@extends('adminlte::page') @section('content')

Sales Order Bulan Ini


Normal Sales Order

@php $heads = [ 'Customer', 'Products', 'Quantity', 'Harga', 'Total', 'Order Date', ['label' => 'Status', 'no-export' => true], ]; $config = [ 'data' => [], 'order' => [[5, 'desc']], 'columns' => [null, null, null, null, null, null, ['orderable' => false]], ]; @endphp @foreach($ordersNormal as $order) {{ $order->namaCustomer }} {{ $order->produk }} {{ $order->quantity }} {{ number_format($order->harga, 0, '.', '') }} Rp. {{ number_format($order->harga * $order->quantity, 0, ',', '.') }},00 {{ \Carbon\Carbon::parse($order->created_at)->isoFormat('DD MMMM YYYY') }} @php $status = 'Belum Selesai'; if ($order->done) { $status = 'Selesai'; } elseif ($order->retur) { $status = 'Retur'; } elseif ($order->cancel) { $status = 'Order dicancel'; } @endphp {{ $status }} @endforeach {{ $ordersNormal->links() }}

Sales Order dari Kunjungan

@php $heads = [ 'Customer', 'Location', 'Products', 'Quantity', 'Harga', 'Total', 'Order Date', ['label' => 'Status', 'no-export' => true], ]; $config = [ 'data' => [], 'order' => [[6, 'desc']], 'columns' => [null, null, null, null, null, null, ['orderable' => false]], ]; @endphp @foreach($kunjungans as $kunjungan) {{ $kunjungan->namaCustomer }} {{ $kunjungan->lokasi }} @foreach ($kunjungan->orderDetails as $orderDetail)
{{ $orderDetail->produk }}
@endforeach @foreach ($kunjungan->orderDetails as $orderDetail)
{{ number_format($orderDetail->harga, 0, '.', '') }}
@endforeach @foreach ($kunjungan->orderDetails as $orderDetail)
{{ $orderDetail->quantity }}
@endforeach @php $total = 0; foreach ($kunjungan->orderDetails as $orderDetail) { $total += $orderDetail->harga * $orderDetail->quantity; } @endphp Rp. {{ number_format($total, 0, ',', '.') }},00 {{ \Carbon\Carbon::parse($kunjungan->created_at)->isoFormat('DD MMMM YYYY') }} @php $status = 'Belum Selesai'; foreach ($kunjungan->orderDetails as $orderDetail) { if ($orderDetail->done) { $status = 'Selesai'; break; } elseif ($orderDetail->retur) { $status = 'Retur'; break; } elseif ($orderDetail->cancel) { $status = 'Order dicancel'; break; } } @endphp {{ $status }} @endforeach
{{ $kunjungans->links() }}
@foreach ($kunjungans as $kunjungan) @endforeach
Customer Location Products Quantity Harga Order Date Status
{{ $kunjungan->namaCustomer }} {{ $kunjungan->lokasi }} @foreach ($kunjungan->orderDetails as $orderDetail)
{{ $orderDetail->produk }}
@endforeach
@foreach ($kunjungan->orderDetails as $orderDetail)
{{ number_format($orderDetail->harga, 0, '.', '') }}
@endforeach
@foreach ($kunjungan->orderDetails as $orderDetail)
{{ $orderDetail->quantity }}
@endforeach
{{ $kunjungan->created_at }} @php $status = 'Belum Selesai'; foreach ($kunjungan->orderDetails as $orderDetail) { if ($orderDetail->done) { $status = 'Selesai'; break; } elseif ($orderDetail->retur) { $status = 'Retur'; break; } elseif ($orderDetail->cancel) { $status = 'Order dicancel'; break; } } @endphp {{ $status }}
{{ $kunjungans->links() }} @endsection