@extends('layouts.report_pdf') @section('title') {{__('Accounting report')}}-{{date('Y-m-d')}} @endsection @section('content')
{{-- --}}
|
{{__('Accounting 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']))}} |
| {{__('Invoices')}} | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| # | {{__('Status')}} | {{__('Branch')}} | {{__('Created by')}} | {{__('Date')}} | {{__('Patient Name')}} | {{__('Referral')}} | {{__('Laboratory')}} | {{__('Contract')}} | {{--{{__('Tests')}} | --}} {{--{{__('Subtotal')}} | {{__('Sample collection fees')}} | {{__('Tax')}} | {{__('Copayment discount')}} | --}}{{__('Subtotal')}} | {{__('Discount')}} | {{__('Total')}} | {{__('Copayment')}} | {{__('Paid')}} | {{__('Due')}} | ||||||
| {{$invoice['id']}} |
@if($invoice['canceled'])
|
@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 | {{--
| --}}
{{-- {{$invoice['subtotal']}} | {{$invoice['sample_collection_fees']}} | {{$invoice['tax']}} | {{$invoice['patient_payment_discount']}} | --}}{{format_money($invoice['subtotal'])}} | {{format_money($invoice['discount_total'])}} | {{format_money($invoice['total'])}} | {{format_money($invoice['patient_payment_total'])}} | {{format_money($invoice['paid'])}} | {{format_money($invoice['due'])}} | ||||||
| {{__('Summary')}} | {{--{{format_money($data['subtotal'])}} | {{format_money($data['discount'])}} | {{format_money(round($data['invoices']->sum('sample_collection_fees'),2))}} | {{format_money(round($data['invoices']->sum('tax'),2))}} | --}}{{format_money(round($data['invoices']->where('canceled',false)->sum('subtotal'),2))}} | {{format_money(round($data['invoices']->where('canceled',false)->sum('discount_total'),2))}} | {{format_money(round($data['invoices']->where('canceled',false)->sum('total'),2))}} | {{format_money(round($data['invoices']->where('canceled',false)->sum('patient_payment_total'),2))}} | {{format_money(round($data['invoices']->where('canceled',false)->sum('paid'),2))}} | {{format_money(round($data['invoices']->where('canceled',false)->sum('due'),2))}} | |||||||||||||||
| {{__('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(round($data['payments']->sum('amount'),2))}} | ||||||||
| {{__('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'])}} | ||||||||
| {{__('Expenses')}} | |||||||
|---|---|---|---|---|---|---|---|
| # | {{__('Branch')}} | {{__('Category')}} | {{__('Date')}} | {{__('Payment method')}} | {{__('Amount')}} | {{__('Note')}} | {{__('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'])}} | ||||||
| {{__('Expense categories')}} | |
|---|---|
| {{__('Category')}} | {{__('Amount')}} |
| {{$expense_category['category_name']}} | {{format_money($expense_category['total'])}} |
| {{__('Summary')}} | {{format_money(round($data['expense_categories']->sum('total'),2))}} |
| {{__('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'])}} | |||||
| {{__('Purchase payments')}} | ||||
|---|---|---|---|---|
| # | #{{__('Purchase')}} | {{__('Date')}} | {{__('Payment method')}} | {{__('Amount')}} |
| {{$payment['id']}} | {{$payment['purchase_id']}} | {{$payment['date']}} | @if(isset($payment['payment_method'])) {{$payment['payment_method']['name']}} @endif | {{format_money($payment['amount'])}} |
| {{__('Summary')}} | {{format_money(round($data['purchase_payments']->sum('amount'),2))}} | |||
| {{__('Tests')}} | ||
|---|---|---|
| {{__('Name')}} | {{__('Count')}} | {{__('Total')}} |
| {{$test['test_name']}} | {{$test['count']}} | {{$test['total']}} |
| {{__('Cultures')}} | ||
|---|---|---|
| {{__('Name')}} | {{__('Count')}} | {{__('Total')}} |
| {{$culture['culture_name']}} | {{$culture['count']}} | {{$culture['total']}} |
| {{__('Packages')}} | ||
|---|---|---|
| {{__('Name')}} | {{__('Count')}} | {{__('Total')}} |
| {{$package['package_name']}} | {{$package['count']}} | {{$package['total']}} |
| {{__('Laboratories')}} | ||||
|---|---|---|---|---|
| {{__('Name')}} | {{__('Invoices count')}} | {{__('Total')}} | {{__('Paid')}} | {{__('Due')}} |
| {{$laboratory['laboratory_name']}} | {{format_money($laboratory['count'])}} | {{format_money($laboratory['total'])}} | {{format_money($laboratory['paid'])}} | {{format_money($laboratory['due'])}} |
| {{__('Summary')}} | {{format_money(round($data['laboratories_statistics']->sum('count'),2))}} | {{format_money(round($data['laboratories_statistics']->sum('total'),2))}} | {{format_money(round($data['laboratories_statistics']->sum('paid'),2))}} | {{format_money(round($data['laboratories_statistics']->sum('due'),2))}} |
| {{__('Contracts')}} | |||||||
|---|---|---|---|---|---|---|---|
| {{__('Name')}} | {{__('Invoices count')}} | {{__('Total')}} | {{__('Contract copayment')}} | {{__('Contract discount')}} | {{__('Claim net amount')}} | {{__('Contract paid')}} | {{__('Contract due')}} |
| {{$contract['contract_name']}} | {{format_money($contract['count'])}} | {{format_money($contract['total'])}} | {{format_money($contract['contract_copayment'])}} | {{format_money($contract['contract_discount'])}} | {{format_money($contract['contract_claim'])}} | {{format_money($contract['contract_paid'])}} | {{format_money($contract['contract_due'])}} |
| {{__('Summary')}} | {{format_money(round($data['contracts_statistics']->sum('count'),2))}} | {{format_money(round($data['contracts_statistics']->sum('total'),2))}} | {{format_money(round($data['contracts_statistics']->sum('contract_copayment'),2))}} | {{format_money(round($data['contracts_statistics']->sum('contract_discount'),2))}} | {{format_money(round($data['contracts_statistics']->sum('contract_claim'),2))}} | {{format_money(round($data['contracts_statistics']->sum('contract_paid'),2))}} | {{format_money(round($data['contracts_statistics']->sum('contract_due'),2))}} |
| {{__('Companies')}} | ||
|---|---|---|
| {{__('Name')}} | {{__('Count')}} | {{__('Total')}} |
| {{$contract['company_name']}} | {{$contract['count']}} | {{$contract['total']}} |
| {{__('Referrals')}} | ||||||
|---|---|---|---|---|---|---|
| {{__('Name')}} | {{__('Invoices count')}} | {{__('Total')}} | {{__('Paid')}} | {{__('Due')}} | {{__('Commsission')}} | {{__('Profit')}} |
| {{$referral['referral_name']}} | {{format_money($referral['count'])}} | {{format_money($referral['total_income'])}} | {{format_money($referral['paid'])}} | {{format_money($referral['due'])}} | {{format_money($referral['commission'])}} | {{format_money($referral['profit'])}} |
| {{__('Summary')}} | {{format_money(round($data['referrals_statistics']->sum('count'),2))}} | {{format_money(round($data['referrals_statistics']->sum('total_income'),2))}} | {{format_money(round($data['referrals_statistics']->sum('paid'),2))}} | {{format_money(round($data['referrals_statistics']->sum('due'),2))}} | {{format_money(round($data['referrals_statistics']->sum('commission'),2))}} | {{format_money(round($data['referrals_statistics']->sum('profit'),2))}} |
| {{__('Patients')}} | ||||||
|---|---|---|---|---|---|---|
| {{__('File number')}} | {{__('Name')}} | {{__('Invoices count')}} | {{__('Total')}} | {{__('Copayment')}} | {{__('Paid')}} | {{__('Due')}} |
| {{$patient['patient_code']}} | {{$patient['patient_name']}} | {{format_money($patient['count'])}} | {{format_money($patient['total'])}} | {{format_money($patient['payment_amount'])}} | {{format_money($patient['paid'])}} | {{format_money($patient['due'])}} |
| {{__('Summary')}} | {{format_money(round($data['patients_statistics']->sum('count'),2))}} | {{format_money(round($data['patients_statistics']->sum('total'),2))}} | {{format_money(round($data['patients_statistics']->sum('payment_amount'),2))}} | {{format_money(round($data['patients_statistics']->sum('paid'),2))}} | {{format_money(round($data['patients_statistics']->sum('due'),2))}} | |
| {{__('Users')}} | |||||
|---|---|---|---|---|---|
| {{__('Name')}} | {{__('Income')}} | {{__('Refund')}} | {{__('Expenses')}} | {{__('Purchase payments')}} | {{__('Balance')}} |
| {{$user['name']}} | {{format_money($user['income'])}} | {{format_money($user['refund'])}} | {{format_money($user['expense'])}} | {{format_money($user['purchase_payment'])}} | {{format_money($user['balance'])}} |
| {{__('Summary')}} | {{format_money(round($data['users_statistics']->sum('income'),2))}} | {{format_money(round($data['users_statistics']->sum('refund'),2))}} | {{format_money(round($data['users_statistics']->sum('expense'),2))}} | {{format_money(round($data['users_statistics']->sum('purchase_payment'),2))}} | {{format_money(round($data['users_statistics']->sum('balance'),2))}} |
| {{__('Payment methods')}} | ||||||
|---|---|---|---|---|---|---|
| {{__('Payment method')}} | {{__('Income')}} | {{__('Refund')}} | {{__('Deposit')}} | {{__('Expenses')}} | {{__('Purchase payments')}} | {{__('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['purchase_payment'])}} | {{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('purchase_payment'))}} | {{format_money(collect($data['payment_methods'])->flatten()->sum('balance'))}} |
| {{__('Branches')}} | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{__('Branch')}} | {{__('Visits count')}} | {{__('Subtotal')}} | {{__('Discount')}} | {{__('Total')}} | {{__('Paid')}} | {{__('Due')}} | {{__('Income')}} | {{__('Refund')}} | {{__('Deposit')}} | {{__('Expenses')}} | {{__('Purchase payments')}} | {{__('Profit')}} |
| {{$branch['name']}} | {{format_money($branch['count'])}} | {{format_money($branch['subtotal'])}} | {{format_money($branch['discount'])}} | {{format_money($branch['total'])}} | {{format_money($branch['paid'])}} | {{format_money($branch['due'])}} | {{format_money($branch['income'])}} | {{format_money($branch['refund'])}} | {{format_money($branch['deposit'])}} | {{format_money($branch['expense'])}} | {{format_money($branch['purchase_payment'])}} | {{format_money($branch['profit'])}} |
| {{__('Summary')}} | {{format_money(collect($data['branches_statistics'])->flatten()->sum('count'))}} | {{format_money(collect($data['branches_statistics'])->flatten()->sum('subtotal'))}} | {{format_money(collect($data['branches_statistics'])->flatten()->sum('discount'))}} | {{format_money(collect($data['branches_statistics'])->flatten()->sum('total'))}} | {{format_money(collect($data['branches_statistics'])->flatten()->sum('paid'))}} | {{format_money(collect($data['branches_statistics'])->flatten()->sum('due'))}} | {{format_money(collect($data['branches_statistics'])->flatten()->sum('income'))}} | {{format_money(collect($data['branches_statistics'])->flatten()->sum('refund'))}} | {{format_money(collect($data['branches_statistics'])->flatten()->sum('deposit'))}} | {{format_money(collect($data['branches_statistics'])->flatten()->sum('expense'))}} | {{format_money(collect($data['branches_statistics'])->flatten()->sum('purchase_payment'))}} | {{format_money(collect($data['branches_statistics'])->flatten()->sum('profit'))}} |
| {{__('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'])}} |
| {{__('Patients count')}} | {{format_money($data['patients_count'])}} |
| {{__('Recurring patients count')}} | {{format_money($data['recurring_patients_count'])}} |
| {{__('Subtotal')}} | {{format_money($data['subtotal'])}} |
| {{__('Discount')}} | {{format_money($data['discount'])}} |
| {{__('Tax')}} | {{format_money($data['tax'])}} |
| {{__('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 on patient')}} | {{format_money($data['patient_due'])}} |
| {{__('Due on laboratory')}} | {{format_money($data['laboratory_due'])}} |
| {{__('Due on contract')}} | {{format_money($data['contract_due'])}} |
| {{__('Due')}} | {{format_money($data['due'])}} |
| {{__('Deposits')}} | {{format_money($data['deposit'])}} |
| {{__('Expenses')}} | {{format_money($data['total_expenses'])}} |
| {{__('Purchases')}} | {{format_money($data['total_purchases'])}} |
| {{__('Balance')}} | {{format_money($data['profit'])}} |