Check for valid asset

This commit is contained in:
snipe 2017-09-28 17:32:37 -07:00
parent 1775995f26
commit adac5ac544

View file

@ -41,8 +41,9 @@
$totalCost = 0;
?>
@foreach ($assetMaintenances as $assetMaintenance)
@if ($assetMaintenance->asset)
<tr>
<td>{{ is_null($assetMaintenance->asset->company) ? '' : $assetMaintenance->asset->company->name }}</td>
<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>
@ -65,6 +66,7 @@
{{ number_format($assetMaintenance->cost,2) }}
</td>
</tr>
@endif
<?php
$totalDays += $assetMaintenanceTime;
$totalCost += floatval($assetMaintenance->cost);