Patch level :2.0 448

Files correlati     :ba3.exe
Ricompilazione Demo : [ ]
Commento            :
LL700257
Solo in fase di inserimento obbligare l'utente a digitare un codice di tre cifre (tabella magazzini)

LL700258
Solo in fase di inseriemtno obbligare l'utente a digitare un codice di tre cifre (tabella grmerceolog)


git-svn-id: svn://10.65.10.50/trunk@10989 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2003-04-08 10:31:31 +00:00
parent 89a6eb102a
commit 08f2bf3004

View File

@ -21,6 +21,8 @@
#define TAB_REGISTRI "REG"
#define TAB_VALUTE "%VAL"
#define TAB_VERSAMENTI "%VER"
#define TAB_MAGAZZINI "MAG"
#define TAB_GRMERC "GMC"
class TGeneric_table_app : public TTable_application
{
@ -47,6 +49,8 @@ protected:
static bool valute_decimals_handler(TMask_field& f, KEY k);
static bool change_decimals_handler(TMask_field& f, KEY k);
static bool codcab_handler(TMask_field& f, KEY k);
static bool codmag_handler(TMask_field& f, KEY k);
static bool codgmc_handler(TMask_field& f, KEY k);
public:
bool exist_journal() { return _exist_journal; }
@ -291,11 +295,6 @@ HIDDEN bool coddel_handler(TMask_field& f, KEY k)
const short id = f.dlg();
const long cod = m.get_long(id == F_BANCA1 ? F_BANCA1 : F_CONCESSIONE);
//if (id == F_BANCA1)
// if (cod != 0)
// m.hide(F_CONCESSIONE);
//if (id == F_CONCESSIONE || id == F_BANCA1)
if (cod != 0)
{
const long firm = m.get_long(F_DITTA);
@ -409,7 +408,7 @@ HIDDEN bool impdel_handler(TMask_field& f, KEY k)
HIDDEN bool mese_handler(TMask_field& f, KEY k)
{
// if (!f.mask().query_mode() && k == K_ENTER)
if (k == K_ENTER)
{
TMask& m = f.mask();
@ -545,6 +544,40 @@ bool TGeneric_table_app::codcab_handler(TMask_field& f, KEY k)
}
return TRUE;
}
bool TGeneric_table_app::codmag_handler(TMask_field& f, KEY k)
{
TMask& m = f.mask();
if (m.query_mode() && k == K_ENTER)
{
const TString& codice = m.get(f.dlg()); //stringa immessa nella maschera
const TString& codtab = cache().get("MAG", codice, "CODTAB"); //stringa cercata nella tabella
if (codtab.empty()) //se non trovi la stringa in tabella (in codice magazzino non esiste->se in insert mode)
{
const int lungh = codice.len();
if (lungh > 0 && lungh < 3)
return f.error_box("Il codice magazzino deve avere obbligatoriamente lunghezza 3");
}
}
return TRUE;
}
bool TGeneric_table_app::codgmc_handler(TMask_field& f, KEY k)
{
TMask& m = f.mask();
if (m.query_mode() && k == K_ENTER)
{
const TString& codice = m.get(f.dlg()); //stringa immessa nella maschera
const TString& codtab = cache().get("GMC", codice, "CODTAB"); //stringa cercata nella tabella
if (codtab.empty()) //se non trovi la stringa in tabella (in codice magazzino non esiste->se in insert mode)
{
const int lungh = codice.len();
if (lungh > 0 && lungh < 3)
return f.error_box("Il codice del gruppo merceologico deve avere obbligatoriamente lunghezza 3");
}
}
return TRUE;
}
bool TGeneric_table_app::user_create()
{
@ -602,6 +635,12 @@ bool TGeneric_table_app::user_create()
if (name == TAB_BANCHE)
mask.set_handler(102, codcab_handler);
if (name == TAB_MAGAZZINI)
mask.set_handler(101, codmag_handler);
if (name == TAB_GRMERC)
mask.set_handler(101, codgmc_handler);
}
return ok;