@extends('layouts.app') @php use App\Models\TenancyImportRow; $tabs = [ '' => ['label' => 'All rows', 'count' => $batch->rows_read], TenancyImportRow::OUTCOME_NEW => ['label' => 'New outlets', 'count' => $batch->rows_new], TenancyImportRow::OUTCOME_UPDATE => ['label' => 'Will update', 'count' => $batch->rows_updated], TenancyImportRow::OUTCOME_DUPLICATE => ['label' => 'Duplicates', 'count' => $batch->rows_duplicate], TenancyImportRow::OUTCOME_INVALID => ['label' => 'Cannot import', 'count' => $batch->rows_invalid], ]; @endphp @section('title', 'Import preview') @section('heading', 'Import preview — '.$batch->reference) @section('subheading', $batch->original_filename.' · sheet "'.$batch->sheet_name.'"') @section('content') @if ($batch->isCommitted())
This import was committed on {{ $batch->committed_at->format('d M Y H:i') }} — {{ $batch->rows_imported }} added and {{ $batch->rows_updated }} updated. View the tenancy records.
@elseif ($batch->status === \App\Models\TenancyImportBatch::STATUS_CANCELLED)
This import was discarded. Nothing was saved. Start again.
@else
Nothing has been saved yet. Review the rows below, untick anything you do not want, then choose Import ticked rows.
@endif {{-- ------------------------------------------------------------ --}} {{-- Summary --}} {{-- ------------------------------------------------------------ --}}
Rows read
{{ $batch->rows_read }}
New outlets
{{ $batch->rows_new }}
Will update
{{ $batch->rows_updated }}
Duplicates
{{ $batch->rows_duplicate }}
Cannot import
{{ $batch->rows_invalid }}
@unless ($batch->isCommitted() || $batch->status === \App\Models\TenancyImportBatch::STATUS_CANCELLED)
@csrf
@csrf
Upload a different file
@endunless {{-- ------------------------------------------------------------ --}} {{-- Rows --}} {{-- ------------------------------------------------------------ --}}
@csrf @method('PATCH')
@forelse ($rows as $row) @php $importable = in_array($row->outcome, [TenancyImportRow::OUTCOME_NEW, TenancyImportRow::OUTCOME_UPDATE], true); @endphp @empty @endforelse
isCommitted())> Excel row Outcome Region Outlet Unit / location Landlord Commencing Expiry Category Notes
selected) @disabled(! $importable || $batch->isCommitted()) aria-label="Import Excel row {{ $row->source_row }}"> {{ $row->source_row }} {{ $row->outcomeLabel() }} {{ $row->value('region_code') ?? '—' }} {{ $row->value('outlet') }} {{ $row->value('location') ?? '—' }} {{ $row->value('landlord_name') ?? '—' }} {{ $row->value('commencement_date') ?? ($row->value('commencement_tbc') ? 'TBC' : '—') }} {{ $row->value('expiry_date') ?? ($row->value('expiry_tbc') ? 'TBC' : '—') }} {{ $row->value('category_slug') }} @foreach ($row->messages ?? [] as $message)
{{ $message }} @if ($row->matched_tenancy_id) open @endif
@endforeach
No rows in this group.
@unless ($batch->isCommitted()) @endunless
@endsection