Before you start
This tutorial is for Web application developers investigating the XForms Web form processing technology. This tutorial is the third installment of a six-part series developing a suite of accounting tools for a business. The last tutorial introduced some basic XForms flavors of classic HTML forms concepts. This tutorial introduces several more XForms programming elements, the mechanisms of which perform some fairly involved calculations.
Nearly every profitable business implements some notion of billing management. The example business demonstrating the functionality for this tutorial (we will create a budgeting tool for X-Trapolate) operates under the assumption that customers make orders that consist of separate items and that each item comes from a specific department. Each order comes from a single invoice and the income from each item attributed to a department directly contributes to that department's profit. Each department also makes purchases of equipment that contributes to the expenses for that department. The budgeting process allows management to create and destroy departments and sub-departments and to change each department's planned profit and planned expenses or to compare the planned profits and expenses against the current totals as determined by the recorded orders and expenses.
The billing tool, that will also be created in this tutorial, attempts to serve as a mechanism for the billing staff to generate bills for customer accounts, print receipts, or send accounts to collections. The database of contacts originally referenced in the last tutorial of this series, after enhancements, contains information adequate for billing and can be queried for that information. Additionally, identification numbers link the accounts with individual orders and with payments.
The purpose of the series is to demonstrate the use of XForms in the development of realistic Web applications and to instruct the reader in the use of XForms.
- Part 1 is an introduction to the entire series summarizing all the portions of the end result and what facets of the XForms specification each part covers.
- Part 2 covers logging in and account management.
- Part 3 covers the development of forms pertaining to asset management.
- Part 4 continues the coverage of the development of asset management and reporting of various accounting aspects of a business.
- Part 5 covers liability management and more enhancements.
- Part 6 concludes the series with a summary of the developed tools, and some suggestions for improvement and further work for the tool set.
This tutorial uses a MySQL database for storage and reference. Necessary SQL commands appear throughout the article, but require a working knowledge of MySQL. PHPMyAdmin offers equivalent access to configure the MySQL database and view the entries from a menu driven graphical interface.
Though the purpose of the series is to educate the reader about the use of XForms, some background is expected. There are some very good articles and introductory series concerning XForms available from developerWorks (see Resources). XForms is built on XML, and, hence, a basic understanding of XML is also assumed.
Other technologies and concepts may also be involved, but they will be to a much lesser extent and should be inconsequential to the reader's comprehension of the topic. Some software is also required:
- A browser capable of displaying XForms, such as Firefox 2.0.1.
- A Web server with PHP enabled, such as WAMP
- An SQL server, MySQL, which is part of the WAMP package in this case.

