@extends('layouts.app') @section('title', 'Delivery Challan Details') @section('content')

{{ $deliveryChallan->challan_number }}

@if($deliveryChallan->status == 'draft') Edit
@csrf
@endif @if($deliveryChallan->status == 'open') @endif @if($deliveryChallan->status == 'delivered')
@csrf
@endif
Item Details
@php $badgeClass = [ 'draft' => 'bg-light-secondary text-secondary', 'open' => 'bg-light-info text-info', 'delivered' => 'bg-light-success text-success', 'returned' => 'bg-light-danger text-danger' ][$deliveryChallan->status] ?? 'bg-light-secondary text-secondary'; @endphp {{ $deliveryChallan->status }}
@foreach($deliveryChallan->items as $item) @endforeach @if($deliveryChallan->tax_amount > 0) @endif @if($deliveryChallan->discount > 0) @endif @if($deliveryChallan->adjustment != 0) @endif
Item Name Ordered Qty Delivered Qty Returned Qty Rate Amount
{{ $item->item_name }} {{ number_format($item->quantity, 2) }} {{ number_format($item->delivered_quantity, 2) }} {{ number_format($item->returned_quantity, 2) }} {{ formatCurrency($item->rate) }} {{ formatCurrency($item->amount) }}
Subtotal {{ formatCurrency($deliveryChallan->subtotal) }}
Tax {{ formatCurrency($deliveryChallan->tax_amount) }}
Discount (-) - {{ formatCurrency($deliveryChallan->discount) }}
Adjustment {{ formatCurrency($deliveryChallan->adjustment) }}
Total {{ formatCurrency($deliveryChallan->total_amount) }}
@if($deliveryChallan->terms_conditions)
Terms & Conditions

{{ $deliveryChallan->terms_conditions }}

@endif
Customer Info
{{ $deliveryChallan->customer->name }}

{{ $deliveryChallan->customer->email }}


Challan Date: {{ \Carbon\Carbon::parse($deliveryChallan->date)->format('d M Y') }}
Created At: {{ $deliveryChallan->created_at->format('d M Y H:i') }}
@if($deliveryChallan->customer_notes)
Customer Notes

"{{ $deliveryChallan->customer_notes }}"

@endif
@endsection