- Print
-
This button is used in order to produce a paper copy of all the
information stored in the inventory table.
The Print button will first load a standard Print Setup Dialog box, which will
allow the user to adjust the current printer, and the format of the pages.
The PRINT function will produce the report:
- in the current sorted order shown on the grid
- one record per line
- formating it with headers/footers (format is not determined)
- to the page size and format as given in the Print Setup Dialog Box
Then the job will be sent to the printer to print.
Purpose:
- To print a hardcopy of the grid records in the inventory window
Input:
- - user_action (from User)
- - inventories (from Inventories)
- - desc_categories (from Products)
- - Store ID (from User)
- - Security Access (from Security)
Output:
- - grid_records Listing (to printer)
- - UPCs (to Product)
Error Conditions :
- a) The inventory database is empty, ie nothing to print
Conditions Assumed True : All data is correct when printing
Process :
IF ( Security_access == FAIL )
ELSE
CALL windows_print_dialog_box*
IF 'ok' is received THEN
QUERY "inventories" data store, using the following inputs:
and return all inventories
QUERY "Products" data store, using the following inputs:
inventories.UPCs
Store ID
Security Access
and return all desc_categories
IF no matching records found THEN // happens in empty database
ELSE
CREATE a grid_records using the following:
inventories
desc_categories
SEND grid_records to Printer in specified format
ELSE IF 'cancel' is received
END
*Note the windows_print_dialog_box will return either (ok) or (cancel), no other values can be returned
- Find
-
The Find button allows a user to locate a particular record in the inventory
table. This button loads a seperate window called the Find Form and allows
the user to enter field specific data in order to locate a record.
The Find Form is a GENERIC dialog box. It will be used by all Find buttons
on all windows, this will remove possible redundancy in the program. Upon
creation of this form (by possible cloning techniques), the form will
dynamically setup a list of labels and associated Input Areas which coorespond
to the searchable fields in the table. A Search button and a Cancel button
will appear then at the bottom of the form.
The Input Areas will be interface objects (such as a text box, dropdown combo
box, or selection buttons) that relate to the data that field can contain.
For example:
The Status field in the Orders table is a dropdown combo box containing
predefined selections
The Status Input Area on the Find Form will be the same (a dropdown
combo box containing the same predefined selections)
NOTE:
It is possible to set up default criteria in this form. This can be
static (the same criteria appears everytime the form loads), OR it can
be dynamic (either the criteria from the last find is shown or possibly
a user-defined criteria is set)
When the user has completed entering the data that they wish to search on, they
will press the Search button.
If no data was entered in any of the above fields, the Search button will
return the messsage:
No data was entered, please enter something into one of the above
fields.
If data is given, the Search button will then search the table (using the
quickest and most appropiate method possible).
If a record is found that matchs the criteria given, the Find Form will close
and the table on the main window will scroll through the records in the grid
to the first record that matched the search criteria is visible.
If though, no records were located, the following message will be displayed:
Sorry, no record could be found matching those criteria.
The Find Form will stay open, and allow the user to enter another search.
The Cancel button will close the Find Form without a search being performed.
This allows a user to get rid of the form if it was loaded by mistake or no
more searches need be performed.
Purpose:
- To search for a particular grid record by some of it's values
Inputs :
- - find criteria (from User)
- - inventories (from Inventories)
- - desc_categories (from Products)
- - Store ID (from User)
- - Security Access (from Security)
Output :
- - grid_record (to Display)
- - UPCs (to Products)
Error Conditions :
- a) No find criteria given
- b) The find criteria is invalid (improper values)
- c) No record located
Conditions Assumed True :
Process :
Check to see if any find criteria were given
IF not find criteria given THEN
IF not find criteria valid THEN
QUERY "inventories" data store, using the following inputs:
find criteria
Store ID
Security Access
and return a matching inventory
QUERY "Products" data store, using the following inputs:
find criteria
Store ID
Security Access
and return a matching desc_category
IF no matching record found THEN
ELSE
CREATE a grid_record using the following:
SEND grid_record to Display
END IF
- Change Record
-
Purpose:
- To alter some of the values for an inventory record by way if update
Inputs :
- - Inventory_a (from User)
- - Inventory_b (from "Inventory" which corresponds to Inventory_a.UPC)
- - Store ID (from User)
- - Security Access (from Security)
Outputs :
- - Inventory (to Inventory)
- - Error_messages (to User)
Error Conditions :
- a) Making an invalid change to a field
Conditions Assumned True : Assume that user cannot even attempt to change the
- 'read-only' parts of the Inventory records
Process :
WHILE (Inventory_a != Inventory_b) // ie a field has been changed
IF ( range_checks( All altered fields ) == FAIL )
report error
re-prompt the field change that failed
ELSE ( range_checks == SUCCESS )
IF ( Security_Access == FAIL )
report Error
restore original value to field(s)
STOP
ELSE
SEND Inventory_a to Inventory to update
END
- Sort
-
The Sort button allows the user to sort the table using whichever field they
deem usefull. This button will load the Sort Form which will faciliate this.
The Sort Form is a GENERIC dialog box. It will be called by all Sort buttons
on all the windows in the application. The Sort Form will be created much
like the Find Form (described above). It will dynamically create a list of
selection buttons each of which designates a particular field in the table.
(Note that not all fields need be listed, only those that can be sorted by).
The sort form will contain a scroll bar that will allow users to
enter multiple field sorts (such as by Description AND Price), by
enabling the user to scroll to the next sort type (Primary, Secondary,
Tertiary, etc.)
At the bottom of the Sort Form will be two more selection buttons, the Ascending
and Descending buttons. These allow the user to determine in which direction
the records will be sorted in. As well, there will be a Sort button and a
Cancel button.
NOTE:
It is possible to set up a default selection in this form. This can be
static (the same selection appears everytime the form loads), OR it can
be dynamic (either the selection from the last sort is shown or possibly
a user-defined selection is set)
When the Sort button is pressed, the button will first determine if any
selection has been made.
If no selection has been made, the button will show the following message:
No sort criteria entered. Please select a field to sort by.
If no sort order has been selected, the button will show the following message:
No sort direction selected. Please select either Ascending or
Descending.
If successful, the table will be rebuilt (possibly using SQL) and the records
will be displayed in that order on the table on the main window. The Sort Form
will then be closed.
If the Cancel button is pressed, the Sort Form will be automatically closed
with no sort being performed.
Purpose:
- To sort the grid records of the inventory window
Inputs:
- - sort criteria (from User)
- - inventories (from Inventories)
- - desc_categories (from Products)
- - Store ID (from User)
- - Security Access (from Security)
Output:
- - grid_records (to Display)
- - UPCs (to Products)
Error Conditions:
- a) Improper sort criteria/order given
Conditions Assumed True:
Process:
Check to see if the sort criteria are proper (valid or whatnot)
IF not sort criteria given THEN
IF not sort order given THEN
QUERY "inventories" data store, using the following inputs:
sort criteria
Store ID
Security Access
and return all inventories
QUERY "Products" data store, using the following inputs:
inventories.UPCs
Store ID
Security Access
and return all desc_categories
CREATE a grid_records using the following:
inventories
desc_categories
SEND grid_records to Display
- Exit
-
If the user presses this button, the inventory window (and Sort and Find forms
if they are open) will be closed.
As all data is updated immediately through the grid, no data need be stored
at this point.
Purpose:
- To exit from the inventory window
Input :
- - None
Output :
- - Closing of the Inventory screen and control returning to the
- Main menu
Error Condidtions : None
Conditions Assumed True: The data has been saved properly
Process :
CLOSE Inventory_window
RETURN control to Main_menu
END
The Inventory Window, corresponds almost directly to the Inventory Table
stored in the database.
As well, using the UPC as a primary key, the following fields are loaded
out of the Product Table in the database:
All records that are changed are restored in the database automatically
As well, the User Security level must be available to disable any fields on
the grid that the particular user can not access.
Printing will export a formatted document to the printer (how this document
will be formatted is not yet determined).
The list of Categories must also be loaded from somewhere (in order to
populate the drop down combo box in the grid). This data can be stored in an
INI file or in its own table in the database (whatever is decided).
Other "from user" inputs are detailed in each of the button descriptions.