From 4cc2afbd832aab3dfc3ac5dc668934411d79daad Mon Sep 17 00:00:00 2001 From: khushi8112 Date: Mon, 15 Sep 2025 16:34:14 +0530 Subject: [PATCH] feat: print format design two --- .../print_format_sales_invoice/__init__.py | 0 .../print_format_sales_invoice.html | 310 ++++++++++++++++++ .../print_format_sales_invoice.json | 32 ++ 3 files changed, 342 insertions(+) create mode 100644 erpnext/accounts/print_format/print_format_sales_invoice/__init__.py create mode 100644 erpnext/accounts/print_format/print_format_sales_invoice/print_format_sales_invoice.html create mode 100644 erpnext/accounts/print_format/print_format_sales_invoice/print_format_sales_invoice.json diff --git a/erpnext/accounts/print_format/print_format_sales_invoice/__init__.py b/erpnext/accounts/print_format/print_format_sales_invoice/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/erpnext/accounts/print_format/print_format_sales_invoice/print_format_sales_invoice.html b/erpnext/accounts/print_format/print_format_sales_invoice/print_format_sales_invoice.html new file mode 100644 index 00000000000..aa1f9923326 --- /dev/null +++ b/erpnext/accounts/print_format/print_format_sales_invoice/print_format_sales_invoice.html @@ -0,0 +1,310 @@ +{%- macro add_header(page_num, max_pages, doc, letter_head, no_letterhead, footer, print_settings=None, +print_heading_template=None) -%} {% if letter_head and not no_letterhead %} +
{{ letter_head }}
+{% endif %} {% if print_heading_template %} {{ frappe.render_template(print_heading_template, {"doc":doc}) }} +{% endif %} {%- if doc.meta.is_submittable and doc.docstatus==2 -%} +
+

{{ _("CANCELLED") }}

+
+{%- endif -%} {%- endmacro -%} {% for page in layout %} +
+
+ {{ add_header(loop.index, layout|len, doc, letter_head, no_letterhead, footer, print_settings) }} +
+ + + + + + + + + +
+
+
Customer Name:
+
Bill to:
+
+
+
{{ doc.customer_name }}
+
{{ doc.address_display or "" }}
+
+
+
+
Invoice Number:
+
Invoice Date:
+
Payment Due Date:
+
+
+
{{ doc.name }}
+
{{ frappe.utils.format_date(doc.posting_date) }}
+
{{ frappe.utils.format_date(doc.due_date) }}
+
+
+ + + + + + + + + + + + + + + + + + + + + + + {% for item in doc.items %} + + + + + + + + + + {% endfor %} + +
{{ _("No") }}{{ _("Item") }}{{ _("HSN/SAC") }}{{ _("Quantity") }}{{ _("Rate") }}{{ _("Amount") }}
{{ loop.index }} +
+
+ {% if item.image %} +
+ {{ item.item_name }} +
+ {% endif %} +
+
{{ item.item_name }}
+
+
{{ item.gst_hsn_code }}{{ item.get_formatted("qty", 0) }} {{ item.uom }}{{ item.get_formatted("net_rate", doc) }}{{ item.get_formatted("net_amount", doc) }}
+ + + + + + + + + + + +
  + + + + + + + + + + {% set tax_rate = doc.taxes | selectattr("tax_amount") | sum(attribute="rate") %} {% if + tax_rate > 0 %} + + + + + {% endif %} +
{{ _("Sub Total:") }}{{ doc.get_formatted("total", doc) }}
+ {{ _("Discount") }} ({{ doc.additional_discount_percentage or 0 }}%): + {{ doc.get_formatted("discount_amount", doc) }}
{{ _("Tax") }} ({{ tax_rate }}%):{{ doc.get_formatted("total_taxes_and_charges", doc) }}
+
+
+ + + + + + +
+
{{ _("In Words: ") }}{{ doc.in_words }}
+
{{ _("Grand Total:") }} + + {{ doc.get_formatted("grand_total", doc) }} + +
+
+
+ + {% if doc.taxes_and_charges %} + +
{{ _("Tax Breakup") }}
+ + + + + {% for row in doc.taxes %} + + {% endfor %} + + + + {% for item in doc.items %} + + + + {% for row in doc.taxes %} {% set tax_amount = item.base_net_amount * (row.rate / 100) %} + + {% endfor %} + + {% endfor %} + +
{{ _("HSN/SAC") }}{{ _("Taxable Amount") }}{{ row.description }} ({{ row.rate }}%)
{{ item.gst_hsn_code }}{{ item.get_formatted("base_net_amount", doc) }} + {{ frappe.format_value(tax_amount, {"fieldtype": "Currency"}, doc) }} +
+ {% endif %} + + + {% if doc.terms %} +
+
{{ _("Terms and Conditions") }}
+ {{ doc.terms}} +
+ {% endif %} +
+{% endfor %} diff --git a/erpnext/accounts/print_format/print_format_sales_invoice/print_format_sales_invoice.json b/erpnext/accounts/print_format/print_format_sales_invoice/print_format_sales_invoice.json new file mode 100644 index 00000000000..9952485cc28 --- /dev/null +++ b/erpnext/accounts/print_format/print_format_sales_invoice/print_format_sales_invoice.json @@ -0,0 +1,32 @@ +{ + "absolute_value": 0, + "align_labels_right": 0, + "creation": "2025-09-15 16:31:00.732539", + "custom_format": 0, + "default_print_language": "en", + "disabled": 0, + "doc_type": "Sales Invoice", + "docstatus": 0, + "doctype": "Print Format", + "font_size": 14, + "idx": 0, + "line_breaks": 0, + "margin_bottom": 15.0, + "margin_left": 15.0, + "margin_right": 15.0, + "margin_top": 15.0, + "modified": "2025-09-15 16:31:00.732539", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Print Format Sales Invoice", + "owner": "Administrator", + "page_number": "Hide", + "pdf_generator": "wkhtmltopdf", + "print_format_builder": 0, + "print_format_builder_beta": 0, + "print_format_for": "DocType", + "print_format_type": "Jinja", + "raw_printing": 0, + "show_section_headings": 0, + "standard": "Yes" +}