Patch level : 12.0 376
Files correlati : li Commento : Sistemati controlli dichiarazione di intento. Tutti i problemi per le dichiarazioni di intento di tipo "Nel periodo" sono stati sistemati, con i tasti Shift+F12 è possibile disabilitare tutti i controlli e con i tasti Shift+F11 si riabilitano. git-svn-id: svn://10.65.10.50/branches/R_10_00@23706 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
da49bf46f0
commit
cc4e2ee949
@ -20,6 +20,7 @@ protected:
|
|||||||
bool hasLiOpen();
|
bool hasLiOpen();
|
||||||
|
|
||||||
bool block;
|
bool block;
|
||||||
|
bool keyforced;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TDate ultima_stampa(int anno);
|
TDate ultima_stampa(int anno);
|
||||||
@ -32,13 +33,12 @@ bool TLetint_mask::on_key(KEY k)
|
|||||||
{
|
{
|
||||||
if (k == K_SHIFT+K_F12 && (edit_mode() || insert_mode()))
|
if (k == K_SHIFT+K_F12 && (edit_mode() || insert_mode()))
|
||||||
{
|
{
|
||||||
|
keyforced = true;
|
||||||
enable(DLG_SAVEREC);
|
enable(DLG_SAVEREC);
|
||||||
if(get_int(F_TIPOOP) == 3) // Nel periodo
|
enable(F_NUMPROT);
|
||||||
{
|
|
||||||
enable(F_DAL);
|
|
||||||
enable(F_AL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if (k == K_SHIFT+K_F11)
|
||||||
|
keyforced = false;
|
||||||
return TAutomask::on_key(k);
|
return TAutomask::on_key(k);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ bool TLetint_mask::on_field_event(TOperable_field& o, TField_event e, long jolly
|
|||||||
if (e == fe_close && query_mode())
|
if (e == fe_close && query_mode())
|
||||||
{
|
{
|
||||||
const long numprot = get_long(F_NUMPROT);
|
const long numprot = get_long(F_NUMPROT);
|
||||||
if (numprot > 1)
|
if (!keyforced && numprot > 1)
|
||||||
{
|
{
|
||||||
const int anno = get_int(F_ANNO);
|
const int anno = get_int(F_ANNO);
|
||||||
TLocalisamfile letint(LF_LETINT);
|
TLocalisamfile letint(LF_LETINT);
|
||||||
@ -67,6 +67,7 @@ bool TLetint_mask::on_field_event(TOperable_field& o, TField_event e, long jolly
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case F_DATAREG:
|
case F_DATAREG:
|
||||||
if (e == fe_close && insert_mode())
|
if (e == fe_close && insert_mode())
|
||||||
{
|
{
|
||||||
@ -93,51 +94,53 @@ bool TLetint_mask::on_field_event(TOperable_field& o, TField_event e, long jolly
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case F_CODCLI:
|
case F_CODCLI:
|
||||||
// Controllo se il cliente non ha già una dichiarazione aperta
|
// Controllo se il cliente non ha già una dichiarazione aperta
|
||||||
if(hasLiOpen() && insert_mode())
|
if(!keyforced && hasLiOpen() && insert_mode())
|
||||||
{
|
{
|
||||||
warning_box("Il cliente %d ha già una dichiarazione aperta! Chiudere prima la precedente!", get_int(F_CODCLI));
|
warning_box("Il cliente %d ha già una dichiarazione aperta! Chiudere prima la precedente!", get_int(F_CODCLI));
|
||||||
|
|
||||||
disable(DLG_SAVEREC);
|
disable(DLG_SAVEREC);
|
||||||
block = true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
enable(DLG_SAVEREC);
|
enable(DLG_SAVEREC);
|
||||||
enable(F_TIPOOP);
|
|
||||||
}
|
}
|
||||||
|
case F_DAL:
|
||||||
|
if(e != fe_modify)
|
||||||
|
break;
|
||||||
case F_TIPOOP:
|
case F_TIPOOP:
|
||||||
switch(get_int(F_TIPOOP))
|
// Controlli
|
||||||
|
if(!keyforced && insert_mode() && get_int(F_TIPOOP) == 3 && get_date(F_DAL) > TDate(01,03,2017))
|
||||||
|
{
|
||||||
|
error_box(TR("Non può esistere una dichiarazione di intento di tipo \"A Periodo\"\ncon data posteriore al 01/03/2017!"));
|
||||||
|
disable(DLG_SAVEREC);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
enable(DLG_SAVEREC);
|
||||||
|
}
|
||||||
|
// Abilitazione date
|
||||||
|
switch (get_int(F_TIPOOP))
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
if(!block) enable(DLG_SAVEREC);
|
|
||||||
disable(F_DAL);
|
disable(F_DAL);
|
||||||
disable(F_AL);
|
disable(F_AL);
|
||||||
|
set(F_DAL, "");
|
||||||
|
set(F_AL, "");
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if(!block) enable(DLG_SAVEREC);
|
|
||||||
enable(F_DAL);
|
enable(F_DAL);
|
||||||
disable(F_AL);
|
disable(F_AL);
|
||||||
|
set(F_AL, "");
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
{
|
enable(F_DAL);
|
||||||
disable(DLG_SAVEREC);
|
enable(F_AL);
|
||||||
disable(F_DAL);
|
|
||||||
disable(F_AL);
|
|
||||||
if(!insert_mode())
|
|
||||||
{
|
|
||||||
// Chiudo la dichiarazione di intento
|
|
||||||
TRectype liclosed = cache().get(LF_LETINT, TString(get(F_ANNO)) << "|" << get_int(F_NUMPROT));
|
|
||||||
liclosed.put("CHIUSA", "X");
|
|
||||||
liclosed.rewrite(TLocalisamfile(LF_LETINT));
|
|
||||||
set(B_CHIUSA, true);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -182,7 +185,7 @@ TDate TLetint_mask::ultima_stampa(int anno)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TLetint_mask::TLetint_mask() : TAutomask("li0400a"), block(false)
|
TLetint_mask::TLetint_mask() : TAutomask("li0400a"), block(false), keyforced(false)
|
||||||
{
|
{
|
||||||
first_focus(F_ANNO);
|
first_focus(F_ANNO);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user