Patch level : 12.0 716
Files correlati : fp Commento : Correzione problemi invio mail mancate consegna
This commit is contained in:
parent
72373dfb8e
commit
1a76da72e1
@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
class TMancati_mask : public TAutomask
|
class TMancati_mask : public TAutomask
|
||||||
{
|
{
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
enum {_codnum, _tipodoc, _dastato, _astato, _tiposdi};
|
enum {_codnum, _tipodoc, _dastato, _astato, _tiposdi};
|
||||||
|
|
||||||
@ -40,7 +41,7 @@ protected:
|
|||||||
void load_all_fields();
|
void load_all_fields();
|
||||||
|
|
||||||
bool _filter_changed;
|
bool _filter_changed;
|
||||||
|
friend class TMancati_app;
|
||||||
public:
|
public:
|
||||||
TMancati_mask() : TAutomask("fp0500a"), _filter_changed(true)
|
TMancati_mask() : TAutomask("fp0500a"), _filter_changed(true)
|
||||||
{
|
{
|
||||||
@ -120,6 +121,7 @@ void TMancati_mask::fill()
|
|||||||
|
|
||||||
const TDate dal = get(F_DATAINI);
|
const TDate dal = get(F_DATAINI);
|
||||||
const TDate al = get(F_DATAEND);
|
const TDate al = get(F_DATAEND);
|
||||||
|
TString filter_selected = get(F_FATTSEL);
|
||||||
|
|
||||||
#ifdef DBG
|
#ifdef DBG
|
||||||
enable(DLG_OK);
|
enable(DLG_OK);
|
||||||
@ -164,10 +166,14 @@ void TMancati_mask::fill()
|
|||||||
if(!check_doc_filter(doc))
|
if(!check_doc_filter(doc))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!chiave_paf(doc, hfatt, bfatt) || !paf0100f.search(nullptr, hfatt, bfatt) || paf0100f.sq_get("P1_GESTIONE") != "N" && paf0100f.sq_get("P1_ERRINT") != "M")
|
if (!chiave_paf(doc, hfatt, bfatt) || !paf0100f.search(nullptr, hfatt, bfatt) || paf0100f.sq_get("P1_GESTIONE") != "N" && paf0100f.sq_get("P1_ERREST") != "M")
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (filter_selected == "" && paf0100f.sq_get("P1_ERRINT") != MANCATA_SEND
|
||||||
|
|| filter_selected == "S" && paf0100f.sq_get("P1_ERRINT") == MANCATA_SEND
|
||||||
|
|| filter_selected == "A")
|
||||||
|
{
|
||||||
TToken_string& row = docs.row(-1);
|
TToken_string& row = docs.row(-1);
|
||||||
row = "";
|
row = "";
|
||||||
row.add(rec.get(DOC_ANNO).as_int(), 1);
|
row.add(rec.get(DOC_ANNO).as_int(), 1);
|
||||||
@ -178,9 +184,10 @@ void TMancati_mask::fill()
|
|||||||
row.add(rec.get(CFV_CODCF).as_int());
|
row.add(rec.get(CFV_CODCF).as_int());
|
||||||
row.add(rec.get("20." CLI_RAGSOC).as_string());
|
row.add(rec.get("20." CLI_RAGSOC).as_string());
|
||||||
row.add(rec.get("20." CLI_COFI).as_string());
|
row.add(rec.get("20." CLI_COFI).as_string());
|
||||||
|
|
||||||
row.add(rec.get("20." CLI_DOCMAIL).as_string()); // Indirizzo email
|
row.add(rec.get("20." CLI_DOCMAIL).as_string()); // Indirizzo email
|
||||||
row.add(rec.get("20." CLI_BYMAIL).as_string()); // Consenso invio email
|
row.add(rec.get("20." CLI_BYMAIL).as_string()); // Consenso invio email
|
||||||
|
row.add(paf0100f.sq_get("P1_ERRINT") == MANCATA_SEND? "X" : "");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
docs.force_update();
|
docs.force_update();
|
||||||
@ -313,18 +320,8 @@ bool TMancati_mask::check_doc_filter(const TDocumentoEsteso& d) const
|
|||||||
|
|
||||||
class TMancati_app : public TSkeleton_application
|
class TMancati_app : public TSkeleton_application
|
||||||
{
|
{
|
||||||
//int _anno;
|
|
||||||
//TString16 _codnum, _tipodoc;
|
|
||||||
//long _ndoc, _codcf;
|
|
||||||
//char _tipocf;
|
|
||||||
|
|
||||||
//void set_next_pdf(const int anno, const TFixed_string& codnum, const TFixed_string& tipodoc, const long ndoc, const long codcf);
|
|
||||||
//bool get_next_pdf(int anno, long ditta, const char* codnum, long ndoc, long codcf, TFilename& pdf) const override;
|
|
||||||
//bool get_mail_address(TToken_string& to, TToken_string& cc) const;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual bool create();
|
virtual bool create();
|
||||||
|
|
||||||
virtual bool destroy();
|
virtual bool destroy();
|
||||||
virtual void main_loop();
|
virtual void main_loop();
|
||||||
|
|
||||||
@ -339,22 +336,43 @@ void TMancati_app::main_loop()
|
|||||||
TString_array& sht = mask.sfield(F_DOCS).rows_array();
|
TString_array& sht = mask.sfield(F_DOCS).rows_array();
|
||||||
TFp_mail_sender mail_sender;
|
TFp_mail_sender mail_sender;
|
||||||
|
|
||||||
|
if ( !mail_sender.set_alleg(fp_settings().get_allega_fat()) )
|
||||||
|
{
|
||||||
|
TString msg; msg << "Non è possibile allegare alla fattura:\nAllega in fattura disabilitato nelle impostazioni.\n"
|
||||||
|
<< "Inviare lo stesso la mail\nNotifica Mancata Consegna senza allegato?";
|
||||||
|
if (!noyes_box(msg)) // Se non sono abilitati gli allegati in fattura avviso e chiedo se procedere lo stesso
|
||||||
|
continue; // Esco senza inviare (se risponde no)
|
||||||
|
} // Altrimenti procedo lo stesso con l'invio mail senza pdf
|
||||||
|
|
||||||
|
FOR_EACH_ARRAY_ROW(sht, nr, row)
|
||||||
|
{
|
||||||
|
const TString mail = row->get(mask.sfield(F_DOCS).cid2index(S_DOCMAIL));
|
||||||
|
bool accord = TString(row->get(mask.sfield(F_DOCS).cid2index(S_BYMAIL))) == "X";
|
||||||
|
if (row->starts_with("X") && (mail.blank() || !accord)) {
|
||||||
|
error_box("Attenzione: c'è almeno un cliente senza indirizzo email o senza il consenso per l'invio email.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
FOR_EACH_ARRAY_ROW(sht, r, riga)
|
FOR_EACH_ARRAY_ROW(sht, r, riga)
|
||||||
{
|
{
|
||||||
|
if (riga->starts_with("X"))
|
||||||
if (riga->starts_with("X") && riga->get(mask.sfield(F_DOCS).cid2index(S_BYMAIL)))
|
|
||||||
{
|
{
|
||||||
const int anno = riga->get_int(mask.sfield(F_DOCS).cid2index(S_ANNO));
|
const int anno = riga->get_int(mask.sfield(F_DOCS).cid2index(S_ANNO));
|
||||||
const long ndoc = riga->get_long(mask.sfield(F_DOCS).cid2index(S_NDOC));
|
const long ndoc = riga->get_long(mask.sfield(F_DOCS).cid2index(S_NDOC));
|
||||||
const TFixed_string codnum(riga->get(mask.sfield(F_DOCS).cid2index(S_CODNUM)));
|
const TFixed_string codnum(riga->get(mask.sfield(F_DOCS).cid2index(S_CODNUM)));
|
||||||
const TFixed_string tipodoc(riga->get(mask.sfield(F_DOCS).cid2index(S_TIPODOC)));
|
const TFixed_string tipodoc(riga->get(mask.sfield(F_DOCS).cid2index(S_TIPODOC)));
|
||||||
const long codcf = riga->get_long(mask.sfield(F_DOCS).cid2index(S_CLIENTE));
|
const long codcf = riga->get_long(mask.sfield(F_DOCS).cid2index(S_CLIENTE));
|
||||||
const TString mail = riga->get_long(mask.sfield(F_DOCS).cid2index(S_DOCMAIL));
|
const TString mail = riga->get(mask.sfield(F_DOCS).cid2index(S_DOCMAIL));
|
||||||
bool pdf;
|
bool accord = TString(riga->get(mask.sfield(F_DOCS).cid2index(S_BYMAIL))) == "X";
|
||||||
mail_sender.set_doc(anno, ndoc, codnum, tipodoc, codcf, mail);
|
TString ragsoc = riga->get(mask.sfield(F_DOCS).cid2index(S_RAGSOC));
|
||||||
mail_sender.send();
|
bool sent = TString(riga->get(mask.sfield(F_DOCS).cid2index(S_SENT))) == "X";
|
||||||
|
|
||||||
riga->add("", 0);
|
mail_sender.set_doc(anno, ndoc, codnum, tipodoc, codcf, mail, accord, ragsoc, sent);
|
||||||
|
if (mail_sender.send()) {
|
||||||
|
riga->add("", 0); // Se l'invio avviene con successo sfleggo la riga
|
||||||
|
riga->add("X", 11); // E segno inviata
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
#define START_MASK 401
|
#define START_MASK 401
|
||||||
#define F_DATAINI 401
|
#define F_DATAINI 401
|
||||||
#define F_DATAEND 402
|
#define F_DATAEND 402
|
||||||
#define F_SETDEFCOD 403
|
#define F_FATTSEL 403
|
||||||
#define F_SETCODEST 404
|
#define F_SETDEFCOD 404
|
||||||
#define F_VALCODEST 405
|
#define F_SETCODEST 405
|
||||||
|
#define F_VALCODEST 406
|
||||||
#define END_MASK 499
|
#define END_MASK 499
|
||||||
|
|
||||||
|
|
||||||
@ -28,3 +29,4 @@
|
|||||||
#define S_COFI 109
|
#define S_COFI 109
|
||||||
#define S_DOCMAIL 110
|
#define S_DOCMAIL 110
|
||||||
#define S_BYMAIL 111
|
#define S_BYMAIL 111
|
||||||
|
#define S_SENT 112
|
||||||
|
@ -10,16 +10,8 @@ END
|
|||||||
|
|
||||||
BUTTON DLG_OK 2 2
|
BUTTON DLG_OK 2 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 1 "Elabora"
|
PROMPT 1 1 "Invia Mail"
|
||||||
PICTURE TOOL_ELABORA
|
|
||||||
FLAGS "D"
|
|
||||||
END
|
|
||||||
|
|
||||||
BUTTON DLG_EMAIL 10 2
|
|
||||||
BEGIN
|
|
||||||
PROMPT 5 1 "Mail"
|
|
||||||
PICTURE TOOL_EMAIL
|
PICTURE TOOL_EMAIL
|
||||||
MESSAGE EXIT,69
|
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
@ -43,6 +35,15 @@ BEGIN
|
|||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
END
|
END
|
||||||
|
|
||||||
|
RADIOBUTTON F_FATTSEL 3 80
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 2 "Fatture da visualizzare"
|
||||||
|
ITEM "|Non inviate"
|
||||||
|
ITEM "S|Già spedite"
|
||||||
|
ITEM "A|Tutte"
|
||||||
|
FLAGS "Z"
|
||||||
|
END
|
||||||
|
|
||||||
SPREADSHEET F_DOCUMENTI_TIPO 80 5
|
SPREADSHEET F_DOCUMENTI_TIPO 80 5
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 6 ""
|
PROMPT 1 6 ""
|
||||||
@ -71,6 +72,7 @@ BEGIN
|
|||||||
ITEM "Codice Fiscale@16"
|
ITEM "Codice Fiscale@16"
|
||||||
ITEM "EMail@50"
|
ITEM "EMail@50"
|
||||||
ITEM "Consenso\ninvio@7"
|
ITEM "Consenso\ninvio@7"
|
||||||
|
ITEM "SENT@4"
|
||||||
END
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
@ -217,13 +219,19 @@ END
|
|||||||
|
|
||||||
STRING S_DOCMAIL 50
|
STRING S_DOCMAIL 50
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 6 "email"
|
PROMPT 1 7 "email"
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
BOOLEAN S_BYMAIL
|
BOOLEAN S_BYMAIL
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 7 "Consenso invio email"
|
PROMPT 1 8 "Consenso invio email"
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
BOOLEAN S_SENT
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 9 "Sent"
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#include <cg2103.h>
|
#include <cg2103.h>
|
||||||
|
|
||||||
#define SQL_FLD "sql/"
|
#define SQL_FLD "sql/"
|
||||||
|
#define MANCATA_SEND "S" // Se la mail di mancata consegna è già stata inviata P1_ERRINT è segnato con "S"
|
||||||
enum { no_pdf = -1, pdf_ok = 0, no_alleg = -2};
|
enum { no_pdf = -1, pdf_ok = 0, no_alleg = -2};
|
||||||
|
|
||||||
// Ritorna la connessione al DB paf secondo i parametri impostati nel programma di configurazione
|
// Ritorna la connessione al DB paf secondo i parametri impostati nel programma di configurazione
|
||||||
@ -306,25 +307,34 @@ public:
|
|||||||
|
|
||||||
TFP_righe_custom();
|
TFP_righe_custom();
|
||||||
};
|
};
|
||||||
|
|
||||||
class TFp_mail_sender
|
class TFp_mail_sender
|
||||||
{
|
{
|
||||||
int _anno;
|
int _anno;
|
||||||
TString16 _codnum;
|
TString16 _codnum;
|
||||||
const TTipo_documento* _tipodoc;
|
const TTipo_documento* _tipodoc;
|
||||||
long _ndoc, _codcf;
|
long _ndoc;
|
||||||
TString _mail, _pdf_path, _pdf_name;
|
long _codcf;
|
||||||
|
TString _mail;
|
||||||
|
TString _pdf_path;
|
||||||
|
TString _pdf_name;
|
||||||
|
bool _alleg;
|
||||||
|
bool _accord;
|
||||||
|
TString _ragsoc;
|
||||||
|
int _error;
|
||||||
|
bool _sent;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void set_doc(const int anno, const long ndoc, const TFixed_string& codnum, const TFixed_string& tipodoc, const long codcf, TString mail);
|
void set_doc(const int anno, const long ndoc, const TFixed_string& codnum, const TFixed_string& tipodoc, const long codcf, TString mail, bool accord, TString ragsoc, bool sent);
|
||||||
bool genera_pdf();
|
bool genera_pdf();
|
||||||
void send();
|
bool send();
|
||||||
bool get_mail(TToken_string& to, TToken_string& cc, TToken_string& ccn, TString& subj, TString& text, TToken_string& attach, short& flags);
|
bool get_mail(TToken_string& to, TToken_string& cc, TToken_string& ccn, TString& subj, TString& text, TToken_string& attach, short& flags);
|
||||||
bool spotlite_send_mail(const TFilename& pdf);
|
bool spotlite_send_mail(const TFilename& pdf);
|
||||||
bool spotlite_send_mail();
|
bool spotlite_send_mail();
|
||||||
|
bool set_alleg(const bool allega_fat);
|
||||||
|
|
||||||
TFp_mail_sender() { }
|
TFp_mail_sender() { _error = -1; }
|
||||||
TFp_mail_sender(const int anno, const long ndoc, const TFixed_string& codnum, const TFixed_string& tipodoc, const long codcf, TString mail)
|
TFp_mail_sender(const int anno, const long ndoc, const TFixed_string& codnum, const TFixed_string& tipodoc, const long codcf, TString mail, bool accord, TString ragsoc, bool sent)
|
||||||
{ set_doc(anno, ndoc, codnum, tipodoc, codcf, mail); }
|
{ set_doc(anno, ndoc, codnum, tipodoc, codcf, mail, accord, ragsoc, sent); }
|
||||||
};
|
};
|
||||||
#endif // __FPLIB_H
|
#endif // __FPLIB_H
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
class TExternal_app;
|
class TExternal_app;
|
||||||
|
|
||||||
void TFp_mail_sender::set_doc(const int anno, const long ndoc, const TFixed_string& codnum, const TFixed_string& tipodoc, const long codcf, TString mail)
|
void TFp_mail_sender::set_doc(const int anno, const long ndoc, const TFixed_string& codnum, const TFixed_string& tipodoc, const long codcf, TString mail, bool accord, TString ragsoc, bool sent)
|
||||||
{
|
{
|
||||||
_anno = anno;
|
_anno = anno;
|
||||||
_codnum = codnum;
|
_codnum = codnum;
|
||||||
@ -14,6 +14,9 @@ void TFp_mail_sender::set_doc(const int anno, const long ndoc, const TFixed_stri
|
|||||||
_ndoc = ndoc;
|
_ndoc = ndoc;
|
||||||
_codcf = codcf;
|
_codcf = codcf;
|
||||||
_mail = mail;
|
_mail = mail;
|
||||||
|
_accord = accord;
|
||||||
|
_ragsoc = ragsoc;
|
||||||
|
_sent = sent;
|
||||||
_pdf_name.cut(0) << SLASH << _anno << '_' << _codnum << '_' << _ndoc << ".pdf";
|
_pdf_name.cut(0) << SLASH << _anno << '_' << _codnum << '_' << _ndoc << ".pdf";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -25,6 +28,7 @@ bool TFp_mail_sender::genera_pdf()
|
|||||||
<< " D " << _ndoc << " X P 1 D"; // X: stampa su disco, P: provvisorio, 1: 1 copia, D: disabilita archiviazione
|
<< " D " << _ndoc << " X P 1 D"; // X: stampa su disco, P: provvisorio, 1: 1 copia, D: disabilita archiviazione
|
||||||
|
|
||||||
TExternal_app interattivo(commandline);
|
TExternal_app interattivo(commandline);
|
||||||
|
|
||||||
if (interattivo.run() != NOERR)
|
if (interattivo.run() != NOERR)
|
||||||
{
|
{
|
||||||
TString msgerr = "Fallita generazione PDF documento ";
|
TString msgerr = "Fallita generazione PDF documento ";
|
||||||
@ -49,46 +53,73 @@ bool TFp_mail_sender::genera_pdf()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Creo se non c'è il pdf e lo allego alla mail per l'invio
|
// Creo se non c'è il pdf e lo allego alla mail per l'invio
|
||||||
void TFp_mail_sender::send()
|
bool TFp_mail_sender::send()
|
||||||
|
{
|
||||||
|
// Controllo per sicurezza quando si prova a rifare l'invio di una fattura già spedita
|
||||||
|
if (_sent)
|
||||||
|
{
|
||||||
|
if(_error == -1)
|
||||||
|
_error = custom_box("ATTENZIONE fattura già spedita. Reinviare?", "Sì a tutti", "No", "Annulla");
|
||||||
|
|
||||||
|
if (_error == K_NO)
|
||||||
|
_error = -1;
|
||||||
|
if (_error == -1 || _error == K_SPACE)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool ok = false;
|
||||||
|
if (_alleg && !_mail.blank() && _accord)
|
||||||
{
|
{
|
||||||
bool main_prof = false;
|
|
||||||
if (fp_settings().get_allega_fat()) {
|
|
||||||
_pdf_path = fp_settings().get_fld_dest_usr(); // Cartella dove ci sono i pdf generati
|
_pdf_path = fp_settings().get_fld_dest_usr(); // Cartella dove ci sono i pdf generati
|
||||||
|
|
||||||
TFilename pdf; pdf << _pdf_path << _pdf_name;
|
TFilename pdf; pdf << _pdf_path << _pdf_name;
|
||||||
|
|
||||||
int pdf_exist = pdf.exist();
|
const int pdf_exist = pdf.exist();
|
||||||
bool new_f = false; // Bool. se creo un nuovo pdf (in tempdir)
|
|
||||||
if (pdf_exist)
|
if (pdf_exist)
|
||||||
spotlite_send_mail(pdf); // -> Invio mail con PDF già esistente
|
ok = spotlite_send_mail(pdf); // -> Invio mail con PDF già esistente
|
||||||
else if( !((new_f = genera_pdf())) ) // Genero pdf se non esiste già
|
else if (genera_pdf()) // Genero pdf se non esiste già (in tempdir)
|
||||||
{ // Manda già un messaggio di errore generazione se fallisce la generazione
|
{ // Manda già un messaggio di errore generazione se fallisce la generazione
|
||||||
bool send_no_pdf = noyes_box("Inviare lo stesso la mail senza il pdf allegato?"); // Se la generazione fallisce chiedo se procedere lo stesso
|
|
||||||
if (!send_no_pdf)
|
|
||||||
return; // Esco se non voglio inviare mail senza pdf
|
|
||||||
spotlite_send_mail(); // Se no, procedo con mail senza pdf
|
|
||||||
}
|
|
||||||
else if(new_f) {
|
|
||||||
TFilename newf_pdf; newf_pdf << _pdf_path << _pdf_name;
|
TFilename newf_pdf; newf_pdf << _pdf_path << _pdf_name;
|
||||||
spotlite_send_mail(newf_pdf);
|
ok = spotlite_send_mail(newf_pdf);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
TString msg; msg << "Inviare lo stesso la mail senza il pdf allegato?";
|
||||||
|
if (noyes_box(msg)) // Se la generazione fallisce chiedo se procedere lo stesso
|
||||||
|
ok = spotlite_send_mail(); // Se sì, procedo con mail senza pdf
|
||||||
|
} // Se no, esco senza inviare
|
||||||
}
|
}
|
||||||
else
|
else if (!_alleg && _accord)
|
||||||
|
ok = spotlite_send_mail();
|
||||||
|
|
||||||
|
if(ok)
|
||||||
{
|
{
|
||||||
error_box("Non è possibile allegare fattura pdf in allegato:\nAllega in fattura disabilitato nelle impostazioni.");
|
TDocumento fdoc('D', _anno, _codnum, _ndoc);
|
||||||
|
TString hfatt, bfatt;
|
||||||
|
TPaf_record paf0100f("PAF0100F");
|
||||||
|
TString query;
|
||||||
|
if (chiave_paf(fdoc, hfatt, bfatt) && paf0100f.search(nullptr, hfatt, bfatt))
|
||||||
|
{
|
||||||
|
query << "UPDATE PAF0100F SET P1_ERRINT = 'S' WHERE P1_KEYHEADERFATT = '" << hfatt << "' AND P1_KEYBODYFATT = '" << bfatt << "'";
|
||||||
|
fp_db().sq_set_exec(query);
|
||||||
|
fp_db().sq_commit();
|
||||||
}
|
}
|
||||||
|
#ifdef DBG
|
||||||
|
else
|
||||||
|
error_box("Attenzione non è stato possibile trovare il documento");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TFp_mail_sender::get_mail(TToken_string& to, TToken_string& cc, TToken_string& ccn,
|
bool TFp_mail_sender::get_mail(TToken_string& to, TToken_string& cc, TToken_string& ccn,
|
||||||
TString& subj, TString& text, TToken_string& attach, short& ui)
|
TString& subj, TString& text, TToken_string& attach, short& ui)
|
||||||
{
|
{
|
||||||
|
to.cut(0) << _mail;
|
||||||
//to.cut(0) << _mail;
|
// to.cut(0) << "spalacino@sirio-is.it";
|
||||||
to.cut(0) << "spalacino@sirio-is.it";
|
|
||||||
const TDocumento doc('D', _anno, _codnum, _ndoc);
|
const TDocumento doc('D', _anno, _codnum, _ndoc);
|
||||||
doc.riferimento(subj);
|
doc.riferimento(subj);
|
||||||
if (subj.blank())
|
|
||||||
subj = doc.tipo().descrizione();
|
|
||||||
subj << "Notifica Mancata Consegna Fattura n. " << _ndoc
|
subj << "Notifica Mancata Consegna Fattura n. " << _ndoc
|
||||||
<< ' ' << prefix().firm().ragione_sociale();
|
<< ' ' << prefix().firm().ragione_sociale();
|
||||||
|
|
||||||
@ -105,9 +136,8 @@ bool TFp_mail_sender::get_mail(TToken_string& to, TToken_string& cc, TToken_stri
|
|||||||
text << saluti << '\n';
|
text << saluti << '\n';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
text << "Cordiali Saluti " << prefix().firm().ragione_sociale();
|
text << "Cordiali Saluti " << prefix().firm().ragione_sociale();
|
||||||
}
|
|
||||||
text.trim();
|
text.trim();
|
||||||
if (to.full())
|
if (to.full())
|
||||||
ui &= ~0x1; // No user interface
|
ui &= ~0x1; // No user interface
|
||||||
@ -148,3 +178,9 @@ bool TFp_mail_sender::spotlite_send_mail()
|
|||||||
xvt_mail_send(to, cc, ccn, subj, text, attach, flags)) != 0;
|
xvt_mail_send(to, cc, ccn, subj, text, attach, flags)) != 0;
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TFp_mail_sender::set_alleg(const bool allega_fat)
|
||||||
|
{
|
||||||
|
_alleg = allega_fat;
|
||||||
|
return _alleg;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user