@php $isCustomerAdmin = auth()->user()->hasRole('customer_admin') ? auth()->user()->hasRole('customer_admin') : auth()->user()->hasRole('customer_staff'); $user = $order->user; $orderNumber = $isCustomerAdmin ? $order->getOfflineOrderNumber() : $order->getOrderNumber(); $consumables = $order->consumableModals; @endphp {{-- Print invoice button --}}
{{-- Order Information --}} @include('partials.ordersummary.details',[ 'isCustomerAdmin' => $isCustomerAdmin, 'order' => $order, 'type' => 'consumables', 'user' => $user ]) {{-- Order item detials --}}
Consumables @if(!$isCustomerAdmin)
Price
@endif
@if ($consumables->count() > 0) @php $totalPrice = 0; @endphp @foreach ($consumables as $item) @php if (!$isCustomerAdmin) { $totalPrice += $item->price ? (float)$item->price : 0; } @endphp
{{ $item->quantity }}x {{ $item->name }} - {{ $item->sub_name }} @if(!$isCustomerAdmin) @if(!empty($item->price))
${{ $item->price ? number_format($item->price, 2) : '' }}
@endif @endif
@endforeach @else
No Consumables Found
@endif
@if(!$isCustomerAdmin)
Total:
${{ number_format($totalPrice, 2) }}
@endif
@include('partials.actions.printbtn',[ 'isCustomerAdmin' => $isCustomerAdmin, 'order' => $order ])