Aggiornamento PiuChebuono: lista Totali del Produttore.

This commit is contained in:
Surya Paolo
2025-02-26 19:08:00 +01:00
parent 57679fe649
commit 757bf44c68
5 changed files with 20 additions and 7 deletions

View File

@@ -604,8 +604,11 @@ async function extractArrayDataFromCSV(idapp, rec) {
arrcampi_product = getValoriAndIndice_Product(null);
for (const campoobj of arrcampi_productInfo) {
if (rec.hasOwnProperty(campoobj.name)) {
let myval = tools.ripulisciCampo(rec[campoobj.name]);
// TODO: controlla che il campo rec[campoobj.name] esista anche se minuscolo/maiuscolo
const mykey = Object.keys(rec).find(key => key.toLowerCase() === campoobj.name.toLowerCase());
if (mykey) {
let myval = tools.ripulisciCampo(rec[mykey]);
productInfo[campoobj.name] = (myval === 'TRUE' || myval.toUpperCase() === 'SI') ? true : ((myval === 'FALSE' || myval.toUpperCase() === 'NO') ? false : myval);
}