@extends('layouts.app') @section('style') @endsection @section('content')
@if(session('success'))
Success
{{ session('success') }}
@endif @if(session('error'))
Error
{{ session('error') }}
@endif
{{ $supplier->name }}

{{ $supplier->name }}

{{ $supplier->email ?? 'No email' }} | {{ $supplier->phone ?? 'No phone' }}

@if($supplier->status == 'active') Active @else Inactive @endif {{ $supplier->purchases_count ?? 0 }} Purchases
Total Purchases
{{ $purchaseStats['total_purchases'] }}
All time orders
Total Spent
${{ number_format($purchaseStats['total_spent'], 2) }}
Lifetime value
Avg Order Value
${{ number_format($purchaseStats['avg_order_value'], 2) }}
Per purchase
Supplier Information

{{ $supplier->contact_person ?? 'Not specified' }}

{{ $supplier->payment_terms ?? 'Not specified' }}

{{ $supplier->tax_id ?? 'Not specified' }}

@if($supplier->website) {{ $supplier->website }} @else Not specified @endif

{{ $supplier->address ?? 'Not specified' }}

@if($supplier->notes) {{ $supplier->notes }} @else No additional notes @endif

Recent Purchases
New Purchase
@if($purchases->count() > 0)
@foreach($purchases as $purchase) @endforeach
Invoice # Date Total Tax Grand Total
#{{ $purchase->invoice_no ?? 'N/A' }} {{ $purchase->created_at->format('M d, Y') }} ${{ number_format($purchase->total, 2) }} ${{ number_format($purchase->tax_total, 2) }} ${{ number_format($purchase->grand_total, 2) }}
{{ $purchases->links() }}
@else
No purchases found

This supplier hasn't made any purchases yet.

Create First Purchase
@endif
Activity Timeline
Supplier Created

{{ $supplier->created_at->format('M d, Y \a\t h:i A') }}

@if($purchaseStats['last_purchase'])
Last Purchase

{{ $purchaseStats['last_purchase'] }}

@endif
Last Updated

{{ $supplier->updated_at->format('M d, Y \a\t h:i A') }}

Quick Actions
@endsection @section('script') @endsection