From 40f904391e2b8e0d2f8c86b5e392b9c366d9228b Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Mon, 20 Nov 2023 11:52:26 +0530 Subject: [PATCH 1/3] refactor: set default for 'update_billed_amount_in_delivery_note' (cherry picked from commit ee0c64215d160f0bd493bcefc9e94a5a90d318d2) --- erpnext/accounts/doctype/sales_invoice/sales_invoice.json | 4 ++-- erpnext/controllers/sales_and_purchase_return.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json index 5ec612f6b0f..6b26d40303b 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json @@ -2147,7 +2147,7 @@ "label": "Use Company default Cost Center for Round off" }, { - "default": "0", + "default": "1", "depends_on": "eval: doc.is_return", "fieldname": "update_billed_amount_in_delivery_note", "fieldtype": "Check", @@ -2164,7 +2164,7 @@ "link_fieldname": "consolidated_invoice" } ], - "modified": "2023-11-03 14:39:38.012346", + "modified": "2023-11-20 11:51:43.555197", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice", diff --git a/erpnext/controllers/sales_and_purchase_return.py b/erpnext/controllers/sales_and_purchase_return.py index a69b21c7c1d..5a6c87c2169 100644 --- a/erpnext/controllers/sales_and_purchase_return.py +++ b/erpnext/controllers/sales_and_purchase_return.py @@ -356,6 +356,7 @@ def make_return_doc(doctype: str, source_name: str, target_doc=None): if doc.doctype == "Sales Invoice" or doc.doctype == "POS Invoice": doc.consolidated_invoice = "" doc.set("payments", []) + doc.update_billed_amount_in_delivery_note = True for data in source.payments: paid_amount = 0.00 base_paid_amount = 0.00 From 9f8aa7c59d34d8de393e150eea5942b01e2fcc59 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Mon, 20 Nov 2023 12:27:43 +0530 Subject: [PATCH 2/3] refactor: add flag to POS Invoice (cherry picked from commit 83a13e22b7f4aa8ba2c406389af4e7fa8aad55d0) # Conflicts: # erpnext/accounts/doctype/pos_invoice/pos_invoice.json --- .../accounts/doctype/pos_invoice/pos_invoice.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/erpnext/accounts/doctype/pos_invoice/pos_invoice.json b/erpnext/accounts/doctype/pos_invoice/pos_invoice.json index eedaaaf338b..83b025e594c 100644 --- a/erpnext/accounts/doctype/pos_invoice/pos_invoice.json +++ b/erpnext/accounts/doctype/pos_invoice/pos_invoice.json @@ -18,6 +18,7 @@ "is_pos", "is_return", "update_billed_amount_in_sales_order", + "update_billed_amount_in_delivery_note", "column_break1", "company", "posting_date", @@ -1549,12 +1550,23 @@ "fieldtype": "Currency", "label": "Amount Eligible for Commission", "read_only": 1 + }, + { + "default": "1", + "depends_on": "eval: doc.is_return && doc.return_against", + "fieldname": "update_billed_amount_in_delivery_note", + "fieldtype": "Check", + "label": "Update Billed Amount in Delivery Note" } ], "icon": "fa fa-file-text", "is_submittable": 1, "links": [], +<<<<<<< HEAD "modified": "2022-09-30 03:49:50.455199", +======= + "modified": "2023-11-20 12:27:12.848149", +>>>>>>> 83a13e22b7 (refactor: add flag to POS Invoice) "modified_by": "Administrator", "module": "Accounts", "name": "POS Invoice", From 12f027b3f48069c17f85acb562e5cfa48940886a Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Mon, 20 Nov 2023 14:15:03 +0530 Subject: [PATCH 3/3] chore: resolve conflict --- erpnext/accounts/doctype/pos_invoice/pos_invoice.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/erpnext/accounts/doctype/pos_invoice/pos_invoice.json b/erpnext/accounts/doctype/pos_invoice/pos_invoice.json index 83b025e594c..de333cb9e8d 100644 --- a/erpnext/accounts/doctype/pos_invoice/pos_invoice.json +++ b/erpnext/accounts/doctype/pos_invoice/pos_invoice.json @@ -1562,11 +1562,7 @@ "icon": "fa fa-file-text", "is_submittable": 1, "links": [], -<<<<<<< HEAD - "modified": "2022-09-30 03:49:50.455199", -======= "modified": "2023-11-20 12:27:12.848149", ->>>>>>> 83a13e22b7 (refactor: add flag to POS Invoice) "modified_by": "Administrator", "module": "Accounts", "name": "POS Invoice",