薪资接口

This commit is contained in:
李鹏宇
2026-01-24 19:00:26 +08:00
parent 6355319cfd
commit 0c64d53e2b
+5 -5
View File
@@ -66,16 +66,16 @@ class YuthonWillTask(http.Controller):
users_id = int(kw.get('users_id'))
user = request.env['res.users'].sudo().browse(int(users_id))
employee_id = user.with_company(user.company_id.id).employee_id.id
records = request.env['hr.payslip'].sudo().search([('employee_id', '=', employee_id)])
records = request.env['yuthon.salary.active'].sudo().search([('employee_id', '=', employee_id)])
data = {}
for record in records:
year = record.date_from.year
month = record.date_from.month
year = int(record.select_year)
month = int(record.select_time)
if year not in data.keys():
data[year] = {'total': 0}
if month not in data[year].keys():
data[year][month] = {'total': record.actual_salary}
data[year]['total'] += record.actual_salary
data[year][month] = {'total': record.actual_paid_salary}
data[year]['total'] += record.actual_paid_salary
return json.dumps({'data': data, 'code': 200, 'message': ''})
@http.route('/phone/salary/self/detail', type='http', auth="none", csrf=False, cors='*')