fix: Total amount not displayed in Journal Entry (#20794)

* fix: Total amount not displayed in Journal Entry

* fix: Update paid_to_received field

* fix: set total amount

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
This commit is contained in:
Deepesh Garg 2020-03-02 18:09:19 +05:30 committed by GitHub
parent 19df2ffbd8
commit cc2771baa7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -457,8 +457,7 @@ class JournalEntry(AccountsController):
for d in self.get('accounts'):
if d.party_type in ['Customer', 'Supplier'] and d.party:
if not pay_to_recd_from:
pay_to_recd_from = frappe.db.get_value(d.party_type, d.party,
"customer_name" if d.party_type=="Customer" else "supplier_name")
pay_to_recd_from = d.party
if pay_to_recd_from and pay_to_recd_from == d.party:
party_amount += (d.debit_in_account_currency or d.credit_in_account_currency)
@ -469,7 +468,8 @@ class JournalEntry(AccountsController):
bank_account_currency = d.account_currency
if pay_to_recd_from:
self.pay_to_recd_from = pay_to_recd_from
self.pay_to_recd_from = frappe.db.get_value(d.party_type, pay_to_recd_from,
"customer_name" if d.party_type=="Customer" else "supplier_name")
if bank_amount:
total_amount = bank_amount
currency = bank_account_currency