@extends('layouts.app')
@section('title', 'Service Details')
@section('content')
{{-- ══════════════════════════════════════════════ PAGE HEADER ══════════════════════════════════════════════ --}}
{{-- Toast container --}}
@if(session('success'))
@endif
@if(session('error'))
{{ session('error') }}
@endif
{{-- ══════════════════════════════════════════════ CARDS GRID ══════════════════════════════════════════════ --}}
{{-- Iperium Submission --}}
- Submitted to Iperium
-
@if($order->submitted_to_iperium)
Yes
@else
No
@endif
@if($order->iperium_service_id)
- Iperium Service ID
- {{ $order->iperium_service_id }}
@endif
@if($order->iperium_uuid)
- Iperium UUID
{{ $order->iperium_uuid }}
@endif
@php
$apiError = $order->iperium_api_error;
$apiErrorDisplay = '';
if ($apiError) {
$decoded = is_string($apiError) ? json_decode($apiError, true) : $apiError;
$msg = is_array($decoded) ? ($decoded['message'] ?? $decoded['exception'] ?? '') : '';
$bodyRaw = is_array($decoded) ? ($decoded['body_raw'] ?? '') : '';
$httpStatus = is_array($decoded) ? ($decoded['http_status'] ?? null) : null;
if ($msg !== '') { $apiErrorDisplay = $msg; }
elseif ($bodyRaw !== '') { $apiErrorDisplay = $bodyRaw; }
elseif ($httpStatus !== null) { $apiErrorDisplay = 'HTTP ' . $httpStatus . ' – no response body from Iperium (check request payload or Iperium API).'; }
else { $apiErrorDisplay = $apiError; }
}
$showErrorRow = $apiError && !$order->submitted_to_iperium;
@endphp
- Error Logs
- {{ $apiErrorDisplay }}
{{-- Customer Details --}}
- Customer Type
- {{ $order->customer_type }}
- Current Provider
- {{ $order->current_provider ?? '—' }}
- Full Name
-
{{ $order->site_contact_name ?? '—' }}
- Contact Number
-
{{ $order->site_contact_number ?? '—' }}
- Email Address
-
{{ $order->site_contact_email ?? '—' }}
- Date of Birth
- {{ $order->date_of_birth ? \Carbon\Carbon::parse($order->date_of_birth)->format('d/m/Y') : '—' }}
- ABN
- {{ $order->abn ?? '—' }}
- Registered Company Name
- {{ $order->registered_company_name ?? '—' }}
@if($order->service_type === 'nbn')
- AVC ID
-
{{ $order->avc_id ?? '—' }}
@endif
{{-- Order & References --}}
- Service Activation
-
{{ $order->asap ? 'As Soon As Possible' : ($order->service_activation_date ? \Carbon\Carbon::parse($order->service_activation_date)->format('d/m/Y') : '—') }}
@if(!$order->asap)
@endif
- Address
- {{ $order->service_address_display ?? '—' }}
- LOC
- {{ $order->loc ?? '—' }}
- SQ UID
- {{ $order->sq_uid ?? '—' }}
- Router Add-on
-
@if($order->router_status)
Included
@else
Not Included
@endif
{{-- NBN / Technical --}}
- NTD ID
- {{ $order->ntd_id ?? '—' }}
- Port
- {{ $order->port ?? '—' }}
- Copper pair id
- {{ $order->copper_pair_id ?? '—' }}
{{-- Product --}}
- Product
- {{ $order->product_display_name }}
- Product Price
- {{ $order->product_price !== null ? '$' . number_format($order->product_price, 2) : '—' }}{{ $order->isSubscription() ? ' / month' : '' }}
- Payment Type
- {{ $order->payment_type === 'subscription' ? 'Subscription' : 'One-time' }}
{{-- Subscription & Billing --}}
@if($order->isSubscription())
- Stripe Customer ID
{{ $order->stripe_customer_id ?? '—' }}
- Stripe Subscription ID
{{ $order->stripe_subscription_id ?? '—' }}
- Current Status
- {{ $subscription ? ucfirst($subscription->status) : ($order->payment_status ?? '—') }}
- Next Billing Date
- {{ $order->next_billing_date ? $order->next_billing_date->format('d/m/Y') : '—' }}
@if($order->payment_failure_reason)
- Failed Payment Reason
- {{ $order->payment_failure_reason }}
@endif
@if($subscription && !$subscription->cancel_at_period_end)
- Actions
-
@endif
{{-- Subscription History --}}
@if(isset($invoiceHistory) && $invoiceHistory->count())
Invoices and payments for this subscription only.
| Date |
Type |
Amount |
Status |
Link |
@foreach($invoiceHistory as $ph)
| {{ $ph->created_at->format('d/m/Y') }} |
{{ ucfirst(str_replace('_', ' ', $ph->type)) }} |
{{ $ph->formatted_amount }} {{ strtoupper($ph->currency) }} |
{{ ucfirst($ph->status) }}
|
@if($ph->invoice_hosted_url)View →@else —@endif |
@endforeach
@elseif($subscription)
No subscription invoices or payments recorded yet for this order.
@endif
@endif
{{-- Router Add-on Details --}}
@if($order->router_status)
Router shipping fee and payment details for this order.
{{-- Router Payment History --}}
@if(isset($paymentHistories) && $paymentHistories->where('order_id', $order->id)->where('type', 'router_charge')->count() > 0)
| Date |
Type |
Amount |
Status |
Link |
@foreach($paymentHistories->where('order_id', $order->id)->where('type', 'router_charge') as $routerPayment)
| {{ $routerPayment->created_at->format('d/m/Y') }} |
{{ ucfirst(str_replace('_', ' ', $routerPayment->type)) }} |
@if($routerPayment->amount < 1000)
{{-- If amount is less than 1000, it's likely stored in dollars, convert to cents --}}
${{ number_format($routerPayment->amount, 2) }} {{ strtoupper($routerPayment->currency) }}
@else
{{-- Normal cents to dollars conversion --}}
{{ $routerPayment->formatted_amount }} {{ strtoupper($routerPayment->currency) }}
@endif
|
{{ ucfirst($routerPayment->status) }}
|
View →
|
@endforeach
@else
No router payment history found
@endif
@endif
{{-- Service Details --}}
@if($order->nbn_service_profile || $order->ipv4_allocation)
- NBN Service Profile
- {{ $order->nbn_service_profile ?? '—' }}
- IPv4 Allocation
- {{ $order->ipv4_allocation ?? '—' }}
@endif
{{-- PPPoE Authentication --}}
{{-- Notes & Activity log --}}
@php
$serviceNotes = $serviceNotes ?? collect();
@endphp
Automatic entries are private (admin only). Tick Public if the customer should see the note on their service page.
Activity
@forelse($serviceNotes as $note)
@php
$mod = $note->source === \App\Models\OrderServiceNote::SOURCE_STATUS_CHANGE ? 'status' : ($note->source === \App\Models\OrderServiceNote::SOURCE_IPERIUM_SYNC ? 'sync' : 'manual');
@endphp
{{ $note->created_at->format('d-m-Y | h:i:s A') }}
{{ $note->is_private ? 'Private' : 'Public' }}
@if($note->is_high_priority)High priority@endif
{{ $note->source === \App\Models\OrderServiceNote::SOURCE_IPERIUM_SYNC ? 'Iperium sync' : ($note->source === \App\Models\OrderServiceNote::SOURCE_STATUS_CHANGE ? 'Status update' : ($note->author?->name ?? 'Admin')) }}
{!! nl2br(e($note->body)) !!}
@empty
No notes yet. Status changes and Iperium syncs will appear here automatically.
@endforelse
{{-- /sd-grid --}}
{{-- /sd-page --}}
{{-- ══════════════════════════════════════════════ MODALS ══════════════════════════════════════════════ --}}
@php
$modals = [
['id' => 'site-contact-name-modal', 'title' => 'Edit Site Contact Name', 'input_id' => 'site-contact-name-input', 'type' => 'text', 'label' => 'Name', 'placeholder' => 'Site contact name', 'update_id' => 'site-contact-name-update-btn'],
['id' => 'site-contact-phone-modal', 'title' => 'Edit Site Contact Phone', 'input_id' => 'site-contact-phone-input', 'type' => 'text', 'label' => 'Phone', 'placeholder' => 'Site contact phone', 'update_id' => 'site-contact-phone-update-btn'],
['id' => 'site-contact-email-modal', 'title' => 'Edit Site Contact Email', 'input_id' => 'site-contact-email-input', 'type' => 'email', 'label' => 'Email', 'placeholder' => 'Site contact email', 'update_id' => 'site-contact-email-update-btn'],
['id' => 'order-reference-modal', 'title' => 'Edit Order Reference', 'input_id' => 'order-reference-input', 'type' => 'text', 'label' => 'Order Reference', 'placeholder' => 'Order reference', 'update_id' => 'order-reference-update-btn'],
['id' => 'customer-name-modal', 'title' => 'Edit Customer Name', 'input_id' => 'customer-name-input', 'type' => 'text', 'label' => 'Customer Name', 'placeholder' => 'Customer name', 'update_id' => 'customer-name-update-btn'],
];
@endphp
@foreach($modals as $modal)