Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : Corretto ordine nella destroy(); possibilita' di selezionare se stampare un foglio per ogni sezione git-svn-id: svn://10.65.10.50/trunk@6927 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
67b9c5e40f
commit
d4aa612144
158
at/at4400.cpp
158
at/at4400.cpp
@ -33,7 +33,7 @@ public:
|
|||||||
virtual ~TStConvoc_form() {};
|
virtual ~TStConvoc_form() {};
|
||||||
};
|
};
|
||||||
|
|
||||||
class TConvocazioniPerSezione : public TPrintapp
|
class TConvocazioniPerPunto : public TPrintapp
|
||||||
{
|
{
|
||||||
TRelation* _rel;
|
TRelation* _rel;
|
||||||
TMask* _msk;
|
TMask* _msk;
|
||||||
@ -43,7 +43,7 @@ class TConvocazioniPerSezione : public TPrintapp
|
|||||||
TParagraph_string _cognome_nome;
|
TParagraph_string _cognome_nome;
|
||||||
TDate _data_stampa;
|
TDate _data_stampa;
|
||||||
TDate _dataini, _datafin;
|
TDate _dataini, _datafin;
|
||||||
bool _aggiorna;
|
bool _aggiorna, _persezione;
|
||||||
TString16 _punto,_tipo, _sezione, _sottog, _ordina;
|
TString16 _punto,_tipo, _sezione, _sottog, _ordina;
|
||||||
TString16 _codsez, _codsot;
|
TString16 _codsez, _codsot;
|
||||||
TString16 _orario, _datacart;
|
TString16 _orario, _datacart;
|
||||||
@ -51,7 +51,7 @@ class TConvocazioniPerSezione : public TPrintapp
|
|||||||
TString80 _note, _intest1, _intest2, _intest3, _intest4;
|
TString80 _note, _intest1, _intest2, _intest3, _intest4;
|
||||||
bool _usasez;
|
bool _usasez;
|
||||||
ts _tipostampa;
|
ts _tipostampa;
|
||||||
int _contxsez;
|
int _contxsez, _contatore;
|
||||||
int _etlarghezza, _etcolonne;
|
int _etlarghezza, _etcolonne;
|
||||||
|
|
||||||
//static bool filter_func_stconvoc(const TRelation* rel);
|
//static bool filter_func_stconvoc(const TRelation* rel);
|
||||||
@ -69,18 +69,19 @@ public:
|
|||||||
void crea_intestazione();
|
void crea_intestazione();
|
||||||
void header_sezione(const TString16 codsez, const TString16 codsot);
|
void header_sezione(const TString16 codsez, const TString16 codsot);
|
||||||
void footer_sezione();
|
void footer_sezione();
|
||||||
|
void fine_stampa();
|
||||||
void dati_sezione(const TString16 codsez, const TString16 codsot);
|
void dati_sezione(const TString16 codsez, const TString16 codsot);
|
||||||
TMask& app_mask() { return *_msk; }
|
TMask& app_mask() { return *_msk; }
|
||||||
TConvocazioniPerSezione() : _data_stampa(TODAY), _cognome_nome("",35) {}
|
TConvocazioniPerPunto() : _data_stampa(TODAY), _cognome_nome("",35) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
HIDDEN inline TConvocazioniPerSezione& app() { return (TConvocazioniPerSezione&) main_app(); }
|
HIDDEN inline TConvocazioniPerPunto& app() { return (TConvocazioniPerPunto&) main_app(); }
|
||||||
|
|
||||||
TCursor* TStConvoc_form::cursor() const { return app().current_cursor(); }
|
TCursor* TStConvoc_form::cursor() const { return app().current_cursor(); }
|
||||||
|
|
||||||
TRelation* TStConvoc_form::relation() const { return cursor()->relation(); }
|
TRelation* TStConvoc_form::relation() const { return cursor()->relation(); }
|
||||||
|
|
||||||
ts TConvocazioniPerSezione::dati_cartoline()
|
ts TConvocazioniPerPunto::dati_cartoline()
|
||||||
{
|
{
|
||||||
TMask msk("at4100b");
|
TMask msk("at4100b");
|
||||||
if (msk.run() == K_ENTER)
|
if (msk.run() == K_ENTER)
|
||||||
@ -101,7 +102,21 @@ ts TConvocazioniPerSezione::dati_cartoline()
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TConvocazioniPerSezione::set_page(int file, int cnt)
|
void TConvocazioniPerPunto::fine_stampa()
|
||||||
|
{
|
||||||
|
// stampa totale soggetti a fine stampa
|
||||||
|
|
||||||
|
reset_footer();
|
||||||
|
printer().footerlen(20);
|
||||||
|
TString sep(80);
|
||||||
|
sep.fill('-');
|
||||||
|
set_footer(1, (const char *) sep);
|
||||||
|
set_footer(2,"TOTALE SOGGETTI CONVOCATI %d", _contatore);
|
||||||
|
printer().formfeed();
|
||||||
|
reset_footer();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TConvocazioniPerPunto::set_page(int file, int cnt)
|
||||||
{
|
{
|
||||||
// costruzione etichette
|
// costruzione etichette
|
||||||
switch (_tipostampa)
|
switch (_tipostampa)
|
||||||
@ -185,25 +200,34 @@ void TConvocazioniPerSezione::set_page(int file, int cnt)
|
|||||||
set_row(1,"@0g#a", &_cognome_nome);
|
set_row(1,"@0g#a", &_cognome_nome);
|
||||||
set_row(1,"@36g@S", FLD(LF_SOGGETTI,SOG_CATDON));
|
set_row(1,"@36g@S", FLD(LF_SOGGETTI,SOG_CATDON));
|
||||||
set_row(1,"@40g@S", FLD(LF_SOGGETTI,SOG_TESSAVIS));
|
set_row(1,"@40g@S", FLD(LF_SOGGETTI,SOG_TESSAVIS));
|
||||||
set_row(1,"@48g@ld", FLD(LF_SOGGETTI,SOG_DATAULTDON));
|
set_row(1,"@48g@S", FLD(LF_SOGGETTI,SOG_CODSEZ));
|
||||||
set_row(1,"@59g@S", FLD(LF_SOGGETTI,SOG_TIPOULTDON));
|
set_row(1,"@51g@S", FLD(LF_SOGGETTI,SOG_CODSOT));
|
||||||
set_row(1,"@62g@ld", FLD(LF_RCONVOC,RCV_DATACONV));
|
set_row(1,"@54g@ld", FLD(LF_SOGGETTI,SOG_DATAULTDON));
|
||||||
set_row(1,"@73g@S", FLD(LF_RCONVOC,RCV_CHIAMATA));
|
set_row(1,"@65g@S", FLD(LF_SOGGETTI,SOG_TIPOULTDON));
|
||||||
set_row(1,"@75g@S", FLD(LF_CONVOC,COV_DATA));
|
set_row(1,"@68g@ld", FLD(LF_RCONVOC,RCV_DATACONV));
|
||||||
|
set_row(1,"@79g@S", FLD(LF_RCONVOC,RCV_CHIAMATA));
|
||||||
|
set_row(1,"@84g@S", FLD(LF_CONVOC,COV_DATA));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print_action TConvocazioniPerSezione::postprocess_print(int file, int counter)
|
print_action TConvocazioniPerPunto::postprocess_print(int file, int counter)
|
||||||
{
|
{
|
||||||
if (_contxsez > 0)
|
if (_contxsez > 0)
|
||||||
footer_sezione();
|
footer_sezione();
|
||||||
|
if ((_contatore > 0) && ((_contatore != _contxsez) || (!_persezione)))
|
||||||
|
fine_stampa();
|
||||||
return NEXT_PAGE;
|
return NEXT_PAGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TConvocazioniPerSezione::preprocess_page(int file, int counter)
|
bool TConvocazioniPerPunto::preprocess_page(int file, int counter)
|
||||||
{
|
{
|
||||||
|
if (_aggiorna)
|
||||||
|
{
|
||||||
|
current_cursor()->curr().put(RCV_STAMPATO,"X");
|
||||||
|
current_cursor()->file().rewrite();
|
||||||
|
}
|
||||||
if (_tipostampa==elenco)
|
if (_tipostampa==elenco)
|
||||||
{
|
{
|
||||||
TString80 nome = current_cursor()->curr(LF_SOGGETTI).get(SOG_COGNOME);
|
TString80 nome = current_cursor()->curr(LF_SOGGETTI).get(SOG_COGNOME);
|
||||||
@ -224,6 +248,7 @@ bool TConvocazioniPerSezione::preprocess_page(int file, int counter)
|
|||||||
header_sezione(codsez, codsot);
|
header_sezione(codsez, codsot);
|
||||||
}
|
}
|
||||||
_contxsez++;
|
_contxsez++;
|
||||||
|
_contatore++;
|
||||||
}
|
}
|
||||||
if (_tipostampa==etichette)
|
if (_tipostampa==etichette)
|
||||||
if (printer().rows_left() < _form_eti->get_body().height())
|
if (printer().rows_left() < _form_eti->get_body().height())
|
||||||
@ -231,48 +256,49 @@ bool TConvocazioniPerSezione::preprocess_page(int file, int counter)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TConvocazioniPerSezione::footer_sezione()
|
void TConvocazioniPerPunto::footer_sezione()
|
||||||
{
|
{
|
||||||
// stampa totale sezione
|
if (_persezione)
|
||||||
reset_footer();
|
{
|
||||||
TString sep(80);
|
// stampa totale sezione
|
||||||
sep.fill('-');
|
reset_footer();
|
||||||
set_footer(2, (const char *) sep);
|
TString sep(80);
|
||||||
set_footer(3,"TOTALE CONVOCATI SEZIONE %d", _contxsez);
|
sep.fill('-');
|
||||||
printer().formfeed();
|
set_footer(2, (const char *) sep);
|
||||||
reset_footer();
|
set_footer(3,"TOTALE CONVOCATI SEZIONE %d", _contxsez);
|
||||||
|
printer().formfeed();
|
||||||
|
reset_footer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TConvocazioniPerSezione::header_sezione(const TString16 codsez, const TString16 codsot)
|
void TConvocazioniPerPunto::header_sezione(const TString16 codsez, const TString16 codsot)
|
||||||
{
|
{
|
||||||
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
if (_persezione)
|
||||||
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
|
||||||
TString intestazione(80);
|
|
||||||
intestazione = "Sezione: ";
|
|
||||||
intestazione << codsez;
|
|
||||||
if (codsot.not_empty())
|
|
||||||
{
|
{
|
||||||
intestazione << "/";
|
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||||
intestazione << codsot;
|
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||||
}
|
TString intestazione(80);
|
||||||
intestazione << " ";
|
intestazione = "Sezione: ";
|
||||||
intestazione << densez;
|
intestazione << codsez;
|
||||||
if (densot.not_empty())
|
if (codsot.not_empty())
|
||||||
{
|
{
|
||||||
intestazione << "/";
|
intestazione << "/";
|
||||||
intestazione << densot;
|
intestazione << codsot;
|
||||||
}
|
}
|
||||||
intestazione.center_just();
|
intestazione << " ";
|
||||||
set_header(1,"@0g%s", (const char*) intestazione);
|
intestazione << densez;
|
||||||
TString16 data_stampa = _data_stampa.string();
|
if (densot.not_empty())
|
||||||
set_header(1,"@0g%10s", (const char*) data_stampa);
|
{
|
||||||
TString16 sep = "";
|
intestazione << "/";
|
||||||
sep << "Pag. @#";
|
intestazione << densot;
|
||||||
set_header(1, "@70g%s", (const char*) sep);
|
}
|
||||||
|
intestazione.center_just();
|
||||||
|
set_header(1,"@0g%s", (const char*) intestazione);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TConvocazioniPerSezione::dati_sezione(const TString16 codsez, const TString16 codsot)
|
void TConvocazioniPerPunto::dati_sezione(const TString16 codsez, const TString16 codsot)
|
||||||
{
|
{
|
||||||
_intest1 = current_cursor()->curr(LF_SEZIONI).get(SEZ_INTESTAZ1);
|
_intest1 = current_cursor()->curr(LF_SEZIONI).get(SEZ_INTESTAZ1);
|
||||||
_intest2 = current_cursor()->curr(LF_SEZIONI).get(SEZ_INTESTAZ2);
|
_intest2 = current_cursor()->curr(LF_SEZIONI).get(SEZ_INTESTAZ2);
|
||||||
@ -295,7 +321,7 @@ void TConvocazioniPerSezione::dati_sezione(const TString16 codsez, const TString
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TConvocazioniPerSezione::set_print(int m)
|
bool TConvocazioniPerPunto::set_print(int m)
|
||||||
{
|
{
|
||||||
_tipostampa = undefined;
|
_tipostampa = undefined;
|
||||||
KEY tasto;
|
KEY tasto;
|
||||||
@ -321,6 +347,7 @@ bool TConvocazioniPerSezione::set_print(int m)
|
|||||||
_sezione = _msk->get(F_CODSEZ);
|
_sezione = _msk->get(F_CODSEZ);
|
||||||
_sottog = _msk->get(F_CODSOT);
|
_sottog = _msk->get(F_CODSOT);
|
||||||
_aggiorna = _msk->get_bool(F_AGGIORNA);
|
_aggiorna = _msk->get_bool(F_AGGIORNA);
|
||||||
|
_persezione = _msk->get_bool(F_PERSEZIONE);
|
||||||
_ordina = _msk->get(F_ORDINA);
|
_ordina = _msk->get(F_ORDINA);
|
||||||
TString256 chiave = "";
|
TString256 chiave = "";
|
||||||
switch (_ordina[0])
|
switch (_ordina[0])
|
||||||
@ -373,6 +400,8 @@ bool TConvocazioniPerSezione::set_print(int m)
|
|||||||
//current_cursor()->set_filterfunction(filter_func_stconvoc);
|
//current_cursor()->set_filterfunction(filter_func_stconvoc);
|
||||||
_codsez = "**";
|
_codsez = "**";
|
||||||
_codsot = "**";
|
_codsot = "**";
|
||||||
|
_contxsez = 0;
|
||||||
|
_contatore = 0;
|
||||||
reset_files();
|
reset_files();
|
||||||
add_file(LF_RCONVOC);
|
add_file(LF_RCONVOC);
|
||||||
reset_print();
|
reset_print();
|
||||||
@ -383,7 +412,7 @@ bool TConvocazioniPerSezione::set_print(int m)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TConvocazioniPerSezione::crea_intestazione()
|
void TConvocazioniPerPunto::crea_intestazione()
|
||||||
{
|
{
|
||||||
reset_header();
|
reset_header();
|
||||||
if (_tipostampa == elenco)
|
if (_tipostampa == elenco)
|
||||||
@ -407,9 +436,11 @@ void TConvocazioniPerSezione::crea_intestazione()
|
|||||||
}
|
}
|
||||||
sep.center_just();
|
sep.center_just();
|
||||||
set_header(2, "@0g%s", (const char*) sep);
|
set_header(2, "@0g%s", (const char*) sep);
|
||||||
char ora[16];
|
TString16 data_stampa = _data_stampa.string();
|
||||||
_strtime(ora);
|
set_header(2,"@0g%10s", (const char*) data_stampa);
|
||||||
set_header(2,"@0g%8s", ora);
|
sep = "";
|
||||||
|
sep << "Pag. @#";
|
||||||
|
set_header(2, "@80g%s", (const char*) sep);
|
||||||
sep = "";
|
sep = "";
|
||||||
if (_punto.not_empty())
|
if (_punto.not_empty())
|
||||||
{
|
{
|
||||||
@ -423,13 +454,16 @@ void TConvocazioniPerSezione::crea_intestazione()
|
|||||||
}
|
}
|
||||||
sep.center_just();
|
sep.center_just();
|
||||||
set_header(3, "@0g%s", (const char*) sep);
|
set_header(3, "@0g%s", (const char*) sep);
|
||||||
set_header(5,"@0gCognome e nome@36gCat.@40gTessera@48gUltima donaz.@62gData conv.@73gTipo");
|
char ora[16];
|
||||||
set_header(6,"@0g-----------------------------------@36g---@40g-------@48g---------- --@62g----------@73g----");
|
_strtime(ora);
|
||||||
|
set_header(3,"@0g%8s", ora);
|
||||||
|
set_header(5,"@0gCognome e nome@36gCat.@40gTessera@48gSe/So@54gUltima donaz.@68gData cart.@79gTipo@84gData conv.");
|
||||||
|
set_header(6,"@0g-----------------------------------@36g---@40g-------@48g-- --@54g---------- --@68g----------@79g----@84g----------");
|
||||||
printer().footerlen(3);
|
printer().footerlen(3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TConvocazioniPerSezione::user_create()
|
bool TConvocazioniPerPunto::user_create()
|
||||||
{
|
{
|
||||||
_rel = new TRelation(LF_RCONVOC);
|
_rel = new TRelation(LF_RCONVOC);
|
||||||
_rel->add(LF_SOGGETTI, "CODICE==CODICE");
|
_rel->add(LF_SOGGETTI, "CODICE==CODICE");
|
||||||
@ -447,18 +481,18 @@ bool TConvocazioniPerSezione::user_create()
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TConvocazioniPerSezione::user_destroy()
|
bool TConvocazioniPerPunto::user_destroy()
|
||||||
{
|
{
|
||||||
|
delete _form_car;
|
||||||
|
delete _form_eti;
|
||||||
delete _msk;
|
delete _msk;
|
||||||
delete _rel;
|
delete _rel;
|
||||||
delete _form_eti;
|
|
||||||
delete _form_car;
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int at4400(int argc, char* argv[])
|
int at4400(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
TConvocazioniPerSezione a;
|
TConvocazioniPerPunto a;
|
||||||
a.run(argc, argv, "Elenco convocati");
|
a.run(argc, argv, "Stampa convocati su punto di prelievo");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user