From 65b4832087ffa2ad82a99c9a0ef58377ee4375a2 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Mon, 6 Sep 2010 19:49:37 +0530 Subject: [PATCH] * Accounting/Reporting/Legal Report/Accounting Reports/ Print Profit And Loss * Both Landscape and Non Landscape * default value for float is not 0.0. but it should be 0.00.(use formatLang) * not all total amount should be bold. it's depends on leval style.(like Account Balance) * Without Landscape * remove space between report title and internal header bzr revid: apa@tinyerp.com-20100906141937-bus41waaytalehty --- .../account/report/account_profit_horizontal.rml | 12 ++++++------ addons/account/report/account_profit_loss.py | 4 ++-- addons/account/report/account_profit_loss.rml | 15 ++++++--------- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/addons/account/report/account_profit_horizontal.rml b/addons/account/report/account_profit_horizontal.rml index 6b48ab14014..84e39da1a38 100644 --- a/addons/account/report/account_profit_horizontal.rml +++ b/addons/account/report/account_profit_horizontal.rml @@ -274,7 +274,7 @@ - [[ a['balance'] and formatLang(abs(a['balance'])) or 0.0 ]] [[ company.currency_id.symbol ]] + [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]][[ formatLang(abs(a['balance'])) ]] [[ company.currency_id.symbol ]] @@ -287,7 +287,7 @@ - [[ a['balance1'] and formatLang(abs(a['balance1'])) or 0.0 ]] [[ company.currency_id.symbol ]] + [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]][[ formatLang(abs(a['balance1'])) ]] [[ company.currency_id.symbol ]] @@ -300,7 +300,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(abs(final_result()['balance'])) or 0.0 ]] [[ company.currency_id.symbol ]] + [[ final_result()['balance'] and final_result()['type'] == 'Net Profit C.F.B.L.' and formatLang(abs(final_result()['balance'])) ]] [[ company.currency_id.symbol ]] @@ -309,7 +309,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(abs(final_result()['balance'])) or 0.0 ]] [[ company.currency_id.symbol ]] + [[ final_result()['balance'] and final_result()['type'] == 'Net Loss C.F.B.L.' and formatLang(abs(final_result()['balance'])) ]] [[ final_result()['balance'] and final_result()['type'] == 'Net Loss C.F.B.L.' and company.currency_id.symbol ]] @@ -320,13 +320,13 @@ Total:([[ get_currency(data['form']) ]] [[ company.currency_id.code]] ) - [[ sum_dr() and formatLang(abs(sum_dr())) or 0.0 ]] [[ company.currency_id.symbol ]] + [[ formatLang(abs(sum_dr())) ]] [[ company.currency_id.symbol ]] Total:([[ get_currency(data['form']) ]] [[ company.currency_id.code]]) - [[ sum_cr() and formatLang(abs(sum_cr())) or 0.0 ]] [[ company.currency_id.symbol ]] + [[ formatLang(abs(sum_cr())) ]] [[ company.currency_id.symbol ]] diff --git a/addons/account/report/account_profit_loss.py b/addons/account/report/account_profit_loss.py index a7c732cf379..28b5cb52aaf 100644 --- a/addons/account/report/account_profit_loss.py +++ b/addons/account/report/account_profit_loss.py @@ -63,12 +63,12 @@ class report_pl_account_horizontal(rml_parse.rml_parse, common_report_header): def sum_dr(self): if self.res_pl['type'] == 'Net Profit C.F.B.L.': self.result_sum_dr += self.res_pl['balance'] - return self.result_sum_dr or 0.0 + return self.result_sum_dr def sum_cr(self): if self.res_pl['type'] == 'Net Loss C.F.B.L.': self.result_sum_cr += self.res_pl['balance'] - return self.result_sum_cr or 0.0 + return self.result_sum_cr def get_data(self, data): cr, uid = self.cr, self.uid diff --git a/addons/account/report/account_profit_loss.rml b/addons/account/report/account_profit_loss.rml index 5a9b81a82f6..144cd33fff6 100644 --- a/addons/account/report/account_profit_loss.rml +++ b/addons/account/report/account_profit_loss.rml @@ -185,9 +185,6 @@ - - - @@ -267,7 +264,7 @@ - [[ a.balance and formatLang(abs(a.balance)) or 0.0 ]] [[ company.currency_id.symbol ]] + [[ a.level<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]][[ formatLang(abs(a.balance)) ]] [[ company.currency_id.symbol ]] @@ -280,7 +277,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(abs(final_result()['balance'])) or 0.0 ]] [[ company.currency_id.symbol ]] + [[ final_result()['balance'] and final_result()['type'] == 'Net Loss C.F.B.L.' and formatLang(abs(final_result()['balance'])) ]] [[ final_result()['balance'] and final_result()['type'] == 'Net Loss C.F.B.L.' and company.currency_id.symbol ]] @@ -290,7 +287,7 @@ Total:([[ get_currency(data) ]]) - [[ sum_dr() and formatLang(abs(sum_dr())) or 0.0 ]] [[ company.currency_id.symbol ]] + [[ formatLang(abs(sum_dr())) ]] [[ company.currency_id.symbol ]] @@ -322,7 +319,7 @@ - [[ a.balance and formatLang(abs(a.balance)) or 0.0 ]] [[ company.currency_id.symbol ]] + [[ a.level<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]][[ formatLang(abs(a.balance)) ]] [[ company.currency_id.symbol ]] @@ -335,7 +332,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(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'])) ]] [[ final_result()['balance'] and final_result()['type'] == 'Net Loss C.F.B.L.' and company.currency_id.symbol ]] @@ -345,7 +342,7 @@ Total:([[ get_currency(data) ]]) - [[ sum_cr() and formatLang(abs(sum_cr())) or 0.0 ]] [[ company.currency_id.symbol ]] + [[ formatLang(abs(sum_cr())) ]] [[ company.currency_id.symbol ]]