@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

{{ __('Farmacia — Punto de venta') }}

{{ __('Ver productos') }} @can('inventory.manage') {{ __('Nuevo producto') }} @endcan
@if ($activeReservation)

{{ __('Venta ligada a reserva clínica') }} #{{ $activeReservation->id }}

{{ __('Paciente') }}: {{ $activeReservation->patient->name }} @if ($activeReservation->patient->client) · {{ $activeReservation->patient->client->name }} @endif

{{ __('Si modifica el carrito manualmente, se desvincula la reserva. Para cobrar la reserva exacta, cargue de nuevo desde la lista.') }}

@endif

{{ __('Moneda principal') }}: {{ strtoupper($primaryCurrency) }} @if ($secondaryEnabled) · {{ __('Secundaria') }}: {{ strtoupper($secondaryCurrency) }} · {{ __('Tasa') }} USD/VES: {{ number_format($usdToVesRate, 2) }} @endif

{{ __('Catálogo general de productos activos.') }}

{{ __('Filtrar') }} {{ __('Limpiar') }}
@forelse ($products as $product)

{{ $product->name }}

{{ $product->category ?: __('Sin categoría') }}

{{ $money((float) $product->sale_price) }}

@csrf
{{ __('Agregar') }}
@empty
{{ __('Sin resultados.') }}
@endforelse
{{ $products->links() }}
@can('reservations.view') @if ($pendingReservations->isNotEmpty())

{{ __('Reservas pendientes (clínica)') }}

    @foreach ($pendingReservations as $pr)
  • #{{ $pr->id }} {{ $pr->patient->name }} @if ($pr->patient->client) · {{ $pr->patient->client->name }} @endif @if ($pr->author) {{ $pr->author->name }} @endif
    @csrf {{ __('Cargar en caja') }}
  • @endforeach
@endif @endcan

{{ __('Carrito') }}

{{ __('Cliente') }} {{ __('Descuento') }}
@if ($selectedClient)

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

@csrf @method('delete')
@endif @if ($cart === [])

{{ __('Vacío') }}

{{ __('Agrega productos desde el catálogo para iniciar el cobro.') }}

@else
    @foreach ($cart as $i => $line)
  • {{ $line['name'] }}

    {{ $money((float) $line['unit_price']) }} x {{ $line['qty'] }}

    @csrf {{ __('Actualizar') }}
    @csrf
  • @endforeach

{{ __('Subtotal') }}{{ $money((float) $subtotal) }}

{{ __('Descuento') }} -{{ $money((float) $discountAmount) }}

@if ($discountAmount > 0)

{{ __('Código') }}: {{ $discountCode }}

@csrf @method('delete')
@endif

{{ __('Total') }} {{ $money((float) $total) }}

{{ __('Pagar ahora') }}
@csrf
@endif

{{ __('Ventas recientes') }}

    @foreach ($recentSales as $sale)
  • #{{ $sale->id }} {{ $money((float) $sale->total, false) }}
  • @endforeach

{{ __('Asignar cliente al carrito') }}

{{ __('Opcional para facturación y control de compras.') }}

@foreach ($clients as $client)
@csrf

{{ $client->name }}

{{ $client->document_number ?: '-' }} · {{ $client->phone ?: '-' }}

{{ __('Seleccionar') }}
@endforeach
{{ __('Cerrar') }}
@csrf

{{ __('Aplicar descuento') }}

{{ __('Cancelar') }} {{ __('Guardar descuento') }}
@csrf

{{ __('Pagar venta') }}

{{ __('Subtotal') }}{{ $money((float) $subtotal) }}

{{ __('Descuento') }}-{{ $money((float) $discountAmount) }}

{{ __('Total a cobrar') }}{{ $money((float) $total) }}

{{ __('Cancelar') }} {{ __('Confirmar pago') }}