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

  1.           **********  Invoices COMMAND FILE  **********
  2. * This file accepts inputs for invoices to clients.  Individual projects
  3. * and items are stored in the Billings data file.  Any number of items
  4. * may be entered using a single invoice number.  Invoice numbers are
  5. * automatically generated by the computer and stored in the Konstant.mem
  6. * file.
  7. *        After all the job billings have been entered, they are summarized by
  8. * invoice number and the data is stored in the Invoices file.
  9. *        A printout of items billed and invoice totals is provided.
  10. ************************************************************************
  11. *
  12. RESTORE FROM Konstant
  13. *
  14. Date = DATE()
  15. *
  16. SELECT 1
  17. *
  18. T_Invoice = SPACE(1)
  19. DO WHILE LEN(T_Invoice) <> 0
  20.    APPEND BLANK
  21.    REPLACE Inv_Date WITH Date, Inv_Nmbr WITH Next_Inv
  22.    *
  23.    CLEAR
  24.    T_Enter = SPACE(1)
  25.    DO WHILE LEN(T_Enter) <> 0
  26.       @ 13,0
  27.       @  3,0 SAY '           Entry' + STR(RECNO(),5)
  28.       @  3,30 SAY '     DATE  '+dtoc(Inv_Date)
  29.       @  5,0 SAY 'INVOICE NUMBER ' GET Next_Inv
  30.       @  7,0 SAY '        CLIENT ' GET Client PICTURE '!!!'
  31.       @  8,0 SAY '    JOB NUMBER ' GET Job_Nmbr
  32.       @  9,0 SAY 'TAXABLE AMOUNT ' GET Taxable
  33.       @ 10,0 SAY 'TAXFREE AMOUNT ' GET TaxFree
  34.       @ 11,0 SAY '  P. O. NUMBER ' GET PO_Nmbr PICTURE '!!!!!!!!'
  35.       @ 12,0 SAY '   DESCRIPTION ' GET Descrip PICTURE ;
  36.         '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
  37.       Exempt = 'N'
  38.       @ 13,0 SAY ' Outside L.A.? ' GET Exempt
  39.       @ 13,20 SAY '(Y to skip the extra L.A./San Mateo tax)'
  40.       READ
  41.       *
  42.       MClient = UPPER(Client)
  43.       *
  44.       IF Taxable > 0
  45.          IF UPPER(Exempt) <> 'Y'
  46.             REPLACE Sales_Tax WITH (6.50*Taxable+0.5)/100.00
  47.             REPLACE ExtraTax WITH .T.
  48.          ELSE
  49.             REPLACE Sales_Tax WITH 0.06*Taxable
  50.             REPLACE ExtraTax WITH .F.
  51.          ENDIF
  52.          @ 13, 0
  53.          @ 13, 0 SAY '     SALES TAX '
  54.          @ 13,16 SAY Sales_Tax
  55.       ENDIF
  56.       *
  57.       IF Job_Nmbr < 1000
  58.          @ 15,10 SAY 'JOB not 4 digits.'
  59.       ENDIF
  60.       IF MClient <> '  ' .AND. (Taxable <> 0 .OR. TaxFree <> 0)
  61.          @ 18,0 SAY 'Type any key to EDIT this entry,'
  62.          WAIT 'press <ENTER> if O.K.' TO T_Enter
  63.          IF LEN(T_Enter) = 0
  64.             @ 18, 0 SAY 'Type any key for NEXT invoice,   '
  65.             WAIT 'press <ENTER> to finish  ' TO T_Invoice
  66.             *
  67.             IF LEN(T_Invoice) = 1
  68.                Next_Inv = STR(VAL(Next_Inv)+1,5)
  69.             ENDIF
  70.          ENDIF
  71.       ELSE
  72.          @ 16,10 SAY 'CLIENT or AMOUNT missing.                '
  73.          @ 18, 0 SAY 'Type any key to EDIT this entry,        '
  74.          WAIT 'press <ENTER> to abort.      ' TO T_Enter
  75.          IF LEN(T_Enter) = 0
  76.             T_Invoice = SPACE(0)
  77.          ELSE
  78.             DELETE
  79.          ENDIF
  80.       ENDIF
  81.       @ 17,0 CLEAR
  82.    ENDDO T_Enter
  83. ENDDO T_Invoice
  84. *
  85. RELEASE Billing, T_Enter, MClient, Task, Date, New
  86. SAVE TO Konstant
  87. *
  88. GO TOP
  89. CLEAR
  90. IF EOF()
  91.    WAIT 'No invoices to add to the file, press any key to continue.'
  92. ELSE
  93.    * Either of the following procedures can generate an Abort
  94.    Aborted = .F.
  95.    *
  96.    DO Invcheck
  97.    *
  98.    IF .NOT. Aborted
  99.       DO Invprint
  100.       DO Invupdat
  101.    ENDIF
  102. ENDIF
  103. *
  104. RETURN
  105.