Skip to content

Commit

Permalink
Merge pull request #1915 from SusanneCalderon/bugfix/Issue1912_Landed…
Browse files Browse the repository at this point in the history
…CostAllocation_CreateCostDetail

#1912 Landed cost allocation create cost detail, Create costdetail when completing the invoice
fixes
  • Loading branch information
e-Evolution committed Oct 7, 2018
2 parents cc344ab + e9e92c3 commit 53e3eec
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions base/src/org/compiere/model/MInvoice.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.util.function.BiFunction;
import java.util.logging.Level;

import org.adempiere.engine.CostEngineFactory;
import org.adempiere.exceptions.AdempiereException;
import org.adempiere.exceptions.BPartnerNoAddressException;
import org.adempiere.exceptions.DBException;
Expand Down Expand Up @@ -1887,6 +1888,9 @@ && getReversal_ID() ==0) {
if (counter != null)
info.append(" - @CounterDoc@: @C_Invoice_ID@=").append(counter.getDocumentNo());

for (MInvoiceLine invoiceLine:getLines()){
generateCostDetail(invoiceLine);
}
processMsg = info.toString().trim();
setProcessed(true);
setDocAction(DOCACTION_Close);
Expand Down Expand Up @@ -2534,5 +2538,12 @@ private void allocatePrepayments()
}


private void generateCostDetail(MInvoiceLine invoiceLine) {
for (MLandedCostAllocation allocation : MLandedCostAllocation.getOfInvoiceLine(getCtx(), invoiceLine.getC_InvoiceLine_ID(), get_TrxName())) {
CostEngineFactory.getCostEngine(getAD_Client_ID()).createCostDetailForLandedCostAllocation(allocation);
}
}



} // MInvoice

0 comments on commit 53e3eec

Please sign in to comment.