home *** CD-ROM | disk | FTP | other *** search
- ********** Timecalc COMMAND FILE **********
- * Verifies that employee name and number match, then
- * calculates billing charges for employee time.
- ********************************************************
- *
- RESTORE FROM Konstant ADDI
- CLEAR
- *
- *
- SELECT 2
- DO WHILE .NOT. EOF()
- CLEAR
- @ 4,20 SAY ' ** DO NOT INTERRUPT ** '
- @ 5,20 SAY ' PROCESSING TIME CHARGES '
- *
- * A job number of 31 means that the entry in the Postfile is a salary
- * salary payment, not an entry for time worked on a client job, so we
- * skip it. We also skip deleted records. The only valid entries for
- * employee time sheets have '---' entered as the check number by our
- * Costtime command file.
- *
- IF DELETED() .OR. Job_Nmbr = 31 .OR. Check_Nmbr <> '---'
- SKIP
- ELSE
- * We first check to see that some time has been entered against a job.
- * If not, the operator can correct the entry or delete the record.
- REPLACE Client WITH UPPER(Client),Name WITH UPPER(Name)
- Number = STR(RECNO(),4)
- @ 7,20 SAY ' Record # '+Number
- @ 8,20 SAY ' '+Name
- ?
- IF Hours <= 0
- CLEAR
- REPLACE Hours WITH Hours*1.00
- @ 4,0
- DISPLAY
- @ 6,16 SAY 'HOURS='
- ?
- ? 'Press &F6 to delete the record,'
- ? 'any other key to correct the HOURS.'
- WAIT ' ' TO Choice
- IF UPPER(Choice) = 'D'
- CLEAR
- DELETE
- DISPLAY
- ?
- ? 'THIS RECORD HAS BEEN DELETED.'
- WAIT
- ELSE
- @ 6,22 GET Hours
- READ
- ENDIF
- ELSE
- SELECT 5
- GO TOP
- Looking = .T.
- DO WHILE Looking .AND. .NOT. EOF()
- Names = Name = SUBSTR(B->Name,1,10)
- Numbers = (Emp_Nmbr = B->Emp_Nmbr)
- DO CASE
- CASE .NOT. Names .AND. .NOT. Numbers
- SKIP
- CASE Names .AND. .NOT. Numbers
- SELECT 2
- CLEAR
- @ 4,0
- DISPLAY
- @ 6,33 SAY '=EMPLOYEE NUMBER'
- @ 8,0
- ? TRIM(E->Name)
- ?? ' is Employee Number '
- ?? E->Emp_Nmbr
- ?
- ? 'Press ANY KEY to change the EMPLOYEE NUMBER'
- ? 'or press &F6 to DELETE the entry.'
- WAIT ' ' TO Choice
- IF UPPER(Choice) <> 'D'
- REPLACE Emp_Nmbr WITH E->Emp_Nmbr
- SELECT 5
- GO TOP
- ELSE
- DELETE
- Looking = .F.
- ENDIF Employee number
- CLEAR
- CASE Numbers .AND. .NOT. Names
- SELECT 2
- CLEAR
- @ 4,0
- DISPLAY
- @ 6,33 SAY '=EMPLOYEE NUMBER'
- ?
- ? TRIM(E->Name)
- ?? ' is Employee Number '
- ?? E->Emp_Nmbr
- ?
- ? 'Press ANY KEY to change the NAME'
- ? 'or press &F6 to DELETE the entry.'
- WAIT ' ' TO Choice
- IF UPPER(Choice) <> 'D'
- REPLACE Emp_Nmbr WITH E->Emp_Nmbr
- SELECT 5
- GO TOP
- ELSE
- DELETE
- Looking = .F.
- ENDIF Employee number
- CLEAR
- CASE Names .AND. Numbers
- SELECT 2
- REPLACE Amount WITH E->Pay_Rate*2.6*Hours/65
- SELECT 5
- Looking = .F.
- ENDCASE
- *
- IF EOF()
- CLEAR
- SELECT 2
- @ 4,0
- DISPLAY
- ? 'This name is not listed in the Personnel file,'
- ? 'so time charges were not calculated.'
- ? 'Press any key to edit the entry,'
- ? 'or press &F6 to DELETE.'
- WAIT ' ' TO Change
- IF UPPER(Change)<> 'D'
- EDIT
- REPLACE Name WITH UPPER(Name)
- SKIP -1
- ELSE
- DELETE
- ENDIF Change
- SELECT 5
- ENDIF no name
- ENDDO Looking
- SELECT 2
- SKIP
- ENDIF
- ENDIF deleted
- ENDDO billing calculations
- *
- RETURN