Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0020041Openbravo ERP09. Financial managementpublic2012-03-15 18:392012-06-07 13:27
dmiguelez 
dmiguelez 
normalmajoralways
closedfixed 
20Community Appliance
pi 
3.0MP13 
Core
No
0020041: It does not balance as intended the amount when making a Payment to an Invoice
In the following scenario, when making a Payment to an Invoice, it does not share the amount paid between the payment lines as intended.
Test Cases from [EPPf010] to [EPPf090]

[EPPf010]

Create the Sales Order.

Login as:

Username: QAAdmin
Password: QAAdmin
Go to Sales Management || Transactions || Sales order:
Click New and select:

“Transaction Document”: Standard Order
“Business Partner”: Type CUSA and press enter key. Customer A should be showed instead.
“Order date”: System +1 month 5 days.
“Scheduled Delivery date”: System +1 month 5 days.
“Payment Method”: 2.1 (Spain)
“Payment Terms”: 30-60-90
“Invoice Terms”: Immediate
Move to Lines. Click new and select:

“Product”: Type FGA and press enter key. Final good A should be showed instead.
“Order Quantity”: - 101
Click New and select:

“Product”: Type FGB and press enter key. Final good B should be showed instead.
“Order Quantity”: - 102
Click the “Book” button. Click OK.

[EPPf020]
Create the Sales Order.

Login as:

Username: QAAdmin
Password: QAAdmin
Go to Sales Management || Transactions || Sales order:
Click New and select:

“Transaction Document”: Standard Order
“Business Partner”: Type CUSA and press enter key. Customer A should be showed instead.
“Order date”: System +1 month 10 days.
“Scheduled Delivery date”: System +1 month 10 days.
“Payment Method”: 2.1 (Spain)
“Payment Terms”: 30-60-90
“Invoice Terms”: Immediate
Move to Lines. Click new and select:

“Product”: Type FGA and press enter key. Final good A should be showed instead.
“Order Quantity”: 201
Click the “Book” button. Click OK.

[EPPf030]
Create the Sales Order.
Login as:

Username: QAAdmin
Password: QAAdmin
Go to Sales Management || Transactions || Sales order:
Click New and select:

“Transaction Document”: Standard Order
“Business Partner”: Type CUSA and press enter key. Customer A should be showed instead.
“Order date”: System +1 month 15 days.
“Scheduled Delivery date”: System +1 month 15 days.
“Payment Method”: 2.1 (Spain)
“Payment Terms”: 30-60-90
“Invoice Terms”: Immediate
Move to Lines. Click new and select:

“Product”: Type FGA and press enter key. Final good A should be showed instead.
“Order Quantity”: - 301
Click New and select:

“Product”: Type FGB and press enter key. Final good B should be showed instead.
“Order Quantity”: - 302
Click New and select:

“Product”: Type FGC and press enter key. Final good C should be showed instead.
“Order Quantity”: - 303
Click the “Book” button. Click OK.


[EPPf040]
 Create the Sales Invoice.

Login as:

Username: QAAdmin
Password: QAAdmin
Go to Sales Management || Transactions || Sales invoice:
Click New and select:

“Business Partner”: Type CUSA and press enter key. Customer A should be showed instead.
“Payment Method”: 2.1 (Spain)
“Payment Terms”: 30-60-90
Click on the button “Create Lines From”:

In the order combo box select the order created in [EPPf010].
Mark all the records that appear in the grid and press OK.
Click on the button “Create Lines From”:

In the order combo box select the order created in [EPPf020].
Mark all the records that appear in the grid and press OK.
Click on the button “Create Lines From”:

In the order combo box select the order created in [EPPf030].
Mark all the records that appear in the grid and press OK.
Click the “Complete” button. Click OK.

[EPPf050]
Create an Executed Payment for the Invoice.

Login as:

Username: QAAdmin
Password: QAAdmin
Go to Sales Financial Management || Receivables & Payables || Transactions || Payment In:
Click New and select:

“Received From”: Type CUSA and press enter key. Customer A should be showed instead.
“Payment Method”: 2.1 (Spain)
“Amount”: -400.00
Then click the “Add Details” button.
In the pop-up select:

“Transaction Type”: Invoices
And then make sure that the only line selected is the one with the values:

“Sales Invoice No.”: The invoice created in [EPPf040].
“Due Date”: System +1 month 5 days.
“Outstanding Amount”: -639.06
Click the “Process” button and then OK.
Click on the “Execute Payment” button and then Execute.

[EPPf060]
Create a Payment for the Invoice in status Awaiting Execution.

Login as:

Username: QAAdmin
Password: QAAdmin
Go to Financial Management || Receivables & Payables || Transactions || Payment In:
Click New and select:

“Received From”: Type CUSA and press enter key. Customer A should be showed instead.
“Payment Method”: 2.1 (Spain)
“Amount”: -500.00
Then click the “Add Details” button.
In the pop-up select:

“Transaction Type”: Invoices
And then make sure that the only line selected is the one with the values:

“Sales Invoice No.”: The invoice created in [EPPf040].
“Due Date”: System +1 month 10 days.
“Outstanding Amount”: -620.25
Click the “Process” button and then OK.

[EPPf070]
Create a Payment for the Invoice with a WriteOff.

Login as:

Username: QAAdmin
Password: QAAdmin
Go to Sales Financial Management || Receivables & Payables || Transactions || Payment In:
Click New and select:

“Received From”: Type CUSA and press enter key. Customer A should be showed instead.
“Payment Method”: 2.1 (Spain)
“Amount”: -615.00
Then click the “Add Details” button.
In the pop-up select:

“Transaction Type”: Invoices
And then make sure that the only line selected is the one with the values:

“Sales Invoice No.”: The invoice created in [EPPf040].
“Due Date”: System +1 month 15 days.
“Outstanding Amount”: -620.25
Check the “Write off the difference” option at the bottom.
Click the “Process” button and then OK.
Click on the “Execute Payment” button and then Execute.

[EPPf080]
Login as:

Username: QAAdmin
Password: QAAdmin
Go to Sales Management || Transactions || Sales invoice:
Click the “Modify Payment In Plan” button:
Select the line with the value:

“Received”: -400.00
Modify the Outstanding value to: 0
Select the line with the value:

“Awaiting Execution Amount”: -500.00
Modify the Outstanding value to: -550.00
Create a new line by clicking over Add New. Set this values:

“Outstanding”: -309.31
Click the “Submit (Create new version of the plan)” button.

[EPPf090]
Make the Payment.

Login as:

Username: QAAdmin
Password: QAAdmin
Go to Sales Management || Transactions || Sales invoice:
Click the “Add Payment In/Out” button


In the PopUp notice that the amount selected is not well balance between the invoice lines, even more, the quantities pending of payment shown in the popup are not what were expected
VMA-Reviewed
related to defect 0019427 closed Sandrahuguet Issue with Add Payment In/Out process with an invoice with multiple Payment Plan lines and negative values 
png Pantallazo-8.png (126,155) 2012-03-15 18:41
https://issues.openbravo.com/file_download.php?file_id=5085&type=bug
png

png Pantallazo-9.png (122,723) 2012-03-15 18:42
https://issues.openbravo.com/file_download.php?file_id=5086&type=bug
png
Issue History
2012-03-15 18:39dmiguelezNew Issue
2012-03-15 18:39dmiguelezAssigned To => vmromanos
2012-03-15 18:39dmiguelezModules => Core
2012-03-15 18:41dmiguelezFile Added: Pantallazo-8.png
2012-03-15 18:42dmiguelezFile Added: Pantallazo-9.png
2012-03-15 18:43dmiguelezNote Added: 0046479
2012-04-11 11:45vmromanosTag Attached: VMA-Reviewed
2012-05-10 12:12gorka_gilAssigned Tovmromanos => mirurita
2012-06-01 13:47dmiguelezAssigned Tomirurita => dmiguelez
2012-06-01 13:47dmiguelezStatusnew => scheduled
2012-06-01 13:47dmiguelezfix_in_branch => pi
2012-06-01 13:50dmiguelezRelationship addedrelated to 0019427
2012-06-07 13:26hgbotCheckin
2012-06-07 13:26hgbotNote Added: 0049671
2012-06-07 13:26hgbotStatusscheduled => resolved
2012-06-07 13:26hgbotResolutionopen => fixed
2012-06-07 13:26hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/a44a29d2a0c00d1bfe4f44535fba51ea8a140864 [^]
2012-06-07 13:27miruritaNote Added: 0049673
2012-06-07 13:27miruritaStatusresolved => closed
2012-06-07 13:27miruritaFixed in Version => 3.0MP13

Notes
(0046479)
dmiguelez   
2012-03-15 18:43   
The first screenshot is what the PopUp shows, related to the Invoice I/41.
The second is what it was expected to get related to the same Invoice
(0049671)
hgbot   
2012-06-07 13:26   
Repository: erp/devel/pi
Changeset: a44a29d2a0c00d1bfe4f44535fba51ea8a140864
Author: Mikel Irurita <mikel.irurita <at> openbravo.com>
Date: Thu Jun 07 13:17:39 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/a44a29d2a0c00d1bfe4f44535fba51ea8a140864 [^]

Related to issue 19427: missing flow. Fixed issue 20041.

---
M modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/FIN_Utilities.js
---
(0049673)
mirurita   
2012-06-07 13:27   
code review + testing OK