3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-02-05 01:05:28 +00:00

Fix eol rate in asset transformer

This commit is contained in:
Marcus Moore
2025-03-12 13:33:15 -07:00
parent 6cf7df22cd
commit 1122cd8567

View File

@ -42,7 +42,7 @@ class AssetsTransformer
'requestable' => ($asset->requestable ? true : false),
'model_number' => (($asset->model) && ($asset->model->model_number)) ? e($asset->model->model_number) : null,
'eol' => (($asset->asset_eol_date != '') && ($asset->purchase_date != '')) ? Carbon::parse($asset->asset_eol_date)->diffInMonths($asset->purchase_date).' months' : null,
'eol' => (($asset->asset_eol_date != '') && ($asset->purchase_date != '')) ? (int) Carbon::parse($asset->asset_eol_date)->diffInMonths($asset->purchase_date, true) . ' months' : null,
'asset_eol_date' => ($asset->asset_eol_date != '') ? Helper::getFormattedDateObject($asset->asset_eol_date, 'date') : null,
'status_label' => ($asset->assetstatus) ? [
'id' => (int) $asset->assetstatus->id,