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

Parties (Customers & Suppliers)

New Party
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif
Clear
@php $customers = $parties->where('type', 'customer')->count() + $parties->where('type', 'both')->count(); $suppliers = $parties->where('type', 'supplier')->count() + $parties->where('type', 'both')->count(); $totalReceivable = $parties->whereIn('type', ['customer', 'both'])->sum('current_balance'); $totalPayable = $parties->whereIn('type', ['supplier', 'both'])->sum('current_balance'); @endphp
Customers
{{ $customers }}
Suppliers
{{ $suppliers }}
Total Receivable
Rs. {{ number_format($totalReceivable, 2) }}
Total Payable
Rs. {{ number_format($totalPayable, 2) }}
@forelse($parties as $party) @empty @endforelse
Code Party Name Type Phone City Credit Limit Balance Status Actions
{{ $party->code }} {{ $party->name }} @php $typeColors = ['customer' => '#28a745', 'supplier' => '#007bff', 'both' => '#6f42c1']; @endphp {{ $types[$party->type] ?? ucfirst($party->type) }} {{ $party->phone ?: $party->mobile ?: '-' }} {{ $party->city ?: '-' }} {{ $party->credit_limit ? 'Rs. ' . number_format($party->credit_limit, 2) : '-' }} Rs. {{ number_format($party->current_balance, 2) }} @if($party->is_active) Active @else Inactive @endif
@csrf @method('DELETE')

No parties found. Create your first party

Total: {{ $parties->count() }} parties
@endsection