diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index 006470f8605..7e0ed7f390c 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -255,7 +255,7 @@ class PurchaseInvoice(BuyingController): "against": self.against_expense_account, "credit": self.total_amount_to_pay, "remarks": self.remarks, - "against_voucher": self.name, + "against_voucher": self.return_against if cint(self.is_return) else self.name, "against_voucher_type": self.doctype, }) )