@extends('layouts.admin') @section('title', trans_choice('general.bills', 1) . ': ' . $bill->bill_number) @section('content') @stack('recurring_message_start') @if (($recurring = $bill->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.bills', 1)), 'date' => $next->format($date_format) ]) }}

@stack('recurring_message_body_end')
@endif @stack('recurring_message_end') @stack('status_message_start') @if ($bill->status->code == 'draft')
@endif @stack('status_message_end') @stack('timeline_start') @if ($bill->status->code != 'paid') @stack('timeline_body_start')
@stack('timeline_body_create_bill_start')
@stack('timeline_body_create_bill_head_start')

{{ trans('bills.create_bill') }}

@stack('timeline_body_create_bill_head_end') @stack('timeline_body_create_bill_body_start') @stack('timeline_body_create_bill_body_message_start') {{ trans_choice('general.statuses', 1) . ':' }} {{ trans('bills.messages.status.created', ['date' => Date::parse($bill->created_at)->format($date_format)]) }} @stack('timeline_body_create_bill_body_message_end')
@stack('timeline_body_create_bill_body_button_edit_start') {{ trans('general.edit') }} @stack('timeline_body_create_bill_body_button_edit_end')
@stack('timeline_body_create_bill_body_end')
@stack('timeline_body_create_bill_end') @stack('timeline_body_receive_bill_start')
@stack('timeline_body_receive_bill_head_start')

{{ trans('bills.receive_bill') }}

@stack('timeline_body_receive_bill_head_end') @stack('timeline_body_receive_bill_body_start') @if ($bill->status->code == 'draft') @stack('timeline_body_receive_bill_body_message_start') {{ trans_choice('general.statuses', 1) . ':' }} {{ trans('bills.messages.status.receive.draft') }} @stack('timeline_body_receive_bill_body_message_end')
@stack('timeline_body_receive_bill_body_button_sent_start') @permission('update-purchases-bills') {{ trans('bills.mark_received') }} @endpermission @stack('timeline_body_receive_bill_body_button_sent_end')
@else @stack('timeline_body_receive_bill_body_message_start') {{ trans_choice('general.statuses', 1) . ':' }} {{ trans('bills.messages.status.receive.received', ['date' => Date::parse($bill->created_at)->format($date_format)]) }} @stack('timeline_body_receive_bill_body_message_end') @endif @stack('timeline_body_receive_bill_body_end')
@stack('timeline_body_receive_bill_end') @stack('timeline_body_make_payment_start')
@stack('timeline_body_make_payment_head_start')

{{ trans('bills.make_payment') }}

@stack('timeline_body_make_payment_head_end') @stack('timeline_body_make_payment_body_start') @stack('timeline_body_get_paid_body_message_start') @if($bill->status->code != 'paid' && empty($bill->transactions->count())) {{ trans_choice('general.statuses', 1) . ':' }} {{ trans('bills.messages.status.paid.await') }} @else {{ trans_choice('general.statuses', 1) . ':' }} {{ trans('general.partially_paid') }} @endif @stack('timeline_body_make_payment_body_message_end')
@stack('timeline_body_make_payment_body_button_payment_start') @if(empty($bill->transactions->count()) || (!empty($bill->transactions->count()) && $bill->paid != $bill->amount)) @endif @stack('timeline_body_make_payment_body_button_payment_end')
@stack('timeline_body_make_payment_body_end')
@stack('timeline_body_make_payment_end')
@stack('timeline_body_end') @endif @stack('timeline_end') @stack('bill_start')
@stack('bill_status_start')

{{ trans('bills.status.' . $bill->status->code) }}

@stack('bill_status_end')
@stack('bill_header_start')
@if (!empty($bill->contact->logo) && !empty($bill->contact->logo->id)) {{ $bill->contact_name }} @else {{ $bill->contact_name }} @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('bill_header_end') @stack('bill_information_start')
{{ trans('bills.bill_from') }} @stack('name_input_start') {{ $bill->contact_name }} @stack('name_input_end')
@stack('address_input_start') {!! nl2br($bill->contact_address) !!} @stack('address_input_end')
@stack('tax_number_input_start') @if ($bill->contact_tax_number) {{ trans('general.tax_number') }}: {{ $bill->contact_tax_number }} @endif @stack('tax_number_input_end')
@stack('phone_input_start') @if ($bill->contact_phone) {{ $bill->contact_phone }} @endif @stack('phone_input_end')
@stack('email_start') {{ $bill->contact_email }} @stack('email_input_end')
@stack('bill_number_input_start') @stack('bill_number_input_end') @stack('order_number_input_start') @if ($bill->order_number) @endif @stack('order_number_input_end') @stack('billed_at_input_start') @stack('billed_at_input_end') @stack('due_at_input_start') @stack('due_at_input_end')
{{ trans('bills.bill_number') }}: {{ $bill->bill_number }}
{{ trans('bills.order_number') }}: {{ $bill->order_number }}
{{ trans('bills.bill_date') }}: @date($bill->billed_at)
{{ trans('bills.payment_due') }}: @date($bill->due_at)
@stack('bill_information_end') @stack('bill_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($bill->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('general.items', 1) }}{{ trans('bills.quantity') }}{{ trans('bills.price') }}{{ trans('bills.total') }}
{{ $item->name }}{{ $item->quantity }}@money($item->price, $bill->currency_code, true)@money($item->total, $bill->currency_code, true)
@stack('bill_item_end') @stack('bill_total_start')
@stack('notes_input_start')
@if ($bill->notes) @endif

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

{{ $bill->notes }}

@stack('notes_input_end')
@foreach ($bill->totals as $total) @if ($total->code != 'total') @stack($total->code . '_td_start') @stack($total->code . '_td_end') @else @if ($bill->paid) @endif @stack('grand_total_td_start') @stack('grand_total_td_end') @endif @endforeach
{{ trans($total->title) }}: @money($total->amount, $bill->currency_code, true)
{{ trans('bills.paid') }}: - @money($bill->paid, $bill->currency_code, true)
{{ trans($total->name) }}: @money($total->amount - $bill->paid, $bill->currency_code, true)
@stack('bill_total_end')
@stack('box_footer_start') @stack('box_footer_end')
@stack('bill_end') @stack('row_footer_start')
@stack('row_footer_history_start')
@foreach($bill->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_transaction_start')
@if ($bill->transactions->count()) @foreach($bill->transactions as $transaction) @endforeach @else @endif
{{ trans('general.date') }} {{ trans('general.amount') }} {{ trans_choice('general.accounts', 1) }} {{ trans('general.actions') }}
@date($item->paid_at) @money($transaction->amount, $transaction->currency_code, true) {{ $transaction->account->name }} @if ($transaction->reconciled) @else {!! Form::open([ 'id' => 'bill-transaction-' . $transaction->id, 'method' => 'DELETE', 'route' => ['transactions.destroy', $transaction->id], 'style' => 'display:inline' ]) !!} {!! Form::button(' ' . trans('general.delete'), array( 'type' => 'button', 'class' => 'btn btn-danger btn-sm', 'title' => trans('general.delete'), 'onclick' => 'confirmDelete("' . '#bill-transaction-' . $transaction->id . '", "' . trans_choice('general.transaction', 2) . '", "' . 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))]) . '", "' . trans('general.cancel') . '", "' . trans('general.delete') . '")' )) !!} {!! Form::close() !!} @endif
{{ trans('general.no_records') }}
@stack('row_footer_transaction_end')
@stack('row_footer_end') @endsection @push('content_content_end') @endpush @push('scripts_start') @endpush