@extends('layouts.app') @section('content')

Party Details: {{ $party->name }}

Edit Back
Party Code
{{ $party->code }}
Party Name
{{ $party->name }}
Current Balance
Rs. {{ number_format($party->current_balance, 2) }}

Basic Information

Type: @php $typeLabels = ['customer' => 'Customer', 'supplier' => 'Supplier', 'both' => 'Customer & Supplier']; $typeColors = ['customer' => '#28a745', 'supplier' => '#007bff', 'both' => '#6f42c1']; @endphp {{ $typeLabels[$party->type] ?? ucfirst($party->type) }}
Phone: {{ $party->phone ?: '-' }}
Mobile: {{ $party->mobile ?: '-' }}
Email: {{ $party->email ?: '-' }}
City: {{ $party->city ?: '-' }}
Address: {{ $party->address ?: '-' }}
NTN: {{ $party->ntn ?: '-' }}
CNIC: {{ $party->cnic ?: '-' }}
Status: @if($party->is_active) Active @else Inactive @endif

Financial Information

Opening Balance: Rs. {{ number_format($party->opening_balance, 2) }} ({{ ucfirst($party->opening_type) }})
Current Balance: Rs. {{ number_format($party->current_balance, 2) }}
Credit Limit: {{ $party->credit_limit ? 'Rs. ' . number_format($party->credit_limit, 2) : 'No Limit' }}
Credit Days: {{ $party->credit_days ?: '0' }} days
Linked Account: @if($party->account) {{ $party->account->code }} - {{ $party->account->name }} @else Not linked @endif
Created: {{ $party->created_at->format('d M Y, h:i A') }}
Last Updated: {{ $party->updated_at->format('d M Y, h:i A') }}

Purchase History

@if($party->purchases && $party->purchases->count() > 0) @foreach($party->purchases->take(10) as $purchase) @endforeach
Bill No Date Amount
{{ $purchase->bill_no }} {{ \Carbon\Carbon::parse($purchase->date)->format('d M Y') }} Rs. {{ number_format($purchase->net_amount, 2) }}
@if($party->purchases->count() > 10) @endif @else

No purchases found.

@endif

Sales History

@if($party->sales && $party->sales->count() > 0) @foreach($party->sales->take(10) as $sale) @endforeach
Bill No Date Amount
{{ $sale->bill_no }} {{ \Carbon\Carbon::parse($sale->date)->format('d M Y') }} Rs. {{ number_format($sale->net_amount, 2) }}
@if($party->sales->count() > 10) @endif @else

No sales found.

@endif

Contracts New Contract

@if($party->contracts && $party->contracts->count() > 0) @foreach($party->contracts->take(10) as $contract) @endforeach
Contract No Type Qty Pending Status
{{ $contract->contract_no }} {{ ucfirst($contract->type) }} {{ number_format($contract->agreed_quantity, 2) }} {{ number_format($contract->pending_quantity, 2) }} @php $statusColors = [ 'draft' => 'background: #fafafa; color: #666;', 'active' => 'background: #e8f5e9; color: #2e7d32;', 'completed' => 'background: #e3f2fd; color: #1565c0;', 'cancelled' => 'background: #ffebee; color: #c62828;', ]; @endphp {{ ucfirst($contract->status) }}
@if($party->contracts->count() > 10) @endif @else

No contracts found for this party.

@endif
@endsection