home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol198 / jourp.acc < prev    next >
Encoding:
Text File  |  1985-02-10  |  17.3 KB  |  553 lines

  1. * DATE 09/12/84  10:25
  2. * program to print out or display journals
  3. STOR CHR(PEEK(063)) TO dr
  4. SELE PRIMARY
  5. USE &dr.:account
  6. SET index TO &dr.:account
  7. ERAS
  8. STOR '99' TO build1
  9. STOR t TO maybe
  10. STOR 'N' TO answer
  11. REST from coname additive
  12. STOR 'Y' TO printer
  13. STOR 'N' TO disk
  14. STOR '        ' TO filename
  15. STOR '?' TO select
  16. STOR t TO more
  17. DO WHIL more
  18. TEXT
  19.  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  20.  *                                                                           *
  21.  *                                                                           *
  22.  *                                                                           *
  23.  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  24.  *                                                                           *
  25.  *                                                                           *
  26.  *                                                                           *
  27.  *                                                                           *
  28.  *                                                                           *
  29.  *                                                                           *
  30.  *                                                                           *
  31.  *                                                                           *
  32.  *                                                                           *
  33.  *                                                                           *
  34.  *                                                                           *
  35.  *                                                                           *
  36.  *                                                                           *
  37.  *                                                                           *
  38.  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  39.  *   Please select one of the above options. You may also leave this menu    *
  40.  *   by typing 'Q' and get on-line HELP by typing '?'.                       *
  41.  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  42. ENDT
  43.  @ 3,04 SAY coname + '  -  ACCOUNTING REPORT MENU'
  44.  @ 3,65 SAY DATE()
  45.  @ 7,27 SAY "A. Cash Receipts Journal"
  46.  @ 8,27 SAY "B. Cash Disbursements Journal"
  47.  @ 9,27 SAY "C. General Journal"
  48.  @ 10,27 SAY "D. General Ledger"
  49.  @ 11,27 SAY "E. Display records on screen"
  50.  @ 12,27 SAY "F. Reindex"
  51.  @ 13,27 SAY "G. Return to Main Menu"
  52.  @ 17,23 SAY "PLEASE SELECT ONE OF THE OPTIONS"
  53.  @ 17,58 GET select PICTURE '!'
  54.  READ
  55.  DO WHIL @(select, 'ABCDEFG?Q') = 0
  56.   STOR '?' TO select
  57.   @ 17,58 GET select PICTURE '!'
  58.   READ
  59.  ENDD
  60.  CLEA GETS
  61.  IF select >='A' .AND. select <  'E'
  62. * select building
  63.   @ 17,00
  64.   @ 17,00 SAY " *          What building shall we do ('99' for all) ?                       *"
  65.   @ 17,60 GET build1 PICTURE '99'
  66.   READ
  67. * get a starting  point
  68.   STOR '00/00/00' TO stdat
  69.   @ 17,00
  70.   @ 17,00 SAY ' *          What is the starting date (MM/DD/YY) ?                           *'
  71.   @ 17,57 GET stdat PICTURE '99/99/99'
  72.   READ
  73.   STOR $(stdat,7,2)+$(stdat,1,2)+$(stdat,4,2) TO stday 
  74.   STOR VAL(stday) TO stdate
  75.   RELE stday
  76.   STOR date() TO enddat
  77.   @ 18,00 SAY ' *          What is the cutoff date for entries?                             *'
  78.   @ 18,57 GET enddat PICTURE '99/99/99'
  79.   READ
  80.   STOR $(enddat,7,2)+$(enddat,1,2)+$(enddat,4,2) TO endday 
  81.   STOR VAL(endday) TO enddate
  82.   RELE endday
  83.   @ 17,00
  84.   @ 18,00
  85.   STOR LEN(coname)/2  TO L
  86.   STOR 40-L TO L
  87.   STOR '                                        ' TO bl
  88.   STOR $(bl,1,L) + coname TO coname1
  89.   RELE L, bl
  90.   @ 17,00 SAY " *          Send Report to the Printer (Y/N)                                 *"
  91.   @ 18,00 SAY ' *                                                                           *'
  92.   @ 17,55 GET printer PICTURE '!'
  93.   READ
  94.   @ 18,00 SAY " *          Send Report to a Disk File (Y/N)                                 *"
  95.   @ 18,55 GET disk PICTURE '!'
  96.   READ
  97.   IF disk ='Y'
  98.    @ 17,00
  99.    @ 18,00
  100.    @ 17,00 SAY " *                    Enter Disk File Name                                   *"
  101.    @ 18,00 SAY " *                                                                           *"
  102.    @ 17,44 GET filename PICTURE '!!!!!!!!'
  103.    @ 17,54 SAY "(.TXT will be added )"
  104.    READ
  105.    @ 18,00 SAY ' *                    Select drive to put Files on                           *'
  106.    @ 18,55 GET dr PICTURE '!'
  107.    READ
  108.    DO WHIL @(dr,'AB') = 0
  109.     @ 18,00
  110.     @ 18,00 SAY ' *                    Select drive to put Files on                           *'
  111.     @ 18,55 GET dr PICTURE '!'
  112.     READ
  113.    ENDD while @
  114.   ENDI disk = Y
  115.   IF printer = 'Y'
  116.    @ 17,00
  117.    @ 18,00
  118.    @ 17,00 SAY ' *        MAKE PRINTER READY AND THEN HIT ANY KEY                            *'
  119.    @ 18,00 SAY " *                                                                           *"
  120.    SET CONSOLE OFF
  121.    WAIT
  122.    SET CONSOLE ON
  123.    SET print ON
  124.   ENDI printer = Y
  125.   IF disk = 'Y' .AND. filename <> ' '
  126. * make a proper REPORT file name that is of type TXT
  127.    STOR @('.',filename) TO length
  128.    IF length = 0 .OR. length > 8
  129.     STOR 9 TO length
  130.    ENDI length
  131.    STOR $(filename,1,length-1) TO filename
  132.    STOR '&dr.:'+filename+'.TXT' TO filename
  133.    SET ALTERNATE TO &filename
  134.    SET ALTERNATE ON
  135.   ENDI disk = Y and filename <> ''
  136.  ENDI select
  137.  ERAS
  138.  CLEA GETS
  139.  DO CASE
  140.  CASE select = 'A'
  141.   SET INDEX TO
  142.   GO TOP
  143. * initialize variables
  144.   STOR 0 TO pageno
  145.   STOR 0 TO counter
  146.   STOR 0 TO mamount
  147.   STOR 0 TO amt
  148.   STOR t TO more1
  149.   SET MARGIN TO 3
  150.   DO WHIL more1
  151. * do page counter etc
  152.    STOR pageno + 1 TO pageno
  153.    STOR 4 TO lineno
  154.    ERAS
  155.    ? '  '
  156. * and write TITLE
  157.    IF pageno = 1
  158.     ? coname1
  159.     ? '                              CASH RECEIPTS JOURNAL'
  160.     ? ' '
  161.     ? 'Report of ' +date() + '.                  ' + 'Covering period ' +stdat  + ' to   ' + enddat
  162.     STOR lineno + 4 TO lineno
  163.    ENDI pageno = 1
  164.    ? '                                                                    ' + 'PAGE ' + STR(pageno,2)
  165.    ? '  Date    Check #'+'  Payor/Description '+ '     Account  Prop   ' + '  ' + 'Amount'
  166.    ? "----------------------------------------------------------------------------"
  167.    ? ' '
  168. * now fill up rest of page to 50 lines with entries
  169.    DO WHIL lineno < 50
  170. * now do a page if not end of file
  171.     IF .NOT. EOF
  172.      STOR VAL(date) TO stdate1
  173.      IF (build1 = '99' .OR. build1 = $(data,5,2)).AND.((stdate1 >= stdate .AND. stdate1 <= enddate) .AND. $(data,40,1) = 'R')
  174.       STOR $(date,3,2)+'/'+$(date,5,2)+'/'+$(date,1,2)+'     ' TO m1
  175.       IF $(data,5,2) = '00'
  176.        STOR '  ' TO prop
  177.       ELSE
  178.        STORE $(data,5,2) TO prop
  179.       ENDIF
  180.       ? m1+$(data,1,4)+'  '+$(data,12,20)+'     '+$(data,7,4) + '     ' + prop+'   ' + STR(amount,12,2)
  181.       STOR mamount + amount TO mamount
  182.       SKIP
  183.       IF amount < 0
  184.          STOR amount*-1 TO amt
  185.       ELSE
  186.          STOR amount TO amt
  187.       ENDI amount
  188.       ? '                   '+$(data,12,20)+'     '+$(data,7,4) + '                 ' + STR(amt,12,2)
  189.       ? ' '
  190.       STOR lineno +3 TO lineno
  191.       SKIP
  192.      ELSE
  193.       SKIP
  194.      ENDI (stdate1)
  195.     ELSE
  196.      ? ' '
  197.      ? '                       TOTAL RECEIPTS FOR THIS PERIOD:  '  + STR(mamount,12,2)
  198.      ? ' '
  199.      STOR f TO more1
  200.      STOR 60 TO lineno
  201.     ENDI not EOF
  202.    ENDD while lineno < 50
  203.   ENDD more1
  204. * if it was on turn it off
  205.   EJEC
  206.   SET PRINT OFF
  207.   SET ALTERNATE OFF
  208.   ? '                                           Hit any key to continue'
  209.   SET CONSOLE OFF
  210.   WAIT
  211.   SET CONSOLE ON
  212.   ERAS
  213.   STOR 'Y' TO printer
  214.   STOR 'N' TO disk
  215.   STOR '99' TO build1
  216.   STOR '        ' TO filename
  217.   STOR '?' TO select
  218.  CASE select = 'B'
  219.   SET INDEX TO
  220.   GO TOP
  221. * initialize variables
  222.   STOR 0 TO pageno
  223.   STOR 0 TO counter
  224.   STOR 0 TO mamount
  225.   STOR 0 TO amt
  226.   STOR t TO more1
  227.   SET MARGIN TO 3
  228.   DO WHIL more1
  229. * do page counter etc
  230.    STOR pageno + 1 TO pageno
  231.    STOR 4 TO lineno
  232.    ERAS
  233.    ? '  '
  234. * and write TITLE
  235.    IF pageno = 1
  236.     ? coname1
  237.     ? '                           CASH DISBURSEMENTS JOURNAL'
  238.     ? ' '
  239.     ? 'Report of ' +date() + '.                  ' + 'Covering period ' +stdat  + ' to   ' + enddat
  240.     STOR lineno + 4 TO lineno
  241.    ENDI pageno = 1
  242.    ? '                                                                    ' + 'PAGE ' + STR(pageno,2)
  243.    ? '  Date    Check #'+'  Payee/Description '+ '     Account    Prop   ' + '  ' + 'Amount'
  244.    ? "----------------------------------------------------------------------------"
  245.    ? ' '
  246. * now fill up rest of page to 50 lines with entries
  247.    DO WHIL lineno < 50
  248. * now do a page if not end of file
  249.     IF .NOT. EOF
  250.      STOR VAL(date) TO stdate1
  251.      IF (build1 = '99' .OR. build1 = $(data,5,2)).AND.((stdate1 >= stdate .AND. stdate1 <= enddate) .AND. $(data,40,1) = 'D')
  252.       STOR $(date,3,2)+'/'+$(date,5,2)+'/'+$(date,1,2)+'     ' TO m1
  253.       IF $(data,5,2) = '00'
  254.        STOR '  ' TO prop
  255.       ELSE
  256.        STOR $(data,5,2) TO prop
  257.       ENDIF $(data)
  258.       ? m1+$(data,1,4)+'  '+$(data,12,20)+'     '+$(data,7,4)+'     '+prop+'  ' + STR(amount,12,2)
  259.       STOR mamount + amount TO mamount
  260.       SKIP
  261.       IF amount < 0
  262.         STOR amount*-1 TO amt
  263.       ELSE
  264.         STOR amount to amt
  265.       ENDI amount
  266.       ? '                   '+$(data,12,20)+'     '+$(data,7,4)+ '               ' + STR(amt,12,2)
  267.       ? ' '
  268.       STOR lineno +3 TO lineno
  269.       SKIP
  270.      ELSE
  271.       SKIP
  272.      ENDI stdate
  273.     ELSE
  274.      ? ' '
  275.      ? '                         TOTAL DISBURSEMENTS LISTED FOR PERIOD:  ' + STR(mamount,12,2)
  276.      ? ' '
  277.      STOR f TO more1
  278.      STOR 60 TO lineno
  279.     ENDI not EOF
  280.    ENDD while lineno < 50
  281.   ENDD more1
  282. * if it was on turn it off
  283.   EJEC
  284.   SET PRINT OFF
  285.   SET ALTERNATE OFF
  286.   ? '                                           Hit any key to continue'
  287.   SET CONSOLE OFF
  288.   WAIT
  289.   SET CONSOLE ON
  290.   ERAS
  291.   STOR 'Y' TO printer
  292.   STOR 'N' TO disk
  293.   STOR '99' TO build1
  294.   STOR '        ' TO filename
  295.   STOR '?' TO select
  296.  CASE select = 'C'
  297.   SET INDEX TO
  298.   GO TOP
  299. * initialize variables
  300.   STOR 0 TO pageno
  301.   STOR 0 TO counter
  302.   STOR 0 TO amt
  303.   STOR t TO more1
  304.   SET MARGIN TO 3
  305.   DO WHIL more1
  306. * do page counter etc
  307.    STOR pageno + 1 TO pageno
  308.    STOR 4 TO lineno
  309.    ERAS
  310.    ? '  '
  311. * and write TITLE
  312.    IF pageno = 1
  313.     ? coname1
  314.     ? '                                 GENERAL JOURNAL'
  315.     ? ' '
  316.     ? 'Report of ' +date() + '.                  ' + 'Covering period ' +stdat  + ' to   ' + enddat
  317.     STOR lineno + 4 TO lineno
  318.    ENDI pageno = 1
  319.    ? '                                                                    ' + 'PAGE ' + STR(pageno,2)
  320.    ? '  Date   ' +  ' Journal   '+' Description ' + '   '+ '      Account Prop   ' + '  ' + '     Amount'
  321.    ? "----------------------------------------------------------------------------"
  322.    ? ' '
  323. * now fill up rest of page to 50 lines with entries
  324.    DO WHIL lineno < 50
  325. * now do a page if not end of file
  326.     IF .NOT. EOF
  327.      STOR VAL(date) TO stdate1
  328.      IF (build1 = '99' .OR. build1 = $(data,5,2)).AND.((stdate1 >= stdate .AND. stdate1 <= enddate) .AND. $(data,40,1) = 'J')
  329.       STOR $(date,3,2)+'/'+$(date,5,2)+'/'+$(date,1,2)+'     ' TO m1
  330.       IF $(data,5,2) = '00'
  331.        STOR '  ' TO prop
  332.       ELSE
  333.        STOR $(data,5,2) TO prop
  334.       ENDIF $(data)
  335.       IF amount >= 0
  336.        STOR ' ' TO sp
  337.        STOR amount TO amt
  338.     ELSE
  339.        STOR '           ' TO sp
  340.        STOR amount*-1 TO amt
  341.       ENDI amount
  342.       ? m1+$(data,1,4)+'    '+$(data,12,20)+' '+$(data,7,4)+'     '+prop+ sp + STR(amt,12,2)
  343.       STOR lineno +1 TO lineno
  344.       SKIP
  345.      ELSE
  346.       SKIP
  347.      ENDI stdate
  348.     ELSE
  349.      STOR f TO more1
  350.      STOR 60 TO lineno
  351.     ENDI not EOF
  352.    ENDD while lineno < 50
  353.   ENDD more1
  354. * if it was on turn it off
  355.   EJEC
  356.   SET PRINT OFF
  357.   SET ALTERNATE OFF
  358.   ? '                                           Hit any key to continue'
  359.   SET CONSOLE OFF
  360.   WAIT
  361.   SET CONSOLE ON
  362.   ERAS
  363.   STOR 'Y' TO printer
  364.   STOR 'N' TO disk
  365.   STOR '        ' TO filename
  366.   STOR '99' TO build1
  367.   STOR '?' TO select
  368.  CASE select = 'D'
  369.   SET INDEX TO &dr.:account
  370.   GO TOP
  371. * initialize variables
  372.   STOR 0 TO pageno
  373.   STOR 0 TO counter
  374.   STOR t TO more1
  375.   STOR $(data,7,4) TO account
  376.   STOR 0 TO amtacct
  377.   STOR 0 TO amt
  378.   SET MARGIN TO 3
  379.   DO WHIL more1
  380. * do page counter etc
  381.    STOR pageno + 1 TO pageno
  382.    STOR 4 TO lineno
  383.    ERAS
  384.    ? '  '
  385. * and write TITLE
  386.    IF pageno = 1
  387.     ? coname1
  388.     ? '                                 GENERAL LEDGER'
  389.     ? ' '
  390.     ? 'Report of ' +date() + '.                  ' + 'Covering period ' +stdat  + ' to   ' + enddat
  391.     STOR lineno + 4 TO lineno
  392.    ENDI pageno = 1
  393.    ? '                                                                    ' + 'PAGE ' + STR(pageno,2)
  394.    ? '  Date   ' + ' ' + '  Journal  '+'             ' + ' Account      Prop   ' + '  ' + '     Amount'
  395.    ? "----------------------------------------------------------------------------"
  396.    ? ' '
  397. * now fill up rest of page to 50 lines with entries
  398.    DO WHIL lineno < 50
  399. * now do a page if not end of file
  400.     IF .NOT. EOF
  401.      STOR VAL(date) TO stdate1
  402.    IF stdate1 >= stdate .AND. stdate1 <= enddate                           
  403.      IF $(data,40,1) = 'D'
  404.       STOR 'Cash Disburse Jnrl' TO book
  405.      ENDI $(data,40)
  406.      IF $(data,40,1) = 'R'
  407.       STOR 'Cash Receipt Jnrl ' TO book
  408.      ENDI $(data,40)
  409.      IF $(data,40,1) = 'J'
  410.       STOR 'General Journal   ' TO book
  411.      ENDI $(data,40)
  412.      IF build1 = '99' .OR. build1 = $(data,5,2)
  413.       STOR $(date,3,2)+'/'+$(date,5,2)+'/'+$(date,1,2)+'    ' TO m1
  414.       IF $(data,5,2) = '00'
  415.        STOR '  ' TO prop
  416.       ELSE
  417.        STOR $(data,5,2) TO prop
  418.       ENDIF $(data)
  419.       IF amount >= 0
  420.        STOR ' ' TO sp
  421.        STOR amount TO amt
  422.       ELSE
  423.        STOR '           ' TO sp
  424.        STOR amount*-1 TO amt
  425.       ENDI amount
  426.       STOR $(data,7,4) TO account1
  427.       IF account1 = account
  428.        STOR amtacct + amount TO amtacct
  429.        ? m1+book+'      '+$(data,7,4)+ '         '+prop+sp+STR(amt,12,2)
  430.       ELSE
  431.        ? '                            Balance account ' + account + ' =  ' + STR(amtacct,12,2)
  432.        ? '  '
  433.        ? m1+book+'      '+$(data,7,4)+ '         '+prop+sp+STR(amt,12,2)
  434.        STOR amount TO amtacct
  435.        STOR account1 TO account
  436.        STOR lineno + 3 TO lineno
  437.       ENDI account1
  438.       SKIP
  439.       STOR lineno +1 TO lineno
  440.      ELSE
  441.       SKIP
  442.      ENDI build1
  443.    ELSE
  444.     SKIP
  445.    ENDI stdate1
  446.     ELSE
  447.      ? '                            Balance account ' + account + ' =  ' + STR(amtacct,12,2)
  448.      ? ' '
  449.      STOR f TO more1
  450.      STOR 60 TO lineno
  451.   ENDI not EOF
  452.    ENDD while lineno < 50
  453.   ENDD more1
  454. * if it was on turn it off
  455.   EJEC
  456.   SET PRINT OFF
  457.   SET ALTERNATE OFF
  458.   ? '                                           Hit any key to continue'
  459.   SET CONSOLE OFF
  460.   WAIT
  461.   SET CONSOLE ON
  462.   ERAS
  463.   STOR 'Y' TO printer
  464.   STOR 'N' TO disk
  465.   STOR '        ' TO filename
  466.   STOR '99' TO build1
  467.   STOR '?' TO select
  468.  CASE select = 'E'
  469.   ERAS
  470. TEXT
  471.  
  472.          Accounting entries can be displayed either in the order 
  473.          they were entered (showing both the debit and credit) or
  474.          in date order further sorted by building and account.
  475.  
  476.          When WAITING hit space bar to continue or ESCape to quit.
  477.  
  478. ENDT
  479. * get a starting point in file
  480.   STOR 'E' TO sttype
  481.   @ 10,12 SAY 'Shall we display by <E)ntry order or <S)ort order'
  482.   @ 10,63 Get sttype PICTURE '!'
  483.   READ
  484.   DO WHIL @(sttype,'ES')=0
  485.    @ 10,12 SAY 'Shall we display by <E)ntry order or <S)ort order'
  486.    @ 10,63 Get sttype PICTURE '!'
  487.    READ
  488.   ENDD WHILE @(sttype)
  489.   IF sttype = 'S'
  490.    SET INDEX TO &dr.:account
  491.   ELSE
  492.    SET INDEX TO
  493.    GO TOP
  494.   ENDI sttype
  495. * display selected list
  496.   ERAS
  497.   SET ESCAPE OFF
  498.   DISP NEXT 65000 $(date,5,2)+'/'+$(date,3,2)+'/'+$(date,1,2), $(data,1,4), $(data,5,2),$(data,12,20),$(data,7,4),$(data,40,1),amount,$(data,32,8)
  499.   IF eof
  500.    WAIT
  501.   ENDI
  502.   SET ESCAPE ON
  503.   ERAS
  504.   STOR '?' TO select
  505.   STOR '?' TO select
  506.  CASE select = '?'
  507.   ERAS
  508. TEXT
  509.  
  510.  
  511.      A C C O U N T I N G   R E P O R T   M E N U   H E L P   S C R E E N
  512.  
  513.  
  514.      This is a very powerful little module that allows you to print out
  515.      or view the various journals. You also can examine any or all of 
  516.      the original entries via the Display command.  (If you must change
  517.      these entries - the only way to do this in the program is via the  
  518.      Browse command on the Main Accounting menu.)                     
  519.  
  520.      Before you run any of these journal programs - make sure you index.
  521.  
  522.      Financial statements are prepared and printed from the main accounting
  523.      menu.
  524.  
  525.                         ......hit any key to continue
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. ENDT
  533.   SET CONSOLE OFF
  534.   WAIT
  535.   SET CONSOLE ON
  536.   ERAS
  537.  CASE select = 'F'
  538.   ERAS
  539.   SET TALK ON
  540.   SET ECHO ON
  541.   INDE on $(data,7,4) +date+ $(data,5,2) to &dr.:account
  542.   SET ECHO OFF
  543.   SET TALK OFF
  544.   ERAS
  545.  CASE select = 'Q' .OR. select = 'G'
  546.   STOR f TO more
  547.  ENDC
  548. ENDD WHILE more
  549. STOR CHR(PEEK(063)) TO dr
  550. SET INDEX TO &dr.:account
  551. RELE ALL
  552. STOR t TO account
  553.