{{-- Name: invoice.list.blade Author: JH2 Created: 2015-11-13 --}} @extends('partials.box') @section($content_id) {{-- @can('invoiceAccountingRecords') @include('partials.linkbox', [ 'links' => [ 'admin.invoice.accountingRecords' => [ 'display' => Auth::user()->hasPermission('invoiceAccountingRecords'), 'name' => Lang::get('invoice.accountingRecords.btn'), ], ] ]) @endcan --}} @if(isset($filter) && $filter == true)

{{ Lang::get('receiver.filterOn') }}:

{{ Lang::get('invoice.text') }}
{{ Lang::get('invoice.type') }}
{!! Form::select('type', [ '-1' => Lang::get('invoice.all'), Invoice::_get('statusTypes')['normal'] => Lang::get('invoice.typeNormal'), Invoice::_get('statusTypes')['credit'] => Lang::get('invoice.typeCredit'), ], @Request::get('type'), ['class' => 'form-control']) !!}
{{ Lang::get('invoice.status') }}
{!! Form::select('status', [ '-1' => Lang::get('invoice.all'), '1' => Lang::get('invoice.onlyPaid'), '0' => Lang::get('invoice.onlyNotPaid'), ], @Request::get('status'), ['class' => 'form-control']) !!}

@endif
{{ Lang::get('invoice.number') }} @if (Route::currentRouteName() == 'admin.invoice.index') , {{ Lang::get('invoice.company') }} @elseif(\Route::currentRouteName() == 'invoice.index') ({{ Lang::get('invoice.company') }}) @endif
{{ Lang::get('invoice.status') }}
{{ Lang::get('invoice.total') }}
{{ Lang::get('invoice.duedate') }}
@if (!$invoices->isEmpty()) @foreach($invoices as $key => $invoice)
{{ $invoice['number'] }} @if (\Route::currentRouteName() == 'admin.invoice.index') @if(!is_null($invoice->company)) ({{ $invoice->company->name }}) @else {{ Lang::get('invoice.companyDeleted') }} @endif @if(isset($invoice->company) && !is_null($invoice->reference)) @endif @if(isset($invoice->company->card) && !is_null($invoice->company->card)) @endif @elseif(\Route::currentRouteName() == 'invoice.index') ({{ $invoice->company->name }}) @endif
@if($invoice->status == Invoice::_get('statusTypes')['credit']) {{-- Invoice is a credit invoice --}} {{ Lang::get('invoice.sent') }} @elseif($invoice->isCredited()) {{-- Invoice is credited --}} {{ Lang::get('invoice.credited') }} {{ (!is_null($invoice['send_time']))?$invoice['send_time']->toDateString():' ' }} @elseif($invoice->isPaid()) {{-- Invoice is paid --}} {{ Lang::get('invoice.paid') }} @else {{-- Invoice is not paid or part paid --}} {{ Lang::get('invoice.notPaid') }} @endif
{{ $invoice->totalWithVat() }}
@if(!$invoice->isPaid() && $invoice->duedate <= Carbon\Carbon::today()) {{-- Invoice is not paid or part paid --}} {{ $invoice['duedate']->toDateString() }} @else {{-- Invoice is paid --}} {{ $invoice['duedate']->toDateString() }} @endif
@endforeach @else
{{ Lang::get('invoice.form.noResult') }}
@endif @if(isset($paginate) && $paginate === true) {{-- Display pagination links --}} {!! $invoices !!} @endif
@stop