home *** CD-ROM | disk | FTP | other *** search
-
-
- * COSTTIME.CMD
- * Accepts time sheet entries for employees using a temporary file called
- * GetTime. For data entry.
- * GetTime 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 GetTime
- * we can check the entries without having to go through the entire PostFile.
- * After verifying that the dates are in the right format and
- * checking the names against our Suppliers file, the billing amounts are
- * computed.
- * The records are then transferred to the CostFile and the temporary
- * file GetTime is deleted.
-
- @ 0,25 SAY ' TIME SHEETS '
-
- RESTORE FROM Constant
- USE PostFile
- COPY STRUCTURE TO GetTime
-
- USE GetTime
- STORE 'Y' TO Time
- DO WHILE !(Time) <> 'F'
- APPEND BLANK
- STORE STR(#,5) TO Number
-
- STORE T TO Entering
- DO WHILE Entering
- ERASE
- STORE F TO Entering
- @ 1,0 SAY ' RECORD NUMBER: ' -NUMBER
- @ 3,0 SAY ' DATE WORKED' GET Bill:Date
- @ 4,0 SAY ' CLIENT' GET Client
- @ 5,0 SAY ' JOB NUMBER' GET Job:Nmbr
- @ 6,0 SAY ' HOURS WORKED' GET Hours
- @ 7,0 SAY ' EMPLOYEE NUMBER' GET Emp:Nmbr
- @ 8,0 SAY ' EMPLOYEE NAME' GET Name
- READ
-
- REPLACE Check:Nmbr WITH '----', Check:Date WITH Bill:Date,;
- Client WITH !(Client), Name WITH !(Name)
- @ 4,21 SAY Client
- @ 8,21 SAY Name
-
- * The following sequence of IF statements flags all entry errors, then
- * gives the operator the choice of fixing them or ending the procedure.
-
- ?
- IF $(Client,1,1)=' '.OR. $(Client,2,1) =' ' .OR. $(Client,3,1) =' '
- ? ' CLIENT must have three letters.'
- STORE T TO Entering
- ENDIF
-
- IF Job:Nmbr < 100
- ? ' JOB # is not for a client job.'
- ? ' Is this right (Y or N)?'
- WAIT TO Ask
- IF !(Ask) <> 'Y'
- STORE T TO Entering
- ENDIF
- ENDIF
-
- IF .NOT. (Hours > 0)
- ? ' HOURS must be entered. '
- STORE T TO Entering
- ENDIF
-
- IF .NOT.(Emp:Nmbr>0 .AND. Emp:Nmbr<=MaxEmpl)
- ? ' EMPLOYEE # out of range. '
- STORE T TO Entering
- ENDIF
-
- IF $(Name,1,1) = ' '
- ? ' NAME must not start with a blank.'
- STORE T TO Entering
- ENDIF
-
- IF Entering
- ?
- ?
- ? ' F if FINISHED,'
- ACCEPT ' <Return> to change' TO Time
-
- * If the operator decides to quit on an incomplete entry, it is
- * marked for deletion so that it is not transferred to the PostFile.
- IF !(Time) = 'F'
- DELETE RECORD &Number
- STORE F TO Entering
- ENDIF
- ELSE
- ?
- ? ' C to CHANGE,'
- ? ' F if FINISHED,'
- ACCEPT ' <Return> to continue' TO Time
- IF !(Time) = 'C'
- STORE T TO Entering
- ENDIF
- ENDIF
- ENDDO Entering
- ENDDO Time
-
- COUNT FOR .NOT. * TO Any
- IF Any = 0
- ERASE
- @ 3,0 SAY ' No entries to add to the CostFile. '
- ? ' <Return to the menu. '
- USE
- WAIT
- ELSE
-
- * The test for the date needs the name of the date field to be tested.
- STORE 'Bill:Date' TO Date
- DO DateTest
-
- * Checks names against a list of suppliers to catch spelling and
- * abbreviation inconsistencies.
- DO NameTest
-
- * 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
-
- ERASE
-
- @ 3,25 SAY " *** DO NOT INTERRUPT *** "
- @ 5,25 SAY " UPDATING THE POSTING FILE"
- USE PostFile
- APPEND FROM GetTime
- ENDIF
-
- DELETE FILE GetTime
- RELEASE ALL
- RETURN
-