@extends('Admin.layout') @section('content')
{{-- Card Header --}}
Bulk Order Bill Details
Order #{{ $order->order_id }} @if($order->daily_serial_number) • Serial: #{{ $order->daily_serial_number }} @endif • Branch: {{ $order->branch->branch_name ?? 'Branch' }}
{{-- Cancellation Banner if Cancelled --}} @if($order->status === 'cancelled')
This Bulk Order is Cancelled

Reason: {{ $order->cancel_remark ?: 'No remark provided' }}

@endif {{-- Meta Info Grid --}}
Branch {{ $order->branch->branch_name ?? '-' }}
Order ID {{ $order->order_id }}
Serial Number {{ $order->daily_serial_number ?: '-' }}
Customer {{ $order->customer_name ?: '-' }}
Phone {{ $order->customer_phone ?: '-' }}
Delivery Date & Time {{ $order->delivery_date ? \Carbon\Carbon::parse($order->delivery_date)->format('d-m-Y h:i A') : '-' }}
@if($order->note)
Order Note {{ $order->note }}
@endif
Sold By {{ $order->staff->name ?? '-' }}
Status @if($order->status === 'completed') Completed & Fully Paid @elseif($order->status === 'cancelled') Cancelled @elseif($order->status === 'partially_paid' || $order->status === 'advance_paid') Pending (Advance Paid) @else Pending @endif
{{-- Products Table --}}
Ordered Products
{{ count($order->details) }} Items
# Product Details Product Code Rate (₹) Quantity Tax Total Amount (₹)
{{-- Lower Split: Payment History & Financial Breakdown --}}
{{-- Payment Timeline --}}
Payment Record & History
@php $history = is_array($order->payment_history) ? $order->payment_history : []; @endphp @if(count($history) > 0)
@foreach($history as $pay)
{{ ucfirst($pay['payment_mode'] ?? 'Cash') }} ₹ {{ number_format($pay['amount'] ?? 0, 2) }}
{{ ucfirst(str_replace('_', ' ', $pay['type'] ?? 'Payment')) }} {{ isset($pay['date']) ? \Carbon\Carbon::parse($pay['date'])->format('d-m-Y h:i A') : '-' }}
@if(!empty($pay['note'])) Note: {{ $pay['note'] }} @endif
@endforeach
@else
Initial advance paid via {{ ucfirst($order->payment_mode ?? 'cash') }}: ₹ {{ number_format($order->advance_amt, 2) }}
@endif
{{-- Totals Summary --}}
Subtotal ₹ {{ number_format($order->subtotal, 2) }}
@if((float) $order->gst > 0)
GST + ₹ {{ number_format($order->gst, 2) }}
@endif @if((float) $order->charge > 0)
Extra / Delivery Charges + ₹ {{ number_format($order->charge, 2) }}
@endif @if((float) $order->discount > 0)
Discount - ₹ {{ number_format($order->discount, 2) }}
@endif
Grand Total ₹ {{ number_format($order->total, 2) }}
Advance Paid ₹ {{ number_format($order->advance_amt, 2) }}
Balance Due ₹ {{ number_format($order->balance_amt, 2) }}
{{-- DataTables Script --}} @endsection