From e4be2d94320257a0efb3fbfb761cbb7094b33f34 Mon Sep 17 00:00:00 2001 From: Alessandro Bonazzi Date: Fri, 17 Jan 2020 00:40:40 +0100 Subject: [PATCH] Patch level : 12.0 924 Files correlati : bacnv.exe ve2.exe Commento : - Corretto caricamento sul CONAI nuovo se ho una sottocategoria errata tipo "0" vedi nuovabienne Da valutare se fare anche ve0.exe ve1.exe ve5.exe ve6.exe --- src/mg/mglib02.cpp | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/mg/mglib02.cpp b/src/mg/mglib02.cpp index d3460c49e..509734cf6 100755 --- a/src/mg/mglib02.cpp +++ b/src/mg/mglib02.cpp @@ -1909,12 +1909,27 @@ TArticolo_conai::TArticolo_conai(const TString& codart) for (int i = 0; i < 6; i++) { const TString& con = conaisc.mid(i * 4, 4); - const TString& categoria = con.left(2); - const TString& sottocat = con.right(2); - if (con.blank()) continue; - _sc.add(con); - _peso.add(ranamag.get_real(conai2anamagfld(categoria))); + if (con.full()) + { + const TString& categoria = con.left(2); + const TString& sottocat = con.right(2); + const TString fldname = conai2anamagfld(categoria); + + if (fldname != "ERROR") + { + _sc.add(con); + _peso.add(ranamag.get_real(fldname)); + } +#ifdef DBG + else + { + TString msg; msg.format("Errore nome campo: Articolo %s - Sottocategoria %s", (const char *)_codart, (const char *)con); + + message_box(msg); +#endif + } + } } } }