@php $fmt = fn ($v) => number_format((float) $v, 2) . ' ' . $shop->currency; $reasons = ['changed_mind' => 'Changed mind', 'defective' => 'Defective', 'wrong_item' => 'Wrong item', 'damaged_in_transit' => 'Damaged in transit', 'other' => 'Other']; @endphp {{ $ret->return_no }} @if ($logo)@endif

{{ $shop->name }}

@if ($shop->address){{ $shop->address }}
@endif @if ($shop->phone)Tel: {{ $shop->phone }}
@endif @if ($taxNumber)Tax no: {{ $taxNumber }}@endif

{{ (float) $ret->credited_amount > 0 ? 'CREDIT NOTE' : 'REFUND RECEIPT' }}


@if ($ret->user)@endif @if ($ret->reason)@endif
Return no.{{ $ret->return_no }}
Date{{ $ret->returned_at->timezone($shop->timezone)->format('Y-m-d H:i') }}
Original invoice{{ $ret->sale?->invoice_no }}
Customer{{ $ret->customer?->name ?? 'Walk-in' }}
Processed by{{ $ret->user->name }}
Reason{{ $reasons[$ret->reason] ?? $ret->reason }}

@foreach ($ret->items as $i) @endforeach
Returned itemQtyAmount
{{ $i->saleItem?->product_name }} {{ rtrim(rtrim(number_format((float) $i->quantity, 3, '.', ''), '0'), '.') }} {{ number_format((float) $i->total, 2) }}
@if ((float) $ret->tax > 0)@endif
Subtotal{{ $fmt($ret->subtotal) }}
Tax{{ $fmt($ret->tax) }}
TOTAL RETURNED{{ $fmt($ret->total) }}

@if ((float) $ret->refunded_amount > 0) @endif @if ((float) $ret->credited_amount > 0) @if ($ret->customer)@endif @endif
Refunded ({{ $ret->refund_method }}){{ $fmt($ret->refunded_amount) }}
Credited to account{{ $fmt($ret->credited_amount) }}
Account balance now{{ $fmt($ret->customer->balance) }}
@if ($ret->notes)
{{ $ret->notes }}
@endif @if ($footer)
{{ $footer }}
@endif @if (! $pdf)
PDF
@if ($autoPrint)@endif @endif