From 0b19fdebbcdbd6f4071531b90c0b00cf74850ab9 Mon Sep 17 00:00:00 2001 From: cris Date: Fri, 12 Feb 1999 14:05:35 +0000 Subject: [PATCH] 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 --- at/at1100.cpp | 39 +++++++++++++++++++++++---------------- at/at1300.cpp | 25 ++++++++++++++----------- at/at1400.cpp | 7 +++++-- 3 files changed, 42 insertions(+), 29 deletions(-) diff --git a/at/at1100.cpp b/at/at1100.cpp index 6b8a26416..2f6a8d661 100755 --- a/at/at1100.cpp +++ b/at/at1100.cpp @@ -10,6 +10,7 @@ #include "at1.h" #include "at1100a.h" +#include "atlib.h" #define ALIAS_LCP 100 #define ALIAS_TCS 200 @@ -185,20 +186,28 @@ bool TStampaDonBen::filter_func_donben(const TRelation* rel) benem.put(BEN_TIPOBEN, app()._tipoben); int err = benem.read(); 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); key->put(BEN_CODICE, codice); int err = app()._sbenemerenze->read(key); - if (err == NOERR) + if ((err==NOERR) || (err==_iseof) || (err==_isemptyfile)) { int r = app()._sbenemerenze->rows(); TRectype& rec = app()._sbenemerenze->row(r+1,TRUE); - TString16 codsez = sog.get(SOG_CODSEZ); - TString16 codsot = sog.get(SOG_CODSOT); - TString16 gruppoazie = sog.get(SOG_GRUPPOAZIE); + TString16 codsez = recsog.get(SOG_CODSEZ); + TString16 codsot = recsog.get(SOG_CODSOT); + TString16 gruppoazie = recsog.get(SOG_GRUPPOAZIE); rec.put(BEN_TIPOBEN, app()._tipoben); //rec.put(BEN_DATAMAT, row.get(2)); @@ -212,15 +221,9 @@ bool TStampaDonBen::filter_func_donben(const TRelation* rel) rec.put(BEN_GRUPPOAZIE, gruppoazie); int err = app()._sbenemerenze->rewrite(); } - } - return filtrato; -} - -bool TStampaDonBen::preprocess_page(int file, int counter) -{ + } if (_tipostampa == elenco) { - TRectype& recsog = current_cursor()->curr(); TString80 nome = recsog.get(SOG_COGNOME); nome << " "; nome << recsog.get(SOG_NOME); @@ -282,19 +285,23 @@ void TStampaDonBen::header_sezione(const TString16 codsez, const TString16 codso bool TStampaDonBen::set_print(int m) { + TPrinter& p = printer(); + p.read_configuration(); _tipostampa = undefined; KEY tasto; tasto = _msk->run(); switch (tasto) { case F_ELENCO: + { _tipostampa = elenco; _codsez = "**"; _codsot = "**"; - break; + } + break; case F_ETICHETTE: - _tipostampa = etichette; - break; + _tipostampa = (configura_stampante(p, "AT_ETICHETTE", "etichette")) ? etichette : undefined; + break; } if (_tipostampa != undefined) { diff --git a/at/at1300.cpp b/at/at1300.cpp index 5c40783fd..7c0f1584d 100755 --- a/at/at1300.cpp +++ b/at/at1300.cpp @@ -10,15 +10,16 @@ #include "at1.h" #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_LCPRES 101 // localita' postale di residenza #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_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 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) { + TPrinter& p = printer(); + p.read_configuration(); _tipostampa = undefined; KEY tasto; tasto = _msk->run(); @@ -304,11 +307,11 @@ bool TStampaBenemerenze::set_print(int m) _tipostampa=completo; break; case F_ETICHETTE: - _tipostampa=etichette; - break; - case F_LETTERE: - _tipostampa = lettere; - break; + _tipostampa = (configura_stampante(p, "AT_ETICHETTE", "etichette")) ? etichette : undefined; + break; + case F_LETTERE: + _tipostampa = lettere; + break; } if (_tipostampa != undefined) { @@ -475,11 +478,11 @@ bool TStampaBenemerenze::user_create() _rel = new TRelation(LF_BENEM); _rel->add(LF_SOGGETTI, "CODICE==CODICE"); _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(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); //_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT"); _sezioni = new TLocalisamfile(LF_SEZIONI); _msk = new TMask("at1300a"); diff --git a/at/at1400.cpp b/at/at1400.cpp index c4a6f5993..e7a05ab12 100755 --- a/at/at1400.cpp +++ b/at/at1400.cpp @@ -11,6 +11,7 @@ #include "at1.h" #include "at1400a.h" +#include "atlib.h" #define ALIAS_BNZ 600 #define ALIAS_GAZ 300 @@ -250,6 +251,8 @@ void TStampaBenxGAz::header_gruppo(const TString16 gruppo) bool TStampaBenxGAz::set_print(int m) { + TPrinter& p = printer(); + p.read_configuration(); _tipostampa = undefined; KEY tasto; tasto = _msk->run(); @@ -262,8 +265,8 @@ bool TStampaBenxGAz::set_print(int m) _tipostampa=completo; break; case F_ETICHETTE: - _tipostampa=etichette; - break; + _tipostampa = (configura_stampante(p, "AT_ETICHETTE", "etichette")) ? etichette : undefined; + break; } if (_tipostampa != undefined) {