@if ($invoice->receivable)
@else
{{ __('patientappo.invoice no receiver') }}
@endif
{!! QrCode::color(68, 95,
129)->size(75)->style('round')->eye('circle')->generate($invoice->code) !!}
{{ $invoice->code }}
{{ __('basic.type') }}
@if ($invoice->type == 0)
{{ __('patientappo.income') }}
@else
{{ __('patientappo.expenses') }}
@endif
{{ __('basic.specialty') }}
{{ $invoice->specialty->name }}
{{ __('basic.branch') }}
{{ $invoice->branch->name }} @if ($invoice->worker)
| {{ $invoice->worker->name }}
@endif
{{ __('basic.created') }}
{{ date('d M Y', strtotime($invoice->created_at)) }}
@role('Super-admin|Branch-manager')
@endrole {{ __('basic.attached') }}
@role('Super-admin|Branch-manager')
@endrole
@if (!empty($invoice->attached_pic))
{{ __('basic.download') }}
@else
No attached
@endif
@if ($invoice->payment_method == 1)
@php
$payment_method_txt = __('basic.cash');
@endphp
@elseif ($invoice->payment_method == 2)
@php
$payment_method_txt = __('basic.visa');
@endphp
@elseif ($invoice->payment_method == 3)
@php
$payment_method_txt = __('basic.online');
@endphp
@elseif ($invoice->payment_method == 4)
@php
$payment_method_txt = __('basic.bank transfer');
@endphp
@elseif ($invoice->payment_method == 5)
@php
$payment_method_txt = __('basic.mobile transfer');
@endphp
@else
@php
$payment_method_txt = '';
@endphp
@endif
@if ($invoice->status == 0)
{{ __('basic.status') }}
{{ __('basic.not paid')
}}
@elseif ($invoice->status == 1)
{{ __('basic.status') }}
{{ __('basic.pending')
}}
@elseif ($invoice->status == 2)
{{ __('basic.status') }}
{{ __('basic.installment')
}}
@elseif ($invoice->status == 3)
{{ __('basic.paid') }}
{{ date('d M Y', strtotime($invoice->paid_date)) }} | {{ $payment_method_txt }}
@else
@endif
@foreach ($invoice->invoice_items as $item)
@role('Super-admin|Branch-manager')
@endrole
{{ $item->categorizable->name }}
{{ $item->price }}
{{ __('basic.egp') }}
@role('Super-admin|Branch-manager')
@endrole
@endforeach
{{ __('basic.subtotal')
}}
{{ $invoice->invoice_items->sum('price') }} {{ __('basic.egp') }}
{{ __('basic.discount')
}}
@if (!empty($invoice->discount))
{{ $invoice->discount }}
{{ __('basic.egp') }}
@else
0 {{ __('basic.egp') }}
@endif
{{ __('basic.total price') }}
{{ $invoice->final_price }} {{ __('basic.egp') }}
@role('Super-admin|Accountant')
Doctors commission
{{ $invoice->invoice_items->sum('doctor_comm') }}
{{ __('basic.egp') }}
@if (count($invoice->costs) > 0)
@foreach ($invoice->costs as $item)
@role('Super-admin|Branch-manager')
@endrole
{{ $item->cost_cat->name }}
{{ $item->price }}
{{ __('basic.egp') }}
@role('Super-admin|Branch-manager')
@endrole
@endforeach
@endif
@if (count($invoice->materials) > 0)
@foreach ($invoice->materials as $item)
@role('Super-admin|Branch-manager')
@endrole
{{ $item->inventory->name }} (Qty:
{{ $item->qty }})
@php
$material_item_cost = $item->qty * $item->price;
@endphp
{{ $material_item_cost }}
{{ __('basic.egp') }}
@role('Super-admin|Branch-manager')
@endrole
@endforeach
@endif
{{ __('basic.total cost') }}
{{ $invoice->total_cost }}
{{ __('basic.egp') }}
@endrole
{{-- for payments --}}
@if (count($invoice->payment) > 0)
@foreach ($invoice->payment as $item_p)
@php
if ($item_p->method == 1) {
$method_payment = 'Cash';
} else {
$method_payment = 'Visa';
}
@endphp
@if ($invoice->status == 1)
@role('Super-admin|Branch-manager')
@endrole
@endif
@if ($item_p->type == 2)
@endif
@if ($item_p->type == 2)
{{ date('d M Y', strtotime($item_p->installment_date))
}}
Installment
@else
{{ date('d M Y', strtotime($item_p->paid_date)) }}
via
{{ $method_payment }}
@endif
@if ($item_p->installment_date)
Installment:
{{ date('d M Y', strtotime($item_p->installment_date)) }}
@endif
@if ($item_p->worker)
Shift:
{{ $item_p->worker->name }}
@endif
{{ $item_p->amount }}
{{ __('basic.egp') }}
@role('Super-admin|Branch-manager')
@endrole
@role('Super-admin|Branch-manager')
@endrole
@endforeach
{{ __('basic.total payments') }}
@if ($invoice->sum_payment)
{{ $invoice->sum_payment }}
@else
0
@endif
{{ __('basic.egp') }}
@if ($invoice->status !== 3)
{{ __('basic.remaining amount') }}
{{ $invoice->final_price - $invoice->sum_payment }}
{{ __('basic.egp') }}
@endif
@endif
{{ $invoice->note }}
{{ __('patientappo.invoice final msg') }}
@if ($invoice->status == 0)
{{ __('basic.not paid') }}
@elseif (in_array($invoice->status, [1, 2]))
{{ __('basic.remaining amount') }}
{{ $invoice->final_price - $invoice->sum_payment }}
{{ __('basic.egp') }}
@else
{{ __('patientappo.amount to pay') }}
{{ $invoice->final_price }}
{{ __('basic.egp') }}
@endif