From 0c64d53e2b3390e250c164cb82bfc27fbed0dd08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Sat, 24 Jan 2026 19:00:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=96=AA=E8=B5=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_salary/controllers/salary_phone.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/yuthon_salary/controllers/salary_phone.py b/yuthon_salary/controllers/salary_phone.py index 226e1be6a..477bf3cea 100644 --- a/yuthon_salary/controllers/salary_phone.py +++ b/yuthon_salary/controllers/salary_phone.py @@ -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='*')