Patch level :

Files correlati     :
Ricompilazione Demo : [ ]
Commento            : Configura_stampante per etichette


git-svn-id: svn://10.65.10.50/trunk@7783 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
cris 1999-02-12 14:05:35 +00:00
parent c2724d13bd
commit 0b19fdebbc
3 changed files with 42 additions and 29 deletions

View File

@ -10,6 +10,7 @@
#include "at1.h" #include "at1.h"
#include "at1100a.h" #include "at1100a.h"
#include "atlib.h"
#define ALIAS_LCP 100 #define ALIAS_LCP 100
#define ALIAS_TCS 200 #define ALIAS_TCS 200
@ -186,19 +187,27 @@ bool TStampaDonBen::filter_func_donben(const TRelation* rel)
int err = benem.read(); int err = benem.read();
filtrato = (err != NOERR); filtrato = (err != NOERR);
} }
if (filtrato && app()._definitiva) return filtrato;
}
bool TStampaDonBen::preprocess_page(int file, int counter)
{
TRectype& recsog = current_cursor()->curr();
if (app()._definitiva)
{ {
long codice = recsog.get_long(SOG_CODICE);
TRectype* key = new TRectype(LF_BENEM); TRectype* key = new TRectype(LF_BENEM);
key->put(BEN_CODICE, codice); key->put(BEN_CODICE, codice);
int err = app()._sbenemerenze->read(key); int err = app()._sbenemerenze->read(key);
if (err == NOERR) if ((err==NOERR) || (err==_iseof) || (err==_isemptyfile))
{ {
int r = app()._sbenemerenze->rows(); int r = app()._sbenemerenze->rows();
TRectype& rec = app()._sbenemerenze->row(r+1,TRUE); TRectype& rec = app()._sbenemerenze->row(r+1,TRUE);
TString16 codsez = sog.get(SOG_CODSEZ); TString16 codsez = recsog.get(SOG_CODSEZ);
TString16 codsot = sog.get(SOG_CODSOT); TString16 codsot = recsog.get(SOG_CODSOT);
TString16 gruppoazie = sog.get(SOG_GRUPPOAZIE); TString16 gruppoazie = recsog.get(SOG_GRUPPOAZIE);
rec.put(BEN_TIPOBEN, app()._tipoben); rec.put(BEN_TIPOBEN, app()._tipoben);
//rec.put(BEN_DATAMAT, row.get(2)); //rec.put(BEN_DATAMAT, row.get(2));
@ -213,14 +222,8 @@ bool TStampaDonBen::filter_func_donben(const TRelation* rel)
int err = app()._sbenemerenze->rewrite(); int err = app()._sbenemerenze->rewrite();
} }
} }
return filtrato;
}
bool TStampaDonBen::preprocess_page(int file, int counter)
{
if (_tipostampa == elenco) if (_tipostampa == elenco)
{ {
TRectype& recsog = current_cursor()->curr();
TString80 nome = recsog.get(SOG_COGNOME); TString80 nome = recsog.get(SOG_COGNOME);
nome << " "; nome << " ";
nome << recsog.get(SOG_NOME); nome << recsog.get(SOG_NOME);
@ -282,18 +285,22 @@ void TStampaDonBen::header_sezione(const TString16 codsez, const TString16 codso
bool TStampaDonBen::set_print(int m) bool TStampaDonBen::set_print(int m)
{ {
TPrinter& p = printer();
p.read_configuration();
_tipostampa = undefined; _tipostampa = undefined;
KEY tasto; KEY tasto;
tasto = _msk->run(); tasto = _msk->run();
switch (tasto) switch (tasto)
{ {
case F_ELENCO: case F_ELENCO:
{
_tipostampa = elenco; _tipostampa = elenco;
_codsez = "**"; _codsez = "**";
_codsot = "**"; _codsot = "**";
}
break; break;
case F_ETICHETTE: case F_ETICHETTE:
_tipostampa = etichette; _tipostampa = (configura_stampante(p, "AT_ETICHETTE", "etichette")) ? etichette : undefined;
break; break;
} }
if (_tipostampa != undefined) if (_tipostampa != undefined)

View File

@ -10,15 +10,16 @@
#include "at1.h" #include "at1.h"
#include "at1300a.h" #include "at1300a.h"
#include "atlib.h"
#define CAMPO_BENEM 10 // campo benemerenza in form per lettera #define CAMPO_BENEM 10 // campo benemerenza in form per lettera
#define ALIAS_BNZ 600 #define ALIAS_BNZ 600
#define ALIAS_LCPRES 101 // localita' postale di residenza //#define ALIAS_LCPRES 101 // localita' postale di residenza
#define ALIAS_LCPDOM 100 // localita' postale di domicilio #define ALIAS_LCPDOM 100 // localita' postale di domicilio
#define ALIAS_COMRES 502 // comune di residenza //#define ALIAS_COMRES 502 // comune di residenza
#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 #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 #define LET_BENEM 10 // campo benemerenza in form per lettera
@ -292,6 +293,8 @@ void TStampaBenemerenze::header_ben(const TString16 tipoben, const TString16 cod
bool TStampaBenemerenze::set_print(int m) bool TStampaBenemerenze::set_print(int m)
{ {
TPrinter& p = printer();
p.read_configuration();
_tipostampa = undefined; _tipostampa = undefined;
KEY tasto; KEY tasto;
tasto = _msk->run(); tasto = _msk->run();
@ -304,7 +307,7 @@ bool TStampaBenemerenze::set_print(int m)
_tipostampa=completo; _tipostampa=completo;
break; break;
case F_ETICHETTE: case F_ETICHETTE:
_tipostampa=etichette; _tipostampa = (configura_stampante(p, "AT_ETICHETTE", "etichette")) ? etichette : undefined;
break; break;
case F_LETTERE: case F_LETTERE:
_tipostampa = lettere; _tipostampa = lettere;
@ -475,11 +478,11 @@ bool TStampaBenemerenze::user_create()
_rel = new TRelation(LF_BENEM); _rel = new TRelation(LF_BENEM);
_rel->add(LF_SOGGETTI, "CODICE==CODICE"); _rel->add(LF_SOGGETTI, "CODICE==CODICE");
_rel->add("BNZ", "CODTAB==TIPOBEN",1,0,ALIAS_BNZ); _rel->add("BNZ", "CODTAB==TIPOBEN",1,0,ALIAS_BNZ);
_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("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==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); _sezioni = new TLocalisamfile(LF_SEZIONI);
_msk = new TMask("at1300a"); _msk = new TMask("at1300a");

View File

@ -11,6 +11,7 @@
#include "at1.h" #include "at1.h"
#include "at1400a.h" #include "at1400a.h"
#include "atlib.h"
#define ALIAS_BNZ 600 #define ALIAS_BNZ 600
#define ALIAS_GAZ 300 #define ALIAS_GAZ 300
@ -250,6 +251,8 @@ void TStampaBenxGAz::header_gruppo(const TString16 gruppo)
bool TStampaBenxGAz::set_print(int m) bool TStampaBenxGAz::set_print(int m)
{ {
TPrinter& p = printer();
p.read_configuration();
_tipostampa = undefined; _tipostampa = undefined;
KEY tasto; KEY tasto;
tasto = _msk->run(); tasto = _msk->run();
@ -262,7 +265,7 @@ bool TStampaBenxGAz::set_print(int m)
_tipostampa=completo; _tipostampa=completo;
break; break;
case F_ETICHETTE: case F_ETICHETTE:
_tipostampa=etichette; _tipostampa = (configura_stampante(p, "AT_ETICHETTE", "etichette")) ? etichette : undefined;
break; break;
} }
if (_tipostampa != undefined) if (_tipostampa != undefined)