Corretta gestione codici fiscali e IVA duplicati

git-svn-id: svn://10.65.10.50/trunk@92 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1994-08-30 08:04:56 +00:00
parent 153fc29d92
commit 4584da5e26
3 changed files with 505 additions and 499 deletions

View File

@ -468,7 +468,8 @@ bool BA1100_application::menu(MENU_TAG m)
enable_menu_item(M_FILE_NEW); enable_menu_item(M_FILE_NEW);
} }
return TRUE;
return xvt_test_menu_tag(BAR_ITEM(2));
} }
int ba1100(int argc, char** argv) int ba1100(int argc, char** argv)

View File

@ -54,14 +54,14 @@ public:
bool ba4200_handler(TMask& m, KEY k) bool ba4200_handler(TMask& m, KEY k)
{ {
BA4200_application* app = (BA4200_application*) MainApp(); BA4200_application* app = (BA4200_application*) MainApp();
if (k == K_F10) if (k == K_F10)
{ {
if (app->ana_fis()) app->set_tip_ana(TGIU); if (app->ana_fis()) app->set_tip_ana(TGIU);
else app->set_tip_ana(TFIS); else app->set_tip_ana(TFIS);
m.stop_run(k); m.stop_run(K_ESC);
return FALSE; return FALSE;
} }
if (k != K_F5 || m.mode() != MODE_MOD) return TRUE; if (k != K_F5 || m.mode() != MODE_MOD) return TRUE;
@ -98,14 +98,14 @@ bool ba4200_handler(TMask& m, KEY k)
d->read(_iscurr, _lock) ; d->read(_iscurr, _lock) ;
m.set_focus(); m.set_focus();
return FALSE; return FALSE;
} }
void BA4200_application::init_query_mode(TMask& m) void BA4200_application::init_query_mode(TMask& m)
{ {
m.disable(DLG_DITTE); m.disable(DLG_DITTE);
m.enable(DLG_CHGTIP); m.enable(DLG_CHGTIP);
} }
const char* BA4200_application::get_next_key() const char* BA4200_application::get_next_key()
@ -185,7 +185,7 @@ bool gest_nazionalita(TMask_field& f, KEY key)
// Handler dell'ufficio imposte dirette // Handler dell'ufficio imposte dirette
bool gest_uff_imp_nr(TMask_field& f, KEY key) bool gest_uff_imp_nr(TMask_field& f, KEY key)
{ {
/* /*
if (!f.to_check(key)) return TRUE; if (!f.to_check(key)) return TRUE;
const TString cod_uff(f.get()); const TString cod_uff(f.get());
@ -214,7 +214,7 @@ bool gest_uff_imp_nr(TMask_field& f, KEY key)
return f.error_box("L'ufficio deve appartenere al comune di residenza: %s", com); return f.error_box("L'ufficio deve appartenere al comune di residenza: %s", com);
} }
} }
*/ */
return TRUE; return TRUE;
} }
@ -285,22 +285,23 @@ bool no_dup_fis(TMask_field& f, KEY key)
BA4200_application* app = (BA4200_application*) MainApp(); BA4200_application* app = (BA4200_application*) MainApp();
TLocalisamfile& anag = *app->get_relation()->lfile(LF_ANAG) ; TLocalisamfile& anag = *app->get_relation()->lfile(LF_ANAG) ;
const TString cofi(f.get()); const TString16 cofi(f.get());
if ( cofi.not_empty() && !anag.empty() ) if ( cofi.not_empty() )
{ {
beep();
anag.zero() ; anag.zero() ;
anag.put(N_TIPOA, app->tip_ana());
anag.put(N_COFI, cofi ) ; anag.put(N_COFI, cofi ) ;
anag.setkey(3) ; anag.setkey(3) ;
anag.read() ; anag.read() ;
anag.setkey(1) ; anag.setkey(1) ;
char t = anag.get_char(N_TIPOA); const char t = anag.get_char(N_TIPOA), t1 = app->tip_ana();
char t1 = app->tip_ana(); const TString16 s = anag.get(N_CODANAGR), s1 = app->cod_ana();
TString s = anag.get(N_CODANAGR), s1 = app->cod_ana();
if (anag.good() && (t1 != t || s1 != s)) if (anag.good() && (t1 != t || s1 != s))
{ {
f.error_box("Codice fiscale gia' utilizzato per il codice : %c/%s", f.error_box("Codice fiscale gia' utilizzato per il codice %c/%s",
t, (const char*) s); t, (const char*)s);
return FALSE; return FALSE;
} }
} }
@ -318,6 +319,7 @@ bool gest_iva(TMask_field& f, KEY key , short fd_sta ,short fd_iva )
if ( f.get().not_empty() && !anag.empty() ) if ( f.get().not_empty() && !anag.empty() )
{ {
anag.zero() ; anag.zero() ;
anag.put(N_TIPOA, app->tip_ana());
anag.put(N_STATOPAIV, msk.get(fd_sta) ) ; anag.put(N_STATOPAIV, msk.get(fd_sta) ) ;
anag.put(N_PAIV, msk.get(fd_iva) ) ; anag.put(N_PAIV, msk.get(fd_iva) ) ;
anag.setkey(4) ; anag.setkey(4) ;
@ -344,7 +346,7 @@ bool no_dup_iva_f(TMask_field& f, KEY key)
bool no_dup_iva_g(TMask_field& f, KEY key) bool no_dup_iva_g(TMask_field& f, KEY key)
{ {
if (key == K_ENTER && f.get().empty()) if (key == K_ENTER && !f.mask().query_mode() && f.get().empty())
{ {
bool ok = FALSE; bool ok = FALSE;
if (!f.mask().get_bool(CHK_AG1_ENTENCOMM)) if (!f.mask().get_bool(CHK_AG1_ENTENCOMM))
@ -400,12 +402,12 @@ bool BA4200_application::user_create()
{ {
_msk[MSKF] = NULL; _msk[MSKF] = NULL;
_rel[MSKF] = new TRelation(LF_ANAG); _rel[MSKF] = new TRelation(LF_ANAG);
// _rel[MSKF]->add(LF_ANAGFIS, "CODANAGR=CODANAGR", 1, 0, 0, TRUE); verificare // _rel[MSKF]->add(LF_ANAGFIS, "CODANAGR=CODANAGR", 1, 0, 0, TRUE); verificare
_rel[MSKF]->add(LF_ANAGFIS, "CODANAGR=CODANAGR", 1, 0, 0); _rel[MSKF]->add(LF_ANAGFIS, "CODANAGR=CODANAGR", 1, 0, 0);
_msk[MSKG] = NULL; _msk[MSKG] = NULL;
_rel[MSKG] = new TRelation(LF_ANAG); _rel[MSKG] = new TRelation(LF_ANAG);
// _rel[MSKG]->add(LF_ANAGGIU, "CODANAGR=CODANAGR", 1, 0, 0, TRUE); verificare // _rel[MSKG]->add(LF_ANAGGIU, "CODANAGR=CODANAGR", 1, 0, 0, TRUE); verificare
_rel[MSKG]->add(LF_ANAGGIU, "CODANAGR=CODANAGR", 1, 0, 0); _rel[MSKG]->add(LF_ANAGGIU, "CODANAGR=CODANAGR", 1, 0, 0);
_comuni = new TLocalisamfile(LF_COMUNI) ; _comuni = new TLocalisamfile(LF_COMUNI) ;

3
ba/prassi.aut Executable file
View File

@ -0,0 +1,3 @@
ba Base
cg Contabilita' Generale
te Testmask