1
This commit is contained in:
@@ -2,6 +2,10 @@ from odoo import api, fields, models, _
|
||||
from odoo.exceptions import ValidationError, UserError
|
||||
import json
|
||||
from odoo.tools import date_utils
|
||||
import logging
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class InheritHrPayslip(models.Model):
|
||||
_inherit = 'hr.payslip'
|
||||
@@ -278,11 +282,15 @@ class InheritHrPayslip(models.Model):
|
||||
)
|
||||
|
||||
# 本期应收 - 三险一金 - 年金 - 应补退税 - 工会会费 - 个税退回
|
||||
# total_before_tax - three_one - b_year - union_dues - tax_payable - individual_tax_refund
|
||||
@api.depends('total_before_tax', 'three_one', 'b_year', 'union_dues', 'tax_payable', 'individual_tax_refund')
|
||||
def _compute_actual_salary(self):
|
||||
for record in self:
|
||||
record.actual_salary = (record.total_before_tax - record.three_one - record.b_year - record.union_dues - record.tax_payable - record.individual_tax_refund)
|
||||
|
||||
if record.employee_id.name == '罗梦烨':
|
||||
_logger.info("罗梦烨实发{} 本期应:{},31:{},年金:{}应补:{}工会{}个税{}".format(record.actual_salary, record.total_before_tax,
|
||||
record.three_one, record.b_year, record.union_dues,
|
||||
record.tax_payable, record.individual_tax_refund))
|
||||
|
||||
def put_button(self):
|
||||
for record in self:
|
||||
|
||||
@@ -104,6 +104,7 @@
|
||||
<button name="put_release" type="object" string="推送" class="btn-primary" invisible="is_salary_release"/>
|
||||
<button name="put_payslip" type="object" string="发送" class="btn-primary" invisible="not is_salary_release"/>
|
||||
<button name="return_salary_button" string="退回" type="object" class="oe_highlight" invisible="not is_salary_release"/>
|
||||
<button name="open_record" string="详情" type="object" class="oe_highlight"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user