diff --git a/org.adempiere.base/src/org/compiere/model/MInventory.java b/org.adempiere.base/src/org/compiere/model/MInventory.java index 765f682429..8431080b4b 100644 --- a/org.adempiere.base/src/org/compiere/model/MInventory.java +++ b/org.adempiere.base/src/org/compiere/model/MInventory.java @@ -617,8 +617,6 @@ public class MInventory extends X_M_Inventory implements DocAction if(qtyDiff.compareTo(Env.ZERO)==0) return; - // Check Line - boolean needSave = false; // Attribute Set Instance if (line.getM_AttributeSetInstance_ID() == 0) { @@ -693,11 +691,6 @@ public class MInventory extends X_M_Inventory implements DocAction if (log.isLoggable(Level.FINE)) log.fine("##: " + lineMA); } } // outgoing Trx - - if (needSave) - { - line.saveEx(); - } } // for all lines } // checkMaterialPolicy diff --git a/org.adempiere.base/src/org/compiere/model/MStorageOnHand.java b/org.adempiere.base/src/org/compiere/model/MStorageOnHand.java index 67b4c8b140..997afc20c6 100644 --- a/org.adempiere.base/src/org/compiere/model/MStorageOnHand.java +++ b/org.adempiere.base/src/org/compiere/model/MStorageOnHand.java @@ -375,7 +375,7 @@ public class MStorageOnHand extends X_M_StorageOnHand MProduct product = MProduct.get(Env.getCtx(), M_Product_ID); if(product.isUseGuaranteeDateForMPolicy()){ - sql += "ORDER BY l.PriorityNo DESC, asi.GuaranteeDate"; + sql += "ORDER BY l.PriorityNo DESC, COALESCE(asi.GuaranteeDate,s.DateMaterialPolicy)"; if (!FiFo) sql += " DESC"; }