Search in sources :

Example 6 with MPPOrderNode

use of org.eevolution.model.MPPOrderNode 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;
}
Also used : MResource(org.compiere.model.MResource) ImageIcon(javax.swing.ImageIcon) MPPOrderNode(org.eevolution.model.MPPOrderNode) DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) Date(java.util.Date) MPPOrder(org.eevolution.model.MPPOrder)

Example 7 with MPPOrderNode

use of org.eevolution.model.MPPOrderNode in project adempiere by adempiere.

the class CRPDatasetFactory method calculateLoad.

public BigDecimal calculateLoad(Timestamp dateTime, MResource r, String docStatus) {
    MResourceType t = MResourceType.get(Env.getCtx(), r.getS_ResourceType_ID());
    MUOM uom = MUOM.get(Env.getCtx(), t.getC_UOM_ID());
    BigDecimal qtyOpen;
    long millis = 0l;
    for (MPPOrderNode node : getPPOrderNodes(dateTime, r)) {
        if (docStatus != null) {
            MPPOrder o = new MPPOrder(node.getCtx(), node.getPP_Order_ID(), node.get_TrxName());
            if (!o.getDocStatus().equals(docStatus)) {
                continue;
            }
        }
        millis += calculateMillisForDay(dateTime, node, t);
    }
    // Pre-converts to minutes, because its the lowest time unit of compiere 
    BigDecimal scale = new BigDecimal(1000 * 60);
    BigDecimal minutes = new BigDecimal(millis).divide(scale, 2, BigDecimal.ROUND_HALF_UP);
    return convert(minutes);
}
Also used : MPPOrderNode(org.eevolution.model.MPPOrderNode) MUOM(org.compiere.model.MUOM) MResourceType(org.compiere.model.MResourceType) BigDecimal(java.math.BigDecimal) MPPOrder(org.eevolution.model.MPPOrder)

Aggregations

MPPOrderNode (org.eevolution.model.MPPOrderNode)7 MPPOrder (org.eevolution.model.MPPOrder)4 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)3 MResource (org.compiere.model.MResource)3 BigDecimal (java.math.BigDecimal)2 Timestamp (java.sql.Timestamp)2 Date (java.util.Date)2 MResourceType (org.compiere.model.MResourceType)2 MPPOrderWorkflow (org.eevolution.model.MPPOrderWorkflow)2 SimpleDateFormat (java.text.SimpleDateFormat)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 ImageIcon (javax.swing.ImageIcon)1 VDate (org.compiere.grid.ed.VDate)1 MProduct (org.compiere.model.MProduct)1 MUOM (org.compiere.model.MUOM)1 PO (org.compiere.model.PO)1 CRPException (org.eevolution.exceptions.CRPException)1