{
 "id": "hoa-service-contracts",
 "file": "softwiro-hoa-service-contracts.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": 0,
   "settings": [
    {
     "label": "تاريخ اليوم",
     "cell": "B4",
     "value": "2026-11-01"
    },
    {
     "label": "تنبيه انتهاء العقد قبل (يوم)",
     "cell": "B5",
     "value": 60
    }
   ]
  },
  {
   "name": "العقود",
   "formula_cells": 1600,
   "record_tables": [
    {
     "header_row": 5,
     "first_record_row": 6,
     "sample_rows_filled": 7,
     "capacity_last_row": 205,
     "columns": [
      {
       "column": "A",
       "header": "المورد / الشركة",
       "kind": "input",
       "examples": [
        "شركة النظافة المثالية",
        "شركة حراسة (مثال)",
        "شركة مصاعد (مثال)"
       ]
      },
      {
       "column": "B",
       "header": "الخدمة",
       "kind": "input",
       "examples": [
        "نظافة",
        "حراسة",
        "صيانة مصعد"
       ],
       "allowed_values": [
        "نظافة",
        "حراسة",
        "صيانة مصعد",
        "حدائق",
        "مكافحة حشرات",
        "إنترنت",
        "أخرى"
       ]
      },
      {
       "column": "C",
       "header": "الجوال",
       "kind": "input",
       "examples": [
        "01010000011",
        "01010000012",
        "01010000013"
       ]
      },
      {
       "column": "D",
       "header": "القيمة الشهرية",
       "kind": "input",
       "examples": [
        4000,
        9000,
        3500
       ]
      },
      {
       "column": "E",
       "header": "بداية العقد",
       "kind": "input",
       "examples": [
        "2026-01-01",
        "2025-07-01",
        "2026-03-01"
       ]
      },
      {
       "column": "F",
       "header": "نهاية العقد",
       "kind": "input",
       "examples": [
        "2026-12-31",
        "2026-06-30",
        "2027-02-28"
       ]
      },
      {
       "column": "G",
       "header": "شروط التجديد / ملاحظات",
       "kind": "input",
       "examples": [
        "تجديد بإخطار قبل 30 يومًا، يُطلب عرض سعر بديل",
        "انتهى العقد وقيد التجديد",
        "تجديد تلقائي سنوي"
       ]
      },
      {
       "column": "H",
       "header": "الأشهر المستحقة",
       "kind": "formula",
       "formula_row_1": "=IF(OR(A6&\"\"=\"\",NOT(ISNUMBER(E6)),NOT(ISNUMBER(D6))),\"\",MAX(0,(YEAR(IF(ISNUMBER(F6),MIN('الإعدادات'!$B$4,F6),'الإعدادات'!$B$4))-YEAR(E6))*12+MONTH(IF(ISNUMBER(F6),MIN('الإعدادات'!$B$4,F6),'الإعدادات'!$B$4))-MONTH(E6)+IF(DAY(IF(ISNUMBER(F6),MIN('الإعدادات'!$B$4,F6),'الإعدادات'!$B$4))>=DAY(E6),1,0)))"
      },
      {
       "column": "I",
       "header": "إجمالي المستحق",
       "kind": "formula",
       "formula_row_1": "=IF(H6=\"\",\"\",ROUND(H6*D6,2))"
      },
      {
       "column": "J",
       "header": "المدفوع",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",SUMIFS('الدفعات'!$C$6:$C$1005,'الدفعات'!$B$6:$B$1005,A6&\"\"))"
      },
      {
       "column": "K",
       "header": "المتبقي",
       "kind": "formula",
       "formula_row_1": "=IF(I6=\"\",\"\",ROUND(I6-J6,2))"
      },
      {
       "column": "L",
       "header": "أيام حتى النهاية",
       "kind": "formula",
       "formula_row_1": "=IF(OR(A6&\"\"=\"\",NOT(ISNUMBER(F6))),\"\",F6-'الإعدادات'!$B$4)"
      },
      {
       "column": "M",
       "header": "حالة العقد",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",IF(OR(NOT(ISNUMBER(E6)),NOT(ISNUMBER(F6))),\"بيانات ناقصة\",IF(F6<'الإعدادات'!$B$4,\"منتهي\",IF(E6>'الإعدادات'!$B$4,\"لم يبدأ\",IF(F6-'الإعدادات'!$B$4<='الإعدادات'!$B$5,\"ينتهي قريبًا\",\"ساري\")))))"
      },
      {
       "column": "N",
       "header": "القيمة السنوية",
       "kind": "formula",
       "formula_row_1": "=IF(N(D6)=0,\"\",ROUND(D6*12,2))"
      },
      {
       "column": "O",
       "header": "ترتيب التجديد",
       "kind": "formula",
       "formula_row_1": "=IF(OR(M6=\"منتهي\",M6=\"ينتهي قريبًا\"),COUNTIFS($M$6:$M$205,\"منتهي\",$L$6:$L$205,\"<\"&L6)+COUNTIFS($M$6:$M$205,\"ينتهي قريبًا\",$L$6:$L$205,\"<\"&L6)+COUNTIFS($M$6:M6,\"منتهي\",$L$6:L6,L6)+COUNTIFS($M$6:M6,\"ينتهي قريبًا\",$L$6:L6,L6),\"\")"
      }
     ]
    }
   ]
  },
  {
   "name": "الدفعات",
   "formula_cells": 2000,
   "record_tables": [
    {
     "header_row": 5,
     "first_record_row": 6,
     "sample_rows_filled": 55,
     "capacity_last_row": 1005,
     "columns": [
      {
       "column": "A",
       "header": "التاريخ",
       "kind": "input",
       "examples": [
        "2025-07-01",
        "2025-08-01",
        "2025-09-01"
       ]
      },
      {
       "column": "B",
       "header": "المورد",
       "kind": "input",
       "examples": [
        "شركة حراسة (مثال)",
        "شركة حراسة (مثال)",
        "شركة حراسة (مثال)"
       ],
       "allowed_values": {
        "from_range": "'العقود'!$A$6:$A$205"
       }
      },
      {
       "column": "C",
       "header": "المبلغ",
       "kind": "input",
       "examples": [
        9000,
        9000,
        9000
       ]
      },
      {
       "column": "D",
       "header": "طريقة الدفع",
       "kind": "input",
       "examples": [
        "تحويل بنكي",
        "نقدًا",
        "نقدًا"
       ],
       "allowed_values": [
        "نقدًا",
        "تحويل بنكي",
        "شيك"
       ]
      },
      {
       "column": "E",
       "header": "ملاحظة",
       "kind": "input"
      },
      {
       "column": "F",
       "header": "الخدمة",
       "kind": "formula",
       "formula_row_1": "=IF(B6&\"\"=\"\",\"\",IFERROR(INDEX('العقود'!$B$6:$B$205,MATCH(B6&\"\",'العقود'!$A$6:$A$205,0))&\"\",\"\"))"
      },
      {
       "column": "G",
       "header": "تنبيه",
       "kind": "formula",
       "formula_row_1": "=IF(B6&\"\"=\"\",\"\",IF(COUNTIF('العقود'!$A$6:$A$205,B6&\"\")=0,\"مورد غير موجود\",\"\"))"
      }
     ]
    }
   ]
  },
  {
   "name": "للتجديد",
   "formula_cells": 501,
   "record_tables": [
    {
     "header_row": 6,
     "first_record_row": 7,
     "sample_rows_filled": 0,
     "capacity_last_row": 56,
     "columns": [
      {
       "column": "A",
       "header": "م",
       "kind": "formula",
       "formula_row_1": "=IF(1<=$B$4,1,\"\")"
      },
      {
       "column": "B",
       "header": "المورد",
       "kind": "formula",
       "formula_row_1": "=IF($A7=\"\",\"\",INDEX('العقود'!$A$6:$A$205,MATCH($A7,'العقود'!$O$6:$O$205,0))&\"\")"
      },
      {
       "column": "C",
       "header": "الخدمة",
       "kind": "formula",
       "formula_row_1": "=IF($A7=\"\",\"\",INDEX('العقود'!$B$6:$B$205,MATCH($A7,'العقود'!$O$6:$O$205,0))&\"\")"
      },
      {
       "column": "D",
       "header": "الجوال",
       "kind": "formula",
       "formula_row_1": "=IF($A7=\"\",\"\",INDEX('العقود'!$C$6:$C$205,MATCH($A7,'العقود'!$O$6:$O$205,0))&\"\")"
      },
      {
       "column": "E",
       "header": "القيمة الشهرية",
       "kind": "formula",
       "formula_row_1": "=IF($A7=\"\",\"\",INDEX('العقود'!$D$6:$D$205,MATCH($A7,'العقود'!$O$6:$O$205,0)))"
      },
      {
       "column": "F",
       "header": "نهاية العقد",
       "kind": "formula",
       "formula_row_1": "=IF($A7=\"\",\"\",INDEX('العقود'!$F$6:$F$205,MATCH($A7,'العقود'!$O$6:$O$205,0)))"
      },
      {
       "column": "G",
       "header": "الأيام المتبقية",
       "kind": "formula",
       "formula_row_1": "=IF($A7=\"\",\"\",INDEX('العقود'!$L$6:$L$205,MATCH($A7,'العقود'!$O$6:$O$205,0)))"
      },
      {
       "column": "H",
       "header": "الحالة",
       "kind": "formula",
       "formula_row_1": "=IF($A7=\"\",\"\",INDEX('العقود'!$M$6:$M$205,MATCH($A7,'العقود'!$O$6:$O$205,0))&\"\")"
      },
      {
       "column": "I",
       "header": "المتبقي له",
       "kind": "formula",
       "formula_row_1": "=IF($A7=\"\",\"\",INDEX('العقود'!$K$6:$K$205,MATCH($A7,'العقود'!$O$6:$O$205,0)))"
      },
      {
       "column": "J",
       "header": "شروط التجديد / ملاحظات",
       "kind": "formula",
       "formula_row_1": "=IF($A7=\"\",\"\",INDEX('العقود'!$G$6:$G$205,MATCH($A7,'العقود'!$O$6:$O$205,0))&\"\")"
      }
     ]
    }
   ],
   "results": [
    {
     "label": "عقود تحتاج تجديدًا أو تفاوضًا",
     "cell": "B4",
     "formula": "=COUNTIF('العقود'!$O$6:$O$205,\">0\")"
    }
   ]
  },
  {
   "name": "الملخص",
   "formula_cells": 36,
   "record_tables": [
    {
     "header_row": 28,
     "first_record_row": 29,
     "sample_rows_filled": 7,
     "capacity_last_row": 35,
     "columns": [
      {
       "column": "A",
       "header": "الخدمة",
       "kind": "input",
       "examples": [
        "نظافة",
        "حراسة",
        "صيانة مصعد"
       ]
      },
      {
       "column": "B",
       "header": "عدد العقود",
       "kind": "formula",
       "formula_row_1": "=COUNTIF('العقود'!$B$6:$B$205,A29)"
      },
      {
       "column": "C",
       "header": "الالتزام الشهري",
       "kind": "formula",
       "formula_row_1": "=SUMIFS('العقود'!$D$6:$D$205,'العقود'!$B$6:$B$205,A29,'العقود'!$M$6:$M$205,\"ساري\")+SUMIFS('العقود'!$D$6:$D$205,'العقود'!$B$6:$B$205,A29,'العقود'!$M$6:$M$205,\"ينتهي قريبًا\")"
      },
      {
       "column": "D",
       "header": "المتبقي للمورد",
       "kind": "formula",
       "formula_row_1": "=SUMIFS('العقود'!$K$6:$K$205,'العقود'!$B$6:$B$205,A29,'العقود'!$K$6:$K$205,\">0\")"
      }
     ]
    }
   ],
   "results": [
    {
     "label": "عدد العقود",
     "cell": "B5",
     "formula": "=COUNTIF('العقود'!$A$6:$A$205,\"?*\")"
    },
    {
     "label": "سارية",
     "cell": "B6",
     "formula": "=COUNTIF('العقود'!$M$6:$M$205,\"ساري\")"
    },
    {
     "label": "تنتهي قريبًا",
     "cell": "B7",
     "formula": "=COUNTIF('العقود'!$M$6:$M$205,\"ينتهي قريبًا\")"
    },
    {
     "label": "منتهية",
     "cell": "B8",
     "formula": "=COUNTIF('العقود'!$M$6:$M$205,\"منتهي\")"
    },
    {
     "label": "لم تبدأ بعد",
     "cell": "B9",
     "formula": "=COUNTIF('العقود'!$M$6:$M$205,\"لم يبدأ\")"
    },
    {
     "label": "الالتزام الشهري (العقود السارية والقريبة من الانتهاء)",
     "cell": "B12",
     "formula": "=SUMIFS('العقود'!$D$6:$D$205,'العقود'!$M$6:$M$205,\"ساري\")+SUMIFS('العقود'!$D$6:$D$205,'العقود'!$M$6:$M$205,\"ينتهي قريبًا\")"
    },
    {
     "label": "الالتزام السنوي (× 12)",
     "cell": "B13",
     "formula": "=B12*12"
    },
    {
     "label": "التزام شهري لعقود لم تبدأ بعد",
     "cell": "B14",
     "formula": "=SUMIFS('العقود'!$D$6:$D$205,'العقود'!$M$6:$M$205,\"لم يبدأ\")"
    },
    {
     "label": "إجمالي المستحق حتى اليوم",
     "cell": "B17",
     "formula": "=SUM('العقود'!$I$6:$I$205)"
    },
    {
     "label": "إجمالي المدفوع",
     "cell": "B18",
     "formula": "=SUM('العقود'!$J$6:$J$205)"
    },
    {
     "label": "المتبقي للموردين",
     "cell": "B19",
     "formula": "=SUMIF('العقود'!$K$6:$K$205,\">0\")"
    },
    {
     "label": "دفعات زائدة عن المستحق",
     "cell": "B20",
     "formula": "=-SUMIF('العقود'!$K$6:$K$205,\"<0\")"
    },
    {
     "label": "موردون لهم متبقٍ",
     "cell": "B21",
     "formula": "=COUNTIF('العقود'!$K$6:$K$205,\">0\")"
    },
    {
     "label": "المدفوع في الشهر الحالي",
     "cell": "B22",
     "formula": "=SUMIFS('الدفعات'!$C$6:$C$1005,'الدفعات'!$A$6:$A$1005,\">=\"&DATE(YEAR('الإعدادات'!$B$4),MONTH('الإعدادات'!$B$4),1),'الدفعات'!$A$6:$A$1005,\"<=\"&'الإعدادات'!$B$4)"
    },
    {
     "label": "عقود تحتاج تجديدًا أو تفاوضًا",
     "cell": "B25",
     "formula": "=B7+B8"
    }
   ]
  },
  {
   "name": "لماذا ما زلت على إكسل؟",
   "formula_cells": 0
  }
 ]
}