-- Restore old stock_requisitions data lost during the MySQL migration
-- Generated from the old database.sqlite backup

-- Remove any broken/empty rows with the same IDs first (safe if they don't exist)
DELETE FROM stock_requisition_details WHERE requisition_id IN (4,14,15,16,18,19,20,21,22);
DELETE FROM stock_requisitions WHERE id IN (4,14,15,16,18,19,20,21,22);

-- Restore requisitions
INSERT INTO stock_requisitions (id, req_date, warehouse_id, warehouse_name, user_name, status, comments, intended_approver, paper_approved_by) VALUES (4, '2026-06-25 15:09:26', 8, 'محطة خلط خرسانة ابوقرقاص', 'admin', 'pending', '[]', NULL, NULL);
INSERT INTO stock_requisitions (id, req_date, warehouse_id, warehouse_name, user_name, status, comments, intended_approver, paper_approved_by) VALUES (14, '2026-07-13 13:16:31', 3, 'مخزن الروافع', 'mohamed hamed', 'pending', '[{"text":"\\u0644\\u0641\\u0629 \\u0627\\u0644\\u0633\\u0644\\u0643 \\u062a\\u0643\\u0648\\u0646 4\\u0637\\u0631\\u0641 40\\u0645","user":"mohamed hamed","timestamp":"2026-07-13T12:55:31.159Z"}]', 'e.ahmed abdelazzem, mahmoud elmehe, Mustafa, e.yasser tawfic', 'mahmoud elmehe');
INSERT INTO stock_requisitions (id, req_date, warehouse_id, warehouse_name, user_name, status, comments, intended_approver, paper_approved_by) VALUES (15, '2026-07-13 17:51:15', 4, 'مخزن ابوقرقاص', 'emad hussen', 'pending', '[]', 'e.ahmed abdelazzem, mahmoud elmehe', 'mahmoud elmehe,e.ahmed abdelazzem');
INSERT INTO stock_requisitions (id, req_date, warehouse_id, warehouse_name, user_name, status, comments, intended_approver, paper_approved_by) VALUES (16, '2026-07-19 08:49:28', 3, 'مخزن الروافع', 'mohamed hamed', 'pending', '[]', 'emad fawzy, e.ahmed abdelazzem, mahmoud elmehe, Mustafa, e.yasser tawfic', 'mahmoud elmehe');
INSERT INTO stock_requisitions (id, req_date, warehouse_id, warehouse_name, user_name, status, comments, intended_approver, paper_approved_by) VALUES (18, '2026-07-22 10:06:11', 3, 'مخزن الروافع', 'mohamed hamed', 'pending', '[]', 'emad fawzy, e.ahmed abdelazzem, mahmoud elmehe, Mustafa, e.yasser tawfic', 'mahmoud elmehe');
INSERT INTO stock_requisitions (id, req_date, warehouse_id, warehouse_name, user_name, status, comments, intended_approver, paper_approved_by) VALUES (19, '2026-07-27 19:25:01', 4, 'مخزن ابوقرقاص', 'emad hussen', 'pending', '[]', 'e.ahmed abdelazzem, mahmoud elmehe', NULL);
INSERT INTO stock_requisitions (id, req_date, warehouse_id, warehouse_name, user_name, status, comments, intended_approver, paper_approved_by) VALUES (20, '2026-07-28 22:48:08', 3, 'مخزن الروافع', 'mohamed hamed', 'pending', '[]', 'e.ahmed abdelazzem, mahmoud elmehe, Mustafa, e.yasser tawfic', 'mahmoud elmehe');
INSERT INTO stock_requisitions (id, req_date, warehouse_id, warehouse_name, user_name, status, comments, intended_approver, paper_approved_by) VALUES (21, '2026-08-04 13:14:56', 8, 'محطة خلط خرسانة ابوقرقاص', 'admin', 'pending', '[]', 'emad hussen', 'emad hussen');
INSERT INTO stock_requisitions (id, req_date, warehouse_id, warehouse_name, user_name, status, comments, intended_approver, paper_approved_by) VALUES (22, '2026-08-04 14:25:21', 4, 'مخزن ابوقرقاص', 'emad hussen', 'pending', '[]', 'emad fawzy, e.ahmed abdelazzem, mahmoud elmehe', NULL);

-- Restore requisition line items
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (5, 4, 7, 'اسمنت', 60.0, 2.35, 0.0, 'طن', 1000.0, NULL);
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (17, 14, 529, 'جركن زيت هيدروليك', 6.0, 0.0, 0.0, 'جركن', 1.0, NULL);
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (18, 14, 535, 'جركن زيت موبيل', 6.0, 0.0, 0.0, 'جركن', 1.0, NULL);
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (19, 14, 528, 'جركن زيت تروس', 1.0, 0.0, 0.0, 'جركن', 1.0, NULL);
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (20, 14, 552, 'صفيحة شحم', 2.0, 0.0, 0.0, 'عبوة', 1.0, NULL);
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (21, 14, 133, 'لفه سلك كهربا', 4.0, 0.0, 0.0, 'عدد', 1.0, NULL);
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (22, 14, 399, 'سلسله', 7.0, 0.0, 0.0, 'متر', 1.0, NULL);
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (23, 14, 857, 'مشحمه يدوي', 1.0, 0.0, 0.0, 'عدد', 1.0, NULL);
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (24, 15, 632, 'جنط سياره', 2.0, 0.0, 0.0, 'عدد', 1.0, NULL);
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (30, 16, 558, 'بسكوت 2.5 سم كوبايه', 5.0, NULL, NULL, 'شكارة', 1.0, NULL);
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (31, 16, 560, 'بسكوت 5سم كوبايه', 5.0, NULL, NULL, 'شكارة', 1.0, NULL);
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (32, 16, 301, 'برميل بلاستيك', 1.0, NULL, NULL, 'عدد', 1.0, NULL);
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (33, 16, 255, 'شريط لاصق', 40.0, NULL, NULL, 'عدد', 1.0, NULL);
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (34, 16, 276, 'خيط نجارين', 50.0, NULL, NULL, 'عدد', 1.0, NULL);
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (35, 16, 631, 'بطاريه', 1.0, 0.0, 0.0, 'عدد', 1.0, NULL);
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (43, 18, 364, 'خرطوم هواء لمبه قطعيه', 20.0, 0.0, 0.0, 'متر', 1.0, NULL);
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (44, 18, 616, 'خلاطه فتحه', 1.0, 0.0, 0.0, 'عدد', 1.0, NULL);
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (45, 18, 206, 'جوانتي لحام', 1.0, 0.0, 0.0, 'عدد', 1.0, NULL);
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (46, 18, 203, 'عفريته', 2.0, 0.0, 0.0, 'عدد', 1.0, NULL);
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (47, 18, 640, 'كاوتش سياره', 2.0, 0.0, 0.0, 'عدد', 1.0, NULL);
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (48, 18, 415, 'كمبلوسر هواء', 1.0, 0.0, 0.0, 'عدد', 1.0, NULL);
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (49, 18, 269, 'محبس خرطوم هواء', 1.0, 0.0, 0.0, 'عدد', 1.0, NULL);
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (50, 19, 7, 'اسمنت', 50.0, 0.0, 4300.0, 'كجم', 1.0, NULL);
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (51, 20, 7, 'اسمنت', 57.0, 0.0, 1.5, 'طن', 1000.0, NULL);
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (52, 21, 198, 'حامل تحويله', 11.0, 0.0, 0.0, 'عدد', 1.0, 'مشمشم');
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (53, 22, 633, 'فلتر زيت', 1.0, 0.0, 0.0, 'عدد', 1.0, 'p557440لودر36');
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (54, 22, 634, 'فلتر جاز', 1.0, 0.0, 0.0, 'عدد', 1.0, 'p554004  لودر36');
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (55, 22, 673, 'فلتر هواء', 2.0, 0.0, 0.0, 'عدد', 1.0, 'خلاطة محمود mp3');
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (56, 22, 761, 'اكره باب', 1.0, 0.0, 0.0, 'عدد', 1.0, 'خلاطةmp3');
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (57, 22, 803, 'عمه هواء', 1.0, 0.0, 0.0, 'عدد', 1.0, 'خلاطة بليدى مرفق صوره ');
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (58, 22, 639, 'كوريك رفع', 1.0, 0.0, 0.0, 'عدد', 1.0, '3خلاطات');
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (59, 22, 692, 'فانوس خلفي', 1.0, 0.0, 0.0, 'عدد', 1.0, 'خلاطة بليدى');
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (60, 22, 852, 'بنسه', 1.0, 0.0, 0.0, 'عدد', 1.0, 'خلاطة بليدى ');
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (61, 22, 870, 'خرطوم مشحمه', 10.0, 0.0, 0.0, 'متر', 1.0, '');
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (62, 22, 539, 'جركن مياه نار', 1.0, 0.0, 0.0, 'جركن', 1.0, '');
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (63, 22, 315, 'مسدس هواء', 2.0, 0.0, 0.0, 'عدد', 1.0, 'خلاطة بليدى  والكمبروسور');
INSERT INTO stock_requisition_details (id, requisition_id, item_id, item_name, req_qty, current_qty, other_qty, unit, conv_factor, note) VALUES (64, 22, 316, 'خرطوم مسدس هواء', 10.0, 0.0, 0.0, 'متر', 1.0, 'للكمبروسور');