Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0032434Openbravo ERPZ. Otherspublic2016-03-08 13:052016-03-23 21:50
maite 
markmm82 
urgentmajoralways
closedfixed 
5
 
3.0PR16Q23.0PR16Q2 
aferraz
Advanced Payables and Receivables Mngmt
No
0032434: Wrong Exchange Rate set in Payment created from "Set New currency" process, when converting existent credit
"Set new currency" process offers possibility to define GL Item and automatically create payments described in following article: http://wiki.openbravo.com/wiki/How_to_convert_credit_to_a_different_currency [^]

Payment that generates credit in new currency has wrong Exchange Rate so payment's accounting entry is not properly converted
0. Access "Cuenta de Banco" financial account and configure "Transferencia" payment method as "Make payments in multiple currencies", Automatic Withdrawn=NO and Upon Payment Use=In Transit Payment Account
1. Register new Payment Out for Bebidas Alegres, set Generated Credit=150 and currency EUR and process. Credit will be generated
2. Register new Payment Out for Bebidas Alegres, set Generated Credit=300 and currency USD and process. Error will be raised, which is correct
3. Access "Bebidas Alegres" business partner and run "Set new currency" process. Set USD currency and select GL Item. Process
4. Access to Payment Out window and realize that 3 payments have been created (according with following information: http://wiki.openbravo.com/wiki/How_to_convert_credit_to_a_different_currency [^])
5. Access payment created in USD currency, which is the one generating credit in new currency and with a negative detail related to gl item and realize that "Exchange Rate" has been set to 1 instead of default's rate (which is 0.917431 for payment's date 08-03-2016)

NOTE: in case you post all involved payments you can see that difference is found in gl item account when balance should be zero

NOTE2: if you manually create identical Payment Out document you can see that proper Exchange Rate is set
No tags attached.
related to defect 00300773.0PR15Q4 closed aferraz Customer Balance not working properly with multicurrency credit 
Issue History
2016-03-08 13:05maiteNew Issue
2016-03-08 13:05maiteAssigned To => Triage Finance
2016-03-08 13:05maiteModules => Advanced Payables and Receivables Mngmt
2016-03-08 13:05maiteResolution time => 1459634400
2016-03-08 13:05maiteTriggers an Emergency Pack => No
2016-03-08 13:06maiteIssue Monitored: networkb
2016-03-08 13:09maiteRelationship addedrelated to 0030077
2016-03-09 17:24markmm82Statusnew => scheduled
2016-03-09 17:24markmm82Assigned ToTriage Finance => markmm82
2016-03-11 16:23markmm82Note Added: 0084922
2016-03-15 15:21psanjuanNote Added: 0084988
2016-03-15 15:23psanjuanNote Edited: 0084988bug_revision_view_page.php?bugnote_id=0084988#r11440
2016-03-15 15:28psanjuanNote Edited: 0084988bug_revision_view_page.php?bugnote_id=0084988#r11441
2016-03-15 15:41psanjuanNote Edited: 0084988bug_revision_view_page.php?bugnote_id=0084988#r11444
2016-03-15 15:44psanjuanNote Edited: 0084988bug_revision_view_page.php?bugnote_id=0084988#r11445
2016-03-16 18:33markmm82Note Added: 0085017
2016-03-17 12:26psanjuanNote Edited: 0084988bug_revision_view_page.php?bugnote_id=0084988#r11478
2016-03-17 12:41psanjuanNote Added: 0085200
2016-03-17 12:41psanjuanNote Edited: 0085200bug_revision_view_page.php?bugnote_id=0085200#r11480
2016-03-17 12:52psanjuanNote Edited: 0085200bug_revision_view_page.php?bugnote_id=0085200#r11481
2016-03-22 20:34hgbotCheckin
2016-03-22 20:34hgbotNote Added: 0085269
2016-03-22 20:34hgbotStatusscheduled => resolved
2016-03-22 20:34hgbotResolutionopen => fixed
2016-03-22 20:34hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/05ebc1f592f51a0c271f0e5f127489bc95750364 [^]
2016-03-22 20:34aferrazReview Assigned To => aferraz
2016-03-22 20:34aferrazNote Added: 0085270
2016-03-22 20:34aferrazStatusresolved => closed
2016-03-22 20:34aferrazFixed in Version => 3.0PR16Q2
2016-03-23 21:50hudsonbotCheckin
2016-03-23 21:50hudsonbotNote Added: 0085302

Notes
(0084922)
markmm82   
2016-03-11 16:23   
Test Plan:

0. Access "Cuenta de Banco" financial account and configure "Transferencia" payment method as "Make payments in multiple currencies", Automatic Withdrawn=NO and Upon Payment Use=In Transit Payment Account
1. Register new Payment Out for Bebidas Alegres, set Generated Credit=150 and currency EUR and process. Credit will be generated
2. Register new Payment Out for Bebidas Alegres, set Generated Credit=300 and currency USD and process. Error will be raised, which is correct
3. Access "Bebidas Alegres" business partner and run "Set new currency" process. Set USD currency and select GL Item. Process
4. Access to Payment Out window and realize that 3 payments have been created (according with following information: http://wiki.openbravo.com/wiki/How_to_convert_credit_to_a_different_currency [^] [^])
5. Access payment created in USD currency, which is the one generating credit in new currency and with a negative detail related to gl item and realize that "Exchange Rate" has been set to the right exchange rate!
(0084988)
psanjuan   
2016-03-15 15:21   
(edited on: 2016-03-17 12:26)
Test Plan to verify the issue:

Create a BP in F&B España named "BP Credito Supplier", select a price list in EUR, for instance Tarifa Bebidas Alegres.

Go to payment out window and register a credit of 150.00 € for this BP. Post it.
Amount Left as credit 150 EUR

Posting for F&B España euro looks like:
DEBIT 150.00 (40700)
CREDIT 150.00 (55500)

Posting for F&B International Group USD looks like: (exchange rate eur - usd = 1.5)
DEBIT 225.00 (1410)
CREDIT 225.00 (1140)

Go to BP window and change the currency of the BP just created to USD by using "Set New currency" process and selecting below options:
Currency = USD
Use default conversion rate = yes
G/L item - select a GL Item for instance named "Currency Conversion".
Press Done.

Go to Payment out window and check that 3 payments have been created:

Payment 1 (ide. 10000471) GL Item : Currency Conversion. Posting looks like:

Posting for F&B España euro looks like:
DEBIT 150.00 (G/L item account)
CREDIT 150.00 (55500)

Posting for F&B International Group USD looks like: (exchange rate eur - usd = 1.5)
DEBIT 225.00 (G/L item account)
CREDIT 225.00 (1140)

Payment 2 (ie 1000472). Refunded payment 10000471, Amount refunded -150

Posting for F&B España euro looks like:
DEBIT 150.00 (55500)
CREDIT 150.00 (40700)

Posting for F&B International Group USD looks like: (exchange rate eur - usd = 1.5)
DEBIT 225.00 (1140)
CREDIT 225.00 (1410)

Payment 3 in USD. (ie. 10000472) Amount left as credit -225.00 USD

Posting for F&B España euro looks like:
DEBIT 225.00 (40700)
CREDIT 225.00 (G/L item account)

Posting for F&B International Group USD looks like: (exchange rate eur - usd = 1.5)
DEBIT 225.00 (1410)
CREDIT 225.00 (G/L item account)

Final posting for F&B International Group USD is correct:
DEBIT 225.00 (1410) Vendor Prepayment
CREDIT 225.00 (1140) Checking in Transfer

But final posting for F&B España EUR general ledger is not correct:
DEBIT 225.00 (40700)
CREDIT 150.00 (55500)
CREDIT 75.00 (G/l item)

Therefore correct posting of last payment should have been:

DEBIT 150.00 (225.00 USD x 0.66667 tc USD to €) (40700) Vendor Prepayment
CREDIT 150.00 (225.00 USD x 0.66667 tc USD to €) (G/L item account)

Therefore final posting for F&B España EUR is:
DEBIT 150.00 (40700)
CREDIT 150.00 (55500)

(0085017)
markmm82   
2016-03-16 18:33   
Test Plan:

0. Access "Cuenta de Banco" financial account and configure "Transferencia" payment method as "Make payments in multiple currencies", Automatic Withdrawn=NO and Upon Payment Use=In Transit Payment Account.
1. Check conversion rates between EUR and USD currencies. For instance: EUR - USD: 1.09; USD - EUR: 0.917431.
2. Create a BP in F&B España Región Norte named "BP Credito", select a price list in EUR, for instance Otros Servicios.
3. Go to payment out window and register a credit of 100.00 € for this BP. Post it.
    (Payment 1000442) Amount Left as credit 100 EUR
4. Posting for F&B España euro looks like:
    DEBIT 100.00 (40700)
    CREDIT 100.00 (55500)

   Posting for F&B International Group USD looks like: (exchange rate eur - usd = 1.09)
    DEBIT 109.00 (1410)
    CREDIT 109.00 (1140)

5. Go to BP window and change the currency of the BP just created to USD by using "Set New currency" process and selecting below options:
    Currency = USD
    Use default conversion rate = yes
    G/L item - select a GL Item for instance named "Currency Conversion".
    Press Done.

6. Go to Payment out window and check that 3 payments have been created:

   Payment 1 (ide. 1000443) GL Item : Currency Conversion. Posting looks like:

    Posting for F&B España euro looks like:
    DEBIT 100.00 (G/L item account)
    CREDIT 100.00 (55500)

    Posting for F&B International Group USD looks like: (exchange rate eur - usd = 1.09)
    DEBIT 109.00 (G/L item account: 6290 - Salaries)
    CREDIT 109.00 (1140)

   Payment 2 (ie 1000444). Refunded payment 1000443, Amount refunded -100

    Posting for F&B España euro looks like:
    DEBIT 100.00 (55500)
    CREDIT 100.00 (40700)

    Posting for F&B International Group USD looks like: (exchange rate eur - usd = 1.09)
    DEBIT 109.00 (1140)
    CREDIT 109.00 (1410)

   Payment 3 in USD. (ie. 10000472) Amount left as credit 109.00 USD

    Posting for F&B España euro looks like:
    DEBIT 100.00 (40700)
    CREDIT 100.00 (G/L item account: 64000 - Sueldos y salarios)

    Posting for F&B International Group USD looks like: (exchange rate eur - usd = 1.09)
    DEBIT 109.00 (1410)
    CREDIT 109.00 (G/L item account)

All posting are correct!
(0085200)
psanjuan   
2016-03-17 12:41   
(edited on: 2016-03-17 12:52)
Test Plan to verify the issue:

Scenario 1 - Vendor currency EUR that changes to USD.

Create a BP in F&B España named "BP Credito Supplier", select a price list in EUR, for instance Tarifa Bebidas Alegres.

Go to payment out window and register a credit of 150.00 € for this BP. Post it.
Amount Left as credit 150 EUR

Posting for F&B España euro looks like:
DEBIT 150.00 (40700)
CREDIT 150.00 (55500)

Posting for F&B International Group USD looks like: (exchange rate eur - usd = 1.5)
DEBIT 225.00 (1410)
CREDIT 225.00 (1140)

Go to BP window and change the currency of the BP just created to USD by using "Set New currency" process and selecting below options:
Currency = USD
Use default conversion rate = yes
G/L item - select a GL Item for instance named "Currency Conversion".
Press Done.

Go to Payment out window and check that 3 payments have been created:

Payment 1 (ide. 10000471) GL Item : Currency Conversion. Posting looks like:

Posting for F&B España euro looks like:
DEBIT 150.00 (G/L item account)
CREDIT 150.00 (55500)

Posting for F&B International Group USD looks like: (exchange rate eur - usd = 1.5)
DEBIT 225.00 (G/L item account)
CREDIT 225.00 (1140)

Payment 2 (ie 1000472). Refunded payment 10000471, Amount refunded -150

Posting for F&B España euro looks like:
DEBIT 150.00 (55500)
CREDIT 150.00 (40700)

Posting for F&B International Group USD looks like: (exchange rate eur - usd = 1.5)
DEBIT 225.00 (1140)
CREDIT 225.00 (1410)

Payment 3 in USD. (ie. 10000472) Amount left as credit -225.00 USD

Posting for F&B España euro looks like:

DEBIT 150.00 (225.00 USD x 0.66667 tc USD to €) (40700) Vendor Prepayment
CREDIT 150.00 (225.00 USD x 0.66667 tc USD to €) (G/L item account)

Posting for F&B International Group USD looks like: (exchange rate eur - usd = 1.5)
DEBIT 225.00 (1410)
CREDIT 225.00 (G/L item account)

Final posting for F&B International Group USD is correct:
DEBIT 225.00 (1410) Vendor Prepayment
CREDIT 225.00 (1140) Checking in Transfer

Final posting for F&B España EUR is:
DEBIT 150.00 (40700)
CREDIT 150.00 (55500)

Check that current balance of the BP has changed from 150 EUR to 225 USD

Repeat same test for scenarios below:

Scenario 2 - Vendor currency USD that changes to EUR.
Check that current balance of the BP has changed from 225 USD to 150 EUR

Scenario 3 - Customer currency EUR that changes to USD.
Check that current balance of the BP has changed from -150 EUR to 225 USD

Scenario 4 - Customer currency USD that changes to EUR.
Check that current balance of the BP has changed from -225 USD to -150 EUR

(0085269)
hgbot   
2016-03-22 20:34   
Repository: erp/devel/pi
Changeset: 05ebc1f592f51a0c271f0e5f127489bc95750364
Author: Mark <m.molina <at> nectus.com>
Date: Wed Mar 16 13:15:55 2016 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/05ebc1f592f51a0c271f0e5f127489bc95750364 [^]

Fixes issue 32434: Fixed Wrong Exchange Rate set in Payment created from "Set New currency" process.

Payment that generates credit in new currency was calculated with wrong Exchange Rate so payment's accounting
entry was not properly converted, it was fixed updating the transaction tax rate with the correct conversion between currencies.

---
M src/org/openbravo/common/actionhandler/SetNewBPCurrency.java
---
(0085270)
aferraz   
2016-03-22 20:34   
Code review OK
(0085302)
hudsonbot   
2016-03-23 21:50   
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/618cfeb90f07 [^]
Maturity status: Test