home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
xbase
/
library
/
dbase
/
billing
/
procfile.prg
< prev
next >
Wrap
Text File
|
1986-11-10
|
3KB
|
76 lines
PROCEDURE headline
SET COLOR TO W+
@ 1,27 SAY "TENNESSEE DATA CONSULTING"
@ 2,27 SAY "7003 Chadwick, Suite 265"
@ 3,30 SAY "Brentwood, TN 37027"
@ 4,33 SAY "(615)377-6253"
SET COLOR TO W
@ 6,5 SAY clt->c_name
@ 7,5 SAY clt->street
@ 8,5 SAY TRIM(clt->city)+", "+clt->state+" "+clt->zip
@ 10,5 SAY "Statement for services provided during "+CMONTH(DATE()-15)+"."
@ 12,5 SAY " DATE DESCRIPTION OF TASK HOURS CHARGES"
@ 13,5 SAY "-------- ----------------------------------------- ----- -------"
RETURN
PROCEDURE get_task
* if you want to see how the search works, replace all [*?] with [?]
*
*date_key=STR(m_client,3,0)+SUBSTR(DTOC(start_date),7,2)+SUBSTR(DTOC(start_date),1,2)+SUBSTR(DTOC(start_date),4,2)
SET DATE ANSI
date_key=STR(m_client,3,0)+DTOC(start_date)
looking=.T.
DO WHILE looking
*look for specific client/date
SELECT task
*? "seek1 for "+date_key
SEEK date_key
*?? " found client="+str(c_code,3,0)+" task_date="+dtoc(taskdate)
IF .NOT. FOUND()
*look for client year/month group
*? "seek2 for "+STR(m_client,3,0)+SUBSTR(DTOC(start_date),7,2)+SUBSTR(DTOC(start_date),1,2)
*SEEK STR(m_client,3,0)+SUBSTR(DTOC(start_date),7,2)+SUBSTR(DTOC(start_date),1,2)
SEEK SUBSTR(date_key,1,8)
*?? "found client="+str(c_code,3,0)+" task_date="+dtoc(taskdate)
*? "check for desired record before locate step"
IF c_code=m_client .AND. taskdate>=start_date .AND. taskdate<end_date
*? "eurika! found by month w/o locate step"
EXIT
ENDIF c_code=m_client .AND. taskdate=start_date
IF .NOT. FOUND()
*? "no find on client code + month requested"
*nothing this month, so try next client; but get last one
SELECT clt
SEEK m_client
IF c_code=0
SET DATE AMERICAN
RETURN
ELSE
SKIP
ENDIF c_code=0
m_client=c_code
SELECT task
*date_key=STR(m_client,3,0)+SUBSTR(DTOC(start_date),7,2)+SUBSTR(DTOC(start_date),1,2)+SUBSTR(DTOC(start_date),4,2)
date_key=STR(m_client,3,0)+DTOC(start_date)
*? "cycle to next client with date_key = "+date_key
LOOP
ELSE
*get next best date
*? "nothing found by date; locating from "+str(c_code,3,0)+dtoc(taskdate)
LOCATE FOR c_code=m_client .AND. taskdate>=start_date .AND. taskdate<end_date
*? "located record "+str(c_code,3,0)+dtoc(taskdate)
IF .NOT. FOUND()
CLEAR
@ 12,15 SAY "CANNOT LOCATE KEY DATE OF "+CMONTH(start_date)+" "+STR(DOW(start_date),2,0)
WAIT
RETURN
ENDIF .NOT. FOUND()
ENDIF .NOT. FOUND()
ENDIF .NOT. FOUND()
looking=IIF(FOUND(),.F.,.T.)
ENDDO WHILE looking
*? "resulting record is "+str(c_code,3,0)+dtoc(taskdate)
*wait
SET DATE AMERICAN
RETURN