CREATE TABLE IF NOT EXISTS `qbdata_invoices` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `uuid` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sync_uuid` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `business_entity_id` int NOT NULL,
  `qb_invoice_id` bigint NOT NULL,
  `qb_customer_id` bigint DEFAULT NULL,
  `invoice_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `invoice_date` date DEFAULT NULL,
  `invoice_due_date` date DEFAULT NULL,
  `total_amount` decimal(19,4) DEFAULT NULL,
  `outstanding_amount` decimal(19,4) DEFAULT NULL,
  `currency` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `exchange_rate` decimal(19,4) DEFAULT NULL,
  `homecurr_total_amount` decimal(19,4) DEFAULT NULL,
  `homecurr_outstanding_amount` decimal(19,4) DEFAULT NULL,
  `enc_data_obj` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `download_folder` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `download_filename` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `downloaded_at` timestamp NULL DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0/1 - inactive/active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_by` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `updated_by` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deleted_by` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `qbdata_invoices_business_entity_id_IDX` (`business_entity_id`) USING BTREE,
  KEY `qbdata_invoices_qb_invoice_id_IDX` (`qb_invoice_id`) USING BTREE,
  KEY `qbdata_invoices_status_IDX` (`status`) USING BTREE,
  KEY `qbdata_invoices_qb_customer_id_IDX` (`qb_customer_id`) USING BTREE,
  KEY `qbdata_invoices_uuid_IDX` (`uuid`) USING BTREE,
  CONSTRAINT `qbdata_invoices_company__business_entity_FK` FOREIGN KEY (`business_entity_id`) REFERENCES `spserp_dev`.`company__business_entity` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=19042 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='from qbdata sync';

-- Dumping data for table cpdb.qbdata_invoices: ~168 rows (approximately)
INSERT INTO `qbdata_invoices` (`id`, `uuid`, `sync_uuid`, `business_entity_id`, `qb_invoice_id`, `qb_customer_id`, `invoice_number`, `invoice_date`, `invoice_due_date`, `total_amount`, `outstanding_amount`, `currency`, `exchange_rate`, `homecurr_total_amount`, `homecurr_outstanding_amount`, `enc_data_obj`, `download_folder`, `download_filename`, `downloaded_at`, `status`, `created_at`, `updated_at`, `deleted_at`, `created_by`, `updated_by`, `deleted_by`) VALUES
	(1, '29d3eb36-22b9-41fd-89e6-b267063a27f0', '68a56ff7-54cf-4b3b-9aa8-9a7bd900b42f', 7, 3406, 290, '2808', '2021-12-20', '2021-12-20', 26765.0000, 5765.0000, 'MYR', 1.0000, 26765.0000, 5765.0000, '[encoded data, 11648 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-05-06 17:50:04', NULL, NULL, NULL, NULL),
	(2, '03d24d77-f2f7-405c-81d0-25ea758cb792', 'ec07a63a-6710-4310-bc28-5ca09bbdeb22', 7, 7497, 146, '3319', '2024-03-12', '2024-03-12', 3348.0000, 0.0000, 'MYR', 1.0000, 3348.0000, 0.0000, '[encoded data, 13148 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-01 04:05:16', NULL, NULL, NULL, NULL),
	(3, 'a03c2aa5-4fe6-42e0-a4c4-6c13a0f28fca', '7aa91e1e-7602-47bd-a6e8-b86e99ec3a88', 7, 7559, 129, '3328', '2024-03-27', '2024-03-27', 2916.0000, 0.0000, 'MYR', 1.0000, 2916.0000, NULL, '[encoded data, 11588 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-19 08:45:04', NULL, NULL, NULL, NULL),
	(4, '525bb7c3-19f9-47a1-b8ec-a1facca553ea', '168f6cd8-6953-4957-b2b2-015be56da606', 7, 7558, 134, '3327', '2024-03-27', '2024-03-27', 2322.0000, 0.0000, 'MYR', 1.0000, 2322.0000, NULL, '[encoded data, 12976 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-08 08:00:05', NULL, NULL, NULL, NULL),
	(5, '6e57c9ac-b2e3-446a-be6a-cd772ce9d6dd', '168f6cd8-6953-4957-b2b2-015be56da606', 7, 7557, 315, '3326', '2024-03-27', '2024-03-27', 2322.0000, 0.0000, 'MYR', 1.0000, 2322.0000, NULL, '[encoded data, 12896 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-08 08:00:05', NULL, NULL, NULL, NULL),
	(6, '47ebf288-90ba-49ca-aeb8-065cf1daf011', 'ec07a63a-6710-4310-bc28-5ca09bbdeb22', 7, 7512, 144, '3321', '2024-03-15', '2024-03-15', 3888.0000, 0.0000, 'MYR', 1.0000, 3888.0000, 0.0000, '[encoded data, 13024 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-01 04:05:16', NULL, NULL, NULL, NULL),
	(7, '59a6b64b-f6b5-41d4-bfb5-b79b1043f7ee', '0f133355-b265-41b4-a1f3-64f45632af63', 7, 7103, 279, '3274', '2023-12-08', '2023-12-08', 20140.0000, 0.0000, 'MYR', 1.0000, 20140.0000, NULL, '[encoded data, 14532 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-30 10:15:04', NULL, NULL, NULL, NULL),
	(8, '224097d7-1513-448c-a6b9-2d8f918e72f5', 'ec07a63a-6710-4310-bc28-5ca09bbdeb22', 7, 6987, 105, '3260', '2023-11-09', '2023-11-09', 12296.0000, 0.0000, 'MYR', 1.0000, 12296.0000, 0.0000, '[encoded data, 14504 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-01 04:05:16', NULL, NULL, NULL, NULL),
	(9, 'cbae46bb-82a3-453c-ae75-90c83ff50ea0', 'ec07a63a-6710-4310-bc28-5ca09bbdeb22', 7, 5496, 105, '3030', '2022-10-27', '2022-10-27', 10176.0000, 0.0000, 'MYR', 1.0000, 10176.0000, 0.0000, '[encoded data, 11568 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-01 04:05:16', NULL, NULL, NULL, NULL),
	(10, 'f08b14ec-7b0a-41da-a6ea-8d69b1087ac9', 'ec07a63a-6710-4310-bc28-5ca09bbdeb22', 7, 5495, 105, '3029', '2022-10-27', '2022-10-27', 10176.0000, 0.0000, 'MYR', 1.0000, 10176.0000, 0.0000, '[encoded data, 11588 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-01 04:05:16', NULL, NULL, NULL, NULL),
	(11, '5a1db1cf-112c-470e-9308-ed9309c47a12', 'ec07a63a-6710-4310-bc28-5ca09bbdeb22', 7, 5406, 105, '3012', '2022-10-04', '2022-10-04', 9964.0000, 0.0000, 'MYR', 1.0000, 9964.0000, 0.0000, '[encoded data, 11568 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-01 04:05:16', NULL, NULL, NULL, NULL),
	(12, '6968a313-d8fa-45ee-b983-7513951e3e7a', '4bf4840c-2bbb-460f-8882-2c1ac34e5dab', 7, 7530, 71, '3323', '2024-03-22', '2024-03-22', 14742.0000, 0.0000, 'MYR', 1.0000, 14742.0000, NULL, '[encoded data, 26892 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-17 08:35:04', NULL, NULL, NULL, NULL),
	(13, '5f1ed891-1948-412c-8421-f45861a0c944', 'ec07a63a-6710-4310-bc28-5ca09bbdeb22', 7, 7476, 421, '3314', '2024-03-06', '2024-03-06', 12906.0000, 0.0000, 'MYR', 1.0000, 12906.0000, 0.0000, '[encoded data, 11516 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-01 04:05:16', NULL, NULL, NULL, NULL),
	(14, '3d18f813-63c2-46a2-aef0-75206c450b87', '1321d85c-f74f-4127-8c4a-fef065d228b4', 7, 7532, 66, '3325', '2024-03-22', '2024-03-22', 4752.0000, 0.0000, 'MYR', 1.0000, 4752.0000, NULL, '[encoded data, 11564 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-23 14:55:03', NULL, NULL, NULL, NULL),
	(15, 'a9ced5b7-1357-4a17-80d8-2a9866fd75fc', 'd832ccac-2bb3-4732-b58b-f32d2c5dae1c', 7, 7531, 64, '3324', '2024-03-22', '2024-03-22', 6912.0000, 0.0000, 'MYR', 1.0000, 6912.0000, NULL, '[encoded data, 11564 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-03 09:20:04', NULL, NULL, NULL, NULL),
	(16, '8c0b641a-af3b-4bb9-9260-50a773a5f850', 'ec07a63a-6710-4310-bc28-5ca09bbdeb22', 7, 7511, 167, '3320', '2024-03-15', '2024-03-15', 9396.0000, 0.0000, 'MYR', 1.0000, 9396.0000, 0.0000, '[encoded data, 14384 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-01 04:05:16', NULL, NULL, NULL, NULL),
	(17, '14d90569-4526-4a85-8996-328c4ad4dc3c', 'f7c7f2b6-c206-4139-b614-a836400df2e7', 7, 7526, 155, '3322', '2024-03-21', '2024-03-21', 7452.0000, 0.0000, 'MYR', 1.0000, 7452.0000, NULL, '[encoded data, 15712 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-15 15:40:04', NULL, NULL, NULL, NULL),
	(18, '33275d4b-3b9e-46da-9c14-a000202a69fc', '97785476-c58a-4f9c-9da8-61b348e5130f', 7, 7466, 35, '3313', '2024-02-29', '2024-02-29', 5671.0000, 0.0000, 'MYR', 1.0000, 5671.0000, NULL, '[encoded data, 14604 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-23 08:40:03', NULL, NULL, NULL, NULL),
	(19, '259ef909-3bbe-4c58-8c24-8f53e4e28c29', 'ec07a63a-6710-4310-bc28-5ca09bbdeb22', 7, 6298, 88, '3152', '2023-05-24', '2023-05-24', 3233.0000, 0.0000, 'MYR', 1.0000, 3233.0000, 0.0000, '[encoded data, 10064 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-01 04:05:16', NULL, NULL, NULL, NULL),
	(20, '18547c0b-c1a9-4037-a6b6-c3add0738ca2', 'ec07a63a-6710-4310-bc28-5ca09bbdeb22', 7, 7492, 257, '3315', '2024-03-11', '2024-03-11', 4104.0000, 0.0000, 'MYR', 1.0000, 4104.0000, 0.0000, '[encoded data, 12912 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-01 04:05:16', NULL, NULL, NULL, NULL),
	(21, 'f78a66c4-6f6d-45dc-baf7-47644d02e4e0', 'ec07a63a-6710-4310-bc28-5ca09bbdeb22', 7, 7385, 423, '3303', '2024-02-16', '2024-02-16', 1272.0000, 0.0000, 'MYR', 1.0000, 1272.0000, 0.0000, '[encoded data, 8436 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-01 04:05:16', NULL, NULL, NULL, NULL),
	(22, 'cea20c8d-8157-443a-b9ad-90428a7990d5', 'ec07a63a-6710-4310-bc28-5ca09bbdeb22', 7, 7493, 141, '3316', '2024-03-11', '2024-03-11', 4104.0000, 0.0000, 'MYR', 1.0000, 4104.0000, 0.0000, '[encoded data, 12884 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-01 04:05:16', NULL, NULL, NULL, NULL),
	(23, '2ef0fea5-adbc-41ac-af79-d607364abbf8', 'ec07a63a-6710-4310-bc28-5ca09bbdeb22', 7, 7494, 163, '3317', '2024-03-11', '2024-03-11', 3294.0000, 0.0000, 'MYR', 1.0000, 3294.0000, 0.0000, '[encoded data, 14524 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-01 04:05:16', NULL, NULL, NULL, NULL),
	(24, '86b9c2e8-7160-4b5c-864f-7ea2c9d58ff0', 'ec07a63a-6710-4310-bc28-5ca09bbdeb22', 7, 7312, 406, '3294', '2024-02-02', '2024-02-02', 2756.0000, 0.0000, 'MYR', 1.0000, 2756.0000, 0.0000, '[encoded data, 11556 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-01 04:05:16', NULL, NULL, NULL, NULL),
	(25, '5794e151-4912-4939-8e26-cf69994ff42b', '98a2014f-6215-43da-be80-5451b3bda3b3', 7, 7496, 428, '3318', '2024-03-12', '2024-03-12', 3348.0000, 1500.0000, 'MYR', 1.0000, 3348.0000, 1500.0000, '[encoded data, 13092 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-30 15:25:04', NULL, NULL, NULL, NULL),
	(26, 'd9f7cb8e-082f-4f55-a727-814b1fb75fe0', 'ec07a63a-6710-4310-bc28-5ca09bbdeb22', 7, 7277, 286, '3287', '2024-01-25', '2024-01-25', 2160.0000, 0.0000, 'MYR', 1.0000, 2160.0000, 0.0000, '[encoded data, 8324 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-01 04:05:16', NULL, NULL, NULL, NULL),
	(27, 'a205c4f7-1db0-4c0e-aca7-56e13770acc7', 'ec07a63a-6710-4310-bc28-5ca09bbdeb22', 7, 7420, 36, '3307', '2024-02-22', '2024-02-22', 6360.0000, 0.0000, 'MYR', 1.0000, 6360.0000, 0.0000, '[encoded data, 14328 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-01 04:05:16', NULL, NULL, NULL, NULL),
	(28, '0045d796-4ed5-4eb4-a01b-fbe095d5cf4f', 'ec07a63a-6710-4310-bc28-5ca09bbdeb22', 7, 7448, 437, '3311', '2024-02-29', '2024-02-29', 3551.0000, 0.0000, 'MYR', 1.0000, 3551.0000, 0.0000, '[encoded data, 16340 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-01 04:05:16', NULL, NULL, NULL, NULL),
	(29, 'c704300b-576a-4232-8a5f-12998bf0fb21', 'ec07a63a-6710-4310-bc28-5ca09bbdeb22', 7, 7443, 163, '3310', '2024-02-28', '2024-02-28', 3127.0000, 0.0000, 'MYR', 1.0000, 3127.0000, 0.0000, '[encoded data, 13140 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-01 04:05:16', NULL, NULL, NULL, NULL),
	(30, 'aefcf6f2-1dba-4ea1-8f3d-a9245470ed83', 'ec07a63a-6710-4310-bc28-5ca09bbdeb22', 7, 6344, 35, '3161', '2023-06-01', '2023-06-01', 7314.0000, 0.0000, 'MYR', 1.0000, 7314.0000, 0.0000, '[encoded data, 15064 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-01 04:05:16', NULL, NULL, NULL, NULL),
	(31, 'c68b40d9-e081-41b6-80b7-33d0e89f34a9', 'ec07a63a-6710-4310-bc28-5ca09bbdeb22', 7, 7419, 145, '3306', '2024-02-21', '2024-02-21', 4399.0000, 0.0000, 'MYR', 1.0000, 4399.0000, 0.0000, '[encoded data, 14548 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-01 04:05:16', NULL, NULL, NULL, NULL),
	(32, 'fad96b5b-e40a-4996-9c01-66c74a72e190', 'e1f87803-f706-4cd7-be52-cda6684ecbd9', 7, 7454, 286, '3312', '2024-02-29', '2024-02-29', 5040.0000, 0.0000, 'MYR', 1.0000, 5040.0000, NULL, '[encoded data, 8336 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-15 08:45:04', NULL, NULL, NULL, NULL),
	(33, '7e2fc23a-4f73-43d2-8738-f9be3f282b51', '2d1ef8c5-7f35-497a-8a22-9b0f4fc5e0c5', 7, 7442, 447, '3309', '2024-02-28', '2024-02-28', 14310.0000, 0.0000, 'MYR', 1.0000, 14310.0000, NULL, '[encoded data, 8508 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-05-02 12:20:04', NULL, NULL, NULL, NULL),
	(34, '74af894e-60c9-47ea-b72b-99ebcbcfeee0', 'ec07a63a-6710-4310-bc28-5ca09bbdeb22', 7, 7440, 326, '3308', '2024-02-27', '2024-02-27', 1060.0000, 1060.0000, 'MYR', 1.0000, 1060.0000, 1060.0000, '[encoded data, 11476 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-01 04:05:16', NULL, NULL, NULL, NULL),
	(35, '8d790827-bf66-4df9-a0a8-35288f6e0e8a', 'ec07a63a-6710-4310-bc28-5ca09bbdeb22', 7, 7411, 38, '3304', '2024-02-21', '2024-02-21', 4611.0000, 0.0000, 'MYR', 1.0000, 4611.0000, 0.0000, '[encoded data, 12948 characters]', NULL, NULL, NULL, 1, '2024-04-01 04:05:16', '2024-04-01 04:05:16', NULL, NULL, NULL, NULL),
