Patch level : 1.7 at

Files correlati     : at0.exe
Ricompilazione Demo : [ ]
Commento            : Sblocco sospesi: sistemato stampa motivo di sospensione


git-svn-id: svn://10.65.10.50/trunk@13136 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
cris 2005-05-20 11:04:28 +00:00
parent 0f4f2c3959
commit 139c50b3d6

View File

@ -161,36 +161,40 @@ bool TSbloccoSospesi::preprocess_page(int file, int counter)
const TDate datafine = recsog.get_date(SOG_DATA_PROS); const TDate datafine = recsog.get_date(SOG_DATA_PROS);
TDate datafinesi(NULLDATE); TDate datafinesi(NULLDATE);
TDate datafineaf(NULLDATE); TDate datafineaf(NULLDATE);
if (statosi == "SO") if (statosi == SOSPENSIONE)
{ {
datafinesi = recsog.get_date(SOG_FINESOSSI); datafinesi = recsog.get_date(SOG_FINESOSSI);
if ((datafine == datafinesi) && (stato == statosi) && (pros_stato != FINE_SOSPENSIONE)) if ((datafine == datafinesi) && (stato == statosi) && (pros_stato != FINE_SOSPENSIONE))
datafinesi = NULLDATE; datafinesi = NULLDATE;
} }
if (statoaf == "SO") if (statoaf == SOSPENSIONE)
{ {
datafineaf = recsog.get_date(SOG_FINESOSAF); datafineaf = recsog.get_date(SOG_FINESOSAF);
if ((datafine == datafineaf) && (stato == statoaf) && (pros_stato != FINE_SOSPENSIONE)) if ((datafine == datafineaf) && (stato == statoaf) && (pros_stato != FINE_SOSPENSIONE))
datafineaf = NULLDATE; datafineaf = NULLDATE;
} }
TString80 operazione = ""; TString80 operazione = "";
TString80 motivo = reccon.get(CON_MOTIVO);
if (stato=="SO" && pros_stato==FINE_SOSPENSIONE && datafine.ok() && datafine<=app()._data_sblocco) if (current_cursor()->curr(-ALIAS_TCS).get("S6") == "S" && pros_stato==FINE_SOSPENSIONE && datafine.ok() && datafine<=app()._data_sblocco)
{ {
const TDate datastato = recsog.get_date(SOG_DATASTATO); const TDate datastato = recsog.get_date(SOG_DATASTATO);
operazione.format("%s %s %4s -- -- -- SO FS", datastato.string(), datafine.string(), (const char*) reccon.get(CON_MOTIVO)); operazione << datastato.string();
operazione << ' ';
operazione << datafine.string();
operazione << ' ';
operazione << format("%4s -- -- -- %2s %2s", (const char*) motivo, (const char*) stato, (const char*) pros_stato);
} }
else else
if (statosi == "SO" && datafinesi.ok() && datafinesi <= app()._data_sblocco) if (statosi == SOSPENSIONE && datafinesi.ok() && datafinesi <= app()._data_sblocco)
{ {
const TDate datastato = recsog.get_date(SOG_DATASI); const TDate datastato = recsog.get_date(SOG_DATASI);
operazione.format("%s %s %4s SI SO ID", datastato.string(), datafinesi.string(), (const char*)reccon.get(CON_MOTIVO)); operazione.format("%s %s %4s SI SO ID", datastato.string(), datafinesi.string(), (const char*) motivo);
} }
else else
if (statoaf == "SO" && datafineaf.ok() && datafineaf <= app()._data_sblocco) if (statoaf == SOSPENSIONE && datafineaf.ok() && datafineaf <= app()._data_sblocco)
{ {
const TDate datastato = recsog.get_date(SOG_DATAAF); const TDate datastato = recsog.get_date(SOG_DATAAF);
operazione.format("%s %s %4s AF SO ID", datastato.string(), datafineaf.string(), (const char*)reccon.get(CON_MOTIVO)); operazione.format("%s %s %4s AF SO ID", datastato.string(), datafineaf.string(), (const char*) motivo);
} }
TDate datarif = app()._data_sblocco; TDate datarif = app()._data_sblocco;
datarif.set_year(datarif.year()-2); datarif.set_year(datarif.year()-2);
@ -214,7 +218,7 @@ bool TSbloccoSospesi::preprocess_page(int file, int counter)
_operazione = operazione; _operazione = operazione;
if (_definitiva) if (_definitiva)
{ {
if (stato == "SO" && datafine.ok() && datafine <= app()._data_sblocco) if (current_cursor()->curr(-ALIAS_TCS).get("S6") == "S" && datafine.ok() && datafine <= app()._data_sblocco)
{ {
TRectype* key = new TRectype(LF_CONTSAN); TRectype* key = new TRectype(LF_CONTSAN);
long codice = recsog.get_long(SOG_CODICE); long codice = recsog.get_long(SOG_CODICE);
@ -242,7 +246,7 @@ bool TSbloccoSospesi::preprocess_page(int file, int counter)
recsog.put(SOG_NUMCONV,0); recsog.put(SOG_NUMCONV,0);
//current_cursor()->file().rewrite(); //current_cursor()->file().rewrite();
} }
if ((statosi == "SO" && datafinesi.ok() && datafinesi <= app()._data_sblocco) || (statoaf == "SO" && datafineaf.ok() && datafineaf <= app()._data_sblocco)) if ((statosi == SOSPENSIONE && datafinesi.ok() && datafinesi <= app()._data_sblocco) || (statoaf == SOSPENSIONE && datafineaf.ok() && datafineaf <= app()._data_sblocco))
{ {
TRectype* key = new TRectype(LF_IDONEITA); TRectype* key = new TRectype(LF_IDONEITA);
long codice = recsog.get_long(SOG_CODICE); long codice = recsog.get_long(SOG_CODICE);
@ -254,7 +258,7 @@ bool TSbloccoSospesi::preprocess_page(int file, int counter)
TRectype* key1 = new TRectype(LF_CONTSAN); TRectype* key1 = new TRectype(LF_CONTSAN);
key1->put(CON_CODICE, codice); key1->put(CON_CODICE, codice);
err = _scontrolli->read(key1); err = _scontrolli->read(key1);
if (statosi == "SO" && datafinesi.ok() && datafinesi <= app()._data_sblocco) if (statosi == SOSPENSIONE && datafinesi.ok() && datafinesi <= app()._data_sblocco)
{ {
int progido = _sidoneita->rows()+1; int progido = _sidoneita->rows()+1;
TRectype& recido = _idoneita->curr(); TRectype& recido = _idoneita->curr();
@ -289,7 +293,7 @@ bool TSbloccoSospesi::preprocess_page(int file, int counter)
recsog.put(SOG_DATAULTSOL,NULLDATE); recsog.put(SOG_DATAULTSOL,NULLDATE);
recsog.put(SOG_NUMCONV,0); recsog.put(SOG_NUMCONV,0);
} }
if (statoaf == "SO" && datafineaf.ok() && datafineaf <= app()._data_sblocco) if (statoaf == SOSPENSIONE && datafineaf.ok() && datafineaf <= app()._data_sblocco)
{ {
int progido = _sidoneita->rows()+1; int progido = _sidoneita->rows()+1;
TRectype& recido = _idoneita->curr(); TRectype& recido = _idoneita->curr();
@ -401,14 +405,14 @@ bool TSbloccoSospesi::filter_func_sbloccosospesi(const TRelation* rel)
datafine = recsog.get_date(SOG_DATA_PROS); datafine = recsog.get_date(SOG_DATA_PROS);
TDate datafinesi(NULLDATE); TDate datafinesi(NULLDATE);
TDate datafineaf(NULLDATE); TDate datafineaf(NULLDATE);
if (statosi == "SO") if (statosi == SOSPENSIONE)
{ {
datafinesi = recsog.get_date(SOG_FINESOSSI); datafinesi = recsog.get_date(SOG_FINESOSSI);
if ((stato == statosi) && (statopros != FINE_SOSPENSIONE)) if ((stato == statosi) && (statopros != FINE_SOSPENSIONE))
datafinesi = NULLDATE; datafinesi = NULLDATE;
} }
if (statoaf == "SO") if (statoaf == SOSPENSIONE)
{ {
datafineaf = recsog.get_date(SOG_FINESOSAF); datafineaf = recsog.get_date(SOG_FINESOSAF);
if ((stato == statoaf) && (statopros != FINE_SOSPENSIONE)) if ((stato == statoaf) && (statopros != FINE_SOSPENSIONE))
@ -524,7 +528,7 @@ bool TSbloccoSospesi::user_create()
_msk = new TMask("at0700a"); _msk = new TMask("at0700a");
_msk->set_handler(F_DATA,data_handler); _msk->set_handler(F_DATA,data_handler);
_rel = new TRelation(LF_SOGGETTI); _rel = new TRelation(LF_SOGGETTI);
_rel->add(LF_CONTSAN,"CODICE==CODICE|DATACON==DATASTATO"); _rel->add(LF_CONTSAN,"DATACON==DATASTATO|CODICE==CODICE", 2);
_rel->add(LF_SEZIONI,"CODSEZ==CODSEZ|CODSOT==CODSOT"); _rel->add(LF_SEZIONI,"CODSEZ==CODSEZ|CODSOT==CODSOT");
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS); _rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
_rel->add("CTD", "CODTAB==CATDON",1,0,ALIAS_CTD); _rel->add("CTD", "CODTAB==CATDON",1,0,ALIAS_CTD);