Fix aged partner balance

- Fix indentation
- Fix quote in sql query

bzr revid: ced-f77181c998a10440e849e6c2bf5c79f6b1212b3f
This commit is contained in:
ced
2008-01-10 13:59:54 +00:00
parent 7ab61b2614
commit 47764e9e48
+7 -7
View File
@@ -81,12 +81,12 @@ class aged_trial_report(report_sxw.rml_parse):
values[str(i)] = during and during[0] or ""
a3 = "SELECT SUM(debit-credit) \
FROM account_move_line AS line, account_account \
WHERE (line.account_id=account_account.id) AND (account_account.type IN (%s)) \
AND (partner_id = %d) AND (reconcile_id IS NULL) \
AND (line.state <> 'draft') AND (line.period_id in (SELECT id FROM account_period WHERE fiscalyear_id=%d)) \
AND (account_account.company_id = %d) AND account_account.active" %(form['computation'], partner['id'], form['fiscalyear'], form['company_id'])
a3 = "SELECT SUM(debit-credit) \
FROM account_move_line AS line, account_account \
WHERE (line.account_id=account_account.id) AND (account_account.type IN (%s)) \
AND (partner_id = %d) AND (reconcile_id IS NULL) \
AND (line.state <> 'draft') AND (line.period_id in (SELECT id FROM account_period WHERE fiscalyear_id=%d)) \
AND (account_account.company_id = %d) AND account_account.active" %(form['computation'], partner['id'], form['fiscalyear'], form['company_id'])
self.cr.execute(a3)
total = self.cr.fetchone()
@@ -136,7 +136,7 @@ class aged_trial_report(report_sxw.rml_parse):
per = "SELECT SUM(debit-credit) \
FROM account_move_line AS line, account_account \
WHERE (line.account_id=account_account.id) AND (account_account.type IN (%s)) \
AND reconcile_id IS NULL AND (date >= %s) AND (date <= %s) \
AND reconcile_id IS NULL AND (date >= '%s') AND (date <= '%s') \
AND (line.state<>'draft') AND partner_id is not null \
AND (line.period_id in (SELECT id FROM account_period WHERE fiscalyear_id = %d)) \
AND (account_account.company_id = %d) AND account_account.active" %(self.form['computation'], period['start'], period['stop'], fiscalyear, company_id)