@extends('Layouts.master') @section('content')

@lang('loans')

@if(count($loans) >= 1) @foreach($loans as $loan) @endforeach
@lang('type') @lang('item') @lang('amount') @lang('date_end')
@switch($loan->loanable_type) @case('App\Models\Product') @can('products_viewAny') @lang('product') @else @lang('product') @endcan @break @case('App\Models\Cabel') @can('cabels_viewAny') @lang('cabel') @else @lang('cabel') @endcan @break @endswitch @switch($loan->loanable_type) @case('App\Models\Product') @can('products_view') @if(config('app.barcode_mode') == 'dynamic') {{$loan->loanable->category->name}}.@if(!empty($loan->loanable->subcategory)){{$loan->loanable->subcategory->name}}.@endif{{$loan->loanable->brand->name}}.{{$loan->loanable->model->name}}@if(!empty($loan->loanable->name)).{{$loan->loanable->name}}@endif @endif @if(config('app.barcode_mode') == 'static') {{$loan->loanable->barcode}} @endif @else @if(config('app.barcode_mode') == 'dynamic') {{$loan->loanable->category->name}}.@if(!empty($loan->loanable->subcategory)){{$loan->loanable->subcategory->name}}.@endif{{$loan->loanable->brand->name}}.{{$loan->loanable->model->name}}@if(!empty($loan->loanable->name)).{{$loan->loanable->name}}@endif @endif @if(config('app.barcode_mode') == 'static') {{$loan->loanable->barcode}} @endif @endcan @break @case('App\Models\Cabel') @can('cabels_view') {{$loan->loanable->category->name}}.{{$loan->loanable->name}} @else {{$loan->loanable->category->name}}.{{$loan->loanable->name}} @endcan @break @endswitch {{$loan->amount}} @if(!empty($loan->date_end)) {{date('d.m.Y',strtotime($loan->date_end))}} @else @lang('permanent') @endif
Total : {{count($data->loans)}}
@else @lang('no_amount') @lang('loans') @endif


@lang('reservations')

@if(count($reservations) >= 1) @foreach($reservations as $loan) @endforeach
@lang('type') @lang('item') @lang('amount') @lang('date_start') @lang('date_end') @lang('status')
@switch($loan->loanable_type) @case('App\Models\Product') @can('products_viewAny') @lang('product') @else @lang('product') @endcan @break @case('App\Models\Cabel') @can('cabels_viewAny') @lang('cabel') @else @lang('cabel') @endcan @break @endswitch @switch($loan->loanable_type) @case('App\Models\Product') @can('products_view') @if(config('app.barcode_mode') == 'dynamic') {{$loan->loanable->category->name}}.@if(!empty($loan->loanable->subcategory)){{$loan->loanable->subcategory->name}}.@endif{{$loan->loanable->brand->name}}.{{$loan->loanable->model->name}}@if(!empty($loan->loanable->name)).{{$loan->loanable->name}}@endif @endif @if(config('app.barcode_mode') == 'static') {{$loan->loanable->barcode}} @endif @else @if(config('app.barcode_mode') == 'dynamic') {{$loan->loanable->category->name}}.@if(!empty($loan->loanable->subcategory)){{$loan->loanable->subcategory->name}}.@endif{{$loan->loanable->brand->name}}.{{$loan->loanable->model->name}}@if(!empty($loan->loanable->name)).{{$loan->loanable->name}}@endif @endif @if(config('app.barcode_mode') == 'static') {{$loan->loanable->barcode}} @endif @endcan @break @case('App\Models\Cabel') @can('cabels_view') {{$loan->loanable->category->name}}.{{$loan->loanable->name}} @else {{$loan->loanable->category->name}}.{{$loan->loanable->name}} @endcan @break @endswitch {{$loan->amount}} {{date('d.m.Y',strtotime($loan->date_start))}} {{date('d.m.Y',strtotime($loan->date_end))}} @switch($loan->type->name) @case('Reservation - Awaiting') @lang('validation') - @lang('deadline') : @if(!empty($loan->date_deadline)) {{date('d.m.Y H:i:s',strtotime($loan->date_deadline))}} @endif @break @case('Reservation - Set Up') @lang('awaiting') @lang('setup') @break @case('Reservation - Pick Up') @lang('awaiting') @lang('pickup') @break @endswitch
Total : {{count($data->reservations)}}
@else @lang('no_amount') @lang('reservations') @endif


@lang('contracts')

@if(count($contracts) >= 1) @can('pdf_view') @foreach($contracts as $file) @endforeach
@lang('date') @lang('type') @lang('action')
{{ date('d.m.Y H:i:s', $file->timestamp) }} @if($file->type == 'contracts') @lang('loan') @elseif($file->type == 'laptops') @lang('laptop') @elseif($file->type == 'reservations') @lang('reservation') @endif @lang('show') @can('delete', App\Models\PDF::class)
@csrf @method('DELETE')
@endcan
Total : {{count($contracts)}}
@endcan @cannot('pdf_view') @if(Auth::user()->id == $data->id) @foreach($contracts as $file) @endforeach
@lang('date') @lang('type') @lang('action')
{{ date('d.m.Y H:i:s', $file->timestamp) }} @if($file->type == 'contracts') @lang('loan') @elseif($file->type == 'laptops') @lang('laptop') @elseif($file->type == 'reservations') @lang('reservation') @endif @lang('show')
Total : {{count($contracts)}}
@endif @endcannot @else @lang('no_amount') @lang('contracts') @endif


@can('notes_view')

@lang('notes')

@if(count($notes) >= 1) @foreach($notes as $note) @endforeach
@lang('item') @lang('type') @lang('item') @lang('note') @lang('type') @lang('note')
@switch($note->loanable_type) @case('App\Models\Product') @can('products_viewAny') @lang('product') @else @lang('product') @endcan @break @case('App\Models\Cabel') @can('cabels_viewAny') @lang('cabel') @else @lang('cabel') @endcan @break @endswitch @switch($note->loanable_type) @case('App\Models\Product') @can('products_view') @if(config('app.barcode_mode') == 'dynamic') {{$note->loanable->category->name}}.@if(!empty($note->loanable->subcategory)){{$note->loanable->subcategory->name}}.@endif{{$note->loanable->brand->name}}.{{$note->loanable->model->name}}@if(!empty($note->loanable->name)).{{$note->loanable->name}}@endif @endif @if(config('app.barcode_mode') == 'static') {{$note->loanable->barcode}} @endif @else @if(config('app.barcode_mode') == 'dynamic') {{$note->loanable->category->name}}.@if(!empty($note->loanable->subcategory)){{$note->loanable->subcategory->name}}.@endif{{$note->loanable->brand->name}}.{{$note->loanable->model->name}}@if(!empty($note->loanable->name)).{{$note->loanable->name}}@endif @endif @if(config('app.barcode_mode') == 'static') {{$note->loanable->barcode}} @endif @endcan @break @case('App\Models\Cabel') @can('cabels_view') {{$note->loanable->category->name}}.{{$note->loanable->name}} @else {{$note->loanable->category->name}}.{{$note->loanable->name}} @endcan @break @endswitch {{$note->type->name}} {{$note->note}}
@else @lang('no_amount') @lang('notes') @endif @endcan
@switch($data->loanerType->name) @case('adUser') @break @case('nadUser') @break @endswitch
@can('users_edit') @if($data->loanerType->name != 'adUser') @lang('update') @else @can('users_edit_role') @if(Auth::user()->id != $data->id) @lang('update') @endif @else @lang('update') @endcan @endif @endcan
@endsection @section('scripting') @endsection