-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `logistic`
--

-- --------------------------------------------------------

--
-- Table structure for table `account_groups`
--

CREATE TABLE `account_groups` (
  `id` bigint UNSIGNED NOT NULL,
  `company_id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `parent_id` bigint UNSIGNED DEFAULT NULL,
  `type` enum('asset','liability','income','expense') COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `account_groups`
--

INSERT INTO `account_groups` (`id`, `company_id`, `name`, `parent_id`, `type`, `created_at`, `updated_at`) VALUES
(1, 1, 'Business Income Account', NULL, 'income', '2025-08-26 09:29:21', '2025-08-26 09:29:21'),
(2, 1, 'Current Assets Account', NULL, 'asset', '2025-08-26 09:36:58', '2025-08-26 09:36:58'),
(3, 1, 'Account Receivables Account', 2, 'asset', '2025-08-26 09:37:32', '2025-08-26 09:37:32'),
(4, 1, 'Bank Accounts', 2, 'asset', '2025-08-26 09:40:40', '2025-08-26 09:40:40'),
(5, 1, 'Cash In Hand Account', 2, 'asset', '2025-08-26 09:40:59', '2025-08-26 09:40:59'),
(6, 1, 'Deposits (Asset) Account', 2, 'asset', '2025-08-26 09:43:27', '2025-08-26 09:43:27'),
(7, 1, 'Insurance Claims Account', 2, 'asset', '2025-08-26 09:43:55', '2025-08-26 09:43:55'),
(8, 1, 'Loans & Advances (Asset) Account', 2, 'asset', '2025-08-26 09:44:27', '2025-08-26 09:45:09'),
(9, 1, 'Trucks Administration Expenses Account', 10, 'expense', '2025-08-27 00:28:11', '2025-08-27 00:28:55'),
(10, 1, 'Operating  Expenses Account', NULL, 'expense', '2025-08-27 00:28:46', '2025-08-27 00:28:46'),
(11, 1, 'Purchase Accounts', NULL, 'expense', '2025-08-27 01:10:40', '2025-08-27 01:10:40'),
(12, 1, 'Sales Accounts', NULL, 'income', '2025-08-27 01:11:14', '2025-08-27 01:11:14'),
(13, 1, 'Current Liabilities Account', NULL, 'liability', '2025-08-27 01:16:08', '2025-08-27 01:16:08'),
(14, 1, 'Staff Payroll Expenses Account', 10, 'expense', '2025-08-27 11:21:23', '2025-08-27 11:21:23'),
(15, 1, 'Current Liabilities Account', NULL, 'liability', '2025-08-28 20:23:06', '2025-08-28 20:23:06'),
(16, 1, 'Account Payables Account', 15, 'liability', '2025-08-28 20:26:59', '2025-08-28 20:26:59'),
(17, 1, 'Loans & Advances (Asset) Account', 2, 'asset', '2025-08-30 09:43:35', '2025-08-30 09:43:35');

-- --------------------------------------------------------

--
-- Table structure for table `account_types`
--

CREATE TABLE `account_types` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `start_code` int DEFAULT NULL,
  `end_code` int DEFAULT NULL,
  `status` int NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `account_types`
--

INSERT INTO `account_types` (`id`, `name`, `start_code`, `end_code`, `status`, `created_at`, `updated_at`) VALUES
(1, 'ASSET', 1, 1999, 1, '2023-05-15 05:27:51', '2023-05-15 05:27:51'),
(2, 'EXPENSES', 5000, 8999, 1, '2023-05-15 05:27:51', '2023-05-15 05:27:51'),
(3, 'SHARE EQUITY', 3000, 3999, 1, '2023-05-15 05:27:51', '2023-10-16 02:00:40'),
(4, 'LIABILITIES', 2000, 2999, 1, '2023-05-15 05:27:51', '2023-05-15 05:27:51'),
(5, 'REVENUE', 4000, 4999, 1, '2023-05-15 05:27:51', '2023-05-15 05:27:51');

-- --------------------------------------------------------

--
-- Table structure for table `administration_costs`
--

CREATE TABLE `administration_costs` (
  `id` bigint UNSIGNED NOT NULL,
  `dept_id` bigint UNSIGNED NOT NULL,
  `type_id` bigint UNSIGNED DEFAULT NULL,
  `amount` double NOT NULL,
  `truck_id` bigint UNSIGNED DEFAULT NULL,
  `reason` text COLLATE utf8mb4_unicode_ci,
  `status` int NOT NULL DEFAULT '0',
  `approval_status` int NOT NULL DEFAULT '0',
  `state` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `requested_by` bigint UNSIGNED DEFAULT NULL,
  `currency_id` bigint UNSIGNED DEFAULT NULL,
  `rate` double DEFAULT NULL,
  `real_amount` double DEFAULT NULL,
  `quantity` double DEFAULT NULL,
  `transaction_charges` double DEFAULT NULL,
  `service_charges` double DEFAULT NULL,
  `vat_charges` double DEFAULT NULL,
  `payment_status` int DEFAULT NULL,
  `paid_amount` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `real_paid_amount` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `currency_log_id` int NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `allocations`
--

CREATE TABLE `allocations` (
  `id` bigint UNSIGNED NOT NULL,
  `ref_no` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `customer_id` bigint UNSIGNED NOT NULL,
  `amount` double NOT NULL,
  `quantity` double NOT NULL,
  `cargo` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `trip_nature` enum('None','Flatbed','Tanker') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cargo_ref` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `estimated_pay` double NOT NULL DEFAULT '0',
  `loading_site` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `offloading_site` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `clearance` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'No',
  `container` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'No',
  `container_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dimensions` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_currency` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rate` double DEFAULT NULL,
  `real_amount` double DEFAULT NULL,
  `route_id` bigint UNSIGNED NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `unit` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Ton',
  `status` int NOT NULL DEFAULT '0',
  `approval_status` int NOT NULL DEFAULT '0',
  `type` int NOT NULL DEFAULT '1',
  `state` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_by` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `goingload_id` int DEFAULT NULL,
  `approver_id` int NOT NULL DEFAULT '0',
  `disapprover_id` int NOT NULL DEFAULT '0',
  `usd_income` double NOT NULL DEFAULT '0',
  `cargo_nature` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_mode` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `allocation_costs`
--

CREATE TABLE `allocation_costs` (
  `id` bigint UNSIGNED NOT NULL,
  `allocation_id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` double NOT NULL,
  `account_code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_by` bigint UNSIGNED NOT NULL,
  `route_id` bigint UNSIGNED NOT NULL,
  `currency_id` bigint UNSIGNED NOT NULL,
  `rate` double NOT NULL,
  `real_amount` double NOT NULL,
  `status` int NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `quantity` double DEFAULT NULL,
  `vat` tinyint(1) NOT NULL DEFAULT '0',
  `editable` tinyint(1) NOT NULL DEFAULT '0',
  `type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'All',
  `advancable` int NOT NULL DEFAULT '0',
  `paid_amount` double NOT NULL DEFAULT '0',
  `remaining_amount` double NOT NULL DEFAULT '0',
  `payment_status` int NOT NULL DEFAULT '0',
  `return` tinyint(1) NOT NULL DEFAULT '0',
  `reason` text COLLATE utf8mb4_unicode_ci,
  `missing_status` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `allocation_cost_payments`
--

CREATE TABLE `allocation_cost_payments` (
  `id` bigint UNSIGNED NOT NULL,
  `allocation_id` bigint UNSIGNED DEFAULT NULL,
  `truck_id` bigint UNSIGNED NOT NULL,
  `cost_id` bigint UNSIGNED NOT NULL,
  `paid_by` bigint UNSIGNED NOT NULL,
  `paid_date` date NOT NULL,
  `amount` double NOT NULL,
  `remain` int NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `transaction_charges` double DEFAULT NULL,
  `service_charges` double NOT NULL DEFAULT '0',
  `vat_charges` double NOT NULL DEFAULT '0',
  `payment_status` int NOT NULL DEFAULT '0',
  `transfer` int NOT NULL DEFAULT '0',
  `reason` text COLLATE utf8mb4_unicode_ci,
  `station` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `paid_amount` double DEFAULT NULL,
  `real_paid_amount` double DEFAULT NULL,
  `currency_log_id` int NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `allocation_reference_settings`
--

CREATE TABLE `allocation_reference_settings` (
  `id` bigint UNSIGNED NOT NULL,
  `type` int NOT NULL COMMENT 'Allocation type (1 for GL, 2 for BL)',
  `prefix` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'Prefix for reference number (e.g., GL, BL)',
  `pattern` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '{type_prefix}-{customer_abbreviation}{year}{month}-{id}' COMMENT 'Pattern for generating reference number',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `allocation_reference_settings`
--

INSERT INTO `allocation_reference_settings` (`id`, `type`, `prefix`, `pattern`, `created_at`, `updated_at`) VALUES
(1, 1, 'GL', '{type_prefix}-{customer_abbreviation}{year}{month}-{id}', '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(2, 2, 'BL', '{type_prefix}-{customer_abbreviation}{year}{month}-{id}', '2026-04-21 16:42:19', '2026-04-21 16:42:19');

-- --------------------------------------------------------

--
-- Table structure for table `allocation_remarks`
--

CREATE TABLE `allocation_remarks` (
  `id` bigint UNSIGNED NOT NULL,
  `allocation_id` bigint UNSIGNED NOT NULL,
  `remark` text COLLATE utf8mb4_unicode_ci,
  `status` int NOT NULL DEFAULT '1',
  `remarked_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_by` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `approvals`
--

CREATE TABLE `approvals` (
  `id` bigint UNSIGNED NOT NULL,
  `process_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `levels` int NOT NULL DEFAULT '0',
  `escallation` tinyint(1) NOT NULL,
  `escallation_time` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `approvals`
--

INSERT INTO `approvals` (`id`, `process_name`, `levels`, `escallation`, `escallation_time`, `created_at`, `updated_at`) VALUES
(1, 'Trip Approval', 0, 0, NULL, '2026-04-21 16:44:30', '2026-04-21 16:44:30'),
(2, 'Invoice Approval', 0, 0, NULL, '2026-04-21 16:44:34', '2026-04-21 16:44:34');

-- --------------------------------------------------------

--
-- Table structure for table `approval_levels`
--

CREATE TABLE `approval_levels` (
  `id` bigint UNSIGNED NOT NULL,
  `approval_id` bigint NOT NULL,
  `role_id` bigint NOT NULL,
  `level_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rank` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `label_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` tinyint(1) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `audits`
--

CREATE TABLE `audits` (
  `id` bigint UNSIGNED NOT NULL,
  `user_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_id` bigint UNSIGNED DEFAULT NULL,
  `event` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `auditable_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `auditable_id` bigint UNSIGNED NOT NULL,
  `old_values` text COLLATE utf8mb4_unicode_ci,
  `new_values` text COLLATE utf8mb4_unicode_ci,
  `url` text COLLATE utf8mb4_unicode_ci,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` varchar(1023) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tags` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `audits`
--

INSERT INTO `audits` (`id`, `user_type`, `user_id`, `event`, `auditable_type`, `auditable_id`, `old_values`, `new_values`, `url`, `ip_address`, `user_agent`, `tags`, `created_at`, `updated_at`) VALUES
(1, 'App\\Models\\User', 1, 'updated', 'App\\Models\\User', 1, '[]', '[]', 'http://localhost/logistic/public/login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36 Edg/147.0.0.0', NULL, '2026-04-21 16:44:01', '2026-04-21 16:44:01'),
(2, 'App\\Models\\User', 1, 'created', 'App\\Models\\Approval', 1, '[]', '{\"process_name\":\"Trip Approval\",\"levels\":0,\"escallation\":false,\"escallation_time\":null}', 'http://localhost/logistic/public/trips/finance-trips', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36 Edg/147.0.0.0', NULL, '2026-04-21 16:44:30', '2026-04-21 16:44:30'),
(3, 'App\\Models\\User', 1, 'created', 'App\\Models\\Approval', 2, '[]', '{\"process_name\":\"Invoice Approval\",\"levels\":0,\"escallation\":false,\"escallation_time\":null}', 'http://localhost/logistic/public/finance/all-trips', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36 Edg/147.0.0.0', NULL, '2026-04-21 16:44:34', '2026-04-21 16:44:34');

-- --------------------------------------------------------

--
-- Table structure for table `batches`
--

CREATE TABLE `batches` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `breakdowns`
--

CREATE TABLE `breakdowns` (
  `id` bigint UNSIGNED NOT NULL,
  `truck_id` bigint UNSIGNED DEFAULT NULL,
  `trip_id` bigint UNSIGNED DEFAULT NULL,
  `breakdown_category_id` bigint UNSIGNED DEFAULT NULL,
  `breakdown_item_id` bigint UNSIGNED DEFAULT NULL,
  `added_by_id` bigint UNSIGNED DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `cost` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type_of_breakdown` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` int DEFAULT NULL,
  `brakedown_date` datetime DEFAULT NULL,
  `state` int DEFAULT NULL,
  `currency_id` bigint UNSIGNED DEFAULT NULL,
  `new_cost` double DEFAULT NULL,
  `is_paid` tinyint(1) DEFAULT NULL,
  `pay_type` int DEFAULT NULL,
  `payment_date` datetime DEFAULT NULL,
  `rate` double DEFAULT NULL,
  `real_amount` double DEFAULT NULL,
  `new_cost_currency_id` bigint UNSIGNED DEFAULT NULL,
  `breakdown_level` int DEFAULT NULL,
  `payment_level` int DEFAULT NULL,
  `code` int DEFAULT NULL,
  `location` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `breakdown_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `closed_date` datetime DEFAULT NULL,
  `closed_by_id` bigint UNSIGNED DEFAULT NULL,
  `created_by` int DEFAULT NULL,
  `workshop_status` tinyint(1) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `breakdown_categories`
--

CREATE TABLE `breakdown_categories` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_by_id` bigint UNSIGNED DEFAULT NULL,
  `status` int NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `breakdown_expenses`
--

CREATE TABLE `breakdown_expenses` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `breakdown_id` bigint UNSIGNED NOT NULL,
  `fund_type_id` bigint UNSIGNED NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `currency_id` bigint UNSIGNED NOT NULL,
  `paid_at` datetime DEFAULT NULL,
  `status` int NOT NULL DEFAULT '0',
  `level` int NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `narration` text COLLATE utf8mb4_unicode_ci,
  `real_amount` double DEFAULT NULL,
  `transaction_charges` double DEFAULT NULL,
  `service_charges` double NOT NULL DEFAULT '0',
  `vat_charges` double NOT NULL DEFAULT '0',
  `paid_amount` double NOT NULL DEFAULT '0',
  `real_paid_amount` double NOT NULL DEFAULT '0',
  `payment_status` int NOT NULL DEFAULT '0',
  `currency_log_id` int NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `breakdown_items`
--

CREATE TABLE `breakdown_items` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `breakdown_category_id` bigint UNSIGNED NOT NULL,
  `status` int NOT NULL DEFAULT '0',
  `cost` decimal(15,2) DEFAULT NULL,
  `currency_id` bigint UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `cargo_natures`
--

CREATE TABLE `cargo_natures` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `cargo_natures`
--

INSERT INTO `cargo_natures` (`id`, `name`, `status`, `created_at`, `updated_at`) VALUES
(1, 'Container', 0, '2023-03-23 20:51:14', '2023-03-23 20:51:15'),
(2, 'Loose Cargo', 0, '2023-03-23 20:51:14', '2023-03-23 20:51:15'),
(3, 'Out of grade', 0, '2023-03-23 20:51:14', '2023-03-23 20:51:15');

-- --------------------------------------------------------

--
-- Table structure for table `categories`
--

CREATE TABLE `categories` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `tag` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'spare',
  `status` tinyint NOT NULL DEFAULT '1',
  `created_by` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `categories`
--

INSERT INTO `categories` (`id`, `name`, `tag`, `status`, `created_by`, `created_at`, `updated_at`) VALUES
(1, 'LIGHTS', 'spare', 1, 3, '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(2, 'TYRES', 'spare', 1, 3, '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(3, 'LASHING GEARS', 'spare', 1, 3, '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(4, 'SUSPENSION', 'spare', 1, 3, '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(5, 'SPARE PARTS', 'spare', 1, 3, '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(6, 'PRINTING AND STATIONARIES', 'office', 1, 3, '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(7, 'BATTERIES', 'spare', 1, 3, '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(8, 'RADIATOR', 'spare', 1, 3, '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(9, 'FIRE EXTINGUISHERS', 'spare', 1, 3, '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(10, 'SAFETY', 'spare', 1, 3, '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(11, 'FIRST AID', 'spare', 1, 3, '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(12, 'OTHERS', 'spare', 1, 3, '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(13, 'ELECTRIC SYSTEM', 'spare', 1, 1, '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(14, 'MECHANICAL SYSTEM', 'spare', 1, 1, '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(15, 'PNEUMATIC SYSTEM', 'spare', 1, 1, '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(16, 'BODY & PAINTS', 'spare', 1, 1, '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(17, 'TYRE AND TUBES', 'spare', 1, 1, '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(18, 'CABIN & CHASIS', 'spare', 1, 1, '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(19, 'OTHERS TRUCKS PARTS', 'spare', 1, 1, '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(20, 'STORE', 'spare', 1, 1, '2026-04-21 16:42:19', '2026-04-21 16:42:19');

-- --------------------------------------------------------

--
-- Table structure for table `common_bulk_expenses`
--

CREATE TABLE `common_bulk_expenses` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `ledger_id` bigint UNSIGNED NOT NULL,
  `created_by` bigint UNSIGNED NOT NULL,
  `status` int NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `common_bulk_expenses`
--

INSERT INTO `common_bulk_expenses` (`id`, `name`, `ledger_id`, `created_by`, `status`, `created_at`, `updated_at`) VALUES
(1, 'NAKONDE PARKING', 27, 844, 0, '2024-01-09 04:55:40', '2024-01-09 04:55:40'),
(2, 'TUNDUMA PARKING', 27, 844, 0, '2024-01-09 04:56:02', '2024-01-09 04:56:02'),
(3, 'PARKING-Normal Parking', 27, 862, 0, '2024-01-09 04:56:54', '2024-05-23 02:44:49'),
(4, 'TUNDUMA/ NAKONDE ARGENT FEE', 31, 844, 0, '2024-01-19 07:24:37', '2024-01-19 07:24:37'),
(5, 'DRC ARGENT FEE', 31, 844, 0, '2024-01-19 07:25:24', '2024-01-19 07:25:24'),
(6, 'TRANSACTION CHARGES', 226, 844, 0, '2024-01-30 03:54:06', '2024-01-30 03:54:06'),
(7, 'LASHING GEARS FEE', 34, 844, 0, '2024-01-31 06:37:29', '2024-01-31 06:37:29'),
(9, 'GCLA PERMITS', 138, 844, 0, '2024-02-08 01:48:40', '2024-02-08 01:48:40'),
(10, 'FACILITATIONS EXPENSES', 231, 844, 0, '2024-02-08 02:19:44', '2024-02-08 02:19:44'),
(11, 'LOADING PERDIEM', 18, 844, 0, '2024-02-13 03:13:46', '2024-02-13 03:13:46'),
(12, 'OVERSTAY PERDIEM', 18, 844, 0, '2024-02-13 03:14:34', '2024-02-13 03:15:12'),
(13, 'PARKING FEE- KURASINI', 27, 844, 0, '2024-02-13 09:27:33', '2024-02-13 09:27:33'),
(14, 'TRAFFIC FINES', 217, 862, 0, '2024-02-14 01:14:21', '2024-02-14 01:14:21'),
(15, 'ADDITIONAL TOLLGATES', 44, 862, 0, '2024-02-15 05:35:46', '2024-02-15 05:35:46'),
(16, 'MOVEMENT SHEET FEE', 234, 844, 0, '2024-02-16 08:15:53', '2024-02-16 08:15:53'),
(17, 'PARKING PENALTY KASUMBALESA', 235, 844, 0, '2024-02-21 08:28:19', '2024-02-21 08:28:19'),
(18, 'WHISKY PARKING PENALTY', 235, 844, 0, '2024-02-21 08:28:50', '2024-02-21 08:28:50'),
(19, 'PARKING LUBUMBASHI', 27, 844, 0, '2024-02-21 08:39:17', '2024-02-21 08:39:17'),
(20, 'STICKER NENDA KWA USALAMA', 92, 844, 0, '2024-02-22 03:07:20', '2024-02-22 03:07:20'),
(21, 'FUEL EXPENSES-OOB', 16, 844, 0, '2024-02-28 03:21:36', '2024-02-28 03:21:36'),
(22, 'LATRA PROCESING FEE', 31, 844, 0, '2024-02-29 06:32:48', '2024-02-29 06:32:48'),
(23, 'TRANSPORT FEES', 73, 862, 0, '2024-03-11 06:56:20', '2024-03-11 06:56:20'),
(24, 'VISA & PER DIEM', 23, 862, 0, '2024-03-14 04:13:52', '2024-03-14 04:13:52'),
(25, 'ENTRY CARD RENEWALS', 29, 862, 0, '2024-03-14 04:14:36', '2024-03-14 04:14:36'),
(26, 'WEIGHBRIDGE FEES', 30, 862, 0, '2024-03-15 05:53:53', '2024-03-15 05:53:53'),
(27, 'ROAD PERMIT & CARBON TAX', 20, 862, 0, '2024-03-23 02:44:41', '2024-03-23 02:44:41'),
(28, 'MOBILIZATION COSTS FOR PEAGES', 26, 862, 0, '2024-04-24 04:32:41', '2024-04-24 04:32:41'),
(29, 'MOBILIZATION FACILITATION COSTS', 231, 862, 0, '2024-04-24 04:34:44', '2024-04-24 04:34:44'),
(30, 'ROAD TOLL EXTENSION FEES', 26, 862, 0, '2024-04-29 03:30:36', '2024-04-29 03:30:36'),
(31, 'CONTAINER OFFLOADING FEES', 39, 862, 0, '2024-05-02 03:21:27', '2024-05-02 03:21:27'),
(32, 'COUNCIL FEES', 26, 862, 0, '2024-05-23 02:46:04', '2024-05-23 02:46:04'),
(33, 'ABNORMAL PERMITS', 138, 862, 0, '2024-05-23 02:47:06', '2024-05-23 02:47:06'),
(34, 'ESCORT FEES UNDER A TRIP', 283, 862, 0, '2024-05-23 07:37:25', '2024-05-23 07:37:25'),
(35, 'MILEAGE PER DIEM', 18, 862, 0, '2024-06-07 02:41:30', '2024-06-07 02:41:30'),
(36, 'RADIATION FEE', 1, 862, 0, '2024-08-24 02:15:11', '2024-08-24 02:15:11'),
(37, 'CNPR FEE', 35, 862, 0, '2024-08-31 04:10:07', '2024-08-31 04:10:07');

-- --------------------------------------------------------

--
-- Table structure for table `common_costs`
--

CREATE TABLE `common_costs` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `ledger_id` bigint NOT NULL,
  `created_by` bigint NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `vat` tinyint(1) NOT NULL DEFAULT '0',
  `editable` tinyint(1) NOT NULL DEFAULT '0',
  `advancable` int NOT NULL DEFAULT '0',
  `return` tinyint(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `common_costs`
--

INSERT INTO `common_costs` (`id`, `name`, `ledger_id`, `created_by`, `created_at`, `updated_at`, `vat`, `editable`, `advancable`, `return`) VALUES
(2, 'PER DIEM', 18, 17, '2023-05-15 17:17:55', '2023-05-15 17:17:55', 0, 0, 0, 0),
(3, 'LASHING FEE', 34, 17, '2023-05-15 17:18:49', '2023-05-15 17:18:49', 0, 0, 0, 0),
(4, 'COUNCIL FEE-TUNDUMA', 28, 17, '2023-05-15 17:19:08', '2023-05-15 17:19:08', 0, 0, 0, 0),
(5, 'ROAD PERMIT', 20, 17, '2023-05-15 17:19:23', '2023-05-15 17:19:23', 0, 0, 0, 0),
(6, 'CARBON TAX', 20, 17, '2023-05-15 17:20:08', '2023-05-15 17:20:08', 0, 0, 0, 0),
(7, 'Council fees Nakonde/Isoka', 28, 17, '2023-05-15 17:20:46', '2023-05-15 17:20:46', 0, 0, 0, 0),
(8, 'Council fees Kapiri', 28, 17, '2023-05-15 17:21:13', '2023-05-15 17:21:13', 0, 0, 0, 0),
(9, 'Toll gate Chilonga', 21, 17, '2023-05-15 17:21:37', '2023-05-15 17:21:37', 0, 0, 0, 0),
(10, 'Toll gate Kapiri', 21, 17, '2023-05-15 17:22:04', '2023-05-15 17:22:04', 0, 0, 0, 0),
(11, 'Toll gate Kafulafuta', 21, 17, '2023-05-15 17:22:26', '2023-05-15 17:22:26', 0, 0, 0, 0),
(12, 'Toll gate Michael Chilufya', 21, 17, '2023-05-15 17:22:56', '2023-05-15 17:22:56', 0, 0, 0, 0),
(13, 'Toll gate Wilson Mofya', 21, 17, '2023-05-15 17:23:15', '2023-05-15 17:23:15', 0, 0, 0, 0),
(14, 'Kasumbalesa council', 28, 17, '2023-05-15 17:23:36', '2023-05-29 01:14:25', 0, 0, 0, 0),
(15, 'ROAD TOLL(ZAMBIA)', 26, 17, '2023-05-15 17:23:51', '2023-05-15 17:23:51', 0, 0, 0, 0),
(16, 'DRIVER PER DIEM(USD)', 18, 17, '2023-05-15 17:24:12', '2023-05-15 17:24:12', 0, 0, 0, 0),
(17, 'PEAGE LUBUMBASHI(USD)', 26, 17, '2023-05-15 17:24:39', '2023-05-15 17:24:39', 0, 0, 0, 0),
(18, 'ENTRY CARD(USD)', 29, 17, '2023-05-15 20:23:25', '2023-05-15 20:23:25', 0, 0, 0, 0),
(19, 'DRC CROSSING FEE(USD)', 29, 17, '2023-05-15 20:23:50', '2023-05-15 20:23:50', 0, 0, 0, 0),
(20, 'PARKING FEE-ZAMBIA(USD)', 27, 17, '2023-05-15 20:25:48', '2023-05-15 20:25:48', 0, 0, 0, 0),
(21, 'DRIVER VISA(USD)', 23, 17, '2023-05-15 20:26:07', '2023-05-15 20:26:07', 0, 0, 0, 0),
(22, 'TRANSCORM(USD)', 37, 17, '2023-05-15 20:26:28', '2023-05-15 20:26:28', 0, 0, 0, 0),
(23, 'TOURISM LEVY(USD)', 37, 17, '2023-05-15 20:26:46', '2023-05-15 20:26:46', 0, 0, 0, 0),
(24, 'TRACKING DEVICE(USD)', 38, 17, '2023-05-15 20:27:17', '2023-05-15 20:27:17', 0, 0, 0, 0),
(25, 'KANYAKA PARKING', 27, 17, '2023-05-15 20:27:40', '2023-05-15 20:27:40', 0, 0, 0, 0),
(26, 'WHYSKY PARKING FEES(USD)', 27, 17, '2023-05-15 20:27:56', '2023-09-29 03:33:59', 0, 1, 0, 0),
(27, 'CHEMICAL FEE(USD)', 39, 17, '2023-05-15 20:28:13', '2023-05-15 20:28:13', 0, 0, 0, 0),
(28, 'CORONA TEST(USD)', 40, 17, '2023-05-15 20:28:26', '2023-10-08 23:13:19', 0, 1, 0, 0),
(29, 'PEAGE BULUO', 26, 17, '2023-05-15 20:28:39', '2023-05-15 20:28:39', 0, 0, 0, 0),
(30, 'PEAGE KIMBEIMBE', 26, 17, '2023-05-15 20:28:54', '2023-05-15 20:28:54', 0, 0, 0, 0),
(31, 'PEAGE LWAMBO', 26, 17, '2023-05-15 20:29:06', '2023-05-15 20:29:06', 0, 0, 0, 0),
(32, 'PEAGE LUALABA', 26, 17, '2023-05-15 20:29:22', '2023-05-15 20:29:22', 0, 0, 0, 0),
(33, 'PARKING KOLOWEZI', 27, 17, '2023-05-15 20:29:37', '2023-05-15 20:29:37', 0, 0, 0, 0),
(34, 'CNPR FEE', 35, 17, '2023-05-15 20:29:54', '2023-05-15 20:29:54', 0, 0, 0, 0),
(35, 'DOCUMENT PUSHING', 36, 17, '2023-05-15 20:30:11', '2023-05-15 20:30:11', 0, 0, 0, 0),
(36, 'PARKING IA-LUBUMBASHI', 27, 17, '2023-05-15 20:30:28', '2023-09-19 21:18:35', 0, 1, 0, 0),
(37, 'QUEUE SECURITY FEE', 36, 17, '2023-05-15 20:30:53', '2023-05-15 20:30:53', 0, 0, 0, 0),
(38, 'COMESA EXPENSES', 19, 17, '2023-05-15 20:31:10', '2023-05-15 20:31:10', 0, 0, 0, 0),
(39, 'TUNDUMA AGENCY FEE', 31, 17, '2023-05-15 20:31:37', '2023-05-15 20:31:37', 0, 0, 0, 0),
(40, 'DRC AGENCY FEE', 31, 17, '2023-05-15 20:32:14', '2023-05-15 20:32:14', 0, 0, 0, 0),
(41, 'CLEARING FEE', 41, 17, '2023-05-15 20:32:27', '2023-05-15 20:32:27', 0, 0, 0, 0),
(42, 'CONTAINER FEE', 39, 17, '2023-05-15 20:32:42', '2023-05-15 20:32:42', 0, 0, 0, 0),
(43, 'Council fees Chilabombwe', 28, 17, '2023-05-15 20:42:15', '2023-05-15 20:42:15', 0, 0, 0, 0),
(44, 'Lualaba bridge', 30, 17, '2023-05-28 14:27:03', '2023-05-28 14:27:03', 0, 0, 0, 0),
(45, 'Gate pass pushing', 36, 17, '2023-05-28 14:28:28', '2023-05-28 14:28:28', 0, 0, 0, 0),
(46, 'Fuel Pulling Truck', 16, 17, '2023-05-28 14:29:31', '2023-05-28 14:29:31', 0, 0, 0, 0),
(47, 'Fuel Semi Truck', 16, 17, '2023-05-28 14:30:12', '2023-05-28 14:30:12', 0, 0, 0, 0),
(48, 'Driver Per diem in Dar ( Semi Truck )', 18, 17, '2023-05-28 14:31:00', '2023-05-28 14:31:00', 0, 0, 0, 0),
(49, 'Driver Per diem in Dar ( Pulling Truck )', 18, 17, '2023-05-28 14:31:40', '2023-05-28 14:31:40', 0, 0, 0, 0),
(50, 'Return per diem SEMI', 18, 17, '2023-05-28 14:32:11', '2023-05-28 14:32:11', 0, 0, 0, 1),
(51, 'Kapiri-mposhi Council', 28, 17, '2023-05-29 01:15:48', '2023-05-29 01:15:48', 0, 0, 0, 0),
(52, 'Weight Bridge fee', 30, 17, '2023-05-29 01:16:12', '2023-05-29 01:16:12', 0, 0, 0, 0),
(53, 'Document Extension', 36, 17, '2023-05-29 01:23:05', '2023-05-29 01:23:05', 0, 0, 0, 0),
(58, 'Driver per diem Dar', 18, 1, '2023-09-19 15:08:01', '2023-09-19 15:08:01', 0, 0, 0, 0),
(59, 'Driver per diem Tunduma', 1, 1, '2023-09-19 15:08:16', '2023-09-19 15:08:16', 0, 0, 0, 0),
(60, 'Driver per diem Lusaka', 18, 1, '2023-09-19 15:39:00', '2023-09-19 15:39:00', 0, 0, 0, 0),
(61, 'Road permit & Carbon Tax', 20, 1, '2023-09-19 15:42:49', '2023-09-19 15:42:49', 0, 0, 0, 0),
(62, 'Tollgate Katuba', 26, 1, '2023-09-19 15:48:34', '2023-09-19 15:48:34', 0, 0, 0, 0),
(63, 'Toll gate Manyumbi', 21, 1, '2023-09-19 15:50:45', '2023-09-19 15:50:45', 0, 0, 0, 0),
(64, 'Return Per diem PULLING', 18, 1, '2023-09-19 16:06:04', '2023-09-19 16:06:04', 0, 0, 0, 1),
(65, 'Communal Peage', 26, 1, '2023-09-19 21:13:51', '2023-09-19 21:13:51', 0, 0, 0, 0),
(66, 'Mobilization Per diem', 18, 1, '2023-09-19 21:26:11', '2023-09-19 21:26:11', 0, 0, 0, 0),
(67, 'Chemafu Peage', 26, 1, '2023-09-19 21:59:09', '2023-09-19 21:59:09', 0, 0, 0, 0),
(68, 'PEAGE SAKANIA', 26, 862, '2023-09-28 23:02:48', '2023-09-28 23:02:48', 0, 0, 0, 0),
(69, 'SAKANIA PARKING', 27, 862, '2023-09-28 23:03:57', '2023-09-28 23:03:57', 0, 0, 0, 0),
(70, 'Driver per diem Sakania', 18, 862, '2023-09-29 03:34:52', '2023-09-29 03:34:52', 0, 0, 0, 0),
(71, 'Zambia Processing Fee', 36, 862, '2023-09-29 03:36:08', '2023-09-29 03:36:08', 0, 0, 0, 0),
(72, 'CARANTEEN', 40, 862, '2023-09-29 03:40:54', '2023-09-29 03:40:54', 0, 0, 0, 0),
(73, 'SAKANIA COUNCIL FEE', 28, 862, '2023-09-29 03:41:32', '2023-09-29 03:41:32', 0, 0, 0, 0),
(74, 'DRHK SAKANIA', 40, 862, '2023-09-29 03:42:43', '2023-09-29 03:42:43', 0, 0, 0, 0),
(75, 'Occ & Copies Trip Documentations', 88, 862, '2023-09-29 04:04:28', '2023-09-29 04:04:28', 0, 0, 0, 0),
(76, 'PEAGE KAKONTWE', 26, 862, '2023-10-08 23:14:50', '2023-10-08 23:14:50', 0, 0, 0, 0),
(77, 'PEAGE KAPUMPI', 26, 862, '2023-10-08 23:15:30', '2023-10-08 23:15:30', 0, 0, 0, 0),
(78, 'GCLA & ABNORMAL PERMITS', 88, 862, '2023-10-09 01:37:47', '2024-05-23 02:48:25', 0, 0, 0, 0),
(79, 'PEAGE LUFUWA', 26, 862, '2023-10-11 02:47:54', '2023-10-11 02:47:54', 0, 0, 0, 0),
(80, 'LUFUWA PARKING', 27, 862, '2023-10-11 02:48:23', '2023-10-11 02:48:23', 0, 0, 0, 0),
(81, 'LUFUWA COUNCIL', 28, 862, '2023-10-11 02:48:44', '2023-10-11 02:48:44', 0, 0, 0, 0),
(82, 'PHYSICAL VERIFICATION FEES', 36, 862, '2023-10-18 00:25:04', '2023-10-18 00:25:04', 0, 0, 0, 0),
(83, 'COBOLT FEES', 36, 862, '2023-11-21 01:56:55', '2023-11-21 02:01:11', 0, 0, 0, 0),
(84, 'PLACARDS', 34, 862, '2023-11-21 02:02:56', '2023-11-21 02:02:56', 0, 0, 0, 0),
(85, 'TOLL GATE KONKOLA PLAZA', 21, 862, '2023-12-04 01:37:10', '2023-12-04 01:37:10', 0, 0, 0, 0),
(86, 'Seal Rope Fees', 34, 862, '2023-12-04 02:00:54', '2023-12-04 02:00:54', 0, 0, 0, 0),
(87, 'TCC PEAGE', 26, 862, '2023-12-10 04:13:02', '2023-12-10 04:13:02', 0, 0, 0, 0),
(88, 'HANRUI PEAGE', 26, 862, '2023-12-10 04:13:55', '2023-12-10 04:13:55', 0, 0, 0, 0),
(89, 'MMT PEAGE', 26, 844, '2024-01-08 09:01:07', '2024-01-08 09:01:07', 0, 0, 0, 0),
(90, 'URBAN PEAGE', 26, 862, '2024-01-13 03:19:41', '2024-01-13 03:19:41', 0, 0, 0, 0),
(91, 'KPM PEAGE', 26, 862, '2024-01-15 02:35:52', '2024-01-15 02:35:52', 0, 0, 0, 0),
(92, 'PEAGE NGUYA', 26, 844, '2024-02-07 07:31:00', '2024-02-07 07:31:00', 0, 0, 0, 0),
(93, 'ESCORT FEES', 36, 862, '2024-02-08 06:14:59', '2024-02-08 06:15:29', 0, 0, 0, 0),
(94, 'KINSENDA PEAGE', 26, 862, '2024-02-08 06:16:04', '2024-02-08 06:16:04', 0, 0, 0, 0),
(95, 'MUTUKULA CITY COUNCIL FEES', 28, 862, '2024-02-17 03:55:46', '2024-02-17 03:55:46', 0, 0, 0, 0),
(96, 'MUTUKULA AGENCY FEES', 31, 862, '2024-02-17 03:56:13', '2024-02-17 03:56:13', 0, 0, 0, 0),
(97, 'ROAD TOLLS MUTUKULA TO MBARARA', 26, 862, '2024-02-17 03:56:49', '2024-02-17 03:56:49', 0, 0, 0, 0),
(98, 'LOADING PER DIEM', 18, 862, '2024-02-17 04:03:00', '2024-02-17 04:03:00', 0, 0, 0, 0),
(99, 'TOLL GATE KAVINDERE', 21, 844, '2024-02-23 01:10:15', '2024-02-23 01:10:15', 0, 0, 0, 0),
(100, 'ROAD TOLLS JINJA', 26, 862, '2024-03-22 02:01:05', '2024-03-22 02:01:05', 0, 0, 0, 0),
(101, 'MOVEMENT SHEET', 130, 862, '2024-03-22 06:55:20', '2024-03-22 06:55:20', 0, 0, 0, 0),
(102, 'TRANSACTION CHARGES', 67, 862, '2024-03-22 06:58:55', '2024-03-22 06:58:55', 0, 0, 0, 0),
(103, 'MUMBWA TOLLGATE', 26, 862, '2024-03-25 05:25:53', '2024-03-25 05:25:53', 0, 0, 0, 0),
(104, 'MWEEKE TOLLGATE', 26, 862, '2024-03-25 05:26:34', '2024-03-25 05:26:34', 0, 0, 0, 0),
(105, 'ROADTOLL KIGALI-RWANDA', 26, 862, '2024-05-02 03:22:13', '2024-05-02 03:22:13', 0, 0, 0, 0),
(106, 'PEAGE MUKAMBO', 26, 862, '2024-06-04 06:31:28', '2024-06-04 06:31:28', 0, 0, 0, 0),
(107, 'BUNGUBUNGU PEAGE', 26, 862, '2024-07-31 02:11:39', '2024-07-31 02:11:39', 0, 0, 0, 0),
(108, 'RADIATION FEE', 1, 862, '2024-08-24 01:20:48', '2024-08-24 01:20:48', 0, 0, 0, 0);

-- --------------------------------------------------------

--
-- Table structure for table `companies`
--

CREATE TABLE `companies` (
  `id` bigint UNSIGNED NOT NULL,
  `user_id` bigint UNSIGNED DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `address` text COLLATE utf8mb4_unicode_ci,
  `tax_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `currency_id` bigint UNSIGNED NOT NULL,
  `financial_year_start` date NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `companies`
--

INSERT INTO `companies` (`id`, `user_id`, `name`, `address`, `tax_number`, `currency_id`, `financial_year_start`, `created_at`, `updated_at`) VALUES
(1, NULL, 'SudEnery Logistics', '123 Main St, City', 'TAX123456', 1, '2025-01-01', '2026-04-21 16:42:13', '2026-04-21 16:42:13');

-- --------------------------------------------------------

--
-- Table structure for table `cost_categories`
--

CREATE TABLE `cost_categories` (
  `id` bigint UNSIGNED NOT NULL,
  `company_id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `cost_categories`
--

INSERT INTO `cost_categories` (`id`, `company_id`, `name`, `created_at`, `updated_at`) VALUES
(1, 1, 'Sales', '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(2, 1, 'Administration', '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(3, 1, 'Production', '2026-04-21 16:42:19', '2026-04-21 16:42:19');

-- --------------------------------------------------------

--
-- Table structure for table `cost_centers`
--

CREATE TABLE `cost_centers` (
  `id` bigint UNSIGNED NOT NULL,
  `company_id` bigint UNSIGNED NOT NULL,
  `cost_category_id` bigint UNSIGNED DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `cost_centers`
--

INSERT INTO `cost_centers` (`id`, `company_id`, `cost_category_id`, `name`, `created_at`, `updated_at`) VALUES
(1, 1, NULL, 'Marketing', '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(2, 1, NULL, 'IT Department', '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(3, 1, NULL, 'Project X', '2026-04-21 16:42:19', '2026-04-21 16:42:19');

-- --------------------------------------------------------

--
-- Table structure for table `credit_notes`
--

CREATE TABLE `credit_notes` (
  `id` bigint UNSIGNED NOT NULL,
  `ref_no` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `invoice_id` int NOT NULL,
  `amount` double NOT NULL,
  `charges` double NOT NULL DEFAULT '0',
  `currency_id` bigint UNSIGNED DEFAULT NULL,
  `real_amount` double NOT NULL DEFAULT '0',
  `real_charges` double NOT NULL DEFAULT '0',
  `rate` int NOT NULL DEFAULT '0',
  `start_date` date DEFAULT NULL,
  `due_date` date DEFAULT NULL,
  `credit_term` int NOT NULL DEFAULT '30',
  `vat` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'No',
  `status` int NOT NULL DEFAULT '0',
  `approval_status` int NOT NULL DEFAULT '0',
  `state` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `created_by` bigint UNSIGNED NOT NULL,
  `type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `account` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `note` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `currency_log_id` int NOT NULL DEFAULT '1',
  `payment_status` int NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `credit_note_remarks`
--

CREATE TABLE `credit_note_remarks` (
  `id` bigint UNSIGNED NOT NULL,
  `note_id` bigint UNSIGNED NOT NULL,
  `remark` text COLLATE utf8mb4_unicode_ci,
  `status` int NOT NULL DEFAULT '1',
  `remarked_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_by` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `credit_note_trucks`
--

CREATE TABLE `credit_note_trucks` (
  `id` bigint UNSIGNED NOT NULL,
  `note_id` bigint UNSIGNED NOT NULL,
  `truck_id` bigint UNSIGNED NOT NULL,
  `invoice_id` bigint UNSIGNED NOT NULL,
  `amount` double NOT NULL,
  `currency_id` int UNSIGNED NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rate` int NOT NULL,
  `real_amount` double NOT NULL,
  `charges` double NOT NULL DEFAULT '0',
  `status` int NOT NULL DEFAULT '0',
  `state` int NOT NULL DEFAULT '0',
  `created_by` int UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `currency_log_id` int NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `currencies`
--

CREATE TABLE `currencies` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `symbol` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `currency` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rate` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '1',
  `created_by` bigint UNSIGNED NOT NULL,
  `code` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `value` double DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `currencies`
--

INSERT INTO `currencies` (`id`, `name`, `symbol`, `currency`, `rate`, `status`, `created_by`, `code`, `value`, `created_at`, `updated_at`) VALUES
(1, 'Tanzania Shilling', 'Tsh', 'TZS', '1', 1, 1, 'TZS', 1, '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(2, 'Zambia Kwacha', 'ZMW', 'ZMK', '99', 1, 1, 'ZMK', 102.4197, '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(3, 'US Dollar', '$', 'USD', '2600', 1, 1, 'USD', 2703.88, '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(4, 'Tanzania Shilling', 'Tsh', 'TZS', '1', 1, 1, 'TZS', 1, '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(5, 'Zambia Kwacha', 'ZMW', 'ZMK', '99', 1, 1, 'ZMK', 102.4197, '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(6, 'US Dollar', '$', 'USD', '2600', 1, 1, 'USD', 2703.88, '2026-04-21 16:42:19', '2026-04-21 16:42:19');

-- --------------------------------------------------------

--
-- Table structure for table `currency_logs`
--

CREATE TABLE `currency_logs` (
  `id` bigint UNSIGNED NOT NULL,
  `created_date` date NOT NULL,
  `created_by` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `currency_log_items`
--

CREATE TABLE `currency_log_items` (
  `id` bigint UNSIGNED NOT NULL,
  `currency_log_id` bigint UNSIGNED NOT NULL,
  `currency_id` bigint UNSIGNED NOT NULL,
  `rate` double NOT NULL,
  `created_by` bigint UNSIGNED NOT NULL,
  `corridor_rate` double NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `customers`
--

CREATE TABLE `customers` (
  `id` bigint UNSIGNED NOT NULL,
  `contact_person` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `TIN` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `VRN` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `address` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `company` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `abbreviation` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_by` bigint UNSIGNED NOT NULL,
  `status` int NOT NULL DEFAULT '1',
  `credit_term` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `debit_notes`
--

CREATE TABLE `debit_notes` (
  `id` bigint UNSIGNED NOT NULL,
  `ref_no` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `invoice_id` bigint UNSIGNED NOT NULL,
  `amount` double NOT NULL,
  `charges` double NOT NULL DEFAULT '0',
  `currency_id` bigint UNSIGNED DEFAULT NULL,
  `real_amount` double NOT NULL DEFAULT '0',
  `real_charges` double NOT NULL DEFAULT '0',
  `rate` int NOT NULL DEFAULT '0',
  `start_date` date DEFAULT NULL,
  `due_date` date DEFAULT NULL,
  `credit_term` int NOT NULL DEFAULT '30',
  `vat` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'No',
  `status` int NOT NULL DEFAULT '0',
  `approval_status` int NOT NULL DEFAULT '0',
  `state` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `created_by` bigint UNSIGNED NOT NULL,
  `type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `account` bigint UNSIGNED NOT NULL DEFAULT '9',
  `note` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `currency_log_id` int NOT NULL DEFAULT '1',
  `payment_status` int NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `debit_note_remarks`
--

CREATE TABLE `debit_note_remarks` (
  `id` bigint UNSIGNED NOT NULL,
  `note_id` bigint UNSIGNED NOT NULL,
  `remark` text COLLATE utf8mb4_unicode_ci,
  `status` int NOT NULL DEFAULT '1',
  `remarked_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_by` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `debit_note_trucks`
--

CREATE TABLE `debit_note_trucks` (
  `id` bigint UNSIGNED NOT NULL,
  `note_id` bigint UNSIGNED NOT NULL,
  `truck_id` bigint UNSIGNED NOT NULL,
  `invoice_id` bigint UNSIGNED NOT NULL,
  `amount` double NOT NULL,
  `currency_id` bigint UNSIGNED NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rate` int NOT NULL,
  `real_amount` double NOT NULL,
  `charges` double NOT NULL DEFAULT '0',
  `status` int NOT NULL DEFAULT '0',
  `state` int NOT NULL DEFAULT '0',
  `created_by` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `currency_log_id` int NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `departments`
--

CREATE TABLE `departments` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('active','inactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `hod` bigint UNSIGNED DEFAULT NULL,
  `created_by` bigint UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `departments`
--

INSERT INTO `departments` (`id`, `name`, `status`, `hod`, `created_by`, `created_at`, `updated_at`) VALUES
(1, 'Logistics', 'active', NULL, NULL, '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(2, 'Customer Service', 'active', NULL, NULL, '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(3, 'IT Support', 'active', NULL, NULL, '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(4, 'Dispatch', 'active', NULL, NULL, '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(5, 'Drivers', 'active', NULL, NULL, '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(6, 'Administration', 'active', NULL, NULL, '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(7, 'Operations', 'active', NULL, NULL, '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(8, 'Management', 'active', NULL, NULL, '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(9, 'Accounts', 'active', NULL, NULL, '2026-04-21 16:42:13', '2026-04-21 16:42:13');

-- --------------------------------------------------------

--
-- Table structure for table `driver_assignments`
--

CREATE TABLE `driver_assignments` (
  `id` bigint UNSIGNED NOT NULL,
  `driver_id` bigint UNSIGNED NOT NULL,
  `truck_id` bigint UNSIGNED NOT NULL,
  `assigned_by` bigint UNSIGNED NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `driver_attachments`
--

CREATE TABLE `driver_attachments` (
  `id` bigint UNSIGNED NOT NULL,
  `driver_id` bigint UNSIGNED NOT NULL,
  `file_path` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `original_filename` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `document_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `file_size` bigint UNSIGNED DEFAULT NULL,
  `mime_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `issued_date` date DEFAULT NULL,
  `expiry_date` date DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `failed_jobs`
--

CREATE TABLE `failed_jobs` (
  `id` bigint UNSIGNED NOT NULL,
  `uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `fuel_costs`
--

CREATE TABLE `fuel_costs` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `ledger_id` bigint NOT NULL,
  `created_by` bigint NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `vat` tinyint(1) NOT NULL DEFAULT '0',
  `editable` tinyint(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `fuel_costs`
--

INSERT INTO `fuel_costs` (`id`, `name`, `ledger_id`, `created_by`, `created_at`, `updated_at`, `vat`, `editable`) VALUES
(2, 'Fuel Expenses (Olympic Tunduma)', 64, 17, '2023-06-05 10:25:52', '2023-06-17 23:57:37', 0, 1),
(3, 'Fuel Expenses (Olympic Mikese)', 64, 17, '2023-06-05 10:30:22', '2023-09-28 21:54:45', 0, 1),
(4, 'Fuel Expenses (Mount Meru Mbezi)', 63, 17, '2023-06-05 10:30:47', '2023-06-17 23:57:02', 0, 1),
(5, 'Fuel Expenses( Mount Meru Misugusugu)', 63, 844, '2023-12-29 08:29:42', '2023-12-29 08:29:42', 0, 1),
(6, 'Fuel expenses(Acer Petrol ltd Tunduma)', 304, 1017, '2024-10-03 03:10:00', '2024-10-03 03:18:13', 0, 1);

-- --------------------------------------------------------

--
-- Table structure for table `fund_types`
--

CREATE TABLE `fund_types` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `currency_id` bigint UNSIGNED NOT NULL,
  `status` int NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `mapper_id` bigint UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `godowns`
--

CREATE TABLE `godowns` (
  `id` bigint UNSIGNED NOT NULL,
  `company_id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `address` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `godown_stocks`
--

CREATE TABLE `godown_stocks` (
  `id` bigint UNSIGNED NOT NULL,
  `company_id` bigint UNSIGNED NOT NULL,
  `stock_item_id` bigint UNSIGNED NOT NULL,
  `godown_id` bigint UNSIGNED NOT NULL,
  `quantity` decimal(15,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `group_accounts`
--

CREATE TABLE `group_accounts` (
  `id` bigint UNSIGNED NOT NULL,
  `client_end_code` int DEFAULT NULL,
  `client_start_code` int DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type_id` bigint UNSIGNED DEFAULT NULL,
  `start_code` int DEFAULT NULL,
  `end_code` int DEFAULT NULL,
  `status` int NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `group_accounts`
--

INSERT INTO `group_accounts` (`id`, `client_end_code`, `client_start_code`, `name`, `type_id`, `start_code`, `end_code`, `status`, `created_at`, `updated_at`) VALUES
(2, 1000, 1, 'FIXED ASSET', 1, 1, 999, 1, '2023-05-08 11:27:47', '2023-12-05 00:15:13'),
(3, 1999, 1001, 'CURRENT ASSET', 1, 1000, 1799, 1, '2023-05-08 11:29:42', '2023-12-05 00:20:24'),
(5, 2499, 2001, 'CURRENT LIABILITIES', 4, 2100, 2499, 1, '2023-05-08 11:33:00', '2023-12-05 01:01:42'),
(6, 2999, 2500, 'LONG TERM LIABILITIES', 4, 2500, 2999, 1, '2023-05-08 11:34:36', '2023-12-05 01:20:09'),
(7, 3999, 3001, 'CAPITAL AND RESERVE', 3, 3000, 3999, 1, '2023-05-08 11:36:34', '2023-12-05 01:25:47'),
(8, 4499, 4000, 'SALES', 5, 4000, 4999, 1, '2023-05-08 11:37:45', '2024-04-24 07:35:27'),
(15, 6999, 5000, 'DIRECT EXPENSES', 2, 7000, 7199, 1, '2023-05-08 12:31:07', '2024-04-25 02:16:29'),
(16, 8999, 7000, 'INDIRECT EXPENSE', 2, 7200, 7999, 1, '2023-05-08 12:31:53', '2024-04-25 02:17:03'),
(18, 4999, 4500, 'OTHER INCOMES', 5, 4999, NULL, 1, '2023-12-05 01:52:36', '2023-12-05 01:52:36');

-- --------------------------------------------------------

--
-- Table structure for table `invoiced_trucks`
--

CREATE TABLE `invoiced_trucks` (
  `id` bigint UNSIGNED NOT NULL,
  `invoice_id` bigint NOT NULL,
  `truck_id` bigint NOT NULL,
  `allocation_id` bigint NOT NULL,
  `amount` double NOT NULL,
  `currency_id` bigint NOT NULL,
  `rate` int NOT NULL,
  `real_amount` double NOT NULL,
  `status` int NOT NULL DEFAULT '0',
  `state` int NOT NULL DEFAULT '0',
  `created_by` bigint NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `quantity` double NOT NULL DEFAULT '0',
  `ref_no` varchar(250) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `invoice_rate` decimal(12,2) NOT NULL DEFAULT '0.00',
  `currency_log_id` int NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `invoiced_truck_incomes`
--

CREATE TABLE `invoiced_truck_incomes` (
  `id` bigint UNSIGNED NOT NULL,
  `invoice_id` bigint UNSIGNED NOT NULL,
  `truck_id` bigint UNSIGNED NOT NULL,
  `allocation_id` bigint UNSIGNED NOT NULL,
  `income_id` bigint UNSIGNED NOT NULL,
  `amount` double NOT NULL,
  `currency_id` bigint UNSIGNED NOT NULL,
  `rate` int NOT NULL,
  `real_amount` double NOT NULL,
  `status` int NOT NULL DEFAULT '0',
  `state` int NOT NULL DEFAULT '0',
  `created_by` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `jobcards`
--

CREATE TABLE `jobcards` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` int NOT NULL,
  `final_inspection_id` bigint UNSIGNED DEFAULT NULL,
  `created_by_id` bigint UNSIGNED DEFAULT NULL,
  `status` int NOT NULL DEFAULT '0',
  `approve_status` int NOT NULL DEFAULT '0',
  `is_revoked` tinyint NOT NULL DEFAULT '0',
  `approve_comment` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `truck_id` int DEFAULT NULL,
  `trip_id` int DEFAULT NULL,
  `approved_by_id` int DEFAULT NULL,
  `duration` double DEFAULT NULL,
  `worked_duration` double DEFAULT NULL,
  `completion_date` datetime DEFAULT NULL,
  `approved_date` datetime DEFAULT NULL,
  `completion_by_id` bigint UNSIGNED DEFAULT NULL,
  `real_amount` decimal(15,2) DEFAULT NULL,
  `dispatched_date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `ledgers`
--

CREATE TABLE `ledgers` (
  `id` bigint UNSIGNED NOT NULL,
  `company_id` bigint NOT NULL,
  `group_id` bigint NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `opening_balance` decimal(15,2) NOT NULL DEFAULT '0.00',
  `contact_details` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `client_code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `self_ledger_id` int DEFAULT NULL,
  `tag` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `supplier_id` int DEFAULT NULL,
  `customer_id` int DEFAULT NULL,
  `sub_account_id` int DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `status` int DEFAULT NULL,
  `user_id` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `ledgers`
--

INSERT INTO `ledgers` (`id`, `company_id`, `group_id`, `name`, `opening_balance`, `contact_details`, `created_at`, `updated_at`, `client_code`, `code`, `self_ledger_id`, `tag`, `supplier_id`, `customer_id`, `sub_account_id`, `description`, `status`, `user_id`) VALUES
(1, 1, 13, 'TRIP REVENUE', 10000.00, NULL, '2023-05-15 15:22:10', '2023-12-13 01:50:03', '4000', '4000', NULL, NULL, NULL, NULL, 13, 'This is a ledger account that stores all trip payments', NULL, NULL),
(2, 1, 12, 'Sales Account', 0.00, NULL, '2026-04-21 16:42:19', '2026-04-21 16:42:19', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(3, 1, 6, 'STOCK', 0.00, NULL, '2023-05-15 15:23:44', '2023-12-13 03:53:19', '1600', '1200', NULL, NULL, NULL, NULL, 6, 'This is the stock account ledger', NULL, NULL),
(4, 1, 3, 'John Doe', 5000.00, '123 Customer St', '2026-04-21 16:42:19', '2026-04-21 16:42:19', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(5, 1, 7, 'CREDITORS', 3000.00, '456 Supplier Rd', '2023-05-15 15:25:23', '2023-12-13 00:40:58', '2000', '2100', NULL, NULL, NULL, NULL, 7, 'This is Creditors Account Ledger', NULL, NULL),
(6, 1, 25, 'PURCHASES', 0.00, NULL, '2023-05-15 15:26:59', '2023-12-13 03:00:43', '6000', '5000', NULL, NULL, NULL, NULL, 25, 'This is the purchases account ledger', NULL, NULL),
(7, 1, 24, 'RETAINED EARNING', 0.00, NULL, '2023-05-15 15:29:34', '2023-12-13 05:56:38', '3400', '3400', NULL, NULL, NULL, NULL, 24, 'This is the retained earning account ledger', NULL, NULL),
(8, 1, 3, 'BOA-TZS ACCOUNT', 0.00, NULL, '2023-05-15 15:32:00', '2023-12-13 00:51:27', '1001', '1002', NULL, NULL, NULL, NULL, 3, 'This is the BOA account ledger', NULL, NULL),
(9, 1, 3, 'BOA-USD ACCOUNT', 0.00, NULL, '2023-05-15 15:33:07', '2023-12-13 00:51:53', '1002', '1002', NULL, NULL, NULL, NULL, 3, 'This is a ledger for BOA-USD ACCOUNT', NULL, NULL),
(10, 1, 3, 'NMB-TZS ACCOUNT', 0.00, NULL, '2023-05-15 15:34:16', '2023-12-13 00:56:52', '1003', '1004', NULL, NULL, NULL, NULL, 3, 'This is a ledger for NMB-TZS ACCOUNT', NULL, NULL),
(11, 1, 3, 'NMB-USD ACCOUNT', 0.00, NULL, '2023-05-15 15:35:24', '2023-12-13 00:58:43', '1004', '1005', NULL, NULL, NULL, NULL, 3, 'This is a ledger for NMB-USD ACCOUNT', NULL, NULL),
(12, 1, 19, 'PETTY CASH', 0.00, NULL, '2023-05-15 15:40:04', '2023-12-13 00:59:47', '1401', '1102', NULL, NULL, NULL, NULL, 19, 'This is a ledger for PETTY CASH', NULL, NULL),
(14, 1, 1, 'TRUCKS', 0.00, NULL, '2023-05-15 15:43:07', '2023-12-13 03:11:37', '1', '2', NULL, NULL, NULL, NULL, 1, 'This is a ledger for TRUCKS LEDGER', NULL, NULL),
(15, 1, 14, 'Other Income', 0.00, NULL, '2023-05-15 15:45:02', '2023-12-13 04:28:33', '4500', '4500', NULL, NULL, NULL, NULL, 14, 'This is a ledger for OTHER INCOME', NULL, NULL),
(16, 1, 16, 'FUEL EXPENSES', 0.00, NULL, '2023-05-15 15:46:36', '2023-12-13 05:19:21', '5023', '7000', NULL, NULL, NULL, NULL, 16, 'This is a ledger for Fuel', NULL, NULL),
(17, 1, 25, 'SPARE PARTS EXPENSES', 0.00, NULL, '2023-05-15 15:47:35', '2023-12-13 01:32:16', '6001', '6002', NULL, NULL, NULL, NULL, 25, 'This is a ledger for SPARE PARTS EXPENSES', NULL, NULL),
(18, 1, 16, 'DRIVER MILEAGE', 0.00, NULL, '2023-05-15 15:48:40', '2023-12-13 01:31:23', '5001', '7002', NULL, NULL, NULL, NULL, 16, 'This is a ledger for DRIVER MILEAGE', NULL, NULL),
(19, 1, 16, 'COMESA EXPENSES', 0.00, NULL, '2023-05-15 15:49:54', '2023-12-13 01:19:39', '5002', '7003', NULL, NULL, NULL, NULL, 16, 'This is a ledger for COMESA EXPENSES', NULL, NULL),
(20, 1, 16, 'ROAD PERMIT & CARBON TAX', 0.00, NULL, '2023-05-15 15:51:12', '2023-12-13 01:13:55', '5003', '7004', NULL, NULL, NULL, NULL, 16, 'This is a ledger for ROAD PERMIT & CARBON TAX', NULL, NULL),
(21, 1, 16, 'ZAMBIA GATE EXPENSES', 0.00, NULL, '2023-05-15 15:52:02', '2023-12-13 01:12:12', '5004', '7005', NULL, NULL, NULL, NULL, 16, 'This is a ledger for ZAMBIA GATE EXPENSES', NULL, NULL),
(22, 1, 16, 'C28 & C40 EXPENSES', 0.00, NULL, '2023-05-15 15:53:50', '2023-12-13 01:09:44', '5005', '7006', NULL, NULL, NULL, NULL, 16, 'This is a ledger for C28 & C40 EXPENSES', NULL, NULL),
(23, 1, 16, 'DRIVER VISA', 0.00, NULL, '2023-05-15 15:55:21', '2023-12-13 02:07:19', '5006', '7007', NULL, NULL, NULL, NULL, 16, 'This is a ledger for DRIVER VISA', NULL, NULL),
(24, 1, 16, 'INSURANCE COVER', 0.00, NULL, '2023-05-15 15:56:24', '2023-12-13 02:06:54', '5007', '7008', NULL, NULL, NULL, NULL, 16, 'This is a ledger for INSURANCE COVER', NULL, NULL),
(25, 1, 16, 'Sumatra Charges', 0.00, NULL, '2023-05-15 15:58:13', '2023-12-13 02:03:08', '5008', '7009', NULL, NULL, NULL, NULL, 16, 'This is a ledger for Sumatra Charges', NULL, NULL),
(26, 1, 16, 'Road tolls,(Peage) Fee', 0.00, NULL, '2023-05-15 16:00:28', '2023-12-13 02:02:39', '5009', '7010', NULL, NULL, NULL, NULL, 16, 'This is a ledger for Road tolls,(Peage) Fee', NULL, NULL),
(27, 1, 16, 'Parking Fees', 0.00, NULL, '2023-05-15 16:00:58', '2023-12-13 02:02:18', '5010', '7011', NULL, NULL, NULL, NULL, 16, 'This is a ledger for Parking Fees', NULL, NULL),
(28, 1, 16, 'City Council Fee', 0.00, NULL, '2023-05-15 16:01:30', '2023-12-13 02:01:59', '5011', '7015', NULL, NULL, NULL, NULL, 16, 'This is a ledger for City Council Fee', NULL, NULL),
(29, 1, 16, 'Entry Card & Crossing fee', 0.00, NULL, '2023-05-15 16:02:06', '2023-12-13 02:00:18', '5012', '7012', NULL, NULL, NULL, NULL, 16, 'This is a ledger for Entry Card & Crossing fee', NULL, NULL),
(30, 1, 16, 'Weight  Bridge fee', 0.00, NULL, '2023-05-15 16:02:38', '2023-12-13 01:59:51', '5013', '7014', NULL, NULL, NULL, NULL, 16, 'This is a ledger for Weight  Bridge fee', NULL, NULL),
(31, 1, 16, 'Agency fee', 0.00, NULL, '2023-05-15 16:03:13', '2023-12-13 01:56:08', '5014', '7014', NULL, NULL, NULL, NULL, 16, 'This is a ledger for Agency fee', NULL, NULL),
(32, 1, 25, 'Tyres & Tubes Expenses', 0.00, NULL, '2023-05-15 16:04:33', '2023-12-13 02:58:03', '6002', '6002', NULL, NULL, NULL, NULL, 25, 'This is a ledger for Tyres & Tubes Expenses', NULL, NULL),
(33, 1, 25, 'Repair & Maintenance Cost', 0.00, NULL, '2023-05-15 16:05:26', '2023-12-13 03:01:12', '6003', '6001', NULL, NULL, NULL, NULL, 25, 'This is a ledger for Repair & Maintenance Cost', NULL, NULL),
(34, 1, 16, 'Lashing Gears Fee', 0.00, NULL, '2023-05-15 16:06:01', '2023-12-13 01:55:40', '5015', '7017', NULL, NULL, NULL, NULL, 16, 'This is a ledger for Lashing Gears Fee', NULL, NULL),
(35, 1, 16, 'CNPR Fee', 0.00, NULL, '2023-05-15 16:06:42', '2023-12-13 02:27:05', '5016', '7018', NULL, NULL, NULL, NULL, 16, 'This is a ledger for CNPR Fee', NULL, NULL),
(36, 1, 16, 'Boarder Facilitation Fee', 0.00, NULL, '2023-05-15 16:07:50', '2023-12-13 02:26:04', '5017', '7020', NULL, NULL, NULL, NULL, 16, 'This is a ledger for Boader Facilitation Fee', NULL, NULL),
(37, 1, 16, 'Tourism & Transcorm Fee', 0.00, NULL, '2023-05-15 16:08:16', '2023-12-13 02:25:34', '5018', '7021', NULL, NULL, NULL, NULL, 16, 'This is a ledger for Tourism & Transcorm Fee', NULL, NULL),
(38, 1, 16, 'Tracking Fee', 0.00, NULL, '2023-05-15 16:08:47', '2023-12-13 02:10:10', '5019', '7022', NULL, NULL, NULL, NULL, 16, 'This is a ledger for Tracking Fee', NULL, NULL),
(39, 1, 16, 'Chemical/ Conteiner Fee', 0.00, NULL, '2023-05-15 16:10:02', '2023-12-13 02:09:40', '5020', '7023', NULL, NULL, NULL, NULL, 16, 'This is a ledger for Chemical/ Conteiner Fee', NULL, NULL),
(40, 1, 16, 'Korona Test Fee', 0.00, NULL, '2023-05-15 16:10:45', '2023-12-13 02:09:07', '5021', '7024', NULL, NULL, NULL, NULL, 16, 'This is a ledger for Korona Test Fee', NULL, NULL),
(41, 1, 16, 'Clearing Charges', 0.00, NULL, '2023-05-15 16:11:12', '2023-12-13 02:08:37', '5022', '7025', NULL, NULL, NULL, NULL, 16, 'This is a ledger for Clearing Charges', NULL, NULL),
(42, 1, 16, 'EXPENSES ACCOUNT', 0.00, NULL, '2023-05-15 17:32:32', '2023-12-13 06:53:05', '7027', '7027', NULL, NULL, NULL, NULL, 16, 'This is a ledger for OUT OF BUDGETS EXPENSES', NULL, NULL),
(44, 1, 16, 'Toll gate Chilonga', 0.00, NULL, '2023-05-23 03:17:36', '2023-12-13 17:07:48', '5026', '7005', 21, 'sub', NULL, NULL, 16, 'This zambia chilonga gate', NULL, NULL),
(46, 1, 5, 'DEBTORS', 0.00, NULL, '2023-05-25 23:33:26', '2023-12-13 00:50:22', '1100', '1200', NULL, NULL, NULL, NULL, 5, 'This is a debtors ledger', NULL, NULL),
(57, 1, 1, 'TRAILERS', 0.00, NULL, '2023-05-25 23:47:49', '2023-12-13 03:12:05', '2', '1', NULL, NULL, NULL, NULL, 1, 'This is a ledger for TRAILERS', NULL, NULL),
(59, 1, 19, 'INTER AFRICA ACCOUNT', 0.00, NULL, '2023-05-30 21:18:52', '2023-12-13 01:51:06', '1402', '1102', NULL, NULL, NULL, NULL, 19, 'This is a ledger for INTER AFRICA ACCOUNT', NULL, NULL),
(63, 1, 7, 'MOUNT MERU', 0.00, NULL, '2023-06-05 10:14:39', '2023-12-14 00:36:29', '2050', '2100', 5, 'sub', 7, NULL, 7, 'This is a ledger for MOUNT MERU', NULL, NULL),
(64, 1, 7, 'OLYMPIC', 0.00, NULL, '2023-06-05 10:16:05', '2023-12-14 00:35:38', '2049', '2100', 5, 'sub', 8, NULL, 7, 'This is a ledger for OLYMPIC', NULL, NULL),
(66, 1, 23, 'SHARE EQUITY', 0.00, NULL, '2023-06-22 23:56:38', '2023-12-13 03:40:36', '3400', '3002', NULL, NULL, NULL, NULL, 23, 'This is an equity account', NULL, NULL),
(67, 1, 17, 'OTHER ADMINISTRATION EXPENSES', 0.00, NULL, '2023-08-31 18:41:24', '2024-04-24 07:39:20', '8002', '7201', NULL, NULL, NULL, NULL, 17, 'This is the  Administrative Expense Account', NULL, NULL),
(72, 1, 17, 'MOTOR VEHICLES RUNNING AND MAINTANANCE', 0.00, NULL, '2023-08-31 19:04:06', '2023-12-13 19:54:24', '7024', '7201', 67, 'sub', NULL, NULL, 17, 'This is a ledger for MOTOR VEHICLES RUNNING AND MAINTANANCE', NULL, NULL),
(73, 1, 17, 'TRANSPORT AND CONVEYENCE', 0.00, NULL, '2023-08-31 19:05:14', '2023-12-13 19:49:13', '7023', '7201', 67, 'sub', NULL, NULL, 17, 'This is a ledger for TRANSPORT AND CONVEYENCE', NULL, NULL),
(74, 1, 17, 'PRINITING AND STATIONERY', 0.00, NULL, '2023-08-31 19:06:29', '2023-12-13 19:44:30', '7022', '7201', 67, 'sub', NULL, NULL, 17, 'This is a ledger for PRINITING AND STATIONERY', NULL, NULL),
(75, 1, 17, 'AUDIT FEES', 0.00, NULL, '2023-08-31 19:09:18', '2023-12-13 19:24:01', '7021', '7201', 67, 'sub', NULL, NULL, 17, 'This is a ledger for AUDIT FEES', NULL, NULL),
(76, 1, 17, 'BRELA FEES', 0.00, NULL, '2023-08-31 19:10:13', '2023-12-13 19:20:38', '7020', '7201', 67, 'sub', NULL, NULL, 17, 'This is a ledger for BRELA FEES', NULL, NULL),
(77, 1, 17, 'POSTAGE', 0.00, NULL, '2023-08-31 19:10:55', '2023-12-13 19:14:13', '7019', '7201', 67, 'sub', NULL, NULL, 17, 'This is a ledger for POSTAGE', NULL, NULL),
(78, 1, 17, 'OFFICE SUPPLIES', 0.00, NULL, '2023-08-31 19:12:33', '2023-12-13 19:09:18', '7018', '7201', NULL, NULL, NULL, NULL, 17, 'This is a ledger for OFFICE SUPPLIES', NULL, NULL),
(79, 1, 17, 'Newspapers and Periodicals', 0.00, NULL, '2023-08-31 19:16:10', '2023-12-13 19:00:12', '7017', '7201', 67, 'sub', NULL, NULL, 17, 'This is a ledger for REPAIRS AND REPAIRS AND MAINTANANCE', NULL, NULL),
(80, 1, 17, 'Repairs and REPAIRS AND MAINTANANCE', 0.00, NULL, '2023-08-31 19:20:07', '2023-12-13 18:38:02', '7016', '7201', 67, 'sub', NULL, NULL, 17, 'This is a ledger for REPAIRS AND MAINTANANCE', NULL, NULL),
(81, 1, 17, 'MEETING EXPENSES', 0.00, NULL, '2023-08-31 19:26:17', '2024-04-25 04:27:20', '7018', '7019', NULL, NULL, NULL, NULL, 17, 'This is a ledger for MEETING EXPENSES', NULL, NULL),
(82, 1, 17, 'COOPERATE SOCIAL RESPONSIBLITY', 0.00, NULL, '2023-08-31 19:27:48', '2023-12-13 18:26:04', '7014', '7201', 67, 'sub', NULL, NULL, 17, 'This is a ledger for COOPERATE SOCIAL RESPONSIBLITY', NULL, NULL),
(85, 1, 17, 'INTERNET AND TELEPHONE', 0.00, NULL, '2023-08-31 19:35:49', '2023-12-13 18:11:12', '7013', '7201', 67, 'sub', NULL, NULL, 17, 'This is a ledger for INTERNET AND TELEPHONE', NULL, NULL),
(88, 1, 16, 'OTHER OPERATING EXPENSES', 0.00, NULL, '2023-08-31 19:44:20', '2023-12-13 04:30:06', '5024', '7030', NULL, NULL, NULL, NULL, 16, 'This is Other Operating Expenses Ledger', NULL, NULL),
(90, 1, 28, 'SERVICE CHARGES', 0.00, NULL, '2023-08-31 19:47:31', '2024-04-25 04:11:57', '7312', '8006', NULL, NULL, NULL, NULL, 28, 'This is a ledger for SERVICE CHARGES', NULL, NULL),
(91, 1, 28, 'ELECTRICITY AND WATER', 0.00, NULL, '2023-08-31 19:49:34', '2024-04-25 04:09:26', '7311', '8006', NULL, NULL, NULL, NULL, 28, 'This is a ledger for Electricity and Water', NULL, NULL),
(92, 1, 28, 'TRUCK LICENCES', 0.00, NULL, '2023-08-31 19:52:38', '2024-04-25 04:09:48', '7310', '8006', NULL, NULL, NULL, NULL, 28, 'This is a ledger for Licences', NULL, NULL),
(94, 1, 28, 'CLEANING AND SANITATION', 0.00, NULL, '2023-08-31 20:05:46', '2024-04-25 03:57:53', '7309', '8006', NULL, NULL, NULL, NULL, 28, 'This is  the ledger for Cleaning and Sanitation', NULL, NULL),
(95, 1, 16, 'Depreceation', 0.00, NULL, '2023-08-31 20:22:58', '2023-12-13 17:41:38', '5028', '7030', 88, 'sub', NULL, NULL, 16, 'This is a ledger for Depreceation', NULL, NULL),
(110, 1, 17, 'STAFF MEALS', 0.00, NULL, '2023-09-25 03:44:39', '2024-04-25 02:08:24', '7009', '7201', NULL, NULL, NULL, NULL, 17, 'This is a ledger for STAFF MEALS', NULL, NULL),
(129, 1, 5, 'BRIDGE SHIPPING - C. STEINWEG', 0.00, NULL, '2023-09-27 01:25:59', '2023-12-13 22:51:06', '1123', '1200', 46, 'sub', NULL, 1, 5, 'This is a ledger for BRIDGE SHIPPING - C. STEINWEG', NULL, NULL),
(130, 1, 16, 'Coppies & OCC fees Documents', 0.00, NULL, '2023-09-29 04:02:08', '2023-12-13 17:10:16', '5027', '7030', 88, 'sub', NULL, NULL, 16, 'This is  the ledger for Coppies & OCC fees Documents', NULL, NULL),
(131, 1, 7, 'HIGHWAY AUTO SPARES', 0.00, NULL, '2023-10-02 00:34:19', '2023-12-14 00:34:45', '2048', '2100', 5, 'sub', 1, NULL, 7, 'This is a ledger for HIGHWAY AUTO SPARES', NULL, NULL),
(132, 1, 7, 'HOPE AUTO SPARES', 0.00, NULL, '2023-10-04 21:04:47', '2023-12-14 00:33:00', '2047', '2100', 5, 'sub', 2, NULL, 7, 'This is a ledger for HOPE AUTO SPARES', NULL, NULL),
(133, 1, 7, 'RJ AUTOMOBILES', 0.00, NULL, '2023-10-04 23:56:59', '2023-12-14 00:31:52', '2046', '2100', 5, 'sub', 3, NULL, 7, 'This is a ledger for RJ AUTOMOBILES', NULL, NULL),
(134, 1, 7, 'R.K CHUDASAMA', 0.00, NULL, '2023-10-05 00:41:23', '2023-12-14 00:30:24', '2045', '2100', 5, 'sub', 4, NULL, 7, 'This is a ledger for R.K CHUDASAMA', NULL, NULL),
(135, 1, 7, 'MWANZA AUTOMOBILES', 0.00, NULL, '2023-10-05 00:50:59', '2023-12-14 00:27:06', '2044', '2100', 5, 'sub', 5, NULL, 7, 'This is a ledger for MWANZA AUTOMOBILES', NULL, NULL),
(136, 1, 7, 'MSIME AUTO SPARES', 0.00, NULL, '2023-10-05 02:40:26', '2024-10-30 15:45:23', '2043', '2100', 5, 'sub', 9, NULL, 7, 'This is a ledger for KINDUU B MSIME', NULL, NULL),
(137, 1, 7, 'NAS TYRES SERVICES LTD', 0.00, NULL, '2023-10-06 02:43:51', '2023-12-14 00:23:54', '2042', '2100', 5, 'sub', 10, NULL, 7, 'This is a ledger for NAS TYRES SERVICES LTD', NULL, NULL),
(138, 1, 16, 'GCLA & ABNORMAL PERMITS', 0.00, NULL, '2023-10-09 01:36:04', '2024-05-23 02:49:51', '5025', '7031', NULL, NULL, NULL, NULL, 16, 'For all chemical permits applied on the given trip route', NULL, NULL),
(139, 1, 5, 'IMPALA TERMINALS TANZANIA LTD', 0.00, NULL, '2023-10-10 01:16:15', '2023-12-13 22:50:09', '1122', '1200', 46, 'sub', NULL, 2, 5, 'This is a ledger for IMPALA TERMINALS TANZANIA LTD', NULL, NULL),
(140, 1, 7, 'GALMASO ENTERPRISES', 0.00, NULL, '2023-10-10 21:11:37', '2023-12-14 00:21:15', '2041', '2100', 5, 'sub', 11, NULL, 7, 'This is a ledger for GALMASO ENTERPRISES', NULL, NULL),
(141, 1, 7, 'KAMAKA CO. LTD', 0.00, NULL, '2023-10-10 22:51:49', '2023-12-14 00:20:13', '2040', '2100', 5, 'sub', 12, NULL, 7, 'This is a ledger for KAMAKA CO. LTD', NULL, NULL),
(142, 1, 7, 'NAMA INVESTIMENT', 0.00, NULL, '2023-10-11 03:32:25', '2023-12-14 00:17:10', '2039', '2100', 5, 'sub', 13, NULL, 7, 'This is a ledger for NAMA INVESTIMENT', NULL, NULL),
(143, 1, 7, 'R.B.R SPARE PARTS', 0.00, NULL, '2023-10-11 21:19:19', '2023-12-14 00:13:24', '2038', '2100', 5, 'sub', 14, NULL, 7, 'This is a ledger for R.B.R SPARE PARTS', NULL, NULL),
(144, 1, 7, 'RETAIL SHOP-BIKE SPARES', 0.00, NULL, '2023-10-15 22:07:57', '2024-10-30 15:22:36', '2037', '2100', 5, 'sub', 15, NULL, 7, 'This is a ledger for RETAIL SHOP', NULL, NULL),
(145, 1, 7, 'TAHFIF STATIONERY KARIAKOO', 0.00, NULL, '2023-10-15 22:13:57', '2023-12-14 00:11:00', '2036', '2100', 5, 'sub', 16, NULL, 7, 'This is a ledger for TAHFIF STATIONERY KARIAKOO', NULL, NULL),
(146, 1, 7, 'KIROWI TRUCKS', 0.00, NULL, '2023-10-17 03:34:24', '2023-12-14 00:09:11', '2035', '2100', 5, 'sub', 17, NULL, 7, 'This is a ledger for KIROWI TRUCKS', NULL, NULL),
(147, 1, 5, 'EQUATOR LOGISTICS', 0.00, NULL, '2023-10-17 04:17:35', '2023-12-13 22:47:43', '1121', '1200', 46, 'sub', NULL, 3, 5, 'This is a ledger for EQUATOR LOGISTICS', NULL, NULL),
(148, 1, 5, 'XIANGYU', 0.00, NULL, '2023-10-17 05:24:04', '2023-12-13 22:46:20', '1120', '1200', 46, 'sub', NULL, 4, 5, 'This is a ledger for XIANGYU', NULL, NULL),
(149, 1, 5, 'NOVA ESPERANCA SERVICES LIMITED', 0.00, NULL, '2023-10-17 05:33:07', '2023-12-13 22:40:57', '1119', '1200', 46, 'sub', NULL, 5, 5, 'This is a ledger for NOVA ESPERANCA SERVICES LIMITED', NULL, NULL),
(150, 1, 5, 'JW LOGISTICS (BEIJING) CO. LTD', 0.00, NULL, '2023-10-17 05:41:19', '2023-12-13 22:40:01', '1118', '1200', 46, 'sub', NULL, 6, 5, 'This is a ledger for MATRIX LINE', NULL, NULL);

-- --------------------------------------------------------

--
-- Table structure for table `license_payments`
--

CREATE TABLE `license_payments` (
  `id` bigint UNSIGNED NOT NULL,
  `license_request_id` bigint UNSIGNED NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `payment_date` date NOT NULL,
  `payment_method` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reference` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `license_requests`
--

CREATE TABLE `license_requests` (
  `id` bigint UNSIGNED NOT NULL,
  `license_type_id` bigint UNSIGNED NOT NULL,
  `batch_id` bigint UNSIGNED NOT NULL,
  `user_id` bigint UNSIGNED NOT NULL,
  `status` enum('pending','approved','rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `requested_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `approved_at` timestamp NULL DEFAULT NULL,
  `expiry_date` date DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `license_request_trailer`
--

CREATE TABLE `license_request_trailer` (
  `id` bigint UNSIGNED NOT NULL,
  `license_request_id` bigint UNSIGNED NOT NULL,
  `trailer_id` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `license_request_truck`
--

CREATE TABLE `license_request_truck` (
  `id` bigint UNSIGNED NOT NULL,
  `license_request_id` bigint UNSIGNED NOT NULL,
  `truck_id` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `license_types`
--

CREATE TABLE `license_types` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `ledger_id` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `messages`
--

CREATE TABLE `messages` (
  `id` bigint UNSIGNED NOT NULL,
  `sender_id` bigint UNSIGNED NOT NULL,
  `receiver_id` bigint UNSIGNED NOT NULL,
  `message` text COLLATE utf8mb4_unicode_ci,
  `file_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `receiver_status` int NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `message_attachments`
--

CREATE TABLE `message_attachments` (
  `id` bigint UNSIGNED NOT NULL,
  `message_id` bigint UNSIGNED NOT NULL,
  `file_path` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `migrations`
--

CREATE TABLE `migrations` (
  `id` int UNSIGNED NOT NULL,
  `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `migrations`
--

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_reset_tokens_table', 1),
(3, '2019_08_19_000000_create_failed_jobs_table', 1),
(4, '2019_12_14_000001_create_personal_access_tokens_table', 1),
(5, '2025_05_13_064334_create_permission_tables', 1),
(6, '2025_05_13_073353_create_departments_table', 1),
(7, '2025_05_13_074547_add_department_and_line_manager_to_users_table', 1),
(8, '2025_05_14_175215_create_currencies_table', 1),
(9, '2025_05_14_183045_create_customers_table', 1),
(10, '2025_05_14_185607_create_positions_table', 1),
(11, '2025_05_14_191159_add_position_id_to_users_table', 1),
(12, '2025_05_14_234901_add_status_to_users_table', 1),
(13, '2025_05_16_072010_add_created_by_to_users_table', 1),
(14, '2025_05_16_093542_create_trucks_table', 1),
(15, '2025_05_16_105913_update_trucks_table', 1),
(16, '2025_05_16_111416_create_trailers_table', 1),
(17, '2025_05_16_113850_create_routes_table', 1),
(18, '2025_05_16_122212_create_common_costs_table', 1),
(19, '2025_05_17_043311_add_mode_to_users_table', 1),
(20, '2025_05_17_043318_add_mode_to_users_table', 1),
(21, '2025_05_17_130024_create_fuel_costs_table', 1),
(22, '2025_05_17_204639_create_approvals_table', 1),
(23, '2025_05_17_205723_create_approval_levels_table', 1),
(24, '2025_05_17_214641_create_driver_assignments_table', 1),
(25, '2025_05_17_221707_create_trailer_assignments_table', 1),
(26, '2025_05_17_224019_create_route_costs_table', 1),
(27, '2025_05_18_000424_create_payment_methods_table', 1),
(28, '2025_05_18_000558_create_ledgers_table', 1),
(29, '2025_05_18_004200_create_payment_modes_table', 1),
(30, '2025_05_18_065315_create_cargo_natures_table', 1),
(31, '2025_05_18_075112_create_allocations_table', 1),
(32, '2025_05_18_110945_create_currency_logs_table', 1),
(33, '2025_05_18_111250_create_currency_log_items_table', 1),
(34, '2025_05_18_134331_create_allocation_costs_table', 1),
(35, '2025_05_23_210858_create_trips_table', 1),
(36, '2025_05_23_212545_create_truck_allocations_table', 1),
(37, '2025_05_23_214638_add_columns_to_allocations_table', 1),
(38, '2025_05_23_215413_drop_cargo_nature_id_from_allocations_table', 1),
(39, '2025_05_23_215606_drop_payment_mode_id_from_allocations_table', 1),
(40, '2025_05_23_221922_create_allocation_remarks_table', 1),
(41, '2025_05_23_223335_create_mobilization_costs_table', 1),
(42, '2025_05_23_223636_create_mobilization_routes_table', 1),
(43, '2025_05_23_224206_create_truck_manager_assignments_table', 1),
(44, '2025_05_23_231719_create_truck_costs_table', 1),
(45, '2025_05_23_232029_create_truck_types_table', 1),
(46, '2025_05_25_102308_create_system_logs_table', 1),
(47, '2025_05_27_094003_create_truck_change_requests_table', 1),
(48, '2025_05_27_130954_create_allocation_cost_payments_table', 1),
(49, '2025_05_27_131304_create_audits_table', 1),
(50, '2025_05_27_195612_create_trip_costs_table', 1),
(51, '2025_06_01_155026_create_trip_truck_remarks_table', 1),
(52, '2025_06_01_215826_add_deleted_at_to_trucks_table', 1),
(53, '2025_06_02_072232_create_breakdown_categories_table', 1),
(54, '2025_06_02_072233_create_breakdown_items_table', 1),
(55, '2025_06_02_072334_create_breakdowns_table', 1),
(56, '2025_06_02_102313_create_off_budget_categories_table', 1),
(57, '2025_06_04_004002_create_companies_table', 1),
(58, '2025_06_04_011206_create_account_groups_table', 1),
(59, '2025_06_04_015408_create_cost_categories_table', 1),
(60, '2025_06_04_015409_create_cost_centers_table', 1),
(61, '2025_06_04_041540_create_godowns_table', 1),
(62, '2025_06_04_042305_create_voucher_types_table', 1),
(63, '2025_06_04_043107_create_units_table', 1),
(64, '2025_06_04_050332_create_stock_groups_table', 1),
(65, '2025_06_04_051203_create_stock_items_table', 1),
(66, '2025_06_04_054902_create_godown_stocks_table', 1),
(67, '2025_06_04_091746_create_vouchers_table', 1),
(68, '2025_06_04_091822_create_voucher_entries_table', 1),
(69, '2025_06_04_092336_create_stock_entries_table', 1),
(70, '2025_06_05_015334_add_columns_to_users_table', 1),
(71, '2025_06_10_082444_create_trip_remarks_table', 1),
(72, '2025_06_12_200723_create_suppliers_table', 1),
(73, '2025_06_24_211432_create_org_regions_table', 1),
(74, '2025_06_28_044603_create_trip_invoices_table', 1),
(75, '2025_06_28_045458_create_transactions_table', 1),
(76, '2025_06_28_050402_create_process_ledgers_table', 1),
(77, '2025_06_28_050719_create_process_ledger_mappers_table', 1),
(78, '2025_06_28_053937_create_service_purchases_table', 1),
(79, '2025_06_28_054007_create_service_purchase_items_table', 1),
(80, '2025_06_28_071142_create_taxes_table', 1),
(81, '2025_06_28_195702_create_truck_cost_payments_table', 1),
(82, '2025_07_17_074752_add_columns_to_ledgers_table', 1),
(83, '2025_07_17_092629_create_invoiced_trucks_table', 1),
(84, '2025_07_19_072300_create_invoiced_truck_incomes_table', 1),
(85, '2025_07_19_075901_create_trip_invoice_remarks_table', 1),
(86, '2025_07_19_144934_create_trip_invoice_payments_table', 1),
(87, '2025_07_20_100659_create_debit_notes_table', 1),
(88, '2025_07_20_104603_create_debit_note_trucks_table', 1),
(89, '2025_07_20_112021_create_debit_note_remarks_table', 1),
(90, '2025_07_20_124524_create_credit_notes_table', 1),
(91, '2025_07_20_135648_create_credit_note_trucks_table', 1),
(92, '2025_07_20_143044_create_credit_note_remarks_table', 1),
(93, '2025_07_20_155445_create_truck_change_lists_table', 1),
(94, '2025_07_20_160705_create_truck_change_remarks_table', 1),
(95, '2025_07_20_204939_create_purchase_delivery_notes_table', 1),
(96, '2025_07_20_211614_create_service_purchase_remarks_table', 1),
(97, '2025_07_22_051720_create_account_types_table', 1),
(98, '2025_07_22_051949_create_group_accounts_table', 1),
(99, '2025_07_22_052256_create_sub_accounts_table', 1),
(100, '2025_07_22_081746_add_columns_to_ledgers_table', 1),
(101, '2025_07_22_142218_add_columns_to_ledgers_table', 1),
(102, '2025_07_22_194245_create_off_budgets_table', 1),
(103, '2025_07_22_224717_create_offbudget_remarks_table', 1),
(104, '2025_08_06_191832_create_upload_requests_table', 1),
(105, '2025_08_06_194249_create_upload_request_items_table', 1),
(106, '2025_08_06_194736_create_common_bulk_expenses_table', 1),
(107, '2025_08_06_202636_create_remarks_table', 1),
(108, '2025_08_30_145004_add_columns_to_ledgers_table', 1),
(109, '2025_08_31_044204_create_administration_costs_table', 1),
(110, '2025_08_31_083921_create_workshop_requests_table', 1),
(111, '2025_08_31_084225_create_workshop_request_items_table', 1),
(112, '2025_08_31_084708_create_categories_table', 1),
(113, '2025_08_31_090605_create_retail_units_table', 1),
(114, '2025_08_31_091358_create_retails_table', 1),
(115, '2025_08_31_091751_create_breakdown_expenses_table', 1),
(116, '2025_08_31_091931_create_fund_types_table', 1),
(117, '2025_08_31_092123_create_personnel_expenses_table', 1),
(118, '2025_08_31_092331_create_personnel_assignments_table', 1),
(119, '2025_08_31_092529_create_technicians_table', 1),
(120, '2025_09_02_234441_create_jobcards_table', 1),
(121, '2025_09_30_005146_add_columns_to_service_purchases_table', 1),
(122, '2025_10_21_233117_create_units_table', 1),
(123, '2025_10_23_131138_alter_breakdowns_table_make_currency_id_nullable', 1),
(124, '2025_11_28_071549_add_description_and_status_to_units_table', 1),
(125, '2025_11_28_072238_make_company_id_nullable_in_units_table', 1),
(126, '2025_11_28_072816_make_user_id_nullable_in_companies_table', 1),
(127, '2025_12_02_011133_add_going_return_refs_to_truck_allocations_table', 1),
(128, '2025_12_02_013053_add_litre_capacity_to_trailers_table', 1),
(129, '2025_12_12_173242_add_trip_nature_to_allocations_table', 1),
(130, '2026_01_04_160600_add_sidebar_modules_to_users_table', 1),
(131, '2026_01_16_182700_create_messages_table', 1),
(132, '2026_01_16_182800_create_message_attachments_table', 1),
(133, '2026_01_17_010539_add_allocation_id_to_transactions_table', 1),
(134, '2026_01_17_010727_add_total_loss_amount_to_truck_allocations_table', 1),
(135, '2026_01_19_204100_create_driver_attachments_table', 1),
(136, '2026_01_19_233145_add_fields_to_driver_attachments_table', 1),
(137, '2026_01_23_190343_create_notifications_table', 1),
(138, '2026_01_27_052828_create_license_types_table', 1),
(139, '2026_01_27_052926_create_batches_table', 1),
(140, '2026_01_27_053000_create_license_requests_table', 1),
(141, '2026_01_27_053100_create_license_payments_table', 1),
(142, '2026_01_27_053200_create_license_request_truck_table', 1),
(143, '2026_01_27_053300_create_license_request_trailer_table', 1),
(144, '2026_01_27_183532_drop_type_from_license_types_table', 1),
(145, '2026_02_04_000000_create_allocation_reference_settings_table', 1);

-- --------------------------------------------------------

--
-- Table structure for table `mobilization_costs`
--

CREATE TABLE `mobilization_costs` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` double NOT NULL,
  `quantity` double DEFAULT NULL,
  `account_code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_by` bigint UNSIGNED NOT NULL,
  `cost_id` bigint UNSIGNED NOT NULL,
  `route_id` bigint UNSIGNED DEFAULT NULL,
  `currency_id` bigint UNSIGNED NOT NULL,
  `rate` double NOT NULL,
  `real_amount` double NOT NULL,
  `vat` tinyint(1) NOT NULL DEFAULT '0',
  `editable` tinyint(1) NOT NULL DEFAULT '0',
  `type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'All',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `advancable` int NOT NULL DEFAULT '0',
  `return` tinyint(1) NOT NULL DEFAULT '0',
  `status` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `mobilization_routes`
--

CREATE TABLE `mobilization_routes` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `start_point` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `end_point` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `model_has_permissions`
--

CREATE TABLE `model_has_permissions` (
  `permission_id` bigint UNSIGNED NOT NULL,
  `model_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` bigint UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `model_has_roles`
--

CREATE TABLE `model_has_roles` (
  `role_id` bigint UNSIGNED NOT NULL,
  `model_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` bigint UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `model_has_roles`
--

INSERT INTO `model_has_roles` (`role_id`, `model_type`, `model_id`) VALUES
(1, 'App\\Models\\User', 1),
(2, 'App\\Models\\User', 2),
(3, 'App\\Models\\User', 3),
(4, 'App\\Models\\User', 4),
(5, 'App\\Models\\User', 5),
(6, 'App\\Models\\User', 6),
(7, 'App\\Models\\User', 7);

-- --------------------------------------------------------

--
-- Table structure for table `notifications`
--

CREATE TABLE `notifications` (
  `id` bigint UNSIGNED NOT NULL,
  `user_id` bigint UNSIGNED NOT NULL,
  `type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'info',
  `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `message` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `data` json DEFAULT NULL,
  `read_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `offbudget_remarks`
--

CREATE TABLE `offbudget_remarks` (
  `id` bigint UNSIGNED NOT NULL,
  `offbudget_id` bigint UNSIGNED NOT NULL,
  `remark` text COLLATE utf8mb4_unicode_ci,
  `remarked_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_by` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `off_budgets`
--

CREATE TABLE `off_budgets` (
  `id` bigint UNSIGNED NOT NULL,
  `truck_id` bigint UNSIGNED NOT NULL,
  `trip_id` bigint UNSIGNED NOT NULL,
  `currency_id` bigint UNSIGNED NOT NULL,
  `category_id` bigint NOT NULL,
  `date` date NOT NULL,
  `amount` double NOT NULL DEFAULT '0',
  `rate` double DEFAULT NULL,
  `real_amount` double DEFAULT NULL,
  `reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `state` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'N/L',
  `status` tinyint(1) NOT NULL DEFAULT '0',
  `created_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `approval_status` int NOT NULL DEFAULT '0',
  `quantity` double DEFAULT NULL,
  `nature` int NOT NULL DEFAULT '0',
  `transaction_charges` int DEFAULT NULL,
  `service_charges` double NOT NULL DEFAULT '0',
  `vat_charges` double NOT NULL DEFAULT '0',
  `payment_status` int NOT NULL DEFAULT '0',
  `paid_amount` double DEFAULT NULL,
  `real_paid_amount` double DEFAULT NULL,
  `currency_log_id` int NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `off_budget_categories`
--

CREATE TABLE `off_budget_categories` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_by` bigint DEFAULT NULL,
  `cost_id` bigint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `org_regions`
--

CREATE TABLE `org_regions` (
  `id` bigint UNSIGNED NOT NULL,
  `reg_code` varchar(125) COLLATE utf8mb4_unicode_ci NOT NULL,
  `reg_name` varchar(125) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `org_regions`
--

INSERT INTO `org_regions` (`id`, `reg_code`, `reg_name`, `created_at`, `updated_at`) VALUES
(1, '01', 'Dodoma', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(2, '02', 'Arusha', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(3, '03', 'Kilimanjaro', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(4, '04', 'Tanga', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(5, '05', 'Morogoro', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(6, '06', 'Pwani', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(7, '07', 'Dar-es-salaam', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(8, '08', 'Lindi', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(9, '09', 'Mtwara', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(10, '10', 'Ruvuma', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(11, '11', 'Iringa', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(12, '12', 'Mbeya', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(13, '13', 'Singida', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(14, '14', 'Tabora', '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(15, '15', 'Rukwa', '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(16, '16', 'Kogoma', '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(17, '17', 'Shinyanga', '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(18, '18', 'Kagera', '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(19, '19', 'Mwanza', '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(20, '20', 'Mara', '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(21, '21', 'Manyara', '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(22, '22', 'Njombe', '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(23, '23', 'Katavi', '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(24, '24', 'Simiyu', '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(25, '25', 'Geita', '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(26, '51', 'Kaskazini Unguja', '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(27, '52', 'Kusini Unguja', '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(28, '53', 'Mjini Magharibi', '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(29, '54', 'Kaskazini Pemba', '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(30, '55', 'Kusini Pemba', '2026-04-21 16:42:19', '2026-04-21 16:42:19');

-- --------------------------------------------------------

--
-- Table structure for table `payment_methods`
--

CREATE TABLE `payment_methods` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `ledger_id` bigint NOT NULL,
  `created_by` bigint NOT NULL,
  `status` int NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `currency_id` int NOT NULL DEFAULT '0',
  `account_number_usd` varchar(110) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `account_number_tzs` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `branch_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bank_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `swift_code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `branch_code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `payment_modes`
--

CREATE TABLE `payment_modes` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payment_modes`
--

INSERT INTO `payment_modes` (`id`, `name`, `status`, `created_at`, `updated_at`) VALUES
(1, 'Per Truck', 0, '2026-04-21 16:42:16', '2026-04-21 16:42:16'),
(2, 'Per Ton', 0, '2026-04-21 16:42:16', '2026-04-21 16:42:16'),
(3, 'Per 1000 Litre', 0, '2026-04-21 16:42:16', '2026-04-21 16:42:16');

-- --------------------------------------------------------

--
-- Table structure for table `permissions`
--

CREATE TABLE `permissions` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `guard_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `permissions`
--

INSERT INTO `permissions` (`id`, `name`, `guard_name`, `created_at`, `updated_at`) VALUES
(1, 'manage users', 'web', '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(2, 'manage customers', 'web', '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(3, 'manage vehicles', 'web', '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(4, 'manage routes', 'web', '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(5, 'manage shipments', 'web', '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(6, 'track shipments', 'web', '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(7, 'assign vehicles', 'web', '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(8, 'assign-driver', 'web', '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(9, 'deassign-trailer', 'web', '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(10, 'view reports', 'web', '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(11, 'view-dashboard', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(12, 'create-dashboard', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(13, 'edit-dashboard', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(14, 'delete-dashboard', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(15, 'view-users', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(16, 'create-users', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(17, 'edit-users', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(18, 'delete-users', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(19, 'view-logistics-modules', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(20, 'create-logistics-modules', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(21, 'edit-logistics-modules', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(22, 'delete-logistics-modules', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(23, 'view-customers', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(24, 'create-customers', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(25, 'edit-customers', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(26, 'delete-customers', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(27, 'view-drivers', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(28, 'create-drivers', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(29, 'edit-drivers', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(30, 'delete-drivers', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(31, 'view-trucks', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(32, 'create-trucks', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(33, 'edit-trucks', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(34, 'delete-trucks', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(35, 'view-trailers', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(36, 'create-trailers', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(37, 'edit-trailers', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(38, 'delete-trailers', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(39, 'view-routes', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(40, 'create-routes', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(41, 'edit-routes', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(42, 'delete-routes', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(43, 'view-allocations', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(44, 'create-allocations', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(45, 'edit-allocations', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(46, 'delete-allocations', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(47, 'view-truck-change', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(48, 'create-truck-change', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(49, 'edit-truck-change', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(50, 'delete-truck-change', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(51, 'view-truck-loading', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(52, 'create-truck-loading', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(53, 'edit-truck-loading', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(54, 'delete-truck-loading', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(55, 'view-breakdowns', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(56, 'create-breakdowns', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(57, 'edit-breakdowns', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(58, 'delete-breakdowns', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(59, 'view-accidents', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(60, 'create-accidents', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(61, 'edit-accidents', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(62, 'delete-accidents', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(63, 'view-out-of-budget', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(64, 'create-out-of-budget', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(65, 'edit-out-of-budget', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(66, 'delete-out-of-budget', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(67, 'view-reports', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(68, 'create-reports', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(69, 'edit-reports', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(70, 'delete-reports', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(71, 'view-finance-modules', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(72, 'create-finance-modules', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(73, 'edit-finance-modules', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(74, 'delete-finance-modules', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(75, 'view-accounts-modules', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(76, 'create-accounts-modules', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(77, 'edit-accounts-modules', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(78, 'delete-accounts-modules', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(79, 'view-tally-modules', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(80, 'create-tally-modules', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(81, 'edit-tally-modules', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(82, 'delete-tally-modules', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(83, 'view-company-management', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(84, 'create-company-management', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(85, 'edit-company-management', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(86, 'delete-company-management', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(87, 'view-chart-of-accounts', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(88, 'create-chart-of-accounts', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(89, 'edit-chart-of-accounts', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(90, 'delete-chart-of-accounts', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(91, 'view-stock-management', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(92, 'create-stock-management', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(93, 'edit-stock-management', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(94, 'delete-stock-management', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(95, 'view-vouchers-management', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(96, 'create-vouchers-management', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(97, 'edit-vouchers-management', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(98, 'delete-vouchers-management', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(99, 'view-accounting-reports', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(100, 'create-accounting-reports', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(101, 'edit-accounting-reports', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(102, 'delete-accounting-reports', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(103, 'view-tally-integration', 'web', '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(104, 'create-tally-integration', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(105, 'edit-tally-integration', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(106, 'delete-tally-integration', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(107, 'view-finance-settings', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(108, 'create-finance-settings', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(109, 'edit-finance-settings', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(110, 'delete-finance-settings', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(111, 'view-logistics-settings', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(112, 'create-logistics-settings', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(113, 'edit-logistics-settings', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(114, 'delete-logistics-settings', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(115, 'view-system-settings', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(116, 'create-system-settings', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(117, 'edit-system-settings', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(118, 'delete-system-settings', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(119, 'view-currencies', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(120, 'create-currencies', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(121, 'edit-currencies', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(122, 'delete-currencies', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(123, 'view-taxes', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(124, 'create-taxes', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(125, 'edit-taxes', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(126, 'delete-taxes', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(127, 'view-banks', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(128, 'create-banks', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(129, 'edit-banks', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(130, 'delete-banks', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(131, 'view-payment-methods', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(132, 'create-payment-methods', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(133, 'edit-payment-methods', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(134, 'delete-payment-methods', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(135, 'view-suppliers', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(136, 'create-suppliers', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(137, 'edit-suppliers', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(138, 'delete-suppliers', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(139, 'view-categories', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(140, 'create-categories', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(141, 'edit-categories', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(142, 'delete-categories', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(143, 'view-spare-parts', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(144, 'create-spare-parts', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(145, 'edit-spare-parts', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(146, 'delete-spare-parts', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(147, 'view-units', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(148, 'create-units', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(149, 'edit-units', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(150, 'delete-units', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(151, 'view-license-management', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(152, 'create-license-management', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(153, 'edit-license-management', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(154, 'delete-license-management', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(155, 'view-license-types', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(156, 'create-license-types', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(157, 'edit-license-types', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(158, 'delete-license-types', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(159, 'view-batches', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(160, 'create-batches', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(161, 'edit-batches', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(162, 'delete-batches', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(163, 'use-collapsable-vendors-menu', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(164, 'use-collapsable-users-menu', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(165, 'use-collapsable-finance-settings-menu', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(166, 'use-collapsable-logistics-settings-menu', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(167, 'use-collapsable-system-settings-menu', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(168, 'use-collapsable-logistics-menu', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(169, 'use-collapsable-finance-menu', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(170, 'use-collapsable-tally-menu', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(171, 'use-collapsable-settings-menu', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(172, 'view-finance-trips', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(173, 'view-trip-expenses', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(174, 'view-finance-offbudget', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(175, 'view-service-purchases', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(176, 'view-fuel-procurements', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(177, 'view-clients-payments', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(178, 'view-payment-history', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18'),
(179, 'view-finance-reports', 'web', '2026-04-21 16:42:18', '2026-04-21 16:42:18');

-- --------------------------------------------------------

--
-- Table structure for table `personnel_assignments`
--

CREATE TABLE `personnel_assignments` (
  `id` bigint UNSIGNED NOT NULL,
  `jobcard_id` bigint UNSIGNED DEFAULT NULL,
  `inspection_id` bigint UNSIGNED DEFAULT NULL,
  `checklist_id` bigint UNSIGNED DEFAULT NULL,
  `department_id` bigint UNSIGNED DEFAULT NULL,
  `personnel_id` bigint UNSIGNED NOT NULL,
  `status` int NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `duration` double DEFAULT NULL,
  `truck_id` bigint UNSIGNED DEFAULT NULL,
  `closed_date` datetime DEFAULT NULL,
  `progress_date` datetime DEFAULT NULL,
  `narration` text COLLATE utf8mb4_unicode_ci,
  `last_hold_date` datetime DEFAULT NULL,
  `hoding_time` datetime DEFAULT NULL,
  `hold_at` datetime DEFAULT NULL,
  `resume_at` datetime DEFAULT NULL,
  `failed_at` datetime DEFAULT NULL,
  `breakdown_id` bigint UNSIGNED DEFAULT NULL,
  `holding_duration` bigint DEFAULT NULL,
  `maintanance_id` bigint UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `personnel_expenses`
--

CREATE TABLE `personnel_expenses` (
  `id` bigint UNSIGNED NOT NULL,
  `truck_id` bigint UNSIGNED DEFAULT NULL,
  `personnel_assignment_id` bigint UNSIGNED DEFAULT NULL,
  `added_by_id` bigint UNSIGNED DEFAULT NULL,
  `paid_by_id` bigint UNSIGNED DEFAULT NULL,
  `cost` decimal(15,2) DEFAULT NULL,
  `currency_id` bigint UNSIGNED DEFAULT NULL,
  `mapper_id` bigint UNSIGNED DEFAULT NULL,
  `paid_at` datetime DEFAULT NULL,
  `status` int NOT NULL DEFAULT '0',
  `level` int NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `fund_type_id` bigint UNSIGNED DEFAULT NULL,
  `narration` text COLLATE utf8mb4_unicode_ci,
  `real_amount` double DEFAULT NULL,
  `transaction_charges` double DEFAULT NULL,
  `service_charges` double NOT NULL DEFAULT '0',
  `vat_charges` double NOT NULL DEFAULT '0',
  `paid_amount` double NOT NULL DEFAULT '0',
  `real_paid_amount` double NOT NULL DEFAULT '0',
  `payment_status` int NOT NULL DEFAULT '0',
  `currency_log_id` int NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `positions`
--

CREATE TABLE `positions` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` tinyint(1) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `positions`
--

INSERT INTO `positions` (`id`, `name`, `slug`, `status`, `created_at`, `updated_at`) VALUES
(1, 'Driver', 'driver', 1, '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(2, 'Dispatcher', 'dispatcher', 1, '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(3, 'Warehouse Manager', 'warehouse-manager', 1, '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(4, 'Logistics Coordinator', 'logistics-coordinator', 1, '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(5, 'Operations Supervisor', 'operations-supervisor', 1, '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(6, 'Fleet Manager', 'fleet-manager', 1, '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(7, 'Delivery Associate', 'delivery-associate', 1, '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(8, 'Route Planner', 'route-planner', 1, '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(9, 'Inventory Controller', 'inventory-controller', 1, '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(10, 'Customs Clearance Officer', 'customs-clearance-officer', 1, '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(11, 'Freight Forwarding Agent', 'freight-forwarding-agent', 1, '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(12, 'Supply Chain Analyst', 'supply-chain-analyst', 1, '2026-04-21 16:42:13', '2026-04-21 16:42:13');

-- --------------------------------------------------------

--
-- Table structure for table `process_ledgers`
--

CREATE TABLE `process_ledgers` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `process_ledgers`
--

INSERT INTO `process_ledgers` (`id`, `name`, `created_at`, `updated_at`) VALUES
(1, 'Truck Registration', '2023-05-25 23:03:02', '2023-05-25 23:03:02'),
(2, 'Trailer Registration', '2023-05-25 23:03:02', '2023-05-25 23:03:02'),
(3, 'Truck License Payment', '2023-05-25 23:03:02', '2023-05-25 23:03:02'),
(4, 'Trip Expense Payment', '2023-05-25 23:03:02', '2023-05-25 23:03:02'),
(5, 'Trip Invoice Generation', '2023-05-25 23:03:02', '2023-05-25 23:03:02'),
(6, 'Trip Invoice Payment', '2023-05-25 23:03:02', '2023-05-25 23:03:02'),
(7, 'Out of Budget Payment', '2023-05-25 23:03:02', '2023-05-25 23:03:02'),
(8, 'Breakdown Payment', '2023-05-25 23:03:02', '2023-05-25 23:03:02'),
(9, 'LPO Generation', '2023-05-25 23:03:02', '2023-05-25 23:03:02'),
(10, 'Goods Delivery Notice', '2023-05-25 23:03:02', '2023-05-25 23:03:02'),
(11, 'Purchase Invoice', '2023-05-25 23:03:02', '2023-05-25 23:03:02'),
(12, 'Purchase Payment', '2023-05-25 23:03:02', '2023-05-25 23:03:02'),
(13, 'Store Item Dispatch', '2023-05-25 23:03:02', '2023-05-25 23:03:02'),
(14, 'Procurement Dispatch', '2023-05-25 23:03:02', '2023-05-25 23:03:02'),
(15, 'Administration Expense Payment', '2023-05-25 23:03:02', '2023-05-25 23:03:02'),
(16, 'Retirement Registration', '2023-05-25 23:03:02', '2023-05-25 23:03:02'),
(17, 'Retirement Payment', '2023-05-25 23:03:02', '2023-05-25 23:03:02'),
(18, 'Allocation Request Submission', '2023-05-25 23:03:02', '2023-05-25 23:03:02'),
(19, 'Artisan Fund', '2023-09-07 12:31:16', '2023-09-07 12:31:16'),
(20, 'Artisan Fund', '2023-09-07 12:36:00', '2023-09-07 12:36:00'),
(21, 'Artisan Fund', '2023-09-07 12:36:59', '2023-09-07 12:36:59'),
(22, 'Labour Charges', '2023-09-07 12:37:52', '2023-09-07 12:37:52'),
(23, 'STAFF MEALS', '2023-09-07 12:38:29', '2023-10-11 22:36:28'),
(24, 'SPARE PARTS', '2023-09-07 12:38:53', '2023-10-11 22:34:30'),
(25, 'Assignment Payment', NULL, NULL),
(26, 'TRANSPORT FEE', '2023-11-14 01:30:19', '2023-11-14 01:30:19'),
(27, 'TRANSPORTING FEE', '2023-11-14 01:33:07', '2023-11-14 01:33:07'),
(28, 'OUT OF STATION ALLOWANCE', '2023-11-16 05:19:31', '2023-11-16 05:19:31');

-- --------------------------------------------------------

--
-- Table structure for table `process_ledger_mappers`
--

CREATE TABLE `process_ledger_mappers` (
  `id` bigint UNSIGNED NOT NULL,
  `process_id` bigint UNSIGNED DEFAULT NULL,
  `ledger_debit_id` bigint UNSIGNED DEFAULT NULL,
  `ledger_credit_id` bigint UNSIGNED DEFAULT NULL,
  `sub_account_debit_id` bigint UNSIGNED DEFAULT NULL,
  `sub_account_credit_id` bigint UNSIGNED DEFAULT NULL,
  `vat_id` bigint UNSIGNED DEFAULT NULL,
  `vat_percentage` decimal(8,2) DEFAULT NULL,
  `status` int NOT NULL DEFAULT '1',
  `credit_level` int NOT NULL DEFAULT '5',
  `debit_level` int NOT NULL DEFAULT '5',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `purchase_delivery_notes`
--

CREATE TABLE `purchase_delivery_notes` (
  `id` bigint UNSIGNED NOT NULL,
  `purchase_id` bigint UNSIGNED NOT NULL,
  `retail_id` bigint UNSIGNED DEFAULT NULL,
  `workshop_request_item_id` bigint UNSIGNED DEFAULT NULL,
  `service_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `price` decimal(15,2) DEFAULT NULL,
  `tax_rate` double DEFAULT NULL,
  `previous_quantity` int NOT NULL,
  `received_quantity` int NOT NULL DEFAULT '0',
  `remain_quantity` int NOT NULL DEFAULT '0',
  `total_price` double DEFAULT NULL,
  `delivery_status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '1 for pending(not received), 2 for completed, 3 for partial',
  `purchase_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'item' COMMENT 'item, service',
  `status` tinyint NOT NULL DEFAULT '1',
  `created_by` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `purchase_item_id` bigint UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `remarks`
--

CREATE TABLE `remarks` (
  `id` bigint UNSIGNED NOT NULL,
  `remark` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `remarked_by_id` bigint UNSIGNED DEFAULT NULL,
  `type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type_id` bigint UNSIGNED DEFAULT NULL,
  `status` int NOT NULL DEFAULT '0',
  `remarked` bigint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `retails`
--

CREATE TABLE `retails` (
  `id` bigint UNSIGNED NOT NULL,
  `category_id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `unit` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `main_price` decimal(15,2) DEFAULT NULL,
  `total_quantity` int DEFAULT NULL,
  `actual_quantity` int DEFAULT NULL,
  `stock_taking_date` datetime DEFAULT NULL,
  `tag` tinyint NOT NULL DEFAULT '0' COMMENT '0 for default/dispatch_by_quantity, 1 for serial-number',
  `description` text COLLATE utf8mb4_unicode_ci,
  `status` tinyint NOT NULL DEFAULT '1',
  `created_by` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `label` tinyint NOT NULL DEFAULT '0' COMMENT '1 for Store, 0 for Workshop, 2 for Stationary'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `retails`
--

INSERT INTO `retails` (`id`, `category_id`, `name`, `unit`, `main_price`, `total_quantity`, `actual_quantity`, `stock_taking_date`, `tag`, `description`, `status`, `created_by`, `created_at`, `updated_at`, `label`) VALUES
(1, 1, 'Headlight Bulb', 'Pc', 1500.00, 50, 50, '2026-04-21 19:42:19', 0, 'Standard headlight bulb for trucks', 1, 1, '2026-04-21 16:42:19', '2026-04-21 16:42:19', 0),
(2, 1, 'Tail Light Assembly', 'Pc', 2500.00, 30, 30, '2026-04-21 19:42:19', 0, 'Complete tail light assembly', 1, 1, '2026-04-21 16:42:19', '2026-04-21 16:42:19', 0),
(3, 2, 'Truck Tyre 11R22.5', 'Pc', 45000.00, 20, 20, '2026-04-21 19:42:19', 0, 'Heavy duty truck tyre', 1, 1, '2026-04-21 16:42:19', '2026-04-21 16:42:19', 0),
(4, 2, 'Inner Tube 11R22.5', 'Pc', 5000.00, 25, 25, '2026-04-21 19:42:19', 0, 'Inner tube for truck tyres', 1, 1, '2026-04-21 16:42:19', '2026-04-21 16:42:19', 0),
(5, 3, 'Ratchet Strap 2\"', 'Pc', 800.00, 100, 100, '2026-04-21 19:42:19', 0, 'Heavy duty ratchet strap', 1, 1, '2026-04-21 16:42:19', '2026-04-21 16:42:19', 0),
(6, 4, 'Leaf Spring', 'Pc', 12000.00, 15, 15, '2026-04-21 19:42:19', 0, 'Truck leaf spring suspension', 1, 1, '2026-04-21 16:42:19', '2026-04-21 16:42:19', 0),
(7, 5, 'Brake Pad Set', 'Set', 3500.00, 40, 40, '2026-04-21 19:42:19', 0, 'Brake pads for truck brakes', 1, 1, '2026-04-21 16:42:19', '2026-04-21 16:42:19', 0),
(8, 7, 'Truck Battery 12V 150Ah', 'Pc', 25000.00, 10, 10, '2026-04-21 19:42:19', 0, 'Heavy duty truck battery', 1, 1, '2026-04-21 16:42:19', '2026-04-21 16:42:19', 0),
(9, 8, 'Radiator Core', 'Pc', 18000.00, 8, 8, '2026-04-21 19:42:19', 0, 'Truck radiator core', 1, 1, '2026-04-21 16:42:19', '2026-04-21 16:42:19', 0),
(10, 9, 'Fire Extinguisher 5kg', 'Pc', 3000.00, 50, 50, '2026-04-21 19:42:19', 0, 'Dry chemical fire extinguisher', 1, 1, '2026-04-21 16:42:19', '2026-04-21 16:42:19', 0);

-- --------------------------------------------------------

--
-- Table structure for table `retail_units`
--

CREATE TABLE `retail_units` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` tinyint NOT NULL DEFAULT '1',
  `created_by` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `retail_units`
--

INSERT INTO `retail_units` (`id`, `name`, `status`, `created_by`, `created_at`, `updated_at`) VALUES
(1, 'Pc\'s', 1, 1, '2023-05-15 22:12:35', '2023-05-15 22:12:35'),
(2, 'Metre', 1, 1, '2023-05-15 22:12:43', '2023-05-15 22:12:43'),
(3, 'Kilograms', 1, 1, '2023-05-15 22:13:04', '2023-05-15 22:13:04'),
(4, 'Litres', 1, 1, '2023-10-03 23:50:21', '2023-10-03 23:50:21'),
(5, 'PKT', 1, 1, '2023-10-15 23:59:10', '2023-10-15 23:59:10'),
(6, 'BOX', 1, 864, '2023-10-15 23:59:19', '2023-10-15 23:59:19'),
(7, 'Set', 1, 1, '2023-10-30 06:43:44', '2023-10-30 06:43:44'),
(8, 'Roll', 1, 1, '2023-11-24 04:12:04', '2023-11-24 04:12:04');

-- --------------------------------------------------------

--
-- Table structure for table `roles`
--

CREATE TABLE `roles` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `guard_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `roles`
--

INSERT INTO `roles` (`id`, `name`, `guard_name`, `created_at`, `updated_at`) VALUES
(1, 'admin', 'web', '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(2, 'dispatcher', 'web', '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(3, 'driver', 'web', '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(4, 'operation-manager', 'web', '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(5, 'managing-director', 'web', '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(6, 'accountant', 'web', '2026-04-21 16:42:13', '2026-04-21 16:42:13'),
(7, 'customer-service', 'web', '2026-04-21 16:42:13', '2026-04-21 16:42:13');

-- --------------------------------------------------------

--
-- Table structure for table `role_has_permissions`
--

CREATE TABLE `role_has_permissions` (
  `permission_id` bigint UNSIGNED NOT NULL,
  `role_id` bigint UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `role_has_permissions`
--

INSERT INTO `role_has_permissions` (`permission_id`, `role_id`) VALUES
(1, 1),
(2, 1),
(3, 1),
(4, 1),
(5, 1),
(6, 1),
(7, 1),
(8, 1),
(9, 1),
(10, 1),
(11, 1),
(12, 1),
(13, 1),
(14, 1),
(15, 1),
(16, 1),
(17, 1),
(18, 1),
(19, 1),
(20, 1),
(21, 1),
(22, 1),
(23, 1),
(24, 1),
(25, 1),
(26, 1),
(27, 1),
(28, 1),
(29, 1),
(30, 1),
(31, 1),
(32, 1),
(33, 1),
(34, 1),
(35, 1),
(36, 1),
(37, 1),
(38, 1),
(39, 1),
(40, 1),
(41, 1),
(42, 1),
(43, 1),
(44, 1),
(45, 1),
(46, 1),
(47, 1),
(48, 1),
(49, 1),
(50, 1),
(51, 1),
(52, 1),
(53, 1),
(54, 1),
(55, 1),
(56, 1),
(57, 1),
(58, 1),
(59, 1),
(60, 1),
(61, 1),
(62, 1),
(63, 1),
(64, 1),
(65, 1),
(66, 1),
(67, 1),
(68, 1),
(69, 1),
(70, 1),
(71, 1),
(72, 1),
(73, 1),
(74, 1),
(75, 1),
(76, 1),
(77, 1),
(78, 1),
(79, 1),
(80, 1),
(81, 1),
(82, 1),
(83, 1),
(84, 1),
(85, 1),
(86, 1),
(87, 1),
(88, 1),
(89, 1),
(90, 1),
(91, 1),
(92, 1),
(93, 1),
(94, 1),
(95, 1),
(96, 1),
(97, 1),
(98, 1),
(99, 1),
(100, 1),
(101, 1),
(102, 1),
(103, 1),
(104, 1),
(105, 1),
(106, 1),
(107, 1),
(108, 1),
(109, 1),
(110, 1),
(111, 1),
(112, 1),
(113, 1),
(114, 1),
(115, 1),
(116, 1),
(117, 1),
(118, 1),
(119, 1),
(120, 1),
(121, 1),
(122, 1),
(123, 1),
(124, 1),
(125, 1),
(126, 1),
(127, 1),
(128, 1),
(129, 1),
(130, 1),
(131, 1),
(132, 1),
(133, 1),
(134, 1),
(135, 1),
(136, 1),
(137, 1),
(138, 1),
(139, 1),
(140, 1),
(141, 1),
(142, 1),
(143, 1),
(144, 1),
(145, 1),
(146, 1),
(147, 1),
(148, 1),
(149, 1),
(150, 1),
(151, 1),
(152, 1),
(153, 1),
(154, 1),
(155, 1),
(156, 1),
(157, 1),
(158, 1),
(159, 1),
(160, 1),
(161, 1),
(162, 1),
(163, 1),
(164, 1),
(165, 1),
(166, 1),
(167, 1),
(168, 1),
(169, 1),
(170, 1),
(171, 1),
(172, 1),
(173, 1),
(174, 1),
(175, 1),
(176, 1),
(177, 1),
(178, 1),
(179, 1),
(2, 2),
(5, 2),
(6, 2),
(7, 2),
(8, 2),
(9, 2),
(6, 3);

-- --------------------------------------------------------

--
-- Table structure for table `routes`
--

CREATE TABLE `routes` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `start_point` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `destination` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `estimated_distance` double DEFAULT NULL,
  `estimated_days` int DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '0',
  `created_by` bigint NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `route_costs`
--

CREATE TABLE `route_costs` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` double NOT NULL DEFAULT '0',
  `account_code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_by` bigint UNSIGNED NOT NULL,
  `cost_id` bigint UNSIGNED NOT NULL,
  `route_id` bigint UNSIGNED DEFAULT NULL,
  `currency_id` bigint UNSIGNED NOT NULL,
  `rate` double NOT NULL DEFAULT '0',
  `real_amount` double NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `quantity` double DEFAULT NULL,
  `vat` tinyint(1) NOT NULL DEFAULT '0',
  `editable` tinyint(1) NOT NULL DEFAULT '0',
  `type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'All',
  `advancable` int NOT NULL DEFAULT '0',
  `return` tinyint(1) NOT NULL DEFAULT '0',
  `status` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `service_purchases`
--

CREATE TABLE `service_purchases` (
  `id` bigint UNSIGNED NOT NULL,
  `supplier_id` bigint UNSIGNED DEFAULT NULL,
  `service_purchase_prefix` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `service_purchase_order_no` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `subject` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tax_amount` double DEFAULT NULL,
  `currency_symbol` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `currency_rate` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `subtotal` double DEFAULT NULL,
  `payment_amount` double DEFAULT NULL,
  `total` double DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `order_status` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `state` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `service_purchase_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `due_date` date DEFAULT NULL,
  `workshop_request_id` bigint DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '1',
  `purchase_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'workshop',
  `payment_level_status` int NOT NULL DEFAULT '0',
  `procurement_level_status` int NOT NULL DEFAULT '0',
  `created_by` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `tag` tinyint(1) NOT NULL DEFAULT '0',
  `offbudget_id` int DEFAULT NULL,
  `admin_id` int DEFAULT NULL,
  `retirement_id` int DEFAULT NULL,
  `transaction_charges` double DEFAULT NULL,
  `discount_amount` double DEFAULT NULL,
  `old_status` int DEFAULT NULL,
  `discount` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `service_purchase_items`
--

CREATE TABLE `service_purchase_items` (
  `id` bigint UNSIGNED NOT NULL,
  `service_purchase_id` bigint UNSIGNED NOT NULL,
  `service_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `price` double NOT NULL,
  `quantity` double NOT NULL,
  `tax_rate` double NOT NULL,
  `total` double NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `allocation_id` int DEFAULT NULL,
  `truck_cost_id` int DEFAULT NULL,
  `allocation_cost_id` int DEFAULT NULL,
  `retirement_id` int DEFAULT NULL,
  `discount_amount` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `service_purchase_remarks`
--

CREATE TABLE `service_purchase_remarks` (
  `id` bigint UNSIGNED NOT NULL,
  `service_purchase_id` bigint UNSIGNED NOT NULL,
  `remark` text COLLATE utf8mb4_unicode_ci,
  `remarked_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_by` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `stock_entries`
--

CREATE TABLE `stock_entries` (
  `id` bigint UNSIGNED NOT NULL,
  `company_id` bigint UNSIGNED NOT NULL,
  `voucher_id` bigint UNSIGNED NOT NULL,
  `stock_item_id` bigint UNSIGNED NOT NULL,
  `godown_id` bigint UNSIGNED NOT NULL,
  `quantity` decimal(15,2) NOT NULL,
  `rate` decimal(15,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `stock_groups`
--

CREATE TABLE `stock_groups` (
  `id` bigint UNSIGNED NOT NULL,
  `company_id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `parent_id` bigint UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `stock_groups`
--

INSERT INTO `stock_groups` (`id`, `company_id`, `name`, `parent_id`, `created_at`, `updated_at`) VALUES
(1, 1, 'Primary', NULL, '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(2, 1, 'Electronics', 1, '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(3, 1, 'Clothing', 1, '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(4, 1, 'Mobile Phones', 2, '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(5, 1, 'Shirts', 3, '2026-04-21 16:42:19', '2026-04-21 16:42:19');

-- --------------------------------------------------------

--
-- Table structure for table `stock_items`
--

CREATE TABLE `stock_items` (
  `id` bigint UNSIGNED NOT NULL,
  `company_id` bigint UNSIGNED NOT NULL,
  `stock_group_id` bigint UNSIGNED NOT NULL,
  `unit_id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `opening_stock` decimal(15,2) NOT NULL DEFAULT '0.00',
  `rate` decimal(15,2) NOT NULL DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `sub_accounts`
--

CREATE TABLE `sub_accounts` (
  `id` bigint UNSIGNED NOT NULL,
  `client_end_code` int DEFAULT NULL,
  `client_start_code` int DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `group_id` bigint UNSIGNED DEFAULT NULL,
  `start_code` int DEFAULT NULL,
  `end_code` int DEFAULT NULL,
  `amount` decimal(8,2) NOT NULL DEFAULT '0.00',
  `status` int NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sub_accounts`
--

INSERT INTO `sub_accounts` (`id`, `client_end_code`, `client_start_code`, `name`, `group_id`, `start_code`, `end_code`, `amount`, `status`, `created_at`, `updated_at`) VALUES
(1, 499, 1, 'PROPERTY,PLANTS AND EQUIPMENT(PPE)', 2, 1, NULL, 0.00, 1, '2023-05-15 14:57:02', '2023-12-05 02:33:21'),
(2, 999, 500, 'INTANGIBLE ASSETS', 2, 500, NULL, 0.00, 1, '2023-05-15 14:57:41', '2024-04-23 08:14:29'),
(3, 1099, 1000, 'BANK ACCOUNT', 3, 1000, NULL, 0.00, 1, '2023-05-15 14:59:12', '2023-12-05 03:20:45'),
(5, 1399, 1100, 'TRADE AND OTHER RECEIVABLES', 3, 1100, NULL, 0.00, 1, '2023-05-15 15:00:48', '2023-12-06 01:11:03'),
(6, 1899, 1600, 'STOCK', 3, 1600, NULL, 0.00, 1, NULL, '2023-12-06 02:48:35'),
(7, 2499, 2000, 'TRADE AND OTHER PAYABLES', 5, 2000, NULL, 0.00, 1, NULL, '2023-12-06 06:59:32'),
(13, 4000, 4000, 'TRANSPORT SALES', 8, 4000, NULL, 0.00, 1, NULL, '2023-12-06 17:59:04'),
(14, 4999, 4500, 'OTHER INCOMES', 8, 4500, NULL, 0.00, 1, NULL, '2023-12-06 18:01:47'),
(16, 5999, 5000, 'TRIP EXPENSES', 15, 5000, NULL, 0.00, 1, NULL, '2023-12-06 18:09:04'),
(17, 7299, 7000, 'STAFF COSTS', 16, 7000, NULL, 0.00, 1, NULL, '2024-04-25 02:57:15'),
(18, 8999, 8000, 'DEPRECIATION', 16, 8000, NULL, 0.00, 1, NULL, '2023-12-06 18:15:35'),
(19, 1599, 1400, 'CASH ACCOUNT', 3, 1400, NULL, 0.00, 1, NULL, '2023-12-06 18:16:48'),
(21, 2799, 2700, 'CURRENT TAXES', 5, 2700, NULL, 0.00, 1, '2023-12-06 06:49:27', '2024-04-23 08:12:48'),
(22, 2699, 2500, 'LONG TERM LOANS & BORROWINGS', 6, 2500, NULL, 0.00, 1, '2023-12-06 17:39:47', '2024-04-23 08:13:39'),
(23, 3499, 3001, 'ISSUED AND FULL PAID UP SHARES', 7, 3001, NULL, 0.00, 1, '2023-12-06 17:50:25', '2023-12-06 17:50:25'),
(24, 3999, 3400, 'RETAINED EARNINGS', 7, 3400, NULL, 0.00, 1, '2023-12-06 17:56:17', '2023-12-06 17:56:17'),
(25, 6999, 6000, 'WORKSHOP,REPAIR & MAINTENANCE', 15, 6000, NULL, 0.00, 1, '2023-12-06 18:12:12', '2024-04-25 02:16:06'),
(26, 1900, 1900, 'VAT CONTROL ACCOUNT', 3, 1900, NULL, 0.00, 1, '2024-04-25 00:26:59', '2024-04-25 00:29:08'),
(27, 1999, 1901, 'INCOME TAX RECOVERABLE', 3, 1901, NULL, 0.00, 1, '2024-04-25 00:30:14', '2024-04-25 00:30:14'),
(28, 8499, 7300, 'ADMINISTRATION EXPENSE', 16, 8000, NULL, 0.00, 1, '2024-04-25 00:42:02', '2024-04-25 02:57:56');

-- --------------------------------------------------------

--
-- Table structure for table `suppliers`
--

CREATE TABLE `suppliers` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(125) COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(125) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(125) COLLATE utf8mb4_unicode_ci NOT NULL,
  `company` varchar(125) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `credit_term` varchar(125) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` varchar(125) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tin_number` varchar(125) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `vrn_number` varchar(125) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bank_name` varchar(125) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bank_account` varchar(125) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_type` int NOT NULL DEFAULT '1',
  `status` tinyint(1) NOT NULL DEFAULT '1',
  `created_by` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `balance_ledger` int DEFAULT NULL,
  `region_id` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `system_logs`
--

CREATE TABLE `system_logs` (
  `id` bigint UNSIGNED NOT NULL,
  `process_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `narration` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `taxes`
--

CREATE TABLE `taxes` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rate` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` tinyint NOT NULL DEFAULT '1',
  `created_by` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `taxes`
--

INSERT INTO `taxes` (`id`, `name`, `rate`, `status`, `created_by`, `created_at`, `updated_at`) VALUES
(1, 'VAT', '18', 1, 8, '2023-05-15 21:35:19', '2023-05-15 21:35:19'),
(2, 'NO VAT', '0', 1, 57, '2023-06-13 22:07:02', '2023-06-15 21:10:39');

-- --------------------------------------------------------

--
-- Table structure for table `trailers`
--

CREATE TABLE `trailers` (
  `id` bigint UNSIGNED NOT NULL,
  `plate_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `purchase_date` date DEFAULT NULL,
  `amount` double DEFAULT NULL,
  `capacity` double NOT NULL,
  `manufacturer` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `length` double NOT NULL,
  `trailer_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '0',
  `added_by` bigint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `litre_capacity` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `trailer_assignments`
--

CREATE TABLE `trailer_assignments` (
  `id` bigint UNSIGNED NOT NULL,
  `trailer_id` bigint UNSIGNED NOT NULL,
  `truck_id` bigint UNSIGNED NOT NULL,
  `assigned_by` bigint UNSIGNED NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `transactions`
--

CREATE TABLE `transactions` (
  `id` bigint UNSIGNED NOT NULL,
  `ledger_id` bigint UNSIGNED DEFAULT NULL,
  `amount` decimal(18,2) NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type` int NOT NULL,
  `status` int NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `process` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `process_id` bigint DEFAULT NULL,
  `driver_id` bigint DEFAULT NULL,
  `created_by` bigint DEFAULT NULL,
  `category` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'General Expense',
  `currency_id` int DEFAULT NULL,
  `rate` double NOT NULL DEFAULT '1',
  `currency_value` int NOT NULL DEFAULT '1',
  `currency_log_id` int NOT NULL DEFAULT '1',
  `corridor_rate` double NOT NULL DEFAULT '1',
  `corridor_amount` double NOT NULL DEFAULT '0',
  `allocation_id` bigint UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `trips`
--

CREATE TABLE `trips` (
  `id` bigint UNSIGNED NOT NULL,
  `ref_no` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `allocation_id` bigint UNSIGNED NOT NULL,
  `initiated_date` date NOT NULL,
  `total_payment` double NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '1',
  `state` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_by` bigint UNSIGNED NOT NULL,
  `type` int NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `approval_status` int NOT NULL DEFAULT '0',
  `completion_approval_status` int NOT NULL DEFAULT '0',
  `invoiced_income` double NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `trip_costs`
--

CREATE TABLE `trip_costs` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` double NOT NULL,
  `trip_id` bigint UNSIGNED NOT NULL,
  `cost_id` bigint UNSIGNED NOT NULL,
  `status` tinyint NOT NULL,
  `created_by` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `return` tinyint NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `trip_invoices`
--

CREATE TABLE `trip_invoices` (
  `id` bigint UNSIGNED NOT NULL,
  `invoice_ref` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `allocation_id` bigint UNSIGNED NOT NULL,
  `amount` double NOT NULL,
  `currency_id` bigint UNSIGNED NOT NULL,
  `real_amount` double NOT NULL,
  `rate` double DEFAULT NULL,
  `start_date` date NOT NULL,
  `due_date` date NOT NULL,
  `credit_term` int NOT NULL DEFAULT '30',
  `vat` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'No',
  `status` int NOT NULL DEFAULT '0',
  `state` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `created_by` bigint UNSIGNED NOT NULL,
  `type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `account` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `note` text COLLATE utf8mb4_unicode_ci,
  `currency_log_id` int NOT NULL DEFAULT '1',
  `credit_amount` double NOT NULL DEFAULT '0',
  `payment_status` int NOT NULL DEFAULT '1',
  `paid_amount` double NOT NULL DEFAULT '0',
  `real_paid_amount` double NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `trip_invoice_payments`
--

CREATE TABLE `trip_invoice_payments` (
  `id` bigint UNSIGNED NOT NULL,
  `invoice_id` bigint NOT NULL,
  `amount` double NOT NULL,
  `currency_id` bigint NOT NULL,
  `real_amount` double NOT NULL,
  `remaining` double NOT NULL,
  `real_remaining` double NOT NULL,
  `rate` int NOT NULL,
  `paid_date` date DEFAULT NULL,
  `status` int NOT NULL DEFAULT '0',
  `state` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `created_by` bigint NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `payment_method` int DEFAULT NULL,
  `charges` double DEFAULT NULL,
  `currency_log_id` int NOT NULL DEFAULT '1',
  `credit_amount` double NOT NULL DEFAULT '0',
  `paid_amount` double NOT NULL DEFAULT '0',
  `real_paid_amount` double NOT NULL DEFAULT '0',
  `payment_status` int NOT NULL DEFAULT '1',
  `payment_id` text COLLATE utf8mb4_unicode_ci,
  `payment_item_id` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `trip_invoice_remarks`
--

CREATE TABLE `trip_invoice_remarks` (
  `id` bigint UNSIGNED NOT NULL,
  `invoice_id` bigint NOT NULL,
  `remark` text COLLATE utf8mb4_unicode_ci,
  `remarked_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_by` bigint NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `trip_remarks`
--

CREATE TABLE `trip_remarks` (
  `id` bigint UNSIGNED NOT NULL,
  `trip_id` bigint UNSIGNED NOT NULL,
  `remark` text COLLATE utf8mb4_unicode_ci,
  `remarked_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` bigint UNSIGNED NOT NULL DEFAULT '0',
  `created_by` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `trip_truck_remarks`
--

CREATE TABLE `trip_truck_remarks` (
  `id` bigint UNSIGNED NOT NULL,
  `truck_id` bigint UNSIGNED NOT NULL,
  `remark` text COLLATE utf8mb4_unicode_ci,
  `status` int NOT NULL DEFAULT '1',
  `remarked_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_by` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `trucks`
--

CREATE TABLE `trucks` (
  `id` bigint UNSIGNED NOT NULL,
  `purchase_date` date DEFAULT NULL,
  `plate_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `body_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `truck_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fuel_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'diesel',
  `fuel_capacity` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `trailer_connection` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `trailer_capacity` int NOT NULL DEFAULT '1',
  `transmission` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mileage` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `vehicle_model` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `manufacturer` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `year` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `color` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `engine_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `engine_capacity` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `gross_weight` double DEFAULT NULL,
  `location` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` int NOT NULL DEFAULT '0',
  `amount` double DEFAULT NULL,
  `capacity` double DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `added_by` bigint UNSIGNED DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `truck_allocations`
--

CREATE TABLE `truck_allocations` (
  `id` bigint UNSIGNED NOT NULL,
  `allocation_id` bigint UNSIGNED NOT NULL,
  `truck_id` bigint UNSIGNED NOT NULL,
  `trailer_id` bigint UNSIGNED NOT NULL,
  `driver_id` bigint UNSIGNED NOT NULL,
  `status` tinyint NOT NULL DEFAULT '0',
  `total_cost` double NOT NULL DEFAULT '0',
  `additional_cost` double NOT NULL DEFAULT '0',
  `income` double NOT NULL DEFAULT '0',
  `loaded` double NOT NULL DEFAULT '0',
  `offloaded` double NOT NULL DEFAULT '0',
  `loading_date` date DEFAULT NULL,
  `offload_date` date DEFAULT NULL,
  `currency` bigint UNSIGNED NOT NULL DEFAULT '0',
  `cost_status` int NOT NULL DEFAULT '0',
  `payment_status` int NOT NULL DEFAULT '0',
  `created_by` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `pod` varchar(250) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `rescue_status` int NOT NULL DEFAULT '0',
  `planned` double NOT NULL DEFAULT '0',
  `initiation_status` tinyint NOT NULL DEFAULT '0',
  `trip_status` tinyint NOT NULL DEFAULT '0',
  `usd_income` double NOT NULL DEFAULT '0',
  `mobilization` int NOT NULL DEFAULT '0',
  `mobilization_route` int DEFAULT NULL,
  `going_ref` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `return_ref` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `total_loss_amount` decimal(15,2) NOT NULL DEFAULT '0.00'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `truck_change_lists`
--

CREATE TABLE `truck_change_lists` (
  `id` bigint UNSIGNED NOT NULL,
  `change_id` bigint UNSIGNED NOT NULL,
  `truck_id` bigint NOT NULL,
  `allocation_id` bigint NOT NULL,
  `reason` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `action` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `requested_by` bigint UNSIGNED NOT NULL,
  `status` int NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `truck_change_remarks`
--

CREATE TABLE `truck_change_remarks` (
  `id` bigint UNSIGNED NOT NULL,
  `change_id` bigint UNSIGNED NOT NULL,
  `remark` text COLLATE utf8mb4_unicode_ci,
  `remarked_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_by` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `truck_change_requests`
--

CREATE TABLE `truck_change_requests` (
  `id` bigint UNSIGNED NOT NULL,
  `allocation_id` bigint UNSIGNED NOT NULL,
  `reason` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `requested_by` bigint UNSIGNED NOT NULL,
  `status` int NOT NULL,
  `approval_status` int NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `truck_costs`
--

CREATE TABLE `truck_costs` (
  `id` bigint UNSIGNED NOT NULL,
  `allocation_id` bigint NOT NULL,
  `truck_id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` double NOT NULL,
  `account_code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `route_id` bigint UNSIGNED DEFAULT NULL,
  `currency_id` bigint UNSIGNED NOT NULL,
  `rate` double NOT NULL,
  `real_amount` double NOT NULL,
  `status` int NOT NULL DEFAULT '0',
  `created_by` bigint UNSIGNED NOT NULL,
  `quantity` double DEFAULT NULL,
  `editable` tinyint(1) NOT NULL DEFAULT '0',
  `type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'All',
  `mobilization` int NOT NULL DEFAULT '0',
  `advancable` int NOT NULL DEFAULT '0',
  `return` tinyint(1) NOT NULL DEFAULT '0',
  `transaction_charges` double DEFAULT NULL,
  `service_charges` double DEFAULT NULL,
  `vat_charges` double DEFAULT NULL,
  `paid_amount` double DEFAULT NULL,
  `real_paid_amount` double DEFAULT NULL,
  `payment_status` int NOT NULL DEFAULT '1',
  `reason` text COLLATE utf8mb4_unicode_ci,
  `missing_status` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `truck_cost_payments`
--

CREATE TABLE `truck_cost_payments` (
  `id` bigint UNSIGNED NOT NULL,
  `truck_id` bigint UNSIGNED NOT NULL,
  `cost_id` bigint UNSIGNED NOT NULL,
  `paid_by` bigint UNSIGNED NOT NULL,
  `paid_date` date NOT NULL,
  `amount` double NOT NULL,
  `remain` int NOT NULL DEFAULT '0',
  `transaction_charges` double DEFAULT NULL,
  `service_charges` double DEFAULT NULL,
  `vat_charges` double DEFAULT NULL,
  `paid_amount` double DEFAULT NULL,
  `real_paid_amount` double DEFAULT NULL,
  `payment_status` int NOT NULL DEFAULT '1',
  `transfer` int NOT NULL DEFAULT '0',
  `reason` text COLLATE utf8mb4_unicode_ci,
  `station` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `currency_log_id` int NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `truck_manager_assignments`
--

CREATE TABLE `truck_manager_assignments` (
  `id` bigint UNSIGNED NOT NULL,
  `manager_id` bigint UNSIGNED DEFAULT NULL,
  `truck_id` bigint UNSIGNED DEFAULT NULL,
  `assigned_by` bigint UNSIGNED DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `truck_types`
--

CREATE TABLE `truck_types` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `added_by` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `truck_types`
--

INSERT INTO `truck_types` (`id`, `name`, `added_by`, `created_at`, `updated_at`) VALUES
(1, 'Semi', 1, '2026-04-21 16:42:16', '2026-04-21 16:42:16'),
(2, 'Pulling', 1, '2026-04-21 16:42:16', '2026-04-21 16:42:16'),
(3, 'Private', 1, '2026-04-21 16:42:17', '2026-04-21 16:42:17'),
(4, 'Tanker', 1, '2026-04-21 16:42:17', '2026-04-21 16:42:17');

-- --------------------------------------------------------

--
-- Table structure for table `units`
--

CREATE TABLE `units` (
  `id` bigint UNSIGNED NOT NULL,
  `company_id` bigint UNSIGNED DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `symbol` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_compound` tinyint(1) NOT NULL DEFAULT '0',
  `base_unit_id` bigint UNSIGNED DEFAULT NULL,
  `conversion_factor` decimal(10,2) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `status` int NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `units`
--

INSERT INTO `units` (`id`, `company_id`, `name`, `symbol`, `is_compound`, `base_unit_id`, `conversion_factor`, `created_at`, `updated_at`, `description`, `status`) VALUES
(1, NULL, 'Piece', 'pc', 0, NULL, NULL, '2026-04-21 16:42:19', '2026-04-21 16:42:19', 'Individual piece or item', 1),
(2, NULL, 'Kilogram', 'kg', 0, NULL, NULL, '2026-04-21 16:42:19', '2026-04-21 16:42:19', 'Weight in kilograms', 1),
(3, NULL, 'Liter', 'L', 0, NULL, NULL, '2026-04-21 16:42:19', '2026-04-21 16:42:19', 'Volume in liters', 1),
(4, NULL, 'Meter', 'm', 0, NULL, NULL, '2026-04-21 16:42:19', '2026-04-21 16:42:19', 'Length in meters', 1),
(5, NULL, 'Box', 'box', 0, NULL, NULL, '2026-04-21 16:42:19', '2026-04-21 16:42:19', 'Container box', 1),
(6, NULL, 'Pack', 'pack', 0, NULL, NULL, '2026-04-21 16:42:19', '2026-04-21 16:42:19', 'Package or bundle', 1),
(7, NULL, 'Set', 'set', 0, NULL, NULL, '2026-04-21 16:42:19', '2026-04-21 16:42:19', 'Complete set', 1),
(8, NULL, 'Dozen', 'doz', 0, NULL, NULL, '2026-04-21 16:42:19', '2026-04-21 16:42:19', 'Twelve pieces', 1),
(9, NULL, 'Gram', 'g', 0, NULL, NULL, '2026-04-21 16:42:19', '2026-04-21 16:42:19', 'Weight in grams', 1),
(10, NULL, 'Milliliter', 'ml', 0, NULL, NULL, '2026-04-21 16:42:19', '2026-04-21 16:42:19', 'Volume in milliliters', 1);

-- --------------------------------------------------------

--
-- Table structure for table `upload_requests`
--

CREATE TABLE `upload_requests` (
  `id` bigint UNSIGNED NOT NULL,
  `total_amount` decimal(10,2) NOT NULL,
  `total_quantity` int NOT NULL,
  `subject` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `upload_request_level_status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `upload_request_items`
--

CREATE TABLE `upload_request_items` (
  `id` bigint UNSIGNED NOT NULL,
  `upload_request_id` bigint UNSIGNED DEFAULT NULL,
  `trip_ref_no` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `truck_plate_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `narration` text COLLATE utf8mb4_unicode_ci,
  `type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `price` decimal(15,2) NOT NULL,
  `quantity` int NOT NULL,
  `total` decimal(15,2) NOT NULL,
  `currency_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `currency_rate` decimal(8,2) DEFAULT NULL,
  `real_amount` decimal(15,2) DEFAULT NULL,
  `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '1',
  `created_by` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `debit_ledger` int DEFAULT NULL,
  `transaction_charges` double DEFAULT NULL,
  `service_charges` double NOT NULL DEFAULT '0',
  `vat_charges` double NOT NULL DEFAULT '0',
  `payment_status` int NOT NULL DEFAULT '0',
  `paid_amount` double NOT NULL DEFAULT '0',
  `real_paid_amount` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `vouchers`
--

CREATE TABLE `vouchers` (
  `id` bigint UNSIGNED NOT NULL,
  `company_id` bigint UNSIGNED NOT NULL,
  `voucher_type_id` bigint UNSIGNED NOT NULL,
  `voucher_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `date` date NOT NULL,
  `narration` text COLLATE utf8mb4_unicode_ci,
  `amount` decimal(15,2) NOT NULL,
  `currency_id` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `voucher_entries`
--

CREATE TABLE `voucher_entries` (
  `id` bigint UNSIGNED NOT NULL,
  `voucher_id` bigint UNSIGNED NOT NULL,
  `ledger_id` bigint UNSIGNED NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `type` enum('debit','credit') COLLATE utf8mb4_unicode_ci NOT NULL,
  `cost_center_id` bigint UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `voucher_types`
--

CREATE TABLE `voucher_types` (
  `id` bigint UNSIGNED NOT NULL,
  `company_id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `prefix` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `numbering` enum('manual','auto') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'auto',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `voucher_types`
--

INSERT INTO `voucher_types` (`id`, `company_id`, `name`, `prefix`, `numbering`, `created_at`, `updated_at`) VALUES
(1, 1, 'Payment', 'PAY', 'auto', '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(2, 1, 'Receipt', 'REC', 'auto', '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(3, 1, 'Sales', 'SAL', 'auto', '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(4, 1, 'Purchase', 'PUR', 'auto', '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(5, 1, 'Journal', 'JRN', 'auto', '2026-04-21 16:42:19', '2026-04-21 16:42:19'),
(6, 1, 'Contra', 'CON', 'auto', '2026-04-21 16:42:19', '2026-04-21 16:42:19');

-- --------------------------------------------------------

--
-- Table structure for table `workshop_requests`
--

CREATE TABLE `workshop_requests` (
  `id` bigint UNSIGNED NOT NULL,
  `name` text COLLATE utf8mb4_unicode_ci,
  `jobcard_id` bigint UNSIGNED DEFAULT NULL,
  `department_id` bigint UNSIGNED DEFAULT NULL,
  `trip_id` bigint UNSIGNED DEFAULT NULL,
  `truck_id` bigint UNSIGNED DEFAULT NULL,
  `maintanance_id` bigint UNSIGNED DEFAULT NULL,
  `total_items` int DEFAULT NULL,
  `requested_by_id` bigint UNSIGNED DEFAULT NULL,
  `approved_by` bigint UNSIGNED DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `date` datetime DEFAULT NULL,
  `request_status` tinyint NOT NULL DEFAULT '0',
  `show_tab` tinyint NOT NULL DEFAULT '0',
  `status` tinyint NOT NULL DEFAULT '0',
  `breakdown_id` bigint UNSIGNED DEFAULT NULL,
  `level` int NOT NULL DEFAULT '1',
  `requested_date` datetime DEFAULT NULL,
  `issued_date` datetime DEFAULT NULL,
  `tag` int NOT NULL DEFAULT '0',
  `real_amount` decimal(15,2) NOT NULL DEFAULT '0.00',
  `lashing_gear` int NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `workshop_request_items`
--

CREATE TABLE `workshop_request_items` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `workshop_request_id` bigint UNSIGNED NOT NULL,
  `retail_id` bigint UNSIGNED DEFAULT NULL,
  `truck_id` bigint UNSIGNED DEFAULT NULL,
  `trip_id` bigint UNSIGNED DEFAULT NULL,
  `department_id` bigint UNSIGNED DEFAULT NULL,
  `jobcard_id` bigint UNSIGNED DEFAULT NULL,
  `quantity` int NOT NULL,
  `remain_quantity` int DEFAULT NULL,
  `spare_comment` text COLLATE utf8mb4_unicode_ci,
  `tag` tinyint NOT NULL DEFAULT '0' COMMENT '0 = default/dispatch_by_quantity, 1 = serial-number',
  `received_date` date DEFAULT NULL COMMENT 'for items when marked as completed/received',
  `date` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` tinyint NOT NULL DEFAULT '0',
  `price` decimal(15,2) DEFAULT NULL,
  `breakdown_id` bigint DEFAULT NULL,
  `maintanance_id` bigint DEFAULT NULL,
  `requested_date` datetime DEFAULT NULL,
  `issued_date` datetime DEFAULT NULL,
  `inspection_id` bigint UNSIGNED DEFAULT NULL,
  `real_amount` decimal(15,2) NOT NULL DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `account_groups`
--
ALTER TABLE `account_groups`
  ADD PRIMARY KEY (`id`),
  ADD KEY `account_groups_company_id_foreign` (`company_id`),
  ADD KEY `account_groups_parent_id_foreign` (`parent_id`);

--
-- Indexes for table `account_types`
--
ALTER TABLE `account_types`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `administration_costs`
--
ALTER TABLE `administration_costs`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `allocations`
--
ALTER TABLE `allocations`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `allocation_costs`
--
ALTER TABLE `allocation_costs`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `allocation_cost_payments`
--
ALTER TABLE `allocation_cost_payments`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `allocation_reference_settings`
--
ALTER TABLE `allocation_reference_settings`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `allocation_reference_settings_type_unique` (`type`),
  ADD KEY `allocation_reference_settings_type_index` (`type`);

--
-- Indexes for table `allocation_remarks`
--
ALTER TABLE `allocation_remarks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `allocation_remarks_allocation_id_foreign` (`allocation_id`),
  ADD KEY `allocation_remarks_created_by_foreign` (`created_by`);

--
-- Indexes for table `approvals`
--
ALTER TABLE `approvals`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `approvals_process_name_unique` (`process_name`);

--
-- Indexes for table `approval_levels`
--
ALTER TABLE `approval_levels`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `approval_levels_approval_id_level_name_unique` (`approval_id`,`level_name`);

--
-- Indexes for table `audits`
--
ALTER TABLE `audits`
  ADD PRIMARY KEY (`id`),
  ADD KEY `audits_auditable_type_auditable_id_index` (`auditable_type`,`auditable_id`),
  ADD KEY `audits_user_id_user_type_index` (`user_id`,`user_type`);

--
-- Indexes for table `batches`
--
ALTER TABLE `batches`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `breakdowns`
--
ALTER TABLE `breakdowns`
  ADD PRIMARY KEY (`id`),
  ADD KEY `breakdowns_truck_id_foreign` (`truck_id`),
  ADD KEY `breakdowns_trip_id_foreign` (`trip_id`),
  ADD KEY `breakdowns_breakdown_category_id_foreign` (`breakdown_category_id`),
  ADD KEY `breakdowns_breakdown_item_id_foreign` (`breakdown_item_id`),
  ADD KEY `breakdowns_added_by_id_foreign` (`added_by_id`),
  ADD KEY `breakdowns_currency_id_foreign` (`currency_id`),
  ADD KEY `breakdowns_new_cost_currency_id_foreign` (`new_cost_currency_id`),
  ADD KEY `breakdowns_closed_by_id_foreign` (`closed_by_id`);

--
-- Indexes for table `breakdown_categories`
--
ALTER TABLE `breakdown_categories`
  ADD PRIMARY KEY (`id`),
  ADD KEY `breakdown_categories_created_by_id_foreign` (`created_by_id`);

--
-- Indexes for table `breakdown_expenses`
--
ALTER TABLE `breakdown_expenses`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `breakdown_items`
--
ALTER TABLE `breakdown_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `breakdown_items_breakdown_category_id_foreign` (`breakdown_category_id`),
  ADD KEY `breakdown_items_currency_id_foreign` (`currency_id`);

--
-- Indexes for table `cargo_natures`
--
ALTER TABLE `cargo_natures`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `categories`
--
ALTER TABLE `categories`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `common_bulk_expenses`
--
ALTER TABLE `common_bulk_expenses`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `common_costs`
--
ALTER TABLE `common_costs`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `common_costs_name_unique` (`name`);

--
-- Indexes for table `companies`
--
ALTER TABLE `companies`
  ADD PRIMARY KEY (`id`),
  ADD KEY `companies_user_id_foreign` (`user_id`),
  ADD KEY `companies_currency_id_foreign` (`currency_id`);

--
-- Indexes for table `cost_categories`
--
ALTER TABLE `cost_categories`
  ADD PRIMARY KEY (`id`),
  ADD KEY `cost_categories_company_id_foreign` (`company_id`);

--
-- Indexes for table `cost_centers`
--
ALTER TABLE `cost_centers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `cost_centers_company_id_foreign` (`company_id`),
  ADD KEY `cost_centers_cost_category_id_foreign` (`cost_category_id`);

--
-- Indexes for table `credit_notes`
--
ALTER TABLE `credit_notes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `credit_notes_currency_id_foreign` (`currency_id`),
  ADD KEY `credit_notes_created_by_foreign` (`created_by`);

--
-- Indexes for table `credit_note_remarks`
--
ALTER TABLE `credit_note_remarks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `credit_note_remarks_note_id_foreign` (`note_id`);

--
-- Indexes for table `credit_note_trucks`
--
ALTER TABLE `credit_note_trucks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `credit_note_trucks_note_id_foreign` (`note_id`),
  ADD KEY `credit_note_trucks_truck_id_foreign` (`truck_id`),
  ADD KEY `credit_note_trucks_invoice_id_foreign` (`invoice_id`);

--
-- Indexes for table `currencies`
--
ALTER TABLE `currencies`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `currency_logs`
--
ALTER TABLE `currency_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `currency_logs_created_by_foreign` (`created_by`);

--
-- Indexes for table `currency_log_items`
--
ALTER TABLE `currency_log_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `currency_log_items_currency_id_foreign` (`currency_id`),
  ADD KEY `currency_log_items_created_by_foreign` (`created_by`),
  ADD KEY `currency_log_items_currency_log_id_currency_id_created_by_index` (`currency_log_id`,`currency_id`,`created_by`);

--
-- Indexes for table `customers`
--
ALTER TABLE `customers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customers_created_by_foreign` (`created_by`);

--
-- Indexes for table `debit_notes`
--
ALTER TABLE `debit_notes`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `debit_note_remarks`
--
ALTER TABLE `debit_note_remarks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `debit_note_remarks_note_id_foreign` (`note_id`),
  ADD KEY `debit_note_remarks_created_by_foreign` (`created_by`);

--
-- Indexes for table `debit_note_trucks`
--
ALTER TABLE `debit_note_trucks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `debit_note_trucks_note_id_foreign` (`note_id`),
  ADD KEY `debit_note_trucks_truck_id_foreign` (`truck_id`),
  ADD KEY `debit_note_trucks_invoice_id_foreign` (`invoice_id`),
  ADD KEY `debit_note_trucks_currency_id_foreign` (`currency_id`),
  ADD KEY `debit_note_trucks_created_by_foreign` (`created_by`);

--
-- Indexes for table `departments`
--
ALTER TABLE `departments`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `departments_name_unique` (`name`),
  ADD KEY `departments_hod_foreign` (`hod`),
  ADD KEY `departments_created_by_foreign` (`created_by`);

--
-- Indexes for table `driver_assignments`
--
ALTER TABLE `driver_assignments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `driver_assignments_driver_id_truck_id_index` (`driver_id`,`truck_id`);

--
-- Indexes for table `driver_attachments`
--
ALTER TABLE `driver_attachments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `driver_attachments_driver_id_foreign` (`driver_id`);

--
-- Indexes for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`);

--
-- Indexes for table `fuel_costs`
--
ALTER TABLE `fuel_costs`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `fuel_costs_name_unique` (`name`);

--
-- Indexes for table `fund_types`
--
ALTER TABLE `fund_types`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `godowns`
--
ALTER TABLE `godowns`
  ADD PRIMARY KEY (`id`),
  ADD KEY `godowns_company_id_foreign` (`company_id`);

--
-- Indexes for table `godown_stocks`
--
ALTER TABLE `godown_stocks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `godown_stocks_company_id_foreign` (`company_id`),
  ADD KEY `godown_stocks_stock_item_id_foreign` (`stock_item_id`),
  ADD KEY `godown_stocks_godown_id_foreign` (`godown_id`);

--
-- Indexes for table `group_accounts`
--
ALTER TABLE `group_accounts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `group_accounts_type_id_foreign` (`type_id`);

--
-- Indexes for table `invoiced_trucks`
--
ALTER TABLE `invoiced_trucks`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `invoiced_truck_incomes`
--
ALTER TABLE `invoiced_truck_incomes`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `jobcards`
--
ALTER TABLE `jobcards`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `ledgers`
--
ALTER TABLE `ledgers`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `license_payments`
--
ALTER TABLE `license_payments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `license_payments_license_request_id_foreign` (`license_request_id`);

--
-- Indexes for table `license_requests`
--
ALTER TABLE `license_requests`
  ADD PRIMARY KEY (`id`),
  ADD KEY `license_requests_license_type_id_foreign` (`license_type_id`),
  ADD KEY `license_requests_batch_id_foreign` (`batch_id`),
  ADD KEY `license_requests_user_id_foreign` (`user_id`);

--
-- Indexes for table `license_request_trailer`
--
ALTER TABLE `license_request_trailer`
  ADD PRIMARY KEY (`id`),
  ADD KEY `license_request_trailer_license_request_id_foreign` (`license_request_id`),
  ADD KEY `license_request_trailer_trailer_id_foreign` (`trailer_id`);

--
-- Indexes for table `license_request_truck`
--
ALTER TABLE `license_request_truck`
  ADD PRIMARY KEY (`id`),
  ADD KEY `license_request_truck_license_request_id_foreign` (`license_request_id`),
  ADD KEY `license_request_truck_truck_id_foreign` (`truck_id`);

--
-- Indexes for table `license_types`
--
ALTER TABLE `license_types`
  ADD PRIMARY KEY (`id`),
  ADD KEY `license_types_ledger_id_foreign` (`ledger_id`);

--
-- Indexes for table `messages`
--
ALTER TABLE `messages`
  ADD PRIMARY KEY (`id`),
  ADD KEY `messages_sender_id_foreign` (`sender_id`),
  ADD KEY `messages_receiver_id_foreign` (`receiver_id`);

--
-- Indexes for table `message_attachments`
--
ALTER TABLE `message_attachments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `message_attachments_message_id_foreign` (`message_id`);

--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `mobilization_costs`
--
ALTER TABLE `mobilization_costs`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `mobilization_routes`
--
ALTER TABLE `mobilization_routes`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `model_has_permissions`
--
ALTER TABLE `model_has_permissions`
  ADD PRIMARY KEY (`permission_id`,`model_id`,`model_type`),
  ADD KEY `model_has_permissions_model_id_model_type_index` (`model_id`,`model_type`);

--
-- Indexes for table `model_has_roles`
--
ALTER TABLE `model_has_roles`
  ADD PRIMARY KEY (`role_id`,`model_id`,`model_type`),
  ADD KEY `model_has_roles_model_id_model_type_index` (`model_id`,`model_type`);

--
-- Indexes for table `notifications`
--
ALTER TABLE `notifications`
  ADD PRIMARY KEY (`id`),
  ADD KEY `notifications_user_id_foreign` (`user_id`);

--
-- Indexes for table `offbudget_remarks`
--
ALTER TABLE `offbudget_remarks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `offbudget_remarks_offbudget_id_foreign` (`offbudget_id`),
  ADD KEY `offbudget_remarks_created_by_foreign` (`created_by`);

--
-- Indexes for table `off_budgets`
--
ALTER TABLE `off_budgets`
  ADD PRIMARY KEY (`id`),
  ADD KEY `off_budgets_truck_id_foreign` (`truck_id`),
  ADD KEY `off_budgets_trip_id_foreign` (`trip_id`),
  ADD KEY `off_budgets_currency_id_foreign` (`currency_id`);

--
-- Indexes for table `off_budget_categories`
--
ALTER TABLE `off_budget_categories`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `org_regions`
--
ALTER TABLE `org_regions`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `payment_methods`
--
ALTER TABLE `payment_methods`
  ADD PRIMARY KEY (`id`),
  ADD KEY `payment_methods_ledger_id_created_by_index` (`ledger_id`,`created_by`);

--
-- Indexes for table `payment_modes`
--
ALTER TABLE `payment_modes`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `permissions`
--
ALTER TABLE `permissions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `permissions_name_guard_name_unique` (`name`,`guard_name`);

--
-- Indexes for table `personnel_assignments`
--
ALTER TABLE `personnel_assignments`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `personnel_expenses`
--
ALTER TABLE `personnel_expenses`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `positions`
--
ALTER TABLE `positions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `positions_slug_unique` (`slug`);

--
-- Indexes for table `process_ledgers`
--
ALTER TABLE `process_ledgers`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `process_ledger_mappers`
--
ALTER TABLE `process_ledger_mappers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `process_ledger_mappers_process_id_foreign` (`process_id`);

--
-- Indexes for table `purchase_delivery_notes`
--
ALTER TABLE `purchase_delivery_notes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `purchase_delivery_notes_created_by_foreign` (`created_by`);

--
-- Indexes for table `remarks`
--
ALTER TABLE `remarks`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `retails`
--
ALTER TABLE `retails`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `retail_units`
--
ALTER TABLE `retail_units`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `roles`
--
ALTER TABLE `roles`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `roles_name_guard_name_unique` (`name`,`guard_name`);

--
-- Indexes for table `role_has_permissions`
--
ALTER TABLE `role_has_permissions`
  ADD PRIMARY KEY (`permission_id`,`role_id`),
  ADD KEY `role_has_permissions_role_id_foreign` (`role_id`);

--
-- Indexes for table `routes`
--
ALTER TABLE `routes`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `routes_name_unique` (`name`);

--
-- Indexes for table `route_costs`
--
ALTER TABLE `route_costs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `route_costs_created_by_foreign` (`created_by`),
  ADD KEY `route_costs_cost_id_foreign` (`cost_id`),
  ADD KEY `route_costs_currency_id_foreign` (`currency_id`),
  ADD KEY `route_costs_route_id_cost_id_index` (`route_id`,`cost_id`);

--
-- Indexes for table `service_purchases`
--
ALTER TABLE `service_purchases`
  ADD PRIMARY KEY (`id`),
  ADD KEY `service_purchases_supplier_id_foreign` (`supplier_id`);

--
-- Indexes for table `service_purchase_items`
--
ALTER TABLE `service_purchase_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `service_purchase_items_service_purchase_id_foreign` (`service_purchase_id`);

--
-- Indexes for table `service_purchase_remarks`
--
ALTER TABLE `service_purchase_remarks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `service_purchase_remarks_service_purchase_id_foreign` (`service_purchase_id`),
  ADD KEY `service_purchase_remarks_created_by_foreign` (`created_by`);

--
-- Indexes for table `stock_entries`
--
ALTER TABLE `stock_entries`
  ADD PRIMARY KEY (`id`),
  ADD KEY `stock_entries_company_id_foreign` (`company_id`),
  ADD KEY `stock_entries_voucher_id_foreign` (`voucher_id`),
  ADD KEY `stock_entries_stock_item_id_foreign` (`stock_item_id`),
  ADD KEY `stock_entries_godown_id_foreign` (`godown_id`);

--
-- Indexes for table `stock_groups`
--
ALTER TABLE `stock_groups`
  ADD PRIMARY KEY (`id`),
  ADD KEY `stock_groups_company_id_foreign` (`company_id`),
  ADD KEY `stock_groups_parent_id_foreign` (`parent_id`);

--
-- Indexes for table `stock_items`
--
ALTER TABLE `stock_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `stock_items_company_id_foreign` (`company_id`),
  ADD KEY `stock_items_stock_group_id_foreign` (`stock_group_id`),
  ADD KEY `stock_items_unit_id_foreign` (`unit_id`);

--
-- Indexes for table `sub_accounts`
--
ALTER TABLE `sub_accounts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sub_accounts_group_id_foreign` (`group_id`);

--
-- Indexes for table `suppliers`
--
ALTER TABLE `suppliers`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `system_logs`
--
ALTER TABLE `system_logs`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `taxes`
--
ALTER TABLE `taxes`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `trailers`
--
ALTER TABLE `trailers`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `trailers_plate_number_unique` (`plate_number`);

--
-- Indexes for table `trailer_assignments`
--
ALTER TABLE `trailer_assignments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `trailer_assignments_trailer_id_truck_id_index` (`trailer_id`,`truck_id`);

--
-- Indexes for table `transactions`
--
ALTER TABLE `transactions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `transactions_ledger_id_foreign` (`ledger_id`),
  ADD KEY `transactions_allocation_id_foreign` (`allocation_id`);

--
-- Indexes for table `trips`
--
ALTER TABLE `trips`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `trip_costs`
--
ALTER TABLE `trip_costs`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `trip_invoices`
--
ALTER TABLE `trip_invoices`
  ADD PRIMARY KEY (`id`),
  ADD KEY `trip_invoices_allocation_id_foreign` (`allocation_id`),
  ADD KEY `trip_invoices_currency_id_foreign` (`currency_id`),
  ADD KEY `trip_invoices_created_by_foreign` (`created_by`);

--
-- Indexes for table `trip_invoice_payments`
--
ALTER TABLE `trip_invoice_payments`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `trip_invoice_remarks`
--
ALTER TABLE `trip_invoice_remarks`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `trip_remarks`
--
ALTER TABLE `trip_remarks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `trip_remarks_trip_id_foreign` (`trip_id`);

--
-- Indexes for table `trip_truck_remarks`
--
ALTER TABLE `trip_truck_remarks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `trip_truck_remarks_truck_id_foreign` (`truck_id`),
  ADD KEY `trip_truck_remarks_created_by_foreign` (`created_by`);

--
-- Indexes for table `trucks`
--
ALTER TABLE `trucks`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `trucks_plate_number_unique` (`plate_number`),
  ADD KEY `trucks_added_by_foreign` (`added_by`);

--
-- Indexes for table `truck_allocations`
--
ALTER TABLE `truck_allocations`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `truck_change_lists`
--
ALTER TABLE `truck_change_lists`
  ADD PRIMARY KEY (`id`),
  ADD KEY `truck_change_lists_change_id_foreign` (`change_id`),
  ADD KEY `truck_change_lists_requested_by_foreign` (`requested_by`);

--
-- Indexes for table `truck_change_remarks`
--
ALTER TABLE `truck_change_remarks`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `truck_change_requests`
--
ALTER TABLE `truck_change_requests`
  ADD PRIMARY KEY (`id`),
  ADD KEY `truck_change_requests_allocation_id_foreign` (`allocation_id`),
  ADD KEY `truck_change_requests_requested_by_foreign` (`requested_by`);

--
-- Indexes for table `truck_costs`
--
ALTER TABLE `truck_costs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `truck_costs_truck_id_foreign` (`truck_id`),
  ADD KEY `truck_costs_route_id_foreign` (`route_id`),
  ADD KEY `truck_costs_currency_id_foreign` (`currency_id`);

--
-- Indexes for table `truck_cost_payments`
--
ALTER TABLE `truck_cost_payments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `truck_cost_payments_truck_id_foreign` (`truck_id`),
  ADD KEY `truck_cost_payments_cost_id_foreign` (`cost_id`),
  ADD KEY `truck_cost_payments_paid_by_foreign` (`paid_by`);

--
-- Indexes for table `truck_manager_assignments`
--
ALTER TABLE `truck_manager_assignments`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `truck_types`
--
ALTER TABLE `truck_types`
  ADD PRIMARY KEY (`id`),
  ADD KEY `truck_types_added_by_foreign` (`added_by`);

--
-- Indexes for table `units`
--
ALTER TABLE `units`
  ADD PRIMARY KEY (`id`),
  ADD KEY `units_company_id_foreign` (`company_id`),
  ADD KEY `units_base_unit_id_foreign` (`base_unit_id`);

--
-- Indexes for table `upload_requests`
--
ALTER TABLE `upload_requests`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `upload_request_items`
--
ALTER TABLE `upload_request_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `upload_request_items_upload_request_id_foreign` (`upload_request_id`);

--
-- Indexes for table `vouchers`
--
ALTER TABLE `vouchers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `vouchers_company_id_foreign` (`company_id`),
  ADD KEY `vouchers_voucher_type_id_foreign` (`voucher_type_id`),
  ADD KEY `vouchers_currency_id_foreign` (`currency_id`);

--
-- Indexes for table `voucher_entries`
--
ALTER TABLE `voucher_entries`
  ADD PRIMARY KEY (`id`),
  ADD KEY `voucher_entries_voucher_id_foreign` (`voucher_id`),
  ADD KEY `voucher_entries_ledger_id_foreign` (`ledger_id`),
  ADD KEY `voucher_entries_cost_center_id_foreign` (`cost_center_id`);

--
-- Indexes for table `voucher_types`
--
ALTER TABLE `voucher_types`
  ADD PRIMARY KEY (`id`),
  ADD KEY `voucher_types_company_id_foreign` (`company_id`);

--
-- Indexes for table `workshop_requests`
--
ALTER TABLE `workshop_requests`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `workshop_request_items`
--
ALTER TABLE `workshop_request_items`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `account_groups`
--
ALTER TABLE `account_groups`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;

--
-- AUTO_INCREMENT for table `account_types`
--
ALTER TABLE `account_types`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `administration_costs`
--
ALTER TABLE `administration_costs`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `allocations`
--
ALTER TABLE `allocations`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `allocation_costs`
--
ALTER TABLE `allocation_costs`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `allocation_cost_payments`
--
ALTER TABLE `allocation_cost_payments`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `allocation_reference_settings`
--
ALTER TABLE `allocation_reference_settings`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `allocation_remarks`
--
ALTER TABLE `allocation_remarks`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `approvals`
--
ALTER TABLE `approvals`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `approval_levels`
--
ALTER TABLE `approval_levels`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `audits`
--
ALTER TABLE `audits`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `batches`
--
ALTER TABLE `batches`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `breakdowns`
--
ALTER TABLE `breakdowns`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `breakdown_categories`
--
ALTER TABLE `breakdown_categories`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `breakdown_expenses`
--
ALTER TABLE `breakdown_expenses`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `breakdown_items`
--
ALTER TABLE `breakdown_items`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `cargo_natures`
--
ALTER TABLE `cargo_natures`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `categories`
--
ALTER TABLE `categories`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;

--
-- AUTO_INCREMENT for table `common_bulk_expenses`
--
ALTER TABLE `common_bulk_expenses`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=38;

--
-- AUTO_INCREMENT for table `common_costs`
--
ALTER TABLE `common_costs`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=109;

--
-- AUTO_INCREMENT for table `companies`
--
ALTER TABLE `companies`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `cost_categories`
--
ALTER TABLE `cost_categories`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `cost_centers`
--
ALTER TABLE `cost_centers`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `credit_notes`
--
ALTER TABLE `credit_notes`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `credit_note_remarks`
--
ALTER TABLE `credit_note_remarks`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `credit_note_trucks`
--
ALTER TABLE `credit_note_trucks`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `currencies`
--
ALTER TABLE `currencies`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `currency_logs`
--
ALTER TABLE `currency_logs`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `currency_log_items`
--
ALTER TABLE `currency_log_items`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `customers`
--
ALTER TABLE `customers`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `debit_notes`
--
ALTER TABLE `debit_notes`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `debit_note_remarks`
--
ALTER TABLE `debit_note_remarks`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `debit_note_trucks`
--
ALTER TABLE `debit_note_trucks`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `departments`
--
ALTER TABLE `departments`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `driver_assignments`
--
ALTER TABLE `driver_assignments`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `driver_attachments`
--
ALTER TABLE `driver_attachments`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `fuel_costs`
--
ALTER TABLE `fuel_costs`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `fund_types`
--
ALTER TABLE `fund_types`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `godowns`
--
ALTER TABLE `godowns`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `godown_stocks`
--
ALTER TABLE `godown_stocks`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `group_accounts`
--
ALTER TABLE `group_accounts`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;

--
-- AUTO_INCREMENT for table `invoiced_trucks`
--
ALTER TABLE `invoiced_trucks`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `invoiced_truck_incomes`
--
ALTER TABLE `invoiced_truck_incomes`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `jobcards`
--
ALTER TABLE `jobcards`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ledgers`
--
ALTER TABLE `ledgers`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=151;

--
-- AUTO_INCREMENT for table `license_payments`
--
ALTER TABLE `license_payments`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `license_requests`
--
ALTER TABLE `license_requests`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `license_request_trailer`
--
ALTER TABLE `license_request_trailer`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `license_request_truck`
--
ALTER TABLE `license_request_truck`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `license_types`
--
ALTER TABLE `license_types`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `messages`
--
ALTER TABLE `messages`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `message_attachments`
--
ALTER TABLE `message_attachments`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=146;

--
-- AUTO_INCREMENT for table `mobilization_costs`
--
ALTER TABLE `mobilization_costs`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `mobilization_routes`
--
ALTER TABLE `mobilization_routes`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `notifications`
--
ALTER TABLE `notifications`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `offbudget_remarks`
--
ALTER TABLE `offbudget_remarks`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `off_budgets`
--
ALTER TABLE `off_budgets`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `off_budget_categories`
--
ALTER TABLE `off_budget_categories`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `org_regions`
--
ALTER TABLE `org_regions`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31;

--
-- AUTO_INCREMENT for table `payment_methods`
--
ALTER TABLE `payment_methods`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `payment_modes`
--
ALTER TABLE `payment_modes`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `permissions`
--
ALTER TABLE `permissions`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=180;

--
-- AUTO_INCREMENT for table `personnel_assignments`
--
ALTER TABLE `personnel_assignments`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `personnel_expenses`
--
ALTER TABLE `personnel_expenses`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `positions`
--
ALTER TABLE `positions`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT for table `process_ledgers`
--
ALTER TABLE `process_ledgers`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=29;

--
-- AUTO_INCREMENT for table `process_ledger_mappers`
--
ALTER TABLE `process_ledger_mappers`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `purchase_delivery_notes`
--
ALTER TABLE `purchase_delivery_notes`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `remarks`
--
ALTER TABLE `remarks`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `retails`
--
ALTER TABLE `retails`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT for table `retail_units`
--
ALTER TABLE `retail_units`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `roles`
--
ALTER TABLE `roles`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `routes`
--
ALTER TABLE `routes`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `route_costs`
--
ALTER TABLE `route_costs`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `service_purchases`
--
ALTER TABLE `service_purchases`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `service_purchase_items`
--
ALTER TABLE `service_purchase_items`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `service_purchase_remarks`
--
ALTER TABLE `service_purchase_remarks`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `stock_entries`
--
ALTER TABLE `stock_entries`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `stock_groups`
--
ALTER TABLE `stock_groups`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `stock_items`
--
ALTER TABLE `stock_items`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `sub_accounts`
--
ALTER TABLE `sub_accounts`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=29;

--
-- AUTO_INCREMENT for table `suppliers`
--
ALTER TABLE `suppliers`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `system_logs`
--
ALTER TABLE `system_logs`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `taxes`
--
ALTER TABLE `taxes`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `trailers`
--
ALTER TABLE `trailers`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `trailer_assignments`
--
ALTER TABLE `trailer_assignments`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `transactions`
--
ALTER TABLE `transactions`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `trips`
--
ALTER TABLE `trips`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `trip_costs`
--
ALTER TABLE `trip_costs`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `trip_invoices`
--
ALTER TABLE `trip_invoices`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `trip_invoice_payments`
--
ALTER TABLE `trip_invoice_payments`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `trip_invoice_remarks`
--
ALTER TABLE `trip_invoice_remarks`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `trip_remarks`
--
ALTER TABLE `trip_remarks`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `trip_truck_remarks`
--
ALTER TABLE `trip_truck_remarks`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `trucks`
--
ALTER TABLE `trucks`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `truck_allocations`
--
ALTER TABLE `truck_allocations`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `truck_change_lists`
--
ALTER TABLE `truck_change_lists`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `truck_change_remarks`
--
ALTER TABLE `truck_change_remarks`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `truck_change_requests`
--
ALTER TABLE `truck_change_requests`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `truck_costs`
--
ALTER TABLE `truck_costs`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `truck_cost_payments`
--
ALTER TABLE `truck_cost_payments`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `truck_manager_assignments`
--
ALTER TABLE `truck_manager_assignments`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `truck_types`
--
ALTER TABLE `truck_types`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `units`
--
ALTER TABLE `units`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT for table `upload_requests`
--
ALTER TABLE `upload_requests`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `upload_request_items`
--
ALTER TABLE `upload_request_items`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vouchers`
--
ALTER TABLE `vouchers`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `voucher_entries`
--
ALTER TABLE `voucher_entries`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `voucher_types`
--
ALTER TABLE `voucher_types`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `workshop_requests`
--
ALTER TABLE `workshop_requests`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `workshop_request_items`
--
ALTER TABLE `workshop_request_items`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `account_groups`
--
ALTER TABLE `account_groups`
  ADD CONSTRAINT `account_groups_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `account_groups_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `account_groups` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `allocation_remarks`
--
ALTER TABLE `allocation_remarks`
  ADD CONSTRAINT `allocation_remarks_allocation_id_foreign` FOREIGN KEY (`allocation_id`) REFERENCES `allocations` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `allocation_remarks_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `breakdowns`
--
ALTER TABLE `breakdowns`
  ADD CONSTRAINT `breakdowns_added_by_id_foreign` FOREIGN KEY (`added_by_id`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `breakdowns_breakdown_category_id_foreign` FOREIGN KEY (`breakdown_category_id`) REFERENCES `breakdown_categories` (`id`),
  ADD CONSTRAINT `breakdowns_breakdown_item_id_foreign` FOREIGN KEY (`breakdown_item_id`) REFERENCES `breakdown_items` (`id`),
  ADD CONSTRAINT `breakdowns_closed_by_id_foreign` FOREIGN KEY (`closed_by_id`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `breakdowns_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`),
  ADD CONSTRAINT `breakdowns_new_cost_currency_id_foreign` FOREIGN KEY (`new_cost_currency_id`) REFERENCES `currencies` (`id`),
  ADD CONSTRAINT `breakdowns_trip_id_foreign` FOREIGN KEY (`trip_id`) REFERENCES `trips` (`id`),
  ADD CONSTRAINT `breakdowns_truck_id_foreign` FOREIGN KEY (`truck_id`) REFERENCES `trucks` (`id`);

--
-- Constraints for table `breakdown_categories`
--
ALTER TABLE `breakdown_categories`
  ADD CONSTRAINT `breakdown_categories_created_by_id_foreign` FOREIGN KEY (`created_by_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `breakdown_items`
--
ALTER TABLE `breakdown_items`
  ADD CONSTRAINT `breakdown_items_breakdown_category_id_foreign` FOREIGN KEY (`breakdown_category_id`) REFERENCES `breakdown_categories` (`id`),
  ADD CONSTRAINT `breakdown_items_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`);

--
-- Constraints for table `companies`
--
ALTER TABLE `companies`
  ADD CONSTRAINT `companies_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE RESTRICT,
  ADD CONSTRAINT `companies_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `cost_categories`
--
ALTER TABLE `cost_categories`
  ADD CONSTRAINT `cost_categories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `cost_centers`
--
ALTER TABLE `cost_centers`
  ADD CONSTRAINT `cost_centers_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `cost_centers_cost_category_id_foreign` FOREIGN KEY (`cost_category_id`) REFERENCES `cost_categories` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `credit_notes`
--
ALTER TABLE `credit_notes`
  ADD CONSTRAINT `credit_notes_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `credit_notes_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`);

--
-- Constraints for table `credit_note_remarks`
--
ALTER TABLE `credit_note_remarks`
  ADD CONSTRAINT `credit_note_remarks_note_id_foreign` FOREIGN KEY (`note_id`) REFERENCES `credit_notes` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `credit_note_trucks`
--
ALTER TABLE `credit_note_trucks`
  ADD CONSTRAINT `credit_note_trucks_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `trip_invoices` (`id`),
  ADD CONSTRAINT `credit_note_trucks_note_id_foreign` FOREIGN KEY (`note_id`) REFERENCES `credit_notes` (`id`),
  ADD CONSTRAINT `credit_note_trucks_truck_id_foreign` FOREIGN KEY (`truck_id`) REFERENCES `trucks` (`id`);

--
-- Constraints for table `currency_logs`
--
ALTER TABLE `currency_logs`
  ADD CONSTRAINT `currency_logs_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT;

--
-- Constraints for table `currency_log_items`
--
ALTER TABLE `currency_log_items`
  ADD CONSTRAINT `currency_log_items_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT,
  ADD CONSTRAINT `currency_log_items_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE RESTRICT,
  ADD CONSTRAINT `currency_log_items_currency_log_id_foreign` FOREIGN KEY (`currency_log_id`) REFERENCES `currency_logs` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `customers`
--
ALTER TABLE `customers`
  ADD CONSTRAINT `customers_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`);

--
-- Constraints for table `debit_note_remarks`
--
ALTER TABLE `debit_note_remarks`
  ADD CONSTRAINT `debit_note_remarks_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `debit_note_remarks_note_id_foreign` FOREIGN KEY (`note_id`) REFERENCES `debit_notes` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `debit_note_trucks`
--
ALTER TABLE `debit_note_trucks`
  ADD CONSTRAINT `debit_note_trucks_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `debit_note_trucks_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`),
  ADD CONSTRAINT `debit_note_trucks_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `trip_invoices` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `debit_note_trucks_note_id_foreign` FOREIGN KEY (`note_id`) REFERENCES `debit_notes` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `debit_note_trucks_truck_id_foreign` FOREIGN KEY (`truck_id`) REFERENCES `trucks` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `departments`
--
ALTER TABLE `departments`
  ADD CONSTRAINT `departments_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `departments_hod_foreign` FOREIGN KEY (`hod`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `driver_attachments`
--
ALTER TABLE `driver_attachments`
  ADD CONSTRAINT `driver_attachments_driver_id_foreign` FOREIGN KEY (`driver_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `godowns`
--
ALTER TABLE `godowns`
  ADD CONSTRAINT `godowns_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `godown_stocks`
--
ALTER TABLE `godown_stocks`
  ADD CONSTRAINT `godown_stocks_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `godown_stocks_godown_id_foreign` FOREIGN KEY (`godown_id`) REFERENCES `godowns` (`id`) ON DELETE RESTRICT,
  ADD CONSTRAINT `godown_stocks_stock_item_id_foreign` FOREIGN KEY (`stock_item_id`) REFERENCES `stock_items` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `group_accounts`
--
ALTER TABLE `group_accounts`
  ADD CONSTRAINT `group_accounts_type_id_foreign` FOREIGN KEY (`type_id`) REFERENCES `account_types` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `license_payments`
--
ALTER TABLE `license_payments`
  ADD CONSTRAINT `license_payments_license_request_id_foreign` FOREIGN KEY (`license_request_id`) REFERENCES `license_requests` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `license_requests`
--
ALTER TABLE `license_requests`
  ADD CONSTRAINT `license_requests_batch_id_foreign` FOREIGN KEY (`batch_id`) REFERENCES `batches` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `license_requests_license_type_id_foreign` FOREIGN KEY (`license_type_id`) REFERENCES `license_types` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `license_requests_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `license_request_trailer`
--
ALTER TABLE `license_request_trailer`
  ADD CONSTRAINT `license_request_trailer_license_request_id_foreign` FOREIGN KEY (`license_request_id`) REFERENCES `license_requests` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `license_request_trailer_trailer_id_foreign` FOREIGN KEY (`trailer_id`) REFERENCES `trailers` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `license_request_truck`
--
ALTER TABLE `license_request_truck`
  ADD CONSTRAINT `license_request_truck_license_request_id_foreign` FOREIGN KEY (`license_request_id`) REFERENCES `license_requests` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `license_request_truck_truck_id_foreign` FOREIGN KEY (`truck_id`) REFERENCES `trucks` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `license_types`
--
ALTER TABLE `license_types`
  ADD CONSTRAINT `license_types_ledger_id_foreign` FOREIGN KEY (`ledger_id`) REFERENCES `ledgers` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `messages`
--
ALTER TABLE `messages`
  ADD CONSTRAINT `messages_receiver_id_foreign` FOREIGN KEY (`receiver_id`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `messages_sender_id_foreign` FOREIGN KEY (`sender_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `message_attachments`
--
ALTER TABLE `message_attachments`
  ADD CONSTRAINT `message_attachments_message_id_foreign` FOREIGN KEY (`message_id`) REFERENCES `messages` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `model_has_permissions`
--
ALTER TABLE `model_has_permissions`
  ADD CONSTRAINT `model_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `model_has_roles`
--
ALTER TABLE `model_has_roles`
  ADD CONSTRAINT `model_has_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `notifications`
--
ALTER TABLE `notifications`
  ADD CONSTRAINT `notifications_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `offbudget_remarks`
--
ALTER TABLE `offbudget_remarks`
  ADD CONSTRAINT `offbudget_remarks_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `offbudget_remarks_offbudget_id_foreign` FOREIGN KEY (`offbudget_id`) REFERENCES `off_budgets` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `off_budgets`
--
ALTER TABLE `off_budgets`
  ADD CONSTRAINT `off_budgets_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `off_budgets_trip_id_foreign` FOREIGN KEY (`trip_id`) REFERENCES `trips` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `off_budgets_truck_id_foreign` FOREIGN KEY (`truck_id`) REFERENCES `trucks` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `process_ledger_mappers`
--
ALTER TABLE `process_ledger_mappers`
  ADD CONSTRAINT `process_ledger_mappers_process_id_foreign` FOREIGN KEY (`process_id`) REFERENCES `process_ledgers` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `purchase_delivery_notes`
--
ALTER TABLE `purchase_delivery_notes`
  ADD CONSTRAINT `purchase_delivery_notes_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`);

--
-- Constraints for table `role_has_permissions`
--
ALTER TABLE `role_has_permissions`
  ADD CONSTRAINT `role_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `role_has_permissions_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `route_costs`
--
ALTER TABLE `route_costs`
  ADD CONSTRAINT `route_costs_cost_id_foreign` FOREIGN KEY (`cost_id`) REFERENCES `common_costs` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `route_costs_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT,
  ADD CONSTRAINT `route_costs_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE RESTRICT,
  ADD CONSTRAINT `route_costs_route_id_foreign` FOREIGN KEY (`route_id`) REFERENCES `routes` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `service_purchases`
--
ALTER TABLE `service_purchases`
  ADD CONSTRAINT `service_purchases_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `service_purchase_items`
--
ALTER TABLE `service_purchase_items`
  ADD CONSTRAINT `service_purchase_items_service_purchase_id_foreign` FOREIGN KEY (`service_purchase_id`) REFERENCES `service_purchases` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `service_purchase_remarks`
--
ALTER TABLE `service_purchase_remarks`
  ADD CONSTRAINT `service_purchase_remarks_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `service_purchase_remarks_service_purchase_id_foreign` FOREIGN KEY (`service_purchase_id`) REFERENCES `service_purchases` (`id`);

--
-- Constraints for table `stock_entries`
--
ALTER TABLE `stock_entries`
  ADD CONSTRAINT `stock_entries_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `stock_entries_godown_id_foreign` FOREIGN KEY (`godown_id`) REFERENCES `godowns` (`id`) ON DELETE RESTRICT,
  ADD CONSTRAINT `stock_entries_stock_item_id_foreign` FOREIGN KEY (`stock_item_id`) REFERENCES `stock_items` (`id`) ON DELETE RESTRICT,
  ADD CONSTRAINT `stock_entries_voucher_id_foreign` FOREIGN KEY (`voucher_id`) REFERENCES `vouchers` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `stock_groups`
--
ALTER TABLE `stock_groups`
  ADD CONSTRAINT `stock_groups_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `stock_groups_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `stock_groups` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `stock_items`
--
ALTER TABLE `stock_items`
  ADD CONSTRAINT `stock_items_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `stock_items_stock_group_id_foreign` FOREIGN KEY (`stock_group_id`) REFERENCES `stock_groups` (`id`) ON DELETE RESTRICT,
  ADD CONSTRAINT `stock_items_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE RESTRICT;

--
-- Constraints for table `sub_accounts`
--
ALTER TABLE `sub_accounts`
  ADD CONSTRAINT `sub_accounts_group_id_foreign` FOREIGN KEY (`group_id`) REFERENCES `group_accounts` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `transactions`
--
ALTER TABLE `transactions`
  ADD CONSTRAINT `transactions_allocation_id_foreign` FOREIGN KEY (`allocation_id`) REFERENCES `truck_allocations` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `transactions_ledger_id_foreign` FOREIGN KEY (`ledger_id`) REFERENCES `ledgers` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `trip_invoices`
--
ALTER TABLE `trip_invoices`
  ADD CONSTRAINT `trip_invoices_allocation_id_foreign` FOREIGN KEY (`allocation_id`) REFERENCES `allocations` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `trip_invoices_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `trip_invoices_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `trip_remarks`
--
ALTER TABLE `trip_remarks`
  ADD CONSTRAINT `trip_remarks_trip_id_foreign` FOREIGN KEY (`trip_id`) REFERENCES `trips` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `trip_truck_remarks`
--
ALTER TABLE `trip_truck_remarks`
  ADD CONSTRAINT `trip_truck_remarks_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `trip_truck_remarks_truck_id_foreign` FOREIGN KEY (`truck_id`) REFERENCES `trucks` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `trucks`
--
ALTER TABLE `trucks`
  ADD CONSTRAINT `trucks_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `truck_change_lists`
--
ALTER TABLE `truck_change_lists`
  ADD CONSTRAINT `truck_change_lists_change_id_foreign` FOREIGN KEY (`change_id`) REFERENCES `truck_change_requests` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `truck_change_lists_requested_by_foreign` FOREIGN KEY (`requested_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `truck_change_requests`
--
ALTER TABLE `truck_change_requests`
  ADD CONSTRAINT `truck_change_requests_allocation_id_foreign` FOREIGN KEY (`allocation_id`) REFERENCES `truck_allocations` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `truck_change_requests_requested_by_foreign` FOREIGN KEY (`requested_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `truck_costs`
--
ALTER TABLE `truck_costs`
  ADD CONSTRAINT `truck_costs_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `truck_costs_route_id_foreign` FOREIGN KEY (`route_id`) REFERENCES `routes` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `truck_costs_truck_id_foreign` FOREIGN KEY (`truck_id`) REFERENCES `trucks` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `truck_cost_payments`
--
ALTER TABLE `truck_cost_payments`
  ADD CONSTRAINT `truck_cost_payments_cost_id_foreign` FOREIGN KEY (`cost_id`) REFERENCES `truck_costs` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `truck_cost_payments_paid_by_foreign` FOREIGN KEY (`paid_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `truck_cost_payments_truck_id_foreign` FOREIGN KEY (`truck_id`) REFERENCES `trucks` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `truck_types`
--
ALTER TABLE `truck_types`
  ADD CONSTRAINT `truck_types_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `units`
--
ALTER TABLE `units`
  ADD CONSTRAINT `units_base_unit_id_foreign` FOREIGN KEY (`base_unit_id`) REFERENCES `units` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `units_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `upload_request_items`
--
ALTER TABLE `upload_request_items`
  ADD CONSTRAINT `upload_request_items_upload_request_id_foreign` FOREIGN KEY (`upload_request_id`) REFERENCES `upload_requests` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vouchers`
--
ALTER TABLE `vouchers`
  ADD CONSTRAINT `vouchers_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `vouchers_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE RESTRICT,
  ADD CONSTRAINT `vouchers_voucher_type_id_foreign` FOREIGN KEY (`voucher_type_id`) REFERENCES `voucher_types` (`id`) ON DELETE RESTRICT;

--
-- Constraints for table `voucher_entries`
--
ALTER TABLE `voucher_entries`
  ADD CONSTRAINT `voucher_entries_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `voucher_entries_ledger_id_foreign` FOREIGN KEY (`ledger_id`) REFERENCES `ledgers` (`id`) ON DELETE RESTRICT,
  ADD CONSTRAINT `voucher_entries_voucher_id_foreign` FOREIGN KEY (`voucher_id`) REFERENCES `vouchers` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `voucher_types`
--
ALTER TABLE `voucher_types`
  ADD CONSTRAINT `voucher_types_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE;
COMMIT;

