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

  1.  
  2.  
  3.  
  4. *DEPOSITS.CMD
  5. *This file records any money coming in, in a file called DEPOSITS.  If the
  6. *money is in payment of an invoice, the amount and date of payment are
  7. *entered against that invoice in the INVOICE file.
  8. *  The checkbook balance is kept current for each entry.
  9. *  At the end of the session, deposits are printed out individually, then
  10. *the total of deposits plus the new checkbook balance are printed.
  11.  
  12.  
  13.  
  14. RESTORE FROM Constant
  15.  
  16. ERASE
  17.  
  18. @  5,20 SAY '   ENTERING INCOME'
  19. @  7,20 SAY ' THE STARTING BALANCE IS'+STR(MBalance,9,2)
  20. ?
  21. ?  '   If this does not match the checkbook,'
  22. ?  '   <return> to the main menu to change.'
  23. ?
  24. ?  '   C to CONTINUE.'
  25. ?
  26. WAIT TO Continue
  27. IF !(Continue) <> 'C'
  28.     RELEASE ALL
  29.     RETURN
  30. ENDIF
  31. RELEASE Continue
  32.  
  33. DO GetDate
  34.  
  35. SELECT PRIMARY
  36. USE Deposits
  37. COPY STRUCTURE TO GetDep
  38.  
  39. USE GetDep
  40. STORE 'Y' TO Depositing
  41. DO WHILE !(Depositing) <>'F'
  42.     APPEND BLANK
  43.     STORE STR(#,5) TO Number
  44.     REPLACE Dep:Date WITH Date
  45.  
  46.  
  47.     ERASE
  48.     *Next loop is used when there has been an error in the entry
  49.     *(defined as no client or no rate).  The operator is shown the
  50.     *previous entries and can make any changes required.
  51.     STORE 'T' TO Incorrect
  52.     DO WHILE !(Incorrect) <> 'F'
  53.  @ 3, 0 SAY 'If a check covers more than one agency invoice,'
  54.  @ 4, 0 SAY 'enter each invoice and amount separately.'
  55.  ?
  56.  @ 6, 0 SAY 'RECORD NUMBER: '-Number
  57.  @ 7, 0 SAY '     HOW MUCH'  GET Deposit
  58.  @ 8, 0 SAY 'OUR INVOICE NO' GET Inv:Nmbr
  59.  @ 9, 0 SAY '    CHECK FROM' GET Payer
  60.  @ 10,0 SAY 'THEIR CHECK NO' GET Pay:Nmbr
  61.  @ 11,0 SAY '      Comments' GET Comments
  62.  ? CHR(7)
  63.  READ
  64.  
  65.  REPLACE Payer WITH !(Payer), Comments WITH !(Comments)
  66.  @ 9,15 SAY Payer
  67.  @11,15 SAY Comments
  68.  
  69.  IF Payer <> '    ' .AND. Deposit > 0
  70.      @ 17,5 SAY '    C to CHANGE,'
  71.      @ 18,5 SAY '<Return> to continue.'
  72.      ?
  73.      ? CHR(7)
  74.      WAIT TO Depositing
  75.      IF !(Depositing)='C'
  76.   STORE 'T' TO Incorrect
  77.   ERASE
  78.      ELSE
  79.   STORE (MBalance + Deposit) TO MBalance
  80.   @ 17, 5 SAY '    F if FINISHED,'
  81.   ?
  82.   ? '                            '
  83.   ? CHR(7)
  84.   WAIT TO Depositing
  85.  
  86.   STORE 'F' TO Incorrect
  87.      ENDIF
  88.  ELSE
  89.      @ 15,5 SAY 'CHECK WRITER or AMOUNT missing.'
  90.      ?
  91.      ? '         F if FINISHED,'
  92.      ? '    <Return> to correct the record.'
  93.      ? CHR(7)
  94.      WAIT TO Depositing
  95.      ERASE
  96.      IF !(Depositing)= 'F'
  97.   DELETE RECORD &Number
  98.   STORE 'F' TO Incorrect
  99.      ELSE
  100.   ERASE
  101.   STORE 'T' TO Incorrect
  102.      ENDIF
  103.  ENDIF
  104.     ENDDO Incorrect
  105. ENDDO Depositing
  106.  
  107. RELEASE Change, Date, NoDate, Depositing, Number, Update, New, Incorrect
  108. SAVE TO Constant
  109.  
  110. COUNT FOR .NOT. * TO Any
  111. ERASE
  112. IF Any = 0
  113.     ? 'No deposits to add to the file.'
  114.     ? 'Press any key to continue.'
  115.     ? CHR(7)
  116.     USE
  117.     WAIT
  118. ELSE
  119.     DO DepPrint
  120.  
  121.     *The next portion of this program uses the Primary and Secondary work
  122.     *areas to record payments received against agency invoices in the record
  123.     *for that invoice in the Invoices files..  Both work areas are necessary so
  124.     *that we can compare each record in the GetDep file against all of the
  125.     *records in the Invoices file.
  126.     DO DepTrans
  127.     USE Deposits
  128.     APPEND FROM GetDep
  129. ENDIF there are deposits to add to the file
  130.  
  131. DELETE FILE GetDep
  132. RELEASE All
  133. RETURN
  134.