Aggiunta gestione ulc in sheet di prima nota

git-svn-id: svn://10.65.10.50/trunk@2070 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1995-11-03 08:04:05 +00:00
parent d7440be38c
commit 313732f8ac

View File

@ -46,7 +46,7 @@ void TPagamento::set_inizio(const TDate& d)
{
bool dio;
_inizio = d;
recalc_rate(0, FALSE, NULL, d.string(), NULL, _rdiff, _mcomm, dio);
recalc_rate(0, FALSE, NULL, d.string(), NULL, NULL, _rdiff, _mcomm, dio);
}
void TPagamento::set_intervallo_rate(int in)
@ -196,7 +196,7 @@ void TPagamento::set_numero_rate(int n, int sscad, int rdiff)
{
if (i >= nr)
add_rata(perc, (sscad == -1 ? (i < nr ? scad_rata(i) : scad_rata(nr-1)) : sscad),
tipo_rata(nr-1));
tipo_rata(nr-1), ulc_rata(nr-1));
if (_inited) set_imprata (i, div);
set_percrata(i, perc);
}
@ -598,7 +598,8 @@ const char* TPagamento::desc_tipo(int i) const
word TPagamento::recalc_rate(int row, bool is_perc_modified,
const char* new_value, const char* scad,
const char* typ, int rdiff, bool mcomm,
const char* typ, const char* ulc,
int rdiff, bool mcomm,
bool& need_recalc)
// ricalcola le rate sulla base di parametri modificati sulla riga row
// parametri: tutti i const char* possono essere NULL, il che vuol dire
@ -614,7 +615,8 @@ word TPagamento::recalc_rate(int row, bool is_perc_modified,
if (_rate.items() == 0) return P_OK;
real rsum(0.0), newv(0.0), rmax(0.0);
int oldtype = tipo_rata(0);
int oldtype = tipo_rata(0);
TString oldulc = ulc_rata(0);
int oldscad = scad_rata(0);
TDate lastdate = data_rata(0);
int first = _tpr < 4 ? 0 : 1;
@ -666,6 +668,12 @@ word TPagamento::recalc_rate(int row, bool is_perc_modified,
// no error is possible
}
}
}
if (ulc != NULL)
{
rata(row).add(ulc, 5);
srate.row(row).add(ulc, 5);
}
if (scad != NULL)
@ -787,6 +795,7 @@ word TPagamento::recalc_rate(int row, bool is_perc_modified,
TDate dd(lastdate);
int type = oldtype;
TString nulc = oldulc;
int nscd = oldscad;
const int frs = (rdiff == 3 || rdiff == 4) ? row+1 : first;
@ -828,7 +837,7 @@ word TPagamento::recalc_rate(int row, bool is_perc_modified,
next_scad(dd,nscd,mcomm,k);
set_rata(k, is_perc_modified ? (k == first ? nimp : div) : ZERO,
nscd, type, NULL, NULL, _inited ? dd.string() : NULL);
nscd, type, nulc, NULL, _inited ? dd.string() : NULL);
if (!is_perc_modified)
set_imprata (k, k == first ? (nimp + delta) : div);
}
@ -872,7 +881,7 @@ word TPagamento::recalc_rate(int row, bool is_perc_modified,
next_scad(dd,nscd,mcomm,k);
set_rata(k, is_perc_modified ? (k == first ? rfirst : nimp) : ZERO,
nscd, type, ulc);
nscd, type, ulc, NULL, dd.string());
if (!is_perc_modified)
set_imprata (k, k == first ? (rfirst + delta) : nimp);
}
@ -1334,10 +1343,11 @@ void TPagamento::set_sheet(TSheet_field& sf, int sscad)
}
ts.add(perc_rata(i).string(), 3); // 3 - Percentuale
ts.add(tipo_rata(i), 4); // 4 - Tipo rata
ts.add(desc_tipo(tipo_rata(i)), 5); // 5 - Descrizione tipo rata
// 6,7,8,9 - Banche
ts.add(ulc_rata(i), 5); // 5 - Ulteriore classificazione
ts.add(desc_tipo(tipo_rata(i)), 6); // 6 - Descrizione tipo rata
// 7,8,9,10 - Banche
const bool paid = ratapagata(i);
ts.add(paid ? "X" : "", 10); // 10 - Pagaya
ts.add(paid ? "X" : "", 11); // 11 - Pagaya
}
// destroy remaining