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:
guy 1995-07-13 09:45:22 +00:00
parent 0303a5c42a
commit f393c1a3ba
2 changed files with 3300 additions and 3276 deletions

View File

@ -59,8 +59,9 @@ void TAgg_opintra::look_mov()
const TString16 reg(mov.get(MOV_REG)); const TString16 reg(mov.get(MOV_REG));
if (reg.empty()) continue; if (reg.empty()) continue;
const TDate datareg = mov.get_date(MOV_DATAREG); const TDate& datareg = mov.get_date(MOV_DATAREG);
if (datareg < "01-01-93") continue; // if (datareg < "01-01-93") continue;
if (datareg.year() << 1993) continue; // Meglio cosi'
const TString16 codcaus(mov.get(MOV_CODCAUS)); const TString16 codcaus(mov.get(MOV_CODCAUS));
if (codcaus.not_empty()) if (codcaus.not_empty())

View File

@ -1126,10 +1126,11 @@ bool CG4400_application::cerca_libro_gio(TString& datas, bool* good)
int tiporeg = _tabreg->get_int("I0"); int tiporeg = _tabreg->get_int("I0");
if (tiporeg == 5) //libro giornale if (tiporeg == 5) //libro giornale
{ {
TDate data = _tabreg->get_date("D3"); const TDate& data = _tabreg->get_date("D3");
if (data > _data_a) 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; *good = FALSE;
return FALSE; return FALSE;
} }
@ -1706,9 +1707,10 @@ bool CG4400_application::compila_reg(const TMask& m)
if (_u_data.ok()) if (_u_data.ok())
if (_data_a < _u_data) if (_data_a < _u_data)
{ {
TString16 datas = format("%02d/%02d/%4d", _u_data.day(), _u_data.month(), _u_data.year()); // 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); // 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 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 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 (!_st_liq[m])
if (stampo_liquidazione(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; TFilename t;
t.temp("reg"); t.temp("reg");
if (_scelta == B0_settato || _scelta == prosegui_stampa) if (_scelta == B0_settato || _scelta == prosegui_stampa)
@ -2093,10 +2096,13 @@ void CG4400_application::scrivi_reg()
Tabreg.put("CODTAB", codtab); Tabreg.put("CODTAB", codtab);
if (Tabreg.read() == NOERR) 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 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) if (ultima_data > d)
Tabreg.put("D3", ultima_data); Tabreg.put("D3", ultima_data);
} }
@ -2142,7 +2148,10 @@ void CG4400_application::aggiorna_reg(const bool aggiorna_vidi)
TDate d = Tabreg.get_date("D3"); TDate d = Tabreg.get_date("D3");
if (!_mov_empty) //cioe' se e' stata stampata almeno una pagina 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) if (ultima_data > d)
Tabreg.put("D3", ultima_data); Tabreg.put("D3", ultima_data);
} }
@ -2516,11 +2525,16 @@ bool CG4400_application::set_print(int n)
_data_stampa = m.get(DATA_STAMPA); _data_stampa = m.get(DATA_STAMPA);
_data_da = m.get(DA_DATA); _data_da = m.get(DA_DATA);
_data_a = m.get(A_DATA); _data_a = m.get(A_DATA);
if (!_data_da.ok()) 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()) if (!_data_a.ok())
_data_a = format("31/12/%4d", _annoes); // _data_a = format("31/12/%4d", _annoes);
TDate d(31,12,_annoes); _data_a = TDate(31, 12, _annoes); // Meglio cosi'
const TDate d(31,12,_annoes);
if (_data_a == d) if (_data_a == d)
_tipo_riepilogativo = m.get(TIPO_RIEPILOGATIVO)[0]; _tipo_riepilogativo = m.get(TIPO_RIEPILOGATIVO)[0];
else _tipo_riepilogativo = ' '; else _tipo_riepilogativo = ' ';
@ -2531,7 +2545,8 @@ bool CG4400_application::set_print(int n)
if ( (_tipo_stampa == 2) || (_tipo_stampa == 4) ) if ( (_tipo_stampa == 2) || (_tipo_stampa == 4) )
{ {
_fino_a_mese = m.get_int(FINO_A_MESE); _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 else //stampa su libro unico
{ {
@ -2540,7 +2555,8 @@ bool CG4400_application::set_print(int n)
_u_stampata = m.get_int(ULTIMA_PAGINA); _u_stampata = m.get_int(ULTIMA_PAGINA);
_rif_vid = m.get_bool(RIF_VID); _rif_vid = m.get_bool(RIF_VID);
_primast = _u_stampata; _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) if (_fino_a_mese == 12)
{ {
@ -2550,11 +2566,15 @@ bool CG4400_application::set_print(int n)
else else
{ {
_tipo_riepilogativo = ' '; _tipo_riepilogativo = ' ';
TDate primo = format("01/%02d/%4d", _fino_a_mese+1, _annoes); // TDate primo = format("01/%02d/%4d", _fino_a_mese+1, _annoes);
--primo; // --primo;
TDate primo(1, _fino_a_mese, _annoes);
primo.set_end_month(); // Meglio cosi'
giorni_del_mese = primo.day(); 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(); _stampa_data_reg = stampa_datareg();
if (_tipo_stampa == 3) if (_tipo_stampa == 3)
@ -2657,7 +2677,9 @@ void CG4400_application::no_movimenti()
{ {
TFilename f; TFilename f;
f.temp("rgp"); 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 (_scelta == B0_settato || _scelta == prosegui_stampa)
{ {
if (_tipo_stampa == 1) if (_tipo_stampa == 1)
@ -2895,7 +2917,8 @@ void CG4400_application::stampa_liq_mesi_succ()
printer().open(); printer().open();
if (stampo_liquidazione(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; TFilename t;
t.temp("iva"); t.temp("iva");
if (_tipo_stampa == 1) if (_tipo_stampa == 1)