@extends('layouts.backend.index') @section('title', $label) @section('content')
@csrf
@if (Auth::user()->entity->is_barang) @else @endif
@if (Auth::user()->entity->is_barang) @else @endif @php $old = old('items', []); $subtotal = 0; $ppn = 0; $pph = 0; $total = 0; if (old('ppn-checked') == 'ppn') { $ppn_percent = old('ppn_percent', $ppn_percent); } if (old('pph-checked') == 'pph') { $pph_percent = old('pph_percent', $pph_percent); } @endphp @if (empty($old)) @if (Auth::user()->entity->is_barang) @endif @else @foreach ($old['id'] as $index => $i) @php $price = empty($old['price'][$index]) ? 0 : str_replace('.', '', $old['price'][$index]); $qty = empty($old['qty'][$index]) ? 0 : str_replace('.', '', $old['qty'][$index]); $total_item = $price * $qty; $subtotal += $total_item; @endphp @if (Auth::user()->entity->is_barang) @endif @endforeach @php if (old('ppn-checked') == 'ppn') { $ppn = ($subtotal * $ppn_percent) / 100; } if (old('pph-checked') == 'pph') { $pph = ($subtotal * $pph_percent) / 100; } $ppn = round($ppn); $pph = round($pph); $total = $subtotal + $ppn - $pph; @endphp @endif
Item StokNama JasaHarga Satuan Jumlah Total #
@if ($index > 0) @endif
ADD

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, '', '.') }}
@endsection @push('styles') @endpush @push('scripts') @endpush