Review DSARs for Approval {{-- The screen previously never said whose DSARs these were — the tranche URL carries no client — so the client is named here, and linked. --}} @if($client) @php $clientName = trim(collect([ $client->title, $client->name_first, $client->name_last, ])->filter()->implode(' ')); @endphp

{{ $tranche->dsars->count() }} {{ Str::plural('DSAR', $tranche->dsars->count()) }} for {{ $clientName ?: 'this client' }} #{{ $client->displayId }}

@endif {{-- ══════════════════════════════════════════════════════════════════════ What will be attached — shown before approval, because these files go out with every DSAR in the batch and there is no way to check them afterwards short of opening a sent email. ══════════════════════════════════════════════════════════════════════ --}} @if(!empty($attachments)) @php $missing = collect($attachments)->where('exists', false); $unmergeable = collect($attachments)->where('exists', true)->where('willMerge', false); @endphp
Documents that will be attached

Merged into the end of each DSAR letter PDF, and attached to the email for institutions contacted by email.

@foreach($attachments as $attachment) @php $document = $attachment['document']; @endphp
$attachment['willMerge'], 'mdi-file-alert-outline text-warning' => $attachment['exists'] && !$attachment['willMerge'], 'mdi-file-remove-outline text-danger' => !$attachment['exists'], ]) style="font-size:1.4rem;">
{{ $attachment['type'] }} @unless($attachment['exists']) Not on file @elseif(!$attachment['willMerge']) Won't merge into the letter @endunless
@if($document)
{{ $document->display_name ?: $document->file_name }} · {{ $document->file_type ?: 'unknown type' }} {{-- file_size is cast to a formatted string (App\Casts\FileSize), so it is printed as-is rather than divided. --}} @if($document->getRawOriginal('file_size')) · {{ $document->file_size }} @endif · uploaded {{ $document->created_at?->format('d M Y') }}
@if(!$attachment['exists'])
Recorded against the client but the file is missing from storage, so the send will skip it.
@elseif(!$attachment['willMerge'])
Only PDFs and images can be merged into the letter. This still goes out as an email attachment, but posted letters won't include it.
@endif @else
No {{ $attachment['type'] }} has been uploaded for this client.
@endif
@if($document && $attachment['exists']) @endif
@endforeach @if($missing->isNotEmpty())
{{ $missing->pluck('type')->implode(' and ') }} {{ $missing->count() === 1 ? 'is' : 'are' }} not available, so {{ $missing->count() === 1 ? 'it' : 'they' }} won't be sent with this batch. Sending is still allowed — check with the file handler first if the institution requires authority before releasing records.
@elseif($unmergeable->isNotEmpty())
Some documents can't be merged into the posted letter — see above.
@endif
@endif
@foreach($tranche->dsars as $dsar) @endforeach
Tranche Status {{ ucfirst($tranche->status) }}
Approval Progress
{{ $tranche->dsars()->where('status', 'approved')->count() }} / {{ $tranche->dsars->count() }} Approved
@if($tranche->status === 'draft') @can('dsars.delete') @endcan @endif Save & Exit