@extends('admin.layouts.wholesale-live') @section('page-title', $currentPage) @section('wholesale-actions')Payment History@endsection @section('wholesale-content') @if($review)

Review payment before saving

Party
{{ $review['party']->name }} · {{ $review['party']->phone }}
Payment against
{{ $review['invoice']?->code() ?? 'Opening due' }}
Outstanding (BDT)
{{ number_format($review['due'] / 100, 2) }}
Received now (BDT)
{{ number_format($review['amount'] / 100, 2) }}
Due after payment (BDT)
{{ number_format(($review['due'] - $review['amount']) / 100, 2) }}
Date / Method
{{ $payload['payment_date'] }} · {{ $payload['method'] }}
Reference
{{ $payload['reference'] ?? '—' }}
Note
{{ $payload['note'] ?? '—' }}
@csrf @foreach($payload as $key => $value)@endforeach

Confirm only money already received. If the connection fails, resubmit this same confirmation; the receipt will be recorded once.

Back
@else
@if($party)

{{ $party->name }} · {{ $party->phone }} · Current Party due: BDT {{ number_format($balance / 100, 2) }}

@endif
@if($party)

Up to 50 outstanding invoices shown; search by WH code for older invoices. Inactive Parties can pay existing dues.

@if($due > 0 && ($target === 'opening' || $selectedInvoice))
@csrf

Payment against {{ $selectedInvoice?->code() ?? 'Opening due' }}

Due BDT {{ number_format($due / 100, 2) }}
Required for Bank / Mobile payments.

No stock changes. Review before recording the payment.

@elseif($target !== '')

No outstanding due for this selection. Choose another invoice or opening due.

@endif @endif @endif @endsection