diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index 6bad8ffc35a4..ce76f5600885 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -1312,6 +1312,9 @@ def get_dr_and_account_for_advances(self, reference): if reference.reference_doctype == "Sales Invoice": return "credit", reference.account + if reference.reference_doctype == "Purchase Invoice": + return "debit", reference.account + if reference.reference_doctype == "Payment Entry": # reference.account_type and reference.payment_type is only available for Reverse payments if reference.account_type == "Receivable" and reference.payment_type == "Pay":