Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0020994Openbravo ERP09. Financial managementpublic2012-07-10 16:552012-07-10 17:55
mirurita 
ioritzCia 
urgentmajoralways
closedfixed 
20Community Appliance
pi 
3.0MP13 
Advanced Payables and Receivables Mngmt
Pre packaging ( pi )
2012-06-27
https://code.openbravo.com/erp/devel/pi/rev/3b4adfb72e90 [^]
No
0020994: Add Details (Payment in/out): difference options are not properly calculated
If you have more than one record in the grid the difference options are not properly displayed.

Note: if you use the "select all" checkbox the difference options work.

For each record in the grid the updateReadOnly (FIN_Utilities.js) method is called.

expectedAmount = frm.inpExpectedPayment.value;

frm.inpExpectedPayment.value at this point is "" (empty string).
Before, at this point, updateAll method was previously called and it was calculating the expected payment.

and after this statement it takes "NaN.00" value
frm.inpExpectedPayment.value = subtract(expectedAmount, recordAmount);

(see attached screenshot)

for difference options the expected payment value is used. As it has an invalid value the difference options calculation does not work.
1) Create two sales invoices for Healthy Food Supermarkets, Co.
   - SI1: 2.04$
   - SI2: 1.34$
2) Create a new Payment In
   - Business Partner: Healthy Food Supermarkets, Co.
3) Click on Add Details button
4) The option displayed in the bottom is: "Write off the difference"
5) Enter 3 in Actual Payment In. The amount is properly distributed.
6) Realize that the option has not changed, the only available option is "Write off the difference". This is wrong.
7) At this point if you try to modify the amounts in the grid manually the options are not properly recalculated
No tags attached.
png Difference options.png (45,636) 2012-07-10 16:56
https://issues.openbravo.com/file_download.php?file_id=5389&type=bug
png

png ExpectedAmount.png (113,515) 2012-07-10 16:56
https://issues.openbravo.com/file_download.php?file_id=5390&type=bug
png
Issue History
2012-07-10 16:55miruritaNew Issue
2012-07-10 16:55miruritaAssigned To => ioritzCia
2012-07-10 16:55miruritaModules => Advanced Payables and Receivables Mngmt
2012-07-10 16:56miruritaFile Added: Difference options.png
2012-07-10 16:56miruritaFile Added: ExpectedAmount.png
2012-07-10 16:57miruritaRegression level => Pre packaging ( pi )
2012-07-10 16:57miruritaRegression date => 2012-06-27
2012-07-10 16:57miruritaRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/3b4adfb72e90 [^]
2012-07-10 17:01miruritaDescription Updatedbug_revision_view_page.php?rev_id=3615#r3615
2012-07-10 17:51hgbotCheckin
2012-07-10 17:51hgbotNote Added: 0050464
2012-07-10 17:51hgbotStatusnew => resolved
2012-07-10 17:51hgbotResolutionopen => fixed
2012-07-10 17:51hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/bd214e6331389d964a7cf6b72ce834718c219ed3 [^]
2012-07-10 17:55miruritaNote Added: 0050465
2012-07-10 17:55miruritaStatusresolved => closed
2012-07-10 17:55miruritaFixed in Version => 3.0MP13

Notes
(0050464)
hgbot   
2012-07-10 17:51   
Repository: erp/devel/pi
Changeset: bd214e6331389d964a7cf6b72ce834718c219ed3
Author: Ioritz Cia <ioritz.cia <at> openbravo.com>
Date: Tue Jul 10 17:49:42 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/bd214e6331389d964a7cf6b72ce834718c219ed3 [^]

Fixes issue 20994: Backout of changeset 3b4adfb72e90.
Add Details (Payment in/out): difference options are not properly calculated.

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddOrderOrInvoice.html
---
(0050465)
mirurita   
2012-07-10 17:55   
restored to the previous code

code review + testing OK