Capt. Horatio T.P. Webb | MIS 3371 Transaction Processing I
ASSIGNMENT #3 -- Fall 2014 Last Updated 11AM 8/22/2014
|
This client-side data entry/validation is composed of HTML, XML and Javascript.
These components will provide the user with the ability to make client-side journals entries (the journal voucher).
The Journal Entry Process
The process of creating journal entries begins with pre-numbered paper document -- the journal voucher. This document contains:
- a preprinted unique four-digit numeric source reference number
- a maximum of six journal entries per voucher. Each journal entry contains:
- four digit major account number
- four digit minor account number
- four digit sub1 account number
- four digit sub2 account number
- transaction amount (currency)
- 50 character text description for each entry
- the sum of the journal entry transaction amounts (which must be zero)
- the entire journal voucher should be contained in a form named "jvform"
The HTML for such a journal voucher appears as:
EDITING TASKS
NOTE: Three journal entries have four 4-digit account numbers, transaction amounts and one has a journal entry description that are loaded initial using value clauses.
When you click on "Validate and Submit", your form should:
- Assure that the source reference number is a four digit number -- no blanks or non-numeric characters
- Check for valid fiscal-month numeric values: 1,2,3,..., 11,12
- Allow for up to six detail journal entries
- Assure that major, minor, sub1 and sub2 each contain four digit numbers
If less than four digits are entered in major OR minor OR sub1 OR sub1, then the field should be padding with zeroes at the beginning (e.g., if the user enters "33", then the script should convert this to a four digit number "0033", if they enter "0", the script should convert this to "0000")
Blank fields are not allowed in the major, minor, sub1. sub2 or ta fields
However, if an account number containing ALL zeroes is INVALID (i.e., if major=0000 AND minor=0000 AND sub1=0000 AND sub2=0000, then the journal entry is considered INVALID because there will never be an Account Number composed of all zeroes)
- Transaction amounts should be valid currency numbers (positive or negative) (i.e., a number with two digits to the right of the decimal)
- Descriptions are always optional (i.e, this field may be empty)
- If any of the four account fields (i.e., major, minor, sub1 or sub2) have entries (i.e., not blank), then there must be a valid transaction amount for that entry
- If a transaction amount is entered, then a valid GL account number must be present
- Check to assure that for the voucher, the sum of the transaction amounts is zero
- a minimum of two rows and a maximum of six rows (i.e., journal entries) must be present
Each type of failure is to be reported to the user in a message (or alert) box and the form should NOT be submitted.
If the journal voucher passes all the editing tests, the script should create a string of XML:
- The tags to be used are defined by the following DTD:
<?xml version="1.0"?>
<!DOCTYPE journalvoucher [
<!ELEMENT journalvoucher (srn, fm, je+)
<!ELEMENT srn (#PCDATA) >
<!ELEMENT fm (#PCDATA) >
<!ELEMENT je ( major,minor,sub1,sub2,ta,desc) >
<!ELEMENT major (#PCDATA) >
<!ELEMENT minor (#PCDATA) >
<!ELEMENT sub1 (#PCDATA) >
<!ELEMENT sub2 (#PCDATA) >
<!ELEMENT ta (#PCDATA) >
<!ELEMENT desc (#PCDATA) >
]
The string should be named "xmlstring" in the script. The value of "xmlstring" might look something like this:
<journalvoucher><srn>1234</srn><fm>11</fm><je><major>1000</major>
<minor>1500</minor><sub1>0300</sub1><sub2>9100</sub2><ta>-123.09</ta>
<desc>Pay Electrical Bill for March</desc></je><je><major>9000</major><minor>2500</minor>
<sub1>0100</sub1><sub2>1000</sub2><ta>123.09</ta><desc></desc></je></journalvoucher>
If a journal entry (i.e., a row) is empty, DO NOT create a XML data for that journal entry (i.e., row).
On the HTML page there should ALSO be:
- a second form named "xmlform"
- with one hidden HTML object named "xmlout"
- specify the method as "GET"
- specify the action as "http://auckland.bauer.uh.edu/Students/parks/echoxml2.asp"
Once "xmlstring" is created it should be placed in the hidden HTML object "xmlout".
- Then submit the "xmlform" to test the contents of the form's querystring. This server-side program will return the XML string to the user by setting the content-type to txt/xml and returning the querystring as the only text. The result (if IE5 or later) on the browser will be a correctly parsed XML file of the user's data.
Regardless or whether you choose to write the assignmnet in javascript or vbscript, the page should be named:
a3.htm
It is imperative that you use the filename EXACTLY as shown. My grading program will look ONLY for the name "a3.htm" on the CD/DVD you turn in at the end of the semester. If it doesn't find this filename, your assignment WILL NOT BE GRADED.
Return to Parks' mis3371 Homepage