Skip to content

Commit

Permalink
fix: handle expected_value_after_useful_life properly in asset value …
Browse files Browse the repository at this point in the history
…adjustment (backport #35117) (#35120)

fix: handle expected_value_after_useful_life properly in asset value adjustment (#35117)

(cherry picked from commit 80230fe)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
  • Loading branch information
mergify[bot] and anandbaburajan committed May 1, 2023
1 parent d3c769c commit 635559d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ def reschedule_depreciations(self, asset_value):
if d.depreciation_method in ("Straight Line", "Manual"):
end_date = max(s.schedule_date for s in asset.schedules if cint(s.finance_book_id) == d.idx)
total_days = date_diff(end_date, self.date)
rate_per_day = flt(d.value_after_depreciation) / flt(total_days)
rate_per_day = flt(d.value_after_depreciation - d.expected_value_after_useful_life) / flt(
total_days
)
from_date = self.date
else:
no_of_depreciations = len(
Expand Down

0 comments on commit 635559d

Please sign in to comment.