@extends('layouts.app') @section('title', __('laboratory::messages.wizard.step_review')) @section('content')

{{ __('laboratory::messages.wizard.step_review_heading') }}

{{ __('laboratory::messages.wizard.step_review_hint') }}

{{ __('common.cancel') }}
@include('laboratory::wizard.partials.steps', ['current' => 'review']) @if ($errors->any()) @endif
@csrf

{{ __('laboratory::messages.wizard.patient') }}

{{ $patient->name }}
{{ $patient->mrn }} · {{ $patient->ageLabel }}@if ($patient->phone) · {{ $patient->phone }} @endif
{{ __('common.change') }}
@if ($patient->activeAllergyCount > 0) @endif

{{ __('laboratory::messages.wizard.tests_chosen') }}

{{ __('common.change') }}
@foreach ($tests as $test) {{-- Keyed by test, not by billing code: a test can be priced on itself without naming an entry in the price list. --}} @php $minor = $prices[$test->id] ?? null; @endphp @endforeach {{-- Only there once something is taken off, so an order with no discount reads exactly as it did. --}}
{{ __('laboratory::messages.orders.tests') }} {{ __('laboratory::messages.orders.specimen') }} {{ __('laboratory::messages.wizard.price') }}
{{ $test->name }}
{{ $test->code }} · {{ $test->category->label() }}
{{ $test->specimen_type ?: '—' }} @if ($minor !== null) {{ \App\Support\Money\Money::fromMinor($minor, $currency)->format() }} @else {{-- Absent, not zero. A test with no entry in the price list has not been priced, and printing 0.00 here would be quoted at the desk as free. --}} {{ __('laboratory::messages.wizard.not_priced') }} @endif
{{ __('laboratory::messages.wizard.total') }} {{ $total->format() }}
@if (! $billingActive)

{{ __('laboratory::messages.wizard.billing_inactive') }}

@elseif ($unpricedCount > 0)

{{ trans_choice('laboratory::messages.wizard.unpriced_notice', $unpricedCount, ['count' => $unpricedCount]) }}

@endif

{{ __('laboratory::messages.wizard.request_details') }}

{{ __('laboratory::messages.orders.clinical_details_hint') }}
{{-- A discount agreed while the patient is standing there. Only for somebody who may reduce a bill — `invoices.write`, the same grant the invoice screen's own discount sits behind. Ordering a test and deciding what it costs are different authorities, and a receptionist who may do the first all day does not thereby get the second. It has to be here rather than on the invoice afterwards: the bill for a lab order is raised and closed in one movement, so a minute later there is an issued document that only a credit note can change. --}} @if ($billingActive && (auth()->user()?->can('invoices.write') ?? false)) {{-- The figures the running total is worked out from. Carried on the element rather than inlined into a script, because the content security policy forbids inline JavaScript — the same reason every other behaviour on this system travels on a data attribute. What the browser shows is only a preview. The discount that counts is applied server-side to the draft invoice, by the same arithmetic, before the bill is closed. --}}

{{ __('laboratory::messages.wizard.discount') }}

{{ __('laboratory::messages.wizard.discount_hint') }}

{{-- Said plainly, because "10" means two very different sums depending on the box above. --}} {{ __('laboratory::messages.wizard.discount_value_hint', ['currency' => $currency]) }}
@endif
@endsection