home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Du Jour
/
SoftwareDuJour.iso
/
BUSINESS
/
DBASE
/
DB3.ARC
/
COSTBILL.PRG
< prev
next >
Wrap
Text File
|
1984-10-25
|
5KB
|
138 lines
*********** Costbill COMMAND FILE ***********
* This file accepts inputs for supplier bills.
* When the agency has bought an item without paying a use tax on it,
* the item is added to the Invoices file (not Billings), then is used by the
* Salestax program so that the Quarterly Sales Tax report can be prepared by
* the computer.
*
* A temporary file called Gettemp is used for data entry because the operator
* can decide to quit on an incomplete entry, which is marked for deletion.
* When the data is APPENDed to the Postfile, these entries are eliminated (the
* APPEND command does not transfer records marked for deletion). An entry must
* include at least the name of a supplier and the amount of the bill. If these
* are not both supplied, the entry is flagged for correction or deletion.
********************************************************************
SET FUNCTION 10 TO 'USE TAX ENTRY'
*
SELECT 1
STORE 'Y' TO Bills
DO WHILE Bills <> ' '
CLEAR
APPEND BLANK
Entering = .T.
DO WHILE Entering
Row = 0
@ 1, 0 SAY 'Supplier Bills'
@ 3, 0 SAY ' Entry'+ STR(RECNO(),5)
@ 5, 0 SAY ' CLIENT' GET Client PICTURE '!!!'
@ 6, 0 SAY ' JOB NUMBER' GET Job_Nmbr
@ 7, 0 SAY ' AMOUNT' GET Amount
@ 8, 0 SAY ' BILL NUMBER' GET Bill_Nmbr PICTURE '!!!!!!!'
@ 9, 0 SAY ' BILL DATE' GET Bill_Date
@ 10, 0 SAY ' SUPPLIER NAME' GET Name PICTURE '!!!!!!!!!!!!!!!!!!!!'
@ 11, 0 SAY ' DESCRIPTION' GET Descrip PICTURE '!!!!!!!!!!!!!!!!!!!!'
@ 11,50 SAY 'Untaxed items press &F10 '
READ
@ 12,0 CLEAR
IF Descrip = 'USE' .AND. (Job_Nmbr > 100 .OR. Client <> 'OFC')
@ 13,0 SAY 'USE TAX applies only to materials that the AGENCY uses.'
@ 14,0 SAY 'CLIENT must be "OFC" and JOB NUMBER must be 2 digits.'
Row = Row + 2
ENDIF
*
IF Job_Nmbr <= 0 .OR. (Job_Nmbr>99 .AND. Job_nmbr<1000)
@ 13+Row,0 SAY ' The JOB NUMBER is wrong.'
Row = Row + 1
ENDIFè *
IF ' ' $ Client
@ 13+Row,0 SAY ' The CLIENT entry is wrong.'
Row = Row + 1
ENDIF
*
IF Amount = 0 .OR. Name <= ' '
@ 13+Row,0 SAY ' AMOUNT or NAME blank.'
Row = Row + 1
ENDIF
*
Bills = ' '
@ 14+Row,0 SAY ' &F3 to CONTINUE.'
@ 15+Row,0 SAY ' &F4 to EDIT.'
@ 16+Row,0 SAY 'Press <ENTER> to terminate entry: '
*
SET COLOR TO ,
@ 16+Row,40 GET Bills
READ
SET COLOR TO W, ,W
*
@ 13+Row,0 CLEAR
Entering = .F.
*** IF Row is greater than zero an error has occurred ***
IF Row > 0 .AND. ( Bills = ' ' .OR. UPPER(Bills) = 'C' )
DELETE
ELSE
IF ( Bills <> ' ' .AND. UPPER(Bills) <> 'C' )
Entering = .T.
ENDIF
ENDIF
ENDDO Entering
ENDDO Bills
*
COUNT FOR .NOT. DELETED() TO Any
IF Any = 0
CLEAR
@ 3,0 SAY ' No valid entries to add to the files.'
WAIT
ELSE
*
* Checks names against a list of suppliers to catch spelling and
* abbreviation inconsistencies.
DO Nametest With "1"
*
CLEAR
@ 3,25 SAY ' *** DO NOT INTERRUPT ***'
@ 5,25 SAY ' UPDATING THE POSTING FILE'
SELECT 1
GO TOP
DO WHILE .NOT. EOF()
IF .NOT. DELETED()
SELECT 2
APPEND BLANK
REPLACE Check_date WITH B->Check_date,Check_nmbr WITH B->Check_nmbr,;
Client WITH B->Client,Job_nmbr WITH B->Job_nmbr,Amount WITH ;
B->Amount,Name WITH B->Name
REPLACE Descrip WITH B->Descrip,Bill_date WITH B->Bill_date,Bill_nmbr;
WITH B->Bill_nmbr,Hours WITH B->Hours,Emp_nmbr WITH B->Emp_nmbr
SELECT 1
ENDIF
SKIP
ENDDO
*
* If there are any USE TAX entries, they are transferred to the Invoice
* file with the following loop so that the Use Tax can be paid to the state.
* The amount of the bill is entered in the "Taxable" column. The
* job number is entered into the Invoice Number column. Since invoices
* have 5 digits, while job numbers are under 100, we use this to separate
* the two types of entries later in the SalesTax.PRG file. The name of
* the supplier is placed in the "Date Received" field to make this billè * easier to find if we ever have to dig it out of the Costbase.
* We SELECT 1 and 8 work areas to step through the GetBills file one entry
* at a time. Any "use tax" entries are entered in Invoices
GO TOP
DO WHILE .NOT. EOF()
IF Descrip = 'USE' .AND. .NOT. DELETED()
SELECT 8
APPEND BLANK
REPLACE Inv_Nmbr WITH STR(A->Job_Nmbr,4),Inv_Date WITH ;
A->Bill_Date, Client WITH 'USE',Taxable WITH ;
A->Amount
SELECT 1
ENDIF
SKIP
ENDDO
*
ENDIF
*
SELECT 1
ZAP
SET FUNCTION 10 TO 'edit;'
RETURN