@extends('layouts.app') @section('title', 'Accountant Report') @section('content')

Accountant Report

Settings
@php $chartFilterBits = []; if ($onlyNoTax) { $chartFilterBits[] = 'no-tax only'; } else { $chartFilterBits[] = 'all sales'; } if ($hideFlNoTax) { $chartFilterBits[] = 'FL no-tax hidden'; } if ($hideTest) { $chartFilterBits[] = 'tests hidden'; } @endphp

Sales by month · {{ $filter['year'] }}

{{ implode(' · ', $chartFilterBits) }}

Year total ${{ number_format($yearTotalAmount, 2) }}
Sales {{ $yearTotalCount }}
{{ $filter['label'] }} ${{ number_format((float) $transactions->sum('amount'), 2) }}
@foreach($yearSeries as $point) @endforeach
Month Sales Amount
{{ $point['label_full'] }} {{ $point['count'] }} ${{ number_format($point['amount'], 2) }}
Table rows {{ $transactions->count() }} {{ $filter['label'] }}
Accountant {{ $settings->accountantEmail() }} Auto-send: {{ $settings->isAutoSendEnabled() ? 'ON (day ' . $autoSendDay . ')' : 'OFF' }}
Last email to accountant @if($settings->hasLastSentReport())

{{ $settings->lastSentAtDisplay() }}

{{ $settings->lastSentModeLabel() }} · to {{ $settings->last_sent_to }} · report for {{ $settings->last_sent_month_label }} · {{ (int) $settings->last_sent_row_count }} row(s) · ${{ number_format((float) $settings->last_sent_total_amount, 2) }} @if($lastSend) · status {{ $lastSend->statusLabel() }} @if($lastSend->delivered_at) · delivered {{ $lastSend->deliveredAtDisplay() }} @endif @if($lastSend->opened_at) · opened {{ $lastSend->openedAtDisplay() }} @endif @if($lastSend->hasIncompleteInvoices()) · invoices {{ (int) $lastSend->invoices_included }}/{{ (int) $lastSend->invoices_expected }} @endif @endif

@else

Not sent yet

After you email a report (manual or automatic), the date/time, delivery status, PDF, and CSV appear here.

@endif
@if($settings->hasLastSentPdfFile()) View last PDF @elseif($settings->hasLastSentReport()) PDF archive missing @endif @if($settings->hasLastSentCsvFile()) Last CSV @endif
@if($recentSends->isNotEmpty())

Send history

PDF + CSV archives by month · delivery/open from Brevo + open pixel

@foreach($recentSends as $send) @endforeach
When Month Mode Status Rows Amount Invoices Files
{{ $send->sentAtDisplay() }} {{ $send->month_label }} {{ $send->modeLabel() }} {{ $send->statusLabel() }} @if($send->status === \App\Models\AccountantReportSend::STATUS_FAILED && $send->error_message)
{{ \Illuminate\Support\Str::limit($send->error_message, 80) }}
@endif @if($send->opened_at)
Opened {{ $send->openedAtDisplay() }}
@elseif($send->delivered_at)
Delivered {{ $send->deliveredAtDisplay() }}
@endif
{{ (int) $send->row_count }} ${{ number_format((float) $send->total_amount, 2) }} {{ (int) $send->invoices_included }}/{{ (int) $send->invoices_expected }} @if($send->hasIncompleteInvoices() && is_array($send->invoices_missing) && count($send->invoices_missing))
missing
@endif
@if($send->pdfAbsolutePath()) PDF @else — @endif · @if($send->csvAbsolutePath()) CSV @else — @endif
@endif
Export PDF Export CSV
@csrf
@forelse($transactions as $row) @empty @endforelse
Date Source Name Shopify order NMI txn Amount City State Tax Invoice / Receipt
{{ $row['occurred_at_display'] }} {{ $row['source_label'] }}
{{ $row['source_detail'] }}
@if(!empty($row['is_test']))
Test
@endif
{{ $row['customer_name'] }} {{ !empty($row['shopify_order_ref']) ? $row['shopify_order_ref'] : '—' }} {{ !empty($row['nmi_transaction_id']) ? $row['nmi_transaction_id'] : '—' }} ${{ number_format($row['amount'], 2) }} @if($row['is_partial_refund'])
Partial refund −${{ number_format($row['refunded_amount'], 2) }} · original ${{ number_format((float) $row['amount'] + (float) $row['refunded_amount'], 2) }}
@endif
{{ $row['city'] }} {{ $row['state'] }} @if($row['has_tax']) ${{ number_format($row['tax_amount'], 2) }} @else No tax @endif @if(!empty($row['invoice_url'])) {{ $row['invoice_label'] }} @else {{ $row['invoice_label'] }} @endif
@if($summary['total_count'] === 0) No reportable paid transactions for {{ $filter['label'] }}. Use Setting → Accountant Report → Run year-to-date sync, or wait for the hourly auto-sync. @elseif($onlyNoTax && $summary['no_tax_count'] === 0) No no-tax sales in {{ $filter['label'] }}. This month has {{ $summary['total_count'] }} reportable sale(s), all with tax collected. Uncheck “Only no-tax” to see them. @elseif($onlyNoTax && $hideFlNoTax && $summary['no_tax_count'] > 0 && $summary['no_tax_count'] === $summary['no_tax_florida_count'] && $summary['no_tax_test_count'] === 0) All {{ $summary['no_tax_florida_count'] }} no-tax sale(s) in {{ $filter['label'] }} are Florida no-tax (billing errors) and are hidden. Uncheck “Hide Florida no-tax” to view them — they are never emailed to the accountant. @elseif($onlyNoTax && $hideTest && $summary['no_tax_count'] > 0 && $summary['no_tax_count'] === $summary['no_tax_test_count']) {{ $summary['no_tax_test_count'] }} no-tax row(s) in {{ $filter['label'] }} are test orders ({{ $testEmail }} / {{ $testPhone }}) and are hidden. Uncheck “Hide test orders” to view them — they are never emailed to the accountant. @elseif($hideTest && $summary['test_count'] === $summary['total_count']) All {{ $summary['total_count'] }} sale(s) in {{ $filter['label'] }} are test orders and are hidden. Uncheck “Hide test orders” to view them. @else No rows match the current filters for {{ $filter['label'] }}. @if($onlyNoTax && $hideFlNoTax && ($summary['no_tax_florida_count'] ?? 0) > 0) ({{ $summary['no_tax_florida_count'] }} Florida no-tax billing error(s) are hidden.) @endif @endif
@endsection @push('styles') @endpush @push('scripts') @endpush