MOdifiche calcolo numero rate (corrette percentuali) e ricalcolo
scadenze con mese commerciale git-svn-id: svn://10.65.10.50/trunk@2579 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
cd49631f73
commit
b20b78d978
@ -354,11 +354,11 @@ void TPagamento::set_numero_rate(int n, int sscad, int rdiff)
|
||||
if (_inited)
|
||||
{
|
||||
set_imprata (i, div, FALSE);
|
||||
rem -= importo_rata(i,FALSE);
|
||||
rem -= div;
|
||||
if (inv)
|
||||
{
|
||||
set_imprata (i, oiv, TRUE);
|
||||
oem -= importo_rata(i,TRUE);
|
||||
oem -= oiv;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -420,7 +420,11 @@ void TPagamento::set_numero_rate(int n, int sscad, int rdiff)
|
||||
remove_rate_from(i);
|
||||
|
||||
if (_inited)
|
||||
{
|
||||
set_inizio(_datadoc);
|
||||
adjust_perc(rdiff, inv);
|
||||
}
|
||||
|
||||
adjust_fixed_scad();
|
||||
|
||||
_dirty = TRUE;
|
||||
@ -505,7 +509,7 @@ void TPagamento::set_cambio(const real& cambio, bool recalc_lit)
|
||||
|
||||
void TPagamento::next_scad(TDate& d, int scad, bool mcomm, int rata)
|
||||
{
|
||||
if (mcomm && rata > 0)
|
||||
if (mcomm /* && rata > 0 */)
|
||||
{
|
||||
int nm = scad / 30;
|
||||
int ny = nm / 12;
|
||||
@ -984,16 +988,22 @@ word TPagamento::recalc_rate(int row, bool is_perc_modified,
|
||||
{
|
||||
TToken_string& tt = rata(row);
|
||||
TToken_string& ss = (TToken_string&)srate[row];
|
||||
lastdate = scad;
|
||||
lastdate = scad;
|
||||
int lastscad = oldscad;
|
||||
// controlla errore sulla data scadenza
|
||||
if (i > 0)
|
||||
{
|
||||
oldscad = (int)(lastdate - data_rata(i-1));
|
||||
if (oldscad <= 0l) return P_SCAD;
|
||||
}
|
||||
else if (lastdate < _datadoc) return P_INIZIO; // _inizio
|
||||
tt.add(scad,3); tt.add(oldscad, 0);
|
||||
ss.add(scad,3); ss.add(oldscad, 0);
|
||||
else
|
||||
{
|
||||
if (lastdate < _datadoc)
|
||||
return P_INIZIO; // _inizio
|
||||
lastscad = scad_rata(0);
|
||||
}
|
||||
tt.add(scad,3); tt.add(lastscad, 0);
|
||||
ss.add(scad,3); ss.add(lastscad, 0);
|
||||
// ricalcola rate successive: se si vuole modificarne solo una
|
||||
// ci si fotte e si disabilita il ricalcolo
|
||||
TDate ddd (lastdate);
|
||||
|
Loading…
x
Reference in New Issue
Block a user