添加功能
This commit is contained in:
@@ -24,39 +24,48 @@ class SalaryPayslipWizard(models.Model):
|
||||
self.yuthon_payroll_data(row)
|
||||
|
||||
def yuthon_payroll_data(self, row):
|
||||
employee_id = self.env['hr.employee'].search([('name', '=', row[1].value)])
|
||||
year = (row[4].value).split('-')[0]
|
||||
month = (row[4].value).split('-')[1]
|
||||
payslip_run_name = f'{year}年-{int(month)}月'
|
||||
payslip_run_id = self.env['hr.payslip.run'].search([('name', '=', payslip_run_name)])
|
||||
if not payslip_run_id:
|
||||
payslip_run_id = self.env['hr.payslip.run'].create({
|
||||
'name': payslip_run_name,
|
||||
'date_start': row[4].value,
|
||||
'date_end': row[5].value,
|
||||
'state': 'draft',
|
||||
'payslip_count': 0
|
||||
})
|
||||
payslip_id = self.env['hr.payslip'].search([('employee_id', '=', employee_id.id), ('is_push', '=', True), ('is_salary_push', '=', False),
|
||||
('date_from', '>=', row[4].value), ('date_to', '<=', row[5].value)])
|
||||
employee_id = self.env['hr.employee'].search([('name', '=', row[0].value)])
|
||||
# year = (row[4].value).split('-')[0]
|
||||
# month = (row[4].value).split('-')[1]
|
||||
# payslip_run_name = f'{year}年-{int(month)}月'
|
||||
# payslip_run_id = self.env['hr.payslip.run'].search([('name', '=', payslip_run_name)])
|
||||
# if not payslip_run_id:
|
||||
# payslip_run_id = self.env['hr.payslip.run'].create({
|
||||
# 'name': payslip_run_name,
|
||||
# 'date_start': row[4].value,
|
||||
# 'date_end': row[5].value,
|
||||
# 'state': 'draft',
|
||||
# 'payslip_count': 0
|
||||
# })
|
||||
# payslip_id = self.env['hr.payslip'].search([('employee_id', '=', employee_id.id), ('is_push', '=', True), ('is_salary_push', '=', False),
|
||||
# ('date_from', '>=', row[4].value), ('date_to', '<=', row[5].value)])
|
||||
# payslip_id.write({
|
||||
# 'name': employee_id.name,
|
||||
# 'employee_id': employee_id.id,
|
||||
# 'payslip_run_id': payslip_run_id.id,
|
||||
# 'state': 'draft',
|
||||
# 'child_education': row[12].value,
|
||||
# 'continuing_education': row[13].value,
|
||||
# 'housing_loan_interest': row[14].value,
|
||||
# 'housing_rent':row[15].value,
|
||||
# 'elderly_support':row[16].value,
|
||||
# 'infant_care':row[17].value,
|
||||
# 'elderly_support_deduction':row[18].value,
|
||||
# 'commercial_health_insurance': row[20].value,
|
||||
# 'tax_deferred_pension_insurance': row[21].value,
|
||||
# 'others': row[22].value,
|
||||
# 'deductible_donations': row[23].value,
|
||||
# 'total_pre_tax_deductions': row[24].value,
|
||||
# 'tax_reduction': row[25].value,
|
||||
# 'deduction_standard': row[26].value,
|
||||
# 'paid_tax': row[27].value,
|
||||
# })
|
||||
payslip_id = self.env['hr.payslip'].search(
|
||||
[('employee_id', '=', employee_id.id)]
|
||||
)
|
||||
payslip_id.write({
|
||||
'name': employee_id.name,
|
||||
'employee_id': employee_id.id,
|
||||
'payslip_run_id': payslip_run_id.id,
|
||||
'state': 'draft',
|
||||
'child_education': row[12].value,
|
||||
'continuing_education': row[13].value,
|
||||
'housing_loan_interest': row[14].value,
|
||||
'housing_rent':row[15].value,
|
||||
'elderly_support':row[16].value,
|
||||
'infant_care':row[17].value,
|
||||
'elderly_support_deduction':row[18].value,
|
||||
'commercial_health_insurance': row[20].value,
|
||||
'tax_deferred_pension_insurance': row[21].value,
|
||||
'others': row[22].value,
|
||||
'deductible_donations': row[23].value,
|
||||
'total_pre_tax_deductions': row[24].value,
|
||||
'tax_reduction': row[25].value,
|
||||
'deduction_standard': row[26].value,
|
||||
'paid_tax': row[27].value,
|
||||
})
|
||||
'year_compute':row[1].value,
|
||||
'year_jie': row[2].value,
|
||||
'year_gong': row[3].value,
|
||||
'jing_te':row[5].value,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user