薪资接口
This commit is contained in:
@@ -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='*')
|
||||
|
||||
Reference in New Issue
Block a user