diff --git a/addons/account/report/third_party_ledger.py b/addons/account/report/third_party_ledger.py index 4560c61ea2a..d28da4897f0 100644 --- a/addons/account/report/third_party_ledger.py +++ b/addons/account/report/third_party_ledger.py @@ -52,9 +52,13 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header): 'get_start_date':self._get_start_date, 'get_end_date': self._get_end_date, 'get_journal': self._get_journal, - 'get_partners': self._get_partners, - 'get_intial_balance': self._get_intial_balance, - }) + 'get_partners':self._get_partners, + 'get_intial_balance':self._get_intial_balance, + 'display_initial_balance':self._display_initial_balance, + 'display_currency':self._display_currency, + + }) + def date_range(self, start, end): if not start or not end: @@ -274,7 +278,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header): "AND date < %s " , (partner.id, tuple(self.account_ids), self.date_lst[0],)) res = self.cr.fetchall() - return res[0][0],res[0][1],res[0][2] + return res def _sum_debit_partner(self, partner, data): result_tmp = 0.0 @@ -456,7 +460,15 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header): else: currency_total = self.tot_currency = 0.0 return currency_total - + def _display_initial_balance(self, data): + if data['form']['initial_balance'] : + return True + return False + def _display_currency(self,data): + if data['form']['amount_currency'] : + return True + return False + report_sxw.report_sxw('report.account.third_party_ledger', 'res.partner', 'addons/account/report/third_party_ledger.rml',parser=third_party_ledger, header='internal') diff --git a/addons/account/report/third_party_ledger.rml b/addons/account/report/third_party_ledger.rml index 45f0d1e1007..dc66cd57031 100644 --- a/addons/account/report/third_party_ledger.rml +++ b/addons/account/report/third_party_ledger.rml @@ -227,7 +227,7 @@ - [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]] + [[ display_currecny(data) == False or removeParentNode('blockTable') ]] Date @@ -255,7 +255,7 @@ - [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]] + [[ display_currency(data) == False or removeParentNode('blockTable') ]] Balance Brought Forward @@ -274,19 +274,19 @@ - [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]] - [[ data['form']['initial_balance'] and get_intial_balance(p,data) or removeParentNode('tr') ]] - - + [[ display_currency(data) == False or removeParentNode('blockTable') ]] + + [[ data['form']['initial_balance'] or removeParentNode('tr') ]] + Initial Balance - + [[ get_intial_balance(p,data)[0][0] or 0.0 ]] - + [[ get_intial_balance(p,data)[0][1] or 0.0 ]] - + [[ get_intial_balance(p,data)[0][2] or 0.0 ]] @@ -309,7 +309,7 @@
[[ repeatIn(lines(p,data), 'line') ]] - [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]] + [[ display_currency(data) == False or removeParentNode('blockTable') ]] [[ formatLang(line['date'],date=True) ]] @@ -338,7 +338,7 @@
- [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]] + [[ display_currency(data) == True or removeParentNode('blockTable') ]] Date @@ -369,7 +369,7 @@ - [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]] + [[ display_currency(data) == True or removeParentNode('blockTable') ]] Balance Brought Forward @@ -390,25 +390,23 @@ - [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]] - [[ data['form']['initial_balance'] and get_intial_balance(p,data) or removeParentNode('tr') ]] - - + [[ display_currency(data) == True or removeParentNode('blockTable') ]] + + [[display_initial_balance(data) or removeParentNode('tr') ]] + Initial Balance + + + [[ get_intial_balance(p,data)[0][0] or 0.0 ]] - + [[ get_intial_balance(p,data)[0][1] or 0.0 ]] + [[ get_intial_balance(p,data)[0][2] or 0.0 ]] + + - - - - - - - - - + @@ -435,7 +433,7 @@
[[ repeatIn(lines(p,data), 'line') ]] - [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]] + [[ display_currency(data) == True or removeParentNode('blockTable') ]] [[ formatLang(line['date'],date=True) ]] diff --git a/addons/account/report/third_party_ledger_other.rml b/addons/account/report/third_party_ledger_other.rml index dc93a06d2dd..8be4c0f2e9b 100644 --- a/addons/account/report/third_party_ledger_other.rml +++ b/addons/account/report/third_party_ledger_other.rml @@ -410,7 +410,7 @@ - [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]] + [[ display_currency(data) == False or removeParentNode('blockTable') ]] Date @@ -435,7 +435,7 @@ - [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]] + [[ display_currency(data) == False or removeParentNode('blockTable') ]] Balance Brought Forward @@ -454,19 +454,19 @@
[[ repeatIn(objects, 'p') ]] [[ setLang(p.lang) ]] - [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]] - [[ data['form']['initial_balance'] and get_intial_balance(p,data) or removeParentNode('tr') ]] - - + [[ display_currency(data) == False or removeParentNode('blockTable') ]] + + [[ display_initial_balance(data) or removeParentNode('tr') ]] + Initial Balance - + [[ get_intial_balance(p,data)[0][0] or 0.0 ]] - + [[ get_intial_balance(p,data)[0][1] or 0.0 ]] - + [[ get_intial_balance(p,data)[0][2] or 0.0 ]] @@ -486,7 +486,7 @@
[[ repeatIn(lines(p,data), 'line') ]] - [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]] + [[ display_currency(data) == False or removeParentNode('blockTable') ]] [[ formatLang(line['date'],date=True) ]] @@ -513,7 +513,7 @@
- [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]] + [[ display_currency(data) == True or removeParentNode('blockTable') ]] Date @@ -542,7 +542,7 @@ - [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]] + [[ display_currency(data) == True or removeParentNode('blockTable') ]] Balance Brought Forward @@ -565,25 +565,27 @@
[[ repeatIn(objects, 'p') ]] [[ setLang(p.lang) ]] - [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]] - - + [[ display_currency(data) == True or removeParentNode('blockTable') ]] + + [[ data['form']['initial_balance'] or removeParentNode('tr') ]] + Initial Balance + + + [[ get_intial_balance(p,data)[0][0] or 0.0 ]] - + [[ get_intial_balance(p,data)[0][1] or 0.0 ]] - - - - + [[ get_intial_balance(p,data)[0][2] or 0.0 ]] - + + - [[ p.ref ]] - [[ p.name ]] + [[ p.ref ]] - [[ p.name ]] [[ formatLang((sum_debit_partner(p,data))) ]] @@ -603,7 +605,7 @@
[[ repeatIn(lines(p,data), 'line') ]] - [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]] + [[ display_currency(data) == True or removeParentNode('blockTable') ]] [[ formatLang(line['date'],date=True) ]]