***************************************************
* AC101.CMD - V1.00 - 
* THE MAIN PROGRAM WHICH CONTROLS THE
* AC101 PROGRAM FLOW.
***************************************************
ERASE
SET TALK OFF
STORE DATE() TO MTODAY
STORE 0 TO MFLAG
? CHR(07)
? "==================================================================="
? "Released to: FOG RBBS-RCP/M #29 BOSTON, MA. 02124 TEL:(617)288-4667"
? "==================================================================="
@ 7,12 SAY "WELCOME TO THE WORLD OF"
@ 9,12 SAY "   ACCOUNTING 101"
@ 10,12 SAY "       V1.00"
@ 12,6 SAY "(C) COPYRIGHT 1986 ROBERT D. SAUNDERS"
@ 13,6 SAY "         ALL RIGHTS RESERVED"
@ 14,6 SAY "       RELEASED MARCH 10, 1986"
@ 18,2 SAY "This program is not to be sold for profit."
@ 22,1 SAY " "
DO WHILE MFLAG < 75
STORE MFLAG + 1 TO MFLAG
LOOP
ENDDO
***************************************************
SET TALK OFF
ERASE
SET EJECT OFF
STORE " " TO CHOICEL
? CHR(07)
@ 1,10 SAY "****** INTRODUCTION MENU ******"
@ 2,20 SAY MTODAY
@ 3,1 SAY "1. SKIP TO MAIN MENU."
@ 5,1 SAY "2. PRINT START-UP DOCUMENTATION."
@ 7,1 SAY "3. PRINT AUTHOR'S COVER LETTER."
@ 9,1 SAY "4. DISPLAY WELCOME FRAMES."
@ 11,1 SAY "5. PRINT REGISTRATION FORM & INSTRUCTIONS."
@ 13,1 SAY "6. EXIT TO dBASE II."
@ 15,1 SAY "7. QUIT dBASE II."
@ 17,1 SAY "8. SET TODAY'S DATE."
@ 22,1 SAY " "
WAIT TO CHOICEL
DO CASE
****************
CASE CHOICEL = "2"
  DO AC101DOC
  DO AC101
****************
CASE CHOICEL = "3"
  DO AC101LTR
  DO AC101
**************
CASE CHOICEL = "4"
  DO AC101FRM
  DO AC101
**************
CASE CHOICEL = "5"
  DO AC101REG
  DO AC101
**************
CASE CHOICEL = "6"
  CANCEL
**************
CASE CHOICEL = "7"
  QUIT
**************
CASE CHOICEL = "8"
  STORE " " TO MTODAY
  ACCEPT "ENTER TODAY'S DATE (MM/DD/YY)" TO MTODAY
  SET DATE TO &MTODAY
  ? DATE()
  DO AC101
ENDCASE
******************** INIT ************************
STORE " " TO MEND
STORE " " TO MHNAME
STORE " " TO MHYEAR
STORE " " TO MHQUART
STORE DATE() TO MHDATE
DO WHILE .NOT. MEND = "END"
STORE DATE() TO MDATE
STORE 0 TO MRECS
STORE " " TO CHOICES2
STORE " " TO CHOICEBK
STORE " " TO CHOICES
STORE " " TO CHOICE1
STORE " " TO CHOICE2
STORE " " TO CHOICE3
STORE " " TO MPRTJRN
ERASE
SET TALK OFF
******************* START ************************
ERASE
? CHR(07)
@ 1,0  SAY " "
@ 1,15 SAY "****** MAIN MENU ******"
@ 3,0  SAY "SELECT ONE OF THE FOLLOWING:"
@ 5,2  SAY "1. PROCESS BOOKKEEPING RECORDS."
@ 7,2  SAY "2. PROCESS SECURITIES RECORDS +"
@ 9,2  SAY "3. PROCESS IRS FORM 1040 RECORDS +"
@ 11,2 SAY "4. PROCESS CHECKBOOK RECORDS +"
@ 13,2 SAY "5. PROCESS OTHER RECORDS +"
@ 15,2 SAY "6. EXIT TO dBASE II."
@ 17,2 SAY "7. QUIT dBASE II."
@ 19,2 SAY "8. RETURN TO INIT MENU."
@ 21,2 SAY "      + DENOTES: AC101GL PROGRAM IS REQUIRED."
@ 22,2 SAY " "
WAIT TO CHOICES
**************** PROCESS BOOKKEEPING *************
IF CHOICES = "1"
  ERASE
? CHR(07)
  @ 1,10 SAY "****** BOOKKEEPING MENU ******"
  @ 3,0  SAY "SELECT ONE OF THE FOLLOWING:"
  @ 5,2  SAY "1. PROCESS JOURNAL RECORDS."
  @ 7,2  SAY "2. PROCESS LEDGER RECORDS +"
  @ 9,2  SAY "3. PROCESS CHART OF ACCOUNTS."
  @ 11,2 SAY "4. RETURN TO MAIN MENU."
  @ 22,2 SAY " "
  WAIT TO CHOICEBK
ENDIF
DO CASE
**************** PROCESS SECURITIES **************
CASE CHOICES = "2"
  DO AC101GL.CMD
**************** PROCESS IRS FORMS ***************
CASE CHOICES = "3"
  DO AC101GL.CMD
**************** PROCESS CHECKBOOK ***************
CASE CHOICES = "4"
  DO AC101GL.CMD
**************** PROCESS OTHER *******************
CASE CHOICES = "5"
  DO AC101GL.CMD
****************** CANCEL ************************
CASE CHOICES = "6"
  CANCEL
****************** QUIT **************************
CASE CHOICES = "7"
  QUIT
****************** INIT **************************
CASE CHOICES = "8"
  DO AC101
ENDCASE
******************* PROCESS JOURNAL **************
IF CHOICEBK = "1"
STORE " " TO CHOICE
STORE " " TO CHOICE2
STORE " " TO CHOICE4
STORE " " TO MMONAME
? CHR(07)
ERASE
@ 1,10 SAY "****** JOURNAL MENU ******"
@ 2,0  SAY "SELECT ONE OF THE FOLLOWING:"
@ 4,2  SAY "1. ADD NEW RECORDS."
@ 6,2  SAY "2. SORT JOURNAL BY DATE."
@ 8,2  SAY "3. FIND A RECORD."
@ 10,2 SAY "4. EDIT A RECORD."
@ 12,2 SAY "5. DELETE A RECORD."
@ 14,2 SAY "6. PRINT THE JOURNAL (FORMATTED)."
@ 16,2 SAY "7. PRINT A REPORT +"
@ 18,2 SAY "8. RETURN TO MAIN MENU."
@ 20,2 SAY "9. LIST THE JOURNAL (NON FORMATTED)."
@ 22,2 SAY "0. SUMMARIZE JOURNAL ACCOUNTS +"
WAIT TO CHOICE
***************** ADD NEW RECORDS ****************
DO CASE
CASE CHOICE = "1"
  ERASE
USE B:GENJOURN
ERASE
SET TALK OFF
STORE " " TO MDR:DESCR
STORE " " TO MCR:DESCR
STORE 0.00 TO MAMT
STORE " " TO MANS
STORE " " TO MSELADD
STORE 00.00 TO MDR:AMT
STORE 00.00 TO MCR:AMT
STORE " " TO MSALAN
STORE " " TO MCASHAN
STORE " " TO MFWHAN
STORE " " TO MFICAAN
STORE " " TO MSWHAN
STORE " " TO MINSH
**********************
DO WHILE .NOT. (MSELADD = "8" .OR. MANS = "N")
STORE " " TO MDR:AN
STORE " " TO MCR:AN
STORE " " TO MDATEOLD
STORE " " TO MDR:DESCR
STORE " " TO MCR:DESCR
STORE " " TO MSELADD
? CHR(07)
ERASE
COUNT TO MREC
IF MREC > 500
  ERASE
@ 10,1 SAY "WARNING: THERE ARE MORE THAN 500 RECORDS"
@ 11,10 SAY "IN THE GENERAL JOURNAL - THIS DATABASE"
@ 12,10 SAY "SHOULD BE DIVIDED INTO SMALLER TIME PERIODS."
@ 13,10 SAY "IF YOU ARE NOW USING A FULL YEAR AS THE"
@ 14,10 SAY "FISCAL PERIOD, YOU SHOULD CONSIDER HALF"
@ 15,10 SAY "YEAR OR QUARTERLY PERIODS."
@ 16,10 SAY "<CR> TO CONTINUE."
WAIT
ERASE
ENDIF
STORE MREC + 1 TO MREC
@ 1,0 SAY "ENTER RECORD:"
@ 1,15 SAY MREC
@ 2,0 SAY " "
************** ENTER DATA MENU ***************
@ 3,0  SAY "SELECT ONE OF THE FOLLOWING:"
@ 5,2  SAY "1. Enter GENERAL RECEIPTS."
@ 7,2  SAY "2. Enter CHECK STUBS."
@ 9,2  SAY "3. Enter SECURITY TICKETS."
@ 11,2 SAY "4. Enter GASOLINE RECEIPTS."
@ 13,2 SAY "5. Enter PAYROLL STUBS."
@ 15,2 SAY "6. Enter CREDIT CARD RECEIPTS."
@ 17,2 SAY "7. Enter CASH RECEIPTS."
@ 19,2 SAY "8. RETURN TO MAIN MENU."
@ 22,2 SAY " "
WAIT TO MSELADD
IF .NOT. (MSELADD = " " .OR. MSELADD = "8")
  DO RECEIPTS
ENDIF
LOOP
ENDDO
**************** SORT THE JOURNAL ***************
CASE CHOICE = "2"
  ERASE
  @ 15,10 SAY "SORTING THE JOURNAL BY DATE."
  USE B:GENJOURN
  SORT ON DATE TO B:TEMP
  USE B:TEMP
  COPY TO B:GENJOURN
  USE B:GENJOURN
  ERASE
  @ 15,15 SAY "SORT COMPLETE."
  DELETE FILE B:TEMP
**************** FIND A RECORD ******************
CASE CHOICE = "3"
  ERASE
  STORE " " TO MRECDAY
  @ 9,2 SAY " "
  ACCEPT "ENTER DATE OF RECORD (MM/DD/YY)" TO MRECDAY
  USE B:GENJOURN
  DISPLAY FOR DATE = MRECDAY
  WAIT
**************** EDIT A RECORD ******************
CASE CHOICE = "4"
  ERASE
  USE B:GENJOURN
  ? "USE: <CTRL>W TO WRITE (SAVE) EDITS."
  ? "USE: <CTRL>Q TO QUIT (WITHOUT SAVING) EDITS."
  ? "USE: <CR> TO EXIT EDIT MODE."
  ? "USE: ARROW KEYS TO MOVE CURSOR IN EDIT MODE."
  ? "--------------------------------------------------"
  ? " "
  EDIT
**************** DELETE A RECORD ****************
CASE CHOICE = "5"
  STORE 0 TO MDELREC
  STORE " " TO MEND
  ERASE
  USE B:GENJOURN
  DO WHILE .NOT. MEND = "END"
  ERASE
  @ 1,1  SAY "TO DELETE A RECORD ENTER RECORD #:"
  @ 2,1  SAY " "
  INPUT TO MDELREC
GOTO MDELREC
    DISPLAY
@ 10,1 SAY "IS THIS THE RECORD TO BE DELETED? (Y/N)"
ACCEPT TO MANS
  IF MANS = "Y" .OR. MANS = "y"
    DELETE
  ENDIF
ERASE
@ 18,1 SAY "ARE MORE RECORDS TO BE DELETED? (Y/N)"
ACCEPT TO MANS
  IF .NOT. (MANS = "Y" .OR. MANS = "y")
    STORE "END" TO MEND
  ENDIF
LOOP
ENDDO 
STORE " " TO MEND
************** PRINT THE JOURNAL ***************
CASE CHOICE = "6"
  DO PRTJRN
***************** PRINT REPORT ******************
CASE CHOICE = "7"
ERASE
DO AC101GL
***************** RETURN ************************
  CASE CHOICE = "8"
    ERASE
***************** LIST JOURNAL ******************
CASE CHOICE = "9"
  DO PRTDAT
************* SUMMARIZE ACCOUNTS ****************
CASE CHOICE = "0"
  ERASE
  DO AC101GL
ENDCASE
**************************************************
ENDIF
IF CHOICEBK = "2"
  ERASE
  DO AC101GL
ENDIF
**************** PROCESS ANCHART ******************
IF CHOICEBK = "3"
STORE "7" TO CHOICEAN
STORE " " TO MEDAN
STORE " " TO MANS
STORE " " TO MDELAN
DO WHILE .NOT. CHOICEAN = " "
? CHR(07)
ERASE
  @ 2,10 SAY "****** CHART OF ACCOUNTS MENU ******"
  @ 4,2  SAY "1. DISPLAY CHART OF ACCOUNTS."
  @ 6,2 SAY "2. EDIT  CHART OF ACCOUNTS."
  @ 8,2 SAY "3. ADD ACCOUNT TO CHART."
  @ 10,2 SAY "4. SORT CHART OF ACCOUNTS."
  @ 12,2 SAY "5. DELETE ACCOUNT FROM CHART."
  @ 14,2 SAY "6. PRINT CHART OF ACCOUNTS."
  @ 16,2 SAY "7. RETURN TO MAIN MENU."
  @ 22,1 SAY " "
WAIT TO CHOICEAN
IF .NOT. CHOICEAN = " "
  DO ANCHART
ENDIF
********
LOOP
ENDDO
ENDIF
*********************** LOOP ********************
IF MEND = "END"
  CANCEL
ENDIF
LOOP
ENDDO
DO AC101
CANCEL
