Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0036690
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 05. Production managementmajoralways2017-08-22 12:582017-09-21 16:49
ReporterngarciaView Statuspublic 
Assigned Tomarkmm82 
PriorityurgentResolutionfixedFixed in Version3.0PR17Q4
StatusclosedFix in branchFixed in SCM revision708d0981673d
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toaferraz
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0036690: Insufficient stock in Create Standards Process of Work Effort - Production Run tab if stock is in different priority warehouses

DescriptionInsufficient stock in Create Standards Process of Work Effort - Production Run tab if stock is in different priority warehouses

The problem is that in M_GET_STOCK_PARAM function v_qtyaux is decreased on each loop and v_finalqty has the total value in the following piece of code:

      v_qtyaux := v_qtyaux - v_finalqty;
      IF (v_qtyaux <= 0) THEN
        DELETE FROM m_stock_proposed
        WHERE ad_pinstance_id = p_uuid
          AND (priority > cur_warehouse.priority
              OR isfinal = 'N');
        EXIT;
      END IF;
Steps To ReproduceAs group admin role:
   Create two new warehouses for F&B España Region Norte
   Add a locator to them
   Assign them as on hand warehouse to F&B España Region Norte organization (add also Region Norte WH in case it is not defined) and change their priority to 10, 20 and 30 respectively.
   Check all its locators have a inventory status that does not accept overissue (for example Undefined). Change it if not

   Create a new product: consumed
   Set it as production
   Add 13 units of it in the warehouse with 10 priority
   Add 8 units of it in the warehouse with 20 priority
   Add more than 9 units of it in the warehouse with 30 priority

   Create a new product: produced
   Set it as production
   Create a record in Manufacturing tab for España Norte org and any locator

   Create an Activity
   Create a Process Plan, Version and Operation
   Set Create Standards to 'N'
   Add 30 units of the previously created product to be consumed (P-)
   Add 1 unit of the previously created product to be produced (P+)

   Create a Work Requirement for that Process Plan and process it (Quantity: 1)
   Create Work Effort
   Go to Work Effort - Production Run tab, set Completed Quantity to 1 and Create Standards
   You will get the following error:
      Insufficient stock:: <productName>
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0036681 closedmarkmm82 Insufficient stock in Create Standards Process of Work Effort - Production Run tab if decimal quantities are consumed 

-  Notes
(0098711)
markmm82 (developer)
2017-08-29 19:17
edited on: 2017-08-29 20:09

Test Plan 1: Using different warehouses, locators and priorities. Product with Enough Stock.

As group admin role:
1. Go to Warehouse and Storage Bins and create a new one for F&B US East Coast.
     Search Key = Name = EC2
2. Add a locator to them.
     Search Key = Name = L2
3. Change Inventory Status to Undefined.

4. Go to Warehouse and Storage Bins and create a new one for F&B US East Coast.
     Search Key = Name = EC3
5. Add a locator to them.
     Search Key = Name = L3
6. Change Inventory Status to Undefined.

7. Assign both created warehouses as on hand warehouse to F&B US East Coast organization
     Ensure it is also added East Coast WH in case it is not defined.
8. Change their priority to 10, 20 and 30 respectively.

9. Create a new product: consumed
     Set it as production

10. Go to Goods receipt windows and create a new one:
     Business partner = Be Soft Drinker, Inc.
     Warehouse = US East Coast (priority = 10)
11. Add a new line:
     Product = Consumed
     Quantity = 13
     Storage Bin = EC-2-0-0
12. Complete the receipt.

13. Go to Goods receipt windows and create a new one:
     Business partner = Be Soft Drinker, Inc.
     Warehouse = EC2 (priority = 20)
14. Add a new line:
     Product = Consumed
     Quantity = 8
     Storage Bin = L2
15. Complete the receipt.

16. Go to Goods receipt windows and create a new one:
     Business partner = Be Soft Drinker, Inc.
     Warehouse = EC3 (priority = 30)
17. Add a new line:
     Product = Consumed
     Quantity = 10
     Storage Bin = L3
18. Complete the receipt.


19. Create a new product: produced
     Set it as production
     Create a record in Manufacturing tab for US East Coast org and any locator, for example EC-0-0-0

20. Create an Activity
21. Create a Process Plan, Version and Operation
     Set Create Standards to 'N'
22. Go to I/O Products tab and create two lines with following data:
     Line 10:
          Product = consumed
          Production Type = Product use (P-)
          Quantity = 30
     Line 20:
          Product = produced
          Production Type = Product Production (P+)
          Quantity = 1

23. Create a Work Requirement
     Organization = F&B US East Coast
     Process Plan = previously created
     Quantity = 1
24. Process it.

25. Create Work Effort and set Today as date.
 
26. Go to Work Effort - Production Run tab, set Completed Quantity to 1.
27. Execute Create Standards process.
     Notice you don't get any error and process ends successfully.

28. Go to Work Effort - Production Run tab - Product tab and notice there are 4 new lines:
     Line 10: Product = produced, Production Type = Product Production (P+), Qty = 1, Storage Bin = EC-0-0-0 (defined in Manufacturing tab of product)
     Line 20: Product = consumed, Production Type = Product use (P-), Qty = 13, Storage Bin = EC-2-0-0 (defined in step 11)
     Line 30: Product = consumed, Production Type = Product use (P-), Qty = 8, Storage Bin = L2 (defined in step 14)
     Line 40: Product = consumed, Production Type = Product use (P-), Qty = 9, Storage Bin = L3 (defined in step 17)



-------------------------------------------


Test Plan 2: Using different warehouses with different and same priorities. Product with Enough Stock.

As group admin role:
1. Go to Warehouse and Storage Bins and create a new one for F&B US West Coast.
     Search Key = Name = WC2
2. Add a locator to them.
     Search Key = Name = WL2
3. Change Inventory Status to Undefined.

4. Go to Warehouse and Storage Bins and create a new one for F&B US West Coast.
     Search Key = Name = WC3
5. Add a locator to them.
     Search Key = Name = WL3
6. Change Inventory Status to Undefined.

7. Assign both created warehouses as on hand warehouse to F&B US West Coast organization
     Ensure it is also added US West Coast WH in case it is not defined.
8. Change their priority to 10, 20 and 20 respectively.
     Notice WC2 and WC3 have the same priority = 20.

9. Create a new product: consumed
     Set it as production

10. Go to Goods receipt windows and create a new one:
     Business partner = Be Soft Drinker, Inc.
     Warehouse = US West Coast (priority = 10)
11. Add a new line:
     Product = Consumed
     Quantity = 13
     Storage Bin = WC-1-0-0
12. Complete the receipt.

13. Go to Goods receipt windows and create a new one:
     Business partner = Be Soft Drinker, Inc.
     Warehouse = WC2 (priority = 20)
14. Add a new line:
     Product = Consumed
     Quantity = 8
     Storage Bin = WL2
15. Complete the receipt.

16. Go to Goods receipt windows and create a new one:
     Business partner = Be Soft Drinker, Inc.
     Warehouse = WC3 (priority = 20)
17. Add a new line:
     Product = Consumed
     Quantity = 10
     Storage Bin = WL3
18. Complete the receipt.


19. Create a new product: produced
     Set it as production
     Create a record in Manufacturing tab for US West Coast org and any locator, for example WC-0-0-0

20. Create an Activity
21. Create a Process Plan, Version and Operation
     Set Create Standards to 'N'
22. Go to I/O Products tab and create two lines with following data:
     Line 10:
          Product = consumed
          Production Type = Product use (P-)
          Quantity = 30
     Line 20:
          Product = produced
          Production Type = Product Production (P+)
          Quantity = 1

23. Create a Work Requirement
     Organization = F&B US West Coast
     Process Plan = previously created
     Quantity = 1
24. Process it.

25. Create Work Effort and set Today as date.
 
26. Go to Work Effort - Production Run tab, set Completed Quantity to 1.
27. Execute Create Standards process.
     Notice you don't get any error and process ends successfully.

28. Go to Work Effort - Production Run tab - Product tab and notice there are 4 new lines:
     Line 10: Product = produced, Production Type = Product Production (P+), Qty = 1, Storage Bin = WC-0-0-0 (defined in Manufacturing tab of product)
     Line 20: Product = consumed, Production Type = Product use (P-), Qty = 13, Storage Bin = WC-1-0-0 (defined in step 11)
     Line 30: Product = consumed, Production Type = Product use (P-), Qty = 8, Storage Bin = WL2 (defined in step 14)
     Line 40: Product = consumed, Production Type = Product use (P-), Qty = 9, Storage Bin = WL3 (defined in step 17)



----------------------------------------------------------


Test Plan 3: Using different warehouses, locators and priorities. Product with Insufficient Stock.

As group admin role:
   Create two new warehouses for F&B España Region Norte
   Add a locator to them
   Assign them as on hand warehouse to F&B España Region Norte organization (add also Region Norte WH in case it is not defined) and change their priority to 10, 20 and 30 respectively.
   Check all its locators have a inventory status that does not accept overissue (for example Undefined). Change it if not

   Create a new product: consumed
   Set it as production
   Add 13 units of it in the warehouse with 10 priority
   Add 8 units of it in the warehouse with 20 priority
   Add less than 9 units of it in the warehouse with 30 priority

   Create a new product: produced
   Set it as production
   Create a record in Manufacturing tab for España Norte org and any locator

   Create an Activity
   Create a Process Plan, Version and Operation
   Set Create Standards to 'N'
   Add 30 units of the previously created product to be consumed (P-)
   Add 1 unit of the previously created product to be produced (P+)

   Create a Work Requirement for that Process Plan and process it (Quantity: 1)
   Create Work Effort
   Go to Work Effort - Production Run tab, set Completed Quantity to 1 and Create Standards
   You will get the following error:
      Insufficient stock: consumed

(0098737)
markmm82 (developer)
2017-08-30 17:15
edited on: 2017-08-30 20:22

Test Plan 4: Related to issue 22231: Qty on hand warehouses and rules

1. Go to Organization window, select F&B US, Inc. and go to to Warehouse tab.
   Notice there are two on-hand warehouses:
     - US East Coast
     - US West Coast
2. Configure a new product as follows:
   Organization = F&B US, Inc.
   Name = Search Key = TestingProduct
3. Add purchase and sales price list to it.

4. Create a new Goods Receipt for F&B US, Inc. organization and US East coast Warehouse.
5. Add a line with created product:
   Product = TestingProduct
   Storage Bin = EC-0-0-0
   Movement Quantity = 45 Units
6. Add another line with created product:
   Product = TestingProduct
   Storage Bin = EC-1-0-0
   Movement Quantity = 30 Units
7. Complete the receipts.

8. Create a new Goods Receipt for F&B US, Inc. organization and US West coast Warehouse.
9. Add a line with created product:
   Product = TestingProduct
   Storage Bin = WC-0-0-0
   Movement Quantity = 12 Units
10. Add another line with created product:
   Product = TestingProduct
   Storage Bin = WC-1-0-0
   Movement Quantity = 65 Units
11. Complete the receipts.

12. Create a sales order with a line:
    Product = TestingProduct
    Ordered Quantity = 60
    Warehouse Rule = Unique Storage Bin.
13. Complete the sales order.

14. Go to the window "Create shipments from order". Select the above sales order.
15. Click process and good shipment will be created.
16. Go to Goods Shipment window and select it. Notice in the created line, that good shipment took the storage bin WC-1-0-0 of the US West coast Warehouse
    It is correct as it is the only one with available stock in an unique storage bin according the warehouse rule applied in sales order.


Test Plan 5: Related to issue 22231: Qty on hand warehouses and NO rules applied

1. Go to Organization window, select F&B US, Inc. and go to to Warehouse tab.
   Notice there are two on-hand warehouses:
     - US East Coast
     - US West Coast
2. Configure a new product as follows:
   Organization = F&B US, Inc.
   Name = Search Key = TestingProduct2
3. Add purchase and sales price list to it.

4. Create a new Goods Receipt for F&B US, Inc. organization and US East coast Warehouse.
5. Add a line with created product:
   Product = TestingProduct2
   Storage Bin = EC-0-0-0
   Movement Quantity = 45 Units
6. Add another line with created product:
   Product = TestingProduct2
   Storage Bin = EC-1-0-0
   Movement Quantity = 30 Units
7. Complete the receipts.

8. Create a new Goods Receipt for F&B US, Inc. organization and US West coast Warehouse.
9. Add a line with created product:
   Product = TestingProduct2
   Storage Bin = WC-0-0-0
   Movement Quantity = 12 Units
10. Add another line with created product:
   Product = TestingProduct2
   Storage Bin = WC-1-0-0
   Movement Quantity = 65 Units
11. Complete the receipts.

12. Create a sales order with a line for US East coast warehouse:
    Product = TestingProduct2
    Ordered Quantity = 60
    Warehouse Rule = EMPTY.
13. Complete the sales order.

14. Go to the window "Create shipments from order". Select the above sales order.
15. Click process and good shipment will be created.
16. Go to Goods Shipment window and select it. Notice in the created lines, that good shipment took the storage bins from East coast Warehouse:
    45 Units from EC-0-0-0
    15 Units from EC-1-0-0



Test Plan 6
Repeat 1-11 steps of Test Plan 5.
In 12 step when you create the sales order header, select US West coast warehouse instead of US East coast warehouse.
Repeat 13-16 steps
In 16 step, you will get a shipment with following lines:
    12 Units from WC-0-0-0
    48 Units from WC-1-0-0

(0098738)
markmm82 (developer)
2017-08-30 20:23

Test Plan 7 Related to issue 36681: Insufficient stock in Create Standards Process of Work Effort - Production Run tab
if decimal quantities are consumed

As group admin role:
   Create a new warehouse for F&B España Region Norte
   Add a locator to it
   Increase its Relative Priority to 100
   Assign it as on hand warehouse to F&B España Region Norte organization

   Create a new product: consumed
   Set it as production
   Add 4 units of it in Region Norte warehouse
   Add more units of it in the new created warehouse

   Create a new product: produced
   Set it as production
   Assign a locator to it in the Manufacturing tab

   Create an Activity
   Create a Process Plan, Version and Operation
   Set Create Standards to 'N'
   Add 4.4 units of the previously created product to be consumed (P-)
   Add 1 unit of the previously created product to be produced (P+)

   Create a Work Requirement for that Process Plan and process it (Quantity: 1)
   Create Work Effort
   Go to Work Effort - Production Run tab, set Completed Quantity to 1
   Run Create Standards process.
   Notice it finishes successfully.
(0098739)
markmm82 (developer)
2017-08-30 21:24

Test Plan 8 Related to issue 29539: Issues in Reservations related to Reallocate Stock functionality

0. Active Enable Stock reservations preference.

1. Create new Product

  Go to Product Window and create a new record
     Organization: F&B US
     SearchKey: Test Product
     Name: Test Product
     Tax Category: Exempt
     Sale: Checked
     Product Type: Item
     Stocked: Checked
     Attribute Set: Lot
  Go to Price Tab and create a new record
    Price List Version: General Sales
    Unit Price: 10
    List Price: 10


2. Add Stock

  Go to Physical Inventory Window and create a new record
    Organization: F&B US
    Warehouse: US East Coast
  Go to Lines Tab and create a new record
    Product. Click on the magnifing glass. Click on the funnel icon. Filter Search Key by Test Product. Pick the record that has no Attribute defined
    Attribute Set Value: Create new one. 0001
    Storage Bin: EC-0-0-0
    Quantity Count: 10
  Click on Process Inventory Count

  Create another record in Physical Inventory Window
    Organization: F&B US
    Warehouse: US East Coast
  Go to Lines Tab and create a new record
    Product. Click on the magnifing glass. Click on the funnel icon. Filter Search Key by Test Product. Pick the record that has no Attribute defined
    Attribute Set Value: Create new one. 0002
    Storage Bin: EC-0-0-0
    Quantity Count: 10
  Click on Process Inventory Count


3. Create Sales Orders with Reservations

  Go to Sales Order Window and create a new record
    Organization: F&B US
    Business Partner: Healthy Food SuperMarkets
    Warehouse: US East Coast
    Invoice Terms: Immediate
  Go to Lines Tab and create a new record
    Product: Test Product
    Ordered Quantity: 5
  Go to Basic Discounts Tab and delete the existing record
  Book the Order
  Select the Sales Order Line and click on Manage Reservations button
  Select the Line with Attribute Set Value L0001 and set Quantity to 5 and click on Done

  Create another record in Sales Order Window
    Organization: F&B US
    Business Partner: Healthy Food SuperMarkets
    Warehouse: US East Coast
    Invoice Terms: Immediate
  Go to Lines Tab and create a new record
    Product: Test Product
    Ordered Quantity: 10
  Go to Basic Discounts Tab and delete the existing record
  Book the Order
  Select the Line and click on Manage Reservations button
  Select the Line with Attribute Set Value L0002 and set Quantity to 10 and click on Done


4. Check the data before moving forward

  This query can help, just replace productid with the m_product_id desired

    select l.value, sd.m_storage_detail_id, a.lot, a.m_attributesetinstance_id, qtyonhand, reservedqty, allocatedqty
    from m_storage_detail sd
      join m_locator l using (m_locator_id)
      join m_attributesetinstance a using (m_attributesetinstance_id)
    where m_product_id = productid
      and l.em_obwhs_type IS NULL OR l.em_obwhs_type <> 'OUT'
      and lot is not null;

  It should return something like this

    Lot ------ qtyonhand ----- reservedqty ----- allocatedqty
    0001 ----- 10 ------------ 5 --------------- 0
    0002 ----- 10 ----------- 10 -------------- 0


5. Generate PickList

  Back in Sales Order Window, select the Sales Order that has 10 as the Ordered Quantity
  Click on the Generate PickList button and generate a PickList using Outbound Locator.
  Note: Be sure you has configured Warehouse Picking List dataset and an outbound locator.
  
  By launching the previous query it will return something like
    Lot ------ qtyonhand ----- reservedqty ----- allocatedqty
    0001 ----- 10 ------------ 10 -------------- 5
    0002 ----- 10 ------------ 5 --------------- 5

  As expected
(0098785)
hgbot (developer)
2017-09-04 09:12

Repository: erp/devel/pi
Changeset: 708d0981673dc18d7ea644daf1819245c966fa26
Author: Mark <markmm82 <at> gmail.com>
Date: Fri Sep 01 12:26:19 2017 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/708d0981673dc18d7ea644daf1819245c966fa26 [^]

Fixes issue 36690: Insufficient stock in Create Standards Process of Work Effort

When Create Standards Process of Work Effort - Production Run tab was executed
if stock is in different priority warehouses, an error message Insufficient stock
is shown even if there is stock of the product.

Problem was that in M_GET_STOCK_PARAM function v_qtyaux is decreased on each loop
and v_finalqty is taking into account stock in warehouses of the same priority than
currently analyzed, when v_qtyaux is updated always is subtracted the sum of
m_stock_proposed lines with priority less or equal than current and it is wrong.

Solution is always compare the requested quantity (v_quantity) with sum of quantities
from m_stock_proposed lines with priority less or equal than current iteration.

---
M src-db/database/model/functions/M_GET_STOCK_PARAM.xml
---
(0098786)
aferraz (developer)
2017-09-04 09:14

Code review + Testing OK
(0099352)
hudsonbot (developer)
2017-09-21 16:49

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/9750b78d3e5c [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2017-08-22 12:58 ngarcia New Issue
2017-08-22 12:58 ngarcia Assigned To => Triage Finance
2017-08-22 12:58 ngarcia Modules => Core
2017-08-22 12:58 ngarcia Triggers an Emergency Pack => No
2017-08-22 12:58 ngarcia Issue generated from 0036681
2017-08-22 12:58 ngarcia Issue Monitored: networkb
2017-08-22 12:59 ngarcia Relationship added related to 0036681
2017-08-22 12:59 ngarcia Steps to Reproduce Updated View Revisions
2017-08-22 13:16 aferraz Assigned To Triage Finance => markmm82
2017-08-23 23:56 markmm82 Status new => scheduled
2017-08-24 20:57 markmm82 Assigned To markmm82 => ngarcia
2017-08-24 20:57 markmm82 Status scheduled => feedback
2017-08-25 09:08 ngarcia Status feedback => scheduled
2017-08-25 09:08 ngarcia Steps to Reproduce Updated View Revisions
2017-08-25 09:30 aferraz Assigned To ngarcia => markmm82
2017-08-25 11:44 ngarcia Steps to Reproduce Updated View Revisions
2017-08-25 12:02 aferraz Steps to Reproduce Updated View Revisions
2017-08-29 19:17 markmm82 Note Added: 0098711
2017-08-29 19:20 markmm82 Note Edited: 0098711 View Revisions
2017-08-29 19:51 markmm82 Note Edited: 0098711 View Revisions
2017-08-29 20:09 markmm82 Note Edited: 0098711 View Revisions
2017-08-30 17:15 markmm82 Note Added: 0098737
2017-08-30 17:25 markmm82 Note Edited: 0098737 View Revisions
2017-08-30 20:22 markmm82 Note Edited: 0098737 View Revisions
2017-08-30 20:23 markmm82 Note Added: 0098738
2017-08-30 21:24 markmm82 Note Added: 0098739
2017-09-04 09:12 hgbot Checkin
2017-09-04 09:12 hgbot Note Added: 0098785
2017-09-04 09:12 hgbot Status scheduled => resolved
2017-09-04 09:12 hgbot Resolution open => fixed
2017-09-04 09:12 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/708d0981673dc18d7ea644daf1819245c966fa26 [^]
2017-09-04 09:14 aferraz Review Assigned To => aferraz
2017-09-04 09:14 aferraz Note Added: 0098786
2017-09-04 09:14 aferraz Status resolved => closed
2017-09-04 09:14 aferraz Fixed in Version => 3.0PR17Q4
2017-09-21 16:49 hudsonbot Checkin
2017-09-21 16:49 hudsonbot Note Added: 0099352


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker