jj
git-svn-id: svn://10.65.10.50/trunk@3777 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
27bf18b4da
commit
6306defe26
436
cg/cg6901.cpp
436
cg/cg6901.cpp
@ -895,7 +895,443 @@ void TLista_archivi::controlla_PNIVA(char file)
|
||||
|
||||
void TLista_archivi::controlla_fatture(char file)
|
||||
{
|
||||
/*
|
||||
TPrintrow row;
|
||||
TString str;
|
||||
bool errore = FALSE;
|
||||
bool salto = FALSE;
|
||||
bool intesta = TRUE;
|
||||
bool tit_riga = FALSE;
|
||||
TString_array stampa(50);
|
||||
int num;
|
||||
long nreg_p = 0;
|
||||
|
||||
_part->setkey(1);
|
||||
_part->zero();
|
||||
|
||||
for (_part->first(); !_part->eof(); _part->next())
|
||||
{
|
||||
bool inviata = _part->get_bool(PART_INVIATA);
|
||||
|
||||
if (inviata) continue; // Se il movimento e' gia' stato inviato non lo posso piu' inviare
|
||||
// cosi' come le sue rate e i suoi pagamenti.
|
||||
|
||||
TDate datareg (_part->get_date(PART_DATAREG));
|
||||
|
||||
if (datareg > _datalimite) continue;
|
||||
|
||||
char tipo = _part->get_char(PART_TIPOCF);
|
||||
int gruppo = _part->get_int (PART_GRUPPO);
|
||||
int conto = _part->get_int (PART_CONTO);
|
||||
long sottoc = _part->get_long(PART_SOTTOCONTO);
|
||||
int anno = _part->get_int (PART_ANNO);
|
||||
TString numpart = _part->get (PART_NUMPART);
|
||||
int nriga = _part->get_int (PART_NRIGA);
|
||||
long nreg = _part->get_long(PART_NREG);
|
||||
int
|
||||
if (nreg > 999999)
|
||||
{
|
||||
errore = TRUE;
|
||||
stampa.add(" - Rilevato un numero di registrazione composto da 7");
|
||||
}
|
||||
|
||||
TString reg = _mov->get(MOV_REG);
|
||||
if (!controlla_valore(reg,9,1))
|
||||
{
|
||||
errore = TRUE;
|
||||
stampa.add(" - Rilevato un codice registro IVA composto da 2 o piu' cifre");
|
||||
}
|
||||
|
||||
const char* codcaus = _mov->get(MOV_CODCAUS);
|
||||
if (codcaus && *codcaus)
|
||||
if (!real::is_natural(codcaus))
|
||||
{
|
||||
errore = TRUE;
|
||||
stampa.add(" - Rilevato un codice causale alfanumerico");
|
||||
}
|
||||
|
||||
TString codpag = _mov->get(MOV_CODPAG);
|
||||
if (!controlla_valore(codpag,99,2))
|
||||
{
|
||||
errore = TRUE;
|
||||
stampa.add(" - Rilevato un codice di pagamento composto da 3 o piu' cifre");
|
||||
}
|
||||
|
||||
num = 0;
|
||||
|
||||
bool prima = TRUE;
|
||||
|
||||
_rmov->setkey(1);
|
||||
_rmov->zero();
|
||||
_rmov->put(RMV_NUMREG, nreg);
|
||||
|
||||
TRectype rmov (_rmov->curr());
|
||||
|
||||
for (_rmov->read(); !_rmov->eof(); _rmov->next())
|
||||
{
|
||||
|
||||
if (_rmov->curr() > rmov) break;
|
||||
|
||||
tit_riga = FALSE;
|
||||
|
||||
soliva = FALSE;
|
||||
|
||||
num++;
|
||||
|
||||
if (num > 99)
|
||||
{
|
||||
errore = TRUE;
|
||||
stampa.add(" - Rilevato movimento di Primanota con numero righe superiore a 99");
|
||||
}
|
||||
|
||||
int nr = _rmov->get_int (RMV_NUMRIG);
|
||||
int g = _rmov->get_int (RMV_GRUPPO);
|
||||
int c = _rmov->get_int (RMV_CONTO);
|
||||
int gc = _rmov->get_int (RMV_GRUPPOC);
|
||||
int cc = _rmov->get_int (RMV_CONTOC);
|
||||
|
||||
if (nr > 99)
|
||||
{
|
||||
if (prima)
|
||||
{
|
||||
stampa.add(" ");
|
||||
stampa.add("Righe primanota");
|
||||
stampa.add(" ");
|
||||
prima = FALSE;
|
||||
}
|
||||
errore = TRUE;
|
||||
TString app;
|
||||
app.format("%5s%03d", (const char*)"@b - ", nr);
|
||||
app << " " << "@rRilevato numero di riga con piu' di due cifre";
|
||||
stampa.add(app);
|
||||
tit_riga = TRUE;
|
||||
}
|
||||
|
||||
if (g > 99)
|
||||
{
|
||||
errore = TRUE;
|
||||
TString app;
|
||||
if (prima)
|
||||
{
|
||||
stampa.add(" ");
|
||||
stampa.add("Righe primanota");
|
||||
stampa.add(" ");
|
||||
prima = FALSE;
|
||||
}
|
||||
if (tit_riga)
|
||||
app << "@r Rilevato un gruppo di partita composto da 3 cifre";
|
||||
else
|
||||
{
|
||||
app.format("%5s%03d", (const char*)"@b - ", nr);
|
||||
app << " " << "@rRilevato un gruppo di partita composto da 3 cifre";
|
||||
}
|
||||
stampa.add(app);
|
||||
tit_riga = TRUE;
|
||||
}
|
||||
|
||||
if (c > 99)
|
||||
{
|
||||
errore = TRUE;
|
||||
TString app;
|
||||
if (prima)
|
||||
{
|
||||
stampa.add(" ");
|
||||
stampa.add("Righe primanota");
|
||||
stampa.add(" ");
|
||||
prima = FALSE;
|
||||
}
|
||||
if (tit_riga)
|
||||
app << "@r Rilevato un conto di partita composto da 3 cifre";
|
||||
else
|
||||
{
|
||||
app.format("%5s%03d", (const char*)"@b - ", nr);
|
||||
app << " " << "@rRilevato un conto di partita composto da 3 cifre";
|
||||
}
|
||||
stampa.add(app);
|
||||
}
|
||||
|
||||
if (gc > 99)
|
||||
{
|
||||
errore = TRUE;
|
||||
TString app;
|
||||
if (prima)
|
||||
{
|
||||
stampa.add(" ");
|
||||
stampa.add("Righe primanota");
|
||||
stampa.add(" ");
|
||||
prima = FALSE;
|
||||
}
|
||||
if (tit_riga)
|
||||
app << "@r Rilevato un gruppo di contropartita composto da 3 cifre";
|
||||
else
|
||||
{
|
||||
app.format("%5s%03d", (const char*)"@b - ", nr);
|
||||
app << " " << "@rRilevato un gruppo di contropartita composto da 3 cifre";
|
||||
}
|
||||
stampa.add(app);
|
||||
tit_riga = TRUE;
|
||||
}
|
||||
|
||||
if (cc > 99)
|
||||
{
|
||||
errore = TRUE;
|
||||
TString app;
|
||||
if (prima)
|
||||
{
|
||||
stampa.add(" ");
|
||||
stampa.add("Righe primanota");
|
||||
stampa.add(" ");
|
||||
prima = FALSE;
|
||||
}
|
||||
if (tit_riga)
|
||||
app << "@r Rilevato un conto di contropartita composto da 3 cifre";
|
||||
else
|
||||
{
|
||||
app.format("%5s%03d", (const char*)"@b - ", nr);
|
||||
app << " " << "@rRilevato un conto di contropartita composto da 3 cifre";
|
||||
}
|
||||
stampa.add(app);
|
||||
}
|
||||
}
|
||||
|
||||
if (soliva)
|
||||
{
|
||||
TLocalisamfile rcaus (LF_RCAUSALI);
|
||||
int g = 0;
|
||||
int c = 0;
|
||||
bool tit_riga = FALSE;
|
||||
bool prima = TRUE;
|
||||
int nr = 1;
|
||||
|
||||
rcaus.setkey(1);
|
||||
rcaus.zero();
|
||||
rcaus.put(RCA_CODCAUS, codcaus);
|
||||
rcaus.read();
|
||||
TString codcau = rcaus.get(RCA_CODCAUS);
|
||||
if (codcau == codcaus)
|
||||
{
|
||||
g = rcaus.get_int (RCA_GRUPPO);
|
||||
c = rcaus.get_int (RCA_CONTO);
|
||||
}
|
||||
|
||||
|
||||
if (g > 99)
|
||||
{
|
||||
errore = TRUE;
|
||||
TString app;
|
||||
if (prima)
|
||||
{
|
||||
stampa.add(" ");
|
||||
stampa.add("Righe primanota");
|
||||
stampa.add(" ");
|
||||
prima = FALSE;
|
||||
}
|
||||
if (tit_riga)
|
||||
app << "@r Rilevato un gruppo di partita composto da 3 cifre";
|
||||
else
|
||||
{
|
||||
app.format("%5s%03d", (const char*)"@b - ", nr);
|
||||
app << " " << "@rRilevato un gruppo di partita composto da 3 cifre";
|
||||
}
|
||||
stampa.add(app);
|
||||
tit_riga = TRUE;
|
||||
}
|
||||
|
||||
if (c > 99)
|
||||
{
|
||||
errore = TRUE;
|
||||
TString app;
|
||||
if (prima)
|
||||
{
|
||||
stampa.add(" ");
|
||||
stampa.add("Righe primanota");
|
||||
stampa.add(" ");
|
||||
prima = FALSE;
|
||||
}
|
||||
if (tit_riga)
|
||||
app << "@r Rilevato un conto di partita composto da 3 cifre";
|
||||
else
|
||||
{
|
||||
app.format("5s%03d", (const char*)"@b - ", nr);
|
||||
app << " " << "@rRilevato un conto di partita composto da 3 cifre";
|
||||
}
|
||||
stampa.add(app);
|
||||
}
|
||||
}
|
||||
|
||||
num = 0;
|
||||
|
||||
if (_files.find('U') != -1)
|
||||
{
|
||||
nreg_p = 0;
|
||||
_rmoviva->setkey(1);
|
||||
_rmoviva->zero();
|
||||
_rmoviva->put(RMI_NUMREG, nreg);
|
||||
|
||||
TRectype rmoviva (_rmoviva->curr());
|
||||
|
||||
prima = TRUE;
|
||||
|
||||
for (_rmoviva->read(); !_rmoviva->eof(); _rmoviva->next())
|
||||
{
|
||||
if (_rmoviva->curr() > rmoviva) break;
|
||||
|
||||
num++;
|
||||
|
||||
if (num > 9)
|
||||
{
|
||||
errore = TRUE;
|
||||
stampa.add(" - Rilevato movimento Iva con numero righe superiore a 9");
|
||||
}
|
||||
|
||||
int nr = _rmoviva->get_int (RMI_NUMRIG);
|
||||
int g = _rmoviva->get_int (RMI_GRUPPO);
|
||||
int c = _rmoviva->get_int (RMI_CONTO);
|
||||
|
||||
if (nr > 99)
|
||||
{
|
||||
errore = TRUE;
|
||||
TString app;
|
||||
if (prima)
|
||||
{
|
||||
stampa.add(" ");
|
||||
stampa.add("Righe iva");
|
||||
stampa.add(" ");
|
||||
prima = FALSE;
|
||||
}
|
||||
app.format("%5s%03d", (const char*)"@b - ", nr);
|
||||
app << " " << "@rRilevato numero di riga con piu' di due cifre";
|
||||
stampa.add(app);
|
||||
tit_riga = TRUE;
|
||||
}
|
||||
|
||||
if (g > 99)
|
||||
{
|
||||
errore = TRUE;
|
||||
TString app;
|
||||
if (prima)
|
||||
{
|
||||
stampa.add(" ");
|
||||
stampa.add("Righe iva");
|
||||
stampa.add(" ");
|
||||
prima = FALSE;
|
||||
}
|
||||
if (tit_riga)
|
||||
app << "@r Rilevato un gruppo composto da 3 cifre";
|
||||
else
|
||||
{
|
||||
app.format("%5s%03d", (const char*)"@b - ", nr);
|
||||
app << " " << "@rRilevato un gruppo composto da 3 cifre";
|
||||
}
|
||||
stampa.add(app);
|
||||
tit_riga = TRUE;
|
||||
}
|
||||
|
||||
if (c > 99)
|
||||
{
|
||||
errore = TRUE;
|
||||
TString app;
|
||||
if (prima)
|
||||
{
|
||||
stampa.add(" ");
|
||||
stampa.add("Righe iva");
|
||||
stampa.add(" ");
|
||||
prima = FALSE;
|
||||
}
|
||||
if (tit_riga)
|
||||
app << "@r Rilevato un conto composto da 3 cifre";
|
||||
else
|
||||
{
|
||||
app.format("%5s%03d", (const char*)"@b - ", nr);
|
||||
app << " " << "@rRilevato un conto composto da 3 cifre";
|
||||
}
|
||||
stampa.add(app);
|
||||
}
|
||||
const char* ci = _rmoviva->get (RMI_CODIVA);
|
||||
if ( ci && *ci && !real::is_natural(ci) )
|
||||
{
|
||||
errore = TRUE;
|
||||
TString app;
|
||||
if (prima)
|
||||
{
|
||||
stampa.add(" ");
|
||||
stampa.add("Righe iva");
|
||||
stampa.add(" ");
|
||||
prima = FALSE;
|
||||
}
|
||||
if (tit_riga)
|
||||
app << "@r Rilevato un codice IVA alfanumerico";
|
||||
else
|
||||
{
|
||||
app.format("%5s%03d", (const char*)"@b - ", nr);
|
||||
app << " " << "@rRilevato un codice IVA alfanumerico";
|
||||
}
|
||||
stampa.add(app);
|
||||
tit_riga = TRUE;
|
||||
}
|
||||
|
||||
if (!controlla_valore(ci,99,2))
|
||||
{
|
||||
errore = TRUE;
|
||||
TString app;
|
||||
if (prima)
|
||||
{
|
||||
stampa.add(" ");
|
||||
stampa.add("Righe iva");
|
||||
stampa.add(" ");
|
||||
prima = FALSE;
|
||||
}
|
||||
if (tit_riga)
|
||||
app << "@r Rilevato un codice IVA composto da 3 o piu' cifre";
|
||||
else
|
||||
{
|
||||
app.format("%5s%03d", (const char*)"@b - ", nr);
|
||||
app << " " << "@rRilevato un codice IVA composto da 3 o piu' cifre";
|
||||
}
|
||||
stampa.add(app);
|
||||
tit_riga = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (errore)
|
||||
{
|
||||
TString app;
|
||||
|
||||
if (intesta)
|
||||
{
|
||||
setta_intestazione(file);
|
||||
intesta = FALSE;
|
||||
}
|
||||
|
||||
app << "@b- Registrazione numero " << nreg;
|
||||
row.put(app,0);
|
||||
printer().print(row);
|
||||
row.reset();
|
||||
|
||||
long items = stampa.items();
|
||||
|
||||
for (int i = 0; i < items; i++)
|
||||
{
|
||||
str = stampa.row(i);
|
||||
row.put(str,0);
|
||||
printer().print(row);
|
||||
row.reset();
|
||||
}
|
||||
|
||||
row.put(" ",0);
|
||||
printer().print(row);
|
||||
row.reset();
|
||||
|
||||
errore = FALSE;
|
||||
salto = TRUE;
|
||||
_risposta = 1;
|
||||
}
|
||||
stampa.destroy();
|
||||
}
|
||||
if (salto)
|
||||
printer().formfeed();
|
||||
*/
|
||||
}
|
||||
|
||||
void TLista_archivi::setta_intestazione(char sigla)
|
||||
|
Loading…
x
Reference in New Issue
Block a user