home *** CD-ROM | disk | FTP | other *** search
/ The Don Maslin Archive / maslin_archive.zip / AARDVARK_Tape_Backups / maslin_c_d_3oct95 / ddrive / sydex / prgms / invntory.lbr / LEDGER.CMD < prev    next >
OS/2 REXX Batch file  |  1980-01-29  |  17KB  |  592 lines

  1. ******************* ledger.cmd *******************
  2. CLEAR
  3. DO WHILE t
  4.  CLEAR
  5.  ERASE
  6.  @ 1, 0 SAY "**************************************************" 
  7.  @ 1,50 SAY "***" 
  8.  @ 2,14 SAY "L E D G E R   M E N U" 
  9.  @ 3, 0 SAY "**************************************************" 
  10.  @ 3,50 SAY "***" 
  11.  @ 6, 8 SAY "Which would you like to do:" 
  12.  @ 8,11 SAY "1. DISPLAY LEDGER CARD" 
  13.  @ 10,11 SAY "2. CREDIT ACCOUNT" 
  14.  @ 12,11 SAY "3. DEBIT ACCOUNT" 
  15.  @ 14,11 SAY "4. EDIT LEDGER CARD" 
  16.  @ 16,11 SAY "5. PRINT STATEMENTS" 
  17.  @ 18,11 SAY "R. RETURN to MAIN MENU" 
  18.  ? 
  19.  ACCEPT "      Enter here " TO command
  20.  DO CASE
  21.   CASE !(command)= 'R' 
  22.    RETURN
  23.   CASE command= '1' 
  24.    SELECT PRIMARY
  25.    USE accounts INDEX accnt:no
  26.    SELECT secondary
  27.    USE ledger INDEX ledger
  28.    STORE t TO getcard
  29.    DO WHILE getcard
  30.     ERASE
  31.     ?
  32.     ? '  **** D I S P L A Y   L E D G E R   C A R D ****' 
  33.     ?
  34.     ? 
  35.     ? "Enter '99' as the Account Number to" 
  36.     ? "return to  Ledger Menu." 
  37.     ?
  38.     ? 'Enter the Account NUMBER of the' 
  39.     ACCEPT "LEDGER CARD you wish to see " TO number
  40.     IF number= '99' 
  41.      STORE f TO getcard
  42.      LOOP
  43.     ELSE
  44.      SELECT PRIMARY
  45.      STORE !(number) TO number
  46.      FIND &number
  47.      IF #=0
  48.       ? chr(07)
  49.       ? '    *************NOT ON FILE!!*************' 
  50.       LOOP
  51.      ENDIF #=0 
  52.      ERASE
  53.      @ 1,00 SAY '         **** L E D G E R   C A R D ****' 
  54.      @ 2, 0 SAY "----------------ACCOUNT NO:" 
  55.      @ 2,27 SAY accnt:no
  56.      @ 2,36 SAY "--------------------------------------------" 
  57.      @ 3, 0 SAY "Name:" 
  58.      @ 3, 5 SAY bill:nm
  59.      @ 3,39 SAY "Credit:" 
  60.      @ 3,46 SAY credit
  61.      @ 4, 0 SAY "Addr:" 
  62.      @ 4, 5 SAY bill:ad
  63.      @ 4,40 SAY "Terms:" 
  64.      @ 4,46 SAY terms
  65.      @ 5, 5 SAY bill:cty
  66.      @ 5,23 SAY bill:st
  67.      @ 5,37 SAY "UPS zone:" 
  68.      @ 5,46 SAY upszone 
  69.      @ 6, 5 SAY bill:zp
  70.      @ 6,40 SAY "Buyer:" 
  71.      @ 6,46 SAY buyer
  72.      @ 7, 0 SAY "Phone number:" 
  73.      @ 7,13 SAY phone:no
  74.      @ 7,32 SAY "Special Instr:" 
  75.      @ 7,46 SAY spl:inst
  76.      @ 8, 0 SAY "--------------------------------------------------" 
  77.      @ 8,50 SAY "------------------------------" 
  78.      @ 9, 2 SAY "DATE  |       DETAIL       |   DEBIT |  CREDIT |  BALANCE" 
  79.      STORE balance TO mbal
  80.      SELECT secondary
  81.      FIND &number
  82.      IF #=0
  83.       ?? chr(07)
  84.       @ 12,10 SAY "  *****NO SALES TO DATE******" 
  85.       ?
  86.      ELSE 
  87.       DO WHILE .not. eof .AND. accnt:no=number
  88.        ? DATE,detail, '   ' ,debit,credit,rbalance
  89.        SKIP +1
  90.       ENDDO WHILE .not. eof .AND. accnt:no=number 
  91.      ENDIF #=0
  92.      ? '                           ------------------------' 
  93.      ? '                           BALANCE IS=$ ' ,mbal 
  94.      ? '                           ------------------------' 
  95.      ? '                           <return> to continue' 
  96.      ?
  97.      SET console OFF
  98.      WAIT
  99.      SET console ON
  100.     ENDIF number= '99' 
  101.    ENDDO WHILE getcard 
  102.   CASE command= '2' 
  103.    SELECT PRIMARY
  104.    USE accounts INDEX accnt:no
  105.    SELECT secondary
  106.    USE ledger INDEX ledger
  107.    STORE t TO getcredits
  108.    DO WHILE getcredits
  109.     ERASE
  110.     ? '   ***** C R E D I T I N G   A C C O U N T S *****' 
  111.     ? 
  112.     ?
  113.     ? "Enter '99' for Account Number to" 
  114.     ? "return to Ledger Menu." 
  115.     ?
  116.     ?
  117.     ? 'Enter the ACCOUNT NUMBER of the Account' 
  118.     ACCEPT 'you wish to CREDIT ' TO number
  119.     IF number= '99' 
  120.      STORE f TO getcredits
  121.      LOOP
  122.     ELSE
  123.      SELECT PRIMARY
  124.      STORE !(number) TO number
  125.      FIND &number
  126.      IF #=0
  127.       ? chr(07)
  128.       ? "  **********NOT ON FILE!!***************" 
  129.       LOOP
  130.      ENDIF #=0 
  131.      IF *
  132.       ?
  133.       ? '             *** E R R O R ***' 
  134.       ?
  135.       ? 'You cannot credit a record tagged for deletion.' 
  136.       ? 'Undelete (D) before atempting to credit' 
  137.       ?
  138.       ?
  139.       ? '                        <return> to continue' 
  140.       SET console OFF
  141.       WAIT
  142.       SET console ON
  143.       LOOP
  144.      ENDIF * 
  145.      ERASE
  146.      @ 1, 5 SAY "*** C R E D I T I N G   A C C O U N T S ***" 
  147.      @ 3, 0 SAY "+-------------------------------------------------" 
  148.      @ 3,50 SAY "-+" 
  149.      @ 4, 0 SAY "| ACCOUNT NUMBER:" 
  150.      @ 4,17 SAY accnt:no
  151.      @ 4,51 SAY "|" 
  152.      @ 5, 0 SAY "|" 
  153.      @ 5,51 SAY "|" 
  154.      @ 6, 0 SAY "| Name:" 
  155.      @ 6, 7 SAY bill:nm
  156.      @ 6,30 SAY "BALANCE:$" 
  157.      @ 6,39 SAY balance
  158.      @ 6,51 SAY "|" 
  159.      @ 7, 0 SAY "| Addr:" 
  160.      @ 7, 7 SAY bill:ad
  161.      @ 7,51 SAY "|" 
  162.      @ 8, 0 SAY "|" 
  163.      @ 8, 7 SAY bill:cty
  164.      @ 8,23 SAY bill:st
  165.      @ 8,35 SAY "Credit:" 
  166.      @ 8,42 SAY credit
  167.      @ 8,51 SAY "|" 
  168.      @ 9, 0 SAY "|" 
  169.      @ 9, 7 SAY bill:zp
  170.      @ 9,36 SAY "Terms:" 
  171.      @ 9,42 SAY terms
  172.      @ 9,51 SAY "|" 
  173.      @ 10, 0 SAY "|" 
  174.      @ 10,35 SAY "Categ.:" 
  175.      @ 10,42 SAY category
  176.      @ 10,51 SAY "|" 
  177.      @ 11, 0 SAY "| UPS :" 
  178.      @ 11, 7 SAY upszone
  179.      @ 11,33 SAY "   Buyer:" 
  180.      @ 11,42 SAY buyer
  181.      @ 11,51 SAY "|" 
  182.      @ 12, 0 SAY "|                                Salesman:" 
  183.      @ 12,42 SAY salesman
  184.      @ 12,51 SAY "|" 
  185.      @ 13, 0 SAY "| Phone Number:" 
  186.      @ 13,15 SAY phone:no
  187.      @ 13,51 SAY "|" 
  188.      @ 14, 0 SAY "|" 
  189.      @ 14,51 SAY "|" 
  190.      @ 15, 0 SAY "| Special Instructions:" 
  191.      @ 15,23 SAY spl:inst
  192.      @ 15,51 SAY "|" 
  193.      @ 16, 0 SAY "|" 
  194.      @ 16,51 SAY "|" 
  195.      @ 17, 0 SAY "| FFL Number:" 
  196.      @ 17,13 SAY ffl:no
  197.      @ 17,28 SAY "Expires(YYMM):" 
  198.      @ 17,42 SAY expires
  199.      @ 17,51 SAY "|" 
  200.      @ 18, 0 SAY "+-------------------------------------------------" 
  201.      @ 18,50 SAY "-+" 
  202.      INPUT "Correct Account, (Y/N) ?" TO GO
  203.      IF .not. GO
  204.       LOOP
  205.      ELSE
  206.       STORE '               ' TO mem:detail
  207.       STORE 000.00 TO mem:credit
  208.       STORE p.accnt:no TO number
  209.       @ 19,00 
  210.       @ 20,00
  211.       @ 19, 2 SAY "  DATE  MM/DD/YY:" 
  212.       @ 19,19 SAY DATE ()
  213.       @ 20, 2 SAY "AMOUNT TO CREDIT:" 
  214.       @ 20,19 GET mem:credit
  215.       @ 21,12 SAY "DETAIL:" 
  216.       @ 21,19 GET mem:detail PICTURE '!!!!!!!!!!!!!!!' 
  217.       READ
  218.       SELECT PRIMARY
  219.       REPLACE balance WITH balance-mem:credit
  220.       STORE balance TO rbal
  221.       SELECT secondary
  222.       APPEND BLANK
  223.       REPLACE DATE WITH DATE (),credit WITH mem:credit,detail WITH mem:detail
  224.       REPLACE accnt:no WITH number,rbalance WITH rbal
  225.      ENDIF .not. GO 
  226.     ENDIF number= '99' 
  227.    ENDDO WHILE getcredits 
  228.   CASE command= '3' 
  229.    SELECT PRIMARY
  230.    USE accounts INDEX accnt:no
  231.    SELECT secondary
  232.    USE ledger INDEX ledger
  233.    STORE t TO getdebits
  234.    DO WHILE getdebits
  235.     ERASE
  236.     @ 2, 5 SAY "*** D E B I T I N G   A C C O U N T S ***" 
  237.     ?
  238.     ?
  239.     ? "Enter '99' for Account Number to" 
  240.     ? "return to Ledger Menu." 
  241.     ?
  242.     ? 'Enter the ACCOUNT NUMBER of the Account' 
  243.     ACCEPT 'you wish to DEBIT ' TO number
  244.     IF number= '99' 
  245.      STORE f TO getdebits
  246.      LOOP
  247.     ELSE
  248.      SELECT PRIMARY
  249.      STORE !(number) TO number
  250.      FIND &number
  251.      IF #=0 
  252.       ? chr(07)
  253.       ? "  **********NOT ON FILE!!***************" 
  254.       LOOP
  255.      ENDIF #=0 
  256.      IF *
  257.       ?
  258.       ? '             *** E R R O R ***' 
  259.       ?
  260.       ? 'You cannot debit a record tagged for deletion.' 
  261.       ? 'Undelete (D) before atempting to debit' 
  262.       ?
  263.       ?
  264.       ? '                        <return> to continue' 
  265.       SET console OFF
  266.       WAIT
  267.       SET console ON
  268.       LOOP
  269.      ENDIF *
  270.      ERASE
  271.      @ 1, 6 SAY "*** D E B I T I N G   A C C O U N T S ***" 
  272.      @ 3, 0 SAY "+-------------------------------------------------" 
  273.      @ 3,50 SAY "-+" 
  274.      @ 4, 0 SAY "| ACCOUNT NUMBER:" 
  275.      @ 4,17 SAY accnt:no
  276.      @ 4,51 SAY "|" 
  277.      @ 5, 0 SAY "|" 
  278.      @ 5,51 SAY "|" 
  279.      @ 6, 0 SAY "| Name:" 
  280.      @ 6, 7 SAY bill:nm
  281.      @ 6,30 SAY "BALANCE:$" 
  282.      @ 6,39 SAY balance
  283.      @ 6,51 SAY "|" 
  284.      @ 7, 0 SAY "| Addr:" 
  285.      @ 7, 7 SAY bill:ad
  286.      @ 7,51 SAY "|" 
  287.      @ 8, 0 SAY "|" 
  288.      @ 8, 7 SAY bill:cty
  289.      @ 8,23 SAY bill:st
  290.      @ 8,35 SAY "Credit:" 
  291.      @ 8,42 SAY credit
  292.      @ 8,51 SAY "|" 
  293.      @ 9, 0 SAY "|" 
  294.      @ 9, 7 SAY bill:zp
  295.      @ 9,36 SAY "Terms:" 
  296.      @ 9,42 SAY terms
  297.      @ 9,51 SAY "|" 
  298.      @ 10, 0 SAY "|" 
  299.      @ 10,35 SAY "Categ.:" 
  300.      @ 10,42 SAY category
  301.      @ 10,51 SAY "|" 
  302.      @ 11, 0 SAY "| UPS :" 
  303.      @ 11, 7 SAY upszone
  304.      @ 11,33 SAY "   Buyer:" 
  305.      @ 11,42 SAY buyer
  306.      @ 11,51 SAY "|" 
  307.      @ 12, 0 SAY "|                                Salesman:" 
  308.      @ 12,42 SAY salesman
  309.      @ 12,51 SAY "|" 
  310.      @ 13, 0 SAY "| Phone Number:" 
  311.      @ 13,15 SAY phone:no
  312.      @ 13,51 SAY "|" 
  313.      @ 14, 0 SAY "|" 
  314.      @ 14,51 SAY "|" 
  315.      @ 15, 0 SAY "| Special Instructions:" 
  316.      @ 15,23 SAY spl:inst
  317.      @ 15,51 SAY "|" 
  318.      @ 16, 0 SAY "|" 
  319.      @ 16,51 SAY "|" 
  320.      @ 17, 0 SAY "| FFL Number:" 
  321.      @ 17,13 SAY ffl:no
  322.      @ 17,28 SAY "Expires(YYMM):" 
  323.      @ 17,42 SAY expires
  324.      @ 17,51 SAY "|" 
  325.      @ 18, 0 SAY "+-------------------------------------------------" 
  326.      @ 18,50 SAY "-+" 
  327.      INPUT "Correct Account, (Y/N) ?" TO GO
  328.      IF .not. GO
  329.       LOOP
  330.      ELSE
  331.       STORE p.accnt:no TO number
  332.       STORE '               ' TO mem:detail
  333.       STORE 000.00 TO mem:debit 
  334.       STORE DATE () TO mem:date
  335.       @ 19,00
  336.       @ 20,00
  337.       @ 21,0
  338.       @ 22,0
  339.       @ 19, 3 SAY "  DATE MM/DD/YY:" 
  340.       @ 19,19 GET mem:date PICTURE '99/99/99' 
  341.       @ 20, 3 SAY "AMOUNT TO DEBIT:" 
  342.       @ 20,19 GET mem:debit 
  343.       @ 21,12 SAY "DETAIL:" 
  344.       @ 21,19 GET mem:detail PICTURE '!!!!!!!!!!!!!!!' 
  345.       READ
  346.       SELECT PRIMARY
  347.       REPLACE balance WITH balance+mem:debit
  348.       STORE balance TO rbal
  349.       SELECT seco
  350.       APPEND BLANK
  351.       REPLACE DATE WITH mem:date,debit WITH mem:debit,detail WITH mem:detail
  352.       REPLACE accnt:no WITH number,rbalance WITH rbal
  353.      ENDIF .not. GO 
  354.     ENDIF number= '99' 
  355.    ENDDO WHILE getdebits 
  356.   CASE command= '4' 
  357.    SELECT PRIMARY
  358.    USE accounts INDEX accnt:no
  359.    SELECT secondary
  360.    USE ledger INDEX ledger
  361.    STORE t TO legedit
  362.    DO WHILE legedit
  363.     STORE 00.00 TO mcred
  364.     STORE 00.00 TO mdeb
  365.     ERASE
  366.     ?
  367.     ? ' **** E D I T I N G   L E D G E R  C A R D S ****' 
  368.     ? 
  369.     ?
  370.     ? "Enter '99' as Account Number to return " 
  371.     ? "to Ledger Menu." 
  372.     ?
  373.     ? 'What is the number of the account whose' 
  374.     ACCEPT "LEDGER CARD you wish to EDIT " TO number
  375.     IF number= '99' 
  376.      STORE f TO legedit
  377.      LOOP
  378.     ELSE
  379.      @ 12,2 SAY "Enter amount of existing CREDIT: " 
  380.      @ 12,36 GET mcred
  381.      @ 13,15 SAY "or" 
  382.      @ 14,2 SAY "Enter amount of existing  DEBIT: " 
  383.      @ 14,36 GET mdeb
  384.      READ
  385.      IF mcred>0 .AND. mdeb>0
  386.       ?? chr(07)
  387.       LOOP
  388.      ENDIF mcred>0 .AND. mdeb>0 
  389.      SELECT secondary
  390.      STORE !(number) TO number
  391.      FIND &number
  392.      SKIP -1
  393.      LOCATE FOR accnt:no=number .AND. credit=mcred .AND. debit=mdeb next 150 
  394.      IF eof .OR. (accnt:no<>number) .OR. (credit<>mcred) .OR. (debit<>mdeb)
  395.       ? chr(07)
  396.       @ 17,0 SAY '    *********NO SUCH TRANSACTION TO DATE*********' 
  397.       @ 19,0 SAY '                <return> to continue' 
  398.       ?
  399.       SET console OFF
  400.       WAIT
  401.       SET console ON
  402.       LOOP
  403.      ENDIF eof .OR. (accnt:no<>number) .OR. (credit
  404.      SELECT PRIMARY
  405.      FIND &number
  406.      IF *
  407.       ?
  408.       ? '             *** E R R O R ***' 
  409.       ?
  410.       ? 'You cannot edit a record tagged for deletion.' 
  411.       ? 'Undelete (D) before atempting to debit' 
  412.       ?
  413.       ?
  414.       ? '                        <return> to continue' 
  415.       SET console OFF
  416.       WAIT
  417.       SET console ON
  418.       LOOP
  419.      ENDIF * 
  420.      REPLACE p.balance WITH p.balance-s.debit+s.credit
  421.      SELECT secondary
  422.      ERASE
  423.      @ 1, 1 SAY "***** E D I T I N G   L E D G E R  C A R D S *****" 
  424.      @ 3, 0 SAY "+-------------------------------------------------" 
  425.      @ 3,50 SAY "-+" 
  426.      @ 4,0 SAY "|" 
  427.      @ 4,51 SAY "|" 
  428.      @ 5,0 SAY "|" 
  429.      @ 5,51 SAY "|" 
  430.      @ 5,13 SAY "Account #:" 
  431.      @ 5,23 SAY s.accnt:no
  432.      @ 6,0 SAY "|" 
  433.      @ 6,51 SAY "|" 
  434.      @ 7,0 SAY "|" 
  435.      @ 7,18 SAY "Date:" 
  436.      @ 7,23 GET s.DATE PICTURE '99/99/99' 
  437.      @ 7,51 SAY "|" 
  438.      @ 8,0 SAY "|" 
  439.      @ 8,51 SAY "|" 
  440.      @ 9,0 SAY "|" 
  441.      @ 9,16 SAY "Credit:" 
  442.      @ 9,23 GET s.credit
  443.      @ 9,51 SAY "|" 
  444.      @ 10,0 SAY "|" 
  445.      @ 10,51 SAY "|" 
  446.      @ 11,0 SAY "|" 
  447.      @ 11,17 SAY "Debit:" 
  448.      @ 11,23 GET s.debit
  449.      @ 11,51 SAY "|" 
  450.      @ 12,0 SAY "|" 
  451.      @ 12,51 SAY "|" 
  452.      @ 13,0 SAY "|" 
  453.      @ 13,16 SAY "Detail:" 
  454.      @ 13,23 GET s.detail PICTURE '!!!!!!!!!!!!!!!' 
  455.      @ 13,51 SAY "|" 
  456.      @ 14,0 SAY "|" 
  457.      @ 14,51 SAY "|" 
  458.      @ 15,0 SAY "|" 
  459.      @ 15,51 SAY "|" 
  460.      @ 16,0 SAY "|" 
  461.      @ 16,51 SAY "|" 
  462.      @ 17,0 SAY "|" 
  463.      @ 17,51 SAY "|" 
  464.      @ 18,0 SAY "|" 
  465.      @ 18,51 SAY "|" 
  466.      @ 19,0 SAY "|" 
  467.      @ 19,51 SAY "|" 
  468.      @ 20, 0 SAY "+-------------------------------------------------" 
  469.      @ 20,50 SAY "-+" 
  470.      READ
  471.      SELECT PRIMARY
  472.      REPLACE p.balance WITH p.balance+s.debit-s.credit
  473.     ENDIF number= '99' 
  474.    ENDDO WHILE legedit
  475.   CASE command= '5' 
  476.    SELECT PRIMARY
  477.    USE ledger INDEX ledger
  478.    SELECT secondary
  479.    USE accounts INDEX accounts
  480.    GO TOP
  481.    SET exact OFF
  482.    RELEASE ALL
  483.    ERASE
  484.    ?
  485.    ? '        ***** S T A T E M E N T S *****' 
  486.    ? 
  487.    ?
  488.    ? 'Enter CATEGORY you wish to have statements' 
  489.    ACCEPT 'printed for ' TO statecateg
  490.    ERASE
  491.    ?
  492.    ? '        ***** S T A T E M E N T S *****' 
  493.    ? 
  494.    ?
  495.    ? 'Ready the PRINTER and press <return> -- or' 
  496.    ? "enter an 'A' ABORT and return to the ledger menu " 
  497.    ?
  498.    SET console OFF
  499.    WAIT TO GO
  500.    SET console ON
  501.    IF !(GO)<> 'A' 
  502.     ERASE
  503.     @ 12,16 SAY "PRINTING" 
  504.     SET console OFF
  505.     SET PRINT ON
  506.     SET FORM TO PRINT
  507.     DO WHILE .not. eof
  508.      SELECT seco
  509.      IF s.category=statecateg .AND. (.not. *) 
  510.       IF s.terms= 'NET 30' 
  511.        STORE "Net 30 Days from date of Invoice" TO mterms
  512.       ELSE
  513.        STORE s.terms TO mterms
  514.       ENDIF s.terms= 'NET 30' 
  515.       STORE s.accnt:no TO maccount
  516.       @ 5,50 SAY chr(14)+ "STATEMENT" 
  517.       @ 6,50 SAY "AS OF:" 
  518.       @ 6,57 SAY DATE ()
  519.       @ 8, 4 SAY trim(s.bill:nm)
  520.       @ 9, 4 SAY trim(s.bill:ad)
  521.       @ 10, 4 SAY trim(s.bill:cty)
  522.       @ 10,20 SAY trim(s.bill:st)
  523.       @ 11, 4 SAY trim(s.bill:zp)
  524.       @ 13, 0 SAY "ACCOUNT NUMBER:" 
  525.       @ 13,16 SAY s.accnt:no
  526.       @ 13,30 SAY "TERMS: &mterms" 
  527.       @ 14, 0 SAY "+------------------+-------------------+----------" 
  528.       @ 14,50 SAY "------+----------------------+" 
  529.       @ 15, 0 SAY "|       DATE       |      DETAIL       |   DEBIT " 
  530.       @ 15,56 SAY "|   CREDIT             |" 
  531.       @ 16, 0 SAY "+------------------+-------------------+----------" 
  532.       @ 16,50 SAY "------+----------------------+" 
  533.       SELECT PRIMARY
  534.       FIND &maccount
  535.       STORE 17 TO x
  536.       STORE "2" TO p
  537.       DO WHILE p.accnt:no=maccount .AND. (.not. eof)
  538.        @ x,8 SAY p.DATE
  539.        @ x,21 SAY p.detail
  540.        @ x,42 SAY p.debit 
  541.        @ x,59 SAY p.credit
  542.        SELECT PRIMARY
  543.        SKIP +1
  544.        STORE x+1 TO x
  545.        IF x=55 .AND. (p.accnt:no=maccount)
  546.         EJECT
  547.         @ 5,50 SAY chr(14)+ "STATEMENT" 
  548.         @ 6,50 SAY "AS OF:" 
  549.         @ 6,57 SAY DATE ()
  550.         @ 8, 4 SAY trim(s.bill:nm)
  551.         @ 8,50 SAY chr(14)+ "PAGE &p" 
  552.         @ 9, 4 SAY trim(s.bill:ad)
  553.         @ 10, 4 SAY trim(s.bill:cty)
  554.         @ 10,20 SAY trim(s.bill:st)
  555.         @ 11, 4 SAY trim(s.bill:zp)
  556.         @ 13, 0 SAY "ACCOUNT NUMBER:" 
  557.         @ 13,16 SAY s.accnt:no
  558.         @ 13,30 SAY "TERMS: &mterms" 
  559.         @ 14, 0 SAY "+------------------+-------------------+----------" 
  560.         @ 14,50 SAY "------+----------------------+" 
  561.         @ 15, 0 SAY "|       DATE       |      DETAIL       |   CREDIT" 
  562.         @ 15,56 SAY "|   DEBIT              |" 
  563.         @ 16, 0 SAY "+------------------+-------------------+----------" 
  564.         @ 16,50 SAY "------+----------------------+" 
  565.         STORE 17 TO x
  566.         STORE "3" TO p
  567.        ENDIF x=55 
  568.       ENDDO WHILE p.accnt:no=maccount .AND. (.not. e
  569.       SELECT seco
  570.       @ 57,55 SAY "+-----------------------+" 
  571.       @ 58,55 SAY "| BALANCE:$" 
  572.       @ 58,66 SAY s.balance
  573.       @ 58,79 SAY "|" 
  574.       @ 59,55 SAY "+-----------------------+" 
  575.       SKIP +1
  576.       EJECT
  577.      ELSE
  578.       SELECT seco
  579.       SKIP +1
  580.      ENDIF category=statecateg 
  581.     ENDDO WHILE .not. eof 
  582.    ENDIF !(GO)<> 'R' 
  583.    SET PRINT OFF
  584.    SET console ON
  585.    SET FORMAT TO screen
  586.    SET exact ON
  587.   OTHERWISE
  588.    ERASE
  589.    ? chr(07)
  590.  ENDCASE 
  591. ENDDO WHILE t 
  592.