Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0034301Openbravo ERPZ. Otherspublic2016-10-26 10:022016-12-16 18:38
maite 
markmm82 
urgentmajoralways
closedfixed 
5
 
3.0PR17Q1 
aferraz
Advanced Payables and Receivables Mngmt
No
0034301: "Set new currency" process error when converting credit already generated in multicurrency payment
"Set new currency" process error when converting credit already generated in multicurrency payment
1. Access Financial Account window, create new record for "España" organization, currency=FJD. Add "Transferencia" in Payment Method tab
2. Register new Payment Out document for "Bebidas alegres" using "Transferencia" payment method, financial account previously created, currency=EUR, rate=5 and generated credit=100. Process payment
3. Access "Bebidas alegres" business partner and run "Set new currency" process. Set FJD currency, uncheck option "use default rate" and set rate=18. Select any gl item and run
4. Access Payment Out window again and realize that:
  4.1) Payment Generating credit in FJD currency has "Paid (Financial Account)"=500, when it should be 1800 as it is not multicurrency
  4.2) Payment when amount is refunded (negative one) has negative amount (-100) but positive "Paid (Financial Account)" amount (500 when it should also be negative)
No tags attached.
related to defect 0033977 closed markmm82 "Set new currency" process is not converting credit properly when more than one credit payment exists for this business partner 
Issue History
2016-10-26 10:02maiteNew Issue
2016-10-26 10:02maiteAssigned To => Triage Finance
2016-10-26 10:02maiteModules => Advanced Payables and Receivables Mngmt
2016-10-26 10:02maiteTriggers an Emergency Pack => No
2016-10-26 10:02maiteRelationship addedrelated to 0033977
2016-10-26 11:08aferrazAssigned ToTriage Finance => markmm82
2016-10-26 11:11maiteResolution time => 1478646000
2016-10-26 11:12maiteIssue Monitored: networkb
2016-10-26 11:13maiteResolution time1478646000 => 1479250800
2016-10-31 17:01markmm82Statusnew => scheduled
2016-11-10 20:20markmm82Note Added: 0091343
2016-11-11 15:14psanjuanNote Added: 0091404
2016-11-14 12:29psanjuanNote Edited: 0091404bug_revision_view_page.php?bugnote_id=0091404#r13665
2016-11-14 12:53psanjuanNote Edited: 0091343bug_revision_view_page.php?bugnote_id=0091343#r13667
2016-11-14 12:53psanjuanNote Added: 0091448
2016-11-14 12:57psanjuanNote Edited: 0091343bug_revision_view_page.php?bugnote_id=0091343#r13668
2016-11-14 13:07psanjuanNote Edited: 0091343bug_revision_view_page.php?bugnote_id=0091343#r13669
2016-11-14 13:09psanjuanNote Edited: 0091343bug_revision_view_page.php?bugnote_id=0091343#r13670
2016-11-14 13:09psanjuanNote Edited: 0091448bug_revision_view_page.php?bugnote_id=0091448#r13672
2016-11-14 13:09psanjuanNote Edited: 0091343bug_revision_view_page.php?bugnote_id=0091343#r13673
2016-11-14 13:10psanjuanNote Edited: 0091448bug_revision_view_page.php?bugnote_id=0091448#r13674
2016-11-14 13:13psanjuanNote Added: 0091452
2016-11-14 13:16psanjuanNote Edited: 0091452bug_revision_view_page.php?bugnote_id=0091452#r13678
2016-11-14 13:19psanjuanNote Edited: 0091448bug_revision_view_page.php?bugnote_id=0091448#r13679
2016-11-14 13:26hgbotCheckin
2016-11-14 13:26hgbotNote Added: 0091453
2016-11-14 13:26hgbotStatusscheduled => resolved
2016-11-14 13:26hgbotResolutionopen => fixed
2016-11-14 13:26hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/3b0fb57e7fed324c6e4efb57a4c5657a1fa08e90 [^]
2016-11-14 13:27aferrazReview Assigned To => aferraz
2016-11-14 13:27aferrazNote Added: 0091454
2016-11-14 13:27aferrazStatusresolved => closed
2016-11-14 13:27aferrazFixed in Version => 3.0PR17Q1
2016-12-16 18:38hudsonbotCheckin
2016-12-16 18:38hudsonbotNote Added: 0092615

Notes
(0091343)
markmm82   
2016-11-10 20:20   
(edited on: 2016-11-14 13:09)
Test Plan

Go to Business Partner window and create a new one.
  Organization = F&B España - Región Norte
  Search Key = Name = BPC
  BP Category = Supplier
Go to Vendor/Creditor tab and fill the fields with following information:
  Purchase Pricelist = Tarifa Bebidas Alegres
  PO Payment Method = Transferencia
  PO Payment Terms = 30 Days
  PO Financial Account = Cuenta de Banco
Go to Location/Address tab and create a new entry for any Spain region.
Access Financial Account window, create new header:
  Organization = F&B España, S.A
  Name = FA_FJD
  Currency=FJD.
Add "Transferencia" in Payment Method tab, ensure you check the "Make Payments in Multiple Currencies" within the Payment Out section.
Go to Payment Out window and register a document
  Business Partner = previously created bp ("BPC")
  Payment method = "Transferencia"
  Financial Account = previously created (FA_FJD)
  Currency = EUR
  Rate = 5
  Generated credit = 100.
Notice Paid (Financial Account) field is recalculated and is shown 500 = (Generated credit * conversion rate) = 100 * 5
Process payment
Go back to new created BP and notice the balance is updated to 100 EUR.
Run "Set new currency" process. with the following configuration:
  Set FJD currency,
  Uncheck option "use default rate" and set rate=18.
  Select any gl item
Run
Notice the balance is updated to 1800 FJD
Access Payment Out window again, refresh and realize that:
  Payment Generating credit in FJD currency has "Paid (Financial Account)"=1800, as it is not multicurrency
  Payment when amount is refunded (negative one) has negative amount (-100) and negative "Paid (Financial Account)" amount = -500
It is correct.

(0091404)
psanjuan   
2016-11-11 15:14   
(edited on: 2016-11-14 12:29)
Issue verified.

(0091448)
psanjuan   
2016-11-14 12:53   
(edited on: 2016-11-14 13:19)
Test Plan:

Test Case 1
Go to Business Partner window and create a new one.
Organization = F&B España
Search Key = Name = Supplier FJD
BP Category = Supplier

Go to Vendor/Creditor tab and fill the fields with following information:
Purchase Pricelist = Tarifa Bebidas Alegres (in EUR)
PO Payment Method = Transferencia
PO Payment Terms = 30 Days
PO Financial Account = Cuenta de Banco

Go to Location/Address tab and create a new entry for any Spain region.

Access Financial Account window, create a new financial account
Organization = F&B España, S.A
Name = FA_FJD
Currency= FJD

Add "Transferencia" in Payment Method tab, ensure you check "Make Payments in Multiple Currencies" within the Payment Out section.

Ensure you also check "Receive Payment in Multiple Currencies" within the Payment In section.


Go to Payment Out window and show the column "Paid (Financial Account)".
Create a new payment out for F&B España, Supplier FJD business partner, with below information:
Payment method = "Transferencia"
Financial Account = previously created (FA_FJD)
Currency = EUR
Rate = 5
Generated credit = 100.00 (EUR).

Notice that "Paid (Financial Account)" field is recalculated to 500 = (Generated credit * conversion rate) = 100 * 5

Press Add Details and the Done.

Go back to the new created BP, Supplier FJD, and notice that is balance is updated to 100 EUR.

Run "Set new currency" process. with the following configuration:
Set FJD currency,
Uncheck option "use default rate" and enter a rate = 18.
Select any gl item

Run the process.

Notice the balance is updated to 1800 FJD

Go to Payment Out window again, refresh and realize that there are three new payments created for the supplier "Supplier FJD":

(1) Credit consumption payment related to the GL Item selected (Currency Conversion) in EUR for a paid amount of 100.00 at an Exchange Rate = 5 and a Paid (Financial Account ) 500.00

(2) Refunded of payment above for -100.00 paid amount and -500.00 Paid (Financial Account ) Amount.

(3) 0.00 amount Credit payment in FJD with a Generated Credit 1800.00 Paid Amount 1800.00 and -1800.00 = 0.00; and a Paid (Financial Account ) amount = 1800.00. Status Payment Made.

Test Case 2

Repeat same test for a customer and a payment in.

Test Case 3

Repeat same test as abover for a supplier and for a customer, by generating Credit in the same currency of the financial Account (EUR). After that run Set New Currency Process and verify that the 0.00 Amount credit payment is generated for 1800.00 Received (Financial Account) or Paid (Financial account); in case the conversion rate used while running set new currency process is 18 and the initial credit in EUR amount is 100.00

(0091452)
psanjuan   
2016-11-14 13:13   
(edited on: 2016-11-14 13:16)
Test plan above verified.

Issue can be code reviewed and closed.

(0091453)
hgbot   
2016-11-14 13:26   
Repository: erp/devel/pi
Changeset: 3b0fb57e7fed324c6e4efb57a4c5657a1fa08e90
Author: Mark <markmm82 <at> gmail.com>
Date: Thu Nov 10 14:12:42 2016 -0500
URL: http://code.openbravo.com/erp/devel/pi/rev/3b0fb57e7fed324c6e4efb57a4c5657a1fa08e90 [^]

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.

---
M src/org/openbravo/common/actionhandler/SetNewBPCurrency.java
---
(0091454)
aferraz   
2016-11-14 13:27   
Code review OK
(0092615)
hudsonbot   
2016-12-16 18:38   
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/dc8bf00badd0 [^]
Maturity status: Test