@php function formatIndianCurrency($amount) { $amount = (float) $amount; $decimal = number_format($amount, 2, '.', ''); $exploded = explode('.', $decimal); $last3 = substr($exploded[0], -3); $restUnits = substr($exploded[0], 0, -3); if ($restUnits != '') { $restUnits = preg_replace("/\B(?=(\d{2})+(?!\d))/", ",", $restUnits); } return '₹' . $restUnits . $last3 . '.' . $exploded[1]; } @endphp @extends('layouts.admin') @section('title', 'Active Jobs') @section('pages', 'Active Jobs') @section('content')
All currently in-progress projects
| Quote No | Client | Factory Name | Factory Location | Quote Date | Status | Estimated Quote | Final Quote Value | |
|---|---|---|---|---|---|---|---|---|
| {{ strtoupper(substr($order->quotation->state_code ?? '', 0, 2)) }}-{{ \Carbon\Carbon::parse($order->quotation->created_at)->format('y') }}-{{ str_pad($order->quotation->id ?? 0, 3, '0', STR_PAD_LEFT) }} | {{-- Client with Avatar --}}
{{ $order->client_name }}
|
{{-- Project Name --}}
{{ $order->title ?? 'N/A' }}
|
{{-- Location --}}
{{ $order->location ?? 'N/A' }}
|
{{-- Date --}}
{{ \Carbon\Carbon::parse($order->created_at)->format('d M Y') }}
{{ \Carbon\Carbon::parse($order->created_at)->diffForHumans() }}
|
{{-- Status Badge --}}
@php $statusMap = [ 'in-progress' => ['bg' => '#e0f2fe', 'text' => '#0369a1', 'dot' => '#0ea5e9', 'label' => 'In Progress'], 'on-hold' => ['bg' => '#fef9c3', 'text' => '#854d0e', 'dot' => '#eab308', 'label' => 'On Hold'], 'review' => ['bg' => '#ede9fe', 'text' => '#6d28d9', 'dot' => '#8b5cf6', 'label' => 'Review'], 'completed' => ['bg' => '#dcfce7', 'text' => '#15803d', 'dot' => '#22c55e', 'label' => 'Completed'], ]; $s = $statusMap[strtolower($order->status)] ?? ['bg' => '#f3f4f6', 'text' => '#374151', 'dot' => '#9ca3af', 'label' => ucfirst($order->status)]; @endphp {{ $s['label'] }} | {{-- Estimated Cost --}}
@if(!empty($order->quotation->estimate_cost))
{{ formatIndianCurrency($order->quotation->estimate_cost) }}
@else
—
@endif
|
{{-- Final Quote --}}
@if(!empty($order->project_cost))
{{ formatIndianCurrency($order->project_cost) }}
{{-- Show variance if both values exist --}}
@if(!empty($order->quotation->estimate_cost))
@php
$diff = $order->project_cost - $order->quotation->estimate_cost;
$pct = $order->quotation->estimate_cost > 0
? round(($diff / $order->quotation->estimate_cost) * 100, 1)
: 0;
@endphp
{{ abs($pct) }}% vs estimate
@endif
@else
—
@endif
|
{{-- Action --}}
|
No active jobs foundNo projects are currently in progress. |
||||||||