home *** CD-ROM | disk | FTP | other *** search
/ Software Du Jour / SoftwareDuJour.iso / BUSINESS / DBASE / DBASEACC.ARC / COSTBILL.PRG < prev    next >
Encoding:
Text File  |  1979-12-31  |  2.6 KB  |  104 lines

  1.  
  2.  
  3. * COSTBILLS.CMD
  4. * This file accepts inputs for supplier bills.
  5. * A temporary file called GetBills is used for data entry because the operator
  6. * can decide to quit on an incomplete entry, which is marked for deletion.
  7. * When the data is APPENDed to the PostFile, these entries are eliminated )the
  8. * APPEND command does not transfer records marked for deletion).  An entry must
  9. * included at least the name of a supplier and the amount of the bill. If these
  10.  
  11. ERASE
  12. @ 5,20 SAY 'SUPPLIER BILLS'
  13. USE PostFile
  14. COPY STRUCTURE TO GetBills
  15.  
  16. USE GetBills
  17. STORE 'Y' TO Bills
  18. DO WHILE !(Bills) <> 'F'
  19.     APPEND BLANK
  20.     STORE STR(#,5) TO Number
  21.  
  22.     STORE T TO Entering
  23.     DO WHILE Entering
  24.  ERASE
  25.  @ 1,0 SAY '      RECORD NUMBER:  '-Number
  26.  @ 3,0 SAY '             CLIENT' GET Client
  27.  @ 4,0 SAY '         JOB NUMBER' GET Job:Nmbr
  28.  @ 5,0 SAY '             AMOUNT' GET Amount
  29.  @ 6,0 SAY '        BILL NUMBER' GET Bill:Nmbr
  30.  @ 7,0 SAY '          BILL DATE' GET Bill:Date
  31.  @ 8,0 SAY '      SUPPLIER NAME' GET Name
  32.  @ 9,0 SAY '        DESCRIPTION' GET Descrip
  33.  READ
  34.  REPLACE Client WITH !(Client), Name WITH !(Name),Descrip;
  35.   WITH !(Descrip), Bill:Nmbr WITH !(Bill:Nmbr)
  36.  @ 3,20 SAY Client
  37.  @ 8,20 SAY Name
  38.  @ 9,20 SAY Descrip
  39.  
  40.  STORE ' ' TO Getting
  41.  IF $(Client,1,1) = ' ' .OR. $(Client,2,1) = ' ' .OR. $(Client,3,1);
  42.     = ' ' .OR. Job:Nmbr <= 0
  43.   @ 12,0
  44.   ? '     CLIENT or JOB NUMBER wrong.'
  45.   ? '     F if FINISHED,'
  46.   ACCEPT '   <Return> to change.' TO Getting
  47.      ELSE
  48.   IF Amount = 0 .OR. Name <= '     '
  49.       ?
  50.       ?
  51.       ? '      AMOUNT or NAME missing.'
  52.       ?
  53.       ? '      F if FINISHED,'
  54.       ACCEPT '   <Return> to change.' TO Getting
  55.   ELSE
  56.       @ 12,5 SAY '   C to CHANGE.'
  57.       @ 13,5 SAY '   F if FINISHED,'
  58.       ACCEPT '   <Return> to continue.' TO Bills
  59.  
  60.       IF !(Bills) = 'C'
  61.    STORE T TO Entering
  62.       ELSE
  63.    STORE F TO Entering
  64.       ENDIF
  65.   ENDIF amount or name
  66.      ENDIF client or job number
  67.  
  68.      IF !(Getting) = 'F'
  69.   DELETE RECORD &Number
  70.   STORE F TO Entering
  71.   STORE 'F' TO Bills
  72.      ENDIF
  73.  ENDDO Entering
  74.     ENDDO Bills
  75.  
  76. COUNT FOR .NOT. * TO Any
  77. IF Any = 0
  78.     ? 'No entries to add to the Cost Base.'
  79.     ? '<Return> to the menu.'
  80.     USE
  81.     WAIT
  82. ELSE
  83.  
  84.     RESTORE FROM Constant
  85.     STORE 'Bill:Date' TO Date
  86.     DO DateTest
  87.  
  88.     * Checks names against a list of suppliers to catch spelling and
  89.     * abbreviation inconsistencies.
  90.     DO NameTest
  91.  
  92.     ERASE
  93.     @ 3,25 SAY ' *** DO NOT INTERRUPT ***'
  94.     @ 5,25 SAY ' UPDATING THE POSTING FILE'
  95.     USE POSTFILE
  96.     APPEND FROM GetBills
  97. ENDIF
  98.  
  99. USE
  100. DELETE FILE GetBills
  101. RELEASE All
  102. RETURN
  103.  
  104.