Revert "IDEMPIERE-4849: fix for MProduction.createLines() storage issue (#743)" (#1109)

This reverts commit 73b389652f.
This commit is contained in:
Carlos Ruiz 2022-01-03 19:07:41 +01:00 committed by GitHub
parent 0232b2e8f3
commit de1e9011c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -263,6 +263,8 @@ public class MProduction extends X_M_Production implements DocAction {
int M_Warehouse_ID = finishedLocator.getM_Warehouse_ID();
int asi = 0;
// products used in production
String sql = " SELECT bl.M_Product_ID, bl.QtyBOM" + " FROM PP_Product_BOMLine bl"
+ " JOIN PP_Product_BOM b ON b.PP_Product_BOM_ID = bl.PP_Product_BOM_ID "
@ -353,7 +355,6 @@ public class MProduction extends X_M_Production implements DocAction {
MProductionLine BOMLine = null;
int prevLoc = -1;
int previousAttribSet = -1;
int prevAsi = -1;
// Create lines from storage until qty is reached
for (int sl = 0; sl < storages.length; sl++) {
@ -365,11 +366,11 @@ public class MProduction extends X_M_Production implements DocAction {
int loc = storages[sl].getM_Locator_ID();
int slASI = storages[sl].getM_AttributeSetInstance_ID();
int locAttribSet = new MAttributeSetInstance(getCtx(), slASI,
int locAttribSet = new MAttributeSetInstance(getCtx(), asi,
get_TrxName()).getM_AttributeSet_ID();
// roll up costing attributes if in the same locator
if (((locAttribSet == 0 && previousAttribSet == 0) || (slASI == prevAsi))
if (locAttribSet == 0 && previousAttribSet == 0
&& prevLoc == loc) {
BOMLine.setQtyUsed(BOMLine.getQtyUsed()
.add(lineQty));
@ -394,7 +395,6 @@ public class MProduction extends X_M_Production implements DocAction {
}
prevLoc = loc;
previousAttribSet = locAttribSet;
prevAsi = slASI;
// enough ?
BOMMovementQty = BOMMovementQty.subtract(lineQty);
if (BOMMovementQty.signum() == 0)