Patch level :2.2 nopatch

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :sempre modulo LI


git-svn-id: svn://10.65.10.50/trunk@12921 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2005-04-07 13:39:10 +00:00
parent dc2e614310
commit b947d26c8a
2 changed files with 44 additions and 22 deletions

View File

@ -26,22 +26,39 @@ public:
bool TLetint_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
{
switch (o.dlg())
{
case F_DATAREG:
if (e == fe_close)
{
case F_NUMPROT:
if (e == fe_close && query_mode())
{
const int anno = get_int(F_ANNO);
const long numprot = get_long(F_NUMPROT);
TLocalisamfile letint(LF_LETINT);
letint.setkey(1);
letint.put(LETINT_ANNO, anno);
letint.put(LETINT_NUMPROT, numprot);
letint.prev();
const TDate& old_data = letint.get_date(LETINT_DATAREG);
if (get_date(F_DATAREG) < old_data)
return error_box(TR("La data di registrazione non puo' essere antecedente a %s"), (const char*) old_data.string());
if (numprot > 1)
{
const int anno = get_int(F_ANNO);
TLocalisamfile letint(LF_LETINT);
letint.put(LETINT_ANNO, anno);
letint.put(LETINT_NUMPROT, numprot - 1);
if (letint.read() != NOERR)
return error_box(TR("Il numero di protocollo deve essere progressivo!"));
}
}
break;
case F_DATAREG:
if (e == fe_close && insert_mode())
{
const long numprot = get_long(F_NUMPROT);
if (numprot > 1)
{
const int anno = get_int(F_ANNO);
TLocalisamfile letint(LF_LETINT);
letint.put(LETINT_ANNO, anno);
letint.put(LETINT_NUMPROT, numprot);
if (letint.read() == NOERR)
{
const TDate& old_data = letint.get_date(LETINT_DATAREG);
if (get_date(F_DATAREG) < old_data)
return error_box(TR("La data di registrazione non puo' essere antecedente a %s"), (const char*) old_data.string());
}
}
}
break;

View File

@ -15,11 +15,17 @@ NUMBER F_ANNO 4
BEGIN
PROMPT 1 2 "Anno "
FLAGS "AU"
USE LF_LETINT
USE LF_LETINT
JOIN LF_CLIFO INTO TIPOCF="C" CODCF=CODCLI
INPUT ANNO F_ANNO
DISPLAY "Anno@8" ANNO
DISPLAY "Numero protocollo@30" NUMPROT
INPUT NUMPROT F_NUMPROT
DISPLAY "Anno" ANNO
DISPLAY "N.Protocollo" NUMPROT
DISPLAY "Data Reg.@10" DATAREG
DISPLAY "Cliente" CODCLI
DISPLAY "Ragione sociale@50" LF_CLIFO->RAGSOC
OUTPUT F_ANNO ANNO
OUTPUT F_NUMPROT NUMPROT
CHECKTYPE REQUIRED
FIELD ANNO
KEY 1
@ -29,11 +35,7 @@ NUMBER F_NUMPROT 6
BEGIN
PROMPT 15 2 "Numero protocollo "
FLAGS "U"
USE LF_LETINT
INPUT NUMPROT F_NUMPROT
DISPLAY "Numero protocollo@30" NUMPROT
DISPLAY "Anno@8" ANNO
OUTPUT F_NUMPROT NUMPROT
COPY ALL F_ANNO
CHECKTYPE REQUIRED
FIELD NUMPROT
KEY 1
@ -191,6 +193,7 @@ CURRENCY F_IMPORTO 18
BEGIN
PROMPT 1 17 "Importo "
FIELD IMPORTO
CHECKTYPE REQUIRED
END
DATE F_DAL
@ -198,6 +201,7 @@ BEGIN
PROMPT 1 18 "Data inizio periodo "
GROUP 1
FIELD DAL
CHECKTYPE REQUIRED
END
DATE F_AL
@ -205,6 +209,7 @@ BEGIN
PROMPT 1 19 "Data fine periodo "
GROUP 1
FIELD AL
CHECKTYPE REQUIRED
VALIDATE DATE_CMP_FUNC >= F_DAL
WARNING "Specificare una 'Data fine periodo' non inferiore alla 'Data inizio perodo'"
END