-- Table structure for cliche_printing_qualitys
-- ----------------------------
CREATE TABLE `cliche_printing_qualitys`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `foreign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `cliche_printing_qualitys_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `cliche_printing_qualitys_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `cliche_printing_qualitys_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `cliche_printing_qualitys_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `cliche_printing_qualitys_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `cliche_printing_qualitys_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `cliche_printing_qualitys_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `cliche_printing_qualitys_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of cliche_printing_qualitys
-- ----------------------------

-- ----------------------------
-- Table structure for cliche_thinknesss
-- ----------------------------
CREATE TABLE `cliche_thinknesss`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `foreign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `cliche_thinknesss_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `cliche_thinknesss_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `cliche_thinknesss_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `cliche_thinknesss_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `cliche_thinknesss_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `cliche_thinknesss_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `cliche_thinknesss_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `cliche_thinknesss_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of cliche_thinknesss
-- ----------------------------

-- ----------------------------
-- Table structure for clinic_appointment_status
-- ----------------------------
CREATE TABLE `clinic_appointment_status`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `foreign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `clinic_appointment_status_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `clinic_appointment_status_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `clinic_appointment_status_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `clinic_appointment_status_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `clinic_appointment_status_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `clinic_appointment_status_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `clinic_appointment_status_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `clinic_appointment_status_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of clinic_appointment_status
-- ----------------------------
INSERT INTO `clinic_appointment_status` VALUES (1, 'قيد المراجعة', '1', 'Pending', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:59', '2025-06-12 14:05:59', NULL);
INSERT INTO `clinic_appointment_status` VALUES (2, 'تم بنجاح', '2', 'Successed', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:59', '2025-06-12 14:05:59', NULL);
INSERT INTO `clinic_appointment_status` VALUES (3, 'الغي', '3', 'Canceled', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:59', '2025-06-12 14:05:59', NULL);
INSERT INTO `clinic_appointment_status` VALUES (4, 'بأنتضار الموافقة', '4', 'Approval pending', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:59', '2025-06-12 14:05:59', NULL);
INSERT INTO `clinic_appointment_status` VALUES (5, 'عند الطبيب', '5', 'With doctor', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:59', '2025-06-12 14:05:59', NULL);

-- ----------------------------
-- Table structure for clinic_room_appointments
-- ----------------------------
CREATE TABLE `clinic_room_appointments`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `clinic_room_id` int UNSIGNED NULL DEFAULT NULL,
  `customer_user_id` int UNSIGNED NOT NULL,
  `employee_user_id` int UNSIGNED NULL DEFAULT NULL,
  `clinic_appointment_state_id` int UNSIGNED NOT NULL,
  `customer_insurance_percentage` double UNSIGNED NULL DEFAULT NULL,
  `insurance_company_id` int UNSIGNED NULL DEFAULT NULL,
  `clinic_session_id` int UNSIGNED NULL DEFAULT NULL,
  `insurance_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `insurance_company_state` int UNSIGNED NULL DEFAULT NULL,
  `journal_entry_id` int UNSIGNED NULL DEFAULT NULL,
  `start_datetime` datetime NOT NULL,
  `end_datetime` datetime NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `clinic_room_appointments_journal_entry_id_foreign`(`journal_entry_id` ASC) USING BTREE,
  INDEX `clinic_room_appointments_insurance_company_id_foreign`(`insurance_company_id` ASC) USING BTREE,
  INDEX `clinic_room_appointments_insurance_company_state_foreign`(`insurance_company_state` ASC) USING BTREE,
  INDEX `clinic_room_appointments_clinic_room_id_foreign`(`clinic_room_id` ASC) USING BTREE,
  INDEX `clinic_room_appointments_customer_user_id_foreign`(`customer_user_id` ASC) USING BTREE,
  INDEX `clinic_room_appointments_employee_user_id_foreign`(`employee_user_id` ASC) USING BTREE,
  INDEX `clinic_room_appointments_clinic_appointment_state_id_foreign`(`clinic_appointment_state_id` ASC) USING BTREE,
  INDEX `clinic_room_appointments_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `clinic_room_appointments_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `clinic_room_appointments_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `clinic_room_appointments_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `clinic_room_appointments_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `clinic_room_appointments_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `clinic_room_appointments_clinic_appointment_state_id_foreign` FOREIGN KEY (`clinic_appointment_state_id`) REFERENCES `clinic_appointment_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `clinic_room_appointments_clinic_room_id_foreign` FOREIGN KEY (`clinic_room_id`) REFERENCES `clinic_rooms` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `clinic_room_appointments_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `clinic_room_appointments_customer_user_id_foreign` FOREIGN KEY (`customer_user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `clinic_room_appointments_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `clinic_room_appointments_employee_user_id_foreign` FOREIGN KEY (`employee_user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `clinic_room_appointments_insurance_company_id_foreign` FOREIGN KEY (`insurance_company_id`) REFERENCES `insurance_companies` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `clinic_room_appointments_insurance_company_state_foreign` FOREIGN KEY (`insurance_company_state`) REFERENCES `status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `clinic_room_appointments_journal_entry_id_foreign` FOREIGN KEY (`journal_entry_id`) REFERENCES `journal_entries` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of clinic_room_appointments
-- ----------------------------

-- ----------------------------
-- Table structure for clinic_rooms
-- ----------------------------
CREATE TABLE `clinic_rooms`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `foreign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `state_id` int UNSIGNED NULL DEFAULT NULL,
  `time_till_next_appointment` int UNSIGNED NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `clinic_rooms_state_id_foreign`(`state_id` ASC) USING BTREE,
  INDEX `clinic_rooms_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `clinic_rooms_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `clinic_rooms_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `clinic_rooms_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `clinic_rooms_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `clinic_rooms_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `clinic_rooms_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `clinic_rooms_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `clinic_rooms_state_id_foreign` FOREIGN KEY (`state_id`) REFERENCES `status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of clinic_rooms
-- ----------------------------
INSERT INTO `clinic_rooms` VALUES (1, 'عيادة طب عام 1', '1', 'Room 1', 1, 10, NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:59', '2025-06-12 14:05:59', NULL);
INSERT INTO `clinic_rooms` VALUES (2, 'عيادة طب عام  2', '2', 'Room 2', 1, 10, NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:59', '2025-06-12 14:05:59', NULL);
INSERT INTO `clinic_rooms` VALUES (3, 'عيادة اسنان 1', '3', 'Room 3', 1, 10, NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:59', '2025-06-12 14:05:59', NULL);

-- ----------------------------
-- Table structure for clinic_sessions
-- ----------------------------
CREATE TABLE `clinic_sessions`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `foreign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `session_mints` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `clinic_sessions_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `clinic_sessions_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `clinic_sessions_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `clinic_sessions_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `clinic_sessions_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `clinic_sessions_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `clinic_sessions_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `clinic_sessions_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of clinic_sessions
-- ----------------------------

-- ----------------------------
-- Table structure for clinic_settings
-- ----------------------------
CREATE TABLE `clinic_settings`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `clinic_room_appointment_state_id` int UNSIGNED NOT NULL,
  `saturday_appointment_start` time NULL DEFAULT NULL,
  `saturday_appointment_end` time NULL DEFAULT NULL,
  `sumday_appointment_start` time NULL DEFAULT NULL,
  `sumday_appointment_end` time NULL DEFAULT NULL,
  `monday_appointment_start` time NULL DEFAULT NULL,
  `monday_appointment_end` time NULL DEFAULT NULL,
  `tuesday_appointment_start` time NULL DEFAULT NULL,
  `tuesday_appointment_end` time NULL DEFAULT NULL,
  `wednesday_appointment_start` time NULL DEFAULT NULL,
  `wednesday_appointment_end` time NULL DEFAULT NULL,
  `thursday_appointment_start` time NULL DEFAULT NULL,
  `thursday_appointment_end` time NULL DEFAULT NULL,
  `friday_appointment_start` time NULL DEFAULT NULL,
  `friday_appointment_end` time NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `clinic_settings_clinic_room_appointment_state_id_foreign`(`clinic_room_appointment_state_id` ASC) USING BTREE,
  INDEX `clinic_settings_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `clinic_settings_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `clinic_settings_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `clinic_settings_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `clinic_settings_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `clinic_settings_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `clinic_settings_clinic_room_appointment_state_id_foreign` FOREIGN KEY (`clinic_room_appointment_state_id`) REFERENCES `status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `clinic_settings_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `clinic_settings_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of clinic_settings
-- ----------------------------
INSERT INTO `clinic_settings` VALUES (1, 1, '08:00:00', '08:00:00', '08:00:00', '08:00:00', '08:00:00', '08:00:00', '08:00:00', '08:00:00', '08:00:00', '08:00:00', '08:00:00', '08:00:00', '08:00:00', '08:00:00', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:59', '2025-06-12 14:05:59', NULL);

-- ----------------------------
-- Table structure for collected_money_in_pos_values
-- ----------------------------
CREATE TABLE `collected_money_in_pos_values`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `only_on_closing` int NOT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `collected_money_in_pos_values_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `collected_money_in_pos_values_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `collected_money_in_pos_values_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `collected_money_in_pos_values_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `collected_money_in_pos_values_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `collected_money_in_pos_values_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `collected_money_in_pos_values_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `collected_money_in_pos_values_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of collected_money_in_pos_values
-- ----------------------------

-- ----------------------------
-- Table structure for companies
-- ----------------------------
CREATE TABLE `companies`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `foreign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of companies
-- ----------------------------
INSERT INTO `companies` VALUES (1, 'شركة تجريبية', '1', 'Test company', NULL, NULL, NULL, NULL);

-- ----------------------------
-- Table structure for component_template_lines
-- ----------------------------
CREATE TABLE `component_template_lines`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `component_template_id` int UNSIGNED NOT NULL,
  `product_id` int UNSIGNED NOT NULL,
  `unit_id` int UNSIGNED NOT NULL,
  `balance_is_required` int UNSIGNED NOT NULL,
  `component_is_required` int UNSIGNED NOT NULL,
  `component_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `component_can_change_balance` int UNSIGNED NOT NULL,
  `quantity` double UNSIGNED NOT NULL,
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `component_template_lines_component_template_id_foreign`(`component_template_id` ASC) USING BTREE,
  INDEX `component_template_lines_product_id_foreign`(`product_id` ASC) USING BTREE,
  INDEX `component_template_lines_unit_id_foreign`(`unit_id` ASC) USING BTREE,
  INDEX `component_template_lines_balance_is_required_foreign`(`balance_is_required` ASC) USING BTREE,
  INDEX `component_template_lines_component_is_required_foreign`(`component_is_required` ASC) USING BTREE,
  INDEX `component_template_lines_component_can_change_balance_foreign`(`component_can_change_balance` ASC) USING BTREE,
  INDEX `component_template_lines_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `component_template_lines_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `component_template_lines_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `component_template_lines_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `component_template_lines_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `component_template_lines_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `component_template_lines_balance_is_required_foreign` FOREIGN KEY (`balance_is_required`) REFERENCES `status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `component_template_lines_component_can_change_balance_foreign` FOREIGN KEY (`component_can_change_balance`) REFERENCES `status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `component_template_lines_component_is_required_foreign` FOREIGN KEY (`component_is_required`) REFERENCES `status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `component_template_lines_component_template_id_foreign` FOREIGN KEY (`component_template_id`) REFERENCES `component_templates` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `component_template_lines_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `component_template_lines_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `component_template_lines_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `component_template_lines_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of component_template_lines
-- ----------------------------

-- ----------------------------
-- Table structure for component_templates
-- ----------------------------
CREATE TABLE `component_templates`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `foreign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `component_templates_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `component_templates_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `component_templates_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `component_templates_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `component_templates_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `component_templates_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `component_templates_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `component_templates_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of component_templates
-- ----------------------------

-- ----------------------------
-- Table structure for configurations
-- ----------------------------
CREATE TABLE `configurations`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `user_limit` int NULL DEFAULT NULL,
  `monthly_invoice_limit` int NULL DEFAULT NULL,
  `is_trial` int NULL DEFAULT NULL,
  `user_id_from_main` int NULL DEFAULT NULL,
  `start_date` date NULL DEFAULT NULL,
  `end_date` date NULL DEFAULT NULL,
  `active_models` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `configurations_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `configurations_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `configurations_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `configurations_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `configurations_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `configurations_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `configurations_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `configurations_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of configurations
-- ----------------------------
INSERT INTO `configurations` VALUES (1, 100000, 10000, NULL, NULL, '2025-07-08', '2026-07-08', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-07-08 14:58:14', '2025-07-08 14:58:14', NULL);

-- ----------------------------
-- Table structure for contract_close_status
-- ----------------------------
CREATE TABLE `contract_close_status`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `foreign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `contract_close_status_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `contract_close_status_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `contract_close_status_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `contract_close_status_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `contract_close_status_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contract_close_status_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contract_close_status_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contract_close_status_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of contract_close_status
-- ----------------------------
INSERT INTO `contract_close_status` VALUES (1, 'عادي', '1', 'Normal', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:49', '2025-06-12 14:05:49', NULL);
INSERT INTO `contract_close_status` VALUES (2, 'شهري', '2', 'Monthly', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:49', '2025-06-12 14:05:49', NULL);

-- ----------------------------
-- Table structure for contract_journal_entries
-- ----------------------------
CREATE TABLE `contract_journal_entries`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `contract_id` int UNSIGNED NOT NULL,
  `journal_entry_id` int UNSIGNED NOT NULL,
  `amount` double UNSIGNED NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `contract_journal_entries_contract_id_foreign`(`contract_id` ASC) USING BTREE,
  INDEX `contract_journal_entries_journal_entry_id_foreign`(`journal_entry_id` ASC) USING BTREE,
  INDEX `contract_journal_entries_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `contract_journal_entries_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `contract_journal_entries_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `contract_journal_entries_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `contract_journal_entries_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contract_journal_entries_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contract_journal_entries_contract_id_foreign` FOREIGN KEY (`contract_id`) REFERENCES `contracts` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contract_journal_entries_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contract_journal_entries_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contract_journal_entries_journal_entry_id_foreign` FOREIGN KEY (`journal_entry_id`) REFERENCES `journal_entries` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 459 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of contract_journal_entries
-- ----------------------------
INSERT INTO `contract_journal_entries` VALUES (3, 2, 93, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (5, 2, 129, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (6, 2, 130, 50, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (7, 2, 131, 150, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (8, 2, 132, 50, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (9, 2, 133, 200, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (10, 2, 134, 50, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (11, 2, 135, 50, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (12, 2, 136, 75, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (13, 2, 137, 125, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (14, 3, 359, 500, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (15, 3, 425, 250, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (16, 4, 120, 70, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (18, 4, 138, 20, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (19, 4, 139, 35, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (20, 4, 140, 130, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (21, 4, 141, 70, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (22, 4, 142, 50, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (23, 4, 143, 50, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (24, 4, 144, 50, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (41, 6, 104, 50, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (44, 6, 182, 65, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (46, 6, 211, 10, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (48, 6, 239, 140, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (50, 6, 306, 200, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (51, 6, 399, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (52, 7, 19, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (53, 7, 31, 80, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (54, 7, 82, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (55, 7, 109, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (56, 7, 179, 121, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (58, 7, 181, 225, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (59, 7, 217, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (60, 7, 228, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (61, 7, 244, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (62, 7, 282, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (63, 7, 322, 150, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (65, 8, 117, 450, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (67, 8, 234, 450, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (68, 8, 305, 300, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (69, 8, 319, 150, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (73, 9, 307, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (76, 10, 205, 170, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (77, 10, 240, 50, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (78, 10, 258, 120, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (79, 10, 278, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (80, 10, 296, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (81, 10, 317, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (82, 10, 339, 200, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (83, 12, 49, 210, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (85, 12, 164, 210, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (86, 12, 204, 210, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (87, 12, 235, 210, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (88, 12, 289, 210, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (89, 12, 313, 210, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (90, 12, 423, 210, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (93, 14, 45, 121, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (94, 14, 110, 104, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:24', '2025-07-22 22:57:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (95, 14, 249, 225, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (96, 14, 422, 300, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (133, 18, 323, 500, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (143, 20, 78, 150, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (144, 20, 250, 150, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (145, 20, 302, 150, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (146, 20, 396, 150, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (147, 21, 79, 25, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (149, 21, 81, 39, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (150, 21, 97, 10, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (151, 21, 126, 25, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (152, 21, 127, 25, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (153, 21, 167, 50, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (154, 21, 201, 50, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (157, 21, 332, 20, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (158, 21, 337, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (159, 21, 346, 150, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (161, 22, 242, 300, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (162, 22, 300, 300, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (166, 24, 105, 14, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (169, 24, 257, 186, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (170, 24, 268, 150, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (171, 24, 276, 250, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (172, 24, 333, 200, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (173, 25, 60, 150, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (175, 25, 152, 150, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (176, 25, 218, 150, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (177, 25, 256, 150, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (178, 25, 277, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (179, 25, 297, 50, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (180, 25, 336, 150, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (181, 26, 22, 600, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (182, 26, 207, 50, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (183, 26, 261, 300, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (184, 26, 262, 200, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (185, 27, 101, 300, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (186, 27, 116, 300, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (187, 27, 189, 300, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (188, 27, 245, 900, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (189, 27, 316, 450, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (190, 27, 567, 450, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (191, 28, 36, 80, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (192, 28, 161, 80, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (193, 28, 196, 80, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (194, 28, 232, 80, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (195, 28, 287, 80, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (196, 28, 326, 80, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (197, 28, 343, 80, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (200, 29, 40, 525, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (203, 30, 46, 70, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (204, 30, 163, 70, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (205, 30, 208, 70, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (206, 30, 231, 70, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (207, 30, 274, 70, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (208, 30, 309, 70, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (209, 30, 342, 70, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (210, 31, 72, 125, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (211, 31, 169, 125, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (212, 31, 219, 125, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (213, 31, 247, 125, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (214, 31, 275, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (215, 31, 426, 150, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (228, 34, 41, 85, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (229, 34, 173, 85, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (230, 34, 213, 85, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (231, 34, 241, 85, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (232, 34, 281, 85, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (233, 34, 311, 85, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (234, 34, 395, 85, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (249, 37, 312, 60, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (250, 37, 340, 70, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (251, 38, 35, 70, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (252, 38, 155, 70, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (253, 38, 209, 70, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (254, 38, 230, 70, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (255, 38, 284, 70, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (256, 38, 310, 70, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (257, 38, 341, 70, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (259, 39, 29, 167, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (261, 39, 128, 167, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (262, 39, 193, 168, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (263, 39, 226, 168, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (264, 39, 251, 1000, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (267, 40, 111, 150, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (269, 40, 125, 120, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (270, 40, 160, 250, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (271, 40, 171, 200, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (273, 40, 264, 131.5, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (274, 40, 295, 400, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (275, 40, 299, 200, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (276, 40, 329, 500, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (277, 40, 345, 330, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (278, 42, 103, 200, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (279, 42, 106, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (280, 42, 156, 72, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (281, 42, 157, 53, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (282, 42, 170, 125, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (283, 42, 185, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (284, 42, 212, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (285, 42, 220, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (286, 42, 233, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (287, 42, 237, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (288, 42, 260, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (289, 42, 270, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (290, 42, 283, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (291, 42, 293, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (292, 42, 315, 50, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (293, 42, 330, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (294, 42, 335, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (295, 42, 401, 100, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (298, 43, 154, 167, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (299, 43, 194, 167, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (300, 43, 227, 167, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (301, 43, 252, 1000, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-22 22:57:25', '2025-07-22 22:57:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (302, 14, 582, 200, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-23 14:11:23', '2025-07-23 14:11:23', NULL);
INSERT INTO `contract_journal_entries` VALUES (303, 21, 583, 330, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-23 17:11:41', '2025-07-23 17:11:41', NULL);
INSERT INTO `contract_journal_entries` VALUES (304, 4, 585, 100, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-24 15:57:01', '2025-07-24 15:57:01', NULL);
INSERT INTO `contract_journal_entries` VALUES (316, 43, 30, 167, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-27 18:42:17', '2025-07-27 18:42:17', NULL);
INSERT INTO `contract_journal_entries` VALUES (332, 36, 34, 70, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:24:57', '2025-07-28 13:24:57', NULL);
INSERT INTO `contract_journal_entries` VALUES (334, 36, 162, 70, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:26:07', '2025-07-28 13:26:07', NULL);
INSERT INTO `contract_journal_entries` VALUES (335, 36, 210, 70, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:26:18', '2025-07-28 13:26:18', NULL);
INSERT INTO `contract_journal_entries` VALUES (336, 36, 229, 70, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:26:28', '2025-07-28 13:26:28', NULL);
INSERT INTO `contract_journal_entries` VALUES (337, 36, 271, 70, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:26:56', '2025-07-28 13:26:56', NULL);
INSERT INTO `contract_journal_entries` VALUES (338, 36, 303, 70, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:27:08', '2025-07-28 13:27:08', NULL);
INSERT INTO `contract_journal_entries` VALUES (339, 36, 344, 70, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:27:19', '2025-07-28 13:27:19', NULL);
INSERT INTO `contract_journal_entries` VALUES (340, 35, 34, 70, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:27:47', '2025-07-28 13:27:47', NULL);
INSERT INTO `contract_journal_entries` VALUES (341, 35, 162, 70, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:27:56', '2025-07-28 13:27:56', NULL);
INSERT INTO `contract_journal_entries` VALUES (342, 35, 210, 70, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:28:06', '2025-07-28 13:28:06', NULL);
INSERT INTO `contract_journal_entries` VALUES (343, 35, 229, 70, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:28:16', '2025-07-28 13:28:16', NULL);
INSERT INTO `contract_journal_entries` VALUES (344, 35, 271, 70, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:28:25', '2025-07-28 13:28:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (345, 35, 303, 70, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:28:35', '2025-07-28 13:28:35', NULL);
INSERT INTO `contract_journal_entries` VALUES (346, 35, 344, 70, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:29:03', '2025-07-28 13:29:03', NULL);
INSERT INTO `contract_journal_entries` VALUES (347, 32, 76, 80, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:38:02', '2025-07-28 13:38:02', NULL);
INSERT INTO `contract_journal_entries` VALUES (348, 32, 176, 80, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:38:19', '2025-07-28 13:38:19', NULL);
INSERT INTO `contract_journal_entries` VALUES (349, 32, 221, 80, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:38:30', '2025-07-28 13:38:30', NULL);
INSERT INTO `contract_journal_entries` VALUES (350, 32, 254, 80, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:38:43', '2025-07-28 13:38:43', NULL);
INSERT INTO `contract_journal_entries` VALUES (351, 32, 292, 80, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:38:51', '2025-07-28 13:38:51', NULL);
INSERT INTO `contract_journal_entries` VALUES (352, 32, 324, 80, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:39:01', '2025-07-28 13:39:01', NULL);
INSERT INTO `contract_journal_entries` VALUES (353, 32, 587, 80, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:39:21', '2025-07-28 13:39:21', NULL);
INSERT INTO `contract_journal_entries` VALUES (354, 33, 76, 80, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:39:49', '2025-07-28 13:39:49', NULL);
INSERT INTO `contract_journal_entries` VALUES (355, 33, 176, 80, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:40:07', '2025-07-28 13:40:07', NULL);
INSERT INTO `contract_journal_entries` VALUES (356, 33, 221, 80, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:40:15', '2025-07-28 13:40:15', NULL);
INSERT INTO `contract_journal_entries` VALUES (357, 33, 254, 80, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:40:29', '2025-07-28 13:40:29', NULL);
INSERT INTO `contract_journal_entries` VALUES (358, 33, 292, 80, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:40:39', '2025-07-28 13:40:39', NULL);
INSERT INTO `contract_journal_entries` VALUES (359, 33, 324, 80, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:40:50', '2025-07-28 13:40:50', NULL);
INSERT INTO `contract_journal_entries` VALUES (360, 33, 588, 80, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:41:07', '2025-07-28 13:41:07', NULL);
INSERT INTO `contract_journal_entries` VALUES (373, 25, 593, 150, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 16:52:52', '2025-07-28 16:52:52', NULL);
INSERT INTO `contract_journal_entries` VALUES (374, 9, 594, 90, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 17:01:55', '2025-07-28 17:01:55', NULL);
INSERT INTO `contract_journal_entries` VALUES (375, 39, 286, 330.004, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 17:25:14', '2025-07-28 17:25:14', NULL);
INSERT INTO `contract_journal_entries` VALUES (376, 43, 286, 169.996, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 17:26:53', '2025-07-28 17:26:53', NULL);
INSERT INTO `contract_journal_entries` VALUES (377, 40, 253, 51.838, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 17:33:54', '2025-07-28 17:33:54', NULL);
INSERT INTO `contract_journal_entries` VALUES (382, 52, 23, 450, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 18:11:12', '2025-07-28 18:11:12', NULL);
INSERT INTO `contract_journal_entries` VALUES (383, 52, 215, 150, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 18:11:26', '2025-07-28 18:11:26', NULL);
INSERT INTO `contract_journal_entries` VALUES (384, 52, 265, 150, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 18:11:43', '2025-07-28 18:11:43', NULL);
INSERT INTO `contract_journal_entries` VALUES (386, 29, 88, 525, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 18:25:51', '2025-07-28 18:25:51', NULL);
INSERT INTO `contract_journal_entries` VALUES (387, 29, 491, 525, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 18:26:04', '2025-07-28 18:26:04', NULL);
INSERT INTO `contract_journal_entries` VALUES (388, 2, 596, 100, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-29 12:07:01', '2025-07-29 12:07:01', NULL);
INSERT INTO `contract_journal_entries` VALUES (389, 26, 595, 500, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-29 12:07:39', '2025-07-29 12:07:39', NULL);
INSERT INTO `contract_journal_entries` VALUES (390, 55, 172, 67, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-29 13:26:01', '2025-07-29 13:26:01', NULL);
INSERT INTO `contract_journal_entries` VALUES (391, 55, 190, 70, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-29 13:26:24', '2025-07-29 13:26:24', NULL);
INSERT INTO `contract_journal_entries` VALUES (392, 42, 598, 100, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-29 16:03:09', '2025-07-29 16:03:09', NULL);
INSERT INTO `contract_journal_entries` VALUES (393, 17, 15, 125, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-30 11:54:43', '2025-07-30 11:54:43', NULL);
INSERT INTO `contract_journal_entries` VALUES (394, 17, 112, 45, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-30 11:55:02', '2025-07-30 11:55:02', NULL);
INSERT INTO `contract_journal_entries` VALUES (396, 17, 294, 263, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-30 11:55:41', '2025-07-30 11:55:41', NULL);
INSERT INTO `contract_journal_entries` VALUES (397, 17, 320, 70, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-30 11:56:00', '2025-07-30 11:56:00', NULL);
INSERT INTO `contract_journal_entries` VALUES (398, 19, 166, 173, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-30 11:57:12', '2025-07-30 11:57:12', NULL);
INSERT INTO `contract_journal_entries` VALUES (399, 19, 188, 125, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-30 11:57:27', '2025-07-30 11:57:27', NULL);
INSERT INTO `contract_journal_entries` VALUES (400, 19, 223, 125, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-30 11:58:12', '2025-07-30 11:58:12', NULL);
INSERT INTO `contract_journal_entries` VALUES (401, 19, 294, 137, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-30 11:58:31', '2025-07-30 11:58:31', NULL);
INSERT INTO `contract_journal_entries` VALUES (402, 45, 66, 190.5, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-30 13:29:51', '2025-07-30 13:29:51', NULL);
INSERT INTO `contract_journal_entries` VALUES (403, 45, 74, 500, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-30 13:31:23', '2025-07-30 13:31:23', NULL);
INSERT INTO `contract_journal_entries` VALUES (404, 45, 145, 1109.5, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-30 13:35:52', '2025-07-30 13:35:52', NULL);
INSERT INTO `contract_journal_entries` VALUES (405, 46, 145, 366.675, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-30 13:37:02', '2025-07-30 13:37:02', NULL);
INSERT INTO `contract_journal_entries` VALUES (406, 47, 145, 366.675, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-30 13:37:43', '2025-07-30 13:37:43', NULL);
INSERT INTO `contract_journal_entries` VALUES (407, 48, 145, 266.65, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-30 13:38:18', '2025-07-30 13:38:18', NULL);
INSERT INTO `contract_journal_entries` VALUES (408, 48, 147, 100.025, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-30 13:42:25', '2025-07-30 13:42:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (409, 49, 146, 500, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-30 13:44:15', '2025-07-30 13:44:15', NULL);
INSERT INTO `contract_journal_entries` VALUES (410, 51, 243, 100, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-31 09:59:52', '2025-07-31 09:59:52', NULL);
INSERT INTO `contract_journal_entries` VALUES (411, 51, 267, 70, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-31 10:00:05', '2025-07-31 10:00:05', NULL);
INSERT INTO `contract_journal_entries` VALUES (412, 50, 267, 24.6, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-31 10:00:52', '2025-07-31 10:00:52', NULL);
INSERT INTO `contract_journal_entries` VALUES (413, 56, 52, 250, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-31 10:16:51', '2025-07-31 10:16:51', NULL);
INSERT INTO `contract_journal_entries` VALUES (414, 56, 68, 60, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-31 10:20:32', '2025-07-31 10:20:32', NULL);
INSERT INTO `contract_journal_entries` VALUES (415, 56, 71, 59.2, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-31 10:20:43', '2025-07-31 10:20:43', NULL);
INSERT INTO `contract_journal_entries` VALUES (416, 56, 186, 84, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-31 10:21:02', '2025-07-31 10:21:02', NULL);
INSERT INTO `contract_journal_entries` VALUES (417, 56, 191, 136.8, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-31 10:21:17', '2025-07-31 10:21:17', NULL);
INSERT INTO `contract_journal_entries` VALUES (422, 5, 148, 250, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-31 11:09:35', '2025-07-31 11:09:35', NULL);
INSERT INTO `contract_journal_entries` VALUES (424, 5, 150, 1000, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-31 11:09:53', '2025-07-31 11:09:53', NULL);
INSERT INTO `contract_journal_entries` VALUES (425, 5, 147, 29.975, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-31 11:12:25', '2025-07-31 11:12:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (426, 5, 149, 496.5, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-31 11:14:33', '2025-07-31 11:14:33', NULL);
INSERT INTO `contract_journal_entries` VALUES (427, 44, 591, 1900, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-31 12:15:05', '2025-07-31 12:15:05', NULL);
INSERT INTO `contract_journal_entries` VALUES (428, 22, 195, 150, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-31 13:09:26', '2025-07-31 13:09:26', NULL);
INSERT INTO `contract_journal_entries` VALUES (429, 18, 600, 70, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-31 13:11:39', '2025-07-31 13:11:39', NULL);
INSERT INTO `contract_journal_entries` VALUES (430, 53, 400, 150, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-01 14:11:26', '2025-08-01 14:11:26', NULL);
INSERT INTO `contract_journal_entries` VALUES (431, 57, 602, 125, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-02 12:50:04', '2025-08-02 12:50:04', NULL);
INSERT INTO `contract_journal_entries` VALUES (432, 21, 603, 100, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-02 13:54:59', '2025-08-02 13:54:59', NULL);
INSERT INTO `contract_journal_entries` VALUES (433, 8, 604, 450, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-02 14:47:56', '2025-08-02 14:47:56', NULL);
INSERT INTO `contract_journal_entries` VALUES (434, 2, 606, 60, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-02 19:06:22', '2025-08-02 19:06:22', NULL);
INSERT INTO `contract_journal_entries` VALUES (435, 5, 608, 50, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-03 22:09:42', '2025-08-03 22:09:42', NULL);
INSERT INTO `contract_journal_entries` VALUES (436, 15, 609, 225, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-03 22:10:19', '2025-08-03 22:10:19', NULL);
INSERT INTO `contract_journal_entries` VALUES (437, 16, 610, 225, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-03 22:10:49', '2025-08-03 22:10:49', NULL);
INSERT INTO `contract_journal_entries` VALUES (438, 40, 611, 300, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-03 22:12:25', '2025-08-03 22:12:25', NULL);
INSERT INTO `contract_journal_entries` VALUES (439, 58, 47, 225, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-04 13:32:46', '2025-08-04 13:32:46', NULL);
INSERT INTO `contract_journal_entries` VALUES (440, 59, 20, 150, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-04 13:36:35', '2025-08-04 13:36:35', NULL);
INSERT INTO `contract_journal_entries` VALUES (441, 6, 613, 100, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-04 13:43:08', '2025-08-04 13:43:08', NULL);
INSERT INTO `contract_journal_entries` VALUES (442, 4, 615, 50, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-04 19:32:17', '2025-08-04 19:32:17', NULL);
INSERT INTO `contract_journal_entries` VALUES (443, 35, 617, 70, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-04 21:13:34', '2025-08-04 21:13:34', NULL);
INSERT INTO `contract_journal_entries` VALUES (444, 36, 618, 70, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-04 21:19:13', '2025-08-04 21:19:13', NULL);
INSERT INTO `contract_journal_entries` VALUES (445, 2, 620, 40, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-05 13:25:26', '2025-08-05 13:25:26', NULL);
INSERT INTO `contract_journal_entries` VALUES (446, 7, 621, 100, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-05 14:22:32', '2025-08-05 14:22:32', NULL);
INSERT INTO `contract_journal_entries` VALUES (447, 24, 624, 79.45, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-05 14:48:27', '2025-08-05 14:48:27', NULL);
INSERT INTO `contract_journal_entries` VALUES (448, 15, 627, 225, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-05 15:00:56', '2025-08-05 15:00:56', NULL);
INSERT INTO `contract_journal_entries` VALUES (449, 5, 628, 21, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-05 15:01:45', '2025-08-05 15:01:45', NULL);
INSERT INTO `contract_journal_entries` VALUES (450, 42, 634, 100, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-06 14:49:29', '2025-08-06 14:49:29', NULL);
INSERT INTO `contract_journal_entries` VALUES (451, 14, 632, 225, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-06 15:00:13', '2025-08-06 15:00:13', NULL);
INSERT INTO `contract_journal_entries` VALUES (452, 22, 641, 150, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-07 17:28:14', '2025-08-07 17:28:14', NULL);
INSERT INTO `contract_journal_entries` VALUES (453, 30, 642, 70, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-09 11:12:27', '2025-08-09 11:12:27', NULL);
INSERT INTO `contract_journal_entries` VALUES (454, 38, 643, 70, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-09 13:02:44', '2025-08-09 13:02:44', NULL);
INSERT INTO `contract_journal_entries` VALUES (455, 37, 644, 70, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-09 13:02:59', '2025-08-09 13:02:59', NULL);
INSERT INTO `contract_journal_entries` VALUES (456, 54, 646, 75, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-10 11:40:13', '2025-08-10 11:40:13', NULL);
INSERT INTO `contract_journal_entries` VALUES (457, 21, 647, 25, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-10 11:41:02', '2025-08-10 11:41:02', NULL);
INSERT INTO `contract_journal_entries` VALUES (458, 6, 649, 100, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-10 15:16:10', '2025-08-10 15:16:10', NULL);

-- ----------------------------
-- Table structure for contract_specification_relations
-- ----------------------------
CREATE TABLE `contract_specification_relations`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `contract_specification_value_id` int UNSIGNED NULL DEFAULT NULL,
  `contract_specification_id` int UNSIGNED NOT NULL,
  `contract_id` int UNSIGNED NOT NULL,
  `value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `contract_specification_relations_contract_id_foreign`(`contract_id` ASC) USING BTREE,
  INDEX `contract_specification_relations_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `contract_specification_relations_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `contract_specification_relations_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `contract_specification_relations_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `contract_specification_relations_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contract_specification_relations_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contract_specification_relations_contract_id_foreign` FOREIGN KEY (`contract_id`) REFERENCES `contracts` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contract_specification_relations_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contract_specification_relations_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of contract_specification_relations
-- ----------------------------

-- ----------------------------
-- Table structure for contract_specification_values
-- ----------------------------
CREATE TABLE `contract_specification_values`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `contract_specification_id` int UNSIGNED NULL DEFAULT NULL,
  `value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `contract_specification_values_contract_specification_id_foreign`(`contract_specification_id` ASC) USING BTREE,
  INDEX `contract_specification_values_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `contract_specification_values_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `contract_specification_values_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `contract_specification_values_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `contract_specification_values_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contract_specification_values_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contract_specification_values_contract_specification_id_foreign` FOREIGN KEY (`contract_specification_id`) REFERENCES `contract_specifications` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contract_specification_values_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contract_specification_values_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of contract_specification_values
-- ----------------------------

-- ----------------------------
-- Table structure for contract_specifications
-- ----------------------------
CREATE TABLE `contract_specifications`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `validation` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `product_specification_type_id` int UNSIGNED NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `contract_specifications_product_specification_type_id_foreign`(`product_specification_type_id` ASC) USING BTREE,
  INDEX `contract_specifications_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `contract_specifications_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `contract_specifications_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `contract_specifications_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `contract_specifications_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contract_specifications_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contract_specifications_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contract_specifications_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contract_specifications_product_specification_type_id_foreign` FOREIGN KEY (`product_specification_type_id`) REFERENCES `product_specification_types` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of contract_specifications
-- ----------------------------

-- ----------------------------
-- Table structure for contract_status
-- ----------------------------
CREATE TABLE `contract_status`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `foreign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `contract_status_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `contract_status_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `contract_status_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `contract_status_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `contract_status_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contract_status_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contract_status_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contract_status_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of contract_status
-- ----------------------------
INSERT INTO `contract_status` VALUES (1, 'مفتوح', '1', 'Open', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:53', '2025-06-12 14:05:53', NULL);
INSERT INTO `contract_status` VALUES (2, 'مغلق', '2', 'Close', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:53', '2025-06-12 14:05:53', NULL);

-- ----------------------------
-- Table structure for contract_types
-- ----------------------------
CREATE TABLE `contract_types`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `foreign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `numbering_type_id` int UNSIGNED NOT NULL,
  `rental_type_value_id` int UNSIGNED NOT NULL,
  `next_number` int UNSIGNED NULL DEFAULT NULL,
  `header` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `footer` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `revne_user_id` int NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `contract_types_rental_type_value_id_foreign`(`rental_type_value_id` ASC) USING BTREE,
  INDEX `contract_types_numbering_type_id_foreign`(`numbering_type_id` ASC) USING BTREE,
  INDEX `contract_types_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `contract_types_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `contract_types_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `contract_types_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `contract_types_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contract_types_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contract_types_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contract_types_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contract_types_numbering_type_id_foreign` FOREIGN KEY (`numbering_type_id`) REFERENCES `numbering_types` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contract_types_rental_type_value_id_foreign` FOREIGN KEY (`rental_type_value_id`) REFERENCES `rental_type_values` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of contract_types
-- ----------------------------
INSERT INTO `contract_types` VALUES (1, 'تأجير مباني', '1', NULL, 4, 2, 60, '<div class=\"row\">\r\n    <div class=\"col-5 center\">\r\n        <div class=\"bold\" style=\"font-size:30px\">مجمع عيسى الطباخي وشركاه</div>\r\n    </div>\r\n    <div class=\"col-2 center\">\r\n        <img width=\"180px\" height=\"100px\" src=\"https://eesa.cyberlapaccounts.com/main/public/storage/eesa.cyberlapaccounts.com/logo.png\" />\r\n    </div>\r\n    <div class=\"col-5 center\">\r\n        <div class=\"bold\" style=\"font-size:30px\">مجمع عيسى الطباخي وشركاه</div>\r\n    </div>\r\n</div>', NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:53', '2025-08-04 14:41:32', NULL, 248);

-- ----------------------------
-- Table structure for contracts
-- ----------------------------
CREATE TABLE `contracts`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `driver_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `driver_license_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `driver_license_nationallty` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `driver_license_date` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `driver_license_expire_date` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `additional_driver_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `additional_driver_license_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `additional_driver_license_nationallty` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `additional_driver_license_date` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `additional_driver_license_expire_date` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `entry_counter` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `exit_counter` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `security_deposit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `pickup_time` time NULL DEFAULT NULL,
  `return_time` time NULL DEFAULT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `date` date NOT NULL,
  `total_contract_price` double NULL DEFAULT NULL,
  `one_day_rental_price` double NULL DEFAULT NULL,
  `tax_value` double NULL DEFAULT NULL,
  `in_date_tax_value` double NULL DEFAULT NULL,
  `discount` double NULL DEFAULT NULL,
  `collected_money` double NULL DEFAULT NULL,
  `contract_type_id` int UNSIGNED NOT NULL,
  `contract_state_id` int UNSIGNED NOT NULL,
  `tax_state_id` int UNSIGNED NOT NULL,
  `user_id` int UNSIGNED NOT NULL,
  `income_id` int UNSIGNED NULL DEFAULT NULL,
  `cost_center_id` int UNSIGNED NULL DEFAULT NULL,
  `product_id` int UNSIGNED NOT NULL,
  `unit_id` int UNSIGNED NOT NULL,
  `warehouse_id` int UNSIGNED NULL DEFAULT NULL,
  `branch_id` int UNSIGNED NOT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `contracts_contract_type_id_foreign`(`contract_type_id` ASC) USING BTREE,
  INDEX `contracts_contract_state_id_foreign`(`contract_state_id` ASC) USING BTREE,
  INDEX `contracts_tax_state_id_foreign`(`tax_state_id` ASC) USING BTREE,
  INDEX `contracts_user_id_foreign`(`user_id` ASC) USING BTREE,
  INDEX `contracts_income_id_foreign`(`income_id` ASC) USING BTREE,
  INDEX `contracts_cost_center_id_foreign`(`cost_center_id` ASC) USING BTREE,
  INDEX `contracts_product_id_foreign`(`product_id` ASC) USING BTREE,
  INDEX `contracts_unit_id_foreign`(`unit_id` ASC) USING BTREE,
  INDEX `contracts_warehouse_id_foreign`(`warehouse_id` ASC) USING BTREE,
  INDEX `contracts_branch_id_foreign`(`branch_id` ASC) USING BTREE,
  INDEX `contracts_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `contracts_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `contracts_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `contracts_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `contracts_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contracts_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contracts_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contracts_contract_state_id_foreign` FOREIGN KEY (`contract_state_id`) REFERENCES `contract_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contracts_contract_type_id_foreign` FOREIGN KEY (`contract_type_id`) REFERENCES `contract_types` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contracts_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contracts_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contracts_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contracts_income_id_foreign` FOREIGN KEY (`income_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contracts_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contracts_tax_state_id_foreign` FOREIGN KEY (`tax_state_id`) REFERENCES `tax_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contracts_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contracts_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `contracts_warehouse_id_foreign` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 61 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of contracts
-- ----------------------------
INSERT INTO `contracts` VALUES (2, '2', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 3600, 300, 0, NULL, NULL, 1150, 1, 1, 2, 194, NULL, NULL, 3, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-09 14:29:44', '2025-08-05 13:25:26', NULL);
INSERT INTO `contracts` VALUES (3, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-07-20', '2025-12-31', '2025-07-13', 2670, 500, 0, NULL, NULL, 750, 1, 1, 2, 249, NULL, 1, 1, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-13 17:59:11', '2025-07-24 14:22:23', NULL);
INSERT INTO `contracts` VALUES (4, '3', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 1500, 125, 0, NULL, NULL, 625, 1, 1, 2, 195, NULL, 4, 4, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-17 04:07:55', '2025-08-04 19:32:17', NULL);
INSERT INTO `contracts` VALUES (5, '4', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 3600, 300, 0, NULL, NULL, 1847.475, 1, 1, 2, 196, NULL, 5, 5, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-17 04:10:30', '2025-08-05 15:01:45', NULL);
INSERT INTO `contracts` VALUES (6, '5', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 1500, 125, 0, NULL, NULL, 765, 1, 1, 2, 197, NULL, 6, 6, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-17 04:11:50', '2025-08-10 15:16:10', NULL);
INSERT INTO `contracts` VALUES (7, '6', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 2700, 225, 0, NULL, NULL, 1376, 1, 1, 2, 198, NULL, 7, 7, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-17 04:14:16', '2025-08-05 14:22:32', NULL);
INSERT INTO `contracts` VALUES (8, '7', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 2700, 225, 0, NULL, NULL, 1800, 1, 1, 2, 199, NULL, 8, 8, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-17 05:43:43', '2025-08-02 14:47:56', NULL);
INSERT INTO `contracts` VALUES (9, '8', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-07-18', 2700, 225, 0, NULL, NULL, 190, 1, 1, 2, 200, NULL, 9, 9, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 21:49:36', '2025-07-30 14:10:09', NULL);
INSERT INTO `contracts` VALUES (10, '9', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 2040, 170, 0, NULL, NULL, 840, 1, 1, 2, 201, NULL, 10, 10, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 21:50:13', '2025-07-31 11:26:24', NULL);
INSERT INTO `contracts` VALUES (12, '11', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 2520, 210, 0, NULL, NULL, 1470, 1, 1, 2, 204, NULL, 12, 12, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 21:51:53', '2025-07-31 11:30:11', NULL);
INSERT INTO `contracts` VALUES (14, '10', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 2700, 225, 0, NULL, NULL, 1175, 1, 1, 2, 203, NULL, 11, 11, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 21:56:22', '2025-08-06 15:00:13', NULL);
INSERT INTO `contracts` VALUES (15, '12', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-07-01', '2025-12-31', '2025-07-01', 1350, 225, 0, NULL, NULL, 450, 1, 1, 2, 259, NULL, 13, 13, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 21:57:25', '2025-08-05 15:00:56', NULL);
INSERT INTO `contracts` VALUES (16, '13', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-07-01', '2025-12-31', '2025-07-01', 1350, 225, 0, NULL, NULL, 225, 1, 1, 2, 260, NULL, 14, 14, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 21:58:19', '2025-08-03 22:10:49', NULL);
INSERT INTO `contracts` VALUES (17, '14', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 3000, 250, 0, NULL, NULL, 503, 1, 1, 2, 207, NULL, 19, 19, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 22:00:00', '2025-07-30 11:56:00', NULL);
INSERT INTO `contracts` VALUES (18, '15', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-07-01', '2025-12-31', '2025-06-01', 1500, 250, 0, NULL, NULL, 570, 1, 1, 2, 232, NULL, 20, 20, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 22:01:14', '2025-07-31 13:11:39', NULL);
INSERT INTO `contracts` VALUES (19, '16', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 960, 80, 0, NULL, NULL, 560, 1, 1, 2, 257, NULL, 21, 21, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 22:03:52', '2025-07-30 11:58:31', NULL);
INSERT INTO `contracts` VALUES (20, '17', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 1800, 150, 0, NULL, NULL, 600, 1, 1, 2, 209, NULL, 22, 22, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 22:04:35', '2025-07-22 22:57:25', NULL);
INSERT INTO `contracts` VALUES (21, '18', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 1800, 150, 0, NULL, NULL, 949, 1, 1, 2, 210, NULL, 23, 23, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 22:05:30', '2025-08-10 11:41:02', NULL);
INSERT INTO `contracts` VALUES (22, '19', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-03-01', '2025-12-31', '2025-03-01', 1500, 150, 0, NULL, NULL, 900, 1, 1, 2, 231, NULL, 24, 24, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 22:06:13', '2025-08-07 17:28:14', NULL);
INSERT INTO `contracts` VALUES (24, '21', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 1800, 150, 0, NULL, NULL, 879.45, 1, 1, 2, 214, NULL, 27, 27, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 22:08:02', '2025-08-05 14:48:27', NULL);
INSERT INTO `contracts` VALUES (25, '20', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 1800, 150, 0, NULL, NULL, 1050, 1, 1, 2, 213, NULL, 26, 26, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 22:10:20', '2025-07-28 16:52:59', NULL);
INSERT INTO `contracts` VALUES (26, '22', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 3600, 300, 0, NULL, NULL, 1650, 1, 1, 2, 215, NULL, 28, 28, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 22:11:01', '2025-07-29 12:07:39', NULL);
INSERT INTO `contracts` VALUES (27, '23', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 3600, 300, 0, NULL, NULL, 2700, 1, 1, 2, 216, NULL, 45, 45, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 22:23:33', '2025-07-22 22:57:25', NULL);
INSERT INTO `contracts` VALUES (28, '24', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 960, 80, 0, NULL, NULL, 560, 1, 1, 2, 228, NULL, 29, 29, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 22:29:12', '2025-07-22 22:57:25', NULL);
INSERT INTO `contracts` VALUES (29, '25', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 2100, 175, 0, NULL, NULL, 1575, 1, 1, 2, 222, NULL, 30, 30, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 22:30:11', '2025-07-28 18:26:04', NULL);
INSERT INTO `contracts` VALUES (30, '26', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 840, 70, 0, NULL, NULL, 560, 1, 1, 2, 229, NULL, 31, 31, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 22:31:55', '2025-08-09 11:12:27', NULL);
INSERT INTO `contracts` VALUES (31, '27', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-07-31', '2025-01-01', 875, 125, 0, NULL, NULL, 750, 1, 2, 2, 230, NULL, 32, 32, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 22:33:35', '2025-08-01 14:14:09', NULL);
INSERT INTO `contracts` VALUES (32, '28', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 960, 80, 0, NULL, NULL, 560, 1, 1, 2, 226, NULL, 33, 33, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 22:34:24', '2025-07-28 13:39:21', NULL);
INSERT INTO `contracts` VALUES (33, '29', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 960, 80, 0, NULL, NULL, 560, 1, 1, 2, 226, NULL, 34, 34, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 22:35:03', '2025-07-28 13:41:07', NULL);
INSERT INTO `contracts` VALUES (34, '30', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 1020, 85, 0, NULL, NULL, 595, 1, 1, 2, 227, NULL, 35, 35, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 22:36:06', '2025-07-22 22:57:25', NULL);
INSERT INTO `contracts` VALUES (35, '34', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 840, 70, 0, NULL, NULL, 560, 1, 1, 2, 223, NULL, 36, 36, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 22:36:58', '2025-08-04 21:13:34', NULL);
INSERT INTO `contracts` VALUES (36, '35', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 840, 70, 0, NULL, NULL, 560, 1, 1, 2, 223, NULL, 37, 37, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 22:37:38', '2025-08-04 21:19:13', NULL);
INSERT INTO `contracts` VALUES (37, '36', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-06-15', '2025-12-31', '2025-06-01', 480, 70, 0, NULL, NULL, 200, 1, 1, 2, 254, NULL, 38, 38, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 22:41:16', '2025-08-09 13:02:59', NULL);
INSERT INTO `contracts` VALUES (38, '37', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 840, 70, 0, NULL, NULL, 560, 1, 1, 2, 225, NULL, 39, 39, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 22:42:16', '2025-08-09 13:02:44', NULL);
INSERT INTO `contracts` VALUES (39, '31', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 2000.004, 166.667, 0, NULL, NULL, 2000.004, 1, 1, 2, 218, NULL, 40, 40, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 22:44:20', '2025-07-28 17:25:14', NULL);
INSERT INTO `contracts` VALUES (40, '32', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 4000.008, 333.334, 0, NULL, NULL, 2633.338, 1, 1, 2, 220, NULL, 41, 41, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 22:45:22', '2025-08-03 22:12:25', NULL);
INSERT INTO `contracts` VALUES (42, '38', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 3600, 300, 0, NULL, NULL, 2000, 1, 1, 2, 221, NULL, 44, 44, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 22:47:16', '2025-08-06 14:49:29', NULL);
INSERT INTO `contracts` VALUES (43, '33', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-12-31', '2025-01-01', 2000.004, 166.667, 0, NULL, NULL, 1837.996, 1, 1, 2, 219, NULL, 43, 43, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 22:48:16', '2025-07-28 17:26:53', NULL);
INSERT INTO `contracts` VALUES (44, '44', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-06-30', '2025-01-01', 3000, 500, 0, NULL, NULL, 1900, 1, 2, 2, 193, NULL, 1, 1, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-27 15:10:46', '2025-08-01 14:08:47', NULL);
INSERT INTO `contracts` VALUES (45, '45', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-06-30', '2025-01-01', 1800, 300, 0, NULL, NULL, 1800, 1, 2, 2, 258, NULL, 2, 2, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:42:18', '2025-07-30 13:36:32', NULL);
INSERT INTO `contracts` VALUES (46, '46', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-03-31', '2025-01-01', 366.675, 122.225, 0, NULL, NULL, 366.675, 1, 2, 2, 261, NULL, 16, 16, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:44:22', '2025-07-30 13:37:23', NULL);
INSERT INTO `contracts` VALUES (47, '47', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-03-31', '2025-01-01', 366.675, 122.225, 0, NULL, NULL, 366.675, 1, 2, 2, 262, NULL, 17, 17, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:44:58', '2025-07-30 13:37:57', NULL);
INSERT INTO `contracts` VALUES (48, '48', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-03-31', '2025-01-01', 366.675, 122.225, 0, NULL, NULL, 366.675, 1, 2, 2, 263, NULL, 18, 18, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:45:43', '2025-07-30 13:42:44', NULL);
INSERT INTO `contracts` VALUES (49, '49', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-05-01', '2025-06-30', '2025-07-28', 500, 250, 0, NULL, NULL, 500, 1, 2, 2, 260, NULL, 14, 14, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 13:47:15', '2025-07-30 13:44:35', NULL);
INSERT INTO `contracts` VALUES (50, '50', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-06-30', '2025-01-01', 1350, 225, 0, NULL, NULL, 24.6, 1, 2, 2, 205, NULL, 13, 13, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 17:50:37', '2025-07-31 10:01:27', NULL);
INSERT INTO `contracts` VALUES (51, '51', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-02-28', '2025-01-01', 170, 85, 0, NULL, NULL, 170, 1, 2, 2, 264, NULL, 15, 15, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 17:56:03', '2025-07-31 10:00:25', NULL);
INSERT INTO `contracts` VALUES (52, '52', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-05-31', '2025-01-01', 750, 150, 0, NULL, NULL, 750, 1, 2, 2, 212, NULL, 25, 25, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 18:10:31', '2025-07-31 10:13:42', NULL);
INSERT INTO `contracts` VALUES (53, '53', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-06-01', '2025-06-30', '2025-06-01', 150, 150, 0, NULL, NULL, 150, 1, 2, 2, 265, NULL, 25, 25, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 18:13:31', '2025-08-01 14:11:26', NULL);
INSERT INTO `contracts` VALUES (54, '54', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-07-15', '2025-07-31', '2025-07-01', 75, 150, 0, NULL, NULL, 75, 1, 2, 2, 266, NULL, 25, 25, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-28 18:18:11', '2025-08-10 11:40:13', NULL);
INSERT INTO `contracts` VALUES (55, '55', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-05', '2025-02-28', '2025-01-01', 137, 70, 0, NULL, NULL, 137, 1, 2, 2, 224, NULL, 38, 38, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-29 13:23:43', '2025-07-31 10:11:48', NULL);
INSERT INTO `contracts` VALUES (56, '56', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-15', '2025-03-31', '2025-01-01', 625, 250, 0, NULL, NULL, 590, 1, 2, 2, 208, NULL, 20, 20, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-31 10:16:08', '2025-07-31 13:12:25', NULL);
INSERT INTO `contracts` VALUES (57, '57', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-08-01', '2025-12-31', '2025-08-02', 625, 125, 0, NULL, NULL, 125, 1, 1, 2, 267, NULL, 32, 32, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-02 12:07:57', '2025-08-02 12:50:04', NULL);
INSERT INTO `contracts` VALUES (58, '58', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-01-31', '2025-01-01', 225, 225, 0, NULL, NULL, 225, 1, 2, 2, 206, NULL, 14, 14, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-04 13:31:14', '2025-08-04 13:33:52', NULL);
INSERT INTO `contracts` VALUES (59, '59', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-01-01', '2025-01-31', '2025-01-01', 150, 150, 0, NULL, NULL, 150, 1, 2, 2, 211, NULL, 24, 24, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-04 13:35:57', '2025-08-04 13:36:57', NULL);
INSERT INTO `contracts` VALUES (60, '60', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-08-01', '2025-08-31', '2025-08-01', 100, 100, 0, NULL, NULL, 0, 1, 1, 2, 266, NULL, 25, 25, 1, NULL, 1, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-04 14:41:32', '2025-08-04 14:41:32', NULL);

-- ----------------------------
-- Table structure for cost_centers
-- ----------------------------
CREATE TABLE `cost_centers`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `foreign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `cost_center_id` int UNSIGNED NULL DEFAULT NULL,
  `main_child_zeros` int NULL DEFAULT NULL,
  `main_child_counter` int NULL DEFAULT NULL,
  `sub_child_zeros` int NULL DEFAULT NULL,
  `sub_child_counter` int NULL DEFAULT NULL,
  `branch_id` int UNSIGNED NULL DEFAULT NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `cost_centers_cost_center_id_foreign`(`cost_center_id` ASC) USING BTREE,
  INDEX `cost_centers_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `cost_centers_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `cost_centers_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `cost_centers_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `cost_centers_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `cost_centers_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `cost_centers_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 46 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of cost_centers
-- ----------------------------
INSERT INTO `cost_centers` VALUES (1, 'محل رقم 1 + 2', NULL, '1', NULL, 10, NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-06-12 14:05:49', '2025-08-02 16:40:57', NULL);
INSERT INTO `cost_centers` VALUES (2, 'محل رقم 3', NULL, '2', NULL, 10, NULL, 1000, NULL, 1, 71, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:04:04', '2025-07-23 10:48:08', NULL);
INSERT INTO `cost_centers` VALUES (3, 'محل رقم 4', NULL, '3', NULL, 10, NULL, 1000, NULL, 1, 71, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:04:08', '2025-07-23 10:47:45', NULL);
INSERT INTO `cost_centers` VALUES (4, 'محل رقم 5', NULL, '4', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:16:15', '2025-07-12 21:16:15', NULL);
INSERT INTO `cost_centers` VALUES (5, 'محل رقم 6+7', NULL, '5', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:17:38', '2025-07-12 21:17:38', NULL);
INSERT INTO `cost_centers` VALUES (6, 'محل رقم 8', NULL, '6', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:17:46', '2025-07-12 21:17:46', NULL);
INSERT INTO `cost_centers` VALUES (7, 'محل رقم 9', NULL, '7', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:17:55', '2025-07-12 21:17:55', NULL);
INSERT INTO `cost_centers` VALUES (8, 'محل رقم 10', NULL, '8', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:18:04', '2025-07-12 21:18:04', NULL);
INSERT INTO `cost_centers` VALUES (9, 'محل رقم 11', NULL, '9', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:18:16', '2025-07-12 21:18:16', NULL);
INSERT INTO `cost_centers` VALUES (10, 'محل رقم 12', NULL, '10', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:18:24', '2025-07-12 21:18:24', NULL);
INSERT INTO `cost_centers` VALUES (11, 'محل رقم 13', NULL, '11', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:18:28', '2025-07-12 21:18:28', NULL);
INSERT INTO `cost_centers` VALUES (12, 'محل رقم 14', NULL, '12', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:18:34', '2025-07-12 21:18:34', NULL);
INSERT INTO `cost_centers` VALUES (13, 'محل رقم 15', NULL, '13', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:18:42', '2025-07-12 21:18:42', NULL);
INSERT INTO `cost_centers` VALUES (14, 'محل رقم 16', NULL, '14', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:19:05', '2025-07-12 21:19:05', NULL);
INSERT INTO `cost_centers` VALUES (15, 'محل رقم 17', NULL, '15', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:19:11', '2025-07-12 21:19:11', NULL);
INSERT INTO `cost_centers` VALUES (16, 'محل رقم 18', NULL, '16', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:19:22', '2025-07-12 21:19:22', NULL);
INSERT INTO `cost_centers` VALUES (17, 'محل رقم 19', NULL, '17', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:19:29', '2025-07-12 21:19:29', NULL);
INSERT INTO `cost_centers` VALUES (18, 'محل رقم 20', NULL, '18', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:19:36', '2025-07-12 21:19:36', NULL);
INSERT INTO `cost_centers` VALUES (19, 'محل رقم 21+22', NULL, '19', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:19:45', '2025-07-12 21:19:45', NULL);
INSERT INTO `cost_centers` VALUES (20, 'محل 23+24', NULL, '20', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:19:51', '2025-07-12 21:19:51', NULL);
INSERT INTO `cost_centers` VALUES (21, 'محل رقم 25', NULL, '21', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:19:58', '2025-07-12 21:19:58', NULL);
INSERT INTO `cost_centers` VALUES (22, 'محل رقم 26', NULL, '22', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:20:06', '2025-07-12 21:20:06', NULL);
INSERT INTO `cost_centers` VALUES (23, 'محل رقم 27', NULL, '23', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:20:15', '2025-07-12 21:20:15', NULL);
INSERT INTO `cost_centers` VALUES (24, 'محل رقم 28', NULL, '24', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:20:24', '2025-07-12 21:20:24', NULL);
INSERT INTO `cost_centers` VALUES (25, 'محل رقم 29', NULL, '25', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:20:36', '2025-07-12 21:20:36', NULL);
INSERT INTO `cost_centers` VALUES (26, 'محل رقم 30', NULL, '26', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:20:44', '2025-07-12 21:20:44', NULL);
INSERT INTO `cost_centers` VALUES (27, 'محل رقم 31', NULL, '27', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:20:54', '2025-07-12 21:20:54', NULL);
INSERT INTO `cost_centers` VALUES (28, 'محل رقم 32+33', NULL, '28', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:21:01', '2025-07-12 21:21:01', NULL);
INSERT INTO `cost_centers` VALUES (29, 'سكن غرفة رقم 1 / خلف المكتب', NULL, '29', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:21:13', '2025-07-12 21:21:13', NULL);
INSERT INTO `cost_centers` VALUES (30, 'سكن غرفة رقم 2 / فوق محل 1+2', NULL, '30', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:21:22', '2025-07-12 21:21:22', NULL);
INSERT INTO `cost_centers` VALUES (31, 'سكن غرفة رقم 3 / فوق محل رقم 4', NULL, '31', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:21:31', '2025-07-12 21:21:31', NULL);
INSERT INTO `cost_centers` VALUES (32, 'سكن غرفة رقم 4 / فوق محل 3+4', NULL, '32', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:21:42', '2025-07-12 21:21:42', NULL);
INSERT INTO `cost_centers` VALUES (33, 'سكن غرفة رقم 5 / طابق اول يمين', NULL, '33', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:21:50', '2025-07-12 21:21:50', NULL);
INSERT INTO `cost_centers` VALUES (34, 'سكن فرفة رقم 6 / طابق اول يمين', NULL, '34', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:21:59', '2025-07-12 21:21:59', NULL);
INSERT INTO `cost_centers` VALUES (35, 'سكن غرفة رقم 7 / طابق اول يمين', NULL, '35', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:22:05', '2025-07-12 21:22:05', NULL);
INSERT INTO `cost_centers` VALUES (36, 'سكن غرفة رقم 8 / طابق ثاني شمال', NULL, '36', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:22:13', '2025-07-12 21:22:13', NULL);
INSERT INTO `cost_centers` VALUES (37, 'سكن فرغة رقم 9 / طابق ثاني شمال', NULL, '37', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:22:21', '2025-07-12 21:22:21', NULL);
INSERT INTO `cost_centers` VALUES (38, 'سكن غرفة رقم 10 / طابق ثاني شمال', NULL, '38', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:22:30', '2025-07-12 21:22:30', NULL);
INSERT INTO `cost_centers` VALUES (39, 'سكن غرفة رقم 11 / طابق ثاني شمال', NULL, '39', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:22:36', '2025-07-12 21:22:36', NULL);
INSERT INTO `cost_centers` VALUES (40, 'مشغل طابق اول يمين', NULL, '40', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:22:44', '2025-07-12 21:22:44', NULL);
INSERT INTO `cost_centers` VALUES (41, 'مشغل طابق اول شمال', NULL, '41', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:23:48', '2025-07-12 21:23:48', NULL);
INSERT INTO `cost_centers` VALUES (42, 'مشغل طابق ثاني يمين', NULL, '42', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:24:05', '2025-07-12 21:24:05', NULL);
INSERT INTO `cost_centers` VALUES (43, 'مشغل طابق ثاني شمال', NULL, '43', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:24:18', '2025-07-12 21:24:18', NULL);
INSERT INTO `cost_centers` VALUES (44, 'مشغل طابق ثالث شمال / هنجر', NULL, '44', NULL, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:24:33', '2025-07-12 21:24:33', NULL);
INSERT INTO `cost_centers` VALUES (45, 'الارض الفارغة', NULL, '45', 45, 10, NULL, 1000, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '2025-07-12 21:55:07', '2025-08-02 16:43:25', NULL);

-- ----------------------------
-- Table structure for countries
-- ----------------------------
CREATE TABLE `countries`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `foreign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `phone_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `countries_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `countries_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `countries_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `countries_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `countries_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `countries_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of countries
-- ----------------------------
INSERT INTO `countries` VALUES (1, 'الاردن', 'jordan', '1', '962', 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:48', '2025-06-12 14:05:48', NULL);
INSERT INTO `countries` VALUES (2, 'فلسطين', 'palestine', '2', '970', 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:48', '2025-06-12 14:05:48', NULL);

-- ----------------------------
-- Table structure for credit_cards
-- ----------------------------
CREATE TABLE `credit_cards`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `percentage` double NULL DEFAULT NULL,
  `value` double NULL DEFAULT NULL,
  `expense_account_id` int UNSIGNED NULL DEFAULT NULL,
  `bank_account_id` int UNSIGNED NULL DEFAULT NULL,
  `is_it_pos_payment_method` int UNSIGNED NULL DEFAULT NULL,
  `branch_id` int UNSIGNED NOT NULL,
  `take_all_the_batch` int UNSIGNED NULL DEFAULT NULL,
  `can_tack_refund` int UNSIGNED NULL DEFAULT NULL,
  `is_it_loyalty_point` int UNSIGNED NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `credit_cards_expense_account_id_foreign`(`expense_account_id` ASC) USING BTREE,
  INDEX `credit_cards_take_all_the_batch_foreign`(`take_all_the_batch` ASC) USING BTREE,
  INDEX `credit_cards_is_it_pos_payment_method_foreign`(`is_it_pos_payment_method` ASC) USING BTREE,
  INDEX `credit_cards_bank_account_id_foreign`(`bank_account_id` ASC) USING BTREE,
  INDEX `credit_cards_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `credit_cards_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `credit_cards_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `credit_cards_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `credit_cards_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `credit_cards_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `credit_cards_bank_account_id_foreign` FOREIGN KEY (`bank_account_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `credit_cards_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `credit_cards_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `credit_cards_expense_account_id_foreign` FOREIGN KEY (`expense_account_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `credit_cards_is_it_pos_payment_method_foreign` FOREIGN KEY (`is_it_pos_payment_method`) REFERENCES `status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `credit_cards_take_all_the_batch_foreign` FOREIGN KEY (`take_all_the_batch`) REFERENCES `status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of credit_cards
-- ----------------------------

-- ----------------------------
-- Table structure for curds
-- ----------------------------
CREATE TABLE `curds`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `foreign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `curds_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `curds_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `curds_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `curds_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of curds
-- ----------------------------
INSERT INTO `curds` VALUES (1, 'انشاء', '1', 'Create', 1, NULL, NULL, '2025-06-12 14:05:47', '2025-06-12 14:05:47', NULL);

-- ----------------------------
-- Table structure for currencies
-- ----------------------------
CREATE TABLE `currencies`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `foreign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `symbol` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `current_rate` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `currencies_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `currencies_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `currencies_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `currencies_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `currencies_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `currencies_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of currencies
-- ----------------------------
INSERT INTO `currencies` VALUES (1, 'JOD', '1', NULL, 'JOD', '1', 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:48', '2025-06-12 14:05:48', NULL);
INSERT INTO `currencies` VALUES (2, 'USD', '2', NULL, 'USD', '0.71', 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:48', '2025-06-12 14:05:48', NULL);

-- ----------------------------
-- Table structure for customer_main_account_limits
-- ----------------------------
CREATE TABLE `customer_main_account_limits`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `from_date` date NOT NULL,
  `to_date` date NOT NULL,
  `customer_main_account_id` int UNSIGNED NOT NULL,
  `pipeline_counts` int UNSIGNED NULL DEFAULT NULL,
  `pipeline_value` double UNSIGNED NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `customer_main_account_limits_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `customer_main_account_limits_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `customer_main_account_limits_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `customer_main_account_limits_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `customer_main_account_limits_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `customer_main_account_limits_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `customer_main_account_limits_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `customer_main_account_limits_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of customer_main_account_limits
-- ----------------------------

-- ----------------------------
-- Table structure for customer_main_accounts
-- ----------------------------
CREATE TABLE `customer_main_accounts`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `foreign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `main_account_id` int UNSIGNED NULL DEFAULT NULL,
  `main_child_zeros` int NULL DEFAULT NULL,
  `main_child_counter` int NULL DEFAULT NULL,
  `sub_child_zeros` int NULL DEFAULT NULL,
  `sub_child_counter` int NULL DEFAULT NULL,
  `cost_center_id` int UNSIGNED NULL DEFAULT NULL,
  `journal_id` int UNSIGNED NULL DEFAULT NULL,
  `branch_id` int UNSIGNED NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `customer_main_accounts_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `customer_main_accounts_main_account_id_foreign`(`main_account_id` ASC) USING BTREE,
  INDEX `customer_main_accounts_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `customer_main_accounts_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `customer_main_accounts_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `customer_main_accounts_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `customer_main_accounts_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `customer_main_accounts_main_account_id_foreign` FOREIGN KEY (`main_account_id`) REFERENCES `customer_main_accounts` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of customer_main_accounts
-- ----------------------------
INSERT INTO `customer_main_accounts` VALUES (1, 'المستأجرين', '1131', 'Customers', NULL, 10, NULL, 1000, 60, NULL, NULL, 1, NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:48', '2025-08-02 12:06:59', NULL);

-- ----------------------------
-- Table structure for customers
-- ----------------------------
CREATE TABLE `customers`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `foreign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `tax_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `mobile` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `country_id` int UNSIGNED NULL DEFAULT NULL,
  `city_id` int UNSIGNED NULL DEFAULT NULL,
  `branch_id` int UNSIGNED NULL DEFAULT NULL,
  `customer_main_account_id` int UNSIGNED NULL DEFAULT NULL,
  `permission_id` int UNSIGNED NULL DEFAULT NULL,
  `sales_account_user_id` int UNSIGNED NULL DEFAULT NULL,
  `sell_under_cost` int UNSIGNED NULL DEFAULT NULL,
  `point_of_sale_barcode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `e_invoice_data` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `tax_state_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `bulding_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `street_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `district` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `city` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `country` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `postal_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `additional_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `other_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `sales_payment_term_id` int UNSIGNED NULL DEFAULT NULL,
  `purchase_payment_term_id` int UNSIGNED NULL DEFAULT NULL,
  `financial_account_type_id` int UNSIGNED NULL DEFAULT NULL,
  `user_id` int UNSIGNED NULL DEFAULT NULL,
  `sales_person` int UNSIGNED NULL DEFAULT NULL,
  `bank_account` int UNSIGNED NULL DEFAULT NULL,
  `account_address_id` int UNSIGNED NULL DEFAULT NULL,
  `balance_limit_exception` int UNSIGNED NULL DEFAULT NULL,
  `send_notification_to_approve_balance_limit_exception` int UNSIGNED NULL DEFAULT NULL,
  `send_invoices_alert_via_whatsapp` int UNSIGNED NULL DEFAULT NULL,
  `longitude` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `latitudes` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `multiple_branches` int UNSIGNED NULL DEFAULT NULL,
  `payment_method_id` int UNSIGNED NULL DEFAULT NULL,
  `selling_price_by_last_selling_price` int UNSIGNED NULL DEFAULT NULL,
  `balance_limit` double NULL DEFAULT NULL,
  `minimum_value_for_purchases` double NULL DEFAULT NULL,
  `minimum_value_for_sales` double NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `customers_country_id_foreign`(`country_id` ASC) USING BTREE,
  INDEX `customers_city_id_foreign`(`city_id` ASC) USING BTREE,
  INDEX `customers_customer_main_account_id_foreign`(`customer_main_account_id` ASC) USING BTREE,
  INDEX `customers_sales_payment_term_id_foreign`(`sales_payment_term_id` ASC) USING BTREE,
  INDEX `customers_purchase_payment_term_id_foreign`(`purchase_payment_term_id` ASC) USING BTREE,
  INDEX `customers_financial_account_type_id_foreign`(`financial_account_type_id` ASC) USING BTREE,
  INDEX `customers_user_id_foreign`(`user_id` ASC) USING BTREE,
  INDEX `customers_sales_person_foreign`(`sales_person` ASC) USING BTREE,
  INDEX `customers_bank_account_foreign`(`bank_account` ASC) USING BTREE,
  INDEX `customers_account_address_id_foreign`(`account_address_id` ASC) USING BTREE,
  INDEX `customers_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `customers_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `customers_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `customers_account_address_id_foreign` FOREIGN KEY (`account_address_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `customers_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `customers_bank_account_foreign` FOREIGN KEY (`bank_account`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `customers_city_id_foreign` FOREIGN KEY (`city_id`) REFERENCES `cities` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `customers_country_id_foreign` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `customers_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `customers_customer_main_account_id_foreign` FOREIGN KEY (`customer_main_account_id`) REFERENCES `customer_main_accounts` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `customers_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `customers_financial_account_type_id_foreign` FOREIGN KEY (`financial_account_type_id`) REFERENCES `financial_account_types` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `customers_purchase_payment_term_id_foreign` FOREIGN KEY (`purchase_payment_term_id`) REFERENCES `payment_terms` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `customers_sales_payment_term_id_foreign` FOREIGN KEY (`sales_payment_term_id`) REFERENCES `payment_terms` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `customers_sales_person_foreign` FOREIGN KEY (`sales_person`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `customers_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 63 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of customers
-- ----------------------------
INSERT INTO `customers` VALUES (1, 'اسامة مصطفى خالد حسين', NULL, '1131001', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 193, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:46', '2025-07-08 18:53:46', NULL);
INSERT INTO `customers` VALUES (2, 'محمد يزيد اسماعيل ابو عواد', NULL, '1131002', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 194, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:46', '2025-07-08 18:53:46', NULL);
INSERT INTO `customers` VALUES (3, 'احمد عمر مصطفى رمان ', NULL, '1131003', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 195, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:46', '2025-07-08 18:53:46', NULL);
INSERT INTO `customers` VALUES (4, 'لؤي محمد مسلم العزة', NULL, '1131004', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 196, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:46', '2025-07-08 18:53:46', NULL);
INSERT INTO `customers` VALUES (5, 'عز الدين محمد حسين الخوالدة ', NULL, '1131005', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 197, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:46', '2025-07-08 18:53:46', NULL);
INSERT INTO `customers` VALUES (6, 'صالح ابراهيم عبد صدقه', NULL, '1131006', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 198, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:46', '2025-07-08 18:53:46', NULL);
INSERT INTO `customers` VALUES (7, 'هيثم حنون ', NULL, '1131007', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 199, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:46', '2025-07-08 18:53:46', NULL);
INSERT INTO `customers` VALUES (8, 'صالح علي صالح القريناوي', NULL, '1131008', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 200, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 1, NULL, NULL, 450, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:46', '2025-07-31 12:56:24', NULL);
INSERT INTO `customers` VALUES (9, 'محمد سعدات الكور ', NULL, '1131009', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 201, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:46', '2025-07-08 18:53:46', NULL);
INSERT INTO `customers` VALUES (10, 'هشام ابو عواد ', NULL, '1131010', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 202, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:46', '2025-07-08 18:53:46', NULL);
INSERT INTO `customers` VALUES (11, 'هاني محمد حسن موسى ', NULL, '1131011', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 203, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:46', '2025-07-08 18:53:46', NULL);
INSERT INTO `customers` VALUES (12, 'عمر هارون', NULL, '1131012', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 204, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:46', '2025-07-08 18:53:46', NULL);
INSERT INTO `customers` VALUES (13, 'اسماعيل داوود / محل 15', NULL, '1131013', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 205, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:46', '2025-07-30 12:39:02', NULL);
INSERT INTO `customers` VALUES (14, 'يزن ابو صالح ', NULL, '1131014', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 206, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:46', '2025-07-08 18:53:46', NULL);
INSERT INTO `customers` VALUES (15, 'ايمن مناع/ محل 21+22', NULL, '1131015', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 207, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:46', '2025-07-30 10:53:15', NULL);
INSERT INTO `customers` VALUES (16, 'محمد رجب وزياد دوديين', NULL, '1131016', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 208, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:46', '2025-07-08 18:53:46', NULL);
INSERT INTO `customers` VALUES (17, 'ناصر محمود السلاق', NULL, '1131017', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 209, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:46', '2025-07-08 18:53:46', NULL);
INSERT INTO `customers` VALUES (18, 'حسين الغزاوي', NULL, '1131018', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 210, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 1, NULL, NULL, 300, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-31 12:54:56', NULL);
INSERT INTO `customers` VALUES (19, 'بلال عميره ', NULL, '1131019', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 211, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-08 18:53:47', NULL);
INSERT INTO `customers` VALUES (20, 'يزن نضال فهمي عجاوي ', NULL, '1131020', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 212, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-08 18:53:47', NULL);
INSERT INTO `customers` VALUES (21, 'محمد عصام يوسف ملحم', NULL, '1131021', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 213, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-08 18:53:47', NULL);
INSERT INTO `customers` VALUES (22, 'محمد زاهي مصطفى الشلبي', NULL, '1131022', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 214, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-08 18:53:47', NULL);
INSERT INTO `customers` VALUES (23, 'توفيق عبد قعدان', NULL, '1131023', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 215, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-08 18:53:47', NULL);
INSERT INTO `customers` VALUES (24, 'خضر جميل ابو نجم ', NULL, '1131024', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 216, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-08 18:53:47', NULL);
INSERT INTO `customers` VALUES (25, 'طابق ثاني يمين ', NULL, '1131025', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 217, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-08 18:53:47', NULL);
INSERT INTO `customers` VALUES (26, 'مراد الشويكي مشغل طابق اول ', NULL, '1131026', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 218, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-08 18:53:47', NULL);
INSERT INTO `customers` VALUES (27, 'مراد الشويكي مشغل طابق ثاني', NULL, '1131027', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 219, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-08 18:53:47', NULL);
INSERT INTO `customers` VALUES (28, 'نبيل مناصره ', NULL, '1131028', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 220, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-08 18:53:47', NULL);
INSERT INTO `customers` VALUES (29, 'سامي درويش ', NULL, '1131029', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 221, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-08 18:53:47', NULL);
INSERT INTO `customers` VALUES (30, 'الشركة العربية للتجهيزات الغذائية ', NULL, '1131030', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 222, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-08 18:53:47', NULL);
INSERT INTO `customers` VALUES (31, 'قهوة ابو عروب', NULL, '1131031', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 223, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-29 12:24:03', NULL);
INSERT INTO `customers` VALUES (32, 'عمرو / غرفة 10 ط/2ش', NULL, '1131032', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 224, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-29 12:27:47', NULL);
INSERT INTO `customers` VALUES (33, 'اسلام / غرفة 11 ط/2ش', NULL, '1131033', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 225, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-29 12:29:40', NULL);
INSERT INTO `customers` VALUES (34, 'مخابز الايمان / غرفة 5+6 / ط1 يمين', NULL, '1131034', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 226, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-29 12:54:39', NULL);
INSERT INTO `customers` VALUES (35, 'اليمنيين / غرفة 7 / ط1يمين', NULL, '1131035', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 227, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-29 12:53:34', NULL);
INSERT INTO `customers` VALUES (36, 'مرشدي رزق النحراوي / غرفة 1', NULL, '1131036', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 228, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-29 12:45:37', NULL);
INSERT INTO `customers` VALUES (37, 'ابو احمد  / غرفة 3', NULL, '1131037', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 229, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-29 12:49:37', NULL);
INSERT INTO `customers` VALUES (38, 'مشغل موفق النعيمي ', NULL, '1131038', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 230, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-08 18:53:47', NULL);
INSERT INTO `customers` VALUES (39, 'محمود محمد عبد الفتاح الكيالي/ محل رقم 28', NULL, '1131039', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 231, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-30 12:41:37', NULL);
INSERT INTO `customers` VALUES (40, 'محمد حبيب مؤيد خالد', NULL, '1131040', NULL, NULL, NULL, '0790063159', NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 232, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-08-04 11:06:02', NULL);
INSERT INTO `customers` VALUES (41, 'عز الدين عماد الجنيدي ', NULL, '1131041', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 233, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-08 18:53:47', NULL);
INSERT INTO `customers` VALUES (42, 'مجدي جلال موسى جمعه ', NULL, '1131042', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 234, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-08 18:53:47', NULL);
INSERT INTO `customers` VALUES (43, ' زياد سليمان ', NULL, '1131043', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 235, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-08 18:53:47', NULL);
INSERT INTO `customers` VALUES (44, 'محمد يوسف جميل الشرقاوي', NULL, '1131044', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 236, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-08 18:53:47', NULL);
INSERT INTO `customers` VALUES (45, 'احمد فخر الدين زيادة', NULL, '1131045', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 237, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-08 18:53:47', NULL);
INSERT INTO `customers` VALUES (46, 'محمد عادل حسين العتال ', NULL, '1131046', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 238, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-08 18:53:47', NULL);
INSERT INTO `customers` VALUES (47, 'محمد ياسر احمد العوايشة ', NULL, '1131047', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 239, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-08 18:53:47', NULL);
INSERT INTO `customers` VALUES (48, 'مجدي علي احمد الفروخ', NULL, '1131048', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 240, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-07-08 18:53:47', '2025-07-08 18:53:47', NULL);
INSERT INTO `customers` VALUES (50, 'محمد وسيم علي ابو عيشة', NULL, '1131049', 'الكرك', NULL, NULL, '0779875212', NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 249, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-13 17:59:01', '2025-07-13 17:59:01', NULL);
INSERT INTO `customers` VALUES (51, 'محمد سلامة', NULL, '1131050', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 254, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-18 22:40:20', '2025-07-18 22:40:20', NULL);
INSERT INTO `customers` VALUES (52, 'ايمن مناع / محل 25', NULL, '1131051', NULL, NULL, NULL, '0785067634', NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 257, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-30 10:54:03', '2025-08-04 11:05:20', NULL);
INSERT INTO `customers` VALUES (53, 'لؤي العزة / محل رقم 3', NULL, '1131052', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 258, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-30 12:21:17', '2025-07-30 12:21:17', NULL);
INSERT INTO `customers` VALUES (54, 'لؤي العزة / محل رقم 15', NULL, '1131053', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 259, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-30 12:21:42', '2025-07-30 12:21:42', NULL);
INSERT INTO `customers` VALUES (55, 'لؤي العزة / محل رقم 16', NULL, '1131054', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 260, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-30 12:21:58', '2025-07-30 12:21:58', NULL);
INSERT INTO `customers` VALUES (56, 'لؤي العزة / محل رقم 18', NULL, '1131055', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 261, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-30 12:22:26', '2025-07-30 12:22:26', NULL);
INSERT INTO `customers` VALUES (57, 'لؤي العزة / محل رقم 19', NULL, '1131056', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 262, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-30 12:22:42', '2025-07-30 12:22:42', NULL);
INSERT INTO `customers` VALUES (58, 'لؤي العزة / محل رقم 20', NULL, '1131057', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 263, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-30 12:23:06', '2025-07-30 12:23:06', NULL);
INSERT INTO `customers` VALUES (59, 'اسماعيل داوود / محل 17', NULL, '1131058', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 264, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-30 12:26:34', '2025-07-30 12:26:34', NULL);
INSERT INTO `customers` VALUES (60, 'محمود محمد عبد الفتاح الكيالي / محل 29', NULL, '1131059', NULL, NULL, NULL, '0796922834', NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 265, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-30 12:42:15', '2025-08-04 11:04:31', NULL);
INSERT INTO `customers` VALUES (61, 'حسين الغزاوي \\ محل 29', NULL, '1131060', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 266, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, 71, NULL, NULL, NULL, NULL, '2025-07-31 10:46:15', '2025-07-31 10:46:15', NULL);
INSERT INTO `customers` VALUES (62, 'محمد عدنان سليمان عبد الرازق و يزن اياد محمود العلي', NULL, '1131061', NULL, NULL, NULL, '0782299298', NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 267, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, 71, NULL, NULL, NULL, NULL, '2025-08-02 12:06:59', '2025-08-02 12:06:59', NULL);

-- ----------------------------
-- Table structure for daily_classes
-- ----------------------------
CREATE TABLE `daily_classes`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `date` date NOT NULL,
  `class_id` int UNSIGNED NOT NULL,
  `subject_id` int UNSIGNED NOT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `daily_classes_class_id_foreign`(`class_id` ASC) USING BTREE,
  INDEX `daily_classes_subject_id_foreign`(`subject_id` ASC) USING BTREE,
  INDEX `daily_classes_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `daily_classes_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `daily_classes_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `daily_classes_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `daily_classes_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `daily_classes_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `daily_classes_class_id_foreign` FOREIGN KEY (`class_id`) REFERENCES `classes` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `daily_classes_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `daily_classes_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `daily_classes_subject_id_foreign` FOREIGN KEY (`subject_id`) REFERENCES `subjects` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of daily_classes
-- ----------------------------

-- ----------------------------
-- Table structure for daily_notification_types
-- ----------------------------
CREATE TABLE `daily_notification_types`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `foreign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `daily_notification_types_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `daily_notification_types_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `daily_notification_types_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `daily_notification_types_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `daily_notification_types_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `daily_notification_types_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `daily_notification_types_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `daily_notification_types_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of daily_notification_types
-- ----------------------------
INSERT INTO `daily_notification_types` VALUES (1, 'اشعار بالقيود اليومية', '1', 'Daily Journal entries', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:53', '2025-06-12 14:05:53', NULL);
INSERT INTO `daily_notification_types` VALUES (2, 'اشعارات الشيكات', '2', 'Checks Notifications', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:53', '2025-06-12 14:05:53', NULL);
INSERT INTO `daily_notification_types` VALUES (3, 'اشعار بالمواد بطيئة الحركة', '3', 'Slow moving products notification', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:53', '2025-06-12 14:05:53', NULL);
INSERT INTO `daily_notification_types` VALUES (4, 'اشعار بأعادة طلب المواد', '4', 'Reorder Product notification', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:53', '2025-06-12 14:05:53', NULL);
INSERT INTO `daily_notification_types` VALUES (5, 'اشعار بتأخير الموظفين', '5', 'Notification of employees delays', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:53', '2025-06-12 14:05:53', NULL);
INSERT INTO `daily_notification_types` VALUES (6, 'اشعار بالحضور اليومي', '6', 'Dally attendance notification', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:53', '2025-06-12 14:05:53', NULL);
INSERT INTO `daily_notification_types` VALUES (7, 'اشعار بالتذكيرات', '7', 'Reminder Notifications', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:53', '2025-06-12 14:05:53', NULL);
INSERT INTO `daily_notification_types` VALUES (8, 'اشعار باعادة طلب المواد', '8', 'Product reorder notification', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:53', '2025-06-12 14:05:53', NULL);
INSERT INTO `daily_notification_types` VALUES (9, 'اشعار بالمواد بطيئة الحركة', '9', 'Slow moving product notification', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:53', '2025-06-12 14:05:53', NULL);
INSERT INTO `daily_notification_types` VALUES (10, 'اشعار بمبيعات نقاط البيع', '10', 'Pos sales', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:53', '2025-06-12 14:05:53', NULL);

-- ----------------------------
-- Table structure for daily_notifications
-- ----------------------------
CREATE TABLE `daily_notifications`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `user_id` int UNSIGNED NULL DEFAULT NULL,
  `notification_type_id` int UNSIGNED NOT NULL,
  `daily_notification_type_id` int UNSIGNED NOT NULL,
  `value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `number_of_days` int UNSIGNED NULL DEFAULT NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `daily_notifications_user_id_foreign`(`user_id` ASC) USING BTREE,
  INDEX `daily_notifications_notification_type_id_foreign`(`notification_type_id` ASC) USING BTREE,
  INDEX `daily_notifications_daily_notification_type_id_foreign`(`daily_notification_type_id` ASC) USING BTREE,
  INDEX `daily_notifications_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `daily_notifications_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `daily_notifications_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `daily_notifications_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `daily_notifications_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `daily_notifications_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `daily_notifications_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `daily_notifications_daily_notification_type_id_foreign` FOREIGN KEY (`daily_notification_type_id`) REFERENCES `daily_notification_types` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `daily_notifications_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `daily_notifications_notification_type_id_foreign` FOREIGN KEY (`notification_type_id`) REFERENCES `notification_types` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `daily_notifications_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of daily_notifications
-- ----------------------------

-- ----------------------------
-- Table structure for days
-- ----------------------------
CREATE TABLE `days`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `foreign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `days_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `days_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `days_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `days_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `days_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `days_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `days_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `days_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of days
-- ----------------------------
INSERT INTO `days` VALUES (1, 'السبت', '1', 'Saturday', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:56', '2025-06-12 14:05:56', NULL);
INSERT INTO `days` VALUES (2, 'الاحد', '2', 'Sunday', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:56', '2025-06-12 14:05:56', NULL);
INSERT INTO `days` VALUES (3, 'الاثنين', '3', 'Monday', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:56', '2025-06-12 14:05:56', NULL);
INSERT INTO `days` VALUES (4, 'الثلاثاء', '4', 'Tuesday', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:56', '2025-06-12 14:05:56', NULL);
INSERT INTO `days` VALUES (5, 'الاربعاء', '5', 'Wednesday', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:56', '2025-06-12 14:05:56', NULL);
INSERT INTO `days` VALUES (6, 'الخميس', '6', 'Thursday', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:56', '2025-06-12 14:05:56', NULL);
INSERT INTO `days` VALUES (7, 'الجمعة', '7', 'Friday', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:56', '2025-06-12 14:05:56', NULL);

-- ----------------------------
-- Table structure for deductions
-- ----------------------------
CREATE TABLE `deductions`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `foreign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `value` double NULL DEFAULT NULL,
  `percentage_from_main_salary` double NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `deductions_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `deductions_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `deductions_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `deductions_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `deductions_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `deductions_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `deductions_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `deductions_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of deductions
-- ----------------------------
INSERT INTO `deductions` VALUES (1, '10 % على الراتب الاساسي', '1', '10 Percentage on main salary deduction', NULL, 10, NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:52', '2025-06-12 14:05:52', NULL);
INSERT INTO `deductions` VALUES (2, 'اقتطاع  10 دنانير', '1', '10 Jd deduction', 10, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:52', '2025-06-12 14:05:52', NULL);

-- ----------------------------
-- Table structure for deleted_pos_products
-- ----------------------------
CREATE TABLE `deleted_pos_products`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `product_id` int UNSIGNED NOT NULL,
  `user_id` int UNSIGNED NOT NULL,
  `price` double NOT NULL,
  `quantity` double NULL DEFAULT NULL,
  `printed_to_prepare` int UNSIGNED NULL DEFAULT NULL,
  `printed_to_check` int UNSIGNED NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `deleted_pos_products_product_id_foreign`(`product_id` ASC) USING BTREE,
  INDEX `deleted_pos_products_user_id_foreign`(`user_id` ASC) USING BTREE,
  INDEX `deleted_pos_products_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `deleted_pos_products_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `deleted_pos_products_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `deleted_pos_products_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `deleted_pos_products_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `deleted_pos_products_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `deleted_pos_products_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `deleted_pos_products_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `deleted_pos_products_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `deleted_pos_products_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of deleted_pos_products
-- ----------------------------

-- ----------------------------
-- Table structure for delivery_areas
-- ----------------------------
CREATE TABLE `delivery_areas`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `foreign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `price` double NULL DEFAULT NULL,
  `branch_id` int UNSIGNED NULL DEFAULT NULL,
  `is_it_delivery` int UNSIGNED NULL DEFAULT NULL,
  `is_it_delivery_on_date` int UNSIGNED NULL DEFAULT NULL,
  `is_it_heat_and_cut` int UNSIGNED NULL DEFAULT NULL,
  `is_it_full_area` int UNSIGNED NULL DEFAULT NULL,
  `order_delivery_type_id` int UNSIGNED NULL DEFAULT NULL,
  `rank` int UNSIGNED NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `delivery_areas_branch_id_foreign`(`branch_id` ASC) USING BTREE,
  INDEX `delivery_areas_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `delivery_areas_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `delivery_areas_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `delivery_areas_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `delivery_areas_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_areas_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_areas_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_areas_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_areas_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of delivery_areas
-- ----------------------------

-- ----------------------------
-- Table structure for delivery_companies
-- ----------------------------
CREATE TABLE `delivery_companies`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `delivery_companies_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `delivery_companies_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `delivery_companies_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `delivery_companies_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `delivery_companies_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_companies_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_companies_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_companies_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of delivery_companies
-- ----------------------------

-- ----------------------------
-- Table structure for delivery_order_journal_entries
-- ----------------------------
CREATE TABLE `delivery_order_journal_entries`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `delivery_order_id` int UNSIGNED NOT NULL,
  `journal_entry_id` int UNSIGNED NOT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `delivery_order_journal_entries_delivery_order_id_foreign`(`delivery_order_id` ASC) USING BTREE,
  INDEX `delivery_order_journal_entries_journal_entry_id_foreign`(`journal_entry_id` ASC) USING BTREE,
  INDEX `delivery_order_journal_entries_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `delivery_order_journal_entries_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `delivery_order_journal_entries_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `delivery_order_journal_entries_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `delivery_order_journal_entries_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_order_journal_entries_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_order_journal_entries_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_order_journal_entries_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_order_journal_entries_delivery_order_id_foreign` FOREIGN KEY (`delivery_order_id`) REFERENCES `delivery_orders` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_order_journal_entries_journal_entry_id_foreign` FOREIGN KEY (`journal_entry_id`) REFERENCES `journal_entries` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of delivery_order_journal_entries
-- ----------------------------

-- ----------------------------
-- Table structure for delivery_order_lines
-- ----------------------------
CREATE TABLE `delivery_order_lines`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `date` date NOT NULL,
  `customer_id` int UNSIGNED NOT NULL,
  `delivery_order_state_id` int UNSIGNED NOT NULL,
  `product_id` int UNSIGNED NOT NULL,
  `unit_id` int UNSIGNED NOT NULL,
  `branch_id` int UNSIGNED NOT NULL,
  `quantity` double UNSIGNED NOT NULL,
  `quantity_t` double UNSIGNED NULL DEFAULT NULL,
  `price` double UNSIGNED NULL DEFAULT NULL,
  `price_with_cost` double UNSIGNED NULL DEFAULT NULL,
  `delivered_quantity` double UNSIGNED NULL DEFAULT NULL,
  `delivery_order_id` int UNSIGNED NOT NULL,
  `sales_order_id` int UNSIGNED NULL DEFAULT NULL,
  `note_voucher_id` int UNSIGNED NULL DEFAULT NULL,
  `journal_entry_id` int UNSIGNED NULL DEFAULT NULL,
  `working_contract_id` int UNSIGNED NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `delivery_order_lines_customer_id_foreign`(`customer_id` ASC) USING BTREE,
  INDEX `delivery_order_lines_delivery_order_state_id_foreign`(`delivery_order_state_id` ASC) USING BTREE,
  INDEX `delivery_order_lines_product_id_foreign`(`product_id` ASC) USING BTREE,
  INDEX `delivery_order_lines_unit_id_foreign`(`unit_id` ASC) USING BTREE,
  INDEX `delivery_order_lines_branch_id_foreign`(`branch_id` ASC) USING BTREE,
  INDEX `delivery_order_lines_delivery_order_id_foreign`(`delivery_order_id` ASC) USING BTREE,
  INDEX `delivery_order_lines_sales_order_id_foreign`(`sales_order_id` ASC) USING BTREE,
  INDEX `delivery_order_lines_note_voucher_id_foreign`(`note_voucher_id` ASC) USING BTREE,
  INDEX `delivery_order_lines_journal_entry_id_foreign`(`journal_entry_id` ASC) USING BTREE,
  INDEX `delivery_order_lines_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `delivery_order_lines_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `delivery_order_lines_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `delivery_order_lines_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `delivery_order_lines_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_order_lines_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_order_lines_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_order_lines_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_order_lines_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_order_lines_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_order_lines_delivery_order_id_foreign` FOREIGN KEY (`delivery_order_id`) REFERENCES `delivery_orders` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_order_lines_delivery_order_state_id_foreign` FOREIGN KEY (`delivery_order_state_id`) REFERENCES `delivery_order_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_order_lines_journal_entry_id_foreign` FOREIGN KEY (`journal_entry_id`) REFERENCES `journal_entries` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_order_lines_note_voucher_id_foreign` FOREIGN KEY (`note_voucher_id`) REFERENCES `note_vouchers` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_order_lines_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_order_lines_sales_order_id_foreign` FOREIGN KEY (`sales_order_id`) REFERENCES `sales_orders` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_order_lines_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of delivery_order_lines
-- ----------------------------

-- ----------------------------
-- Table structure for delivery_order_note_vouchers
-- ----------------------------
CREATE TABLE `delivery_order_note_vouchers`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `delivery_order_id` int UNSIGNED NOT NULL,
  `note_voucher_id` int UNSIGNED NOT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `delivery_order_note_vouchers_delivery_order_id_foreign`(`delivery_order_id` ASC) USING BTREE,
  INDEX `delivery_order_note_vouchers_note_voucher_id_foreign`(`note_voucher_id` ASC) USING BTREE,
  INDEX `delivery_order_note_vouchers_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `delivery_order_note_vouchers_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `delivery_order_note_vouchers_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `delivery_order_note_vouchers_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `delivery_order_note_vouchers_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_order_note_vouchers_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_order_note_vouchers_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_order_note_vouchers_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_order_note_vouchers_delivery_order_id_foreign` FOREIGN KEY (`delivery_order_id`) REFERENCES `delivery_orders` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_order_note_vouchers_note_voucher_id_foreign` FOREIGN KEY (`note_voucher_id`) REFERENCES `note_vouchers` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of delivery_order_note_vouchers
-- ----------------------------

-- ----------------------------
-- Table structure for delivery_order_status
-- ----------------------------
CREATE TABLE `delivery_order_status`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `foreign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `delivery_order_status_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `delivery_order_status_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `delivery_order_status_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `delivery_order_status_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `delivery_order_status_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_order_status_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_order_status_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_order_status_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of delivery_order_status
-- ----------------------------
INSERT INTO `delivery_order_status` VALUES (1, 'مفتوح', '1', 'Open', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:54', '2025-06-12 14:05:54', NULL);
INSERT INTO `delivery_order_status` VALUES (2, 'قيد التسليم', '2', 'Pending', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:54', '2025-06-12 14:05:54', NULL);
INSERT INTO `delivery_order_status` VALUES (3, 'الغي', '3', 'Canceled', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:54', '2025-06-12 14:05:54', NULL);
INSERT INTO `delivery_order_status` VALUES (4, 'تم بنجاح', '4', 'Successed', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:54', '2025-06-12 14:05:54', NULL);

-- ----------------------------
-- Table structure for delivery_orders
-- ----------------------------
CREATE TABLE `delivery_orders`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `date` date NOT NULL,
  `delivery_order_state_id` int UNSIGNED NOT NULL,
  `customer_id` int UNSIGNED NOT NULL,
  `branch_id` int UNSIGNED NOT NULL,
  `sales_order_id` int UNSIGNED NULL DEFAULT NULL,
  `note_voucher_id` int UNSIGNED NULL DEFAULT NULL,
  `journal_entry_id` int UNSIGNED NULL DEFAULT NULL,
  `working_contract_id` int UNSIGNED NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `delivery_orders_delivery_order_state_id_foreign`(`delivery_order_state_id` ASC) USING BTREE,
  INDEX `delivery_orders_customer_id_foreign`(`customer_id` ASC) USING BTREE,
  INDEX `delivery_orders_branch_id_foreign`(`branch_id` ASC) USING BTREE,
  INDEX `delivery_orders_sales_order_id_foreign`(`sales_order_id` ASC) USING BTREE,
  INDEX `delivery_orders_note_voucher_id_foreign`(`note_voucher_id` ASC) USING BTREE,
  INDEX `delivery_orders_journal_entry_id_foreign`(`journal_entry_id` ASC) USING BTREE,
  INDEX `delivery_orders_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `delivery_orders_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `delivery_orders_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `delivery_orders_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `delivery_orders_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_orders_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_orders_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_orders_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_orders_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_orders_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_orders_delivery_order_state_id_foreign` FOREIGN KEY (`delivery_order_state_id`) REFERENCES `delivery_order_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_orders_journal_entry_id_foreign` FOREIGN KEY (`journal_entry_id`) REFERENCES `journal_entries` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_orders_note_voucher_id_foreign` FOREIGN KEY (`note_voucher_id`) REFERENCES `note_vouchers` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_orders_sales_order_id_foreign` FOREIGN KEY (`sales_order_id`) REFERENCES `sales_orders` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of delivery_orders
-- ----------------------------

-- ----------------------------
-- Table structure for delivery_types
-- ----------------------------
CREATE TABLE `delivery_types`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `foreign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `delivery_types_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `delivery_types_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `delivery_types_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `delivery_types_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `delivery_types_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_types_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_types_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `delivery_types_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of delivery_types
-- ----------------------------
INSERT INTO `delivery_types` VALUES (1, 'فوري', '1', 'immediate', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:59', '2025-06-12 14:05:59', NULL);
INSERT INTO `delivery_types` VALUES (2, 'العميل سوف يستلم', '2', 'Customer will com and tack', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:59', '2025-06-12 14:05:59', NULL);
INSERT INTO `delivery_types` VALUES (3, 'توصيل', '3', 'Delivery', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:59', '2025-06-12 14:05:59', NULL);
INSERT INTO `delivery_types` VALUES (4, 'تسخين وتقطيع', '4', 'Delivery', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:59', '2025-06-12 14:05:59', NULL);
INSERT INTO `delivery_types` VALUES (5, 'موقع كامل', '5', 'Delivery', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:59', '2025-06-12 14:05:59', NULL);

-- ----------------------------
-- Table structure for departments
-- ----------------------------
CREATE TABLE `departments`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `foreign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `department_id` int UNSIGNED NULL DEFAULT NULL,
  `main_child_zeros` int NULL DEFAULT NULL,
  `main_child_counter` int NULL DEFAULT NULL,
  `sub_child_zeros` int NULL DEFAULT NULL,
  `sub_child_counter` int NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `departments_department_id_foreign`(`department_id` ASC) USING BTREE,
  INDEX `departments_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `departments_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `departments_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `departments_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `departments_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `departments_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `departments_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `departments_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `departments_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of departments
-- ----------------------------
INSERT INTO `departments` VALUES (1, 'الادارة', '1', 'Manager', NULL, 10, NULL, 1000, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:52', '2025-06-12 14:05:52', NULL);

-- ----------------------------
-- Table structure for discount_status
-- ----------------------------
CREATE TABLE `discount_status`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `discount_status_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `discount_status_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `discount_status_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `discount_status_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of discount_status
-- ----------------------------
INSERT INTO `discount_status` VALUES (1, 'active', '1', 1, NULL, NULL, '2025-06-12 14:05:48', '2025-06-12 14:05:48', NULL);
INSERT INTO `discount_status` VALUES (2, 'deactivate', '1', 1, NULL, NULL, '2025-06-12 14:05:48', '2025-06-12 14:05:48', NULL);

-- ----------------------------
-- Table structure for document_categories
-- ----------------------------
CREATE TABLE `document_categories`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `foreign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `document_category_id` int UNSIGNED NULL DEFAULT NULL,
  `main_child_zeros` int NULL DEFAULT NULL,
  `main_child_counter` int NULL DEFAULT NULL,
  `sub_child_zeros` int NULL DEFAULT NULL,
  `sub_child_counter` int NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `document_categories_document_category_id_foreign`(`document_category_id` ASC) USING BTREE,
  INDEX `document_categories_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `document_categories_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `document_categories_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `document_categories_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `document_categories_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `document_categories_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `document_categories_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `document_categories_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `document_categories_document_category_id_foreign` FOREIGN KEY (`document_category_id`) REFERENCES `document_categories` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of document_categories
-- ----------------------------
INSERT INTO `document_categories` VALUES (1, 'شؤون الموظفين', '1', 'Hr', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:53', '2025-06-12 14:05:53', NULL);
INSERT INTO `document_categories` VALUES (2, 'العملاء', '1', 'Customers', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:53', '2025-06-12 14:05:53', NULL);

-- ----------------------------
-- Table structure for document_paths
-- ----------------------------
CREATE TABLE `document_paths`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `date` date NOT NULL,
  `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `size` double NULL DEFAULT NULL,
  `cost_center_id` int UNSIGNED NULL DEFAULT NULL,
  `document_category_id` int UNSIGNED NOT NULL,
  `user_id` int UNSIGNED NULL DEFAULT NULL,
  `product_id` int UNSIGNED NULL DEFAULT NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `document_paths_cost_center_id_foreign`(`cost_center_id` ASC) USING BTREE,
  INDEX `document_paths_document_category_id_foreign`(`document_category_id` ASC) USING BTREE,
  INDEX `document_paths_user_id_foreign`(`user_id` ASC) USING BTREE,
  INDEX `document_paths_product_id_foreign`(`product_id` ASC) USING BTREE,
  INDEX `document_paths_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `document_paths_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `document_paths_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `document_paths_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `document_paths_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `document_paths_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `document_paths_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `document_paths_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `document_paths_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `document_paths_document_category_id_foreign` FOREIGN KEY (`document_category_id`) REFERENCES `document_categories` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `document_paths_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `document_paths_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of document_paths
-- ----------------------------

-- ----------------------------
-- Table structure for education_settings
-- ----------------------------
CREATE TABLE `education_settings`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `student_permission_id` int UNSIGNED NOT NULL,
  `teacher_permission_id` int UNSIGNED NOT NULL,
  `zoom_token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `student_can_view_mark` int UNSIGNED NOT NULL,
  `number_of_daily_classes` int UNSIGNED NULL DEFAULT NULL,
  `class_starts` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `class_ends` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `education_settings_student_can_view_mark_foreign`(`student_can_view_mark` ASC) USING BTREE,
  INDEX `education_settings_student_permission_id_foreign`(`student_permission_id` ASC) USING BTREE,
  INDEX `education_settings_teacher_permission_id_foreign`(`teacher_permission_id` ASC) USING BTREE,
  INDEX `education_settings_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `education_settings_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `education_settings_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `education_settings_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `education_settings_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `education_settings_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `education_settings_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `education_settings_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `education_settings_student_can_view_mark_foreign` FOREIGN KEY (`student_can_view_mark`) REFERENCES `status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `education_settings_student_permission_id_foreign` FOREIGN KEY (`student_permission_id`) REFERENCES `permissions` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `education_settings_teacher_permission_id_foreign` FOREIGN KEY (`teacher_permission_id`) REFERENCES `permissions` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of education_settings
-- ----------------------------
INSERT INTO `education_settings` VALUES (1, 2, 1, NULL, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:55', '2025-06-12 14:05:55', NULL);

-- ----------------------------
-- Table structure for education_types
-- ----------------------------
CREATE TABLE `education_types`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `foreign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `education_types_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `education_types_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `education_types_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `education_types_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `education_types_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `education_types_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `education_types_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `education_types_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of education_types
-- ----------------------------
INSERT INTO `education_types` VALUES (1, 'مدرسة متوسطة', '1', 'High school', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:52', '2025-06-12 14:05:52', NULL);
INSERT INTO `education_types` VALUES (2, 'كلية جامعية متوسطة', '2', 'Diploma', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:52', '2025-06-12 14:05:52', NULL);
INSERT INTO `education_types` VALUES (3, 'شهادة جامعية', '3', 'Bachelor degree', NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:52', '2025-06-12 14:05:52', NULL);

-- ----------------------------
-- Table structure for email_list_mails
-- ----------------------------
CREATE TABLE `email_list_mails`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `email_list_id` int UNSIGNED NOT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `state_id` int UNSIGNED NOT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `email_list_mails_email_list_id_foreign`(`email_list_id` ASC) USING BTREE,
  INDEX `email_list_mails_state_id_foreign`(`state_id` ASC) USING BTREE,
  INDEX `email_list_mails_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `email_list_mails_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `email_list_mails_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `email_list_mails_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `email_list_mails_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `email_list_mails_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `email_list_mails_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `email_list_mails_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `email_list_mails_email_list_id_foreign` FOREIGN KEY (`email_list_id`) REFERENCES `email_lists` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `email_list_mails_state_id_foreign` FOREIGN KEY (`state_id`) REFERENCES `status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of email_list_mails
-- ----------------------------

-- ----------------------------
-- Table structure for email_lists
-- ----------------------------
CREATE TABLE `email_lists`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `foreign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `main_child_zeros` int UNSIGNED NULL DEFAULT NULL,
  `main_child_counter` int UNSIGNED NULL DEFAULT NULL,
  `sub_child_zeros` int UNSIGNED NULL DEFAULT NULL,
  `sub_child_counter` int UNSIGNED NULL DEFAULT NULL,
  `email_list_id` int UNSIGNED NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `email_lists_email_list_id_foreign`(`email_list_id` ASC) USING BTREE,
  INDEX `email_lists_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `email_lists_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `email_lists_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `email_lists_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `email_lists_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `email_lists_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `email_lists_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `email_lists_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `email_lists_email_list_id_foreign` FOREIGN KEY (`email_list_id`) REFERENCES `email_lists` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of email_lists
-- ----------------------------
INSERT INTO `email_lists` VALUES (1, 'قائمة ايميلات', '1', 'Email list', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:55', '2025-06-12 14:05:55', NULL);

-- ----------------------------
-- Table structure for employee_allowance_on_salarys
-- ----------------------------
CREATE TABLE `employee_allowance_on_salarys`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `employee_user_id` int UNSIGNED NOT NULL,
  `allowance_on_salary_id` int UNSIGNED NOT NULL,
  `subject_to_social_security` int UNSIGNED NOT NULL,
  `branch_id` int UNSIGNED NULL DEFAULT NULL,
  `from_date` date NULL DEFAULT NULL,
  `to_date` date NULL DEFAULT NULL,
  `value` double UNSIGNED NOT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `employee_allowance_on_salarys_employee_user_id_foreign`(`employee_user_id` ASC) USING BTREE,
  INDEX `employee_allowance_on_salarys_subject_to_social_security_foreign`(`subject_to_social_security` ASC) USING BTREE,
  INDEX `employee_allowance_on_salarys_allowance_on_salary_id_foreign`(`allowance_on_salary_id` ASC) USING BTREE,
  INDEX `employee_allowance_on_salarys_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `employee_allowance_on_salarys_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `employee_allowance_on_salarys_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `employee_allowance_on_salarys_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `employee_allowance_on_salarys_allowance_on_salary_id_foreign` FOREIGN KEY (`allowance_on_salary_id`) REFERENCES `allowance_on_salarys` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_allowance_on_salarys_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_allowance_on_salarys_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_allowance_on_salarys_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_allowance_on_salarys_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_allowance_on_salarys_employee_user_id_foreign` FOREIGN KEY (`employee_user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_allowance_on_salarys_subject_to_social_security_foreign` FOREIGN KEY (`subject_to_social_security`) REFERENCES `status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of employee_allowance_on_salarys
-- ----------------------------

-- ----------------------------
-- Table structure for employee_attendances
-- ----------------------------
CREATE TABLE `employee_attendances`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `employee_user_id` int UNSIGNED NOT NULL,
  `in_type` int UNSIGNED NULL DEFAULT NULL,
  `out_type` int UNSIGNED NULL DEFAULT NULL,
  `in_datetime` datetime NULL DEFAULT NULL,
  `out_datetime` datetime NULL DEFAULT NULL,
  `date` date NOT NULL,
  `attendance_machine_id` int UNSIGNED NULL DEFAULT NULL,
  `shift_id` int UNSIGNED NULL DEFAULT NULL,
  `leave_start_time` time NULL DEFAULT NULL,
  `leave_end_time` time NULL DEFAULT NULL,
  `in_latitude` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `in_longitude` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `out_latitude` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `out_longitude` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `employee_attendances_employee_user_id_foreign`(`employee_user_id` ASC) USING BTREE,
  INDEX `employee_attendances_in_type_foreign`(`in_type` ASC) USING BTREE,
  INDEX `employee_attendances_out_type_foreign`(`out_type` ASC) USING BTREE,
  INDEX `employee_attendances_attendance_machine_id_foreign`(`attendance_machine_id` ASC) USING BTREE,
  INDEX `employee_attendances_shift_id_foreign`(`shift_id` ASC) USING BTREE,
  INDEX `employee_attendances_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `employee_attendances_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `employee_attendances_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `employee_attendances_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `employee_attendances_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_attendances_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_attendances_attendance_machine_id_foreign` FOREIGN KEY (`attendance_machine_id`) REFERENCES `attendance_machines` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_attendances_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_attendances_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_attendances_employee_user_id_foreign` FOREIGN KEY (`employee_user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_attendances_in_type_foreign` FOREIGN KEY (`in_type`) REFERENCES `attendance_types` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_attendances_out_type_foreign` FOREIGN KEY (`out_type`) REFERENCES `attendance_types` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_attendances_shift_id_foreign` FOREIGN KEY (`shift_id`) REFERENCES `shifts` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of employee_attendances
-- ----------------------------

-- ----------------------------
-- Table structure for employee_clearances
-- ----------------------------
CREATE TABLE `employee_clearances`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `employee_user_id` int UNSIGNED NOT NULL,
  `journal_entry_id` int UNSIGNED NULL DEFAULT NULL,
  `pay_journal_entry_id` int UNSIGNED NULL DEFAULT NULL,
  `branch_id` int UNSIGNED NULL DEFAULT NULL,
  `date` date NOT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `employee_clearances_employee_user_id_foreign`(`employee_user_id` ASC) USING BTREE,
  INDEX `employee_clearances_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `employee_clearances_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `employee_clearances_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `employee_clearances_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `employee_clearances_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_clearances_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_clearances_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_clearances_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_clearances_employee_user_id_foreign` FOREIGN KEY (`employee_user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of employee_clearances
-- ----------------------------

-- ----------------------------
-- Table structure for employee_deductions
-- ----------------------------
CREATE TABLE `employee_deductions`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `employee_user_id` int UNSIGNED NOT NULL,
  `deduction_id` int UNSIGNED NOT NULL,
  `value` double NULL DEFAULT NULL,
  `percentage_from_main_salary` double NULL DEFAULT NULL,
  `branch_id` int UNSIGNED NULL DEFAULT NULL,
  `date` date NOT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `employee_deductions_employee_user_id_foreign`(`employee_user_id` ASC) USING BTREE,
  INDEX `employee_deductions_deduction_id_foreign`(`deduction_id` ASC) USING BTREE,
  INDEX `employee_deductions_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `employee_deductions_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `employee_deductions_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `employee_deductions_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `employee_deductions_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_deductions_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_deductions_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_deductions_deduction_id_foreign` FOREIGN KEY (`deduction_id`) REFERENCES `deductions` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_deductions_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_deductions_employee_user_id_foreign` FOREIGN KEY (`employee_user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of employee_deductions
-- ----------------------------

-- ----------------------------
-- Table structure for employee_departures
-- ----------------------------
CREATE TABLE `employee_departures`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `employee_user_id` int UNSIGNED NOT NULL,
  `from_datetime` datetime NOT NULL,
  `to_datetime` datetime NULL DEFAULT NULL,
  `number_of_minits` double NULL DEFAULT NULL,
  `branch_id` double NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `employee_departures_employee_user_id_foreign`(`employee_user_id` ASC) USING BTREE,
  INDEX `employee_departures_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `employee_departures_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `employee_departures_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `employee_departures_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `employee_departures_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_departures_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_departures_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_departures_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_departures_employee_user_id_foreign` FOREIGN KEY (`employee_user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of employee_departures
-- ----------------------------

-- ----------------------------
-- Table structure for employee_educations
-- ----------------------------
CREATE TABLE `employee_educations`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `employee_user_id` int UNSIGNED NOT NULL,
  `education_type_id` int UNSIGNED NOT NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `employee_educations_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `employee_educations_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `employee_educations_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `employee_educations_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `employee_educations_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_educations_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_educations_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_educations_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of employee_educations
-- ----------------------------

-- ----------------------------
-- Table structure for employee_groups
-- ----------------------------
CREATE TABLE `employee_groups`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `foreign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `employee_group_id` int UNSIGNED NULL DEFAULT NULL,
  `main_child_zeros` int NULL DEFAULT NULL,
  `main_child_counter` int NULL DEFAULT NULL,
  `sub_child_zeros` int NULL DEFAULT NULL,
  `sub_child_counter` int NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `employee_groups_employee_group_id_foreign`(`employee_group_id` ASC) USING BTREE,
  INDEX `employee_groups_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `employee_groups_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `employee_groups_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `employee_groups_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `employee_groups_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_groups_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_groups_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_groups_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_groups_employee_group_id_foreign` FOREIGN KEY (`employee_group_id`) REFERENCES `employee_groups` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of employee_groups
-- ----------------------------
INSERT INTO `employee_groups` VALUES (1, 'الادارة', '1', 'Managers', NULL, 10, NULL, 1000, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:52', '2025-06-12 14:05:52', NULL);
INSERT INTO `employee_groups` VALUES (2, 'العمال', '2', 'Workers', NULL, 10, NULL, 1000, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-06-12 14:05:52', '2025-06-12 14:05:52', NULL);

-- ----------------------------
-- Table structure for employee_loan_maturity_dates
-- ----------------------------
CREATE TABLE `employee_loan_maturity_dates`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `employee_user_id` int UNSIGNED NOT NULL,
  `employee_loan_id` int UNSIGNED NOT NULL,
  `date` date NULL DEFAULT NULL,
  `amount` double NULL DEFAULT NULL,
  `employee_loans_state_id` int UNSIGNED NOT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `employee_loan_maturity_dates_employee_user_id_foreign`(`employee_user_id` ASC) USING BTREE,
  INDEX `employee_loan_maturity_dates_employee_loans_state_id_foreign`(`employee_loans_state_id` ASC) USING BTREE,
  INDEX `employee_loan_maturity_dates_employee_loan_id_foreign`(`employee_loan_id` ASC) USING BTREE,
  INDEX `employee_loan_maturity_dates_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `employee_loan_maturity_dates_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `employee_loan_maturity_dates_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `employee_loan_maturity_dates_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `employee_loan_maturity_dates_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_loan_maturity_dates_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_loan_maturity_dates_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_loan_maturity_dates_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_loan_maturity_dates_employee_loan_id_foreign` FOREIGN KEY (`employee_loan_id`) REFERENCES `employee_loans` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_loan_maturity_dates_employee_loans_state_id_foreign` FOREIGN KEY (`employee_loans_state_id`) REFERENCES `employee_loans_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_loan_maturity_dates_employee_user_id_foreign` FOREIGN KEY (`employee_user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of employee_loan_maturity_dates
-- ----------------------------

-- ----------------------------
-- Table structure for employee_loan_payments
-- ----------------------------
CREATE TABLE `employee_loan_payments`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `amount` double NOT NULL,
  `employee_loan_id` int UNSIGNED NOT NULL,
  `employee_user_id` int UNSIGNED NOT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `employee_loan_payments_employee_loan_id_foreign`(`employee_loan_id` ASC) USING BTREE,
  INDEX `employee_loan_payments_employee_user_id_foreign`(`employee_user_id` ASC) USING BTREE,
  INDEX `employee_loan_payments_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `employee_loan_payments_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `employee_loan_payments_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `employee_loan_payments_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `employee_loan_payments_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_loan_payments_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_loan_payments_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_loan_payments_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_loan_payments_employee_loan_id_foreign` FOREIGN KEY (`employee_loan_id`) REFERENCES `employee_loans` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_loan_payments_employee_user_id_foreign` FOREIGN KEY (`employee_user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of employee_loan_payments
-- ----------------------------

-- ----------------------------
-- Table structure for employee_loans
-- ----------------------------
CREATE TABLE `employee_loans`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` double NOT NULL,
  `monthly_payment` double NOT NULL,
  `last_month_payment` double NULL DEFAULT NULL,
  `remain` double NULL DEFAULT NULL,
  `date` date NOT NULL,
  `from_date` date NOT NULL,
  `to_date` date NOT NULL,
  `employee_user_id` int UNSIGNED NOT NULL,
  `journal_entry_id` int UNSIGNED NULL DEFAULT NULL,
  `employee_loan_state_id` int UNSIGNED NULL DEFAULT NULL,
  `branch_id` int UNSIGNED NULL DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` int UNSIGNED NULL DEFAULT NULL,
  `deleted_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_by` int UNSIGNED NULL DEFAULT NULL,
  `approved_date` date NULL DEFAULT NULL,
  `approved_state_id` int UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `employee_loans_branch_id_foreign`(`branch_id` ASC) USING BTREE,
  INDEX `employee_loans_journal_entry_id_foreign`(`journal_entry_id` ASC) USING BTREE,
  INDEX `employee_loans_employee_loan_state_id_foreign`(`employee_loan_state_id` ASC) USING BTREE,
  INDEX `employee_loans_approved_by_foreign`(`approved_by` ASC) USING BTREE,
  INDEX `employee_loans_employee_user_id_foreign`(`employee_user_id` ASC) USING BTREE,
  INDEX `employee_loans_approved_state_id_foreign`(`approved_state_id` ASC) USING BTREE,
  INDEX `employee_loans_created_by_foreign`(`created_by` ASC) USING BTREE,
  INDEX `employee_loans_deleted_by_foreign`(`deleted_by` ASC) USING BTREE,
  CONSTRAINT `employee_loans_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_loans_approved_state_id_foreign` FOREIGN KEY (`approved_state_id`) REFERENCES `approval_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_loans_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_loans_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_loans_deleted_by_foreign` FOREIGN KEY (`deleted_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_loans_employee_loan_state_id_foreign` FOREIGN KEY (`employee_loan_state_id`) REFERENCES `employee_loans_status` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_loans_employee_user_id_foreign` FOREIGN KEY (`employee_user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `employee_loans_journal_entry_id_foreign` FOREIGN KEY (`journal_entry_id`) REFERENCES `journal_entries` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of employee_loans
-- ----------------------------

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