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

View File

@ -5,14 +5,14 @@ PAGE "" -1 -1 73 16
NUMBER F_CODDITTA 5
BEGIN
PROMPT 2 1 "Ditta "
PROMPT 2 1 "Ditta "
FLAGS "FRD"
USE LF_NDITTE KEY 1
CHECKTYPE REQUIRED
INPUT CODDITTA F_CODDITTA
DISPLAY "Codice" CODDITTA
DISPLAY "Ragione sociale @50" RAGSOC
OUTPUT F_CODDITTA CODDITTA
DISPLAY "Ragione sociale @50" RAGSOC
OUTPUT F_CODDITTA CODDITTA
OUTPUT F_RAGSOC RAGSOC
END
@ -126,7 +126,7 @@ END
BOOLEAN F_CAMBIO
BEGIN
GROUP 2
//GROUP 2
PROMPT 2 10 "Cambio pagina per cliente/fornitore "
HELP "Indicare se cambiare pagina nel passaggio da clienti a fornitori"
END

View File

@ -1103,7 +1103,29 @@ bool CG3200_application::preprocess_print(int file, int counter)
{
_g_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;
@ -1153,25 +1175,7 @@ bool CG3200_application::set_print(int)
_anno_corrente = _anno_ghost;
_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
if (nummast == 1)
@ -1218,9 +1222,6 @@ bool CG3200_application::set_print(int)
break;
default: break;
}
_prima_volta = TRUE;
_stampa_progressivi_si = TRUE;
enable_print_menu();

View File

@ -87,6 +87,7 @@ public:
public:
int _ae; // anno esercizio di ALLA_DATA
int _tipo; // tipo del registro
int _annoEsMov; // anno esercizio letto da mov
bool _stampa_definitiva;
TDate _inizioEs, _fineEs; // date inizio e fine esercizio
@ -209,11 +210,11 @@ void CG3400_application::get_dati_ditta ()
if (tipoa == 'F')
{
/*
TString80 cognome(_ragsoc.cut(1,30));
TString80 nome(_ragsoc.cut(30,50));
_ragsoc = cognome; _ragsoc << " " << nome;
*/
/*
TString80 cognome(_ragsoc.cut(1,30));
TString80 nome(_ragsoc.cut(30,50));
_ragsoc = cognome; _ragsoc << " " << nome;
*/
}
_anag->setkey(1);
@ -362,8 +363,8 @@ void CG3400_application::set_totali_giorno(const TDate& data, const int righeiva
dep = frm;
dep << "Operazioni del "; dep << data.string();
set_row (r++, "%s Dare: %r Avere: %r", (const char *)dep,
&_tot_dare_gg, &_tot_avere_gg );
// set_row (r++, "%s Dare: %r Avere: %r", (const char *)dep,&_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;
}
@ -372,8 +373,8 @@ void CG3400_application::set_totali_giorno(const TDate& data, const int righeiva
dep = frm;
dep << "Operazioni del "; dep << data.string() << " " << "Anno precedente";
set_row (r++, "%s Dare: %r Avere: %r", (const char *)dep, &_tot_dare_ap,
&_tot_avere_ap );
// set_row (r++, "%s Dare: %r Avere: %r", (const char *)dep, &_tot_dare_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;
}
@ -547,7 +548,7 @@ void CG3400_application::preprocess_footer()
}
if (_stampa_width == 132)
frm = "@b@45g";
frm = "@b@59g";
else
frm = "@b@100g";
@ -557,15 +558,14 @@ void CG3400_application::preprocess_footer()
const TFixed_string progr_avere ( _tot_avere_progr.string(REAL_TOT_PIC));
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);
set_footer (r++, (const char*) riga);
if (ap)
{
// riga = frm;
riga.format("%sTotale progressivi anno precedente Dare: %s Avere: %s",
riga.format("%sTotale progressivi anno precedente @95g%s @112g%s",
(const char*) frm,
(const char *) progr_dare_ap, (const char *) progr_avere_ap);
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));
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);
}
else // Non ancora totale generale
@ -588,7 +588,7 @@ else // Non ancora totale generale
const TFixed_string ats(at.string(REAL_TOT_PIC));
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);
set_footer (r++, (const char*) riga);
}
@ -608,13 +608,13 @@ int CG3400_application::stampa_intestazione_ditta()
set_header(r, riga);
#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 *)_comunefis, (const char *)_provfis);
_intes = format ("Partita iva %s @24gCodice fiscale %s %s @117gData @>",
(const char*)_paiva, (const char*)_cofi,
_stampa_definitiva ? "" : "STAMPA DI PROVA");
(const char*)_paiva, (const char*)_cofi,
_stampa_definitiva ? "" : "STAMPA DI PROVA");
set_header (++r, "%s", (const char*) _intes);
@ -763,7 +763,7 @@ void CG3400_application::preprocess_header()
TString dare (riporto_dare.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)
frm = "@b@84g";
@ -1249,7 +1249,7 @@ int CG3400_application::ultimo_esercizio()
TTable ese("ESC");
ese.zero();
// ese.last(); // Sembra che non vadi ?!?
// ese.last(); // Sembra che non vadi ?!?
ese.first();
sanno = ese.get("CODTAB"); sanno.cut(4);
@ -1285,7 +1285,8 @@ bool CG3400_application::leggi_tabreg(const char * reg_cod,
_last_data = _tabreg->get_date ("D3");
_stampa_intesta = _tabreg->get_bool ("B9");
_reg_descr = _tabreg->get ("S0");
_tipo = _tabreg->get_int("I0");
return ok;
}
@ -1332,7 +1333,7 @@ bool CG3400_application::data_a_hndl (TMask_field& f, KEY k)
if (ae == 0)
return f.error_box("La data specificata non appartiene a nessun esercizio");
}
if (k == K_ENTER)
{
const bool definitiva = m.get_bool(STAMPA_DEF);
@ -1342,33 +1343,33 @@ bool CG3400_application::data_a_hndl (TMask_field& f, KEY k)
const int ae = app()._ae;
const TMask_field& fld_dtda = m.field(DATA_DA);
// Controlli sulle date
// Controlli sulle date
if (definitiva)
{
if (dtda.not_empty()) // senno' ci metto inizioEs
{
if (data_da < app()._inizioEs || data_a > app()._fineEs);
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
return f.warning_box("Le date specificate non appartengono allo stesso esercizio");
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
const TString16 codreg(m.get(CODREG));
const TMask_field& fld_reg = m.field(CODREG);
TRegistro reg(codreg, ae);
if (!reg.ok())
/*********************
// Controllo il registro
const TString16 codreg(m.get(CODREG));
const TMask_field& fld_reg = m.field(CODREG);
TRegistro reg(codreg, ae);
if (!reg.ok())
return fld_reg.warning_box("Non trovo il libro giornale %s per l'esercizio %d",
(const char *) codreg, ae);
if (reg.tipo() != 5)
(const char *) codreg, ae);
if (reg.tipo() != 5)
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
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)
{
TMask& m = f.mask();
if (f.to_check(k))
{
TMask& m = f.mask();
const TDate data_da (f.get());
const TString16 data_a(m.get(DATA_A));
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)
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;
}
@ -1411,20 +1431,25 @@ bool CG3400_application::mask_a_cod_reg (TMask_field& f, KEY k)
TMask& m = f.mask();
CG3400_application& a = (CG3400_application&) main_app();
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;
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(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)
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)
{