Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0031186Openbravo ERP04. Warehouse managementpublic2015-10-20 12:442015-11-18 11:13
VictorVillar 
aferraz 
immediatemajoralways
closedfixed 
5
pi 
3.0PR16Q1 
dmiguelez
Core
No
0031186: org.openbravo.fix.stock.qtyorderonhand module is not working with negative stock
org.openbravo.fix.stock.qtyorderonhand module is not working with negative stock
org.openbravo.fix.stock.qtyorderonhand module is not working with negative stock
Review the CostingRuleprocess.java in order to know how this problem is avoided.


        if (BigDecimal.ZERO.compareTo(qty) < 0) {
          // Do not insert negative values in Inventory lines, instead reverse the Quantity Count
          // and the Book Quantity. For example:
          // Instead of CountQty=0 and BookQty=-5 insert CountQty=5 and BookQty=0
          // By doing so the difference between both quantities remains the same and no negative
          // values have been inserted.

          openInventoryLine = insertInventoryLine(cri.getInitInventory(), productId, attrSetInsId,
              uomId, orderUOMId, locatorId, qty, BigDecimal.ZERO, orderQty, BigDecimal.ZERO,
              lineNo, null);
          insertInventoryLine(cri.getCloseInventory(), productId, attrSetInsId, uomId, orderUOMId,
              locatorId, BigDecimal.ZERO, qty, BigDecimal.ZERO, orderQty, lineNo, openInventoryLine);

        } else {
          openInventoryLine = insertInventoryLine(cri.getInitInventory(), productId, attrSetInsId,
              uomId, orderUOMId, locatorId, BigDecimal.ZERO, qty.abs(), BigDecimal.ZERO,
              orderQty == null ? null : orderQty.abs(), lineNo, closingInventoryLine);
          insertInventoryLine(cri.getCloseInventory(), productId, attrSetInsId, uomId, orderUOMId,
              locatorId, qty == null ? null : qty.abs(), BigDecimal.ZERO, orderQty == null ? null
                  : orderQty.abs(), BigDecimal.ZERO, lineNo, openInventoryLine);

        }
No tags attached.
depends on defect 00304813.0PR15Q4 closed AtulOpenbravo Wrong quantity conversion in goods receipts under some circumstancies 
related to defect 0031761 closed aferraz Not possible to launch the org.openbravo.fix.stock.qtyorderonhand module if you have more than 100 inventory lines 
Issue History
2015-10-20 12:44VictorVillarNew Issue
2015-10-20 12:44VictorVillarAssigned To => Triage Finance
2015-10-20 12:44VictorVillarModules => Core
2015-10-20 12:44VictorVillarResolution time => 1447974000
2015-10-20 12:44VictorVillarTriggers an Emergency Pack => No
2015-10-20 12:44VictorVillarRelationship addeddepends on 0030481
2015-10-20 12:44VictorVillarIssue Monitored: networkb
2015-11-05 10:49hgbotCheckin
2015-11-05 10:49hgbotNote Added: 0081497
2015-11-05 10:49hgbotStatusnew => resolved
2015-11-05 10:49hgbotResolutionopen => fixed
2015-11-05 10:49hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.fix.stock.qtyorderonhand/rev/5ca106808897bda2875a3ba64f32484c333cc565 [^]
2015-11-05 10:51aferrazAssigned ToTriage Finance => aferraz
2015-11-11 12:44ngarciaIssue Monitored: ngarcia
2015-11-11 13:35dmiguelezReview Assigned To => dmiguelez
2015-11-11 13:35dmiguelezNote Added: 0081706
2015-11-11 13:35dmiguelezStatusresolved => closed
2015-11-18 11:13hgbotCheckin
2015-11-18 11:13hgbotNote Added: 0081944
2015-12-22 11:10VictorVillarRelationship addedrelated to 0031761

Notes
(0081497)
hgbot   
2015-11-05 10:49   
Repository: erp/pmods/org.openbravo.fix.stock.qtyorderonhand
Changeset: 5ca106808897bda2875a3ba64f32484c333cc565
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu Nov 05 09:50:23 2015 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.fix.stock.qtyorderonhand/rev/5ca106808897bda2875a3ba64f32484c333cc565 [^]

Fixes issue 31186: Module is not working with negative stock

With negative stock, instead of creating inventory lines with negative values, reverse the quantity count and the book quantity. For example, instead of CountQty=0 and BookQty=-5 insert CountQty=5 and BookQty=0.
By doing so the difference between both quantities remains the same and no negative values have been inserted.
Move also storage detail query to a separate method, to make code more clear.

---
M src/org/openbravo/fix/stock/qtyorderonhand/FixStockQtyOrderProcess.java
---
(0081706)
dmiguelez   
2015-11-11 13:35   
Code Review + Testing Ok
(0081944)
hgbot   
2015-11-18 11:13   
Repository: erp/pmods/org.openbravo.fix.stock.qtyorderonhand
Changeset: 266a181d6bef2413a9d8da417ba5a86d671a6c1f
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Wed Nov 18 11:12:35 2015 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.fix.stock.qtyorderonhand/rev/266a181d6bef2413a9d8da417ba5a86d671a6c1f [^]

Related to Issue 31186: Reverse creation of Opening Inventory Lines when
dealing with negative Stock.

---
M src/org/openbravo/fix/stock/qtyorderonhand/FixStockQtyOrderProcess.java
---