diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index 7c813eb329..40dcc8cc68 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -924,8 +924,8 @@ class PaymentEntry(AccountsController): self.make_invoice_liability_entry(gl_entries, d) gle.update( { - "voucher_type": "Payment Entry", - "voucher_no": self.name, + "against_voucher_type": "Payment Entry", + "against_voucher": self.name, } ) @@ -973,14 +973,20 @@ class PaymentEntry(AccountsController): "party": self.party, "account_currency": self.party_account_currency, "cost_center": self.cost_center, - "voucher_type": invoice.reference_doctype, - "voucher_no": invoice.reference_name, + "voucher_type": "Payment Entry", + "voucher_no": self.name, } dr_or_cr = "credit" if invoice.reference_doctype == "Sales Invoice" else "debit" args_dict["account"] = invoice.account args_dict[dr_or_cr] = invoice.allocated_amount args_dict[dr_or_cr + "_in_account_currency"] = invoice.allocated_amount + args_dict.update( + { + "against_voucher_type": invoice.reference_doctype, + "against_voucher": invoice.reference_name, + } + ) gle = self.get_gl_dict( args_dict, item=self,