@extends('layouts.app') @section('title', 'Notifications') @section('content')
@include('settings._tabs')
Notifications

Email and SMS a Z report automatically every time a register is closed.

@if ($errors->any())
@endif
Z Report on Register Close

A short email with the totals, and the full report attached as a PDF: payments by method, cash drawer, products sold, profit and every sale in the shift.

@csrf
@if($latestRegister)
Latest register: #{{ $latestRegister->id }} · {{ $latestRegister->user->name ?? 'Unknown' }} · {{ $latestRegister->closed_at ? 'closed ' . $latestRegister->closed_at->format('M d, H:i') : 'still open' }} Preview report
@csrf
@endif
Register report for a day

Every register opened on the day you choose: each shift with its cash count, then the day's payments and products sold. Sent to the same people as the Z report, as a PDF.

@csrf
@error('date')
{{ $message }}
@enderror
Send To
@csrf
@forelse($recipients as $recipient) @empty @endforelse
{{ $recipient->email }}
{{ $recipient->name }} @if($recipient->is_default) Default (login email) @endif @if(!$recipient->is_active) Paused @endif
@csrf @method('PATCH')
@csrf @method('DELETE')
No emails added. Z reports will go to the login email of the cashier who closes the register.
Send by SMS
@if($phones->where('is_active', true)->isNotEmpty() && $latestRegister && $smsReady)
@csrf
@endif
@unless($smsReady)
SMS is not set up on this server yet (TUMASEND_API_KEY is missing in .env). Numbers can be added now and will receive texts once it is set.
@endunless @if($phones->isEmpty()) {{-- Prompt, like the email list starts with the login email --}}
Get the Z report on your phone
Add a phone number to receive a one-SMS summary (each payment method and the total sales) every time a register closes.
@if($suggestedPhone)
@csrf
@endif
@endif
@csrf
@forelse($phones as $phone) @empty @endforelse
{{ $phone->display_phone }}
{{ $phone->name }} @if(!$phone->is_active) Paused @endif
@csrf @method('PATCH')
@csrf @method('DELETE')
No phone numbers yet. Z reports are only emailed.

Each text uses SMS credits on TumaSend (1 credit per number per report).

Recently Sent
@if($logs->total() > 0)
@csrf @method('DELETE')
@endif
@forelse($logs as $log)
@if($log->type === 'daily_report') {{ $log->subject }} @else Register #{{ $log->register_id }} · {{ $log->register->user->name ?? '' }} @endif {{ ucfirst($log->status) }}
{{ $log->created_at->format('M d, Y H:i') }} · {{ $log->triggeredBy ? 'by ' . $log->triggeredBy->name : 'automatic' }}
To: {{ $log->recipients ?: '—' }}
@if($log->error)
{{ \Illuminate\Support\Str::limit($log->error, 200) }}
@endif
@empty

No Z reports sent yet.

@endforelse
{{ $logs->links() }}
@endsection