From 3b239772e3e7ee0f3f4e0429185e0002b6d9c46a Mon Sep 17 00:00:00 2001 From: Antoine Maas Date: Wed, 29 Jun 2022 15:39:45 +0200 Subject: [PATCH 1/3] feat: standard print format for sales invoice --- .../print_format/sales_invoice/__init__.py | 0 .../sales_invoice/sales_invoice.json | 32 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 erpnext/accounts/print_format/sales_invoice/__init__.py create mode 100644 erpnext/accounts/print_format/sales_invoice/sales_invoice.json diff --git a/erpnext/accounts/print_format/sales_invoice/__init__.py b/erpnext/accounts/print_format/sales_invoice/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/accounts/print_format/sales_invoice/sales_invoice.json b/erpnext/accounts/print_format/sales_invoice/sales_invoice.json new file mode 100644 index 0000000000..837d95c20d --- /dev/null +++ b/erpnext/accounts/print_format/sales_invoice/sales_invoice.json @@ -0,0 +1,32 @@ +{ + "absolute_value": 0, + "align_labels_right": 0, + "creation": "2022-06-29 14:44:12.967395", + "custom_format": 0, + "default_print_language": "fr", + "disabled": 0, + "doc_type": "Sales Invoice", + "docstatus": 0, + "doctype": "Print Format", + "font": "Default", + "font_size": 0, + "format_data": "[{\"fieldname\": \"print_heading_template\", \"fieldtype\": \"Custom HTML\", \"options\": \"
\\t\\t\\t\\t\\n
\\n

Facture de vente
Ref: {{ doc.name }}

\\n \\n\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\", \"pagebreak\": 0}, {\"fieldtype\": \"Column Break\"}, {\"fieldname\": \"customer_name\", \"print_hide\": 0, \"label\": \"Nom du client\"}, {\"fieldname\": \"tax_id\", \"print_hide\": 0, \"label\": \"N\\u00b0 de TVA\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldname\": \"posting_date\", \"print_hide\": 0, \"label\": \"Date\"}, {\"fieldname\": \"due_date\", \"print_hide\": 0, \"label\": \"Date d'\\u00e9ch\\u00e9ance de paiement\"}, {\"fieldtype\": \"Section Break\", \"label\": \"D\\u00e9tails de la commande client\", \"pagebreak\": 0}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldname\": \"po_no\", \"print_hide\": 0, \"label\": \"N\\u00b0 de commande fournisseur du Client\"}, {\"fieldname\": \"po_date\", \"print_hide\": 0, \"label\": \"Date de la commande client\"}, {\"fieldtype\": \"Section Break\", \"label\": \"Adresse et Contact\", \"pagebreak\": 0}, {\"fieldtype\": \"Column Break\"}, {\"fieldname\": \"address_display\", \"print_hide\": 0, \"label\": \"Adresse\"}, {\"fieldname\": \"contact_display\", \"print_hide\": 0, \"label\": \"Contact\"}, {\"fieldname\": \"contact_mobile\", \"print_hide\": 0, \"label\": \"N\\u00b0 mobile\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Section Break\", \"label\": \"Articles\", \"pagebreak\": 0}, {\"fieldtype\": \"Column Break\"}, {\"fieldname\": \"items\", \"print_hide\": 0, \"label\": \"Articles\", \"visible_columns\": [{\"fieldname\": \"item_code\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"is_down_payment_item\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"down_payment_rate\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"description\", \"print_width\": \"410px\", \"print_hide\": 0}, {\"fieldname\": \"qty\", \"print_width\": \"100px\", \"print_hide\": 0}, {\"fieldname\": \"uom\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"discount_amount\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"rate\", \"print_width\": \"85px\", \"print_hide\": 0}, {\"fieldname\": \"amount\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"asset\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"finance_book\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"deferred_revenue_account\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"service_stop_date\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"enable_deferred_revenue\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"service_start_date\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"service_end_date\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"quality_inspection\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"serial_no\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"project\", \"print_width\": \"\", \"print_hide\": 0}]}, {\"fieldtype\": \"Section Break\", \"label\": \"\", \"pagebreak\": 0}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldname\": \"total\", \"print_hide\": 0, \"label\": \"Total\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\", \"pagebreak\": 0}, {\"fieldtype\": \"Column Break\"}, {\"fieldname\": \"taxes\", \"print_hide\": 0, \"label\": \"Taxes et frais de vente\", \"visible_columns\": [{\"fieldname\": \"charge_type\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"row_id\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"account_head\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"description\", \"print_width\": \"300px\", \"print_hide\": 0}, {\"fieldname\": \"cost_center\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"rate\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"tax_amount\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"total\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"tax_amount_after_discount_amount\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"base_tax_amount\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"base_total\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"base_tax_amount_after_discount_amount\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"item_wise_tax_detail\", \"print_width\": \"\", \"print_hide\": 0}]}, {\"fieldtype\": \"Section Break\", \"label\": \"\", \"pagebreak\": 0}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldname\": \"grand_total\", \"print_hide\": 0, \"label\": \"Total TTC\"}, {\"fieldtype\": \"Section Break\", \"label\": \"Termes et conditions\", \"pagebreak\": 0}, {\"fieldtype\": \"Column Break\"}, {\"fieldname\": \"terms\", \"print_hide\": 0, \"label\": \"D\\u00e9tails des termes et conditions\"}]", + "idx": 0, + "line_breaks": 0, + "margin_bottom": 0.0, + "margin_left": 0.0, + "margin_right": 0.0, + "margin_top": 0.0, + "modified": "2022-06-29 15:00:13.899957", + "modified_by": "thierry@dokos.io", + "module": "Accounts", + "name": "Sales_Invoice", + "owner": "thierry@dokos.io", + "page_number": "Hide", + "print_format_builder": 0, + "print_format_builder_beta": 0, + "print_format_type": "Jinja", + "raw_printing": 0, + "show_section_headings": 0, + "standard": "Yes" +} \ No newline at end of file -- GitLab From 8a1dad456ecfb9e5108af71b49b73623733dcbce Mon Sep 17 00:00:00 2001 From: Antoine Maas Date: Wed, 29 Jun 2022 15:46:51 +0200 Subject: [PATCH 2/3] print UOM after quantity selected by default --- erpnext/setup/install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/setup/install.py b/erpnext/setup/install.py index 7e218f9cec..31500ec389 100644 --- a/erpnext/setup/install.py +++ b/erpnext/setup/install.py @@ -101,7 +101,7 @@ def create_print_setting_custom_fields(): "label": _("Print UOM after Quantity"), "fieldname": "print_uom_after_quantity", "fieldtype": "Check", - "default": 0, + "default": 1, "insert_after": "compact_item_print", }, ) -- GitLab From a6eff7bd6a7290f5c8e1234f72025ba80ae5cb4a Mon Sep 17 00:00:00 2001 From: Antoine Maas Date: Thu, 30 Jun 2022 09:44:14 +0200 Subject: [PATCH 3/3] fix: renamed pint format --- .../accounts/print_format/sales_invoice/sales_invoice.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/print_format/sales_invoice/sales_invoice.json b/erpnext/accounts/print_format/sales_invoice/sales_invoice.json index 837d95c20d..13c0844ea2 100644 --- a/erpnext/accounts/print_format/sales_invoice/sales_invoice.json +++ b/erpnext/accounts/print_format/sales_invoice/sales_invoice.json @@ -20,7 +20,7 @@ "modified": "2022-06-29 15:00:13.899957", "modified_by": "thierry@dokos.io", "module": "Accounts", - "name": "Sales_Invoice", + "name": "Sales Invoice", "owner": "thierry@dokos.io", "page_number": "Hide", "print_format_builder": 0, @@ -29,4 +29,4 @@ "raw_printing": 0, "show_section_headings": 0, "standard": "Yes" -} \ No newline at end of file +} -- GitLab