IDEMPIERE-3062 Unable to complete MR with qty >1 with Attribute Set of Always Mandatory (#144)
This commit is contained in:
parent
9da97ab06d
commit
4afaed6140
|
@ -1203,9 +1203,21 @@ public class MInOut extends X_M_InOut implements DocAction
|
|||
if (product != null && product.isASIMandatory(isSOTrx()))
|
||||
{
|
||||
if (product.getAttributeSet() != null && !product.getAttributeSet().excludeTableEntry(MInOutLine.Table_ID, isSOTrx())) {
|
||||
m_processMsg = "@M_AttributeSet_ID@ @IsMandatory@ (@Line@ #" + lines[i].getLine() +
|
||||
", @M_Product_ID@=" + product.getValue() + ")";
|
||||
return DocAction.STATUS_Invalid;
|
||||
BigDecimal qtyDiff = line.getMovementQty();
|
||||
// verify if the ASIs are captured on lineMA
|
||||
MInOutLineMA mas[] = MInOutLineMA.get(getCtx(),
|
||||
line.getM_InOut_ID(), get_TrxName());
|
||||
BigDecimal qtyma = Env.ZERO;
|
||||
for (MInOutLineMA ma : mas) {
|
||||
if (! ma.isAutoGenerated()) {
|
||||
qtyma = qtyma.add(ma.getMovementQty());
|
||||
}
|
||||
}
|
||||
if (qtyma.subtract(qtyDiff).signum() != 0) {
|
||||
m_processMsg = "@M_AttributeSet_ID@ @IsMandatory@ (@Line@ #" + lines[i].getLine() +
|
||||
", @M_Product_ID@=" + product.getValue() + ")";
|
||||
return DocAction.STATUS_Invalid;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue