diff --git a/cg/cg4100.cpp b/cg/cg4100.cpp index 873b62add..29d1a3f6d 100755 --- a/cg/cg4100.cpp +++ b/cg/cg4100.cpp @@ -182,17 +182,10 @@ bool CG4100_App::sort_mov() if (!set_parms()) return FALSE; - TSystemisamfile mov(LF_MOV); - TSystemisamfile rmov(LF_RMOV); - TSystemisamfile rmoviva(LF_RMOVIVA); - - if (mov.open(_excllock) || rmov.open(_excllock) || - rmoviva.open(_excllock)) - { - warning_box("Gli archivi sono in uso. Operazione interrotta"); - return FALSE; - } - + TSystemisamfile mov(LF_MOV); mov.open(_excllock); + TSystemisamfile rmov(LF_RMOV); rmov.open(_excllock); + TSystemisamfile rmoviva(LF_RMOVIVA); rmoviva.open(_excllock); + mov.indexoff(); rmov.indexoff(); rmoviva.indexoff(); mov.first(); @@ -342,13 +335,15 @@ bool CG4100_App::sort_sal() if (!set_parms()) return FALSE; + TSystemisamfile saldi(LF_SALDI); saldi.open(_excllock); + TLocalisamfile rmov(LF_RMOV); + TLocalisamfile causali(LF_CAUSALI); + TLocalisamfile mov(LF_MOV); + TSaldo_agg sal; + FILE* fp = fopen ("__sal__.sav","w"); fclose(fp); - TLocalisamfile rmov(LF_RMOV); - TLocalisamfile mov(LF_MOV); - TLocalisamfile causali(LF_CAUSALI); - TSaldo_agg sal; int gruppo, conto; const int year = atoi(_year); long oldnumreg = 0L, sottoconto; @@ -423,6 +418,7 @@ bool CG4100_App::sort_sal() sal.registra(); remove("__sal__.sav"); + saldi.close(); return TRUE; }