*  *************** REPORTMENU COMMAND FILE  ************
* This command file is a sub-module of the ACCOUNTS.CMD control
* module.  It provides detailed choices that relate to reports
* that the user might choose to see or print from the cost
* database.  The functions are set up as sub-sub-procedures
* under the control of this module.
******************************************************************

ERASE
STORE T TO Reporting
DO WHILE Reporting
      @  3,20 SAY '   1> COSTS BY JOB'
      @  5,20 SAY '   2> FIND & EDIT BILLS'
      @  7,20 SAY '   3> REVIEW A DATABASE'
      @  9,20 SAY '   4> Quarterly Sales Tax Summary'
      @ 11,20 SAY '   5> RE-INDEX THE COSTBASE ON JOB NUMBERS'
      @ 12,20 SAY "      Make sure you won't need the computer"
      @ 13,20 SAY '      for a while: this takes a long time.'

      @ 17,20 SAY '               <RETURN>'
      WAIT TO Action

      IF Action = '1'
         USE B:PostFile
         COUNT FOR .NOT. * TO Any
         IF Any > 0
            @ 15, 0 SAY CHR(27)+CHR(74)
            ? 'There are '+STR(Any,5)+' entries in the Postfile.'
            ? 'Do you still want to do the Job Costs (Y or N)?'
            WAIT TO Continue
            IF !(Continue) = 'Y'
               DO JobCosts
            ENDIF
         ELSE
            DO JobCosts
         ENDIF
         RELEASE Any
      ELSE
         IF Action = '2'
            DO FindBills
         ELSE
            IF Action = '3'
               ERASE
               DISPLAY FILES ON B
               ?
               ?
               ? 'Which file do you want to review?'
               ACCEPT TO Database
               IF FILE("B:"+DATABASE) > 0
                  USE B:&Database
                  DO Review
               ELSE
                  * Erases IBM 3101 to end of Screen
                  @ 17,0 SAY CHR(27)+CHR(74)
                  @ 17,0 SAY !(Database) + " isn't on the list, is it? Check ";
                       + 'your spelling, then hit <Return>'
                  ? 'and try again.  Or not, as the case may be.'
                  WAIT
               ENDIF
            ELSE
               IF Action = '4'
                  DO SalesTax
               ELSE
                  IF Action = '5'
                     DO JobsIndx
                  ELSE
                     RELEASE All
                     RETURN
                  ENDIF 5
               ENDIF 4
            ENDIF 3
         ENDIF 2
      ENDIF 1
   ERASE
   STORE T TO Reporting
ENDDO Reporting
