From a3418e10d405a7f57ca54686864ba46e43bd4f5d Mon Sep 17 00:00:00 2001 From: angelo Date: Thu, 18 Jan 1996 18:02:13 +0000 Subject: [PATCH] Corretto salto pagina, incolonnamento Dare/avere del saldo totale e sort per data scadenza/data pagamento. git-svn-id: svn://10.65.10.50/trunk@2468 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- sc/sc2100.cpp | 44 +++++++++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/sc/sc2100.cpp b/sc/sc2100.cpp index 699b702d3..737e220df 100755 --- a/sc/sc2100.cpp +++ b/sc/sc2100.cpp @@ -755,6 +755,8 @@ void TEC_form::print_total(int riga, const THash_object& o) TString_array prompt(MAXID); TPrint_section& foot = section('F'); + TPrint_section& body = section('B'); + TForm_item& bdesc = body.find_field(PEC_DESCR); // Sostituisce magic-names nei prompt TString s(80); @@ -767,6 +769,8 @@ void TEC_form::print_total(int riga, const THash_object& o) prompt.add(s, i); change_magic_footer(o, s); desc_field.set_prompt(s); + if (desc_field.x() <= 0) + desc_field.set_x(bdesc.x()); } } @@ -775,7 +779,6 @@ void TEC_form::print_total(int riga, const THash_object& o) TForm_item& dare = foot.find_field(PEC_DARE); TForm_item& avere = foot.find_field(PEC_AVERE); - TPrint_section& body = section('B'); if (dare.x() <= 0 || avere.x() <= 0) { TForm_item& bdare = body.find_field(PEC_DARE); @@ -785,15 +788,25 @@ void TEC_form::print_total(int riga, const THash_object& o) avere.set_x(bavere.x()); } - if (imp.sezione() == 'D') + char sez = imp.sezione(); + real num = imp.valore(); + if (sez=='D' && num<0) { - dare.set(imp.valore().string()); + num = abs(num); sez = 'A'; + } + if (sez=='A' && num<0) + { + num = abs(num); sez = 'D'; + } + if (sez == 'D') + { + dare.set(num.string()); avere.set(""); } else { dare.set(""); - avere.set(imp.valore().string()); + avere.set(num.string()); } TForm_item& scaduto = foot.find_field(PEC_SCADUTO); @@ -1016,6 +1029,7 @@ TEC_form::TEC_form(const TEC_mask& m, bool gesval) pr.footerlen(foot.height()); TForm_item& flags = find_field('H', last_page, PEC_FLAGS); + TToken_string f(flags.prompt()); _in_valuta = gesval && f.get_char(0) == 'X'; // Il profilo e' in valuta se c'e' il flag di valuta _fincatura = f.get_int(1); @@ -1028,6 +1042,10 @@ TEC_form::TEC_form(const TEC_mask& m, bool gesval) set_mode((bkg_mode)_fincatura); genera_fincatura(odd_page, first, last, horiz); } + TForm_item& uns = section('F').find_field(PEC_UNASSIGNED); + TForm_item& tuns = section('F').find_field(PEC_TUNASSIGNED); + if (uns.shown()) uns.hide(); + if (tuns.shown()) tuns.hide(); init_header(m); // Set fixed text @@ -1091,7 +1109,7 @@ public: TEC_form& form() { return *_form; } bool print_selected(); // print selected items - bool print_ec(); // print one item + int print_ec(); // print one item TStampaEC_application(); virtual ~TStampaEC_application() {} @@ -1127,11 +1145,15 @@ bool TStampaEC_application::print_selected() printer().formfeed(); fc = i; // Muove il cursore alla posizione corrente - const bool ok = print_ec(); - if (ok) + const int ret = print_ec(); + if (ret > 0) one_printed = TRUE; else - analfabeti++; + { + one_printed = FALSE; + if (ret < 0) + analfabeti++; + } } if (one_printed) @@ -1145,7 +1167,7 @@ bool TStampaEC_application::print_selected() return TRUE; } -bool TStampaEC_application::print_ec() +int TStampaEC_application::print_ec() { TEC_form& f = form(); @@ -1159,7 +1181,7 @@ bool TStampaEC_application::print_ec() ok = lincf == f.lingua(); if (!ok) // Cliente analfabeta - return FALSE; + return -1; f.azzera_totali(); // Azzera totali di fine pagina @@ -1216,7 +1238,7 @@ bool TStampaEC_application::print_ec() if (one_printed) f.ultima_pagina(); - return TRUE; + return one_printed ? 1 : 0; } ///////////////////////////////////////////////////////////