INSERT INTO `meterreading` (`MeterReadingID`, `BillingPeriod`, `ConsType`, `CustomerID`, `UnitID`, `Reading`, `ReadingDate`, `Consumption`, `BaseOfBilling`, `ReadingComments`, `MeterNo`, `PrvReading`, `PrvReadingDate`, `PrvReadingID`, `CompanyID`) VALUES
(11438, 202506, 'ENERGY', 49, 49, NULL, '2026-01-25', NULL, 'E', NULL, '101253', 24576, '2026-01-25', 11355, 1),
(11439, 202506, 'ENERGY', 50, 50, NULL, '2026-01-25', NULL, 'E', NULL, '101246', 228236, '2026-01-25', 11356, 1),
(11440, 202506, 'ENERGY', 51, 51, NULL, '2026-01-25', NULL, 'E', NULL, '101250', 259, '2026-01-25', 11357, 1),
(11441, 202506, 'ENERGY', 52, 52, NULL, '2026-01-25', NULL, 'E', NULL, '101249', 356, '2026-01-25', 11358, 1),
(11442, 202506, 'ENERGY', 53, 53, NULL, '2026-01-25', NULL, 'E', NULL, '101245', 59885, '2026-01-25', 11359, 1),
(11443, 202506, 'ENERGY', 54, 54, NULL, '2026-01-25', NULL, 'E', NULL, '101244', 79294, '2026-01-25', 11360, 1),
(11444, 202506, 'ENERGY', 55, 55, NULL, '2026-01-25', NULL, 'E', NULL, '101247', 35278, '2026-01-25', 11361, 1),
(11445, 202506, 'ENERGY', 56, 56, NULL, '2026-01-25', NULL, 'E', NULL, '101248', 29102, '2026-01-25', 11362, 1),
(11446, 202506, 'ENERGY', 57, 57, NULL, '2026-01-25', NULL, 'E', NULL, '101152', 97659, '2026-01-25', 11363, 1),
(11447, 202506, 'ENERGY', 58, 58, NULL, '2026-01-25', NULL, 'E', NULL, '101110', 80148, '2026-01-25', 11364, 1),
(11448, 202506, 'ENERGY', 59, 59, NULL, '2026-01-25', NULL, 'E', NULL, '101243', 154, '2026-01-25', 11365, 1),
(11449, 202506, 'ENERGY', 60, 60, NULL, '2026-01-25', NULL, 'E', NULL, '101303', 492505, '2026-01-25', 11366, 1),
(11450, 202506, 'ENERGY', 61, 61, NULL, '2026-01-25', NULL, 'E', NULL, '101271', 31, '2026-01-25', 11367, 1),
(11451, 202506, 'ENERGY', 62, 62, NULL, '2026-01-25', NULL, 'E', NULL, '101272', 39095, '2026-01-25', 11368, 1),
(11452, 202506, 'ENERGY', 63, 63, NULL, '2026-01-25', NULL, 'E', NULL, '101140', 43, '2026-01-25', 11369, 1),
(11453, 202506, 'ENERGY', 64, 64, NULL, '2026-01-25', NULL, 'E', NULL, '101141', 8, '2026-01-25', 11370, 1),
(11454, 202506, 'ENERGY', 65, 65, NULL, '2026-01-25', NULL, 'E', NULL, '101151', 33529, '2026-01-25', 11371, 1),
(11455, 202506, 'ENERGY', 66, 66, NULL, '2026-01-25', NULL, 'E', NULL, '101145', 38772, '2026-01-25', 11372, 1),
(11456, 202506, 'ENERGY', 67, 67, NULL, '2026-01-25', NULL, 'E', NULL, '101144', 2647, '2026-01-25', 11373, 1),
(11457, 202506, 'ENERGY', 68, 68, NULL, '2026-01-25', NULL, 'E', NULL, '101149', 8411, '2026-01-25', 11374, 1),
(11458, 202506, 'ENERGY', 69, 69, NULL, '2026-01-25', NULL, 'E', NULL, '101111', 33, '2026-01-25', 11375, 1),
(11459, 202506, 'ENERGY', 70, 70, NULL, '2026-01-25', NULL, 'E', NULL, '101118', 10198, '2026-01-25', 11376, 1),
(11460, 202506, 'ENERGY', 71, 71, NULL, '2026-01-25', NULL, 'E', NULL, '101153', 286234, '2026-01-25', 11377, 1),
(11461, 202506, 'ENERGY', 73, 73, NULL, '2026-01-25', NULL, 'E', NULL, '101240', 16386, '2026-01-25', 11378, 1),
(11462, 202506, 'ENERGY', 75, 75, NULL, '2026-01-25', NULL, 'E', NULL, '1', 3271, '2026-01-25', 11379, 1),
(11463, 202506, 'ENERGY', 76, 76, NULL, '2026-01-25', NULL, 'E', NULL, '2', 5288, '2026-01-25', 11380, 1),
(11464, 202506, 'ENERGY', 77, 77, NULL, '2026-01-25', NULL, 'E', NULL, '3', 4264, '2026-01-25', 11381, 1),
(11465, 202506, 'ENERGY', 78, 78, NULL, '2026-01-25', NULL, 'E', NULL, '4', 643, '2026-01-25', 11382, 1),
(11466, 202506, 'ENERGY', 79, 79, NULL, '2026-01-25', NULL, 'E', NULL, '2014157208', 45386, '2026-01-25', 11383, 1),
(11467, 202506, 'ENERGY', 80, 80, NULL, '2026-01-25', NULL, 'E', NULL, '2012070717094', 329, '2026-01-25', 11384, 1),
(11468, 202506, 'ENERGY', 81, 81, NULL, '2026-01-25', NULL, 'E', NULL, '2515-01220654', 3362, '2026-01-25', 11385, 1),
(11469, 202506, 'ENERGY', 82, 82, NULL, '2026-01-25', NULL, 'E', NULL, '2015-013515', 14037, '2026-01-25', 11386, 1),
(11470, 202506, 'ENERGY', 83, 83, NULL, '2026-01-25', NULL, 'E', NULL, '2014188089', 292, '2026-01-25', 11387, 1),
(11471, 202506, 'ENERGY', 84, 84, NULL, '2026-01-25', NULL, 'E', NULL, '201418814', 2455, '2026-01-25', 11388, 1),
(11472, 202506, 'ENERGY', 85, 85, NULL, '2026-01-25', NULL, 'E', NULL, '2014155518', 388, '2026-01-25', 11389, 1),
(11473, 202506, 'ENERGY', 86, 86, NULL, '2026-01-25', NULL, 'E', NULL, '2014180349', 190, '2026-01-25', 11390, 1);

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

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

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

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

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '0001_01_01_000000_create_users_table', 1),
(2, '0001_01_01_000001_create_cache_table', 1),
(3, '0001_01_01_000002_create_jobs_table', 1),
(4, '2026_01_23_060106_create_company_table', 1),
(5, '2026_01_23_060208_create_tbl_cons_type_table', 1),
(6, '2026_01_23_060235_create_tbl_cal_method_table', 1),
(7, '2026_01_23_060248_create_tbl_taxes_table', 1),
(8, '2026_01_23_060307_create_property_table', 1),
(9, '2026_01_23_060325_create_prop_service_table', 1),
(10, '2026_01_23_060357_create_pro_units_table', 1),
(11, '2026_01_23_060420_create_customer_table', 1),
(12, '2026_01_23_060435_create_tariff_category_table', 1),
(13, '2026_01_23_060507_create_tariff_line_table', 1),
(14, '2026_01_23_060524_create_bulk_invoice_table', 1),
(15, '2026_01_23_060550_create_meter_reading_table', 1),
(16, '2026_01_23_060615_create_billing_service_table', 1),
(17, '2026_01_23_060649_create_bill_table', 1),
(18, '2026_01_23_060711_create_bill_line_table', 1),
(19, '2026_01_23_060725_create_payment_table', 1),
(20, '2026_01_23_060753_create_bill_dez_table', 1),
(21, '2026_01_23_060814_create_bill_line2_table', 1),
(22, '2026_01_23_060841_create_bill_line_dez_table', 1),
(23, '2026_01_23_060901_create_tmp_bulk_invoice_line_table', 1),
(24, '2026_01_23_060933_create_tmp_meter_reading_table', 1),
(25, '2026_01_23_061012_create_bulk_invoice_line_table', 1),
(26, '2026_01_23_110306_create_unit_assignments_table', 1),
(27, '2026_01_23_123500_alter_customer_table_make_accountfilename_nullable', 1),
(28, '2026_01_23_123800_make_unitid_nullable', 1),
(29, '2026_01_23_134506_add_prop_id_to_prop_services_table', 1),
(30, '2026_01_23_135228_add_prop_id_to_prop_services_table', 1),
(31, '2026_01_23_135922_create_customer_service_table', 1),
(32, '2026_01_23_140832_create_customer_prop_service_table', 1),
(33, '2026_01_23_142947_add_company_id_and_prop_id_to_users_table', 2),
(34, '2026_01_24_174716_create_notes_table', 3),
(35, '2026_01_24_183601_create_periods_table', 3),
(36, '2026_01_25_050928_add_status_to_bulk_invoice_table', 3),
(37, '2026_01_26_094200_add_company_id_to_customer_table', 4),
(38, '2026_01_27_055934_add_customer_email_to_customer_table', 5),
(39, '2026_01_28_091306_add_image_path_to_tmp_meter_readings_table', 6);

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

--
-- Table structure for table `notes`
--

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

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

--
-- Table structure for table `password_reset_tokens`
--

CREATE TABLE `password_reset_tokens` (
  `email` varchar(255) NOT NULL,
  `token` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `payment`
--

CREATE TABLE `payment` (
  `PaymentID` int(10) UNSIGNED NOT NULL,
  `CustomerID` int(10) UNSIGNED NOT NULL,
  `PaymentDate` date DEFAULT NULL,
  `PaymentMode` varchar(30) DEFAULT NULL,
  `ReceiptNo` varchar(15) DEFAULT NULL,
  `TotalPayment` decimal(19,4) NOT NULL DEFAULT 0.0000,
  `Processed` char(1) NOT NULL DEFAULT 'N',
  `LastUpdatedate` datetime NOT NULL DEFAULT current_timestamp(),
  `LastUpdateUser` varchar(10) NOT NULL DEFAULT current_user()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payment`
--

INSERT INTO `payment` (`PaymentID`, `CustomerID`, `PaymentDate`, `PaymentMode`, `ReceiptNo`, `TotalPayment`, `Processed`, `LastUpdatedate`, `LastUpdateUser`) VALUES
(1000, 9, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:48', 'dbo'),
(1001, 10, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1002, 11, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1003, 12, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1004, 13, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1005, 14, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1006, 15, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1007, 16, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1008, 57, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1009, 58, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1010, 1, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1011, 2, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1012, 3, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1013, 4, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1014, 5, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1015, 6, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1016, 7, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1017, 8, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1018, 65, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1019, 66, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1020, 67, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1021, 68, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1022, 17, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1023, 18, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1024, 19, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1025, 20, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1026, 21, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1027, 22, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1028, 23, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1029, 24, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1030, 25, '2015-06-30', '', '', 2209.3100, '0', '2015-08-23 11:26:51', 'dbo'),
(1031, 25, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1032, 26, '2015-06-30', '', '', 594.9100, '0', '2015-08-23 11:26:51', 'dbo'),
(1033, 26, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1034, 26, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1035, 27, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1036, 28, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1037, 29, '2015-06-30', '', '', 491428.0400, '0', '2015-08-23 11:26:51', 'dbo'),
(1038, 29, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1039, 30, '2015-06-30', '', '', 288571.9600, '0', '2015-08-23 11:26:51', 'dbo'),
(1040, 30, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1041, 31, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1042, 32, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1043, 69, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1044, 70, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1045, 59, '2015-06-30', '', '', 1740.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1046, 59, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1047, 60, '2015-06-30', '', '', 1740.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1048, 60, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1049, 33, '2015-06-30', '', '', 3592.8600, '0', '2015-08-23 11:26:51', 'dbo'),
(1050, 33, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1051, 34, '2015-06-30', '', '', 2863.7900, '0', '2015-08-23 11:26:51', 'dbo'),
(1052, 34, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1053, 35, '2015-06-30', '', '', 13498.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1054, 35, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1055, 36, '2015-06-30', '', '', 3612.0700, '0', '2015-08-23 11:26:51', 'dbo'),
(1056, 36, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1057, 37, '2015-06-30', '', '', 5389.7800, '0', '2015-08-23 11:26:51', 'dbo'),
(1058, 37, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1059, 38, '2015-06-30', '', '', 2585.2900, '0', '2015-08-23 11:26:51', 'dbo'),
(1060, 38, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1061, 39, '2015-06-30', '', '', 2272.8400, '0', '2015-08-23 11:26:51', 'dbo'),
(1062, 39, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1063, 40, '2015-06-30', '', '', 2926.7400, '0', '2015-08-23 11:26:51', 'dbo'),
(1064, 40, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1065, 61, '2015-06-30', '', '', 1740.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1066, 61, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1067, 62, '2015-06-30', '', '', 1740.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1068, 62, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1069, 41, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1070, 42, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1071, 43, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1072, 44, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1073, 45, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1074, 45, '2015-06-30', '', '', 316047.1400, '0', '2015-08-23 11:26:51', 'dbo'),
(1075, 46, '2015-06-30', '', '', 100000.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1076, 46, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1077, 46, '2015-06-30', '', '', 100000.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1078, 47, '2015-06-30', '', '', 180577.6000, '0', '2015-08-23 11:26:51', 'dbo'),
(1079, 47, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1080, 48, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1081, 63, '2015-06-30', '', '', 1740.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1082, 63, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1083, 64, '2015-06-30', '', '', 1740.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1084, 64, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1085, 49, '2015-06-30', '', '', 6737.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1086, 49, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1087, 50, '2015-06-30', '', '', 21346.8300, '0', '2015-08-23 11:26:51', 'dbo'),
(1088, 50, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1089, 51, '2015-06-30', '', '', 8990.1400, '0', '2015-08-23 11:26:51', 'dbo'),
(1090, 51, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1091, 52, '2015-06-30', '', '', 2932.1000, '0', '2015-08-23 11:26:51', 'dbo'),
(1092, 52, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1093, 53, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1094, 54, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1095, 55, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1096, 56, '2015-06-30', '', '', 2661.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1097, 56, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1098, 56, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1099, 56, '2015-06-30', '', '', 0.0000, '0', '2015-08-23 11:26:51', 'dbo'),
(1100, 26, '2015-08-24', '', '', 31797.4100, '0', '2016-04-25 07:35:13', 'dbo'),
(1101, 43, '2015-08-19', '', '', 280000.0000, '0', '2016-04-25 07:35:13', 'dbo'),
(1102, 47, '2015-10-29', '', '', 62194.8300, '0', '2016-04-25 07:35:13', 'dbo'),
(1103, 48, '2015-10-14', '', '', 4090.6300, '0', '2016-04-25 07:35:13', 'dbo'),
(1104, 1, '2026-01-28', '', '', 3765.8900, '0', '2026-01-27 07:59:57', 'dbo'),
(1105, 2, '2015-11-30', '', '', 6614.7600, '0', '2016-04-25 07:59:57', 'dbo'),
(1106, 3, '2015-11-30', '', '', 2759.5100, '0', '2016-04-25 07:59:57', 'dbo'),
(1107, 4, '2015-11-30', '', '', 4050.4000, '0', '2016-04-25 07:59:57', 'dbo'),
(1108, 5, '2015-11-30', '', '', 4220.7500, '0', '2016-04-25 07:59:57', 'dbo'),
(1109, 6, '2015-11-30', '', '', 2939.0400, '0', '2016-04-25 07:59:57', 'dbo'),
(1110, 7, '2015-11-30', '', '', 3468.2500, '0', '2016-04-25 07:59:57', 'dbo'),
(1111, 8, '2015-11-30', '', '', 4285.2200, '0', '2016-04-25 07:59:57', 'dbo'),
(1112, 57, '2015-11-30', '', '', 4444.2100, '0', '2016-04-25 07:59:57', 'dbo'),
(1113, 58, '2015-11-30', '', '', 2533.6000, '0', '2016-04-25 07:59:57', 'dbo'),
(1114, 25, '2015-11-03', '', '', 488.0000, '0', '2016-04-25 07:59:57', 'dbo'),
(1115, 26, '2015-11-04', '', '', 138885.1800, '0', '2016-04-25 07:59:57', 'dbo'),
(1116, 29, '2015-11-11', '', '', 194133.0000, '0', '2016-04-25 07:59:57', 'dbo'),
(1117, 30, '2015-11-11', '', '', 98225.0000, '0', '2016-04-25 07:59:57', 'dbo'),
(1118, 31, '2015-11-09', '', '', 187637.3800, '0', '2016-04-25 07:59:57', 'dbo'),
(1119, 32, '2015-11-09', '', '', 296805.2200, '0', '2016-04-25 07:59:57', 'dbo'),
(1120, 44, '2015-11-04', '', '', 9767.0000, '0', '2016-04-25 07:59:57', 'dbo'),
(1121, 49, '2015-11-20', '', '', 15039.0000, '0', '2016-04-25 07:59:57', 'dbo'),
(1122, 50, '2015-11-20', '', '', 273805.0000, '0', '2016-04-25 07:59:57', 'dbo'),
(1123, 65, '2015-12-31', '', '', 2378.9200, '0', '2016-04-25 08:21:52', 'dbo'),
(1124, 66, '2015-12-31', '', '', 5281.8300, '0', '2016-04-25 08:21:52', 'dbo'),
(1125, 67, '2015-12-31', '', '', 4565.8200, '0', '2016-04-25 08:21:52', 'dbo'),
(1126, 68, '2015-12-31', '', '', 2088.4700, '0', '2016-04-25 08:21:52', 'dbo'),
(1127, 17, '2015-12-22', '', '', 4768.0900, '0', '2016-04-25 08:21:52', 'dbo'),
(1128, 18, '2015-12-22', '', '', 2483.5400, '0', '2016-04-25 08:21:52', 'dbo'),
(1129, 19, '2015-12-22', '', '', 4485.2500, '0', '2016-04-25 08:21:52', 'dbo'),
(1130, 20, '2015-12-22', '', '', 4941.6900, '0', '2016-04-25 08:21:52', 'dbo'),
(1131, 27, '2015-12-24', '', '', 2945.6800, '0', '2016-04-25 08:21:52', 'dbo'),
(1132, 28, '2015-12-24', '', '', 3379.5500, '0', '2016-04-25 08:21:52', 'dbo'),
(1133, 31, '2015-12-24', '', '', 10623.9200, '0', '2016-04-25 08:21:52', 'dbo'),
(1134, 32, '2015-12-24', '', '', 22172.7000, '0', '2016-04-25 08:21:52', 'dbo'),
(1135, 33, '2015-12-09', '', '', 29610.0000, '0', '2016-04-25 08:21:52', 'dbo'),
(1136, 34, '2015-12-09', '', '', 17426.0000, '0', '2016-04-25 08:21:52', 'dbo'),
(1137, 35, '2015-12-09', '', '', 40376.0000, '0', '2016-04-25 08:21:52', 'dbo'),
(1138, 36, '2015-12-09', '', '', 75186.0000, '0', '2016-04-25 08:21:52', 'dbo'),
(1139, 37, '2015-12-09', '', '', 63558.0000, '0', '2016-04-25 08:21:52', 'dbo'),
(1140, 38, '2015-12-09', '', '', 25698.0000, '0', '2016-04-25 08:21:52', 'dbo'),
(1141, 39, '2015-12-09', '', '', 621312.0000, '0', '2016-04-25 08:21:52', 'dbo'),
(1142, 40, '2015-12-09', '', '', 48127.0000, '0', '2016-04-25 08:21:52', 'dbo'),
(1143, 60, '2015-12-09', '', '', 89257.0000, '0', '2016-04-25 08:21:52', 'dbo'),
(1144, 43, '2015-12-23', '', '', 160000.0000, '0', '2016-04-25 08:21:52', 'dbo'),
(1145, 21, '2016-04-26', '', '', 436605.0000, '0', '2016-08-13 07:07:12', 'dbo'),
(1146, 22, '2016-04-26', '', '', 265759.0000, '0', '2016-08-13 07:07:12', 'dbo'),
(1147, 23, '2016-04-26', '', '', 645416.0000, '0', '2016-08-13 07:07:12', 'dbo'),
(1148, 24, '2016-04-26', '', '', 550501.0000, '0', '2016-08-13 07:07:12', 'dbo'),
(1149, 71, '2016-05-25', '', '', 91504.0000, '0', '2016-08-13 07:07:12', 'dbo'),
(1150, 45, '2016-05-16', '', '', 131857.0000, '0', '2016-08-13 07:07:12', 'dbo'),
(1151, 60, '2016-07-11', '', '', 1218435.0000, '0', '2016-08-13 07:07:12', 'dbo'),
(1152, 54, '2016-07-26', '', '', 308734.8000, '0', '2016-08-13 07:07:12', 'dbo'),
(1153, 71, '2024-03-31', '', '', -178.0000, '0', '2024-04-04 13:28:12', 'dbo');

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

--
-- Table structure for table `payments`
--

CREATE TABLE `payments` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `payment_number` varchar(255) NOT NULL,
  `customer_id` bigint(20) UNSIGNED NOT NULL,
  `invoice_id` bigint(20) UNSIGNED DEFAULT NULL,
  `invoice_type` varchar(255) DEFAULT NULL,
  `amount` decimal(10,2) NOT NULL,
  `payment_method` varchar(255) NOT NULL,
  `reference_number` varchar(255) DEFAULT NULL,
  `payment_date` date NOT NULL,
  `notes` text DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'completed',
  `received_by` bigint(20) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `periods`
--

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

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

--
-- Table structure for table `property`
--

CREATE TABLE `property` (
  `PropID` int(10) UNSIGNED NOT NULL,
  `PropName` varchar(60) NOT NULL,
  `PropDesc` varchar(100) NOT NULL,
  `BillPeriodicity` varchar(50) NOT NULL,
  `City` varchar(50) NOT NULL,
  `PropertyType` varchar(50) NOT NULL,
  `NoMonthPerYear` int(11) NOT NULL,
  `WMeterNo` varchar(20) DEFAULT NULL,
  `EMeterNo` varchar(20) DEFAULT NULL,
  `CompanyID` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `property`
--

INSERT INTO `property` (`PropID`, `PropName`, `PropDesc`, `BillPeriodicity`, `City`, `PropertyType`, `NoMonthPerYear`, `WMeterNo`, `EMeterNo`, `CompanyID`) VALUES
(1, 'THE WATERMARK BUSINESS PARK', 'BUSINESS PARK', '1', 'NAIROBI', 'BUSINESS PARK', 12, '0000000000', '13030778', 1),
(2, 'Eldowas Rural', 'Eldoret Water Branch', 'Monthly', 'Nairobi', 'Commercial', 12, NULL, NULL, 1),
(3, 'Coast', 'Test', 'Monthly', 'Nakuru', 'Industrial', 12, NULL, NULL, 2),
(4, 'Test', 'Kericho Test', 'Monthly', 'Kericho', 'Industrial', 12, NULL, NULL, 1),
(5, 'Kawangware apartment', 'New Apartment', 'Monthly', 'Nairobi', 'Residential', 12, NULL, NULL, 1);

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

--
-- Table structure for table `propservice`
--

CREATE TABLE `propservice` (
  `IDService` int(10) UNSIGNED NOT NULL,
  `PropID` bigint(20) UNSIGNED DEFAULT NULL,
  `ServiceName` varchar(255) NOT NULL,
  `Description` text DEFAULT NULL,
  `Price` decimal(10,2) NOT NULL,
  `NoMonthPerYear` int(11) NOT NULL DEFAULT 12,
  `CompanyID` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `propservice`
--

INSERT INTO `propservice` (`IDService`, `PropID`, `ServiceName`, `Description`, `Price`, `NoMonthPerYear`, `CompanyID`) VALUES
(1, 1, 'Montly Rent', 'Test', 20000.00, 4, 1),
(2, 1, 'Car Parking', 'Car Parking Fee', 2500.00, 4, 1),
(3, 1, 'Garbage Collection', 'Test Garbage', 500.00, 4, 1),
(4, NULL, 'New', 'test', 1000.00, 12, 1),
(5, NULL, 'New New', 'sdfsef', 3434.00, 3, 1),
(6, 5, 'thjr', 'fdgdf', 4334.00, 12, 1);

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

--
-- Table structure for table `prounits`
--

CREATE TABLE `prounits` (
  `UnitID` int(10) UNSIGNED NOT NULL,
  `PropID` int(10) UNSIGNED NOT NULL,
  `UnitIdentity` varchar(20) NOT NULL,
  `BlockNo` varchar(20) DEFAULT NULL,
  `FloorNo` varchar(20) DEFAULT NULL,
  `DoorNo` varchar(20) DEFAULT NULL,
  `UnitDesc` varchar(100) DEFAULT NULL,
  `EFixedCharge` decimal(19,4) NOT NULL DEFAULT 0.0000,
  `WFixedCharge` decimal(19,4) NOT NULL DEFAULT 0.0000,
  `MonthlyRent` decimal(19,4) NOT NULL DEFAULT 0.0000,
  `WMeterNo` varchar(20) DEFAULT NULL,
  `EMeterNo` varchar(20) DEFAULT NULL,
  `WLastReading` int(11) NOT NULL DEFAULT 0,
  `ELastReading` int(11) NOT NULL DEFAULT 0,
  `UnitActive` tinyint(1) NOT NULL DEFAULT 1,
  `WMaxReading` int(11) NOT NULL DEFAULT 9999,
  `EMaxReading` int(11) NOT NULL DEFAULT 9999,
  `OccupationStatus` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `prounits`
--

INSERT INTO `prounits` (`UnitID`, `PropID`, `UnitIdentity`, `BlockNo`, `FloorNo`, `DoorNo`, `UnitDesc`, `EFixedCharge`, `WFixedCharge`, `MonthlyRent`, `WMeterNo`, `EMeterNo`, `WLastReading`, `ELastReading`, `UnitActive`, `WMaxReading`, `EMaxReading`, `OccupationStatus`) VALUES
(1, 1, 'A11', 'A', '1', '1', 'COVE COURT _Ground_S1', 200.0000, 200.0000, 20000.0000, 'xx', '101225', 0, 0, 1, 99999, 99999, 'Active'),
(2, 1, 'A12', 'A', '1', '2', 'COVE COURT _Ground_S2', 200.0000, 200.0000, 20000.0000, 'xx', '101229', 0, 0, 1, 99999, 99999, 'Active'),
(3, 1, 'A13', 'A', '1', '3', 'COVE COURT _Ground_S3', 200.0000, 200.0000, 20000.0000, 'xx', '101226', 0, 0, 1, 99999, 99999, 'Active'),
(4, 1, 'A14', 'A', '1', '4', 'COVE COURT _Ground_S4', 200.0000, 200.0000, 20000.0000, 'xx', '101232', 0, 0, 1, 99999, 99999, 'Active'),
(5, 1, 'A21', 'A', '2', '1', 'COVE COURT _Upper_S1', 200.0000, 200.0000, 20000.0000, 'xx', '101227', 0, 0, 1, 99999, 99999, 'Active'),
(6, 1, 'A22', 'A', '2', '2', 'COVE COURT _Upper_S2', 200.0000, 200.0000, 20000.0000, 'xx', '101233', 0, 0, 1, 99999, 99999, 'Active'),
(7, 1, 'A23', 'A', '2', '3', 'COVE COURT _Upper_S3', 200.0000, 200.0000, 20000.0000, 'xx', '101230', 0, 0, 1, 99999, 99999, 'Active'),
(8, 1, 'A24', 'A', '2', '4', 'COVE COURT _Upper_S4', 200.0000, 200.0000, 20000.0000, 'xx', '101231', 0, 0, 1, 99999, 99999, 'Active'),
(9, 1, 'B11', 'B', '1', '1', 'RIVERINA COURT_Ground_S1', 200.0000, 200.0000, 20000.0000, 'xx', '101143', 0, 0, 1, 99999, 99999, 'Active'),
(10, 1, 'B12', 'B', '1', '2', 'RIVERINA COURT_Ground_S2', 200.0000, 200.0000, 20000.0000, 'xx', '101142', 0, 0, 1, 99999, 99999, 'Active'),
(11, 1, 'B13', 'B', '1', '3', 'RIVERINA COURT_Ground_S3', 200.0000, 200.0000, 20000.0000, 'xx', '101134', 0, 0, 1, 99999, 99999, 'Active'),
(12, 1, 'B14', 'B', '1', '4', 'RIVERINA COURT_Ground_S4', 200.0000, 200.0000, 20000.0000, 'xx', '101138', 0, 0, 1, 99999, 99999, 'Active'),
(13, 1, 'B21', 'B', '2', '1', 'RIVERINA COURT_Upper_S1', 200.0000, 200.0000, 20000.0000, 'xx', '101136', 0, 0, 1, 99999, 99999, 'Active'),
(14, 1, 'B22', 'B', '2', '2', 'RIVERINA COURT_Upper_S2', 200.0000, 200.0000, 20000.0000, 'xx', '101137', 0, 0, 1, 99999, 99999, 'Active'),
(15, 1, 'B23', 'B', '2', '3', 'RIVERINA COURT_Upper_S3', 200.0000, 200.0000, 20000.0000, 'xx', '101135', 0, 0, 1, 99999, 99999, 'Active'),
(16, 1, 'B24', 'B', '2', '4', 'RIVERINA COURT_Upper_S4', 200.0000, 200.0000, 20000.0000, 'xx', '101139', 0, 0, 1, 99999, 99999, 'Active'),
(17, 1, 'C11', 'C', '1', '1', 'FOUNTAIN COURT_Ground_S1', 200.0000, 200.0000, 20000.0000, 'xx', '101295', 0, 0, 1, 99999, 99999, 'Active'),
(18, 1, 'C12', 'C', '1', '2', 'FOUNTAIN COURT_Ground_S2', 200.0000, 200.0000, 20000.0000, 'xx', '101296', 0, 0, 1, 99999, 99999, 'Active'),
(19, 1, 'C13', 'C', '1', '3', 'FOUNTAIN COURT_Ground_S3', 200.0000, 200.0000, 20000.0000, 'xx', '101297', 0, 0, 1, 99999, 99999, 'Active'),
(20, 1, 'C14', 'C', '1', '4', 'FOUNTAIN COURT_Ground_S4', 200.0000, 200.0000, 20000.0000, 'xx', '101301', 0, 0, 1, 99999, 99999, 'Active'),
(21, 1, 'C21', 'C', '2', '1', 'FOUNTAIN COURT_Upper_S1', 200.0000, 200.0000, 20000.0000, 'xx', '101298', 0, 0, 1, 99999, 99999, 'Active'),
(22, 1, 'C22', 'C', '2', '2', 'FOUNTAIN COURT_Upper_S2', 200.0000, 200.0000, 20000.0000, 'xx', '101299', 0, 0, 1, 99999, 99999, 'Active'),
(23, 1, 'C23', 'C', '2', '3', 'FOUNTAIN COURT_Upper_S3', 200.0000, 200.0000, 20000.0000, 'xx', '101300', 0, 0, 1, 99999, 99999, 'Active'),
(24, 1, 'C24', 'C', '2', '4', 'FOUNTAIN COURT_Upper_S4', 200.0000, 200.0000, 20000.0000, 'xx', '101302', 0, 0, 1, 99999, 99999, 'Active'),
(25, 1, 'D11', 'D', '1', '1', 'BAY COURT_Ground_S1', 200.0000, 200.0000, 20000.0000, 'xx', '101156', 0, 0, 1, 99999, 99999, 'Active'),
(26, 1, 'D12', 'D', '1', '2', 'BAY COURT_Ground_S2', 200.0000, 200.0000, 20000.0000, 'xx', '101158', 0, 0, 1, 99999, 99999, 'Active'),
(27, 1, 'D13', 'D', '1', '3', 'BAY COURT_Ground_S3', 200.0000, 200.0000, 20000.0000, 'xx', '101162', 0, 0, 1, 99999, 99999, 'Active'),
(28, 1, 'D14', 'D', '1', '4', 'BAY COURT_Ground_S4', 200.0000, 200.0000, 20000.0000, 'xx', '101163', 0, 0, 1, 99999, 99999, 'Active'),
(29, 1, 'D21', 'D', '2', '1', 'BAY COURT_Upper_S1', 200.0000, 200.0000, 20000.0000, 'xx', '101155', 0, 0, 1, 99999, 99999, 'Active'),
(30, 1, 'D22', 'D', '2', '2', 'BAY COURT_Upper_S2', 200.0000, 200.0000, 20000.0000, 'xx', '101157', 0, 0, 1, 99999, 99999, 'Active'),
(31, 1, 'D23', 'D', '2', '3', 'BAY COURT_Upper_S3', 200.0000, 200.0000, 20000.0000, 'xx', '101161', 0, 0, 1, 99999, 99999, 'Active'),
(32, 1, 'D24', 'D', '2', '4', 'BAY COURT_Upper_S4', 200.0000, 200.0000, 20000.0000, 'xx', '101160', 0, 0, 1, 99999, 99999, 'Active'),
(33, 1, 'E11', 'E', '1', '1', 'LAGOON COURT_Ground_S1', 200.0000, 200.0000, 20000.0000, 'xx', '101228', 0, 0, 1, 99999, 99999, 'Active'),
(34, 1, 'E12', 'E', '1', '2', 'LAGOON COURT_Ground_S2', 200.0000, 200.0000, 20000.0000, 'xx', '101159', 0, 0, 1, 99999, 99999, 'Active'),
(35, 1, 'E13', 'E', '1', '3', 'LAGOON COURT_Ground_S3', 200.0000, 200.0000, 20000.0000, 'xx', '101294', 0, 0, 1, 99999, 99999, 'Active'),
(36, 1, 'E14', 'E', '1', '4', 'LAGOON COURT_Ground_S4', 200.0000, 200.0000, 20000.0000, 'xx', '101252', 0, 0, 1, 99999, 99999, 'Active'),
(37, 1, 'E21', 'E', '2', '1', 'LAGOON COURT_Upper_S1', 200.0000, 200.0000, 20000.0000, 'xx', '101242', 0, 0, 1, 99999, 99999, 'Active'),
(38, 1, 'E22', 'E', '2', '2', 'LAGOON COURT_Upper_S2', 200.0000, 200.0000, 20000.0000, 'xx', '101154', 0, 0, 1, 99999, 99999, 'Active'),
(39, 1, 'E23', 'E', '2', '3', 'LAGOON COURT_Upper_S3', 200.0000, 200.0000, 20000.0000, 'xx', '101224', 0, 0, 1, 99999, 99999, 'Active'),
(40, 1, 'E24', 'E', '2', '4', 'LAGOON COURT_Upper_S4', 200.0000, 200.0000, 20000.0000, 'xx', '101251', 0, 0, 1, 99999, 99999, 'Active'),
(41, 1, 'F11', 'F', '1', '1', 'SPRING COURT_Ground_S1', 200.0000, 200.0000, 20000.0000, 'xx', '101267', 0, 0, 1, 99999, 99999, 'Active'),
(42, 1, 'F12', 'F', '1', '2', 'SPRING COURT_Ground_S2', 200.0000, 200.0000, 20000.0000, 'xx', '101268', 0, 0, 1, 99999, 99999, 'Active'),
(43, 1, 'F13', 'F', '1', '3', 'SPRING COURT_Ground_S3', 200.0000, 200.0000, 20000.0000, 'xx', '101266', 0, 0, 1, 99999, 99999, 'Active'),
(44, 1, 'F14', 'F', '1', '4', 'SPRING COURT_Ground_S4', 200.0000, 200.0000, 20000.0000, 'xx', '101269', 0, 0, 1, 99999, 99999, 'Active'),
(45, 1, 'F21', 'F', '2', '1', 'SPRING COURT_Upper_S1', 200.0000, 200.0000, 20000.0000, 'xx', '101265', 0, 0, 1, 99999, 99999, 'Active'),
(46, 1, 'F22', 'F', '2', '2', 'SPRING COURT_Upper_S2', 200.0000, 200.0000, 20000.0000, 'xx', '101273', 0, 0, 1, 99999, 99999, 'Active'),
(47, 1, 'F23', 'F', '2', '3', 'SPRING COURT_Upper_S3', 200.0000, 200.0000, 20000.0000, 'xx', '101264', 0, 0, 1, 99999, 99999, 'Active'),
(48, 1, 'F24', 'F', '2', '4', 'SPRING COURT_Upper_S4', 200.0000, 200.0000, 20000.0000, 'xx', '101270', 0, 0, 1, 99999, 99999, 'Active'),
(49, 1, 'G11', 'G', '1', '1', 'DELTA COURT_Ground_S1', 200.0000, 200.0000, 20000.0000, 'xx', '101253', 0, 0, 1, 99999, 99999, 'Active'),
(50, 1, 'G12', 'G', '1', '2', 'DELTA COURT_Ground_S2', 200.0000, 200.0000, 20000.0000, 'xx', '101246', 0, 0, 1, 99999, 99999, 'Active'),
(51, 1, 'G13', 'G', '1', '3', 'DELTA COURT_Ground_S3', 200.0000, 200.0000, 20000.0000, 'xx', '101250', 0, 0, 1, 99999, 99999, 'Active'),
(52, 1, 'G14', 'G', '1', '4', 'DELTA COURT_Ground_S4', 200.0000, 200.0000, 20000.0000, 'xx', '101249', 0, 0, 1, 99999, 99999, 'Active'),
(53, 1, 'G21', 'G', '2', '1', 'DELTA COURT_Upper_S1', 200.0000, 200.0000, 20000.0000, 'xx', '101245', 0, 0, 1, 99999, 99999, 'Active'),
(54, 1, 'G22', 'G', '2', '2', 'DELTA COURT_Upper_S2', 200.0000, 200.0000, 20000.0000, 'xx', '101244', 0, 0, 1, 99999, 99999, 'Active'),
(55, 1, 'G23', 'G', '2', '3', 'DELTA COURT_Upper_S3', 200.0000, 200.0000, 20000.0000, 'xx', '101247', 0, 0, 1, 99999, 99999, 'Active'),
(56, 1, 'G24', 'G', '2', '4', 'DELTA COURT_Upper_S4', 200.0000, 200.0000, 20000.0000, 'xx', '101248', 0, 0, 1, 99999, 99999, 'Active'),
(57, 1, 'H01', 'H', '0', '1', 'BASEMENTS _Suite 1', 200.0000, 200.0000, 20000.0000, 'xx', '101152', 0, 0, 1, 99999, 99999, 'Active'),
(58, 1, 'H02', 'H', '0', '2', 'BASEMENTS _Suite 2', 200.0000, 200.0000, 20000.0000, 'xx', '101110', 0, 0, 1, 99999, 99999, 'Active'),
(59, 1, 'H01', 'H', '0', '1', 'BASEMENTS _Lagoon Court 1', 200.0000, 200.0000, 20000.0000, 'xx', '101243', 0, 0, 1, 99999, 99999, 'Active'),
(60, 1, 'H02', 'H', '0', '2', 'BASEMENTS _Lagoon Court  2', 200.0000, 200.0000, 20000.0000, 'xx', '101303', 0, 0, 1, 99999, 99999, 'Active'),
(61, 1, 'H01', 'H', '0', '1', 'BASEMENTS _Spring Court 1', 200.0000, 200.0000, 20000.0000, 'xx', '101271', 0, 0, 1, 99999, 99999, 'Active'),
(62, 1, 'H02', 'H', '0', '2', 'BASEMENTS _Spring Court 2', 200.0000, 200.0000, 20000.0000, 'xx', '101272', 0, 0, 1, 99999, 99999, 'Active'),
(63, 1, 'H01', 'H', '0', '1', 'BASEMENTS _Delta Court 1', 200.0000, 200.0000, 20000.0000, 'xx', '101140', 0, 0, 1, 99999, 99999, 'Active'),
(64, 1, 'H02', 'H', '0', '2', 'BASEMENTS _Delta Court 2', 200.0000, 200.0000, 20000.0000, 'xx', '101141', 0, 0, 1, 99999, 99999, 'Active'),
(65, 1, 'I11', 'I', '1', '1', 'ANNEXE A - ADMIN BUILDING _Suite 1', 200.0000, 200.0000, 20000.0000, 'xx', '101151', 0, 0, 1, 99999, 99999, 'Active'),
(66, 1, 'I12', 'I', '1', '2', 'ANNEXE A - ADMIN BUILDING _Suite 2', 200.0000, 200.0000, 20000.0000, 'xx', '101145', 0, 0, 1, 99999, 99999, 'Active'),
(67, 1, 'I21', 'I', '2', '1', 'ANNEXE A - ADMIN BUILDING _Suite 1', 200.0000, 200.0000, 20000.0000, 'xx', '101144', 0, 0, 1, 99999, 99999, 'Active'),
(68, 1, 'I22', 'I', '2', '2', 'ANNEXE A - ADMIN BUILDING _Suite 2', 200.0000, 200.0000, 20000.0000, 'xx', '101149', 0, 0, 1, 99999, 99999, 'Active'),
(69, 1, 'I10', 'I', '1', '0', 'ANNEXE B - DAY CARE BLDG_Ground Floor', 200.0000, 200.0000, 20000.0000, 'xx', '101111', 0, 0, 1, 99999, 99999, 'Active'),
(70, 1, 'I20', 'I', '2', '0', 'ANNEXE B - DAY CARE BLDG_Upper Floor', 200.0000, 200.0000, 20000.0000, 'xx', '101118', 0, 0, 1, 99999, 99999, 'Active'),
(71, 1, 'J00', 'J', '0', '0', 'CAFETARIA ', 200.0000, 200.0000, 20000.0000, 'xx', '101153', 0, 0, 1, 99999, 99999, 'Active'),
(72, 1, 'K00', 'K', '0', '0', 'SHOP', 200.0000, 200.0000, 20000.0000, 'xx', '101193', 0, 0, 1, 99999, 99999, 'Active'),
(73, 1, 'L00', 'L', '0', '0', 'PAVILLION (GAZEBO)', 200.0000, 200.0000, 20000.0000, 'xx', '101240', 0, 0, 1, 99999, 99999, 'Active'),
(74, 1, 'M00', 'M', '0', '0', 'Common Areas ', 200.0000, 200.0000, 20000.0000, 'xx', '999999', 0, 0, 1, 99999, 99999, 'Active'),
(75, 1, 'M01', 'M', '0', '0', 'Delta Court Mtr', 200.0000, 200.0000, 20000.0000, 'xx', '1', 0, 0, 1, 99999, 99999, 'Active'),
(76, 1, 'M02', 'M', '0', '0', 'Bay Court Mtr', 200.0000, 200.0000, 20000.0000, 'xx', '2', 0, 0, 1, 99999, 99999, 'Active'),
(77, 1, 'M03', 'M', '0', '0', 'AQ Mtr', 200.0000, 200.0000, 20000.0000, 'xx', '3', 0, 0, 1, 99999, 99999, 'Active'),
(78, 1, 'M04', 'M', '0', '0', 'Delta Court', 200.0000, 200.0000, 20000.0000, 'xx', '4', 0, 0, 1, 99999, 99999, 'Active'),
(79, 1, 'M05', 'M', '0', '0', 'Management Meter', 200.0000, 200.0000, 20000.0000, 'xx', '2014157208', 0, 0, 1, 99999, 99999, 'Active'),
(80, 1, 'M06', 'M', '0', '0', 'Management Meter', 200.0000, 200.0000, 20000.0000, 'xx', '2012070717094', 0, 0, 1, 99999, 99999, 'Active'),
(81, 1, 'M07', 'M', '0', '0', 'Management Meter ', 200.0000, 200.0000, 20000.0000, 'xx', '2515-01220654', 0, 0, 1, 99999, 99999, 'Active'),
(82, 1, 'M08', 'M', '0', '0', 'Management Meter ', 200.0000, 200.0000, 20000.0000, 'xx', '2015-013515', 0, 0, 1, 99999, 99999, 'Active'),
(83, 1, 'M09', 'M', '0', '0', 'FOUNTAIN COURT', 200.0000, 200.0000, 20000.0000, 'xx', '2014188089', 0, 0, 1, 99999, 99999, 'Active'),
(84, 1, 'M10', 'M', '0', '0', 'RIVERINA COURT', 200.0000, 200.0000, 20000.0000, 'xx', '201418814', 0, 0, 1, 99999, 99999, 'Active'),
(85, 1, 'M11', 'M', '0', '0', 'LAGOON COURT', 200.0000, 200.0000, 20000.0000, 'xx', '2014155518', 0, 0, 1, 99999, 99999, 'Active'),
(86, 1, 'M12', 'M', '0', '0', 'SPRING COURT', 200.0000, 200.0000, 20000.0000, 'xx', '2014180349', 0, 0, 1, 99999, 99999, 'Active');

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

--
-- Table structure for table `rentservicebill`
--

CREATE TABLE `rentservicebill` (
  `BillID` char(11) NOT NULL,
  `CompanyID` int(11) NOT NULL,
  `CustomerID` int(11) NOT NULL,
  `UnitID` int(11) NOT NULL,
  `BillingPeriod` char(6) NOT NULL,
  `BillingDate` date NOT NULL,
  `TotalAmount` decimal(12,2) DEFAULT 0.00,
  `BillStatus` varchar(20) DEFAULT 'OPEN',
  `CreatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  `CreatedBy` varchar(250) DEFAULT NULL,
  `PreviousBalance` decimal(12,2) DEFAULT 0.00,
  `CurrentCharges` decimal(12,2) DEFAULT 0.00,
  `TotalPayable` decimal(12,2) DEFAULT 0.00
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `rentservicebill`
--

INSERT INTO `rentservicebill` (`BillID`, `CompanyID`, `CustomerID`, `UnitID`, `BillingPeriod`, `BillingDate`, `TotalAmount`, `BillStatus`, `CreatedAt`, `CreatedBy`, `PreviousBalance`, `CurrentCharges`, `TotalPayable`) VALUES
('20250400001', 1, 1, 1, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400002', 1, 2, 2, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400003', 1, 3, 3, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400004', 1, 4, 4, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400005', 1, 5, 5, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400006', 1, 6, 6, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400007', 1, 7, 7, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400008', 1, 8, 8, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400009', 1, 9, 9, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400010', 1, 10, 10, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400011', 1, 11, 11, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400012', 1, 12, 12, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400013', 1, 13, 13, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400014', 1, 14, 14, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400015', 1, 15, 15, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400016', 1, 16, 16, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400017', 1, 17, 17, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400018', 1, 18, 18, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400019', 1, 19, 19, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400020', 1, 20, 20, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400021', 1, 21, 21, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400025', 1, 25, 25, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400026', 1, 26, 26, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400027', 1, 27, 27, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400028', 1, 28, 28, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400029', 1, 29, 29, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400030', 1, 30, 30, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400031', 1, 31, 31, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400032', 1, 32, 32, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400033', 1, 33, 33, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400034', 1, 34, 34, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400035', 1, 35, 35, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400036', 1, 36, 36, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400037', 1, 37, 37, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400038', 1, 38, 38, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400039', 1, 39, 39, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400040', 1, 40, 40, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400041', 1, 41, 41, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400042', 1, 42, 42, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400043', 1, 43, 43, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400044', 1, 44, 44, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400045', 1, 45, 45, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400046', 1, 46, 46, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400047', 1, 47, 47, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400048', 1, 48, 48, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400049', 1, 49, 49, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400050', 1, 50, 50, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400051', 1, 51, 51, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400052', 1, 52, 52, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400053', 1, 53, 53, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400054', 1, 54, 54, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400055', 1, 55, 55, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400056', 1, 56, 56, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400057', 1, 57, 57, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400058', 1, 58, 58, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400059', 1, 59, 59, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400060', 1, 60, 60, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400061', 1, 61, 61, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400062', 1, 62, 62, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400063', 1, 63, 63, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400064', 1, 64, 64, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400065', 1, 65, 65, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400066', 1, 66, 66, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400067', 1, 67, 67, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400068', 1, 68, 68, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400069', 1, 69, 69, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400070', 1, 70, 70, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400071', 1, 71, 71, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400073', 1, 73, 73, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400075', 1, 75, 75, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 40000.00, 40000.00),
('20250400076', 1, 76, 76, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400077', 1, 77, 77, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400078', 1, 78, 78, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400079', 1, 79, 79, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400080', 1, 80, 80, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400081', 1, 81, 81, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400082', 1, 82, 82, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400083', 1, 83, 83, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400084', 1, 84, 84, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400085', 1, 85, 85, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400086', 1, 86, 86, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250400087', 1, 87, 22, '202504', '2026-01-26', 0.00, 'OPEN', '2026-01-26 09:09:51', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500001', 1, 1, 1, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500002', 1, 2, 2, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500003', 1, 3, 3, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500004', 1, 4, 4, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500005', 1, 5, 5, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500006', 1, 6, 6, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500007', 1, 7, 7, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500008', 1, 8, 8, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500009', 1, 9, 9, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500010', 1, 10, 10, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500011', 1, 11, 11, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500012', 1, 12, 12, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500013', 1, 13, 13, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500014', 1, 14, 14, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500015', 1, 15, 15, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500016', 1, 16, 16, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500017', 1, 17, 17, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500018', 1, 18, 18, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500019', 1, 19, 19, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500020', 1, 20, 20, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500021', 1, 21, 21, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500025', 1, 25, 25, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500026', 1, 26, 26, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500027', 1, 27, 27, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500028', 1, 28, 28, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500029', 1, 29, 29, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500030', 1, 30, 30, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500031', 1, 31, 31, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500032', 1, 32, 32, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500033', 1, 33, 33, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500034', 1, 34, 34, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500035', 1, 35, 35, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500036', 1, 36, 36, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500037', 1, 37, 37, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500038', 1, 38, 38, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500039', 1, 39, 39, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500040', 1, 40, 40, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500041', 1, 41, 41, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500042', 1, 42, 42, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500043', 1, 43, 43, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500044', 1, 44, 44, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500045', 1, 45, 45, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500046', 1, 46, 46, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500047', 1, 47, 47, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500048', 1, 48, 48, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500049', 1, 49, 49, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500050', 1, 50, 50, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500051', 1, 51, 51, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500052', 1, 52, 52, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500053', 1, 53, 53, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500054', 1, 54, 54, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500055', 1, 55, 55, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500056', 1, 56, 56, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500057', 1, 57, 57, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500058', 1, 58, 58, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500059', 1, 59, 59, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500060', 1, 60, 60, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500061', 1, 61, 61, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500062', 1, 62, 62, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500063', 1, 63, 63, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500064', 1, 64, 64, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500065', 1, 65, 65, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500066', 1, 66, 66, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500067', 1, 67, 67, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500068', 1, 68, 68, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500069', 1, 69, 69, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500070', 1, 70, 70, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500071', 1, 71, 71, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500073', 1, 73, 73, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500075', 1, 75, 75, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 40000.00, 40000.00),
('20250500076', 1, 76, 76, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500077', 1, 77, 77, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500078', 1, 78, 78, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500079', 1, 79, 79, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500080', 1, 80, 80, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500081', 1, 81, 81, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500082', 1, 82, 82, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500083', 1, 83, 83, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500084', 1, 84, 84, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500085', 1, 85, 85, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500086', 1, 86, 86, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250500087', 1, 87, 22, '202505', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:36:16', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600001', 1, 1, 1, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600002', 1, 2, 2, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600003', 1, 3, 3, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600004', 1, 4, 4, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600005', 1, 5, 5, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600006', 1, 6, 6, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600007', 1, 7, 7, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600008', 1, 8, 8, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600009', 1, 9, 9, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600010', 1, 10, 10, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600011', 1, 11, 11, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600012', 1, 12, 12, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600013', 1, 13, 13, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600014', 1, 14, 14, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600015', 1, 15, 15, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600016', 1, 16, 16, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600017', 1, 17, 17, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600018', 1, 18, 18, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600019', 1, 19, 19, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600020', 1, 20, 20, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600021', 1, 21, 21, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600025', 1, 25, 25, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600026', 1, 26, 26, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600027', 1, 27, 27, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600028', 1, 28, 28, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600029', 1, 29, 29, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600030', 1, 30, 30, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600031', 1, 31, 31, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600032', 1, 32, 32, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600033', 1, 33, 33, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600034', 1, 34, 34, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600035', 1, 35, 35, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600036', 1, 36, 36, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600037', 1, 37, 37, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600038', 1, 38, 38, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600039', 1, 39, 39, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600040', 1, 40, 40, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600041', 1, 41, 41, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600042', 1, 42, 42, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600043', 1, 43, 43, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600044', 1, 44, 44, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600045', 1, 45, 45, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600046', 1, 46, 46, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600047', 1, 47, 47, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600048', 1, 48, 48, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600049', 1, 49, 49, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600050', 1, 50, 50, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600051', 1, 51, 51, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600052', 1, 52, 52, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600053', 1, 53, 53, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600054', 1, 54, 54, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600055', 1, 55, 55, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600056', 1, 56, 56, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600057', 1, 57, 57, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600058', 1, 58, 58, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600059', 1, 59, 59, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600060', 1, 60, 60, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600061', 1, 61, 61, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600062', 1, 62, 62, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600063', 1, 63, 63, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600064', 1, 64, 64, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600065', 1, 65, 65, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600066', 1, 66, 66, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600067', 1, 67, 67, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600068', 1, 68, 68, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600069', 1, 69, 69, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600070', 1, 70, 70, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600071', 1, 71, 71, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600073', 1, 73, 73, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600075', 1, 75, 75, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 5000.00, 40000.00, 40000.00),
('20250600076', 1, 76, 76, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600077', 1, 77, 77, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600078', 1, 78, 78, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600079', 1, 79, 79, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600080', 1, 80, 80, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600081', 1, 81, 81, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600082', 1, 82, 82, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600083', 1, 83, 83, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600084', 1, 84, 84, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600085', 1, 85, 85, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600086', 1, 86, 86, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00),
('20250600087', 1, 87, 22, '202506', '2026-01-26', 0.00, 'OPEN', '2026-01-26 07:35:41', 'Sulis Ea', 0.00, 20000.00, 20000.00);

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

--
-- Table structure for table `rentservicebillline`
--

CREATE TABLE `rentservicebillline` (
  `BillLineID` bigint(20) NOT NULL,
  `BillID` char(11) NOT NULL,
  `LineType` enum('RENT','SERVICE') NOT NULL,
  `ItemID` int(11) DEFAULT NULL,
  `ItemName` varchar(100) DEFAULT NULL,
  `Units` decimal(10,2) DEFAULT NULL,
  `UnitPrice` decimal(12,2) DEFAULT NULL,
  `LineAmount` decimal(12,2) DEFAULT NULL,
  `CreatedAt` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `rentservicebillline`
--

INSERT INTO `rentservicebillline` (`BillLineID`, `BillID`, `LineType`, `ItemID`, `ItemName`, `Units`, `UnitPrice`, `LineAmount`, `CreatedAt`) VALUES
(1, '20250600001', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(2, '20250600002', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(3, '20250600003', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(4, '20250600004', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(5, '20250600005', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(6, '20250600006', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(7, '20250600007', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(8, '20250600008', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(9, '20250600009', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(10, '20250600010', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(11, '20250600011', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(12, '20250600012', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(13, '20250600013', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(14, '20250600014', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(15, '20250600015', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(16, '20250600016', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(17, '20250600017', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(18, '20250600018', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(19, '20250600019', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(20, '20250600020', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(21, '20250600021', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(22, '20250600025', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(23, '20250600026', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(24, '20250600027', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(25, '20250600028', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(26, '20250600029', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(27, '20250600030', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(28, '20250600031', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(29, '20250600032', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(30, '20250600033', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(31, '20250600034', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(32, '20250600035', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(33, '20250600036', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(34, '20250600037', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(35, '20250600038', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(36, '20250600039', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(37, '20250600040', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(38, '20250600041', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(39, '20250600042', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(40, '20250600043', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(41, '20250600044', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(42, '20250600045', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(43, '20250600046', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(44, '20250600047', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(45, '20250600048', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(46, '20250600049', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(47, '20250600050', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(48, '20250600051', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(49, '20250600052', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(50, '20250600053', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(51, '20250600054', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(52, '20250600055', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(53, '20250600056', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(54, '20250600057', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(55, '20250600058', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(56, '20250600059', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(57, '20250600060', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(58, '20250600061', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(59, '20250600062', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(60, '20250600063', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(61, '20250600064', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(62, '20250600065', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(63, '20250600066', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(64, '20250600067', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(65, '20250600068', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(66, '20250600069', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(67, '20250600070', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(68, '20250600071', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(69, '20250600073', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(70, '20250600075', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(71, '20250600075', 'SERVICE', 2, 'Car Parking', 8.00, 2500.00, 20000.00, '2026-01-26 07:35:41'),
(72, '20250600076', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(73, '20250600077', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(74, '20250600078', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(75, '20250600079', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(76, '20250600080', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(77, '20250600081', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(78, '20250600082', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(79, '20250600083', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(80, '20250600084', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(81, '20250600085', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(82, '20250600086', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(83, '20250600087', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:35:41'),
(84, '20250500001', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(85, '20250500002', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(86, '20250500003', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(87, '20250500004', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(88, '20250500005', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(89, '20250500006', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(90, '20250500007', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(91, '20250500008', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(92, '20250500009', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(93, '20250500010', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(94, '20250500011', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(95, '20250500012', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(96, '20250500013', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(97, '20250500014', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(98, '20250500015', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(99, '20250500016', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(100, '20250500017', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(101, '20250500018', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(102, '20250500019', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(103, '20250500020', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(104, '20250500021', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(105, '20250500025', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(106, '20250500026', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(107, '20250500027', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(108, '20250500028', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(109, '20250500029', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(110, '20250500030', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(111, '20250500031', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(112, '20250500032', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(113, '20250500033', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(114, '20250500034', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(115, '20250500035', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(116, '20250500036', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(117, '20250500037', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(118, '20250500038', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(119, '20250500039', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(120, '20250500040', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(121, '20250500041', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(122, '20250500042', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(123, '20250500043', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(124, '20250500044', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(125, '20250500045', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(126, '20250500046', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(127, '20250500047', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(128, '20250500048', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(129, '20250500049', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(130, '20250500050', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(131, '20250500051', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(132, '20250500052', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(133, '20250500053', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(134, '20250500054', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(135, '20250500055', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(136, '20250500056', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(137, '20250500057', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(138, '20250500058', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(139, '20250500059', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(140, '20250500060', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(141, '20250500061', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(142, '20250500062', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(143, '20250500063', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(144, '20250500064', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(145, '20250500065', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(146, '20250500066', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(147, '20250500067', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(148, '20250500068', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(149, '20250500069', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(150, '20250500070', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(151, '20250500071', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(152, '20250500073', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(153, '20250500075', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(154, '20250500075', 'SERVICE', 2, 'Car Parking', 8.00, 2500.00, 20000.00, '2026-01-26 07:36:16'),
(155, '20250500076', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(156, '20250500077', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(157, '20250500078', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(158, '20250500079', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(159, '20250500080', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(160, '20250500081', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(161, '20250500082', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(162, '20250500083', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(163, '20250500084', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(164, '20250500085', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(165, '20250500086', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(166, '20250500087', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 07:36:16'),
(167, '20250400001', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(168, '20250400002', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(169, '20250400003', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(170, '20250400004', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(171, '20250400005', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(172, '20250400006', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(173, '20250400007', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(174, '20250400008', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(175, '20250400009', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(176, '20250400010', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(177, '20250400011', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(178, '20250400012', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(179, '20250400013', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(180, '20250400014', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(181, '20250400015', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(182, '20250400016', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(183, '20250400017', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(184, '20250400018', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(185, '20250400019', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(186, '20250400020', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(187, '20250400021', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(188, '20250400025', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(189, '20250400026', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(190, '20250400027', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(191, '20250400028', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(192, '20250400029', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(193, '20250400030', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(194, '20250400031', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(195, '20250400032', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(196, '20250400033', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(197, '20250400034', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(198, '20250400035', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(199, '20250400036', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(200, '20250400037', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(201, '20250400038', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(202, '20250400039', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(203, '20250400040', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(204, '20250400041', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(205, '20250400042', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(206, '20250400043', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(207, '20250400044', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(208, '20250400045', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(209, '20250400046', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(210, '20250400047', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(211, '20250400048', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(212, '20250400049', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(213, '20250400050', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(214, '20250400051', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(215, '20250400052', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(216, '20250400053', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(217, '20250400054', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(218, '20250400055', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(219, '20250400056', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(220, '20250400057', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(221, '20250400058', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(222, '20250400059', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(223, '20250400060', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(224, '20250400061', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(225, '20250400062', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(226, '20250400063', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(227, '20250400064', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(228, '20250400065', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(229, '20250400066', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(230, '20250400067', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(231, '20250400068', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(232, '20250400069', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(233, '20250400070', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(234, '20250400071', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(235, '20250400073', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(236, '20250400075', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(237, '20250400075', 'SERVICE', 2, 'Car Parking', 8.00, 2500.00, 20000.00, '2026-01-26 09:09:51'),
(238, '20250400076', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(239, '20250400077', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(240, '20250400078', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(241, '20250400079', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(242, '20250400080', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(243, '20250400081', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(244, '20250400082', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(245, '20250400083', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(246, '20250400084', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(247, '20250400085', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(248, '20250400086', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(249, '20250400087', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:09:51'),
(250, '20250200001', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:29:25'),
(251, '20250300001', 'RENT', 1, 'Monthly Rent', 1.00, 20000.00, 20000.00, '2026-01-26 09:39:37');

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

--
-- Table structure for table `sessions`
--

CREATE TABLE `sessions` (
  `id` varchar(255) NOT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text DEFAULT NULL,
  `payload` longtext NOT NULL,
  `last_activity` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sessions`
--

INSERT INTO `sessions` (`id`, `user_id`, `ip_address`, `user_agent`, `payload`, `last_activity`) VALUES
('AI5IHPlz0Ei7OKaczWLtxqJPt9KpyUGi99yToyDl', 1, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36', 'YTo3OntzOjY6Il90b2tlbiI7czo0MDoiSEZDdW53U1NwV3hjRVdINFNhcWZWSjlyNkloUDAycVZKM2Nyd2JWaCI7czozOiJ1cmwiO2E6MDp7fXM6OToiX3ByZXZpb3VzIjthOjI6e3M6MzoidXJsIjtzOjM0OiJodHRwOi8vMTI3LjAuMC4xOjgwMDAvcHJvcGVydGllcy81IjtzOjU6InJvdXRlIjtzOjE1OiJwcm9wZXJ0aWVzLnNob3ciO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX1zOjUwOiJsb2dpbl93ZWJfNTliYTM2YWRkYzJiMmY5NDAxNTgwZjAxNGM3ZjU4ZWE0ZTMwOTg5ZCI7aToxO3M6OToiQ29tcGFueUlEIjtpOjE7czo2OiJQcm9wSUQiO2k6MTt9', 1769610326);

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

--
-- Table structure for table `sp_create_emeter_reading_log`
--

CREATE TABLE `sp_create_emeter_reading_log` (
  `log_id` int(11) NOT NULL,
  `log_time` timestamp NOT NULL DEFAULT current_timestamp(),
  `step_name` varchar(100) DEFAULT NULL,
  `message` text DEFAULT NULL,
  `records_affected` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `sp_create_emeter_reading_log`
--

INSERT INTO `sp_create_emeter_reading_log` (`log_id`, `log_time`, `step_name`, `message`, `records_affected`) VALUES
(1, '2026-01-25 07:01:04', 'START', 'Starting SP_CREATE_EMETER_READING for CompanyID: 1, BMonth: 202506', NULL),
(2, '2026-01-25 07:01:04', 'CLEANUP', 'Cleared tmp_meterreading', 82),
(3, '2026-01-25 07:01:04', 'INSERT', 'Created new meter reading records', 82),
(4, '2026-01-25 07:01:04', 'CLEANUP', 'Cleared tmp_meterreading for current period', 0),
(5, '2026-01-25 07:01:04', 'CURSOR', 'Completed updating previous readings', 82),
(6, '2026-01-25 07:01:04', 'TEMP_TABLE', 'Copied records to tmp_meterreading', 82),
(7, '2026-01-25 07:01:04', 'COMPLETE', 'SP_CREATE_EMETER_READING completed successfully', NULL);

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

--
-- Table structure for table `sp_create_period`
--

CREATE TABLE `sp_create_period` (
  `LogID` bigint(20) NOT NULL,
  `StepName` varchar(255) DEFAULT NULL,
  `Message` text DEFAULT NULL,
  `CompanyID` int(11) DEFAULT NULL,
  `PrvBMonth` char(6) DEFAULT NULL,
  `BMonth` char(6) DEFAULT NULL,
  `LogTime` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `sp_create_period`
--

INSERT INTO `sp_create_period` (`LogID`, `StepName`, `Message`, `CompanyID`, `PrvBMonth`, `BMonth`, `LogTime`) VALUES
(1, 'START', 'Procedure started', 1, '202505', '202506', '2026-01-25 07:01:03'),
(2, 'FETCH_BULK_INVOICE', 'BulkInvoiceID = 127', 1, NULL, NULL, '2026-01-25 07:01:03'),
(3, 'SP_UPDATE_E_BALANCES', 'Electricity balances updated', 1, NULL, NULL, '2026-01-25 07:01:04'),
(4, 'SP_CREATE_EMETER_READING', 'New meter readings created', 1, NULL, NULL, '2026-01-25 07:01:04'),
(5, 'END', 'Procedure completed successfully', 1, NULL, NULL, '2026-01-25 07:01:04');

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

--
-- Table structure for table `sp_debug_log`
--

CREATE TABLE `sp_debug_log` (
  `LogID` bigint(20) NOT NULL,
  `ProcedureName` varchar(100) DEFAULT NULL,
  `StepName` varchar(255) DEFAULT NULL,
  `Message` text DEFAULT NULL,
  `CompanyID` int(11) DEFAULT NULL,
  `PrvBMonth` char(6) DEFAULT NULL,
  `BMonth` char(6) DEFAULT NULL,
  `LogTime` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `sp_debug_log`
--

INSERT INTO `sp_debug_log` (`LogID`, `ProcedureName`, `StepName`, `Message`, `CompanyID`, `PrvBMonth`, `BMonth`, `LogTime`) VALUES
(1, 'SP_INIT_PERIOD', 'START', 'Procedure execution started', NULL, '202601', '202602', '2026-01-24 19:49:29'),
(2, 'SP_INIT_PERIOD', 'END', 'Procedure execution finished', NULL, NULL, NULL, '2026-01-24 19:49:29'),
(3, 'SP_INIT_PERIOD', 'START', 'Procedure execution started', NULL, '202601', '202602', '2026-01-24 19:52:33'),
(4, 'SP_INIT_PERIOD', 'END', 'Procedure execution finished', NULL, NULL, NULL, '2026-01-24 19:52:33'),
(5, 'SP_INIT_PERIOD', 'START', 'Procedure execution started', NULL, '202601', '202602', '2026-01-24 20:03:06'),
(6, 'SP_INIT_PERIOD', 'END', 'Procedure execution finished', NULL, NULL, NULL, '2026-01-24 20:03:06'),
(7, 'SP_INIT_PERIOD', 'START', 'Procedure execution started', NULL, '202505', '202506', '2026-01-25 07:01:03'),
(8, 'SP_INIT_PERIOD', 'FETCH', 'Fetched CompanyID', 1, NULL, NULL, '2026-01-25 07:01:03'),
(9, 'SP_INIT_PERIOD', 'SP_CREATE_PERIOD_DONE', 'SP_CREATE_PERIOD completed', 1, NULL, NULL, '2026-01-25 07:01:04'),
(10, 'SP_INIT_PERIOD', 'END', 'Procedure execution finished', NULL, NULL, NULL, '2026-01-25 07:01:04');

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

--
-- Table structure for table `tariffcategory`
--

CREATE TABLE `tariffcategory` (
  `CompanyID` int(10) UNSIGNED NOT NULL,
  `CategoryID` char(3) NOT NULL,
  `TariffCatName` varchar(60) NOT NULL,
  `Class` varchar(10) NOT NULL,
  `BillingModeName` varchar(60) NOT NULL,
  `ConsType` varchar(6) DEFAULT NULL,
  `LastUpdateDate` datetime NOT NULL DEFAULT current_timestamp(),
  `LastUpdateUser` varchar(20) NOT NULL DEFAULT current_user()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tariffcategory`
--

INSERT INTO `tariffcategory` (`CompanyID`, `CategoryID`, `TariffCatName`, `Class`, `BillingModeName`, `ConsType`, `LastUpdateDate`, `LastUpdateUser`) VALUES
(1, 'KPL', 'KPLC DOMESTIC', 'CONS', '', 'ENERGY', '2011-12-14 10:13:03', 'dbo'),
(1, 'TAX', 'VAT', 'VAT', '', 'ENERGY', '2011-12-14 11:25:13', 'dbo');

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

--
-- Table structure for table `tariffline`
--

CREATE TABLE `tariffline` (
  `CompanyID` int(10) UNSIGNED NOT NULL,
  `CategoryID` char(3) NOT NULL,
  `TLineID` char(3) NOT NULL,
  `TLineName` varchar(60) NOT NULL,
  `TLineDescription` varchar(60) DEFAULT NULL,
  `TLineBillingMode` char(3) NOT NULL,
  `TLineMinConsumption` smallint(6) DEFAULT NULL,
  `TLineMaxConsumption` smallint(6) DEFAULT NULL,
  `TLinePricePerUnit` decimal(10,4) NOT NULL,
  `TLineCalcMethod` char(3) DEFAULT NULL,
  `TLineConsType` varchar(6) DEFAULT NULL,
  `TLineAccountNo` char(5) NOT NULL,
  `TLineTaxID` smallint(5) UNSIGNED DEFAULT NULL,
  `TLinePeriodicity` smallint(6) DEFAULT NULL,
  `TLinePriority` smallint(6) DEFAULT NULL,
  `LastUpdateDate` datetime NOT NULL DEFAULT current_timestamp(),
  `LastUpdateUser` varchar(10) NOT NULL DEFAULT current_user()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tariffline`
--

INSERT INTO `tariffline` (`CompanyID`, `CategoryID`, `TLineID`, `TLineName`, `TLineDescription`, `TLineBillingMode`, `TLineMinConsumption`, `TLineMaxConsumption`, `TLinePricePerUnit`, `TLineCalcMethod`, `TLineConsType`, `TLineAccountNo`, `TLineTaxID`, `TLinePeriodicity`, `TLinePriority`, `LastUpdateDate`, `LastUpdateUser`) VALUES
(1, 'KPL', 'L01', 'Fixed Charge', 'Fixed rate per unit', 'FX', 0, 0, 300.0000, 'FIX', 'ENERGY', 'FIXED', 1, 1, 1, '2011-12-14 10:18:37', 'dbo'),
(1, 'KPL', 'L02', 'Consumption', 'Prorata on cons', 'CO', 0, 0, 20.5800, 'CON', 'ENERGY', 'CONS', 1, 1, 2, '2011-12-14 10:58:46', 'dbo'),
(1, 'KPL', 'L03', 'Fuel Energy Cost', 'Prorata on cons', 'CO', 0, 0, 4.1400, 'CON', 'ENERGY', 'CONS', 1, 1, 4, '2011-12-14 11:14:22', 'dbo'),
(1, 'KPL', 'L04', 'Forex Exchange Adj.', 'Prorata on cons', 'CO', 0, 0, 3.6804, 'CON', 'ENERGY', 'CONS', NULL, 1, 5, '2011-12-14 11:16:05', 'dbo'),
(1, 'KPL', 'L05', 'Inflation Adj.', 'Prorata on cons', 'CO', 0, 0, 0.3300, 'CON', 'ENERGY', 'CONS', NULL, 1, 6, '2011-12-14 11:18:00', 'dbo'),
(1, 'KPL', 'L06', 'Max Demand KVA', 'Prorata on cons', 'CO', 0, 0, 0.0000, 'MAX', 'ENERGY', 'CONS', 1, 1, 3, '2011-12-14 11:19:15', 'dbo'),
(1, 'KPL', 'L07', 'ERC Levy', '% Rate on cons', 'CO', 0, 0, 0.0800, 'RCN', 'ENERGY', 'CONS', NULL, 1, 7, '2011-12-14 11:19:59', 'dbo'),
(1, 'KPL', 'L08', 'REP Levy', '% Rate on cons value', 'CO', 0, 0, 0.0500, 'RVL', 'ENERGY', 'CONS', NULL, 1, 8, '2011-12-14 11:19:59', 'dbo'),
(1, 'KPL', 'L09', 'WARMA LEVY', '% Rate on cons', 'CO', 0, 0, 0.0145, 'RCN', 'ENERGY', 'CONS', NULL, 1, 9, '2011-12-14 11:19:59', 'dbo'),
(1, 'TAX', 'VAT', 'VAT @ 16%', 'Prorata on taxable', 'TX', 0, 0, 0.1600, 'RRT', 'ENERGY', 'VAT', NULL, 1, 10, '2021-01-08 10:52:07', 'dbo');

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

--
-- Table structure for table `tblcalmethod`
--

CREATE TABLE `tblcalmethod` (
  `MethodName` varchar(50) NOT NULL,
  `MethodDescription` varchar(100) DEFAULT NULL,
  `ConsType` varchar(6) NOT NULL,
  `tID` char(3) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tblcalmethod`
--

INSERT INTO `tblcalmethod` (`MethodName`, `MethodDescription`, `ConsType`, `tID`) VALUES
('CONSUMPTION BASED', 'PRORATA ON CONSUMPTION', 'ENERGY', 'CO'),
('FIXED', 'FIXED RATE', 'ENERGY', 'FIX'),
('CONSUMPTION BASED', 'PRORATA ON CONSUMPTION', 'ENERGY', 'MAX'),
('PER% ON Kwh', '% RATE ON CONSUMPTION', 'ENERGY', 'RC'),
('PER% ON TAXABLE VALUE', '% RATE ON TAXABLE VALUE', 'ENERGY', 'RRT'),
('PER% ON CONS VALUE (Kshs)', '% RATE ON CONSUMPTION VALUE (Kshs)', 'ENERGY', 'RVL');

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

--
-- Table structure for table `tblconstype`
--

CREATE TABLE `tblconstype` (
  `ConsType` varchar(50) NOT NULL,
  `ConsTypeDescription` varchar(100) DEFAULT NULL,
  `tID` varchar(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tblconstype`
--

INSERT INTO `tblconstype` (`ConsType`, `ConsTypeDescription`, `tID`) VALUES
('ELECRICITY', 'KENYA POWER ELECRICITY', 'ENERGY'),
('WATER', 'WATER', 'WATER');

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

--
-- Table structure for table `tbltaxes`
--

CREATE TABLE `tbltaxes` (
  `TaxName` varchar(50) NOT NULL,
  `TaxPercentage` decimal(19,4) NOT NULL,
  `PrintingChar` char(3) NOT NULL,
  `AccountNo` char(5) DEFAULT NULL,
  `tID` smallint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tbltaxes`
--

INSERT INTO `tbltaxes` (`TaxName`, `TaxPercentage`, `PrintingChar`, `AccountNo`, `tID`) VALUES
('VAT @ 12%', 12.0000, '*', NULL, 1);

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

--
-- Table structure for table `tmp_bulkinvoiceline`
--

CREATE TABLE `tmp_bulkinvoiceline` (
  `BulkInvoiceID` int(11) NOT NULL,
  `BulkCategID` char(3) NOT NULL,
  `BulkLineID` char(3) NOT NULL,
  `BulkLineDesc` varchar(60) NOT NULL,
  `BulkLineUnitPrice` decimal(10,4) NOT NULL,
  `BulkLineAmount` decimal(19,4) NOT NULL,
  `TableOwner` char(9) NOT NULL,
  `tblID` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tmp_bulkinvoiceline`
--

INSERT INTO `tmp_bulkinvoiceline` (`BulkInvoiceID`, `BulkCategID`, `BulkLineID`, `BulkLineDesc`, `BulkLineUnitPrice`, `BulkLineAmount`, `TableOwner`, `tblID`) VALUES
(1, 'KPL', 'L01', 'Fixed Charge', 0.0000, 2500.0000, 'sa15502sa', 181),
(1, 'KPL', 'L02', 'Consumption', 0.0000, 482816.0000, 'sa15502sa', 182),
(1, 'KPL', 'L03', 'Fuel Costs Charge', 0.0000, 131724.8000, 'sa15502sa', 183),
(1, 'KPL', 'L04', 'Forex Adj', 0.0000, 52480.0000, 'sa15502sa', 184),
(1, 'KPL', 'L05', 'Inflation Adj.', 0.0000, 12070.4000, 'sa15502sa', 185),
(1, 'KPL', 'L06', 'Max KVA', 0.0000, 128000.0000, 'sa15502sa', 186),
(1, 'KPL', 'L07', 'ERC Levy 3.0 c/kwh', 0.0000, 1574.4000, 'sa15502sa', 187),
(1, 'KPL', 'L08', 'REP Levy 5.00%', 0.0000, 24140.8000, 'sa15502sa', 188),
(1, 'KPL', 'L09', 'WARMA LEVY 6 c/kwh', 0.0000, 2624.0000, 'sa15502sa', 189),
(1, 'TAX', 'VAT', 'VAT @ 16%', 0.0000, 129534.5900, 'sa15502sa', 190),
(26, 'KPL', 'L01', 'Fixed Charge', 0.0000, 2500.0000, 'sa15744sa', 311),
(26, 'KPL', 'L02', 'Consumption', 0.0000, 602130.8000, 'sa15744sa', 312),
(26, 'KPL', 'L03', 'Fuel Costs Charge', 0.0000, 186529.6500, 'sa15744sa', 313),
(26, 'KPL', 'L04', 'Forex Adj', 0.0000, 59558.5900, 'sa15744sa', 314),
(26, 'KPL', 'L05', 'Inflation Adj.', 0.0000, 18980.2100, 'sa15744sa', 315),
(26, 'KPL', 'L06', 'Max KVA', 0.0000, 144800.0000, 'sa15744sa', 316),
(26, 'KPL', 'L07', 'ERC Levy 3.0 c/kwh', 0.0000, 1963.4700, 'sa15744sa', 317),
(26, 'KPL', 'L08', 'REP Levy 5.00%', 0.0000, 30106.5800, 'sa15744sa', 318),
(26, 'KPL', 'L09', 'WARMA LEVY 6 c/kwh', 0.0000, 1374.4200, 'sa15744sa', 319),
(26, 'TAX', 'VAT', 'VAT @ 16%', 0.0000, 162319.8800, 'sa15744sa', 320),
(1, 'KPL', 'L01', 'Fixed Charge', 1.0000, 0.0000, 'sa17381sa', 731),
(1, 'KPL', 'L02', 'Consumption', 1.0000, 629712.0000, 'sa17381sa', 732),
(1, 'KPL', 'L03', 'Fuel Costs Charge', 1.0000, 131190.0000, 'sa17381sa', 733),
(1, 'KPL', 'L04', 'Forex Adj', 1.0000, 0.0000, 'sa17381sa', 734),
(1, 'KPL', 'L05', 'Inflation Adj.', 1.0000, 0.0000, 'sa17381sa', 735),
(1, 'KPL', 'L06', 'Max KVA', 1.0000, 0.0000, 'sa17381sa', 736),
(1, 'KPL', 'L07', 'ERC Levy 3.0 c/kwh', 1.0000, 0.0000, 'sa17381sa', 737),
(1, 'KPL', 'L08', 'REP Levy 5.00%', 1.0000, 0.0000, 'sa17381sa', 738),
(1, 'KPL', 'L09', 'WARMA LEVY 6 c/kwh', 1.0000, 0.0000, 'sa17381sa', 739),
(1, 'TAX', 'VAT', 'VAT @ 16%', 1.0000, 0.0000, 'sa17381sa', 740);

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

--
-- Table structure for table `tmp_meterreading`
--

CREATE TABLE `tmp_meterreading` (
  `MeterReadingID` int(11) NOT NULL,
  `BillingPeriod` int(11) NOT NULL,
  `ConsType` varchar(6) NOT NULL,
  `CustomerID` int(11) NOT NULL,
  `UnitID` int(11) NOT NULL,
  `Reading` int(11) DEFAULT NULL,
  `ReadingDate` date DEFAULT NULL,
  `Consumption` int(11) DEFAULT NULL,
  `ImagePath` varchar(255) DEFAULT NULL,
  `BaseOfBilling` varchar(20) DEFAULT NULL,
  `PrvReading` int(11) DEFAULT NULL,
  `PrvReadingDate` date DEFAULT NULL,
  `CompanyID` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tmp_meterreading`
--

INSERT INTO `tmp_meterreading` (`MeterReadingID`, `BillingPeriod`, `ConsType`, `CustomerID`, `UnitID`, `Reading`, `ReadingDate`, `Consumption`, `ImagePath`, `BaseOfBilling`, `PrvReading`, `PrvReadingDate`, `CompanyID`) VALUES
(11392, 202506, 'ENERGY', 1, 1, 26112, '2026-01-25', 22, 'MR001-1-20250303_125319.jpg', 'C', 26090, '2026-01-25', 1),
(11393, 202506, 'ENERGY', 2, 2, 20116, '2026-01-25', 49, 'MR001-1-20250303_125319.jpg', 'C', 20067, '2026-01-25', 1),
(11394, 202506, 'ENERGY', 3, 3, 248193, '2026-01-25', 26, 'MR001-1-20250303_125319.jpg', 'C', 248167, '2026-01-25', 1),
(11395, 202506, 'ENERGY', 4, 4, 70009, '2026-01-25', 33, 'MR001-1-20250303_125319.jpg', 'C', 69976, '2026-01-25', 1),
(11396, 202506, 'ENERGY', 5, 5, 87255, '2026-01-25', 36, 'MR001-1-20250303_125319.jpg', 'C', 87219, '2026-01-25', 1),
(11397, 202506, 'ENERGY', 6, 6, 32406, '2026-01-25', 31, 'MR001-1-20250303_125319.jpg', 'C', 32375, '2026-01-25', 1),
(11398, 202506, 'ENERGY', 7, 7, 77509, '2026-01-25', 49, 'MR001-1-20250303_125319.jpg', 'C', 77460, '2026-01-25', 1),
(11399, 202506, 'ENERGY', 8, 8, 11093, '2026-01-25', 48, 'MR001-1-20250303_125319.jpg', 'C', 11045, '2026-01-25', 1),
(11400, 202506, 'ENERGY', 9, 9, 44042, '2026-01-25', 46, 'MR001-1-20250303_125319.jpg', 'C', 43996, '2026-01-25', 1),
(11401, 202506, 'ENERGY', 10, 10, 36478, '2026-01-25', 33, 'MR001-1-20250303_125319.jpg', 'C', 36445, '2026-01-25', 1),
(11402, 202506, 'ENERGY', 11, 11, 40987, '2026-01-25', 25, 'MR001-1-20250303_125319.jpg', 'C', 40962, '2026-01-25', 1),
(11403, 202506, 'ENERGY', 12, 12, 33038, '2026-01-25', 28, 'MR001-1-20250303_125319.jpg', 'C', 33010, '2026-01-25', 1),
(11404, 202506, 'ENERGY', 13, 13, 67421, '2026-01-25', 12, 'MR001-1-20250303_125319.jpg', 'C', 67409, '2026-01-25', 1),
(11405, 202506, 'ENERGY', 14, 14, 83843, '2026-01-25', 29, 'MR001-1-20250303_125319.jpg', 'C', 83814, '2026-01-25', 1),
(11406, 202506, 'ENERGY', 15, 15, 11991, '2026-01-25', 5, 'MR001-1-20250303_125319.jpg', 'C', 11986, '2026-01-25', 1),
(11407, 202506, 'ENERGY', 16, 16, 45226, '2026-01-25', 40, 'MR001-1-20250303_125319.jpg', 'C', 45186, '2026-01-25', 1),
(11408, 202506, 'ENERGY', 17, 17, 152309, '2026-01-25', 35, 'MR001-1-20250303_125319.jpg', 'C', 152274, '2026-01-25', 1),
(11409, 202506, 'ENERGY', 18, 18, 97784, '2026-01-25', 5, 'MR001-1-20250303_125319.jpg', 'C', 97779, '2026-01-25', 1),
(11410, 202506, 'ENERGY', 19, 19, 83421, '2026-01-25', 18, 'MR001-1-20250303_125319.jpg', 'C', 83403, '2026-01-25', 1),
(11411, 202506, 'ENERGY', 20, 20, 29725, '2026-01-25', 24, 'MR001-1-20250303_125319.jpg', 'C', 29701, '2026-01-25', 1),
(11412, 202506, 'ENERGY', 21, 21, 83138, '2026-01-25', 17, 'MR001-1-20250303_125319.jpg', 'C', 83121, '2026-01-25', 1),
(11413, 202506, 'ENERGY', 87, 22, 1618, '2026-01-25', 14, 'MR001-1-20250303_125319.jpg', 'C', 1604, '2026-01-25', 1),
(11414, 202506, 'ENERGY', 25, 25, 192449, '2026-01-25', 17, 'MR001-1-20250303_125319.jpg', 'C', 192432, '2026-01-25', 1),
(11415, 202506, 'ENERGY', 26, 26, 355006, '2026-01-25', 41, 'MR001-1-20250303_125319.jpg', 'C', 354965, '2026-01-25', 1),
(11416, 202506, 'ENERGY', 27, 27, 10724, '2026-01-25', 5, 'MR001-1-20250303_125319.jpg', 'C', 10719, '2026-01-25', 1),
(11417, 202506, 'ENERGY', 28, 28, 28405, '2026-01-25', 3, 'MR001-1-20250303_125319.jpg', 'C', 28402, '2026-01-25', 1),
(11418, 202506, 'ENERGY', 29, 29, 230036, '2026-01-25', 49, 'MR001-1-20250303_125319.jpg', 'C', 229987, '2026-01-25', 1),
(11419, 202506, 'ENERGY', 30, 30, 97892, '2026-01-25', 34, 'MR001-1-20250303_125319.jpg', 'C', 97858, '2026-01-25', 1),
(11420, 202506, 'ENERGY', 31, 31, 134068, '2026-01-25', 25, 'MR001-1-20250303_125319.jpg', 'C', 134043, '2026-01-25', 1),
(11421, 202506, 'ENERGY', 32, 32, 307605, '2026-01-25', 20, 'MR001-1-20250303_125319.jpg', 'C', 307585, '2026-01-25', 1),
(11422, 202506, 'ENERGY', 33, 33, 65149, '2026-01-25', 24, 'MR001-1-20250303_125319.jpg', 'C', 65125, '2026-01-25', 1),
(11423, 202506, 'ENERGY', 34, 34, 12963, '2026-01-25', 9, 'MR001-1-20250303_125319.jpg', 'C', 12954, '2026-01-25', 1),
(11424, 202506, 'ENERGY', 35, 35, 39269, '2026-01-25', 24, 'MR001-1-20250303_125319.jpg', 'C', 39245, '2026-01-25', 1),
(11425, 202506, 'ENERGY', 36, 36, 59602, '2026-01-25', 43, 'MR001-1-20250303_125319.jpg', 'C', 59559, '2026-01-25', 1),
(11426, 202506, 'ENERGY', 37, 37, 49199, '2026-01-25', 43, 'MR001-1-20250303_125319.jpg', 'C', 49156, '2026-01-25', 1),
(11427, 202506, 'ENERGY', 38, 38, 24567, '2026-01-25', 33, 'MR001-1-20250303_125319.jpg', 'C', 24534, '2026-01-25', 1),
(11428, 202506, 'ENERGY', 39, 39, 42754, '2026-01-25', 36, 'MR001-1-20250303_125319.jpg', 'C', 42718, '2026-01-25', 1),
(11429, 202506, 'ENERGY', 40, 40, 73252, '2026-01-25', 30, 'MR001-1-20250303_125319.jpg', 'C', 73222, '2026-01-25', 1),
(11430, 202506, 'ENERGY', 41, 41, 483, '2026-01-25', 41, 'MR001-1-20250303_125319.jpg', 'C', 442, '2026-01-25', 1),
(11431, 202506, 'ENERGY', 42, 42, 4969, '2026-01-25', 17, 'MR001-1-20250303_125319.jpg', 'C', 4952, '2026-01-25', 1),
(11432, 202506, 'ENERGY', 43, 43, 150181, '2026-01-25', 10, 'MR001-1-20250303_125319.jpg', 'C', 150171, '2026-01-25', 1),
(11433, 202506, 'ENERGY', 44, 44, 85458, '2026-01-25', 47, 'MR001-1-20250303_125319.jpg', 'C', 85411, '2026-01-25', 1),
(11434, 202506, 'ENERGY', 45, 45, 73529, '2026-01-25', 4, 'MR001-1-20250303_125319.jpg', 'C', 73525, '2026-01-25', 1),
(11435, 202506, 'ENERGY', 46, 46, 130469, '2026-01-25', 29, 'MR001-1-20250303_125319.jpg', 'C', 130440, '2026-01-25', 1),
(11436, 202506, 'ENERGY', 47, 47, 62261, '2026-01-25', 35, 'MR001-1-20250303_125319.jpg', 'C', 62226, '2026-01-25', 1),
(11437, 202506, 'ENERGY', 48, 48, 74493, '2026-01-25', 35, 'MR001-1-20250303_125319.jpg', 'C', 74458, '2026-01-25', 1),
(11438, 202506, 'ENERGY', 49, 49, 24596, '2026-01-25', 20, 'MR001-1-20250303_125319.jpg', 'C', 24576, '2026-01-25', 1),
(11439, 202506, 'ENERGY', 50, 50, 228281, '2026-01-25', 45, 'MR001-1-20250303_125319.jpg', 'C', 228236, '2026-01-25', 1),
(11440, 202506, 'ENERGY', 51, 51, 275, '2026-01-25', 16, 'MR001-1-20250303_125319.jpg', 'C', 259, '2026-01-25', 1),
(11441, 202506, 'ENERGY', 52, 52, 398, '2026-01-25', 42, 'MR001-1-20250303_125319.jpg', 'C', 356, '2026-01-25', 1),
(11442, 202506, 'ENERGY', 53, 53, 59897, '2026-01-25', 12, 'MR001-1-20250303_125319.jpg', 'C', 59885, '2026-01-25', 1),
(11443, 202506, 'ENERGY', 54, 54, 79329, '2026-01-25', 35, 'MR001-1-20250303_125319.jpg', 'C', 79294, '2026-01-25', 1),
(11444, 202506, 'ENERGY', 55, 55, 35314, '2026-01-25', 36, 'MR001-1-20250303_125319.jpg', 'C', 35278, '2026-01-25', 1),
(11445, 202506, 'ENERGY', 56, 56, 29130, '2026-01-25', 28, 'MR001-1-20250303_125319.jpg', 'C', 29102, '2026-01-25', 1),
(11446, 202506, 'ENERGY', 57, 57, 97688, '2026-01-25', 29, 'MR001-1-20250303_125319.jpg', 'C', 97659, '2026-01-25', 1),
(11447, 202506, 'ENERGY', 58, 58, 80159, '2026-01-25', 11, 'MR001-1-20250303_125319.jpg', 'C', 80148, '2026-01-25', 1),
(11448, 202506, 'ENERGY', 59, 59, 170, '2026-01-25', 16, 'MR001-1-20250303_125319.jpg', 'C', 154, '2026-01-25', 1),
(11449, 202506, 'ENERGY', 60, 60, 492552, '2026-01-25', 47, 'MR001-1-20250303_125319.jpg', 'C', 492505, '2026-01-25', 1),
(11450, 202506, 'ENERGY', 61, 61, 67, '2026-01-25', 36, 'MR001-1-20250303_125319.jpg', 'C', 31, '2026-01-25', 1),
(11451, 202506, 'ENERGY', 62, 62, 39132, '2026-01-25', 37, 'MR001-1-20250303_125319.jpg', 'C', 39095, '2026-01-25', 1),
(11452, 202506, 'ENERGY', 63, 63, 72, '2026-01-25', 29, 'MR001-1-20250303_125319.jpg', 'C', 43, '2026-01-25', 1),
(11453, 202506, 'ENERGY', 64, 64, 41, '2026-01-25', 33, 'MR001-1-20250303_125319.jpg', 'C', 8, '2026-01-25', 1),
(11454, 202506, 'ENERGY', 65, 65, 33557, '2026-01-25', 28, 'MR001-1-20250303_125319.jpg', 'C', 33529, '2026-01-25', 1),
(11455, 202506, 'ENERGY', 66, 66, 38811, '2026-01-25', 39, 'MR001-1-20250303_125319.jpg', 'C', 38772, '2026-01-25', 1),
(11456, 202506, 'ENERGY', 67, 67, 2656, '2026-01-25', 9, 'MR001-1-20250303_125319.jpg', 'C', 2647, '2026-01-25', 1),
(11457, 202506, 'ENERGY', 68, 68, 8440, '2026-01-25', 29, 'MR001-1-20250303_125319.jpg', 'C', 8411, '2026-01-25', 1),
(11458, 202506, 'ENERGY', 69, 69, 53, '2026-01-25', 20, 'MR001-1-20250303_125319.jpg', 'C', 33, '2026-01-25', 1),
(11459, 202506, 'ENERGY', 70, 70, 10207, '2026-01-25', 9, 'MR001-1-20250303_125319.jpg', 'C', 10198, '2026-01-25', 1),
(11460, 202506, 'ENERGY', 71, 71, 286269, '2026-01-25', 35, 'MR001-1-20250303_125319.jpg', 'C', 286234, '2026-01-25', 1),
(11461, 202506, 'ENERGY', 73, 73, 16432, '2026-01-25', 46, 'MR001-1-20250303_125319.jpg', 'C', 16386, '2026-01-25', 1),
(11462, 202506, 'ENERGY', 75, 75, 3297, '2026-01-25', 26, 'MR001-1-20250303_125319.jpg', 'C', 3271, '2026-01-25', 1),
(11463, 202506, 'ENERGY', 76, 76, 5329, '2026-01-25', 41, 'MR001-1-20250303_125319.jpg', 'C', 5288, '2026-01-25', 1),
(11464, 202506, 'ENERGY', 77, 77, 4290, '2026-01-25', 26, 'MR001-1-20250303_125319.jpg', 'C', 4264, '2026-01-25', 1),
(11465, 202506, 'ENERGY', 78, 78, 651, '2026-01-25', 8, 'MR001-1-20250303_125319.jpg', 'C', 643, '2026-01-25', 1),
(11466, 202506, 'ENERGY', 79, 79, 45396, '2026-01-25', 10, 'MR001-1-20250303_125319.jpg', 'C', 45386, '2026-01-25', 1),
(11467, 202506, 'ENERGY', 80, 80, 356, '2026-01-25', 27, 'MR001-1-20250303_125319.jpg', 'C', 329, '2026-01-25', 1),
(11468, 202506, 'ENERGY', 81, 81, 3367, '2026-01-25', 5, 'MR001-1-20250303_125319.jpg', 'C', 3362, '2026-01-25', 1),
(11469, 202506, 'ENERGY', 82, 82, 14081, '2026-01-25', 44, 'MR001-1-20250303_125319.jpg', 'C', 14037, '2026-01-25', 1),
(11470, 202506, 'ENERGY', 83, 83, 297, '2026-01-25', 5, 'MR001-1-20250303_125319.jpg', 'C', 292, '2026-01-25', 1),
(11471, 202506, 'ENERGY', 84, 84, 2497, '2026-01-25', 42, 'MR001-1-20250303_125319.jpg', 'C', 2455, '2026-01-25', 1),
(11472, 202506, 'ENERGY', 85, 85, 431, '2026-01-25', 43, 'MR001-1-20250303_125319.jpg', 'C', 388, '2026-01-25', 1),
(11473, 202506, 'ENERGY', 86, 86, 229, '2026-01-25', 39, 'MR001-1-20250303_125319.jpg', 'C', 190, '2026-01-25', 1);

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

--
-- Table structure for table `unit_assignments`
--

CREATE TABLE `unit_assignments` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `customer_id` int(10) UNSIGNED NOT NULL,
  `unit_id` int(10) UNSIGNED NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date DEFAULT NULL,
  `status` enum('active','terminated','transferred') NOT NULL DEFAULT 'active',
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Tracks customer unit assignments with status';

--
-- Dumping data for table `unit_assignments`
--

INSERT INTO `unit_assignments` (`id`, `customer_id`, `unit_id`, `start_date`, `end_date`, `status`, `notes`, `created_at`, `updated_at`) VALUES
(1, 1, 1, '2026-01-28', '2027-02-01', 'active', 'New Tenant', '2026-01-28 02:40:06', '2026-01-28 02:40:06');

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

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

CREATE TABLE `users` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `CompanyID` int(10) UNSIGNED DEFAULT NULL,
  `PropID` int(10) UNSIGNED DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(255) NOT NULL,
  `remember_token` varchar(100) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `users` (`id`, `CompanyID`, `PropID`, `name`, `email`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, 1, 1, 'Sulis Ea', 'sulisdeveloper@gmail.com', NULL, '$2y$12$jcZCwo8harJA1o7MI8Tnrut98EYyBYJPv493Udq9ovj04acvqI9rq', NULL, '2026-01-23 11:38:22', '2026-01-23 11:38:22');

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

--
-- Stand-in structure for view `view_bill_anom`
-- (See below for the actual view)
--
CREATE TABLE `view_bill_anom` (
`BillNo` int(10) unsigned
,`BillMonth` varchar(20)
,`BillingPeriod` int(11)
,`BillingDate` date
,`CurReading` int(11)
,`PrvReading` int(11)
,`BalanceBF` decimal(19,4)
,`TotalBill` decimal(19,4)
,`TotalPayments` decimal(19,4)
,`BalanceCF` decimal(19,4)
,`ConsumptionBilled` int(11)
,`AccountNo` varchar(20)
,`CustomerName` varchar(100)
,`EMeterNo` varchar(20)
,`DueDate` date
,`Address1` varchar(60)
,`AnomType` varchar(24)
);

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

--
-- Stand-in structure for view `view_bill_courts`
-- (See below for the actual view)
--
CREATE TABLE `view_bill_courts` (
`BillMonth` varchar(20)
,`BillingPeriod` int(11)
,`BillingDate` date
,`CustomerName` varchar(100)
,`AddressLine` varchar(60)
,`DueDate` date
,`PropName` varchar(60)
,`BulkInvoiceID` int(10) unsigned
,`Court` varchar(60)
,`CourtID` varchar(3)
,`ClientCode` varchar(100)
,`ConsumptionBilled` decimal(32,0)
,`BalanceBF` int(1)
,`TotalPayments` int(1)
,`TotalBill` decimal(41,4)
,`BalanceCF` decimal(41,4)
,`BillNo` varchar(112)
,`NoOfBills` bigint(21)
,`TenantName` varchar(50)
);

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

--
-- Stand-in structure for view `view_bill_print`
-- (See below for the actual view)
--
CREATE TABLE `view_bill_print` (
`BillNo` int(10) unsigned
,`BillMonth` varchar(20)
,`BillingPeriod` int(11)
,`BillingDate` date
,`CurReading` int(11)
,`PrvReading` int(11)
,`BalanceBF` decimal(19,4)
,`TotalBill` decimal(19,4)
,`TotalPayments` decimal(19,4)
,`BalanceCF` decimal(19,4)
,`ConsumptionBilled` int(11)
,`AccountNo` varchar(20)
,`CustomerName` varchar(100)
,`EMeterNo` varchar(20)
,`DueDate` date
,`PropName` varchar(60)
,`ShopNo` varchar(20)
,`BulkInvoiceID` int(10) unsigned
,`CurReadingDate` date
,`PrvReadingDate` date
,`Court` varchar(60)
,`Floor` varchar(60)
,`Suite` varchar(60)
,`AddressLine` varchar(200)
,`Suffix` varchar(60)
,`CourtID` varchar(3)
);

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

--
-- Stand-in structure for view `view_bill_print2`
-- (See below for the actual view)
--
CREATE TABLE `view_bill_print2` (
`BillNo` int(10) unsigned
,`BillMonth` varchar(20)
,`BillingPeriod` int(11)
,`BillingDate` date
,`BalanceBF` decimal(19,4)
,`TotalBill` decimal(19,4)
,`TotalPayments` decimal(19,4)
,`BalanceCF` decimal(19,4)
,`ConsumptionBilled` int(11)
,`AccountNo` varchar(20)
,`CustomerName` varchar(100)
,`EMeterNo` varchar(20)
,`DueDate` date
,`PropName` varchar(60)
,`ShopNo` varchar(20)
,`BulkInvoiceID` int(10) unsigned
,`VATABLE` decimal(41,4)
,`NONVATABLE` decimal(41,4)
,`VATAmount` decimal(41,4)
,`Address1` varchar(60)
);

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

--
-- Stand-in structure for view `view_bill_print_ex`
-- (See below for the actual view)
--
CREATE TABLE `view_bill_print_ex` (
`BillNo` int(10) unsigned
,`BillMonth` varchar(20)
,`BillingPeriod` int(11)
,`BillingDate` date
,`CurReading` int(11)
,`PrvReading` int(11)
,`BalanceBF` int(1)
,`TotalBill` decimal(19,4)
,`TotalPayments` decimal(19,4)
,`BalanceCF` decimal(19,4)
,`ConsumptionBilled` int(11)
,`AccountNo` varchar(20)
,`CustomerName` varchar(100)
,`EMeterNo` varchar(20)
,`DueDate` date
,`PropName` varchar(60)
,`ShopNo` varchar(20)
,`BulkInvoiceID` int(10) unsigned
,`CurReadingDate` date
,`PrvReadingDate` date
,`Court` varchar(60)
,`Floor` varchar(60)
,`Suite` varchar(60)
,`AddressLine` varchar(200)
,`Suffix` varchar(60)
,`CourtID` varchar(3)
,`TenantName` varchar(50)
);

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

--
-- Stand-in structure for view `view_bill_summ1`
-- (See below for the actual view)
--
CREATE TABLE `view_bill_summ1` (
`BillNo` int(10) unsigned
,`CustomerName` varchar(100)
,`BillMonth` varchar(20)
,`BillingPeriod` int(11)
,`BLineDesc` varchar(64)
,`Amount` decimal(19,4)
);

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

--
-- Stand-in structure for view `view_bill_summ1b`
-- (See below for the actual view)
--
CREATE TABLE `view_bill_summ1b` (
`BillNo` int(10) unsigned
,`CustomerName` varchar(163)
,`BillMonth` varchar(20)
,`BillingPeriod` int(11)
,`BLineDesc` varchar(64)
,`Amount` decimal(19,4)
);

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

--
-- Stand-in structure for view `view_bill_summ2`
-- (See below for the actual view)
--
CREATE TABLE `view_bill_summ2` (
`BillMonth` varchar(20)
,`BillingPeriod` int(11)
,`BLineDesc` varchar(64)
,`Amount` decimal(42,4)
,`BulkInvoiceID` int(10) unsigned
,`CustomerName` varchar(61)
,`LineType` varchar(6)
);

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

--
-- Stand-in structure for view `view_bill_summ3`
-- (See below for the actual view)
--
CREATE TABLE `view_bill_summ3` (
`BillMonth` varchar(20)
,`BillingPeriod` int(11)
,`BLineDesc` varchar(64)
,`Amount` decimal(42,4)
,`BulkInvoiceID` int(10) unsigned
,`CustomerName` varchar(61)
,`LineType` varchar(6)
);

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

--
-- Stand-in structure for view `view_customer_avg`
-- (See below for the actual view)
--
CREATE TABLE `view_customer_avg` (
`CustomerID` int(10) unsigned
,`AvgCons` decimal(14,4)
,`AVG_QRY` varbinary(77)
);

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

--
-- Stand-in structure for view `view_cust_details`
-- (See below for the actual view)
--
CREATE TABLE `view_cust_details` (
`CompanyID` int(10) unsigned
,`CompanyName` varchar(50)
,`CustomerID` int(10) unsigned
,`CustomerName` varchar(100)
,`AccountNo` varchar(20)
,`UnitIdentity` varchar(20)
,`AccountStatus` char(1)
,`CustData` varchar(444)
,`AddressLine` varchar(200)
);

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

--
-- Stand-in structure for view `view_invoice_summ`
-- (See below for the actual view)
--
CREATE TABLE `view_invoice_summ` (
`BillingPeriod` int(11)
,`CompanyName` varchar(50)
,`PropName` varchar(60)
,`Nbr` bigint(21)
);

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

--
-- Stand-in structure for view `view_new_payments`
-- (See below for the actual view)
--
CREATE TABLE `view_new_payments` (
`CustomerID` decimal(10,0)
,`CustomerName` varchar(100)
,`Email` varchar(200)
,`AccountBalance` decimal(19,4)
);

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

--
-- Stand-in structure for view `view_period_to_bill`
-- (See below for the actual view)
--
CREATE TABLE `view_period_to_bill` (
`BulkInvoiceID` int(10) unsigned
,`CompanyName` varchar(50)
,`BillMonth` varchar(20)
,`BillingPeriod` int(11)
,`CompanyID` int(10) unsigned
,`BillNbr` bigint(21)
);

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

--
-- Stand-in structure for view `view_reading_sheet`
-- (See below for the actual view)
--
CREATE TABLE `view_reading_sheet` (
`ID` int(10) unsigned
,`Tenant` varchar(100)
,`ShopNo` varchar(20)
,`MeterNo` varchar(20)
);

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

--
-- Stand-in structure for view `view_statement`
-- (See below for the actual view)
--
CREATE TABLE `view_statement` (
`AccountNo` varchar(20)
,`CustomerName` varchar(100)
,`MeterNo` varchar(20)
,`AptNo` varchar(20)
,`BillNo` int(10) unsigned
,`Period` varchar(20)
,`Billing Date` date
,`Current Reading` int(11)
,`Previous Reading` int(11)
,`Cons (m3)` int(11)
,`Balance B/F` decimal(19,4)
,`Payments` decimal(19,4)
,`Bill Amount` decimal(19,4)
,`Balance C/F` decimal(19,4)
,`PropName` varchar(60)
,`AddressLine` varchar(200)
);

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

--
-- Stand-in structure for view `view_tmp_summ1`
-- (See below for the actual view)
--
CREATE TABLE `view_tmp_summ1` (
`BillNo` int(10) unsigned
,`CustomerName` varchar(100)
,`BillMonth` varchar(20)
,`BillingPeriod` int(11)
,`BLineDesc` varchar(18)
,`Amount` decimal(20,4)
);

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

--
-- Structure for view `view_bill_anom`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_bill_anom`  AS SELECT `b`.`BillID` AS `BillNo`, `fn_BillingMonthEx`(`b`.`BillingPeriod`) AS `BillMonth`, `b`.`BillingPeriod` AS `BillingPeriod`, `b`.`BillingDate` AS `BillingDate`, `b`.`CurReading` AS `CurReading`, `b`.`PrvReading` AS `PrvReading`, `b`.`BalanceBF` AS `BalanceBF`, `b`.`TotalBill` AS `TotalBill`, `b`.`TotalPayments` AS `TotalPayments`, `b`.`BalanceCF` AS `BalanceCF`, `b`.`ConsumptionBilled` AS `ConsumptionBilled`, `c`.`AccountNo` AS `AccountNo`, `c`.`CustomerName` AS `CustomerName`, `c`.`EMeterNo` AS `EMeterNo`, `b`.`DueDate` AS `DueDate`, `c`.`Address1` AS `Address1`, 'Negative Consumption' AS `AnomType` FROM (`bill` `b` join `customer` `c` on(`b`.`CustomerID` = `c`.`CustomerID`)) WHERE `b`.`ConsumptionBilled` < 0unionselect `b`.`BillID` AS `BillNo`,`fn_BillingMonthEx`(`b`.`BillingPeriod`) AS `BillMonth`,`b`.`BillingPeriod` AS `BillingPeriod`,`b`.`BillingDate` AS `BillingDate`,`b`.`CurReading` AS `CurReading`,`b`.`PrvReading` AS `PrvReading`,`b`.`BalanceBF` AS `BalanceBF`,`b`.`TotalBill` AS `TotalBill`,`b`.`TotalPayments` AS `TotalPayments`,`b`.`BalanceCF` AS `BalanceCF`,`b`.`ConsumptionBilled` AS `ConsumptionBilled`,`c`.`AccountNo` AS `AccountNo`,`c`.`CustomerName` AS `CustomerName`,`c`.`EMeterNo` AS `EMeterNo`,`b`.`DueDate` AS `DueDate`,`c`.`Address1` AS `Address1`,'Invalid Previous Reading' AS `AnomType` from (`bill` `b` join `customer` `c` on(`b`.`CustomerID` = `c`.`CustomerID`)) where `b`.`PrvReading` = -1 union select `b`.`BillID` AS `BillNo`,`fn_BillingMonthEx`(`b`.`BillingPeriod`) AS `BillMonth`,`b`.`BillingPeriod` AS `BillingPeriod`,`b`.`BillingDate` AS `BillingDate`,`b`.`CurReading` AS `CurReading`,`b`.`PrvReading` AS `PrvReading`,`b`.`BalanceBF` AS `BalanceBF`,`b`.`TotalBill` AS `TotalBill`,`b`.`TotalPayments` AS `TotalPayments`,`b`.`BalanceCF` AS `BalanceCF`,`b`.`ConsumptionBilled` AS `ConsumptionBilled`,`c`.`AccountNo` AS `AccountNo`,`c`.`CustomerName` AS `CustomerName`,`c`.`EMeterNo` AS `EMeterNo`,`b`.`DueDate` AS `DueDate`,`c`.`Address1` AS `Address1`,'Abnormal Consumption' AS `AnomType` from (`bill` `b` join `customer` `c` on(`b`.`CustomerID` = `c`.`CustomerID`)) where `b`.`ConsumptionBilled` > `c`.`EAvgCons` * 3 and `c`.`EAvgCons` <> 0  ;

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

--
-- Structure for view `view_bill_courts`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_bill_courts`  AS SELECT `fn_BillingMonthEx`(`b`.`BillingPeriod`) AS `BillMonth`, `b`.`BillingPeriod` AS `BillingPeriod`, `b`.`BillingDate` AS `BillingDate`, `c`.`CustomerName` AS `CustomerName`, `c`.`Address1` AS `AddressLine`, `b`.`DueDate` AS `DueDate`, `p`.`PropName` AS `PropName`, `b`.`BulkInvoiceID` AS `BulkInvoiceID`, `c`.`Address1` AS `Court`, left(`c`.`Address3`,3) AS `CourtID`, `c`.`ClientCode` AS `ClientCode`, sum(`b`.`ConsumptionBilled`) AS `ConsumptionBilled`, 0 AS `BalanceBF`, 0 AS `TotalPayments`, sum(`b`.`TotalBill`) AS `TotalBill`, sum(`b`.`TotalBill`) AS `BalanceCF`, concat(`c`.`ClientCode`,'_',`b`.`BillingPeriod`) AS `BillNo`, count(0) AS `NoOfBills`, `c`.`TenantName` AS `TenantName` FROM (((`bill` `b` join `customer` `c` on(`b`.`CustomerID` = `c`.`CustomerID`)) join `prounits` `pu` on(`c`.`UnitID` = `pu`.`UnitID`)) join `property` `p` on(`pu`.`PropID` = `p`.`PropID`)) GROUP BY `fn_BillingMonthEx`(`b`.`BillingPeriod`), `b`.`BillingPeriod`, `b`.`BillingDate`, `c`.`CustomerName`, `c`.`Address1`, `b`.`DueDate`, `p`.`PropName`, `b`.`BulkInvoiceID`, left(`c`.`Address3`,3), `c`.`ClientCode`, `c`.`TenantName` ;

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

--
-- Structure for view `view_bill_print`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_bill_print`  AS SELECT `b`.`BillID` AS `BillNo`, `fn_BillingMonthEx`(`b`.`BillingPeriod`) AS `BillMonth`, `b`.`BillingPeriod` AS `BillingPeriod`, `b`.`BillingDate` AS `BillingDate`, `b`.`CurReading` AS `CurReading`, `b`.`PrvReading` AS `PrvReading`, `b`.`BalanceBF` AS `BalanceBF`, `b`.`TotalBill` AS `TotalBill`, `b`.`TotalPayments` AS `TotalPayments`, `b`.`BalanceCF` AS `BalanceCF`, `b`.`ConsumptionBilled` AS `ConsumptionBilled`, `c`.`AccountNo` AS `AccountNo`, `c`.`CustomerName` AS `CustomerName`, `c`.`EMeterNo` AS `EMeterNo`, `b`.`DueDate` AS `DueDate`, `p`.`PropName` AS `PropName`, `pu`.`UnitIdentity` AS `ShopNo`, `b`.`BulkInvoiceID` AS `BulkInvoiceID`, `b`.`CurReadingDate` AS `CurReadingDate`, `b`.`PrvReadingDate` AS `PrvReadingDate`, `c`.`Address1` AS `Court`, `c`.`Address2` AS `Floor`, `c`.`TelNo` AS `Suite`, `c`.`AddressLine` AS `AddressLine`, `c`.`Address3` AS `Suffix`, left(`c`.`Address3`,3) AS `CourtID` FROM (((`bill` `b` join `customer` `c` on(`b`.`CustomerID` = `c`.`CustomerID`)) join `prounits` `pu` on(`c`.`UnitID` = `pu`.`UnitID`)) join `property` `p` on(`pu`.`PropID` = `p`.`PropID`)) ;

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

--
-- Structure for view `view_bill_print2`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_bill_print2`  AS SELECT `b`.`BillNo` AS `BillNo`, `b`.`BillMonth` AS `BillMonth`, `b`.`BillingPeriod` AS `BillingPeriod`, `b`.`BillingDate` AS `BillingDate`, `b`.`BalanceBF` AS `BalanceBF`, `b`.`TotalBill` AS `TotalBill`, `b`.`TotalPayments` AS `TotalPayments`, `b`.`BalanceCF` AS `BalanceCF`, `b`.`ConsumptionBilled` AS `ConsumptionBilled`, `b`.`AccountNo` AS `AccountNo`, `b`.`CustomerName` AS `CustomerName`, `b`.`EMeterNo` AS `EMeterNo`, `b`.`DueDate` AS `DueDate`, `b`.`PropName` AS `PropName`, `b`.`ShopNo` AS `ShopNo`, `b`.`BulkInvoiceID` AS `BulkInvoiceID`, sum(`b`.`VATABLE`) AS `VATABLE`, sum(`b`.`NONVATABLE`) AS `NONVATABLE`, sum(`b`.`VATAmount`) AS `VATAmount`, `b`.`Address1` AS `Address1` FROM (select `b`.`BillID` AS `BillNo`,`fn_BillingMonthEx`(`b`.`BillingPeriod`) AS `BillMonth`,`b`.`BillingPeriod` AS `BillingPeriod`,`b`.`BillingDate` AS `BillingDate`,`b`.`BalanceBF` AS `BalanceBF`,`b`.`TotalBill` AS `TotalBill`,`b`.`TotalPayments` AS `TotalPayments`,`b`.`BalanceCF` AS `BalanceCF`,`b`.`ConsumptionBilled` AS `ConsumptionBilled`,`c`.`AccountNo` AS `AccountNo`,`c`.`CustomerName` AS `CustomerName`,`c`.`EMeterNo` AS `EMeterNo`,`b`.`DueDate` AS `DueDate`,`p`.`PropName` AS `PropName`,`pu`.`UnitIdentity` AS `ShopNo`,`b`.`BulkInvoiceID` AS `BulkInvoiceID`,case when `tl`.`TLineTaxID` = 1 then `bl`.`BLineAmount` else 0 end AS `VATABLE`,case when `tl`.`TLineTaxID` is null then `bl`.`BLineAmount` else 0 end AS `NONVATABLE`,0 AS `VATAmount`,`c`.`Address1` AS `Address1` from (((((`bill` `b` join `customer` `c` on(`b`.`CustomerID` = `c`.`CustomerID`)) join `prounits` `pu` on(`c`.`UnitID` = `pu`.`UnitID`)) join `property` `p` on(`pu`.`PropID` = `p`.`PropID`)) join `billline` `bl` on(`b`.`BillID` = `bl`.`BillID`)) join `tariffline` `tl` on(`bl`.`BLineTLineID` = `tl`.`TLineID` and `bl`.`BLineCategID` = `tl`.`CategoryID` and `p`.`CompanyID` = `tl`.`CompanyID`)) where `bl`.`BLineTLineID` <> 'VAT' union all select `b`.`BillID` AS `BillNo`,`fn_BillingMonthEx`(`b`.`BillingPeriod`) AS `BillMonth`,`b`.`BillingPeriod` AS `BillingPeriod`,`b`.`BillingDate` AS `BillingDate`,`b`.`BalanceBF` AS `BalanceBF`,`b`.`TotalBill` AS `TotalBill`,`b`.`TotalPayments` AS `TotalPayments`,`b`.`BalanceCF` AS `BalanceCF`,`b`.`ConsumptionBilled` AS `ConsumptionBilled`,`c`.`AccountNo` AS `AccountNo`,`c`.`CustomerName` AS `CustomerName`,`c`.`EMeterNo` AS `EMeterNo`,`b`.`DueDate` AS `DueDate`,`p`.`PropName` AS `PropName`,`pu`.`UnitIdentity` AS `ShopNo`,`b`.`BulkInvoiceID` AS `BulkInvoiceID`,0 AS `VATABLE`,0 AS `NONVATABLE`,`bl`.`BLineAmount` AS `VATAmount`,`c`.`Address1` AS `Address1` from (((((`bill` `b` join `customer` `c` on(`b`.`CustomerID` = `c`.`CustomerID`)) join `prounits` `pu` on(`c`.`UnitID` = `pu`.`UnitID`)) join `property` `p` on(`pu`.`PropID` = `p`.`PropID`)) join `billline` `bl` on(`b`.`BillID` = `bl`.`BillID`)) join `tariffline` `tl` on(`bl`.`BLineTLineID` = `tl`.`TLineID` and `bl`.`BLineCategID` = `tl`.`CategoryID` and `p`.`CompanyID` = `tl`.`CompanyID`)) where `bl`.`BLineTLineID` = 'VAT') AS `b` GROUP BY `b`.`BillNo`, `b`.`BillMonth`, `b`.`BillingPeriod`, `b`.`BillingDate`, `b`.`BalanceBF`, `b`.`TotalBill`, `b`.`TotalPayments`, `b`.`BalanceCF`, `b`.`ConsumptionBilled`, `b`.`AccountNo`, `b`.`CustomerName`, `b`.`EMeterNo`, `b`.`DueDate`, `b`.`PropName`, `b`.`ShopNo`, `b`.`BulkInvoiceID`, `b`.`Address1` ;

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

--
-- Structure for view `view_bill_print_ex`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_bill_print_ex`  AS SELECT `b`.`BillID` AS `BillNo`, `fn_BillingMonthEx`(`b`.`BillingPeriod`) AS `BillMonth`, `b`.`BillingPeriod` AS `BillingPeriod`, `b`.`BillingDate` AS `BillingDate`, `b`.`CurReading` AS `CurReading`, `b`.`PrvReading` AS `PrvReading`, 0 AS `BalanceBF`, `b`.`TotalBill` AS `TotalBill`, `b`.`TotalPayments` AS `TotalPayments`, `b`.`TotalBill` AS `BalanceCF`, `b`.`ConsumptionBilled` AS `ConsumptionBilled`, `c`.`AccountNo` AS `AccountNo`, `c`.`CustomerName` AS `CustomerName`, `c`.`EMeterNo` AS `EMeterNo`, `b`.`DueDate` AS `DueDate`, `p`.`PropName` AS `PropName`, `pu`.`UnitIdentity` AS `ShopNo`, `b`.`BulkInvoiceID` AS `BulkInvoiceID`, `b`.`CurReadingDate` AS `CurReadingDate`, `b`.`PrvReadingDate` AS `PrvReadingDate`, `c`.`Address1` AS `Court`, `c`.`Address2` AS `Floor`, `c`.`TelNo` AS `Suite`, `c`.`AddressLine` AS `AddressLine`, `c`.`Address3` AS `Suffix`, left(`c`.`Address3`,3) AS `CourtID`, `c`.`TenantName` AS `TenantName` FROM (((`bill` `b` join `customer` `c` on(`b`.`CustomerID` = `c`.`CustomerID`)) join `prounits` `pu` on(`c`.`UnitID` = `pu`.`UnitID`)) join `property` `p` on(`pu`.`PropID` = `p`.`PropID`)) ;

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

--
-- Structure for view `view_bill_summ1`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_bill_summ1`  AS SELECT `b`.`BillID` AS `BillNo`, `c`.`CustomerName` AS `CustomerName`, `fn_BillingMonthEx`(`b`.`BillingPeriod`) AS `BillMonth`, `b`.`BillingPeriod` AS `BillingPeriod`, concat(lpad(`bl`.`BLineID`,2,'0'),'. ',`bl`.`BLineDesc`) AS `BLineDesc`, `bl`.`BLineAmount` AS `Amount` FROM ((`bill` `b` join `customer` `c` on(`b`.`CustomerID` = `c`.`CustomerID`)) join `billline` `bl` on(`b`.`BillID` = `bl`.`BillID`)) ;

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

--
-- Structure for view `view_bill_summ1b`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_bill_summ1b`  AS SELECT `b`.`BillID` AS `BillNo`, concat(`c`.`Address1`,' - ',`c`.`CustomerName`) AS `CustomerName`, `fn_BillingMonthEx`(`b`.`BillingPeriod`) AS `BillMonth`, `b`.`BillingPeriod` AS `BillingPeriod`, concat(lpad(`bl`.`BLineID`,2,'0'),'. ',`bl`.`BLineDesc`) AS `BLineDesc`, `bl`.`BLineAmount` AS `Amount` FROM ((`bill` `b` join `customer` `c` on(`b`.`CustomerID` = `c`.`CustomerID`)) join `billline` `bl` on(`b`.`BillID` = `bl`.`BillID`)) ;

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

--
-- Structure for view `view_bill_summ2`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_bill_summ2`  AS SELECT cast(`fn_BillingMonthEx`(`b`.`BillingPeriod`) as char charset utf8mb4) FROM ((`bill` `b` join `customer` `c` on(`b`.`CustomerID` = `c`.`CustomerID`)) join `billline` `bl` on(`b`.`BillID` = `bl`.`BillID`)) GROUP BY `fn_BillingMonthEx`(`b`.`BillingPeriod`), `b`.`BillingPeriod`, concat(lpad(`bl`.`BLineID`,2,'0'),'. ',`bl`.`BLineDesc`), `b`.`BulkInvoiceID`, concat('Total Billing - ',`fn_BillingMonthEx`(`b`.`BillingPeriod`))union all select cast(`fn_BillingMonthEx`(`b`.`BillingPeriod`) as char charset utf8mb4) collate utf8mb4_unicode_ci AS `BillMonth`,`b`.`BillingPeriod` AS `BillingPeriod`,cast(concat(lpad(`tl`.`TLinePriority`,2,'0'),'. ',`bl`.`BulkLineDesc`) as char charset utf8mb4) collate utf8mb4_unicode_ci AS `BLineDesc`,`bl`.`BulkLineAmount` AS `Amount`,`b`.`BulkInvoiceID` AS `BulkInvoiceID`,cast(concat('KPLC Bill  ',`b`.`InvoiceNo`) as char charset utf8mb4) collate utf8mb4_unicode_ci AS `CustomerName`,cast('Kshs. ' as char charset utf8mb4) collate utf8mb4_unicode_ci AS `LineType` from ((`bulkinvoiceline` `bl` join `tariffline` `tl` on(`bl`.`BulkCategID` = `tl`.`CategoryID` and `bl`.`BulkLineID` = `tl`.`TLineID`)) join `bulkinvoice` `b` on(`bl`.`BulkInvoiceID` = `b`.`BulkInvoiceID`)) where `bl`.`BulkLineAmount` <> 0 union all select cast(`fn_BillingMonthEx`(`b`.`BillingPeriod`) as char charset utf8mb4) collate utf8mb4_unicode_ci AS `BillMonth`,`b`.`BillingPeriod` AS `BillingPeriod`,cast(' Cons. (Kwh) ' as char charset utf8mb4) collate utf8mb4_unicode_ci AS `BLineDesc`,sum(0 - `b`.`ConsumptionBilled`) AS `Amount`,`b`.`BulkInvoiceID` AS `BulkInvoiceID`,cast(concat('Total Billing - ',`fn_BillingMonthEx`(`b`.`BillingPeriod`)) as char charset utf8mb4) collate utf8mb4_unicode_ci AS `CustomerName`,cast('Kwh ' as char charset utf8mb4) collate utf8mb4_unicode_ci AS `LineType` from (`bill` `b` join `customer` `c` on(`b`.`CustomerID` = `c`.`CustomerID`)) group by `fn_BillingMonthEx`(`b`.`BillingPeriod`),`b`.`BillingPeriod`,`b`.`BulkInvoiceID`,concat('Total Billing - ',`fn_BillingMonthEx`(`b`.`BillingPeriod`)) union all select cast(`fn_BillingMonthEx`(`b`.`BillingPeriod`) as char charset utf8mb4) collate utf8mb4_unicode_ci AS `BillMonth`,`b`.`BillingPeriod` AS `BillingPeriod`,cast(' Cons. (Kwh) ' as char charset utf8mb4) collate utf8mb4_unicode_ci AS `BLineDesc`,`b`.`Consumption` AS `Amount`,`b`.`BulkInvoiceID` AS `BulkInvoiceID`,cast(concat('KPLC Bill  ',`b`.`InvoiceNo`) as char charset utf8mb4) collate utf8mb4_unicode_ci AS `CustomerName`,cast('Kwh ' as char charset utf8mb4) collate utf8mb4_unicode_ci AS `LineType` from `bulkinvoice` `b`  ;

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

--
-- Structure for view `view_bill_summ3`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_bill_summ3`  AS SELECT cast(`fn_BillingMonthEx`(`b`.`BillingPeriod`) as char charset utf8mb4) FROM ((`bill` `b` join `customer` `c` on(`b`.`CustomerID` = `c`.`CustomerID`)) join `billline` `bl` on(`b`.`BillID` = `bl`.`BillID`)) WHERE `bl`.`BLineID` not between 2 and 6 GROUP BY `fn_BillingMonthEx`(`b`.`BillingPeriod`), `b`.`BillingPeriod`, concat(lpad(`bl`.`BLineID`,2,'0'),'. ',`bl`.`BLineDesc`), `b`.`BulkInvoiceID`, concat('Total Billing - ',`fn_BillingMonthEx`(`b`.`BillingPeriod`))union all select cast(`fn_BillingMonthEx`(`b`.`BillingPeriod`) as char charset utf8mb4) collate utf8mb4_unicode_ci AS `BillMonth`,`b`.`BillingPeriod` AS `BillingPeriod`,cast(concat(lpad(`bl`.`BLineID`,2,'0'),'. ',`bl`.`BLineDesc`) as char charset utf8mb4) collate utf8mb4_unicode_ci AS `BLineDesc`,sum(0 - `bl`.`BLineAmount`) AS `Amount`,`b`.`BulkInvoiceID` AS `BulkInvoiceID`,cast(concat('Total Billing - ',`fn_BillingMonthEx`(`b`.`BillingPeriod`)) as char charset utf8mb4) collate utf8mb4_unicode_ci AS `CustomerName`,cast('Kshs. ' as char charset utf8mb4) collate utf8mb4_unicode_ci AS `LineType` from ((`bill` `b` join `customer` `c` on(`b`.`CustomerID` = `c`.`CustomerID`)) join `billline2` `bl` on(`b`.`BillID` = `bl`.`BillID`)) group by `fn_BillingMonthEx`(`b`.`BillingPeriod`),`b`.`BillingPeriod`,concat(lpad(`bl`.`BLineID`,2,'0'),'. ',`bl`.`BLineDesc`),`b`.`BulkInvoiceID`,concat('Total Billing - ',`fn_BillingMonthEx`(`b`.`BillingPeriod`)) union all select cast(`fn_BillingMonthEx`(`b`.`BillingPeriod`) as char charset utf8mb4) collate utf8mb4_unicode_ci AS `BillMonth`,`b`.`BillingPeriod` AS `BillingPeriod`,cast(concat(lpad(`tl`.`TLinePriority`,2,'0'),'. ',`bl`.`BulkLineDesc`) as char charset utf8mb4) collate utf8mb4_unicode_ci AS `BLineDesc`,`bl`.`BulkLineAmount` AS `Amount`,`b`.`BulkInvoiceID` AS `BulkInvoiceID`,cast(concat('KPLC Bill  ',`b`.`InvoiceNo`) as char charset utf8mb4) collate utf8mb4_unicode_ci AS `CustomerName`,cast('Kshs. ' as char charset utf8mb4) collate utf8mb4_unicode_ci AS `LineType` from ((`bulkinvoiceline` `bl` join `tariffline` `tl` on(`bl`.`BulkCategID` = `tl`.`CategoryID` and `bl`.`BulkLineID` = `tl`.`TLineID`)) join `bulkinvoice` `b` on(`bl`.`BulkInvoiceID` = `b`.`BulkInvoiceID`)) where `bl`.`BulkLineAmount` <> 0 union all select cast(`fn_BillingMonthEx`(`b`.`BillingPeriod`) as char charset utf8mb4) collate utf8mb4_unicode_ci AS `BillMonth`,`b`.`BillingPeriod` AS `BillingPeriod`,cast(' Cons. (Kwh) ' as char charset utf8mb4) collate utf8mb4_unicode_ci AS `BLineDesc`,sum(0 - `b`.`ConsumptionBilled`) AS `Amount`,`b`.`BulkInvoiceID` AS `BulkInvoiceID`,cast(concat('Total Billing - ',`fn_BillingMonthEx`(`b`.`BillingPeriod`)) as char charset utf8mb4) collate utf8mb4_unicode_ci AS `CustomerName`,cast('Kwh ' as char charset utf8mb4) collate utf8mb4_unicode_ci AS `LineType` from (`bill` `b` join `customer` `c` on(`b`.`CustomerID` = `c`.`CustomerID`)) group by `fn_BillingMonthEx`(`b`.`BillingPeriod`),`b`.`BillingPeriod`,`b`.`BulkInvoiceID`,concat('Total Billing - ',`fn_BillingMonthEx`(`b`.`BillingPeriod`)) union all select cast(`fn_BillingMonthEx`(`b`.`BillingPeriod`) as char charset utf8mb4) collate utf8mb4_unicode_ci AS `BillMonth`,`b`.`BillingPeriod` AS `BillingPeriod`,cast(' Cons. (Kwh) ' as char charset utf8mb4) collate utf8mb4_unicode_ci AS `BLineDesc`,`b`.`Consumption` AS `Amount`,`b`.`BulkInvoiceID` AS `BulkInvoiceID`,cast(concat('KPLC Bill  ',`b`.`InvoiceNo`) as char charset utf8mb4) collate utf8mb4_unicode_ci AS `CustomerName`,cast('Kwh ' as char charset utf8mb4) collate utf8mb4_unicode_ci AS `LineType` from `bulkinvoice` `b`  ;

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

--
-- Structure for view `view_customer_avg`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_customer_avg`  AS SELECT `meterreading`.`CustomerID` AS `CustomerID`, avg(`meterreading`.`Consumption`) AS `AvgCons`, concat('UPDATE CUSTOMER SET EAvgCons = ',avg(`meterreading`.`Consumption`),' WHERE CustomerID = ',`meterreading`.`CustomerID`) AS `AVG_QRY` FROM `meterreading` WHERE !(`meterreading`.`BillingPeriod` in (select max(`tmp_meterreading`.`BillingPeriod`) from `tmp_meterreading`)) GROUP BY `meterreading`.`CustomerID` ;

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

--
-- Structure for view `view_cust_details`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_cust_details`  AS SELECT `c`.`CompanyID` AS `CompanyID`, `c`.`CompanyName` AS `CompanyName`, `cm`.`CustomerID` AS `CustomerID`, `cm`.`CustomerName` AS `CustomerName`, `cm`.`AccountNo` AS `AccountNo`, `pu`.`UnitIdentity` AS `UnitIdentity`, `cm`.`AccountStatus` AS `AccountStatus`, concat(`cm`.`CustomerName`,' ',`cm`.`AccountNo`,' ',`pu`.`UnitIdentity`,' ',`pu`.`UnitDesc`,' ',`cm`.`AddressLine`) AS `CustData`, `cm`.`AddressLine` AS `AddressLine` FROM (((`customer` `cm` join `prounits` `pu` on(`cm`.`UnitID` = `pu`.`UnitID`)) join `property` `p` on(`pu`.`PropID` = `p`.`PropID`)) join `company` `c` on(`p`.`CompanyID` = `c`.`CompanyID`)) ;

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

--
-- Structure for view `view_invoice_summ`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_invoice_summ`  AS SELECT `b`.`BillingPeriod` AS `BillingPeriod`, `c`.`CompanyName` AS `CompanyName`, `p`.`PropName` AS `PropName`, count(0) AS `Nbr` FROM (((`bill` `b` join `bulkinvoice` `bl` on(`b`.`BulkInvoiceID` = `bl`.`BulkInvoiceID`)) join `company` `c` on(`bl`.`CompanyID` = `c`.`CompanyID`)) join `property` `p` on(`c`.`CompanyID` = `p`.`CompanyID`)) WHERE `b`.`BillingPeriod` > 201402 AND `b`.`TotalBill` <> 0 GROUP BY `b`.`BillingPeriod`, `c`.`CompanyName`, `p`.`PropName` ORDER BY `b`.`BillingPeriod` DESC, `c`.`CompanyName` ASC, `p`.`PropName` ASC LIMIT 0, 40 ;

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

--
-- Structure for view `view_new_payments`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_new_payments`  AS SELECT `c`.`CustomerID` AS `CustomerID`, `c`.`CustomerName` AS `CustomerName`, `c`.`Email` AS `Email`, `c`.`AccountBalance` AS `AccountBalance` FROM (select `customer`.`CustomerID` AS `CustomerID`,`customer`.`CustomerName` AS `CustomerName`,`customer`.`Email` AS `Email`,`customer`.`AccountBalance` AS `AccountBalance` from `customer` where `customer`.`AccountType` <> 'TERMINATED' union all select 0 AS `CustomerID`,'Clinford Limited' AS `CustomerName`,'Clinford Limited' AS `Email`,-0.65 AS `AccountBalance` union all select 0 AS `CustomerID`,'Blancos Holdings' AS `CustomerName`,'Blancos Holdings' AS `Email`,81730.45 AS `AccountBalance` union all select 0 AS `CustomerID`,'Arcon Consult' AS `CustomerName`,'Arcon Consult' AS `Email`,27.95 AS `AccountBalance` union all select 0 AS `CustomerID`,'Safari Beads' AS `CustomerName`,'Safari Beads' AS `Email`,-528.85 AS `AccountBalance`) AS `c` ORDER BY `c`.`Email` ASC LIMIT 0, 1000 ;

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

--
-- Structure for view `view_period_to_bill`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_period_to_bill`  AS SELECT `bi`.`BulkInvoiceID` AS `BulkInvoiceID`, `c`.`CompanyName` AS `CompanyName`, `mr`.`BillMonth` AS `BillMonth`, `bi`.`BillingPeriod` AS `BillingPeriod`, `bi`.`CompanyID` AS `CompanyID`, (select count(0) from `bill` where `bill`.`BulkInvoiceID` = `bi`.`BulkInvoiceID`) AS `BillNbr` FROM (((select `mr`.`CompanyID` AS `CompanyID`,`mr`.`BillingPeriod` AS `BillingPeriod`,`fn_BillingMonthEx`(`mr`.`BillingPeriod`) AS `BillMonth` from (select `meterreading`.`CompanyID` AS `CompanyID`,max(`meterreading`.`BillingPeriod`) AS `BillingPeriod` from `meterreading` group by `meterreading`.`CompanyID`) `mr`) `mr` join `company` `c` on(`mr`.`CompanyID` = `c`.`CompanyID`)) join `bulkinvoice` `bi` on(`mr`.`CompanyID` = `bi`.`CompanyID` and `mr`.`BillingPeriod` = `bi`.`BillingPeriod`)) ;

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

--
-- Structure for view `view_reading_sheet`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_reading_sheet`  AS SELECT `c`.`CustomerID` AS `ID`, `c`.`CustomerName` AS `Tenant`, `p`.`UnitIdentity` AS `ShopNo`, `c`.`EMeterNo` AS `MeterNo` FROM (`customer` `c` join `prounits` `p` on(`c`.`UnitID` = `p`.`UnitID`)) WHERE `c`.`AccountType` <> 'TERMINATED' ORDER BY `c`.`Address2` ASC LIMIT 0, 200 ;

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

--
-- Structure for view `view_statement`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_statement`  AS SELECT `view_bill_print`.`AccountNo` AS `AccountNo`, `view_bill_print`.`CustomerName` AS `CustomerName`, `view_bill_print`.`EMeterNo` AS `MeterNo`, `view_bill_print`.`ShopNo` AS `AptNo`, `view_bill_print`.`BillNo` AS `BillNo`, `fn_BillingMonthEx2`(`view_bill_print`.`BillingPeriod`) AS `Period`, `view_bill_print`.`BillingDate` AS `Billing Date`, `view_bill_print`.`CurReading` AS `Current Reading`, `view_bill_print`.`PrvReading` AS `Previous Reading`, `view_bill_print`.`ConsumptionBilled` AS `Cons (m3)`, `view_bill_print`.`BalanceBF` AS `Balance B/F`, `view_bill_print`.`TotalPayments` AS `Payments`, `view_bill_print`.`TotalBill` AS `Bill Amount`, `view_bill_print`.`BalanceCF` AS `Balance C/F`, `view_bill_print`.`PropName` AS `PropName`, `view_bill_print`.`AddressLine` AS `AddressLine` FROM `view_bill_print` ;

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

--
-- Structure for view `view_tmp_summ1`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_tmp_summ1`  AS SELECT `b`.`BillID` AS `BillNo`, `c`.`CustomerName` AS `CustomerName`, `fn_BillingMonthEx`(`b`.`BillingPeriod`) AS `BillMonth`, `b`.`BillingPeriod` AS `BillingPeriod`, `tl`.`TLineName` AS `BLineDesc`, `bl`.`BLineAmount` AS `Amount` FROM (((`bill` `b` join `customer` `c` on(`b`.`CustomerID` = `c`.`CustomerID`)) join `billline` `bl` on(`b`.`BillID` = `bl`.`BillID`)) join (select 'L01' AS `TLineID`,'01. Fixed Charge' AS `TLineName` union select 'L02' AS `L02`,'02. Consumption' AS `02. Consumption` union select 'L03' AS `L03`,'03. Fuel Costs' AS `03. Fuel Costs` union select 'L04' AS `L04`,'04. Forex Adj' AS `04. Forex Adj` union select 'L05' AS `L05`,'05. Inflation Adj.' AS `05. Inflation Adj.` union select 'L06' AS `L06`,'06. Max KVA' AS `06. Max KVA` union select 'L07' AS `L07`,'07. ERC Levy' AS `07. ERC Levy` union select 'L08' AS `L08`,'08. REP Levy' AS `08. REP Levy` union select 'L09' AS `L09`,'09. WARMA Levy' AS `09. WARMA Levy` union select 'VAT' AS `VAT`,'10. VAT @ 16%' AS `10. VAT @ 16%`) `tl` on(`bl`.`BLineTLineID` = `tl`.`TLineID`))union all select `b`.`BillID` AS `BillNo`,`c`.`CustomerName` AS `CustomerName`,`fn_BillingMonthEx`(`b`.`BillingPeriod`) AS `BillMonth`,`b`.`BillingPeriod` AS `BillingPeriod`,' Payments' AS `BLineDesc`,0 - `b`.`TotalPayments` AS `Amount` from (`bill` `b` join `customer` `c` on(`b`.`CustomerID` = `c`.`CustomerID`)) union all select `b`.`BillID` AS `BillNo`,`c`.`CustomerName` AS `CustomerName`,`fn_BillingMonthEx`(`b`.`BillingPeriod`) AS `BillMonth`,`b`.`BillingPeriod` AS `BillingPeriod`,' Cons (Kwh)' AS `BLineDesc`,`b`.`ConsumptionBilled` AS `Amount` from (`bill` `b` join `customer` `c` on(`b`.`CustomerID` = `c`.`CustomerID`))  ;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `bill`
--
ALTER TABLE `bill`
  ADD PRIMARY KEY (`BillID`),
  ADD KEY `bill_bulkinvoiceid_foreign` (`BulkInvoiceID`),
  ADD KEY `bill_customerid_foreign` (`CustomerID`),
  ADD KEY `bill_meterreadingid_foreign` (`MeterReadingID`),
  ADD KEY `bill_billtype_foreign` (`BillType`);

--
-- Indexes for table `billingservice`
--
ALTER TABLE `billingservice`
  ADD PRIMARY KEY (`IDService`,`CustomerID`),
  ADD KEY `billingservice_customerid_foreign` (`CustomerID`);

--
-- Indexes for table `billline`
--
ALTER TABLE `billline`
  ADD PRIMARY KEY (`BillID`,`BLineID`);

--
-- Indexes for table `bulkinvoice`
--
ALTER TABLE `bulkinvoice`
  ADD PRIMARY KEY (`BulkInvoiceID`),
  ADD UNIQUE KEY `IX_UK_BulkInvoice` (`CompanyID`,`BillingPeriod`),
  ADD KEY `bulkinvoice_propid_foreign` (`PropID`),
  ADD KEY `bulkinvoice_constype_foreign` (`ConsType`);

--
-- Indexes for table `bulkinvoiceline`
--
ALTER TABLE `bulkinvoiceline`
  ADD PRIMARY KEY (`BulkInvoiceID`,`BulkCategID`,`BulkLineID`);

--
-- Indexes for table `cache`
--
ALTER TABLE `cache`
  ADD PRIMARY KEY (`key`),
  ADD KEY `cache_expiration_index` (`expiration`);

--
-- Indexes for table `cache_locks`
--
ALTER TABLE `cache_locks`
  ADD PRIMARY KEY (`key`),
  ADD KEY `cache_locks_expiration_index` (`expiration`);

--
-- Indexes for table `company`
--
ALTER TABLE `company`
  ADD PRIMARY KEY (`CompanyID`);

--
-- Indexes for table `customer`
--
ALTER TABLE `customer`
  ADD PRIMARY KEY (`CustomerID`),
  ADD KEY `customer_unitid_foreign` (`UnitID`),
  ADD KEY `customer_companyid_foreign` (`CompanyID`);

--
-- Indexes for table `customer_prop_service`
--
ALTER TABLE `customer_prop_service`
  ADD PRIMARY KEY (`CustomerID`,`IDService`);

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

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

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

--
-- Indexes for table `jobs`
--
ALTER TABLE `jobs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `jobs_queue_index` (`queue`);

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

--
-- Indexes for table `meterreading`
--
ALTER TABLE `meterreading`
  ADD PRIMARY KEY (`MeterReadingID`),
  ADD KEY `meterreading_customerid_foreign` (`CustomerID`),
  ADD KEY `meterreading_unitid_foreign` (`UnitID`),
  ADD KEY `meterreading_constype_foreign` (`ConsType`),
  ADD KEY `meterreading_prvreadingid_foreign` (`PrvReadingID`),
  ADD KEY `meterreading_companyid_foreign` (`CompanyID`);

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

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

--
-- Indexes for table `password_reset_tokens`
--
ALTER TABLE `password_reset_tokens`
  ADD PRIMARY KEY (`email`);

--
-- Indexes for table `payment`
--
ALTER TABLE `payment`
  ADD PRIMARY KEY (`PaymentID`),
  ADD KEY `payment_customerid_foreign` (`CustomerID`);

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

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

--
-- Indexes for table `property`
--
ALTER TABLE `property`
  ADD PRIMARY KEY (`PropID`),
  ADD KEY `property_companyid_foreign` (`CompanyID`);

--
-- Indexes for table `propservice`
--
ALTER TABLE `propservice`
  ADD PRIMARY KEY (`IDService`),
  ADD KEY `propservice_companyid_foreign` (`CompanyID`);

--
-- Indexes for table `prounits`
--
ALTER TABLE `prounits`
  ADD PRIMARY KEY (`UnitID`),
  ADD KEY `prounits_propid_foreign` (`PropID`);

--
-- Indexes for table `rentservicebill`
--
ALTER TABLE `rentservicebill`
  ADD PRIMARY KEY (`BillID`);

--
-- Indexes for table `rentservicebillline`
--
ALTER TABLE `rentservicebillline`
  ADD PRIMARY KEY (`BillLineID`),
  ADD KEY `BillID` (`BillID`);

--
-- Indexes for table `sessions`
--
ALTER TABLE `sessions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sessions_user_id_index` (`user_id`),
  ADD KEY `sessions_last_activity_index` (`last_activity`);

--
-- Indexes for table `sp_create_emeter_reading_log`
--
ALTER TABLE `sp_create_emeter_reading_log`
  ADD PRIMARY KEY (`log_id`);

--
-- Indexes for table `sp_create_period`
--
ALTER TABLE `sp_create_period`
  ADD PRIMARY KEY (`LogID`);

--
-- Indexes for table `sp_debug_log`
--
ALTER TABLE `sp_debug_log`
  ADD PRIMARY KEY (`LogID`);

--
-- Indexes for table `tariffcategory`
--
ALTER TABLE `tariffcategory`
  ADD PRIMARY KEY (`CompanyID`,`CategoryID`),
  ADD KEY `tariffcategory_constype_foreign` (`ConsType`);

--
-- Indexes for table `tariffline`
--
ALTER TABLE `tariffline`
  ADD PRIMARY KEY (`CompanyID`,`CategoryID`,`TLineID`),
  ADD KEY `tariffline_tlinecalcmethod_foreign` (`TLineCalcMethod`),
  ADD KEY `tariffline_tlineconstype_foreign` (`TLineConsType`),
  ADD KEY `tariffline_tlinetaxid_foreign` (`TLineTaxID`);

--
-- Indexes for table `tblcalmethod`
--
ALTER TABLE `tblcalmethod`
  ADD PRIMARY KEY (`tID`),
  ADD KEY `tblcalmethod_constype_foreign` (`ConsType`);

--
-- Indexes for table `tblconstype`
--
ALTER TABLE `tblconstype`
  ADD PRIMARY KEY (`tID`);

--
-- Indexes for table `tbltaxes`
--
ALTER TABLE `tbltaxes`
  ADD PRIMARY KEY (`tID`);

--
-- Indexes for table `tmp_bulkinvoiceline`
--
ALTER TABLE `tmp_bulkinvoiceline`
  ADD PRIMARY KEY (`tblID`);

--
-- Indexes for table `tmp_meterreading`
--
ALTER TABLE `tmp_meterreading`
  ADD PRIMARY KEY (`MeterReadingID`),
  ADD KEY `tmp_meterreading_constype_foreign` (`ConsType`);

--
-- Indexes for table `unit_assignments`
--
ALTER TABLE `unit_assignments`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unit_assignments_customer_id_status_unique` (`customer_id`,`status`),
  ADD KEY `unit_assignments_customer_id_index` (`customer_id`),
  ADD KEY `unit_assignments_unit_id_index` (`unit_id`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `users_email_unique` (`email`),
  ADD KEY `users_companyid_foreign` (`CompanyID`),
  ADD KEY `users_propid_foreign` (`PropID`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `bill`
--
ALTER TABLE `bill`
  MODIFY `BillID` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2025050170;

--
-- AUTO_INCREMENT for table `bulkinvoice`
--
ALTER TABLE `bulkinvoice`
  MODIFY `BulkInvoiceID` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=128;

--
-- AUTO_INCREMENT for table `company`
--
ALTER TABLE `company`
  MODIFY `CompanyID` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `customer`
--
ALTER TABLE `customer`
  MODIFY `CustomerID` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=88;

--
-- AUTO_INCREMENT for table `customer_service`
--
ALTER TABLE `customer_service`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `debug_log`
--
ALTER TABLE `debug_log`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=260;

--
-- AUTO_INCREMENT for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=392;

--
-- AUTO_INCREMENT for table `jobs`
--
ALTER TABLE `jobs`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2179;

--
-- AUTO_INCREMENT for table `meterreading`
--
ALTER TABLE `meterreading`
  MODIFY `MeterReadingID` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11519;

--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=40;

--
-- AUTO_INCREMENT for table `notes`
--
ALTER TABLE `notes`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `payment`
--
ALTER TABLE `payment`
  MODIFY `PaymentID` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1154;

--
-- AUTO_INCREMENT for table `payments`
--
ALTER TABLE `payments`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `periods`
--
ALTER TABLE `periods`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `property`
--
ALTER TABLE `property`
  MODIFY `PropID` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `propservice`
--
ALTER TABLE `propservice`
  MODIFY `IDService` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `prounits`
--
ALTER TABLE `prounits`
  MODIFY `UnitID` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=87;

--
-- AUTO_INCREMENT for table `rentservicebillline`
--
ALTER TABLE `rentservicebillline`
  MODIFY `BillLineID` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=252;

--
-- AUTO_INCREMENT for table `sp_create_emeter_reading_log`
--
ALTER TABLE `sp_create_emeter_reading_log`
  MODIFY `log_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `sp_create_period`
--
ALTER TABLE `sp_create_period`
  MODIFY `LogID` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `sp_debug_log`
--
ALTER TABLE `sp_debug_log`
  MODIFY `LogID` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT for table `tbltaxes`
--
ALTER TABLE `tbltaxes`
  MODIFY `tID` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `tmp_bulkinvoiceline`
--
ALTER TABLE `tmp_bulkinvoiceline`
  MODIFY `tblID` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=741;

--
-- AUTO_INCREMENT for table `unit_assignments`
--
ALTER TABLE `unit_assignments`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `bill`
--
ALTER TABLE `bill`
  ADD CONSTRAINT `bill_billtype_foreign` FOREIGN KEY (`BillType`) REFERENCES `tblconstype` (`tID`),
  ADD CONSTRAINT `bill_bulkinvoiceid_foreign` FOREIGN KEY (`BulkInvoiceID`) REFERENCES `bulkinvoice` (`BulkInvoiceID`),
  ADD CONSTRAINT `bill_customerid_foreign` FOREIGN KEY (`CustomerID`) REFERENCES `customer` (`CustomerID`),
  ADD CONSTRAINT `bill_meterreadingid_foreign` FOREIGN KEY (`MeterReadingID`) REFERENCES `meterreading` (`MeterReadingID`);

--
-- Constraints for table `billingservice`
--
ALTER TABLE `billingservice`
  ADD CONSTRAINT `billingservice_customerid_foreign` FOREIGN KEY (`CustomerID`) REFERENCES `customer` (`CustomerID`),
  ADD CONSTRAINT `billingservice_idservice_foreign` FOREIGN KEY (`IDService`) REFERENCES `propservice` (`IDService`);

--
-- Constraints for table `billline`
--
ALTER TABLE `billline`
  ADD CONSTRAINT `billline_billid_foreign` FOREIGN KEY (`BillID`) REFERENCES `bill` (`BillID`);

--
-- Constraints for table `bulkinvoice`
--
ALTER TABLE `bulkinvoice`
  ADD CONSTRAINT `bulkinvoice_companyid_foreign` FOREIGN KEY (`CompanyID`) REFERENCES `company` (`CompanyID`),
  ADD CONSTRAINT `bulkinvoice_constype_foreign` FOREIGN KEY (`ConsType`) REFERENCES `tblconstype` (`tID`),
  ADD CONSTRAINT `bulkinvoice_propid_foreign` FOREIGN KEY (`PropID`) REFERENCES `property` (`PropID`);

--
-- Constraints for table `bulkinvoiceline`
--
ALTER TABLE `bulkinvoiceline`
  ADD CONSTRAINT `bulkinvoiceline_bulkinvoiceid_foreign` FOREIGN KEY (`BulkInvoiceID`) REFERENCES `bulkinvoice` (`BulkInvoiceID`);

--
-- Constraints for table `customer`
--
ALTER TABLE `customer`
  ADD CONSTRAINT `customer_companyid_foreign` FOREIGN KEY (`CompanyID`) REFERENCES `company` (`CompanyID`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_unitid_foreign` FOREIGN KEY (`UnitID`) REFERENCES `prounits` (`UnitID`);

--
-- Constraints for table `meterreading`
--
ALTER TABLE `meterreading`
  ADD CONSTRAINT `meterreading_companyid_foreign` FOREIGN KEY (`CompanyID`) REFERENCES `company` (`CompanyID`),
  ADD CONSTRAINT `meterreading_constype_foreign` FOREIGN KEY (`ConsType`) REFERENCES `tblconstype` (`tID`),
  ADD CONSTRAINT `meterreading_customerid_foreign` FOREIGN KEY (`CustomerID`) REFERENCES `customer` (`CustomerID`),
  ADD CONSTRAINT `meterreading_prvreadingid_foreign` FOREIGN KEY (`PrvReadingID`) REFERENCES `meterreading` (`MeterReadingID`),
  ADD CONSTRAINT `meterreading_unitid_foreign` FOREIGN KEY (`UnitID`) REFERENCES `prounits` (`UnitID`);

--
-- Constraints for table `payment`
--
ALTER TABLE `payment`
  ADD CONSTRAINT `payment_customerid_foreign` FOREIGN KEY (`CustomerID`) REFERENCES `customer` (`CustomerID`);

--
-- Constraints for table `property`
--
ALTER TABLE `property`
  ADD CONSTRAINT `property_companyid_foreign` FOREIGN KEY (`CompanyID`) REFERENCES `company` (`CompanyID`);

--
-- Constraints for table `propservice`
--
ALTER TABLE `propservice`
  ADD CONSTRAINT `propservice_companyid_foreign` FOREIGN KEY (`CompanyID`) REFERENCES `company` (`CompanyID`);

--
-- Constraints for table `prounits`
--
ALTER TABLE `prounits`
  ADD CONSTRAINT `prounits_propid_foreign` FOREIGN KEY (`PropID`) REFERENCES `property` (`PropID`);

--
-- Constraints for table `rentservicebillline`
--
ALTER TABLE `rentservicebillline`
  ADD CONSTRAINT `rentservicebillline_ibfk_1` FOREIGN KEY (`BillID`) REFERENCES `rentservicebill` (`BillID`);

--
-- Constraints for table `tariffcategory`
--
ALTER TABLE `tariffcategory`
  ADD CONSTRAINT `tariffcategory_companyid_foreign` FOREIGN KEY (`CompanyID`) REFERENCES `company` (`CompanyID`),
  ADD CONSTRAINT `tariffcategory_constype_foreign` FOREIGN KEY (`ConsType`) REFERENCES `tblconstype` (`tID`);

--
-- Constraints for table `tariffline`
--
ALTER TABLE `tariffline`
  ADD CONSTRAINT `tariffline_companyid_categoryid_foreign` FOREIGN KEY (`CompanyID`,`CategoryID`) REFERENCES `tariffcategory` (`CompanyID`, `CategoryID`),
  ADD CONSTRAINT `tariffline_tlinecalcmethod_foreign` FOREIGN KEY (`TLineCalcMethod`) REFERENCES `tblcalmethod` (`tID`),
  ADD CONSTRAINT `tariffline_tlineconstype_foreign` FOREIGN KEY (`TLineConsType`) REFERENCES `tblconstype` (`tID`),
  ADD CONSTRAINT `tariffline_tlinetaxid_foreign` FOREIGN KEY (`TLineTaxID`) REFERENCES `tbltaxes` (`tID`);

--
-- Constraints for table `tblcalmethod`
--
ALTER TABLE `tblcalmethod`
  ADD CONSTRAINT `tblcalmethod_constype_foreign` FOREIGN KEY (`ConsType`) REFERENCES `tblconstype` (`tID`);

--
-- Constraints for table `tmp_meterreading`
--
ALTER TABLE `tmp_meterreading`
  ADD CONSTRAINT `tmp_meterreading_constype_foreign` FOREIGN KEY (`ConsType`) REFERENCES `tblconstype` (`tID`);

--
-- Constraints for table `unit_assignments`
--
ALTER TABLE `unit_assignments`
  ADD CONSTRAINT `unit_assignments_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`CustomerID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `unit_assignments_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `prounits` (`UnitID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `users`
--
ALTER TABLE `users`
  ADD CONSTRAINT `users_companyid_foreign` FOREIGN KEY (`CompanyID`) REFERENCES `company` (`CompanyID`) ON DELETE SET NULL,
  ADD CONSTRAINT `users_propid_foreign` FOREIGN KEY (`PropID`) REFERENCES `property` (`PropID`) ON DELETE SET NULL;
COMMIT;

