Patch level : 12.0 1048
Files correlati : 777.exe 777200a.msk 777200c.msk f20.trr f20.dir Commento : Invio Certificazione unica per email
This commit is contained in:
parent
2221c7ba10
commit
f3a8ba10fb
@ -1016,6 +1016,18 @@ TTrasferimentoCU::TTrasferimentoCU(const char* path, char mode)
|
|||||||
TTrasferimentoCU::~TTrasferimentoCU()
|
TTrasferimentoCU::~TTrasferimentoCU()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
||||||
|
HIDDEN bool key_handler(TMask& m, KEY k)
|
||||||
|
{
|
||||||
|
// Per ora facciamo che il SHIFT+F12 attiva sempre il campo 3
|
||||||
|
if (k == K_SHIFT + K_F12)
|
||||||
|
{
|
||||||
|
m.reset(F_TESTEMAIL);
|
||||||
|
m.show(F_TESTEMAIL, !m.field(F_TESTEMAIL).shown());
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// TCU_mask
|
// TCU_mask
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -1026,7 +1038,7 @@ protected:
|
|||||||
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TInvio_CU_mask() : TAutomask("777200c") {}
|
TInvio_CU_mask() : TAutomask("777200c") { set_handler(key_handler); }
|
||||||
};
|
};
|
||||||
|
|
||||||
bool TInvio_CU_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
bool TInvio_CU_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||||
@ -1056,7 +1068,7 @@ protected:
|
|||||||
void fill_row(TMask & m, const char * tipoa, long percip);
|
void fill_row(TMask & m, const char * tipoa, long percip);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TCU_mask() : TAutomask("777200a") {}
|
TCU_mask() : TAutomask("777200a") { }
|
||||||
};
|
};
|
||||||
|
|
||||||
void TCU_mask::fill_row(TMask & m, const char * tipoa, long percip)
|
void TCU_mask::fill_row(TMask & m, const char * tipoa, long percip)
|
||||||
@ -1106,6 +1118,7 @@ bool TCU_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
|||||||
TFilename f = o.get();
|
TFilename f = o.get();
|
||||||
f.add(CU_DEFAULT_NAME);
|
f.add(CU_DEFAULT_NAME);
|
||||||
enable(DLG_PREVIEW, f.exist());
|
enable(DLG_PREVIEW, f.exist());
|
||||||
|
enable(DLG_EMAIL, f.exist());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DLG_PREVIEW:
|
case DLG_PREVIEW:
|
||||||
@ -1172,6 +1185,7 @@ bool TCU_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
|||||||
fill_row(m, tipoa, percip);
|
fill_row(m, tipoa, percip);
|
||||||
if (m.run() == K_ENTER)
|
if (m.run() == K_ENTER)
|
||||||
{
|
{
|
||||||
|
set_test_mail(m.get(F_TESTEMAIL));
|
||||||
FOR_EACH_SHEET_ITEM(sh, r)
|
FOR_EACH_SHEET_ITEM(sh, r)
|
||||||
{
|
{
|
||||||
if (sh.get_bool_row_cell(r, S_SELECTED))
|
if (sh.get_bool_row_cell(r, S_SELECTED))
|
||||||
@ -1181,13 +1195,14 @@ bool TCU_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
|||||||
email = sh.get_str_row_cell(r, S_EMAIL);
|
email = sh.get_str_row_cell(r, S_EMAIL);
|
||||||
|
|
||||||
TString query;
|
TString query;
|
||||||
|
|
||||||
query.format("USE %d SELECT (ANNO=%d)&&(TIPOA==\"%s\")&&(CODANAGR==%ld)\nBY TIPOA CODANAGR CAUSALE\nFROM CODDITTA=%ld\nTO CODDITTA=%ld",
|
query.format("USE %d SELECT (ANNO=%d)&&(TIPOA==\"%s\")&&(CODANAGR==%ld)\nBY TIPOA CODANAGR CAUSALE\nFROM CODDITTA=%ld\nTO CODDITTA=%ld",
|
||||||
LF_QUALA, anno, (const char *) tipoa, percip, codditta, codditta);
|
LF_QUALA, anno, (const char *) tipoa, percip, codditta, codditta);
|
||||||
|
|
||||||
TISAM_recordset perc(query);
|
TISAM_recordset perc(query);
|
||||||
TString ragsoc = sh.get_str_row_cell(r, S_RAGSOC);
|
TString ragsoc = sh.get_str_row_cell(r, S_RAGSOC);
|
||||||
|
|
||||||
send_cu(perc, quality, simple, anno, tipoa, percip, email, ragsoc, log);
|
send_cu(perc, quality, simple, anno, tipoa, percip, email, m.get(F_CCNEMAIL), ragsoc, m.get_bool(F_RECEIPT), log);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1195,7 +1210,8 @@ bool TCU_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
cantread_box(tmp);
|
cantread_box(tmp);
|
||||||
log.print_or_preview();
|
if (log.rows() > 0)
|
||||||
|
log.print_or_preview();
|
||||||
return false; // don't close mask
|
return false; // don't close mask
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -86,7 +86,8 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
void print_cu(const TFilename& datafile, int quality, bool simple);
|
void print_cu(const TFilename& datafile, int quality, bool simple);
|
||||||
void send_cu(TISAM_recordset& perc, int quality, bool syntetic, int anno, const char * tipoa, long percip, const char * email, const char * ragsoc, TLog_report & log);
|
void send_cu(TISAM_recordset& perc, int quality, bool syntetic, int anno, const char * tipoa, long percip,
|
||||||
|
const char * email, const char * ccnemail, const char * ragsoc, bool receipt, TLog_report & log);
|
||||||
void edit_cu(const TFilename& datafile, int quality, bool simple);
|
void edit_cu(const TFilename& datafile, int quality, bool simple);
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -1,4 +1,7 @@
|
|||||||
#define F_SHEET 201
|
#define F_SHEET 201
|
||||||
|
#define F_CCNEMAIL 202
|
||||||
|
#define F_RECEIPT 203
|
||||||
|
#define F_TESTEMAIL 204
|
||||||
|
|
||||||
#define S_SELECTED 101
|
#define S_SELECTED 101
|
||||||
#define S_EMAIL 102
|
#define S_EMAIL 102
|
||||||
|
@ -20,9 +20,25 @@ ENDPAGE
|
|||||||
|
|
||||||
PAGE "Invio Certificazione unica" 0 2 0 0
|
PAGE "Invio Certificazione unica" 0 2 0 0
|
||||||
|
|
||||||
|
STRING F_CCNEMAIL 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 "Email conoscenza "
|
||||||
|
END
|
||||||
|
|
||||||
|
BOOLEAN F_RECEIPT
|
||||||
|
BEGIN
|
||||||
|
PROMPT 70 1 "Ricevuta"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_TESTEMAIL 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 2 "Email prova "
|
||||||
|
FLAGS "H"
|
||||||
|
END
|
||||||
|
|
||||||
SPREADSHEET F_SHEET -1 -1
|
SPREADSHEET F_SHEET -1 -1
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 0 2 ""
|
PROMPT 0 4 ""
|
||||||
ITEM "@1"
|
ITEM "@1"
|
||||||
ITEM "Email@50"
|
ITEM "Email@50"
|
||||||
ITEM "Tipo"
|
ITEM "Tipo"
|
||||||
|
@ -924,7 +924,7 @@ void print_cu(const TFilename& datafile, int quality, bool syntetic)
|
|||||||
xvtil_statbar_set(NULL);
|
xvtil_statbar_set(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void send_cu(TISAM_recordset& perc, int quality, bool syntetic, int anno, const char * tipoa, long percip, const char * email, const char * ragsoc, TLog_report & log)
|
void send_cu(TISAM_recordset& perc, int quality, bool syntetic, int anno, const char * tipoa, long percip, const char * email, const char * ccnemail, const char * ragsoc, bool receipt, TLog_report & log)
|
||||||
{
|
{
|
||||||
TCU_report cur(quality, syntetic, true);
|
TCU_report cur(quality, syntetic, true);
|
||||||
TFilename datafile;
|
TFilename datafile;
|
||||||
@ -951,15 +951,15 @@ void send_cu(TISAM_recordset& perc, int quality, bool syntetic, int anno, const
|
|||||||
|
|
||||||
b.export_pdf(pdf, false);
|
b.export_pdf(pdf, false);
|
||||||
|
|
||||||
TToken_string to(email, ';'), cc("", ';'), ccn("", ';'), attachment(pdf, ';');
|
TToken_string to(email, ';'), cc("", ';'), ccn(ccnemail, ';'), attachment(pdf, ';');
|
||||||
TString msg("Invio a ");
|
TString msg("Invio a ");
|
||||||
TString subj("Certificazione unica anno ");
|
TString subj("Certificazione unica anno ");
|
||||||
TString message("Certificazione anno ");
|
TString message("Certificazione anno ");
|
||||||
|
|
||||||
subj << anno + 1;
|
subj << anno + 1;
|
||||||
message << anno + 1 << " di " << ragsoc;
|
message << anno + 1 << " di " << ragsoc << " (" << email << ")";
|
||||||
msg << email;
|
msg << email;
|
||||||
if (!send_mail(to, cc, ccn, subj, message, attachment))
|
if (!send_mail(to, cc, ccn, subj, message, attachment, false, receipt))
|
||||||
msg << " non ";
|
msg << " non ";
|
||||||
else
|
else
|
||||||
ini_set_bool(CONFIG_DITTA, "CU", format("%1s%6ld", (const char *)tipoa, percip), true);
|
ini_set_bool(CONFIG_DITTA, "CU", format("%1s%6ld", (const char *)tipoa, percip), true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user