svn commit: r1496721 - /ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1496721 - /ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml

hansbak-2
Author: hansbak
Date: Wed Jun 26 03:15:41 2013
New Revision: 1496721

URL: http://svn.apache.org/r1496721
Log:
not possible anymore to change generic entity maps. message: Cannot modify an immutable entity object. Quantity in invoiceItem was modified, now copied to other variable

Modified:
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml

Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml?rev=1496721&r1=1496720&r2=1496721&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml Wed Jun 26 03:15:41 2013
@@ -1927,13 +1927,14 @@ under the License.
             <iterate list="invoiceItems" entry="invoiceItem">
                 <set field="amountFromOrder" type="BigDecimal" value="0"/>
                 <set field="amountFromInvoice" type="BigDecimal" value="0"/>
-                <if-empty field="invoiceItem.quantity">
-                    <set field="invoiceItem.quantity" value="1"/>
-                </if-empty>
+                <set field="quantity" type="BigDecimal" value="1"/>
+                <if-not-empty field="invoiceItem.quantity">
+                    <set field="quantity" from-field="invoiceItem.quantity"/>
+                </if-not-empty>
                 <!-- This InvoiceItem amount. -->
                 <calculate field="amountFromInvoice"  decimal-scale="${ledgerDecimals}" rounding-mode="${roundingMode}">
                     <calcop operator="multiply">
-                        <calcop operator="get" field="invoiceItem.quantity"/>
+                        <calcop operator="get" field="quantity"/>
                         <calcop operator="get" field="invoiceItem.amount"/>
                     </calcop>
                 </calculate>
@@ -2051,12 +2052,13 @@ under the License.
             <iterate list="invoiceItems" entry="invoiceItem">
                 <set field="amountFromOrder" type="BigDecimal" value="0"/>
                 <set field="amountFromInvoice" type="BigDecimal" value="0"/>
-                <if-empty field="invoiceItem.quantity">
-                    <set field="invoiceItem.quantity" value="1"/>
-                </if-empty>
+                <set field="quantity" type="BigDecimal" value="1"/>
+                <if-not-empty field="invoiceItem.quantity">
+                    <set field="quantity" from-field="invoiceItem.quantity"/>
+                </if-not-empty>
                 <calculate field="amountFromInvoice"  decimal-scale="${ledgerDecimals}" rounding-mode="${roundingMode}">
                     <calcop operator="multiply">
-                        <calcop operator="get" field="invoiceItem.quantity"/>
+                        <calcop operator="get" field="quantity"/>
                         <calcop operator="get" field="invoiceItem.amount"/>
                     </calcop>
                 </calculate>
@@ -2215,12 +2217,13 @@ under the License.
             </entity-condition>
             <iterate list="invoiceItems" entry="invoiceItem">
                 <!-- TODO: handle serialized inventory -->
-                <if-empty field="invoiceItem.quantity">
-                    <set field="invoiceItem.quantity" type="BigDecimal" value="1"/>
-                </if-empty>
+                <set field="quantity" type="BigDecimal" value="1"/>
+                <if-not-empty field="invoiceItem.quantity">
+                    <set field="quantity" from-field="invoiceItem.quantity"/>
+                </if-not-empty>
                 <calculate field="origAmount" decimal-scale="${ledgerDecimals}" rounding-mode="${roundingMode}">
                     <calcop operator="multiply">
-                        <calcop operator="get" field="invoiceItem.quantity"/>
+                        <calcop operator="get" field="quantity"/>
                         <calcop operator="get" field="invoiceItem.amount"/>
                     </calcop>
                 </calculate>