use of org.adempiere.exceptions.InvoiceFullyMatchedException in project adempiere by adempiere.
the class InvoiceCreateInOut method doIt.
// prepare
/**
* Create Shipment
* @return info
* @throws Exception
*/
protected String doIt() throws Exception {
log.info("C_Invoice_ID=" + p_C_Invoice_ID + ", M_Warehouse_ID=" + p_M_Warehouse_ID);
if (p_C_Invoice_ID <= 0)
throw new FillMandatoryException("C_Invoice_ID");
if (p_M_Warehouse_ID == 0)
throw new FillMandatoryException(PARAM_M_Warehouse_ID);
//
MInvoice invoice = new MInvoice(getCtx(), p_C_Invoice_ID, null);
if (invoice.get_ID() <= 0)
throw new AdempiereException("@NotFound@ @C_Invoice_ID@");
if (!MInvoice.DOCSTATUS_Completed.equals(invoice.getDocStatus()))
throw new AdempiereException("@InvoiceCreateDocNotCompleted@");
//
for (MInvoiceLine invoiceLine : invoice.getLines(false)) {
createLine(invoice, invoiceLine);
}
if (m_inout == null)
throw new InvoiceFullyMatchedException();
//
return m_inout.getDocumentNo();
}
Aggregations