{{-- The POS's shops, as the POS itself lists them. Not the Subscriptions tab: that shows what has been mirrored into BCP, which is only the shops whose billing has been connected here. This is every real shop the POS has, connected or not, read from the POS when the screen is opened. The POS leaves its demonstration shops out, and says for each of the rest whether it may be entered. Every class here is one the subscriptions list or the subscription screen already uses, so the built stylesheet carries all of them. --}} @php //Why a shop has no way in, in the administrator's words. $reasons = [ 'operator' => 'Bindu\'s own shop. Sign in on the POS.', 'inactive' => 'Deactivated in the POS.', 'no_owner' => 'No owner who can sign in.', ]; @endphp
@if ($error) @endif
@forelse ($shops as $shop) @php $subscription = $billing[$shop['id']] ?? null; @endphp @empty @endforelse
Shop Owner Package Status Billing in BCP Visit
{{ $shop['name'] }} #{{ $shop['id'] }}@if ($shop['city']) · {{ $shop['city'] }}@endif {{ $shop['owner'] ?? '—' }} @if ($shop['phone']) {{ $shop['phone'] }} @endif @if ($shop['email']) {{ $shop['email'] }} @endif {{ $shop['package'] ?? 'No package in force' }} @if ($shop['ends_at']) until {{ $shop['ends_at'] }} @endif {{ $shop['active'] ? 'Active' : 'Inactive' }} @if ($subscription) Connected → @elseif (($waiting[$shop['id']] ?? null) === 'linked') {{-- Both halves done: the POS holds the token and names this account. It has had no subscription to mirror. --}} Connected no subscription yet @elseif (($waiting[$shop['id']] ?? null) === 'pending') {{-- BCP's half is done; the command on the POS's server is not. Not "waiting": nothing is in progress, it is the administrator's turn. --}} Not finished Finish → @else Not connected {{-- Never the operator's own shop: it is not a customer, and is not billed. --}} @if (! $shop['operator'] && $connected) Connect → @endif @endif
@if ($shop['can_visit'] && $connected) {{-- Opens in a new tab, so the administrator stays signed in here. --}}
@csrf
@else {{ $reasons[$shop['refusal']] ?? 'Cannot be entered.' }} @endif

{{ $error ? 'The list of shops could not be read from the POS' : 'The POS has no shops yet' }}

Read from the POS just now and kept nowhere here. Demonstration shops are left out by the POS itself.