- 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:
@@ -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('') + '.*';
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.2.57
|
||||
1.2.58
|
||||
Reference in New Issue
Block a user