Sei sulla pagina 1di 75

Stock Management System

ABSTRACT

Stock Management System is important to handle transactions revolving around consumer


goods. Without proper stock control, a large retail store may run out of stock on an important
item. A good Stock Management System will alert the retailer when it is time to reorder. Stock
Management System also prepares records of incoming and outgoing sales. Manually
preparing the records is likely to result in error. A proper Stock Management System helps to
minimize the risk of error. In retail stores, a Stock Management System also helps track theft
of retail merchandise, providing valuable information about store profits and the need for theft-
prevention systems.

The Stock Management System can serve a variety of functions in this case. It can help a
worker prepare bill for a sale, it can send an order request, prepare reports of order, reorder
and sale and it can remove these purchased items from the stock tally to keep an accurate count
of in-stock items. The system also keeps the details of the products and suppliers. Stock
Management System make it simple to locate and analyze stock information in real-time with
a simple database search.

Keywords: Stock Management System, Java, Product, Supplier, Bill, Stock Level.

i
Stock Management System

ACKNOWLEDGEMENT

The project has been benefited from the joint efforts of many individuals. It has been very
pleasure for us to acknowledge the assistance and contributions that were very important and
supportive throughout the project.

We owe special thanks to a number of people who has devoted much of their time and expertise
without which it would have been very difficult for us to complete our project entitled “Stock
Management System”.

We would like to extend our special thanks to Er. Sugandha Amatya for providing technical
support with suggestions which helped our project to foster. We would also like to thank Er.
Bhushan Thapa for his valuable guidance throughout the project development period. It would
be our privilege to thank Er. Madan Kadariya, Head of Department of Software and IT
Engineering for his support.

We would not forget to thank our teachers and classmates who have been knowingly or
unknowingly the part of this project and lent support and views during the entire development
time.

ii
Stock Management System

LIST OF ABBREVIATIONS

API Application Program Interface

CD R/W Compact Disc Rewritable

CUI Command-line User Interface

DFD Data Flow Diagram

ER Entity Relationship

Fig Figure

FP Function Point

GUI Graphical User Interface

JRE Java Runtime Environment

LOC Lines of Code

MS Microsoft

MSDN Microsoft Developer Network

PM Person per Month

RDBMS Relational Database Management System

SQL Structured Query Language

SRS System Requirement Specification

SVGA Super video Graphics Adapter

iii
Stock Management System

LIST OF FIGURES

Figure 5.1: Incremental Model .............................................................................................. 16

Figure 6.1: Context Diagram ................................................................................................... 20

Figure 6.2: Data Flow Diagram ................................................................................................... 21

Figure 6.3: ER - Diagram ....................................................................................................... 22

Figure 6.4: Use Case Diagram ..................................................................................................... 23

Figure 6.5: Sequence Diagram for Admin............................................................................... 24

Figure 6.6: Sequence Diagram for Manager............................................................................ 25

Figure 6.7: Sequence Diagram for Sale_Operator................................................................... 26

Figure 6.8: Class Diagram ...................................................................................................... 27

Figure 8.1: Output: Message displaying username/password is not correct............................ 34

Figure 8.2: Output: Error Message .......................................................................................... 35

Figure 8.3: Output: Data saved successfully message ............................................................. 36

Figure 8.4: Output: Enter required field message.................................................................... 37

Figure 8.5: Output: Data Updated Successfully ...................................................................... 38

Figure 8.6: Output: Product deleted message .......................................................................... 39

Figure 8.7: Output: Error Message .......................................................................................... 40

Figure 8.8: Output: Data saved successfully message ............................................................. 41

Figure 8.9: Output: Error message........................................................................................... 42

Figure 8.10: Output: Data updated successfully...................................................................... 43

Figure 8.11: Output: Company details deleted ........................................................................ 44

Figure 8.12: Output: Correct errors to create user message..................................................... 45

Figure 8.13: Output: New user created successfully message................................................. 46

Figure 8.14: Output: Username and password not correct message........................................ 47

Figure 8.15: Output: Password changed successfully message ............................................... 48

iv
Stock Management System

Figure 8.16: Output: Username does not exit message............................................................ 49

Figure 8.17: Output: User removed successfully message ...................................................... 50

Figure 8.18: Output: Stock level is below 50. Reorder soon message .................................... 51

Figure 9.1: Gantt Chart ............................................................................................................ 52

v
Stock Management System

LIST OF TABLES

Table 3.1: Team Members and Divided Roles ........................................................................ 6

Table 4.1: Product Details........................................................................................................ 11

Table 4.2: Company Details ........................................................................................................ 12

Table 4.3: Sold Details ........................................................................................................... 12

Table 4.4: Reorder Details ........................................................................................................... 13

Table 4.5: Stock Details ......................................................................................................... 13

Table 4.6: User Details ................................................................................................................. 14

Table 8.1: Testing Table .......................................................................................................... 31

vi
Stock Management System

TABLE OF CONTENTS

Abstract .......................................................................................................................................i

Acknowledgement .....................................................................................................................ii

List of Abbreviation .......................................................................................................................iii

List of Figures................................................................................................................................. iv

List of Tables ...........................................................................................................................vi

1. Introduction ......................................................................................... 1

1.1 Project Overview .......................................................................................................... 1


1.2 Motivation .................................................................................................. 1
1.3 Project Objective ............................................................................................... 2
1.4 Significance of Study.................................................................................................... 2
1.5 Scope of Project ............................................................................................................ 3
2. Literature Review........................................................................................... 4
2.1. Review .......................................................................................................................... 4
2.2. Domain ......................................................................................................................... 4
2.3. Existing System ............................................................................................................ 4
2.4. Comparison with the Existing System.......................................................................... 4
3. Team Members and Divided Roles...................................................................................... 6
4. Requirements ........................................................................................................ 7

4.1 Requirement Analysis................................................................................................... 7


4.2 System Requirement Specification............................................................................... 7
4.2.1 Functional Requirement....................................................................................... 7
4.2.2 Input Requirement ............................................................................................. 10
4.2.3 Output Requirement........................................................................................... 14
4.2.4 Security Requirement ........................................................................................ 15
4.2.5 Hardware Specification ..................................................................................... 15
4.2.6 Software Specification....................................................................................... 15

5. Methodology...................................................................................................................... 16

5.1 Software Development Lifecycle ............................................................................... 16

vii
Stock Management System

5.2 Technologies Used...................................................................................................... 17


5.3 Tools Used .................................................................................................................. 18

6. System Design .......................................................................................................19

6.1 Data Structure Design................................................................................................ 19


6.2 Context Diagram........................................................................................................ 20
6.3 Data Flow Diagram..................................................................................................... 21
6.4 ER - Diagram .............................................................................................................. 22
6.5 Use Case Diagram ...................................................................................................... 23
6.6 Sequence Diagram ...................................................................................................... 24
6.7 Class Diagram............................................................................................................. 27

7. Budget..................................................................................................................28

7.1 Function Point............................................................................................................. 28


7.2 Line of Code ............................................................................................................... 30

8. Testing ..................................................................................................................31

8.1 Testing Table .............................................................................................................. 31

8.2 List of Testing ............................................................................................................. 34

9. Gantt Chart......................................................................................................................... 52

10. Conclusion and Future Extension .........................................................................53

11. Bibliographical References.................................................................................. 54

Appendix A ....................................................................................................... viii

Appendix B ....................................................................................................... xiii

viii
Stock Management System

1. INTRODUCTION

1.1 PROJECT OVERVIEW

Managing stock effectively is important for any business. Stock management involves careful
planning to ensure that the business has sufficient stock of the right quality available at the
right time. Stock can mean a variety of things from raw materials, finished and ready to use
goods like processed food items, clothes depending upon the type of the business.

In order to meet customer orders, product has to be available from stock. If a business does not
have the necessary stock to meet orders, this can lead to a loss of sales and also degrade
business reputation. It is important therefore that a business either holds sufficient stocks to
meet actual and anticipated orders, or can get stocks quickly enough to meet those orders.

Also, a business requires a billing system that prepares a bill for each sale and a report preparing
system that prepares a report for the sales, order and reorder that takes place in the business.
So, a complete Stock Management System, should not only store the information about the
products and suppliers but also have an alert system when the stock level goes low and should
also include a billing and a report preparing unit.

1.2 PROJECT MOTIVATION

We have observed the increasing use of a computer-based system to keep records of the
products, suppliers and prepare a bill for each sale by various stores. The concept of preparing
hand written records and bills is slowly being replaced by the computer-based stock managing
system. Thus, there is an increased demand of such systems in the market. However, the
developers are still insufficient. This unbalanced situation motivated us to design a general
purpose Stock Management System that can be used to keep track of available stock, prepare
bill for each sale and prepare records of order, reorder and sale for a specified period of time,
by all kinds of business with a little or no change at all.

Our knowledge of the field in the beginning of the project was casual. We knew generally about
the process of selling and billing, without actually knowing about how the product are bought
from the suppliers, on what basis the reordering takes places. So with the progress in the
project, we realized the wider horizon and reach of such systems in the world of business and
also realized that progressive nature of such systems. The increasing demand for an efficient

1
Stock Management System

and real objects manipulating system, the challenge in developing the system increased.
However, the challenge motivated us even more.

1.3 PROJECT OBJECTIVES

After the investigation of the data collection process objectives of the new computerized system
has been drawn out. The core objectives of the new computerized system are

 Develop an application with user friendly interface.

 Provide the facility of adding, saving, editing, deleting, searching, displaying the
record.

 Provide the facility of adding, saving, editing and searching product details.

 Provide the facility of adding, saving, editing and searching company details.

 Provide the facility of searching records stored in database very quickly and
flexibly.

 Provide the facility of deleting records form the database.

 User validation measures to prevent invalid data being entered and the program
crashing as a result.

 Develop an application that should analyze the records and produce suitable reports.

 Include very possible features to efficiently manage a stock system.

 The new system should be time efficient.

 The new system should maintain the record in neat and clean way.

 Give access to authentic person only to manage user accounts.

1.4 SIGNIFICANCE OF STUDY

The study investigates the need of a system for managing stock in a business. With the field of
business getting more competitive and advance, there is need for a system that can meet up to
the customer’s need. The increasing and changing customer demands encourages the software

2
Stock Management System

developers to study the customer’s needs and implement those needs in a software. The
constantly changing needs of the customer demand the software developers to extensively
study the problem and then find the solutions for the problems. The study also looks into the
similar systems that are currently in use and subjects it to various user to explore its feasibility
and drawbacks as well.

1.5 SCOPE OF PROJECT

The scope of this project is to provide a user with a platform in the user can store product and
supplier details and can access the data efficiently. With a Stock Management System the
company/store can:

 Have an accurate plan to stay ahead of the demand curve and keep right amount of
products.
 Provide employee efficiency.
 Manage suppliers, which play a key role in business.
 Prepare a printable sale, order and reorder reports.
 Provide a bill with a unique id for each purchase.

3
Stock Management System

2. LITERATURE REVIEW

2.1 REVIEW

Various works have been done and are being done in the field of Stock Management System. However,
only very few works are acceptable to the market standards and make up to the quality
standards. Also, many companies have not given up on the register-based record keeping as
the system that are available in the market fail to meet their requirements. The growth in the
field of business, also needs the development in the field software design and development.
Also, the increasing demands of real-world like systems, is leading towards the crisis of Stock
Management System as such. Hence, we have designed a general purpose Stock Management
System that is useful for all kind of business and is also very efficient and easy to use.

2.2 DOMAIN

Stock Management System is applicable in each and every business that deals with buying and
selling of goods. Our system is widely useful business dealing with any kind of goods from
clothes to ready-to use and packed foods to medicines.

2.3 EXISTING SYSTEM

In the present situation, most business still continue to use the register-based record keeping
system. Different registers are used to keep product details, company details, sale record,
reorder record. Also, hand written reports of sale, order and reorder are prepared on a monthly
basis. If a certain record is to be deleted, either the page containing the record is deleted or the
row containing the record is crossed out. All the updates are also done manually. Such systems
face a lot of security issues due to theft. Also, manually adding and updating stock is time
consuming.

2.4 COMPARISION WITH THE EXISTING SYSTEM

Our system has a numerous advantage over the existing system. All the register-based systems
are being replace by the computer-based system. The system provides a quick and efficient
way add, update and delete product details company/ supplier details. It also provides an easy

4
Stock Management System

access over the sale, order and reorder reports of the specified period of time. The backup plan
of the system records the system’s database to an external storage device, that is password
protected and provides a great deal of database security. Also in case, an intruder looks into the
database, he will have a hard time decrypting the system’s user’s password as the password is
store only after hashing it by SHA-256 algorithm. [7]

5
Stock Management System

3. TEAM MEMBERS AND DIVIDED ROLES

Table 3.1: Team Members and Divided Roles

Name Roles Responsibilities

Ingroj Shrestha Project Manager  Review and approve all project deliverables
(Initiation Plan, Detailed Plan, Testing etc.)
 Provide overall project oversight and work
with business offices and Technical Project
manager to keep project on track.
 Ensures business and functional decisions
are made to ensure technical development
progress and completion

Security and  Create and Maintain system security


Authorizations (authentication, user profiles, assignment of
Expert users to profiles)

System  Define and execute development requirement


Developer

Shreeya Singh System Designer  Develop system interfaces


Dhakal  Test system interfaces

Department
 Participate in analysis, requirement
Process Experts
gathering, & preparation of specifications
 Identify improvement opportunities
 Define test case scenarios

End User  Participate in testing


Documentation  Develop Quick Reference Card(s)
Expert  Develop documentation

6
Stock Management System

4. REQUIREMENT

4.1 REQUIREMENT ANALYSIS

Requirement analysis, in software engineering encompasses those tasks that go into


determining the need and conditions to meet for a new or altered product, taking account of
possibly conflicting requirements of the various stakeholders, such as beneficiaries and users.
It is the early stage activity of requirement engineering which encompasses all activities
concerned with eliciting, analyzing, documenting, validating and managing system
requirements.

4.2 SYSTEM REQUIREMENT SPECIFICATIONS

4.2.1 Functional Requirements

 Functionality
What functionality is required from the new system?

 Data Entry Method

The following inputs formats were applied:

 Automatic Input:
SoldID is automatically generated.
Date of Sold items is automatically current date.

 Selection from the combo box and option button


For instance, Manufacture Date, Expire Date is using calendar from date
picker.

 Direct Entry using keyboard


Most of the stock details, company details, amount of items sold in
billing are entered through keyboard.

7
Stock Management System

 Backup facility
User may use backup of the records for security purpose. This may be
through hard copy or soft copy output of the report.

 Output to User

 Soft Output Requirements

Methods of displaying records

a. MS flex-grid
b. Save sold, re-order and ordered report
c. Photo of each products

 Hard Output Requirements

Basically hard copy output is obtained in printed form. This


requirements deal with the formats like: use of plain text, use of colors
in reports.

 Report of selective fields of billing including data from product


details.
 Report of selective fields of ordered and re-ordered products

 Interface required

Manager was provided with options of CUI and GUI interface. He choose
GUI because for the person handling Stock Management System would be
preferable with GUI based interface as it provide easy access of the system,
better look and feel and low learning curve.

The user would be working with the following windows. Their functions are
also listed below:

8
Stock Management System

 Data Entry Window


It will be used to make data entries. This should facilitate user with
above indicated input formats.

 Date editing window


It will be used to make data editing. This should facilitate user with
above indicated input formats and output formats.

 Data viewing window


This is used to display reports. This should facilitate output formats
indicated above in output requirements.

 Search window
This displays search results of the particular product. This should
facilitate input and output formats indicated above.

 Other windows
It includes login window, change password, create and remove users.

User is facilitated to use these windows using menu bar rather than a
form for easy access and interface.

 Special features required


User wants to save the report in various format listed below.
 PDF (*.pdf)
 RTF (*.rtf)
 DOCX (*.docx)
 HTML (*.html)
 Excel format (*.xls)

9
Stock Management System

4.2.2 Input Requirements

Data Required

The data to be input are:-

 Product Details
This contains product name, associated company of product,
manufacturer date, expire date, quantity ordered, total price of products,
image of products.

 Company Schedules
This contains company name, email address, phone number and address.

 Sold products Details


This contains product id, quantity sold and price of products sold

 Re-ordered product Details


This contains product id, associated company and ordered quantity.

Source of data

The information about product and company will be provided by Marketing Manager and
billing will be provided by Sales Operator.

10
Stock Management System

Input List and Validation

The user inputs, for each, are categorized on the basis of entry by the user. They are tabulated
below along with data description, validation and data length which would be helpful in Design
Phase.

Table 4.1: Product Details

S.N. Input Data type Length Description

1 Product ID Character 20 characters It is the unique id given to the


product

2 Product Name Character 20 characters It is the name of the product

3 Company name Character 20 characters It is the name of associated


company manufacturing
product

4 Manufacture Date Standard It is the manufacture date of the


Date product

5 Expire Date Date Standard It is the expire date of the


product

6 Ordered Quantity Integer Standard It is the amount of product


ordered

7 Price Double Standard It is the total cost of ordered


Precision quantity

8 Product Image Bytea Standard It I the image of product

9 Ordered Date Date Standard It is the order date of the product

11
Stock Management System

Table 4.2: Company Details

S.N. Input Data type Length Description

1 Company Name Character 20 characters It is the name of company

2 Address Character 20 characters It is the address of company

3 Phone Number Character 10 characters It is the phone number of


company

4 Email Character 32 characters It is the mailing address of


company

Table 4.3: Sold Details

S.N. Input Data type Length Description

1 Product ID Character 20 characters It is the id of sold product

2 Sold Quantity Integer Standard It is the quantity of product sold

3 Sold Date Date Standard It is the sold date of product

4 Sold ID Integer Standard It is the ID generated when


product is sold

12
Stock Management System

Table 4.4: Re-ordered Details

S.N. Input Data type Length Description

1 Product ID Character 20 characters It is unique id of re-ordered


product

2 Re-order Date Date Standard It is the re-order date

3 Re-order Integer Standard It is the amount of product


Quantity reordered

4 Company Name Character 20 characters It is the name of company from


which re-order is done

Table 4.5: Stock Details

S.N. Input Data type Length Description

1 Product ID Character 20 characters It is the unique id of product in


stock

2 Stock Level Integer Standard It is the quantity of product in store


house

13
Stock Management System

Table 4.6: User Details

S.N. Input Data type Length Description

1 Username Character 32 characters It is the unique id of users of the


system

2 Password Character 32 characters It is the password of the users of


the system

3 Post Character 20 characters It is the post of the users of the


system

4.2.3 Output Requirements

Output objectives

The admin requires following output from the system:

1. Details of Ordered Quantity


Details of ordered quantity in a selected range of date are required for the
admin to have his certain date ordered records.

2. Details of Re-ordered Quantity


Details of re-ordered quantity in a selected range of date are required for the
admin to have his certain date re-ordered records.

3. Details of Sold Quantity


Details of sold quantity in a selected range of date are required for the admin
to have his certain date sold products records.

14
Stock Management System

4.2.4 Security Requirements

Unauthorized user should not be allowed to access the new system. So, to provide security
password protection was used and username was provided to each user. Also, passwords are
saved in the database, are hashed using SHA-256 protocol but being stored. Adoption of this
protocol to encrypt passwords keep the passwords safe from the intruders. In new system, new
user creation facility is provided to admin only.

4.2.5 Hardware Specifications

i. Processing Speed : 800 MHz or Higher

ii. Memory : 128 MB or Higher and 10MB free space

iii. Input : Standard Keyboard, Mouse, Digital Camera

iv. Storage : Hard Disk, CD R/W Drive, Quality Blank CDs

v. Output : Monitor, Printer

vi. Display : 256 Color SVGA display

4.2.6 Software Specifications

i. Operating System : Windows 98 or higher

ii. Drivers : Required Drivers of the Hardware parts

iii. Programs : JRE 1.7 or higher

These are the minimum requirements for running the Computerized Stock Management System.

15
Stock Management System

5. METHODOLOGY

5.1 SOFTWARE DEVELOPMENT LIFECYCLE

The framework we followed in developing this project is incremental model, which is a use of
linear sequential model in an iterative manner. New functionalities were added as each
increment was developed. Linear sequential model was applied to develop each increment. The
phases of the linear sequential model are: Analysis, Design, Coding and Testing. The software
repeatedly passes through these phase in iteration and an increment is delivered with
progressive changes. [4]

Fig. 5.1: Incremental Model

Analysis Phase: In this phase, analysis was done in order to find out the requirements of the
system. The outcome of this phase is a SRS which is an acronym for “System Requirement
Specifications”.

Design Phase: In this phase the SRS was translated into the system’s design. Context
Diagram, DFD, ER – Diagram, Use Case Diagram and Class Diagram were developed.

Coding Phase: In this phase coding was done according to the design and a working system
was developed by the end of this process.

16
Stock Management System

Testing Phase: In this phase, the system was tested. With each testing a list of changes to the
system developed, was suggested and the changes were applied to the software and the
software was delivered as a successive increment until a satisfying system was achieved.

5.2 TECHNOLOGIES USED

SOFTWARE TYPE SELECTION

We had had following option through which we can develop the software:
1. Spreadsheet Package
Spreadsheet software like Microsoft Excel or Lotus could be used to create
templates in the layout specified by the user. User would enter data in cells. In
addition formulae could be used to perform various calculations.

2. A Relational Database Management System


Various RDBMS provide facilities to create relational databases. In addition, they
allow templates and reports to be created which would allow the user to enter and
retrieve data. Some of the software that could provide all these is Microsoft Access,
Microsoft Fox pro.

3. A Programming Language along with RDBMS


In this all the windows and processes will be created using programming language.
In addition, RDBMS could be used as back-end, to store data. For example, we
could use Java along with PostgreSQL etc.

From the above three option in using the software for program development, we
prefer to use A Programming Language along with RDBMS.

Reasons for Choosing Java as Programming Language:

Java is a Rapid Application Development Tool that allows programmers to create


windows application in very little time efficiently.
 High Level Language
 Calling For Windows API possible
 Good help and tutorials in MSDN

17
Stock Management System

 Inbuilt system and function to handle database


 Rapid Application Development under time constrains being possible
 Easy to write in programming code

Reasons for Choosing PostgreSQL as Back-end

 Relational Database Management System


 Highly organized
 Security provided
 Good integration with Java
 SQL widely supported

5.3 TOOLS USED

 Eclipse Luna version 4.4.0

 PostgreSQL version 1.18.1

 Jasper iReports version 5.6.0

 Autodesk Sketckbook Express

 Smart Draw

18
Stock Management System

6. SYSTEM DESIGN

Designing according to the requirement specification, we have made an attempt to make sure
that the system design actually confirms the user requirements of the system. In order to do so,
we frequently looked into the following matters:

 Verifications of input and output formats


 To make sure that the design layouts of windows are accepted by the user
 To make sure that security specifications are met

6.1 DATA STRUCTURE DESIGN [11]

The descriptions of the data type that will be used in the new system are as below:

The data type, size and constraints for each data Entity is documented. The data types are
identified as following:-

 Character varying (n), varchar (n) : variable-length with limit


 Integer :4 bytes
 Bytea :1 or 4 bytes plus the actual binary string
 Date : 4 bytes
 Boolean :1 byte
 Double Precision : 8 bytes

19
Stock Management System

6.2 CONTEXT DIAGRAM

The context diagram represents the overall explanation of the system ‘Stock Management
System’.

The system has been shown in diagrammatic process below:

PRODUCT COMPANY

Re-order Request
Product Details Company Details
STOCK MANAGEMENT
SYSTEM
Re-order Details
Provides Stock

Buys Product
Provides Bill
Level

CUSTOMER
RE-ORDER PROCESS

Fig. 6.1 Context Diagram for Stock Management System

20
Stock Management System

6.3 DATA FLOW DIAGRAM

A Data Flow Diagram (DFD) is a graphical representation of the "flow" of data through a
system.

The flow of data in our system is represented by the following Data Flow Diagram.

Top Level DFD

USER

Invalid
SECURITY PROCEDURE. USERNAME
AND PASSWORD

Valid
ADD/ EDIT, SEARCH & STOCKMANAGEMENT ADD/ EDIT, SEARCH &
DELETE PRODUCT DELETE COMPANY
SYSTEM
DETAILS DETAILS

PRODUCT COMPANY

ADD/SEARCH & DELETE VIEW, SAVE & PRINT VIEW & UPDATE STOCK
USER DETAILS REPORT LEVEL

USER REPORT STOCK

Fig. 6.2 Data Flow Diagram for Stock Management System

21
Stock Management System

6.4 ER - DIAGRAM

This section aims to create a normalized Entity-Relationship Diagram for the system. The E-R
Diagram is a graphical representation of the overall logical structure of the database. In order
to do so, normalization process will carried out in an un-normalized E-R Diagram so as to
improve the performance of the system.

Fig. 6.3 ER – Diagram for Stock Management System

22
Stock Management System

6.5 USE CASE DIAGRAM

Use case is a list of steps, typically defining interactions between a role and a system, to
achieve a goal. The following figure shows the interactions between the roles involved and the
Stock Management System.

Fig. 6.4 Use Case Diagram for Stock Management System

23
Stock Management System

6.6 SEQUENCE DIAGRAM

Fig. 6.5 Sequence Diagram for Admin

24
Stock Management System

Fig. 6.6: Sequence Diagram for Manager

25
Stock Management System

Preview Bill

Fig. 6.7 Sequence Diagram for Sale_Operator

26
Stock Management System

6.7 CLASS DIAGRAM

A type of static structure diagram that describes the structure of a system by showing the
system's classes, their attributes, operations (or methods), and the relationships among objects.
The class diagram for our system is shown below:

Fig. 6.8 Class Diagram for Stock Management System

27
Stock Management System

7. BUDGET

7.1 FUNCTION POINT

Table 7.1: Function Point

Information Domain Values Weight Count Total count

[Weight * Count]

No of User Inputs 46 4 184

No of User Outputs 32 5 160

Number of User Inquiries 9 4 36

No of Logical Files 21 10 210

No of External Interfaces 3 7 21

Count Total 611

Function Point (FP) = Count Total * Complexity Multiplier [4]

= 611* [0.65 + 0.01 *∑ଵସ


ଵ ‫ܨ‬௜]

= 611* 1.07

= 653.77 ≈ 654

Average productivity = 10 FP / pm

Labor Rate = Rs. 15000 per month

ி௉ ଺ହସ
Effort = = ≈ 66
஺௩௘௥௔௚௘ ௉௥௢ௗ௨௖௧௜௩௜௧௬ ଵ଴

௅௔௕௢௥ ோ௔௧௘ ଵହ଴଴଴


Total Project Cost =‫∗ ܲܨ‬ = 654 ∗ = ܴ‫ݏ‬. 9,81,000
஺௩௘௥௔௚௘ ௉௥௢ௗ௨௖௧௜௩௜௧௬ ଵ଴

28
Stock Management System

 The value of the count and the count multiplier used is average.
 Number of user inputs
Each user input that provides distinct application oriented data to the software is counted.
 Number of user outputs
Each user output that provides application oriented information to the user is counted. In
this context "output" refers to reports, screens, error messages, etc. Individual data items
within a report are not counted separately.
 Number of user inquiries
An inquiry is defined as an on-line input that results in the generation of some immediate
software response in the form of an on-line output. Each distinct inquiry is counted.
 Number of files
Each logical master file is counted.
 Number of external interfaces
All machine-readable interfaces that are used to transmit information to another system
are counted.

29
Stock Management System

7.2 LINE OF CODE

Using Lines of Code metric, the project size is estimated by counting the number of
source instructions in the developed program.

Estimated LOC = 5329

Average Productivity = 100 LOC/pm

Labor Rate = Rs 15000 per month

Now,

Estimated Project Cost = Estimated LOC * Cost/LOC [4]

௅௔௕௢௥ ோ௔௧௘
= 5329 *
஺௩௘௥௔௚௘ ௉௥௢ௗ௨௖௧௜௩௜௧௬

ଵହ଴଴଴
= 5329 * ଵ଴଴

= Rs 7, 99,350

௄௅ை஼
Estimated Efforts = [4]
஺௩௘௥௔௚௘ ௉௥௢ௗ௨௖௧௜௩௜௧௬

ହଷଶଽ
= ≈ 54
ଵ଴଴

30
Stock Management System

8. TESTING

We wanted to make sure that all the elements of the developed worked functioned properly. For this,
we created a test plan for our work, in which elements such as validation, reliability and user acceptance
will be tested. The system will be tested for normal condition, primarily.

Testing was performed on each unit.

8.1 TESTING TABLE

Test Form Test Expected Result Actual Result Evide


No. nce

1. Login Invalid Username/Password Username/Password Test


Password is not correct is not correct 1.1
message. message.

2. Add Leave one of Error message Error message Test


Product the required 2.1
Details fields empty

3. Add Fill all Data saved Data saved Test


Product details successfully successfully 2.2
Details correctly message message

4. Update Leave one of Enter required field Enter required field Test
Product the required message message 3.1
Details fields empty

5. Update Fill all Data updated Data updated Test


Product details successfully successfully 3.2
Details correctly message message

31
Stock Management System

6. Remove Delete Product deleted Product deleted Test


Product selected message message 4.1
Details product/s

7. Enter Leave one of Error message Error message Test


Company the required 5.1
Details fields empty

8. Enter Fill all Data saved Data saved Test


Company details successfully successfully 5.2
Details correctly message message

9. Update Leave one of Error message Error message Test


Company the required 6.1
Details fields empty

10. Update Fill all Data updated Data updated Test


Company details successfully successfully 6.2
Details correctly message message

11. Remove Delete Company details Company details Test


Company selected deleted message deleted message 7.1
Details company

12. Create a Enter Correct error/s to Correct error/s to Test


New existing create user message create user message 8.1
User Username or
leave other
field/s empty

13. Create a Enter a New user created New user created Test
New unique successfully successfully 8.2
User Username message message
and fill all
the fields

32
Stock Management System

14 Update Enter un- Username and Username and Test


User matching password not correct password not correct 9.1
Details username message message
and
password
pair

15. Update Enter Password changed Password changed Test


User matching successfully successfully 9.2
Details username message message
and
password
pair and fill
new
password
fields

16. Remove Enter non- User does not exist User does not exist Test
User existing message message 10.1
username

17. Remove Enter User removed User removed Test


User existing successfully successfully 10.2
username message message

18. Billing Enter id and If product’s stock If product’s stock Test


quantity of level is less than 50, level is less than 50, 11.1
product to stock level is less stock level is less
be sold and than 50, reorder than 50, reorder
press print soon message soon message

33
Stock Management System

8.2 LIST OF TESTING

All the testing is shown below:

1. Form: Login

Test 1.1

Purpose: To know what happens if either username or password is typed incorrectly.

Input: Incorrect username/password.

Expected Output: Username/password is not correct message.

Fig. 8.1 Output: Message displaying username/password is not correct

34
Stock Management System

2. Form: Add Product Details

Test 2.1

Purpose: To know what happens if either of the required fields is left empty.

Input: Left the price field empty.

Expected Output: Error Message pops up.

Fig 8.2 Output: Error Message

35
Stock Management System

Test 2.2

Purpose: To know what happens if all the required field/s are filled correctly.

Input: Product ID, Product Name, Manufacture Date, Expire Date, Quantity, Price.

Expected Output: Data Saved successfully message.

Fig 8.3 Output: Data saved successfully message

36
Stock Management System

3. Form: Update Product Details

Test 3.1

Purpose: To know what happens if either of the required fields is left empty.

Input: Left the price field empty.

Expected Output: Enter required field Message.

Fig 8.4 Output: Enter required field message.

37
Stock Management System

Test 3.2

Purpose: To know what happens if all the required field/s are filled correctly.

Input: Product ID, Product Name, Manufacture Date, Expire Date, Quantity, Price.

Expected Output: Data updated successfully message.

Fig. 8.5 Output: Data Updated Successfully

38
Stock Management System

4. Form: Remove Product Details

Test 4.1

Purpose: To know what happens when deleting a specified product’s details.

Expected Output: First the user is asked, if he is sure about the delete action. If he
clicks yes, the product is removed else the dialog box closes.

Fig. 8.6 Output: Product deleted message

39
Stock Management System

5. Form: Enter Company Details

Test 5.1

Purpose: To know what happens if either of the required fields is left empty.

Input: Left the phone number field empty.

Expected Output: Error Message pops up.

Fig 8.7 Output: Error Message

40
Stock Management System

Test 5.2

Purpose: To know what happens if all the required field/s are filled correctly.

Input: Company Name, Email, Phone Number and Address.

Expected Output: Data Saved successfully message.

Fig. 8.8 Output: Data saved successfully message

41
Stock Management System

6. Form: Update Company Details

Test 6.1

Purpose: To know what happens if either of the required fields is left empty.

Input: Left the phone number field empty.

Expected Output: Error Message.

Fig 8.9 Output: Error message

42
Stock Management System

Test 6.2

Purpose: To know what happens if all the required field/s are filled correctly.

Input: Company Name, Email, Phone Number and Address

Expected Output: Data updated successfully message.

Fig. 8.10 Output: Data updated successfully

43
Stock Management System

7. Remove Company Details

Test 7.1

Purpose: To know what happens when deleting a specified company’s details.

Expected Output: First the user is asked, if he is sure about the delete action. If he
clicks yes, the product is removed else the dialog box closes.

Fig 8.11 Output: Company details deleted

44
Stock Management System

8. Form: Create a New User

Test 8.1

Purpose: To know what happens if either of the required fields is left empty or an
existing username is entered.

Input: Entered existing username and left the remaining fields empty.

Expected Output: Error Message pops up.

Fig. 8.12 Output: Correct errors to create user message

45
Stock Management System

Test 8.2

Purpose: To know what happens if all the required field/s are filled correctly and a
non-existing username is entered.

Input: Username, Password and Post

Expected Output: New user created successfully message.

Fig. 8.13 Output: New user created successfully message

46
Stock Management System

9. Form: Update User Detail

Test 9.1

Purpose: To know what happens if all we try to change password without matching
the username and password pair.

Input: Un-matching username and password pair.

Expected Output: Username and password not correct message.

Fig 8.14 Output: Username and password not correct message

47
Stock Management System

Test 9.2

Purpose: To know what happens if all we try to change password by entering all the
fields correctly.

Input: Matching username and password pair and new password.

Expected Output: Password changed successfully message.

Fig 8.15 Output: Password changed successfully message

48
Stock Management System

10. Form: Remove User

Test 10.1

Purpose: To know what happens if all we enter non-existing username to delete.

Input: Non-existing username.

Expected Output: Username does not exit message.

Fig 8.16 Output: Username does not exit message

49
Stock Management System

Test 10.2

Purpose: To know if an existing username can be deleted.

Input: Existing username.

Expected Output: User removed successfully message.

Fig. 8.17 Output: User removed successfully message

50
Stock Management System

11. Form: Billing

Test 11.1

Purpose: To know what happens if we sell product whose stock level is less than
50.

Input: Product Id, Quantity.

Expected Output: Stock level is below 50, reorder soon message.

Fig. 8.17 Output: Stock level is below 50. Reorder soon message

51
Stock Management System

9. GANTT CHART

Fig. 9.1 Gantt Chart

The project schedules has been followed as per requirements and time constraints involved. The
table does not include numerous informal conversations with the user of the system which had
further aided in the development of the system.

52
Stock Management System

10. CONCLUSION AND FUTURE EXTENSION

Stock Management System has the potential to computerize the overall process of a business.
With some minor change to be done in the project, it will be completed in one month with
documentation and made available to the possible customers. The future extensions for the
project are:

 To send an automated e-mail to the suppliers when the stock level gets below a certain
specified value.

 Concurrent updates from users over different networks.

53
Stock Management System

11. BIBLIOGRAPHICAL REFERENCE

[1] Cay S. Horstmann, Gary Cornell, Ninth Edition, Core Java Volume I – Fundamental,
ISBN 9780137081899, Pearson Education Inc, 2013

[2] Cay S. Horstmann, Gary Cornell, Ninth Edition, Core Java Volume II – Advanced
Features, ISBN 9780137081608, Pearson Education Inc, 2014

[3] Herbert Schildt, Eight Edition, Java The Complete Reference, McGraw Hill, 2011

[4] Roger S. Pressman, Ph.D., Seventh Edition, Software Engineering: A Practitioner’s


Approach, McGraw Hill, 2010

[5] Jaspersoft Community, 'Documentation', 2015. [Online]. Available:


https://community.jaspersoft.com/documentation?version=13758. [Accessed: 09- Apr- 2015].

[6] D. Roy, Eclipse.org, 2015. [Online]. Available:


http://www.eclipse.org/documentation/. [Accessed: 09- Apr- 2015].

[7] Mkyong.com, 'Java SHA Hashing Example', 2010. [Online]. Available:


http://www.mkyong.com/java/java-sha-hashing-example/. [Accessed: 09- Apr- 2015].

[8] Crackstation.net, 'Secure Salted Password Hashing - How to do it Properly', 2015.


[Online]. Available: https://crackstation.net/hashing-security.htm. [Accessed: 09- Apr- 2015].

[9] G. Kowal, 'Launch4j - Cross-platform Java executable wrapper',


Launch4j.sourceforge.net, 2015. [Online]. Available: http://launch4j.sourceforge.net/.
[Accessed: 09- Apr- 2015].

[10] Stackoverflow.com, 'Newest Questions', 2015. [Online]. Available:


http://stackoverflow.com/questions. [Accessed: 09- Apr- 2015].

[11] Postgresql.org, 'PostgreSQL: Documentation', 2015. [Online]. Available:


http://www.postgresql.org/docs/. [Accessed: 09- Apr- 2015].

[12] Tutorialspoint.com, 'PostgreSQL Tutorial', 2015. [Online]. Available:


http://www.tutorialspoint.com/postgresql/index.htm. [Accessed: 09- Apr- 2015].

[13] Tutorialspoint.com, 'SQLite Tutorial', 2015. [Online]. Available:


http://www.tutorialspoint.com/sqlite/index.htm. [Accessed: 09- Apr- 2015].

54
Stock Management System

[14] D. Ltd., 'Jar File Download examples (example source code) Organized by topic',
Java2s.com, 2015. [Online]. Available: http://www.java2s.com/Code/Jar/CatalogJar.htm.
[Accessed: 09- Apr- 2015].

[15] Draw.io, 'Flow Chart Maker & Online Diagram Software', 2015. [Online]. Available:
https://www.draw.io/. [Accessed: 09- Apr- 2015].

55
Stock Management System

APPENDIX A

SYSTEM SNAPSHOT

viii
Stock Management System

ix
Stock Management System

x
Stock Management System

xi
Stock Management System

xii
Stock Management System

APPENDIX B

CODE LISTING

1. Connection

package main;

import java.sql.Connection;
import java.sql.DriverManager;

import javax.swing.JOptionPane;

public class PostgresqlConnection {


Connection conn= null;
public static Connection dbConnector()
{
try{
Class.forName("org.postgresql.Driver"); [2]
return
DriverManager.getConnection("jdbc:postgresql://localhost:5432/postgres","postgres",
"admin");
}catch (Exception e)
{
JOptionPane.showMessageDialog(null, e);
return null;
}
}
}

xiii
Stock Management System

2. Add Company Details

public void save(){


// save details

try {

connection = PostgresqlConnection.dbConnector();
System.out.println(connection);

String query = "insert into tblcompany (company_name, address,


phone_no, email) values (?, ?, ?, ?)";
PreparedStatement pst = connection.prepareStatement(query);
String comp_name = txtcompanyname.getText();

//check if company name is empty


if (comp_name.isEmpty()){
txtcompanyname.setBorder(
BorderFactory.createLineBorder(Color.red));
lblcomperror.setVisible(true);
lblcomperror.setText("Company name cannot be empty");
lblcomperror.setForeground (Color.red);

//check if company name already exists


else{
try {
String query2 = "select company_name from
tblcompany where company_name= '"+comp_name+"'";
PreparedStatement pst2=
connection.prepareStatement(query2);
ResultSet rs2= pst2.executeQuery();

if (rs2.next()){
lblcomperror.setVisible(true);
lblcomperror.setText("Company name already
exists");
}
else{
txtcompanyname.setBorder( border);
lblcomperror.setVisible(false);
}
pst2.close();
rs2.close();
} catch (SQLException ex) {

xiv
Stock Management System

// TODO Auto-generated catch block


ex.printStackTrace();
}

pst.setString(1, comp_name);

pst.setString(2, txtaddress.getText());

String comp_phone = txtphone.getText();


//check if phone number is empty
if (comp_phone.isEmpty()){
txtphone.setBorder(
BorderFactory.createLineBorder(Color.red));
lblphone_error.setVisible(true);
lblphone_error.setText("Phone number cannot be empty");
lblphone_error.setForeground (Color.red);

}
else{
txtphone.setBorder( border);
lblphone_error.setVisible(false);
comp_phone= txtphone.getText();
}

pst.setString(3, comp_phone);

//check if the entered email is in correct pattern

if (txtemail.getText().isEmpty()){
lblemail_error.setText("");
txtemail.setText("user@gmail.com");
}else{
String EMAIL_PATTERN = "^[a-zA-Z0-9]{1,20}@[a-zA-Z0-
9]{1,20}.[a-zA-Z]{2,3}$";
Pattern pattern = Pattern.compile(EMAIL_PATTERN);
Matcher regexMatcher = pattern.matcher(txtemail.getText());

if (!regexMatcher.matches()){

lblemail_error.setText("Email Format is not correct");


lblemail_error.setForeground (Color.red);
txtemail.setBorder(
BorderFactory.createLineBorder(Color.red));

xv
Stock Management System

}else{
txtemail.setBorder( border);
lblemail_error.setText("");
}
}

pst.setString(4, txtemail.getText());
//check if there is any error in the program
if (lblcomperror.isVisible() ||lblphone_error.isVisible()){
JOptionPane.showMessageDialog(null,
"ERROR/S","Error",JOptionPane.ERROR_MESSAGE);

}else{
pst.execute();
JOptionPane.showMessageDialog(null, "Data Saved
Successfully");
}

pst.close();

} catch (SQLException ex) {

ex.printStackTrace();
}
}

xvi
Stock Management System

3. Login

public void login_submit(){

String obtain_post;
int count = 0;
if (txtusername.getText().isEmpty()|| txtpassword.getText().isEmpty()){
count=3;
}

try {
String hash = Hashing.HashCode(new String(txtpassword
.getPassword()));

String query = "select * from tbluser where username=? and


password=?";
PreparedStatement pst = connection.prepareStatement(query);
pst.setString(1, txtusername.getText());
pst.setString(2, hash);// changing character arrary to
// string
// do not use depreciated menthods //methods with crossed
// line are deprecated

ResultSet rs = pst.executeQuery();

if (rs.next()) {
count++;
if (count == 1) {

obtain_post = rs.getString("post");
dispose();// closes current window

// provide access to menu item on the basis of


// user's post

MenuWindow m = new MenuWindow();

switch (obtain_post.replaceAll("\\s+", "")) {


case "Admin":
m.mnFile.setEnabled(true);
m.mnUser.setEnabled(true);
m.mnHelp.setEnabled(true);
m.mnReport.setEnabled(true);
m.mnProduct.setEnabled(false);
m.mnCompany.setEnabled(false);

xvii
Stock Management System

m.mnBilling.setEnabled(false);
break;
case "Marketing_Manager":
m.mnFile.setEnabled(true);
m.mnHelp.setEnabled(true);
m.mnCompany.setEnabled(true);
m.mnProduct.setEnabled(true);
m.mnUser.setEnabled(false);
m.mnReport.setEnabled(false);
m.mnBilling.setEnabled(false);
break;
case "Sales_Operator":
m.mnFile.setEnabled(true);
m.mnHelp.setEnabled(true);
m.mnBilling.setEnabled(true);
m.mnProduct.setEnabled(false);
m.mnCompany.setEnabled(false);
m.mnUser.setEnabled(false);
m.mnReport.setEnabled(false);
break;
default:
break;
}
m.setVisible(true);
}

if (count != 1) {

JOptionPane.showMessageDialog(null,"username/password is
not correct");
}

rs.close();
pst.close();
} catch (Exception e) {
JOptionPane.showMessageDialog(null, e);

xviii
Stock Management System

4. Get Stock Level

package product;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import main.PostgresqlConnection;

public class GetStockLevel {


static int stock;
public static int StockLevel(String product_id_){

try{

Connection connection=null;
connection = PostgresqlConnection.dbConnector();

String query2 ="select stock_level from tblstock where product_id =


'"+product_id_+"'";

PreparedStatement pst2 = connection.prepareStatement(query2);


ResultSet rs2 = pst2.executeQuery();
while (rs2.next()){
stock= rs2.getInt("stock_level");
}
pst2.close();
rs2.close();

}catch(Exception ex){
ex.printStackTrace();
}
return stock;
}

xix

Potrebbero piacerti anche