Skip to content

Commit

Permalink
fix: handle zero salvage value case
Browse files Browse the repository at this point in the history
  • Loading branch information
khushi8112 committed Dec 17, 2024
1 parent 8940747 commit 632a45d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions erpnext/assets/doctype/asset/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,9 @@ def get_depreciation_rate(self, args, on_validate=False):
return args.get("rate_of_depreciation")

if self.flags.increase_in_asset_value_due_to_repair:
if not flt(args.get("expected_value_after_useful_life")):
return args.get("rate_of_depreciation")

value = flt(args.get("expected_value_after_useful_life")) / flt(
args.get("value_after_depreciation")
)
Expand Down

0 comments on commit 632a45d

Please sign in to comment.