(Feat-Fix): Fixed Reports Page, overhauled the filtering system for reports.

This commit is contained in:
2025-12-21 08:40:40 +00:00
parent 6cc9ebdcf7
commit 8fcbfe2a47
5 changed files with 607 additions and 355 deletions

View File

@@ -32,13 +32,16 @@ router.get(
c.name as contractor_name,
sd.name as sub_department_name,
d.name as department_name,
d.id as department_id
d.id as department_id,
sr.rate as standard_rate
FROM work_allocations wa
JOIN users e ON wa.employee_id = e.id
JOIN users s ON wa.supervisor_id = s.id
JOIN users c ON wa.contractor_id = c.id
LEFT JOIN sub_departments sd ON wa.sub_department_id = sd.id
LEFT JOIN departments d ON e.department_id = d.id
LEFT JOIN standard_rates sr ON wa.sub_department_id = sr.sub_department_id
AND wa.activity = sr.activity
WHERE wa.status = 'Completed'
`;
const queryParams: unknown[] = [];