File: /var/www/matriculas_api_dev/resources/views/pdfs/payment_receipt.blade.php
<!doctype html>
<html lang="es">
<head>
<meta charset="utf-8">
<title>Comprobante de Pago #{{ str_pad($payment->id, 6, '0', STR_PAD_LEFT) }}</title>
<style type="text/css">
@page {
size: 21.59cm 27.94cm;
margin: 50px 40px 40px 40px;
}
body {
font-family: DejaVu Sans, sans-serif;
font-size: 11px;
color: #333;
line-height: 1.5;
}
/* Header */
.receipt-header {
text-align: center;
padding-bottom: 15px;
border-bottom: 2px solid #1a3a2a;
margin-bottom: 25px;
}
.receipt-header img {
width: 110px;
margin-bottom: 8px;
}
.receipt-header h1 {
font-size: 18px;
color: #1a3a2a;
margin: 0 0 4px 0;
letter-spacing: 2px;
}
.receipt-header .receipt-number {
font-size: 11px;
color: #888;
}
/* Amount banner */
.amount-banner {
border-radius: 8px;
text-align: center;
padding: 18px 20px;
margin-bottom: 25px;
}
.amount-banner-normal {
background-color: #f0faf5;
border: 1px solid #c6e9d7;
}
.amount-banner-cancelled {
background-color: #fef2f2;
border: 1px solid #fecaca;
}
.amount-banner .label {
font-size: 9px;
color: #888;
text-transform: uppercase;
letter-spacing: 1.5px;
margin-bottom: 4px;
}
.amount-banner .amount {
font-size: 28px;
font-weight: bold;
color: #1a3a2a;
}
.amount-banner-cancelled .amount {
color: #991b1b;
text-decoration: line-through;
}
.amount-banner .uf-detail {
font-size: 10px;
color: #888;
margin-top: 2px;
}
/* Status badge */
.status-badge {
display: inline-block;
padding: 3px 10px;
border-radius: 4px;
font-size: 10px;
font-weight: bold;
text-transform: uppercase;
letter-spacing: 0.5px;
margin-top: 8px;
}
.status-green { background-color: #d1fae5; color: #065f46; }
.status-amber { background-color: #fef3c7; color: #92400e; }
.status-blue { background-color: #dbeafe; color: #1e40af; }
.status-red { background-color: #fee2e2; color: #991b1b; }
/* Info table */
.info-table {
width: 100%;
border-collapse: collapse;
margin-bottom: 25px;
}
.info-table td {
padding: 6px 10px;
vertical-align: top;
font-size: 11px;
}
.info-table .label {
font-weight: bold;
color: #555;
width: 130px;
background-color: #f8f8f8;
}
.info-table .value {
color: #333;
}
.info-table tr {
border-bottom: 1px solid #eee;
}
/* Concepts table */
.concepts-table {
width: 100%;
border-collapse: collapse;
margin-bottom: 25px;
}
.concepts-table th {
background-color: #1a3a2a;
color: white;
padding: 8px 12px;
text-align: left;
font-size: 10px;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.concepts-table th.amount-col {
text-align: right;
}
.concepts-table td {
padding: 8px 12px;
border-bottom: 1px solid #e5e5e5;
font-size: 11px;
}
.concepts-table td.amount-col {
text-align: right;
white-space: nowrap;
}
.concepts-table .uf-note {
font-size: 9px;
color: #888;
display: block;
}
.concepts-table .total-row td {
background-color: #f0faf5;
font-weight: bold;
font-size: 12px;
border-top: 2px solid #1a3a2a;
border-bottom: none;
}
.concepts-table .total-row-cancelled td {
background-color: #fef2f2;
}
/* Notes */
.notes-box {
background-color: #fafafa;
border: 1px solid #e5e5e5;
border-radius: 6px;
padding: 10px 14px;
margin-bottom: 25px;
}
.notes-box .notes-label {
font-size: 9px;
font-weight: bold;
color: #888;
text-transform: uppercase;
letter-spacing: 0.5px;
margin-bottom: 4px;
}
.notes-box .notes-text {
font-size: 11px;
color: #555;
}
/* Footer */
.receipt-footer {
margin-top: 40px;
text-align: center;
font-size: 9px;
color: #aaa;
border-top: 1px solid #ddd;
padding-top: 12px;
}
</style>
</head>
<body>
@php
$isCancelled = ($statusColor ?? '') === 'red';
@endphp
{{-- Header --}}
<div class="receipt-header">
<img src="{{ public_path('assets/images/LogoBDF.png') }}" alt="Logo">
<h1>COMPROBANTE DE PAGO</h1>
<div class="receipt-number">N° {{ str_pad($payment->id, 6, '0', STR_PAD_LEFT) }}</div>
</div>
{{-- Amount banner --}}
<div class="amount-banner {{ $isCancelled ? 'amount-banner-cancelled' : 'amount-banner-normal' }}">
<div class="label">Total Pagado</div>
<div class="amount">${{ number_format($displayAmount, 0, ',', '.') }}</div>
@if($ufTotal > 0)
<div class="uf-detail">
@if($clpTotal > 0)
${{ number_format($clpTotal, 0, ',', '.') }} +
@endif
{{ number_format($ufTotal, 2, ',', '.') }} UF
</div>
@endif
@if($statusLabel)
<div class="status-badge status-{{ $statusColor }}">{{ $statusLabel }}</div>
@endif
</div>
{{-- Payment info --}}
<table class="info-table">
<tr>
<td class="label">Fecha</td>
<td class="value">{{ $payment->created_at->format('d/m/Y H:i') }}</td>
<td class="label">Contrato</td>
<td class="value">{{ $contract->code_contract ?? '-' }}</td>
</tr>
<tr>
<td class="label">Método de Pago</td>
<td class="value">{{ $paymentMethodName }}</td>
<td class="label">Referencia</td>
<td class="value">{{ $referenceNumber ?? '-' }}</td>
</tr>
<tr>
<td class="label">Apoderado</td>
<td class="value">{{ $parentName }}</td>
<td class="label">RUT</td>
<td class="value">{{ $parentRut }}</td>
</tr>
<tr>
<td class="label">Registrado por</td>
<td class="value" colspan="3">{{ $registeredBy }}</td>
</tr>
</table>
{{-- Concepts --}}
@if(count($details) > 0)
<table class="concepts-table">
<thead>
<tr>
<th>Concepto</th>
<th class="amount-col">Monto</th>
</tr>
</thead>
<tbody>
@foreach($details as $detail)
<tr>
<td>{{ $detail['description'] }}</td>
<td class="amount-col">
@if(($detail['currency'] ?? '') === 'UF' && isset($detail['amount_clp']))
${{ number_format($detail['amount_clp'], 0, ',', '.') }}
<span class="uf-note">{{ number_format($detail['amount'], 2, ',', '.') }} UF</span>
@else
${{ number_format($detail['amount'], 0, ',', '.') }}
@endif
</td>
</tr>
@endforeach
<tr class="total-row {{ $isCancelled ? 'total-row-cancelled' : '' }}">
<td>TOTAL PAGADO</td>
<td class="amount-col">${{ number_format($displayAmount, 0, ',', '.') }}</td>
</tr>
</tbody>
</table>
@endif
{{-- Notes --}}
@if($payment->notes)
<div class="notes-box">
<div class="notes-label">Nota</div>
<div class="notes-text">{{ $payment->notes }}</div>
</div>
@endif
{{-- Footer --}}
<div class="receipt-footer">
Documento generado el {{ now()->format('d/m/Y H:i') }} — Este comprobante no constituye boleta ni factura
</div>
</body>
</html>