IDEMPIERE-3406 MStorageOnHand.getDateMaterialPolicy isn't correct on some condition

This commit is contained in:
Heng Sin Low 2017-11-22 15:49:11 +08:00
parent ed5f3b33d9
commit 0ae352c815
1 changed files with 2 additions and 2 deletions

View File

@ -1043,7 +1043,7 @@ public class MStorageOnHand extends X_M_StorageOnHand
if (M_Product_ID <= 0 || M_AttributeSetInstance_ID <= 0) if (M_Product_ID <= 0 || M_AttributeSetInstance_ID <= 0)
return null; return null;
String sql = "SELECT dateMaterialPolicy FROM M_StorageOnHand WHERE M_Product_ID=? and M_AttributeSetInstance_ID=?"; String sql = "SELECT dateMaterialPolicy FROM M_StorageOnHand WHERE M_Product_ID=? and M_AttributeSetInstance_ID=? ORDER BY QtyOnHand DESC";
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
@ -1085,7 +1085,7 @@ public class MStorageOnHand extends X_M_StorageOnHand
if (M_Product_ID <= 0 || M_AttributeSetInstance_ID <= 0) if (M_Product_ID <= 0 || M_AttributeSetInstance_ID <= 0)
return null; return null;
String sql = "SELECT dateMaterialPolicy FROM M_StorageOnHand WHERE M_Product_ID=? and M_AttributeSetInstance_ID=? AND M_Locator_ID=?"; String sql = "SELECT dateMaterialPolicy FROM M_StorageOnHand WHERE M_Product_ID=? and M_AttributeSetInstance_ID=? AND M_Locator_ID=? ORDER BY QtyOnHand DESC";
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;