home *** CD-ROM | disk | FTP | other *** search
- ********** Invoices COMMAND FILE **********
- * This file accepts inputs for invoices to clients. Individual projects
- * and items are stored in the Billings data file. Any number of items
- * may be entered using a single invoice number. Invoice numbers are
- * automatically generated by the computer and stored in the Konstant.mem
- * file.
- * After all the job billings have been entered, they are summarized by
- * invoice number and the data is stored in the Invoices file.
- * A printout of items billed and invoice totals is provided.
- ************************************************************************
- *
- RESTORE FROM Konstant
- *
- Date = DATE()
- *
- SELECT 1
- *
- T_Invoice = SPACE(1)
- DO WHILE LEN(T_Invoice) <> 0
- APPEND BLANK
- REPLACE Inv_Date WITH Date, Inv_Nmbr WITH Next_Inv
- *
- CLEAR
- T_Enter = SPACE(1)
- DO WHILE LEN(T_Enter) <> 0
- @ 13,0
- @ 3,0 SAY ' Entry' + STR(RECNO(),5)
- @ 3,30 SAY ' DATE '+dtoc(Inv_Date)
- @ 5,0 SAY 'INVOICE NUMBER ' GET Next_Inv
- @ 7,0 SAY ' CLIENT ' GET Client PICTURE '!!!'
- @ 8,0 SAY ' JOB NUMBER ' GET Job_Nmbr
- @ 9,0 SAY 'TAXABLE AMOUNT ' GET Taxable
- @ 10,0 SAY 'TAXFREE AMOUNT ' GET TaxFree
- @ 11,0 SAY ' P. O. NUMBER ' GET PO_Nmbr PICTURE '!!!!!!!!'
- @ 12,0 SAY ' DESCRIPTION ' GET Descrip PICTURE ;
- '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
- Exempt = 'N'
- @ 13,0 SAY ' Outside L.A.? ' GET Exempt
- @ 13,20 SAY '(Y to skip the extra L.A./San Mateo tax)'
- READ
- *
- MClient = UPPER(Client)
- *
- IF Taxable > 0
- IF UPPER(Exempt) <> 'Y'
- REPLACE Sales_Tax WITH (6.50*Taxable+0.5)/100.00
- REPLACE ExtraTax WITH .T.
- ELSE
- REPLACE Sales_Tax WITH 0.06*Taxable
- REPLACE ExtraTax WITH .F.
- ENDIF
- @ 13, 0
- @ 13, 0 SAY ' SALES TAX '
- @ 13,16 SAY Sales_Tax
- ENDIF
- *
- IF Job_Nmbr < 1000
- @ 15,10 SAY 'JOB not 4 digits.'
- ENDIF
- IF MClient <> ' ' .AND. (Taxable <> 0 .OR. TaxFree <> 0)
- @ 18,0 SAY 'Type any key to EDIT this entry,'
- WAIT 'press <ENTER> if O.K.' TO T_Enter
- IF LEN(T_Enter) = 0
- @ 18, 0 SAY 'Type any key for NEXT invoice, '
- WAIT 'press <ENTER> to finish ' TO T_Invoice
- *
- IF LEN(T_Invoice) = 1
- Next_Inv = STR(VAL(Next_Inv)+1,5)
- ENDIF
- ENDIF
- ELSE
- @ 16,10 SAY 'CLIENT or AMOUNT missing. '
- @ 18, 0 SAY 'Type any key to EDIT this entry, '
- WAIT 'press <ENTER> to abort. ' TO T_Enter
- IF LEN(T_Enter) = 0
- T_Invoice = SPACE(0)
- ELSE
- DELETE
- ENDIF
- ENDIF
- @ 17,0 CLEAR
- ENDDO T_Enter
- ENDDO T_Invoice
- *
- RELEASE Billing, T_Enter, MClient, Task, Date, New
- SAVE TO Konstant
- *
- GO TOP
- CLEAR
- IF EOF()
- WAIT 'No invoices to add to the file, press any key to continue.'
- ELSE
- * Either of the following procedures can generate an Abort
- Aborted = .F.
- *
- DO Invcheck
- *
- IF .NOT. Aborted
- DO Invprint
- DO Invupdat
- ENDIF
- ENDIF
- *
- RETURN