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)
Bahan |
Stok |
@else
Nama Jasa |
@endif
Harga Satuan |
Jumlah |
Total |
@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
{{$itemName}}
|
@isset($itemStock)
{{$itemStock}}
|
@endisset
{{$price}}
|
{{$i['qty']}}
|
{{$total_item}}
|
@endforeach
@endisset
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)
- {{ $e }}
@endforeach
@endif