From 40fb7979ab26fbad5f2552874410787681925eb4 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Fri, 16 Jul 2010 18:19:19 +0530 Subject: [PATCH] [IMP] account :Improve account reports bzr revid: sbh@tinyerp.com-20100716124919-4p0er6o36s15247x --- addons/account/report/account_journal.rml | 13 ++++++------- addons/account/report/central_journal.py | 2 +- addons/account/report/central_journal.rml | 4 ++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/addons/account/report/account_journal.rml b/addons/account/report/account_journal.rml index f5499ea30dd..61bff9e975a 100644 --- a/addons/account/report/account_journal.rml +++ b/addons/account/report/account_journal.rml @@ -127,8 +127,6 @@ - - @@ -182,7 +180,8 @@ - + + @@ -204,7 +203,7 @@ - + Chat Account Fiscal Year @@ -218,7 +217,7 @@ [[ get_fiscalyear(data) or removeParentNode('para') ]] [[o.journal_id.name ]] [[ get_filter(data)=='No Filter' and get_filter(data) or removeParentNode('para') ]] - [[ get_filter(data)=='Date' or removeParentNode('blockTable') ]] + [[ get_filter(data)=='Date' or removeParentNode('blockTable') ]] Start Date End Date @@ -228,7 +227,7 @@ [[ data['form']['date_to'] ]] - [[ get_filter(data)=='Periods' or removeParentNode('blockTable') ]] + [[ get_filter(data)=='Periods' or removeParentNode('blockTable') ]] Start Period End Period @@ -314,7 +313,7 @@ [[ formatLang(line.debit) ]] [[ formatLang(line.credit) ]] [[ formatLang(line.credit - line.debit) ]] - [[ line.account_id.currency_id and formatLang(line.amount_currency) or '' ]] [[ line.amount_currency.code or '']] + [[ line.account_id.currency_id and formatLang(line.amount_currency) or '' ]] [[ line.amount_currency.code or '']] diff --git a/addons/account/report/central_journal.py b/addons/account/report/central_journal.py index 03cb5943c6d..83cfb88e8da 100644 --- a/addons/account/report/central_journal.py +++ b/addons/account/report/central_journal.py @@ -64,7 +64,7 @@ class journal_print(report_sxw.rml_parse, common_report_header): return super(journal_print, self).set_context(objects, data, ids, report_type) def lines(self, period_id, journal_id): - self.cr.execute('SELECT a.code, a.name, c.code AS currency_code, l.amount_currency ,SUM(debit) AS debit, SUM(credit) AS credit from account_move_line l LEFT JOIN account_account a ON (l.account_id=a.id) LEFT JOIN res_currency c on (l.currency_id=c.id)WHERE l.period_id=%s AND l.journal_id=%s '+self.query_get_clause+' GROUP BY a.id, a.code, a.name,l.amount_currency,c.code ', (period_id, journal_id)) + self.cr.execute('SELECT a.currency_id ,a.code, a.name, c.code AS currency_code, l.amount_currency ,SUM(debit) AS debit, SUM(credit) AS credit from account_move_line l LEFT JOIN account_account a ON (l.account_id=a.id) LEFT JOIN res_currency c on (l.currency_id=c.id)WHERE l.period_id=%s AND l.journal_id=%s '+self.query_get_clause+' GROUP BY a.id, a.code, a.name,l.amount_currency,c.code , a.currency_id', (period_id, journal_id)) res = self.cr.dictfetchall() return res def _set_get_account_currency_code(self, account_id): diff --git a/addons/account/report/central_journal.rml b/addons/account/report/central_journal.rml index 9cd76c140eb..7ddc8e7002e 100644 --- a/addons/account/report/central_journal.rml +++ b/addons/account/report/central_journal.rml @@ -343,7 +343,7 @@ [[ formatLang( sum_debit(o.period_id.id, o.journal_id.id)) ]] [[ formatLang( sum_credit(o.period_id.id, o.journal_id.id)) ]] [[ formatLang( sum_credit(o.period_id.id, o.journal_id.id)-sum_credit(o.period_id.id, o.journal_id.id) ) ]] - [[ o.currency_id and formatLang(sum_currency_amount_account(o, data['form'])) +o.currency_id.code or '' ]] + [[ o.journal_id.currency and formatLang(sum_currency_amount_account(o, data['form'])) + o.journal_id.currency.code or '' ]] @@ -367,7 +367,7 @@ [[ formatLang(line['debit']) ]] [[ formatLang(line['credit'])]] [[ formatLang(line['debit']-line['credit']) ]] - [[ formatLang(line['amount_currency']) or '' ]] [[ line['currency_code'] or '']] + [[ line['currency_id'] and formatLang(line['amount_currency']) or '' ]] [[ line['currency_code'] or '']]