{{-- ── Header ── --}}

{{ __('Profit & Loss Summary') }}

{{ __('Revenue vs Expenses breakdown') }}

{{-- Month/Year Filter --}}
{{-- ── KPI Cards ── --}}
{{-- Total Revenue --}}
{{ __('Total Revenue') }}

৳{{ number_format($totalRevenue, 2) }}

{{ __('ISP') }}: ৳{{ number_format($collectionRevenue, 2) }} · {{ __('Hotspot') }}: ৳{{ number_format($hotspotRevenue, 2) }}
{{-- Reseller Commission --}}
{{ __('Commissions') }}

৳{{ number_format($resellerCommissions, 2) }}

{{ __('Reseller Commissions') }}
{{-- Total Expenses --}}
{{ __('Expenses') }}

৳{{ number_format($totalExpenses, 2) }}

{{ trans_choice('{1} :count category|[2,*] :count categories', $expensesByCategory->count(), ['count' => $expensesByCategory->count()]) }}
{{-- Net Profit --}}
@php $isProfitable = $netProfit >= 0; @endphp
{{ __('Net :type', ['type' => $isProfitable ? __('Profit') : __('Loss')]) }}

{{ $isProfitable ? '' : '-' }}৳{{ number_format(abs($netProfit), 2) }}

{{ __('After all costs') }}
{{-- ── P&L Statement ── --}}
{{ __('P&L Statement') }}

{{ __($months[$month]) }} {{ $year }}

{{-- Revenue rows --}}
{{ __('ISP Collections') }} + ৳{{ number_format($collectionRevenue, 2) }}
{{ __('Hotspot Sales') }} + ৳{{ number_format($hotspotRevenue, 2) }}
Total Revenue ৳{{ number_format($totalRevenue, 2) }}
{{ __('COSTS & EXPENSES') }}
{{-- Commission row --}}
{{ __('Reseller Commissions') }} − ৳{{ number_format($resellerCommissions, 2) }}
{{-- Expense category rows --}} @php $catColors = ['item_purchase'=>'primary','raw_bill'=>'warning','employee_salary'=>'info','miscellaneous'=>'secondary']; $catIcons = ['item_purchase'=>'bag-fill','raw_bill'=>'lightning-charge-fill','employee_salary'=>'people-fill','miscellaneous'=>'three-dots']; @endphp @foreach($categories as $key => $label)
{{ __($label) }} − ৳{{ number_format($expensesByCategory[$key] ?? 0, 2) }}
@endforeach {{-- Total costs --}}
{{ __('Total Costs') }} ৳{{ number_format($resellerCommissions + $totalExpenses, 2) }}
{{-- Net profit --}}
{{ __('Net :type', ['type' => $isProfitable ? __('Profit') : __('Loss')]) }} {{ $isProfitable ? '' : '-' }}৳{{ number_format(abs($netProfit), 2) }}
{{-- ── Expense Breakdown Doughnut ── --}}
{{ __('Expense Breakdown') }}

{{ __('By category') }}

@foreach($categories as $key => $label) @php $amount = $expensesByCategory[$key] ?? 0; @endphp @if($amount > 0)
{{ __($label) }}
৳{{ number_format($amount, 2) }}
@endif @endforeach
{{-- ── 12-Month Trend Chart ── --}}
{{ __('12-Month Trend') }}

{{ __('Revenue vs Expenses') }}

{{-- ── Detailed Item & Employee Expenses ── --}}
{{-- Item Purchases --}}
{{ __('Item Purchases Breakdown') }}
{{ trans_choice('{1} :count item|[2,*] :count items', $itemPurchases->count(), ['count' => $itemPurchases->count()]) }}

{{ __('Detailed list of purchased items for this month') }}

@if($itemPurchases->isEmpty())
{{ __('No item purchases recorded this month') }}
@else
@foreach($itemPurchases as $item) @endforeach
{{ __('Date') }} {{ __('Item / Title') }} {{ __('Ref No.') }} {{ __('Amount') }}
{{ $item->expense_date->format('d M, Y') }}
{{ $item->title }}
@if($item->description)
{{ Str::limit($item->description, 50) }}
@endif
{{ $item->reference_no ?? '-' }} ৳{{ number_format($item->amount, 2) }}
@endif
{{-- Employee Salary / Bills --}}
{{ __('Employee Salary & Bills') }}
{{ trans_choice('{1} :count bill|[2,*] :count bills', $employeeSalaries->count(), ['count' => $employeeSalaries->count()]) }}

{{ __('Detailed list of employee payments & claims for this month') }}

@if($employeeSalaries->isEmpty())
{{ __('No employee salary or bills recorded this month') }}
@else
@foreach($employeeSalaries as $bill) @endforeach
{{ __('Date') }} {{ __('Employee / Purpose') }} {{ __('Ref No.') }} {{ __('Amount') }}
{{ $bill->expense_date->format('d M, Y') }}
{{ $bill->title }}
@if($bill->description)
{{ Str::limit($bill->description, 50) }}
@endif
{{ $bill->reference_no ?? '-' }} ৳{{ number_format($bill->amount, 2) }}
@endif
{{-- ── Quick link to expense manager ── --}}
@push('scripts') @endpush