[IMP] reports: use of FormatLang(amount, currency_obj=...) instead of printing currency.symbol directly in the report

bzr revid: qdp-launchpad@openerp.com-20121011094002-7unxi6bi2hh2u6k5
This commit is contained in:
Quentin (OpenERP) 2012-10-11 11:40:02 +02:00
parent ce440f16d3
commit bc44da05a1
8 changed files with 20 additions and 20 deletions

View File

@ -236,7 +236,7 @@
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['credit'] or 0) or (y['account_id']['type'] == 'payable' and y['debit'] * -1 or 0)), getLines(o), 0))) ]] </para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), filter(lambda x: x['date_maturity'] &lt; time.strftime('%Y-%m-%d'), getLines(o)), 0))) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), filter(lambda x: x['date_maturity'] &lt; time.strftime('%Y-%m-%d'), getLines(o)), 0)), currency_obj=company.currency_id) ]]</para>
</td>
<td>
<para style="terp_default_9">

View File

@ -256,7 +256,7 @@
<para style="terp_default_Centre_9">[[line.date=='False' and '-' or formatLang(line.date,date=True) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[formatLang(line.amount, currency_obj= user.company_id and user.company_id.currency_id) or '-' ]] </para>
<para style="terp_default_Right_9">[[formatLang(line.amount, currency_obj= user.company_id.currency_id) or '-' ]] </para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(line.amount_currency, currency_obj= line.currency)]]</para>
@ -275,10 +275,10 @@
<para style="terp_default_Bold_9">Total:</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(get_amount_total(o), currency_obj= user.company_id and user.company_id.currency_id) or '' ]] </para>
<para style="terp_default_Right_9">[[ formatLang(get_amount_total(o), currency_obj= user.company_id.currency_id) or '' ]] </para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(get_amount_total_in_currency(o), currency_obj= user.company_id and user.company_id.currency_id) or '' ]] </para>
<para style="terp_default_Right_9">[[ formatLang(get_amount_total_in_currency(o), currency_obj= user.company_id.currency_id) or '' ]] </para>
</td>
</tr>
</blockTable>

View File

@ -219,7 +219,7 @@
<para style="terp_default_9_30cm">[[ p['pname'] ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ p['amount'] ]] [[ voucher.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ formatLang(p['amount'], currency_obj=voucher.currency_id) ]]</para>
</td>
</tr>
<tr>
@ -323,7 +323,7 @@
</para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ voucher.amount ]] [[ voucher.currency_id.symbol ]]</para>
<para style="terp_default_Right_9_Bold">[[ formatLang(voucher.amount, currency_obj=voucher.currency_id) ]]</para>
</td>
</tr>
</blockTable>

View File

@ -108,7 +108,7 @@
<para style="terp_default_9">[[ l['code'] (l['intra_code']) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ l['amount'] or O.OO ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ formatLang(l['amount'], currency_obj=company.currency_id) ]]</para>
</td>
</tr>
</blockTable>
@ -129,7 +129,7 @@
<para style="terp_tblheader_General_Right">Total:</para>
</td>
<td>
<para style="terp_tblheader_General_Right">[[ data['form']['amountsum'] or 0.00 ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_tblheader_General_Right">[[ formatLang(data['form']['amountsum'], currency_obj=company.currency_id) ]]</para>
</td>
</tr>
</blockTable>

View File

@ -73,7 +73,7 @@ class all_closed_cashbox_of_the_day(report_sxw.rml_parse):
if res:
return res[0]['bal']
else:
return False
return 0
def _get_sub_total(self, user, data, date):
res={}

View File

@ -207,7 +207,7 @@
<para style="terp_default_Bold_8">[[ statement['closing_date'] ]]</para>
</td>
<td>
<para style="P1"><u>[[ (get_bal(statement)) or '0.00' ]] [[company.currency_id.symbol]]</u></para>
<para style="P1"><u>[[ formatLang(get_bal(statement), currency_obj = company.currency_id)]]</u></para>
</td>
<td>
<para style="P1"><u>[[ formatLang(get_sub_total(user,statement['journal_id'],statement['date']), currency_obj = company.currency_id )]]</u></para>

View File

@ -204,7 +204,7 @@
<para style="P1">[[ p[0] ]]</para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ p[1] ]] [[company.currency_id.symbol]]</para>
<para style="terp_default_Right_9_Bold">[[ formatLang(p[1], currency_obj=company.currency_id) ]]</para>
</td>
</tr>
</blockTable>
@ -235,7 +235,7 @@
<para style="P2">[[ t[0] ]]</para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ '%.2f' % (t[1],) ]] [[company.currency_id.symbol]]</para>
<para style="terp_default_Right_9_Bold">[[ formatLang(t[1], currency_obj=company.currency_id) ]]</para>
</td>
</tr>
</blockTable>
@ -280,7 +280,7 @@
<para style="terp_default_Bold_9">Total invoiced</para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ '%.2f' % getsuminvoice(objects) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9_Bold">[[ formatLang(getsuminvoice(objects), currency_obj=company.currency_id) ]]</para>
</td>
</tr>
<tr>
@ -288,7 +288,7 @@
<para style="terp_default_Bold_9">Total discount</para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ '%.2f' % getsumdisc(objects) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9_Bold">[[ formatLang(getsumdisc(objects), currency_obj=company.currency_id) ]]</para>
</td>
</tr>
<tr>
@ -296,7 +296,7 @@
<para style="terp_default_Bold_9">Total paid</para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ '%.2f' % getpaidtotal(objects) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9_Bold">[[ formatLang(getpaidtotal(objects), currency_obj=company.currency_id) ]]</para>
</td>
</tr>
<tr>
@ -304,7 +304,7 @@
<para style="terp_default_Bold_9">Total of the day</para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ '%.2f' % gettotalofthaday(objects) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9_Bold">[[ formatLang(gettotalofthaday(objects), currency_obj=company.currency_id) ]]</para>
</td>
</tr>
</blockTable>

View File

@ -108,7 +108,7 @@
<para style="terp_default_Right_9">[[o.state=='cancel' and o.statement_ids and '-' or '']][['%.f' % line.qty ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[o.state=='cancel' and o.statement_ids and '-' or '']][[ '%.2f' % net(line.id) ]] [[company.currency_id.symbol]] <font face="Helvetica">[[ line and line.discount == 0.0 and removeParentNode('font') ]] ([[ '%.2f' % line.discount ]]%) [[company.currency_id.symbol]]</font></para>
<para style="terp_default_Right_9">[[o.state=='cancel' and o.statement_ids and '-' or '']][[ formatLang(net(line.id), currency_obj=company.currency_id) ]] <font face="Helvetica">[[ line and line.discount == 0.0 and removeParentNode('font') ]] ([[ formatLang(line.discount, currency_obj=company.currency_id) ]])</font></para>
</td>
</tr>
</blockTable>
@ -118,7 +118,7 @@
<para style="P6a">Taxes :</para>
</td>
<td>
<para style="terp_default_Right_9">[[o.state=='cancel' and o.statement_ids and '-' or '']][['%.2f' % o.amount_tax]] [[company.currency_id.symbol]]</para>
<para style="terp_default_Right_9">[[o.state=='cancel' and o.statement_ids and '-' or '']][[formatLang(o.amount_tax, currency_obj=company.currency_id)]]</para>
</td>
</tr>
</blockTable>
@ -128,7 +128,7 @@
<para style="P6">Total :</para>
</td>
<td>
<para style="terp_default_Bold_9_Right2">[[o.state=='cancel' and o.statement_ids and '-' or '']][['%.2f' % o.amount_total]] [[company.currency_id.symbol]]</para>
<para style="terp_default_Bold_9_Right2">[[o.state=='cancel' and o.statement_ids and '-' or '']][[formatLang(o.amount_total, currency_obj=company.currency_id)]]</para>
</td>
</tr>
</blockTable>
@ -157,7 +157,7 @@
</para>
</td>
<td>
<para style="P8">[[ '%.2f' %(d['amt'] or 0) ]] [[company.currency_id.symbol]]</para>
<para style="P8">[[ formatLang(d['amt'] or 0, currency_obj=company.currency_id) ]]</para>
</td>
</tr>
</blockTable>