diff --git a/cg/cg1600.cpp b/cg/cg1600.cpp index 4856d2318..6800a3981 100755 --- a/cg/cg1600.cpp +++ b/cg/cg1600.cpp @@ -1580,6 +1580,17 @@ void CG1600_application::crea_sort_piano_conti_verifica() mov_avere = ZERO; app = ZERO; + //Senza questo controllo conto_prec quando viene letto un gruppo verrebbe + //settato a 0 (il conto non c'e'), quindi nella eventuale lettura del conto + //nel ciclo successivo, qualsiasi conto sarebbe diverso da quello precedente. + + if (g != gruppo_prec) + conto_prec = -1; + else + conto_prec = c; + + gruppo_prec = g; + if (classe_conto) { if (c != conto_prec && conto_prec != -1) @@ -1594,17 +1605,6 @@ void CG1600_application::crea_sort_piano_conti_verifica() } } - //Senza questo controllo conto_prec quando viene letto un gruppo verrebbe - //settato a 0 (il conto non c'e'), quindi nella eventuale lettura del conto - //nel ciclo successivo, qualsiasi conto sarebbe diverso da quello precedente. - - if (g != gruppo_prec) - conto_prec = -1; - else - conto_prec = c; - - gruppo_prec = g; - // Se si tratta di un conto e contiene la classe, allora lo passo al sort. // Gli eventuali sottoconti avranno la stessa classe. @@ -1747,11 +1747,14 @@ void CG1600_application::crea_sort_piano_conti_verifica() if (conto_dettagliato) riempi_record(sez_conto,let_conto,numr_conto,num_conto,g,c,s,saldo,ZERO,sld_prg_dare,sld_prg_avere,mov_dare,mov_avere,tmcf); - saldo_conto += saldo; - sld_prg_dare_conto += sld_prg_dare; - sld_prg_avere_conto += sld_prg_avere; - mov_dare_conto += mov_dare; - mov_avere_conto += mov_avere; + if (!(saldo == ZERO && _stampamov))//Se non deve stampare i conti con saldo a zero, non aggiornare il totale del conto + { + saldo_conto += saldo; + sld_prg_dare_conto += sld_prg_dare; + sld_prg_avere_conto += sld_prg_avere; + mov_dare_conto += mov_dare; + mov_avere_conto += mov_avere; + } } else { @@ -1914,11 +1917,14 @@ void CG1600_application::sottoc_clifo_verifica(int g,int c,int anno,char tipocf, if (stsottbil) riempi_record(sez_conto,let_conto,numr_conto,num_conto,g,c,s,saldo,ZERO,sld_prg_dare,sld_prg_avere,mov_dare,mov_avere,tipocf); - saldo_conto += saldo; - sld_prg_dare_conto += sld_prg_dare; - sld_prg_avere_conto += sld_prg_avere; - mov_dare_conto += mov_dare; - mov_avere_conto += mov_avere; + if (!(saldo == ZERO && _stampamov)) //Se non deve stampare i conti con saldo a zero, non aggiornare il totale del conto + { + saldo_conto += saldo; + sld_prg_dare_conto += sld_prg_dare; + sld_prg_avere_conto += sld_prg_avere; + mov_dare_conto += mov_dare; + mov_avere_conto += mov_avere; + } } if (items > 0) riempi_record(sez_conto,let_conto,numr_conto,num_conto,g,c,0,saldo_conto,ZERO,sld_prg_dare_conto,sld_prg_avere_conto,mov_dare_conto,mov_avere_conto,tipocf,stsottbil); @@ -3369,9 +3375,11 @@ void CG1600_application::stampa_totali_verifica() set_row (_i,"@8gTotale"); if (_num != 0) - { - set_row (_i,"@49g%r", &_tot_num_prg_d); - set_row (_i,"@65g%r", &_tot_num_prg_a); + { + if (_tot_num_prg_d != ZERO) + set_row (_i,"@49g%r", &_tot_num_prg_d); + if (_tot_num_prg_a != ZERO) + set_row (_i,"@65g%r", &_tot_num_prg_a); set_row (_i,"@82g%r", &_tot_num_mov_d); set_row (_i,"@98g%r", &_tot_num_mov_a); } @@ -3407,8 +3415,10 @@ void CG1600_application::stampa_totali_verifica() if (_num_tot == "20" || _num_tot == "21") { set_row (_i,"@4gTotale delle partite straordinarie"); - set_row (_i,"@49g%r", &_tot_parz_prg_d); - set_row (_i,"@65g%r", &_tot_parz_prg_a); + if (_tot_parz_prg_d != ZERO) + set_row (_i,"@49g%r", &_tot_parz_prg_d); + if (_tot_parz_prg_a != ZERO) + set_row (_i,"@65g%r", &_tot_parz_prg_a); set_row (_i,"@82g%r", &_tot_parz_mov_d); set_row (_i,"@98g%r", &_tot_parz_mov_a); _risimp_fatto = FALSE; @@ -3457,8 +3467,10 @@ void CG1600_application::stampa_totali_verifica() if (_num != 0) { - set_row (_i,"@49g%r", &_tot_num_prg_d); - set_row (_i,"@65g%r", &_tot_num_prg_a); + if (_tot_num_prg_d != ZERO) + set_row (_i,"@49g%r", &_tot_num_prg_d); + if (_tot_num_prg_a != ZERO) + set_row (_i,"@65g%r", &_tot_num_prg_a); set_row (_i,"@82g%r", &_tot_num_mov_d); set_row (_i,"@98g%r", &_tot_num_mov_a); } @@ -3492,8 +3504,10 @@ void CG1600_application::stampa_totali_verifica() if (numrom != "") { set_row (_i,"@8gTotale@15g%s", (const char*) numrom); - set_row (_i,"@49g%r", &_tot_numr_prg_d); - set_row (_i,"@65g%r", &_tot_numr_prg_a); + if (_tot_numr_prg_d != ZERO) + set_row (_i,"@49g%r", &_tot_numr_prg_d); + if (_tot_numr_prg_a != ZERO) + set_row (_i,"@65g%r", &_tot_numr_prg_a); set_row (_i,"@82g%r", &_tot_numr_mov_d); set_row (_i,"@98g%r", &_tot_numr_mov_a); } @@ -3548,8 +3562,10 @@ void CG1600_application::stampa_totali_verifica() if (_num != 0) { - set_row (_i,"@49g%r", &_tot_num_prg_d); - set_row (_i,"@65g%r", &_tot_num_prg_a); + if (_tot_num_prg_d != ZERO) + set_row (_i,"@49g%r", &_tot_num_prg_d); + if (_tot_num_prg_a != ZERO) + set_row (_i,"@65g%r", &_tot_num_prg_a); set_row (_i,"@82g%r", &_tot_num_mov_d); set_row (_i,"@98g%r", &_tot_num_mov_a); } @@ -3583,8 +3599,10 @@ void CG1600_application::stampa_totali_verifica() if (numrom != "") { set_row (_i,"@8gTotale@15g%s", (const char*) numrom); - set_row (_i,"@49g%r", &_tot_numr_prg_d); - set_row (_i,"@65g%r", &_tot_numr_prg_a); + if (_tot_numr_prg_d != ZERO) + set_row (_i,"@49g%r", &_tot_numr_prg_d); + if (_tot_numr_prg_a != ZERO) + set_row (_i,"@65g%r", &_tot_numr_prg_a); set_row (_i,"@82g%r", &_tot_numr_mov_d); set_row (_i,"@98g%r", &_tot_numr_mov_a); } @@ -3618,8 +3636,10 @@ void CG1600_application::stampa_totali_verifica() if (_sez_stamp == '9' && _let_stamp != 'E') { set_row (_i,"@8gTotale@15g%c@16g)", _let); - set_row (_i,"@49g%r", &_tot_let_prg_d); - set_row (_i,"@65g%r", &_tot_let_prg_a); + if (_tot_let_prg_d != ZERO) + set_row (_i,"@49g%r", &_tot_let_prg_d); + if (_tot_let_prg_a != ZERO) + set_row (_i,"@65g%r", &_tot_let_prg_a); set_row (_i,"@82g%r", &_tot_let_mov_d); set_row (_i,"@98g%r", &_tot_let_mov_a); } @@ -3627,8 +3647,10 @@ void CG1600_application::stampa_totali_verifica() if (_sez_stamp != '9') { set_row (_i,"@8gTotale@15g%c@16g)", _let); - set_row (_i,"@49g%r", &_tot_let_prg_d); - set_row (_i,"@65g%r", &_tot_let_prg_a); + if (_tot_let_prg_d != ZERO) + set_row (_i,"@49g%r", &_tot_let_prg_d); + if (_tot_let_prg_a != ZERO) + set_row (_i,"@65g%r", &_tot_let_prg_a); set_row (_i,"@82g%r", &_tot_let_mov_d); set_row (_i,"@98g%r", &_tot_let_mov_a); } @@ -4151,8 +4173,10 @@ bool CG1600_application::preprocess_stampa_verifica(int counter) } else { - set_row (_i,"@49g%r", &_tot_gen_prg_d); - set_row (_i,"@65g%r", &_tot_gen_prg_a); + if (_tot_gen_prg_d != ZERO) + set_row (_i,"@49g%r", &_tot_gen_prg_d); + if (_tot_gen_prg_a != ZERO) + set_row (_i,"@65g%r", &_tot_gen_prg_a); set_row (_i,"@82g%r", &_tot_gen_mov_d); set_row (_i,"@98g%r", &_tot_gen_mov_a); } @@ -4650,7 +4674,10 @@ void CG1600_application::setta_righe(const char * titolo) //set_row(_i++,"@15g)@18g%s", (const char*) descr_num); //_cont_num += 1; if (!_intera_struttura || (_intera_struttura && bil->gruppo[0] != 'Z')) + { _cont_gcs = 0; + _cont_numr= 1; + } } } if (bil->gruppo[0] != 'A') @@ -4662,7 +4689,8 @@ void CG1600_application::setta_righe(const char * titolo) _cont_gcs += 1; set_row (_i,"@18g%s", bil->gruppo); set_row (_i,"@22g%s", bil->conto); - set_row (_i,"@26g%s", bil->sottoc); + if (sottoc != 0) + set_row (_i,"@26g%s", bil->sottoc); set_row (_i,"@33g%s", (const char*) descr_sottoc); set_row (_i,"@84g%r", &_sale); if (_annoeserafr != 0 || _databilrafr != botime) @@ -4894,19 +4922,23 @@ void CG1600_application::setta_righe_verifica() _cont_gcs += 1; set_row (_i,"@0g%s", bil->gruppo); set_row (_i,"@4g%s", bil->conto); - set_row (_i,"@8g%s", bil->sottoc); + if (sottoc != 0) + set_row (_i,"@8g%s", bil->sottoc); //set_row (_i,"@15g%-.33s", (const char*) descr_sottoc); - set_row (_i,"@15g#a", _d); - + //set_row (_i,"@15g#a", _d); + num = "@15g%s"; + num2 = num; + setta_righe_descr_verifica(_d,num,num2); + _i--; if (_dataini == _data_ini_ese) { //modifica del 27/11/1995 if (_tipo_stampa == 2) //all'ultima immissione { real saldoini = _sld_prg_dare - _sld_prg_avere; - if (saldoini >= ZERO) + if (saldoini > ZERO) set_row(_i,"@49g%r", &saldoini); - else + else if (saldoini < ZERO) // Non stampare il saldo iniziale se == 0.0 { saldoini = -saldoini; set_row(_i,"@65g%r", &saldoini); @@ -4914,14 +4946,18 @@ void CG1600_application::setta_righe_verifica() } else if (_tipo_stampa == 1) //per date limiti { - set_row(_i,"@49g%r", &_sld_prg_dare); - set_row(_i,"@65g%r", &_sld_prg_avere); + if (_sld_prg_dare != ZERO) + set_row(_i,"@49g%r", &_sld_prg_dare); + if (_sld_prg_avere != ZERO) + set_row(_i,"@65g%r", &_sld_prg_avere); } //fine } else { + if (_sld_prg_dare != ZERO) set_row (_i,"@49g%r", &_sld_prg_dare); + if (_sld_prg_avere != ZERO) set_row (_i,"@65g%r", &_sld_prg_avere); } @@ -4974,9 +5010,9 @@ void CG1600_application::setta_righe_verifica() if (_tipo_stampa == 2) { real saldoini = _sld_prg_dare - _sld_prg_avere; - if (saldoini >= ZERO) + if (saldoini > ZERO) set_row(_i,"@49g%r", &saldoini); - else + else if (saldoini < ZERO) // non stampare il saldo iniziale se == 0.0 { saldoini = -saldoini; set_row(_i,"@65g%r", &saldoini); @@ -4984,15 +5020,19 @@ void CG1600_application::setta_righe_verifica() } else if (_tipo_stampa == 1) { - set_row(_i,"@49g%r", &_sld_prg_dare); - set_row(_i,"@65g%r", &_sld_prg_avere); + if (_sld_prg_dare != ZERO) + set_row(_i,"@49g%r", &_sld_prg_dare); + if (_sld_prg_avere != ZERO) + set_row(_i,"@65g%r", &_sld_prg_avere); } //fine } else { - set_row (_i,"@49g%r", &_sld_prg_dare); - set_row (_i,"@65g%r", &_sld_prg_avere); + if (_sld_prg_dare != ZERO) + set_row (_i,"@49g%r", &_sld_prg_dare); + if (_sld_prg_avere != ZERO) + set_row (_i,"@65g%r", &_sld_prg_avere); } set_row (_i,"@82g%r", &_mov_dare);