@lang('app.to')
@foreach($branches as $branch) @endforeach {{-- @foreach($registers as $register) @endforeach --}} @if(user_can('View Cash Register Reports')) @foreach($cashiers as $cashier) @endforeach @endif
@if($sessions->count() > 0)

@lang('cashregister::app.cashLedgerByRegister')

@lang('cashregister::app.exportCsv')

@lang('cashregister::app.totalSessions'): {{ $summary['total_sessions'] }}

@lang('cashregister::app.totalCashSales'): {{ currency_format($summary['total_cash_sales'], restaurant()->currency_id) }}

@lang('cashregister::app.totalPaymentsLabel'): {{ currency_format($summary['total_payments'], restaurant()->currency_id) }}

@lang('cashregister::app.totalOpeningFloat')

{{ currency_format($summary['total_opening_float'], restaurant()->currency_id) }}

@lang('cashregister::app.totalCashSales')

{{ currency_format($summary['total_cash_sales'], restaurant()->currency_id) }}

@if(!empty($summary['payment_method_totals'])) @foreach($summary['payment_method_totals'] as $method => $amount) @continue($method === 'cash')

{{ __('modules.order.' . $method) !== 'modules.order.' . $method ? __('modules.order.' . $method) : \Illuminate\Support\Str::title(str_replace('_', ' ', (string) $method)) }} @lang('cashregister::app.sales')

{{ currency_format((float) $amount, restaurant()->currency_id) }}

@endforeach @endif

@lang('cashregister::app.totalPaymentsLabel')

{{ currency_format($summary['total_payments'], restaurant()->currency_id) }}

@lang('cashregister::app.totalCashIn')

{{ currency_format($summary['total_cash_in'], restaurant()->currency_id) }}

@lang('cashregister::app.totalCashOut')

{{ currency_format($summary['total_cash_out'], restaurant()->currency_id) }}

@foreach($sessions as $session) @php $transactions = \Modules\CashRegister\Entities\CashRegisterTransaction::where('cash_register_session_id', $session->id)->get(); $cashSales = $transactions->where('type', 'cash_sale')->sum('amount'); $paymentMethodTotals = $transactions->whereIn('type', ['cash_sale', 'order_payment']) ->groupBy(function ($transaction) { return $transaction->payment_method ?: 'cash'; }) ->map(function ($items) { return (float) $items->sum('amount'); }) ->sortKeys() ->toArray(); $totalPayments = array_sum($paymentMethodTotals); $cashIn = $transactions->where('type', 'cash_in')->sum('amount'); $cashOut = $transactions->where('type', 'cash_out')->sum('amount'); $safeDrops = $transactions->where('type', 'safe_drop')->sum('amount'); $changeGiven = $transactions->where('type', 'change_given')->sum('amount'); $refunds = $transactions->where('type', 'refund')->sum('amount'); $expectedCash = (float) $session->opening_float + $totalPayments + $cashIn - $changeGiven - $cashOut - $safeDrops - $refunds; $countedCash = (float) ($session->counted_cash ?? 0); $diff = $countedCash - $expectedCash; @endphp @endforeach
@lang('cashregister::app.date') @lang('cashregister::app.cashier') @lang('cashregister::app.openingFloat') @lang('cashregister::app.cashSales') @lang('cashregister::app.paymentMethods') @lang('cashregister::app.cashIn') @lang('cashregister::app.cashOut') @lang('cashregister::app.safeDrops') @lang('cashregister::app.expectedCash') @lang('cashregister::app.countedCash') @lang('cashregister::app.discrepancy') @lang('cashregister::app.status')
{{ $session->opened_at->timezone(timezone())->format('d M Y') }} {{ $session->cashier->name ?? __('cashregister::app.unknown') }} {{ currency_format($session->opening_float, restaurant()->currency_id) }} {{ currency_format($cashSales, restaurant()->currency_id) }}
@foreach($paymentMethodTotals as $method => $amount) {{ __('modules.order.' . $method) !== 'modules.order.' . $method ? __('modules.order.' . $method) : \Illuminate\Support\Str::title(str_replace('_', ' ', (string) $method)) }}: {{ currency_format((float) $amount, restaurant()->currency_id) }} @endforeach
{{ currency_format($cashIn, restaurant()->currency_id) }} {{ currency_format($cashOut, restaurant()->currency_id) }} {{ currency_format($safeDrops, restaurant()->currency_id) }} {{ currency_format($expectedCash, restaurant()->currency_id) }} {{ currency_format($countedCash, restaurant()->currency_id) }} {{ $diff >= 0 ? '+' : '' }}{{ currency_format($diff, restaurant()->currency_id) }} @lang('app.' . $session->status)

@lang('cashregister::app.totalSessions')

{{ $summary['total_sessions'] }}

@lang('cashregister::app.totalExpected')

{{ currency_format($summary['total_expected_cash'], restaurant()->currency_id) }}

@lang('cashregister::app.totalCounted')

{{ currency_format($summary['total_counted_cash'], restaurant()->currency_id) }}

@lang('cashregister::app.totalDiscrepancy')

{{ $summary['total_discrepancy'] >= 0 ? '+' : '' }}{{ currency_format($summary['total_discrepancy'], restaurant()->currency_id) }}

@else

@lang('cashregister::app.noDataAvailable')

@lang('cashregister::app.noCashRegisterSessionsFoundForSelectedCriteria')

@endif
@script @endscript