Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : Stampa ben. per sezione: possibile ora la scelta tra sezione che ha attribuito e sezione di appartenenza attuale git-svn-id: svn://10.65.10.50/trunk@7262 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
fc42bcbfbd
commit
02b70cf749
126
at/at1300.cpp
126
at/at1300.cpp
@ -21,10 +21,12 @@
|
|||||||
|
|
||||||
class TStampaBenemerenze : public TPrintapp
|
class TStampaBenemerenze : public TPrintapp
|
||||||
{
|
{
|
||||||
|
TLocalisamfile* _sezioni;
|
||||||
TRelation* _rel;
|
TRelation* _rel;
|
||||||
TMask* _msk;
|
TMask* _msk;
|
||||||
int _counter;
|
int _counter;
|
||||||
int _cur;
|
int _cur;
|
||||||
|
char _tiposta;
|
||||||
TDate _dataini, _datafin;
|
TDate _dataini, _datafin;
|
||||||
TString16 _codsez, _codsot, _sezini, _sotini, _sezfin, _sotfin;
|
TString16 _codsez, _codsot, _sezini, _sotini, _sezfin, _sotfin;
|
||||||
bool _stampa80;
|
bool _stampa80;
|
||||||
@ -32,6 +34,7 @@ class TStampaBenemerenze : public TPrintapp
|
|||||||
TString16 _tipoold;
|
TString16 _tipoold;
|
||||||
int _contatore;
|
int _contatore;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool user_create();
|
virtual bool user_create();
|
||||||
virtual bool user_destroy();
|
virtual bool user_destroy();
|
||||||
@ -110,8 +113,17 @@ bool TStampaBenemerenze::preprocess_page(int file, int counter)
|
|||||||
|
|
||||||
// salto pagina se cambio punto di rottura
|
// salto pagina se cambio punto di rottura
|
||||||
const TString16 tiponew = current_cursor()->curr().get(BEN_TIPOBEN);
|
const TString16 tiponew = current_cursor()->curr().get(BEN_TIPOBEN);
|
||||||
const TString16 codsez = current_cursor()->curr(LF_SOGGETTI).get(SOG_CODSEZ);
|
TString16 codsez, codsot;
|
||||||
const TString16 codsot = current_cursor()->curr(LF_SOGGETTI).get(SOG_CODSOT);
|
if (app()._tiposta == 'S')
|
||||||
|
{
|
||||||
|
codsez = current_cursor()->curr(LF_SOGGETTI).get(SOG_CODSEZ);
|
||||||
|
codsot = current_cursor()->curr(LF_SOGGETTI).get(SOG_CODSOT);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
codsez = current_cursor()->curr().get(BEN_CODSEZ);
|
||||||
|
codsot = current_cursor()->curr().get(BEN_CODSOT);
|
||||||
|
}
|
||||||
if ((tiponew != _tipoold) || (_codsez!=codsez) || (_codsot!=codsot))
|
if ((tiponew != _tipoold) || (_codsez!=codsez) || (_codsot!=codsot))
|
||||||
{
|
{
|
||||||
if (_tipoold != "**")
|
if (_tipoold != "**")
|
||||||
@ -138,8 +150,18 @@ void TStampaBenemerenze::header_ben(const TString16 tipoben, const TString16 cod
|
|||||||
intestazione << current_cursor()->curr(-ALIAS_BNZ).get("S0");
|
intestazione << current_cursor()->curr(-ALIAS_BNZ).get("S0");
|
||||||
intestazione.center_just(132);
|
intestazione.center_just(132);
|
||||||
set_header(3,"@0g%s", (const char*) intestazione);
|
set_header(3,"@0g%s", (const char*) intestazione);
|
||||||
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
TLocalisamfile sezioni(LF_SEZIONI);
|
||||||
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
sezioni.zero();
|
||||||
|
sezioni.put(SEZ_CODSEZ, codsez);
|
||||||
|
sezioni.put(SEZ_CODSOT, codsot);
|
||||||
|
TString80 densez, densot;
|
||||||
|
densez = "";
|
||||||
|
densot = "";
|
||||||
|
if (sezioni.read() == NOERR)
|
||||||
|
{
|
||||||
|
densez = sezioni.get(SEZ_DENSEZ);
|
||||||
|
densot = sezioni.get(SEZ_DENSOT);
|
||||||
|
}
|
||||||
intestazione = "Sezione: ";
|
intestazione = "Sezione: ";
|
||||||
intestazione << codsez;
|
intestazione << codsez;
|
||||||
intestazione << "/";
|
intestazione << "/";
|
||||||
@ -164,8 +186,9 @@ bool TStampaBenemerenze::set_print(int m)
|
|||||||
{
|
{
|
||||||
_codsez = "**";
|
_codsez = "**";
|
||||||
_codsot = "**";
|
_codsot = "**";
|
||||||
_dataini = _msk->get_date(F_DATAINI);
|
_dataini = _msk->get_date(F_DATAINI);
|
||||||
_datafin = _msk->get_date(F_DATAFIN);
|
_datafin = _msk->get_date(F_DATAFIN);
|
||||||
|
_tiposta = _msk->get(F_TIPOSTA)[0];
|
||||||
TRectype da(LF_BENEM);
|
TRectype da(LF_BENEM);
|
||||||
TRectype a (LF_BENEM);
|
TRectype a (LF_BENEM);
|
||||||
if (_dataini.ok())
|
if (_dataini.ok())
|
||||||
@ -173,20 +196,93 @@ bool TStampaBenemerenze::set_print(int m)
|
|||||||
if (_datafin.ok())
|
if (_datafin.ok())
|
||||||
a.put(BEN_DATABEN, _datafin);
|
a.put(BEN_DATABEN, _datafin);
|
||||||
//TString80 chiave = "94->TIPOBEN|UPPER(90->COGNOME)|UPPER(90->NOME)";
|
//TString80 chiave = "94->TIPOBEN|UPPER(90->COGNOME)|UPPER(90->NOME)";
|
||||||
TString80 chiave = "90->CODSEZ|90->CODSOT|94->TIPOBEN|UPPER(90->COGNOME)|UPPER(90->NOME)";
|
TString80 chiave = "";
|
||||||
|
if (_tiposta == 'S')
|
||||||
|
chiave = "90->CODSEZ|90->CODSOT|94->TIPOBEN|UPPER(90->COGNOME)|UPPER(90->NOME)";
|
||||||
|
else
|
||||||
|
chiave = "94->CODSEZ|94->CODSOT|94->TIPOBEN|UPPER(90->COGNOME)|UPPER(90->NOME)";
|
||||||
_cur = add_cursor(new TSorted_cursor(_rel, (const char*) chiave, "", 2, &da, &a));
|
_cur = add_cursor(new TSorted_cursor(_rel, (const char*) chiave, "", 2, &da, &a));
|
||||||
TString80 filtro = "";
|
|
||||||
// filtro per sezioni
|
// filtro per sezioni
|
||||||
_sezini = _msk->get(F_SEZINI);
|
_sezini = _msk->get(F_SEZINI);
|
||||||
_sotini = _msk->get(F_SOTINI);
|
_sotini = _msk->get(F_SOTINI);
|
||||||
_sezfin = _msk->get(F_SEZFIN);
|
_sezfin = _msk->get(F_SEZFIN);
|
||||||
_sotfin = _msk->get(F_SOTFIN);
|
_sotfin = _msk->get(F_SOTFIN);
|
||||||
if (_sezini.not_empty())
|
TString256 filtro = "";
|
||||||
filtro << "(90->CODSEZ >= \"" << _sezini << "\") && ";
|
if (_sezini.not_empty())
|
||||||
if (_sezfin.not_empty())
|
{
|
||||||
filtro << "(90->CODSEZ <= \"" << _sezfin << "\")";
|
if (_sotini.not_empty())
|
||||||
|
{
|
||||||
|
if (_tiposta == 'S')
|
||||||
|
{
|
||||||
|
filtro << "(";
|
||||||
|
filtro << format("(90->CODSEZ > \"%s\")",(const char*)_sezini);
|
||||||
|
filtro << " || ";
|
||||||
|
filtro << "(" << format("(90->CODSEZ == \"%s\")",(const char*)_sezini);
|
||||||
|
filtro << " && ";
|
||||||
|
filtro << format("(90->CODSOT >= \"%s\")",(const char*)_sotini);
|
||||||
|
filtro << ")";
|
||||||
|
filtro << ")";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
filtro << "(";
|
||||||
|
filtro << format("(94->CODSEZ > \"%s\")",(const char*)_sezini);
|
||||||
|
filtro << " || ";
|
||||||
|
filtro << "(" << format("(94->CODSEZ == \"%s\")",(const char*)_sezini);
|
||||||
|
filtro << " && ";
|
||||||
|
filtro << format("(94->CODSOT >= \"%s\")",(const char*)_sotini);
|
||||||
|
filtro << ")";
|
||||||
|
filtro << ")";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (_tiposta == 'S')
|
||||||
|
filtro << format("(90->CODSEZ >= \"%s\")",(const char*)_sezini);
|
||||||
|
else
|
||||||
|
filtro << format("(94->CODSEZ >= \"%s\")",(const char*)_sezini);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (_sezfin.not_empty())
|
||||||
|
{
|
||||||
|
if (filtro.not_empty())
|
||||||
|
filtro << " && ";
|
||||||
|
|
||||||
|
if (_sotfin.not_empty())
|
||||||
|
{
|
||||||
|
if (_tiposta == 'S')
|
||||||
|
{
|
||||||
|
filtro << "(";
|
||||||
|
filtro << format("(90->CODSEZ < \"%s\")",(const char*)_sezfin);
|
||||||
|
filtro << " || ";
|
||||||
|
filtro << "(" << format("(90->CODSEZ == \"%s\")",(const char*)_sezfin);
|
||||||
|
filtro << " && ";
|
||||||
|
filtro << format("(90->CODSOT <= \"%s\")",(const char*)_sotfin);
|
||||||
|
filtro << ")";
|
||||||
|
filtro << ")";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
filtro << "(";
|
||||||
|
filtro << format("(94->CODSEZ < \"%s\")",(const char*)_sezfin);
|
||||||
|
filtro << " || ";
|
||||||
|
filtro << "(" << format("(94->CODSEZ == \"%s\")",(const char*)_sezfin);
|
||||||
|
filtro << " && ";
|
||||||
|
filtro << format("(94->CODSOT <= \"%s\")",(const char*)_sotfin);
|
||||||
|
filtro << ")";
|
||||||
|
filtro << ")";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (_tiposta == 'S')
|
||||||
|
filtro << format("(90->CODSEZ <= \"%s\")",(const char*)_sezfin);
|
||||||
|
else
|
||||||
|
filtro << format("(94->CODSEZ <= \"%s\")",(const char*)_sezfin);
|
||||||
|
}
|
||||||
|
}
|
||||||
current_cursor()->setfilter((const char*) filtro, TRUE);
|
current_cursor()->setfilter((const char*) filtro, TRUE);
|
||||||
_counter = 0;
|
_counter = 0;
|
||||||
_tipoold = "**";
|
_tipoold = "**";
|
||||||
reset_files();
|
reset_files();
|
||||||
add_file(LF_BENEM);
|
add_file(LF_BENEM);
|
||||||
@ -231,7 +327,8 @@ bool TStampaBenemerenze::user_create()
|
|||||||
_rel->add(LF_COMUNI, "COM==RES_CODCOM",1,LF_SOGGETTI,ALIAS_COMRES);
|
_rel->add(LF_COMUNI, "COM==RES_CODCOM",1,LF_SOGGETTI,ALIAS_COMRES);
|
||||||
_rel->add(LF_COMUNI, "COM==DOM_CODCOM",1,LF_SOGGETTI,ALIAS_COMDOM);
|
_rel->add(LF_COMUNI, "COM==DOM_CODCOM",1,LF_SOGGETTI,ALIAS_COMDOM);
|
||||||
_rel->add(LF_COMUNI, "COM==COMNASC",1,LF_SOGGETTI,ALIAS_COMNAS);
|
_rel->add(LF_COMUNI, "COM==COMNASC",1,LF_SOGGETTI,ALIAS_COMNAS);
|
||||||
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
|
//_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
|
||||||
|
_sezioni = new TLocalisamfile(LF_SEZIONI);
|
||||||
_msk = new TMask("at1300a");
|
_msk = new TMask("at1300a");
|
||||||
TConfig config(CONFIG_STUDIO);
|
TConfig config(CONFIG_STUDIO);
|
||||||
_stampa80 = config.get_bool("Stampa80");
|
_stampa80 = config.get_bool("Stampa80");
|
||||||
@ -241,6 +338,7 @@ bool TStampaBenemerenze::user_create()
|
|||||||
bool TStampaBenemerenze::user_destroy()
|
bool TStampaBenemerenze::user_destroy()
|
||||||
{
|
{
|
||||||
delete _msk;
|
delete _msk;
|
||||||
|
delete _sezioni;
|
||||||
delete _rel;
|
delete _rel;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -11,3 +11,4 @@
|
|||||||
#define F_D_SOTFIN 108
|
#define F_D_SOTFIN 108
|
||||||
#define F_DATAINI 109
|
#define F_DATAINI 109
|
||||||
#define F_DATAFIN 110
|
#define F_DATAFIN 110
|
||||||
|
#define F_TIPOSTA 111
|
||||||
|
@ -14,7 +14,7 @@ BEGIN
|
|||||||
END
|
END
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
PAGE "Elenco benemerenze attribuite" -1 -1 78 20
|
PAGE "Elenco benemerenze per sezione" -1 -1 78 20
|
||||||
|
|
||||||
GROUPBOX DLG_NULL 77 4
|
GROUPBOX DLG_NULL 77 4
|
||||||
BEGIN
|
BEGIN
|
||||||
@ -146,5 +146,12 @@ BEGIN
|
|||||||
PROMPT 30 6 "al "
|
PROMPT 30 6 "al "
|
||||||
END
|
END
|
||||||
|
|
||||||
|
RADIOBUTTON F_TIPOSTA 40
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 8 "Stampa per sezione "
|
||||||
|
ITEM "B|che ha attribuito la benemerenza"
|
||||||
|
ITEM "S|di appartenenza attuale"
|
||||||
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
ENDMASK
|
ENDMASK
|
||||||
|
Loading…
x
Reference in New Issue
Block a user