From 4c064822e80c703683689c7321b83ace1cf517be Mon Sep 17 00:00:00 2001
From: zhou <123@>
Date: Thu, 3 Apr 2025 19:00:10 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
yuthon_hr_employee/models/inherit_hr_job.py | 9 +++
yuthon_hr_employee/security/company_rule.xml | 5 ++
.../views/inherit_hr_job_views.xml | 8 ++-
yuthon_salary/models/inherit_hr_payslip.py | 22 +++++++
.../static/others/hr_payslip_template.xlsx | Bin 9631 -> 9656 bytes
.../inherit_hr_payroll_structure_views.xml | 2 +-
.../views/inherit_hr_payslip_views.xml | 60 ++++++++++--------
yuthon_salary/wizard/salary_payslip_wizard.py | 1 +
8 files changed, 77 insertions(+), 30 deletions(-)
diff --git a/yuthon_hr_employee/models/inherit_hr_job.py b/yuthon_hr_employee/models/inherit_hr_job.py
index c24ca3e05..13eacf5e4 100644
--- a/yuthon_hr_employee/models/inherit_hr_job.py
+++ b/yuthon_hr_employee/models/inherit_hr_job.py
@@ -104,6 +104,15 @@ class HrJob(models.Model):
if department_id:
job.sudo().write({'department_id': department_id.id if len(department_id) == 1 else department_id[0].id})
+ def f6_new(self):
+ job_ids = self.env["hr.job"].browse(self._context.get('active_ids', self._context.get('active_id')))
+ for job in job_ids:
+ if job.department_id:
+ company_id = job.department_id.company_id
+ if company_id:
+ job.sudo().write(
+ {'company_id': company_id})
+
def write(self, vals):
res = super(HrJob, self).write(vals)
if 'job_personnel_ids' in vals:
diff --git a/yuthon_hr_employee/security/company_rule.xml b/yuthon_hr_employee/security/company_rule.xml
index be7d1db73..07e46bd14 100644
--- a/yuthon_hr_employee/security/company_rule.xml
+++ b/yuthon_hr_employee/security/company_rule.xml
@@ -5,6 +5,11 @@
[('company_id', 'in', company_ids)]
+
+ 岗位多公司
+
+ [('company_id', 'in', company_ids)]
+
工资单分组多公司
diff --git a/yuthon_hr_employee/views/inherit_hr_job_views.xml b/yuthon_hr_employee/views/inherit_hr_job_views.xml
index a3a5949f5..e10f52f85 100644
--- a/yuthon_hr_employee/views/inherit_hr_job_views.xml
+++ b/yuthon_hr_employee/views/inherit_hr_job_views.xml
@@ -7,7 +7,13 @@
code
action = model.f5_new()
-
+
+ 同步公司
+
+
+ code
+ action = model.f6_new()
+
hr.job.inherit
hr.job
diff --git a/yuthon_salary/models/inherit_hr_payslip.py b/yuthon_salary/models/inherit_hr_payslip.py
index f3c80eb6a..c871f9be9 100644
--- a/yuthon_salary/models/inherit_hr_payslip.py
+++ b/yuthon_salary/models/inherit_hr_payslip.py
@@ -9,6 +9,8 @@ class InheritHrPayslip(models.Model):
employee_id = fields.Many2one('hr.employee', string="姓名")
base_salary = fields.Float(string='基本工资', compute='_compute_salary', store=True)
bank_account = fields.Char(string='银行账号', related='employee_id.bank_account', store=True)
+ tax_payable = fields.Float(string='应补(退)税额', store=True)
+ actual_salary = fields.Float(string='实发工资', store=True, compute='_compute_actual_salary')
identification_id = fields.Char(string='证件号码', related='employee_id.identification_id', store=True)
card_type = fields.Char(string='证件类型', store=True, default="居民身份证")
salary_group_id = fields.Many2one('yuthon.salary.group', string="工资组", store=True, index=True)
@@ -75,6 +77,7 @@ class InheritHrPayslip(models.Model):
performance_deduction = fields.Float(string='扣发绩效奖金', compute='_compute_deduction', store=True)
commuting_deduction = fields.Float(string='扣发通信补贴', compute='_compute_deduction', store=True)
base_salary_deduction = fields.Float(string='扣发基本工资', compute='_compute_deduction', store=True)
+ specialized_deduction = fields.Float(string='累计专项扣除')
def action_refresh_from_work_entries(self):
if any(p.state not in ['draft', 'verify'] for p in self):
@@ -219,6 +222,25 @@ class InheritHrPayslip(models.Model):
record.base_salary_deduction
)
+ @api.depends('total_before_tax', 'basic_endowment_insurance', 'basic_medical_insurance',
+ 'unemployment_insurance', 'housing_provident_fund', 'b_year', 'tax_payable',
+ 'union_dues', 'meal_misunderstanding_fee', 'temporary_performance_bonus',
+ 'reimburse_performance_bonus', 'life_salary')
+ def _compute_actual_salary(self):
+ for record in self:
+ record.actual_salary = (record.total_before_tax -
+ record.basic_endowment_insurance -
+ record.basic_medical_insurance -
+ record.unemployment_insurance -
+ record.housing_provident_fund -
+ record.b_year -
+ record.tax_payable -
+ record.union_dues -
+ record.meal_misunderstanding_fee -
+ record.temporary_performance_bonus -
+ record.reimburse_performance_bonus -
+ record.life_salary)
+
def put_button(self):
for record in self:
record.write({'is_push': True})
diff --git a/yuthon_salary/static/others/hr_payslip_template.xlsx b/yuthon_salary/static/others/hr_payslip_template.xlsx
index fdf12f7686cfb35aeb38d9c600bc79bd8adc26ef..8fae842e752b4497d9c2e301a4d8e4d73558248e 100644
GIT binary patch
delta 1514
zcmVpo-uNjFqKMQ8Xeb0L@Dw
z^)5v(`6|3Yfpts^R+Ji2bOehQ+4WVzE6Pg)8&g(boCF(qlD3prDcU<%QH(9$gJO2%
z9omcA(tjxC{L$=i#rOx?0Ui@F!wMV|%rV>m!>T8u6H@RVS$&$K1qhCz00r7v9E~FU
z<8@$^{d1sI22Lg2vGScxaffWdJF#~ktn7_-U61Oxjp6f0_-+08+*S>xZg#~1Wr^UF
z8(^+9+0wV&L$G;zNbumgSz*DfTl;NqC5YQ&woVjEYH6Km<`Vqd;IVCsjtwI4xoFqo
zth~l|_xTECV=|tGBnrtqClg9$l#uu4{fqe~XLq4aDgGr+LK5d>PU9(!X9MCHkhQrl
z|3>x=v;G3M0SQy)dx(t!005_xy#ybBl~vnr;~)@yUuplr;=S08-P{zX>L#0QA6BaN
z`b;p6QEcM{61RWf0bh!hRn+oeU=HWZ3=DX6_gog!za+dut-?~iM?+*8r)(?esbrOIMIoZXN+OS^`UZq+NNyu3v1r
zeLzgV=`>A)n_6L7bx}AQ6wZ8qrZ*?0MY$!Kp!Le0z?1aXtCYhonxpq5%Mx@SE+0b#
zcDv#aXN_{ko+kUBtYB2L6iNkorUdpv9L>TP0;|jQ@1
zz#lxgV?Y
z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Ld7$GPy
zf?v+JTO|GRp_9Fx=dE#>4D职级
hr.payroll.structure
tree,form,search
- {'group_by_no_leaf':1,'group_by':[]}
+
批量更新职级类型
diff --git a/yuthon_salary/views/inherit_hr_payslip_views.xml b/yuthon_salary/views/inherit_hr_payslip_views.xml
index 3ab3fe670..fdc77993a 100644
--- a/yuthon_salary/views/inherit_hr_payslip_views.xml
+++ b/yuthon_salary/views/inherit_hr_payslip_views.xml
@@ -24,36 +24,46 @@
1
+
+ hide
+
-
+
+
+
-
-
-
-
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -162,7 +172,7 @@
-
+
@@ -202,6 +212,7 @@
+
@@ -262,22 +273,15 @@
-
- inherit.view.hr.payslip.tree
- hr.payslip
-
-
-
-
-
-
-
薪资审定
hr.payslip
tree,form,search
[('is_salary_push', '=', True)]
{'search_default_group_by_employee': 1}
+
薪资计算
diff --git a/yuthon_salary/wizard/salary_payslip_wizard.py b/yuthon_salary/wizard/salary_payslip_wizard.py
index d18bf2728..432b7ef00 100644
--- a/yuthon_salary/wizard/salary_payslip_wizard.py
+++ b/yuthon_salary/wizard/salary_payslip_wizard.py
@@ -10,6 +10,7 @@ from datetime import datetime
class SalaryPayslipWizard(models.Model):
_name = 'salary.payslip.wizard'
+ _description = '个税计算导入'
excel_file = fields.Binary(string="上传Excel表")
excel_name = fields.Char(string="文件名")