@foreach ($orders as $order)

{{ $company->name }}

{{ $company->address }}

MOB:{{ $company->phone }}

Email: {{ $company->email }}

FSSAI NO : {{ $company->fssai_number }}

GSTIN : {{ $company->gst }}

ORDER DETAILS

TERMS:CASH

Order Date: {{ date('d-m-Y', strtotime($order->voucher_date)) }}

Order No: {{ $order->voucher_number }}

Place of Supply: {{ $order->debitLedger->state }}({{ $order->debitLedger->state_code }})

{{--

Delivery Date: {{ date('d-m-Y', strtotime($order->delivery_date)) }}

--}} {{--

E-Way Bill No: {{ $order->ewayBill ? $order->ewayBill->ewayBillNo : '' }}

--}}
No Of Articles: {{ $order->box_no }}
Sales Person: {{ $order->insertUser ? $order->insertUser->name : '' }}

Billed To:

M/s : {{ $order->customer ? $order->customer->name : $order->debitLedger->name }}

{{ $order->customer ? $order->customer->address : $order->debitLedger->address }}

Phone : {{ $order->customer ? $order->customer->mobile : $order->debitLedger->mobile_no }}

GST : {{ $order->customer ? '' : $order->debitLedger->gst }}

Cash Party / Shipped To :

@php $shipToName = $order->shipping_party_name ?? ($order->customer->name ?? $order->debitLedger->name); @endphp M/s : {{ $shipToName }}

{{ $order->ship_to_address }}

GST : {{ $order->customer ? '' : $order->debitLedger->gst }}

@foreach ($order->items as $key => $item) @endforeach @for ($i = $order->items()->count(); $i <= 17; $i++) @endfor
s no Description of Goods HSN/SAC Qty Unit Unit
Price
Amount Disc Amt Taxable Gst % Gst Amt Total
{{ $key + 1 }} {{ $item->stockItem->name }} {{ $item->stockItem->hsn_code }} {{ $item->quantity }} {{ $item->unit->symbol }} {{ number_format($item->price, 2) }} {{ number_format($item->gross_value, 2) }} {{ number_format($item->disc_amount, 2) }} {{ number_format($item->taxable_value, 2) }} {{ $item->gst_per }} {{ number_format($item->cgst + $item->sgst + $item->igst + $item->cess, 2) }} {{ number_format($item->total, 2) }}
 
{{ $order->items->sum('quantity') }} {{ $order->items->sum('gross_value') }} {{ $order->items->sum('disc_amount') }} {{ $order->items->sum('taxable_value') }} {{ $order->items->sum('igst') + $order->items->sum('cgst') + $order->items->sum('sgst') + $order->items->sum('cess') }} {{ $order->items->sum('total') }}
@php $gstItems = \App\Models\orderItem::where('order_id', $order->id) ->join('stock_items', 'stock_items.id', '=', 'order_items.stock_item_id') ->select( 'stock_items.gst', DB::raw('SUM(order_items.taxable_value) as TaxableValue'), DB::raw('SUM(order_items.cgst) as CGSTAmt'), DB::raw('SUM(order_items.sgst) as SGSTAmt'), DB::raw('SUM(order_items.total) as Total'), ) ->groupBy('stock_items.gst') ->get(); $words = new \NumberFormatter('en', \NumberFormatter::SPELLOUT); $words = $words->format($order->amount); @endphp
Grand Total In Words
({{ $words }}) @if ($order->items()->sum('igst') > 0) @else @endif @foreach ($gstItems as $gstItem) @if ($order->items()->sum('igst') > 0) @else @endif @endforeach
Gst % Taxable ValueCGST % CGST Amt SGST % SGST AmtTotal
{{ $gstItem->gst }} % {{ $gstItem->TaxableValue }}{{ $gstItem->gst / 2 }} {{ $gstItem->CGSTAmt }} {{ $gstItem->gst / 2 }} {{ $gstItem->SGSTAmt }}{{ $gstItem->Total }}
@if ($order->freight > 0) @endif
Discount : {{ $order->discount }}
Freight: {{ $order->freight }}
Round Off: {{ $order->round_off }}
Grand Total : {{ $order->amount }}
Our Bank Details:
Name:{{ $company->bankLedger->name }} ,
Branch: {{ $company->bankLedger->branch }}
Account No: {{ $company->bankLedger->account_number }} ,
IFSC Code: {{ $company->bankLedger->ifsc_code }}
@if ($qr_code != null) @endif {{ $company->name }}

Authorised Signatory
@if ($orders->last() != $order)
@endif @endforeach