Product Installment Management
The product installment was not saved:
-
@foreach ($errors->all() as $error)
- {{ $error }} @endforeach
| # | Manager | POP | Product | Status | Installments | Total (৳) | Speed Money | Per Install (৳) | Paid (৳) | Remaining (৳) | Action |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Total |
{{-- Folds to one line while the table is scrolled (the row is sticky, so a
long list would cover the rows); opens again at the top or on click. --}}
@if ($grandProducts->isNotEmpty())
{{ $grandProducts->count() }} products · {{ $grandProducts->sum() }} qty
@foreach ($grandProducts as $productName => $quantity)
@endif
{{ $loop->iteration }}. {{ $productName }} = {{ $quantity }}
@endforeach
|
{{ number_format($grandTotal, 2) }} | {{ number_format($grandSpeed, 2) }} | {{ number_format($grandPerInstall, 2) }} | {{ number_format($grandPaidShown, 2) }} | {{ number_format($grandRemaining, 2) }} | |||||
| {{ $item->id }} |
{{ $item->manager->name_with_type ?? '—' }}
Added by: {{ $item->createdBy->name ?? '—' }} |
{{ $item->pop->popname ?? '—' }} |
{{-- Just what was given: one numbered "Product = Qty" line per product. --}}
@forelse ($item->items as $line)
{{ $loop->iteration }}. {{ $line->product_name }} = {{ $line->quantity }}
@empty
{{-- Entries from before product lines existed only carry a name. --}}
{{ $item->product_name }}
@endforelse
@if ($item->requisition_id)
Requisition ID: {{ $item->requisition_id }}
@endif
|
@include('partials.approval-status', ['item' => $item]) @if ($item->status === 'approved') @if ($totalPaid > 0 && $remaining <= 0) Fully Paid @endif @endif @include('partials.approval-comment', ['item' => $item]) |
{{ $item->installment_count }} times
@if ($item->start_month)
From {{ $item->start_month->format('M Y') }} @endif |
{{ number_format($item->total_amount, 2) }} | @if ($item->speed_money > 0) {{ number_format($item->speed_money, 2) }} @else — @endif | {{ number_format($item->one_installment_amount, 2) }} | @if ($paidShown > 0) {{ number_format($paidShown, 2) }} @else — @endif | @if ($remaining > 0) {{ number_format($remaining, 2) }} @else Paid @endif | {{-- An approved installment stays editable/deletable, but only for a user who also holds the *-approved permission. --}} @php $isApproved = $item->status === 'approved'; $canEditRow = auth()->user()->can('product-installment-edit') && (!$isApproved || auth()->user()->can('product-installment-edit-approved')); $canDeleteRow = auth()->user()->can('product-installment-delete') && (!$isApproved || auth()->user()->can('product-installment-delete-approved')); @endphp @if ($canEditRow) Edit @endif @can('product-installment-approve') @include('partials.approval-decision-buttons', [ 'item' => $item, 'url' => route('product-installment.approve', $item->id), 'label' => 'product installment', ]) @endcan @if ($canDeleteRow) @endif @if ($item->status === 'approved') @can('product-installment-payment') @if ($remaining > 0) @endif @if ($totalPaid > 0) @endif @endcan @endif @can('product-installment-history') History @endcan |