@php $fmt = fn ($v) => $note->invoice ? invoice_money_fmt((float) $v, $note->invoice) : money_fmt($v); @endphp
@if(!empty($company['logo']))@endif
{{ $company['name'] }}
@if(!empty($company['legal_name']) && $company['legal_name'] !== $company['name'])
{{ $company['legal_name'] }}
@endif @if($company['address'])
{{ $company['address'] }}
@endif @if($company['city'])
{{ trim(($company['postcode'] ?? '').' '.$company['city']) }} {{ $company['country'] }}
@endif @if($company['phone'])
{{ $company['phone'] }}
@endif @if($company['email'])
{{ $company['email'] }}
@endif @if($company['tax_id'])
{{ __('pdf.tax_id') }}: {{ $company['tax_id'] }}
@endif
{{ __('admin.credit_notes.document_title') }}
#{{ $note->number }}

{{ __('pdf.bill_to') }}

{{ $note->buyer('first_name') }} {{ $note->buyer('last_name') }}
@if($note->buyer('company_name')){{ $note->buyer('company_name') }}
@endif @if($note->buyer('address1')){{ $note->buyer('address1') }}
@endif @if($note->buyer('address2')){{ $note->buyer('address2') }}
@endif @if($note->buyer('city')){{ $note->buyer('city') }}, {{ $note->buyer('state') }} {{ $note->buyer('postcode') }}
@endif @if($note->buyer('country')){{ $note->buyer('country') }}
@endif @if($note->buyer('tax_id')){{ __('pdf.tax_id') }}: {{ $note->buyer('tax_id') }}
@endif {{ $note->buyer('email') }}

{{ __('admin.credit_notes.details') }}

@if($note->invoice) @endif
{{ __('admin.credit_notes.date') }}:{{ $note->date->format(date_fmt()) }}
{{ __('admin.credit_notes.for_invoice') }}:#{{ $note->invoice->invoice_num ?? $note->invoice_id }} ({{ $note->invoice->date?->format(date_fmt()) }})
{{ __('admin.credit_notes.method') }}:{{ __('admin.credit_notes.method_'.$note->method) }}@if($note->gateway && $note->method === 'gateway') ({{ payment_method_label($note->gateway) }})@endif
@foreach($note->lines as $line) @endforeach
{{ __('common.table.description') }}{{ __('common.table.amount') }}
{{ $line['description'] }}-{{ $fmt($line['amount']) }}
@if((float) $note->tax > 0)@endif
{{ __('admin.credit_notes.subtotal') }}-{{ $fmt($note->subtotal) }}
{{ __('common.table.tax') }}-{{ $fmt($note->tax) }}
{{ __('admin.credit_notes.total') }}-{{ $fmt($note->total) }}
@if($note->reason)
{{ __('admin.credit_notes.reason') }}: {{ $note->reason }}
@endif