Author: hansbak
Date: Tue Jun 25 02:09:11 2013
New Revision: 1496337

URL: http://svn.apache.org/r1496337
Log:
additional changes belonging to 1495294 because the amount was set wrongly

Modified:
    
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml

Modified: 
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml?rev=1496337&r1=1496336&r2=1496337&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml
 (original)
+++ 
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml
 Tue Jun 25 02:09:11 2013
@@ -1054,7 +1054,12 @@ under the License.
                     <if-empty field="paymentAppls">
                         <set field="createAppl.paymentId" 
from-field="payments[0].paymentId"/>
                         <set field="createAppl.invoiceId" 
from-field="parameters.invoiceId"/>
-                        <set field="createAppl.amountApplied" 
from-field="invoiceTotal"/>
+                        <if-compare operator="equals" value="true" 
field="isForeign">
+                            <set field="createAppl.amountApplied" 
from-field="payments[0].actualCurrencyAmount"/>
+                            <else>
+                                <set field="createAppl.amountApplied" 
from-field="payments[0].amount"/>
+                            </else>
+                        </if-compare>
                     </if-empty>
                 </if-not-empty>
             </if-not-empty>
@@ -1088,12 +1093,14 @@ under the License.
                         <if-compare-field operator="equals" 
field="invoiceTotal" to-field="payment.actualCurrencyAmount">
                             <if-compare-field operator="equals" 
field="invoice.currencyUomId" to-field="payment.actualCurrencyUomId">
                                 <set field="invoiceId" 
from-field="invoice.invoiceId"/>
+                                <set field="amountApplied" 
from-field="payment.actualCurrencyAmount"/>
                             </if-compare-field>                
                         </if-compare-field>                
                         <else>
                             <if-compare-field operator="equals" 
field="invoiceTotal" to-field="payment.amount">
                                 <if-compare-field operator="equals" 
field="invoice.currencyUomId" to-field="payment.currencyUomId">
                                     <set field="invoiceId" 
from-field="invoice.invoiceId"/>
+                                    <set field="amountApplied" 
from-field="payment.amount"/>
                                 </if-compare-field>                
                             </if-compare-field>                
                         </else>
@@ -1106,7 +1113,7 @@ under the License.
                     <if-empty field="paymentAppls">
                         <set field="createAppl.paymentId" 
from-field="parameters.paymentId"/>
                         <set field="createAppl.invoiceId" 
from-field="invoiceId"/>
-                        <set field="createAppl.amountApplied" 
from-field="payment.amount"/>
+                        <set field="createAppl.amountApplied" 
from-field="amountApplied"/>
                     </if-empty>
                 </if-not-empty>
             </if-not-empty>


Reply via email to