From 2bd96713db51f093e8e8524700826d752c19baee Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:09:38 +0530 Subject: [PATCH] fix: 1st row depr. sch. value of asset put to less than 180 days acc. to I.T. S. 32 (backport #38696) (#38703) fix: 1st row depr. sch. value of asset put to less than 180 days acc. to I.T. S. 32 (#38696) fix: 1st row value of asset put to less than 180 days acc. to IT S. 32 (cherry picked from commit e7984b3ef90da98506e8c79303ac804e8d037085) Co-authored-by: Anand Baburajan --- .../asset_depreciation_schedule.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/erpnext/assets/doctype/asset_depreciation_schedule/asset_depreciation_schedule.py b/erpnext/assets/doctype/asset_depreciation_schedule/asset_depreciation_schedule.py index 0021140282e..67234ccd843 100644 --- a/erpnext/assets/doctype/asset_depreciation_schedule/asset_depreciation_schedule.py +++ b/erpnext/assets/doctype/asset_depreciation_schedule/asset_depreciation_schedule.py @@ -340,6 +340,10 @@ class AssetDepreciationSchedule(Document): n == 0 and (has_pro_rata or has_wdv_or_dd_non_yearly_pro_rata) and not self.opening_accumulated_depreciation + and get_updated_rate_of_depreciation_for_wdv_and_dd( + asset_doc, value_after_depreciation, row, False + ) + == row.rate_of_depreciation ): from_date = add_days( asset_doc.available_for_use_date, -1 @@ -605,7 +609,9 @@ def get_depreciation_amount( @erpnext.allow_regional -def get_updated_rate_of_depreciation_for_wdv_and_dd(asset, depreciable_value, fb_row): +def get_updated_rate_of_depreciation_for_wdv_and_dd( + asset, depreciable_value, fb_row, show_msg=True +): return fb_row.rate_of_depreciation