@extends('layouts.app') @section('title', 'Additional Charge') @push('styles') @include('wuser.partials.delivery-badge-styles') @endpush @section('content')
@php $chargeShipments = $payment->warehousePaymentShipments->map->shipment->filter()->unique('id')->values(); $firstShipment = $chargeShipments->first(); $virtualAddress = optional($firstShipment)->virtualAddress; $paymentDetails = method_exists($payment, 'getPaymentDetailsArray') ? $payment->getPaymentDetailsArray() : []; $paidVia = strtolower((string) (($paymentDetails['paid_via'] ?? null) ?: ($payment->payment_method ?? ''))); $viewIsPaid = in_array($payment->payment_status, ['success', 'completed', 'paid', 'payment_processed'], true); $paymentFigures = $payment->shippingFigures(); $latestTrackingStatus = $payment->latestTrackingStatus; $trackingRows = $payment->trackingStatuses()->orderBy('status_date')->orderBy('id')->get(); @endphp
Consolidation & Freight
Additional charge
Back to payments
@if($virtualAddress)
@include('wuser.partials.delivery-badges', ['badges' => $virtualAddress->deliveryBadges(), 'inline' => true, 'suiteLine' => $firstShipment->suite_number ?: ($payment->suite_number ?? '')])
@endif
@csrf
Payment {{ $payment->tracking_number ?: ('#' . $payment->id) }} @if($viewIsPaid && in_array($paidVia, ['upi', 'cash'], true)) Paid · {{ strtoupper($paidVia) }} @elseif($viewIsPaid) Paid @elseif($payment->payment_status === 'failed') Failed @else {{ ucfirst($payment->payment_status ?? 'pending') }} @endif @if($latestTrackingStatus) {{ $latestTrackingStatus->display_status }} @endif {{ $payment->kuser->name ?? 'N/A' }} @if($paymentFigures['notax'] !== null) Shipping ₹{{ number_format((float) $paymentFigures['notax'], 2) }} GST ₹{{ number_format((float) $paymentFigures['gst'], 2) }} @endif Total amount ₹{{ number_format((float) ($paymentFigures['shipping'] ?? $payment->amount), 2) }}

Shipments ({{ $chargeShipments->count() }})

@include('wuser.payments.partials.shipment-summary-cards', ['shipments' => $chargeShipments])
@include('wuser.payments.partials.shipment-photo-rail', [ 'photoShipments' => $chargeShipments, 'galleryId' => 'chargePhoto', 'photoTitle' => $chargeShipments->count().' shipment(s)', ])
@php $originalServices = $payment->services()->orderBy('created_at', 'desc')->get(); $additionalServices = $payment->additionalServices()->orderBy('created_at', 'desc')->get(); $previousRows = $originalServices->concat($additionalServices); @endphp @include('wuser.payments.partials.service-summary-card', ['serviceRows' => $previousRows, 'serviceTitle' => 'Additional services'])

Additional Services for This Payment

Service Type Service Details Amount (₹)
Total additional amount
@if($trackingRows->count() > 0)

Tracking flow

@foreach($trackingRows as $index => $status)
{{ $status->display_status }}

{{ $status->description }}

@if($status->status_date) {{ $status->status_date->format('d-m-Y H:i') }} {{ ($status->status_updated_type === 'mms') ? 'Maldives Time' : 'Indian Standard Time' }} @endif
@endforeach
@endif @if($payment->additionalAmounts->count() > 0)

Previous Additional Charges

@foreach($payment->additionalAmounts as $add) @endforeach
Date Amount (₹) Services Count Reason
{{ $add->created_at->format('M d, Y H:i') }} ₹ {{ number_format($add->additional_amount, 2) }} {{ $add->services_count }} {{ $add->reason ?? '-' }}
@endif

Payment Gateway

@if($paymentConfig && $paymentConfig->is_active)
Active Payment Provider: {{ $paymentConfig->provider_name }} ({{ ucfirst($paymentConfig->provider) }})
Payment link for this additional charge will be generated via {{ $paymentConfig->provider_name }}, same as the main shipment payment flow.
@else
No active shipping cost payment configuration found. Please configure payment settings in admin before initiating additional charge.
@endif
@endsection @push('scripts') @endpush