{{-- New-Unity ERP | setup/complete.blade.php | v4.8 | 13/06/2026 00:00:00 --}} {{-- v4.8 — Elimina switch legacy Use General Report (formato activo ahora en Invoice Formats). --}} {{-- v4.7 — Fix layout: Use General Report ocupa col restante tras eliminar campo de color. --}} {{-- v4.6 — Elimina campo legacy invoice_reports_color del formulario (colores ahora en Invoice Formats). --}} {{-- v4.5 — Fix autocomplete='off' en campos de dirección fiscal para suprimir popup del navegador. --}} {{-- v4.4 — Fix modal Settings Saved: elimina salto/brinco al aparecer centrado. --}} {{-- v4.3 — General Settings: agrega sección Fiscal Address (postal_code, street, colony, city, state, country). --}} {{-- v2.3 — Campo IVA % (tax_percent) agregado en General Settings (junto a Tax Regime). --}} @extends('layouts.vertical') @section('content')
{{-- Page Header --}}

Invoice Setup

Configure issuer data to stamp CFDI 4.0 invoices

{{-- Breadcrumb --}} {{-- Alerts --}} @if(!$contributor->certificado || !$contributor->k_key || !$contributor->regime)
Attention: @if(!$contributor->k_key || !$contributor->certificado) You must upload your Digital Seal Certificate (.cer) and Private Key (.key) to stamp invoices. @else You must configure the Tax Regime to stamp invoices. @endif
@endif @if(session('success')) {{-- Modal de confirmación de guardado --}} @endif @if(session('error'))
{{ session('error') }}
@endif @if ($errors->any())
Please verify the data:
@endif {{-- Tabs --}}
{{-- TAB 1: General Settings --}}
@csrf
Issuer Data

Search tax regime
%
Se aplica en facturas
Fiscal Address

CP del domicilio fiscal SAT
Series and Folios

Cancel
{{-- TAB 2: Certificate Data --}}
@csrf
Digital Seal Certificate (CSD)

@if($contributor->certificado)
Current certificate:
{{ basename($contributor->certificado) }}
@else
No certificate uploaded
@endif {{-- Datos permanentes del .cer desde BD --}} @if($certData ?? false)
Certificate Info
  • File: {{ $certData->filename }}
  • RFC: {{ $certData->rfc }}
  • Name: {{ $certData->name }}
  • Valid from: {{ $certData->valid_from?->format('d/m/Y H:i:s') }}
  • Expires: {{ $certData->valid_to?->format('d/m/Y H:i:s') }}
  • @if($certData->days_remaining > 0) {{ $certData->days_remaining }} days remaining @else Certificate EXPIRED @endif
@endif {{-- Datos AJAX al subir nuevo archivo --}}
Certificate Info
  • File:
  • RFC:
  • Name:
  • Valid from:
  • Expires:
@if($contributor->k_key)
Current key:
{{ basename($contributor->k_key) }}
@else
No private key uploaded
@endif {{-- Datos permanentes del .key desde BD --}} @if($keyData ?? false)
Private Key Info
  • File: {{ $keyData->filename }}
  • Bits: {{ $keyData->bits }}
  • Password valid ✓
@endif {{-- Resultado AJAX al subir nueva llave --}}
Required to validate and save the private key {{-- Estado validación --}}
Cancel
{{-- ══ TEST CERTIFICATES ═══════════════════════════════════════════ --}}
Test Certificates (SAT — EKU9003173C9) {{ $contributor->test_mode ? 'Test Mode ON' : 'Test Mode OFF' }}

Certificados de prueba del SAT. Solo se usan cuando Test Mode está activo. No reemplazan los certificados productivos.  |  Contraseña default SAT: 12345678a

@csrf
@if($contributor->test_certificado ?? false)
Current test cert:
{{ basename($contributor->test_certificado) }}
@else
No test certificate uploaded
@endif {{-- Info del .cer de prueba (igual que productivo) --}} @if($testCertData ?? false)
Test Certificate Info
  • File: {{ $testCertData->filename }}
  • RFC: {{ $testCertData->rfc }}
  • Name: {{ $testCertData->name }}
  • Valid from: {{ $testCertData->valid_from?->format('d/m/Y H:i:s') }}
  • Expires: {{ $testCertData->valid_to?->format('d/m/Y H:i:s') }}
  • @if(($testCertData->days_remaining ?? 0) > 0) {{ $testCertData->days_remaining }} days remaining @else EXPIRED @endif
@endif
@if($contributor->test_k_key ?? false)
Current test key:
{{ basename($contributor->test_k_key) }}
@else
No test key uploaded
@endif {{-- Info del .key de prueba --}} @if($testKeyData ?? false)
Test Private Key Info
  • File: {{ $testKeyData->filename }}
  • Bits: {{ $testKeyData->bits }}
  • Password valid ✓
@endif
Default SAT test: 12345678a
{{-- ══ FIN TEST CERTIFICATES ══════════════════════════════════════ --}}
{{-- TAB 3: PAC Configuration --}}
@csrf {{-- Test Mode Switch --}}
test_mode ? 'checked' : '' }} style="width:3em; height:1.5em;">
{{ $contributor->test_mode ? 'Test Mode Active' : 'Production Mode Active' }} {{ $contributor->test_mode ? 'Switch off when ready to go live' : 'System is using production PAC' }}
{{-- Test Environment --}}
Test Environment

RFC used when Test Mode is active
{{-- Production Environment --}}
Production Environment

Taken from General Settings
Cancel
{{-- TAB 4: Invoice Formats --}}

Select the invoice PDF format for your company. Click a card to activate it.

@csrf
@foreach($formats as $fmt)
@endforeach
{{-- Logos Form (separado para soportar multipart) --}}
Invoice Logos
@csrf
@php $logoConfig = [ 'corporate_logo' => ['label'=>'Company Logo', 'maxW'=>170,'maxH'=>50], 'sponsor_logo_1' => ['label'=>'Sponsor Logo 1','maxW'=>120,'maxH'=>50], 'sponsor_logo_2' => ['label'=>'Sponsor Logo 2','maxW'=>120,'maxH'=>50], 'sponsor_logo_3' => ['label'=>'Sponsor Logo 3','maxW'=>120,'maxH'=>50], ]; @endphp @foreach($logoConfig as $field => $cfg)
JPG/PNG — auto-resized
@if($contributor->$field) @else @endif
@if($contributor->$field) {{ $contributor->$field }} @else No logo @endif
@endforeach
{{-- ── COLOR SETTINGS ─────────────────────────────── --}}
Invoice Colors
@csrf @foreach($formats as $fmt)
{{ $fmt->name }}
{{ $fmt->slug }}
{{-- Modo de color --}}
@php $mode = $fmt->settings['color_mode'] ?? 'original'; @endphp
{{-- Color pickers (solo en modo custom) --}}
@php $colors = [ ['key'=>'primary_color', 'label'=>'Color Primario', 'icon'=>'🎨'], ['key'=>'header_color', 'label'=>'Header / Banda', 'icon'=>'🔝'], ['key'=>'footer_color', 'label'=>'Footer / Pie', 'icon'=>'🔚'], ['key'=>'folio_color', 'label'=>'Número de Folio', 'icon'=>'#️⃣'], ['key'=>'text_color', 'label'=>'Texto General', 'icon'=>'✍️'], ['key'=>'table_header_color', 'label'=>'Header de Tabla', 'icon'=>'📋'], ]; @endphp @foreach($colors as $col)
@endforeach
@endforeach
{{-- fin tab-content --}}
{{-- Modal Error Certificado --}} {{-- Modal Tax Regime --}} {{-- Modal de preview --}} {{-- Modal de preview --}} {{-- Modal Preview PDF --}} @section('scripts') @endsection @endsection