-- Payroll remittances: tracks statutory bill payments (PAYE, Pension, Union fees)
CREATE TABLE IF NOT EXISTS `payroll_remittances` (
  `remittance_id` int(11) NOT NULL AUTO_INCREMENT,
  `payroll_run_id` int(11) DEFAULT NULL,
  `bill_type` enum('PAYE','Pension','Union Fee','Other') NOT NULL DEFAULT 'Other',
  `description` varchar(255) NOT NULL DEFAULT '',
  `amount` decimal(14,2) NOT NULL DEFAULT 0.00,
  `due_date` date DEFAULT NULL,
  `payment_date` date DEFAULT NULL,
  `payment_status` enum('pending','paid','overdue') NOT NULL DEFAULT 'pending',
  `reference_number` varchar(120) DEFAULT NULL,
  `branch_id` int(11) DEFAULT NULL,
  `recorded_by` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`remittance_id`),
  KEY `payroll_run_id` (`payroll_run_id`),
  KEY `branch_id` (`branch_id`),
  KEY `payment_status` (`payment_status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
