Patch level : 120.00 1412
Files correlati : sc2.exe Commento : Corretta stampa prospetto pagamenti
This commit is contained in:
parent
0b1a36ecd0
commit
a21fa09580
@ -154,7 +154,7 @@ void TProspettoScadenze::print_real(TString& dest, const real& num)
|
||||
if(!_m->get_bool(F_DECIMALI))
|
||||
elaCur = elaCur.sub(0, elaCur.find(","));
|
||||
dest = elaCur;
|
||||
dest.right_just(10);
|
||||
dest.right_just(12);
|
||||
}
|
||||
|
||||
bool fil_function(const TRelation *r)
|
||||
@ -407,10 +407,13 @@ void TProspettoScadenze::calcola_saldo(TAssoc_array * l)
|
||||
saldo.set_annoes(codes);
|
||||
const TDate dataini(e.esercizio(codes).inizio());
|
||||
saldo.data_limite_bilancio(Competenza, g, c, s, dataini, _limop, indbil_conto);
|
||||
if (_tipost == fornitori)
|
||||
ll->_sl -= saldo.saldo();
|
||||
else
|
||||
ll->_sl += saldo.saldo();
|
||||
if (!saldo.is_zero())
|
||||
{
|
||||
if (_tipost == fornitori)
|
||||
ll->_sl -= saldo.saldo();
|
||||
else
|
||||
ll->_sl += saldo.saldo();
|
||||
}
|
||||
}
|
||||
// aggiorno il totale generale
|
||||
TAssoc_array& at = (TAssoc_array&) _t[1];
|
||||
@ -807,7 +810,10 @@ void TProspettoScadenze::print_totali_rows(int nriga, bool what, TAssoc_array *
|
||||
// If what is 0 prints single total... else prints also general total
|
||||
{
|
||||
reset_print();
|
||||
TAssoc_array& xassoc = l == nullptr ? (TAssoc_array&) _t[what] : *l;
|
||||
|
||||
TAssoc_array& xassoc = l == nullptr ? (TAssoc_array&) _t[what] : *l;
|
||||
const int dec = _m->get_bool(F_DECIMALI) ? 2 : 0;
|
||||
|
||||
if (_cod_pre.blank())
|
||||
{
|
||||
xassoc.destroy();
|
||||
@ -818,6 +824,8 @@ void TProspettoScadenze::print_totali_rows(int nriga, bool what, TAssoc_array *
|
||||
|
||||
xassoc.get_keys(as);
|
||||
as.sort();
|
||||
if (!what && !_excel)
|
||||
calcola_saldo(l);
|
||||
for (int i=0; i < items; i++)
|
||||
{
|
||||
TString k(as.row(i)); // Chiave di ordinamento(valuta)
|
||||
@ -827,13 +835,12 @@ void TProspettoScadenze::print_totali_rows(int nriga, bool what, TAssoc_array *
|
||||
int pos = 49;
|
||||
TString rw(255);
|
||||
|
||||
if (!what && !_excel)
|
||||
calcola_saldo(l);
|
||||
rw = "";
|
||||
if (_sinfasce)
|
||||
{
|
||||
for (int i = _sfasce; i >= 0; i--)
|
||||
{
|
||||
v._s[i].round(dec);
|
||||
if (v._s[i] != ZERO)
|
||||
{
|
||||
print_real(value, v._s[i]);
|
||||
@ -845,6 +852,7 @@ void TProspettoScadenze::print_totali_rows(int nriga, bool what, TAssoc_array *
|
||||
}
|
||||
else
|
||||
{
|
||||
v._s[0].round(dec);
|
||||
if (v._s[0] != ZERO)
|
||||
{
|
||||
print_real(value, v._s[0]);
|
||||
@ -858,6 +866,7 @@ void TProspettoScadenze::print_totali_rows(int nriga, bool what, TAssoc_array *
|
||||
{
|
||||
for (int i = 0; i <= _nsfasce; i++)
|
||||
{
|
||||
v._ns[i].round(dec);
|
||||
if (v._ns[i] != ZERO)
|
||||
{
|
||||
print_real(value, v._ns[i]);
|
||||
@ -869,6 +878,7 @@ void TProspettoScadenze::print_totali_rows(int nriga, bool what, TAssoc_array *
|
||||
}
|
||||
else
|
||||
{
|
||||
v._s[0].round(dec);
|
||||
if (v._ns[0] != ZERO)
|
||||
{
|
||||
print_real(value, v._ns[0]);
|
||||
@ -878,27 +888,32 @@ void TProspettoScadenze::print_totali_rows(int nriga, bool what, TAssoc_array *
|
||||
pos += 12;
|
||||
}
|
||||
|
||||
tot.round(dec);
|
||||
if (tot != ZERO)
|
||||
{
|
||||
print_real(value, tot);
|
||||
rw << format("@%dg%12s", pos, (const char*) value);
|
||||
}
|
||||
pos += 12;
|
||||
v._es.round(dec);
|
||||
if (v._es != ZERO)
|
||||
{
|
||||
print_real(value, v._es);
|
||||
rw << format("@%dg%12s", pos, (const char*) value);
|
||||
}
|
||||
pos += 12;
|
||||
if (v._sl != ZERO)
|
||||
v._sl.round(dec);
|
||||
if (v._sl != ZERO)
|
||||
{
|
||||
print_real(value, v._sl);
|
||||
rw << format("@%dg%12s", pos, (const char*) value);
|
||||
}
|
||||
pos += 12;
|
||||
|
||||
const real diff = v._sl - (tot - v._es);
|
||||
if (!diff.is_zero())
|
||||
real diff = v._sl - (tot - v._es);
|
||||
|
||||
diff.round(dec);
|
||||
if (!diff.is_zero())
|
||||
{
|
||||
print_real(value, diff);
|
||||
rw << format("@%dg%12s", pos, (const char*) value);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user