@php $primaryCurrency = ($currencySettings['primary'] ?? 'usd') === 'ves' ? 'ves' : 'usd'; $secondaryCurrency = $primaryCurrency === 'usd' ? 'ves' : 'usd'; $secondaryEnabled = (bool) ($currencySettings['enable_secondary'] ?? false); $usdToVesRate = max(0.000001, (float) ($currencySettings['usd_to_ves_rate'] ?? 1)); $money = function (float $amount, bool $withSecondary = true) use ($primaryCurrency, $secondaryCurrency, $secondaryEnabled, $usdToVesRate): string { $toCurrency = function (float $value, string $currency) use ($usdToVesRate): float { return $currency === 'ves' ? $value * $usdToVesRate : $value; }; $primaryValue = $toCurrency($amount, $primaryCurrency); $text = number_format($primaryValue, 2).' '.strtoupper($primaryCurrency); if ($withSecondary && $secondaryEnabled) { $secondaryValue = $toCurrency($amount, $secondaryCurrency); $text .= ' / '.number_format($secondaryValue, 2).' '.strtoupper($secondaryCurrency); } return $text; }; @endphp

{{ __('Ticket de venta') }} #{{ $sale->id }}

{{ __('Volver al POS') }}

{{ $sale->created_at->translatedFormat('d M Y H:i') }} @if ($sale->cashier) · {{ $sale->cashier->name }} @endif

@if ($sale->productReservation)

{{ __('Reserva clínica #:id', ['id' => $sale->productReservation->id]) }} @if ($sale->productReservation->patient) · {{ $sale->productReservation->patient->name }} @endif

@endif @if ($sale->notes)

{{ $sale->notes }}

@endif @if ($sale->client)

{{ __('Cliente') }}: {{ $sale->client->name }}

@endif @foreach ($sale->items as $item) @endforeach
{{ $item->product_name }} x{{ $item->quantity }} {{ $money((float) $item->line_total) }}
{{ __('Subtotal') }} {{ $money((float) $sale->subtotal) }}
{{ __('Descuento') }} -{{ $money((float) $sale->discount_amount) }}
{{ __('Total') }} {{ $money((float) $sale->total) }}
{{ __('Método de pago') }} {{ strtoupper((string) $sale->payment_method) }}