Openbravo Issue Tracking System - Modules
View Issue Details
0036090ModulesCash VAT Managementpublic2017-05-24 16:422017-06-08 17:12
maite 
AtulOpenbravo 
urgentmajoralways
closedfixed 
5
 
 
aferraz
0036090: Wrong Business Partner Balance when non paid cash vat invoice is voided
When a non-paid invoice is voided, zero payment is automatically created. In case invoice is set as cash vat, Current Balance field in business partner window is updated twice so final balance is wrong.
0. Check Current Balance for any business partner
1. Register Sales Invoice for this bp. Add line and Complete invoice
2. Check that Current Balance has been increased with invoice's amount
3. Void invoice (zero payment has been automatically created)
4. Check that Current Balance has not changed, which is wrong as it should has been descreased

NOTE: if you enable "fully audit" functionality for business partner table you can see that field is updated 2 times when voiding, which seems to be root cause of problem
No tags attached.
Issue History
2017-05-24 16:42maiteNew Issue
2017-05-24 16:42maiteAssigned To => Triage Finance
2017-05-24 16:42maiteResolution time => 1497391200
2017-05-24 16:42maiteIssue Monitored: networkb
2017-05-25 16:51aferrazAssigned ToTriage Finance => AtulOpenbravo
2017-05-30 07:22AtulOpenbravoStatusnew => scheduled
2017-05-30 18:49AtulOpenbravoNote Added: 0097031
2017-05-30 18:59AtulOpenbravoNote Added: 0097033
2017-05-31 12:48hgbotCheckin
2017-05-31 12:48hgbotNote Added: 0097047
2017-05-31 12:48hgbotStatusscheduled => resolved
2017-05-31 12:48hgbotResolutionopen => fixed
2017-05-31 12:48hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/f7bca35786a1d56820c2ca301624fc30f55f9d60 [^]
2017-05-31 12:48aferrazReview Assigned To => aferraz
2017-05-31 12:48aferrazNote Added: 0097048
2017-05-31 12:48aferrazStatusresolved => closed
2017-06-08 17:12hudsonbotCheckin
2017-06-08 17:12hudsonbotNote Added: 0097225

Notes
(0097031)
AtulOpenbravo   
2017-05-30 18:49   
Test Plan

- Check Current Balance for any business partner.
- Register Sales Invoice for this business partner. Add line and Complete invoice
- Check that Current Balance has been increased with invoice's amount.
- Void invoice (zero payment has been automatically created).
- Check that Current Balance is decreased with reversed invoice amount.


- Register Sales Invoice for above business partner. Add line and complete invoice.
- Check that current balance has been increased by invoice amount.
- Reactivate the invoice.
- Check that current balance has been decreased by invoice amount.
- Complete the invoice again.
- Check that current balance has been increased by invoice amount.
- Add Payment with full amount of the invoice.
- Check that current balance has been decreased by the paid amount.


- Register Sales Invoice for above business partner. Add line and complete invoice.
- Check that current balance has been increased by invoice amount.
- Add Payment with partial amount against invoice.
- Check that current balance has been decreased by the paid partial amount.
- Reactivate and delete the Payment.
- Check that current balance has been increased by the partial amount of the deleted payment.
(0097033)
AtulOpenbravo   
2017-05-30 18:59   
Test Plan

- Enable Reverse Payment button in Payment In Header.
- Register Sales Invoice for above business partner. Add line and complete invoice.
- Check that current balance has been increased by invoice amount.
- Add Payment with full amount against invoice.
- Check that current balance has been decreased by the paid amount.
- Reverse the Payment In created.
- Check that current balance has been increased by reversed payment amount.
(0097047)
hgbot   
2017-05-31 12:48   
Repository: erp/devel/pi
Changeset: f7bca35786a1d56820c2ca301624fc30f55f9d60
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Tue May 30 22:32:28 2017 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/f7bca35786a1d56820c2ca301624fc30f55f9d60 [^]

Fixes issue 36090: Wrong BP balance when non paid cash vat invoice is voided

creditUsed in updateCustomerCredit method in FIN_PaymentProcess
is not the updated usedcredit of business partner after processing
the reverse invoice created in void process. In order to get correct
value, business partner object is refreshed. Doing refresh was not
enough as in the case of dummy payment has +ve and -ve payment details,
updateCustomerCredit is called twice first time decreases invoice amount
(+ve) and second time decreases (-ve) reversed invoice amount. Net effect
is nullified. So after first call flush is needed to save values to
database.

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
---
(0097048)
aferraz   
2017-05-31 12:48   
Code review + Testing OK
(0097225)
hudsonbot   
2017-06-08 17:12   
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/fda0f16ab470 [^]
Maturity status: Test