@extends('layouts.horizontal', ['title' => 'Order', 'topbarTitle' => 'View Order', 'nonav' => true]) @section('css') @endsection @section('content')
{!! $business->business_address !!}
Phone: {{ $business->business_phone1 }}
{{ $customer->customer_name }}
{{ $customer->customer_cell }}
{{$order->order_status}}

Order: # {{$order->id_customer_order}}

Date: {{$order->customer_order_date}}
Time: {{$order->customer_order_time}}
Agent: {{$order->created_by}}
Type: {{ 'Retail' }}
@if (isset($categoriesDataFormattedData) && !empty($categoriesDataFormattedData))
@endif
@php $subTotal = 0; $totalTax = 0; $total_discount_amount = 0; $row = 1; @endphp @foreach($order_products as $product) @php $unit_price_with_qty = $product->qty * $product->product_unit_price; $discount_amount = $product->qty * ($product->product_discount_amount ?? 0); $discounted_price = $unit_price_with_qty - $discount_amount; $tax_amount = $discounted_price > 0 ? $product->product_sales_tax / 100 * $discounted_price : 0; $final_price = $discounted_price + $tax_amount; $subTotal += $product->price*$product->qty; $total_discount_amount += $discount_amount; $totalTax += $tax_amount; @endphp @php $row++; @endphp @endforeach
# Item Unit Qty. Discount Total
{{ $row }} {{ $product->business_brand_name }} {{ $product->product }} {!! $product->staff !!} {{ $product->batch_id . '|' . $product->batch }} {{ number_format((float)$product->product_unit_price, 2, '.', '') }} {{ $product->qty }} {{ number_format((float)$discount_amount, 2, '.', '') }} {{ number_format((float)$discounted_price, 2, '.', '') }} {{ number_format((float)$tax_amount, 2, '.', '') }} {{ number_format((float)$final_price, 2, '.', '') }}
@php $total_advance_amount =0; @endphp @if (isset($customer_order_advance)) @foreach ($customer_order_advance as $row) @php $total_advance_amount+= $row->advance_amount; @endphp @endforeach @endif @if ($total_advance_amount > 0) @endif
SubTotal {{ config('constants.CURRENCY') }} {{ config('constants.CURRENCY') . ' ' . number_format($subTotal, 2) }}
Total Before Tax {{ config('constants.CURRENCY') . ' ' . number_format($subTotal - $total_discount_amount, 2) }}
Sales Tax {{ config('constants.CURRENCY') . ' ' . number_format($totalTax, 2) }}
Total Amount {{ config('constants.CURRENCY') . ' ' . number_format(($subTotal - $total_discount_amount)+$totalTax, 2) }}
Advance Amount {{ config('constants.CURRENCY') . ' ' . number_format($total_advance_amount, 2) }}
@if (isset($categoriesDataFormattedData) && !empty($categoriesDataFormattedData))
@foreach($categoriesDataFormattedData as $category)

{{ $category['category_name'] }}

@php $sections = $category['sections']; @endphp @for($i = 0; $i < count($sections); $i += 2)
@if(isset($sections[$i]))

{{ $sections[$i]['title'] }}

@foreach($sections[$i]['fields'] as $field) @endforeach
{{ $field['label'] }} {{ $field['value'] ?? '-' }}
@endif
@if(isset($sections[$i + 1]))

{{ $sections[$i + 1]['title'] }}

@foreach($sections[$i + 1]['fields'] as $field) @endforeach
{{ $field['label'] }} {{ $field['value'] ?? '-' }}
@endif
@endfor @endforeach
@endif

THANK YOU FOR YOUR VISIT! It has been our pleasure to serve you, and we hope we see you again soon.

Terms : {!! $business->payment_terms !!}

@endsection @section('scripts') @endsection