Patch level : 10.0

Files correlati     : ve1.exe
Ricompilazione Demo : [ ]
Commento            :
Migliorato log delle mail inviate


git-svn-id: svn://10.65.10.50/trunk@20573 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2010-06-17 08:09:42 +00:00
parent 15258127ae
commit 82df15a4bc
3 changed files with 28 additions and 13 deletions

View File

@ -993,7 +993,11 @@ bool TReport_doc_app::get_next_mail(TToken_string& to, TToken_string& cc, TToken
TDocumento doc('D', _anno, _codnum, _ndoc); TDocumento doc('D', _anno, _codnum, _ndoc);
doc.riferimento(subj); doc.riferimento(subj);
if (subj.blank()) if (subj.blank())
{
subj = doc.tipo().descrizione(); subj = doc.tipo().descrizione();
subj << ' ' << _ndoc << TR(" del ") << doc.get(DOC_DATADOC)
<< ' ' << prefix().firm().ragione_sociale();
}
text << TR("Invio documento ") << subj; text << TR("Invio documento ") << subj;
if (to.full()) if (to.full())
ui &= ~0x1; // No user interface ui &= ~0x1; // No user interface
@ -1077,7 +1081,7 @@ bool TReport_doc_app::print_loop(TRecordset& doc, TOutput_mode mode, bool is_def
TReports_cache reports; // Cache degli ultimi reports usati TReports_cache reports; // Cache degli ultimi reports usati
TDoc_book book; // Destinazione dell'intera stampa TDoc_book book; // Destinazione dell'intera stampa
TDoc_book* mail_book = NULL; // Destinazione della singola mail TDoc_book* mail_book = NULL; // Destinazione della singola mail
TLog_report log(TR("Invio documenti per email")); TLog_report mail_log(TR("Invio documenti per email"));
TProgind pi(docs, TR("Elaborazione documenti..."), true, true); TProgind pi(docs, TR("Elaborazione documenti..."), true, true);
bool attach_mail = mode==out_mail || mode==out_signed_mail; bool attach_mail = mode==out_mail || mode==out_signed_mail;
@ -1092,9 +1096,15 @@ bool TReport_doc_app::print_loop(TRecordset& doc, TOutput_mode mode, bool is_def
doc.move_to(i); doc.move_to(i);
const TString4 tipodoc = doc.get(DOC_TIPODOC).as_string();
const TTipo_documento& tipo = cached_tipodoc(tipodoc);
bool arc = false; bool arc = false;
if (is_definitive) if (is_definitive)
{ {
if (doc.get(DOC_STATO).as_string()[0] == tipo.stato_finale_stampa())
continue; // Evita lavoro inutile!
const TString4 codnum = doc.get(DOC_CODNUM).as_string(); const TString4 codnum = doc.get(DOC_CODNUM).as_string();
const TCodice_numerazione& cn = cached_numerazione(codnum); const TCodice_numerazione& cn = cached_numerazione(codnum);
arc = cn.auto_archive(); arc = cn.auto_archive();
@ -1103,8 +1113,6 @@ bool TReport_doc_app::print_loop(TRecordset& doc, TOutput_mode mode, bool is_def
doc.get(DOC_NDOC).as_int(), doc.get(DOC_TIPOCF).as_string()[0], doc.get(DOC_NDOC).as_int(), doc.get(DOC_TIPOCF).as_string()[0],
doc.get(DOC_CODCF).as_int()); doc.get(DOC_CODCF).as_int());
const TString4 tipodoc = doc.get(DOC_TIPODOC).as_string();
const TTipo_documento& tipo = cached_tipodoc(tipodoc);
const bool send_mail = ( mode == out_mail || mode == out_signed_mail) && get_mail_address().full(); const bool send_mail = ( mode == out_mail || mode == out_signed_mail) && get_mail_address().full();
const bool paperless = send_mail || mode == out_pdf || mode == out_signed_pdf; const bool paperless = send_mail || mode == out_pdf || mode == out_signed_pdf;
@ -1140,8 +1148,8 @@ bool TReport_doc_app::print_loop(TRecordset& doc, TOutput_mode mode, bool is_def
TString mesg; TString mesg;
mesg << tipo.descrizione() << TR(" n. ") << doc.get(DOC_NDOC) mesg << tipo.descrizione() << TR(" n. ") << doc.get(DOC_NDOC)
<< TR(" a ") << get_mail_address(); << TR(" del ") << doc.get(DOC_DATADOC) << TR(" a ") << get_mail_address();
log.log(0, mesg); mail_log.log(0, mesg);
} }
else else
{ {
@ -1203,7 +1211,7 @@ bool TReport_doc_app::print_loop(TRecordset& doc, TOutput_mode mode, bool is_def
{ {
ok = spotlite_send_mail(attachment); ok = spotlite_send_mail(attachment);
if (is_tmp) if (is_tmp)
remove(attachment); attachment.fremove();
} }
} }
delete mail_book; delete mail_book;
@ -1215,7 +1223,9 @@ bool TReport_doc_app::print_loop(TRecordset& doc, TOutput_mode mode, bool is_def
{ {
if (docs > 1) if (docs > 1)
set_next_pdf(0, "", 0L, ' ', 0L); //spegne l'archiviazione nell'esportazione;non si possono archiviare più docs in uno!!! set_next_pdf(0, "", 0L, ' ', 0L); //spegne l'archiviazione nell'esportazione;non si possono archiviare più docs in uno!!!
book.add(log);
if (mail_log.recordset()->items() > 0)
book.add(mail_log);
switch (mode) switch (mode)
{ {
case out_preview: book.preview(); break; case out_preview: book.preview(); break;
@ -1237,6 +1247,11 @@ bool TReport_doc_app::print_loop(TRecordset& doc, TOutput_mode mode, bool is_def
break; break;
} }
} }
else
{
if (mail_log.recordset()->items() > 0)
mail_log.preview();
}
if (mode == out_signed_mail || mode == out_signed_pdf) if (mode == out_signed_mail || mode == out_signed_pdf)
xvt_sign_stop(); xvt_sign_stop();

View File

@ -260,7 +260,7 @@ long TGenerazione_effetti::group_bills(TAssoc_array& group_array)
TString msg1,msg2; TString msg1,msg2;
TString16 codpag; TString16 codpag;
real imprata, imprataval, importo, importoval; real imprata, imprataval, importo, importoval;
msg1 = "Raggruppamento effetti"; msg1 = TR("Raggruppamento effetti");
#ifdef DBG #ifdef DBG
TProgind p(items,msg1,TRUE,TRUE,1); TProgind p(items,msg1,TRUE,TRUE,1);
@ -292,7 +292,7 @@ long TGenerazione_effetti::group_bills(TAssoc_array& group_array)
if (doc.read(provv,anno,codnum,numdoc) != NOERR) if (doc.read(provv,anno,codnum,numdoc) != NOERR)
continue; // Legge il documento (giusto saltare e proseguire se non lo trova?) continue; // Legge il documento (giusto saltare e proseguire se non lo trova?)
msg2 = "Documento: "; msg2 = TR("Documento: ");
msg2 << codnum << "/" << numdoc; msg2 << codnum << "/" << numdoc;
xvtil_statbar_set(msg2); xvtil_statbar_set(msg2);
do_events(); do_events();