@extends('layouts.app') @section('title', 'Profit & Loss') @section('body-class', 'page-profit-loss') @section('breadcrumb') @endsection @section('content') @php $companyId = auth()->user()->company_id; $money = function ($amount) use ($companyId) { $amount = (float) $amount; if (abs($amount) < 0.005) return '—'; $formatted = \App\Helpers\NumberHelper::formatAmount(abs($amount), $companyId); return $amount < 0 ? '(' . $formatted . ')' : $formatted; }; $dateQuery = ['date_from' => $dateFrom, 'date_to' => $dateTo]; $companyName = auth()->user()->company?->name ?? config('app.name'); $periodLabel = \Carbon\Carbon::parse($dateFrom)->format('d M Y') . ' to ' . \Carbon\Carbon::parse($dateTo)->format('d M Y'); @endphp
Export
{{ $companyName }}

Profit & Loss

{{ $periodLabel }}
@include('reports.profit-loss._dimension-picker', [ 'dimensionTree' => $filterOptions['dimensionTree'] ?? [], 'selectedIds' => $filters['dimension_value_ids'] ?? [], ])
@include('reports.profit-loss._multi-filter-picker', [ 'pickerId' => 'plAccountSectionPicker', 'emptyLabel' => 'All account types', 'searchPlaceholder' => 'Search account types...', 'inputName' => 'account_sections[]', 'selectedValues' => $filters['account_sections'] ?? [], 'options' => $filterOptions['accountTypes'], 'toggleLabel' => $selectedAccountSectionsLabel ?? 'All account types', ])
@include('reports.profit-loss._multi-filter-picker', [ 'pickerId' => 'plVoucherTypePicker', 'emptyLabel' => 'All voucher types', 'searchPlaceholder' => 'Search voucher types...', 'inputName' => 'voucher_types[]', 'selectedValues' => $filters['voucher_types'] ?? [], 'options' => $filterOptions['voucherTypes'], 'toggleLabel' => $selectedVoucherTypesLabel ?? 'All voucher types', ])
@include('reports.profit-loss._party-picker', [ 'filterOptions' => $filterOptions, 'filters' => $filters, 'selectedPartyLabel' => $selectedPartyLabel ?? 'All names', ])
Clear
@if(!empty($columnPeriods)) @foreach($columnPeriods as $period) @endforeach @endif @foreach(['income', 'cost_of_goods_sold'] as $section) @include('reports.profit-loss._section', ['group' => $groups[$section]]) @endforeach @include('reports.profit-loss._period-amount-cells', [ 'amounts' => $totals['periods']['gross_profit'] ?? $totals['gross_profit'], 'total' => $totals['gross_profit'], 'cellClass' => 'fw-bold', ]) @include('reports.profit-loss._section', ['group' => $groups['expenses']]) @include('reports.profit-loss._period-amount-cells', [ 'amounts' => $totals['periods']['operating_income'] ?? $totals['operating_income'], 'total' => $totals['operating_income'], 'cellClass' => 'fw-bold', ]) @foreach(['other_income', 'other_expense'] as $section) @include('reports.profit-loss._section', ['group' => $groups[$section]]) @endforeach @include('reports.profit-loss._period-amount-cells', [ 'amounts' => $totals['periods']['net_income'] ?? $totals['net_income'], 'total' => $totals['net_income'], 'cellClass' => 'fw-bold', ])
{{ $period['label'] }}Total
Gross Profit
Net Operating Income
Net Income
@endsection @push('modals') @php $emailFormat = old('format', 'pdf'); $defaultPaperSize = old('paper_size', 'a4'); $defaultLayout = old('layout', 'portrait'); $paperSizeOptions = ['a4' => 'A4', 'letter' => 'Letter', 'legal' => 'Legal']; $layoutOptions = ['portrait' => 'Portrait', 'landscape' => 'Landscape']; @endphp @endpush @push('scripts') @endpush