From 60ecb3075466bbe483cdddae8fcb99df41c14290 Mon Sep 17 00:00:00 2001 From: Charles-Henri Decultot Date: Wed, 23 Oct 2024 14:02:19 +0200 Subject: [PATCH] fix: Better display net rate in compact print format and correct VAT rate when included --- erpnext/controllers/print_settings.py | 4 ++-- erpnext/templates/print_formats/includes/taxes.html | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/erpnext/controllers/print_settings.py b/erpnext/controllers/print_settings.py index bc5e64d6782..e9957cdaf67 100644 --- a/erpnext/controllers/print_settings.py +++ b/erpnext/controllers/print_settings.py @@ -14,7 +14,7 @@ def set_print_templates_for_item_table(doc, settings): } } - doc.flags.compact_item_fields = ["description", "qty", "rate", "amount"] + doc.flags.compact_item_fields = ["description", "qty", "rate", "amount", "net_rate", "net_amount"] if settings.compact_item_print: doc.child_print_templates["items"][ @@ -41,7 +41,7 @@ def set_print_templates_for_taxes(doc, settings): def format_columns(display_columns, compact_fields): - compact_fields = compact_fields + ["image", "item_code", "item_name"] + compact_fields = [*compact_fields, "image", "item_code", "item_name"] final_columns = [] for column in display_columns: if column not in compact_fields: diff --git a/erpnext/templates/print_formats/includes/taxes.html b/erpnext/templates/print_formats/includes/taxes.html index 8881f81740b..48916fcaf66 100644 --- a/erpnext/templates/print_formats/includes/taxes.html +++ b/erpnext/templates/print_formats/includes/taxes.html @@ -22,8 +22,13 @@
+ {% if charge.included_in_print_rate %} + {{ frappe.format_value(frappe.utils.flt(charge.tax_amount_after_discount_amount), + table_meta.get_field("tax_amount_after_discount_amount"), doc, currency=doc.currency) }} + {% else %} {{ frappe.format_value(frappe.utils.flt(charge.tax_amount), table_meta.get_field("tax_amount"), doc, currency=doc.currency) }} + {% endif %}
{%- endif -%} -- GitLab