@extends('layouts.app') @section('title', 'Credit Debit Note') @section('content')

Credit Debit Note

Credit Debit Note
Reset
{{-- Totals for the current filter. A description list rather than an

: these are figures, not a section heading, so they no longer compete with the page title. Credit and Debit are told apart by a tinted label pill, not by tinting the amounts. Every accessible text colour in this theme is a dark, desaturated tone (warning #623e0a against primary #15395a), so two coloured amounts read as the same muddy dark; the theme's bright brand colours are legible only as a background, not as text on white. So the colour goes where it can be strong — a filled pill — and the amounts stay plain dark for maximum legibility. The pills reuse the badge language of the table below. --}}
Credit
RM {{ number_format($creditTotal, 2) }}
Debit
RM {{ number_format($debitTotal, 2) }}

{{-- Resolved once for the whole listing: permissions do not vary per row. The approval tick is only offered to a reviewer who has no edit pencil, because both controls open the same edit page and a second copy of the same link adds nothing. --}} @php $reviewsApprovals = auth()->user()?->can('approve-credit-debit-note') && ! auth()->user()?->can('edit-credit-debit-note'); @endphp
@forelse ($creditDebitNotes as $creditDebitNote) {{-- Who approved or rejected this note, and when. The outcome itself is the Approval Status badge above. --}} {{-- Nothing here renders disabled: a control is either shown and usable, or not shown at all. The delete form holds only its own button, and the group is laid out inline so the controls sit on one row instead of stacking. --}} @empty @endforelse
# Invoice No. Customer Site Name Type Payment For Description Amount Invoice Date Transaction Date Status Approval Status Category Decided By Decided Date Action
{{ $loop->iteration }} {{ $creditDebitNote->paymentItem->payment->invoice_no ?? '' }} {{ $creditDebitNote->cardholder->name ?? '' }} {{ $creditDebitNote->paymentItem->site->name ?? '' }} {{ $creditDebitNote->type->name ?? '' }} {{ $creditDebitNote->paymentItem->payment->payment_for ?? '' }} {{ $creditDebitNote->description ?? '' }} {{ $creditDebitNote->type->symbol() }} RM {{ $creditDebitNote->amount ?? '' }} {{ $creditDebitNote->paymentItem->payment->invoiced_at?->format('d/m/Y') ?? '--' }} {{ $creditDebitNote->paymentItem->payment->received_time?->format('d/m/Y \- H:i') ?? '--' }} @if ($creditDebitNote->paymentItem->payment->isPaid()) Paid @else Unpaid @endif @if ($creditDebitNote->status) {{ $creditDebitNote->status->label() }} @else Draft @endif {{ $creditDebitNote->category?->label() ?? '-' }}{{ $creditDebitNote->decider?->name ?? '-' }} {{ $creditDebitNote->decided_at?->format('d/m/Y \- H:i') ?? '-' }}
@can('edit-credit-debit-note') @endcan {{-- A call to action, not a status indicator: the tick invites a decision, so it retires once one is recorded (approved or rejected). A decided note is then read through the edit page. --}} @if ($reviewsApprovals && ! $creditDebitNote->isDecided()) @endif @can('delete-credit-debit-note')
@method('DELETE') @csrf
@endcan
No record found
@endsection @push('css') @endpush @push('js') @endpush