@extends('layouts.app') @section('title', 'Sale ' . $sale->invoice_no) @section('content') @php $qty = fn ($v) => rtrim(rtrim(number_format((float) $v, 2), '0'), '.'); $method = fn ($key) => $methodNames[$key] ?? ucwords(str_replace('_', ' ', (string) $key)); $paid = (float) ($sale->total_paid ?: $sale->payments->sum('amount')); $change = max(0, $paid - (float) $sale->total_amount); $status = strtolower((string) $sale->payment_status); $cashier = $sale->user?->name ?? $sale->register?->user?->name; @endphp
| # | Product | Qty | Unit price | Amount |
|---|---|---|---|---|
| {{ $loop->iteration }} |
{{ $item->product?->name ?? 'Deleted product' }}
@if($item->product?->sku)SKU {{ $item->product->sku }}@endif
@if($itemBatches->isNotEmpty())
Batch {{ \App\Services\BatchStock::describe($itemBatches) }}
@endif
|
{{ $qty($item->quantity) }} | {{ formatCurrency($item->price) }} | {{ formatCurrency($item->subtotal) }} |
| Product | Was | Now | Price was | Price now |
|---|---|---|---|---|
| {{ $original['product_name'] ?? $new['product_name'] ?? 'Unknown' }} | {{ $qty($originalQty) }} | {{ $qty($newQty) }} | {{ formatCurrency($originalPrice) }} | {{ formatCurrency($newPrice) }} |
Powered by {{ config('brand.full') }}
@endif