From 9ec6aef95d99c148731404f2f6b9e323fd2b8b16 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Fri, 28 Jun 2024 20:48:22 +0530 Subject: [PATCH] refactor: handle purchase invoice as reference --- erpnext/accounts/doctype/payment_entry/payment_entry.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index 6bad8ffc35a..ce76f560088 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -1312,6 +1312,9 @@ class PaymentEntry(AccountsController): 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":