Patch level : 12.0 332
Files correlati : sc2.exe L'ultima colonna dell' a scadere non viene mai riempita git-svn-id: svn://10.65.10.50/branches/R_10_00@23522 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
98f08fd845
commit
64c4ff6050
@ -44,8 +44,8 @@ enum tipo_st {clienti=0, fornitori=1};
|
|||||||
class TLineTotal : public TObject //Oggetto di base per i TAssoc_array dei totali
|
class TLineTotal : public TObject //Oggetto di base per i TAssoc_array dei totali
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
real _s[NUMERO_FASCE];// Scaglioni scaduto
|
real _s[NUMERO_FASCE + 1];// Scaglioni scaduto
|
||||||
real _ns[NUMERO_FASCE];// Scaglioni a scadere
|
real _ns[NUMERO_FASCE + 1];// Scaglioni a scadere
|
||||||
real _es; // esposto
|
real _es; // esposto
|
||||||
real _sl; // saldo
|
real _sl; // saldo
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ public:
|
|||||||
|
|
||||||
TLineTotal & TLineTotal::copy(const TLineTotal & l)
|
TLineTotal & TLineTotal::copy(const TLineTotal & l)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < NUMERO_FASCE; i++)
|
for (int i = 0; i <= NUMERO_FASCE; i++)
|
||||||
{
|
{
|
||||||
_s[i] = l._s[i];
|
_s[i] = l._s[i];
|
||||||
_ns[i] = l._ns[i];
|
_ns[i] = l._ns[i];
|
||||||
@ -70,7 +70,7 @@ TLineTotal & TLineTotal::copy(const TLineTotal & l)
|
|||||||
|
|
||||||
void TLineTotal::zero()
|
void TLineTotal::zero()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < NUMERO_FASCE; i++)
|
for (int i = 0; i <= NUMERO_FASCE; i++)
|
||||||
{
|
{
|
||||||
_s[i] = ZERO;
|
_s[i] = ZERO;
|
||||||
_ns[i] = ZERO;
|
_ns[i] = ZERO;
|
||||||
@ -132,7 +132,7 @@ public:
|
|||||||
void print_header();
|
void print_header();
|
||||||
|
|
||||||
int calc_last_column();
|
int calc_last_column();
|
||||||
void update_totals(bool what, real& esp, real s[NUMERO_FASCE], real ns[NUMERO_FASCE]);
|
void update_totals(bool what, real& esp, real s[NUMERO_FASCE + 1], real ns[NUMERO_FASCE + 1]);
|
||||||
void compute_unassigned(TPartita& p, const TDate & datalim);
|
void compute_unassigned(TPartita& p, const TDate & datalim);
|
||||||
void compute_all(TPartita& p);
|
void compute_all(TPartita& p);
|
||||||
void print_real(TString& dest, const real& num);
|
void print_real(TString& dest, const real& num);
|
||||||
@ -171,7 +171,7 @@ bool fil_function(const TRelation *r)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TProspettoScadenze::update_totals(bool what, real& esp,
|
void TProspettoScadenze::update_totals(bool what, real& esp,
|
||||||
real s[NUMERO_FASCE], real ns[NUMERO_FASCE])
|
real s[NUMERO_FASCE + 1], real ns[NUMERO_FASCE + 1])
|
||||||
{
|
{
|
||||||
TAssoc_array& a = (TAssoc_array&) _t[what];
|
TAssoc_array& a = (TAssoc_array&) _t[what];
|
||||||
TLineTotal *ll = (TLineTotal *) a.objptr(_codval);
|
TLineTotal *ll = (TLineTotal *) a.objptr(_codval);
|
||||||
@ -180,7 +180,7 @@ void TProspettoScadenze::update_totals(bool what, real& esp,
|
|||||||
ll = new TLineTotal;
|
ll = new TLineTotal;
|
||||||
a.add(_codval, ll);
|
a.add(_codval, ll);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < NUMERO_FASCE; i++)
|
for (int i = 0; i <= NUMERO_FASCE; i++)
|
||||||
{
|
{
|
||||||
ll->_s[i] += s[i];
|
ll->_s[i] += s[i];
|
||||||
ll->_ns[i] += ns[i];
|
ll->_ns[i] += ns[i];
|
||||||
@ -221,8 +221,8 @@ void TProspettoScadenze::compute_unassigned(TPartita& p, const TDate & datalim)
|
|||||||
void TProspettoScadenze::compute_all(TPartita& p)
|
void TProspettoScadenze::compute_all(TPartita& p)
|
||||||
{
|
{
|
||||||
real residuo;
|
real residuo;
|
||||||
real s[NUMERO_FASCE];
|
real s[NUMERO_FASCE + 1];
|
||||||
real ns[NUMERO_FASCE];
|
real ns[NUMERO_FASCE + 1];
|
||||||
real res_pagati;
|
real res_pagati;
|
||||||
real esposto;
|
real esposto;
|
||||||
|
|
||||||
@ -333,15 +333,18 @@ void TProspettoScadenze::compute_all(TPartita& p)
|
|||||||
{
|
{
|
||||||
if (_nsinfasce)
|
if (_nsinfasce)
|
||||||
{
|
{
|
||||||
for (int i = _nsfasce - 1; i >= 0; i--)
|
bool found = false;
|
||||||
|
|
||||||
|
for (int i = 0 ; !found && i < _nsfasce; i++)
|
||||||
{
|
{
|
||||||
const TDate & limdate = (TDate&)_ns_date[i];
|
const TDate & limdate = (TDate&)_ns_date[i];
|
||||||
if (limdate.ok() && d > limdate)
|
|
||||||
{
|
found = d <= limdate;
|
||||||
|
if (found)
|
||||||
ns[i] += res;
|
ns[i] += res;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if (!found)
|
||||||
|
ns[_nsfasce] += res;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ns[0] += res;
|
ns[0] += res;
|
||||||
@ -350,15 +353,18 @@ void TProspettoScadenze::compute_all(TPartita& p)
|
|||||||
{
|
{
|
||||||
if (_sinfasce)
|
if (_sinfasce)
|
||||||
{
|
{
|
||||||
for (int i = _sfasce - 1; i >= 0; i--)
|
bool found = false;
|
||||||
|
|
||||||
|
for (int i = 0; !found && i <= _sfasce; i++)
|
||||||
{
|
{
|
||||||
const TDate & limdate = (TDate&)_s_date[i];
|
const TDate & limdate = (TDate&)_s_date[i];
|
||||||
if (limdate.ok() && d <= limdate)
|
|
||||||
{
|
found = d >= limdate;
|
||||||
|
if (found)
|
||||||
s[i] += res;
|
s[i] += res;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if (!found)
|
||||||
|
s[_sfasce] += res;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
s[0] += res;
|
s[0] += res;
|
||||||
@ -515,13 +521,13 @@ bool TProspettoScadenze::open_print()
|
|||||||
_s_date.add(new TDate);
|
_s_date.add(new TDate);
|
||||||
_ns_date.add(new TDate);
|
_ns_date.add(new TDate);
|
||||||
}
|
}
|
||||||
for (int j = 0; j <= _sfasce; j++)
|
for (int j = 0; j < _sfasce; j++)
|
||||||
{
|
{
|
||||||
TDate & d = (TDate &)_s_date[j];
|
TDate & d = (TDate &)_s_date[j];
|
||||||
d = _limscad;
|
d = _limscad;
|
||||||
d.addmonth(-_limiti[j]);
|
d.addmonth(-_limiti[j]);
|
||||||
}
|
}
|
||||||
for (int k = 0; k <= _nsfasce; k++)
|
for (int k = 0; k < _nsfasce; k++)
|
||||||
{
|
{
|
||||||
TDate & d = (TDate &)_ns_date[k];
|
TDate & d = (TDate &)_ns_date[k];
|
||||||
d = _limscad;
|
d = _limscad;
|
||||||
@ -593,17 +599,17 @@ bool TProspettoScadenze::open_print()
|
|||||||
_colnames.destroy();
|
_colnames.destroy();
|
||||||
if (_sinfasce)
|
if (_sinfasce)
|
||||||
{
|
{
|
||||||
_colnames.add(format("Scaduto > %3d gg", _limiti[_sfasce] * 30));
|
_colnames.add(format("Scaduto > %3d gg", _limiti[_sfasce - 1] * 30));
|
||||||
for (int i = _sfasce; i > 0; i--)
|
for (int i = _sfasce - 1; i >= 0; i--)
|
||||||
_colnames.add(format("Scaduto <= %3d gg", _limiti[i] * 30));
|
_colnames.add(format("Scaduto <= %3d gg", _limiti[i] * 30));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_colnames.add("Scaduto");
|
_colnames.add("Scaduto");
|
||||||
if (_nsinfasce)
|
if (_nsinfasce)
|
||||||
{
|
{
|
||||||
for (int i = 1; i <= _nsfasce; i++)
|
for (int i = 0; i < _nsfasce; i++)
|
||||||
_colnames.add(format("A Scadere <= %3d gg", _limiti[i] * 30));
|
_colnames.add(format("A Scadere <= %3d gg", _limiti[i] * 30));
|
||||||
_colnames.add(format("A Scadere > %3d gg", _limiti[_nsfasce] * 30));
|
_colnames.add(format("A Scadere > %3d gg", _limiti[_nsfasce - 1] * 30));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_colnames.add("A Scadere");
|
_colnames.add("A Scadere");
|
||||||
@ -734,8 +740,8 @@ bool TProspettoScadenze::set_print(int)
|
|||||||
|
|
||||||
if (nmesi == 0)
|
if (nmesi == 0)
|
||||||
nmesi = 1;
|
nmesi = 1;
|
||||||
for (int i = 0; i <= NUMERO_FASCE; i++)
|
for (int i = 0; i < NUMERO_FASCE; i++)
|
||||||
_limiti[i] = i * nmesi;
|
_limiti[i] = (i + 1) * nmesi;
|
||||||
_start = true;
|
_start = true;
|
||||||
}
|
}
|
||||||
_stvaluta = _m->get_bool(F_VALUTA);
|
_stvaluta = _m->get_bool(F_VALUTA);
|
||||||
@ -922,7 +928,7 @@ void TProspettoScadenze::export_totali_rows()
|
|||||||
|
|
||||||
if (_nsinfasce)
|
if (_nsinfasce)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < _nsfasce; i++)
|
for (int i = 0; i <= _nsfasce; i++)
|
||||||
{
|
{
|
||||||
_recset->set(_colnames.row(col++), v._ns[i]);
|
_recset->set(_colnames.row(col++), v._ns[i]);
|
||||||
tot += v._ns[i];
|
tot += v._ns[i];
|
||||||
@ -1001,9 +1007,9 @@ void TProspettoScadenze::print_header()
|
|||||||
rw.cut(0);
|
rw.cut(0);
|
||||||
if (_sinfasce)
|
if (_sinfasce)
|
||||||
{
|
{
|
||||||
rw << format("@%dg >%3d gg", pos, _limiti[_sfasce] * 30);
|
rw << format("@%dg >%3d gg", pos, _limiti[_sfasce - 1] * 30);
|
||||||
pos += 12;
|
pos += 12;
|
||||||
for (int i = _sfasce; i > 0; i--)
|
for (int i = _sfasce - 1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
rw << format("@%dg <= %3d gg", pos, _limiti[i] * 30);
|
rw << format("@%dg <= %3d gg", pos, _limiti[i] * 30);
|
||||||
pos += 12;
|
pos += 12;
|
||||||
@ -1019,12 +1025,12 @@ void TProspettoScadenze::print_header()
|
|||||||
const int pos_ascad = pos;
|
const int pos_ascad = pos;
|
||||||
if (_nsinfasce)
|
if (_nsinfasce)
|
||||||
{
|
{
|
||||||
for (int i = 1; i <= _nsfasce; i++)
|
for (int i = 0; i < _nsfasce; i++)
|
||||||
{
|
{
|
||||||
rw << format("@%dg <= %3d gg", pos, _limiti[i] * 30);
|
rw << format("@%dg <= %3d gg", pos, _limiti[i] * 30);
|
||||||
pos = pos + 12;
|
pos = pos + 12;
|
||||||
}
|
}
|
||||||
rw << format("@%dg >%3d gg", pos, _limiti[_nsfasce] * 30);
|
rw << format("@%dg >%3d gg", pos, _limiti[_nsfasce - 1] * 30);
|
||||||
pos = pos + 12;
|
pos = pos + 12;
|
||||||
set_header(soh, format("@%dg%s", pos_ascad+((pos-pos_ascad)/2)-5, "A SCADERE"));
|
set_header(soh, format("@%dg%s", pos_ascad+((pos-pos_ascad)/2)-5, "A SCADERE"));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user