mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-15 03:01:22 +00:00
refactor: use hooks to identify advance doctypes
(cherry picked from commit e7bb960bb5)
This commit is contained in:
@@ -1166,6 +1166,10 @@ class PaymentEntry(AccountsController):
|
|||||||
if not self.party_account:
|
if not self.party_account:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
advance_payment_doctypes = frappe.get_hooks("advance_payment_receivable_doctypes") + frappe.get_hooks(
|
||||||
|
"advance_payment_payable_doctypes"
|
||||||
|
)
|
||||||
|
|
||||||
if self.payment_type == "Receive":
|
if self.payment_type == "Receive":
|
||||||
against_account = self.paid_to
|
against_account = self.paid_to
|
||||||
else:
|
else:
|
||||||
@@ -1216,10 +1220,7 @@ class PaymentEntry(AccountsController):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if self.book_advance_payments_in_separate_party_account:
|
if self.book_advance_payments_in_separate_party_account:
|
||||||
if d.reference_doctype in [
|
if d.reference_doctype in advance_payment_doctypes:
|
||||||
"Sales Order",
|
|
||||||
"Purchase Order",
|
|
||||||
]:
|
|
||||||
gle.update(
|
gle.update(
|
||||||
{
|
{
|
||||||
"against_voucher_type": d.reference_doctype,
|
"against_voucher_type": d.reference_doctype,
|
||||||
|
|||||||
Reference in New Issue
Block a user