Fixes bug 27834: Match LC Cost window does not show the landed cost type once matched.
authorEduardo Argal Guibert <eduardo.argal@openbravo.com>
Fri, 10 Oct 2014 13:28:52 +0200
changeset 25036 7d9c64b8e40c
parent 25035 599405c75b1f
child 25037 a94c1d59710b
Fixes bug 27834: Match LC Cost window does not show the landed cost type once matched.

Wrong query (hql in table) and inserter.
src-db/database/sourcedata/AD_TABLE.xml
src/org/openbravo/common/inserters/LCMatchFromInvoiceInserter.java
--- a/src-db/database/sourcedata/AD_TABLE.xml	Fri Oct 10 12:59:19 2014 +0200
+++ b/src-db/database/sourcedata/AD_TABLE.xml	Fri Oct 10 13:28:52 2014 +0200
@@ -11405,7 +11405,7 @@
   join lcc.landedCostType as lct
   left join lcc.landedCostMatchedList as lcm with lcm.invoiceLine.id = :invlineid,
   InvoiceLine as il
-where (lcc.isMatchingAdjusted = false or lcm is not null)
+where (lcc.matched = false or lcm is not null)
   and @additional_filters@
   and @insertion_point_0@
 group by  coalesce(lcm.id, lcc.id), lcc, lct.name, lcc.amount, lcc.currency.iSOCode, lcm.amount, case when lcm is not null then true else false end, lc.referenceDate, lcc.matched, lcc.isMatchingAdjusted, lcm.id, lcc.id, il, lc.documentNo, lcc.lineNo, lcm.amountInInvoiceCurrency]]></HQLQUERY>
--- a/src/org/openbravo/common/inserters/LCMatchFromInvoiceInserter.java	Fri Oct 10 12:59:19 2014 +0200
+++ b/src/org/openbravo/common/inserters/LCMatchFromInvoiceInserter.java	Fri Oct 10 13:28:52 2014 +0200
@@ -38,7 +38,6 @@
     Check.isTrue(IsIDFilter.instance.accept(strInvoiceLineID), "Value " + strInvoiceLineID
         + " is not a valid id.");
     String strWhereClause = " (il is null or il.id = :invlineid) ";
-    strWhereClause += "and (lcc.matched = false or lcc.invoiceLine.id = :invlineid) ";
     queryNamedParameters.put("invlineid", strInvoiceLineID);
 
     final String strInvoiceLineId = requestParameters.get("@InvoiceLine.id@");