diff --git a/cg/cg1500.cpp b/cg/cg1500.cpp index f8c84e9eb..04907d031 100755 --- a/cg/cg1500.cpp +++ b/cg/cg1500.cpp @@ -2275,9 +2275,11 @@ void CG1500_application::leggi_clifo(const TArray& gccf) saldi.put(SLD_CONTO, c); saldi.put(SLD_SOTTOCONTO, codcf); if (saldi.read() != NOERR) - if (_tipo_stampa1 == 1) //bilancio per data limite - continue; - else if (_stampac == 2) //se sono richiesti i conti movimentati + { + //if (_tipo_stampa1 == 1) //bilancio per data limite + // continue; + //else + if (_stampac == 2) //se sono richiesti i conti movimentati { //esco, se no... _indbil = cerca_indbil(g,c); if (_indbil == 1 || _indbil == 2 || _indbil == 5) @@ -2292,7 +2294,7 @@ void CG1500_application::leggi_clifo(const TArray& gccf) continue; } } - + } if ( (((_cp != -1) && (c != _cp)) || ((_gp != -1) && (g != _gp))) && esiste_sc ) { @@ -2327,10 +2329,15 @@ void CG1500_application::leggi_clifo(const TArray& gccf) _indbil = cerca_indbil(g,c); movimentato = calcola(g,c,codcf); if (_stampa_mov_prov != 3) - if (!movimentato && _stampac!=1) + if (!movimentato /* && _stampac!=1 */) if (_indbil == 1 || _indbil == 2 || _indbil == 5) - if (_annoes != 0) //cioe' se sto ragionando per competenza + if (_annoes != 0) //cioe' se sto ragionando per competenza + { saldo_iniziale = sld.saldofin_esprec(_annoes,g,c,codcf); + if (saldo_iniziale > ZERO) + _saldo_ini_dare = saldo_iniziale; + else _saldo_ini_avere = -saldo_iniziale; + } if (movimentato) { @@ -2365,7 +2372,7 @@ void CG1500_application::leggi_clifo(const TArray& gccf) } //fine modifica del 19/06/95 //movimentato = calcola(g,c,codcf); - if (movimentato || _stampac != 1) + if (movimentato || _stampac != 1 || saldo_iniziale != ZERO) { if (_datada == _dataini) saldo_finale = saldo_iniziale+_mov_periodo_dare-_mov_periodo_avere; @@ -2392,14 +2399,14 @@ void CG1500_application::leggi_clifo(const TArray& gccf) movimentato = sld.ultima_immissione_verifica(anno,g,c,codcf,_indbil,_stampa_mov_prov); if (_stampa_mov_prov != 3) - if (!movimentato && _stampac!=1) + if (!movimentato /* && _stampac!=1 */ ) if (_indbil == 1 || _indbil == 2 || _indbil == 5) saldo_iniziale = sld.saldofin_esprec(anno,g,c,codcf,FALSE,TRUE); if (movimentato) saldo_iniziale = sld.saldoini(); - if (movimentato || _stampac != 1) + if (movimentato || _stampac != 1 || saldo_iniziale != ZERO) { _mov_periodo_dare = sld.prgdare(); _mov_periodo_avere = sld.prgavere(); @@ -2412,7 +2419,7 @@ void CG1500_application::leggi_clifo(const TArray& gccf) // if (_stampac == 2) // continue; } - if (movimentato || _stampac != 1) + if (movimentato || _stampac != 1 || saldo_iniziale != ZERO) if (!(saldo_finale == ZERO && _stampac == 2)) { esiste_sc = TRUE; @@ -2935,8 +2942,8 @@ void CG1500_application::set_page(int file, int counter) { set_row(r,"@1g%6ld",(const char*)_sottoconto); if ((_saldo_dare != ZERO) || (_saldo_avere != ZERO) || (_mov_dare != ZERO) || - (_mov_avere != ZERO) || (_saldofinale != ZERO)) - set_row(r," %s",(const char*)udata); + (_mov_avere != ZERO) || (_saldofinale != ZERO)) + set_row(r," %s",(const char*)udata); set_row(r,"@18g#a@49g!@50g%r@67g%r@82g!@83g%r@99g%r@114g!@115g%r",_d,&_saldo_dare, &_saldo_avere,&_mov_dare,&_mov_avere,&_saldofinale); if (_saldofinale != ZERO) @@ -2948,8 +2955,8 @@ void CG1500_application::set_page(int file, int counter) { set_row(r,"@1g%6ld",(const char*)_sottoconto); if ((_saldo_dare != ZERO) || (_saldo_avere != ZERO) || (_mov_dare != ZERO) || - (_mov_avere != ZERO) || (_saldofinale != ZERO)) - set_row(r," %s",(const char*)udata); + (_mov_avere != ZERO) || (_saldofinale != ZERO)) + set_row(r," %s",(const char*)udata); set_row(r,"@18g#a@49g!@50g%r@67g%r@82g!@83g%r@100g%r@115g!@116g%r@148g!",_d, &_saldo_dare,&_saldo_avere,&_mov_dare,&_mov_avere,&_saldofinale); if (_descr.len() > 30) @@ -2959,8 +2966,8 @@ void CG1500_application::set_page(int file, int counter) { set_row(r,"@1g%6ld",(const char*)_sottoconto); if ((_saldo_dare != ZERO) || (_saldo_avere != ZERO) || (_mov_dare != ZERO) || - (_mov_avere != ZERO) || (_saldofinale != ZERO)) - set_row(r," %s",(const char*)udata); + (_mov_avere != ZERO) || (_saldofinale != ZERO)) + set_row(r," %s",(const char*)udata); set_row(r,"@18g#a@49g!@50g%r@67g%r@82g!@83g%r@100g%r@115g!@132g%r@148g!", _d,&_saldo_dare,&_saldo_avere,&_mov_dare,&_mov_avere,&_saldofinale); if (_descr.len() > 30) @@ -3021,9 +3028,9 @@ void CG1500_application::set_page(int file, int counter) { set_row(r,"@1g%6ld",(const char*)_sottoconto_succ); if ((_saldoini_dare_succ != ZERO) || (_saldoini_avere_succ != ZERO) || - (_mov_dare_succ != ZERO) || (_mov_avere_succ != ZERO) || - (_saldofinale_succ != ZERO)) - set_row(r," %s",(const char*)udata); + (_mov_dare_succ != ZERO) || (_mov_avere_succ != ZERO) || + (_saldofinale_succ != ZERO)) + set_row(r," %s",(const char*)udata); set_row(r,"@18g#a@49g!@50g%r@67g%r@82g!@83g%r@99g%r@114g!@115g%r", _d,&_saldoini_dare_succ,&_saldoini_avere_succ, &_mov_dare_succ,&_mov_avere_succ,&_saldofinale_succ); @@ -3036,9 +3043,9 @@ void CG1500_application::set_page(int file, int counter) { set_row(r,"@1g%6ld",(const char*)_sottoconto_succ); if ((_saldoini_dare_succ != ZERO) || (_saldoini_avere_succ != ZERO) || - (_mov_dare_succ != ZERO) || (_mov_avere_succ != ZERO) || - (_saldofinale_succ != ZERO)) - set_row(r," %s",(const char*)udata); + (_mov_dare_succ != ZERO) || (_mov_avere_succ != ZERO) || + (_saldofinale_succ != ZERO)) + set_row(r," %s",(const char*)udata); set_row(r,"@18g#a@49g!@50g%r@67g%r@82g!@83g%r@100g%r@115g!@116g%r@148g!", _d,&_saldoini_dare_succ,&_saldoini_avere_succ, &_mov_dare_succ,&_mov_avere_succ,&_saldofinale_succ); @@ -3049,9 +3056,9 @@ void CG1500_application::set_page(int file, int counter) { set_row(r,"@1g%6ld",(const char*)_sottoconto_succ); if ((_saldoini_dare_succ != ZERO) || (_saldoini_avere_succ != ZERO) || - (_mov_dare_succ != ZERO) || (_mov_avere_succ != ZERO) || - (_saldofinale_succ != ZERO)) - set_row(r," %s",(const char*)udata); + (_mov_dare_succ != ZERO) || (_mov_avere_succ != ZERO) || + (_saldofinale_succ != ZERO)) + set_row(r," %s",(const char*)udata); set_row(r,"@18g#a@49g!@50g%r@67g%r@82g!@83g%r@100g%r@115g!@132g%r@148g!", _d,&_saldoini_dare_succ,&_saldoini_avere_succ, &_mov_dare_succ,&_mov_avere_succ,&_saldofinale_succ);