@extends('layouts.master') @section('title', 'Statistics | Proxima - Medical Management app') @section('title-topbar', 'Statistics') @section('css') @endsection @section('content')
| Status | Total@role('Super-admin|Accountant') | Cost@endrole | Cat | Items | Description | Discount | Receptionist | Patient | Doctor | Branch | Date-Time | 
|---|---|---|---|---|---|---|---|---|---|---|---|
| @if ($item->status == 1)
                                                @php
                                                $status = 'pend-color-btn';
                                                $status_msg = __('basic.pending');
                                                @endphp
                                                @elseif ($item->status == 2)
                                                @php
                                                $status = 'prog-color-btn';
                                                $status_msg = __('basic.installment');
                                                @endphp
                                                @elseif ($item->status == 3)
                                                @php
                                                $status = 'done-color-btn';
                                                $status_msg = __('basic.paid');
                                                @endphp
                                                @elseif ($item->status == 4)
                                                @php
                                                $status = 'cancel-color-btn';
                                                $status_msg = __('basic.refund');
                                                @endphp
                                                @endif 
                                                    {{ $status_msg }} | @foreach ($item->payment as $item_p)
                                                @if ($item_p->method == 1)
                                                @php
                                                $payment_method_txt = __('basic.cash');
                                                $total_income_cash += $item_p->amount;
                                                @endphp
                                                @elseif ($item_p->method == 2)
                                                @php
                                                $payment_method_txt = __('basic.visa');
                                                $total_income_visa += $item_p->amount;
                                                @endphp
                                                @endif
                                                {{ $item_p->amount }} 
                                                    EGP @role('Super-admin|Accountant')
                                                    via {{ $payment_method_txt }} | shift:
                                                    {{ $item_p->worker->name }}
                                                @endforeach | {{ $item->total_cost }} EGP@endrole | {{ $item->service_inv_cat->name }} | @foreach ($item->invoice_items as $item_items) @if ($item_items->categorizable) {{ $item_items->categorizable->name }} | @else No Items @endif @endforeach | {{ $item->note }} | @if ($item->discount)
                                                {{ $item->discount }} 
                                                    EGP 
                                                    on {{ $item->items_price }} egp
                                                @else
                                                @endif | @php
                                                $workers = [];
                                                @endphp
                                                @foreach ($item->payment as $item_p)
                                                    @if (!in_array($item_p->worker->name,$workers))
                                                        @php
                                                        $workers[] = $item_p->worker->name
                                                        @endphp
                                                    @endif
                                                @endforeach
                                                @foreach ($workers as $worker)
                                                 {{$worker}} @endforeach | @if ($item->receivable) {{ $item->receivable->name }} @else {{ __('patientappo.no receiver') }} @endif | @php
                                                $doctors = [];
                                                @endphp
                                                @foreach ($item->invoice_items as $item_items)
                                                    @if ($item_items->doctor->name ?? '')
                                                        @if (!in_array($item_items->doctor->name ,$doctors))
                                                            @php
                                                            $doctors[] = $item_items->doctor->name
                                                            @endphp
                                                        @endif
                                                    @endif
                                                @endforeach
                                                @if (!$doctors)
                                                    No Doctor Assigned
                                                @endif
                                                @foreach ($doctors as $doctor)
                                                 {{$doctor}} @endforeach | {{ $item->branch->name }} | @foreach ($item->payment as $item_p)
                                                    {{$item_p->paid_date}} @endforeach | 
| TOTAL | {{ $total_income = $total_income_cash + $total_income_visa }} EGP | Cash | {{ $total_income_cash }} EGP | Credit | {{ $total_income_visa }} EGP@role('Super-admin|Accountant') | Cost | {{ $invoice_income->sum('total_cost') }} EGP@endrole | 
| Status | Total | Cat | Items | Description | Discount | Receptionist | Patient | Doctor | Branch | Date-Time | 
|---|---|---|---|---|---|---|---|---|---|---|
| @if ($item->status == 1)
                                                @php
                                                $status = 'pend-color-btn';
                                                $status_msg = __('basic.pending');
                                                @endphp
                                                @elseif ($item->status == 2)
                                                @php
                                                $status = 'prog-color-btn';
                                                $status_msg = __('basic.installment');
                                                @endphp
                                                @elseif ($item->status == 3)
                                                @php
                                                $status = 'done-color-btn';
                                                $status_msg = __('basic.paid');
                                                @endphp
                                                @elseif ($item->status == 4)
                                                @php
                                                $status = 'cancel-color-btn';
                                                $status_msg = __('basic.refund');
                                                @endphp
                                                @endif 
                                                    {{ $status_msg }} | @foreach ($item->payment as $item_p)
                                                @if ($item_p->method == 1)
                                                @php
                                                $payment_method_txt = __('basic.cash');
                                                $total_expenses_cash += $item_p->amount;
                                                @endphp
                                                @elseif ($item_p->method == 2)
                                                @php
                                                $payment_method_txt = __('basic.visa');
                                                $total_expenses_visa += $item_p->amount;
                                                @endphp
                                                @endif
                                                {{ $item_p->amount }} 
                                                    EGP 
                                                    via {{ $payment_method_txt }} | shift:
                                                    {{ $item_p->worker->name }}
                                                @endforeach | {{ $item->service_inv_cat->name }} | @foreach ($item->invoice_items as $item_items) @if ($item_items->categorizable) {{ $item_items->categorizable->name }} | @else No Items @endif @endforeach | {{ $item->note }} | @if ($item->discount)
                                                {{ $item->discount }} 
                                                    EGP 
                                                    on {{ $item->items_price }} egp
                                                @else
                                                @endif | @php
                                                $workers = [];
                                                @endphp
                                                @foreach ($item->payment as $item_p)
                                                    @if (!in_array($item_p->worker->name,$workers))
                                                        @php
                                                        $workers[] = $item_p->worker->name
                                                        @endphp
                                                    @endif
                                                @endforeach
                                                @foreach ($workers as $worker)
                                                 {{$worker}} @endforeach | @if ($item->receivable) {{ $item->receivable->name }} @else {{ __('patientappo.no receiver') }} @endif | @php
                                                $doctors = [];
                                                @endphp
                                                @foreach ($item->invoice_items as $item_items)
                                                    @if ($item_items->doctor->name ?? '')
                                                        @if (!in_array($item_items->doctor->name ,$doctors))
                                                            @php
                                                            $doctors[] = $item_items->doctor->name
                                                            @endphp
                                                        @endif
                                                    @endif
                                                @endforeach
                                                @if (!$doctors)
                                                    No Doctor Assigned
                                                @endif
                                                @foreach ($doctors as $doctor)
                                                 {{$doctor}} @endforeach | {{ $item->branch->name }} | @foreach ($item->payment as $item_p)
                                                    {{$item_p->paid_date}} @endforeach | 
| TOTAL | {{ $total_expenses = $total_expenses_cash + $total_expenses_visa }} EGP | Cash | {{ $total_expenses_cash }} EGP | Credit | {{ $total_expenses_visa }} EGP | 
| Type | Patient | Service name | Balance Before | Amount | Balance After | Branch | Note | 
|---|---|---|---|---|---|---|---|
| TOTAL | {{ $wallet->sum('amount') }} EGP | ||||||
| {{ $msg }} | {{ $item->patient->name }} | @if ($item->service) {{ $item->service->name }} @else Add new balance @endif | {{ $item->balance_before_tran }} EGP | {{ $item->amount }} EGP | {{ $item->balance_before_tran - $item->amount }} EGP | {{ $item->branch->name }} | {{ $item->note }} | 
| Status | Total | Cost | Cat | Items | Description | Discount | Receptionist | Patient | Doctor | Branch | Date-Time | 
|---|---|---|---|---|---|---|---|---|---|---|---|
| @if ($item->status == 1)
                                                @php
                                                $status = 'pend-color-btn';
                                                $status_msg = __('basic.pending');
                                                @endphp
                                                @elseif ($item->status == 2)
                                                @php
                                                $status = 'prog-color-btn';
                                                $status_msg = __('basic.installment');
                                                @endphp
                                                @elseif ($item->status == 3)
                                                @php
                                                $status = 'done-color-btn';
                                                $status_msg = __('basic.paid');
                                                @endphp
                                                @elseif ($item->status == 4)
                                                @php
                                                $status = 'cancel-color-btn';
                                                $status_msg = __('basic.refund');
                                                @endphp
                                                @endif 
                                                    {{ $status_msg }} | @foreach ($item->payment as $item_p)
                                                @if ($item_p->method == 1)
                                                @php
                                                $payment_method_txt = __('basic.cash');
                                                $total_income_cash += $item_p->amount;
                                                @endphp
                                                @elseif ($item_p->method == 2)
                                                @php
                                                $payment_method_txt = __('basic.visa');
                                                $total_income_visa += $item_p->amount;
                                                @endphp
                                                @endif
                                                {{ $item_p->amount }} 
                                                    EGP 
                                                    via {{ $payment_method_txt }} | shift:
                                                    {{ $item_p->worker->name }}
                                                @endforeach | {{ $item->total_cost }} EGP | {{ $item->service_inv_cat->name }} | @foreach ($item->invoice_items as $item_items) @if ($item_items->categorizable) {{ $item_items->categorizable->name }} | @else No Items @endif @endforeach | {{ $item->note }} | @if ($item->discount)
                                                {{ $item->discount }} 
                                                    EGP 
                                                    on {{ $item->items_price }} egp
                                                @else
                                                @endif | @php
                                                $workers = [];
                                                @endphp
                                                @foreach ($item->payment as $item_p)
                                                    @if (!in_array($item_p->worker->name,$workers))
                                                        @php
                                                        $workers[] = $item_p->worker->name
                                                        @endphp
                                                    @endif
                                                @endforeach
                                                @foreach ($workers as $worker)
                                                 {{$worker}} @endforeach | @if ($item->receivable) {{ $item->receivable->name }} @else {{ __('patientappo.no receiver') }} @endif | @php
                                                $doctors = [];
                                                @endphp
                                                @foreach ($item->invoice_items as $item_items)
                                                    @if ($item_items->doctor->name ?? '')
                                                        @if (!in_array($item_items->doctor->name ,$doctors))
                                                            @php
                                                            $doctors[] = $item_items->doctor->name
                                                            @endphp
                                                        @endif
                                                    @endif
                                                @endforeach
                                                @if (!$doctors)
                                                    No Doctor Assigned
                                                @endif
                                                @foreach ($doctors as $doctor)
                                                 {{$doctor}} @endforeach | {{ $item->branch->name }} | @foreach ($item->payment as $item_p)
                                                    {{$item_p->paid_date}} @endforeach | 
| TOTAL | {{ $total_op_income = $total_income_op_cash + $total_income_op_visa }} EGP | Cash | {{ $total_income_op_cash }} EGP | Credit | {{ $total_income_op_visa }} EGP | Cost | {{ $invoice_income->sum('total_cost') }} EGP | 
| Status | Total | Cat | Items | Description | Discount | Receptionist | Patient | Doctor | Branch | Date-Time | 
|---|---|---|---|---|---|---|---|---|---|---|
| @if ($item->status == 1)
                                                @php
                                                $status = 'pend-color-btn';
                                                $status_msg = __('basic.pending');
                                                @endphp
                                                @elseif ($item->status == 2)
                                                @php
                                                $status = 'prog-color-btn';
                                                $status_msg = __('basic.installment');
                                                @endphp
                                                @elseif ($item->status == 3)
                                                @php
                                                $status = 'done-color-btn';
                                                $status_msg = __('basic.paid');
                                                @endphp
                                                @elseif ($item->status == 4)
                                                @php
                                                $status = 'cancel-color-btn';
                                                $status_msg = __('basic.refund');
                                                @endphp
                                                @endif 
                                                    {{ $status_msg }} | @foreach ($item->payment as $item_p)
                                                @if ($item_p->method == 1)
                                                @php
                                                $payment_method_txt = __('basic.cash');
                                                $total_income_cash += $item_p->amount;
                                                @endphp
                                                @elseif ($item_p->method == 2)
                                                @php
                                                $payment_method_txt = __('basic.visa');
                                                $total_income_visa += $item_p->amount;
                                                @endphp
                                                @endif
                                                {{ $item_p->amount }} 
                                                    EGP 
                                                    via {{ $payment_method_txt }} | shift:
                                                    {{ $item_p->worker->name }}
                                                @endforeach | {{ $item->service_inv_cat->name }} | @foreach ($item->invoice_items as $item_items) @if ($item_items->categorizable) {{ $item_items->categorizable->name }} | @else No Items @endif @endforeach | {{ $item->note }} | @if ($item->discount)
                                                {{ $item->discount }} 
                                                    EGP 
                                                    on {{ $item->items_price }} egp
                                                @else
                                                @endif | @php
                                                $workers = [];
                                                @endphp
                                                @foreach ($item->payment as $item_p)
                                                    @if (!in_array($item_p->worker->name,$workers))
                                                        @php
                                                        $workers[] = $item_p->worker->name
                                                        @endphp
                                                    @endif
                                                @endforeach
                                                @foreach ($workers as $worker)
                                                 {{$worker}} @endforeach | @if ($item->receivable) {{ $item->receivable->name }} @else {{ __('patientappo.no receiver') }} @endif | @php
                                                $doctors = [];
                                                @endphp
                                                @foreach ($item->invoice_items as $item_items)
                                                    @if ($item_items->doctor->name ?? '')
                                                        @if (!in_array($item_items->doctor->name ,$doctors))
                                                            @php
                                                            $doctors[] = $item_items->doctor->name
                                                            @endphp
                                                        @endif
                                                    @endif
                                                @endforeach
                                                @if (!$doctors)
                                                    No Doctor Assigned
                                                @endif
                                                @foreach ($doctors as $doctor)
                                                 {{$doctor}} @endforeach | {{ $item->branch->name }} | @foreach ($item->payment as $item_p)
                                                    {{$item_p->paid_date}} @endforeach | 
| TOTAL | {{ $total_op_expenses = $total_expenses_op_cash + $total_expenses_op_visa }} EGP | Cash | {{ $total_expenses_op_cash }} EGP | Credit | {{ $total_expenses_op_visa }} EGP |