From a7ebc82e615faf779eb2f5ab2ab12cdd224a2269 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Mon, 20 Oct 2008 16:44:38 +0530 Subject: [PATCH] Compelted partner balance and partner ledger report with wizard... bzr revid: patelamit2003@gmail.com-20081020111438-xyqsoxc3ef5luabz --- addons/account/report/partner_balance.py | 6 +- addons/account/report/partner_balance.rml | 236 ++++++++++++++++++-- addons/account/report/third_party_ledger.py | 70 +++++- addons/account/report/third_party_ledger.rml | 68 +++--- .../wizard/wizard_partner_balance_report.py | 2 +- addons/account/wizard/wizard_third_party_ledger.py | 66 +++--- 6 files changed, 356 insertions(+), 92 deletions(-) diff --git a/addons/account/report/partner_balance.py b/addons/account/report/partner_balance.py index ea0a986..5194565 100644 --- a/addons/account/report/partner_balance.py +++ b/addons/account/report/partner_balance.py @@ -161,13 +161,13 @@ class partner_balance(report_sxw.rml_parse): if data['form']['state'] == 'none': print"========none==========" self.transform_none_into_date_array(data) - if data['form']['state'] == 'bydate': + elif data['form']['state'] == 'bydate': print"========bydate==========" self.transform_date_into_date_array(data) - if data['form']['state'] == 'byperiod': + elif data['form']['state'] == 'byperiod': print"========byperiod==========" self.transform_period_into_date_array(data) - if data['form']['state'] == 'all': + elif data['form']['state'] == 'all': print"========both==========" self.transform_both_into_date_array(data) diff --git a/addons/account/report/partner_balance.rml b/addons/account/report/partner_balance.rml index 8eaf6ec..561eb07 100644 --- a/addons/account/report/partner_balance.rml +++ b/addons/account/report/partner_balance.rml @@ -3,6 +3,7 @@ @@ -55,15 +57,13 @@ - - - - - - - + + + @@ -84,14 +84,18 @@ - - + + + + + + @@ -108,13 +112,190 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - Code + [[ setTag('tr','tr',{'style':'Line1'}) ]] Code Partner name @@ -134,7 +315,7 @@ - Grand total + [[ setTag('tr','tr',{'style':'Line2'}) ]] Grand total @@ -171,22 +352,33 @@ [[ repeatIn(lines(data), 'a') ]][[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ a['ref'] ]] [[ a['type']==3 and a['code'] ]] - [[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ a['name'] ]] + [[ a['type']==3 and ( setTag('tr','tr',{'style':'TrLevel0'})) ]] [[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ a['type']==1 and ( setTag('blockTable','blockTable',{'style':'LineLevel1'})) ]] [[ a['name'] ]] - [[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ a['debit'] or '0.0' ]] + + [[ (a['type']==3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica-Bold'}) ]] [[ a['debit'] or '0.0' ]] + [[ (a['type']!=3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica'}) ]] [[ a['debit'] or '0.0' ]] + - [[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ a['credit'] or '0.0' ]] + + [[ (a['type']==3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica-Bold'}) ]] [[ a['credit'] or '0.0' ]] + [[ (a['type']!=3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica'}) ]] [[ a['credit'] or '0.0' ]] + - [[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ a['balance'] or '0.0' ]] + + [[ (a['type']==3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica-Bold'}) ]] [[ a['balance'] or '0.0' ]] + [[ (a['type']!=3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica'}) ]] [[ a['balance'] or '0.0' ]] + - [[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ a['enlitige'] or '0.0' ]] + + [[ (a['type']==3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica-Bold'}) ]] [[ a['enlitige'] or '0.0' ]] + [[ (a['type']!=3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica'}) ]] [[ a['enlitige'] or '0.0' ]] + - \ No newline at end of file diff --git a/addons/account/report/third_party_ledger.py b/addons/account/report/third_party_ledger.py index aa04279..afc5635 100755 --- a/addons/account/report/third_party_ledger.py +++ b/addons/account/report/third_party_ledger.py @@ -79,6 +79,54 @@ class third_party_ledger(rml_parse.rml_parse): self.date_lst = return_array self.date_lst.sort() + def transform_both_into_date_array(self,data): + + if not data['form']['periods'][0][2] : + periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',data['form']['fiscalyear'])]) + else: + periods_id = data['form']['periods'][0][2] + date_array = [] + for period_id in periods_id: + period_obj = self.pool.get('account.period').browse(self.cr, self.uid, period_id) + date_array = date_array + self.date_range(period_obj.date_start,period_obj.date_stop) + + period_start_date = date_array[0] + date_start_date = data['form']['date1'] + period_stop_date = date_array[-1] + date_stop_date = data['form']['date2'] + + if period_start_date @@ -53,43 +53,43 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + @@ -124,7 +124,7 @@ - + [[ data['form']['page_split'] == True or removeParentNode('para') ]] @@ -133,7 +133,7 @@ - + Date @@ -147,7 +147,7 @@ Debit - + Credit @@ -183,7 +183,7 @@ [[ data['form']['page_split'] == False or removeParentNode('para') ]] [[ repeatIn(objects, 'p') ]] - + [[ p.ref ]] - [[ p.name ]] @@ -202,7 +202,7 @@ - + [[ repeatIn(lines(p,data), 'line') ]][[ line['date'] ]] @@ -211,10 +211,10 @@ [[ line['code'] ]] - [[ line['ref'] ]] + [[ line['ref'] ]] / [[ line['name'] ]] - [[ line['name'] ]] + [[ (line['debit']) or '' ]] @@ -227,13 +227,13 @@ - + - - - - + + + + - + \ No newline at end of file diff --git a/addons/account/wizard/wizard_partner_balance_report.py b/addons/account/wizard/wizard_partner_balance_report.py index 1fb8012..d90a68a 100644 --- a/addons/account/wizard/wizard_partner_balance_report.py +++ b/addons/account/wizard/wizard_partner_balance_report.py @@ -73,7 +73,7 @@ period_fields = { 'required':True }, 'soldeinit':{'string':" Inclure les soldes initiaux",'type':'boolean'}, - 'date1': {'string':' Start date', 'type':'date', 'required':True,'default': lambda *a: time.strftime('%Y-01-01')}, + 'date1': {'string':' Start date', 'type':'date', 'required':True,'default': lambda *a: time.strftime('%Y-01-01')}, 'date2': {'string':'End date', 'type':'date', 'required':True,'default': lambda *a: time.strftime('%Y-%m-%d')}, } diff --git a/addons/account/wizard/wizard_third_party_ledger.py b/addons/account/wizard/wizard_third_party_ledger.py index d62aaef..f4b9c5a 100755 --- a/addons/account/wizard/wizard_third_party_ledger.py +++ b/addons/account/wizard/wizard_third_party_ledger.py @@ -33,41 +33,51 @@ import pooler period_form = '''
- - - - - - - - - - - - - - - - - - - + - - - + + +