@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 == 'draft')
@endif @stack('status_message_end') @stack('timeline_start') @if (!in_array($bill->status, ['paid', 'cancelled'])) @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 == '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_received_start') @permission('update-purchases-bills') {{ trans('bills.mark_received') }} @endpermission @stack('timeline_body_receive_bill_body_button_received_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->received_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 != '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_get_paid_body_button_pay_start') @permission('update-purchases-bills') {{ trans('bills.mark_paid') }} @endpermission @stack('timeline_body_get_paid_body_button_pay_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.statuses.' . $bill->status) }}

@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
@if (setting('company.address')) @endif @if (setting('company.tax_number')) @endif @if (setting('company.phone')) @endif
{{ setting('company.name') }}
{!! nl2br(setting('company.address')) !!}
{{ trans('general.tax_number') }}: {{ setting('company.tax_number') }}
{{ setting('company.phone') }}
{{ setting('company.email') }}
@stack('bill_header_end') @stack('bill_information_start')
@if ($invoice->contact_address || $__env->hasStack('address_input_start', 'address_input_end')) @endif @if ($invoice->contact_tax_number || $__env->hasStack('tax_number_input_start', 'tax_number_input_end')) @endif @if ($invoice->contact_phone || $__env->hasStack('phone_input_start', 'phone_input_end')) @endif @if ($invoice->contact_email || $__env->hasStack('email_start', 'email_input_end')) @endif
{{ trans('bills.bill_from') }} @stack('name_input_start') {{ $bill->contact_name }} @stack('name_input_end')
@stack('address_input_start') @if ($bill->contact_address) {!! nl2br($bill->contact_address) !!} @endif @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') @if ($bill->contact_email) {{ $bill->contact_email }} @endif @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') @if (in_array(setting('localisation.discount_location', 'total'), ['item', 'both'])) @stack('discount_th_start') @stack('discount_th_end') @endif @stack('total_th_start') @stack('total_th_end') @foreach($bill->items as $item) @include('partials.documents.item.show', ['document' => $bill]) @endforeach
{{ trans_choice('general.items', 1) }}{{ trans('bills.quantity') }}{{ trans('bills.price') }}{{ trans('bills.discount') }}{{ trans('bills.total') }}
@stack('bill_item_end') @stack('bill_total_start')
@stack('notes_input_start')
@if ($bill->notes) @endif

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

{!! nl2br($bill->notes) !!}

@stack('notes_input_end')
@foreach ($bill->totals_sorted as $total) @if ($total->code != 'total') @stack($total->code . '_total_tr_start') @stack($total->code . '_total_tr_end') @else @if ($bill->paid) @stack('paid_total_tr_start') @stack('paid_total_tr_end') @endif @stack('grand_total_tr_start') @stack('grand_total_tr_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) {{ trans('bills.statuses.' . $history->status) }} {{ $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($transaction->paid_at) @money($transaction->amount, $transaction->currency_code, true) {{ $transaction->account->name }} @if ($transaction->reconciled) @else @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::button(' ' . trans('general.delete'), array( 'type' => 'button', 'class' => 'btn btn-danger btn-sm', 'title' => trans('general.delete'), '@click' => 'confirmDelete("' . route('transactions.destroy', $transaction->id) . '", "' . trans_choice('general.transactions', 2) . '", "' . $message. '", "' . trans('general.cancel') . '", "' . trans('general.delete') . '")' )) !!} @endif
{{ trans('general.no_records') }}
@stack('row_footer_transaction_end')
@stack('row_footer_end') {{ Form::hidden('bill_id', $bill->id, ['id' => 'bill_id']) }} @endsection @push('scripts_start') @endpush