fix MPPCostCollector.isIssue/isReceipt NPE

This commit is contained in:
teo_sarca 2008-12-11 16:19:12 +00:00
parent 54c4942b64
commit 49b3056950
1 changed files with 5 additions and 5 deletions

View File

@ -328,9 +328,9 @@ public class MPPCostCollector extends X_PP_Cost_Collector implements DocAction
{ {
MPPOrderNode onodeact = getPP_Order_Node(); MPPOrderNode onodeact = getPP_Order_Node();
onodeact.setDocStatus(DOCSTATUS_Completed); onodeact.setDocStatus(DOCSTATUS_Completed);
onodeact.setQtyDelivered(onodeact.getQtyDelivered().add(getMovementQty()));
onodeact.setQtyScrap(onodeact.getQtyScrap().add(getScrappedQty())); onodeact.setQtyScrap(onodeact.getQtyScrap().add(getScrappedQty()));
onodeact.setQtyReject(onodeact.getQtyReject().add(getQtyReject())); onodeact.setQtyReject(onodeact.getQtyReject().add(getQtyReject()));
onodeact.setQtyDelivered(onodeact.getQtyDelivered().add(getMovementQty()));
onodeact.setDurationReal(onodeact.getDurationReal()+getDurationReal().intValue()); onodeact.setDurationReal(onodeact.getDurationReal()+getDurationReal().intValue());
onodeact.setSetupTimeReal(onodeact.getSetupTimeReal()+getSetupTimeReal().intValue()); onodeact.setSetupTimeReal(onodeact.getSetupTimeReal()+getSetupTimeReal().intValue());
onodeact.saveEx(); onodeact.saveEx();
@ -788,12 +788,12 @@ public class MPPCostCollector extends X_PP_Cost_Collector implements DocAction
public boolean isIssue() public boolean isIssue()
{ {
return getMovementType().charAt(1) == '-'; return isCostCollectorType(COSTCOLLECTORTYPE_ComponentIssue);
} }
public boolean isReceipt() public boolean isReceipt()
{ {
return getMovementType().charAt(1) == '+'; return isCostCollectorType(COSTCOLLECTORTYPE_MaterialReceipt);
} }
public String getMovementType() public String getMovementType()
@ -802,7 +802,7 @@ public class MPPCostCollector extends X_PP_Cost_Collector implements DocAction
return MTransaction.MOVEMENTTYPE_WorkOrderPlus; return MTransaction.MOVEMENTTYPE_WorkOrderPlus;
else if(isCostCollectorType(COSTCOLLECTORTYPE_ComponentIssue)) else if(isCostCollectorType(COSTCOLLECTORTYPE_ComponentIssue))
return MTransaction.MOVEMENTTYPE_WorkOrder_; return MTransaction.MOVEMENTTYPE_WorkOrder_;
else
return null; return null;
} }