Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0033838Openbravo ERP07. Sales managementpublic2016-08-29 11:322016-09-19 16:27
psanjuan 
markmm82 
urgentmajoralways
closedfixed 
20Professional Appliance
 
3.0PR16Q4 
aferraz
Core
No
0033838: Available inventory not correct if an order including a reserved product is closed.
Available inventory not correct if an order including a reserved product is closed.
Make sure that "Enable Stock Reservations" preference is active as "Y".
Log out and log in.

Go to F&B International Client.
Create a new product named "33838" for F&EB España. Select a purchase price list and a sales price list.

Go to purchase order and create a new one for Bebidas Alegres BP. Purchase 10 units of this new item. Book the order.

Create a Goods Receipt and receipt those 10 units in España Region Norte Wh, position RN-1-0-0 for instance. Complete the receipt.

Create a Sales order, for F&B España, Alimentos BP. Add a product line. Select the product and enter 2 units. Leave "Stock Reservation" field empty.

Go to Manage Reservation and press done.

Go to Reserved Stock and check a new record has been created for this order with below info:
Quantity = Reserved Qty = 2, Released = 0


Check also that both Sales Header and Sales order line shows as reservation status "Completely Reserved".

Create now a goods shipment, and ship two units of the product, from RN-1-0-0. Complete the shipment.

Check that Stock Reservation status has changed to "Closed" as it shows Release qty= 2.

Go to the Sales Order and Close it.
Verify that both Sales Header and Sales order line shows as reservation status "Completely Reserved" still.

Go to the Stock Reservation related to the order. It remains the same.
Quantity = Reserved Qty = Released = 2.

Go to Goods Shipment window and void the shipment.

Check a new stock reservation has been created in status completed, but related to the order in status closed, with Quantity = 2 - Reserved Qty= 2, Release = 0. This is not correct.

Create another Sales order. Select the product and enter once again 2 units.
Go to the line and press Manage Reservation button.

Check below info is shown, which is not correct.

Available Qty = 10
Reserved in others = 2
Quantity = 2

As it should be:
Available Qty = 10
Reserved in others = 0
Quantity = 2

Press cancel.


A new stock reservation in status "Completed" is created against an order (sales order) in status closed, this order can not be shipped, therefore a remaining reservation is shown there still while it should not be.

Correct information shown should have been:
Available Qty = 10
Reserved in others = 0
Quantity = 2
No tags attached.
related to defect 0033837 closed markmm82 Reservation Status info is not correct if an order including a reserved product is closed. 
related to defect 0033752 closed markmm82 Cannot close an order if the stock was reserved and the associated goods shipment is voided 
Issue History
2016-08-29 11:32psanjuanNew Issue
2016-08-29 11:32psanjuanAssigned To => Triage Finance
2016-08-29 11:32psanjuanModules => Core
2016-08-29 11:32psanjuanTriggers an Emergency Pack => No
2016-08-29 11:33psanjuanRelationship addedrelated to 0033837
2016-08-29 11:38psanjuanSummarytbd => Available inventory not correct if an order including a reserved product is closed.
2016-08-29 11:38psanjuanDescription Updatedbug_revision_view_page.php?rev_id=12936#r12936
2016-08-29 11:38psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=12938#r12938
2016-08-29 11:41psanjuanNote Added: 0089489
2016-08-29 11:41psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=12939#r12939
2016-08-29 11:51psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=12940#r12940
2016-08-29 11:51psanjuanProposed Solution updated
2016-08-29 11:54psanjuanNote Edited: 0089489bug_revision_view_page.php?bugnote_id=0089489#r12942
2016-08-29 11:57psanjuanNote Edited: 0089489bug_revision_view_page.php?bugnote_id=0089489#r12943
2016-08-29 11:58psanjuanRelationship addedblocks 0033752
2016-08-29 13:36psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=12944#r12944
2016-08-29 14:14psanjuanProposed Solution updated
2016-08-29 15:07psanjuanNote Edited: 0089489bug_revision_view_page.php?bugnote_id=0089489#r12945
2016-08-29 15:07psanjuanRelationship addedrelated to 0033842
2016-09-05 10:54psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=13038#r13038
2016-09-05 10:57psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=13039#r13039
2016-09-05 11:19psanjuanProposed Solution updated
2016-09-05 11:21psanjuanNote Deleted: 0089489
2016-09-05 18:05aferrazRelationship deletedblocks 0033752
2016-09-05 18:05aferrazRelationship addedrelated to 0033752
2016-09-06 16:59markmm82Statusnew => scheduled
2016-09-06 16:59markmm82Assigned ToTriage Finance => markmm82
2016-09-07 17:49ngarciaResolution time => 1475013600
2016-09-12 16:21markmm82Note Added: 0089900
2016-09-16 09:59hgbotCheckin
2016-09-16 09:59hgbotNote Added: 0090032
2016-09-16 09:59hgbotStatusscheduled => resolved
2016-09-16 09:59hgbotResolutionopen => fixed
2016-09-16 09:59hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/676e265994661b17ddd4fcd452b71d8443659aa5 [^]
2016-09-16 10:02aferrazReview Assigned To => aferraz
2016-09-16 10:02aferrazNote Added: 0090034
2016-09-16 10:02aferrazStatusresolved => closed
2016-09-16 10:02aferrazFixed in Version => 3.0PR16Q4
2016-09-19 16:27hudsonbotCheckin
2016-09-19 16:27hudsonbotNote Added: 0090073

Notes
(0089900)
markmm82   
2016-09-12 16:21   
Test Plan
- Active "Enable Stock Reservations" preference".
- Log out and log in.

Go to F&B International Client.
1. Create a new product named "33838" for F&EB España. Select a purchase price list and a sales price list.
2. Go to purchase order and create a new one for Bebidas Alegres BP. Purchase 10 units of this new item. Book the order.
3. Create a Goods Receipt and receipt those 10 units in España Region Norte Wh, position RN-1-0-0 for instance. Complete the receipt.
4. Create a Sales order, for F&B España, Alimentos BP. Add a product line. Select the product and enter 2 units. Leave "Stock Reservation" field empty.
5. Go to Manage Reservation and press done.
6. Go to Reserved Stock and check a new record has been created for this order with below info:
     Quantity = Reserved Qty = 2, Released = 0
   Check also that both Sales Header and Sales order line shows as reservation status "Completely Reserved".
7. Create now a goods shipment, and ship two units of the product, from RN-1-0-0. Complete the shipment.
8. Check that Stock Reservation status has changed to "Closed" as it shows Release qty= 2.
9. Go to the Sales Order and Close it.
   Verify that both Sales Header and Sales order line shows as reservation status "Not Reserved".
   Go to the Stock Reservation related to the order. It remains the same.
     Quantity = Reserved Qty = Released = 2.
10. Go to Goods Shipment window and void the shipment.
11. Check that no new stock reservation has been created.
12. Create another Sales order. Select the product and enter once again 2 units.
13. Go to the line and press Manage Reservation button.
14. Check below info is shown, which is correct.
     Available Qty = 10
     Reserved in others = 0
     Quantity = 2
15. Press cancel.
(0090032)
hgbot   
2016-09-16 09:59   
Repository: erp/devel/pi
Changeset: 676e265994661b17ddd4fcd452b71d8443659aa5
Author: Mark <markmm82 <at> gmail.com>
Date: Thu Sep 15 12:14:10 2016 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/676e265994661b17ddd4fcd452b71d8443659aa5 [^]

Fixes issue 33838: Correct Stock Reservation when created from a closed order

When voiding a shipment related to a reserved order, if order is closed, new reservation will not be created (in case order was fully shipped) and existing reservation will not be updated (in case order was partially shipped).
Besides, when closing an order, related reservation will be also closed.

---
M src-db/database/model/functions/C_ORDER_POST1.xml
M src-db/database/model/functions/M_INOUT_POST.xml
---
(0090034)
aferraz   
2016-09-16 10:02   
Code review + Testing OK
(0090073)
hudsonbot   
2016-09-19 16:27   
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/17da7ad0ad62 [^]
Maturity status: Test