**************************************************
* PAYSTUB.CMD - USED TO ENTER PAYROLL STUBS IN THE
*               GENERAL JOURNAL.
**************************************************
ERASE
@ 4,0 SAY " "
STORE " " TO MANS
STORE " " TO MOTH
STORE " " TO MINSD
STORE " " TO MSALAN
STORE " " TO MSALDES
STORE " " TO MCASHAN
STORE " " TO MCASHDES
STORE " " TO MFWHAN
STORE " " TO MFWHDES
STORE " " TO MFICAAN
STORE " " TO MFICADES
STORE " " TO MSWHAN
STORE " " TO MSWHDES
STORE " " TO MINSAN
STORE " " TO MINSDES
STORE " " TO MDEDAN
STORE " " TO MDEDDES
*********************
DO WHILE MSALDES = " "
  STORE " " TO MSALDES
  ACCEPT "Enter SALARIES A/N" TO MSALAN
  USE ANCHART
  LOCATE FOR AN = MSALAN
  IF AN = MSALAN
    STORE DESCR TO MSALDES
? MSALAN, "   ", MSALDES
? " "
  ENDIF
  IF MSALDES = " "
? "ACCOUNT ERROR", MSALAN
? " "
    STORE " " TO MSALAN
? CHR(07)
  ENDIF
  LOOP
ENDDO
*********************
DO WHILE MCASHDES = " "
  STORE " " TO MCASHDES
  ACCEPT "Enter CASH or CHECKING A/N" TO MCASHAN
  USE ANCHART
  LOCATE FOR AN = MCASHAN
  IF AN = MCASHAN
    STORE DESCR TO MCASHDES
? MCASHAN, "   ", MCASHDES
? " "
  ENDIF
  IF MCASHDES = " "
? "ACCOUNT ERROR", MCASHAN
? " "
    STORE " " TO MCASHAN
? CHR(07)
  ENDIF
  LOOP
ENDDO
**********************
DO WHILE MFWHDES = " "
  STORE " " TO MFWHDES
  ACCEPT "Enter FEDERAL WITHHOLDING A/N" TO MFWHAN
  USE ANCHART
  LOCATE FOR AN = MFWHAN
  IF AN = MFWHAN
    STORE DESCR TO MFWHDES
? MFWHAN, "   ", MFWHDES
? " "
  ENDIF
  IF MFWHDES = " "
? "ACCOUNT ERROR", MFWHAN
? " "
    STORE " " TO MFWHAN
? CHR(07)
  ENDIF
  LOOP
ENDDO
*********************
DO WHILE MFICADES = " "
  STORE " " TO MFICADES
  ACCEPT "Enter FICA (SOC SEC) A/N" TO MFICAAN
  USE ANCHART
  LOCATE FOR AN = MFICAAN
  IF AN = MFICAAN
    STORE DESCR TO MFICADES
? MFICAAN, "   ", MFICADES
? " "
  ENDIF
  IF MFICADES = " "
? "ACCOUNT ERROR", MFICAAN
? " "
    STORE " " TO MFICAAN
? CHR(07)
  ENDIF
  LOOP
ENDDO
***********************
DO WHILE MSWHDES = " "
  STORE " " TO MSWHDES
  ACCEPT "Enter STATE WITHHOLDING A/N" TO MSWHAN
  USE ANCHART
  LOCATE FOR AN = MSWHAN
  IF AN = MSWHAN
    STORE DESCR TO MSWHDES
? MSWHAN, "   ", MSWHDES
? " "
  ENDIF
  IF MSWHDES = " "
? "ACCOUNT ERROR", MSWHAN
? " "
    STORE " " TO MSWHAN
? CHR(07)
  ENDIF
  LOOP
ENDDO
*********************
DO WHILE MINSDES = " "
  STORE " " TO MINSDES
  ACCEPT "Enter INSURANCE DEDUCTION A/N" TO MINSAN
  IF MINSDES = " "
    STORE "***" TO MINSDES
  ENDIF
  IF .NOT. MINSAN = " "
  USE ANCHART
  LOCATE FOR AN = MINSAN
  IF AN = MINSAN
    STORE DESCR TO MINSDES
? MINSAN, "   ", MINSDES
? " "
  ENDIF
  ENDIF
  IF MINSDES = " "
? "ACCOUNT ERROR", MINSAN
? " "
    STORE " " TO MINSAN
? CHR(07)
  ENDIF
  LOOP
ENDDO
***************************
DO WHILE MDEDDES = " "
  STORE " " TO MDEDDES
  ACCEPT "Enter OTHER DEDUCTION A/N" TO MDEDAN
  IF MDEDAN = " "
    STORE "***" TO MDEDDES
  ENDIF
  IF .NOT. MDEDAN = " "
  USE ANCHART
  LOCATE FOR AN = MDEDAN
  IF AN = MDEDAN
    STORE DESCR TO MDEDDES
? MDEDAN, "   ", MDEDDES
? " "
  ENDIF
  IF MDEDDES = " "
? "ACCOUNT ERROR", MDEDAN
? " "
    STORE " " TO MDEDAN
? CHR(07)
  ENDIF
  ENDIF
  LOOP
ENDDO
***************************
DO WHILE .NOT. (MANS = "N" .OR. MANS = "n")
    ERASE
    INPUT "Amount GROSS EARNINGS <CR>" TO MAMT
    STORE MSALAN TO MCR:AN
    STORE MSALDES TO MCR:DESCR
    STORE MCASHAN TO MDR:AN
    STORE MCASHDES TO MDR:DESCR
    ACCEPT "EMPLOYER" TO MNOTES1
    ACCEPT "HOURS OR LOCATION" TO MNOTES2
      DO ADDREC
    ERASE
@ 4,0 SAY " "
    INPUT "Amount FEDERAL WITHHOLDING <CR>" TO MAMT
    STORE MFWHAN TO MDR:AN
    STORE "FEDERAL WITHHOLDING" TO MDR:DESCR
    STORE MCASHAN TO MCR:AN
    STORE "CASH" TO MCR:DESCR
      DO ADDREC
    ERASE
@ 4,0 SAY " "
    INPUT "Amount FICA <CR>" TO MAMT
    STORE MFICAAN TO MDR:AN
    STORE "FICA" TO MDR:DESCR
      DO ADDREC
    ERASE
@ 4,0 SAY " "
    INPUT "Amount STATE WITHHOLDING <CR>" TO MAMT
    STORE MSWHAN TO MDR:AN
    STORE "STATE WITHHOLDING" TO MDR:DESCR
      DO ADDREC
    STORE " " TO MNOTES2
    ERASE
@ 4,0 SAY " "
    IF .NOT. MINSDES = "***"
    ACCEPT "Enter INSURANCE DEDUCTION (Y/N) <CR>?" TO MINSD
    IF MINSD = "Y" .OR. MINSD = "y"
      INPUT "Amount INSURANCE <CR>" TO MAMT
      STORE MINSAN TO MDR:AN
      STORE "INSURANCE DEDUCTION" TO MDR:DESCR
      DO ADDREC
      STORE " " TO MINSD
      ERASE
    ENDIF
    ENDIF
@ 4,0 SAY " "
    IF .NOT. MDEDDES = "***"
    ACCEPT "Enter OTHER DEDUCTIONS (Y/N) <CR>?" TO MOTH
    IF MOTH = "Y" .OR MOTH = "y"
      INPUT "Amount OTHER DEDUCTION <CR>" TO MAMT
      STORE MDEDAN TO MDR:AN
      STORE "PAYROLL DEDUCTION" TO MDR:DESC
      DO ADDREC
      ERASE
      STORE " " TO MOTH
    ENDIF
    ENDIF
    ACCEPT "Enter more PAYROLL STUBS (Y/N) <CR>?" TO MANS
LOOP
ENDDO
RETURN
CANCEL