Purchase Stock and Sales Management System
Purchase Stock and Sales Management System
R052038
0520381
KASUN RANASINGHE
November 2017
ii
ABSTRACT
Information technology plays a major role in present society. Varieties of fields are getting
advantages by using information technology. Business and distribution is one of developed field
via Information technology. In a business massive number of information is taking in and out. So
human being cannot manage all the data in a manual way. It wastes time, decrease efficiency,
overload paper works and increase the cost as well. Information technology is the answer for this
type of problems.
The client Gishani Distributors is a sales agent in Horana area, Kaluthara district. They purchase
confectionery items from the Uswatte Confectionary Works (pvt) Limited (UCWPL). They store
the confectionery items and distribute within their area with the support of sales representative
who is appointed by the UCWPL. Generally the client purchase items for a week. They order
variety of products at once. They manage all store records in manually. It was chaotic matter to
the management when they reordering items and stock controlling. Author recognized that they
need systematic program to manage the purchase, stock and sales.
By using this system user can manage category, packing, item, expenses and customer details easily.
As well as Purchase orders, purchase invoices and sales invoices can manage using this system. Also
this system facilitates the user to generate different kind of reports. Such as expenses for given
period, available stock, sales for given period etc. Only authorized users can access the system.
According to the present software engineering theories and by studying the problem domain, the
Rational Unified Process (RUP) was identified as the most suitable development methodology.
Java selected as the programming language, Intelij Idea is selected as IDE and MySql for
database management. Also JSP, HTML5, JavaScript, CSS, JQuery, Bootstrap, Spring and
Hibernate is used to develop the system.
The new web based purchase, stock and sales management system will fulfill the user and
system requirements. The System will increase efficiency and accuracy of the process.
iii
Acknowledgement
First of all I would like to express my gratitude and thankful to the BIT Coordinators and academic
staff of University of Colombo School of Computing (UCSC) for giving us valuable degree and
providing us a good guidance continuously.
Special thank must go to my project supervisor Mr Kasun Ranasinghe for his assistance and guidance.
I would like to thanks my client Ms Surangi Jayakodi and her staff for giving me a great support to
complete my project successfully.
I also extend my heartfelt thanks to my wife. Without her support success of the project would have been a
distant reality. I am obliged to my family members for the constant support, encouragement and the
guidance given to complete this project.
iv
TABLE OF CONTENT
DECLARATION ................................................................................................................ ii
ABSTRACT....................................................................................................................... iii
ACKNOWLEDGEMENT ................................................................................................. iv
TABLE OF CONTENT ...................................................................................................... v
LIST OF FIGURES .......................................................................................................... vii
LIST OF TABLE ............................................................................................................... ix
CHAPTER 1 – INTRODUCTION ..................................................................................... 1
1.1 Gishani Distributors .................................................................................................. 1
1.2 Motivation of the Project .......................................................................................... 2
1.3 Objectives of the System ........................................................................................... 3
1.4 Scope of the System .................................................................................................. 3
1.5 Structure of the Dissertation...................................................................................... 6
CHAPTER 2: ANALYSIS ................................................................................................. 7
2.1 Introduction ............................................................................................................... 7
2.2 Requirement gathering techniques ............................................................................ 7
2.3 Analyzing the Current Manual System………………………………………….…10
2.3.1 Following activities identified in the existing manual system………………...10
2.3.2 Use case diagram for the existing system……………………………………..10
2.4 Drawbacks of the existing System. ......................................................................... 11
2.5 Similar systems ....................................................................................................... 12
2.6 Functional Requirements of the System ................................................................. 15
2.7 Non Functional Requirements of the System.......................................................... 16
CHAPTER 03–DESIGN................................................................................................... 18
3.1 Introduction ............................................................................................................. 18
3.2 Process Models........................................................................................................ 18
3.3 Process Models for the system ................................................................................ 18
3.3.1 Advantages of RUP .......................................................................................... 19
3.4 Software Design Strategies ..................................................................................... 20
3.5 Why web based application .................................................................................... 23
3.5.1 User Interface design ........................................................................................ 29
v
CHAPTER 4 – IMPLEMENTATION ............................................................................. 34
4.1 Introduction ............................................................................................................. 34
4.2 Hardware and Software Requirements.................................................................... 34
4.2.1 Hardware Requirements ................................................................................... 34
4.2.2 Software Requirements .................................................................................... 34
4.3 Other frameworks and development tools .............................................................. 36
4.4 System Architecture ................................................................................................ 37
4.4.1 Overview of Spring layered Architecture ......................................................... 38
4.4.2 Overview of Spring MVC Architecture ........................................................... 38
4.4.3 Package Structure……………….......................................................................40
CHAPTER 05: EVALUATION ....................................................................................... 49
5.1 Introduction ............................................................................................................. 49
5.2 Types of Testing ...................................................................................................... 49
5.2.1 Unit Testing…………………………………………………………………....49
5.2.2 Integration Testing…………………………………………………………….49
5.2.3 System Testing………………………………………………………………...50
5.2.4 Acceptance Testing…………………………………………………………....50
5.3.5 Regression Testing…………………………………………………………….50
5.3 System Plan ............................................................................................................ 50
5.4 User AcceptanceTesting.......................................................................................... 53
CHAPTER 06: CONCLUSION ....................................................................................... 54
6.1 Introduction ............................................................................................................. 54
6.2 Future Enhancement................................................................................................ 54
6.3 Lessons Learnt ........................................................................................................ 55
References ......................................................................................................................... 56
Appendix A-System Documentation ................................................................................ 58
Appendix C-User Documentation .................................................................................... 61
Appendix D-Management Reports ................................................................................... 67
Appendix E-Test Results .................................................................................................. 69
Appendix F-Code Listing ................................................................................................. 73
Appendix G – Customer Certification...............................................................................77
vi
List of Figures
viii
List of Tables
ix
List of Acronyms
PC – Personal Computer
OS – Operating System
EE – Enterprise Edition
EL – Expression Language
x
CHAPTER 1 – INTRODUCTION
Gishani distributers is one of the sales agents of Uswatte Confectionary works (Pvt)
Limited (UCWPL). They purchase confectionery items from the UCWPL. For the
purchase invoice Gishani distributors get a discount percentage. All the purchase
items are stored in their own stores. UCWPL has appointed a sales executive for each
sales agent. Responsibility of the sales executive is to do sales in the area defined by
UCWPL. Sales executive do the sales through the bike offered by UCWPL.
Responsibility of the Gishani distributors is to distribute confectionery items
according to the sales orders taken by Sales executive and collect the payments.
Gishani distributors own a Lorry to distribute the confectionery items. Currently two
employees work for them, Cash collector and the driver. Responsibility of the cash
collector is to hand over the items to each shop and collect the payments. Also if there
are any market return goods (damaged, expired) those items need to be collected by
him.
End of the day cash collector has to hand over the collected money and all the sales
invoices to the Gishani distributors.
Gishani distributors distribute various types of confectioneries such as marshmallows,
Fruit tablets, Jelly pack, peppermints, tip tips and wafer biscuits etc. Their regular
customers are co-op cities, food cities and other confectionary shops.
1
1.2 Motivation of the Project
Gishani distributors make purchase order once a week. They have to identify the
balance stock end of the each week to make the next purchase order. They use hand
written stock books to keep the track of the balance stock. To manage daily expenses
and identify monthly expenses they do the paper work by manually. Sales are done by
cash, credit or cheque. Gishani distributors has the authority to decide whether sales
do for credit or not. That is done by looking at the customer’s payment history.
Confectionary industry has lot of competing companies as well. Author analyzed the
problem according to the SWOT analysis theory. The main weakness of the client is
they do not have a proper purchase, stock, sales and cash management system. Time
wasting problems, stock recording infirmities, data updating weaknesses of the
Gishani distributors motivated the author to continue the project. Below are the main
concerns.
2
1.3 Objectives of the System
The main objective of this system is to provide a proper mechanism to manage the day to
day activities of the Gishani distributors which is done manually at present. And further
to increase their productivity and efficiency of their work through the proposed software
solution. Following are the other objectives of the system.
Maintain confectionery item inventory without having heavy paper work.
Improve the efficiency of finding category, packing, confectionery item, expenses
and customer details.
Easily manage purchase orders and sales orders by looking at the available
confectionery item stock.
Ensure the safety of the customer details and transaction details history.
Ensure the accuracy of the cash, credit, cheque balance and other system
information.
Maximize the profit margin by maintaining daily expenses and income.
Generate expense, income and sales reports to take management decisions.
3
Sales Management
Responsibility of the Gishani distributors is to deliver the purchase items to the market
(food city, shops etc). For the sales invoice sales executive can give free items and
discounts up to a certain limit. Based on the sales, stock has to be updated accordingly.
These things need to be captured by the proposed software solution.
Stock Management
Based on the purchase and sales system will automatically update the balance stock. User
shall be able to see the balance stock.
Customer management
All the customers who are dealing with Gishani distributors has to be feed into the
system. Such that when need to contact customer easily can find the information through
the system.
4
Expenses management
Managing vehicle expenses, salary expenses and all other expenditures is important to
calculate the profit of the business.
User Management
Provide a login module for Gishani distributors as well as to sales executive and cash
collector. Users are grouped by user role. Only administrative user can manage other
users. That means if there is a need to add new user or remove the existing user that
feasibility is given for the administrative user.
5
1.5 Structure of the Dissertation
This dissertation provides the overall knowledge of the purchase, stock and sales
management system. The dissertation consists six main chapters.
Chapter one describes about the client, objectives of the project, motivation of the project
and scope of the project.
Chapter two explains the requirement gathering techniques, function and non-functional
requirements of the proposed software solution. Top level Use-Case diagrams are used to
take a deep idea about the system.
Chapter three design based on the requirement analysis. This chapter explains the UML
diagrams of the proposed system, database design and the user interfaces of the system.
Forth chapter implementation explains how to do the coding according to the requirement
analysis and design. Also this included the Hardware and software requirements to run
the system.
Chapter five describes how the implement system should be tested is described in this
chapter; such as test cases planning, applying different testing methodologies to test the
accuracy of the system. User acceptance testing is also carried out at this stage.
Last chapter conclusion explains the critical evaluation of the solution and lessons learnt
from the overall project work developed software.
6
CHAPTER 2: ANALYSIS
2.1 Introduction
Gathering business requirements is a critical first step for every project. Creating a complete set
of requirements up front enables better planning, more accurate cost estimates, shorter delivery
cycles, improved customer satisfaction and adoption of the final product.
There are lots of requirement gathering techniques to identify the business requirements.
Following requirements gathering techniques has been chosen to identify the business
requirements.
Interviews
“Interviews are primary ways for information gathering where the system analyst will have face-
to-face interaction with relevant stakeholders or subject matter experts. The business analyst will
spend most of the time to interview system users and system owner during the early stages of
project life cycle.”[1]
It is important to be very clearly articulate of the objectives of interviews and the questions could
be prepared ahead of time or asked spontaneously and the responses should be recorded.
Interviews could also be done with multiple interviewers and / or multiple interviewers.
Interviews could be either one on one or group interviews.
Observations
“Observation or job shadowing involves an analyst watching their client performing their daily
tasks and asking questions about what they are doing and why. It is a great way to understand
what the user might go through in their job and can provide some immediate requirements for
how a process can be improved.”[1]
7
Prototyping
“In this approach, the preliminary requirements will be gathered which is used to build an initial
version of the solution called a prototype. The prototype may not have all the functionality but
serves as a proof of concept for idea verification/further analysis. An iterative process of
prototype creation, testing and feedback is followed before reaching a final stage.”[1]
This repetitive process continues until the product meets the final goal of business for an agreed
number of iterations.
Documentation Analysis
“The technique involves written documentation of procedures and tasks that often exist,
particularly in business contexts. It describes how things should be done rather than how they
are. This also helps the Business Analyst to prepare questions for validating the requirement
correctness and completeness. Most of the information is mostly buried in present documents
that assist us in putting questions as a part of validating the requirement completeness.”[1]
The core of system analysis is to get as much as information needed to develop the system.
Hence it is in our hands in deciding which techniques will best do the job in the time and with the
resources available. During the requirement gathering, the analyst will identify what types of
techniques will be used and what type of information will collected.
Questionnaires
“It is an informal technique in which a document is used to collect information and opinion
from respondents. It allows the system analyst to collect information from a target population
which is very large and in remote locations or those who will have only minor input into the
overall requirements. The responses could be sent for further statistical analysis if needed. It
makes clear and specific questions and involves some closed questions with a range of answers.”
[1]
8
When having the discussion with the sales executive, he wanted to send a report to the UCWPL
which should contain the daily sale figures. Figure 2.1 created and given to the sales executive in
the requirement gathering stage to do his job easily. That was helpful to understand the exact
requirements. Google sheet is like Microsoft excel but advantage of the Google sheet, you can
feed data from the mobile phone which has android operation system.
9
2.3 Analyzing the Current Manual System.
Calculate the items that have to be release from stock for next working day.
Handover sales items to the customer via lorry and collect payments.
Collect the cash of the credit bills.
Figure 2.2 describes the existing functionalities of the Gishani Distributors. Owner, Stock keeper,
Sales Executive, Driver and Cash collector are the main roles involved in day today activates.
According to the Figure 2.2 most of the responsibilities and duties are handled by the owner.
Cash collector and sales executive are doing major roles in this business. But Driver does not
play a major role
10
Usercase diagram for the existing system
2.4.1 The following drawbacks have been identified in the existing manual system.
11
2.5 Similar systems
Found some similar systems but some systems are not free. Some systems do not satisfy most
of the requirements requested by Gishani distributors. It was very helpful to get a good
understating about purchase, stock and sales management systems by studying similar
systems.
InFlow [2]
Inflow is a popular, desktop based inventory management system for small and medium
businesses. It can use it to fill and distribute customer orders, reorder stocks, generate
invoices and purchase orders, and to create customized reports. Figure 2.3 shows the InFlow
inventory management system.
Barcode support
Cost tracking
Customizable pricing models
Inventory optimization
Inventory overview
Purchase order management
Reorder management
Supplier management
Shipping management
Inventory management
Stock level monitoring
Order management
Barcode scanning
Packing & shipping
Contact management
Invoicing
Dispatching
Return management
Reporting
Mobile access
Delivrd has one of the best shipping & order fulfillment plans that can be acquired for free. All
main inventory and shipping features are available in this free plan, but users will be limited to
manage up to 25 products per month. Figure 2.5 shows the Delivrd stock management system.
14
2.6 Functional Requirements of the System
Functional user requirements may be high-level statements of what the system should do but
functional system requirements should also describe clearly about the system services in
detail.[3]
Below are the functional requirements that are identified by the author while studying the manual
system.
Category management
System shall be able to add, update, delete and view categories.
Packing management
System shall be able to add, update, delete and view pickings.
Customer management
System shall be able to add, update and delete customer information.
Stock management
System shall be able update stock information according to the purchase and sales.
Expense management
System shall be able manage the daily expenses of the business.
Report management
System shall be able to generate different type of reports.
Non-functional requirements cover all the remaining requirements which are not covered by the
functional requirements. They specify criteria that judge the operation of a system, rather than
specific behaviors, for example: “Modified data in a database should be updated for all users
accessing it within 2 seconds.”
1. Accuracy
This is about system give correct result as expected. As an example available stock in the
2. Modifiability
The ease with which the system can be changed, whether for bug fixes or to add new
functionality. When there is a new requirement that can be developed without having a
big effort.
16
3. Portability
The effort required to move the software to a different target platform. The ease with
which software can be installed on all necessary platforms and the platforms on which it
is expected to run.
4. Reliability
The capability of the software to maintain its performance over time. Unreliable software
fails frequently, and certain tasks are more sensitive to failure (for example, because they
cannot be restarted, or because they must be run at a certain time).
5. Security
System should allow accessing the information to the users who has authorized to access
the information, restricting access to features or data to certain users and protecting the
privacy of data entered into the software.
6. Usability
Usability relates to how easily users can learn how to use a system and how efficient they
are while using it. Highly usable systems reduce the effort required to read or input data
and prevent users from making errors resulting in increased operational efficiency.
17
CHAPTER 03–DESIGN
3.1 Introduction
“A Process Model describes the sequence of phases for the entire lifetime of a product.
Therefore it is sometimes also called Product Life Cycle. This covers everything from the
initial commercial idea until the final de-installation or disassembling of the product after
its use.”[2]
Rational Unified Model (RUP) has selected for the PMS among the other process models.
RUP model emphasizes the elaboration phase, normally taken place after the inception
phase. Design is related to elaboration phase. This phase can identify as foundation of the
system. The primary goal of the Elaboration phase is to prove the architecture for the
system to be developed. This chapter will define how users interact with the system and
how the users are handling their functionalities through system. Figure 3.1 shows the
phases of RUP process model.
18
Figure 3.1 Phases of RUP Process Model
19
3.4 Software Design Strategies
Structured Design
Structured design is mostly based on ‘divide and conquer’ strategy where a problem is broken
into several small problems and each small problem is individually solved until the whole
problem is solved.
The small pieces of problem are solved by means of solution modules. Structured design
emphasis that these modules be well organized in order to achieve precise solution.
Function oriented design inherits some properties of structured design where divide and conquer
methodology is used.
This design mechanism divides the whole system into smaller functions, which provides means
of abstraction by concealing the information and their operation.. These functional modules can
share information among themselves by means of information passing and using information
available globally.
20
Object Oriented Design
Object oriented design works around the entities and their characteristics instead of functions
involved in the software system. This design strategy focuses on entities and its characteristics.
The whole concept of software solution revolves around the engaged entities.
Objects - All entities involved in the solution design are known as objects. For example,
person, banks, company and customers are treated as objects. Every entity has some
attributes associated to it and has some methods to perform on the attributes.
Classes - A class is a generalized description of an object. An object is an instance of a
class. Class defines all the attributes, which an object can have and methods, which
defines the functionality of the object.
In the solution design, attributes are stored as variables and functionalities are defined by
means of methods or procedures.
Encapsulation - In OOD, the attributes (data variables) and methods (operation on the
data) are bundled together is called encapsulation. Encapsulation not only bundles
important information of an object together, but also restricts access of the data and
methods from the outside world. This is called information hiding.
Inheritance - OOD allows similar classes to stack up in hierarchical manner where the
lower or sub-classes can import, implement and re-use allowed variables and methods
from their immediate super classes. This property of OOD is known as inheritance. This
makes it easier to define specific class and to create generalized classes from specific
ones.
Polymorphism - OOD languages provide a mechanism where methods performing
similar tasks but vary in arguments, can be assigned same name. This is called
polymorphism, which allows a single interface performing tasks for different types.
Depending upon how the function is invoked, respective portion of the code gets
executed.
21
Author has selected object oriented design over other strategies by considering below
advantages.
Simplicity: software objects model real world objects, so the complexity is reduced and the
program structure is very clear.
Reusability: Reusability is a desired goal of all development and is based on the reluctance of
reinventing something when it has already been invented.
Increased Quality: Increases in quality are largely a by-product of this program reuse. If 90% of
a new application consists of proven, existing components, then only the remaining 10% of the
code has to be tested from scratch. That observation implies an order-of-magnitude reduction in
defects.
Faster Development: OOD leads to faster development. Many of the claims of potentially
reduced development time are correct in principle.
Maintainable: OOP methods make code more maintainable. Objects can be maintained
separately, making locating and fixing problems easier. The principles of good OOP design
contribute to an application's maintainability.
Scalable: Object oriented applications are more scalable then structured approach. As an object's
interface provides for reusing the object in new software, it also provides all the information
needed to replace the object without affecting other code. This makes it easy to replace old and
aging code with faster algorithms and newer technology.
Modularity: Object-oriented systems have a natural structure for modular design: objects,
subsystems, framework, and so on. Thus, OOD systems are easier to modify. OOD systems can
be altered in fundamental ways without ever breaking up since changes are neatly encapsulated.
Modifiability: It is easy to make minor changes in the data representation or the procedures in an
OO program.
22
3.5 Why web based application
There is no need to develop and test it on all possible operating system versions and
configurations. This makes development and troubleshooting much easier and for web
applications front end is not depending on the operating system as front end is rendered on web
browser.
Accessible anywhere
Unlike traditional applications, web systems are accessible anytime, anywhere and via any PC
with an Internet connection. This puts the user firmly in charge of where and when they access
the application.
It also opens up exciting, modern possibilities such as global teams, home working and real-time
collaboration. The idea of sitting in front of a single computer and working in a fixed location is
a thing of the past with web-based applications.
Easily customizable
The user interface of web-based applications is easier to customize than is the case with desktop
applications. This makes it easier to update the look and feel of the application or to customize
the presentation of information to different user groups.
Therefore, there is no longer any need for everyone to settle for using exactly the same interface
at all times. Instead, you can find the perfect look for each situation and user.
In addition to being customizable for user groups, content can also be customized for use on any
device connected to the internet. This includes the likes of PDAs, mobile phones and tablets.
23
This further extends the user’s ability to receive and interact with information in a way that suits
them. In this way, the up to date information is always at the fingertips of the people who need it.
Improved interoperability
It is possible to achieve a far greater level of interoperability between web applications than it is
with isolated desktop systems. For example, it is much easier to integrate a web-based shopping
cart system with a web-based accounting package than it is to get two proprietary systems to talk
to each other.
Because of this, web-based architecture makes it possible to rapidly integrate enterprise systems,
improving work-flow and other business processes. By taking advantage of internet technologies
you get a flexible and adaptable business model that can be changed according to shifting market
demands.
Rolling out new software can be accomplished more easily, requiring only that users have up-to-
date browsers and plugins. As the upgrades are only performed by an experienced professional to
a single server the results are also more predictable and reliable.
Increasing processor capacity also becomes a far simpler operation with web-based applications.
If an application requires more power to perform tasks only the server hardware needs to be
upgraded.
The capacity of web-based software can be increased by “clustering” or running the software on
several servers simultaneously. As workload increases, new servers can be added to the system
easily.
For example, Google runs on thousands of inexpensive Linux servers. If a server fails, it can be
replaced without affecting the overall performance of the application.
24
Increased Security
Web-based applications are typically deployed on dedicated servers, which are monitored and
maintained by experienced server administrators. This is far more effective than monitoring
hundreds or even thousands of client computers as is the case with desktop applications.
This means that security is tighter and any potential breaches should be noticed far more quickly.
[4]
By considering the above advantages author has decided to come up with a web based solution
for Gishani distributors to fulfill their requirements. One main concern when developing web
based solution is browser compatibility. To resolve the browser compatibility issues author has
selected a frond end framework called Bootstrap and java language as the server side language.
On top of java language another framework (Spring) used to easy the development. All the tools
and frameworks are explained in implementation chapter in detail.
25
Figure 3.2 shows high level use case diagram for the purchase, stock and sales management
system of Gishani distributors. Driver is removed from this use case as he does not involve to
any business related matter.
26
Figure 3.3 shows the class diagram for the proposed system
27
Figure 3.4 shows the ER diagram for the proposed system
28
Figure 3.5 shows the sequence diagram for the user login screen
User interface is the front-end application view to which user interacts in order to use the
software. User can manipulate and control the software as well as hardware by means of
user interface. Today, user interface is found at almost every place where digital
technology exists, right from computers, mobile phones, cars, music players, airplanes,
ships etc. [5]
Attractive
Simple to use
Responsive in short time
Clear to understand
29
Consistent on all interfacing screens
This is a common interface for all users to log into the system. Only authorized users
can access into the system. Following figure 3.6 shows login interface of the system.
Add, Update, Delete and view list of categories can be done via Category page. Figure 3.7 shows the
category page.
30
Like Category page Add, Update, Delete and view list of items handled via Item detail page. Figure 3.8
shows the Item page.
Figure 3.9 shows the list of Purchase Order. From this screen user can view the detail of the selected
purchase order. Also user can edit and delete selected purchase order.
31
Items come with different packings. Figure 3.10 shows the packing page. User can add, update, delete and
view list of packing.
Sales invoice is one of the most important and frequently used user interfaces in the system.
Figure 3.11 shows the Sales invoice. User can select customer, add different items and create
sales Also user can specify discount, Free issues and Market return from this screen. System will
calculate the total based on user input.
Figure 3.13 show the Add expenses. From this screen user can add business expenses.
33
CHAPTER 4 – IMPLEMENTATION
4.1 Introduction
This is the phase where the code is developed according to the analyzed requirements
and the system design. Author has selected different software tools and frameworks to
develop the proposed software solution.
Below author has mentioned the minimum hardware requirements to run the developed
software.
10 GB Hard Disk
4GB RAM
Desktop or Laptop computer with the dual core or above processor.
Java 8 or above
35
4.3 Other frameworks and development tools
Spring framework
Hibernate
Bootstrap
36
jQuery
jQuery is a fast, small, and feature-rich JavaScript library. It makes things like
HTML document traversal and manipulation, event handling, animation, and
Ajax much simpler with an easy-to-use API that works across a multitude of
browsers. With a combination of versatility and extensibility, jQuery has
changed the way that millions of people write JavaScript. [9]
HTML is the standard markup language for creating Web pages. HTML5 is
latest evolution of HTML. HTML5 has incorporated many new APIs and
features like drawing, video playback, and drag-and-drop effects that
developers could only implement before with the help of third-party plug-ins.
CSS stands for Cascading Style Sheets. CSS describes how HTML elements
are to be displayed on screen, paper, or in other media.
JavaScript is the programming language of HTML and the Web. [10]
Spring MVC architecture and the layered architecture are used to develop the code.
Figure 4.1 shows the layered architecture supported by the spring framework.
37
4.4.1 Overview of Spring layered Architecture
It is considered good practice to use modularity across Spring web applications. It keeps them
maintainable and testable. This can be achieved by using controllers, services and repository
objects (DAO). Typically, a user request is handled by a controller, which calls a service, which
calls a data access object, which calls the persistence layer implementation.
38
Figure 4.2 Spring mvc architecture
39
4.4.3 Package Structure
Figure 4.3 shows the package structure which represents the controller, service and DAO layers.
40
According to the Gishani distributors confectionery items are categorized into different
categories.
Figure 4.4 shows the presentation logic to add, update, delete and view list of category.
41
When the code mentioned in figure 4.4 is rendered to the web browser the UI mentioned in
figure 4.5 will be shown to the user.
When user click on the edit button of a selected category “Add Category” button will be changed
to “Update Category” and user can change the name of selected category. Also when user wants
to delete a selected category user can click on the Delete button.
Author has put the comments to understand the method behavior of below class. All the http
requests are coming from the Category page (Figure 4.3) will be handled by CategoryConroller
class mentioned in figure 4.6.
42
Figure 4.6 Categorycontroller class
43
Figure 4.7 shows the Category Service Implementation. CategoryController class will call
relevant method of the CategoryServiceImpl class. This is the place where multiple transactions
will be handled.
Figure 4.8 shows the code which will connect to the database and add, update, delete and get the
list of categories. On this level inheritance is used generalize the database connection logic.
Connection to the database is handled on the GenericDaoImpl class. All the Dao classes can
inherit the GenericDaoImpl use the generalized behavior.
44
Figure 4.9 shows the GenericDaoImpl class which holds a instance of a SessionFactoryclas.
SessionFactory is heavy weighted because it contains connection, hibernate configuration,
mapping between entity class and the tables. Due to that reason only one sessionFactory instance
used for the whole application.
A Session is used to get a physical connection with a database. The Session object is lightweight
and designed to be instantiated each time an interaction is needed with the database. Session is
taken from the sessionFactory.
45
Figure 4.10 explains the call sequence of the above explained code.
Figure 4.11 shows Category class which is used in all the layers to represent the Category. This
class is developed according to the JavaBean naming convention. A JavaBean is a Java object
that satisfies certain programming conventions:
46
Figure 4.11 Category class
@ Entity Annotation
By Using @Entity annotation to the Category class, this marks this class as an entity. Category
class can be considered as a Entity bean as it annotated with @Entity annotation.
@Table Annotation
The @Table annotation allows programmer to specify the details of the table that will be used to
persist the entity in the database. According to the above code table name is CATEGORY.
47
@Id and @GeneratedValue Annotations
Each entity bean will have a primary key, which annotate on the class with the @Id annotation.
@GeneratedValue annotation is used to define the primary key generation strategy. For the
Category table generation strategy is auto increment.
@Column Annotation
The @Column annotation is used to specify the details of the column to which a field or property
will be mapped
Figure 4.12 is the hibernate configuration which is defined in the configuration.xml. This
configuration information is used to create a SessionFactory object.
48
CHAPTER 05: EVALUATION
5.1 Introduction
Testing is the process of evaluating a system or its component(s) with the intent to find whether it
satisfies the specified requirements or not.
Testing is executing a system in order to identify any gaps, errors, or missing requirements in
contrary to the actual requirements. [12]
White box testing is a testing technique that takes into account the internal mechanism of
a system. It is also called structural testing and glass box testing.
Black box testing is often used for validation and white box testing is often used for
verification. [13]
Unit testing is the testing of an individual unit or group of related units. It falls under
the class of white box testing. It is often done by the programmer to test that the unit
he/she has implemented is producing expected output against given input.[13]
System testing is the testing to ensure that by putting the software in different
environments (e.g., Operating Systems) it still works. System testing is done with
full system implementation and environment. It falls under the class of black box
testing. [13]
Acceptance testing is often done by the customer to ensure that the delivered product
meets the requirements and works as the customer expected. It falls under the class
of black box testing.[13]
Introducing test plan is very important part in software development life cycle. Test plan should
have the ability to test the functionality of the overall system. By properly testing a system, it can
identify the errors which generate from the system and can correct them. The implemented
system was tested using different type of testing.
After performing the system unit testing, next integration testing was done, and this can identify
the errors and the required functionality of the units after integration. System testing was
performed as the final stage for the completely developed web based application to check the
functionality. This performed at the client’s environment with client’s original data.
50
Figure 5.1 show the unit tests done to perform add, update, delete and select categories.
51
Table 5.1 shows the list of test cases performed to validate add, update, delete and
select categories.
Table 5.1 Test cases for category
tst_0001 Add category without specifying a “Please fill out this field” pass
name message should show.
tst_0002 Add category by specifying a name System should not allow adding pass
which extend the length of 30 more than 30 characters.
characters.
tst_0003 Add category name by specifying a “Please use at least 2 characters” pass
name length of 1 character. message should show.
tst_0004 Add category name which is already “Specified name exist” message fail
in the system. should show.
tst_0005 Add category name more than 1 There should be a new record in pass
the CATEGORY table.
character and not exceed 30
Category record should be
characters. shown to the user in the category
list view.
tst_0006 Click on the edit button of a “Add Category” caption should pass
category in the list view. change into “Update Category”.
Category id should show in a
read only label. Name should be
shown inside the name textbox.
52
5.4 User Acceptance Testing
After implementing the system it was tested in the client environment to get the user acceptance
testing. The system was tested by the client to identify the functionality provided by the system,
whether it can satisfy the operational needs of the company. By introducing the system briefly
the client could understand how the system works. User Acceptance Testing was started by
feeding the actual dataset to the developed system. There were some minor modifications
required for the system.
The overall system was tested by the client; changing the user’s privileges. Because at the
requirement gathering stage, it was stated there is a need for having all the company internal
operational privileges to Administrator account. After testing the system, it had been requested to
test the system using the staff members. Manager, all the users tested the system by login to their
user accounts under the direction. Some minor modifications needed were pointed out by the
users. When finishing their session there was a pleasant response about the system.
After completing the user acceptance testing, a positive response was received from all the users
requesting for minor modifications. With the newly developed system the company could
function efficiently and smoothly rather than continue using the old method, the client stated.
53
CHAPTER 06: CONCLUSION
6.1 Introduction
Producing quality consumer goods or manufacturing various items takes most of the time and
effort of companies. They don’t have sufficient time to concentrate on distributing their produces
throughout the island. Therefore, most of the Sri Lankan producers and manufacturers working
with the agency services in Sri Lanka at the end of production line. Those agencies have
warehouses, staff and vehicles and handle distribution of their produces in the country.
Most of the agency services use manual process to handle their business. Giving a generic
software solution for all the agencies will help to save their time and improve the productivity.
This can be considered as a business opportunity. That’s what came into author’s mind while
developing this software.
According to the current requirement Gishani distributors all the confectionery items are
purchased from one supplier. Due to that reason and to reduce the complexity supplier is not
included in this system. If there is a need come then will give the support to purchase items
from different suppliers.
Mobile support
All the screens are not verified in the all the major mobile devices. This is something that has
to be done. Most of the people have their mobile devices with them and they like to use the
system with their mobile devices. Due to that reason this will be done with high priority.
One of the most important things is reports in software. Different kind of reports can be
generated based on the customer need. This is important to the management to do the
54
sales forecast. When they started to use this system definitely will ask for different kind
of reports.
UCWPL appointed multiple agencies to distribute their items all over the county. Most of
the agencies have the same behavior. Because of that reason this software can be adapted
to work with multiple agencies. But to do that need to consider about the concurrency
handling, performance and accessibility of the system.
Doing a project is very important to understand the whole software life cycle. Student has
to get the overall knowledge from understanding the requirements up to deliver the
software to the customer. During this period student understand all activates of the
software life cycle. This experience cannot be achieved even working from a software
company.
This was very helpful to the sales executive to do his calculation until develop this
software. Also for the author this was a very important to understand the accurate
requirements.
Author has got good understanding about different frameworks which is popular in the
software industry. It was very helpful to find a new job in software industry.
Writing unit test is one of the important things and was able to learn about unit testing
and do the code coverage via unit testing.
It is important to understand the user requirements correctly from the beginning.
Otherwise time to develop the software cannot be achieved with the expected decline.
55
References
[1] S.Devarajan, Techniques for Requirements Gathering, 2016,
[Online]. Available: https://www.tutorialspoint.com/articles/techniques-for-requirements-
gathering [Accessed 02 Feb 2017]
[10] upwork.com, HTML vs. XHTML vs. HTML5: Understanding the Difference Between
These Commonly Confused Terms, 2017, [Online].Available:
https://www.upwork.com/hiring/development/html-vs-xhtml-vs-html5/[Accessed 05 Jun
2017]
56
[13] https://www.codeproject.com, Software Testing - Types of Testing, 2012,
[Online].Available:
https://www.codeproject.com/Tips/351122/What-is-software-testing-What-are-the-
different-ty [Accessed 20 Jul 2017]
57
Appendix A-System Documentation
System Manual
Step1:-Install Java 8.0 or above version
https://www.java.com/en/download/help/download_options.xml
Step3:-Install MySQL
https://www.wikihow.com/Install-the-MySQL-Database-Server-on-Your-Windows-PC
Step4:- Execute the sql commands given in the SQL.txt file which will create the database
and the required tables. Part of the SQL is mentioned below to get an understanding.
58
Step3:-Deploy WAR file to the Web Server.
WAR (Web application Archive) files are used to distribute Java-based web applications. WAR
files are used to combine JSPs, servlets, Java class files, XML files, javascript libraries, JAR
libraries, static web pages, and any other resources needed to run the application.
2. Click on the “manager webapp” link and provide username and password, then click ok button.
59
3. In the Deploy section, WAR file to deploy subsection, click on Browse....
60
Appendix C-User Documentation
Login page
61
Dashboard
If user successfully logged into the system then user will get the dashboard. From left
menu bar you can go to different screens by clicking on different links. If you want to
exit from the system then you can use the Logout button.
Packing
To add a packing to the system, first you have to specify the description and then quantity. Then
click on the “Add Packing” button. Created packing will be shown list below to the “Add
Packing” button.
To change the description or quantity of a packing you have to click on the Edit button. After you
click on the Edit button “Add Packing” caption will change to “Update packing”. Now you can
change the description and quantity.
When you click on the “Delete” Button relevant record will be removed from the list.
62
Figure C.3 Packing
Purchase order
To create a purchase order, order no and order date is required. Initially all the purchase items
show with the pink background color. Once specify quantity for an item that row become green.
Also you can change the item price. Based on the required units and item price total price will be
calculated.
63
Sales Invoice
You can add the customer by specifying the name of the customer. Customer names will be
shown to you based on user input. Select the customer name from the list. If the customer is not
available in the list that means customer is still not in the system. then you have to use the
customer page to add a new customer.
64
To add a new Item first click on the “Add Item” button. Then you will see like this.
You can use the Code or Name field to search the available confectionery items.
If you want to remove a item which is already added then select the relevant checkbox in front of
the item field and click on the “Remove item” button. If you want to select all items at once then
use the checkbox of the Code heading.
65
Figure C.10 Sales invoice – remove item
You can define the quantity that you are going to sale, selling price, discount, and free quantity
issue also if there any previous market return value
66
Appendix D – Management Reports
Available Stock Report
Figure D.1 shows the currently available stock. Based on this report management can decide next
purchase order. Also sales executive can check the available stock before put the sales orders.
Based on the Sales orders taken by sales executive for a certain day, need to identify the
confectionery items that have to be release from the store for that day. Figure D.2 shows the
stock release report.
67
Sales Invoice report
Figure D.3 shows the sales for a selected date. In this report user can see the total sales and the
grand total. Grand total is calculated after deducting the discount and market return from the total
bill.
Total income and the total expenses are calculated and shown in the figure D.4. User can specify
date range to identify the expenses and income. Purchase expenses means total expenses of the
purchase invoices. All other expenses are shown in Other expenses colum and All the sales
income shows in Sales Income column.
68
Appendix E – Test Results
Test Cases for Managing the Categories
The test cases and results of the manage categories are displayed in Table E.1
tst_0001 Add category without specifying a “Please fill out this field” pass
name message should show.
tst_0002 Add category by specifying a name System should not allow adding pass
which extend the length of 30 more than 30 characters.
characters.
tst_0003 Add category name by specifying a “Please use at least 2 characters” pass
name length of 1 character. message should show.
tst_0004 Add category name which is already “Specified name exist” message fail
in the system. should show.
tst_0005 Add category name more than 1 There should be a new record in pass
the CATEGORY table.
character and not exceed 30
Category record should be
characters. shown to the user in the category
list view.
tst_0006 Click on the edit button of a “Add Category” caption should pass
category in the list view. change into “Update Category”.
Category id should show in a
read only label. Name should be
shown inside the name textbox.
69
tst_0008 User clicks on delete button of a There should be a confirmation pass
category in the list view. message before delete the
record.
If user accepts then record
should delete from the table and
remove from the list view. If
user ignore to delete nothing
should happen.
The test cases and results of the manage items are displayed in Table E. 2
tst_0001 Add Item without specifying a name “Please fill out this field” Pass
message should show.
tst_0002 Add Item without selecting a “Please fill out this field” Pass
packing message should show.
tst_0003 Add Item without specifying a valid “Please fill out this field” Pass
quantity message should show.
tst_0004 Add Item by specifying a name System should not allow adding pass
which exceeds the length of 30 more than 30 characters.
characters.
tst_0005 Add Item name by specifying a “Please use at least 2 characters” pass
name length of 1 character. message should show.
tst_0006 Add Item name which is already in “Specified name exist” message fail
the system. should show.
tst_0007 Add Item name more than 1 There should be a new record in pass
the ITEM table.
character and not exceed 30
Item record should be shown to
characters. the user in the item list view.
tst_0008 Click on the edit button of a item in “Add Item” caption should pass
the list view. change into “Update Item”.
User shall be able to change the
item name, packing and quantity.
70
tst_0009 From tst_0001 to tst_0005 should be Item record should be updated pass
executed before executing this test with the changed name. Item
case. record should be shown to the
Dependant test case - tst_0006 user in the item list view with
User changes the item name and updated information.
click on the update button.
tst_0010 User clicks on delete button of a There should be a confirmation pass
item in the list view. message before delete the
record.
If user accepts then record
should delete from the table and
remove from the list view. If
user ignore to delete nothing
should happen.
The test cases and results of the manage packing are displayed in Table E .3
tst_0001 Add packing without specifying a “Please fill out this field” pass
name message should show.
tst_0002 Add packing by specifying a name System should not allow adding pass
which exceeds the length of 30 more than 30 characters.
characters.
tst_0003 Add packing name by specifying a “Please use at least 2 characters” pass
name length of 1 character. message should show.
tst_0004 Add packing name which is already “Specified name exist” message fail
in the system. should show.
tst_0005 Add packing name more than 1 There should be a new record in pass
the PACKING table.
character and not exceed 30
Packing record should be shown
characters. to the user in the packing list
view.
71
tst_0006 Click on the edit button of a packing “Add Packing” caption should pass
in the list view. change into “Update Packing”.
Packing id should show in a read
only label. Name should be
shown inside the name textbox.
72
Appendix F - Code Listing
Apache Tiles allows authors to define page fragments which can be assembled into complete
pages at runtime. These fragments, or tiles, can be used as simple includes in order to reduce
the duplication of common page elements or embedded within other tiles to develop a series
of reusable templates. These templates streamline the development of a consistent look and
feel across an entire application. Figure F.1 shows the tile configuration file for the project.
<put-list-attribute name="stylesheets">
<add-attribute value="/resources/css/bootstrap.css" />
<add-attribute value="/resources/css/jquery-ui.css" />
<add-attribute value="/resources/css/dashboard.css" />
</put-list-attribute>
</definition>
<put-list-attribute name="javascripts">
<!-- Jquery 3 is not used as jquery ui is not compatibale with jquery 3 --
>
<add-attribute value="/resources/js/jquery-1.12.4.js" />
<add-attribute value="/resources/js/bootstrap.js" />
<add-attribute value="/resources/js/jquery-ui.js" />
<add-attribute value="/resources/js/main.js" />
</put-list-attribute>
<put-list-attribute name="stylesheets">
<add-attribute value="/resources/css/bootstrap.css" />
<add-attribute value="/resources/css/jquery-ui.css" />
<add-attribute value="/resources/css/dashboard.css" />
<add-attribute value="/resources/css/main.css" />
</put-list-attribute>
</definition>
73
<definition name="dashboard" extends="base">
<put-attribute name="body" value="/WEB-INF/views/index.jsp" />
</definition>
</tiles-definitions>
75
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
76
Appendix G – Customer Certification
77