home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / dbbooks.zip / UPDATER.CMD < prev   
OS/2 REXX Batch file  |  1987-02-14  |  1KB  |  55 lines

  1. *********************************** UPDATER.CMD
  2. ************** Monthly update program for
  3. ************** Updating Chart of Accounts Balances.
  4. ERAS
  5. ? "This program should be performed once a month"
  6. ? "to bring the Chart of Accounts totals up-to-date"
  7. ?
  8. STORE " " TO YN
  9. @ 5,2 SAY "Is this the program you want? " GET YN
  10. READ
  11.  
  12. IF !(YN) <> "Y"
  13.    RETURN
  14. ENDIF (yn <> y)
  15.  
  16. ******************** Ask about start of new quarter.
  17. ERASE
  18. STORE " " TO QTR
  19. @ 10,2 SAY "Is this the start of a new quarter? "
  20. @ 10,38 GET QTR
  21. READ
  22.  
  23. ************* Perform the update.
  24. ERASE
  25. ? "Performing the update...."
  26. USE TRANS INDEX ACCT
  27. COPY TO TEMP FOR .NOT. POSTED
  28. REPL ALL POSTED WITH T
  29. USE COA INDEX COA
  30. ************** Set Month-to-Date field (AMOUNT) to zero.
  31. REPLACE ALL AMOUNT WITH 0
  32.  
  33. ************** If start of new quarter, replace all
  34. ************** Quarterly balances with zeroes too.
  35. IF !(QTR)="Y"
  36.    REPLACE ALL QTD WITH 0
  37. ENDIF (qtr=y)
  38.  
  39. ************** Update from TEMO file, then
  40. ************** increment QTD and YTD.
  41. UPDATE ON ACCT FROM TEMP ADD AMOUNT
  42. REPL ALL QTD WITH QTD+AMOUNT
  43. REPL ALL YTD WITH YTD+AMOUNT
  44.  
  45.  
  46. ************** Now, set POSTED flag in TRANS to T.
  47. USE TRANS
  48. REPLACE ALL POSTED WITH T
  49.  
  50. ************** Update Geninfo File
  51. USE GENINFO
  52. REPLACE LAST:UPDAT WITH T:DATE
  53. USE
  54. RETURN
  55.