refactor: reference update logic in advance

(cherry picked from commit a112581acd)
This commit is contained in:
ruthra kumar
2024-10-12 15:29:48 +05:30
committed by Mergify
parent b72906a7a1
commit ca0a962870

View File

@@ -1215,7 +1215,8 @@ class PaymentEntry(AccountsController):
} }
) )
if self.book_advance_payments_in_separate_party_account and d.reference_doctype in [ if self.book_advance_payments_in_separate_party_account:
if d.reference_doctype in [
"Sales Order", "Sales Order",
"Purchase Order", "Purchase Order",
]: ]:
@@ -1227,6 +1228,13 @@ class PaymentEntry(AccountsController):
) )
else: else:
gle.update({"against_voucher_type": self.doctype, "against_voucher": self.name}) gle.update({"against_voucher_type": self.doctype, "against_voucher": self.name})
else:
gle.update(
{
"against_voucher_type": d.reference_doctype,
"against_voucher": d.reference_name,
}
)
gl_entries.append(gle) gl_entries.append(gle)