diff --git a/addons/.pydevproject b/addons/.pydevproject new file mode 100644 index 00000000000..78259a9c3db --- /dev/null +++ b/addons/.pydevproject @@ -0,0 +1,6 @@ + + + + +python 2.4 + diff --git a/addons/account/report/__init__.py b/addons/account/report/__init__.py index f14ab460225..a3206fbcdf8 100644 --- a/addons/account/report/__init__.py +++ b/addons/account/report/__init__.py @@ -40,6 +40,7 @@ import overdue import aged_trial_balance import tax_report import general_ledger_landscape +import account_tax_code # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/report/account_tax_code.py b/addons/account/report/account_tax_code.py new file mode 100644 index 00000000000..b236c087949 --- /dev/null +++ b/addons/account/report/account_tax_code.py @@ -0,0 +1,19 @@ +import time +import pooler +import rml_parse +import copy +from report import report_sxw +import re + +class account_tax_code_report(rml_parse.rml_parse): + _name = 'report.account.tax.code.entries' + def __init__(self, cr, uid, name, context): + super(account_tax_code_report, self).__init__(cr, uid, name, context) + self.localcontext.update({ + 'time': time, + }) + + +report_sxw.report_sxw('report.account.tax.code.entries', 'account.tax.code', + 'addons/account/report/account_tax_code.rml', parser=account_tax_code_report, header=False) + diff --git a/addons/account/report/account_tax_code.rml b/addons/account/report/account_tax_code.rml index ade928c8a9d..f6295bc7368 100644 --- a/addons/account/report/account_tax_code.rml +++ b/addons/account/report/account_tax_code.rml @@ -2,7 +2,31 @@ @@ -10,42 +34,29 @@ - - - - - - - - - - - - - + - + - + + + + + + + + + + + + - - - - - - - - - - - - @@ -53,115 +64,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + - [[ repeatIn(objects, 'o') ]] - +
+ [[ repeatIn(objects, 'o') ]] + + - + - Date + Date - Voucher Nb + Voucher Nb - Account Number + Account Number - Third party (Country) + Third party (Country) - Entry label + Entry label - Debit + Debit - Credit + Credit - - + - - - [[ repeatIn(o.line_ids, 'line') ]] - [[ line.date ]] - - - - [[ line.ref ]] - - - [[ line.account_id.code ]] - - - [[ line.partner_id and line.partner_id.name ]] ([[ line.partner_id and line.partner_id.address and line.partner_id.address[0].country_id.code or '' ]] ) - - - [[ line.name ]] - - - [[ '%.2f' % line.debit ]] - - - [[ '%.2f' % line.credit ]] - + + [[ repeatIn(o.line_ids, 'line') ]] + + + + [[ line.date ]] + + + [[ line.ref ]] + + + [[ line.account_id.code ]] + + + [[ line.partner_id and line.partner_id.name ]]([[ line.partner_id and line.partner_id.address and line.partner_id.address[0].country_id.code or removeParentNode('font') ]] ) + + + [[ line.name ]] + + + [[ formatLang(line.debit) or '%.2f' % line.debit ]] + + + [[ formatLang(line.credit) or '%.2f' % line.credit ]] + + + + - - - - TOTAL: - - - - - - - - - - - - - - +
+
- diff --git a/addons/account/report/tax_report.py b/addons/account/report/tax_report.py index 445ca968878..6e8cc64f29c 100755 --- a/addons/account/report/tax_report.py +++ b/addons/account/report/tax_report.py @@ -87,7 +87,7 @@ class tax_report(rml_parse.rml_parse): while ind_general < len(res_general) : res_general[ind_general]['type'] = 2 res_general[ind_general]['pos'] = 0 - res_general[ind_general]['level'] = res_dict['level'] + ' ' + res_general[ind_general]['level'] = res_dict['level'] top_result.append(res_general[ind_general]) ind_general+=1 i+=1 @@ -143,6 +143,7 @@ class tax_report(rml_parse.rml_parse): GROUP BY account.id,account.name,account.code', ('draft',tax_code_id, company_id)) res = self.cr.dictfetchall() + #AND line.period_id IN ('+ period_sql_list +') \ i = 0 @@ -158,7 +159,7 @@ class tax_report(rml_parse.rml_parse): res = [] for code in tc.browse(self.cr, self.uid, ids, {'based_on': based_on}): res.append(('a'*2*level,code)) - print"=====res=====",res + res += self._get_codes(based_on, code.id, level+1) return res diff --git a/addons/account/report/tax_report.rml b/addons/account/report/tax_report.rml index 50dd5a89dda..903a4b7f661 100755 --- a/addons/account/report/tax_report.rml +++ b/addons/account/report/tax_report.rml @@ -215,19 +215,19 @@ [[ repeatIn(get_lines(data['form']['based_on'],data['form']['periods'],data['form']['company_id']), 'o') ]] [[ o['level'] ]] - [[o['type']==1 and ( setTag('para','para',{'fontName':'Helvetica'}))]] + [[o['type']==1 and ( setTag('para','para',{'fontName':'Helvetica'}))]] [[ setTag('tr','tr',{'style':'TrLevel'+str(o['level']), 'paraStyle':('Level'+str(o['level']))}) ]] [[ o['code'] ]] [[ o['name'] ]] - [[o['type']==2 and (o['debit']) ]] + [[o['type']==2 and (o['debit']) or '0.0' ]] - [[o['type']==2 and (o['credit']) ]] + [[o['type']==2 and (o['credit']) or '0.0' ]] - [[ o['tax_amount'] ]] + [[ o['tax_amount'] or '0.0' ]] diff --git a/addons/account_report/report/print_indicator.py b/addons/account_report/report/print_indicator.py index e26f179cd6e..51a0a905e10 100644 --- a/addons/account_report/report/print_indicator.py +++ b/addons/account_report/report/print_indicator.py @@ -36,7 +36,8 @@ from report.interface import report_int from reportlab.graphics.shapes import Drawing from reportlab.graphics.charts.barcharts import VerticalBarChart import reportlab.lib.colors -from reportlab.graphics import renderPM +#from reportlab.graphics import renderPM +import tools class accounting_report1(report_sxw.rml_parse): @@ -53,7 +54,7 @@ class accounting_report1(report_sxw.rml_parse): drawing = Drawing(400, 200) data = [ (13, 5, 20, 22, 37, 45, 19, 4), - (11, 3, 10, 22, 30, 25, 29, 6), + (15, 13, 4, 22, 30, 25, 29, 6), ] bc = VerticalBarChart() bc.x = 50 @@ -72,7 +73,8 @@ class accounting_report1(report_sxw.rml_parse): bc.categoryAxis.categoryNames = ['Jan-99','Feb-99','Mar-99', 'Apr-99','May-99','Jun-99','Jul-99','Aug-99'] drawing.add(bc) - renderPM.drawToFile(drawing, 'example1.jpg','jpg') + drawing.save(formats=['png'],fnRoot=tools.config['root_path']+"/Image",title="helo") +# renderPM.drawToFile(drawing, 'example1.jpg','jpg') return True diff --git a/addons/account_report/report/print_indicator.rml b/addons/account_report/report/print_indicator.rml index 41b025cc115..f3682148ce8 100644 --- a/addons/account_report/report/print_indicator.rml +++ b/addons/account_report/report/print_indicator.rml @@ -128,7 +128,7 @@ - +