@extends('layouts.user') @section('title', __('profit_loss.title')) @section('page_title', __('profit_loss.page_title')) @section('breadcrumb', __('profit_loss.breadcrumb')) @section('content') @php $fmt = fn ($v) => number_format((float) $v, 2); $isProfit = (float) $netProfitLoss >= 0; $periodLabel = $from->format('M Y') . ' - ' . $to->format('M Y'); $pdfUrl = url('/user/reports/profit-loss/pdf') . (request()->query() ? ('?' . http_build_query(request()->query())) : ''); $resetUrl = url('/user/reports/profit-loss'); $chartLabelsJson = json_encode($chartLabels ?? []); $chartIncomeJson = json_encode($chartIncome ?? []); $chartExpenseJson = json_encode($chartExpense ?? []); $chartNetJson = json_encode($chartNet ?? []); @endphp
{{-- Header + Filter --}}

{{ __('profit_loss.financial_report') }}

{{ __('profit_loss.statement_title') }}

{{ $periodLabel }} {{ $from->format('d M Y') }} - {{ $to->format('d M Y') }}
{{ __('profit_loss.reset') }}
{{-- Main Summary --}}

{{ __('profit_loss.total_income') }}

{{ $fmt($totalIncome) }}

{{ __('profit_loss.total_income_hint') }}

{{ __('profit_loss.total_expense') }}

{{ $fmt($totalExpense) }}

{{ __('profit_loss.total_expense_hint') }}

{{ $isProfit ? __('profit_loss.net_profit') : __('profit_loss.net_loss') }}

{{ $fmt(abs($netProfitLoss)) }}

{{ $isProfit ? __('profit_loss.profit_hint') : __('profit_loss.loss_hint') }}

{{ __('profit_loss.selected_period') }}

{{ $periodLabel }}

{{ $from->format('d M Y') }} - {{ $to->format('d M Y') }}

{{-- Mini Summary --}}

{{ __('profit_loss.customer_bill_income') }}

{{ $fmt($customerBillIncome) }}

{{ __('profit_loss.daily_expense') }}

{{ $fmt($dailyExpenseTotal) }}

{{ __('profit_loss.supplier_expense') }}

{{ $fmt($supplierExpenseTotal) }}

{{ __('profit_loss.salary_expense') }}

{{ $fmt($salaryExpenseTotal) }}

{{ __('profit_loss.bonus_bank_charge') }}

{{ $fmt((float) $paidBonusExpenseTotal + (float) $bankChargeExpenseTotal) }}

{{ __('profit_loss.loan_finance_cost') }}

{{ $fmt($loanFinanceCostTotal ?? 0) }}
{{-- Chart --}}

{{ __('profit_loss.chart_title') }}

{{ ($chartMode ?? 'monthly') === 'yearly' ? __('profit_loss.chart_yearly') : __('profit_loss.chart_monthly') }}

{{-- Breakdown Tables --}}

{{ __('profit_loss.income_breakdown') }}

{{ __('profit_loss.income_sources') }}

@forelse($statementIncomeRows as $row) @empty @endforelse
{{ __('profit_loss.particulars') }} {{ __('profit_loss.amount') }}
{{ $row['label'] }} {{ $fmt($row['amount']) }}
{{ __('profit_loss.no_income_data') }}
{{ __('profit_loss.total_income') }} {{ $fmt($totalIncome) }}

{{ __('profit_loss.expense_breakdown') }}

{{ __('profit_loss.expense_details') }}

@forelse($statementExpenseRows as $row) @php $isLoanRow = str_contains(strtolower($row['label']), 'loan finance cost'); @endphp @empty @endforelse @if(($loanFinanceCostTotal ?? 0) > 0 && collect($statementExpenseRows)->where('label', 'Loan Finance Cost')->count() === 0) @endif
{{ __('profit_loss.particulars') }} {{ __('profit_loss.amount') }}
{{ $row['label'] }} {{ $fmt($row['amount']) }}
{{ __('profit_loss.no_expense_data') }}
{{ __('profit_loss.loan_finance_cost') }} {{ $fmt($loanFinanceCostTotal) }}
{{ __('profit_loss.total_expense') }} {{ $fmt($totalExpense) }}
{{-- Final Summary --}}

{{ __('profit_loss.final_summary') }}

{{ __('profit_loss.total_income') }}

{{ $fmt($totalIncome) }}

{{ __('profit_loss.total_expense') }}

{{ $fmt($totalExpense) }}

{{ $isProfit ? __('profit_loss.net_profit') : __('profit_loss.net_loss') }}

{{ $fmt(abs($netProfitLoss)) }}
@endsection @push('scripts') @endpush