diff --git a/src/ve/ve5400.cpp b/src/ve/ve5400.cpp index b28e0632a..798bb2ad8 100755 --- a/src/ve/ve5400.cpp +++ b/src/ve/ve5400.cpp @@ -203,13 +203,18 @@ void TArchive_doc::archivia(const TMask& m) delete_tmp_files(false); //chiude i files temp in modo da risparmiare memoria const char* dir = _tmp_dir; //fa puntare dir alla directory temp - if (*dir == '%') dir++; - bool rt = _arc.backup(dir,_unit,_desc, TRUE); //esegue la compressione ed il salvataggio sul device scelto - create_tmp_files(false); //apre i files temp, riallocandoli (NON li crea effettvam.) + + if (*dir == '%') + dir++; + + bool rt = _arc.backup(dir,_unit,_desc, TRUE); //esegue la compressione ed il salvataggio sul device scelto + + create_tmp_files(false); //apre i files temp, riallocandoli (NON li crea effettvam.) delete_tmp_files(true); //cancella fisicamente i files temp TFilename unit; - unit << _unit << ':' << SLASH; + + unit << _unit << ':' << SLASH; if (!xvt_fsys_is_removable_drive(unit) && _path != "") //se il drive non e' rimovibile,sposta i files dalla root del drive { //alla target dir scritta sulla maschera for (int i = 0; i <= 1; i++) @@ -240,7 +245,15 @@ bool TArchive_doc::restore_file(TIsamtempfile& src, bool update) for (int err = src.first(); err == NOERR; err = src.next()) { dst.curr() = src.curr(); - err = dst.write_rewrite(); + if (update) + err = dst.write_rewrite(); + else + { + TRectype curr(src.curr()); + + if (curr.read(dst) != NOERR) + err = dst.write(); + } if (err != NOERR) return cantwrite_box(dst.description()); if (!pi.add_status(1)) @@ -261,7 +274,7 @@ bool TArchive_doc::restore_docs() if (ok) { _tdoc->set_curr(new TDocumento); - ok = restore_file(*_tdoc, false); + ok = restore_file(*_tdoc, true); } return ok; } diff --git a/src/ve/velib03.cpp b/src/ve/velib03.cpp index f75e73bd3..eef3bac36 100755 --- a/src/ve/velib03.cpp +++ b/src/ve/velib03.cpp @@ -3062,10 +3062,9 @@ void TDocumento::update_conai() { if (main_app().has_module(DCAUT, CHK_DONGLE) && tipo().add_conai() && tipo().stati_iniziali_modifica().find(stato()) >= 0) { - TAssoc_array conai_aggiornati; + TAssoc_array conai_aggiornati; 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);