use of org.compiere.model.MLandedCost in project adempiere by adempiere.
the class LandedCostDistribute method doIt.
// prepare
/**
* Process
* @return info
* @throws Exception
*/
protected String doIt() throws Exception {
m_lc = new MLandedCost(getCtx(), p_C_LandedCost_ID, get_TrxName());
log.info(m_lc.toString());
if (m_lc.get_ID() == 0)
throw new AdempiereUserError("@NotFound@: @C_LandedCost_ID@ - " + p_C_LandedCost_ID);
String error = m_lc.allocateCosts();
generateCostDetail();
if (error == null || error.length() == 0)
return "@OK@";
return error;
}
use of org.compiere.model.MLandedCost in project adempiere by adempiere.
the class GenerateLandedCost method createLandedCost.
public void createLandedCost(MInOut inOut, MInOutLine inOutLine) {
MInOut document = inOut;
if (document == null)
document = inOutLine.getParent();
MLandedCost landedCost = new MLandedCost(getCtx(), 0, get_TrxName());
landedCost.setAD_Org_ID(document.getAD_Org_ID());
landedCost.setC_InvoiceLine_ID(getRecord_ID());
landedCost.setM_InOut_ID(document.getM_InOut_ID());
landedCost.setDescription(document.getPOReference());
landedCost.setLandedCostDistribution(getCostDistribution());
landedCost.setM_CostElement_ID(getCostElementId());
if (inOut == null) {
landedCost.setM_InOutLine_ID(inOutLine.getM_InOutLine_ID());
landedCost.setM_Product_ID(inOutLine.getM_Product_ID());
}
landedCost.saveEx();
}
Aggregations