{{-- PDF receipt of a quick sale, rendered by dompdf (no Tailwind or JavaScript; DejaVu Sans has the € sign and Finnish letters). Amounts of a credit are negative. --}} @use('App\Modules\Shared\Domain\ValueObjects\Money') @use('App\Modules\Shared\Domain\ValueObjects\VatPercentage') @use('Carbon\CarbonImmutable') @php $money = fn (int $cents): string => ($cents < 0 ? '-' : '').Money::fromCents(abs($cents))->format(); $title = $sale->isCredit() ? __('sales.receipt.credit_title') : __('sales.receipt.title'); @endphp {{ $title }} {{ $sale->id }}
@if ($company !== null)

{{ $company->name }}

@if ($company->address !== null)

{!! nl2br(e($company->address)) !!}

@endif @if ($company->phone !== null)

{{ $company->phone }}

@endif @if ($company->email !== null)

{{ $company->email }}

@endif

{{ __('sales.receipt.business_id') }}: {{ $company->businessId }}   {{ __('sales.receipt.vat_number') }}: {{ $company->vatNumber() }}

@else

{{ __('sales.receipt.company_missing') }}

@endif

{{ $title }}

@if ($sale->customerName !== null) @endif @if ($sale->isCredit()) @endif
{{ __('sales.receipt.number') }}{{ $sale->id }}
{{ __('sales.receipt.date') }}{{ CarbonImmutable::createFromFormat('Y-m-d H:i', $sale->soldAt)->format('j.n.Y H.i') }}
{{ __('sales.receipt.seller') }}{{ $sale->sellerName }}
{{ __('sales.receipt.customer') }}{{ $sale->customerName }}
{{ __('sales.receipt.payment_method') }}{{ __('sales.payment_methods.'.$sale->paymentMethod->value) }}
{{ __('sales.receipt.credits', ['number' => $sale->creditsSaleId]) }}
@foreach ($sale->lines as $line) @endforeach
{{ __('sales.receipt.product') }} {{ __('sales.receipt.quantity') }} {{ __('sales.receipt.unit_price') }} {{ __('sales.receipt.vat_rate') }} {{ __('sales.receipt.line_total') }}
{{ $line->productName }} {{ $line->quantity }} {{ $money($line->unitPriceCents) }} {{ (new VatPercentage($line->vatBasisPoints))->format() }} {{ $money($line->totalCents) }}
{{ __('sales.receipt.total') }} {{ $money($sale->totalCents) }}

{{ __('sales.receipt.vat_heading') }}

@foreach ($sale->vatTotals() as $vatTotal) @endforeach
{{ __('sales.receipt.vat_rate') }} {{ __('sales.receipt.net') }} {{ __('sales.receipt.vat') }} {{ __('sales.receipt.gross') }}
{{ (new VatPercentage($vatTotal->vatBasisPoints))->format() }} {{ $money($vatTotal->netCents) }} {{ $money($vatTotal->vatCents) }} {{ $money($vatTotal->grossCents) }}