Merge pull request #28048 from netchampfaris/print-format-builder-templates
feat: Taxes template for selling/buying doctypes
This commit is contained in:
commit
c8d0d9ece9
@ -0,0 +1,16 @@
|
||||
{
|
||||
"creation": "2021-10-19 18:06:53.083133",
|
||||
"docstatus": 0,
|
||||
"doctype": "Print Format Field Template",
|
||||
"document_type": "Purchase Invoice",
|
||||
"field": "taxes",
|
||||
"idx": 0,
|
||||
"modified": "2021-10-19 18:06:53.083133",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Purchase Invoice Taxes",
|
||||
"owner": "Administrator",
|
||||
"standard": 1,
|
||||
"template": "",
|
||||
"template_file": "templates/print_formats/includes/taxes_and_charges.html"
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
{
|
||||
"creation": "2021-10-19 17:50:00.152759",
|
||||
"docstatus": 0,
|
||||
"doctype": "Print Format Field Template",
|
||||
"document_type": "Sales Invoice",
|
||||
"field": "taxes",
|
||||
"idx": 0,
|
||||
"modified": "2021-10-19 18:13:20.894207",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Sales Invoice Taxes",
|
||||
"owner": "Administrator",
|
||||
"standard": 1,
|
||||
"template": "",
|
||||
"template_file": "templates/print_formats/includes/taxes_and_charges.html"
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
{
|
||||
"creation": "2021-10-19 18:07:19.253457",
|
||||
"docstatus": 0,
|
||||
"doctype": "Print Format Field Template",
|
||||
"document_type": "Purchase Order",
|
||||
"field": "taxes",
|
||||
"idx": 0,
|
||||
"modified": "2021-10-19 18:07:19.253457",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Buying",
|
||||
"name": "Purchase Order Taxes",
|
||||
"owner": "Administrator",
|
||||
"standard": 1,
|
||||
"template": "",
|
||||
"template_file": "templates/print_formats/includes/taxes_and_charges.html"
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
{
|
||||
"creation": "2021-10-19 18:09:08.103919",
|
||||
"docstatus": 0,
|
||||
"doctype": "Print Format Field Template",
|
||||
"document_type": "Supplier Quotation",
|
||||
"field": "taxes",
|
||||
"idx": 0,
|
||||
"modified": "2021-10-19 18:09:08.103919",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Buying",
|
||||
"name": "Supplier Quotation Taxes",
|
||||
"owner": "Administrator",
|
||||
"standard": 1,
|
||||
"template": "",
|
||||
"template_file": "templates/print_formats/includes/taxes_and_charges.html"
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
{
|
||||
"creation": "2021-10-19 15:48:56.416449",
|
||||
"docstatus": 0,
|
||||
"doctype": "Print Format Field Template",
|
||||
"document_type": "Quotation",
|
||||
"field": "taxes",
|
||||
"idx": 0,
|
||||
"modified": "2021-10-19 18:11:33.553722",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Selling",
|
||||
"name": "Quotation Taxes",
|
||||
"owner": "Administrator",
|
||||
"standard": 1,
|
||||
"template": "",
|
||||
"template_file": "templates/print_formats/includes/taxes_and_charges.html"
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
{
|
||||
"creation": "2021-10-19 18:04:24.443076",
|
||||
"docstatus": 0,
|
||||
"doctype": "Print Format Field Template",
|
||||
"document_type": "Sales Order",
|
||||
"field": "taxes",
|
||||
"idx": 0,
|
||||
"modified": "2021-10-19 18:04:24.443076",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Selling",
|
||||
"name": "Sales Order Taxes",
|
||||
"owner": "Administrator",
|
||||
"standard": 1,
|
||||
"template": "",
|
||||
"template_file": "templates/print_formats/includes/taxes_and_charges.html"
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
{% macro render_row(label, value) %}
|
||||
<div class="field row">
|
||||
<div class="col-7 {%- if doc.align_labels_right %} text-right{%- endif -%}">
|
||||
<div class="label">{{ label }}</div>
|
||||
</div>
|
||||
<div class="text-right col-5">
|
||||
{{ value }}
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{%- macro render_discount_amount(doc) -%}
|
||||
{%- if doc.discount_amount -%}
|
||||
{{ render_row(_(doc.meta.get_label('discount_amount')), '- ' + doc.get_formatted("discount_amount", doc)) }}
|
||||
{%- endif -%}
|
||||
{%- endmacro -%}
|
||||
|
||||
<div class="row">
|
||||
<div class="col"></div>
|
||||
<div class="col">
|
||||
{%- if doc.apply_discount_on == "Net Total" -%}
|
||||
{{ render_discount_amount(doc) }}
|
||||
{%- endif -%}
|
||||
{%- for charge in doc.taxes -%}
|
||||
{%- if (charge.tax_amount or print_settings.print_taxes_with_zero_amount) and (not charge.included_in_print_rate or doc.flags.show_inclusive_tax_in_print) -%}
|
||||
{{ render_row(charge.get_formatted("description"), charge.get_formatted('tax_amount', doc)) }}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{%- if doc.apply_discount_on == "Grand Total" -%}
|
||||
{{ render_discount_amount(doc) }}
|
||||
{%- endif -%}
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user