Skip to content

Commit e203d4d

Browse files
committed
Merge remote-tracking branch 'origin/develop'
2 parents b47d773 + 1488271 commit e203d4d

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

app/Http/Controllers/Api/AssetsController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ public function index(Request $request, $action = null, $upcoming_status = null)
146146
'model.category',
147147
'model.manufacturer',
148148
'model.fieldset',
149+
'model.depreciation',
149150
'supplier'
150151
); // it might be tempting to add 'assetlog' here, but don't. It blows up update-heavy users.
151152

app/Http/Transformers/AssetsTransformer.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ public function transformAsset(Asset $asset)
5858
'id' => (int) $asset->model->manufacturer->id,
5959
'name'=> e($asset->model->manufacturer->name),
6060
] : null,
61+
'depreciation' => (($asset->model) && ($asset->model->depreciation)) ? [
62+
'id' => (int) $asset->model->depreciation->id,
63+
'name'=> e($asset->model->depreciation->name),
64+
'months'=> (int) $asset->model->depreciation->months,
65+
'type'=> e($asset->model->depreciation->depreciation_type),
66+
'minimum'=> ($asset->model->depreciation->depreciation_min) ? (int) $asset->model->depreciation->depreciation_min : null,
67+
] : null,
6168
'supplier' => ($asset->supplier) ? [
6269
'id' => (int) $asset->supplier->id,
6370
'name'=> e($asset->supplier->name),

0 commit comments

Comments
 (0)