Skip to content

Commit

Permalink
FIX: assets: division by zero when trying to calculate depreciation o…
Browse files Browse the repository at this point in the history
…n assets that don't have it (#31858)

* FIX: assets: division by zero when trying to calculate depreciation on assets that don't have it

* FIX: assets: division by zero when trying to calculate depreciation on assets that don't have it, part 2
  • Loading branch information
marc-dll authored Nov 16, 2024
1 parent aa6422e commit b6dfc49
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions htdocs/asset/class/asset.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,10 @@ public function calculationDepreciation()
return -1;
}

if (! empty($this->not_depreciated)) {
return 1;
}

// Get depreciation options
//---------------------------
require_once DOL_DOCUMENT_ROOT . '/asset/class/assetdepreciationoptions.class.php';
Expand Down

0 comments on commit b6dfc49

Please sign in to comment.