Corretta stampa Sig. o Sig.ra nella stampa delle etichette delle persone fisiche
git-svn-id: svn://10.65.10.50/trunk@253 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									7b2d537322
								
							
						
					
					
						commit
						19a035c659
					
				
							
								
								
									
										15
									
								
								ba/ba0.cpp
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								ba/ba0.cpp
									
									
									
									
									
								
							| @ -86,7 +86,8 @@ class TMenu_application : public TApplication | ||||
| protected: | ||||
|   void load_menu(); | ||||
|   int do_level(); | ||||
|   bool create(); | ||||
|   virtual bool create(); | ||||
|   virtual bool menu(MENU_TAG m); | ||||
| 
 | ||||
| public: | ||||
|   TMenu_application(const char* name) : _name(name) {} | ||||
| @ -179,9 +180,16 @@ int TMenu_application::do_level() | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| bool TMenu_application::create() | ||||
| { | ||||
|   load_menu(); | ||||
|   dispatch_e_menu(BAR_ITEM(1)); | ||||
|   return TRUE; | ||||
| } | ||||
| 
 | ||||
| bool TMenu_application::menu(MENU_TAG) | ||||
| { | ||||
|   int refarray[256]; | ||||
|   int i = 0; | ||||
| 
 | ||||
| @ -213,14 +221,13 @@ bool TMenu_application::create() | ||||
|     else _level = (--i >= 0) ? refarray[i] : 0; | ||||
|   } | ||||
| 
 | ||||
|   stop_run(); | ||||
|   return TRUE; | ||||
|   return FALSE; | ||||
| } | ||||
| 
 | ||||
| int main(int argc, char** argv) | ||||
| { | ||||
|   const char* menu = (argc < 2) ? "prassi.mnu" : argv[1]; | ||||
|   TMenu_application ma(menu); | ||||
|   ma.run(argc, argv, "PRASSI"); | ||||
|   ma.run(argc, argv, "Menu principale"); | ||||
|   return TRUE; | ||||
| } | ||||
|  | ||||
| @ -42,7 +42,7 @@ void BA6100_App::process_link(int id, const char* txt) | ||||
| {                                          | ||||
|   if (id == _ana_link) | ||||
|   { | ||||
|     TString ss = "1|"; ss << txt; | ||||
|     TString80 ss = "1|"; ss << txt; | ||||
|     TMessage fs(cmd2name("ba4","-1"), MSG_LN, ss); | ||||
|     TMailbox m; | ||||
|     m.send(fs);               | ||||
| @ -51,10 +51,9 @@ void BA6100_App::process_link(int id, const char* txt) | ||||
|   }                           | ||||
|   else if (id == _dit_link) | ||||
|   { | ||||
|     TString ss = "1|"; ss << txt << "|" << txt; | ||||
|     TString80 ss = "1|"; ss << txt << "|" << txt; | ||||
|     TMessage fs(cmd2name("ba4","-2"), MSG_LN, ss); | ||||
|     TMailbox m; | ||||
|     m.send(fs);            | ||||
|     fs.send();            | ||||
|     TExternal_app ba4("ba4 -2"); | ||||
|     if (ba4.run()) beep(); | ||||
|   } | ||||
| @ -165,8 +164,9 @@ void BA6100_App::preprocess_etichette() | ||||
| 
 | ||||
|   if (_pr_what == anafis) | ||||
|   {  | ||||
|     _surname = _name.mid(30,50); _surname.trim(); | ||||
|     _name    = _name.mid(0,30);  _name.trim(); | ||||
|     _surname = _name.mid(30); _surname.trim(); | ||||
|     _name    = _name.cut(30); _name.trim(); | ||||
|     _sex     = get_field(LF_ANAGFIS,"SESSO")[0] == 'M' ? "Sig." : "Sig.ra"; | ||||
|   } | ||||
|   switch (_ind_what) | ||||
|   { | ||||
| @ -453,7 +453,7 @@ bool BA6100_App::set_print(int) | ||||
| void BA6100_App::user_create() | ||||
| { | ||||
|   TToken_string rxp(40); | ||||
| { | ||||
| 
 | ||||
|   TProgind p(5, "Preparazione archivi\nPrego attendere", FALSE, TRUE, 30);  | ||||
|    | ||||
|   // setup relation
 | ||||
| @ -544,7 +544,7 @@ void BA6100_App::user_create() | ||||
|   set_wait_threshold(0);                        | ||||
| 
 | ||||
|   p.addstatus(1); | ||||
| } | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| void BA6100_App::user_destroy() | ||||
| @ -561,6 +561,6 @@ void BA6100_App::user_destroy() | ||||
| int ba6100(int argc, char* argv[]) | ||||
| { | ||||
|   BA6100_App app; | ||||
|   app.run(argc, argv, "Stampe Anagrafiche");    | ||||
|   app.run(argc, argv, "Stampa Anagrafiche");    | ||||
|   return 0; | ||||
| } | ||||
|  | ||||
							
								
								
									
										207
									
								
								ba/ba6100.h
									
									
									
									
									
								
							
							
						
						
									
										207
									
								
								ba/ba6100.h
									
									
									
									
									
								
							| @ -1,103 +1,104 @@ | ||||
| #include <printapp.h> | ||||
| #include <iostream.h> | ||||
| #include <mask.h> | ||||
| #include <lffiles.h> | ||||
| #include <stdio.h> | ||||
| #include <urldefid.h> | ||||
| #include <tabutil.h> | ||||
| #include <utility.h>  | ||||
| 
 | ||||
| #include "ba6100a.h" | ||||
| #include "ba6100b.h" | ||||
| 
 | ||||
| #define M_SET_PRINTER MENU_FILE + 1100 | ||||
| #define M_PRINT MENU_FILE + 1101 | ||||
| #define MENU_TYPE MENU_FILE + 1102 | ||||
| 
 | ||||
| enum pt { undefined = 0, elenco = 1, schede = 2, rubriche = 3, etichette = 4 }; | ||||
| enum pw { anafis = 0, anagiu = 1, nditte = 2 }; | ||||
| enum in { residenza = 1, domfisc = 2, corrispondenza = 3 };  | ||||
| 
 | ||||
| bool mask_reset_fields(TMask_field& mf, KEY k); | ||||
| 
 | ||||
| class BA6100_App : public TPrintapp | ||||
| { | ||||
|   friend bool mask_reset_fields(TMask_field& mf, KEY k); | ||||
| 
 | ||||
|   pt _pr_type; | ||||
|   pw _pr_what; | ||||
|   TRelation* _rel_fis; | ||||
|   TRelation* _rel_giu; | ||||
|   TRelation* _rel_dit; | ||||
|   int _cfis1, _cgiu1, _cdit1; | ||||
|   int _cfis2, _cgiu2, _cdit2; | ||||
|   int _sort; | ||||
|   bool _inclditte; | ||||
|   TLocalisamfile* _comuni; | ||||
|   // settings etichette
 | ||||
|   in _ind_what; | ||||
|   int _ind_row, _ind_col, _rows_et, _cols_et; | ||||
|   int _piv_row, _piv_col, _cod_row, _cod_col; | ||||
|   bool _is_piv, _is_cod; | ||||
|   bool* _frpos; | ||||
|   TString _cod, _cofi, _name, _surname, _address,  | ||||
|           _cap, _prov, _com,  _civ, _stato, _phone;                  | ||||
|            | ||||
|   int _ana_link, _dit_link; | ||||
| 
 | ||||
| protected: | ||||
| 
 | ||||
|   virtual void set_page(int file, int cnt); | ||||
|   virtual bool preprocess_page(int file, int counter); | ||||
|   virtual void user_create(); | ||||
|   virtual void user_destroy(); | ||||
|   virtual bool set_print(int n); | ||||
|   virtual void process_link(int id, const char* txt); | ||||
|    | ||||
| public: | ||||
| 
 | ||||
| 
 | ||||
|   int cfis() { return _sort == 1 ? _cfis1 : _cfis2; } | ||||
|   int cgiu() { return _sort == 1 ? _cgiu1 : _cgiu2; } | ||||
|   int cdit() { return _sort == 1 ? _cdit1 : _cdit2; } | ||||
| 
 | ||||
|   TRectype& look_com(const char* cod); | ||||
|   const char* look_tab(const char* tabname, const char* cod,  | ||||
| 		       const char* fld = "S0"); | ||||
| 
 | ||||
|   // bel casino, le schede
 | ||||
|   void set_scheda_anagiu(); | ||||
|   void set_scheda_anafis(); | ||||
|   void set_scheda_ditta(); | ||||
|   void set_scheda_attiv(); | ||||
|   void set_scheda_registro(); | ||||
|   void set_scheda_unloc(); | ||||
|   void set_scheda_socio(); | ||||
|   void preprocess_etichette(); | ||||
|   void set_rubriche(); | ||||
|   void set_elenco(); | ||||
|   void set_schede(); | ||||
|   void set_etichette(); | ||||
|   void set_headers(); | ||||
| 
 | ||||
|   const char* get_field(int ln, const char* fn) | ||||
|     { return current_cursor()->curr(ln).get(fn); } | ||||
| 
 | ||||
|   void init_print(); | ||||
| 
 | ||||
|   BA6100_App() : TPrintapp(), _cod(5), _cofi(30), _name(20), _surname(30),  | ||||
|                  _address(50), _cap(10), _prov(2), _com(50), _civ(5),  | ||||
|                  _stato(40),   _phone(30) | ||||
| 
 | ||||
|     {  | ||||
|       _rel_fis = _rel_giu = _rel_dit = NULL;  | ||||
|       _pr_type = undefined; _pr_what = anafis;  | ||||
|       _inclditte = FALSE; | ||||
|       _ind_what = residenza; | ||||
|       _rows_et = 9; _cols_et = 40; | ||||
|       _is_piv = TRUE; _is_cod = FALSE; | ||||
|       _piv_row = 7; _cod_row = 2; _ind_row = 3; | ||||
|       _piv_col = _ind_col = 3; _cod_col = 6; | ||||
|       _frpos = NULL; | ||||
|     } | ||||
| }; | ||||
| #include <printapp.h> | ||||
| #include <iostream.h> | ||||
| #include <mask.h> | ||||
| #include <lffiles.h> | ||||
| #include <stdio.h> | ||||
| #include <urldefid.h> | ||||
| #include <tabutil.h> | ||||
| #include <utility.h>  | ||||
| 
 | ||||
| #include "ba6100a.h" | ||||
| #include "ba6100b.h" | ||||
| 
 | ||||
| #define M_SET_PRINTER MENU_FILE + 1100 | ||||
| #define M_PRINT MENU_FILE + 1101 | ||||
| #define MENU_TYPE MENU_FILE + 1102 | ||||
| 
 | ||||
| enum pt { undefined = 0, elenco = 1, schede = 2, rubriche = 3, etichette = 4 }; | ||||
| enum pw { anafis = 0, anagiu = 1, nditte = 2 }; | ||||
| enum in { residenza = 1, domfisc = 2, corrispondenza = 3 };  | ||||
| 
 | ||||
| bool mask_reset_fields(TMask_field& mf, KEY k); | ||||
| 
 | ||||
| class BA6100_App : public TPrintapp | ||||
| { | ||||
|   friend bool mask_reset_fields(TMask_field& mf, KEY k); | ||||
| 
 | ||||
|   pt _pr_type; | ||||
|   pw _pr_what; | ||||
|   TRelation* _rel_fis; | ||||
|   TRelation* _rel_giu; | ||||
|   TRelation* _rel_dit; | ||||
|   int _cfis1, _cgiu1, _cdit1; | ||||
|   int _cfis2, _cgiu2, _cdit2; | ||||
|   int _sort; | ||||
|   bool _inclditte; | ||||
|   TLocalisamfile* _comuni; | ||||
|   // settings etichette
 | ||||
|   in _ind_what; | ||||
|   int _ind_row, _ind_col, _rows_et, _cols_et; | ||||
|   int _piv_row, _piv_col, _cod_row, _cod_col; | ||||
|   bool _is_piv, _is_cod; | ||||
|   bool* _frpos; | ||||
|   TString _cod, _cofi, _name, _surname, _address,  | ||||
|   _cap, _prov, _com, _civ, _stato, _phone;                  | ||||
|   TString16 _sex; | ||||
|    | ||||
|   int _ana_link, _dit_link; | ||||
| 
 | ||||
| protected: | ||||
| 
 | ||||
|   virtual void set_page(int file, int cnt); | ||||
|   virtual bool preprocess_page(int file, int counter); | ||||
|   virtual void user_create(); | ||||
|   virtual void user_destroy(); | ||||
|   virtual bool set_print(int n); | ||||
|   virtual void process_link(int id, const char* txt); | ||||
|    | ||||
| public: | ||||
| 
 | ||||
| 
 | ||||
|   int cfis() { return _sort == 1 ? _cfis1 : _cfis2; } | ||||
|   int cgiu() { return _sort == 1 ? _cgiu1 : _cgiu2; } | ||||
|   int cdit() { return _sort == 1 ? _cdit1 : _cdit2; } | ||||
| 
 | ||||
|   TRectype& look_com(const char* cod); | ||||
|   const char* look_tab(const char* tabname, const char* cod,  | ||||
|                        const char* fld = "S0"); | ||||
| 
 | ||||
|   // bel casino, le schede
 | ||||
|   void set_scheda_anagiu(); | ||||
|   void set_scheda_anafis(); | ||||
|   void set_scheda_ditta(); | ||||
|   void set_scheda_attiv(); | ||||
|   void set_scheda_registro(); | ||||
|   void set_scheda_unloc(); | ||||
|   void set_scheda_socio(); | ||||
|   void preprocess_etichette(); | ||||
|   void set_rubriche(); | ||||
|   void set_elenco(); | ||||
|   void set_schede(); | ||||
|   void set_etichette(); | ||||
|   void set_headers(); | ||||
| 
 | ||||
|   const char* get_field(int ln, const char* fn) | ||||
|   { return current_cursor()->curr(ln).get(fn); } | ||||
| 
 | ||||
|   void init_print(); | ||||
| 
 | ||||
|   BA6100_App() : TPrintapp(), _cod(5), _cofi(30), _name(20), _surname(30),  | ||||
|   _address(50), _cap(10), _prov(2), _com(50), _civ(5),  | ||||
|   _stato(40),   _phone(30) | ||||
| 
 | ||||
|   {  | ||||
|     _rel_fis = _rel_giu = _rel_dit = NULL;  | ||||
|     _pr_type = undefined; _pr_what = anafis;  | ||||
|     _inclditte = FALSE; | ||||
|     _ind_what = residenza; | ||||
|     _rows_et = 9; _cols_et = 40; | ||||
|     _is_piv = TRUE; _is_cod = FALSE; | ||||
|     _piv_row = 7; _cod_row = 2; _ind_row = 3; | ||||
|     _piv_col = _ind_col = 3; _cod_col = 6; | ||||
|     _frpos = NULL; | ||||
|   } | ||||
| }; | ||||
|  | ||||
| @ -91,19 +91,19 @@ BEGIN | ||||
| 	PROMPT 4 11 "Salva impostazioni" | ||||
| END | ||||
| 
 | ||||
| BUTTON DLG_OK 9 3 | ||||
| BUTTON DLG_OK 9 2 | ||||
| BEGIN | ||||
| 	PROMPT 30 12 "Conferma" | ||||
| 	PROMPT -13 -1 "Conferma" | ||||
| END | ||||
| 
 | ||||
| BUTTON DLG_CANCEL 9 3 | ||||
| BUTTON DLG_CANCEL 9 2 | ||||
| BEGIN | ||||
| 	PROMPT 44 12 "Annulla" | ||||
| 	PROMPT -23 -1 "Annulla" | ||||
| END | ||||
| 
 | ||||
| BUTTON BUT_BA6B_RESET 5 3 | ||||
| BUTTON BUT_BA6B_RESET 9 2 | ||||
| BEGIN | ||||
| 	PROMPT 4 12 "Reset" | ||||
| 	PROMPT -33 -1 "~Reset" | ||||
| END | ||||
| 
 | ||||
| ENDPAGE | ||||
|  | ||||
| @ -831,11 +831,8 @@ void BA6100_App::set_etichette() | ||||
|   if (_pr_what == anagiu) | ||||
|     set_row(namerow,TString(format("@%dg#t",_ind_col)), &_name); | ||||
|   else | ||||
|   {  | ||||
|     set_row(namerow,TString(format("@%dg%s #t #t",_ind_col, | ||||
|                                    *((const char *)get_field(LF_ANAGFIS,"SESSO")) == 'M' ?  | ||||
|                                    "Sig." : "Sig.ra")), | ||||
|             &_name, &_surname); | ||||
|   {                                     | ||||
|     set_row(namerow,TString(format("@%dg#t #t #t",_ind_col)), &_sex, &_name, &_surname); | ||||
|   } | ||||
| 
 | ||||
|   set_row(_ind_row,TString(format("@%dg#t #t", _ind_col)), &_address, &_civ); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user