home *** CD-ROM | disk | FTP | other *** search
/ Software Du Jour / SoftwareDuJour.iso / BUSINESS / DBASE / DBASEACC.ARC / USETAX.PRG < prev   
Text File  |  1979-12-31  |  4KB  |  134 lines

  1.  
  2.  
  3. * USETAX.CMD
  4. * This file accepts inputs for supplier bills when the agency has bought
  5. * an item without paying a use tax on it.
  6. *   The item or items are added to the Invoices file(not Billings),
  7. * then are used by the SalesTax program so that the Quarterly Sales Tax
  8. * report can be prepared by the computer.
  9. *
  10. * A temporary file called GetBills is used for data entry because the operator
  11. * can decide to quit on an incomplete entry, which is marked for deletion.
  12. * When the data is APPENDed to the PostFile, these entries are eliminated (the
  13. * APPEND command does not transfer records marked for deletion).  An entry must
  14. * include at least the name of a supplier and the amount of the bill.  If these
  15. * are not both supplied, the entry is flagged for correction or deletion.
  16.  
  17. ERASE
  18. @ 5,20 SAY 'AGENCY USE TAX PROCEDURE'
  19. ?
  20. USE PostFile
  21. COPY STRUCTURE TO GetBills
  22.  
  23. USE GetBills
  24. STORE 'Y' TO Bills
  25. DO WHILE !(Bills) <> 'F'
  26.     APPEND BLANK
  27.     STORE STR(#,5) To Number
  28.     REPLACE Client WITH 'OFC'
  29.     STORE T TO Entering
  30.     DO WHILE Entering
  31.  ERASE
  32.  @ 1,0 SAY 'ENTER ONLY UNTAXED ITEMS NOT USED FOR CLIENT JOBS.'
  33.  @ 3,0 SAY '   RECORD NUMBER:' + Number
  34.  @ 4,0 SAY '          CLIENT:' + Client + ':'
  35.  @ 5,0 SAY '      JOB NUMBER' GET Job:Nmbr
  36.  @ 6,0 SAY '          AMOUNT' GET Amount
  37.  @ 7,0 SAY '     BILL NUMBER' GET Bill:Nmbr
  38.  @ 8,0 SAY '       BILL DATE' GET Bill:Date
  39.  @ 9,0 SAY '   SUPPLIER NAME' GET Name
  40.  READ
  41.  REPLACE Name WITH !(Name),Descrip WITH 'USE TAX ENTRY';
  42.   Bill:Nmbr WITH !(Bill:Nmbr)
  43.  @ 7,17 SAY Bill:Nmbr
  44.  @ 9,17 SAY Name
  45.  @ 10,17 SAY Descrip
  46.  
  47.  STORE ' ' TO Getting
  48.  IF Job:Nmbr <= 0 .OR. Job:Nmbr > 99
  49.      @ 12,0
  50.      ? '         The JOB NUMBER entry is wrong.'
  51.      ? '         Agency jobs are from 1 through 99.'
  52.      ? '         F if FINISHED,'
  53.      ACCEPT '   <Return> to change.' TO Getting
  54.  ELSE
  55.      IF Amount = 0 .OR. Name <= '     '
  56.      ?
  57.      ?
  58.      ? '     AMOUNT or NAME missing.'
  59.      ? '     F if FINISHED,'
  60.      ACCEPT '    <Return> to change.' TO Getting
  61.  ELSE
  62.      @ 12,5 SAY '  C to CHANGE,'
  63.      @ 13,5 SAY '  F if FINISHED,'
  64.      ACCEPT '   <Return> to continue.' TO Bills
  65.  IF !(Bills)='C'
  66.      STORE T TO Entering
  67.  ELSE
  68.      STORE F TO Entering
  69.  ENDIF
  70.     ENDIF amount or name
  71. ENDIF client or job number
  72.  
  73. IF !(Getting)='F'
  74.     DELETE RECORD &Number
  75.     STORE F TO Entering
  76.     STORE 'F' TO Bills
  77. ENDIF
  78. ENDDO Entering
  79. ENDDO Bills
  80.  
  81. COUNT FOR .NOT. * TO Any
  82. IF Any = 0
  83.     ?
  84.     ? '           No valid entries to add to the files.'
  85.     ? '           <Return> to the menu.'
  86.     WAIT
  87. ELSE
  88.  
  89.     RESTORE FROM Constant
  90.     STORE 'Bill:Date' TO Date
  91.     DO DateTest
  92.  
  93.     * Checks names against a list of suppliers to catch spelling and
  94.     * abbreviation inconsistencies.
  95.     DO NameTest
  96.  
  97.     ERASE
  98.     @ 3,25 SAY ' *** DO NOT INTERRUPT ***'
  99.     @ 5,25 SAY ' UPDATING THE POSTING FILE'
  100.     USE PostFile
  101.     APPEND FROM GetBills
  102.  
  103.     * The following loop transfers the bills just entered into the Invoices
  104.     * file.  The amount of the bill is entered in the "Taxable" column. The
  105.     * job number is entered into the Invoice Number column.  Since invoices
  106.     * have 5 digits, while job numbers are under 1000, we use this to sepa-
  107.     * rate the two types of entries later in the SalesTax.CMD file.
  108.     * PRIMARY and SECONDARY work areas are used to step through the GetBills
  109.     * file one entry at a time.
  110.  
  111.     USE GetBills
  112.     SELECT SECONDARY
  113.     USE Invoices
  114.     SELECT PRIMARY
  115.     DO WHILE .NOT. EOF
  116.  IF *
  117.      SKIP
  118.  ELSE
  119.      SELECT SECONDARY
  120.      APPEND BLANK
  121.      REPLACE Inv:Nmbr WITH STR(Job:Nmbr,3), Inv:Date WITH Bill:Date,;
  122.       Taxable WITH P.Amount, Date:Rcd WITH 'USE TAX'
  123.      SELECT PRIMARY
  124.      SKIP
  125.  ENDIF
  126.     ENDDO
  127.  
  128. ENDIF
  129. USE
  130. DELETE FILE GetBills
  131. RELEASE All
  132. RETURN
  133.  
  134.