diff --git a/cm/cm0100.cpp b/cm/cm0100.cpp index aa78f4de4..216441b8c 100755 --- a/cm/cm0100.cpp +++ b/cm/cm0100.cpp @@ -21,8 +21,8 @@ public: void set_testata() { set_header(1,TRUE); } TPrint_section& get_body() { return section('B', odd_page); } TPrint_section& get_section(char s, pagetype pos) { return section(s, pos); } - TForm_contixcdc(); + TForm_contixcdc(); virtual ~TForm_contixcdc(); }; @@ -183,6 +183,7 @@ protected: void print_header_cms(); void print_footer_fsc(); void print_header_fsc(); + void print_footer_last(); void set_intestazione(); void fill_importo(const TImporto& imp, short id_imp, short id_sez); void fill_body(const TTotali& tot); //riempie il campo body con tutti i totali @@ -251,11 +252,10 @@ void TContixCdc::print_footer_gruppo() key.format("%d|%d", _oldgruppo, _oldconto); TString tmp; const TRectype& pcon = cache().get(LF_PCON, key); - tmp.format("TOTALE %d %d %s", _oldgruppo, _oldconto, (const char*) pcon.get(PCN_DESCR)); set_field(FR_GRUPPO, _oldgruppo); set_field(FR_CONTO, _oldconto); set_field(FR_SOTTOC, ""); - set_field(FR_D_SOTTOC, tmp); + set_field(FR_D_SOTTOC, pcon.get(PCN_DESCR)); fill_body(_t_gruppo); print_body(); } @@ -299,6 +299,23 @@ void TContixCdc::print_footer_fsc() _headerfsc = TRUE; } +void TContixCdc::print_footer_last() +{ + TPrinter& pr = printer(); + TPrint_section& f = _form->get_section('F', last_page); + if (f.fields() > 0) + { + f.update(); + if (f.height() > pr.rows_left()) + pr.formfeed(); + + pr.footerlen(f.height()); + for (word i = 0; i < f.height(); i++) + pr.setfooterline(i, f.row(i)); + } + pr.formfeed(); +} + void TContixCdc::print_header_cms() { _form->find_field('H', odd_page, FR_CMS).set(_oldcms); @@ -324,6 +341,9 @@ void TContixCdc::set_intestazione() _form->find_field('H', first_page, FR_ACDC).set(_mask->get(F_ACDC)); _form->find_field('H', first_page, FR_AFSC).set(_mask->get(F_AFSC)); _form->set_testata(); + + printer().footerlen(0); + printer().resetfooter(); } void TContixCdc::print_body() @@ -522,7 +542,7 @@ void TContixCdc::main_loop() if (ctrlfsc) print_footer_fsc(); print_footer_cms(); - printer().formfeed(); + print_footer_last(); } printer().close(); }