/** * Set Invoice Line. Does not set Quantity! * * @param iLine invoice line * @param M_Locator_ID locator * @param Qty qty only fo find suitable locator */ public void setInvoiceLine(MInvoiceLine iLine, int M_Locator_ID, BigDecimal Qty) { setC_OrderLine_ID(iLine.getC_OrderLine_ID()); setLine(iLine.getLine()); setC_UOM_ID(iLine.getC_UOM_ID()); int M_Product_ID = iLine.getM_Product_ID(); if (M_Product_ID == 0) { set_ValueNoCheck("M_Product_ID", null); set_ValueNoCheck("M_Locator_ID", null); set_ValueNoCheck("M_AttributeSetInstance_ID", null); } else { setM_Product_ID(M_Product_ID); setM_AttributeSetInstance_ID(iLine.getM_AttributeSetInstance_ID()); if (M_Locator_ID == 0) setM_Locator_ID(Qty); // requires warehouse, product, asi else setM_Locator_ID(M_Locator_ID); } setC_Charge_ID(iLine.getC_Charge_ID()); setDescription(iLine.getDescription()); setIsDescription(iLine.isDescription()); // setC_Project_ID(iLine.getC_Project_ID()); setC_ProjectPhase_ID(iLine.getC_ProjectPhase_ID()); setC_ProjectTask_ID(iLine.getC_ProjectTask_ID()); setC_Activity_ID(iLine.getC_Activity_ID()); setC_Campaign_ID(iLine.getC_Campaign_ID()); setAD_OrgTrx_ID(iLine.getAD_OrgTrx_ID()); setUser1_ID(iLine.getUser1_ID()); setUser2_ID(iLine.getUser2_ID()); } // setInvoiceLine
/** * Set (default) Locator based on qty. * * @param Qty quantity Assumes Warehouse is set */ public void setM_Locator_ID(BigDecimal Qty) { // Locator established if (getM_Locator_ID() != 0) return; // No Product if (getM_Product_ID() == 0) { set_ValueNoCheck(COLUMNNAME_M_Locator_ID, null); return; } // Get existing Location int M_Locator_ID = MStorage.getM_Locator_ID( getM_Warehouse_ID(), getM_Product_ID(), getM_AttributeSetInstance_ID(), Qty, get_TrxName()); // Get default Location if (M_Locator_ID == 0) { MWarehouse wh = MWarehouse.get(getCtx(), getM_Warehouse_ID()); M_Locator_ID = wh.getDefaultLocator().getM_Locator_ID(); } setM_Locator_ID(M_Locator_ID); } // setM_Locator_ID