Correzioni per XI

git-svn-id: svn://10.65.10.50/trunk@2833 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1996-05-16 09:18:18 +00:00
parent 20b383cc49
commit 6858a7875c
5 changed files with 126 additions and 113 deletions

View File

@ -88,16 +88,8 @@ bool TPersone_app::ba4200_handler(TMask& m, KEY k)
TMessage msg(cmd2name(cmd), MSG_FS, (const char*) body); TMessage msg(cmd2name(cmd), MSG_FS, (const char*) body);
msg.send(); msg.send();
// TLocalisamfile& d = app.get_relation()->lfile();
// d.setkey(1);
// d.zero();
// d.put(N_TIPOA, app.ana_fis() ? "F" : "G");
// d.put(N_CODANAGR, m.get(FLD_CODANAGR));
// d.read(_isequal, _unlock) ;
TExternal_app a(cmd); TExternal_app a(cmd);
a.run(); a.run();
// d.read(_iscurr, _lock) ;
m.set_focus(); m.set_focus();
return FALSE; return FALSE;
} }
@ -418,9 +410,6 @@ bool no_dup_fis(TMask_field& f, KEY key)
const TString16 cofi(f.get()); const TString16 cofi(f.get());
if ( cofi.not_empty() ) if ( cofi.not_empty() )
{ {
// TRelation * r = app.get_relation();
// r->save_status();
anag.zero() ; anag.zero() ;
anag.put(N_TIPOA, app.tip_ana()); anag.put(N_TIPOA, app.tip_ana());
anag.put(N_COFI, cofi ) ; anag.put(N_COFI, cofi ) ;
@ -433,7 +422,6 @@ bool no_dup_fis(TMask_field& f, KEY key)
if (anag.good() && (t1 != t || s1 != s)) if (anag.good() && (t1 != t || s1 != s))
f.message_box("Codice fiscale gia' utilizzato per il codice %c/%s", f.message_box("Codice fiscale gia' utilizzato per il codice %c/%s",
t, (const char*)s); t, (const char*)s);
// r->restore_status();
} }
return TRUE ; return TRUE ;
} }
@ -494,10 +482,8 @@ bool no_dup_iva_g(TMask_field& f, KEY key)
TMask* TPersone_app::get_mask(int mode) TMask* TPersone_app::get_mask(int mode)
{ {
if (!changing_mask(mode)) return _msk[tip_msk()]; if (!changing_mask(mode)) return _msk[tip_msk()];
if (ana_fis()) if (ana_fis() && _msk[MSKF] == NULL)
{ {
if (_msk[MSKG] != NULL) delete _msk[MSKG];
_msk[MSKG] = NULL;
_msk[MSKF] = new TMask("ba4200b") ; _msk[MSKF] = new TMask("ba4200b") ;
_msk[MSKF]->set_handler(F_STATO, stato_hnd); _msk[MSKF]->set_handler(F_STATO, stato_hnd);
_msk[MSKF]->set_handler(FLD_AF1_PAIV, no_dup_iva_f); _msk[MSKF]->set_handler(FLD_AF1_PAIV, no_dup_iva_f);
@ -511,9 +497,8 @@ TMask* TPersone_app::get_mask(int mode)
_msk[MSKF]->set_handler(ba4200_handler); _msk[MSKF]->set_handler(ba4200_handler);
} }
else else
if (ana_giu() && _msk[MSKG] == NULL)
{ {
if (_msk[MSKF] != NULL) delete _msk[MSKF];
_msk[MSKF] = NULL;
_msk[MSKG] = new TMask("ba4200c") ; _msk[MSKG] = new TMask("ba4200c") ;
_msk[MSKG]->set_handler(FLD_AG2_COMRES, gest_uff_imp); _msk[MSKG]->set_handler(FLD_AG2_COMRES, gest_uff_imp);
_msk[MSKG]->set_handler(FLD_AG1_COMRF, gest_uff_imp); _msk[MSKG]->set_handler(FLD_AG1_COMRF, gest_uff_imp);

View File

@ -129,7 +129,6 @@ bool ba4300_handler(TMask& m, KEY k)
if (appname.not_empty()) if (appname.not_empty())
{ {
TString body(16); TString body(16);
// TLocalisamfile& d = app.get_relation()->lfile();
if (fldbrowse) if (fldbrowse)
body << fldbrowse << "|"; body << fldbrowse << "|";
@ -144,16 +143,11 @@ bool ba4300_handler(TMask& m, KEY k)
TMailbox mb; TMailbox mb;
mb.send(msg); mb.send(msg);
} }
// d.setkey(1);
// d.zero();
// d.put("CODDITTA", m.get(FLD_GD1_CODDITTA));
// d.read(_isequal, _unlock) ;
TExternal_app a(appname); TExternal_app a(appname);
const long oldditta = main_app().get_firm(); const long oldditta = main_app().get_firm();
if (k == K_F8) main_app().set_firm(m.get_long(FLD_GD1_CODDITTA)); if (k == K_F8) main_app().set_firm(m.get_long(FLD_GD1_CODDITTA));
a.run(); a.run();
if (k == K_F8) main_app().set_firm(oldditta); if (k == K_F8) main_app().set_firm(oldditta);
// d.read(_iscurr, _lock) ;
m.set_focus(); m.set_focus();
return FALSE; return FALSE;
} }
@ -216,7 +210,7 @@ void TDitte_application::set_att_prev(const TMask& m)
_attiv->put(CODATT, _oldattprev); _attiv->put(CODATT, _oldattprev);
if (_attiv->read(_isequal, _lock) == NOERR) if (_attiv->read(_isequal, _lock) == NOERR)
{ {
_attiv->put("ATTPREV", FALSE); _attiv->put("ATTPREV", bool(FALSE));
if (_attiv->rewrite() != NOERR) if (_attiv->rewrite() != NOERR)
error_box("Non posso aggiornare l'attivita' prevalente precedente : errore n. %d", _attiv->status()); error_box("Non posso aggiornare l'attivita' prevalente precedente : errore n. %d", _attiv->status());
} }
@ -239,7 +233,7 @@ void TDitte_application::set_att_prev(const TMask& m)
if (tabatt.read() == NOERR) if (tabatt.read() == NOERR)
_attiv->put(DESCR, tabatt.get(S0)) ; _attiv->put(DESCR, tabatt.get(S0)) ;
} }
_attiv->put("ATTPREV", TRUE) ; _attiv->put("ATTPREV", bool(TRUE)) ;
if (itwas) if (itwas)
{ {
if (_attiv->rewrite() != NOERR) if (_attiv->rewrite() != NOERR)

View File

@ -24,23 +24,26 @@ public:
HIDDEN bool clear_cap(TMask_field& f, KEY key) HIDDEN bool clear_cap(TMask_field& f, KEY key)
{ {
if (f.mask().query_mode()) if (!f.mask().query_mode() && key == K_TAB)
return TRUE; {
TMask& msk = f.mask() ; TMask& msk = f.mask() ;
const short dlg = f.dlg();
if (dlg != FLD_UL1_COMULC && !f.to_check(key, TRUE))
return TRUE;
const TString16 val(f.get()); const TString16 val(f.get());
const int capid = dlg == FLD_UL1_COMULC ? FLD_UL1_CAPULC : FLD_UL2_CAPTRIB; const bool com_ulc = f.dlg() == FLD_UL1_COMULC;
if (val.empty()) if (val.empty())
msk.set(capid, ""); {
msk.set(com_ulc ? FLD_UL1_CAPULC : FLD_UL2_CAPTRIB, "", TRUE);
if (com_ulc)
{
msk.reset(-7);
msk.set(FLD_UL1_COMULC_COMUNI_PROVCOM, "", TRUE);
}
msk.set(com_ulc ? FLD_UL1_COMULC_COMUNI_DENCOM : FLD_UL2_COMTRIB_COMUNI_DENCOM, "", TRUE);
}
}
return TRUE; return TRUE;
} }
bool BA4400_application::user_create() bool BA4400_application::user_create()
{ {
_msk = new TMask("ba4400a") ; _msk = new TMask("ba4400a") ;

View File

@ -43,7 +43,8 @@ bool TAttivita_application::gest_res(TMask_field& f, KEY key)
msk.set( FLD_AT2_DEP_ANAGR_COMUNI_DESCR , "" ) ; msk.set( FLD_AT2_DEP_ANAGR_COMUNI_DESCR , "" ) ;
msk.set( FLD_AT2_DEP_ANAGR_COMUNI_PROV , "" ) ; msk.set( FLD_AT2_DEP_ANAGR_COMUNI_PROV , "" ) ;
} }
if (!f.to_check(key)) return TRUE; if (f.to_check(key))
{
TLocalisamfile & anag = *app()._anag; TLocalisamfile & anag = *app()._anag;
TLocalisamfile & comuni = *app()._comuni; TLocalisamfile & comuni = *app()._comuni;
@ -94,19 +95,20 @@ bool TAttivita_application::gest_res(TMask_field& f, KEY key)
} }
} }
} }
}
return TRUE; return TRUE;
} }
HIDDEN bool clear_cap(TMask_field& f, KEY key) HIDDEN bool clear_cap(TMask_field& f, KEY key)
{ {
if (f.mask().query_mode() || !f.to_check(key, TRUE)) if (!f.mask().query_mode() && key == K_TAB)
return TRUE; {
TMask& msk = f.mask() ; TMask& msk = f.mask() ;
const TString16 val(f.get()); const TString16 val(f.get());
if (val.empty()) if (val.empty())
msk.set(FLD_AT2_CAPCS, ""); msk.set(FLD_AT2_CAPCS, "");
}
return TRUE; return TRUE;
} }

View File

@ -23,8 +23,11 @@ public:
virtual ~TSoci_application() {} virtual ~TSoci_application() {}
virtual void init_query_mode(TMask& m) ; virtual void init_query_mode(TMask& m) ;
virtual void init_query_insert_mode(TMask& m) ; virtual void init_query_insert_mode(TMask& m) ;
virtual void init_modify_mode(TMask& m) ;
virtual void init_insert_mode(TMask& m) { init_modify_mode(m) ; }
virtual int rewrite(const TMask& m); virtual int rewrite(const TMask& m);
virtual int write(const TMask& m); virtual int write(const TMask& m);
virtual bool remove();
virtual void update_ap_socio(const TMask& m); virtual void update_ap_socio(const TMask& m);
}; };
@ -34,6 +37,7 @@ void TSoci_application::init_query_mode(TMask& m)
m.show(FLD_SC1_CODANAGRSOH); m.show(FLD_SC1_CODANAGRSOH);
m.hide(FLD_SC1_CODANAGRSO); m.hide(FLD_SC1_CODANAGRSO);
m.set(FLD_SC1_CODANAGR_ANAGR_RAGSOC, ""); m.set(FLD_SC1_CODANAGR_ANAGR_RAGSOC, "");
m.enable(FLD_SC1_CODANAGR_ANAGR_RAGSOC);
} }
@ -45,12 +49,18 @@ void TSoci_application::init_query_insert_mode(TMask& m)
m.set(FLD_SC1_CODANAGR_ANAGR_RAGSOC, ""); m.set(FLD_SC1_CODANAGR_ANAGR_RAGSOC, "");
} }
void TSoci_application::init_modify_mode(TMask& m)
{
m.disable(FLD_SC1_CODANAGR_ANAGR_RAGSOC);
}
void TSoci_application::update_ap_socio(const TMask& m) void TSoci_application::update_ap_socio(const TMask& m)
{ {
int err = NOERR; int err = NOERR;
const char ap = (m.get(FLD_SC1_ANNO)[0] == 'A') ? 'P' : 'A'; const char ap = (m.get(FLD_SC1_ANNO)[0] == 'A') ? 'P' : 'A';
if (yesno_box(format("Aggiornare anche il socio %s?", ap == 'A' ? "attuale" : "precedente"))) if (yesno_box(format("Aggiornare il socio anche per l' anno %s?", ap == 'A' ? "in corso" : "precedente")))
{ {
_rel->save_status(); _rel->save_status();
m.autosave(*_rel); m.autosave(*_rel);
@ -61,7 +71,7 @@ void TSoci_application::update_ap_socio(const TMask& m)
if (was) err = _rel->rewrite(); if (was) err = _rel->rewrite();
else err = _rel->write(); else err = _rel->write();
if (err != NOERR) if (err != NOERR)
error_box("Aggiornamento socio %s - Errore : %d", ap == 'A' ? "attuale" : "precedente", err); error_box("Aggiornamento socio anno %s - Errore : %d", ap == 'A' ? "in corso" : "precedente", err);
_rel->restore_status(); _rel->restore_status();
} }
} }
@ -82,6 +92,25 @@ int TSoci_application::rewrite(const TMask& m)
return err; return err;
} }
bool TSoci_application::remove()
{
const char ap = (curr_mask().get(FLD_SC1_ANNO)[0] == 'A') ? 'P' : 'A';
if (yesno_box(format("Cancellare il socio anche per l' anno %s?", ap == 'A' ? "in corso" : "precedente")))
{
_rel->save_status();
_rel->lfile().put("ATTPREC", ap);
if (_rel->read(_isequal, _lock) == NOERR)
{
const int err = _rel->remove();
if (err != NOERR)
error_box("Cancellazione socio anno %s - Errore : %d", ap == 'A' ? "in corso" : "precedente", err);
}
_rel->restore_status();
}
return TRelation_application::remove();
}
bool TSoci_application::user_create() bool TSoci_application::user_create()
{ {
_rel = new TRelation(LF_SOCI) ; _rel = new TRelation(LF_SOCI) ;