@extends('layouts.app')
@section('content')
@php
// Clean numeric display: PHP doubles json_encode with full precision on
// this server (127.2900000000000006…) — trim to a tidy form.
$cleanNum = function ($v) {
return rtrim(rtrim(number_format((float) $v, 6, '.', ''), '0'), '.');
};
$minPrices = $current['size_min_prices'] ?? [];
$minPricesJson = '{' . collect($minPrices)
->map(fn ($v, $k) => '"' . $k . '":' . $cleanNum($v))->implode(',') . '}';
$bounds = array_values($current['distance_tier_bounds'] ?? []);
$descriptions = [
'markup_base' => "Flat amount added to every size's markup on every quote.",
'min_cost_distance_km' => 'Routes shorter than this (km) get the minimum charge.',
'uk_vat_rate' => 'VAT applied when the place of supply is the UK. Enter a fraction: 0.05 = 5%.',
'size_30_multiplier' => '30 m³ price = the 15 m³ price × this.',
'price_rounding_decimals' => 'Decimal places on the final displayed price.',
'size_min_prices' => 'Minimum charge per size, applied under the min-charge distance.',
'distance_tier_bounds' => 'Distance boundaries (km) that select the rate tier. Must strictly increase.',
'eu_supported_countries' => 'Moves between two ticked countries are priced with the EU rate block.',
];
// The recognised EU-27 codes — the only values the server accepts.
$eu27 = [
'AT' => 'Austria', 'BE' => 'Belgium', 'BG' => 'Bulgaria', 'HR' => 'Croatia', 'CY' => 'Cyprus',
'CZ' => 'Czechia', 'DK' => 'Denmark', 'EE' => 'Estonia', 'FI' => 'Finland', 'FR' => 'France',
'DE' => 'Germany', 'GR' => 'Greece', 'HU' => 'Hungary', 'IE' => 'Ireland', 'IT' => 'Italy',
'LV' => 'Latvia', 'LT' => 'Lithuania', 'LU' => 'Luxembourg', 'MT' => 'Malta', 'NL' => 'Netherlands',
'PL' => 'Poland', 'PT' => 'Portugal', 'RO' => 'Romania', 'SK' => 'Slovakia', 'SI' => 'Slovenia',
'ES' => 'Spain', 'SE' => 'Sweden',
];
$currentEu = $current['eu_supported_countries'] ?? [];
$locked = collect($constants ?? [])->reject(fn ($r) => $r['editable_later']);
@endphp
The fixed values the pricing engine uses. Edit the business knobs below and Review changes to preview the impact before saving.
@if(!$gateOpen)| {{ $row['label'] }} | {{ $row['value'] }} |
{{ $row['meaning'] }}
@if($row['note'] !== '')
warning {{ $row['note'] }} @endif |