Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0030077Openbravo ERPZ. Otherspublic2015-06-02 16:482015-08-20 23:16
maite 
aferraz 
urgentmajoralways
closedfixed 
5
 
3.0PR15Q4 
vmromanos
Core
No
0030077: Customer Balance not working properly with multicurrency credit
Customer Balance not working properly with multicurrency credit
1. Create new Business Partner defined as Customer. Set pricelist, payemnt method, financial account...
2. Register new Payment In for this BP. Set amount=100 and process payment generating credit
3. Access Business Partner window and realize that Customer Balance is -100 (which is correct)
4. From Business Partner window, Run "Set new currency" process, to convert your credit to -50 MXN
5. Access Business Partner Financial Account and configure Payment Method as "receive payments in multiple currencies"
6. Access Payment In window and create new record for same business partner. Set Currency=MXN and any any conversion rate. Run Add details process, select pending credit and use it against a gl item. Process payment
7. Access Business Partner window and realize that Customer Balance is not 0.00, when you are trying to consume all already converted credit
No tags attached.
related to defect 00301343.0PR15Q3 closed NaroaIriarte Error when executing a Process Definition if a parameter has defined a numeric default value 
depends on defect 00300953.0PR15Q3 closed aferraz BP current balance not properly updated when generating credit from Payment In/Out 
depends on defect 00301383.0PR15Q3 closed aferraz Error in Add Payment when generating credit and adding a negative line 
related to defect 00324343.0PR16Q2 closed markmm82 Wrong Exchange Rate set in Payment created from "Set New currency" process, when converting existent credit 
Issue History
2015-06-02 16:48maiteNew Issue
2015-06-02 16:48maiteAssigned To => Triage Finance
2015-06-02 16:48maiteModules => Core
2015-06-02 16:48maiteResolution time => 1436133600
2015-06-02 16:48maiteTriggers an Emergency Pack => No
2015-06-02 16:48maiteIssue Monitored: networkb
2015-06-02 16:49maiteSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8728#r8728
2015-06-04 09:20aferrazAssigned ToTriage Finance => aferraz
2015-06-04 14:14aferrazRelationship addeddepends on 0030095
2015-06-08 12:32aferrazStatusnew => scheduled
2015-06-09 12:52aferrazRelationship addedrelated to 0030134
2015-06-09 13:41aferrazRelationship addeddepends on 0030138
2015-06-11 11:26aferrazNote Added: 0078206
2015-06-11 12:23aferrazNote Edited: 0078206bug_revision_view_page.php?bugnote_id=0078206#r8817
2015-06-12 12:32ngarciaIssue Monitored: ngarcia
2015-06-29 12:45egoitzTarget Version3.0PR15Q3 => 3.0PR15Q4
2015-07-03 14:05vmromanosNote Edited: 0078206bug_revision_view_page.php?bugnote_id=0078206#r8979
2015-07-06 11:17hgbotCheckin
2015-07-06 11:17hgbotNote Added: 0078660
2015-07-06 11:17hgbotStatusscheduled => resolved
2015-07-06 11:17hgbotResolutionopen => fixed
2015-07-06 11:17hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/9d85d9a430b2eb9bad6881c4525a144133175941 [^]
2015-07-06 11:17hgbotCheckin
2015-07-06 11:17hgbotNote Added: 0078661
2015-07-06 11:17hgbotCheckin
2015-07-06 11:17hgbotNote Added: 0078662
2015-07-06 11:17vmromanosReview Assigned To => vmromanos
2015-07-06 11:17vmromanosNote Added: 0078663
2015-07-06 11:17vmromanosStatusresolved => closed
2015-08-20 23:16hudsonbotCheckin
2015-08-20 23:16hudsonbotNote Added: 0079468
2015-08-20 23:16hudsonbotCheckin
2015-08-20 23:16hudsonbotNote Added: 0079469
2015-08-20 23:16hudsonbotCheckin
2015-08-20 23:16hudsonbotNote Added: 0079470
2016-03-08 13:09maiteRelationship addedrelated to 0032434

Notes
(0078206)
aferraz   
2015-06-11 11:26   
(edited on: 2015-07-03 14:05)
Test plan:

- Create a new Business Partner and configure it as Customer and also as Vendor with EUR currency.

- Configure "Transferencia" Payment Method in "Cuenta de Banco" Financial Account as "Receive Payments in Multiple Currencies" = Y and "Make Payments in Multiple Currencies" = Y

- Create a Payment In for created business partner generating 100 EUR of credit.

- Realize current balance of business partner is now -100 EUR

- Create a Payment Out for created business partner generating 100 EUR of credit.

- Realize current balance of business partner is now 0 EUR

- Click on Set New Currency in Business Partner window
  Realize a Warning message is shown
  Set Currency = MXN, Set Amount = Y, Foreign Amount = -50 and G/L Item = Capital Social
  Click on Done
  Realize an Error message is shown

- Create a Payment In for created business partner generating 100 EUR of credit.

- Realize current balance of business partner is now -100 EUR

- Click on Set New Currency in Business Partner window
  Realize a Warning message is shown
  Set Currency = MXN, Set Amount = Y, Foreign Amount = -50 and G/L Item = Capital Social
  Click on Done
  Realize "Currency updated Successfully" message is shown.

- Go to Payment In window
  Realize two created payments with credit have been converted to new business partner currency following the wiki documentation

- Go to Payment Out window
  Realize created payment with credit has been converted to new business partner currency following the wiki documentation

- Realize current balance of business partner is now -50 MXN

- Create a Payment In for created business partner, refunding 50 MXN of credit.

- Realize current balance of business partner is now 0 MXN

- Click on Set New Currency in Business Partner window
  Realize a Warning message is shown
  Set Currency = EUR, Set Amount = N, Use default conversion rate = N, Rate = 2 and G/L Item empty
  Realize Done button is disabled

(0078660)
hgbot   
2015-07-06 11:17   
Repository: erp/devel/pi
Changeset: 9d85d9a430b2eb9bad6881c4525a144133175941
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu Jun 11 12:43:23 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/9d85d9a430b2eb9bad6881c4525a144133175941 [^]

Fixes issue 30077: Wrong customer balance with multicurrency credits

Customer balance was not correctly updated when consuming credit generated in one currency in a payment with another currency.
Credit To Use grid in AddPayment will only show available credit in the currency of current payment.
Also, when changing the currency of a business partner with Set New Currency process, if exists available credit, the process will be able to convert automatically this credit into credit in the new curreny if a GLItem is selected, following this process: http://wiki.openbravo.com/wiki/How_to_convert_credit_to_a_different_currency [^]

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/AdvPaymentMngtDao.java
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/PaymentInAddPaymentDisplayLogics.java
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/PaymentOutAddPaymentDisplayLogics.java
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/PurchaseInvoiceAddPaymentDisplayLogics.java
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/PurchaseOrderAddPaymentDisplayLogics.java
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/SalesInvoiceAddPaymentDisplayLogics.java
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/SalesOrderAddPaymentDisplayLogics.java
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/TransactionAddPaymentDisplayLogics.java
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/hqlinjections/CreditToUseTransformer.java
M modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationComponentProvider.java
M src-db/database/sourcedata/AD_MESSAGE.xml
M src-db/database/sourcedata/OBUIAPP_PARAMETER.xml
M src-db/database/sourcedata/OBUIAPP_PROCESS.xml
M src/org/openbravo/common/actionhandler/SetNewBPCurrency.java
M src/org/openbravo/financial/FinancialUtils.java
A src/org/openbravo/common/actionhandler/CheckAvailableCreditActionHandler.java
A web/js/checkAvailableCredit.js
---
(0078661)
hgbot   
2015-07-06 11:17   
Repository: erp/devel/pi
Changeset: 317d186e5a3141b3b24deefdd439a0896bf6d578
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Fri Jul 03 13:33:24 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/317d186e5a3141b3b24deefdd439a0896bf6d578 [^]

Related to issue 30077: applied js beautifier

---
M web/js/checkAvailableCredit.js
---
(0078662)
hgbot   
2015-07-06 11:17   
Repository: erp/devel/pi
Changeset: b815e49be324a0464825ed8e48ca2b3599ef247d
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Fri Jul 03 15:04:14 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/b815e49be324a0464825ed8e48ca2b3599ef247d [^]

Related to issue 30077: code review improvements

Use credit popup when completing an invoice only shown when invoice's currency = business partner's currency.
Call getCustomerPaymentsWithCredit() without checking currency != null, because the method already checks it.
Improved warning message with a link to the wiki page.
Amounts are properly rounded.
Improvements in the created payment messages.
Change Business Partner currency: Forced to select a gl item if credit is detected in order to change the currency.

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/ProcessInvoice.java
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/AdvPaymentMngtDao.java
M src-db/database/sourcedata/AD_MESSAGE.xml
M src/org/openbravo/common/actionhandler/SetNewBPCurrency.java
M web/js/checkAvailableCredit.js
---
(0078663)
vmromanos   
2015-07-06 11:17   
Code review + testing OK
(0079468)
hudsonbot   
2015-08-20 23:16   
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/8c91718397a5 [^]
Maturity status: Test
(0079469)
hudsonbot   
2015-08-20 23:16   
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/8c91718397a5 [^]
Maturity status: Test
(0079470)
hudsonbot   
2015-08-20 23:16   
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/8c91718397a5 [^]
Maturity status: Test