From 32e1d070e264431099eb91a009c5d65263f57ac7 Mon Sep 17 00:00:00 2001 From: vra Date: Thu, 16 Sep 2010 19:14:07 +0530 Subject: [PATCH] [ADD][IMP] account: added account code and name colomn and improved the table in partner ledger report. bzr revid: vra@tinyerp.com-20100916134407-vcsv1vkzplrjjr33 --- .../account/report/account_partner_ledger.py | 8 ++-- .../account/report/account_partner_ledger.rml | 45 +++++++++++++------ .../report/account_partner_ledger_other.rml | 42 ++++++++++++----- 3 files changed, 67 insertions(+), 28 deletions(-) diff --git a/addons/account/report/account_partner_ledger.py b/addons/account/report/account_partner_ledger.py index 742c0c6e158..2a0c7446b6b 100644 --- a/addons/account/report/account_partner_ledger.py +++ b/addons/account/report/account_partner_ledger.py @@ -135,12 +135,14 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header): else: RECONCILE_TAG = "AND l.reconcile_id IS NULL" self.cr.execute( - "SELECT l.id,l.date,j.code, l.ref, m.name as move_name, l.name, l.debit, l.credit,l.amount_currency,c.code AS currency_code " \ + "SELECT l.id, l.date, j.code, acc.code as a_code, acc.name as a_name, l.ref, m.name as move_name, l.name, l.debit, l.credit, l.amount_currency, c.symbol 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)" \ - "LEFT JOIN account_move m on (m.id=l.move_id)" \ + "LEFT JOIN account_account acc " \ + "ON (l.account_id = acc.id) " \ + "LEFT JOIN res_currency c ON (l.currency_id=c.id)" \ + "LEFT JOIN account_move m ON (m.id=l.move_id)" \ "WHERE l.partner_id = %s " \ "AND l.account_id IN %s AND " + self.query +" " \ "AND m.state IN %s " \ diff --git a/addons/account/report/account_partner_ledger.rml b/addons/account/report/account_partner_ledger.rml index fdccec10f77..88b61dd43f6 100644 --- a/addons/account/report/account_partner_ledger.rml +++ b/addons/account/report/account_partner_ledger.rml @@ -24,6 +24,7 @@ + @@ -36,7 +37,7 @@ - + @@ -69,6 +70,9 @@ + + + @@ -80,6 +84,7 @@ + @@ -96,12 +101,13 @@ + - + @@ -123,6 +129,7 @@ + @@ -270,7 +277,7 @@ - [[ display_currency(data) == False or removeParentNode('blockTable') ]] + [[ display_currency(data) == False or removeParentNode('blockTable') ]] Date @@ -281,6 +288,9 @@ Ref. + + A/c No.- Name + Entry Label @@ -301,7 +311,7 @@ - [[ display_currency(data) == False or removeParentNode('blockTable') ]] + [[ display_currency(data) == False or removeParentNode('blockTable') ]] @@ -319,7 +329,7 @@ [[ data['form']['initial_balance'] or removeParentNode('tr') ]] - Initial Balance + Initial Balance [[ formatLang(get_intial_balance(p)[0][0])]] [[ company.currency_id.symbol ]] @@ -337,7 +347,7 @@
[[ repeatIn(lines(p), 'line') ]] - [[ display_currency(data) == False or removeParentNode('blockTable') ]] + [[ display_currency(data) == False or removeParentNode('blockTable') ]] [[ formatLang(line['date'],date=True) ]] @@ -349,7 +359,10 @@ [[ line['move_name'] ]] - b[[ (line['ref'] or '') + ' ' + line['name'] ]] + [[ line['a_code'] ]] - [[ line['a_name'] ]] + + + [[ line['ref'] ]] - [[ line['name'] ]] [[ formatLang((line['debit'])) ]] [[ company.currency_id.symbol ]] @@ -366,10 +379,10 @@
- [[ display_currency(data) == True or removeParentNode('blockTable') ]] + [[ display_currency(data) == True or removeParentNode('blockTable') ]] - Datefff + Date JNRL @@ -377,6 +390,9 @@ Ref. + + A/c No.- Name + Entry Label @@ -400,7 +416,7 @@ - [[ display_currency(data) == True or removeParentNode('blockTable') ]] + [[ display_currency(data) == True or removeParentNode('blockTable') ]] @@ -423,7 +439,7 @@ [[display_initial_balance(data) or removeParentNode('tr') ]] - Initial Balance + Initial Balance [[ formatLang(get_intial_balance(p)[0][0]) ]] [[ company.currency_id.symbol ]] @@ -444,7 +460,7 @@
[[ repeatIn(lines(p), 'line') ]] - [[ display_currency(data) == True or removeParentNode('blockTable') ]] + [[ display_currency(data) == True or removeParentNode('blockTable') ]] [[ formatLang(line['date'],date=True) ]] @@ -456,7 +472,10 @@ [[ line['move_name'] ]] - a[[ (line['ref'] or '') + ' ' + line['name'] ]] + [[ line['a_code'] ]] - [[ line['a_name'] ]] + + + [[ (line['ref'] or '') + ' ' + line['name'] ]] [[ formatLang((line['debit'])) ]] [[ company.currency_id.symbol ]] diff --git a/addons/account/report/account_partner_ledger_other.rml b/addons/account/report/account_partner_ledger_other.rml index edbf74e3bae..1e8429546db 100644 --- a/addons/account/report/account_partner_ledger_other.rml +++ b/addons/account/report/account_partner_ledger_other.rml @@ -181,7 +181,9 @@ - + + + @@ -207,6 +209,7 @@ + @@ -219,7 +222,7 @@ - + @@ -231,6 +234,7 @@ + @@ -243,6 +247,7 @@ + @@ -256,7 +261,7 @@ - + @@ -269,6 +274,7 @@ + @@ -425,7 +431,7 @@ - [[ display_currency(data) == False or removeParentNode('blockTable') ]] + [[ display_currency(data) == False or removeParentNode('blockTable') ]] Date @@ -436,6 +442,9 @@ Ref. + + A/c No.- Name + Entry Label @@ -452,7 +461,7 @@
[[ repeatIn(objects, 'p') ]] [[ setLang(p.lang) ]] - [[ display_currency(data) == False or removeParentNode('blockTable') ]] + [[ display_currency(data) == False or removeParentNode('blockTable') ]] @@ -470,7 +479,7 @@ [[ display_initial_balance(data) or removeParentNode('tr') ]] - Initial Balance + Initial Balance [[ formatLang(get_intial_balance(p)[0][0])]] [[ company.currency_id.symbol ]] @@ -485,7 +494,7 @@
[[ repeatIn(lines(p), 'line') ]] - [[ display_currency(data) == False or removeParentNode('blockTable') ]] + [[ display_currency(data) == False or removeParentNode('blockTable') ]] [[ formatLang(line['date'],date=True) ]] @@ -497,7 +506,10 @@ [[ line['move_name'] ]] - [[ (line['ref'] or '')+ ' ' + line['name'] ]] + [[ line['a_code'] ]] - [[ line['a_name'] ]] + + + [[ (line['ref'] or '') + ' ' + line['name'] ]] [[ formatLang((line['debit'])) ]] [[ company.currency_id.symbol ]] @@ -512,7 +524,7 @@
- [[ display_currency(data) == True or removeParentNode('blockTable') ]] + [[ display_currency(data) == True or removeParentNode('blockTable') ]] Date @@ -523,6 +535,9 @@ Ref. + + A/c No.- Name + Entry Label @@ -543,7 +558,7 @@
[[ repeatIn(objects, 'p') ]] [[ setLang(p.lang) ]] - [[ display_currency(data) == True or removeParentNode('blockTable') ]] + [[ display_currency(data) == True or removeParentNode('blockTable') ]] @@ -566,7 +581,7 @@ [[ data['form']['initial_balance'] or removeParentNode('tr') ]] - Initial Balance + Initial Balance [[ formatLang(get_intial_balance(p)[0][0]) ]] [[ company.currency_id.symbol ]] @@ -584,7 +599,7 @@
[[ repeatIn(lines(p), 'line') ]] - [[ display_currency(data) == True or removeParentNode('blockTable') ]] + [[ display_currency(data) == True or removeParentNode('blockTable') ]] [[ formatLang(line['date'],date=True) ]] @@ -595,6 +610,9 @@ [[ line['move_name'] ]] + + [[ line['a_code'] ]] - [[ line['a_name'] ]] + [[ (line['ref'] or '') + ' ' + line['name'] ]]