Cambiata l'implementazione, senza usare i TRecfield
git-svn-id: svn://10.65.10.50/trunk@3878 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
63d8921469
commit
3e56b5a648
@ -35,23 +35,24 @@ bool TAgg_codes::calcola_codes()
|
|||||||
{
|
{
|
||||||
TLocalisamfile& mov = get_mov();
|
TLocalisamfile& mov = get_mov();
|
||||||
TEsercizi_contabili esercizi;
|
TEsercizi_contabili esercizi;
|
||||||
TRecfield datacomp(mov.curr(), "DATACOMP");
|
TDate data;
|
||||||
TRecfield annoes(mov.curr(), "ANNOES");
|
long modified_recs=0L;
|
||||||
|
|
||||||
long nrecs = (long) mov.eod();
|
long nrecs = (long) mov.eod();
|
||||||
TProgind p(nrecs, "Aggiornamento in corso...", TRUE, TRUE, 50);
|
TProgind p(nrecs, "Aggiornamento in corso...", TRUE, TRUE, 100);
|
||||||
|
|
||||||
for (mov.first(); !mov.eof(); mov.next())
|
for (mov.first(); !mov.eof(); mov.next())
|
||||||
{
|
{
|
||||||
p.addstatus(1);
|
p.addstatus(1);
|
||||||
TDate data = (TDate) datacomp;
|
data=mov.get_date(MOV_DATACOMP);
|
||||||
int codes = atoi(annoes);
|
const int codes = mov.get_int(MOV_ANNOES);
|
||||||
int newcodes = esercizi.date2esc(data);
|
const int newcodes = esercizi.date2esc(data);
|
||||||
if (codes != newcodes)
|
if (codes != newcodes)
|
||||||
{
|
{
|
||||||
annoes = newcodes;
|
mov.put(MOV_ANNOES,newcodes);
|
||||||
mov.rewrite();
|
mov.rewrite();
|
||||||
|
modified_recs++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return message_box("Aggiornamento codice esercizio completata");
|
return message_box("Aggiornamento codice esercizio completata. Modificati %ld movimenti.",modified_recs);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user