home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / chrchpr3.zip / MCONREPT.CMD < prev    next >
OS/2 REXX Batch file  |  1991-01-21  |  5KB  |  211 lines

  1. * Program MCONREPT - Generates a brief office report for a month.
  2. Select secondary
  3. Use
  4. Select primary
  5. Store str(val(OT)-1,1) to CTSF
  6. Store F to EOY
  7. If wknummax=6
  8.   Store 60 to lastcurln
  9.   USE CONTRIBT
  10.   If $(curdates,1,2)='12'
  11.     Store T to EOY
  12.   endif
  13. else
  14.   Store 50 to lastcurln
  15.   USE CONTRIBU
  16.   If $(curdates,1,2)='10'
  17.     Store T to EOY
  18.   endif
  19. endif
  20. Store d+':CONTRIBX' to XX
  21. If file(XX)
  22.   delete file &XX
  23. endif
  24. Copy to &XX structure
  25. Select secondary
  26. USE &XX
  27. Select primary
  28. Use &MFILE
  29. Store 0 to recc
  30. Store 0 to recnum
  31. Store 0 to pagenum
  32. Store ' ' to curline
  33. If OSEL='3'
  34.   ? 'Ready the printer for the Contributions Report.'
  35.   Store "printing this month's office report and " to curline
  36.   Set format to print
  37.   Store trim(cmonthco)+', '+cyearcon to CNAME
  38. endif
  39. Set raw on
  40. ? "Now ",curline,"creating next month's CONTRIBX file."
  41. Set raw off
  42. Store 62 to curline
  43. Set exact on
  44. Do while .not. EOF
  45.     If OSEL='3'
  46.      If curline >= lastcurln
  47.       If pagenum>0
  48.         EJECT
  49.       endif
  50.       Store pagenum+1 to pagenum
  51.       @ 1,10 say chname+' Contributions Report for '+CNAME
  52.       @ 1,66 say 'Page'+str(pagenum,3)
  53.       @ 4,1 say 'Envl #          '+HDR3
  54.       Store 6 to curline
  55.      endif
  56.     endif
  57. Store 1 to wknumb
  58. Store 0.00 to GIVING1
  59. Store 0.00 to GIVING2
  60. Store 0.00 to GIVING3
  61. Store 0.00 to GIVING4
  62. Store 0.00 to GIVING5
  63. Do while wknumb<wknummax
  64.   Store '0' to N
  65.   Store ' ' to wktotls
  66.   Store ' ' to WKSF
  67.   do while N<>OT
  68.     Store str(val(N)+1,1) to N
  69.     Store $(ocateg&N,wknumb*8+2,8) to onecontr
  70.     If onecontr='    0.00'
  71.       Store '        ' to onecontr
  72.     endif
  73.     Store wktotls+'    '+onecontr to wktotls
  74.   enddo
  75.   If CSA<>' '
  76.     Store $(wktotls,1,50)+$(spaccounts,wknumb+1,1)+$(wktotls,52,10) to wktotls
  77.   endif
  78.   If wktotls<>' '
  79.     If OSEL='3'
  80.       @ curline,12 say $(curdates,wknumb*6-5,6)+wktotls
  81.     endif
  82.     Store curline+1 to curline
  83.     Store 0 to M
  84.     Store val(OT) to OTT
  85.     Do while M<>OTT
  86.       Store M+1 to M
  87.       Store str(M,1) to O
  88.       Store $(wktotls,M*12-8,8) to GIVING0
  89.       Store &GIVING0+GIVING&O to GIVING&O
  90.     enddo
  91.   endif
  92.   Store wknumb+1 to wknumb
  93. enddo
  94.     If osel='3'
  95.      Store '0' to N
  96.      Store ' ' to GIVING
  97.      Do while N<>OT
  98.        Store str(val(N)+1,1) to N
  99.        Store GIVING+str(GIVING&N,12,2) to GIVING
  100.      enddo
  101.      @ CURLINE,0 SAY str(#,4)+'  Year-to-date'+GIVING
  102.      Store curline+2 to curline
  103.     endif
  104.   Select secondary
  105.   APPEND BLANK
  106.   Store '0' to N
  107.   Replace MCONSTATUS with str(#,5)
  108.   If EOY
  109.     Replace PLEDGED with ' '
  110.   else
  111.     Replace PLEDGED with P.PLEDGED
  112.     Do while N<>OT
  113.       Store str(val(N)+1,1) to N
  114.       Replace OCATEG&N with STR(GIVING&N,9,2)
  115.     enddo
  116.   endif
  117.   Select primary
  118.   SKIP
  119.   Store recc+1 to recc
  120.   If recc = 20
  121.     Store recnum+20 to recnum
  122.     ? recnum,' RECORDS PROCESSED'
  123.     Store 0 to recc
  124.   endif
  125. ENDDO
  126. EJECT
  127. Set format to screen
  128. Store recc+recnum to recnum
  129. ? recnum,' TOTAL RECORDS PROCESSED'
  130. Select secondary
  131. Use
  132. Release OCATEGY1,OCATEGY2,OCATEGY3,OCATEGY4,OCATEGY5,OCATEGYT,RECC,RECNUM,
  133. RELEASE PAGENUM,CURLINE,cname,pagenum,wknumb,OTT,OTSF,M,WKTOTALS,EOY
  134. If CSA<>' '
  135.   ? 'Now updating the Special Funds for next month/quarter.'
  136.   Set exact off
  137.   USE CDIRFILE
  138.   COPY TO CDIRFILX for #<102
  139.   Select primary
  140.   USE CDIRFILX
  141.   Index on CDIRINDEX to CDIRFILX
  142.   Use CDIRFILX index CDIRFILX
  143.   Select secondary
  144.   USE CDIRFILE index CDIRFILE
  145.   GOTO 51
  146.   Store ' ' to CSA
  147.   Do while .not. EOF
  148.     Store $(CDIRINDEX,1,2)+'.' to SFX
  149.     Store spact to tspact
  150.     Store 0.00 to SPFUNDT
  151.     SKIP
  152.     Do while CDIRINDEX=SFX
  153.       Store SPFUNDT+val($(spact,3,9)) to SPFUNDT
  154.       SKIP
  155.     enddo
  156.     Select primary
  157.     Store $(SFX,1,2)+' ' to SFX
  158.     Find &SFX
  159.     If #<>0
  160.       Replace cdirindex with SFX+' '+date()
  161.       Store val($(tspact,23,9))+SPFUNDT to SPFUNDT
  162.       Store str(SPFUNDT,9,2) to SPFUNDX
  163.       Replace spact with $(spact,1,22)+SPFUNDX
  164.       ? 'SPECIAL FUND: ',$(cdirindex,1,3),spact
  165.       Store CSA+$(sfx,2,1) to CSA
  166.     endif
  167.     Select secondary
  168.     Store $(SFX,1,2) to sfx
  169.     Do while (cdirindex=SFX .or.$(CDIRINDEX,3,1)='*').and. .not. EOF
  170.       SKIP
  171.     enddo
  172.   enddo
  173.   Select primary
  174.   GOTO 49
  175.   Store len(CSA) to NN
  176.   IF NN>39
  177.     Replace spact with $(csa,2,38)
  178.     Store ' '+$(CSA,40,NN-39) to CSA
  179.     Store len(CSA) to NN
  180.     GOTO 50
  181.   endif
  182.   Replace spact with $(csa,2,NN-1)
  183.   If #=49
  184.     GOTO 50
  185.     Replace spact with ' '
  186.   endif
  187. endif
  188. USE
  189. If OSEL='3'
  190.   ? 'Contributions report is complete. '
  191. endif
  192.  Accept 'The new CONTRIBX file has been built. Press <retn> ' to XX
  193. RETURN
  194.  
  195. 
  196.  
  197. rinter for the Contributions Report.'
  198.   Store "printing this month's office report and " to curline
  199.   Set format to print
  200.   Store trim(cmonthco)+', '+cyearcon to CNAME
  201. endif
  202. Set raw on
  203. ? "Now ",curline,"creating next month's CONTRIBX file."
  204. Set raw off
  205. Store 62 to curline
  206. Set exact on
  207. Do while .not. EOF
  208.     If OSEL='3'
  209.      If curline >= lastcurln
  210.       If pagenum>0
  211.         EJECT