Fixed bug 23617 changed ALERT_RULE_SQL2 in Issue21640WrongMatchInvAccounting
authorSandra Huguet <sandra.huguet@openbravo.com>
Fri, 17 May 2013 12:04:47 +0200
changeset 20482 7b20cf4da8ef
parent 20481 a569477afae5
child 20483 14c8d925fdc6
Fixed bug 23617 changed ALERT_RULE_SQL2 in Issue21640WrongMatchInvAccounting
src-util/modulescript/build/classes/org/openbravo/modulescript/Issue21640WrongMatchInvAccounting.class
src-util/modulescript/src/org/openbravo/modulescript/Issue21640WrongMatchInvAccounting.java
Binary file src-util/modulescript/build/classes/org/openbravo/modulescript/Issue21640WrongMatchInvAccounting.class has changed
--- a/src-util/modulescript/src/org/openbravo/modulescript/Issue21640WrongMatchInvAccounting.java	Tue May 28 12:46:06 2013 +0200
+++ b/src-util/modulescript/src/org/openbravo/modulescript/Issue21640WrongMatchInvAccounting.java	Fri May 17 12:04:47 2013 +0200
@@ -25,7 +25,7 @@
 public class Issue21640WrongMatchInvAccounting extends ModuleScript {
 
   final static private String ALERT_RULE_SQL1 = "SELECT DISTINCT ad_column_identifier('m_matchinv', fa.record_id, 'en_US') as record_id, fa.record_id as referencekey_id, 0 as ad_role_id, null as ad_user_id, 'This Matched Invoice need to be posted again due to wrong accounting.' as description, 'Y' as isactive, mi.ad_org_id, mi.ad_client_id,  now() as created, 0 as createdBy, now() as updated, 0 as updatedBy FROM fact_acct fa JOIN m_matchinv mi ON fa.record_id = mi.m_matchinv_id WHERE fa.ad_table_id = '472' GROUP BY fa.fact_acct_group_id, mi.m_matchinv_id, mi.ad_org_id, fa.record_id, mi.ad_client_id HAVING count(*) > 3";
-  final static private String ALERT_RULE_SQL2 = "SELECT DISTINCT ad_column_identifier('m_matchinv', fa.record_id, 'en_US') as record_id, fa.record_id as referencekey_id, 0 as ad_role_id, null as ad_user_id, 'This Matched Invoice need to be posted again due to wrong accounting.' as description, 'Y' as isactive, mi.ad_org_id, mi.ad_client_id,  now() as created, 0 as createdBy, now() as updated, 0 as updatedBy FROM fact_acct fa JOIN m_matchinv mi ON fa.record_id = mi.m_matchinv_id LEFT JOIN fact_acct far ON far.line_id = mi.m_inoutline_id AND far.account_id = fa.account_id LEFT JOIN fact_acct fi ON fi.line_id = mi.c_invoiceline_id AND fi.account_id = fa.account_id AND fi.ad_table_id = '318' WHERE 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))";
+  final static private String ALERT_RULE_SQL2 = "SELECT DISTINCT ad_column_identifier('m_matchinv', fa.record_id, 'en_US') as record_id, fa.record_id as referencekey_id, 0 as ad_role_id, null as ad_user_id, 'This Matched Invoice need to be posted again due to wrong accounting.' as description, 'Y' as isactive, mi.ad_org_id, mi.ad_client_id, now() as created, 0 as createdBy, now() as updated, 0 as updatedBy FROM fact_acct fa JOIN m_matchinv mi ON fa.record_id = mi.m_matchinv_id LEFT JOIN fact_acct far ON far.line_id = mi.m_inoutline_id AND far.account_id = fa.account_id LEFT JOIN fact_acct fi ON fi.line_id = mi.c_invoiceline_id AND fi.account_id = fa.account_id AND fi.ad_table_id = '318' 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))";
   final static private String ALERT_RULE1 = "Wrong Matched Invoice posting. Wrong account.";
   final static private String ALERT_RULE2 = "Wrong Matched Invoice posting. Wrong currency conversion.";
   final static private String ALERT_NAME = "This Matched Invoice need to be posted again due to wrong accounting.";