Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : ADVANCED.ZIP
Filename : SALREPS.PRG

 
Output of file : SALREPS.PRG contained in archive : ADVANCED.ZIP
**************************************************** SALREPS.PRG
* Print reports from the Sales file.
* Called from Sales Menu, SMENU.PRG.

*----- Open files and set up relationship.
SELECT 1
USE Sales
SELECT 2
USE Master INDEX Master

SELECT 1
SET RELATION TO Part_No INTO Master


RepChoice = 0
*------- Start loop for menu.
DO WHILE RepChoice # 3
CLEAR
@ 2,1 SAY "Sales Report Options"
@ 2,60 SAY DTOC(T_Date) + " " + TIME()
@ 3,0 SAY ULine
?
?
TEXT
1. By invoice number

2. By dates


3. Return to Sales Menu
ENDTEXT

@ 24,1 SAY "Enter choice (1-3) " GET RepChoice PICT "9"
READ

*------- If not exiting, ask about printer.
@ 5,0 CLEAR
STORE " " TO YN, Printer
IF RepChoice # 3
@ 15,5 SAY "Send to printer? " GET YN PICT "!"
READ

*------- Set up printer macro.
IF YN = "Y"
Printer = "TO PRINT"
ENDIF
ENDIF

*------- Print appropriate report based upon request.
@ 5,0 CLEAR
DO CASE

*------- Case 1: Search by invoice number.
CASE RepChoice = 1
@ 15,5
INPUT "Look for what invoice number?: " TO ISearch
CLEAR
LOCATE FOR Invoice_No = ISearch

*------- If found, print invoice.
IF FOUND()
IF YN = "Y"
SET PRINT ON
ENDIF

*------- Print header info from first record
*------- with that invoice number.
? "Invoice number:", Invoice_No
?? " Date:", Date
? "Clerk:", Clerk, "Customer:", Customer
?
? " Part # Part Name Qty Price Total"

*------- Print data for all records
*------- with that invoice number.
LIST OFF WHILE Invoice_No = ISearch;
Part_No, B->Title,Qty, Price, (Qty * Price)
IF YN = "Y"
EJECT
SET PRINT OFF
ENDIF
ENDIF (not eof)

*------- Case 2: Search by dates.
CASE RepChoice = 2
STORE SPACE(8) TO Start, End
@ 15,5 SAY "Enter start date " GET Start PICT "99/99/99"
@ 17,5 SAY "Enter end date " GET End PICT "99/99/99"
READ
Start = CTOD(Start)
End = CTOD(End)
CLEAR

*------- Print the report.
REPORT FORM Sales;
FOR Date >= Start .AND. Date <= End &Printer

ENDCASE

*------- If not going to printer, pause the screen.
IF YN # "Y" .AND. RepChoice # 3
?
?
WAIT "Press any key to return to the Reports Menu..."
ENDIF

ENDDO (while user does not request exit)

*------- When done, return to Sales Menu.
SET RELATION TO
CLOSE DATABASES
RETURN



  3 Responses to “Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : ADVANCED.ZIP
Filename : SALREPS.PRG

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/