@extends('layouts.app') @section('title', 'Etsy shop') @section('content')

Sales

{{ $connection?->shop_name ?? 'Connect your Etsy shop' }}

Paid orders awaiting dispatch and listings by state.

@if($configured)
@csrf
@elseSet up Etsy@endif
@if(! $configured)@endif @if($stateError)@endif @if($pageError)@endif @if($receiptsError)@endif @if($listingsError)@endif @if($connection)

Awaiting dispatch

{{ count($receipts) }}

{{ ucfirst($state === 'active' ? 'Live' : 'Draft') }} listings total

{{ $listingCount }}

Orders to dispatch

@forelse($receipts as $receipt)@empty@endforelse
ReceiptBuyerPlacedTotal
#{{ $receipt['receipt_id'] ?? 'โ€”' }}{{ $receipt['name'] ?? $receipt['buyer_email'] ?? 'Buyer' }}{{ isset($receipt['create_timestamp']) ? \Illuminate\Support\Carbon::createFromTimestamp($receipt['create_timestamp'])->format('d M Y') : 'โ€”' }}{{ isset($receipt['grandtotal']['amount']) ? ($receipt['grandtotal']['currency_code'] ?? 'GBP').' '.number_format((float) $receipt['grandtotal']['amount'] / max(1, (int) ($receipt['grandtotal']['divisor'] ?? 100)), 2) : 'โ€”' }}
No paid orders awaiting dispatch.

Listings

@php $snapshotAge = is_array($listingSnapshot ?? null) && ! empty($listingSnapshot['fetched_at']) ? \Illuminate\Support\Carbon::createFromTimestamp($listingSnapshot['fetched_at'])->diffForHumans() : null; $snapshotStale = is_array($listingSnapshot ?? null) && ! empty($listingSnapshot['stale']); @endphp

Showing {{ count($listings) }} of {{ $listingCount }} {{ $state === 'active' ? 'live' : 'draft' }} listings.{{ $snapshotAge ? ' Snapshot '.$snapshotAge.($snapshotStale ? ' ยท cached after a failed refresh, not asserted live' : '').'.' : '' }}

@forelse($listings as $listing)
{{ $listing['title'] ?? 'Untitled listing' }}{{ $listing['quantity'] ?? 0 }} available
@empty

No {{ $state === 'active' ? 'live' : 'draft' }} listings returned.

@endforelse
@if($listingCount > $perPage || $page > 1) @endif
@endif @endsection