@extends('layouts.app') @section('title', 'Contractor: ' . $contractor->name) @section('content')

{{ $contractor->name }}

Ledger Edit Back
Contact Information
Mobile {{ $contractor->mobile }}
Email {{ $contractor->email ?? '—' }}
Address {{ $contractor->address ?? '—' }}
Specialization {{ $contractor->specialization ?? '—' }}
NID {{ $contractor->nid ?? '—' }}
Status @if($contractor->is_active) Active @else Inactive @endif
Financial Summary
Total Agreed
৳{{ number_format((float) $contractor->total_agreed, 2) }}
Total Paid
৳{{ number_format((float) $contractor->total_paid, 2) }}
Total Due
৳{{ number_format((float) $contractor->total_due, 2) }}
Active Work Orders
{{ $contractor->workOrders->where('status', 'active')->count() }}

Payment Breakdown
Advance: ৳{{ number_format($summary['advance'], 2) }}
Milestone: ৳{{ number_format($summary['milestone'], 2) }}
Bill: ৳{{ number_format($summary['bill'], 2) }}
Final: ৳{{ number_format($summary['final'], 2) }}
Work Orders
New Work Order
@forelse($contractor->workOrders as $wo) @empty @endforelse
WO # Title Project Agreed Paid Status Actions
{{ $wo->work_order_number }} {{ $wo->title }} {{ $wo->project->project_name ?? '—' }} ৳{{ number_format((float) $wo->agreed_amount, 2) }} ৳{{ number_format((float) $wo->paid_amount, 2) }} @php $statusColors = ['draft' => 'secondary', 'active' => 'primary', 'completed' => 'success', 'cancelled' => 'danger']; @endphp {{ ucfirst($wo->status) }}
No work orders yet.
Recent Payments
@forelse($contractor->contractorPayments->take(10) as $p) @empty @endforelse
Date Type Work Order Narration Amount
{{ $p->payment_date->format('d M Y') }} @if($p->is_reversal) Reversal @else {{ ucfirst($p->payment_type) }} @endif {{ $p->workOrder->work_order_number ?? '—' }} {{ $p->narration ?? '—' }} {{ $p->is_reversal ? '-' : '' }}৳{{ number_format((float) $p->amount, 2) }}
No payments recorded yet.
@endsection