From d5d9d7d47f75caf11f9a0928c0373dc85f144dda Mon Sep 17 00:00:00 2001 From: luca83 Date: Fri, 29 Jan 2010 12:14:49 +0000 Subject: [PATCH] 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 --- lv/lv2400.cpp | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/lv/lv2400.cpp b/lv/lv2400.cpp index 8cd016a31..3f7000307 100755 --- a/lv/lv2400.cpp +++ b/lv/lv2400.cpp @@ -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")); + } } }