Patch level : 1.7 at
Files correlati : at8.exe Ricompilazione Demo : [ ] Commento : correzioni su trasf. da Cetraplus git-svn-id: svn://10.65.10.50/trunk@12550 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
12eea0bede
commit
50441f610f
622
at/at8900.cpp
622
at/at8900.cpp
@ -1048,31 +1048,35 @@ bool TCtpr2at::accesso(const TString& istruzione)
|
|||||||
TString8 luogodon_at;
|
TString8 luogodon_at;
|
||||||
TString16& str = (TString16&) record["DT_ACCESSO"];
|
TString16& str = (TString16&) record["DT_ACCESSO"];
|
||||||
const TDate datadon = TDate(atoi(str.sub(8,10)) ,atoi(str.sub(5,7)), atoi(str.sub(0,4)));
|
const TDate datadon = TDate(atoi(str.sub(8,10)) ,atoi(str.sub(5,7)), atoi(str.sub(0,4)));
|
||||||
TString16& codabar = (TString16&) record["CODABAR"];
|
TDate datanulla(NULLDATE);
|
||||||
_donaz->setkey(2);
|
if (datadon != datanulla)
|
||||||
TRectype& recdon = _donaz->curr();
|
{
|
||||||
recdon.zero();
|
TString16& codabar = (TString16&) record["CODABAR"];
|
||||||
recdon.put(DON_CODICE, recsog.get(SOG_CODICE));
|
_donaz->setkey(2);
|
||||||
recdon.put(DON_DATADON, datadon);
|
TRectype& recdon = _donaz->curr();
|
||||||
if (_donaz->read() == NOERR)
|
recdon.zero();
|
||||||
{
|
recdon.put(DON_CODICE, recsog.get(SOG_CODICE));
|
||||||
if ((codabar.left(2) == "52") || (codabar.left(2) == "53") || (codabar.left(2) == "54") || (codabar.left(2) == "55") || (codabar.left(2) == "56") || (codabar.left(2) == "57"))
|
recdon.put(DON_DATADON, datadon);
|
||||||
luogodon_at = "0001";
|
if (_donaz->read() == NOERR)
|
||||||
else
|
{
|
||||||
{
|
if ((codabar.left(2) == "52") || (codabar.left(2) == "53") || (codabar.left(2) == "54") || (codabar.left(2) == "55") || (codabar.left(2) == "56") || (codabar.left(2) == "57"))
|
||||||
if (recsog.get(SOG_CODSEZ) == "13")
|
luogodon_at = "0001";
|
||||||
luogodon_at = "1301";
|
else
|
||||||
else
|
{
|
||||||
luogodon_at = "0000";
|
if (recsog.get(SOG_CODSEZ) == "13")
|
||||||
}
|
luogodon_at = "1301";
|
||||||
recdon.put(DON_LUOGODON, luogodon_at);
|
else
|
||||||
_donaz->rewrite();
|
luogodon_at = "0000";
|
||||||
TString16& prog = (TString16&) record["PROG_GIORNAL"];
|
}
|
||||||
TString80 chiave = str;
|
recdon.put(DON_LUOGODON, luogodon_at);
|
||||||
chiave << prog;
|
_donaz->rewrite();
|
||||||
if (!_array_donaz->is_key(chiave))
|
TString16& prog = (TString16&) record["PROG_GIORNAL"];
|
||||||
_array_donaz->add(chiave, record["ID_ANAGRAFICA"]) ;
|
TString80 chiave = str;
|
||||||
}
|
chiave << prog;
|
||||||
|
if (!_array_donaz->is_key(chiave))
|
||||||
|
_array_donaz->add(chiave, record["ID_ANAGRAFICA"]) ;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1080,122 +1084,126 @@ bool TCtpr2at::accesso(const TString& istruzione)
|
|||||||
TString4 tipocon = _configfile->get(tp_accesso, "ACCESSI");
|
TString4 tipocon = _configfile->get(tp_accesso, "ACCESSI");
|
||||||
TString16& str = (TString16&) record["DT_ACCESSO"];
|
TString16& str = (TString16&) record["DT_ACCESSO"];
|
||||||
TDate datacon = TDate(atoi(str.sub(8,10)) ,atoi(str.sub(5,7)), atoi(str.sub(0,4)));
|
TDate datacon = TDate(atoi(str.sub(8,10)) ,atoi(str.sub(5,7)), atoi(str.sub(0,4)));
|
||||||
TString16& prog = (TString16&) record["PROG_GIORNAL"];
|
TDate datanulla(NULLDATE);
|
||||||
TString80 chiave = str;
|
if (datacon != datanulla)
|
||||||
chiave << prog;
|
|
||||||
if (!_array_donaz->is_key(chiave))
|
|
||||||
_array_donaz->add(chiave, record["ID_ANAGRAFICA"]) ;
|
|
||||||
if (tipocon.empty() && _message)
|
|
||||||
{
|
{
|
||||||
print_line(stampa);
|
TString16& prog = (TString16&) record["PROG_GIORNAL"];
|
||||||
stampa = "Tipo accesso ";
|
TString80 chiave = str;
|
||||||
stampa << tp_accesso[0] << " del ";
|
chiave << prog;
|
||||||
stampa << datacon.string() << " senza corrispondenza. Non inserito.";
|
if (!_array_donaz->is_key(chiave))
|
||||||
print_line(stampa);
|
_array_donaz->add(chiave, record["ID_ANAGRAFICA"]) ;
|
||||||
tipocon = "VS";
|
if (tipocon.empty() && _message)
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
TRectype* recc = new TRectype(LF_CONTSAN);
|
|
||||||
recc->put(CON_CODICE, recsog.get(SOG_CODICE));
|
|
||||||
recc->put(CON_DATACON, datacon);
|
|
||||||
recc->put(CON_TIPOCON, tipocon);
|
|
||||||
recc->put(CON_RESPONSAB, "CETRAPLUS");
|
|
||||||
|
|
||||||
bool insert = FALSE;
|
|
||||||
bool exist = FALSE;
|
|
||||||
TRectype* keyc = new TRectype(LF_CONTSAN);
|
|
||||||
keyc->put(CON_CODICE, recsog.get(SOG_CODICE));
|
|
||||||
int err = _scontrolli->read(keyc);
|
|
||||||
if (err == NOERR)
|
|
||||||
{
|
{
|
||||||
int r=_scontrolli->rows();
|
print_line(stampa);
|
||||||
while (r>=1 && !insert && !exist)
|
stampa = "Tipo accesso ";
|
||||||
|
stampa << tp_accesso[0] << " del ";
|
||||||
|
stampa << datacon.string() << " senza corrispondenza. Non inserito.";
|
||||||
|
print_line(stampa);
|
||||||
|
tipocon = "VS";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TRectype* recc = new TRectype(LF_CONTSAN);
|
||||||
|
recc->put(CON_CODICE, recsog.get(SOG_CODICE));
|
||||||
|
recc->put(CON_DATACON, datacon);
|
||||||
|
recc->put(CON_TIPOCON, tipocon);
|
||||||
|
recc->put(CON_RESPONSAB, "CETRAPLUS");
|
||||||
|
|
||||||
|
bool insert = FALSE;
|
||||||
|
bool exist = FALSE;
|
||||||
|
TRectype* keyc = new TRectype(LF_CONTSAN);
|
||||||
|
keyc->put(CON_CODICE, recsog.get(SOG_CODICE));
|
||||||
|
int err = _scontrolli->read(keyc);
|
||||||
|
if (err == NOERR)
|
||||||
{
|
{
|
||||||
const TRectype& riga = _scontrolli->row(r);
|
int r=_scontrolli->rows();
|
||||||
const TDate d = riga.get(CON_DATACON);
|
while (r>=1 && !insert && !exist)
|
||||||
if (datacon==d) // esiste gia' un controllo in questa data
|
|
||||||
{
|
{
|
||||||
// verifico la priorita
|
const TRectype& riga = _scontrolli->row(r);
|
||||||
TString4 tipoes = riga.get(CON_TIPOCON);
|
const TDate d = riga.get(CON_DATACON);
|
||||||
if (tipoes != tipocon)
|
if (datacon==d) // esiste gia' un controllo in questa data
|
||||||
{
|
{
|
||||||
int p_tipocon = _configfile->get_int(tipocon, "PRIORITA");
|
// verifico la priorita
|
||||||
int p_tipoes = _configfile->get_int(tipoes, "PRIORITA");
|
TString4 tipoes = riga.get(CON_TIPOCON);
|
||||||
if (p_tipocon == 999)
|
if (tipoes != tipocon)
|
||||||
{
|
{
|
||||||
++datacon;
|
int p_tipocon = _configfile->get_int(tipocon, "PRIORITA");
|
||||||
recc->put(CON_DATACON, datacon);
|
int p_tipoes = _configfile->get_int(tipoes, "PRIORITA");
|
||||||
recc->put(CON_RESPONSAB, "CETRAPLUS ieri");
|
if (p_tipocon == 999)
|
||||||
recc->put(CON_PROGCON,r+1);
|
|
||||||
_scontrolli->insert_row(recc);
|
|
||||||
insert = TRUE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (p_tipocon > p_tipoes)
|
|
||||||
{
|
{
|
||||||
recc->put(CON_PROGCON,riga.get(CON_PROGCON));
|
++datacon;
|
||||||
_scontrolli->add_row(recc);
|
recc->put(CON_DATACON, datacon);
|
||||||
|
recc->put(CON_RESPONSAB, "CETRAPLUS ieri");
|
||||||
|
recc->put(CON_PROGCON,r+1);
|
||||||
|
_scontrolli->insert_row(recc);
|
||||||
insert = TRUE;
|
insert = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
exist=TRUE;
|
if (p_tipocon > p_tipoes)
|
||||||
r=0;
|
|
||||||
if (_message)
|
|
||||||
{
|
{
|
||||||
print_line(stampa);
|
recc->put(CON_PROGCON,riga.get(CON_PROGCON));
|
||||||
stampa = "";
|
_scontrolli->add_row(recc);
|
||||||
stampa << "Controllo già esistente in data " << datacon.string();
|
insert = TRUE;
|
||||||
print_line(stampa);
|
}
|
||||||
print_line();
|
else
|
||||||
}
|
{
|
||||||
|
exist=TRUE;
|
||||||
|
r=0;
|
||||||
|
if (_message)
|
||||||
|
{
|
||||||
|
print_line(stampa);
|
||||||
|
stampa = "";
|
||||||
|
stampa << "Controllo già esistente in data " << datacon.string();
|
||||||
|
print_line(stampa);
|
||||||
|
print_line();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
|
exist=TRUE;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
exist=TRUE;
|
if (datacon > d)
|
||||||
}
|
{
|
||||||
else
|
recc->put(CON_PROGCON,r+1);
|
||||||
if (datacon > d)
|
_scontrolli->insert_row(recc);
|
||||||
{
|
insert=TRUE;
|
||||||
recc->put(CON_PROGCON,r+1);
|
}
|
||||||
_scontrolli->insert_row(recc);
|
r--;
|
||||||
insert=TRUE;
|
}
|
||||||
}
|
if (!exist && !insert)
|
||||||
r--;
|
{
|
||||||
}
|
recc->put(CON_PROGCON,1);
|
||||||
if (!exist && !insert)
|
_scontrolli->insert_row(recc);
|
||||||
|
insert = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (err == _iseof || err == _isemptyfile)
|
||||||
|
{
|
||||||
|
recc->put(CON_PROGCON,1);
|
||||||
|
_scontrolli->insert_row(recc);
|
||||||
|
insert = TRUE;
|
||||||
|
}
|
||||||
|
if (!exist)
|
||||||
{
|
{
|
||||||
recc->put(CON_PROGCON,1);
|
_scontrolli->write(TRUE);
|
||||||
_scontrolli->insert_row(recc);
|
if (_message)
|
||||||
insert = TRUE;
|
{
|
||||||
}
|
print_line(stampa);
|
||||||
}
|
stampa = "";
|
||||||
else
|
stampa << "Inserito controllo " << tipocon << " del " << datacon.string();
|
||||||
if (err == _iseof || err == _isemptyfile)
|
print_line(stampa);
|
||||||
{
|
print_line();
|
||||||
recc->put(CON_PROGCON,1);
|
}
|
||||||
_scontrolli->insert_row(recc);
|
// aggiorno data e utente ultimo aggiornamento
|
||||||
insert = TRUE;
|
TDate oggi(TODAY);
|
||||||
}
|
recsog.put(SOG_DATAULTAGG, oggi);
|
||||||
if (!exist)
|
recsog.put(SOG_UTENULTAGG, "CETRAPLUS");
|
||||||
{
|
err = recsog.rewrite(_rel->lfile());
|
||||||
_scontrolli->write(TRUE);
|
}
|
||||||
if (_message)
|
|
||||||
{
|
|
||||||
print_line(stampa);
|
|
||||||
stampa = "";
|
|
||||||
stampa << "Inserito controllo " << tipocon << " del " << datacon.string();
|
|
||||||
print_line(stampa);
|
|
||||||
print_line();
|
|
||||||
}
|
|
||||||
// aggiorno data e utente ultimo aggiornamento
|
|
||||||
TDate oggi(TODAY);
|
|
||||||
recsog.put(SOG_DATAULTAGG, oggi);
|
|
||||||
recsog.put(SOG_UTENULTAGG, "CETRAPLUS");
|
|
||||||
err = recsog.rewrite(_rel->lfile());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1250,107 +1258,111 @@ bool TCtpr2at::sacca(const TString& istruzione)
|
|||||||
// ho trovato il soggetto, ora verifico la donazione
|
// ho trovato il soggetto, ora verifico la donazione
|
||||||
TString16& str = (TString16&) record["DT_PRELIEVO"];
|
TString16& str = (TString16&) record["DT_PRELIEVO"];
|
||||||
const TDate datadon = TDate(atoi(str.sub(8,10)) ,atoi(str.sub(5,7)), atoi(str.sub(0,4)));
|
const TDate datadon = TDate(atoi(str.sub(8,10)) ,atoi(str.sub(5,7)), atoi(str.sub(0,4)));
|
||||||
_progins++;
|
TDate datanulla(NULLDATE);
|
||||||
TRectype* rec = new TRectype(LF_DONAZ);
|
if (datadon != datanulla)
|
||||||
rec->put(DON_CODICE, recsog.get(SOG_CODICE));
|
|
||||||
rec->put(DON_DATADON, datadon);
|
|
||||||
str = (TString16&) record["TP_DONAZIONE"];
|
|
||||||
TRectype recpr2 = cache().get("PR2", str);
|
|
||||||
TString16 tipodon = recpr2.get("S6");
|
|
||||||
if (tipodon.empty())
|
|
||||||
{
|
|
||||||
print_line(stampa);
|
|
||||||
stampa = "";
|
|
||||||
stampa << "Tipo donazione SIT " << str << " senza corrispondenza: non inserita";
|
|
||||||
print_line(stampa);
|
|
||||||
stampa = "";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
rec->put(DON_TIPODON, tipodon);
|
_progins++;
|
||||||
TString16& etichetta = (TString16&) record["ID_SACCA"];
|
TRectype* rec = new TRectype(LF_DONAZ);
|
||||||
rec->put(DON_ETICHETTA, etichetta);
|
rec->put(DON_CODICE, recsog.get(SOG_CODICE));
|
||||||
rec->put(DON_CODSEZ, recsog.get(SOG_CODSEZ));
|
rec->put(DON_DATADON, datadon);
|
||||||
rec->put(DON_CODSOT, recsog.get(SOG_CODSOT));
|
str = (TString16&) record["TP_DONAZIONE"];
|
||||||
rec->put(DON_PROGINS, _progins);
|
TRectype recpr2 = cache().get("PR2", str);
|
||||||
|
TString16 tipodon = recpr2.get("S6");
|
||||||
bool insert = FALSE;
|
if (tipodon.empty())
|
||||||
bool exist = FALSE;
|
{
|
||||||
TRectype* key = new TRectype(LF_DONAZ);
|
print_line(stampa);
|
||||||
key->put(DON_CODICE, recsog.get(SOG_CODICE));
|
stampa = "";
|
||||||
err = _sdonazioni->read(key);
|
stampa << "Tipo donazione SIT " << str << " senza corrispondenza: non inserita";
|
||||||
if (err == NOERR)
|
print_line(stampa);
|
||||||
|
stampa = "";
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
int r=_sdonazioni->rows();
|
rec->put(DON_TIPODON, tipodon);
|
||||||
while (r>=1 && !insert && !exist)
|
TString16& etichetta = (TString16&) record["ID_SACCA"];
|
||||||
|
rec->put(DON_ETICHETTA, etichetta);
|
||||||
|
rec->put(DON_CODSEZ, recsog.get(SOG_CODSEZ));
|
||||||
|
rec->put(DON_CODSOT, recsog.get(SOG_CODSOT));
|
||||||
|
rec->put(DON_PROGINS, _progins);
|
||||||
|
|
||||||
|
bool insert = FALSE;
|
||||||
|
bool exist = FALSE;
|
||||||
|
TRectype* key = new TRectype(LF_DONAZ);
|
||||||
|
key->put(DON_CODICE, recsog.get(SOG_CODICE));
|
||||||
|
err = _sdonazioni->read(key);
|
||||||
|
if (err == NOERR)
|
||||||
{
|
{
|
||||||
const TRectype& riga = _sdonazioni->row(r);
|
int r=_sdonazioni->rows();
|
||||||
const TDate d = riga.get(DON_DATADON);
|
while (r>=1 && !insert && !exist)
|
||||||
if (datadon==d) // esiste gia' una donazione in questa data
|
|
||||||
{
|
{
|
||||||
exist=TRUE;
|
const TRectype& riga = _sdonazioni->row(r);
|
||||||
r=0;
|
const TDate d = riga.get(DON_DATADON);
|
||||||
|
if (datadon==d) // esiste gia' una donazione in questa data
|
||||||
|
{
|
||||||
|
exist=TRUE;
|
||||||
|
r=0;
|
||||||
|
if (_message)
|
||||||
|
{
|
||||||
|
print_line(stampa);
|
||||||
|
stampa = "";
|
||||||
|
stampa << "Donazione già esistente in data " << datadon.string();
|
||||||
|
print_line(stampa);
|
||||||
|
print_line();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (datadon > d)
|
||||||
|
{
|
||||||
|
rec->put(DON_PROGDON,r+1);
|
||||||
|
_sdonazioni->insert_row(rec);
|
||||||
|
insert=TRUE;
|
||||||
|
}
|
||||||
|
r--;
|
||||||
|
}
|
||||||
|
if (!exist && !insert)
|
||||||
|
{
|
||||||
|
rec->put(DON_PROGDON,1);
|
||||||
|
rec->put(DON_PRIMADON,'X');
|
||||||
|
_sdonazioni->insert_row(rec);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (err == _iseof || err == _isemptyfile)
|
||||||
|
{
|
||||||
|
rec->put(DON_PROGDON,1);
|
||||||
|
rec->put(DON_PRIMADON,'X');
|
||||||
|
_sdonazioni->insert_row(rec);
|
||||||
|
}
|
||||||
|
if (!exist)
|
||||||
|
{
|
||||||
|
err = _sdonazioni->write(TRUE);
|
||||||
|
if (err == NOERR)
|
||||||
|
{
|
||||||
if (_message)
|
if (_message)
|
||||||
{
|
{
|
||||||
print_line(stampa);
|
print_line(stampa);
|
||||||
stampa = "";
|
stampa = "";
|
||||||
stampa << "Donazione già esistente in data " << datadon.string();
|
stampa << "Inserita donazione del " << datadon;
|
||||||
print_line(stampa);
|
print_line(stampa);
|
||||||
print_line();
|
if (modstato_tcs(recsog.get(SOG_STATO)) == 'S')
|
||||||
}
|
{
|
||||||
}
|
stampa = "** ATTENZIONE ** il soggetto e' sospeso";
|
||||||
else
|
print_line(stampa);
|
||||||
if (datadon > d)
|
}
|
||||||
{
|
|
||||||
rec->put(DON_PROGDON,r+1);
|
|
||||||
_sdonazioni->insert_row(rec);
|
|
||||||
insert=TRUE;
|
|
||||||
}
|
}
|
||||||
r--;
|
calcola_donazioni_lib(recsog, _sdonazioni); // questo metodo sistema tutto!!!
|
||||||
}
|
calcola_categoria(recsog); // modificato per dare i messaggi al posto dei veri cambiamenti
|
||||||
if (!exist && !insert)
|
//print_line(); // tolto perchè altrimenti stampa alcuni fogli vuoti
|
||||||
{
|
// aggiorno data e utente ultimo aggiornamento
|
||||||
rec->put(DON_PROGDON,1);
|
TDate oggi(TODAY);
|
||||||
rec->put(DON_PRIMADON,'X');
|
recsog.put(SOG_DATAULTAGG, oggi);
|
||||||
_sdonazioni->insert_row(rec);
|
recsog.put(SOG_UTENULTAGG, "CETRAPLUS");
|
||||||
|
err = recsog.rewrite(_rel->lfile());
|
||||||
|
}
|
||||||
|
//else
|
||||||
|
//error_box("Errore %d in scrittura archivio donazioni, riga %d", err, rigasog);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
if (err == _iseof || err == _isemptyfile)
|
|
||||||
{
|
|
||||||
rec->put(DON_PROGDON,1);
|
|
||||||
rec->put(DON_PRIMADON,'X');
|
|
||||||
_sdonazioni->insert_row(rec);
|
|
||||||
}
|
|
||||||
if (!exist)
|
|
||||||
{
|
|
||||||
err = _sdonazioni->write(TRUE);
|
|
||||||
if (err == NOERR)
|
|
||||||
{
|
|
||||||
if (_message)
|
|
||||||
{
|
|
||||||
print_line(stampa);
|
|
||||||
stampa = "";
|
|
||||||
stampa << "Inserita donazione del " << datadon;
|
|
||||||
print_line(stampa);
|
|
||||||
if (modstato_tcs(recsog.get(SOG_STATO)) == 'S')
|
|
||||||
{
|
|
||||||
stampa = "** ATTENZIONE ** il soggetto e' sospeso";
|
|
||||||
print_line(stampa);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
calcola_donazioni_lib(recsog, _sdonazioni); // questo metodo sistema tutto!!!
|
|
||||||
calcola_categoria(recsog); // modificato per dare i messaggi al posto dei veri cambiamenti
|
|
||||||
//print_line(); // tolto perchè altrimenti stampa alcuni fogli vuoti
|
|
||||||
// aggiorno data e utente ultimo aggiornamento
|
|
||||||
TDate oggi(TODAY);
|
|
||||||
recsog.put(SOG_DATAULTAGG, oggi);
|
|
||||||
recsog.put(SOG_UTENULTAGG, "CETRAPLUS");
|
|
||||||
err = recsog.rewrite(_rel->lfile());
|
|
||||||
}
|
|
||||||
//else
|
|
||||||
//error_box("Errore %d in scrittura archivio donazioni, riga %d", err, rigasog);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1410,110 +1422,112 @@ bool TCtpr2at::analisi(const TString& istruzione)
|
|||||||
stampa = recsog.get(SOG_COGNOME);
|
stampa = recsog.get(SOG_COGNOME);
|
||||||
stampa << " " << recsog.get(SOG_NOME);
|
stampa << " " << recsog.get(SOG_NOME);
|
||||||
stampa << " " << recsog.get(SOG_DATANASC);
|
stampa << " " << recsog.get(SOG_DATANASC);
|
||||||
//TString16& str = (TString16&) record["DT_ACCESSO"];
|
|
||||||
TDate datacon = TDate(atoi(str.sub(8,10)) ,atoi(str.sub(5,7)), atoi(str.sub(0,4)));
|
TDate datacon = TDate(atoi(str.sub(8,10)) ,atoi(str.sub(5,7)), atoi(str.sub(0,4)));
|
||||||
|
TDate datanulla(NULLDATE);
|
||||||
TRectype* recc = new TRectype(LF_CONTSAN);
|
if (datacon != datanulla)
|
||||||
recc->put(CON_CODICE, recsog.get(SOG_CODICE));
|
{
|
||||||
recc->put(CON_DATACON, datacon);
|
TRectype* recc = new TRectype(LF_CONTSAN);
|
||||||
recc->put(CON_TIPOCON, tipocon);
|
recc->put(CON_CODICE, recsog.get(SOG_CODICE));
|
||||||
recc->put(CON_RESPONSAB, "CETRAPLUS");
|
recc->put(CON_DATACON, datacon);
|
||||||
|
recc->put(CON_TIPOCON, tipocon);
|
||||||
bool insert = FALSE;
|
recc->put(CON_RESPONSAB, "CETRAPLUS");
|
||||||
bool exist = FALSE;
|
|
||||||
TRectype* keyc = new TRectype(LF_CONTSAN);
|
bool insert = FALSE;
|
||||||
keyc->put(CON_CODICE, recsog.get(SOG_CODICE));
|
bool exist = FALSE;
|
||||||
int err = _scontrolli->read(keyc);
|
TRectype* keyc = new TRectype(LF_CONTSAN);
|
||||||
if (err == NOERR)
|
keyc->put(CON_CODICE, recsog.get(SOG_CODICE));
|
||||||
{
|
int err = _scontrolli->read(keyc);
|
||||||
int r=_scontrolli->rows();
|
if (err == NOERR)
|
||||||
while (r>=1 && !insert && !exist)
|
|
||||||
{
|
{
|
||||||
const TRectype& riga = _scontrolli->row(r);
|
int r=_scontrolli->rows();
|
||||||
const TDate d = riga.get(CON_DATACON);
|
while (r>=1 && !insert && !exist)
|
||||||
if (datacon==d) // esiste gia' un controllo in questa data
|
|
||||||
{
|
{
|
||||||
// verifico la priorita
|
const TRectype& riga = _scontrolli->row(r);
|
||||||
TString4 tipoes = riga.get(CON_TIPOCON);
|
const TDate d = riga.get(CON_DATACON);
|
||||||
if (tipoes != tipocon)
|
if (datacon==d) // esiste gia' un controllo in questa data
|
||||||
{
|
{
|
||||||
int p_tipocon = _configfile->get_int(tipocon, "PRIORITA");
|
// verifico la priorita
|
||||||
int p_tipoes = _configfile->get_int(tipoes, "PRIORITA");
|
TString4 tipoes = riga.get(CON_TIPOCON);
|
||||||
if (p_tipocon == 999)
|
if (tipoes != tipocon)
|
||||||
{
|
{
|
||||||
++datacon;
|
int p_tipocon = _configfile->get_int(tipocon, "PRIORITA");
|
||||||
recc->put(CON_DATACON, datacon);
|
int p_tipoes = _configfile->get_int(tipoes, "PRIORITA");
|
||||||
recc->put(CON_RESPONSAB, "CETRAPLUS ieri");
|
if (p_tipocon == 999)
|
||||||
recc->put(CON_PROGCON,r+1);
|
|
||||||
_scontrolli->insert_row(recc);
|
|
||||||
insert = TRUE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (p_tipocon > p_tipoes)
|
|
||||||
{
|
{
|
||||||
|
++datacon;
|
||||||
recc->put(CON_PROGCON,riga.get(CON_PROGCON));
|
recc->put(CON_DATACON, datacon);
|
||||||
_scontrolli->add_row(recc);
|
recc->put(CON_RESPONSAB, "CETRAPLUS ieri");
|
||||||
|
recc->put(CON_PROGCON,r+1);
|
||||||
|
_scontrolli->insert_row(recc);
|
||||||
insert = TRUE;
|
insert = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
exist=TRUE;
|
if (p_tipocon > p_tipoes)
|
||||||
r=0;
|
|
||||||
if (_message)
|
|
||||||
{
|
{
|
||||||
print_line(stampa);
|
|
||||||
stampa = "";
|
recc->put(CON_PROGCON,riga.get(CON_PROGCON));
|
||||||
stampa << "Controllo già esistente in data " << datacon.string();
|
_scontrolli->add_row(recc);
|
||||||
print_line(stampa);
|
insert = TRUE;
|
||||||
print_line();
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
|
exist=TRUE;
|
||||||
|
r=0;
|
||||||
|
if (_message)
|
||||||
|
{
|
||||||
|
print_line(stampa);
|
||||||
|
stampa = "";
|
||||||
|
stampa << "Controllo già esistente in data " << datacon.string();
|
||||||
|
print_line(stampa);
|
||||||
|
print_line();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
|
exist=TRUE;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
exist=TRUE;
|
if (datacon > d)
|
||||||
}
|
{
|
||||||
else
|
recc->put(CON_PROGCON,r+1);
|
||||||
if (datacon > d)
|
_scontrolli->insert_row(recc);
|
||||||
{
|
insert=TRUE;
|
||||||
recc->put(CON_PROGCON,r+1);
|
}
|
||||||
_scontrolli->insert_row(recc);
|
r--;
|
||||||
insert=TRUE;
|
}
|
||||||
}
|
if (!exist && !insert)
|
||||||
r--;
|
{
|
||||||
}
|
recc->put(CON_PROGCON,1);
|
||||||
if (!exist && !insert)
|
_scontrolli->insert_row(recc);
|
||||||
{
|
insert = TRUE;
|
||||||
recc->put(CON_PROGCON,1);
|
}
|
||||||
_scontrolli->insert_row(recc);
|
}
|
||||||
insert = TRUE;
|
else
|
||||||
}
|
if (err == _iseof || err == _isemptyfile)
|
||||||
}
|
{
|
||||||
else
|
recc->put(CON_PROGCON,1);
|
||||||
if (err == _iseof || err == _isemptyfile)
|
_scontrolli->insert_row(recc);
|
||||||
{
|
insert = TRUE;
|
||||||
recc->put(CON_PROGCON,1);
|
}
|
||||||
_scontrolli->insert_row(recc);
|
if (!exist)
|
||||||
insert = TRUE;
|
{
|
||||||
}
|
_scontrolli->write(TRUE);
|
||||||
if (!exist)
|
if (_message)
|
||||||
{
|
{
|
||||||
_scontrolli->write(TRUE);
|
print_line(stampa);
|
||||||
if (_message)
|
stampa = "";
|
||||||
{
|
stampa << "Inserito controllo " << tipocon << " del " << datacon.string();
|
||||||
print_line(stampa);
|
print_line(stampa);
|
||||||
stampa = "";
|
print_line();
|
||||||
stampa << "Inserito controllo " << tipocon << " del " << datacon.string();
|
}
|
||||||
print_line(stampa);
|
// aggiorno data e utente ultimo aggiornamento
|
||||||
print_line();
|
TDate oggi(TODAY);
|
||||||
|
recsog.put(SOG_DATAULTAGG, oggi);
|
||||||
|
recsog.put(SOG_UTENULTAGG, "CETRAPLUS");
|
||||||
|
err = recsog.rewrite(_rel->lfile());
|
||||||
}
|
}
|
||||||
// aggiorno data e utente ultimo aggiornamento
|
|
||||||
TDate oggi(TODAY);
|
|
||||||
recsog.put(SOG_DATAULTAGG, oggi);
|
|
||||||
recsog.put(SOG_UTENULTAGG, "CETRAPLUS");
|
|
||||||
err = recsog.rewrite(_rel->lfile());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1578,7 +1592,7 @@ bool TCtpr2at::esclusione(const TString& istruzione)
|
|||||||
const long codsog = recsog.get_long(SOG_CODICE);
|
const long codsog = recsog.get_long(SOG_CODICE);
|
||||||
//TString16& str = (TString16&) record["DA_DATA"];
|
//TString16& str = (TString16&) record["DA_DATA"];
|
||||||
//const TDate datacon = TDate(atoi(str.sub(8,10)) ,atoi(str.sub(5,7)), atoi(str.sub(0,4)));
|
//const TDate datacon = TDate(atoi(str.sub(8,10)) ,atoi(str.sub(5,7)), atoi(str.sub(0,4)));
|
||||||
TDate datacon(TODAY);
|
TDate datacon(TODAY);
|
||||||
TString16& str = (TString16&) record["A_DATA"];
|
TString16& str = (TString16&) record["A_DATA"];
|
||||||
const TDate datapross = TDate(atoi(str.sub(8,10)) ,atoi(str.sub(5,7)), atoi(str.sub(0,4)));
|
const TDate datapross = TDate(atoi(str.sub(8,10)) ,atoi(str.sub(5,7)), atoi(str.sub(0,4)));
|
||||||
TDate datanulla(NULLDATE);
|
TDate datanulla(NULLDATE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user