Patch level : 1.7 at 682
Files correlati : at1.exe Ricompilazione Demo : [ ] Commento : Stampa lettere ai premiati sia per sezione che per gruppo aziendale git-svn-id: svn://10.65.10.50/trunk@11780 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
4fa8e6ddaa
commit
aaa5f2c762
@ -12,8 +12,6 @@
|
||||
#include "at1300a.h"
|
||||
#include "atlib.h"
|
||||
|
||||
#define CAMPO_BENEM 10 // campo benemerenza in form per lettera
|
||||
|
||||
#define ALIAS_BNZ 600
|
||||
//#define ALIAS_LCPRES 101 // localita' postale di residenza
|
||||
#define ALIAS_LCPDOM 100 // localita' postale di domicilio
|
||||
|
@ -16,15 +16,13 @@
|
||||
#define ALIAS_BNZ 600
|
||||
#define ALIAS_GAZ 300
|
||||
|
||||
#define ALIAS_LCPRES 101 // localita' postale di residenza
|
||||
#define ALIAS_LCPDOM 100 // localita' postale di domicilio
|
||||
#define ALIAS_COMRES 502 // comune di residenza
|
||||
#define ALIAS_COMDOM 501 // comune di domicilio
|
||||
#define ALIAS_COMNAS 500 // comune di nascita
|
||||
|
||||
#define ETI_COGNOME 3 // numero campo cognome e nome in etichetta (deve essere sempre cosi') per famiglie
|
||||
#define LET_BENEM 10 // campo benemerenza in form per lettera
|
||||
|
||||
enum ts { undefined=0, sintetico=1, completo=2, etichette=3 };
|
||||
enum ts { undefined=0, sintetico=1, completo=2, etichette=3, lettere=4 };
|
||||
|
||||
// definizione form per etichette
|
||||
class TEti_bengru_form : public TForm
|
||||
@ -47,6 +45,7 @@ class TStampaBenxGAz : public TPrintapp
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TEti_bengru_form* _form_eti;
|
||||
TEti_bengru_form* _form_let;
|
||||
int _cur;
|
||||
char _tiposta;
|
||||
TDate _dataini, _datafin;
|
||||
@ -151,6 +150,23 @@ void TStampaBenxGAz::set_page(int file, int cnt)
|
||||
}
|
||||
}
|
||||
break;
|
||||
case lettere:
|
||||
{
|
||||
TPrint_section& corpo = _form_let->get_body();
|
||||
TForm_item& item_benem = corpo.find_field(LET_BENEM);
|
||||
TString80 benem = current_cursor()->curr(-ALIAS_BNZ).get("S0");
|
||||
int new_x = (88-benem.len())/2;
|
||||
item_benem.set_x(new_x);
|
||||
corpo.update();
|
||||
for (word i = 0; i < corpo.height(); i++)
|
||||
{
|
||||
TPrintrow& riga = corpo.row(i);
|
||||
set_row(i+1,riga);
|
||||
}
|
||||
force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage
|
||||
// altrimenti stampa sempre la stessa etichetta
|
||||
}
|
||||
break;
|
||||
case completo:
|
||||
{
|
||||
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########"));
|
||||
@ -230,6 +246,9 @@ bool TStampaBenxGAz::preprocess_page(int file, int counter)
|
||||
if (_tipostampa==etichette)
|
||||
if (printer().rows_left() < _form_eti->get_body().height())
|
||||
printer().formfeed();
|
||||
if (_tipostampa==lettere)
|
||||
if (printer().rows_left() < _form_let->get_body().height())
|
||||
printer().formfeed();
|
||||
_contatore++;
|
||||
return TRUE;
|
||||
}
|
||||
@ -266,7 +285,10 @@ bool TStampaBenxGAz::set_print(int m)
|
||||
break;
|
||||
case F_ETICHETTE:
|
||||
_tipostampa = (configura_stampante(p, "AT_ETICHETTE", "etichette")) ? etichette : undefined;
|
||||
break;
|
||||
break;
|
||||
case F_LETTERE:
|
||||
_tipostampa = lettere;
|
||||
break;
|
||||
}
|
||||
if (_tipostampa != undefined)
|
||||
{
|
||||
@ -357,17 +379,18 @@ bool TStampaBenxGAz::user_create()
|
||||
_rel->add(LF_SOGGETTI, "CODICE==CODICE");
|
||||
_rel->add("BNZ", "CODTAB==TIPOBEN",1,0,ALIAS_BNZ);
|
||||
//_rel->add("GAZ", "CODTAB==GRUPPOAZIE",1,LF_SOGGETTI,ALIAS_GAZ);
|
||||
_rel->add("LCP", "CODTAB==RES_CODLOC",1,LF_SOGGETTI,ALIAS_LCPRES);
|
||||
//_rel->add("LCP", "CODTAB==RES_CODLOC",1,LF_SOGGETTI,ALIAS_LCPRES);
|
||||
_rel->add("LCP", "CODTAB==DOM_CODLOC",1,LF_SOGGETTI,ALIAS_LCPDOM);
|
||||
_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==COMNASC",1,LF_SOGGETTI,ALIAS_COMNAS);
|
||||
//_rel->add(LF_COMUNI, "COM==COMNASC",1,LF_SOGGETTI,ALIAS_COMNAS);
|
||||
_msk = new TMask("at1400a");
|
||||
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);
|
||||
_form_let = new TEti_bengru_form("ATLEBEBO");
|
||||
_stampa80 = config.get_bool("Stampa80");
|
||||
_etictot = config.get_bool("EticTot");
|
||||
return TRUE;
|
||||
@ -375,6 +398,7 @@ bool TStampaBenxGAz::user_create()
|
||||
|
||||
bool TStampaBenxGAz::user_destroy()
|
||||
{
|
||||
delete _form_let;
|
||||
delete _form_eti;
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
|
@ -18,3 +18,4 @@
|
||||
#define F_SINTETICO 501
|
||||
#define F_COMPLETO 502
|
||||
#define F_ETICHETTE 503
|
||||
#define F_LETTERE 504
|
||||
|
@ -4,25 +4,31 @@ TOOLBAR "" 0 20 0 2
|
||||
|
||||
BUTTON F_SINTETICO 9 2
|
||||
BEGIN
|
||||
PROMPT -14 -11 "~Sintetico"
|
||||
PROMPT -15 -11 "~Sintetico"
|
||||
MESSAGE EXIT,F_SINTETICO
|
||||
END
|
||||
|
||||
BUTTON F_COMPLETO 9 2
|
||||
BEGIN
|
||||
PROMPT -24 -11 "~Completo"
|
||||
PROMPT -25 -11 "~Completo"
|
||||
MESSAGE EXIT,F_COMPLETO
|
||||
END
|
||||
|
||||
BUTTON F_ETICHETTE 9 2
|
||||
BEGIN
|
||||
PROMPT -34 -11 "~Etichette"
|
||||
PROMPT -35 -11 "~Etichette"
|
||||
MESSAGE EXIT,F_ETICHETTE
|
||||
END
|
||||
|
||||
BUTTON F_LETTERE 9 2
|
||||
BEGIN
|
||||
PROMPT -45 -11 "~Lettere"
|
||||
MESSAGE EXIT,F_LETTERE
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -44 -11 ""
|
||||
PROMPT -55 -11 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
Loading…
x
Reference in New Issue
Block a user