diff options
| author | rmu-odoo <rmu@openerp.com> | 2017-10-23 17:06:15 +0530 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2018-02-06 15:49:45 +0530 |
| commit | f6216a99df42beefe70f75414eaa6c9eadb92430 (patch) | |
| tree | d47aabe79912959eed1c253aca30f4b1b77c3c7a /addons | |
| parent | e25d0b38913c276e67e415e76af5720bb99fc04c (diff) | |
[IMP] sale,account: display tax amount when rounding method is perline
Display the tax amount on the sale/invoice line report
Task id: 31052
Closes #20531
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/account/views/report_invoice.xml | 14 | ||||
| -rw-r--r-- | addons/report_intrastat/report/report_intrastat_invoice_template.xml | 15 | ||||
| -rw-r--r-- | addons/sale/report/sale_report_templates.xml | 8 |
3 files changed, 36 insertions, 1 deletions
diff --git a/addons/account/views/report_invoice.xml b/addons/account/views/report_invoice.xml index 486f4c50d07..be284b823dd 100644 --- a/addons/account/views/report_invoice.xml +++ b/addons/account/views/report_invoice.xml @@ -52,6 +52,11 @@ <!-- Is there a discount on at least one line? --> <t t-set="display_discount" t-value="any([l.discount for l in o.invoice_line_ids])"/> + <!-- show only in sale invoice --> + <t t-set="type_is_out" t-value="o.type == 'out_invoice'"/> + <!-- if Rounding Method is computed per line --> + <t t-set="display_taxamount" + t-value="o.company_id.tax_calculation_rounding_method == 'round_per_line'"/> <table class="table table-condensed" name="invoice_line_table"> <thead> @@ -62,6 +67,7 @@ <th class="text-right">Unit Price</th> <th t-if="display_discount" class="text-right">Disc.(%)</th> <th class="text-right">Taxes</th> + <th t-if="display_taxamount and type_is_out" class="text-right">Tax Amount</th> <th class="text-right">Amount</th> </tr> </thead> @@ -82,6 +88,13 @@ <td class="text-right"> <span t-esc="', '.join(map(lambda x: (x.description or x.name), l.invoice_line_tax_ids))"/> </td> + <td t-if="display_taxamount and type_is_out" class="text-right"> + <t t-set="taxes" + t-value="l.invoice_line_tax_ids.compute_all(l.price_unit, l.currency_id, l.quantity)"/> + <t t-set="tax_amount" + t-value="taxes and (taxes['total_included'] - taxes['base']) or 0.0"/> + <span t-esc="tax_amount" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> + </td> <td class="text-right" id="subtotal"> <span t-field="l.price_subtotal" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> @@ -93,6 +106,7 @@ <td></td> <td></td> <td t-if="display_discount"></td> + <td t-if="display_taxamount and type_is_out"></td> <td></td> <td></td> </tr> diff --git a/addons/report_intrastat/report/report_intrastat_invoice_template.xml b/addons/report_intrastat/report/report_intrastat_invoice_template.xml index 50fe807269b..580a1341986 100644 --- a/addons/report_intrastat/report/report_intrastat_invoice_template.xml +++ b/addons/report_intrastat/report/report_intrastat_invoice_template.xml @@ -39,12 +39,18 @@ <!-- Is there a discount on at least one line? --> <t t-set="display_discount" t-value="any([l.discount for l in o.invoice_line_ids])"/> + <!-- show only in sale invoice --> + <t t-set="type_is_out" t-value="o.type == 'out_invoice'"/> + <!-- if Rounding Method is computed per line --> + <t t-set="display_taxamount" + t-value="o.company_id.tax_calculation_rounding_method == 'round_per_line'"/> <table class="table table-condensed"> <thead> <tr> <th>Description</th> <th class="text-right">Taxes</th> + <th t-if="display_taxamount and type_is_out" class="text-right">Tax Amount</th> <th class="text-right">Intrastat</th> <th class="text-right">Weight</th> <th class="text-right">Quantity</th> @@ -58,6 +64,13 @@ <tr t-foreach="o.invoice_line_ids" t-as="l"> <td><span t-field="l.name"/></td> <td class="text-right"><span t-esc="', '.join(map(lambda x: x.name, l.invoice_line_tax_ids))"/></td> + <td t-if="display_taxamount and type_is_out" class="text-right"> + <t t-set="taxes" + t-value="l.invoice_line_tax_ids.compute_all(l.price_unit, l.currency_id, l.quantity)"/> + <t t-set="tax_amount" + t-value="taxes and (taxes['total_included'] - taxes['base']) or 0.0"/> + <span t-esc="tax_amount" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> + </td> <td class="text-right"><span t-esc="l.product_id.intrastat_id.name"/></td> <td class="text-right"><span t-esc="l.product_id.weight"/></td> <td class="text-right"><span t-field="l.quantity"/></td> @@ -86,7 +99,7 @@ </td> </tr> <tr> - <td>Taxes</td> + <td>Taxes Amount</td> <td class="text-right"> <span t-field="o.amount_tax" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> </td> diff --git a/addons/sale/report/sale_report_templates.xml b/addons/sale/report/sale_report_templates.xml index 3352f75b048..e0a4e340d6d 100644 --- a/addons/sale/report/sale_report_templates.xml +++ b/addons/sale/report/sale_report_templates.xml @@ -64,6 +64,9 @@ <!-- Is there a discount on at least one line? --> <t t-set="display_discount" t-value="any([l.discount for l in doc.order_line])"/> + <!-- if Rounding Method is computed per line --> + <t t-set="display_taxamount" + t-value="doc.company_id.tax_calculation_rounding_method == 'round_per_line'"/> <t t-foreach="doc.order_lines_layouted()" t-as="page"> <table class="table table-condensed"> @@ -74,6 +77,7 @@ <th class="text-right">Unit Price</th> <th t-if="display_discount" class="text-right" groups="sale.group_discount_per_so_line">Disc.(%)</th> <th class="text-right">Taxes</th> + <th t-if="display_taxamount" class="text-right">Tax Amount</th> <th class="text-right" groups="sale.group_show_price_subtotal">Amount</th> <th class="text-right price_tax_included" groups="sale.group_show_price_total">Total Price</th> </tr> @@ -106,6 +110,10 @@ <td class="text-right"> <span t-esc="', '.join(map(lambda x: (x.description or x.name), l.tax_id))"/> </td> + <td t-if="display_taxamount" class="text-right"> + <span t-field="l.price_tax" + t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'/> + </td> <td class="text-right" groups="sale.group_show_price_subtotal"> <span t-field="l.price_subtotal" t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'/> |
