{
 "id": "mechanical-job-orders",
 "file": "softwiro-mechanical-job-orders.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": 1,
   "settings": [
    {
     "label": "تاريخ اليوم",
     "cell": "B4",
     "value": "2026-11-26"
    },
    {
     "label": "سعر ساعة المكينة (ج.م)",
     "cell": "B5",
     "value": 250
    },
    {
     "label": "التكاليف غير المباشرة (% من الخامات والمكينة)",
     "cell": "B6",
     "value": 0.12
    },
    {
     "label": "مضاعف الحد الأدنى لكمية إعادة طلب الخامة",
     "cell": "B7",
     "value": 2
    }
   ],
   "results": [
    {
     "label": "عدد المراحل",
     "cell": "B8",
     "formula": "=COUNTIF('الإعدادات'!$D$5:$D$12,\"?*\")"
    }
   ]
  },
  {
   "name": "أوامر التشغيل",
   "formula_cells": 3000,
   "record_tables": [
    {
     "header_row": 5,
     "first_record_row": 6,
     "sample_rows_filled": 10,
     "capacity_last_row": 205,
     "columns": [
      {
       "column": "A",
       "header": "رقم الأمر",
       "kind": "input",
       "examples": [
        "JO-101",
        "JO-102",
        "JO-103"
       ]
      },
      {
       "column": "B",
       "header": "تاريخ الأمر",
       "kind": "input",
       "examples": [
        "2026-10-05",
        "2026-10-08",
        "2026-10-12"
       ]
      },
      {
       "column": "C",
       "header": "العميل",
       "kind": "input",
       "examples": [
        "شركة النيل للمقاولات",
        "مصنع الأمل للأغذية",
        "ورشة المهندس سامي"
       ]
      },
      {
       "column": "D",
       "header": "المنتج",
       "kind": "input",
       "examples": [
        "باب حديد 100×210",
        "خزان صلب 500 لتر",
        "ترس صلب 60 سنًّا"
       ],
       "allowed_values": {
        "from_range": "'الإعدادات'!$F$5:$F$12"
       }
      },
      {
       "column": "E",
       "header": "الكمية",
       "kind": "input",
       "examples": [
        10,
        2,
        40
       ]
      },
      {
       "column": "F",
       "header": "سعر الوحدة",
       "kind": "input",
       "examples": [
        4200,
        16000,
        850
       ]
      },
      {
       "column": "G",
       "header": "المقدم المدفوع",
       "kind": "input",
       "examples": [
        20000,
        10000,
        8000
       ]
      },
      {
       "column": "H",
       "header": "تسليم مطلوب",
       "kind": "input",
       "examples": [
        "2026-10-25",
        "2026-10-30",
        "2026-10-28"
       ]
      },
      {
       "column": "I",
       "header": "تسليم فعلي",
       "kind": "input",
       "examples": [
        "2026-10-24",
        "2026-11-03",
        "2026-10-28"
       ]
      },
      {
       "column": "J",
       "header": "الحالة",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",IF(ISNUMBER(I6),\"سُلّم\",IF(AND(N('الإعدادات'!$B$8)>0,K6>=N('الإعدادات'!$B$8)),\"جاهز للتسليم\",IF(OR(K6>0,COUNTIFS('المراحل'!$A$6:$A$605,A6&\"\",'المراحل'!$C$6:$C$605,\"جارية\")>0),\"قيد التشغيل\",\"لم يبدأ\"))))"
      },
      {
       "column": "K",
       "header": "مراحل منتهية",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",COUNTIFS('المراحل'!$A$6:$A$605,A6&\"\",'المراحل'!$C$6:$C$605,\"منتهية\"))"
      },
      {
       "column": "L",
       "header": "الإنجاز",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",IFERROR(K6/'الإعدادات'!$B$8,\"\"))"
      },
      {
       "column": "M",
       "header": "المرحلة الحالية",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",IF(J6=\"سُلّم\",\"—\",IF(AND(N('الإعدادات'!$B$8)>0,K6>=N('الإعدادات'!$B$8)),\"اكتمل التشغيل\",IFERROR(INDEX('الإعدادات'!$D$5:$D$12,K6+1)&\"\",\"\"))))"
      },
      {
       "column": "N",
       "header": "ساعات المكينة",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",SUMIFS('المراحل'!$F$6:$F$605,'المراحل'!$A$6:$A$605,A6&\"\"))"
      },
      {
       "column": "O",
       "header": "تكلفة الخامات",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",SUMIFS('الخامات المستخدمة'!$G$6:$G$605,'الخامات المستخدمة'!$A$6:$A$605,A6&\"\"))"
      },
      {
       "column": "P",
       "header": "تكلفة المكينة",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",ROUND(N6*N('الإعدادات'!$B$5),2))"
      },
      {
       "column": "Q",
       "header": "تكاليف غير مباشرة",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",ROUND((O6+P6)*N('الإعدادات'!$B$6),2))"
      },
      {
       "column": "R",
       "header": "إجمالي التكلفة",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",O6+P6+Q6)"
      },
      {
       "column": "S",
       "header": "قيمة الأمر",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",ROUND(N(E6)*N(F6),2))"
      },
      {
       "column": "T",
       "header": "الربح",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",S6-R6)"
      },
      {
       "column": "U",
       "header": "الهامش",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",IF(S6>0,T6/S6,\"\"))"
      },
      {
       "column": "V",
       "header": "المتبقي على العميل",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",S6-N(G6))"
      },
      {
       "column": "W",
       "header": "أيام التأخير",
       "kind": "formula",
       "formula_row_1": "=IF(OR(A6&\"\"=\"\",NOT(ISNUMBER(H6))),\"\",IF(ISNUMBER(I6),MAX(0,I6-H6),MAX(0,'الإعدادات'!$B$4-H6)))"
      },
      {
       "column": "X",
       "header": "التنبيه",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",IF(N(W6)=0,\"\",IF(ISNUMBER(I6),\"سُلّم متأخرًا\",\"متأخر\")))"
      }
     ]
    }
   ]
  },
  {
   "name": "المراحل",
   "formula_cells": 1800,
   "record_tables": [
    {
     "header_row": 5,
     "first_record_row": 6,
     "sample_rows_filled": 35,
     "capacity_last_row": 605,
     "columns": [
      {
       "column": "A",
       "header": "رقم الأمر",
       "kind": "input",
       "examples": [
        "JO-101",
        "JO-101",
        "JO-101"
       ]
      },
      {
       "column": "B",
       "header": "المرحلة",
       "kind": "input",
       "examples": [
        "قص",
        "تشغيل",
        "لحام"
       ],
       "allowed_values": {
        "from_range": "'الإعدادات'!$D$5:$D$12"
       }
      },
      {
       "column": "C",
       "header": "الحالة",
       "kind": "input",
       "examples": [
        "منتهية",
        "منتهية",
        "منتهية"
       ],
       "allowed_values": [
        "لم تبدأ",
        "جارية",
        "منتهية"
       ]
      },
      {
       "column": "D",
       "header": "انتهاء مخطط",
       "kind": "input",
       "examples": [
        "2026-10-08",
        "2026-10-13",
        "2026-10-18"
       ]
      },
      {
       "column": "E",
       "header": "انتهاء فعلي",
       "kind": "input",
       "examples": [
        "2026-10-08",
        "2026-10-14",
        "2026-10-18"
       ]
      },
      {
       "column": "F",
       "header": "ساعات المكينة",
       "kind": "input",
       "examples": [
        6,
        14,
        20
       ]
      },
      {
       "column": "G",
       "header": "المشغّل أو ملاحظة",
       "kind": "input",
       "examples": [
        "أحمد",
        "محمود",
        "سعيد"
       ]
      },
      {
       "column": "H",
       "header": "المنتج",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",IFERROR(INDEX('أوامر التشغيل'!$D$6:$D$205,MATCH(A6&\"\",'أوامر التشغيل'!$A$6:$A$205,0))&\"\",\"\"))"
      },
      {
       "column": "I",
       "header": "أيام التأخير",
       "kind": "formula",
       "formula_row_1": "=IF(OR(A6&\"\"=\"\",NOT(ISNUMBER(D6))),\"\",IF(C6=\"منتهية\",IF(ISNUMBER(E6),MAX(0,E6-D6),\"\"),MAX(0,'الإعدادات'!$B$4-D6)))"
      },
      {
       "column": "J",
       "header": "التنبيه",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",IF(COUNTIF('أوامر التشغيل'!$A$6:$A$205,A6&\"\")=0,\"أمر غير موجود\",IF(N(I6)>0,\"متأخرة\",\"\")))"
      }
     ]
    }
   ]
  },
  {
   "name": "الخامات المستخدمة",
   "formula_cells": 3000,
   "record_tables": [
    {
     "header_row": 5,
     "first_record_row": 6,
     "sample_rows_filled": 31,
     "capacity_last_row": 605,
     "columns": [
      {
       "column": "A",
       "header": "رقم الأمر",
       "kind": "input",
       "examples": [
        "JO-101",
        "JO-101",
        "JO-101"
       ]
      },
      {
       "column": "B",
       "header": "كود الخامة",
       "kind": "input",
       "examples": [
        "M01",
        "M02",
        "M06"
       ],
       "allowed_values": {
        "from_range": "'الخامات'!$A$6:$A$105"
       }
      },
      {
       "column": "C",
       "header": "الكمية",
       "kind": "input",
       "examples": [
        6,
        10,
        30
       ]
      },
      {
       "column": "D",
       "header": "اسم الخامة",
       "kind": "formula",
       "formula_row_1": "=IF(B6&\"\"=\"\",\"\",IFERROR(INDEX('الخامات'!$B$6:$B$105,MATCH(B6&\"\",'الخامات'!$A$6:$A$105,0))&\"\",\"كود غير موجود\"))"
      },
      {
       "column": "E",
       "header": "الوحدة",
       "kind": "formula",
       "formula_row_1": "=IF(B6&\"\"=\"\",\"\",IFERROR(INDEX('الخامات'!$C$6:$C$105,MATCH(B6&\"\",'الخامات'!$A$6:$A$105,0))&\"\",\"\"))"
      },
      {
       "column": "F",
       "header": "سعر الوحدة",
       "kind": "formula",
       "formula_row_1": "=IF(B6&\"\"=\"\",\"\",IFERROR(INDEX('الخامات'!$D$6:$D$105,MATCH(B6&\"\",'الخامات'!$A$6:$A$105,0)),0))"
      },
      {
       "column": "G",
       "header": "التكلفة",
       "kind": "formula",
       "formula_row_1": "=IF(B6&\"\"=\"\",\"\",ROUND(N(C6)*F6,2))"
      },
      {
       "column": "H",
       "header": "التنبيه",
       "kind": "formula",
       "formula_row_1": "=IF(A6&B6=\"\",\"\",IF(D6=\"كود غير موجود\",\"كود غير موجود\",IF(COUNTIF('أوامر التشغيل'!$A$6:$A$205,A6&\"\")=0,\"أمر غير موجود\",\"\")))"
      }
     ]
    }
   ]
  },
  {
   "name": "الخامات",
   "formula_cells": 500,
   "record_tables": [
    {
     "header_row": 5,
     "first_record_row": 6,
     "sample_rows_filled": 8,
     "capacity_last_row": 105,
     "columns": [
      {
       "column": "A",
       "header": "الكود",
       "kind": "input",
       "examples": [
        "M01",
        "M02",
        "M03"
       ]
      },
      {
       "column": "B",
       "header": "الخامة أو القطعة",
       "kind": "input",
       "examples": [
        "لوح صلب 3 مم",
        "ماسورة مربعة 40×40 (6 م)",
        "قضيب صلب دائري 50 مم"
       ]
      },
      {
       "column": "C",
       "header": "الوحدة",
       "kind": "input",
       "examples": [
        "لوح",
        "قطعة",
        "متر"
       ]
      },
      {
       "column": "D",
       "header": "سعر الوحدة",
       "kind": "input",
       "examples": [
        2100,
        380,
        420
       ]
      },
      {
       "column": "E",
       "header": "الرصيد الافتتاحي",
       "kind": "input",
       "examples": [
        40,
        120,
        60
       ]
      },
      {
       "column": "F",
       "header": "الحد الأدنى",
       "kind": "input",
       "examples": [
        10,
        20,
        15
       ]
      },
      {
       "column": "G",
       "header": "المصروف للأوامر",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",SUMIFS('الخامات المستخدمة'!$C$6:$C$605,'الخامات المستخدمة'!$B$6:$B$605,A6&\"\"))"
      },
      {
       "column": "H",
       "header": "الرصيد الحالي",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",N(E6)-G6)"
      },
      {
       "column": "I",
       "header": "قيمة الرصيد",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",ROUND(H6*N(D6),2))"
      },
      {
       "column": "J",
       "header": "الحالة",
       "kind": "formula",
       "formula_row_1": "=IF(A6&\"\"=\"\",\"\",IF(H6<=0,\"نفد\",IF(H6<N(F6),\"اطلب\",\"متوفر\")))"
      },
      {
       "column": "K",
       "header": "كمية الطلب المقترحة",
       "kind": "formula",
       "formula_row_1": "=IF(OR(J6=\"نفد\",J6=\"اطلب\"),MAX(0,ROUNDUP(N(F6)*'الإعدادات'!$B$7-H6,0)),\"\")"
      }
     ]
    }
   ]
  },
  {
   "name": "الملخص",
   "formula_cells": 109,
   "record_tables": [
    {
     "header_row": 25,
     "first_record_row": 26,
     "sample_rows_filled": 0,
     "capacity_last_row": 60,
     "columns": [
      {
       "column": "A",
       "header": "المنتج",
       "kind": "formula",
       "formula_row_1": "=IF('الإعدادات'!F5&\"\"=\"\",\"\",'الإعدادات'!F5)"
      },
      {
       "column": "B",
       "header": "عدد الأوامر",
       "kind": "formula",
       "formula_row_1": "=IF(A26=\"\",\"\",COUNTIFS('أوامر التشغيل'!$D$6:$D$205,A26&\"\",'أوامر التشغيل'!$J$6:$J$205,\"سُلّم\"))"
      },
      {
       "column": "C",
       "header": "القيمة",
       "kind": "formula",
       "formula_row_1": "=IF(A26=\"\",\"\",SUMIFS('أوامر التشغيل'!$S$6:$S$205,'أوامر التشغيل'!$D$6:$D$205,A26&\"\",'أوامر التشغيل'!$J$6:$J$205,\"سُلّم\"))"
      },
      {
       "column": "D",
       "header": "التكلفة",
       "kind": "formula",
       "formula_row_1": "=IF(A26=\"\",\"\",SUMIFS('أوامر التشغيل'!$R$6:$R$205,'أوامر التشغيل'!$D$6:$D$205,A26&\"\",'أوامر التشغيل'!$J$6:$J$205,\"سُلّم\"))"
      },
      {
       "column": "E",
       "header": "الربح",
       "kind": "formula",
       "formula_row_1": "=IF(A26=\"\",\"\",C26-D26)"
      }
     ]
    }
   ],
   "results": [
    {
     "label": "عدد الأوامر",
     "cell": "B5",
     "formula": "=COUNTIF('أوامر التشغيل'!$A$6:$A$205,\"?*\")"
    },
    {
     "label": "لم يبدأ",
     "cell": "B6",
     "formula": "=COUNTIF('أوامر التشغيل'!$J$6:$J$205,\"لم يبدأ\")"
    },
    {
     "label": "قيد التشغيل",
     "cell": "B7",
     "formula": "=COUNTIF('أوامر التشغيل'!$J$6:$J$205,\"قيد التشغيل\")"
    },
    {
     "label": "جاهز للتسليم",
     "cell": "B8",
     "formula": "=COUNTIF('أوامر التشغيل'!$J$6:$J$205,\"جاهز للتسليم\")"
    },
    {
     "label": "سُلّم",
     "cell": "B9",
     "formula": "=COUNTIF('أوامر التشغيل'!$J$6:$J$205,\"سُلّم\")"
    },
    {
     "label": "أوامر متأخرة حاليًا (غير مسلّمة)",
     "cell": "B10",
     "formula": "=COUNTIF('أوامر التشغيل'!$X$6:$X$205,\"متأخر\")"
    },
    {
     "label": "أوامر سُلّمت متأخرة",
     "cell": "B11",
     "formula": "=COUNTIF('أوامر التشغيل'!$X$6:$X$205,\"سُلّم متأخرًا\")"
    },
    {
     "label": "قيمة الأوامر المفتوحة (غير المسلّمة)",
     "cell": "B12",
     "formula": "=SUM('أوامر التشغيل'!$S$6:$S$205)-SUMIFS('أوامر التشغيل'!$S$6:$S$205,'أوامر التشغيل'!$J$6:$J$205,\"سُلّم\")"
    },
    {
     "label": "المتبقي على العملاء من كل الأوامر",
     "cell": "B13",
     "formula": "=SUM('أوامر التشغيل'!$V$6:$V$205)"
    },
    {
     "label": "قيمة الأوامر المسلّمة",
     "cell": "B16",
     "formula": "=SUMIFS('أوامر التشغيل'!$S$6:$S$205,'أوامر التشغيل'!$J$6:$J$205,\"سُلّم\")"
    },
    {
     "label": "تكلفتها",
     "cell": "B17",
     "formula": "=SUMIFS('أوامر التشغيل'!$R$6:$R$205,'أوامر التشغيل'!$J$6:$J$205,\"سُلّم\")"
    },
    {
     "label": "الربح",
     "cell": "B18",
     "formula": "=B16-B17"
    },
    {
     "label": "هامش الربح",
     "cell": "B19",
     "formula": "=IF(B16=0,\"\",B18/B16)"
    },
    {
     "label": "ساعات المكينة المسجلة (كل الأوامر)",
     "cell": "B20",
     "formula": "=SUM('أوامر التشغيل'!$N$6:$N$205)"
    },
    {
     "label": "تكلفة الخامات المصروفة (كل الأوامر)",
     "cell": "B21",
     "formula": "=SUM('أوامر التشغيل'!$O$6:$O$205)"
    },
    {
     "label": "خامات تحت الحد الأدنى أو نفدت",
     "cell": "B22",
     "formula": "=COUNTIF('الخامات'!$J$6:$J$105,\"اطلب\")+COUNTIF('الخامات'!$J$6:$J$105,\"نفد\")"
    }
   ]
  },
  {
   "name": "لماذا ما زلت على إكسل؟",
   "formula_cells": 0
  }
 ]
}