Patch level : 10.0 patch 601

Files correlati     : lv2
Ricompilazione Demo : [ ]
Commento            :
Evitato errore fatale nel caso in cui non vengano generati documenti


git-svn-id: svn://10.65.10.50/trunk@20019 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca83 2010-01-29 12:14:49 +00:00
parent c4abf9b089
commit d5d9d7d47f

View File

@ -946,7 +946,7 @@ bool TGenera_documenti_app::transfer()
}
}
if (_msk->get_bool(F_STAMPA))
if (_msk->get_bool(F_STAMPA) && documenti.items() > 0)
{
TFilename tmp;
tmp.temp("", "ini");
@ -954,7 +954,7 @@ bool TGenera_documenti_app::transfer()
// Ensure that the ofstream is well closed before ve1 call
if (tmp.full()) // dummy test
{
TDoc_key kd(documenti.get_hashobj()->key());
TDoc_key kd(documenti.get_hashobj()->key());
TString16 chiavedoc; // Parte della chiave comune a tutti i documenti
chiavedoc << kd.provv() << '|' << kd.anno() << '|' << kd.codnum() << '|';
@ -985,24 +985,29 @@ bool TGenera_documenti_app::transfer()
}
}
if (adata < TODAY && _msk->get_int(F_TPGEN) == 0)
warning_box(TR("Non è stato possibile generare documenti con data prevista consegna nel passato"));
if (documenti.items() == 0)
warning_box(TR("Non è stato possibile generare nessun documento; probabilmente i documenti richiesti esistono già"));
else
{
TReport_book buc;
buc.add(rep);
if (buc.pages() > 0)
buc.preview();
if (adata < TODAY && _msk->get_int(F_TPGEN) == 0)
warning_box(TR("Non è stato possibile generare documenti con data prevista consegna nel passato"));
else
{
TString str;
if (numdocgen > 1)
str << "Sono stati generati " << numdocgen << " buoni.";
TReport_book buc;
buc.add(rep);
if (buc.pages() > 0)
buc.preview();
else
str << "E' stato generato " << numdocgen << " buono.";
message_box(str);
{
TString str;
if (numdocgen > 1)
str << "Sono stati generati " << numdocgen << " buoni.";
else
str << "E' stato generato " << numdocgen << " buono.";
message_box(str);
message_box(TR("Generazione terminata"));
message_box(TR("Generazione terminata"));
}
}
}