Patch level : 12.00 1284

Files correlati     : fp0.exe
Commento            :

Gli allegati esterni non venivano elaborati
This commit is contained in:
Alessandro Bonazzi 2023-09-29 00:32:18 +02:00
parent 749a907557
commit fb59d994d2

View File

@ -2984,9 +2984,11 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
} }
} }
} }
TToken_string allegati(doc.get("COLL_GOLEM"), '\n');
bool load_allegati = true; TToken_string allegati(doc.get(DOC_COLL_GOLEM), '\n');
if (allegati.full())
bool load_allegati = true;
if (allegati.full())
{ {
if (_def_fld.empty()) if (_def_fld.empty())
{ {
@ -3000,12 +3002,18 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
TFilename fname; TFilename fname;
FOR_EACH_TOKEN(allegati, row) FOR_EACH_TOKEN(allegati, row)
{ {
const TToken_string entry(row); TToken_string entry(row);
const bool external = entry.get_bool(2);
if (entry.get(0, fname)) if (entry.get(0, fname))
{ {
TFilename file_path = golem_path; TFilename file_path = fname;
file_path.add(fname.name());
if (!external)
{
file_path = golem_path;
file_path.add(fname.name());
}
if (file_path.exist()) if (file_path.exist())
{ {
if (!add_row_alleg(file_path, nprogr, paf2600f)) if (!add_row_alleg(file_path, nprogr, paf2600f))
@ -3015,6 +3023,44 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
} }
} }
} }
allegati = doc.get(DOC_CARTACEI);
if (allegati.full())
{
if (_def_fld.empty())
{
TString msgerr; msgerr << "Errore: il documento " << _bfatt << " ha degli allegati ma nella configurazione non stato impostato come trametterli\nCaricare il documento senza allegati?";
load_allegati = false;
if (!yesno_box(msgerr))
return false;
}
else
{
TFilename fname;
FOR_EACH_TOKEN(allegati, row)
{
TToken_string entry(row);
const bool external = entry.get_bool(2);
if (entry.get(0, fname))
{
TFilename file_path = fname;
if (!external)
{
file_path = golem_path;
file_path.add(fname.name());
}
if (file_path.exist())
{
if (!add_row_alleg(file_path, nprogr, paf2600f))
return false;
}
}
}
}
}
} }
// Tabella di non invio XML // Tabella di non invio XML