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

๐Ÿงพ Detail Transaksi

Kode Transaksi : {{ $sale->invoice_number }}

Tanggal : {{ \Carbon\Carbon::parse($sale->created_at)->format('d-m-Y H:i:s') }}

Metode Bayar : {{ strtoupper($sale->payment_method) }}

๐Ÿ“ฆ Produk Dibeli

@foreach($sale->items as $item) @php $originalPrice = $item->product->price; $discountQty = $item->product->discount_qty; $discountPrice = $item->product->discount_price; $isDiscount = $discountQty && $item->qty >= $discountQty && $discountPrice < $originalPrice; @endphp @endforeach
Produk Harga Satuan Qty Subtotal
{{ $item->product->name }} @if($isDiscount)
๐ŸŽ‰ Diskon aktif (min beli {{ $discountQty }})
@endif
@if($isDiscount)
Rp {{ number_format($originalPrice,0,',','.') }}
Rp {{ number_format($item->price,0,',','.') }}
@else Rp {{ number_format($item->price,0,',','.') }} @endif
{{ $item->qty }} Rp {{ number_format($item->subtotal,0,',','.') }}

Total Belanja: Rp {{ number_format($sale->total_amount,0,',','.') }}

Dibayar: Rp {{ number_format($sale->paid_amount,0,',','.') }}

Kembalian: Rp {{ number_format($sale->change_amount,0,',','.') }}

โ† Kembali ke Laporan
@endsection