From 7ad2e9c142bcb0a88abe4ec8408c4a189dc9aa5e Mon Sep 17 00:00:00 2001
From: Naiel <109038805+naielv@users.noreply.github.com>
Date: Wed, 25 Feb 2026 14:00:42 +0000
Subject: [PATCH] =?UTF-8?q?feat:=20A=C3=B1adir=20funcionalidad=20de=20filt?=
=?UTF-8?q?rado=20en=20la=20b=C3=BAsqueda=20de=20elementos=20y=20actualiza?=
=?UTF-8?q?r=20etiquetas=20en=20la=20p=C3=A1gina=20de=20pagos?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/app_modules.js | 19 +++++++++++++++++++
src/page/pagos.js | 2 +-
src/page/personas.js | 4 ++--
3 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/src/app_modules.js b/src/app_modules.js
index 179c6c5..acaf01e 100644
--- a/src/app_modules.js
+++ b/src/app_modules.js
@@ -1213,6 +1213,7 @@ function TS_IndexElement(
var searchKeyInput = safeuuid();
var debounce_search = safeuuid();
var debounce_load = safeuuid();
+ var filter_tr = safeuuid();
// Create the container with search bar and table
container.innerHTML = html`
@@ -1230,6 +1231,7 @@ function TS_IndexElement(
/>
+
@@ -1251,7 +1253,24 @@ function TS_IndexElement(
if (hashQuery.has('search')) {
searchKeyEl.value = hashQuery.get('search');
}
+ var filters = {};
+ if (hashQuery.has('filter')) {
+ hashQuery.getAll('filter').forEach((filter) => {
+ var [key, value] = filter.split(":");
+ filters[key] = value;
+ });
+ document.getElementById(filter_tr).innerHTML = 'Filtrando por: ' + Object.entries(filters)
+ .map(([key, value]) => `${key}`)
+ .join(', ') + ' - Limpiar filtros ';
+ }
function searchInData(data, searchValue, config) {
+ if (filters) {
+ for (var fkey in filters) {
+ if (data[fkey] != filters[fkey]) {
+ return false;
+ }
+ }
+ }
if (!searchValue) return true;
// Search in ID
diff --git a/src/page/pagos.js b/src/page/pagos.js
index d6bb70c..a425119 100644
--- a/src/page/pagos.js
+++ b/src/page/pagos.js
@@ -1030,7 +1030,7 @@ PAGES.pagos = {
-
Total Ganancias
+
Total Gastos
0.00€
diff --git a/src/page/personas.js b/src/page/personas.js
index 4a6c675..6ec7f23 100644
--- a/src/page/personas.js
+++ b/src/page/personas.js
@@ -66,7 +66,7 @@ PAGES.personas = {
Notas del Monedero
-
Ver Transacciones del Monedero
+
Ver movimientos
@@ -209,7 +209,7 @@ PAGES.personas = {
});
};
document.getElementById(btn_ver_monedero).onclick = () => {
- setUrlHash('pagos?search=' + encodeURIComponent(document.getElementById(field_nombre).value)); // Navigate to pagos and show transactions for this person
+ setUrlHash('pagos?filter=Persona:' + encodeURIComponent(mid)); // Navigate to pagos and show transactions for this person
};
document.getElementById(btn_borrar).onclick = () => {
if (confirm('¿Quieres borrar esta persona?') == true) {