Search in sources :

Example 11 with MPPOrder

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

the class AbstractMakeToOrder method createPPOrder.

public MPPOrder createPPOrder() {
    MPPOrder expected = new MPPOrder(getCtx(), 0, trxName);
    expected.setAD_Org_ID(AD_Org_ID);
    expected.setM_Product_ID(product.getM_Product_ID());
    expected.setDateOrdered(today);
    expected.setDatePromised(promisedDeta);
    expected.setDateFinish(promisedDeta);
    expected.setPP_Product_BOM_ID(PP_Product_BOM_ID);
    expected.setAD_Workflow_ID(AD_Workflow_ID);
    expected.setS_Resource_ID(S_Resource_ID);
    expected.setM_Warehouse_ID(M_Warehouse_ID);
    expected.setDocStatus(MPPOrder.DOCSTATUS_InProgress);
    expected.setQty(Qty);
    return expected;
}
Also used : MPPOrder(org.eevolution.model.MPPOrder)

Example 12 with MPPOrder

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

the class VOrderPlanning method actionPerformed.

public void actionPerformed(ActionEvent e) {
    //  Confirm Panel
    String cmd = e.getActionCommand();
    if (cmd.equals(ConfirmPanel.A_OK)) {
        m_frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
        //System.out.println("Row ...ID " + row);
        int[] rows = p_table.getSelectedRows();
        for (int r = 0; r < rows.length; r++) {
            IDColumn id = (IDColumn) p_table.getValueAt(rows[r], 0);
            if (id != null && id.isSelected()) {
                Integer PP_Order_ID = id.getRecord_ID();
                MPPOrder order = new MPPOrder(Env.getCtx(), PP_Order_ID.intValue(), null);
                order.setDocStatus(order.prepareIt());
                order.setDocAction(MPPOrder.DOCACTION_Complete);
                order.save();
            }
        }
        if (rows.length != 0) {
            ADialog.info(m_WindowNo, this, "ProcessOK");
            executeQuery();
            m_frame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
            executeQuery();
        }
        m_frame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    }
    if (cmd.equals(ConfirmPanel.A_CANCEL)) {
        dispose();
    }
    dispose();
}
Also used : IDColumn(org.compiere.minigrid.IDColumn) MPPOrder(org.eevolution.model.MPPOrder)

Example 13 with MPPOrder

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

the class VOrderReceiptIssue method vetoableChange.

public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException {
    String name = e.getPropertyName();
    Object value = e.getNewValue();
    log.fine("VOrderReceip.vetoableChange - " + name + "=" + value);
    if (value == null)
        return;
    // PP_Order_ID
    if (name.equals("PP_Order_ID")) {
        orderField.setValue(value);
        MPPOrder pp_order = getPP_Order();
        if (pp_order != null) {
            setS_Resource_ID(pp_order.getS_Resource_ID());
            setM_Warehouse_ID(pp_order.getM_Warehouse_ID());
            setDeliveredQty(pp_order.getQtyDelivered());
            setOrderedQty(pp_order.getQtyOrdered());
            // m_PP_order.getQtyOrdered().subtract(m_PP_order.getQtyDelivered());
            setQtyBatchs(pp_order.getQtyBatchs());
            setQtyBatchSize(pp_order.getQtyBatchSize());
            setOpenQty(pp_order.getQtyOrdered().subtract(pp_order.getQtyDelivered()));
            setToDeliverQty(getOpenQty());
            setM_Product_ID(pp_order.getM_Product_ID());
            MProduct m_product = MProduct.get(Env.getCtx(), pp_order.getM_Product_ID());
            setC_UOM_ID(m_product.getC_UOM_ID());
            setOrder_UOM_ID(pp_order.getC_UOM_ID());
            // Default ASI defined from the Parent BOM Order
            setM_AttributeSetInstance_ID(pp_order.getMPPOrderBOM().getM_AttributeSetInstance_ID());
            // default to first entry -
            pickcombo.setSelectedIndex(0);
        // isBackflush
        }
    }
// PP_Order_ID
}
Also used : MProduct(org.compiere.model.MProduct) MPPOrder(org.eevolution.model.MPPOrder)

Example 14 with MPPOrder

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

the class CompletePrintOrder method doIt.

// prepare
/**
	 * Perform process.
	 * 
	 * @return Message (clear text)
	 * @throws Exception
	 *             if not successful
	 */
protected String doIt() throws Exception {
    if (p_PP_Order_ID == 0) {
        throw new FillMandatoryException(MPPOrder.COLUMNNAME_PP_Order_ID);
    }
    if (p_IsComplete) {
        MPPOrder order = new MPPOrder(getCtx(), p_PP_Order_ID, get_TrxName());
        if (!order.isAvailable()) {
            throw new AdempiereException("@NoQtyAvailable@");
        }
        //
        // Process document
        boolean ok = order.processIt(MPPOrder.DOCACTION_Complete);
        order.saveEx();
        if (!ok) {
            throw new AdempiereException(order.getProcessMsg());
        }
        // Document Status should be completed
        if (!MPPOrder.DOCSTATUS_Completed.equals(order.getDocStatus())) {
            throw new AdempiereException(order.getProcessMsg());
        }
    }
    if (p_IsPrintPickList) {
        // Get Format & Data
        ReportEngine re = this.getReportEngine("Manufacturing_Order_BOM_Header ** TEMPLATE **", "PP_Order_BOM_Header_v");
        if (re == null) {
            return "";
        }
        ReportCtl.preview(re);
        // prints only original
        re.print();
    }
    if (p_IsPrintPackList) {
        // Get Format & Data
        ReportEngine re = this.getReportEngine("Manufacturing_Order_BOM_Header_Packing ** TEMPLATE **", "PP_Order_BOM_Header_v");
        if (re == null) {
            return "";
        }
        ReportCtl.preview(re);
        // prints only original
        re.print();
    }
    if (p_IsPrintWorkflow) {
        // Get Format & Data
        ReportEngine re = this.getReportEngine("Manufacturing_Order_Workflow_Header ** TEMPLATE **", "PP_Order_Workflow_Header_v");
        if (re == null) {
            return "";
        }
        ReportCtl.preview(re);
        // prints only original
        re.print();
    }
    return "@OK@";
}
Also used : ReportEngine(org.compiere.print.ReportEngine) AdempiereException(org.adempiere.exceptions.AdempiereException) FillMandatoryException(org.adempiere.exceptions.FillMandatoryException) MPPOrder(org.eevolution.model.MPPOrder)

Example 15 with MPPOrder

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

the class Doc_PPOrder method loadDocumentDetails.

//Doc Cost Collector
/**
	 *  Load Document Details
	 *  @return error message or null
	 */
protected String loadDocumentDetails() {
    MPPOrder order = (MPPOrder) getPO();
    setDateDoc(order.getDateOrdered());
    return STATUS_Posted;
}
Also used : MPPOrder(org.eevolution.model.MPPOrder)

Aggregations

MPPOrder (org.eevolution.model.MPPOrder)26 AdempiereException (org.adempiere.exceptions.AdempiereException)8 MProduct (org.compiere.model.MProduct)8 BigDecimal (java.math.BigDecimal)5 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)5 MPPProductBOM (org.eevolution.model.MPPProductBOM)5 BOMWrapper (org.eevolution.model.wrapper.BOMWrapper)5 MBPartner (org.compiere.model.MBPartner)4 MResource (org.compiere.model.MResource)4 I_PP_Order (org.eevolution.model.I_PP_Order)4 MPPOrderNode (org.eevolution.model.MPPOrderNode)4 MWorkflow (org.compiere.wf.MWorkflow)3 BOMLineWrapper (org.eevolution.model.wrapper.BOMLineWrapper)3 HashMap (java.util.HashMap)2 MOrderLine (org.compiere.model.MOrderLine)2 MRequisition (org.compiere.model.MRequisition)2 MResourceType (org.compiere.model.MResourceType)2 PO (org.compiere.model.PO)2 MDDOrder (org.eevolution.model.MDDOrder)2 Timestamp (java.sql.Timestamp)1