@extends('layouts.master') @section('title', 'Invoice | Alboosh - Timeless authenticity, born of the desert') @section('title-topbar', $invoice_type) @section('css') @endsection @section('fixedcontent') @if (Session::has('success'))

Sent Successfully

{{ Session::get('success') }}

@endif @endsection @section('content')
{{ __('basic.dashboard') }} | {{ __('basic.invoices') }} | {{ $invoice_type }} @if ($invoice->receivable_type === 'App\Models\Invoice\Debtor') @php $receivable_type_name = $invoice->receivable->company_name; $receivable_type_title = __('basic.supplier'); $receivable_type_avatar = "img/debtor/"; @endphp @else @php $receivable_type_name = $invoice->receivable->full_name; $receivable_type_title = __('basic.client'); $receivable_type_avatar = "img/useravatar/"; @endphp @endif
{{ __('basic.send email') }} {{ __('basic.copy invoice pdf url') }} {{-- @if (in_array($invoice->status, [1, 2, 3]) && $invoice->refund_id == null && $invoice->type == 0) {{ __('basic.refund') }} @endif --}} @if ($invoice->status == 0) {{-- {{ __('patientappo.new items invoice') }} --}} @endif @if ($invoice->status == 0) {{-- {{ __('basic.installment') }} --}} {{ __('basic.pay') }} @role('Super-admin|Accountant-manager') {{ __('basic.delete') }} @endrole @endif @if ($invoice->status == 1) {{ __('basic.add payment') }} @endif @if ($invoice->status == 0) @role('Super-admin|Branch-manager|Accountant-manager') {{ __('basic.edit') }} {{-- {{ __('basic.edit') }} --}} @endrole @endif {{ __('basic.print') }}
@role('Super-admin|Branch-manager') @endrole
{{ $invoice_type }}
{!! QrCode::color(68, 95, 129)->size(75)->style('round')->eye('circle')->generate($invoice->code) !!}

{{ $invoice->code }}


{{ __('basic.transaction') }}

@if($invoice->entry) @foreach ($invoice->entry->items as $item) @if(!$loop->last OR $item->type == 1) @endif @endforeach @endif

{{ __('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->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)) }}

@else @endif

@foreach ($invoice->invoice_items as $item) @endforeach
{{ __('basic.item') }} {{ __('basic.description') }} {{ __('basic.unit price') }} {{ __('basic.quantity') }} {{ __('basic.tax') }} {{ __('basic.final price') }}
{{ $item->categorizable->name }} @if ($item->days) for {{ $item->days }} days @endif {{ $item->description }}
{{ $item->price }} {{ $invoice->currency->code }}
{{ $item->qty }} {{ $item->tax }}
{{ $item->final_price }} {{ $invoice->currency->code }}
{{ __('basic.subtotal') }}
{{ $invoice->items_price }}{{ $invoice->currency->code }}
{{ __('basic.discount') }}
@if (!empty($invoice->discount)) {{ $invoice->discount }} {{ $invoice->currency->code }} @else 0 {{ $invoice->currency->code }} @endif
{{ __('basic.tax') }}
{{ $invoice->total_tax }}{{ $invoice->currency->code }}
{{ __('basic.total price') }}
{{ $invoice->final_price }} {{ $invoice->currency->code }}
{{ __('basic.total paid') }}
{{ $invoice->total_paid }} {{ $invoice->currency->code }}
{{ __('basic.remaining amount') }}
{{ $invoice->final_price - $invoice->sum_payment }} {{ $invoice->currency->code }}
{{ $invoice->note }}
{{-- for payments --}} @if (count($invoice->payment) > 0)
@foreach ($invoice->payment as $item_p) @if($item_p->method == 1) @php $payment_method_text = __('basic.cash'); @endphp @elseif($item_p->method == 2) @php $payment_method_text = __('basic.bank transfer'); @endphp @elseif($item_p->method == 3) @php $payment_method_text = __('basic.credit card'); @endphp @elseif($item_p->method == 4) @php $payment_method_text = __('basic.mobile wallet'); @endphp @endif @endforeach
{{ __('basic.date') }} {{ __('basic.entry') }} {{ __('basic.payment') }} {{ __('basic.treasury') }} {{ __('basic.amount') }}
{{ date('d M Y', strtotime($item_p->paid_date)) }} @if ($item_p->worker)

{{ __('basic.worker') }}: {{ $item_p->worker->full_name }}

@endif
{{ $item_p->amount }} {{ $invoice->currency->code }}
{{ __('basic.total payments') }}
@if ($invoice->sum_payment) {{ $invoice->sum_payment }} @else 0 @endif {{ $invoice->currency->code }}
@if ($invoice->status !== 3)
{{ __('basic.remaining amount') }}
{{ $invoice->final_price - $invoice->sum_payment }} {{ $invoice->currency->code }}
@endif @else
{{ __('basic.no payments yet') }}
@endif
{{-- for payments --}} @if (count($invoice->inventory) > 0)
@foreach ($invoice->inventory as $item_iv) @endforeach
{{ __('basic.transaction') }} {{ __('basic.price') }} {{ __('basic.warehouse') }} {{ __('basic.quantity after') }}
@if($item_iv->type == 0) @php $trans_inventory_icon = "fa-plus"; $trans_inventory_color = "text-green"; @endphp @else @php $trans_inventory_icon = "fa-minus"; $trans_inventory_color = "text-red"; @endphp @endif

{{ $item_iv->quantity }}

{{ $item_iv->price . " " . $item_iv->currency->code }} @if ($item_iv->worker)

worker: {{ $item_iv->worker->full_name }}

@endif
{{ $item_iv->quantity_after }}
@else
{{ __('basic.no inventory yet') }}
@endif
{{ __('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 }} {{ $invoice->currency->code }}

@else
{{ __('patientappo.amount to pay') }}

{{ $invoice->final_price }} {{ $invoice->currency->code }}

@endif
@role('Super-admin|Accountant-manager') @endrole @endsection @section('js') @endsection