IDEMPIERE-3037 Date Material Policy not respected in shipment / remove duplicated code (thanks to Hiep)
This commit is contained in:
parent
822453941d
commit
7c535366bd
|
@ -1428,20 +1428,10 @@ public class MInOut extends X_M_InOut implements DocAction
|
||||||
if (mtrx == null)
|
if (mtrx == null)
|
||||||
{
|
{
|
||||||
Timestamp dateMPolicy= null;
|
Timestamp dateMPolicy= null;
|
||||||
MStorageOnHand[] storages = null;
|
MStorageOnHand[] storages = MStorageOnHand.getWarehouse(getCtx(), 0,
|
||||||
if (sLine.getMovementQty().compareTo(Env.ZERO) > 0) {
|
sLine.getM_Product_ID(), sLine.getM_AttributeSetInstance_ID(), null,
|
||||||
// Find Date Material Policy bases on ASI
|
MClient.MMPOLICY_FiFo.equals(product.getMMPolicy()), false,
|
||||||
storages = MStorageOnHand.getWarehouse(getCtx(), 0,
|
sLine.getM_Locator_ID(), get_TrxName());
|
||||||
sLine.getM_Product_ID(), sLine.getM_AttributeSetInstance_ID(), null,
|
|
||||||
MClient.MMPOLICY_FiFo.equals(product.getMMPolicy()), false,
|
|
||||||
sLine.getM_Locator_ID(), get_TrxName());
|
|
||||||
} else {
|
|
||||||
//Case of reversal
|
|
||||||
storages = MStorageOnHand.getWarehouse(getCtx(), 0,
|
|
||||||
sLine.getM_Product_ID(), sLine.getM_AttributeSetInstance_ID(), null,
|
|
||||||
MClient.MMPOLICY_FiFo.equals(product.getMMPolicy()), false,
|
|
||||||
sLine.getM_Locator_ID(), get_TrxName());
|
|
||||||
}
|
|
||||||
for (MStorageOnHand storage : storages) {
|
for (MStorageOnHand storage : storages) {
|
||||||
if (storage.getQtyOnHand().compareTo(sLine.getMovementQty()) >= 0) {
|
if (storage.getQtyOnHand().compareTo(sLine.getMovementQty()) >= 0) {
|
||||||
dateMPolicy = storage.getDateMaterialPolicy();
|
dateMPolicy = storage.getDateMaterialPolicy();
|
||||||
|
|
Loading…
Reference in New Issue