@lang('superadmin.orderMoneyRecalculation.title')

@lang('superadmin.orderMoneyRecalculation.description')

@lang('superadmin.orderMoneyRecalculation.menuPriceWarning')
@foreach ($restaurants as $restaurant) @endforeach
@foreach ($branches as $branch) @endforeach
@lang('modules.order.preview')
@if (count($matches) > 0 && !$preview)

@lang('superadmin.orderMoneyRecalculation.multipleMatches')

@foreach ($matches as $match) @endforeach
ID @lang('modules.settings.branchName') @lang('modules.order.date') @lang('modules.order.total') @lang('app.action')
{{ $match['id'] }} {{ $match['branch_name'] ?? '—' }} {{ $match['date_time'] ?? '—' }} {{ $match['total'] }} @lang('superadmin.orderMoneyRecalculation.useThisOrder')
@endif @if ($preview) @php $decimals = (int) ($preview['decimals'] ?? 2); $syncPaymentDisabled = !($preview['can_sync_payment'] ?? false) || $applied; $applyDisabled = $applied || !($preview['has_changes'] ?? false); @endphp

@lang('modules.order.orderNumber') #{{ $preview['order_number'] }} (ID {{ $preview['order_id'] }})

{{ $preview['restaurant_name'] }} @if (!empty($preview['branch_name'])) · {{ $preview['branch_name'] }} @endif · {{ $decimals }} @lang('superadmin.orderMoneyRecalculation.decimalPlaces')

@if ($applied) @lang('superadmin.orderMoneyRecalculation.applied') @elseif (!($preview['has_changes'] ?? false)) @lang('superadmin.orderMoneyRecalculation.noChanges') @endif
@foreach ($preview['lines'] as $line) $line['changed'] ?? false])> @endforeach
@lang('modules.menu.item') @lang('superadmin.orderMoneyRecalculation.oldPrice') @lang('superadmin.orderMoneyRecalculation.newPrice') @lang('superadmin.orderMoneyRecalculation.oldAmount') @lang('superadmin.orderMoneyRecalculation.newAmount')
{{ $line['name'] }} {{ number_format($line['before_price'], $decimals) }} {{ number_format($line['new_price'], $decimals) }} {{ number_format($line['before_amount'], $decimals) }} {{ number_format($line['new_amount'], $decimals) }}
@foreach (['sub_total', 'total_tax_amount', 'total', 'amount_paid'] as $field) @php $row = $preview['totals'][$field] ?? ['old' => 0, 'new' => 0, 'changed' => false]; @endphp $row['changed'] ?? false])> @endforeach
@lang('superadmin.orderMoneyRecalculation.field') @lang('superadmin.orderMoneyRecalculation.oldValue') @lang('superadmin.orderMoneyRecalculation.newValue')
{{ $field }} {{ number_format($row['old'], $decimals) }} @if ($field === 'amount_paid' && $syncPayment && ($preview['can_sync_payment'] ?? false) && !$applied) {{ number_format($preview['totals']['total']['new'], $decimals) }} @else {{ number_format($row['new'], $decimals) }} @endif
@lang('superadmin.orderMoneyRecalculation.apply')
@endif