mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 16:04:46 +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):
|
def has_depreciation_settings_changed(self, schedule_doc, fb_row):
|
||||||
"""Check if depreciation calculation settings have changed"""
|
"""Check if depreciation calculation settings have changed"""
|
||||||
|
|
||||||
# For non-manual depreciation methods, always check for changes
|
if not schedule_doc.get("depreciation_schedule"):
|
||||||
if schedule_doc.depreciation_method != "Manual":
|
return True
|
||||||
|
|
||||||
|
if fb_row.depreciation_method != "Manual":
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# For manual depreciation, check specific parameters
|
|
||||||
return (
|
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 fb_row.frequency_of_depreciation != schedule_doc.frequency_of_depreciation
|
||||||
or getdate(fb_row.depreciation_start_date)
|
or getdate(fb_row.depreciation_start_date)
|
||||||
!= schedule_doc.get("depreciation_schedule")[0].schedule_date
|
!= schedule_doc.get("depreciation_schedule")[0].schedule_date
|
||||||
|
|||||||
Reference in New Issue
Block a user