@include('layouts.header') @include('layouts.sidebar')
@if(session()->has('success'))
{{ session()->get('success') }}
@endif @if(session()->has('error'))
{{ session()->get('error') }}
@endif
@csrf
Order Items
@php $baseamount = 0; $totalgst = 0; $gst_5 = $gst_12 = $gst_18 = $gst_28 = 0; $netbillamount = 0; $discount = $order->customer_discount_amount; $forwarding = $order->forwarding_amount; $forwarding_gst = $order->forwarding_gst; @endphp @foreach($orderItems as $item) @php $priceInclGst = $item->price; $gstRate = $item->gst_rate; // Calculate base price per unit (excluding GST) $basePricePerUnit = $priceInclGst / (1 + ($gstRate / 100)); // Total base for quantity $total = $basePricePerUnit * $item->quantity; // GST amount for this line $gstamt = ($priceInclGst - $basePricePerUnit) * $item->quantity; $baseamount += $total; $totalgst += $gstamt; if ($gstRate == 5.00) { $gst_5 += $gstamt; } elseif ($gstRate == 12.00) { $gst_12 += $gstamt; } elseif ($gstRate == 18.00) { $gst_18 += $gstamt; } elseif ($gstRate == 28.00) { $gst_28 += $gstamt; } @endphp @endforeach @php $netbillamount = $baseamount + $totalgst + $forwarding + $forwarding_gst - $discount; @endphp
Description Quantity GST% GST Rate Amount HSN Code UoM

{{-- --}} @include('layouts.footer')