home *** CD-ROM | disk | FTP | other *** search
- ********** Costtime COMMAND FILE **********
- * Accepts time sheet entries for employees using a transaction
- * file called Gettemp. For data entry.
- * Gettemp is used because the operator can decide to quit on an incomplete
- * entry. In that case, the entry is marked for deletion, and when the data is
- * APPENDed to the Postfile, these entries are eliminated (the APPEND command
- * does not transfer records marked for deletion).
- * After all entries are made, entries are checked for the
- * correct range of employee numbers and to see that hours have
- * been entered. Using Gettemp, we can check the entries without
- * having to go through the entire Postfile.
- * After checking the names against our Supplier file, the billing
- * amounts are computed.
- * The records are then transferred to the Postfile and the
- * temporary file Gettemp is deleted.
- **************************************************************
- *
- *
- *
- SELECT 1
- Timing = 'Y'
- DO WHILE Timing <> ' '
- APPEND BLANK
- *
- Entering = .T.
- CLEAR
- DO WHILE Entering
- Row = 0
- @ 1,0 SAY 'Employee Time Sheets'
- @ 3,0 SAY ' Entry' + STR(RECNO(),5)
- @ 5,0 SAY ' DATE WORKED' GET Bill_Date
- @ 6,0 SAY ' CLIENT' GET Client Picture '!!!'
- @ 7,0 SAY ' JOB NUMBER' GET Job_Nmbr
- @ 8,0 SAY ' HOURS WORKED' GET Hours
- @ 9,0 SAY ' EMPLOYEE NUMBER' GET Emp_Nmbr
- @ 10,0 SAY ' EMPLOYEE NAME' GET Name Picture '!!!!!!!!!!!!!!!!!!!!'
- READ
- *
- REPLACE Check_Nmbr WITH '----', Check_Date WITH Bill_Date
- *
- * The following sequence of IF statments flags all entry errors, then
- * gives the operator the choice of fixing them or ending the procedure.
- *
- @ 12,0 CLEAR
- IF ' ' $ Client
- @ 12+Row,0 SAY ' CLIENT must have three letters.'
- Row = Row + 1
- ENDIF
- *
- IF Job_Nmbr < 1000 .AND. Job_Nmbr <> 31
- @ 12+Row,0 SAY ' JOB # is not for a client job.'
- Row = Row + 1
- ENDIF
- *
- IF .NOT. (Hours > 0)
- @ 12+Row,0 SAY ' HOURS must be entered. '
- Row = Row + 1
- ENDIF
- *
- IF Emp_Nmbr <= 0
- @ 12+Row,0 SAY ' EMPLOYEE # wrong. '
- Row = Row + 1
- ENDIF
- *
- IF SUBSTR(Name,1,1) = ' '
- @ 12+Row,0 SAY ' NAME must not start WITH a blank.'
- Row = Row + 1
- ENDIF
- *
- Timing = ' '
- @ 14+Row,0 SAY ' &F3 to CONTINUE,'
- @ 15+Row,0 SAY ' &F4 to EDIT,'
- @ 16+Row,0 SAY 'Press <ENTER> to terminate entry. '
- SET COLOR TO ,
- @ 16+Row,40 GET Timing
- READ
- SET COLOR TO W, ,W
- *
- @ 12+row,0 CLEAR
- Entering = .F.
- *** IF Row is greater than zero an error has occurred ***
- IF Row > 0 .AND. ( Timing = ' ' .OR. UPPER(Timing) = 'C' )
- DELETE
- ELSE
- IF (Timing <> ' ' .AND. UPPER(Timing) <> 'C')
- Entering = .T.
- ENDIF
- ENDIF
- ENDDO Entering
- ENDDO Timing
- *
- *
- COUNT FOR .NOT. DELETED() TO Any
- IF Any = 0
- CLEAR
- @ 3,0 SAY ' No entries to add to the PostFile. '
- WAIT
- ELSE
- *
- * Checks names against a list of suppliers to catch spelling and
- * abbreviation inconsistencies.
- DO Nametest WITH "1"
- *
- * Verifies match between employee name and number, then computes the amount
- * to be billed for the employee's time based on his salary.
- DO Timecalc
- *
- CLEAR
- @ 3,25 SAY " *** DO NOT INTERRUPT ***"
- @ 5,25 SAY " UPDATING THE POSTING FILE"
- SELECT 1
- GO TOP
- DO WHILE .NOT. EOF()
- IF .NOT. DELETED()
- SELECT 2
- APPEND BLANK
- REPLACE Check_date WITH A->Check_date,Check_nmbr WITH A->Check_nmbr,;
- Client WITH A->Client,Job_nmbr WITH A->Job_nmbr,Amount WITH ;
- A->Amount,Name WITH A->Name
- REPLACE Descrip WITH A->Descrip,Bill_date WITH A->Bill_date,Bill_nmbr;
- WITH A->Bill_nmbr,Hours WITH A->Hours,Emp_nmbr WITH A->Emp_nmbr
- SELECT 1
- ENDIF
- SKIP
- ENDDO
- ENDIF
- *
- ZAP
- RETURN