use of org.adempiere.exceptions.FillMandatoryException in project adempiere by adempiere.
the class A_Depreciation_Exp_Modify method doIt.
protected String doIt() throws Exception {
//
if (p_A_Depreciation_Exp_ID <= 0) {
throw new FillMandatoryException("A_Depreciation_Exp_ID");
}
//
MDepreciationExp exp = new MDepreciationExp(getCtx(), p_A_Depreciation_Exp_ID, get_TrxName());
if (exp.get_ID() != p_A_Depreciation_Exp_ID) {
throw new AdempiereException("@NotFound@ @A_Depreciation_Exp_ID@ = " + p_A_Depreciation_Exp_ID);
}
//
MDepreciationEntry.deleteFacts(exp);
exp.setDR_Account_ID(p_DR_Account_ID);
exp.setCR_Account_ID(p_CR_Account_ID);
exp.saveEx();
//
if (p_IsTest) {
rollback();
}
//
return "Ok";
}
use of org.adempiere.exceptions.FillMandatoryException 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@";
}
Aggregations