@extends('layouts.admin') @section('content')

Notas de Débito

Nueva Nota
@if (session('success'))
{{ session('success') }}
@endif
Hoy PDF
@if($debitNotes->isEmpty())

No hay notas de débito registradas.

@else @foreach($debitNotes as $debitNote) @php $status = $debitNote->dte_status ?? 'PENDIENTE'; $statusClass = match($status) { 'RECIBIDO', 'PROCESADO' => 'badge-procesado', 'RECHAZADO' => 'badge-rechazado', default => 'badge-pendiente' }; @endphp @endforeach
Código Generación Cliente Venta Relacionada Fecha Total Estado DTE Acciones
{{ $debitNote->codigo_generacion ?? '—' }} {{ $debitNote->customer->nombre ?? 'Sin cliente' }} {{ $debitNote->sale->invoice_number ?? 'N/A' }} {{ \Carbon\Carbon::parse($debitNote->debit_note_date)->format('d/m/Y') }} ${{ number_format($debitNote->total_amount, 2) }} @if($status === 'PENDIENTE')
@csrf
@else {{ $status }} @endif
Ver @php $canDelete = $debitNote->created_at->greaterThan(now()->subHours(24)); @endphp @if ($canDelete)
@csrf @method('DELETE')
@else @endif
@endif
@endsection