[fix] Total Amount in Journal Entry

This commit is contained in:
Nabin Hait 2016-01-19 15:44:55 +05:30
parent c978b9c36a
commit 77532cc8db

View File

@ -351,6 +351,7 @@ class JournalEntry(AccountsController):
def set_print_format_fields(self): def set_print_format_fields(self):
total_amount = 0.0 total_amount = 0.0
bank_account_currency = None bank_account_currency = None
self.pay_to_recd_from = None
for d in self.get('accounts'): for d in self.get('accounts'):
if d.party_type and d.party: if d.party_type and d.party:
if not self.pay_to_recd_from: 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"]: 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) total_amount += (d.debit_in_account_currency or d.credit_in_account_currency)
bank_account_currency = d.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) self.set_total_amount(total_amount, bank_account_currency)
def set_total_amount(self, amt, currency): def set_total_amount(self, amt, currency):