<<<<<<< HEAD {{-- resources/views/accounting/reports/profit_loss_grouped.blade.php --}} ======= {{-- resources/views/accounting/reports/profit_loss.blade.php --}} >>>>>>> origin/main @extends('admin.admin_dashboard') @section('admin') <<<<<<< HEAD @php $totalSales = collect($incomes)->sum('balance'); $totalCOGS = collect($cogs ?? [])->sum('balance'); $grossProfit = $totalSales - $totalCOGS; $totalIndirectIncome = collect($indirectIncomes ?? [])->sum('balance'); $totalIndirectExpense = collect($expenses ?? [])->sum('balance'); $net = $grossProfit + $totalIndirectIncome - $totalIndirectExpense; @endphp
{{-- Header --}}
Profit & Loss Account

Period: {{ $from ?? 'Start' }} → {{ $to ?? 'End' }}

{{-- Date Filter Form --}}
Reset
{{-- ================= TRADING ACCOUNT ================= --}} {{-- Sales Accounts --}} @foreach($incomes as $row) @endforeach {{-- Cost of Sales --}} {{-- Gross Profit --}} {{-- ================= INCOME STATEMENT ================= --}} {{-- Indirect Incomes --}} @if(!empty($indirectIncomes)) @foreach($indirectIncomes as $row) @endforeach @endif {{-- Indirect Expenses --}} @if(!empty($expenses)) @foreach($expenses as $row) @endforeach @endif {{-- Net Profit / Loss --}}
Particulars Amount %
Trading Account
Sales Accounts
{{ $row['account'] }} {{ number_format($row['balance'], 2) }} {{ $totalSales ? number_format(($row['balance'] / $totalSales) * 100, 2) : 0 }} %
Total Sales {{ number_format($totalSales, 2) }} 100 %
Cost of Sales
Opening Stock {{ number_format($openingStock ?? 0, 2) }}
Add: Purchase Accounts {{ number_format($purchaseAccounts ?? 0, 2) }}
Less: Closing Stock {{ number_format($closingStock ?? 0, 2) }}
Total Cost of Sales {{ number_format($totalCOGS, 2) }} {{ $totalSales ? number_format(($totalCOGS / $totalSales) * 100, 2) : 0 }} %
Gross Profit {{ number_format($grossProfit, 2) }} {{ $totalSales ? number_format(($grossProfit / $totalSales) * 100, 2) : 0 }} %
Income Statement
Indirect Incomes
{{ $row['account'] }} {{ number_format($row['balance'], 2) }} {{ $totalSales ? number_format(($row['balance'] / $totalSales) * 100, 2) : 0 }} %
Total Indirect Incomes {{ number_format($totalIndirectIncome, 2) }} {{ $totalSales ? number_format(($totalIndirectIncome / $totalSales) * 100, 2) : 0 }} %
Indirect Expenses
{{ $row['account'] }} {{ number_format($row['balance'], 2) }} {{ $totalSales ? number_format(($row['balance'] / $totalSales) * 100, 2) : 0 }} %
Total Indirect Expenses {{ number_format($totalIndirectExpense, 2) }} {{ $totalSales ? number_format(($totalIndirectExpense / $totalSales) * 100, 2) : 0 }} %
Excess of Income over Expenditure {{ number_format($net, 2) }} {{ $totalSales ? number_format(($net / $totalSales) * 100, 2) : 0 }} %
=======
@include('partials.accounting.period-banner')

Parent accounts show rolled-up balances. Click to expand child accounts.

Income
@if(!empty($incomeRows)) @include('accounting.reports.partials.balance-sheet-rows', ['rows' => $incomeRows]) @else @endif
Account Amount
No income in this period
Total Income {{ number_format($totalIncome, 2) }}
Expenses
@if(!empty($expenseRows)) @include('accounting.reports.partials.balance-sheet-rows', ['rows' => $expenseRows]) @else @endif
Account Amount
No expenses in this period
Total Expenses {{ number_format($totalExpenses, 2) }}
Net {{ ($netProfit ?? 0) >= 0 ? 'Profit' : 'Loss' }}: {{ number_format(abs($netProfit ?? 0), 2) }}
>>>>>>> origin/main @endsection