Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0019532Openbravo ERP09. Financial managementpublic2012-01-20 10:582012-01-26 18:26
psarobe 
gorkaion 
immediatemajoralways
closedfixed 
5
 
3.0MP8 
Core
No
0019532: Payment schedule detail does not get updated when you close the order
When you have a sales order and you invoice it but without delivering anything or less than the quantity invoiced then the data becomes inconsistent when closing the sales order. For example.

Before closing:
Amount 1000€, ordered 1000€, delivered 0€, invoiced 1000€
Payment schedule detail 1000€

After closing:
Amount 0€, ordered 0€, delivered 0€, invoiced 1000€
Payment schedule detail 1000# and THIS IS WRONG
1. Login as Openbravo/openbravo
2. Change the role to QA testing admin
3. Go to Sales order window. click new
4. Select the Customer A and change the invoice rule to immediate. Save
5. Create a line and select the product Final Good A and quantity 5. Save
6. Click Book. Total gross amount= 10,35
5. Go to Sales invoice and click new. Select Customer A. Save
6. Click the button create lines from and select the above sales order
7. Click the complete button
8. Go back to the above sales order and close the order

Now the amount is 0 which is correct but the Payment in Plan remains as 10,35

Tables for this order:

Fin_payment_schedule still shows 10,35
Fin_payment_scheduledetails shows 10,35

No tags attached.
related to defect 00192253.0MP8 closed jecharri Data of payment plan are not updated if you close the order 
depends on defect 0019534 closed gorkaion Qty ordered gets updated to qty delivered even when the qty invoiced is bigger than qty delivered when closing the order 
Issue History
2012-01-20 10:58psarobeNew Issue
2012-01-20 10:58psarobeAssigned To => jonalegriaesarte
2012-01-20 10:58psarobeModules => Core
2012-01-20 11:05jonalegriaesarteAssigned Tojonalegriaesarte => jecharri
2012-01-20 11:08jonalegriaesarteRelationship addedrelated to 0019225
2012-01-20 11:21psarobeAssigned Tojecharri => jonalegriaesarte
2012-01-20 11:21psarobeSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=3072#r3072
2012-01-20 11:29psarobeRelationship addeddepends on 0019534
2012-01-23 10:41gorkaionAssigned Tojonalegriaesarte => gorkaion
2012-01-24 17:26gorkaionNote Added: 0044518
2012-01-24 17:45gorkaionStatusnew => scheduled
2012-01-24 17:45gorkaionfix_in_branch => pi
2012-01-24 17:45gorkaionNote Added: 0044522
2012-01-24 17:45gorkaionStatusscheduled => resolved
2012-01-24 17:45gorkaionFixed in SCM revision => 331403eece14
2012-01-24 17:45gorkaionResolutionopen => fixed
2012-01-26 18:26psarobeNote Added: 0044619
2012-01-26 18:26psarobeStatusresolved => closed
2012-01-26 18:26psarobeFixed in Version => 3.0MP8

Notes
(0044518)
gorkaion   
2012-01-24 17:26   
Developer steps to test the fix.

Several test cases have been designed based on the delivered, invoiced and paid amounts. All test cases have been tested in both Sales and Purchase flows using Oracle. On postgresql test case #4 for purchases and #7 for sales have been tested.

test case number;ordered qty;delivered qty;invoiced qty;paid qty
1;10;8;0;0
2;10;5;8;0
3;10;5;3;0
4;10;0;5;0
5;10;3;5;0
6;10;5;5;5
7;10;5;6;3
8;10;0;5;8

Step to test each case:
1 Create order and book
2 Create receipt/shipment, invoice and payment if necessary.
3 Close order
4 Check in database order's fin_payment_scheduledetails
(0044522)
gorkaion   
2012-01-24 17:45   
fixed in
https://code.openbravo.com/erp/devel/pi/rev/331403eece14 [^]
(0044619)
psarobe   
2012-01-26 18:26   
Works fine