(Feat-Fix): Added unit display and completion in work allocation system, and ability to edit completed units. Fixed contractor reporting system not displaying data under corresponding departments.

This commit is contained in:
2025-12-31 08:09:04 +00:00
parent 1ac9d22e2d
commit 4e5555c658
13 changed files with 2361 additions and 29 deletions

View File

@@ -0,0 +1,15 @@
-- Add completed_units column to work_allocations table
-- Run this migration to support tracking completed units separately from total units
-- Note: MySQL 8.0 does not support IF NOT EXISTS for ADD COLUMN
-- Check if column exists before running:
-- SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'work_allocations' AND COLUMN_NAME = 'completed_units';
-- Add the column (will error if already exists)
ALTER TABLE work_allocations
ADD COLUMN completed_units DECIMAL(10,2) DEFAULT 0 AFTER units;
-- Update existing records to set completed_units equal to units for completed allocations
UPDATE work_allocations
SET completed_units = units
WHERE status = 'Completed' AND units IS NOT NULL;