@extends('garage.layouts.app') @section('title', 'Vendors') @push('styles') @include('shared.garage-vendors-ui-styles') @endpush @section('content') @php $statusVal = $status ?? 'all'; $filterQuery = fn (string $s) => array_filter(['search' => $search ?: null, 'status' => $s === 'all' ? null : $s]); $vendorsIndexUrl = route('garage.vendors.index'); $jsonPlaceholder = 987654321; $vendorJsonUrlTemplate = str_replace((string) $jsonPlaceholder, '__ID__', route('garage.vendors.json', ['id' => $jsonPlaceholder])); $editFormAction = session('vendor_edit_id') ? route('garage.vendors.update', session('vendor_edit_id')) : '#'; @endphp

Vendors

Supplier ledgers for purchase orders and bills. Add or edit from the modals — summary stays in the table below.

@if($statusVal !== 'all') @endif @if(($search ?? '') !== '' || $statusVal !== 'all') Clear @endif
@forelse($vendors as $vendor) @php $displayBalance = ($vendor->opening_balance_type ?? 'debit') === 'credit' ? -(float) $vendor->opening_balance : (float) $vendor->opening_balance; $vendorLedgerReportUrl = route('garage.ledger-reports.ledger', $vendor->id); @endphp @empty @endforelse
Code Name Contact Email Credit Balance Status Actions
{{ $vendor->code }} {{ $vendor->name }} @if($vendor->contact_person)
{{ $vendor->contact_person }}
@endif
@if($vendor->phone)
{{ $vendor->phone }}
@endif @if($vendor->address)
{{ \Illuminate\Support\Str::limit($vendor->address, 36) }}
@elseif(!$vendor->phone) @endif
@if($vendor->email) {{ \Illuminate\Support\Str::limit($vendor->email, 28) }} @else @endif @if($vendor->credit_limit) PKR {{ number_format($vendor->credit_limit, 0) }} @else @endif PKR {{ number_format(abs($displayBalance), 0) }} @if($vendor->is_active) Active @else Inactive @endif
No vendors match. Use Add vendor to create one.
@if($vendors->hasPages())
{{ $vendors->withQueryString()->links() }}
@endif
{{-- Create --}} {{-- Edit --}} @push('scripts') @endpush @endsection