Related to bug 28389: If is no diff in match LCC leave LCC amount as matchedAmt
authorUnai Martirena <unai.martirena@openbravo.com>
Fri, 19 Dec 2014 12:01:16 +0100
changeset 25622 a705033f90f1
parent 25621 89ccf1b5d6be
child 25623 a39bd13414a2
Related to bug 28389: If is no diff in match LCC leave LCC amount as matchedAmt
src/org/openbravo/costing/LandedCostProcess.java
--- a/src/org/openbravo/costing/LandedCostProcess.java	Thu Dec 18 18:36:08 2014 +0100
+++ b/src/org/openbravo/costing/LandedCostProcess.java	Fri Dec 19 12:01:16 2014 +0100
@@ -323,6 +323,9 @@
     critMatched.add(Restrictions.eq(LCMatched.PROPERTY_LANDEDCOSTCOST, lcc));
     critMatched.setProjection(Projections.sum(LCMatched.PROPERTY_AMOUNT));
     BigDecimal matchedAmt = (BigDecimal) critMatched.uniqueResult();
+    if (matchedAmt == null) {
+      matchedAmt = lcc.getAmount();
+    }
     lcc.setMatchingAmount(matchedAmt);
     OBDal.getInstance().save(lcc);
   }