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='*')