Order printer does not print total sum for Switzerland.

Order printer does not print total sum for Switzerland.

Axelito1
Visitor
2 0 0

Hey there, 
i just migrated from Order Printer (Legacy) to Order Printer. I did not setup the old templates and i am not a coder. Now the invoices for my country (germany) and other european countries look fine except for switzerland.
It does'nt print the total sum and no tax line. Any body got any ideas?

 

Chatgpt asked me to check if order.total_price is giving out the right value:

<p>Order Total Price: {{ order.total_price | money }}</p>

 

i did it, but it did not show in the invoice.

 

i guess this is the relevant part:

 

***

<td class="text-center line-item-qty">× {{ line_item.quantity }}</td>
{% assign product_tax = 0.0 %}
{% for tax in line_item.tax_lines %}
{% assign per_item_tax = tax.price | divided_by: line_item.quantity %}
{% assign product_tax = product_tax | plus: per_item_tax %}
{% endfor %}
<td class="text-right no-wrap line-item-price">
{% if line_item.variant.price and line_item.variant.price > line_item.price %}
{% assign original_price = line_item.variant.price %}
{% elsif line_item.variant.compare_at_price
and line_item.variant.compare_at_price > line_item.price
%}
{% assign original_price = line_item.variant.compare_at_price %}
{% else %}
{% assign original_price = 0 %}
{% endif %}
{% if original_price > 0 and original_price > line_item.price %}
<p>
<s>{{ original_price | money }}</s>
</p>
{% endif %}
<p>{{ line_item.price | money }}</p>
</td>
<td class="text-right no-wrap line-item-line-price">{{ line_item.line_price | money }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="col-xs-8">
<div class="notes">
{% if order.note != blank or order.attributes != blank %}
<div class="notes-title editable" data-key="order_notes">Anmerkungen</div>
{% endif %}
<div class="notes-text">
{{ order.note | newline_to_br }}
</div>
</div>
</div>
<div class="col-xs-4">
<table class="pricing-table table">
<tbody>
{% for discount in order.discounts %}
<tr>
<td class="pricing-table-title">
<span class="editable" data-key="discount">Rabatt</span>
{%- if discount.title != blank %} "{{ discount.title }}"{% endif %}
</td>
<td class="pricing-table-text">{{ discount.savings | money }}</td>
</tr>
{% endfor %}
<tr>
<td class="pricing-table-title editable" data-key="subtotal">Zwischensumme</td>
<td class="pricing-table-text">{{ order.subtotal_price | money }}</td>
</tr>
<tr>
<td class="pricing-table-title editable" data-key="shipping_handling">Versand</td>
<td class="pricing-table-text">{{ order.shipping_price | default: 0 | money }}</td>
</tr>
</tr>{% for tax_line in order.tax_lines %}
<tr>
<td class="pricing-table-title">{{ tax_line.title }} ({{ tax_line.rate | times: 100}}%)
</td>
<td class="pricing-table-text">{{ tax_line.price | money }}</td>
</tr>
<td class="pricing-table-title editable" data-key="total_minus_tax">Gesamtsumme netto</td>
<td class="pricing-table-text">{{ order.total_price | minus: order.tax_price | money }}</td>
</tr>
<tr class="pricing-table-total-row">
<td class="pricing-table-title editable" data-key="total">Gesamtbetrag</td>
<td class="pricing-table-text">{{ order.total_price | money }}</td>
</tr>
</tr>
{% endfor %}
{% if order.tax_price != 0.00 and order.tax_price != blank %}
{% endif %}
</tr>
{% assign total_refunds = 0.0 %}
{% for transaction in order.transactions %}
{% if transaction.kind == 'refund' and transaction.status == 'success' %}
<tr>
<td class="pricing-table-title editable" data-key="refund">Rückerstattung</td>
<td class="pricing-table-text">-{{ transaction.amount | money }}</td>
{% assign total_refunds = total_refunds | plus: transaction.amount %}
</tr>
{% endif %}
{% endfor %}
</tbody>

 

***

 

thx

Cheers

Replies 3 (3)

PaulMartin
Shopify Partner
483 53 110

Hey.

When you install the Order Printer, there's always out-of-the-box templates, try checking if their out-of-the-box templates also doesn't show the tax lines and the total price. If it shows, that's good because you can copy how they do it and hopefully it will work for you. If not, then something is up with Shopify. 

Let me know what the results are after you check it the default templates.

Contact here for Email
$25 start rate for theme customizations
Don't forget to like and mark as solution
Axelito1
Visitor
2 0 0

Hey,

Thank you for your answer.

I use the same (one) template for all invoices of all national and international orders.

It shows the tax and the total sum for all of them except for swiss orders.

So do you think i should still test other codes of other templates?

PaulMartin
Shopify Partner
483 53 110

Yeah. Definitely try testing them, then also test this code by creating a test-template if you can:

 

<div>
  <div class="columns">
    <h1>Invoice</h1>
    <div>
      <p style="text-align: right; margin: 0;">
      Order {{ order.order_name }}<br />
      {% if order.po_number %}PO # {{ order.po_number }}<br />{% endif %}
      {{ order.created_at | date: "%B %e, %Y" }}
    </p>
  </div>
</div>
<div class="columns" style="margin-top: 1.5em;">
  <div class="address">
    <strong>From</strong><br/>
    {{ shop.name }}<br/>
    {{ shop.address | format_address }}
    {% if shop.phone %}{{ shop.phone }}{% endif %}
  </div>
  {% if order.billing_address %}
  <div class="address">
    <strong>Bill to</strong>
    {{ order.billing_address | format_address  }}
  </div>
  {% endif %}
  {% if order.shipping_address %}
  <div class="address">
    <strong>Ship to</strong>
    {{ order.shipping_address | format_address  }}
    {% if order.shipping_address.phone %}{{ order.shipping_address.phone }}{% endif %}
  </div>
  {% endif %}
</div>
<hr />
<h2>Order Details</h2>
<table class="table-tabular" style="margin: 1em 0 0 0;">
  <thead>
    <tr>
      <th>Qty</th>
      <th>Item</th>
      <th style="text-align: right;">Price</th>
    </tr>
  </thead>
  <tbody>
    {% for line_item in order.line_items %}
      <tr>
        <td>{{ line_item.quantity }}</td>
        <td>{{ line_item.title }}
        {% if line_item.line_level_discount_allocations.size > 0 %}
          <span class="subduedText">
            {% for discount_allocation in line_item.line_level_discount_allocations %}
            <br>{{ discount_allocation.discount_application.title }} (-{{ discount_allocation.amount | money }})
            {% endfor %}
          </span>
        {% endif %}
        </td>
        <td style="text-align: right;">
          {% if line_item.original_price != line_item.final_price %}
            <span class="subduedText"><s>{{ line_item.original_price | money }}</s></span>
          {% endif %}
          {{ line_item.final_price | money }}
        </td>
      </tr>
    {% endfor %}
    <tr>
      <td colspan="2" style="text-align: right;">Subtotal</td>
      <td style="text-align: right;">{{ order.line_items_subtotal_price | money }}</td>
    </tr>
    {% for discount_application in order.cart_level_discount_applications %}
    <tr>
      <td colspan="2" style="text-align: right;">{% if discount_application.title %}<span class="subduedText">{{ discount_application.title }}</span>{% endif %}</td>
      <td style="text-align: right;">-{{ discount_application.total_allocated_amount | money }}</td>
    </tr>
    {% endfor %}
    <tr>
      <td colspan="2" style="text-align: right;">Tax</td>
      <td style="text-align: right;">{{ order.tax_price | money }}</td>
    </tr>
    {% if order.shipping_address %}
      <tr>
        <td colspan="2" style="text-align: right;">Shipping</td>
        <td style="text-align: right;">{{ order.shipping_price | money }}</td>
      </tr>
    {% endif %}
    <tr>
      <td colspan="2" style="text-align: right;"><strong>Total</strong></td>
      <td style="text-align: right;"><strong>{{ order.total_price | money }}</strong></td>
    </tr>
    {% if order.net_payment != order.total_net_amount %}
      <tr>
        <td colspan="2" style="text-align: right;">Total Paid</td>
        <td style="text-align: right;">{{ order.net_payment | money }}</td>
      </tr>
    {% endif %}
    {% if order.total_refunded_amount > 0 %}
      <tr>
        <td colspan="2" style="text-align: right;">Total Refunded</td>
        <td style="text-align: right;">-{{ order.total_refunded_amount | money }}</td>
      </tr>
    {% endif %}
    {% if order.net_payment != order.total_net_amount %}
      <tr>
        <td colspan="2" style="text-align: right;"><strong>Outstanding Amount</strong></td>
        <td style="text-align: right;"><strong>{{ order.total_price | minus: order.net_payment | money }}</strong></td>
      </tr>
    {% endif %}
  </tbody>
</table>

{% if transactions.size > 1 %}
  <h2>Transaction Details</h2>
  <table class="table-tabular" style="margin: 0 0 1.5em 0;">
    <thead>
      <tr>
        <th>Type</th>
        <th>Amount</th>
        <th>Kind</th>
        <th>Status</th>
      </tr>
    </thead>
    <tbody>
      {% for transaction in transactions %}
        <tr>
          <td>{{ transaction.gateway | payment_method }}</td>
          <td>{{ transaction.amount | money }}</td>
          <td>{{ transaction.kind }}</td>
          <td>{{ transaction.status }}</td>
        </tr>
      {% endfor %}
    </tbody>
  </table>
{% endif %}

{% if order.note %}
<h2>Note</h2>
<p>{{ order.note }}</p>
{% endif %}

<p style="margin-bottom: 0;">If you have any questions, please send an email to <u>{{ shop.email }}</u></p>
</div>

 

This code is from Shopify's original template when you first install the app. Test this one out to see if the tax lines and final price gets displayed, then let me know.

Contact here for Email
$25 start rate for theme customizations
Don't forget to like and mark as solution