mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-24 07:29:22 +00:00
fix: Only validate against JV if it's not a reverse depreciation entry
This commit is contained in:
@@ -58,7 +58,10 @@ class JournalEntry(AccountsController):
|
|||||||
if not frappe.flags.in_import:
|
if not frappe.flags.in_import:
|
||||||
self.validate_total_debit_and_credit()
|
self.validate_total_debit_and_credit()
|
||||||
|
|
||||||
self.validate_against_jv()
|
if not self.flags.is_reverse_depr_entry:
|
||||||
|
self.validate_against_jv()
|
||||||
|
self.validate_stock_accounts()
|
||||||
|
|
||||||
self.validate_reference_doc()
|
self.validate_reference_doc()
|
||||||
if self.docstatus == 0:
|
if self.docstatus == 0:
|
||||||
self.set_against_account()
|
self.set_against_account()
|
||||||
@@ -69,7 +72,6 @@ class JournalEntry(AccountsController):
|
|||||||
self.validate_empty_accounts_table()
|
self.validate_empty_accounts_table()
|
||||||
self.set_account_and_party_balance()
|
self.set_account_and_party_balance()
|
||||||
self.validate_inter_company_accounts()
|
self.validate_inter_company_accounts()
|
||||||
self.validate_stock_accounts()
|
|
||||||
|
|
||||||
if self.docstatus == 0:
|
if self.docstatus == 0:
|
||||||
self.apply_tax_withholding()
|
self.apply_tax_withholding()
|
||||||
|
|||||||
@@ -1063,6 +1063,7 @@ class SalesInvoice(SellingController):
|
|||||||
|
|
||||||
reverse_journal_entry = make_reverse_journal_entry(schedule.journal_entry)
|
reverse_journal_entry = make_reverse_journal_entry(schedule.journal_entry)
|
||||||
reverse_journal_entry.posting_date = nowdate()
|
reverse_journal_entry.posting_date = nowdate()
|
||||||
|
reverse_journal_entry.flags.is_reverse_depr_entry = True
|
||||||
reverse_journal_entry.submit()
|
reverse_journal_entry.submit()
|
||||||
|
|
||||||
asset.flags.ignore_validate_update_after_submit = True
|
asset.flags.ignore_validate_update_after_submit = True
|
||||||
|
|||||||
Reference in New Issue
Block a user