details:   https://code.openbravo.com/erp/devel/pi/rev/3b0fb57e7fed
changeset: 30639:3b0fb57e7fed
user:      Mark <markmm82 <at> gmail.com>
date:      Thu Nov 10 14:12:42 2016 -0500
summary:   Fixes issue 34301: "Set new currency" process fixed if multicurrency 
payment

When converting credit already generated in multicurrency payment "Set new
currency" process, generated entries was incorrect.
It includes:
- Update the "Paid (Financial Account)" amount field to be negated just its
  amount is the case.
- Updated the "Paid (Financial Account)" with the generatedCredit amount to
  Payment Generating credit in the new currency as it will be not multicurrency.

diffstat:

 src/org/openbravo/common/actionhandler/SetNewBPCurrency.java |  3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diffs (20 lines):

diff -r 78990dcd4bf3 -r 3b0fb57e7fed 
src/org/openbravo/common/actionhandler/SetNewBPCurrency.java
--- a/src/org/openbravo/common/actionhandler/SetNewBPCurrency.java      Mon Nov 
14 12:25:55 2016 +0100
+++ b/src/org/openbravo/common/actionhandler/SetNewBPCurrency.java      Thu Nov 
10 14:12:42 2016 -0500
@@ -195,6 +195,8 @@
                 + payment1.getDocumentNo());
             payment2.setGeneratedCredit(BigDecimal.ZERO);
             payment2.setUsedCredit(creditAmount);
+            
payment2.setFinancialTransactionAmount(paymentCredit.getFinancialTransactionAmount()
+                .negate());
 
             // Create a payment credit to refund the credit
             FIN_Payment_Credit paymentCredit2 = OBProvider.getInstance().get(
@@ -270,6 +272,7 @@
             payment3.setGeneratedCredit(generatedCredit);
             payment3.setUsedCredit(BigDecimal.ZERO);
             payment3.setFinancialTransactionConvertRate(reverseCreditRate);
+            payment3.setFinancialTransactionAmount(generatedCredit);
 
             // Create a payment detail to create the credit with a glitem
             FIN_PaymentDetail paymentDetail3 = OBProvider.getInstance()

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to