You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gn_odoo/gn_discount/views/invoice_report.xml

65 lines
2.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="gn_discount_report_invoice" inherit_id="account.report_invoice_document">
<!--<xpath expr="//span[@t-field='o.amount_untaxed']" position="replace">
<span t-field="o.amount_undiscounted"/>
</xpath>-->
<!--<xpath expr="//tr[td[strong[text()='Subtotal']]]" position="replace">-->
<xpath expr="//t[@t-set='display_discount']" position="replace">
<t t-set="display_discount" t-value="false"/>
</xpath>
<xpath expr="//tr[@class='border-black o_subtotal']" position="replace">
<t t-if="o.amount_discount &gt; 0">
<tr class="border-black">
<td><strong>Subtotal</strong></td>
<td class="text-right">
<span
t-if="o.amount_discount &gt;= 0"
t-att-style="'text-decoration: line-through' or None"
t-att-class="'text-danger' or ''"
data-id="total_before_discount"
t-field="o.amount_undiscounted"
/>
</td>
</tr>
<tr>
<td>Discount**</td>
<td class="text-right">
<div>
<span>-</span>
<span t-if="o.amount_discount" t-field="o.amount_discount"/>
</div>
</td>
</tr>
<tr>
<td><strong>Subtotal with discount</strong></td>
<td class="text-right">
<div>
<div t-if="o.amount_discount" t-field="o.amount_untaxed">
</div>
</div>
</td>
</tr>
</t>
<t-else>
<tr class="border-black">
<td><strong>Subtotal</strong></td>
<td class="text-right">
<span t-field="o.amount_untaxed"/>
</td>
</tr>
</t-else>
</xpath>
<xpath expr="//td[.//span[@t-field='line.price_subtotal']]" position="replace">
<td class="text-right o_price_total">
<span t-field="line.price_subtotal_before_discount"/>
</td>
</xpath>
</template>
</odoo>