diff --git a/sc/sc2600.cpp b/sc/sc2600.cpp index 5eebbffe9..e2bac37f3 100755 --- a/sc/sc2600.cpp +++ b/sc/sc2600.cpp @@ -37,7 +37,7 @@ TPRSC_recordset::TPRSC_recordset(const TString_array & colnames) : TAS400_record /////////////////////////////////////////////////////////// #define NUMERO_FASCE 9 -#define LIMITI {0, 30, 60, 90, 120, 150, 180, 210, 240, 270} +// #define LIMITI {0, 30, 60, 90, 120, 150, 180, 210, 240, 270} enum tipo_st {clienti=0, fornitori=1}; @@ -111,6 +111,7 @@ class TProspettoScadenze : public TPrintapp static TString _last_game; static bool fil_function(const TRelation *); TString_array _colnames; + int _limiti[NUMERO_FASCE]; public: virtual bool preprocess_page(int file, int counter); @@ -514,11 +515,18 @@ bool TProspettoScadenze::open_print() _s_date.add(new TDate); _ns_date.add(new TDate); } - int limiti[NUMERO_FASCE + 1] = LIMITI; for (int j = 0; j <= _sfasce; j++) - (TDate &)_s_date[j] = _limscad - (const long) limiti[j]; + { + TDate & d = (TDate &)_s_date[j]; + d = _limscad; + d.addmonth(-_limiti[j]); + } for (int k = 0; k <= _nsfasce; k++) - (TDate &)_ns_date[k] = _limscad + (const long) limiti[k]; + { + TDate & d = (TDate &)_ns_date[k]; + d = _limscad; + d.addmonth(_limiti[k]); + } _anno.cut(0);_numdoc.cut(0);_protiva.cut(0);_datadoc.cut(0); _codval.cut(0);_cod.cut(0); _des.cut(0); _cod_pre.cut(0); for (int it=0; it < _t.items(); it++) @@ -573,17 +581,17 @@ bool TProspettoScadenze::open_print() _colnames.destroy(); if (_sinfasce) { - _colnames.add(format("Scaduto > %3d gg", limiti[_sfasce])); + _colnames.add(format("Scaduto > %3d gg", _limiti[_sfasce] * 30)); for (int i = _sfasce; i > 0; i--) - _colnames.add(format("Scaduto <= %3d gg", limiti[i])); + _colnames.add(format("Scaduto <= %3d gg", _limiti[i] * 30)); } else _colnames.add("Scaduto"); if (_nsinfasce) { for (int i = 1; i <= _nsfasce; i++) - _colnames.add(format("A Scadere <= %3d gg", limiti[i])); - _colnames.add(format("A Scadere > %3d gg", limiti[_nsfasce])); + _colnames.add(format("A Scadere <= %3d gg", _limiti[i] * 30)); + _colnames.add(format("A Scadere > %3d gg", _limiti[_nsfasce] * 30)); } else _colnames.add("A Scadere"); @@ -710,6 +718,12 @@ bool TProspettoScadenze::set_print(int) KEY k = _m->run(); _excel = k != K_ENTER; print = k != K_QUIT; + int nmesi = _m->get_int(F_NMESI); + + if (nmesi == 0) + nmesi = 1; + for (int i = 0; i <= NUMERO_FASCE; i++) + _limiti[i] = i * nmesi; _start = true; } _stvaluta = _m->get_bool(F_VALUTA); @@ -968,17 +982,16 @@ void TProspettoScadenze::print_header() meno.fill('-', last_column); set_header(soh++,(const char *)meno); set_header(soh,"CODICE@8gC O G N O M E E N O M E "); - int limiti[NUMERO_FASCE + 1] = LIMITI; int pos = 40; rw.cut(0); if (_sinfasce) { - rw << format("@%dg >%3d gg", pos, limiti[_sfasce]); + rw << format("@%dg >%3d gg", pos, _limiti[_sfasce] * 30); pos += 11; for (int i = _sfasce; i > 0; i--) { - rw << format("@%dg <= %3d gg", pos, limiti[i] ); + rw << format("@%dg <= %3d gg", pos, _limiti[i] * 30); pos += 11; } set_header(soh, format("@%dg%s", 40+((pos-40)/2), "SCADUTO")); @@ -994,10 +1007,10 @@ void TProspettoScadenze::print_header() { for (int i = 1; i <= _nsfasce; i++) { - rw << format("@%dg <= %3d gg", pos, limiti[i]); + rw << format("@%dg <= %3d gg", pos, _limiti[i] * 30); pos = pos + 11; } - rw << format("@%dg >%3d gg", pos, limiti[_nsfasce]); + rw << format("@%dg >%3d gg", pos, _limiti[_nsfasce] * 30); pos = pos + 11; set_header(soh, format("@%dg%s", pos_ascad+((pos-pos_ascad)/2)-5, "A SCADERE")); } diff --git a/sc/sc2600.h b/sc/sc2600.h index 442ec4582..92af91e16 100755 --- a/sc/sc2600.h +++ b/sc/sc2600.h @@ -11,3 +11,4 @@ #define F_SCADFASCE 202 #define F_ASCADINFASCE 203 #define F_ASCADFASCE 204 +#define F_NMESI 205 diff --git a/sc/sc2600a.uml b/sc/sc2600a.uml index 881519877..9d1b7a67f 100755 --- a/sc/sc2600a.uml +++ b/sc/sc2600a.uml @@ -185,48 +185,35 @@ BEGIN FLAGS "D" END +NUMBER F_NMESI 2 +BEGIN + PROMPT 2 16 "Mesi per fascia " +END + BOOLEAN F_SCADINFASCE BEGIN - PROMPT 2 16 "Scaduto suddiviso in fasce" + PROMPT 2 17 "Scaduto suddiviso in fasce" HELP "Selezionare se si vuole la stampa scaduto suddiviso in fasce" MESSAGE TRUE ENABLE,F_SCADFASCE MESSAGE FALSE RESET,F_SCADFASCE|DISABLE,F_SCADFASCE END -LISTBOX F_SCADFASCE 3 +NUMBER F_SCADFASCE 1 BEGIN - PROMPT 35 16 "Fino alla fascia " - ITEM "0|0" - ITEM "1|30" - ITEM "2|60" - ITEM "3|90" - ITEM "4|120" - ITEM "5|150" - ITEM "6|180" - ITEM "7|210" - ITEM "8|240" + PROMPT 35 17 "Fino alla fascia " END BOOLEAN F_ASCADINFASCE BEGIN - PROMPT 2 17 "A scadere suddiviso in fasce" + PROMPT 2 18 "A scadere suddiviso in fasce" HELP "Selezionare se si vuole la stampa a scadere suddiviso in fasce" MESSAGE TRUE ENABLE,F_ASCADFASCE MESSAGE FALSE RESET,F_ASCADFASCE|DISABLE,F_ASCADFASCE END -LISTBOX F_ASCADFASCE 3 +NUMBER F_ASCADFASCE 1 BEGIN - PROMPT 35 17 "Fino alla fascia " - ITEM "0|0" - ITEM "1|30" - ITEM "2|60" - ITEM "3|90" - ITEM "4|120" - ITEM "5|150" - ITEM "6|180" - ITEM "7|210" - ITEM "8|240" + PROMPT 35 18 "Fino alla fascia " NUM_EXPR {#F_SCADFASCE+#F_ASCADFASCE < 10} WARNING "E' possibile selezionare massimo 9 fasce in totale" END