@php use App\Models\Inventory; use App\Models\ParameterDetail; @endphp @extends('layouts.backend.index') @section('title', $label) @section('content')
@csrf
@php $old = old('work', []); $old_work = json_decode($salesorder->work, true); $subtotal = 0; $ppn = 0; $pph = 0; $total = 0; @endphp @if (empty($old)) @foreach ($old_work as $index => $i) @php $type = ParameterDetail::select('id', 'name')->whereId($i['id'])->first(); $id = $i['id']; $price = $i['price']; $remaining = $i['remaining']; $total_item = $price * $remaining; $subtotal += $total_item; @endphp @endforeach @php if ($salesorder->customer->flag == 2) { $ppn = ($subtotal * $ppn_percent) / 100; if ($salesorder->customer->pph == 1) $pph = ($subtotal * $pph_percent) / 100; } $total = $subtotal + $ppn - $pph; @endphp @else @foreach ($old['id'] as $index => $i) @php $price = (empty($old['price'][$index])) ? 0 : str_replace('.', '', $old['price'][$index]); $remaining = (empty($old['remaining'][$index])) ? 0 : str_replace('.', '', $old['remaining'][$index]); $qty = (empty($old['qty'][$index])) ? 0 : str_replace('.', '', $old['qty'][$index]); $total_item = $price * $qty; $subtotal += $total_item; @endphp @endforeach @php if ($salesorder->customer->flag == 2) { $ppn = ($subtotal * $ppn_percent) / 100; if ($salesorder->customer->pph == 1) $pph = ($subtotal * $pph_percent) / 100; } $total = $subtotal + $ppn - $pph; @endphp @endif
Jenis Pekerjaan Keterangan Harga Satuan Jumlah Jumlah Dikerjakan Total #

Sub Total : Rp {{ number_format($subtotal, 0, '', '.') }}
PPN : Rp {{ number_format($ppn, 0, '', '.') }}
PPH : Rp {{ number_format($pph, 0, '', '.') }}

Total : Rp {{ number_format($total, 0, '', '.') }}
@php $old = old('items', []); $old_items = json_decode($salesorder->items, true); @endphp @if (empty($old)) @foreach ($old_items as $index => $i) @php $goods = Inventory::select('id', 'id_item') ->with([ 'item' => function ($query) { $query->select('id', 'id_type', 'id_category', 'name', 'unit') ->with([ 'type' => function ($qt) { $qt->select('id', 'name'); }, 'category' => function ($qc) { $qc->select('id', 'name'); } ]); }, ]) ->whereId($i['id']) ->withTrashed() ->first(); @endphp @endforeach @else @foreach ($old['id'] as $index => $i) @endforeach @endif
Material Tipe Jenis Jumlah Jumlah Dipakai #
ADD
@php $old = old('worker', []); @endphp @if (empty($old)) @else @foreach ($old['id'] as $index => $i) @endforeach @endif
Nama Pekerja Jabatan #
@if ($index > 0) @endif
ADD
@endsection @push('styles') @endpush @push('scripts') @endpush