From bc58fd1fa4d2c6f690df299beb8d4e51ec1c48a4 Mon Sep 17 00:00:00 2001 From: Navin-S-R Date: Mon, 8 Dec 2025 15:38:48 +0530 Subject: [PATCH] fix(asset): prorata daily depr amount calculation --- erpnext/assets/doctype/asset/asset.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/erpnext/assets/doctype/asset/asset.py b/erpnext/assets/doctype/asset/asset.py index 6185eeb9547..3edc41ec077 100644 --- a/erpnext/assets/doctype/asset/asset.py +++ b/erpnext/assets/doctype/asset/asset.py @@ -1532,11 +1532,7 @@ def get_straight_line_or_manual_depr_amount(asset, row, schedule_idx, number_of_ # if the Depreciation Schedule is being prepared for the first time else: if row.daily_prorata_based: - amount = ( - flt(asset.gross_purchase_amount) - - flt(asset.opening_accumulated_depreciation) - - flt(row.expected_value_after_useful_life) - ) + amount = flt(asset.gross_purchase_amount) - flt(row.expected_value_after_useful_life) total_days = ( date_diff( get_last_day( @@ -1548,7 +1544,11 @@ def get_straight_line_or_manual_depr_amount(asset, row, schedule_idx, number_of_ ), add_days( get_last_day( - add_months(row.depreciation_start_date, -1 * row.frequency_of_depreciation) + add_months( + row.depreciation_start_date, + (row.frequency_of_depreciation * (asset.number_of_depreciations_booked + 1)) + * -1, + ), ), 1, ),