Author: jleroux
Date: Fri Mar 10 12:23:29 2017
New Revision: 1786332

URL: http://svn.apache.org/viewvc?rev=1786332&view=rev
Log:
Fixed: compareBigDecimals in org.ofbiz.minilang.method.conditional.Compare does 
not compare certain values correctly
(OFBIZ-)

After fixing the issue  in
trunk r1786079
R16.11 r1786080
R15.12 r1786082

These tests were broken
auto-invoice-tests.testGlPostingOnCancelCheckRun
auto-payment-tests.testGlPostingOnCheckRun

This is due to expressions like this
<set field="totalPayableDebitAmount" value="${payableDebitTotal + 36.43}" 
type="BigDecimal"/>

Using a local BigDecimal fixes the problem

Modified:
    
ofbiz/branches/release15.12/applications/accounting/script/org/ofbiz/accounting/test/AutoInvoiceTests.xml
    
ofbiz/branches/release15.12/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml
    
ofbiz/branches/release16.11/applications/accounting/minilang/test/AutoInvoiceTests.xml
    
ofbiz/branches/release16.11/applications/accounting/minilang/test/AutoPaymentTests.xml
    
ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/test/AutoInvoiceTests.xml
    
ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/test/AutoPaymentTests.xml

Modified: 
ofbiz/branches/release15.12/applications/accounting/script/org/ofbiz/accounting/test/AutoInvoiceTests.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/release15.12/applications/accounting/script/org/ofbiz/accounting/test/AutoInvoiceTests.xml?rev=1786332&r1=1786331&r2=1786332&view=diff
==============================================================================
--- 
ofbiz/branches/release15.12/applications/accounting/script/org/ofbiz/accounting/test/AutoInvoiceTests.xml
 (original)
+++ 
ofbiz/branches/release15.12/applications/accounting/script/org/ofbiz/accounting/test/AutoInvoiceTests.xml
 Fri Mar 10 12:23:29 2017
@@ -295,9 +295,11 @@ under the License.
         <first-from-list list="paymentGroupMemberAndTransList" 
entry="paymentGroupMemberAndTrans"/>
         <if-compare field="paymentGroupMemberAndTrans.finAccountTransStatusId" 
operator="not-equals" value="FINACT_TRNS_APPROVED">
 
-        <set field="totalPayableDebitAmount" value="${payableDebitTotal + 
82.86}" type="BigDecimal"/>
-        <set field="totalPayableCreditAmount" value="${payableCreditTotal + 
165.72}" type="BigDecimal"/>
-        <set field="totalPayableDebitCreditDifference" 
value="${payableDebitCreditDifference - 82.86}" type="BigDecimal"/>
+        <set field="tempBig" value="82.86" type="BigDecimal"/><!-- Necessary, 
see OFBIZ-6386 -->
+        <set field="totalPayableDebitAmount" value="${payableDebitTotal + 
tempBig}" type="BigDecimal"/>
+        <set field="totalPayableCreditAmount" value="165.72" 
type="BigDecimal"/>
+        <set field="totalPayableCreditAmount" value="${payableCreditTotal + 
totalPayableCreditAmount}" type="BigDecimal"/>
+        <set field="totalPayableDebitCreditDifference" 
value="${payableDebitCreditDifference - tempBig}" type="BigDecimal"/>
         <set field="getAcctgTransEntriesAndTransTotalMap.glAccountId" 
value="210000"/>
         <call-service service-name="getAcctgTransEntriesAndTransTotal" 
in-map-name="getAcctgTransEntriesAndTransTotalMap">
             <result-to-field result-name="debitTotal" 
field="payableDebitTotal"/>
@@ -311,8 +313,8 @@ under the License.
             <if-compare-field field="totalPayableDebitCreditDifference" 
operator="equals" to-field="payableDebitCreditDifference" type="BigDecimal"/>
         </assert>
         <check-errors/>
-        <set field="totalUndepositedDebitAmount" 
value="${undepositedDebitTotal + 82.86}" type="BigDecimal"/>
-        <set field="totalUndepositedDebitCreditDifference" 
value="${undepositedDebitCreditDifference + 82.86}" type="BigDecimal"/>
+        <set field="totalUndepositedDebitAmount" 
value="${undepositedDebitTotal + tempBig}" type="BigDecimal"/>
+        <set field="totalUndepositedDebitCreditDifference" 
value="${undepositedDebitCreditDifference + tempBig}" type="BigDecimal"/>
         <set field="getAcctgTransEntriesAndTransTotalMap.glAccountId" 
value="111100"/>
         <call-service service-name="getAcctgTransEntriesAndTransTotal" 
in-map-name="getAcctgTransEntriesAndTransTotalMap">
             <result-to-field result-name="debitTotal" 
field="undepositedDebitTotal"/>

Modified: 
ofbiz/branches/release15.12/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/release15.12/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml?rev=1786332&r1=1786331&r2=1786332&view=diff
==============================================================================
--- 
ofbiz/branches/release15.12/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml
 (original)
+++ 
ofbiz/branches/release15.12/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml
 Fri Mar 10 12:23:29 2017
@@ -469,9 +469,10 @@ under the License.
         <call-service service-name="createPaymentAndPaymentGroupForInvoices" 
in-map-name="createPaymentAndPaymentGroupForInvoicesMap">
             <result-to-field result-name="paymentGroupId"/>
         </call-service>
-        <set field="totalPayableDebitAmount" value="${payableDebitTotal + 
36.43}" type="BigDecimal"/>
+        <set field="tempBig" value="36.43" type="BigDecimal"/><!-- Necessary, 
see OFBIZ-6386 -->
+        <set field="totalPayableDebitAmount" value="${payableDebitTotal + 
tempBig}" type="BigDecimal"/>
         <set field="totalPayableCreditAmount" from-field="payableCreditTotal" 
type="BigDecimal"/>
-        <set field="totalPayableDebitCreditDifference" 
value="${payableDebitCreditDifference + 36.43}" type="BigDecimal"/>
+        <set field="totalPayableDebitCreditDifference" 
value="${payableDebitCreditDifference + tempBig}" type="BigDecimal"/>
         <set field="getAcctgTransEntriesAndTransTotalMap.glAccountId" 
value="210000"/>
         <call-service service-name="getAcctgTransEntriesAndTransTotal" 
in-map-name="getAcctgTransEntriesAndTransTotalMap">
             <result-to-field result-name="debitTotal" 
field="payableDebitTotal"/>
@@ -484,8 +485,8 @@ under the License.
             <if-compare-field field="totalPayableDebitCreditDifference" 
operator="equals" to-field="payableDebitCreditDifference" type="BigDecimal"/>
         </assert>
         <check-errors/>
-        <set field="totalUndepositedCreditAmount" 
value="${undepositedCreditTotal + 36.43}" type="BigDecimal"/>
-        <set field="totalUndepositedDebitCreditDifference" 
value="${undepositedDebitCreditDifference - 36.43}" type="BigDecimal"/>
+        <set field="totalUndepositedCreditAmount" 
value="${undepositedCreditTotal + tempBig}" type="BigDecimal"/>
+        <set field="totalUndepositedDebitCreditDifference" 
value="${undepositedDebitCreditDifference - tempBig}" type="BigDecimal"/>
         <set field="getAcctgTransEntriesAndTransTotalMap.glAccountId" 
value="111100"/>
         <call-service service-name="getAcctgTransEntriesAndTransTotal" 
in-map-name="getAcctgTransEntriesAndTransTotalMap">
             <result-to-field result-name="debitTotal" 
field="undepositedDebitTotal"/>

Modified: 
ofbiz/branches/release16.11/applications/accounting/minilang/test/AutoInvoiceTests.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/release16.11/applications/accounting/minilang/test/AutoInvoiceTests.xml?rev=1786332&r1=1786331&r2=1786332&view=diff
==============================================================================
--- 
ofbiz/branches/release16.11/applications/accounting/minilang/test/AutoInvoiceTests.xml
 (original)
+++ 
ofbiz/branches/release16.11/applications/accounting/minilang/test/AutoInvoiceTests.xml
 Fri Mar 10 12:23:29 2017
@@ -295,9 +295,11 @@ under the License.
         <first-from-list list="paymentGroupMemberAndTransList" 
entry="paymentGroupMemberAndTrans"/>
         <if-compare field="paymentGroupMemberAndTrans.finAccountTransStatusId" 
operator="not-equals" value="FINACT_TRNS_APPROVED">
 
-        <set field="totalPayableDebitAmount" value="${payableDebitTotal + 
82.86}" type="BigDecimal"/>
-        <set field="totalPayableCreditAmount" value="${payableCreditTotal + 
165.72}" type="BigDecimal"/>
-        <set field="totalPayableDebitCreditDifference" 
value="${payableDebitCreditDifference - 82.86}" type="BigDecimal"/>
+        <set field="tempBig" value="82.86" type="BigDecimal"/><!-- Necessary, 
see OFBIZ-6386 -->
+        <set field="totalPayableDebitAmount" value="${payableDebitTotal + 
tempBig}" type="BigDecimal"/>
+        <set field="totalPayableCreditAmount" value="165.72" 
type="BigDecimal"/>
+        <set field="totalPayableCreditAmount" value="${payableCreditTotal + 
totalPayableCreditAmount}" type="BigDecimal"/>
+        <set field="totalPayableDebitCreditDifference" 
value="${payableDebitCreditDifference - tempBig}" type="BigDecimal"/>
         <set field="getAcctgTransEntriesAndTransTotalMap.glAccountId" 
value="210000"/>
         <call-service service-name="getAcctgTransEntriesAndTransTotal" 
in-map-name="getAcctgTransEntriesAndTransTotalMap">
             <result-to-field result-name="debitTotal" 
field="payableDebitTotal"/>
@@ -311,8 +313,8 @@ under the License.
             <if-compare-field field="totalPayableDebitCreditDifference" 
operator="equals" to-field="payableDebitCreditDifference" type="BigDecimal"/>
         </assert>
         <check-errors/>
-        <set field="totalUndepositedDebitAmount" 
value="${undepositedDebitTotal + 82.86}" type="BigDecimal"/>
-        <set field="totalUndepositedDebitCreditDifference" 
value="${undepositedDebitCreditDifference + 82.86}" type="BigDecimal"/>
+        <set field="totalUndepositedDebitAmount" 
value="${undepositedDebitTotal + tempBig}" type="BigDecimal"/>
+        <set field="totalUndepositedDebitCreditDifference" 
value="${undepositedDebitCreditDifference + tempBig}" type="BigDecimal"/>
         <set field="getAcctgTransEntriesAndTransTotalMap.glAccountId" 
value="111100"/>
         <call-service service-name="getAcctgTransEntriesAndTransTotal" 
in-map-name="getAcctgTransEntriesAndTransTotalMap">
             <result-to-field result-name="debitTotal" 
field="undepositedDebitTotal"/>

Modified: 
ofbiz/branches/release16.11/applications/accounting/minilang/test/AutoPaymentTests.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/release16.11/applications/accounting/minilang/test/AutoPaymentTests.xml?rev=1786332&r1=1786331&r2=1786332&view=diff
==============================================================================
--- 
ofbiz/branches/release16.11/applications/accounting/minilang/test/AutoPaymentTests.xml
 (original)
+++ 
ofbiz/branches/release16.11/applications/accounting/minilang/test/AutoPaymentTests.xml
 Fri Mar 10 12:23:29 2017
@@ -469,9 +469,10 @@ under the License.
         <call-service service-name="createPaymentAndPaymentGroupForInvoices" 
in-map-name="createPaymentAndPaymentGroupForInvoicesMap">
             <result-to-field result-name="paymentGroupId"/>
         </call-service>
-        <set field="totalPayableDebitAmount" value="${payableDebitTotal + 
36.43}" type="BigDecimal"/>
+        <set field="tempBig" value="36.43" type="BigDecimal"/><!-- Necessary, 
see OFBIZ-6386 -->
+        <set field="totalPayableDebitAmount" value="${payableDebitTotal + 
tempBig}" type="BigDecimal"/>
         <set field="totalPayableCreditAmount" from-field="payableCreditTotal" 
type="BigDecimal"/>
-        <set field="totalPayableDebitCreditDifference" 
value="${payableDebitCreditDifference + 36.43}" type="BigDecimal"/>
+        <set field="totalPayableDebitCreditDifference" 
value="${payableDebitCreditDifference + tempBig}" type="BigDecimal"/>
         <set field="getAcctgTransEntriesAndTransTotalMap.glAccountId" 
value="210000"/>
         <call-service service-name="getAcctgTransEntriesAndTransTotal" 
in-map-name="getAcctgTransEntriesAndTransTotalMap">
             <result-to-field result-name="debitTotal" 
field="payableDebitTotal"/>
@@ -484,8 +485,8 @@ under the License.
             <if-compare-field field="totalPayableDebitCreditDifference" 
operator="equals" to-field="payableDebitCreditDifference" type="BigDecimal"/>
         </assert>
         <check-errors/>
-        <set field="totalUndepositedCreditAmount" 
value="${undepositedCreditTotal + 36.43}" type="BigDecimal"/>
-        <set field="totalUndepositedDebitCreditDifference" 
value="${undepositedDebitCreditDifference - 36.43}" type="BigDecimal"/>
+        <set field="totalUndepositedCreditAmount" 
value="${undepositedCreditTotal + tempBig}" type="BigDecimal"/>
+        <set field="totalUndepositedDebitCreditDifference" 
value="${undepositedDebitCreditDifference - tempBig}" type="BigDecimal"/>
         <set field="getAcctgTransEntriesAndTransTotalMap.glAccountId" 
value="111100"/>
         <call-service service-name="getAcctgTransEntriesAndTransTotal" 
in-map-name="getAcctgTransEntriesAndTransTotalMap">
             <result-to-field result-name="debitTotal" 
field="undepositedDebitTotal"/>

Modified: 
ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/test/AutoInvoiceTests.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/test/AutoInvoiceTests.xml?rev=1786332&r1=1786331&r2=1786332&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/test/AutoInvoiceTests.xml
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/test/AutoInvoiceTests.xml
 Fri Mar 10 12:23:29 2017
@@ -295,9 +295,11 @@ under the License.
         <first-from-list list="paymentGroupMemberAndTransList" 
entry="paymentGroupMemberAndTrans"/>
         <if-compare field="paymentGroupMemberAndTrans.finAccountTransStatusId" 
operator="not-equals" value="FINACT_TRNS_APPROVED">
 
-        <set field="totalPayableDebitAmount" value="${payableDebitTotal + 
82.86}" type="BigDecimal"/>
-        <set field="totalPayableCreditAmount" value="${payableCreditTotal + 
165.72}" type="BigDecimal"/>
-        <set field="totalPayableDebitCreditDifference" 
value="${payableDebitCreditDifference - 82.86}" type="BigDecimal"/>
+        <set field="tempBig" value="82.86" type="BigDecimal"/><!-- Necessary, 
see OFBIZ-6386 -->
+        <set field="totalPayableDebitAmount" value="${payableDebitTotal + 
tempBig}" type="BigDecimal"/>
+        <set field="totalPayableCreditAmount" value="165.72" 
type="BigDecimal"/>
+        <set field="totalPayableCreditAmount" value="${payableCreditTotal + 
totalPayableCreditAmount}" type="BigDecimal"/>
+        <set field="totalPayableDebitCreditDifference" 
value="${payableDebitCreditDifference - tempBig}" type="BigDecimal"/>
         <set field="getAcctgTransEntriesAndTransTotalMap.glAccountId" 
value="210000"/>
         <call-service service-name="getAcctgTransEntriesAndTransTotal" 
in-map-name="getAcctgTransEntriesAndTransTotalMap">
             <result-to-field result-name="debitTotal" 
field="payableDebitTotal"/>
@@ -311,8 +313,8 @@ under the License.
             <if-compare-field field="totalPayableDebitCreditDifference" 
operator="equals" to-field="payableDebitCreditDifference" type="BigDecimal"/>
         </assert>
         <check-errors/>
-        <set field="totalUndepositedDebitAmount" 
value="${undepositedDebitTotal + 82.86}" type="BigDecimal"/>
-        <set field="totalUndepositedDebitCreditDifference" 
value="${undepositedDebitCreditDifference + 82.86}" type="BigDecimal"/>
+        <set field="totalUndepositedDebitAmount" 
value="${undepositedDebitTotal + tempBig}" type="BigDecimal"/>
+        <set field="totalUndepositedDebitCreditDifference" 
value="${undepositedDebitCreditDifference + tempBig}" type="BigDecimal"/>
         <set field="getAcctgTransEntriesAndTransTotalMap.glAccountId" 
value="111100"/>
         <call-service service-name="getAcctgTransEntriesAndTransTotal" 
in-map-name="getAcctgTransEntriesAndTransTotalMap">
             <result-to-field result-name="debitTotal" 
field="undepositedDebitTotal"/>

Modified: 
ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/test/AutoPaymentTests.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/test/AutoPaymentTests.xml?rev=1786332&r1=1786331&r2=1786332&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/test/AutoPaymentTests.xml
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/test/AutoPaymentTests.xml
 Fri Mar 10 12:23:29 2017
@@ -469,9 +469,10 @@ under the License.
         <call-service service-name="createPaymentAndPaymentGroupForInvoices" 
in-map-name="createPaymentAndPaymentGroupForInvoicesMap">
             <result-to-field result-name="paymentGroupId"/>
         </call-service>
-        <set field="totalPayableDebitAmount" value="${payableDebitTotal + 
36.43}" type="BigDecimal"/>
+        <set field="tempBig" value="36.43" type="BigDecimal"/><!-- Necessary, 
see OFBIZ-6386 -->
+        <set field="totalPayableDebitAmount" value="${payableDebitTotal + 
tempBig}" type="BigDecimal"/>
         <set field="totalPayableCreditAmount" from-field="payableCreditTotal" 
type="BigDecimal"/>
-        <set field="totalPayableDebitCreditDifference" 
value="${payableDebitCreditDifference + 36.43}" type="BigDecimal"/>
+        <set field="totalPayableDebitCreditDifference" 
value="${payableDebitCreditDifference + tempBig}" type="BigDecimal"/>
         <set field="getAcctgTransEntriesAndTransTotalMap.glAccountId" 
value="210000"/>
         <call-service service-name="getAcctgTransEntriesAndTransTotal" 
in-map-name="getAcctgTransEntriesAndTransTotalMap">
             <result-to-field result-name="debitTotal" 
field="payableDebitTotal"/>
@@ -484,8 +485,8 @@ under the License.
             <if-compare-field field="totalPayableDebitCreditDifference" 
operator="equals" to-field="payableDebitCreditDifference" type="BigDecimal"/>
         </assert>
         <check-errors/>
-        <set field="totalUndepositedCreditAmount" 
value="${undepositedCreditTotal + 36.43}" type="BigDecimal"/>
-        <set field="totalUndepositedDebitCreditDifference" 
value="${undepositedDebitCreditDifference - 36.43}" type="BigDecimal"/>
+        <set field="totalUndepositedCreditAmount" 
value="${undepositedCreditTotal + tempBig}" type="BigDecimal"/>
+        <set field="totalUndepositedDebitCreditDifference" 
value="${undepositedDebitCreditDifference - tempBig}" type="BigDecimal"/>
         <set field="getAcctgTransEntriesAndTransTotalMap.glAccountId" 
value="111100"/>
         <call-service service-name="getAcctgTransEntriesAndTransTotal" 
in-map-name="getAcctgTransEntriesAndTransTotalMap">
             <result-to-field result-name="debitTotal" 
field="undepositedDebitTotal"/>


Reply via email to