@extends('layouts.adminlte') @section('title', 'DETAIL COST PROJECT') @section('page_title', 'DETAIL COST PROJECT') @push('styles') @endpush @section('content') @php $fmtRp = fn($n) => 'Rp ' . number_format((float) ($n ?? 0), 2, ',', '.'); $qTotal = (float) ($quotation?->grand_total ?? 0); $poBarangTotal = (float) $poBarang->sum('total_amount'); $poJasaTotal = (float) $poJasa->sum('total_amount'); $actualTotal = $poBarangTotal + $poJasaTotal; $variance = $qTotal - $actualTotal; @endphp
{{ $project->code }} - {{ $project->name }}
Client: {{ $project->customer?->name ?: '-' }}
No WO
{{ $project->no_wo ?: '-' }}
WO Amount
{{ $fmtRp($project->wo_amount ?: 0) }}
Quotation
{{ $quotation?->quotation_number ?: '-' }} ({{ $quotation?->status ?: '-' }})
Quotation Total
{{ $fmtRp($qTotal) }}
Actual PO Barang (Approved/Closed)
{{ $fmtRp($poBarangTotal) }}
Actual PO Jasa (Approved/Closed)
{{ $fmtRp($poJasaTotal) }}
Actual Total
{{ $fmtRp($actualTotal) }}
Variance (Quotation - Actual)
{{ $fmtRp($variance) }}

Quotation Items

@if(!$quotation)
Belum ada quotation untuk project ini.
@else
@foreach(($quotation->items ?? collect())->sortBy('sort_order') as $i => $it) @endforeach
# Description Qty Unit Unit Price Total
{{ $i+1 }} {{ $it->description }} {{ number_format((float)$it->qty, 3, ',', '.') }} {{ $it->unit ?: '-' }} {{ $fmtRp($it->unit_price) }} {{ $fmtRp($it->total_price) }}
Grand Total {{ $fmtRp($quotation->grand_total) }}
@endif

PO Barang (Approved/Closed)

@if($poBarang->isEmpty())
Tidak ada PO barang approved/closed.
@else @foreach($poBarang as $po)
{{ $po->po_number }} {{ $po->status }}
Vendor: {{ $po->vendor?->name ?: '-' }} | Tanggal: {{ $po->po_date ?: '-' }}
Payment
{{ $po->payment_status ?: 'unpaid' }} | {{ $fmtRp($po->paid_amount ?: 0) }}
@foreach($po->items as $it) @endforeach
Item Qty Unit Price Total
{{ $it->rabItem?->item_code ?: '-' }} - {{ $it->rabItem?->item_name ?: '-' }} {{ number_format((float)$it->qty, 3, ',', '.') }} {{ $fmtRp($it->unit_price) }} {{ $fmtRp($it->total_price) }}
PO Total {{ $fmtRp($po->total_amount) }}
@endforeach @endif

PO Jasa (Approved/Closed)

@if($poJasa->isEmpty())
Tidak ada PO jasa approved/closed.
@else @foreach($poJasa as $po)
{{ $po->po_number }} {{ $po->status }}
Vendor: {{ $po->vendor?->name ?: '-' }} | Tanggal: {{ $po->po_date ?: '-' }}
Payment
{{ $po->payment_status ?: 'unpaid' }} | {{ $fmtRp($po->paid_amount ?: 0) }}
@foreach($po->serviceItems as $it) @endforeach
Description Qty Unit Unit Price Total
{{ $it->description }} {{ number_format((float)$it->qty, 3, ',', '.') }} {{ $it->unit ?: '-' }} {{ $fmtRp($it->unit_price) }} {{ $fmtRp($it->total_price) }}
PO Total {{ $fmtRp($po->total_amount) }}
@endforeach @endif
@endsection