{
 "id": "restaurant-table-reservations",
 "file": "softwiro-restaurant-table-reservations.xlsx",
 "title": "شيت حجز ترابيزات المطعم والكافيه",
 "language": "ar",
 "direction": "rtl",
 "how_it_works": "White cells are typed input; cells whose kind is \"formula\" are calculated and must not be overwritten. Add one record per row under the header row of a record table, keeping the columns in order.",
 "sheets": [
  {
   "name": "ابدأ هنا",
   "formula_cells": 0
  },
  {
   "name": "الإعدادات",
   "formula_cells": 2,
   "settings": [
    {
     "label": "اسم المكان",
     "cell": "B4",
     "value": "مطعم وكافيه الريف"
    },
    {
     "label": "تاريخ السهرة في «جدول السهرة»",
     "cell": "B5",
     "value": "2026-11-13"
    },
    {
     "label": "بداية أول فترة في الجدول",
     "cell": "B6",
     "value": "18:00:00"
    },
    {
     "label": "الشهر المطلوب ملخصه (أول يوم فيه)",
     "cell": "B7",
     "value": "2026-11-01"
    },
    {
     "label": "أقل عدد زيارات ليُعد العميل متكررًا",
     "cell": "B10",
     "value": 2
    }
   ],
   "results": [
    {
     "label": "آخر يوم في الشهر",
     "cell": "B8",
     "formula": "=IF(B7=\"\",\"\",EOMONTH(B7,0))"
    },
    {
     "label": "عدد أيام الشهر",
     "cell": "B9",
     "formula": "=IF(B7=\"\",\"\",B8-B7+1)"
    }
   ]
  },
  {
   "name": "الترابيزات",
   "formula_cells": 30,
   "record_tables": [
    {
     "header_row": 5,
     "first_record_row": 6,
     "sample_rows_filled": 12,
     "capacity_last_row": 35,
     "columns": [
      {
       "column": "A",
       "header": "رقم الترابيزة",
       "kind": "input",
       "examples": [
        "D1",
        "D2",
        "D3"
       ]
      },
      {
       "column": "B",
       "header": "المنطقة",
       "kind": "input",
       "examples": [
        "داخلي",
        "داخلي",
        "داخلي"
       ],
       "allowed_values": [
        "داخلي",
        "خارجي",
        "VIP"
       ]
      },
      {
       "column": "C",
       "header": "المقاعد",
       "kind": "input",
       "examples": [
        2,
        2,
        4
       ]
      },
      {
       "column": "D",
       "header": "الحد الأدنى للإنفاق",
       "kind": "input",
       "examples": [
        200,
        200,
        400
       ]
      },
      {
       "column": "E",
       "header": "حجوزات تاريخ السهرة",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",COUNTIFS('الحجوزات'!$E$6:$E$505,A6&\"\",'الحجوزات'!$A$6:$A$505,'الإعدادات'!$B$5,'الحجوزات'!$J$6:$J$505,\"<>ألغى\"))"
      }
     ]
    }
   ]
  },
  {
   "name": "الحجوزات",
   "formula_cells": 6000,
   "record_tables": [
    {
     "header_row": 5,
     "first_record_row": 6,
     "sample_rows_filled": 35,
     "capacity_last_row": 505,
     "columns": [
      {
       "column": "A",
       "header": "التاريخ",
       "kind": "input",
       "examples": [
        "2026-10-03",
        "2026-10-09",
        "2026-10-16"
       ]
      },
      {
       "column": "B",
       "header": "الوقت",
       "kind": "input",
       "examples": [
        "20:00:00",
        "21:00:00",
        "19:30:00"
       ]
      },
      {
       "column": "C",
       "header": "المدة (ساعات)",
       "kind": "input",
       "examples": [
        2,
        2,
        2
       ]
      },
      {
       "column": "D",
       "header": "الضيوف",
       "kind": "input",
       "examples": [
        4,
        2,
        6
       ]
      },
      {
       "column": "E",
       "header": "الترابيزة",
       "kind": "input",
       "examples": [
        "D3",
        "D1",
        "D5"
       ],
       "allowed_values": {
        "from_range": "'الترابيزات'!$A$6:$A$35"
       }
      },
      {
       "column": "F",
       "header": "العميل",
       "kind": "input",
       "examples": [
        "عمرو حسين",
        "منى فؤاد",
        "شركة النور"
       ]
      },
      {
       "column": "G",
       "header": "الهاتف",
       "kind": "input",
       "examples": [
        "0100 700 0001",
        "0111 700 0002",
        "0122 700 0003"
       ]
      },
      {
       "column": "H",
       "header": "المناسبة",
       "kind": "input",
       "examples": [
        "عشاء عائلي",
        "ذكرى زواج",
        "عشاء عمل"
       ],
       "allowed_values": [
        "بدون",
        "عشاء عائلي",
        "عيد ميلاد",
        "ذكرى زواج",
        "خطوبة",
        "عشاء عمل",
        "اجتماع",
        "تجمع أصدقاء"
       ]
      },
      {
       "column": "I",
       "header": "العربون",
       "kind": "input",
       "examples": [
        0,
        100,
        300
       ]
      },
      {
       "column": "J",
       "header": "الحالة",
       "kind": "input",
       "examples": [
        "حضر",
        "حضر",
        "حضر"
       ],
       "allowed_values": [
        "مؤكد",
        "حضر",
        "ألغى",
        "لم يحضر"
       ]
      },
      {
       "column": "K",
       "header": "ملاحظات",
       "kind": "input",
       "examples": [
        "ورد على الترابيزة",
        "تورتة من العميل",
        "لم يرد على الهاتف"
       ]
      },
      {
       "column": "L",
       "header": "ينتهي",
       "kind": "formula",
       "formula_row_1": "=IF(AND(ISNUMBER(B6),ISNUMBER(C6)),MOD(B6+C6/24,1),\"\")"
      },
      {
       "column": "M",
       "header": "المقاعد",
       "kind": "formula",
       "formula_row_1": "=IF(E6&\"\"=\"\",\"\",IFERROR(INDEX('الترابيزات'!$C$6:$C$35,MATCH($E6&\"\",'الترابيزات'!$A$6:$A$35,0)),\"\"))"
      },
      {
       "column": "N",
       "header": "المنطقة",
       "kind": "formula",
       "formula_row_1": "=IF(E6&\"\"=\"\",\"\",IFERROR(INDEX('الترابيزات'!$B$6:$B$35,MATCH($E6&\"\",'الترابيزات'!$A$6:$A$35,0)),\"\"))"
      },
      {
       "column": "O",
       "header": "الحد الأدنى",
       "kind": "formula",
       "formula_row_1": "=IF(E6&\"\"=\"\",\"\",IFERROR(INDEX('الترابيزات'!$D$6:$D$35,MATCH($E6&\"\",'الترابيزات'!$A$6:$A$35,0)),\"\"))"
      },
      {
       "column": "P",
       "header": "السعة",
       "kind": "formula",
       "formula_row_1": "=IF(AND(A6&\"\"=\"\",E6&\"\"=\"\",F6&\"\"=\"\"),\"\",IF(E6&\"\"=\"\",\"اختر الترابيزة\",IF(ISNA(MATCH(E6&\"\",'الترابيزات'!$A$6:$A$35,0)),\"ترابيزة غير مسجلة\",IF(AND(ISNUMBER(M6),N(D6)>M6),\"فوق السعة\",\"\"))))"
      },
      {
       "column": "Q",
       "header": "تعارض",
       "kind": "formula",
       "formula_row_1": "=IF(OR(R6=\"\",S6=\"\",E6&\"\"=\"\",J6=\"ألغى\",J6=\"لم يحضر\"),\"\",IF(COUNTIFS('الحجوزات'!$E$6:$E$505,E6&\"\",'الحجوزات'!$J$6:$J$505,\"<>ألغى\",'الحجوزات'!$J$6:$J$505,\"<>لم يحضر\",'الحجوزات'!$R$6:$R$505,\"<\"&S6,'الحجوزات'!$S$6:$S$505,\">\"&R6)>1,\"تعارض\",\"\"))"
      },
      {
       "column": "R",
       "header": "بداية (دقيقة)",
       "kind": "formula",
       "formula_row_1": "=IF(AND(ISNUMBER(A6),ISNUMBER(B6)),ROUND(A6*1440+B6*1440,0),\"\")"
      },
      {
       "column": "S",
       "header": "نهاية (دقيقة)",
       "kind": "formula",
       "formula_row_1": "=IF(AND(R6<>\"\",ISNUMBER(C6)),R6+ROUND(C6*60,0),\"\")"
      },
      {
       "column": "T",
       "header": "ضمن الشهر",
       "kind": "formula",
       "formula_row_1": "=IF(NOT(ISNUMBER(A6)),\"\",IF(AND(A6>='الإعدادات'!$B$7,A6<='الإعدادات'!$B$8),1,0))"
      },
      {
       "column": "U",
       "header": "مفتاح العميل",
       "kind": "formula",
       "formula_row_1": "=IF(OR(G6&\"\"=\"\",COUNTIF(G$6:G6,G6&\"\")>1),\"\",IF(COUNTIFS('الحجوزات'!$G$6:$G$505,G6&\"\",'الحجوزات'!$J$6:$J$505,\"حضر\")<'الإعدادات'!$B$10,\"\",COUNTIFS('الحجوزات'!$G$6:$G$505,G6&\"\",'الحجوزات'!$J$6:$J$505,\"حضر\")*1000000+SUMIFS('الحجوزات'!$V$6:$V$505,'الحجوزات'!$G$6:$G$505,G6&\"\")/COUNTIFS('الحجوزات'!$G$6:$G$505,G6&\"\",'الحجوزات'!$V$6:$V$505,\">0\")+ROW()/10000))"
      },
      {
       "column": "V",
       "header": "آخر زيارة",
       "kind": "formula",
       "formula_row_1": "=IF(AND(J6=\"حضر\",ISNUMBER(A6),G6&\"\"<>\"\"),IF(COUNTIFS('الحجوزات'!$G$6:$G$505,G6&\"\",'الحجوزات'!$J$6:$J$505,\"حضر\",'الحجوزات'!$A$6:$A$505,\">\"&A6)=0,A6,\"\"),\"\")"
      },
      {
       "column": "W",
       "header": "مفتاح الحجز",
       "kind": "formula",
       "formula_row_1": "=IF(AND(E6&\"\"<>\"\",R6<>\"\",J6<>\"ألغى\",J6<>\"لم يحضر\"),E6&\"|\"&R6,\"\")"
      }
     ]
    }
   ]
  },
  {
   "name": "جدول السهرة",
   "formula_cells": 499,
   "record_tables": [
    {
     "header_row": 5,
     "first_record_row": 6,
     "sample_rows_filled": 0,
     "capacity_last_row": 38,
     "columns": [
      {
       "column": "A",
       "header": "الترابيزة",
       "kind": "formula",
       "formula_row_1": "=IF('الترابيزات'!A6&\"\"=\"\",\"\",'الترابيزات'!A6)"
      },
      {
       "column": "B",
       "header": "المنطقة",
       "kind": "formula",
       "formula_row_1": "=IF($A6=\"\",\"\",'الترابيزات'!B6)"
      },
      {
       "column": "C",
       "header": "المقاعد",
       "kind": "formula",
       "formula_row_1": "=IF($A6=\"\",\"\",'الترابيزات'!C6)"
      }
     ]
    }
   ],
   "results": [
    {
     "label": "التاريخ",
     "cell": "B3",
     "formula": "='الإعدادات'!$B$5"
    }
   ]
  },
  {
   "name": "العملاء المتكررون",
   "formula_cells": 150,
   "record_tables": [
    {
     "header_row": 5,
     "first_record_row": 6,
     "sample_rows_filled": 30,
     "capacity_last_row": 35,
     "columns": [
      {
       "column": "A",
       "header": "الترتيب",
       "kind": "input",
       "examples": [
        1,
        2,
        3
       ]
      },
      {
       "column": "B",
       "header": "العميل",
       "kind": "formula",
       "formula_row_1": "=IFERROR(INDEX('الحجوزات'!$F$6:$F$505,MATCH(LARGE('الحجوزات'!$U$6:$U$505,1),'الحجوزات'!$U$6:$U$505,0)),\"\")"
      },
      {
       "column": "C",
       "header": "الهاتف",
       "kind": "formula",
       "formula_row_1": "=IFERROR(INDEX('الحجوزات'!$G$6:$G$505,MATCH(LARGE('الحجوزات'!$U$6:$U$505,1),'الحجوزات'!$U$6:$U$505,0)),\"\")"
      },
      {
       "column": "D",
       "header": "الزيارات",
       "kind": "formula",
       "formula_row_1": "=IFERROR(INT(LARGE('الحجوزات'!$U$6:$U$505,1)/1000000),\"\")"
      },
      {
       "column": "E",
       "header": "آخر زيارة",
       "kind": "formula",
       "formula_row_1": "=IFERROR(INT(LARGE('الحجوزات'!$U$6:$U$505,1))-D6*1000000,\"\")"
      },
      {
       "column": "F",
       "header": "مرات عدم الحضور",
       "kind": "formula",
       "formula_row_1": "=IF(C6=\"\",\"\",COUNTIFS('الحجوزات'!$G$6:$G$505,C6,'الحجوزات'!$J$6:$J$505,\"لم يحضر\"))"
      }
     ]
    }
   ]
  },
  {
   "name": "الملخص",
   "formula_cells": 184,
   "record_tables": [
    {
     "header_row": 34,
     "first_record_row": 35,
     "sample_rows_filled": 36,
     "capacity_last_row": 71,
     "columns": [
      {
       "column": "A",
       "header": "المنطقة",
       "kind": "input",
       "examples": [
        "داخلي",
        "خارجي",
        "VIP"
       ]
      },
      {
       "column": "B",
       "header": "الحجوزات",
       "kind": "formula",
       "formula_row_1": "=COUNTIFS('الحجوزات'!$T$6:$T$505,1,'الحجوزات'!$N$6:$N$505,$A35,'الحجوزات'!$J$6:$J$505,\"<>ألغى\")"
      },
      {
       "column": "C",
       "header": "الضيوف",
       "kind": "formula",
       "formula_row_1": "=SUMIFS('الحجوزات'!$D$6:$D$505,'الحجوزات'!$T$6:$T$505,1,'الحجوزات'!$N$6:$N$505,$A35,'الحجوزات'!$J$6:$J$505,\"<>ألغى\")"
      }
     ]
    }
   ],
   "settings": [
    {
     "label": "الحالة",
     "cell": "B27",
     "value": "عدد الحجوزات"
    }
   ],
   "results": [
    {
     "label": "المكان",
     "cell": "B3",
     "formula": "='الإعدادات'!B4"
    },
    {
     "label": "الشهر",
     "cell": "B4",
     "formula": "='الإعدادات'!$B$7"
    },
    {
     "label": "كل الحجوزات",
     "cell": "B6",
     "formula": "=COUNTIFS('الحجوزات'!$T$6:$T$505,1)"
    },
    {
     "label": "حجوزات «مؤكد»",
     "cell": "B7",
     "formula": "=COUNTIFS('الحجوزات'!$T$6:$T$505,1,'الحجوزات'!$J$6:$J$505,\"مؤكد\")"
    },
    {
     "label": "حجوزات «حضر»",
     "cell": "B8",
     "formula": "=COUNTIFS('الحجوزات'!$T$6:$T$505,1,'الحجوزات'!$J$6:$J$505,\"حضر\")"
    },
    {
     "label": "حجوزات «ألغى»",
     "cell": "B9",
     "formula": "=COUNTIFS('الحجوزات'!$T$6:$T$505,1,'الحجوزات'!$J$6:$J$505,\"ألغى\")"
    },
    {
     "label": "حجوزات «لم يحضر»",
     "cell": "B10",
     "formula": "=COUNTIFS('الحجوزات'!$T$6:$T$505,1,'الحجوزات'!$J$6:$J$505,\"لم يحضر\")"
    },
    {
     "label": "نسبة عدم الحضور (لم يحضر ÷ حضر + لم يحضر)",
     "cell": "B11",
     "formula": "=IF(B8+B10>0,B10/(B8+B10),\"\")"
    },
    {
     "label": "نسبة الإلغاء (ألغى ÷ كل الحجوزات)",
     "cell": "B12",
     "formula": "=IF(B6>0,B9/B6,\"\")"
    },
    {
     "label": "ضيوف حضروا فعلًا",
     "cell": "B13",
     "formula": "=SUMIFS('الحجوزات'!$D$6:$D$505,'الحجوزات'!$T$6:$T$505,1,'الحجوزات'!$J$6:$J$505,\"حضر\")"
    },
    {
     "label": "ضيوف حجوزاتهم «مؤكد» لم تُنفذ بعد",
     "cell": "B14",
     "formula": "=SUMIFS('الحجوزات'!$D$6:$D$505,'الحجوزات'!$T$6:$T$505,1,'الحجوزات'!$J$6:$J$505,\"مؤكد\")"
    },
    {
     "label": "متوسط الضيوف في الحجز (دون الملغي)",
     "cell": "B15",
     "formula": "=IFERROR(SUMIFS('الحجوزات'!$D$6:$D$505,'الحجوزات'!$T$6:$T$505,1,'الحجوزات'!$J$6:$J$505,\"<>ألغى\")/COUNTIFS('الحجوزات'!$T$6:$T$505,1,'الحجوزات'!$J$6:$J$505,\"<>ألغى\"),\"\")"
    },
    {
     "label": "عربون محتجز (كل الحجوزات «مؤكد»)",
     "cell": "B17",
     "formula": "=SUMIFS('الحجوزات'!$I$6:$I$505,'الحجوزات'!$J$6:$J$505,\"مؤكد\")"
    },
    {
     "label": "عربون من حضروا (يُخصم من فواتيرهم) في الشهر",
     "cell": "B18",
     "formula": "=SUMIFS('الحجوزات'!$I$6:$I$505,'الحجوزات'!$T$6:$T$505,1,'الحجوزات'!$J$6:$J$505,\"حضر\")"
    },
    {
     "label": "عربون من لم يحضروا في الشهر",
     "cell": "B19",
     "formula": "=SUMIFS('الحجوزات'!$I$6:$I$505,'الحجوزات'!$T$6:$T$505,1,'الحجوزات'!$J$6:$J$505,\"لم يحضر\")"
    },
    {
     "label": "عربون من ألغوا في الشهر",
     "cell": "B20",
     "formula": "=SUMIFS('الحجوزات'!$I$6:$I$505,'الحجوزات'!$T$6:$T$505,1,'الحجوزات'!$J$6:$J$505,\"ألغى\")"
    },
    {
     "label": "حجوزات بها تعارض (كل طرف يُحسب)",
     "cell": "B22",
     "formula": "=COUNTIFS('الحجوزات'!$Q$6:$Q$505,\"تعارض\",'الحجوزات'!$T$6:$T$505,1)"
    },
    {
     "label": "حجوزات فوق سعة الترابيزة",
     "cell": "B23",
     "formula": "=COUNTIFS('الحجوزات'!$P$6:$P$505,\"فوق السعة\",'الحجوزات'!$T$6:$T$505,1)"
    },
    {
     "label": "حجوزات بترابيزة غير مسجلة أو ناقصة",
     "cell": "B24",
     "formula": "=COUNTIF('الحجوزات'!$P$6:$P$505,\"ترابيزة غير مسجلة\")+COUNTIF('الحجوزات'!$P$6:$P$505,\"اختر الترابيزة\")"
    },
    {
     "label": "مؤكد",
     "cell": "B28",
     "formula": "=B7"
    },
    {
     "label": "حضر",
     "cell": "B29",
     "formula": "=B8"
    },
    {
     "label": "ألغى",
     "cell": "B30",
     "formula": "=B9"
    },
    {
     "label": "لم يحضر",
     "cell": "B31",
     "formula": "=B10"
    }
   ]
  },
  {
   "name": "لماذا ما زلت على إكسل؟",
   "formula_cells": 0
  }
 ]
}