Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
ABSTRACT
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
ER Entity Relationship
Fig Figure
FP Function Point
MS Microsoft
iii
Stock Management System
LIST OF FIGURES
iv
Stock Management System
Figure 8.18: Output: Stock level is below 50. Reorder soon message .................................... 51
v
Stock Management System
LIST OF TABLES
vi
Stock Management System
TABLE OF CONTENTS
Abstract .......................................................................................................................................i
Acknowledgement .....................................................................................................................ii
List of Figures................................................................................................................................. iv
1. Introduction ......................................................................................... 1
5. Methodology...................................................................................................................... 16
vii
Stock Management System
7. Budget..................................................................................................................28
8. Testing ..................................................................................................................31
9. Gantt Chart......................................................................................................................... 52
viii
Stock Management System
1. INTRODUCTION
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.
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.
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
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.
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.
The new system should maintain the record in neat and clean way.
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.
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.
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.
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
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
Department
Participate in analysis, requirement
Process Experts
gathering, & preparation of specifications
Identify improvement opportunities
Define test case scenarios
6
Stock Management System
4. REQUIREMENT
Functionality
What functionality is required from the new system?
Automatic Input:
SoldID is automatically generated.
Date of Sold items is automatically current date.
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
a. MS flex-grid
b. Save sold, re-order and ordered report
c. Photo of each 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
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.
9
Stock Management System
Data Required
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.
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
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.
11
Stock Management System
12
Stock Management System
13
Stock Management System
Output objectives
14
Stock Management System
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.
These are the minimum requirements for running the Computerized Stock Management System.
15
Stock Management System
5. METHODOLOGY
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]
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.
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.
From the above three option in using the software for program development, we
prefer to use A Programming Language along with RDBMS.
17
Stock Management System
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:
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:-
19
Stock Management System
The context diagram represents the overall explanation of the system ‘Stock Management
System’.
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
20
Stock Management System
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.
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
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.
22
Stock Management System
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.
23
Stock Management System
24
Stock Management System
25
Stock Management System
Preview Bill
26
Stock Management System
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:
27
Stock Management System
7. BUDGET
[Weight * Count]
No of External Interfaces 3 7 21
= 611* 1.07
= 653.77 ≈ 654
Average productivity = 10 FP / pm
ி ହସ
Effort = = ≈ 66
௩ ௗ௨௧௩௧௬ ଵ
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
Using Lines of Code metric, the project size is estimated by counting the number of
source instructions in the developed program.
Now,
ோ௧
= 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.
4. Update Leave one of Enter required field Enter required field Test
Product the required message message 3.1
Details fields empty
31
Stock Management System
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
16. Remove Enter non- User does not exist User does not exist Test
User existing message message 10.1
username
33
Stock Management System
1. Form: Login
Test 1.1
34
Stock Management System
Test 2.1
Purpose: To know what happens if either of the required fields is left empty.
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.
36
Stock Management System
Test 3.1
Purpose: To know what happens if either of the required fields is left empty.
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.
38
Stock Management System
Test 4.1
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.
39
Stock Management System
Test 5.1
Purpose: To know what happens if either of the required fields is left empty.
40
Stock Management System
Test 5.2
Purpose: To know what happens if all the required field/s are filled correctly.
41
Stock Management System
Test 6.1
Purpose: To know what happens if either of the required fields is left empty.
42
Stock Management System
Test 6.2
Purpose: To know what happens if all the required field/s are filled correctly.
43
Stock Management System
Test 7.1
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.
44
Stock Management System
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.
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.
46
Stock Management System
Test 9.1
Purpose: To know what happens if all we try to change password without matching
the username and password pair.
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.
48
Stock Management System
Test 10.1
49
Stock Management System
Test 10.2
50
Stock Management System
Test 11.1
Purpose: To know what happens if we sell product whose stock level is less than
50.
Fig. 8.17 Output: Stock level is below 50. Reorder soon message
51
Stock Management System
9. 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
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.
53
Stock Management System
[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
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;
xiii
Stock Management System
try {
connection = PostgresqlConnection.dbConnector();
System.out.println(connection);
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
pst.setString(1, comp_name);
pst.setString(2, txtaddress.getText());
}
else{
txtphone.setBorder( border);
lblphone_error.setVisible(false);
comp_phone= txtphone.getText();
}
pst.setString(3, comp_phone);
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()){
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();
ex.printStackTrace();
}
}
xvi
Stock Management System
3. Login
String obtain_post;
int count = 0;
if (txtusername.getText().isEmpty()|| txtpassword.getText().isEmpty()){
count=3;
}
try {
String hash = Hashing.HashCode(new String(txtpassword
.getPassword()));
ResultSet rs = pst.executeQuery();
if (rs.next()) {
count++;
if (count == 1) {
obtain_post = rs.getString("post");
dispose();// closes current window
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
package product;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import main.PostgresqlConnection;
try{
Connection connection=null;
connection = PostgresqlConnection.dbConnector();
}catch(Exception ex){
ex.printStackTrace();
}
return stock;
}
xix