Patch level : at
Files correlati : Ricompilazione Demo : [ ] Commento : aggiunte etichette in stampa turni per controlli git-svn-id: svn://10.65.10.50/trunk@9350 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									5328307bcb
								
							
						
					
					
						commit
						349d075753
					
				
							
								
								
									
										175
									
								
								at/at5300.cpp
									
									
									
									
									
								
							
							
						
						
									
										175
									
								
								at/at5300.cpp
									
									
									
									
									
								
							| @ -16,6 +16,10 @@ | |||||||
| 
 | 
 | ||||||
| // nomi campi maschera
 | // nomi campi maschera
 | ||||||
| #include "at5300a.h" | #include "at5300a.h" | ||||||
|  | #include "at4100b.h" | ||||||
|  | #include "at4100c.h" | ||||||
|  | 
 | ||||||
|  | #include "atlib.h" | ||||||
|            |            | ||||||
| // nomi dei campi
 | // nomi dei campi
 | ||||||
| #include "soggetti.h" | #include "soggetti.h" | ||||||
| @ -23,7 +27,7 @@ | |||||||
| #include "sezioni.h" | #include "sezioni.h" | ||||||
| #include <comuni.h> | #include <comuni.h> | ||||||
| 
 | 
 | ||||||
| enum ts { undefined = 0, elenco = 1, etichette = 2 }; | enum ts { undefined = 0, elenco = 1, etichette = 2, cartoline = 3 }; | ||||||
| 
 | 
 | ||||||
| // definizione form per etichette
 | // definizione form per etichette
 | ||||||
| class TEti_turnicon_form : public TForm | class TEti_turnicon_form : public TForm | ||||||
| @ -46,15 +50,19 @@ class TTurniControlli : public TPrintapp | |||||||
| 	TLocalisamfile*		_contsan; | 	TLocalisamfile*		_contsan; | ||||||
| 	TRecord_array* 		_scontrolli; | 	TRecord_array* 		_scontrolli; | ||||||
|   TEti_turnicon_form*	_form_eti; |   TEti_turnicon_form*	_form_eti; | ||||||
|  |   TEti_turnicon_form*	_form_car; | ||||||
|   TAssoc_array		  _categorie, _tipicon; |   TAssoc_array		  _categorie, _tipicon; | ||||||
| 	int 							_cur;	 | 	int 							_cur;	 | ||||||
| 	int								_contatore, _totale; | 	int								_contatore, _totale; | ||||||
| 	TDate							_data_stampa; | 	TDate							_data_stampa; | ||||||
| 	TString16					_codsez, _codsot; |  | ||||||
| 	bool							_maifatto; | 	bool							_maifatto; | ||||||
|  | 	bool 							_usasez; | ||||||
| 	TDate							_primadel, _dataini, _datafin; | 	TDate							_primadel, _dataini, _datafin; | ||||||
|   TParagraph_string _cognome_nome, _rigastampa, _dencom; |   TParagraph_string _cognome_nome, _rigastampa, _dencom; | ||||||
| 	ts 	      				_tipostampa; | 	ts 	      				_tipostampa; | ||||||
|  | 	TString16					_codsez, _codsot, _orario, _datacart; | ||||||
|  | 	TString80					_invitoper, _data, _presso1, _presso2, _presso3, _presso4; | ||||||
|  | 	TString80					_note, _intest1, _intest2, _intest3, _intest4; | ||||||
| 	int								_etlarghezza, _etcolonne; | 	int								_etlarghezza, _etcolonne; | ||||||
| 
 | 
 | ||||||
| 	static bool filter_func_turnicon(const TRelation* rel); | 	static bool filter_func_turnicon(const TRelation* rel); | ||||||
| @ -66,11 +74,13 @@ protected: | |||||||
| 	virtual void set_page(int file, int cnt); | 	virtual void set_page(int file, int cnt); | ||||||
| 	virtual bool preprocess_page(int file, int counter); | 	virtual bool preprocess_page(int file, int counter); | ||||||
|   virtual print_action postprocess_print(int file, int counter); |   virtual print_action postprocess_print(int file, int counter); | ||||||
|  |   ts dati_cartoline(); | ||||||
| 	 | 	 | ||||||
| public: | public: | ||||||
|   void filtra_sezioni(); |   void filtra_sezioni(); | ||||||
|   void crea_intestazione(); |   void crea_intestazione(); | ||||||
|   void header_sezione(const TString16 codsez, const TString16 codsot); |   void header_sezione(const TString16 codsez, const TString16 codsot); | ||||||
|  |   void dati_sezione(const TString16 codsez, const TString16 codsot); | ||||||
|   void footer_sezione(); |   void footer_sezione(); | ||||||
|   void fine_stampa(); |   void fine_stampa(); | ||||||
| 	TTurniControlli() : _data_stampa(TODAY), _cognome_nome("",51), _rigastampa("", 71), _dencom("",51)  {} | 	TTurniControlli() : _data_stampa(TODAY), _cognome_nome("",51), _rigastampa("", 71), _dencom("",51)  {} | ||||||
| @ -82,6 +92,27 @@ TCursor* TEti_turnicon_form::cursor() const { return app().current_cursor(); } | |||||||
| 
 | 
 | ||||||
| TRelation* TEti_turnicon_form::relation() const { return cursor()->relation(); } | TRelation* TEti_turnicon_form::relation() const { return cursor()->relation(); } | ||||||
| 
 | 
 | ||||||
|  | ts TTurniControlli::dati_cartoline() | ||||||
|  | { | ||||||
|  | 	TMask msk("at4100b"); | ||||||
|  |  	if (msk.run() == K_ENTER)  | ||||||
|  |  	{  | ||||||
|  |  		_invitoper = msk.get(F_INVITOPER); | ||||||
|  |  		_data			 = msk.get(F_DATA); | ||||||
|  |  		_presso1   = msk.get(F_PRESSO1); | ||||||
|  |  		_presso2   = msk.get(F_PRESSO2); | ||||||
|  |  		_presso3   = msk.get(F_PRESSO3); | ||||||
|  |  		_presso4   = msk.get(F_PRESSO4); | ||||||
|  |  		_datacart  = msk.get(F_DATACART); | ||||||
|  |  		_orario  	 = msk.get(F_ORARIO); | ||||||
|  |  		_note   	 = msk.get(F_NOTE); | ||||||
|  |  		_usasez		 = msk.get_bool(F_USASEZ); | ||||||
|  |  		return cartoline; | ||||||
|  |  	} | ||||||
|  |  	else | ||||||
|  |  		return undefined; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| print_action TTurniControlli::postprocess_print(int file, int counter) | print_action TTurniControlli::postprocess_print(int file, int counter) | ||||||
| {  | {  | ||||||
| 	if (_contatore > 0) | 	if (_contatore > 0) | ||||||
| @ -90,6 +121,29 @@ print_action TTurniControlli::postprocess_print(int file, int counter) | |||||||
| 	return NEXT_PAGE; | 	return NEXT_PAGE; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | void TTurniControlli::dati_sezione(const TString16 codsez, const TString16 codsot) | ||||||
|  | { | ||||||
|  | 	_intest1 = current_cursor()->curr(LF_SEZIONI).get(SEZ_INTESTAZ1); | ||||||
|  | 	_intest2 = current_cursor()->curr(LF_SEZIONI).get(SEZ_INTESTAZ2); | ||||||
|  | 	_intest3 = current_cursor()->curr(LF_SEZIONI).get(SEZ_INTESTAZ3); | ||||||
|  | 	_intest4 = current_cursor()->curr(LF_SEZIONI).get(SEZ_INTESTAZ4); | ||||||
|  | 	if (_usasez) | ||||||
|  | 	{ | ||||||
|  | 		if (_presso1.blank()) | ||||||
|  | 		{ | ||||||
|  | 			_presso1 = current_cursor()->curr(LF_SEZIONI).get(SEZ_CONVSEDE1); | ||||||
|  | 			_presso2 = current_cursor()->curr(LF_SEZIONI).get(SEZ_CONVSEDE2); | ||||||
|  | 			_presso3 = current_cursor()->curr(LF_SEZIONI).get(SEZ_CONVSEDE3); | ||||||
|  | 			_presso4 = current_cursor()->curr(LF_SEZIONI).get(SEZ_CONVSEDE4); | ||||||
|  | 		}			 | ||||||
|  | 		if (_orario.blank()) | ||||||
|  | 			_orario = current_cursor()->curr(LF_SEZIONI).get(SEZ_CONVORA); | ||||||
|  | 		if (_note.blank()) | ||||||
|  | 			_note = current_cursor()->curr(LF_SEZIONI).get(SEZ_CONVNOTE); | ||||||
|  | 	} | ||||||
|  | 	return; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| void TTurniControlli::fine_stampa() | void TTurniControlli::fine_stampa() | ||||||
| { | { | ||||||
| 	// stampa totale soggetti a fine stampa
 | 	// stampa totale soggetti a fine stampa
 | ||||||
| @ -214,6 +268,54 @@ void TTurniControlli::set_page(int file, int cnt) | |||||||
| {  | {  | ||||||
| 	switch (_tipostampa) | 	switch (_tipostampa) | ||||||
| 	{ | 	{ | ||||||
|  | 		case cartoline: | ||||||
|  | 		{ | ||||||
|  | 			TPrint_section& corpo = _form_car->get_body(); | ||||||
|  | 			const TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);		 | ||||||
|  | 			const TString16 codsot = current_cursor()->curr().get(SOG_CODSOT);		 | ||||||
|  | 			if ((_codsez!=codsez)||(_codsot!=codsot)) | ||||||
|  | 			{ | ||||||
|  | 				_codsez = codsez; | ||||||
|  | 				_codsot = codsot; | ||||||
|  | 				dati_sezione(codsez, codsot); | ||||||
|  | 				corpo.reset(); | ||||||
|  | 			  TForm_item& intest1 = corpo.find_field(CAR_INTEST1); | ||||||
|  | 			  intest1.set(_intest1); | ||||||
|  | 			  TForm_item& intest2 = corpo.find_field(CAR_INTEST2); | ||||||
|  | 			  intest2.set(_intest2); | ||||||
|  | 			  TForm_item& intest3 = corpo.find_field(CAR_INTEST3); | ||||||
|  | 			  intest3.set(_intest3); | ||||||
|  | 			  TForm_item& intest4 = corpo.find_field(CAR_INTEST4); | ||||||
|  | 			  intest4.set(_intest4); | ||||||
|  | 			  TForm_item& invito = corpo.find_field(CAR_INVITOPER); | ||||||
|  | 	  		invito.set(_invitoper); | ||||||
|  | 			  TForm_item& data = corpo.find_field(CAR_DATA); | ||||||
|  | 	  		data.set(_data); | ||||||
|  | 			  TForm_item& presso1 = corpo.find_field(CAR_PRESSO1); | ||||||
|  | 	  		presso1.set(_presso1); | ||||||
|  | 			  TForm_item& presso2 = corpo.find_field(CAR_PRESSO2); | ||||||
|  | 	  		presso2.set(_presso2); | ||||||
|  | 			  TForm_item& presso3 = corpo.find_field(CAR_PRESSO3); | ||||||
|  | 	  		presso3.set(_presso3); | ||||||
|  | 			  TForm_item& presso4 = corpo.find_field(CAR_PRESSO4); | ||||||
|  | 	  		presso4.set(_presso4); | ||||||
|  | 			  TForm_item& orario = corpo.find_field(CAR_ORARIO); | ||||||
|  | 	  		orario.set(_orario); | ||||||
|  | 			  TForm_item& datacart = corpo.find_field(CAR_DATACART); | ||||||
|  | 	  		datacart.set(_datacart); | ||||||
|  | 			  TForm_item& note = corpo.find_field(CAR_NOTE); | ||||||
|  | 	  		note.set(_note); | ||||||
|  | 			} | ||||||
|  | 			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 etichette: | 		case etichette: | ||||||
| 		{ | 		{ | ||||||
| 			TPrint_section& corpo = _form_eti->get_body(); | 			TPrint_section& corpo = _form_eti->get_body(); | ||||||
| @ -328,6 +430,8 @@ void TTurniControlli::header_sezione(const TString16 codsez, const TString16 cod | |||||||
| 
 | 
 | ||||||
| bool TTurniControlli::set_print(int) | bool TTurniControlli::set_print(int) | ||||||
| { | { | ||||||
|  |   TPrinter& p = printer(); | ||||||
|  | 	p.read_configuration(); | ||||||
| 	_tipostampa = undefined; | 	_tipostampa = undefined; | ||||||
|   KEY tasto; |   KEY tasto; | ||||||
|   tasto = _msk->run(); |   tasto = _msk->run(); | ||||||
| @ -337,10 +441,13 @@ bool TTurniControlli::set_print(int) | |||||||
|   	_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; | ||||||
|  |   case F_CARTOLINE: | ||||||
|  |   	_tipostampa = (configura_stampante(p, "AT_CARTOLINE", "cartoline")) ? dati_cartoline() : undefined; | ||||||
|  |   break; | ||||||
|   }	 |   }	 | ||||||
| 	if (_tipostampa != undefined) | 	if (_tipostampa != undefined) | ||||||
|   { |   { | ||||||
| @ -417,35 +524,38 @@ bool TTurniControlli::set_print(int) | |||||||
| 
 | 
 | ||||||
| void TTurniControlli::crea_intestazione() | void TTurniControlli::crea_intestazione() | ||||||
| {      | {      | ||||||
| 	char* tc; |  | ||||||
| 	reset_header(); | 	reset_header(); | ||||||
| 	TString sep(132); |   if (_tipostampa == elenco) | ||||||
|  	sep = "STAMPA TURNI PER CONTROLLI SANITARI "; 	 |  | ||||||
|   for (tc = (char*)_tipicon.first_item(); tc != NULL; tc = (char*) _tipicon.succ_item()) |  | ||||||
|   { |   { | ||||||
|     sep << _tipicon.get_hashobj()->key(); | 		TString sep(132); | ||||||
|     sep << " "; | 	 	sep = "STAMPA TURNI PER CONTROLLI SANITARI "; 	 | ||||||
|  	} | 		char* tc; | ||||||
|  	if (_maifatto) | 	  for (tc = (char*)_tipicon.first_item(); tc != NULL; tc = (char*) _tipicon.succ_item()) | ||||||
|  		sep << " - mai effettuato"; | 	  { | ||||||
| 	if (_primadel.ok()) | 	    sep << _tipicon.get_hashobj()->key(); | ||||||
| 		sep << " - effettuato prima del " << _primadel.string(); 		 | 	    sep << " "; | ||||||
| 	sep.center_just(); | 	 	} | ||||||
|  	set_header(2, "@0g%s", (const char*) sep); | 	 	if (_maifatto) | ||||||
|  	TDate data_stampa = _data_stampa.string(); | 	 		sep << " - mai effettuato"; | ||||||
|   set_header(2,"@0g%10s", (const char*) data_stampa); | 		if (_primadel.ok()) | ||||||
|   sep = ""; | 			sep << " - effettuato prima del " << _primadel.string(); 		 | ||||||
|   sep << "Pag. @#"; | 		sep.center_just(); | ||||||
|   set_header(2, "@125g%s", (const char*) sep);   | 	 	set_header(2, "@0g%s", (const char*) sep); | ||||||
|  | 	 	TDate data_stampa = _data_stampa.string(); | ||||||
|  | 	  set_header(2,"@0g%10s", (const char*) data_stampa); | ||||||
|  | 	  sep = ""; | ||||||
|  | 	  sep << "Pag. @#"; | ||||||
|  | 	  set_header(2, "@125g%s", (const char*) sep);   | ||||||
| 	  	 | 	  	 | ||||||
|   sep = ""; | 	  sep = ""; | ||||||
|   sep.fill('-'); | 	  sep.fill('-'); | ||||||
|   set_header(3, (const char *) sep); | 	  set_header(3, (const char *) sep); | ||||||
|  	set_header(4,"@0gCodice@9gCognome e nome@61gNato il@72gTelefono abit.@87gTelefono lav.@102gTelefono altro"); | 	 	set_header(4,"@0gCodice@9gCognome e nome@61gNato il@72gTelefono abit.@87gTelefono lav.@102gTelefono altro"); | ||||||
|  	set_header(5,"@0gTessera@9gIndirizzo"); | 	 	set_header(5,"@0gTessera@9gIndirizzo"); | ||||||
|  	set_header(6,"@0gCat.@61gGruppo Rh@72gData ult. controllo scelto"); | 	 	set_header(6,"@0gCat.@61gGruppo Rh@72gData ult. controllo scelto"); | ||||||
|  	set_header(7,"@0g--------@9g---------------------------------------------------@61g----------@72g------------------------------------------------------"); | 	 	set_header(7,"@0g--------@9g---------------------------------------------------@61g----------@72g------------------------------------------------------"); | ||||||
|  	printer().footerlen(3); | 	 	printer().footerlen(3); | ||||||
|  | 	}	 	 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| bool TTurniControlli::user_create() | bool TTurniControlli::user_create() | ||||||
| @ -469,12 +579,13 @@ bool TTurniControlli::user_create() | |||||||
|   _etlarghezza = config.get_int("EtLarghezza"); |   _etlarghezza = config.get_int("EtLarghezza"); | ||||||
|   _etcolonne = config.get_int("EtColonne"); |   _etcolonne = config.get_int("EtColonne"); | ||||||
| 	_form_eti = new TEti_turnicon_form(etformato); | 	_form_eti = new TEti_turnicon_form(etformato); | ||||||
| 	 | 	_form_car = new TEti_turnicon_form("ATCARTO1"); | ||||||
| 	return TRUE; | 	return TRUE; | ||||||
| }	 | }	 | ||||||
| 
 | 
 | ||||||
| bool TTurniControlli::user_destroy()	 | bool TTurniControlli::user_destroy()	 | ||||||
| { | { | ||||||
|  | 	delete _form_car; | ||||||
| 	delete _form_eti; | 	delete _form_eti; | ||||||
| 	delete _scontrolli; | 	delete _scontrolli; | ||||||
| 	delete _contsan; | 	delete _contsan; | ||||||
|  | |||||||
| @ -50,3 +50,4 @@ | |||||||
| 
 | 
 | ||||||
| #define F_ELENCO    401 | #define F_ELENCO    401 | ||||||
| #define F_ETICHETTE 402 | #define F_ETICHETTE 402 | ||||||
|  | #define F_CARTOLINE 403 | ||||||
|  | |||||||
| @ -4,19 +4,25 @@ TOOLBAR "" 0 20 0 2 | |||||||
| 
 | 
 | ||||||
| BUTTON F_ELENCO 10 2 | BUTTON F_ELENCO 10 2 | ||||||
| BEGIN | BEGIN | ||||||
|         PROMPT -13 -11 "E~lenco" |         PROMPT -14 -11 "E~lenco" | ||||||
|         MESSAGE EXIT,F_ELENCO |         MESSAGE EXIT,F_ELENCO | ||||||
| END | END | ||||||
| 
 | 
 | ||||||
| BUTTON F_ETICHETTE 10 2 | BUTTON F_ETICHETTE 10 2 | ||||||
| BEGIN | BEGIN | ||||||
|         PROMPT -23 -11 "~Etichette" |         PROMPT -24 -11 "~Etichette" | ||||||
|         MESSAGE EXIT,F_ETICHETTE |         MESSAGE EXIT,F_ETICHETTE | ||||||
| END | END | ||||||
| 
 | 
 | ||||||
|  | BUTTON F_CARTOLINE 10 2 | ||||||
|  | BEGIN | ||||||
|  |         PROMPT -34 -11 "~Cartoline" | ||||||
|  |         MESSAGE EXIT,F_CARTOLINE | ||||||
|  | END | ||||||
|  | 
 | ||||||
| BUTTON DLG_QUIT 10 2 | BUTTON DLG_QUIT 10 2 | ||||||
| BEGIN | BEGIN | ||||||
|         PROMPT -33 -11 "" |         PROMPT -44 -11 "" | ||||||
| END | END | ||||||
| 
 | 
 | ||||||
| ENDPAGE | ENDPAGE | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user