@extends('admin.layouts.master-soyuz') @section('title', __('View Order :order |', ['order' => $order->order_id])) @section('body') @component('admin.component.breadcumb',['secondaryactive' => 'active']) @slot('heading'){{ __('Inhouse Orders') }}@endslot @slot('menu1'){{ __('View Order') }}@endslot @slot('button')
{{ __('Back') }} {{ __('Print') }}
@endslot @endcomponent @php $statusMap = [ 'processed' => ['bg' => '#dcfce7', 'fg' => '#16a34a', 'icon' => 'check-circle'], 'pending' => ['bg' => '#fef3c7', 'fg' => '#d97706', 'icon' => 'clock'], 'cancelled' => ['bg' => '#fee2e2', 'fg' => '#dc2626', 'icon' => 'x-circle'], 'shipped' => ['bg' => '#dbeafe', 'fg' => '#2952d3', 'icon' => 'truck'], 'delivered' => ['bg' => '#dcfce7', 'fg' => '#16a34a', 'icon' => 'check-circle'], ]; $st = $statusMap[$order->order_status] ?? ['bg' => '#f1f5f9', 'fg' => '#475569', 'icon' => 'circle']; $sym = ''; $sameState = optional($store->state)->id == optional($order->states)->id; @endphp
{{-- Hero --}}
{{ __('Invoice') }}

#{{ $order->order_id }}

{{ ucfirst(str_replace('_',' ',$order->order_status)) }}
{{ __('Grand Total') }}

{!! $sym !!} {{ sprintf('%.2f', $order['grand_total']) }}

{{ __('Paid via') }} {{ $order->payment_method }}
{{-- LEFT: Items + summary --}}
{{-- Items --}}
{{ __('Order Items') }}
@if(isset($order->orderItems) && count($order->orderItems)) @foreach($order->orderItems as $key => $item) @endforeach @else @endif
# {{ __('Product') }} {{ __('Price') }} {{ __('Qty') }} {{ __('Tax') }} {{ __('Subtotal') }}
{{ $key+1 }}
{{ $item['product_name'] }}
@if(!empty($item['origin']) && $item['origin'] !== '-') {{ __('Origin') }}: {{ $item['origin'] }} @endif
{!! $sym !!} {{ sprintf('%.2f', $item['product_price']) }} ×{{ $item['product_qty'] }} {!! $sym !!} {{ sprintf('%.2f', $item['product_tax']) }} {!! $sym !!} {{ sprintf('%.2f', $item['product_total']) }}
{{ __('No items in this order') }}
{{-- Notes --}} @if(!empty($order['additional_note']))
{{ __('Additional Note') }}
{!! $order['additional_note'] !!}
@endif {{-- Totals --}}
{{ __('Totals') }}
@php $rows = [ [__('Subtotal'), sprintf('%.2f', $order['subtotal']), false], [__('Tax').' ('.$order['tax_rate'].'%)', sprintf('%.2f', $order['total_tax']), false], ]; if (!$sameState) { $rows[] = [__('IGST').' ('.$order['tax_rate'].'%)', sprintf('%.2f', $order['total_tax']), false, true]; } else { $rows[] = [__('SGST').' ('.sprintf('%.2f',$order['tax_rate']/2).'%)', sprintf('%.2f', $order['total_tax']/2), false, true]; $rows[] = [__('CGST').' ('.sprintf('%.2f',$order['tax_rate']/2).'%)', sprintf('%.2f', $order['total_tax']/2), false, true]; } $rows[] = [__('Shipping'), sprintf('%.2f', $order['total_shipping']), false]; if ($order['adjustable_amount'] != 0) $rows[] = [__('Adjustment'), sprintf('%.2f', $order['adjustable_amount']), false]; @endphp @foreach($rows as $r)
{{ $r[0] }} {!! $sym !!} {{ $r[1] }}
@endforeach
{{ __('Grand Total') }} {!! $sym !!} {{ sprintf('%.2f', $order['grand_total']) }}
{{-- RIGHT: Customer + Store + Meta --}}
{{-- Customer --}}
{{ __('Customer') }}
{{ $order->customer_name ?: '—' }}
@if($order->customer_email) @endif @if($order->customer_phone) @endif
{{ __('Shipping Address') }}
{{ $order->customer_shipping_address }}
{{ optional($order->cities)->name }}{{ optional($order->cities)->name ? ', ' : '' }}{{ optional($order->states)->name }}{{ optional($order->states)->name ? ', ' : '' }}{{ optional($order->country)->nicename }} @if($order->customer_pincode)
{{ $order->customer_pincode }}@endif
{{-- Order meta --}}
{{ __('Order Details') }}
{{ __('Order ID') }} {{ $order->order_id }}
{{ __('Date') }} {{ date('d M Y', strtotime($order->invoice_date)) }}
{{ __('Payment') }} {{ $order->payment_method }}
@if($order->txn_id)
{{ __('TXN') }} {{ $order->txn_id }}
@endif
{{-- Store --}}
{{ __('From Store') }}
{{ $store->name }}
@if($store->address)
{{ $store->address }}
{{ optional($store->city)->name }}{{ optional($store->city)->name ? ', ' : '' }}{{ optional($store->state)->name }}{{ optional($store->state)->name ? ', ' : '' }}{{ optional($store->country)->nicename }} @if($store->pin_code)
{{ $store->pin_code }}@endif
@endif @if($store->mobile || $store->email)
@if($store->mobile)
{{ $store->mobile }}
@endif @if($store->email)
{{ $store->email }}
@endif @endif
@endsection