From db4309d289214ac86316305f77bed391e805ee7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Sat, 24 Jan 2026 15:57:22 +0800 Subject: [PATCH 1/2] =?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_salary/models/yuthon_salary_active.py | 48 +++++++--- .../views/yuthon_salary_active_views.xml | 87 ++++++++++++++++--- yuthon_work_brand/views/hr_menus.xml | 2 +- 3 files changed, 115 insertions(+), 22 deletions(-) diff --git a/yuthon_salary/models/yuthon_salary_active.py b/yuthon_salary/models/yuthon_salary_active.py index 5ff7a113e..29a91e68b 100644 --- a/yuthon_salary/models/yuthon_salary_active.py +++ b/yuthon_salary/models/yuthon_salary_active.py @@ -19,6 +19,10 @@ class YuthonSalaryActive(models.Model): employee_id = fields.Many2one('hr.employee', string='员工', required=True) company_id = fields.Many2one('res.company', string='公司', related='employee_id.company_id', store=True) + department_id = fields.Many2one('hr.department', related='employee_id.department_id', string="部门", store=True) + company_old = fields.Many2one(related='employee_id.company_old', string="司龄", store=True) + onboarding_time = fields.Date(related='employee_id.entry_date', string="入职日期") + confirm_status = fields.Selection([('todo', '待发送'), ('un_confirm', '待确认'), ('confirm', '已确认')], string='状态',default='todo') select_time = fields.Selection([('1', '一月'), ('2', '二月'), ('3', '三月'), ('4', '四月'), ('5', '五月'), ('6', '六月'), ('7', '七月'), ('8', '八月'), ('9', '九月'), ('10', '十月'), ('11', '十一月'), @@ -28,7 +32,6 @@ class YuthonSalaryActive(models.Model): basic_salary = fields.Float(string='基本工资') rank_salary = fields.Float(string='职级工资') pre_performance_bonus = fields.Float(string='预发绩效奖金') - meal_allowance = fields.Float(string='误餐费') post_salary = fields.Float(string='岗位工资') communication_subsidy = fields.Float(string='通讯补贴') seniority_wage = fields.Float(string='工龄工资') @@ -36,31 +39,45 @@ class YuthonSalaryActive(models.Model): full_attendance_bonus = fields.Float(string='全勤奖') basic_year_end_bonus = fields.Float(string='基础年终奖') - liquidation_salary_leader = fields.Float(string='2024年清算工资(领导)') - balance_salary = fields.Float(string='2025年结余工资') - liquidation_salary_staff = fields.Float(string='2024年清算工资(职工)') # - business_special_bonus = fields.Float(string='2025经营特别奖') + # 清算/结余/奖励类字段 + salary_liquidation_2024_leader = fields.Float(string='2024年清算工资(领导)') + salary_balance_2025 = fields.Float(string='2025年结余工资') + salary_liquidation_2024_staff = fields.Float(string='2024年清算工资(职工)') + business_special_bonus_2025 = fields.Float(string='2025经营特别奖') + # 扣发类字段 deduct_performance_bonus = fields.Float(string='扣发绩效奖金') deduct_communication_subsidy = fields.Float(string='扣发通讯补贴') attendance_deduction = fields.Float(string='考勤扣发') - # 合计/社保/税费类字段(float 类型) + # 合计/社保/税费基础类字段 total_pre_tax_salary = fields.Float(string='税前工资合计') basic_endowment_insurance = fields.Float(string='基本养老保险费') basic_medical_insurance = fields.Float(string='基本医疗保险费') unemployment_insurance = fields.Float(string='失业保险费') housing_fund = fields.Float(string='住房公积金') enterprise_annuity = fields.Float(string='企业(职业)年金') - tax_adjustment = fields.Float(string='应补(退)税额') - trade_union_dues = fields.Float(string='工会会费') + personal_payment_total_including_annuity = fields.Float(string='个人缴纳合计(含年金)') - # 实发/福利类字段(float 类型) + # 专项附加扣除类字段 + cumulative_children_education = fields.Float(string='累计子女教育') + cumulative_support_elderly = fields.Float(string='累计赡养老人') + cumulative_housing_loan_interest = fields.Float(string='累计住房贷款利息') + cumulative_housing_rent = fields.Float(string='累计住房租金') + cumulative_continue_education = fields.Float(string='累计继续教育') + cumulative_infant_care_under_3 = fields.Float(string='累计3岁以下婴幼儿照护') + + # 个税计算类字段 + cumulative_taxable_income = fields.Float(string='累计应纳税所得额') + tax_rate_withholding_rate = fields.Float(string='税率/预扣率') + tax_adjustment = fields.Float(string='应补(退)税额') + + trade_union_dues = fields.Float(string='工会会费') actual_paid_salary = fields.Float(string='实发工资') + meal_allowance = fields.Float(string='误餐费') reimbursed_medical_exam_fee = fields.Float(string='已报销体检费') remaining_medical_exam_fee = fields.Float(string='剩余体检费') - def payslip_wizard(self): return { "type": "ir.actions.act_window", @@ -73,6 +90,17 @@ class YuthonSalaryActive(models.Model): } } + + def open_archive_record(self): + return { + 'name': '工资条', + 'type': 'ir.actions.act_window', + 'res_model': 'yuthon.salary.active', + 'view_mode': 'tree', + 'domain': [('employee_id', '=', self.employee_id.id)], + } + + def _get_default_month(self): current_month = datetime.now().month return str(current_month) \ No newline at end of file diff --git a/yuthon_salary/views/yuthon_salary_active_views.xml b/yuthon_salary/views/yuthon_salary_active_views.xml index c4d731c6f..f8a6a7e00 100644 --- a/yuthon_salary/views/yuthon_salary_active_views.xml +++ b/yuthon_salary/views/yuthon_salary_active_views.xml @@ -8,13 +8,79 @@