@extends('layouts.finance.finance') @section('title', 'Finance Dashboard') @section('content') {{-- Header & Actions --}}

Finance Dashboard

{{-- Generate PDF Button --}}
@php $renderTrend = function ($trend) { $color = $trend['color'] ?? ($trend['direction'] === 'up' ? 'emerald' : 'red'); $icon = $trend['direction'] === 'up' ? 'arrow-up' : 'arrow-down'; return "

" . " {$trend['value']} vs last month

"; }; @endphp {{-- DASHBOARD UI (Visible on screen) --}}
{{-- KPI Cards --}}

Total Project Value

{{ $kpis['project_value']['formatted'] }}

{{ $kpis['project_value']['active_count'] }} Active Projects

Amount Received

{{ $kpis['received']['formatted'] }}

{!! $renderTrend($kpis['received']['trend']) !!}

Outstanding Receivables

{{ $kpis['outstanding']['formatted'] }}

{!! $renderTrend($kpis['outstanding']['trend']) !!}

Total Expenses

{{ $kpis['expenses']['formatted'] }}

{!! $renderTrend($kpis['expenses']['trend']) !!}

Net Profit

{{ $kpis['net_profit']['formatted'] }}

{!! $renderTrend($kpis['net_profit']['trend']) !!}

Profit Margin

{{ $kpis['margin']['formatted'] }}

{!! $renderTrend($kpis['margin']['trend']) !!}
{{-- Quick stat strip --}}

Active Projects

{{ $quickStats['active_projects'] }}

View all projects

Pending PO Approval

{{ $quickStats['pending_po'] }}

View approvals

Vendor Outstanding

{{ $quickStats['vendor_outstanding'] }}

View payables

Client Overdue

{{ $quickStats['client_overdue'] }}

View receivables

Today's Payments

{{ $quickStats['todays_payments'] }}

View all payments
{{-- HIDDEN REPORT TEMPLATE (Only used for PDF generation) --}}
{{-- Report Header --}}

Finance Status Report

Organization: Meking Buildtec

Generated Date: {{ now()->format('d M Y, h:i A') }}

{{-- Financial Overview Table --}}

1. Financial Overview

Metric Current Value
Total Project Value {{ $kpis['project_value']['formatted'] }}
Amount Received {{ $kpis['received']['formatted'] }}
Outstanding Receivables {{ $kpis['outstanding']['formatted'] }}
Total Expenses {{ $kpis['expenses']['formatted'] }}
Net Profit {{ $kpis['net_profit']['formatted'] }}
Profit Margin {{ $kpis['margin']['formatted'] }}
{{-- Operational Statistics Table --}}

2. Operational Tracking

Tracking Metric Status / Amount
Active Projects {{ $quickStats['active_projects'] }}
Pending PO Approvals {{ $quickStats['pending_po'] }}
Vendor Outstanding {{ $quickStats['vendor_outstanding'] }}
Client Overdue {{ $quickStats['client_overdue'] }}
Today's Payments Processed {{ $quickStats['todays_payments'] }}
{{-- END HIDDEN REPORT --}} @endsection @push('scripts') {{-- html2pdf CDN --}} @endpush