home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / chrchpr2.zip / CSEREPTS.CMD < prev    next >
OS/2 REXX Batch file  |  1987-01-06  |  7KB  |  232 lines

  1. * Program CSEREPTS - Gives reports of all Church Special Event Categories
  2. Store T to LEVEL3
  3. Do while LEVEL3
  4.   Erase
  5.   @ 0,1 say  ename
  6.   @ 0,60 say curdate
  7.   @ 1,1  say 'DATA DISK = '+D
  8.   @ 2,21 say 'CHURCH SPECIAL EVENT REPORTS           3-7-/CSEREPTS/'
  9.   @ 4,16 say  '1)  Full-Information Report'
  10.   @ 5,16 say  '2)  Two-line Report'
  11.   @ 6,16 say  '3)  Mailing Labels'
  12.   @ 7,16 say  '4)  Financial Summary'
  13.   @ 8,16 say  '5)  Lodgings'
  14.   @ 9,16 say  '6)  Sessions'
  15.   @ 10,16 say '7)  Transportation'
  16. ?
  17. Accept '                Enter selection ' to MSEL
  18. ?
  19. Select primary
  20. Store F to validd1
  21. Do while .NOT. validd1
  22.   Store T to validd1
  23.   Do CASE
  24.     CASE MSEL = '1'
  25.       GOTO TOP
  26.       Set format to print
  27.       Store 99 to curline
  28.       Store 0 to pag
  29.       Do while .not. EOF
  30.         If curline>58
  31.           If curline<>99
  32.             Eject
  33.           endif
  34.           Store pag+1 to pag
  35.           @ 1,10 say ename
  36.           @ 1,55 say  curdate+'    Page'+str(pag,3)
  37.           Store 4 to curline
  38.         endif
  39.         Store trim(last:name)+', '+trim(first:name) to names
  40.         If len(names)>30
  41.           Store $(names,1,30)+'_' to names
  42.         endif
  43.         @ curline,0 say 'TRANSP: '+transpor+'  LODGING: '+room
  44.         @ curline,40 say names
  45.         @ curline,71 say home:phone
  46.         @ curline+1,0 say 'PAID: $'+paid1+$(paid2,1,13)
  47.         @ curline+1,40 say address
  48.         @ curline+1,68 say ss:sc:memb+' '+$(membstatus,1,2)+$(membstatus,9,1)
  49.        @ curline+2,0 say 'DUE:  $'+str(amount:due,7,2)+' ('+str(amount,7,2)+')'
  50.         @ curline+2,40 say trim(city:state)+' '+zip
  51.         @ curline+2,67 say 'BD: '+$(birthdate,1,5)
  52.         @ curline+3,0 say 'SESS: '+sessions
  53.         @ curline+3,51 say familycode+comments
  54.         @ curline+4,0 say 'EQUIPMENT: '+equipment
  55.         Store curline+6 to curline
  56.         SKIP
  57.       enddo
  58.       Eject
  59.       Set format to screen
  60.       Accept 'Report is complete. Press <RETURN>' to xx
  61.     CASE MSEL = '2'
  62.       GOTO TOP
  63.       ? 'Now printing the CSEVENT Two-line report'
  64.       Set format to print
  65.       Store 99 to curline
  66.       Store 0 to pag
  67.       Do while .not. EOF
  68.         If curline>58
  69.           If curline<>99
  70.             Eject
  71.           endif
  72.           Store pag+1 to pag
  73.           @ 1,10 say ename
  74.           @ 1,55 say  curdate+'    Page'+str(pag,3)
  75.           Store 4 to curline
  76.         endif
  77.         Store trim(last:name)+', '+trim(first:name) to names
  78.         If len(names)>30
  79.           Store $(names,1,30)+'_' to names
  80.         endif
  81.         Store trim(address)+', '+trim(city:state) to addr
  82.         If len(addr)>34
  83.           Store $(addr,1,34) to addr
  84.         endif
  85.         Store str(val($(paid1,4,6))+val($(paid2,4,6)),6,2) to paidx
  86.         @ curline,0 say 'TRAN: '+transpor+' LODG: '+room+' PD:'+paidx
  87.         @ curline,40 say names
  88.         @ curline,71 say home:phone
  89.         @ curline+1,0 say 'SESS: '+$(sessions,1,30)
  90.         @ curline+1,40 say addr+' '+$(zip,1,5)
  91.         Store curline+3 to curline
  92.         SKIP
  93.       enddo
  94.       Eject
  95.       Set format to screen
  96.       Accept 'Report is complete. Press <RETURN>' to xx
  97.     CASE MSEL='3'
  98.       GOTO TOP
  99.       ? 'Now printing CSEVENT Mailing Labels.'
  100.       Accept 'Enter the mailing labels spacing (press <retn> for 12) ' to xx
  101.       If xx=' '
  102.         Store 12 to lspacing
  103.       else
  104.         Store val(xx) to lspacing
  105.       endif
  106.       If lspacing<6 .or. lspacing > 66
  107.         ? 'Invalid label spacing. Must be between 6 and 66.'
  108.       else
  109.       Set format to print
  110.       Store 99 to curline
  111.       Store 0 to pag
  112.       Do while .not. EOF
  113.         If curline>60
  114.           If curline<>99
  115.             Eject
  116.           endif
  117.           Store 0 to curline
  118.         endif
  119.         Store trim(last:name)+', '+trim(first:name) to names
  120.         If len(names)>30
  121.           Store $(names,1,30)+'_' to names
  122.         endif
  123.         Store trim(city:state)+', '+zip to addr
  124.         @ curline,0 say names
  125.         @ curline+1,0 say address
  126.         @ curline+2,0 say addr
  127.         Store curline+lspacing to curline
  128.         SKIP
  129.       enddo
  130.       Eject
  131.       Set format to screen
  132.       endif
  133.       Accept 'Report is complete. Press <RETURN>' to xx
  134.     CASE MSEL='4'
  135.       GOTO TOP
  136.       ? 'Now printing the CSEVENT Financial Summary'
  137.       Set format to print
  138.       Store 99 to curline
  139.       Store 0 to pag
  140.       Store 0.00 to owed:total
  141.       Store 0.00 to paid:total
  142.       Do while .not. EOF
  143.         If curline>58
  144.           If curline<>99
  145.             Eject
  146.           endif
  147.           Store pag+1 to pag
  148.           @ 1,5 say $(ename,1,30)+'  FINANCES'
  149.           @ 1,50 say  curdate+'    Page'+str(pag,3)
  150.           @ 3,1 say     'AMOUNT   PAID-1         PAID-2          DUE'
  151.           @ 4,1 say     '------   -----------    -----------   ------'
  152.           Store 5 to curline
  153.         endif
  154.         Store trim(last:name)+', '+trim(first:name) to names
  155.         If len(names)>29
  156.           Store $(names,1,29)+'_' to names
  157.         endif
  158.         Store val($(paid1,4,6))+val($(paid2,4,6)) to paidx
  159.         Store paid:total+paidx to paid:total
  160.         Store amount+owed:total to owed:total
  161.         @ curline,0 say str(amount,7,2)+$(paid1,1,15)+$(paid2,1,15)
  162.         Store amount-paidx to duex
  163.         If duex>0
  164.           @ curline,38 say str(duex,7,2)
  165.         endif
  166.         @ curline,47 say names
  167.         @ curline,71 say home:phone
  168.         Store curline+1 to curline
  169.         SKIP
  170.       enddo
  171.   @ curline,2 say ;
  172. '-----------------------------------------------------------------------------'
  173. @ curline+1,4 say 'Total AMOUNT: '+str(owed:total,8,2)+'    Total RECEIVED: '+;
  174. str(paid:total,8,2)+'  Total DUE:'+str(owed:total-paid:total,7,2)
  175.       Eject
  176.       Set format to screen
  177.       Accept 'Report is complete. Press <RETURN>' to xx
  178.     CASE MSEL='5' .or. MSEL='6' .or.MSEL='7'
  179. Select secondary
  180. GOTO TOP
  181. If MSEL='5'
  182.   Accept 'Enter a Lodging code ' to ssel
  183.   Store 'ROOM='+ssel to xsel
  184.   Store '    Report for Lodging = ' to ANAME
  185. else
  186.   If MSEL='6'
  187.     Accept 'Enter a Session code ' to ssel
  188.     Store 'SESS='+ssel to xsel
  189.     Store '    Report for Session = ' to ANAME
  190.   else
  191.     Accept 'Enter a Transportation code ' to ssel
  192.     Store 'TRAN='+ssel to xsel
  193.     Store '   Report for Transportation = '  to ANAME
  194.   endif
  195. endif
  196. Find &xsel
  197. If #=0
  198.   Accept 'This code is not found. Press <retn> ' to xx
  199. else
  200.   ?
  201.   ? ANAME,ssel,'    ',curdate
  202.   ?
  203.   Do while spact=xsel.and. .not. EOF
  204.     ? $(spact,6,55)
  205.     SKIP
  206.   enddo
  207.   ?
  208.   Accept 'End of report.  Press <retn> ' to xx
  209. endif
  210.  
  211.     CASE !(MSEL) = 'Q'
  212.       Store F to LEVEL3
  213.     OTHERWISE
  214.       Accept 'Illegal selection. Please enter again ' to MSEL
  215.       Store F to validd1
  216.   ENDCASE
  217.   ENDDO
  218. endif
  219. ENDDO
  220. RETURN
  221.  
  222.  
  223.  be deleted: ',last:name,first:name
  224.            Accept 'OK? ' to xx
  225.            If !(xx)='Y'
  226.              ? 'DELETED -',last:name,first:name
  227.              DELETE
  228.            else
  229.              ? 'No delete is made.'
  230.            endif
  231.          else
  232.