Browse Source

feat: Taxes template for selling/buying doctypes

Depends on the new Print Format Builder
frappe/frappe#14134
develop
Faris Ansari 3 years ago
parent
commit
8b547e39a8
  1. 0
      erpnext/accounts/print_format_field_template/__init__.py
  2. 0
      erpnext/accounts/print_format_field_template/purchase_invoice_taxes/__init__.py
  3. 16
      erpnext/accounts/print_format_field_template/purchase_invoice_taxes/purchase_invoice_taxes.json
  4. 0
      erpnext/accounts/print_format_field_template/sales_invoice_taxes/__init__.py
  5. 16
      erpnext/accounts/print_format_field_template/sales_invoice_taxes/sales_invoice_taxes.json
  6. 0
      erpnext/buying/print_format_field_template/__init__.py
  7. 0
      erpnext/buying/print_format_field_template/purchase_order_taxes/__init__.py
  8. 16
      erpnext/buying/print_format_field_template/purchase_order_taxes/purchase_order_taxes.json
  9. 0
      erpnext/buying/print_format_field_template/supplier_quotation_taxes/__init__.py
  10. 16
      erpnext/buying/print_format_field_template/supplier_quotation_taxes/supplier_quotation_taxes.json
  11. 0
      erpnext/selling/print_format_field_template/__init__.py
  12. 0
      erpnext/selling/print_format_field_template/quotation_taxes/__init__.py
  13. 16
      erpnext/selling/print_format_field_template/quotation_taxes/quotation_taxes.json
  14. 0
      erpnext/selling/print_format_field_template/sales_order_taxes/__init__.py
  15. 16
      erpnext/selling/print_format_field_template/sales_order_taxes/sales_order_taxes.json
  16. 34
      erpnext/templates/print_formats/includes/taxes_and_charges.html

0
erpnext/accounts/print_format_field_template/__init__.py

0
erpnext/accounts/print_format_field_template/purchase_invoice_taxes/__init__.py

16
erpnext/accounts/print_format_field_template/purchase_invoice_taxes/purchase_invoice_taxes.json

@ -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
erpnext/accounts/print_format_field_template/sales_invoice_taxes/__init__.py

16
erpnext/accounts/print_format_field_template/sales_invoice_taxes/sales_invoice_taxes.json

@ -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
erpnext/buying/print_format_field_template/__init__.py

0
erpnext/buying/print_format_field_template/purchase_order_taxes/__init__.py

16
erpnext/buying/print_format_field_template/purchase_order_taxes/purchase_order_taxes.json

@ -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
erpnext/buying/print_format_field_template/supplier_quotation_taxes/__init__.py

16
erpnext/buying/print_format_field_template/supplier_quotation_taxes/supplier_quotation_taxes.json

@ -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
erpnext/selling/print_format_field_template/__init__.py

0
erpnext/selling/print_format_field_template/quotation_taxes/__init__.py

16
erpnext/selling/print_format_field_template/quotation_taxes/quotation_taxes.json

@ -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
erpnext/selling/print_format_field_template/sales_order_taxes/__init__.py

16
erpnext/selling/print_format_field_template/sales_order_taxes/sales_order_taxes.json

@ -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"
}

34
erpnext/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…
Cancel
Save