Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0040392Openbravo ERPZ. Otherspublic2019-03-15 10:322019-03-28 14:56
ngarcia 
markmm82 
urgentmajoralways
closedfixed 
5
 
3.0PR19Q2 
Sandrahuguet
Core
No
0040392: Cannot modify payment plan of an invoice if it is already modified
Cannot modify payment plan of an invoice if it is already modified
As System Admin mode:
   Set Modify Payment Plan field in Payment Plan tab of Purchase Invoice and Sales Invoice windows

Compile the window and restart Tomcat

As group admin role:
   Create a Purchase Invoice with a total amount of 381.15 and complete it
   Modify it's Payment Plan:
      1) Change the amount of the line to 200
      2) Add a new line with a different Due date and Payment Method and an amount of 181.15
   Submit
   Refresh the tab and check two lines are created
   Modify it's Payment Plan again: try to change the Payment Method in the second line
   Check the following error message is shown:
      "One or more fields contain illegal values, check the errors for each field."
   The Outstanding field of the two lines appear in red
   
No tags attached.
causes defect 0041732pi closed collazoandy4 Modify payment plan recalculation when deleting line 
Issue History
2019-03-15 10:32ngarciaNew Issue
2019-03-15 10:32ngarciaAssigned To => Triage Finance
2019-03-15 10:32ngarciaModules => Core
2019-03-15 10:32ngarciaResolution time => 1554415200
2019-03-15 10:32ngarciaTriggers an Emergency Pack => No
2019-03-15 10:33ngarciaIssue Monitored: networkb
2019-03-15 10:39SandrahuguetAssigned ToTriage Finance => markmm82
2019-03-15 16:52jfrancesIssue Monitored: jfrances
2019-03-18 22:25markmm82Statusnew => scheduled
2019-03-18 22:37markmm82Note Added: 0110485
2019-03-25 20:19markmm82Note Added: 0110637
2019-03-25 20:19markmm82Note Edited: 0110637bug_revision_view_page.php?bugnote_id=0110637#r18528
2019-03-26 12:27hgbotCheckin
2019-03-26 12:27hgbotNote Added: 0110655
2019-03-26 12:27hgbotStatusscheduled => resolved
2019-03-26 12:27hgbotResolutionopen => fixed
2019-03-26 12:27hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/a121302dfba615e486bbfcd4fe8caaed6116e051 [^]
2019-03-26 13:02SandrahuguetReview Assigned To => Sandrahuguet
2019-03-26 13:02SandrahuguetNote Added: 0110657
2019-03-26 13:02SandrahuguetStatusresolved => closed
2019-03-26 13:02SandrahuguetFixed in Version => 3.0PR19Q2
2019-03-28 14:56hudsonbotCheckin
2019-03-28 14:56hudsonbotNote Added: 0110892
2021-09-30 18:06vmromanosRelationship addedcauses 0041732

Notes
(0110485)
markmm82   
2019-03-18 22:36   
Test Plan:
As System Admin mode:
   Set Modify Payment Plan field in Payment Plan tab of Purchase Invoice and Sales Invoice windows

Compile the window and restart Tomcat

As group admin role:
   Create a Purchase Invoice with a total amount of 381.15 and complete it
   Modify it's Payment Plan:
      1) Change the amount of the line to 200
      2) Add a new line with a different Due date and Payment Method and an amount of 181.15
   Submit
   Refresh the tab and check two lines are created
   Modify it's Payment Plan again: try to change the Payment Method in the second line
   Check no error message is shown.

   Modify it's Payment Plan again: try to change the amounts in both lines keeping the sum of them equals than the outstanding origina amount (381.15). For example you can exchange the amount of each line, set 200 in the second line and 181.15 in the first line.
   Submit
   Refresh the tab and check two lines are updated with the previously changed amounts.

   Modify it's Payment Plan again: try to change the amounts in any line in a way that the sum of the new outstanding amounts is different than the original one (381.15). For example you set 400 in the second line .
   Submit
   Check an error message is shown.
      "One or more fields contain illegal values, check the errors for each field."
   The Outstanding field of the two lines appear in red as the sum of the new enetered outstanding amount is different tha the original one.
(0110637)
markmm82   
2019-03-25 20:19   
Test Plan 2: Repeat the process more than once.
As System Admin mode:
   Set Modify Payment Plan field in Payment Plan tab of Purchase Invoice and Sales Invoice windows

Compile the window and restart Tomcat

As group admin role:
   Create a Purchase Invoice with a total amount of 381.15 and complete it
   Modify it's Payment Plan:
      1) Change the amount of the line to 200
      2) Add a new line with a different Due date and Payment Method and an amount of 181.15
   Submit
   Refresh the tab and check two lines are created
   Modify it's Payment Plan again: try to change the Payment Method in the second line
   Check no error message is shown.

   Modify it's Payment Plan again: try to change the amount in the line with 200:
      1) Change the amount of the line to 100
      2) Add a new line with a different Due date and Payment Method. Notice that Outstanding amount is automatically set as 100 as it is the amount remaining not included in other lines.
   Submit
   Refresh the tab and check three lines are there
   Modify it's Payment Plan again: try to change the Payment Method in any line
   Check no error message is shown.

(0110655)
hgbot   
2019-03-26 12:27   
Repository: erp/devel/pi
Changeset: a121302dfba615e486bbfcd4fe8caaed6116e051
Author: Mark Molina <mark.molina <at> doceleguas.com>
Date: Mon Mar 18 18:27:33 2019 -0300
URL: http://code.openbravo.com/erp/devel/pi/rev/a121302dfba615e486bbfcd4fe8caaed6116e051 [^]

Fixes issue 40392: Can't modify an invoice payment plan if it's already modified

This solution takes into account all the Payment Plan lines when calculating that
modified outstanding amounts are modified.
Also, all the payment plan expected amounts are updated if the sum of the updated
outstandings amounts are equals than original outstanding amount of the invoice instead
of just update the last record.

Also when a new record is added are taken into account all the lines and the new
outstanding amount is calculated by subtract to the total expected the total already paid
and the total outstanding in the existing lines.

---
M modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-utilities.js
---
(0110657)
Sandrahuguet   
2019-03-26 13:02   
Code review + testing OK
(0110892)
hudsonbot   
2019-03-28 14:56   
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/b2fbc1588df4 [^]
Maturity status: Test