Dio gabrone

git-svn-id: svn://10.65.10.50/trunk@2319 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
villa 1995-12-19 12:02:36 +00:00
parent 585c6020ac
commit f9ac1b045a
4 changed files with 21 additions and 14 deletions

@ -669,7 +669,7 @@ word TPagamento::recalc_rate(int row, bool is_perc_modified,
if (new_value != NULL)
{
newv = new_value;
newv = new_value;
rmax = is_perc_modified ? real(100.0) : (_tpr < 4 ? _firstr : _secndr);
if (newv > rmax) return P_RSUM;
}
@ -767,11 +767,12 @@ word TPagamento::recalc_rate(int row, bool is_perc_modified,
// here's the bell
if (new_value != NULL)
{
if (newv == ZERO || (rsum+newv) > rmax)
{
real totogl((row == first && _inited && _tpr > 0 && _tpr < 4) ? _secndr : 0.0);
if (newv == ZERO || (rsum+newv-totogl) > rmax)
return P_RSUM;
// did not sforate
rsum += newv;
rsum += newv-totogl;
TToken_string& rt = rata(row);
// setta nuovo valore e ricalcola cio' che ne consegue
if (is_perc_modified) rt.add(new_value,1);
@ -1049,14 +1050,16 @@ word TPagamento::recalc_rate(int row, bool is_perc_modified,
if (!is_perc_modified && j == first && _tpr > 0 && _tpr < 4)
rvl -= _secndr;
real zpx = rvl/rmax; // percentuale
dt.add(zpx);
dt.add(zpx); // * cento???
}
for (j = first; j < _rate.items(); j++)
{
real rfirst(0.0);
TToken_string& tr = rata(j);
real rvl = dt.get();
real rvl = dt.get();
if (!is_perc_modified)
rvl *= real(100.0);
if (j == first)
{
@ -1074,7 +1077,7 @@ word TPagamento::recalc_rate(int row, bool is_perc_modified,
if (is_perc_modified && j == first && _tpr > 0 && _tpr < 4)
rfirst += _secndr;
tr.add((j == first ? rfirst.string() : rvl.string()), is_perc_modified ? 4 : 1);
if (_cambio != 1.0)
@ -1116,8 +1119,11 @@ word TPagamento::recalc_rate(int row, bool is_perc_modified,
if (is_perc_modified)
rsum += perc_rata(i);
else
rsum += tpay_rata(i);
{
rsum += tpay_rata(i);
if (i == 0 && _tpr > 0 && _tpr < 4)
rsum -= _secndr;
}
lastdate = data_rata(i);
oldtype = tipo_rata(i);
if (scad_rata(i) > 0) oldscad = scad_rata(i);

@ -2372,6 +2372,7 @@ bool TPrint_section::edit(const char* title)
{
TForm_item& f = field(i);
field(i).print_on_sheet_row(tt);
// TBI colorare se specials (e vedi se colorare solo se non standard)
ms.row(-1) = tt;
}

@ -1259,8 +1259,8 @@ char *real ::stringa (int len, int dec, char pad) const
void TDistrib ::add(real slice)
{
// if (slice > real (1.0))
slice /= 100.0;
if (slice > real (1.0))
slice /= 100.0;
CHECK (!_ready, "TDistrib: les jeux sont faits");
_slices.add (slice);
}

@ -49,9 +49,9 @@ class TViswin : public TScroll_window
bool _isedit;
// @cmember Indica la presenza del bottone Stampa
bool _isprint;
// @cmember Indice se effettuare il disgno della crossbar
// @cmember Indica se effettuare il disegno della crossbar
bool _iscross;
// @cmember India se e' in corso la selezione
// @cmember Indica se e' in corso la selezione
bool _selecting;
// @cmember Indica se la selezione e' attiva
bool _isselection;
@ -134,7 +134,7 @@ class TViswin : public TScroll_window
TArray* _hotspots;
// @cmember Array di segnalibri
TArray* _bookmarks;
// @cmember Indica se occorre ridisegnare la selezione
bool need_paint_sel(bool smart = TRUE);