@extends('layouts.layoutMaster') @section('title', 'Sales Order Detail') @php $breadcrumbs = [ ['url' => route('dashboard'), 'label' => 'Dashboard'], ['url' => route('sales-order.index'), 'label' => 'Sales Order'], ['url' => route('sales-order.show', ['sales_order' => $model->id]), 'label' => $model->code], ]; @endphp @section('content')
Sales Order Details
@php $hasDeliveryOrder = \App\Models\DeliveryOrder::where('id_transaction', $model->id)->exists(); @endphp @if ($model->status === 'pending' && !$hasDeliveryOrder) @can('delivery-order.create') Make Delivery Order @endcan @can('sales-order.update') Edit @endcan @endif @can('delivery-order.show') @if ($hasDeliveryOrder) @php $deliveryOrder = \App\Models\DeliveryOrder::where('id_transaction', $model->id)->first(); @endphp View Delivery Order @endif @endcan
Basic Information
Sales Order Code {{ $model->code }}
Quotation @if ($model->parentTransaction) @can('delivery-order.show') {{ $model->parentTransaction->code }} @else {{ $model->parentTransaction->code }} @endcan @else - @endif
Status {{ strtoupper($model->status) }}
Invoice Date {{ $model->invoice_date?->format('d/m/Y') ?? '-' }}
Notes {{ $model->notes ?: '-' }}
Customer & Sales Information
Customer @if ($model->customer) @can('customer.show') {{ $model->customer->full_name }} @else {{ $model->customer->full_name }} @endcan @else - @endif
Customer Phone {{ $model->customer->phone ?? '-' }}
Sales Person {{ $model->sales->name ?? '-' }}
Sales Order Details
@forelse($model->details as $index => $detail) @empty @endforelse
No Origin Destination Loadout Quantity Price Driver Allowance Subtotal
{{ $index + 1 }} {{ $detail->origin_name ?? ($detail->origin->name ?? '-') }} {{ $detail->destination_name ?? ($detail->destination->name ?? '-') }} {{ $detail->loadout->name ?? '-' }} {{ \App\Helpers\Helpers::formatNumber($detail->quantity) }} {{ \App\Helpers\Helpers::formatCurrency($detail->price ?: 0, 2) }} @php $totalAllowance = ($detail->pocket_money_1 ?: 0) + ($detail->pocket_money_2 ?: 0) + ($detail->pocket_money_3 ?: 0) + ($detail->bonus ?: 0); @endphp {{ \App\Helpers\Helpers::formatCurrency($detail->sub_total ?: 0, 2) }}
No details available
Financial Summary
@if ($model->ppn > 0) @endif @if ($model->pph > 0) @endif
Subtotal {{ \App\Helpers\Helpers::formatCurrency($model->total ?: 0, 2) }}
PPN (VAT) {{ $model->ppn_percentage ? '(' . $model->ppn_percentage . '%)' : '' }} {{ \App\Helpers\Helpers::formatCurrency($model->ppn ?: 0, 2) }}
PPh (Income Tax) {{ $model->pph_percentage ? '(' . $model->pph_percentage . '%)' : '' }} - {{ \App\Helpers\Helpers::formatCurrency($model->pph ?: 0, 2) }}
Discount - {{ \App\Helpers\Helpers::formatCurrency($model->discount ?: 0, 2) }}
Grand Total {{ \App\Helpers\Helpers::formatCurrency($model->grand_total ?: 0, 2) }}
Created: {{ $model->created_at?->format('d/m/Y H:i') ?? '-' }} @if ($model->createdBy) by {{ $model->createdBy->name }} @endif
Last Updated: {{ $model->updated_at?->format('d/m/Y H:i') ?? '-' }} @if ($model->updatedBy) by {{ $model->updatedBy->name }} @endif
@endsection @section('page-script') @endsection