@extends('layouts.admin') @section('title','Store Branch') @section('admin-content')
YOUR PHYSICAL STORES

Store Branch.

Manage your stores. Active switches save automatically.

Reset
@forelse($branches as $branch) @empty@endforelse
Store codeStore nameStateActiveActions
{{ $branch->code }}{{ $branch->name }}{{ $branch->state ?: 'Not set' }}
@csrf @method('PATCH')
No branches match. Adjust your filters or add a branch.
@foreach(collect([null])->concat($branches->items()) as $branch) @php($dialogId=$branch ? 'branch-'.$branch->id : 'branch-new') any() && (string)old('editing_branch')===(string)($branch->id ?? 'new')) data-branch-reopen @endif>

{{ $branch ? 'Edit branch' : 'Add store branch' }}

@csrf @if($branch) @method('PUT') @endif@include('admin.partials.store-branch-form',['branch'=>$branch])
@if($branch) @if($branch->used)

This branch has purchase history. Deactivate it to stop new entries.

@else
@csrf @method('DELETE')
@endif @endif
@endforeach @if($legacy)
Match older branch names

Select the correct store for each name previously entered. Existing labels stay unchanged. Matching connects the records and prevents the same receipt being used again under the new store name.

@foreach($legacy as $entry)
@csrf{{ $entry['name'] }} · {{ $entry['count'] }} records
@endforeach
@endif @endsection @push('scripts')@endpush