Patch level : 2.0 602
Files correlati : ef0.exe ef0300c.msk Ricompilazione Demo : [ ] Commento : GF20109 Quando, nella pagina della selezione, spunto sulle riba per selezionarle alla prima selezione l'importo sotto non viene aggiornato, alla seconda spunta, viene messo l'importo della prima ri.ba e così via; succede la stessa cosa anche quando da una distinta creata cerco di sottrarre delle riba che in quella distinta per errore sono state selzionate. git-svn-id: svn://10.65.10.50/trunk@11503 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
23efd93d02
commit
237316d334
@ -36,9 +36,10 @@ protected:
|
||||
virtual bool has_filtered_cursor() const { return true; }
|
||||
static bool tipodist_handler(TMask_field& f, KEY k);
|
||||
static bool importo_handler(TMask_field& f, KEY k);
|
||||
static bool imp_aut_handler(TMask_field& f, KEY k);
|
||||
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 impdist_notify(TSheet_field& s, int r, KEY key);
|
||||
static bool imp_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);
|
||||
static bool data_handler(TMask_field& f, KEY k);
|
||||
@ -53,9 +54,9 @@ protected:
|
||||
static void ord_fatt();
|
||||
// ritorna un riferimento allo sheet degli effetti (righe) nella
|
||||
// distinta
|
||||
TSheet_field& righe_sheet() const { return (TSheet_field&)_msk->field(F_SHEET_RIBA); }
|
||||
TSheet_field& righe_sheet() const { return _msk->sfield(F_SHEET_RIBA); }
|
||||
// ritorna un riferimento allo sheet delle righe
|
||||
TSheet_field& righe_sel_sheet() const { return (TSheet_field&)_m2->field(F_SHEET); }
|
||||
TSheet_field& righe_sel_sheet() const { return _m2->sfield(F_SHEET); }
|
||||
bool cerca(long num);
|
||||
bool user_create();
|
||||
bool user_destroy();
|
||||
@ -231,9 +232,9 @@ int TVariazione_distinte::read(TMask& m)
|
||||
riga.add(cache().get(LF_CLIFO, codice, CLI_RAGSOC));
|
||||
|
||||
codice = eff.get(EFF_CODABI);
|
||||
TString desc(cache().get("%BAN", codice, "S0"));
|
||||
TString desc = cache().get("%BAN", codice, "S0");
|
||||
codice << eff.get(EFF_CODCAB);
|
||||
desc << " " << cache().get("%BAN", codice, "S0");
|
||||
desc << ' ' << cache().get("%BAN", codice, "S0");
|
||||
desc.cut(50);
|
||||
riga.add(desc);
|
||||
|
||||
@ -398,17 +399,20 @@ bool TVariazione_distinte::user_create()
|
||||
|
||||
_distinta = new TDistinta;
|
||||
set_search_field(F_NUMBER);//setto il campo di ricerca della distinta
|
||||
|
||||
_msk->set_handler(F_TIPODIST, tipodist_handler);
|
||||
_msk->set_handler(F_IMPBUTTON, importo_handler);
|
||||
_msk->set_handler(F_UNCONTABIL, uncontabilize_handler);
|
||||
_m2->set_handler(F_TOTIMPDIST, imp_aut_handler);
|
||||
righe_sheet().set_notify(impdist_notify);
|
||||
|
||||
_m2->set_handler(F_IMPSEL, imp_sel_handler);
|
||||
_m2->set_handler(DLG_OK, conferma_handler);
|
||||
_m2->set_handler(DLG_CANCEL, annulla_handler);
|
||||
_m2->set_handler(F_DADATA, data_handler);
|
||||
_m2->set_handler(F_ADATA, data_handler);
|
||||
_m2->set_handler(F_TIPORD, ordina_handler);
|
||||
righe_sheet().set_notify(impdist_notify);
|
||||
righe_sel_sheet().set_notify(imp_notify);
|
||||
righe_sel_sheet().set_notify(imp_notify);
|
||||
righe_sel_sheet().sheet_mask().set_handler(FIRST_FIELD, check_handler);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -575,7 +579,7 @@ bool TVariazione_distinte::importo_handler(TMask_field& f, KEY k)
|
||||
// Handler per gestire il caricamento degli effetti nella distinta in
|
||||
// automatico relativamente ad un importo fissato (per la maschera
|
||||
// secondaria)
|
||||
bool TVariazione_distinte::imp_aut_handler(TMask_field& f, KEY k)
|
||||
bool TVariazione_distinte::imp_sel_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
TMask& m2 = f.mask();
|
||||
// se quando si entra nell maschera il campo contiene un valore
|
||||
@ -586,7 +590,7 @@ bool TVariazione_distinte::imp_aut_handler(TMask_field& f, KEY k)
|
||||
TMask* m = app()._msk;
|
||||
TSheet_field& sf = (TSheet_field&)m2.field(F_SHEET);
|
||||
TSheet_field& sf_riba = (TSheet_field&)m->field(F_SHEET_RIBA);
|
||||
real res = m2.get_real(F_TOTIMPDIST);
|
||||
real res = m2.get_real(F_IMPSEL);
|
||||
if (res > ZERO)
|
||||
{ // se i due importi sono diversi da zero
|
||||
TString16 val = m->get(F_CODVAL);
|
||||
@ -855,36 +859,40 @@ void TVariazione_distinte::calcola_totale()
|
||||
// distinta nella maschera di scelta delle riba (ef0300c)
|
||||
void TVariazione_distinte::calcola()
|
||||
{
|
||||
TMask* m2 = app()._m2;
|
||||
TMask* m = app()._msk;
|
||||
TSheet_field& sf = (TSheet_field&)m2->field(F_SHEET);
|
||||
const int items = sf.items();
|
||||
TMask& m2 = *app()._m2;
|
||||
TSheet_field& sf = m2.sfield(F_SHEET);
|
||||
const bool valuta = ::is_true_value(m2.get(F_CODVALS));
|
||||
const int imp_col = sf.cid2index(valuta ? F_IMPORTOVAL : F_IMPORTO); // Colonna con importo
|
||||
real impsel;
|
||||
const real imp_pres = m->get_real(F_TOTIMP);
|
||||
const TString16 codval = m->get(F_CODVAL);
|
||||
const bool valuta = ::is_true_value(codval);
|
||||
|
||||
for (int i = 0; i < items; i++)
|
||||
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
|
||||
if (*row.get(0) == 'X')
|
||||
if (row.get_char(0) == 'X')
|
||||
{
|
||||
const real imp = row.get(sf.cid2index(valuta ? F_IMPORTOVAL : F_IMPORTO));
|
||||
const real imp = row.get(imp_col);
|
||||
impsel += imp;
|
||||
}
|
||||
}
|
||||
m2->set(F_IMPSEL, impsel);
|
||||
m2->set(F_TOTIMPDIST, impsel);
|
||||
m2.set(F_IMPSEL, impsel);
|
||||
|
||||
const real imp_pres = app()._msk->get_real(F_TOTIMP);
|
||||
m2.set(F_TOTIMPDIST, real(imp_pres+impsel));
|
||||
}
|
||||
|
||||
// Notify per il calcolo dei totali relativi alla selezione effetti
|
||||
// per la distinta nella maschera di scelta delle riba (ef0300c)
|
||||
bool TVariazione_distinte::imp_notify(TSheet_field& s, int r, KEY key)
|
||||
bool TVariazione_distinte::check_handler(TMask_field& f, KEY key)
|
||||
{
|
||||
if (s.to_check(key, TRUE))
|
||||
calcola();
|
||||
if (key == K_SPACE)
|
||||
{
|
||||
TSheet_field& s = app().righe_sel_sheet();
|
||||
TToken_string& row = s.row(s.selected());
|
||||
const bool checked = f.get().not_empty();
|
||||
row.add(checked ? "X" : "", 0);
|
||||
app().calcola();
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -901,10 +909,8 @@ void TVariazione_distinte::aggiungi()
|
||||
TWait_cursor hourglass;
|
||||
carica_riba(tipopag);
|
||||
}
|
||||
m2->reset(F_TOTIMPDIST);
|
||||
m2->reset(F_IMPSEL);
|
||||
const TString16 codval = m->get(F_CODVAL);
|
||||
m2->set(F_CODVALS, codval);
|
||||
m2->set(F_CODVALS, m->get(F_CODVAL));
|
||||
calcola();
|
||||
m2->run();
|
||||
calcola_totale();
|
||||
}
|
||||
@ -924,6 +930,13 @@ bool TVariazione_distinte::impdist_notify(TSheet_field& s, int r, KEY key)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TVariazione_distinte::imp_notify(TSheet_field& s, int r, KEY key)
|
||||
{
|
||||
if (key == K_DEL || key == K_INS)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
int ef0300(int argc, char* argv[])
|
||||
{
|
||||
TVariazione_distinte a ;
|
||||
|
@ -26,7 +26,7 @@ BEGIN
|
||||
ITEM "F|Fattura "
|
||||
END
|
||||
|
||||
SPREADSHEET F_SHEET 74 9
|
||||
SPREADSHEET F_SHEET 74 10
|
||||
BEGIN
|
||||
PROMPT 2 6 "EFFETTI SELEZIONABILI"
|
||||
ITEM "Sel."
|
||||
@ -48,24 +48,26 @@ BEGIN
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
CURRENCY F_TOTIMPDIST 18
|
||||
BEGIN
|
||||
PROMPT 2 17 "Importo "
|
||||
DRIVENBY F_CODVALS
|
||||
END
|
||||
|
||||
CURRENCY F_IMPSEL 18
|
||||
BEGIN
|
||||
PROMPT 37 17 "Importo Selezionato "
|
||||
PROMPT 2 17 "Imp. selezionato "
|
||||
DRIVENBY F_CODVALS
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
CURRENCY F_TOTIMPDIST 18
|
||||
BEGIN
|
||||
PROMPT 40 17 "Imp. presentazione "
|
||||
DRIVENBY F_CODVALS
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
|
||||
BUTTON DLG_OK 10 2
|
||||
BEGIN
|
||||
PROMPT -12 -1 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_CANCEL 9 2
|
||||
BUTTON DLG_CANCEL 10 2
|
||||
BEGIN
|
||||
PROMPT -22 -1 ""
|
||||
END
|
||||
|
Loading…
x
Reference in New Issue
Block a user