[IMP] hr_payroll: 'payslip' report now uses decimal.precision
bzr revid: olt@tinyerp.com-20101005111929-ij6mgz6a3fkechm6
This commit is contained in:
parent
43c7907b37
commit
f233bd317a
|
@ -27,6 +27,7 @@ import netsvc
|
|||
from osv import fields, osv
|
||||
from tools import config
|
||||
from tools.translate import _
|
||||
import decimal_precision as dp
|
||||
|
||||
|
||||
|
||||
|
@ -774,9 +775,9 @@ class hr_payslip(osv.osv):
|
|||
('done','Paid Salary'),
|
||||
('cancel','Reject'),
|
||||
],'State', select=True, readonly=True),
|
||||
'basic_before_leaves': fields.float('Basic Salary', readonly=True, digits=(16, 2)),
|
||||
'leaves': fields.float('Leave Deductions', readonly=True, digits=(16, 2)),
|
||||
'basic': fields.float('Net Basic', readonly=True, digits=(16, 2)),
|
||||
'basic_before_leaves': fields.float('Basic Salary', readonly=True, digits_compute=dp.get_precision('Account')),
|
||||
'leaves': fields.float('Leave Deductions', readonly=True, digits_compute=dp.get_precision('Account')),
|
||||
'basic': fields.float('Net Basic', readonly=True, digits_compute=dp.get_precision('Account')),
|
||||
'grows': fields.function(_calculate, method=True, store=True, multi='dc', string='Gross Salary', type='float', digits=(16, 2)),
|
||||
'net': fields.function(_calculate, method=True, store=True, multi='dc', string='Net Salary', digits=(16, 2)),
|
||||
'allounce': fields.function(_calculate, method=True, store=True, multi='dc', string='Allowance', digits=(16, 2)),
|
||||
|
|
|
@ -392,19 +392,19 @@
|
|||
<para style="terp_default_Bold_9">Basic Salary</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ formatLang(o.basic_before_leaves) ]] [[ o.company_id.currency_id.symbol ]] </para>
|
||||
<para style="terp_default_9">[[ formatLang(o.basic_before_leaves, dp='Account') ]] [[ o.company_id.currency_id.symbol ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Leaved Deduction</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ o.leaves or '' ]]</para>
|
||||
<para style="terp_default_9">[[ formatLang(o.leaves, dp='Account') ]] [[ o.company_id.currency_id.symbol ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Basic Salary – Leaves</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ formatLang(o.basic) ]] [[ o.company_id.currency_id.symbol ]]</para>
|
||||
<para style="terp_default_9">[[ formatLang(o.basic, dp='Account') ]] [[ o.company_id.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
@ -433,7 +433,7 @@
|
|||
<para style="terp_default_9">[[ ld.code ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(ld.total) ]] [[ o.company_id.currency_id.symbol ]]</para>
|
||||
<para style="terp_default_Right_9">[[ formatLang(ld.total, dp='Account') ]] [[ o.company_id.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
@ -463,7 +463,7 @@
|
|||
<para style="terp_default_9">Basic Salary</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(o.basic) ]] [[ o.company_id.currency_id.symbol ]]</para>
|
||||
<para style="terp_default_Right_9">[[ formatLang(o.basic, dp='Account') ]] [[ o.company_id.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -471,7 +471,7 @@
|
|||
<para style="terp_default_9">[[repeatIn(get_earnings(o.line_ids),'a') ]] [[ a.code or removeParentNode('tr') ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(a.total) ]] [[ o.company_id.currency_id.symbol ]]</para>
|
||||
<para style="terp_default_Right_9">[[ formatLang(a.total, dp='Account') ]] [[ o.company_id.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
@ -488,7 +488,7 @@
|
|||
<para style="terp_default_9">[[ b.code ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(b.total) ]] [[ o.company_id.currency_id.symbol ]]</para>
|
||||
<para style="terp_default_Right_9">[[ formatLang(b.total, dp='Account') ]] [[ o.company_id.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
@ -508,13 +508,13 @@
|
|||
<para style="terp_tblheader_Details">Total Earnings<font face="Helvetica" size="7.0">([[ o.company_id.currency_id.code ]])</font></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">[[ formatLang(o.allounce + o.basic) ]] [[ o.company_id.currency_id.symbol ]] </para>
|
||||
<para style="terp_tblheader_Details_Right">[[ formatLang(o.allounce + o.basic, dp='Account') ]] [[ o.company_id.currency_id.symbol ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Total Deductions<font face="Helvetica" size="7.0">([[ o.company_id.currency_id.code ]])</font></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">[[ formatLang(o.deduction) ]] [[ o.company_id.currency_id.symbol ]]</para>
|
||||
<para style="terp_tblheader_Details_Right">[[ formatLang(o.deduction, dp='Account') ]] [[ o.company_id.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
@ -542,10 +542,10 @@
|
|||
<para style="terp_default_9">[[ ol.type in ['advance','loan','otherpay','otherdeduct','installment'] and ol.code or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ ol.type in ['advance','loan','otherpay'] and formatLang(ol.total) or '' ]] [[ ol.type in ['advance','loan','otherpay'] and o.company_id.currency_id.symbol or '' ]]</para>
|
||||
<para style="terp_default_Right_9">[[ ol.type in ['advance','loan','otherpay'] and formatLang(ol.total, dp='Account') or '' ]] [[ ol.type in ['advance','loan','otherpay'] and o.company_id.currency_id.symbol or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ ol.type in ['otherdeduct','installment'] and formatLang(ol.total) or '' ]] [[ ol.type in ['advance','loan','otherpay'] and o.company_id.currency_id.symbol or '' ]]</para>
|
||||
<para style="terp_default_Right_9">[[ ol.type in ['otherdeduct','installment'] and formatLang(ol.total, dp='Account') or '' ]] [[ ol.type in ['advance','loan','otherpay'] and o.company_id.currency_id.symbol or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
@ -561,7 +561,7 @@
|
|||
<para style="terp_tblheader_Details">Net Amount<font face="Helvetica" size="7.0">([[ o.company_id.currency_id.code ]])</font></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">[[ formatLang(o.net) ]] [[ o.company_id.currency_id.symbol ]]</para>
|
||||
<para style="terp_tblheader_Details_Right">[[ formatLang(o.net, dp='Account') ]] [[ o.company_id.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
@ -609,4 +609,4 @@
|
|||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
</document>
|
||||
</document>
|
||||
|
|
|
@ -99,18 +99,5 @@ class payslip_report(report_sxw.rml_parse):
|
|||
|
||||
report_sxw.report_sxw('report.payslip.pdf', 'hr.payslip', 'hr_payroll/report/payslip.rml', parser=payslip_report)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue