Corretti errori

Libro giornale:
1083
2928
2027
2026
2025
2024
2029
0066

Lista movimenti
2060

(Tutti MI...)


git-svn-id: svn://10.65.10.50/trunk@632 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
nik 1994-11-16 11:39:51 +00:00
parent 9cf873f929
commit fe90bc29c9
4 changed files with 158 additions and 117 deletions

View File

@ -49,13 +49,13 @@ HIDDEN const char* err_msg[] = {"La data operazione non appartiene a nessun eser
"Data competenza incompatibile con data operazione", "Data competenza incompatibile con data operazione",
"Anno esercizio incompatibile con data competenza", "Anno esercizio incompatibile con data competenza",
"Codice causale non presente in tabella", "Codice causale non presente in tabella",
"Codice causale sospeso" "Codice causale sospeso",
"Nella causale e' stato attivato il segnale non va in allegato", "Nella causale e' stato attivato il segnale non va in allegato",
"Tipo documento non presente in tabella", "Tipo documento non presente in tabella",
"Tipo documento non corrisponde a quello indicato in causale", "Tipo documento non corrisponde a quello indicato in causale",
"Codice registro non corrisponde a quello indicato in causale", "Codice registro non corrisponde a quello indicato in causale",
"Codice registro non presente in tabella", "Codice registro non presente in tabella",
"Codice registro sospeso" "Codice registro sospeso",
"Tipo registro incompatibile con tipo documento", "Tipo registro incompatibile con tipo documento",
"Non indicato codice cliente/fornitore", "Non indicato codice cliente/fornitore",
"Tipo cliente/fornitore non compatibile con tipo registro", "Tipo cliente/fornitore non compatibile con tipo registro",
@ -497,10 +497,8 @@ const int CodiceRegistro (const char* cod, int anno)
int tipo_reg; int tipo_reg;
tab_reg.zero(); tab_reg.zero();
tab_reg.put("CODTAB", codtab); tab_reg.put("CODTAB", codtab);
tab_reg.read(); tab_reg.read();
if (tab_reg.good()) if (tab_reg.good())
tipo_reg = tab_reg.get_int("I0"); tipo_reg = tab_reg.get_int("I0");
else else
@ -761,7 +759,7 @@ void CG3100_application::stampa_errori_iva(int* nr, const char* cod, const int t
if (s) if (s)
set_row(++(*nr), "@11gCodice IVA sospeso"); set_row(++(*nr), "@11gCodice IVA sospeso");
if (_stampa_mess_alleg_iva) if (_stampa_mess_alleg_iva)
if (allc == 0 && allf == 0) if (allc == 0 || allf == 0)
set_row(++(*nr), "@11gSul Codice IVA non e' stato attivato l'indicatore per allegato"); set_row(++(*nr), "@11gSul Codice IVA non e' stato attivato l'indicatore per allegato");
} }
else else
@ -786,7 +784,8 @@ void CG3100_application::stampa_errori_mov()
if (i != -1) if (i != -1)
{ {
for (; i <= _err.last_one(); i++) for (; i <= _err.last_one(); i++)
set_row(++_n, "@11g%s", (const char*) err_msg[i-1]); if (_err[i])
set_row(++_n, "@11g%s", (const char*) err_msg[i]);
} }
} }
@ -1106,10 +1105,13 @@ bool CG3100_application::preprocess_page(int file,int counter)
_tipodoc = cur->curr(LF_MOV).get(MOV_TIPODOC); _tipodoc = cur->curr(LF_MOV).get(MOV_TIPODOC);
_codval = cur->curr(LF_MOV).get(MOV_CODVAL); _codval = cur->curr(LF_MOV).get(MOV_CODVAL);
_totdoc = cur->curr(LF_MOV).get_real(MOV_TOTDOC); _totdoc = cur->curr(LF_MOV).get_real(MOV_TOTDOC);
/*
if ((_tipo_elenco != _tipo_clifo_prec) && if ((_tipo_elenco != _tipo_clifo_prec) &&
(_tipo_clifo_prec != "") && _salto_pagina) (_tipo_clifo_prec != "") && _salto_pagina)
printer().formfeed(); printer().formfeed();
*/
if (_tipo_elenco != _tipo_clifo_prec && _tipo_clifo_prec != "")
printer().formfeed();
TLocalisamfile & file = cur->file(LF_MOV); TLocalisamfile & file = cur->file(LF_MOV);
TRectype da (file.curr()); TRectype da (file.curr());
@ -1149,6 +1151,8 @@ bool CG3100_application::preprocess_page(int file,int counter)
_settata_prima_riga = FALSE; _settata_prima_riga = FALSE;
else else
{ {
if ( _salto_pagina && _tipo_clifo_prec == _tipo_elenco )
printer().formfeed();
stampa_intestazione(); stampa_intestazione();
_tipo_clifo_prec = _tipo_elenco; _tipo_clifo_prec = _tipo_elenco;
_codcf_prec = _codcf; _codcf_prec = _codcf;
@ -1504,78 +1508,89 @@ bool CG3100_application::segnala_errori_primariga()
const int ae = date2esc(_datacomp); const int ae = date2esc(_datacomp);
if (_ae == 0) if (_ae == 0)
_err.set(1); _err.set(0l);
if (_registro.not_empty()) //si tratta di fattura if (_registro.not_empty()) //si tratta di fattura
if (_datareg.year() != _anno) if (_datareg.year() != _anno)
_err.set(2); _err.set(1);
if ( _scelta_stampa == 0 && _stampa_anno_comp ) if ( _scelta_stampa == 0 && _stampa_anno_comp )
if (_ae != _annoeser) if (_ae != _annoeser)
if (_annoes) //specificato l'anno nella maschera if (_annoes) //specificato l'anno nella maschera
_err.set(3); _err.set(2);
else _err.set(4); else _err.set(3);
if (ae) if (ae)
{ {
int pr; // Esercizio precedente int pr; // Esercizio precedente
const int ar = date2esc(_datareg, &pr); // Esercizio in corso const int ar = date2esc(_datareg, &pr); // Esercizio in corso
if (ae != ar && ae != pr) if (ae != ar && ae != pr)
_err.set(5); _err.set(4);
} }
else _err.set(6); else _err.set(5);
if (_annoeser != ae) if (_annoeser != ae)
_err.set(7); _err.set(6);
if (_causale.not_empty()) //se indicata la causale if (_causale.not_empty()) //se indicata la causale
{ {
if (_caus->curr().empty()) if (_caus->curr().empty())
_err.set(8); _err.set(7);
else else
{ {
bool sos = _caus->curr().get_bool(CAU_SOSPESO); bool sos = _caus->curr().get_bool(CAU_SOSPESO);
if (sos) if (sos)
_err.set(9); _err.set(8);
if (_stampa_mess_alleg_iva && _alleg_causale) if (_stampa_mess_alleg_iva && _alleg_causale)
_err.set(10); _err.set(9);
} }
if (_tipodoc == "" || _tipodoc != _tipodocumento) if (_tipodoc == "" || _tipodoc != _tipodocumento)
_err.set(11); _err.set(10);
if (_tipodoc != "") if (_tipodoc != "")
if (!RicercaDoc(_tipodoc)) if (!RicercaDoc(_tipodoc))
_err.set(12); _err.set(11);
if (_registro == "" || _registro != _reg_causale) if (_registro == "" || _registro != _reg_causale)
_err.set(13); _err.set(12);
if (_registro.not_empty()) //movimento iva (fatture) if (_registro.not_empty()) //movimento iva (fatture)
{ {
TRegistro rg (_registro, _datareg.year()); TRegistro rg (_registro, _datareg.year());
if (rg.name().empty()) if (rg.name().empty())
_err.set(14); _err.set(13);
else else
{ {
bool so = rg.sospeso(); bool so = rg.sospeso();
const int tipo = rg.tipo();
if (so) if (so)
_err.set(15); _err.set(14);
TipoIVA i = nessuna_iva; TipoIVA i = nessuna_iva;
TTable tabtpd("%TPD"); TTable tabtpd("%TPD");
tabtpd.put("CODTAB", _tipodoc); tabtpd.put("CODTAB", _tipodoc);
if (tabtpd.read() == NOERR) if (tabtpd.read() == NOERR)
{ {
bool cor = tabtpd.get_bool("B0"); bool cor = tabtpd.get_bool("B0");
/*
i = (TipoIVA)tabtpd.get_int("I0"); // IVA acquisti, vendite, generica i = (TipoIVA)tabtpd.get_int("I0"); // IVA acquisti, vendite, generica
const TipoIVA ri = rg.iva(); const TipoIVA ri = rg.iva();
if (i == iva_generica) i = ri; if (i == iva_generica) i = ri;
if (i != ri || ( cor && !rg.corrispettivi() )) if (i != ri || ( cor && !rg.corrispettivi() ))
_err.set(16); _err.set(16);
*/
int i = tabtpd.get_int("I0");
if (i == 1 && tipo != 1)
_err.set(15);
if (i == 2 && tipo != 2)
_err.set(15);
if (i == 9 && (tipo != 1 && tipo != 2))
_err.set(15);
if (cor && !rg.corrispettivi())
_err.set(15);
if (!cor) if (!cor)
if (_codcf == 0l) if (_codcf == 0l)
_err.set(17); _err.set(16);
} }
const int tipo = rg.tipo();
if ((tipo == 1 && _tipo != 'C') || (tipo == 2 && _tipo != 'F')) if ((tipo == 1 && _tipo != 'C') || (tipo == 2 && _tipo != 'F'))
_err.set(18); _err.set(17);
TLocalisamfile clifo(LF_CLIFO); TLocalisamfile clifo(LF_CLIFO);
clifo.setkey(1); clifo.setkey(1);
@ -1586,17 +1601,17 @@ else _err.set(4);
{ {
bool sosp = clifo.get_bool(CLI_SOSPESO); bool sosp = clifo.get_bool(CLI_SOSPESO);
if (sosp) if (sosp)
_err.set(19); _err.set(18);
bool occ = clifo.get_bool(CLI_OCCAS); bool occ = clifo.get_bool(CLI_OCCAS);
char alleg = clifo.get_char(CLI_ALLEG); char alleg = clifo.get_char(CLI_ALLEG);
long calleg = clifo.get_long(CLI_CODALLEG); long calleg = clifo.get_long(CLI_CODALLEG);
if (!occ) if (!occ)
{ {
if (_stampa_mess_alleg_iva && alleg == 1) if (_stampa_mess_alleg_iva && alleg == 1)
_err.set(20); _err.set(19);
if (calleg != 0l) if (calleg != 0l)
if (calleg == _codcf) if (calleg == _codcf)
_err.set(21); _err.set(20);
clifo.zero(); clifo.zero();
clifo.put(CLI_CODCF, calleg); clifo.put(CLI_CODCF, calleg);
clifo.put(CLI_TIPOCF,_tipo); clifo.put(CLI_TIPOCF,_tipo);
@ -1606,18 +1621,18 @@ else _err.set(4);
long codall = clifo.get_long(CLI_CODALLEG); long codall = clifo.get_long(CLI_CODALLEG);
char alleg = clifo.get_char(CLI_ALLEG); char alleg = clifo.get_char(CLI_ALLEG);
if (sospall) if (sospall)
_err.set(22); _err.set(21);
if (codall != 0l) if (codall != 0l)
_err.set(23); _err.set(22);
if (_stampa_mess_alleg_iva && alleg == 1) if (_stampa_mess_alleg_iva && alleg == 1)
_err.set(24); _err.set(23);
}
else _err.set(24);
}
} }
else _err.set(25); else _err.set(25);
} }
} }
else _err.set(26);
}
}
} }
if (_err.ones()) if (_err.ones())
return TRUE; return TRUE;
@ -1878,7 +1893,7 @@ bool CG3100_application::segnala_errori_iva()
return TRUE; return TRUE;
} }
if (_stampa_mess_alleg_iva) if (_stampa_mess_alleg_iva)
if (allc == 0 && allf == 0) if (allc == 0 || allf == 0)
{ {
rmoviva.readat(nrec); rmoviva.readat(nrec);
return TRUE; return TRUE;
@ -2102,7 +2117,6 @@ bool CG3100_application::set_print(int m)
current_cursor()->setregion(da,a); current_cursor()->setregion(da,a);
add_file(LF_MOV); add_file(LF_MOV);
add_file(LF_RMOVIVA,LF_MOV); add_file(LF_RMOVIVA,LF_MOV);
} }
break; break;
@ -2319,17 +2333,18 @@ void CG3100_application::preprocess_header()
{ {
int soh; // riga d'inizio dell'intestazione int soh; // riga d'inizio dell'intestazione
TString sep(132); TString sep(132);
TString ragsoc(50);
TLocalisamfile nditte(LF_NDITTE); TLocalisamfile nditte(LF_NDITTE);
nditte.zero(); nditte.zero();
nditte.put(NDT_CODDITTA, get_firm()); nditte.put(NDT_CODDITTA, get_firm());
if (nditte.read() == NOERR) if (nditte.read() == NOERR)
_ragsoc = nditte.get(NDT_RAGSOC); ragsoc = nditte.get(NDT_RAGSOC);
reset_header(); reset_header();
soh=1; soh=1;
sep << "Ditta " << get_firm(); sep << "Ditta " << get_firm();
sep << " " << _ragsoc; sep << " " << ragsoc;
sep.left_just(132); sep.left_just(132);
set_header (soh++, (const char*) sep); set_header (soh++, (const char*) sep);

View File

@ -126,7 +126,7 @@ END
BOOLEAN F_CAMBIO BOOLEAN F_CAMBIO
BEGIN BEGIN
GROUP 2 //GROUP 2
PROMPT 2 10 "Cambio pagina per cliente/fornitore " PROMPT 2 10 "Cambio pagina per cliente/fornitore "
HELP "Indicare se cambiare pagina nel passaggio da clienti a fornitori" HELP "Indicare se cambiare pagina nel passaggio da clienti a fornitori"
END END

View File

@ -1104,6 +1104,28 @@ bool CG3200_application::preprocess_print(int file, int counter)
_g_prec = 0; _g_prec = 0;
_c_prec = 0; _c_prec = 0;
_s_prec = 0; _s_prec = 0;
_saldo_periodo = ZERO;
_totale_periodo_dare = ZERO;
_totale_periodo_avere = ZERO;
_saldo_progre = ZERO;
_totprogre_dare = ZERO;
_totprogre_avere = ZERO;
_saldo_progre_al = ZERO;
_totprogre_dare_al = ZERO;
_totprogre_avere_al = ZERO;
_progredare = ZERO;
_progreavere = ZERO;
_totale_prima_dare = ZERO;
_totale_prima_avere = ZERO;
_saldo_movimenti = ZERO;
_saldo_progressivi = ZERO;
_saldo_progre_prec = ZERO;
_protiva = 0;
_prima_volta = TRUE;
_stampa_progressivi_si = TRUE;
} }
return TRUE; return TRUE;
@ -1154,24 +1176,6 @@ bool CG3200_application::set_print(int)
_anno_precedente = _anno_corrente - 1; _anno_precedente = _anno_corrente - 1;
_saldo_periodo = ZERO;
_totale_periodo_dare = ZERO;
_totale_periodo_avere = ZERO;
_saldo_progre = ZERO;
_totprogre_dare = ZERO;
_totprogre_avere = ZERO;
_saldo_progre_al = ZERO;
_totprogre_dare_al = ZERO;
_totprogre_avere_al = ZERO;
_progredare = ZERO;
_progreavere = ZERO;
_totale_prima_dare = ZERO;
_totale_prima_avere = ZERO;
_saldo_movimenti = ZERO;
_saldo_progressivi = ZERO;
_saldo_progre_prec = ZERO;
_protiva = 0;
// Scelta del formato e del numero di mastrini per pagina 1 o 2 // Scelta del formato e del numero di mastrini per pagina 1 o 2
if (nummast == 1) if (nummast == 1)
@ -1218,9 +1222,6 @@ bool CG3200_application::set_print(int)
break; break;
default: break; default: break;
} }
_prima_volta = TRUE;
_stampa_progressivi_si = TRUE;
enable_print_menu(); enable_print_menu();

View File

@ -87,6 +87,7 @@ public:
public: public:
int _ae; // anno esercizio di ALLA_DATA int _ae; // anno esercizio di ALLA_DATA
int _tipo; // tipo del registro
int _annoEsMov; // anno esercizio letto da mov int _annoEsMov; // anno esercizio letto da mov
bool _stampa_definitiva; bool _stampa_definitiva;
TDate _inizioEs, _fineEs; // date inizio e fine esercizio TDate _inizioEs, _fineEs; // date inizio e fine esercizio
@ -213,7 +214,7 @@ void CG3400_application::get_dati_ditta ()
TString80 cognome(_ragsoc.cut(1,30)); TString80 cognome(_ragsoc.cut(1,30));
TString80 nome(_ragsoc.cut(30,50)); TString80 nome(_ragsoc.cut(30,50));
_ragsoc = cognome; _ragsoc << " " << nome; _ragsoc = cognome; _ragsoc << " " << nome;
*/ */
} }
_anag->setkey(1); _anag->setkey(1);
@ -362,8 +363,8 @@ void CG3400_application::set_totali_giorno(const TDate& data, const int righeiva
dep = frm; dep = frm;
dep << "Operazioni del "; dep << data.string(); dep << "Operazioni del "; dep << data.string();
set_row (r++, "%s Dare: %r Avere: %r", (const char *)dep, // set_row (r++, "%s Dare: %r Avere: %r", (const char *)dep,&_tot_dare_gg, &_tot_avere_gg );
&_tot_dare_gg, &_tot_avere_gg ); set_row (r++, "@52g%s @95g%r @112g%r", (const char *)dep, &_tot_dare_gg, &_tot_avere_gg );
_tot_dare_gg = _tot_avere_gg = ZERO; _tot_dare_gg = _tot_avere_gg = ZERO;
} }
@ -372,8 +373,8 @@ void CG3400_application::set_totali_giorno(const TDate& data, const int righeiva
dep = frm; dep = frm;
dep << "Operazioni del "; dep << data.string() << " " << "Anno precedente"; dep << "Operazioni del "; dep << data.string() << " " << "Anno precedente";
set_row (r++, "%s Dare: %r Avere: %r", (const char *)dep, &_tot_dare_ap, // set_row (r++, "%s Dare: %r Avere: %r", (const char *)dep, &_tot_dare_ap,&_tot_avere_ap );
&_tot_avere_ap ); set_row (r++, "@52g%s @95g%r @112g%r", (const char *)dep, &_tot_dare_ap,&_tot_avere_ap );
_tot_avere_ap = _tot_dare_ap = ZERO; _tot_avere_ap = _tot_dare_ap = ZERO;
} }
@ -547,7 +548,7 @@ void CG3400_application::preprocess_footer()
} }
if (_stampa_width == 132) if (_stampa_width == 132)
frm = "@b@45g"; frm = "@b@59g";
else else
frm = "@b@100g"; frm = "@b@100g";
@ -557,15 +558,14 @@ void CG3400_application::preprocess_footer()
const TFixed_string progr_avere ( _tot_avere_progr.string(REAL_TOT_PIC)); const TFixed_string progr_avere ( _tot_avere_progr.string(REAL_TOT_PIC));
riga = frm; riga = frm;
riga << format("Totale progressivi Dare: %s Avere: %s", riga << format("Totale progressivi @95g%s @112g%s",
(const char *) progr_dare, (const char *) progr_avere); (const char *) progr_dare, (const char *) progr_avere);
set_footer (r++, (const char*) riga); set_footer (r++, (const char*) riga);
if (ap) if (ap)
{ {
// riga = frm; riga.format("%sTotale progressivi anno precedente @95g%s @112g%s",
riga.format("%sTotale progressivi anno precedente Dare: %s Avere: %s",
(const char*) frm, (const char*) frm,
(const char *) progr_dare_ap, (const char *) progr_avere_ap); (const char *) progr_dare_ap, (const char *) progr_avere_ap);
set_footer (r++, (const char*) riga); set_footer (r++, (const char*) riga);
@ -577,7 +577,7 @@ void CG3400_application::preprocess_footer()
const TFixed_string ats(_tot_avere_generale.string(REAL_TOT_PIC)); const TFixed_string ats(_tot_avere_generale.string(REAL_TOT_PIC));
riga = frm; riga = frm;
riga << format ("Totale progressivi generali Dare: %s Avere: %s", (const char *) dts, (const char *) ats); riga << format ("Totale progressivi generali @95g%s @112g%s", (const char *) dts, (const char *) ats);
set_footer (r++, (const char*) riga); set_footer (r++, (const char*) riga);
} }
else // Non ancora totale generale else // Non ancora totale generale
@ -588,7 +588,7 @@ else // Non ancora totale generale
const TFixed_string ats(at.string(REAL_TOT_PIC)); const TFixed_string ats(at.string(REAL_TOT_PIC));
riga = frm; riga = frm;
riga << format ("A riportare Dare: %s Avere: %s@r", (const char *) dts, riga << format ("A riportare @95g%s @112g%s@r", (const char *) dts,
(const char *) ats); (const char *) ats);
set_footer (r++, (const char*) riga); set_footer (r++, (const char*) riga);
} }
@ -608,7 +608,7 @@ int CG3400_application::stampa_intestazione_ditta()
set_header(r, riga); set_header(r, riga);
#endif #endif
set_header (++r, "Ditta: %s Via %s %s %s %s", (const char *)_ragsoc, set_header (++r, "Ditta: %s %s %s %s %s", (const char *)_ragsoc,
(const char *)_viafis, (const char *)_cap, (const char *)_viafis, (const char *)_cap,
(const char *)_comunefis, (const char *)_provfis); (const char *)_comunefis, (const char *)_provfis);
@ -763,7 +763,7 @@ void CG3400_application::preprocess_header()
TString dare (riporto_dare.string(RIP_TOT_PIC)); TString dare (riporto_dare.string(RIP_TOT_PIC));
TString avere(riporto_avere.string(RIP_TOT_PIC)); TString avere(riporto_avere.string(RIP_TOT_PIC));
// RIP_TOT_PIC adesso e' lunga 15 // RIP_TOT_PIC adesso e' lunga 15
if (_stampa_width == 132) if (_stampa_width == 132)
frm = "@b@84g"; frm = "@b@84g";
@ -1249,7 +1249,7 @@ int CG3400_application::ultimo_esercizio()
TTable ese("ESC"); TTable ese("ESC");
ese.zero(); ese.zero();
// ese.last(); // Sembra che non vadi ?!? // ese.last(); // Sembra che non vadi ?!?
ese.first(); ese.first();
sanno = ese.get("CODTAB"); sanno.cut(4); sanno = ese.get("CODTAB"); sanno.cut(4);
@ -1285,6 +1285,7 @@ bool CG3400_application::leggi_tabreg(const char * reg_cod,
_last_data = _tabreg->get_date ("D3"); _last_data = _tabreg->get_date ("D3");
_stampa_intesta = _tabreg->get_bool ("B9"); _stampa_intesta = _tabreg->get_bool ("B9");
_reg_descr = _tabreg->get ("S0"); _reg_descr = _tabreg->get ("S0");
_tipo = _tabreg->get_int("I0");
return ok; return ok;
} }
@ -1342,22 +1343,21 @@ bool CG3400_application::data_a_hndl (TMask_field& f, KEY k)
const int ae = app()._ae; const int ae = app()._ae;
const TMask_field& fld_dtda = m.field(DATA_DA); const TMask_field& fld_dtda = m.field(DATA_DA);
// Controlli sulle date // Controlli sulle date
if (definitiva) if (definitiva)
{ {
if (dtda.not_empty()) // senno' ci metto inizioEs if (dtda.not_empty()) // senno' ci metto inizioEs
{
if (data_da < app()._inizioEs || data_a > app()._fineEs); if (data_da < app()._inizioEs || data_a > app()._fineEs);
return f.warning_box("Le date specificate non appartengono allo stesso esercizio"); return f.warning_box("Le date specificate non appartengono allo stesso esercizio");
}
else // se la stampa e' di prova DALLA_DATA e' obbligatoria
if (dtda.empty())
return fld_dtda.warning_box("Manca la data di partenza");
else
if (data_da > data_a) if (data_da > data_a)
return fld_dtda.warning_box("La data di inizio non puo' essere maggiore della data finale"); return f.warning_box("La data di partenza non puo' essere maggiore della data finale");
}
}
// Controllo il registro /*********************
// Controllo il registro
const TString16 codreg(m.get(CODREG)); const TString16 codreg(m.get(CODREG));
const TMask_field& fld_reg = m.field(CODREG); const TMask_field& fld_reg = m.field(CODREG);
TRegistro reg(codreg, ae); TRegistro reg(codreg, ae);
@ -1369,6 +1369,7 @@ bool CG3400_application::data_a_hndl (TMask_field& f, KEY k)
if (reg.tipo() != 5) if (reg.tipo() != 5)
return fld_reg.warning_box("Il registro %s per l'anno %d non e' di tipo libro giornale", return fld_reg.warning_box("Il registro %s per l'anno %d non e' di tipo libro giornale",
(const char *) codreg, ae); (const char *) codreg, ae);
**************/
} // if K_ENTER } // if K_ENTER
return TRUE; return TRUE;
@ -1376,9 +1377,9 @@ bool CG3400_application::data_a_hndl (TMask_field& f, KEY k)
bool CG3400_application::data_da_hndl(TMask_field& f, KEY k) bool CG3400_application::data_da_hndl(TMask_field& f, KEY k)
{ {
TMask& m = f.mask();
if (f.to_check(k)) if (f.to_check(k))
{ {
TMask& m = f.mask();
const TDate data_da (f.get()); const TDate data_da (f.get());
const TString16 data_a(m.get(DATA_A)); const TString16 data_a(m.get(DATA_A));
const int ae_data_da = date2esc(data_da); const int ae_data_da = date2esc(data_da);
@ -1391,6 +1392,25 @@ bool CG3400_application::data_da_hndl(TMask_field& f, KEY k)
if (app()._ae != ae_data_da) if (app()._ae != ae_data_da)
return f.error_box("Le due date non appartengono allo stesso esercizio"); return f.error_box("Le due date non appartengono allo stesso esercizio");
} }
if (k == K_ENTER)
{
const bool definitiva = m.get_bool(STAMPA_DEF);
const TDate data_a(m.get(DATA_A));
const TDate data_da(f.get());
TString16 dtda(data_da.string());
// Controlli sulle date
// se la stampa e' di prova DALLA_DATA e' obbligatoria
if (!definitiva)
if (dtda.empty())
return f.warning_box("Manca la data di partenza");
if (dtda.not_empty())
if (data_da > data_a)
return f.warning_box("La data di partenza non puo' essere maggiore della data finale");
}
return TRUE; return TRUE;
} }
@ -1411,21 +1431,26 @@ bool CG3400_application::mask_a_cod_reg (TMask_field& f, KEY k)
TMask& m = f.mask(); TMask& m = f.mask();
CG3400_application& a = (CG3400_application&) main_app(); CG3400_application& a = (CG3400_application&) main_app();
const bool definitiva = m.get_bool(STAMPA_DEF); const bool definitiva = m.get_bool(STAMPA_DEF);
const int ae = app()._ae;
TString16 reg_cod(f.get()); const TString16 reg_cod(f.get());
if (reg_cod.empty()) return TRUE; if (reg_cod.empty()) return TRUE;
bool reg_ok = a.leggi_tabreg(reg_cod, a._ae); bool reg_ok = a.leggi_tabreg(reg_cod, a._ae);
// Output da qui della descrizione del registro e dell'anno // Output da qui della descrizione del registro e dell'anno
m.set(REG_DESC, a._reg_descr); m.set(REG_DESC, a._reg_descr);
m.set(ANNO_ESER, a._ae); m.set(ANNO_ESER, a._ae);
// CHECKTYPE NORMAL abolito! (nella maschera non ho l'anno... // CHECKTYPE NORMAL abolito! (nella maschera non ho l'anno...
if (!reg_ok) if (!reg_ok)
return f.warning_box("Registro inesistente"); return f.warning_box("Registro inesistente");
if (app()._tipo != 5)
return f.warning_box("Il registro %s per l'anno %d non e' di tipo libro giornale",
(const char *) reg_cod, ae);
if (definitiva) if (definitiva)
{ {
if (a._stampa_ok == -1) // stampa precedente andata bene if (a._stampa_ok == -1) // stampa precedente andata bene