mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-12 03:15:07 +00:00
fix: check and update depreciation if depreciation method was changed
This commit is contained in:
@@ -187,13 +187,15 @@ class Asset(AccountsController):
|
||||
def has_depreciation_settings_changed(self, schedule_doc, fb_row):
|
||||
"""Check if depreciation calculation settings have changed"""
|
||||
|
||||
# For non-manual depreciation methods, always check for changes
|
||||
if schedule_doc.depreciation_method != "Manual":
|
||||
if not schedule_doc.get("depreciation_schedule"):
|
||||
return True
|
||||
|
||||
if fb_row.depreciation_method != "Manual":
|
||||
return True
|
||||
|
||||
# For manual depreciation, check specific parameters
|
||||
return (
|
||||
fb_row.total_number_of_depreciations != schedule_doc.total_number_of_depreciations
|
||||
fb_row.depreciation_method != schedule_doc.depreciation_method
|
||||
or fb_row.total_number_of_depreciations != schedule_doc.total_number_of_depreciations
|
||||
or fb_row.frequency_of_depreciation != schedule_doc.frequency_of_depreciation
|
||||
or getdate(fb_row.depreciation_start_date)
|
||||
!= schedule_doc.get("depreciation_schedule")[0].schedule_date
|
||||
|
||||
Reference in New Issue
Block a user