Explorar el Código

Añado botones de acción en informe cuentas html

Celestino Rey hace 1 año
padre
commit
563771548d
Se han modificado 4 ficheros con 15 adiciones y 2 borrados
  1. 1 1
      K8S/Makefile
  2. 1 0
      src/finanzas/views.py
  3. 1 1
      src/misfinanzas/settings.py
  4. 12 0
      src/templates/informe_cuenta.html

+ 1 - 1
K8S/Makefile

@@ -1,6 +1,6 @@
 export ARQUITECTURA := $(shell lscpu |grep itectur | tr -d ' '| cut -f2 -d':')
 export REGISTRY=registry.reymota.es
-export IMG_VERSION = 0.45
+export IMG_VERSION = 0.46
 export IMG_NGINX_VERSION = 1.4
 
 # limpia todo

+ 1 - 0
src/finanzas/views.py

@@ -495,6 +495,7 @@ def informe_cuenta(request):
                 tipo = 'Ingreso'
 
             movimientos_con_saldo.append({
+                'id': mov.id,
                 'fecha': mov.fecha,
                 'descripcion': mov.descripcion,
                 'monto': mov.monto,

+ 1 - 1
src/misfinanzas/settings.py

@@ -16,7 +16,7 @@ import logging
 
 
 APP_NAME = "Finanzas"
-APP_VERSION = os.environ.get("APP_VERSION", "17.0.9")  # Valor por defecto si no está definido
+APP_VERSION = os.environ.get("APP_VERSION", "17.0.10")  # Valor por defecto si no está definido
 IMG_VERSION = os.environ.get("IMG_VERSION", "0.0.0-dev")  # Valor por defecto si no está definido
 
 

+ 12 - 0
src/templates/informe_cuenta.html

@@ -40,6 +40,7 @@
                     <th>Descripción</th>
                     <th class="text-end">Monto (€)</th>
                     <th class="text-end">Saldo después (€)</th>
+                    <th class="text-end">Acciones</th>
                 </tr>
             </thead>
             <tbody>
@@ -55,6 +56,17 @@
                     <td style="color: red" class="text-end">-{{ item.monto|floatformat:2 }}</td>
                     {% endif %}
                     <td class="text-end">{{ item.saldo_despues|floatformat:2 }}</td>
+                    <td class="edit">
+                        <a href="{% url 'editar_movimiento' item.id %}">
+                            <i class="bi bi-pencil"></i>
+                        </a>
+                        <a href="{% url 'eliminar_movimiento' item.id %}" onclick="return confirm('¿Estás seguro de que quieres eliminar este movimiento?');">
+                            <i class="bi bi-trash"></i>
+                        </a>
+                        <a href="{% url 'duplicar_movimiento' item.id %}">
+                            <i class="bi bi-files"></i>
+                        </a>
+                    </td>
                 </tr>
                 {% endfor %}
             </tbody>