Marketing

Thesis Paper on Products Purchase and Sales Information of a Computer Firm

Thesis Paper on Products Purchase and Sales Information of a Computer Firm

Problem Definition:

Issue of stores is the most important duty of the storekeeper which involves comparatively greater responsibility on his part.

In the manual system

1.    It takes time to find whether a specific item is available in the store or not.  Firstly the books maintained are searched and then the record for the particular item is searched in the book.

2.    Because manual system takes much time in finding whether a particular item exists in the store or not, this affects the continuous functioning if other management concerned. For example, when production department asks the stores department to deliver a list of items in the production department in to carry out manufacturing activity and if items demanded are not found in the stores then the activity of procurement of the items starts. Till the items are made available in the stores from suppliers, the manufacturing activity gets discontinued.

Manual system takes considerably much time in procuring as well as issuing items/raw material, thus affecting the production function .This leads in irregular flow of materials. The maintenance of the continuity of production is one of the mot important responsibilities of the stores department.

3.    Store in Charge may forget to post any transactions in the stock register and this might give incorrect information regarding the current status of the stock.

4.    At the particular time, management does not know how much quantity is present in the store for various items.

5.    Tracking of a transaction is very difficult for store clerk. He takes a lot of time in searching for that transaction.

6.     Time taken in preparation of various reports is considerable.

Existing System:

In the IT competition market different  kinds of database software  are available, which make easy of the practical life and in the work places.

Some of the necessary software are:

● Payroll system software.

● Bank Management system.

● Library Management system.

● Student Management system.

1.3 Proposed System:

The proposed software provides the store and distribution information for different types of products, which is easy to manage and secure to handle. Again, this software system supports the information processing for the computer firm. This software system contents the following facilities:

● Product and Category section.

● Sales section.

● Purchase section.

● Customer support section.

● Company support section.

2.1 Company Profile:

ORGANISATION DETAILS 

Address :         GREEN VALLEY SYSTEMS

A  COMPLETE  IT  SOLUTIONS  FIRM

                                  120/31,Gafur Mansion(1st  Floor)

New Elephant Road(Near Bata Signal)

Dhaka-1205.

E-mail:greenvalley@yahoo.com.

Mob:0172-024079,0188-218182.

   GREEN  VALLEY  SYSTEMS based company started with the alliance of working technocrats. The need was seen to cater to the growing market, with quality service where the customer could be promised a long-term association.

They have planned their services to cater to just this need. Their customers spread over the city, including major corporate companies as well as individual professional single users. They have developed a reputation of consistent service, timely consultancy for upgrading or expansions, maintenance on terms that suite customers requirements and complete faith in their service.

Their strong point has always been service, as a dedicated team, they can offer component level repairs and service to any kind of printer and computer.

They take this opportunity to invite customers enquiries and would like to offer to the customers their versatile services

Scope of the System:

The scope of inventory control may be as given below:

1.                 It determines the different of inventories including that of economic order quantity.

2.                 It determines the stock out.

3.                 It determines the safety stock.

4.                 It determines the lead time.

5.                 It determines the process for smooth and efficient running of the storehouse.

6.                 It works for minimizing the handling and storing cost as well as the idle time of the men and the machine.

7.                 It works to achieve the objective of conservation of working capital to a greater extant and to help in reducing the inventory carrying cost.

            Inventory control refers to a planed method of purchasing and storing the materials at the lowest possible cost without affecting the distribution schedule. Inventory Control, therefore, is a scientific method of determining what, when and how much to purchase and how much to have in stock for given period of time.

Need of the System:

Inventory control system is a very popular package used in various fields of commercial and technical center. It is accustomed to reduce a very large handwork and inconsistent jobs for the employees of the company. It provides a quick and convenient service to the customers, also customer can have a proper interaction with products. This package serves as the following way:

1.      Information about system: It carries out proper lead-time, maximum stock, minimum stock and reorder level. So, this system is needed to take a quick action considering all such situation.

2.      Store management: This system takes care of efficient storing management to control out the stock. It can minimize the over full stock and also can maximize under stock by taking initiative step.

3.      Customer service: It provides a quick and convenient service to the customers. Customer can have a proper interaction with products.

4.      Service efficiency: It drastically reduces various unnecessary jobs to implement business operation. Such that it over views all types of right calculations, quick decisions to the employee. So, it is much useful system in commercial field.

5.      Time saving & faster processing: It is much less time consuming to maintain all the records of the products and update them. So, it also takes care to process all the jobs such as purchase, sales and stock faster.

6.      Searching: It provides a quick search to find any records of customers, suppliers, products etc. so that the business processing becomes very easy and relevant to employees as well as customers.

 Fact finding Methods:

 

For the successful development of any project, a detailed study of the various requirements of the project is needed, Which is referred to as ‘system analysis’.

We have adopted a rigorous approach for fact finding to help us gather correct information. First of all, we carried out a thorough surveillance of existing system to obtain various details of inventory like sales order and purchase order, customer details, supplier details, item information.

We observed their activities to understand the practical sequence of tasks adopted by the company. The employees of the company were enthusiastic in passing valuable information, which helped us a lot while making this project.

 Feasibility Study:

Technical Feasibility:

Technically the system is possible to develop with the available hardware and software. The proposed system will be developed with available software application development tools viz.: Oracle 8, developer6.0. Moreover, it can run in any windows based operating system without any additional software.

Operational Feasibility:

The proposed system is not trying to develop new methods but it is following the same existing conventions and general rules which guides several processes and it is just the automation of the current partially computerized system for better efficiency and accuracy. Therefore, it is expected that the user will not feel alien to the new system. Operationally, the system shall be feasible to implement, as it is based on Graphical User Interface (GUI) and thus it is easy to learn.

Economical Feasibility:

Economically, the system is feasible because the company already has the hardware and software requirements, so the initial investment is not required. In addition, the system will have time to increase the speed of work and documentation.

Requirements:

(i) Hardware Requirements:

Windows 98/2000 used while developing the system. Any other normal PC having operating system like Windows 95/98/2000/ ME/XP can use the system properly.

Specification:

●       CPU                      : Pentium III, 40 GHz.

●       Memory                : 128 MB RAM.

●       Disk capacity        : 640 MB.

●       Printer                   : Canon.

(ii) Software Requirements:

● Operating system

Server Side                                    : Windows NT 4.0/Windows 2000

Normal PC Side                           :           Windows 98/Me/XP

●   Database management system    :           Oracle 8.

●   Front-end used                             :          Developer 6.0

●    Reporting                                     :          MS word 2000

 Analysis:

(i) Context Level Diagram

(ii) Data Flow Diagram

(iii) Entity Relationship Diagram

(iv) Functional Decomposition Diagram

(i) Context Level Diagram:

Process Description:

Process 1.0: Sales processing.

Description: Take order details from the customer and
produce a report for sales.
Input: Sales details, Customer record.
Output: Report for the order for sales.

Process 2.0: Purchase processing.

Description: Give purchase order details to the supplier and
issue a purchase report.
Input: Supplier records, Stock, Purchase order.
Output: Order for purchase report to supplier.

Process 3.0: Category & Product processing.

Description: Take orders for sales of the products. Each products have
its own Category.
Input: Product record, stock information.
Output: Current stock along with updating of inventory.

Process 4.0: Shrinkage processing.

Description: Give all shrinkage details of the products.
Input: Shrinkage details.
Output: Shrinkage report.

 Data Requirements:

The initial specification of user requirements is based on interviews with the database users and on our own analysis of the package. The following list itemizes the major requirements for the Inventory Control package.

1. To maintain the Inventory control any company can purchase and sales various products which is grouped in various category.

2. The company can purchases various products from various suppliers. The company can keep records for all the purchase orders and suppliers.

3. The companies can sale various products to various customers. The company can also keeps records for all the sales order as well as customers.

4. The company needs to know that a particular supplier supplies which product or which supplier supplies products.

5. The companies can keeps records if there is any shrinkage of any product in what condition.

CONTEXT LEVEL

 Data Dictionary:

(!)Data Elements:

Data Elements Product Code
Description Unique Number For Particular Product
Type Number
Alias Product_ID
Width 5

Data Elements Category Code
Description Unique Number For Particular Category of Product
Type Number
Alias Category_ID
Width 5

Data Elements Shrinkage Code
Description Unique Number For Particular Shrinkage of Product
Type Number
Alias Shrinkage_ID
Width 5

Data Elements Purchase Code
Description Unique Number For Particular Purchase of Product
Type Number
Alias Purchase_ID
Width 5

Data Elements Customer Code
Description Unique Number For Particular Customer
Type Number
Alias Customer_ID
Width 5

Data Elements Supplier Code
Description Unique Number For Particular Supplier
Type Number
Alias Supplier_ID
Width 5

Data Elements Sales Code
Description Unique Number For Particular Sales of Product
Type Number
Alias Sales_ID
Width 5

(!!)Data Stores:

Data Store Name Product
Description Store Details of Product
Type Record
Contents Product_ID, Product Name, Category Name, Description, lead-time, Unit Price, Units on hand

Data Store Name Category
Description Store Details of Product Categories
Type Record
Contents Category_ID, Category Name.

Data Store Name Company
Description Store Detail information of the licensee company
Type Record
Contents Company_ID, Company name, Address, Country, State, City, Phone no, Fax no, Pin code,Description

Data Store Name Shrinkage
Description Store Details of Shrinkage Products
Type Record
Contents Shrinkage_ID, Date, Description, Unit Shrinkage.

Data Store Name Purchase
Description Store Details of Product’s Purchase
Type Record
Contents Purchase_ID, Product_ID, Product_Name, Description, Order_ID, Order Date, Receive Date, Promise date.

Data Store Name Pur_detail
Description Store Details of Product’s Purchase
Type Record
Contents Purchase_ID, Product_ID, Product_Name, Description, Qty,Amount

Data Store Name Customer
Description Store Details of Customer
Type Record
Contents Customer_ID, Customer Name, Description, Address, City, Pincode, State, Country, Phone Number, Fax Number.
Data Store Name Supplier
Description Store Details of Supplier
Type Record
Contents Supplier_ID, Supplier Name, Description, Address, City, Pincode, State, Country, Phone Number, Fax Number.

Data Store Name Order For sale
Description Store Details of Sales Order
Type Record
Contents Order_ID, Product_ID, Product_Name, Order_Date, Unit Ordered.

Data Store Name Order For Purchase
Description Store Details of Purchase Order
Type Record
Contents Order_ID, Product_ID, Product_Name, Order_Date, Unit Ordered.

Data Store Name Sales
Description Store Details of Product’s sales
Type Record
Contents Sales_ID, Product_ID, Product_Name, Description, Order_ID, Order Date, Delivery Date, Promise date.

Data Store Name Sls_detail
Description Store Details of Product’s sales
Type Record

Contents SALES_ID, Product_ID, Product_Name, Description, QTY, UNIT,AMOUNT.

(iii) Data Structures:

Data Structure Name Product
Contents Product_ID, Product Name, Description, lead-time, Unit_Price, Units on hand, , Category_Name.

Data Structure Name Category
Contents Category_ID, Category Name.

Data Structure Name Company
Contents Company_ID, Company name, Address, Country, State, City, Phone no, Fax no, Pin code, Description
Data Structure Name Shrinkage
Contents Shrinkage_ID, Date, Description, Unit Shrinkage, Product_Name,Unit_price.

Data Structure Name Purchase
Contents Purchase_ID, Product_ID, Product_Name,Description, Order Date, Receive Date, Promise date, Supplier_ID, Supplier_Name.

Data Structure Name Customer
Contents Customer_ID, Customer Name, Description, Address, City, Country, Phone Number, Fax Number.

Data Structure Name Supplier
Contents Supplier_ID, Supplier Name, Description, Address, City, Country, Phone Number, Fax Number.

Data Structure Name Shrinkage
Contents Shrinkage_ID, Product_id,Product_name, Description, Unitshrinkage,Productprice,Shrinkagedate.

Data Structure Name Order For sale
Contents Order_ID, Product_ID, Product_Name, Order_Date, Unit Ordered.

Data Structure Name Order For Purchase
Contents Order_ID, Product_ID, Product_Name, Order_Date, Unit Ordered.

Data Structure Name Pur_detail
Contents Purchase_ID, Product_ID, Product_Name, Description,, Qty, Amount.

Data Structure Name Sales
Contents Sales_ID, Product_ID, Product_Name, Description, Order_ID, Order Date, Delivery Date, Promise date.

Data Structure Name Sls_detail
Contents Sales_ID, Product_ID, Product_Name, Description, Qty, Unit,Amount.

INPUT OUTPUT SCREENS:

Main Form (frmMain.fmb)

Manual Instruction of Main Form:
► At first give the Username & Password and click on OK.
► Main Form will be Opened.
► It has six Menu items.
► File Menu, Order Menu, Update Menu, Information Menu, Report
Menu and Help Menu.

CONTEXT LEVEL

Category Form (frmCategory.fmb):

Manual Instruction of Category Information:

To Update Category Information:
► Open Category Information form.
► Click Update Button.
► Enter new record and then click on Save.

To Query Category Information:
► Open Category Information Form.
► Click Query Button.
► Then all records will be shown in the form.

To Save Category Information:
► Open Category Information Form.
► Click Add Button.
► Insert Data in the text.
► Then click on the Save Button.

To Delete Category Information:
► Open Category Information Form.
► Click Delete.
► Msg Box: ‘Are you sure to delete this record’ click ‘Yes’

To Close the Category Form:
► Open Category Information Form.
► Click Close.
► Msg Box: ‘Do you want to close’ click ’Yes’.

Another Buttons:
► The First, Last, Previous and Next Buttons are used to navigate the
records which is wanted to show.

Product Form (frmProduct.fmb):

Manual Instruction of Product Information:

To Update Product Information:
► Open Product Information form.
► Click Update Button.
► Enter new record and then click Save.

To Query Product Information:
► Open Product Information Form.
► Click Query Button.
► Then all records will be shown in the form.

To Save Product Information:
► Open Product Information Form.
► Click Add Button.
► Insert Data in the text.
► Then click on the Save Button.

To Delete Product Information:
► Open Product Information Form.
►Click Delete.
►Msg Box: ‘Are you sure to delete this record’ click ”Yes”

To Close the Product Form:
► Open Product Information Form.
►Click Close.
►Msg Box: ‘Do you want to close’ click ”Yes”.

Another Buttons:
► The First, Last, Previous and Next Buttons are used to navigate the
records which is wanted to show.

To Show the List of all Category Names:

List of Values (LOV):
► When the cursor reach the Category Name text box, then type a Category
Name.
► Press TAB Button, then the list of all Category Name will be shown.
► Press ENTER, if the name is not matched then the Name will be clear.
► And if matched, then the cursor will go to the next text field.

Supplier Form (frmSupplier.fmb):

Manual Instruction of Supplier Information:

To Update Supplier Information:
► Open Supplier Information form.
► Click Update Button.
► Enter new record and then click Save.

To Query Supplier Information:
► Open Supplier Information Form.
► Click Query Button.
► Then all records will be shown in the form.

To Save Supplier Information:
► Open Supplier Information Form.
► Click Add Button.
► Insert Data in the text.
► Then click on the Save Button.

To Delete Supplier Information:
► Open Supplier Information Form.
►Click Delete.
►Msg Box: ‘Are you sure to delete this record’ click ”Yes”

To Close the Supplier Form:
► Open Supplier Information Form.
►Click Close.
►Msg Box: ‘Do you want to close’ click ”Yes”.

Another Buttons:
► The First, Last, Previous and Next Buttons are used to navigate the
records which is wanted to show.

Customer Form (frmCustomer.fmb):

Manual Instruction of Customer Information:

To Update Customer Information:
► Open Customer Information form.
► Click Update Button.
► Enter new record and then click Save.

To Query Customer Information:
► Open Customer Information Form.
► Click Query Button.
► Then all records will be shown in the form.

To Save Customer Information:
► Open Customer Information Form.
► Click Add Button.
► Insert Data in the text.
► Then click on the Save Button.

To Delete Customer Information:
► Open Customer Information Form.
►Click Delete.
►Msg Box: ‘Are you sure to delete this record’ click ”Yes”

To Close the Customer Form:
► Open Customer Information Form.
►Click Close.
►Msg Box: ‘Do you want to close’ click ”Yes”.

Another Buttons:
► The First, Last, Previous and Next Buttons are used to navigate the
records which is wanted to show.

Company Form (frmCompany.fmb):

Manual Instruction of Company Information:

To Update Company Information:
► Open Company Information form.
► Click Update Button.
► Enter new record and then click Save.

To Query Company Information:
► Open Company Information Form.
► Click Query Button.
► Then all records will be shown in the form.

To Save Company Information:
► Open Company Information Form.
► Click Add Button.
► Insert Data in the text.
► Then click on the Save Button.

To Delete Company Information:
► Open Company Information Form.
►Click Delete.
►Msg Box: ‘Are you sure to delete this record’ click ”Yes”

To Close the Company Form:
► Open Company Information Form.
►Click Close.
►Msg Box: ‘Do you want to close’ click ”Yes”.

Another Buttons:
► The First, Last, Previous and Next Buttons are used to navigate the
records which is wanted to show.

Employee Form (frmEmployee.fmb):

Manual Instruction of Employee Information:

To Update Employee Information:
► Open Employee Information form.
► Click Update Button.
► Enter new record and then click Save.

To Query Employee Information:
► Open Employee Information Form.
► Click Query Button.
► Then all records will be shown in the form.

To Save Employee Information:
► Open Employee Information Form.
► Click Add Button.
► Insert Data in the text.
► Then click on the Save Button.

To Delete Employee Information:
► Open Employee Information Form.
►Click Delete.
►Msg Box: ‘Are you sure to delete this record’ click ”Yes”

To Close the Employee Form:
► Open Employee Information Form.
►Click Close.
►Msg Box: ‘Do you want to close’ click ”Yes”.

Another Buttons:
► The First, Last, Previous and Next Buttons are used to navigate the
records which is wanted to show.

Purchase Order Form (frmOrderPurchase.fmb):

Manual Instruction of Purchase Order Information:

To Update Purchase Order Information:
► Open the Purchase Order Information form.
► Click Update Button.
► Enter new record and then click Save.
To Query Purchase Order Information:
► Open Purchase Order Information Form.
► Click Query Button.
► Then all records will be shown in the form.

To Save Purchase Order Information:
► Open Purchase Order Information Form.
► Click Add Button.
► Insert Data in the text.
► Then click on the Save Button.

To Delete Purchase Order Information:
► Open Purchase Order Information Form.
►Click Delete.
►Msg Box: ‘Are you sure to delete this record’ click ”Yes”

To Close the Purchase Order Form:
► Open Purchase Order Information Form.
►Click Close.
►Msg Box: ‘Do you want to close’ click ”Yes”.

Another Buttons:
► The First, Last, Previous and Next Buttons are used to navigate the
records which is wanted to show.

Note:
In this Purchase Order Information form we use a list item for the products. All the product numbers are included in the list. When we click the specific product numbers from the list, then the corresponding product information will be shown in the form.

Purchase Form (frmPurchase.fmb):

Manual Instruction of Purchase Information:

To Update Purchase Information:
► Open the Purchase Information form.
► Click Update Button.
► Enter new record and then click Save.
To Query Purchase Information:
► Open Purchase Information Form.
► Click Query Button.
► Then all records will be shown in the form.

To Save Purchase Information:
► Open Purchase Information Form.
► Click Add Button.
► Insert Data in the text.
► Then click on the Save Button.

To Delete Purchase Information:
► Open Purchase Information Form.
►Click Delete.
►Msg Box: ‘Are you sure to delete this record’ click ”Yes”

To Close the Purchase Form:
► Open Purchase Information Form.
►Click Close.
►Msg Box: ‘Do you want to close’ click ”Yes”.

Another Buttons:
► The First, Last, Previous and Next Buttons are used to navigate the
records which is wanted to show.

Note: In this Purchase Information form we use three list items for the Customers, Products and for Orders. All the Customers, products and Order numbers are included in the lists. When we click the specific numbers from the list, then the corresponding information will be shown in the form.

Sales Order Form (frmOrderSales.fmb):

Manual Instruction of Sales Order Information:

To Update Sales Order Information:
► Open the Sales Order Information form.
► Click Update Button.
► Enter new record and then click Save.

To Query Sales Order Information:
► Open Sales Order Information Form.
► Click Query Button.
► Then all records will be shown in the form.

To Save Sales Order Information:
► Open Sales Order Information Form.
► Click Add Button.
► Insert Data in the text.
► Then click on the Save Button.

To Delete Sales Order Information:
► Open Sales Order Information Form.
►Click Delete.
►Msg Box: ‘Are you sure to delete this record’ click ”Yes”

To Close the Sales Order Form:
► Open Sales Order Information Form.
►Click Close.
►Msg Box: ‘Do you want to close’ click ”Yes”.

Another Buttons:
► The First, Last, Previous and Next Buttons are used to navigate the
records which is wanted to show.

Note: In this Sales Order Information form we use a list item for the products.
All the product numbers are included in the list. When we click the specific product numbers from the list, then the corresponding product information will be shown in the form.

Sales Form (frmSales.fmb):

Manual Instruction of Sales Information:

To Update Sales Information:
► Open the Sales Information form.
► Click Update Button.
► Enter new record and then click Save.

To Query Sales Information:
► Open Sales Information Form.
► Click Query Button.
► Then all records will be shown in the form.

To Save Sales Information:
► Open Sales Information Form.
► Click Add Button.
► Insert Data in the text.
► Then click on the Save Button.

To Delete Sales Information:
► Open Sales Information Form.
►Click Delete.
►Msg Box: ‘Are you sure to delete this record’ click ”Yes”

To Close the Sales Form:
► Open Sales Information Form.
►Click Close.
►Msg Box: ‘Do you want to close’ click ”Yes”.

Another Buttons:
► The First, Last, Previous and Next Buttons are used to navigate the
records which is wanted to show.

Note: In this Sales Information form we use three list items for the Suppliers, products and for Orders. All the Suppliers, product and Order numbers are included in the list. When we click the specific number from the list, then the corresponding information will be shown in the form.

Shrinkage Form (frmShrinkage.fmb):

Manual Instruction of Shrinkage Information:

To Update Shrinkage Information:
► Open Shrinkage Information form.
► Click Update Button.
► Enter new record and then click Save.

To Query Shrinkage Information:
► Open Shrinkage Information Form.
► Click Query Button.
► Then all records will be shown in the form.

To Save Shrinkage Information:
► Open Shrinkage Information Form.
► Click Add Button.
► Insert Data in the text.
► Then click on the Save Button.

To Delete Shrinkage Information:
► Open Shrinkage Information Form.
►Click Delete.
►Msg Box: ‘Are you sure to delete this record’ click ”Yes”

To Close the Shrinkage Form:
► Open Shrinkage Information Form.
►Click Close.
►Msg Box: ‘Do you want to close’ click ”Yes”.

Another Buttons:
► The First, Last, Previous and Next Buttons are used to navigate the
records which is wanted to show.

To Show the List of all Product Names:

List of Values (LOV):
► When the cursor reach the Product Name text box, then type a Product
Name.
► Press TAB Button, then the list of all Product Name will be shown.
► Press ENTER, if the name is not matched then the Name will be clear.
► And if matched, then the cursor will go to the next text field.

Entity Relationship Diagram

 OUTPUT REPORTS:

Category Report:

Product Report:

Supplier Report:

Shrinkage Reports:

Customer Reports:

Company Reports:

Employee Reports:

SALES REPORT:

PURCHASE REPORT:

Code of the Procedure for all Forms

Procedure Name: SCROLL_CONTROL
Item Type: Program unit
Code:

PROCEDURE scroll_control IS
BEGIN
if :system.last_record = ‘TRUE’ and :system.cursor_record = ‘1’ then
set_item_property(‘button_palette.pb_first’, enabled, property_off);
set_item_property(‘button_palette.pb_prev’, enabled, property_off);
set_item_property(‘button_palette.pb_next’, enabled, property_off);
set_item_property(‘button_palette.pb_last’, enabled, property_off);

elsif :system.last_record = ‘TRUE’ then
set_item_property(‘button_palette.pb_first’, enabled, property_on);
set_item_property(‘button_palette.pb_prev’, enabled, property_on);
set_item_property(‘button_palette.pb_next’, enabled, property_off);
set_item_property(‘button_palette.pb_last’, enabled, property_off);

elsif :system.cursor_record = ‘1’ then
set_item_property(‘button_palette.pb_first’, enabled, property_off);
set_item_property(‘button_palette.pb_prev’, enabled, property_off);
set_item_property(‘button_palette.pb_next’, enabled, property_on);
set_item_property(‘button_palette.pb_last’, enabled, property_on);

else
set_item_property(‘button_palette.pb_first’, enabled, property_on);
set_item_property(‘button_palette.pb_prev’, enabled, property_on);
set_item_property(‘button_palette.pb_next’, enabled, property_on);
set_item_property(‘button_palette.pb_last’, enabled, property_on);

end if;

END;

Procedure Name: ITEM_ENABLE_DISABLE
Item Type: Program unit
Sample Code for a Form:

PROCEDURE item_enable_disable (item_on_off IN NUMBER) IS
BEGIN
set_item_property(‘Purchase.purchase_ID’, updateable, item_on_off);
set_item_property(‘Purchase.product_ID’, updateable, item_on_off);
set_item_property(‘Purchase.product_Name’, updateable, item_on_off);
set_item_property(‘Purchase.supplier_ID’, updateable, item_on_off);
set_item_property(‘Purchase.supplier_Name’, updateable, item_on_off);
set_item_property(‘Purchase.description’, updateable, item_on_off);
set_item_property(‘Purchase.quantity’, updateable, item_on_off);
set_item_property(‘Purchase.unitprice’, updateable, item_on_off);
set_item_property(‘Purchase.receivedate’, updateable, item_on_off);
set_item_property(‘Purchase.order_ID’, updateable, item_on_off);
set_item_property(‘Purchase.requiredate’, updateable, item_on_off);
set_item_property(‘Purchase.promisedate’, updateable, item_on_off);
–set_item_property(‘Purchase.totalamount’, updateable, item_on_off);
END;

Item Type: Form item
Trigger Name: WHEN-NEW-RECORD-INSTANCE
Code:
begin
scroll_control;
end

Item Type: Block Item
Trigger Name: WHEN-VALIDATE-ITEM
Sample Code for a Form:

declare
buff char(1);
alert1 number;
begin
select ‘x’ into buff from Catagory
where catagory_ID =:Catagory.catagory_ID;
raise too_many_rows;
exception
when no_data_found then
null;
when too_many_rows then
set_alert_property(‘Dup_alert’, title, ‘Duplicate Record’);
set_alert_property(‘Dup_alert’, alert_message_text,
‘Duplicate Catagory Number.’);
alert1 := show_alert(‘Dup_alert’);
if alert1 = alert_button1 then
clear_record;
end if;
–message(‘Duplicate Catagory Number’);
raise form_trigger_failure;
end;

Code of the Category Form (frmCatagory.fmb)

Button Name: Update
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘Catagory’);
item_enable_disable(property_on);
set_item_property(‘Catagory.catagory_ID’, updateable, property_off);
set_item_property(‘button_palette.pb_update’, visible, property_off);
set_item_property(‘button_palette.pb_save’, visible, property_on);
set_item_property(‘button_palette.pb_save’, enabled, property_on);
end;

Button Name: Save
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘Catagory’);
if :system.form_status = ‘CHANGED’ then
commit_form;
if :system.form_status = ‘QUERY’ then
item_enable_disable(property_off);
end if;
end if;
set_item_property(‘button_palette.pb_update’, visible, property_on);
set_item_property(‘button_palette.pb_update’,enabled, property_on);
/*set_item_property(‘button_palette.pb_save’,visible, property_off);*/
end;

Button Name: Add
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘Catagory’);
create_record;
set_item_property(‘button_palette.pb_save’, visible, property_on);
set_item_property(‘button_palette.pb_update’, visible, property_off);
set_item_property(‘button_palette.pb_save’, enabled, property_on);
item_enable_disable(property_on);
end;

Button Name: Query
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘Catagory’);
execute_query;
set_item_property(‘button_palette.pb_update’, visible, property_on);
set_item_property(‘button_palette.pb_save’, visible, property_off);
set_item_property(‘button_palette.pb_update’,enabled, property_on);
item_enable_disable(property_off);
end;

Button Name: Delete
Trigger Name: WHEN-BUTTON-PRESSED
Code:
declare
chk_button number;
begin
go_block(‘Catagory’);
chk_button := show_alert(‘alert_delete’);
if chk_button = alert_button1 then
delete_record;
end if;
end;

Button Name: Close
Trigger Name: WHEN-BUTTON-PRESSED
Code:
declare
answer number;
begin
go_block(‘Catagory’);
if :system.form_status = ‘CHANGED’ then
set_alert_property(‘confirm_alert’, title, ‘Save Changes’);
set_alert_property(‘confirm_alert’, alert_message_text,
‘Would you like to save the changes?’);
answer := show_alert(‘confirm_alert’);
if answer = alert_button1 then
commit_form;
end if;
end if;

exit_form(No_Commit);
end;

Code of the Company Form (frmCompany.fmb)

Button Name: Update
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘Company’);
item_enable_disable(property_on);
set_item_property(‘Company.company_ID’,updateable, property_off);
set_item_property(‘button_palette.pb_update’, visible, property_off);
set_item_property(‘button_palette.pb_save’, visible, property_on);
set_item_property(‘button_palette.pb_save’, enabled, property_on);
end;

Button Name: Save
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ Company ‘);
if :system.form_status = ‘CHANGED’ then
commit_form;
if :system.form_status = ‘QUERY’ then
item_enable_disable(property_off);
end if;
end if;
set_item_property(‘button_palette.pb_update’, visible, property_on);
set_item_property(‘button_palette.pb_update’,enabled, property_on);
/*set_item_property(‘button_palette.pb_save’,visible, property_off);*/
end;

Button Name: Add
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ Company ‘);
create_record;
set_item_property(‘button_palette.pb_save’, visible, property_on);
set_item_property(‘button_palette.pb_update’, visible, property_off);
set_item_property(‘button_palette.pb_save’, enabled, property_on);
item_enable_disable(property_on);
end;

Button Name: Query
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ Company ‘);
execute_query;
set_item_property(‘button_palette.pb_update’, visible, property_on);
set_item_property(‘button_palette.pb_save’, visible, property_off);
set_item_property(‘button_palette.pb_update’,enabled, property_on);
item_enable_disable(property_off);
end;

Button Name: Delete
Trigger Name: WHEN-BUTTON-PRESSED
Code:
declare
chk_button number;

begin
go_block(‘ Company ‘);
chk_button := show_alert(‘alert_delete’);
if chk_button = alert_button1 then
delete_record;
end if;
end;

Button Name: Close
Trigger Name: WHEN-BUTTON-PRESSED
Code:
declare
answer number;
begin
go_block(‘ Company ‘);
if :system.form_status = ‘CHANGED’ then
set_alert_property(‘confirm_alert’, title, ‘Save Changes’);
set_alert_property(‘confirm_alert’, alert_message_text,
‘Would you like to save the changes?’);
answer := show_alert(‘confirm_alert’);
if answer = alert_button1 then
commit_form;
end if;
end if;

exit_form(No_Commit);
end;

Code of the Customer Form (frmCustomer.fmb)

Button Name: Update
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘Customer’);
item_enable_disable(property_on);
set_item_property(‘Customer.customer_ID’, updateable, property_off);
set_item_property(‘button_palette.pb_update’, visible, property_off);
set_item_property(‘button_palette.pb_save’, visible, property_on);
set_item_property(‘button_palette.pb_save’, enabled, property_on);
end;

Button Name: Save
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ Customer ‘);
if :system.form_status = ‘CHANGED’ then
commit_form;
if :system.form_status = ‘QUERY’ then
item_enable_disable(property_off);
end if;
end if;
set_item_property(‘button_palette.pb_update’, visible, property_on);
set_item_property(‘button_palette.pb_update’,enabled, property_on);
/*set_item_property(‘button_palette.pb_save’,visible, property_off);*/
end;

Button Name: Add
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ Customer ‘);
create_record;
set_item_property(‘button_palette.pb_save’, visible, property_on);
set_item_property(‘button_palette.pb_update’, visible, property_off);
set_item_property(‘button_palette.pb_save’, enabled, property_on);
item_enable_disable(property_on);
end;

Button Name: Query
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ Customer ‘);
execute_query;
set_item_property(‘button_palette.pb_update’, visible, property_on);
set_item_property(‘button_palette.pb_save’, visible, property_off);
set_item_property(‘button_palette.pb_update’,enabled, property_on);
item_enable_disable(property_off);
end;

Button Name: Delete
Trigger Name: WHEN-BUTTON-PRESSED
Code:
declare
chk_button number;

begin
go_block(‘ Customer ‘);
chk_button := show_alert(‘alert_delete’);
if chk_button = alert_button1 then
delete_record;
end if;
end;

Button Name: Close
Trigger Name: WHEN-BUTTON-PRESSED
Code:
declare
answer number;
begin
go_block(‘ Customer ‘);
if :system.form_status = ‘CHANGED’ then
set_alert_property(‘confirm_alert’, title, ‘Save Changes’);
set_alert_property(‘confirm_alert’, alert_message_text,
‘Would you like to save the changes?’);
answer := show_alert(‘confirm_alert’);
if answer = alert_button1 then
commit_form;
end if;
end if;

exit_form(No_Commit);
end;

Code of the Employee Form (frmEmployee.fmb)

Button Name: Update
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘Employee’);
item_enable_disable(property_on);
set_item_property(‘Employee.employee_ID’,updateable,property_off);
set_item_property(‘button_palette.pb_update’, visible, property_off);
set_item_property(‘button_palette.pb_save’, visible, property_on);
set_item_property(‘button_palette.pb_save’, enabled, property_on);
end;

Button Name: Save
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ Employee ‘);
if :system.form_status = ‘CHANGED’ then
commit_form;
if :system.form_status = ‘QUERY’ then
item_enable_disable(property_off);
end if;
end if;
set_item_property(‘button_palette.pb_update’, visible, property_on);
set_item_property(‘button_palette.pb_update’,enabled, property_on);
/*set_item_property(‘button_palette.pb_save’,visible, property_off);*/
end;

Button Name: Add
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ Employee ‘);
create_record;
set_item_property(‘button_palette.pb_save’, visible, property_on);
set_item_property(‘button_palette.pb_update’, visible, property_off);
set_item_property(‘button_palette.pb_save’, enabled, property_on);
item_enable_disable(property_on);
end;

Button Name: Query
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ Employee ‘);
execute_query;
set_item_property(‘button_palette.pb_update’, visible, property_on);
set_item_property(‘button_palette.pb_save’, visible, property_off);
set_item_property(‘button_palette.pb_update’,enabled, property_on);
item_enable_disable(property_off);
end;

Button Name: Delete
Trigger Name: WHEN-BUTTON-PRESSED
Code:
declare
chk_button number;
begin
go_block(‘ Employee ‘);
chk_button := show_alert(‘alert_delete’);
if chk_button = alert_button1 then
delete_record;
end if;
end;

Button Name: Close
Trigger Name: WHEN-BUTTON-PRESSED
Code:
declare
answer number;
begin
go_block(‘ Employee ‘);
if :system.form_status = ‘CHANGED’ then
set_alert_property(‘confirm_alert’, title, ‘Save Changes’);
set_alert_property(‘confirm_alert’, alert_message_text,
‘Would you like to save the changes?’);
answer := show_alert(‘confirm_alert’);
if answer = alert_button1 then
commit_form;
end if;
end if;

exit_form(No_Commit);
end;

Code of the Product Form (frmProduct.fmb)

Button Name: Update
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ Product ‘);
item_enable_disable(property_on);
set_item_property(‘ Product. product _ID’, updateable, property_off);
set_item_property(‘button_palette.pb_update’, visible, property_off);
set_item_property(‘button_palette.pb_save’, visible, property_on);
set_item_property(‘button_palette.pb_save’, enabled, property_on);
end;

Button Name: Save
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ Product ‘);
if :system.form_status = ‘CHANGED’ then
commit_form;
if :system.form_status = ‘QUERY’ then
item_enable_disable(property_off);
end if;
end if;
set_item_property(‘button_palette.pb_update’, visible, property_on);
set_item_property(‘button_palette.pb_update’,enabled, property_on);
/*set_item_property(‘button_palette.pb_save’,visible, property_off);*/
end;

Button Name: Add
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ Product ‘);
create_record;
set_item_property(‘button_palette.pb_save’, visible, property_on);
set_item_property(‘button_palette.pb_update’, visible, property_off);
set_item_property(‘button_palette.pb_save’, enabled, property_on);
item_enable_disable(property_on);
end;

Button Name: Query
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ Product ‘);
execute_query;
set_item_property(‘button_palette.pb_update’, visible, property_on);
set_item_property(‘button_palette.pb_save’, visible, property_off);
set_item_property(‘button_palette.pb_update’,enabled, property_on);
item_enable_disable(property_off);
end;

Button Name: Delete
Trigger Name: WHEN-BUTTON-PRESSED
Code:
declare
chk_button number;
begin
go_block(‘ Product ‘);
chk_button := show_alert(‘alert_delete’);
if chk_button = alert_button1 then
delete_record;
end if;
end;

Button Name: Close
Trigger Name: WHEN-BUTTON-PRESSED
Code:
declare
answer number;
begin
go_block(‘ Product ‘);
if :system.form_status = ‘CHANGED’ then
set_alert_property(‘confirm_alert’, title, ‘Save Changes’);
set_alert_property(‘confirm_alert’, alert_message_text,
‘Would you like to save the changes?’);
answer := show_alert(‘confirm_alert’);
if answer = alert_button1 then
commit_form;
end if;
end if;
exit_form(No_Commit);
end;

Trigger Level: Field Level
Trigger Name: KEY-NEXT-ITEM
Code:
declare
buff char(1);

begin
select ‘x’ into buff from Catagory
where Catagory.catagory_name =:product.description;
next_item;
end;

exception
when no_data_found then
declare
plov boolean;
begin
plov := show_lov(‘Pro_lov’);
clear_item;
end;

Code of the Sales Form (frmSales.fmb)

Button Name: Update
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ Sales’);
item_enable_disable(property_on);
set_item_property(‘ Sales. sales _ID’, updateable, property_off);
set_item_property(‘button_palette.pb_update’, visible, property_off);
set_item_property(‘button_palette.pb_save’, visible, property_on);
set_item_property(‘button_palette.pb_save’, enabled, property_on);
end;

Button Name: Save
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ Sales ‘);
if :system.form_status = ‘CHANGED’ then
commit_form;
if :system.form_status = ‘QUERY’ then
item_enable_disable(property_off);
end if;
end if;
set_item_property(‘button_palette.pb_update’, visible, property_on);
set_item_property(‘button_palette.pb_update’,enabled, property_on);
/*set_item_property(‘button_palette.pb_save’,visible, property_off);*/

declare
cursor c1 is
select PRODUCT_ID,QTY from sls_detail
where sales_id = :sales.sales_id;
begin
for i in c1 loop
update product
set unitsonhand = nvl(unitsonhand, 0) – nvl(i.QTY, 0)
where product_id = i.product_id;
end loop;
commit;
end;
end;

Button Name: Add
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ Sales ‘);
create_record;
set_item_property(‘button_palette.pb_save’, visible, property_on);
set_item_property(‘button_palette.pb_update’, visible, property_off);
set_item_property(‘button_palette.pb_save’, enabled, property_on);
item_enable_disable(property_on);
end;

Button Name: Query
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ Sales ‘);
execute_query;
set_item_property(‘button_palette.pb_update’, visible, property_on);
set_item_property(‘button_palette.pb_save’, visible, property_off);
set_item_property(‘button_palette.pb_update’,enabled, property_on);
item_enable_disable(property_off);
end;

Button Name: Delete
Trigger Name: WHEN-BUTTON-PRESSED
Code:
declare
chk_button number;

begin
go_block(‘ Sales ‘);
chk_button := show_alert(‘alert_delete’);
if chk_button = alert_button1 then
delete_record;
end if;
end;

Button Name: Close
Trigger Name: WHEN-BUTTON-PRESSED
Code:
declare
answer number;
begin
go_block(‘ Sales ‘);
if :system.form_status = ‘CHANGED’ then
set_alert_property(‘confirm_alert’, title, ‘Save Changes’);
set_alert_property(‘confirm_alert’, alert_message_text,
‘Would you like to save the changes?’);
answer := show_alert(‘confirm_alert’);
if answer = alert_button1 then
commit_form;
end if;
end if;

exit_form(No_Commit);
end;

Trigger Level: Item Level
Trigger Name: WHEN-NEW-FORM-INSTANCE
Code:
declare
Precgrp recordgroup;
Crecgrp recordgroup;
Orecgrp recordgroup;
status number;
begin
Precgrp := create_group_from_query(‘Precgrp’,
‘select product_ID, product_ID from Product’);
if not id_null(Precgrp) then
status := populate_group(Precgrp);
populate_list(‘product_ID’, Precgrp);
end if;

Crecgrp := create_group_from_query(‘Crecgrp’,
‘select customer_ID, customer_ID from Customer’);
if not id_null(Crecgrp)then
status := populate_group(Crecgrp);
populate_list(‘customer_ID’, Crecgrp);
end if;

Orecgrp := create_group_from_query(‘Orecgrp’,
‘select order_ID, order_ID from OrderforSales’);
if not id_null(Orecgrp) then
status := populate_group(Orecgrp);
populate_list(‘order_ID’, Orecgrp);
end if;
end;

Trigger Level: Block Level
Trigger Name: WHEN-LIST-CHANGED
Code:
begin
select customer_Name into :customer_Name from Customer
where customer_ID =:Sales.customer_ID;
exception
when no_data_found then
message(‘Invalid Customer Number.’);
raise form_trigger_failure;
end;

Code of the Purchase Form (frmPurchase.fmb)

Button Name: Update
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ Purchase’);
item_enable_disable(property_on);
set_item_property(‘ Purchase. Purchase_ ID’, updateable,property_off);
set_item_property(‘button_palette.pb_update’, visible, property_off);
set_item_property(‘button_palette.pb_save’, visible, property_on);
set_item_property(‘button_palette.pb_save’, enabled, property_on);
end;

Button Name: Save
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ Purchase ‘);
if :system.form_status = ‘CHANGED’ then
commit_form;
if :system.form_status = ‘QUERY’ then
item_enable_disable(property_off);
end if;
end if;
set_item_property(‘button_palette.pb_update’, visible, property_on);
set_item_property(‘button_palette.pb_update’,enabled, property_on);
/*set_item_property(‘button_palette.pb_save’,visible, property_off);*/
declare
cursor d2 is select product_id,QTY from pur_detail;
dproduct_id varchar2(10);
dQTY number(10);

begin
open d2;
loop
fetch d2 into dproduct_id,dQTY;
exit when d2%notfound;

update product set unitsonhand = nvl(unitsonhand, 0) + nvl(dQTY, 0) where product_id = dproduct_id;

end loop;

close d2;
commit;
end;

end;

Button Name: Add
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ Purchase ‘);
create_record;
set_item_property(‘button_palette.pb_save’, visible, property_on);
set_item_property(‘button_palette.pb_update’, visible, property_off);
set_item_property(‘button_palette.pb_save’, enabled, property_on);
item_enable_disable(property_on);
end;

Button Name: Query
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ Purchase ‘);
execute_query;
set_item_property(‘button_palette.pb_update’, visible, property_on);
set_item_property(‘button_palette.pb_save’, visible, property_off);
set_item_property(‘button_palette.pb_update’,enabled, property_on);
item_enable_disable(property_off);
end;

Button Name: Delete
Trigger Name: WHEN-BUTTON-PRESSED
Code:
declare
chk_button number;
begin
go_block(‘ Purchase ‘);
chk_button := show_alert(‘alert_delete’);
if chk_button = alert_button1 then
delete_record;
end if;
end;

Button Name: Close
Trigger Name: WHEN-BUTTON-PRESSED
Code:
declare
answer number;
begin
go_block(‘ Purchase ‘);
if :system.form_status = ‘CHANGED’ then
set_alert_property(‘confirm_alert’, title, ‘Save Changes’);
set_alert_property(‘confirm_alert’, alert_message_text,
‘Would you like to save the changes?’);
answer := show_alert(‘confirm_alert’);
if answer = alert_button1 then
commit_form;
end if;
end if;
exit_form(No_Commit);
end;
Trigger Level: Item Level
Trigger Name: WHEN-NEW-FORM-INSTANCE
Code:
declare
Precgrp recordgroup;
Srecgrp recordgroup;
Orecgrp recordgroup;
status number;
begin
Precgrp := create_group_from_query(‘Precgrp’,
‘select product_ID, product_ID from Product’);
if not id_null(Precgrp) then
status := populate_group(Precgrp);
populate_list(‘product_ID’, Precgrp);
end if;

Srecgrp := create_group_from_query(‘Srecgrp’,
‘select supplier_ID, supplier_ID from Supplier’);
if not id_null(Srecgrp)then
status := populate_group(Srecgrp);
populate_list(‘supplier_ID’, Srecgrp);
end if;

Orecgrp := create_group_from_query(‘Orecgrp’,
‘select order_ID, order_ID from OrderforPurchase’);
if not id_null(Orecgrp) then
status := populate_group(Orecgrp);
populate_list(‘order_ID’, Orecgrp);
end if;
end;

Trigger Level: Field Level
Trigger Name: WHEN-LIST-CHANGED
Code:
begin
select supplier_Name into :supplier_Name from Supplier
where supplier_ID =:Purchase.supplier_ID;
exception
when no_data_found then
message(‘Invalid Supplier Number.’);
raise form_trigger_failure;
end;

Code of the Order for Purchase Form (frmOrderPurchase.fmb)

Button Name: Update
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ OrderforPurchase’);
item_enable_disable(property_on);
set_item_property(‘OrderforPurchase.orderforpurchase_ID’,
updateable, property_off);
set_item_property(‘button_palette.pb_update’, visible, property_off);
set_item_property(‘button_palette.pb_save’, visible, property_on);
set_item_property(‘button_palette.pb_save’, enabled, property_on);
end;

Button Name: Save
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ OrderforPurchase ‘);
if :system.form_status = ‘CHANGED’ then
commit_form;
if :system.form_status = ‘QUERY’ then
item_enable_disable(property_off);
end if;
end if;
set_item_property(‘button_palette.pb_update’,visible, property_on);
set_item_property(‘button_palette.pb_update’,enabled, property_on);
/*set_item_property(‘button_palette.pb_save’,visible, property_off);*/
end;

Button Name: Add
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ OrderforPurchase ‘);
create_record;
set_item_property(‘button_palette.pb_save’, visible, property_on);
set_item_property(‘button_palette.pb_update’, visible, property_off);
set_item_property(‘button_palette.pb_save’, enabled, property_on);
item_enable_disable(property_on);
end;
Button Name: Query
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ OrderforPurchase ‘);
execute_query;
set_item_property(‘button_palette.pb_update’, visible, property_on);
set_item_property(‘button_palette.pb_save’, visible, property_off);
set_item_property(‘button_palette.pb_update’,enabled, property_on);
item_enable_disable(property_off);
end;

Button Name: Delete
Trigger Name: WHEN-BUTTON-PRESSED
Code:
declare
chk_button number;
begin
go_block(‘ OrderforPurchase ‘);
chk_button := show_alert(‘alert_delete’);
if chk_button = alert_button1 then
delete_record;
end if;
end;

Button Name: Close
Trigger Name: WHEN-BUTTON-PRESSED
Code:
declare
answer number;
begin
go_block(‘ OrderforPurchase ‘);
if :system.form_status = ‘CHANGED’ then
set_alert_property(‘confirm_alert’, title, ‘Save Changes’);
set_alert_property(‘confirm_alert’, alert_message_text,
‘Would you like to save the changes?’);
answer := show_alert(‘confirm_alert’);
if answer = alert_button1 then
commit_form;
end if;
end if;
exit_form(No_Commit);
end;
Trigger Level: Item Block
Trigger Name: WHEN-NEW-FORM-INSTANCE
Code:
declare
recgrp recordgroup;
status number;
begin
recgrp := create_group_from_query(‘recgrp’,
‘select Product_ID, Product_ID from Product’);
if not id_null(recgrp)then
status := populate_group(recgrp);
populate_list(‘Product_ID’, recgrp);
end if;
end;

Trigger Level: Item Level
Trigger Name: WHEN-LIST-CHANGED
Code:
begin
select productName, description, unitPrice
into :product_Name, :description, :unitPrice
from Product
where product_ID =:OrderforPurchase.product_ID;
exception
when no_data_found then
message(‘Invalid Product Number.’);
raise form_trigger_failure;
end;

Code of the Order for Sales Form (frmOrderSales.fmb)

Button Name: Update
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ OrderforSales’);
item_enable_disable(property_on);
set_item_property(‘OrderforSales.orderforsales_ID’,updateable,
property_off);
set_item_property(‘button_palette.pb_update’, visible, property_off);
set_item_property(‘button_palette.pb_save’, visible, property_on);
set_item_property(‘button_palette.pb_save’, enabled, property_on);
end;
Button Name: Save
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ OrderforSales’);
if :system.form_status = ‘CHANGED’ then
commit_form;
if :system.form_status = ‘QUERY’ then
item_enable_disable(property_off);
end if;
end if;
set_item_property(‘button_palette.pb_update’, visible, property_on);
set_item_property(‘button_palette.pb_update’,enabled, property_on);
/*set_item_property(‘button_palette.pb_save’,visible, property_off);*/
end;

Button Name: Add
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ OrderforSales’);
create_record;
set_item_property(‘button_palette.pb_save’, visible, property_on);
set_item_property(‘button_palette.pb_update’, visible, property_off);
set_item_property(‘button_palette.pb_save’, enabled, property_on);
item_enable_disable(property_on);
end;

Button Name: Query
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ OrderforSales’);
execute_query;
set_item_property(‘button_palette.pb_update’, visible, property_on);
set_item_property(‘button_palette.pb_save’, visible, property_off);
set_item_property(‘button_palette.pb_update’,enabled, property_on);
item_enable_disable(property_off);
end;

Button Name: Delete
Trigger Name: WHEN-BUTTON-PRESSED
Code:
declare
chk_button number;

begin
go_block(‘ OrderforSales’);
chk_button := show_alert(‘alert_delete’);
if chk_button = alert_button1 then
delete_record;
end if;
end;

Button Name: Close
Trigger Name: WHEN-BUTTON-PRESSED
Code:
declare
answer number;
begin
go_block(‘ OrderforSales’);
if :system.form_status = ‘CHANGED’ then
set_alert_property(‘confirm_alert’, title, ‘Save Changes’);
set_alert_property(‘confirm_alert’, alert_message_text,
‘Would you like to save the changes?’);
answer := show_alert(‘confirm_alert’);
if answer = alert_button1 then
commit_form;
end if;
end if;

exit_form(No_Commit);
end;

Trigger Level: Item Block
Trigger Name: WHEN-NEW-FORM-INSTANCE
Code:
declare
recgrp recordgroup;
status number;
begin
recgrp := create_group_from_query(‘recgrp’,
‘select product_ID, product_ID from Product’);
if not id_null(recgrp) then
status := populate_group(recgrp);
populate_list(‘product_ID’, recgrp);
end if;
end;

Trigger Level: Item Level
Trigger Name: WHEN-LIST-CHANGED
Code:
begin
select productName, description, unitPrice, unitsonhand
into :product_Name, :description, :unitPrice, :unitDelivered from Product
where product_ID =:OrderforSales.product_ID;
exception
when no_data_found then
message(‘Invalid Supplier Number.’);
raise form_trigger_failure;
end;

Code of the Shrinkage Form (frmshrinkage.fmb)

Button Name: Update
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ Shrinkage’);
item_enable_disable(property_on);
set_item_property( Shrinkage. shrinkage _ID’,updateable, property_off);
set_item_property(‘button_palette.pb_update’, visible, property_off);
set_item_property(‘button_palette.pb_save’, visible, property_on);
set_item_property(‘button_palette.pb_save’, enabled, property_on);
end;

Button Name: Save
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ Shrinkage ‘);
if :system.form_status = ‘CHANGED’ then
commit_form;
if :system.form_status = ‘QUERY’ then
item_enable_disable(property_off);
end if;
end if;
set_item_property(‘button_palette.pb_update’, visible, property_on);
set_item_property(‘button_palette.pb_update’,enabled, property_on);
/*set_item_property(‘button_palette.pb_save’,visible, property_off);*/
end;

Button Name: Add
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘Shrinkage’);
create_record;
set_item_property(‘button_palette.pb_save’, visible, property_on);
set_item_property(‘button_palette.pb_update’, visible, property_off);
set_item_property(‘button_palette.pb_save’, enabled, property_on);
item_enable_disable(property_on);
end;

Button Name: Query
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ Shrinkage’);
execute_query;
set_item_property(‘button_palette.pb_update’, visible, property_on);
set_item_property(‘button_palette.pb_save’, visible, property_off);
set_item_property(‘button_palette.pb_update’,enabled, property_on);
item_enable_disable(property_off);
end;

Button Name: Delete
Trigger Name: WHEN-BUTTON-PRESSED
Code:
declare
chk_button number;
begin
go_block(‘ Shrinkage ‘);
chk_button := show_alert(‘alert_delete’);
if chk_button = alert_button1 then
delete_record;
end if;
end;
Button Name: Close
Trigger Name: WHEN-BUTTON-PRESSED
Code:
declare
answer number;
begin
go_block(‘ Shrinkage ‘);
if :system.form_status = ‘CHANGED’ then
set_alert_property(‘confirm_alert’, title, ‘Save Changes’);
set_alert_property(‘confirm_alert’, alert_message_text,
‘Would you like to save the changes?’);
answer := show_alert(‘confirm_alert’);
if answer = alert_button1 then
commit_form;
end if;
end if;

exit_form(No_Commit);
end;

Trigger Level: Field Level
Trigger Name: KEY-NEXT-ITEM
Code:
declare
buff char(1);

begin
select ‘x’ into buff from Product
where product.productname =:shrinkage.product_name;
next_item;
end;

exception
when no_data_found then
declare
plov boolean;
begin
plov := show_lov(‘Pro_lov’);
clear_item;
end;

Code of the Supplier Form (frmSupplier.fmb)

Button Name: Update
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ Supplier’);
item_enable_disable(property_on);
set_item_property(‘ Supplier. supplier_ID’,updateable, property_off);
set_item_property(‘button_palette.pb_update’, visible, property_off);
set_item_property(‘button_palette.pb_save’, visible, property_on);
set_item_property(‘button_palette.pb_save’, enabled, property_on);
end;

Button Name: Save
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ Supplier ‘);
if :system.form_status = ‘CHANGED’ then
commit_form;
if :system.form_status = ‘QUERY’ then
item_enable_disable(property_off);
end if;
end if;
set_item_property(‘button_palette.pb_update’, visible, property_on);
set_item_property(‘button_palette.pb_update’,enabled, property_on);
/*set_item_property(‘button_palette.pb_save’,visible, property_off);*/
end;

Button Name: Add
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘Supplier ‘);
create_record;
set_item_property(‘button_palette.pb_save’, visible, property_on);
set_item_property(‘button_palette.pb_update’, visible, property_off);
set_item_property(‘button_palette.pb_save’, enabled, property_on);
item_enable_disable(property_on);
end;

Button Name: Query
Trigger Name: WHEN-BUTTON-PRESSED
Code:
begin
go_block(‘ Supplier’);
execute_query;
set_item_property(‘button_palette.pb_update’, visible, property_on);
set_item_property(‘button_palette.pb_save’, visible, property_off);
set_item_property(‘button_palette.pb_update’,enabled, property_on);
item_enable_disable(property_off);
end;

Button Name: Delete
Trigger Name: WHEN-BUTTON-PRESSED
Code:
declare
chk_button number;
begin
go_block(‘ Supplier ‘);
chk_button := show_alert(‘alert_delete’);
if chk_button = alert_button1 then
delete_record;
end if;
end;

Button Name: Close
Trigger Name: WHEN-BUTTON-PRESSED
Code:
declare
answer number;
begin
go_block(‘ Supplier ‘);
if :system.form_status = ‘CHANGED’ then
set_alert_property(‘confirm_alert’, title, ‘Save Changes’);
set_alert_property(‘confirm_alert’, alert_message_text,
‘Would you like to save the changes?’);
answer := show_alert(‘confirm_alert’);
if answer = alert_button1 then
commit_form;
end if;
end if;
exit_form(No_Commit);
end;

Discussion:

(i) Security System:
As the proposed system is a multi-user system we provide a highly restricted security to manipulate sell-covered data. An unauthorized person is not allowed to access the package. Even the authorized persons’ may have different access on the package. To secure all these processes we have given priority permission rather than for a multi-user accessing.

(ii) System Advantages:

► Using this system,company can give proper and fast service to customer.
►This software is well secured.
►This softqare is easy to handle.
►This software will fillup the most requirements of a IT company.

(iii) System Drawbacks:
The work carried in the system takes some time because the system is partially manual also there is quite an amount of paperwork like purchase that order as sales order has to prepare manually. More employees are required in the various departments, which is an overhead.

The system has very highly configured systems, which help a lot as maintained earlier, but it is not used as an optimized way. They are only used for typing letters and finding out some information about sales and purchase orders.

The present system of inventory control is very cumbersome since a lot of paper work and registers have to be maintained and information gathering takes a lot of time. During on some high rush it is very difficult for employees to maintain all sales and purchase order. The previous system does not allow the strict security for all type of users and non-users.
The system can be implemented to only normal computer hardware stores not to any computer firm or industries.

Future Enhancement:

The preferable enhancements that are likely to be included are :

► The system can be provided with graphical support. This will give
management a better view of issues dealt in this system.

► The system could be provided with the context sensitive help thus
providing end-user a very friendly system.

► The system could be made to use it on the network system. We can
connect their different center with Internet using Windows 2000.

Conclusion:
After the development of Inventory Control System, working of the system showed that it deals with following aspects :

 Maintaining Master data stores.

 Maintaining data validity.

 Reducing redundancy of data.

 Providing useful information about sale of the company to the management.

 Providing correct and useful information for sale department.

 Providing useful reports for all the validate records of the company related fields to the management.

Products Purchase and Sales