use of org.eevolution.model.MPPOrder in project adempiere by adempiere.
the class MRPApproval method executeManufacturingOrderApproval.
private void executeManufacturingOrderApproval(MPPMRP mrp) {
boolean createMO = false;
if (getBOMFormulaId() > 0)
createMO = true;
if (getWorkflowId() > 0)
createMO = true;
MPPOrder currentMfgOrder = (MPPOrder) mrp.getPP_Order();
MPPOrder newMfgOrder;
if (createMO) {
newMfgOrder = new MPPOrder(mrp.getCtx(), 0, get_TrxName());
newMfgOrder.copyValues(currentMfgOrder, newMfgOrder);
if (getBOMFormulaId() > 0)
newMfgOrder.setPP_Product_BOM_ID(getBOMFormulaId());
if (getWorkflowId() > 0)
newMfgOrder.setAD_Workflow_ID(getWorkflowId());
newMfgOrder.saveEx();
currentMfgOrder.deleteEx(true);
currentMfgOrder = newMfgOrder;
}
if (mrp.is_Changed()) {
validateChanges(mrp, MPPMRP.COLUMNNAME_Priority, currentMfgOrder, MPPOrder.COLUMNNAME_PriorityRule);
validateChanges(mrp, MPPMRP.COLUMNNAME_DateStartSchedule, currentMfgOrder, MPPOrder.COLUMNNAME_DateStartSchedule);
validateChanges(mrp, MPPMRP.COLUMNNAME_DatePromised, currentMfgOrder, MPPOrder.COLUMNNAME_DatePromised);
currentMfgOrder.setQty(getSelectionAsBigDecimal(mrp.getPP_MRP_ID(), "MRP_" + MPPMRP.COLUMNNAME_Qty));
currentMfgOrder.saveEx();
}
currentMfgOrder.processIt(DocAction.ACTION_Prepare);
currentMfgOrder.saveEx();
}
use of org.eevolution.model.MPPOrder in project adempiere by adempiere.
the class BOMTreeFactory method buildStructure.
protected DefaultMutableTreeNode buildStructure(PO po, StorageReasoner reasoner) {
mapping = new HashMap();
DefaultMutableTreeNode root = new DefaultMutableTreeNode(po);
mapping.put(root, getTreeNodeRepresentation(root));
BOMWrapper bom = null;
String restriction = null;
if (po instanceof MProduct) {
restriction = MProduct.Table_Name + "_ID";
} else if (po instanceof MPPOrder) {
restriction = MPPOrder.Table_Name + "_ID";
}
int[] ids = reasoner.getPOIDs(BOMWrapper.tableName(type()), "IsActive = 'Y' AND " + restriction + " = " + po.get_ID(), null);
for (int i = 0; i < ids.length; i++) {
bom = new BOMWrapper(Env.getCtx(), ids[i], null, type());
root.add(getNode(bom, null, mapping));
}
return root;
}
use of org.eevolution.model.MPPOrder in project adempiere by adempiere.
the class DiagramTreeCellRenderer method getIcon.
protected ImageIcon getIcon(Object value) {
ImageIcon icon = null;
DefaultMutableTreeNode node = (DefaultMutableTreeNode) value;
if (node.getUserObject() instanceof MResource) {
} else if (node.getUserObject() instanceof Date) {
icon = Env.getImageIcon("Calendar10.gif");
} else if (node.getUserObject() instanceof MPPOrder) {
} else if (node.getUserObject() instanceof MPPOrderNode) {
}
return icon;
}
use of org.eevolution.model.MPPOrder in project adempiere by adempiere.
the class BOMTreeFactory method getTreeNodeRepresentation.
protected String getTreeNodeRepresentation(DefaultMutableTreeNode node) {
String name = null;
if (node.getUserObject() instanceof MProduct) {
MProduct p = (MProduct) node.getUserObject();
name = p.getName() + " (" + p.getValue() + ")";
}
if (node.getUserObject() instanceof MPPOrder) {
MPPOrder o = (MPPOrder) node.getUserObject();
MResource r = MResource.get(Env.getCtx(), o.getS_Resource_ID());
name = o.getDocumentNo() + " (" + r.getName() + ")";
} else if (node.getUserObject() instanceof BOMWrapper) {
BOMWrapper pb = (BOMWrapper) node.getUserObject();
MProduct p = new MProduct(Env.getCtx(), pb.getM_Product_ID(), null);
name = pb.getName();
} else if (node.getUserObject() instanceof BOMLineWrapper) {
BOMLineWrapper mpbl = (BOMLineWrapper) node.getUserObject();
MProduct p = new MProduct(Env.getCtx(), mpbl.getM_Product_ID(), null);
name = p.getName();
}
return name;
}
use of org.eevolution.model.MPPOrder in project adempiere by adempiere.
the class BOMMessenger method getToolTipText.
public String getToolTipText(TreePath path) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
String tooltip = (String) cache.get(node);
if (tooltip != null) {
return tooltip;
}
if (node.getUserObject() instanceof MProduct) {
tooltip = getProductInfo((MProduct) node.getUserObject());
}
if (node.getUserObject() instanceof MPPOrder) {
tooltip = getMfcOrderInfo((MPPOrder) node.getUserObject());
} else if (node.getUserObject() instanceof BOMWrapper) {
tooltip = getBOMInfo((BOMWrapper) node.getUserObject());
} else if (node.getUserObject() instanceof BOMLineWrapper) {
tooltip = getBOMLineInfo((BOMLineWrapper) node.getUserObject());
}
cache.put(node, tooltip);
return tooltip;
}
Aggregations