--
-- Host: localhost    Database: loan_new
-- ------------------------------------------------------


--
-- Table structure for table `activations`
--

CREATE TABLE `activations` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned NOT NULL,
  `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `completed` tinyint(1) NOT NULL DEFAULT '0',
  `completed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `activations`
--

INSERT INTO `activations` VALUES (1,1,'rP38dIpxalNh3mSdffcHVUwrR2pTVBLD',1,'2022-09-27 08:15:14','2022-09-27 08:15:14','2022-09-27 08:15:14'),(2,2,'kcNxosSTjdtG8XPo1OxM3EGS5ixVVQbS',1,'2022-09-27 11:42:32','2022-09-27 11:42:32','2022-09-27 11:42:32'),(3,3,'j57Wh5yNXBSN04suFMcilcms0pB8kb8y',1,'2022-09-27 13:23:56','2022-09-27 13:23:56','2022-09-27 13:23:56'),(4,4,'6z0kDInsqayLXVwaIfVuAJh1hWXyH4go',1,'2022-09-27 13:25:11','2022-09-27 13:25:11','2022-09-27 13:25:11'),(5,5,'8gt9zB2JtMGgTVWjRs9tQrgXESrn8KAz',1,'2022-12-28 10:32:40','2022-12-28 10:32:40','2022-12-28 10:32:40'),(6,6,'TDKQKMqjtZbnRIGvfSOJbTcR4IH5HGfH',1,'2023-01-09 08:10:49','2023-01-09 08:10:49','2023-01-09 08:10:49');

--
-- Table structure for table `asset_types`
--

CREATE TABLE `asset_types` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `type` enum('current','fixed','intangible','investment','other') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `asset_types`
--

INSERT INTO `asset_types` VALUES (1,'office equipment\r\n',NULL);

--
-- Table structure for table `asset_valuations`
--

CREATE TABLE `asset_valuations` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `asset_id` int DEFAULT NULL,
  `date` date DEFAULT NULL,
  `amount` decimal(65,4) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `asset_valuations`
--

INSERT INTO `asset_valuations` VALUES (1,1,1,'2022-09-28',1.0000,'2022-09-27 13:45:07','2022-09-27 13:45:07');

--
-- Table structure for table `assets`
--

CREATE TABLE `assets` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `asset_type_id` int DEFAULT NULL,
  `purchase_date` date DEFAULT NULL,
  `purchase_price` decimal(65,4) DEFAULT NULL,
  `replacement_value` decimal(65,4) DEFAULT NULL,
  `serial_number` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `bought_from` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `files` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `branch_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `assets_id_index` (`id`),
  KEY `assets_purchase_date_index` (`purchase_date`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `assets`
--

INSERT INTO `assets` VALUES (1,1,1,NULL,10.0000,NULL,'445465',NULL,NULL,'a:0:{}','2022-09-27 13:45:07','2022-09-27 13:45:07',1);

--
-- Table structure for table `audit_trail`
--

CREATE TABLE `audit_trail` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned DEFAULT NULL,
  `user` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `module` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `branch_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `audit_trail_id_index` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=250 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `audit_trail`
--

INSERT INTO `audit_trail` VALUES (1,1,'Admin Admin',NULL,'Logged in to system','2022-09-27 08:15:37','2022-09-27 08:15:37',NULL),(2,1,'Admin Admin',NULL,'Logged in to system','2022-09-27 11:17:52','2022-09-27 11:17:52',NULL),(3,1,'Admin Admin',NULL,'Updated Settings','2022-09-27 11:18:28','2022-09-27 11:18:28',1),(4,1,'Admin Admin',NULL,'Updated user with id:1','2022-09-27 11:18:55','2022-09-27 11:18:55',1),(5,1,'Admin Admin',NULL,'Added borrower  with id:1','2022-09-27 11:19:46','2022-09-27 11:19:46',1),(6,1,'Admin Admin',NULL,'Added loan with id:1','2022-09-27 11:21:25','2022-09-27 11:21:25',1),(7,1,'Admin Admin',NULL,'Added user with id:2','2022-09-27 11:42:32','2022-09-27 11:42:32',1),(8,1,'Admin Admin',NULL,'Updated user with id:2','2022-09-27 11:45:27','2022-09-27 11:45:27',1),(9,1,'Admin Admin',NULL,'Updated role with id:2','2022-09-27 13:11:04','2022-09-27 13:11:04',1),(10,1,'Admin Admin',NULL,'Updated user with id:2','2022-09-27 13:17:06','2022-09-27 13:17:06',1),(11,2,'tet te',NULL,'Logged in to system','2022-09-27 13:17:11','2022-09-27 13:17:11',NULL),(12,1,'Admin Admin',NULL,'Added user with id:4','2022-09-27 13:25:11','2022-09-27 13:25:11',1),(13,4,'Co Co',NULL,'Logged in to system','2022-09-27 13:26:38','2022-09-27 13:26:38',NULL),(14,1,'Admin Admin',NULL,'Updated role with id:2','2022-09-27 13:26:54','2022-09-27 13:26:54',1),(15,1,'Admin Admin',NULL,'Updated role with id:2','2022-09-27 13:27:21','2022-09-27 13:27:21',1),(16,1,'Admin Admin',NULL,'Updated role with id:2','2022-09-27 13:28:01','2022-09-27 13:28:01',1),(17,4,'Co Co',NULL,'Added collateral  with id:1','2022-09-27 13:30:48','2022-09-27 13:30:48',1),(18,1,'Admin Admin',NULL,'Added asset  with id:1','2022-09-27 13:45:07','2022-09-27 13:45:07',1),(19,1,'Admin Admin',NULL,'Logged in to system','2022-09-28 05:46:10','2022-09-28 05:46:10',NULL),(20,1,'Admin Admin',NULL,'Logged in to system','2022-09-28 13:44:24','2022-09-28 13:44:24',NULL),(21,1,'Admin Admin',NULL,'Updated user with id:1','2022-09-28 14:22:43','2022-09-28 14:22:43',1),(22,1,'Admin Admin',NULL,'Logged in to system','2022-09-29 06:51:23','2022-09-29 06:51:23',NULL),(23,1,'Admin Admin',NULL,'Logged out of system','2022-09-29 07:11:15','2022-09-29 07:11:15',1),(24,1,'Admin Admin',NULL,'Logged in to system','2022-09-29 07:11:22','2022-09-29 07:11:22',1),(25,1,'Admin Admin',NULL,'Logged in to system','2022-09-29 07:27:07','2022-09-29 07:27:07',1),(26,1,'Admin Admin',NULL,'Logged in to system','2022-09-29 08:30:25','2022-09-29 08:30:25',NULL),(27,1,'Admin Admin',NULL,'Approved loan with id:1','2022-09-29 08:31:00','2022-09-29 08:31:00',1),(28,1,'Admin Admin',NULL,'Disbursed loan with id:1','2022-09-29 08:41:49','2022-09-29 08:41:49',1),(29,1,'Admin Admin',NULL,'Added repayment for loan with id:1','2022-09-29 08:55:21','2022-09-29 08:55:21',1),(30,1,'Admin Admin',NULL,'Logged in to system','2022-10-08 15:18:42','2022-10-08 15:18:42',NULL),(31,1,'Admin Admin',NULL,'Declined borrower  with id:1','2022-10-08 15:18:47','2022-10-08 15:18:47',1),(32,1,'Admin Admin',NULL,'Logged in to system','2022-10-16 09:53:33','2022-10-16 09:53:33',NULL),(33,1,'Admin Admin',NULL,'Approved borrower  with id:1','2022-10-16 09:55:37','2022-10-16 09:55:37',1),(34,1,'Admin Admin',NULL,'Added repayment for loan with id:1','2022-10-16 09:56:19','2022-10-16 09:56:19',1),(35,1,'Admin Admin',NULL,'Logged in to system','2022-10-18 15:29:23','2022-10-18 15:29:23',NULL),(36,1,'Admin Admin',NULL,'Logged in to system','2022-10-18 15:30:28','2022-10-18 15:30:28',NULL),(37,1,'Admin Admin',NULL,'Added loan with id:2','2022-10-18 15:32:56','2022-10-18 15:32:56',1),(38,1,'Admin Admin',NULL,'Approved loan with id:2','2022-10-18 15:33:10','2022-10-18 15:33:10',1),(39,1,'Admin Admin',NULL,'Disbursed loan with id:2','2022-10-18 15:34:16','2022-10-18 15:34:16',1),(40,1,'Admin Admin',NULL,'Logged out of system','2022-10-18 15:47:50','2022-10-18 15:47:50',1),(41,1,'Admin Admin',NULL,'Logged in to system','2022-10-18 15:47:57','2022-10-18 15:47:57',1),(42,1,'Admin Admin',NULL,'Logged out of system','2022-10-18 16:19:55','2022-10-18 16:19:55',1),(43,1,'Admin Admin',NULL,'Logged in to system','2022-10-18 16:19:59','2022-10-18 16:19:59',1),(44,1,'Admin Admin',NULL,'Logged in to system','2022-10-19 13:55:12','2022-10-19 13:55:12',NULL),(45,1,'Admin Admin',NULL,'Logged in to system','2022-10-21 09:17:37','2022-10-21 09:17:37',NULL),(46,1,'Admin Admin',NULL,'Logged in to system','2022-10-21 09:17:38','2022-10-21 09:17:38',1),(47,1,'Admin Admin',NULL,'Logged in to system','2022-10-21 10:20:57','2022-10-21 10:20:57',NULL),(48,1,'Admin Admin',NULL,'Added borrower  with id:2','2022-10-21 10:26:01','2022-10-21 10:26:01',1),(49,1,'Admin Admin',NULL,'Added loan with id:3','2022-10-21 10:28:21','2022-10-21 10:28:21',1),(50,1,'Admin Admin',NULL,'Approved loan with id:3','2022-10-21 10:29:48','2022-10-21 10:29:48',1),(51,1,'Admin Admin',NULL,'Disbursed loan with id:3','2022-10-21 10:31:43','2022-10-21 10:31:43',1),(52,1,'Admin Admin',NULL,'Logged in to system','2022-10-22 10:36:18','2022-10-22 10:36:18',NULL),(53,1,'Admin Admin',NULL,'Logged in to system','2022-10-22 18:51:40','2022-10-22 18:51:40',NULL),(54,1,'Admin Admin',NULL,'Logged in to system','2022-10-27 18:17:58','2022-10-27 18:17:58',NULL),(55,1,'Admin Admin',NULL,'Logged in to system','2022-10-28 08:49:05','2022-10-28 08:49:05',NULL),(56,1,'Admin Admin',NULL,'Logged in to system','2022-10-28 10:49:08','2022-10-28 10:49:08',1),(57,1,'Admin Admin',NULL,'Logged in to system','2022-10-28 13:33:08','2022-10-28 13:33:08',NULL),(58,1,'Admin Admin',NULL,'Logged in to system','2022-10-28 15:53:52','2022-10-28 15:53:52',NULL),(59,1,'Admin Admin',NULL,'Logged in to system','2022-10-28 15:54:54','2022-10-28 15:54:54',NULL),(60,1,'Admin Admin',NULL,'Logged in to system','2022-10-29 02:03:52','2022-10-29 02:03:52',NULL),(61,1,'Admin Admin',NULL,'Logged in to system','2022-10-30 12:00:37','2022-10-30 12:00:37',NULL),(62,1,'Admin Admin',NULL,'Logged in to system','2022-11-03 11:03:45','2022-11-03 11:03:45',NULL),(63,1,'Admin Admin',NULL,'Logged in to system','2022-11-03 11:30:46','2022-11-03 11:30:46',NULL),(64,1,'Admin Admin',NULL,'Undisbursed loan with id:3','2022-11-03 11:31:26','2022-11-03 11:31:26',1),(65,1,'Admin Admin',NULL,'Disbursed loan with id:3','2022-11-03 11:31:46','2022-11-03 11:31:46',1),(66,1,'Admin Admin',NULL,'Undisbursed loan with id:3','2022-11-03 11:32:07','2022-11-03 11:32:07',1),(67,1,'Admin Admin',NULL,'Updated loan with id:3','2022-11-03 11:32:39','2022-11-03 11:32:39',1),(68,1,'Admin Admin',NULL,'Disbursed loan with id:3','2022-11-03 11:32:58','2022-11-03 11:32:58',1),(69,1,'Admin Admin',NULL,'Updated loan with id:3','2022-11-03 11:35:33','2022-11-03 11:35:33',1),(70,1,'Admin Admin',NULL,'Undisbursed loan with id:3','2022-11-03 11:35:41','2022-11-03 11:35:41',1),(71,1,'Admin Admin',NULL,'Updated loan with id:3','2022-11-03 11:36:10','2022-11-03 11:36:10',1),(72,1,'Admin Admin',NULL,'Updated loan with id:3','2022-11-03 11:36:32','2022-11-03 11:36:32',1),(73,1,'Admin Admin',NULL,'Disbursed loan with id:3','2022-11-03 11:36:43','2022-11-03 11:36:43',1),(74,1,'Admin Admin',NULL,'Undisbursed loan with id:3','2022-11-03 11:37:28','2022-11-03 11:37:28',1),(75,1,'Admin Admin',NULL,'Updated loan with id:3','2022-11-03 11:38:08','2022-11-03 11:38:08',1),(76,1,'Admin Admin',NULL,'Disbursed loan with id:3','2022-11-03 11:38:17','2022-11-03 11:38:17',1),(77,1,'Admin Admin',NULL,'Undisbursed loan with id:3','2022-11-03 11:39:51','2022-11-03 11:39:51',1),(78,1,'Admin Admin',NULL,'Updated loan with id:3','2022-11-03 11:40:15','2022-11-03 11:40:15',1),(79,1,'Admin Admin',NULL,'Disbursed loan with id:3','2022-11-03 11:40:25','2022-11-03 11:40:25',1),(80,1,'Admin Admin',NULL,'Undisbursed loan with id:3','2022-11-03 11:40:49','2022-11-03 11:40:49',1),(81,1,'Admin Admin',NULL,'Updated loan with id:3','2022-11-03 11:41:04','2022-11-03 11:41:04',1),(82,1,'Admin Admin',NULL,'Disbursed loan with id:3','2022-11-03 11:41:11','2022-11-03 11:41:11',1),(83,1,'Admin Admin',NULL,'Undisbursed loan with id:3','2022-11-03 11:42:41','2022-11-03 11:42:41',1),(84,1,'Admin Admin',NULL,'Updated loan with id:3','2022-11-03 11:42:50','2022-11-03 11:42:50',1),(85,1,'Admin Admin',NULL,'Disbursed loan with id:3','2022-11-03 11:42:57','2022-11-03 11:42:57',1),(86,1,'Admin Admin',NULL,'Logged out of system','2022-11-03 11:44:34','2022-11-03 11:44:34',1),(87,1,'Admin Admin',NULL,'Logged in to system','2022-11-03 13:49:52','2022-11-03 13:49:52',NULL),(88,1,'Admin Admin',NULL,'Logged in to system','2022-11-05 14:47:15','2022-11-05 14:47:15',NULL),(89,1,'Admin Admin',NULL,'Logged in to system','2022-11-11 11:39:04','2022-11-11 11:39:04',NULL),(90,1,'Admin Admin',NULL,'Logged in to system','2022-11-14 04:24:13','2022-11-14 04:24:13',NULL),(91,1,'Admin Admin',NULL,'Logged in to system','2022-11-14 04:24:15','2022-11-14 04:24:15',1),(92,1,'Admin Admin',NULL,'Updated loan with id:3','2022-11-14 04:25:01','2022-11-14 04:25:01',1),(93,1,'Admin Admin',NULL,'Undisbursed loan with id:3','2022-11-14 04:25:54','2022-11-14 04:25:54',1),(94,1,'Admin Admin',NULL,'Disbursed loan with id:3','2022-11-14 04:26:12','2022-11-14 04:26:12',1),(95,1,'Admin Admin',NULL,'Undisbursed loan with id:3','2022-11-14 04:28:10','2022-11-14 04:28:10',1),(96,1,'Admin Admin',NULL,'Disbursed loan with id:3','2022-11-14 04:28:18','2022-11-14 04:28:18',1),(97,1,'Admin Admin',NULL,'Updated loan with id:3','2022-11-14 04:28:27','2022-11-14 04:28:27',1),(98,1,'Admin Admin',NULL,'Undisbursed loan with id:3','2022-11-14 04:38:27','2022-11-14 04:38:27',1),(99,1,'Admin Admin',NULL,'Updated loan with id:3','2022-11-14 04:38:49','2022-11-14 04:38:49',1),(100,1,'Admin Admin',NULL,'Disbursed loan with id:3','2022-11-14 04:38:59','2022-11-14 04:38:59',1),(101,1,'Admin Admin',NULL,'Updated loan with id:3','2022-11-14 05:14:50','2022-11-14 05:14:50',1),(102,1,'Admin Admin',NULL,'Undisbursed loan with id:3','2022-11-14 05:15:00','2022-11-14 05:15:00',1),(103,1,'Admin Admin',NULL,'Disbursed loan with id:3','2022-11-14 05:15:06','2022-11-14 05:15:06',1),(104,1,'Admin Admin',NULL,'Updated loan with id:3','2022-11-14 05:16:10','2022-11-14 05:16:10',1),(105,1,'Admin Admin',NULL,'Undisbursed loan with id:3','2022-11-14 05:16:21','2022-11-14 05:16:21',1),(106,1,'Admin Admin',NULL,'Disbursed loan with id:3','2022-11-14 05:16:26','2022-11-14 05:16:26',1),(107,1,'Admin Admin',NULL,'Logged in to system','2022-11-14 08:06:19','2022-11-14 08:06:19',NULL),(108,1,'Admin Admin',NULL,'Logged in to system','2022-11-14 08:06:47','2022-11-14 08:06:47',1),(109,1,'Admin Admin',NULL,'Logged in to system','2022-11-16 14:58:57','2022-11-16 14:58:57',NULL),(110,1,'Admin Admin',NULL,'Added borrower  with id:3','2022-11-16 15:08:51','2022-11-16 15:08:51',1),(111,1,'Admin Admin',NULL,'Added loan with id:4','2022-11-16 15:09:50','2022-11-16 15:09:50',1),(112,1,'Admin Admin',NULL,'Approved loan with id:4','2022-11-16 15:09:59','2022-11-16 15:09:59',1),(113,1,'Admin Admin',NULL,'Disbursed loan with id:4','2022-11-16 15:10:05','2022-11-16 15:10:05',1),(114,1,'Admin Admin',NULL,'Logged in to system','2022-11-18 09:16:49','2022-11-18 09:16:49',NULL),(115,1,'Admin Admin',NULL,'Declined borrower  with id:2','2022-11-18 09:17:24','2022-11-18 09:17:24',1),(116,1,'Admin Admin',NULL,'Approved borrower  with id:2','2022-11-18 09:17:33','2022-11-18 09:17:33',1),(117,1,'Admin Admin',NULL,'Logged in to system','2022-11-18 09:18:38','2022-11-18 09:18:38',NULL),(118,1,'Admin Admin',NULL,'Added loan with id:5','2022-11-18 09:50:53','2022-11-18 09:50:53',1),(119,1,'Admin Admin',NULL,'Approved loan with id:5','2022-11-18 09:51:07','2022-11-18 09:51:07',1),(120,1,'Admin Admin',NULL,'Logged in to system','2022-11-19 07:17:16','2022-11-19 07:17:16',NULL),(121,1,'Admin Admin',NULL,'Logged in to system','2022-11-20 06:15:15','2022-11-20 06:15:15',NULL),(122,1,'Admin Admin',NULL,'Logged in to system','2022-12-05 03:54:17','2022-12-05 03:54:17',NULL),(123,1,'Admin Admin',NULL,'Added loan with id:6','2022-12-05 03:55:53','2022-12-05 03:55:53',1),(124,1,'Admin Admin',NULL,'Approved loan with id:6','2022-12-05 03:55:58','2022-12-05 03:55:58',1),(125,1,'Admin Admin',NULL,'Disbursed loan with id:6','2022-12-05 03:56:02','2022-12-05 03:56:02',1),(126,1,'Admin Admin',NULL,'Added loan with id:7','2022-12-05 04:16:57','2022-12-05 04:16:57',1),(127,1,'Admin Admin',NULL,'Approved loan with id:7','2022-12-05 04:17:03','2022-12-05 04:17:03',1),(128,1,'Admin Admin',NULL,'Disbursed loan with id:7','2022-12-05 04:17:08','2022-12-05 04:17:08',1),(129,1,'Admin Admin',NULL,'Logged in to system','2022-12-22 04:18:23','2022-12-22 04:18:23',NULL),(130,1,'Admin Admin',NULL,'Logged in to system','2022-12-23 11:13:37','2022-12-23 11:13:37',NULL),(131,1,'Admin Admin',NULL,'Updated loan product with id:1','2022-12-23 11:58:33','2022-12-23 11:58:33',1),(132,1,'Admin Admin',NULL,'Updated loan product with id:2','2022-12-23 11:59:37','2022-12-23 11:59:37',1),(133,1,'Admin Admin',NULL,'Updated loan product with id:1','2022-12-23 11:59:48','2022-12-23 11:59:48',1),(134,1,'Admin Admin',NULL,'Added loan with id:8','2022-12-23 12:03:54','2022-12-23 12:03:54',1),(135,1,'Admin Admin',NULL,'Approved loan with id:8','2022-12-23 12:04:11','2022-12-23 12:04:11',1),(136,1,'Admin Admin',NULL,'Disbursed loan with id:8','2022-12-23 12:04:14','2022-12-23 12:04:14',1),(137,1,'Admin Admin',NULL,'Undisbursed loan with id:8','2022-12-23 12:11:48','2022-12-23 12:11:48',1),(138,1,'Admin Admin',NULL,'Logged in to system','2022-12-28 09:43:32','2022-12-28 09:43:32',NULL),(139,1,'Admin Admin',NULL,'Logged in to system','2022-12-28 10:23:32','2022-12-28 10:23:32',NULL),(140,1,'Admin Admin',NULL,'Updated user with id:4','2022-12-28 10:24:21','2022-12-28 10:24:21',1),(141,1,'Admin Admin',NULL,'Logged out of system','2022-12-28 10:25:24','2022-12-28 10:25:24',1),(142,4,'Co Co',NULL,'Logged in to system','2022-12-28 10:25:28','2022-12-28 10:25:28',1),(143,1,'Admin Admin',NULL,'Logged in to system','2022-12-28 10:25:51','2022-12-28 10:25:51',NULL),(144,1,'Admin Admin',NULL,'Updated role with id:2','2022-12-28 10:26:35','2022-12-28 10:26:35',1),(145,1,'Admin Admin',NULL,'Updated role with id:2','2022-12-28 10:27:03','2022-12-28 10:27:03',1),(146,1,'Admin Admin',NULL,'Updated role with id:3','2022-12-28 10:32:02','2022-12-28 10:32:02',1),(147,1,'Admin Admin',NULL,'Added user with id:5','2022-12-28 10:32:40','2022-12-28 10:32:40',1),(148,4,'Co Co',NULL,'Logged out of system','2022-12-28 10:34:51','2022-12-28 10:34:51',1),(149,5,'Sub Admin Sub Admin',NULL,'Logged in to system','2022-12-28 10:34:57','2022-12-28 10:34:57',1),(150,1,'Admin Admin',NULL,'Added loan with id:9','2022-12-28 10:36:50','2022-12-28 10:36:50',1),(151,1,'Admin Admin',NULL,'Updated loan with id:9','2022-12-28 10:37:17','2022-12-28 10:37:17',1),(152,1,'Admin Admin',NULL,'Updated user with id:5','2022-12-28 10:44:21','2022-12-28 10:44:21',1),(153,1,'Admin Admin',NULL,'Disbursed loan with id:8','2022-12-28 11:34:41','2022-12-28 11:34:41',1),(154,1,'Admin Admin',NULL,'Undisbursed loan with id:8','2022-12-28 11:41:53','2022-12-28 11:41:53',1),(155,1,'Admin Admin',NULL,'Disbursed loan with id:8','2022-12-28 11:42:08','2022-12-28 11:42:08',1),(156,1,'Admin Admin',NULL,'Undisbursed loan with id:8','2022-12-28 11:42:55','2022-12-28 11:42:55',1),(157,1,'Admin Admin',NULL,'Updated loan product with id:1','2022-12-28 11:44:21','2022-12-28 11:44:21',1),(158,1,'Admin Admin',NULL,'Disbursed loan with id:8','2022-12-28 11:44:49','2022-12-28 11:44:49',1),(159,1,'Admin Admin',NULL,'Approved loan with id:9','2022-12-28 11:47:13','2022-12-28 11:47:13',1),(160,1,'Admin Admin',NULL,'Disbursed loan with id:9','2022-12-28 11:47:16','2022-12-28 11:47:16',1),(161,1,'Admin Admin',NULL,'Logged in to system','2022-12-30 08:07:13','2022-12-30 08:07:13',NULL),(162,4,'Co Co',NULL,'Logged in to system','2023-01-06 17:21:54','2023-01-06 17:21:54',NULL),(163,4,'Co Co',NULL,'Added borrower  with id:4','2023-01-06 17:24:34','2023-01-06 17:24:34',1),(164,4,'Co Co',NULL,'Added loan with id:10','2023-01-06 17:29:15','2023-01-06 17:29:15',1),(165,4,'Co Co',NULL,'Logged out of system','2023-01-06 17:30:13','2023-01-06 17:30:13',1),(166,5,'Sub Admin Sub Admin',NULL,'Logged in to system','2023-01-06 17:31:19','2023-01-06 17:31:19',1),(167,5,'Sub Admin Sub Admin',NULL,'Logged in to system','2023-01-06 17:31:25','2023-01-06 17:31:25',1),(168,5,'Sub Admin Sub Admin',NULL,'Updated loan with id:10','2023-01-06 17:41:07','2023-01-06 17:41:07',1),(169,5,'Sub Admin Sub Admin',NULL,'Updated loan with id:10','2023-01-06 17:41:40','2023-01-06 17:41:40',1),(170,1,'Admin Admin',NULL,'Logged in to system','2023-01-08 07:36:55','2023-01-08 07:36:55',NULL),(171,1,'Admin Admin',NULL,'Logged in to system','2023-01-08 07:36:59','2023-01-08 07:36:59',1),(172,1,'Admin Admin',NULL,'Logged in to system','2023-01-09 07:20:40','2023-01-09 07:20:40',NULL),(173,1,'Admin Admin',NULL,'Added role with id:4','2023-01-09 08:10:02','2023-01-09 08:10:02',1),(174,1,'Admin Admin',NULL,'Updated role with id:4','2023-01-09 08:10:11','2023-01-09 08:10:11',1),(175,1,'Admin Admin',NULL,'Added user with id:6','2023-01-09 08:10:49','2023-01-09 08:10:49',1),(176,6,'Dany Dany',NULL,'Logged in to system','2023-01-09 08:11:40','2023-01-09 08:11:40',NULL),(177,1,'Admin Admin',NULL,'Updated role with id:4','2023-01-09 08:13:26','2023-01-09 08:13:26',1),(178,6,'Dany Dany',NULL,'Logged in to system','2023-01-09 08:58:49','2023-01-09 08:58:49',NULL),(179,1,'Admin Admin',NULL,'Logged in to system','2023-01-11 09:53:38','2023-01-11 09:53:38',NULL),(180,1,'Admin Admin',NULL,'Logged in to system','2023-01-11 16:53:02','2023-01-11 16:53:02',NULL),(181,1,'Admin Admin',NULL,'Logged in to system','2023-01-11 16:55:56','2023-01-11 16:55:56',NULL),(182,6,'Dany Dany',NULL,'Logged in to system','2023-01-14 10:26:53','2023-01-14 10:26:53',NULL),(183,1,'Admin Admin',NULL,'Logged in to system','2023-01-17 04:56:19','2023-01-17 04:56:19',NULL),(184,1,'Admin Admin',NULL,'Logged in to system','2023-01-19 10:48:03','2023-01-19 10:48:03',NULL),(185,1,'Admin Admin',NULL,'Logged in to system','2023-01-24 07:35:21','2023-01-24 07:35:21',NULL),(186,1,'Admin Admin',NULL,'Logged in to system','2023-01-24 10:06:08','2023-01-24 10:06:08',NULL),(187,1,'Admin Admin',NULL,'Logged in to system','2023-02-09 09:20:49','2023-02-09 09:20:49',NULL),(188,1,'Admin Admin',NULL,'Declined borrower  with id:2','2023-02-09 09:22:05','2023-02-09 09:22:05',1),(189,1,'Admin Admin',NULL,'Approved borrower  with id:2','2023-02-09 09:22:09','2023-02-09 09:22:09',1),(190,1,'Admin Admin',NULL,'Updated borrower  with id:2','2023-02-09 09:22:34','2023-02-09 09:22:34',1),(191,1,'Admin Admin',NULL,'Updated borrower  with id:2','2023-02-09 09:22:43','2023-02-09 09:22:43',1),(192,1,'Admin Admin',NULL,'Updated borrower  with id:1','2023-02-09 09:24:02','2023-02-09 09:24:02',1),(193,1,'Admin Admin',NULL,'Declined borrower  with id:4','2023-02-09 09:28:31','2023-02-09 09:28:31',1),(194,1,'Admin Admin',NULL,'Approved borrower  with id:4','2023-02-09 09:28:34','2023-02-09 09:28:34',1),(195,1,'Admin Admin',NULL,'Logged in to system','2023-02-10 05:04:45','2023-02-10 05:04:45',NULL),(196,1,'Admin Admin',NULL,'Logged in to system','2023-02-10 08:22:21','2023-02-10 08:22:21',NULL),(197,1,'Admin Admin',NULL,'Logged in to system','2023-02-10 08:32:46','2023-02-10 08:32:46',NULL),(198,1,'Admin Admin',NULL,'Added loan with id:11','2023-02-10 09:06:00','2023-02-10 09:06:00',1),(199,1,'Admin Admin',NULL,'Approved loan with id:11','2023-02-10 09:06:20','2023-02-10 09:06:20',1),(200,1,'Admin Admin',NULL,'Disbursed loan with id:11','2023-02-10 09:06:30','2023-02-10 09:06:30',1),(201,1,'Admin Admin',NULL,'Logged out of system','2023-02-10 09:50:07','2023-02-10 09:50:07',1),(202,1,'Admin Admin',NULL,'Logged in to system','2023-02-13 10:54:55','2023-02-13 10:54:55',NULL),(203,1,'Admin Admin',NULL,'Logged in to system','2023-02-14 08:58:34','2023-02-14 08:58:34',NULL),(204,1,'Admin Admin',NULL,'Declined borrower  with id:4','2023-02-14 08:58:43','2023-02-14 08:58:43',1),(205,1,'Admin Admin',NULL,'Approved borrower  with id:4','2023-02-14 08:58:46','2023-02-14 08:58:46',1),(206,1,'Admin Admin',NULL,'Updated borrower  with id:4','2023-02-14 08:59:02','2023-02-14 08:59:02',1),(207,1,'Admin Admin',NULL,'Logged in to system','2023-02-15 10:27:58','2023-02-15 10:27:58',NULL),(208,6,'Dany Dany',NULL,'Logged out of system','2023-02-17 07:54:59','2023-02-17 07:54:59',1),(209,1,'Admin Admin',NULL,'Logged in to system','2023-02-17 07:55:08','2023-02-17 07:55:08',1),(210,1,'Admin Admin',NULL,'Added loan with id:12','2023-02-17 08:01:54','2023-02-17 08:01:54',1),(211,1,'Admin Admin',NULL,'Approved loan with id:12','2023-02-17 08:02:01','2023-02-17 08:02:01',1),(212,1,'Admin Admin',NULL,'Disbursed loan with id:12','2023-02-17 08:02:07','2023-02-17 08:02:07',1),(213,1,'Admin Admin',NULL,'Added loan with id:13','2023-02-17 08:05:39','2023-02-17 08:05:39',1),(214,1,'Admin Admin',NULL,'Updated loan with id:13','2023-02-17 08:05:51','2023-02-17 08:05:51',1),(215,1,'Admin Admin',NULL,'Approved loan with id:13','2023-02-17 08:05:57','2023-02-17 08:05:57',1),(216,1,'Admin Admin',NULL,'Disbursed loan with id:13','2023-02-17 08:06:02','2023-02-17 08:06:02',1),(217,1,'Admin Admin',NULL,'Added loan with id:14','2023-02-17 08:09:20','2023-02-17 08:09:20',1),(218,1,'Admin Admin',NULL,'Updated loan with id:14','2023-02-17 08:09:32','2023-02-17 08:09:32',1),(219,1,'Admin Admin',NULL,'Approved loan with id:14','2023-02-17 08:09:43','2023-02-17 08:09:43',1),(220,1,'Admin Admin',NULL,'Disbursed loan with id:14','2023-02-17 08:09:52','2023-02-17 08:09:52',1),(221,1,'Admin Admin',NULL,'Added loan with id:15','2023-02-17 08:10:39','2023-02-17 08:10:39',1),(222,1,'Admin Admin',NULL,'Approved loan with id:15','2023-02-17 08:10:48','2023-02-17 08:10:48',1),(223,1,'Admin Admin',NULL,'Disbursed loan with id:15','2023-02-17 08:10:51','2023-02-17 08:10:51',1),(224,1,'Admin Admin',NULL,'Added loan with id:16','2023-02-17 08:12:06','2023-02-17 08:12:06',1),(225,1,'Admin Admin',NULL,'Approved loan with id:16','2023-02-17 08:12:33','2023-02-17 08:12:33',1),(226,1,'Admin Admin',NULL,'Disbursed loan with id:16','2023-02-17 08:13:01','2023-02-17 08:13:01',1),(227,1,'Admin Admin',NULL,'Added loan with id:17','2023-02-17 08:17:37','2023-02-17 08:17:37',1),(228,1,'Admin Admin',NULL,'Approved loan with id:17','2023-02-17 08:17:44','2023-02-17 08:17:44',1),(229,1,'Admin Admin',NULL,'Disbursed loan with id:17','2023-02-17 08:17:47','2023-02-17 08:17:47',1),(230,1,'Admin Admin',NULL,'Added loan with id:18','2023-02-17 08:28:11','2023-02-17 08:28:11',1),(231,1,'Admin Admin',NULL,'Updated loan with id:18','2023-02-17 08:28:25','2023-02-17 08:28:25',1),(232,1,'Admin Admin',NULL,'Approved loan with id:18','2023-02-17 08:28:31','2023-02-17 08:28:31',1),(233,1,'Admin Admin',NULL,'Disbursed loan with id:18','2023-02-17 08:28:34','2023-02-17 08:28:34',1),(234,1,'Admin Admin',NULL,'Undisbursed loan with id:18','2023-02-17 08:28:58','2023-02-17 08:28:58',1),(235,1,'Admin Admin',NULL,'Unapproved loan with id:18','2023-02-17 08:29:03','2023-02-17 08:29:03',1),(236,1,'Admin Admin',NULL,'Updated loan with id:18','2023-02-17 08:29:15','2023-02-17 08:29:15',1),(237,1,'Admin Admin',NULL,'Approved loan with id:18','2023-02-17 08:29:21','2023-02-17 08:29:21',1),(238,1,'Admin Admin',NULL,'Disbursed loan with id:18','2023-02-17 08:29:24','2023-02-17 08:29:24',1),(239,1,'Admin Admin',NULL,'Undisbursed loan with id:18','2023-02-17 08:29:58','2023-02-17 08:29:58',1),(240,1,'Admin Admin',NULL,'Unapproved loan with id:18','2023-02-17 08:30:02','2023-02-17 08:30:02',1),(241,1,'Admin Admin',NULL,'Updated loan with id:18','2023-02-17 08:30:12','2023-02-17 08:30:12',1),(242,1,'Admin Admin',NULL,'Approved loan with id:18','2023-02-17 08:30:19','2023-02-17 08:30:19',1),(243,1,'Admin Admin',NULL,'Disbursed loan with id:18','2023-02-17 08:30:22','2023-02-17 08:30:22',1),(244,1,'Admin Admin',NULL,'Added repayment for loan with id:13','2023-02-17 08:50:44','2023-02-17 08:50:44',1),(245,1,'Admin Admin',NULL,'Added repayment for loan with id:15','2023-02-17 08:51:14','2023-02-17 08:51:14',1),(246,1,'Admin Admin',NULL,'Rescheduled loan with id:18','2023-02-17 08:58:52','2023-02-17 08:58:52',1),(247,1,'Admin Admin',NULL,'Waived penalty for loan schedule with id 13','2023-02-17 09:05:15','2023-02-17 09:05:15',1),(248,1,'Admin Admin',NULL,'Logged in to system','2023-02-21 08:58:56','2023-02-21 08:58:56',NULL),(249,1,'Admin Admin',NULL,'Added Pay Off for loan with id:19','2023-02-21 09:00:41','2023-02-21 09:00:41',1);

--
-- Table structure for table `bank_accounts`
--

CREATE TABLE `bank_accounts` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `bank_accounts`
--


--
-- Table structure for table `borrower_group_members`
--

CREATE TABLE `borrower_group_members` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `borrower_group_id` int DEFAULT NULL,
  `borrower_id` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `borrower_group_members`
--


--
-- Table structure for table `borrower_groups`
--

CREATE TABLE `borrower_groups` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `assigned_borrowers` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `borrower_groups`
--


--
-- Table structure for table `borrowers`
--

CREATE TABLE `borrowers` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `first_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `gender` enum('Male','Female') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Male',
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mobile` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `unique_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dob` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `city` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `state` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `zip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `business_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `working_status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `photo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `files` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `loan_officers` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `month` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `year` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `source` enum('online','admin') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'admin',
  `active` tinyint DEFAULT '1',
  `blacklisted` tinyint DEFAULT '0',
  `branch_id` int DEFAULT NULL,
  `country_id` int DEFAULT NULL,
  `id_card_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `place_of_birth` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `borrowers_id_index` (`id`),
  KEY `borrowers_unique_number_index` (`unique_number`),
  KEY `borrowers_month_index` (`month`),
  KEY `borrowers_year_index` (`year`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `borrowers`
--

INSERT INTO `borrowers` VALUES (1,1,'សាន្ត','គឹមសាល','Female',NULL,NULL,'test@gmail.com1',NULL,NULL,'Poipet',NULL,NULL,NULL,'012545555','test','Employee',NULL,NULL,'a:0:{}','N;','2022-09-27 11:19:46','2023-02-09 09:24:02',NULL,NULL,NULL,'09','2022','admin',1,0,1,NULL,'45645646','11/10/1991'),(2,1,'ដានី','ដាន្នី','Female',NULL,NULL,NULL,'333455',NULL,NULL,NULL,NULL,NULL,'0987654321',NULL,'Employee',NULL,NULL,'a:0:{}','N;','2022-10-21 10:26:01','2023-02-09 09:22:43',NULL,NULL,NULL,'10','2022','admin',1,0,1,NULL,'0987654323456','Poit Pet'),(3,1,'test','KS','Female',NULL,NULL,NULL,NULL,'1991-10-04','Test',NULL,NULL,NULL,'023658987',NULL,'Employee',NULL,NULL,'a:0:{}','N;','2022-11-16 15:08:51','2022-11-16 15:08:51',NULL,NULL,NULL,'11','2022','admin',1,0,1,NULL,'46546757657657657','Test'),(4,4,'សុភាព','ម៉ា','Male',NULL,NULL,NULL,NULL,'2023-01-07','Poay pet',NULL,NULL,NULL,'098766553r',NULL,'Employee',NULL,'Loan','a:0:{}','N;','2023-01-06 17:24:34','2023-02-14 08:59:02',NULL,NULL,NULL,'01','2023','admin',1,0,1,NULL,'2632222',NULL);

--
-- Table structure for table `branch_users`
--

CREATE TABLE `branch_users` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `branch_id` int DEFAULT NULL,
  `user_id` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `branch_users`
--

INSERT INTO `branch_users` VALUES (1,1,1,'2022-09-27 08:15:14','2022-09-27 08:15:14'),(2,1,4,'2022-09-27 13:25:11','2022-09-27 13:25:11'),(3,1,5,'2022-12-28 10:32:40','2022-12-28 10:32:40'),(4,1,6,'2023-01-09 08:10:49','2023-01-09 08:10:49');

--
-- Table structure for table `branches`
--

CREATE TABLE `branches` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `assigned_users` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `default_branch` tinyint NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `branches`
--

INSERT INTO `branches` VALUES (1,'Default',NULL,NULL,1);

--
-- Table structure for table `brands`
--

CREATE TABLE `brands` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `brands`
--


--
-- Table structure for table `capital`
--

CREATE TABLE `capital` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `date` date DEFAULT NULL,
  `amount` decimal(10,2) DEFAULT NULL,
  `year` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `month` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `branch_id` int DEFAULT NULL,
  `bank_account_id` int DEFAULT NULL,
  `type` enum('withdrawal','deposit') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'deposit',
  `loan_id` int DEFAULT NULL,
  `expense_id` int DEFAULT NULL,
  `account_id` int DEFAULT NULL,
  `credit_account_id` int DEFAULT NULL,
  `debit_account_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `capital_id_index` (`id`),
  KEY `capital_month_index` (`month`),
  KEY `capital_year_index` (`year`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `capital`
--


--
-- Table structure for table `charges`
--

CREATE TABLE `charges` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `product` enum('loan','savings') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `charge_type` enum('disbursement','specified_due_date','installment_fee','overdue_installment_fee','loan_rescheduling_fee','overdue_maturity','savings_activation','withdrawal_fee','annual_fee','monthly_fee') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `charge_option` enum('fixed','percentage','principal_due','principal_interest','interest_due','total_due','original_principal') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `charge_frequency` tinyint NOT NULL DEFAULT '0',
  `charge_frequency_type` enum('days','weeks','months','years') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'days',
  `charge_frequency_amount` int NOT NULL DEFAULT '0',
  `amount` decimal(65,2) DEFAULT NULL,
  `charge_payment_mode` enum('regular','account_transfer') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'regular',
  `currency_id` int DEFAULT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `penalty` tinyint NOT NULL DEFAULT '0',
  `override` tinyint NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `charges`
--

INSERT INTO `charges` VALUES (1,NULL,'Loan Fee','loan','disbursement','fixed',0,'days',0,1.00,'regular',NULL,1,0,1,'2022-12-23 11:14:27','2022-12-28 11:44:37'),(2,NULL,'Other Fee','loan','specified_due_date','fixed',0,'days',0,1.00,'regular',NULL,1,0,0,'2023-01-24 07:36:22','2023-01-24 07:36:22');

--
-- Table structure for table `chart_of_accounts`
--

CREATE TABLE `chart_of_accounts` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `parent_id` int DEFAULT NULL,
  `name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `gl_code` int DEFAULT NULL,
  `account_type` enum('asset','expense','equity','liability','income') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'asset',
  `allow_manual` tinyint NOT NULL DEFAULT '0',
  `active` tinyint NOT NULL DEFAULT '1',
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `chart_of_accounts_id_index` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `chart_of_accounts`
--

INSERT INTO `chart_of_accounts` VALUES (1,NULL,'Fund Source',101,'asset',0,1,NULL),(2,NULL,'Loan Portfolio',102,'asset',0,1,NULL),(3,NULL,'Interest Receivable',103,'asset',0,1,NULL),(4,NULL,'Fees Receivable',104,'asset',0,1,NULL),(5,NULL,'Penalties Receivable',105,'asset',0,1,NULL),(6,NULL,'Overpayments',201,'liability',0,1,NULL),(7,NULL,'Income For Interest',301,'income',0,1,NULL),(8,NULL,'Income From Fee',302,'income',0,1,NULL),(9,NULL,'Income From Penalties',303,'income',0,1,NULL),(10,NULL,'Income From Recovery',304,'income',0,1,NULL),(11,NULL,'Loans Written Off',401,'expense',0,1,NULL);

--
-- Table structure for table `collateral`
--

CREATE TABLE `collateral` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `loan_id` int unsigned DEFAULT NULL,
  `borrower_id` int unsigned DEFAULT NULL,
  `collateral_type_id` int unsigned DEFAULT NULL,
  `value` decimal(65,4) DEFAULT NULL,
  `date` date DEFAULT NULL,
  `year` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('returned_to_borrower','repossessed','repossession_initiated','sold','lost','collateral_with_borrower','deposited_into_branch') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `month` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `photo` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `files` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `owner_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `relationship` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `collateral_id_index` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `collateral`
--

INSERT INTO `collateral` VALUES (1,'Toyota',1,1,1,10000.0000,'2022-09-14','2022','collateral_with_borrower','09',NULL,NULL,'a:0:{}','2022-09-27 13:30:48','2022-09-27 13:30:48','Test uSer','Friend');

--
-- Table structure for table `collateral_types`
--

CREATE TABLE `collateral_types` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `collateral_types`
--

INSERT INTO `collateral_types` VALUES (1,'ឡាន'),(2,'ម៉ូតូ'),(3,'ដី'),(4,'ផ្សេងៗ'),(5,'office\r\n');

--
-- Table structure for table `collateral_vehicles`
--

CREATE TABLE `collateral_vehicles` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `collateral_id` int unsigned DEFAULT NULL,
  `serial_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `model_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `model_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `manufacture_date` date DEFAULT NULL,
  `color` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `engine_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `frame_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `license_plate` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `steering_wheel` enum('left','right') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `collateral_vehicles`
--

INSERT INTO `collateral_vehicles` VALUES (1,1,NULL,NULL,NULL,NULL,'red',NULL,NULL,NULL,'left','2022-09-27 13:30:48','2022-09-27 13:30:48');

--
-- Table structure for table `countries`
--

CREATE TABLE `countries` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `sortname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=247 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `countries`
--

INSERT INTO `countries` VALUES (1,'AF','Afghanistan'),(2,'AL','Albania'),(3,'DZ','Algeria'),(4,'AS','American Samoa'),(5,'AD','Andorra'),(6,'AO','Angola'),(7,'AI','Anguilla'),(8,'AQ','Antarctica'),(9,'AG','Antigua And Barbuda'),(10,'AR','Argentina'),(11,'AM','Armenia'),(12,'AW','Aruba'),(13,'AU','Australia'),(14,'AT','Austria'),(15,'AZ','Azerbaijan'),(16,'BS','Bahamas The'),(17,'BH','Bahrain'),(18,'BD','Bangladesh'),(19,'BB','Barbados'),(20,'BY','Belarus'),(21,'BE','Belgium'),(22,'BZ','Belize'),(23,'BJ','Benin'),(24,'BM','Bermuda'),(25,'BT','Bhutan'),(26,'BO','Bolivia'),(27,'BA','Bosnia and Herzegovina'),(28,'BW','Botswana'),(29,'BV','Bouvet Island'),(30,'BR','Brazil'),(31,'IO','British Indian Ocean Territory'),(32,'BN','Brunei'),(33,'BG','Bulgaria'),(34,'BF','Burkina Faso'),(35,'BI','Burundi'),(36,'KH','Cambodia'),(37,'CM','Cameroon'),(38,'CA','Canada'),(39,'CV','Cape Verde'),(40,'KY','Cayman Islands'),(41,'CF','Central African Republic'),(42,'TD','Chad'),(43,'CL','Chile'),(44,'CN','China'),(45,'CX','Christmas Island'),(46,'CC','Cocos (Keeling) Islands'),(47,'CO','Colombia'),(48,'KM','Comoros'),(49,'CG','Congo'),(50,'CD','Congo The Democratic Republic Of The'),(51,'CK','Cook Islands'),(52,'CR','Costa Rica'),(53,'CI','Cote D\'Ivoire (Ivory Coast)'),(54,'HR','Croatia (Hrvatska)'),(55,'CU','Cuba'),(56,'CY','Cyprus'),(57,'CZ','Czech Republic'),(58,'DK','Denmark'),(59,'DJ','Djibouti'),(60,'DM','Dominica'),(61,'DO','Dominican Republic'),(62,'TP','East Timor'),(63,'EC','Ecuador'),(64,'EG','Egypt'),(65,'SV','El Salvador'),(66,'GQ','Equatorial Guinea'),(67,'ER','Eritrea'),(68,'EE','Estonia'),(69,'ET','Ethiopia'),(70,'XA','External Territories of Australia'),(71,'FK','Falkland Islands'),(72,'FO','Faroe Islands'),(73,'FJ','Fiji Islands'),(74,'FI','Finland'),(75,'FR','France'),(76,'GF','French Guiana'),(77,'PF','French Polynesia'),(78,'TF','French Southern Territories'),(79,'GA','Gabon'),(80,'GM','Gambia The'),(81,'GE','Georgia'),(82,'DE','Germany'),(83,'GH','Ghana'),(84,'GI','Gibraltar'),(85,'GR','Greece'),(86,'GL','Greenland'),(87,'GD','Grenada'),(88,'GP','Guadeloupe'),(89,'GU','Guam'),(90,'GT','Guatemala'),(91,'XU','Guernsey and Alderney'),(92,'GN','Guinea'),(93,'GW','Guinea-Bissau'),(94,'GY','Guyana'),(95,'HT','Haiti'),(96,'HM','Heard and McDonald Islands'),(97,'HN','Honduras'),(98,'HK','Hong Kong S.A.R.'),(99,'HU','Hungary'),(100,'IS','Iceland'),(101,'IN','India'),(102,'ID','Indonesia'),(103,'IR','Iran'),(104,'IQ','Iraq'),(105,'IE','Ireland'),(106,'IL','Israel'),(107,'IT','Italy'),(108,'JM','Jamaica'),(109,'JP','Japan'),(110,'XJ','Jersey'),(111,'JO','Jordan'),(112,'KZ','Kazakhstan'),(113,'KE','Kenya'),(114,'KI','Kiribati'),(115,'KP','Korea North'),(116,'KR','Korea South'),(117,'KW','Kuwait'),(118,'KG','Kyrgyzstan'),(119,'LA','Laos'),(120,'LV','Latvia'),(121,'LB','Lebanon'),(122,'LS','Lesotho'),(123,'LR','Liberia'),(124,'LY','Libya'),(125,'LI','Liechtenstein'),(126,'LT','Lithuania'),(127,'LU','Luxembourg'),(128,'MO','Macau S.A.R.'),(129,'MK','Macedonia'),(130,'MG','Madagascar'),(131,'MW','Malawi'),(132,'MY','Malaysia'),(133,'MV','Maldives'),(134,'ML','Mali'),(135,'MT','Malta'),(136,'XM','Man (Isle of)'),(137,'MH','Marshall Islands'),(138,'MQ','Martinique'),(139,'MR','Mauritania'),(140,'MU','Mauritius'),(141,'YT','Mayotte'),(142,'MX','Mexico'),(143,'FM','Micronesia'),(144,'MD','Moldova'),(145,'MC','Monaco'),(146,'MN','Mongolia'),(147,'MS','Montserrat'),(148,'MA','Morocco'),(149,'MZ','Mozambique'),(150,'MM','Myanmar'),(151,'NA','Namibia'),(152,'NR','Nauru'),(153,'NP','Nepal'),(154,'AN','Netherlands Antilles'),(155,'NL','Netherlands The'),(156,'NC','New Caledonia'),(157,'NZ','New Zealand'),(158,'NI','Nicaragua'),(159,'NE','Niger'),(160,'NG','Nigeria'),(161,'NU','Niue'),(162,'NF','Norfolk Island'),(163,'MP','Northern Mariana Islands'),(164,'NO','Norway'),(165,'OM','Oman'),(166,'PK','Pakistan'),(167,'PW','Palau'),(168,'PS','Palestinian Territory Occupied'),(169,'PA','Panama'),(170,'PG','Papua new Guinea'),(171,'PY','Paraguay'),(172,'PE','Peru'),(173,'PH','Philippines'),(174,'PN','Pitcairn Island'),(175,'PL','Poland'),(176,'PT','Portugal'),(177,'PR','Puerto Rico'),(178,'QA','Qatar'),(179,'RE','Reunion'),(180,'RO','Romania'),(181,'RU','Russia'),(182,'RW','Rwanda'),(183,'SH','Saint Helena'),(184,'KN','Saint Kitts And Nevis'),(185,'LC','Saint Lucia'),(186,'PM','Saint Pierre and Miquelon'),(187,'VC','Saint Vincent And The Grenadines'),(188,'WS','Samoa'),(189,'SM','San Marino'),(190,'ST','Sao Tome and Principe'),(191,'SA','Saudi Arabia'),(192,'SN','Senegal'),(193,'RS','Serbia'),(194,'SC','Seychelles'),(195,'SL','Sierra Leone'),(196,'SG','Singapore'),(197,'SK','Slovakia'),(198,'SI','Slovenia'),(199,'XG','Smaller Territories of the UK'),(200,'SB','Solomon Islands'),(201,'SO','Somalia'),(202,'ZA','South Africa'),(203,'GS','South Georgia'),(204,'SS','South Sudan'),(205,'ES','Spain'),(206,'LK','Sri Lanka'),(207,'SD','Sudan'),(208,'SR','Suriname'),(209,'SJ','Svalbard And Jan Mayen Islands'),(210,'SZ','Swaziland'),(211,'SE','Sweden'),(212,'CH','Switzerland'),(213,'SY','Syria'),(214,'TW','Taiwan'),(215,'TJ','Tajikistan'),(216,'TZ','Tanzania'),(217,'TH','Thailand'),(218,'TG','Togo'),(219,'TK','Tokelau'),(220,'TO','Tonga'),(221,'TT','Trinidad And Tobago'),(222,'TN','Tunisia'),(223,'TR','Turkey'),(224,'TM','Turkmenistan'),(225,'TC','Turks And Caicos Islands'),(226,'TV','Tuvalu'),(227,'UG','Uganda'),(228,'UA','Ukraine'),(229,'AE','United Arab Emirates'),(230,'GB','United Kingdom'),(231,'US','United States'),(232,'UM','United States Minor Outlying Islands'),(233,'UY','Uruguay'),(234,'UZ','Uzbekistan'),(235,'VU','Vanuatu'),(236,'VA','Vatican City State (Holy See)'),(237,'VE','Venezuela'),(238,'VN','Vietnam'),(239,'VG','Virgin Islands (British)'),(240,'VI','Virgin Islands (US)'),(241,'WF','Wallis And Futuna Islands'),(242,'EH','Western Sahara'),(243,'YE','Yemen'),(244,'YU','Yugoslavia'),(245,'ZM','Zambia'),(246,'ZW','Zimbabwe');

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

CREATE TABLE `currencies` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned DEFAULT NULL,
  `rate` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `symbol` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `position` enum('left','right') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'left',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `currencies` VALUES (1,NULL,'1.00','USD','United States dollar','$','left');

--
-- Table structure for table `custom_fields`
--

CREATE TABLE `custom_fields` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `category` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `field_type` enum('number','textfield','date','decimal','textarea') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'textfield',
  `required` tinyint NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `custom_fields`
--


--
-- Table structure for table `custom_fields_meta`
--

CREATE TABLE `custom_fields_meta` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `category` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `parent_id` int DEFAULT NULL,
  `custom_field_id` int DEFAULT NULL,
  `name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `custom_fields_meta`
--


--
-- Table structure for table `emails`
--

CREATE TABLE `emails` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned NOT NULL,
  `subject` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `recipients` int unsigned NOT NULL,
  `send_to` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `branch_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `emails_id_index` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `emails`
--


--
-- Table structure for table `expense_types`
--

CREATE TABLE `expense_types` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `account_id` int DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `expense_types`
--

INSERT INTO `expense_types` VALUES (1,'Equipment',12);

--
-- Table structure for table `expenses`
--

CREATE TABLE `expenses` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned DEFAULT NULL,
  `expense_type_id` int unsigned DEFAULT NULL,
  `amount` decimal(65,4) DEFAULT NULL,
  `date` date DEFAULT NULL,
  `year` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `month` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `recurring` tinyint NOT NULL DEFAULT '0',
  `recur_frequency` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '31',
  `recur_start_date` date DEFAULT NULL,
  `recur_end_date` date DEFAULT NULL,
  `recur_next_date` date DEFAULT NULL,
  `recur_type` enum('day','week','month','year') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'month',
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `files` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `branch_id` int DEFAULT NULL,
  `chart_id` int DEFAULT NULL,
  `account_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `expenses_id_index` (`id`),
  KEY `expenses_month_index` (`month`),
  KEY `expenses_year_index` (`year`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `expenses`
--


--
-- Table structure for table `guarantor`
--

CREATE TABLE `guarantor` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `loan_application_id` int DEFAULT NULL,
  `loan_id` int DEFAULT NULL,
  `borrower_id` int DEFAULT NULL,
  `guarantor_id` int DEFAULT NULL,
  `amount` decimal(10,2) DEFAULT NULL,
  `saving_amount` decimal(10,2) DEFAULT NULL,
  `accepted_amount` decimal(10,2) DEFAULT NULL,
  `status` enum('pending','accepted','declined') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `saving_status` enum('pending','hold','restored') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `saving_restored` tinyint NOT NULL DEFAULT '0',
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `date` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `branch_id` int unsigned DEFAULT NULL,
  `first_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `gender` enum('Male','Female') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Male',
  `country_id` int DEFAULT NULL,
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mobile` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `unique_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dob` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `city` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `state` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `zip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `business_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `working_status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `photo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `files` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `id_card_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `guarantor_id_index` (`id`),
  KEY `guarantor_unique_number_index` (`unique_number`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `guarantor`
--


--
-- Table structure for table `journal_entries`
--

CREATE TABLE `journal_entries` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `account_id` int DEFAULT NULL,
  `transaction_type` enum('repayment','disbursement','accrual','deposit','withdrawal','manual_entry','pay_charge','transfer_fund','expense','payroll','income','fee','penalty','interest','dividend','guarantee','close_write_off','repayment_disbursement','repayment_recovery','interest_accrual','fee_accrual') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'repayment',
  `name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `gl_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `date` date DEFAULT NULL,
  `month` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `year` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reference` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `borrower_id` int DEFAULT NULL,
  `loan_id` int DEFAULT NULL,
  `expense_id` int DEFAULT NULL,
  `capital_id` int DEFAULT NULL,
  `income_id` int DEFAULT NULL,
  `payroll_id` int DEFAULT NULL,
  `savings_id` int DEFAULT NULL,
  `loan_repayment_id` int DEFAULT NULL,
  `debit` decimal(65,4) DEFAULT NULL,
  `credit` decimal(65,4) DEFAULT NULL,
  `balance` decimal(65,4) DEFAULT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `loan_transaction_id` int DEFAULT NULL,
  `branch_id` int DEFAULT NULL,
  `transaction_sub_type` enum('overpayment','repayment_interest','repayment_principal','repayment_fees','repayment_penalty') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reversed` tinyint NOT NULL DEFAULT '0',
  `other_income_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `journal_entries_id_index` (`id`),
  KEY `journal_entries_month_index` (`month`),
  KEY `journal_entries_year_index` (`year`)
) ENGINE=InnoDB AUTO_INCREMENT=95 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `journal_entries`
--

INSERT INTO `journal_entries` VALUES (1,1,1,'disbursement','Loan Disbursement',NULL,'2022-09-27','09','2022','1',1,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,100.0000,NULL,1,NULL,'2022-09-29 08:41:49','2022-09-29 08:41:49',NULL,1,NULL,0,NULL),(2,1,1,'repayment','Principal Repayment',NULL,'2022-09-29','09','2022','3',1,1,NULL,NULL,NULL,NULL,NULL,NULL,8.3333,NULL,NULL,1,NULL,'2022-09-29 08:55:21','2022-09-29 08:55:21',3,1,NULL,0,NULL),(3,1,1,'repayment','Principal Repayment',NULL,'2022-10-16','10','2022','4',1,1,NULL,NULL,NULL,NULL,NULL,NULL,8.3325,NULL,NULL,1,NULL,'2022-10-16 09:56:19','2022-10-16 09:56:19',4,1,NULL,0,NULL),(4,1,1,'disbursement','Loan Disbursement',NULL,'2022-10-18','10','2022','2',1,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,200.0000,NULL,1,NULL,'2022-10-18 15:34:16','2022-10-18 15:34:16',NULL,1,NULL,0,NULL),(5,1,1,'disbursement','Loan Disbursement',NULL,'2022-10-21','10','2022','3',2,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,500.0000,NULL,1,NULL,'2022-10-21 10:31:43','2022-10-21 10:31:43',NULL,1,NULL,0,NULL),(6,1,1,'disbursement','Loan Disbursement',NULL,'2022-10-21','10','2022','3',2,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,500.0000,NULL,1,NULL,'2022-11-03 11:31:46','2022-11-03 11:31:46',NULL,1,NULL,0,NULL),(7,1,1,'disbursement','Loan Disbursement',NULL,'2022-10-21','10','2022','3',2,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,500.0000,NULL,1,NULL,'2022-11-03 11:32:58','2022-11-03 11:32:58',NULL,1,NULL,0,NULL),(8,1,1,'disbursement','Loan Disbursement',NULL,'2022-10-21','10','2022','3',2,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1000.0000,NULL,1,NULL,'2022-11-03 11:36:43','2022-11-03 11:36:43',NULL,1,NULL,0,NULL),(9,1,1,'disbursement','Loan Disbursement',NULL,'2022-10-21','10','2022','3',2,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1000.0000,NULL,1,NULL,'2022-11-03 11:38:17','2022-11-03 11:38:17',NULL,1,NULL,0,NULL),(10,1,1,'disbursement','Loan Disbursement',NULL,'2022-10-21','10','2022','3',2,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,700.0000,NULL,1,NULL,'2022-11-03 11:40:25','2022-11-03 11:40:25',NULL,1,NULL,0,NULL),(11,1,1,'disbursement','Loan Disbursement',NULL,'2022-10-21','10','2022','3',2,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,500.0000,NULL,1,NULL,'2022-11-03 11:41:11','2022-11-03 11:41:11',NULL,1,NULL,0,NULL),(12,1,1,'disbursement','Loan Disbursement',NULL,'2022-10-21','10','2022','3',2,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,250.0000,NULL,1,NULL,'2022-11-03 11:42:57','2022-11-03 11:42:57',NULL,1,NULL,0,NULL),(13,1,1,'disbursement','Loan Disbursement',NULL,'2022-10-21','10','2022','3',2,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,889.0000,NULL,1,NULL,'2022-11-14 04:26:12','2022-11-14 04:26:12',NULL,1,NULL,0,NULL),(14,1,1,'disbursement','Loan Disbursement',NULL,'2022-10-21','10','2022','3',2,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,889.0000,NULL,1,NULL,'2022-11-14 04:28:18','2022-11-14 04:28:18',NULL,1,NULL,0,NULL),(15,1,1,'disbursement','Loan Disbursement',NULL,'2022-10-21','10','2022','3',2,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,899.0000,NULL,1,NULL,'2022-11-14 04:38:59','2022-11-14 04:38:59',NULL,1,NULL,0,NULL),(16,1,1,'disbursement','Loan Disbursement',NULL,'2022-10-21','10','2022','3',2,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,500.0000,NULL,1,NULL,'2022-11-14 05:15:06','2022-11-14 05:15:06',NULL,1,NULL,0,NULL),(17,1,1,'disbursement','Loan Disbursement',NULL,'2022-10-21','10','2022','3',2,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,500.0000,NULL,1,NULL,'2022-11-14 05:16:26','2022-11-14 05:16:26',NULL,1,NULL,0,NULL),(18,1,1,'disbursement','Loan Disbursement',NULL,'2022-11-16','11','2022','4',1,4,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1000.0000,NULL,1,NULL,'2022-11-16 15:10:05','2022-11-16 15:10:05',NULL,1,NULL,0,NULL),(19,1,1,'disbursement','Loan Disbursement',NULL,'2022-12-05','12','2022','6',1,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,500.0000,NULL,1,NULL,'2022-12-05 03:56:02','2022-12-05 03:56:02',NULL,1,NULL,0,NULL),(20,1,1,'disbursement','Loan Disbursement',NULL,'2022-12-05','12','2022','7',1,7,NULL,NULL,NULL,NULL,NULL,NULL,NULL,500.0000,NULL,1,NULL,'2022-12-05 04:17:08','2022-12-05 04:17:08',NULL,1,NULL,0,NULL),(21,1,8,'fee','Fee Income',NULL,'2022-12-23','12','2022','42',1,8,NULL,NULL,NULL,NULL,NULL,NULL,400.0000,400.0000,NULL,1,NULL,'2022-12-23 12:04:14','2022-12-23 12:11:48',NULL,1,NULL,0,NULL),(22,1,1,'fee','Fee Income',NULL,'2022-12-23','12','2022','42',1,8,NULL,NULL,NULL,NULL,NULL,NULL,400.0000,400.0000,NULL,1,NULL,'2022-12-23 12:04:14','2022-12-23 12:11:48',NULL,1,NULL,0,NULL),(23,1,1,'disbursement','Loan Disbursement',NULL,'2022-12-23','12','2022','8',1,8,NULL,NULL,NULL,NULL,NULL,NULL,NULL,2000.0000,NULL,1,NULL,'2022-12-23 12:04:14','2022-12-23 12:04:14',NULL,1,NULL,0,NULL),(24,1,2,'disbursement','Loan Disbursement',NULL,'2022-12-23','12','2022','8',1,8,NULL,NULL,NULL,NULL,NULL,NULL,2000.0000,NULL,NULL,1,NULL,'2022-12-23 12:04:14','2022-12-23 12:04:14',NULL,1,NULL,0,NULL),(25,1,8,'fee','Fee Income',NULL,'2022-12-23','12','2022','46',1,8,NULL,NULL,NULL,NULL,NULL,NULL,400.0000,400.0000,NULL,1,NULL,'2022-12-28 11:34:41','2022-12-28 11:41:53',NULL,1,NULL,0,NULL),(26,1,1,'fee','Fee Income',NULL,'2022-12-23','12','2022','46',1,8,NULL,NULL,NULL,NULL,NULL,NULL,400.0000,400.0000,NULL,1,NULL,'2022-12-28 11:34:41','2022-12-28 11:41:53',NULL,1,NULL,0,NULL),(27,1,1,'disbursement','Loan Disbursement',NULL,'2022-12-23','12','2022','8',1,8,NULL,NULL,NULL,NULL,NULL,NULL,NULL,2000.0000,NULL,1,NULL,'2022-12-28 11:34:41','2022-12-28 11:34:41',NULL,1,NULL,0,NULL),(28,1,2,'disbursement','Loan Disbursement',NULL,'2022-12-23','12','2022','8',1,8,NULL,NULL,NULL,NULL,NULL,NULL,2000.0000,NULL,NULL,1,NULL,'2022-12-28 11:34:41','2022-12-28 11:34:41',NULL,1,NULL,0,NULL),(29,1,8,'fee','Fee Income',NULL,'2022-12-23','12','2022','50',1,8,NULL,NULL,NULL,NULL,NULL,NULL,400.0000,400.0000,NULL,1,NULL,'2022-12-28 11:42:08','2022-12-28 11:42:55',NULL,1,NULL,0,NULL),(30,1,1,'fee','Fee Income',NULL,'2022-12-23','12','2022','50',1,8,NULL,NULL,NULL,NULL,NULL,NULL,400.0000,400.0000,NULL,1,NULL,'2022-12-28 11:42:08','2022-12-28 11:42:55',NULL,1,NULL,0,NULL),(31,1,1,'disbursement','Loan Disbursement',NULL,'2022-12-23','12','2022','8',1,8,NULL,NULL,NULL,NULL,NULL,NULL,NULL,2000.0000,NULL,1,NULL,'2022-12-28 11:42:08','2022-12-28 11:42:08',NULL,1,NULL,0,NULL),(32,1,2,'disbursement','Loan Disbursement',NULL,'2022-12-23','12','2022','8',1,8,NULL,NULL,NULL,NULL,NULL,NULL,2000.0000,NULL,NULL,1,NULL,'2022-12-28 11:42:08','2022-12-28 11:42:08',NULL,1,NULL,0,NULL),(33,1,8,'fee','Fee Income',NULL,'2022-12-23','12','2022','54',1,8,NULL,NULL,NULL,NULL,NULL,NULL,NULL,20.0000,NULL,1,NULL,'2022-12-28 11:44:49','2022-12-28 11:44:49',NULL,1,NULL,0,NULL),(34,1,1,'fee','Fee Income',NULL,'2022-12-23','12','2022','54',1,8,NULL,NULL,NULL,NULL,NULL,NULL,20.0000,NULL,NULL,1,NULL,'2022-12-28 11:44:49','2022-12-28 11:44:49',NULL,1,NULL,0,NULL),(35,1,1,'disbursement','Loan Disbursement',NULL,'2022-12-23','12','2022','8',1,8,NULL,NULL,NULL,NULL,NULL,NULL,NULL,2000.0000,NULL,1,NULL,'2022-12-28 11:44:49','2022-12-28 11:44:49',NULL,1,NULL,0,NULL),(36,1,2,'disbursement','Loan Disbursement',NULL,'2022-12-23','12','2022','8',1,8,NULL,NULL,NULL,NULL,NULL,NULL,2000.0000,NULL,NULL,1,NULL,'2022-12-28 11:44:49','2022-12-28 11:44:49',NULL,1,NULL,0,NULL),(37,1,8,'fee','Fee Income',NULL,'2022-12-28','12','2022','58',2,9,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10.0000,NULL,1,NULL,'2022-12-28 11:47:16','2022-12-28 11:47:16',NULL,1,NULL,0,NULL),(38,1,1,'fee','Fee Income',NULL,'2022-12-28','12','2022','58',2,9,NULL,NULL,NULL,NULL,NULL,NULL,10.0000,NULL,NULL,1,NULL,'2022-12-28 11:47:16','2022-12-28 11:47:16',NULL,1,NULL,0,NULL),(39,1,1,'disbursement','Loan Disbursement',NULL,'2022-12-28','12','2022','9',2,9,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1000.0000,NULL,1,NULL,'2022-12-28 11:47:16','2022-12-28 11:47:16',NULL,1,NULL,0,NULL),(40,1,2,'disbursement','Loan Disbursement',NULL,'2022-12-28','12','2022','9',2,9,NULL,NULL,NULL,NULL,NULL,NULL,1000.0000,NULL,NULL,1,NULL,'2022-12-28 11:47:16','2022-12-28 11:47:16',NULL,1,NULL,0,NULL),(41,1,8,'fee','Fee Income',NULL,'2023-02-10','02','2023','62',4,11,NULL,NULL,NULL,NULL,NULL,NULL,NULL,500.0000,NULL,1,NULL,'2023-02-10 09:06:30','2023-02-10 09:06:30',NULL,1,NULL,0,NULL),(42,1,1,'fee','Fee Income',NULL,'2023-02-10','02','2023','62',4,11,NULL,NULL,NULL,NULL,NULL,NULL,500.0000,NULL,NULL,1,NULL,'2023-02-10 09:06:30','2023-02-10 09:06:30',NULL,1,NULL,0,NULL),(43,1,1,'disbursement','Loan Disbursement',NULL,'2023-02-10','02','2023','11',4,11,NULL,NULL,NULL,NULL,NULL,NULL,NULL,50000.0000,NULL,1,NULL,'2023-02-10 09:06:30','2023-02-10 09:06:30',NULL,1,NULL,0,NULL),(44,1,2,'disbursement','Loan Disbursement',NULL,'2023-02-10','02','2023','11',4,11,NULL,NULL,NULL,NULL,NULL,NULL,50000.0000,NULL,NULL,1,NULL,'2023-02-10 09:06:30','2023-02-10 09:06:30',NULL,1,NULL,0,NULL),(45,1,8,'fee','Fee Income',NULL,'2023-02-17','02','2023','66',1,12,NULL,NULL,NULL,NULL,NULL,NULL,NULL,5.0000,NULL,1,NULL,'2023-02-17 08:02:07','2023-02-17 08:02:07',NULL,1,NULL,0,NULL),(46,1,1,'fee','Fee Income',NULL,'2023-02-17','02','2023','66',1,12,NULL,NULL,NULL,NULL,NULL,NULL,5.0000,NULL,NULL,1,NULL,'2023-02-17 08:02:07','2023-02-17 08:02:07',NULL,1,NULL,0,NULL),(47,1,1,'disbursement','Loan Disbursement',NULL,'2023-02-17','02','2023','12',1,12,NULL,NULL,NULL,NULL,NULL,NULL,NULL,500.0000,NULL,1,NULL,'2023-02-17 08:02:07','2023-02-17 08:02:07',NULL,1,NULL,0,NULL),(48,1,2,'disbursement','Loan Disbursement',NULL,'2023-02-17','02','2023','12',1,12,NULL,NULL,NULL,NULL,NULL,NULL,500.0000,NULL,NULL,1,NULL,'2023-02-17 08:02:07','2023-02-17 08:02:07',NULL,1,NULL,0,NULL),(49,1,8,'fee','Fee Income',NULL,'2023-03-17','03','2023','70',1,13,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.0000,NULL,1,NULL,'2023-02-17 08:06:02','2023-02-17 08:06:02',NULL,1,NULL,0,NULL),(50,1,1,'fee','Fee Income',NULL,'2023-03-17','03','2023','70',1,13,NULL,NULL,NULL,NULL,NULL,NULL,1.0000,NULL,NULL,1,NULL,'2023-02-17 08:06:02','2023-02-17 08:06:02',NULL,1,NULL,0,NULL),(51,1,1,'disbursement','Loan Disbursement',NULL,'2023-03-17','03','2023','13',1,13,NULL,NULL,NULL,NULL,NULL,NULL,NULL,100.0000,NULL,1,NULL,'2023-02-17 08:06:02','2023-02-17 08:06:02',NULL,1,NULL,0,NULL),(52,1,2,'disbursement','Loan Disbursement',NULL,'2023-03-17','03','2023','13',1,13,NULL,NULL,NULL,NULL,NULL,NULL,100.0000,NULL,NULL,1,NULL,'2023-02-17 08:06:02','2023-02-17 08:06:02',NULL,1,NULL,0,NULL),(53,1,8,'fee','Fee Income',NULL,'2023-02-17','02','2023','74',1,14,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.0000,NULL,1,NULL,'2023-02-17 08:09:52','2023-02-17 08:09:52',NULL,1,NULL,0,NULL),(54,1,1,'fee','Fee Income',NULL,'2023-02-17','02','2023','74',1,14,NULL,NULL,NULL,NULL,NULL,NULL,1.0000,NULL,NULL,1,NULL,'2023-02-17 08:09:52','2023-02-17 08:09:52',NULL,1,NULL,0,NULL),(55,1,1,'disbursement','Loan Disbursement',NULL,'2023-02-17','02','2023','14',1,14,NULL,NULL,NULL,NULL,NULL,NULL,NULL,100.0000,NULL,1,NULL,'2023-02-17 08:09:52','2023-02-17 08:09:52',NULL,1,NULL,0,NULL),(56,1,2,'disbursement','Loan Disbursement',NULL,'2023-02-17','02','2023','14',1,14,NULL,NULL,NULL,NULL,NULL,NULL,100.0000,NULL,NULL,1,NULL,'2023-02-17 08:09:52','2023-02-17 08:09:52',NULL,1,NULL,0,NULL),(57,1,8,'fee','Fee Income',NULL,'2023-02-17','02','2023','78',1,15,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.0000,NULL,1,NULL,'2023-02-17 08:10:51','2023-02-17 08:10:51',NULL,1,NULL,0,NULL),(58,1,1,'fee','Fee Income',NULL,'2023-02-17','02','2023','78',1,15,NULL,NULL,NULL,NULL,NULL,NULL,1.0000,NULL,NULL,1,NULL,'2023-02-17 08:10:51','2023-02-17 08:10:51',NULL,1,NULL,0,NULL),(59,1,1,'disbursement','Loan Disbursement',NULL,'2023-02-17','02','2023','15',1,15,NULL,NULL,NULL,NULL,NULL,NULL,NULL,100.0000,NULL,1,NULL,'2023-02-17 08:10:51','2023-02-17 08:10:51',NULL,1,NULL,0,NULL),(60,1,2,'disbursement','Loan Disbursement',NULL,'2023-02-17','02','2023','15',1,15,NULL,NULL,NULL,NULL,NULL,NULL,100.0000,NULL,NULL,1,NULL,'2023-02-17 08:10:51','2023-02-17 08:10:51',NULL,1,NULL,0,NULL),(61,1,8,'fee','Fee Income',NULL,'2023-02-17','02','2023','82',1,16,NULL,NULL,NULL,NULL,NULL,NULL,NULL,2.5000,NULL,1,NULL,'2023-02-17 08:13:01','2023-02-17 08:13:01',NULL,1,NULL,0,NULL),(62,1,1,'fee','Fee Income',NULL,'2023-02-17','02','2023','82',1,16,NULL,NULL,NULL,NULL,NULL,NULL,2.5000,NULL,NULL,1,NULL,'2023-02-17 08:13:01','2023-02-17 08:13:01',NULL,1,NULL,0,NULL),(63,1,1,'disbursement','Loan Disbursement',NULL,'2023-02-17','02','2023','16',1,16,NULL,NULL,NULL,NULL,NULL,NULL,NULL,250.0000,NULL,1,NULL,'2023-02-17 08:13:01','2023-02-17 08:13:01',NULL,1,NULL,0,NULL),(64,1,2,'disbursement','Loan Disbursement',NULL,'2023-02-17','02','2023','16',1,16,NULL,NULL,NULL,NULL,NULL,NULL,250.0000,NULL,NULL,1,NULL,'2023-02-17 08:13:01','2023-02-17 08:13:01',NULL,1,NULL,0,NULL),(65,1,8,'fee','Fee Income',NULL,'2023-02-17','02','2023','86',1,17,NULL,NULL,NULL,NULL,NULL,NULL,NULL,100.0000,NULL,1,NULL,'2023-02-17 08:17:47','2023-02-17 08:17:47',NULL,1,NULL,0,NULL),(66,1,1,'fee','Fee Income',NULL,'2023-02-17','02','2023','86',1,17,NULL,NULL,NULL,NULL,NULL,NULL,100.0000,NULL,NULL,1,NULL,'2023-02-17 08:17:47','2023-02-17 08:17:47',NULL,1,NULL,0,NULL),(67,1,1,'disbursement','Loan Disbursement',NULL,'2023-02-17','02','2023','17',1,17,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10000.0000,NULL,1,NULL,'2023-02-17 08:17:47','2023-02-17 08:17:47',NULL,1,NULL,0,NULL),(68,1,2,'disbursement','Loan Disbursement',NULL,'2023-02-17','02','2023','17',1,17,NULL,NULL,NULL,NULL,NULL,NULL,10000.0000,NULL,NULL,1,NULL,'2023-02-17 08:17:47','2023-02-17 08:17:47',NULL,1,NULL,0,NULL),(69,1,8,'fee','Fee Income',NULL,'2023-02-17','02','2023','90',1,18,NULL,NULL,NULL,NULL,NULL,NULL,1.0000,1.0000,NULL,1,NULL,'2023-02-17 08:28:34','2023-02-17 08:28:58',NULL,1,NULL,0,NULL),(70,1,1,'fee','Fee Income',NULL,'2023-02-17','02','2023','90',1,18,NULL,NULL,NULL,NULL,NULL,NULL,1.0000,1.0000,NULL,1,NULL,'2023-02-17 08:28:34','2023-02-17 08:28:58',NULL,1,NULL,0,NULL),(71,1,1,'disbursement','Loan Disbursement',NULL,'2023-02-17','02','2023','18',1,18,NULL,NULL,NULL,NULL,NULL,NULL,NULL,295.0000,NULL,1,NULL,'2023-02-17 08:28:34','2023-02-17 08:28:34',NULL,1,NULL,0,NULL),(72,1,2,'disbursement','Loan Disbursement',NULL,'2023-02-17','02','2023','18',1,18,NULL,NULL,NULL,NULL,NULL,NULL,295.0000,NULL,NULL,1,NULL,'2023-02-17 08:28:34','2023-02-17 08:28:34',NULL,1,NULL,0,NULL),(73,1,8,'fee','Fee Income',NULL,'2023-02-17','02','2023','94',1,18,NULL,NULL,NULL,NULL,NULL,NULL,1.0000,1.0000,NULL,1,NULL,'2023-02-17 08:29:24','2023-02-17 08:29:58',NULL,1,NULL,0,NULL),(74,1,1,'fee','Fee Income',NULL,'2023-02-17','02','2023','94',1,18,NULL,NULL,NULL,NULL,NULL,NULL,1.0000,1.0000,NULL,1,NULL,'2023-02-17 08:29:24','2023-02-17 08:29:58',NULL,1,NULL,0,NULL),(75,1,1,'disbursement','Loan Disbursement',NULL,'2023-02-17','02','2023','18',1,18,NULL,NULL,NULL,NULL,NULL,NULL,NULL,295.0000,NULL,1,NULL,'2023-02-17 08:29:24','2023-02-17 08:29:24',NULL,1,NULL,0,NULL),(76,1,2,'disbursement','Loan Disbursement',NULL,'2023-02-17','02','2023','18',1,18,NULL,NULL,NULL,NULL,NULL,NULL,295.0000,NULL,NULL,1,NULL,'2023-02-17 08:29:24','2023-02-17 08:29:24',NULL,1,NULL,0,NULL),(77,1,8,'fee','Fee Income',NULL,'2023-02-17','02','2023','98',1,18,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.0000,NULL,1,NULL,'2023-02-17 08:30:22','2023-02-17 08:30:22',NULL,1,NULL,0,NULL),(78,1,1,'fee','Fee Income',NULL,'2023-02-17','02','2023','98',1,18,NULL,NULL,NULL,NULL,NULL,NULL,1.0000,NULL,NULL,1,NULL,'2023-02-17 08:30:22','2023-02-17 08:30:22',NULL,1,NULL,0,NULL),(79,1,1,'disbursement','Loan Disbursement',NULL,'2023-02-17','02','2023','18',1,18,NULL,NULL,NULL,NULL,NULL,NULL,NULL,295.0000,NULL,1,NULL,'2023-02-17 08:30:22','2023-02-17 08:30:22',NULL,1,NULL,0,NULL),(80,1,2,'disbursement','Loan Disbursement',NULL,'2023-02-17','02','2023','18',1,18,NULL,NULL,NULL,NULL,NULL,NULL,295.0000,NULL,NULL,1,NULL,'2023-02-17 08:30:22','2023-02-17 08:30:22',NULL,1,NULL,0,NULL),(81,1,2,'repayment','Principal Repayment',NULL,'2023-02-17','02','2023','99',1,13,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10.0000,NULL,1,NULL,'2023-02-17 08:50:44','2023-02-17 08:50:44',99,1,'repayment_principal',0,NULL),(82,1,1,'repayment','Principal Repayment',NULL,'2023-02-17','02','2023','99',1,13,NULL,NULL,NULL,NULL,NULL,NULL,10.0000,NULL,NULL,1,NULL,'2023-02-17 08:50:44','2023-02-17 08:50:44',99,1,NULL,0,NULL),(83,1,7,'repayment','Interest Repayment',NULL,'2023-02-17','02','2023','99',1,13,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10.0000,NULL,1,NULL,'2023-02-17 08:50:44','2023-02-17 08:50:44',99,1,'repayment_interest',0,NULL),(84,1,3,'repayment','Interest Repayment',NULL,'2023-02-17','02','2023','99',1,13,NULL,NULL,NULL,NULL,NULL,NULL,10.0000,NULL,NULL,1,NULL,'2023-02-17 08:50:44','2023-02-17 08:50:44',99,1,NULL,0,NULL),(85,1,2,'repayment','Principal Repayment',NULL,'2023-02-17','02','2023','100',1,15,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10.0000,NULL,1,NULL,'2023-02-17 08:51:14','2023-02-17 08:51:14',100,1,'repayment_principal',0,NULL),(86,1,1,'repayment','Principal Repayment',NULL,'2023-02-17','02','2023','100',1,15,NULL,NULL,NULL,NULL,NULL,NULL,10.0000,NULL,NULL,1,NULL,'2023-02-17 08:51:14','2023-02-17 08:51:14',100,1,NULL,0,NULL),(87,1,7,'repayment','Interest Repayment',NULL,'2023-02-17','02','2023','100',1,15,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10.0000,NULL,1,NULL,'2023-02-17 08:51:14','2023-02-17 08:51:14',100,1,'repayment_interest',0,NULL),(88,1,3,'repayment','Interest Repayment',NULL,'2023-02-17','02','2023','100',1,15,NULL,NULL,NULL,NULL,NULL,NULL,10.0000,NULL,NULL,1,NULL,'2023-02-17 08:51:14','2023-02-17 08:51:14',100,1,NULL,0,NULL),(89,1,1,'disbursement','Loan Disbursement',NULL,NULL,'02','2023','19',1,19,NULL,NULL,NULL,NULL,NULL,NULL,NULL,150.0000,NULL,1,NULL,'2023-02-17 08:58:52','2023-02-17 08:58:52',NULL,1,NULL,0,NULL),(90,1,2,'disbursement','Loan Disbursement',NULL,NULL,'02','2023','19',1,19,NULL,NULL,NULL,NULL,NULL,NULL,150.0000,NULL,NULL,1,NULL,'2023-02-17 08:58:52','2023-02-17 08:58:52',NULL,1,NULL,0,NULL),(91,1,2,'repayment','Principal Repayment',NULL,'2023-02-21','02','2023','105',1,19,NULL,NULL,NULL,NULL,NULL,NULL,NULL,103.2000,NULL,1,NULL,'2023-02-21 09:00:41','2023-02-21 09:00:41',105,1,NULL,0,NULL),(92,1,1,'repayment','Principal Repayment',NULL,'2023-02-21','02','2023','105',1,19,NULL,NULL,NULL,NULL,NULL,NULL,103.2000,NULL,NULL,1,NULL,'2023-02-21 09:00:41','2023-02-21 09:00:41',105,1,NULL,0,NULL),(93,1,7,'','Interest Pay Off',NULL,'2023-02-21','02','2023','105',1,19,NULL,NULL,NULL,NULL,NULL,NULL,NULL,58.8000,NULL,1,NULL,'2023-02-21 09:00:41','2023-02-21 09:00:41',105,1,'repayment_interest',0,NULL),(94,1,3,'','Interest Pay Off',NULL,'2023-02-21','02','2023','105',1,19,NULL,NULL,NULL,NULL,NULL,NULL,58.8000,NULL,NULL,1,NULL,'2023-02-21 09:00:41','2023-02-21 09:00:41',105,1,NULL,0,NULL);

--
-- Table structure for table `loan_applications`
--

CREATE TABLE `loan_applications` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `borrower_id` int unsigned DEFAULT NULL,
  `loan_product_id` int NOT NULL,
  `amount` decimal(65,4) DEFAULT NULL,
  `status` enum('approved','pending','declined') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `branch_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `loan_applications_id_index` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `loan_applications`
--


--
-- Table structure for table `loan_charges`
--

CREATE TABLE `loan_charges` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `charge_id` int DEFAULT NULL,
  `loan_id` int DEFAULT NULL,
  `amount` decimal(65,2) DEFAULT NULL,
  `date` date DEFAULT NULL,
  `grace_period` int NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `loan_charges`
--

INSERT INTO `loan_charges` VALUES (1,1,1,8,20.00,NULL,0,'2022-12-23 12:03:54','2022-12-23 12:03:54'),(3,1,1,9,10.00,NULL,0,'2022-12-28 10:37:17','2022-12-28 10:37:17'),(6,5,1,10,1.00,NULL,0,'2023-01-06 17:41:40','2023-01-06 17:41:40'),(7,1,1,11,500.00,NULL,0,'2023-02-10 09:06:00','2023-02-10 09:06:00'),(8,1,1,12,5.00,NULL,0,'2023-02-17 08:01:54','2023-02-17 08:01:54'),(10,1,1,13,1.00,NULL,0,'2023-02-17 08:05:51','2023-02-17 08:05:51'),(12,1,1,14,1.00,NULL,0,'2023-02-17 08:09:32','2023-02-17 08:09:32'),(13,1,1,15,1.00,NULL,0,'2023-02-17 08:10:39','2023-02-17 08:10:39'),(14,1,1,16,2.50,NULL,0,'2023-02-17 08:12:06','2023-02-17 08:12:06'),(15,1,1,17,100.00,NULL,0,'2023-02-17 08:17:37','2023-02-17 08:17:37'),(19,1,1,18,1.00,NULL,0,'2023-02-17 08:30:12','2023-02-17 08:30:12');

--
-- Table structure for table `loan_comments`
--

CREATE TABLE `loan_comments` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned NOT NULL,
  `loan_id` int unsigned NOT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `loan_comments`
--

INSERT INTO `loan_comments` VALUES (1,1,2,'test','2022-10-18 15:33:32','2022-10-18 15:33:32'),(2,1,4,'test','2022-11-16 15:20:47','2022-11-16 15:20:47');

--
-- Table structure for table `loan_disbursed_by`
--

CREATE TABLE `loan_disbursed_by` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `loan_disbursed_by`
--

INSERT INTO `loan_disbursed_by` VALUES (1,'Admin');

--
-- Table structure for table `loan_fees`
--

CREATE TABLE `loan_fees` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `loan_fee_type` enum('fixed','percentage') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `loan_fees`
--


--
-- Table structure for table `loan_fees_meta`
--

CREATE TABLE `loan_fees_meta` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `category` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `parent_id` int DEFAULT NULL,
  `loan_fees_id` int DEFAULT NULL,
  `value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `loan_fees_schedule` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `loan_fees_meta`
--


--
-- Table structure for table `loan_guarantors`
--

CREATE TABLE `loan_guarantors` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned DEFAULT NULL,
  `loan_id` int unsigned DEFAULT NULL,
  `borrower_id` int unsigned DEFAULT NULL,
  `guarantor_id` int unsigned DEFAULT NULL,
  `loan_application_id` int unsigned DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `loan_guarantors`
--


--
-- Table structure for table `loan_overdue_penalties`
--

CREATE TABLE `loan_overdue_penalties` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `type` enum('fixed','percentage') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(65,2) DEFAULT NULL,
  `days` int NOT NULL DEFAULT '10',
  `active` tinyint NOT NULL DEFAULT '1',
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `loan_overdue_penalties`
--


--
-- Table structure for table `loan_product_charges`
--

CREATE TABLE `loan_product_charges` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `charge_id` int DEFAULT NULL,
  `loan_product_id` int DEFAULT NULL,
  `amount` decimal(65,2) DEFAULT NULL,
  `date` date DEFAULT NULL,
  `grace_period` int NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `penalty` tinyint NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `loan_product_charges`
--

INSERT INTO `loan_product_charges` VALUES (2,1,1,2,NULL,NULL,0,'2022-12-23 11:59:37','2022-12-23 11:59:37',0),(4,1,1,1,NULL,NULL,0,'2022-12-28 11:44:21','2022-12-28 11:44:21',0);

--
-- Table structure for table `loan_products`
--

CREATE TABLE `loan_products` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `loan_disbursed_by_id` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `minimum_principal` decimal(65,4) DEFAULT NULL,
  `default_principal` decimal(65,4) DEFAULT NULL,
  `maximum_principal` decimal(65,4) DEFAULT NULL,
  `interest_method` enum('flat_rate','declining_balance_equal_installments','declining_balance_equal_principal','interest_only','compound_interest') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'flat_rate',
  `interest_rate` decimal(10,4) DEFAULT NULL,
  `interest_period` enum('day','week','month','year') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'year',
  `minimum_interest_rate` decimal(10,4) DEFAULT NULL,
  `default_interest_rate` decimal(10,4) DEFAULT NULL,
  `maximum_interest_rate` decimal(10,4) DEFAULT NULL,
  `override_interest` tinyint NOT NULL DEFAULT '0',
  `override_interest_amount` decimal(10,4) NOT NULL DEFAULT '0.0000',
  `default_loan_duration` int DEFAULT NULL,
  `default_loan_duration_type` enum('day','week','month','year') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'year',
  `repayment_cycle` enum('daily','weekly','monthly','bi_monthly','quarterly','semi_annually','annually') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'monthly',
  `decimal_places` enum('round_off_to_two_decimal','round_off_to_integer') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'round_off_to_two_decimal',
  `repayment_order` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `loan_fees_schedule` enum('dont_include','distribute_fees_evenly','charge_fees_on_released_date','charge_fees_on_first_payment','charge_fees_on_last_payment') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'distribute_fees_evenly',
  `branch_access` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `grace_on_interest_charged` int DEFAULT NULL,
  `advanced_enabled` tinyint DEFAULT '0',
  `enable_late_repayment_penalty` tinyint DEFAULT '0',
  `enable_after_maturity_date_penalty` tinyint DEFAULT '0',
  `after_maturity_date_penalty_type` enum('percentage','fixed') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'percentage',
  `late_repayment_penalty_type` enum('percentage','fixed') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'percentage',
  `late_repayment_penalty_calculate` enum('overdue_principal','overdue_principal_interest','overdue_principal_interest_fees','total_overdue') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'overdue_principal',
  `after_maturity_date_penalty_calculate` enum('overdue_principal','overdue_principal_interest','overdue_principal_interest_fees','total_overdue') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'overdue_principal',
  `late_repayment_penalty_amount` decimal(10,4) DEFAULT NULL,
  `after_maturity_date_penalty_amount` decimal(10,4) DEFAULT NULL,
  `late_repayment_penalty_grace_period` int DEFAULT NULL,
  `after_maturity_date_penalty_grace_period` int DEFAULT NULL,
  `late_repayment_penalty_recurring` int DEFAULT NULL,
  `after_maturity_date_penalty_recurring` int DEFAULT NULL,
  `accounting_rule` enum('cash_based','accrual_periodic','accrual_upfront') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'cash_based',
  `chart_fund_source_id` int DEFAULT NULL,
  `chart_loan_portfolio_id` int DEFAULT NULL,
  `chart_receivable_interest_id` int DEFAULT NULL,
  `chart_receivable_fee_id` int DEFAULT NULL,
  `chart_receivable_penalty_id` int DEFAULT NULL,
  `chart_loan_over_payments_id` int DEFAULT NULL,
  `chart_income_interest_id` int DEFAULT NULL,
  `chart_income_fee_id` int DEFAULT NULL,
  `chart_income_penalty_id` int DEFAULT NULL,
  `chart_income_recovery_id` int DEFAULT NULL,
  `chart_loans_written_off_id` int DEFAULT NULL,
  `after_maturity_date_penalty_system_type` enum('system','user') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'system',
  `after_maturity_date_penalties` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `loan_products`
--

INSERT INTO `loan_products` VALUES (1,NULL,'Personal Loan','a:0:{}',0.0000,100.0000,50000.0000,'flat_rate',NULL,'month',0.0000,8.0000,50.0000,0,0.0000,4,'month','monthly','round_off_to_two_decimal','a:4:{i:0;s:7:\"penalty\";i:1;s:4:\"fees\";i:2;s:8:\"interest\";i:3;s:9:\"principal\";}',NULL,NULL,0,0,1,0,'fixed','fixed','overdue_principal_interest','overdue_principal',1.0000,NULL,0,0,NULL,NULL,'cash_based',1,2,3,4,5,6,7,8,9,10,11,'system',NULL),(2,NULL,'Business Loan','a:0:{}',1000.0000,100.0000,1000000.0000,'flat_rate',NULL,'month',0.0000,8.0000,50.0000,0,0.0000,12,'month','daily','round_off_to_two_decimal','a:4:{i:0;s:7:\"penalty\";i:1;s:4:\"fees\";i:2;s:8:\"interest\";i:3;s:9:\"principal\";}',NULL,NULL,0,0,1,0,'percentage','fixed','overdue_principal_interest','overdue_principal',1.0000,NULL,0,0,NULL,NULL,'cash_based',1,2,3,4,5,6,7,8,9,10,11,'system',NULL);

--
-- Table structure for table `loan_repayment_methods`
--

CREATE TABLE `loan_repayment_methods` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `loan_repayment_methods`
--

INSERT INTO `loan_repayment_methods` VALUES (1,'Cash');

--
-- Table structure for table `loan_repayments`
--

CREATE TABLE `loan_repayments` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `loan_id` int unsigned NOT NULL,
  `borrower_id` int unsigned DEFAULT NULL,
  `user_id` int unsigned NOT NULL,
  `amount` decimal(10,4) NOT NULL,
  `repayment_method_id` int unsigned NOT NULL,
  `collection_date` date DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `month` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `year` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `due_date` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `branch_id` int DEFAULT NULL,
  `receipt` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `loan_repayments_id_index` (`id`),
  KEY `loan_repayments_borrower_id_index` (`borrower_id`),
  KEY `loan_repayments_loan_id_index` (`loan_id`),
  KEY `loan_repayments_year_index` (`year`),
  KEY `loan_repayments_month_index` (`month`),
  KEY `loan_repayments_due_date_index` (`due_date`),
  KEY `loan_repayments_collection_date_index` (`collection_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `loan_repayments`
--


--
-- Table structure for table `loan_schedules`
--

CREATE TABLE `loan_schedules` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `loan_id` int NOT NULL,
  `borrower_id` int NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `due_date` date DEFAULT NULL,
  `month` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `year` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `principal` decimal(10,4) DEFAULT NULL,
  `principal_balance` decimal(10,4) DEFAULT NULL,
  `interest` decimal(10,4) DEFAULT NULL,
  `fees` decimal(10,4) DEFAULT NULL,
  `penalty` decimal(10,4) DEFAULT NULL,
  `due` decimal(10,4) DEFAULT NULL,
  `system_generated` tinyint NOT NULL DEFAULT '0',
  `closed` tinyint NOT NULL DEFAULT '0',
  `missed` tinyint NOT NULL DEFAULT '0',
  `missed_penalty_applied` tinyint NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `branch_id` int DEFAULT NULL,
  `fees_waived` decimal(65,4) DEFAULT NULL,
  `penalty_waived` decimal(65,4) DEFAULT NULL,
  `interest_waived` decimal(65,4) DEFAULT NULL,
  `principal_waived` decimal(65,4) DEFAULT NULL,
  `pay_off` decimal(10,4) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `loan_schedules_id_index` (`id`),
  KEY `loan_schedules_borrower_id_index` (`borrower_id`),
  KEY `loan_schedules_loan_id_index` (`loan_id`),
  KEY `loan_schedules_year_index` (`year`),
  KEY `loan_schedules_month_index` (`month`),
  KEY `loan_schedules_due_date_index` (`due_date`)
) ENGINE=InnoDB AUTO_INCREMENT=256 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `loan_schedules`
--

INSERT INTO `loan_schedules` VALUES (1,1,1,'Repayment','2022-10-31','10','2022',8.3333,91.6667,8.7742,NULL,NULL,17.1075,0,0,0,0,'2022-09-29 08:41:49','2022-09-29 08:41:49',NULL,1,NULL,NULL,NULL,NULL,NULL),(2,1,1,'Repayment','2022-12-01','12','2022',8.3333,83.3333,8.0000,NULL,NULL,16.3333,0,0,0,0,'2022-09-29 08:41:49','2022-09-29 08:41:49',NULL,1,NULL,NULL,NULL,NULL,NULL),(3,1,1,'Repayment','2023-01-01','01','2023',8.3333,75.0000,8.0000,NULL,NULL,16.3333,0,0,0,0,'2022-09-29 08:41:49','2022-09-29 08:41:49',NULL,1,NULL,NULL,NULL,NULL,NULL),(4,1,1,'Repayment','2023-02-01','02','2023',8.3333,66.6667,8.0000,NULL,NULL,16.3333,0,0,0,0,'2022-09-29 08:41:49','2022-09-29 08:41:49',NULL,1,NULL,NULL,NULL,NULL,NULL),(5,1,1,'Repayment','2023-03-01','03','2023',8.3333,58.3333,8.0000,NULL,NULL,16.3333,0,0,0,0,'2022-09-29 08:41:49','2022-09-29 08:41:49',NULL,1,NULL,NULL,NULL,NULL,NULL),(6,1,1,'Repayment','2023-04-01','04','2023',8.3333,50.0000,8.0000,NULL,NULL,16.3333,0,0,0,0,'2022-09-29 08:41:49','2022-09-29 08:41:49',NULL,1,NULL,NULL,NULL,NULL,NULL),(7,1,1,'Repayment','2023-05-01','05','2023',8.3333,41.6667,8.0000,NULL,NULL,16.3333,0,0,0,0,'2022-09-29 08:41:49','2022-09-29 08:41:49',NULL,1,NULL,NULL,NULL,NULL,NULL),(8,1,1,'Repayment','2023-06-01','06','2023',8.3333,33.3333,8.0000,NULL,NULL,16.3333,0,0,0,0,'2022-09-29 08:41:49','2022-09-29 08:41:49',NULL,1,NULL,NULL,NULL,NULL,NULL),(9,1,1,'Repayment','2023-07-01','07','2023',8.3333,25.0000,8.0000,NULL,NULL,16.3333,0,0,0,0,'2022-09-29 08:41:49','2022-09-29 08:41:49',NULL,1,NULL,NULL,NULL,NULL,NULL),(10,1,1,'Repayment','2023-08-01','08','2023',8.3333,16.6667,8.0000,NULL,NULL,16.3333,0,0,0,0,'2022-09-29 08:41:49','2022-09-29 08:41:49',NULL,1,NULL,NULL,NULL,NULL,NULL),(11,1,1,'Repayment','2023-09-01','09','2023',8.3333,8.3333,8.0000,NULL,NULL,16.3333,0,0,0,0,'2022-09-29 08:41:49','2022-09-29 08:41:49',NULL,1,NULL,NULL,NULL,NULL,NULL),(12,1,1,'Repayment','2023-10-01','10','2023',8.3333,0.0000,8.0000,NULL,NULL,16.3333,0,0,0,0,'2022-09-29 08:41:49','2022-09-29 08:41:49',NULL,1,NULL,NULL,NULL,NULL,NULL),(13,2,1,'Repayment','2022-11-01','11','2022',12.5000,187.5000,1.8667,NULL,0.8677,14.3667,0,0,0,1,'2022-10-18 15:34:16','2023-02-17 09:05:15',NULL,1,NULL,1.0000,NULL,NULL,NULL),(14,2,1,'Repayment','2022-11-08','11','2022',12.5000,175.0000,4.0000,NULL,0.9900,16.5000,0,0,0,1,'2022-10-18 15:34:16','2022-11-14 07:11:18',NULL,1,NULL,NULL,NULL,NULL,NULL),(15,2,1,'Repayment','2022-11-15','11','2022',12.5000,162.5000,4.0000,NULL,NULL,16.5000,0,0,0,0,'2022-10-18 15:34:16','2022-10-18 15:34:16',NULL,1,NULL,NULL,NULL,NULL,NULL),(16,2,1,'Repayment','2022-11-22','11','2022',12.5000,150.0000,4.0000,NULL,NULL,16.5000,0,0,0,0,'2022-10-18 15:34:16','2022-10-18 15:34:16',NULL,1,NULL,NULL,NULL,NULL,NULL),(17,2,1,'Repayment','2022-11-29','11','2022',12.5000,137.5000,4.0000,NULL,NULL,16.5000,0,0,0,0,'2022-10-18 15:34:16','2022-10-18 15:34:16',NULL,1,NULL,NULL,NULL,NULL,NULL),(18,2,1,'Repayment','2022-12-06','12','2022',12.5000,125.0000,4.0000,NULL,NULL,16.5000,0,0,0,0,'2022-10-18 15:34:16','2022-10-18 15:34:16',NULL,1,NULL,NULL,NULL,NULL,NULL),(19,2,1,'Repayment','2022-12-13','12','2022',12.5000,112.5000,4.0000,NULL,NULL,16.5000,0,0,0,0,'2022-10-18 15:34:16','2022-10-18 15:34:16',NULL,1,NULL,NULL,NULL,NULL,NULL),(20,2,1,'Repayment','2022-12-20','12','2022',12.5000,100.0000,4.0000,NULL,NULL,16.5000,0,0,0,0,'2022-10-18 15:34:16','2022-10-18 15:34:16',NULL,1,NULL,NULL,NULL,NULL,NULL),(21,2,1,'Repayment','2022-12-27','12','2022',12.5000,87.5000,4.0000,NULL,NULL,16.5000,0,0,0,0,'2022-10-18 15:34:16','2022-10-18 15:34:16',NULL,1,NULL,NULL,NULL,NULL,NULL),(22,2,1,'Repayment','2023-01-03','01','2023',12.5000,75.0000,4.0000,NULL,NULL,16.5000,0,0,0,0,'2022-10-18 15:34:16','2022-10-18 15:34:16',NULL,1,NULL,NULL,NULL,NULL,NULL),(23,2,1,'Repayment','2023-01-10','01','2023',12.5000,62.5000,4.0000,NULL,NULL,16.5000,0,0,0,0,'2022-10-18 15:34:16','2022-10-18 15:34:16',NULL,1,NULL,NULL,NULL,NULL,NULL),(24,2,1,'Repayment','2023-01-17','01','2023',12.5000,50.0000,4.0000,NULL,NULL,16.5000,0,0,0,0,'2022-10-18 15:34:16','2022-10-18 15:34:16',NULL,1,NULL,NULL,NULL,NULL,NULL),(25,2,1,'Repayment','2023-01-24','01','2023',12.5000,37.5000,4.0000,NULL,NULL,16.5000,0,0,0,0,'2022-10-18 15:34:16','2022-10-18 15:34:16',NULL,1,NULL,NULL,NULL,NULL,NULL),(26,2,1,'Repayment','2023-01-31','01','2023',12.5000,25.0000,4.0000,NULL,NULL,16.5000,0,0,0,0,'2022-10-18 15:34:16','2022-10-18 15:34:16',NULL,1,NULL,NULL,NULL,NULL,NULL),(27,2,1,'Repayment','2023-02-07','02','2023',12.5000,12.5000,4.0000,NULL,NULL,16.5000,0,0,0,0,'2022-10-18 15:34:16','2022-10-18 15:34:16',NULL,1,NULL,NULL,NULL,NULL,NULL),(28,2,1,'Repayment','2023-02-14','02','2023',12.5000,0.0000,4.0000,NULL,NULL,16.5000,0,0,0,0,'2022-10-18 15:34:16','2022-10-18 15:34:16',NULL,1,NULL,NULL,NULL,NULL,NULL),(29,3,2,'Repayment','2022-11-01','11','2022',125.0000,375.0000,14.6667,NULL,NULL,139.6667,0,0,0,0,'2022-10-21 10:31:43','2022-11-03 11:31:25','2022-11-03 11:31:25',1,NULL,NULL,NULL,NULL,NULL),(30,3,2,'Repayment','2022-12-01','12','2022',125.0000,250.0000,30.0000,NULL,NULL,155.0000,0,0,0,0,'2022-10-21 10:31:43','2022-11-03 11:31:25','2022-11-03 11:31:25',1,NULL,NULL,NULL,NULL,NULL),(31,3,2,'Repayment','2023-01-01','01','2023',125.0000,125.0000,20.0000,NULL,NULL,145.0000,0,0,0,0,'2022-10-21 10:31:43','2022-11-03 11:31:25','2022-11-03 11:31:25',1,NULL,NULL,NULL,NULL,NULL),(32,3,2,'Repayment','2023-02-01','02','2023',125.0000,0.0000,10.0000,NULL,NULL,135.0000,0,0,0,0,'2022-10-21 10:31:43','2022-11-03 11:31:25','2022-11-03 11:31:25',1,NULL,NULL,NULL,NULL,NULL),(33,3,2,'Repayment','2022-11-01','11','2022',125.0000,375.0000,14.6667,NULL,NULL,139.6667,0,0,0,0,'2022-11-03 11:31:46','2022-11-03 11:32:07','2022-11-03 11:32:07',1,NULL,NULL,NULL,NULL,NULL),(34,3,2,'Repayment','2022-12-01','12','2022',125.0000,250.0000,30.0000,NULL,NULL,155.0000,0,0,0,0,'2022-11-03 11:31:46','2022-11-03 11:32:07','2022-11-03 11:32:07',1,NULL,NULL,NULL,NULL,NULL),(35,3,2,'Repayment','2023-01-01','01','2023',125.0000,125.0000,20.0000,NULL,NULL,145.0000,0,0,0,0,'2022-11-03 11:31:46','2022-11-03 11:32:07','2022-11-03 11:32:07',1,NULL,NULL,NULL,NULL,NULL),(36,3,2,'Repayment','2023-02-01','02','2023',125.0000,0.0000,10.0000,NULL,NULL,135.0000,0,0,0,0,'2022-11-03 11:31:46','2022-11-03 11:32:07','2022-11-03 11:32:07',1,NULL,NULL,NULL,NULL,NULL),(37,3,2,'Repayment','2022-11-01','11','2022',125.0000,375.0000,2.7500,NULL,NULL,127.7500,0,0,0,0,'2022-11-03 11:32:58','2022-11-03 11:35:41','2022-11-03 11:35:41',1,NULL,NULL,NULL,NULL,NULL),(38,3,2,'Repayment','2022-12-01','12','2022',125.0000,250.0000,7.5000,NULL,NULL,132.5000,0,0,0,0,'2022-11-03 11:32:58','2022-11-03 11:35:41','2022-11-03 11:35:41',1,NULL,NULL,NULL,NULL,NULL),(39,3,2,'Repayment','2023-01-01','01','2023',125.0000,125.0000,7.5000,NULL,NULL,132.5000,0,0,0,0,'2022-11-03 11:32:58','2022-11-03 11:35:41','2022-11-03 11:35:41',1,NULL,NULL,NULL,NULL,NULL),(40,3,2,'Repayment','2023-02-01','02','2023',125.0000,0.0000,7.5000,NULL,NULL,132.5000,0,0,0,0,'2022-11-03 11:32:58','2022-11-03 11:35:41','2022-11-03 11:35:41',1,NULL,NULL,NULL,NULL,NULL),(41,3,2,'Repayment','2022-11-01','11','2022',166.6667,833.3333,5.5000,NULL,NULL,172.1667,0,0,0,0,'2022-11-03 11:36:43','2022-11-03 11:37:28','2022-11-03 11:37:28',1,NULL,NULL,NULL,NULL,NULL),(42,3,2,'Repayment','2022-12-01','12','2022',166.6667,666.6667,15.0000,NULL,NULL,181.6667,0,0,0,0,'2022-11-03 11:36:43','2022-11-03 11:37:28','2022-11-03 11:37:28',1,NULL,NULL,NULL,NULL,NULL),(43,3,2,'Repayment','2023-01-01','01','2023',166.6667,500.0000,15.0000,NULL,NULL,181.6667,0,0,0,0,'2022-11-03 11:36:43','2022-11-03 11:37:28','2022-11-03 11:37:28',1,NULL,NULL,NULL,NULL,NULL),(44,3,2,'Repayment','2023-02-01','02','2023',166.6667,333.3333,15.0000,NULL,NULL,181.6667,0,0,0,0,'2022-11-03 11:36:43','2022-11-03 11:37:28','2022-11-03 11:37:28',1,NULL,NULL,NULL,NULL,NULL),(45,3,2,'Repayment','2023-03-01','03','2023',166.6667,166.6667,15.0000,NULL,NULL,181.6667,0,0,0,0,'2022-11-03 11:36:43','2022-11-03 11:37:28','2022-11-03 11:37:28',1,NULL,NULL,NULL,NULL,NULL),(46,3,2,'Repayment','2023-04-01','04','2023',166.6667,0.0000,15.0000,NULL,NULL,181.6667,0,0,0,0,'2022-11-03 11:36:43','2022-11-03 11:37:28','2022-11-03 11:37:28',1,NULL,NULL,NULL,NULL,NULL),(47,3,2,'Repayment','2022-11-21','11','2022',166.6667,833.3333,15.0000,NULL,NULL,181.6667,0,0,0,0,'2022-11-03 11:38:17','2022-11-03 11:39:51','2022-11-03 11:39:51',1,NULL,NULL,NULL,NULL,NULL),(48,3,2,'Repayment','2022-12-21','12','2022',166.6667,666.6667,15.0000,NULL,NULL,181.6667,0,0,0,0,'2022-11-03 11:38:17','2022-11-03 11:39:51','2022-11-03 11:39:51',1,NULL,NULL,NULL,NULL,NULL),(49,3,2,'Repayment','2023-01-21','01','2023',166.6667,500.0000,15.0000,NULL,NULL,181.6667,0,0,0,0,'2022-11-03 11:38:17','2022-11-03 11:39:51','2022-11-03 11:39:51',1,NULL,NULL,NULL,NULL,NULL),(50,3,2,'Repayment','2023-02-21','02','2023',166.6667,333.3333,15.0000,NULL,NULL,181.6667,0,0,0,0,'2022-11-03 11:38:17','2022-11-03 11:39:51','2022-11-03 11:39:51',1,NULL,NULL,NULL,NULL,NULL),(51,3,2,'Repayment','2023-03-21','03','2023',166.6667,166.6667,15.0000,NULL,NULL,181.6667,0,0,0,0,'2022-11-03 11:38:17','2022-11-03 11:39:51','2022-11-03 11:39:51',1,NULL,NULL,NULL,NULL,NULL),(52,3,2,'Repayment','2023-04-21','04','2023',166.6667,0.0000,15.0000,NULL,NULL,181.6667,0,0,0,0,'2022-11-03 11:38:17','2022-11-03 11:39:51','2022-11-03 11:39:51',1,NULL,NULL,NULL,NULL,NULL),(53,3,2,'Repayment','2022-11-21','11','2022',116.6667,583.3333,10.5000,NULL,NULL,127.1667,0,0,0,0,'2022-11-03 11:40:25','2022-11-03 11:40:49','2022-11-03 11:40:49',1,NULL,NULL,NULL,NULL,NULL),(54,3,2,'Repayment','2022-12-21','12','2022',116.6667,466.6667,10.5000,NULL,NULL,127.1667,0,0,0,0,'2022-11-03 11:40:25','2022-11-03 11:40:49','2022-11-03 11:40:49',1,NULL,NULL,NULL,NULL,NULL),(55,3,2,'Repayment','2023-01-21','01','2023',116.6667,350.0000,10.5000,NULL,NULL,127.1667,0,0,0,0,'2022-11-03 11:40:25','2022-11-03 11:40:49','2022-11-03 11:40:49',1,NULL,NULL,NULL,NULL,NULL),(56,3,2,'Repayment','2023-02-21','02','2023',116.6667,233.3333,10.5000,NULL,NULL,127.1667,0,0,0,0,'2022-11-03 11:40:25','2022-11-03 11:40:49','2022-11-03 11:40:49',1,NULL,NULL,NULL,NULL,NULL),(57,3,2,'Repayment','2023-03-21','03','2023',116.6667,116.6667,10.5000,NULL,NULL,127.1667,0,0,0,0,'2022-11-03 11:40:25','2022-11-03 11:40:49','2022-11-03 11:40:49',1,NULL,NULL,NULL,NULL,NULL),(58,3,2,'Repayment','2023-04-21','04','2023',116.6667,0.0000,10.5000,NULL,NULL,127.1667,0,0,0,0,'2022-11-03 11:40:25','2022-11-03 11:40:49','2022-11-03 11:40:49',1,NULL,NULL,NULL,NULL,NULL),(59,3,2,'Repayment','2022-11-21','11','2022',83.3333,416.6667,7.5000,NULL,NULL,90.8333,0,0,0,0,'2022-11-03 11:41:10','2022-11-03 11:42:41','2022-11-03 11:42:41',1,NULL,NULL,NULL,NULL,NULL),(60,3,2,'Repayment','2022-12-21','12','2022',83.3333,333.3333,7.5000,NULL,NULL,90.8333,0,0,0,0,'2022-11-03 11:41:10','2022-11-03 11:42:41','2022-11-03 11:42:41',1,NULL,NULL,NULL,NULL,NULL),(61,3,2,'Repayment','2023-01-21','01','2023',83.3333,250.0000,7.5000,NULL,NULL,90.8333,0,0,0,0,'2022-11-03 11:41:10','2022-11-03 11:42:41','2022-11-03 11:42:41',1,NULL,NULL,NULL,NULL,NULL),(62,3,2,'Repayment','2023-02-21','02','2023',83.3333,166.6667,7.5000,NULL,NULL,90.8333,0,0,0,0,'2022-11-03 11:41:11','2022-11-03 11:42:41','2022-11-03 11:42:41',1,NULL,NULL,NULL,NULL,NULL),(63,3,2,'Repayment','2023-03-21','03','2023',83.3333,83.3333,7.5000,NULL,NULL,90.8333,0,0,0,0,'2022-11-03 11:41:11','2022-11-03 11:42:41','2022-11-03 11:42:41',1,NULL,NULL,NULL,NULL,NULL),(64,3,2,'Repayment','2023-04-21','04','2023',83.3333,0.0000,7.5000,NULL,NULL,90.8333,0,0,0,0,'2022-11-03 11:41:11','2022-11-03 11:42:41','2022-11-03 11:42:41',1,NULL,NULL,NULL,NULL,NULL),(65,3,2,'Repayment','2022-11-21','11','2022',41.6667,208.3333,3.7500,NULL,NULL,45.4167,0,0,0,0,'2022-11-03 11:42:57','2022-11-14 04:25:54','2022-11-14 04:25:54',1,NULL,NULL,NULL,NULL,NULL),(66,3,2,'Repayment','2022-12-21','12','2022',41.6667,166.6667,3.7500,NULL,NULL,45.4167,0,0,0,0,'2022-11-03 11:42:57','2022-11-14 04:25:54','2022-11-14 04:25:54',1,NULL,NULL,NULL,NULL,NULL),(67,3,2,'Repayment','2023-01-21','01','2023',41.6667,125.0000,3.7500,NULL,NULL,45.4167,0,0,0,0,'2022-11-03 11:42:57','2022-11-14 04:25:54','2022-11-14 04:25:54',1,NULL,NULL,NULL,NULL,NULL),(68,3,2,'Repayment','2023-02-21','02','2023',41.6667,83.3333,3.7500,NULL,NULL,45.4167,0,0,0,0,'2022-11-03 11:42:57','2022-11-14 04:25:54','2022-11-14 04:25:54',1,NULL,NULL,NULL,NULL,NULL),(69,3,2,'Repayment','2023-03-21','03','2023',41.6667,41.6667,3.7500,NULL,NULL,45.4167,0,0,0,0,'2022-11-03 11:42:57','2022-11-14 04:25:54','2022-11-14 04:25:54',1,NULL,NULL,NULL,NULL,NULL),(70,3,2,'Repayment','2023-04-21','04','2023',41.6667,0.0000,3.7500,NULL,NULL,45.4167,0,0,0,0,'2022-11-03 11:42:57','2022-11-14 04:25:54','2022-11-14 04:25:54',1,NULL,NULL,NULL,NULL,NULL),(71,3,2,'Repayment','2022-11-21','11','2022',74.0833,814.9167,13.3350,NULL,NULL,87.4183,0,0,0,0,'2022-11-14 04:26:12','2022-11-14 04:28:10','2022-11-14 04:28:10',1,NULL,NULL,NULL,NULL,NULL),(72,3,2,'Repayment','2022-12-21','12','2022',74.0833,740.8333,13.3350,NULL,NULL,87.4183,0,0,0,0,'2022-11-14 04:26:12','2022-11-14 04:28:10','2022-11-14 04:28:10',1,NULL,NULL,NULL,NULL,NULL),(73,3,2,'Repayment','2023-01-21','01','2023',74.0833,666.7500,13.3350,NULL,NULL,87.4183,0,0,0,0,'2022-11-14 04:26:12','2022-11-14 04:28:10','2022-11-14 04:28:10',1,NULL,NULL,NULL,NULL,NULL),(74,3,2,'Repayment','2023-02-21','02','2023',74.0833,592.6667,13.3350,NULL,NULL,87.4183,0,0,0,0,'2022-11-14 04:26:12','2022-11-14 04:28:10','2022-11-14 04:28:10',1,NULL,NULL,NULL,NULL,NULL),(75,3,2,'Repayment','2023-03-21','03','2023',74.0833,518.5833,13.3350,NULL,NULL,87.4183,0,0,0,0,'2022-11-14 04:26:12','2022-11-14 04:28:10','2022-11-14 04:28:10',1,NULL,NULL,NULL,NULL,NULL),(76,3,2,'Repayment','2023-04-21','04','2023',74.0833,444.5000,13.3350,NULL,NULL,87.4183,0,0,0,0,'2022-11-14 04:26:12','2022-11-14 04:28:10','2022-11-14 04:28:10',1,NULL,NULL,NULL,NULL,NULL),(77,3,2,'Repayment','2023-05-21','05','2023',74.0833,370.4167,13.3350,NULL,NULL,87.4183,0,0,0,0,'2022-11-14 04:26:12','2022-11-14 04:28:10','2022-11-14 04:28:10',1,NULL,NULL,NULL,NULL,NULL),(78,3,2,'Repayment','2023-06-21','06','2023',74.0833,296.3333,13.3350,NULL,NULL,87.4183,0,0,0,0,'2022-11-14 04:26:12','2022-11-14 04:28:10','2022-11-14 04:28:10',1,NULL,NULL,NULL,NULL,NULL),(79,3,2,'Repayment','2023-07-21','07','2023',74.0833,222.2500,13.3350,NULL,NULL,87.4183,0,0,0,0,'2022-11-14 04:26:12','2022-11-14 04:28:10','2022-11-14 04:28:10',1,NULL,NULL,NULL,NULL,NULL),(80,3,2,'Repayment','2023-08-21','08','2023',74.0833,148.1667,13.3350,NULL,NULL,87.4183,0,0,0,0,'2022-11-14 04:26:12','2022-11-14 04:28:10','2022-11-14 04:28:10',1,NULL,NULL,NULL,NULL,NULL),(81,3,2,'Repayment','2023-09-21','09','2023',74.0833,74.0833,13.3350,NULL,NULL,87.4183,0,0,0,0,'2022-11-14 04:26:12','2022-11-14 04:28:10','2022-11-14 04:28:10',1,NULL,NULL,NULL,NULL,NULL),(82,3,2,'Repayment','2023-10-21','10','2023',74.0833,0.0000,13.3350,NULL,NULL,87.4183,0,0,0,0,'2022-11-14 04:26:12','2022-11-14 04:28:10','2022-11-14 04:28:10',1,NULL,NULL,NULL,NULL,NULL),(83,3,2,'Repayment','2022-11-21','11','2022',74.0833,814.9167,13.3350,NULL,NULL,87.4183,0,0,0,0,'2022-11-14 04:28:18','2022-11-14 04:38:27','2022-11-14 04:38:27',1,NULL,NULL,NULL,NULL,NULL),(84,3,2,'Repayment','2022-12-21','12','2022',74.0833,740.8333,13.3350,NULL,NULL,87.4183,0,0,0,0,'2022-11-14 04:28:18','2022-11-14 04:38:27','2022-11-14 04:38:27',1,NULL,NULL,NULL,NULL,NULL),(85,3,2,'Repayment','2023-01-21','01','2023',74.0833,666.7500,13.3350,NULL,NULL,87.4183,0,0,0,0,'2022-11-14 04:28:18','2022-11-14 04:38:27','2022-11-14 04:38:27',1,NULL,NULL,NULL,NULL,NULL),(86,3,2,'Repayment','2023-02-21','02','2023',74.0833,592.6667,13.3350,NULL,NULL,87.4183,0,0,0,0,'2022-11-14 04:28:18','2022-11-14 04:38:27','2022-11-14 04:38:27',1,NULL,NULL,NULL,NULL,NULL),(87,3,2,'Repayment','2023-03-21','03','2023',74.0833,518.5833,13.3350,NULL,NULL,87.4183,0,0,0,0,'2022-11-14 04:28:18','2022-11-14 04:38:27','2022-11-14 04:38:27',1,NULL,NULL,NULL,NULL,NULL),(88,3,2,'Repayment','2023-04-21','04','2023',74.0833,444.5000,13.3350,NULL,NULL,87.4183,0,0,0,0,'2022-11-14 04:28:18','2022-11-14 04:38:27','2022-11-14 04:38:27',1,NULL,NULL,NULL,NULL,NULL),(89,3,2,'Repayment','2023-05-21','05','2023',74.0833,370.4167,13.3350,NULL,NULL,87.4183,0,0,0,0,'2022-11-14 04:28:18','2022-11-14 04:38:27','2022-11-14 04:38:27',1,NULL,NULL,NULL,NULL,NULL),(90,3,2,'Repayment','2023-06-21','06','2023',74.0833,296.3333,13.3350,NULL,NULL,87.4183,0,0,0,0,'2022-11-14 04:28:18','2022-11-14 04:38:27','2022-11-14 04:38:27',1,NULL,NULL,NULL,NULL,NULL),(91,3,2,'Repayment','2023-07-21','07','2023',74.0833,222.2500,13.3350,NULL,NULL,87.4183,0,0,0,0,'2022-11-14 04:28:18','2022-11-14 04:38:27','2022-11-14 04:38:27',1,NULL,NULL,NULL,NULL,NULL),(92,3,2,'Repayment','2023-08-21','08','2023',74.0833,148.1667,13.3350,NULL,NULL,87.4183,0,0,0,0,'2022-11-14 04:28:18','2022-11-14 04:38:27','2022-11-14 04:38:27',1,NULL,NULL,NULL,NULL,NULL),(93,3,2,'Repayment','2023-09-21','09','2023',74.0833,74.0833,13.3350,NULL,NULL,87.4183,0,0,0,0,'2022-11-14 04:28:18','2022-11-14 04:38:27','2022-11-14 04:38:27',1,NULL,NULL,NULL,NULL,NULL),(94,3,2,'Repayment','2023-10-21','10','2023',74.0833,0.0000,13.3350,NULL,NULL,87.4183,0,0,0,0,'2022-11-14 04:28:18','2022-11-14 04:38:27','2022-11-14 04:38:27',1,NULL,NULL,NULL,NULL,NULL),(95,3,2,'Repayment','2022-11-21','11','2022',149.8333,749.1667,13.4850,NULL,NULL,163.3183,0,0,0,0,'2022-11-14 04:38:59','2022-11-14 05:15:00','2022-11-14 05:15:00',1,NULL,NULL,NULL,NULL,NULL),(96,3,2,'Repayment','2022-12-21','12','2022',149.8333,599.3333,13.4850,NULL,NULL,163.3183,0,0,0,0,'2022-11-14 04:38:59','2022-11-14 05:15:00','2022-11-14 05:15:00',1,NULL,NULL,NULL,NULL,NULL),(97,3,2,'Repayment','2023-01-21','01','2023',149.8333,449.5000,13.4850,NULL,NULL,163.3183,0,0,0,0,'2022-11-14 04:38:59','2022-11-14 05:15:00','2022-11-14 05:15:00',1,NULL,NULL,NULL,NULL,NULL),(98,3,2,'Repayment','2023-02-21','02','2023',149.8333,299.6667,13.4850,NULL,NULL,163.3183,0,0,0,0,'2022-11-14 04:38:59','2022-11-14 05:15:00','2022-11-14 05:15:00',1,NULL,NULL,NULL,NULL,NULL),(99,3,2,'Repayment','2023-03-21','03','2023',149.8333,149.8333,13.4850,NULL,NULL,163.3183,0,0,0,0,'2022-11-14 04:38:59','2022-11-14 05:15:00','2022-11-14 05:15:00',1,NULL,NULL,NULL,NULL,NULL),(100,3,2,'Repayment','2023-04-21','04','2023',149.8333,0.0000,13.4850,NULL,NULL,163.3183,0,0,0,0,'2022-11-14 04:38:59','2022-11-14 05:15:00','2022-11-14 05:15:00',1,NULL,NULL,NULL,NULL,NULL),(101,3,2,'Repayment','2022-11-21','11','2022',83.3333,416.6667,7.5000,NULL,NULL,90.8333,0,0,0,0,'2022-11-14 05:15:05','2022-11-14 05:16:21','2022-11-14 05:16:21',1,NULL,NULL,NULL,NULL,NULL),(102,3,2,'Repayment','2022-12-21','12','2022',83.3333,333.3333,7.5000,NULL,NULL,90.8333,0,0,0,0,'2022-11-14 05:15:05','2022-11-14 05:16:21','2022-11-14 05:16:21',1,NULL,NULL,NULL,NULL,NULL),(103,3,2,'Repayment','2023-01-21','01','2023',83.3333,250.0000,7.5000,NULL,NULL,90.8333,0,0,0,0,'2022-11-14 05:15:05','2022-11-14 05:16:21','2022-11-14 05:16:21',1,NULL,NULL,NULL,NULL,NULL),(104,3,2,'Repayment','2023-02-21','02','2023',83.3333,166.6667,7.5000,NULL,NULL,90.8333,0,0,0,0,'2022-11-14 05:15:05','2022-11-14 05:16:21','2022-11-14 05:16:21',1,NULL,NULL,NULL,NULL,NULL),(105,3,2,'Repayment','2023-03-21','03','2023',83.3333,83.3333,7.5000,NULL,NULL,90.8333,0,0,0,0,'2022-11-14 05:15:05','2022-11-14 05:16:21','2022-11-14 05:16:21',1,NULL,NULL,NULL,NULL,NULL),(106,3,2,'Repayment','2023-04-21','04','2023',83.3333,0.0000,7.5000,NULL,NULL,90.8333,0,0,0,0,'2022-11-14 05:15:05','2022-11-14 05:16:21','2022-11-14 05:16:21',1,NULL,NULL,NULL,NULL,NULL),(107,3,2,'Repayment','2022-11-21','11','2022',41.6667,458.3333,7.5000,NULL,NULL,49.1667,0,0,0,0,'2022-11-14 05:16:26','2022-11-14 05:16:26',NULL,1,NULL,NULL,NULL,NULL,NULL),(108,3,2,'Repayment','2022-12-21','12','2022',41.6667,416.6667,7.5000,NULL,NULL,49.1667,0,0,0,0,'2022-11-14 05:16:26','2022-11-14 05:16:26',NULL,1,NULL,NULL,NULL,NULL,NULL),(109,3,2,'Repayment','2023-01-21','01','2023',41.6667,375.0000,7.5000,NULL,NULL,49.1667,0,0,0,0,'2022-11-14 05:16:26','2022-11-14 05:16:26',NULL,1,NULL,NULL,NULL,NULL,NULL),(110,3,2,'Repayment','2023-02-21','02','2023',41.6667,333.3333,7.5000,NULL,NULL,49.1667,0,0,0,0,'2022-11-14 05:16:26','2022-11-14 05:16:26',NULL,1,NULL,NULL,NULL,NULL,NULL),(111,3,2,'Repayment','2023-03-21','03','2023',41.6667,291.6667,7.5000,NULL,NULL,49.1667,0,0,0,0,'2022-11-14 05:16:26','2022-11-14 05:16:26',NULL,1,NULL,NULL,NULL,NULL,NULL),(112,3,2,'Repayment','2023-04-21','04','2023',41.6667,250.0000,7.5000,NULL,NULL,49.1667,0,0,0,0,'2022-11-14 05:16:26','2022-11-14 05:16:26',NULL,1,NULL,NULL,NULL,NULL,NULL),(113,3,2,'Repayment','2023-05-21','05','2023',41.6667,208.3333,7.5000,NULL,NULL,49.1667,0,0,0,0,'2022-11-14 05:16:26','2022-11-14 05:16:26',NULL,1,NULL,NULL,NULL,NULL,NULL),(114,3,2,'Repayment','2023-06-21','06','2023',41.6667,166.6667,7.5000,NULL,NULL,49.1667,0,0,0,0,'2022-11-14 05:16:26','2022-11-14 05:16:26',NULL,1,NULL,NULL,NULL,NULL,NULL),(115,3,2,'Repayment','2023-07-21','07','2023',41.6667,125.0000,7.5000,NULL,NULL,49.1667,0,0,0,0,'2022-11-14 05:16:26','2022-11-14 05:16:26',NULL,1,NULL,NULL,NULL,NULL,NULL),(116,3,2,'Repayment','2023-08-21','08','2023',41.6667,83.3333,7.5000,NULL,NULL,49.1667,0,0,0,0,'2022-11-14 05:16:26','2022-11-14 05:16:26',NULL,1,NULL,NULL,NULL,NULL,NULL),(117,3,2,'Repayment','2023-09-21','09','2023',41.6667,41.6667,7.5000,NULL,NULL,49.1667,0,0,0,0,'2022-11-14 05:16:26','2022-11-14 05:16:26',NULL,1,NULL,NULL,NULL,NULL,NULL),(118,3,2,'Repayment','2023-10-21','10','2023',41.6667,0.0000,7.5000,NULL,NULL,49.1667,0,0,0,0,'2022-11-14 05:16:26','2022-11-14 05:16:26',NULL,1,NULL,NULL,NULL,NULL,NULL),(119,4,1,'ការទូទាត់សង','2022-12-01','12','2022',250.0000,750.0000,38.7097,NULL,NULL,288.7097,0,0,0,0,'2022-11-16 15:10:05','2022-11-16 15:10:05',NULL,1,NULL,NULL,NULL,NULL,NULL),(120,4,1,'Repayment','2023-01-01','01','2023',250.0000,500.0000,80.0000,NULL,NULL,330.0000,0,0,0,0,'2022-11-16 15:10:05','2022-11-16 15:10:05',NULL,1,NULL,NULL,NULL,NULL,NULL),(121,4,1,'Repayment','2023-02-01','02','2023',250.0000,250.0000,80.0000,NULL,NULL,330.0000,0,0,0,0,'2022-11-16 15:10:05','2022-11-16 15:10:05',NULL,1,NULL,NULL,NULL,NULL,NULL),(122,4,1,'Repayment','2023-03-01','03','2023',250.0000,0.0000,80.0000,NULL,NULL,330.0000,0,0,0,0,'2022-11-16 15:10:05','2022-11-16 15:10:05',NULL,1,NULL,NULL,NULL,NULL,NULL),(123,6,1,'Repayment','2022-12-31','12','2022',62.5000,437.5000,50.0000,NULL,NULL,112.5000,0,0,0,0,'2022-12-05 03:56:02','2022-12-05 03:56:02',NULL,1,NULL,NULL,NULL,NULL,NULL),(124,6,1,'Repayment','2023-01-31','01','2023',62.5000,375.0000,50.0000,NULL,NULL,112.5000,0,0,0,0,'2022-12-05 03:56:02','2022-12-05 03:56:02',NULL,1,NULL,NULL,NULL,NULL,NULL),(125,6,1,'Repayment','2023-03-03','03','2023',62.5000,312.5000,50.0000,NULL,NULL,112.5000,0,0,0,0,'2022-12-05 03:56:02','2022-12-05 03:56:02',NULL,1,NULL,NULL,NULL,NULL,NULL),(126,6,1,'Repayment','2023-04-03','04','2023',62.5000,250.0000,50.0000,NULL,NULL,112.5000,0,0,0,0,'2022-12-05 03:56:02','2022-12-05 03:56:02',NULL,1,NULL,NULL,NULL,NULL,NULL),(127,6,1,'Repayment','2023-05-03','05','2023',62.5000,187.5000,50.0000,NULL,NULL,112.5000,0,0,0,0,'2022-12-05 03:56:02','2022-12-05 03:56:02',NULL,1,NULL,NULL,NULL,NULL,NULL),(128,6,1,'Repayment','2023-06-03','06','2023',62.5000,125.0000,50.0000,NULL,NULL,112.5000,0,0,0,0,'2022-12-05 03:56:02','2022-12-05 03:56:02',NULL,1,NULL,NULL,NULL,NULL,NULL),(129,6,1,'Repayment','2023-07-03','07','2023',62.5000,62.5000,50.0000,NULL,NULL,112.5000,0,0,0,0,'2022-12-05 03:56:02','2022-12-05 03:56:02',NULL,1,NULL,NULL,NULL,NULL,NULL),(130,6,1,'Repayment','2023-08-03','08','2023',62.5000,0.0000,50.0000,NULL,NULL,112.5000,0,0,0,0,'2022-12-05 03:56:02','2022-12-05 03:56:02',NULL,1,NULL,NULL,NULL,NULL,NULL),(131,7,1,'Repayment','2022-12-31','12','2022',43.7220,456.2780,50.0000,NULL,NULL,93.7220,0,0,0,0,'2022-12-05 04:17:08','2022-12-05 04:17:08',NULL,1,NULL,NULL,NULL,NULL,NULL),(132,7,1,'Repayment','2023-01-31','01','2023',48.0942,408.1838,45.6278,NULL,NULL,93.7220,0,0,0,0,'2022-12-05 04:17:08','2022-12-05 04:17:08',NULL,1,NULL,NULL,NULL,NULL,NULL),(133,7,1,'Repayment','2023-03-03','03','2023',52.9036,355.2802,40.8184,NULL,NULL,93.7220,0,0,0,0,'2022-12-05 04:17:08','2022-12-05 04:17:08',NULL,1,NULL,NULL,NULL,NULL,NULL),(134,7,1,'Repayment','2023-04-03','04','2023',58.1940,297.0862,35.5280,NULL,NULL,93.7220,0,0,0,0,'2022-12-05 04:17:08','2022-12-05 04:17:08',NULL,1,NULL,NULL,NULL,NULL,NULL),(135,7,1,'Repayment','2023-05-03','05','2023',64.0134,233.0728,29.7086,NULL,NULL,93.7220,0,0,0,0,'2022-12-05 04:17:08','2022-12-05 04:17:08',NULL,1,NULL,NULL,NULL,NULL,NULL),(136,7,1,'Repayment','2023-06-03','06','2023',70.4147,162.6580,23.3073,NULL,NULL,93.7220,0,0,0,0,'2022-12-05 04:17:08','2022-12-05 04:17:08',NULL,1,NULL,NULL,NULL,NULL,NULL),(137,7,1,'Repayment','2023-07-03','07','2023',77.4562,85.2018,16.2658,NULL,NULL,93.7220,0,0,0,0,'2022-12-05 04:17:08','2022-12-05 04:17:08',NULL,1,NULL,NULL,NULL,NULL,NULL),(138,7,1,'Repayment','2023-08-03','08','2023',85.2018,0.0000,8.5202,NULL,NULL,93.7220,0,0,0,0,'2022-12-05 04:17:08','2022-12-05 04:17:08',NULL,1,NULL,NULL,NULL,NULL,NULL),(139,8,1,'Repayment','2023-02-01','02','2023',500.0000,1500.0000,228.5714,NULL,NULL,728.5714,0,0,0,0,'2022-12-23 12:04:14','2022-12-23 12:11:48','2022-12-23 12:11:48',1,NULL,NULL,NULL,NULL,NULL),(140,8,1,'Repayment','2023-03-01','03','2023',462.0503,1037.9497,120.0000,NULL,NULL,582.0503,0,0,0,0,'2022-12-23 12:04:14','2022-12-23 12:11:48','2022-12-23 12:11:48',1,NULL,NULL,NULL,NULL,NULL),(141,8,1,'Repayment','2023-04-01','04','2023',499.0143,538.9354,83.0360,NULL,NULL,582.0503,0,0,0,0,'2022-12-23 12:04:14','2022-12-23 12:11:48','2022-12-23 12:11:48',1,NULL,NULL,NULL,NULL,NULL),(142,8,1,'Repayment','2023-05-01','05','2023',538.9354,0.0000,43.1148,NULL,NULL,582.0503,0,0,0,0,'2022-12-23 12:04:14','2022-12-23 12:11:48','2022-12-23 12:11:48',1,NULL,NULL,NULL,NULL,NULL),(143,8,1,'Repayment','2023-02-01','02','2023',500.0000,1500.0000,228.5714,NULL,NULL,728.5714,0,0,0,0,'2022-12-28 11:34:41','2022-12-28 11:41:53','2022-12-28 11:41:53',1,NULL,NULL,NULL,NULL,NULL),(144,8,1,'Repayment','2023-03-01','03','2023',462.0503,1037.9497,120.0000,NULL,NULL,582.0503,0,0,0,0,'2022-12-28 11:34:41','2022-12-28 11:41:53','2022-12-28 11:41:53',1,NULL,NULL,NULL,NULL,NULL),(145,8,1,'Repayment','2023-04-01','04','2023',499.0143,538.9354,83.0360,NULL,NULL,582.0503,0,0,0,0,'2022-12-28 11:34:41','2022-12-28 11:41:53','2022-12-28 11:41:53',1,NULL,NULL,NULL,NULL,NULL),(146,8,1,'Repayment','2023-05-01','05','2023',538.9354,0.0000,43.1148,NULL,NULL,582.0503,0,0,0,0,'2022-12-28 11:34:41','2022-12-28 11:41:53','2022-12-28 11:41:53',1,NULL,NULL,NULL,NULL,NULL),(147,8,1,'Repayment','2023-02-01','02','2023',500.0000,1500.0000,228.5714,NULL,NULL,728.5714,0,0,0,0,'2022-12-28 11:42:08','2022-12-28 11:42:55','2022-12-28 11:42:55',1,NULL,NULL,NULL,NULL,NULL),(148,8,1,'Repayment','2023-03-01','03','2023',462.0503,1037.9497,120.0000,NULL,NULL,582.0503,0,0,0,0,'2022-12-28 11:42:08','2022-12-28 11:42:55','2022-12-28 11:42:55',1,NULL,NULL,NULL,NULL,NULL),(149,8,1,'Repayment','2023-04-01','04','2023',499.0143,538.9354,83.0360,NULL,NULL,582.0503,0,0,0,0,'2022-12-28 11:42:08','2022-12-28 11:42:55','2022-12-28 11:42:55',1,NULL,NULL,NULL,NULL,NULL),(150,8,1,'Repayment','2023-05-01','05','2023',538.9354,0.0000,43.1148,NULL,NULL,582.0503,0,0,0,0,'2022-12-28 11:42:08','2022-12-28 11:42:55','2022-12-28 11:42:55',1,NULL,NULL,NULL,NULL,NULL),(151,8,1,'Repayment','2023-02-01','02','2023',500.0000,1500.0000,228.5714,NULL,NULL,728.5714,0,0,0,0,'2022-12-28 11:44:49','2022-12-28 11:44:49',NULL,1,NULL,NULL,NULL,NULL,NULL),(152,8,1,'Repayment','2023-03-01','03','2023',462.0503,1037.9497,120.0000,NULL,NULL,582.0503,0,0,0,0,'2022-12-28 11:44:49','2022-12-28 11:44:49',NULL,1,NULL,NULL,NULL,NULL,NULL),(153,8,1,'Repayment','2023-04-01','04','2023',499.0143,538.9354,83.0360,NULL,NULL,582.0503,0,0,0,0,'2022-12-28 11:44:49','2022-12-28 11:44:49',NULL,1,NULL,NULL,NULL,NULL,NULL),(154,8,1,'Repayment','2023-05-01','05','2023',538.9354,0.0000,43.1148,NULL,NULL,582.0503,0,0,0,0,'2022-12-28 11:44:49','2022-12-28 11:44:49',NULL,1,NULL,NULL,NULL,NULL,NULL),(155,9,2,'Repayment','2022-12-30','12','2022',250.0000,750.0000,5.1613,NULL,NULL,255.1613,0,0,0,0,'2022-12-28 11:47:16','2022-12-28 11:47:16',NULL,1,NULL,NULL,NULL,NULL,NULL),(156,9,2,'Repayment','2023-01-30','01','2023',231.0251,518.9749,60.0000,NULL,NULL,291.0251,0,0,0,0,'2022-12-28 11:47:16','2022-12-28 11:47:16',NULL,1,NULL,NULL,NULL,NULL,NULL),(157,9,2,'Repayment','2023-03-02','03','2023',249.5071,269.4677,41.5180,NULL,NULL,291.0251,0,0,0,0,'2022-12-28 11:47:16','2022-12-28 11:47:16',NULL,1,NULL,NULL,NULL,NULL,NULL),(158,9,2,'Repayment','2023-04-02','04','2023',269.4677,0.0000,21.5574,NULL,NULL,291.0251,0,0,0,0,'2022-12-28 11:47:16','2022-12-28 11:47:16',NULL,1,NULL,NULL,NULL,NULL,NULL),(159,11,4,'Repayment','2023-03-10','03','2023',5000.0000,45000.0000,4000.0000,NULL,NULL,9000.0000,0,0,0,0,'2023-02-10 09:06:29','2023-02-10 09:06:29',NULL,1,NULL,NULL,NULL,NULL,NULL),(160,11,4,'Repayment','2023-04-10','04','2023',5000.0000,40000.0000,3600.0000,NULL,NULL,8600.0000,0,0,0,0,'2023-02-10 09:06:29','2023-02-10 09:06:29',NULL,1,NULL,NULL,NULL,NULL,NULL),(161,11,4,'Repayment','2023-05-10','05','2023',5000.0000,35000.0000,3200.0000,NULL,NULL,8200.0000,0,0,0,0,'2023-02-10 09:06:29','2023-02-10 09:06:29',NULL,1,NULL,NULL,NULL,NULL,NULL),(162,11,4,'Repayment','2023-06-10','06','2023',5000.0000,30000.0000,2800.0000,NULL,NULL,7800.0000,0,0,0,0,'2023-02-10 09:06:29','2023-02-10 09:06:29',NULL,1,NULL,NULL,NULL,NULL,NULL),(163,11,4,'Repayment','2023-07-10','07','2023',5000.0000,25000.0000,2400.0000,NULL,NULL,7400.0000,0,0,0,0,'2023-02-10 09:06:29','2023-02-10 09:06:29',NULL,1,NULL,NULL,NULL,NULL,NULL),(164,11,4,'Repayment','2023-08-10','08','2023',5000.0000,20000.0000,2000.0000,NULL,NULL,7000.0000,0,0,0,0,'2023-02-10 09:06:29','2023-02-10 09:06:29',NULL,1,NULL,NULL,NULL,NULL,NULL),(165,11,4,'Repayment','2023-09-10','09','2023',5000.0000,15000.0000,1600.0000,NULL,NULL,6600.0000,0,0,0,0,'2023-02-10 09:06:29','2023-02-10 09:06:29',NULL,1,NULL,NULL,NULL,NULL,NULL),(166,11,4,'Repayment','2023-10-10','10','2023',5000.0000,10000.0000,1200.0000,NULL,NULL,6200.0000,0,0,0,0,'2023-02-10 09:06:29','2023-02-10 09:06:29',NULL,1,NULL,NULL,NULL,NULL,NULL),(167,11,4,'Repayment','2023-11-10','11','2023',5000.0000,5000.0000,800.0000,NULL,NULL,5800.0000,0,0,0,0,'2023-02-10 09:06:29','2023-02-10 09:06:29',NULL,1,NULL,NULL,NULL,NULL,NULL),(168,11,4,'Repayment','2023-12-10','12','2023',5000.0000,0.0000,400.0000,NULL,NULL,5400.0000,0,0,0,0,'2023-02-10 09:06:29','2023-02-10 09:06:29',NULL,1,NULL,NULL,NULL,NULL,NULL),(169,12,1,'Repayment','2023-03-01','03','2023',125.0000,375.0000,19.3548,NULL,NULL,144.3548,0,0,0,0,'2023-02-17 08:02:07','2023-02-17 08:02:07',NULL,1,NULL,NULL,NULL,NULL,NULL),(170,12,1,'Repayment','2023-04-01','04','2023',113.2931,261.7069,37.5000,NULL,NULL,150.7931,0,0,0,0,'2023-02-17 08:02:07','2023-02-17 08:02:07',NULL,1,NULL,NULL,NULL,NULL,NULL),(171,12,1,'Repayment','2023-05-01','05','2023',124.6224,137.0846,26.1707,NULL,NULL,150.7931,0,0,0,0,'2023-02-17 08:02:07','2023-02-17 08:02:07',NULL,1,NULL,NULL,NULL,NULL,NULL),(172,12,1,'Repayment','2023-06-01','06','2023',137.0846,0.0000,13.7085,NULL,NULL,150.7931,0,0,0,0,'2023-02-17 08:02:07','2023-02-17 08:02:07',NULL,1,NULL,NULL,NULL,NULL,NULL),(173,13,1,'Repayment','2023-03-17','03','2023',10.0000,90.0000,10.0000,NULL,NULL,20.0000,0,0,0,0,'2023-02-17 08:06:02','2023-02-17 08:06:02',NULL,1,NULL,NULL,NULL,NULL,NULL),(174,13,1,'Repayment','2023-04-17','04','2023',10.0000,80.0000,10.0000,NULL,NULL,20.0000,0,0,0,0,'2023-02-17 08:06:02','2023-02-17 08:06:02',NULL,1,NULL,NULL,NULL,NULL,NULL),(175,13,1,'Repayment','2023-05-17','05','2023',10.0000,70.0000,10.0000,NULL,NULL,20.0000,0,0,0,0,'2023-02-17 08:06:02','2023-02-17 08:06:02',NULL,1,NULL,NULL,NULL,NULL,NULL),(176,13,1,'Repayment','2023-06-17','06','2023',10.0000,60.0000,10.0000,NULL,NULL,20.0000,0,0,0,0,'2023-02-17 08:06:02','2023-02-17 08:06:02',NULL,1,NULL,NULL,NULL,NULL,NULL),(177,13,1,'Repayment','2023-07-17','07','2023',10.0000,50.0000,10.0000,NULL,NULL,20.0000,0,0,0,0,'2023-02-17 08:06:02','2023-02-17 08:06:02',NULL,1,NULL,NULL,NULL,NULL,NULL),(178,13,1,'Repayment','2023-08-17','08','2023',10.0000,40.0000,10.0000,NULL,NULL,20.0000,0,0,0,0,'2023-02-17 08:06:02','2023-02-17 08:06:02',NULL,1,NULL,NULL,NULL,NULL,NULL),(179,13,1,'Repayment','2023-09-17','09','2023',10.0000,30.0000,10.0000,NULL,NULL,20.0000,0,0,0,0,'2023-02-17 08:06:02','2023-02-17 08:06:02',NULL,1,NULL,NULL,NULL,NULL,NULL),(180,13,1,'Repayment','2023-10-17','10','2023',10.0000,20.0000,10.0000,NULL,NULL,20.0000,0,0,0,0,'2023-02-17 08:06:02','2023-02-17 08:06:02',NULL,1,NULL,NULL,NULL,NULL,NULL),(181,13,1,'Repayment','2023-11-17','11','2023',10.0000,10.0000,10.0000,NULL,NULL,20.0000,0,0,0,0,'2023-02-17 08:06:02','2023-02-17 08:06:02',NULL,1,NULL,NULL,NULL,NULL,NULL),(182,13,1,'Repayment','2023-12-17','12','2023',10.0000,0.0000,10.0000,NULL,NULL,20.0000,0,0,0,0,'2023-02-17 08:06:02','2023-02-17 08:06:02',NULL,1,NULL,NULL,NULL,NULL,NULL),(183,14,1,'Repayment','2023-03-17','03','2023',6.2745,93.7255,10.0000,NULL,NULL,16.2745,0,0,0,0,'2023-02-17 08:09:51','2023-02-17 08:09:51',NULL,1,NULL,NULL,NULL,NULL,NULL),(184,14,1,'Repayment','2023-04-17','04','2023',6.9020,86.8235,9.3725,NULL,NULL,16.2745,0,0,0,0,'2023-02-17 08:09:51','2023-02-17 08:09:51',NULL,1,NULL,NULL,NULL,NULL,NULL),(185,14,1,'Repayment','2023-05-17','05','2023',7.5922,79.2313,8.6823,NULL,NULL,16.2745,0,0,0,0,'2023-02-17 08:09:51','2023-02-17 08:09:51',NULL,1,NULL,NULL,NULL,NULL,NULL),(186,14,1,'Repayment','2023-06-17','06','2023',8.3514,70.8799,7.9231,NULL,NULL,16.2745,0,0,0,0,'2023-02-17 08:09:51','2023-02-17 08:09:51',NULL,1,NULL,NULL,NULL,NULL,NULL),(187,14,1,'Repayment','2023-07-17','07','2023',9.1866,61.6933,7.0880,NULL,NULL,16.2745,0,0,0,0,'2023-02-17 08:09:51','2023-02-17 08:09:51',NULL,1,NULL,NULL,NULL,NULL,NULL),(188,14,1,'Repayment','2023-08-17','08','2023',10.1052,51.5881,6.1693,NULL,NULL,16.2745,0,0,0,0,'2023-02-17 08:09:52','2023-02-17 08:09:52',NULL,1,NULL,NULL,NULL,NULL,NULL),(189,14,1,'Repayment','2023-09-17','09','2023',11.1157,40.4724,5.1588,NULL,NULL,16.2745,0,0,0,0,'2023-02-17 08:09:52','2023-02-17 08:09:52',NULL,1,NULL,NULL,NULL,NULL,NULL),(190,14,1,'Repayment','2023-10-17','10','2023',12.2273,28.2451,4.0472,NULL,NULL,16.2745,0,0,0,0,'2023-02-17 08:09:52','2023-02-17 08:09:52',NULL,1,NULL,NULL,NULL,NULL,NULL),(191,14,1,'Repayment','2023-11-17','11','2023',13.4500,14.7950,2.8245,NULL,NULL,16.2745,0,0,0,0,'2023-02-17 08:09:52','2023-02-17 08:09:52',NULL,1,NULL,NULL,NULL,NULL,NULL),(192,14,1,'Repayment','2023-12-17','12','2023',14.7950,0.0000,1.4795,NULL,NULL,16.2745,0,0,0,0,'2023-02-17 08:09:52','2023-02-17 08:09:52',NULL,1,NULL,NULL,NULL,NULL,NULL),(193,15,1,'Repayment','2023-03-17','03','2023',10.0000,90.0000,10.0000,NULL,NULL,20.0000,0,0,0,0,'2023-02-17 08:10:51','2023-02-17 08:10:51',NULL,1,NULL,NULL,NULL,NULL,NULL),(194,15,1,'Repayment','2023-04-17','04','2023',10.0000,80.0000,9.0000,NULL,NULL,19.0000,0,0,0,0,'2023-02-17 08:10:51','2023-02-17 08:10:51',NULL,1,NULL,NULL,NULL,NULL,NULL),(195,15,1,'Repayment','2023-05-17','05','2023',10.0000,70.0000,8.0000,NULL,NULL,18.0000,0,0,0,0,'2023-02-17 08:10:51','2023-02-17 08:10:51',NULL,1,NULL,NULL,NULL,NULL,NULL),(196,15,1,'Repayment','2023-06-17','06','2023',10.0000,60.0000,7.0000,NULL,NULL,17.0000,0,0,0,0,'2023-02-17 08:10:51','2023-02-17 08:10:51',NULL,1,NULL,NULL,NULL,NULL,NULL),(197,15,1,'Repayment','2023-07-17','07','2023',10.0000,50.0000,6.0000,NULL,NULL,16.0000,0,0,0,0,'2023-02-17 08:10:51','2023-02-17 08:10:51',NULL,1,NULL,NULL,NULL,NULL,NULL),(198,15,1,'Repayment','2023-08-17','08','2023',10.0000,40.0000,5.0000,NULL,NULL,15.0000,0,0,0,0,'2023-02-17 08:10:51','2023-02-17 08:10:51',NULL,1,NULL,NULL,NULL,NULL,NULL),(199,15,1,'Repayment','2023-09-17','09','2023',10.0000,30.0000,4.0000,NULL,NULL,14.0000,0,0,0,0,'2023-02-17 08:10:51','2023-02-17 08:10:51',NULL,1,NULL,NULL,NULL,NULL,NULL),(200,15,1,'Repayment','2023-10-17','10','2023',10.0000,20.0000,3.0000,NULL,NULL,13.0000,0,0,0,0,'2023-02-17 08:10:51','2023-02-17 08:10:51',NULL,1,NULL,NULL,NULL,NULL,NULL),(201,15,1,'Repayment','2023-11-17','11','2023',10.0000,10.0000,2.0000,NULL,NULL,12.0000,0,0,0,0,'2023-02-17 08:10:51','2023-02-17 08:10:51',NULL,1,NULL,NULL,NULL,NULL,NULL),(202,15,1,'Repayment','2023-12-17','12','2023',10.0000,0.0000,1.0000,NULL,NULL,11.0000,0,0,0,0,'2023-02-17 08:10:51','2023-02-17 08:10:51',NULL,1,NULL,NULL,NULL,NULL,NULL),(203,16,1,'Repayment','2023-03-17','03','2023',83.3333,166.6667,20.0000,NULL,NULL,103.3333,0,0,0,0,'2023-02-17 08:13:01','2023-02-17 08:13:01',NULL,1,NULL,NULL,NULL,NULL,NULL),(204,16,1,'Repayment','2023-04-17','04','2023',83.3333,83.3333,13.3333,NULL,NULL,96.6667,0,0,0,0,'2023-02-17 08:13:01','2023-02-17 08:13:01',NULL,1,NULL,NULL,NULL,NULL,NULL),(205,16,1,'Repayment','2023-05-17','05','2023',83.3333,0.0000,6.6667,NULL,NULL,90.0000,0,0,0,0,'2023-02-17 08:13:01','2023-02-17 08:13:01',NULL,1,NULL,NULL,NULL,NULL,NULL),(206,17,1,'Repayment','2023-03-17','03','2023',290.4742,9709.5258,300.0000,NULL,NULL,590.4742,0,0,0,0,'2023-02-17 08:17:47','2023-02-17 08:17:47',NULL,1,NULL,NULL,NULL,NULL,NULL),(207,17,1,'Repayment','2023-04-17','04','2023',299.1884,9410.3375,291.2858,NULL,NULL,590.4742,0,0,0,0,'2023-02-17 08:17:47','2023-02-17 08:17:47',NULL,1,NULL,NULL,NULL,NULL,NULL),(208,17,1,'Repayment','2023-05-17','05','2023',308.1640,9102.1734,282.3101,NULL,NULL,590.4742,0,0,0,0,'2023-02-17 08:17:47','2023-02-17 08:17:47',NULL,1,NULL,NULL,NULL,NULL,NULL),(209,17,1,'Repayment','2023-06-17','06','2023',317.4090,8784.7645,273.0652,NULL,NULL,590.4742,0,0,0,0,'2023-02-17 08:17:47','2023-02-17 08:17:47',NULL,1,NULL,NULL,NULL,NULL,NULL),(210,17,1,'Repayment','2023-07-17','07','2023',326.9312,8457.8332,263.5429,NULL,NULL,590.4742,0,0,0,0,'2023-02-17 08:17:47','2023-02-17 08:17:47',NULL,1,NULL,NULL,NULL,NULL,NULL),(211,17,1,'Repayment','2023-08-17','08','2023',336.7392,8121.0941,253.7350,NULL,NULL,590.4742,0,0,0,0,'2023-02-17 08:17:47','2023-02-17 08:17:47',NULL,1,NULL,NULL,NULL,NULL,NULL),(212,17,1,'Repayment','2023-09-17','09','2023',346.8413,7774.2527,243.6328,NULL,NULL,590.4742,0,0,0,0,'2023-02-17 08:17:47','2023-02-17 08:17:47',NULL,1,NULL,NULL,NULL,NULL,NULL),(213,17,1,'Repayment','2023-10-17','10','2023',357.2466,7417.0062,233.2276,NULL,NULL,590.4742,0,0,0,0,'2023-02-17 08:17:47','2023-02-17 08:17:47',NULL,1,NULL,NULL,NULL,NULL,NULL),(214,17,1,'Repayment','2023-11-17','11','2023',367.9640,7049.0422,222.5102,NULL,NULL,590.4742,0,0,0,0,'2023-02-17 08:17:47','2023-02-17 08:17:47',NULL,1,NULL,NULL,NULL,NULL,NULL),(215,17,1,'Repayment','2023-12-17','12','2023',379.0029,6670.0393,211.4713,NULL,NULL,590.4742,0,0,0,0,'2023-02-17 08:17:47','2023-02-17 08:17:47',NULL,1,NULL,NULL,NULL,NULL,NULL),(216,17,1,'Repayment','2024-01-17','01','2024',390.3730,6279.6663,200.1012,NULL,NULL,590.4742,0,0,0,0,'2023-02-17 08:17:47','2023-02-17 08:17:47',NULL,1,NULL,NULL,NULL,NULL,NULL),(217,17,1,'Repayment','2024-02-17','02','2024',402.0842,5877.5821,188.3900,NULL,NULL,590.4742,0,0,0,0,'2023-02-17 08:17:47','2023-02-17 08:17:47',NULL,1,NULL,NULL,NULL,NULL,NULL),(218,17,1,'Repayment','2024-03-17','03','2024',414.1467,5463.4354,176.3275,NULL,NULL,590.4742,0,0,0,0,'2023-02-17 08:17:47','2023-02-17 08:17:47',NULL,1,NULL,NULL,NULL,NULL,NULL),(219,17,1,'Repayment','2024-04-17','04','2024',426.5711,5036.8644,163.9031,NULL,NULL,590.4742,0,0,0,0,'2023-02-17 08:17:47','2023-02-17 08:17:47',NULL,1,NULL,NULL,NULL,NULL,NULL),(220,17,1,'Repayment','2024-05-17','05','2024',439.3682,4597.4961,151.1059,NULL,NULL,590.4742,0,0,0,0,'2023-02-17 08:17:47','2023-02-17 08:17:47',NULL,1,NULL,NULL,NULL,NULL,NULL),(221,17,1,'Repayment','2024-06-17','06','2024',452.5493,4144.9468,137.9249,NULL,NULL,590.4742,0,0,0,0,'2023-02-17 08:17:47','2023-02-17 08:17:47',NULL,1,NULL,NULL,NULL,NULL,NULL),(222,17,1,'Repayment','2024-07-17','07','2024',466.1258,3678.8211,124.3484,NULL,NULL,590.4742,0,0,0,0,'2023-02-17 08:17:47','2023-02-17 08:17:47',NULL,1,NULL,NULL,NULL,NULL,NULL),(223,17,1,'Repayment','2024-08-17','08','2024',480.1095,3198.7116,110.3646,NULL,NULL,590.4742,0,0,0,0,'2023-02-17 08:17:47','2023-02-17 08:17:47',NULL,1,NULL,NULL,NULL,NULL,NULL),(224,17,1,'Repayment','2024-09-17','09','2024',494.5128,2704.1988,95.9613,NULL,NULL,590.4742,0,0,0,0,'2023-02-17 08:17:47','2023-02-17 08:17:47',NULL,1,NULL,NULL,NULL,NULL,NULL),(225,17,1,'Repayment','2024-10-17','10','2024',509.3482,2194.8506,81.1260,NULL,NULL,590.4742,0,0,0,0,'2023-02-17 08:17:47','2023-02-17 08:17:47',NULL,1,NULL,NULL,NULL,NULL,NULL),(226,17,1,'Repayment','2024-11-17','11','2024',524.6286,1670.2219,65.8455,NULL,NULL,590.4742,0,0,0,0,'2023-02-17 08:17:47','2023-02-17 08:17:47',NULL,1,NULL,NULL,NULL,NULL,NULL),(227,17,1,'Repayment','2024-12-17','12','2024',540.3675,1129.8544,50.1067,NULL,NULL,590.4742,0,0,0,0,'2023-02-17 08:17:47','2023-02-17 08:17:47',NULL,1,NULL,NULL,NULL,NULL,NULL),(228,17,1,'Repayment','2025-01-17','01','2025',556.5785,573.2759,33.8956,NULL,NULL,590.4742,0,0,0,0,'2023-02-17 08:17:47','2023-02-17 08:17:47',NULL,1,NULL,NULL,NULL,NULL,NULL),(229,17,1,'Repayment','2025-02-17','02','2025',573.2759,0.0000,17.1983,NULL,NULL,590.4742,0,0,0,0,'2023-02-17 08:17:47','2023-02-17 08:17:47',NULL,1,NULL,NULL,NULL,NULL,NULL),(230,18,1,'Repayment','2023-03-17','03','2023',57.2564,237.7436,4.4250,NULL,NULL,61.6814,0,0,0,0,'2023-02-17 08:28:34','2023-02-17 08:28:58','2023-02-17 08:28:58',1,NULL,NULL,NULL,NULL,NULL),(231,18,1,'Repayment','2023-04-17','04','2023',58.1152,179.6285,3.5662,NULL,NULL,61.6814,0,0,0,0,'2023-02-17 08:28:34','2023-02-17 08:28:58','2023-02-17 08:28:58',1,NULL,NULL,NULL,NULL,NULL),(232,18,1,'Repayment','2023-05-17','05','2023',58.9869,120.6415,2.6944,NULL,NULL,61.6814,0,0,0,0,'2023-02-17 08:28:34','2023-02-17 08:28:58','2023-02-17 08:28:58',1,NULL,NULL,NULL,NULL,NULL),(233,18,1,'Repayment','2023-06-17','06','2023',59.8717,60.7698,1.8096,NULL,NULL,61.6814,0,0,0,0,'2023-02-17 08:28:34','2023-02-17 08:28:58','2023-02-17 08:28:58',1,NULL,NULL,NULL,NULL,NULL),(234,18,1,'Repayment','2023-07-17','07','2023',60.7698,0.0000,0.9115,NULL,NULL,61.6814,0,0,0,0,'2023-02-17 08:28:34','2023-02-17 08:28:58','2023-02-17 08:28:58',1,NULL,NULL,NULL,NULL,NULL),(235,18,1,'Repayment','2023-03-17','03','2023',59.0000,236.0000,4.4250,NULL,NULL,63.4250,0,0,0,0,'2023-02-17 08:29:24','2023-02-17 08:29:58','2023-02-17 08:29:58',1,NULL,NULL,NULL,NULL,NULL),(236,18,1,'Repayment','2023-04-17','04','2023',59.0000,177.0000,3.5400,NULL,NULL,62.5400,0,0,0,0,'2023-02-17 08:29:24','2023-02-17 08:29:58','2023-02-17 08:29:58',1,NULL,NULL,NULL,NULL,NULL),(237,18,1,'Repayment','2023-05-17','05','2023',59.0000,118.0000,2.6550,NULL,NULL,61.6550,0,0,0,0,'2023-02-17 08:29:24','2023-02-17 08:29:58','2023-02-17 08:29:58',1,NULL,NULL,NULL,NULL,NULL),(238,18,1,'Repayment','2023-06-17','06','2023',59.0000,59.0000,1.7700,NULL,NULL,60.7700,0,0,0,0,'2023-02-17 08:29:24','2023-02-17 08:29:58','2023-02-17 08:29:58',1,NULL,NULL,NULL,NULL,NULL),(239,18,1,'Repayment','2023-07-17','07','2023',59.0000,0.0000,0.8850,NULL,NULL,59.8850,0,0,0,0,'2023-02-17 08:29:24','2023-02-17 08:29:58','2023-02-17 08:29:58',1,NULL,NULL,NULL,NULL,NULL),(240,18,1,'Repayment','2023-03-17','03','2023',59.0000,236.0000,4.4250,NULL,NULL,63.4250,0,0,0,0,'2023-02-17 08:30:22','2023-02-17 08:30:22',NULL,1,NULL,NULL,NULL,NULL,NULL),(241,18,1,'Repayment','2023-04-17','04','2023',59.0000,177.0000,4.4250,NULL,NULL,63.4250,0,0,0,0,'2023-02-17 08:30:22','2023-02-17 08:30:22',NULL,1,NULL,NULL,NULL,NULL,NULL),(242,18,1,'Repayment','2023-05-17','05','2023',59.0000,118.0000,4.4250,NULL,NULL,63.4250,0,0,0,0,'2023-02-17 08:30:22','2023-02-17 08:30:22',NULL,1,NULL,NULL,NULL,NULL,NULL),(243,18,1,'Repayment','2023-06-17','06','2023',59.0000,59.0000,4.4250,NULL,NULL,63.4250,0,0,0,0,'2023-02-17 08:30:22','2023-02-17 08:30:22',NULL,1,NULL,NULL,NULL,NULL,NULL),(244,18,1,'Repayment','2023-07-17','07','2023',59.0000,0.0000,4.4250,NULL,NULL,63.4250,0,0,0,0,'2023-02-17 08:30:22','2023-02-17 08:30:22',NULL,1,NULL,NULL,NULL,NULL,NULL),(245,19,1,'Repayment','2023-03-17','03','2023',15.0000,135.0000,12.0000,NULL,NULL,27.0000,0,0,0,0,'2023-02-17 08:58:52','2023-02-17 08:58:52',NULL,1,NULL,NULL,NULL,NULL,NULL),(246,19,1,'Repayment','2023-04-17','04','2023',15.0000,120.0000,10.8000,NULL,NULL,25.8000,0,0,0,0,'2023-02-17 08:58:52','2023-02-17 08:58:52',NULL,1,NULL,NULL,NULL,NULL,NULL),(247,19,1,'Repayment','2023-05-17','05','2023',15.0000,105.0000,9.6000,NULL,NULL,24.6000,0,0,0,0,'2023-02-17 08:58:52','2023-02-17 08:58:52',NULL,1,NULL,NULL,NULL,NULL,NULL),(248,19,1,'Repayment','2023-06-17','06','2023',15.0000,90.0000,8.4000,NULL,NULL,23.4000,0,0,0,0,'2023-02-17 08:58:52','2023-02-17 08:58:52',NULL,1,NULL,NULL,NULL,NULL,NULL),(249,19,1,'Repayment','2023-07-17','07','2023',15.0000,75.0000,7.2000,NULL,NULL,22.2000,0,0,0,0,'2023-02-17 08:58:52','2023-02-17 08:58:52',NULL,1,NULL,NULL,NULL,NULL,NULL),(250,19,1,'Repayment','2023-08-17','08','2023',15.0000,60.0000,6.0000,NULL,NULL,21.0000,0,0,0,0,'2023-02-17 08:58:52','2023-02-17 08:58:52',NULL,1,NULL,NULL,NULL,NULL,NULL),(251,19,1,'Repayment','2023-09-17','09','2023',15.0000,45.0000,4.8000,NULL,NULL,19.8000,0,0,0,0,'2023-02-17 08:58:52','2023-02-17 08:58:52',NULL,1,NULL,NULL,NULL,NULL,NULL),(252,19,1,'Repayment','2023-10-17','10','2023',15.0000,30.0000,3.6000,NULL,NULL,18.6000,0,0,0,0,'2023-02-17 08:58:52','2023-02-17 08:58:52',NULL,1,NULL,NULL,NULL,NULL,NULL),(253,19,1,'Repayment','2023-11-17','11','2023',15.0000,15.0000,2.4000,NULL,NULL,17.4000,0,0,0,0,'2023-02-17 08:58:52','2023-02-17 08:58:52',NULL,1,NULL,NULL,NULL,NULL,NULL),(254,19,1,'Repayment','2023-12-17','12','2023',15.0000,0.0000,1.2000,NULL,NULL,16.2000,0,0,0,0,'2023-02-17 08:58:52','2023-02-17 08:58:52',NULL,1,NULL,NULL,NULL,NULL,NULL),(255,19,1,'Pay Off','2023-02-21','02',NULL,NULL,NULL,NULL,NULL,NULL,-54.0000,0,0,0,1,'2023-02-21 09:00:41','2023-02-21 09:00:41',NULL,NULL,NULL,NULL,NULL,NULL,-54.0000);

--
-- Table structure for table `loan_status`
--

CREATE TABLE `loan_status` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `text_color` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `background_color` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `loan_status`
--


--
-- Table structure for table `loan_transactions`
--

CREATE TABLE `loan_transactions` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `branch_id` int DEFAULT NULL,
  `user_id` int DEFAULT NULL,
  `modified_by_id` int DEFAULT NULL,
  `loan_id` int DEFAULT NULL,
  `borrower_id` int DEFAULT NULL,
  `loan_schedule_id` int DEFAULT NULL,
  `repayment_method_id` int DEFAULT NULL,
  `transaction_type` enum('repayment','repayment_disbursement','write_off','write_off_recovery','disbursement','interest_accrual','fee_accrual','penalty_accrual','deposit','withdrawal','manual_entry','pay_charge','transfer_fund','interest','income','fee','disbursement_fee','installment_fee','specified_due_date_fee','overdue_maturity','overdue_installment_fee','loan_rescheduling_fee','penalty','interest_waiver','charge_waiver','pay_off') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'repayment',
  `name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `debit` decimal(65,4) DEFAULT NULL,
  `credit` decimal(65,4) DEFAULT NULL,
  `balance` decimal(65,4) DEFAULT NULL,
  `reversible` tinyint NOT NULL DEFAULT '0',
  `reversed` tinyint NOT NULL DEFAULT '0',
  `reversal_type` enum('system','user','none') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'none',
  `payment_type` enum('interest','principal','regular') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'regular',
  `date` date DEFAULT NULL,
  `month` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `year` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `receipt` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=106 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `loan_transactions`
--

INSERT INTO `loan_transactions` VALUES (1,1,1,NULL,1,1,NULL,NULL,'disbursement',NULL,100.0000,NULL,NULL,0,0,'none','regular','2022-09-27','09','2022',NULL,NULL,'2022-09-29 08:41:49','2022-09-29 08:41:49'),(2,1,1,NULL,1,1,NULL,NULL,'interest',NULL,96.7742,NULL,NULL,0,0,'none','regular','2022-09-27','09','2022',NULL,NULL,'2022-09-29 08:41:49','2022-09-29 08:41:49'),(3,1,1,NULL,1,1,1,1,'repayment',NULL,NULL,17.1100,NULL,1,0,'none','regular','2022-09-29','09','2022',NULL,NULL,'2022-09-29 08:55:21','2022-09-29 08:55:21'),(4,1,1,NULL,1,1,2,1,'repayment',NULL,NULL,16.3300,NULL,1,0,'none','regular','2022-10-16','10','2022',NULL,NULL,'2022-10-16 09:56:19','2022-10-16 09:56:19'),(5,1,1,NULL,2,1,NULL,NULL,'disbursement',NULL,200.0000,NULL,NULL,0,0,'none','regular','2022-10-18','10','2022',NULL,NULL,'2022-10-18 15:34:16','2022-10-18 15:34:16'),(6,1,1,NULL,2,1,NULL,NULL,'interest',NULL,61.8667,NULL,NULL,0,0,'none','regular','2022-10-18','10','2022',NULL,NULL,'2022-10-18 15:34:16','2022-10-18 15:34:16'),(7,1,1,NULL,3,2,NULL,NULL,'disbursement',NULL,500.0000,500.0000,NULL,0,1,'system','regular','2022-10-21','10','2022',NULL,NULL,'2022-10-21 10:31:43','2022-11-03 11:31:25'),(8,1,1,NULL,3,2,NULL,NULL,'interest',NULL,74.6667,74.6667,NULL,0,1,'system','regular','2022-10-21','10','2022',NULL,NULL,'2022-10-21 10:31:43','2022-11-03 11:31:26'),(9,1,1,NULL,3,2,NULL,NULL,'disbursement',NULL,500.0000,500.0000,NULL,0,1,'system','regular','2022-10-21','10','2022',NULL,NULL,'2022-11-03 11:31:46','2022-11-03 11:32:07'),(10,1,1,NULL,3,2,NULL,NULL,'interest',NULL,74.6667,74.6667,NULL,0,1,'system','regular','2022-10-21','10','2022',NULL,NULL,'2022-11-03 11:31:46','2022-11-03 11:32:07'),(11,1,1,NULL,3,2,NULL,NULL,'disbursement',NULL,500.0000,500.0000,NULL,0,1,'system','regular','2022-10-21','10','2022',NULL,NULL,'2022-11-03 11:32:58','2022-11-03 11:35:41'),(12,1,1,NULL,3,2,NULL,NULL,'interest',NULL,25.2500,25.2500,NULL,0,1,'system','regular','2022-10-21','10','2022',NULL,NULL,'2022-11-03 11:32:58','2022-11-03 11:35:41'),(13,1,1,NULL,3,2,NULL,NULL,'disbursement',NULL,1000.0000,1000.0000,NULL,0,1,'system','regular','2022-10-21','10','2022',NULL,NULL,'2022-11-03 11:36:43','2022-11-03 11:37:28'),(14,1,1,NULL,3,2,NULL,NULL,'interest',NULL,80.5000,80.5000,NULL,0,1,'system','regular','2022-10-21','10','2022',NULL,NULL,'2022-11-03 11:36:43','2022-11-03 11:37:28'),(15,1,1,NULL,3,2,NULL,NULL,'disbursement',NULL,1000.0000,1000.0000,NULL,0,1,'system','regular','2022-10-21','10','2022',NULL,NULL,'2022-11-03 11:38:17','2022-11-03 11:39:51'),(16,1,1,NULL,3,2,NULL,NULL,'interest',NULL,90.0000,90.0000,NULL,0,1,'system','regular','2022-10-21','10','2022',NULL,NULL,'2022-11-03 11:38:17','2022-11-03 11:39:51'),(17,1,1,NULL,3,2,NULL,NULL,'disbursement',NULL,700.0000,700.0000,NULL,0,1,'system','regular','2022-10-21','10','2022',NULL,NULL,'2022-11-03 11:40:25','2022-11-03 11:40:49'),(18,1,1,NULL,3,2,NULL,NULL,'interest',NULL,63.0000,63.0000,NULL,0,1,'system','regular','2022-10-21','10','2022',NULL,NULL,'2022-11-03 11:40:25','2022-11-03 11:40:49'),(19,1,1,NULL,3,2,NULL,NULL,'disbursement',NULL,500.0000,500.0000,NULL,0,1,'system','regular','2022-10-21','10','2022',NULL,NULL,'2022-11-03 11:41:11','2022-11-03 11:42:41'),(20,1,1,NULL,3,2,NULL,NULL,'interest',NULL,45.0000,45.0000,NULL,0,1,'system','regular','2022-10-21','10','2022',NULL,NULL,'2022-11-03 11:41:11','2022-11-03 11:42:41'),(21,1,1,NULL,3,2,NULL,NULL,'disbursement',NULL,250.0000,250.0000,NULL,0,1,'system','regular','2022-10-21','10','2022',NULL,NULL,'2022-11-03 11:42:57','2022-11-14 04:25:54'),(22,1,1,NULL,3,2,NULL,NULL,'interest',NULL,22.5000,22.5000,NULL,0,1,'system','regular','2022-10-21','10','2022',NULL,NULL,'2022-11-03 11:42:57','2022-11-14 04:25:54'),(23,1,1,NULL,3,2,NULL,NULL,'disbursement',NULL,889.0000,889.0000,NULL,0,1,'system','regular','2022-10-21','10','2022',NULL,NULL,'2022-11-14 04:26:12','2022-11-14 04:28:10'),(24,1,1,NULL,3,2,NULL,NULL,'interest',NULL,160.0200,160.0200,NULL,0,1,'system','regular','2022-10-21','10','2022',NULL,NULL,'2022-11-14 04:26:12','2022-11-14 04:28:10'),(25,1,1,NULL,3,2,NULL,NULL,'disbursement',NULL,889.0000,889.0000,NULL,0,1,'system','regular','2022-10-21','10','2022',NULL,NULL,'2022-11-14 04:28:18','2022-11-14 04:38:27'),(26,1,1,NULL,3,2,NULL,NULL,'interest',NULL,160.0200,160.0200,NULL,0,1,'system','regular','2022-10-21','10','2022',NULL,NULL,'2022-11-14 04:28:18','2022-11-14 04:38:27'),(27,1,1,NULL,3,2,NULL,NULL,'disbursement',NULL,899.0000,899.0000,NULL,0,1,'system','regular','2022-10-21','10','2022',NULL,NULL,'2022-11-14 04:38:59','2022-11-14 05:15:00'),(28,1,1,NULL,3,2,NULL,NULL,'interest',NULL,80.9100,80.9100,NULL,0,1,'system','regular','2022-10-21','10','2022',NULL,NULL,'2022-11-14 04:38:59','2022-11-14 05:15:00'),(29,1,1,NULL,3,2,NULL,NULL,'disbursement',NULL,500.0000,500.0000,NULL,0,1,'system','regular','2022-10-21','10','2022',NULL,NULL,'2022-11-14 05:15:05','2022-11-14 05:16:21'),(30,1,1,NULL,3,2,NULL,NULL,'interest',NULL,45.0000,45.0000,NULL,0,1,'system','regular','2022-10-21','10','2022',NULL,NULL,'2022-11-14 05:15:05','2022-11-14 05:16:21'),(31,1,1,NULL,3,2,NULL,NULL,'disbursement',NULL,500.0000,NULL,NULL,0,0,'none','regular','2022-10-21','10','2022',NULL,NULL,'2022-11-14 05:16:26','2022-11-14 05:16:26'),(32,1,1,NULL,3,2,NULL,NULL,'interest',NULL,90.0000,NULL,NULL,0,0,'none','regular','2022-10-21','10','2022',NULL,NULL,'2022-11-14 05:16:26','2022-11-14 05:16:26'),(33,1,1,NULL,4,1,NULL,NULL,'disbursement',NULL,1000.0000,NULL,NULL,0,0,'none','regular','2022-11-16','11','2022',NULL,NULL,'2022-11-16 15:10:05','2022-11-16 15:10:05'),(34,1,1,NULL,4,1,NULL,NULL,'interest',NULL,278.7097,NULL,NULL,0,0,'none','regular','2022-11-16','11','2022',NULL,NULL,'2022-11-16 15:10:05','2022-11-16 15:10:05'),(35,1,1,NULL,6,1,NULL,NULL,'disbursement',NULL,500.0000,NULL,NULL,0,0,'none','regular','2022-12-05','12','2022',NULL,NULL,'2022-12-05 03:56:02','2022-12-05 03:56:02'),(36,1,1,NULL,6,1,NULL,NULL,'interest',NULL,400.0000,NULL,NULL,0,0,'none','regular','2022-12-05','12','2022',NULL,NULL,'2022-12-05 03:56:02','2022-12-05 03:56:02'),(37,1,1,NULL,7,1,NULL,NULL,'disbursement',NULL,500.0000,NULL,NULL,0,0,'none','regular','2022-12-05','12','2022',NULL,NULL,'2022-12-05 04:17:08','2022-12-05 04:17:08'),(38,1,1,NULL,7,1,NULL,NULL,'interest',NULL,249.7761,NULL,NULL,0,0,'none','regular','2022-12-05','12','2022',NULL,NULL,'2022-12-05 04:17:08','2022-12-05 04:17:08'),(39,1,1,NULL,8,1,NULL,NULL,'disbursement',NULL,2000.0000,2000.0000,NULL,0,1,'system','regular','2022-12-23','12','2022',NULL,NULL,'2022-12-23 12:04:14','2022-12-23 12:11:48'),(40,1,1,NULL,8,1,NULL,NULL,'interest',NULL,474.7222,474.7222,NULL,0,1,'system','regular','2022-12-23','12','2022',NULL,NULL,'2022-12-23 12:04:14','2022-12-23 12:11:48'),(41,1,1,NULL,8,1,NULL,NULL,'disbursement_fee',NULL,400.0000,400.0000,NULL,0,1,'system','regular','2022-12-23','12','2022',NULL,NULL,'2022-12-23 12:04:14','2022-12-23 12:11:48'),(42,1,1,NULL,8,1,NULL,NULL,'repayment_disbursement',NULL,400.0000,400.0000,NULL,0,1,'system','regular','2022-12-23','12','2022',NULL,NULL,'2022-12-23 12:04:14','2022-12-23 12:11:48'),(43,1,1,NULL,8,1,NULL,NULL,'disbursement',NULL,2000.0000,2000.0000,NULL,0,1,'system','regular','2022-12-23','12','2022',NULL,NULL,'2022-12-28 11:34:41','2022-12-28 11:41:53'),(44,1,1,NULL,8,1,NULL,NULL,'interest',NULL,474.7222,474.7222,NULL,0,1,'system','regular','2022-12-23','12','2022',NULL,NULL,'2022-12-28 11:34:41','2022-12-28 11:41:53'),(45,1,1,NULL,8,1,NULL,NULL,'disbursement_fee',NULL,400.0000,400.0000,NULL,0,1,'system','regular','2022-12-23','12','2022',NULL,NULL,'2022-12-28 11:34:41','2022-12-28 11:41:53'),(46,1,1,NULL,8,1,NULL,NULL,'repayment_disbursement',NULL,400.0000,400.0000,NULL,0,1,'system','regular','2022-12-23','12','2022',NULL,NULL,'2022-12-28 11:34:41','2022-12-28 11:41:53'),(47,1,1,NULL,8,1,NULL,NULL,'disbursement',NULL,2000.0000,2000.0000,NULL,0,1,'system','regular','2022-12-23','12','2022',NULL,NULL,'2022-12-28 11:42:08','2022-12-28 11:42:55'),(48,1,1,NULL,8,1,NULL,NULL,'interest',NULL,474.7222,474.7222,NULL,0,1,'system','regular','2022-12-23','12','2022',NULL,NULL,'2022-12-28 11:42:08','2022-12-28 11:42:55'),(49,1,1,NULL,8,1,NULL,NULL,'disbursement_fee',NULL,400.0000,400.0000,NULL,0,1,'system','regular','2022-12-23','12','2022',NULL,NULL,'2022-12-28 11:42:08','2022-12-28 11:42:55'),(50,1,1,NULL,8,1,NULL,NULL,'repayment_disbursement',NULL,400.0000,400.0000,NULL,0,1,'system','regular','2022-12-23','12','2022',NULL,NULL,'2022-12-28 11:42:08','2022-12-28 11:42:55'),(51,1,1,NULL,8,1,NULL,NULL,'disbursement',NULL,2000.0000,NULL,NULL,0,0,'none','regular','2022-12-23','12','2022',NULL,NULL,'2022-12-28 11:44:49','2022-12-28 11:44:49'),(52,1,1,NULL,8,1,NULL,NULL,'interest',NULL,474.7222,NULL,NULL,0,0,'none','regular','2022-12-23','12','2022',NULL,NULL,'2022-12-28 11:44:49','2022-12-28 11:44:49'),(53,1,1,NULL,8,1,NULL,NULL,'disbursement_fee',NULL,20.0000,NULL,NULL,0,0,'none','regular','2022-12-23','12','2022',NULL,NULL,'2022-12-28 11:44:49','2022-12-28 11:44:49'),(54,1,1,NULL,8,1,NULL,NULL,'repayment_disbursement',NULL,NULL,20.0000,NULL,0,0,'none','regular','2022-12-23','12','2022',NULL,NULL,'2022-12-28 11:44:49','2022-12-28 11:44:49'),(55,1,1,NULL,9,2,NULL,NULL,'disbursement',NULL,1000.0000,NULL,NULL,0,0,'none','regular','2022-12-28','12','2022',NULL,NULL,'2022-12-28 11:47:16','2022-12-28 11:47:16'),(56,1,1,NULL,9,2,NULL,NULL,'interest',NULL,128.2367,NULL,NULL,0,0,'none','regular','2022-12-28','12','2022',NULL,NULL,'2022-12-28 11:47:16','2022-12-28 11:47:16'),(57,1,1,NULL,9,2,NULL,NULL,'disbursement_fee',NULL,10.0000,NULL,NULL,0,0,'none','regular','2022-12-28','12','2022',NULL,NULL,'2022-12-28 11:47:16','2022-12-28 11:47:16'),(58,1,1,NULL,9,2,NULL,NULL,'repayment_disbursement',NULL,NULL,10.0000,NULL,0,0,'none','regular','2022-12-28','12','2022',NULL,NULL,'2022-12-28 11:47:16','2022-12-28 11:47:16'),(59,1,1,NULL,11,4,NULL,NULL,'disbursement',NULL,50000.0000,NULL,NULL,0,0,'none','regular','2023-02-10','02','2023',NULL,NULL,'2023-02-10 09:06:30','2023-02-10 09:06:30'),(60,1,1,NULL,11,4,NULL,NULL,'interest',NULL,22000.0000,NULL,NULL,0,0,'none','regular','2023-02-10','02','2023',NULL,NULL,'2023-02-10 09:06:30','2023-02-10 09:06:30'),(61,1,1,NULL,11,4,NULL,NULL,'disbursement_fee',NULL,500.0000,NULL,NULL,0,0,'none','regular','2023-02-10','02','2023',NULL,NULL,'2023-02-10 09:06:30','2023-02-10 09:06:30'),(62,1,1,NULL,11,4,NULL,NULL,'repayment_disbursement',NULL,NULL,500.0000,NULL,0,0,'none','regular','2023-02-10','02','2023',NULL,NULL,'2023-02-10 09:06:30','2023-02-10 09:06:30'),(63,1,1,NULL,12,1,NULL,NULL,'disbursement',NULL,500.0000,NULL,NULL,0,0,'none','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:02:07','2023-02-17 08:02:07'),(64,1,1,NULL,12,1,NULL,NULL,'interest',NULL,96.7340,NULL,NULL,0,0,'none','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:02:07','2023-02-17 08:02:07'),(65,1,1,NULL,12,1,NULL,NULL,'disbursement_fee',NULL,5.0000,NULL,NULL,0,0,'none','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:02:07','2023-02-17 08:02:07'),(66,1,1,NULL,12,1,NULL,NULL,'repayment_disbursement',NULL,NULL,5.0000,NULL,0,0,'none','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:02:07','2023-02-17 08:02:07'),(67,1,1,NULL,13,1,NULL,NULL,'disbursement',NULL,100.0000,NULL,NULL,0,0,'none','regular','2023-03-17','03','2023',NULL,NULL,'2023-02-17 08:06:02','2023-02-17 08:06:02'),(68,1,1,NULL,13,1,NULL,NULL,'interest',NULL,100.0000,NULL,NULL,0,0,'none','regular','2023-03-17','03','2023',NULL,NULL,'2023-02-17 08:06:02','2023-02-17 08:06:02'),(69,1,1,NULL,13,1,NULL,NULL,'disbursement_fee',NULL,1.0000,NULL,NULL,0,0,'none','regular','2023-03-17','03','2023',NULL,NULL,'2023-02-17 08:06:02','2023-02-17 08:06:02'),(70,1,1,NULL,13,1,NULL,NULL,'repayment_disbursement',NULL,NULL,1.0000,NULL,0,0,'none','regular','2023-03-17','03','2023',NULL,NULL,'2023-02-17 08:06:02','2023-02-17 08:06:02'),(71,1,1,NULL,14,1,NULL,NULL,'disbursement',NULL,100.0000,NULL,NULL,0,0,'none','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:09:52','2023-02-17 08:09:52'),(72,1,1,NULL,14,1,NULL,NULL,'interest',NULL,62.7454,NULL,NULL,0,0,'none','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:09:52','2023-02-17 08:09:52'),(73,1,1,NULL,14,1,NULL,NULL,'disbursement_fee',NULL,1.0000,NULL,NULL,0,0,'none','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:09:52','2023-02-17 08:09:52'),(74,1,1,NULL,14,1,NULL,NULL,'repayment_disbursement',NULL,NULL,1.0000,NULL,0,0,'none','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:09:52','2023-02-17 08:09:52'),(75,1,1,NULL,15,1,NULL,NULL,'disbursement',NULL,100.0000,NULL,NULL,0,0,'none','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:10:51','2023-02-17 08:10:51'),(76,1,1,NULL,15,1,NULL,NULL,'interest',NULL,55.0000,NULL,NULL,0,0,'none','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:10:51','2023-02-17 08:10:51'),(77,1,1,NULL,15,1,NULL,NULL,'disbursement_fee',NULL,1.0000,NULL,NULL,0,0,'none','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:10:51','2023-02-17 08:10:51'),(78,1,1,NULL,15,1,NULL,NULL,'repayment_disbursement',NULL,NULL,1.0000,NULL,0,0,'none','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:10:51','2023-02-17 08:10:51'),(79,1,1,NULL,16,1,NULL,NULL,'disbursement',NULL,250.0000,NULL,NULL,0,0,'none','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:13:01','2023-02-17 08:13:01'),(80,1,1,NULL,16,1,NULL,NULL,'interest',NULL,40.0000,NULL,NULL,0,0,'none','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:13:01','2023-02-17 08:13:01'),(81,1,1,NULL,16,1,NULL,NULL,'disbursement_fee',NULL,2.5000,NULL,NULL,0,0,'none','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:13:01','2023-02-17 08:13:01'),(82,1,1,NULL,16,1,NULL,NULL,'repayment_disbursement',NULL,NULL,2.5000,NULL,0,0,'none','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:13:01','2023-02-17 08:13:01'),(83,1,1,NULL,17,1,NULL,NULL,'disbursement',NULL,10000.0000,NULL,NULL,0,0,'none','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:17:47','2023-02-17 08:17:47'),(84,1,1,NULL,17,1,NULL,NULL,'interest',NULL,4171.3798,NULL,NULL,0,0,'none','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:17:47','2023-02-17 08:17:47'),(85,1,1,NULL,17,1,NULL,NULL,'disbursement_fee',NULL,100.0000,NULL,NULL,0,0,'none','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:17:47','2023-02-17 08:17:47'),(86,1,1,NULL,17,1,NULL,NULL,'repayment_disbursement',NULL,NULL,100.0000,NULL,0,0,'none','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:17:47','2023-02-17 08:17:47'),(87,1,1,NULL,18,1,NULL,NULL,'disbursement',NULL,295.0000,295.0000,NULL,0,1,'system','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:28:34','2023-02-17 08:28:58'),(88,1,1,NULL,18,1,NULL,NULL,'interest',NULL,13.4068,13.4068,NULL,0,1,'system','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:28:34','2023-02-17 08:28:58'),(89,1,1,NULL,18,1,NULL,NULL,'disbursement_fee',NULL,1.0000,1.0000,NULL,0,1,'system','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:28:34','2023-02-17 08:28:58'),(90,1,1,NULL,18,1,NULL,NULL,'repayment_disbursement',NULL,1.0000,1.0000,NULL,0,1,'system','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:28:34','2023-02-17 08:28:58'),(91,1,1,NULL,18,1,NULL,NULL,'disbursement',NULL,295.0000,295.0000,NULL,0,1,'system','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:29:24','2023-02-17 08:29:58'),(92,1,1,NULL,18,1,NULL,NULL,'interest',NULL,13.2750,13.2750,NULL,0,1,'system','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:29:24','2023-02-17 08:29:58'),(93,1,1,NULL,18,1,NULL,NULL,'disbursement_fee',NULL,1.0000,1.0000,NULL,0,1,'system','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:29:24','2023-02-17 08:29:58'),(94,1,1,NULL,18,1,NULL,NULL,'repayment_disbursement',NULL,1.0000,1.0000,NULL,0,1,'system','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:29:24','2023-02-17 08:29:58'),(95,1,1,NULL,18,1,NULL,NULL,'disbursement',NULL,295.0000,NULL,NULL,0,0,'none','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:30:22','2023-02-17 08:30:22'),(96,1,1,NULL,18,1,NULL,NULL,'interest',NULL,22.1250,NULL,NULL,0,0,'none','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:30:22','2023-02-17 08:30:22'),(97,1,1,NULL,18,1,NULL,NULL,'disbursement_fee',NULL,1.0000,NULL,NULL,0,0,'none','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:30:22','2023-02-17 08:30:22'),(98,1,1,NULL,18,1,NULL,NULL,'repayment_disbursement',NULL,NULL,1.0000,NULL,0,0,'none','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:30:22','2023-02-17 08:30:22'),(99,1,1,NULL,13,1,173,1,'repayment',NULL,NULL,20.0000,NULL,1,0,'none','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:50:44','2023-02-17 08:50:44'),(100,1,1,NULL,15,1,193,1,'repayment',NULL,NULL,20.0000,NULL,1,0,'none','regular','2023-02-17','02','2023',NULL,NULL,'2023-02-17 08:51:14','2023-02-17 08:51:14'),(101,1,1,NULL,19,1,NULL,NULL,'disbursement',NULL,150.0000,NULL,NULL,0,0,'none','regular',NULL,'02','2023',NULL,NULL,'2023-02-17 08:58:52','2023-02-17 08:58:52'),(102,1,1,NULL,19,1,NULL,NULL,'interest',NULL,66.0000,NULL,NULL,0,0,'none','regular',NULL,'02','2023',NULL,NULL,'2023-02-17 08:58:52','2023-02-17 08:58:52'),(103,1,1,NULL,19,1,NULL,NULL,'interest',NULL,-66.0000,NULL,NULL,0,0,'none','regular','2023-02-21','02','2023',NULL,NULL,'2023-02-21 09:00:41','2023-02-21 09:00:41'),(104,1,1,NULL,19,1,NULL,NULL,'interest',NULL,12.0000,NULL,NULL,0,0,'none','regular','2023-02-21','02','2023',NULL,NULL,'2023-02-21 09:00:41','2023-02-21 09:00:41'),(105,1,1,NULL,19,1,NULL,1,'pay_off',NULL,NULL,162.0000,NULL,1,0,'none','regular','2023-02-21','02','2023','test','test','2023-02-21 09:00:41','2023-02-21 09:00:41');

--
-- Table structure for table `loans`
--

CREATE TABLE `loans` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `borrower_id` int NOT NULL,
  `loan_product_id` int NOT NULL,
  `reference` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `release_date` date DEFAULT NULL,
  `maturity_date` date DEFAULT NULL,
  `month` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `year` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `interest_start_date` date DEFAULT NULL,
  `first_payment_date` date DEFAULT NULL,
  `loan_disbursed_by_id` int DEFAULT NULL,
  `principal` decimal(65,4) DEFAULT NULL,
  `interest_method` enum('flat_rate','declining_balance_equal_installments','declining_balance_equal_principal','interest_only','compound_interest') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'flat_rate',
  `interest_rate` decimal(10,4) DEFAULT NULL,
  `interest_period` enum('day','week','month','year') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'day',
  `override_interest` tinyint NOT NULL DEFAULT '0',
  `override_interest_amount` decimal(10,4) DEFAULT '0.0000',
  `loan_duration` int DEFAULT NULL,
  `loan_duration_type` enum('day','week','month','year') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'year',
  `repayment_cycle` enum('daily','weekly','monthly','bi_monthly','quarterly','semi_annually','annually') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'monthly',
  `decimal_places` enum('round_off_to_two_decimal','round_off_to_integer') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'round_off_to_two_decimal',
  `repayment_order` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `loan_fees_schedule` enum('dont_include','distribute_fees_evenly','charge_fees_on_released_date','charge_fees_on_first_payment','charge_fees_on_last_payment') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'distribute_fees_evenly',
  `grace_on_interest_charged` int DEFAULT NULL,
  `loan_status_id` int DEFAULT NULL,
  `files` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `loan_status` enum('open','fully_paid','defaulted','restructured','processing') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'open',
  `balance` decimal(65,4) DEFAULT NULL,
  `override` tinyint NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `status` enum('pending','approved','disbursed','declined','withdrawn','written_off','closed','pending_reschedule','rescheduled') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `applied_amount` decimal(65,4) DEFAULT NULL,
  `approved_amount` decimal(65,4) DEFAULT NULL,
  `approved_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `disbursed_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `withdrawn_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `closed_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `rescheduled_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `declined_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `written_off_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `approved_date` date DEFAULT NULL,
  `disbursed_date` date DEFAULT NULL,
  `withdrawn_date` date DEFAULT NULL,
  `closed_date` date DEFAULT NULL,
  `rescheduled_date` date DEFAULT NULL,
  `declined_date` date DEFAULT NULL,
  `written_off_date` date DEFAULT NULL,
  `approved_by_id` int DEFAULT NULL,
  `disbursed_by_id` int DEFAULT NULL,
  `withdrawn_by_id` int DEFAULT NULL,
  `declined_by_id` int DEFAULT NULL,
  `written_off_by_id` int DEFAULT NULL,
  `rescheduled_by_id` int DEFAULT NULL,
  `closed_by_id` int DEFAULT NULL,
  `branch_id` int DEFAULT NULL,
  `processing_fee` decimal(65,4) DEFAULT NULL,
  `product_check_out_id` int DEFAULT NULL,
  `loan_officer_id` int DEFAULT NULL,
  `pay_off_interest_rate` decimal(10,4) DEFAULT '0.0000',
  PRIMARY KEY (`id`),
  KEY `loans_id_index` (`id`),
  KEY `loans_month_index` (`month`),
  KEY `loans_year_index` (`year`),
  KEY `loans_release_date_index` (`release_date`),
  KEY `loans_maturity_date_index` (`maturity_date`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `loans`
--

INSERT INTO `loans` VALUES (1,1,1,1,NULL,'2022-09-27','2023-11-01','09','2022',NULL,'2022-10-31',1,100.0000,'flat_rate',8.0000,'month',0,0.0000,12,'month','monthly','round_off_to_two_decimal',NULL,'distribute_fees_evenly',0,NULL,'a:0:{}',NULL,'open',NULL,0,'2022-09-27 11:21:25','2022-09-29 08:41:49',NULL,'disbursed',100.0000,100.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2022-09-29','2022-09-27',NULL,NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,1,8.0000),(2,1,1,1,NULL,'2022-10-18','2023-02-21','10','2022',NULL,'2022-11-01',1,200.0000,'flat_rate',8.0000,'month',0,0.0000,4,'month','weekly','round_off_to_two_decimal',NULL,'distribute_fees_evenly',0,NULL,'a:0:{}',NULL,'open',NULL,0,'2022-10-18 15:32:56','2022-10-18 15:34:16',NULL,'disbursed',100.0000,200.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2022-10-18','2022-10-18',NULL,NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,1,8.0000),(3,1,2,1,NULL,'2022-10-21','2023-11-21','10','2022',NULL,'2022-11-21',1,500.0000,'flat_rate',1.5000,'month',0,0.0000,12,'month','monthly','round_off_to_two_decimal',NULL,'distribute_fees_evenly',0,NULL,'a:0:{}',NULL,'open',NULL,0,'2022-10-21 10:28:21','2022-11-14 05:16:26',NULL,'disbursed',500.0000,500.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2022-10-21','2022-10-21',NULL,NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,4,1.5000),(4,1,1,1,NULL,'2022-11-16','2023-04-01','11','2022',NULL,'2022-12-01',1,1000.0000,'flat_rate',8.0000,'month',0,0.0000,4,'month','monthly','round_off_to_two_decimal',NULL,'distribute_fees_evenly',0,NULL,'a:0:{}','tset','open',NULL,0,'2022-11-16 15:09:50','2022-11-16 15:10:05',NULL,'disbursed',1000.0000,1000.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2022-11-16','2022-11-16',NULL,NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,4,8.0000),(5,1,2,1,NULL,'2022-11-18','2023-10-01','11','2022',NULL,'2022-12-01',NULL,2000.0000,'declining_balance_equal_installments',8.0000,'month',0,0.0000,10,'month','monthly','round_off_to_two_decimal',NULL,'distribute_fees_evenly',0,NULL,'a:0:{}',NULL,'open',NULL,0,'2022-11-18 09:50:53','2022-11-18 09:51:07',NULL,'approved',2000.0000,2000.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2022-11-18',NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,1,8.0000),(6,1,1,1,NULL,'2022-12-05','2023-09-03','12','2022',NULL,'2022-12-31',1,500.0000,'flat_rate',10.0000,'month',0,0.0000,8,'month','monthly','round_off_to_two_decimal',NULL,'distribute_fees_evenly',0,NULL,'a:0:{}',NULL,'open',NULL,0,'2022-12-05 03:55:53','2022-12-05 03:56:02',NULL,'disbursed',500.0000,500.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2022-12-05','2022-12-05',NULL,NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,1,10.0000),(7,1,1,1,NULL,'2022-12-05','2023-09-03','12','2022',NULL,'2022-12-31',1,500.0000,'declining_balance_equal_installments',10.0000,'month',0,0.0000,8,'month','monthly','round_off_to_two_decimal',NULL,'distribute_fees_evenly',0,NULL,'a:0:{}',NULL,'open',NULL,0,'2022-12-05 04:16:57','2022-12-05 04:17:08',NULL,'disbursed',500.0000,500.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2022-12-05','2022-12-05',NULL,NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,1,10.0000),(8,1,1,1,NULL,'2022-12-23','2023-06-01','12','2022',NULL,'2023-02-01',1,2000.0000,'declining_balance_equal_installments',8.0000,'month',0,0.0000,4,'month','monthly','round_off_to_two_decimal',NULL,'distribute_fees_evenly',0,NULL,'a:0:{}',NULL,'open',NULL,0,'2022-12-23 12:03:54','2022-12-28 11:44:49',NULL,'disbursed',2000.0000,2000.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2022-12-23','2022-12-23',NULL,NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,1,8.0000),(9,1,2,1,NULL,'2022-12-28','2023-05-02','12','2022',NULL,'2022-12-30',1,1000.0000,'declining_balance_equal_installments',8.0000,'month',0,0.0000,4,'month','monthly','round_off_to_two_decimal',NULL,'distribute_fees_evenly',0,NULL,'a:0:{}',NULL,'open',NULL,0,'2022-12-28 10:36:50','2022-12-28 11:47:16',NULL,'disbursed',1000.0000,1000.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2022-12-28','2022-12-28',NULL,NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,5,8.0000),(10,4,4,1,NULL,'2023-01-07','2023-03-05','01','2023',NULL,'2023-02-05',NULL,20000.0000,'flat_rate',5.0000,'month',0,0.0000,1,'month','monthly','round_off_to_two_decimal',NULL,'distribute_fees_evenly',0,NULL,'a:0:{}',NULL,'open',NULL,0,'2023-01-06 17:29:15','2023-01-06 17:41:40',NULL,'pending',20000.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,4,5.0000),(11,1,4,1,NULL,'2023-02-10','2024-01-10','02','2023',NULL,'2023-03-10',1,50000.0000,'declining_balance_equal_principal',8.0000,'month',0,0.0000,10,'month','monthly','round_off_to_two_decimal',NULL,'distribute_fees_evenly',0,NULL,'a:0:{}',NULL,'open',NULL,0,'2023-02-10 09:06:00','2023-02-10 09:06:29',NULL,'disbursed',50000.0000,50000.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2023-02-10','2023-02-10',NULL,NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,1,8.0000),(12,1,1,1,NULL,'2023-02-17','2023-07-01','02','2023',NULL,'2023-03-01',1,500.0000,'declining_balance_equal_installments',10.0000,'month',0,0.0000,4,'month','monthly','round_off_to_two_decimal',NULL,'distribute_fees_evenly',0,NULL,'a:0:{}',NULL,'open',NULL,0,'2023-02-17 08:01:54','2023-02-17 08:02:07',NULL,'disbursed',500.0000,500.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2023-02-17','2023-02-17',NULL,NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,1,8.0000),(13,1,1,1,NULL,'2023-03-17','2024-01-17','03','2023',NULL,'2023-03-17',1,100.0000,'flat_rate',10.0000,'month',0,0.0000,10,'month','monthly','round_off_to_two_decimal',NULL,'distribute_fees_evenly',0,NULL,'a:0:{}',NULL,'open',NULL,0,'2023-02-17 08:05:39','2023-02-17 08:06:02',NULL,'disbursed',100.0000,100.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2023-02-17','2023-03-17',NULL,NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,1,8.0000),(14,1,1,1,NULL,'2023-02-17','2024-01-17','02','2023',NULL,'2023-03-17',1,100.0000,'declining_balance_equal_installments',10.0000,'month',0,0.0000,10,'month','monthly','round_off_to_two_decimal',NULL,'distribute_fees_evenly',0,NULL,'a:0:{}',NULL,'open',NULL,0,'2023-02-17 08:09:20','2023-02-17 08:09:51',NULL,'disbursed',100.0000,100.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2023-02-17','2023-02-17',NULL,NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,1,8.0000),(15,1,1,1,NULL,'2023-02-17','2024-01-17','02','2023',NULL,'2023-03-17',1,100.0000,'declining_balance_equal_principal',10.0000,'month',0,0.0000,10,'month','monthly','round_off_to_two_decimal',NULL,'distribute_fees_evenly',0,NULL,'a:0:{}',NULL,'open',NULL,0,'2023-02-17 08:10:39','2023-02-17 08:10:51',NULL,'disbursed',100.0000,100.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2023-02-17','2023-02-17',NULL,NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,1,8.0000),(16,1,1,1,NULL,'2023-02-17','2023-06-17','02','2023',NULL,'2023-03-17',1,250.0000,'declining_balance_equal_principal',8.0000,'month',0,0.0000,3,'month','monthly','round_off_to_two_decimal',NULL,'distribute_fees_evenly',0,NULL,'a:0:{}',NULL,'open',NULL,0,'2023-02-17 08:12:06','2023-02-17 08:13:01',NULL,'disbursed',250.0000,250.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2023-02-17','2023-02-17',NULL,NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,1,8.0000),(17,1,1,1,NULL,'2023-02-17','2025-03-17','02','2023',NULL,'2023-03-17',1,10000.0000,'declining_balance_equal_installments',3.0000,'month',0,0.0000,24,'month','monthly','round_off_to_two_decimal',NULL,'distribute_fees_evenly',0,NULL,'a:0:{}',NULL,'open',NULL,0,'2023-02-17 08:17:37','2023-02-17 08:17:47',NULL,'disbursed',10000.0000,10000.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2023-02-17','2023-02-17',NULL,NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,1,8.0000),(18,1,1,1,NULL,'2023-02-17','2023-08-17','02','2023',NULL,'2023-03-17',1,295.0000,'flat_rate',1.5000,'month',0,0.0000,5,'month','monthly','round_off_to_two_decimal',NULL,'distribute_fees_evenly',0,NULL,'a:0:{}',NULL,'open',NULL,0,'2023-02-17 08:28:11','2023-02-17 08:58:52',NULL,'rescheduled',295.0000,295.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2023-02-17','2023-02-17',NULL,NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,1,8.0000),(19,1,1,1,NULL,NULL,'2024-01-17','02','2023',NULL,'2023-03-17',NULL,150.0000,'declining_balance_equal_principal',8.0000,'month',0,0.0000,10,'month','monthly','round_off_to_two_decimal',NULL,'distribute_fees_evenly',0,NULL,'a:0:{}',NULL,'open',NULL,0,'2023-02-17 08:58:52','2023-02-21 09:00:41',NULL,'closed',150.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,8.0000);

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

CREATE TABLE `messages` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `message_id` int unsigned DEFAULT NULL,
  `title` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `attach_file` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `to_id` int NOT NULL,
  `from_id` int NOT NULL,
  `read` tinyint NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `messages`
--


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

CREATE TABLE `migrations` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=140 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `migrations` VALUES (1,'2014_07_02_230147_migration_cartalyst_sentinel',1),(2,'2014_10_12_100000_create_password_resets_table',1),(3,'2016_07_23_173157_create_messages_table',1),(4,'2016_07_23_173226_create_sms_table',1),(5,'2016_07_23_173242_create_settings_table',1),(6,'2016_11_05_062734_create_permissions_table',1),(7,'2017_02_23_000640_create_borrowers_table',1),(8,'2017_02_23_002300_create_custom_fields_table',1),(9,'2017_02_23_003720_create_custom_fields_meta_table',1),(10,'2017_03_05_131103_create_loans_table',1),(11,'2017_03_05_132848_create_loans_products_table',1),(12,'2017_03_05_145851_create_loan_disbursed_by_table',1),(13,'2017_03_05_150107_create_loan_repayment_methods_table',1),(14,'2017_03_05_151538_create_loan_status_table',1),(15,'2017_03_08_182936_create_loan_schedules_table',1),(16,'2017_03_19_080840_create_loan_repayments_table',1),(17,'2017_04_02_142753_create_loan_comments_table',1),(18,'2017_04_11_091435_create_payroll_templates_table',1),(19,'2017_04_11_094729_create_payroll_template_meta_table',1),(20,'2017_04_12_004631_create_payroll_table',1),(21,'2017_04_12_004829_create_payroll_meta_table',1),(22,'2017_04_14_083438_create_expenses_table',1),(23,'2017_04_14_083535_create_expense_types_table',1),(24,'2017_04_16_084016_create_other_income_table',1),(25,'2017_04_16_084118_create_other_income_types_table',1),(26,'2017_04_16_094025_create_collateral_types_table',1),(27,'2017_04_16_094131_create_collateral_table',1),(28,'2017_04_18_083800_create_emails_table',1),(29,'2017_04_23_072100_create_loan_fees_table',1),(30,'2017_04_23_073118_create_loan_fees_meta_table',1),(31,'2017_05_04_103559_create_countries_table',1),(32,'2017_07_17_123811_add_login_fields_to_borrowers_table',1),(33,'2017_07_17_124138_add_month_year_to_borrowers_table',1),(34,'2017_07_17_124357_add_fields_to_borrowers_table',1),(35,'2017_07_17_130228_add_v1_1_settings_table',1),(36,'2017_07_23_061641_create_loan_applications_table',1),(37,'2017_07_23_064420_create_audit_trail_table',1),(38,'2017_07_23_120222_add_payment_to_v1_1_settings_table',1),(39,'2017_07_24_063824_create_savings_product_table',1),(40,'2017_07_24_070639_create_savings_table',1),(41,'2017_07_24_071756_create_savings_transactions_table',1),(42,'2017_07_24_073802_create_savings_fees_table',1),(43,'2017_07_27_071556_create_asset_types_table',1),(44,'2017_07_27_071814_create_assets_table',1),(45,'2017_07_27_074421_create_asset_valuations_table',1),(46,'2017_07_27_174045_create_capital_table',1),(47,'2017_08_01_064016_add_status_to_loans_table',1),(48,'2017_08_01_081424_create_guarantor_table',1),(49,'2017_08_07_083717_update_from_v1_0_to_1_1',1),(50,'2017_08_23_205719_add_blacklist_to_borrowers_table',1),(51,'2017_09_02_092303_create_borrower_groups',1),(52,'2017_09_02_092551_create_branches',1),(53,'2017_09_02_094025_add_branches_to_all_tables',1),(54,'2017_09_02_154128_create_borrower_group_members_table',1),(55,'2017_09_02_171328_update_from_v1_1_to_1_2',1),(56,'2017_09_05_075257_add_v12_settings',1),(57,'2017_09_05_082513_add_v12_permissions',1),(58,'2017_09_20_093729_add_client_background_settings',1),(59,'2017_09_20_094221_change_update_url',1),(60,'2017_09_23_133042_create_provision_rates_table',1),(61,'2017_09_23_133535_insert_data_to_provision_rates_table',1),(62,'2017_09_24_091220_create_bank_accounts_table',1),(63,'2017_09_24_091340_add_bank_accounts_to_capital_table',1),(64,'2017_10_13_113742_create_branch_users_table',1),(65,'2017_10_13_121839_add_application_fee_to_loans_table',1),(66,'2017_10_13_161720_add_default_branch',1),(67,'2017_10_13_161930_create_default_branch_and_assign_user',1),(68,'2017_10_13_173431_add_branch_to_schedules',1),(69,'2017_10_13_184930_set_default_branch_for_current_loans',1),(70,'2017_10_14_062601_add_v_1_3_permissions',1),(71,'2017_10_14_063504_update_v_1_3_update_url',1),(72,'2017_10_14_074553_update_to_v_1_3',1),(73,'2017_10_21_203340_create_product_categories_meta_table',1),(74,'2017_11_03_102928_add_type_to_capital_table',1),(75,'2017_11_03_105326_create_sms_gateways_table',1),(76,'2017_11_03_163022_add_name_to_guarantors_table',1),(77,'2017_11_03_164012_add_country_id_to_borrowers_table',1),(78,'2017_11_03_164336_add_currencies_table',1),(79,'2017_11_03_165413_add_ver_1_4_settings_table',1),(80,'2017_11_03_203227_add_loan_guarantors_table',1),(81,'2017_11_04_085909_update_to_ver_1_4_table',1),(82,'2017_11_05_232841_create_products_table',1),(83,'2017_11_05_233251_create_product_categories_table',1),(84,'2017_11_06_072921_create_products_check_in_table',1),(85,'2017_11_06_073248_create_products_check_out_table',1),(86,'2017_11_06_073316_create_products_warehouse_table',1),(87,'2017_11_06_082547_create_purchase_orders_table',1),(88,'2017_11_06_100343_create_suppliers_table',1),(89,'2017_11_06_164523_create_brands_table',1),(90,'2017_11_06_210217_create_products_check_out_items_table',1),(91,'2017_11_06_210317_create_products_payments_table',1),(92,'2017_11_06_210706_create_products_check_in_items_table',1),(93,'2017_11_07_035537_create_purchase_order_items_table',1),(94,'2017_11_07_090146_add_checkout_to_loan_table_table',1),(95,'2017_11_07_091944_add_warehouses_table',1),(96,'2017_11_08_151744_add_overdraw_settings',1),(97,'2017_11_11_071409_create_chart_of_accounts_table',1),(98,'2017_11_11_080928_add_accounting_to_loan_products_table',1),(99,'2017_11_11_094902_create_loan_overdue_penalties_table',1),(100,'2017_11_11_095510_add_accounting_to_savings_products',1),(101,'2017_11_11_100235_add_accounting_to_expenses_table',1),(102,'2017_11_11_100255_add_accounting_to_income_table',1),(103,'2017_11_11_100318_add_accounting_to_payroll_table',1),(104,'2017_11_11_131440_add_v_1_5_permissions',1),(105,'2017_11_11_174146_add_accounting_to_settings_table',1),(106,'2017_11_11_225159_create_journal_entries_table',1),(107,'2017_11_14_082223_add_account_to_expense_and_income_categories',1),(108,'2017_11_18_172024_add_current_theme_to_settings_table',1),(109,'2017_12_02_095438_add_receipt_tp_payments_table',1),(110,'2017_12_03_094335_add_loan_officer_to_loans_table',1),(111,'2017_12_03_185018_add_debit_and_credit_to_capital_table',1),(112,'2017_12_10_161628_add_index_to_all_tables',1),(113,'2017_12_12_144725_create_loan_transactions_table',1),(114,'2017_12_16_202252_create_charges_table',1),(115,'2017_12_16_214117_create_loan_charges_table',1),(116,'2017_12_16_214117_create_savings_charges_table',1),(117,'2017_12_16_214236_create_loan_products_charges_table',1),(118,'2017_12_27_101540_update_journal_entries_table',1),(119,'2018_01_10_104604_add_waive_to_loan_schedules_table',1),(120,'2018_01_14_215823_create_savings_products_charge_table',1),(121,'2018_01_15_000219_add_status_to_savings_table',1),(122,'2018_01_15_083204_add_debit_credit_to_savings_transactions_table',1),(123,'2018_01_26_193838_add_transfer_type_to_saving_transactions',1),(124,'2018_02_01_145506_add_mpesa_to_settings_table',1),(125,'2018_02_01_194418_add_2_0_settings',1),(126,'2018_02_01_201034_increase_decimal_length',1),(127,'2018_02_02_002812_update_system_to_version_2_0',1),(128,'2018_12_23_175846_add_other_income_id_to_journal_entry_table',1),(129,'2018_12_25_101910_add_penalty_column_to_loan_product_charges_table',1),(130,'2019_09_19_150323_add_id_card_number_to_borrowers_table',1),(131,'2019_09_19_155120_add_place_of_birth_to_borrowers_table',1),(132,'2019_09_19_162851_add_color_to_collateral_table',1),(133,'2019_09_19_172814_add_id_card_number_to_guarantor_table',1),(134,'2019_09_20_155640_add_pay_off_interest_rate_table',1),(135,'2019_10_02_153818_add_pay_off_to_loan_schedules_table',1),(136,'2019_10_16_195119_add_owner_date_to_collateral_table',1),(137,'2019_10_23_151522_create_collateral_vehicles_table',1),(138,'2019_11_18_151019_add_max_approval_to_users_table',1),(139,'2019_12_14_000001_create_personal_access_tokens_table',1);

--
-- Table structure for table `other_income`
--

CREATE TABLE `other_income` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned DEFAULT NULL,
  `other_income_type_id` int unsigned DEFAULT NULL,
  `amount` decimal(65,4) DEFAULT NULL,
  `date` date DEFAULT NULL,
  `year` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `month` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `files` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `branch_id` int DEFAULT NULL,
  `chart_id` int DEFAULT NULL,
  `account_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `other_income_id_index` (`id`),
  KEY `other_income_year_index` (`year`),
  KEY `other_income_month_index` (`month`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `other_income`
--


--
-- Table structure for table `other_income_types`
--

CREATE TABLE `other_income_types` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `account_id` int DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `other_income_types`
--

INSERT INTO `other_income_types` VALUES (1,'Penalty',9);

--
-- Table structure for table `password_resets`
--

CREATE TABLE `password_resets` (
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  KEY `password_resets_email_index` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `password_resets`
--


--
-- Table structure for table `payroll`
--

CREATE TABLE `payroll` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `payroll_template_id` int unsigned DEFAULT NULL,
  `user_id` int unsigned DEFAULT NULL,
  `employee_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `business_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_method` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bank_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `account_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `comments` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `paid_amount` decimal(65,4) DEFAULT NULL,
  `date` date DEFAULT NULL,
  `year` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `month` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `recurring` tinyint NOT NULL DEFAULT '0',
  `recur_frequency` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '31',
  `recur_start_date` date DEFAULT NULL,
  `recur_end_date` date DEFAULT NULL,
  `recur_next_date` date DEFAULT NULL,
  `recur_type` enum('day','week','month','year') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'month',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `branch_id` int DEFAULT NULL,
  `chart_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `payroll_id_index` (`id`),
  KEY `payroll_user_id_index` (`user_id`),
  KEY `payroll_year_index` (`year`),
  KEY `payroll_month_index` (`month`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payroll`
--


--
-- Table structure for table `payroll_meta`
--

CREATE TABLE `payroll_meta` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `payroll_id` int unsigned NOT NULL,
  `payroll_template_meta_id` int unsigned DEFAULT NULL,
  `value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `position` enum('top_left','top_right','bottom_left','bottom_right') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'bottom_left',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payroll_meta`
--


--
-- Table structure for table `payroll_template_meta`
--

CREATE TABLE `payroll_template_meta` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `payroll_template_id` int unsigned NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `position` enum('top_left','top_right','bottom_left','bottom_right') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'bottom_left',
  `is_default` tinyint NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payroll_template_meta`
--


--
-- Table structure for table `payroll_templates`
--

CREATE TABLE `payroll_templates` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `picture` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payroll_templates`
--

INSERT INTO `payroll_templates` VALUES (1,'Default','Default Payroll Template','default_payroll_template');

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

CREATE TABLE `permissions` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `parent_id` int NOT NULL DEFAULT '0',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=102 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `permissions` VALUES (1,0,'Borrowers','borrowers','Access Borrowers Module'),(2,1,'View borrowers','borrowers.view','View borrowers'),(3,1,'Update borrowers','borrowers.update','Update Borrowers'),(4,1,'Delete borrowers','borrowers.delete','Delete borrowers'),(5,1,'Create borrowers','borrowers.create','Add new borrower'),(6,0,'Loans','loans','Access Loans Module'),(7,6,'Create Loans','loans.create','Create Loans'),(9,6,'Update Loans','loans.update','Update Loans'),(10,6,'Delete Loans','loans.delete','Delete Loans'),(11,6,'View Loans','loans.view','View Loans'),(12,6,'Loan Products','loans.products','Manage Loan Products'),(13,6,'Loan Fees','loans.fees','Manage Loan Fees'),(14,6,'Loan Schedule','loans.schedule','Manage loan schedule, including sending loan schedule emails'),(15,0,'Repayments','repayments','View Repayments Module'),(16,15,'View Repayments','repayments.view','View All repayments'),(17,15,'Create Repayments','repayments.create','Add Repayments'),(18,15,'Delete Repayments','repayments.delete','Delete Repayments'),(19,15,'Update Repayments','repayments.update','Update Repayments'),(20,0,'Payroll','payroll','Access Payroll Module'),(21,20,'View Payroll','payroll.view','View Payroll'),(22,20,'Update Payroll','payroll.update','Update Payroll'),(23,20,'Delete Payroll','payroll.delete','Delete Payroll'),(24,20,'Create Payroll','payroll.create','Create Payroll'),(25,0,'Expenses','expenses','Access Expenses Module'),(26,25,'View Expenses','expenses.view','View Expenses'),(27,25,'Create Expenses','expenses.create','Create Expenses'),(28,25,'Update Expenses','expenses.update','Update Expenses'),(29,25,'Delete Expenses','expenses.delete','Delete Expenses'),(30,0,'Other Income','other_income','Access Other Income Module'),(31,30,'View Other Income','other_income.view','View Other income'),(32,30,'Create Other Income','other_income.create','Create other income'),(33,30,'Update Other Income','other_income.update','Update Other Incom'),(34,30,'Delete Other Income','other_income.delete','Delete other income'),(35,0,'Collateral','collateral','Access Collateral Module'),(36,35,'View collateral','collateral.view','View Collateral'),(37,35,'Update Collateral','collateral.update','Update Collateral'),(38,35,'Create Collateral','collateral.create','Create Collateral'),(39,35,'Delete Collateral','collateral.delete','Delete Collateral'),(40,0,'Reports','reports','Access Reports Module'),(41,0,'Communication','communication','Access Communication Module'),(42,41,'Create Communication','communication.create','Send Emails & SMS'),(43,41,'Delete Communication','communication.delete','Delete Communication'),(44,0,'Custom Fields','custom_fields','Access Custom Fields Module'),(45,44,'View Custom Fields','custom_fields.view','View Custom fields'),(46,44,'Create Custom Fields','custom_fields.create','Create Custom Fields'),(47,44,'Custom Fields','custom_fields.update','Update Custom Fields'),(48,44,'Delete Custom Fields','custom_fields.delete','Delete Custom Fields'),(49,0,'Users','users','Access Users Module'),(50,49,'View Users','users.view','View Users '),(51,49,'Create Users','users.create','Create users'),(52,49,'Update Users','users.update','Update Users'),(53,49,'Delete Users','users.delete','Delete Users'),(54,49,'Manage Roles','users.roles','Manage user roles'),(55,0,'Settings','settings','Manage Settings'),(56,0,'Audit Trail','audit_trail','Access Audit Trail'),(57,0,'Savings','savings','Access Savings Menu'),(58,57,'Create Savings','savings.create',''),(59,57,'Update Savings','savings.update',''),(60,57,'Delete Savings','savings.delete',''),(61,57,'Create Savings Transaction','savings.transactions.create',''),(62,57,'Update Savings Transaction','savings.transactions.update',''),(63,57,'Delete Savings Transaction','savings.transactions.delete',''),(64,57,'View Savings','savings.view',''),(65,57,'View Savings Transaction','savings.transactions.view',''),(66,57,'Manage Savings Products','savings.products','Manage Savings Products'),(67,57,'Manage Savings Fees','savings.fees',''),(68,6,'Approve Loans','loans.approve','Approve Loans'),(69,6,'Disburse Loans','loans.disburse','Disburse Loans'),(70,1,'Approve Borrowers','borrowers.approve','Approve Borrowers'),(71,6,'Withdraw Loans','loans.withdraw','Withdraw Loans'),(72,6,'Write Off Loans','loans.writeoff','Write off Loans'),(73,6,'Reschedule Loans','loans.reschedule','Reschedule Loans'),(74,0,'Dashboard','dashboard','Access Dashboard'),(75,74,'Loans Released Monthly Graph','dashboard.loans_released_monthly_graph','Access Loans Released Monthly Graph'),(76,74,'Loans Collected Monthly Graph','dashboard.loans_collected_monthly_graph','Access Loans Collected Monthly Graph'),(77,74,'Registered Borrowers','dashboard.registered_borrowers','Access Registered Borrowers Statistics'),(78,74,'Total Loans Released','dashboard.total_loans_released','Access Total Loans Released'),(79,74,'Total Collections','dashboard.total_collections','Access Total Collections Statistics'),(80,74,'Total Disbursed Loans','dashboard.loans_disbursed','Access Total Disbursed Loans Statistics'),(81,74,'Total Loans Pending','dashboard.loans_pending',''),(82,74,'Loans Approved','dashboard.loans_approved',''),(83,74,'Loans Declined','dashboard.loans_declined',''),(84,74,'Loans Closed','dashboard.loans_closed',''),(85,74,'Loans Withdrawn','dashboard.loans_withdrawn',''),(86,74,'Loans Written Off','dashboard.loans_written_off',''),(87,74,'Loans Rescheduled','dashboard.loans_rescheduled',''),(88,6,'Create Guarantor','loans.guarantor.create',''),(89,6,'Update Guarantor','loans.guarantor.update',''),(90,6,'Delete Guarantor','loans.guarantor.delete',''),(91,6,'Guarantor Savings','loans.guarantor.savings',''),(92,0,'Capital','capital','Access Capital'),(93,92,'View  Capital','capital.view',''),(94,92,'Create Capital','capital.create',''),(95,92,'Update Capital','capital.update',''),(96,92,'Delete Capital','capital.delete',''),(97,0,'Assets','assets','Access Assets Menu'),(98,97,'Create Assets','assets.create',''),(99,97,'View Assets','assets.view',''),(100,97,'Update Assets','assets.update',''),(101,97,'Delete Assets','assets.delete','');

--
-- Table structure for table `persistences`
--

CREATE TABLE `persistences` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned NOT NULL,
  `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `persistences_code_unique` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=79 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `persistences`
--

INSERT INTO `persistences` VALUES (3,2,'whMIdtfXPMnw6AkeIgMJ7f0guZo4mo6r','2022-09-27 13:17:11','2022-09-27 13:17:11'),(52,5,'pi7sLbSoqW9yusJbalM9Pe6DNHsIQZfA','2022-12-28 10:34:57','2022-12-28 10:34:57'),(55,5,'ORkKo8k7PjxZYxZAo7FxLlAsEXcjmMNa','2023-01-06 17:31:19','2023-01-06 17:31:19'),(56,5,'MAyONLCB1m0CYWVc9ZnFLkmLA1wENr72','2023-01-06 17:31:25','2023-01-06 17:31:25'),(74,1,'t8XOkj6ckaTVb0lWnt2JUkSxUsrNY4Jl','2023-02-13 10:54:55','2023-02-13 10:54:55'),(75,1,'VzSmYXqIz58YIFiJlyXbFf7A6okmnRwS','2023-02-14 08:58:34','2023-02-14 08:58:34'),(76,1,'APifFtWuSDmP5GerM3gBErjVm18IK3OY','2023-02-15 10:27:58','2023-02-15 10:27:58'),(77,1,'dOw3ztkJXR7U6Nt8rKRkcFSNmr6e00Ha','2023-02-17 07:55:08','2023-02-17 07:55:08'),(78,1,'dXKQg3V3Q89kggbTEoiLW8CNnOhQGC2l','2023-02-21 08:58:56','2023-02-21 08:58:56');

--
-- Table structure for table `personal_access_tokens`
--

CREATE TABLE `personal_access_tokens` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `tokenable_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `tokenable_id` bigint unsigned NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `token` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `abilities` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `last_used_at` timestamp NULL DEFAULT NULL,
  `expires_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `personal_access_tokens_token_unique` (`token`),
  KEY `personal_access_tokens_tokenable_type_tokenable_id_index` (`tokenable_type`,`tokenable_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `personal_access_tokens`
--


--
-- Table structure for table `product_categories`
--

CREATE TABLE `product_categories` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned DEFAULT NULL,
  `parent_id` int unsigned NOT NULL DEFAULT '0',
  `name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `slug` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `active` tinyint NOT NULL DEFAULT '1',
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `product_categories`
--


--
-- Table structure for table `product_categories_meta`
--

CREATE TABLE `product_categories_meta` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `product_id` int DEFAULT NULL,
  `product_category_id` int DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `product_categories_meta`
--


--
-- Table structure for table `product_check_in_items`
--

CREATE TABLE `product_check_in_items` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `product_check_in_id` int unsigned DEFAULT NULL,
  `product_id` int unsigned DEFAULT NULL,
  `tax_rate` decimal(65,2) NOT NULL DEFAULT '0.00',
  `qty` decimal(65,2) NOT NULL DEFAULT '0.00',
  `unit_cost` decimal(65,2) NOT NULL DEFAULT '0.00',
  `tax_total` decimal(65,2) NOT NULL DEFAULT '0.00',
  `total_cost` decimal(65,2) NOT NULL DEFAULT '0.00',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `product_check_in_items_id_index` (`id`),
  KEY `product_check_in_items_product_check_in_id_index` (`product_check_in_id`),
  KEY `product_check_in_items_product_id_index` (`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `product_check_in_items`
--


--
-- Table structure for table `product_check_ins`
--

CREATE TABLE `product_check_ins` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned DEFAULT NULL,
  `supplier_id` int DEFAULT NULL,
  `branch_id` int DEFAULT NULL,
  `warehouse_id` int DEFAULT NULL,
  `amount` decimal(65,2) NOT NULL DEFAULT '0.00',
  `unit_cost` decimal(65,2) NOT NULL DEFAULT '0.00',
  `qty` decimal(65,2) NOT NULL DEFAULT '0.00',
  `total_cost` decimal(65,2) NOT NULL DEFAULT '0.00',
  `tax_rate` decimal(10,2) NOT NULL DEFAULT '0.00',
  `tax_total` decimal(10,2) NOT NULL DEFAULT '0.00',
  `date` date DEFAULT NULL,
  `month` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `year` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `product_check_ins_id_index` (`id`),
  KEY `product_check_ins_supplier_id_index` (`supplier_id`),
  KEY `product_check_ins_warehouse_id_index` (`warehouse_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `product_check_ins`
--


--
-- Table structure for table `product_check_out_items`
--

CREATE TABLE `product_check_out_items` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `product_id` int unsigned DEFAULT NULL,
  `product_check_out_id` int unsigned DEFAULT NULL,
  `tax_rate` decimal(65,2) NOT NULL DEFAULT '0.00',
  `qty` decimal(65,2) NOT NULL DEFAULT '0.00',
  `unit_cost` decimal(65,2) NOT NULL DEFAULT '0.00',
  `tax_total` decimal(65,2) NOT NULL DEFAULT '0.00',
  `total_cost` decimal(65,2) NOT NULL DEFAULT '0.00',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `product_check_out_items_id_index` (`id`),
  KEY `product_check_out_items_product_check_out_id_index` (`product_check_out_id`),
  KEY `product_check_out_items_product_id_index` (`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `product_check_out_items`
--


--
-- Table structure for table `product_check_outs`
--

CREATE TABLE `product_check_outs` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `type` enum('cash','loan') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'cash',
  `loan_id` int unsigned DEFAULT NULL,
  `branch_id` int DEFAULT NULL,
  `user_id` int unsigned DEFAULT NULL,
  `borrower_id` int DEFAULT NULL,
  `warehouse_id` int DEFAULT NULL,
  `unit_cost` decimal(65,2) NOT NULL DEFAULT '0.00',
  `amount` decimal(65,2) NOT NULL DEFAULT '0.00',
  `qty` decimal(65,2) NOT NULL DEFAULT '0.00',
  `total_cost` decimal(65,2) NOT NULL DEFAULT '0.00',
  `tax_rate` decimal(10,2) NOT NULL DEFAULT '0.00',
  `tax_total` decimal(10,2) NOT NULL DEFAULT '0.00',
  `date` date DEFAULT NULL,
  `month` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `year` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `product_check_outs_id_index` (`id`),
  KEY `product_check_outs_loan_id_index` (`loan_id`),
  KEY `product_check_outs_borrower_id_index` (`borrower_id`),
  KEY `product_check_outs_year_index` (`year`),
  KEY `product_check_outs_month_index` (`month`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `product_check_outs`
--


--
-- Table structure for table `product_payments`
--

CREATE TABLE `product_payments` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned DEFAULT NULL,
  `bank_id` int unsigned DEFAULT NULL,
  `product_check_in_id` int unsigned DEFAULT NULL,
  `product_check_out_id` int unsigned DEFAULT NULL,
  `type` enum('debit','credit') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'credit',
  `payment_method_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `receipt` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `payment_slip` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `amount` decimal(65,2) NOT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `date` date NOT NULL,
  `month` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `year` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `product_payments_id_index` (`id`),
  KEY `product_payments_year_index` (`year`),
  KEY `product_payments_month_index` (`month`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `product_payments`
--


--
-- Table structure for table `product_warehouses`
--

CREATE TABLE `product_warehouses` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `product_warehouses`
--


--
-- Table structure for table `products`
--

CREATE TABLE `products` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned DEFAULT NULL,
  `name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `brand_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `category_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `code` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `cost_price` decimal(65,2) DEFAULT NULL,
  `selling_price` decimal(65,2) DEFAULT NULL,
  `qty` int unsigned NOT NULL DEFAULT '0',
  `alert_qty` int unsigned NOT NULL DEFAULT '0',
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `picture` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `slug` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `active` tinyint NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `products_id_index` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `products`
--


--
-- Table structure for table `provision_rates`
--

CREATE TABLE `provision_rates` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `days` int DEFAULT NULL,
  `rate` double(10,2) NOT NULL DEFAULT '0.00',
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `provision_rates`
--

INSERT INTO `provision_rates` VALUES (1,'Current',0,0.00,NULL),(2,'Especially Mentioned',31,5.00,NULL),(3,'Substandard',61,10.00,NULL),(4,'Doubtful',91,50.00,NULL),(5,'Loss',181,100.00,NULL);

--
-- Table structure for table `purchase_order_items`
--

CREATE TABLE `purchase_order_items` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `purchase_order_id` int unsigned DEFAULT NULL,
  `product_id` int unsigned DEFAULT NULL,
  `tax_rate` decimal(65,2) NOT NULL DEFAULT '0.00',
  `qty` decimal(65,2) NOT NULL DEFAULT '0.00',
  `qty_received` decimal(65,2) NOT NULL DEFAULT '0.00',
  `unit_cost` decimal(65,2) NOT NULL DEFAULT '0.00',
  `tax_total` decimal(65,2) NOT NULL DEFAULT '0.00',
  `total_cost` decimal(65,2) NOT NULL DEFAULT '0.00',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchase_order_items`
--


--
-- Table structure for table `purchase_orders`
--

CREATE TABLE `purchase_orders` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned DEFAULT NULL,
  `supplier_id` int DEFAULT NULL,
  `warehouse_id` int DEFAULT NULL,
  `amount` decimal(65,2) NOT NULL DEFAULT '0.00',
  `unit_cost` decimal(65,2) NOT NULL DEFAULT '0.00',
  `qty` decimal(65,2) NOT NULL DEFAULT '0.00',
  `total_cost` decimal(65,2) NOT NULL DEFAULT '0.00',
  `tax_rate` decimal(10,2) NOT NULL DEFAULT '0.00',
  `tax_total` decimal(10,2) NOT NULL DEFAULT '0.00',
  `delivery_date` date DEFAULT NULL,
  `date` date DEFAULT NULL,
  `month` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `year` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchase_orders`
--


--
-- Table structure for table `reminders`
--

CREATE TABLE `reminders` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned NOT NULL,
  `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `completed` tinyint(1) NOT NULL DEFAULT '0',
  `completed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `reminders`
--


--
-- Table structure for table `role_users`
--

CREATE TABLE `role_users` (
  `user_id` int unsigned NOT NULL,
  `role_id` int unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`user_id`,`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `role_users`
--

INSERT INTO `role_users` VALUES (1,1,'2022-09-27 08:15:14','2022-09-27 08:15:14'),(2,2,'2022-09-27 11:45:27','2022-09-27 11:45:27'),(4,2,'2022-09-27 13:25:11','2022-09-27 13:25:11'),(5,3,'2022-12-28 10:44:21','2022-12-28 10:44:21'),(6,4,'2023-01-09 08:10:49','2023-01-09 08:10:49');

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

CREATE TABLE `roles` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `slug` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `permissions` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `roles_slug_unique` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `roles` VALUES (1,'admin','Admin','{\"borrowers\":true,\"borrowers.view\":true,\"borrowers.update\":true,\"borrowers.delete\":true,\"borrowers.create\":true,\"borrowers.approve\":true,\"loans\":true,\"loans.create\":true,\"loans.update\":true,\"loans.delete\":true,\"loans.view\":true,\"loans.products\":true,\"loans.fees\":true,\"loans.schedule\":true,\"loans.approve\":true,\"loans.disburse\":true,\"loans.withdraw\":true,\"loans.writeoff\":true,\"loans.reschedule\":true,\"loans.guarantor.create\":true,\"loans.guarantor.update\":true,\"loans.guarantor.delete\":true,\"loans.guarantor.savings\":true,\"repayments\":true,\"repayments.view\":true,\"repayments.create\":true,\"repayments.delete\":true,\"repayments.update\":true,\"payroll\":true,\"payroll.view\":true,\"payroll.update\":true,\"payroll.delete\":true,\"payroll.create\":true,\"expenses\":true,\"expenses.view\":true,\"expenses.create\":true,\"expenses.update\":true,\"expenses.delete\":true,\"other_income\":true,\"other_income.view\":true,\"other_income.create\":true,\"other_income.update\":true,\"other_income.delete\":true,\"collateral\":true,\"collateral.view\":true,\"collateral.update\":true,\"collateral.create\":true,\"collateral.delete\":true,\"reports\":true,\"communication\":true,\"communication.create\":true,\"communication.delete\":true,\"custom_fields\":true,\"custom_fields.view\":true,\"custom_fields.create\":true,\"custom_fields.update\":true,\"custom_fields.delete\":true,\"users\":true,\"users.view\":true,\"users.create\":true,\"users.update\":true,\"users.delete\":true,\"users.roles\":true,\"settings\":true,\"audit_trail\":true,\"savings\":true,\"savings.create\":true,\"savings.update\":true,\"savings.delete\":true,\"savings.transactions.create\":true,\"savings.transactions.update\":true,\"savings.transactions.delete\":true,\"savings.view\":true,\"savings.transactions.view\":true,\"savings.products\":true,\"savings.fees\":true,\"dashboard\":true,\"dashboard.loans_released_monthly_graph\":true,\"dashboard.loans_collected_monthly_graph\":true,\"dashboard.registered_borrowers\":true,\"dashboard.total_loans_released\":true,\"dashboard.total_collections\":true,\"dashboard.loans_disbursed\":true,\"dashboard.loans_pending\":true,\"dashboard.loans_approved\":true,\"dashboard.loans_declined\":true,\"dashboard.loans_closed\":true,\"dashboard.loans_withdrawn\":true,\"dashboard.loans_written_off\":true,\"dashboard.loans_rescheduled\":true,\"capital\":true,\"capital.view\":true,\"capital.create\":true,\"capital.update\":true,\"capital.delete\":true,\"assets\":true,\"assets.create\":true,\"assets.view\":true,\"assets.update\":true,\"assets.delete\":true}',NULL,'2020-01-02 19:38:26'),(2,'co','CO','{\"borrowers\":true,\"borrowers.view\":true,\"borrowers.update\":true,\"borrowers.delete\":true,\"borrowers.create\":true,\"loans\":true,\"loans.create\":true,\"loans.update\":true,\"loans.view\":true,\"loans.schedule\":true,\"repayments\":true,\"repayments.view\":true,\"collateral\":true,\"collateral.view\":true,\"collateral.update\":true,\"collateral.create\":true,\"collateral.delete\":true}','2019-11-06 16:15:08','2022-12-28 10:27:03'),(3,'sub_admin','Sub Admin','{\"borrowers\":true,\"borrowers.view\":true,\"borrowers.update\":true,\"borrowers.delete\":true,\"borrowers.create\":true,\"borrowers.approve\":true,\"loans\":true,\"loans.create\":true,\"loans.update\":true,\"loans.delete\":true,\"loans.view\":true,\"loans.schedule\":true,\"loans.disburse\":true,\"loans.withdraw\":true,\"loans.writeoff\":true,\"loans.reschedule\":true,\"loans.guarantor.create\":true,\"loans.guarantor.update\":true,\"loans.guarantor.delete\":true,\"loans.guarantor.savings\":true,\"repayments\":true,\"repayments.view\":true,\"repayments.create\":true,\"repayments.delete\":true,\"repayments.update\":true,\"payroll\":true,\"payroll.view\":true,\"payroll.update\":true,\"payroll.delete\":true,\"payroll.create\":true,\"expenses\":true,\"expenses.view\":true,\"expenses.create\":true,\"expenses.update\":true,\"expenses.delete\":true,\"other_income\":true,\"other_income.view\":true,\"other_income.create\":true,\"other_income.update\":true,\"other_income.delete\":true,\"collateral\":true,\"collateral.view\":true,\"collateral.update\":true,\"collateral.create\":true,\"collateral.delete\":true,\"reports\":true,\"communication\":true,\"communication.create\":true,\"communication.delete\":true,\"custom_fields\":true,\"custom_fields.view\":true,\"custom_fields.create\":true,\"custom_fields.update\":true,\"custom_fields.delete\":true,\"users\":true,\"users.view\":true,\"users.create\":true,\"users.update\":true,\"users.delete\":true,\"settings\":true,\"audit_trail\":true,\"savings\":true,\"savings.create\":true,\"savings.update\":true,\"savings.delete\":true,\"savings.transactions.create\":true,\"savings.transactions.update\":true,\"savings.transactions.delete\":true,\"savings.view\":true,\"savings.transactions.view\":true,\"savings.products\":true,\"savings.fees\":true,\"dashboard\":true,\"dashboard.loans_released_monthly_graph\":true,\"dashboard.loans_collected_monthly_graph\":true,\"dashboard.registered_borrowers\":true,\"dashboard.total_loans_released\":true,\"dashboard.total_collections\":true,\"dashboard.loans_disbursed\":true,\"dashboard.loans_pending\":true,\"dashboard.loans_approved\":true,\"dashboard.loans_declined\":true,\"dashboard.loans_closed\":true,\"dashboard.loans_withdrawn\":true,\"dashboard.loans_written_off\":true,\"dashboard.loans_rescheduled\":true,\"capital\":true,\"capital.view\":true,\"capital.create\":true,\"capital.update\":true,\"capital.delete\":true,\"assets\":true,\"assets.create\":true,\"assets.view\":true,\"assets.update\":true,\"assets.delete\":true}','2019-11-13 14:39:34','2022-12-28 10:32:02'),(4,'manager_co','Manager CO','{\"borrowers\":true,\"borrowers.view\":true,\"borrowers.update\":true,\"borrowers.delete\":true,\"borrowers.create\":true,\"borrowers.approve\":true,\"loans\":true,\"loans.create\":true,\"loans.update\":true,\"loans.delete\":true,\"loans.view\":true,\"loans.writeoff\":true,\"loans.guarantor.update\":true,\"loans.guarantor.delete\":true,\"loans.guarantor.savings\":true,\"other_income\":true,\"other_income.view\":true,\"collateral\":true,\"collateral.view\":true,\"reports\":true,\"communication\":true,\"communication.create\":true,\"users\":true,\"dashboard\":true,\"dashboard.loans_released_monthly_graph\":true,\"dashboard.loans_collected_monthly_graph\":true,\"dashboard.registered_borrowers\":true,\"dashboard.total_loans_released\":true,\"dashboard.total_collections\":true,\"dashboard.loans_disbursed\":true,\"dashboard.loans_pending\":true,\"dashboard.loans_approved\":true,\"dashboard.loans_declined\":true,\"dashboard.loans_closed\":true,\"dashboard.loans_withdrawn\":true,\"dashboard.loans_written_off\":true,\"dashboard.loans_rescheduled\":true}','2023-01-09 08:10:01','2023-01-09 08:13:26');

--
-- Table structure for table `savings`
--

CREATE TABLE `savings` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned DEFAULT NULL,
  `borrower_id` int unsigned DEFAULT NULL,
  `savings_product_id` int unsigned DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `date` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `branch_id` int DEFAULT NULL,
  `status` enum('active','closed','pending','declined','withdrawn') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `loan_officer_id` int DEFAULT NULL,
  `year` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `month` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `overdraft_limit` decimal(65,4) DEFAULT NULL,
  `approved_date` date DEFAULT NULL,
  `declined_date` date DEFAULT NULL,
  `closed_date` date DEFAULT NULL,
  `approved_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `declined_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `closed_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `savings_id_index` (`id`),
  KEY `savings_borrower_id_index` (`borrower_id`),
  KEY `savings_savings_product_id_index` (`savings_product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `savings`
--


--
-- Table structure for table `savings_charges`
--

CREATE TABLE `savings_charges` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `charge_id` int DEFAULT NULL,
  `savings_id` int DEFAULT NULL,
  `amount` decimal(65,2) DEFAULT NULL,
  `date` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `savings_charges`
--


--
-- Table structure for table `savings_fees`
--

CREATE TABLE `savings_fees` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `savings_products` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `amount` decimal(10,2) DEFAULT '0.00',
  `fees_posting` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fees_adding` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `new_fee_type` enum('full','pro_rata') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'full',
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `savings_fees`
--


--
-- Table structure for table `savings_product_charges`
--

CREATE TABLE `savings_product_charges` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `charge_id` int DEFAULT NULL,
  `savings_product_id` int DEFAULT NULL,
  `amount` decimal(65,2) DEFAULT NULL,
  `date` date DEFAULT NULL,
  `grace_period` int NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `savings_product_charges`
--


--
-- Table structure for table `savings_products`
--

CREATE TABLE `savings_products` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `allow_overdraw` tinyint NOT NULL DEFAULT '0',
  `interest_rate` decimal(10,2) DEFAULT NULL,
  `minimum_balance` int DEFAULT '0',
  `interest_posting` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `interest_adding` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `accounting_rule` enum('none','cash_based') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'none',
  `chart_reference_id` int DEFAULT NULL,
  `chart_overdraft_portfolio_id` int DEFAULT NULL,
  `chart_savings_control_id` int DEFAULT NULL,
  `chart_income_interest_id` int DEFAULT NULL,
  `chart_income_fee_id` int DEFAULT NULL,
  `chart_income_penalty_id` int DEFAULT NULL,
  `chart_payable_interest_id` int DEFAULT NULL,
  `chart_receivable_fee_id` int DEFAULT NULL,
  `chart_receivable_penalty_id` int DEFAULT NULL,
  `chart_expense_interest_id` int DEFAULT NULL,
  `chart_expense_written_off_id` int DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `savings_products`
--


--
-- Table structure for table `savings_transactions`
--

CREATE TABLE `savings_transactions` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned DEFAULT NULL,
  `borrower_id` int unsigned DEFAULT NULL,
  `savings_id` int unsigned DEFAULT NULL,
  `amount` decimal(10,2) DEFAULT '0.00',
  `type` enum('deposit','withdrawal','bank_fees','interest','dividend','guarantee','guarantee_restored','fees_payment','transfer_loan','transfer_savings') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `system_interest` tinyint NOT NULL DEFAULT '0',
  `date` date DEFAULT NULL,
  `time` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `year` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `month` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `branch_id` int DEFAULT NULL,
  `receipt` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_method_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `debit` decimal(65,4) DEFAULT NULL,
  `credit` decimal(65,4) DEFAULT NULL,
  `balance` decimal(65,4) DEFAULT NULL,
  `reversible` tinyint NOT NULL DEFAULT '0',
  `reversed` tinyint NOT NULL DEFAULT '0',
  `reversal_type` enum('system','user','none') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'none',
  `reference` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `savings_transactions_id_index` (`id`),
  KEY `savings_transactions_borrower_id_index` (`borrower_id`),
  KEY `savings_transactions_savings_id_index` (`savings_id`),
  KEY `savings_transactions_date_index` (`date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `savings_transactions`
--


--
-- Table structure for table `settings`
--

CREATE TABLE `settings` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `setting_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `setting_value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`),
  UNIQUE KEY `settings_setting_key_unique` (`setting_key`)
) ENGINE=InnoDB AUTO_INCREMENT=102 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `settings`
--

INSERT INTO `settings` VALUES (1,'allow_self_registration','0'),(2,'allow_client_login','0'),(3,'welcome_note','Welcome to our company. You can login with your username and password'),(4,'allow_client_apply','0'),(5,'enable_online_payment','0'),(6,'paynow_key',NULL),(7,'paynow_id',NULL),(8,'paypal_enabled','0'),(9,'paynow_enabled','0'),(10,'client_registration_required_fields',''),(11,'client_auto_activate_account','0'),(12,'client_request_guarantor','0'),(13,'auto_post_savings_interest','0'),(14,'update_url','http://webstudio.co.zw/ulm/update'),(15,'client_login_background',''),(16,'stripe_secret_key',NULL),(17,'stripe_publishable_key',NULL),(18,'stripe_enabled','0'),(19,'allow_bank_overdraw','0'),(20,'expenses_chart_id',''),(21,'income_chart_id',''),(22,'payroll_chart_id',NULL),(23,'active_theme','limitless'),(24,'mpesa_consumer_key',NULL),(25,'mpesa_consumer_secret',NULL),(26,'mpesa_shortcode',NULL),(27,'mpesa_endpoint','https://sandbox.safaricom.co.ke'),(28,'mpesa_initiator',NULL),(29,'mpesa_enabled','0'),(30,'default_online_payment_method',''),(31,'timezone','Africa/Blantyre'),(32,'auto_download_update','0'),(33,'update_notification',''),(34,'update_last_checked',''),(35,'header_javascript',''),(36,'footer_javascript',''),(37,'company_name','Loan'),(38,'company_phone','Fast Money Exchange'),(39,'company_address','Suite 608'),(40,'company_currency','ZAR'),(41,'company_website','http://www.webstudio.co.zw'),(42,'company_country','1'),(43,'system_version','1.0'),(44,'sms_enabled','1'),(45,'active_sms',NULL),(46,'portal_address','http://www.'),(47,'company_email','admin@gmail.com'),(48,'currency_symbol','$'),(49,'currency_position','left'),(50,'company_logo','logo.jpg'),(51,'twilio_sid',''),(52,'twilio_token',''),(53,'twilio_phone_number',''),(54,'routesms_host',''),(55,'routesms_username',''),(56,'routesms_password',''),(57,'routesms_port',''),(58,'sms_sender',''),(59,'clickatell_username',''),(60,'clickatell_password',''),(61,'clickatell_api_id',''),(62,'paypal_email',NULL),(63,'currency','USD'),(64,'password_reset_subject','Password reset instructions'),(65,'password_reset_template','Password reset instructions'),(66,'payment_received_sms_template','Dear {borrowerFirstName}, we have received your payment of ${paymentAmount} for loan {loanNumber}. New loan balance:${loanBalance}. Thank you'),(67,'payment_received_email_template','<p>Dear {borrowerFirstName}, we have received your payment of ${paymentAmount} for loan {loanNumber}. New loan balance:${loanBalance}. Thank you</p>'),(68,'payment_received_email_subject','Payment Received'),(69,'payment_email_subject','Payment Receipt'),(70,'payment_email_template','<p>Dear {borrowerFirstName}, find attached receipt of your payment of ${paymentAmount} for loan {loanNumber} on {paymentDate}. New loan balance:${loanBalance}. Thank you</p>'),(71,'borrower_statement_email_subject','Client Statement'),(72,'borrower_statement_email_template','<p>Dear {borrowerFirstName}, find attached statement of your loans with us. Thank you</p>'),(73,'loan_statement_email_subject','Loan Statement'),(74,'loan_statement_email_template','<p>Dear {borrowerFirstName}, find attached loan statement for loan {loanNumber}. Thank you</p>'),(75,'loan_schedule_email_subject','Loan Schedule'),(76,'loan_schedule_email_template','<p>Dear {borrowerFirstName}, find attached loan schedule for loan {loanNumber}. Thank you</p>'),(77,'cron_last_run','2022-11-14 14:11:18'),(78,'auto_apply_penalty','0'),(79,'auto_payment_receipt_sms','0'),(80,'auto_payment_receipt_email','1'),(81,'auto_repayment_sms_reminder','0'),(82,'auto_repayment_email_reminder','1'),(83,'auto_repayment_days','4'),(84,'auto_overdue_repayment_sms_reminder','0'),(85,'auto_overdue_repayment_email_reminder','1'),(86,'auto_overdue_repayment_days','2'),(87,'auto_overdue_loan_sms_reminder','0'),(88,'auto_overdue_loan_email_reminder','1'),(89,'auto_overdue_loan_days','2'),(90,'loan_overdue_email_subject','Loan Overdue'),(91,'loan_overdue_email_template','<p>Dear {borrowerFirstName}, Your loan {loanNumber} is overdue. Please make your payment. Thank you</p>'),(92,'loan_overdue_sms_template','Dear {borrowerFirstName}, Your loan {loanNumber} is overdue. Please make your payment. Thank you'),(93,'loan_payment_reminder_subject','Upcoming Payment Reminder'),(94,'loan_payment_reminder_email_template','<p>Dear {borrowerFirstName},You have an upcoming payment of {paymentAmount} due on {paymentDate} for loan {loanNumber}. Please make your payment. Thank you</p>'),(95,'loan_payment_reminder_sms_template','Dear {borrowerFirstName},You have an upcoming payment of {paymentAmount} due on {paymentDate} for loan {loanNumber}. Please make your payment. Thank you'),(96,'missed_payment_email_subject','Missed Payment'),(97,'missed_payment_email_template','<p>Dear {borrowerFirstName},You missed payment of {paymentAmount} which was due on {paymentDate} for loan {loanNumber}. Please make your payment. Thank you</p>'),(98,'missed_payment_sms_template','Dear {borrowerFirstName},You missed  payment of {paymentAmount} which was due on {paymentDate} for loan {loanNumber}. Please make your payment. Thank you'),(99,'enable_cron','1'),(100,'infobip_username',''),(101,'infobip_password','');

--
-- Table structure for table `sms`
--

CREATE TABLE `sms` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned NOT NULL,
  `message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `recipients` int unsigned NOT NULL,
  `send_to` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `gateway` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `branch_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sms_id_index` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sms`
--


--
-- Table structure for table `sms_gateways`
--

CREATE TABLE `sms_gateways` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `from_name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `to_name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `url` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `msg_name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sms_gateways`
--


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

CREATE TABLE `suppliers` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned DEFAULT NULL,
  `name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `mobile_phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `work_phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `suppliers`
--


--
-- Table structure for table `throttle`
--

CREATE TABLE `throttle` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned DEFAULT NULL,
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `throttle_user_id_index` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `throttle`
--

INSERT INTO `throttle` VALUES (1,NULL,'global',NULL,'2022-09-27 13:16:47','2022-09-27 13:16:47'),(2,NULL,'ip','127.0.0.1','2022-09-27 13:16:47','2022-09-27 13:16:47'),(3,2,'user',NULL,'2022-09-27 13:16:47','2022-09-27 13:16:47'),(4,NULL,'global',NULL,'2022-09-29 05:46:14','2022-09-29 05:46:14'),(5,NULL,'ip','127.0.0.1','2022-09-29 05:46:14','2022-09-29 05:46:14'),(6,1,'user',NULL,'2022-09-29 05:46:14','2022-09-29 05:46:14'),(7,NULL,'global',NULL,'2022-09-29 05:46:19','2022-09-29 05:46:19'),(8,NULL,'ip','127.0.0.1','2022-09-29 05:46:19','2022-09-29 05:46:19'),(9,1,'user',NULL,'2022-09-29 05:46:19','2022-09-29 05:46:19'),(10,NULL,'global',NULL,'2022-09-29 05:46:30','2022-09-29 05:46:30'),(11,NULL,'ip','127.0.0.1','2022-09-29 05:46:30','2022-09-29 05:46:30'),(12,1,'user',NULL,'2022-09-29 05:46:30','2022-09-29 05:46:30'),(13,NULL,'global',NULL,'2022-09-29 05:46:39','2022-09-29 05:46:39'),(14,NULL,'ip','127.0.0.1','2022-09-29 05:46:39','2022-09-29 05:46:39'),(15,1,'user',NULL,'2022-09-29 05:46:39','2022-09-29 05:46:39'),(16,NULL,'global',NULL,'2022-09-29 06:50:07','2022-09-29 06:50:07'),(17,NULL,'ip','127.0.0.1','2022-09-29 06:50:07','2022-09-29 06:50:07'),(18,1,'user',NULL,'2022-09-29 06:50:07','2022-09-29 06:50:07'),(19,NULL,'global',NULL,'2022-09-29 06:50:11','2022-09-29 06:50:11'),(20,NULL,'ip','127.0.0.1','2022-09-29 06:50:11','2022-09-29 06:50:11'),(21,1,'user',NULL,'2022-09-29 06:50:11','2022-09-29 06:50:11'),(22,NULL,'global',NULL,'2022-11-11 14:07:09','2022-11-11 14:07:09'),(23,NULL,'ip','162.158.163.152','2022-11-11 14:07:09','2022-11-11 14:07:09'),(24,NULL,'global',NULL,'2022-12-22 04:17:43','2022-12-22 04:17:43'),(25,NULL,'ip','162.158.163.187','2022-12-22 04:17:43','2022-12-22 04:17:43'),(26,NULL,'global',NULL,'2023-01-06 17:30:54','2023-01-06 17:30:54'),(27,NULL,'ip','162.158.162.235','2023-01-06 17:30:54','2023-01-06 17:30:54'),(28,5,'user',NULL,'2023-01-06 17:30:54','2023-01-06 17:30:54'),(29,NULL,'global',NULL,'2023-01-06 17:31:06','2023-01-06 17:31:06'),(30,NULL,'ip','162.158.163.188','2023-01-06 17:31:06','2023-01-06 17:31:06'),(31,5,'user',NULL,'2023-01-06 17:31:06','2023-01-06 17:31:06');

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `permissions` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `last_login` timestamp NULL DEFAULT NULL,
  `first_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `gender` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `max_approval` decimal(10,0) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `users_email_unique` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `users`
--

INSERT INTO `users` VALUES (1,'admin@gmail.com','$2y$10$MaQP4yIg5yyTaP.LxrIo/Oq0MTnznZiZZKZBTKCdme6bJI1izGCya',NULL,'2023-02-21 08:58:56','Admin','Admin',NULL,NULL,NULL,NULL,NULL,'2022-09-27 08:15:14','2023-02-21 08:58:56',1000000000),(4,'co@gmail.com','$2y$10$DsIDsX0Z/0s60QXNX5lVnu5Q24ZVPinv4mIr3i/jBDMqZ95/yu6J.',NULL,'2023-01-06 17:21:54','Co','Co',NULL,NULL,NULL,NULL,NULL,'2022-09-27 13:25:11','2023-01-06 17:21:54',10000),(5,'subadmin@gmail.com','$2y$10$MExRuc4bZPvpSZmLfUN5.eiXzKbVSx3O2sJs2eHxsFnE3IUXP9JNi',NULL,'2023-01-06 17:31:25','Sub Admin','Sub Admin',NULL,NULL,NULL,NULL,NULL,'2022-12-28 10:32:40','2023-01-06 17:31:25',NULL),(6,'dany@gmail.com','$2y$10$K0TQzBS/yUSsETznlAZwUum1AB2ZeopDoYTzeiqOcGvPV0.atylYO',NULL,'2023-01-14 10:26:53','Dany','Dany',NULL,NULL,NULL,NULL,NULL,'2023-01-09 08:10:49','2023-01-14 10:26:53',NULL);

--
-- Table structure for table `warehouses`
--

CREATE TABLE `warehouses` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `warehouses`
--



