	REMARK	****************************************\
		*  P/R340.BAS    M-T-D JOB FILE RESET  *\
		*   5/18/79               10:39  AM    *\
		****************************************

%INCLUDE CURSOR

	DIM W(2),W1(2),W2(14),W2$(2),G3(5),G2$(5)
	GOTO 6000
%INCLUDE SUBS1
%INCLUDE GENINFO
6000	Y9=2
	CTRL.C%=1
	OPEN "JOB0F100.DAT" RECL 160 AS 1
	OPEN "G/I0F010.DAT" RECL 200 AS 2				REMARK  OPEN JOB AND GENERAL INFORMATION FILES
	GOSUB 700
6010	PRINT CLEAR.SCREEN$;"CLEAR JOB MTD FIELDS"			REMARK  DISPLAY PROGRAM I.D.
	PRINT "KEY RETURN TO BEGIN; CTRL-C TO EXIT"			REMARK  DISPLAY OPERATOR INSTRUCTIONS ON CRT
	FOR I%=1 TO 6:PRINT:NEXT I%
6011	PRINT "THIS PROGRAM WILL CLEAR ALL MTD FIELDS FOR EVERY JOB ON THE ";
	PRINT "JOB ":PRINT "FILE, SO BE SURE YOU WANT THAT TO HAPPEN BEFORE ";
	PRINT "YOU START IT."
6015	PRINT 
	PRINT "TO END THE PROGRAM WITHOUT CLEARING, PRESS CTRL-C NOW."
	PRINT "IT WILL NOT WORK AFTER THE PROGRAM HAS STARTED."
6021	X1=256:GOSUB 210
	PRINT "DATE: ";
	X0=G3(1):GOSUB 680.5						REMARK  DISPLAY CURRENT DATE
	PRINT "    P/R NUMBER:";G3(4)					REMARK  DISPLAY DAY NUMBER IN PAYROLL PERIOD
	X1=128:GOSUB 210
6050	X1=128:X2=1:X3=0:X4=0:GOSUB 345
	IF X%=3 THEN GOTO 7000
	X2$= "ARE YOU SURE YOU WANT TO CLEAR MTD FIELDS NOW?"
	X2=1:X3=0:X4=1:GOSUB 665					REMARK  PROMPT OPERATOR ONE LAST TIME
	IF X%=3 THEN GOTO 7000
	IF X0 <> 1 THEN GOTO 7000					REMARK  VERIFY ENTRY:'1'=O.K, '0'=EXIT PROGRAM
	FOR K%=1 TO JOB.RECORDS
	READ #1,K%;W(1),W(2)						REMARK  READ FROM JOB FILE; IF W(2)=0, THEN READ DETAIL
	IF W(2)=0 THEN GOTO 6100
	READ #1,K%;W(1),W(2),W2(1),W2(2),W2(3),W2(4),W2(5),W2(6),W2(7),\
	W2(8),W2(9),W2(10),W2(11),W2(12),W2(13),W2(14)
	IF W2(3)=-1 THEN 6100						REMARK  SKIP LOGICALLY DELETED JOB RECORDS
	X1=320:GOSUB 210						REMARK  DISPLAY M-T-D CLEAR STATUS
	PRINT USING "NOW CLEARING JOB ###### -- EMPLOYEE ###";W(1),W(2)
	FOR I%=1 TO 7
	W2(I%)=0							REMARK  SET MONTH-TO-DATE TOTAL TO ZERO
	NEXT I%
	PRINT #1,K%;W(1),W(2),W2(1),W2(2),W2(3),W2(4),W2(5),W2(6),W2(7),\
	W2(8),W2(9),W2(10),W2(11),W2(12),W2(13),W2(14)			REMARK  RE-WRITE CLEARED JOB DETAIL RECORD
6100	NEXT K%
7000	PRINT CLEAR.SCREEN$;"MTD JOB CLEAR LOADING MENU"		REMARK  DISPLAY PROGRAM EXIT MESSAGE
	CHAIN "P/R000"
