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


@if (Auth::user()->entity->is_barang) @else @endif @php $old_items = json_decode($quotation->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}} {{number_format($itemStock,0,',','.')}} {{number_format($price,0,',','.')}} {{number_format($i['qty'],0,',','.')}} {{number_format($total_item,0,',','.')}}
Sub Total : Rp {{ number_format($quotation->subtotal, 0, '', '.') }}
PPN : Rp {{ number_format($quotation->ppn, 0, '', '.') }}
PPH : Rp {{ number_format($quotation->pph, 0, '', '.') }}

Total : Rp {{ number_format($quotation->total, 0, '', '.') }}
@endsection