From 62c3ca8286e131d9d4072e9c8d3d298133c755d5 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Mon, 26 Jun 2023 23:53:55 +0530 Subject: [PATCH] fix: Paid invoice in AR report --- .../accounts/doctype/payment_entry/payment_entry.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index 8141d0519e6..cbf8c0865f3 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -986,12 +986,20 @@ class PaymentEntry(AccountsController): gle = party_gl_dict.copy() allocated_amount_in_company_currency = self.calculate_base_allocated_amount_for_reference(d) + + if self.book_advance_payments_in_separate_party_account: + against_voucher_type = "Payment Entry" + against_voucher = self.name + else: + against_voucher_type = d.reference_doctype + against_voucher = d.reference_name + gle.update( { dr_or_cr: allocated_amount_in_company_currency, dr_or_cr + "_in_account_currency": d.allocated_amount, - "against_voucher_type": d.reference_doctype, - "against_voucher": d.reference_name, + "against_voucher_type": against_voucher_type, + "against_voucher": against_voucher, "cost_center": cost_center, } )