diff --git a/front_end/src/Apps/Payroll.jsx b/front_end/src/Apps/Payroll.jsx index 161777ca..273fa520 100644 --- a/front_end/src/Apps/Payroll.jsx +++ b/front_end/src/Apps/Payroll.jsx @@ -2,7 +2,10 @@ import { useEffect, useReducer, useState, useMemo } from "react"; import EditPayroll from "../Components/EditPayroll"; import * as api from "../Components/EditPayroll/api"; -import { payrollHeaders, vacancyHeaders } from "../Components/EditPayroll/constants"; +import { + payrollHeaders, + vacancyHeaders, +} from "../Components/EditPayroll/constants"; const initialPayrollState = []; @@ -79,7 +82,7 @@ export default function Payroll() { />

Vacancies

diff --git a/payroll/services/payroll.py b/payroll/services/payroll.py index ab668f6b..a510997f 100644 --- a/payroll/services/payroll.py +++ b/payroll/services/payroll.py @@ -140,6 +140,7 @@ def update_payroll_data( class Vacancies(TypedDict): + id: str grade: str programme_code: str recruitment_type: str @@ -194,7 +195,6 @@ def update_vacancies_data( ValueError: If any of the pay_periods are not of type bool. """ - # Need to add id to Vacancies and pay periods to Vacancy model for vacancy in vacancies_data: if not vacancy["id"]: raise ValueError("id is empty") @@ -206,8 +206,8 @@ def update_vacancies_data( raise ValueError("pay_periods items should be of type bool") pay_periods = EmployeePayPeriods.objects.get( - employee__employee_no=vacancy["employee_no"], - employee__cost_centre=cost_centre, + vacancy__id=vacancy["id"], + vacancy__cost_centre=cost_centre, year=financial_year, ) pay_periods.periods = vacancy["pay_periods"]