minor fix recompute lines
This commit is contained in:
parent
173de783e3
commit
14f8d89338
|
@ -21,3 +21,11 @@ class Configuration(metaclass=PoolMeta):
|
|||
], required=True)
|
||||
payment_partial_sunday = fields.Boolean('Payment Partial Sunday')
|
||||
template_email_confirm = fields.Many2One('email.template', 'Template Email of Confirmation')
|
||||
period_payroll = fields.Selection([
|
||||
('1', 'Weekly'),
|
||||
('2', 'Decennial'),
|
||||
('3', 'Catorcenal'),
|
||||
('4', 'Quincenal'),
|
||||
('5', 'Monthly'),
|
||||
('6', 'Other')
|
||||
], 'Period Payroll')
|
||||
|
|
10
payroll.py
10
payroll.py
|
@ -568,6 +568,16 @@ class Payroll(metaclass=PoolMeta):
|
|||
line_tax = None
|
||||
deductions = _ZERO
|
||||
for line in self.lines:
|
||||
if line.wage_type.provision_cancellation:
|
||||
amount_line = [m.amount for m in self.lines if m.wage_type == line.wage_type.provision_cancellation]
|
||||
values = []
|
||||
for m in line.move_lines:
|
||||
values.append(abs(m.debit - m.credit))
|
||||
amount = sum(values) + sum(amount_line)
|
||||
line.write([line], {
|
||||
'unit_value': amount,
|
||||
'amount': amount,
|
||||
})
|
||||
if line.wage_type.definition == 'deduction':
|
||||
deductions += line.amount
|
||||
if line.wage_type.type_concept == 'tax':
|
||||
|
|
|
@ -19,5 +19,8 @@ this repository contains the full copyright notices and license terms. -->
|
|||
expr="/form/field[@name='minimum_salary']" position="after">
|
||||
<label name="template_email_confirm"/>
|
||||
<field name="template_email_confirm"/>
|
||||
<label name="period_payroll"/>
|
||||
<field name="period_payroll"/>
|
||||
|
||||
</xpath>
|
||||
</data>
|
||||
|
|
Loading…
Reference in New Issue