fix(pe): set contact fields

This commit is contained in:
David Arnold
2024-02-06 02:04:03 +01:00
committed by David
parent f24f51b7de
commit 98c7f44280

View File

@@ -30,7 +30,7 @@ from erpnext.accounts.general_ledger import (
make_reverse_gl_entries,
process_gl_map,
)
from erpnext.accounts.party import get_party_account
from erpnext.accounts.party import get_party_account, set_contact_details
from erpnext.accounts.utils import (
cancel_exchange_gain_loss_journal,
get_account_currency,
@@ -444,6 +444,8 @@ class PaymentEntry(AccountsController):
self.party_name = frappe.db.get_value(self.party_type, self.party, "name")
if self.party:
if not self.contact_person:
set_contact_details(self, party=frappe._dict({"name": self.party}), party_type=self.party_type)
if not self.party_balance:
self.party_balance = get_balance_on(
party_type=self.party_type, party=self.party, date=self.posting_date, company=self.company