* MENU2.CMD
* WRITTEN BY MICHAEL LYNN 8/1/83
USE INVOICE INDEX INDNUM
RELEASE ALL
DO WHILE T
ERASE
?
? '=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-='
?
? '     **INVOICE - REPORTS & UPDATING**'
? '     ================================'
?
? '1 - PRINT REPORT OF UNPAID INVOICES'
?
? '2 - PRINT REPORT OF SALES TOTALS TO DATE'
?
? '3 - PRINT REPORT OF INVOICES FOR 1983' 
?
? '4 - PRINT REPORT OF INVOICES FOR SELECTED MONTH'
?
? '5 - MONTHLY SALES SUMMARY FOR THIS YEAR'
?
? '6 - MARK SELECTED INVOICES "PAID"'
?
? '7 - RETURN TO MAIN MENU'
?
? '-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-'
?
SET CONSOLE OFF
WAIT TO what
SET CONSOLE ON
ERASE

IF what < '6'
@ 18, 1 SAY 'ENTER A Y TO GET A PRINTED COPY OF REPORT'
SET CONSOLE OFF
WAIT TO print
SET CONSOLE ON
ENDIF

DO CASE
ERASE

CASE WHAT ='1'
	IF !(print) ='Y'
	SET PRINT ON
	SET EJECT OFF
	ENDIF
   RELEASE print
   SET HEAD TO ***UNPAID INVOICES***
   ERASE
   REPORT FORM B:UNPAID FOR .NOT. PAID 
   SET PRINT OFF
   SET CONSOLE OFF
   WAIT
   SET CONSOLE ON

CASE WHAT ='2'
     	IF !(print) ='Y'
	SET EJECT OFF
	SET FORMAT TO PRINT
	ENDIF
   RELEASE print
   ERASE
   USE INVOICE 
   @ 4, 6 SAY "SALES STATISTICS TO DATE:"
   @ 4,31 SAY date()
   @ 5, 6 SAY "============================================"
   @ 6, 6 SAY "TOTAL AMOUNT OF SALES TO DATE:"
   SUM total TO xtot
   @ 6,36 SAY xtot USING '$99,999.99'
   GO BOTT
   STORE # TO xsales
   @ 7, 6 SAY "TOTAL NUMBER OF SALES:"
   @ 7,29 SAY xsales USING '9999'
   @ 8, 6 SAY "AVERAGE SALE AMOUNT:"
   @ 8,27 SAY xtot/xsales USING '$999.99'
   SUM total FOR .NOT. paid TO notpaid
   @ 9, 6 SAY "TOTAL OF SALES NOT PAID:"
   @ 9,30 SAY notpaid USING '$9,999.99'
   SUM total FOR tax TO mtax
   @ 10, 6 SAY "TOTAL TAXABLE SALES:"
   @ 10,27 SAY mtax USING '$9,999.99'
   @ 11, 6 SAY "AMOUNT DUE MICHIGAN:"
   @ 11,27 SAY mtax*.04 USING '$999.99'
   @ 12, 6 SAY "=========================================="
   SET FORMAT TO SCREEN
   SET CONSOLE OFF
   WAIT
   SET CONSOLE ON
   ERASE
   RELEASE xtot, xsales, notpaid
   EJECT
   SET INDEX TO INDNUM

CASE what ='3'
	IF !(print) ='Y'
	SET PRINT ON
	SET EJECT OFF
	ENDIF
SET HEAD TO ***REPORT OF SALES TO DATE FOR 1983***
ERASE
REPORT FORM B:UNPAID FOR $(date,7,2)='83'
EJECT
SET PRINT OFF
SET CONSOLE OFF
WAIT 
SET CONSOLE ON

CASE what ='4'
STORE '!!' TO month
@ 4, 1 SAY 'ENTER MONTH FOR REPORT AS A 2 DIGIT NUMBER'
@ 5, 1 SAY 'REPORT WILL BE FOR CURRENT YEAR ONLY' GET month PICTURE '99'
READ
	IF !(print) ='Y'
	SET PRINT ON
	SET EJECT OFF
	ENDIF
ERASE
SET HEAD TO REPORT FOR &month ,1983
REPORT FORM B:UNPAID FOR $(date,1,2) = month .and. $(date,7,2)='83'
EJECT
SET PRINT OFF
SET CONSOLE OFF
WAIT
SET CONSOLE ON
RELEASE month

CASE what ='5'
USE INVOICE
ERASE
@ 4, 4 SAY 'THIS PROGRAM TAKES A WHILE TO RUN'
@ 5, 4 SAY 'YOU REALLY MIGHT WANT TO GET A CUP OF COFFEE'
SUM total FOR $(date,1,2)='01' .AND. $(date,7,2)='83' TO JAN
SUM total FOR $(date,1,2)='02' .AND. $(date,7,2)='83' TO FEB
SUM total FOR $(date,1,2)='03' .AND. $(date,7,2)='83' TO MAR
@ 6, 4 SAY "DON'T GIVE UP"
SUM total FOR $(date,1,2)='04' .AND. $(date,7,2)='83' TO APR
SUM total FOR $(date,1,2)='05' .AND. $(date,7,2)='83' TO MAY
SUM total FOR $(date,1,2)='06' .AND. $(date,7,2)='83' TO JUN
SUM total FOR $(date,1,2)='07' .AND. $(date,7,2)='83' TO JUL
SUM total FOR $(date,1,2)='08' .AND. $(date,7,2)='83' TO AUG
@ 8, 4 SAY 'STILL WORKING'
SUM total FOR $(date,1,2)='09' .AND. $(date,7,2)='83' TO SEP 
SUM total FOR $(date,1,2)='10' .AND. $(date,7,2)='83' TO OCT
SUM total FOR $(date,1,2)='11' .AND. $(date,7,2)='83' TO NOV
@ 10, 4 SAY 'ALMOST DONE'
SUM total FOR $(date,1,2)='12' .AND. $(date,7,2)='83' TO DEC
ERASE
	IF !(print) ='Y'
        SET FORMAT TO PRINT
        SET MARGIN TO 10

@ 3, 1 SAY date()
@ 4, 5 SAY 'MONTHLY SALES REPORT FOR 1983'
@ 6, 1 SAY '==============================================='
@ 8, 5 SAY 'SALES FOR JANUARY:'
@ 8,30 SAY jan USING '$99,999.99' 
@ 10, 5 SAY 'SALES FOR FEBRUARY:'
@ 10,30 SAY feb USING '$99,999.99'
@ 12, 5 SAY 'SALES FOR MARCH:'
@ 12,30 SAY mar USING '$99,999.99'
@ 14, 5 SAY 'SALES FOR APRIL:'
@ 14,30 SAY apr USING '$99,999.99'
@ 16, 5 SAY 'SALES FOR MAY:'
@ 16,30 SAY may USING '$99,999.99'
@ 18, 5 SAY 'SALES FOR JUNE:'
@ 18,30 SAY jun USING '$99,999.99'
@ 20, 5 SAY 'SALES FOR JULY:'
@ 20,30 SAY jul USING '$99,999.99'
@ 22, 5 SAY 'SALES FOR AUGUST:'
@ 22,30 SAY aug USING '$99,999.99'
@ 24, 5 SAY 'SALES FOR SEPTEMBER:'
@ 24,30 SAY sep USING '$99,999.99'
@ 26, 5 SAY 'SALES FOR OCTOBER:'
@ 26,30 SAY oct USING '$99,999.99'
@ 28, 5 SAY 'SALES FOR NOVEMBER:'
@ 28,30 SAY nov USING '$99,999.99'
@ 30, 5 SAY 'SALES FOR DECEMBER:'
@ 30,30 SAY dec USING '$99,999.99'
@ 32, 1 SAY '=============================================='
@ 34, 5 SAY 'TOTAL 1983 SALES:'
@ 34,30 SAY jan+feb+mar+apr+may+jun+jul+aug+sep+oct+nov+dec USING '$99,999.99'
@ 36, 1 SAY '=============================================='
SET MARGIN TO 0
EJECT
SET FORMAT TO SCREEN
   ELSE
@ 1, 5 SAY date()
@ 2, 5 SAY 'MONTHLY SALES REPORT FOR 1983'
@ 3, 1 SAY '==============================================='
@ 5, 5 SAY 'SALES FOR JANUARY:'
@ 5,30 SAY jan USING '$99,999.99' 
@ 6, 5 SAY 'SALES FOR FEBRUARY:'
@ 6,30 SAY feb USING '$99,999.99'
@ 7, 5 SAY 'SALES FOR MARCH:'
@ 7,30 SAY mar USING '$99,999.99'
@ 8, 5 SAY 'SALES FOR APRIL:'
@ 8,30 SAY apr USING '$99,999.99'
@ 9, 5 SAY 'SALES FOR MAY:'
@ 9,30 SAY may USING '$99,999.99'
@ 10, 5 SAY 'SALES FOR JUNE:'
@ 10,30 SAY jun USING '$99,999.99'
@ 11, 5 SAY 'SALES FOR JULY:'
@ 11,30 SAY jul USING '$99,999.99'
@ 12, 5 SAY 'SALES FOR AUGUST:'
@ 12,30 SAY aug USING '$99,999.99'
@ 13, 5 SAY 'SALES FOR SEPTEMBER:'
@ 13,30 SAY sep USING '$99,999.99'
@ 14, 5 SAY 'SALES FOR OCTOBER:'
@ 14,30 SAY oct USING '$99,999.99'
@ 15, 5 SAY 'SALES FOR NOVEMBER:'
@ 15,30 SAY nov USING '$99,999.99'
@ 16, 5 SAY 'SALES FOR DECEMBER:'
@ 16,30 SAY dec USING '$99,999.99'
@ 18, 1 SAY '=============================================='
@ 19, 5 SAY 'TOTAL 1983 SALES:'
@ 19,30 SAY jan+feb+mar+apr+may+jun+jul+aug+sep+oct+nov+dec USING '$99,999.99'
@ 20, 1 SAY '=============================================='
SET CONSOLE OFF
WAIT
SET CONSOLE ON
ERASE
   ENDIF

SET INDEX TO INDNUM
RELEASE jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec

CASE WHAT ='6'
   DO B:MARK

CASE what ='7'
RETURN

ENDCASE
ENDDO
