Nello sblocco sospesi si puo' decidere se sbloccare o no i soggetti
con categoria di dimissione (non attivi) git-svn-id: svn://10.65.10.50/trunk@6178 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
76b9cf4b62
commit
817147b5cc
@ -10,6 +10,7 @@
|
|||||||
#include "atlib.h"
|
#include "atlib.h"
|
||||||
|
|
||||||
#define ALIAS_TCS 200
|
#define ALIAS_TCS 200
|
||||||
|
#define ALIAS_CTD 700
|
||||||
#define FINE_SOSPENSIONE "FS"
|
#define FINE_SOSPENSIONE "FS"
|
||||||
|
|
||||||
// nomi campi maschera
|
// nomi campi maschera
|
||||||
@ -35,7 +36,7 @@ class TSbloccoSospesi : public TPrintapp
|
|||||||
TDate _data_stampa;
|
TDate _data_stampa;
|
||||||
TString16 _tiposo; // tipo sospesione da sbloccare
|
TString16 _tiposo; // tipo sospesione da sbloccare
|
||||||
TString16 _codsez, _codsot;
|
TString16 _codsez, _codsot;
|
||||||
bool _definitiva;
|
bool _definitiva, _anchedimessi;
|
||||||
TParagraph_string _cognome_nome, _operazione;
|
TParagraph_string _cognome_nome, _operazione;
|
||||||
TString16 _finesospensione;
|
TString16 _finesospensione;
|
||||||
|
|
||||||
@ -259,52 +260,31 @@ void TSbloccoSospesi::set_page(int file, int cnt)
|
|||||||
|
|
||||||
bool TSbloccoSospesi::filter_func_sbloccosospesi(const TRelation* rel)
|
bool TSbloccoSospesi::filter_func_sbloccosospesi(const TRelation* rel)
|
||||||
{
|
{
|
||||||
bool filtrato = FALSE;
|
bool filtrato = TRUE;
|
||||||
TRectype& recsog = rel->lfile().curr();
|
TRectype& recsog = rel->lfile().curr();
|
||||||
const TString16 stato = recsog.get(SOG_STATO);
|
if (!app()._anchedimessi)
|
||||||
const TString16 statopros = recsog.get(SOG_PROS_STATO);
|
filtrato = !(rel->lfile(-ALIAS_CTD).get_bool("B0"));
|
||||||
const TString16 statosi = recsog.get(SOG_STATOSI);
|
if (filtrato)
|
||||||
const TString16 statoaf = recsog.get(SOG_STATOAF);
|
{
|
||||||
|
filtrato = FALSE;
|
||||||
TDate datafine(NULLDATE);
|
const TString16 stato = recsog.get(SOG_STATO);
|
||||||
if (statopros == "FS")
|
const TString16 statopros = recsog.get(SOG_PROS_STATO);
|
||||||
datafine = recsog.get_date(SOG_DATA_PROS);
|
const TString16 statosi = recsog.get(SOG_STATOSI);
|
||||||
TDate datafinesi(NULLDATE);
|
const TString16 statoaf = recsog.get(SOG_STATOAF);
|
||||||
TDate datafineaf(NULLDATE);
|
|
||||||
if (statosi == "SO")
|
TDate datafine(NULLDATE);
|
||||||
datafinesi = recsog.get_date(SOG_FINESOSSI);
|
if (statopros == "FS")
|
||||||
if (statoaf == "SO")
|
datafine = recsog.get_date(SOG_DATA_PROS);
|
||||||
datafineaf = recsog.get_date(SOG_FINESOSAF);
|
TDate datafinesi(NULLDATE);
|
||||||
filtrato = (datafine.ok()) && (datafine <= app()._data_sblocco);
|
TDate datafineaf(NULLDATE);
|
||||||
if ((!filtrato) && (datafinesi.ok() || datafineaf.ok()))
|
if (statosi == "SO")
|
||||||
filtrato = ((datafinesi.ok() && (datafinesi <= app()._data_sblocco)) || (datafineaf.ok() && (datafineaf <= app()._data_sblocco)));
|
datafinesi = recsog.get_date(SOG_FINESOSSI);
|
||||||
|
if (statoaf == "SO")
|
||||||
/*
|
datafineaf = recsog.get_date(SOG_FINESOSAF);
|
||||||
TRectype* key = new TRectype(LF_CONTSAN);
|
filtrato = (datafine.ok()) && (datafine <= app()._data_sblocco);
|
||||||
long codice = recsog.get_long(SOG_CODICE);
|
if ((!filtrato) && (datafinesi.ok() || datafineaf.ok()))
|
||||||
key->put(CON_CODICE, codice);
|
filtrato = ((datafinesi.ok() && (datafinesi <= app()._data_sblocco)) || (datafineaf.ok() && (datafineaf <= app()._data_sblocco)));
|
||||||
int err = app()._scontrolli->read(key);
|
}
|
||||||
if (err == NOERR)
|
|
||||||
{
|
|
||||||
TString16 stato = recsog.get(SOG_STATO);
|
|
||||||
TDate datastato = recsog.get(SOG_DATASTATO);
|
|
||||||
for (int r=1; r<=app()._scontrolli->rows(); r++)
|
|
||||||
{
|
|
||||||
const TRectype& riga = app()._scontrolli->row(r);
|
|
||||||
TString16 tipo = riga.get(CON_TIPOCON);
|
|
||||||
TDate datatipo = riga.get(CON_DATACON);
|
|
||||||
if (tipo == stato && datatipo == datastato)
|
|
||||||
{
|
|
||||||
TString16 prosstipo = riga.get(CON_PROSSTIPO);
|
|
||||||
if (modstato_tcs(prosstipo) == 'F')
|
|
||||||
{
|
|
||||||
TDate datafine = riga.get(CON_PROSSDATA);
|
|
||||||
filtrato = (datafine.ok()) && (datafine <= app()._data_sblocco);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
return filtrato;
|
return filtrato;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -340,7 +320,7 @@ bool TSbloccoSospesi::set_print(int)
|
|||||||
_data_sblocco = _msk->get(F_DATA);
|
_data_sblocco = _msk->get(F_DATA);
|
||||||
_tiposo = _msk->get(F_TIPO);
|
_tiposo = _msk->get(F_TIPO);
|
||||||
_definitiva = _msk->get_bool(F_DEFINITIVA);
|
_definitiva = _msk->get_bool(F_DEFINITIVA);
|
||||||
|
_anchedimessi = _msk->get_bool(F_ANCHEDIMESSI);
|
||||||
_contatore = 0;
|
_contatore = 0;
|
||||||
_totale = 0;
|
_totale = 0;
|
||||||
reset_files();
|
reset_files();
|
||||||
@ -349,10 +329,10 @@ bool TSbloccoSospesi::set_print(int)
|
|||||||
// filtro per tipo sospensione
|
// filtro per tipo sospensione
|
||||||
TString256 filtro = "";
|
TString256 filtro = "";
|
||||||
if (_tiposo.not_empty())
|
if (_tiposo.not_empty())
|
||||||
filtro.format("((STATO == \"%s\") && (PROS_STATO == \"FS\"))",(const char*)_tiposo);
|
filtro.format("(((STATO == \"%s\") && (PROS_STATO == \"FS\"))",(const char*)_tiposo);
|
||||||
else
|
else
|
||||||
filtro << "((TCS->S6 == \"S\") && (PROS_STATO == \"FS\"))";
|
filtro << "(((TCS->S6 == \"S\") && (PROS_STATO == \"FS\"))";
|
||||||
filtro << " || (STATOSI == \"SO\") || (STATOAF == \"SO\")";
|
filtro << " || (STATOSI == \"SO\") || (STATOAF == \"SO\"))";
|
||||||
current_cursor()->setfilter(filtro, TRUE);
|
current_cursor()->setfilter(filtro, TRUE);
|
||||||
current_cursor()->set_filterfunction(filter_func_sbloccosospesi,TRUE);
|
current_cursor()->set_filterfunction(filter_func_sbloccosospesi,TRUE);
|
||||||
reset_print();
|
reset_print();
|
||||||
@ -398,6 +378,7 @@ bool TSbloccoSospesi::user_create()
|
|||||||
_rel = new TRelation(LF_SOGGETTI);
|
_rel = new TRelation(LF_SOGGETTI);
|
||||||
_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);
|
||||||
//cursore ordinamento per sezione+sottogruppo+cognome+nome
|
//cursore ordinamento per sezione+sottogruppo+cognome+nome
|
||||||
_cur = add_cursor(new TCursor(_rel, "", 3));
|
_cur = add_cursor(new TCursor(_rel, "", 3));
|
||||||
_contsan = new TLocalisamfile(LF_CONTSAN);
|
_contsan = new TLocalisamfile(LF_CONTSAN);
|
||||||
|
25
at/at0700a.h
25
at/at0700a.h
@ -1,15 +1,16 @@
|
|||||||
// sblocco sospesi
|
// sblocco sospesi
|
||||||
// definizione campi per maschera di selezione
|
// definizione campi per maschera di selezione
|
||||||
|
|
||||||
#define F_SEZINI 101
|
#define F_SEZINI 101
|
||||||
#define F_D_SEZINI 102
|
#define F_D_SEZINI 102
|
||||||
#define F_SOTINI 103
|
#define F_SOTINI 103
|
||||||
#define F_D_SOTINI 104
|
#define F_D_SOTINI 104
|
||||||
#define F_SEZFIN 105
|
#define F_SEZFIN 105
|
||||||
#define F_D_SEZFIN 106
|
#define F_D_SEZFIN 106
|
||||||
#define F_SOTFIN 107
|
#define F_SOTFIN 107
|
||||||
#define F_D_SOTFIN 108
|
#define F_D_SOTFIN 108
|
||||||
#define F_DATA 109
|
#define F_DATA 109
|
||||||
#define F_TIPO 110
|
#define F_TIPO 110
|
||||||
#define F_D_TIPO 111
|
#define F_D_TIPO 111
|
||||||
#define F_DEFINITIVA 112
|
#define F_ANCHEDIMESSI 112
|
||||||
|
#define F_DEFINITIVA 113
|
||||||
|
@ -132,7 +132,7 @@ BEGIN
|
|||||||
HELP "Sottogruppo finale"
|
HELP "Sottogruppo finale"
|
||||||
END
|
END
|
||||||
|
|
||||||
GROUPBOX DLG_NULL 77 5
|
GROUPBOX DLG_NULL 77 6
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 5 "Opzioni per lo sblocco"
|
PROMPT 1 5 "Opzioni per lo sblocco"
|
||||||
END
|
END
|
||||||
@ -165,9 +165,15 @@ BEGIN
|
|||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
BOOLEAN F_ANCHEDIMESSI
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 8 "Sblocco anche per categorie di dimissione"
|
||||||
|
HELP "Indicare se si vogliono sbloccare i soggetti con categoria di dimissione"
|
||||||
|
END
|
||||||
|
|
||||||
BOOLEAN F_DEFINITIVA
|
BOOLEAN F_DEFINITIVA
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 8 "Sblocco definitivo"
|
PROMPT 2 9 "Sblocco definitivo"
|
||||||
HELP "Se sblocco definitivo, i soggetti stampati vengono sbloccati"
|
HELP "Se sblocco definitivo, i soggetti stampati vengono sbloccati"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user