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:
parent
15258127ae
commit
82df15a4bc
@ -993,7 +993,11 @@ bool TReport_doc_app::get_next_mail(TToken_string& to, TToken_string& cc, TToken
|
||||
TDocumento doc('D', _anno, _codnum, _ndoc);
|
||||
doc.riferimento(subj);
|
||||
if (subj.blank())
|
||||
{
|
||||
subj = doc.tipo().descrizione();
|
||||
subj << ' ' << _ndoc << TR(" del ") << doc.get(DOC_DATADOC)
|
||||
<< ' ' << prefix().firm().ragione_sociale();
|
||||
}
|
||||
text << TR("Invio documento ") << subj;
|
||||
if (to.full())
|
||||
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
|
||||
TDoc_book book; // Destinazione dell'intera stampa
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
const TString4 tipodoc = doc.get(DOC_TIPODOC).as_string();
|
||||
const TTipo_documento& tipo = cached_tipodoc(tipodoc);
|
||||
|
||||
bool arc = false;
|
||||
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 TCodice_numerazione& cn = cached_numerazione(codnum);
|
||||
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_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 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;
|
||||
mesg << tipo.descrizione() << TR(" n. ") << doc.get(DOC_NDOC)
|
||||
<< TR(" a ") << get_mail_address();
|
||||
log.log(0, mesg);
|
||||
<< TR(" del ") << doc.get(DOC_DATADOC) << TR(" a ") << get_mail_address();
|
||||
mail_log.log(0, mesg);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1203,7 +1211,7 @@ bool TReport_doc_app::print_loop(TRecordset& doc, TOutput_mode mode, bool is_def
|
||||
{
|
||||
ok = spotlite_send_mail(attachment);
|
||||
if (is_tmp)
|
||||
remove(attachment);
|
||||
attachment.fremove();
|
||||
}
|
||||
}
|
||||
delete mail_book;
|
||||
@ -1215,7 +1223,9 @@ bool TReport_doc_app::print_loop(TRecordset& doc, TOutput_mode mode, bool is_def
|
||||
{
|
||||
if (docs > 1)
|
||||
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)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mail_log.recordset()->items() > 0)
|
||||
mail_log.preview();
|
||||
}
|
||||
|
||||
if (mode == out_signed_mail || mode == out_signed_pdf)
|
||||
xvt_sign_stop();
|
||||
|
@ -739,11 +739,11 @@ public:
|
||||
TCodgiac_livelli & livelli() const ;
|
||||
void dirty_fields();
|
||||
|
||||
TAssoc_array & tabella_iva(bool solo_imponibili = false) { update_tabella_iva(solo_imponibili); return _tabella_iva; }
|
||||
TAssoc_array& tabella_iva(bool solo_imponibili = false) { update_tabella_iva(solo_imponibili); return _tabella_iva; }
|
||||
TCli_for& clifor(bool force_reload = false) const;
|
||||
TOccasionale & occas() const;
|
||||
const TAgente & agente(bool first = true) const;
|
||||
const TString & riferimento(TString& rif) const { return tipo().riferimento(*this, rif); }
|
||||
TOccasionale& occas() const;
|
||||
const TAgente& agente(bool first = true) const;
|
||||
const TString& riferimento(TString& rif) const { return tipo().riferimento(*this, rif); }
|
||||
|
||||
virtual TRecord_array& body(int logicnum = 0) const;
|
||||
virtual TDocumento & operator =(const TDocumento & d) {return copy(d);}
|
||||
|
@ -260,7 +260,7 @@ long TGenerazione_effetti::group_bills(TAssoc_array& group_array)
|
||||
TString msg1,msg2;
|
||||
TString16 codpag;
|
||||
real imprata, imprataval, importo, importoval;
|
||||
msg1 = "Raggruppamento effetti";
|
||||
msg1 = TR("Raggruppamento effetti");
|
||||
|
||||
#ifdef DBG
|
||||
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)
|
||||
continue; // Legge il documento (giusto saltare e proseguire se non lo trova?)
|
||||
|
||||
msg2 = "Documento: ";
|
||||
msg2 = TR("Documento: ");
|
||||
msg2 << codnum << "/" << numdoc;
|
||||
xvtil_statbar_set(msg2);
|
||||
do_events();
|
||||
|
Loading…
x
Reference in New Issue
Block a user