{{-- Billing's contribution to the settings screen. Rendered into the `settings.tab.payment_methods` slot. The Settings module knows nothing about this file or about payment methods — remove Billing and the tab disappears with it. Two panels rather than one, matching the other settings tabs: what exists, then what can be added. The add form is a separate panel because it is a different action, and folding it under the table made the table look like it had an editable last row. --}} @php $methods = \App\Modules\Billing\Models\PaymentMethod::query() ->orderBy('sort_order') ->orderBy('name') ->get(); // Icons carry the same information as the name, for the reader scanning // rather than reading. Matched on the code because that is the stable // identifier; an unrecognised method gets the neutral one rather than a // wrong guess. $icons = [ 'cash' => 'bi-cash-stack', 'card' => 'bi-credit-card', 'transfer' => 'bi-bank', 'bank' => 'bi-bank', 'cheque' => 'bi-receipt', 'check' => 'bi-receipt', 'online' => 'bi-globe', 'wallet' => 'bi-phone', ]; @endphp

{{ __('settings::messages.payment_methods.heading') }}

{{ __('billing::messages.payment_methods.intro') }}

@if ($methods->isNotEmpty()) {{ trans_choice('billing::messages.payment_methods.active_count', $methods->where('is_active', true)->count(), [ 'count' => $methods->where('is_active', true)->count(), 'total' => $methods->count(), ]) }} @endif
@if ($methods->isEmpty())

{{ __('billing::messages.payment_methods.none') }}

{{ __('billing::messages.payment_methods.none_text') }}

@else
@if ($canUpdate)@endif @foreach ($methods as $method) ! $method->is_active])> {{-- Yes is the notable answer on both of these columns, so only Yes gets a chip; a page of chips reading "No" is noise the eye has to filter before it finds the ones that matter. --}} @if ($canUpdate) @endif @endforeach
{{ __('billing::messages.payment_methods.name') }} {{ __('billing::messages.payment_methods.code') }} {{ __('billing::messages.payment_methods.drawer') }} {{ __('billing::messages.payment_methods.reference') }} {{ __('common.status') }}{{ __('common.actions') }}
{{ $method->name }} {{ $method->code }} @if ($method->affects_cash_drawer) {{ __('common.yes') }} @else {{ __('common.no') }} @endif @if ($method->requires_reference) {{ __('common.yes') }} @else {{ __('common.no') }} @endif {{ $method->is_active ? __('common.active') : __('common.inactive') }} {{-- Deactivate, never delete: a payment row points at the method it was taken with, and removing it turns historical receipts into dangling references. --}}
@csrf @method('PATCH')
@endif
@if ($canUpdate)

{{ __('billing::messages.payment_methods.add') }}

@csrf
@error('name')
{{ $message }}
@enderror
{{ __('billing::messages.payment_methods.code_help') }} @error('code')
{{ $message }}
@enderror
{{ __('billing::messages.payment_methods.behaviour') }}
@endif