mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-17 08:35:00 +00:00
refactor: use hooks to identify advance doctypes
This commit is contained in:
@@ -1263,6 +1263,10 @@ class PaymentEntry(AccountsController):
|
||||
if not self.party_account:
|
||||
return
|
||||
|
||||
advance_payment_doctypes = frappe.get_hooks("advance_payment_receivable_doctypes") + frappe.get_hooks(
|
||||
"advance_payment_payable_doctypes"
|
||||
)
|
||||
|
||||
if self.payment_type == "Receive":
|
||||
against_account = self.paid_to
|
||||
else:
|
||||
@@ -1313,10 +1317,7 @@ class PaymentEntry(AccountsController):
|
||||
)
|
||||
|
||||
if self.book_advance_payments_in_separate_party_account:
|
||||
if d.reference_doctype in [
|
||||
"Sales Order",
|
||||
"Purchase Order",
|
||||
]:
|
||||
if d.reference_doctype in advance_payment_doctypes:
|
||||
gle.update(
|
||||
{
|
||||
"against_voucher_type": d.reference_doctype,
|
||||
|
||||
Reference in New Issue
Block a user