Account

Report Invoice Document

ID: mint_system.account.report_invoice_document.add_header_and_footer_note

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//table[@id='info']" position="after">
    <t t-if="o.note_header != '&lt;p&gt;&lt;br&gt;&lt;/p&gt;'">
      <span class="note" t-field="o.note_header"/>
    </t>
  </xpath>

  <xpath expr="//table[2]" position="after">
    <t t-if="o.note_footer != '&lt;p&gt;&lt;br&gt;&lt;/p&gt;'">
      <span class="note" t-field="o.note_footer"/>
    </t>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.add_header_and_footer_note.xmlopen in new window

Add Header Padding

ID: mint_system.account.report_invoice_document.add_header_padding

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//h2" position="attributes">
    <attribute name="style">padding-top: 2rem</attribute>
	</xpath>

</data>

Source: snippets/account.report_invoice_document.add_header_padding.xmlopen in new window

Add Header Space

ID: mint_system.account.report_invoice_document.add_header_space

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

	<xpath expr="//h2" position="attributes">
		 <attribute name="style">padding-top: 5rem</attribute>
	</xpath>

</data>

Source: snippets/account.report_invoice_document.add_header_space.xmlopen in new window

Add Iban

ID: mint_system.account.report_invoice_document.add_iban

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <!-- Odoo 14.0 -->
  <xpath expr="/t/t/div/p[2]" position="after">
      <div class="row">
      <div class="col">
          <span>IBAN: </span>
          <span t-field="o.partner_bank_id.acc_number"/>
      </div>
      </div>
  </xpath>
  <xpath expr="/t/t/div/div[3]" position="after">
      <div class="row">
      <div class="col">
          <span>Bank/BIC: </span>
          <span t-field="o.partner_bank_id.bank_id.display_name"/>
          <br/>
          <br/>
      </div>
      </div>
  </xpath>

  <!-- Odoo 13.0 -->
  <!-- <xpath expr="/t/t/div/p[2]" position="after">
      <div class="row">
      <div class="col">
          <span>IBAN: </span>
          <span t-field="o.invoice_partner_bank_id.acc_number"/>
      </div>
      </div>
  </xpath>
  <xpath expr="/t/t/div/div[3]" position="after">
      <div class="row">
      <div class="col">
          <span>Bank/BIC: </span>
          <span t-field="o.invoice_partner_bank_id.bank_id.display_name"/>
          <br/>
          <br/>
      </div>
      </div>
  </xpath> -->

</data>

Source: snippets/account.report_invoice_document.add_iban.xmlopen in new window

Add Percentage Sign

ID: mint_system.account.report_invoice_document.add_percentage_sign

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

<xpath expr="//span[@t-field='line.discount']" position="replace">
    <span t-field="line.discount"/>%
  </xpath>

</data>

Source: snippets/account.report_invoice_document.add_percentage_sign.xmlopen in new window

Add Salesperson

ID: mint_system.account.report_invoice_document.add_salesperson

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="/t/t/div/div[1]/div[1]" position="after">
    <div class="col-3 bm-2" t-if="o.invoice_user_id" name="invoice_user_id">
      <strong>Contact:</strong>
      <p class="m-0" t-field="o.invoice_user_id.email"/>
      <p class="m-0" t-field="o.invoice_user_id.phone"/>
    </div>
  </xpath>

  <!-- <xpath expr="/t/t/div/div[1]/div[1]" position="after">
    <div class="col-auto mw-100 mb-2" t-if="o.invoice_user_id" name="invoice_user_id">
      <strong>Contact:</strong>
      <p class="m-0" t-field="o.invoice_user_id.email"/>
      <p class="m-0" t-field="o.invoice_user_id.phone"/>
    </div>
  </xpath> -->

  <!-- <xpath expr="/t/t/div/div[1]/div[1]" position="after">
    <div class="col-auto mw-100 mb-2" t-if="o.invoice_user_id" name="invoice_user_id">
      <strong>Salesperson:</strong>
      <p class="m-0" t-field="o.invoice_user_id.name"/>
    </div>
  </xpath> -->

</data>

Source: snippets/account.report_invoice_document.add_salesperson.xmlopen in new window

Align Taxes

ID: mint_system.account.report_invoice_document.align_taxes

<?xml version="1.0"?>
<!-- Align invoice tax row right -->
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//th[@name='th_taxes']" position="attributes">
    <attribute name="t-attf-class" separator=" " remove="text-right" add="text-right" />
  </xpath>

  <xpath expr="//span[@id='line_tax_ids']/.." position="attributes">
    <attribute name="t-attf-class" separator=" " remove="text-right" add="text-right" />
  </xpath>

</data>

Source: snippets/account.report_invoice_document.align_taxes.xmlopen in new window

Bank Account

ID: mint_system.account.report_invoice_document.bank_account

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="/t/t/div/p[2]" position="after">
    <t t-if="o.currency_id.name=='CHF'">
        <t t-set="account" t-value="o.company_id.bank_ids.browse(13)"/>
    </t>
    <t t-if="o.currency_id.name=='EUR'">
        <t t-set="account" t-value="o.company_id.bank_ids.browse(14)"/>
    </t>
    <t t-if="o.currency_id.name=='USD'">
        <t t-set="account" t-value="o.company_id.bank_ids.browse(15)"/>
    </t>
    <div class="row">
      <div class="col">
        <span>IBAN: </span>
        <span t-field="account.acc_number"/>
        <br/>
        <span>Bank/BIC: </span>
        <span t-field="account.bank_id.display_name"/>
        <br/>
        <br/>
      </div>
    </div>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.bank_account.xmlopen in new window

Custom Taxes

ID: mint_system.account.report_invoice_document.custom_taxes

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//th[@name='th_taxes']" position="replace">
  	<th name="th_taxes" t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"><span>Steuern</span></th>
  </xpath>
  <xpath expr="//t[@name='account_invoice_line_accountable']/td[5]" position="replace">
  	<td t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
  		<span t-esc="', '.join(map(lambda x: (x.description or x.name), line.tax_ids))" id="line_tax_ids"/>
  	</td>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.custom_taxes.xmlopen in new window

Display Shipping Address

ID: mint_system.account.report_invoice_document.display_shipping_address

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="/t/t/t" position="after">
    <t t-if="o.partner_shipping_id">
      <t t-set="information_block">
        <strong>Shipping address:</strong>
        <div t-if="o.partner_shipping_id" style="margin-bottom: 1rem;">
          <div t-field="o.partner_shipping_id" t-options="{'widget': 'contact', 'fields': ['address', 'name'], 'no_marker': True, 'phone_icons': True}" name="invoice_shipping_address"/>
        </div>
      </t>
    </t>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.display_shipping_address.xmlopen in new window

Font Size

ID: mint_system.account.report_invoice_document.font_size

<?xml version="1.0"?>
<!-- Change default font size -->
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//div[hasclass('page')]" position="inside">
		<style>
			body {
				font-size: 0.9rem;
			}
		</style>
	</xpath>

</data>

Source: snippets/account.report_invoice_document.font_size.xmlopen in new window

Format Address Blocks

ID: mint_system.account.report_invoice_document.format_address_blocks

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//t[@t-set='address']/div" position="attributes">
    <attribute name="style">font-size:10pt; line-height: 1.2; padding-bottom:33mm</attribute>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.format_address_blocks.xmlopen in new window

Format Pos

ID: mint_system.account.report_invoice_document.format_pos

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//t[@t-if='o.sale_order_id']/td" position="attributes">
    <attribute name="style">text-align: right; width: 5mm</attribute>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.format_pos.xmlopen in new window

Format Qty With Decimal

ID: mint_system.account.report_invoice_document.format_qty_with_decimal

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

	<xpath expr="//span[@id='qty']" position="replace">
		<t t-if="line.product_uom_id.id == 1">
			<span id="qty" t-field="line.quantity" t-options="{'widget': 'integer'}"/>
		</t>
		<t t-else="">
			<span id="qty" t-field="line.quantity"/>
		</t>
	</xpath>

</data>

Source: snippets/account.report_invoice_document.format_qty_with_decimal.xmlopen in new window

Format Title

ID: mint_system.account.report_invoice_document.format_title

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//h2" position="attributes">
    <attribute name="style">color: black; font-size:13pt; font-weight:bold; margin-top:10mm; margin-bottom:3mm</attribute>
  </xpath>
  
</data>

Source: snippets/account.report_invoice_document.format_title.xmlopen in new window

Get Position

ID: mint_system.account.report_invoice_document.get_position

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">
  
  <xpath expr="//table/thead/tr/th[1]" position="before">
    <t t-if="o.sale_order_id">
      <th id="position">
        <span>Pos</span>
      </th>
    </t>
    <t t-if="o.invoice_line_ids.purchase_line_id">
      <th id="position">
        <span>Pos</span>
      </th>
    </t>
  </xpath>
  
  <!--
  <xpath expr="//table/tbody/t[3]/tr/t[1]/td[1]" position="before">
    <t t-if="o.sale_order_id">
      <td id="position">
        <span t-esc="line.position"/>
      </td>
    </t>
    <t t-if="line.purchase_order_id">
      <td id="position">
        <span t-esc="line.position"/>
      </td>
    </t>
  </xpath>
  -->

    <xpath expr="//span[@t-field='line.name']/.." position="before">
    <t t-if="o.sale_order_id">
      <td id="position">
        <span t-esc="line.position"/>
      </td>
    </t>
    <t t-if="line.purchase_order_id">
      <td id="position">
        <span t-esc="line.position"/>
      </td>
    </t>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.get_position.xmlopen in new window

Group By Pickings

ID: mint_system.account.report_invoice_document.group_by_pickings

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//h2" position="before">
    <!-- Get all pickings without duplicates -->
    <t t-set="pickings" t-value="list(set(o.invoice_line_ids.picking_ids.filtered(lambda p: p.state != 'cancel')))"/>
    <!-- Store if has pickings -->
    <t t-set="has_pickings" t-value="len(pickings) > 0"/>
    <!-- Store if has multiple pickings -->
    <t t-set="has_multiple_pickings" t-value="len(pickings) > 1"/>
    <!-- Store if has lines without pickings -->
    <t t-set="has_lines_without_pickings" t-value="len(o.invoice_line_ids.filtered(lambda l: not l.picking_ids)) > 0"/>
  </xpath>
  
  <xpath expr="//h2/span[1]" position="replace">
    <span t-if="o.move_type == 'out_invoice' and o.state == 'posted' and not has_multiple_pickings">Rechnung</span>
    <span t-if="o.move_type == 'out_invoice' and o.state == 'posted' and has_multiple_pickings">Sammelrechnung</span>
  </xpath>

  <xpath expr="//t[@t-foreach='lines']" position="replace">

    <!-- Add empty picking if there are lines without pickings -->
    <t t-if="not has_pickings or has_lines_without_pickings">
      <t t-set="null" t-value="pickings.append(False)"/>
    </t>

    <!--<p t-esc="pickings"/> -->
    <!-- <p t-esc="has_pickings"/> -->
    <!-- <p t-esc="has_multiple_pickings"/> -->
    <!-- <p t-esc="has_lines_without_pickings"/> -->

    <t t-foreach="pickings" t-as="picking">
      <tr t-if="has_pickings and picking" class="o_line_note">
        <td colspan="99" style="padding-top: 1rem;" >
          <strong><span>Lieferung </span><span t-esc="picking.name.replace('WH/OUT/','')"/></strong>
          <!--<strong><span>Lieferung </span><span t-esc="picking.name.replace('WH/OUT/','')"/><span> / Bestellung </span><span t-esc="picking.group_id.name"/></strong>-->
          <span> vom </span>
          <span t-esc="picking.scheduled_date" t-options="{'widget': 'date'}"/><span>:</span>
        </td>
      </tr>
      <tr t-if="not picking" class="o_line_note">
        <td colspan="99" style="padding-top: 1rem;">
          <strong>
            <span>Weitere Positionen: </span>
          </strong>
        </td>
      </tr>
      <t t-foreach="lines" t-as="line">

        <!-- Show line if picking is set and linked or not picking is set and line is unlinked  -->
        <t t-if="(picking and picking in line.picking_ids) or (not line.picking_ids and not picking)">

          <t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/>
          <t t-set="current_subtotal" t-value="current_subtotal + line.price_total" groups="account.group_show_line_subtotals_tax_included"/>

          <tr t-att-class="'bg-200 font-weight-bold o_line_section' if line.display_type == 'line_section' else 'font-italic o_line_note' if line.display_type == 'line_note' else ''">
            <t t-if="not line.display_type" name="account_invoice_line_accountable">
              <td name="account_invoice_line_name">
                <span t-field="line.name" t-options="{'widget': 'text'}"/>
              </td>
              <td class="text-right">
                <span t-field="line.quantity"/>
                <span t-field="line.product_uom_id" groups="uom.group_uom"/>
              </td>
              <td t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
                <span class="text-nowrap" t-field="line.price_unit"/>
              </td>
              <td t-if="display_discount" t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
                <span class="text-nowrap" t-field="line.discount"/>
              </td>
              <td t-attf-class="text-left {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
                <span t-esc="', '.join(map(lambda x: (x.description or x.name), line.tax_ids))" id="line_tax_ids"/>
              </td>
              <td class="text-right o_price_total">
                <span class="text-nowrap" t-field="line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/>
                <span class="text-nowrap" t-field="line.price_total" groups="account.group_show_line_subtotals_tax_included"/>
              </td>
            </t>
            <t t-if="line.display_type == 'line_section'">
              <td colspan="99">
                <span t-field="line.name" t-options="{'widget': 'text'}"/>
              </td>
              <t t-set="current_section" t-value="line"/>
              <t t-set="current_subtotal" t-value="0"/>
            </t>
            <t t-if="line.display_type == 'line_note'">
              <td colspan="99">
                <span t-field="line.name" t-options="{'widget': 'text'}"/>
              </td>
            </t>
          </tr>

          <t t-if="current_section and (line_last or lines[line_index+1].display_type == 'line_section')">
            <tr class="is-subtotal text-right">
              <td colspan="99">
                <strong class="mr16">Subtotal</strong>
                <span t-esc="current_subtotal" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.currency_id}"/>
              </td>
            </tr>
          </t>

        </t>
      </t>
      <tr t-if="picking and picking.sale_id.note" class="o_line_note">
        <td colspan="99" style="padding-bottom: 1rem;" >
          <span t-esc="picking.sale_id.note"/>
        </td>
      </tr>
    </t>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.group_by_pickings.xmlopen in new window

Group By Sale Order

ID: mint_system.account.report_invoice_document.group_by_sale_order

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//h2" position="before">
    <!-- Get all sale orders without duplicates -->
    <t t-set="sale_orders" t-value="list(set([line.order_id for line in o.invoice_line_ids.sale_line_ids]))"/>
    <!-- Store if has sale orders -->
    <t t-set="has_sale_orders" t-value="len(sale_orders) > 0"/>
    <!-- Store if has multiple sale orders -->
    <t t-set="has_multiple_sale_orders" t-value="len(sale_orders) > 1"/>
    <!-- Store if has lines without sale orders -->
    <t t-set="has_lines_without_sale_orders" t-value="len(o.invoice_line_ids.filtered(lambda l: not l.sale_line_ids)) > 0"/>
  </xpath>

  <xpath expr="//h2/span[1]" position="replace">
    <span t-if="o.move_type == 'out_invoice' and o.state == 'posted' and not has_multiple_sale_orders">Rechnung</span>
    <span t-if="o.move_type == 'out_invoice' and o.state == 'posted' and has_multiple_sale_orders">Sammelrechnung</span>
  </xpath>

  <xpath expr="//t[@t-foreach='lines']" position="replace">

    <!-- Add empty sale order if there are lines without sale orders -->
    <t t-if="not has_sale_orders or has_lines_without_sale_orders">
      <t t-set="null" t-value="sale_orders.append(False)"/>
    </t>

    <!-- <p t-esc="sale_orders"/> -->
    <!-- <p t-esc="has_sale_orders"/> -->
    <!-- <p t-esc="has_multiple_sale_orders"/> -->
    <!-- <p t-esc="has_lines_without_sale_orders"/> -->
    
    <t t-foreach="sale_orders" t-as="sale_order">
      <tr t-if="has_sale_orders and sale_order" class="o_line_note">
        <td colspan="99" style="padding-top: 1rem;">
          <strong>
            <span>Verkaufsauftrag </span>
            <span t-esc="sale_order.name"/>
            <span t-if="sale_order.client_order_ref">/</span>
            <span t-if="sale_order.client_order_ref" t-esc="sale_order.client_order_ref"/>
            <span> vom </span>
            <span t-esc="sale_order.date_order" t-options="{'widget': 'date'}"/><span>:</span>
          </strong>
        </td>
      </tr>
      <tr t-if="not sale_order" class="o_line_note">
        <td colspan="99" style="padding-top: 1rem;">
          <strong>
            <span>Weitere Positionen: </span>
          </strong>
        </td>
      </tr>
      <t t-foreach="lines" t-as="line">

        <!-- Show line if sale order is set and linked or not sale order is set and line is unlinked  -->
        <t t-if="(sale_order and sale_order in line.sale_line_ids.order_id) or (not line.sale_line_ids and not sale_order)">

          <t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/>
          <t t-set="current_subtotal" t-value="current_subtotal + line.price_total" groups="account.group_show_line_subtotals_tax_included"/>

          <tr t-att-class="'bg-200 font-weight-bold o_line_section' if line.display_type == 'line_section' else 'font-italic o_line_note' if line.display_type == 'line_note' else ''">
            <t t-if="not line.display_type" name="account_invoice_line_accountable">
              <td name="account_invoice_line_name">
                <span t-field="line.name" t-options="{'widget': 'text'}"/>
              </td>
              <td class="text-right">
                <span t-field="line.quantity"/>
                <span t-field="line.product_uom_id" groups="uom.group_uom"/>
              </td>
              <td t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
                <span class="text-nowrap" t-field="line.price_unit"/>
              </td>
              <td t-if="display_discount" t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
                <span class="text-nowrap" t-field="line.discount"/>
              </td>
              <td t-attf-class="text-left {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
                <span t-esc="', '.join(map(lambda x: (x.description or x.name), line.tax_ids))" id="line_tax_ids"/>
              </td>
              <td class="text-right o_price_total">
                <span class="text-nowrap" t-field="line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/>
                <span class="text-nowrap" t-field="line.price_total" groups="account.group_show_line_subtotals_tax_included"/>
              </td>
            </t>
            <t t-if="line.display_type == 'line_section'">
              <td colspan="99">
                <span t-field="line.name" t-options="{'widget': 'text'}"/>
              </td>
              <t t-set="current_section" t-value="line"/>
              <t t-set="current_subtotal" t-value="0"/>
            </t>
            <t t-if="line.display_type == 'line_note'">
              <td colspan="99">
                <span t-field="line.name" t-options="{'widget': 'text'}"/>
              </td>
            </t>
          </tr>

          <t t-if="current_section and (line_last or lines[line_index+1].display_type == 'line_section')">
            <tr class="is-subtotal text-right">
              <td colspan="99">
                <strong class="mr16">Subtotal</strong>
                <span t-esc="current_subtotal" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.currency_id}"/>
              </td>
            </tr>
          </t>

        </t>
      </t>
    </t>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.group_by_sale_order.xmlopen in new window

Margin After Title

ID: mint_system.account.report_invoice_document.margin_after_title

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//h2" position="attributes">
    <attribute name="style" separator=";" add="margin-bottom: 1rem"/>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.margin_after_title.xmlopen in new window

Margin Before Invoice Table

ID: mint_system.account.report_invoice_document.margin_before_invoice_table

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <table name="invoice_line_table" position="attributes">
    <attribute name="style" separator=";" add="margin-top: 1rem"/>
  </table>

</data>

Source: snippets/account.report_invoice_document.margin_before_invoice_table.xmlopen in new window

Margin Before Title

ID: mint_system.account.report_invoice_document.margin_before_title

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//h2" position="attributes">
    <attribute name="style" separator=";" add="margin-top: 1rem"/>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.margin_before_title.xmlopen in new window

Modify Main Table

ID: mint_system.account.report_invoice_document.modify_main_table

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <!-- add default_code   -->
  <xpath expr="//table[@class='table table-sm o_main_table']/thead/tr/th[1]" position="before">
    <th style="text-align: right; width: 27mm; padding-right: 10px">
      <span>Part No.</span>
    </th>
  </xpath>
  <xpath expr="//table[@class='table table-sm o_main_table']/tbody/t/tr/t[1]/td[1]" position="before">
    <td style="text-align: right; padding-right: 10px">
      <span t-field="line.product_id.default_code" />
    </td>
  </xpath>

  <!-- Header desriptin -->
  <xpath expr="//table[@class='table table-sm o_main_table']/thead/tr/th[2]" position="attributes">
    <attribute name="style">width: 70mm</attribute>
  </xpath>

  <!-- add delivery date -->
  <xpath expr="//table[@class='table table-sm o_main_table']/thead/tr/th[3]" position="before">
    <th style="text-align: right; width: 27mm; padding-right: 10px">
      <span></span>
    </th>
  </xpath>
  <xpath expr="//table[@class='table table-sm o_main_table']/tbody/t/tr/t[1]/td[3]" position="before">
    <td style="text-align: right; padding-right: 10px"></td>
  </xpath>

  <xpath expr="//td[@name='account_invoice_line_name']" position="replace">
    <td>
      <span style="font-weight: bold" t-field="line.product_id.type_description" />
    </td>
  </xpath>

  <!-- add second row -->
  <xpath expr="//table[@class='table table-sm o_main_table']/tbody//tr[1]" position="after">
    <tr>
      <td style="padding-bottom :10px; padding-left:3px; line-height: 1.2"></td>
      <td style="padding:0; padding-left:3px; line-height: 1.2"></td>
      <td style="padding:0; padding-left:3px; line-height: 1.2" colspan="4">
        <span t-field="line.sale_line_ids.name" />
        <br />
        <t t-if="line.product_id.country_of_origin_id.code and line.product_id.hs_code">
          Country of origin:
          <span t-esc="line.product_id.country_of_origin_id.code" />
          / HS Code:
          <span t-esc="line.product_id.hs_code" />
          <br />
        </t>

        <t t-if="line.product_id.hs_code and not line.product_id.country_of_origin_id.code">
          HS Code:
          <span t-esc="line.product_id.hs_code" />
        </t>

        <t t-if="line.product_id.country_of_origin_id.code and not line.product_id.hs_code">
          Country of origin:
          <span t-esc="line.product_id.country_of_origin_id.code" />
        </t>
      </td>

      <td></td>
    </tr>
    <tr style="border-bottom: 1px solid rgb(220,220,220)">
      <td colspan="8"></td>
    </tr>
  </xpath>

  <!-- format main_table -->
  <xpath expr="//table[@class='table table-sm o_main_table']" position="attributes">
    <attribute name="style">width: 100%; font-size:9pt</attribute>
    <attribute name="class">table table-borderless table-sm</attribute>
  </xpath>

  <!-- header-->
  <xpath expr="//table[@class='table table-borderless table-sm']/thead/tr" position="attributes">
    <attribute name="style">border-top:solid 1px; border-bottom: solid 1px; color: black;</attribute>
  </xpath>

  <xpath expr="//table[@name='invoice_line_table']" position="after">

    <table class="table table-borderless table-sm" style="margin-top:20px; width:100%; color:black; font-family: arial; font-size:9pt; border-top-style:solid; border-bottom-style:solid; border-width:1px; border-color:black">
      <t t-if="o.note_footer != '&lt;p&gt;&lt;br&gt;&lt;/p&gt;'">
        <span class="note" t-field="o.note_footer" />
      </t>
      <t t-foreach="o.amount_by_group" t-as="amount_by_group">
        <tr>
          <td style="width:15.5%; text-align:left">
            <Strong>Warenwert</Strong>
          </td>
          <td style="width:23%; text-align:left">
            <span t-field="o.amount_untaxed" />
          </td>
          <td style="width:12%; text-align:left">
            <span t-esc="amount_by_group[0]" />
          </td>
          <td style="width:17%; text-align:left">
            <span t-esc="amount_by_group[3]" />
          </td>
          <td style="width:14%; text-align:right">
            <Strong>Rechnungsbetrag</Strong>
          </td>
          <td style="width:18%; text-align:right">
            <span t-field="o.amount_total" />
          </td>
        </tr>
      </t>
    </table>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.modify_main_table.xmlopen in new window

Net Value Summary

ID: mint_system.account.report_invoice_document.net_value_summary

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//div[@id='total']//table/tr[1]" position="before">

    <t t-set="net_value_of_goods" t-value="sum(o.invoice_line_ids.filtered(lambda l: l.product_id.type == 'product').mapped('price_subtotal'))" />
    <t t-set="additional_expenses" t-value="sum(o.invoice_line_ids.filtered(lambda l: l.product_id.type != 'product').mapped('price_subtotal'))" />

    <tr>
      <!-- de_CH: Nettowarenwert -->
      <td>Net Value of Goods</td>
      <td class="text-right">
        <span t-esc="net_value_of_goods" t-options="{'widget': 'monetary', 'display_currency': o.currency_id}" />
      </td>
    </tr>
    <tr>
      <!-- de_CH: Zusatzaufwendungen -->
      <td>Additional Expenses</td>
      <td class="text-right">
        <span t-esc="additional_expenses" t-options="{'widget': 'monetary', 'display_currency': o.currency_id}" />
      </td>
    </tr>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.net_value_summary.xmlopen in new window

Product Hs Code And Origin

ID: mint_system.account.report_invoice_document.product_hs_code_and_origin

<?xml version="1.0"?>
<!-- Show custom field country of origin and hs code -->
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//table/tbody/t[3]/tr/t[1]/td[1]/span" position="after">
    <t t-if="line.product_id.country_of_origin_id.code">
      <br/>
      Country of Origin: <span t-field="line.product_id.country_of_origin_id.code"/>
    </t>
    <t t-if="line.product_id.hs_code">
      <br/>
      HS Code: <span t-field="line.product_id.hs_code"/>
    </t>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.product_hs_code_and_origin.xmlopen in new window

Product Weight

ID: mint_system.account.report_invoice_document.product_weight

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//table/tbody/t[3]/tr/t[1]/td[1]/span" position="after">
  <t t-if="line.product_id.weight">
    <br/>
		Weight: <span t-field="line.product_id.weight"/>
		<span t-field="line.product_id.weight_uom_id.display_name"/>
  </t>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.product_weight.xmlopen in new window

Remove Incoterms

ID: mint_system.account.report_invoice_document.remove_incoterms

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

	<xpath expr="//p[@name='payment_communication']" position="replace">
  </xpath>

</data>

Source: snippets/account.report_invoice_document.remove_incoterms.xmlopen in new window

Remove Payment Ref

ID: mint_system.account.report_invoice_document.remove_payment_ref

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

	<xpath expr="//p[@name='payment_communication']" position="replace">
  </xpath>

</data>

Source: snippets/account.report_invoice_document.remove_payment_ref.xmlopen in new window

Remove Payment Term

ID: mint_system.account.report_invoice_document.remove_payment_term

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

	<p name="payment_term" position="replace">
  </p>

</data>

Source: snippets/account.report_invoice_document.remove_payment_term.xmlopen in new window

Remove Summary Table

ID: mint_system.account.report_invoice_document.remove_summary_table

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

<xpath expr="//div[@class='clearfix']" position="replace">
</xpath>

</data>

Source: snippets/account.report_invoice_document.remove_summary_table.xmlopen in new window

Remove Taxes

ID: mint_system.account.report_invoice_document.remove_taxes

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="60">

  <xpath expr="//th[@name='th_taxes']" position="replace"/>
  <xpath expr="//span[@id='line_tax_ids']/.." position="replace"/>

</data>

Source: snippets/account.report_invoice_document.remove_taxes.xmlopen in new window

Replace Address

ID: mint_system.account.report_invoice_document.replace_address

<?xml version="1.0"?>
<!-- Align invoice tax row right -->
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//div[@t-field='o.partner_id']" position="replace">
    <div t-field="o.partner_invoice_id" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;], &quot;no_marker&quot;: True}"/>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.replace_address.xmlopen in new window

ID: mint_system.account.report_invoice_document.replace_footer

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//p[@name='payment_communication']" position="replace">
  </xpath>
  
  <p t-if="o.invoice_payment_term_id" name="payment_term">
                        <span t-field="o.invoice_payment_term_id.note"/>
                    </p>

  <xpath expr="//p[@t-if='o.invoice_incoterm_id']" position="replace">
    <style>
      table#footer {
        width: 100%;
        font-size: 8pt;
      }
      table#footer tr, td {
        vertical-align: top;
      }
    </style>
    <table id='footer'>
      <tr>
        <td t-if="o.invoice_payment_term_id" name="payment_term">
          Zahlungsbedingungen: <span t-field="o.invoice_payment_term_id.note"/>
        </td>
        <td width="50%">
          Lieferung gemäss unseren allgemeinen Lieferbedingungen
        </td>
      </tr>
      <tr>
        <td >MWST-Nr: 
          <span t-field="o.company_id.vat"/>
        </td>
        <td>
          <table width="100%">
            <tr>
              <td width="35%">
               Bankverbindungen:
              </td>
              <td width="65%">
              UBS AG, 6301 Zug, BLZ 273, SWIFT UBSWCHZH80A
              </td>
            </tr>
            <tr>
              <td>
              </td>
              <td>
            (CHF) IBAN CH63 0027 3273 Q978 6962 0
              </td>
            </tr>

            <tr>
              <td>
              </td>
              <td>
            (EUR) IBAN CH59 0027 3273 HN10 3698 0
              </td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
    
  </xpath>

  <xpath expr="//p[@name='payment_term']" position="replace">
  </xpath>


</data>

Source: snippets/account.report_invoice_document.replace_footer.xmlopen in new window

Replace Information Table2

ID: mint_system.account.report_invoice_document.replace_information_table2

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">
  <xpath expr="//*[@id='informations']" position="replace">
    <style>
      table#informations {
        white-space: nowrap;
      }
      table#informations td:nth-child(odd) {
        text-align: left;
      }
      table#informations td:nth-child(even) {
        text-align: left;
        padding-right: 3rem;
      }
    </style>
    <table id='informations' class="table table-borderless table-sm">
      <tr>
        <td>
          <strong>Rechnungsdatum: </strong>
        </td>
        <td>
          <span t-field="o.invoice_date"/>
        </td>
        <td>
          <strong>Kontakt Rechnung: </strong>
        </td>
        <td>
          <t t-foreach="res_company.partner_id.child_ids.filtered(lambda c: c.type == 'invoice' and c.name)" t-as="delivery_partner">
            <span t-esc="delivery_partner.name" />
          </t>
        </td>
        <td>
          <strong>Zahlbar innert: </strong>
        </td>
        <td>
          <span t-field="o.invoice_payment_term_id"/>
        </td>
      </tr>
      <tr>
        <td>
          <strong>Kontakt Verkauf: </strong>
        </td>
        <td>
          <span t-field="o.invoice_user_id" />
        </td>
        <td>
          <strong>Tel. Direkt: </strong>
        </td>
        <td>
          <t t-foreach="res_company.partner_id.child_ids.filtered(lambda c: c.type == 'invoice' and c.phone)" t-as="delivery_partner">
            <span t-esc="delivery_partner.phone" />
          </t>
        </td>
        <td>
        </td>
      </tr>
      <tr>
        <td>
          <strong>Kunden-Nr.: </strong>
        </td>
        <td>
          <span t-field="o.partner_id.ref" />
        </td>
        <td>
          <strong>E-Mail:</strong>
        </td>
        <td>
          <t t-foreach="res_company.partner_id.child_ids.filtered(lambda c: c.type == 'invoice' and c.email)" t-as="delivery_partner">
            <span t-esc="delivery_partner.email" />
          </t>
        </td>
        <td>
          <!-- <strong>MWST: </strong> -->
        </td>
        <td>
          <!-- <span t-field="res_company.vat" /> -->
        </td>
      </tr>
    </table>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.replace_information_table2.xmlopen in new window

Replace Information Table

ID: mint_system.account.report_invoice_document.replace_information_table

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">
  <xpath expr="//*[@id='informations']" position="replace">
    <style>
      table#informations{
        white-space: nowrap;
      }
    </style>
    <table id='informations' class="table table-borderless table-sm">
      <tr>
        <td>
          <strong>Rechnungsdatum: </strong>
          <span t-field="o.invoice_date"/>
        </td>
        <td>
          <strong>Kontakt Rechnung: </strong>
          <t t-foreach="res_company.partner_id.child_ids.filtered(lambda c: c.type == 'invoice' and c.name)" t-as="delivery_partner">
            <span t-esc="delivery_partner.name" />
          </t>
        </td>
        <td>
          <strong>Zahlbar innert: </strong>
          <span t-field="o.invoice_payment_term_id"/>
        </td>
      </tr>
      <tr>
        <td>
          <strong>Kontakt Verkauf: </strong>
          <span t-field="o.invoice_user_id" />
        </td>
        <td>
          <strong>Tel. Direkt: </strong>
          <t t-foreach="res_company.partner_id.child_ids.filtered(lambda c: c.type == 'invoice' and c.phone)" t-as="delivery_partner">
            <span t-esc="delivery_partner.phone" />
          </t>
        </td>
        <td>
        </td>
      </tr>
      <tr>
        <td>
          <strong>Kunden-Nr.: </strong>
          <span t-field="o.partner_id.ref" />
        </td>
        <td>
          <strong>E-Mail:</strong>
          <t t-foreach="res_company.partner_id.child_ids.filtered(lambda c: c.type == 'invoice' and c.email)" t-as="delivery_partner">
            <span t-esc="delivery_partner.email" />
          </t>
        </td>
        <td>
          <!-- <strong>MWST: </strong>
          <span t-field="res_company.vat" /> -->
        </td>
      </tr>
    </table>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.replace_information_table.xmlopen in new window

Replace Infotable

ID: mint_system.account.report_invoice_document.replace_infotable

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//div[@id='informations']" position="replace">
    <style>
    table#info {
      width: 100%;
      margin-bottom: 25px;
      font-size: 9pt;
    }
    table#info tr {
      line-height: 1.2;
      text-align: left;
    }
    .note {
      font-size: 9pt;
    }
    </style>
    <table id='info'>
      <tr>
        <td></td>
        <td></td>
        <td>Order No.</td>
        <td>
          <span t-field='o.invoice_origin'/>
        </td>
      </tr>
      <tr>
        <td width="17%">Invoice date</td>
        <td width="44%">
          <span t-field='o.invoice_date' t-options='{ "widget": "date" }'/>
        </td>
        <td width="14%">Our Reference</td>
        <td width="25%">
          <span t-field='o.user_id'/>
        </td>
      </tr>
      <tr>
        <td>Customer No.</td>
        <td>
          <span t-field='o.partner_id.ref'/>
        </td>
        <td>Delivery Method</td>
        <td>
          <span t-field='o.carrier_id'/>
        </td>
      </tr>
      <tr>
        <td>Order</td>
        <td>
          <span t-field='o.ref'/>
        </td>
        <td>Incoterm</td>
        <td>
          <span t-field='o.invoice_incoterm_id'/>
        </td>
      </tr>
      <tr>
        <td>Reference</td>
        <td>
           <span t-field='o.comment'/>
        </td>
        
        <td>Delivery Date</td>
        <td>
          <span t-field='o.x_date_done' t-options='{ "widget": "date" }'/>
        </td>
    
      </tr>
    </table>
  </xpath>
</data>



Source: snippets/account.report_invoice_document.replace_infotable.xmlopen in new window

Replace Product Description

ID: mint_system.account.report_invoice_document.replace_product_description

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

<xpath expr="//td[@name='account_invoice_line_name']" position="replace">
  <t t-if="line.product_id.type_description">
	<td>
		<span style="font-weight: bold" t-field="line.product_id.type_description"/>
	</td>
  </t>
  <t t-if="not line.product_id.type_description">
	<td>
    <span t-field="line.external_name"/>
	</td>
  </t>

</xpath>

</data>

Source: snippets/account.report_invoice_document.replace_product_description.xmlopen in new window

Replace Summary

ID: mint_system.account.report_invoice_document.replace_summary

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//table[@name='invoice_line_table']" position="after">

    <style>
			table.trimada_summary tr {
				border-top: solid 1px !important;
				border-bottom: solid 1px;
				page-break-inside: avoid;
			}
			table.trimada_details tr {
			  border-top: 0px !important;
			  border-bottom: 0px;
			  line-height: 0.7;
			}
			table.trimada_summary #amount_untaxed_label {
				width: 11.5%;
				text-align: left;
			}
			table.trimada_details td#amount_by_group0 {
				width: 8%;
				text-align: left;
			}
			table.trimada_details td#amount_by_group3 {
				width: 21%;
				text-align: right;
				padding-right: 10%;
			}
			table.trimada_details td#amount_by_group4 {
				width: 27%;
				text-align: right;
				padding-right: 15%;
			}
			table.trimada_summary td#amount_by_group_label {
				width: 12%;
				text-align: left;
			}
			table.trimada_summary td#amount_by_group {
				width: 17%;
				text-align: left;
			}
			table.trimada_summary #amount_total_label {
				width: 14%;
				text-align: right;
			}
			table.trimada_summary #amount_total {
				width: 18%;
				text-align: right;
			}
    </style>

    <table class="table table-borderless table-sm trimada trimada_summary">
      <td id="amount_untaxed_label">
        <Strong>Warenwert</Strong>
      </td>

      <td>
        <table class="trimada_details">
          <t t-foreach="o.amount_by_group" t-as="amount_by_group">
            <tr style="">

              <td id="amount_by_group4">
                <span>
                  <t t-esc="amount_by_group[4]"/>
                </span>
              </td>

              <t t-if="len(o.line_ids.filtered(lambda line: line.tax_line_id)) in [0, 1] and o.amount_untaxed == amount_by_group[2]">
                <td id="amount_by_group0">
                  <span class="text-nowrap" t-esc="amount_by_group[0]"/>
                </td>
                <td id="amount_by_group3" class="text-right o_price_total">
                  <span class="text-nowrap" t-esc="amount_by_group[3]"/>
                </td>
              </t>
              <t t-else="">
                <td id="amount_by_group0">
                  <span t-esc="amount_by_group[0]"/>
                </td>
                <td id="amount_by_group3" class="text-right o_price_total">
                  <span class="text-nowrap" t-esc="amount_by_group[3]"/>
                </td>
              </t>
            </tr>
          </t>

          <t t-if="print_with_payments">
            <t t-if="o.payment_state != 'invoicing_legacy'">
              <t t-set="payments_vals" t-value="o.sudo()._get_reconciled_info_JSON_values()"/>
              <t t-foreach="payments_vals" t-as="payment_vals">
                <tr>
                  <td>
                    <i class="oe_form_field text-right oe_payment_label">Paid on <t t-esc="payment_vals['date']" t-options="{&quot;widget&quot;: &quot;date&quot;}"/>
                    </i>
                  </td>
                  <td class="text-right">
                    <span t-esc="payment_vals['amount']" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.currency_id}"/>
                  </td>
                </tr>
              </t>
              <t t-if="len(payments_vals) &gt; 0">
                <tr class="border-black">
                  <td>
                    <strong>Amount Due</strong>
                  </td>
                  <td class="text-right">
                    <span t-field="o.amount_residual"/>
                  </td>
                </tr>
              </t>
            </t>
          </t>
        </table>
      </td>

      <td id="amount_total_label">
        <strong>Total</strong>
      </td>
      <td id="amount_total">
        <span class="text-nowrap" t-field="o.amount_total"/>
      </td>

    </table>

  </xpath>

</data>


Source: snippets/account.report_invoice_document.replace_summary.xmlopen in new window

Reset Address

ID: mint_system.account.report_invoice_document.reset_address

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//t[@t-set='address']" position="replace">
    <t t-set="address">
      <div>
        <address t-field="o.partner_invoice_id" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;], &quot;no_marker&quot;: True}" />
      </div>
    </t>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.reset_address.xmlopen in new window

Round Price

ID: mint_system.account.report_invoice_document.round_price

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//span[@t-field='line.price_unit']" position="replace">
		 <span t-esc="'%g' % line.price_unit if str(line.price_unit)[::-1].find('.') >= 3 else '{0:,.2f}'.format(float(line.price_unit)).replace(',','\'')"/>
  </xpath>
   
</data>

Source: snippets/account.report_invoice_document.round_price.xmlopen in new window

Round Quantity

ID: mint_system.account.report_invoice_document.round_quantity

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//span[@t-field='line.quantity']" position="replace">
    <span t-esc="'%.2f' % line.quantity"/>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.round_quantity.xmlopen in new window

Round Total Price

ID: mint_system.account.report_invoice_document.round_total_price

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//span[@t-field='line.price_subtotal']" position="replace">
    <span t-esc="'{0:,.2f}'.format(float(line.price_subtotal)).replace(',','\'')"/>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.round_total_price.xmlopen in new window

Second Row

ID: mint_system.account.report_invoice_document.second_row

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">
  
  <xpath expr="//tbody[hasclass('invoice_tbody')]//tr" position="attributes">
    <attribute name="class" separator=" " add="first"/>
  </xpath>

  <xpath expr="//tbody[hasclass('invoice_tbody')]//tr" position="after">
    <t t-if="line.product_id.type_description">
    <tr class="second">
      <td></td>
      <td></td>
      <td colspan="5">
        <span t-field="line.external_name"/><br/>
        <t t-if="line.product_id.country_of_origin_id.code">
          Ursprungsland:
          <span t-field="line.product_id.country_of_origin_id.code" />
        </t>
        <t t-if="line.product_id.hs_code">
          / Zollposition:
          <span t-field="line.product_id.hs_code" />
        </t>
      </td>
    </tr>
    </t>
    <t t-if="not line.product_id.type_description">
    <tr class="second">
      <td></td>
      <td></td>
      <td colspan="5">
        <t t-if="line.product_id.country_of_origin_id.code">
          Ursprungsland:
          <span t-field="line.product_id.country_of_origin_id.code" />
        </t>
        <t t-if="line.product_id.hs_code">
          / Zollposition:
          <span t-field="line.product_id.hs_code" />
        </t>
      </td>
    </tr>
    </t>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.second_row.xmlopen in new window

Sequence In Table

ID: mint_system.account.report_invoice_document.sequence_in_table

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="60">

  <xpath expr="//table/thead/tr/th[1]" position="before">
    <th>
      <span>Pos</span>
    </th>
  </xpath>

  <xpath expr="//t[@t-foreach='lines']" position="before">
    <t t-set="index" t-value="1"/>
  </xpath>
  
  <xpath expr="//table/tbody//tr/t[1]/td[1]" position="before">
    <td>
      <span t-esc="index"/><t t-set="index" t-value="index+1"/>
    </td>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.sequence_in_table.xmlopen in new window

Set Ids

ID: mint_system.account.report_invoice_document.set_ids

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">
  
	<xpath expr="//th[@name='th_quantity']" position="attributes">
		<attribute name="id">th_quantity</attribute>
	</xpath>

	<xpath expr="//th[@name='th_description']" position="attributes">
		<attribute name="id">description</attribute>
	</xpath>
	<xpath expr="//table[@name='invoice_line_table']//td[2]" position="attributes">
		<attribute name="id">quantity</attribute>
	</xpath>
	<xpath expr="//table[@name='invoice_line_table']//td[2]/span[1]" position="attributes">
		<attribute name="id">qty</attribute>
	</xpath>
	
	<xpath expr="//table[@name='invoice_line_table']//td[3]/span[1]" position="attributes">
		<attribute name="id">price</attribute>
	</xpath>

</data>

Source: snippets/account.report_invoice_document.set_ids.xmlopen in new window

Show Default Code

ID: mint_system.account.report_invoice_document.show_default_code

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//table[@name='invoice_line_table']/thead/tr/th[1]" position="before">
    <th id="default_code">
      <strong >Part No.</strong>
    </th>
  </xpath>

  <xpath expr="//table[@name='invoice_line_table']/tbody/t/tr/t[1]/td[1]" position="before">
    <td id="default_code">
      <span t-field="line.product_id.default_code"/>
    </td>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.show_default_code.xmlopen in new window

Show Product Name

ID: mint_system.account.report_invoice_document.show_product_name

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="60">

  <xpath expr="//td[@name='account_invoice_line_name']" position="replace">
    <td name="account_invoice_line_name">
      <t t-if="line.product_id">
        <span t-field="line.product_id.name"/>
        <br/>
      </t>
      <span class="o_italic" t-field="line.name" t-options="{'widget': 'text'}"/>
    </td>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.show_product_name.xmlopen in new window

Style Trimada

ID: mint_system.account.report_invoice_document.style_trimada

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="60">

	<xpath expr="//div[hasclass('page')]" position="before">
		<style>
			table.trimada {
				font-size: 9pt;
				font-family: arial;
				color: black;
			}
			table.trimada tr.first td {
				padding-bottom: 0;
			}
			table.trimada tr.second td {
				padding-top: 0;
			}
			table.trimada tr.second {
				border-bottom: 1px solid rgb(220,220,220);
			}
			table.trimada thead tr {
				border-top:solid 1px;
				border-bottom: solid 1px;
			}
			table.trimada thead th#position {
				width: 5mm;
			}
			table.trimada thead th#default_code {
			  width: 27mm;
			  text-align: right;
			}
			table.trimada thead th#open_quantity {
			  width: 30mm;
			  text-align: right;
			}
			table.trimada thead th#quantity {
			  width: 25mm;
			  text-align: right !important;
			}
			table.trimada tbody td#position {
			  text-align: right;
			}
			table.trimada tbody td#default_code {
			  text-align: right;
			}
			table.trimada tbody td#open_quantity {
			  text-align: right !important;
			}
			table.trimada tbody td#quantity {
			  text-align: right;
			}			
			table.trimada tbody span#qty {
			  font-weight: bold;
			}
			table.trimada tbody span#open_qty {
			  font-weight: bold;
			}
			.address {
			  font-size: 10pt;
			  line-height: 1.2;
			  padding-bottom:33mm;
			}
			.subtitel {
				font-size: 11pt;
				font-family: arial;
				margin-top: 10mm;
			}
			.note {
				font-size: 9pt;
				font-family: arial;
			}
		</style>
	</xpath>

	<table name="invoice_line_table" position="attributes">
		<attribute name="class" separator=" " add="trimada table-borderless"/>
	</table>

	<table name="invoice_line_table" position="attributes">
		<attribute name="class" separator=" " add="trimada table-borderless"/>
	</table>

  <span id="qty" position="attributes">
		<attribute name="t-options-widget">"integer"</attribute>
	</span>
	
</data>

Source: snippets/account.report_invoice_document.style_trimada.xmlopen in new window

Switch Address Block

ID: mint_system.account.report_invoice_document.switch_address_block

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//t[@t-set='address']" position="after">
    <t t-set="information_block">
      <address t-field="o.partner_id" t-options="{'widget': 'contact', 'fields': ['address', 'name'], 'no_marker': True}"/>
      <div t-if="o.partner_id.vat" class="mt16">
          <t t-if="o.company_id.country_id.vat_label" t-esc="o.company_id.country_id.vat_label" id="inv_tax_id_label"/>
          <t t-else="">Tax ID</t>: <span t-field="o.partner_id.vat"/></div>
    </t>
  </xpath>

  <xpath expr="//t[@t-set='address']" position="replace">
    <t t-set="address">
    </t>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.switch_address_block.xmlopen in new window

Unit Precision

ID: mint_system.account.report_invoice_document.unit_precision

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//tbody[1]/t[3]/tr[1]/t[1]/td[2]/span[1]" position="attributes">
		<attribute name="t-options-widget">"integer"</attribute>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.unit_precision.xmlopen in new window

X Picking List

ID: mint_system.account.report_invoice_document.x_picking_list

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//p[@t-field='o.invoice_origin']" position="attributes">
    <attribute name="t-field">o.x_picking_list</attribute>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.x_picking_list.xmlopen in new window

Report Invoice Document With Payments

Add Iban And Bank

ID: mint_system.account.report_invoice_document_with_payments.add_iban_and_bank

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document_with_payments" priority="50">

  <xpath expr="/t/t/div/p[2]" position="after">
    <div class="row">
      <div class="col">
        <span>IBAN: </span>
        <span t-field="o.invoice_partner_bank_id.acc_number"/>
      </div>
    </div>
  </xpath>

  <xpath expr="/t/t/div/div[3]" position="after">
    <div class="row">
      <div class="col">
        <span>Bank/BIC: </span>
        <span t-field="o.invoice_partner_bank_id.bank_id.display_name"/>
        <br/>
        <br/>
      </div>
    </div>
  </xpath>

</data>

Source: snippets/account.report_invoice_document_with_payments.add_iban_and_bank.xmlopen in new window

Report Invoice Document

ID: mint_system.account.report_invoice_document.add_header_and_footer_note

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//table[@id='info']" position="after">
    <t t-if="o.note_header != '&lt;p&gt;&lt;br&gt;&lt;/p&gt;'">
      <span class="note" t-field="o.note_header"/>
    </t>
  </xpath>

  <xpath expr="//table[2]" position="after">
    <t t-if="o.note_footer != '&lt;p&gt;&lt;br&gt;&lt;/p&gt;'">
      <span class="note" t-field="o.note_footer"/>
    </t>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.add_header_and_footer_note.xmlopen in new window

Add Header Padding

ID: mint_system.account.report_invoice_document.add_header_padding

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//h2" position="attributes">
    <attribute name="style">padding-top: 2rem</attribute>
	</xpath>

</data>

Source: snippets/account.report_invoice_document.add_header_padding.xmlopen in new window

Add Header Space

ID: mint_system.account.report_invoice_document.add_header_space

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

	<xpath expr="//h2" position="attributes">
		 <attribute name="style">padding-top: 5rem</attribute>
	</xpath>

</data>

Source: snippets/account.report_invoice_document.add_header_space.xmlopen in new window

Add Iban

ID: mint_system.account.report_invoice_document.add_iban

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <!-- Odoo 14.0 -->
  <xpath expr="/t/t/div/p[2]" position="after">
      <div class="row">
      <div class="col">
          <span>IBAN: </span>
          <span t-field="o.partner_bank_id.acc_number"/>
      </div>
      </div>
  </xpath>
  <xpath expr="/t/t/div/div[3]" position="after">
      <div class="row">
      <div class="col">
          <span>Bank/BIC: </span>
          <span t-field="o.partner_bank_id.bank_id.display_name"/>
          <br/>
          <br/>
      </div>
      </div>
  </xpath>

  <!-- Odoo 13.0 -->
  <!-- <xpath expr="/t/t/div/p[2]" position="after">
      <div class="row">
      <div class="col">
          <span>IBAN: </span>
          <span t-field="o.invoice_partner_bank_id.acc_number"/>
      </div>
      </div>
  </xpath>
  <xpath expr="/t/t/div/div[3]" position="after">
      <div class="row">
      <div class="col">
          <span>Bank/BIC: </span>
          <span t-field="o.invoice_partner_bank_id.bank_id.display_name"/>
          <br/>
          <br/>
      </div>
      </div>
  </xpath> -->

</data>

Source: snippets/account.report_invoice_document.add_iban.xmlopen in new window

Add Percentage Sign

ID: mint_system.account.report_invoice_document.add_percentage_sign

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

<xpath expr="//span[@t-field='line.discount']" position="replace">
    <span t-field="line.discount"/>%
  </xpath>

</data>

Source: snippets/account.report_invoice_document.add_percentage_sign.xmlopen in new window

Add Salesperson

ID: mint_system.account.report_invoice_document.add_salesperson

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="/t/t/div/div[1]/div[1]" position="after">
    <div class="col-3 bm-2" t-if="o.invoice_user_id" name="invoice_user_id">
      <strong>Contact:</strong>
      <p class="m-0" t-field="o.invoice_user_id.email"/>
      <p class="m-0" t-field="o.invoice_user_id.phone"/>
    </div>
  </xpath>

  <!-- <xpath expr="/t/t/div/div[1]/div[1]" position="after">
    <div class="col-auto mw-100 mb-2" t-if="o.invoice_user_id" name="invoice_user_id">
      <strong>Contact:</strong>
      <p class="m-0" t-field="o.invoice_user_id.email"/>
      <p class="m-0" t-field="o.invoice_user_id.phone"/>
    </div>
  </xpath> -->

  <!-- <xpath expr="/t/t/div/div[1]/div[1]" position="after">
    <div class="col-auto mw-100 mb-2" t-if="o.invoice_user_id" name="invoice_user_id">
      <strong>Salesperson:</strong>
      <p class="m-0" t-field="o.invoice_user_id.name"/>
    </div>
  </xpath> -->

</data>

Source: snippets/account.report_invoice_document.add_salesperson.xmlopen in new window

Align Taxes

ID: mint_system.account.report_invoice_document.align_taxes

<?xml version="1.0"?>
<!-- Align invoice tax row right -->
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//th[@name='th_taxes']" position="attributes">
    <attribute name="t-attf-class" separator=" " remove="text-right" add="text-right" />
  </xpath>

  <xpath expr="//span[@id='line_tax_ids']/.." position="attributes">
    <attribute name="t-attf-class" separator=" " remove="text-right" add="text-right" />
  </xpath>

</data>

Source: snippets/account.report_invoice_document.align_taxes.xmlopen in new window

Bank Account

ID: mint_system.account.report_invoice_document.bank_account

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="/t/t/div/p[2]" position="after">
    <t t-if="o.currency_id.name=='CHF'">
        <t t-set="account" t-value="o.company_id.bank_ids.browse(13)"/>
    </t>
    <t t-if="o.currency_id.name=='EUR'">
        <t t-set="account" t-value="o.company_id.bank_ids.browse(14)"/>
    </t>
    <t t-if="o.currency_id.name=='USD'">
        <t t-set="account" t-value="o.company_id.bank_ids.browse(15)"/>
    </t>
    <div class="row">
      <div class="col">
        <span>IBAN: </span>
        <span t-field="account.acc_number"/>
        <br/>
        <span>Bank/BIC: </span>
        <span t-field="account.bank_id.display_name"/>
        <br/>
        <br/>
      </div>
    </div>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.bank_account.xmlopen in new window

Custom Taxes

ID: mint_system.account.report_invoice_document.custom_taxes

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//th[@name='th_taxes']" position="replace">
  	<th name="th_taxes" t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"><span>Steuern</span></th>
  </xpath>
  <xpath expr="//t[@name='account_invoice_line_accountable']/td[5]" position="replace">
  	<td t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
  		<span t-esc="', '.join(map(lambda x: (x.description or x.name), line.tax_ids))" id="line_tax_ids"/>
  	</td>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.custom_taxes.xmlopen in new window

Display Shipping Address

ID: mint_system.account.report_invoice_document.display_shipping_address

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="/t/t/t" position="after">
    <t t-if="o.partner_shipping_id">
      <t t-set="information_block">
        <strong>Shipping address:</strong>
        <div t-if="o.partner_shipping_id" style="margin-bottom: 1rem;">
          <div t-field="o.partner_shipping_id" t-options="{'widget': 'contact', 'fields': ['address', 'name'], 'no_marker': True, 'phone_icons': True}" name="invoice_shipping_address"/>
        </div>
      </t>
    </t>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.display_shipping_address.xmlopen in new window

Font Size

ID: mint_system.account.report_invoice_document.font_size

<?xml version="1.0"?>
<!-- Change default font size -->
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//div[hasclass('page')]" position="inside">
		<style>
			body {
				font-size: 0.9rem;
			}
		</style>
	</xpath>

</data>

Source: snippets/account.report_invoice_document.font_size.xmlopen in new window

Format Address Blocks

ID: mint_system.account.report_invoice_document.format_address_blocks

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//t[@t-set='address']/div" position="attributes">
    <attribute name="style">font-size:10pt; line-height: 1.2; padding-bottom:33mm</attribute>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.format_address_blocks.xmlopen in new window

Format Pos

ID: mint_system.account.report_invoice_document.format_pos

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//t[@t-if='o.sale_order_id']/td" position="attributes">
    <attribute name="style">text-align: right; width: 5mm</attribute>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.format_pos.xmlopen in new window

Format Qty With Decimal

ID: mint_system.account.report_invoice_document.format_qty_with_decimal

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

	<xpath expr="//span[@id='qty']" position="replace">
		<t t-if="line.product_uom_id.id == 1">
			<span id="qty" t-field="line.quantity" t-options="{'widget': 'integer'}"/>
		</t>
		<t t-else="">
			<span id="qty" t-field="line.quantity"/>
		</t>
	</xpath>

</data>

Source: snippets/account.report_invoice_document.format_qty_with_decimal.xmlopen in new window

Format Title

ID: mint_system.account.report_invoice_document.format_title

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//h2" position="attributes">
    <attribute name="style">color: black; font-size:13pt; font-weight:bold; margin-top:10mm; margin-bottom:3mm</attribute>
  </xpath>
  
</data>

Source: snippets/account.report_invoice_document.format_title.xmlopen in new window

Get Position

ID: mint_system.account.report_invoice_document.get_position

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">
  
  <xpath expr="//table/thead/tr/th[1]" position="before">
    <t t-if="o.sale_order_id">
      <th id="position">
        <span>Pos</span>
      </th>
    </t>
    <t t-if="o.invoice_line_ids.purchase_line_id">
      <th id="position">
        <span>Pos</span>
      </th>
    </t>
  </xpath>
  
  <!--
  <xpath expr="//table/tbody/t[3]/tr/t[1]/td[1]" position="before">
    <t t-if="o.sale_order_id">
      <td id="position">
        <span t-esc="line.position"/>
      </td>
    </t>
    <t t-if="line.purchase_order_id">
      <td id="position">
        <span t-esc="line.position"/>
      </td>
    </t>
  </xpath>
  -->

    <xpath expr="//span[@t-field='line.name']/.." position="before">
    <t t-if="o.sale_order_id">
      <td id="position">
        <span t-esc="line.position"/>
      </td>
    </t>
    <t t-if="line.purchase_order_id">
      <td id="position">
        <span t-esc="line.position"/>
      </td>
    </t>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.get_position.xmlopen in new window

Group By Pickings

ID: mint_system.account.report_invoice_document.group_by_pickings

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//h2" position="before">
    <!-- Get all pickings without duplicates -->
    <t t-set="pickings" t-value="list(set(o.invoice_line_ids.picking_ids.filtered(lambda p: p.state != 'cancel')))"/>
    <!-- Store if has pickings -->
    <t t-set="has_pickings" t-value="len(pickings) > 0"/>
    <!-- Store if has multiple pickings -->
    <t t-set="has_multiple_pickings" t-value="len(pickings) > 1"/>
    <!-- Store if has lines without pickings -->
    <t t-set="has_lines_without_pickings" t-value="len(o.invoice_line_ids.filtered(lambda l: not l.picking_ids)) > 0"/>
  </xpath>
  
  <xpath expr="//h2/span[1]" position="replace">
    <span t-if="o.move_type == 'out_invoice' and o.state == 'posted' and not has_multiple_pickings">Rechnung</span>
    <span t-if="o.move_type == 'out_invoice' and o.state == 'posted' and has_multiple_pickings">Sammelrechnung</span>
  </xpath>

  <xpath expr="//t[@t-foreach='lines']" position="replace">

    <!-- Add empty picking if there are lines without pickings -->
    <t t-if="not has_pickings or has_lines_without_pickings">
      <t t-set="null" t-value="pickings.append(False)"/>
    </t>

    <!--<p t-esc="pickings"/> -->
    <!-- <p t-esc="has_pickings"/> -->
    <!-- <p t-esc="has_multiple_pickings"/> -->
    <!-- <p t-esc="has_lines_without_pickings"/> -->

    <t t-foreach="pickings" t-as="picking">
      <tr t-if="has_pickings and picking" class="o_line_note">
        <td colspan="99" style="padding-top: 1rem;" >
          <strong><span>Lieferung </span><span t-esc="picking.name.replace('WH/OUT/','')"/></strong>
          <!--<strong><span>Lieferung </span><span t-esc="picking.name.replace('WH/OUT/','')"/><span> / Bestellung </span><span t-esc="picking.group_id.name"/></strong>-->
          <span> vom </span>
          <span t-esc="picking.scheduled_date" t-options="{'widget': 'date'}"/><span>:</span>
        </td>
      </tr>
      <tr t-if="not picking" class="o_line_note">
        <td colspan="99" style="padding-top: 1rem;">
          <strong>
            <span>Weitere Positionen: </span>
          </strong>
        </td>
      </tr>
      <t t-foreach="lines" t-as="line">

        <!-- Show line if picking is set and linked or not picking is set and line is unlinked  -->
        <t t-if="(picking and picking in line.picking_ids) or (not line.picking_ids and not picking)">

          <t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/>
          <t t-set="current_subtotal" t-value="current_subtotal + line.price_total" groups="account.group_show_line_subtotals_tax_included"/>

          <tr t-att-class="'bg-200 font-weight-bold o_line_section' if line.display_type == 'line_section' else 'font-italic o_line_note' if line.display_type == 'line_note' else ''">
            <t t-if="not line.display_type" name="account_invoice_line_accountable">
              <td name="account_invoice_line_name">
                <span t-field="line.name" t-options="{'widget': 'text'}"/>
              </td>
              <td class="text-right">
                <span t-field="line.quantity"/>
                <span t-field="line.product_uom_id" groups="uom.group_uom"/>
              </td>
              <td t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
                <span class="text-nowrap" t-field="line.price_unit"/>
              </td>
              <td t-if="display_discount" t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
                <span class="text-nowrap" t-field="line.discount"/>
              </td>
              <td t-attf-class="text-left {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
                <span t-esc="', '.join(map(lambda x: (x.description or x.name), line.tax_ids))" id="line_tax_ids"/>
              </td>
              <td class="text-right o_price_total">
                <span class="text-nowrap" t-field="line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/>
                <span class="text-nowrap" t-field="line.price_total" groups="account.group_show_line_subtotals_tax_included"/>
              </td>
            </t>
            <t t-if="line.display_type == 'line_section'">
              <td colspan="99">
                <span t-field="line.name" t-options="{'widget': 'text'}"/>
              </td>
              <t t-set="current_section" t-value="line"/>
              <t t-set="current_subtotal" t-value="0"/>
            </t>
            <t t-if="line.display_type == 'line_note'">
              <td colspan="99">
                <span t-field="line.name" t-options="{'widget': 'text'}"/>
              </td>
            </t>
          </tr>

          <t t-if="current_section and (line_last or lines[line_index+1].display_type == 'line_section')">
            <tr class="is-subtotal text-right">
              <td colspan="99">
                <strong class="mr16">Subtotal</strong>
                <span t-esc="current_subtotal" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.currency_id}"/>
              </td>
            </tr>
          </t>

        </t>
      </t>
      <tr t-if="picking and picking.sale_id.note" class="o_line_note">
        <td colspan="99" style="padding-bottom: 1rem;" >
          <span t-esc="picking.sale_id.note"/>
        </td>
      </tr>
    </t>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.group_by_pickings.xmlopen in new window

Group By Sale Order

ID: mint_system.account.report_invoice_document.group_by_sale_order

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//h2" position="before">
    <!-- Get all sale orders without duplicates -->
    <t t-set="sale_orders" t-value="list(set([line.order_id for line in o.invoice_line_ids.sale_line_ids]))"/>
    <!-- Store if has sale orders -->
    <t t-set="has_sale_orders" t-value="len(sale_orders) > 0"/>
    <!-- Store if has multiple sale orders -->
    <t t-set="has_multiple_sale_orders" t-value="len(sale_orders) > 1"/>
    <!-- Store if has lines without sale orders -->
    <t t-set="has_lines_without_sale_orders" t-value="len(o.invoice_line_ids.filtered(lambda l: not l.sale_line_ids)) > 0"/>
  </xpath>

  <xpath expr="//h2/span[1]" position="replace">
    <span t-if="o.move_type == 'out_invoice' and o.state == 'posted' and not has_multiple_sale_orders">Rechnung</span>
    <span t-if="o.move_type == 'out_invoice' and o.state == 'posted' and has_multiple_sale_orders">Sammelrechnung</span>
  </xpath>

  <xpath expr="//t[@t-foreach='lines']" position="replace">

    <!-- Add empty sale order if there are lines without sale orders -->
    <t t-if="not has_sale_orders or has_lines_without_sale_orders">
      <t t-set="null" t-value="sale_orders.append(False)"/>
    </t>

    <!-- <p t-esc="sale_orders"/> -->
    <!-- <p t-esc="has_sale_orders"/> -->
    <!-- <p t-esc="has_multiple_sale_orders"/> -->
    <!-- <p t-esc="has_lines_without_sale_orders"/> -->
    
    <t t-foreach="sale_orders" t-as="sale_order">
      <tr t-if="has_sale_orders and sale_order" class="o_line_note">
        <td colspan="99" style="padding-top: 1rem;">
          <strong>
            <span>Verkaufsauftrag </span>
            <span t-esc="sale_order.name"/>
            <span t-if="sale_order.client_order_ref">/</span>
            <span t-if="sale_order.client_order_ref" t-esc="sale_order.client_order_ref"/>
            <span> vom </span>
            <span t-esc="sale_order.date_order" t-options="{'widget': 'date'}"/><span>:</span>
          </strong>
        </td>
      </tr>
      <tr t-if="not sale_order" class="o_line_note">
        <td colspan="99" style="padding-top: 1rem;">
          <strong>
            <span>Weitere Positionen: </span>
          </strong>
        </td>
      </tr>
      <t t-foreach="lines" t-as="line">

        <!-- Show line if sale order is set and linked or not sale order is set and line is unlinked  -->
        <t t-if="(sale_order and sale_order in line.sale_line_ids.order_id) or (not line.sale_line_ids and not sale_order)">

          <t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/>
          <t t-set="current_subtotal" t-value="current_subtotal + line.price_total" groups="account.group_show_line_subtotals_tax_included"/>

          <tr t-att-class="'bg-200 font-weight-bold o_line_section' if line.display_type == 'line_section' else 'font-italic o_line_note' if line.display_type == 'line_note' else ''">
            <t t-if="not line.display_type" name="account_invoice_line_accountable">
              <td name="account_invoice_line_name">
                <span t-field="line.name" t-options="{'widget': 'text'}"/>
              </td>
              <td class="text-right">
                <span t-field="line.quantity"/>
                <span t-field="line.product_uom_id" groups="uom.group_uom"/>
              </td>
              <td t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
                <span class="text-nowrap" t-field="line.price_unit"/>
              </td>
              <td t-if="display_discount" t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
                <span class="text-nowrap" t-field="line.discount"/>
              </td>
              <td t-attf-class="text-left {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
                <span t-esc="', '.join(map(lambda x: (x.description or x.name), line.tax_ids))" id="line_tax_ids"/>
              </td>
              <td class="text-right o_price_total">
                <span class="text-nowrap" t-field="line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/>
                <span class="text-nowrap" t-field="line.price_total" groups="account.group_show_line_subtotals_tax_included"/>
              </td>
            </t>
            <t t-if="line.display_type == 'line_section'">
              <td colspan="99">
                <span t-field="line.name" t-options="{'widget': 'text'}"/>
              </td>
              <t t-set="current_section" t-value="line"/>
              <t t-set="current_subtotal" t-value="0"/>
            </t>
            <t t-if="line.display_type == 'line_note'">
              <td colspan="99">
                <span t-field="line.name" t-options="{'widget': 'text'}"/>
              </td>
            </t>
          </tr>

          <t t-if="current_section and (line_last or lines[line_index+1].display_type == 'line_section')">
            <tr class="is-subtotal text-right">
              <td colspan="99">
                <strong class="mr16">Subtotal</strong>
                <span t-esc="current_subtotal" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.currency_id}"/>
              </td>
            </tr>
          </t>

        </t>
      </t>
    </t>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.group_by_sale_order.xmlopen in new window

Margin After Title

ID: mint_system.account.report_invoice_document.margin_after_title

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//h2" position="attributes">
    <attribute name="style" separator=";" add="margin-bottom: 1rem"/>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.margin_after_title.xmlopen in new window

Margin Before Invoice Table

ID: mint_system.account.report_invoice_document.margin_before_invoice_table

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <table name="invoice_line_table" position="attributes">
    <attribute name="style" separator=";" add="margin-top: 1rem"/>
  </table>

</data>

Source: snippets/account.report_invoice_document.margin_before_invoice_table.xmlopen in new window

Margin Before Title

ID: mint_system.account.report_invoice_document.margin_before_title

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//h2" position="attributes">
    <attribute name="style" separator=";" add="margin-top: 1rem"/>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.margin_before_title.xmlopen in new window

Modify Main Table

ID: mint_system.account.report_invoice_document.modify_main_table

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <!-- add default_code   -->
  <xpath expr="//table[@class='table table-sm o_main_table']/thead/tr/th[1]" position="before">
    <th style="text-align: right; width: 27mm; padding-right: 10px">
      <span>Part No.</span>
    </th>
  </xpath>
  <xpath expr="//table[@class='table table-sm o_main_table']/tbody/t/tr/t[1]/td[1]" position="before">
    <td style="text-align: right; padding-right: 10px">
      <span t-field="line.product_id.default_code" />
    </td>
  </xpath>

  <!-- Header desriptin -->
  <xpath expr="//table[@class='table table-sm o_main_table']/thead/tr/th[2]" position="attributes">
    <attribute name="style">width: 70mm</attribute>
  </xpath>

  <!-- add delivery date -->
  <xpath expr="//table[@class='table table-sm o_main_table']/thead/tr/th[3]" position="before">
    <th style="text-align: right; width: 27mm; padding-right: 10px">
      <span></span>
    </th>
  </xpath>
  <xpath expr="//table[@class='table table-sm o_main_table']/tbody/t/tr/t[1]/td[3]" position="before">
    <td style="text-align: right; padding-right: 10px"></td>
  </xpath>

  <xpath expr="//td[@name='account_invoice_line_name']" position="replace">
    <td>
      <span style="font-weight: bold" t-field="line.product_id.type_description" />
    </td>
  </xpath>

  <!-- add second row -->
  <xpath expr="//table[@class='table table-sm o_main_table']/tbody//tr[1]" position="after">
    <tr>
      <td style="padding-bottom :10px; padding-left:3px; line-height: 1.2"></td>
      <td style="padding:0; padding-left:3px; line-height: 1.2"></td>
      <td style="padding:0; padding-left:3px; line-height: 1.2" colspan="4">
        <span t-field="line.sale_line_ids.name" />
        <br />
        <t t-if="line.product_id.country_of_origin_id.code and line.product_id.hs_code">
          Country of origin:
          <span t-esc="line.product_id.country_of_origin_id.code" />
          / HS Code:
          <span t-esc="line.product_id.hs_code" />
          <br />
        </t>

        <t t-if="line.product_id.hs_code and not line.product_id.country_of_origin_id.code">
          HS Code:
          <span t-esc="line.product_id.hs_code" />
        </t>

        <t t-if="line.product_id.country_of_origin_id.code and not line.product_id.hs_code">
          Country of origin:
          <span t-esc="line.product_id.country_of_origin_id.code" />
        </t>
      </td>

      <td></td>
    </tr>
    <tr style="border-bottom: 1px solid rgb(220,220,220)">
      <td colspan="8"></td>
    </tr>
  </xpath>

  <!-- format main_table -->
  <xpath expr="//table[@class='table table-sm o_main_table']" position="attributes">
    <attribute name="style">width: 100%; font-size:9pt</attribute>
    <attribute name="class">table table-borderless table-sm</attribute>
  </xpath>

  <!-- header-->
  <xpath expr="//table[@class='table table-borderless table-sm']/thead/tr" position="attributes">
    <attribute name="style">border-top:solid 1px; border-bottom: solid 1px; color: black;</attribute>
  </xpath>

  <xpath expr="//table[@name='invoice_line_table']" position="after">

    <table class="table table-borderless table-sm" style="margin-top:20px; width:100%; color:black; font-family: arial; font-size:9pt; border-top-style:solid; border-bottom-style:solid; border-width:1px; border-color:black">
      <t t-if="o.note_footer != '&lt;p&gt;&lt;br&gt;&lt;/p&gt;'">
        <span class="note" t-field="o.note_footer" />
      </t>
      <t t-foreach="o.amount_by_group" t-as="amount_by_group">
        <tr>
          <td style="width:15.5%; text-align:left">
            <Strong>Warenwert</Strong>
          </td>
          <td style="width:23%; text-align:left">
            <span t-field="o.amount_untaxed" />
          </td>
          <td style="width:12%; text-align:left">
            <span t-esc="amount_by_group[0]" />
          </td>
          <td style="width:17%; text-align:left">
            <span t-esc="amount_by_group[3]" />
          </td>
          <td style="width:14%; text-align:right">
            <Strong>Rechnungsbetrag</Strong>
          </td>
          <td style="width:18%; text-align:right">
            <span t-field="o.amount_total" />
          </td>
        </tr>
      </t>
    </table>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.modify_main_table.xmlopen in new window

Net Value Summary

ID: mint_system.account.report_invoice_document.net_value_summary

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//div[@id='total']//table/tr[1]" position="before">

    <t t-set="net_value_of_goods" t-value="sum(o.invoice_line_ids.filtered(lambda l: l.product_id.type == 'product').mapped('price_subtotal'))" />
    <t t-set="additional_expenses" t-value="sum(o.invoice_line_ids.filtered(lambda l: l.product_id.type != 'product').mapped('price_subtotal'))" />

    <tr>
      <!-- de_CH: Nettowarenwert -->
      <td>Net Value of Goods</td>
      <td class="text-right">
        <span t-esc="net_value_of_goods" t-options="{'widget': 'monetary', 'display_currency': o.currency_id}" />
      </td>
    </tr>
    <tr>
      <!-- de_CH: Zusatzaufwendungen -->
      <td>Additional Expenses</td>
      <td class="text-right">
        <span t-esc="additional_expenses" t-options="{'widget': 'monetary', 'display_currency': o.currency_id}" />
      </td>
    </tr>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.net_value_summary.xmlopen in new window

Product Hs Code And Origin

ID: mint_system.account.report_invoice_document.product_hs_code_and_origin

<?xml version="1.0"?>
<!-- Show custom field country of origin and hs code -->
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//table/tbody/t[3]/tr/t[1]/td[1]/span" position="after">
    <t t-if="line.product_id.country_of_origin_id.code">
      <br/>
      Country of Origin: <span t-field="line.product_id.country_of_origin_id.code"/>
    </t>
    <t t-if="line.product_id.hs_code">
      <br/>
      HS Code: <span t-field="line.product_id.hs_code"/>
    </t>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.product_hs_code_and_origin.xmlopen in new window

Product Weight

ID: mint_system.account.report_invoice_document.product_weight

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//table/tbody/t[3]/tr/t[1]/td[1]/span" position="after">
  <t t-if="line.product_id.weight">
    <br/>
		Weight: <span t-field="line.product_id.weight"/>
		<span t-field="line.product_id.weight_uom_id.display_name"/>
  </t>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.product_weight.xmlopen in new window

Remove Incoterms

ID: mint_system.account.report_invoice_document.remove_incoterms

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

	<xpath expr="//p[@name='payment_communication']" position="replace">
  </xpath>

</data>

Source: snippets/account.report_invoice_document.remove_incoterms.xmlopen in new window

Remove Payment Ref

ID: mint_system.account.report_invoice_document.remove_payment_ref

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

	<xpath expr="//p[@name='payment_communication']" position="replace">
  </xpath>

</data>

Source: snippets/account.report_invoice_document.remove_payment_ref.xmlopen in new window

Remove Payment Term

ID: mint_system.account.report_invoice_document.remove_payment_term

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

	<p name="payment_term" position="replace">
  </p>

</data>

Source: snippets/account.report_invoice_document.remove_payment_term.xmlopen in new window

Remove Summary Table

ID: mint_system.account.report_invoice_document.remove_summary_table

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

<xpath expr="//div[@class='clearfix']" position="replace">
</xpath>

</data>

Source: snippets/account.report_invoice_document.remove_summary_table.xmlopen in new window

Remove Taxes

ID: mint_system.account.report_invoice_document.remove_taxes

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="60">

  <xpath expr="//th[@name='th_taxes']" position="replace"/>
  <xpath expr="//span[@id='line_tax_ids']/.." position="replace"/>

</data>

Source: snippets/account.report_invoice_document.remove_taxes.xmlopen in new window

Replace Address

ID: mint_system.account.report_invoice_document.replace_address

<?xml version="1.0"?>
<!-- Align invoice tax row right -->
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//div[@t-field='o.partner_id']" position="replace">
    <div t-field="o.partner_invoice_id" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;], &quot;no_marker&quot;: True}"/>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.replace_address.xmlopen in new window

ID: mint_system.account.report_invoice_document.replace_footer

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//p[@name='payment_communication']" position="replace">
  </xpath>
  
  <p t-if="o.invoice_payment_term_id" name="payment_term">
                        <span t-field="o.invoice_payment_term_id.note"/>
                    </p>

  <xpath expr="//p[@t-if='o.invoice_incoterm_id']" position="replace">
    <style>
      table#footer {
        width: 100%;
        font-size: 8pt;
      }
      table#footer tr, td {
        vertical-align: top;
      }
    </style>
    <table id='footer'>
      <tr>
        <td t-if="o.invoice_payment_term_id" name="payment_term">
          Zahlungsbedingungen: <span t-field="o.invoice_payment_term_id.note"/>
        </td>
        <td width="50%">
          Lieferung gemäss unseren allgemeinen Lieferbedingungen
        </td>
      </tr>
      <tr>
        <td >MWST-Nr: 
          <span t-field="o.company_id.vat"/>
        </td>
        <td>
          <table width="100%">
            <tr>
              <td width="35%">
               Bankverbindungen:
              </td>
              <td width="65%">
              UBS AG, 6301 Zug, BLZ 273, SWIFT UBSWCHZH80A
              </td>
            </tr>
            <tr>
              <td>
              </td>
              <td>
            (CHF) IBAN CH63 0027 3273 Q978 6962 0
              </td>
            </tr>

            <tr>
              <td>
              </td>
              <td>
            (EUR) IBAN CH59 0027 3273 HN10 3698 0
              </td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
    
  </xpath>

  <xpath expr="//p[@name='payment_term']" position="replace">
  </xpath>


</data>

Source: snippets/account.report_invoice_document.replace_footer.xmlopen in new window

Replace Information Table2

ID: mint_system.account.report_invoice_document.replace_information_table2

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">
  <xpath expr="//*[@id='informations']" position="replace">
    <style>
      table#informations {
        white-space: nowrap;
      }
      table#informations td:nth-child(odd) {
        text-align: left;
      }
      table#informations td:nth-child(even) {
        text-align: left;
        padding-right: 3rem;
      }
    </style>
    <table id='informations' class="table table-borderless table-sm">
      <tr>
        <td>
          <strong>Rechnungsdatum: </strong>
        </td>
        <td>
          <span t-field="o.invoice_date"/>
        </td>
        <td>
          <strong>Kontakt Rechnung: </strong>
        </td>
        <td>
          <t t-foreach="res_company.partner_id.child_ids.filtered(lambda c: c.type == 'invoice' and c.name)" t-as="delivery_partner">
            <span t-esc="delivery_partner.name" />
          </t>
        </td>
        <td>
          <strong>Zahlbar innert: </strong>
        </td>
        <td>
          <span t-field="o.invoice_payment_term_id"/>
        </td>
      </tr>
      <tr>
        <td>
          <strong>Kontakt Verkauf: </strong>
        </td>
        <td>
          <span t-field="o.invoice_user_id" />
        </td>
        <td>
          <strong>Tel. Direkt: </strong>
        </td>
        <td>
          <t t-foreach="res_company.partner_id.child_ids.filtered(lambda c: c.type == 'invoice' and c.phone)" t-as="delivery_partner">
            <span t-esc="delivery_partner.phone" />
          </t>
        </td>
        <td>
        </td>
      </tr>
      <tr>
        <td>
          <strong>Kunden-Nr.: </strong>
        </td>
        <td>
          <span t-field="o.partner_id.ref" />
        </td>
        <td>
          <strong>E-Mail:</strong>
        </td>
        <td>
          <t t-foreach="res_company.partner_id.child_ids.filtered(lambda c: c.type == 'invoice' and c.email)" t-as="delivery_partner">
            <span t-esc="delivery_partner.email" />
          </t>
        </td>
        <td>
          <!-- <strong>MWST: </strong> -->
        </td>
        <td>
          <!-- <span t-field="res_company.vat" /> -->
        </td>
      </tr>
    </table>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.replace_information_table2.xmlopen in new window

Replace Information Table

ID: mint_system.account.report_invoice_document.replace_information_table

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">
  <xpath expr="//*[@id='informations']" position="replace">
    <style>
      table#informations{
        white-space: nowrap;
      }
    </style>
    <table id='informations' class="table table-borderless table-sm">
      <tr>
        <td>
          <strong>Rechnungsdatum: </strong>
          <span t-field="o.invoice_date"/>
        </td>
        <td>
          <strong>Kontakt Rechnung: </strong>
          <t t-foreach="res_company.partner_id.child_ids.filtered(lambda c: c.type == 'invoice' and c.name)" t-as="delivery_partner">
            <span t-esc="delivery_partner.name" />
          </t>
        </td>
        <td>
          <strong>Zahlbar innert: </strong>
          <span t-field="o.invoice_payment_term_id"/>
        </td>
      </tr>
      <tr>
        <td>
          <strong>Kontakt Verkauf: </strong>
          <span t-field="o.invoice_user_id" />
        </td>
        <td>
          <strong>Tel. Direkt: </strong>
          <t t-foreach="res_company.partner_id.child_ids.filtered(lambda c: c.type == 'invoice' and c.phone)" t-as="delivery_partner">
            <span t-esc="delivery_partner.phone" />
          </t>
        </td>
        <td>
        </td>
      </tr>
      <tr>
        <td>
          <strong>Kunden-Nr.: </strong>
          <span t-field="o.partner_id.ref" />
        </td>
        <td>
          <strong>E-Mail:</strong>
          <t t-foreach="res_company.partner_id.child_ids.filtered(lambda c: c.type == 'invoice' and c.email)" t-as="delivery_partner">
            <span t-esc="delivery_partner.email" />
          </t>
        </td>
        <td>
          <!-- <strong>MWST: </strong>
          <span t-field="res_company.vat" /> -->
        </td>
      </tr>
    </table>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.replace_information_table.xmlopen in new window

Replace Infotable

ID: mint_system.account.report_invoice_document.replace_infotable

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//div[@id='informations']" position="replace">
    <style>
    table#info {
      width: 100%;
      margin-bottom: 25px;
      font-size: 9pt;
    }
    table#info tr {
      line-height: 1.2;
      text-align: left;
    }
    .note {
      font-size: 9pt;
    }
    </style>
    <table id='info'>
      <tr>
        <td></td>
        <td></td>
        <td>Order No.</td>
        <td>
          <span t-field='o.invoice_origin'/>
        </td>
      </tr>
      <tr>
        <td width="17%">Invoice date</td>
        <td width="44%">
          <span t-field='o.invoice_date' t-options='{ "widget": "date" }'/>
        </td>
        <td width="14%">Our Reference</td>
        <td width="25%">
          <span t-field='o.user_id'/>
        </td>
      </tr>
      <tr>
        <td>Customer No.</td>
        <td>
          <span t-field='o.partner_id.ref'/>
        </td>
        <td>Delivery Method</td>
        <td>
          <span t-field='o.carrier_id'/>
        </td>
      </tr>
      <tr>
        <td>Order</td>
        <td>
          <span t-field='o.ref'/>
        </td>
        <td>Incoterm</td>
        <td>
          <span t-field='o.invoice_incoterm_id'/>
        </td>
      </tr>
      <tr>
        <td>Reference</td>
        <td>
           <span t-field='o.comment'/>
        </td>
        
        <td>Delivery Date</td>
        <td>
          <span t-field='o.x_date_done' t-options='{ "widget": "date" }'/>
        </td>
    
      </tr>
    </table>
  </xpath>
</data>



Source: snippets/account.report_invoice_document.replace_infotable.xmlopen in new window

Replace Product Description

ID: mint_system.account.report_invoice_document.replace_product_description

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

<xpath expr="//td[@name='account_invoice_line_name']" position="replace">
  <t t-if="line.product_id.type_description">
	<td>
		<span style="font-weight: bold" t-field="line.product_id.type_description"/>
	</td>
  </t>
  <t t-if="not line.product_id.type_description">
	<td>
    <span t-field="line.external_name"/>
	</td>
  </t>

</xpath>

</data>

Source: snippets/account.report_invoice_document.replace_product_description.xmlopen in new window

Replace Summary

ID: mint_system.account.report_invoice_document.replace_summary

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//table[@name='invoice_line_table']" position="after">

    <style>
			table.trimada_summary tr {
				border-top: solid 1px !important;
				border-bottom: solid 1px;
				page-break-inside: avoid;
			}
			table.trimada_details tr {
			  border-top: 0px !important;
			  border-bottom: 0px;
			  line-height: 0.7;
			}
			table.trimada_summary #amount_untaxed_label {
				width: 11.5%;
				text-align: left;
			}
			table.trimada_details td#amount_by_group0 {
				width: 8%;
				text-align: left;
			}
			table.trimada_details td#amount_by_group3 {
				width: 21%;
				text-align: right;
				padding-right: 10%;
			}
			table.trimada_details td#amount_by_group4 {
				width: 27%;
				text-align: right;
				padding-right: 15%;
			}
			table.trimada_summary td#amount_by_group_label {
				width: 12%;
				text-align: left;
			}
			table.trimada_summary td#amount_by_group {
				width: 17%;
				text-align: left;
			}
			table.trimada_summary #amount_total_label {
				width: 14%;
				text-align: right;
			}
			table.trimada_summary #amount_total {
				width: 18%;
				text-align: right;
			}
    </style>

    <table class="table table-borderless table-sm trimada trimada_summary">
      <td id="amount_untaxed_label">
        <Strong>Warenwert</Strong>
      </td>

      <td>
        <table class="trimada_details">
          <t t-foreach="o.amount_by_group" t-as="amount_by_group">
            <tr style="">

              <td id="amount_by_group4">
                <span>
                  <t t-esc="amount_by_group[4]"/>
                </span>
              </td>

              <t t-if="len(o.line_ids.filtered(lambda line: line.tax_line_id)) in [0, 1] and o.amount_untaxed == amount_by_group[2]">
                <td id="amount_by_group0">
                  <span class="text-nowrap" t-esc="amount_by_group[0]"/>
                </td>
                <td id="amount_by_group3" class="text-right o_price_total">
                  <span class="text-nowrap" t-esc="amount_by_group[3]"/>
                </td>
              </t>
              <t t-else="">
                <td id="amount_by_group0">
                  <span t-esc="amount_by_group[0]"/>
                </td>
                <td id="amount_by_group3" class="text-right o_price_total">
                  <span class="text-nowrap" t-esc="amount_by_group[3]"/>
                </td>
              </t>
            </tr>
          </t>

          <t t-if="print_with_payments">
            <t t-if="o.payment_state != 'invoicing_legacy'">
              <t t-set="payments_vals" t-value="o.sudo()._get_reconciled_info_JSON_values()"/>
              <t t-foreach="payments_vals" t-as="payment_vals">
                <tr>
                  <td>
                    <i class="oe_form_field text-right oe_payment_label">Paid on <t t-esc="payment_vals['date']" t-options="{&quot;widget&quot;: &quot;date&quot;}"/>
                    </i>
                  </td>
                  <td class="text-right">
                    <span t-esc="payment_vals['amount']" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.currency_id}"/>
                  </td>
                </tr>
              </t>
              <t t-if="len(payments_vals) &gt; 0">
                <tr class="border-black">
                  <td>
                    <strong>Amount Due</strong>
                  </td>
                  <td class="text-right">
                    <span t-field="o.amount_residual"/>
                  </td>
                </tr>
              </t>
            </t>
          </t>
        </table>
      </td>

      <td id="amount_total_label">
        <strong>Total</strong>
      </td>
      <td id="amount_total">
        <span class="text-nowrap" t-field="o.amount_total"/>
      </td>

    </table>

  </xpath>

</data>


Source: snippets/account.report_invoice_document.replace_summary.xmlopen in new window

Reset Address

ID: mint_system.account.report_invoice_document.reset_address

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//t[@t-set='address']" position="replace">
    <t t-set="address">
      <div>
        <address t-field="o.partner_invoice_id" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;], &quot;no_marker&quot;: True}" />
      </div>
    </t>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.reset_address.xmlopen in new window

Round Price

ID: mint_system.account.report_invoice_document.round_price

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//span[@t-field='line.price_unit']" position="replace">
		 <span t-esc="'%g' % line.price_unit if str(line.price_unit)[::-1].find('.') >= 3 else '{0:,.2f}'.format(float(line.price_unit)).replace(',','\'')"/>
  </xpath>
   
</data>

Source: snippets/account.report_invoice_document.round_price.xmlopen in new window

Round Quantity

ID: mint_system.account.report_invoice_document.round_quantity

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//span[@t-field='line.quantity']" position="replace">
    <span t-esc="'%.2f' % line.quantity"/>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.round_quantity.xmlopen in new window

Round Total Price

ID: mint_system.account.report_invoice_document.round_total_price

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//span[@t-field='line.price_subtotal']" position="replace">
    <span t-esc="'{0:,.2f}'.format(float(line.price_subtotal)).replace(',','\'')"/>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.round_total_price.xmlopen in new window

Second Row

ID: mint_system.account.report_invoice_document.second_row

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">
  
  <xpath expr="//tbody[hasclass('invoice_tbody')]//tr" position="attributes">
    <attribute name="class" separator=" " add="first"/>
  </xpath>

  <xpath expr="//tbody[hasclass('invoice_tbody')]//tr" position="after">
    <t t-if="line.product_id.type_description">
    <tr class="second">
      <td></td>
      <td></td>
      <td colspan="5">
        <span t-field="line.external_name"/><br/>
        <t t-if="line.product_id.country_of_origin_id.code">
          Ursprungsland:
          <span t-field="line.product_id.country_of_origin_id.code" />
        </t>
        <t t-if="line.product_id.hs_code">
          / Zollposition:
          <span t-field="line.product_id.hs_code" />
        </t>
      </td>
    </tr>
    </t>
    <t t-if="not line.product_id.type_description">
    <tr class="second">
      <td></td>
      <td></td>
      <td colspan="5">
        <t t-if="line.product_id.country_of_origin_id.code">
          Ursprungsland:
          <span t-field="line.product_id.country_of_origin_id.code" />
        </t>
        <t t-if="line.product_id.hs_code">
          / Zollposition:
          <span t-field="line.product_id.hs_code" />
        </t>
      </td>
    </tr>
    </t>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.second_row.xmlopen in new window

Sequence In Table

ID: mint_system.account.report_invoice_document.sequence_in_table

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="60">

  <xpath expr="//table/thead/tr/th[1]" position="before">
    <th>
      <span>Pos</span>
    </th>
  </xpath>

  <xpath expr="//t[@t-foreach='lines']" position="before">
    <t t-set="index" t-value="1"/>
  </xpath>
  
  <xpath expr="//table/tbody//tr/t[1]/td[1]" position="before">
    <td>
      <span t-esc="index"/><t t-set="index" t-value="index+1"/>
    </td>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.sequence_in_table.xmlopen in new window

Set Ids

ID: mint_system.account.report_invoice_document.set_ids

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">
  
	<xpath expr="//th[@name='th_quantity']" position="attributes">
		<attribute name="id">th_quantity</attribute>
	</xpath>

	<xpath expr="//th[@name='th_description']" position="attributes">
		<attribute name="id">description</attribute>
	</xpath>
	<xpath expr="//table[@name='invoice_line_table']//td[2]" position="attributes">
		<attribute name="id">quantity</attribute>
	</xpath>
	<xpath expr="//table[@name='invoice_line_table']//td[2]/span[1]" position="attributes">
		<attribute name="id">qty</attribute>
	</xpath>
	
	<xpath expr="//table[@name='invoice_line_table']//td[3]/span[1]" position="attributes">
		<attribute name="id">price</attribute>
	</xpath>

</data>

Source: snippets/account.report_invoice_document.set_ids.xmlopen in new window

Show Default Code

ID: mint_system.account.report_invoice_document.show_default_code

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//table[@name='invoice_line_table']/thead/tr/th[1]" position="before">
    <th id="default_code">
      <strong >Part No.</strong>
    </th>
  </xpath>

  <xpath expr="//table[@name='invoice_line_table']/tbody/t/tr/t[1]/td[1]" position="before">
    <td id="default_code">
      <span t-field="line.product_id.default_code"/>
    </td>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.show_default_code.xmlopen in new window

Show Product Name

ID: mint_system.account.report_invoice_document.show_product_name

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="60">

  <xpath expr="//td[@name='account_invoice_line_name']" position="replace">
    <td name="account_invoice_line_name">
      <t t-if="line.product_id">
        <span t-field="line.product_id.name"/>
        <br/>
      </t>
      <span class="o_italic" t-field="line.name" t-options="{'widget': 'text'}"/>
    </td>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.show_product_name.xmlopen in new window

Style Trimada

ID: mint_system.account.report_invoice_document.style_trimada

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="60">

	<xpath expr="//div[hasclass('page')]" position="before">
		<style>
			table.trimada {
				font-size: 9pt;
				font-family: arial;
				color: black;
			}
			table.trimada tr.first td {
				padding-bottom: 0;
			}
			table.trimada tr.second td {
				padding-top: 0;
			}
			table.trimada tr.second {
				border-bottom: 1px solid rgb(220,220,220);
			}
			table.trimada thead tr {
				border-top:solid 1px;
				border-bottom: solid 1px;
			}
			table.trimada thead th#position {
				width: 5mm;
			}
			table.trimada thead th#default_code {
			  width: 27mm;
			  text-align: right;
			}
			table.trimada thead th#open_quantity {
			  width: 30mm;
			  text-align: right;
			}
			table.trimada thead th#quantity {
			  width: 25mm;
			  text-align: right !important;
			}
			table.trimada tbody td#position {
			  text-align: right;
			}
			table.trimada tbody td#default_code {
			  text-align: right;
			}
			table.trimada tbody td#open_quantity {
			  text-align: right !important;
			}
			table.trimada tbody td#quantity {
			  text-align: right;
			}			
			table.trimada tbody span#qty {
			  font-weight: bold;
			}
			table.trimada tbody span#open_qty {
			  font-weight: bold;
			}
			.address {
			  font-size: 10pt;
			  line-height: 1.2;
			  padding-bottom:33mm;
			}
			.subtitel {
				font-size: 11pt;
				font-family: arial;
				margin-top: 10mm;
			}
			.note {
				font-size: 9pt;
				font-family: arial;
			}
		</style>
	</xpath>

	<table name="invoice_line_table" position="attributes">
		<attribute name="class" separator=" " add="trimada table-borderless"/>
	</table>

	<table name="invoice_line_table" position="attributes">
		<attribute name="class" separator=" " add="trimada table-borderless"/>
	</table>

  <span id="qty" position="attributes">
		<attribute name="t-options-widget">"integer"</attribute>
	</span>
	
</data>

Source: snippets/account.report_invoice_document.style_trimada.xmlopen in new window

Switch Address Block

ID: mint_system.account.report_invoice_document.switch_address_block

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//t[@t-set='address']" position="after">
    <t t-set="information_block">
      <address t-field="o.partner_id" t-options="{'widget': 'contact', 'fields': ['address', 'name'], 'no_marker': True}"/>
      <div t-if="o.partner_id.vat" class="mt16">
          <t t-if="o.company_id.country_id.vat_label" t-esc="o.company_id.country_id.vat_label" id="inv_tax_id_label"/>
          <t t-else="">Tax ID</t>: <span t-field="o.partner_id.vat"/></div>
    </t>
  </xpath>

  <xpath expr="//t[@t-set='address']" position="replace">
    <t t-set="address">
    </t>
  </xpath>

</data>

Source: snippets/account.report_invoice_document.switch_address_block.xmlopen in new window

Unit Precision

ID: mint_system.account.report_invoice_document.unit_precision

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document" priority="50">

  <xpath expr="//tbody[1]/t[3]/tr[1]/t[1]/td[2]/span[1]" position="attributes">
		<attribute name="t-options-widget">"integer"</attribute>
  </xpath>

</data>