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