OTTO ExPerience Support
Posted: Sun Aug 28, 2011 12:27 am
Dear Otto,
I saw you made an application for Hotel
and I m asking if you could resolve my problem
I'm making a app for Bungalow
and I have problems with rango dates I think you have resolve this problem on your hotel application
I explain you
I made a dialog with btnbmp and for each btn I assign a cargo if is free,is occupated, is notpayed, is daily ,is reservation (nstate= 1,2,3,4,5)
then I have a dbf where I insert the reservations with these field NUMTABLE, DATAIN , DATAFIN , TIPO
NUMTBLE is numeric and it is the number of Bungalow
DATAIN is the priod from
DATAFIn is the period To
TIPO is the type of Bungalow
on a ribbonbar I insert two datepick control where the final user select a rango dates the I cal a function to show or change btnbmp file
on my function I made :
For n=1 to 100
IF RESERVATION-> DBSEEK(n) //searh the number of bungalow on reservation archive
IF RE->NUMTABLE=n .AND.;
( ;
( RE->DATAIN >= dDataIni .AND. RE->DATAFIN >= dDataIni ) .or. ;
( dDataFin <= RE->DATAIN .AND. RE->DATAFIN <= dDataFin );
)
nState := 2 //occupated
cPos:=RE->Ccustomer
ELSE
nState := 1 //free
cPos:="Bungalow "+str(n)
ENDIF
IF RE->NUMTABLE=n .AND.;
( ;
( RE->DATAIN = dDataIni .AND. RE->DATAFIN = dDataIni );
)
nStato :=5 //DAILY
ENDIF
IF nStato=2
IF re->diff=0 //if the customer have to pay also
nStato :=2 // occupated
ELSE
nStato :=3 // the customer must also to pay
ENDIF
ENDIF
ENDIF
then I show the bungalow btnbmp with setfile and change the bmp for the nstate numbers
the problem is this
on reservation archive (I have only an index on NUMTABLE) I have for a sample
NUMTABLE DATAIN DATAFIN TIPO
1 04.08.11 08.04.11 O
11 04.08.11 04.08.11 O
53 07.08.11 07.08.11 O
if I select 04.08.11 to 04.08.11
the procedure show me
the number 1 with right bmp ( nstate= 3) ,
the number 11 with right bmp (nstate= 5 daily) ,
and the number 53 with wrong bmp
but why it show me the number 53 if the user select the rango date 04.08.11 to 04.08.11 ?
If I have many reservation sometimes give me a right plan visualization and sometimes give me it bad
I hope you understand and you can resolve this problem ...
I saw you made an application for Hotel
and I m asking if you could resolve my problem
I'm making a app for Bungalow
and I have problems with rango dates I think you have resolve this problem on your hotel application
I explain you
I made a dialog with btnbmp and for each btn I assign a cargo if is free,is occupated, is notpayed, is daily ,is reservation (nstate= 1,2,3,4,5)
then I have a dbf where I insert the reservations with these field NUMTABLE, DATAIN , DATAFIN , TIPO
NUMTBLE is numeric and it is the number of Bungalow
DATAIN is the priod from
DATAFIn is the period To
TIPO is the type of Bungalow
on a ribbonbar I insert two datepick control where the final user select a rango dates the I cal a function to show or change btnbmp file
on my function I made :
For n=1 to 100
IF RESERVATION-> DBSEEK(n) //searh the number of bungalow on reservation archive
IF RE->NUMTABLE=n .AND.;
( ;
( RE->DATAIN >= dDataIni .AND. RE->DATAFIN >= dDataIni ) .or. ;
( dDataFin <= RE->DATAIN .AND. RE->DATAFIN <= dDataFin );
)
nState := 2 //occupated
cPos:=RE->Ccustomer
ELSE
nState := 1 //free
cPos:="Bungalow "+str(n)
ENDIF
IF RE->NUMTABLE=n .AND.;
( ;
( RE->DATAIN = dDataIni .AND. RE->DATAFIN = dDataIni );
)
nStato :=5 //DAILY
ENDIF
IF nStato=2
IF re->diff=0 //if the customer have to pay also
nStato :=2 // occupated
ELSE
nStato :=3 // the customer must also to pay
ENDIF
ENDIF
ENDIF
then I show the bungalow btnbmp with setfile and change the bmp for the nstate numbers
the problem is this
on reservation archive (I have only an index on NUMTABLE) I have for a sample
NUMTABLE DATAIN DATAFIN TIPO
1 04.08.11 08.04.11 O
11 04.08.11 04.08.11 O
53 07.08.11 07.08.11 O
if I select 04.08.11 to 04.08.11
the procedure show me
the number 1 with right bmp ( nstate= 3) ,
the number 11 with right bmp (nstate= 5 daily) ,
and the number 53 with wrong bmp
but why it show me the number 53 if the user select the rango date 04.08.11 to 04.08.11 ?
If I have many reservation sometimes give me a right plan visualization and sometimes give me it bad
I hope you understand and you can resolve this problem ...