@extends('layouts.app') @section('title', 'Comprobante ' . $comprobante->numero_completo) @section('header', $comprobante->tipo_documento_nombre . ' ' . $comprobante->numero_completo) @section('content') @php $moneda = $empresaGlobal->moneda ?? '$'; $color = $comprobante->estado_color; $esRetencion = $comprobante->tipo_documento === '07'; @endphp

{{ $comprobante->tipo_documento_nombre }} electrónica

{{ $comprobante->numero_completo }}

Emitida el {{ $comprobante->fecha_emision->format('d/m/Y') }} • Ambiente: {{ $comprobante->ambiente_nombre }}

{{ str_replace('_', ' ', $comprobante->estado_sri) }}

Emisor

{{ $comprobante->emisor_razon_social }}

RUC: {{ $comprobante->emisor_ruc }}

{{ $esRetencion ? 'Sujeto retenido' : 'Receptor' }}

{{ $comprobante->receptor_razon_social }}

{{ $comprobante->receptor_tipo_label }}: {{ $comprobante->receptor_identificacion }}

@if($comprobante->receptor_direccion)

{{ $comprobante->receptor_direccion }}

@endif
@if($comprobante->num_doc_modificado)

Documento modificado: Factura {{ $comprobante->num_doc_modificado }}

Motivo: {{ $comprobante->motivo }}

@endif @if($esRetencion)

Período fiscal: {{ $comprobante->periodo_fiscal }}

Documento de sustento: {{ $comprobante->doc_sustento_numero }} ({{ $comprobante->doc_sustento_fecha?->format('d/m/Y') }})

@endif @if($comprobante->detalles->count())

Detalle

@if($esRetencion) @foreach($comprobante->detalles as $d) @endforeach @else @foreach($comprobante->detalles as $d) @endforeach @endif
Impuesto Base % Retenido
{{ \App\Models\ComprobanteDetalle::CODIGOS_RETENCION[$d->ret_codigo] ?? $d->descripcion }} {{ $moneda }}{{ number_format($d->ret_base_imponible, 2) }} {{ number_format($d->ret_porcentaje, 2) }}% {{ $moneda }}{{ number_format($d->ret_valor_retenido, 2) }}
Producto Cant. P. Unit. IVA Subtotal

{{ $d->descripcion }}

{{ $d->codigo_principal }}

{{ number_format($d->cantidad, 2) }} {{ $moneda }}{{ number_format($d->precio_unitario, 4) }} {{ number_format($d->impuesto_tarifa, 0) }}% {{ $moneda }}{{ number_format($d->precio_total_sin_impuesto, 2) }}
@endif
@if($esRetencion)
TOTAL RETENIDO:{{ $moneda }}{{ number_format($comprobante->total_retenido, 2) }}
@else
Subtotal sin impuestos:{{ $moneda }}{{ number_format($comprobante->total_sin_impuestos, 2) }}
@if($comprobante->total_descuento > 0)
Descuento:-{{ $moneda }}{{ number_format($comprobante->total_descuento, 2) }}
@endif
IVA:{{ $moneda }}{{ number_format($comprobante->total_iva, 2) }}
TOTAL:{{ $moneda }}{{ number_format($comprobante->importe_total, 2) }}
@endif
@if(count($comprobante->mensajes))

Mensajes del SRI

@foreach($comprobante->mensajes as $m)
@if(!empty($m['identificador']))

[{{ $m['identificador'] }}] {{ $m['tipo'] ?? '' }}

@endif

{{ $m['mensaje'] ?? '' }}

@if(!empty($m['informacion']))

{{ $m['informacion'] }}

@endif
@endforeach
@endif

Acciones SRI

@if(in_array($comprobante->estado_sri, ['CREADO', 'FIRMADO', 'DEVUELTA', 'NO_AUTORIZADO', 'EXCEPCION']))
@csrf
@endif @if($comprobante->estado_sri === 'RECIBIDA')
@csrf
@endif @if($comprobante->xml_path) Descargar XML firmado @endif @if($comprobante->xml_autorizado_path) Descargar XML autorizado @endif @if($comprobante->estado_sri === 'AUTORIZADO' && $comprobante->tipo_documento === '01') @endif
@if($comprobante->clave_acceso)

Clave de acceso

{{ $comprobante->clave_acceso }}

@endif

Datos técnicos

Tipo:
{{ $comprobante->tipo_documento }} - {{ $comprobante->tipo_documento_nombre }}
Estab. - Pto:
{{ $comprobante->estab }}-{{ $comprobante->pto_emi }}
Secuencial:
{{ $comprobante->secuencial }}
Ambiente:
{{ $comprobante->ambiente_nombre }}
@if($comprobante->numero_autorizacion)
N° Autorización:
{{ $comprobante->numero_autorizacion }}
@endif @if($comprobante->fecha_autorizacion)
Fecha autorización:
{{ $comprobante->fecha_autorizacion->format('d/m/Y H:i') }}
@endif
Volver al listado
@endsection