[IMP] account: rename the function, imporve the report and add the header in thrid_party_ledger
bzr revid: sbh@tinyerp.com-20100720094853-6u7ad7o9ulvrqbpu
This commit is contained in:
parent
73bffa7020
commit
ba7d2d38be
|
@ -53,7 +53,7 @@ class journal_print(report_sxw.rml_parse, common_report_header):
|
|||
'get_journal': self._get_journal,
|
||||
'get_start_date':self._get_start_date,
|
||||
'get_end_date':self._get_end_date,
|
||||
'print_data':self._print_data,
|
||||
'get_currency ':self.get_currency
|
||||
})
|
||||
|
||||
def set_context(self, objects, data, ids, report_type=None): # Improve move to common default?
|
||||
|
@ -126,7 +126,7 @@ class journal_print(report_sxw.rml_parse, common_report_header):
|
|||
return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).fiscalyear_id.name
|
||||
return super(journal_print ,self)._get_fiscalyear(data)
|
||||
|
||||
def _print_data(self, data):
|
||||
def _get_currency(self, data):
|
||||
if data['model']=='account.journal.period':
|
||||
return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).journal_id.currency or False
|
||||
return data['form']['amount_currency']
|
||||
|
|
|
@ -287,7 +287,7 @@
|
|||
<para style="P9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="62.0,118.0,89.0,83.0,77.0,100.0" style="Table_Journal_Title" repeatRows="1"><para>[[ print_data(data)==False or removeParentNode('blockTable') ]]</para>
|
||||
<blockTable colWidths="62.0,118.0,89.0,83.0,77.0,100.0" style="Table_Journal_Title" repeatRows="1"><para>[[ get_currency(data)==False or removeParentNode('blockTable') ]]</para>
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_Details">Code</para></td>
|
||||
<td><para style="terp_tblheader_Details">Journal Name</para></td>
|
||||
|
@ -305,7 +305,7 @@
|
|||
<td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_debit()- sum_credit()) ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="60.0,100.0,70.0,73.0,77.0,60.0,80.0" style="Table_Journal_Title" repeatRows="1">[[ print_data(data) or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="60.0,100.0,70.0,73.0,77.0,60.0,80.0" style="Table_Journal_Title" repeatRows="1">[[ get_currency(data) or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_Details">Code</para></td>
|
||||
<td><para style="terp_tblheader_Details">Journal Name</para></td>
|
||||
|
@ -327,7 +327,7 @@
|
|||
</blockTable>
|
||||
|
||||
<section>
|
||||
<blockTable colWidths="61.0,119.0,91.0,83.0,76.0,100.0" style="Table_Journal_Detail">[[ print_data(data) == False or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="61.0,119.0,91.0,83.0,76.0,100.0" style="Table_Journal_Detail">[[ get_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9"><font face="Times-Roman">[[ repeatIn(lines(o.id),'line')]]</font> [[ line['code'] ]]</para>
|
||||
|
@ -349,7 +349,7 @@
|
|||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="70.0,100.0,70.0,73.0,77.0,60.0,80.0" style="Table_Journal_Detail">[[print_data(data) or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="70.0,100.0,70.0,73.0,77.0,60.0,80.0" style="Table_Journal_Detail">[[ get_currency(data) or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_default_9"><font>[[ repeatIn(lines(o.id),'line')]]</font> [[ line['code'] ]]</para></td>
|
||||
<td><para style="terp_default_9">[[ line['name'] ]]</para></td>
|
||||
|
|
|
@ -41,8 +41,7 @@
|
|||
<blockTableStyle id="Table3">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,1" stop="-1,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table4">
|
||||
<blockAlignment value="LEFT"/>
|
||||
|
|
|
@ -43,6 +43,18 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
|
|||
'sum_credit': self._sum_credit,
|
||||
'get_currency': self._get_currency,
|
||||
'comma_me' : self.comma_me,
|
||||
'get_start_period': self.get_start_period,
|
||||
'get_end_period': self.get_end_period,
|
||||
'get_account': self._get_account,
|
||||
'get_filter': self._get_filter,
|
||||
'get_start_date': self._get_start_date,
|
||||
'get_end_date': self._get_end_date,
|
||||
'sum_currency_amount_account': self._sum_currency_amount_account,
|
||||
'get_fiscalyear': self._get_fiscalyear,
|
||||
'get_start_date':self._get_start_date,
|
||||
'get_end_date':self._get_end_date,
|
||||
'get_journal': self._get_journal,
|
||||
|
||||
})
|
||||
|
||||
def date_range(self, start, end):
|
||||
|
@ -398,6 +410,18 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
|
|||
def _get_currency(self, form):
|
||||
return pooler.get_pool(self.cr.dbname).get('res.company').browse(self.cr, self.uid, form['company_id']).currency_id.name
|
||||
|
||||
def _sum_currency_amount_account(self, account, form):
|
||||
self._set_get_account_currency_code(account.id)
|
||||
self.cr.execute("SELECT sum(aml.amount_currency) FROM account_move_line as aml,res_currency as rc WHERE aml.currency_id = rc.id AND aml.account_id= %s ", (account.id,))
|
||||
total = self.cr.fetchone()
|
||||
|
||||
if self.account_currency:
|
||||
return_field = str(total[0]) + self.account_currency
|
||||
return return_field
|
||||
else:
|
||||
currency_total = self.tot_currency = 0.0
|
||||
return currency_total
|
||||
|
||||
report_sxw.report_sxw('report.account.third_party_ledger', 'res.partner',
|
||||
'addons/account/report/third_party_ledger.rml',parser=third_party_ledger,
|
||||
header=False)
|
||||
|
|
|
@ -37,6 +37,38 @@
|
|||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2_header">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="5,0" stop="5,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="6,0" stop="6,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="6,0" stop="6,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="6,0" stop="6,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,-1" stop="6,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="7,0" stop="7,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="7,0" stop="7,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="7,0" stop="7,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table3">
|
||||
<blockAlignment value="LEFT"/>
|
||||
|
@ -101,6 +133,50 @@
|
|||
</blockTable>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="80.0,80.0,80.0,120.0,100.0" style="Table2_header">
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_General_Centre">Company <font color="white"> [[ data['model']=='account.journal.period' or removeParentNode('para') ]]</font></para>
|
||||
<para style="terp_tblheader_General_Centre">Chart of Account <font color="white"> [[ data['model']=='ir.ui.menu' or removeParentNode('para') ]]</font></para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Journal</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Filters By </para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Printing Date</para></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><para style="terp_default_Centre_8">[[ get_account(data) or '' ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[', '.join([ lt or '' for lt in get_journal(data) ]) ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ get_filter(data)=='No Filter' and get_filter(data) or removeParentNode('para') ]] </para>
|
||||
<blockTable colWidths="60.0,60.0" style="Table3">[[ get_filter(data)=='Date' or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_Details_Centre">Start Date</para></td>
|
||||
<td><para style="terp_tblheader_Details_Centre">End Date</para></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><para style="terp_default_Centre_8">[[ get_start_date(data) ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ get_end_date(data) ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="60.0,60.0" style="Table3">[[ get_filter(data)=='Periods' or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_Details_Centre">Start Period</para></td>
|
||||
<td><para style="terp_tblheader_Details_Centre">End Period</para></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><para style="terp_default_Centre_8">[[ get_start_period(data) or removeParentNode('para') ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ get_end_period(data) or removeParentNode('para') ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
<td><para style="terp_default_Centre_8">[[ formatLang(time.strftime('%Y-%m-%d %H:%M:%S'), date_time = True) ]] </para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="58.0,26.0,40.0,156.0,68.0,67.0,66.0" style="Table_header_1">
|
||||
<tr>
|
||||
|
|
Loading…
Reference in New Issue