{
  "format": "jmeryar-print-template",
  "version": 1,
  "id": "delivery-pictures-ku",
  "doc_type": "delivery_invoice",
  "locale": "ku",
  "name": {
    "en": "Delivery invoice with pictures",
    "ku": "پسوڵەی گەیاندن بە وێنە",
    "ar": "فاتورة توصيل مع الصور",
    "fa": "فاکتور تحویل با تصویر",
    "de": "Lieferschein mit Bildern"
  },
  "description": {
    "en": "A4 delivery invoice with each product's picture beside its line, so the driver and the customer can check the goods at a glance. Lines not on this delivery are struck through.",
    "ku": "پسوڵەی گەیاندنی A4 بە وێنەی هەر بەرهەمێک لە تەنیشت دێڕەکەیەوە، تا شۆفێر و کڕیار بە یەک سەیرکردن کاڵاکان بپشکنن. ئەو دێڕانەی لەم گەیاندنەدا نین هێڵیان بەسەردا دێت.",
    "ar": "فاتورة توصيل بحجم A4 مع صورة كل منتج بجانب سطره، ليتحقق السائق والعميل من البضاعة بنظرة واحدة. تُشطب الأسطر غير المشمولة بهذا التوصيل.",
    "fa": "فاکتور تحویل A4 با تصویر هر کالا کنار ردیفش، تا راننده و خریدار با یک نگاه کالاها را وارسی کنند. ردیف‌هایی که در این تحویل نیستند خط می‌خورند.",
    "de": "A4-Lieferschein mit dem Bild jedes Produkts neben seiner Zeile, damit Fahrer und Kunde die Ware auf einen Blick prüfen. Zeilen, die nicht zu dieser Lieferung gehören, sind durchgestrichen."
  },
  "content": "{%- comment -%}\n  Delivery invoice — WITH PICTURES (کوردی). From the jmeryar template library.\n  A4 sheet with each product's picture beside its line, so the driver and the\n  customer can check the goods at a glance. A product with no picture gets an empty\n  frame. No prices. Change the colour in one place: --accent below. Printed for one\n  delivery of an invoice, the lines on other deliveries are struck through with the\n  reason under them.\n  The pictures arrive as `p.image`: the app only fetches them for a template that\n  reads `.image`, so keep that word in the template if you edit it.\n{%- endcomment -%}\n{%- assign org_name = branch.invoice_title | default: branch.company_name | default: branch.name | default: sell_invoice.branch.name_en -%}\n{%- case digits -%}{%- when \"persian\" -%}{%- assign page_digits = \"persian\" -%}{%- when \"arabic\" -%}{%- assign page_digits = \"arabic-indic\" -%}{%- else -%}{%- assign page_digits = \"decimal\" -%}{%- endcase -%}\n<!doctype html>\n<html lang=\"ku\" dir=\"rtl\">\n<head>\n<meta charset=\"utf-8\">\n<title>پسوڵەی گەیاندن {{ sell_invoice.invoice_number_series }}</title>\n<style>\n  :root { --accent:#c2410c; --accent-soft:#fff7ed; --ink:#1c1917; --muted:#78716c; --line:#e7e5e4; }\n  * { box-sizing: border-box; }\n  html, body { margin: 0; padding: 0; }\n  body {\n    font-family: Tahoma, \"Segoe UI\", \"Noto Naskh Arabic\", \"Noto Sans Arabic\", Arial, sans-serif; color: var(--ink); font-size: 11.5px; line-height: 1.5; background: #e7e5e4;\n    -webkit-print-color-adjust: exact; print-color-adjust: exact;\n  }\n  .sheet { width: 210mm; min-height: 297mm; margin: 12px auto; background: #fff; padding: 12mm 13mm 14mm; box-shadow: 0 1px 4px rgba(28,25,23,.15); }\n  .ltr { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }\n  @page {\n    size: A4; margin: 0 0 14mm;\n    @bottom-center { content: \"لاپەڕە \" counter(page, {{ page_digits }}) \" / \" counter(pages, {{ page_digits }}); font: 8.5px Tahoma, \"Segoe UI\", \"Noto Naskh Arabic\", \"Noto Sans Arabic\", Arial, sans-serif; color: #a8a29e; }\n  }\n\n  header { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-bottom: 10px; border-bottom: 3px solid var(--accent); }\n  .org { display: flex; align-items: center; gap: 12px; min-width: 0; }\n  .logo { max-height: 50px; max-width: 130px; object-fit: contain; }\n  .org-name { font-size: 18px; font-weight: 800; line-height: 1.2; }\n  .org-meta { font-size: 10px; color: var(--muted); margin-top: 2px; }\n  .doc { text-align: end; flex: 0 0 auto; }\n  .doc .kind { display: inline-block; background: var(--accent); color: #fff; font-size: 15px; font-weight: 800; padding: 4px 14px; border-radius: 6px; }\n  .doc .no { margin-top: 5px; font-size: 14px; font-weight: 800; }\n  .badge { display: inline-block; margin-inline-start: 6px; padding: 1px 9px; border-radius: 999px; background: #fee2e2; color: #b91c1c; font-size: 10px; font-weight: 800; }\n\n  .strip { display: flex; margin: 12px 0 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }\n  .strip > div { padding: 9px 12px; min-width: 0; }\n  .strip .to { flex: 1.6; background: var(--accent-soft); }\n  .strip .cell { flex: 1; border-inline-start: 1px solid var(--line); }\n  .label { font-size: 9px; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 2px; }\n  .big { font-size: 14px; font-weight: 800; }\n  .sub { color: var(--muted); margin-top: 1px; }\n  .addr { margin-top: 2px; font-weight: 600; }\n\n  .banner { background: var(--accent-soft); border-inline-start: 4px solid var(--accent); border-radius: 6px; padding: 7px 12px; margin-bottom: 12px; }\n  .banner .hint, .banner .bn { color: var(--muted); font-size: 10.5px; margin-top: 2px; }\n\n  table.lines { width: 100%; border-collapse: collapse; }\n  table.lines thead { display: table-header-group; }\n  table.lines tr { break-inside: avoid; page-break-inside: avoid; }\n  table.lines th { font-size: 9.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; text-align: start; padding: 6px 8px; border-bottom: 2px solid var(--ink); }\n  table.lines td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }\n  table.lines tfoot td { font-weight: 800; font-size: 12px; padding: 10px 8px; border-bottom: none; border-top: 2px solid var(--ink); }\n  .c-no { width: 7mm; color: var(--muted); }\n  .c-pic { width: 27mm; }\n  .pic { width: 24mm; height: 24mm; border: 1px solid var(--line); border-radius: 8px; background: #fafaf9; display: flex; align-items: center; justify-content: center; overflow: hidden; }\n  .pic img { max-width: 100%; max-height: 100%; object-fit: contain; }\n  .pic .none { width: 40%; height: 40%; border: 2px dashed #d6d3d1; border-radius: 6px; }\n  .brand { font-size: 9.5px; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .4px; }\n  .pn { font-size: 12.5px; font-weight: 700; }\n  .ln { font-size: 10px; color: var(--muted); white-space: pre-wrap; margin-top: 2px; }\n  .num { text-align: center; white-space: nowrap; }\n  .c-qty { width: 18mm; }\n  .qty { display: inline-block; min-width: 30px; padding: 3px 8px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 800; }\n  .c-chk { width: 13mm; text-align: center; }\n  .box { display: inline-block; width: 16px; height: 16px; border: 1.5px solid var(--ink); border-radius: 3px; vertical-align: middle; }\n  /* A line that is not on this delivery: faded and struck, its reason left unstruck. */\n  tr.off .pic { opacity: .35; }\n  tr.off .pn, tr.off .brand { text-decoration: line-through; color: #a8a29e; }\n  tr.off .qty { background: #d6d3d1; text-decoration: line-through; }\n  tr.off .box { border-color: #d6d3d1; }\n  .why { display: inline-block; margin-top: 3px; font-size: 10px; font-style: italic; color: var(--accent); }\n\n  .closing { break-inside: avoid; page-break-inside: avoid; display: flex; gap: 14px; margin-top: 16px; align-items: stretch; }\n  .aside { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }\n  .note { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; white-space: pre-wrap; }\n  .cond { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }\n  .cond .opts { display: flex; gap: 22px; margin-top: 3px; }\n  .cond .opts span { display: inline-flex; align-items: center; gap: 6px; }\n  .qr { flex: 0 0 auto; width: 38mm; border: 1px solid var(--line); border-radius: 8px; padding: 8px; text-align: center; }\n  .qr img { width: 28mm; height: 28mm; image-rendering: pixelated; display: block; margin: 0 auto; }\n  .qr .cap { font-size: 9px; color: var(--muted); margin-top: 4px; }\n\n  .statement { margin-top: 16px; font-weight: 600; break-inside: avoid; }\n  .signs { display: flex; gap: 26px; margin-top: 38px; break-inside: avoid; }\n  .signs .s { flex: 1; text-align: center; border-top: 1.5px solid var(--ink); padding-top: 5px; color: var(--muted); font-size: 10.5px; }\n  .stamp { margin-top: 16px; text-align: center; font-size: 9.5px; color: #a8a29e; }\n\n  @media print {\n    body { background: #fff; }\n    .sheet { margin: 0; width: auto; min-height: 0; box-shadow: none; }\n  }\n</style>\n</head>\n<body>\n<div class=\"sheet\">\n  <header>\n    <div class=\"org\">\n      {% if branch.logo and branch.logo != \"\" %}<img class=\"logo\" src=\"{{ branch.logo }}\" alt=\"\">{% endif %}\n      <div>\n        <div class=\"org-name\"><bdi>{{ org_name }}</bdi></div>\n        <div class=\"org-meta\">\n          {% if branch.address and branch.address != \"\" %}{{ branch.address }}{% endif %}\n          {% if branch.phone1 and branch.phone1 != \"\" %} · <span class=\"ltr\">{{ branch.phone1 }}</span>{% endif %}\n        </div>\n      </div>\n    </div>\n    <div class=\"doc\">\n      <div class=\"kind\">پسوڵەی گەیاندن</div>\n      <div class=\"no\"><span class=\"ltr\">{{ sell_invoice.invoice_number_series }}</span>{% case sell_invoice.status %}{% when \"draft\" %}<span class=\"badge\">ڕەشنووس</span>{% when \"canceled\" %}<span class=\"badge\">هەڵوەشاوە</span>{% endcase %}</div>\n    </div>\n  </header>\n\n  <section class=\"strip\">\n    <div class=\"to\">\n      <div class=\"label\">گەیاندن بۆ</div>\n      <div class=\"big\"><bdi>{{ customer.name | default: sell_invoice.customer.name | default: \"—\" }}</bdi></div>\n      {% if customer.phones.size > 0 %}\n      <div class=\"sub\">{% for p in customer.phones %}{% unless forloop.first %} · {% endunless %}<span class=\"ltr\">{{ p }}</span>{% endfor %}</div>\n      {% elsif sell_invoice.customer.contacts.size > 0 %}\n      <div class=\"sub\">{% for c in sell_invoice.customer.contacts %}{% unless forloop.first %} · {% endunless %}<span class=\"ltr\">{{ c.phone_display | default: c.phone_number }}</span>{% endfor %}</div>\n      {% endif %}\n      {% if sell_invoice.delivery_address and sell_invoice.delivery_address != \"\" %}<div class=\"addr\">{{ sell_invoice.delivery_address }}</div>{% endif %}\n    </div>\n    <div class=\"cell\">\n      <div class=\"label\">بەرواری گەیاندن</div>\n      <div class=\"big\"><span class=\"ltr\">{{ sell_invoice.delivery_date | default: \"—\" }}{% if sell_invoice.delivery_time and sell_invoice.delivery_time != \"\" %} {{ sell_invoice.delivery_time }}{% endif %}</span></div>\n      <div class=\"sub\">بەروار: <span class=\"ltr\">{{ sell_invoice.invoice_date }}</span></div>\n    </div>\n    <div class=\"cell\">\n      <div class=\"label\">لق</div>\n      <div class=\"big\">{{ sell_invoice.branch.name_en | default: \"—\" }}</div>\n      {% if sell_invoice.created_by.name_en and sell_invoice.created_by.name_en != \"\" %}<div class=\"sub\">ژمێریار: {{ sell_invoice.created_by.name_en }}</div>{% endif %}\n    </div>\n  </section>\n\n  {% if delivery %}\n  <div class=\"banner\">\n    <b>ئەم گەیاندنە:</b> <span class=\"ltr\">{{ delivery.when }}</span> — <span class=\"ltr\">{{ delivery.items }} / {{ delivery.items_total }}</span> بەرهەم\n    {% if delivery.partial %}<div class=\"hint\">ئەو بەرهەمانەی هێڵیان بەسەردا هاتووە بەشێک نین لەم گەیاندنە.</div>{% endif %}\n    {% if delivery.note and delivery.note != \"\" %}<div class=\"bn\">{{ delivery.note }}</div>{% endif %}\n  </div>\n  {% endif %}\n\n  <table class=\"lines\">\n    <thead>\n      <tr><th class=\"c-no\">#</th><th class=\"c-pic\">وێنە</th><th>بەرهەم</th><th class=\"num\">عەدەد</th><th class=\"c-chk\">✓</th></tr>\n    </thead>\n    <tbody>\n      {% for p in si_products %}\n      <tr{% if p.included == false %} class=\"off\"{% endif %}>\n        <td class=\"c-no\"><span class=\"ltr\">{{ p.no }}</span></td>\n        <td class=\"c-pic\"><div class=\"pic\">{% if p.image and p.image != \"\" %}<img src=\"{{ p.image }}\" alt=\"\">{% else %}<span class=\"none\"></span>{% endif %}</div></td>\n        <td>\n          {%- assign brand = p.brand.name | default: p.brand.name_en -%}\n          {% if brand and brand != \"\" %}<div class=\"brand\"><bdi>{{ brand }}</bdi></div>{% endif %}\n          <div class=\"pn\"><bdi>{{ p.product_name | default: p.product_name_en | default: \"—\" }}</bdi></div>\n          {% if p.notes and p.notes != \"\" %}<div class=\"ln\">{{ p.notes }}</div>{% endif %}\n          {% if p.included == false %}<span class=\"why\">لەم گەیاندنەدا نییە —\n            {% case p.delivery_state %}{% when \"delivered\" %}پێشتر گەیەندراوە{% when \"earlier\" %}لە گەیاندنێکی پێشووتردا{% when \"later\" %}لە گەیاندنێکی دواتردا{% when \"same_day\" %}لە گەیاندنێکی تری هەمان ڕۆژدا{% else %}هێشتا کاتی بۆ دانەنراوە{% endcase %}{% if p.delivery_when and p.delivery_when != \"\" %} (<span class=\"ltr\">{{ p.delivery_when }}</span>){% endif %}</span>{% endif %}\n        </td>\n        <td class=\"num c-qty\"><span class=\"qty ltr\">{{ p.qty }}</span></td>\n        <td class=\"c-chk\"><span class=\"box\"></span></td>\n      </tr>\n      {% endfor %}\n    </tbody>\n    <tfoot>\n      <tr><td></td><td></td><td>کۆی عەدەد</td><td class=\"num\"><span class=\"ltr\">{{ total_qty }}</span></td><td></td></tr>\n    </tfoot>\n  </table>\n\n  <div class=\"closing\">\n    <div class=\"aside\">\n      {% if sell_invoice.notes and sell_invoice.notes != \"\" %}<div class=\"note\"><div class=\"label\">تێبینی</div>{{ sell_invoice.notes }}</div>{% endif %}\n      <div class=\"cond\">\n        <div class=\"label\">دۆخی کاڵا لە کاتی گەیشتن</div>\n        <div class=\"opts\"><span><span class=\"box\"></span> باشە</span><span><span class=\"box\"></span> زیانی پێگەیشتووە</span></div>\n      </div>\n    </div>\n    {% if qr_data_url and qr_data_url != \"\" %}\n    <div class=\"qr\">\n      <img src=\"{{ qr_data_url }}\" alt=\"\">\n      <div class=\"cap\">{% if qr_is_link %}بۆ بینینی پسوڵەکەت سکان بکە{% else %}<span class=\"ltr\">{{ sell_invoice.invoice_number_series }}</span>{% endif %}</div>\n    </div>\n    {% endif %}\n  </div>\n\n  <div class=\"statement\">{% if delivery and delivery.partial %}من بەرهەمەکانی سەرەوەم، جگە لەوانەی هێڵیان بەسەردا هاتووە، بە تەواوی و بە دۆخێکی باش وەرگرت.{% else %}من بەرهەمەکانی سەرەوەم بە تەواوی و بە دۆخێکی باش وەرگرت.{% endif %}</div>\n  <section class=\"signs\">\n    <div class=\"s\">ناوی وەرگر</div>\n    <div class=\"s\">واژووی کڕیار</div>\n    <div class=\"s\">واژووی شۆفێر</div>\n  </section>\n  <div class=\"stamp\">چاپکراوە لە <span class=\"ltr\">{{ generated_at }}</span></div>\n</div>\n</body>\n</html>\n"
}