Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagehtml
{% load i18n static pdf_tags %}
{% get_current_language as LANGUAGE_CODE %}
<!doctype html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{{ preview_title }}</title>
    <link rel="stylesheet" href="{% static 'css/order_notes/base.css' %}">
    {% if css_additional %}
        <link rel="stylesheet" href="{% static css_additional %}">
    {% endif %}
    {% include "b3_pdf/extra_header.html" %}
</head>
<body>
<header>
    <table class="header">
        <tr>
            <td class="header__logo">
                <img src="{{ logo_url }}" alt="Default Logo">
            </td>
        </tr>
    </table>
    <div class="header__address">
        {{ service.name }} | {{ sender_address_line }}
    </div>
    <table class="address">
        <tr>
            <td class="address__to">
                <div class="element__label">{% trans 'Billing Address' %}</div>
                <div class="element__value">
                    {{ billing_address.salutation }}
                    {% if billing_address.company_name %}
                        <br/> {{ billing_address.company_name }}
                    {% endif %}
                    {% if billing_address.line1 %}
                        <br/> {{ billing_address.line1 }}
                    {% endif %}
                    {% if billing_address.line2 %}
                        <br/> {{ billing_address.line2 }}
                    {% endif %}
                    <br/> {{ billing_address.city }}{% if billing_address.state %}, {{ billing_address.state }}{% endif %}, {{ billing_address.zip_code }}
                    <br/> {{ billing_address.country.name }}
                </div>
            </td>
            <td class="address__from">
                <div class="element__label">{% trans 'Customer Support' %}</div>
                <div class="element__value">
                    {{ service_address.phone_number }}
                    {% if service.email %}
                        <br> {% trans 'Email:' %} {{ service.email }}
                    {% endif %}
                    <br> {% trans 'Processed by:' %} {{ service_user_name }}
                    <br> {{ note_data.issue_date|date:theme_date_format }}
                </div>
            </td>
        </tr>
    </table>
</header>
<main>
    <h1 class="page-title">
        {{ note_name }}: {{ note_prefix }}{{ note_id }}
    </h1>
    <table class="info">
        <tr>
            <td class="element">
                <div class="element__label">{% trans 'Order #' %}</div>
                <div class="element__value">{{ order_obj.full_number }}</div>
            </td>
            <td class="element">
                <div class="element__label">{% trans 'Order Date' %}</div>
                <div class="element__value">{{ order_date|date:theme_date_format }}</div>
            </td>
            {% if is_customer_number_shown %}
            <td class="element">
                <div class="element__label">{{ customer_number_label }}</div>
                <div class="element__value">{{ customer_number|default:"-" }}</div>
            </td>
            {% endif %}
            {% if is_customer_reference_shown %}
            <td class="element">
                <div class="element__label">{{ customer_reference_label }}</div>
                <div class="element__value">{{ customer_reference|default:"-" }}</div>
            </td>
            {% endif %}
        </tr>
    </table>
    <table class="info info--grey">
        <tr>
            <td class="element">
                <div class="element__label">{% trans 'Order Confirmation #' %}</div>
                <div class="element__value">{{ confirmation_note.order_confirmation_number }}</div>
            </td>
            <td class="element">
                <div class="element__label">{% trans 'Payment method' %}</div>
                {% if payment_custom_fields %}
                  <div class="element__value">{{ payment_custom_fields }}</div>
                {% else %}
                <div class="element__value">{% trans order_obj.payment_method_name %}</div>
                {% endif %}

                {% comment %}
                    To access individual payment metadata items:
                    {% if payment_metadata %}
                      {% for key, value in payment_metadata.items %}
                       {{ key }}: {{ value }}<br>
                      {% endfor %}
                    {% endif %}
                {% endcomment %}
            </td>
            <td class="element">
                <div class="element__label">{% trans 'Delivery date' %}</div>
                <div class="element__value">{{ note_data.shipping_date|date:theme_date_format }}</div>
            </td>
            <td class="element">
                <div class="element__label">{% trans 'Shipping Type' %}</div>
                <div class="element__value">
                    {{ order_obj.shipping_method }}
                </div>
            </td>
        </tr>
    </table>
    {% if backdrop_text %}
        <div class="overlay-wrapper">
            <div class="overlay-text">
                {% trans backdrop_text %}
            </div>
        </div>
    {% endif %}
    <section id="customer-greeting">
        <h4>{% blocktrans %}Dear Sir or Madam, Thank you for your order.{% endblocktrans %}</h4>
        <p>
            {% blocktrans %}
                We hope you were satisfied with the handling of your order so far. If you have any questions or need
                further information, we are of course happy to help.
            {% endblocktrans %}
        </p>
    </section>
    <section id="order-lines">
        <table class="kt-table">
            <thead>
            <tr>
                <th class="line-number">#</th>
                <th class="line-image"></th>
                <th class="line-part">{% trans 'Part' %}</th>
                <th class="line-quantity text-right">{% trans 'Qty.' %}</th>
                <th class="line-price-unit text-right">{% trans 'Unit Price' %}</th>
                <th class="line-price-discount text-right">{% trans 'Discount' %}</th>
                <th class="line-price-total text-right">{% trans 'Item Total' %}</th>
            </tr>
            </thead>
            <tbody>
            {% for line in order_lines %}
                <tr>
                    <td>{{ forloop.counter }}</td>
                    <td class="line-thumbnail">
                        <img
                            src="{{ line.thumbnail }}"
                            alt="{{ line.fullName }}"
                            class="line-image"
                        >
                    </td>
                    <td>
                        <b>{{ line.fullName }}</b>
                        <br> {{ line.offer.technology }}
                        <br> {{ line.offer.material }} | {{ line.prices.printPrice|as_currency:line.prices.currency }}
                        {% if line.offer.postProcessings %}
                            <br>
                            {% for option in line.offer.postProcessings %}
                                <br/>{{ option.name }}
                                {% if option.colorTitle %} | color: {{ option.colorTitle }}{% endif %}
                                {% if option.price %} | {{ option.price|as_currency:line.prices.currency }}{% endif %}
                            {% endfor %}
                            <br>
                        {% endif %}
                        <br>
                        {{ line.dimensions.w|floatformat:2 }} *
                        {{ line.dimensions.h|floatformat:2 }} *
                        {{ line.dimensions.d|floatformat:2 }} ({{ line.measureUnit }})|
                        {{ line.weight|floatformat:line.weightDecimals }} {{ line.weightUnit }}
                        <br>
                    </td>
                    <td class="text-right quantity">{{ line.quantity }} / {{ line.quantity }}</td>
                    <td class="text-right unit-price">
                        {{ line.prices.unitPrice|as_currency:line.prices.currency }}
                    </td>
                    <td class="text-right discount">
                        {% if line.prices.discount %}
                            {{ line.prices.discount|as_currency:line.prices.currency }}
                        {% else %}
                            --/--
                        {% endif %}
                    </td>
                    <td class="text-right line-price">
                        {{ line.prices.linePrice|as_currency:line.prices.currency }}
                    </td>
                </tr>
                {% if line.part_requirements.fields.all %}
                    <tr>
                        <td colspan="2"></td>
                        <td>
                            {% for field in line.part_requirements.fields.all %}
                                {% if field.show_on_pdf %}
                                    <span class="part_requirements_field">
                                        <span class="label">{{ field.property.name }}:</span>
                                        {{ field.get_value_as_str_pretty_printed }}
                                    </span>
                                    <br>
                                {% endif %}
                            {% endfor %}
                        </td>
                        <td colspan="4"></td>
                    </tr>
                {% endif %}
            {% endfor %}
            <tr>
                <td colspan="4"></td>
                <td colspan="3">
                    <table id="order-totals-summary" class="totals-summary">
                        <tbody>
                        <tr>
                            <td class="totals sub-total" width="50%">
                                {% trans 'Subtotal' %}:
                            </td>
                            <td class="totals sub-total" width="50%">
                                {{ subtotal|as_currency:order_obj.currency }}
                            </td>
                        </tr>
                        <tr>
                            <td >
                                {% trans 'Including' %}:
                            </td>
                        </tr>
                        <tr>
                            <td >
                                *   {% trans 'Post-Processings' %}:
                            </td>
                            <td>
                                {{ post_processings_price|as_currency:order_obj.currency }}
                            </td>
                        </tr>
                        <tr>
                            <td >
                                *   {% trans 'Printing' %}:
                            </td>
                            <td>
                                {{ printing_price|as_currency:order_obj.currency }}
                            </td>
                        </tr>
                        {% if fee %}
                            <tr class="extra-fee">
                                <td>{% trans 'Extra Fee' %}:</td>
                                <td>
                                    {{ fee|as_currency:order_obj.currency }}
                                </td>
                            </tr>
                            {% for fee_obj in fees %}
                                <tr>
                                    <td>* {{fee_obj.fee}}</td>
                                    <td>{{fee_obj.amount|as_currency:order_obj.currency}}</td>
                                </tr>
                            {% endfor %}
                        {% endif %}
                        {% if difference_to_minimum > 0 %}
                            <tr class="difference-to-minimum">
                                <td>{% trans 'Difference to minimum price' %}:</td>
                                <td>
                                    {{ difference_to_minimum|as_currency:order_obj.currency }}
                                </td>
                            </tr>
                        {% endif %}
                        {% if voucher_discount > 0 %}
                            <tr class="voucher-discount">
                                <td>{% trans 'Voucher' %}:</td>
                                <td>
                                    {{ voucher_discount|negative|as_currency:order_obj.currency }}
                                </td>
                            </tr>
                        {% endif %}
                        {% if shipping_price > 0 %}
                            <tr class="shipping-price">
                                <td>{% trans 'Shipping' %}:</td>
                                <td>
                                    {{ shipping_price|as_currency:order_obj.currency }}
                                </td>
                            </tr>
                        {% endif %}
                        <tr class="total-without-tax">
                            <td>{% trans 'Net total' %}:</td>
                            <td>
                                {{ total_prices.excl_tax|as_currency:order_obj.currency }}
                            </td>
                        </tr>
                        <tr class="tax">
                            <td>{{ tax_rate|floatformat:2 }}% {% trans 'VAT' %}:</td>
                            <td>
                                {{ tax|as_currency:order_obj.currency }}
                            </td>
                        </tr>
                        <tr class="totals grand-total">
                            <td>{% trans 'Gross Total' %}:</td>
                            <td>{{ total_prices.incl_tax|as_currency:order_obj.currency }}</td>
                        </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
            </tbody>
        </table>
    </section>
    {% if note_data.comment %}
        <section id="comment">
            <h3>{% trans 'Comment' %}</h3>
            <p class="comment">{{ note_data.comment|linebreaksbr }}</p>
        </section>
    {% endif %}
    {% if general_sales_conditions %}
        <section id="general-sales-conditions">
            <h3>{% trans 'General Sales Conditions' %}</h3>
            <div>
                {{ general_sales_conditions|linebreaks }}
            </div>
        </section>
    {% endif %}
    {% if general_shipping_conditions %}
        <section id="shipping-conditions">
            <h3>{% trans 'General Shipping Conditions' %}</h3>
            <div>
                {{ general_shipping_conditions|linebreaks }}
            </div>
        </section>
    {% endif %}
</main>
<footer class="footer">
    <p>{{ page_footer }}</p>
</footer>
</body>
</html>

Available Variables

This is an overview of the variables available for use in templates.

...

Category

...

Variable Name

...

Description

...

Document Metadata

...

preview_title

...

Title of the document for display in the browser tab or print preview.

...

Styles

...

css_additional

...

Path to any additional CSS file to style the PDF.

...

Header / Footer

...

logo_url

...

URL of the logo to be displayed in the PDF header.

...

page_footer

...

Text displayed in the footer of the document.

...

Service Information

...

service.name

...

Name of the service or company issuing the document.

...

sender_address_line

...

Address of the service issuing the document.

...

service_address.phone_number

...

Service's customer support phone number.

...

service.email

...

Service's customer support email address.

...

service_user_name

...

Name of the user or agent processing the document.

...

Billing Address

...

billing_address.salutation

...

Salutation or title of the recipient (e.g., Mr., Mrs., Ms.).

...

billing_address.company_name

...

Company name of the billing recipient.

...

billing_address.line1

...

First line of the billing recipient's address.

...

billing_address.line2

...

Second line of the billing recipient's address.

...

billing_address.city

...

City of the billing recipient.

...

billing_address.state

...

State of the billing recipient.

...

billing_address.zip_code

...

ZIP code of the billing recipient.

...

billing_address.country.name

...

Country of the billing recipient.

...

billing_address.vat_id

...

VAT number of the billing recipient.

...

company

...

Name of the company related to the customer (if applicable).

...

Document Information

...

note_name

...

The type of the document (e.g., invoice, order confirmation).

...

note_prefix

...

Prefix used for the document number.

...

note_id

...

Unique identifier for the document.

...

show_thumbnails

...

Boolean flag indicating whether product thumbnails should be displayed.

...

Order Details

...

order_obj.full_number

...

Full number of the order.

...

order_obj.number

...

Order number for the current order.

...

order_obj.sequence_number

...

Sequence number for the order, if applicable.

...

order_date

...

Date when the order was placed.

...

is_customer_number_shown

...

Boolean flag indicating if the customer number should be shown.

...

customer_number_label

...

Label for the customer number.

...

customer_number

...

Customer number associated with the order.

...

is_customer_reference_shown

...

Boolean flag indicating if the customer reference should be shown.

...

customer_reference_label

...

Label for the customer reference.

...

customer_reference

...

Customer reference number.

...

confirmation_note.order_confirmation_number

...

The order confirmation number for the order.

...

order_obj.payment_method_name

...

Name of the payment method used for the order.

...

payment_custom_fields

...

Custom fields related to payment, if available.

...

Shipping Details

...

note_data.shipping_date

...

Date the order was shipped.

...

order_obj.shipping_method

...

Shipping method selected for the order.

...

shipping_address.salutation

...

Salutation or title of the shipping recipient (e.g., Mr., Mrs., Ms.).

...

shipping_address.company_name

...

Company name of the shipping recipient.

...

shipping_address.line1

...

First line of the shipping recipient's address.

...

shipping_address.line2

...

Second line of the shipping recipient's address.

...

shipping_address.city

...

City of the shipping recipient.

...

shipping_address.state

...

State of the shipping recipient.

...

shipping_address.zip_code

...

ZIP code of the shipping recipient.

...

shipping_address.country.name

...

Country of the shipping recipient.

...

delivery_time

...

Estimated delivery time for the order.

...

is_pickup

...

Boolean flag indicating if the order is a pickup.

...

order_obj.pickup_location.location

...

Location where the order will be picked up (for pickup orders).

...

order_obj.pickup_location.instructions

...

Instructions for picking up the order.

...

Order Lines

...

order_lines

...

A list of order lines/items included in the document.

...

line.thumbnail

...

Thumbnail image of the order line.

...

line.fullName

...

Full name of the product in the order line.

...

line.offer.technology

...

Technology used for the line item (e.g., 3D printing method).

...

line.offer.material

...

Material used for the product in the order line.

...

line.prices.printPrice

...

Print price of the line item.

...

line.offer.postProcessings

...

List of post-processing options for the line item.

...

line.dimensions.w

...

Width dimension of the line item.

...

line.dimensions.h

...

Height dimension of the line item.

...

line.dimensions.d

...

Depth dimension of the line item.

...

line.measureUnit

...

Unit of measurement for the line item dimensions.

...

line.weight

...

Weight of the line item.

...

line.weightUnit

...

Unit of measurement for the line item weight.

...

line.volume

...

Volume of the line item

...

line.volumeUnit

...

Unit of measurement for volume of the line item

...

line.prices.unitPrice

...

Unit price of the line item.

...

line.prices.discount

...

Discount applied to the line item.

...

line.prices.linePrice

...

Total price for the line item.

...

line.part_requirements.fields.all

...

Additional requirements for the line item.

...

Delivered Items

...

delivered_items

...

List of delivered items for the order.

...

delivered_item.delivered

...

Quantity of the item that has been delivered.

...

Totals

...

subtotal

...

Subtotal of the order.

...

post_processings_price

...

Total cost for post-processing.

...

printing_price

...

Total printing cost.

...

fee

...

Extra fee applied to the order.

...

fees

...

List of fees associated with the order.

...

difference_to_minimum

...

Difference to the minimum price required.

...

voucher_discount

...

Discount applied through a voucher.

...

shipping_price

...

Shipping price for the order.

...

total_prices.excl_tax

...

Net total (before taxes) for the order.

...

tax_rate

...

Tax rate applied to the order.

...

tax

...

Total tax amount.

...

total_prices.incl_tax

...

Gross total (including taxes) for the order.

...

total_weight

...

Total weight of the items in the order.

...

total_weight_decimals

...

Number of decimal places to display for the total weight.

...

total_weight_unit

...

Unit of measurement for the total weight (e.g., kg, lbs).

...

Comments

...

note_data.comment

...

Additional comments related to the order.

...

Conditions

...

general_sales_conditions

...

Text containing the general sales conditions.

...

general_shipping_conditions

...

For a documentation on the variables that can be used inside order notes, see https://3yourmind.atlassian.net/wiki/x/BIAShg