home *** CD-ROM | disk | FTP | other *** search
/ Software Du Jour / SoftwareDuJour.iso / BUSINESS / DBASE / DB3.ARC / COSTMENU.PRG < prev    next >
Encoding:
Text File  |  1984-10-25  |  4.4 KB  |  109 lines

  1.        **********  Costmenu COMMAND FILE   **********
  2. * This is one level down from the Accounts.prg control module.
  3. * Selections are refinements that relate to costs for client-related
  4. * jobs or agency overhead.
  5. *        The main database is called Costbase.dbf.
  6. * Costs are not entered directly into the Costbase, however, because this leads
  7. * to data contamination and all sorts of problems fixing the errors.  Instead,
  8. * supplier bills and agency time sheets are posted into an interim file called
  9. * Postfile.dbf.  In here, they can be reviewed and edited as necessary.
  10. *        When all the cost entries are confirmed as being correct, they are
  11. * transferred to the Costbase by using the update procedure (selection 3).
  12. ******************************************************************************
  13. *
  14. *** These file are SELECTed in all the listed menu items
  15. SELECT 1
  16. USE Gettemp
  17. SELECT 2
  18. USE Postfile
  19. SELECT 4
  20. USE Supplier INDEX Supplier
  21. SELECT 5
  22. USE Personne
  23. *
  24. DO WHILE .T.
  25.    CLEAR
  26.    @  2, 0 SAY '* * * * * *   B I L L S   &   T I M E   S H E E T S   * * * * * *'
  27.    @  4,15 SAY '   1> ENTER EMPLOYEE TIME SHEETS'
  28.    @  6,15 SAY '   2> ENTER SUPPLIER BILLS'
  29.    @  8,15 SAY '   3> UPDATE the Costbase'
  30.    @ 10,15 SAY '   4> EDIT the Postfile'
  31.    @ 12, 0 SAY '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *'
  32.    @ 14,15 SAY 'Choose a number or press <ENTER> to exit.'
  33.    @ 15, 0
  34.    *
  35.    WAIT ' ' TO Costing
  36.    *
  37.    DO CASE
  38.       CASE Costing = '1'
  39.          @ ROW(),0 SAY 'Preparing Employee Time Sheets'
  40.          DO Costtime
  41.       CASE Costing = '2'
  42.          @ ROW(),0 SAY 'Preparing Supplier Bills'
  43.          SELECT 8
  44.          USE Invoices
  45.          DO Costbill
  46.       CASE Costing = '3'
  47.          @ ROW(),0 SAY 'Preparing to UPDATE Costbase'
  48.          SELECT 3
  49.          USE Costbase INDEX Costname,Costjobs
  50.          DO Costupda
  51.       CASE Costing = '4'
  52.          @ ROW(),0 SAY 'Selecting Posting File'
  53.          Changing = 'Y'
  54.          DO WHILE LEN(Changing) <> 0
  55.             SELECT 2
  56.             GO TOP
  57.             IF EOF()
  58.                CLEAR
  59.                ? '     There are no entries in the Posting file.'
  60.                WAIT
  61.                Changing = ''
  62.             ELSE
  63.                GO BOTTOM
  64.                CLEAR
  65.                @  3,10 SAY 'Edit Postfile '
  66.                @  5,10 SAY 'There are '+STR(RECNO(),5)+' file entries.'
  67.                WAIT 'Which entry do you want to EDIT?' TO Recno
  68.                *
  69.                * Next line converts the Character value of Which into a
  70.                * Numeric value.  This is necessary in the 'ELSE' part.
  71.                * The EDIT command must be given a NUMERIC value to edit.
  72.                IF &Recno <= 0 .OR. &Recno > RECNO()
  73.                   ?
  74.                   WAIT '   Out of range: do you want to continue (Y or N)?' ;
  75.                       TO Changing
  76.                ELSE
  77.                   GOTO &Recno
  78.                   CLEAR
  79.                   @  1, 0 SAY 'Postfile Edit'
  80.                   @  3, 0 SAY '           Entry'+ STR(RECNO(),5)
  81.                   @  5, 0 SAY '      Check Date' GET Check_Date
  82.                   @  6, 0 SAY '    Check Number' GET Check_Nmbr
  83.                   @  7, 0 SAY '          Client' GET Client PICTURE '!!!'
  84.                   @  8, 0 SAY '      Job Number' GET Job_Nmbr 
  85.                   @  9, 0 SAY '          Amount' GET Amount
  86.                   @ 10, 0 SAY '            Name' GET Name PICTURE '!!!!!!!!!!!!!!!!!!!!'
  87.                   @ 11, 0 SAY '     Description' GET Descrip PICTURE '!!!!!!!!!!!!!!!!!!!!'
  88.                   @ 12, 0 SAY '     Bill Number' GET Bill_Nmbr PICTURE '!!!!!!!'
  89.                   @ 13, 0 SAY '       Bill Date' GET Bill_Date
  90.                   @ 14, 0 SAY '           Hours' GET HOURS
  91.                   @ 15, 0 SAY ' Employee Number' GET Emp_Nmbr
  92.                   @ 19,10 SAY '^W to save, ESC to cancel changes.'
  93.                   READ
  94.                   @ 19,0
  95.                   WAIT 'Press (ENTER) to exit, any key to continue';
  96.                        TO Changing
  97.                ENDIF
  98.             ENDIF
  99.          ENDDO Changing
  100.       CASE LEN(Costing) = 0
  101.          @ ROW(),0 SAY 'Returning to Main Menu'
  102.          CLOSE DATABASE
  103.          RETURN
  104.          *
  105.       OTHERWISE
  106.       *
  107.    ENDCASE Costing
  108. ENDDO
  109.