{{-- Name: invoice.partials.show Author: JH2 Created: 2015-11-13 --}} @extends('partials.box') @section($content_id) @include('partials.linkbox', [ 'links' => [ 'admin.invoice.credit' => [ 'display' => ($invoice->status == Invoice::_get('statusTypes')['credit'] || !is_null($invoice->credit_invoice_id) || $invoice->total === 0 || $invoice->paid == 1 || Auth::user()->hasPermission('invoiceCredit') == false) ? false : true, 'type' => 'warning', 'param' => $invoice['id'], 'data' => 'credit-invoice-btn', 'name' => Lang::get('invoice.credit.button'), ], 'invoice.getPay' => [ 'display' => ($invoice->paid == 0 && $invoice->payments()->sum('sum') != $invoice->totalWithVat() && is_null($invoice->reference))? true : false, 'type' => 'primary', 'param' => $invoice['id'], 'name' => Lang::get('invoice.pay.button'), ], 'invoice.getPdf' => [ 'display' => true, 'type' => 'primary', 'param' => $invoice['id'], 'name' => Lang::get('invoice.print.button'), ] ] ])

{{ Lang::get('invoice.show.customerTitle') }}

{{-- --}}
{{ Lang::get('invoice.show.customerName') }} {{ $invoice['company_name'] }} ({{ $invoice->company->customer_number ?? 'Borttaget' }})
{{ Lang::get('invoice.show.customerStreet') }} {{ $invoice['company_address'] }}
{{ Lang::get('invoice.show.customerZip') }} {{ $invoice['company_zip'] }}, {{ $invoice['company_city'] }}
{{ Lang::get('invoice.show.customerCity') }} {{ $invoice['company_city'] }}
{{ Lang::get('invoice.show.customerEmail') }} {{ (!is_null($invoice['company_email']))?$invoice['company_email']:'' }}

{{ Lang::get('invoice.show.invoiceTitle') }}

{{-- --}}
{{ Lang::get('invoice.show.status') }} @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') }} ({{ $invoice->credited()->number }}) @elseif($invoice->isPaid()) {{-- Invoice is paid --}} {{ Lang::get('invoice.paid') }} ({{ $invoice->payments[0]->created_at->format('Y-m-d') }}) @else {{-- Invoice is not paid or part paid --}} {{ Lang::get('invoice.notPaid') }} @endif
{{ Lang::get('invoice.show.created') }} {{ $invoice['created_at']->format('Y-m-d') }}
{{ Lang::get('invoice.show.sent') }} {{ (!is_null($invoice['send_time']))?$invoice['send_time']->format('Y-m-d'):'' }}
{{ Lang::get('invoice.show.due') }} {{ $invoice['duedate']->format('Y-m-d') }}
{{ Lang::get('invoice.show.ocr') }} {{ $invoice['ocr'] }}

{{ Lang::get('invoice.show.rowsTitle') }}

{{-- --}} @foreach($invoice->rows()->get()->toArray() as $key => $row) {{-- --}} @endforeach
{{ Lang::get('invoice.show.row.line') }} {{ Lang::get('invoice.show.row.description') }}{{ Lang::get('invoice.show.row.period') }}{{ Lang::get('invoice.show.row.items') }} {{ Lang::get('invoice.show.row.itemPrice') }} {{ Lang::get('invoice.show.row.total') }}
{{ ($key + 1) * 10 }} {{ $row['row_text'] }}{{ $row['period'] }}1 {{ number_format($row['price'], 2) }} {{ number_format($row['price'], 2) }}
{{ Lang::get('invoice.show.row.vat_rate') }} @if($invoice->isCredited()) @elseif($invoice->isPaid()) @endif {{ $invoice['vat_rate'] * 100 }}% {{ number_format($invoice->vatTotal(), 2) }}
{{ Lang::get('invoice.show.row.total') }} {{ $invoice->totalWithVat() }}

{{ Lang::get('invoice.show.payments') }}

@foreach($invoice->payments()->get()->toArray() as $key => $payment) @endforeach @if($invoice->isCredited()) {{-- This invoice is paid with a credit --}} @elseif($invoice->payments()->count() == 0) @endif
{{ Lang::get('invoice.show.payment.time') }} {{ Lang::get('invoice.show.payment.amount') }}
{{ $payment['created_at'] }} {{ number_format($payment['sum'], 2) }}
{!! $invoice->credit_time.' ('.Lang::get('invoice.credited').')' !!} {{ $invoice->credited()->totalWithVat() }}
{{ Lang::get('invoice.show.payment.noResult') }}
{{--
VAT: {{ $invoice['vat'] }} | IBAN: {{ $invoice['iban'] }} | Swift: {{ $invoice['swift'] }} | Bankgiro: {{ $invoice['bankgiro'] }}
--}} @stop