[FIX] acount: aged partner balance
In the aged balance report, the reconcile entries are excluded except if the reconciliation date is greater than the date for which the aged balance report is requested. But this exception should never include opening entries. opw:643172
This commit is contained in:
parent
7c2521a79b
commit
2835381c7e
|
@ -75,7 +75,7 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header):
|
|||
AND (account_account.type IN %s)\
|
||||
AND account_account.active\
|
||||
AND ((reconcile_id IS NULL)\
|
||||
OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
|
||||
OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s AND not recon.opening_reconciliation)))\
|
||||
AND (l.partner_id=res_partner.id)\
|
||||
AND (l.date <= %s)\
|
||||
AND ' + self.query + ' \
|
||||
|
@ -99,7 +99,7 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header):
|
|||
AND (account_account.type IN %s)\
|
||||
AND (l.partner_id IN %s)\
|
||||
AND ((l.reconcile_id IS NULL)\
|
||||
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
|
||||
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s AND not recon.opening_reconciliation)))\
|
||||
AND ' + self.query + '\
|
||||
AND account_account.active\
|
||||
AND (l.date <= %s)\
|
||||
|
@ -119,7 +119,7 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header):
|
|||
AND (COALESCE(l.date_maturity, l.date) < %s)\
|
||||
AND (l.partner_id IN %s)\
|
||||
AND ((l.reconcile_id IS NULL)\
|
||||
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
|
||||
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s AND not recon.opening_reconciliation)))\
|
||||
AND '+ self.query + '\
|
||||
AND account_account.active\
|
||||
AND (l.date <= %s)\
|
||||
|
@ -136,7 +136,7 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header):
|
|||
AND (COALESCE(l.date_maturity,l.date) > %s)\
|
||||
AND (l.partner_id IN %s)\
|
||||
AND ((l.reconcile_id IS NULL)\
|
||||
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
|
||||
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s AND not recon.opening_reconciliation)))\
|
||||
AND '+ self.query + '\
|
||||
AND account_account.active\
|
||||
AND (l.date <= %s)\
|
||||
|
@ -168,7 +168,7 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header):
|
|||
AND (account_account.type IN %s)
|
||||
AND (l.partner_id IN %s)
|
||||
AND ((l.reconcile_id IS NULL)
|
||||
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))
|
||||
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s AND not recon.opening_reconciliation)))
|
||||
AND ''' + self.query + '''
|
||||
AND account_account.active
|
||||
AND ''' + dates_query + '''
|
||||
|
@ -264,7 +264,7 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header):
|
|||
AND (l.partner_id IS NULL)\
|
||||
AND (account_account.type IN %s)\
|
||||
AND ((l.reconcile_id IS NULL) \
|
||||
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
|
||||
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s AND not recon.opening_reconciliation)))\
|
||||
AND ' + self.query + '\
|
||||
AND (l.date <= %s)\
|
||||
AND account_account.active ',(tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from,))
|
||||
|
@ -281,7 +281,7 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header):
|
|||
AND (account_account.type IN %s)\
|
||||
AND (COALESCE(l.date_maturity, l.date) < %s)\
|
||||
AND ((l.reconcile_id IS NULL)\
|
||||
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
|
||||
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s AND not recon.opening_reconciliation)))\
|
||||
AND '+ self.query + '\
|
||||
AND account_account.active ', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from))
|
||||
t = self.cr.fetchall()
|
||||
|
@ -296,7 +296,7 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header):
|
|||
AND (account_account.type IN %s)\
|
||||
AND (COALESCE(l.date_maturity,l.date) > %s)\
|
||||
AND ((l.reconcile_id IS NULL)\
|
||||
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
|
||||
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s AND not recon.opening_reconciliation)))\
|
||||
AND '+ self.query + '\
|
||||
AND account_account.active ', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from))
|
||||
t = self.cr.fetchall()
|
||||
|
@ -324,7 +324,7 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header):
|
|||
AND (account_account.type IN %s)\
|
||||
AND (l.partner_id IS NULL)\
|
||||
AND ((l.reconcile_id IS NULL)\
|
||||
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
|
||||
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s AND not recon.opening_reconciliation)))\
|
||||
AND '+ self.query + '\
|
||||
AND account_account.active\
|
||||
AND ' + dates_query + '\
|
||||
|
|
Loading…
Reference in New Issue