DISC 4372-Spring
2002-Parks-Name_______________________ SSN___________________
An open item accounts payable system records each vendor invoice in a table row. A vendor may have MORE THAN ONE invoice in the table. The table structure for the table payables is:.
CREATE TABLE payables (
vendor-num int NOT NULL,
seq-num int IDENTITY, '**** auto-generated row number
vendor-name varchar(30) NOT NULL,
invoice-day char(2),
invoice-month char(2),
invoice-year char(2),
invoice-amt decimal (12,2),
amount-paid decimal(12,2),
check-num char(10),
paid-switch char(1), '**** "Y" = the invoice has been paid, "N" = the invoice has not been paid
.
.
.
primary key (vendor-num, seq-num))
Write a active server page that allows invoices to be paid:
- One the first pass, the asp program produces a list all vendors (i.e., every unique vendor-name) in the payables table (i.e., ONLY ONE ROW PER VENDOR in the report). This list is in alphabetical vendor-name order. Each name is a link. The link contains as part of the quertystring the vendor-num and a state maintenance variable. When the user clicks on a vendor name, the html page returns the vendor-num and state maintenance variable to the asp program.
- On the second pass, the asp program creates a report with a list of all invoices that HAVE NOT BEEN PAID for the vendor-num requested. This list produces one row per invoice. The row contains: vendor-name, seq-num, invoice-amount, invoice month-day-year. The report is sorted in ascending date order (i.e., oldest first). The seq-num is a link. This link contains the vendor-num, seq-num and state-maintenance variable as part of its querystring. When the user clicks on a seq-num, the HTML page sends the querystring back to the asp program
- On the third pass, the asp program returns the details of the specific invoice chosen in step two above (i.e., vendor-name, vendor-num, seq-num, invoice date, and invoice-amount). The program also returns: a text box that is labelled "Amount Paid"; a text box labelled "Check Number"; and a submit button. The user fills in the amount to be paid and the check-number and then clicks the submit button. A form is returned to the asp program that contains: vendor-name, vendor-num, seq-num, amount-paid, check-num and a state maintenance variable.
- On the fourth pass, the asp program records the invoice payment. The form amounts are used to update the amount-paid and check-num fields and the paid-switch is set to "Y". The program should first:
- check the table for duplicate check numbers (i.e., assure that this check-num has not already been issued)
- check to be sure that the amount-paid equals the invoice-amount (i.e., no partial payments or overpayments are allowed)
If either of these errors occurs::
- return an error message to the user that states the error problem (either duplicate check-num or wrong amount-paid)
- provide the user with all the data received on this pass (i.e., vendor-name, vendor-num, seq-num, amount-paid, check-num), two text boxes with amount-paid and check-num filled in (i.e., with values the user entered on the previous pass) and a submit button. This allows the user to correct their data and resubmit the form.
else
produce a page that tells the user that the invoice payment has been recorded OK.
DO NOT provide client side editing of the data. DO NOT USE transaction control.