cg1301.cpp Sostituito data < "01-01-93" con data.year() < 1993
cg4400.cpp    Sostituite tutte le stringhe con date separate da / con
              costruttore date.
git-svn-id: svn://10.65.10.50/trunk@1591 c028cbd2-c16b-5b4b-a496-9718f37d4682
			
			
This commit is contained in:
		
							parent
							
								
									0303a5c42a
								
							
						
					
					
						commit
						f393c1a3ba
					
				| @ -59,8 +59,9 @@ void TAgg_opintra::look_mov() | ||||
|     const TString16 reg(mov.get(MOV_REG)); | ||||
|     if (reg.empty()) continue; | ||||
|      | ||||
|     const TDate datareg = mov.get_date(MOV_DATAREG); | ||||
|     if (datareg < "01-01-93") continue; | ||||
|     const TDate& datareg = mov.get_date(MOV_DATAREG); | ||||
|     //    if (datareg < "01-01-93") continue;
 | ||||
|     if (datareg.year() << 1993) continue;   // Meglio cosi'
 | ||||
|      | ||||
|     const TString16 codcaus(mov.get(MOV_CODCAUS));  | ||||
|     if (codcaus.not_empty()) | ||||
|  | ||||
| @ -1126,10 +1126,11 @@ bool CG4400_application::cerca_libro_gio(TString& datas, bool* good) | ||||
|     int tiporeg = _tabreg->get_int("I0"); | ||||
|     if (tiporeg == 5) //libro giornale
 | ||||
|     {     | ||||
|       TDate data = _tabreg->get_date("D3"); | ||||
|       const TDate& data = _tabreg->get_date("D3"); | ||||
|       if (data > _data_a) | ||||
|       { | ||||
|         datas = format("%02/%02d/%4d", data.day(), data.month(), data.year()); | ||||
| //        datas = format("%02/%02d/%4d", data.day(), data.month(), data.year());
 | ||||
|         datas = data;          // Meglio cosi'
 | ||||
|         *good = FALSE; | ||||
|         return FALSE; | ||||
|       } | ||||
| @ -1706,9 +1707,10 @@ bool CG4400_application::compila_reg(const TMask& m) | ||||
|           if (_u_data.ok()) | ||||
|             if (_data_a < _u_data) | ||||
|             { | ||||
|               TString16 datas = format("%02d/%02d/%4d", _u_data.day(), _u_data.month(), _u_data.year()); | ||||
|               warning_box ("Ditta %ld: la data specificata non deve essere inferiore al %s (ultima data di stampa specificata sul registro)", _ditta, (const char*)datas);     | ||||
|               return FALSE; | ||||
| //              TString16 datas = format("%02d/%02d/%4d", _u_data.day(), _u_data.month(), _u_data.year());
 | ||||
| //              warning_box ("Ditta %ld: la data specificata non deve essere inferiore al %s (ultima data di stampa specificata sul registro)", _ditta, (const char*)datas);     
 | ||||
| //              return FALSE;
 | ||||
|               return warning_box ("Ditta %ld: la data specificata non deve essere inferiore al %s (ultima data di stampa specificata sul registro)", _ditta, (const char*)_u_data.string());     | ||||
|             } | ||||
|           if (_tipo_stampa == 4) //stampa con riferimenti al libro giornale
 | ||||
|           { | ||||
| @ -1814,7 +1816,8 @@ bool CG4400_application::preprocess_page(int file, int counter) | ||||
|         if (!_st_liq[m]) | ||||
|           if (stampo_liquidazione(m)) | ||||
|           { | ||||
|             _datareg = format("01/%02d/%4d", m, _annoes); //serve per la preprocess_header (intestazione per la stampa liquidazione)
 | ||||
| //            _datareg = format("01/%02d/%4d", m, _annoes); //serve per la preprocess_header (intestazione per la stampa liquidazione)
 | ||||
|             _datareg = TDate(1, m, _annoes); // Meglio cosi'
 | ||||
|             TFilename t; | ||||
|             t.temp("reg");     | ||||
|             if (_scelta == B0_settato || _scelta == prosegui_stampa) | ||||
| @ -2093,10 +2096,13 @@ void CG4400_application::scrivi_reg() | ||||
|   Tabreg.put("CODTAB", codtab);   | ||||
|   if (Tabreg.read() == NOERR) | ||||
|   { | ||||
|     TDate d = Tabreg.get_date("D3"); | ||||
|     const TDate d = Tabreg.get_date("D3"); | ||||
|     if (!_mov_empty) //cioe' se e' stata stampata almeno una pagina
 | ||||
|     { | ||||
|       TDate ultima_data = format("%02d/%02d/%4d", _datareg.last_day(_datareg.month(), _annoes), _datareg.month(), _annoes); | ||||
| //      TDate ultima_data = format("%02d/%02d/%4d", _datareg.last_day(_datareg.month(), _annoes), _datareg.month(), _annoes);
 | ||||
|       TDate ultima_data(_datareg);  | ||||
|       ultima_data.set_end_month();       // Meglio cosi'
 | ||||
|        | ||||
|       if (ultima_data > d)  | ||||
|         Tabreg.put("D3", ultima_data); | ||||
|     }   | ||||
| @ -2142,7 +2148,10 @@ void CG4400_application::aggiorna_reg(const bool aggiorna_vidi) | ||||
|     TDate d = Tabreg.get_date("D3"); | ||||
|     if (!_mov_empty) //cioe' se e' stata stampata almeno una pagina
 | ||||
|     { | ||||
|       TDate ultima_data = format("%02d/%02d/%4d", _datareg.last_day(_datareg.month(), _annoes), _datareg.month(), _annoes); | ||||
| //      TDate ultima_data = format("%02d/%02d/%4d", _datareg.last_day(_datareg.month(), _annoes), _datareg.month(), _annoes);
 | ||||
|       TDate ultima_data(_datareg);  | ||||
|       ultima_data.set_end_month();       // Meglio cosi'
 | ||||
| 
 | ||||
|       if (ultima_data > d)  | ||||
|         Tabreg.put("D3", ultima_data); | ||||
|     }   | ||||
| @ -2516,11 +2525,16 @@ bool CG4400_application::set_print(int n) | ||||
|         _data_stampa = m.get(DATA_STAMPA); | ||||
|         _data_da     = m.get(DA_DATA); | ||||
|         _data_a      = m.get(A_DATA); | ||||
|          | ||||
|         if (!_data_da.ok()) | ||||
|           _data_da = format("01/01/%4d", _annoes); | ||||
| //          _data_da = format("01/01/%4d", _annoes);
 | ||||
|           _data_da = TDate(1, 1, _annoes);    // Meglio cosi'
 | ||||
|          | ||||
|         if (!_data_a.ok()) | ||||
|           _data_a = format("31/12/%4d", _annoes); | ||||
|         TDate d(31,12,_annoes); | ||||
| //          _data_a = format("31/12/%4d", _annoes);
 | ||||
|           _data_a = TDate(31, 12, _annoes);    // Meglio cosi'
 | ||||
|          | ||||
|         const TDate d(31,12,_annoes); | ||||
|         if (_data_a == d) | ||||
|           _tipo_riepilogativo = m.get(TIPO_RIEPILOGATIVO)[0]; | ||||
|         else _tipo_riepilogativo = ' ';   | ||||
| @ -2531,7 +2545,8 @@ bool CG4400_application::set_print(int n) | ||||
|         if ( (_tipo_stampa == 2) || (_tipo_stampa == 4) ) | ||||
|         { | ||||
|           _fino_a_mese = m.get_int(FINO_A_MESE); | ||||
|           _data_da = format("01/01/%4d", _annoes);  //e non ultima data di stampa del registro (come invece verrebbe spontaneo di pensare)
 | ||||
| //          _data_da = format("01/01/%4d", _annoes);  //e non ultima data di stampa del registro (come invece verrebbe spontaneo di pensare)
 | ||||
|           _data_da = TDate(1, 1, _annoes);        // Meglio cosi'
 | ||||
|         } | ||||
|         else  //stampa su libro unico
 | ||||
|         {  | ||||
| @ -2540,7 +2555,8 @@ bool CG4400_application::set_print(int n) | ||||
|           _u_stampata  = m.get_int(ULTIMA_PAGINA); | ||||
|           _rif_vid     = m.get_bool(RIF_VID); | ||||
|           _primast     = _u_stampata; | ||||
|           _data_da     = format("01/%02d/%04d", _fino_a_mese, _annoes);  | ||||
| //          _data_da     = format("01/%02d/%04d", _fino_a_mese, _annoes); 
 | ||||
|           _data_da     = TDate(1, _fino_a_mese, _annoes);   // Meglio cosi'
 | ||||
|         }      | ||||
|         if (_fino_a_mese == 12) | ||||
|         { | ||||
| @ -2550,11 +2566,15 @@ bool CG4400_application::set_print(int n) | ||||
|         else | ||||
|         { | ||||
|           _tipo_riepilogativo = ' '; | ||||
|           TDate primo = format("01/%02d/%4d", _fino_a_mese+1, _annoes); | ||||
|           --primo; | ||||
| //          TDate primo = format("01/%02d/%4d", _fino_a_mese+1, _annoes);
 | ||||
| //          --primo;
 | ||||
|           TDate primo(1, _fino_a_mese, _annoes);  | ||||
|           primo.set_end_month();                    // Meglio cosi'
 | ||||
|            | ||||
|           giorni_del_mese = primo.day(); | ||||
|         } | ||||
|         _data_a=format("%02d/%02d/%4d",giorni_del_mese,_fino_a_mese,_annoes); | ||||
| //        _data_a=format("%02d/%02d/%4d",giorni_del_mese,_fino_a_mese,_annoes);
 | ||||
|         _data_a = TDate(giorni_del_mese, _fino_a_mese, _annoes);  // Meglio cosi'
 | ||||
|       } | ||||
|       _stampa_data_reg = stampa_datareg(); | ||||
|       if (_tipo_stampa == 3) | ||||
| @ -2657,7 +2677,9 @@ void CG4400_application::no_movimenti() | ||||
|       { | ||||
|         TFilename f; | ||||
|         f.temp("rgp"); | ||||
|         _datareg = format("01/%02d/%4d", m, _annoes); //serve per la preprocess_header
 | ||||
| //        _datareg = format("01/%02d/%4d", m, _annoes); //serve per la preprocess_header
 | ||||
|         _datareg = TDate(1, m, _annoes);  // Meglio cosi'
 | ||||
|          | ||||
|         if (_scelta == B0_settato || _scelta == prosegui_stampa) | ||||
|         { | ||||
|           if (_tipo_stampa == 1) | ||||
| @ -2895,7 +2917,8 @@ void CG4400_application::stampa_liq_mesi_succ() | ||||
|       printer().open(); | ||||
|     if (stampo_liquidazione(m)) | ||||
|     { | ||||
|       _datareg = format("01/%02d/%4d", m, _annoes); //serve per la preprocess_header (intestazione per la stampa liquidazione)
 | ||||
| //      _datareg = format("01/%02d/%4d", m, _annoes); //serve per la preprocess_header (intestazione per la stampa liquidazione)
 | ||||
|       _datareg = TDate(1, m, _annoes);     // Meglio cosi'
 | ||||
|       TFilename t; | ||||
|       t.temp("iva");     | ||||
|       if (_tipo_stampa == 1) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user