mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-27 06:29:47 -08:00
10e64deafe
Signed-off-by: snipe <snipe@snipe.net>
18 lines
1.1 KiB
PHP
18 lines
1.1 KiB
PHP
@component('mail::message')
|
|
{{ trans_choice('mail.assets_warrantee_alert', $assets->count(), ['count'=>$assets->count(), 'threshold' => $threshold]) }}
|
|
@component('mail::table')
|
|
|
|
<table width="100%">
|
|
<tr><td> </td><td>{{ trans('mail.name') }}</td><td>{{ trans('mail.Days') }}</td><td>{{ trans('mail.expires') }}</td><td>{{ trans('mail.supplier') }}</td><td>{{ trans('mail.assigned_to') }}</td></tr>
|
|
@foreach ($assets as $asset)
|
|
@php
|
|
$expires = Helper::getFormattedDateObject($asset->present()->warranty_expires, 'date');
|
|
$diff = round(abs(strtotime($asset->present()->warranty_expires) - strtotime(date('Y-m-d')))/86400);
|
|
$icon = ($diff <= ($threshold / 2)) ? '🚨' : (($diff <= $threshold) ? '⚠️' : ' ');
|
|
@endphp
|
|
<tr><td>{{ $icon }} </td><td> <a href="{{ route('hardware.show', $asset->id) }}">{{ $asset->present()->name }}</a> </td><td> {{ $diff }} {{ trans('mail.Days') }} </td><td> {{ $expires['formatted'] }} </td><td> {{ ($asset->supplier ? e($asset->supplier->name) : '') }} </td><td> {{ ($asset->assignedTo ? e($asset->assignedTo->present()->name()) : '') }} </td></tr>
|
|
@endforeach
|
|
</table>
|
|
@endcomponent
|
|
@endcomponent
|