@php use App\Models\Inventory; use App\Models\Item; @endphp @extends('layouts.backend.index') @section('title', $label) @section('content')
No. Order : {{ $salesorder->number }}
Tanggal : {{ Common::dateFormat($salesorder->setdate, 'dd mmmm yyyy') }}
Nama Pelanggan : {{ @$salesorder->customer->name }}
Status : {!! @$salesorder->status_badge !!}
@isset($salesorder->id_quotation)
No. Quotation : {{ $salesorder->quotation->number }}
@endisset

@if (Auth::user()->entity->is_barang) @else @endif @php $old_items = json_decode($salesorder->items, true); $subtotal = 0; @endphp @isset($old_items) @foreach ($old_items as $index => $i) @php if (Auth::user()->entity->is_barang) { $goods = Inventory::select('id', 'id_item', 'stock') ->with([ 'item' => function ($query) { $query->select('id', 'id_category', 'name', 'uom')->with([ 'uomData' => function ($qt) { $qt->select('id', 'name'); }, 'category' => function ($qc) { $qc->select('id', 'name'); }, ]); }, ]) ->whereId($i['id']) ->withTrashed() ->first(); $id = $i['id']; $price = $i['price']; $qty = $i['qty']; $total_item = $price * $qty; $subtotal += $total_item; $itemName = @$goods->item->name; $itemStock = @$goods->stock ?? 0; } else { $goods = Item::select('id', 'id_category', 'name', 'uom') ->with([ 'uomData' => function ($qt) { $qt->select('id', 'name'); }, 'category' => function ($qc) { $qc->select('id', 'name'); }, ]) ->whereId($i['id']) ->withTrashed() ->first(); $id = $i['id']; $price = $i['price']; $qty = $i['qty']; $total_item = $price * $qty; $itemName = @$goods->name; $itemStock = null; } @endphp @isset($itemStock) @endisset @endforeach @endisset
Bahan StokNama JasaHarga Satuan Jumlah Total
{{$itemName}} {{$itemStock}} {{$price}} {{$i['qty']}} {{$total_item}}
Sub Total : Rp {{ number_format($salesorder->subtotal, 0, '', '.') }}
PPN : Rp {{ number_format($salesorder->ppn, 0, '', '.') }}
PPH : Rp {{ number_format($salesorder->pph, 0, '', '.') }}

Total : Rp {{ number_format($salesorder->total, 0, '', '.') }}
@if (!empty($employees))
Karyawan :
    @foreach ($employees as $e)
  1. {{ $e }}
  2. @endforeach
@endif
@endsection