Displaying shipping tax in Order Printer

Nadja_Ocepek
New Member
1 0 1

Hello everyone, 

 

I hope I'm posting this in the right section of the forum. I have a question regarding Shopify’s native Order Printer app, specifically about the option of displaying shipping tax. Our store charges taxes on shipping, and what I would like to accomplish is to display the subtotal shipping cost (without the tax) besides the total shipping cost (which is displayed by default). Order Printer doesn’t seem to have an option for enabling this, and it also doesn’t display the shipping tax amount or rate. The shipping tax is simply added to the total tax amount of the whole order. The customer, therefore, has to look at the total tax amount of their entire order and that of their items, and then figure out that taxes had been applied to shipping.

 

I have read the documentation for this at https://help.shopify.com/en/themes/liquid/objects/tax_line and could not find a solution. Liquid templating language has variables like: {{ tax_line.price | money }} etc., but none of these variables are suitable for what I want to accomplish. Is there a variable for this or is there a way to use the variables to calculate the amount in a custom way?

Any help would be greatly appreciated.

Hey Nadja,

 

You are right, the Order Printer by Shopify app does not provide the tax amount charged on shipping costs. So you would need to calculate it yourself. Here's how:

 

{% assign line_item_taxes = 0.0 %}
{% for line_item in line_items %}
  {% for tax in line_item.tax_lines %}
    {% assign line_item_taxes = line_item_taxes | plus: tax.price %}
  {% endfor %}
{% endfor %}

{% assign shipping_tax = total_tax | minus: line_item_taxes %}

{{ shipping_tax | money }}

Hope it helps :)

 

Bjorn

Bjorn Forsberg | FORSBERG+two | Award-winning Shopify Apps since 2011
0 Likes
Carlotta1
New Member
2 0 0

Hello, 

I have the same problem as Nadja, could you tell me where do I have to copy and paste this code? I tried but it didn't work. Thank you

0 Likes

Hey there,

 

It really depends on your template code, and where you would like it displayed. If you attach a text file containing your current template code, then I can perhaps help get it included for you :)

 

Thanks,

Bjorn

Bjorn Forsberg | FORSBERG+two | Award-winning Shopify Apps since 2011
Carlotta1
New Member
2 0 0

Hello, I use the default code of the order printer app.

I'd need to put the shipping as an item of the list, and in the 'tax field' the summation of item taxes+ shipping taxes.

The third question is: is there a way to set the n° of the invoice automated or to modify it each time? Because I have to restart the sequence each year here in Italy and it doesn't match with the order number of the site (e.g.#34).

Thank you for your reply, I hope I explained it well, sorry for my English!

 

Here is the code:

<p style="float: right; text-align: right; margin: 0;">
{{ "now" | date: "%m/%d/%y" }}<br />
Fattura per {{ order_name }}
</p>

<div style="float: left; margin: 0 0 1.5em 0;" >
<strong style="font-size: 2em;">{{ shop_name }}</strong><br /><br />
{{ shop.address }}<br/>
{{ shop.city }} {{ shop.province_code }} {{ shop.zip | upcase }}<br/>
{{ shop.country }}
</div>

<hr />

<h3 style="margin: 0 0 1em 0;">Item Details</h3>

<table class="table-tabular" style="margin: 0 0 1.5em 0;">
<thead>
<tr>
<th>Quantity</th>
<th>Item</th>
{% if show_line_item_taxes %}
<th>Taxes</th>
{% endif %}
<th>Price</th>
</tr>
</thead>
<tbody>
{% for line_item in line_items %}
<tr>
<td>{{ line_item.quantity }} x</td>
<td><b>{{ line_item.title }}</b></td>
{% if line_item.tax_lines %}
<td>
{% for tax_line in line_item.tax_lines %}
{{ tax_line.price | money }} {{ tax_line.title }}<br/>
{% endfor %}
</td>
{% endif %}
<td>
{% if line_item.original_price != line_item.price %}
<s>{{ line_item.original_price | money }}</s>
{% endif %}
{{ line_item.price | money }}
</td>
</tr>
{% endfor %}
</tbody>
</table>

{% if transactions.size > 1 %}
<h3 style="margin: 0 0 1em 0;">Transaction Details</h3>
<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 %}

<h3 style="margin: 0 0 1em 0;">Payment Details</h3>

<table class="table-tabular" style="margin: 0 0 1.5em 0;">
<tr>
<td>Subtotal price:</td>
<td>{{ subtotal_price | money }}</td>
</tr>
{% for discount in discounts %}
<tr>
<td>Includes discount "{{ discount.code }}"</td>
<td>{{ discount.savings | money }}</td>
</tr>
{% endfor %}
<tr>
<td>Total tax:</td>
<td>{{ tax_price | money }}</td>
</tr>
{% if shipping_address %}
<tr>
<td>Shipping:</td>
<td>{{ shipping_price | money }}</td>
</tr>
{% endif %}

<tr>
<td><strong>Total price:</strong></td>
<td><strong>{{ total_price | money }}</strong></td>
</tr>
{% if total_paid != total_price %}
<tr>
<td><strong>Total paid:</strong></td>
<td><strong>{{ total_paid | money }}</strong></td>
</tr>
<tr>
<td><strong>Outstanding Amount:</strong></td>
<td><strong>{{ total_price | minus: total_paid | money }}</strong></td>
</tr>
{% endif %}
</table>

{% if note %}
<h3 style="margin: 0 0 1em 0;">Note</h3>
<p>{{ note }}</p>
{% endif %}

{% if shipping_address %}
<h3 style="margin: 0 0 1em 0;">Shipping Details</h3>

<div style="margin: 0 0 1em 0; padding: 1em; border: 1px solid black;">
<strong>{{ shipping_address.name }}</strong><br/>
{% if shipping_address.company %}
{{ shipping_address.company }}<br/>
{% endif %}
{{ shipping_address.street }}<br/>
{{ shipping_address.city }}
{{ shipping_address.province_code }}
{{ shipping_address.zip | upcase }}<br/>
{{ shipping_address.country }}
</div>
{% endif %}

<p>If you have any questions, please send an email to <u>{{ shop.email }}</u></p>

0 Likes

Hey there,

 

I checked your template code, and it already contains the "Shipping" and "Total tax" in the template:

 

 

Note: These will only appear if you have setup your Shopify admin to charge taxes and shipping on your orders. So if you are not seeing them in your documents, I would suggest double checking that they are setup correctly. The Shopify Support team can help you get it setup if needed.

 

Regarding the last part about the order number, you can do that by adjusting the order number in the code, at the end of each year.

 

Change this line of code:

 

  Fattura per {{ order_name }}

To be the following instead:

 

  Fattura per #{{ order_number | minus: 0 }}

Then adjust the 0 in above code to the number needed to reset it to 1 each year. So if your order number is currently 100, you would set it to be minus: 99 to get you back to 1.

 

Hope it helps.

 

Bjorn

Bjorn Forsberg | FORSBERG+two | Award-winning Shopify Apps since 2011
0 Likes
Elisaw
Explorer
60 2 4

@Bjorn_Forsberg_You seem to be an Order Printer expert, I was wondering if you could help me figure this out:

I want my refund template to also have a number which should be GS-order_number-1000. This is for taxing purposes. I have this code so far:
 

 

<li class="order_details">
                            <span class="order-details-title editable" data-key="number"> Refund-Nr. </span>
                            {% for transaction in refund_transactions %}
                              GS{{order_number}}-1000
                            {% endfor %}
</li>

 

 
What I need is for the "-1000" to also be variable. I need the first refund to be GS-order_number-1000, the second GS-order_number-1001, the third GS-order_number-1002, and so on. I am not sure how I can manage to make the "-1000" dynamic. Any ideas? Below is the full code of the template. I hope you can help, thank you so much!
 

 

<!-- Winter Breeze -->
<!-- Common Base Styling -->
{% assign primary_font = "Roboto"%}
{% assign primary_font_color = "#000000" %} <!-- Black text color -->
{% assign primary_font_size = "10px"%}
{% assign secondary_font = "Roboto"%}
{% assign secondary_font_color = "#333333" %} <!-- Grey text color -->
{% assign theme_color = "#000000"%}
<script type="text/javascript">
    var font1Id = 'font-{{ primary_font | replace: " ", "-" }}';
      if (!document.getElementById(font1Id)) {
        $.get("https://fonts.googleapis.com/css?family={{ primary_font | replace: " ", "+" }}:300,400,700&subset=latin-ext").done(function(response) {
          var pFontCss = response.replace(/ local\(.+?\)\,/g,"");
          var pStyle = document.createElement('style');
          var pHead = document.head || document.getElementsByTagName('head')[0];
          pStyle.type = 'text/css';
          pStyle.id = font1Id;
          if (pStyle.styleSheet){
            pStyle.styleSheet.cssText = pFontCss;
          } else {
            pStyle.appendChild(document.createTextNode(pFontCss));
          }
          pHead.appendChild(pStyle);
        });
      };
    {% if secondary_font != blank and secondary_font != primary_font %}
      var font2Id = 'font-{{ secondary_font | replace: " ", "-" }}';
      if (!document.getElementById(font1Id)) {
        $.get("https://fonts.googleapis.com/css?family={{ secondary_font | replace: " ", "+" }}:300,400,700&subset=latin-ext").done(function(response) {
          var sFontCss = response.replace(/ local\(.+?\)\,/g,"");
          var sStyle = document.createElement('style');
          var sHead = document.head || document.getElementsByTagName('head')[0];
          sStyle.type = 'text/css';
          sStyle.id = font2Id;
          if (sStyle.styleSheet){
            sStyle.styleSheet.cssText = sFontCss;
          } else {
            sStyle.appendChild(document.createTextNode(sFontCss));
          }
          sHead.appendChild(sStyle);
        });
      };
    {% endif %}
</script>
<script>
    $(function () {
         if (navigator.userAgent.indexOf('Safari') != -1 &&
         navigator.userAgent.indexOf('Chrome') == -1) {
             $("body").addClass("safari");
         }
       });
</script>
<style type="text/css">
    /* ### BASE - PAGE SIZING AND MARGIN SETUP NORMALIZATION ACROSS BROWSERS ### */
      @page {
        margin: 12mm !important;
        margin-top: 12mm !important;
        margin-right: 12mm !important;
        margin-bottom: 12mm !important;
        margin-left: 12mm !important;
      }
      @media print {
        .safari {
          padding-top: 15px;
          box-sizing: border-box;
        }
        .printer-preview-content .printer-preview-content {
          padding-left: 15px;
          padding-right: 15px;
          box-sizing: border-box;
        }
      }
      @media screen {
        .printer-preview-content {
          padding: 14px 0;
          min-height: 800px;
          /* background-image: url(http://basehold.it/i/14) */
        }
        .printer-preview-content .printer-preview-content {
          margin-right: auto;
          margin-left: auto;
          max-width: 680px;
        }
      }
      @media screen,print {
    
        /* ### BASE - TYPOGRAPHY AND REMOVAL OF STANDARD SHOPIFY STYLING ### */
        .printer-preview-content .t52949 * {
          color: {{ secondary_font_color }};
          font-family: '{{ primary_font }}';
          font-size: {{ primary_font_size }};
          font-weight: 400;
          line-height: 14px;
          text-rendering: optimizeLegibility;
          margin: 0 0 0 0;
          padding: 0 0 0 0;
          -webkit-print-color-adjust: exact;
          overflow: visible !important;
        }
        .printer-preview-content .t52949 h1 {
          font-size: 36px;
          line-height: 42px;
        }
        .printer-preview-content .t52949 h2 {
          font-size: 18px;
          line-height: 28px;
        }
        .printer-preview-content .t52949 h3 {
          font-size: 14px;
          line-height: 28px;
        }
        .printer-preview-content .t52949 h1,
        .printer-preview-content .t52949 h2,
        .printer-preview-content .t52949 h3 {
          margin-bottom: 14px;
        }
        .printer-preview-content .t52949 b,
        .printer-preview-content .t52949 b * {
          font-weight: bold;
        }
        .printer-preview-content .t52949 .text-right {
          text-align: right;
        }
        .printer-preview-content .t52949 .text-center {
          text-align: center;
        }
        .printer-preview-content .t52949 .no-wrap {
          white-space: nowrap;
        }
    
        /* ### BASE - GRID AND RE-USABLE LAYOUT COMPONENTS ### */
        .printer-preview-content .t52949 .row {
          width: 100%;
          display: block;
          clear: both;
        }
        .printer-preview-content .t52949 .row:after {
          content: "";
          display: table;
          clear: both;
        }
        .printer-preview-content .t52949 .col-xs-1,
        .printer-preview-content .t52949 .col-xs-2,
        .printer-preview-content .t52949 .col-xs-3,
        .printer-preview-content .t52949 .col-xs-4,
        .printer-preview-content .t52949 .col-xs-5,
        .printer-preview-content .t52949 .col-xs-6,
        .printer-preview-content .t52949 .col-xs-7,
        .printer-preview-content .t52949 .col-xs-8,
        .printer-preview-content .t52949 .col-xs-9,
        .printer-preview-content .t52949 .col-xs-10,
        .printer-preview-content .t52949 .col-xs-11,
        .printer-preview-content .t52949 .col-xs-12 {
          float: left;
          min-height: 1px;
          margin-bottom: 28px;
        }
        .printer-preview-content .t52949 .col-xs-12 {
          width: 100%;
        }
        .printer-preview-content .t52949 .col-xs-11 {
          width: 91.66666667%;
        }
        .printer-preview-content .t52949 .col-xs-10 {
          width: 83.33333333%;
        }
        .printer-preview-content .t52949 .col-xs-9 {
          width: 75%;
        }
        .printer-preview-content .t52949 .col-xs-8 {
          width: 66.66666667%;
        }
        .printer-preview-content .t52949 .col-xs-7 {
          width: 58.33333333%;
        }
        .printer-preview-content .t52949 .col-xs-6 {
          width: 50%;
        }
        .printer-preview-content .t52949 .col-xs-5 {
          width: 41.66666667%;
        }
        .printer-preview-content .t52949 .col-xs-4 {
          width: 33.33333333%;
        }
        .printer-preview-content .t52949 .col-xs-3 {
          width: 25%;
        }
        .printer-preview-content .t52949 .col-xs-2 {
          width: 16.66666667%;
        }
        .printer-preview-content .t52949 .col-xs-1 {
          width: 8.33333333%;
        }
        .printer-preview-content .t52949 .col-no-margin {
          margin-bottom: 0 !important;
        }
        .printer-preview-content .t52949 .clear-fix {
          clear: both;
        }
        .printer-preview-content .t52949 .half-margin-top {
          margin-top: 7px !important;
        }
        .printer-preview-content .t52949 .half-margin-bottom {
          margin-bottom: 7px !important;
        }
        .printer-preview-content .t52949 .margin-bottom {
          margin-bottom: 14px !important;
          margin-top: 1px;
        }
        .printer-preview-content .t52949 .margin-top {
          margin-top: 14px !important;
        }
        .printer-preview-content .t52949 .double-margin-top {
          margin-top: 28px !important;
        }
        .printer-preview-content .t52949 .double-margin-bottom {
          margin-bottom: 28px !important;
        }
    
        /* ### BASE - TABLE STYLING ### */
        .printer-preview-content .t52949 table,
        .printer-preview-content .t52949 .table {
          width: 100%;
          max-width: 100%;
          background-color: transparent;
          border-collapse: collapse;
        }
        .printer-preview-content .t52949 table thead {
          display: table-row-group;
        }
        .printer-preview-content .t52949 table tbody tr {
          page-break-inside:avoid !important;
          page-break-after:auto !important;
        }
        .printer-preview-content .t52949 table tbody tr td {
          page-break-inside:avoid !important;
        }
        .printer-preview-content .t52949 th {
          white-space: nowrap;
          text-align: left;
          vertical-align: middle;
          border-top: 0;
          border-bottom: 0;
        }
        .printer-preview-content .t52949 td {
          vertical-align: top;
          border-top: 0;
          border-bottom: 0;
        }
        .printer-preview-content .t52949 .order-table tbody > tr:nth-child(odd) td {
          background-color: #f9f9f9;
        }
        .printer-preview-content .t52949 .pricing-table tbody > tr:nth-child(even) > td {
          background-color: #f9f9f9;
        }
    /*    .printer-preview-content .t52949 .pricing-table tbody > tr > td.pricing-table-title {
          word-break: break-all;
        }*/
        .printer-preview-content .t52949 th.order-table-qty {
          width: 10%;
        }
        .printer-preview-content .t52949 th.order-table-price {
          width: 10%;
        }
        .printer-preview-content .t52949 th.order-table-item-total,
        .printer-preview-content .t52949 th.order-table-reason {
          width: 17%;
        }
        .printer-preview-content .t52949 th.order-table-return-comments {
          width: 30%;
        }
        .printer-preview-content .t52949 .pricing-table-text {
          text-align: right;
          white-space: nowrap;
        }
    
        /* ### BASE - PRODUCT IMAGE SIZING TO RETAIN LINE HEIGHT RYTHM) ### */
        .printer-preview-content .t52949 .product-image-wrapper {
          width: 0px;
          max-height: 0px;
        }
        .printer-preview-content .t52949 .product-image {
          padding: 0 4px;
          page-break-inside:avoid !important;
          max-width: 0px;
        }
    
        /* ### BASE - LISTS RESET ### */
        .printer-preview-content .t52949 ul {
          list-style: none;
        }
        .printer-preview-content .t52949 li {
          color: {{ secondary_font_color }};
          list-style: none;
        }
    
        /* ### BASE - LOGO ### */
        .printer-preview-content .t52949 .logo-wrapper {
          display: inline-block;
          width: 100%;
          padding-bottom: 7px;
        }
        .printer-preview-content .t52949 .logo {
          float: left;
          padding-right: 15px;
          max-width: 76%;
          max-height: 124.64px;
        }
    
        /* ### BASE - BARCODE ### */
        .printer-preview-content .t52949 .order-number-barcode,
        .printer-preview-content .t52949 .product-barcode {
          display: block;
        }
    
        /* ### BASE - ADDITONAL COMMON SHARED TYPOGRAPHY AND ALIGNMENT ### */
        .printer-preview-content .t52949 .address {
          margin-right: 5%;
        }
        .printer-preview-content .t52949 .col-xs-8 .notes,
        .printer-preview-content .t52949 .col-xs-6 .notes {
          margin-right: 20%;
        }
        .printer-preview-content .t52949 .notes-title,
        .printer-preview-content .t52949 .return-codes {
          margin: 7px 0;
        }
        /* ### BASE - HORIZONTAL RULE MARKS ### */
        .printer-preview-content .t52949 hr {
          background: {{ theme_color }};
          border-top: 0;
          border: 0;
          height: 2px;
          width: 100%;
          margin-bottom: -2px;
        }
    
      }
</style>
<!-- Template Specific Styling -->
<style type="text/css">
    @media screen,print {
    
      /* ### DESIGN SPECIFIC - TYPOGRAPHY ### */
      .printer-preview-content .t52949 h1 {
        font-family: '{{ secondary_font }}';
        color: {{ primary_font_color }};
        font-weight: bold;
      }
      .printer-preview-content .t52949 h2 {
        font-family: '{{ secondary_font }}';
        color: {{ primary_font_color }};
      }
      .printer-preview-content .t52949 h3 {
        font-family: '{{ secondary_font }}';
        color: {{ primary_font_color }};
      }
    
      /* ### DESIGN SPECIFIC - LOGO POSITIONING ### */
      .printer-preview-content .t52949 .logo {
        float: right;
        padding-right: 0;
        margin-bottom: 14px;
      }
    
      /* ### DESIGN SPECIFIC - STORE DETAILS ### */
      .printer-preview-content .t52949 .shop-block {
        text-align: center;
      }
      .printer-preview-content .t52949 .shop-block .shop-address-block b,
      .printer-preview-content .t52949 .shop-block .shop-address-block b * {
        color: {{ primary_font_color }};
      }
      .printer-preview-content .t52949 .shop-block .shop-domain {
        font-weight: bold;
      }
    
      .printer-preview-content .t52949 .shop-return-address b,
      .printer-preview-content .t52949 .shop-return-address b * {
        color: {{ primary_font_color }};
      }
    
      /* ### DESIGN SPECIFIC - ORDER DETAILS ### */
      .printer-preview-content .t52949 .order-details-title {
        display: inline-block;
        font-weight: bold;
        color: {{ primary_font_color }};
      }
    
      /* ### DESIGN SPECIFIC - BILL TO AND SHIP TO ADDRESS ### */
      .printer-preview-content .t52949 .address-title {
        font-weight: bold;
        color: {{ primary_font_color }};
      }
    
      /* ### DESIGN SPECIFIC - TABLE HEADER ### */
      .printer-preview-content .t52949 .order-table thead tr th {
        padding-left: 4px;
        padding-right: 4px;
        border-top: 2px solid {{ theme_color }};
        padding-top: 5px;
        border-bottom: 2px solid {{ theme_color }};
        padding-bottom:5px;
        font-weight: bold;
      }
    
      /* ### DESIGN SPECIFIC - TABLE BODY (SHARED) ### */
      .printer-preview-content .t52949 .order-table tbody tr td,
      .printer-preview-content .t52949 .pricing-table tbody tr td {
        padding-left: 4px;
        padding-right: 4px;
        border-top: 0;
        padding-top: 7px;
        border-bottom: 1px solid #efefef;
        padding-bottom:6px;
      }
      /* ### DESIGN SPECIFIC - ORDER TABLE SPECIFIC ### */
      .printer-preview-content .t52949 .order-table tbody > tr > td.line-item-description,
      .printer-preview-content .t52949 .order-table tbody > tr > td.line-item-qty {
        font-weight: bold;
        color: {{ primary_font_color }};
      }
      .printer-preview-content .t52949 .order-table tbody > tr > td.line-item-description p.line-item-sku {
        font-weight: normal;
      }
      /* ### DESIGN SPECIFIC - PRICING TABLE SPECIFIC ### */
      .printer-preview-content .t52949 .pricing-table tbody > tr.pricing-table-total-row > td {
        border-top: 2px solid {{ theme_color }};
        border-bottom: 2px solid {{ theme_color }};
        padding-bottom:5px;
      }
      .printer-preview-content .t52949 .pricing-table tbody > tr > td.pricing-table-title,
      .printer-preview-content .t52949 .pricing-table tbody > tr > td.pricing-table-title span {
        font-weight: bold;
        color: {{ primary_font_color }};
      }
      .printer-preview-content .t52949 .pricing-table tbody > tr.pricing-table-total-row .pricing-table-title,
      .printer-preview-content .t52949 .pricing-table tbody > tr.pricing-table-total-row .pricing-table-text {
        font-weight: bold;
        color: {{ primary_font_color }};
      }
    
      /* ### DESIGN SPECIFIC - ORDER NOTES ### */
      .printer-preview-content .t52949 .notes-title {
        font-weight: bold;
        color: {{ primary_font_color }};
      }
    
      /* ### DESIGN SPECIFIC - RETURN FORM REASON CODES ### */
      .printer-preview-content .t52949 .return-codes b,
      .printer-preview-content .t52949 .return-code b * {
        font-weight: bold;
        color: {{ primary_font_color }};
      }
    
      /* ### DESIGN SPECIFIC - THANK YOU MESSAGE ### */
      .printer-preview-content .t52949 .thanks-text {
        text-align: center;
        font-weight: bold;
        color: {{ primary_font_color }};
      }
      .printer-preview-content .t52949 .thanks-text * {
        font-weight: bold;
        color: {{ primary_font_color }};
      }
    
      /* ### DESIGN SPECIFIC - GIFT MESSAGE ### */
      .printer-preview-content .t52949 .gift-text {
        text-align: center;
        font-weight: bold;
        width: 80%;
        margin: 0 10%;
        padding-bottom:14px;
        font-size: 18px;
      }
      .printer-preview-content .t52949 .gift-text * {
        font-weight: bold;
        font-size: 18px;
      }
      .printer-preview-content .t52949 .gift-text svg {
        padding-bottom:7px;
      }
    
      /* ### DESIGN SPECIFIC - TERMS AND CONDITIONS ### */
      .printer-preview-content .t52949 .terms-text {
        font-size: 8px;
        text-align: center;
      }
      .printer-preview-content .t52949 .terms-text * {
        font-size: 8px;
      }
    
      /* ### DESIGN SPECIFIC - SOCIAL ICONS ### */
      .printer-preview-content .t52949 .social-icons {
        display: inline;
        width: 20px;
        margin: 7px 4px;
      }
   
    }
</style>
<div class="printer-preview-content" contenteditable="true" spellcheck="false" title="Click to edit text (changes will be printed but not saved)">
    <div class="t52949">
        <div class="row">
            <div id="header-row">
                <div class="col-xs-6">
                    <div class="template-title">
                        <h1 class="editable" data-key="template_type_name">GUTSCHRIFT</h1>
                    </div>
                    <ul class="order-details">
                        <li class="order_details">
                            <span class="order-details-title editable" data-key="number"> Gutschrift-Nr. </span>
                            
                            {% for transaction in refund_transactions %}
                              GS{{ order_number }}-1000
                            {% endfor %}

                        </li>
                        <li class="order-details">
                            <span class="order-details-title editable" data-key="date">  Gutschrift Datum</span>
                                {% for transaction in refund_transactions %}
                                  {{ transaction.date | date: "%d.%m.%Y" }}  
                                {% endfor %}
                        </li>
                        <li class="order-details-date">
                            <span class="order-details-title editable" data-key="date"> Bestelldatum</span>
                            <span class="order-details-text">{{ processed_at | date: "%d.%m.%Y" }}</span>
                        </li>
                        
                        {% assign transaction_text = "" %}
                        {% for transaction in transactions %}
                            {% if transaction.status != "failure" and transaction.status != "error" %}
                                {% if transaction.kind == "authorization" or transaction.kind == "sale" %}
                                    {% if transaction.payment_details.credit_card_number %}
                                        {% capture transaction_text %}{{ transaction.payment_details.credit_card_company }} ({{ transaction.payment_details.credit_card_number | replace: " ", "" | replace: "•", ""}}){% endcapture %}{% break %}
          }
        {% else %}
          {% capture transaction_text %}{{ transaction.gateway | capitalize }}{% endcapture %}{% break %}
        {% endif %}
      {% endif %}
    {% endif %}
  {% endfor %}
  {% if transaction_text != blank and transaction_text != "manual" %}
    
                        <li class="order-details-payment">
                            <span class="order-details-title editable" data-key="payment_method"> Zahlungsart</span>
                            <span class="order-details-text">{{ transaction_text }}</span>
                        </li>
                        {% endif %}
                        <li class="order-details-shipping">
                            <span class="order-details-title editable" data-key="shipping_method"> Versand</span>
                            <span class="order-details-text">{{ shipping_method.title }}</span>
                        </li>
                        </ul>
                        </div>
                                <div class="col-xs-6 col-no-margin">
                                    <div class="logo-wrapper">
                                        <img class="logo" alt="Logo" src="https://d1sv15muvzgtp9.cloudfront.net/api/file/ZSCbHOoQxiTTfjoFRZYM/convert?fit=max&h=1200&w=2400" />
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-xs-2">
                                <div class="address-title bill-to-title editable" data-key="bill_to"> Rechnungsadresse  </div>
                            </div>
                            <div class="col-xs-4">
                                <ul class="address">
                                    {% if billing_address and billing_address != blank %}
                                        <li>{{ billing_address.name }}</li>
                                        {% if billing_address.company != blank %}
                                            <li>{{ billing_address.company }}</li>
                                        {% endif %}
                                        <li>{{ billing_address.address1 }}</li>
                                        {% if billing_address.address2 != blank %}
                                            <li>{{ billing_address.address2 }}</li>
                                        {% endif %}
                                        <li>{{ billing_address.zip | upcase }} {{ billing_address.city }}</li>
                                        {% if billing_address.province_code != blank and billing_address.province != blank %}
                                            <li>{% if billing_address.province_code != blank %}{{ billing_address.province_code }}{% else %}{{ billing_address.province }}{% endif %}</li>
                                        {% endif %}
                                        {% if shop.country != billing_address.country %}
                                            <li>{{ billing_address.country }}</li>
                                        {% endif %}
                                    {% elsif customer != blank and customer.default_address != blank %}
                                        <li>{{ customer.name }}</li>
                                        {% if customer.default_address.company != blank %}
                                            <li>{{ customer.default_address.company }}</li>
                                        {% endif %}
                                        <li>{{ customer.default_address.address1 }}</li>
                                        {% if customer.default_address.address2 != blank %}
                                            <li>{{ customer.default_address.address2 }}</li>
                                        {% endif %}
                                        <li>{{ customer.default_address.zip | upcase }} {{ customer.default_address.city }}</li>
                                        {% if customer.default_address.province_code != blank and customer.default_address.province != blank %}
                                            <li>{% if customer.default_address.province_code != blank %}{{ customer.default_address.province_code }}{% else %}{{ customer.default_address.province }}{% endif %}</li>
                                        {% endif %}
                                        {% if shop.country != customer.default_address.country %}
                                            <li>{{ customer.default_address.country }}</li>
                                        {% endif %}
                                    {% elsif customer != blank %}
                                        {% if customer.name != blank %}
                                            <li>{{ customer.name }}</li>
                                        {% endif %}
                                        {% if customer.email != blank %}
                                            <li>{{ customer.email }}</li>
                                        {% endif %}
                                    {% endif %}
                                </ul>
                            </div>
                            <div class="col-xs-2">
                                {% if shipping_address and shipping_address != "" and shipping_address != nil %}
                                    <div class="address-title ship-to-title editable" data-key="ship_to"> Versandadresse  </div>
                                {% endif %}
                            </div>
                            <div class="col-xs-4">
                                <ul class="address">
                                    {% if shipping_address and shipping_address != blank %}
                                        <li>{{ shipping_address.name }}</li>
                                        {% if shipping_address.company != blank %}
                                            <li>{{ shipping_address.company }}</li>
                                        {% endif %}
                                        <li>{{ shipping_address.address1 }}</li>
                                        {% if shipping_address.address2 != blank %}
                                            <li>{{ shipping_address.address2 }}</li>
                                        {% endif %}
                                        <li>{{ shipping_address.zip | upcase }} {{ shipping_address.city }}</li>
                                        {% if shipping_address.province_code != blank and shipping_address.province != blank %}
                                            <li>{% if shipping_address.province_code != blank %}{{ shipping_address.province_code }}{% else %}{{ shipping_address.province }}{% endif %}</li>
                                        {% endif %}
                                        {% if shop.country != shipping_address.country %}
                                            <li>{{ shipping_address.country }}</li>
                                        {% endif %}
                                    {% endif %}
                                </ul>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-xs-12 col-no-margin">
                                <table class="order-table table">
                                    <thead>
                                        <tr>
                                            <th class="order-table-title editable" data-key="item">Artikel</th>
                                            <th class="order-table-qty text-center editable" data-key="qty">Stckz.</th>
                                            <th class="order-table-price text-right editable" data-key="price">Preis</th>
                                            <th class="order-table-item-total text-right editable" data-key="item_total">Gesamtbetrag</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <!-- Bold Product Options Snippet 1 -->
                                        {% assign hidden_variant_ids = "" %}
                                        {% for line_item in line_items %}
                                            {% if line_item.properties._boldVariantIds %}
                                                {% assign hidden_variant_ids = hidden_variant_ids | append: ',' %}
                                                {% assign hidden_variant_ids = hidden_variant_ids | append: line_item.properties._boldVariantIds %}
                                            {% endif %}
                                        {% endfor %}
                                        {% assign hidden_variant_ids = hidden_variant_ids | split: ',' %}
                                        <!-- END Bold Product Options Snippet 1 -->
                                        {% for line_item in line_items %}
                                            {% assign non_refunded_quantity = line_item.quantity %}
                                            <!-- Bold Product Options Snippet 2 -->
                                            {% if hidden_variant_ids contains line_item.variant_id %}{% continue %}{% endif %}
                                            {% assign adjusted_item_price = line_item.price %}
                                            {% assign adjusted_line_price = line_item.price | times: non_refunded_quantity %}
                                            {% for line_item2 in line_items %}
                                                {% if line_item.properties._boldVariantIds contains line_item2.variant_id %}
                                                    {% assign adjusted_item_price = adjusted_item_price | plus: line_item2.price %}
                                                    {% assign adjusted_line_option_price = line_item2.price | times: non_refunded_quantity %}
                                                    {% assign adjusted_line_price = adjusted_line_price | plus: adjusted_line_option_price %}
                                                {% endif %}
                                            {% endfor %}
                                            <!-- END Bold Product Options Snippet 2 -->
                                            <tr>
                                                <td class="line-item-description">
                                                    <p style="font-weight: 700;">
                                                        {{ line_item.title | replace: " - Default Title", "" }}</p>
                                                    {% if line_item.sku != blank %}
                                                        <p class="line-item-sku">{{ line_item.sku }}</p>
                                                    {% endif %}
                                                    {% for p in line_item.properties %}
                                                        {% assign p_internal = p.first | slice: 0 %}
                                                        {% unless p.first contains "builder_id" or p.first contains "builder_info" or p.first contains "master_builder" or p_internal == "_" or p.last == "" or p.last == blank %}
                                                            {% if p.last contains "/uploads/" or p.last contains ".png?" or p.last contains ".jpg?" %}
                                                                <p class="line-item-property">{{ p.first }}:<br>
                                                                </p>
                                                                <a href="{{ p.last }}" target="_blank"><img src="{{ p.last }}" alt="{{ p.first }}" width="60" border="0" style="width: 60px; height: auto !important;"></a>
                                                            {% else %}
                                                                <p class="line-item-property">{{ p.first }}: {{ p.last }}</p>
                                                            {% endif %}
                                                        {% endunless %}
                                                    {% endfor %}
                                                </td>
                                                <td class="text-center line-item-qty">× {{ non_refunded_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 > adjusted_item_price %}
                                                        {% assign original_price = line_item.variant.price %}
                                                    {% elsif line_item.variant.compare_at_price and line_item.variant.compare_at_price > adjusted_item_price %}
                                                        {% assign original_price = line_item.variant.compare_at_price %}
                                                    {% else %}
                                                        {% assign original_price = 0 %}
                                                    {% endif %}
                                                    {% if original_price > 0 and original_price > adjusted_item_price %}
                                                        <p><s>{{ original_price | money }}</s></p>
                                                    {% endif %}
                                                    <p>{{ adjusted_item_price | money }}</p>
                                                </td>
                                                <td class="text-right no-wrap line-item-line-price">{{ adjusted_line_price | money }}</td>
                                            </tr>
                                        {% endfor %}
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-xs-8">
                                <div class="notes">
                                    {% if note != blank or attributes != blank %}
                                        <div class="notes-title editable" data-key="order_notes">Anmerkungen</div>
                                    {% endif %}
                                    <div class="notes-text">
                                        {{ note | newline_to_br }}
                                    </div>
                                </div>
                            </div>
                            <div class="col-xs-4">
                                <table class="pricing-table table">
                                    <tbody>
                                        {% assign order_discounts = 0.00 %}
                                        {% for discount in discounts %}
                                            {% assign order_discounts = order_discounts | plus: discount.amount %}
                                        {% endfor %}
                                        {% if discounts != blank or order_discounts != 0.00 %}
                                            <tr>
                                                <td class="pricing-table-title editable" data-key="subtotal">Zwischensumme</td>
                                                <td class="pricing-table-text">{{ subtotal_price | plus: order_discounts | money }}</td>
                                            </tr>
                                            {% for discount in discounts %}
                                                <tr>
                                                    <td class="pricing-table-title"><span class="editable" data-key="discount">Rabatt</span>{% if discount.code != blank %} "{{ discount.code }}"{% endif %}</td>
                                                        <td class="pricing-table-text">{{ discount.savings | money }}</td>
                                                    </tr>
                                                {% endfor %}
                                            {% else %}
                                                <tr>
                                                    <td class="pricing-table-title editable" data-key="subtotal">Zwischensumme</td>
                                                    <td class="pricing-table-text">{{ subtotal_price | money }}</td>
                                                </tr>
                                            {% endif %}
                                            <tr>
                                                <td class="pricing-table-title editable" data-key="shipping_handling">Versand</td>
                                                <td class="pricing-table-text">{{ shipping_price | default: 0 | money }}</td>
                                            </tr>
                                            <tr>
                                                <td class="pricing-table-title editable" data-key="total_minus_tax">Gesamtsumme netto</td>
                                                <td class="pricing-table-text">{{ total_price | minus: total_tax | money }}</td>
                                            </tr>
                                            {% for tax_line in 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>
                                            {% endfor %}
                                            <tr class="pricing-table-total-row">
                                                <td class="pricing-table-title editable" data-key="total">Gesamtbetrag</td>
                                                <td class="pricing-table-text">{{ total_price | money }}</td>
                                            </tr>
                                            {% assign total_refunds =  0.0 %}
                                            {% for transaction in 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>
                                    </table>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-xs-12 margin-bottom">
                                    <div class="thanks-text full-editable" data-key="thanks">
                                        <p>
                                            <p>
                                            </p>
                                            <p><br>
                                            </p>
                                            <p><br>
                                            </p>
                                            <p><br>
                                            </p>
                                            <p><br>
                                            </p>
                                            <p><br>
                                            </p>
                                            <p><br>
                                            </p>
                                            <p><br>
                                            </p>
                                            <p><br>
                                            </p>
                                            <p><br>
                                            </p>
                                            <p><br>
                                            </p>
                                            <p>Vielen Dank für Ihren Einkauf!</p>
                                            <p></p>
                                        </p>
                                    </div>
                                    <div class="terms-text full-editable" data-key="terms_and_conditions">
                                        <p>Bitten lassen Sie es uns wissen, falls Sie irgendwelche Fragen haben.</p>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-xs-12 shop-block col-no-margin">
                                    <div class="shop-address-block full-editable" data-key="shop_block">
                                        <p><b>TARTAR</b> <b>Ledermanufaktur</b></p>
                                        <p>Mayer & Ojurovic GbR, Genslerstr. 13A, 13055 Berlin</p>
                                        <p>kontakt@tartar-berlin.com | Ust-IdNr.: DE 316294519</p>
                                        <p>Commerzbank, IBAN: DE53 1004 0000 0420 1208 00, BIC: COBADEFFXXX</p>
                                    </div>
                                    <div class="shop-domain editable" data-key="shop_domain">
                                        tartar-berlin.com

                                    </div>
                                    <div class="shop-social">
                                        <img class="social-icons" src="https://cdn.shopify.com/s/files/1/0398/5025/files/Fb_icon.jpg?11755453313570768267"/>
                                        <img class="social-icons" src="https://cdn.shopify.com/s/files/1/0398/5025/files/instagram_9.png?576915513262272927"/>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

 

0 Likes

Hey @Elisaw ,

Unfortunately there is no way to do this dynamically, based on the refunds. This issues is that there is no sequential number that counts how many refunds have been made in your account in the past, so we have no way of knowing what number to show automatically. The order number counts upwards automatically, but there is nothing similar for refunds

Sorry for the bad news!

Kind regards,

Bjorn

Bjorn Forsberg | FORSBERG+two | Award-winning Shopify Apps since 2011
0 Likes
Elisaw
Explorer
60 2 4

HI @Bjorn_Forsberg_  Thank you so much for getting back to me! That is a shame. Do you know if there is another App that is able to do this? For example Order Printer Pro?

0 Likes

You are very welcome @Elisaw . Unfortuntely not, it also doesn't have any way to store or calculate how many refunds your account has had in the past

Bjorn Forsberg | FORSBERG+two | Award-winning Shopify Apps since 2011
0 Likes