Corretta disabilitazione delle pagine 4..8 in caso di fornitore.

Aggiunta la lettura da tabella %SAD per le spese da addebitare.


git-svn-id: svn://10.65.10.50/trunk@236 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
angelo 1994-09-14 15:50:45 +00:00
parent 0daf91d29c
commit ea7293e662

View File

@ -216,6 +216,25 @@ HIDDEN bool tipo_handler(TMask_field& f, KEY key)
return TRUE;
}
HIDDEN bool tipocf_handler(TMask_field& f, KEY key)
{
TMask& m = f.mask();
const bool cf = (f.get() == "F");
if (key == K_TAB)
{
if (cf || !gest_vend()) // If it's a FORNICATOR disable pages
for (int j=3; j<8;j++)
m.disable_page(j);
else // If it's a CUSTOMER enable pages
{
for (int j=3; j<8;j++)
m.enable_page(j);
}
}
return TRUE;
}
HIDDEN bool percip_handler(TMask_field& f, KEY key)
{
@ -340,12 +359,13 @@ void CG0200_application::init_pages(TMask& m)
{
TConfig conf(CONFIG_DITTA, "cg");
const bool tipocf=(m.get(F_TIPOCF) == "F");
lbcn = (conf.get("GsLbCn") == "X");
m.send_key(K_SHIFT + K_CTRL + (lbcn ? 's' : 'h'), -5);
// Se non e' abilitata la gestione delle vendite disabilita le
// maschere dalla 4 in poi
if (!gest_vend())
if (!gest_vend() || tipocf)
{
for (int j=3; j<8;j++)
m.disable_page(j);
@ -570,6 +590,7 @@ bool CG0200_application::user_create() // initvar e arrmask
_pcon = new TLocalisamfile(LF_PCON);
_comuni = new TLocalisamfile(LF_COMUNI);
_msk = new TMask("cg0200a") ;
_msk->set_handler(F_TIPOCF,tipocf_handler);
_msk->set_handler(F_OCCASIONALE, occas_handler);
_msk->set_handler(F_COFI, autoexit_handler);
_msk->set_handler(F_PAIV, autoexit_handler);