@extends('layouts.app') @section('content')
MANEJO DE FACTURA
@csrf {{-- DATOS DEL EMISOR Y RECEPTOR --}}
{{ config('services.sat.business_name') }}
RFC: {{ config('services.sat.rfc') }}
  • Régimen Fiscal: {{ config('services.sat.tax_regime') }} - {{ config('services.sat.tax_regime_name') }}
  • Teléfono: {{ config('services.company.phone') }}
  • Licencia Sanitaria: {{ config('services.company.sanitary_license') }} {{ config('services.company.sanitary_license_2') }}
{{-- PERIODO DE LA FACTURA --}}
  • Periodo de facturación
{{-- SELECCIONAR CLIENTE --}}
  • Cliente Facturable
  • {{-- DATOS DEL CLIENTE SELECCIONADO --}}
  • Información del Cliente
    {{-- Los datos se cargarán automáticamente via JavaScript --}}
    Razón Social:
    -
    RFC:
    -
    Teléfono:
    -
    Email:
    -
    Régimen Fiscal:
    -
    Uso de CFDI:
    -
    Dirección:
    -
{{-- TABLA DE CONCEPTOS (DINÁMICA) --}}
{{-- @if (isset($invoice) && $invoice->items->count() > 0) --}} @if (!isset($preloadedData) || (isset($preloadedData) && empty($preloadedData['services']))) {{-- Código existente para edición de factura --}} @if (isset($invoice) && $invoice->items->count() > 0) @foreach ($invoice->items as $index => $item) @endforeach @endif @elseif(isset($preloadedData) && !empty($preloadedData['services'])) {{-- Cargar conceptos desde preloadedData --}} @foreach ($preloadedData['services'] as $index => $service) @php // Calcular subtotal, impuestos y total para cada servicio $quantity = $service['quantity'] ?? 1; $amount = $service['amount'] ?? 0; $discountRate = $service['discount_rate'] ?? 0; $taxRate = $service['tax_total'] ?? 0.16; $grossAmount = $quantity * $amount; $discountAmount = $grossAmount * ($discountRate / 100); $subtotal = $grossAmount - $discountAmount; $taxesAmount = $subtotal * $taxRate; $total = $subtotal + $taxesAmount; @endphp @endforeach @else {{-- Fila por defecto para crear nueva factura --}} @endif {{-- TABLA DE TOTALES --}}
Conceptos
Cant. Concepto P. Unit. Desc. % Impuesto Subtotal Impuestos Total
${{ number_format($item->subtotal, 2) }} ${{ number_format($item->tax_amount, 2) }} ${{ number_format($item->total, 2) }}
$ {{ number_format($subtotal, 2) }} $ {{ number_format($taxesAmount, 2) }} $ {{ number_format($total, 2) }}
$0.00 $0.00 $0.00
Subtotal: @if (isset($preloadedData) && isset($preloadedData['total']) && isset($preloadedData['tax'])) ${{ number_format($preloadedData['total'] - $preloadedData['tax'], 2) }} @else $0.00 @endif IVA: @if (isset($preloadedData) && isset($preloadedData['tax'])) ${{ number_format($preloadedData['tax'], 2) }} @else $0.00 @endif Total: @if (isset($preloadedData) && isset($preloadedData['total'])) ${{ number_format($preloadedData['total'], 2) }} @else $0.00 @endif
{{-- INFORMACION DE PAGO --}}
Informacion de pago
Método de pago Forma de pago Moneda Tipo de cambio
{{-- BOTÓN DE GUARDAR --}}
@endsection