
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `alert_rules`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `alert_rules` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `name` varchar(160) COLLATE utf8mb4_unicode_ci NOT NULL,
  `kind` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
  `severity` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'medium',
  `threshold_json` json DEFAULT NULL,
  `scope_truck_ids` json DEFAULT NULL,
  `scope_geofence_ids` json DEFAULT NULL,
  `cooldown_minutes` int unsigned NOT NULL DEFAULT '15',
  `notify_sms_to` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notify_email_to` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notify_inapp` tinyint(1) NOT NULL DEFAULT '1',
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_by` int unsigned DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `edited_by` int unsigned DEFAULT NULL,
  `edited_on` datetime DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  KEY `idx_ar_kind_active` (`kind`,`active`,`deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `alert_rules` WRITE;
/*!40000 ALTER TABLE `alert_rules` DISABLE KEYS */;
INSERT INTO `alert_rules` VALUES (1,1,'Over-speed > 80 kph','over_speed','medium','{\"speed_kph\": 80}',NULL,NULL,0,'+255712000001','ops@pacific.test',1,1,'Fires when a position reports speed above 80 kph. Adjust for highway vs urban.',1,'2026-08-27 09:44:08',NULL,NULL,0),(2,1,'Reckless speeding > 100 kph','over_speed','high','{\"speed_kph\": 100}',NULL,NULL,5,NULL,NULL,1,1,'Higher-severity alert for anything above 100 kph.',1,'2026-08-27 09:44:08',NULL,NULL,0),(3,1,'Sudden fuel drop > 20L','fuel_drop','high','{\"drop_l\": 20, \"within_min\": 10}',NULL,NULL,30,NULL,NULL,1,1,'Fuel loss > 20L within 10 minutes ÔÇö probable siphon.',1,'2026-08-27 09:44:08',NULL,NULL,0),(4,1,'Ignition on after hours','ignition_after_hours','medium','{\"hour_to\": 5, \"hour_from\": 20}',NULL,NULL,60,NULL,NULL,1,1,'Truck engine start between 20:00 and 05:00 local time.',1,'2026-08-27 09:44:08',NULL,NULL,0),(5,1,'Device offline > 30 min','device_offline','low','{\"offline_minutes\": 30}',NULL,NULL,60,NULL,NULL,1,1,'Tracker has not reported for 30+ minutes during operating hours.',1,'2026-08-27 09:44:08',NULL,NULL,0),(6,1,'Geofence exit','geofence_exit','medium',NULL,NULL,NULL,0,NULL,NULL,1,1,'Fires whenever a truck exits a geofence with trigger_alert=1.',1,'2026-08-27 09:44:08',NULL,NULL,0),(7,1,'PM due (within threshold)','pm_due','medium',NULL,NULL,NULL,60,NULL,NULL,1,1,'Fires when a truck comes within the threshold_km or threshold_days of a scheduled PM.',1,'2026-08-27 13:18:25',NULL,NULL,0),(8,1,'PM overdue','pm_overdue','high',NULL,NULL,NULL,120,NULL,NULL,1,1,'Fires when the odometer or date has passed the scheduled PM point.',1,'2026-08-27 13:18:25',NULL,NULL,0),(9,1,'Document expiring soon','doc_expiring_soon','medium','{\"days_to\": 30, \"days_from\": 15}',NULL,NULL,1440,NULL,NULL,1,1,'Fires when a truck or driver document is 15-30 days from expiry.',1,'2026-08-27 13:43:10',NULL,NULL,0),(10,1,'Document expiring urgent','doc_expiring_urgent','high','{\"days_to\": 14, \"days_from\": 1}',NULL,NULL,1440,NULL,NULL,1,1,'Fires when a truck or driver document is 1-14 days from expiry ÔÇö needs immediate action.',1,'2026-08-27 13:43:10',NULL,NULL,0),(11,1,'Document expired','doc_expired','critical','{\"days_over\": 0}',NULL,NULL,1440,NULL,NULL,1,1,'Fires the day a document passes its expiry and every day after.',1,'2026-08-27 13:43:10',NULL,NULL,0);
/*!40000 ALTER TABLE `alert_rules` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `alerts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `alerts` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `rule_id` int unsigned DEFAULT NULL,
  `kind` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
  `severity` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'medium',
  `device_id` int unsigned DEFAULT NULL,
  `truck_id` int unsigned DEFAULT NULL,
  `driver_id` int unsigned DEFAULT NULL,
  `geofence_id` int unsigned DEFAULT NULL,
  `trip_id` int unsigned DEFAULT NULL,
  `position_id` int unsigned DEFAULT NULL,
  `event_id` int unsigned DEFAULT NULL,
  `ts` datetime NOT NULL,
  `lat` decimal(10,6) DEFAULT NULL,
  `lng` decimal(10,6) DEFAULT NULL,
  `title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `message` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload_json` json DEFAULT NULL,
  `sms_sent` tinyint(1) NOT NULL DEFAULT '0',
  `email_sent` tinyint(1) NOT NULL DEFAULT '0',
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'open',
  `acknowledged_by` int unsigned DEFAULT NULL,
  `acknowledged_at` datetime DEFAULT NULL,
  `resolution_note` text COLLATE utf8mb4_unicode_ci,
  `created_on` datetime NOT NULL,
  PRIMARY KEY (`c0d`),
  KEY `idx_al_status_ts` (`status`,`ts`),
  KEY `idx_al_truck_ts` (`truck_id`,`ts`),
  KEY `idx_al_kind_ts` (`kind`,`ts`),
  KEY `idx_al_rule` (`rule_id`,`ts`)
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `alerts` WRITE;
/*!40000 ALTER TABLE `alerts` DISABLE KEYS */;
INSERT INTO `alerts` VALUES (1,1,1,'over_speed','medium',1,100,NULL,NULL,NULL,2,NULL,'2024-08-27 08:01:00',-6.810000,39.250000,'Over-speed · 95 kph','Speed 95 kph exceeds limit 80 kph.','{\"limit\": 80, \"speed\": 95}',0,0,'open',NULL,NULL,NULL,'2026-08-27 09:44:45'),(2,1,6,'geofence_exit','medium',1,100,NULL,1,NULL,2,NULL,'2024-08-27 08:01:00',-6.810000,39.250000,'Geofence exit · fence #1','Vehicle exited the geofence.',NULL,0,0,'open',NULL,NULL,NULL,'2026-08-27 09:44:45'),(3,1,1,'over_speed','medium',1,100,NULL,NULL,NULL,3,NULL,'2024-08-27 08:02:00',-6.820000,39.260000,'Over-speed · 105 kph','Speed 105 kph exceeds limit 80 kph.','{\"limit\": 80, \"speed\": 105}',0,0,'open',NULL,NULL,NULL,'2026-08-27 09:44:45'),(4,1,2,'over_speed','high',1,100,NULL,NULL,NULL,3,NULL,'2024-08-27 08:02:00',-6.820000,39.260000,'Over-speed · 105 kph','Speed 105 kph exceeds limit 100 kph.','{\"limit\": 100, \"speed\": 105}',0,0,'open',NULL,NULL,NULL,'2026-08-27 09:44:45'),(5,1,5,'device_offline','low',1,100,NULL,NULL,NULL,NULL,NULL,'2026-08-27 09:45:50',NULL,NULL,'Device offline · T 999 DEMO','Tracker 352093088111111 (T 999 DEMO) has not reported for 45 minutes.','{\"last_seen_at\": \"2026-08-27 09:00:35\", \"minutes_offline\": 45}',0,0,'open',NULL,NULL,NULL,'2026-08-27 09:45:50'),(6,1,6,'geofence_exit','medium',3,100,NULL,1,NULL,5,NULL,'2024-08-27 08:00:00',-6.800000,39.250000,'Geofence exit · fence #1','Vehicle exited the geofence.',NULL,0,0,'open',NULL,NULL,NULL,'2026-08-27 10:10:05'),(7,1,8,'pm_overdue','high',NULL,100,NULL,NULL,NULL,NULL,NULL,'2026-08-27 10:18:59',NULL,NULL,'PM overdue · T 999 DEMO · Engine oil & filter change','Truck T 999 DEMO needs Engine oil & filter change. Odometer 123,900 km — planned at 130,000 km (6,100 km ahead). Planned date: 2025-07-30.','{\"event_id\": 1, \"template\": \"Engine oil & filter change\", \"current_km\": 123900, \"planned_km\": 130000, \"schedule_id\": 1, \"planned_date\": \"2025-07-30\"}',0,0,'resolved',1,'2026-08-27 13:19:00','PM completed at 135200 km','2026-08-27 13:18:59'),(8,1,8,'pm_overdue','high',NULL,100,NULL,NULL,NULL,NULL,NULL,'2026-08-27 10:18:59',NULL,NULL,'PM overdue · T 999 DEMO · Brake pads inspection','Truck T 999 DEMO needs Brake pads inspection. Odometer 123,900 km — planned at 140,000 km (16,100 km ahead). Planned date: 2025-10-28.','{\"event_id\": 2, \"template\": \"Brake pads inspection\", \"current_km\": 123900, \"planned_km\": 140000, \"schedule_id\": 2, \"planned_date\": \"2025-10-28\"}',0,0,'open',NULL,NULL,NULL,'2026-08-27 13:18:59'),(9,1,8,'pm_overdue','high',NULL,100,NULL,NULL,NULL,NULL,NULL,'2026-08-27 10:18:59',NULL,NULL,'PM overdue · T 999 DEMO · Tyre rotation','Truck T 999 DEMO needs Tyre rotation. Odometer 135,000 km is 5,000 km past the planned 130,000 km.','{\"event_id\": 3, \"template\": \"Tyre rotation\", \"current_km\": 135000, \"planned_km\": 130000, \"schedule_id\": 3, \"planned_date\": null}',0,0,'open',NULL,NULL,NULL,'2026-08-27 13:19:00'),(30,1,11,'doc_expired','critical',NULL,100,NULL,NULL,NULL,NULL,NULL,'2026-08-27 10:46:51',NULL,NULL,'Insurance Policy · T 999 DEMO · expired 10 days ago','Insurance Policy for Truck T 999 DEMO (#INS-2025-EXPIRED) expired 10 days ago. Expiry date: 2026-08-17. Issued by Jubilee Insurance.','{\"doc_id\": 1, \"source\": \"truck\", \"doc_type\": \"insurance\", \"expires_on\": \"2026-08-17\", \"subject_id\": 100, \"subject_name\": \"T 999 DEMO\", \"days_remaining\": -10}',0,0,'open',NULL,NULL,NULL,'2026-08-27 13:46:51'),(31,1,11,'doc_expired','critical',NULL,NULL,100,NULL,NULL,NULL,NULL,'2026-08-27 10:46:51',NULL,NULL,'Medical Fitness Certificate · Demo Driver · expired 3 days ago','Medical Fitness Certificate for Driver Demo Driver (#MED-EXPIRED) expired 3 days ago. Expiry date: 2026-08-24. Issued by Aga Khan Hospital.','{\"doc_id\": 2, \"source\": \"driver\", \"doc_type\": \"medical\", \"expires_on\": \"2026-08-24\", \"subject_id\": 100, \"subject_name\": \"Demo Driver\", \"days_remaining\": -3}',0,0,'open',NULL,NULL,NULL,'2026-08-27 13:46:51'),(32,1,10,'doc_expiring_urgent','high',NULL,100,NULL,NULL,NULL,NULL,NULL,'2026-08-27 10:46:51',NULL,NULL,'Road Permit · T 999 DEMO · expires in 5 days','Road Permit for Truck T 999 DEMO (#PERMIT-URGENT) expires in 5 days. Expiry date: 2026-09-01. Issued by TRA.','{\"doc_id\": 2, \"source\": \"truck\", \"doc_type\": \"road_permit\", \"expires_on\": \"2026-09-01\", \"subject_id\": 100, \"subject_name\": \"T 999 DEMO\", \"days_remaining\": 5}',0,0,'open',NULL,NULL,NULL,'2026-08-27 13:46:51'),(33,1,10,'doc_expiring_urgent','high',NULL,NULL,100,NULL,NULL,NULL,NULL,'2026-08-27 10:46:51',NULL,NULL,'Driver\'s Licence · Demo Driver · expires in 10 days','Driver\'s Licence for Driver Demo Driver (#DL-URGENT) expires in 10 days. Expiry date: 2026-09-06. Issued by TZ Roads.','{\"doc_id\": 1, \"source\": \"driver\", \"doc_type\": \"licence\", \"expires_on\": \"2026-09-06\", \"subject_id\": 100, \"subject_name\": \"Demo Driver\", \"days_remaining\": 10}',0,0,'open',NULL,NULL,NULL,'2026-08-27 13:46:51'),(34,1,9,'doc_expiring_soon','medium',NULL,100,NULL,NULL,NULL,NULL,NULL,'2026-08-27 10:46:52',NULL,NULL,'Annual Inspection · T 999 DEMO · expires in 20 days','Annual Inspection for Truck T 999 DEMO (#INSP-SOON-A) expires in 20 days. Expiry date: 2026-09-16. Issued by TRA.','{\"doc_id\": 3, \"source\": \"truck\", \"doc_type\": \"inspection\", \"expires_on\": \"2026-09-16\", \"subject_id\": 100, \"subject_name\": \"T 999 DEMO\", \"days_remaining\": 20}',0,0,'open',NULL,NULL,NULL,'2026-08-27 13:46:52');
/*!40000 ALTER TABLE `alerts` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `api_audit_log`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `api_audit_log` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `driver_id` int unsigned DEFAULT NULL,
  `token_id` int unsigned DEFAULT NULL,
  `endpoint` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
  `http_method` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `http_status` smallint unsigned NOT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `error_msg` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `duration_ms` int unsigned DEFAULT NULL,
  `created_on` datetime NOT NULL,
  PRIMARY KEY (`c0d`),
  KEY `idx_al_driver_ts` (`driver_id`,`created_on`),
  KEY `idx_al_endpoint` (`endpoint`,`created_on`)
) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `api_audit_log` WRITE;
/*!40000 ALTER TABLE `api_audit_log` DISABLE KEYS */;
INSERT INTO `api_audit_log` VALUES (1,NULL,NULL,'health','GET',200,'::1','curl/8.15.0',NULL,0,'2026-08-27 10:08:06'),(2,NULL,NULL,'login','POST',401,'::1','curl/8.15.0','invalid_credentials: Phone or PIN not recognised, or mobile login not enabled for this driver.',70,'2026-08-27 10:08:06'),(3,100,1,'login','POST',200,'::1','curl/8.15.0',NULL,98,'2026-08-27 10:08:06'),(4,NULL,NULL,'me','GET',401,'::1','curl/8.15.0','invalid_token: Token invalid, expired, or revoked.',0,'2026-08-27 10:08:07'),(5,100,2,'login','POST',200,'::1','curl/8.15.0',NULL,107,'2026-08-27 10:08:59'),(6,100,2,'me','GET',200,'::1','curl/8.15.0',NULL,18,'2026-08-27 10:09:00'),(7,100,2,'pushPosition','POST',200,'::1','curl/8.15.0',NULL,103,'2026-08-27 10:09:00'),(8,100,3,'login','POST',200,'::1','curl/8.15.0',NULL,92,'2026-08-27 10:10:04'),(9,100,3,'tripStart','POST',200,'::1','curl/8.15.0',NULL,32,'2026-08-27 10:10:05'),(10,100,3,'pushPosition','POST',200,'::1','curl/8.15.0',NULL,62,'2026-08-27 10:10:05'),(11,100,3,'fuelEntry','POST',200,'::1','curl/8.15.0',NULL,235,'2026-08-27 10:10:05'),(12,100,3,'expense','POST',200,'::1','curl/8.15.0',NULL,38,'2026-08-27 10:10:05'),(13,100,3,'workRequest','POST',200,'::1','curl/8.15.0',NULL,61,'2026-08-27 10:10:06'),(14,100,3,'tripDeliver','POST',200,'::1','curl/8.15.0',NULL,34,'2026-08-27 10:10:06'),(15,100,3,'tripClose','POST',200,'::1','curl/8.15.0',NULL,39,'2026-08-27 10:10:06'),(16,100,3,'geofences','GET',200,'::1','curl/8.15.0',NULL,27,'2026-08-27 10:10:06'),(17,100,3,'logout','POST',200,'::1','curl/8.15.0',NULL,19,'2026-08-27 10:10:06'),(18,NULL,NULL,'me','GET',401,'::1','curl/8.15.0','invalid_token: Token invalid, expired, or revoked.',3,'2026-08-27 10:10:06'),(19,100,4,'login','POST',200,'::1','curl/8.15.0',NULL,125,'2026-08-27 10:10:48'),(20,100,4,'activeTrip','GET',200,'::1','curl/8.15.0',NULL,26,'2026-08-27 10:10:49'),(21,100,4,'trips','GET',200,'::1','curl/8.15.0',NULL,18,'2026-08-27 10:10:49'),(22,100,4,'tripStart','POST',200,'::1','curl/8.15.0',NULL,48,'2026-08-27 10:10:49'),(23,100,4,'tripDeliver','POST',200,'::1','curl/8.15.0',NULL,44,'2026-08-27 10:10:49'),(24,100,4,'tripClose','POST',200,'::1','curl/8.15.0',NULL,38,'2026-08-27 10:10:50'),(25,100,5,'login','POST',200,'::1','curl/8.15.0',NULL,93,'2026-08-27 10:16:39'),(26,100,5,'tripStart','POST',200,'::1','curl/8.15.0',NULL,121,'2026-08-27 10:16:39'),(27,100,5,'tripAttach','POST',200,'::1','curl/8.15.0',NULL,21,'2026-08-27 10:16:40'),(28,100,5,'tripAttach','POST',200,'::1','curl/8.15.0',NULL,21,'2026-08-27 10:16:40'),(29,100,5,'tripAttach','POST',422,'::1','curl/8.15.0','attach_failed: Extension .exe not allowed.',20,'2026-08-27 10:16:40'),(30,100,5,'tripAttach','POST',403,'::1','curl/8.15.0','not_your_trip: Trip is not assigned to you.',12,'2026-08-27 10:16:40'),(31,100,5,'tripAttachments','GET',200,'::1','curl/8.15.0',NULL,21,'2026-08-27 10:16:41'),(32,100,6,'login','POST',200,'::1','curl/8.15.0',NULL,98,'2026-08-27 10:17:14'),(33,100,6,'tripAttach','POST',200,'::1','curl/8.15.0',NULL,26,'2026-08-27 10:17:15');
/*!40000 ALTER TABLE `api_audit_log` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `api_tokens`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `api_tokens` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `driver_id` int unsigned NOT NULL,
  `token_hash` char(64) COLLATE utf8mb4_unicode_ci NOT NULL,
  `device_label` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `device_platform` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `app_version` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_used_at` datetime DEFAULT NULL,
  `expires_at` datetime NOT NULL,
  `revoked_at` datetime DEFAULT NULL,
  `created_on` datetime NOT NULL,
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_token_hash` (`token_hash`),
  KEY `idx_at_driver` (`driver_id`,`revoked_at`),
  KEY `idx_at_expires` (`expires_at`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `api_tokens` WRITE;
/*!40000 ALTER TABLE `api_tokens` DISABLE KEYS */;
INSERT INTO `api_tokens` VALUES (1,1,100,'d3e318f81ea11e62a3779b6478038522db044d5ba5a68186abb035a4c49e3e42','Test Curl','android','1.0.0','::1','curl/8.15.0','2026-08-27 10:08:07','2026-09-26 10:08:07',NULL,'2026-08-27 10:08:06'),(2,1,100,'19931b202901d37eaec7f411b5f274483ff002cf72c964db048acde91b579b52','Test',NULL,NULL,'::1','curl/8.15.0','2026-08-27 10:09:00','2026-09-26 10:09:00',NULL,'2026-08-27 10:08:59'),(3,1,100,'6f290bacc95b4c7219037eb882efdcdd4abc789b44fb87e878b18b318a508582',NULL,NULL,NULL,'::1','curl/8.15.0','2026-08-27 10:10:06','2026-09-26 10:10:06','2026-08-27 10:10:06','2026-08-27 10:10:04'),(4,1,100,'7eeac933a9243e47cb831254bd6463aa8af5a4073db6362f54b5e18749709ac6',NULL,NULL,NULL,'::1','curl/8.15.0','2026-08-27 10:10:50','2026-09-26 10:10:50',NULL,'2026-08-27 10:10:48'),(5,1,100,'3201d1ccb6e63f9df6363437fa40e43594e4b69c48ee4576177eceb7aadb2950',NULL,NULL,NULL,'::1','curl/8.15.0','2026-08-27 10:16:41','2026-09-26 10:16:41',NULL,'2026-08-27 10:16:39'),(6,1,100,'d87020342f1569f2102b7d4a7c3fffaf63dd3a5346cbc8ff7c297b1136ad3859',NULL,NULL,NULL,'::1','curl/8.15.0','2026-08-27 10:17:15','2026-09-26 10:17:15',NULL,'2026-08-27 10:17:14');
/*!40000 ALTER TABLE `api_tokens` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `app_install_downloads`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `app_install_downloads` (
  `c0d` int NOT NULL AUTO_INCREMENT,
  `token_id` int NOT NULL,
  `downloader_name` varchar(160) NOT NULL,
  `downloader_phone` varchar(40) NOT NULL,
  `downloader_employee_no` varchar(40) DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` varchar(255) DEFAULT NULL,
  `downloaded_on` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`c0d`),
  KEY `idx_aid_token` (`token_id`,`downloaded_on`),
  KEY `idx_aid_phone` (`downloader_phone`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `app_install_downloads` WRITE;
/*!40000 ALTER TABLE `app_install_downloads` DISABLE KEYS */;
/*!40000 ALTER TABLE `app_install_downloads` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `app_install_tokens`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `app_install_tokens` (
  `c0d` int NOT NULL AUTO_INCREMENT,
  `tenant_id` int NOT NULL DEFAULT '1',
  `token` varchar(48) NOT NULL,
  `label` varchar(120) NOT NULL DEFAULT '' COMMENT 'Friendly label admin sets (e.g. "New drivers cohort 3")',
  `created_by` int NOT NULL,
  `created_by_name` varchar(120) NOT NULL DEFAULT '',
  `created_on` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `expires_on` datetime NOT NULL,
  `revoked` tinyint(1) NOT NULL DEFAULT '0',
  `revoked_by` int DEFAULT NULL,
  `revoked_on` datetime DEFAULT NULL,
  `downloads_count` int NOT NULL DEFAULT '0',
  `last_download_on` datetime DEFAULT NULL,
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `token` (`token`),
  KEY `idx_ait_created` (`created_by`,`created_on`),
  KEY `idx_ait_active` (`revoked`,`expires_on`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `app_install_tokens` WRITE;
/*!40000 ALTER TABLE `app_install_tokens` DISABLE KEYS */;
/*!40000 ALTER TABLE `app_install_tokens` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `bank_accounts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `bank_accounts` (
  `c0d` int NOT NULL AUTO_INCREMENT,
  `account_name` varchar(120) NOT NULL,
  `bank_name` varchar(120) NOT NULL,
  `account_number` varchar(60) NOT NULL,
  `swift_code` varchar(40) NOT NULL DEFAULT '',
  `currency` varchar(10) NOT NULL DEFAULT 'TZS',
  `coa_id` int NOT NULL DEFAULT '0',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `opening_balance` decimal(20,2) NOT NULL DEFAULT '0.00',
  `opening_on` date DEFAULT NULL,
  `created_by` int NOT NULL DEFAULT '0',
  `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_bank_acct` (`bank_name`,`account_number`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `bank_accounts` WRITE;
/*!40000 ALTER TABLE `bank_accounts` DISABLE KEYS */;
INSERT INTO `bank_accounts` VALUES (1,'Pacific Group - CRDB Operating','CRDB Bank','TBD-CRDB-ACCT','CORUTZTZ','TZS',12,1,0.00,NULL,1,'2026-08-27 10:37:31'),(2,'Pacific Group - NMB','NMB Bank','TBD-NMB-ACCT','NMIBTZTZ','TZS',13,1,0.00,NULL,1,'2026-08-27 10:37:31');
/*!40000 ALTER TABLE `bank_accounts` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `bank_statement_lines`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `bank_statement_lines` (
  `c0d` int NOT NULL AUTO_INCREMENT,
  `statement_id` int NOT NULL,
  `line_no` int NOT NULL,
  `txn_date` date NOT NULL,
  `description` varchar(255) NOT NULL DEFAULT '',
  `reference` varchar(60) NOT NULL DEFAULT '' COMMENT 'Bank txn ref',
  `amount` decimal(20,2) NOT NULL,
  `running_balance` decimal(20,2) DEFAULT NULL,
  `matched_journal_line_id` int NOT NULL DEFAULT '0' COMMENT 'FK to journal_lines',
  `matched_by` int NOT NULL DEFAULT '0',
  `matched_on` datetime DEFAULT NULL,
  `created_on` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  KEY `idx_bsl_statement` (`statement_id`,`txn_date`),
  KEY `idx_bsl_matched` (`matched_journal_line_id`),
  KEY `idx_bsl_amount` (`statement_id`,`amount`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `bank_statement_lines` WRITE;
/*!40000 ALTER TABLE `bank_statement_lines` DISABLE KEYS */;
INSERT INTO `bank_statement_lines` VALUES (1,1,1,'2026-08-27','DEPOSIT-CUSTOMER-A','RCPT-A',1003000.00,1003000.00,6,1,'2026-08-27 20:22:44','2026-08-27 17:22:44',0),(2,1,2,'2026-08-27','SALARY-PAYROLL-AUG','PAY-AUG',-703125.00,299875.00,24,1,'2026-08-27 20:22:44','2026-08-27 17:22:44',0),(3,1,3,'2026-08-27','MONTHLY BANK CHARGES','BFEE-08',-5000.00,294875.00,26,1,'2026-08-27 20:22:44','2026-08-27 17:22:44',0);
/*!40000 ALTER TABLE `bank_statement_lines` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `bank_statements`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `bank_statements` (
  `c0d` int NOT NULL AUTO_INCREMENT,
  `tenant_id` int NOT NULL,
  `bank_account_id` int NOT NULL COMMENT 'FK to chart_of_accounts (the bank COA)',
  `statement_from` date NOT NULL,
  `statement_to` date NOT NULL,
  `opening_balance` decimal(20,2) NOT NULL DEFAULT '0.00',
  `closing_balance` decimal(20,2) NOT NULL DEFAULT '0.00',
  `reference` varchar(60) NOT NULL DEFAULT '' COMMENT 'Statement no from bank',
  `notes` text,
  `line_count` int NOT NULL DEFAULT '0',
  `matched_count` int NOT NULL DEFAULT '0',
  `status` varchar(20) NOT NULL DEFAULT 'OPEN' COMMENT 'OPEN | RECONCILED | VOID',
  `reconciled_by` int NOT NULL DEFAULT '0',
  `reconciled_on` datetime DEFAULT NULL,
  `created_by` int NOT NULL,
  `created_on` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `edited_by` int NOT NULL DEFAULT '0',
  `edited_on` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  KEY `idx_bs_bank_period` (`bank_account_id`,`statement_from`,`statement_to`),
  KEY `idx_bs_status` (`status`,`deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `bank_statements` WRITE;
/*!40000 ALTER TABLE `bank_statements` DISABLE KEYS */;
INSERT INTO `bank_statements` VALUES (1,1,12,'2026-08-01','2026-08-31',0.00,294875.00,'SMOKE-27-AUG','',3,3,'RECONCILED',1,'2026-08-27 20:22:44',1,'2026-08-27 17:22:44',1,'2026-08-27 17:22:44',0);
/*!40000 ALTER TABLE `bank_statements` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `budget_item_categories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `budget_item_categories` (
  `c0d` int NOT NULL AUTO_INCREMENT,
  `category_name` varchar(120) NOT NULL,
  `category_code` varchar(20) NOT NULL DEFAULT '',
  `description` text,
  `default_expense_coa_id` int NOT NULL DEFAULT '0',
  `parent_id` int NOT NULL DEFAULT '0',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_code` (`category_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `budget_item_categories` WRITE;
/*!40000 ALTER TABLE `budget_item_categories` DISABLE KEYS */;
/*!40000 ALTER TABLE `budget_item_categories` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `chart_of_accounts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `chart_of_accounts` (
  `c0d` int NOT NULL AUTO_INCREMENT,
  `account_code` varchar(20) NOT NULL,
  `account_name` varchar(160) NOT NULL,
  `account_type` varchar(20) NOT NULL,
  `parent_id` int NOT NULL DEFAULT '0',
  `is_bank` tinyint(1) NOT NULL DEFAULT '0',
  `is_control` tinyint(1) NOT NULL DEFAULT '0',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `currency` varchar(10) NOT NULL DEFAULT 'TZS',
  `created_by` int NOT NULL DEFAULT '0',
  `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_account_code` (`account_code`),
  KEY `ix_type` (`account_type`)
) ENGINE=InnoDB AUTO_INCREMENT=77 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `chart_of_accounts` WRITE;
/*!40000 ALTER TABLE `chart_of_accounts` DISABLE KEYS */;
INSERT INTO `chart_of_accounts` VALUES (1,'1000','Contra Asset','ASSET',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(2,'1001','Accumulated depreciation - Motor vehicle','ASSET',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(3,'1002','Accumulated depreciation - Furniture','ASSET',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(4,'1003','Accumulated depreciation - Computer equipment','ASSET',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(5,'1004','Accumulated depreciation - Right of use','ASSET',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(6,'2000','Non-Current Asset','ASSET',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(7,'2001','Computer','ASSET',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(8,'2002','Motor vehicle','ASSET',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(9,'2003','Furnitures','ASSET',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(10,'2004','Right of use','ASSET',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(11,'3000','Current Assets','ASSET',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(12,'3001','Bank - CRDB','ASSET',0,1,0,1,'TZS',1,'2026-08-27 10:37:31'),(13,'3002','Bank - NMB','ASSET',0,1,0,1,'TZS',1,'2026-08-27 10:37:31'),(14,'3003','Cash','ASSET',0,1,0,1,'TZS',1,'2026-08-27 10:37:31'),(15,'3004','Inventory','ASSET',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(16,'3005','Prepaid expenses','ASSET',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(17,'3006','Mobile Money Float','ASSET',0,1,0,1,'TZS',1,'2026-08-27 10:37:31'),(18,'3007','Trade Receivables','ASSET',0,0,1,1,'TZS',1,'2026-08-27 10:37:31'),(19,'3008','VAT Recoverable','ASSET',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(20,'3009','Fuel Card Account','ASSET',0,1,0,1,'TZS',1,'2026-08-27 10:37:31'),(21,'4000','Current Liabilities','LIABILITY',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(22,'4001','Accrued Expenses','LIABILITY',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(23,'4002','Lease liability','LIABILITY',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(24,'4003','NSSF - Payable','LIABILITY',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(25,'4004','PAYE - Payable','LIABILITY',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(26,'4005','Salary - payable','LIABILITY',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(27,'4006','SDL - Payable','LIABILITY',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(28,'4007','Tax payable','LIABILITY',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(29,'4008','WCF - Payable','LIABILITY',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(30,'4009','Trade Payables','LIABILITY',0,0,1,1,'TZS',1,'2026-08-27 10:37:31'),(31,'4010','VAT Payable','LIABILITY',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(32,'5000','Non-Current Liability','LIABILITY',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(33,'5001','Loan Borrowing','LIABILITY',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(34,'5002','Lease liability - Non-current','LIABILITY',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(35,'6000','Equity','EQUITY',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(36,'6001','Capital','EQUITY',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(37,'6002','Opening Balance adjustment','EQUITY',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(38,'6003','Retained Earnings','EQUITY',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(39,'6004','Drawings','EQUITY',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(40,'7000','Expenses','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(41,'7001','Bank Charges','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(42,'7002','Basic Salaries','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(43,'7003','Catering','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(44,'7004','Corporate tax','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(45,'7005','Cost of goods sold (COGS)','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(46,'7006','Delivery Bags','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(47,'7007','Depreciation','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(48,'7008','Finance cost','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(49,'7009','Fuel','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(50,'7010','G&A (Rent, Insurance, Office Supplies)','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(51,'7011','Internet','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(52,'7012','Local Conveyance (Transport)','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(53,'7013','M/Vehicles Running Costs','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(54,'7014','Misc Expenses','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(55,'7015','Mobile Bundles (Mins And Texts)','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(56,'7016','NSSF Contribution','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(57,'7017','Office Attendant (Cleaning)','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(58,'7018','Office rent','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(59,'7019','Office Repairs','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(60,'7020','Office Security','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(61,'7021','Office Service Charges','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(62,'7022','Professional fees','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(63,'7023','Purchases','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(64,'7024','Regulatory And Compliance','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(65,'7025','Sales And Marketing (Flyers And Posters Etc)','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(66,'7026','Skills Development Levy','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(67,'7027','Stationeries','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(68,'7028','Subsistence Allowances','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(69,'7029','Transport Charges','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(70,'7030','Wages','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(71,'7031','Workers Compensation Fund','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(72,'7032','Health Insurance','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(73,'7033','Staff uniforms','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(74,'7034','Freight charges','EXPENSE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(75,'8000','Revenue','REVENUE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31'),(76,'8001','Sales Revenue','REVENUE',0,0,0,1,'TZS',1,'2026-08-27 10:37:31');
/*!40000 ALTER TABLE `chart_of_accounts` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `company_profile`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `company_profile` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `trading_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'DS Pera',
  `short_name` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'DSP',
  `logo_path` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tagline` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `physical_address` varchar(300) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `postal_address` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `region` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `district` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone_primary` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone_secondary` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email_primary` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email_secondary` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `website` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `legal_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'DS Pera Ltd',
  `reg_number` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tin` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `vat_number` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tax_regime` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bank_name` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bank_branch` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bank_account_name` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bank_account_no` varchar(60) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bank_swift` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bank_currency` varchar(6) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'TZS',
  `edited_by` int unsigned DEFAULT NULL,
  `edited_by_name` varchar(160) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `edited_on` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`c0d`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `company_profile` WRITE;
/*!40000 ALTER TABLE `company_profile` DISABLE KEYS */;
INSERT INTO `company_profile` VALUES (1,'DS Pera','DSP',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'DS Pera Ltd',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'TZS',NULL,NULL,NULL);
/*!40000 ALTER TABLE `company_profile` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `controllers_actions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `controllers_actions` (
  `c0d` int NOT NULL AUTO_INCREMENT,
  `controller_name` varchar(80) NOT NULL,
  `action_name` varchar(80) NOT NULL,
  `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_ctrl_action` (`controller_name`,`action_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `controllers_actions` WRITE;
/*!40000 ALTER TABLE `controllers_actions` DISABLE KEYS */;
/*!40000 ALTER TABLE `controllers_actions` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `cron_runs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `cron_runs` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `worker` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
  `started_at` datetime NOT NULL,
  `finished_at` datetime DEFAULT NULL,
  `watermark_before` datetime DEFAULT NULL,
  `watermark_after` datetime DEFAULT NULL,
  `positions_scanned` int unsigned NOT NULL DEFAULT '0',
  `events_scanned` int unsigned NOT NULL DEFAULT '0',
  `alerts_created` int unsigned NOT NULL DEFAULT '0',
  `sms_sent` int unsigned NOT NULL DEFAULT '0',
  `sms_failed` int unsigned NOT NULL DEFAULT '0',
  `emails_sent` int unsigned NOT NULL DEFAULT '0',
  `emails_failed` int unsigned NOT NULL DEFAULT '0',
  `ok` tinyint(1) NOT NULL DEFAULT '1',
  `error` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`c0d`),
  KEY `idx_cr_worker_started` (`worker`,`started_at`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `cron_runs` WRITE;
/*!40000 ALTER TABLE `cron_runs` DISABLE KEYS */;
INSERT INTO `cron_runs` VALUES (1,'tick','2026-08-27 09:45:11','2026-08-27 09:45:16','2026-08-27 09:39:11','2026-08-27 09:45:11',0,0,0,0,2,0,2,1,NULL),(2,'tick','2026-08-27 09:45:16','2026-08-27 09:45:20','2026-08-27 09:45:11','2026-08-27 09:45:16',0,0,0,0,2,0,2,1,NULL),(3,'tick','2026-08-27 09:45:20','2026-08-27 09:45:24','2026-08-27 09:45:16','2026-08-27 09:45:20',0,0,0,0,2,0,2,1,NULL),(4,'tick','2026-08-27 09:45:50','2026-08-27 09:45:50','2026-08-27 09:45:20','2026-08-27 09:45:50',0,0,1,0,0,0,0,1,NULL);
/*!40000 ALTER TABLE `cron_runs` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `customer_invoice_lines`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `customer_invoice_lines` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `invoice_id` int unsigned NOT NULL,
  `line_no` int unsigned NOT NULL DEFAULT '1',
  `trip_id` int unsigned DEFAULT NULL,
  `description` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
  `quantity` decimal(10,3) NOT NULL DEFAULT '1.000',
  `unit_price` decimal(14,2) NOT NULL DEFAULT '0.00',
  `net_amount` decimal(14,2) NOT NULL DEFAULT '0.00',
  `vat_rate` decimal(5,2) NOT NULL DEFAULT '0.00',
  `vat_amount` decimal(14,2) NOT NULL DEFAULT '0.00',
  `total_amount` decimal(14,2) NOT NULL DEFAULT '0.00',
  `revenue_account` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '4010',
  `truck_id` int unsigned DEFAULT NULL,
  `driver_id` int unsigned DEFAULT NULL,
  `route_summary` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`c0d`),
  KEY `idx_cil_invoice` (`invoice_id`,`line_no`),
  KEY `idx_cil_trip` (`trip_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `customer_invoice_lines` WRITE;
/*!40000 ALTER TABLE `customer_invoice_lines` DISABLE KEYS */;
INSERT INTO `customer_invoice_lines` VALUES (1,1,1,3,'Trip TRIP-TEST-001 — Ubungo depot → Chalinze customer site · 400 km',1.000,500000.00,500000.00,18.00,90000.00,590000.00,'8001',100,100,'Ubungo depot → Chalinze customer site · 400 km'),(2,1,2,4,'Trip TRIP-TEST-002 — Ubungo depot → Morogoro · 300 km',1.000,350000.00,350000.00,18.00,63000.00,413000.00,'8001',100,100,'Ubungo depot → Morogoro · 300 km'),(3,1,3,5,'Trip TRIP-COA21-A — Ubungo depot → Chalinze · 400 km',1.000,500000.00,500000.00,18.00,90000.00,590000.00,'8001',100,100,'Ubungo depot → Chalinze · 400 km'),(4,1,4,6,'Trip TRIP-COA21-B — Ubungo depot → Morogoro · 300 km',1.000,350000.00,350000.00,18.00,63000.00,413000.00,'8001',100,100,'Ubungo depot → Morogoro · 300 km');
/*!40000 ALTER TABLE `customer_invoice_lines` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `customer_invoices`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `customer_invoices` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `invoice_no` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `customer_id` int unsigned NOT NULL,
  `invoice_date` date NOT NULL,
  `due_date` date DEFAULT NULL,
  `payment_terms` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `currency` varchar(6) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'TZS',
  `subtotal` decimal(14,2) NOT NULL DEFAULT '0.00',
  `vat_amount` decimal(14,2) NOT NULL DEFAULT '0.00',
  `total_amount` decimal(14,2) NOT NULL DEFAULT '0.00',
  `amount_paid` decimal(14,2) NOT NULL DEFAULT '0.00',
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
  `issued_by` int unsigned DEFAULT NULL,
  `issued_at` datetime DEFAULT NULL,
  `journal_entry_id` int unsigned DEFAULT NULL,
  `void_by` int unsigned DEFAULT NULL,
  `void_at` datetime DEFAULT NULL,
  `void_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `billing_address` text COLLATE utf8mb4_unicode_ci,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `footer_note` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_by` int unsigned DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `edited_by` int unsigned DEFAULT NULL,
  `edited_on` datetime DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_ci_invoice_no` (`invoice_no`),
  KEY `idx_ci_customer_status` (`customer_id`,`status`,`deleted`),
  KEY `idx_ci_status_date` (`status`,`invoice_date`),
  KEY `idx_ci_due` (`due_date`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `customer_invoices` WRITE;
/*!40000 ALTER TABLE `customer_invoices` DISABLE KEYS */;
INSERT INTO `customer_invoices` VALUES (1,1,'INV-2026-0001',1,'2026-08-27','2026-09-26','Net 30','TZS',1700000.00,306000.00,2006000.00,2006000.00,'paid',1,'2026-08-27 13:39:32',1,NULL,NULL,NULL,'','','Please pay by bank transfer to the account on file. Reference the invoice number.',1,'2026-08-27 13:39:32',1,'2026-08-27 13:39:33',0);
/*!40000 ALTER TABLE `customer_invoices` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `customer_receipt_allocations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `customer_receipt_allocations` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `receipt_id` int unsigned NOT NULL,
  `invoice_id` int unsigned NOT NULL,
  `amount_applied` decimal(14,2) NOT NULL,
  `created_on` datetime NOT NULL,
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_cra` (`receipt_id`,`invoice_id`),
  KEY `idx_cra_invoice` (`invoice_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `customer_receipt_allocations` WRITE;
/*!40000 ALTER TABLE `customer_receipt_allocations` DISABLE KEYS */;
INSERT INTO `customer_receipt_allocations` VALUES (1,1,1,1003000.00,'2026-08-27 13:39:32'),(2,2,1,1003000.00,'2026-08-27 13:39:32');
/*!40000 ALTER TABLE `customer_receipt_allocations` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `customer_receipts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `customer_receipts` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `receipt_no` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `customer_id` int unsigned NOT NULL,
  `receipt_date` date NOT NULL,
  `amount` decimal(14,2) NOT NULL,
  `amount_allocated` decimal(14,2) NOT NULL DEFAULT '0.00',
  `currency` varchar(6) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'TZS',
  `payment_method` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'bank_transfer',
  `reference` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'recorded',
  `journal_entry_id` int unsigned DEFAULT NULL,
  `void_by` int unsigned DEFAULT NULL,
  `void_at` datetime DEFAULT NULL,
  `void_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_by` int unsigned DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_cr_receipt_no` (`receipt_no`),
  KEY `idx_cr_customer` (`customer_id`,`status`),
  KEY `idx_cr_date` (`receipt_date`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `customer_receipts` WRITE;
/*!40000 ALTER TABLE `customer_receipts` DISABLE KEYS */;
INSERT INTO `customer_receipts` VALUES (1,1,'RCPT-2026-0001',1,'2026-08-27',1003000.00,1003000.00,'TZS','mobile_money','MPESA-COA21','recorded',2,NULL,NULL,NULL,'',1,'2026-08-27 13:39:32',0),(2,1,'RCPT-2026-0002',1,'2026-08-27',1003000.00,1003000.00,'TZS','bank_transfer','CRDB-COA21','recorded',3,NULL,NULL,NULL,'',1,'2026-08-27 13:39:32',0);
/*!40000 ALTER TABLE `customer_receipts` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `customers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `customers` (
  `c0d` int NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `customer_no` varchar(20) NOT NULL DEFAULT '',
  `customer_code` varchar(10) NOT NULL DEFAULT '',
  `fname` varchar(120) NOT NULL,
  `lname` varchar(120) NOT NULL DEFAULT '',
  `email` varchar(120) NOT NULL DEFAULT '',
  `phone_1` varchar(40) NOT NULL DEFAULT '',
  `phone_2` varchar(40) NOT NULL DEFAULT '',
  `physical_address` text,
  `po_box` varchar(40) NOT NULL DEFAULT '',
  `city` varchar(60) NOT NULL DEFAULT '',
  `country` varchar(60) NOT NULL DEFAULT 'TANZANIA',
  `customer_tin` varchar(40) NOT NULL DEFAULT '',
  `customer_vrn` varchar(40) NOT NULL DEFAULT '',
  `customer_sector` varchar(60) NOT NULL DEFAULT '',
  `customer_tier` varchar(20) NOT NULL DEFAULT 'RETAIL',
  `customer_poc` varchar(120) NOT NULL DEFAULT '',
  `customer_poc_role` varchar(60) NOT NULL DEFAULT '',
  `customer_poc_phone` varchar(40) NOT NULL DEFAULT '',
  `customer_poc_email` varchar(120) NOT NULL DEFAULT '',
  `status` varchar(20) NOT NULL DEFAULT 'ACTIVE',
  `credit_limit` decimal(14,2) NOT NULL DEFAULT '0.00',
  `payment_terms_days` int NOT NULL DEFAULT '0',
  `currency` varchar(6) NOT NULL DEFAULT 'TZS',
  `opening_balance` decimal(14,2) NOT NULL DEFAULT '0.00',
  `account_manager_id` int unsigned DEFAULT NULL,
  `billing_email` varchar(120) NOT NULL DEFAULT '',
  `notes` text,
  `created_by` int NOT NULL DEFAULT '0',
  `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `edited_by` int NOT NULL DEFAULT '0',
  `edited_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_customer_no` (`customer_no`),
  KEY `ix_sector` (`customer_sector`),
  KEY `ix_tier` (`customer_tier`),
  KEY `idx_customers_status` (`status`,`deleted`),
  KEY `idx_customers_tenant` (`tenant_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `customers` WRITE;
/*!40000 ALTER TABLE `customers` DISABLE KEYS */;
INSERT INTO `customers` VALUES (1,1,'00001','TWG-01','Twiga Cement Ltd','Twiga','ap@twiga.co.tz','+255 22 000 0000','','Nyerere Road','','Dar es Salaam','TANZANIA','123-456-789','40-000123-P','CONSTRUCTION','CORPORATE','Aisha Mwakalinga','AP Manager','+255 787 000 000','aisha@twiga.co.tz','ACTIVE',15000000.00,30,'TZS',0.00,NULL,'invoices@twiga.co.tz','Priority customer.',1,'2026-08-23 12:58:54',0,'2026-08-23 12:58:54',0);
/*!40000 ALTER TABLE `customers` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `customers_branches`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `customers_branches` (
  `c0d` int NOT NULL AUTO_INCREMENT,
  `customer_id` int NOT NULL,
  `branch_name` varchar(120) NOT NULL,
  `branch_address` text,
  `region` varchar(80) NOT NULL DEFAULT '',
  `district` varchar(80) NOT NULL DEFAULT '',
  `branch_poc` varchar(120) NOT NULL DEFAULT '',
  `branch_poc_phone` varchar(40) NOT NULL DEFAULT '',
  `created_by` int NOT NULL DEFAULT '0',
  `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `edited_by` int NOT NULL DEFAULT '0',
  `edited_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  KEY `ix_customer` (`customer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `customers_branches` WRITE;
/*!40000 ALTER TABLE `customers_branches` DISABLE KEYS */;
/*!40000 ALTER TABLE `customers_branches` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `doc_number_settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `doc_number_settings` (
  `c0d` int NOT NULL AUTO_INCREMENT,
  `doc_key` varchar(60) NOT NULL,
  `label` varchar(120) NOT NULL DEFAULT '',
  `prefix` varchar(20) NOT NULL DEFAULT '',
  `separator` varchar(4) NOT NULL DEFAULT '-',
  `include_year` tinyint(1) NOT NULL DEFAULT '1',
  `year_position` enum('AFTER_PREFIX','BEFORE_SEQ','AFTER_SEQ') NOT NULL DEFAULT 'AFTER_PREFIX',
  `seq_width` tinyint NOT NULL DEFAULT '4',
  `start_no` int NOT NULL DEFAULT '1',
  `next_no` int NOT NULL DEFAULT '1',
  `reset_scope` enum('NEVER','YEARLY','MONTHLY') NOT NULL DEFAULT 'YEARLY',
  `current_year` int NOT NULL DEFAULT '0',
  `current_month` tinyint NOT NULL DEFAULT '0',
  `example` varchar(80) NOT NULL DEFAULT '',
  `notes` varchar(500) NOT NULL DEFAULT '',
  `created_by` int NOT NULL DEFAULT '0',
  `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `edited_by` int NOT NULL DEFAULT '0',
  `edited_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_doc_key` (`doc_key`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `doc_number_settings` WRITE;
/*!40000 ALTER TABLE `doc_number_settings` DISABLE KEYS */;
INSERT INTO `doc_number_settings` VALUES (1,'LPO','Local Purchase Order','LPO','-',1,'AFTER_PREFIX',4,1,1,'YEARLY',2026,0,'','Allocated only on chain terminal APPROVED (Slice 8d).',0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(2,'PV','Payment Voucher','PV','-',1,'AFTER_PREFIX',4,1,1,'YEARLY',2026,0,'','Allocated by PaymentVouchers::prepFromLpo.',0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(3,'PAYMENT','Bank Payment','PAY','-',1,'AFTER_PREFIX',4,1,1,'YEARLY',2026,0,'','Allocated by PaymentVouchers::recordPayment.',0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(4,'CR','Consolidated Request','CR','-',1,'AFTER_PREFIX',4,1,1,'YEARLY',2026,0,'','Works CR against a phase.',0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(5,'IPC','Interim Payment Certificate','IPC','-',1,'AFTER_PREFIX',4,1,1,'YEARLY',2026,0,'','IPC per project — project component prepended separately in code.',0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(6,'SCRUB','PC 7-pillar Scrub','SCR','-',1,'AFTER_PREFIX',4,1,1,'YEARLY',2026,0,'','Slice 8h scrub pack per Client PO.',0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(7,'CLIENT_PO','Customer Client PO','CPO','-',1,'AFTER_PREFIX',4,1,1,'YEARLY',2026,0,'','CRM-authored per Slice 8g.',0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(8,'SALE','Sales Invoice','SI','-',1,'AFTER_PREFIX',4,1,1,'YEARLY',2026,0,'','Allocated by Sales::allocateAndAck on terminal.',0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(9,'RECEIPT','Customer Receipt','RCP','-',1,'AFTER_PREFIX',4,1,1,'YEARLY',2026,0,'','Allocated by Receipts::record.',0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(10,'PROJECT','Project number','P','-',1,'AFTER_PREFIX',4,1,1,'YEARLY',2026,0,'','Allocated by Projects::create.',0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0);
/*!40000 ALTER TABLE `doc_number_settings` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `driver_doc_types`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `driver_doc_types` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `slug` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
  `display_name` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL,
  `has_expiry` tinyint(1) NOT NULL DEFAULT '1',
  `warn_days` int NOT NULL DEFAULT '30',
  `required` tinyint(1) NOT NULL DEFAULT '1',
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `sort_order` int NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_driver_doc_types_slug` (`tenant_id`,`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `driver_doc_types` WRITE;
/*!40000 ALTER TABLE `driver_doc_types` DISABLE KEYS */;
INSERT INTO `driver_doc_types` VALUES (1,1,'licence','Driver\'s Licence',1,30,1,1,10),(2,1,'national_id','National ID (NIDA)',0,0,1,1,20),(3,1,'medical','Medical Fitness Certificate',1,30,1,1,30),(4,1,'contract','Employment Contract',0,0,0,1,40),(5,1,'ppe_issue','PPE Issue Record',0,0,0,1,50),(6,1,'training','Defensive-Driving Training',1,365,0,1,60),(7,1,'psv_licence','PSV / Commercial Endorsement',1,30,0,1,70),(8,1,'passport','Passport',1,90,0,1,80);
/*!40000 ALTER TABLE `driver_doc_types` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `driver_docs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `driver_docs` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `driver_id` int unsigned NOT NULL,
  `doc_type_id` int unsigned NOT NULL,
  `doc_no` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `issuer` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `issued_on` date DEFAULT NULL,
  `expires_on` date DEFAULT NULL,
  `file_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file_size` int unsigned DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_by` int unsigned DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `edited_by` int unsigned DEFAULT NULL,
  `edited_on` datetime DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  KEY `idx_driver_docs_driver` (`driver_id`,`deleted`),
  KEY `idx_driver_docs_expiry` (`expires_on`,`deleted`),
  KEY `idx_driver_docs_type` (`doc_type_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `driver_docs` WRITE;
/*!40000 ALTER TABLE `driver_docs` DISABLE KEYS */;
INSERT INTO `driver_docs` VALUES (1,1,100,1,'DL-URGENT','TZ Roads',NULL,'2026-09-06',NULL,NULL,NULL,'test: 8-14d',NULL,'2026-08-27 13:43:10',NULL,NULL,0),(2,1,100,3,'MED-EXPIRED','Aga Khan Hospital',NULL,'2026-08-24',NULL,NULL,NULL,'test: expired',NULL,'2026-08-27 13:43:10',NULL,NULL,0);
/*!40000 ALTER TABLE `driver_docs` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `driver_truck_assignments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `driver_truck_assignments` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `driver_id` int unsigned NOT NULL,
  `truck_id` int unsigned NOT NULL,
  `assigned_from` date NOT NULL,
  `assigned_to` date DEFAULT NULL,
  `role_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'primary',
  `reason` varchar(160) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `ended_by` int unsigned DEFAULT NULL,
  `end_reason` varchar(160) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_by` int unsigned DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `edited_by` int unsigned DEFAULT NULL,
  `edited_on` datetime DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  KEY `idx_dta_driver` (`driver_id`,`deleted`,`assigned_to`),
  KEY `idx_dta_truck` (`truck_id`,`deleted`,`assigned_to`),
  KEY `idx_dta_active` (`assigned_to`,`deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `driver_truck_assignments` WRITE;
/*!40000 ALTER TABLE `driver_truck_assignments` DISABLE KEYS */;
INSERT INTO `driver_truck_assignments` VALUES (1,1,100,100,'2026-08-23',NULL,'primary','Smoke test','',NULL,NULL,1,'2026-08-23 15:32:01',NULL,NULL,0);
/*!40000 ALTER TABLE `driver_truck_assignments` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `drivers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `drivers` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `employee_no` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `full_name` varchar(120) COLLATE utf8mb4_unicode_ci NOT NULL,
  `id_no` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone_1` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone_2` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dob` date DEFAULT NULL,
  `gender` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(60) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `country` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'TANZANIA',
  `next_of_kin_name` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `next_of_kin_phone` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `licence_no` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `licence_class` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `licence_expires` date DEFAULT NULL,
  `hire_date` date DEFAULT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'available',
  `branch_id` int unsigned DEFAULT NULL,
  `photo_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `blood_group` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_by` int unsigned DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `edited_by` int unsigned DEFAULT NULL,
  `edited_on` datetime DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `mobile_password_hash` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mobile_login_enabled` tinyint(1) NOT NULL DEFAULT '0',
  `mobile_last_login_at` datetime DEFAULT NULL,
  `monthly_salary` decimal(14,2) NOT NULL DEFAULT '0.00',
  `commission_pct` decimal(5,2) NOT NULL DEFAULT '0.00',
  `health_ins_amount` decimal(10,2) NOT NULL DEFAULT '0.00',
  `nssf_ee_pct` decimal(5,2) NOT NULL DEFAULT '10.00',
  `bank_account_no` varchar(60) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mobile_money_msisdn` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`c0d`),
  KEY `idx_drivers_name` (`full_name`),
  KEY `idx_drivers_status` (`status`,`deleted`),
  KEY `idx_drivers_licence` (`licence_expires`),
  KEY `idx_drivers_deleted` (`deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `drivers` WRITE;
/*!40000 ALTER TABLE `drivers` DISABLE KEYS */;
INSERT INTO `drivers` VALUES (100,1,'EMP-100','Demo Driver',NULL,'+255700000000',NULL,NULL,NULL,NULL,NULL,NULL,'TANZANIA',NULL,NULL,'TZ-000000','C',NULL,NULL,'available',NULL,NULL,NULL,NULL,1,'2026-08-23 15:32:00',NULL,NULL,0,'$2y$10$YRU9s7lPHNx6W90eN5a3MOl1NWoLh6PbOLwtRZsdrUEpTQZQsrsmu',1,'2026-08-27 10:17:14',800000.00,5.00,20000.00,10.00,'CRDB-000-000-123',NULL);
/*!40000 ALTER TABLE `drivers` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `email_outbox`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `email_outbox` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `to_email` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `to_name` varchar(160) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cc_emails` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `subject` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `body_html` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `body_text` mediumtext COLLATE utf8mb4_unicode_ci,
  `attachments_json` json DEFAULT NULL,
  `alert_id` int unsigned DEFAULT NULL,
  `source_type` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `source_id` int unsigned DEFAULT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'queued',
  `attempts` tinyint unsigned NOT NULL DEFAULT '0',
  `max_attempts` tinyint unsigned NOT NULL DEFAULT '3',
  `last_error` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `scheduled_for` datetime DEFAULT NULL,
  `sent_at` datetime DEFAULT NULL,
  `created_by` int unsigned DEFAULT NULL,
  `created_on` datetime NOT NULL,
  PRIMARY KEY (`c0d`),
  KEY `idx_eo_status` (`status`,`created_on`),
  KEY `idx_eo_alert` (`alert_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `email_outbox` WRITE;
/*!40000 ALTER TABLE `email_outbox` DISABLE KEYS */;
INSERT INTO `email_outbox` VALUES (1,1,'ops@pacific.test',NULL,NULL,'[Pacific Alert] Over-speed · 95 kph','<h3 style=\'font-family:sans-serif;color:#1E3A5F;\'>Over-speed · 95 kph</h3><p style=\'font-family:sans-serif;\'>Speed 95 kph exceeds limit 80 kph.</p><p style=\'font-family:sans-serif;font-size:12px;color:#666;\'>Pacific Logistics · Fleet Alerts</p>','Over-speed · 95 kphSpeed 95 kph exceeds limit 80 kph.Pacific Logistics · Fleet Alerts',NULL,1,'alert',1,'failed',3,3,'mail() returned false',NULL,NULL,NULL,'2026-08-27 09:44:45'),(2,1,'ops@pacific.test',NULL,NULL,'[Pacific Alert] Over-speed · 105 kph','<h3 style=\'font-family:sans-serif;color:#1E3A5F;\'>Over-speed · 105 kph</h3><p style=\'font-family:sans-serif;\'>Speed 105 kph exceeds limit 80 kph.</p><p style=\'font-family:sans-serif;font-size:12px;color:#666;\'>Pacific Logistics · Fleet Alerts</p>','Over-speed · 105 kphSpeed 105 kph exceeds limit 80 kph.Pacific Logistics · Fleet Alerts',NULL,3,'alert',3,'failed',3,3,'mail() returned false',NULL,NULL,NULL,'2026-08-27 09:44:45');
/*!40000 ALTER TABLE `email_outbox` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `expense_approvals`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `expense_approvals` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `expense_id` int unsigned NOT NULL,
  `from_status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `to_status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `actor_id` int unsigned DEFAULT NULL,
  `actor_name` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `action_at` datetime NOT NULL,
  `note` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`c0d`),
  KEY `idx_ea_expense` (`expense_id`,`action_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `expense_approvals` WRITE;
/*!40000 ALTER TABLE `expense_approvals` DISABLE KEYS */;
/*!40000 ALTER TABLE `expense_approvals` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `expense_types`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `expense_types` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `slug` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
  `display_name` varchar(120) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `gl_debit_account_id` int unsigned DEFAULT NULL,
  `scope` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'general',
  `requires_truck` tinyint(1) NOT NULL DEFAULT '0',
  `requires_driver` tinyint(1) NOT NULL DEFAULT '0',
  `requires_vendor` tinyint(1) NOT NULL DEFAULT '0',
  `requires_trip` tinyint(1) NOT NULL DEFAULT '0',
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `sort_order` int NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_expense_types_slug` (`tenant_id`,`slug`),
  KEY `idx_expense_types_active` (`active`)
) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `expense_types` WRITE;
/*!40000 ALTER TABLE `expense_types` DISABLE KEYS */;
INSERT INTO `expense_types` VALUES (1,1,'fuel','Fuel',NULL,53,'fuel',1,1,0,0,1,10),(2,1,'toll_charges','Toll Charges',NULL,53,'general',1,0,0,1,1,20),(3,1,'weighbridge_fee','Weighbridge Fee',NULL,53,'general',1,0,0,1,1,30),(4,1,'loading_offloading','Loading / Offloading',NULL,53,'general',1,0,0,1,1,40),(5,1,'parking_fee','Parking Fee',NULL,53,'general',1,0,0,0,1,50),(6,1,'border_fee','Border / Immigration Fee',NULL,53,'general',1,0,0,1,1,60),(7,1,'repair_maintenance','Repair & Maintenance',NULL,53,'maintenance',1,0,1,0,1,110),(8,1,'spare_parts','Spare Parts',NULL,53,'maintenance',1,0,1,0,1,120),(9,1,'tyres','Tyres',NULL,53,'maintenance',1,0,1,0,1,130),(10,1,'batteries','Batteries',NULL,53,'maintenance',1,0,1,0,1,140),(11,1,'lubricants','Lubricants / Oils',NULL,53,'maintenance',1,0,1,0,1,150),(12,1,'workshop_consumables','Workshop Consumables',NULL,53,'maintenance',0,0,1,0,1,160),(13,1,'external_workshop','External Workshop Service',NULL,53,'maintenance',1,0,1,0,1,170),(14,1,'car_wash','Car Wash & Cleaning',NULL,53,'general',1,0,0,0,1,180),(15,1,'driver_salary','Driver Salary',NULL,53,'driver',0,1,0,0,1,210),(16,1,'driver_overtime','Driver Overtime',NULL,53,'driver',0,1,0,0,1,220),(17,1,'driver_allowance','Driver Allowance / Per Diem',NULL,53,'driver',0,1,0,0,1,230),(18,1,'driver_bonus','Driver Bonus',NULL,53,'driver',0,1,0,0,1,240),(19,1,'driver_ppe','Driver Uniforms & PPE',NULL,53,'driver',0,1,0,0,1,250),(20,1,'driver_training','Driver Training',NULL,53,'driver',0,1,0,0,1,260),(21,1,'driver_medical','Driver Medical',NULL,53,'driver',0,1,0,0,1,270),(22,1,'vehicle_insurance','Vehicle Insurance Premium',NULL,53,'insurance',1,0,1,0,1,310),(23,1,'vehicle_licence','Vehicle Licence & Permits',NULL,53,'general',1,0,0,0,1,320),(24,1,'road_toll_subscription','Road Toll Subscription',NULL,53,'general',1,0,0,0,1,330),(25,1,'inspection_fee','Vehicle Inspection Fee',NULL,53,'general',1,0,0,0,1,340),(26,1,'psv_licence','PSV Licence Renewal',NULL,53,'general',1,0,0,0,1,350),(27,1,'office_salary','Office Salaries & Wages',NULL,53,'admin',0,0,0,0,1,410),(28,1,'rent','Rent',NULL,53,'admin',0,0,1,0,1,420),(29,1,'utilities','Utilities',NULL,53,'admin',0,0,1,0,1,430),(30,1,'telephone_internet','Telephone & Internet',NULL,53,'admin',0,0,1,0,1,440),(31,1,'office_supplies','Office Supplies & Stationery',NULL,53,'admin',0,0,1,0,1,450),(32,1,'professional_fees','Professional Fees',NULL,53,'admin',0,0,1,0,1,460),(33,1,'bank_charges','Bank Charges',NULL,53,'admin',0,0,0,0,1,470),(34,1,'it_software','IT & Software',NULL,53,'admin',0,0,1,0,1,480),(35,1,'travel_entertainment','Travel & Entertainment',NULL,53,'admin',0,0,0,0,1,490),(36,1,'fines_penalties','Fines & Penalties',NULL,53,'general',0,0,0,0,1,920),(37,1,'miscellaneous','Miscellaneous',NULL,53,'general',0,0,0,0,1,990);
/*!40000 ALTER TABLE `expense_types` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `expenses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `expenses` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `expense_no` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `expense_type_id` int unsigned NOT NULL,
  `expense_date` date NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `net_amount` decimal(14,2) NOT NULL DEFAULT '0.00',
  `vat_amount` decimal(14,2) NOT NULL DEFAULT '0.00',
  `gross_amount` decimal(14,2) NOT NULL DEFAULT '0.00',
  `currency` varchar(6) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'TZS',
  `fx_rate` decimal(20,6) NOT NULL DEFAULT '1.000000',
  `truck_id` int unsigned DEFAULT NULL,
  `driver_id` int unsigned DEFAULT NULL,
  `trip_id` int unsigned DEFAULT NULL,
  `trip_request_id` int unsigned DEFAULT NULL,
  `customer_id` int unsigned DEFAULT NULL,
  `vendor_id` int unsigned DEFAULT NULL,
  `cost_centre_id` int unsigned DEFAULT NULL,
  `branch_id` int unsigned DEFAULT NULL,
  `payment_method` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_reference` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `receipt_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `receipt_file_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `receipt_file_size` int unsigned DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
  `submitted_by` int unsigned DEFAULT NULL,
  `submitted_at` datetime DEFAULT NULL,
  `reviewed_by` int unsigned DEFAULT NULL,
  `reviewed_at` datetime DEFAULT NULL,
  `approved_by` int unsigned DEFAULT NULL,
  `approved_at` datetime DEFAULT NULL,
  `paid_by` int unsigned DEFAULT NULL,
  `paid_at` datetime DEFAULT NULL,
  `rejected_by` int unsigned DEFAULT NULL,
  `rejected_at` datetime DEFAULT NULL,
  `rejection_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `accrual_je_id` int unsigned DEFAULT NULL,
  `payment_je_id` int unsigned DEFAULT NULL,
  `created_by` int unsigned DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `edited_by` int unsigned DEFAULT NULL,
  `edited_on` datetime DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_expense_no` (`expense_no`),
  KEY `idx_expenses_status` (`status`,`deleted`),
  KEY `idx_expenses_date` (`expense_date`),
  KEY `idx_expenses_type` (`expense_type_id`),
  KEY `idx_expenses_truck` (`truck_id`),
  KEY `idx_expenses_driver` (`driver_id`),
  KEY `idx_expenses_trip` (`trip_id`),
  KEY `idx_expenses_customer` (`customer_id`),
  KEY `idx_expenses_vendor` (`vendor_id`),
  KEY `idx_expenses_created` (`created_by`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `expenses` WRITE;
/*!40000 ALTER TABLE `expenses` DISABLE KEYS */;
/*!40000 ALTER TABLE `expenses` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `fin_approval_log`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `fin_approval_log` (
  `c0d` int NOT NULL AUTO_INCREMENT,
  `approval_id` int NOT NULL,
  `from_step_id` int DEFAULT NULL,
  `to_step_id` int DEFAULT NULL,
  `decision` varchar(20) NOT NULL,
  `decided_by` int NOT NULL,
  `decided_by_name` varchar(160) NOT NULL DEFAULT '',
  `decided_by_group` varchar(60) NOT NULL DEFAULT '',
  `decided_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `comment` text,
  PRIMARY KEY (`c0d`),
  KEY `ix_approval` (`approval_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `fin_approval_log` WRITE;
/*!40000 ALTER TABLE `fin_approval_log` DISABLE KEYS */;
/*!40000 ALTER TABLE `fin_approval_log` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `fin_approvals`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `fin_approvals` (
  `c0d` int NOT NULL AUTO_INCREMENT,
  `chain_id` int NOT NULL,
  `entity_type` varchar(60) NOT NULL,
  `entity_id` int NOT NULL,
  `current_step_id` int DEFAULT NULL,
  `status` varchar(20) NOT NULL DEFAULT 'IN_PROGRESS',
  `ref_label` varchar(200) NOT NULL DEFAULT '',
  `summary_json` text,
  `return_url` varchar(255) DEFAULT NULL,
  `submitted_by` int NOT NULL DEFAULT '0',
  `submitted_by_name` varchar(160) DEFAULT NULL,
  `submitted_on` timestamp NULL DEFAULT NULL,
  `decided_on` timestamp NULL DEFAULT NULL,
  `created_by` int NOT NULL DEFAULT '0',
  `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `edited_by` int NOT NULL DEFAULT '0',
  `edited_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  KEY `ix_chain` (`chain_id`),
  KEY `ix_entity` (`entity_type`,`entity_id`),
  KEY `ix_step` (`current_step_id`),
  KEY `ix_status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `fin_approvals` WRITE;
/*!40000 ALTER TABLE `fin_approvals` DISABLE KEYS */;
/*!40000 ALTER TABLE `fin_approvals` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `fin_chain_defs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `fin_chain_defs` (
  `c0d` int NOT NULL AUTO_INCREMENT,
  `chain_key` varchar(80) NOT NULL,
  `title` varchar(160) NOT NULL,
  `description` text,
  `status` varchar(20) NOT NULL DEFAULT 'ACTIVE',
  `created_by` int NOT NULL DEFAULT '0',
  `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `edited_by` int NOT NULL DEFAULT '0',
  `edited_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_chain_key` (`chain_key`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `fin_chain_defs` WRITE;
/*!40000 ALTER TABLE `fin_chain_defs` DISABLE KEYS */;
INSERT INTO `fin_chain_defs` VALUES (1,'HR_PAYROLL_APPROVAL','HR Payroll Run Approval','Monthly payroll batch — HR prepares & computes; FM reviews totals; Exec signs off before posting to cashbook + statutory accruals.','ACTIVE',0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(2,'HR_LEAVE_APPROVAL','HR Leave Request Approval','Employee leave request — HR reviews, deducts balance on approval.','ACTIVE',0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(3,'HR_TERMINATION_APPROVAL','HR Termination & Final-Dues','Exit lifecycle — HR computes final dues (leave payout + gratuity + other), FM verifies, Exec authorises payout.','ACTIVE',0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(4,'GOODS_LPO_APPROVAL','Goods LPO Batch Approval','Procurement submits the auto-drafted LPO batch (one chain run per PO covers every supplier LPO). PC → PM → FM → Exec sign off; on approval, Procurement can Issue each LPO.','ACTIVE',0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(5,'GOODS_CUSTOMER_INVOICE','Goods Customer Invoice','PC → PM → Accountant review of a Procurement-drafted customer invoice. Accountant ack allocates sale_no and posts revenue journal.','ACTIVE',0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(6,'SERVICE_PM_APPROVAL','Service PM Plan Approval','PC generates Client POs + ticks items for procurement, then submits. Chain: PM check → Procurement sources → PM margin check → FM → Exec. On terminal approval, draft LPOs auto-approve for Procurement to issue.','ACTIVE',0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(9,'CRM_PROJECT_ONBOARDING','CRM Project Onboarding','Gate that ensures every project passes a formal CRM step before Ops can act on it.','ACTIVE',0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0);
/*!40000 ALTER TABLE `fin_chain_defs` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `fin_chain_steps`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `fin_chain_steps` (
  `c0d` int NOT NULL AUTO_INCREMENT,
  `chain_id` int NOT NULL,
  `step_no` int NOT NULL,
  `step_key` varchar(60) NOT NULL,
  `step_label` varchar(120) NOT NULL,
  `role_required` varchar(60) NOT NULL,
  `is_terminal` tinyint(1) NOT NULL DEFAULT '0',
  `description` text,
  `sort_order` int NOT NULL DEFAULT '0',
  `created_by` int NOT NULL DEFAULT '0',
  `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `edited_by` int NOT NULL DEFAULT '0',
  `edited_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  KEY `ix_chain` (`chain_id`),
  KEY `ix_role_req` (`role_required`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `fin_chain_steps` WRITE;
/*!40000 ALTER TABLE `fin_chain_steps` DISABLE KEYS */;
INSERT INTO `fin_chain_steps` VALUES (1,1,1,'HR_REVIEW','HR Review','HUMAN RESOURCES',0,'HR confirms employees, totals look right',1,0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(2,1,2,'FM_REVIEW','FM Review','FINANCE MANAGER',0,'Finance Manager verifies cost-to-company and bank funds',2,0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(3,1,3,'EXEC','Exec Approval','EXECUTIVE',1,'Final sign-off before payroll posts',3,0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(4,2,1,'HR_REVIEW','HR Review','HUMAN RESOURCES',1,'HR reviews, checks balance, approves or declines.',1,0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(5,3,1,'HR_REVIEW','HR Review','HUMAN RESOURCES',0,'HR confirms dues snapshot is correct',1,0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(6,3,2,'FM_REVIEW','FM Review','FINANCE MANAGER',0,'Finance Manager verifies amounts and bank funds',2,0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(7,3,3,'EXEC','Exec Approval','EXECUTIVE',1,'Final authorisation before payout posts',3,0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(8,4,1,'PC_REVIEW','PC Review','PROJECTS COORDINATOR',0,'Project Coordinator verifies LPO batch matches sourcing awards',1,0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(9,4,2,'PM_APPROVE','PM Approval','PROJECT MANAGER',0,'PM confirms supplier terms acceptable',2,0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(10,4,3,'FM_REVIEW','FM Review','FINANCE MANAGER',0,'Finance Manager checks totals against approved budget',3,0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(11,4,4,'EXEC','Exec Decision','EXECUTIVE',1,'Final sign-off before LPOs can be issued to suppliers',4,0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(12,5,1,'PC_REVIEW','PC Review','PROJECTS COORDINATOR',0,'PC verifies invoice matches deliveries',1,0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(13,5,2,'PM_REVIEW','PM Review','PROJECT MANAGER',0,'PM approves invoice + margin',2,0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(14,5,3,'ACCT_ACK','Accountant Ack','ACCOUNTANT',1,'Accountant allocates sale_no + posts revenue journal',3,0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(15,6,1,'PM_CHECK','PM Check','PROJECT MANAGER',0,'Project Manager reviews scope, packs and dates',1,0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(16,6,2,'PROC_SOURCE','Procurement Sourcing','PROCUREMENT',0,'Procurement routes each PR item, creates RFQs, awards suppliers, drafts LPOs',2,0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(17,6,3,'PM_MARGIN','PM Margin Check','PROJECT MANAGER',0,'PM verifies real supplier cost vs client price; approves if margin is acceptable',3,0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(18,6,4,'FM_APPROVE','FM Approve','FINANCE MANAGER',0,'Finance approves plan totals and budget alignment',4,0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(19,6,5,'EXEC_AUTH','Exec Authorize','EXECUTIVE',1,'Executive authorisation — auto-approves draft LPOs so Procurement can issue',5,0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(20,9,1,'PC_ACCEPT','PC Accept','PROJECTS COORDINATOR',0,'Projects Coordinator reviews contract + checklist + snapshot and accepts.',1,0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(21,9,2,'EXEC_APPROVE','Executive Approve','EXECUTIVE',1,'Executive signs off — onboarding APPROVED; Ops gates open.',2,0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0);
/*!40000 ALTER TABLE `fin_chain_steps` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `fuel_entries`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `fuel_entries` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `entry_no` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `entry_date` date NOT NULL,
  `entry_time` time DEFAULT NULL,
  `truck_id` int unsigned NOT NULL,
  `driver_id` int unsigned DEFAULT NULL,
  `trip_id` int unsigned DEFAULT NULL,
  `station_name` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `station_location` varchar(160) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fuel_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'diesel',
  `liters` decimal(10,3) NOT NULL DEFAULT '0.000',
  `price_per_liter` decimal(10,2) NOT NULL DEFAULT '0.00',
  `gross_amount` decimal(14,2) NOT NULL DEFAULT '0.00',
  `currency` varchar(6) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'TZS',
  `odometer_reading` int unsigned DEFAULT NULL,
  `payment_method` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'cash',
  `payment_reference` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `receipt_no` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `receipt_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `receipt_file_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sensor_event_id` int unsigned DEFAULT NULL,
  `sensor_fill_liters` decimal(10,3) DEFAULT NULL,
  `sensor_variance_l` decimal(10,3) DEFAULT NULL,
  `variance_status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `variance_note` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'posted',
  `je_id` int unsigned DEFAULT NULL,
  `void_je_id` int unsigned DEFAULT NULL,
  `void_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `voided_by` int unsigned DEFAULT NULL,
  `voided_at` datetime DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_by` int unsigned DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `edited_by` int unsigned DEFAULT NULL,
  `edited_on` datetime DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_fuel_entry_no` (`entry_no`),
  KEY `idx_fuel_truck` (`truck_id`,`entry_date`),
  KEY `idx_fuel_driver` (`driver_id`,`entry_date`),
  KEY `idx_fuel_trip` (`trip_id`),
  KEY `idx_fuel_status` (`status`,`deleted`),
  KEY `idx_fuel_variance` (`variance_status`),
  KEY `idx_fuel_date` (`entry_date`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `fuel_entries` WRITE;
/*!40000 ALTER TABLE `fuel_entries` DISABLE KEYS */;
INSERT INTO `fuel_entries` VALUES (1,1,'FUEL-00001','2026-08-27',NULL,100,NULL,NULL,'Puma Ubungo','','diesel',50.000,4000.00,200000.00,'TZS',NULL,'cash','','','','',NULL,NULL,NULL,'pending',NULL,'posted',4,NULL,NULL,NULL,NULL,'',1,'2026-08-27 13:39:33',1,'2026-08-27 13:39:33',0),(2,1,'FUEL-00002','2026-08-27',NULL,100,NULL,NULL,'Puma card','','diesel',90.000,3888.89,350000.00,'TZS',NULL,'fuel_card','','','','',NULL,NULL,NULL,'pending',NULL,'posted',5,NULL,NULL,NULL,NULL,'',1,'2026-08-27 13:39:33',1,'2026-08-27 13:39:33',0);
/*!40000 ALTER TABLE `fuel_entries` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `fuel_sensor_events`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `fuel_sensor_events` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `device_id` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `truck_id` int unsigned NOT NULL,
  `event_ts` datetime NOT NULL,
  `event_kind` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `level_before_l` decimal(10,3) DEFAULT NULL,
  `level_after_l` decimal(10,3) DEFAULT NULL,
  `delta_l` decimal(10,3) DEFAULT NULL,
  `lat` decimal(10,6) DEFAULT NULL,
  `lng` decimal(10,6) DEFAULT NULL,
  `matched_fuel_entry_id` int unsigned DEFAULT NULL,
  `matched_at` datetime DEFAULT NULL,
  `matched_by` int unsigned DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  PRIMARY KEY (`c0d`),
  KEY `idx_fse_truck` (`truck_id`,`event_ts`),
  KEY `idx_fse_kind` (`event_kind`,`event_ts`),
  KEY `idx_fse_matched` (`matched_fuel_entry_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `fuel_sensor_events` WRITE;
/*!40000 ALTER TABLE `fuel_sensor_events` DISABLE KEYS */;
/*!40000 ALTER TABLE `fuel_sensor_events` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `geofence_events`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `geofence_events` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `geofence_id` int unsigned NOT NULL,
  `device_id` int unsigned NOT NULL,
  `truck_id` int unsigned DEFAULT NULL,
  `trip_id` int unsigned DEFAULT NULL,
  `ts` datetime NOT NULL,
  `kind` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `dwell_minutes` int unsigned DEFAULT NULL,
  `position_id` int unsigned DEFAULT NULL,
  PRIMARY KEY (`c0d`),
  KEY `idx_gfe_geofence` (`geofence_id`,`ts`),
  KEY `idx_gfe_device` (`device_id`,`ts`),
  KEY `idx_gfe_trip` (`trip_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `geofence_events` WRITE;
/*!40000 ALTER TABLE `geofence_events` DISABLE KEYS */;
/*!40000 ALTER TABLE `geofence_events` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `geofences`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `geofences` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `name` varchar(160) COLLATE utf8mb4_unicode_ci NOT NULL,
  `kind` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'depot',
  `geometry_json` json DEFAULT NULL,
  `center_lat` decimal(10,6) DEFAULT NULL,
  `center_lng` decimal(10,6) DEFAULT NULL,
  `radius_m` int unsigned DEFAULT NULL,
  `color` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT '#1E3A5F',
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `customer_id` int unsigned DEFAULT NULL,
  `trigger_alert` tinyint(1) NOT NULL DEFAULT '0',
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_by` int unsigned DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `edited_by` int unsigned DEFAULT NULL,
  `edited_on` datetime DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  KEY `idx_gf_active` (`active`,`deleted`),
  KEY `idx_gf_kind` (`kind`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `geofences` WRITE;
/*!40000 ALTER TABLE `geofences` DISABLE KEYS */;
INSERT INTO `geofences` VALUES (1,1,'Ubungo depot','depot',NULL,-6.792400,39.208300,500,'#1E3A5F',1,NULL,1,'Test fence',1,'2026-08-27 09:44:34',NULL,NULL,0);
/*!40000 ALTER TABLE `geofences` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `gps_devices`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `gps_devices` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `device_code` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
  `device_type` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'teltonika_fmc920',
  `protocol` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'codec_8e',
  `truck_id` int unsigned DEFAULT NULL,
  `sim_msisdn` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sim_iccid` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `installed_on` date DEFAULT NULL,
  `firmware_ver` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fuel_sensor` tinyint(1) NOT NULL DEFAULT '0',
  `dashcam` tinyint(1) NOT NULL DEFAULT '0',
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `last_seen_at` datetime DEFAULT NULL,
  `last_position_id` int unsigned DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_by` int unsigned DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `edited_by` int unsigned DEFAULT NULL,
  `edited_on` datetime DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_device_code` (`device_code`),
  KEY `idx_gd_truck` (`truck_id`),
  KEY `idx_gd_status` (`status`,`deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `gps_devices` WRITE;
/*!40000 ALTER TABLE `gps_devices` DISABLE KEYS */;
INSERT INTO `gps_devices` VALUES (1,1,'352093088111111','teltonika_fmc920','codec_8e',100,'+255712345678',NULL,NULL,NULL,0,0,'active','2026-08-27 09:00:35',3,NULL,NULL,'2026-08-27 09:22:58',NULL,NULL,0),(2,1,'352093088222222','unknown','traccar',NULL,NULL,NULL,NULL,NULL,0,0,'inactive',NULL,NULL,'Auto-registered from ingestion — assign a truck to activate.',NULL,'2026-08-27 09:23:09',NULL,NULL,0),(3,1,'MOBILE-D100-T100','mobile_phone','osmand',100,NULL,NULL,NULL,NULL,0,0,'active','2026-08-27 10:10:05',5,'Auto-registered mobile-app device.',NULL,'2026-08-27 10:09:00',NULL,NULL,0);
/*!40000 ALTER TABLE `gps_devices` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `gps_events`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `gps_events` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `device_id` int unsigned NOT NULL,
  `truck_id` int unsigned DEFAULT NULL,
  `trip_id` int unsigned DEFAULT NULL,
  `ts` datetime NOT NULL,
  `kind` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `severity` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'info',
  `lat` decimal(10,6) DEFAULT NULL,
  `lng` decimal(10,6) DEFAULT NULL,
  `speed_kph` decimal(6,2) DEFAULT NULL,
  `payload_json` json DEFAULT NULL,
  `position_id` int unsigned DEFAULT NULL,
  `created_on` datetime NOT NULL,
  PRIMARY KEY (`c0d`),
  KEY `idx_ge_device_ts` (`device_id`,`ts`),
  KEY `idx_ge_truck_ts` (`truck_id`,`ts`),
  KEY `idx_ge_kind` (`kind`,`ts`),
  KEY `idx_ge_trip` (`trip_id`),
  KEY `idx_gps_ev_ts` (`ts` DESC),
  KEY `idx_gps_ev_truck_ts` (`truck_id`,`ts` DESC),
  KEY `idx_gps_ev_trip_ts` (`trip_id`,`ts` DESC)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `gps_events` WRITE;
/*!40000 ALTER TABLE `gps_events` DISABLE KEYS */;
INSERT INTO `gps_events` VALUES (1,1,100,NULL,'2024-08-27 08:00:00','geofence_enter','info',-6.792400,39.208300,10.00,'{\"kind\": \"geofence_enter\", \"severity\": \"info\", \"geofence_id\": 1, \"geofence_name\": \"Ubungo depot\"}',1,'2026-08-27 09:44:44'),(2,1,100,NULL,'2024-08-27 08:01:00','over_speed','medium',-6.810000,39.250000,95.00,'{\"kind\": \"over_speed\", \"speed\": 95, \"severity\": \"medium\"}',2,'2026-08-27 09:44:45'),(3,1,100,NULL,'2024-08-27 08:01:00','geofence_exit','info',-6.810000,39.250000,95.00,'{\"kind\": \"geofence_exit\", \"severity\": \"info\", \"geofence_id\": 1}',2,'2026-08-27 09:44:45'),(4,1,100,NULL,'2024-08-27 08:02:00','over_speed','medium',-6.820000,39.260000,105.00,'{\"kind\": \"over_speed\", \"speed\": 105, \"severity\": \"medium\"}',3,'2026-08-27 09:44:45'),(5,3,100,NULL,'2024-08-27 08:00:00','geofence_enter','info',-6.792400,39.208300,45.00,'{\"kind\": \"geofence_enter\", \"severity\": \"info\", \"geofence_id\": 1, \"geofence_name\": \"Ubungo depot\"}',4,'2026-08-27 10:09:00'),(6,3,100,NULL,'2024-08-27 08:00:00','geofence_exit','info',-6.800000,39.250000,42.00,'{\"kind\": \"geofence_exit\", \"severity\": \"info\", \"geofence_id\": 1}',5,'2026-08-27 10:10:05');
/*!40000 ALTER TABLE `gps_events` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `gps_positions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `gps_positions` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `device_id` int unsigned NOT NULL,
  `truck_id` int unsigned DEFAULT NULL,
  `ts` datetime NOT NULL,
  `server_ts` datetime NOT NULL,
  `lat` decimal(10,6) NOT NULL,
  `lng` decimal(10,6) NOT NULL,
  `altitude_m` decimal(8,2) DEFAULT NULL,
  `speed_kph` decimal(6,2) DEFAULT NULL,
  `heading_deg` decimal(6,2) DEFAULT NULL,
  `valid` tinyint(1) NOT NULL DEFAULT '1',
  `ignition` tinyint(1) DEFAULT NULL,
  `odometer_can_km` int unsigned DEFAULT NULL,
  `fuel_level_l` decimal(10,2) DEFAULT NULL,
  `engine_rpm` int unsigned DEFAULT NULL,
  `engine_temp_c` decimal(5,1) DEFAULT NULL,
  `battery_v` decimal(5,2) DEFAULT NULL,
  `attrs_json` json DEFAULT NULL,
  PRIMARY KEY (`c0d`),
  KEY `idx_gp_device_ts` (`device_id`,`ts`),
  KEY `idx_gp_truck_ts` (`truck_id`,`ts`),
  KEY `idx_gp_server_ts` (`server_ts`),
  KEY `idx_gps_pos_device_ts` (`device_id`,`ts` DESC),
  KEY `idx_gps_pos_truck_ts` (`truck_id`,`ts` DESC)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `gps_positions` WRITE;
/*!40000 ALTER TABLE `gps_positions` DISABLE KEYS */;
INSERT INTO `gps_positions` VALUES (1,1,100,'2024-08-27 08:00:00','2026-08-27 09:44:44',-6.792400,39.208300,NULL,10.00,NULL,1,1,NULL,NULL,NULL,NULL,NULL,'{\"fences\": [1]}'),(2,1,100,'2024-08-27 08:01:00','2026-08-27 09:44:45',-6.810000,39.250000,NULL,95.00,NULL,1,1,NULL,NULL,NULL,NULL,NULL,NULL),(3,1,100,'2024-08-27 08:02:00','2026-08-27 09:44:45',-6.820000,39.260000,NULL,105.00,NULL,1,1,NULL,NULL,NULL,NULL,NULL,NULL),(4,3,100,'2024-08-27 08:00:00','2026-08-27 10:09:00',-6.792400,39.208300,NULL,45.00,NULL,1,1,NULL,NULL,NULL,NULL,NULL,'{\"fences\": [1]}'),(5,3,100,'2024-08-27 08:00:00','2026-08-27 10:10:05',-6.800000,39.250000,NULL,42.00,NULL,1,1,NULL,NULL,NULL,NULL,NULL,NULL);
/*!40000 ALTER TABLE `gps_positions` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `journal_entries`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `journal_entries` (
  `c0d` int NOT NULL AUTO_INCREMENT,
  `je_no` varchar(30) NOT NULL,
  `entry_date` date NOT NULL,
  `source_type` varchar(30) NOT NULL DEFAULT 'JOURNAL',
  `source_id` int NOT NULL DEFAULT '0',
  `source_ref` varchar(60) NOT NULL DEFAULT '',
  `narrative` text,
  `currency` varchar(10) NOT NULL DEFAULT 'TZS',
  `fx_rate` decimal(20,6) NOT NULL DEFAULT '1.000000',
  `total_debit` decimal(20,2) NOT NULL DEFAULT '0.00',
  `total_credit` decimal(20,2) NOT NULL DEFAULT '0.00',
  `status` varchar(20) NOT NULL DEFAULT 'POSTED',
  `reversed_by_je_id` int NOT NULL DEFAULT '0',
  `posted_by` int NOT NULL DEFAULT '0',
  `posted_by_name` varchar(120) NOT NULL DEFAULT '',
  `posted_on` timestamp NULL DEFAULT NULL,
  `created_by` int NOT NULL DEFAULT '0',
  `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `edited_by` int NOT NULL DEFAULT '0',
  `edited_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_je_no` (`je_no`),
  KEY `ix_source` (`source_type`,`source_id`),
  KEY `ix_entry_date` (`entry_date`),
  KEY `ix_status` (`status`),
  KEY `idx_je_date` (`entry_date`),
  KEY `idx_je_date_status` (`entry_date`,`status`,`deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `journal_entries` WRITE;
/*!40000 ALTER TABLE `journal_entries` DISABLE KEYS */;
INSERT INTO `journal_entries` VALUES (1,'JE-2026-0001','2026-08-27','INVOICE_ISSUE',1,'INV-2026-0001','Invoice INV-2026-0001 issued to Twiga Cement Ltd Twiga','TZS',1.000000,2006000.00,2006000.00,'POSTED',0,1,'Test Admin','2026-08-27 10:39:32',1,'2026-08-27 10:39:32',1,'2026-08-27 10:39:32',0),(2,'JE-2026-0002','2026-08-27','RECEIPT_APPLY',1,'RCPT-2026-0001','Customer receipt RCPT-2026-0001','TZS',1.000000,1003000.00,1003000.00,'POSTED',0,1,'Test Admin','2026-08-27 10:39:32',1,'2026-08-27 10:39:32',1,'2026-08-27 10:39:32',0),(3,'JE-2026-0003','2026-08-27','RECEIPT_APPLY',2,'RCPT-2026-0002','Customer receipt RCPT-2026-0002','TZS',1.000000,1003000.00,1003000.00,'POSTED',0,1,'Test Admin','2026-08-27 10:39:32',1,'2026-08-27 10:39:32',1,'2026-08-27 10:39:32',0),(4,'JE-2026-0004','2026-08-27','FUEL',1,'FUEL-00001','Fuel · 50.00 L @ Puma Ubungo · TZS','TZS',1.000000,200000.00,200000.00,'POSTED',0,1,'Test Admin','2026-08-27 10:39:33',1,'2026-08-27 10:39:33',1,'2026-08-27 10:39:33',0),(5,'JE-2026-0005','2026-08-27','FUEL',2,'FUEL-00002','Fuel · 90.00 L @ Puma card · TZS','TZS',1.000000,350000.00,350000.00,'POSTED',0,1,'Test Admin','2026-08-27 10:39:33',1,'2026-08-27 10:39:33',1,'2026-08-27 10:39:33',0),(6,'JE-2026-0006','2026-08-31','PAYROLL_ACCRUAL',1,'PAY-2026-08','Payroll accrual · PAY-2026-08','TZS',1.000000,1065900.00,1065900.00,'POSTED',0,1,'Test Admin','2026-08-27 11:13:34',1,'2026-08-27 11:13:34',1,'2026-08-27 11:13:34',0),(7,'JE-2026-0007','2026-08-27','PAYROLL_PAYMENT',1,'PAY-2026-08','Payroll payment · PAY-2026-08','TZS',1.000000,703125.00,703125.00,'POSTED',0,1,'Test Admin','2026-08-27 11:13:35',1,'2026-08-27 11:13:35',1,'2026-08-27 11:13:35',0),(8,'JE-2026-0008','2026-08-27','BANK_ADJ',3,'stmt-line-3','Monthly bank charges','TZS',1.000000,5000.00,5000.00,'POSTED',0,1,'smoke-test','2026-08-27 17:22:44',1,'2026-08-27 17:22:44',1,'2026-08-27 17:22:44',0),(9,'JE-2026-0009','2026-08-15','BILL',1,'DRAFT-20260827180415','Supplier bill DRAFT-20260827180415 · ACME Fuel Ltd','TZS',1.000000,590000.00,590000.00,'POSTED',0,1,'smoke-test','2026-08-27 18:04:15',1,'2026-08-27 18:04:15',1,'2026-08-27 18:04:15',0),(10,'JE-2026-0010','2026-08-20','SUPPLIER_PAYMENT',0,'AP-SMOKE-BNK-01','Supplier payment · bank_transfer','TZS',1.000000,300000.00,300000.00,'POSTED',0,1,'smoke-test','2026-08-27 18:04:15',1,'2026-08-27 18:04:15',1,'2026-08-27 18:04:15',0),(11,'JE-2026-0011','2026-08-25','SUPPLIER_PAYMENT',0,'AP-SMOKE-MOMO-02','Supplier payment · mobile_money','TZS',1.000000,290000.00,290000.00,'POSTED',0,1,'smoke-test','2026-08-27 18:04:15',1,'2026-08-27 18:04:15',1,'2026-08-27 18:04:15',0);
/*!40000 ALTER TABLE `journal_entries` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `journal_lines`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `journal_lines` (
  `c0d` int NOT NULL AUTO_INCREMENT,
  `journal_entry_id` int NOT NULL,
  `line_no` int NOT NULL DEFAULT '1',
  `account_id` int NOT NULL,
  `account_code` varchar(20) NOT NULL DEFAULT '',
  `account_name` varchar(160) NOT NULL DEFAULT '',
  `debit` decimal(20,2) NOT NULL DEFAULT '0.00',
  `credit` decimal(20,2) NOT NULL DEFAULT '0.00',
  `narrative` varchar(255) NOT NULL DEFAULT '',
  `project_id` int NOT NULL DEFAULT '0',
  `lpo_id` int NOT NULL DEFAULT '0',
  `payment_id` int NOT NULL DEFAULT '0',
  `bank_account_id` int NOT NULL DEFAULT '0',
  `truck_id` int unsigned DEFAULT NULL,
  `driver_id` int unsigned DEFAULT NULL,
  `trip_id` int unsigned DEFAULT NULL,
  `trip_request_id` int unsigned DEFAULT NULL,
  `customer_id` int unsigned DEFAULT NULL,
  `vendor_id` int unsigned DEFAULT NULL,
  `expense_id` int unsigned DEFAULT NULL,
  `fuel_entry_id` int unsigned DEFAULT NULL,
  `work_order_id` int unsigned DEFAULT NULL,
  `cost_centre_id` int unsigned DEFAULT NULL,
  `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`c0d`),
  KEY `ix_je` (`journal_entry_id`),
  KEY `ix_account` (`account_id`),
  KEY `ix_project` (`project_id`),
  KEY `ix_bank` (`bank_account_id`),
  KEY `ix_lpo` (`lpo_id`),
  KEY `ix_payment` (`payment_id`),
  KEY `idx_jl_truck` (`truck_id`),
  KEY `idx_jl_driver` (`driver_id`),
  KEY `idx_jl_trip` (`trip_id`),
  KEY `idx_jl_customer` (`customer_id`),
  KEY `idx_jl_vendor` (`vendor_id`),
  KEY `idx_jl_expense` (`expense_id`),
  KEY `idx_jl_truck_je` (`truck_id`,`journal_entry_id`),
  KEY `idx_jl_customer_je` (`customer_id`,`journal_entry_id`),
  KEY `idx_jl_driver_je` (`driver_id`,`journal_entry_id`)
) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `journal_lines` WRITE;
/*!40000 ALTER TABLE `journal_lines` DISABLE KEYS */;
INSERT INTO `journal_lines` VALUES (1,1,1,18,'3007','Trade Receivables',2006000.00,0.00,'AR — Invoice INV-2026-0001 Twiga Cement Ltd Twiga',0,0,0,0,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,'2026-08-27 10:39:32'),(2,1,2,76,'8001','Sales Revenue',0.00,1700000.00,'Freight revenue — Invoice INV-2026-0001',0,0,0,0,100,100,3,NULL,1,NULL,NULL,NULL,NULL,NULL,'2026-08-27 10:39:32'),(3,1,3,31,'4010','VAT Payable',0.00,306000.00,'VAT Output — Invoice INV-2026-0001',0,0,0,0,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,'2026-08-27 10:39:32'),(4,2,1,17,'3006','Mobile Money Float',1003000.00,0.00,'Receipt RCPT-2026-0001 — mobile_money',0,0,0,0,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,'2026-08-27 10:39:32'),(5,2,2,18,'3007','Trade Receivables',0.00,1003000.00,'AR paid — Invoice INV-2026-0001',0,0,0,0,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,'2026-08-27 10:39:32'),(6,3,1,12,'3001','Bank - CRDB',1003000.00,0.00,'Receipt RCPT-2026-0002 — bank_transfer',0,0,0,0,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,'2026-08-27 10:39:32'),(7,3,2,18,'3007','Trade Receivables',0.00,1003000.00,'AR paid — Invoice INV-2026-0001',0,0,0,0,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,'2026-08-27 10:39:33'),(8,4,1,49,'7009','Fuel',200000.00,0.00,'Fuel expense · FUEL-00001',0,0,0,0,100,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,'2026-08-27 10:39:33'),(9,4,2,14,'3003','Cash',0.00,200000.00,'Paid via cash',0,0,0,0,100,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,'2026-08-27 10:39:33'),(10,5,1,49,'7009','Fuel',350000.00,0.00,'Fuel expense · FUEL-00002',0,0,0,0,100,NULL,NULL,NULL,NULL,NULL,NULL,2,NULL,NULL,'2026-08-27 10:39:33'),(11,5,2,20,'3009','Fuel Card Account',0.00,350000.00,'Paid via fuel_card',0,0,0,0,100,NULL,NULL,NULL,NULL,NULL,NULL,2,NULL,NULL,'2026-08-27 10:39:33'),(12,6,1,42,'7002','Basic Salaries',885000.00,0.00,'Basic salaries & commission · PAY-2026-08',0,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-08-27 11:13:34'),(13,6,2,68,'7028','Subsistence Allowances',50000.00,0.00,'Subsistence allowances · PAY-2026-08',0,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-08-27 11:13:34'),(14,6,3,56,'7016','NSSF Contribution',93500.00,0.00,'NSSF contribution (employer) · PAY-2026-08',0,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-08-27 11:13:34'),(15,6,4,66,'7026','Skills Development Levy',32725.00,0.00,'Skills Development Levy · PAY-2026-08',0,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-08-27 11:13:34'),(16,6,5,71,'7031','Workers Compensation Fund',4675.00,0.00,'Workers Compensation Fund · PAY-2026-08',0,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-08-27 11:13:34'),(17,6,6,26,'4005','Salary - payable',0.00,703125.00,'Net salary payable · PAY-2026-08',0,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-08-27 11:13:34'),(18,6,7,24,'4003','NSSF - Payable',0.00,187000.00,'NSSF payable (ee + er) · PAY-2026-08',0,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-08-27 11:13:34'),(19,6,8,25,'4004','PAYE - Payable',0.00,88375.00,'PAYE payable · PAY-2026-08',0,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-08-27 11:13:34'),(20,6,9,27,'4006','SDL - Payable',0.00,32725.00,'SDL payable · PAY-2026-08',0,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-08-27 11:13:34'),(21,6,10,29,'4008','WCF - Payable',0.00,4675.00,'WCF payable · PAY-2026-08',0,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-08-27 11:13:34'),(22,6,11,22,'4001','Accrued Expenses',0.00,50000.00,'Health insurance & other deductions · PAY-2026-08',0,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-08-27 11:13:34'),(23,7,1,26,'4005','Salary - payable',703125.00,0.00,'Settle salary payable · PAY-2026-08',0,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-08-27 11:13:35'),(24,7,2,12,'3001','Bank - CRDB',0.00,703125.00,'Payroll paid via bank_transfer · PAY-2026-08',0,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-08-27 11:13:35'),(25,8,1,41,'7001','Bank Charges',5000.00,0.00,'Monthly bank charges',0,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-08-27 17:22:44'),(26,8,2,12,'3001','Bank - CRDB',0.00,5000.00,'Monthly bank charges',0,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-08-27 17:22:44'),(27,9,1,49,'7009','Fuel',500000.00,0.00,'Bill DRAFT-20260827180415',0,0,0,0,NULL,NULL,NULL,NULL,NULL,2,NULL,NULL,NULL,NULL,'2026-08-27 18:04:15'),(28,9,2,19,'3008','VAT Recoverable',90000.00,0.00,'Input VAT DRAFT-20260827180415',0,0,0,0,NULL,NULL,NULL,NULL,NULL,2,NULL,NULL,NULL,NULL,'2026-08-27 18:04:15'),(29,9,3,30,'4009','Trade Payables',0.00,590000.00,'A/P DRAFT-20260827180415',0,0,0,0,NULL,NULL,NULL,NULL,NULL,2,NULL,NULL,NULL,NULL,'2026-08-27 18:04:15'),(30,10,1,30,'4009','Trade Payables',300000.00,0.00,'Vendor payment',0,0,0,0,NULL,NULL,NULL,NULL,NULL,2,NULL,NULL,NULL,NULL,'2026-08-27 18:04:15'),(31,10,2,12,'3001','Bank - CRDB',0.00,300000.00,'Paid via bank_transfer',0,0,0,0,NULL,NULL,NULL,NULL,NULL,2,NULL,NULL,NULL,NULL,'2026-08-27 18:04:15'),(32,11,1,30,'4009','Trade Payables',290000.00,0.00,'Vendor payment',0,0,0,0,NULL,NULL,NULL,NULL,NULL,2,NULL,NULL,NULL,NULL,'2026-08-27 18:04:15'),(33,11,2,17,'3006','Mobile Money Float',0.00,290000.00,'Paid via mobile_money',0,0,0,0,NULL,NULL,NULL,NULL,NULL,2,NULL,NULL,NULL,NULL,'2026-08-27 18:04:15');
/*!40000 ALTER TABLE `journal_lines` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `login_attempts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `login_attempts` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `ip` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL,
  `username` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `attempt_at` datetime NOT NULL,
  `success` tinyint(1) NOT NULL DEFAULT '0',
  `user_agent` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_ip_time` (`ip`,`attempt_at`),
  KEY `idx_username_time` (`username`,`attempt_at`),
  KEY `idx_attempt_at` (`attempt_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `login_attempts` WRITE;
/*!40000 ALTER TABLE `login_attempts` DISABLE KEYS */;
/*!40000 ALTER TABLE `login_attempts` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `notifications`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `notifications` (
  `c0d` int NOT NULL AUTO_INCREMENT,
  `recipient_user_id` int NOT NULL,
  `kind` varchar(60) NOT NULL,
  `subject` varchar(200) NOT NULL,
  `body` varchar(500) NOT NULL DEFAULT '',
  `target_url` varchar(255) NOT NULL DEFAULT '',
  `entity_type` varchar(60) NOT NULL DEFAULT '',
  `entity_id` int NOT NULL DEFAULT '0',
  `created_by` int NOT NULL DEFAULT '0',
  `created_by_name` varchar(120) NOT NULL DEFAULT '',
  `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `read_on` timestamp NULL DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  KEY `ix_recip_unread` (`recipient_user_id`,`read_on`),
  KEY `ix_recip_created` (`recipient_user_id`,`created_on`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `notifications` WRITE;
/*!40000 ALTER TABLE `notifications` DISABLE KEYS */;
/*!40000 ALTER TABLE `notifications` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `payroll_periods`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `payroll_periods` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `period_no` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `period_start` date NOT NULL,
  `period_end` date NOT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
  `total_gross` decimal(14,2) NOT NULL DEFAULT '0.00',
  `total_deductions` decimal(14,2) NOT NULL DEFAULT '0.00',
  `total_net` decimal(14,2) NOT NULL DEFAULT '0.00',
  `total_employer` decimal(14,2) NOT NULL DEFAULT '0.00',
  `driver_count` int unsigned NOT NULL DEFAULT '0',
  `computed_by` int unsigned DEFAULT NULL,
  `computed_at` datetime DEFAULT NULL,
  `approved_by` int unsigned DEFAULT NULL,
  `approved_at` datetime DEFAULT NULL,
  `paid_by` int unsigned DEFAULT NULL,
  `paid_at` datetime DEFAULT NULL,
  `accrual_je_id` int unsigned DEFAULT NULL,
  `payment_je_id` int unsigned DEFAULT NULL,
  `void_by` int unsigned DEFAULT NULL,
  `void_at` datetime DEFAULT NULL,
  `void_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_by` int unsigned DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `edited_by` int unsigned DEFAULT NULL,
  `edited_on` datetime DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_pp_no` (`period_no`),
  UNIQUE KEY `uq_pp_month` (`tenant_id`,`period_start`),
  KEY `idx_pp_status` (`status`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `payroll_periods` WRITE;
/*!40000 ALTER TABLE `payroll_periods` DISABLE KEYS */;
INSERT INTO `payroll_periods` VALUES (1,1,'PAY-2026-08','2026-08-01','2026-08-31','paid',935000.00,231875.00,703125.00,130900.00,1,1,'2026-08-27 14:13:34',1,'2026-08-27 14:13:34',1,'2026-08-27 14:13:35',6,7,NULL,NULL,NULL,NULL,1,'2026-08-27 14:13:34',NULL,NULL,0);
/*!40000 ALTER TABLE `payroll_periods` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `payroll_records`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `payroll_records` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `period_id` int unsigned NOT NULL,
  `driver_id` int unsigned NOT NULL,
  `base_salary` decimal(14,2) NOT NULL DEFAULT '0.00',
  `trip_count` int unsigned NOT NULL DEFAULT '0',
  `trip_revenue` decimal(14,2) NOT NULL DEFAULT '0.00',
  `commission` decimal(14,2) NOT NULL DEFAULT '0.00',
  `allowances` decimal(14,2) NOT NULL DEFAULT '0.00',
  `other_earnings` decimal(14,2) NOT NULL DEFAULT '0.00',
  `gross_pay` decimal(14,2) NOT NULL DEFAULT '0.00',
  `paye` decimal(14,2) NOT NULL DEFAULT '0.00',
  `nssf_ee` decimal(14,2) NOT NULL DEFAULT '0.00',
  `nssf_er` decimal(14,2) NOT NULL DEFAULT '0.00',
  `sdl` decimal(14,2) NOT NULL DEFAULT '0.00',
  `wcf` decimal(14,2) NOT NULL DEFAULT '0.00',
  `health_ins` decimal(14,2) NOT NULL DEFAULT '0.00',
  `other_deductions` decimal(14,2) NOT NULL DEFAULT '0.00',
  `net_pay` decimal(14,2) NOT NULL DEFAULT '0.00',
  `breakdown_json` json DEFAULT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
  `notes` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `edited_by` int unsigned DEFAULT NULL,
  `edited_on` datetime DEFAULT NULL,
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_pr` (`period_id`,`driver_id`),
  KEY `idx_pr_driver` (`driver_id`,`period_id`),
  KEY `idx_pr_status` (`status`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `payroll_records` WRITE;
/*!40000 ALTER TABLE `payroll_records` DISABLE KEYS */;
INSERT INTO `payroll_records` VALUES (1,1,1,100,800000.00,4,1700000.00,85000.00,50000.00,0.00,935000.00,88375.00,93500.00,93500.00,32725.00,4675.00,20000.00,30000.00,703125.00,NULL,'paid','Housing allowance + advance recovery',1,'2026-08-27 14:13:34');
/*!40000 ALTER TABLE `payroll_records` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `pm_events`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `pm_events` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `event_no` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `truck_id` int unsigned NOT NULL,
  `template_id` int unsigned NOT NULL,
  `schedule_id` int unsigned NOT NULL,
  `triggered_at` datetime NOT NULL,
  `triggered_by` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'cron',
  `planned_km` int unsigned DEFAULT NULL,
  `planned_date` date DEFAULT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'upcoming',
  `due_since` datetime DEFAULT NULL,
  `overdue_since` datetime DEFAULT NULL,
  `severity` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'normal',
  `completed_at` datetime DEFAULT NULL,
  `completed_km` int unsigned DEFAULT NULL,
  `completed_by` int unsigned DEFAULT NULL,
  `work_order_id` int unsigned DEFAULT NULL,
  `skipped_by` int unsigned DEFAULT NULL,
  `skip_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `alert_id` int unsigned DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_on` datetime NOT NULL,
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_pme_no` (`event_no`),
  KEY `idx_pme_status_truck` (`status`,`truck_id`,`planned_date`),
  KEY `idx_pme_schedule` (`schedule_id`),
  KEY `idx_pme_triggered` (`triggered_at`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `pm_events` WRITE;
/*!40000 ALTER TABLE `pm_events` DISABLE KEYS */;
INSERT INTO `pm_events` VALUES (1,1,'PM-2026-0001',100,1,1,'2026-08-27 13:18:59','cron',130000,'2025-07-30','completed','2026-08-27 10:18:59','2026-08-27 10:18:59','high','2026-08-27 13:19:00',135200,1,NULL,NULL,NULL,7,NULL,'2026-08-27 13:18:59'),(2,1,'PM-2026-0002',100,6,2,'2026-08-27 13:18:59','cron',140000,'2025-10-28','overdue','2026-08-27 10:18:59','2026-08-27 10:18:59','high',NULL,NULL,NULL,NULL,NULL,NULL,8,NULL,'2026-08-27 13:18:59'),(3,1,'PM-2026-0003',100,8,3,'2026-08-27 13:18:59','cron',130000,NULL,'skipped','2026-08-27 10:18:59','2026-08-27 10:18:59','high',NULL,NULL,NULL,NULL,1,'Deferred to next service window',9,NULL,'2026-08-27 13:18:59');
/*!40000 ALTER TABLE `pm_events` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `pm_templates`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `pm_templates` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `name` varchar(160) COLLATE utf8mb4_unicode_ci NOT NULL,
  `kind` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
  `interval_km` int unsigned DEFAULT NULL,
  `interval_days` int unsigned DEFAULT NULL,
  `threshold_km` int unsigned NOT NULL DEFAULT '500',
  `threshold_days` int unsigned NOT NULL DEFAULT '7',
  `priority` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'normal',
  `default_labour_hours` decimal(5,2) DEFAULT NULL,
  `default_parts_cost` decimal(12,2) DEFAULT NULL,
  `applicable_types_json` json DEFAULT NULL,
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_by` int unsigned DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `edited_by` int unsigned DEFAULT NULL,
  `edited_on` datetime DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  KEY `idx_pt_kind_active` (`kind`,`active`,`deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `pm_templates` WRITE;
/*!40000 ALTER TABLE `pm_templates` DISABLE KEYS */;
INSERT INTO `pm_templates` VALUES (1,1,'Engine oil & filter change','oil_change',10000,90,500,7,'high',1.00,120000.00,NULL,1,'Standard 10k km / 3 month service. Whichever comes first.',1,'2026-08-27 13:18:25',NULL,NULL,0),(2,1,'Fuel filter replacement','fuel_filter',20000,180,500,14,'high',0.50,45000.00,NULL,1,'Critical for common-rail diesels running on TZ fuel quality.',1,'2026-08-27 13:18:25',NULL,NULL,0),(3,1,'Air filter replacement','air_filter',30000,365,500,30,'normal',0.30,30000.00,NULL,1,'Shorter interval in dusty upcountry conditions.',1,'2026-08-27 13:18:25',NULL,NULL,0),(4,1,'Transmission oil change','transmission_oil',40000,730,1000,30,'normal',2.00,180000.00,NULL,1,'Every 40k km or 2 years.',1,'2026-08-27 13:18:25',NULL,NULL,0),(5,1,'Differential oil change','diff_oil',40000,730,1000,30,'normal',1.50,120000.00,NULL,1,'Both front and rear diffs on 6x4 configurations.',1,'2026-08-27 13:18:25',NULL,NULL,0),(6,1,'Brake pads inspection','brake_inspection',20000,180,500,14,'critical',0.50,0.00,NULL,1,'Visual inspection; replace pads if under 3mm remaining.',1,'2026-08-27 13:18:25',NULL,NULL,0),(7,1,'Brake fluid change','brake_fluid',50000,730,1000,30,'high',1.00,25000.00,NULL,1,'Every 50k km or 2 years to protect ABS module.',1,'2026-08-27 13:18:25',NULL,NULL,0),(8,1,'Tyre rotation','tyre_rotation',10000,NULL,500,0,'normal',1.00,0.00,NULL,1,'Rotate front-to-rear to equalise wear.',1,'2026-08-27 13:18:25',NULL,NULL,0),(9,1,'Coolant / radiator flush','coolant',50000,730,1000,30,'high',1.50,60000.00,NULL,1,'Prevents overheating on Chalinze corridor climbs.',1,'2026-08-27 13:18:25',NULL,NULL,0),(10,1,'Major service (60k km)','general_service',60000,365,1000,30,'critical',6.00,500000.00,NULL,1,'Full inspection: timing belt, injectors, mounts, greasing, alignment check.',1,'2026-08-27 13:18:25',NULL,NULL,0);
/*!40000 ALTER TABLE `pm_templates` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `routes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `routes` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `code` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `name` varchar(160) COLLATE utf8mb4_unicode_ci NOT NULL,
  `route_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'town',
  `origin_city` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `destination_city` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `distance_km` decimal(9,2) DEFAULT NULL,
  `avg_duration_hrs` decimal(6,2) DEFAULT NULL,
  `stops_summary` text COLLATE utf8mb4_unicode_ci,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `created_by` int unsigned DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `edited_by` int unsigned DEFAULT NULL,
  `edited_on` datetime DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  KEY `idx_routes_type` (`route_type`,`active`),
  KEY `idx_routes_active` (`active`,`deleted`),
  KEY `idx_routes_code` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `routes` WRITE;
/*!40000 ALTER TABLE `routes` DISABLE KEYS */;
INSERT INTO `routes` VALUES (1,1,'DAR-ARU','Dar es Salaam - Arusha','regional','Dar es Salaam','Arusha',647.00,11.50,'Chalinze weighbridge\nMorogoro fuel stop\nBabati overnight','Standard cement + FMCG lane.',1,1,'2026-08-23 16:14:37',NULL,NULL,0);
/*!40000 ALTER TABLE `routes` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `sms_outbox`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `sms_outbox` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `msisdn` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `message` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `alert_id` int unsigned DEFAULT NULL,
  `source_type` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `source_id` int unsigned DEFAULT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'queued',
  `attempts` tinyint unsigned NOT NULL DEFAULT '0',
  `max_attempts` tinyint unsigned NOT NULL DEFAULT '3',
  `last_error` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `provider` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'beem',
  `provider_msg_id` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `scheduled_for` datetime DEFAULT NULL,
  `sent_at` datetime DEFAULT NULL,
  `created_by` int unsigned DEFAULT NULL,
  `created_on` datetime NOT NULL,
  PRIMARY KEY (`c0d`),
  KEY `idx_so_status` (`status`,`created_on`),
  KEY `idx_so_alert` (`alert_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `sms_outbox` WRITE;
/*!40000 ALTER TABLE `sms_outbox` DISABLE KEYS */;
INSERT INTO `sms_outbox` VALUES (1,1,'+255712000001','[Pacific] Over-speed · 95 kph',1,'alert',1,'failed',3,3,'Beem API keys not configured.','beem',NULL,NULL,NULL,NULL,'2026-08-27 09:44:45'),(2,1,'+255712000001','[Pacific] Over-speed · 105 kph',3,'alert',3,'failed',3,3,'Beem API keys not configured.','beem',NULL,NULL,NULL,NULL,'2026-08-27 09:44:45');
/*!40000 ALTER TABLE `sms_outbox` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `special_user_perms`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `special_user_perms` (
  `c0d` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `controller_allowed` varchar(80) NOT NULL,
  `action_allowed` varchar(80) NOT NULL,
  `created_by` int NOT NULL DEFAULT '0',
  `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_special` (`user_id`,`controller_allowed`,`action_allowed`),
  KEY `ix_user` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `special_user_perms` WRITE;
/*!40000 ALTER TABLE `special_user_perms` DISABLE KEYS */;
/*!40000 ALTER TABLE `special_user_perms` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `supplier_bills`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `supplier_bills` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `bill_no` varchar(20) NOT NULL,
  `supplier_ref` varchar(60) NOT NULL DEFAULT '' COMMENT 'Supplier invoice number as printed',
  `vendor_id` int unsigned NOT NULL,
  `bill_date` date NOT NULL,
  `due_date` date DEFAULT NULL,
  `payment_terms` varchar(40) DEFAULT NULL,
  `currency` varchar(6) NOT NULL DEFAULT 'TZS',
  `subtotal` decimal(14,2) NOT NULL DEFAULT '0.00',
  `vat_amount` decimal(14,2) NOT NULL DEFAULT '0.00',
  `total_amount` decimal(14,2) NOT NULL DEFAULT '0.00',
  `amount_paid` decimal(14,2) NOT NULL DEFAULT '0.00',
  `expense_account_id` int unsigned DEFAULT NULL COMMENT 'Which COA the net gets debited to',
  `status` varchar(20) NOT NULL DEFAULT 'draft' COMMENT 'draft|posted|paid|void',
  `issued_by` int unsigned DEFAULT NULL,
  `issued_at` datetime DEFAULT NULL,
  `journal_entry_id` int unsigned DEFAULT NULL,
  `void_by` int unsigned DEFAULT NULL,
  `void_at` datetime DEFAULT NULL,
  `void_reason` varchar(255) DEFAULT NULL,
  `notes` text,
  `created_by` int unsigned DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `edited_by` int unsigned DEFAULT NULL,
  `edited_on` datetime DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `bill_no` (`bill_no`),
  KEY `idx_sb_vendor` (`vendor_id`,`bill_date`),
  KEY `idx_sb_due` (`due_date`,`status`),
  KEY `idx_sb_status` (`status`,`deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `supplier_bills` WRITE;
/*!40000 ALTER TABLE `supplier_bills` DISABLE KEYS */;
INSERT INTO `supplier_bills` VALUES (1,1,'BILL-2026-0001','AP-SMOKE-INV-0001',2,'2026-08-15','2026-09-14','net_30','TZS',500000.00,90000.00,590000.00,590000.00,49,'paid',1,'2026-08-27 21:04:15',9,NULL,NULL,NULL,'Smoke test bill',1,'2026-08-27 21:04:15',1,'2026-08-27 21:04:15',0);
/*!40000 ALTER TABLE `supplier_bills` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `supplier_payment_allocations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `supplier_payment_allocations` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `payment_id` int unsigned NOT NULL,
  `bill_id` int unsigned NOT NULL,
  `amount_applied` decimal(14,2) NOT NULL,
  `created_on` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`c0d`),
  KEY `idx_spa_payment` (`payment_id`),
  KEY `idx_spa_bill` (`bill_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `supplier_payment_allocations` WRITE;
/*!40000 ALTER TABLE `supplier_payment_allocations` DISABLE KEYS */;
INSERT INTO `supplier_payment_allocations` VALUES (1,1,1,300000.00,'2026-08-27 21:04:15'),(2,2,1,290000.00,'2026-08-27 21:04:15');
/*!40000 ALTER TABLE `supplier_payment_allocations` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `supplier_payments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `supplier_payments` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `payment_no` varchar(20) NOT NULL,
  `vendor_id` int unsigned NOT NULL,
  `payment_date` date NOT NULL,
  `amount` decimal(14,2) NOT NULL,
  `amount_allocated` decimal(14,2) NOT NULL DEFAULT '0.00',
  `currency` varchar(6) NOT NULL DEFAULT 'TZS',
  `payment_method` varchar(30) NOT NULL DEFAULT 'bank_transfer' COMMENT 'bank_transfer|mobile_money|cash|fuel_card',
  `reference` varchar(120) DEFAULT NULL,
  `status` varchar(20) NOT NULL DEFAULT 'recorded' COMMENT 'recorded|void',
  `journal_entry_id` int unsigned DEFAULT NULL,
  `void_by` int unsigned DEFAULT NULL,
  `void_at` datetime DEFAULT NULL,
  `void_reason` varchar(255) DEFAULT NULL,
  `notes` text,
  `created_by` int unsigned DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `payment_no` (`payment_no`),
  KEY `idx_sp_vendor` (`vendor_id`,`payment_date`),
  KEY `idx_sp_status` (`status`,`deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `supplier_payments` WRITE;
/*!40000 ALTER TABLE `supplier_payments` DISABLE KEYS */;
INSERT INTO `supplier_payments` VALUES (1,1,'PAY-2026-0001',2,'2026-08-20',300000.00,300000.00,'TZS','bank_transfer','AP-SMOKE-BNK-01','recorded',10,NULL,NULL,NULL,'',1,'2026-08-27 21:04:15',0),(2,1,'PAY-2026-0002',2,'2026-08-25',290000.00,290000.00,'TZS','mobile_money','AP-SMOKE-MOMO-02','recorded',11,NULL,NULL,NULL,'',1,'2026-08-27 21:04:15',0);
/*!40000 ALTER TABLE `supplier_payments` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `trip_attachments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `trip_attachments` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `trip_id` int unsigned NOT NULL,
  `trip_stop_id` int unsigned DEFAULT NULL,
  `category` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'other',
  `caption` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file_url` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
  `file_name` varchar(160) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file_size` int unsigned DEFAULT NULL,
  `mime_type` varchar(60) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `taken_at` datetime DEFAULT NULL,
  `taken_lat` decimal(10,6) DEFAULT NULL,
  `taken_lng` decimal(10,6) DEFAULT NULL,
  `source` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'web',
  `uploaded_by` int unsigned DEFAULT NULL,
  `driver_id` int unsigned DEFAULT NULL,
  `created_on` datetime NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  KEY `idx_ta_trip` (`trip_id`,`category`,`deleted`),
  KEY `idx_ta_stop` (`trip_stop_id`),
  KEY `idx_ta_created` (`created_on`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `trip_attachments` WRITE;
/*!40000 ALTER TABLE `trip_attachments` DISABLE KEYS */;
INSERT INTO `trip_attachments` VALUES (8,1,3,NULL,'damage','Path test','/pacific_logistics/uploads/trip/3/20260827_101715_ac2abdfa7e99.png','20260827_101715_ac2abdfa7e99.png',71,'image/png',NULL,NULL,NULL,'mobile',NULL,100,'2026-08-27 10:17:15',0);
/*!40000 ALTER TABLE `trip_attachments` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `trip_request_cargo_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `trip_request_cargo_items` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `trip_request_id` int unsigned NOT NULL,
  `seq_no` int NOT NULL DEFAULT '1',
  `item_name` varchar(160) COLLATE utf8mb4_unicode_ci NOT NULL,
  `qty` decimal(12,3) NOT NULL DEFAULT '1.000',
  `uom` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'units',
  `weight_kg` decimal(12,2) DEFAULT NULL,
  `volume_m3` decimal(10,2) DEFAULT NULL,
  `packaging` varchar(60) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `handling_notes` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `unit_value` decimal(14,2) DEFAULT NULL,
  `currency` varchar(6) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'TZS',
  `created_by` int unsigned DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `edited_by` int unsigned DEFAULT NULL,
  `edited_on` datetime DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  KEY `idx_trci_req` (`trip_request_id`,`deleted`,`seq_no`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `trip_request_cargo_items` WRITE;
/*!40000 ALTER TABLE `trip_request_cargo_items` DISABLE KEYS */;
INSERT INTO `trip_request_cargo_items` VALUES (1,2,1,'Portland cement 50kg bags',40.000,'bags',2000.00,NULL,'Pallets','Keep dry',NULL,'TZS',1,'2026-08-27 07:49:23',NULL,NULL,0),(2,2,2,'Cooking oil drums (20L)',150.000,'drums',3000.00,NULL,'','Fragile — keep upright',NULL,'TZS',1,'2026-08-27 07:49:23',NULL,NULL,0);
/*!40000 ALTER TABLE `trip_request_cargo_items` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `trip_requests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `trip_requests` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `request_no` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `customer_id` int unsigned DEFAULT NULL,
  `route_id` int unsigned DEFAULT NULL,
  `cargo_type` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'general',
  `cargo_description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `weight_kg` decimal(12,2) DEFAULT NULL,
  `volume_m3` decimal(10,2) DEFAULT NULL,
  `packages_count` int unsigned DEFAULT NULL,
  `origin_address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `destination_address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `pickup_date` date DEFAULT NULL,
  `pickup_time` time DEFAULT NULL,
  `delivery_date` date DEFAULT NULL,
  `delivery_time` time DEFAULT NULL,
  `quote_amount` decimal(14,2) DEFAULT NULL,
  `currency` varchar(6) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'TZS',
  `priority` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'normal',
  `status` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
  `requested_by` int unsigned DEFAULT NULL,
  `requested_at` datetime DEFAULT NULL,
  `approved_by` int unsigned DEFAULT NULL,
  `approved_at` datetime DEFAULT NULL,
  `rejected_by` int unsigned DEFAULT NULL,
  `rejected_at` datetime DEFAULT NULL,
  `reject_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_by` int unsigned DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `edited_by` int unsigned DEFAULT NULL,
  `edited_on` datetime DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_trip_request_no` (`request_no`),
  KEY `idx_tr_customer` (`customer_id`,`deleted`),
  KEY `idx_tr_status` (`status`,`deleted`),
  KEY `idx_tr_priority` (`priority`),
  KEY `idx_tr_pickup` (`pickup_date`),
  KEY `idx_tr_route` (`route_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `trip_requests` WRITE;
/*!40000 ALTER TABLE `trip_requests` DISABLE KEYS */;
INSERT INTO `trip_requests` VALUES (1,1,'TR-00001',1,1,'construction_materials','30 tons Portland cement, 42 pallets',30000.00,24.00,42,'Twiga Cement plant, Wazo Hill','Site 4, Arusha ring road','2026-08-25','07:00:00','2026-08-26','16:00:00',2450000.00,'TZS','high','dispatched',1,'2026-08-23 16:14:37',1,'2026-08-23 16:22:56',NULL,NULL,NULL,'Priority — kiln maintenance schedule.',1,'2026-08-23 16:14:37',1,'2026-08-23 16:22:56',0),(2,1,'TR-00002',1,1,'general','Mixed cargo — UAT test',5000.00,NULL,NULL,'Twiga Cement plant','Multiple sites in Dar','2026-08-25',NULL,NULL,NULL,400000.00,'TZS','normal','dispatched',1,'2026-08-27 07:49:23',1,'2026-08-27 07:49:24',NULL,NULL,NULL,'',1,'2026-08-27 07:49:23',1,'2026-08-27 07:49:24',0);
/*!40000 ALTER TABLE `trip_requests` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `trip_status_log`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `trip_status_log` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `trip_id` int unsigned NOT NULL,
  `from_status` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `to_status` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `changed_by` int unsigned DEFAULT NULL,
  `changed_at` datetime NOT NULL,
  `note` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`c0d`),
  KEY `idx_tsl_trip` (`trip_id`,`changed_at`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `trip_status_log` WRITE;
/*!40000 ALTER TABLE `trip_status_log` DISABLE KEYS */;
INSERT INTO `trip_status_log` VALUES (1,1,NULL,'dispatched',1,'2026-08-23 16:22:56','Trip dispatched from request TR-00001'),(2,1,'dispatched','in_transit',1,'2026-08-27 07:26:25','Trip started'),(3,2,NULL,'dispatched',1,'2026-08-27 07:49:24','Trip dispatched from request TR-00002'),(4,2,'dispatched','dispatched',1,'2026-08-27 07:49:24','Copied 3 planned stop(s) from request'),(5,3,'dispatched','in_transit',0,'2026-08-27 10:10:05','Trip started'),(6,3,'in_transit','delivered',0,'2026-08-27 10:10:06','Cargo delivered'),(7,3,'delivered','closed',0,'2026-08-27 10:10:06','Trip closed · invoice 500,000.00'),(8,3,'dispatched','in_transit',0,'2026-08-27 10:10:49','Trip started'),(9,3,'in_transit','delivered',0,'2026-08-27 10:10:49','Cargo delivered'),(10,3,'delivered','closed',0,'2026-08-27 10:10:50','Trip closed · invoice 500,000.00'),(11,3,'dispatched','in_transit',0,'2026-08-27 10:16:39','Trip started');
/*!40000 ALTER TABLE `trip_status_log` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `trip_stops`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `trip_stops` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `trip_request_id` int unsigned DEFAULT NULL,
  `trip_id` int unsigned DEFAULT NULL,
  `seq_no` int NOT NULL DEFAULT '1',
  `kind` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'waypoint',
  `location_name` varchar(160) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `country` varchar(60) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `lat` decimal(10,6) DEFAULT NULL,
  `lng` decimal(10,6) DEFAULT NULL,
  `contact_name` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `contact_phone` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `planned_arrival` datetime DEFAULT NULL,
  `planned_departure` datetime DEFAULT NULL,
  `actual_arrival` datetime DEFAULT NULL,
  `actual_departure` datetime DEFAULT NULL,
  `stop_notes` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `arrival_odometer` int unsigned DEFAULT NULL,
  `departure_odometer` int unsigned DEFAULT NULL,
  `signature_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `photo_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_by` int unsigned DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `edited_by` int unsigned DEFAULT NULL,
  `edited_on` datetime DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  KEY `idx_ts_request` (`trip_request_id`,`deleted`,`seq_no`),
  KEY `idx_ts_trip` (`trip_id`,`deleted`,`seq_no`),
  KEY `idx_ts_kind` (`kind`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `trip_stops` WRITE;
/*!40000 ALTER TABLE `trip_stops` DISABLE KEYS */;
INSERT INTO `trip_stops` VALUES (1,1,2,NULL,1,'pickup','Twiga Cement Plant','Wazo Hill Road','Dar es Salaam','',NULL,NULL,'Loading Bay','+255 22 000 0000','2026-08-25 07:00:00','2026-08-25 09:30:00',NULL,NULL,'Get 40 pallets + 150 oil drums',NULL,NULL,NULL,NULL,1,'2026-08-27 07:49:23',NULL,NULL,0),(2,1,2,NULL,2,'weighbridge','Vigwaza weighbridge','','Kibaha','',NULL,NULL,'','','2026-08-25 11:00:00',NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,1,'2026-08-27 07:49:23',NULL,NULL,0),(3,1,2,NULL,3,'delivery','Site 4 Warehouse','Nyerere Road ext','Dar es Salaam','',NULL,NULL,'','','2026-08-25 14:00:00',NULL,NULL,NULL,'POD required',NULL,NULL,NULL,NULL,1,'2026-08-27 07:49:23',NULL,NULL,0),(4,1,NULL,2,1,'pickup','Twiga Cement Plant','Wazo Hill Road','Dar es Salaam','',NULL,NULL,'Loading Bay','+255 22 000 0000','2026-08-25 07:00:00','2026-08-25 09:30:00',NULL,NULL,'Get 40 pallets + 150 oil drums',NULL,NULL,NULL,NULL,1,'2026-08-27 07:49:24',NULL,NULL,0),(5,1,NULL,2,2,'weighbridge','Vigwaza weighbridge','','Kibaha','',NULL,NULL,'','','2026-08-25 11:00:00',NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,1,'2026-08-27 07:49:24',NULL,NULL,0),(6,1,NULL,2,3,'delivery','Site 4 Warehouse','Nyerere Road ext','Dar es Salaam','',NULL,NULL,'','','2026-08-25 14:00:00',NULL,NULL,NULL,'POD required',NULL,NULL,NULL,NULL,1,'2026-08-27 07:49:24',NULL,NULL,0);
/*!40000 ALTER TABLE `trip_stops` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `trips`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `trips` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `trip_no` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `trip_request_id` int unsigned DEFAULT NULL,
  `driver_id` int unsigned NOT NULL,
  `truck_id` int unsigned NOT NULL,
  `customer_id` int unsigned DEFAULT NULL,
  `route_id` int unsigned DEFAULT NULL,
  `cargo_type` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cargo_description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `weight_kg` decimal(12,2) DEFAULT NULL,
  `origin_address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `destination_address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `planned_pickup` datetime DEFAULT NULL,
  `planned_delivery` datetime DEFAULT NULL,
  `actual_start` datetime DEFAULT NULL,
  `actual_end` datetime DEFAULT NULL,
  `odometer_start` int unsigned DEFAULT NULL,
  `odometer_end` int unsigned DEFAULT NULL,
  `planned_km` decimal(9,2) DEFAULT NULL,
  `actual_km` decimal(9,2) DEFAULT NULL,
  `quote_amount` decimal(14,2) DEFAULT NULL,
  `invoice_amount` decimal(14,2) DEFAULT NULL,
  `currency` varchar(6) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'TZS',
  `status` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'dispatched',
  `dispatched_by` int unsigned DEFAULT NULL,
  `dispatched_at` datetime DEFAULT NULL,
  `started_by` int unsigned DEFAULT NULL,
  `started_at` datetime DEFAULT NULL,
  `delivered_by` int unsigned DEFAULT NULL,
  `delivered_at` datetime DEFAULT NULL,
  `closed_by` int unsigned DEFAULT NULL,
  `closed_at` datetime DEFAULT NULL,
  `cancelled_by` int unsigned DEFAULT NULL,
  `cancelled_at` datetime DEFAULT NULL,
  `cancel_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_by` int unsigned DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `edited_by` int unsigned DEFAULT NULL,
  `edited_on` datetime DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_trip_no` (`trip_no`),
  KEY `idx_trips_driver` (`driver_id`,`status`,`deleted`),
  KEY `idx_trips_truck` (`truck_id`,`status`,`deleted`),
  KEY `idx_trips_status` (`status`,`deleted`),
  KEY `idx_trips_request` (`trip_request_id`),
  KEY `idx_trips_customer` (`customer_id`),
  KEY `idx_trips_pickup` (`planned_pickup`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `trips` WRITE;
/*!40000 ALTER TABLE `trips` DISABLE KEYS */;
INSERT INTO `trips` VALUES (1,1,'TRIP-00001',1,100,100,1,1,'construction_materials','30 tons Portland cement, 42 pallets',30000.00,'Twiga Cement plant, Wazo Hill','Site 4, Arusha ring road','2026-08-25 07:00:00','2026-08-26 16:00:00','2026-08-27 07:26:25',NULL,NULL,NULL,647.00,NULL,2450000.00,NULL,'TZS','in_transit',1,'2026-08-23 16:22:56',1,'2026-08-27 07:26:25',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Dispatch board smoke test',1,'2026-08-23 16:22:56',1,'2026-08-27 07:26:25',0),(2,1,'TRIP-00002',2,100,100,1,1,'general','Mixed cargo — UAT test',5000.00,'Twiga Cement plant','Multiple sites in Dar','2026-08-25 00:00:00',NULL,NULL,NULL,NULL,NULL,647.00,NULL,400000.00,NULL,'TZS','dispatched',1,'2026-08-27 07:49:24',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'UAT stops copy test',1,'2026-08-27 07:49:24',NULL,NULL,0),(3,1,'TRIP-TEST-001',NULL,100,100,1,NULL,'general','Test cargo for API smoke',NULL,'Ubungo depot','Chalinze customer site','2026-08-27 10:09:43',NULL,'2026-08-27 10:16:39','2026-08-27 12:43:43',123500,124000,NULL,400.00,NULL,500000.00,'TZS','closed',1,'2026-08-27 10:09:43',0,'2026-08-27 10:16:39',0,NULL,0,'2026-08-27 12:43:43',NULL,NULL,NULL,'OK',1,'2026-08-27 10:09:43',0,'2026-08-27 10:16:39',0),(4,1,'TRIP-TEST-002',NULL,100,100,1,NULL,'general','Second test cargo',NULL,'Ubungo depot','Morogoro','2026-08-22 12:41:47',NULL,'2026-08-23 12:41:47','2026-08-24 12:41:47',NULL,NULL,NULL,300.00,NULL,350000.00,'TZS','closed',1,'2026-08-22 12:41:47',NULL,NULL,NULL,NULL,1,'2026-08-24 12:41:47',NULL,NULL,NULL,NULL,1,'2026-08-22 12:41:47',NULL,NULL,0),(5,1,'TRIP-COA21-A',NULL,100,100,1,NULL,'general','COA21 test #1',NULL,'Ubungo depot','Chalinze','2026-08-22 13:39:32',NULL,'2026-08-23 13:39:32','2026-08-24 13:39:32',NULL,NULL,NULL,400.00,NULL,500000.00,'TZS','closed',1,'2026-08-22 13:39:32',NULL,NULL,NULL,NULL,1,'2026-08-24 13:39:32',NULL,NULL,NULL,NULL,1,'2026-08-22 13:39:32',NULL,NULL,0),(6,1,'TRIP-COA21-B',NULL,100,100,1,NULL,'general','COA21 test #2',NULL,'Ubungo depot','Morogoro','2026-08-21 13:39:32',NULL,'2026-08-22 13:39:32','2026-08-23 13:39:32',NULL,NULL,NULL,300.00,NULL,350000.00,'TZS','closed',1,'2026-08-21 13:39:32',NULL,NULL,NULL,NULL,1,'2026-08-23 13:39:32',NULL,NULL,NULL,NULL,1,'2026-08-21 13:39:32',NULL,NULL,0);
/*!40000 ALTER TABLE `trips` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `truck_doc_types`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `truck_doc_types` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `slug` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
  `display_name` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL,
  `has_expiry` tinyint(1) NOT NULL DEFAULT '1',
  `warn_days` int NOT NULL DEFAULT '30',
  `required` tinyint(1) NOT NULL DEFAULT '1',
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `sort_order` int NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_truck_doc_types_slug` (`tenant_id`,`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `truck_doc_types` WRITE;
/*!40000 ALTER TABLE `truck_doc_types` DISABLE KEYS */;
INSERT INTO `truck_doc_types` VALUES (1,1,'registration','Vehicle Registration Card',1,60,1,1,10),(2,1,'insurance','Insurance Policy',1,30,1,1,20),(3,1,'inspection','Annual Inspection',1,30,1,1,30),(4,1,'road_permit','Road Permit',1,30,0,1,40),(5,1,'tra_licence','TRA Transport Licence',1,30,1,1,50),(6,1,'weighbridge','Weighbridge Certificate',1,60,0,1,60),(7,1,'fitness','Fitness Certificate',1,30,0,1,70);
/*!40000 ALTER TABLE `truck_doc_types` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `truck_docs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `truck_docs` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `truck_id` int unsigned NOT NULL,
  `doc_type_id` int unsigned NOT NULL,
  `doc_no` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `issuer` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `issued_on` date DEFAULT NULL,
  `expires_on` date DEFAULT NULL,
  `cost_amount` decimal(14,2) DEFAULT NULL,
  `cost_currency` varchar(6) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'TZS',
  `file_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file_size` int unsigned DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_by` int unsigned DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `edited_by` int unsigned DEFAULT NULL,
  `edited_on` datetime DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  KEY `idx_truck_docs_truck` (`truck_id`,`deleted`),
  KEY `idx_truck_docs_expiry` (`expires_on`,`deleted`),
  KEY `idx_truck_docs_type` (`doc_type_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `truck_docs` WRITE;
/*!40000 ALTER TABLE `truck_docs` DISABLE KEYS */;
INSERT INTO `truck_docs` VALUES (1,1,100,2,'INS-2025-EXPIRED','Jubilee Insurance',NULL,'2026-08-17',NULL,'TZS',NULL,NULL,NULL,'test: expired',NULL,'2026-08-27 13:43:10',NULL,NULL,0),(2,1,100,4,'PERMIT-URGENT','TRA',NULL,'2026-09-01',NULL,'TZS',NULL,NULL,NULL,'test: 0-7d',NULL,'2026-08-27 13:43:10',NULL,NULL,0),(3,1,100,3,'INSP-SOON-A','TRA',NULL,'2026-09-16',NULL,'TZS',NULL,NULL,NULL,'test: 15-30d',NULL,'2026-08-27 13:43:10',NULL,NULL,0),(4,1,100,7,'FIT-DISTANT','SUMATRA',NULL,'2026-11-25',NULL,'TZS',NULL,NULL,NULL,'test: 30+',NULL,'2026-08-27 13:43:10',NULL,NULL,0);
/*!40000 ALTER TABLE `truck_docs` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `truck_pm_schedules`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `truck_pm_schedules` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `truck_id` int unsigned NOT NULL,
  `template_id` int unsigned NOT NULL,
  `baseline_km` int unsigned DEFAULT NULL,
  `baseline_date` date DEFAULT NULL,
  `next_due_km` int unsigned DEFAULT NULL,
  `next_due_date` date DEFAULT NULL,
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `notes` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_by` int unsigned DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `edited_by` int unsigned DEFAULT NULL,
  `edited_on` datetime DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_tps` (`truck_id`,`template_id`,`deleted`),
  KEY `idx_tps_truck` (`truck_id`,`active`,`deleted`),
  KEY `idx_tps_next_km` (`next_due_km`),
  KEY `idx_tps_next_date` (`next_due_date`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `truck_pm_schedules` WRITE;
/*!40000 ALTER TABLE `truck_pm_schedules` DISABLE KEYS */;
INSERT INTO `truck_pm_schedules` VALUES (1,1,100,1,135200,'2026-08-27',145200,'2026-11-25',1,'',1,'2026-08-27 13:18:59',1,'2026-08-27 13:19:00',0),(2,1,100,6,120000,'2025-05-01',140000,'2025-10-28',1,'',1,'2026-08-27 13:18:59',NULL,NULL,0),(3,1,100,8,135000,'2026-08-27',145000,NULL,1,'',1,'2026-08-27 13:18:59',1,'2026-08-27 13:19:00',0);
/*!40000 ALTER TABLE `truck_pm_schedules` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `truck_types`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `truck_types` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `slug` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `display_name` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `sort_order` int NOT NULL DEFAULT '0',
  `created_on` datetime DEFAULT NULL,
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_truck_types_slug` (`tenant_id`,`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `truck_types` WRITE;
/*!40000 ALTER TABLE `truck_types` DISABLE KEYS */;
INSERT INTO `truck_types` VALUES (1,1,'dump','Dump Truck','In-town construction materials, short-cycle',1,10,'2026-08-23 14:43:16'),(2,1,'semi','Regional Semi-Truck','Long-haul cargo, cross-country',1,20,'2026-08-23 14:43:16'),(3,1,'pickup','Pickup / Utility','Light utility vehicle',1,30,'2026-08-23 14:43:16'),(4,1,'trailer','Trailer','Standalone trailer',1,40,'2026-08-23 14:43:16');
/*!40000 ALTER TABLE `truck_types` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `trucks`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `trucks` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `reg_no` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `truck_type_id` int unsigned DEFAULT NULL,
  `make` varchar(60) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `model` varchar(60) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `year` smallint unsigned DEFAULT NULL,
  `chassis_no` varchar(60) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `engine_no` varchar(60) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `colour` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tare_kg` int unsigned DEFAULT NULL,
  `capacity_kg` int unsigned DEFAULT NULL,
  `fuel_tank_liters` int unsigned DEFAULT NULL,
  `current_odometer` int unsigned NOT NULL DEFAULT '0',
  `ownership` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'owned',
  `acquired_on` date DEFAULT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `branch_id` int unsigned DEFAULT NULL,
  `photo_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_by` int unsigned DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `edited_by` int unsigned DEFAULT NULL,
  `edited_on` datetime DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  KEY `idx_trucks_reg` (`tenant_id`,`reg_no`),
  KEY `idx_trucks_status` (`status`,`deleted`),
  KEY `idx_trucks_type` (`truck_type_id`),
  KEY `idx_trucks_deleted` (`deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=105 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `trucks` WRITE;
/*!40000 ALTER TABLE `trucks` DISABLE KEYS */;
INSERT INTO `trucks` VALUES (100,1,'T 999 DEMO',1,'Isuzu','FVR34',2022,NULL,NULL,NULL,NULL,15000,NULL,135000,'owned',NULL,'active',NULL,NULL,NULL,1,'2026-08-23 15:32:00',0,'2026-08-27 10:10:06',0),(101,1,'T 111 IMP',NULL,'Isuzu','NPR75',2020,'','','',NULL,7000,NULL,0,'owned',NULL,'maintenance',NULL,NULL,'',1,'2026-08-23 16:35:18',1,'2026-08-27 07:30:56',0),(102,1,'T 112 IMP',NULL,'FAW','J5',2021,'','','',NULL,12000,NULL,0,'owned',NULL,'active',NULL,NULL,'',1,'2026-08-23 16:35:19',NULL,NULL,0),(103,1,'T 999 IM1',NULL,'Mercedes','Actros',2023,'','','',NULL,40000,NULL,0,'owned',NULL,'active',NULL,NULL,'',1,'2026-08-23 16:37:44',NULL,NULL,0),(104,1,'T 999 IM2',NULL,'Scania','R450',2024,'','','',NULL,38000,NULL,0,'owned',NULL,'active',NULL,NULL,'',1,'2026-08-23 16:37:44',NULL,NULL,0);
/*!40000 ALTER TABLE `trucks` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `user_groups`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `user_groups` (
  `c0d` int NOT NULL AUTO_INCREMENT,
  `user_group_name` varchar(60) NOT NULL,
  `created_by` int NOT NULL DEFAULT '0',
  `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `edited_by` int NOT NULL DEFAULT '0',
  `edited_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_group_name` (`user_group_name`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `user_groups` WRITE;
/*!40000 ALTER TABLE `user_groups` DISABLE KEYS */;
INSERT INTO `user_groups` VALUES (1,'Executive',0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(2,'Finance Manager',0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(3,'Accountant',0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(4,'Project Manager',0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(5,'Projects Coordinator',0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(6,'Field Supervisor',0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(7,'Procurement',0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(8,'Stores',0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(9,'CRM',0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(10,'Administrator',0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(20,'Ops Manager',0,'2026-08-23 12:12:12',0,'2026-08-23 12:12:12',0),(21,'Dispatcher',0,'2026-08-23 12:12:12',0,'2026-08-23 12:12:12',0),(22,'Fleet Manager',0,'2026-08-23 12:12:12',0,'2026-08-23 12:12:12',0),(23,'Fuel Officer',0,'2026-08-23 12:12:12',0,'2026-08-23 12:12:12',0),(24,'HR Officer',0,'2026-08-23 12:12:12',0,'2026-08-23 12:12:12',0),(25,'Driver',0,'2026-08-23 12:12:12',0,'2026-08-23 12:12:12',0);
/*!40000 ALTER TABLE `user_groups` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `user_groups_perms`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `user_groups_perms` (
  `c0d` int NOT NULL AUTO_INCREMENT,
  `user_group_id` int NOT NULL,
  `controller_allowed` varchar(80) NOT NULL,
  `action_allowed` varchar(80) NOT NULL,
  `created_by` int NOT NULL DEFAULT '0',
  `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_perm` (`user_group_id`,`controller_allowed`,`action_allowed`),
  KEY `ix_group` (`user_group_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1390 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `user_groups_perms` WRITE;
/*!40000 ALTER TABLE `user_groups_perms` DISABLE KEYS */;
INSERT INTO `user_groups_perms` VALUES (1,3,'Dashboard','index',0,'2026-08-23 11:39:28'),(2,10,'Dashboard','index',0,'2026-08-23 11:39:28'),(3,9,'Dashboard','index',0,'2026-08-23 11:39:28'),(4,1,'Dashboard','index',0,'2026-08-23 11:39:28'),(5,6,'Dashboard','index',0,'2026-08-23 11:39:28'),(6,2,'Dashboard','index',0,'2026-08-23 11:39:28'),(7,7,'Dashboard','index',0,'2026-08-23 11:39:28'),(8,4,'Dashboard','index',0,'2026-08-23 11:39:28'),(9,5,'Dashboard','index',0,'2026-08-23 11:39:28'),(10,8,'Dashboard','index',0,'2026-08-23 11:39:28'),(16,3,'Logout','index',0,'2026-08-23 11:39:28'),(17,10,'Logout','index',0,'2026-08-23 11:39:28'),(18,9,'Logout','index',0,'2026-08-23 11:39:28'),(19,1,'Logout','index',0,'2026-08-23 11:39:28'),(20,6,'Logout','index',0,'2026-08-23 11:39:28'),(21,2,'Logout','index',0,'2026-08-23 11:39:28'),(22,7,'Logout','index',0,'2026-08-23 11:39:28'),(23,4,'Logout','index',0,'2026-08-23 11:39:28'),(24,5,'Logout','index',0,'2026-08-23 11:39:28'),(25,8,'Logout','index',0,'2026-08-23 11:39:28'),(31,3,'Notifications','markAllReadAj',0,'2026-08-23 11:39:28'),(32,3,'Notifications','markReadAj',0,'2026-08-23 11:39:28'),(33,3,'Notifications','recentAj',0,'2026-08-23 11:39:28'),(34,3,'Notifications','unreadCountAj',0,'2026-08-23 11:39:28'),(35,3,'Notifications','index',0,'2026-08-23 11:39:28'),(36,10,'Notifications','markAllReadAj',0,'2026-08-23 11:39:28'),(37,10,'Notifications','markReadAj',0,'2026-08-23 11:39:28'),(38,10,'Notifications','recentAj',0,'2026-08-23 11:39:28'),(39,10,'Notifications','unreadCountAj',0,'2026-08-23 11:39:28'),(40,10,'Notifications','index',0,'2026-08-23 11:39:28'),(41,9,'Notifications','markAllReadAj',0,'2026-08-23 11:39:28'),(42,9,'Notifications','markReadAj',0,'2026-08-23 11:39:28'),(43,9,'Notifications','recentAj',0,'2026-08-23 11:39:28'),(44,9,'Notifications','unreadCountAj',0,'2026-08-23 11:39:28'),(45,9,'Notifications','index',0,'2026-08-23 11:39:28'),(46,1,'Notifications','markAllReadAj',0,'2026-08-23 11:39:28'),(47,1,'Notifications','markReadAj',0,'2026-08-23 11:39:28'),(48,1,'Notifications','recentAj',0,'2026-08-23 11:39:28'),(49,1,'Notifications','unreadCountAj',0,'2026-08-23 11:39:28'),(50,1,'Notifications','index',0,'2026-08-23 11:39:28'),(51,6,'Notifications','markAllReadAj',0,'2026-08-23 11:39:28'),(52,6,'Notifications','markReadAj',0,'2026-08-23 11:39:28'),(53,6,'Notifications','recentAj',0,'2026-08-23 11:39:28'),(54,6,'Notifications','unreadCountAj',0,'2026-08-23 11:39:28'),(55,6,'Notifications','index',0,'2026-08-23 11:39:28'),(56,2,'Notifications','markAllReadAj',0,'2026-08-23 11:39:28'),(57,2,'Notifications','markReadAj',0,'2026-08-23 11:39:28'),(58,2,'Notifications','recentAj',0,'2026-08-23 11:39:28'),(59,2,'Notifications','unreadCountAj',0,'2026-08-23 11:39:28'),(60,2,'Notifications','index',0,'2026-08-23 11:39:28'),(61,7,'Notifications','markAllReadAj',0,'2026-08-23 11:39:28'),(62,7,'Notifications','markReadAj',0,'2026-08-23 11:39:28'),(63,7,'Notifications','recentAj',0,'2026-08-23 11:39:28'),(64,7,'Notifications','unreadCountAj',0,'2026-08-23 11:39:28'),(65,7,'Notifications','index',0,'2026-08-23 11:39:28'),(66,4,'Notifications','markAllReadAj',0,'2026-08-23 11:39:28'),(67,4,'Notifications','markReadAj',0,'2026-08-23 11:39:28'),(68,4,'Notifications','recentAj',0,'2026-08-23 11:39:28'),(69,4,'Notifications','unreadCountAj',0,'2026-08-23 11:39:28'),(70,4,'Notifications','index',0,'2026-08-23 11:39:28'),(71,5,'Notifications','markAllReadAj',0,'2026-08-23 11:39:28'),(72,5,'Notifications','markReadAj',0,'2026-08-23 11:39:28'),(73,5,'Notifications','recentAj',0,'2026-08-23 11:39:28'),(74,5,'Notifications','unreadCountAj',0,'2026-08-23 11:39:28'),(75,5,'Notifications','index',0,'2026-08-23 11:39:28'),(76,8,'Notifications','markAllReadAj',0,'2026-08-23 11:39:28'),(77,8,'Notifications','markReadAj',0,'2026-08-23 11:39:28'),(78,8,'Notifications','recentAj',0,'2026-08-23 11:39:28'),(79,8,'Notifications','unreadCountAj',0,'2026-08-23 11:39:28'),(80,8,'Notifications','index',0,'2026-08-23 11:39:28'),(94,2,'Tenders','pricingCreateVersionAj',0,'2026-08-23 11:39:28'),(95,9,'Tenders','pricingCreateVersionAj',0,'2026-08-23 11:39:28'),(96,10,'Tenders','pricingCreateVersionAj',0,'2026-08-23 11:39:28'),(97,2,'Tenders','pricingUpdateVersionAj',0,'2026-08-23 11:39:28'),(98,9,'Tenders','pricingUpdateVersionAj',0,'2026-08-23 11:39:28'),(99,10,'Tenders','pricingUpdateVersionAj',0,'2026-08-23 11:39:28'),(100,2,'Tenders','pricingAddSectionAj',0,'2026-08-23 11:39:28'),(101,9,'Tenders','pricingAddSectionAj',0,'2026-08-23 11:39:28'),(102,10,'Tenders','pricingAddSectionAj',0,'2026-08-23 11:39:28'),(103,2,'Tenders','pricingUpdateSectionAj',0,'2026-08-23 11:39:28'),(104,9,'Tenders','pricingUpdateSectionAj',0,'2026-08-23 11:39:28'),(105,10,'Tenders','pricingUpdateSectionAj',0,'2026-08-23 11:39:28'),(106,2,'Tenders','pricingDeleteSectionAj',0,'2026-08-23 11:39:28'),(107,9,'Tenders','pricingDeleteSectionAj',0,'2026-08-23 11:39:28'),(108,10,'Tenders','pricingDeleteSectionAj',0,'2026-08-23 11:39:28'),(109,2,'Tenders','pricingAddLineAj',0,'2026-08-23 11:39:28'),(110,9,'Tenders','pricingAddLineAj',0,'2026-08-23 11:39:28'),(111,10,'Tenders','pricingAddLineAj',0,'2026-08-23 11:39:28'),(112,2,'Tenders','pricingUpdateLineAj',0,'2026-08-23 11:39:28'),(113,9,'Tenders','pricingUpdateLineAj',0,'2026-08-23 11:39:28'),(114,10,'Tenders','pricingUpdateLineAj',0,'2026-08-23 11:39:28'),(115,2,'Tenders','pricingDeleteLineAj',0,'2026-08-23 11:39:28'),(116,9,'Tenders','pricingDeleteLineAj',0,'2026-08-23 11:39:28'),(117,10,'Tenders','pricingDeleteLineAj',0,'2026-08-23 11:39:28'),(118,2,'Tenders','pricingSubmitAj',0,'2026-08-23 11:39:28'),(119,9,'Tenders','pricingSubmitAj',0,'2026-08-23 11:39:28'),(120,10,'Tenders','pricingSubmitAj',0,'2026-08-23 11:39:28'),(121,2,'Tenders','pricingApplyAj',0,'2026-08-23 11:39:28'),(122,9,'Tenders','pricingApplyAj',0,'2026-08-23 11:39:28'),(123,10,'Tenders','pricingApplyAj',0,'2026-08-23 11:39:28'),(125,10,'Tenders','pricingXlsx',0,'2026-08-23 11:39:28'),(126,9,'Tenders','pricingXlsx',0,'2026-08-23 11:39:28'),(127,1,'Tenders','pricingXlsx',0,'2026-08-23 11:39:28'),(128,2,'Tenders','pricingXlsx',0,'2026-08-23 11:39:28'),(129,4,'Tenders','pricingXlsx',0,'2026-08-23 11:39:28'),(130,5,'Tenders','pricingXlsx',0,'2026-08-23 11:39:28'),(202,10,'Trucks','index',1,'2026-08-23 11:55:07'),(203,10,'Trucks','add',1,'2026-08-23 11:55:07'),(204,10,'Trucks','view',1,'2026-08-23 11:55:07'),(205,10,'Trucks','edit',1,'2026-08-23 11:55:07'),(206,10,'Trucks','delete',1,'2026-08-23 11:55:07'),(207,10,'Trucks','uploadDoc',1,'2026-08-23 11:55:07'),(208,10,'Trucks','deleteDoc',1,'2026-08-23 11:55:07'),(209,10,'Trucks','viewDoc',1,'2026-08-23 11:55:07'),(210,1,'Trucks','index',1,'2026-08-23 12:12:12'),(211,1,'Trucks','view',1,'2026-08-23 12:12:12'),(212,20,'Trucks','index',1,'2026-08-23 12:12:12'),(213,20,'Trucks','add',1,'2026-08-23 12:12:12'),(214,20,'Trucks','view',1,'2026-08-23 12:12:12'),(215,20,'Trucks','edit',1,'2026-08-23 12:12:12'),(216,20,'Trucks','delete',1,'2026-08-23 12:12:12'),(217,20,'Trucks','uploadDoc',1,'2026-08-23 12:12:12'),(218,20,'Trucks','deleteDoc',1,'2026-08-23 12:12:12'),(219,20,'Trucks','viewDoc',1,'2026-08-23 12:12:12'),(220,21,'Trucks','index',1,'2026-08-23 12:12:12'),(221,21,'Trucks','view',1,'2026-08-23 12:12:12'),(222,22,'Trucks','index',1,'2026-08-23 12:12:12'),(223,22,'Trucks','add',1,'2026-08-23 12:12:12'),(224,22,'Trucks','view',1,'2026-08-23 12:12:12'),(225,22,'Trucks','edit',1,'2026-08-23 12:12:12'),(226,22,'Trucks','delete',1,'2026-08-23 12:12:12'),(227,22,'Trucks','uploadDoc',1,'2026-08-23 12:12:12'),(228,22,'Trucks','deleteDoc',1,'2026-08-23 12:12:12'),(229,22,'Trucks','viewDoc',1,'2026-08-23 12:12:12'),(230,24,'Trucks','index',1,'2026-08-23 12:12:12'),(231,24,'Trucks','view',1,'2026-08-23 12:12:12'),(232,3,'Trucks','index',1,'2026-08-23 12:12:12'),(233,3,'Trucks','view',1,'2026-08-23 12:12:12'),(234,2,'Trucks','index',1,'2026-08-23 12:12:12'),(235,2,'Trucks','view',1,'2026-08-23 12:12:12'),(236,10,'Drivers','index',1,'2026-08-23 12:12:12'),(237,10,'Drivers','add',1,'2026-08-23 12:12:12'),(238,10,'Drivers','view',1,'2026-08-23 12:12:12'),(239,10,'Drivers','edit',1,'2026-08-23 12:12:12'),(240,10,'Drivers','delete',1,'2026-08-23 12:12:12'),(241,10,'Drivers','uploadDoc',1,'2026-08-23 12:12:12'),(242,10,'Drivers','deleteDoc',1,'2026-08-23 12:12:12'),(243,10,'Drivers','viewDoc',1,'2026-08-23 12:12:12'),(244,1,'Drivers','index',1,'2026-08-23 12:12:12'),(245,1,'Drivers','view',1,'2026-08-23 12:12:12'),(246,20,'Drivers','index',1,'2026-08-23 12:12:12'),(247,20,'Drivers','view',1,'2026-08-23 12:12:12'),(248,20,'Drivers','edit',1,'2026-08-23 12:12:12'),(249,21,'Drivers','index',1,'2026-08-23 12:12:12'),(250,21,'Drivers','view',1,'2026-08-23 12:12:12'),(251,22,'Drivers','index',1,'2026-08-23 12:12:12'),(252,22,'Drivers','view',1,'2026-08-23 12:12:12'),(253,24,'Drivers','index',1,'2026-08-23 12:12:12'),(254,24,'Drivers','add',1,'2026-08-23 12:12:12'),(255,24,'Drivers','view',1,'2026-08-23 12:12:12'),(256,24,'Drivers','edit',1,'2026-08-23 12:12:12'),(257,24,'Drivers','delete',1,'2026-08-23 12:12:12'),(258,24,'Drivers','uploadDoc',1,'2026-08-23 12:12:12'),(259,24,'Drivers','deleteDoc',1,'2026-08-23 12:12:12'),(260,24,'Drivers','viewDoc',1,'2026-08-23 12:12:12'),(261,3,'Drivers','index',1,'2026-08-23 12:12:12'),(262,3,'Drivers','view',1,'2026-08-23 12:12:12'),(263,2,'Drivers','index',1,'2026-08-23 12:12:12'),(264,2,'Drivers','view',1,'2026-08-23 12:12:12'),(265,10,'DriverAssignments','index',1,'2026-08-23 12:30:44'),(266,10,'DriverAssignments','add',1,'2026-08-23 12:30:44'),(267,10,'DriverAssignments','view',1,'2026-08-23 12:30:44'),(268,10,'DriverAssignments','end',1,'2026-08-23 12:30:44'),(269,10,'DriverAssignments','delete',1,'2026-08-23 12:30:44'),(270,20,'DriverAssignments','index',1,'2026-08-23 12:30:44'),(271,20,'DriverAssignments','add',1,'2026-08-23 12:30:44'),(272,20,'DriverAssignments','view',1,'2026-08-23 12:30:44'),(273,20,'DriverAssignments','end',1,'2026-08-23 12:30:44'),(274,20,'DriverAssignments','delete',1,'2026-08-23 12:30:44'),(275,22,'DriverAssignments','index',1,'2026-08-23 12:30:44'),(276,22,'DriverAssignments','add',1,'2026-08-23 12:30:44'),(277,22,'DriverAssignments','view',1,'2026-08-23 12:30:44'),(278,22,'DriverAssignments','end',1,'2026-08-23 12:30:44'),(279,22,'DriverAssignments','delete',1,'2026-08-23 12:30:44'),(280,21,'DriverAssignments','index',1,'2026-08-23 12:30:44'),(281,21,'DriverAssignments','view',1,'2026-08-23 12:30:44'),(282,24,'DriverAssignments','index',1,'2026-08-23 12:30:44'),(283,24,'DriverAssignments','view',1,'2026-08-23 12:30:44'),(284,1,'DriverAssignments','index',1,'2026-08-23 12:30:44'),(285,1,'DriverAssignments','view',1,'2026-08-23 12:30:44'),(286,3,'DriverAssignments','index',1,'2026-08-23 12:30:44'),(287,3,'DriverAssignments','view',1,'2026-08-23 12:30:44'),(288,2,'DriverAssignments','index',1,'2026-08-23 12:30:44'),(289,2,'DriverAssignments','view',1,'2026-08-23 12:30:44'),(290,10,'Customers','index',1,'2026-08-23 12:58:51'),(291,10,'Customers','add',1,'2026-08-23 12:58:51'),(292,10,'Customers','save',1,'2026-08-23 12:58:51'),(293,10,'Customers','view',1,'2026-08-23 12:58:51'),(294,10,'Customers','edit',1,'2026-08-23 12:58:51'),(295,10,'Customers','update',1,'2026-08-23 12:58:51'),(296,10,'Customers','delete',1,'2026-08-23 12:58:51'),(297,1,'Customers','index',1,'2026-08-23 12:58:51'),(298,1,'Customers','view',1,'2026-08-23 12:58:51'),(299,20,'Customers','index',1,'2026-08-23 12:58:51'),(300,20,'Customers','add',1,'2026-08-23 12:58:51'),(301,20,'Customers','save',1,'2026-08-23 12:58:51'),(302,20,'Customers','view',1,'2026-08-23 12:58:51'),(303,20,'Customers','edit',1,'2026-08-23 12:58:51'),(304,20,'Customers','update',1,'2026-08-23 12:58:51'),(305,21,'Customers','index',1,'2026-08-23 12:58:51'),(306,21,'Customers','view',1,'2026-08-23 12:58:51'),(307,3,'Customers','index',1,'2026-08-23 12:58:51'),(308,3,'Customers','add',1,'2026-08-23 12:58:51'),(309,3,'Customers','save',1,'2026-08-23 12:58:51'),(310,3,'Customers','view',1,'2026-08-23 12:58:51'),(311,3,'Customers','edit',1,'2026-08-23 12:58:51'),(312,3,'Customers','update',1,'2026-08-23 12:58:51'),(313,3,'Customers','delete',1,'2026-08-23 12:58:51'),(314,2,'Customers','index',1,'2026-08-23 12:58:51'),(315,2,'Customers','add',1,'2026-08-23 12:58:51'),(316,2,'Customers','save',1,'2026-08-23 12:58:51'),(317,2,'Customers','view',1,'2026-08-23 12:58:51'),(318,2,'Customers','edit',1,'2026-08-23 12:58:51'),(319,2,'Customers','update',1,'2026-08-23 12:58:51'),(320,2,'Customers','delete',1,'2026-08-23 12:58:51'),(321,10,'Routes','index',1,'2026-08-23 13:14:35'),(322,10,'Routes','add',1,'2026-08-23 13:14:35'),(323,10,'Routes','save',1,'2026-08-23 13:14:35'),(324,10,'Routes','view',1,'2026-08-23 13:14:35'),(325,10,'Routes','edit',1,'2026-08-23 13:14:35'),(326,10,'Routes','update',1,'2026-08-23 13:14:35'),(327,10,'Routes','delete',1,'2026-08-23 13:14:35'),(328,20,'Routes','index',1,'2026-08-23 13:14:35'),(329,20,'Routes','add',1,'2026-08-23 13:14:35'),(330,20,'Routes','save',1,'2026-08-23 13:14:35'),(331,20,'Routes','view',1,'2026-08-23 13:14:35'),(332,20,'Routes','edit',1,'2026-08-23 13:14:35'),(333,20,'Routes','update',1,'2026-08-23 13:14:35'),(334,20,'Routes','delete',1,'2026-08-23 13:14:35'),(335,21,'Routes','index',1,'2026-08-23 13:14:35'),(336,21,'Routes','add',1,'2026-08-23 13:14:35'),(337,21,'Routes','save',1,'2026-08-23 13:14:35'),(338,21,'Routes','view',1,'2026-08-23 13:14:35'),(339,21,'Routes','edit',1,'2026-08-23 13:14:35'),(340,21,'Routes','update',1,'2026-08-23 13:14:35'),(341,22,'Routes','index',1,'2026-08-23 13:14:35'),(342,22,'Routes','view',1,'2026-08-23 13:14:35'),(343,1,'Routes','index',1,'2026-08-23 13:14:35'),(344,1,'Routes','view',1,'2026-08-23 13:14:35'),(345,3,'Routes','index',1,'2026-08-23 13:14:35'),(346,3,'Routes','view',1,'2026-08-23 13:14:35'),(347,2,'Routes','index',1,'2026-08-23 13:14:35'),(348,2,'Routes','view',1,'2026-08-23 13:14:35'),(349,10,'TripRequests','index',1,'2026-08-23 13:14:35'),(350,10,'TripRequests','add',1,'2026-08-23 13:14:35'),(351,10,'TripRequests','save',1,'2026-08-23 13:14:35'),(352,10,'TripRequests','view',1,'2026-08-23 13:14:35'),(353,10,'TripRequests','edit',1,'2026-08-23 13:14:35'),(354,10,'TripRequests','update',1,'2026-08-23 13:14:35'),(355,10,'TripRequests','delete',1,'2026-08-23 13:14:35'),(356,10,'TripRequests','submit',1,'2026-08-23 13:14:35'),(357,10,'TripRequests','approve',1,'2026-08-23 13:14:35'),(358,10,'TripRequests','reject',1,'2026-08-23 13:14:35'),(359,10,'TripRequests','cancel',1,'2026-08-23 13:14:35'),(360,20,'TripRequests','index',1,'2026-08-23 13:14:35'),(361,20,'TripRequests','add',1,'2026-08-23 13:14:35'),(362,20,'TripRequests','save',1,'2026-08-23 13:14:35'),(363,20,'TripRequests','view',1,'2026-08-23 13:14:35'),(364,20,'TripRequests','edit',1,'2026-08-23 13:14:35'),(365,20,'TripRequests','update',1,'2026-08-23 13:14:35'),(366,20,'TripRequests','delete',1,'2026-08-23 13:14:35'),(367,20,'TripRequests','submit',1,'2026-08-23 13:14:35'),(368,20,'TripRequests','approve',1,'2026-08-23 13:14:35'),(369,20,'TripRequests','reject',1,'2026-08-23 13:14:35'),(370,20,'TripRequests','cancel',1,'2026-08-23 13:14:35'),(371,21,'TripRequests','index',1,'2026-08-23 13:14:35'),(372,21,'TripRequests','add',1,'2026-08-23 13:14:35'),(373,21,'TripRequests','save',1,'2026-08-23 13:14:35'),(374,21,'TripRequests','view',1,'2026-08-23 13:14:35'),(375,21,'TripRequests','edit',1,'2026-08-23 13:14:35'),(376,21,'TripRequests','update',1,'2026-08-23 13:14:35'),(377,21,'TripRequests','submit',1,'2026-08-23 13:14:35'),(378,21,'TripRequests','cancel',1,'2026-08-23 13:14:35'),(379,1,'TripRequests','index',1,'2026-08-23 13:14:35'),(380,1,'TripRequests','view',1,'2026-08-23 13:14:35'),(381,3,'TripRequests','index',1,'2026-08-23 13:14:35'),(382,3,'TripRequests','view',1,'2026-08-23 13:14:35'),(383,2,'TripRequests','index',1,'2026-08-23 13:14:35'),(384,2,'TripRequests','view',1,'2026-08-23 13:14:35'),(385,10,'Trips','index',1,'2026-08-23 13:22:54'),(386,10,'Trips','view',1,'2026-08-23 13:22:54'),(387,10,'Trips','dispatch',1,'2026-08-23 13:22:54'),(388,10,'Trips','start',1,'2026-08-23 13:22:54'),(389,10,'Trips','deliver',1,'2026-08-23 13:22:54'),(390,10,'Trips','close',1,'2026-08-23 13:22:54'),(391,10,'Trips','cancel',1,'2026-08-23 13:22:54'),(392,10,'Trips','delete',1,'2026-08-23 13:22:54'),(393,10,'Trips','board',1,'2026-08-23 13:22:54'),(394,10,'Trips','boardDataAj',1,'2026-08-23 13:22:54'),(395,20,'Trips','index',1,'2026-08-23 13:22:54'),(396,20,'Trips','view',1,'2026-08-23 13:22:54'),(397,20,'Trips','dispatch',1,'2026-08-23 13:22:54'),(398,20,'Trips','start',1,'2026-08-23 13:22:54'),(399,20,'Trips','deliver',1,'2026-08-23 13:22:54'),(400,20,'Trips','close',1,'2026-08-23 13:22:54'),(401,20,'Trips','cancel',1,'2026-08-23 13:22:54'),(402,20,'Trips','delete',1,'2026-08-23 13:22:54'),(403,20,'Trips','board',1,'2026-08-23 13:22:54'),(404,20,'Trips','boardDataAj',1,'2026-08-23 13:22:54'),(405,21,'Trips','index',1,'2026-08-23 13:22:54'),(406,21,'Trips','view',1,'2026-08-23 13:22:54'),(407,21,'Trips','dispatch',1,'2026-08-23 13:22:54'),(408,21,'Trips','start',1,'2026-08-23 13:22:54'),(409,21,'Trips','deliver',1,'2026-08-23 13:22:54'),(410,21,'Trips','close',1,'2026-08-23 13:22:54'),(411,21,'Trips','cancel',1,'2026-08-23 13:22:54'),(412,21,'Trips','board',1,'2026-08-23 13:22:54'),(413,21,'Trips','boardDataAj',1,'2026-08-23 13:22:54'),(414,22,'Trips','index',1,'2026-08-23 13:22:54'),(415,22,'Trips','view',1,'2026-08-23 13:22:54'),(416,22,'Trips','board',1,'2026-08-23 13:22:54'),(417,22,'Trips','boardDataAj',1,'2026-08-23 13:22:54'),(418,1,'Trips','index',1,'2026-08-23 13:22:54'),(419,1,'Trips','view',1,'2026-08-23 13:22:54'),(420,1,'Trips','board',1,'2026-08-23 13:22:54'),(421,1,'Trips','boardDataAj',1,'2026-08-23 13:22:54'),(422,3,'Trips','index',1,'2026-08-23 13:22:54'),(423,3,'Trips','view',1,'2026-08-23 13:22:54'),(424,2,'Trips','index',1,'2026-08-23 13:22:54'),(425,2,'Trips','view',1,'2026-08-23 13:22:54'),(426,10,'Import','index',1,'2026-08-23 13:33:46'),(427,10,'Import','trucksAj',1,'2026-08-23 13:33:46'),(428,10,'Import','driversAj',1,'2026-08-23 13:33:46'),(429,10,'Import','customersAj',1,'2026-08-23 13:33:46'),(430,20,'Import','index',1,'2026-08-23 13:33:46'),(431,20,'Import','trucksAj',1,'2026-08-23 13:33:46'),(432,20,'Import','customersAj',1,'2026-08-23 13:33:46'),(433,22,'Import','index',1,'2026-08-23 13:33:46'),(434,22,'Import','trucksAj',1,'2026-08-23 13:33:46'),(435,24,'Import','index',1,'2026-08-23 13:33:46'),(436,24,'Import','driversAj',1,'2026-08-23 13:33:46'),(437,3,'Import','index',1,'2026-08-23 13:33:46'),(438,3,'Import','customersAj',1,'2026-08-23 13:33:46'),(439,10,'ChartOfAccounts','index',1,'2026-08-23 13:49:02'),(440,10,'ChartOfAccounts','view',1,'2026-08-23 13:49:02'),(441,10,'ChartOfAccounts','add',1,'2026-08-23 13:49:02'),(442,10,'ChartOfAccounts','save',1,'2026-08-23 13:49:02'),(443,10,'ChartOfAccounts','edit',1,'2026-08-23 13:49:02'),(444,10,'ChartOfAccounts','update',1,'2026-08-23 13:49:02'),(445,10,'Journals','index',1,'2026-08-23 13:49:02'),(446,10,'Journals','view',1,'2026-08-23 13:49:02'),(447,10,'Cashbook','index',1,'2026-08-23 13:49:02'),(448,10,'FinancialStatements','index',1,'2026-08-23 13:49:02'),(453,3,'ChartOfAccounts','index',1,'2026-08-23 13:49:02'),(454,3,'ChartOfAccounts','view',1,'2026-08-23 13:49:02'),(455,3,'ChartOfAccounts','add',1,'2026-08-23 13:49:02'),(456,3,'ChartOfAccounts','save',1,'2026-08-23 13:49:02'),(457,3,'ChartOfAccounts','edit',1,'2026-08-23 13:49:02'),(458,3,'ChartOfAccounts','update',1,'2026-08-23 13:49:02'),(459,3,'Journals','index',1,'2026-08-23 13:49:02'),(460,3,'Journals','view',1,'2026-08-23 13:49:02'),(461,3,'Cashbook','index',1,'2026-08-23 13:49:02'),(462,3,'FinancialStatements','index',1,'2026-08-23 13:49:02'),(467,2,'ChartOfAccounts','index',1,'2026-08-23 13:49:02'),(468,2,'ChartOfAccounts','view',1,'2026-08-23 13:49:02'),(469,2,'ChartOfAccounts','add',1,'2026-08-23 13:49:02'),(470,2,'ChartOfAccounts','save',1,'2026-08-23 13:49:02'),(471,2,'ChartOfAccounts','edit',1,'2026-08-23 13:49:02'),(472,2,'ChartOfAccounts','update',1,'2026-08-23 13:49:02'),(473,2,'Journals','index',1,'2026-08-23 13:49:02'),(474,2,'Journals','view',1,'2026-08-23 13:49:02'),(475,2,'Cashbook','index',1,'2026-08-23 13:49:02'),(476,2,'FinancialStatements','index',1,'2026-08-23 13:49:02'),(481,1,'ChartOfAccounts','index',1,'2026-08-23 13:49:02'),(482,1,'ChartOfAccounts','view',1,'2026-08-23 13:49:02'),(483,1,'Journals','index',1,'2026-08-23 13:49:02'),(484,1,'Journals','view',1,'2026-08-23 13:49:02'),(485,1,'Cashbook','index',1,'2026-08-23 13:49:02'),(486,1,'FinancialStatements','index',1,'2026-08-23 13:49:02'),(491,10,'Expenses','index',1,'2026-08-23 14:04:33'),(492,10,'Expenses','view',1,'2026-08-23 14:04:33'),(493,10,'Expenses','add',1,'2026-08-23 14:04:33'),(494,10,'Expenses','save',1,'2026-08-23 14:04:33'),(495,10,'Expenses','edit',1,'2026-08-23 14:04:33'),(496,10,'Expenses','update',1,'2026-08-23 14:04:33'),(497,10,'Expenses','submit',1,'2026-08-23 14:04:33'),(498,10,'Expenses','review',1,'2026-08-23 14:04:33'),(499,10,'Expenses','approve',1,'2026-08-23 14:04:33'),(500,10,'Expenses','reject',1,'2026-08-23 14:04:33'),(501,10,'Expenses','cancel',1,'2026-08-23 14:04:33'),(502,10,'Expenses','pay',1,'2026-08-23 14:04:33'),(503,10,'Expenses','delete',1,'2026-08-23 14:04:33'),(504,3,'Expenses','index',1,'2026-08-23 14:04:33'),(505,3,'Expenses','view',1,'2026-08-23 14:04:33'),(506,3,'Expenses','add',1,'2026-08-23 14:04:33'),(507,3,'Expenses','save',1,'2026-08-23 14:04:33'),(508,3,'Expenses','edit',1,'2026-08-23 14:04:33'),(509,3,'Expenses','update',1,'2026-08-23 14:04:33'),(510,3,'Expenses','submit',1,'2026-08-23 14:04:33'),(511,3,'Expenses','review',1,'2026-08-23 14:04:33'),(512,3,'Expenses','approve',1,'2026-08-23 14:04:33'),(513,3,'Expenses','reject',1,'2026-08-23 14:04:33'),(514,3,'Expenses','cancel',1,'2026-08-23 14:04:33'),(515,3,'Expenses','pay',1,'2026-08-23 14:04:33'),(516,2,'Expenses','index',1,'2026-08-23 14:04:33'),(517,2,'Expenses','view',1,'2026-08-23 14:04:33'),(518,2,'Expenses','add',1,'2026-08-23 14:04:33'),(519,2,'Expenses','save',1,'2026-08-23 14:04:33'),(520,2,'Expenses','edit',1,'2026-08-23 14:04:33'),(521,2,'Expenses','update',1,'2026-08-23 14:04:33'),(522,2,'Expenses','submit',1,'2026-08-23 14:04:33'),(523,2,'Expenses','review',1,'2026-08-23 14:04:33'),(524,2,'Expenses','approve',1,'2026-08-23 14:04:33'),(525,2,'Expenses','reject',1,'2026-08-23 14:04:33'),(526,2,'Expenses','cancel',1,'2026-08-23 14:04:33'),(527,2,'Expenses','pay',1,'2026-08-23 14:04:33'),(528,20,'Expenses','index',1,'2026-08-23 14:04:33'),(529,20,'Expenses','view',1,'2026-08-23 14:04:33'),(530,20,'Expenses','add',1,'2026-08-23 14:04:33'),(531,20,'Expenses','save',1,'2026-08-23 14:04:33'),(532,20,'Expenses','edit',1,'2026-08-23 14:04:33'),(533,20,'Expenses','update',1,'2026-08-23 14:04:33'),(534,20,'Expenses','submit',1,'2026-08-23 14:04:33'),(535,20,'Expenses','cancel',1,'2026-08-23 14:04:33'),(536,22,'Expenses','index',1,'2026-08-23 14:04:33'),(537,22,'Expenses','view',1,'2026-08-23 14:04:33'),(538,22,'Expenses','add',1,'2026-08-23 14:04:33'),(539,22,'Expenses','save',1,'2026-08-23 14:04:33'),(540,22,'Expenses','edit',1,'2026-08-23 14:04:33'),(541,22,'Expenses','update',1,'2026-08-23 14:04:33'),(542,22,'Expenses','submit',1,'2026-08-23 14:04:33'),(543,22,'Expenses','cancel',1,'2026-08-23 14:04:33'),(544,23,'Expenses','index',1,'2026-08-23 14:04:33'),(545,23,'Expenses','view',1,'2026-08-23 14:04:33'),(546,23,'Expenses','add',1,'2026-08-23 14:04:33'),(547,23,'Expenses','save',1,'2026-08-23 14:04:33'),(548,23,'Expenses','edit',1,'2026-08-23 14:04:33'),(549,23,'Expenses','update',1,'2026-08-23 14:04:33'),(550,23,'Expenses','submit',1,'2026-08-23 14:04:33'),(551,23,'Expenses','cancel',1,'2026-08-23 14:04:33'),(552,24,'Expenses','index',1,'2026-08-23 14:04:33'),(553,24,'Expenses','view',1,'2026-08-23 14:04:33'),(554,24,'Expenses','add',1,'2026-08-23 14:04:33'),(555,24,'Expenses','save',1,'2026-08-23 14:04:33'),(556,24,'Expenses','edit',1,'2026-08-23 14:04:33'),(557,24,'Expenses','update',1,'2026-08-23 14:04:33'),(558,24,'Expenses','submit',1,'2026-08-23 14:04:33'),(559,24,'Expenses','cancel',1,'2026-08-23 14:04:33'),(560,21,'Expenses','index',1,'2026-08-23 14:04:33'),(561,21,'Expenses','view',1,'2026-08-23 14:04:33'),(562,21,'Expenses','add',1,'2026-08-23 14:04:33'),(563,21,'Expenses','save',1,'2026-08-23 14:04:33'),(564,21,'Expenses','edit',1,'2026-08-23 14:04:33'),(565,21,'Expenses','update',1,'2026-08-23 14:04:33'),(566,21,'Expenses','submit',1,'2026-08-23 14:04:33'),(567,21,'Expenses','cancel',1,'2026-08-23 14:04:33'),(568,1,'Expenses','index',1,'2026-08-23 14:04:33'),(569,1,'Expenses','view',1,'2026-08-23 14:04:33'),(570,10,'FuelEntries','index',1,'2026-08-23 14:21:18'),(571,10,'FuelEntries','view',1,'2026-08-23 14:21:18'),(572,10,'FuelEntries','add',1,'2026-08-23 14:21:18'),(573,10,'FuelEntries','save',1,'2026-08-23 14:21:18'),(574,10,'FuelEntries','edit',1,'2026-08-23 14:21:18'),(575,10,'FuelEntries','update',1,'2026-08-23 14:21:18'),(576,10,'FuelEntries','void',1,'2026-08-23 14:21:18'),(577,10,'FuelEntries','delete',1,'2026-08-23 14:21:18'),(578,23,'FuelEntries','index',1,'2026-08-23 14:21:18'),(579,23,'FuelEntries','view',1,'2026-08-23 14:21:18'),(580,23,'FuelEntries','add',1,'2026-08-23 14:21:18'),(581,23,'FuelEntries','save',1,'2026-08-23 14:21:18'),(582,23,'FuelEntries','edit',1,'2026-08-23 14:21:18'),(583,23,'FuelEntries','update',1,'2026-08-23 14:21:18'),(584,23,'FuelEntries','void',1,'2026-08-23 14:21:18'),(585,20,'FuelEntries','index',1,'2026-08-23 14:21:18'),(586,20,'FuelEntries','view',1,'2026-08-23 14:21:18'),(587,20,'FuelEntries','add',1,'2026-08-23 14:21:18'),(588,20,'FuelEntries','save',1,'2026-08-23 14:21:18'),(589,20,'FuelEntries','edit',1,'2026-08-23 14:21:18'),(590,20,'FuelEntries','update',1,'2026-08-23 14:21:18'),(591,20,'FuelEntries','void',1,'2026-08-23 14:21:18'),(592,22,'FuelEntries','index',1,'2026-08-23 14:21:18'),(593,22,'FuelEntries','view',1,'2026-08-23 14:21:18'),(594,22,'FuelEntries','add',1,'2026-08-23 14:21:18'),(595,22,'FuelEntries','save',1,'2026-08-23 14:21:18'),(596,21,'FuelEntries','index',1,'2026-08-23 14:21:18'),(597,21,'FuelEntries','view',1,'2026-08-23 14:21:18'),(598,3,'FuelEntries','index',1,'2026-08-23 14:21:18'),(599,3,'FuelEntries','view',1,'2026-08-23 14:21:18'),(600,2,'FuelEntries','index',1,'2026-08-23 14:21:18'),(601,2,'FuelEntries','view',1,'2026-08-23 14:21:18'),(602,1,'FuelEntries','index',1,'2026-08-23 14:21:18'),(603,1,'FuelEntries','view',1,'2026-08-23 14:21:18'),(604,10,'Vendors','index',1,'2026-08-23 16:32:36'),(605,10,'Vendors','view',1,'2026-08-23 16:32:36'),(606,10,'Vendors','add',1,'2026-08-23 16:32:36'),(607,10,'Vendors','save',1,'2026-08-23 16:32:36'),(608,10,'Vendors','edit',1,'2026-08-23 16:32:36'),(609,10,'Vendors','update',1,'2026-08-23 16:32:36'),(610,10,'Vendors','delete',1,'2026-08-23 16:32:36'),(611,22,'Vendors','index',1,'2026-08-23 16:32:36'),(612,22,'Vendors','view',1,'2026-08-23 16:32:36'),(613,22,'Vendors','add',1,'2026-08-23 16:32:36'),(614,22,'Vendors','save',1,'2026-08-23 16:32:36'),(615,22,'Vendors','edit',1,'2026-08-23 16:32:36'),(616,22,'Vendors','update',1,'2026-08-23 16:32:36'),(617,7,'Vendors','index',1,'2026-08-23 16:32:36'),(618,7,'Vendors','view',1,'2026-08-23 16:32:36'),(619,7,'Vendors','add',1,'2026-08-23 16:32:36'),(620,7,'Vendors','save',1,'2026-08-23 16:32:36'),(621,7,'Vendors','edit',1,'2026-08-23 16:32:36'),(622,7,'Vendors','update',1,'2026-08-23 16:32:36'),(623,20,'Vendors','index',1,'2026-08-23 16:32:36'),(624,20,'Vendors','view',1,'2026-08-23 16:32:36'),(625,3,'Vendors','index',1,'2026-08-23 16:32:36'),(626,3,'Vendors','view',1,'2026-08-23 16:32:36'),(627,2,'Vendors','index',1,'2026-08-23 16:32:36'),(628,2,'Vendors','view',1,'2026-08-23 16:32:36'),(629,1,'Vendors','index',1,'2026-08-23 16:32:36'),(630,1,'Vendors','view',1,'2026-08-23 16:32:36'),(631,10,'WorkOrders','index',1,'2026-08-23 16:32:36'),(632,10,'WorkOrders','view',1,'2026-08-23 16:32:36'),(633,10,'WorkOrders','add',1,'2026-08-23 16:32:36'),(634,10,'WorkOrders','save',1,'2026-08-23 16:32:36'),(635,10,'WorkOrders','edit',1,'2026-08-23 16:32:36'),(636,10,'WorkOrders','update',1,'2026-08-23 16:32:36'),(637,10,'WorkOrders','start',1,'2026-08-23 16:32:36'),(638,10,'WorkOrders','complete',1,'2026-08-23 16:32:36'),(639,10,'WorkOrders','close',1,'2026-08-23 16:32:36'),(640,10,'WorkOrders','cancel',1,'2026-08-23 16:32:36'),(641,10,'WorkOrders','addPart',1,'2026-08-23 16:32:36'),(642,10,'WorkOrders','deletePart',1,'2026-08-23 16:32:36'),(643,10,'WorkOrders','delete',1,'2026-08-23 16:32:36'),(644,22,'WorkOrders','index',1,'2026-08-23 16:32:36'),(645,22,'WorkOrders','view',1,'2026-08-23 16:32:36'),(646,22,'WorkOrders','add',1,'2026-08-23 16:32:36'),(647,22,'WorkOrders','save',1,'2026-08-23 16:32:36'),(648,22,'WorkOrders','edit',1,'2026-08-23 16:32:36'),(649,22,'WorkOrders','update',1,'2026-08-23 16:32:36'),(650,22,'WorkOrders','start',1,'2026-08-23 16:32:36'),(651,22,'WorkOrders','complete',1,'2026-08-23 16:32:36'),(652,22,'WorkOrders','close',1,'2026-08-23 16:32:36'),(653,22,'WorkOrders','cancel',1,'2026-08-23 16:32:36'),(654,22,'WorkOrders','addPart',1,'2026-08-23 16:32:36'),(655,22,'WorkOrders','deletePart',1,'2026-08-23 16:32:36'),(656,20,'WorkOrders','index',1,'2026-08-23 16:32:36'),(657,20,'WorkOrders','view',1,'2026-08-23 16:32:36'),(658,20,'WorkOrders','add',1,'2026-08-23 16:32:36'),(659,20,'WorkOrders','save',1,'2026-08-23 16:32:36'),(660,20,'WorkOrders','start',1,'2026-08-23 16:32:36'),(661,21,'WorkOrders','index',1,'2026-08-23 16:32:36'),(662,21,'WorkOrders','view',1,'2026-08-23 16:32:36'),(663,3,'WorkOrders','index',1,'2026-08-23 16:32:36'),(664,3,'WorkOrders','view',1,'2026-08-23 16:32:36'),(665,2,'WorkOrders','index',1,'2026-08-23 16:32:36'),(666,2,'WorkOrders','view',1,'2026-08-23 16:32:36'),(667,1,'WorkOrders','index',1,'2026-08-23 16:32:36'),(668,1,'WorkOrders','view',1,'2026-08-23 16:32:36'),(669,10,'TripRequests','addCargoItem',1,'2026-08-27 04:49:21'),(670,10,'TripRequests','deleteCargoItem',1,'2026-08-27 04:49:21'),(671,10,'TripRequests','addStop',1,'2026-08-27 04:49:21'),(672,10,'TripRequests','deleteStop',1,'2026-08-27 04:49:21'),(673,20,'TripRequests','addCargoItem',1,'2026-08-27 04:49:21'),(674,20,'TripRequests','deleteCargoItem',1,'2026-08-27 04:49:21'),(675,20,'TripRequests','addStop',1,'2026-08-27 04:49:21'),(676,20,'TripRequests','deleteStop',1,'2026-08-27 04:49:21'),(677,21,'TripRequests','addCargoItem',1,'2026-08-27 04:49:21'),(678,21,'TripRequests','deleteCargoItem',1,'2026-08-27 04:49:21'),(679,21,'TripRequests','addStop',1,'2026-08-27 04:49:21'),(680,21,'TripRequests','deleteStop',1,'2026-08-27 04:49:21'),(681,10,'Trips','addStop',1,'2026-08-27 04:49:21'),(682,10,'Trips','updateStop',1,'2026-08-27 04:49:21'),(683,10,'Trips','deleteStop',1,'2026-08-27 04:49:21'),(684,10,'Trips','arriveStop',1,'2026-08-27 04:49:21'),(685,10,'Trips','departStop',1,'2026-08-27 04:49:21'),(686,20,'Trips','addStop',1,'2026-08-27 04:49:21'),(687,20,'Trips','updateStop',1,'2026-08-27 04:49:21'),(688,20,'Trips','deleteStop',1,'2026-08-27 04:49:21'),(689,20,'Trips','arriveStop',1,'2026-08-27 04:49:21'),(690,20,'Trips','departStop',1,'2026-08-27 04:49:21'),(691,21,'Trips','addStop',1,'2026-08-27 04:49:21'),(692,21,'Trips','updateStop',1,'2026-08-27 04:49:21'),(693,21,'Trips','deleteStop',1,'2026-08-27 04:49:21'),(694,21,'Trips','arriveStop',1,'2026-08-27 04:49:21'),(695,21,'Trips','departStop',1,'2026-08-27 04:49:21'),(696,10,'GpsDevices','index',1,'2026-08-27 06:22:43'),(697,10,'GpsDevices','view',1,'2026-08-27 06:22:43'),(698,10,'GpsDevices','add',1,'2026-08-27 06:22:43'),(699,10,'GpsDevices','save',1,'2026-08-27 06:22:43'),(700,10,'GpsDevices','edit',1,'2026-08-27 06:22:43'),(701,10,'GpsDevices','update',1,'2026-08-27 06:22:43'),(702,10,'GpsDevices','delete',1,'2026-08-27 06:22:43'),(703,20,'GpsDevices','index',1,'2026-08-27 06:22:43'),(704,20,'GpsDevices','view',1,'2026-08-27 06:22:43'),(705,20,'GpsDevices','add',1,'2026-08-27 06:22:43'),(706,20,'GpsDevices','save',1,'2026-08-27 06:22:43'),(707,20,'GpsDevices','edit',1,'2026-08-27 06:22:43'),(708,20,'GpsDevices','update',1,'2026-08-27 06:22:43'),(709,22,'GpsDevices','index',1,'2026-08-27 06:22:43'),(710,22,'GpsDevices','view',1,'2026-08-27 06:22:43'),(711,22,'GpsDevices','add',1,'2026-08-27 06:22:43'),(712,22,'GpsDevices','save',1,'2026-08-27 06:22:43'),(713,22,'GpsDevices','edit',1,'2026-08-27 06:22:43'),(714,22,'GpsDevices','update',1,'2026-08-27 06:22:43'),(715,21,'GpsDevices','index',1,'2026-08-27 06:22:43'),(716,21,'GpsDevices','view',1,'2026-08-27 06:22:43'),(717,1,'GpsDevices','index',1,'2026-08-27 06:22:43'),(718,1,'GpsDevices','view',1,'2026-08-27 06:22:43'),(719,10,'Geofences','index',1,'2026-08-27 06:22:43'),(720,10,'Geofences','view',1,'2026-08-27 06:22:43'),(721,10,'Geofences','add',1,'2026-08-27 06:22:43'),(722,10,'Geofences','save',1,'2026-08-27 06:22:43'),(723,10,'Geofences','edit',1,'2026-08-27 06:22:43'),(724,10,'Geofences','update',1,'2026-08-27 06:22:43'),(725,10,'Geofences','delete',1,'2026-08-27 06:22:43'),(726,20,'Geofences','index',1,'2026-08-27 06:22:43'),(727,20,'Geofences','view',1,'2026-08-27 06:22:43'),(728,20,'Geofences','add',1,'2026-08-27 06:22:43'),(729,20,'Geofences','save',1,'2026-08-27 06:22:43'),(730,20,'Geofences','edit',1,'2026-08-27 06:22:43'),(731,20,'Geofences','update',1,'2026-08-27 06:22:43'),(732,21,'Geofences','index',1,'2026-08-27 06:22:43'),(733,21,'Geofences','view',1,'2026-08-27 06:22:43'),(734,1,'Geofences','index',1,'2026-08-27 06:22:43'),(735,1,'Geofences','view',1,'2026-08-27 06:22:43'),(736,10,'AlertRules','index',1,'2026-08-27 06:44:08'),(737,10,'AlertRules','add',1,'2026-08-27 06:44:08'),(738,10,'AlertRules','save',1,'2026-08-27 06:44:08'),(739,10,'AlertRules','edit',1,'2026-08-27 06:44:08'),(740,10,'AlertRules','update',1,'2026-08-27 06:44:08'),(741,10,'AlertRules','delete',1,'2026-08-27 06:44:08'),(742,10,'AlertRules','toggle',1,'2026-08-27 06:44:08'),(743,20,'AlertRules','index',1,'2026-08-27 06:44:08'),(744,20,'AlertRules','edit',1,'2026-08-27 06:44:08'),(745,20,'AlertRules','update',1,'2026-08-27 06:44:08'),(746,20,'AlertRules','toggle',1,'2026-08-27 06:44:08'),(747,22,'AlertRules','index',1,'2026-08-27 06:44:08'),(748,22,'AlertRules','edit',1,'2026-08-27 06:44:08'),(749,22,'AlertRules','update',1,'2026-08-27 06:44:08'),(750,22,'AlertRules','toggle',1,'2026-08-27 06:44:08'),(751,1,'AlertRules','index',1,'2026-08-27 06:44:08'),(752,10,'Alerts','index',1,'2026-08-27 06:44:08'),(753,10,'Alerts','view',1,'2026-08-27 06:44:08'),(754,10,'Alerts','acknowledge',1,'2026-08-27 06:44:08'),(755,10,'Alerts','resolve',1,'2026-08-27 06:44:08'),(756,10,'Alerts','dismiss',1,'2026-08-27 06:44:08'),(757,20,'Alerts','index',1,'2026-08-27 06:44:08'),(758,20,'Alerts','view',1,'2026-08-27 06:44:08'),(759,20,'Alerts','acknowledge',1,'2026-08-27 06:44:08'),(760,20,'Alerts','resolve',1,'2026-08-27 06:44:08'),(761,22,'Alerts','index',1,'2026-08-27 06:44:08'),(762,22,'Alerts','view',1,'2026-08-27 06:44:08'),(763,22,'Alerts','acknowledge',1,'2026-08-27 06:44:08'),(764,22,'Alerts','resolve',1,'2026-08-27 06:44:08'),(765,21,'Alerts','index',1,'2026-08-27 06:44:08'),(766,21,'Alerts','view',1,'2026-08-27 06:44:08'),(767,21,'Alerts','acknowledge',1,'2026-08-27 06:44:08'),(768,1,'Alerts','index',1,'2026-08-27 06:44:08'),(769,1,'Alerts','view',1,'2026-08-27 06:44:08'),(770,10,'TripAttachments','upload',1,'2026-08-27 07:15:54'),(771,10,'TripAttachments','delete',1,'2026-08-27 07:15:54'),(772,10,'TripAttachments','view',1,'2026-08-27 07:15:54'),(773,20,'TripAttachments','upload',1,'2026-08-27 07:15:54'),(774,20,'TripAttachments','delete',1,'2026-08-27 07:15:54'),(775,20,'TripAttachments','view',1,'2026-08-27 07:15:54'),(776,21,'TripAttachments','upload',1,'2026-08-27 07:15:54'),(777,21,'TripAttachments','view',1,'2026-08-27 07:15:54'),(778,22,'TripAttachments','upload',1,'2026-08-27 07:15:54'),(779,22,'TripAttachments','delete',1,'2026-08-27 07:15:54'),(780,22,'TripAttachments','view',1,'2026-08-27 07:15:54'),(781,1,'TripAttachments','view',1,'2026-08-27 07:15:54'),(782,10,'CustomerInvoices','index',1,'2026-08-27 09:41:25'),(783,10,'CustomerInvoices','view',1,'2026-08-27 09:41:25'),(784,10,'CustomerInvoices','billTrips',1,'2026-08-27 09:41:25'),(785,10,'CustomerInvoices','create',1,'2026-08-27 09:41:25'),(786,10,'CustomerInvoices','edit',1,'2026-08-27 09:41:25'),(787,10,'CustomerInvoices','update',1,'2026-08-27 09:41:25'),(788,10,'CustomerInvoices','issue',1,'2026-08-27 09:41:25'),(789,10,'CustomerInvoices','void',1,'2026-08-27 09:41:25'),(790,10,'CustomerInvoices','delete',1,'2026-08-27 09:41:25'),(791,10,'CustomerInvoices','printable',1,'2026-08-27 09:41:25'),(792,30,'CustomerInvoices','index',1,'2026-08-27 09:41:25'),(793,30,'CustomerInvoices','view',1,'2026-08-27 09:41:25'),(794,30,'CustomerInvoices','billTrips',1,'2026-08-27 09:41:25'),(795,30,'CustomerInvoices','create',1,'2026-08-27 09:41:25'),(796,30,'CustomerInvoices','edit',1,'2026-08-27 09:41:25'),(797,30,'CustomerInvoices','update',1,'2026-08-27 09:41:25'),(798,30,'CustomerInvoices','issue',1,'2026-08-27 09:41:25'),(799,30,'CustomerInvoices','void',1,'2026-08-27 09:41:25'),(800,30,'CustomerInvoices','printable',1,'2026-08-27 09:41:25'),(801,20,'CustomerInvoices','index',1,'2026-08-27 09:41:25'),(802,20,'CustomerInvoices','view',1,'2026-08-27 09:41:25'),(803,20,'CustomerInvoices','billTrips',1,'2026-08-27 09:41:25'),(804,20,'CustomerInvoices','create',1,'2026-08-27 09:41:25'),(805,20,'CustomerInvoices','printable',1,'2026-08-27 09:41:25'),(806,22,'CustomerInvoices','index',1,'2026-08-27 09:41:25'),(807,22,'CustomerInvoices','view',1,'2026-08-27 09:41:25'),(808,1,'CustomerInvoices','index',1,'2026-08-27 09:41:25'),(809,1,'CustomerInvoices','view',1,'2026-08-27 09:41:25'),(810,10,'CustomerReceipts','index',1,'2026-08-27 09:41:25'),(811,10,'CustomerReceipts','view',1,'2026-08-27 09:41:25'),(812,10,'CustomerReceipts','record',1,'2026-08-27 09:41:25'),(813,10,'CustomerReceipts','save',1,'2026-08-27 09:41:25'),(814,10,'CustomerReceipts','void',1,'2026-08-27 09:41:25'),(815,30,'CustomerReceipts','index',1,'2026-08-27 09:41:25'),(816,30,'CustomerReceipts','view',1,'2026-08-27 09:41:25'),(817,30,'CustomerReceipts','record',1,'2026-08-27 09:41:25'),(818,30,'CustomerReceipts','save',1,'2026-08-27 09:41:25'),(819,30,'CustomerReceipts','void',1,'2026-08-27 09:41:25'),(820,20,'CustomerReceipts','index',1,'2026-08-27 09:41:25'),(821,20,'CustomerReceipts','view',1,'2026-08-27 09:41:25'),(822,1,'CustomerReceipts','index',1,'2026-08-27 09:41:25'),(823,1,'CustomerReceipts','view',1,'2026-08-27 09:41:25'),(824,10,'AgedReceivables','index',1,'2026-08-27 09:41:25'),(825,30,'AgedReceivables','index',1,'2026-08-27 09:41:25'),(826,20,'AgedReceivables','index',1,'2026-08-27 09:41:25'),(827,1,'AgedReceivables','index',1,'2026-08-27 09:41:25'),(828,10,'PmTemplates','index',1,'2026-08-27 10:18:25'),(829,10,'PmTemplates','add',1,'2026-08-27 10:18:25'),(830,10,'PmTemplates','save',1,'2026-08-27 10:18:25'),(831,10,'PmTemplates','edit',1,'2026-08-27 10:18:25'),(832,10,'PmTemplates','update',1,'2026-08-27 10:18:25'),(833,10,'PmTemplates','toggle',1,'2026-08-27 10:18:25'),(834,10,'PmTemplates','delete',1,'2026-08-27 10:18:25'),(835,10,'PmTemplates','view',1,'2026-08-27 10:18:25'),(836,20,'PmTemplates','index',1,'2026-08-27 10:18:25'),(837,20,'PmTemplates','add',1,'2026-08-27 10:18:25'),(838,20,'PmTemplates','save',1,'2026-08-27 10:18:25'),(839,20,'PmTemplates','edit',1,'2026-08-27 10:18:25'),(840,20,'PmTemplates','update',1,'2026-08-27 10:18:25'),(841,20,'PmTemplates','toggle',1,'2026-08-27 10:18:25'),(842,20,'PmTemplates','view',1,'2026-08-27 10:18:25'),(843,22,'PmTemplates','index',1,'2026-08-27 10:18:25'),(844,22,'PmTemplates','view',1,'2026-08-27 10:18:25'),(845,1,'PmTemplates','index',1,'2026-08-27 10:18:25'),(846,1,'PmTemplates','view',1,'2026-08-27 10:18:25'),(847,10,'PmDashboard','index',1,'2026-08-27 10:18:25'),(848,10,'PmDashboard','view',1,'2026-08-27 10:18:25'),(849,10,'PmDashboard','complete',1,'2026-08-27 10:18:25'),(850,10,'PmDashboard','skip',1,'2026-08-27 10:18:25'),(851,10,'PmDashboard','triggerNow',1,'2026-08-27 10:18:25'),(852,20,'PmDashboard','index',1,'2026-08-27 10:18:25'),(853,20,'PmDashboard','view',1,'2026-08-27 10:18:25'),(854,20,'PmDashboard','complete',1,'2026-08-27 10:18:25'),(855,20,'PmDashboard','skip',1,'2026-08-27 10:18:25'),(856,22,'PmDashboard','index',1,'2026-08-27 10:18:25'),(857,22,'PmDashboard','view',1,'2026-08-27 10:18:25'),(858,21,'PmDashboard','index',1,'2026-08-27 10:18:25'),(859,21,'PmDashboard','view',1,'2026-08-27 10:18:25'),(860,1,'PmDashboard','index',1,'2026-08-27 10:18:25'),(861,1,'PmDashboard','view',1,'2026-08-27 10:18:25'),(862,10,'TruckPmSchedules','assign',1,'2026-08-27 10:18:25'),(863,10,'TruckPmSchedules','save',1,'2026-08-27 10:18:25'),(864,10,'TruckPmSchedules','edit',1,'2026-08-27 10:18:25'),(865,10,'TruckPmSchedules','update',1,'2026-08-27 10:18:25'),(866,10,'TruckPmSchedules','delete',1,'2026-08-27 10:18:25'),(867,20,'TruckPmSchedules','assign',1,'2026-08-27 10:18:25'),(868,20,'TruckPmSchedules','save',1,'2026-08-27 10:18:25'),(869,20,'TruckPmSchedules','edit',1,'2026-08-27 10:18:25'),(870,20,'TruckPmSchedules','update',1,'2026-08-27 10:18:25'),(871,20,'TruckPmSchedules','delete',1,'2026-08-27 10:18:25'),(872,10,'DocExpiries','index',1,'2026-08-27 10:43:10'),(873,10,'DocExpiries','sweepNow',1,'2026-08-27 10:43:10'),(874,20,'DocExpiries','index',1,'2026-08-27 10:43:10'),(875,20,'DocExpiries','sweepNow',1,'2026-08-27 10:43:10'),(876,22,'DocExpiries','index',1,'2026-08-27 10:43:10'),(877,22,'DocExpiries','sweepNow',1,'2026-08-27 10:43:10'),(878,21,'DocExpiries','index',1,'2026-08-27 10:43:10'),(879,1,'DocExpiries','index',1,'2026-08-27 10:43:10'),(880,10,'FleetAnalytics','index',1,'2026-08-27 10:51:32'),(881,10,'FleetAnalytics','truckPnl',1,'2026-08-27 10:51:32'),(882,10,'FleetAnalytics','customerRevenue',1,'2026-08-27 10:51:32'),(883,10,'FleetAnalytics','driverScorecards',1,'2026-08-27 10:51:32'),(884,20,'FleetAnalytics','index',1,'2026-08-27 10:51:32'),(885,20,'FleetAnalytics','truckPnl',1,'2026-08-27 10:51:32'),(886,20,'FleetAnalytics','customerRevenue',1,'2026-08-27 10:51:32'),(887,20,'FleetAnalytics','driverScorecards',1,'2026-08-27 10:51:32'),(888,30,'FleetAnalytics','index',1,'2026-08-27 10:51:32'),(889,30,'FleetAnalytics','truckPnl',1,'2026-08-27 10:51:32'),(890,30,'FleetAnalytics','customerRevenue',1,'2026-08-27 10:51:32'),(891,22,'FleetAnalytics','index',1,'2026-08-27 10:51:32'),(892,22,'FleetAnalytics','truckPnl',1,'2026-08-27 10:51:32'),(893,22,'FleetAnalytics','driverScorecards',1,'2026-08-27 10:51:32'),(894,21,'FleetAnalytics','index',1,'2026-08-27 10:51:32'),(895,1,'FleetAnalytics','index',1,'2026-08-27 10:51:32'),(896,1,'FleetAnalytics','truckPnl',1,'2026-08-27 10:51:32'),(897,1,'FleetAnalytics','customerRevenue',1,'2026-08-27 10:51:32'),(898,1,'FleetAnalytics','driverScorecards',1,'2026-08-27 10:51:32'),(899,10,'Payroll','index',1,'2026-08-27 11:12:47'),(900,10,'Payroll','view',1,'2026-08-27 11:12:47'),(901,10,'Payroll','add',1,'2026-08-27 11:12:47'),(902,10,'Payroll','save',1,'2026-08-27 11:12:47'),(903,10,'Payroll','compute',1,'2026-08-27 11:12:47'),(904,10,'Payroll','recompute',1,'2026-08-27 11:12:47'),(905,10,'Payroll','approve',1,'2026-08-27 11:12:47'),(906,10,'Payroll','pay',1,'2026-08-27 11:12:47'),(907,10,'Payroll','voidRecord',1,'2026-08-27 11:12:47'),(908,10,'Payroll','voidPeriod',1,'2026-08-27 11:12:47'),(909,10,'Payroll','payslip',1,'2026-08-27 11:12:47'),(910,10,'Payroll','editRecord',1,'2026-08-27 11:12:47'),(911,10,'Payroll','updateRecord',1,'2026-08-27 11:12:47'),(912,30,'Payroll','index',1,'2026-08-27 11:12:47'),(913,30,'Payroll','view',1,'2026-08-27 11:12:47'),(914,30,'Payroll','payslip',1,'2026-08-27 11:12:47'),(915,20,'Payroll','index',1,'2026-08-27 11:12:47'),(916,20,'Payroll','view',1,'2026-08-27 11:12:47'),(917,20,'Payroll','payslip',1,'2026-08-27 11:12:47'),(918,1,'Payroll','index',1,'2026-08-27 11:12:47'),(919,1,'Payroll','view',1,'2026-08-27 11:12:47'),(920,10,'Drivers','staffId',1,'2026-08-27 12:39:53'),(921,20,'Drivers','staffId',1,'2026-08-27 12:39:53'),(922,22,'Drivers','staffId',1,'2026-08-27 12:39:53'),(923,1,'Drivers','staffId',1,'2026-08-27 12:39:53'),(928,1,'FinancialReports','index',1,'2026-08-27 16:30:22'),(929,1,'FinancialReports','trialBalance',1,'2026-08-27 16:30:22'),(930,1,'FinancialReports','pnl',1,'2026-08-27 16:30:22'),(931,1,'FinancialReports','balanceSheet',1,'2026-08-27 16:30:22'),(932,1,'FinancialReports','ledger',1,'2026-08-27 16:30:22'),(933,2,'FinancialReports','index',1,'2026-08-27 16:30:22'),(934,2,'FinancialReports','trialBalance',1,'2026-08-27 16:30:22'),(935,2,'FinancialReports','pnl',1,'2026-08-27 16:30:22'),(936,2,'FinancialReports','balanceSheet',1,'2026-08-27 16:30:22'),(937,2,'FinancialReports','ledger',1,'2026-08-27 16:30:22'),(938,3,'FinancialReports','index',1,'2026-08-27 16:30:22'),(939,3,'FinancialReports','trialBalance',1,'2026-08-27 16:30:22'),(940,3,'FinancialReports','pnl',1,'2026-08-27 16:30:22'),(941,3,'FinancialReports','balanceSheet',1,'2026-08-27 16:30:22'),(942,3,'FinancialReports','ledger',1,'2026-08-27 16:30:22'),(943,10,'FinancialReports','index',1,'2026-08-27 16:30:22'),(944,10,'FinancialReports','trialBalance',1,'2026-08-27 16:30:22'),(945,10,'FinancialReports','pnl',1,'2026-08-27 16:30:22'),(946,10,'FinancialReports','balanceSheet',1,'2026-08-27 16:30:22'),(947,10,'FinancialReports','ledger',1,'2026-08-27 16:30:22'),(948,1,'BankRecon','index',1,'2026-08-27 17:11:54'),(949,1,'BankRecon','view',1,'2026-08-27 17:11:54'),(950,2,'BankRecon','index',1,'2026-08-27 17:11:54'),(951,2,'BankRecon','add',1,'2026-08-27 17:11:54'),(952,2,'BankRecon','save',1,'2026-08-27 17:11:54'),(953,2,'BankRecon','view',1,'2026-08-27 17:11:54'),(954,2,'BankRecon','match',1,'2026-08-27 17:11:54'),(955,2,'BankRecon','unmatch',1,'2026-08-27 17:11:54'),(956,2,'BankRecon','autoMatch',1,'2026-08-27 17:11:54'),(957,2,'BankRecon','adjust',1,'2026-08-27 17:11:54'),(958,2,'BankRecon','complete',1,'2026-08-27 17:11:54'),(959,2,'BankRecon','voidStmt',1,'2026-08-27 17:11:54'),(960,3,'BankRecon','index',1,'2026-08-27 17:11:54'),(961,3,'BankRecon','add',1,'2026-08-27 17:11:54'),(962,3,'BankRecon','save',1,'2026-08-27 17:11:54'),(963,3,'BankRecon','view',1,'2026-08-27 17:11:54'),(964,3,'BankRecon','match',1,'2026-08-27 17:11:54'),(965,3,'BankRecon','unmatch',1,'2026-08-27 17:11:54'),(966,3,'BankRecon','autoMatch',1,'2026-08-27 17:11:54'),(967,3,'BankRecon','adjust',1,'2026-08-27 17:11:54'),(968,3,'BankRecon','complete',1,'2026-08-27 17:11:54'),(969,3,'BankRecon','voidStmt',1,'2026-08-27 17:11:54'),(970,10,'BankRecon','index',1,'2026-08-27 17:11:54'),(971,10,'BankRecon','add',1,'2026-08-27 17:11:54'),(972,10,'BankRecon','save',1,'2026-08-27 17:11:54'),(973,10,'BankRecon','view',1,'2026-08-27 17:11:54'),(974,10,'BankRecon','match',1,'2026-08-27 17:11:54'),(975,10,'BankRecon','unmatch',1,'2026-08-27 17:11:54'),(976,10,'BankRecon','autoMatch',1,'2026-08-27 17:11:54'),(977,10,'BankRecon','adjust',1,'2026-08-27 17:11:54'),(978,10,'BankRecon','complete',1,'2026-08-27 17:11:54'),(979,10,'BankRecon','voidStmt',1,'2026-08-27 17:11:54'),(980,1,'TaxReturns','index',1,'2026-08-27 17:44:02'),(981,1,'TaxReturns','paye',1,'2026-08-27 17:44:02'),(982,1,'TaxReturns','vat',1,'2026-08-27 17:44:02'),(983,1,'TaxReturns','statutory',1,'2026-08-27 17:44:02'),(984,2,'TaxReturns','index',1,'2026-08-27 17:44:02'),(985,2,'TaxReturns','paye',1,'2026-08-27 17:44:02'),(986,2,'TaxReturns','vat',1,'2026-08-27 17:44:02'),(987,2,'TaxReturns','statutory',1,'2026-08-27 17:44:02'),(988,2,'TaxReturns','payeCsv',1,'2026-08-27 17:44:02'),(989,3,'TaxReturns','index',1,'2026-08-27 17:44:02'),(990,3,'TaxReturns','paye',1,'2026-08-27 17:44:02'),(991,3,'TaxReturns','vat',1,'2026-08-27 17:44:02'),(992,3,'TaxReturns','statutory',1,'2026-08-27 17:44:02'),(993,3,'TaxReturns','payeCsv',1,'2026-08-27 17:44:02'),(994,10,'TaxReturns','index',1,'2026-08-27 17:44:02'),(995,10,'TaxReturns','paye',1,'2026-08-27 17:44:02'),(996,10,'TaxReturns','vat',1,'2026-08-27 17:44:02'),(997,10,'TaxReturns','statutory',1,'2026-08-27 17:44:02'),(998,10,'TaxReturns','payeCsv',1,'2026-08-27 17:44:02'),(999,1,'SupplierBills','index',1,'2026-08-27 17:54:20'),(1000,1,'SupplierBills','view',1,'2026-08-27 17:54:20'),(1001,2,'SupplierBills','index',1,'2026-08-27 17:54:20'),(1002,2,'SupplierBills','view',1,'2026-08-27 17:54:20'),(1003,2,'SupplierBills','add',1,'2026-08-27 17:54:20'),(1004,2,'SupplierBills','save',1,'2026-08-27 17:54:20'),(1005,2,'SupplierBills','post',1,'2026-08-27 17:54:20'),(1006,2,'SupplierBills','voidBill',1,'2026-08-27 17:54:20'),(1007,3,'SupplierBills','index',1,'2026-08-27 17:54:20'),(1008,3,'SupplierBills','view',1,'2026-08-27 17:54:20'),(1009,3,'SupplierBills','add',1,'2026-08-27 17:54:20'),(1010,3,'SupplierBills','save',1,'2026-08-27 17:54:20'),(1011,3,'SupplierBills','post',1,'2026-08-27 17:54:20'),(1012,3,'SupplierBills','voidBill',1,'2026-08-27 17:54:20'),(1013,7,'SupplierBills','index',1,'2026-08-27 17:54:20'),(1014,7,'SupplierBills','view',1,'2026-08-27 17:54:20'),(1015,7,'SupplierBills','add',1,'2026-08-27 17:54:20'),(1016,7,'SupplierBills','save',1,'2026-08-27 17:54:20'),(1017,10,'SupplierBills','index',1,'2026-08-27 17:54:20'),(1018,10,'SupplierBills','view',1,'2026-08-27 17:54:20'),(1019,10,'SupplierBills','add',1,'2026-08-27 17:54:20'),(1020,10,'SupplierBills','save',1,'2026-08-27 17:54:20'),(1021,10,'SupplierBills','post',1,'2026-08-27 17:54:20'),(1022,10,'SupplierBills','voidBill',1,'2026-08-27 17:54:20'),(1023,1,'SupplierPayments','index',1,'2026-08-27 17:54:20'),(1024,1,'SupplierPayments','view',1,'2026-08-27 17:54:20'),(1025,2,'SupplierPayments','index',1,'2026-08-27 17:54:20'),(1026,2,'SupplierPayments','view',1,'2026-08-27 17:54:20'),(1027,2,'SupplierPayments','record',1,'2026-08-27 17:54:20'),(1028,2,'SupplierPayments','save',1,'2026-08-27 17:54:20'),(1029,2,'SupplierPayments','voidPayment',1,'2026-08-27 17:54:20'),(1030,3,'SupplierPayments','index',1,'2026-08-27 17:54:20'),(1031,3,'SupplierPayments','view',1,'2026-08-27 17:54:20'),(1032,3,'SupplierPayments','record',1,'2026-08-27 17:54:20'),(1033,3,'SupplierPayments','save',1,'2026-08-27 17:54:20'),(1034,3,'SupplierPayments','voidPayment',1,'2026-08-27 17:54:20'),(1035,10,'SupplierPayments','index',1,'2026-08-27 17:54:20'),(1036,10,'SupplierPayments','view',1,'2026-08-27 17:54:20'),(1037,10,'SupplierPayments','record',1,'2026-08-27 17:54:20'),(1038,10,'SupplierPayments','save',1,'2026-08-27 17:54:20'),(1039,10,'SupplierPayments','voidPayment',1,'2026-08-27 17:54:20'),(1040,1,'AgedPayables','index',1,'2026-08-27 17:54:20'),(1041,2,'AgedPayables','index',1,'2026-08-27 17:54:20'),(1042,3,'AgedPayables','index',1,'2026-08-27 17:54:20'),(1043,10,'AgedPayables','index',1,'2026-08-27 17:54:20'),(1044,1,'Suppliers','index',1,'2026-08-27 17:54:20'),(1045,1,'Suppliers','view',1,'2026-08-27 17:54:20'),(1046,2,'Suppliers','index',1,'2026-08-27 17:54:20'),(1047,2,'Suppliers','view',1,'2026-08-27 17:54:20'),(1048,2,'Suppliers','add',1,'2026-08-27 17:54:20'),(1049,2,'Suppliers','save',1,'2026-08-27 17:54:20'),(1050,2,'Suppliers','edit',1,'2026-08-27 17:54:20'),(1051,2,'Suppliers','update',1,'2026-08-27 17:54:20'),(1052,3,'Suppliers','index',1,'2026-08-27 17:54:20'),(1053,3,'Suppliers','view',1,'2026-08-27 17:54:20'),(1054,3,'Suppliers','add',1,'2026-08-27 17:54:20'),(1055,3,'Suppliers','save',1,'2026-08-27 17:54:20'),(1056,3,'Suppliers','edit',1,'2026-08-27 17:54:20'),(1057,3,'Suppliers','update',1,'2026-08-27 17:54:20'),(1058,7,'Suppliers','index',1,'2026-08-27 17:54:20'),(1059,7,'Suppliers','view',1,'2026-08-27 17:54:20'),(1060,7,'Suppliers','add',1,'2026-08-27 17:54:20'),(1061,7,'Suppliers','save',1,'2026-08-27 17:54:20'),(1062,7,'Suppliers','edit',1,'2026-08-27 17:54:20'),(1063,7,'Suppliers','update',1,'2026-08-27 17:54:20'),(1064,10,'Suppliers','index',1,'2026-08-27 17:54:20'),(1065,10,'Suppliers','view',1,'2026-08-27 17:54:20'),(1066,10,'Suppliers','add',1,'2026-08-27 17:54:20'),(1067,10,'Suppliers','save',1,'2026-08-27 17:54:20'),(1068,10,'Suppliers','edit',1,'2026-08-27 17:54:20'),(1069,10,'Suppliers','update',1,'2026-08-27 17:54:20'),(1070,1,'GpsDashboard','index',1,'2026-08-27 18:15:22'),(1071,1,'GpsDashboard','truck',1,'2026-08-27 18:15:22'),(1072,1,'GpsDashboard','trip',1,'2026-08-27 18:15:22'),(1073,1,'GpsDashboard','alerts',1,'2026-08-27 18:15:22'),(1074,1,'GpsDashboard','livePositions',1,'2026-08-27 18:15:22'),(1075,1,'GpsDashboard','truckTrack',1,'2026-08-27 18:15:22'),(1076,1,'GpsDashboard','tripPoints',1,'2026-08-27 18:15:22'),(1077,20,'GpsDashboard','index',1,'2026-08-27 18:15:22'),(1078,20,'GpsDashboard','truck',1,'2026-08-27 18:15:22'),(1079,20,'GpsDashboard','trip',1,'2026-08-27 18:15:22'),(1080,20,'GpsDashboard','alerts',1,'2026-08-27 18:15:22'),(1081,20,'GpsDashboard','livePositions',1,'2026-08-27 18:15:22'),(1082,20,'GpsDashboard','truckTrack',1,'2026-08-27 18:15:22'),(1083,20,'GpsDashboard','tripPoints',1,'2026-08-27 18:15:22'),(1084,21,'GpsDashboard','index',1,'2026-08-27 18:15:22'),(1085,21,'GpsDashboard','truck',1,'2026-08-27 18:15:22'),(1086,21,'GpsDashboard','trip',1,'2026-08-27 18:15:22'),(1087,21,'GpsDashboard','alerts',1,'2026-08-27 18:15:22'),(1088,21,'GpsDashboard','livePositions',1,'2026-08-27 18:15:22'),(1089,21,'GpsDashboard','truckTrack',1,'2026-08-27 18:15:22'),(1090,21,'GpsDashboard','tripPoints',1,'2026-08-27 18:15:22'),(1091,22,'GpsDashboard','index',1,'2026-08-27 18:15:22'),(1092,22,'GpsDashboard','truck',1,'2026-08-27 18:15:22'),(1093,22,'GpsDashboard','trip',1,'2026-08-27 18:15:22'),(1094,22,'GpsDashboard','alerts',1,'2026-08-27 18:15:22'),(1095,22,'GpsDashboard','livePositions',1,'2026-08-27 18:15:22'),(1096,22,'GpsDashboard','truckTrack',1,'2026-08-27 18:15:22'),(1097,22,'GpsDashboard','tripPoints',1,'2026-08-27 18:15:22'),(1098,6,'GpsDashboard','index',1,'2026-08-27 18:15:22'),(1099,6,'GpsDashboard','alerts',1,'2026-08-27 18:15:22'),(1100,6,'GpsDashboard','livePositions',1,'2026-08-27 18:15:22'),(1101,10,'GpsDashboard','index',1,'2026-08-27 18:15:22'),(1102,10,'GpsDashboard','truck',1,'2026-08-27 18:15:22'),(1103,10,'GpsDashboard','trip',1,'2026-08-27 18:15:22'),(1104,10,'GpsDashboard','alerts',1,'2026-08-27 18:15:22'),(1105,10,'GpsDashboard','livePositions',1,'2026-08-27 18:15:22'),(1106,10,'GpsDashboard','truckTrack',1,'2026-08-27 18:15:22'),(1107,10,'GpsDashboard','tripPoints',1,'2026-08-27 18:15:22'),(1108,1,'FinancialReports','cashFlow',1,'2026-08-27 19:06:45'),(1109,2,'FinancialReports','cashFlow',1,'2026-08-27 19:06:45'),(1110,3,'FinancialReports','cashFlow',1,'2026-08-27 19:06:45'),(1111,10,'FinancialReports','cashFlow',1,'2026-08-27 19:06:45'),(1112,1,'Payroll','p9',1,'2026-08-27 19:28:53'),(1113,1,'Payroll','p9Batch',1,'2026-08-27 19:28:53'),(1114,2,'Payroll','p9',1,'2026-08-27 19:28:53'),(1115,2,'Payroll','p9Batch',1,'2026-08-27 19:28:53'),(1116,3,'Payroll','p9',1,'2026-08-27 19:28:53'),(1117,3,'Payroll','p9Batch',1,'2026-08-27 19:28:53'),(1118,24,'Payroll','p9',1,'2026-08-27 19:28:53'),(1119,24,'Payroll','p9Batch',1,'2026-08-27 19:28:53'),(1120,10,'Payroll','p9',1,'2026-08-27 19:28:53'),(1121,10,'Payroll','p9Batch',1,'2026-08-27 19:28:53'),(1122,1,'CustomerStatements','index',1,'2026-08-27 19:52:32'),(1123,1,'CustomerStatements','pdf',1,'2026-08-27 19:52:32'),(1124,2,'CustomerStatements','index',1,'2026-08-27 19:52:32'),(1125,2,'CustomerStatements','pdf',1,'2026-08-27 19:52:32'),(1126,3,'CustomerStatements','index',1,'2026-08-27 19:52:32'),(1127,3,'CustomerStatements','pdf',1,'2026-08-27 19:52:32'),(1128,9,'CustomerStatements','index',1,'2026-08-27 19:52:32'),(1129,9,'CustomerStatements','pdf',1,'2026-08-27 19:52:32'),(1130,10,'CustomerStatements','index',1,'2026-08-27 19:52:32'),(1131,10,'CustomerStatements','pdf',1,'2026-08-27 19:52:32'),(1132,1,'SupplierStatements','index',1,'2026-08-28 00:58:22'),(1133,1,'SupplierStatements','pdf',1,'2026-08-28 00:58:22'),(1134,2,'SupplierStatements','index',1,'2026-08-28 00:58:22'),(1135,2,'SupplierStatements','pdf',1,'2026-08-28 00:58:22'),(1136,3,'SupplierStatements','index',1,'2026-08-28 00:58:22'),(1137,3,'SupplierStatements','pdf',1,'2026-08-28 00:58:22'),(1138,7,'SupplierStatements','index',1,'2026-08-28 00:58:22'),(1139,7,'SupplierStatements','pdf',1,'2026-08-28 00:58:22'),(1140,10,'SupplierStatements','index',1,'2026-08-28 00:58:22'),(1141,10,'SupplierStatements','pdf',1,'2026-08-28 00:58:22'),(1142,25,'WorkRequests','index',1,'2026-08-28 01:06:29'),(1143,25,'WorkRequests','add',1,'2026-08-28 01:06:29'),(1144,25,'WorkRequests','save',1,'2026-08-28 01:06:29'),(1145,25,'WorkRequests','view',1,'2026-08-28 01:06:29'),(1146,25,'WorkRequests','submit',1,'2026-08-28 01:06:29'),(1147,25,'WorkRequests','cancel',1,'2026-08-28 01:06:29'),(1148,6,'WorkRequests','index',1,'2026-08-28 01:06:29'),(1149,6,'WorkRequests','view',1,'2026-08-28 01:06:29'),(1150,6,'WorkRequests','add',1,'2026-08-28 01:06:29'),(1151,6,'WorkRequests','save',1,'2026-08-28 01:06:29'),(1152,6,'WorkRequests','edit',1,'2026-08-28 01:06:29'),(1153,6,'WorkRequests','update',1,'2026-08-28 01:06:29'),(1154,6,'WorkRequests','submit',1,'2026-08-28 01:06:29'),(1155,6,'WorkRequests','cancel',1,'2026-08-28 01:06:29'),(1156,6,'WorkRequests','reject',1,'2026-08-28 01:06:29'),(1157,6,'WorkRequests','addItem',1,'2026-08-28 01:06:29'),(1158,6,'WorkRequests','deleteItem',1,'2026-08-28 01:06:29'),(1159,20,'WorkRequests','index',1,'2026-08-28 01:06:29'),(1160,20,'WorkRequests','view',1,'2026-08-28 01:06:29'),(1161,20,'WorkRequests','add',1,'2026-08-28 01:06:29'),(1162,20,'WorkRequests','save',1,'2026-08-28 01:06:29'),(1163,20,'WorkRequests','edit',1,'2026-08-28 01:06:29'),(1164,20,'WorkRequests','update',1,'2026-08-28 01:06:29'),(1165,20,'WorkRequests','submit',1,'2026-08-28 01:06:29'),(1166,20,'WorkRequests','cancel',1,'2026-08-28 01:06:29'),(1167,20,'WorkRequests','approve',1,'2026-08-28 01:06:29'),(1168,20,'WorkRequests','reject',1,'2026-08-28 01:06:29'),(1169,20,'WorkRequests','convertToWo',1,'2026-08-28 01:06:29'),(1170,20,'WorkRequests','addItem',1,'2026-08-28 01:06:29'),(1171,20,'WorkRequests','deleteItem',1,'2026-08-28 01:06:29'),(1172,21,'WorkRequests','index',1,'2026-08-28 01:06:29'),(1173,21,'WorkRequests','view',1,'2026-08-28 01:06:29'),(1174,22,'WorkRequests','index',1,'2026-08-28 01:06:29'),(1175,22,'WorkRequests','view',1,'2026-08-28 01:06:29'),(1176,22,'WorkRequests','add',1,'2026-08-28 01:06:29'),(1177,22,'WorkRequests','save',1,'2026-08-28 01:06:29'),(1178,22,'WorkRequests','edit',1,'2026-08-28 01:06:29'),(1179,22,'WorkRequests','update',1,'2026-08-28 01:06:29'),(1180,22,'WorkRequests','submit',1,'2026-08-28 01:06:29'),(1181,22,'WorkRequests','cancel',1,'2026-08-28 01:06:29'),(1182,22,'WorkRequests','approve',1,'2026-08-28 01:06:29'),(1183,22,'WorkRequests','reject',1,'2026-08-28 01:06:29'),(1184,22,'WorkRequests','startSourcing',1,'2026-08-28 01:06:29'),(1185,22,'WorkRequests','markReady',1,'2026-08-28 01:06:29'),(1186,22,'WorkRequests','convertToWo',1,'2026-08-28 01:06:29'),(1187,22,'WorkRequests','addItem',1,'2026-08-28 01:06:29'),(1188,22,'WorkRequests','deleteItem',1,'2026-08-28 01:06:29'),(1189,22,'WorkRequests','delete',1,'2026-08-28 01:06:29'),(1190,7,'WorkRequests','index',1,'2026-08-28 01:06:29'),(1191,7,'WorkRequests','view',1,'2026-08-28 01:06:29'),(1192,7,'WorkRequests','startSourcing',1,'2026-08-28 01:06:29'),(1193,7,'WorkRequests','markReady',1,'2026-08-28 01:06:29'),(1194,7,'WorkRequests','addItem',1,'2026-08-28 01:06:29'),(1195,7,'WorkRequests','deleteItem',1,'2026-08-28 01:06:29'),(1196,10,'WorkRequests','index',1,'2026-08-28 01:06:29'),(1197,10,'WorkRequests','view',1,'2026-08-28 01:06:29'),(1198,10,'WorkRequests','add',1,'2026-08-28 01:06:29'),(1199,10,'WorkRequests','save',1,'2026-08-28 01:06:29'),(1200,10,'WorkRequests','edit',1,'2026-08-28 01:06:29'),(1201,10,'WorkRequests','update',1,'2026-08-28 01:06:29'),(1202,10,'WorkRequests','submit',1,'2026-08-28 01:06:29'),(1203,10,'WorkRequests','cancel',1,'2026-08-28 01:06:29'),(1204,10,'WorkRequests','approve',1,'2026-08-28 01:06:29'),(1205,10,'WorkRequests','reject',1,'2026-08-28 01:06:29'),(1206,10,'WorkRequests','startSourcing',1,'2026-08-28 01:06:29'),(1207,10,'WorkRequests','markReady',1,'2026-08-28 01:06:29'),(1208,10,'WorkRequests','convertToWo',1,'2026-08-28 01:06:29'),(1209,10,'WorkRequests','addItem',1,'2026-08-28 01:06:29'),(1210,10,'WorkRequests','deleteItem',1,'2026-08-28 01:06:29'),(1211,10,'WorkRequests','delete',1,'2026-08-28 01:06:29'),(1212,1,'CompanyProfile','index',1,'2026-08-28 01:10:43'),(1213,1,'DocNumbers','index',1,'2026-08-28 01:10:43'),(1214,10,'CompanyProfile','index',1,'2026-08-28 01:10:43'),(1215,10,'CompanyProfile','saveAj',1,'2026-08-28 01:10:43'),(1216,10,'DocNumbers','index',1,'2026-08-28 01:10:43'),(1217,10,'DocNumbers','saveAj',1,'2026-08-28 01:10:43'),(1218,1,'FinancialStatements','trialBalance',1,'2026-08-28 01:41:30'),(1219,1,'FinancialStatements','profitAndLoss',1,'2026-08-28 01:41:30'),(1220,1,'FinancialStatements','balanceSheet',1,'2026-08-28 01:41:30'),(1221,1,'FinancialStatements','trialBalancePdf',1,'2026-08-28 01:41:30'),(1222,1,'FinancialStatements','trialBalanceXlsx',1,'2026-08-28 01:41:30'),(1223,1,'FinancialStatements','profitAndLossPdf',1,'2026-08-28 01:41:30'),(1224,1,'FinancialStatements','profitAndLossXlsx',1,'2026-08-28 01:41:30'),(1225,1,'FinancialStatements','balanceSheetPdf',1,'2026-08-28 01:41:30'),(1226,1,'FinancialStatements','balanceSheetXlsx',1,'2026-08-28 01:41:30'),(1227,2,'FinancialStatements','trialBalance',1,'2026-08-28 01:41:30'),(1228,2,'FinancialStatements','profitAndLoss',1,'2026-08-28 01:41:30'),(1229,2,'FinancialStatements','balanceSheet',1,'2026-08-28 01:41:30'),(1230,2,'FinancialStatements','trialBalancePdf',1,'2026-08-28 01:41:30'),(1231,2,'FinancialStatements','trialBalanceXlsx',1,'2026-08-28 01:41:30'),(1232,2,'FinancialStatements','profitAndLossPdf',1,'2026-08-28 01:41:30'),(1233,2,'FinancialStatements','profitAndLossXlsx',1,'2026-08-28 01:41:30'),(1234,2,'FinancialStatements','balanceSheetPdf',1,'2026-08-28 01:41:30'),(1235,2,'FinancialStatements','balanceSheetXlsx',1,'2026-08-28 01:41:30'),(1236,3,'FinancialStatements','trialBalance',1,'2026-08-28 01:41:30'),(1237,3,'FinancialStatements','profitAndLoss',1,'2026-08-28 01:41:30'),(1238,3,'FinancialStatements','balanceSheet',1,'2026-08-28 01:41:30'),(1239,3,'FinancialStatements','trialBalancePdf',1,'2026-08-28 01:41:30'),(1240,3,'FinancialStatements','trialBalanceXlsx',1,'2026-08-28 01:41:30'),(1241,3,'FinancialStatements','profitAndLossPdf',1,'2026-08-28 01:41:30'),(1242,3,'FinancialStatements','profitAndLossXlsx',1,'2026-08-28 01:41:30'),(1243,3,'FinancialStatements','balanceSheetPdf',1,'2026-08-28 01:41:30'),(1244,3,'FinancialStatements','balanceSheetXlsx',1,'2026-08-28 01:41:30'),(1245,10,'FinancialStatements','trialBalance',1,'2026-08-28 01:41:30'),(1246,10,'FinancialStatements','profitAndLoss',1,'2026-08-28 01:41:30'),(1247,10,'FinancialStatements','balanceSheet',1,'2026-08-28 01:41:30'),(1248,10,'FinancialStatements','trialBalancePdf',1,'2026-08-28 01:41:30'),(1249,10,'FinancialStatements','trialBalanceXlsx',1,'2026-08-28 01:41:30'),(1250,10,'FinancialStatements','profitAndLossPdf',1,'2026-08-28 01:41:30'),(1251,10,'FinancialStatements','profitAndLossXlsx',1,'2026-08-28 01:41:30'),(1252,10,'FinancialStatements','balanceSheetPdf',1,'2026-08-28 01:41:30'),(1253,10,'FinancialStatements','balanceSheetXlsx',1,'2026-08-28 01:41:30'),(1258,2,'Dashboard','finance',1,'2026-08-28 01:41:30'),(1259,2,'Dashboard','exec',1,'2026-08-28 01:41:30'),(1260,2,'CustomerInvoices','index',1,'2026-08-28 01:41:30'),(1261,2,'CustomerInvoices','view',1,'2026-08-28 01:41:30'),(1262,2,'CustomerInvoices','pdf',1,'2026-08-28 01:41:30'),(1263,2,'CustomerInvoices','print',1,'2026-08-28 01:41:30'),(1264,2,'CustomerInvoices','billTrips',1,'2026-08-28 01:41:30'),(1265,2,'CustomerReceipts','index',1,'2026-08-28 01:41:30'),(1266,2,'CustomerReceipts','view',1,'2026-08-28 01:41:30'),(1267,2,'CustomerReceipts','record',1,'2026-08-28 01:41:30'),(1268,2,'CustomerReceipts','save',1,'2026-08-28 01:41:30'),(1269,2,'AgedReceivables','index',1,'2026-08-28 01:41:30'),(1270,2,'CompanyProfile','index',1,'2026-08-28 01:41:30'),(1271,2,'CompanyProfile','saveAj',1,'2026-08-28 01:41:30'),(1272,2,'DocNumbers','index',1,'2026-08-28 01:41:30'),(1273,2,'DocNumbers','saveAj',1,'2026-08-28 01:41:30'),(1275,3,'Dashboard','finance',1,'2026-08-28 01:41:30'),(1276,3,'CustomerInvoices','index',1,'2026-08-28 01:41:30'),(1277,3,'CustomerInvoices','view',1,'2026-08-28 01:41:30'),(1278,3,'CustomerInvoices','pdf',1,'2026-08-28 01:41:30'),(1279,3,'CustomerInvoices','print',1,'2026-08-28 01:41:30'),(1280,3,'CustomerReceipts','index',1,'2026-08-28 01:41:30'),(1281,3,'CustomerReceipts','view',1,'2026-08-28 01:41:30'),(1282,3,'CustomerReceipts','record',1,'2026-08-28 01:41:30'),(1283,3,'CustomerReceipts','save',1,'2026-08-28 01:41:30'),(1284,3,'AgedReceivables','index',1,'2026-08-28 01:41:30'),(1286,1,'Dashboard','exec',1,'2026-08-28 01:41:30'),(1287,1,'Dashboard','finance',1,'2026-08-28 01:41:30'),(1288,1,'Dashboard','fleet',1,'2026-08-28 01:41:30'),(1289,1,'Dashboard','ops',1,'2026-08-28 01:41:30'),(1290,1,'Dashboard','hr',1,'2026-08-28 01:41:30'),(1291,1,'Dashboard','fuel',1,'2026-08-28 01:41:30'),(1292,1,'Dashboard','procurement',1,'2026-08-28 01:41:30'),(1294,22,'Dashboard','index',1,'2026-08-28 01:41:30'),(1295,22,'Dashboard','fleet',1,'2026-08-28 01:41:30'),(1296,22,'Suppliers','index',1,'2026-08-28 01:41:30'),(1297,22,'Suppliers','view',1,'2026-08-28 01:41:30'),(1298,22,'SupplierBills','index',1,'2026-08-28 01:41:30'),(1299,22,'SupplierBills','view',1,'2026-08-28 01:41:30'),(1300,22,'CustomerReceipts','index',1,'2026-08-28 01:41:30'),(1302,20,'Dashboard','index',1,'2026-08-28 01:41:30'),(1303,20,'Dashboard','ops',1,'2026-08-28 01:41:30'),(1304,20,'Dashboard','fleet',1,'2026-08-28 01:41:30'),(1306,21,'Dashboard','index',1,'2026-08-28 01:41:30'),(1307,21,'Dashboard','ops',1,'2026-08-28 01:41:30'),(1309,24,'Dashboard','index',1,'2026-08-28 01:41:30'),(1310,24,'Dashboard','hr',1,'2026-08-28 01:41:30'),(1311,24,'Payroll','index',1,'2026-08-28 01:41:30'),(1312,24,'Payroll','view',1,'2026-08-28 01:41:30'),(1313,24,'Payroll','add',1,'2026-08-28 01:41:30'),(1314,24,'Payroll','save',1,'2026-08-28 01:41:30'),(1315,24,'Payroll','compute',1,'2026-08-28 01:41:30'),(1316,24,'Payroll','approve',1,'2026-08-28 01:41:30'),(1317,24,'Payroll','pay',1,'2026-08-28 01:41:30'),(1318,24,'Payroll','payslip',1,'2026-08-28 01:41:30'),(1319,24,'Payroll','payslipPdf',1,'2026-08-28 01:41:30'),(1320,24,'Payroll','payslipsBatch',1,'2026-08-28 01:41:30'),(1321,24,'TaxReturns','index',1,'2026-08-28 01:41:30'),(1322,24,'TaxReturns','paye',1,'2026-08-28 01:41:30'),(1323,24,'TaxReturns','vat',1,'2026-08-28 01:41:30'),(1324,24,'TaxReturns','statutory',1,'2026-08-28 01:41:30'),(1325,24,'TaxReturns','payeCsv',1,'2026-08-28 01:41:30'),(1326,24,'DocExpiries','index',1,'2026-08-28 01:41:30'),(1327,24,'Notifications','index',1,'2026-08-28 01:41:30'),(1328,24,'Drivers','staffId',1,'2026-08-28 01:41:30'),(1335,23,'Dashboard','index',1,'2026-08-28 01:41:30'),(1336,23,'Dashboard','fuel',1,'2026-08-28 01:41:30'),(1337,23,'Trucks','index',1,'2026-08-28 01:41:30'),(1338,23,'Trucks','view',1,'2026-08-28 01:41:30'),(1339,23,'Drivers','index',1,'2026-08-28 01:41:30'),(1340,23,'Drivers','view',1,'2026-08-28 01:41:30'),(1341,23,'Trips','index',1,'2026-08-28 01:41:30'),(1342,23,'Trips','view',1,'2026-08-28 01:41:30'),(1343,23,'GpsDashboard','index',1,'2026-08-28 01:41:30'),(1344,23,'Notifications','index',1,'2026-08-28 01:41:30'),(1348,7,'Dashboard','procurement',1,'2026-08-28 01:41:30'),(1349,7,'SupplierPayments','index',1,'2026-08-28 01:41:30'),(1350,7,'SupplierPayments','view',1,'2026-08-28 01:41:30'),(1351,7,'AgedPayables','index',1,'2026-08-28 01:41:30'),(1352,7,'WorkOrders','index',1,'2026-08-28 01:41:30'),(1353,7,'WorkOrders','view',1,'2026-08-28 01:41:30'),(1355,6,'Dashboard','fleet',1,'2026-08-28 01:41:30'),(1356,6,'Trucks','index',1,'2026-08-28 01:41:30'),(1357,6,'Trucks','view',1,'2026-08-28 01:41:30'),(1358,6,'Drivers','index',1,'2026-08-28 01:41:30'),(1359,6,'Drivers','view',1,'2026-08-28 01:41:30'),(1360,6,'WorkOrders','index',1,'2026-08-28 01:41:30'),(1361,6,'WorkOrders','view',1,'2026-08-28 01:41:30'),(1362,6,'PmDashboard','index',1,'2026-08-28 01:41:30'),(1363,6,'PmDashboard','view',1,'2026-08-28 01:41:30'),(1364,6,'FuelEntries','index',1,'2026-08-28 01:41:30'),(1365,6,'DocExpiries','index',1,'2026-08-28 01:41:30'),(1368,1,'FleetAnalytics','matrix',1,'2026-08-28 04:40:49'),(1369,1,'FleetAnalytics','truck',1,'2026-08-28 04:40:49'),(1370,2,'FleetAnalytics','matrix',1,'2026-08-28 04:40:49'),(1371,2,'FleetAnalytics','truck',1,'2026-08-28 04:40:49'),(1372,10,'FleetAnalytics','matrix',1,'2026-08-28 04:40:49'),(1373,10,'FleetAnalytics','truck',1,'2026-08-28 04:40:49'),(1374,20,'FleetAnalytics','matrix',1,'2026-08-28 04:40:49'),(1375,20,'FleetAnalytics','truck',1,'2026-08-28 04:40:49'),(1376,21,'FleetAnalytics','matrix',1,'2026-08-28 04:40:49'),(1377,21,'FleetAnalytics','truck',1,'2026-08-28 04:40:49'),(1378,22,'FleetAnalytics','matrix',1,'2026-08-28 04:40:49'),(1379,22,'FleetAnalytics','truck',1,'2026-08-28 04:40:49'),(1380,10,'Download','index',1,'2026-08-28 06:55:28'),(1381,10,'Download','generate',1,'2026-08-28 06:55:28'),(1382,10,'Download','revoke',1,'2026-08-28 06:55:28'),(1383,10,'Download','view',1,'2026-08-28 06:55:28'),(1384,10,'Download','apkAdmin',1,'2026-08-28 06:55:28'),(1385,24,'Download','index',1,'2026-08-28 06:55:28'),(1386,24,'Download','generate',1,'2026-08-28 06:55:28'),(1387,24,'Download','revoke',1,'2026-08-28 06:55:28'),(1388,24,'Download','view',1,'2026-08-28 06:55:28'),(1389,24,'Download','apkAdmin',1,'2026-08-28 06:55:28');
/*!40000 ALTER TABLE `user_groups_perms` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `users` (
  `c0d` int NOT NULL AUTO_INCREMENT,
  `username` varchar(60) NOT NULL,
  `password` varchar(255) NOT NULL,
  `full_name` varchar(120) NOT NULL DEFAULT '',
  `email` varchar(120) NOT NULL DEFAULT '',
  `phone` varchar(40) NOT NULL DEFAULT '',
  `user_group_id` int NOT NULL,
  `user_group_name` varchar(60) NOT NULL,
  `status` varchar(20) NOT NULL DEFAULT 'ACTIVE',
  `last_login_on` timestamp NULL DEFAULT NULL,
  `created_by` int NOT NULL DEFAULT '0',
  `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `edited_by` int NOT NULL DEFAULT '0',
  `edited_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_username` (`username`),
  KEY `ix_group` (`user_group_id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES (1,'admin','$2y$10$J1D4FJtpdxZiv5ZsmNvVM.tpsxTm4eXEkqMKMqBByW6A6PCC1EUF.','System Administrator','admin@rsflow.local','',10,'Administrator','ACTIVE','2026-08-28 08:02:33',0,'2026-08-23 11:39:28',0,'2026-08-28 08:02:33',0),(2,'exec','$2y$10$J1D4FJtpdxZiv5ZsmNvVM.tpsxTm4eXEkqMKMqBByW6A6PCC1EUF.','Executive Test','','',1,'Executive','ACTIVE','2026-08-28 01:35:58',0,'2026-08-23 11:39:28',0,'2026-08-28 01:35:58',0),(3,'finance','$2y$10$J1D4FJtpdxZiv5ZsmNvVM.tpsxTm4eXEkqMKMqBByW6A6PCC1EUF.','Finance Manager Test','','',2,'Finance Manager','ACTIVE','2026-08-28 02:14:19',0,'2026-08-23 11:39:28',0,'2026-08-28 02:14:19',0),(4,'acct','$2y$10$J1D4FJtpdxZiv5ZsmNvVM.tpsxTm4eXEkqMKMqBByW6A6PCC1EUF.','Accountant Test','','',3,'Accountant','ACTIVE','2026-08-28 01:40:06',0,'2026-08-23 11:39:28',0,'2026-08-28 01:40:06',0),(5,'pm','$2y$10$J1D4FJtpdxZiv5ZsmNvVM.tpsxTm4eXEkqMKMqBByW6A6PCC1EUF.','Project Manager Test','','',4,'Project Manager','ACTIVE',NULL,0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(6,'pc','$2y$10$J1D4FJtpdxZiv5ZsmNvVM.tpsxTm4eXEkqMKMqBByW6A6PCC1EUF.','Projects Coordinator Test','','',5,'Projects Coordinator','ACTIVE',NULL,0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(7,'fs','$2y$10$J1D4FJtpdxZiv5ZsmNvVM.tpsxTm4eXEkqMKMqBByW6A6PCC1EUF.','Field Supervisor Test','','',6,'Field Supervisor','ACTIVE',NULL,0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(8,'procurement','$2y$10$J1D4FJtpdxZiv5ZsmNvVM.tpsxTm4eXEkqMKMqBByW6A6PCC1EUF.','Procurement Test','','',7,'Procurement','ACTIVE',NULL,0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(9,'stores','$2y$10$J1D4FJtpdxZiv5ZsmNvVM.tpsxTm4eXEkqMKMqBByW6A6PCC1EUF.','Stores Test','','',8,'Stores','ACTIVE',NULL,0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0),(10,'crm','$2y$10$J1D4FJtpdxZiv5ZsmNvVM.tpsxTm4eXEkqMKMqBByW6A6PCC1EUF.','CRM Test','','',9,'CRM','ACTIVE',NULL,0,'2026-08-23 11:39:28',0,'2026-08-23 11:39:28',0);
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `vendors`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `vendors` (
  `c0d` int NOT NULL AUTO_INCREMENT,
  `vendor_no` varchar(20) NOT NULL DEFAULT '',
  `vendor_name` varchar(160) NOT NULL,
  `vendor_address` text,
  `vendor_phone_1` varchar(40) NOT NULL DEFAULT '',
  `vendor_phone_2` varchar(40) NOT NULL DEFAULT '',
  `vendor_email` varchar(120) NOT NULL DEFAULT '',
  `vendor_website` varchar(200) NOT NULL DEFAULT '',
  `vendor_po_box` varchar(40) NOT NULL DEFAULT '',
  `vendor_city` varchar(60) NOT NULL DEFAULT '',
  `vendor_country` varchar(60) NOT NULL DEFAULT 'TANZANIA',
  `vendor_tin` varchar(40) NOT NULL DEFAULT '',
  `vendor_vrn` varchar(40) NOT NULL DEFAULT '',
  `vendor_category` varchar(60) NOT NULL DEFAULT '',
  `vendor_poc` varchar(120) NOT NULL DEFAULT '',
  `vendor_poc_phone` varchar(40) NOT NULL DEFAULT '',
  `vendor_poc_email` varchar(120) NOT NULL DEFAULT '',
  `bank_name` varchar(120) NOT NULL DEFAULT '',
  `bank_account_no` varchar(60) NOT NULL DEFAULT '',
  `bank_swift` varchar(40) NOT NULL DEFAULT '',
  `status` varchar(20) NOT NULL DEFAULT 'ACTIVE',
  `created_by` int NOT NULL DEFAULT '0',
  `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `edited_by` int NOT NULL DEFAULT '0',
  `edited_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_vendor_no` (`vendor_no`),
  KEY `ix_category` (`vendor_category`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `vendors` WRITE;
/*!40000 ALTER TABLE `vendors` DISABLE KEYS */;
INSERT INTO `vendors` VALUES (1,'00001','Elite Auto Workshop Ltd','','+255 22 111 2222','','ops@elite.co.tz','','','Dar es Salaam','TANZANIA','111-222-333','','workshop','','','','','','','ACTIVE',1,'2026-08-23 16:32:36',1,'2026-08-23 16:32:36',0),(2,'V-0001','ACME Fuel Ltd','','+255 22 000 1234','','','','','','TANZANIA','111-222-333','','Fuel','','','','','','','ACTIVE',1,'2026-08-27 18:04:15',0,'2026-08-27 18:04:15',0);
/*!40000 ALTER TABLE `vendors` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `work_order_parts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `work_order_parts` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `work_order_id` int unsigned NOT NULL,
  `part_no` varchar(60) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `part_name` varchar(160) COLLATE utf8mb4_unicode_ci NOT NULL,
  `category` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'spare_parts',
  `qty` decimal(10,3) NOT NULL DEFAULT '1.000',
  `unit_cost` decimal(14,2) NOT NULL DEFAULT '0.00',
  `total_cost` decimal(14,2) NOT NULL DEFAULT '0.00',
  `gl_account_code` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_by` int unsigned DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  KEY `idx_wop_wo` (`work_order_id`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `work_order_parts` WRITE;
/*!40000 ALTER TABLE `work_order_parts` DISABLE KEYS */;
/*!40000 ALTER TABLE `work_order_parts` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `work_orders`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `work_orders` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `wo_no` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `truck_id` int unsigned NOT NULL,
  `vendor_id` int unsigned DEFAULT NULL,
  `kind` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'planned',
  `priority` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'normal',
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'open',
  `opened_on` date NOT NULL,
  `opened_by` int unsigned DEFAULT NULL,
  `opened_km` int unsigned DEFAULT NULL,
  `started_at` datetime DEFAULT NULL,
  `started_by` int unsigned DEFAULT NULL,
  `completed_at` datetime DEFAULT NULL,
  `completed_by` int unsigned DEFAULT NULL,
  `closed_at` datetime DEFAULT NULL,
  `closed_by` int unsigned DEFAULT NULL,
  `cancelled_at` datetime DEFAULT NULL,
  `cancelled_by` int unsigned DEFAULT NULL,
  `cancel_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fault_description` text COLLATE utf8mb4_unicode_ci,
  `work_performed` text COLLATE utf8mb4_unicode_ci,
  `parts_cost` decimal(14,2) NOT NULL DEFAULT '0.00',
  `labour_hours` decimal(8,2) NOT NULL DEFAULT '0.00',
  `labour_rate` decimal(10,2) NOT NULL DEFAULT '0.00',
  `labour_cost` decimal(14,2) NOT NULL DEFAULT '0.00',
  `external_cost` decimal(14,2) NOT NULL DEFAULT '0.00',
  `total_cost` decimal(14,2) NOT NULL DEFAULT '0.00',
  `currency` varchar(6) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'TZS',
  `downtime_hrs` decimal(8,2) DEFAULT NULL,
  `payment_method` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_reference` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `je_id` int unsigned DEFAULT NULL,
  `void_je_id` int unsigned DEFAULT NULL,
  `created_by` int unsigned DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `edited_by` int unsigned DEFAULT NULL,
  `edited_on` datetime DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `source_wr_id` int unsigned DEFAULT NULL,
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_wo_no` (`wo_no`),
  KEY `idx_wo_truck` (`truck_id`,`status`),
  KEY `idx_wo_vendor` (`vendor_id`),
  KEY `idx_wo_status` (`status`,`deleted`),
  KEY `idx_wo_kind` (`kind`),
  KEY `idx_wo_opened` (`opened_on`),
  KEY `idx_wo_source_wr` (`source_wr_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `work_orders` WRITE;
/*!40000 ALTER TABLE `work_orders` DISABLE KEYS */;
/*!40000 ALTER TABLE `work_orders` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `work_request_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `work_request_items` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `work_request_id` int unsigned NOT NULL,
  `seq_no` int NOT NULL DEFAULT '1',
  `item_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'part',
  `description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `category` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'spare_parts',
  `qty` decimal(10,3) NOT NULL DEFAULT '1.000',
  `uom` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'unit',
  `unit_cost_est` decimal(14,2) NOT NULL DEFAULT '0.00',
  `total_est` decimal(14,2) NOT NULL DEFAULT '0.00',
  `vendor_id` int unsigned DEFAULT NULL,
  `actual_cost` decimal(14,2) DEFAULT NULL,
  `sourcing_status` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'not_started',
  `notes` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_by` int unsigned DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  KEY `idx_wri_wr` (`work_request_id`,`deleted`,`seq_no`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `work_request_items` WRITE;
/*!40000 ALTER TABLE `work_request_items` DISABLE KEYS */;
INSERT INTO `work_request_items` VALUES (1,1,1,'part','Heavy-duty battery 12V 200Ah N200','batteries',1.000,'unit',420000.00,420000.00,NULL,NULL,'not_started','',1,'2026-08-27 08:10:15',0),(2,1,2,'labour','Fitting labour + battery test','consumables',1.500,'hours',40000.00,60000.00,NULL,NULL,'not_started','',1,'2026-08-27 08:10:16',0);
/*!40000 ALTER TABLE `work_request_items` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `work_request_transitions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `work_request_transitions` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `work_request_id` int unsigned NOT NULL,
  `from_status` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `to_status` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `actor_id` int unsigned DEFAULT NULL,
  `actor_name` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `action_at` datetime NOT NULL,
  `note` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`c0d`),
  KEY `idx_wrt_wr` (`work_request_id`,`action_at`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `work_request_transitions` WRITE;
/*!40000 ALTER TABLE `work_request_transitions` DISABLE KEYS */;
INSERT INTO `work_request_transitions` VALUES (1,1,NULL,'draft',1,'','2026-08-27 08:10:15','Request created'),(2,1,'draft','submitted',1,'System Administrator','2026-08-27 08:10:17','Submitted for Ops Manager approval'),(3,1,'submitted','approved',1,'System Administrator','2026-08-27 08:10:17','Approved up to TZS 500,000.00'),(4,1,'approved','sourcing',1,'System Administrator','2026-08-27 08:10:17','Procurement started sourcing'),(5,1,'sourcing','ready',1,'System Administrator','2026-08-27 08:10:17','Parts ready · workshop to schedule'),(6,1,'ready','wo_created',1,'System Administrator','2026-08-27 08:11:23','Converted to WO-00003'),(7,1,'wo_created','completed',1,'System Administrator','2026-08-27 08:11:25','WO WO-00003 closed'),(8,2,NULL,'submitted',0,'','2026-08-27 10:10:06','Request created');
/*!40000 ALTER TABLE `work_request_transitions` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `work_requests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `work_requests` (
  `c0d` int unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` int unsigned NOT NULL DEFAULT '1',
  `wr_no` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `truck_id` int unsigned NOT NULL,
  `driver_id` int unsigned DEFAULT NULL,
  `urgency` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'normal',
  `reported_at` datetime DEFAULT NULL,
  `reported_by` int unsigned DEFAULT NULL,
  `truck_odometer` int unsigned DEFAULT NULL,
  `fault_location` varchar(160) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `symptom` text COLLATE utf8mb4_unicode_ci,
  `estimated_cost` decimal(14,2) NOT NULL DEFAULT '0.00',
  `approved_amount` decimal(14,2) DEFAULT NULL,
  `currency` varchar(6) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'TZS',
  `approved_by` int unsigned DEFAULT NULL,
  `approved_at` datetime DEFAULT NULL,
  `approval_notes` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `rejected_by` int unsigned DEFAULT NULL,
  `rejected_at` datetime DEFAULT NULL,
  `reject_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sourcing_by` int unsigned DEFAULT NULL,
  `sourcing_started_at` datetime DEFAULT NULL,
  `sourcing_notes` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sourced_vendor_id` int unsigned DEFAULT NULL,
  `ready_at` datetime DEFAULT NULL,
  `ready_by` int unsigned DEFAULT NULL,
  `wo_id` int unsigned DEFAULT NULL,
  `completed_at` datetime DEFAULT NULL,
  `completed_by` int unsigned DEFAULT NULL,
  `cancelled_at` datetime DEFAULT NULL,
  `cancelled_by` int unsigned DEFAULT NULL,
  `cancel_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
  `notes` text COLLATE utf8mb4_unicode_ci,
  `submitted_by` int unsigned DEFAULT NULL,
  `submitted_at` datetime DEFAULT NULL,
  `created_by` int unsigned DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `edited_by` int unsigned DEFAULT NULL,
  `edited_on` datetime DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c0d`),
  UNIQUE KEY `uq_wr_no` (`wr_no`),
  KEY `idx_wr_truck` (`truck_id`,`status`),
  KEY `idx_wr_driver` (`driver_id`),
  KEY `idx_wr_status` (`status`,`deleted`),
  KEY `idx_wr_urgency` (`urgency`),
  KEY `idx_wr_reported` (`reported_at`),
  KEY `idx_wr_wo` (`wo_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `work_requests` WRITE;
/*!40000 ALTER TABLE `work_requests` DISABLE KEYS */;
INSERT INTO `work_requests` VALUES (1,1,'WR-00001',100,100,'high','2026-08-27 08:10:15',1,45750,'At Twiga plant loading bay','Battery dead — dim lights for 2 days then wouldn\'t start this morning. Boosted with cables, works now but replacement needed.',480000.00,500000.00,'TZS',1,'2026-08-27 08:10:17','Approved with 20k contingency',NULL,NULL,NULL,1,'2026-08-27 08:10:17','Confirmed with Elite Auto Workshop; delivery tomorrow',1,'2026-08-27 08:10:17',1,3,'2026-08-27 08:11:24',1,NULL,NULL,NULL,'completed',NULL,1,'2026-08-27 08:10:17',1,'2026-08-27 08:10:15',1,'2026-08-27 08:11:24',0),(2,1,'WR-00002',100,100,'high','2026-08-27 10:10:06',0,123750,'On Chalinze route','Warning light on dashboard - low tyre pressure warning',0.00,NULL,'TZS',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'submitted',NULL,NULL,NULL,0,'2026-08-27 10:10:06',NULL,NULL,0);
/*!40000 ALTER TABLE `work_requests` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

