-- INSERT INTO `orders` (`id`, `order_num`, `user_id`, `restaurant_id`, `status`, `cart_or_paid`, `sub_total`, `total`, `is_accept`, `discount_value`, `vat_value`, `payment_order_id`, `payment_type`, `coupon_id`, `payment_via`, `transaction_data`, `payment_date`, `order_type`, `payment_method`, `status_notes`, `shipping_value`, `client_car_id`, `car_number`, `expected_time`, `expected_time_notes`, `created_at`, `updated_at`) VALUES
-- (1, '1001', 4, 3, 'request', 'paid', 23.75, 24.94, 0, 0.00, 1.19, '1745765772327024', NULL, NULL, NULL, '{\"Comments\": null, \"InvoiceId\": 5513801, \"Suppliers\": [], \"DueDeposit\": 24.796, \"ExpiryDate\": \"April 30, 2025\", \"ExpiryTime\": \"17:56:19.953\", \"CreatedDate\": \"2025-04-27T17:56:19.953\", \"CustomerName\": \"SKIP\", \"InvoiceError\": \"\", \"InvoiceItems\": [], \"InvoiceValue\": 24.94, \"CustomerEmail\": \"Skip_Support@gmail.com\", \"DepositStatus\": \"Not Deposited\", \"InvoiceStatus\": \"Paid\", \"CustomerMobile\": \"+971+8701928491\", \"InvoiceReference\": \"2025197812\", \"UserDefinedField\": null, \"focusTransaction\": {\"ECI\": \"02\", \"Error\": null, \"Country\": \"Egypt\", \"TrackId\": \"27-04-2025_2605098\", \"Currency\": \"KD\", \"DueValue\": \"24.940\", \"ErrorCode\": \"\", \"IpAddress\": \"41.46.8.47\", \"PaymentId\": \"07075513801260509872\", \"VatAmount\": \"0.019\", \"CardNumber\": \"548446xxxxxx6984\", \"ReferenceId\": \"511714324999\", \"PaidCurrency\": \"KD\", \"TransactionId\": \"324999\", \"PaymentGateway\": \"VISA/MASTER\", \"AuthorizationId\": \"764770\", \"TransactionDate\": \"2025-04-27T17:56:32.5466667\", \"TransationValue\": \"24.940\", \"PaidCurrencyValue\": \"24.940\", \"TransactionStatus\": \"Succss\", \"TotalServiceCharge\": \"0.125\", \"CustomerServiceCharge\": \"0.000\"}, \"CustomerReference\": \"1745765772327024\", \"InvoiceDisplayValue\": \"24.940 KD\", \"InvoiceTransactions\": [{\"ECI\": \"02\", \"Error\": null, \"Country\": \"Egypt\", \"TrackId\": \"27-04-2025_2605098\", \"Currency\": \"KD\", \"DueValue\": \"24.940\", \"ErrorCode\": \"\", \"IpAddress\": \"41.46.8.47\", \"PaymentId\": \"07075513801260509872\", \"VatAmount\": \"0.019\", \"CardNumber\": \"548446xxxxxx6984\", \"ReferenceId\": \"511714324999\", \"PaidCurrency\": \"KD\", \"TransactionId\": \"324999\", \"PaymentGateway\": \"VISA/MASTER\", \"AuthorizationId\": \"764770\", \"TransactionDate\": \"2025-04-27T17:56:32.5466667\", \"TransationValue\": \"24.940\", \"PaidCurrencyValue\": \"24.940\", \"TransactionStatus\": \"Succss\", \"TotalServiceCharge\": \"0.125\", \"CustomerServiceCharge\": \"0.000\"}]}', '2025-04-27 11:56:34', 'delivery', NULL, NULL, 0.00, NULL, NULL, NULL, NULL, '2025-04-27 11:56:12', '2025-04-27 11:56:34'),
-- (2, '1002', 4, 3, 'request', 'paid', 23.75, 24.94, 0, 0.00, 1.19, '17457658002122529', NULL, NULL, NULL, '{\"Comments\": null, \"InvoiceId\": 5513817, \"Suppliers\": [], \"DueDeposit\": 24.796, \"ExpiryDate\": \"April 30, 2025\", \"ExpiryTime\": \"18:00:22.140\", \"CreatedDate\": \"2025-04-27T18:00:22.14\", \"CustomerName\": \"SKIP\", \"InvoiceError\": \"\", \"InvoiceItems\": [], \"InvoiceValue\": 24.94, \"CustomerEmail\": \"Skip_Support@gmail.com\", \"DepositStatus\": \"Not Deposited\", \"InvoiceStatus\": \"Paid\", \"CustomerMobile\": \"+971+8701928491\", \"InvoiceReference\": \"2025197823\", \"UserDefinedField\": null, \"focusTransaction\": {\"ECI\": \"02\", \"Error\": null, \"Country\": \"Egypt\", \"TrackId\": \"27-04-2025_2605107\", \"Currency\": \"KD\", \"DueValue\": \"24.940\", \"ErrorCode\": \"\", \"IpAddress\": \"41.46.8.47\", \"PaymentId\": \"07075513817260510772\", \"VatAmount\": \"0.019\", \"CardNumber\": \"545301xxxxxx5539\", \"ReferenceId\": \"511715327099\", \"PaidCurrency\": \"KD\", \"TransactionId\": \"327099\", \"PaymentGateway\": \"VISA/MASTER\", \"AuthorizationId\": \"789330\", \"TransactionDate\": \"2025-04-27T18:00:36.7\", \"TransationValue\": \"24.940\", \"PaidCurrencyValue\": \"24.940\", \"TransactionStatus\": \"Succss\", \"TotalServiceCharge\": \"0.125\", \"CustomerServiceCharge\": \"0.000\"}, \"CustomerReference\": \"17457658002122529\", \"InvoiceDisplayValue\": \"24.940 KD\", \"InvoiceTransactions\": [{\"ECI\": \"02\", \"Error\": null, \"Country\": \"Egypt\", \"TrackId\": \"27-04-2025_2605107\", \"Currency\": \"KD\", \"DueValue\": \"24.940\", \"ErrorCode\": \"\", \"IpAddress\": \"41.46.8.47\", \"PaymentId\": \"07075513817260510772\", \"VatAmount\": \"0.019\", \"CardNumber\": \"545301xxxxxx5539\", \"ReferenceId\": \"511715327099\", \"PaidCurrency\": \"KD\", \"TransactionId\": \"327099\", \"PaymentGateway\": \"VISA/MASTER\", \"AuthorizationId\": \"789330\", \"TransactionDate\": \"2025-04-27T18:00:36.7\", \"TransationValue\": \"24.940\", \"PaidCurrencyValue\": \"24.940\", \"TransactionStatus\": \"Succss\", \"TotalServiceCharge\": \"0.125\", \"CustomerServiceCharge\": \"0.000\"}]}', '2025-04-27 12:00:38', 'delivery', NULL, NULL, 0.00, NULL, NULL, NULL, NULL, '2025-04-27 11:56:40', '2025-04-27 12:00:38'),
-- (3, '1003', 4, 3, 'prepared', 'paid', 23.75, 24.94, 1, 0.00, 1.19, '17457660461254898', NULL, NULL, NULL, '{\"Comments\": null, \"InvoiceId\": 5513821, \"Suppliers\": [], \"DueDeposit\": 24.796, \"ExpiryDate\": \"April 30, 2025\", \"ExpiryTime\": \"18:02:56.147\", \"CreatedDate\": \"2025-04-27T18:02:56.147\", \"CustomerName\": \"SKIP\", \"InvoiceError\": \"\", \"InvoiceItems\": [], \"InvoiceValue\": 24.94, \"CustomerEmail\": \"Skip_Support@gmail.com\", \"DepositStatus\": \"Not Deposited\", \"InvoiceStatus\": \"Paid\", \"CustomerMobile\": \"+971+8701928491\", \"InvoiceReference\": \"2025197825\", \"UserDefinedField\": null, \"focusTransaction\": {\"ECI\": \"02\", \"Error\": null, \"Country\": \"Egypt\", \"TrackId\": \"27-04-2025_2605110\", \"Currency\": \"KD\", \"DueValue\": \"24.940\", \"ErrorCode\": \"\", \"IpAddress\": \"41.46.8.47\", \"PaymentId\": \"07075513821260511071\", \"VatAmount\": \"0.019\", \"CardNumber\": \"545301xxxxxx5539\", \"ReferenceId\": \"511715328159\", \"PaidCurrency\": \"KD\", \"TransactionId\": \"328159\", \"PaymentGateway\": \"VISA/MASTER\", \"AuthorizationId\": \"911000\", \"TransactionDate\": \"2025-04-27T18:03:09.2133333\", \"TransationValue\": \"24.940\", \"PaidCurrencyValue\": \"24.940\", \"TransactionStatus\": \"Succss\", \"TotalServiceCharge\": \"0.125\", \"CustomerServiceCharge\": \"0.000\"}, \"CustomerReference\": \"17457660461254898\", \"InvoiceDisplayValue\": \"24.940 KD\", \"InvoiceTransactions\": [{\"ECI\": \"02\", \"Error\": null, \"Country\": \"Egypt\", \"TrackId\": \"27-04-2025_2605110\", \"Currency\": \"KD\", \"DueValue\": \"24.940\", \"ErrorCode\": \"\", \"IpAddress\": \"41.46.8.47\", \"PaymentId\": \"07075513821260511071\", \"VatAmount\": \"0.019\", \"CardNumber\": \"545301xxxxxx5539\", \"ReferenceId\": \"511715328159\", \"PaidCurrency\": \"KD\", \"TransactionId\": \"328159\", \"PaymentGateway\": \"VISA/MASTER\", \"AuthorizationId\": \"911000\", \"TransactionDate\": \"2025-04-27T18:03:09.2133333\", \"TransationValue\": \"24.940\", \"PaidCurrencyValue\": \"24.940\", \"TransactionStatus\": \"Succss\", \"TotalServiceCharge\": \"0.125\", \"CustomerServiceCharge\": \"0.000\"}]}', '2025-04-27 12:03:11', 'pickup', NULL, NULL, 0.00, 1, '123456', NULL, NULL, '2025-04-27 12:00:46', '2025-04-27 12:31:13'),
-- (4, NULL, 4, 3, 'request', 'cart', 0.00, 0.00, 0, 0.00, 0.00, '17457664583881984', NULL, NULL, NULL, NULL, NULL, 'pickup', NULL, NULL, 0.00, 1, '123456', NULL, NULL, '2025-04-27 12:07:38', '2025-04-27 12:07:38');



-- INSERT INTO `order_items` (`id`, `order_id`, `product_id`, `combination`, `price`, `qty`, `total`, `created_at`, `updated_at`) VALUES
-- (1, 1, 15, NULL, 18.75, 1, 23.75, '2025-04-27 11:56:12', '2025-04-27 11:56:12'),
-- (2, 2, 15, NULL, 18.75, 1, 23.75, '2025-04-27 11:59:54', '2025-04-27 11:59:54'),
-- (3, 3, 15, NULL, 18.75, 1, 23.75, '2025-04-27 12:02:37', '2025-04-27 12:02:37');



-- INSERT INTO `order_item_add_ons` (`id`, `order_item_id`, `add_on_id`, `price`, `qty`, `total`, `created_at`, `updated_at`) VALUES
-- (1, 1, 1, 5.00, 1, 5.00, '2025-04-27 11:56:12', '2025-04-27 11:56:12'),
-- (2, 2, 1, 5.00, 1, 5.00, '2025-04-27 11:59:54', '2025-04-27 11:59:54'),
-- (3, 3, 1, 5.00, 1, 5.00, '2025-04-27 12:02:37', '2025-04-27 12:02:37');




-- INSERT INTO `delivery_orders` (`id`, `city_id`, `region_id`, `address`, `address_number`, `location_id`, `order_id`, `created_at`, `updated_at`) VALUES
-- (1, 1, 1, 'دبي - المكتب الرئيسي - برج خليفة - الطابق 7', '971501234567', 1, 1, '2025-04-27 11:56:20', '2025-04-27 11:56:20'),
-- (2, 1, 1, 'دبي - المكتب الرئيسي - برج خليفة - الطابق 7', '971501234567', 1, 2, '2025-04-27 11:56:40', '2025-04-27 11:56:40');

INSERT INTO `orders` (`id`, `order_num`, `order_type`, `user_id`, `restaurant_id`, `status`, `status_notes`, `is_accept`, `cart_or_paid`, `payment_order_id`, `payment_via`, `transaction_data`, `payment_date`, `payment_method`, `payment_type`, `expected_time`, `expected_time_notes`, `client_car_id`, `car_number`, `is_arrive_client`, `sub_total`, `coupon_id`, `discount_value`, `shipping_value`, `restaurant_percentage`, `restaurant_value`, `skip_percentage`, `skip_value`, `payment_gateway_percentage`, `payment_gateway_value`, `vat_percentage`, `vat_value`, `is_just_reservation`, `is_wallet`, `total`, `created_at`, `updated_at`) VALUES
(1, '1001', 'delivery', 4, 3, 'request', NULL, 0, 'paid', '17480874312084641', NULL, NULL, '2025-05-24 13:10:05', 'wallet', NULL, NULL, NULL, NULL, NULL, 0, 287.50, NULL, 0.00, 0.00, 95.00, 287.50, 5.00, 14.38, 3.00, 9.06, 0.00, 14.38, 0, 1, 310.93, '2025-05-24 12:50:31', '2025-05-24 13:10:05'),
(2, '1002', 'pickup', 4, 3, 'request', NULL, 0, 'paid', '17480886244868942', NULL, NULL, '2025-05-24 13:10:32', 'wallet', NULL, NULL, NULL, 1, '123456', 0, 142.50, NULL, 0.00, 0.00, 95.00, 142.50, 5.00, 7.13, 3.00, 4.49, 0.00, 7.13, 0, 1, 154.11, '2025-05-24 13:10:24', '2025-05-24 13:10:32'),
(3, '1003', 'reservation', 4, 3, 'request', NULL, 0, 'paid', '17480886382765178', NULL, NULL, '2025-05-24 13:13:14', 'wallet', NULL, NULL, NULL, NULL, NULL, 0, 142.50, NULL, 0.00, 0.00, 95.00, 142.50, 5.00, 7.13, 3.00, 4.49, 0.00, 7.13, 0, 1, 154.11, '2025-05-24 13:10:38', '2025-05-24 13:13:14'),
(5, '1004', 'reservation', 4, 3, 'request', NULL, 0, 'paid', '17480888103996958', NULL, NULL, '2025-05-24 10:13:30', 'wallet', NULL, NULL, NULL, NULL, NULL, 0, 10.00, NULL, 0.00, 0.00, 0.00, 0.00, 100.00, 10.00, 0.00, 0.00, 0.00, 0.00, 1, 1, 10.00, '2025-05-24 10:13:30', '2025-05-24 10:13:30');

INSERT INTO `delivery_orders` (`id`, `city_id`, `region_id`, `address`, `address_number`, `location_id`, `order_id`, `amount`, `created_at`, `updated_at`) VALUES
(1, 1, 1, 'دبي - المكتب الرئيسي - برج خليفة - الطابق 7', '971501234567', 1, 1, 90.00, '2025-05-24 13:10:05', '2025-05-24 13:10:05');


INSERT INTO `order_items` (`id`, `order_id`, `product_id`, `combination`, `price`, `qty`, `total`, `created_at`, `updated_at`) VALUES
(1, 1, 13, NULL, 20.00, 5, 145.00, '2025-05-24 12:50:31', '2025-05-24 12:50:31'),
(2, 1, 43, NULL, 19.00, 5, 142.50, '2025-05-24 12:52:43', '2025-05-24 12:52:43'),
(3, 2, 43, NULL, 19.00, 5, 142.50, '2025-05-24 13:10:24', '2025-05-24 13:10:24'),
(4, 3, 43, NULL, 19.00, 5, 142.50, '2025-05-24 13:10:38', '2025-05-24 13:10:38');

INSERT INTO `reservation_orders` (`id`, `order_id`, `mobile_country_code`, `customer_name`, `mobile`, `no_of_adults`, `no_of_children`, `day`, `from`, `to`, `from_to`, `restaurant_table_id`, `is_delete`, `is_cancel`, `created_at`, `updated_at`) VALUES
(1, 3, '971', 'Trend line', '501234500', 1, 0, '2025-05-25', '22:00:00', '23:00:00', NULL, 2, 0, 0, '2025-05-24 13:13:14', '2025-05-24 13:13:14'),
(2, 5, '971', 'Trend line', '501234500', 1, 0, '2025-05-25', '22:00:00', '23:00:00', NULL, 3, 0, 0, '2025-05-24 13:13:30', '2025-05-24 13:13:30');



INSERT INTO `order_item_add_ons` (`id`, `order_item_id`, `add_on_id`, `price`, `qty`, `total`, `created_at`, `updated_at`) VALUES
(1, 1, 12, 9.00, 5, 45.00, '2025-05-24 12:50:31', '2025-05-24 12:50:31'),
(2, 2, 8, 2.50, 5, 12.50, '2025-05-24 12:52:43', '2025-05-24 12:52:43'),
(3, 2, 19, 7.00, 5, 35.00, '2025-05-24 12:52:43', '2025-05-24 12:52:43'),
(4, 3, 8, 2.50, 5, 12.50, '2025-05-24 13:10:24', '2025-05-24 13:10:24'),
(5, 3, 19, 7.00, 5, 35.00, '2025-05-24 13:10:24', '2025-05-24 13:10:24'),
(6, 4, 8, 2.50, 5, 12.50, '2025-05-24 13:10:38', '2025-05-24 13:10:38'),
(7, 4, 19, 7.00, 5, 35.00, '2025-05-24 13:10:38', '2025-05-24 13:10:38');









UPDATE orders
SET hash_key_download = LOWER(CONCAT(
    SUBSTRING(MD5(RAND()), 1, 8),
    SUBSTRING(MD5(RAND()), 1, 8),
    SUBSTRING(MD5(RAND()), 1, 8),
    SUBSTRING(MD5(RAND()), 1, 8)
));