diff --git a/app/models/Asset.php b/app/models/Asset.php index a750980550..4cb343328f 100644 --- a/app/models/Asset.php +++ b/app/models/Asset.php @@ -141,7 +141,7 @@ class Asset extends Elegant { public function depreciation() { - return $this->belongsTo('Depreciation','id'); + return $this->model->belongsTo('Depreciation','depreciation_id'); } public function model() diff --git a/app/views/backend/hardware/view.blade.php b/app/views/backend/hardware/view.blade.php index 8da1a4ec77..2ae66b2965 100644 --- a/app/views/backend/hardware/view.blade.php +++ b/app/views/backend/hardware/view.blade.php @@ -71,7 +71,6 @@ View Asset {{ $asset->asset_tag }} :: {{ $asset->months_until_depreciated()->y }} years @endif -