Patch level : 10.0

Files correlati     : sc2.exe sc21600a.msk
Ricompilazione Demo : [ ]
Commento            :
Corretta stampa previsione incassi per ragioni sociali contenenti @


git-svn-id: svn://10.65.10.50/branches/R_10_00@21879 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2011-04-04 14:43:13 +00:00
parent a355f6bb04
commit ba04455ae6
4 changed files with 79 additions and 30 deletions

View File

@ -134,7 +134,7 @@ public:
int calc_last_column();
void update_totals(bool what, real& esp, real s[NUMERO_FASCE], real ns[NUMERO_FASCE]);
void compute_unassigned(TPartita& p, const TDate & datalim);
void compute_all(TPartita& p, TBill& bill);
void compute_all(TPartita& p);
void print_real(TString& dest, const real& num);
void riempi_conti_mastro(const char cf);
void calcola_saldo();
@ -218,7 +218,7 @@ void TProspettoScadenze::compute_unassigned(TPartita& p, const TDate & datalim)
}
}
void TProspettoScadenze::compute_all(TPartita& p, TBill& bill)
void TProspettoScadenze::compute_all(TPartita& p)
{
real residuo;
real s[NUMERO_FASCE];
@ -419,7 +419,7 @@ bool TProspettoScadenze::preprocess_page(int file, int counter)
{
const TRectype& curr = current_cursor()->curr(file);
TBill bill(curr);
const TBill bill(curr);
const bool checked = _m->selected(bill);
if (!checked && !_end_printed) // Se non e' stato selezionato salta al prossimo record
@ -469,7 +469,7 @@ bool TProspettoScadenze::preprocess_page(int file, int counter)
_codval = (_stvaluta ? rp.get(PART_CODVAL): "");
if (_codval.empty()) _codval = " ";
// Now performing fulkrum...
compute_all(p, bill);
compute_all(p);
}
current_cursor()->repos(); // Very, very necessary...
}
@ -531,7 +531,7 @@ bool TProspettoScadenze::open_print()
_codval.cut(0);_cod.cut(0); _des.cut(0); _cod_pre.cut(0);
for (int it=0; it < _t.items(); it++)
{
TAssoc_array& aa = (TAssoc_array&) _t[it];
TAssoc_array& aa = (TAssoc_array&)_t[it];
aa.destroy(); // Totali lineari (singolo e generale)
}
@ -548,11 +548,23 @@ bool TProspettoScadenze::open_print()
case clienti:
case fornitori:
{
TString filter;
filter_from.put("TIPOC", _tipost == clienti ? "C" : "F");
filter_from.put(PART_TIPOCF, _tipost == clienti ? 'C' : 'F');
filter_to = filter_from;
if (_stvaluta)
if (_ordcod)
{
long cli_first = 0, cli_last = 0;
_m->get_clifo_range(cli_first, cli_last);
if (cli_first > 0)
filter_from.put(PART_SOTTOCONTO, cli_first);
if (cli_last >= cli_first)
filter_to.put(PART_SOTTOCONTO, cli_last);
}
TString filter;
if (_stvaluta)
{
if (is_firm_value(_codvalsel))
filter << "(CODVAL==\"\")||";
@ -680,11 +692,11 @@ bool TProspettoScadenze::user_create()
bool TProspettoScadenze::user_destroy()
{
if (_rel1) delete _rel1;
if (_rel2) delete _rel2;
if (_scad) delete _scad;
if (_pagsca) delete _pagsca;
if (_val) delete _val;
if (_rel1) delete _rel1;
if (_rel2) delete _rel2;
if (_scad) delete _scad;
if (_pagsca) delete _pagsca;
if (_val) delete _val;
if (_m) delete _m;
_t.destroy();
return true;
@ -826,7 +838,7 @@ void TProspettoScadenze::print_totali_rows(int nriga, bool what)
pos += 12;
const real diff = v._sl - (tot - v._es);
if (diff != ZERO)
if (!diff.is_zero())
{
print_real(value, diff);
rw << format("@%dg%12s", pos, (const char*) value);
@ -834,21 +846,25 @@ void TProspettoScadenze::print_totali_rows(int nriga, bool what)
if (rw.not_empty())
{
TString80 s;
if (!what)
{
TString s = _des_pre.left(25);
rw.insert(format("%6s@8g%-25s", (const char*) _cod_pre, (const char*) s));
// Raddoppia le @ in RAGSOC: morte alle TPrintapp
s = _des_pre.left(25);
for (int at = s.find('@'); at >= 0; at = s.find('@', at+2))
s.insert("@", at);
rw.insert(format("%6s", (const char*)_cod_pre));
}
else
{
TString meno;
const int last_column = calc_last_column();
meno.fill('-', last_column);
const TString meno(last_column, '-');
set_row(nriga++, meno);
rw.insert("@8gTOTALE GENERALE");
s = TR("TOTALE GENERALE");
}
set_row(nriga, rw);
rw << "@8g%-25s";
set_row(nriga, rw, (const char*)s);
}
}
xassoc.destroy(); // Distrugge il totale appena stampato
@ -947,13 +963,11 @@ void TProspettoScadenze::print_header()
reset_header ();
TLocalisamfile ditte(LF_NDITTE);
ditte.zero();
ditte.put(NDT_CODDITTA, firm);
ditte.read();
if (ditte.bad()) ditte.zero();
if (ditte.read() != NOERR)
ditte.zero();
TString s;
s = ditte.get(NDT_RAGSOC);
TString s = ditte.get(NDT_RAGSOC);
TString datas = _datas.string();
TString limop = _limop.string();
TString limscad = _limscad.string();
@ -1068,6 +1082,6 @@ TProspettoScadenze::TProspettoScadenze()
int sc2600(int argc, char** argv)
{
TProspettoScadenze app;
app.run(argc, argv, "Stampa Previsione Incassi/Pagamenti");
app.run(argc, argv, "Previsione Incassi/Pagamenti");
return 0;
}

View File

@ -13,7 +13,7 @@ END
ENDPAGE
PAGE "Stampa Previsione Incassi/PagamentI" 0 0 0 0
PAGE "Previsione Incassi/Pagamenti" 0 0 0 0
NUMBER F_CODDITTA 5
BEGIN

View File

@ -488,7 +488,7 @@ bool TSelection_mask::rsortcf_handler(TMask_field& f, KEY k)
void TSelection_mask::update_assoc()
{
_assoc.destroy();
_all_selected = FALSE;
_all_selected = false;
TCursor_sheet& cs = cur_sheet(); // Sheet di selezione (CLI/FO/PCON)
const long checked = cs.checked();
@ -542,3 +542,37 @@ bool TSelection_mask::selected(int g, int c, long s) const
}
return ok;
}
TRecnotype TSelection_mask::get_clifo_range(long& first, long& last) const
{
first = last = 0L;
TRecnotype items = 0;
if (get_who() >= 'C')
{
if (_all_selected)
{
TCursor& c = *cur_sheet().cursor(); // Sheet di selezione (CLI/FO/PCON)
items = c.items();
if (items > 0)
{
c = 0L; first = c.curr().get_long(CLI_CODCF);
c = c.items()-1L; last = c.curr().get_long(CLI_CODCF);
}
}
else
{
TAssoc_array& ass = (TAssoc_array&)_assoc; // Trick the compiler
FOR_EACH_ASSOC_OBJECT(ass, obj, key, item)
{
const TFixed_string gcs(key);
const long codcf = atol(gcs.right(6));
if (first == 0 || codcf < first)
first = codcf;
if (last == 0 || codcf > last)
last = codcf;
items++;
}
}
}
return items;
}

View File

@ -85,6 +85,7 @@ public:
bool selected(const TBill& c) const;
bool selected(int g, int c, long s) const;
TRecnotype get_clifo_range(long& first, long& last) const;
TSelection_mask(const char* name);
virtual ~TSelection_mask();