DATA BASE DESIGN FOR RESOURCE MANAGEMENT -- A CASE STUDY
3.2 Development of algorithm
In any database system, the tasks are commonly
Enter new data, Update records Edit records, Delete records, Generate reports, Utility operations.
ED.tLY Q.t.D.e.~ data
Each entity and the corresponding relational files (if it has its own attribute) are involved in new data entry by the user.
specific case are:
The data entry points in this
a) When new customer order received by resource management department.
b) When production order to place to production department.
c) When procurement order placed to supplier by procurement department.
d) When materials are to be reserved for some future production.
e) When new stock enters into store.
Besides, there are few more cases of new data entry causes occasionally. They are:
f) When new type of material to store.
g) New part list of new product.
h) New production plan of new product, etc.
The common feature of new data entry for all those cases are:
- User-friendly data entry screen to be formed.
After data entry the validity of the data in all respect is to be checked.
- Simultaneous entry of data into all relevant database files to ensure no data inconsistency.
- Old data cannot be retrieve to edit, update or delete with the aid of entry program.
One typical case out of all data entry functions is entry of production order into database. The flow chart of this task and the description of it are given below. Flow chart for all other entry operations are given in Appendix-A.
a) Fig.-20 show the flow-diagram of new entry of production order. It starts with entry of customer order Number. If user enters no data, program will be terminated. Otherwise the entered order number is checked whether this order number exists is database or not. If not exists, it means an error. The program then gives error message and loop for connection of newly entered order number.
User must enter an order number which actually exists to continue. He can exit by entering nothing (i.e., blank).
b) when it is found that entered Order number e><ists in database, program I.il.l ask for part number of the product which is to be taken under production. If user enter no data, program will ask whether user intended to leave the program or continue. If user type exit option, program will be .terminated and if user wishes to continue, it ~,d11 appear again the screen to ente!' part number of the product. ,Ihen part number is entered, the validity of this part number is checked in matedal file., If part number does not exist, program will give error message and user gets opportunity to correct it. If the part number is found valid, one more validity check remains i.e., it is to be checked whether this item is ordered under the ordered number entered before. The entered order numbel' and part number are checked into the new item file. If not found, the program will give error message and user will get back the entered part number for correction.
c) If it is found that the product belongs to that order number. Then program will do some thing for next operation - I.e. it will count into new item database file how much quantity of this item are ordered under the same order.
Then user will be asked to enter the quantity of item how much to be produced.
If entered quantity is less or equal to zero, program will generate error message and will ask user whether he intends to exit or not. If user type exit option, program .Iill be terminated and if user wishes to continue he will get back quantity entry screen to enter again.
d) When the entered quantity is greater than zero, it will be compared with the total quantity ordered by the customer under that order number. If the quantity entered is greater than the quantity ordered by the customer, error
message will be generated and user will get screen to correct the quantity.
e) When quantity is valid, Program will seek for its part list file. If part list file is not found, program will be terminated. And when it is found, program will keep ready an empty temporary file to take the items which are to be "called out" from store to produce this item.
Then program will ask to enter target date within which production department should finish the production.
f) After entry if target date, the program starts its operation to "callout"
the materials from store. The logic of "calling out" the material for a product is as follows:
a Part Number (with which the product consists of) from part list is taken,
multiply the quantity (required to produce one item) written in part list and the quantity of the item to be produced. Thus the total required quantity of this part is found out.
check the reserve file and count the quantity of this part reserved, i) for this product and this order,
ii) for not this product and this order,
if there is any reserve for this product and order, deduct the required quantity (completely or partially) from reserved quantity.
If the quantity of any record of reservation reduced to zero, delete the record.
the present stock of this part is found out from material file and the free stock is calculated by subtracting the quantity reserved for other orders from the stock quantity,
subtract required quantity (completely or partially if free stock in less than required quantity)
if total required quantity is not available, the rest quantity which is shortage is recorded in bond file along with the part number, the product and the order number.
the part number is entered in the temporary file along with all details - last stock in store, present stock, required quantity, delivered quantity, bonded quantity etc.
the above process will be done for all the parts of the part list,
g) This production order is included into production database.
h) This record is also to be included into production status file with status
= "Order Placed."
i) Print the temporary file with the part number of the product and the customer order.
j) Call the same program again if any more production order to be placed.
Otherwise the program will be terminated.