From 11d2cb1503f72521bab70f2b5c28ba5b19cc7beb Mon Sep 17 00:00:00 2001 From: Alessandro Bonazzi Date: Wed, 17 May 2023 09:49:49 +0200 Subject: [PATCH] Patch level : 12.0 1260 Files correlati : ve0.exe ve6.exe vetbnum.mml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commento: Controllo contabilizzazione fattre da rivevere per esercizio La contabilizzazione non cancellava i movimenti abnalaitici non piĆ¹ necessari --- src/ve/velib03.cpp | 6 +++--- src/ve/velib04b.cpp | 22 ++++++++++++++++++++++ src/ve/velib07.cpp | 6 +++--- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/src/ve/velib03.cpp b/src/ve/velib03.cpp index 07068d9c6..f064dffb2 100755 --- a/src/ve/velib03.cpp +++ b/src/ve/velib03.cpp @@ -3336,11 +3336,11 @@ bool has_new_conai(const TDocumento& doc) */ void TDocumento::update_conai() { - if (main_app().has_module(DCAUT, CHK_DONGLE) && tipo().add_conai() && tipo().stati_iniziali_modifica().find(stato()) >= 0) + if (main_app().has_module(DCAUT, CHK_DONGLE) && tipo().add_conai() && tipo().stato_bloccato() != stato()) // tipo().stati_iniziali_modifica().find(stato()) >= 0) { TAssoc_array conai_aggiornati; - const TRectype& cfven = clifor().vendite(); - const bool cli_add_conai = cfven.get_bool("ADDCONAI"); + const TRectype& cfven = clifor().vendite(); + const bool cli_add_conai = cfven.get_bool("ADDCONAI"); const TDate datadoc = get(DOC_DATADOC); const TDate dataies = cfven.get(CFV_DATAICONAI); const TDate dataees = cfven.get(CFV_DATAECONAI); diff --git a/src/ve/velib04b.cpp b/src/ve/velib04b.cpp index 0cc41669b..c3ae73c1e 100755 --- a/src/ve/velib04b.cpp +++ b/src/ve/velib04b.cpp @@ -4318,6 +4318,28 @@ error_type TContabilizzazione::write_anal(TDocumento& doc, const TMovimentoPN& m canal.elabora(doc, numreg_cg, _viswin, _can_write, mov); } + else + { + long numreganal = doc.get_long(DOC_NUMREGCA); + + if (numreganal > 0) + { + TAnal_mov mov(numreganal); + TLocalisamfile movana(LF_MOVANA); + TString msg; + int err; + + if ((err = mov.remove(movana))== NOERR) + { + msg.format(FR("--- Cancellato il movimento analitico %ld"), numreganal); + doc.put(DOC_NUMREGCA, 0L); + } + else + msg.format(FR("--- Errore %d nel cancellare il movimento analitico %ld"), err, numreganal); + _viswin->add_line(msg); + + } + } return _error; } diff --git a/src/ve/velib07.cpp b/src/ve/velib07.cpp index 6621437ec..9e0569c1e 100755 --- a/src/ve/velib07.cpp +++ b/src/ve/velib07.cpp @@ -386,13 +386,13 @@ bool TDocument_report::load(const char* name) if (recset != NULL) { const TString use = recset->query_text(); - if (use.find("MATBASE") > 0) + if (use.find("MATBASE") >= 0) sec->set_recordset(new TMateriali_base_recordset(use)); else - if (use.find("SCALARE") > 0) + if (use.find("SCALARE") >= 0) sec->set_recordset(new TScalare_recordset(use)); else - if (use.find("USE") > 0 && use.find("DOC") > use.find("USE")) + if (use.find("USE") >= 0 && use.find("DOC") > use.find("USE")) sec->set_recordset(new TDocument_recordset(use)); else sec->set_recordset(use);