fix: error message when making reverse journal entry (#24665)

This commit is contained in:
Afshan 2021-02-22 19:25:57 +05:30 committed by GitHub
parent 311bb6452f
commit fdafb55fba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -229,11 +229,11 @@ class JournalEntry(AccountsController):
if d.reference_type=="Journal Entry": if d.reference_type=="Journal Entry":
account_root_type = frappe.db.get_value("Account", d.account, "root_type") account_root_type = frappe.db.get_value("Account", d.account, "root_type")
if account_root_type == "Asset" and flt(d.debit) > 0: if account_root_type == "Asset" and flt(d.debit) > 0:
frappe.throw(_("For {0}, only credit accounts can be linked against another debit entry") frappe.throw(_("Row #{0}: For {1}, you can select reference document only if account gets credited")
.format(d.account)) .format(d.idx, d.account))
elif account_root_type == "Liability" and flt(d.credit) > 0: elif account_root_type == "Liability" and flt(d.credit) > 0:
frappe.throw(_("For {0}, only debit accounts can be linked against another credit entry") frappe.throw(_("Row #{0}: For {1}, you can select reference document only if account gets debited")
.format(d.account)) .format(d.idx, d.account))
if d.reference_name == self.name: if d.reference_name == self.name:
frappe.throw(_("You can not enter current voucher in 'Against Journal Entry' column")) frappe.throw(_("You can not enter current voucher in 'Against Journal Entry' column"))