{
 "id": "farm-management",
 "file": "softwiro-farm-management.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,
   "record_tables": [
    {
     "header_row": 11,
     "first_record_row": 12,
     "sample_rows_filled": 8,
     "capacity_last_row": 19,
     "columns": [
      {
       "column": "A",
       "header": "العمليات",
       "kind": "input",
       "examples": [
        "حراثة",
        "زراعة",
        "ري"
       ]
      },
      {
       "column": "B",
       "header": "المواسم",
       "kind": "input",
       "examples": [
        "شتوي",
        "صيفي",
        "نيلي"
       ]
      },
      {
       "column": "C",
       "header": "الآلات",
       "kind": "input",
       "examples": [
        "جرار",
        "حصادة",
        "ماكينة رش"
       ]
      },
      {
       "column": "D",
       "header": "وظائف العمال",
       "kind": "input",
       "examples": [
        "عامل يومية",
        "مشرف",
        "سائق جرار"
       ]
      },
      {
       "column": "E",
       "header": "بنود الماشية الصغيرة",
       "kind": "input",
       "examples": [
        "بيع لبن",
        "بيع بيض",
        "بيع حيوان"
       ]
      }
     ]
    }
   ],
   "settings": [
    {
     "label": "تاريخ اليوم",
     "cell": "B4",
     "value": "2026-11-15"
    },
    {
     "label": "أول شهر في «التدفق النقدي»",
     "cell": "B5",
     "value": "2026-10-01"
    },
    {
     "label": "رصيد النقدية في أول هذا الشهر",
     "cell": "B6",
     "value": 80000
    },
    {
     "label": "عدد القراريط في الفدان",
     "cell": "B7",
     "value": 24
    }
   ]
  },
  {
   "name": "الأحواض",
   "formula_cells": 3400,
   "record_tables": [
    {
     "header_row": 5,
     "first_record_row": 6,
     "sample_rows_filled": 6,
     "capacity_last_row": 205,
     "columns": [
      {
       "column": "A",
       "header": "كود الحوض",
       "kind": "input",
       "examples": [
        "H01",
        "H02",
        "H03"
       ]
      },
      {
       "column": "B",
       "header": "اسم الحوض",
       "kind": "input",
       "examples": [
        "حوض القمح الشرقي",
        "حوض الذرة",
        "حوض الطماطم"
       ]
      },
      {
       "column": "C",
       "header": "فدان",
       "kind": "input",
       "examples": [
        4,
        3,
        2
       ]
      },
      {
       "column": "D",
       "header": "قيراط",
       "kind": "input",
       "examples": [
        12,
        0,
        6
       ]
      },
      {
       "column": "E",
       "header": "المحصول",
       "kind": "input",
       "examples": [
        "قمح",
        "ذرة",
        "طماطم"
       ]
      },
      {
       "column": "F",
       "header": "الموسم",
       "kind": "input",
       "examples": [
        "شتوي",
        "صيفي",
        "نيلي"
       ],
       "allowed_values": {
        "from_range": "'الإعدادات'!$B$12:$B$15"
       }
      },
      {
       "column": "G",
       "header": "تاريخ الزراعة",
       "kind": "input",
       "examples": [
        "2026-11-10",
        "2026-06-15",
        "2026-08-05"
       ]
      },
      {
       "column": "H",
       "header": "المساحة (فدان)",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",ROUND(N(C6)+N(D6)/'الإعدادات'!$B$7,4))"
      },
      {
       "column": "I",
       "header": "مدخلات",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",SUMIFS('سجل العمليات'!$J$6:$J$2005,'سجل العمليات'!$B$6:$B$2005,A6&\"\"))"
      },
      {
       "column": "J",
       "header": "عمالة خارجية",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",SUMIFS('سجل العمليات'!$F$6:$F$2005,'سجل العمليات'!$B$6:$B$2005,A6&\"\"))"
      },
      {
       "column": "K",
       "header": "أجور العمال",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",SUMIFS('الحضور'!$H$6:$H$3005,'الحضور'!$D$6:$D$3005,A6&\"\"))"
      },
      {
       "column": "L",
       "header": "آلات",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",SUMIFS('الآلات'!$H$6:$H$505,'الآلات'!$D$6:$D$505,A6&\"\"))"
      },
      {
       "column": "M",
       "header": "إجمالي التكلفة",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",ROUND(I6+J6+K6+L6,2))"
      },
      {
       "column": "N",
       "header": "المحصول (كجم)",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",SUMIFS('المحصول'!$C$6:$C$1005,'المحصول'!$B$6:$B$1005,A6&\"\"))"
      },
      {
       "column": "O",
       "header": "الإنتاج لكل فدان",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",IF(AND(H6>0,N6>0),ROUND(N6/H6,1),\"\"))"
      },
      {
       "column": "P",
       "header": "المباع (كجم)",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",SUMIFS('المبيعات'!$D$6:$D$1005,'المبيعات'!$B$6:$B$1005,A6&\"\"))"
      },
      {
       "column": "Q",
       "header": "غير مباع (كجم)",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",IF(N6>0,ROUND(N6-P6,2),\"\"))"
      },
      {
       "column": "R",
       "header": "إيراد المبيعات",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",SUMIFS('المبيعات'!$I$6:$I$1005,'المبيعات'!$B$6:$B$1005,A6&\"\"))"
      },
      {
       "column": "S",
       "header": "الربح",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",IF(R6>0,ROUND(R6-M6,2),\"\"))"
      },
      {
       "column": "T",
       "header": "تكلفة الفدان",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",IF(H6>0,ROUND(M6/H6,2),\"\"))"
      },
      {
       "column": "U",
       "header": "ربح الفدان",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",IF(AND(S6<>\"\",H6>0),ROUND(S6/H6,2),\"\"))"
      },
      {
       "column": "V",
       "header": "تكلفة الكيلو",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",IF(N6>0,ROUND(M6/N6,2),\"\"))"
      },
      {
       "column": "W",
       "header": "الحالة",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",IF(AND(M6=0,R6=0),\"لم تبدأ\",IF(R6=0,\"قيد الزراعة\",IF(S6>=0,\"رابح\",\"خاسر\"))))"
      },
      {
       "column": "X",
       "header": "عند المشترين",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",SUMIFS('المبيعات'!$J$6:$J$1005,'المبيعات'!$B$6:$B$1005,A6&\"\"))"
      }
     ]
    }
   ]
  },
  {
   "name": "المدخلات",
   "formula_cells": 240,
   "record_tables": [
    {
     "header_row": 5,
     "first_record_row": 6,
     "sample_rows_filled": 10,
     "capacity_last_row": 65,
     "columns": [
      {
       "column": "A",
       "header": "الصنف",
       "kind": "input",
       "examples": [
        "تقاوي قمح",
        "تقاوي برسيم",
        "تقاوي بصل"
       ]
      },
      {
       "column": "B",
       "header": "الوحدة",
       "kind": "input",
       "examples": [
        "كجم",
        "كجم",
        "كجم"
       ]
      },
      {
       "column": "C",
       "header": "سعر الوحدة",
       "kind": "input",
       "examples": [
        20,
        70,
        600
       ]
      },
      {
       "column": "D",
       "header": "التصنيف",
       "kind": "input",
       "examples": [
        "تقاوي",
        "تقاوي",
        "تقاوي"
       ],
       "allowed_values": [
        "تقاوي",
        "سماد",
        "مبيدات",
        "وقود",
        "أخرى"
       ]
      },
      {
       "column": "E",
       "header": "الكمية المشتراة",
       "kind": "input",
       "examples": [
        600,
        50,
        10
       ]
      },
      {
       "column": "F",
       "header": "المستخدم",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",SUMIFS('سجل العمليات'!$E$6:$E$2005,'سجل العمليات'!$D$6:$D$2005,A6&\"\"))"
      },
      {
       "column": "G",
       "header": "المتبقي",
       "kind": "formula",
       "formula_row_1": "=IF(OR(A6&\"\"=\"\",E6&\"\"=\"\"),\"\",ROUND(E6-F6,2))"
      },
      {
       "column": "H",
       "header": "قيمة المستخدم",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",ROUND(F6*N(C6),2))"
      },
      {
       "column": "I",
       "header": "تنبيه",
       "kind": "formula",
       "formula_row_1": "=IF(G6=\"\",\"\",IF(G6<0,\"المستخدم أكثر من المشترى\",\"\"))"
      }
     ]
    }
   ]
  },
  {
   "name": "سجل العمليات",
   "formula_cells": 10000,
   "record_tables": [
    {
     "header_row": 5,
     "first_record_row": 6,
     "sample_rows_filled": 23,
     "capacity_last_row": 2005,
     "columns": [
      {
       "column": "A",
       "header": "التاريخ",
       "kind": "input",
       "examples": [
        "2026-06-15",
        "2026-07-10",
        "2026-08-05"
       ]
      },
      {
       "column": "B",
       "header": "الحوض",
       "kind": "input",
       "examples": [
        "H02",
        "H02",
        "H03"
       ],
       "allowed_values": {
        "from_range": "'الأحواض'!$A$6:$A$205"
       }
      },
      {
       "column": "C",
       "header": "العملية",
       "kind": "input",
       "examples": [
        "زراعة",
        "تسميد",
        "زراعة"
       ],
       "allowed_values": {
        "from_range": "'الإعدادات'!$A$12:$A$19"
       }
      },
      {
       "column": "D",
       "header": "الصنف المستخدم",
       "kind": "input",
       "examples": [
        "تقاوي ذرة",
        "سماد يوريا",
        "شتلات طماطم"
       ],
       "allowed_values": {
        "from_range": "'المدخلات'!$A$6:$A$65"
       }
      },
      {
       "column": "E",
       "header": "الكمية",
       "kind": "input",
       "examples": [
        90,
        240,
        9000
       ]
      },
      {
       "column": "F",
       "header": "عمالة خارجية",
       "kind": "input",
       "examples": [
        1500,
        2500,
        1800
       ]
      },
      {
       "column": "G",
       "header": "ملاحظة",
       "kind": "input",
       "examples": [
        "عمال حصاد الذرة",
        "وقود المضخة",
        "جمع الطماطم"
       ]
      },
      {
       "column": "H",
       "header": "الوحدة",
       "kind": "formula",
       "formula_row_1": "=IF(D6&\"\"=\"\",\"\",IFERROR(INDEX('المدخلات'!$B$6:$B$65,MATCH(D6&\"\",'المدخلات'!$A$6:$A$65,0)),\"\"))"
      },
      {
       "column": "I",
       "header": "سعر الوحدة",
       "kind": "formula",
       "formula_row_1": "=IF(D6&\"\"=\"\",\"\",IFERROR(INDEX('المدخلات'!$C$6:$C$65,MATCH(D6&\"\",'المدخلات'!$A$6:$A$65,0)),\"\"))"
      },
      {
       "column": "J",
       "header": "تكلفة المدخل",
       "kind": "formula",
       "formula_row_1": "=IF(OR(E6&\"\"=\"\",I6=\"\"),\"\",ROUND(E6*I6,2))"
      },
      {
       "column": "K",
       "header": "إجمالي العملية",
       "kind": "formula",
       "formula_row_1": "=IF(AND(B6&\"\"=\"\",C6&\"\"=\"\"),\"\",ROUND(N(J6)+N(F6),2))"
      },
      {
       "column": "L",
       "header": "تنبيه",
       "kind": "formula",
       "formula_row_1": "=IF(AND(B6&\"\"=\"\",C6&\"\"=\"\"),\"\",IF(COUNTIF('الأحواض'!$A$6:$A$205,B6&\"\")=0,\"حوض غير موجود\",IF(AND(D6&\"\"<>\"\",I6=\"\"),\"صنف غير موجود في المدخلات\",IF(AND(E6&\"\"<>\"\",D6&\"\"=\"\"),\"اكتب الصنف\",\"\"))))"
      }
     ]
    }
   ]
  },
  {
   "name": "العمال",
   "formula_cells": 300,
   "record_tables": [
    {
     "header_row": 5,
     "first_record_row": 6,
     "sample_rows_filled": 5,
     "capacity_last_row": 65,
     "columns": [
      {
       "column": "A",
       "header": "الكود",
       "kind": "input",
       "examples": [
        "W01",
        "W02",
        "W03"
       ]
      },
      {
       "column": "B",
       "header": "الاسم",
       "kind": "input",
       "examples": [
        "محمد سيد",
        "أحمد علي",
        "مصطفى عبده"
       ]
      },
      {
       "column": "C",
       "header": "التليفون",
       "kind": "input",
       "examples": [
        "01001234567",
        "01112345678",
        "01223456789"
       ]
      },
      {
       "column": "D",
       "header": "الوظيفة",
       "kind": "input",
       "examples": [
        "عامل يومية",
        "عامل يومية",
        "سائق جرار"
       ],
       "allowed_values": {
        "from_range": "'الإعدادات'!$D$12:$D$19"
       }
      },
      {
       "column": "E",
       "header": "الأجر اليومي",
       "kind": "input",
       "examples": [
        250,
        250,
        350
       ]
      },
      {
       "column": "F",
       "header": "تاريخ البدء",
       "kind": "input",
       "examples": [
        "2025-03-01",
        "2025-06-01",
        "2024-09-01"
       ]
      },
      {
       "column": "G",
       "header": "أيام العمل",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",SUMIFS('الحضور'!$C$6:$C$3005,'الحضور'!$B$6:$B$3005,A6&\"\"))"
      },
      {
       "column": "H",
       "header": "الأجور المستحقة",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",SUMIFS('الحضور'!$H$6:$H$3005,'الحضور'!$B$6:$B$3005,A6&\"\"))"
      },
      {
       "column": "I",
       "header": "المدفوع",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",SUMIFS('الحضور'!$E$6:$E$3005,'الحضور'!$B$6:$B$3005,A6&\"\"))"
      },
      {
       "column": "J",
       "header": "المتبقي له",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",ROUND(H6-I6,2))"
      },
      {
       "column": "K",
       "header": "تنبيه",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",IF(COUNTIF($A$6:$A$65,A6&\"\")>1,\"كود مكرر\",IF(J6<0,\"مدفوع أكثر من المستحق\",\"\")))"
      }
     ]
    }
   ]
  },
  {
   "name": "الحضور",
   "formula_cells": 9000,
   "record_tables": [
    {
     "header_row": 5,
     "first_record_row": 6,
     "sample_rows_filled": 42,
     "capacity_last_row": 3005,
     "columns": [
      {
       "column": "A",
       "header": "التاريخ",
       "kind": "input",
       "examples": [
        "2026-10-05",
        "2026-10-05",
        "2026-10-05"
       ]
      },
      {
       "column": "B",
       "header": "كود العامل",
       "kind": "input",
       "examples": [
        "W01",
        "W02",
        "W05"
       ],
       "allowed_values": {
        "from_range": "'العمال'!$A$6:$A$65"
       }
      },
      {
       "column": "C",
       "header": "الأيام",
       "kind": "input",
       "examples": [
        1,
        1,
        0.5
       ]
      },
      {
       "column": "D",
       "header": "الحوض",
       "kind": "input",
       "examples": [
        "H03",
        "H03",
        "H02"
       ],
       "allowed_values": {
        "from_range": "'الأحواض'!$A$6:$A$205"
       }
      },
      {
       "column": "E",
       "header": "المدفوع نقدًا",
       "kind": "input",
       "examples": [
        1500,
        700,
        900
       ]
      },
      {
       "column": "F",
       "header": "ملاحظة",
       "kind": "input",
       "examples": [
        "جرار",
        "جرار",
        "دفعة أكتوبر"
       ]
      },
      {
       "column": "G",
       "header": "اسم العامل",
       "kind": "formula",
       "formula_row_1": "=IF(B6&\"\"=\"\",\"\",IFERROR(INDEX('العمال'!$B$6:$B$65,MATCH(B6&\"\",'العمال'!$A$6:$A$65,0)),\"\"))"
      },
      {
       "column": "H",
       "header": "الأجر",
       "kind": "formula",
       "formula_row_1": "=IF(OR(C6&\"\"=\"\",G6=\"\"),\"\",ROUND(C6*INDEX('العمال'!$E$6:$E$65,MATCH(B6&\"\",'العمال'!$A$6:$A$65,0)),2))"
      },
      {
       "column": "I",
       "header": "تنبيه",
       "kind": "formula",
       "formula_row_1": "=IF(B6&\"\"=\"\",\"\",IF(G6=\"\",\"عامل غير موجود\",IF(AND(D6&\"\"<>\"\",COUNTIF('الأحواض'!$A$6:$A$205,D6&\"\")=0),\"حوض غير موجود\",\"\")))"
      }
     ]
    }
   ]
  },
  {
   "name": "الآلات",
   "formula_cells": 1000,
   "record_tables": [
    {
     "header_row": 5,
     "first_record_row": 6,
     "sample_rows_filled": 10,
     "capacity_last_row": 505,
     "columns": [
      {
       "column": "A",
       "header": "التاريخ",
       "kind": "input",
       "examples": [
        "2026-06-12",
        "2026-08-01",
        "2026-10-01"
       ]
      },
      {
       "column": "B",
       "header": "الآلة",
       "kind": "input",
       "examples": [
        "جرار",
        "جرار",
        "جرار"
       ],
       "allowed_values": {
        "from_range": "'الإعدادات'!$C$12:$C$19"
       }
      },
      {
       "column": "C",
       "header": "ملك / إيجار",
       "kind": "input",
       "examples": [
        "ملك",
        "ملك",
        "ملك"
       ],
       "allowed_values": [
        "ملك",
        "إيجار"
       ]
      },
      {
       "column": "D",
       "header": "الحوض",
       "kind": "input",
       "examples": [
        "H02",
        "H03",
        "H05"
       ],
       "allowed_values": {
        "from_range": "'الأحواض'!$A$6:$A$205"
       }
      },
      {
       "column": "E",
       "header": "الساعات",
       "kind": "input",
       "examples": [
        6,
        5,
        4
       ]
      },
      {
       "column": "F",
       "header": "سعر الساعة",
       "kind": "input",
       "examples": [
        120,
        120,
        120
       ]
      },
      {
       "column": "G",
       "header": "ملاحظة",
       "kind": "input",
       "examples": [
        "حراثة قبل الزراعة",
        "حصاد الذرة",
        "حراثة بعد الحصاد"
       ]
      },
      {
       "column": "H",
       "header": "التكلفة",
       "kind": "formula",
       "formula_row_1": "=IF(OR(E6&\"\"=\"\",F6&\"\"=\"\"),\"\",ROUND(E6*F6,2))"
      },
      {
       "column": "I",
       "header": "تنبيه",
       "kind": "formula",
       "formula_row_1": "=IF(AND(B6&\"\"=\"\",D6&\"\"=\"\"),\"\",IF(COUNTIF('الأحواض'!$A$6:$A$205,D6&\"\")=0,\"حوض غير موجود\",\"\"))"
      }
     ]
    }
   ]
  },
  {
   "name": "المحصول",
   "formula_cells": 2000,
   "record_tables": [
    {
     "header_row": 5,
     "first_record_row": 6,
     "sample_rows_filled": 4,
     "capacity_last_row": 1005,
     "columns": [
      {
       "column": "A",
       "header": "التاريخ",
       "kind": "input",
       "examples": [
        "2026-10-02",
        "2026-10-18",
        "2026-10-22"
       ]
      },
      {
       "column": "B",
       "header": "الحوض",
       "kind": "input",
       "examples": [
        "H02",
        "H03",
        "H03"
       ],
       "allowed_values": {
        "from_range": "'الأحواض'!$A$6:$A$205"
       }
      },
      {
       "column": "C",
       "header": "الكمية (كجم)",
       "kind": "input",
       "examples": [
        10800,
        6500,
        7000
       ]
      },
      {
       "column": "D",
       "header": "ملاحظة",
       "kind": "input",
       "examples": [
        "ذرة",
        "جمعة 1",
        "جمعة 2"
       ]
      },
      {
       "column": "E",
       "header": "المحصول",
       "kind": "formula",
       "formula_row_1": "=IF(B6&\"\"=\"\",\"\",IFERROR(INDEX('الأحواض'!$E$6:$E$205,MATCH(B6&\"\",'الأحواض'!$A$6:$A$205,0)),\"\"))"
      },
      {
       "column": "F",
       "header": "تنبيه",
       "kind": "formula",
       "formula_row_1": "=IF(B6&\"\"=\"\",\"\",IF(COUNTIF('الأحواض'!$A$6:$A$205,B6&\"\")=0,\"حوض غير موجود\",\"\"))"
      }
     ]
    }
   ]
  },
  {
   "name": "المبيعات",
   "formula_cells": 5000,
   "record_tables": [
    {
     "header_row": 5,
     "first_record_row": 6,
     "sample_rows_filled": 5,
     "capacity_last_row": 1005,
     "columns": [
      {
       "column": "A",
       "header": "التاريخ",
       "kind": "input",
       "examples": [
        "2026-10-03",
        "2026-10-19",
        "2026-10-20"
       ]
      },
      {
       "column": "B",
       "header": "الحوض",
       "kind": "input",
       "examples": [
        "H02",
        "H03",
        "H02"
       ],
       "allowed_values": {
        "from_range": "'الأحواض'!$A$6:$A$205"
       }
      },
      {
       "column": "C",
       "header": "المشتري",
       "kind": "input",
       "examples": [
        "مصنع أعلاف الدلتا",
        "سوق الجملة",
        "شونة الحبوب"
       ]
      },
      {
       "column": "D",
       "header": "الكمية (كجم)",
       "kind": "input",
       "examples": [
        6000,
        6400,
        4800
       ]
      },
      {
       "column": "E",
       "header": "سعر الكيلو",
       "kind": "input",
       "examples": [
        7,
        5.5,
        7.2
       ]
      },
      {
       "column": "F",
       "header": "المدفوع",
       "kind": "input",
       "examples": [
        42000,
        35200,
        20000
       ]
      },
      {
       "column": "G",
       "header": "تاريخ التحصيل",
       "kind": "input",
       "examples": [
        "2026-10-03",
        "2026-10-19",
        "2026-10-20"
       ]
      },
      {
       "column": "H",
       "header": "المحصول",
       "kind": "formula",
       "formula_row_1": "=IF(B6&\"\"=\"\",\"\",IFERROR(INDEX('الأحواض'!$E$6:$E$205,MATCH(B6&\"\",'الأحواض'!$A$6:$A$205,0)),\"\"))"
      },
      {
       "column": "I",
       "header": "المبلغ",
       "kind": "formula",
       "formula_row_1": "=IF(OR(D6&\"\"=\"\",E6&\"\"=\"\"),\"\",ROUND(D6*E6,2))"
      },
      {
       "column": "J",
       "header": "المتبقي",
       "kind": "formula",
       "formula_row_1": "=IF(I6=\"\",\"\",ROUND(I6-N(F6),2))"
      },
      {
       "column": "K",
       "header": "تاريخ النقدية",
       "kind": "formula",
       "formula_row_1": "=IF(N(F6)>0,IF(ISNUMBER(G6),G6,A6),\"\")"
      },
      {
       "column": "L",
       "header": "تنبيه",
       "kind": "formula",
       "formula_row_1": "=IF(B6&\"\"=\"\",\"\",IF(COUNTIF('الأحواض'!$A$6:$A$205,B6&\"\")=0,\"حوض غير موجود\",IF(AND(I6<>\"\",N(F6)>I6),\"المدفوع أكبر من المبلغ\",\"\")))"
      }
     ]
    }
   ]
  },
  {
   "name": "الماشية الصغيرة",
   "formula_cells": 1000,
   "record_tables": [
    {
     "header_row": 5,
     "first_record_row": 6,
     "sample_rows_filled": 6,
     "capacity_last_row": 505,
     "columns": [
      {
       "column": "A",
       "header": "التاريخ",
       "kind": "input",
       "examples": [
        "2026-10-10",
        "2026-10-12",
        "2026-10-31"
       ]
      },
      {
       "column": "B",
       "header": "النوع",
       "kind": "input",
       "examples": [
        "إيراد",
        "مصروف",
        "إيراد"
       ],
       "allowed_values": [
        "إيراد",
        "مصروف"
       ]
      },
      {
       "column": "C",
       "header": "البند",
       "kind": "input",
       "examples": [
        "بيع بيض",
        "علف",
        "بيع لبن"
       ],
       "allowed_values": {
        "from_range": "'الإعدادات'!$E$12:$E$19"
       }
      },
      {
       "column": "D",
       "header": "المبلغ",
       "kind": "input",
       "examples": [
        1500,
        2400,
        3200
       ]
      },
      {
       "column": "E",
       "header": "ملاحظة",
       "kind": "input",
       "examples": [
        "خروف"
       ]
      },
      {
       "column": "F",
       "header": "الصافي",
       "kind": "formula",
       "formula_row_1": "=IF(D6&\"\"=\"\",\"\",IF(B6=\"إيراد\",D6,IF(B6=\"مصروف\",-D6,\"\")))"
      },
      {
       "column": "G",
       "header": "تنبيه",
       "kind": "formula",
       "formula_row_1": "=IF(D6&\"\"=\"\",\"\",IF(AND(B6<>\"إيراد\",B6<>\"مصروف\"),\"اختر إيراد أو مصروف\",\"\"))"
      }
     ]
    }
   ]
  },
  {
   "name": "التدفق النقدي",
   "formula_cells": 179,
   "record_tables": [
    {
     "header_row": 5,
     "first_record_row": 6,
     "sample_rows_filled": 0,
     "capacity_last_row": 18,
     "columns": [
      {
       "column": "A",
       "header": "بداية الشهر",
       "kind": "formula",
       "formula_row_1": "='الإعدادات'!$B$5"
      },
      {
       "column": "B",
       "header": "الشهر",
       "kind": "formula",
       "formula_row_1": "=CHOOSE(MONTH(A6),\"يناير\",\"فبراير\",\"مارس\",\"أبريل\",\"مايو\",\"يونيو\",\"يوليو\",\"أغسطس\",\"سبتمبر\",\"أكتوبر\",\"نوفمبر\",\"ديسمبر\")&\" \"&YEAR(A6)"
      },
      {
       "column": "C",
       "header": "بداية التالي",
       "kind": "formula",
       "formula_row_1": "=DATE(YEAR(A6),MONTH(A6)+1,1)"
      },
      {
       "column": "D",
       "header": "مقبوض من المبيعات",
       "kind": "formula",
       "formula_row_1": "=IF($A6>'الإعدادات'!$B$4,\"\",SUMIFS('المبيعات'!$F$6:$F$1005,'المبيعات'!$K$6:$K$1005,\">=\"&$A6,'المبيعات'!$K$6:$K$1005,\"<\"&$C6))"
      },
      {
       "column": "E",
       "header": "إيراد الماشية",
       "kind": "formula",
       "formula_row_1": "=IF($A6>'الإعدادات'!$B$4,\"\",SUMIFS('الماشية الصغيرة'!$D$6:$D$505,'الماشية الصغيرة'!$A$6:$A$505,\">=\"&$A6,'الماشية الصغيرة'!$A$6:$A$505,\"<\"&$C6,'الماشية الصغيرة'!$B$6:$B$505,\"إيراد\"))"
      },
      {
       "column": "F",
       "header": "إجمالي الداخل",
       "kind": "formula",
       "formula_row_1": "=IF($A6>'الإعدادات'!$B$4,\"\",ROUND(D6+E6,2))"
      },
      {
       "column": "G",
       "header": "مدخلات",
       "kind": "formula",
       "formula_row_1": "=IF($A6>'الإعدادات'!$B$4,\"\",SUMIFS('سجل العمليات'!$J$6:$J$2005,'سجل العمليات'!$A$6:$A$2005,\">=\"&$A6,'سجل العمليات'!$A$6:$A$2005,\"<\"&$C6))"
      },
      {
       "column": "H",
       "header": "عمالة خارجية",
       "kind": "formula",
       "formula_row_1": "=IF($A6>'الإعدادات'!$B$4,\"\",SUMIFS('سجل العمليات'!$F$6:$F$2005,'سجل العمليات'!$A$6:$A$2005,\">=\"&$A6,'سجل العمليات'!$A$6:$A$2005,\"<\"&$C6))"
      },
      {
       "column": "I",
       "header": "أجور مدفوعة",
       "kind": "formula",
       "formula_row_1": "=IF($A6>'الإعدادات'!$B$4,\"\",SUMIFS('الحضور'!$E$6:$E$3005,'الحضور'!$A$6:$A$3005,\">=\"&$A6,'الحضور'!$A$6:$A$3005,\"<\"&$C6))"
      },
      {
       "column": "J",
       "header": "إيجار آلات",
       "kind": "formula",
       "formula_row_1": "=IF($A6>'الإعدادات'!$B$4,\"\",SUMIFS('الآلات'!$H$6:$H$505,'الآلات'!$A$6:$A$505,\">=\"&$A6,'الآلات'!$A$6:$A$505,\"<\"&$C6,'الآلات'!$C$6:$C$505,\"إيجار\"))"
      },
      {
       "column": "K",
       "header": "مصروف الماشية",
       "kind": "formula",
       "formula_row_1": "=IF($A6>'الإعدادات'!$B$4,\"\",SUMIFS('الماشية الصغيرة'!$D$6:$D$505,'الماشية الصغيرة'!$A$6:$A$505,\">=\"&$A6,'الماشية الصغيرة'!$A$6:$A$505,\"<\"&$C6,'الماشية الصغيرة'!$B$6:$B$505,\"مصروف\"))"
      },
      {
       "column": "L",
       "header": "إجمالي الخارج",
       "kind": "formula",
       "formula_row_1": "=IF($A6>'الإعدادات'!$B$4,\"\",ROUND(G6+H6+I6+J6+K6,2))"
      },
      {
       "column": "M",
       "header": "الصافي",
       "kind": "formula",
       "formula_row_1": "=IF($A6>'الإعدادات'!$B$4,\"\",ROUND(F6-L6,2))"
      },
      {
       "column": "N",
       "header": "رصيد النقدية آخر الشهر",
       "kind": "formula",
       "formula_row_1": "=IF($A6>'الإعدادات'!$B$4,\"\",ROUND('الإعدادات'!$B$6+SUM(M$6:M6),2))"
      }
     ]
    }
   ]
  },
  {
   "name": "الملخص",
   "formula_cells": 27,
   "results": [
    {
     "label": "عدد الأحواض",
     "cell": "B5",
     "formula": "=COUNTIF('الأحواض'!$A$6:$A$205,\"?*\")"
    },
    {
     "label": "إجمالي المساحة (فدان)",
     "cell": "B6",
     "formula": "=SUM('الأحواض'!$H$6:$H$205)"
    },
    {
     "label": "أحواض رابحة",
     "cell": "B7",
     "formula": "=COUNTIF('الأحواض'!$W$6:$W$205,\"رابح\")"
    },
    {
     "label": "أحواض خاسرة",
     "cell": "B8",
     "formula": "=COUNTIF('الأحواض'!$W$6:$W$205,\"خاسر\")"
    },
    {
     "label": "أحواض قيد الزراعة",
     "cell": "B9",
     "formula": "=COUNTIF('الأحواض'!$W$6:$W$205,\"قيد الزراعة\")"
    },
    {
     "label": "أحواض لم تبدأ",
     "cell": "B10",
     "formula": "=COUNTIF('الأحواض'!$W$6:$W$205,\"لم تبدأ\")"
    },
    {
     "label": "مدخلات",
     "cell": "B13",
     "formula": "=SUM('الأحواض'!$I$6:$I$205)"
    },
    {
     "label": "عمالة خارجية",
     "cell": "B14",
     "formula": "=SUM('الأحواض'!$J$6:$J$205)"
    },
    {
     "label": "أجور العمال",
     "cell": "B15",
     "formula": "=SUM('الأحواض'!$K$6:$K$205)"
    },
    {
     "label": "آلات",
     "cell": "B16",
     "formula": "=SUM('الأحواض'!$L$6:$L$205)"
    },
    {
     "label": "إجمالي تكلفة الأحواض",
     "cell": "B17",
     "formula": "=SUM('الأحواض'!$M$6:$M$205)"
    },
    {
     "label": "أجور بلا حوض (غير موزعة)",
     "cell": "B18",
     "formula": "=ROUND(SUM('الحضور'!$H$6:$H$3005)-B15,2)"
    },
    {
     "label": "إيراد المحاصيل",
     "cell": "B21",
     "formula": "=SUM('المبيعات'!$I$6:$I$1005)"
    },
    {
     "label": "ربح المحاصيل (الإيراد − تكلفة الأحواض)",
     "cell": "B22",
     "formula": "=ROUND(B21-B17,2)"
    },
    {
     "label": "صافي الماشية الصغيرة",
     "cell": "B23",
     "formula": "=SUM('الماشية الصغيرة'!$F$6:$F$505)"
    },
    {
     "label": "ربح المزرعة الكلي",
     "cell": "B24",
     "formula": "=ROUND(B22-B18+B23,2)"
    },
    {
     "label": "ربح المزرعة لكل فدان",
     "cell": "B25",
     "formula": "=IF(B6=0,\"\",ROUND(B24/B6,2))"
    },
    {
     "label": "المحصول المجموع (كجم)",
     "cell": "B28",
     "formula": "=SUM('الأحواض'!$N$6:$N$205)"
    },
    {
     "label": "المباع (كجم)",
     "cell": "B29",
     "formula": "=SUM('الأحواض'!$P$6:$P$205)"
    },
    {
     "label": "غير المباع (كجم)",
     "cell": "B30",
     "formula": "=B28-B29"
    },
    {
     "label": "مستحق عند المشترين",
     "cell": "B31",
     "formula": "=SUM('المبيعات'!$J$6:$J$1005)"
    },
    {
     "label": "مستحق للعمال",
     "cell": "B32",
     "formula": "=SUMIFS('العمال'!$J$6:$J$65,'العمال'!$J$6:$J$65,\">0\")"
    },
    {
     "label": "رصيد النقدية بعد آخر شهر",
     "cell": "B33",
     "formula": "='التدفق النقدي'!N18"
    },
    {
     "label": "عمليات بتنبيه",
     "cell": "B36",
     "formula": "=COUNTIF('سجل العمليات'!$L$6:$L$2005,\"?*\")"
    },
    {
     "label": "حضور بتنبيه",
     "cell": "B37",
     "formula": "=COUNTIF('الحضور'!$I$6:$I$3005,\"?*\")"
    },
    {
     "label": "مبيعات بتنبيه",
     "cell": "B38",
     "formula": "=COUNTIF('المبيعات'!$L$6:$L$1005,\"?*\")"
    },
    {
     "label": "أصناف مستخدمة أكثر من المشتراة",
     "cell": "B39",
     "formula": "=COUNTIF('المدخلات'!$I$6:$I$65,\"?*\")"
    }
   ]
  },
  {
   "name": "لماذا ما زلت على إكسل؟",
   "formula_cells": 0
  }
 ]
}