details:   https://code.openbravo.com/erp/devel/pi/rev/615b38d35a71
changeset: 23867:615b38d35a71
user:      Eduardo Argal Guibert <eduardo.argal <at> openbravo.com>
date:      Tue Jun 24 19:20:25 2014 +0200
summary:   Fixes bug 26913: When processing physical inventories the reserved 
stock is not taken into account

diffstat:

 src/org/openbravo/costing/CostingRuleProcess.java         |   4 +-
 src/org/openbravo/materialmgmt/InventoryCountProcess.java |  16 ++++++++++++--
 2 files changed, 15 insertions(+), 5 deletions(-)

diffs (61 lines):

diff -r 412c6541bb48 -r 615b38d35a71 
src/org/openbravo/costing/CostingRuleProcess.java
--- a/src/org/openbravo/costing/CostingRuleProcess.java Tue Jun 24 19:02:43 
2014 +0200
+++ b/src/org/openbravo/costing/CostingRuleProcess.java Tue Jun 24 19:20:25 
2014 +0200
@@ -347,7 +347,7 @@
     }
     // Process closing physical inventories.
     for (CostingRuleInit cri : rule.getCostingRuleInitList()) {
-      new InventoryCountProcess().processInventory(cri.getCloseInventory());
+      new InventoryCountProcess().processInventory(cri.getCloseInventory(), 
false);
     }
   }
 
@@ -514,7 +514,7 @@
         OBDal.getInstance().save(initICL);
       }
       OBDal.getInstance().flush();
-      new InventoryCountProcess().processInventory(cri.getInitInventory());
+      new InventoryCountProcess().processInventory(cri.getInitInventory(), 
false);
     }
     if (!existsPreviousRule) {
       updateInitInventoriesTrxDate(startingDate, ruleId);
diff -r 412c6541bb48 -r 615b38d35a71 
src/org/openbravo/materialmgmt/InventoryCountProcess.java
--- a/src/org/openbravo/materialmgmt/InventoryCountProcess.java Tue Jun 24 
19:02:43 2014 +0200
+++ b/src/org/openbravo/materialmgmt/InventoryCountProcess.java Tue Jun 24 
19:20:25 2014 +0200
@@ -126,6 +126,11 @@
   }
 
   public OBError processInventory(InventoryCount inventory) throws OBException 
{
+    return processInventory(inventory, true);
+  }
+
+  public OBError processInventory(InventoryCount inventory, boolean 
checkReservationQty)
+      throws OBException {
     OBError msg = new OBError();
     msg.setType("Success");
     msg.setTitle(OBMessageUtils.messageBD("Success"));
@@ -180,9 +185,13 @@
     insert.append(", now()");
     insert.append(", u");
     insert.append(", 'I+'");
-    // We have to set check reservation quantity flag equal to false
-    insert.append(", e." + InventoryCountLine.PROPERTY_PHYSINVENTORY + "."
-        + InventoryCount.PROPERTY_PROCESSED);
+    // We have to set check reservation quantity flag equal to 
checkReservationQty
+    if (checkReservationQty) {
+      insert.append(", e." + InventoryCountLine.PROPERTY_ACTIVE);
+    } else {
+      insert.append(", e." + InventoryCountLine.PROPERTY_PHYSINVENTORY + "."
+          + InventoryCount.PROPERTY_PROCESSED);
+    }
     insert.append(", e." + InventoryCountLine.PROPERTY_PHYSINVENTORY + "."
         + InventoryCount.PROPERTY_MOVEMENTDATE);
     insert.append(", e." + InventoryCountLine.PROPERTY_STORAGEBIN);
@@ -217,6 +226,7 @@
     queryInsert.setString("user", (String) 
DalUtil.getId(OBContext.getOBContext().getUser()));
     final SimpleDateFormat dateFormatter = new SimpleDateFormat("dd-MM-yyyy 
HH:mm:ss");
     queryInsert.setString("currentDate", dateFormatter.format(new Date()));
+    // queryInsert.setBoolean("checkReservation", checkReservationQty);
     queryInsert.executeUpdate();
 
     if 
(!inventory.getClient().getClientInformationList().get(0).isAllowNegativeStock())
 {

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to