Aggiornata gestione anagrafiche per PA e SEPA
git-svn-id: svn://10.65.10.50/branches/R_10_00@23152 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									51299d6178
								
							
						
					
					
						commit
						8da6ac7473
					
				
							
								
								
									
										35
									
								
								fe/felib.cpp
									
									
									
									
									
								
							
							
						
						
									
										35
									
								
								fe/felib.cpp
									
									
									
									
									
								
							| @ -16,6 +16,7 @@ | ||||
| #include <clifo.h> | ||||
| #include <comuni.h> | ||||
| #include <doc.h> | ||||
| #include <effetti.h> | ||||
| #include <mov.h> | ||||
| #include <nditte.h> | ||||
| #include <occas.h> | ||||
| @ -241,6 +242,17 @@ void TAnagrafica::build_ind_res(const TRectype& rec, const char* ind, const char | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| const TString& TAnagrafica::ragione_sociale() const  | ||||
| {  | ||||
|   if (fisica()) | ||||
|   { | ||||
|     TString& rs = get_tmp_string(); | ||||
|     rs = _ragsoc; | ||||
|     return rs.strip_double_spaces(); | ||||
|   } | ||||
|   return _ragsoc;  | ||||
| } | ||||
| 
 | ||||
| const TString& TAnagrafica::cognome() const  | ||||
| {  | ||||
|   TString& c = get_tmp_string(); | ||||
| @ -271,14 +283,12 @@ const TString& TAnagrafica::stato_estero_UNICO() const | ||||
|   return get_tmp_string() = u; | ||||
| } | ||||
| 
 | ||||
| const TString& TAnagrafica::stato_ISO_3166() const  | ||||
| const TString& TAnagrafica::stato_partita_IVA() const  | ||||
| {  | ||||
|   if (_stato_paiv.full()) | ||||
|     return _stato_paiv; | ||||
|   TString& str = get_tmp_string(); | ||||
|   if (_stato_estero <= 0) | ||||
|     str = "IT"; | ||||
|   else | ||||
|   { | ||||
|   } | ||||
|   if (italiano()) str = "IT";  | ||||
|   return str; | ||||
| } | ||||
| 
 | ||||
| @ -377,6 +387,7 @@ bool TAnagrafica::init(const TRectype& rec) | ||||
|     _ragsoc = rec.get(ANA_RAGSOC); | ||||
|     _cofi = rec.get(ANA_COFI); | ||||
|     _paiv = rec.get(ANA_PAIV);  | ||||
|     _stato_paiv = rec.get(ANA_STATOPAIV);  | ||||
|      | ||||
|     // Comune di residenza fiscale o domicilio
 | ||||
|     _stato_estero = rec.get_int(ANA_STATORES); | ||||
| @ -502,18 +513,20 @@ bool TAnagrafica::init(const TRectype& rec) | ||||
|     if (rec.get(CLI_COFI).full()) | ||||
|       _cofi = rec.get(CLI_COFI); | ||||
|     if (rec.get(CLI_PAIV).full()) | ||||
|     { | ||||
|       _paiv = rec.get(CLI_PAIV); | ||||
|       _stato_paiv = rec.get(CLI_STATOPAIV); | ||||
|     } | ||||
| 
 | ||||
|     if (_allegato != 5 && _allegato != 9) | ||||
|     { | ||||
|       const TString4 stato_paiv = rec.get(CLI_STATOPAIV); | ||||
|       if (stato_paiv.blank() || stato_paiv == "IT") | ||||
|       if (_stato_paiv.blank() || _stato_paiv == "IT") | ||||
|       { | ||||
|         // Ci sono anagrafiche con codice fiscale numerico e partita IVA vuota!
 | ||||
|         // I codici fiscali che cominciano per 8 e 9 sono le associazioni riconosciute e non, rispettivamente.
 | ||||
|         if (_paiv.blank() && pi_check(stato_paiv, _cofi) && _cofi[0] < '8') | ||||
|         if (_paiv.blank() && pi_check(_stato_paiv, _cofi) && _cofi[0] < '8') | ||||
|           _paiv = _cofi;  | ||||
|         if (_paiv.len() == 11 && pi_check(stato_paiv, _paiv) && (_paiv[0] == '8' || _paiv[0] == '9')) | ||||
|         if (_paiv.len() == 11 && pi_check(_stato_paiv, _paiv) && (_paiv[0] == '8' || _paiv[0] == '9')) | ||||
|         { | ||||
|           if (_cofi.blank()) | ||||
|             _cofi = _paiv; | ||||
| @ -559,6 +572,8 @@ bool TAnagrafica::init(const TRectype& rec) | ||||
|     return init(rec.get_char(MOV_TIPO), rec.get_long(MOV_CODCF), rec.get(MOV_OCFPI)); | ||||
|   case LF_ALLEG: | ||||
|     return init(rec.get_char(ALL_TIPOCF), rec.get_long(ALL_CODCF), rec.get(ALL_OCFPI)); | ||||
|   case LF_EFFETTI: | ||||
|     return init(rec.get_char(EFF_TIPOCF), rec.get_long(EFF_CODCF), EMPTY_STRING); | ||||
|   default: | ||||
|     CHECKD(false, "Record non valido per TAnagrafica ", rec.num()); | ||||
|     break; | ||||
|  | ||||
| @ -16,6 +16,7 @@ | ||||
| class TAnagrafica : public TObject | ||||
| { | ||||
|   char _tipo; // F o G
 | ||||
|   TString4 _stato_paiv; | ||||
|   TString16 _cofi, _paiv; | ||||
|   TString80 _ragsoc; | ||||
|   TString4 _com_nasc, _com_res; | ||||
| @ -38,8 +39,9 @@ public: | ||||
| 
 | ||||
|   const TString& codice_fiscale() const { return _cofi; } | ||||
|   const TString& partita_IVA() const { return _paiv; } | ||||
|   const TString& stato_partita_IVA() const; | ||||
| 
 | ||||
|   const TString& ragione_sociale() const { return _ragsoc; } | ||||
|   const TString& ragione_sociale() const; | ||||
|   const TString& cognome() const; | ||||
|   const TString& nome() const; | ||||
|   char sesso() const { CHECK(fisica(), "Solo sesso fisico!"); return (_cofi[9] >= '4') ? 'F' : 'M'; } | ||||
| @ -60,7 +62,6 @@ public: | ||||
|   const TString& via_residenza() const { return _via_res; } | ||||
|   const TString& civico_residenza() const { return _civ_res; } | ||||
|   const TString& CAP_residenza() const { return _cap_res; } | ||||
|   const TString& stato_ISO_3166() const; // Alpha-2 code
 | ||||
|    | ||||
|   bool init(const TRectype& rec); | ||||
|   bool init(int num, const TString& codice); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user