From 2cecd5e0566d5fc73fe09805adb9360db40fcc19 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 31 Oct 2018 10:23:47 -0700 Subject: [PATCH] One more fix for #6175 (non-accessories) --- resources/views/users/print.blade.php | 59 ++++++++++++++------------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/resources/views/users/print.blade.php b/resources/views/users/print.blade.php index c522d9400d..572493efd1 100644 --- a/resources/views/users/print.blade.php +++ b/resources/views/users/print.blade.php @@ -113,16 +113,18 @@ @endphp @foreach ($licenses as $license) + @if ($license) + + {{ $lcounter }} + {{ $license->name }} + {{ $license->serial }} + {{ $license->assetlog->first()->created_at }} + + @php + $lcounter++ + @endphp - - {{ $lcounter }} - {{ $license->name }} - {{ $license->serial }} - {{ $license->assetlog->first()->created_at }} - - @php - $lcounter++ - @endphp + @endif @endforeach @endif @@ -150,15 +152,15 @@ @foreach ($accessories as $accessory) @if ($accessory) - - {{ $acounter }} - {{ ($accessory->manufacturer) ? $accessory->manufacturer->name : '' }} {{ $accessory->name }} {{ $accessory->model_number }} - {{ $accessory->category->name }} - {{ $accessory->assetlog->first()->created_at }} - - @php - $acounter++ - @endphp + + {{ $acounter }} + {{ ($accessory->manufacturer) ? $accessory->manufacturer->name : '' }} {{ $accessory->name }} {{ $accessory->model_number }} + {{ $accessory->category->name }} + {{ $accessory->assetlog->first()->created_at }} + + @php + $acounter++ + @endphp @endif @endforeach @@ -185,16 +187,17 @@ @endphp @foreach ($consumables as $consumable) - - - {{ $ccounter }} - {{ ($consumable->manufacturer) ? $consumable->manufacturer->name : '' }} {{ $consumable->name }} {{ $consumable->model_number }} - {{ $consumable->category->name }} - {{ $consumable->assetlog->first()->created_at }} - - @php - $ccounter++ - @endphp + @if ($consumable) + + {{ $ccounter }} + {{ ($consumable->manufacturer) ? $consumable->manufacturer->name : '' }} {{ $consumable->name }} {{ $consumable->model_number }} + {{ $consumable->category->name }} + {{ $consumable->assetlog->first()->created_at }} + + @php + $ccounter++ + @endphp + @endif @endforeach @endif