From 68907ca7839cc9fcb20bf8b3b47ed9318bfedf90 Mon Sep 17 00:00:00 2001 From: Sagar Sharma Date: Thu, 1 Sep 2022 19:31:55 +0530 Subject: [PATCH 1/4] chore: set BOM as default value for Backflush Raw Materials of Subcontract Based On (#32048) chore: set BOM as default value for Backflush Raw Materials of Subcontract Based On in Buying Settings --- erpnext/buying/doctype/buying_settings/buying_settings.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/buying/doctype/buying_settings/buying_settings.json b/erpnext/buying/doctype/buying_settings/buying_settings.json index 6c18a4650b..aad26075f2 100644 --- a/erpnext/buying/doctype/buying_settings/buying_settings.json +++ b/erpnext/buying/doctype/buying_settings/buying_settings.json @@ -76,7 +76,7 @@ "label": "Subcontracting Settings" }, { - "default": "Material Transferred for Subcontract", + "default": "BOM", "fieldname": "backflush_raw_materials_of_subcontract_based_on", "fieldtype": "Select", "label": "Backflush Raw Materials of Subcontract Based On", @@ -148,7 +148,7 @@ "index_web_pages_for_search": 1, "issingle": 1, "links": [], - "modified": "2022-05-31 19:40:26.103909", + "modified": "2022-09-01 18:01:34.994657", "modified_by": "Administrator", "module": "Buying", "name": "Buying Settings", From 6e8395cccdb9fc3eba0a0746450660e89155c9f5 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Fri, 2 Sep 2022 09:50:42 +0530 Subject: [PATCH 2/4] fix: key error on consolidated financial report accounts with same name but different account number will throw key error on consolidated report --- .../consolidated_financial_statement.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.py b/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.py index 98dbbf6c44..330e442a80 100644 --- a/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.py +++ b/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.py @@ -535,7 +535,11 @@ def get_accounts(root_type, companies): ): if account.account_name not in added_accounts: accounts.append(account) - added_accounts.append(account.account_name) + if account.account_number: + account_key = account.account_number + "-" + account.account_name + else: + account_key = account.account_name + added_accounts.append(account_key) return accounts From 08f2e4edc365cfd5e8d0154d7aef69ad45439bee Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Mon, 22 Aug 2022 11:54:07 +0530 Subject: [PATCH 3/4] fix: incorrect import parameter for cancel PDA --- .../process_deferred_accounting/process_deferred_accounting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/process_deferred_accounting/process_deferred_accounting.py b/erpnext/accounts/doctype/process_deferred_accounting/process_deferred_accounting.py index 8ec726b36c..1f88849b26 100644 --- a/erpnext/accounts/doctype/process_deferred_accounting/process_deferred_accounting.py +++ b/erpnext/accounts/doctype/process_deferred_accounting/process_deferred_accounting.py @@ -34,4 +34,4 @@ class ProcessDeferredAccounting(Document): filters={"against_voucher_type": self.doctype, "against_voucher": self.name}, ) - make_gl_entries(gl_entries=gl_entries, cancel=1) + make_gl_entries(gl_map=gl_entries, cancel=1) From 1c385541fa7d8f28138996447fc38f859a71e224 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Fri, 2 Sep 2022 11:22:45 +0530 Subject: [PATCH 4/4] test: pda document submission and cancellation --- .../test_process_deferred_accounting.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/erpnext/accounts/doctype/process_deferred_accounting/test_process_deferred_accounting.py b/erpnext/accounts/doctype/process_deferred_accounting/test_process_deferred_accounting.py index 164ba6aa34..5a0aeb7284 100644 --- a/erpnext/accounts/doctype/process_deferred_accounting/test_process_deferred_accounting.py +++ b/erpnext/accounts/doctype/process_deferred_accounting/test_process_deferred_accounting.py @@ -57,3 +57,16 @@ class TestProcessDeferredAccounting(unittest.TestCase): ] check_gl_entries(self, si.name, expected_gle, "2019-01-10") + + def test_pda_submission_and_cancellation(self): + pda = frappe.get_doc( + dict( + doctype="Process Deferred Accounting", + posting_date="2019-01-01", + start_date="2019-01-01", + end_date="2019-01-31", + type="Income", + ) + ) + pda.submit() + pda.cancel()