From 42bbc82938c6c5d9dbdc63fb4fb43e7f84e84ca6 Mon Sep 17 00:00:00 2001 From: luca83 Date: Wed, 14 Oct 2009 13:46:22 +0000 Subject: [PATCH] =?UTF-8?q?Patch=20level=20=20=20=20=20=20=20=20=20:=2010.?= =?UTF-8?q?0=20patch=20471=20Files=20correlati=20=20=20=20=20:=20lv2=20Ric?= =?UTF-8?q?ompilazione=20Demo=20:=20[=20]=20Commento=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20:=20Corretta=20la=20gestione=20delle=20date;=20p?= =?UTF-8?q?ensate=20in=20formato=20ansi,=20in=20realt=C3=A0=20vengono=20sc?= =?UTF-8?q?ritte=20in=20fomato=20ggmmaaa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Evitato che nel nome file venga scritto anche il percorso, così il file viene effettivamente trovato git-svn-id: svn://10.65.10.50/trunk@19445 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- lv/lv2900.cpp | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/lv/lv2900.cpp b/lv/lv2900.cpp index 9a70f68e7..074fb7867 100755 --- a/lv/lv2900.cpp +++ b/lv/lv2900.cpp @@ -531,21 +531,23 @@ bool TConta_pulito_msk::elabora_file(const TFilename& file) { TString riga = s.line(); if (riga.blank()) - continue; + continue; TRiga_pacco* rp = new TRiga_pacco(); rp->set_key(riga.left(50)); rp->set_articolo(riga.mid(50, 20)); rp->set_quantita(atoi(riga.mid(70, 8))); - rp->set_data((TDate)riga.mid(78, 8)); + TDate data(atoi(riga.mid(78, 2)), atoi(riga.mid(80, 2)), atoi(riga.mid(82, 4))); + rp->set_data(data); int codcf = atoi(riga.mid(86, 6)); if(codcf > 0) { rp->set_cliente(codcf); //eventualmente vuoto - rp->set_databo((TDate)riga.mid(92, 8)); //eventualmente vuoto + TDate databo(atoi(riga.mid(92, 2)), atoi(riga.mid(94, 2)), atoi(riga.mid(96, 4))); + rp->set_databo(databo); //eventualmente vuoto } - const bool ann = riga.mid(100, 1) == 'S' ? true : false; + const bool ann = riga.mid(100, 1)[0] == 'S' ? true : false; rp->set_annullato(ann); //recupero l'unità di misura principale di quest'articolo @@ -553,8 +555,19 @@ bool TConta_pulito_msk::elabora_file(const TFilename& file) key.add(riga.mid(50, 20)); key.add(1); const TRectype& umart = cache().get(LF_UMART, key); - TString4 um = umart.get(UMART_UM); - rp->set_um(um); + if (umart.empty()) + { + TString str; + TString80 codart = riga.mid(50,20); + codart.trim(); + str << "ATTENZIONE: non è stata trovata nessuna unità di misura valida per l'articolo " << codart; + warning_box(str); + } + else + { + TString4 um = umart.get(UMART_UM); + rp->set_um(um); + } rp->write(f); } @@ -909,9 +922,12 @@ TConta_pulito_msk::TConta_pulito_msk():TAutomask("lv2900a") TConfig configlv(CONFIG_DITTA, "lv"); const TString& path = configlv.get("PathPulito"); - const TString& file = configlv.get("FilePulito"); + TFilename& file = (TFilename)configlv.get("FilePulito"); + TString80 f = file.name_only(); + f << ".dat"; + set(F_PATH, path); - set(F_FNAME, file); + set(F_FNAME, f); //se ho più di un parametro, allora lo sto lanciando da linea di comando, e ne devo tenere conto if (main_app().argc() > 2)