Search in sources :

Example 1 with MShipper

use of org.compiere.model.MShipper in project adempiere by adempiere.

the class PackageCreate method doIt.

//	prepare
/**
	 * 	Process
	 *	@return message
	 *	@throws Exception
	 */
protected String doIt() throws Exception {
    log.info("doIt - M_InOut_ID=" + p_M_InOut_ID + ", M_Shipper_ID=" + p_M_Shipper_ID);
    if (p_M_InOut_ID == 0)
        throw new IllegalArgumentException("No Shipment");
    if (p_M_Shipper_ID == 0)
        throw new IllegalArgumentException("No Shipper");
    MInOut shipment = new MInOut(getCtx(), p_M_InOut_ID, null);
    if (shipment.get_ID() != p_M_InOut_ID)
        throw new IllegalArgumentException("Cannot find Shipment ID=" + p_M_InOut_ID);
    MShipper shipper = new MShipper(getCtx(), p_M_Shipper_ID, get_TrxName());
    if (shipper.get_ID() != p_M_Shipper_ID)
        throw new IllegalArgumentException("Cannot find Shipper ID=" + p_M_InOut_ID);
    //
    MPackage pack = MPackage.create(shipment, shipper, null);
    return pack.getDocumentNo();
}
Also used : MInOut(org.compiere.model.MInOut) MPackage(org.compiere.model.MPackage) MShipper(org.compiere.model.MShipper)

Aggregations

MInOut (org.compiere.model.MInOut)1 MPackage (org.compiere.model.MPackage)1 MShipper (org.compiere.model.MShipper)1