From e7dc8c2d55bbf32ef76b7c0fa059a9d807a034fb Mon Sep 17 00:00:00 2001 From: vra Date: Wed, 11 Aug 2010 15:39:47 +0530 Subject: [PATCH] [IMP] account: 'Profit And Loss' & 'Balance Sheet' Reports. bzr revid: vra@tinyerp.com-20100811100947-9gqhubg8hl7hlnjn --- addons/account/report/account_balance_sheet.py | 4 ---- addons/account/report/account_balance_sheet.rml | 8 ++++---- .../report/account_balance_sheet_horizontal.rml | 8 ++++---- addons/account/report/account_profit_horizontal.rml | 12 ++++++------ addons/account/report/account_profit_loss.py | 3 --- addons/account/report/account_profit_loss.rml | 12 ++++++------ 6 files changed, 20 insertions(+), 27 deletions(-) diff --git a/addons/account/report/account_balance_sheet.py b/addons/account/report/account_balance_sheet.py index 08df077c779..ab5a284e412 100644 --- a/addons/account/report/account_balance_sheet.py +++ b/addons/account/report/account_balance_sheet.py @@ -38,7 +38,6 @@ class report_balancesheet_horizontal(rml_parse.rml_parse, common_report_header): self.result_temp = [] self.localcontext.update({ 'time': time, - 'get_abs' : self.get_abs, 'get_lines' : self.get_lines, 'get_lines_another' : self.get_lines_another, 'get_company': self._get_company, @@ -61,9 +60,6 @@ class report_balancesheet_horizontal(rml_parse.rml_parse, common_report_header): }) self.context = context - def get_abs(self,amount): - return abs(amount) - def sum_dr(self): if self.res_bl['type'] == 'Net Profit': self.result_sum_dr += self.res_bl['balance'] diff --git a/addons/account/report/account_balance_sheet.rml b/addons/account/report/account_balance_sheet.rml index 1a5abbdea23..3722e3d1f9f 100644 --- a/addons/account/report/account_balance_sheet.rml +++ b/addons/account/report/account_balance_sheet.rml @@ -245,7 +245,7 @@ [[ '. '*(a['level']-1) ]][[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name'] ]] - [[ a['balance'] or '' ]] + [[ a['balance'] and formatLang(abs(a['balance'])) or 0.0 ]] @@ -255,7 +255,7 @@ Balance:([[ get_currency(data) ]]) - [[ sum_dr() and formatLang(sum_dr()) or 0.0 ]] + [[ formatLang(abs(sum_dr())) or 0.0 ]] @@ -283,7 +283,7 @@ [[ a['code'] ]][[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name'] ]] - [[ a['balance'] and formatLang(a['balance']) or 0.0 ]] + [[ a['balance'] and formatLang(abs(a['balance'])) or 0.0 ]] @@ -293,7 +293,7 @@ Balance:([[ get_currency(data) ]]) - [[ sum_cr() and formatLang(sum_cr()) or 0.0 ]] + [[ formatLang(abs(sum_cr())) or 0.0 ]] diff --git a/addons/account/report/account_balance_sheet_horizontal.rml b/addons/account/report/account_balance_sheet_horizontal.rml index 8cd7e8bab51..d30f904619a 100644 --- a/addons/account/report/account_balance_sheet_horizontal.rml +++ b/addons/account/report/account_balance_sheet_horizontal.rml @@ -272,7 +272,7 @@ [[ '. '*(a['level']-1) ]][[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name'] ]] - [[ a['balance'] and formatLang(get_abs(a['balance'])) or '' ]] + [[ a['balance'] and formatLang(abs(a['balance'])) or '' ]] [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['code1'] ]] @@ -281,7 +281,7 @@ [[ '. '*(a['level1']-1) ]][[ a['level1']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name1'] ]] - [[ a['balance1'] and formatLang(get_abs(a['balance1'])) or 0.0 ]] + [[ a['balance1'] and formatLang(abs(a['balance1'])) or 0.0 ]] @@ -291,13 +291,13 @@ Balance:([[ get_currency(data) ]]) - [[ sum_dr() and formatLang(get_abs(sum_dr())) or 0.0 ]] + [[ formatLang(abs(sum_dr())) or 0.0 ]] Balance:([[ get_currency(data) ]]) - [[ sum_cr() and formatLang(get_abs(sum_cr())) or 0.0 ]] + [[ formatLang(abs(sum_cr())) or 0.0 ]] diff --git a/addons/account/report/account_profit_horizontal.rml b/addons/account/report/account_profit_horizontal.rml index 28215f06075..76d462aacf8 100644 --- a/addons/account/report/account_profit_horizontal.rml +++ b/addons/account/report/account_profit_horizontal.rml @@ -282,7 +282,7 @@ - [[ a['balance'] and formatLang(get_abs(a['balance'])) or 0.0 ]] + [[ a['balance'] and formatLang(abs(a['balance'])) or 0.0 ]] @@ -295,7 +295,7 @@ - [[ a['balance1'] and formatLang(get_abs(a['balance1'])) or '' ]] + [[ a['balance1'] and formatLang(abs(a['balance1'])) or '' ]] @@ -308,7 +308,7 @@ [[ final_result()['type'] == 'Net Profit C.F.B.L.' and final_result()['type'] or '' ]] - [[ final_result()['balance'] and final_result()['type'] == 'Net Profit C.F.B.L.' and formatLang(get_abs(final_result()['balance'])) or 0.0 ]] + [[ final_result()['balance'] and final_result()['type'] == 'Net Profit C.F.B.L.' and formatLang(abs(final_result()['balance'])) or 0.0 ]] @@ -317,7 +317,7 @@ [[ final_result()['type'] == 'Net Loss C.F.B.L.' and final_result()['type'] or '' ]] - [[ final_result()['balance'] and final_result()['type'] == 'Net Loss C.F.B.L.' and formatLang(get_abs(final_result()['balance'])) or 0.0 ]] + [[ final_result()['balance'] and final_result()['type'] == 'Net Loss C.F.B.L.' and formatLang(abs(final_result()['balance'])) or 0.0 ]] @@ -328,13 +328,13 @@ Total:([[ get_currency(data['form']) ]]) - [[ sum_dr() and formatLang(get_abs(sum_dr())) or 0.0 ]] + [[ sum_dr() and formatLang(abs(sum_dr())) or 0.0 ]] Total:([[ get_currency(data['form']) ]]) - [[ sum_cr() and formatLang(get_abs(sum_cr())) or 0.0 ]] + [[ sum_cr() and formatLang(abs(sum_cr())) or 0.0 ]] diff --git a/addons/account/report/account_profit_loss.py b/addons/account/report/account_profit_loss.py index d8da95b53e2..c1c74a1f54d 100644 --- a/addons/account/report/account_profit_loss.py +++ b/addons/account/report/account_profit_loss.py @@ -36,7 +36,6 @@ class report_pl_account_horizontal(rml_parse.rml_parse, common_report_header): self.result_temp = [] self.localcontext.update( { 'time': time, - 'get_abs' : self.get_abs, 'get_lines' : self.get_lines, 'get_lines_another' : self.get_lines_another, 'get_currency': self._get_currency, @@ -57,8 +56,6 @@ class report_pl_account_horizontal(rml_parse.rml_parse, common_report_header): }) self.context = context - def get_abs(self,amount): - return abs(amount) def final_result(self): return self.res_pl diff --git a/addons/account/report/account_profit_loss.rml b/addons/account/report/account_profit_loss.rml index 0a5c03ad395..7bf0704b8a0 100644 --- a/addons/account/report/account_profit_loss.rml +++ b/addons/account/report/account_profit_loss.rml @@ -274,7 +274,7 @@ - [[ a.balance and formatLang(get_abs(a.balance)) or 0.0 ]] + [[ a.balance and formatLang(abs(a.balance)) or 0.0 ]] @@ -287,7 +287,7 @@ [[ final_result()['type'] == 'Net Profit C.F.B.L.' and final_result()['type'] or removeParentNode('blockTable') ]] - [[ final_result()['balance'] and final_result()['type'] == 'Net Profit C.F.B.L.' and formatLang(get_abs(final_result()['balance'])) or 0.0 ]] + [[ final_result()['balance'] and final_result()['type'] == 'Net Profit C.F.B.L.' and formatLang(abs(final_result()['balance'])) or 0.0 ]] @@ -297,7 +297,7 @@ Total:([[ get_currency(data) ]]) - [[ sum_dr() and formatLang(get_abs(sum_dr())) or 0.0 ]] + [[ sum_dr() and formatLang(abs(sum_dr())) or 0.0 ]] @@ -329,7 +329,7 @@ - [[ a.balance and formatLang(get_abs(a.balance)) or 0.0 ]] + [[ a.balance and formatLang(abs(a.balance)) or 0.0 ]] @@ -342,7 +342,7 @@ [[ final_result()['type'] == 'Net Loss C.F.B.L.' and final_result()['type'] or removeParentNode('blockTable') ]] - [[ final_result()['balance'] and final_result()['type'] == 'Net Loss C.F.B.L.' and formatLang(get_abs(final_result()['balance'])) or 0.0 ]] + [[ final_result()['balance'] and final_result()['type'] == 'Net Loss C.F.B.L.' and formatLang(abs(final_result()['balance'])) or 0.0 ]] @@ -352,7 +352,7 @@ Total:([[ get_currency(data) ]]) - [[ sum_cr() and formatLang(get_abs(sum_cr())) or 0.0 ]] + [[ sum_cr() and formatLang(abs(sum_cr())) or 0.0 ]]