@foreach ($orders as $order) @php $chunks = $order->items->chunk(5); $pages = count($chunks); @endphp @foreach ($chunks as $chunkIndex => $chunk)
Page: {{ $chunkIndex + 1 }} of {{ $pages }} Order Details

{{ $company->name }}

{{ $company->address }}

PH: {{ $company->phone }},   Email: {{ $company->email }}

GST: {{ $company->gst }}       State: {{ $company->state }}
CUSTOMER: {{ $order->debitLedger->name }}
ADDRESS: {{ $order->debitLedger->address }}
PHONE: {{ $order->debitLedger->mobile_no }}
GSTIN No: {{ $order->debitLedger->gst }}
State: {{ $order->debitLedger->state }}
PO No: {{ $order->debitLedger->pin_code }}
Order No: {{ $order->order_code }}
Invoice Date: {{ date('d-m-Y', strtotime($order->order_date)) }}
Sales Man: {{ $order->insertUser ? $order->insertUser->name : '' }}
@if ($order->items->sum('igst') > 0) @else @endif @foreach ($chunk as $key => $item) @if ($order->items->sum('igst') > 0) @else @endif @endforeach @if ($chunk->count() < 5) @for ($i = $chunk->count(); $i < 5; $i++) @if ($order->items->sum('igst') > 0) @else @endif @endfor @endif @if ($loop->last) @if ($order->items->sum('igst') > 0) @else @endif @else @endif
s no HSN Product MRP Qty UOM Rate Disc Taxable Gst
%
IGSTCGST SGSTCESS Total
{{ $key + 1 }} {{ $item->stockItem->hsn_code }} {{ $item->stockItem->name }} {{ $item->stockItem->getMrp($order->order_date) }} {{ $item->quantity }} {{ $item->unit->symbol }} {{ number_format($item->price, 2) }} {{ number_format($item->disc_amount, 2) }} {{ number_format($item->taxable_value, 2) }} {{ $item->gst_per }}{{ number_format($item->igst, 2) }}{{ number_format($item->cgst, 2) }} {{ number_format($item->sgst, 2) }}{{ number_format($item->cess, 2) }} {{ number_format($item->total, 2) }}
 
{{ $order->items->sum('quantity') }} {{ number_format($order->items->sum('disc_amount'), 2) }} {{ number_format($order->items->sum('taxable_value'), 2) }} {{ number_format($order->items->sum('igst'), 2) }}{{ number_format($order->items->sum('cgst'), 2) }} {{ number_format($order->items->sum('sgst'), 2) }}{{ number_format($order->items->sum('cess'), 2) }} {{ number_format($order->items->sum('total'), 2) }}
items->sum('igst') > 0) colspan="13" @else colspan="14" @endif style="border-top:1px solid black !important">
@if (!$loop->last)
@endif @endforeach @php $count = 3; if ($order->freight > 0) { $count++; } $words = new \NumberFormatter('en', \NumberFormatter::SPELLOUT); $words = $words->format($order->amount); @endphp @if ($order->freight > 0) @endif
{{ $words }} Order Discount : {{ $order->discount }}
Freight : {{ $order->freight }}
Round Off : {{ $order->round_off }}
Order Total : {{ number_format($order->amount) }}

Received In Good Condition Party Signature FOR :   {{ $company->name }}
@if ($orders->last() != $order)
@endif @endforeach