home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol198 / maintain.acc < prev    next >
Encoding:
Text File  |  1986-03-12  |  16.2 KB  |  532 lines

  1. * DATE 09/12/84  17:36
  2. * maintain.acc
  3. STOR CHR(PEEK(063)) TO dr
  4. SELE PRIMARY
  5. USE &dr.:account
  6. SET INDEX TO &dr.:account
  7. STOR t TO account1
  8. DO WHIL account1
  9.  REST from coname additive
  10.  STOR '?' TO command
  11.  ERAS
  12. TEXT
  13.  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  14.  *                                                                           *
  15.  *                                                                           *
  16.  *                                                                           *
  17.  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  18.  *                                                                           *
  19.  *                                                                           *
  20.  *                                                                           *
  21.  *                                                                           *
  22.  *                                                                           *
  23.  *                                                                           *
  24.  *                                                                           *
  25.  *                                                                           *
  26.  *                                                                           *
  27.  *                                                                           *
  28.  *                                                                           *
  29.  *                                                                           *
  30.  *                                                                           *
  31.  *                                                                           *
  32.  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  33.  *   Please select one of the above options. You may also leave this menu    *
  34.  *   by typing 'Q' and get on-line HELP by typing '?'.                       *
  35.  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  36. ENDT
  37.  @ 3,04 SAY coname + ' -  ACCT MAINTENANCE MENU'
  38.  @ 3,65 SAY DATE()
  39.  @ 7,17 SAY "A. Browse accounting records"
  40.  @ 8,17 SAY "B. Close books for the year"
  41.  @ 9,17 SAY "C. Edit, change or index Chart of Accounts"
  42.  @ 10,17 SAY "D. First initialization of program"
  43.  @ 11,17 SAY "E. Reininitialze defaults, company name, etc."
  44.  @ 12,17 SAY "F. Reindex accounting records"
  45.  @ 13,17 SAY "G. Return to main accounting menu"
  46.  @ 18,23 SAY "PLEASE SELECT ONE OF THE OPTIONS"
  47.  @ 18,58 GET command PICTURE '!'
  48.  READ
  49.  DO WHIL @(COMMAND, 'ABCDEFGQ?') = 0
  50.   STOR '?' TO command
  51.   @ 18,58 GET command PICTURE '!'
  52.   READ
  53.  ENDD
  54.  CLEA GETS
  55.  DO CASE
  56.  CASE command = 'A'
  57.   STOR CHR(PEEK(063)) TO dr
  58.   SELE PRIMARY
  59.   USE &dr.:account
  60.   SET INDEX TO
  61.   GO top
  62. * browse thru records
  63.   ERAS
  64. TEXT
  65.                ***WARNING***  ***WARNING***  ***WARNING*** 
  66.                  Changes made will be written to the File 
  67.  
  68.                  CTRL-C write current record & go down 
  69.                  CTRL-R write current record & go up 
  70.                  CTRL-Z/B pans screen left or right 
  71.                  CTRL-V toggles Insert on or off 
  72.                  CTRL-G Delete character under cursor 
  73.                  CTRL-U Delete or Recall current record 
  74.                  CTRL-Q exit Don't Write Current record 
  75.                  CTRL-W exit and Save all changes 
  76.  
  77.  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  78.   BROWSE allows you to change raw accounting data, so please use it with care.
  79.   You can examine the record in either ENTRY order or SORT order. The use of   
  80.   ENTRY order presents both the debit and the credit. You locate a record by  
  81.   the date of posting. Sort order locates by account number. You have to find  
  82.   the corresponding debit or credit separately. In either case, if the record  
  83.   is not found, the program will go to the first record.                   
  84.  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  85.  
  86.  
  87.  
  88. ENDT
  89. * get a starting point in file
  90.   STOR 'E' TO sttype
  91.   @ 22,12 SAY 'Shall we browse by <E)ntry order or <S)ort order'
  92.   @ 22,63 Get sttype PICTURE '!'
  93.   READ
  94.   DO WHIL @(sttype,'ES')=0
  95.    @ 22,12 SAY 'Shall we browse by <E)ntry order or <S)ort order'
  96.    @ 22,63 Get sttype PICTURE '!'
  97.    READ
  98.   ENDD WHILE @(sttype)
  99.   IF sttype = 'S'
  100.    SET INDEX TO &dr.:account
  101.    STOR '    ' TO mstart
  102.    @ 22,00
  103.    @ 22,12 SAY 'WHAT IS THE STARTING ACCOUNT NUMBER ?'
  104.    @ 22,55 GET mstart PICTURE '9999'
  105.    READ
  106.    FIND &mstart
  107.    IF # = 0
  108.     GO TOP
  109.    ENDI # = 0
  110.   ELSE
  111.    SET INDEX TO
  112.    @ 22,00
  113.    STOR '        ' TO mstar
  114.    @ 22,10 SAY 'WHAT IS THE STARTING DATE (MM/DD/YY) ? '
  115.    @ 22,50 GET mstar PICTURE '99/99/99'
  116.    READ
  117.    STOR $(mstar,7,2) + $(mstar,1,2) + $(mstar,4,2) TO mstart
  118.    LOCA FOR mstart = date
  119.    IF EOF
  120.     GO TOP
  121.    ENDI EOF
  122.   ENDI sttype
  123. * display selected list
  124.   ERAS
  125. * browse thru file
  126.   SET ESCAPE OFF
  127.   BROW fields date, data, amount, posted
  128.   SET ESCAPE ON
  129.   ERAS
  130.   RELE mstar, mstart
  131.   SET INDEX TO &dr.:account
  132.  CASE command = 'B'
  133.   ERAS
  134.   STOR 'N' TO option
  135. TEXT
  136.  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  137.  
  138.         W A R N I N G       W  A  R  N  I N  G       W A R N I N G
  139.         =============       ==================      ==============
  140.  
  141.         This option is designed to create a new data base file to
  142.         start a calendar or fiscal year (or for that matter, to 
  143.         close out any period.  It takes a while to run and if
  144.         something happens (like a voltage drop) while it is
  145.         running - you could very well lose all of your data.
  146.  
  147.         The old file will be saved as 'AC' + the ending date.
  148.  
  149.         NEVER RUN THIS OPTION UNLESS YOU HAVE BACKED UP YOUR DATA          
  150.  
  151.  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158. ENDT
  159.   @ 19,20 SAY 'ARE YOU READY TO PROCEED'
  160.   @ 19,47 GET option PICTURE '!'
  161.   READ
  162.   IF option = 'Y'
  163.    SET CONFIRM ON
  164.    STOR date() TO myear
  165.    ERAS
  166.    @ 10,10 SAY "You should be able to stop this program until the last item by"
  167.    @ 11,10 SAY "hitting the ESCape key and typing QUIT."
  168.    @ 13,10 SAY "I will keep you posted as we go along."
  169.    @ 15,10 SAY "What is the last day of the period your are closing ?"
  170.    @ 15,68 GET myear PICTURE '99/99/99'
  171.    READ
  172.    STOR '01/01/' + STR((VAL($(myear,7,2))+1),2) TO nyear
  173.    @ 16,10 SAY "What is the first day of the new period you are opening ?"
  174.    @ 16,68 GET nyear PICTURE '99/99/99'
  175.    READ
  176.    STOR 'AC' + $(myear,1,2) +$(myear,4,2)+$(myear,7,2)+'.DBF' TO newname
  177.    SET CONFIRM OFF
  178.    SET TALK ON
  179.    SELE PRIMARY
  180.    USE &dr.:account
  181.    INDE on $(data,7,4) + $(data,5,2) TO &dr.:temp
  182.    SET INDEX TO &dr.:temp
  183.    COPY STRUCTURE TO &dr.:temp
  184.    GO TOP
  185.    STOR $(data,7,4) + $(data,5,2) TO info
  186.    STOR 0 TO mamount
  187.    STOR 0 TO recno
  188.    DO WHIL .NOT. EOF
  189.     DO CASE
  190.     CASE $(info,1,1)='1'.OR.$(info,1,1)='2'.OR.$(info,1,2)='57'
  191.      IF $(data,7,4) + $(data,5,2) =  info
  192.       STOR mamount + amount TO mamount
  193.       SKIP
  194.      ELSE
  195.       STOR # TO recno
  196.       SELE SECONDARY
  197.       USE &dr.:TEMP
  198.       IF mamount <> 0
  199.        IF mamount > 0
  200.         STOR 'D' to type
  201.        ELSE
  202.         STOR 'C' TO type
  203.        ENDI mamount > 0
  204.        APPE BLANK
  205.        REPL date WITH $(nyear,7,2)+$(nyear,1,2)+$(nyear,4,2)
  206.        REPL data WITH 'J001'+ $(info,5,2) + $(info,1,4) + type+ 'opening entry       ' + nyear + 'J'
  207.        REPL amount WITH mamount
  208.       ENDI mamount <> 0
  209.       SELE PRIMARY
  210.       USE &dr.:account
  211.       SET index TO &dr.:temp
  212.       STOR 0 TO mamount
  213.       GO recno
  214.       STOR $(data,7,4) + $(data,5,2) TO info
  215.      ENDI $(data,7,4)
  216.     OTHE
  217.      IF .NOT. EOF
  218.       STOR mamount + amount TO mamount
  219.       SKIP
  220.      ELSE
  221.       SELE SECONDARY
  222.       USE &dr.:TEMP
  223.       IF mamount <> 0
  224.        IF mamount > 0
  225.         STOR 'D' to type
  226.        ELSE
  227.         STOR 'C' TO type
  228.        ENDI mamount > 0
  229.        APPE BLANK
  230.        REPL date WITH $(nyear,7,2)+$(nyear,1,2)+$(nyear,4,2)
  231.        REPL data WITH 'J001992530' + type+ 'opening entry       ' + nyear + 'J'
  232.        REPL amount WITH mamount
  233.       ENDI mamount <> 0
  234.       SELE PRIMARY
  235.       USE &dr.:account
  236.       SET index TO &dr.:temp
  237.      ENDI .NOT. EOF
  238.     ENDC
  239.    ENDD WHILE .NOT. EOF
  240.    DO CASE
  241.    CASE $(info,1,1)='1'.OR.$(info,1,1)='2'.OR.$(info,1,2)='57'
  242.     SELE SECONDARY
  243.     USE &dr.:TEMP
  244.     IF mamount <> 0
  245.      IF mamount > 0
  246.       STOR 'D' to type
  247.      ELSE
  248.       STOR 'C' TO type
  249.      ENDI mamount > 0
  250.      APPE BLANK
  251.      REPL date WITH $(nyear,7,2)+$(nyear,1,2)+$(nyear,4,2)
  252.      REPL data WITH 'J001'+ $(info,5,2) + $(info,1,4) + type+ 'opening entry       ' + nyear + 'J'
  253.      REPL amount WITH mamount
  254.     ENDI mamount <> 0
  255.    OTHE
  256.     SELE SECONDARY
  257.     USE &dr.:TEMP
  258.     IF mamount <> 0
  259.      IF mamount > 0
  260.       STOR 'D' to type
  261.      ELSE
  262.       STOR 'C' TO type
  263.      ENDI mamount > 0
  264.      APPE BLANK
  265.      REPL date WITH $(nyear,7,2)+$(nyear,1,2)+$(nyear,4,2)
  266.      REPL data WITH 'J001992530' + type+ 'opening entry       ' + nyear + 'J'
  267.      REPL amount WITH mamount
  268.     ENDI mamount <> 0
  269.    ENDC
  270.    SELE PRIMARY
  271.    USE &dr.:account
  272.    SET index TO &dr.:temp
  273.    SAVE TO temp
  274.    CLEA
  275.    REST FROM temp
  276.    STOR CHR(PEEK(063)) TO dr
  277.    RENA &dr.:account.dbf TO &dr.:&newname
  278.    RENA &dr.:temp.dbf TO &dr.:account.dbf
  279.    DELE file &dr.:temp.ndx
  280.    SELE PRIMARY
  281.    USE &dr.:account
  282.    INDE ON $(data,7,4) + date + $(data,5,2) TO &dr.:account
  283.    SET INDEX TO &dr.:account
  284.    SET TALK OFF
  285.   ENDI OPTION = 'Y'
  286.  CASE command = 'C'
  287.   DO chart.acc
  288.  CASE COMMAND = 'D'
  289.   ERAS
  290.   STOR 'N' TO option
  291.   STOR 'R' TO choice
  292. TEXT
  293.  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  294.  
  295.         W A R N I N G       W  A  R  N  I N  G       W A R N I N G
  296.         =============       ==================      ==============
  297.  
  298.         This option is designed to create a new data base file to
  299.         startup this program the first time. It will eliminate all
  300.         of the sample files we gave you in the accounting data base 
  301.         and start you off with no records.                     
  302.  
  303.         It can also rename one of the two Chart of Accounts data
  304.         bases (CHART1.DBF and CHART2.DBF) to CHART.DBF when you 
  305.         select either the real estate or general Chart of Accounts.
  306.  
  307.  
  308. ------
  309.      SELE SECONDARY
  310.      USE &dr.:TEMP
  311.      IF mamount <> 0
  312.      IF mamount > 0
  313.      STOR 'D' to type 
  314.      ELSE
  315.      STOR 'C' TO type
  316.      ENDI mamount > 0
  317.    APPE BLANK
  318.      REPL date WITH $(nyear,7,2)+$(nyear,1,2)+$(nyear,4,2) 
  319.      REPL data WITH 'J001'+ $(info,5,2) + $(info,1,4) + type+ 'opening entry       ' + nyear + 'J'
  320.      REPL amount WITH mamount
  321.      ENDI mamount <> 0
  322.      SELE PRIMARY
  323.      USE &dr.:account
  324.      SET index TO &dr.:temp
  325.      SAVE TO temp
  326.    CLEA
  327.    REST FROM temp
  328.    STOR CHR(PEEK(063)) TO dr
  329.    RENA &dr.:account.dbf TO &dr.:&newname
  330.    RENA &dr.:temp.dbf TO &dr.:account.dbf
  331.    DELETE file &dr.:temp.ndx
  332.  SELE PRIMARY
  333.    USE &dr.:account
  334.    INDE ON $(data,7,4) + date + $(data,5,2) TO &dr.:account
  335.    SET INDEX TO &dr.:account
  336.    SET TALK OFF
  337.   ENDI OPTION = 'Y'
  338.  CASE command = 'C'
  339.   DO chart.acc
  340.  CASE COMMAND = 'D'
  341.   ERAS
  342.   STOR 'N' TO option
  343.   STOR 'R' TO choice
  344. TEXT
  345.  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  346.  
  347.         W A R N I N G       W  A  R  N  I N  G       W A R N I N G
  348.         =============       ==================      ==============
  349.  
  350.         This option is designed to create a new data base file to
  351.         startup this program the first time. It will eliminate all
  352.         of the sample files we gave you in the accounting data base 
  353.         and start you off with no records.                     
  354.  
  355.         It can also rename one of the two Chart of Accounts data
  356.         bases (CHART1.DBF and CHART2.DBF) to CHART.DBF when you 
  357.         select either the real estate or general Chart of Accounts.
  358.  
  359.         NEVER RUN THIS OPTION UNLESS YOU HAVE BACKED UP THE PROGRAM        
  360.  
  361.  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368. ENDT
  369.   @ 19,20 SAY 'ARE YOU READY TO DELETE THE FILES'
  370.   @ 19,55 GET option PICTURE '!'
  371.   READ
  372.   IF option = 'Y'
  373.    STOR 'N' TO choice
  374.    STOR '?' TO pick
  375.    @ 19,00
  376.    @ 19,05 SAY "Do you want to select a new Chart of Accounts ?"
  377.    @ 19,60 GET choice PICTURE '!'
  378.    READ
  379.    DO WHIL @(CHOICE,'YNQ') = 0
  380.     @ 19,60 GET choice PICTURE '!'
  381.     READ
  382.    ENDD
  383.    IF choice = 'Y'
  384.     @ 19,00
  385.     @ 19,05 SAY "Do you want a <R>eal estate or a <G>eneral Chart of Accounts ?"
  386.     @ 19,68 GET pick PICTURE '!'
  387.     READ
  388.    ENDI choice = 'Y'
  389.    IF pick = 'R'
  390.     DELE file CHART.DBF
  391.     RENA CHART1.DBF TO CHART.DBF
  392.    ENDI
  393.    IF PICK = 'G'
  394.     DELE file CHART.DBF
  395.     RENA CHART2.DBF TO CHART.DBF
  396.    ENDI PICK = 'G'
  397.    STOR CHR(PEEK(063)) TO dr
  398.    USE &dr.:account
  399.    SET INDEX TO
  400.    DELE ALL
  401.    PACK
  402.    INDE ON date + $(data,7,4) + $(data,5,2) TO &dr.:account
  403.    SET INDEX TO &dr.:account
  404.    RELE choice, pick
  405.   ENDI option = 'Y'
  406.  CASE command = 'E'
  407.   SAVE TO temp
  408.   REST from manage.dat
  409.   IF PASS = 'Y'
  410.    ERAS
  411.    @ 12,10 SAY 'PLEASE ENTER THE PASSWORD SLOWLY ........'
  412.    SET EXACT ON
  413.    SET COLON OFF
  414.    STOR '12345678' TO passt
  415.    STOR ' ' TO passt1
  416.    STOR ' ' TO one
  417.    STOR ' ' to one1
  418.    STOR 0 to count
  419.    DO WHIL count < 8
  420.     SET CONSOLE OFF
  421.     @ 12,50 SAY passt1
  422.     WAIT TO one1
  423.     @ 12,50 ACCEPT one1
  424.     SET CONSOLE ON
  425.     STOR TRIM(one) + one1 TO one
  426.     STOR count + 1 TO count
  427.     STOR $(passt,1,count) TO passt1
  428.     @ 12,50 SAY passt1
  429.     SET CONSOLE OFF
  430.    ENDD
  431.    SET CONSOLE ON
  432.    STOR $(one,2,9) TO passt
  433.    IF TRIM(passt) <> TRIM(passp)
  434.     ERAS
  435.     @ 14,10 SAY "U N A U T H O R I Z E D       A C C E S S  "
  436.     @ 17,10
  437.     SET CONSOLE OFF
  438.     QUIT
  439.    ENDI passt
  440.    SET EXACT OFF
  441.    SET COLON ON
  442.   ENDI pass
  443.   DO init.spm
  444.   REST from temp additive
  445.  CASE command = 'F'
  446.   STOR CHR(PEEK(063)) TO dr
  447.   SET TALK ON
  448.   SET ECHO ON
  449.   INDE ON $(data,7,4) +date + $(data,5,2) TO &dr.:account
  450.   SET TALK OFF
  451.   SET ECHO OFF
  452.  CASE command = '?'
  453.   ERAS
  454. TEXT
  455.  
  456.       A C C O U N T I N G   M A I N T E N A N C E   H E L P   M E N U
  457.  
  458.     The browse ('A') option on the menu allows you to make changes directly
  459.     into the file to correct errors. The instructions as to how to do it are
  460.     quite specific.  They are set forth on screen before you actually enter
  461.     browse. Until you are familiar with the commands, make a note of them. 
  462.     Remember that 'CONTROL Q' should get you out without doing  any damage.
  463.     Please use Browse with care.
  464.  
  465.     The year end closing statement option should be done after you have 
  466.     made your closing adjustments AND AFTER YOU HAVE MADE A BACKUP COPY OF
  467.     THE DATA. It copies all of the records to a new file, indexes the new  
  468.     file and then renames the old file to 'ACC' + the prior year. You can stop 
  469.     the process before the end by hitting ESCape and typing QUIT.              
  470.  
  471.     The Chart of Accounts option has its own menu. However, we have included
  472.     two Charts of Account. This program was written as a building management
  473.     data base with accounting. Some people suggested that they might want 
  474.     to use just the accounting aspects for a different type of operation.
  475.  
  476.                                   Please hit any key to continue
  477. ENDT
  478.   SET CONSOLE OFF
  479.   WAIT
  480.   SET CONSOLE ON
  481.   ERAS
  482. TEXT
  483.  
  484.  
  485.  
  486.      For those people who would like to try this program in a non-real
  487.      estate environment, we have created a second Chart of Accounts. (There
  488.      are actually three Charts - CHART.DBF is real estate and will be erase
  489.      when you select between CHART1.DBF (also real estate) and CHART2.DBF
  490.      (general).  If you want to switch to the other system, just rename the
  491.      files. In all probability you will generate you own Chart of Accounts,
  492.      but we put in a sample.
  493.  
  494.      The first time program in addition to initializing the Chart of Accounts
  495.      wipes out all of the sample records we have included and starts you off
  496.      with a clean slate. We warn you to make a backup before you run it.  
  497.                       
  498.      Reindex is on this menu as well as at various other points in the program.
  499.      You will want to use it.
  500.  
  501.                       please hit any key to continue.....
  502.  
  503.  
  504.  
  505. ENDT
  506.   SET CONSOLE OFF
  507.   WAIT
  508.   SET CONSOLE ON
  509.  CASE command = 'G' .OR. command = 'Q'
  510.   STOR f TO account1
  511.  OTHE
  512.   STOR t TO ACCOUNT1
  513.  ENDC
  514. ENDD WHILE account1
  515. REST from manage.dat additive
  516. IF escap = 'N'
  517.  SET ESCAPE OFF
  518. ELSE
  519.  SET ESCAPE ON
  520. ENDI escap
  521. IF bright = 'A'
  522.  SET INTENSITY ON
  523. ELSE
  524.  SET INTENSITY OFF
  525. ENDI bright
  526. RELE all
  527. STOR CHR(PEEK(063)) TO dr
  528. SELE PRIMARY
  529. USE &dr.:account INDEX &dr.:account
  530. STOR t TO account
  531. RETU
  532.