Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : Statistiche: stampa riepilogo finale a fine stampa git-svn-id: svn://10.65.10.50/trunk@7713 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									89ac79a689
								
							
						
					
					
						commit
						ac76ae8ea6
					
				
							
								
								
									
										209
									
								
								at/at3100.cpp
									
									
									
									
									
								
							
							
						
						
									
										209
									
								
								at/at3100.cpp
									
									
									
									
									
								
							| @ -117,7 +117,7 @@ HIDDEN inline TStatSogxEta& app() { return (TStatSogxEta&) main_app(); } | ||||
| 
 | ||||
| int TStatSogxEta::data2row(const int eta) | ||||
| {       | ||||
| 	int indice = 0;         | ||||
| 	int indice = -1;         | ||||
| 	for (int i=0; i<_etaini.items(); i++) | ||||
| 	{  | ||||
| 		real valore; | ||||
| @ -330,30 +330,35 @@ void TStatSogxEta::stampa_sezione(TString16 codsez, TString16 codsot) | ||||
| {  | ||||
| 	TPrintrow row; | ||||
| 	TString256 rigastampa; | ||||
| 	rigastampa = "Sezione: "; | ||||
| 	rigastampa << codsez; | ||||
| 	if (codsot.not_empty()) | ||||
| 	if (codsez == "ZZ" && codsot == "ZZ") | ||||
| 		rigastampa = "RIEPILOGO TOTALE PER TUTTE LE SEZIONI STAMPATE"; | ||||
| 	else | ||||
| 	{ | ||||
| 		rigastampa << "/"; | ||||
| 		rigastampa << codsot; | ||||
| 	}		 | ||||
| 	rigastampa << " "; | ||||
| 	TLocalisamfile sezioni(LF_SEZIONI); | ||||
| 	sezioni.setkey(1); | ||||
| 	sezioni.zero(); | ||||
| 	sezioni.put(SEZ_CODSEZ,codsez); | ||||
| 	sezioni.put(SEZ_CODSOT,codsot);	 | ||||
| 	if (sezioni.read() == NOERR) | ||||
| 	{ | ||||
| 		TString80 den = sezioni.get(SEZ_DENSEZ); | ||||
| 		rigastampa << den; | ||||
| 		den = sezioni.get(SEZ_DENSOT); | ||||
| 		if (den.not_empty()) | ||||
| 		rigastampa = "Sezione: "; | ||||
| 		rigastampa << codsez; | ||||
| 		if (codsot.not_empty()) | ||||
| 		{ | ||||
| 			rigastampa << "/"; | ||||
| 			rigastampa << codsot; | ||||
| 		}		 | ||||
| 		rigastampa << " "; | ||||
| 		TLocalisamfile sezioni(LF_SEZIONI); | ||||
| 		sezioni.setkey(1); | ||||
| 		sezioni.zero(); | ||||
| 		sezioni.put(SEZ_CODSEZ,codsez); | ||||
| 		sezioni.put(SEZ_CODSOT,codsot);	 | ||||
| 		if (sezioni.read() == NOERR) | ||||
| 		{ | ||||
| 			TString80 den = sezioni.get(SEZ_DENSEZ); | ||||
| 			rigastampa << den; | ||||
| 			den = sezioni.get(SEZ_DENSOT); | ||||
| 			if (den.not_empty()) | ||||
| 			{ | ||||
| 				rigastampa << "/"; | ||||
| 				rigastampa << den; | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| 	}	 | ||||
| 	rigastampa.center_just(120); | ||||
| 	row.put(rigastampa); | ||||
|   printer().setheaderline(1, row); | ||||
| @ -477,75 +482,42 @@ bool TStatSogxEta::riepilogo() | ||||
| 		stat.setkey(1);			 | ||||
| 		_cur = new TCursor(_rel, "", 1);   | ||||
| 		TString256 filtro = ""; | ||||
| 
 | ||||
| 		// filtro per categoria
 | ||||
| 		/*		
 | ||||
| 		if (_catdon.not_empty()) | ||||
| 		{ | ||||
|   		if (filtro.empty()) | ||||
|   			filtro = format("(90->CATDON == \"%s\")",(const char*)_catdon); | ||||
| 			else | ||||
| 			{ | ||||
| 				filtro << " && "; | ||||
| 				filtro << format("(90->CATDON == \"%s\")",(const char*)_catdon); | ||||
| 			}	   | ||||
| 			if (_data.ok()) | ||||
| 			{ | ||||
| 				TTable ctd("CTD");  | ||||
| 				ctd.put("CODTAB",_catdon); | ||||
| 				if (ctd.read() == NOERR) | ||||
| 				{ | ||||
| 					bool dimissione = ctd.get_bool("B0"); | ||||
| 					if (dimissione)  | ||||
| 						filtro  << " && (ANSI(90->DATADIM)<=" << _data.string(ANSI) << ")"; | ||||
| 					else | ||||
| 						filtro  << " && (ANSI(90->DATAISC)<=" << _data.string(ANSI) << ")"; | ||||
| 				} | ||||
| 			}									 | ||||
| 		}						 | ||||
| 		*/ | ||||
| 		// filtro per sezione/sottogruppo
 | ||||
| 		if (_sezini.not_empty()) | ||||
| 		{ | ||||
|   		if (filtro.empty()) | ||||
|   			filtro = format("(90->CODSEZ >= \"%s\")",(const char*)_sezini); | ||||
| 			else | ||||
| 			{ | ||||
| 				filtro << " && "; | ||||
| 				filtro << format("(90->CODSEZ >= \"%s\")",(const char*)_sezini); | ||||
| 			}				 | ||||
| 			if (_sotini.not_empty()) | ||||
| 			{ | ||||
| 	  		if (filtro.empty()) | ||||
| 	  			filtro = format("(90->CODSOT >= \"%s\")",(const char*)_sotini); | ||||
| 				else | ||||
| 				{ | ||||
| 					filtro  << " && "; | ||||
| 					filtro << format("(90->CODSOT >= \"%s\")",(const char*)_sotini); | ||||
| 				}				 | ||||
| 			} | ||||
| 	 	if (_sezini.not_empty()) | ||||
| 	 	{ | ||||
| 	 		if (_sotini.not_empty()) | ||||
| 	 		{                     | ||||
| 	 			filtro << "("; | ||||
| 	 			filtro << format("(90->CODSEZ > \"%s\")",(const char*)_sezini); | ||||
| 	 			filtro << " || "; | ||||
| 	 			filtro << "(" << format("(90->CODSEZ == \"%s\")",(const char*)_sezini); | ||||
| 	 			filtro << " && "; | ||||
| 	 			filtro << format("(90->CODSOT >= \"%s\")",(const char*)_sotini); | ||||
| 	 			filtro << ")"; | ||||
| 	 			filtro << ")"; | ||||
| 	 		} | ||||
| 	 		else | ||||
| 		 			filtro << format("(90->CODSEZ >= \"%s\")",(const char*)_sezini); | ||||
| 	 	} | ||||
| 	 	if (_sezfin.not_empty()) | ||||
| 	 	{ | ||||
|  			if (filtro.not_empty()) | ||||
|  				filtro << " && ";  | ||||
| 	 	 | ||||
| 	 		if (_sotfin.not_empty()) | ||||
| 	 		{           | ||||
| 	 			filtro << "("; | ||||
| 	 			filtro << format("(90->CODSEZ < \"%s\")",(const char*)_sezfin); | ||||
| 	 			filtro << " || "; | ||||
| 	 			filtro << "(" << format("(90->CODSEZ == \"%s\")",(const char*)_sezfin); | ||||
| 	 			filtro << " && "; | ||||
| 	 			filtro << format("(90->CODSOT <= \"%s\")",(const char*)_sotfin); | ||||
| 	 			filtro << ")"; | ||||
| 	 			filtro << ")"; | ||||
| 	 		} | ||||
| 	 		else | ||||
| 	 			filtro << format("(90->CODSEZ <= \"%s\")",(const char*)_sezfin); | ||||
| 		} | ||||
| 		if (_sezfin.not_empty()) | ||||
| 		{ | ||||
|   		if (filtro.empty()) | ||||
|   			filtro = format("(90->CODSEZ <= \"%s\")",(const char*)_sezfin); | ||||
| 			else | ||||
| 			{ | ||||
| 				filtro << " && "; | ||||
| 				filtro << format("(90->CODSEZ <= \"%s\")",(const char*)_sezfin); | ||||
| 			}				 | ||||
| 			if (_sotfin.not_empty()) | ||||
| 			{ | ||||
| 	  		if (filtro.empty()) | ||||
| 	  			filtro = format("(90->CODSOT <= \"%s\")",(const char*)_sotfin); | ||||
| 				else | ||||
| 				{ | ||||
| 					filtro  << " && "; | ||||
| 					filtro << format("(90->CODSOT <= \"%s\")",(const char*)_sotfin); | ||||
| 				}				 | ||||
| 			} | ||||
| 		} | ||||
| 		 | ||||
| 	  _cur->setfilter((const char*) filtro, TRUE); | ||||
| 		TString16 codsez, codsot, catdon, catcoll; | ||||
| 		long numero;   | ||||
| @ -604,28 +576,53 @@ bool TStatSogxEta::riepilogo() | ||||
| 				sesso  = recsog.get(SOG_SESSO); | ||||
| 				if (sesso.empty()) | ||||
| 					sesso = "9"; | ||||
| 				stat.zero(); | ||||
| 				stat.put(ATSS_CODSEZ, codsez);  	  | ||||
| 				stat.put(ATSS_CODSOT, codsot);  	  | ||||
| 				stat.put(ATSS_SESSO, 	sesso);  	  | ||||
| 				stat.put(ATSS_FASCIA, fascia);  	  | ||||
| 				if (stat.read() == NOERR) | ||||
| 				{ | ||||
| 					numero = stat.get_long(ATSS_NUMERO); | ||||
| 					numero++; | ||||
| 					stat.put(ATSS_NUMERO, numero); | ||||
| 					stat.rewrite();			 | ||||
| 				}			 | ||||
| 				else | ||||
| 				{ | ||||
| 			  if (fascia != -1) | ||||
| 			  { | ||||
| 					stat.zero(); | ||||
| 					stat.put(ATSS_CODSEZ, codsez);  	  | ||||
| 					stat.put(ATSS_CODSOT, codsot);  	  | ||||
| 					stat.put(ATSS_SESSO, sesso);  	  | ||||
| 					stat.put(ATSS_SESSO, 	sesso);  	  | ||||
| 					stat.put(ATSS_FASCIA, fascia);  	  | ||||
| 					numero = 1; | ||||
| 					stat.put(ATSS_NUMERO, numero); | ||||
| 					stat.write(); | ||||
| 				} | ||||
| 					if (stat.read() == NOERR) | ||||
| 					{ | ||||
| 						numero = stat.get_long(ATSS_NUMERO); | ||||
| 						numero++; | ||||
| 						stat.put(ATSS_NUMERO, numero); | ||||
| 						stat.rewrite();			 | ||||
| 					}			 | ||||
| 					else | ||||
| 					{ | ||||
| 						stat.put(ATSS_CODSEZ, codsez);  	  | ||||
| 						stat.put(ATSS_CODSOT, codsot);  	  | ||||
| 						stat.put(ATSS_SESSO, sesso);  	  | ||||
| 						stat.put(ATSS_FASCIA, fascia);  	  | ||||
| 						numero = 1; | ||||
| 						stat.put(ATSS_NUMERO, numero); | ||||
| 						stat.write(); | ||||
| 					} | ||||
| 					stat.zero(); | ||||
| 					stat.put(ATSS_CODSEZ, "ZZ");  	  | ||||
| 					stat.put(ATSS_CODSOT, "ZZ");  	  | ||||
| 					stat.put(ATSS_SESSO, 	sesso);  	  | ||||
| 					stat.put(ATSS_FASCIA, fascia);  	  | ||||
| 					if (stat.read() == NOERR) | ||||
| 					{ | ||||
| 						numero = stat.get_long(ATSS_NUMERO); | ||||
| 						numero++; | ||||
| 						stat.put(ATSS_NUMERO, numero); | ||||
| 						stat.rewrite();			 | ||||
| 					}			 | ||||
| 					else | ||||
| 					{ | ||||
| 						stat.put(ATSS_CODSEZ, "ZZ");  	  | ||||
| 						stat.put(ATSS_CODSOT, "ZZ");  	  | ||||
| 						stat.put(ATSS_SESSO, sesso);  	  | ||||
| 						stat.put(ATSS_FASCIA, fascia);  	  | ||||
| 						numero = 1; | ||||
| 						stat.put(ATSS_NUMERO, numero); | ||||
| 						stat.write(); | ||||
| 					} | ||||
| 				}					 | ||||
| 			}				 | ||||
| 		}	 | ||||
| 		return (stat.eod() > 0); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user