@extends('layouts.finance') @section('title', 'Monthly Closing') @section('subtitle', 'Close each month to lock its Sale, Profit, Expense and Net Worth') @section('content') @php $preview = $preview ?? ['currency' => 'PKR', 'total_sale' => 0, 'profit' => 0, 'expense' => 0, 'net_profit' => 0, 'net_worth' => 0]; $closings = $closings ?? collect(); $cur = $preview['currency'] ?? 'PKR'; $closureStatus = $closureStatus ?? ['rows' => collect(), 'closed_count' => 0, 'required_count' => 0, 'remaining_count' => 0, 'can_close' => false, 'can_manage' => false]; @endphp @if(session('success'))
| Account | Type | Period | Status | Action |
|---|---|---|---|---|
|
{{ $row['name'] }}
{{ $row['subtitle'] }}
|
{{ $row['kind'] === 'bank' ? 'Bank / Wallet' : 'Credit Card' }} | {{ $row['period_start']->format('d M Y') }} to {{ $row['period_end']->format('d M Y') }} | @if($row['is_closed']) Closed {{ $row['closing']?->closed_at?->format('d M Y, H:i') }} @else Open @endif | @if($row['is_closed']) Done @elseif($closureStatus['can_manage']) @else Unavailable @endif |
| No active banks, wallets, or credit cards found. | ||||
| Month | Total Sale | Profit | Expense | Profit / Loss (after expense) | Company Net Worth | Status | |
|---|---|---|---|---|---|---|---|
| {{ $row->month->format('F Y') }} | {{ $metrics->money($row->total_sale, $row->currency) }} | {{ $metrics->money($row->profit, $row->currency) }} | {{ $metrics->money($row->expense, $row->currency) }} | {{ $row->isProfit() ? '' : '-' }}{{ $metrics->money(abs((float) $row->net_profit), $row->currency) }} | {{ $metrics->money($row->net_worth, $row->currency) }} | {{ $row->accounts_closed_count }}/{{ $row->accounts_required_count }} closed | |
| No months closed yet. Pick a month above and press Close. | |||||||