Presentation is loading. Please wait.

Presentation is loading. Please wait.

Create Purchase Order Application Using Appaserver ©Tim Riley 1. Create the purchase order database design. 2. Create the purchase order database tables.

Similar presentations


Presentation on theme: "Create Purchase Order Application Using Appaserver ©Tim Riley 1. Create the purchase order database design. 2. Create the purchase order database tables."— Presentation transcript:

1 Create Purchase Order Application Using Appaserver ©Tim Riley 1. Create the purchase order database design. 2. Create the purchase order database tables.

2 Purchase Order Database Design ©Tim Riley From Purchase_ Order purchase_datedate* purchase_timetime 4* vendorchar 30* Vendor vendorchar 30* Allocate 30 characters of text for each vendor name. Allocate 4 characters of database space for the purchase time. The format will be HH24. For example, 1310 represents 1:10 PM. The time will be automatically pre-populated in the data entry form. It's possible that two or more purchases could occur at the same minute. So include the vendor in the primary key.

3 Purchase Inventory ©Tim Riley Purchase_ Order purchase_datedate* purchase_timetime 4* vendorchar 30* many There is a many-to-many relationship between purchase order and inventory. Inventory are goods available for sale. Inventory is recorded as an asset until sold. It is recorded in the books at cost. When sold, the cost of inventory is recorded in the account called cost-of-goods- sold. Total cost-of- goods sold is subtracted from total revenues to yield gross- margin. Inventory inventorychar 30*

4 Purchase Inventory ©Tim Riley Purchase_ Order purchase_datedate* purchase_timetime 4* vendorchar 30* Inventory inventorychar 30* Purchase_ Inventory purchase_datedate* purchase_timetime 4* vendorchar 30* inventorychar 30* quantityinteger cost_per_itemfloat Convert the many-to-many relationship into two many- to-one relationships. Record the quantity purchased and the cost per item. The primary key of the new table are the primary keys of both tables. The new table is usually named by combining the names of both many-to-many tables.

5 Purchase Plant and Equipment ©Tim Riley Purchase_ Order purchase_datedate* purchase_timetime 4* vendorchar 30* Plant_Equipment plant_equipmentchar 30* Purchase_ Plant_Equipment purchase_datedate* purchase_timetime 4* vendorchar 30* plant_equipmentchar 30* quantityinteger cost_per_itemfloat Record the quantity purchased and the cost per item. Plant is the business term for buildings. Plant and equipment are buildings, machines, furniture, and tools that are used to add value to products and services. Their costs are material enough to warrant additional book-keeping. Plant and equipment are recorded as an asset. They are systematically expensed over time in the account called depreciation expense.

6 Purchase Supplies ©Tim Riley Purchase_ Order purchase_datedate* purchase_timetime 4* vendorchar 30* Supply supplychar 30* Purchase_ Supply purchase_datedate* purchase_timetime 4* vendorchar 30* supplychar 30* quantityinteger cost_per_itemfloat Record the quantity purchased and the cost per item. Supplies are products that cost less than a material amount. Supplies are expensed when purchased into the account called supplies expense.

7 Purchase Services ©Tim Riley Purchase_ Order purchase_datedate* purchase_timetime 4* vendorchar 30* Service servicechar 30* Purchase_ Service purchase_datedate* purchase_timetime 4* vendorchar 30* servicechar 30* hoursinteger cost_per_hourfloat Record the hours worked and the cost per hour. Services are consumed upon purchase. Services are expensed when purchased into the account called {service} expense. Replace {service} with the actual service. For example, Lawn Mowing expense.

8 Receive Inventory ©Tim Riley Purchase_ Inventory purchase_datedate* purchase_timetime 4* vendorchar 30* inventorychar 30* quantityinteger cost_per_itemfloat Receive_ Inventory received_datedate* received_timetime 4* vendorchar 30* inventorychar 30* purchase_datedate purchase_timetime 4 quantityinteger Partial shipments are possible. Foreign key to purchase inventory table. } Record the quantity received.

9 Receive Supplies ©Tim Riley Purchase_ Supply purchase_datedate* purchase_timetime 4* vendorchar 30* supplychar 30* quantityinteger cost_per_itemfloat Receive_ Supply received_datedate* received_timetime 4* vendorchar 30* supplychar 30* purchase_datedate purchase_timetime 4 quantityinteger Partial shipments are possible. Foreign key to purchase supply table. } Record the quantity received.

10 Receive Equipment ©Tim Riley Purchase_ Plant_Equipment purchase_datedate* purchase_timetime 4* vendorchar 30* plant_equipmentchar 30* quantityinteger cost_per_itemfloat Receive_ Plant_Equipment received_datedate* received_timetime 4* vendorchar 30* plant_equipmentchar 30* purchase_datedate purchase_timetime 4 quantityinteger Partial shipments are possible. Foreign key to purchase plant equipment table. } Record the quantity received.

11 Make Payment ©Tim Riley Purchase_ Order purchase_datedate* purchase_timetime 4* vendorchar 30* amount_duefloat Purchase_ Order_Payment payment_datedate* payment_timetime 4* vendorchar 30* purchase_datedate purchase_timetime 4 bankchar 30 account_numberchar 30 amount_paidfloat Foreign key to purchase order table. } Partial payments are allowed. Cash_Account bankchar 30* account_numberchar 30* Bank bankchar 30*

12 Purchase Order Database Tables ©Tim Riley Log in with your email address and password of changeit.

13 Become Administrator Role ©Tim Riley Choose the administrator role.

14 Purchase Order Database Tables ©Tim Riley From Purchase_ Order purchase_datedate* purchase_timetime 4* vendorchar 30* Vendor vendorchar 30* To preserve relational integrity, create all one tables first. Insert the vendor attribute very first.

15 Insert Attribute ©Tim Riley Choose the insert attribute menu item.

16 Insert Vendor Attribute ©Tim Riley The attribute name is vendor, the datatype is Text, and the size is 30 characters. Leave everything else blank.

17 Insert Vendor Attribute ©Tim Riley Scroll to the bottom of the top frame. Press the button.

18 Insert Vendor Attribute ©Tim Riley The new vendor attribute is inserted into the attribute table.

19 Purchase Order Database Tables ©Tim Riley From Purchase_ Order purchase_datedate* purchase_timetime 4* vendorchar 30* Vendor vendorchar 30* Second, insert the vendor folder.

20 Insert Folder ©Tim Riley Choose the insert folder menu item.

21 Insert Vendor Folder ©Tim Riley The folder name is vendor, the form is Prompt, and the insert screen will have 5 blank rows for data entry. Leave everything else blank. When the user chooses to lookup this folder, the Prompt form displays a query screen to select subsets. The alternative to the Prompt form is the Table form. The Table form displays all of the rows without a query screen first.

22 Insert Vendor Folder ©Tim Riley Scroll to the bottom of the top frame. Press the button.

23 Insert Vendor Folder Attribute ©Tim Riley Upon pressing, the bottom frame displays rows to insert the new folder's attributes.

24 Insert Vendor Folder Attribute ©Tim Riley Choose Vendor from the attribute drop-down, and enter 1 for the primary key index. Leave everything else blank. To show Appaserver that an attribute is not participating in the primary key, enter an integer in the display order column and leave the primary key index blank. Currently, the vendor folder only has one attribute, and it's the primary key. The press the button.

25 From Purchase_ Order purchase_datedate* purchase_timetime 4* vendorchar 30* Vendor vendorchar 30* Insert Vendor Relationship ©Tim Riley The next screen that appears in the bottom frame allows you to insert relations for the vendor folder. However, this folder doesn't have any many-to-one relationships. Instead, the vendor folder has a one-to-many relationship. This one-to-many relationship will be inserted into the relation folder when we insert the purchase order folder. When we insert the purchase order folder, the relationship will be many- to-one.

26 Insert Vendor Relationship ©Tim Riley The bottom frame allows you to insert relations for the vendor folder. However, this folder doesn't have any many-to-one relationships. Press the button without filling out this form..

27 Insert Vendor Permissions ©Tim Riley This screen allows you to insert permissions for the vendor folder. The permissions are insert, update, and lookup. Since the update permission has more authority than the lookup permission, the update permission assumes the user has lookup permission. The permissions for a folder are assigned to roles. Only a supervisor should be allowed to insert and update vendors. The press the button.

28 Insert Vendor Role Operation ©Tim Riley Allow the supervisor to be able to delete vendors. An operation places a yes/no check-box at the beginning of each row following a query. The delete operation places a trash-can check-box on each row. The press the button.

29 Insert Vendor Folder Complete ©Tim Riley We have just inserted rows into the following tables: 1) folder 2) folder_attribute 3) role_folder 4) role_operation The next step is to create the vendor table in the RDBMS.

30 Create Vendor Table ©Tim Riley Scroll to the top of the top frame. This will expose the menu choices. We're going to run a process.

31 Create Vendor Table ©Tim Riley Choose the Create Table process.

32 Create Vendor Table ©Tim Riley Choose the Finance application and the Vendor folder. This will create the vendor table in the RDBMS. All processes that manipulate the database have a Really yn safety mechanism. Choosing No (or leaving at Select) will only display the work that will take place. Choosing Yes will really do the work. Choose No the first time. Finally press.

33 Create Vendor Table ©Tim Riley This is the create table command that will be sent to the RDBMS. The create unique index command enforces the element uniqueness integrity constraint. Next, set Really yn to Yes, and press.

34 Create Vendor Table ©Tim Riley The table is created. Any error messages would have appeared in the bottom frame.

35 Populate Vendor Table ©Tim Riley Switch to the supervisor role.

36 Populate Vendor Table ©Tim Riley Choose the menu item of insert vendor.

37 Populate Vendor Table ©Tim Riley Optionally, we could enter in each vendor one at a time by pressing each time. Remember when we set the insert rows number to 5? This asterisk means vendor is the primary key. Press without entering in a vendor name.

38 Populate Vendor Table ©Tim Riley By leaving any primary key attribute blank on the top frame, you get rows in the bottom frame to insert new data. Enter in all the new rows, then press in the bottom frame once. If we need to add more than 5 vendors in the bottom frame, then press again in the top frame to get 5 more empty rows.

39 Populate Vendor Table ©Tim Riley Type in some vendor names. Then press.

40 Populate Vendor Table ©Tim Riley The insert succeeded.

41 Lookup Vendor Table ©Tim Riley Choose the menu item lookup vendor. The table was empty prior to our insert. However, this count won't get updated until the top frame get repainted.

42 Lookup Vendor Table ©Tim Riley This is the prompt form. Remember when we chose this form over the table form when we inserted this folder? Each attribute will have some mechanism to query subsets.

43 Lookup Vendor Table ©Tim Riley Lookup all vendors that begin with a. Then press.

44 Lookup Vendor Table ©Tim Riley All rows matching the lookup query in the top frame are displayed in the bottom frame. Remember, we inserted the Delete operation to the supervisor role into the role operation folder for the vendor folder?

45 Create Purchase Order Table ©Tim Riley From Purchase_ Order purchase_datedate* purchase_timetime 4* vendorchar 30* Vendor vendorchar 30* Insert the purchase order attributes.

46 Insert Purchase Order Attributes ©Tim Riley Choose the insert attribute menu item.

47 Insert Purchase Order Attributes ©Tim Riley The attribute datatype is current date. The only difference between datatypes of date and current date is current date will prepopulate the field with the current date. The attribute name is purchase_date. The attribute width is 10 characters. The standard format for date is yyyy-mm-dd. However, users can change the way dates are displayed to the American format – mm/dd/yyyy.

48 Insert Purchase Order Attributes ©Tim Riley Leave everything else blank, and scroll down to the bottom of the top frame. Press the button in the top frame.

49 Insert Purchase Order Attributes ©Tim Riley The bottom frame shows the results. Press the button in the top frame. This will clear the form so we can insert the purchase time attribute. Press the button so we don't have to use the scroll bar to get to the top.

50 Insert Purchase Order Attributes ©Tim Riley The attribute name is purchase_time. The attribute datatype is current time. The only difference between datatypes of time and current time is current time will prepopulate the field with the current time. The attribute width is 4 characters. The standard format for time is HH24, which is down to the minute. However, you can have times down to the second by making the width 7. Then the format is HH24:SS. For example 1310:15 is 1:10 PM and 15 seconds.

51 Insert Purchase Order Attributes ©Tim Riley The bottom frame shows the results. Leave everything else blank, and scroll down to the bottom of the top frame. Press the button in the top frame.

52 Create Purchase Order Table ©Tim Riley From Purchase_ Order purchase_datedate* purchase_timetime 4* vendorchar 30* Vendor vendorchar 30* Insert the purchase order folder.

53 ©Tim Riley Insert Purchase Order Folder Choose the insert folder menu item.

54 Insert Purchase Order Folder ©Tim Riley The folder name is purchase_order. The form type is Prompt. The number of rows to insert is 1. We will generate a one-to-many data entry screen. The top frame will be to insert the one purchase order. The bottom frame will be to insert many rows in each related folder: 1) Purchase Inventory 2) Purchase Plant Equipment 3) Purchase Supply 4) Purchase Service The behavior will be just like inserting folders. The top frame inserts the folder. Then the bottom frame inserts many rows in each related folder: 1) Attribute 2) Relation 3) Role Folder 4) Role Operation

55 Insert Purchase Order Folder ©Tim Riley Scroll to the bottom of the top frame. Press the button.

56 Insert Purchase Order Folder Attributes ©Tim Riley Insert the purchase order's 3 primary key attributes. Press in the bottom frame.

57 Insert Purchase Order Relation ©Tim Riley Purchase order has a many-to-one relation to vendor. Choose Null for the related attribute. The related attribute is part of the relation table's primary key. So it must be populated with something. The Null string provides this placeholder. Press in the bottom frame.

58 Insert Purchase Order Permissions ©Tim Riley Give both insert and update permissions to supervisors and users. Press in the bottom frame.

59 Insert Purchase Order Operations ©Tim Riley The delete operation places a trash can next to each row following a query. The detail operation places a magnifying glass next to each row following a query. By checking the magnifying glass, the bottom screen will then display for this purchase order the related folders: 1) Purchase Inventory 2) Purchase Plant Equipment 3) Purchase Supply 4) Purchase Service Press in the bottom frame.

60 Insert Purchase Order Complete ©Tim Riley We have just inserted rows into the following tables: 1) folder 2) relation 3) folder_attribute 4) role_folder 5) role_operation The next step is to create the purchase order table in the RDBMS.

61 Create Purchase Order Table ©Tim Riley

62 Create Purchase Order Table ©Tim Riley

63 Purchase Order Design ©Tim Riley Purchase_Order Vendor Inventory Purchase_ Inventory The rest of the tutorial will create these 2 tables with only minimum callouts. We created these 2 tables. Each screen title will provide you with a guide.

64 Insert Purchase Inventory Attributes ©Tim Riley

65 Insert Purchase Inventory Attributes ©Tim Riley

66 Insert Purchase Inventory Attributes ©Tim Riley

67 Insert Purchase Inventory Attributes ©Tim Riley

68 Insert Purchase Inventory Attributes ©Tim Riley

69 Insert Inventory Folder ©Tim Riley

70 Insert Inventory Folder ©Tim Riley Now we're going to insert the inventory folder.

71 Insert Inventory Folder Attribute ©Tim Riley

72 Insert Inventory Relation ©Tim Riley The inventory folder doesn't have any many-to-one relationships.

73 Insert Inventory Permissions ©Tim Riley

74 Insert Inventory Operations ©Tim Riley

75 Insert Purchase Inventory Folder ©Tim Riley Now we're going to insert the purchase inventory folder.

76 Insert Purchase Inventory Attributes ©Tim Riley

77 Insert Purchase Inventory Relations ©Tim Riley Pair 1tom order is the feature that automatically displays each many related table in sequence when inserting into the one table.

78 Insert Purchase Inventory Permissions ©Tim Riley

79 Insert Purchase Inventory Operations ©Tim Riley

80 Insert Purchase Inventory Completed ©Tim Riley

81 Create Inventory Table ©Tim Riley

82 Create Purchase Inventory Table ©Tim Riley

83 Insert Inventory Item ©Tim Riley The two new tables are created. Now populate them.

84 Insert Inventory Item ©Tim Riley

85 Insert Inventory Item ©Tim Riley

86 Insert Purchase Order ©Tim Riley

87 Insert Purchase Order ©Tim Riley

88 Insert Purchase Order Inventory ©Tim Riley

89 Insert Purchase Order Completed ©Tim Riley

90 Lookup Purchase Order ©Tim Riley The insert screen has a lookup feature. Let's lookup the purchase order we just inserted.

91 Lookup Purchase Order ©Tim Riley

92 Purchase Order Detail ©Tim Riley The detail operation allows you to view all of the rows in each one-to-many related table. Currently, we've only created the purchase inventory table. If you were to delete this purchase order, then all of the rows in the one-to-many related tables would be deleted also. This is necessary to enforce the relational integrity constraint.

93 Purchase Order Detail ©Tim Riley

94 Insert Purchase Order Inventory ©Tim Riley You can insert new inventory purchases for this purchase order here.

95 Insert Purchase Order Inventory ©Tim Riley You can insert new inventory purchases for this purchase order here. However, we only inserted one inventory item – widget. Inserting another widget for this purchase order would be rejected because it would violate the element uniqueness integrity constraint.

96 Purchase Order Design ©Tim Riley Purchase_Order Vendor InventoryPlant EquipmentSupplyService Purchase_ Inventory Purchase_ Plant Equipment Purchase_ Supply Purchase_ Service We created these 4 tables. The other purchase tables plus the receive and payment tables still need to be created.


Download ppt "Create Purchase Order Application Using Appaserver ©Tim Riley 1. Create the purchase order database design. 2. Create the purchase order database tables."

Similar presentations


Ads by Google