@extends('layouts.master') @section('title', 'Statistics | Proxima - Medical Management app') @section('title-topbar', 'Statistics') @section('css') @endsection @section('content')
Dashboard | Invoice | Day invoices
@role('Super-admin|Accountant') @endrole @role('Receptionist') @endrole
@if (request()->live_report) @else @endif
Income invoices
@role('Super-admin|Accountant') @endrole @php $total_income_cash = 0; $total_income_visa = 0; @endphp @foreach ($invoice_income as $item) @role('Super-admin|Accountant') @endrole @endforeach @role('Super-admin|Accountant') @endrole
Status TotalCostCat 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_income = $total_income_cash + $total_income_visa }} EGP Cash {{ $total_income_cash }} EGP Credit {{ $total_income_visa }} EGP Cost {{ $invoice_income->sum('total_cost') }} EGP
Expenses invoices
@php $total_expenses_cash = 0; $total_expenses_visa = 0; @endphp @foreach ($invoice_expenses as $item) @endforeach
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
Wallet transactions
@foreach ($wallet as $item) @if ($item->type == 0) @php $text_color = 'main-color-btn'; $msg = __('basic.add'); @endphp @elseif ($item->type == 1) @php $text_color = 'cancel-color-btn'; $msg = __('basic.withdraw'); @endphp @endif @endforeach
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 }}
@role('Super-admin|Operation|Operation_accountant')
Operation income invoices
@php $total_income_op_cash = 0; $total_income_op_visa = 0; @endphp @foreach ($invoice_oper_income as $item) @endforeach
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
Operation expenses invoices
@php $total_expenses_op_cash = 0; $total_expenses_op_visa = 0; @endphp @foreach ($invoice_oper_expenses as $item) @endforeach
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
@endrole
{{-- total income (cash - credit) --}}
Income (Cash) Expenses (Cash)
Net Income (Cash)
@php $profit_cash = $total_income_cash - $total_expenses_cash; @endphp {{ $profit_cash }} EGP @role('Super-admin|Accountant')
Net Income After Cost (Cash)
{{ $profit_cash - $invoice_income->sum('total_cost') }} EGP @endrole
{{-- total income (cash - credit) --}}
Income (Visa) Expenses (Visa)
Net Income (Visa)
@php $profit_visa = $total_expenses_visa - $total_income_visa; @endphp {{ $profit_visa }} EGP @role('Super-admin|Accountant')
Net Income After Cost (Visa)
{{ $profit_visa - $invoice_income->sum('total_cost') }} EGP @endrole
{{-- total income (cash - credit) --}}
Income (Cash + Visa) Expenses (Cash + Visa)
Net Income
@php $profit = $total_income - $total_expenses; @endphp {{ $profit }} EGP @role('Super-admin|Accountant')
Net Income After Cost
{{ $profit - $invoice_income->sum('total_cost') }} EGP @endrole
@endsection @section('js') @php $chart_color = ['#1a78f1', '#38dfa8', '#d13c62', '#12c7d9', '#03c2c3', '#5035df', '#17a673', '#2e59d9', '#9aeded', '#f3d56a', '#7c859d', '#a4adc5', '#80142f', '#33d293', '#bed233', '#3958e9', '#10c86f', '#654fb6', '#a44fb6', '#89728e', '#c85110', '#6d769d', '#1b6954', '#204494', '#94206b', '#948320', '#209493', '#292094', '#203a65', '#4e6fa5', '#e29031', '#e23168', '#31e0e2', '#e29131', '#319fe2', '#8131e2', '#31a8e2', '#31e2c0', '#31c3e2', '#e2a931', '#3157e2', '#dc3545', '#51b24b', '#a94bb2', '#4b8bb2', '#57b24b', '#a5b24b', '#b2804b', '#b24b4b', '#834bb2', '#b24b6a', '#574bb2', '#236368', '#232c68', '#682345', '#4b2368', '#234b68', '#306823', '#a39f39', '#a239a3', '#a33963', '#a33951', '#a33939', '#c73737', '#6837c7']; @endphp @endsection