From 3e282bfbceb6bbf3cfb015f92790b534335f97da Mon Sep 17 00:00:00 2001 From: Smit Vora Date: Tue, 19 Sep 2023 20:47:21 +0530 Subject: [PATCH] chore: add regional support for getting payment entries (#37119) chore: add regional support for get payment entries --- .../payment_reconciliation/payment_reconciliation.py | 10 ++++++++-- erpnext/controllers/accounts_controller.py | 7 ++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py index 96ae0c30f9..3285a529d2 100644 --- a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py +++ b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py @@ -19,7 +19,7 @@ from erpnext.accounts.utils import ( get_outstanding_invoices, reconcile_against_document, ) -from erpnext.controllers.accounts_controller import get_advance_payment_entries +from erpnext.controllers.accounts_controller import get_advance_payment_entries_for_regional class PaymentReconciliation(Document): @@ -78,7 +78,7 @@ class PaymentReconciliation(Document): if self.payment_name: condition.update({"name": self.payment_name}) - payment_entries = get_advance_payment_entries( + payment_entries = get_advance_payment_entries_for_regional( self.party_type, self.party, party_account, @@ -363,6 +363,7 @@ class PaymentReconciliation(Document): ) def reconcile_allocations(self, skip_ref_details_update_for_pe=False): + adjust_allocations_for_taxes(self) dr_or_cr = ( "credit_in_account_currency" if erpnext.get_party_account_type(self.party_type) == "Receivable" @@ -663,3 +664,8 @@ def reconcile_dr_cr_note(dr_cr_notes, company): None, inv.cost_center, ) + + +@erpnext.allow_regional +def adjust_allocations_for_taxes(doc): + pass diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 475a543758..e635aa7924 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -969,7 +969,7 @@ class AccountsController(TransactionBase): party_type, party, party_account, amount_field, order_doctype, order_list, include_unallocated ) - payment_entries = get_advance_payment_entries( + payment_entries = get_advance_payment_entries_for_regional( party_type, party, party_account, order_doctype, order_list, include_unallocated ) @@ -2410,6 +2410,11 @@ def get_advance_journal_entries( return list(journal_entries) +@erpnext.allow_regional +def get_advance_payment_entries_for_regional(*args, **kwargs): + return get_advance_payment_entries(*args, **kwargs) + + def get_advance_payment_entries( party_type, party,