@foreach ($inventoryVouchers as $inventoryVoucher)

DELIVERY CHALLAN

{{ $company->name }}
Delivery Date No : {{ $inventoryVoucher->voucher_number }}
{{ $company->address }}
Date : {{ \Carbon\Carbon::parse($inventoryVoucher->voucher_date)->format('d M Y') }}
Phone: {{ $company->phone }}
Buyer(Bill To) Details of Consignee (Shipped to)
Name : {{ $inventoryVoucher->sourceLocation->name }}
Address : {{ $inventoryVoucher->sourceLocation->address }}
Name : {{ $inventoryVoucher->destinationLocation->name }}
Address : {{ $inventoryVoucher->destinationLocation->address }}
{{-- --}} @php $inventoryVoucherItems = \App\Models\InventoryVoucherItem::where([ 'inventory_voucher_id' => $inventoryVoucher->id, 'flow' => 0, ])->get(); $totalTaxableValue = 0; $totalCgst = 0; $totalSgst = 0; $grandTotal = 0; @endphp @foreach ($inventoryVoucherItems as $key => $item) @php // $taxableValue = round($item->quantity * $item->price,2); // $gst = $item->gst_per; // $cess = $item->cess_per; // $totalTax = $gst + $cess; // $tax = round($taxableValue * $totalTax / 100 ,2); // $cgst = round($tax / 2,2); // $sgst = round($tax / 2,2); // $total = $taxableValue + $tax; // $totalTaxableValue += $taxableValue; // $totalCgst += $cgst; // $totalSgst += $sgst; $total = round($item->quantity * $item->price, 2); $grandTotal += $total; @endphp {{-- --}} @endforeach @for ($i = $inventoryVoucherItems->count(); $i < 5; $i++) @endfor {{-- --}} @php $roundOff = round($grandTotal) - $grandTotal; $grandTotal += $roundOff; @endphp
sno Item HSN Qty Price UnitTaxable Value CGST SGSTAmount
{{ $key + 1 }} {{ $item->stockItem->name }} ({{ $item->stockItem->internal_barcode }}) {{ $item->stockItem->hsn_code }} {{ number_format($item->quantity) }} {{ number_format($item->price, 2) }} {{ $item->unit->symbol }}{{ number_format($taxableValue,2) }} {{ number_format( $cgst,2) }} {{ number_format( $sgst,2) }}{{ number_format($total, 2) }}
 
Total{{ number_format($totalTaxableValue,2) }} {{ number_format($totalCgst,2) }} {{ number_format($totalSgst,2) }}{{ number_format($grandTotal, 2) }}
Round Off {{ number_format($roundOff, 2) }}
Grand Total {{ number_format($grandTotal, 2) }}

For :{{ $company->name }}

{{-- @php $roundOff = round($grandTotal) - $grandTotal; $grandTotal += $roundOff; @endphp
Total Taxable Value {{ number_format($totalTaxableValue,2) }}
Total Cgst {{ number_format($totalCgst,2) }}
Total Sgst {{ number_format($totalSgst,2) }}
Round Off {{ number_format($roundOff,3) }}
Grand Total {{ number_format($grandTotal,2) }}
--}} @endforeach