From c253f0621dd93ccb56cd3330f17db57b8eb4b38c Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 4 May 2020 12:40:39 +0530 Subject: [PATCH] fix: fieldname update for 'Credit' and 'Debit' (#21405) (#21577) * 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 (cherry picked from commit f7a0b8b5b6c92826cef6108a6a25c81d0ac4ae34) Co-authored-by: Andy Zhu --- erpnext/accounts/doctype/journal_entry/journal_entry.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index 1a530c75395..f367f952b8a 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -561,20 +561,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()