diff --git a/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java b/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java index efea41e29e..b94fd6d418 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java @@ -1016,13 +1016,13 @@ public class MInvoiceLine extends X_C_InvoiceLine { if (isProcessed()) return "Processed"; - MLandedCost[] lcs = MLandedCost.getLandedCosts(this); - if (lcs.length == 0) - return ""; StringBuilder sql = new StringBuilder("DELETE C_LandedCostAllocation WHERE C_InvoiceLine_ID=").append(getC_InvoiceLine_ID()); int no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) if (log.isLoggable(Level.INFO)) log.info("Deleted #" + no); + MLandedCost[] lcs = MLandedCost.getLandedCosts(this); + if (lcs.length == 0) + return ""; int inserted = 0; // *** Single Criteria ***