@php $tiposDte = [ '01' => 'Factura Electrónica', '03' => 'Crédito Fiscal', '05' => 'Nota de Crédito', '06' => 'Nota de Débito', '07' => 'Comprobante de Retención', '11' => 'Factura de Exportación', '14' => 'Factura de Sujeto Excluido', ]; $receptores_nit = ['03', '05', '06']; $receptores_num = ['01', '07', '11', '14']; @endphp @extends('layouts.app') @include('business.layouts.navbar') @section('content')
ID | Tipo de Documento | Información Hacienda | Información Receptor | Fecha Procesamiento | Estado | Observaciones | Acciones |
---|---|---|---|---|---|---|---|
{{ $invoice['id'] }} | {{ $tiposDte[$invoice['tipo_dte']] }} |
Código Generacion: |
@php
$nombre = '';
$documento = '';
if ($invoice['tipo_dte'] == '14') {
$receptor = $invoice['documento']->sujetoExcluido;
} else {
$receptor = $invoice['documento']->receptor;
}
$nombre = $receptor->nombre;
if (in_array($invoice['tipo_dte'], $receptores_nit)) {
$documento = $receptor->nit;
} else {
$documento = $receptor->numDocumento;
}
@endphp
@if ($nombre)
Nombre: |
{{ \Carbon\Carbon::parse($invoice['fhProcesamiento'])->format('d/m/Y H:i:s') }} | {{ $invoice['estado'] }} |
{{-- {{ $invoice['observaciones'] }} --}}
@php
$decoded = json_decode($invoice['observaciones'], true);
@endphp
@if (is_array($decoded))
@if (!empty($decoded))
@if (array_key_exists('descripcionMsg', $decoded))
{{ $decoded['descripcionMsg'] }} @else @foreach ($decoded as $observacion){{ trim($observacion, '[]') }} @endforeach @endif @endif @else @if (str_starts_with($invoice['observaciones'], '[') && str_ends_with($invoice['observaciones'], ']')) @php $json_string = str_replace("'", "\"", $invoice['observaciones']); // Decode the JSON string to a PHP array $array = json_decode($json_string, true); @endphp @if (is_array($array)) @foreach ($array as $observacion){{ $observacion }} @endforeach @endif @else{{ $invoice['observaciones'] }} @endif @endif |
@if ($invoice['estado'] === 'CONTINGENCIA' || $invoice['estado'] === 'RECHAZADO')
@else
|
ID | Tipo de Documento | Información Hacienda | Información Receptor | Fecha Procesamiento | Estado | Observaciones | Acciones |