Branch Statement Summary

Branch: {{ $isBranchAdmin ? (auth()->user()->branch->name ?? 'Your Branch') : (request('branch_id') ? ($branches->firstWhere('id', request('branch_id'))?->name ?? 'Specific Branch') : 'All Branches') }}

Date Range: {{ $dateFrom->format('Y-m-d') }} to {{ $dateTo->format('Y-m-d') }}

@if(request('service_id'))

Service: {{ $services->firstWhere('id', request('service_id'))?->name }}

@endif @if(request('agent_id'))

Agent: {{ $agents->firstWhere('id', request('agent_id'))?->name }}

@endif

Generated: {{ now()->format('Y-m-d H:i:s') }}

@if($records->isNotEmpty() || $totalSales > 0 || $todaySales > 0)
PERIOD TOTALS
@if(!$isBranchAdmin) @endif
Total Sales {{ number_format($totalSales, 2) }}
Total Cash (SR) {{ number_format($totalCash, 2) }}
Total Bank (SR) {{ number_format($totalBank, 2) }}
Total Due {{ number_format($totalDue, 2) }}
Total Due Collection {{ number_format($totalDueCollection, 2) }}
Total Refund {{ number_format($totalRefund, 2) }}
Total Service Charge Deduction {{ number_format($totalServiceChargeDeduction, 2) }}
Total Agent Commission (Payable) {{ number_format($totalAgentCommissionPayable, 2) }}
Total Agent Commission (Paid) {{ number_format($totalAgentCommissionPaid, 2) }}
Total Profit {{ number_format($totalProfit, 2) }}
TODAY'S TOTALS
@if(!$isBranchAdmin) @endif
Today Sales {{ number_format($todaySales, 2) }}
Today Cash (SR) {{ number_format($todayCash, 2) }}
Today Bank (SR) {{ number_format($todayBank, 2) }}
Today Due {{ number_format($todayDue, 2) }}
Today Due Collection {{ number_format($todayDueCollection, 2) }}
Today Refund {{ number_format($todayRefund, 2) }}
Today Service Charge Deduction {{ number_format($todayServiceChargeDeduction, 2) }}
Today Agent Commission (Paid) {{ number_format($todayAgentCommissionPaid, 2) }}
Today Profit {{ number_format($todayProfit, 2) }}
@else

No data found.

@endif