Patch level : 12.01 1300

Files correlati     : fp0.exe
Commento            :

errore archiviazione Dinamica
This commit is contained in:
Alessandro Bonazzi 2023-10-30 22:27:16 +01:00
parent 1a64b093e0
commit 12c6bb5449
2 changed files with 21 additions and 14 deletions

View File

@ -271,6 +271,7 @@ public:
TArray_sheet * get_sheet_catdocs();
TArray_sheet * get_sheet_ann(const TString& catdoc);
TClasse_doc * mov2cat(const long numreg);
TClasse_doc * TCategorie_doc::mov2cat(const TRectype & mov);
const TString & tipo2caus_cont(const TString & tipodoc, const char * tipocaus) { TClasse_doc * c = find_tipodocsdi(tipodoc, tipocaus); if (c != nullptr) return c->causcont(); else return EMPTY_STRING; }
void reload();
static void remove_all();

View File

@ -1080,7 +1080,7 @@ const char* TEstrazione::diagnostica_mov()
if (mov_i.no_err())
{
// Cerco la categoria documentale
TClasse_doc * cd = categorie_doc().mov2cat(mov_i.numreg());
TClasse_doc * cd = categorie_doc().mov2cat(mov);
const bool found = cd != nullptr;
if (found)
@ -1122,6 +1122,7 @@ const char* TEstrazione::diagnostica_mov()
const long numreg = mov_i.numreg();
const TRectype & mov = cache().get(LF_MOV, numreg);
/* Controlli per vendite cambiati:
* Elettroniche solo quelle agli italiani, tutti gli altri sono cartacei
*/
@ -1153,7 +1154,7 @@ const char* TEstrazione::diagnostica_mov()
}
else
{
TClasse_doc* cd = categorie_doc().mov2cat(mov_i.numreg());
TClasse_doc* cd = categorie_doc().mov2cat(mov);
const bool found = cd != nullptr;
if (found)
@ -1183,18 +1184,8 @@ const char* TEstrazione::diagnostica_mov()
else
mov_i.set_err("Non e' stato possibile reperire il file del documento cartaceo per questo movimento.", mov_no_filecart);
}
TToken_string cartacei(mov.get(MOV_CARTACEI), '\n');
FOR_EACH_STR_TOKEN(cartacei, s)
{
TFilename file(s);
if (file.exist())
mov_i.documenti_allegati().add(file);
else
mov_i.set_err(format(FR("Non e' stato possibile reperire il file cartaceo %s per questo movimento."), (const char *) file), mov_no_filecart);
}
if (F9CONF.get_has_cartexp()) // Se e' abilitata l'esportazione dei cartacei, altrimenti skip...
mov_i.load_docs();
copy_file_to_webapp_fld(mov_i);
}
@ -2501,6 +2492,21 @@ TClasse_doc * TCategorie_doc::mov2cat(const long numreg)
return find_tipodoc(tipodoc);
}
TClasse_doc * TCategorie_doc::mov2cat(const TRectype & mov)
{
// Leggo la causale e cerco la corrispondente nelle categorie documentali, se c'e'.
// Guardo le colonne causale cont., tipodoc, class. cat. (opcee)
const TString& caus = mov.get(MOV_CODCAUS);
const TCausale & c = cached_causale(caus, mov.get_date(MOV_DATAREG).year());
const TString& tipodoc = c.tipo_doc();
// Cerco se ho un record che abbia specificata quella caus. contabile
TClasse_doc * cat = find_causcont(caus);
if (cat != nullptr)
return cat;
// Altrimenti cerco per tipo documento
return find_tipodoc(tipodoc);
}
void TCategorie_doc::reload()
{
load_all();