issue 22881: Wrong definition of the alert
authorJavier Etxarri <javier.echarri@openbravo.com>
Tue, 26 Feb 2013 23:13:02 +0100
changeset 19805 f6907c2d08fb
parent 19804 4ee9d8640045
child 19806 497c2b94c060
issue 22881: Wrong definition of the alert
'Wrong Matched Invoice posting. Wrong currency conversion.'
src-util/modulescript/build/classes/org/openbravo/modulescript/Issue21640WrongMatchInvAccountingData.class
src-util/modulescript/src/org/openbravo/modulescript/Issue21640WrongMatchInvAccounting_data.xsql
Binary file src-util/modulescript/build/classes/org/openbravo/modulescript/Issue21640WrongMatchInvAccountingData.class has changed
--- a/src-util/modulescript/src/org/openbravo/modulescript/Issue21640WrongMatchInvAccounting_data.xsql	Tue Feb 26 22:58:05 2013 +0100
+++ b/src-util/modulescript/src/org/openbravo/modulescript/Issue21640WrongMatchInvAccounting_data.xsql	Tue Feb 26 23:13:02 2013 +0100
@@ -50,7 +50,9 @@
           JOIN c_invoiceline il ON mi.c_invoiceline_id = il.c_invoiceline_id
           LEFT JOIN fact_acct far ON far.line_id = iol.m_inoutline_id AND far.account_id = fa.account_id
           LEFT JOIN fact_acct fi ON fi.line_id = il.c_invoiceline_id AND fi.account_id = fa.account_id AND fi.ad_table_id = '318'
-      WHERE fa.ad_table_id = '472'
+      WHERE (round((select movementqty from m_inoutline where m_inoutline_id=mi.m_inoutline_id),2) = 
+            round((select qtyinvoiced from c_invoiceline where c_invoiceline_id=mi.c_invoiceline_id),2))     
+        AND fa.ad_table_id = '472'
         AND (COALESCE(far.amtacctcr + far.amtacctdr, fa.amtacctdr + fa.amtacctcr) <> (fa.amtacctdr + fa.amtacctcr)
             OR COALESCE(fi.amtacctcr + fi.amtacctdr, fa.amtacctdr + fa.amtacctcr) <> (fa.amtacctdr + fa.amtacctcr))
         AND fa.ad_client_id = ?