Openbravo Issue Tracking System - Retail Modules
View Issue Details
0033898Retail ModulesWeb POSpublic2016-09-05 16:392019-01-07 17:45
guilleaer 
guilleaer 
normalmajorhave not tried
closedfixed 
5
 
RR16Q4 
marvintm
No
0033898: Rounding issues paying with foreign currency
Having a certain configuration, payments done in foreign currency does not match with the amounts expected in the "default" currency.

Example:
The customer have to pay 541.65€ but he decides to pay it using USD
In that case -> 32.827272727 USD so rounding the user will have to pay 32.83$
Then once the payment is done, we convert the amount again to EUR and we get
541.695 which is rounded to 541.70

As you can see, the user is paying 541.70 instead of 541.65.

This is normal due to the loss of precision, but it is not acceptable because order/invoice will not be perfectly matched.


Al convertir de MXN 541.65 a USD se obtienen 32.83 USD (32.827272727 sin el redondeo). El problema es que al convertir de vuelta de USD a MXN, 32.83 da 541.695, que redondeado da 541.70.

Un ejemplo concreto se puede ver en el pedido: 3123-2/0039886.
Configure EUR currency
USD -> 0.060606 - 16.5

Configure USD currency
EUR -> 16.5 - 0.060606

Add A Prduct to the ticket
Change price to 541.65
Pay it using USD
Check Created Sales order in the ERP:

   - Payment plan has an outstanding of -0.05
   - Payment details shows 541.70 instead of 541.65
   - Payment in amount is 541.70 instead of 541.65
After discuss with functional team, we will proceed in the same way that ERP.

When a payment to completely pay the order is done using a foreign currency is done, the system should adjust the quantity to match with the amount which is pending in the "default" currency.
No tags attached.
related to defect 0033059 closed ranjith_qualiantech_com rounding problem with multicurrency 
depends on backport 0033983RR16Q3.2 closed guilleaer Rounding issues paying with foreign currency 
depends on backport 0033984RR16Q2.3 closed Retail Rounding issues paying with foreign currency 
related to defect 0034084 new Retail Pending test to be developed 
diff multicurrency_rounding.diff (7,502) 2016-09-05 16:39
https://issues.openbravo.com/file_download.php?file_id=9781&type=bug
Issue History
2016-09-05 16:39guilleaerNew Issue
2016-09-05 16:39guilleaerAssigned To => guilleaer
2016-09-05 16:39guilleaerFile Added: multicurrency_rounding.diff
2016-09-05 16:39guilleaerTriggers an Emergency Pack => No
2016-09-06 16:14hgbotCheckin
2016-09-06 16:14hgbotNote Added: 0089785
2016-09-06 16:14hgbotStatusnew => resolved
2016-09-06 16:14hgbotResolutionopen => fixed
2016-09-06 16:14hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/9514e62268ee017778da2efab7507122bb8ada57 [^]
2016-09-06 16:21guilleaerStatusresolved => new
2016-09-06 16:21guilleaerResolutionfixed => open
2016-09-06 16:22guilleaerAssigned Toguilleaer => Retail
2016-09-06 19:03guilleaerNote Added: 0089791
2016-09-06 19:11hgbotCheckin
2016-09-06 19:11hgbotNote Added: 0089793
2016-09-06 23:15guilleaerRelationship addedrelated to 0033059
2016-09-14 10:17marvintmStatusnew => scheduled
2016-09-26 23:13guilleaerRelationship addedrelated to 0034084
2016-09-26 23:14guilleaerNote Added: 0090278
2016-09-26 23:14guilleaerStatusscheduled => resolved
2016-09-26 23:14guilleaerFixed in Version => RR16Q4
2016-09-26 23:14guilleaerResolutionopen => fixed
2016-09-28 10:38marvintmAssigned ToRetail => guilleaer
2016-09-29 15:58marvintmReview Assigned To => marvintm
2016-09-29 15:58marvintmStatusresolved => closed
2018-07-24 17:41hgbotCheckin
2018-07-24 17:41hgbotNote Added: 0105932
2019-01-07 17:45hgbotCheckin
2019-01-07 17:45hgbotNote Added: 0108846

Notes
(0089785)
hgbot   
2016-09-06 16:14   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 9514e62268ee017778da2efab7507122bb8ada57
Author: Guillermo Alvarez de Eulate <guillermo.alvarez <at> openbravo.com>
Date: Tue Sep 06 16:13:30 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/9514e62268ee017778da2efab7507122bb8ada57 [^]

Fixed issue 33898: Last payment in foreign currency is adjusted to expected to avoid differences

When a payment is done, the code will check if this payment satisfy the amount which is pending in foreign amount. If the amount is satisfied then the amount of this payment will be calculated from the pending amount instead of converting the payment to the default currency which can cause differences.

---
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0089791)
guilleaer   
2016-09-06 19:03   
Reopened because tests are missing
(0089793)
hgbot   
2016-09-06 19:11   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: b91a99381341a6d9da4d37d489c286e0ab2fadd9
Author: Guillermo Alvarez de Eulate <guillermo.alvarez <at> openbravo.com>
Date: Tue Sep 06 19:10:37 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/b91a99381341a6d9da4d37d489c286e0ab2fadd9 [^]

Related to issue 33898: reuse value stored in var instead to call function again

---
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0090278)
guilleaer   
2016-09-26 23:14   
Resolved.

Test is pending. Added to the list of tests included in issue https://issues.openbravo.com/view.php?id=34084 [^]
(0105932)
hgbot   
2018-07-24 17:41   
Repository: tools/automation/pi-mobile
Changeset: fcef70df296e63e4b01964ed1d79231b68913600
Author: Alejandro <alekosmp86 <at> gmail.com>
Date: Fri Jul 20 15:44:27 2018 -0400
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/fcef70df296e63e4b01964ed1d79231b68913600 [^]

Related to issue 33898: added automated test

---
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/payment/I33898_VerifyRoundingWhenPayingInForeignCurrency.java
---
(0108846)
hgbot   
2019-01-07 17:45   
Repository: tools/automation/pi-mobile
Changeset: 4667e7da417d60eed890afd56a4280877ca2b3f2
Author: Alejandro <alekosmp86 <at> gmail.com>
Date: Thu Dec 20 13:48:05 2018 -0500
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/4667e7da417d60eed890afd56a4280877ca2b3f2 [^]

Related to issue 33898: this test no longer creates its own sampledata.

---
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/payment/I33898_VerifyRoundingWhenPayingInForeignCurrency.java
---