From 43af598785fb30f21498c1148aeb1ffe3295cb95 Mon Sep 17 00:00:00 2001 From: Charles-Henri Decultot Date: Fri, 5 Jan 2024 14:20:37 +0100 Subject: [PATCH 1/2] chore: Make bank reconciliation page extendable --- .../bank_reconciliation/bank_reconciliation.js | 11 ++++++++++- .../bank_reconciliation.js | 15 +++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/erpnext/accounts/page/bank_reconciliation/bank_reconciliation.js b/erpnext/accounts/page/bank_reconciliation/bank_reconciliation.js index 1c2f751b3c8..8a428af9430 100644 --- a/erpnext/accounts/page/bank_reconciliation/bank_reconciliation.js +++ b/erpnext/accounts/page/bank_reconciliation/bank_reconciliation.js @@ -2,9 +2,18 @@ // For license information, please see license.txt frappe.provide("erpnext.accounts"); +frappe.provide("erpnext.bank_reconciliation"); frappe.pages['bank-reconciliation'].on_page_load = function(wrapper) { + wrapper.page = frappe.ui.make_app_page({ + parent: wrapper, + title: __("Bank Reconciliation"), + single_column: true + }); + + frappe.utils.make_event_emitter(erpnext.bank_reconciliation); + frappe.require('bank_reconciliation.bundle.js', function() { - new erpnext.accounts.bankReconciliationPage(wrapper); + erpnext.accounts.bank_reconciliation_page = new erpnext.accounts.bankReconciliationPage(wrapper); }); } diff --git a/erpnext/accounts/page/bank_reconciliation/bank_reconciliation_page/bank_reconciliation.js b/erpnext/accounts/page/bank_reconciliation/bank_reconciliation_page/bank_reconciliation.js index 41e33be39f2..c82d9710449 100644 --- a/erpnext/accounts/page/bank_reconciliation/bank_reconciliation_page/bank_reconciliation.js +++ b/erpnext/accounts/page/bank_reconciliation/bank_reconciliation_page/bank_reconciliation.js @@ -4,11 +4,6 @@ frappe.provide("erpnext.bank_reconciliation") erpnext.accounts.bankReconciliationPage = class BankReconciliationPage { constructor(wrapper) { - this.page = frappe.ui.make_app_page({ - parent: wrapper, - title: __("Bank Reconciliation"), - single_column: true - }); this.parent = wrapper; this.page = this.parent.page; @@ -19,10 +14,18 @@ erpnext.accounts.bankReconciliationPage = class BankReconciliationPage { ) this.bank_account = this.user_bank_account; this.date_range = [frappe.datetime.add_months(frappe.datetime.get_today(),-1), frappe.datetime.get_today()]; - frappe.utils.make_event_emitter(erpnext.bank_reconciliation); + + this.emit_initial_events() + this.make(); } + emit_initial_events() { + if (this.user_bank_account) { + erpnext.bank_reconciliation.trigger("filter_change", {name: 'BANK_ACCOUNT', value: this.user_bank_account}) + } + } + make() { const me = this; -- GitLab From a51a1ca41b144f03a94d1abc142ba2cdd0b68e20 Mon Sep 17 00:00:00 2001 From: Charles-Henri Decultot Date: Fri, 5 Jan 2024 16:03:49 +0100 Subject: [PATCH 2/2] fix: Remove top margin on taxes and unhide discount by default --- .../sales_invoice_return/sales_invoice_return.html | 2 +- erpnext/selling/doctype/quotation/quotation.json | 5 ++--- erpnext/templates/print_formats/includes/taxes.html | 2 +- .../templates/print_formats/includes/taxes_and_charges.html | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/erpnext/accounts/print_format/sales_invoice_return/sales_invoice_return.html b/erpnext/accounts/print_format/sales_invoice_return/sales_invoice_return.html index 62afc3c9e19..b474fdbe2fc 100644 --- a/erpnext/accounts/print_format/sales_invoice_return/sales_invoice_return.html +++ b/erpnext/accounts/print_format/sales_invoice_return/sales_invoice_return.html @@ -17,7 +17,7 @@ {%- macro render_taxes(df, doc) -%} {%- set data = doc.get(df.fieldname)[df.start:df.end] -%} -
+
{%- for charge in data -%} diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json index c8086f81ab0..315d9a55fce 100644 --- a/erpnext/selling/doctype/quotation/quotation.json +++ b/erpnext/selling/doctype/quotation/quotation.json @@ -639,8 +639,7 @@ "fieldname": "discount_amount", "fieldtype": "Currency", "label": "Additional Discount Amount", - "options": "currency", - "print_hide": 1 + "options": "currency" }, { "fieldname": "totals", @@ -1080,7 +1079,7 @@ "idx": 82, "is_submittable": 1, "links": [], - "modified": "2023-07-28 16:57:43.666306", + "modified": "2024-01-05 15:56:54.965566", "modified_by": "Administrator", "module": "Selling", "name": "Quotation", diff --git a/erpnext/templates/print_formats/includes/taxes.html b/erpnext/templates/print_formats/includes/taxes.html index 068028daf1b..8881f81740b 100644 --- a/erpnext/templates/print_formats/includes/taxes.html +++ b/erpnext/templates/print_formats/includes/taxes.html @@ -10,7 +10,7 @@ {%- endif -%} {%- endmacro -%} -
+
{%- if doc.apply_discount_on == "Net Total" -%} diff --git a/erpnext/templates/print_formats/includes/taxes_and_charges.html b/erpnext/templates/print_formats/includes/taxes_and_charges.html index 92100c49481..ccbd84f33ef 100644 --- a/erpnext/templates/print_formats/includes/taxes_and_charges.html +++ b/erpnext/templates/print_formats/includes/taxes_and_charges.html @@ -15,7 +15,7 @@ {%- endif -%} {%- endmacro -%} -
+
{%- if doc.apply_discount_on == "Net Total" -%} -- GitLab