@extends('layouts.app') @section('title', 'Session #' . $posSession->id) @section('content')
Back to Sessions

Session #{{ $posSession->id }}

{{ $posSession->warehouse->name ?? 'Unknown Location' }}

@if($posSession->status === 'open') Open @else Closed @endif

Cashier

{{ $posSession->user->name ?? '-' }}

Opened At

{{ $posSession->opened_at ? $posSession->opened_at->format('d M Y, H:i') : $posSession->created_at->format('d M Y, H:i') }}

Closed At

{{ $posSession->closed_at ? $posSession->closed_at->format('d M Y, H:i') : '-' }}

Duration

@if($posSession->closed_at) {{ $posSession->opened_at ? $posSession->opened_at->diffForHumans($posSession->closed_at, true) : '-' }} @elseif($posSession->opened_at) {{ $posSession->opened_at->diffForHumans(null, true) }} (ongoing) @else - @endif

Total Sales

RM {{ number_format($stats['total_sales'], 2) }}

Transactions

{{ $stats['transaction_count'] }}

Cash Sales

RM {{ number_format($stats['cash_sales'], 2) }}

Card/E-Wallet

RM {{ number_format($stats['card_sales'] + $stats['ewallet_sales'] + $stats['transfer_sales'], 2) }}

Cash Summary

Opening Cash RM {{ number_format($posSession->opening_cash ?? 0, 2) }}
+ Cash Sales RM {{ number_format($stats['cash_sales'], 2) }}
Expected Cash RM {{ number_format(($posSession->opening_cash ?? 0) + $stats['cash_sales'], 2) }}
@if($posSession->closing_cash !== null)
Actual Closing RM {{ number_format($posSession->closing_cash, 2) }}
@php $expected = ($posSession->opening_cash ?? 0) + $stats['cash_sales']; $difference = $posSession->closing_cash - $expected; @endphp
Difference {{ $difference >= 0 ? '+' : '' }}RM {{ number_format($difference, 2) }}
@endif

Transactions ({{ $posSession->sales->count() }})

@if($posSession->sales->count() > 0) @foreach($posSession->sales as $sale) @endforeach
Receipt Time Customer Payment Total Actions
{{ $sale->receipt_number }} @if($sale->status === 'voided') Voided @endif {{ $sale->created_at->format('H:i:s') }} {{ $sale->customer_name ?? 'Walk-in' }} {{ ucfirst($sale->payment_method) }} RM {{ number_format($sale->total, 2) }} View
@else
No transactions in this session
@endif
@if($posSession->notes)

Closing Notes

{{ $posSession->notes }}

@endif
@endsection