diff --git a/m770/77stqab.cpp b/m770/77stqab.cpp index 35963c8b8..b4a088759 100755 --- a/m770/77stqab.cpp +++ b/m770/77stqab.cpp @@ -162,7 +162,7 @@ int TQuadroA::calcola_firma() { TPrint_section& totali = section('F', last_page); TForm_item& signature = totali.find_field(2); - const int y = signature.y(); + const int y = signature.y()-1; TString cognome = signature.get(); if (cognome.len() > 30 && cognome[29] == ' ') @@ -172,8 +172,8 @@ int TQuadroA::calcola_firma() cognome << ' ' << nome; signature.set(cognome); - totali.row(y-1).reset(); - totali.row(y-1).put(cognome, signature.x()-1); + totali.row(y).reset(); + totali.row(y).put(cognome, signature.x()-1); } return y; @@ -255,16 +255,16 @@ bool TQuadroA::print(const long codditta, const long NumFis, const long NumNoFis int elementi = 0; // Numero di elementi stampati in questa pagina bool stampato_ultimo = FALSE; bool stampati_totali = FALSE; - + long persone = 0; int pos = 0; TDipendenti indice; if (quadro() == "A" || quadro() == "B") { - const int i = indice.fill(cur); - if (i > 0) - { + persone = indice.fill(cur); + if (persone > 0) + { if (usa_progind()) - progind()->addstatus(cur.items()-i); // Segna come elaborati tutti gli ignorati + progind()->addstatus(cur.items()-persone); // Segna come elaborati tutti gli ignorati cur = indice[0].pos(); } @@ -272,17 +272,19 @@ bool TQuadroA::print(const long codditta, const long NumFis, const long NumNoFis return FALSE; } else + { + persone = cur.items(); cur = 0; - + } while (!stampati_totali) { bool stampero_ultimo = (stampato_ultimo == FALSE); if (stampero_ultimo) { if (indice.items() > 0) // Usa indice alternativo - stampero_ultimo &= pos == indice.items()-1; + stampero_ultimo = (pos == persone-1); else // Usa indice del cursore - stampero_ultimo &= cur.pos() == cur.items()-1; + stampero_ultimo = (cur.pos() == persone-1); } if (!stampato_ultimo)