diff --git a/lv/lv2400.cpp b/lv/lv2400.cpp index 25e73e013..2bef43cc2 100755 --- a/lv/lv2400.cpp +++ b/lv/lv2400.cpp @@ -51,7 +51,7 @@ class TGenera_documenti_app : public TSkeleton_application private: //Metodi per la generazione dei documenti - bool crea_documento(const TISAM_recordset& plan, TLog_report& rep); + bool crea_documento(const TISAM_recordset& plan, TLog_report& rep, int numdocgen); void crea_riga(const TString& codart, const char modpas, const int tplis, const bool tmp, const bool prinbo,TDocumento& doc, TLog_report& rep); //Metodi per il recupero di codnum, tpdoc, stato bool numerazione_ddt(TString& codnum, TString& tpdoc, TString& statoi, TString& statof) const; @@ -116,7 +116,7 @@ bool TGenera_documenti_app::destroy() /////////////////////////////////////////////////////// //CREA_DOCUMENTO: metodo che crea un nuovo documento di trasporto dai dati salvati -bool TGenera_documenti_app::crea_documento(const TISAM_recordset& plan, TLog_report& rep) +bool TGenera_documenti_app::crea_documento(const TISAM_recordset& plan, TLog_report& rep, int numdocgen) { //recupero i dati di interesse dalla maschera const TDate datagen(TODAY); @@ -209,7 +209,10 @@ bool TGenera_documenti_app::crea_documento(const TISAM_recordset& plan, TLog_rep } if (doc.rows() > 0) + { err = doc.rewrite(); + ++numdocgen; + } else doc.remove(); @@ -742,7 +745,9 @@ bool TGenera_documenti_app::transfer() TString4 tpdoc; TString4 statoi; TString4 statof; - numerazione_drit(0, codnum, tpdoc, statoi, statof); + numerazione_drit(0, codnum, tpdoc, statoi, statof); + + int numdocgen = 0; for (dadata; dadata <= adata; ++dadata) { @@ -791,7 +796,7 @@ bool TGenera_documenti_app::transfer() { _quantita.destroy(); _quantita_ritirata.destroy(); - crea_documento(plan, rep); + crea_documento(plan, rep, numdocgen); } } } @@ -805,7 +810,16 @@ bool TGenera_documenti_app::transfer() if (buc.pages() > 0) buc.preview(); else - message_box(TR("Generazione terminata")); + { + 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")); + } } return true;