Patch level : 2.0 602

Files correlati     : ef0.exe
Ricompilazione Demo : [ ]
Commento            :


git-svn-id: svn://10.65.10.50/trunk@11505 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2003-10-16 11:02:28 +00:00
parent c76f11b414
commit 8c4b95f71d

View File

@ -39,6 +39,7 @@ protected:
static bool imp_sel_handler(TMask_field& f, KEY k);
static bool check_handler(TMask_field& f, KEY k);
static bool imp_notify(TSheet_field& s, int r, KEY key);
static bool dist_check_handler(TMask_field& f, KEY key);
static bool impdist_notify(TSheet_field& s, int r, KEY key);
static bool conferma_handler(TMask_field& f, KEY k);
static bool annulla_handler(TMask_field& f, KEY k);
@ -404,6 +405,7 @@ bool TVariazione_distinte::user_create()
_msk->set_handler(F_IMPBUTTON, importo_handler);
_msk->set_handler(F_UNCONTABIL, uncontabilize_handler);
righe_sheet().set_notify(impdist_notify);
righe_sheet().sheet_mask().set_handler(FIRST_FIELD, dist_check_handler);
_m2->set_handler(F_IMPSEL, imp_sel_handler);
_m2->set_handler(DLG_OK, conferma_handler);
@ -846,14 +848,29 @@ void TVariazione_distinte::calcola_totale()
// se l'effetto è selezionato per l'eliminazione tolgo il suo importo
// dal totale presentazione della distinta
if (*row.get(0) != 'X') // valido (not to delete)
if (row.get_char(0) != 'X') // valido (not to delete)
{
const real imp = row.get(sf.cid2index(valuta ? F_IMPORTOVAL : F_IMPORTO));
impdist += imp;
}
}
m->set(F_TOTIMP, impdist);
}
}
// Notify per il calcolo dei totali relativi alla selezione effetti
bool TVariazione_distinte::dist_check_handler(TMask_field& f, KEY key)
{
if (key == K_SPACE)
{
TSheet_field& s = app().righe_sheet();
TToken_string& row = s.row(s.selected());
const bool checked = f.get().not_empty();
row.add(checked ? "X" : "", 0);
app().calcola_totale();
}
return TRUE;
}
// Metodo che calcola i totali relativi alla selezione effetti per la
// distinta nella maschera di scelta delle riba (ef0300c)
@ -867,8 +884,7 @@ void TVariazione_distinte::calcola()
for (int i = 0; i < sf.items(); i++)
{
TToken_string& row = sf.row(i);
// se l'effetto è selezionato aggiungo il suo importo al totale importo
// selezionato
// se l'effetto è selezionato aggiungo il suo importo al totale importo selezionato
if (row.get_char(0) == 'X')
{
const real imp = row.get(imp_col);
@ -919,8 +935,6 @@ void TVariazione_distinte::aggiungi()
// nella maschera della relap (ef0300a)
bool TVariazione_distinte::impdist_notify(TSheet_field& s, int r, KEY key)
{
if (s.to_check(key, TRUE))
calcola_totale();
if (key == K_INS)
{
aggiungi();