fix: calculation correction for annual depreciation

(cherry picked from commit f440243b75)
This commit is contained in:
Khushi Rawat
2024-08-22 02:22:51 +05:30
committed by Mergify
parent 831e2aaf18
commit fa85482662

View File

@@ -767,8 +767,12 @@ def get_daily_depr_amount(asset, row, schedule_idx, amount):
every_year_depr = amount / total_years
depr_period_start_date = add_days(
get_last_day(add_months(row.depreciation_start_date, row.frequency_of_depreciation * -1)), 1
)
year_start_date = add_years(
row.depreciation_start_date, (row.frequency_of_depreciation * schedule_idx) // 12
depr_period_start_date, ((row.frequency_of_depreciation * schedule_idx) // 12)
)
year_end_date = add_days(add_years(year_start_date, 1), -1)