Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0028979Openbravo ERPZ. Otherspublic2015-02-18 13:112015-02-25 21:22
ngarcia 
aferraz 
immediatemajoralways
closedfixed 
5
 
3.0PR15Q2 
Sandrahuguet
Advanced Payables and Receivables Mngmt
No
0028979: UpdateCustomerBalance modulescript is wrongly calculating the Current Balance
UpdateCustomerBalance modulescript is wrongly calculating the Current Balance. It does not take into account partial payments and credit is wrongly added: Credit for receipts (payment in) should be negative while credit for payments (payment out) should be positive
As group admin role:
   Create a Business Partner set as Customer
   Add a Payment In to it where a credit of 100 is generated
   Check the Current Balance in the Business Partner window is -100. This is correct
   Create a Business Partner set as Vendor
   Generate a Purchase Invoice for it
   Check its Current Balance is for the whole amount of the invoice (but negative). This is correct
   Add a partial payment out to it
   Check its Current Balance is for the pending amount of the invoice (but negative). This is correct
As system admin role:
   Delete the IsCustomerBalanceRestored preference

Launch ant smartbuild -Dlocal=No in order the modulescript to be applied and restart tomcat

As group admin role:
   Check the Current Balance in the Business Partner window for the Customer is 100. This is incorrect, it should be negative
   Check the Current Balance in the Business Partner window for the Vendor is the whole amount of the invoice (but negative). This is incorrect, it should be the outstanding amount (but negative)
No tags attached.
related to defect 00248663.0PR14Q2 closed AtulOpenbravo Preference "IsCustomerBalanceRestored" should be created in UpdateCustomerBalance modulescript 
diff 28979.diff (1,619) 2015-02-18 13:35
https://issues.openbravo.com/file_download.php?file_id=7803&type=bug
Issue History
2015-02-18 13:11ngarciaNew Issue
2015-02-18 13:11ngarciaAssigned To => Sandrahuguet
2015-02-18 13:11ngarciaModules => Advanced Payables and Receivables Mngmt
2015-02-18 13:11ngarciaResolution time => 1426806000
2015-02-18 13:11ngarciaTriggers an Emergency Pack => No
2015-02-18 13:15ngarciaRelationship addedrelated to 0024866
2015-02-18 13:15ngarciaIssue Monitored: networkb
2015-02-18 13:16ngarciaFile Added: 28979.diff
2015-02-18 13:34ngarciaFile Deleted: 28979.diff
2015-02-18 13:35ngarciaFile Added: 28979.diff
2015-02-19 12:18SandrahuguetAssigned ToSandrahuguet => ngarcia
2015-02-19 12:18SandrahuguetAssigned Tongarcia => aferraz
2015-02-19 13:35aferrazSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=7711#r7711
2015-02-19 14:45aferrazNote Added: 0074663
2015-02-19 14:46aferrazNote Edited: 0074663bug_revision_view_page.php?bugnote_id=0074663#r7713
2015-02-24 15:41ngarciaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=7752#r7752
2015-02-25 10:09hgbotCheckin
2015-02-25 10:09hgbotNote Added: 0074900
2015-02-25 10:09hgbotStatusnew => resolved
2015-02-25 10:09hgbotResolutionopen => fixed
2015-02-25 10:09hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/92405876894e532479d9de83244806ee1436dda5 [^]
2015-02-25 10:13SandrahuguetReview Assigned To => Sandrahuguet
2015-02-25 10:13SandrahuguetNote Added: 0074902
2015-02-25 10:13SandrahuguetStatusresolved => closed
2015-02-25 10:13SandrahuguetFixed in Version => 3.0PR15Q2
2015-02-25 21:22hudsonbotCheckin
2015-02-25 21:22hudsonbotNote Added: 0074947

Notes
(0074663)
aferraz   
2015-02-19 14:45   
(edited on: 2015-02-19 14:46)
Test plan:

As group admin role:

   Create a Business Partner set as Customer
   Add a Payment In to it where a credit of 100 is generated
   Check the Current Balance in the Business Partner window is -100. This is correct
   Create a Business Partner set as Vendor
   Generate a Purchase Invoice for it
   Check its Current Balance is for the whole amount of the invoice (but negative). This is correct
   Add a partial payment out to it
   Check its Current Balance is for the pending amount of the invoice (but negative). This is correct
As system admin role:
   Delete the IsCustomerBalanceRestored preference

Launch ant smartbuild -Dlocal=No in order the modulescript to be applied and restart tomcat

As group admin role:
   Check the Current Balance in the Business Partner window for the Customer is 100 (but negative).
   Check the Current Balance in the Business Partner window for the Vendor is the outstanding amount of the invoice (but negative).

(0074900)
hgbot   
2015-02-25 10:09   
Repository: erp/devel/pi
Changeset: 92405876894e532479d9de83244806ee1436dda5
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Wed Feb 25 09:53:23 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/92405876894e532479d9de83244806ee1436dda5 [^]

Fixes issue 28979: UpdateCustomerBalance is wrongly calculating CurrentBalance

UpdateCustomerBalance modulescript has been modified in order to get credit for receipts as negative and credit for payments as positive. Also, it now takes into account partial payments.

---
M modules/org.openbravo.advpaymentmngt/build/classes/org/openbravo/advpaymentmngt/modulescript/UpdateCustomerBalanceData.class
M modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/UpdateCustomerBalance_data.xsql
M modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdateCustomerBalanceData.java
---
(0074902)
Sandrahuguet   
2015-02-25 10:13   
Code review + testing ok
(0074947)
hudsonbot   
2015-02-25 21:22   
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/96ba7b028cb7 [^]
Maturity status: Test