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 "sezioni.h"
 | 
			
		||||
#include <comuni.h>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#include "at2.h"
 | 
			
		||||
#include "at2600a.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 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
 | 
			
		||||
class TEti_iscritti_form : public TForm
 | 
			
		||||
@ -38,7 +40,7 @@ class TStampaIscritti : public TPrintapp
 | 
			
		||||
  TEti_iscritti_form*	_form_eti;
 | 
			
		||||
	TExternisamfile*  	_fileiscr;
 | 
			
		||||
  TAssoc_array				_categorie;
 | 
			
		||||
  TParagraph_string 	_cognome_nome;
 | 
			
		||||
  TParagraph_string 	_cognome_nome, _dencom;
 | 
			
		||||
  TDate 							_data_stampa;
 | 
			
		||||
	ts 	      					_tipostampa;
 | 
			
		||||
  int 								_contatore, _totale;
 | 
			
		||||
@ -66,7 +68,7 @@ public:
 | 
			
		||||
  void footer_sezione();
 | 
			
		||||
  void fine_stampa();
 | 
			
		||||
  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(); }
 | 
			
		||||
@ -136,6 +138,27 @@ void TStampaIscritti::set_page(int file, int cnt)
 | 
			
		||||
			set_row(1,"@71g@8,rs", FLD(LF_SOGGETTI,SOG_TESSAVIS));
 | 
			
		||||
		}
 | 
			
		||||
		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)
 | 
			
		||||
{
 | 
			
		||||
	TRectype& recsog = current_cursor()->curr();
 | 
			
		||||
	if (_tipostampa == elenco)
 | 
			
		||||
	{
 | 
			
		||||
	if (_tipostampa == elenco || _tipostampa == completo)
 | 
			
		||||
	{                                       
 | 
			
		||||
		TString80 nome = recsog.get(SOG_COGNOME);
 | 
			
		||||
		nome << " ";
 | 
			
		||||
		nome << ' ';
 | 
			
		||||
		nome << recsog.get(SOG_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
 | 
			
		||||
		const TString16 codsez = recsog.get(SOG_CODSEZ);		
 | 
			
		||||
		const TString16 codsot = recsog.get(SOG_CODSOT);		
 | 
			
		||||
@ -212,7 +245,7 @@ bool TStampaIscritti::preprocess_page(int file, int counter)
 | 
			
		||||
		_fileiscr->put("CAP", cap); 
 | 
			
		||||
		TString80 localita;
 | 
			
		||||
		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
 | 
			
		||||
			localita = current_cursor()->curr(LF_COMUNI).get(COM_DENCOM);
 | 
			
		||||
		_fileiscr->put("COMUNE",localita); 
 | 
			
		||||
@ -260,7 +293,7 @@ print_action TStampaIscritti::postprocess_print(int file, int counter)
 | 
			
		||||
void TStampaIscritti::footer_sezione()
 | 
			
		||||
{
 | 
			
		||||
	// stampa totale soggetti appartenenti alla sezione
 | 
			
		||||
	if (_tipostampa==elenco)
 | 
			
		||||
	if (_tipostampa==elenco || _tipostampa==completo)
 | 
			
		||||
	{
 | 
			
		||||
		reset_footer();
 | 
			
		||||
		TString sep(80);
 | 
			
		||||
@ -275,7 +308,7 @@ void TStampaIscritti::footer_sezione()
 | 
			
		||||
void TStampaIscritti::fine_stampa()
 | 
			
		||||
{
 | 
			
		||||
	// stampa totale soggetti a fine stampa
 | 
			
		||||
  if (_tipostampa==elenco)
 | 
			
		||||
  if (_tipostampa==elenco || _tipostampa==completo)
 | 
			
		||||
	{
 | 
			
		||||
		reset_footer();
 | 
			
		||||
		TString sep(80);
 | 
			
		||||
@ -329,6 +362,15 @@ bool TStampaIscritti::set_print(int m)
 | 
			
		||||
  	_totale = 0;
 | 
			
		||||
  }	
 | 
			
		||||
  break;
 | 
			
		||||
  case F_COMPLETO:
 | 
			
		||||
  {
 | 
			
		||||
  	_tipostampa = completo;
 | 
			
		||||
  	_codsez = "**";
 | 
			
		||||
  	_codsot = "**";
 | 
			
		||||
  	_contatore = 0;
 | 
			
		||||
  	_totale = 0;
 | 
			
		||||
  }	
 | 
			
		||||
  break;
 | 
			
		||||
  case F_ETICHETTE:
 | 
			
		||||
  	_tipostampa = (configura_stampante(p, "AT_ETICHETTE", "etichette")) ? etichette : undefined;
 | 
			
		||||
  break;
 | 
			
		||||
@ -393,7 +435,7 @@ bool TStampaIscritti::set_print(int m)
 | 
			
		||||
void TStampaIscritti::crea_intestazione()
 | 
			
		||||
{
 | 
			
		||||
  reset_header();
 | 
			
		||||
  if (_tipostampa == elenco)
 | 
			
		||||
  if (_tipostampa == elenco || _tipostampa == completo)
 | 
			
		||||
  {
 | 
			
		||||
  	TString sep(80);
 | 
			
		||||
  	sep = "";
 | 
			
		||||
@ -421,19 +463,33 @@ void TStampaIscritti::crea_intestazione()
 | 
			
		||||
  	sep = "";
 | 
			
		||||
  	sep.fill('-');
 | 
			
		||||
  	set_header(3, (const char *) sep);
 | 
			
		||||
  	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-------");
 | 
			
		||||
  	printer().footerlen(3);
 | 
			
		||||
  	if (_tipostampa == elenco)
 | 
			
		||||
  	{
 | 
			
		||||
	  	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-------");
 | 
			
		||||
  		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()
 | 
			
		||||
{
 | 
			
		||||
  _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(LF_COMUNI, "COM==DOM_CODCOM");
 | 
			
		||||
  _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));
 | 
			
		||||
  _msk = new TMask("at2600a");
 | 
			
		||||
  TConfig config(CONFIG_STUDIO);
 | 
			
		||||
@ -445,13 +501,15 @@ bool TStampaIscritti::user_create()
 | 
			
		||||
  iscrname.ext("dbf");
 | 
			
		||||
	TFilename iscrtrr = "iscritti"; 
 | 
			
		||||
	iscrtrr.ext("trr");
 | 
			
		||||
  _fileiscr = new TExternisamfile(iscrname, iscrtrr);
 | 
			
		||||
	if (iscrtrr.exist())
 | 
			
		||||
  	_fileiscr = new TExternisamfile(iscrname, iscrtrr);
 | 
			
		||||
  return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool TStampaIscritti::user_destroy()
 | 
			
		||||
{
 | 
			
		||||
  delete _fileiscr;
 | 
			
		||||
	if (_fileiscr != NULL)
 | 
			
		||||
  	delete _fileiscr;
 | 
			
		||||
  delete _form_eti;
 | 
			
		||||
  delete _msk;
 | 
			
		||||
  delete _rel;
 | 
			
		||||
 | 
			
		||||
@ -31,5 +31,6 @@
 | 
			
		||||
#define F_NOTIZIARIO 306 // soggetti che vogliono il notiziario
 | 
			
		||||
 | 
			
		||||
#define F_ELENCO    401
 | 
			
		||||
#define F_ETICHETTE 402
 | 
			
		||||
#define F_FILE      403
 | 
			
		||||
#define F_COMPLETO  402
 | 
			
		||||
#define F_ETICHETTE 403
 | 
			
		||||
#define F_FILE      404
 | 
			
		||||
 | 
			
		||||
@ -4,25 +4,32 @@ TOOLBAR "" 0 20 0 2
 | 
			
		||||
 | 
			
		||||
BUTTON F_ELENCO 10 2
 | 
			
		||||
BEGIN
 | 
			
		||||
        PROMPT -14 -11 "E~lenco"
 | 
			
		||||
        PROMPT -15 -11 "~Sintetico"
 | 
			
		||||
        MESSAGE EXIT,F_ELENCO
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
BUTTON F_COMPLETO 10 2
 | 
			
		||||
BEGIN
 | 
			
		||||
        PROMPT -25 -11 "~Completo"
 | 
			
		||||
        MESSAGE EXIT,F_COMPLETO
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
BUTTON F_ETICHETTE 10 2
 | 
			
		||||
BEGIN
 | 
			
		||||
        PROMPT -24 -11 "~Etichette"
 | 
			
		||||
        PROMPT -35 -11 "~Etichette"
 | 
			
		||||
        MESSAGE EXIT,F_ETICHETTE
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
BUTTON F_FILE 10 2
 | 
			
		||||
BEGIN
 | 
			
		||||
   PROMPT -34 -11 "~File"
 | 
			
		||||
   PROMPT -45 -11 "~File"
 | 
			
		||||
   MESSAGE EXIT,F_FILE
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
BUTTON DLG_QUIT 10 2
 | 
			
		||||
BEGIN
 | 
			
		||||
        PROMPT -44 -11 ""
 | 
			
		||||
        PROMPT -55 -11 ""
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
ENDPAGE
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user