@extends('layouts.app') @section('title', $coupon->exists ? __('Edit coupon') : __('New coupon')) @section('content')
@csrf @if($coupon->exists) @method('PATCH') @endif {{-- Header --}}
{{ __('Pay-per-analysis coupon') }}

{{ $coupon->exists ? __('Edit coupon') : __('New coupon') }}

{{ __('Applies a discount to a tenant\'s monthly invoice.') }}

← {{ __('Back') }}
@if($errors->any())
@endif {{-- Identity + discount --}}

{{ __('Discount') }}

{{ __('Customer-facing identifier.') }}

% EUR {{ __('analyses') }}

{{ __('Percentage off the invoice subtotal (max 100).') }} {{ __('Fixed amount deducted from the invoice subtotal.') }} {{ __('Number of analyses turned into 0-amount lines.') }}

{{-- Validity + limits --}}

{{ __('Validity & limits') }}

{{ __('Empty = unlimited.') }}

{{-- Tenant scope --}}
@php $selectedTenants = old('applies_to_tenant_ids', $coupon->applies_to_tenant_ids ?? []) ?: []; $selectedTenants = array_map('intval', (array) $selectedTenants); @endphp

{{ __('Tenant scope') }}

{{ __('Leave empty to apply to every tenant.') }}

{{ count($selectedTenants) }} / {{ count($tenants) }}
@if($tenants->isEmpty())

{{ __('No tenants exist yet.') }}

@else
@foreach($tenants as $t) @endforeach
@endif
{{-- Sticky save bar --}}
@if($coupon->exists) {{ __('Used :n times', ['n' => $coupon->uses_count ?? 0]) }} @endif {{ __('Cancel') }}
@endsection