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

  1.           ***********  Costbill COMMAND FILE  ***********
  2. * This file accepts inputs for supplier bills.
  3. *      When the agency has bought an item without paying a use tax on it,
  4. * the item is added to the Invoices file (not Billings), then is used by the
  5. * Salestax program so that the Quarterly Sales Tax report can be prepared by
  6. * the computer.
  7. *
  8. * A temporary file called Gettemp is used for data entry because the operator
  9. * can decide to quit on an incomplete entry, which is marked for deletion.
  10. * When the data is APPENDed to the Postfile, these entries are eliminated (the
  11. * APPEND command does not transfer records marked for deletion).  An entry must
  12. * include at least the name of a supplier and the amount of the bill.  If these
  13. * are not both supplied, the entry is flagged for correction or deletion.
  14. ********************************************************************
  15. SET FUNCTION 10 TO 'USE TAX ENTRY'
  16. *
  17. SELECT 1
  18. STORE 'Y' TO Bills
  19. DO WHILE Bills <> ' '
  20.    CLEAR
  21.    APPEND BLANK
  22.    Entering = .T.
  23.    DO WHILE Entering
  24.       Row = 0
  25.       @  1, 0 SAY 'Supplier Bills'
  26.       @  3, 0 SAY '           Entry'+ STR(RECNO(),5)
  27.       @  5, 0 SAY '          CLIENT' GET Client PICTURE '!!!'
  28.       @  6, 0 SAY '      JOB NUMBER' GET Job_Nmbr 
  29.       @  7, 0 SAY '          AMOUNT' GET Amount
  30.       @  8, 0 SAY '     BILL NUMBER' GET Bill_Nmbr PICTURE '!!!!!!!'
  31.       @  9, 0 SAY '       BILL DATE' GET Bill_Date
  32.       @ 10, 0 SAY '   SUPPLIER NAME' GET Name PICTURE '!!!!!!!!!!!!!!!!!!!!'
  33.       @ 11, 0 SAY '     DESCRIPTION' GET Descrip PICTURE '!!!!!!!!!!!!!!!!!!!!'
  34.       @ 11,50 SAY 'Untaxed items press &F10 '
  35.       READ
  36.       @ 12,0 CLEAR
  37.       IF Descrip = 'USE' .AND. (Job_Nmbr > 100 .OR. Client <> 'OFC')
  38.          @ 13,0 SAY 'USE TAX applies only to materials that the AGENCY uses.'
  39.          @ 14,0 SAY 'CLIENT must be "OFC" and JOB NUMBER must be 2 digits.'
  40.          Row = Row + 2
  41.       ENDIF
  42.       *
  43.       IF Job_Nmbr <= 0 .OR. (Job_Nmbr>99 .AND. Job_nmbr<1000)
  44.          @ 13+Row,0 SAY '        The JOB NUMBER is wrong.'
  45.          Row = Row + 1
  46.       ENDIF
  47. è      *
  48.       IF ' ' $ Client
  49.          @ 13+Row,0 SAY '        The CLIENT entry is wrong.'
  50.          Row = Row + 1
  51.       ENDIF
  52.       *
  53.       IF Amount = 0 .OR. Name <= ' '
  54.          @ 13+Row,0 SAY '        AMOUNT or NAME blank.'
  55.          Row = Row + 1
  56.       ENDIF
  57.       *
  58.       Bills = ' '
  59.       @ 14+Row,0 SAY '        &F3 to CONTINUE.'
  60.       @ 15+Row,0 SAY '        &F4 to EDIT.'
  61.       @ 16+Row,0 SAY 'Press <ENTER> to terminate entry: ' 
  62.       *
  63.       SET COLOR TO  , 
  64.       @ 16+Row,40 GET Bills
  65.       READ
  66.       SET COLOR TO W, ,W
  67.       *
  68.       @ 13+Row,0 CLEAR
  69.       Entering = .F.
  70.       *** IF Row is greater than zero an error has occurred ***
  71.       IF Row > 0 .AND. ( Bills = ' ' .OR. UPPER(Bills) = 'C' )
  72.          DELETE
  73.       ELSE
  74.          IF ( Bills <> ' ' .AND. UPPER(Bills) <> 'C' )
  75.             Entering = .T.
  76.          ENDIF
  77.       ENDIF
  78.    ENDDO Entering
  79. ENDDO Bills
  80. *
  81. COUNT FOR .NOT. DELETED() TO Any
  82. IF Any = 0
  83.    CLEAR
  84.    @ 3,0 SAY '        No valid entries to add to the files.'
  85.    WAIT 
  86. ELSE
  87.    *
  88.    * Checks names against a list of suppliers to catch spelling and
  89.    * abbreviation inconsistencies.
  90.    DO Nametest With "1"
  91.    *
  92.    CLEAR
  93.    @  3,25 SAY ' *** DO NOT INTERRUPT ***'
  94.    @  5,25 SAY ' UPDATING THE POSTING FILE'
  95.    SELECT 1
  96.    GO TOP
  97.    DO WHILE .NOT. EOF()
  98.      IF .NOT. DELETED()
  99.         SELECT 2
  100.         APPEND BLANK
  101.         REPLACE Check_date WITH B->Check_date,Check_nmbr WITH B->Check_nmbr,;
  102.                 Client WITH B->Client,Job_nmbr WITH B->Job_nmbr,Amount WITH ;
  103.                 B->Amount,Name WITH B->Name
  104.         REPLACE Descrip WITH B->Descrip,Bill_date WITH B->Bill_date,Bill_nmbr;
  105.                 WITH B->Bill_nmbr,Hours WITH B->Hours,Emp_nmbr WITH B->Emp_nmbr
  106.         SELECT 1
  107.      ENDIF
  108.      SKIP
  109.    ENDDO
  110.    *
  111.    * If there are any USE TAX entries, they are transferred to the Invoice
  112.    * file with the following loop so that the Use Tax can be paid to the state.
  113.    *         The amount of the bill is entered in the "Taxable" column.  The
  114.    * job number is entered into the Invoice Number column.  Since invoices
  115.    * have 5 digits, while job numbers are under 100, we use this to separate
  116.    * the two types of entries later in the SalesTax.PRG file.  The name of
  117.    * the supplier is placed in the "Date Received" field to make this bill
  118. è   * easier to find if we ever have to dig it out of the Costbase.
  119.    * We SELECT 1 and 8 work areas to step through the GetBills file one entry
  120.    * at a time.  Any "use tax" entries are entered in Invoices
  121.    GO TOP
  122.    DO WHILE .NOT. EOF()
  123.       IF Descrip = 'USE' .AND. .NOT. DELETED()
  124.          SELECT 8
  125.          APPEND BLANK
  126.          REPLACE Inv_Nmbr WITH STR(A->Job_Nmbr,4),Inv_Date WITH ;
  127.                  A->Bill_Date, Client WITH 'USE',Taxable WITH ;
  128.                  A->Amount
  129.          SELECT 1
  130.       ENDIF
  131.       SKIP
  132.    ENDDO
  133.    *
  134. ENDIF
  135. *
  136. SELECT 1
  137. ZAP
  138. SET FUNCTION 10 TO 'edit;'
  139. RETURN
  140.