@extends('layouts.app', ['page' => 'Income Statement Comparison', 'pageSlug' => 'reports-income-statement-comparison', 'section' => 'reports']) @section('content')

Income Statement Comparison

Standard View

{{ config('app.name') }}

Comparative Income Statement

Current Period: {{ $currentStartDate->format('M d, Y') }} to {{ $currentEndDate->format('M d, Y') }}
Previous Period: {{ $previousStartDate->format('M d, Y') }} to {{ $previousEndDate->format('M d, Y') }}
@php $totalRevenue = ['current' => 0, 'previous' => 0]; @endphp @foreach($revenues as $account) @php $currentBalance = $currentBalances[$account->id] ?? 0; $previousBalance = $previousBalances[$account->id] ?? 0; $change = $currentBalance - $previousBalance; $percentChange = $previousBalance != 0 ? ($change / abs($previousBalance)) * 100 : 0; $totalRevenue['current'] += $currentBalance; $totalRevenue['previous'] += $previousBalance; @endphp @endforeach @php $revenueChange = $totalRevenue['current'] - $totalRevenue['previous']; $revenuePercentChange = $totalRevenue['previous'] != 0 ? ($revenueChange / abs($totalRevenue['previous'])) * 100 : 0; @endphp @php $totalExpenses = ['current' => 0, 'previous' => 0]; @endphp @foreach($expenses as $account) @php $currentBalance = $currentBalances[$account->id] ?? 0; $previousBalance = $previousBalances[$account->id] ?? 0; $change = $currentBalance - $previousBalance; $percentChange = $previousBalance != 0 ? ($change / abs($previousBalance)) * 100 : 0; $totalExpenses['current'] += $currentBalance; $totalExpenses['previous'] += $previousBalance; @endphp @endforeach @php $expensesChange = $totalExpenses['current'] - $totalExpenses['previous']; $expensesPercentChange = $totalExpenses['previous'] != 0 ? ($expensesChange / abs($totalExpenses['previous'])) * 100 : 0; @endphp @php $currentNetIncome = $totalRevenue['current'] - $totalExpenses['current']; $previousNetIncome = $totalRevenue['previous'] - $totalExpenses['previous']; $netIncomeChange = $currentNetIncome - $previousNetIncome; $netIncomePercentChange = $previousNetIncome != 0 ? ($netIncomeChange / abs($previousNetIncome)) * 100 : 0; @endphp
Account Previous Period Current Period Change ($) Change (%)
REVENUE
{{ $account->name }} {{ formatMoney($previousBalance) }} {{ formatMoney($currentBalance) }} {{ formatMoney(abs($change)) }} {{ number_format(abs($percentChange), 2) }}%
TOTAL REVENUE {{ formatMoney($totalRevenue['previous']) }} {{ formatMoney($totalRevenue['current']) }} {{ formatMoney(abs($revenueChange)) }} {{ number_format(abs($revenuePercentChange), 2) }}%
EXPENSES
{{ $account->name }} {{ formatMoney($previousBalance) }} {{ formatMoney($currentBalance) }} {{ formatMoney(abs($change)) }} {{ number_format(abs($percentChange), 2) }}%
TOTAL EXPENSES {{ formatMoney($totalExpenses['previous']) }} {{ formatMoney($totalExpenses['current']) }} {{ formatMoney(abs($expensesChange)) }} {{ number_format(abs($expensesPercentChange), 2) }}%
NET INCOME {{ formatMoney($previousNetIncome) }} {{ formatMoney($currentNetIncome) }} {{ formatMoney(abs($netIncomeChange)) }} {{ number_format(abs($netIncomePercentChange), 2) }}%
@endsection @push('css') @endpush