diff --git a/front_end/src/Apps/Payroll.jsx b/front_end/src/Apps/Payroll.jsx index 565eaaf2..240cd7a2 100644 --- a/front_end/src/Apps/Payroll.jsx +++ b/front_end/src/Apps/Payroll.jsx @@ -1,4 +1,5 @@ import { useEffect, useReducer, useState, useMemo } from "react"; +import { useParams } from "react-router-dom"; import EditPayroll from "../Components/EditPayroll"; import * as api from "../Components/EditPayroll/api"; @@ -19,10 +20,13 @@ export default function Payroll() { ); const [vacancies, dispatchVacancies] = useReducer( vacanciesReducer, - initialPayrollState + initialVacanciesState ); const [saveSuccess, setSaveSuccess] = useState(false); + const { cost_centre_code, financial_year } = useParams(); + const addVacancyUrl = `edit/${cost_centre_code}/${financial_year}/vacancies/create`; + useEffect(() => { const savedSuccessFlag = localStorage.getItem("saveSuccess"); if (savedSuccessFlag === "true") { @@ -98,6 +102,9 @@ export default function Payroll() { RowComponent={EmployeeRow} />

Vacancies

+ + Add Vacancy + Payroll forecast {% endfor %} - -

Vacancies

- - - - - - - - - - - - - - - {% for vacancy in vacancies %} - - - - - - - - - - - - {% endfor %} - -
Recruitment TypeGradeProgrammeBudget TypeAppointee NameHiring ManagerHR RefRecruitment Stage
{{ vacancy.get_recruitment_type_display }}{{ vacancy.grade }}{{ vacancy.programme_code.programme_code }}{{ vacancy.programme_code.budget_type }}{{ vacancy.appointee_name|default:"" }}{{ vacancy.hiring_manager|default:"" }}{{ vacancy.hr_ref|default:"" }}{{ vacancy.get_recruitment_stage_display }}
- - Add Vacancy {% endblock content %} {% block scripts %} diff --git a/payroll/views.py b/payroll/views.py index f757ad73..510e832b 100644 --- a/payroll/views.py +++ b/payroll/views.py @@ -10,7 +10,6 @@ from core.models import FinancialYear from costcentre.models import CostCentre from payroll.forms import VacancyForm -from payroll.models import Vacancy from .services import payroll as payroll_service @@ -97,7 +96,6 @@ def edit_payroll_page( payroll_forecast_report_data = payroll_service.payroll_forecast_report( cost_centre_obj, financial_year_obj ) - vacancies = Vacancy.objects.filter(cost_centre=cost_centre_code) context = { "cost_centre_code": cost_centre_obj.cost_centre_code, @@ -117,7 +115,6 @@ def edit_payroll_page( "Feb", "Mar", ], - "vacancies": vacancies, } return TemplateResponse(request, "payroll/page/edit_payroll.html", context)