Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0019963Openbravo ERP09. Financial managementpublic2012-03-06 16:332012-07-03 16:18
dmiguelez 
Sandrahuguet 
normalmajoralways
closedunable to reproduce 
20Community Appliance
main 
 
Core
No
0019963: When canceling a negative payment to a sales order, it creates a wrong payment schedule detail line
First a Sales Order is created with negative amount.
Then a Payment is made to that order, and then canceled.
When creating a Sales Invoice from that order, a positive Payment Schedule Detail line is created in the database, wich is not supposed to happen.
Create the Sales orders.

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

“Business Partner”: Type CUSA and press enter key. Customer A should be showed instead.
“Transaction Document”: Standard Order
“Payment Method”: 2.1 (Spain)
“Payment Terms”: 90 days
“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”: - 500
Click the “Book” button. Click OK.

Partial Payment of one Order

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”: -200.00
Then click the “Add Details” button.
In the pop-up select:

“Transaction Type”: Orders
And then make sure that the line with:

“Sales Order No.”: The order created before.
Click the “Process” button and then OK.
Click on the “Reactivate” button. In the selector box select “Void” and click OK.

Create the Sales invoice.

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”: 90 days
Click on the button “Create Lines From”:
In the order combo box select the order created before.
Mark all the records that appear in the grid and press OK.
Click the “Complete” button. Click OK.

A wrong Payment Schedule Detail is created in the database.
This query can help to watch it:

SELECT PSD.FIN_PAYMENT_SCHEDULEDETAIL_ID, PSD.CREATED, PSD.UPDATED, PSD.AMOUNT, PS.AMOUNT, PSD.ISCANCELED
FROM FIN_PAYMENT_SCHEDULEDETAIL PSD LEFT JOIN FIN_PAYMENT_SCHEDULE PS ON PS.FIN_PAYMENT_SCHEDULE_ID=PSD.FIN_PAYMENT_SCHEDULE_INVOICE
WHERE PS.C_INVOICE_ID = (
SELECT C_INVOICE_ID
FROM C_INVOICE
WHERE DOCUMENTNO LIKE '[InvoiceDocNo]'
)
  AND PSD.ISCANCELED <> 'Y'
;

A line with +200.00 appears and it should have not existed in the first place.

One consecuence of this is:

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”: -200.00
Then click the “Add Details” button.
In the pop-up select:

“Transaction Type”: Invoices
And then make sure that the line with:

“Sales Invoice No.”: The invoice created before.
Click the “Process” button and then OK.
Click on the “Reactivate” button. In the selector box select “Void” and click OK.

An error appears, it can be watched in the screenshot attached.
VMA-Reviewed
png Pantallazo-4.png (96,439) 2012-03-06 16:33
https://issues.openbravo.com/file_download.php?file_id=5059&type=bug
png
Issue History
2012-03-06 16:33dmiguelezNew Issue
2012-03-06 16:33dmiguelezAssigned To => vmromanos
2012-03-06 16:33dmiguelezFile Added: Pantallazo-4.png
2012-03-06 16:33dmiguelezModules => Core
2012-04-11 11:46vmromanosTag Attached: VMA-Reviewed
2012-05-10 12:12gorka_gilAssigned Tovmromanos => mirurita
2012-07-03 16:04SandrahuguetStatusnew => scheduled
2012-07-03 16:04SandrahuguetAssigned Tomirurita => Sandrahuguet
2012-07-03 16:04Sandrahuguetfix_in_branch => pi
2012-07-03 16:18SandrahuguetNote Added: 0050339
2012-07-03 16:18SandrahuguetStatusscheduled => closed
2012-07-03 16:18SandrahuguetResolutionopen => unable to reproduce

Notes
(0050339)
Sandrahuguet   
2012-07-03 16:18   
This issue has been closed because it is not happening in PI.