Fixes issue 29899: False positives in GLJournalAccountingCheck validation
authorEduardo Argal Guibert <eduardo.argal@openbravo.com>
Fri, 15 May 2015 12:01:31 +0200
changeset 26696 a2dd91b010a9
parent 26695 aafe4f86b29c
child 26697 cbea2f4da446
Fixes issue 29899: False positives in GLJournalAccountingCheck validation
Missing ad_table_id constraint ends up in wrong validation when there are old records using numeric values for ids.
src-util/buildvalidation/src/org/openbravo/buildvalidation/GLJournalAccountingCheck_data.xsql
--- a/src-util/buildvalidation/src/org/openbravo/buildvalidation/GLJournalAccountingCheck_data.xsql	Thu May 14 17:12:18 2015 +0200
+++ b/src-util/buildvalidation/src/org/openbravo/buildvalidation/GLJournalAccountingCheck_data.xsql	Fri May 15 12:01:31 2015 +0200
@@ -55,6 +55,7 @@
          WHERE t1.gl_journal_id = t2.record_id
          AND t1.gl_journalline_id = t2.line_id
          AND t1.c_validcombination_id IS NOT NULL
+         AND AD_Table_ID = '224'
          AND ((t1.amtsourcedr - t1.amtsourcecr) <> (t2.amtsourcedr - t2.amtsourcecr)
          OR  (t1.amtacctdr - t1.amtacctcr) <> (t2.amtacctdr - t2.amtacctcr))
       ]]>
@@ -111,6 +112,7 @@
       AND t1.gl_journalline_id = t2.line_id
       AND t1.c_validcombination_id IS NOT NULL
       AND t1.ad_client_id = ?
+      AND AD_Table_ID = '224'
       AND ((t1.amtsourcedr - t1.amtsourcecr) <> (t2.amtsourcedr - t2.amtsourcecr)
       OR  (t1.amtacctdr - t1.amtacctcr) <> (t2.amtacctdr - t2.amtacctcr))
       ]]>
@@ -165,4 +167,4 @@
       ]]>
     </Sql>
   </SqlMethod>
-</SqlClass>
\ No newline at end of file
+</SqlClass>