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;
}
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);
}
Aggregations