{"text_format":"1","workbook":"xlsx","n_sheets":15,"sheets":["لوحة التحكم","Items","Main_Store","Log_Success","Log_Failed","Stores","Serial_Settings","Sales_Header","Sales_Details","Archive_Log","Purchase_Header","Welcome","Users_DB","Purchase_Details","بيانات"],"not_rendered":{"charts":0,"images":0,"macros":1,"external_links":0,"defined_names":0,"comments":0,"pivot_tables":0},"unopened":[],"bounds":{"document_bytes":16777216,"sheet_cells":100000,"rows_first":2000,"rows_last":500,"rows_between":2000,"halvings":0,"cell_chars":16384,"cell_head_chars":4096},"cells_cut":0,"cells_raw":0,"read":"whole","date_system":"1900"}

{"sheet":"لوحة التحكم","index":0,"n_rows":4,"n_cols":1,"rows_kept":4,"cut":false,"hidden":true,"merged":[[3,0,3,7],[0,0,2,7]]}
["🏭  نظام إدارة المخازن والتحويلات"]
[]
[]
["افتح واجهة التحويل من القائمة: إضافات ← فتح نافذة التحويل"]

{"sheet":"Items","index":1,"n_rows":6,"n_cols":9,"rows_kept":6,"cut":false,"hidden":true,"merged":[]}
["الكود (Code)","اسم الصنف (Item_Name)","معامل التحويل (Conversion_Factor)","سعر الشراء (Purchase_Price)","سعر الجملة (Wholesale_Price)","سعر التجزئة (Retail_Price)","نص جملة","كبار عملاء","قطاعى"]
["00001","مياه معدنية 600مل",12,5,6,7]
["00002","عصير برتقال 1لتر",6,10,12,15]
["00003","مشروب غازي 330مل",24,8,9.5,11]
["00004","حليب كامل الدسم 1لتر",12,15,18,22]
["00005","زيت نباتي 1.8لتر",6,25,28,32]

{"sheet":"Main_Store","index":2,"n_rows":31,"n_cols":5,"rows_kept":31,"cut":false,"hidden":true,"merged":[]}
["المخزن (Store_Name)","الكود (Code)","اسم الصنف (Item_Name)","رصيد كرتون (Carton_Qty)","رصيد قطعة (Piece_Qty)"]
["المخزن الرئيسي","00001","مياه معدنية 600مل",70,0]
["المخزن الرئيسي","00002","عصير برتقال 1لتر",100,0]
["المخزن الرئيسي","00003","مشروب غازي 330مل",100,0]
["المخزن الرئيسي","00004","حليب كامل الدسم 1لتر",100,0]
["المخزن الرئيسي","00005","زيت نباتي 1.8لتر",100,0]
["مخزن المندوب 1","00001","مياه معدنية 600مل",50,0]
["مخزن المندوب 1","00002","عصير برتقال 1لتر",20,0]
["مخزن المندوب 1","00003","مشروب غازي 330مل",20,0]
["مخزن المندوب 1","00004","حليب كامل الدسم 1لتر",20,0]
["مخزن المندوب 1","00005","زيت نباتي 1.8لتر",20,0]
["مخزن المندوب 2","00001","مياه معدنية 600مل",20,0]
["مخزن المندوب 2","00002","عصير برتقال 1لتر",20,0]
["مخزن المندوب 2","00003","مشروب غازي 330مل",20,0]
["مخزن المندوب 2","00004","حليب كامل الدسم 1لتر",20,0]
["مخزن المندوب 2","00005","زيت نباتي 1.8لتر",20,0]
["مخزن المندوب 3","00001","مياه معدنية 600مل",20,0]
["مخزن المندوب 3","00002","عصير برتقال 1لتر",20,0]
["مخزن المندوب 3","00003","مشروب غازي 330مل",20,0]
["مخزن المندوب 3","00004","حليب كامل الدسم 1لتر",20,0]
["مخزن المندوب 3","00005","زيت نباتي 1.8لتر",20,0]
["مخزن المندوب 4","00001","مياه معدنية 600مل",20,0]
["مخزن المندوب 4","00002","عصير برتقال 1لتر",20,0]
["مخزن المندوب 4","00003","مشروب غازي 330مل",20,0]
["مخزن المندوب 4","00004","حليب كامل الدسم 1لتر",20,0]
["مخزن المندوب 4","00005","زيت نباتي 1.8لتر",20,0]
["مخزن المندوب 5","00001","مياه معدنية 600مل",20,0]
["مخزن المندوب 5","00002","عصير برتقال 1لتر",20,0]
["مخزن المندوب 5","00003","مشروب غازي 330مل",20,0]
["مخزن المندوب 5","00004","حليب كامل الدسم 1لتر",20,0]
["مخزن المندوب 5","00005","زيت نباتي 1.8لتر",20,0]

{"sheet":"Log_Success","index":3,"n_rows":42,"n_cols":5,"rows_kept":42,"cut":false,"hidden":true,"merged":[]}
[]
["2026-07-14T10:26:44","admin","ddddd",124588563,"Online - دخل النظام بنجاح"]
["2026-07-14T10:30:59","admin","fdfd",28728642,"Online - دخل النظام بنجاح"]
["2026-07-14T10:53:48","admin","soft@gmail.com",2010000000,"Online - دخل النظام بنجاح"]
["2026-07-14T11:33:12","admin","بببيب",52054,"Online - دخل النظام بنجاح"]
["2026-07-14T11:38:08","admin","برشري",3650241,"Online - دخل النظام بنجاح"]
["2026-07-14T11:56:58","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-14T12:05:48","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-14T12:10:18","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-14T12:25:27","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-14T12:30:46","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-14T12:35:43","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-14T12:47:21","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-14T12:58:31","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-14T13:01:37","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-14T13:07:29","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-14T13:13:39","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-14T13:16:45","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-14T13:17:54","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-14T14:31:25","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-14T14:32:39","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-14T14:48:33","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-14T20:26:15","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-14T20:28:19","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-14T20:30:41","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-14T21:06:37","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-14T21:43:45","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-15T08:34:05","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-15T08:35:44","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-15T08:52:09","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-15T08:53:47","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-15T08:56:20","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-15T08:58:26","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-15T08:59:35","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-15T09:10:17","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-15T09:14:54","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-15T09:17:39","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-15T09:23:12","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-15T09:25:26","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-15T09:30:48","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-15T09:40:35","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]
["2026-07-15T09:52:31","admin","mahmoud_nasr2002@yahoo.com",201142249700,"Online - دخل النظام بنجاح"]

{"sheet":"Log_Failed","index":4,"n_rows":4,"n_cols":6,"rows_kept":4,"cut":false,"hidden":true,"merged":[]}
[]
["2026-07-14T11:44:55","admin",1233,null,null,"المحاولة الخاطئة رقم (1 من 3)"]
["2026-07-14T11:47:10","admin",1233,"mahmoud_nasr2002@yahoo.com",201142249700,"المحاولة الخاطئة رقم (2 من 3)"]
["2026-07-15T08:56:04","admin",468,"mahmoud_nasr2002@yahoo.com",201142249700,"المحاولة الخاطئة رقم (1 من 3)"]

{"sheet":"Stores","index":5,"n_rows":7,"n_cols":1,"rows_kept":7,"cut":false,"hidden":true,"merged":[]}
["اسم المخزن (Store_Name)"]
["المخزن الرئيسي"]
["مخزن المندوب 1"]
["مخزن المندوب 2"]
["مخزن المندوب 3"]
["مخزن المندوب 4"]
["مخزن المندوب 5"]

{"sheet":"Serial_Settings","index":6,"n_rows":7,"n_cols":3,"rows_kept":7,"cut":false,"hidden":true,"merged":[]}
["نوع الحركة","الرقم الحالي","البادئة"]
["تحويل بين المخازن",107,"TR"]
["مشتريات",200,"PO"]
["مبيعات",300,"SO"]
["مردودات مشتريات",400,"PR"]
["مردودات مبيعات",500,"SR"]
["تسوية جرد",600,"IA"]

{"sheet":"Sales_Header","index":7,"n_rows":3,"n_cols":7,"rows_kept":3,"cut":false,"hidden":true,"merged":[]}
["رقم الحركة","التاريخ","المخزن المستلم","المخزن المصدر","إجمالي القيمة","نوع الحركة","ملاحظات"]
["TR-2026-106","2026-07-04","مخزن المندوب 1","المخزن الرئيسي",13,"تحويل بين المخازن","مُرحّل: 2026-07-04 23:44"]
["TR-2026-107","2026-07-04","مخزن المندوب 1","المخزن الرئيسي",13,"تحويل بين المخازن","مُرحّل: 2026-07-04 23:51"]

{"sheet":"Sales_Details","index":8,"n_rows":5,"n_cols":9,"rows_kept":5,"cut":false,"hidden":true,"merged":[]}
["رقم الحركة","كود الصنف","اسم الصنف","الوحدة","الكمية","سعر الوحدة","الإجمالي","نوع السعر","نوع الحركة"]
["TR-2026-106",1,"مياه معدنية 600مل","كرتون",2,6,{"$f":"E2*F2","v":12},"جملة","تحويل بين المخازن"]
["TR-2026-106",1,"مياه معدنية 600مل","قطعة",2,0.5,{"$f":"E3*F3","v":1},"جملة","تحويل بين المخازن"]
["TR-2026-107",1,"مياه معدنية 600مل","كرتونة",2,6,{"$f":"E4*F4","v":12},"جملة","تحويل بين المخازن"]
["TR-2026-107",1,"مياه معدنية 600مل","قطعة",2,0.5,{"$f":"E5*F5","v":1},"جملة","تحويل بين المخازن"]

{"sheet":"Archive_Log","index":9,"n_rows":11,"n_cols":7,"rows_kept":11,"cut":false,"hidden":true,"merged":[]}
["رقم الإذن / الحركة","تاريخ الحركة ووقتها","كود الصنف","اسم الصنف","طبيعة الحركة (حذف بند مؤقت / تعديل بند مؤقت / إلغاء فاتورة بالكامل)","الكمية المتأثرة","اسم مستخدم الويندوز (Environ(\"Username\"))"]
["TR-2026-101","2026-06-30T11:43:34",1,null,"حذف بند من القائمة المؤقتة",1,"Mahmoud-Nasr"]
["TR-2026-101","2026-07-01T21:32:22",1,null,"إلغاء فاتورة وعكس مخزون",1,"Mahmoud-Nasr"]
["TR-2026-102","2026-07-01T23:33:25",1,null,"إلغاء فاتورة وعكس مخزون",1,"Mahmoud-Nasr"]
["TR-2026-103","2026-07-01T23:49:13",1,null,"إلغاء فاتورة وعكس مخزون",1,"Mahmoud-Nasr"]
["TR-2026-105","2026-07-02T10:26:57",1,null,"تراجع وإلغاء إدخال علوي",1,"Mahmoud-Nasr"]
["TR-2026-105","2026-07-02T10:27:17",1,null,"حذف بند من القائمة المؤقتة",1,"Mahmoud-Nasr"]
["TR-2026-105","2026-07-02T10:27:35",1,null,"إلغاء فاتورة وعكس مخزون",1,"Mahmoud-Nasr"]
["TR-2026-105","2026-07-02T10:27:36",1,null,"تراجع وإلغاء إدخال علوي",1,"Mahmoud-Nasr"]
["TR-2026-104","2026-07-02T11:41:50",1,"مياه معدنية 600مل","حذف صنف وعكس مخزونه من فاتورة مرحلة [ من: المخزن الرئيسي إلى: مخزن المندوب 1 ]",1,"Mahmoud-Nasr"]
["TR-2026-104","2026-07-02T11:41:51",1,"مياه معدنية 600مل","تراجع وإلغاء إدخال علوي",1,"Mahmoud-Nasr"]

{"sheet":"Purchase_Header","index":10,"n_rows":0,"n_cols":0,"rows_kept":0,"cut":false,"hidden":true,"merged":[]}

{"sheet":"Welcome","index":11,"n_rows":0,"n_cols":0,"rows_kept":0,"cut":false,"hidden":false,"merged":[]}

{"sheet":"Users_DB","index":12,"n_rows":2,"n_cols":6,"rows_kept":2,"cut":false,"hidden":true,"merged":[]}
["اسم المستخدم","كلمة المرور","البريد الإلكتروني"," رقم الهاتف (بالصيغة الدولية: 2010...)","الصلاحيات (أسماء الشيتات مفصولة بفاصلة: المخزون,التحويلات)","الرتبة (Admin أو User)"]
["admin",123,"mahmoud_nasr2002@yahoo.com",201142249700,"إعدادات الإدارة,Sheet1,Sheet3,Sheet2,Sheet4,Sheet5,Sheet6,Sheet7,Sheet8,Sheet9,Sheet10","Admin"]

{"sheet":"Purchase_Details","index":13,"n_rows":0,"n_cols":0,"rows_kept":0,"cut":false,"hidden":true,"merged":[]}

{"sheet":"بيانات","index":14,"n_rows":132,"n_cols":7,"rows_kept":132,"cut":false,"hidden":true,"merged":[]}
["╔══════════════════════════════════════════════════════════════════╗"]
["║       نظام إدارة تحويل المخازن - VBA Excel                      ║",null,null,null,null,null,"' =========================================="]
["║       دليل التركيب والاستخدام الكامل                            ║",null,null,null,null,null,"' 1. زر التراجع ومسح الحقول الحالية (Wipe / Undo)"]
["╚══════════════════════════════════════════════════════════════════╝",null,null,null,null,null,"' =========================================="]
[null,null,null,null,null,null,"Private Sub btnWipeUndo_Click()"]
["━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━",null,null,null,null,null,"    cmbItems.Value = \"\""]
[" الخطوة 1: فتح الملف",null,null,null,null,null,"    txtQty.Text = \"\""]
["━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━",null,null,null,null,null,"    txtPrice.Text = \"0.00\""]
["1. افتح ملف TransferSystem.xlsm",null,null,null,null,null,"    txtAvailableQty.Text = \"0\""]
["2. عند ظهور رسالة \"تمكين وحدات الماكرو\" → انقر [تمكين المحتوى]",null,null,null,null,null,"    txtAvailableQty.BackColor = RGB(232, 244, 253) ' إعادة اللون الأزرق الفاتح الافتراضي"]
[null,null,null,null,null,null,"    "]
["━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━",null,null,null,null,null,"    ' تحديث الحالة الحية لتصفير الحقول بشكل سليم"]
[" الخطوة 2: إضافة كود VBA",null,null,null,null,null,"    Call FetchLiveStock"]
["━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━",null,null,null,null,null,"End Sub"]
["1. اضغط Alt + F11 لفتح محرر VBA"]
["2. من القائمة: Insert ← Module",null,null,null,null,null,"' =========================================="]
["3. افتح ملف [TransferModule.bas] من هذا المجلد",null,null,null,null,null,"' 2. زر تعديل السطر المحدد (Modify Selection)"]
["4. انسخ محتواه والصقه في الموديول الجديد",null,null,null,null,null,"' =========================================="]
[null,null,null,null,null,null,"Private Sub btnModifySelection_Click()"]
["━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━",null,null,null,null,null,"    If lstTransferItems.ListIndex = -1 Then"]
[" الخطوة 3: إنشاء UserForm",null,null,null,null,null,"        MsgBox \"برجاء اختيار صنف من القائمة السفلية لتعديله أولاً.\", vbExclamation, \"تنبيه\""]
["━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━",null,null,null,null,null,"        Exit Sub"]
["1. في محرر VBA: Insert ← UserForm",null,null,null,null,null,"    End If"]
["2. في Properties: غيّر اسمه (Name) إلى: frmTransfer",null,null,null,null,null,"    "]
["3. صمم الواجهة بإضافة العناصر التالية:",null,null,null,null,null,"    ' أخذ كود الصنف والكمية والوحدة قبل حذف السطر"]
[null,null,null,null,null,null,"    Dim selectedCode As String: selectedCode = lstTransferItems.List(lstTransferItems.ListIndex, 0)"]
["   ┌─ صناديق النص (TextBox) ─────────────────────┐",null,null,null,null,null,"    Dim selectedQty As String:  selectedQty = lstTransferItems.List(lstTransferItems.ListIndex, 3)"]
["   │  txtTransferNo  │ رقم الحركة (مقيّد للقراءة) │",null,null,null,null,null,"    Dim selectedUnit As String: selectedUnit = lstTransferItems.List(lstTransferItems.ListIndex, 2)"]
["   │  txtDate        │ تاريخ الحركة               │",null,null,null,null,null,"    "]
["   │  txtSourceCode  │ كود المخزن المصدر           │",null,null,null,null,null,"    ' إزالة السطر المختار من القائمة لإعادة حقنه بعد التعديل"]
["   │  txtTargetCode  │ كود المخزن المستلم          │",null,null,null,null,null,"    lstTransferItems.RemoveItem lstTransferItems.ListIndex"]
["   │  txtPrice       │ سعر الوحدة                  │",null,null,null,null,null,"    "]
["   │  txtAvailableQty│ الرصيد المتاح               │",null,null,null,null,null,"    ' استرجاع البيانات المحددة إلى عناصر التحكم العلوية"]
["   │  txtQty         │ الكمية المراد تحويلها        │",null,null,null,null,null,"    cmbItems.Value = selectedCode"]
["   └─────────────────────────────────────────────┘",null,null,null,null,null,"    txtQty.Text = selectedQty"]
["   ",null,null,null,null,null,"    "]
["   ┌─ قوائم منسدلة (ComboBox) ──────────────────┐",null,null,null,null,null,"    ' التحقق من الوحدة (يدعم كرتون بالعربي أو الإنجليزي لتفادي مشاكل الترميز)"]
["   │  cmbPriceType   │ نوع السعر                  │",null,null,null,null,null,"    If selectedUnit = \"Carton\" Or selectedUnit = \"كرتون\" Then"]
["   │  cmbSourceStore │ المخزن المصدر               │",null,null,null,null,null,"        optCarton.Value = True"]
["   │  cmbTargetStore │ المخزن المستلم              │",null,null,null,null,null,"    Else"]
["   │  cmbItems       │ الأصناف                     │",null,null,null,null,null,"        optPiece.Value = True"]
["   └─────────────────────────────────────────────┘",null,null,null,null,null,"    End If"]
["   ",null,null,null,null,null,"    "]
["   ┌─ أزرار الاختيار (OptionButton) ────────────┐",null,null,null,null,null,"    ' إعادة تحديث الرصيد المتاح والحسبه الحية مع اعتبار السطر محذوفاً الآن"]
["   │  optCarton      │ كرتون                      │",null,null,null,null,null,"    Call FetchLiveStock"]
["   │  optPiece       │ قطعة                       │",null,null,null,null,null,"End Sub"]
["   └─────────────────────────────────────────────┘"]
["   ",null,null,null,null,null,"' =========================================="]
["   ┌─ قائمة العرض والأزرار ─────────────────────┐",null,null,null,null,null,"' 3. زر حذف البند المحدد (Delete Selection)"]
["   │  lstTransferItems │ قائمة الأصناف (ListBox)  │",null,null,null,null,null,"' =========================================="]
["   │  btnAddItem       │ + إضافة للقائمة          │",null,null,null,null,null,"Private Sub btnDeleteItem_Click()"]
["   │  btnDeleteItem    │ 🗑 حذف محدد              │",null,null,null,null,null,"    If lstTransferItems.ListCount = 0 Then Exit Sub"]
["   │  btnProcess       │ ✅ ترحيل التحويل         │",null,null,null,null,null,"    "]
["   │  btnCancel        │ ✖ إلغاء                  │",null,null,null,null,null,"    If lstTransferItems.ListIndex = -1 Then"]
["   └─────────────────────────────────────────────┘",null,null,null,null,null,"        MsgBox \"اختر الصنف المراد حذفه من القائمة أولاً.\", vbExclamation, \"لم يتم الاختيار\""]
[null,null,null,null,null,null,"        Exit Sub"]
["4. في نافذة الكود (Code) الخاصة بالفرم:",null,null,null,null,null,"    End If"]
["   - افتح ملف [frmTransfer_Code.bas] من هذا المجلد",null,null,null,null,null,"    "]
["   - انسخ محتواه بالكامل والصقه",null,null,null,null,null,"    Dim ans As Integer"]
[null,null,null,null,null,null,"    ans = MsgBox(\"هل تريد حذف هذا الصنف من قائمة التحويل؟\", vbYesNo + vbQuestion, \"تأكيد الحذف\")"]
["━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━",null,null,null,null,null,"    "]
[" الخطوة 4: إضافة زر تشغيل في Excel",null,null,null,null,null,"    If ans = vbYes Then"]
["━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━",null,null,null,null,null,"        lstTransferItems.RemoveItem lstTransferItems.ListIndex"]
["1. اذهب لشيت \"لوحة التحكم\"",null,null,null,null,null,"        ' إعادة تحديث المخزون المتاح فوراً لأن الكمية المحجوزة في السطر المحذوف تحررت وعادت للمخزن"]
["2. Insert ← Shapes ← Rectangle (مستطيل)",null,null,null,null,null,"        Call FetchLiveStock"]
["3. اكتب فيه: \"فتح نافذة التحويل\"",null,null,null,null,null,"    End If"]
["4. انقر يمين على الشكل ← Assign Macro",null,null,null,null,null,"End Sub"]
["5. اختر: OpenTransferForm"]
[null,null,null,null,null,null,"Private Sub btnSearch_Click()"]
["━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━",null,null,null,null,null,"    Dim InvoiceNo As String"]
[" هيكل الشيتات الموجودة في الملف",null,null,null,null,null,"    InvoiceNo = Trim(txtTransferNo.Text) ' قراءة رقم الفاتورة/الإذن من حقل النص"]
["━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━",null,null,null,null,null,"    "]
["  Items          ← قاعدة بيانات الأصناف والأسعار",null,null,null,null,null,"    If InvoiceNo = \"\" Then"]
["  Main_Store     ← أرصدة الأصناف في كل مخزن",null,null,null,null,null,"        MsgBox \"⚠️ برجاء إدخال رقم الفاتورة أو إذن التحويل أولاً للبحث!\", vbExclamation, \"حقل فارغ\""]
["  Stores         ← قائمة المخازن والمناديب",null,null,null,null,null,"        txtTransferNo.SetFocus"]
["  Serial_Settings← إعدادات أرقام الحركات",null,null,null,null,null,"        Exit Sub"]
["  Sales_Header   ← رؤوس مستندات التحويل المُرحَّلة",null,null,null,null,null,"    End If"]
["  Sales_Details  ← تفاصيل بنود التحويلات",null,null,null,null,null,"    "]
["  لوحة التحكم   ← الشاشة الرئيسية",null,null,null,null,null,"    Dim wsH As Worksheet: Set wsH = ThisWorkbook.Sheets(\"Sales_Header\")"]
[null,null,null,null,null,null,"    Dim wsD As Worksheet: Set wsD = ThisWorkbook.Sheets(\"Sales_Details\")"]
["━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━",null,null,null,null,null,"    Dim rH As Long, rD As Long"]
[" بيانات تجريبية جاهزة",null,null,null,null,null,"    Dim InvoiceFound As Boolean: InvoiceFound = False"]
["━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━",null,null,null,null,null,"    "]
["  ✓ 5 أصناف في شيت Items",null,null,null,null,null,"    On Error GoTo ErrHandler"]
["  ✓ 6 مخازن (رئيسي + 5 مناديب) في Stores و Main_Store",null,null,null,null,null,"    Application.ScreenUpdating = False"]
["  ✓ أرصدة مبدئية جاهزة للتجربة",null,null,null,null,null,"    "]
[null,null,null,null,null,null,"    ' 1. البحث في شيت رأس المستندات (Sales_Header) لجلب البيانات الأساسية"]
["━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━",null,null,null,null,null,"    For rH = 2 To wsH.Cells(wsH.Rows.Count, \"A\").End(xlUp).Row"]
[" ملاحظات مهمة",null,null,null,null,null,"        If wsH.Cells(rH, 1).Value = InvoiceNo Then"]
["━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━",null,null,null,null,null,"            ' استرجاع البيانات إلى حقول الواجهة"]
["• احفظ الملف دائماً بصيغة .xlsm (Excel Macro-Enabled)",null,null,null,null,null,"            txtDate.Text = Format(wsH.Cells(rH, 2).Value, \"yyyy-mm-dd\")"]
["• لا تحفظ بصيغة .xlsx لأن ذلك سيحذف كود VBA",null,null,null,null,null,"            cmbTargetStore.Value = wsH.Cells(rH, 3).Value ' المخزن المستلم"]
["• يدعم الكود خاصية دمج الأصناف المتكررة تلقائياً",null,null,null,null,null,"            cmbSourceStore.Value = wsH.Cells(rH, 4).Value ' المخزن المصدر"]
["• الرصيد يُحدَّث فورياً بعد كل عملية ترحيل",null,null,null,null,null,"            ' إذا كان لديك حقل لعرض الإجمالي الكلي للفاتورة"]
[null,null,null,null,null,null,"            ' txtGrandTotal.Text = Format(wsH.Cells(rH, 5).Value, \"0.00\") "]
[null,null,null,null,null,null,"            "]
[null,null,null,null,null,null,"            InvoiceFound = True"]
[null,null,null,null,null,null,"            Exit For"]
[null,null,null,null,null,null,"        End If"]
[null,null,null,null,null,null,"    Next rH"]
[null,null,null,null,null,null,"    "]
[null,null,null,null,null,null,"    ' إذا لم يعثر على الرقم في شيت الـ Header"]
[null,null,null,null,null,null,"    If Not InvoiceFound Then"]
[null,null,null,null,null,null,"        MsgBox \"❌ عذراً، لم يتم العثور على فاتورة أو إذن بالرقم: \" & InvoiceNo, vbCritical, \"غير موجود\""]
[null,null,null,null,null,null,"        Application.ScreenUpdating = True"]
[null,null,null,null,null,null,"        Exit Sub"]
[null,null,null,null,null,null,"    End If"]
[null,null,null,null,null,null,"    "]
[null,null,null,null,null,null,"    ' 2. جلب البنود التفصيلية من شيت التفاصيل (Sales_Details) وعرضها في الـ ListBox"]
[null,null,null,null,null,null,"    Me.lstTransferItems.Clear"]
[null,null,null,null,null,null,"    "]
[null,null,null,null,null,null,"    For rD = 2 To wsD.Cells(wsD.Rows.Count, \"A\").End(xlUp).Row"]
[null,null,null,null,null,null,"        If wsD.Cells(rD, 1).Value = InvoiceNo Then"]
[null,null,null,null,null,null,"            With Me.lstTransferItems"]
[null,null,null,null,null,null,"                .AddItem"]
[null,null,null,null,null,null,"                .List(.ListCount - 1, 0) = wsD.Cells(rD, 2).Value ' كود الصنف"]
[null,null,null,null,null,null,"                .List(.ListCount - 1, 1) = wsD.Cells(rD, 3).Value ' اسم الصنف"]
[null,null,null,null,null,null,"                .List(.ListCount - 1, 2) = wsD.Cells(rD, 4).Value ' الوحدة (كرتون/قطعة)"]
[null,null,null,null,null,null,"                .List(.ListCount - 1, 3) = wsD.Cells(rD, 5).Value ' الكمية المرحّلة"]
[null,null,null,null,null,null,"                .List(.ListCount - 1, 4) = Format(wsD.Cells(rD, 6).Value, \"0.00\") ' السعر الفردي"]
[null,null,null,null,null,null,"            End With"]
[null,null,null,null,null,null,"        End If"]
[null,null,null,null,null,null,"    Next rD"]
[null,null,null,null,null,null,"    "]
[null,null,null,null,null,null,"    Application.ScreenUpdating = True"]
[null,null,null,null,null,null,"    MsgBox \"🔍 تم استرجاع الفاتورة رقم [\" & InvoiceNo & \"] بنجاح وعرض كافة بنودها التفصيلية.\", vbInformation, \"نجاح البحث\""]
[null,null,null,null,null,null,"    Exit Sub"]
[]
[null,null,null,null,null,null,"ErrHandler:"]
[null,null,null,null,null,null,"    Application.ScreenUpdating = True"]
[null,null,null,null,null,null,"    MsgBox \"❌ حدث خطأ أثناء جلب بيانات الفاتورة: \" & Err.Description, vbCritical, \"خطأ برمجي\""]
[null,null,null,null,null,null,"End Sub"]