Differences

This shows you the differences between two versions of the page.

Link to this comparison view

control_sql_-_gl_balance_integrity_checks [2019/01/27 11:28]
127.0.0.1 external edit
control_sql_-_gl_balance_integrity_checks [2019/02/05 11:27] (current)
admin
Line 81: Line 81:
            '​A/​P Balance'​ AS Comparison,            '​A/​P Balance'​ AS Comparison,
            ​(SELECT -SUM(amount) FROM GL WHERE GLAccountID = 22 AND COALESCE(GL.DivisionID,​ 10) = Division.ID) AS DetailTotal,​            ​(SELECT -SUM(amount) FROM GL WHERE GLAccountID = 22 AND COALESCE(GL.DivisionID,​ 10) = Division.ID) AS DetailTotal,​
-           ​(SELECT SUM(BalanceDue) FROM TransHeader WHERE TransactionType = 8 AND StatusID ​ 9 AND COALESCE(TransHeader.DivisionID,​ 10) = Division.ID) AS DetailTotal+           ​(SELECT SUM(BalanceDue) FROM TransHeader WHERE TransactionType = 8 AND StatusID ​<> ​9 AND COALESCE(TransHeader.DivisionID,​ 10) = Division.ID) AS DetailTotal
    
            FROM Division            FROM Division