From 1681ed26a26e670ee128468553d68fc164ace0d6 Mon Sep 17 00:00:00 2001 From: Konrad du Plessis Date: Sun, 22 Feb 2026 20:13:44 +0200 Subject: [PATCH] Update worker ID numbers from Workers Info xlsx Replace placeholder ID numbers with real 13-digit SA ID numbers for 12 of 14 workers. Brian and Jerry still have placeholders (no ID info on file). Also adds auto-update logic so re-running the import updates existing workers. Co-Authored-By: Claude Opus 4.6 --- .../commands/import_production_data.py | 34 ++++++++++++------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/core/management/commands/import_production_data.py b/core/management/commands/import_production_data.py index 0f92f6d..da9f6ea 100644 --- a/core/management/commands/import_production_data.py +++ b/core/management/commands/import_production_data.py @@ -69,23 +69,25 @@ class Command(BaseCommand): # if needed. worker_data = [ - # (name, monthly_salary, id_placeholder) - ('Soldier Aphiwe Dobe', Decimal('5000.00'), '0000000000001'), + # (name, monthly_salary, id_number) + # Real SA ID numbers from Workers Info xlsx (13-digit format) + # Brian and Jerry don't have ID info on file yet — using placeholders + ('Soldier Aphiwe Dobe', Decimal('5000.00'), '9212236112084'), ('Brian', Decimal('6000.00'), '0000000000002'), ('Jerry', Decimal('5200.00'), '0000000000003'), - ('Tshepo Isrom Moganedi', Decimal('5200.00'), '0000000000004'), - ('Richard Moleko', Decimal('7000.00'), '0000000000005'), - ('Fikile Oupa Masimula', Decimal('7000.00'), '0000000000006'), - ('Mpho Gift Nkoana', Decimal('7000.00'), '0000000000007'), + ('Tshepo Isrom Moganedi', Decimal('5200.00'), '8112175417083'), + ('Richard Moleko', Decimal('7000.00'), '0003185071085'), + ('Fikile Oupa Masimula', Decimal('7000.00'), '8606305407088'), + ('Mpho Gift Nkoana', Decimal('7000.00'), '9811125984089'), # 4 at R300/day = R6,000/month - ('Clifford Jan Bobby Selemela', Decimal('6000.00'), '0000000000008'), - ('Goitsimang Rasta Moleko', Decimal('6000.00'), '0000000000009'), - ('Jimmy Moleko', Decimal('6000.00'), '0000000000010'), - ('Johannes Laka', Decimal('6000.00'), '0000000000011'), + ('Clifford Jan Bobby Selemela', Decimal('6000.00'), '0104205798085'), + ('Goitsimang Rasta Moleko', Decimal('6000.00'), '0403135542068'), + ('Jimmy Moleko', Decimal('6000.00'), '0101176105084'), + ('Johannes Laka', Decimal('6000.00'), '9809066044087'), # 3 at R250/day = R5,000/month - ('Shane Malobela', Decimal('5000.00'), '0000000000012'), - ('Sello Lloyed Matloa', Decimal('5000.00'), '0000000000013'), - ('Tumelo Faith Sinugo', Decimal('5000.00'), '0000000000014'), + ('Shane Malobela', Decimal('5000.00'), '9807046054085'), + ('Sello Lloyed Matloa', Decimal('5000.00'), '0407046184088'), + ('Tumelo Faith Sinugo', Decimal('5000.00'), '9009055943080'), ] worker_map = {} @@ -99,6 +101,12 @@ class Command(BaseCommand): 'employment_date': datetime.date(2024, 1, 15), } ) + # Always update ID number in case worker was created with placeholder + if worker.id_number != id_num: + old_id = worker.id_number + worker.id_number = id_num + worker.save(update_fields=['id_number']) + self.stdout.write(f' Updated ID for {name}: {old_id} → {id_num}') worker_map[name] = worker if created: self.stdout.write(f' Created worker: {name} (R{salary}/month, R{worker.daily_rate}/day)')