Patch level : 1.7 at
Files correlati : at2.exe at2600a.msk Ricompilazione Demo : [ ] Commento : Stampa iscritti/dimessi: aggiunta stampa completa (chiesto da PR) git-svn-id: svn://10.65.10.50/trunk@13306 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
f3e3c12113
commit
5d34b67aba
@ -5,17 +5,19 @@
|
|||||||
|
|
||||||
#include "soggetti.h"
|
#include "soggetti.h"
|
||||||
#include "sezioni.h"
|
#include "sezioni.h"
|
||||||
|
#include <comuni.h>
|
||||||
|
|
||||||
|
|
||||||
#include "at2.h"
|
#include "at2.h"
|
||||||
#include "at2600a.h"
|
#include "at2600a.h"
|
||||||
#include "atlib.h"
|
#include "atlib.h"
|
||||||
#include <comuni.h>
|
|
||||||
|
|
||||||
#define ALIAS_LCP 100 // localita' postali
|
#define ALIAS_LCPDOM 100 // localita' postale di domicilio
|
||||||
|
#define ALIAS_COMDOM 501 // comune di domicilio
|
||||||
#define ALIAS_CTD 700 // categoria donatori
|
#define ALIAS_CTD 700 // categoria donatori
|
||||||
|
|
||||||
#define ISCRITTI 'I'
|
#define ISCRITTI 'I'
|
||||||
enum ts { undefined = 0, elenco = 1, etichette = 2, stampasufile = 3 };
|
enum ts { undefined = 0, elenco = 1, etichette = 2, stampasufile = 3, completo = 4 };
|
||||||
|
|
||||||
// definizione form per etichette
|
// definizione form per etichette
|
||||||
class TEti_iscritti_form : public TForm
|
class TEti_iscritti_form : public TForm
|
||||||
@ -38,7 +40,7 @@ class TStampaIscritti : public TPrintapp
|
|||||||
TEti_iscritti_form* _form_eti;
|
TEti_iscritti_form* _form_eti;
|
||||||
TExternisamfile* _fileiscr;
|
TExternisamfile* _fileiscr;
|
||||||
TAssoc_array _categorie;
|
TAssoc_array _categorie;
|
||||||
TParagraph_string _cognome_nome;
|
TParagraph_string _cognome_nome, _dencom;
|
||||||
TDate _data_stampa;
|
TDate _data_stampa;
|
||||||
ts _tipostampa;
|
ts _tipostampa;
|
||||||
int _contatore, _totale;
|
int _contatore, _totale;
|
||||||
@ -66,7 +68,7 @@ public:
|
|||||||
void footer_sezione();
|
void footer_sezione();
|
||||||
void fine_stampa();
|
void fine_stampa();
|
||||||
TMask& app_mask() { return *_msk; }
|
TMask& app_mask() { return *_msk; }
|
||||||
TStampaIscritti() : _data_stampa(TODAY), _cognome_nome("",25) {}
|
TStampaIscritti() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",30) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
HIDDEN inline TStampaIscritti& app() { return (TStampaIscritti&) main_app(); }
|
HIDDEN inline TStampaIscritti& app() { return (TStampaIscritti&) main_app(); }
|
||||||
@ -136,6 +138,27 @@ void TStampaIscritti::set_page(int file, int cnt)
|
|||||||
set_row(1,"@71g@8,rs", FLD(LF_SOGGETTI,SOG_TESSAVIS));
|
set_row(1,"@71g@8,rs", FLD(LF_SOGGETTI,SOG_TESSAVIS));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case completo:
|
||||||
|
{
|
||||||
|
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########"));
|
||||||
|
set_row(2,"@0g@8,rs", FLD(LF_SOGGETTI,SOG_TESSAVIS));
|
||||||
|
set_row(3,"@0g@8,rs", FLD(LF_SOGGETTI,SOG_CATDON));
|
||||||
|
set_row(1,"@9g#a", &_cognome_nome);
|
||||||
|
set_row(3,"@9g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
|
||||||
|
set_row(1,"@35g@S", FLD(LF_SOGGETTI,SOG_DOM_INDIR));
|
||||||
|
set_row(2,"@35g#a", &_dencom);
|
||||||
|
set_row(1,"@67g@S", FLD(LF_SOGGETTI,SOG_TELABI));
|
||||||
|
set_row(2,"@67g@S", FLD(LF_SOGGETTI,SOG_TELLAV));
|
||||||
|
set_row(3,"@67g@S", FLD(LF_SOGGETTI,SOG_TELALT));
|
||||||
|
set_row(1,"@82g@ld", FLD(LF_SOGGETTI,SOG_DATASTATO));
|
||||||
|
set_row(2,"@86g@S", FLD(LF_SOGGETTI,SOG_STATO));
|
||||||
|
set_row(3,"@82g@S", FLD(LF_SOGGETTI,SOG_IDON1));
|
||||||
|
set_row(3,"@85g@S", FLD(LF_SOGGETTI,SOG_IDON2));
|
||||||
|
set_row(3,"@88g@S", FLD(LF_SOGGETTI,SOG_IDON3));
|
||||||
|
set_row(3,"@91g@S", FLD(LF_SOGGETTI,SOG_IDON4));
|
||||||
|
set_row(4,"");
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,12 +203,22 @@ bool TStampaIscritti::filter_func_iscritti(const TRelation * rel)
|
|||||||
bool TStampaIscritti::preprocess_page(int file, int counter)
|
bool TStampaIscritti::preprocess_page(int file, int counter)
|
||||||
{
|
{
|
||||||
TRectype& recsog = current_cursor()->curr();
|
TRectype& recsog = current_cursor()->curr();
|
||||||
if (_tipostampa == elenco)
|
if (_tipostampa == elenco || _tipostampa == completo)
|
||||||
{
|
{
|
||||||
TString80 nome = recsog.get(SOG_COGNOME);
|
TString80 nome = recsog.get(SOG_COGNOME);
|
||||||
nome << " ";
|
nome << ' ';
|
||||||
nome << recsog.get(SOG_NOME);
|
nome << recsog.get(SOG_NOME);
|
||||||
_cognome_nome = nome;
|
_cognome_nome = nome;
|
||||||
|
TString256 localita = "";
|
||||||
|
localita << recsog.get(SOG_DOM_CAP);
|
||||||
|
localita << " ";
|
||||||
|
if (!recsog.get(SOG_DOM_CODLOC).blank())
|
||||||
|
localita << current_cursor()->curr(-ALIAS_LCPDOM).get("S0");
|
||||||
|
else
|
||||||
|
localita << current_cursor()->curr(LF_COMUNI).get(COM_DENCOM);
|
||||||
|
localita << ' ' << current_cursor()->curr(LF_COMUNI).get(COM_PROVCOM);
|
||||||
|
localita.trim();
|
||||||
|
_dencom = localita;
|
||||||
// salto pagina se cambio sezione
|
// salto pagina se cambio sezione
|
||||||
const TString16 codsez = recsog.get(SOG_CODSEZ);
|
const TString16 codsez = recsog.get(SOG_CODSEZ);
|
||||||
const TString16 codsot = recsog.get(SOG_CODSOT);
|
const TString16 codsot = recsog.get(SOG_CODSOT);
|
||||||
@ -212,7 +245,7 @@ bool TStampaIscritti::preprocess_page(int file, int counter)
|
|||||||
_fileiscr->put("CAP", cap);
|
_fileiscr->put("CAP", cap);
|
||||||
TString80 localita;
|
TString80 localita;
|
||||||
if (recsog.get(SOG_DOM_CODLOC).not_empty())
|
if (recsog.get(SOG_DOM_CODLOC).not_empty())
|
||||||
localita = current_cursor()->curr(-ALIAS_LCP).get("S0");
|
localita = current_cursor()->curr(-ALIAS_LCPDOM).get("S0");
|
||||||
else
|
else
|
||||||
localita = current_cursor()->curr(LF_COMUNI).get(COM_DENCOM);
|
localita = current_cursor()->curr(LF_COMUNI).get(COM_DENCOM);
|
||||||
_fileiscr->put("COMUNE",localita);
|
_fileiscr->put("COMUNE",localita);
|
||||||
@ -260,7 +293,7 @@ print_action TStampaIscritti::postprocess_print(int file, int counter)
|
|||||||
void TStampaIscritti::footer_sezione()
|
void TStampaIscritti::footer_sezione()
|
||||||
{
|
{
|
||||||
// stampa totale soggetti appartenenti alla sezione
|
// stampa totale soggetti appartenenti alla sezione
|
||||||
if (_tipostampa==elenco)
|
if (_tipostampa==elenco || _tipostampa==completo)
|
||||||
{
|
{
|
||||||
reset_footer();
|
reset_footer();
|
||||||
TString sep(80);
|
TString sep(80);
|
||||||
@ -275,7 +308,7 @@ void TStampaIscritti::footer_sezione()
|
|||||||
void TStampaIscritti::fine_stampa()
|
void TStampaIscritti::fine_stampa()
|
||||||
{
|
{
|
||||||
// stampa totale soggetti a fine stampa
|
// stampa totale soggetti a fine stampa
|
||||||
if (_tipostampa==elenco)
|
if (_tipostampa==elenco || _tipostampa==completo)
|
||||||
{
|
{
|
||||||
reset_footer();
|
reset_footer();
|
||||||
TString sep(80);
|
TString sep(80);
|
||||||
@ -329,6 +362,15 @@ bool TStampaIscritti::set_print(int m)
|
|||||||
_totale = 0;
|
_totale = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case F_COMPLETO:
|
||||||
|
{
|
||||||
|
_tipostampa = completo;
|
||||||
|
_codsez = "**";
|
||||||
|
_codsot = "**";
|
||||||
|
_contatore = 0;
|
||||||
|
_totale = 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case F_ETICHETTE:
|
case F_ETICHETTE:
|
||||||
_tipostampa = (configura_stampante(p, "AT_ETICHETTE", "etichette")) ? etichette : undefined;
|
_tipostampa = (configura_stampante(p, "AT_ETICHETTE", "etichette")) ? etichette : undefined;
|
||||||
break;
|
break;
|
||||||
@ -393,7 +435,7 @@ bool TStampaIscritti::set_print(int m)
|
|||||||
void TStampaIscritti::crea_intestazione()
|
void TStampaIscritti::crea_intestazione()
|
||||||
{
|
{
|
||||||
reset_header();
|
reset_header();
|
||||||
if (_tipostampa == elenco)
|
if (_tipostampa == elenco || _tipostampa == completo)
|
||||||
{
|
{
|
||||||
TString sep(80);
|
TString sep(80);
|
||||||
sep = "";
|
sep = "";
|
||||||
@ -421,19 +463,33 @@ void TStampaIscritti::crea_intestazione()
|
|||||||
sep = "";
|
sep = "";
|
||||||
sep.fill('-');
|
sep.fill('-');
|
||||||
set_header(3, (const char *) sep);
|
set_header(3, (const char *) sep);
|
||||||
|
if (_tipostampa == elenco)
|
||||||
|
{
|
||||||
set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gData isc.@60gData dim.@71gTessera");
|
set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gData isc.@60gData dim.@71gTessera");
|
||||||
set_header(5,"@0g--------@9g--@12g-------------------------@38g----------@49g----------@60g----------@71g-------");
|
set_header(5,"@0g--------@9g--@12g-------------------------@38g----------@49g----------@60g----------@71g-------");
|
||||||
printer().footerlen(3);
|
printer().footerlen(3);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_dencom.set_width(30);
|
||||||
|
set_header(4,"@0gCodice@9gCognome e nome@35gIndirizzo@67gTelefono abit.@82gData stato");
|
||||||
|
set_header(5,"@0gTessera@35gCAP/Località/Comune/Prov.@67gTelefono lav.@82gStato");
|
||||||
|
set_header(6,"@0gCat.don.@9gData nascita@67gTelefono altro@82gIdoneitá");
|
||||||
|
set_header(7,"@0g--------@9g-------------------------@35g------------------------------@67g--------------@82g-----------");
|
||||||
|
printer().footerlen(3);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TStampaIscritti::user_create()
|
bool TStampaIscritti::user_create()
|
||||||
{
|
{
|
||||||
_rel = new TRelation(LF_SOGGETTI);
|
_rel = new TRelation(LF_SOGGETTI);
|
||||||
_rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCP);
|
|
||||||
_rel->add("CTD", "CODTAB==CATDON",1,0,ALIAS_CTD);
|
_rel->add("CTD", "CODTAB==CATDON",1,0,ALIAS_CTD);
|
||||||
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
|
|
||||||
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
|
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
|
||||||
|
_rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCPDOM);
|
||||||
|
_rel->add(LF_COMUNI, "COM==DOM_CODCOM",1,0,ALIAS_COMDOM);
|
||||||
|
|
||||||
add_cursor(new TCursor(_rel, "", 3));
|
add_cursor(new TCursor(_rel, "", 3));
|
||||||
_msk = new TMask("at2600a");
|
_msk = new TMask("at2600a");
|
||||||
TConfig config(CONFIG_STUDIO);
|
TConfig config(CONFIG_STUDIO);
|
||||||
@ -445,12 +501,14 @@ bool TStampaIscritti::user_create()
|
|||||||
iscrname.ext("dbf");
|
iscrname.ext("dbf");
|
||||||
TFilename iscrtrr = "iscritti";
|
TFilename iscrtrr = "iscritti";
|
||||||
iscrtrr.ext("trr");
|
iscrtrr.ext("trr");
|
||||||
|
if (iscrtrr.exist())
|
||||||
_fileiscr = new TExternisamfile(iscrname, iscrtrr);
|
_fileiscr = new TExternisamfile(iscrname, iscrtrr);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TStampaIscritti::user_destroy()
|
bool TStampaIscritti::user_destroy()
|
||||||
{
|
{
|
||||||
|
if (_fileiscr != NULL)
|
||||||
delete _fileiscr;
|
delete _fileiscr;
|
||||||
delete _form_eti;
|
delete _form_eti;
|
||||||
delete _msk;
|
delete _msk;
|
||||||
|
@ -31,5 +31,6 @@
|
|||||||
#define F_NOTIZIARIO 306 // soggetti che vogliono il notiziario
|
#define F_NOTIZIARIO 306 // soggetti che vogliono il notiziario
|
||||||
|
|
||||||
#define F_ELENCO 401
|
#define F_ELENCO 401
|
||||||
#define F_ETICHETTE 402
|
#define F_COMPLETO 402
|
||||||
#define F_FILE 403
|
#define F_ETICHETTE 403
|
||||||
|
#define F_FILE 404
|
||||||
|
@ -4,25 +4,32 @@ TOOLBAR "" 0 20 0 2
|
|||||||
|
|
||||||
BUTTON F_ELENCO 10 2
|
BUTTON F_ELENCO 10 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -14 -11 "E~lenco"
|
PROMPT -15 -11 "~Sintetico"
|
||||||
MESSAGE EXIT,F_ELENCO
|
MESSAGE EXIT,F_ELENCO
|
||||||
END
|
END
|
||||||
|
|
||||||
|
BUTTON F_COMPLETO 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -25 -11 "~Completo"
|
||||||
|
MESSAGE EXIT,F_COMPLETO
|
||||||
|
END
|
||||||
|
|
||||||
|
|
||||||
BUTTON F_ETICHETTE 10 2
|
BUTTON F_ETICHETTE 10 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -24 -11 "~Etichette"
|
PROMPT -35 -11 "~Etichette"
|
||||||
MESSAGE EXIT,F_ETICHETTE
|
MESSAGE EXIT,F_ETICHETTE
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON F_FILE 10 2
|
BUTTON F_FILE 10 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -34 -11 "~File"
|
PROMPT -45 -11 "~File"
|
||||||
MESSAGE EXIT,F_FILE
|
MESSAGE EXIT,F_FILE
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_QUIT 10 2
|
BUTTON DLG_QUIT 10 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -44 -11 ""
|
PROMPT -55 -11 ""
|
||||||
END
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user