@extends('layouts.admin') @section('title', trans_choice('general.invoices', 1) . ': ' . $invoice->invoice_number) @section('content') @stack('recurring_message_start') @if (($recurring = $invoice->recurring) && ($next = $recurring->next()))
@stack('recurring_message_head_start')

{{ trans('recurring.recurring') }}

@stack('recurring_message_head_end') @stack('recurring_message_body_start')

{{ trans('recurring.message', [ 'type' => mb_strtolower(trans_choice('general.invoices', 1)), 'date' => $next->format($date_format) ]) }}

@stack('recurring_message_body_end')
@endif @stack('recurring_message_end') @stack('status_message_start') @if ($invoice->status->code == 'draft')
@endif @stack('status_message_end') @stack('timeline_start') @if ($invoice->status->code != 'paid') @stack('timeline_body_start')
@stack('timeline_body_create_invoice_start')
@stack('timeline_body_create_invoice_head_start')

{{ trans('invoices.create_invoice') }}

@stack('timeline_body_create_invoice_head_end') @stack('timeline_body_create_invoice_body_start') @stack('timeline_body_create_invoice_body_message_start') {{ trans_choice('general.statuses', 1) . ' :' }} {{ trans('invoices.messages.status.created', ['date' => Date::parse($invoice->created_at)->format($date_format)]) }} @stack('timeline_body_create_invoice_body_message_end')
@stack('timeline_body_create_invoice_body_button_edit_start') {{ trans('general.edit') }} @stack('timeline_body_create_invoice_body_button_edit_end')
@stack('timeline_body_create_invoice_body_end')
@stack('timeline_body_create_invoice_end') @stack('timeline_body_send_invoice_start')
@stack('timeline_body_send_invoice_head_start')

{{ trans('invoices.send_invoice') }}

@stack('timeline_body_send_invoice_head_end') @stack('timeline_body_send_invoice_body_start') @if ($invoice->status->code != 'sent' && $invoice->status->code != 'partial' && $invoice->status->code != 'viewed') @stack('timeline_body_send_invoice_body_message_start') {{ trans_choice('general.statuses', 1) . ' :' }} {{ trans('invoices.messages.status.send.draft') }} @stack('timeline_body_send_invoice_body_message_end')
@stack('timeline_body_send_invoice_body_button_sent_start') @permission('update-incomes-invoices') @if($invoice->invoice_status_code == 'draft') {{ trans('invoices.mark_sent') }} @else @endif @endpermission @stack('timeline_body_send_invoice_body_button_sent_end') @stack('timeline_body_send_invoice_body_button_email_start') @if($invoice->contact_email) {{ trans('invoices.send_mail') }} @else @endif @stack('timeline_body_send_invoice_body_button_email_end')
@elseif($invoice->status->code == 'viewed') @stack('timeline_body_viewed_invoice_body_message_start') {{ trans_choice('general.statuses', 1) . ' :' }} {{ trans('invoices.messages.status.viewed') }} @stack('timeline_body_viewed_invoice_body_message_end') @else @stack('timeline_body_send_invoice_body_message_start') {{ trans_choice('general.statuses', 1) . ' :' }} {{ trans('invoices.messages.status.send.sent', ['date' => Date::parse($invoice->created_at)->format($date_format)]) }} @stack('timeline_body_send_invoice_body_message_end') @endif @stack('timeline_body_send_invoice_body_end')
@stack('timeline_body_send_invoice_end') @stack('timeline_body_get_paid_start')
@stack('timeline_body_get_paid_head_start')

{{ trans('invoices.get_paid') }}

@stack('timeline_body_get_paid_head_end') @stack('timeline_body_get_paid_body_start') @stack('timeline_body_get_paid_body_message_start') @if($invoice->status->code != 'paid' && empty($invoice->transactions->count())) {{ trans_choice('general.statuses', 1) . ' :' }} {{ trans('invoices.messages.status.paid.await') }} @else {{ trans_choice('general.statuses', 1) . ' :' }} {{ trans('general.partially_paid') }} @endif @stack('timeline_body_get_paid_body_message_end')
@stack('timeline_body_get_paid_body_button_pay_start') @permission('update-incomes-invoices') {{ trans('invoices.mark_paid') }} @endpermission @stack('timeline_body_get_paid_body_button_pay_end') @stack('timeline_body_get_paid_body_button_payment_start') @if(empty($invoice->transactions->count()) || (!empty($invoice->transactions->count()) && $invoice->paid != $invoice->amount)) @endif @stack('timeline_body_get_paid_body_button_payment_end')
@stack('timeline_body_get_paid_body_end')
@stack('timeline_body_get_paid_end')
@stack('timeline_body_get_paid_end') @endif @stack('timeline_end') @stack('invoice_start')
@stack('invoice_status_start')

{{ trans('invoices.status.' . $invoice->status->code) }}

@stack('invoice_status_end')
@stack('invoice_header_start')
@if (setting('invoice.logo')) @elseif (setting('company.logo')) @else @endif
{{ setting('company.name') }}
{!! nl2br(setting('company.address')) !!}
@if (setting('company.tax_number')) {{ trans('general.tax_number') }}: {{ setting('company.tax_number') }} @endif
@if (setting('company.phone')) {{ setting('company.phone') }} @endif
{{ setting('company.email') }}
@stack('invoice_header_end') @stack('invoice_information_start')
{{ trans('invoices.bill_to') }} @stack('name_input_start') {{ $invoice->contact_name }} @stack('name_input_end')
@stack('address_input_start') {!! nl2br($invoice->contact_address) !!} @stack('address_input_end')
@stack('tax_number_input_start') @if ($invoice->contact_tax_number) {{ trans('general.tax_number') }}: {{ $invoice->contact_tax_number }} @endif @stack('tax_number_input_end')
@stack('phone_input_start') @if ($invoice->contact_phone) {{ $invoice->contact_phone }} @endif @stack('phone_input_end')
@stack('email_start') {{ $invoice->contact_email }} @stack('email_input_end')
@stack('invoice_number_input_start') @stack('invoice_number_input_end') @stack('order_number_input_start') @if ($invoice->order_number) @endif @stack('order_number_input_end') @stack('invoiced_at_input_start') @stack('invoiced_at_input_end') @stack('due_at_input_start') @stack('due_at_input_end')
{{ trans('invoices.invoice_number') }}: {{ $invoice->invoice_number }}
{{ trans('invoices.order_number') }}: {{ $invoice->order_number }}
{{ trans('invoices.invoice_date') }}: @date($invoice->invoiced_at)
{{ trans('invoices.payment_due') }}: @date($invoice->due_at)
@stack('invoice_information_end') @stack('invoice_item_start')
@stack('name_th_start') @stack('name_th_end') @stack('quantity_th_start') @stack('quantity_th_end') @stack('price_th_start') @stack('price_th_end') @stack('total_th_start') @stack('total_th_end') @foreach($invoice->items as $item) @stack('name_td_start') @stack('name_td_end') @stack('quantity_td_start') @stack('quantity_td_end') @stack('price_td_start') @stack('price_td_end') @stack('total_td_start') @stack('total_td_end') @endforeach
{{ trans_choice($text_override['items'], 2) }}{{ trans($text_override['quantity']) }}{{ trans('invoices.total') }}
{{ $item->name }}{{ $item->quantity }}@money($item->total, $invoice->currency_code, true)
@stack('invoice_item_end') @stack('invoice_total_start')
@stack('notes_input_start')
@if ($invoice->notes) @endif

{{ trans_choice('general.notes', 2) }}

{{ $invoice->notes }}

@stack('notes_input_end')
@foreach ($invoice->totals as $total) @if ($total->code != 'total') @stack($total->code . '_td_start') @stack($total->code . '_td_end') @else @if ($invoice->paid) @endif @stack('grand_total_td_start') @stack('grand_total_td_end') @endif @endforeach
{{ trans($total->title) }}: @money($total->amount, $invoice->currency_code, true)
{{ trans('invoices.paid') }}: - @money($invoice->paid, $invoice->currency_code, true)
{{ trans($total->name) }}: @money($total->amount - $invoice->paid, $invoice->currency_code, true)
@stack('invoice_total_end')
@stack('card_footer_start') @stack('card_footer_end')
@stack('invoice_end') @stack('row_footer_start')
@stack('row_footer_history_start')
@foreach($invoice->histories as $history) @endforeach
{{ trans('general.date') }} {{ trans_choice('general.statuses', 1) }} {{ trans('general.description') }}
@date($history->created_at) {{ $history->status->name }} {{ $history->description }}
@stack('row_footer_history_end') @stack('row_footer_payment_start')
@if ($invoice->transactions->count()) @foreach($invoice->transactions as $transaction) @endforeach @else @endif
{{ trans('general.date') }} {{ trans('general.amount') }} {{ trans_choice('general.accounts', 1) }} {{ trans('general.actions') }}
@date($transaction->paid_at) @money($transaction->amount, $transaction->currency_code, true) {{ $transaction->account->name }} @if ($transaction->reconciled) @else {!! Form::open([ 'id' => 'invoice-transaction-' . $transaction->id, 'method' => 'DELETE', 'route' => ['transactions.destroy', $transaction->id], 'class' => 'd-inline' ]) !!} {{ Form::hidden('form_id', '#invoice-transaction-' . $transaction->id, ['id' => 'form_id-' . $transaction->id]) }} {{ Form::hidden('title', trans_choice('general.transactions', 2), ['id' => 'title-' . $transaction->id]) }} @php $message = trans('general.delete_confirm', [ 'name' => '' . Date::parse($transaction->paid_at)->format($date_format) . ' - ' . money($transaction->amount, $transaction->currency_code, true) . ' - ' . $transaction->account->name . '', 'type' => strtolower(trans_choice('general.transactions', 1)) ]); @endphp {{ Form::hidden('message', $message, ['id' => 'mesage-' . $transaction->id]) }} {{ Form::hidden('cancel', trans('general.cancel'), ['id' => 'cancel-' . $transaction->id]) }} {{ Form::hidden('delete', trans('general.delete'), ['id' => 'delete-' . $transaction->id]) }} {!! Form::button(' ' . trans('general.delete'), array( 'type' => 'button', 'class' => 'btn btn-danger btn-sm', 'title' => trans('general.delete'), '@click' => 'onDeleteTransaction("invoice-transaction-' . $transaction->id . '")' )) !!} {!! Form::close() !!} @endif
{{ trans('general.no_records') }}
@stack('row_footer_payment_end')
@stack('row_footer_end') @endsection @push('content_content_end') @endpush @push('scripts_start') @endpush