@extends('layouts.admin') @section('title', 'Payments — ' . $sale->invoice_no) @section('content') @php $input = 'w-full h-11 px-3 rounded-xl border border-slate-300 dark:border-slate-700 bg-slate-50 dark:bg-slate-800 text-sm outline-none focus:ring-2 ring-brand-500 focus:bg-white dark:focus:bg-slate-900'; $label = 'block text-sm font-semibold mb-2'; $badge = [ 'paid' => 'bg-emerald-500/10 text-emerald-600 dark:text-emerald-400', 'partial' => 'bg-amber-500/10 text-amber-600 dark:text-amber-400', 'due' => 'bg-red-500/10 text-red-500', ]; $methods = ['cash' => 'Cash', 'card' => 'Card', 'bank' => 'Bank Transfer']; $percent = (float) $sale->total > 0 ? min(100, round((float) $sale->paid_amount / (float) $sale->total * 100)) : 100; @endphp {{-- Breadcrumb --}}
Sales/ {{ $sale->invoice_no }} payments
@if (session('success'))
{{ session('success') }}
@endif @if ($errors->any())
@endif {{-- Summary --}}
{{ $sale->invoice_no }}
{{ $sale->customer_name }}@if ($sale->customer_phone) · {{ $sale->customer_phone }}@endif · {{ $sale->date->format('d M Y') }}
{{ $sale->payment_status }} View invoice
Total (with VAT)
AED {{ number_format($sale->total, 2) }}
Paid
AED {{ number_format($sale->paid_amount, 2) }}
Due
AED {{ number_format($sale->due_amount, 2) }}
Payment progress{{ $percent }}%
{{-- Add payment --}} @if ($sale->due_amount > 0) @if ($sale->customer_id)
@csrf

Add payment

Baki: AED {{ number_format($sale->due_amount, 2) }}. Kom dile abar pore baki ta nite parbe.

@else
Ei sale e customer nai, tai payment neya jabe na. Edit theke customer select koro.
@endif @endif {{-- History --}}
Payment history
{{-- Sale korar shomoy deya taka --}} @if ($initial > 0) @endif @foreach ($sale->payments as $p) @endforeach @if ($initial <= 0 && $sale->payments->isEmpty()) @endif
Date Method Note Amount Action
{{ $sale->date->format('d M Y') }} {{ $methods[$sale->payment_method] ?? $sale->payment_method }} Sale korar shomoy +{{ number_format($initial, 2) }} —
{{ $p->date->format('d M Y') }} {{ $methods[$p->method] ?? $p->method }} {{ $p->note ?: '—' }} +{{ number_format($p->amount, 2) }}
@csrf @method('DELETE')
Ekhono kono payment nai.
Total paid AED {{ number_format($sale->paid_amount, 2) }}
← Back to sales
@endsection