diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index 697611d961..c469a0244e 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -334,7 +334,7 @@ class PurchaseInvoice(BuyingController): if update_outstanding == "No": update_outstanding_amt(self.credit_to, "Supplier", self.supplier, - self.doctype, self.return_against if cint(self.is_return and self.return_against) else self.name) + self.doctype, self.return_against if cint(self.is_return) and self.return_against else self.name) if repost_future_gle and cint(self.update_stock) and self.auto_accounting_for_stock: from erpnext.controllers.stock_controller import update_gl_entries_after