diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index a64548b46d..9c39f0d5a7 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -351,6 +351,7 @@ class JournalEntry(AccountsController): def set_print_format_fields(self): total_amount = 0.0 bank_account_currency = None + self.pay_to_recd_from = None for d in self.get('accounts'): if d.party_type and d.party: if not self.pay_to_recd_from: @@ -360,7 +361,10 @@ class JournalEntry(AccountsController): elif frappe.db.get_value("Account", d.account, "account_type") in ["Bank", "Cash"]: total_amount += (d.debit_in_account_currency or d.credit_in_account_currency) bank_account_currency = d.account_currency - + + if not self.pay_to_recd_from: + total_amount = 0 + self.set_total_amount(total_amount, bank_account_currency) def set_total_amount(self, amt, currency):