Patch level : 10.0
Files correlati : pe0.exe Ricompilazione Demo : [ ] Commento : Corretto passaggio a nuova revisione di un documento. git-svn-id: svn://10.65.10.50/trunk@19233 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
7abe6a531a
commit
f8a5e36e8a
@ -566,9 +566,13 @@ bool TGestione_preventivo_msk::pe_new_revision_handler(TMask_field& f, KEY k)
|
||||
if (k == K_SPACE)
|
||||
{
|
||||
TGestione_preventivo_msk& mask = (TGestione_preventivo_msk&)f.mask();
|
||||
TDocumento & d = mask.doc();
|
||||
TDocumento& d = mask.doc();
|
||||
|
||||
if (d.bloccato())
|
||||
return f.error_box(TR("Documento bloccato: non e' possibile farne una nuova revisione"));
|
||||
|
||||
TDocumento backup(d);
|
||||
const TTipo_documento & td = cached_tipodoc(d.get(DOC_TIPODOC));
|
||||
const TTipo_documento& td = d.tipo();
|
||||
const char stato_iniziale = d.stato();
|
||||
|
||||
d.put(DOC_STATO, td.stato_bloccato());
|
||||
@ -584,11 +588,15 @@ bool TGestione_preventivo_msk::pe_new_revision_handler(TMask_field& f, KEY k)
|
||||
ok = d.write() == NOERR;
|
||||
if (ok)
|
||||
{
|
||||
/* Trucco demenziale che non aggiorna bene ne' la TMask ne' la TRelation_application
|
||||
mask.doc2mask(false);
|
||||
mask.load_checks();
|
||||
mask.mask2doc();
|
||||
const int err = app().get_relation()->lfile().read(mask.doc());
|
||||
app().get_relation()->save_status();
|
||||
*/
|
||||
mask.enable(DLG_NEXTREC); // Mi assicuro che sia cceso il bottone Avanti
|
||||
mask.stop_run(K_NEXT); // Passo al documento successivo appena creato
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -867,13 +875,13 @@ bool TGestione_preventivo_msk::pe_k_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
TMask& row_mask = f.mask();
|
||||
TSheet_field * sh = row_mask.get_sheet();
|
||||
const bool last_level = row_mask.field(FR_JOLLY3).enabled();
|
||||
|
||||
if (sh == NULL)
|
||||
return true;
|
||||
|
||||
TGestione_preventivo_msk & mask = (TGestione_preventivo_msk &) sh->mask();
|
||||
TGestione_preventivo_msk& mask = (TGestione_preventivo_msk&)sh->mask();
|
||||
|
||||
const bool last_level = row_mask.field(FR_JOLLY3).enabled();
|
||||
if (last_level)
|
||||
{
|
||||
if ((k == K_TAB && f.focusdirty()) || k == K_F8)
|
||||
@ -1008,7 +1016,9 @@ bool TGestione_preventivo_msk::new_revision(const char* codnum, long& ndoc) cons
|
||||
const long divisore = fattore.integer();
|
||||
const long newndoc = ndoc + 1;
|
||||
|
||||
if (((newndoc / divisore) - (ndoc / divisore)) != 0)
|
||||
// Obfuscated C contest: forse bastava scrivere questo
|
||||
// if (newndoc/divisore != ndoc/divisore)
|
||||
if (((newndoc / divisore) - (ndoc / divisore)) != 0)
|
||||
return false;
|
||||
else
|
||||
{
|
||||
@ -1188,21 +1198,18 @@ int TGestione_preventivo_app::read(TMask& m)
|
||||
//ridefinisco il metodo init_insert_mode della TMotore_application
|
||||
void TGestione_preventivo_app::init_insert_mode(TMask &m)
|
||||
{
|
||||
TGestione_preventivo_msk & mask = (TGestione_preventivo_msk&) m;
|
||||
|
||||
mask.disable(F_REVISION);
|
||||
|
||||
m.disable(F_REVISION);
|
||||
m.enable(F_LOAD_COSTS);
|
||||
return TMotore_application::init_insert_mode(m);
|
||||
}
|
||||
|
||||
void TGestione_preventivo_app::init_modify_mode(TMask &m)
|
||||
{
|
||||
TGestione_preventivo_msk & mask = (TGestione_preventivo_msk&) m;
|
||||
TDocumento& d = mask.doc();
|
||||
const TCodice_numerazione& num = cached_numerazione(d.get(DOC_CODNUM));
|
||||
|
||||
mask.enable(F_REVISION, num.revision_len() > 0);
|
||||
|
||||
TGestione_preventivo_msk& mask = (TGestione_preventivo_msk&) m;
|
||||
const TDocumento& d = mask.doc();
|
||||
const TCodice_numerazione& num = d.codice_numerazione();
|
||||
mask.enable(F_REVISION, !d.bloccato() && num.revision_len() > 0);
|
||||
mask.enable(F_LOAD_COSTS, !d.bloccato());
|
||||
|
||||
return TMotore_application::init_modify_mode(m);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user