@extends("admin.layouts.app") @section("title", __("admin.price_update.title")) @section("content")

{{ __('admin.price_update.intro') }}

@php $c = $criteria ?? ['product_ids' => [], 'cycles' => [], 'statuses' => ['active', 'suspended'], 'mode' => 'catalogue', 'value' => null, 'increase_only' => true]; @endphp {{-- Step 1: choose the services and the new price. GET, so the preview can be reloaded and shared. --}}
{{ __('admin.price_update.multi_hint') }}
@foreach($cycles as $key => $stored) @endforeach
{{ __('admin.price_update.cycles_hint') }}
@foreach($statuses as $st) @endforeach
@foreach(['catalogue', 'percent', 'fixed'] as $mode) @endforeach
@if($criteria) {{-- Step 2: what would change. Nothing is saved until Apply. --}}
{{ trans_choice('admin.price_update.will_change', $count, ['count' => $count]) }} @if($count) {{ __('admin.price_update.difference', ['amount' => money_fmt($difference)]) }} @endif @if($openInvoices) {{ __('admin.price_update.open_invoices', ['count' => $openInvoices]) }} @endif
@if($count) @foreach($rows as $row) @php $s = $row['service']; @endphp @endforeach
{{ __('common.table.id') }}{{ __('common.table.client') }}{{ __('common.table.product') }} {{ __('common.table.domain') }}{{ __('common.table.billing_cycle') }}{{ __('admin.services.next_due') }} {{ __('admin.price_update.current') }}{{ __('admin.price_update.new') }}
{{ $s->id }} {{ $s->client?->full_name ?? '-' }} {{ $s->product?->name }} {{ $s->domain ?: '-' }} {{ $s->billing_cycle }} {{ $s->next_due_date?->format(date_fmt()) ?? '-' }} @if($row['open_invoice']){{ __('admin.price_update.invoice_raised') }}@endif {{ money_fmt($row['old']) }} {{ money_fmt($row['new']) }}
@if($count > $previewRows)
{{ __('admin.price_update.more_rows', ['count' => $count - $previewRows]) }}
@endif
@csrf @foreach($criteria['product_ids'] as $id)@endforeach @foreach($criteria['cycles'] as $cy)@endforeach @foreach($criteria['statuses'] as $st)@endforeach @if($criteria['value'] !== null)@endif
@endif
@endif @endsection