home *** CD-ROM | disk | FTP | other *** search
- *************** Checkstu COMMAND FILE *****************
- *áPrint≤áou⌠áchecδ numbers¼áamounts¼áanΣ balance≤áfroφáthσ Checkfil when
- * SALARIES and BILLS are paid. When more than one bill is paid by a
- * single check, the program totals all the bills against that check if they
- * are entered in consecutive order (which they are in the two command files).
- * Records are marked for deletion, but can be reviewed and retrieved.
- *****************************************************************************
- *
- CLEAR
- @ 3,25 SAY '*** DO NOT INTERRUPT ***'
- @ 4,25 SAY ' JUST GETTING ORGANIZED'
- *
- * A single check number may cover several bills, so these commands summarize
- * the payments by check number. Any deleted entries in the Checkfil are
- * also eliminated when the TOTAL is done.
- SELECT 6
- TOTAL ON Check_Nmbr TO Scratch FOR .NOT. DELETED()
- COUNT FOR .NOT. DELETED() TO Entries
- *
- * We open the Scratch file in a second work area so that we can update the
- * Balance field from the Checkfil, which is open in the first work area.
- * For each entry in the Checkfil, the UPDATE command replaces the Balance
- * in the Scratch file with the Balance from the Checkfil. When there are
- * several entries in the Scratch file for a given check number, this is
- * done several times. We could have written a loop to skip repeated entries,
- * but this way is faster and just as accurate.
- SELECT 9
- USE Scratch
- UPDATE ON Check_Nmbr FROM Checkfil REPLACE Balance WITH F->Balance
- COUNT FOR .NOT. DELETED() TO Checks
- *
- STORE 0 TO Spacer, LineCnt
- *
- * If there were several entries for a single check number, print them
- IF Entries > Checks
- SELECT 6
- GO TOP
- CLEAR
- @ 4,0 SAY ' '
- * Print the column headings for the output
- SET PRINT ON
- ? ' THESE INDIVIDUAL BILLS WERE PAID:'
- ?
- ? ' Date Check Name Amount Bill';
- +' Job Number'
- ?
- * Now print all the checks that were written
- DO WHILE .NOT. EOF()
- IF .NOT. DELETED()
- ?? ' ',Check_Date, Check_Nmbr + ' ' + Name, Amount,;
- Bill_Nmbr,Client+'-'+STR(Job_Nmbr,4)
- ?
- LineCnt = LineCnt + 1
- Spacer = Spacer + 1è ENDIF
- *
- IF LineCnt >= 50
- ? CHR(12)
- STORE 0 TO LineCnt, Spacer
- ? ' Date Check Name Amount Bill ';
- +' Job Number'
- ENDIF
- *
- IF Spacer = 10
- ?
- Spacer = 0
- ENDIF
- *
- SKIP
- ENDDO
- SELECT 9
- ENDIF
- Spacer = 0
- LineCnt = LineCnt + 3
- IF LineCnt > 44
- ? CHR(12)
- LineCnt = 0
- ENDIF
- *
- * Now print all the individual checks that are to be written
- Doing = 'Y'
- DO WHILE UPPER(Doing)='Y'
- SELECT 9
- GO TOP
- CLEAR
- SET PRINT ON
- ? ' MAKE THE FOLLOWING ENTRIES IN THE CHECK BOOK:'
- ?
- ? ' Date Check Name Amount Balance'
- ?
- LineCnt = LineCnt + 3
- DO WHILE .NOT. EOF()
- IF .NOT. DELETED()
- ?? ' ', Check_Date, Check_Nmbr + ' ' + Name,;
- Amount, Balance
- ?
- LineCnt = LineCnt + 1
- Spacer = Spacer + 1
- ENDIF
- *
- IF LineCnt >= 50
- SET CONSOLE OFF
- ? CHR(12)
- SET CONSOLE ON
- STORE 0 TO LineCnt, Spacer
- ? ' Date Check Name Amount Balance'
- ?è ENDIF
- *
- IF Spacer = 10
- ?
- Spacer = 0
- ENDIF
- *
- SKIP
- ENDDO
- ?
- ?
- ?
- SET PRINT OFF
- WAIT 'Do you want to print it again (Y or N)?' TO Doing
- ENDDO
- *
- SET PRINT ON
- ? CHR(12)
- SET PRINT OFF
- *
- USE
- ERASE Scratch.dbf
- *
- SELECT 6
- DELETE All
- *
- RETURN