home *** CD-ROM | disk | FTP | other *** search
/ Software Du Jour / SoftwareDuJour.iso / BUSINESS / DBASE / DBASEACC.ARC / INVMENU.PRG < prev    next >
Encoding:
Text File  |  1979-12-31  |  3.3 KB  |  122 lines

  1. * INVMENU.CMD
  2. * Functions are selected by the menu.  This procedure works with two data
  3. * files, BILLINGS and INVOICES.  BILLINGS keeps track of the amount
  4. * billed to a client by individual job number, while INVOICES is a
  5. * summary of the total billed on any given invoice.  This latter file can
  6. * be used to set up an accounts receivable system, as it has fields for
  7. * storing how much has been received in payment against an invoice and
  8. * when that amount was received (filled in by the Deposits.CMD file).
  9.  
  10. ERASE
  11. STORE T TO Invoicing
  12. DO WHILE Invoicing
  13.     @ 5,20 SAY '  1> BILL CLIENTS BY JOB'
  14.     @ 7,20 SAY '  2> EDIT INVOICES and BILLINGS'
  15.     @ 9,20 SAY '  3> REVIEW/PRINT INVOICES and BILLINGS'
  16.     @  12,20 SAY '        <Return> '
  17.     WAIT TO Action
  18.  
  19.     IF Action = '1'
  20.  DO Invoices
  21.     ELSE
  22.  IF Action = '2'
  23.      STORE 'Y' TO Changing
  24.      DO WHILE !(Changing) = 'Y'
  25.      ERASE
  26.      ? '          J to edit individual job billings,'
  27.      ? '    <Return> to edit the summary invoices. '
  28.      WAIT TO Which
  29.      IF !(Which) = 'J'
  30.   STORE 'Billings' TO Database
  31.      ELSE
  32.   STORE 'Invoices' TO Database
  33.      ENDIF
  34.  
  35.      USE &Database
  36.      STORE Inv:Nmbr TO First
  37.      GO BOTTOM
  38.      STORE Inv:Nmbr TO Last
  39.      ERASE
  40.      @  3,10 SAY 'EDITING '+!(Database)
  41.      @  3,35 SAY First+'thru '+Last
  42.      @  5,10 SAY '^W to SAVE, ^Q to CANCEL changes you make.'
  43.      @  6,10 SAY '^R for PREVIOUS< ^C for NEXT record.'
  44.      @  8,14 SAY 'Which INVOICE NUMBER do you want to EDIT?'
  45.      IF !(Which) = 'J'
  46.   @ 9,10 SAY 'This takes you to the FIRST ENTRY for that number.'
  47.   @ 10,10 SAY 'Use ^C to look at the rest of them.'
  48.      ENDIF
  49.      ACCEPT TO Invoice
  50.  
  51.      USE &Database INDEX &Database
  52.      FIND &Invoice
  53.      IF #=0
  54.   ?
  55.   ?
  56.   ? 'That invoice number is not in the file.'
  57.   ? 'Do you want to contnue (Y or N)?'
  58.   WAIT TO Changing
  59.      ELSE
  60.   STORE STR(#,5) TO Number
  61.   Edit &Number
  62.   REPLACE Sales:Tax WITH 0.06*Taxable
  63.   REPLACE Client WITH !(Client)
  64.   IF !(Which) = 'J'
  65.       REPLACE Descrip WITH !(Descrip),PO:Nmbr WITH !(PO:Nmbr)
  66.   ENDIF
  67.   ?
  68.   ? 'Do you want to edit any other invoices (Y or N)?'
  69.   WAIT TO Changing
  70.      ENDIF
  71.  ENDDO Changing
  72.  RELEASE All
  73.     ELSE
  74.  IF Action = '3'
  75.  ERASE
  76.  @ 4, 0 SAY '  '
  77.  ? '        J to see individual job billings,'
  78.  ? '   <Return> to see the summary invoices.'
  79.  WAIT TO Which
  80.  IF !(Which) = 'J'
  81.      STORE 'Billings' TO Database
  82.  ELSE
  83.      STORE 'Invoices' TO Database
  84.  ENDIF
  85.  
  86.  USE &Database
  87.  STORE 'Y' TO Reviewing
  88.  DO WHILE !(Reviewing)='Y'
  89.      GO BOTTOM
  90.      Store STR(#,5) TO Last
  91.      ERASE
  92.      @ 5,10 SAY 'The '+!(Database)+' file has '-Last-' entries.'
  93.      @ 7,10 SAY '<Return> to see the entire file, or'
  94.      @ 8,10 SAY 'enter the record number to start on.'
  95.      ACCEPT TO Number
  96.  
  97.      ? 'Do you want to print the file now (Y or N)?'
  98.      WAIT TO Output
  99.  
  100.      IF !(Output)='Y'
  101.   SET PRINT ON
  102.      ENDIF
  103.  
  104.      STORE CHR(0) TO Condition
  105.      DO Printout
  106.      ?
  107.      SET PRINT OFF
  108.      ? 'Do you want to see it again (Y or N)?'
  109.      WAIT TO Reviewing
  110.      ERASE
  111.  ENDDO Reviewing
  112.  RELEASE All
  113.     ELSE
  114.  RELEASE All
  115.  RETURN
  116.     ENDIF 3
  117. ENDIF 2
  118. ENDIF 1
  119. ERASE
  120. STORE T TO Invoicing
  121. ENDDO Invoicing
  122.