@extends('layouts.app') @section('content')

Edit Penjualan: {{ $sale->invoice_number }}

Tanggal: {{ old('sale_date', isset($sale) ? \Carbon\Carbon::parse($sale->sale_date)->format('Y-m-d') : now()->format('Y-m-d')) }} | Customer: {{ $sale->customer_name }}

🖨 Cetak Nota
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif {{-- Form Tambah Item --}}

Tambah Barang ke Nota

@csrf
{{-- Daftar Item Penjualan --}}

Item Penjualan

@if($sale->items->isEmpty())

Belum ada item.

@else @php $total = 0; @endphp @foreach ($sale->items as $item) @php $subtotal = $item->quantity * $item->selling_price; $total += $subtotal; @endphp @endforeach
Barang Qty Harga Subtotal Aksi
{{ $item->inventory->product_name }} {{ $item->quantity }} Rp{{ number_format($item->selling_price, 0, ',', '.') }} Rp{{ number_format($subtotal, 0, ',', '.') }}
@csrf @method('DELETE')
Total Rp{{ number_format($total, 0, ',', '.') }}
@endif
@endsection