Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0041937Openbravo ERP07. Sales managementpublic2019-10-04 22:332019-10-11 09:13
lbressan 
markmm82 
normalmajoralways
closedfixed 
5
pi 
3.0PR19Q3.23.0PR19Q3.2 
Sandrahuguet
Google Chrome
Core
Pre packaging ( pi )
2019-09-05
main
No
0041937: Modify Payment Plan shows invalid amount when changing payment methods.
In some cases, using the Modify Payment Plan feature will show that the Outstanding Amount is invalid when is not the case.
For example, when having several Payment Plan records, and only one remaining to be paid, the Payment Method cannot be changed (even without altering Outstanding Amount) using the Modify Payment Plan.
This happens after commit from issue: https://issues.openbravo.com/view.php?id=41732 [^]

The problem happens because the total invoice amount is considered when validating the Outstanding Amount. But since the other payment plans are paid (and not shown in the pop up grid), the amounts will never match, giving the error to the user.
1. Create and complete a sales invoice with total amount 1500.
2. Use Modify Payment Plan to create two more payment plans and divide the amount between the three.
3. Remaining Payment Plans should be as following:
Payment Plan 1: 500
Payment Plan 2: 500
Payment Plan 3: 500
4. Pay any two payment plans fully.
5. Pay partially the las payment plan.
6. Use Modify Payment Plan again to change that same payment plan's payment method.
7. Outstanding Amount will be colored Red with a message saying that the value is incorrect. Even though it was not changed.
No tags attached.
blocks defect 0041935 closed markmm82 Modify Payment Plan shows invalid amount when changing payment methods. 
Issue History
2019-10-07 08:55SandrahuguetTypedefect => backport
2019-10-07 08:55SandrahuguetTarget Version => 3.0PR19Q3.2
2019-10-11 09:12hgbotCheckin
2019-10-11 09:12hgbotNote Added: 0115025
2019-10-11 09:12hgbotStatusscheduled => resolved
2019-10-11 09:12hgbotResolutionopen => fixed
2019-10-11 09:12hgbotFixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR19Q3.2/rev/96529e99687ac06ee59485de8ab4548ab1aab3d2 [^]
2019-10-11 09:13SandrahuguetReview Assigned To => Sandrahuguet
2019-10-11 09:13SandrahuguetNote Added: 0115028
2019-10-11 09:13SandrahuguetStatusresolved => closed
2019-10-11 09:13SandrahuguetFixed in Version => 3.0PR19Q3.2

Notes
(0115025)
hgbot   
2019-10-11 09:12   
Repository: erp/backports/3.0PR19Q3.2
Changeset: 96529e99687ac06ee59485de8ab4548ab1aab3d2
Author: Mark Molina <mark.molina <at> doceleguas.com>
Date: Mon Oct 07 20:32:06 2019 -0300
URL: http://code.openbravo.com/erp/backports/3.0PR19Q3.2/rev/96529e99687ac06ee59485de8ab4548ab1aab3d2 [^]

Fixes issue 41937: Take into account total paid when calculating the outstanding
amount of lines when using the Modify Payment Plan feature.

In some cases, using the Modify Payment Plan feature was shoing that the Outstanding Amount
was invalid because the total invoice amount was considered when validating the Outstanding Amount
but wasn't taking into account the other payment plans already paid.
The issue on this situation was to to get the received amount from records shown in
the grid, as those lines already paid are not shown in the pop up grid, the amount
don'tr match and an error is shown to the user.

To fix this issue is validated that the total Outstanding amount is exactly the difference
between the invoice grand total and the total invoice amount already paid

---
M modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-utilities.js
---
(0115028)
Sandrahuguet   
2019-10-11 09:13   
code review + testing ok