fix: fieldname update for 'Credit' and 'Debit' (#21405)

* fix: fieldname update for 'Credit' and 'Debit'

'credit' updated to 'credit_in_account_currency'
'debit' updated to 'debit_in_account_currency'

* Update journal_entry.py

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
This commit is contained in:
Andy Zhu 2020-05-04 18:39:28 +12:00 committed by GitHub
parent c4c7d15d54
commit f7a0b8b5b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -560,20 +560,20 @@ class JournalEntry(AccountsController):
if self.write_off_based_on == 'Accounts Receivable':
jd1.party_type = "Customer"
jd1.credit = flt(d.outstanding_amount, self.precision("credit", "accounts"))
jd1.credit_in_account_currency = flt(d.outstanding_amount, self.precision("credit", "accounts"))
jd1.reference_type = "Sales Invoice"
jd1.reference_name = cstr(d.name)
elif self.write_off_based_on == 'Accounts Payable':
jd1.party_type = "Supplier"
jd1.debit = flt(d.outstanding_amount, self.precision("debit", "accounts"))
jd1.debit_in_account_currency = flt(d.outstanding_amount, self.precision("debit", "accounts"))
jd1.reference_type = "Purchase Invoice"
jd1.reference_name = cstr(d.name)
jd2 = self.append('accounts', {})
if self.write_off_based_on == 'Accounts Receivable':
jd2.debit = total
jd2.debit_in_account_currency = total
elif self.write_off_based_on == 'Accounts Payable':
jd2.credit = total
jd2.credit_in_account_currency = total
self.validate_total_debit_and_credit()