Logo comercio
{{ config('simpleapi.dte.razon_social', 'Innova ERP') }}
{{ collect([config('simpleapi.dte.direccion', ''), config('simpleapi.dte.comuna', '')])->filter()->implode(', ') }}
Giro: {{ config('simpleapi.dte.giro', '') }}
RUT: {{ \App\Services\SimpleAPIService::formatearRut(config('simpleapi.dte.rut_emisor', '')) }}
NOTA DE CRÉDITO
Nº {{ str_pad((string)($nc->id_nc ?? 0), 5, '0', STR_PAD_LEFT) }}
Nº NC: {{ str_pad((string)($nc->id_nc ?? 0), 5, '0', STR_PAD_LEFT) }} | {{ $fechaFormateada ?? 'N/A' }} {{ $horaFormateada ?? '' }}
@if(isset($nc->id_venta) && $nc->id_venta && $nc->id_venta > 0)
Venta asociada: #{{ $nc->id_venta }}
@endif @if($cliente)
Cliente: {{ $cliente->razon_cliente ?? $cliente->nombre_cliente ?? 'N/A' }} @if(!empty($cliente->rut_cliente)) | RUT: {{ $cliente->rut_cliente }}@endif
@endif @if(count($detalles ?? []) > 0)
DETALLE
@foreach($detalles as $detalle) @php $nombre = $detalle->nombre_producto ?? 'Producto'; $cant = floatval($detalle->cantidad_ventaDetalle); $precio = floatval($detalle->precioVenta_ventaDetalle); $dto = floatval($detalle->dto_ventaDetalle ?? 0); $subtotal = $cant * $precio; if ($dto > 0 && $dto < 100) { $subtotal -= $subtotal * ($dto / 100); } if ($dto == 100) { $subtotal = 0; } @endphp
{{ strtoupper($nombre) }}
{{ $cant }} und {{ \App\Helpers\FormatoMonedaHelper::formatCurrencyWithSymbol($precio) }}/und @if($dto > 0){{ $dto }}% dto@endif
{{ \App\Helpers\FormatoMonedaHelper::formatCurrencyWithSymbol($subtotal) }}
@endforeach
@else
DETALLE
CRÉDITO POR DEVOLUCIÓN
{{ \App\Helpers\FormatoMonedaHelper::formatCurrencyWithSymbol($nc->montoTotal_nc ?? 0) }}
@endif
TOTAL {{ \App\Helpers\FormatoMonedaHelper::formatCurrencyWithSymbol($nc->montoTotal_nc ?? 0) }}
VÁLIDO HASTA: {{ $vencimientoFormateado ?? 'N/A' }}