{# ── Bilingual labels ── #} {% if lang == 'gr' %} {% set L_QUOTATION = "ΠΡΟΣΦΟΡΑ" %} {% set L_NUMBER = "Αριθμός" %} {% set L_DATE = "Ημερομηνία" %} {% set L_CLIENT = "ΣΤΟΙΧΕΙΑ ΠΕΛΑΤΗ" %} {% set L_ORDER_META = "ΣΤΟΙΧΕΙΑ ΠΑΡΑΓΓΕΛΙΑΣ" %} {% set L_ORDER_TYPE = "Τύπος" %} {% set L_SHIP_METHOD = "Τρ. Αποστολής" %} {% set L_SHIP_DATE = "Εκτιμώμενη Παράδοση" %} {% set L_DESC = "Περιγραφή" %} {% set L_UNIT_COST = "Τιμή Μον." %} {% set L_DISC = "Έκπτ." %} {% set L_QTY = "Ποσ." %} {% set L_UNIT = "Μον." %} {% set L_VAT_COL = "Φ.Π.Α." %} {% set L_TOTAL = "Σύνολο" %} {% set L_SUBTOTAL = "Υποσύνολο" %} {% set L_GLOBAL_DISC = quotation.global_discount_label or "Έκπτωση" %} {% set L_NEW_SUBTOTAL = "Νέο Υποσύνολο" %} {% set L_VAT = "ΣΥΝΟΛΟ Φ.Π.Α." %} {% set L_SHIPPING_COST = "Μεταφορικά / Shipping" %} {% set L_INSTALL_COST = "Εγκατάσταση / Installation" %} {% set L_EXTRAS = quotation.extras_label or "Άλλα" %} {% set L_FINAL = "ΣΥΝΟΛΟ ΠΛΗΡΩΤΕΟ" %} {% set L_COMMENTS = "ΣΗΜΕΙΩΣΕΙΣ" %} {% set L_VALIDITY = "Η προσφορά ισχύει για 30 ημέρες από την ημερομηνία έκδοσής της." %} {% set L_ORG = "Φορέας" %} {% set L_CONTACT = "Επικοινωνία" %} {% set L_ADDRESS = "Διεύθυνση" %} {% set L_PHONE = "Τηλέφωνο" %} {% set L_COMPANY_ADDR = "Ε.Ο. Αντιρρίου Ιωαννίνων 23, Αγρίνιο, 30131" %} {% set L_CONTACT_INFO = "ΣΤΟΙΧΕΙΑ ΕΠΙΚΟΙΝΩΝΙΑΣ" %} {% set L_PAYMENT_INFO = "ΣΤΟΙΧΕΙΑ ΠΛΗΡΩΜΗΣ" %} {% else %} {% set L_QUOTATION = "QUOTATION" %} {% set L_NUMBER = "Number" %} {% set L_DATE = "Date" %} {% set L_CLIENT = "CLIENT DETAILS" %} {% set L_ORDER_META = "ORDER DETAILS" %} {% set L_ORDER_TYPE = "Order Type" %} {% set L_SHIP_METHOD = "Ship. Method" %} {% set L_SHIP_DATE = "Est. Delivery" %} {% set L_DESC = "Description" %} {% set L_UNIT_COST = "Unit Cost" %} {% set L_DISC = "Disc." %} {% set L_QTY = "Qty" %} {% set L_UNIT = "Unit" %} {% set L_VAT_COL = "VAT" %} {% set L_TOTAL = "Total" %} {% set L_SUBTOTAL = "Subtotal" %} {% set L_GLOBAL_DISC = quotation.global_discount_label or "Discount" %} {% set L_NEW_SUBTOTAL = "New Subtotal" %} {% set L_VAT = "Total VAT" %} {% set L_SHIPPING_COST = "Shipping / Transport" %} {% set L_INSTALL_COST = "Installation" %} {% set L_EXTRAS = quotation.extras_label or "Extras" %} {% set L_FINAL = "TOTAL DUE" %} {% set L_COMMENTS = "NOTES" %} {% set L_VALIDITY = "This quotation is valid for 30 days from the date of issue." %} {% set L_ORG = "Organization" %} {% set L_CONTACT = "Contact" %} {% set L_ADDRESS = "Location" %} {% set L_PHONE = "Phone" %} {% set L_COMPANY_ADDR = "E.O. Antirriou Ioanninon 23, Agrinio, 30131, Greece" %} {% set L_CONTACT_INFO = "CONTACT INFORMATION" %} {% set L_PAYMENT_INFO = "PAYMENT DETAILS" %} {% endif %} {# ── Derived values ── #} {% set today = quotation.created_at[:10] %} {# ── Find phone/email contacts + check if primary contact is already phone/email ── #} {% set ns = namespace(customer_phone='', customer_email='', primary_is_phone=false, primary_is_email=false) %} {% for contact in customer.contacts %} {% if contact.type == 'phone' and contact.value %}{% if contact.primary %}{% set ns.customer_phone = contact.value %}{% set ns.primary_is_phone = true %}{% elif not ns.customer_phone %}{% set ns.customer_phone = contact.value %}{% endif %}{% endif %} {% if contact.type == 'email' and contact.value %}{% if contact.primary %}{% set ns.customer_email = contact.value %}{% set ns.primary_is_email = true %}{% elif not ns.customer_email %}{% set ns.customer_email = contact.value %}{% endif %}{% endif %} {% endfor %} {% set customer_phone = ns.customer_phone %} {% set customer_email = ns.customer_email %} {% set primary_is_phone = ns.primary_is_phone %} {% set primary_is_email = ns.primary_is_email %}

{{ L_COMPANY_ADDR }}

{{ L_QUOTATION }}
{{ L_NUMBER }}: {{ quotation.quotation_number }}
{{ L_DATE }}: {{ today }}
{% if quotation.title %}

{{ quotation.title }}

{% if quotation.subtitle %}

{{ quotation.subtitle }}

{% endif %}
{% endif %}
{{ L_CLIENT }}
{% if customer.organization %}{% endif %}{% set name_parts = [customer.title, customer.name, customer.surname] | select | list %}{% if name_parts %}{% endif %}{% if quotation.client_location %}{% elif customer.location %}{% set loc_parts = [customer.location.address, customer.location.city, customer.location.postal_code, customer.location.region, customer.location.country] | select | list %}{% if loc_parts %}{% endif %}{% endif %}{% if customer_email %}{% endif %}{% if customer_phone %}{% endif %}
{{ L_ORG }}{{ customer.organization }}
{{ L_CONTACT }}{{ name_parts | join(' ') }}
{{ L_ADDRESS }}{{ quotation.client_location }}
{{ L_ADDRESS }}{{ loc_parts | join(', ') }}
Email{{ customer_email }}
{{ L_PHONE }}{{ customer_phone }}
{{ L_ORDER_META }}
{% if quotation.order_type %}{% endif %}{% if quotation.shipping_method %}{% endif %}{% if quotation.estimated_shipping_date %}{% else %}{% endif %}
{{ L_ORDER_TYPE }}{{ quotation.order_type }}
{{ L_SHIP_METHOD }}{{ quotation.shipping_method }}
{{ L_SHIP_DATE }}{{ quotation.estimated_shipping_date }}
{{ L_SHIP_DATE }}
{% for item in quotation.items %} {% endfor %} {% if quotation.items | length == 0 %} {% endif %} {# ── Shipping / Install as special rows ── #} {% set has_special = (quotation.shipping_cost and quotation.shipping_cost > 0) or (quotation.install_cost and quotation.install_cost > 0) %} {% if has_special %} {% endif %} {% if quotation.shipping_cost and quotation.shipping_cost > 0 %} {% set ship_net = quotation.shipping_cost * (1 - quotation.shipping_cost_discount / 100) %} {% endif %} {% if quotation.install_cost and quotation.install_cost > 0 %} {% set install_net = quotation.install_cost * (1 - quotation.install_cost_discount / 100) %} {% endif %}
{{ L_DESC }} {{ L_UNIT_COST }} {{ L_DISC }} {{ L_QTY }} {{ L_UNIT }} {{ L_VAT_COL }} {{ L_TOTAL }}
{% if lang == 'gr' %}{{ item.description_gr or item.description or '' }}{% else %}{{ item.description_en or item.description or '' }}{% endif %} {{ item.unit_cost | format_money }} {% if item.discount_percent and item.discount_percent > 0 %} {{ item.discount_percent | int }}% {% else %} {% endif %} {{ item.quantity | int if item.quantity == (item.quantity | int) else item.quantity }} {{ item.unit_type }} {% if item.vat_percent and item.vat_percent > 0 %} {{ item.vat_percent | int }}% {% else %} {% endif %} {{ item.line_total | format_money }}
{{ L_SHIPPING_COST }}{% if quotation.shipping_cost_discount and quotation.shipping_cost_discount > 0 %} (-{{ quotation.shipping_cost_discount | int }}%){% endif %} {{ quotation.shipping_cost | format_money }} 1 {{ ship_net | format_money }}
{{ L_INSTALL_COST }}{% if quotation.install_cost_discount and quotation.install_cost_discount > 0 %} (-{{ quotation.install_cost_discount | int }}%){% endif %} {{ quotation.install_cost | format_money }} 1 {{ install_net | format_money }}
{% if quotation.global_discount_percent and quotation.global_discount_percent > 0 %} {% endif %} {% if quotation.extras_cost and quotation.extras_cost > 0 %} {% endif %}
{{ L_SUBTOTAL }} {{ quotation.subtotal_before_discount | format_money }}
{{ L_GLOBAL_DISC }} ({{ quotation.global_discount_percent | int }}%) - {{ quotation.global_discount_amount | format_money }}
{{ L_NEW_SUBTOTAL }} {{ quotation.new_subtotal | format_money }}
{{ L_VAT }} {{ quotation.vat_amount | format_money }}
{{ L_EXTRAS }} {{ quotation.extras_cost | format_money }}
{{ L_FINAL }} {{ quotation.final_total | format_money }}
{% set qn = quotation.quick_notes or {} %} {% set has_quick = (qn.payment_advance and qn.payment_advance.enabled) or (qn.lead_time and qn.lead_time.enabled) or (qn.backup_relays and qn.backup_relays.enabled) %} {% set has_comments = quotation.comments and quotation.comments | length > 0 %} {% if has_quick or has_comments %}
{{ L_COMMENTS }}
{% endif %}