DELIVERY SLIP

PARTY WISE PERIOD:

Printed On :{{ Carbon\Carbon::now('GMT+5:30')->format('l, d. F Y h:i') }}

Particulars Unit Qty Remarks
@php $total = 0; $totalWeight = 0; @endphp @foreach ($orders as $order) @php $stockItemId = $order->items->pluck('stock_item_id'); $items = App\Models\StockItem::whereIn('id', $stockItemId); if ($stock_group_id != null) { $stock_group_ids= explode(',', $stock_group_id); $items = $items->whereIn('stock_group_id', $stock_group_ids); } $items = $items->pluck('stock_group_id')->toArray(); $groups = App\Models\StockGroup::whereIn('id', $items)->get(); @endphp @foreach ($groups as $group) @php $stockItems = App\Models\StockItem::whereIn('id', $stockItemId) ->where('stock_group_id', $group->id) ->pluck('id') ->toArray(); $orderItems = App\Models\OrderItem::where('order_id', $order->id) ->whereHas('stockItem', function ($q) use ($stockItems) { $q->whereIn('id', $stockItems); }) ->get(); @endphp @foreach ($orderItems as $key => $item) @php if ($item->stockItem->weight != null) { $weight = $item->base_qty * intval($item->stockItem->weight); } else { $weight = 0; } $totalWeight += $weight; @endphp @endforeach @endforeach
Shop: {{ $order->debitLedger->name }}
Sales Staff: {{ $order?->insertUser->name ?? '' }}
Stcok Group: {{ $group->name }}
{{ $item->stockItem->name }} {{ $item->unit->symbol }} {{ $item->quantity }} {{ $item->remarks }}
Sub Total @if ($stock_group_id != null) @php $sum = $order ->items() ->whereHas('stockItem', function ($q) use ($stock_group_id) { $q->where('stock_group_id', $stock_group_id); }) ->sum('quantity'); $total += $sum; @endphp {{ $sum }} @else {{ $order->items->sum('quantity') }} @php $total += $order->items->sum('quantity'); @endphp @endif

Remarks :{{ $order->remarks }}


@endforeach {{--
--}}
Total Qty {{ $total }}
Total Weight {{ $totalWeight }}