Compare commits

..

3 Commits

Author SHA1 Message Date
60703e2341 Merge branch 'R12.00.1244' of http://192.168.2.5:30000/root/campo-sirio into R12.00.1244 2026-05-08 00:39:32 +02:00
a21fa09580 Patch level : 120.00 1412
Files correlati     : sc2.exe
Commento                :
Corretta stampa prospetto pagamenti
2026-05-08 00:38:04 +02:00
0b1a36ecd0 Patch level : 120.00 1412
Files correlati     : sc2.exe
Commento                :
Corretta stampa prospetto pagamenti
2026-05-08 00:37:22 +02:00
2 changed files with 27 additions and 11 deletions

View File

@ -638,6 +638,7 @@ public:
bool significativo() const { return _significativo; } bool significativo() const { return _significativo; }
bool esiste_saldo() const { return _rec_presente_ec || _rec_presente_ep; } bool esiste_saldo() const { return _rec_presente_ec || _rec_presente_ep; }
bool esiste_saldo_ep() const { return _rec_presente_ep; } bool esiste_saldo_ep() const { return _rec_presente_ep; }
bool is_zero() const { return _saldo == ZERO; }
int annoes() const { return _annoes; } int annoes() const { return _annoes; }
void set_annoes(int anno) { _annoes = anno; } void set_annoes(int anno) { _annoes = anno; }

View File

@ -154,7 +154,7 @@ void TProspettoScadenze::print_real(TString& dest, const real& num)
if(!_m->get_bool(F_DECIMALI)) if(!_m->get_bool(F_DECIMALI))
elaCur = elaCur.sub(0, elaCur.find(",")); elaCur = elaCur.sub(0, elaCur.find(","));
dest = elaCur; dest = elaCur;
dest.right_just(10); dest.right_just(12);
} }
bool fil_function(const TRelation *r) bool fil_function(const TRelation *r)
@ -407,10 +407,13 @@ void TProspettoScadenze::calcola_saldo(TAssoc_array * l)
saldo.set_annoes(codes); saldo.set_annoes(codes);
const TDate dataini(e.esercizio(codes).inizio()); const TDate dataini(e.esercizio(codes).inizio());
saldo.data_limite_bilancio(Competenza, g, c, s, dataini, _limop, indbil_conto); saldo.data_limite_bilancio(Competenza, g, c, s, dataini, _limop, indbil_conto);
if (_tipost == fornitori) if (!saldo.is_zero())
ll->_sl -= saldo.saldo(); {
else if (_tipost == fornitori)
ll->_sl += saldo.saldo(); ll->_sl -= saldo.saldo();
else
ll->_sl += saldo.saldo();
}
} }
// aggiorno il totale generale // aggiorno il totale generale
TAssoc_array& at = (TAssoc_array&) _t[1]; 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 // If what is 0 prints single total... else prints also general total
{ {
reset_print(); 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()) if (_cod_pre.blank())
{ {
xassoc.destroy(); xassoc.destroy();
@ -818,6 +824,8 @@ void TProspettoScadenze::print_totali_rows(int nriga, bool what, TAssoc_array *
xassoc.get_keys(as); xassoc.get_keys(as);
as.sort(); as.sort();
if (!what && !_excel)
calcola_saldo(l);
for (int i=0; i < items; i++) for (int i=0; i < items; i++)
{ {
TString k(as.row(i)); // Chiave di ordinamento(valuta) 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; int pos = 49;
TString rw(255); TString rw(255);
if (!what && !_excel)
calcola_saldo(l);
rw = ""; rw = "";
if (_sinfasce) if (_sinfasce)
{ {
for (int i = _sfasce; i >= 0; i--) for (int i = _sfasce; i >= 0; i--)
{ {
v._s[i].round(dec);
if (v._s[i] != ZERO) if (v._s[i] != ZERO)
{ {
print_real(value, v._s[i]); print_real(value, v._s[i]);
@ -845,6 +852,7 @@ void TProspettoScadenze::print_totali_rows(int nriga, bool what, TAssoc_array *
} }
else else
{ {
v._s[0].round(dec);
if (v._s[0] != ZERO) if (v._s[0] != ZERO)
{ {
print_real(value, v._s[0]); 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++) for (int i = 0; i <= _nsfasce; i++)
{ {
v._ns[i].round(dec);
if (v._ns[i] != ZERO) if (v._ns[i] != ZERO)
{ {
print_real(value, v._ns[i]); print_real(value, v._ns[i]);
@ -869,6 +878,7 @@ void TProspettoScadenze::print_totali_rows(int nriga, bool what, TAssoc_array *
} }
else else
{ {
v._s[0].round(dec);
if (v._ns[0] != ZERO) if (v._ns[0] != ZERO)
{ {
print_real(value, v._ns[0]); print_real(value, v._ns[0]);
@ -878,27 +888,32 @@ void TProspettoScadenze::print_totali_rows(int nriga, bool what, TAssoc_array *
pos += 12; pos += 12;
} }
tot.round(dec);
if (tot != ZERO) if (tot != ZERO)
{ {
print_real(value, tot); print_real(value, tot);
rw << format("@%dg%12s", pos, (const char*) value); rw << format("@%dg%12s", pos, (const char*) value);
} }
pos += 12; pos += 12;
v._es.round(dec);
if (v._es != ZERO) if (v._es != ZERO)
{ {
print_real(value, v._es); print_real(value, v._es);
rw << format("@%dg%12s", pos, (const char*) value); rw << format("@%dg%12s", pos, (const char*) value);
} }
pos += 12; pos += 12;
if (v._sl != ZERO) v._sl.round(dec);
if (v._sl != ZERO)
{ {
print_real(value, v._sl); print_real(value, v._sl);
rw << format("@%dg%12s", pos, (const char*) value); rw << format("@%dg%12s", pos, (const char*) value);
} }
pos += 12; pos += 12;
const real diff = v._sl - (tot - v._es); real diff = v._sl - (tot - v._es);
if (!diff.is_zero())
diff.round(dec);
if (!diff.is_zero())
{ {
print_real(value, diff); print_real(value, diff);
rw << format("@%dg%12s", pos, (const char*) value); rw << format("@%dg%12s", pos, (const char*) value);