@extends('layouts.report_pdf') @section('title') {{__('Daily wallet report')}}-{{date('Y-m-d')}} @endsection @section('content')
{{-- --}} {{__('Daily wallet report')}} {{__('Date')}} : {{date('Y-m-d H:i')}}
{{__('Date range')}} : {{date('Y-m-d H:i',strtotime($data['from']))}} - {{date('Y-m-d H:i',strtotime($data['to']))}}
@if(count($data['invoices'])&&request()->has('print.invoices')) @foreach($data['invoices'] as $invoice) @endforeach
{{__('Invoices')}}
# {{__('Status')}} {{__('Branch')}} {{__('Created by')}} {{__('Date')}} {{__('Patient Name')}} {{__('Referral')}} {{__('Laboratory')}} {{__('Contract')}} {{__('Subtotal')}} {{__('Discount')}} {{__('Total')}} {{__('Paid')}} {{__('Due')}}
{{$invoice['id']}} @if($invoice['canceled']) @else @endif @if(isset($invoice['branch'])) {{$invoice['branch']['name_'.app()->getLocale()]}} @endif @if(isset($invoice['created_by_user'])) {{$invoice['created_by_user']['name']}} @elseif(isset($invoice['created_by_laboratory'])) {{$invoice['created_by_laboratory']['name']}} @elseif(isset($invoice['created_by_contract'])) {{$invoice['created_by_contract']['name']}} @elseif(isset($invoice['created_by_referral'])) {{$invoice['created_by_referral']['name']}} @endif {{date('Y-m-d H:i',strtotime($invoice['created_at']))}} @if(isset($invoice['patient'])) {{$invoice['patient']['name']}} @endif @if(isset($invoice['referral'])) {{$invoice['referral']['name']}} @endif @if(isset($invoice['from_laboratory'])) {{$invoice['from_laboratory']['name']}} @endif @if(isset($invoice['contract'])) {{$invoice['contract']['name']}} @endif {{format_money($invoice['subtotal'])}} {{format_money($invoice['discount_total'])}} {{format_money($invoice['patient_payment_total'])}} {{format_money($invoice['patient_paid'])}} {{format_money($invoice['patient_due'])}}
{{__('Summary')}} {{format_money($data['invoices']->where('canceled',false)->sum('subtotal'))}} {{format_money($data['invoices']->where('canceled',false)->sum('discount_total'))}} {{format_money($data['invoices']->where('canceled',false)->sum('patient_payment_total'))}} {{format_money($data['invoices']->where('canceled',false)->sum('patient_paid'))}} {{format_money($data['invoices']->where('canceled',false)->sum('patient_due'))}}
@endif @if(count($data['payments'])&&request()->has('print.payments')) @foreach($data['payments'] as $payment) @endforeach
{{__('Payments')}}
# {{__('Date')}} {{__('Branch')}} {{__('Cashier')}} #{{__('Visit')}} {{__('Visit date')}} {{__('Patient')}} {{__('Amount')}} {{__('Payment method')}} {{__('Transaction ID')}}
{{$payment['id']}} {{$payment['date']}} @if(isset($payment['invoice'])&&isset($payment['invoice']['branch'])) {{$payment['invoice']['branch']['name_'.app()->getLocale()]}} @endif @if(isset($payment['user'])) {{$payment['user']['name']}} @endif {{$payment['invoice_id']}} @if(isset($payment['invoice'])) {{$payment['invoice']['created_at']}} @endif @if(isset($payment['invoice'])&&isset($payment['invoice']['patient'])) {{$payment['invoice']['patient']['name']}} @endif {{format_money($payment['amount'])}} @if(isset($payment['payment_method'])) {{$payment['payment_method']['name']}} @endif {{$payment['kent_id']}}
{{__('Summary')}} {{format_money($data['paid'])}}
@endif @if(count($data['refunds'])&&request()->has('print.refunds')) @foreach($data['refunds'] as $refund) @endforeach
{{__('Refunds')}}
# {{__('Date')}} {{__('Branch')}} {{__('Cashier')}} #{{__('Visit')}} {{__('Visit date')}} {{__('Patient')}} {{__('Amount')}} {{__('Payment method')}} {{__('Transaction ID')}}
{{$refund['id']}} {{$refund['date']}} @if(isset($refund['invoice'])&&isset($refund['invoice']['branch'])) {{$refund['invoice']['branch']['name_'.app()->getLocale()]}} @endif @if(isset($refund['user'])) {{$refund['user']['name']}} @endif {{$refund['invoice_id']}} @if(isset($refund['invoice'])) {{$refund['invoice']['created_at']}} @endif @if(isset($refund['invoice'])&&isset($refund['invoice']['patient'])) {{$refund['invoice']['patient']['name']}} @endif {{format_money($refund['amount'])}} @if(isset($refund['payment_method'])) {{$refund['payment_method']['name']}} @endif {{$refund['kent_id']}}
{{__('Summary')}} {{format_money($data['refund'])}}
@endif @if(count($data['expenses'])&&request()->has('print.expenses')) @foreach($data['expenses'] as $expense) @endforeach
{{__('Expenses')}}
# {{__('Branch')}} {{__('Category')}} {{__('Date')}} {{__('Payment method')}} {{__('Note')}} {{__('Amount')}} {{__('Attachment')}}
{{$expense['id']}} @if(isset($expense['branch'])) {{$expense['branch']['name_'.app()->getLocale()]}} @endif @if(isset($expense['category'])) {{$expense['category']['name']}} @endif {{date('Y-m-d H:i',strtotime($expense['date']))}} @if(isset($expense['payment_method'])) {{$expense['payment_method']['name']}} @endif {{format_money($expense['amount'])}} {{$expense['notes']}} @if(isset($expense['attachment'])) {{__('Show')}} @endif
{{__('Summary')}} {{format_money($data['total_expenses'])}}
@endif @if(count($data['deposits'])&&request()->has('print.deposits')) @foreach($data['deposits'] as $deposit) @endforeach
{{__('Deposits')}}
# {{__('Branch')}} {{__('User')}} {{__('Date')}} {{__('Payment method')}} {{__('Amount')}} {{__('Note')}}
{{$deposit['id']}} @if(isset($deposit['branch'])) {{$deposit['branch']['name_'.app()->getLocale()]}} @endif @if(isset($deposit['user'])) {{$deposit['user']['name']}} @endif {{date('Y-m-d H:i',strtotime($deposit['date']))}} @if(isset($deposit['payment_method'])) {{$deposit['payment_method']['name']}} @endif {{format_money($deposit['amount'])}} {{$deposit['note']}}
{{__('Summary')}} {{format_money($data['deposit'])}}
@endif @if(count($data['users_statistics'])&&request()->has('print.users_statistics')) @foreach($data['users_statistics'] as $user) @endforeach
{{__('Users')}}
{{__('Name')}} {{__('Income')}} {{__('Refund')}} {{__('Expenses')}} {{__('Balance')}}
{{$user['name']}} {{format_money($user['income'])}} {{format_money($user['refund'])}} {{format_money($user['expense'])}} {{format_money($user['balance'])}}
{{__('Summary')}} {{format_money($data['users_statistics']->sum('income'))}} {{format_money($data['users_statistics']->sum('refund'))}} {{format_money($data['users_statistics']->sum('expense'))}} {{format_money($data['users_statistics']->sum('balance'))}}
@endif @if(request()->has('print.payment_methods_statistics')&&count($data['payment_methods'])) @foreach($data['payment_methods'] as $payment_method) @endforeach
{{__('Balance')}}
{{__('Payment method')}} {{__('Income')}} {{__('Refund')}} {{__('Deposit')}} {{__('Expenses')}} {{__('Balance')}}
{{$payment_method['name']}} {{format_money($payment_method['income'])}} {{format_money($payment_method['refund'])}} {{format_money($payment_method['deposit'])}} {{format_money($payment_method['expense'])}} {{format_money($payment_method['balance'])}}
{{__('Summary')}} {{format_money(collect($data['payment_methods'])->flatten()->sum('income'))}} {{format_money(collect($data['payment_methods'])->flatten()->sum('refund'))}} {{format_money(collect($data['payment_methods'])->flatten()->sum('deposit'))}} {{format_money(collect($data['payment_methods'])->flatten()->sum('expense'))}} {{format_money(collect($data['payment_methods'])->flatten()->sum('balance'))}}
@endif @if(request()->has('print.summary'))
{{__('Summary')}}
{{__('Visits count')}} {{format_money($data['visits_count'])}}
{{__('OPD visits count')}} {{format_money($data['opd_visits_count'])}}
{{__('B2B visits count')}} {{format_money($data['b2b_visits_count'])}}
{{__('Subtotal')}} {{format_money($data['subtotal'])}}
{{__('Discount')}} {{format_money($data['discount'])}}
{{__('Total')}} {{format_money($data['total'])}}
{{__('Paid')}} {{format_money($data['paid'])}}
{{__('Paid by patient')}} {{format_money($data['patient_paid'])}}
{{__('Paid by laboratory')}} {{format_money($data['laboratory_paid'])}}
{{__('Paid by contract')}} {{format_money($data['contract_paid'])}}
{{__('Refund')}} {{format_money($data['refund'])}}
{{__('Due')}} {{format_money($data['due'])}}
{{__('Expenses')}} {{format_money($data['total_expenses'])}}
{{__('Deposits')}} {{format_money($data['deposit'])}}
{{__('Balance')}} {{format_money($data['balance'])}}
@endif @endsection