feat: Add transaction code generation for orders and update receipt templates

This commit is contained in:
2026-04-09 08:51:12 +02:00
parent a570c542c2
commit a3eae63587
7 changed files with 76 additions and 10 deletions
@@ -7,6 +7,9 @@
<div class="alert alert-success p-5">
<h2 class="mb-3">¡Pago completado!</h2>
<p class="mb-4">Tu pedido ha sido procesado correctamente.</p>
{% if order and order.transaction_code %}
<p class="mb-4"><strong>ID de transacción:</strong> {{ order.transaction_code }}</p>
{% endif %}
<a href="{% url 'index' %}" class="btn btn-primary">Volver a la tienda</a>
</div>
</div>
+2
View File
@@ -34,6 +34,7 @@
<thead>
<tr>
<th>Recibo #</th>
<th>ID Transacción</th>
<th>Fecha</th>
<th>Total</th>
<th>Método</th>
@@ -44,6 +45,7 @@
{% for receipt in receipts %}
<tr>
<td>{{ receipt.id }}</td>
<td>{{ receipt.transaction_code|default:"-" }}</td>
<td>{{ receipt.created_at|date:"d/m/Y H:i" }}</td>
<td>{{ receipt.total }}€</td>
<td>{{ receipt.get_payment_method_display }}</td>