From 9e6f8cd12b76fc4240528518bdcec763736f41ee Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Fri, 23 Jul 2010 15:54:59 +0530 Subject: [PATCH] [Add] account : Add the currency in third_party_ledger report bzr revid: sbh@tinyerp.com-20100723102459-dq5sq8lw4z8gqqkb --- addons/account/report/third_party_ledger.py | 4 +- .../report/third_party_ledger_other.rml | 117 ++++++++++++++++-- 2 files changed, 112 insertions(+), 9 deletions(-) diff --git a/addons/account/report/third_party_ledger.py b/addons/account/report/third_party_ledger.py index fe9cca79176..0f945ebf875 100644 --- a/addons/account/report/third_party_ledger.py +++ b/addons/account/report/third_party_ledger.py @@ -235,10 +235,11 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header): # full_account.append(r) if self.date_lst_string: self.cr.execute( - "SELECT l.id,l.date,j.code, l.ref, l.name, l.debit, l.credit " \ + "SELECT l.id,l.date,j.code, l.ref, l.name, l.debit, l.credit,l.amount_currency,c.code AS currency_code " \ "FROM account_move_line l " \ "LEFT JOIN account_journal j " \ "ON (l.journal_id = j.id) " \ + "LEFT JOIN res_currency c on (l.currency_id=c.id)" \ "WHERE l.partner_id = %s " \ "AND l.account_id IN %s"\ "AND l.date IN (" + self.date_lst_string + ")" @@ -246,6 +247,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header): "ORDER BY l.id", (partner.id, tuple(self.account_ids),)) res = self.cr.dictfetchall() + print res sum = 0.0 for r in res: sum = r['debit'] - r['credit'] diff --git a/addons/account/report/third_party_ledger_other.rml b/addons/account/report/third_party_ledger_other.rml index bbd2b7c533e..196cdd0ac02 100644 --- a/addons/account/report/third_party_ledger_other.rml +++ b/addons/account/report/third_party_ledger_other.rml @@ -74,6 +74,10 @@ + + + + @@ -131,7 +135,7 @@ - Third Party Ledger + 111111111Third Party Ledger @@ -184,7 +188,7 @@ - + [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]] Date @@ -212,7 +216,7 @@ - + [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]] Balance Brought Forward @@ -233,7 +237,7 @@
[[ repeatIn(objects, 'p') ]] [[ setLang(p.lang) ]] - + [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]] [[ p.ref ]] - [[ p.name ]] @@ -254,7 +258,7 @@
[[ repeatIn(lines(p,data), 'line') ]] - + [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]] [[ formatLang(line['date'],date=True) ]] @@ -287,8 +291,105 @@
- - - + + + [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]] + + + Date + + + JNRL + + + Ref. + + + Entry Label + + + Debit + + + Credit + + + Balance + + + Currency + + + + + [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]] + + + Balance Brought Forward + + + [[ formatLang((sum_debit(data))) ]] + + + [[ formatLang((sum_credit(data))) ]] + + + [[ formatLang((sum_debit(data) - sum_credit(data))) ]] + + + + +
+ [[ repeatIn(objects, 'p') ]] [[ setLang(p.lang) ]] + [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]] + + + [[ p.ref ]] - [[ p.name ]] + + + [[ formatLang((sum_debit_partner(p,data))) ]] + + + [[ formatLang((sum_credit_partner(p,data))) ]] + + + [[ formatLang((sum_debit_partner(p,data) - sum_credit_partner(p,data))) ]] + + + + +
+ [[ repeatIn(lines(p,data), 'line') ]] + [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]] + + + [[ formatLang(line['date'],date=True) ]] + + + [[ line['code'] ]] + + + [[ line['ref'] ]] + + + [[ line['name'] ]] + + + [[ formatLang((line['debit'])) ]] + + + [[ formatLang((line['credit'])) ]] + + + [[ formatLang((line['progress'])) ]] + + [[ formatLang(line['amount_currency'] or '') ]] [[ line['currency_code'] or '']] + + +
+ + + +
\ No newline at end of file