{{-- Light-mode colors match the original Meyer-style markup; .dark overrides keep every text/background legible in dark mode (Filament toggles the `dark` class on ). --}}
@if($sandboxMode)
SANDBOX MODE — POs are pushed to the PAMS test database. Go-Parts Ship orders are created for real. Swap PAMS_B2B_API_KEY for the pams_live_* key to go live.
@endif {{-- Tab bar --}}
{{-- ==================== AUTO-LABEL TAB ==================== --}} @if($activeTab === 'autolabel') @php $s = $this->autoLabelStats; $problems = $this->labelProblems; @endphp
{{-- Needs attention, first: these are the orders that have stopped and will not move until somebody does something. --}} @if($problems->isNotEmpty())
Needs attention {{ $problems->count() }}
Orders where the label pipeline stopped. Each shows what will actually clear it.
@foreach($problems as $p) @php $r = $p->row; @endphp @endforeach
Work Order PO Part Status What happened Action
{{ $r->pams_work_order ?: '-' }} {{ $r->external_order_id }} {{ $r->part_num }}
inv {{ $r->pams_inventory_id }}
{{ $r->gps_status === \App\Models\PamsOrder::GPS_FLAG_MISMATCH ? 'Flags disagree' : $r->status_label }} {{ $p->error ?: '—' }}
{{ $p->how }}
@if($p->action === 'retry') @elseif($p->action === 'email') {{-- Retry is deliberately not offered: PAMS state it cannot succeed. The only thing that clears this is PAMS acting on their side. --}} pams_work_order . " (PO " . $r->external_order_id . ", inventory " . $r->pams_inventory_id . ") is rejected with:\n\n labels[0] inventoryId is not on this work order.\n\nPer the DWT addendum §6 this cannot be retried. Please attach the label on your side so the order is not held up.\n\nThanks,\nGo-Parts") }}" class="pf-btn-secondary" style="text-decoration:none;display:inline-block;">Email PAMS @else Ask PAMS @endif
@endif {{-- Dimension coverage. The number that matters: how often PAMS fails to send dimensions, forcing a fallback to Go-Parts Ship's own figures and putting us back to under-declaring. --}}
PAMS dimension coverage — since {{ $s['coverage_from']->format('d M Y') }} (from when PAMS enabled the opt-in)
{{ $s['dims_pct'] === null ? '—' : $s['dims_pct'].'%' }}
arrived with dimensions
{{ $s['dims_with'] }}
of {{ $s['dims_total'] }} orders pushed
{{ $s['dims_without'] }}
came WITHOUT dimensions
{{ $s['bought_on_gps_dims'] }}
labels bought on GPS fallback dims
@if($s['dims_without'] > 0)
Breakdown — no lineItems in the response: {{ $s['dims_none'] }}, PAMS holds no record (null): {{ $s['dims_null'] }}, returned but failed our sanity bounds: {{ $s['dims_suspect'] }}.
@endif
{{-- Spend + what the two-provider rate shop is actually saving. --}}
Automated labels — last 30 days
{{ $s['bought'] }}
bought
${{ number_format($s['spend'], 2) }}
postage spend
${{ number_format($s['saved'], 2) }}
saved vs 2nd best
${{ $s['bought'] > 0 ? number_format($s['spend'] / $s['bought'], 2) : '0.00' }}
average per label
{{ $s['failed'] }}
failed
{{-- Every attempt, dry runs included, with the quotes it considered. --}}
Attempts {{ $this->autoLabelFilteredCount }} row{{ $this->autoLabelFilteredCount === 1 ? '' : 's' }} @if($alStatus !== '' || $alProvider !== '' || $alDims !== '') (filtered) @endif
{{-- Filters. All three narrow the same query the export uses, so the CSV always matches what is on screen. --}}
@if($alStatus !== '' || $alProvider !== '' || $alDims !== '') @endif
@forelse($this->autoLabelAttempts as $a) @php $se = $a->bestFor('shipengine'); $vq = $a->bestFor('veeqo'); @endphp {{-- Each provider's best quote. The one that was bought is marked; a provider that returned nothing says so, which is different from losing on price. --}} @empty @endforelse
When Order ID Work Order Status Package Dims ShipEngine Veeqo Why this rate Saved Tracking
{{ $a->created_at?->format('d M H:i') }} {{ $a->external_order_id }} {{ $a->pams_work_order ?: '-' }} {{ $a->status_label }} {{ $a->package_label }} @if($a->dimension_source === 'pams') PAMS @else NO PAMS DIMS @endif @if($se) ${{ number_format((float) $se['cost'], 2) }}@if($a->wonBy('shipengine')) ✓@endif
{{ $se['service'] ?? '' }}
@else no quote @endif
@if($vq) ${{ number_format((float) $vq['cost'], 2) }}@if($a->wonBy('veeqo')) ✓@endif
{{ $vq['service'] ?? '' }}
@else no quote @endif
{{ $a->choice_reason }} @if(count($a->decodedQuotes()) > 2)
{{ count($a->decodedQuotes()) }} quotes considered
@endif
{{ $a->saving === null ? '-' : '$'.number_format($a->saving, 2) }} {{ $a->tracking_number ?: '-' }} @if($a->error)
{{ \Illuminate\Support\Str::limit($a->error, 90) }}
@endif
No automated label attempts yet.
@endif {{-- ==================== IMPORT TAB ==================== --}} @if($activeTab === 'import')
{{-- Upload card --}}
File Upload

Upload limits: {{ ini_get('upload_max_filesize') }} / {{ ini_get('post_max_size') }}

@if(!empty($importSummary))

Import Summary

{{ $importSummary['total_rows'] }} rows · {{ $importSummary['imported'] }} imported · {{ $importSummary['skipped'] }} skipped · {{ $importSummary['errors'] }} errors

@endif @if(!empty($importMessages))

Messages ({{ count($importMessages) }})

@foreach(array_slice($importMessages, 0, 10) as $msg)

{{ $msg }}

@endforeach @if(count($importMessages) > 10)

... and {{ count($importMessages) - 10 }} more

@endif
@endif
{{-- Help card --}}
CSV Format & Flow

Upload the PAMS fulfillment export (the same CSV the Order Fulfillment page generates). Items are matched to PAMS (supplier 74) order lines.

Required

Order # Matches by external order ID

Item matching columns

@foreach(['Partslink #', 'Supplier Part #', 'Supplier'] as $col) {{ $col }} @endforeach

After import, the cron (every 15 min):

1. Pushes the PO to PAMS → work order created

2. Creates the Go-Parts Ship order (same as the Ship button) — PAMS prints labels there

HAZMAT parts (airbags / seat belts) get the PO push only — PAMS does the shipping.

Use the Buy Price export — its prices/address are what gets pushed to PAMS.

@endif {{-- ==================== VIEW TAB ==================== --}} @if($activeTab === 'view')
{{-- Filters --}}
{{-- Table --}}
@forelse($this->pamsOrders as $order) {{-- Did PAMS give us this part's dimensions? Only meaningful once the PO has actually been pushed — before that there has been no response to carry them. --}} @empty @endforelse
Ext. Order ID Item ID Part # Inv. ID Ticket Price WO # Dims Status GPS Error Created
{{ $order->external_order_id }} {{ $order->item_id }} {{ $order->part_num }} @if($order->is_hazmat) HAZMAT @endif {{ $order->pams_inventory_id }} {{ $order->stock_ticket_number ?: '-' }} {{ $order->unit_price !== null ? '$' . number_format($order->unit_price, 2) : '-' }} {{ $order->pams_work_order ?: '-' }} @if($order->processed < \App\Models\PamsOrder::STATUS_ORDERED) @elseif($order->pams_dims_status === \App\Models\PamsOrder::DIMS_OK) {{ $order->pams_length_in }}x{{ $order->pams_width_in }}x{{ $order->pams_height_in }} @else NO DIMS @endif @php $statusStyles = [ -1 => 'background:#fef2f2;color:#991b1b;border:1px solid #fecaca;', 0 => 'background:#fffbeb;color:#92400e;border:1px solid #fde68a;', 1 => 'background:#eff6ff;color:#1e40af;border:1px solid #bfdbfe;', 2 => 'background:#f0fdf4;color:#166534;border:1px solid #bbf7d0;', 3 => 'background:#f5f3ff;color:#5b21b6;border:1px solid #ddd6fe;', 4 => 'background:#f3f4f6;color:#374151;border:1px solid #d1d5db;', // Blocked — PAMS: needs a person to email PAMS, so it is // styled as an alert rather than a neutral end state. 5 => 'background:#fff7ed;color:#9a3412;border:1px solid #fed7aa;', ]; @endphp {{ $order->status_label }} @php $gpsStyles = [ 0 => 'background:#fffbeb;color:#92400e;border:1px solid #fde68a;', 1 => 'background:#f0fdf4;color:#166534;border:1px solid #bbf7d0;', 2 => 'background:#fef2f2;color:#991b1b;border:1px solid #fecaca;', 3 => 'background:#f3f4f6;color:#374151;border:1px solid #d1d5db;', // Held — PAMS flags disagree: needs a person to reconcile // how the part ships before anything is labelled. 4 => 'background:#fff7ed;color:#9a3412;border:1px solid #fed7aa;', ]; @endphp {{ $order->gps_label }} {{ $order->pams_error ?: '-' }} {{ $order->created_at ? $order->created_at->format('m/d/Y') : '-' }} @if($order->canRetry()) @endif
No orders found
{{-- Pagination --}} @if($this->pamsOrders && method_exists($this->pamsOrders, 'hasPages') && $this->pamsOrders->hasPages())
{{ $this->pamsOrders->links() }}
@endif
@endif