Sale
← Back to sales
@if (session('success'))
{{ session('success') }}
@endif @if (session('error'))
{{ session('error') }}
@endif @php $baSalaryShare = $sale->baSalaryShare(); $returned = $sale->returnFigures(); @endphp {{ str($sale->status)->title() }} Print invoice @foreach ($sale->returns as $return) Credit note {{ $return->return_number }} @endforeach @can('sales.update') @if ($sale->isCancellable() && $sale->returns->isEmpty()) Edit sale @endif @endcan @can('sales.return') @if ($sale->isCancellable() && $sale->items->contains(fn ($item) => $item->returnableQuantity() > 0)) @endif @endcan @can('sales.cancel') @if ($sale->isCancellable()) @endif @if ($sale->returns->isEmpty()) @endif @endcan @if ($sale->discount_percent > 0) @else @endif
Recorded by
@if ($editingRecordedBy)
@else
{{ $sale->createdBy?->name ?? '—' }} @can('sales.update') @if (auth()->user()->isAdmin()) @endif @endcan
@endif
@if ($sale->isMixedBrand())
@foreach ($sale->brandTotals() as $part)
{{ number_format($part['total'], 2) }}
@endforeach
@endif @if ($sale->notes)

{{ $sale->notes }}

@endif

Items

@foreach ($sale->items as $item) @endforeach
Product Quantity Unit Price Unit Cost Line Total Profit
{{ $item->product?->name ?? "Deleted product (#{$item->product_id})" }} @if ($item->is_free) FREE · scheme @endif @if ($item->is_sample) SAMPLE · not charged @endif {{ $item->quantity }} {{ number_format($item->unit_price, 2) }} {{ number_format($item->unit_cost, 2) }} {{ number_format($item->line_total, 2) }} $item->profit() >= 0, 'text-red-600 dark:text-red-400' => $item->profit() < 0])>{{ number_format($item->profit(), 2) }}
@if ($sale->returns->isNotEmpty())

Returns

@foreach ($sale->returns as $return)
{{ $return->return_number }}
{{ $return->return_date->format('d M Y') }} · {{ number_format($return->total, 2) }} Credit Note PDF
    @foreach ($return->items as $line)
  • {{ $line->product?->name ?? "Deleted product (#{$line->product_id})" }} — {{ $line->quantity }} @ {{ number_format($line->unit_price, 2) }}
  • @endforeach
@endforeach
@endif {{-- Return Items modal --}} @if ($showReturnForm)

Return Items

@foreach ($returnLines as $index => $line)
{{ $line['product_name'] }} Returnable: {{ $line['returnable'] }}
@endforeach
@endif