chore: add regional support for getting payment entries (#37119)

chore: add regional support for get payment entries
This commit is contained in:
Smit Vora 2023-09-19 20:47:21 +05:30 committed by GitHub
parent c35dea7177
commit 3e282bfbce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 3 deletions

View File

@ -19,7 +19,7 @@ from erpnext.accounts.utils import (
get_outstanding_invoices, get_outstanding_invoices,
reconcile_against_document, 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): class PaymentReconciliation(Document):
@ -78,7 +78,7 @@ class PaymentReconciliation(Document):
if self.payment_name: if self.payment_name:
condition.update({"name": 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_type,
self.party, self.party,
party_account, party_account,
@ -363,6 +363,7 @@ class PaymentReconciliation(Document):
) )
def reconcile_allocations(self, skip_ref_details_update_for_pe=False): def reconcile_allocations(self, skip_ref_details_update_for_pe=False):
adjust_allocations_for_taxes(self)
dr_or_cr = ( dr_or_cr = (
"credit_in_account_currency" "credit_in_account_currency"
if erpnext.get_party_account_type(self.party_type) == "Receivable" if erpnext.get_party_account_type(self.party_type) == "Receivable"
@ -663,3 +664,8 @@ def reconcile_dr_cr_note(dr_cr_notes, company):
None, None,
inv.cost_center, inv.cost_center,
) )
@erpnext.allow_regional
def adjust_allocations_for_taxes(doc):
pass

View File

@ -969,7 +969,7 @@ class AccountsController(TransactionBase):
party_type, party, party_account, amount_field, order_doctype, order_list, include_unallocated 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 party_type, party, party_account, order_doctype, order_list, include_unallocated
) )
@ -2410,6 +2410,11 @@ def get_advance_journal_entries(
return list(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( def get_advance_payment_entries(
party_type, party_type,
party, party,