{
  "template": {
    "ir": "0.1.0",
    "meta": {
      "name": "quotation",
      "version": "1.0.0"
    },
    "page": {
      "size": "A4",
      "margins": "15mm",
      "direction": "rtl"
    },
    "styles": {
      "body": {
        "font": "Cairo",
        "size": "10pt",
        "lineHeight": 1.7
      },
      "co": {
        "font": "Cairo",
        "weight": 700,
        "size": "16pt",
        "color": "#1A3C6E"
      },
      "title": {
        "font": "Cairo",
        "weight": 700,
        "size": "14pt",
        "color": "#8A1538"
      },
      "th": {
        "font": "Cairo",
        "weight": 700,
        "size": "9.5pt",
        "align": "center",
        "color": "#FFFFFF",
        "background": "#1A3C6E"
      },
      "td": {
        "font": "Cairo",
        "size": "9.5pt",
        "align": "center"
      },
      "mut": {
        "font": "Cairo",
        "size": "9pt",
        "color": "#66788c"
      }
    },
    "body": [
      {
        "type": "row",
        "align": "space-between",
        "children": [
          {
            "type": "text",
            "bind": "$.company.name",
            "style": "co"
          },
          {
            "type": "keyValue",
            "items": [
              {
                "label": "رقم العرض",
                "bind": "$.quote.number"
              },
              {
                "label": "التاريخ",
                "bind": "$.quote.date",
                "format": {
                  "dateStyle": "medium"
                }
              },
              {
                "label": "صالح حتى",
                "bind": "$.quote.validUntil",
                "format": {
                  "dateStyle": "medium"
                }
              }
            ]
          }
        ]
      },
      {
        "type": "divider"
      },
      {
        "type": "spacer",
        "height": "4mm"
      },
      {
        "type": "heading",
        "text": "عرض سعر",
        "level": 2,
        "style": "title"
      },
      {
        "type": "text",
        "runs": [
          {
            "text": "مقدم إلى: "
          },
          {
            "bind": "$.customer.name",
            "style": "b"
          }
        ]
      },
      {
        "type": "spacer",
        "height": "4mm"
      },
      {
        "type": "table",
        "bind": "$.items",
        "headerStyle": "th",
        "cellStyle": "td",
        "widths": [
          "50%",
          "14%",
          "18%",
          "18%"
        ],
        "columns": [
          {
            "header": "البيان",
            "cell": {
              "bind": "item.name"
            }
          },
          {
            "header": "الكمية",
            "cell": {
              "bind": "item.qty"
            }
          },
          {
            "header": "السعر",
            "cell": {
              "bind": "item.price",
              "format": {
                "currency": "SAR",
                "kind": "currency"
              }
            }
          },
          {
            "header": "الإجمالي",
            "cell": {
              "bind": "item.total",
              "format": {
                "currency": "SAR",
                "kind": "currency"
              }
            }
          }
        ]
      },
      {
        "type": "spacer",
        "height": "4mm"
      },
      {
        "type": "keyValue",
        "items": [
          {
            "label": "الإجمالي قبل الضريبة",
            "bind": "$.totals.subtotal",
            "format": {
              "currency": "SAR",
              "kind": "currency"
            }
          },
          {
            "label": "ضريبة القيمة المضافة 15٪",
            "bind": "$.totals.vat",
            "format": {
              "currency": "SAR",
              "kind": "currency"
            }
          },
          {
            "label": "الإجمالي",
            "bind": "$.totals.total",
            "format": {
              "currency": "SAR",
              "kind": "currency"
            }
          }
        ]
      },
      {
        "type": "spacer",
        "height": "6mm"
      },
      {
        "type": "text",
        "text": "الشروط: الأسعار شاملة التوريد. مدة التنفيذ تحدد عند التعميد. يعتبر هذا العرض لاغياً بعد تاريخ الصلاحية.",
        "style": "mut"
      },
      {
        "type": "spacer",
        "height": "10mm"
      },
      {
        "type": "signature",
        "field": "sales",
        "label": "المبيعات",
        "bind": "$.company.rep"
      }
    ]
  },
  "data": {
    "company": {
      "name": "مؤسسة الإنجاز للتوريدات",
      "rep": "أ. فهد القحطاني"
    },
    "customer": {
      "name": "مستشفى الشفاء التخصصي"
    },
    "quote": {
      "number": "Q-2026-118",
      "date": "2026-08-14",
      "validUntil": "2026-09-14"
    },
    "items": [
      {
        "name": "أجهزة عرض تفاعلية 75 بوصة",
        "qty": 4,
        "price": 9800,
        "total": 39200
      },
      {
        "name": "تركيب وتدريب",
        "qty": 1,
        "price": 3000,
        "total": 3000
      }
    ],
    "totals": {
      "subtotal": 42200,
      "vat": 6330,
      "total": 48530
    }
  }
}