Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : Elenco ben. per gruppo: possibilita' di fare elenco sintetico, completo, etichette git-svn-id: svn://10.65.10.50/trunk@7694 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
62eac92b31
commit
311165f3b9
139
at/at1400.cpp
139
at/at1400.cpp
@ -21,18 +21,41 @@
|
|||||||
#define ALIAS_COMDOM 501 // comune di domicilio
|
#define ALIAS_COMDOM 501 // comune di domicilio
|
||||||
#define ALIAS_COMNAS 500 // comune di nascita
|
#define ALIAS_COMNAS 500 // comune di nascita
|
||||||
|
|
||||||
|
#define ETI_COGNOME 3 // numero campo cognome e nome in etichetta (deve essere sempre cosi') per famiglie
|
||||||
|
|
||||||
|
enum ts { undefined=0, sintetico=1, completo=2, etichette=3 };
|
||||||
|
|
||||||
|
// definizione form per etichette
|
||||||
|
class TEti_bengru_form : public TForm
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
virtual TCursor* cursor() const;
|
||||||
|
virtual TRelation* relation() const;
|
||||||
|
TPrint_section& get_body() { return section('B'); } ;
|
||||||
|
TPrint_section& get_head() { return section('H'); } ;
|
||||||
|
TPrint_section& get_foot() { return section('F'); } ;
|
||||||
|
TEti_bengru_form(): TForm() {};
|
||||||
|
TEti_bengru_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
|
||||||
|
: TForm(form,code,editlevel,desc) {};
|
||||||
|
virtual ~TEti_bengru_form() {};
|
||||||
|
};
|
||||||
|
|
||||||
class TStampaBenxGAz : public TPrintapp
|
class TStampaBenxGAz : public TPrintapp
|
||||||
{
|
{
|
||||||
TRelation* _rel;
|
TRelation* _rel;
|
||||||
TMask* _msk;
|
TMask* _msk;
|
||||||
|
TEti_bengru_form* _form_eti;
|
||||||
int _cur;
|
int _cur;
|
||||||
char _tiposta;
|
char _tiposta;
|
||||||
TDate _dataini, _datafin;
|
TDate _dataini, _datafin;
|
||||||
TString16 _codsez, _codsot;
|
TString16 _codsez, _codsot;
|
||||||
bool _stampa80;
|
|
||||||
TParagraph_string _cognome_nome, _dencom;
|
TParagraph_string _cognome_nome, _dencom;
|
||||||
TString16 _gruppoazie, _gruppoold, _tipoold;
|
TString16 _gruppoazie, _gruppoold, _tipoold;
|
||||||
int _contatore;
|
int _contatore;
|
||||||
|
ts _tipostampa;
|
||||||
|
int _etlarghezza, _etcolonne;
|
||||||
|
bool _stampa80, _etictot;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool user_create();
|
virtual bool user_create();
|
||||||
@ -52,6 +75,10 @@ public:
|
|||||||
|
|
||||||
HIDDEN inline TStampaBenxGAz& app() { return (TStampaBenxGAz&) main_app(); }
|
HIDDEN inline TStampaBenxGAz& app() { return (TStampaBenxGAz&) main_app(); }
|
||||||
|
|
||||||
|
TCursor* TEti_bengru_form::cursor() const { return app().current_cursor(); }
|
||||||
|
|
||||||
|
TRelation* TEti_bengru_form::relation() const { return cursor()->relation(); }
|
||||||
|
|
||||||
print_action TStampaBenxGAz::postprocess_print(int file, int counter)
|
print_action TStampaBenxGAz::postprocess_print(int file, int counter)
|
||||||
{
|
{
|
||||||
if (_contatore > 0)
|
if (_contatore > 0)
|
||||||
@ -73,6 +100,58 @@ void TStampaBenxGAz::footer_gruppo()
|
|||||||
|
|
||||||
void TStampaBenxGAz::set_page(int file, int cnt)
|
void TStampaBenxGAz::set_page(int file, int cnt)
|
||||||
{
|
{
|
||||||
|
switch (_tipostampa)
|
||||||
|
{
|
||||||
|
case etichette:
|
||||||
|
{
|
||||||
|
TPrint_section& corpo = _form_eti->get_body();
|
||||||
|
for (int r=1;r<=_etcolonne;r++)
|
||||||
|
{
|
||||||
|
if (current_cursor()->pos()<current_cursor()->items())
|
||||||
|
{
|
||||||
|
bool avanza = TRUE;
|
||||||
|
while (avanza)
|
||||||
|
{
|
||||||
|
if (current_cursor()->pos()<current_cursor()->items())
|
||||||
|
avanza = !(preprocess_page(file, cnt));
|
||||||
|
else
|
||||||
|
avanza = FALSE;
|
||||||
|
if (avanza)
|
||||||
|
++(*current_cursor());
|
||||||
|
}
|
||||||
|
force_setpage(TRUE);
|
||||||
|
TForm_item& cognome = corpo.find_field(ETI_COGNOME);
|
||||||
|
cognome.set(_cognome_nome);
|
||||||
|
corpo.update();
|
||||||
|
for (word i = 0; i < corpo.height(); i++)
|
||||||
|
{
|
||||||
|
TPrintrow& riga = corpo.row(i);
|
||||||
|
TString256 riga1 = riga.row();
|
||||||
|
riga1.cut(_etlarghezza);
|
||||||
|
int colonna = ((r-1)*_etlarghezza);
|
||||||
|
TString16 formato;
|
||||||
|
formato << '@' << colonna << 'g';
|
||||||
|
riga1.insert(formato,0);
|
||||||
|
set_row(i+1,riga1);
|
||||||
|
}
|
||||||
|
if (r < _etcolonne)
|
||||||
|
{
|
||||||
|
bool avanza = TRUE;
|
||||||
|
while (avanza)
|
||||||
|
{
|
||||||
|
++(*current_cursor());
|
||||||
|
if (current_cursor()->pos()<current_cursor()->items())
|
||||||
|
avanza = !(preprocess_page(file, cnt));
|
||||||
|
else
|
||||||
|
avanza = FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case completo:
|
||||||
|
{
|
||||||
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########"));
|
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########"));
|
||||||
set_row(1,"@9g@S", FLD(LF_SOGGETTI,SOG_CATDON));
|
set_row(1,"@9g@S", FLD(LF_SOGGETTI,SOG_CATDON));
|
||||||
set_row(1,"@12g#a", &_cognome_nome);
|
set_row(1,"@12g#a", &_cognome_nome);
|
||||||
@ -82,10 +161,20 @@ void TStampaBenxGAz::set_page(int file, int cnt)
|
|||||||
set_row(1,"@116g@S", FLD(LF_SOGGETTI,SOG_TELLAV));
|
set_row(1,"@116g@S", FLD(LF_SOGGETTI,SOG_TELLAV));
|
||||||
set_row(2,"@49g#a", &_dencom);
|
set_row(2,"@49g#a", &_dencom);
|
||||||
set_row(2,"@116g@S", FLD(LF_SOGGETTI,SOG_TELALT));
|
set_row(2,"@116g@S", FLD(LF_SOGGETTI,SOG_TELALT));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case sintetico:
|
||||||
|
{
|
||||||
|
set_row(1,"@0g#a", &_cognome_nome);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TStampaBenxGAz::preprocess_page(int file, int counter)
|
bool TStampaBenxGAz::preprocess_page(int file, int counter)
|
||||||
{
|
{
|
||||||
|
if (_tipostampa==sintetico||_tipostampa==completo)
|
||||||
|
{
|
||||||
TString80 nome = current_cursor()->curr(LF_SOGGETTI).get(SOG_COGNOME);
|
TString80 nome = current_cursor()->curr(LF_SOGGETTI).get(SOG_COGNOME);
|
||||||
nome << " ";
|
nome << " ";
|
||||||
nome << current_cursor()->curr(LF_SOGGETTI).get(SOG_NOME);
|
nome << current_cursor()->curr(LF_SOGGETTI).get(SOG_NOME);
|
||||||
@ -133,9 +222,15 @@ bool TStampaBenxGAz::preprocess_page(int file, int counter)
|
|||||||
if (printer().rows_left() < 3)
|
if (printer().rows_left() < 3)
|
||||||
printer().formfeed();
|
printer().formfeed();
|
||||||
printer().print(riga);
|
printer().print(riga);
|
||||||
|
riga.reset();
|
||||||
|
printer().print(riga);
|
||||||
}
|
}
|
||||||
if (printer().rows_left() < 4)
|
if (printer().rows_left() < 4)
|
||||||
printer().formfeed();
|
printer().formfeed();
|
||||||
|
}
|
||||||
|
if (_tipostampa==etichette)
|
||||||
|
if (printer().rows_left() < _form_eti->get_body().height())
|
||||||
|
printer().formfeed();
|
||||||
_contatore++;
|
_contatore++;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -151,17 +246,37 @@ void TStampaBenxGAz::header_gruppo(const TString16 gruppo)
|
|||||||
gaz.put("CODTAB",gruppo);
|
gaz.put("CODTAB",gruppo);
|
||||||
if (gaz.read() == NOERR)
|
if (gaz.read() == NOERR)
|
||||||
intestazione << gaz.get("S0");
|
intestazione << gaz.get("S0");
|
||||||
|
if (_tipostampa==completo)
|
||||||
intestazione.center_just(132);
|
intestazione.center_just(132);
|
||||||
|
if (_tipostampa==sintetico)
|
||||||
|
intestazione.left_just(132);
|
||||||
set_header(2,"@0g%s", (const char*) intestazione);
|
set_header(2,"@0g%s", (const char*) intestazione);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TStampaBenxGAz::set_print(int m)
|
bool TStampaBenxGAz::set_print(int m)
|
||||||
{
|
{
|
||||||
|
_tipostampa = undefined;
|
||||||
KEY tasto;
|
KEY tasto;
|
||||||
tasto = _msk->run();
|
tasto = _msk->run();
|
||||||
if (tasto == K_ENTER)
|
switch (tasto)
|
||||||
{
|
{
|
||||||
|
case F_SINTETICO:
|
||||||
|
_tipostampa=sintetico;
|
||||||
|
break;
|
||||||
|
case F_COMPLETO:
|
||||||
|
_tipostampa=completo;
|
||||||
|
break;
|
||||||
|
case F_ETICHETTE:
|
||||||
|
_tipostampa=etichette;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (_tipostampa != undefined)
|
||||||
|
{
|
||||||
|
if (_tipostampa == etichette)
|
||||||
|
_cognome_nome.set_width(200);
|
||||||
|
if (_tipostampa == sintetico)
|
||||||
|
_cognome_nome.set_width(51);
|
||||||
_dataini = _msk->get_date(F_DATAINI);
|
_dataini = _msk->get_date(F_DATAINI);
|
||||||
_datafin = _msk->get_date(F_DATAFIN);
|
_datafin = _msk->get_date(F_DATAFIN);
|
||||||
_gruppoazie = _msk->get(F_GRUPPOAZIE);
|
_gruppoazie = _msk->get(F_GRUPPOAZIE);
|
||||||
@ -209,22 +324,34 @@ bool TStampaBenxGAz::set_print(int m)
|
|||||||
void TStampaBenxGAz::crea_intestazione()
|
void TStampaBenxGAz::crea_intestazione()
|
||||||
{
|
{
|
||||||
reset_header();
|
reset_header();
|
||||||
|
if (_tipostampa==sintetico || _tipostampa==completo)
|
||||||
|
{
|
||||||
TString sep(132);
|
TString sep(132);
|
||||||
sep = "STAMPA BENEMERENZE ATTRIBUITE dal ";
|
sep = "STAMPA BENEMERENZE ATTRIBUITE dal ";
|
||||||
sep << _dataini;
|
sep << _dataini;
|
||||||
sep << " al ";
|
sep << " al ";
|
||||||
sep << _datafin;
|
sep << _datafin;
|
||||||
|
if (_tipostampa==completo)
|
||||||
sep.center_just(132);
|
sep.center_just(132);
|
||||||
|
if (_tipostampa==sintetico)
|
||||||
|
sep.left_just(132);
|
||||||
set_header(1,"@0g%s", (const char*) sep);
|
set_header(1,"@0g%s", (const char*) sep);
|
||||||
sep = "Pag. @#";
|
sep = "Pag. @#";
|
||||||
set_header(1, "@110g%s", (const char*) sep);
|
if (_tipostampa==completo)
|
||||||
|
set_header(2, "@110g%s", (const char*) sep);
|
||||||
|
if (_tipostampa==sintetico)
|
||||||
|
set_header(2, "@60g%s", (const char*) sep);
|
||||||
sep = "";
|
sep = "";
|
||||||
sep.fill('-');
|
sep.fill('-');
|
||||||
|
if (_tipostampa==completo)
|
||||||
|
{
|
||||||
set_header(3, (const char *) sep);
|
set_header(3, (const char *) sep);
|
||||||
set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gIndirizzo@100gTelefono abit.@116gTelefono lavoro");
|
set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gIndirizzo@100gTelefono abit.@116gTelefono lavoro");
|
||||||
set_header(5,"@49gCAP/Località/Comune/Prov.@116gTelefono altro");
|
set_header(5,"@49gCAP/Località/Comune/Prov.@116gTelefono altro");
|
||||||
set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g--------------------------------------------------@100g---------------@116g---------------");
|
set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g--------------------------------------------------@100g---------------@116g---------------");
|
||||||
|
}
|
||||||
printer().footerlen(3);
|
printer().footerlen(3);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TStampaBenxGAz::user_create()
|
bool TStampaBenxGAz::user_create()
|
||||||
@ -240,12 +367,18 @@ bool TStampaBenxGAz::user_create()
|
|||||||
_rel->add(LF_COMUNI, "COM==COMNASC",1,LF_SOGGETTI,ALIAS_COMNAS);
|
_rel->add(LF_COMUNI, "COM==COMNASC",1,LF_SOGGETTI,ALIAS_COMNAS);
|
||||||
_msk = new TMask("at1400a");
|
_msk = new TMask("at1400a");
|
||||||
TConfig config(CONFIG_STUDIO);
|
TConfig config(CONFIG_STUDIO);
|
||||||
|
TString16 etformato = config.get("EtFormato");
|
||||||
|
_etlarghezza = config.get_int("EtLarghezza");
|
||||||
|
_etcolonne = config.get_int("EtColonne");
|
||||||
|
_form_eti = new TEti_bengru_form(etformato);
|
||||||
_stampa80 = config.get_bool("Stampa80");
|
_stampa80 = config.get_bool("Stampa80");
|
||||||
|
_etictot = config.get_bool("EticTot");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TStampaBenxGAz::user_destroy()
|
bool TStampaBenxGAz::user_destroy()
|
||||||
{
|
{
|
||||||
|
delete _form_eti;
|
||||||
delete _msk;
|
delete _msk;
|
||||||
delete _rel;
|
delete _rel;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -14,3 +14,7 @@
|
|||||||
#define F_GRUPPOAZIE 111
|
#define F_GRUPPOAZIE 111
|
||||||
#define F_D_GRUPPOAZIE 112
|
#define F_D_GRUPPOAZIE 112
|
||||||
#define F_TIPOSTA 113
|
#define F_TIPOSTA 113
|
||||||
|
|
||||||
|
#define F_SINTETICO 501
|
||||||
|
#define F_COMPLETO 502
|
||||||
|
#define F_ETICHETTE 503
|
||||||
|
@ -2,16 +2,29 @@
|
|||||||
|
|
||||||
TOOLBAR "" 0 20 0 2
|
TOOLBAR "" 0 20 0 2
|
||||||
|
|
||||||
BUTTON DLG_PRINT 9 2
|
BUTTON F_SINTETICO 9 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -12 -11 "~Stampa"
|
PROMPT -14 -11 "~Sintetico"
|
||||||
MESSAGE EXIT,K_ENTER
|
MESSAGE EXIT,F_SINTETICO
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON F_COMPLETO 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -24 -11 "~Completo"
|
||||||
|
MESSAGE EXIT,F_COMPLETO
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON F_ETICHETTE 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -34 -11 "~Etichette"
|
||||||
|
MESSAGE EXIT,F_ETICHETTE
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_QUIT 9 2
|
BUTTON DLG_QUIT 9 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -22 -11 ""
|
PROMPT -44 -11 ""
|
||||||
END
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
PAGE "Elenco benemerenze per gruppo aziendale" -1 -1 78 20
|
PAGE "Elenco benemerenze per gruppo aziendale" -1 -1 78 20
|
||||||
|
Loading…
x
Reference in New Issue
Block a user