@extends('layouts.school') @section('title', 'Service Charges') @section('header', 'Service Charges') @section('content')
{{-- Current rule highlight --}} @if ($activeRule)

Current service-charge rule

{{ $activeRule->name }}

{{ $activeRule->valueLabel($currency) }}

Applies to: online payments · Charge borne by: {{ str_replace('_', ' ', $activeRule->charge_to) }} · Gateway fee: {{ str_replace('_', ' ', $activeRule->gateway_fee_handling) }}

Active
{{-- Example calculation --}} @if ($example)

Example calculation

Based on a school fee of {{ number_format($exampleBase, 2) }} — shown to parents before they pay.

{{ $currency === 'NGN' ? '₦' : $currency }}
School fee
{{ number_format((float) $example['base_amount'], 2) }}
Pishon service charge ({{ $example['rule_name'] }})
@if ((float) $example['charge_amount'] > 0) @if ($example['charge_to'] === 'school') {{ number_format((float) $example['charge_amount'], 2) }} · absorbed by school @else {{ number_format((float) $example['charge_amount'], 2) }} @if ($example['charge_to'] === 'split') (parent pays {{ number_format((float) $example['parent_share'], 2) }}) @endif @endif @else No charge @endif
Total the parent pays
{{ number_format((float) $example['total_charged'], 2) }}
@endif @else
No active service-charge rule. Parents pay exactly the school fee when paying online — no Pishon service charge is applied. Create a rule below to add one.
@endif {{-- Create / edit rule --}}

{{ $activeRule ? 'Edit current rule' : 'Create a service-charge rule' }}

@csrf @if ($activeRule) @method('PATCH') @endif

Saving a rule snapshots it onto future payments. Existing payments keep the charge that was true when they were made.

{{-- Rule history --}}

All rules

@forelse ($rules as $rule)

{{ $rule->name }} #{{ $rule->id }}

{{ $rule->valueLabel($currency) }} · {{ str_replace('_', ' ', $rule->charge_to) }} bears it · @if ($rule->is_active) active @else inactive @endif

@unless ($rule->is_active)
@csrf @method('PATCH')
@endunless
@csrf @method('DELETE')
@empty

No service-charge rules yet.

@endforelse
@endsection