@extends('layouts.layoutapp') @section('content')
@csrf

Confirm Purchase

Review the items, then enter the payment.

@if (session('error'))
{{ session('error') }}
@endif {{-- ITEMS --}}
@foreach ($pending['lines'] as $index => $line) @endforeach
S.No Product Supplier Qty Buying Amount Amount

{{ $index + 1 }}

{{ $line['product_name'] }}

{{ $suppliers[$line['supplier_id']] ?? '-' }}

{{ rtrim(rtrim(number_format($line['qty'], 2, '.', ''), '0'), '.') }}

₹ {{ number_format($line['unitPrice'], 2) }}

₹ {{ number_format($line['amount'], 2) }}

{{-- TOTAL, shown above the paid amount --}}

Total Amount for this Purchase

₹ {{ number_format($pending['total'], 2) }}

Leave blank or 0 if nothing is paid yet.
{{-- Values match what the rest of the app stores in product_payments.payment_type --}}
Purchase Date {{ \Carbon\Carbon::parse($pending['purchase_date'])->format('d-m-Y') }}
Items {{ count($pending['lines']) }}

Total ₹ {{ number_format($pending['total'], 2) }}
Paying Now ₹ 0.00

Balance ₹ {{ number_format($pending['total'], 2) }}
@push('scripts') @endpush @endsection