@extends('layouts.finance.finance') @section('content')
{{-- Header Section --}}
Back to Jobs

{{ $project->title }}

{{-- Dynamic Status Badge --}} @php $statusClass = 'bg-gray-100 text-gray-800'; $dotClass = 'bg-gray-600'; if (in_array(strtolower($project->status), ['active', 'omd-active', 'in-progress'])) { $statusClass = 'bg-green-50 text-green-700 border border-green-200'; $dotClass = 'bg-green-500'; } elseif (strtolower($project->status) == 'pending') { $statusClass = 'bg-amber-50 text-amber-700 border border-amber-200'; $dotClass = 'bg-amber-500'; } elseif (strtolower($project->status) == 'completed') { $statusClass = 'bg-blue-50 text-blue-700 border border-blue-200'; $dotClass = 'bg-blue-500'; } @endphp {{ ucfirst(str_replace('-', ' ', $project->status)) }}

JOB ID: {{ $project->project_code ?? 'JB-' . $project->id }}

{{-- Main Content Column --}}
{{-- Dynamic Financial Calculations --}} @php $formatCurrency = function ($amount) { $amount = (float) $amount; $abs = abs($amount); if ($abs >= 10000000) { return '₹' . number_format($amount / 10000000, 2) . ' Cr'; } if ($abs >= 100000) { return '₹' . number_format($amount / 100000, 2) . ' L'; } return '₹' . number_format($amount, 2); }; $totalValue = (float) $project->project_cost; $amountInvoiced = $project->receivableSchedules->sum('received_amount') ?? 0; $totalSpent = $project->orders->sum('total_amount') ?? 0; $pendingBalance = $totalValue - $amountInvoiced; $progressPct = $totalValue > 0 ? round(($amountInvoiced / $totalValue) * 100) : 0; @endphp

Financial Overview

Total Project Value

{{ $formatCurrency($totalValue) }}

Amount Collected

{{ $formatCurrency($amountInvoiced) }}

Pending Balance

{{ $formatCurrency($pendingBalance) }}

Payment Collection Progress {{ $progressPct }}%
{{-- Functional Job Navigation Tabs with slim-scroll --}} {{-- Tab Content Containers --}}
{{-- 1. Invoices Tab (Active by default) --}}

Client Invoices / Receivables

@forelse($project->invoices as $invoice) @empty @endforelse
Reference Due Date Amount Status Action
{{ $invoice->invoice_number }} {{ \Carbon\Carbon::parse($invoice->created_at)->format('d M Y') }} ₹{{ number_format($invoice->grand_total, 2) }} {{ str_replace('_', ' ', $invoice->invoice_type) }} View
No generated invoices found.
{{-- 3. Vendor PO Tab (Approved/Active Orders) --}} {{-- 4. Ledger Statements Tab --}} {{-- 5. Purchase Requests (Pending Orders) --}} {{-- 6. Petty Cash --}} {{-- 7. Shipping List --}}
{{-- Tab Switching Script --}}
{{-- Sidebar Column --}}
{{-- Client Info --}}

Client & Project Information

Client Name

{{ $project->client_name ?? 'N/A' }}

CIF No.

{{ $project->client->cif ?? 'Pending' }}

Year of Execution

{{ $project->start_date ? \Carbon\Carbon::parse($project->start_date)->format('Y') : 'N/A' }}

Contact Details

{{ $project->quotation->email ?? 'Email Not provided' }}

{{ $project->quotation->phone ?? 'Phone Not provided' }}

Site Address

{{ $project->location ?? 'Not Provided' }}

{{-- Project Dates --}}

Project Timeline

Start Date

{{ $project->start_date ? \Carbon\Carbon::parse($project->start_date)->format('d-m-Y') : 'N/A' }}

Expected Handover

{{ $project->handover_date ? \Carbon\Carbon::parse($project->handover_date)->format('d-m-Y') : 'Not Set' }}

@endsection