home *** CD-ROM | disk | FTP | other *** search
- * ┌─────────────────────────────────────────────────────────────────────┐ *
- * │ SALESREG.PRG: INVOICE REGISTER │ *
- * │ Copyright (c) 1989 Tech III, Inc. All rights reserved. │ *
- * │ Tech III of San Pedro, California (213) 547-2191. │ *
- * │ "The bridge connecting people and technology."(tm) │ *
- * └─────────────────────────────────────────────────────────────────────┘ *
- @ 00,00 SAY WINTITLE(PROMPT())
-
- SELECT invoice
- STORE RECNO() TO curr_rec
- SET ORDER TO inv_inv
-
- * INITIALIZE VARIABLES
- STORE .t. TO printing
- STORE invoice TO startno, endno
- STORE 'PRINTER' TO output
-
- * DEFINITIONS
- ON ESCAPE STORE .f. TO printing
-
- * USER INPUT: SELECT INVOICE RANGE TO PRINT
- @ 02,02 SAY 'Begin printing with invoice number: ' ;
- GET startno ;
- PICTURE '99999' ;
- VALID GETFIRST()
-
- @ 04,02 SAY 'Stop printing after invoice number: ' ;
- GET endno ;
- PICTURE '99999' ;
- RANGE startno,99999 ;
- VALID GETLAST()
-
- @ 06,02 SAY ' Direct report to: PRINTER/SCREEN: ' ;
- GET output PICTURE '@M PRINTER,SCREEN '
- READ
-
- STORE .t. TO printing
- IF .NOT. YESNO("System is ready to run report.")
- STORE .f. TO printing
- ELSE
- IF output<> "SCREEN "
- IF .NOT. READY2PR()
- STORE .f. TO printing
- ENDIF
- ENDIF
- ENDIF
-
- SEEK startno
-
- * START PRINTING
- IF printing
- CLEAR
- IF output = 'PRINTER'
- REPORT FORM salesreg NOEJECT TO PRINT REST WHILE invoice <= endno
- ELSE
- REPORT FORM salesreg TO FILE report.txt NOEJECT REST WHILE invoice <= endno
- SELECT 0
- USE system
- LOCATE FOR LABEL = 'SALESREG: '
- IF EOF()
- APPEND BLANK
- ELSE
- REPLACE NEXT 1 contents WITH ''
- ENDIF
- REPLACE LABEL WITH 'SALESREG: ' + DTOC(DATE())
- APPEND MEMO contents FROM report.txt
- MODIFY MEMO contents NOEDIT WINDOW reportview
- USE
- SELECT invoice
- ENDIF
- DO standby WITH 'Your report request has been completed.'
- ELSE
- DO standby WITH 'You have canceled the report.'
- ENDIF
- ON ESCAPE
- RETURN
-
- FUNCTION getfirst
- SET NEAR ON
- SEEK startno
- IF FOUND()
- SET NEAR OFF
- RETURN .t.
- ELSE
- DO standby WITH "That invoice isn't on file."
- IF EOF()
- GO TOP
- ENDIF
- STORE invoice TO startno
- SET NEAR OFF
- RETURN .f.
- ENDIF
-
- FUNCTION getlast
- SET NEAR ON
- SEEK endno
- IF FOUND()
- SET NEAR OFF
- RETURN .t.
- ELSE
- DO standby WITH "That invoice isn't on file."
- IF EOF()
- GO TOP
- ENDIF
- STORE invoice TO endno
- SET NEAR OFF
- RETURN .f.
- ENDIF
-
- * EOF
-