Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0041880Openbravo ERP09. Financial managementpublic2019-09-25 02:432019-12-31 10:51
agonzalez 
markmm82 
normalmajorhave not tried
closedfixed 
5
3.0PR17Q2.4 
3.0PR20Q1 
aferraz
Google Chrome
Core
No
0041880: Error on window Match Statements for operations with different currencies.
When using different currencies and adding a payment to a transaction inside a Match using the "Match Statements" functionality inside Financial Account window, the "Actual Payment" field does not changes when inserting another currency.

The "Actual Payment" field should change depending on the currency selected, but it's only showing the amount converted to the bank account currency. This cause the "Converted Amount" showing incorrect values when using another currency and making impossible to create a payment in other currency that the one configured on the bank.

Livebuild reproduction:
https://drive.google.com/file/d/1Hs71_itP0eDg3obXqqBvDBaGsYkeuxsl/view [^]
Note: The payment method used has to have enabled the "Receive payments in multiple currencies" and the "Make payments in multiple currencies" checks.

1. Go to Financial Account window
2. Select a Financial Account with type "Bank" that contains more than one bank statement lines
3. Click on "Match Statements" button to open the pop-up
4. Select a match (The price will be displayed on the bank account currency)
5. Click on "Add transaction" button
6. Add a new payment through the "Plus" button on the "Payment" field.
7. Select a payment method with multiple currencies payment capabilities.
At this point, it will be displayed by default the currency configured at the bank account.
8. Select another currency
9. The currency will not be converted on the field "Actual Payment" method, showing the currency assigned by default (the currency of the bank) making unable to create a payment for another currency and setting up an incorrect value on "Converted Amount".
Update the "Actual Payment" field when the currency changes.
No tags attached.
Issue History
2019-09-25 02:43agonzalezNew Issue
2019-09-25 02:43agonzalezAssigned To => Triage Finance
2019-09-25 02:43agonzalezWeb browser => Google Chrome
2019-09-25 02:43agonzalezModules => Core
2019-09-25 02:43agonzalezTriggers an Emergency Pack => No
2019-09-25 03:17mgonzalezhIssue Monitored: mgonzalezh
2019-10-21 17:12lbressanWeb browserGoogle Chrome => Google Chrome
2019-10-21 17:12lbressanResolution time => 1572822000
2019-10-21 17:36SandrahuguetAssigned ToTriage Finance => markmm82
2019-10-22 03:11markmm82Statusnew => scheduled
2019-10-23 05:57markmm82Note Added: 0115238
2019-10-23 22:06markmm82Note Edited: 0115238bug_revision_view_page.php?bugnote_id=0115238#r19556
2019-10-29 12:46SandrahuguetWeb browserGoogle Chrome => Google Chrome
2019-10-29 12:46SandrahuguetResolution time1572822000 => 1573426800
2019-11-13 12:46hgbotCheckin
2019-11-13 12:46hgbotNote Added: 0115574
2019-11-13 12:46hgbotStatusscheduled => resolved
2019-11-13 12:46hgbotResolutionopen => fixed
2019-11-13 12:46hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/e1420ea3bd437e19c1e28cfeac92de55be882974 [^]
2019-11-13 12:46hgbotCheckin
2019-11-13 12:46hgbotNote Added: 0115575
2019-11-13 12:46aferrazReview Assigned To => aferraz
2019-11-13 12:46aferrazNote Added: 0115576
2019-11-13 12:46aferrazStatusresolved => closed
2019-11-13 12:46aferrazFixed in Version => 3.0PR20Q1
2019-11-18 22:38markmm82Note Added: 0115675
2019-11-19 09:20aferrazNote Edited: 0115675bug_revision_view_page.php?bugnote_id=0115675#r19724
2019-11-19 09:25aferrazNote Edited: 0115675bug_revision_view_page.php?bugnote_id=0115675#r19725
2019-12-12 23:01hudsonbotCheckin
2019-12-12 23:01hudsonbotNote Added: 0116280
2019-12-12 23:01hudsonbotCheckin
2019-12-12 23:01hudsonbotNote Added: 0116281
2019-12-31 10:51hgbotCheckin
2019-12-31 10:51hgbotNote Added: 0116586

Notes
(0115238)
markmm82   
2019-10-23 05:57   
(edited on: 2019-10-23 22:06)
Test PLan:

Go to Price List window and create a new Purchase price list header:
  Organization = F&B US, Inc.
  Name = Be Soft Drinker Price List EUR
  Currency = EUR
Add a new Price List Version to it.
Add a Product Price to Cherry Cola:
  Product = Cherry Cola
  Unit Price = List Price = 0.50

Go to Purchase Invoice window and create a new header.
  Organization = F&B US, Inc.
  Business Partner = Be Soft Drinker, Inc.
  Payment Method = Wire Transfer
  Price List = Be Soft Drinker Price List EUR

Add a line to it:
  Product = Cherry Cola
  Quantity = 100
  Unit Price = 0.50

Complete the Invoice.
  Notice we have a Total Amount of 50 EUR (equivalent to 57 USD with a conversion rate of 1.14)

Go to Financial Account window and select Bank - Account 2.
Set Matching Algorithm = Standard.

Go to Payment Method Tab and select Wire Transfer.
Configure to accept/make payments in multi currencies.
  Receive Payments in Multiple Currencies = Yes
  Make Payments in Multiple Currencies.

Go to Imported Bank Statements tab and create a new one.
Go to Bank Statement Lines and create a new one to be matched with the previously created invoice:
  Business Partner = Be Soft Drinker, Inc.
  Amount OUT = 57 USD (It is the equivalent to 50 EUR if we convert it using a conversion rate of 1.14)
Process the Bank Statement.

Click on "Match Statements" button to open the pop-up
Select a match (The price will be displayed on the bank account currency)
Click on "Add transaction" button
Go to add a new payment through the "Plus" button on the "Payment" field.

At this point, it will be displayed by default the currency configured at the bank account in this case it shows 57 USD as Actual Payment.

Select another currency, for example EUR.
Notice Actual Payment was updated to 50 EUR.
The conversion rate from EUR to USD can vary according date, in our case it is having a conversion rate of 1.17 so the converted amount is 58.50.

Change the currency to USD.
Notice Actual Payment was updated to 57 USD.

Change the currency to EUR.
Notice Actual Payment was updated to 50 EUR.

As we want to match the invoice amount and the bank statement with the same rate, we are going to change the conversion rate to 1.14.
Notice the converted amount was updated to 57.00 USD.
Press Done.

Press Done again and notice the Match was successfully and the statement dissapears from pending to be matched.

(0115574)
hgbot   
2019-11-13 12:46   
Repository: erp/devel/pi
Changeset: e1420ea3bd437e19c1e28cfeac92de55be882974
Author: Mark Molina <mark.molina <at> doceleguas.com>
Date: Sun Nov 10 17:26:49 2019 -0300
URL: http://code.openbravo.com/erp/devel/pi/rev/e1420ea3bd437e19c1e28cfeac92de55be882974 [^]

Fixes issue 41880: Actual Payment updated in Match Statements for operations
with different currencies.

Fixed the updation of the actual payment with the value of the bslamount converted
to the same currency and using the defined conversion rate.

Created a new function to update an amount with the current currency and precision.
The new converted amount shold be calculated multiplying or dividing by the currency
exchange rate according the conversion is direct or inverse.

---
M modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js
---
(0115575)
hgbot   
2019-11-13 12:46   
Repository: erp/devel/pi
Changeset: 0afdcc6995f2f4a8cf70de7be080d78460d8de75
Author: Álvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Wed Nov 13 09:58:58 2019 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/0afdcc6995f2f4a8cf70de7be080d78460d8de75 [^]

Related to issue 41880: Change inverseConversion parameter in getConvertedAmount() with directConversion

---
M modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js
---
(0115576)
aferraz   
2019-11-13 12:46   
Code review + Testing OK
(0115675)
markmm82   
2019-11-18 22:38   
(edited on: 2019-11-19 09:25)
Additional testing described in test cases for TestLink:

https://testlink.openbravo.com/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-11587 [^]

https://testlink.openbravo.com/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-11588 [^]

https://testlink.openbravo.com/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-11589 [^]

https://testlink.openbravo.com/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-11590 [^]

https://testlink.openbravo.com/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-11591 [^]

https://testlink.openbravo.com/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-11592 [^]

https://testlink.openbravo.com/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-11593 [^]

https://testlink.openbravo.com/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-11594 [^]

(0116280)
hudsonbot   
2019-12-12 23:01   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/954d2b7a66fb [^]
Maturity status: Test
(0116281)
hudsonbot   
2019-12-12 23:01   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/954d2b7a66fb [^]
Maturity status: Test
(0116586)
hgbot   
2019-12-31 10:51   
Repository: tools/automation/int
Changeset: 965807dbb6ba92f607208359fc119901746bf5b8
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Wed Dec 11 13:29:08 2019 -0500
URL: http://code.openbravo.com/tools/automation/int/rev/965807dbb6ba92f607208359fc119901746bf5b8 [^]

related to BUG-41880: Added some automated tests

---
M src-test/com/openbravo/test/integration/erp/modules/functionalteam/addpayment/testsuites/APR_ReconciliationRefactor/APR_ReconciliationRefactor2/ReconciliationSuite2.java
A src-test/com/openbravo/test/integration/erp/modules/functionalteam/addpayment/testsuites/APR_ReconciliationRefactor/APR_ReconciliationRefactor2/APRIssue41880.java
---