- aggiunto filtro nella lista producttable

- ora compare il bottone aggiungi alla lista solo se non è presente.
- corretto la ricerca con "#"
This commit is contained in:
Surya Paolo
2025-06-25 17:48:44 +02:00
parent 8d4158c2c6
commit 31a93424aa
2 changed files with 7 additions and 2 deletions

View File

@@ -286,6 +286,8 @@ module.exports.executeQueryTable = function (idapp, params) {
module.exports.executeQueryPickup = async function (idapp, params) {
let strfindInput = tools.removeAccents(params.search.trim().toLowerCase());
strfindInput = strfindInput.replace(/#/g, ' '); // aggiungi spazio prima di # se vuoi conservarlo
// Rimuove le parole "il" e "la" e gli spazi, le @ e i tabulazioni
// per non farli influire sulla ricerca
strfindInput = strfindInput
@@ -308,7 +310,10 @@ module.exports.executeQueryPickup = async function (idapp, params) {
const cleanInput = tools.removeAccents(strfindInput.trim());
const words = cleanInput.split(/\s+/);
const escapeRegex = (w) => w.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
const escapeRegex = (w) => {
// Escape del carattere '#' e altri caratteri speciali
return w.replace(/[.*+?^${}()|[\]\\]/g, '\\$&').replace(/#/g, '\\#');
};
// 🔹 Pattern per productInfo.name: tutte le parole devono essere presenti
const patternAllWords = words.map((w) => `(?=.*\\b${escapeRegex(w)})`).join('') + '.*';

View File

@@ -1 +1 @@
1.2.57
1.2.58