Permalink
Browse files

Merged with trunk 890168.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/branches/addbirt@890174 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
2 parents 51cc364 + 038c875 commit 4c1140c8b24f442dc0fca0cdf356c81ed39957c5 @eigood eigood committed Dec 14, 2009
@@ -4913,7 +4913,7 @@
<value xml:lang="de">Rechnung von Akteur</value>
<value xml:lang="en">Bill From Party</value>
<value xml:lang="es">Participante que factura</value>
- <value xml:lang="fr">Acteur débité</value>
+ <value xml:lang="fr">Acteur crédité</value>
<value xml:lang="it">Fattura Dal Soggetto</value>
<value xml:lang="nl">Facturerende relatie</value>
<value xml:lang="ro">Factura de la Subiect</value>
@@ -4926,7 +4926,7 @@
<value xml:lang="de">Rechnung an Akteur</value>
<value xml:lang="en">Bill To Party</value>
<value xml:lang="es">Participante a quien se factura</value>
- <value xml:lang="fr">Acteur crédité</value>
+ <value xml:lang="fr">Acteur débité</value>
<value xml:lang="it">Fattura Al Soggetto</value>
<value xml:lang="nl">Factuur-relatie</value>
<value xml:lang="ro">Factura la Subiect</value>
@@ -48,6 +48,7 @@ under the License.
<service-resource type="eca" loader="main" location="servicedef/secas.xml"/>
<test-suite loader="main" location="testdef/OrderTest.xml"/>
+ <test-suite loader="main" location="testdef/quotetests.xml"/>
<webapp name="order"
title="Order"
@@ -872,12 +872,10 @@ under the License.
<add-error><fail-message message="ERROR: QuoteWorkEffort [${parameters.quoteId}][${parameters.workEffortId}] already exists."/></add-error>
<check-errors/>
</if-not-empty>
- <if-empty field="quoteWorkEffort.quoteId">
- <set-nonpk-fields map="parameters" value-field="lookupMap"/>
- <create-value value-field="lookupMap"/>
- <field-to-result field="lookupMap.quoteId"/>
- <field-to-result field="lookupMap.workEffortId"/>
- </if-empty>
+ <set-nonpk-fields map="parameters" value-field="lookupMap"/>
+ <create-value value-field="lookupMap"/>
+ <field-to-result field="lookupMap.quoteId" result-name="quoteId"/>
+ <field-to-result field="lookupMap.workEffortId" result-name="workEffortId"/>
</simple-method>
<simple-method method-name="deleteQuoteWorkEffort" short-description="Delete a QuoteWorkEffort">
<make-value entity-name="QuoteWorkEffort" value-field="lookupMap"/>
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
+
+ <simple-method method-name="testCreateQuoteWorkEffort" short-description="Test case for successfully creating a QuoteWorkEffort record." login-required="false">
+ <entity-one entity-name="UserLogin" value-field="serviceCtx.userLogin">
+ <field-map field-name="userLoginId" value="DemoRepStore"/>
+ </entity-one>
+ <set field="serviceCtx.quoteId" value="9000"/>
+ <set field="serviceCtx.workEffortId" value="9007"/>
+
+ <!-- Execute the service -->
+ <call-service service-name="createQuoteWorkEffort" in-map-name="serviceCtx">
+ <results-to-map map-name="serviceResult"/>
+ </call-service>
+
+ <!-- Confirm the service output parameters -->
+ <assert>
+ <if-compare-field field="serviceResult.quoteId" operator="equals" to-field="serviceCtx.quoteId"/>
+ <if-compare-field field="serviceResult.workEffortId" operator="equals" to-field="serviceCtx.workEffortId"/>
+ </assert>
+
+ <!-- Confirm the database changes -->
+ <entity-one value-field="quoteWorkEffort" entity-name="QuoteWorkEffort">
+ <field-map field-name="quoteId" from-field="serviceCtx.quoteId"/>
+ <field-map field-name="workEffortId" from-field="serviceCtx.workEffortId"/>
+ </entity-one>
+ <assert><not><if-empty field="quoteWorkEffort"/></not></assert>
+ <check-errors/>
+ </simple-method>
+
+ <simple-method method-name="testCreateQuoteWorkEffortFail"
+ short-description="Test case for unsuccessfully creating a QuoteWorkEffort record by attempting to use a quoteId and workEffortId that has already been used in an existing QuoteWorkEffortRecord." login-required="false">
+
+ <!-- Use to confirm nothing has changed at the end of the test -->
+ <set field="startTime" value="${date:nowTimestamp()}" type="Timestamp"/>
+
+ <entity-one entity-name="UserLogin" value-field="serviceCtx.userLogin">
+ <field-map field-name="userLoginId" value="DemoRepStore"/>
+ </entity-one>
+
+ <set field="serviceCtx.quoteId" value="9000"/>
+ <set field="serviceCtx.workEffortId" value="9007"/>
+
+ <!-- Execute the service, note break-on-error is false so that the test itself doesn't
+ fail and we also need a separate transaction so our lookup below doesn't fail due to the rollback -->
+ <call-service service-name="createQuoteWorkEffort" in-map-name="serviceCtx"
+ break-on-error="false" require-new-transaction="true">
+ <results-to-map map-name="serviceResult"/>
+ </call-service>
+ <!-- Clear these because break-on-error="false" doesn't seem to work as it should at the moment -->
+ <clear-field field="responseMessage"/>
+ <clear-field field="errorMessageList"/>
+
+ <!-- Confirm the service output parameters, in this case the presence of an error response -->
+ <assert><if-compare field="serviceResult.responseMessage" operator="equals" value="error"/></assert>
+
+ <!-- Confirm the database changes, in this case nothing should have changed -->
+ <entity-condition list="quoteWorkEfforts" entity-name="QuoteWorkEffort">
+ <condition-list>
+ <condition-expr field-name="lastUpdatedStamp" operator="greater-equals" from-field="startTime"/>
+ <condition-expr field-name="quoteId" from-field="serviceCtx.quoteId"/>
+ <condition-expr field-name="workEffortId" from-field="serviceCtx.workEffortId"/>
+ </condition-list>
+ </entity-condition>
+ <!-- Should be empty -->
+ <assert><if-empty field="quoteWorkEffort"/></assert>
+ <check-errors/>
+ </simple-method>
+
+ <simple-method method-name="testCreateWorkEffortAndQuoteWorkEffort" login-required="false"
+ short-description="Test case for calling createQuoteWorkEffort without a workEffortId which triggers an ECA to create the WorkEffort first">
+ <entity-one entity-name="UserLogin" value-field="serviceCtx.userLogin">
+ <field-map field-name="userLoginId" value="flexadmin"/>
+ </entity-one>
+ <!-- Use the bare minimum inputs necessary to create the work effort as we aren't testing that service, only that it plays well as an ECA -->
+ <set field="serviceCtx.currentStatusId" value="ROU_ACTIVE"/>
+ <set field="serviceCtx.workEffortName" value="Test WorkEffort"/>
+ <set field="serviceCtx.workEffortTypeId" value="ROUTING"/>
+ <set field="serviceCtx.quoteId" value="9000"/>
+
+ <call-service service-name="createQuoteWorkEffort" in-map-name="serviceCtx">
+ <results-to-map map-name="serviceResult"/>
+ </call-service>
+
+ <assert>
+ <and>
+ <if-compare-field field="serviceResult.quoteId" operator="equals" to-field="serviceCtx.quoteId"/>
+ <not><if-empty field="serviceResult.workEffortId"/></not>
+ </and>
+ </assert>
+
+ <!-- Confirm that a matching WorkEffort was created -->
+ <entity-and list="workEfforts" entity-name="WorkEffort">
+ <field-map field-name="workEffortId" from-field="serviceResult.workEffortId"/>
+ <field-map field-name="currentStatusId" from-field="serviceCtx.currentStatusId"/>
+ <field-map field-name="workEffortName" from-field="serviceCtx.workEffortName"/>
+ <field-map field-name="workEffortTypeId" from-field="serviceCtx.workEffortTypeId"/>
+ </entity-and>
+ <assert>
+ <not><if-empty field="workEfforts"/></not>
+ </assert>
+
+ <entity-one value-field="quoteWorkEffort" entity-name="QuoteWorkEffort">
+ <field-map field-name="quoteId" from-field="serviceCtx.quoteId"/>
+ <field-map field-name="workEffortId" from-field="serviceResult.workEffortId"/>
+ </entity-one>
+ <check-errors/>
+ </simple-method>
+</simple-methods>
@@ -337,7 +337,7 @@ under the License.
</eca>
<!-- WorkEffort -->
- <eca service="createQuoteWorkEffort" event="invoke">
+ <eca service="createQuoteWorkEffort" event="in-validate">
<condition field-name="workEffortId" operator="is-empty"/>
<action service="createWorkEffort" mode="sync"/>
</eca>
@@ -187,6 +187,7 @@ under the License.
<auto-attributes mode="IN" include="nonpk" optional="true" entity-name="WorkEffort"/>
<auto-attributes mode="INOUT" include="pk" optional="true" entity-name="WorkEffort"/>
<override name="quoteId" optional="false"/>
+ <override name="workEffortId" optional="false"/>
</service>
<service name="deleteQuoteWorkEffort" default-entity-name="QuoteWorkEffort" engine="simple" auth="true"
location="component://order/script/org/ofbiz/order/quote/QuoteServices.xml" invoke="deleteQuoteWorkEffort">
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<entity-engine-xml>
+ <Quote quoteId="9000" quoteTypeId="PRODUCT_QUOTE" partyId="DemoCustomer" issueDate="2009-12-11 12:00:00.000" statusId="QUO_CREATED" currencyUomId="USD" productStoreId="9000" salesChannelEnumId="EMAIL_SALES_CHANNEL" validFromDate="2009-12-11 12:00:00.000" quoteName="Most competitive quote ever"/>
+ <WorkEffort workEffortId="9007" workEffortTypeId="TASK" currentStatusId="PTS_CREATED" workEffortName="Quote WorkEffort"/>
+</entity-engine-xml>
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<test-suite suite-name="quotetests"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/test-suite.xsd">
+
+ <test-case case-name="loadQuoteTestData">
+ <entity-xml action="load" entity-xml-url="component://order/testdef/data/QuoteTestData.xml"/>
+ </test-case>
+
+ <test-case case-name="testCreateQuoteWorkEffort">
+ <simple-method-test location="component://order/script/org/ofbiz/order/test/QuoteTests.xml" name="testCreateQuoteWorkEffort"/>
+ </test-case>
+
+ <test-case case-name="testCreateQuoteWorkEffortFail">
+ <simple-method-test location="component://order/script/org/ofbiz/order/test/QuoteTests.xml" name="testCreateQuoteWorkEffortFail"/>
+ </test-case>
+
+ <test-case case-name="testCreateWorkEffortAndQuoteWorkEffort">
+ <simple-method-test location="component://order/script/org/ofbiz/order/test/QuoteTests.xml" name="testCreateWorkEffortAndQuoteWorkEffort"/>
+ </test-case>
+</test-suite>
@@ -20,17 +20,17 @@ under the License.
<#if orderHeader?has_content>
<fo:table border-spacing="3pt">
- <fo:table-column column-width="3.5in"/>
+ <fo:table-column column-width="4in"/>
<fo:table-column column-width="1in"/>
<fo:table-column column-width="1in"/>
<fo:table-column column-width="1in"/>
<fo:table-header>
<fo:table-row>
<fo:table-cell><fo:block font-weight="bold">${uiLabelMap.OrderProduct}</fo:block></fo:table-cell>
- <fo:table-cell text-align="center"><fo:block font-weight="bold">${uiLabelMap.OrderQuantity}</fo:block></fo:table-cell>
- <fo:table-cell text-align="center"><fo:block font-weight="bold">${uiLabelMap.OrderUnitList}</fo:block></fo:table-cell>
- <fo:table-cell text-align="center"><fo:block font-weight="bold">${uiLabelMap.OrderSubTotal}</fo:block></fo:table-cell>
+ <fo:table-cell text-align="right"><fo:block font-weight="bold">${uiLabelMap.OrderQuantity}</fo:block></fo:table-cell>
+ <fo:table-cell text-align="right"><fo:block font-weight="bold">${uiLabelMap.OrderUnitList}</fo:block></fo:table-cell>
+ <fo:table-cell text-align="right"><fo:block font-weight="bold">${uiLabelMap.OrderSubTotal}</fo:block></fo:table-cell>
</fo:table-row>
</fo:table-header>
@@ -63,7 +63,7 @@ under the License.
</fo:table-row>
<#if itemAdjustment != 0>
<fo:table-row>
- <fo:table-cell number-columns-spanned="2"><fo:block><fo:inline font-style="italic">${uiLabelMap.OrderAdjustments}</fo:inline>: <@ofbizCurrency amount=itemAdjustment isoCode=currencyUomId/></fo:block></fo:table-cell>
+ <fo:table-cell number-columns-spanned="2"><fo:block text-indent="0.2in"><fo:inline font-style="italic">${uiLabelMap.OrderAdjustments}</fo:inline>: <@ofbizCurrency amount=itemAdjustment isoCode=currencyUomId/></fo:block></fo:table-cell>
</fo:table-row>
</#if>
</#list>
@@ -17,6 +17,38 @@ specific language governing permissions and limitations
under the License.
-->
<#escape x as x?xml>
+
+<#if shipGroups?exists && shipGroups.size() gt 1>
+ <fo:table border-spacing="3pt" space-before="0.3in" font-size="9pt">
+ <fo:table-column column-width="1in"/>
+ <fo:table-column column-width="1in"/>
+ <fo:table-column column-width="0.5in"/>
+ <fo:table-header>
+ <fo:table-row font-weight="bold">
+ <fo:table-cell><fo:block>${uiLabelMap.OrderShipGroup}</fo:block></fo:table-cell>
+ <fo:table-cell><fo:block>${uiLabelMap.OrderProduct}</fo:block></fo:table-cell>
+ <fo:table-cell text-align="right"><fo:block>${uiLabelMap.OrderQuantity}</fo:block></fo:table-cell>
+ </fo:table-row>
+ </fo:table-header>
+ <fo:table-body>
+ <#list shipGroups as shipGroup>
+ <#assign orderItemShipGroupAssocs = shipGroup.getRelated("OrderItemShipGroupAssoc")?if_exists>
+ <#if orderItemShipGroupAssocs?has_content>
+ <#list orderItemShipGroupAssocs as shipGroupAssoc>
+ <#assign orderItem = shipGroupAssoc.getRelatedOne("OrderItem")?if_exists>
+ <fo:table-row>
+ <fo:table-cell><fo:block>${shipGroup.shipGroupSeqId}</fo:block></fo:table-cell>
+ <fo:table-cell><fo:block>${orderItem.productId?if_exists}</fo:block></fo:table-cell>
+ <fo:table-cell text-align="right"><fo:block>${shipGroupAssoc.quantity?string.number}</fo:block></fo:table-cell>
+ </fo:table-row>
+ </#list>
+ </#if>
+ </#list>
+ </fo:table-body>
+ </fo:table>
+</#if>
+
+
<fo:block space-after="40pt"/>
<#if orderHeader.getString("orderTypeId") == "SALES_ORDER">
<fo:block font-size="14pt" font-weight="bold" text-align="center">THANK YOU FOR YOUR PATRONAGE!</fo:block>
Oops, something went wrong.

0 comments on commit 4c1140c

Please sign in to comment.