{"text_format":"1","workbook":"xlsx","n_sheets":4,"sheets":["تسجيل حضور وانصراف","التقارير","محمود تقرير حضور وانصراف","Sheet16"],"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":9,"n_cols":8,"rows_kept":9,"cut":false,"hidden":false,"merged":[]}
["User","Action IN","Date","TimeIn","Action OUT","TimeOut","Elapsed","خصم التأخير"]
["محمود","Sign IN","2025-03-10","08:30:00","Sign Out","16:30:00","08:00:00"]
["احمد","Sign IN","2025-03-10","08:00:00","Sign Out","16:30:00","08:30:00"]
["حسين","Sign IN","2025-03-10","08:20:00","Sign Out","16:30:00","08:10:00"]
["عماد","Sign IN","2025-03-10","08:30:00","Sign Out","16:30:00","08:00:00"]
["كمال","Sign IN","2025-03-10","08:12:00","Sign Out","16:30:00","08:18:00"]
["حسان","Sign IN","2025-03-10","08:10:00","Sign Out","16:50:00","08:40:00"]
["سيد","Sign IN","2025-03-10","08:30:00","Sign Out","16:32:00","08:02:00"]
["مهند","Sign IN","2025-03-10","08:30:00","Sign Out","16:30:00","08:00:00"]

{"sheet":"التقارير","index":1,"n_rows":32,"n_cols":4,"rows_kept":32,"cut":false,"hidden":false,"merged":[]}
[]
["تقرير الحضور اليومي لـ 2025-03-11"]
["اسم الموظف","وقت الوصول","وقت المغادرة"]
[]
[]
["تقرير الحضور الشهري لـ محمود"]
["التاريخ","وقت الوصول","وقت المغادرة","عدد ساعات العمل"]
["2025-03-10","08:30:00","16:30:00","08:00:00"]
[]
[]
["تقرير إجمالي ساعات العمل وأيام العمل"]
["اسم الموظف","إجمالي الساعات","أيام العمل"]
["محمود","00:00:00","00:00:00"]
["احمد","00:00:00","00:00:00"]
["حسين","00:00:00","00:00:00"]
["عماد","00:00:00","00:00:00"]
["كمال","00:00:00","00:00:00"]
["حسان","00:00:00","00:00:00"]
["سيد","00:00:00","00:00:00"]
["مهند","00:00:00","00:00:00"]
[]
[]
["تقرير عن التأخيرات"]
["اسم الموظف","التاريخ","خصم التأخير"]
["محمود",45933]
["احمد",45933]
["حسين",45933]
["عماد",45933]
["كمال",45933]
["حسان",45933]
["سيد",45933]
["مهند",45933]

{"sheet":"محمود تقرير حضور وانصراف","index":2,"n_rows":2,"n_cols":8,"rows_kept":2,"cut":false,"hidden":false,"merged":[]}
["مسلسل","اسم الموظف","التاريخ","وقت الوصول","وقت المغادرة","إجمالي الساعات","أيام العمل","ملاحظات"]
["محمود","Sign IN","2025-03-10","08:30:00","Sign Out","16:30:00","08:00:00"]

{"sheet":"Sheet16","index":3,"n_rows":166,"n_cols":14,"rows_kept":166,"cut":false,"hidden":false,"merged":[]}
[]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"Sub إنشاء_تقارير()"]
[]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    Dim wsAttendance As Worksheet"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    Dim wsReports As Worksheet"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    Dim lastRowAttendance As Long"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    Dim lastRowReports As Long"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    Dim i As Long"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    Dim j As Long"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    Dim empName As String"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    Dim currentDate As Date"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    Dim totalHours As Double"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    Dim dayCount As Double"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    Dim delayCount As Integer"]
[]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    ' تعيين أوراق العمل"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    Set wsAttendance = ThisWorkbook.Sheets(\"تسجيل حضور وانصراف\")"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    Set wsReports = ThisWorkbook.Sheets(\"التقارير\")"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    "]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    Call DeleteConditionalData"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    "]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    ' الحصول على آخر صف في ورقة الحضور"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    lastRowAttendance = wsAttendance.Cells(wsAttendance.Rows.Count, \"A\").End(xlUp).Row"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    "]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    currentDate = CDate(InputBox(\"أدخل التاريخ (YYYY-MM-DD):\", \"أدخل التاريخ للتقرير اليومي\", Format(Date, \"yyyy-mm-dd\")))"]
[]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    ' تقرير الحضور اليومي"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"'    currentDate = InputBox(\"أدخل التاريخ للتقرير اليومي (YYYY-MM-DD):\", \"تقرير الحضور اليومي\")"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    If IsDate(currentDate) Then"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        currentDate = CDate(currentDate)"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        lastRowReports = wsReports.Cells(wsReports.Rows.Count, \"A\").End(xlUp).Row + 1"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        wsReports.Cells(lastRowReports, \"A\").Value = \"تقرير الحضور اليومي لـ \" & Format(currentDate, \"YYYY-MM-DD\")"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        lastRowReports = lastRowReports + 1"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        wsReports.Cells(lastRowReports, \"A\").Value = \"اسم الموظف\""]
[]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        wsReports.Cells(lastRowReports, \"B\").Value = \"وقت الوصول\""]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        wsReports.Cells(lastRowReports, \"C\").Value = \"وقت المغادرة\""]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        lastRowReports = lastRowReports + 1"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        "]
[]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        For i = 2 To lastRowAttendance"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"            If wsAttendance.Cells(i, \"C\").Value = currentDate Then"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"                wsReports.Cells(lastRowReports, \"A\").Value = wsAttendance.Cells(i, \"A\").Value"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"                wsReports.Cells(lastRowReports, \"B\").Value = wsAttendance.Cells(i, \"D\").Value"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"                wsReports.Cells(lastRowReports, \"C\").Value = wsAttendance.Cells(i, \"F\").Value"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"                lastRowReports = lastRowReports + 1"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"            End If"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        Next i"]
[]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        ' تنسيق وقت الوصول ووقت المغادرة"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        wsReports.Columns(\"B:C\").NumberFormat = \"hh:mm AM/PM\""]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    End If"]
[]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    ' تقرير الحضور الشهري لكل موظف"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    empName = InputBox(\"أدخل اسم الموظف للتقرير الشهري:\", \"تقرير الحضور الشهري\")"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    "]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"     ' البحث عن صف موجود لنفس الموظف في نفس اليوم"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        foundRow = 0"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        For i = 2 To wsAttendance.Cells(wsAttendance.Rows.Count, \"A\").End(xlUp).Row"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"            If wsAttendance.Cells(i, \"A\").Value = empName And wsAttendance.Cells(i, \"C\").Value = currentDate Then"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"                foundRow = i"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"                Exit For"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"            End If"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        Next i"]
[]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    "]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    "]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    If empName <> \"\" Then"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        lastRowReports = wsReports.Cells(wsReports.Rows.Count, \"A\").End(xlUp).Row + 3"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        wsReports.Cells(lastRowReports, \"A\").Value = \"تقرير الحضور الشهري لـ \" & empName"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        lastRowReports = lastRowReports + 1"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        wsReports.Cells(lastRowReports, \"A\").Value = \"التاريخ\""]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        wsReports.Cells(lastRowReports, \"B\").Value = \"وقت الوصول\""]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        wsReports.Cells(lastRowReports, \"C\").Value = \"وقت المغادرة\""]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        wsReports.Cells(lastRowReports, \"D\").Value = \"عدد ساعات العمل\""]
[null,null,null,null,null,null,null,null,null,null,null,null,null," "]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        lastRowReports = lastRowReports + 1"]
[]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        For i = 2 To lastRowAttendance"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"            If wsAttendance.Cells(i, \"A\").Value = empName Then"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"                wsReports.Cells(lastRowReports, \"A\").Value = wsAttendance.Cells(i, \"C\").Value"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"                wsReports.Cells(lastRowReports, \"B\").Value = wsAttendance.Cells(i, \"D\").Value"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"                wsReports.Cells(lastRowReports, \"C\").Value = wsAttendance.Cells(i, \"F\").Value"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"                wsReports.Cells(lastRowReports, \"D\").Value = wsAttendance.Cells(i, \"G\").Value"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"                wsReports.Cells(lastRowReports, \"D\").NumberFormat = \"hh:mm\""]
[]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"                lastRowReports = lastRowReports + 1"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"            End If"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        Next i"]
[]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        ' تنسيق وقت الوصول ووقت المغادرة"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        wsReports.Columns(\"B:C\").NumberFormat = \"hh:mm AM/PM\""]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    End If"]
[]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    ' تقرير إجمالي ساعات العمل وأيام العمل لكل موظف"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    lastRowReports = wsReports.Cells(wsReports.Rows.Count, \"A\").End(xlUp).Row + 3"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    wsReports.Cells(lastRowReports, \"A\").Value = \"تقرير إجمالي ساعات العمل وأيام العمل\""]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    lastRowReports = lastRowReports + 1"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    wsReports.Cells(lastRowReports, \"A\").Value = \"اسم الموظف\""]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    wsReports.Cells(lastRowReports, \"B\").Value = \"إجمالي الساعات\""]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    wsReports.Cells(lastRowReports, \"C\").Value = \"أيام العمل\""]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    lastRowReports = lastRowReports + 1"]
[]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    ' جمع البيانات لكل موظف"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    Dim employees As Object"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    Set employees = CreateObject(\"Scripting.Dictionary\")"]
[]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    For i = 2 To lastRowAttendance"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        empName = wsAttendance.Cells(i, \"A\").Value"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        If Not employees.Exists(empName) Then"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"            employees.Add empName, Array(0, 0)"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        End If"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        employees(empName)(0) = employees(empName)(0) + wsAttendance.Cells(i, \"F\").Value"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        employees(empName)(1) = employees(empName)(1) + wsAttendance.Cells(i, \"G\").Value"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    Next i"]
[]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    ' كتابة البيانات في التقرير"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    Dim empKey As Variant"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    For Each empKey In employees.Keys"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        wsReports.Cells(lastRowReports, \"A\").Value = empKey"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        wsReports.Cells(lastRowReports, \"B\").Value = Format(employees(empKey)(0), \"0.00\")"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        wsReports.Cells(lastRowReports, \"C\").Value = Format(employees(empKey)(1), \"0.00\")"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        lastRowReports = lastRowReports + 1"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    Next empKey"]
[]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"'    ' تنسيق إجمالي الساعات وأيام العمل"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"'    wsReports.Columns(\"B\").NumberFormat = \"0.00\" ' تنسيق إجمالي الساعات برقمين عشريين"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"'    wsReports.Columns(\"C\").NumberFormat = \"0.00\" ' تنسيق أيام العمل برقمين عشريين"]
[]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"  ' تقرير عن التأخيرات"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"lastRowReports = wsReports.Cells(wsReports.Rows.Count, \"A\").End(xlUp).Row + 3"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"wsReports.Cells(lastRowReports, \"A\").Value = \"تقرير عن التأخيرات\""]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"lastRowReports = lastRowReports + 1"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"wsReports.Cells(lastRowReports, \"A\").Value = \"اسم الموظف\""]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"wsReports.Cells(lastRowReports, \"B\").Value = \"التاريخ\""]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"wsReports.Cells(lastRowReports, \"C\").Value = \"خصم التأخير\""]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"lastRowReports = lastRowReports + 1"]
[]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"If foundRow > 0 Then"]
[]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"For i = 2 To lastRowAttendance"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    If wsAttendance.Cells(i, \"I\").Value <> \"لا يوجد خصم\" Then"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        wsReports.Cells(lastRowReports, \"A\").Value = wsAttendance.Cells(i, \"A\").Value ' اسم الموظف"]
[]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        ' التحقق من نوع البيانات"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        If IsDate(wsAttendance.Cells(i, \"C\").Value) Then"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"            ' استخراج التاريخ فقط وتنسيقه"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"            Dim dateValue As Date"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"            dateValue = wsAttendance.Cells(i, \"C\").Value"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"            wsReports.Cells(lastRowReports, \"B\").Value = Format(dateValue, \"dd/mm/yyyy\") ' التاريخ بتنسيق dd/mm/yyyy"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        Else"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"            ' تسجيل خطأ أو تجاهل السجل"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"            wsReports.Cells(lastRowReports, \"B\").Value = \"بيانات غير صالحة\" ' أو يمكنك ترك الخلية فارغة"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        End If"]
[]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        wsReports.Cells(lastRowReports, \"C\").Value = wsAttendance.Cells(i, \"I\").Value ' خصم التأخير"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        lastRowReports = lastRowReports + 1"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    End If"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"Next i"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"    MsgBox \"تم إنشاء التقارير بنجاح!\""]
[null,null,null,null,null,null,null,null,null,null,null,null,null," Else"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"            MsgBox \"لم يتم العثور على سجل دخول مطابق لهذا الموظف في هذا اليوم.\", vbExclamation"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"            Call DeleteConditionalData"]
[]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"        End If"]
[null,null,null,null,null,null,null,null,null,null,null,null,null,"End Sub"]