mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 18:21:22 +00:00
fix: Add flag for reverse depreciation entries
(cherry picked from commit cde0dae987)
This commit is contained in:
@@ -57,7 +57,8 @@ class GLEntry(Document):
|
|||||||
|
|
||||||
# Update outstanding amt on against voucher
|
# Update outstanding amt on against voucher
|
||||||
if (self.against_voucher_type in ['Journal Entry', 'Sales Invoice', 'Purchase Invoice', 'Fees']
|
if (self.against_voucher_type in ['Journal Entry', 'Sales Invoice', 'Purchase Invoice', 'Fees']
|
||||||
and self.against_voucher and self.flags.update_outstanding == 'Yes'):
|
and self.against_voucher and self.flags.update_outstanding == 'Yes'
|
||||||
|
and not frappe.flags.is_reverse_depr_entry):
|
||||||
update_outstanding_amt(self.account, self.party_type, self.party, self.against_voucher_type,
|
update_outstanding_amt(self.account, self.party_type, self.party, self.against_voucher_type,
|
||||||
self.against_voucher)
|
self.against_voucher)
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ 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()
|
||||||
|
|
||||||
if not self.flags.is_reverse_depr_entry:
|
if not frappe.flags.is_reverse_depr_entry:
|
||||||
self.validate_against_jv()
|
self.validate_against_jv()
|
||||||
self.validate_stock_accounts()
|
self.validate_stock_accounts()
|
||||||
|
|
||||||
|
|||||||
@@ -1054,7 +1054,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
|
frappe.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