Skip to content

Commit

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

#1912 Landed cost allocation
  • Loading branch information
e-Evolution committed Oct 1, 2018
2 parents 8794c49 + 0c54078 commit fd02bbe
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions base/src/org/compiere/model/MInvoiceLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -977,12 +977,14 @@ public String allocateLandedCosts()
MLandedCost[] lcs = MLandedCost.getLandedCosts(this);
if (lcs.length == 0)
return "";
String sql = "DELETE C_LandedCostAllocation WHERE C_InvoiceLine_ID=" + getC_InvoiceLine_ID();
int no = DB.executeUpdate(sql, get_TrxName());

sql = "DELETE M_CostDetail WHERE C_landedcostallocation_ID in " +
String sql = "DELETE M_CostDetail WHERE C_landedcostallocation_ID in " +
"(select c_landedCostAllocation_ID from c_landedcostAllocation where c_invoiceline_ID=" + getC_InvoiceLine_ID() + ")";
no = DB.executeUpdate(sql, get_TrxName());
int no = DB.executeUpdate(sql, get_TrxName());
if (no != 0)
log.info("Deleted #" + no);
sql = "DELETE C_LandedCostAllocation WHERE C_InvoiceLine_ID=" + getC_InvoiceLine_ID();
no = DB.executeUpdate(sql, get_TrxName());
if (no != 0)
log.info("Deleted #" + no);

Expand Down

0 comments on commit fd02bbe

Please sign in to comment.