mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Check for valid asset
This commit is contained in:
parent
1775995f26
commit
adac5ac544
|
@ -41,30 +41,32 @@
|
|||
$totalCost = 0;
|
||||
?>
|
||||
@foreach ($assetMaintenances as $assetMaintenance)
|
||||
<tr>
|
||||
<td>{{ is_null($assetMaintenance->asset->company) ? '' : $assetMaintenance->asset->company->name }}</td>
|
||||
<td>{{ $assetMaintenance->asset->asset_tag }}</td>
|
||||
<td>{{ $assetMaintenance->asset->name }}</td>
|
||||
<td>{{ $assetMaintenance->supplier->name }}</td>
|
||||
<td>{{ $assetMaintenance->asset_maintenance_type }}</td>
|
||||
<td>{{ $assetMaintenance->title }}</td>
|
||||
<td>{{ $assetMaintenance->start_date }}</td>
|
||||
<td>{{ is_null($assetMaintenance->completion_date) ? trans('admin/asset_maintenances/message.asset_maintenance_incomplete') : $assetMaintenance->completion_date }}</td>
|
||||
@if (is_null($assetMaintenance->asset_maintenance_time))
|
||||
<?php
|
||||
$assetMaintenanceTime = intval(Carbon::now()->diffInDays(Carbon::parse($assetMaintenance->start_date)));
|
||||
?>
|
||||
@else
|
||||
<?php
|
||||
$assetMaintenanceTime = intval($assetMaintenance->asset_maintenance_time);
|
||||
?>
|
||||
@endif
|
||||
<td>{{ $assetMaintenanceTime }}</td>
|
||||
<td>
|
||||
{{ $snipeSettings->default_currency }}
|
||||
{{ number_format($assetMaintenance->cost,2) }}
|
||||
</td>
|
||||
</tr>
|
||||
@if ($assetMaintenance->asset)
|
||||
<tr>
|
||||
<td>{{ ($assetMaintenance->asset->company) ? $assetMaintenance->asset->company->name : '' }}</td>
|
||||
<td>{{ $assetMaintenance->asset->asset_tag }}</td>
|
||||
<td>{{ $assetMaintenance->asset->name }}</td>
|
||||
<td>{{ $assetMaintenance->supplier->name }}</td>
|
||||
<td>{{ $assetMaintenance->asset_maintenance_type }}</td>
|
||||
<td>{{ $assetMaintenance->title }}</td>
|
||||
<td>{{ $assetMaintenance->start_date }}</td>
|
||||
<td>{{ is_null($assetMaintenance->completion_date) ? trans('admin/asset_maintenances/message.asset_maintenance_incomplete') : $assetMaintenance->completion_date }}</td>
|
||||
@if (is_null($assetMaintenance->asset_maintenance_time))
|
||||
<?php
|
||||
$assetMaintenanceTime = intval(Carbon::now()->diffInDays(Carbon::parse($assetMaintenance->start_date)));
|
||||
?>
|
||||
@else
|
||||
<?php
|
||||
$assetMaintenanceTime = intval($assetMaintenance->asset_maintenance_time);
|
||||
?>
|
||||
@endif
|
||||
<td>{{ $assetMaintenanceTime }}</td>
|
||||
<td>
|
||||
{{ $snipeSettings->default_currency }}
|
||||
{{ number_format($assetMaintenance->cost,2) }}
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
<?php
|
||||
$totalDays += $assetMaintenanceTime;
|
||||
$totalCost += floatval($assetMaintenance->cost);
|
||||
|
|
Loading…
Reference in a new issue