fix: error message when making reverse journal entry (#24665)
This commit is contained in:
parent
311bb6452f
commit
fdafb55fba
@ -102,7 +102,7 @@ class JournalEntry(AccountsController):
|
|||||||
if account_currency == previous_account_currency:
|
if account_currency == previous_account_currency:
|
||||||
if self.total_credit != doc.total_debit or self.total_debit != doc.total_credit:
|
if self.total_credit != doc.total_debit or self.total_debit != doc.total_credit:
|
||||||
frappe.throw(_("Total Credit/ Debit Amount should be same as linked Journal Entry"))
|
frappe.throw(_("Total Credit/ Debit Amount should be same as linked Journal Entry"))
|
||||||
|
|
||||||
def validate_stock_accounts(self):
|
def validate_stock_accounts(self):
|
||||||
stock_accounts = get_stock_accounts(self.company, self.doctype, self.name)
|
stock_accounts = get_stock_accounts(self.company, self.doctype, self.name)
|
||||||
for account in stock_accounts:
|
for account in stock_accounts:
|
||||||
@ -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"))
|
||||||
@ -1077,4 +1077,4 @@ def make_reverse_journal_entry(source_name, target_doc=None):
|
|||||||
},
|
},
|
||||||
}, target_doc)
|
}, target_doc)
|
||||||
|
|
||||||
return doclist
|
return doclist
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user