home *** CD-ROM | disk | FTP | other *** search
- * Viewinvs.prg displays information concerning the specified
- * invoice.
-
- * Select databases Customer with index Custno and Invoices
- SELECT Customer
- SET INDEX TO Custno, Lastname, Ziplist
- SELECT Invoices
-
- * Set up relation between Invoices and Customer
- SET RELATION TO Custno INTO Customer
-
- * Begin main loop
- STORE .T. TO more
- DO WHILE more
-
- * Get number of invoice to be displayed
- CLEAR
- @ 3,0 SAY CENTER("VIEW INVOICE RECORDS")
- STORE SPACE(5) TO minvoice
- @ 12,5 SAY "Enter invoice number: ";
- GET minvoice PICTURE "!!!!!"
- READ
-
- * Search for entered value
- SEEK minvoice
-
- * If invoice is found, display all pertinent information
- IF FOUND()
- CLEAR
- @ 3,0 SAY "Invoice number: " + Invoiceno
- @ 5,0 SAY "Ship to:"
- @ 5,10 SAY TRIM(Customer->Firstname)+" "+ Customer->Lastname
- @ 6,10 SAY Customer->Company
- @ 7,10 SAY Customer->Address
- @ 8,10 SAY TRIM(Customer->City) + ", " +;
- Customer->State + " " + Customer->Zip
- IF Customer->Country <> "U.S.A."
- @ 9,15 SAY Customer->Country
- ENDIF
- @ 12,5 SAY "Quantity Part Number"+;
- " Price"
- @ 11,0 TO 13,79
- @ 13,0 TO 16,79
- @ 14,5 SAY STR(Quantity,8)
- @ 14,25 SAY Partnum
- @ 14,59 SAY STR(Price)
- @ 18,5 SAY "Ship date: " + DTOC(Shipdate)
- @ 18,39 SAY "Payment due by: " + DTOC(Datedue)
-
- * Use the immediate IF function IIF()
- * to convert Paid value to appropriate message
- @ 19,39 SAY IIF(Paid, "Payment received? YES",;
- "Payment received? NO")
-
- * If invoice not found, display message
- ELSE
- @ 14,5 SAY "Invoice not on file"
- ENDIF
-
- * Check whether user wishes to look up additional invoices
- STORE " " TO choice
- @ 22,5 SAY "Look up another invoice? (Y/N): ";
- GET choice PICTURE "Y"
- READ
- IF choice = "N"
- STORE .F. TO more
- ENDIF
-
- * End main loop
- ENDDO
-
- * Reset operating environment and return to Menu.prg
- SET RELATION TO
- RETURN