diff --git a/cg/cg3400.cpp b/cg/cg3400.cpp index d4a4536d7..6f2bdbc28 100755 --- a/cg/cg3400.cpp +++ b/cg/cg3400.cpp @@ -554,24 +554,32 @@ void CG3400_application::preprocess_footer() ap = TRUE; } - if (_cur->pos() < _cur->items()-1 && !_gia_settato_ariportare) - { - dt = _tot_dare_progr + _tot_dare_progr_ap; - at = _tot_avere_progr + _tot_avere_progr_ap; - dts = dt.string(REAL_PICTURE); - ats = at.string(REAL_PICTURE); + // + // Non stampo "A riportare" + // SE : + // 1. E' gia' stato stampato + // OPPURE + // 2. Sono sull'ultima riga + // + if (!_gia_settato_ariportare) + if (_cur->pos() < _cur->items()-1) + { + dt = _tot_dare_progr + _tot_dare_progr_ap; + at = _tot_avere_progr + _tot_avere_progr_ap; + dts = dt.string(REAL_PICTURE); + ats = at.string(REAL_PICTURE); - riga.format ("@b@%dg%s@%dg%c %s %c @%dg%s", - _stampa_width == 132 ? DARE132-STUMB : DARE198-STUMB, - _nuovo_mese ? "Totale progressivi generali " : "A riportare ", - _stampa_width == 132 ? DARE132-3 : DARE198, - 'D', - (const char *) dts, - 'A', - _stampa_width == 132 ? AVERE132 : AVERE198, - (const char *) ats); - set_footer (r++, (const char*) riga); - } + riga.format ("@b@%dg%s@%dg%c %s %c @%dg%s", + _stampa_width == 132 ? DARE132-STUMB : DARE198-STUMB, + _nuovo_mese ? "Totale progressivi generali " : "A riportare ", + _stampa_width == 132 ? DARE132-3 : DARE198, + 'D', + (const char *) dts, + 'A', + _stampa_width == 132 ? AVERE132 : AVERE198, + (const char *) ats); + set_footer (r++, (const char*) riga); + } } @@ -595,7 +603,8 @@ int CG3400_application::set_totali_pagina(int righe) } // SONO SULL'ULTIMO ???????????? SI O NO ???????????? - if (_cur->pos() >= _cur->items()-1) // se sono sull'ultimo + // if (_cur->pos() >= _cur->items()-1) // se sono sull'ultimo + if (_cur->pos() == _cur->items()-1) // se sono sull'ultimo { // I totali distinti tra anno precedente e corrente SOLO SE STAMPA DI PROVA if (!_stampa_definitiva) @@ -921,19 +930,14 @@ print_action CG3400_application::postprocess_page(int file, int counter) righe_iva_settate = setta_righe_valuta(righe_iva_settate); } - // FINITO = _cur->file(LF_MOV).eof() || _cur->pos() == _cur->items(); - - // if (!FINITO) { _cur->save_status(); ++(*_cur); _data_succ = _cur->file(LF_MOV).get_date(MOV_DATAREG); _mese_succ = _data_succ.month(); --(*_cur); _cur->restore_status(); - // } - if (_data_corr != _data_succ || _cur->pos() == _cur->items()) - // if (_data_corr != _data_succ || FINITO) + if (_data_corr != _data_succ || _cur->pos() == _cur->items()-1) { _nuovo_mese = (_mese_succ != _mese_corr); int righe = set_totali_giorno(_data_corr, righe_iva_settate); diff --git a/cg/cg4400.cpp b/cg/cg4400.cpp index f1d0b50f2..64d23addf 100755 --- a/cg/cg4400.cpp +++ b/cg/cg4400.cpp @@ -194,7 +194,7 @@ bool CG4400_application::look_reg(int i, int anno, TString& codlib, int m, const { TString16 cod_lib_un = _tabreg->get("S6"); TDate u_data = _tabreg->get_date("D3"); - TDate sca_vid = _tabreg->get_date("D0"); + TDate sca_vid = _tabreg->get_date("D1"); if (codlib != cod_lib_un) { if (_selected[i]) message_box("Ditta %ld: il codice libro unico del registro non e' uguale al codice libro unico indicato", ditta); @@ -234,13 +234,12 @@ bool CG4400_application::look_regs(int anno, TString& codlib, int m, int* umese, codtab = _tabreg->get("CODTAB"); a = atoi(codtab.mid(0,4)); if (a > anno) - //return FALSE; break; if (a == anno) if ( tipo == 1 || tipo == 2 ) //registro iva { TString16 cod_lib_un = _tabreg->get("S6"); - TDate sca_vid = _tabreg->get_date("D0"); + TDate sca_vid = _tabreg->get_date("D1"); TDate u_data = _tabreg->get_date("D3"); if (codlib != cod_lib_un) continue; @@ -297,8 +296,8 @@ bool CG4400_application::mask_libun (TMask_field& f, KEY k) if (!ok) { if (app()._selected[i]) f.message_box("Ditta %ld: il registro %s non soddisfa i parametri indicati", ditta, (const char*)cod); - if (app()._selected.last_one() == i) - break; + //if (app()._selected.last_one() == i) + // break; else continue; } @@ -312,16 +311,18 @@ bool CG4400_application::mask_libun (TMask_field& f, KEY k) else { ok = app().look_regs(anno,codlib,fino_a_mese,&mese,ditta,&can_print); - if ( app()._selected[i] && !ok ) + //if ( app()._selected[i] && !ok ) + if (!ok) { - if (!can_print) + if (!can_print) return FALSE; - f.message_box("Ditta %ld: nessun registro soddisfa i parametri indicati", ditta); + if ( app()._selected[i]) + f.message_box("Ditta %ld: nessun registro soddisfa i parametri indicati", ditta); continue; } } - if (app()._selected[i]) - last_mese = (last_mese < mese) ? last_mese : mese; + //if (app()._selected[i]) + last_mese = (last_mese < mese) ? last_mese : mese; } } app().set_firm(app().__firm); @@ -632,8 +633,6 @@ void CG4400_application::build_nomiditte(TProgind* pnd) //TApplication::set_firm(dt.get_long("CODDITTA")); if (!look_lia(dt.get_long("CODDITTA"))) good = FALSE; } - else continue; - _n_ditte++; TToken_string* d = new TToken_string(64); d->add(dt.get("CODDITTA")); @@ -701,8 +700,6 @@ bool CG4400_application::user_create() add_file(LF_MOV); add_file(LF_RMOVIVA); - printer().footerlen(5); - //set_real_picture(REAL_PICTURE); delete pnd; return TRUE; @@ -1751,7 +1748,7 @@ bool CG4400_application::compila_reg(const TMask& m) if (_tipo_reg == 1 || _tipo_reg == 2) //registro iva { cod_lib_un = _tabreg->get("S6"); - sca_vid = _tabreg->get_date("D0"); + sca_vid = _tabreg->get_date("D1"); if (_tipo_stampa != 1) _u_data = _tabreg->get_date ("D3"); if ( _tipo_stampa == 2 || _tipo_stampa == 4 ) @@ -2494,6 +2491,7 @@ bool CG4400_application::set_print(int n) m.field(F_SELECT).set(format("%ld",_selected.ones())); set_choice_limits(m); + printer().footerlen(5); set_real_picture("###.###.###.###"); while (ok = set_ditte(m)) @@ -2765,7 +2763,7 @@ bool CG4400_application::stampa_registri_IVA(const TMask& m) { _codreg = codtab.mid(4,3); cod_lib_un = _tabreg->get("S6"); - sca_vid = _tabreg->get_date("D0"); + sca_vid = _tabreg->get_date("D1"); if (_tipo_stampa != 1) _u_data = _tabreg->get_date("D3"); if (_tipo_stampa == 2 || _tipo_stampa == 4)