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

{{ $supplier->name }}

Make Payment Back
Total Purchases
Rs. {{ number_format($supplier->purchases->sum('total_amount'), 2) }}
Total Paid
Rs. {{ number_format($supplier->payments->sum('amount'), 2) }}
Balance Due
Rs. {{ number_format($supplier->balance, 2) }}
Purchase History
@forelse($supplier->purchases as $purchase) @empty @endforelse
#DateItemsTotalPaid
{{ $purchase->id }} {{ $purchase->date->format('d M Y') }} @foreach($purchase->items as $item) {{ $item->product->category->name ?? '' }} {{ $item->product->weight->label ?? '' }} ({{ $item->bags }} bags){{ !$loop->last ? ', ' : '' }} @endforeach Rs. {{ number_format($purchase->total_amount, 2) }} Rs. {{ number_format($purchase->paid_amount, 2) }} View
No purchases yet
Payment History
@forelse($supplier->payments as $payment) @empty @endforelse
#DateAmountNotes
{{ $payment->id }} {{ $payment->date->format('d M Y') }} Rs. {{ number_format($payment->amount, 2) }} {{ $payment->notes ?: '-' }}
No payments yet
@endsection