Sei sulla pagina 1di 60

PROJECT REPORT

ON
INVENTORY & BILLING SYSTEM

Submitted in partial fulfillment of the


Requirement for the award of the degree of
Bachelor of Computer Application

Submitted To Submitted By
Priyanka Gupta Sahil Khan
VSIT 07529802016
(Batch: 2016-2019)

Vivekananda Institute of Professional Studies

(Affiliated to Guru Gobind Singh Indraprastha University)

1
CERTIFICATE

This is to certify that we Sahil Khan, Richik Maity and Pravinder Shalot of BCA 5th Semester
from Vivekananda Institute of Professional Studies, Delhi has presented this project work
entitled INVENTORY MANAGEMENT AND BILLING SYSTEM in partial fulfillment of the
requirements for the award of the degree of Bachelor of Computer Applications under our
supervision and guidance.

2
ACKNOWLEDGEMENT

It is our proud privilege to express our profound gratitude to the entire management of
Vivekananda Institute of Professional Studies and teachers of the institute for providing us with
the opportunity to avail the excellent facilities and infrastructure. The knowledge and values
inculcated have proved to be of immense help at the very start of my career. Special thanks to
Hon’ble Founder, Vivekananda Institute of Professional Studies, Delhi for having provided us
an excellent infrastructure at VSIT.

I am grateful to Prof. (Dr.) SupriyaMadan (Dean, VSIT), and “project guide” for their astute
guidance, constant encouragement and sincere support for this project work.

Sincere thanks to all my family members, seniors and friends, specially Divyanshu Sharma for
their support and assistance throughout the project.

SAHIL KHAN

BCA-V

07529802016

3
Table Of Content
1 INTRODUCTION 6

1.1 Objective of the System 6


1.2 Justification and need for the system 7
1.3 Advantage of the system 7
1.4 Previous work or related systems, how they are used. 8

2 REQUIREMENT ANALYSIS 9

2.1 Analysis Study 9


2.2 User Requirements 10
2.3 Discussion with IT Experts 11
2.4 Final Requirements 11

3 DESIGN OF THE SYSTEM 12

3.1 Hardware, Software requirements 12


3.2 System requirements 12
3.3 Detailed System Specification (Module Wise) 15
3.4 ER Diagram of the system 16
3.5 DFDs/Algorithms/Flow Charts 17

4 IMPLEMENTATION & CODING 19

4.1 Operating System 19


4.2 Languages 19
4.3 S/W Tools 19
4.4 Coding 20

5 TESTING & TEST RESULTS 55

5.1 Software Testing and Objective of Testing 55


5.2 Sample test data/ Output screen printouts etc. 55

6 CONCLUSION 59

6.1 Conclusion 59
6.2 Future Scope 59

Biblography 60

4
Table of Figures
3 Fig. 3.1 Actor and Usecase 15

Fig.3.2 Interaction between user andadmin18 15

Fig 3.3 ER diagram 16

Fig 3.4DFD 18

5
Chapter 1

INTRODUCTION
Inventory Management Billing System Softwaresspecializes in tracking record of various products with
the interaction of the customers to each other. It is an system through which store or restaurant owners
can keep the information about the products that are available and what are their details. They can add
items to sell, record the sale made, generate bill for customers etc. Our company is registered and fulfills
all the requirements and security standards set by the sale and purchase department.

It has a single login page where one can enter their login ID and password given by the owner of the
store to the employees working on the system.

It is the basic login interface for any user of the system. It provides the user with the information of
different items added to be sold. Also, the user can add her/his item by using the add item option on the
home of the software.

It gives an overview of all the sales made, who are the buyers, etc. It also provides the advantage to
cancel or finalize any sale.

1.1 OBJECTIVE OF THE SYSTEM

This project will serve the following objectives:-

1. Provides the user with easy and friendly interface


2. Add and maintain record of available products
3. Add and maintain description of products
4. Provides attractive discounts
5. Accepts Customer Details
6. Provides the preferences of customers.
7. Provides a convenient solution for billing pattern
8. E-Bill Generation for the better Environment

6
1.2 JUSTIFICATION AND NEED FOR THE SYSTEM
Nowadays when everyone is so busy and occupied, we all want ease of work. And with the lack of time
arises the need of these kinds of applications that would provide all the facilities to the customer (user),
and the manager/admin at one place. Now, the admin can handle all its items added at one place.

And on the other hand, they can select best price to sell the items to different users sitting at a single
place. He also gets to know the status of all the sales made ever.

1.3 Advantages of the system


1. Easiness in modification of data: The proposed system provides managing of huge data effectively
and efficiently for efficient results, storing the details of the products, users, etc. in such a way that the
database can be modified.

2. User friendly: The proposed system is user friendly because the retrieval and storing of data is fast
and data is maintained efficiently. Moreover the graphical user interface is provided in the proposed
system, which provides user to deal with the system very easily.

3. Customer Preferences: The buyer’s purchasing habits can be understood.

4. No or very few paperwork: The proposed system either does not require paper work or very few
paper works is required. All the data is feted into the computer immediately and various feedbacks and
reports can be generated through computers. Moreover work becomes very easy because there is no
need to keep data on papers.

5. Support strategic competitive advantage: Proposed system supports strategic competitive


advantages. Since the proposed systems provide easiness in reports generating it will provide strategic
advantages among competitors.

6. Computer operator control: Computer operator control will be there no errors. Moreover storing
and retrieving of information is easy. So work can be done speedily and in time.

7. Save Environment: As the bill which is being generated does not use papers and are sent to their
phone numbers we help people save trees. And this is also the most promising way for the buyers to take
record of their bills for future use

7
.

1.4 Previous work or related systems, how they are used.


Following are the problems associated with the previous project which led to the creation of the
proposed project:-

1. Inability of modification of data: The managing of huge data effectively and efficiently for efficient
results, storing the details of the products etc. in such a way that the database can be modified as not
possible in the current system.

2. Not user friendly: The existing system is not user friendly because the retrieval and storage of data is
slow and data is not maintained efficiently.

3.Difficulty in reports generating: Either no reports generating in a current system or they are
generated with great difficulty reports take time to generate in the current system.

4.Manual operator control: Manual operator control is there and leads to a lot of chaos and errors.

5.Lot of paperwork: Existing system requires lot of paper work and even a small transaction require
many papers fill. Moreover any unnatural cause (such as fire in the organization) can destroy all data of
the organization. Loss of even a single paper led to difficult situation because all the papers are
interrelated.

6.Inability of sharing the data: Data cannot be shared in the existing system. This means that no two
persons can use the same data in existing system. Also the two departments in an organization cannot
interact with each other without the actual movement of data.

7.No support in decision-making: Existing system does not support managerial decision-making.

8.No support in strategic competitive advantage: Existing system does not support strategic
competitive advantages.

8
Chapter 2

REQUIREMENT ANALYSIS
Before we begin a new system it is important to study the system that will be improved or replaced (if
there is one).We need to analyze how this system uses hardware, software, network and the people
resources to convert data resources, such as transaction data, into information products, such as reports
and displays. Thus we should document how the information system activities of input, processing,
output, storage and control are accomplished.

2.1 ANALYSIS STUDY

1. Open Communication Environment:


It provides a good way of communication between the user (customer) and the admin of the system. The
owner gets to see a wide variety of products available there. He may order the products which he thinks
are in shortage.
2. Lower Installation Charges:
It neither require any high configuration systems for smooth running of program, nor do we require any
high configuration systems for smooth running of a client program. This application is designed with an
ease to support any ordinary system even without an internet connection.
3. Secured and Reliable:
The messages that travel across the system and customer’s phone are managed by a paid API of
SMSLOCAL. So the private sessions would be done in a secured form without a third party interface.
4. Simple to use and Easy to Understand:
The coding of this application is a tedious job. The user only needs a system with java and sql installed.
The modules are user friendly and can be operated easily.
5. Platform Independent
Since the project is done completely in java, it also executes main properties of language. The given
application is platform independent. So the client systems may have vista, Linux, Mac or any other
operating system, but they can operate on any environment without any dependencies of OS.

9
2.2 Feasibility Study

All projects are feasible if they have unlimited resources and infinite time. But the development of
software is plagued by the scarcity of resources and difficult delivery rates. It is necessary and prudent to
evaluate the feasibility of a project at the earliest possible time. The three considerations are involved in
the feasibility analysis.

2.2.1Technical Feasibility

Technical feasibility centers on the existing mobile system (hardware, software…etc) and to what extent it can
support the proposed addition if the budget is a serious constraint, then the project is judged not feasible. The
technical feasibilities are important role in my project because here I am using JVM. It requires
NetBeans(software) to develop this application. A easily available software and easy to use.

2.2.2Economical Feasibility

This procedure is to determine the benefits and savings that are expected from a candidate system and compare
with cost. If benefits outweigh cost then the decision is made to design and implement the system. Otherwise
further justification or alterations in proposed systems that have to be made if it is having a change of being
approved. This is an ongoing effort that improves any feasibility costs spent on this project because here I am
using open source environments.

2.2.3Operational Feasibility

People are inherently resistant to change and have been known to facilitate change. There is no need of technical
background is required to work on the application. All the information needed can be seen on just one click.

2.3USER REQUIREMENTS

The system provides the user with ease of recording inventory and generating bill for the sale made. The user
merely requires a system and start placing orders. The user might also understand the habit of their customers
about the product they purchase. The system specifications that a user may want are as follows:

1. It should be easy to understand


2. Must be interactive
3. Should provide a good user interface
4. Security should be maintained
5. Redundancy must be controlled

10
2.4Discussion with IT experts

Creating an IT project for a beginner can at times become a challenging task. So, the discussion with the veterans
in the field of IT becomes an important task which might lead to some great benefits for the developer. The
people who are in the IT field for a long time knows the mindset of the user pretty well and might help in giving
some important pointers which in turn would help in improvement of the project. Following were the outcome of
the discussion held with our IT experts:

1. Proper validations were proposed


2. User friendly design should be formed
3. Security Checks were performed
4. More functionality was added

So, it was a very eventful and important step taken in the development of the project which leads to some
interesting improvements in the project.

2.5Final Requirements

User Oriented:A system should be more user friendly not of the technical point of view

Better GUI:All the elements used in the system should be of interactive in nature that is its look and
feel should encourage a person to use it.

Reliability: The system should be reliable and fast in processing

Data security: Access to the organizational data is not to be granted to any unknown person which is
not a part of the transaction

Confidentiality:Whatever the usermaintains in the organization,the user has the full rights to modify it
and it could be not be accessed/modified without users permission

Better Management of information:All the information should be managed that is the flow of the
information is to be in right track

Presentation:The content that is to be presented to the user is to be presented in such a way that is self-
explanatory to the user

11
Chapter 3

DESIGN OF THE SYSTEM

3. Software requirements

Platform Platform Independent


The Operating System Windows vista or better
Framework NetBeans
Front-End Tool NetBeans
Back-End Tool MySql Database

3.1.1 Hardware Requirements

Processor Intel Pentium IV 2.9 GHz

RAM Min. 1 GB

Graphics Integrated

Hard Disk 2 GB free

3.2 System Requirements

To know the detailed system requirements an SRS has to be prepared .Software requirement
specification abbreviated as SRS is a means of translating the idea of files into a formal document. The
main features of SRS include:
 Establishing the basis for an agreement between the client and the developer.

 Producing a reference for validation of the final product. SRS assist clients in determining if the
software meets the requirements.
Mainly there are six requirements which an SRS must satisfy.

12
(a) It should specify the external behavior.

(b) It should specify the constraints.

(c) It should be easy to change.

(d) It should be a reference tool.

(e) It should record throughout the lifecycle.

(f) It should have the capacity of expectation of an undesired event.

Usually we come across four types of requirement specification

(a) User Interface Requirements

(b) Database Requirements

(c) Functional Requirements

(d) Non-Functional Requirements

3.2.1 User Interface Requirements

The user of the proposed system requires that the developed software should be user friendly, have
security access, and ensure the privacy of the administrator and produce results in timely manner. The
system interface to the user must be simple and understandable. The modules must be user-friendly and
must be in an easy-to-use style. The user must be able to easily switch among various modules. The
product is well designed so that it can be used easily by the users who are novices to the system.

3.2.2 Database Requirements

The database should be designed in such a way that it enhances the efficient searching, Adding and
manipulating of all the information associated. For instance all general information regarding an item
attribute should be stored in a particular table.

The database should be organized in such a way that it helps in various essential summaries needed for
users.

13
3.2.3 Functional Requirements

The various functional requirements of the system can be summarized as:-

(a) A home screen that is user friendly and ambiguous.

(b) It is easy to look for the desired information.

(c) User can easily do various tasks.

3.2.4 Non-Functional Requirements

Non-functional requirements define the system properties and constraints that arise through user needs,
because of the budgeted constraints or organizational policies, or because of the need for interoperability
with other software or due to the external factors such as safety regulations privacy registrations and so
on.

3.2.5 Design Requirements

The main objectives of input design are:

(a) Controlling the amount of input

(b) Keeping the process simple.

(c) The best thing in the input design is to achieve all the objectives mentioned in the simplest manner
possible.

The main objectives of output design are:

(a) Identifying the specific outputs.

(b) Creating reports for displaying and storing information.

The primary goal of the system analysis is to improve the efficiency of the existing system. For that the
study of specification of the requirements is very essential. For the development of the new system, a
preliminary survey of the existing system will be conducted. Investigation should be done whether the
upgradation of the system into an application program could solve the problems and eradicate the
inefficiency of the existing system.

14
3.3 Detailed System Specification (Module Wise)

The proposed system consists of mainly 6 important modules and various other sub modules. The main
6 modules of the system are as follows

1.Login- With login info given to the user, he is free to use the services offered to him by logging into
her/his account using appropriate details.

3.3 THE USE CASE APPROACH

A use case is a set of scenarios that describe an interaction between a user and a system.

A use case diagram displays the relationship among actors and use cases. The two main components of a
use case diagram are use cases and actors.

USE CASE

Fig. 3.1 Actor and Usecase

An actor is represents a user or another system that will interact with the system you are modelling.

A use case is an external view of the system that represents some action the user might perform in order
to complete a task.

LOGIN

LOG OUT

Manages
Inventory
Sale

Fig.3.2 Interaction between user and admin

15
3.4 ER DIAGRAM
Entity – Relationship model (ER model) in software engineering is an abstract way to describe
a database. This article refers to the techniques proposed in Peter Chen's 1976 paper. However, variants
of the idea existed previously, and have been devised subsequently such as super type and subtype data
entities and commonality relationships.

Fig 3.3ER diagram

In The above diagram shows the entity relationship. An Entity Relationship Diagram (ERD) is a visual
representation of different data using conventions that describe how these data are related to each other.

16
For example, the elements writer, novel, and consumer may be described using ER diagram.In the
diagram, the elements inside rectangles are called entities while the items inside diamonds denote the
relationships between entities. This ER diagram tutorial for beginners covers most things related to ER
diagram

3.5 DATA FLOW DIAGRAM (DFD)

A data flow diagram (DFD) is a graphical representation of the "flow" of data through an information
system, modelling its process aspects. Often they are a preliminary step used to create an overview of
the system which can later be elaborated. DFDs can also be used for the visualization of data
processing (structured design).

A DFD shows what kinds of information will be input to and output from the system, where the data
will come from and go to, and where the data will be stored. It does not show information about the
timing of processes, or information about whether processes will operate in sequence or in parallel
(which is shown on a flowchart).

17
DFD Diagram

18
Chapter 4

IMPLEMENTATION AND CODING

4.1 Operating System

Platform Independent:Since the project is done completely in java, it also executes main properties of
language. The chat application is platform independent. So the client systems may have vista, Linux,
Mac or any other operating system, but they can connect to server easily without any dependencies of
OS.

4.2 Languages used

Java Standard Edition (J2SE)


Also known as Core Java, this is the most basic and standard version of Java. It’s the purest form of
Java, a basic foundation for all other editions.
It consists of a wide variety of general purpose API’s (like java.lang, java.util) as well as many special
purpose APIs
J2SE is mainly used to create applications for Desktop environment.
It consist all the basics of Java the language, variables, primitive data types, Arrays, Streams, Strings
Java Database Connectivity(JDBC) and much more. This is the standard, from which all other editions
came out, according to the needs of the time.
The famous JVM of Java, the heart of Java development, was also given by this edition only. It’s
because of this feature, that Java has such a wide usage.

4.3 S/W Tools


NetBeans

NetBeans is an integrated development environment (IDE) for Java. NetBeans allows applications to be
developed from a set of modular software components called modules. NetBeans runs on Microsoft
Windows, macOS, Linux and Solaris. In addition to Java development, it has extensions for other
languages like PHP, C++ and JavaScript. Applications based on NetBeans, including the NetBeans IDE,
can be extended by third party developers.

19
4.4 CODING
4.4.1. LogIn

import java.sql.*;

import javax.swing.JOptionPane;

SIGN-IN BUTTON

try{Class.forName("com.mysql.jdbc.Driver");

Connection
con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/chinatown","root","oom");

Statement stmt=con.createStatement();

String query="select * from emp;";

ResultSet rs=stmt.executeQuery(query);

String a=tfun.getText();

String b=new String(pf.getPassword());

String signin="select emp_no,password from emp where Emp_no='"+a+"' and password='"+b+"';";

ResultSet rowEffected=stmt.executeQuery(signin);

20
while(rowEffected.next())

{new items().setVisible(true);}

dispose();

rs.close();

stmt.close();

con.close();

catch(ClassNotFoundException e)

{JOptionPane.showMessageDialog(null,"Error in SignIn Process");

} catch (SQLException e) {

JOptionPane.showMessageDialog(null,"Error in SignIn Process");

4.4.2. Items

21
import com.sun.glass.events.KeyEvent;

import java.awt.Color;

import static java.awt.Color.green;

import java.awt.HeadlessException;

import java.io.BufferedReader;

import java.io.InputStreamReader;

import java.net.HttpURLConnection;

import java.net.URL;

import java.sql.*;

import javax.swing.JOptionPane;

ADD button

try{Class.forName("com.mysql.jdbc.Driver");

Connection con=(Connection)DriverManager.getConnection

("jdbc:mysql://localhost/chinatown","root","oom");

Statement stmt=con.createStatement();

String query="select * from items;";

ResultSet rs=stmt.executeQuery(query);

String a=iname.getText();

String b=iprice.getText();

int c=0;

if(r1.isSelected()==true)

{ chow.addItem(a);

c=1;}

if(r2.isSelected()==true)

22
{ momos.addItem(a);

c=2;}

if(r3.isSelected()==true)

{soup.addItem(a);

c=3;}

if(r4.isSelected()==true)

{rice.addItem(a);

c=4;}

String sql="insert into items values('"+a+"','"+b+"','"+c+"');";

int rowEffected=stmt.executeUpdate(sql);

JOptionPane.showMessageDialog(null,"Successfully Added");

iname.setText("");

iprice.setText("");

rs.close();

stmt.close();

con.close();

catch(HeadlessException e)

{JOptionPane.showMessageDialog(null,"Error in Adding a New Product");

} catch (ClassNotFoundException e) {

JOptionPane.showMessageDialog(null,"Error in Adding a New Product");

23
}

catch (SQLException e) {

JOptionPane.showMessageDialog(null,"Error in Adding a New Product");

Calculate Button

try{Class.forName("com.mysql.jdbc.Driver");

Connection con=(Connection)DriverManager.getConnection

("jdbc:mysql://localhost/chinatown","root","oom");

Statement stmt=con.createStatement();

String a = (String)chow.getSelectedItem();

String b = (String)momos.getSelectedItem();

String c = (String)soup.getSelectedItem();

String d = (String)rice.getSelectedItem();

String q1="select sum(price) from items where item_name='"+a+"' or item_name='"+b+"' or


item_name='"+c+"' or item_name='"+d+"';";

ResultSet rs=stmt.executeQuery(q1);

if(rs.next())

{String a1=rs.getString("sum(price)");

//lblamt.setText(""+a1);}

if(rbFull.isSelected()==true){

lblamt.setText(""+a1);}

24
if(rbHalf.isSelected()==true){

lblamt.setText(""+a1);

int aa=Integer.parseInt(lblamt.getText());

aa=aa/2;

lblamt.setText(""+aa);}

rs.close();

stmt.close();

con.close();

catch(ClassNotFoundException e)

{JOptionPane.showMessageDialog(null,"Error");

} catch (SQLException e) {

JOptionPane.showMessageDialog(null,"Error");

Proceed Button

float a=Float.parseFloat(lblamt.getText());

txttax.setEditable(true);

txtnet.setEditable(true);

txtcontact.setEditable(true);

txtamt.setEditable(true);

txtcust.setEditable(true);

txtamt.setText(""+a);

Calcnet

float a = Float.parseFloat(txtamt.getText());

25
float tax= (float) (a / 100 * 12.5);

txttax.setText(""+tax);

float b = Float.parseFloat(txttax.getText());

float c = a+b;

txtnet.setText(""+c);

Paid Button

try{

Class.forName("com.mysql.jdbc.Driver");

Connection con=(Connection)DriverManager.getConnection

("jdbc:mysql://localhost/chinatown","root","oom");

Statement stmt=con.createStatement();

String query="select * from customer;";

ResultSet rs=stmt.executeQuery(query);

String name=txtcust.getText();

String phn=txtcontact.getText();

String sql="insert into customer(Phone_no,Customer_Name) values('"+phn+"','"+name+"')";

int rowEffected=stmt.executeUpdate(sql);

//JOptionPane.showMessageDialog(null,"Successfully SignedUp");

rs.close();

stmt.close();

con.close();

26
}

catch(HeadlessException e)

{System.out.println(e);

JOptionPane.showMessageDialog(null,"Problem!");

} catch (ClassNotFoundException e) {

System.out.println(e);

JOptionPane.showMessageDialog(null,"Problem!");

} // TODO add your handling code here:

catch (SQLException e) {

System.out.println(e);

JOptionPane.showMessageDialog(null,"Problem!");

JOptionPane.showMessageDialog(null,"Order Placed Successfully");

try {

// Construct data

String apiKey = "apikey=" + "Vijc0UfyvK0-


9MiH7b4oOGwLJCAnykrk0BdgsEsLuQ";

//String message = "&message=" + txtmsg.getText();

String message = "&message=" +"Thank you! YOU ARE LISTENING OUR PROJECT
CONCEPT..";

//String sender = "&sender=" + txtsndr.getText();

String sender = "&sender=" + "TXTLCL";

27
String numbers = "&numbers=" + txtcontact.getText();

// Send data

HttpURLConnection conn = (HttpURLConnection) new


URL("https://api.textlocal.in/send/?").openConnection();

String data = apiKey + numbers + message + sender;

conn.setDoOutput(true);

conn.setRequestMethod("POST");

conn.setRequestProperty("Content-Length", Integer.toString(data.length()));

conn.getOutputStream().write(data.getBytes("UTF-8"));

final BufferedReader rd = new BufferedReader(new


InputStreamReader(conn.getInputStream()));

final StringBuffer stringBuffer = new StringBuffer();

String line;

while ((line = rd.readLine()) != null) {

//stringBuffer.append(line);

JOptionPane.showMessageDialog(null, "message"+line);

rd.close();

//return stringBuffer.toString();

} catch (Exception e) {

//System.out.println("Error SMS "+e);

JOptionPane.showMessageDialog(null, "Error!"+e);

//return "Error "+e;

28
txttax.setText("");

txtnet.setText("");

txtcontact.setText("");

txtamt.setText("");

txtcust.setText("");

lblamt.setText("0");

txttax.setEditable(false);

txtnet.setEditable(false);

txtcontact.setEditable(false);

txtamt.setEditable(false);

txtcust.setEditable(false);

Button cancel

txttax.setText("");

txtnet.setText("");

txtcontact.setText("");

txtamt.setText("");

txtcust.setText("");

lblamt.setText("0");

txttax.setEditable(false);

txtnet.setEditable(false);

txtcontact.setEditable(false);

txtamt.setEditable(false);

txtcust.setEditable(false);

29
4.4.3. Hindustani Rasoi

import java.awt.HeadlessException;

import java.io.BufferedReader;

import java.io.InputStreamReader;

import java.net.HttpURLConnection;

import java.net.URL;

import java.sql.*;

import javax.swing.JOptionPane;

30
Add button

try{Class.forName("com.mysql.jdbc.Driver");

Connection
con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/chinatown","root","oom");

Statement stmt=con.createStatement();

String query="select * from items;";

ResultSet rs=stmt.executeQuery(query);

String a=Rname.getText();

String b=Rprice.getText();

int c=0;

if(rbroti.isSelected()==true){

cbroti.addItem(a);

c=1;

if(rbsabzi.isSelected()==true){

cbsabzi.addItem(a);

c=2;

if(rbmithai.isSelected()==true){

cbmithai.addItem(a);

c=3;

31
String sql="insert into items values('"+a+"','"+b+"','"+c+"');";

int rowEffected=stmt.executeUpdate(sql);

JOptionPane.showMessageDialog(null,"Successfully Added");

rs.close();

stmt.close();

con.close();

catch(HeadlessException e){

System.out.print(e);

JOptionPane.showMessageDialog(null,"Error in Adding a New Product");

catch (ClassNotFoundException e) {

System.out.print(e);

JOptionPane.showMessageDialog(null,"Error in Adding a New Product");

catch (SQLException e) {

System.out.print(e);

JOptionPane.showMessageDialog(null,"Error in Adding a New Product");

32
Calculate Button

try{Class.forName("com.mysql.jdbc.Driver");

Connection con=(Connection)DriverManager.getConnection

("jdbc:mysql://localhost/chinatown","root","oom");

Statement stmt=con.createStatement();

String a = (String)cbroti.getSelectedItem();

String b = (String)cbsabzi.getSelectedItem();

String c = (String)cbmithai.getSelectedItem();

String q1="select sum(price) from items where item_name='"+a+"' or item_name='"+b+"' or


item_name='"+c+"';";

ResultSet rs=stmt.executeQuery(q1);

if(rs.next())

{String a1=rs.getString("sum(price)");

if(rbfull.isSelected()==true){

jLabel12.setText(""+a1);}

if(rbhalf.isSelected()==true){

jLabel12.setText(""+a1);

int aa=Integer.parseInt(jLabel12.getText());

aa=aa/2;

jLabel12.setText(""+aa);

} }

33
rs.close();

stmt.close();

con.close();

catch(ClassNotFoundException e)

{JOptionPane.showMessageDialog(null,"Error");

} catch (SQLException e) {

JOptionPane.showMessageDialog(null,"Error");

Proceed Button

float a=Float.parseFloat(jLabel12.getText());

jTextField3.setEditable(true);//order amt

jTextField4.setEditable(true);//tzx

jTextField5.setEditable(true);//name

jTextField6.setEditable(true);//phone

jTextField7.setEditable(true);//net amt

jTextField3.setText(""+a);

Calc Net Button

float a = Float.parseFloat(jTextField3.getText());

float tax= (float) (a / 100 * 12.5);

jTextField4.setText(""+tax);

float b = Float.parseFloat( jTextField4.getText());

float c = a-b;

jTextField7.setText(""+c);

34
Paid Button

try{

Class.forName("com.mysql.jdbc.Driver");

Connection con=(Connection)DriverManager.getConnection

("jdbc:mysql://localhost/chinatown","root","oom");

Statement stmt=con.createStatement();

String query="select * from customer;";

ResultSet rs=stmt.executeQuery(query);

String name=jTextField5.getText();

String phn=jTextField6.getText();

String sql="insert into customer(Phone_no,Customer_Name) values('"+phn+"','"+name+"')";

int rowEffected=stmt.executeUpdate(sql);

JOptionPane.showMessageDialog(null,"Order Placed!");

rs.close();

stmt.close();

con.close();

catch(HeadlessException e)

{System.out.println(e);

JOptionPane.showMessageDialog(null,"Problem!");

} catch (ClassNotFoundException e) {

System.out.println(e);

35
JOptionPane.showMessageDialog(null,"Problem!");

} // TODO add your handling code here:

catch (SQLException e) {

System.out.println(e);

JOptionPane.showMessageDialog(null,"Problem!");

try {

// Construct data

String apiKey = "apikey=" + "Vijc0UfyvK0-


9MiH7b4oOGwLJCAnykrk0BdgsEsLuQ";

// String apiKey = (Vijc0UfyvK0-VWLOWaJXWUQj7zXdQncnJ8VMq0OFSY);

//String message = "&message=" + txtmsg.getText();

String message = "&message=" +"Thank you! YOU ARE LISTENING OUR PROJECT
CONCEPT..";

//String sender = "&sender=" + txtsndr.getText();

String sender = "&sender=" + "TXTLCL";

String numbers = "&numbers=" + jTextField6.getText();

// Send data

HttpURLConnection conn = (HttpURLConnection) new


URL("https://api.textlocal.in/send/?").openConnection();

String data = apiKey + numbers + message + sender;

conn.setDoOutput(true);

conn.setRequestMethod("POST");

conn.setRequestProperty("Content-Length", Integer.toString(data.length()));

conn.getOutputStream().write(data.getBytes("UTF-8"));

36
final BufferedReader rd = new BufferedReader(new
InputStreamReader(conn.getInputStream()));

final StringBuffer stringBuffer = new StringBuffer();

String line;

while ((line = rd.readLine()) != null) {

//stringBuffer.append(line);

JOptionPane.showMessageDialog(null, "message"+line);

rd.close();

//return stringBuffer.toString();

} catch (Exception e) {

//System.out.println("Error SMS "+e);

JOptionPane.showMessageDialog(null, "Error!"+e);

//return "Error "+e;

Cancel Button

jTextField3.setText("");

jTextField4.setText("");

jTextField5.setText("");

jTextField6.setText("");

jTextField7.setText("");

jTextField3.setEditable(false);

jTextField4.setEditable(false);

jTextField5.setEditable(false);

37
jTextField6.setEditable(false);

jTextField7.setEditable(false);

4.4.4. Customer’s Data

import java.sql.*;

import javax.swing.JOptionPane;

Search Button

String find=txt1.getText();

try{

Class.forName("com.mysql.jdbc.Driver");

38
Connection
con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/chinatown","root","oom");

Statement smt=con.createStatement();

String qury="Select * from customer where Phone_no='"+find+"'";

ResultSet rs=smt.executeQuery(qury);

if(rs.next()){

String phn=rs.getString("Phone_no");

String name=rs.getString("Customer_name");

String area_code=rs.getString("area_code");

String area_name=rs.getString("area_name");

String address=rs.getString("address");

String fvrt_dish=rs.getString("fvrt_dish");

txt1.setText(""+phn);

txt2.setText(""+name);

txt3.setText(""+area_code);

txt4.setText(""+area_name);

txt5.setText(""+address);

txt6.setText(""+fvrt_dish);

rs.close();

smt.close();

con.close();

39
catch(ClassNotFoundException e){

System.err.println(e);

JOptionPane.showMessageDialog(null, "Something is wrong!");

} catch (SQLException e) {

System.err.println(e);

JOptionPane.showMessageDialog(null, "Something is wrong!");

Update Button

try{

Class.forName("com.mysql.jdbc.Driver");

Connection
con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/chinatown","root","oom");

Statement smt=con.createStatement();

String qury="Select * from customer";

ResultSet rs=smt.executeQuery(qury);

String phn=txt1.getText();

String Cust_name=txt2.getText();

String areacode=txt3.getText();

String areaname=txt4.getText();

String address=txt5.getText();

String fvrt=txt6.getText()

String sql="update customer set Customer_name='"+Cust_name+

"', area_code='"+areacode+

"', Area_name='"+areaname+

40
"', address='"+address+

"', fvrt_dish='"+fvrt+

"' where Phone_no='"+phn+"';";

//where Phone_no='"+phn+"';

int rowsEffected=smt.executeUpdate(sql);

JOptionPane.showMessageDialog(null,"Successfully Updated ");

rs.close();

smt.close();

con.close();

catch(ClassNotFoundException e){

System.err.println(e);

JOptionPane.showMessageDialog(null, "Something is wrong!");

} catch (SQLException e) {

System.err.println(e);

JOptionPane.showMessageDialog(null, "Something is wrong!");

Cancel Button

txt1.setText("");

txt2.setText("");

txt3.setText("");

txt4.setText("");

txt5.setText("");

txt6.setText("");

41
4.4.5. Expense Data

import java.awt.HeadlessException;

import java.sql.Connection;

import java.util.Date;

import java.sql.DriverManager;

import java.sql.ResultSet;

import java.sql.SQLException;

import java.sql.Statement;

import java.text.SimpleDateFormat;

import javax.swing.JOptionPane;

42
public Expense() {

initComponents();

showdate();

void showdate(){

Date date=new Date();

String objsdf="dd-MMM-yyyy";

//SimpleDateFormat sdf=new SimpleDateFormat("yyyy-mmm-dd");

SimpleDateFormat sdf=new SimpleDateFormat(objsdf);

jTextField1.setText(sdf.format(date));

Add Button

try{Class.forName("com.mysql.jdbc.Driver");

Connection con=(Connection)DriverManager.getConnection

("jdbc:mysql://localhost/chinatown","root","oom");

Statement stmt=con.createStatement();

String query="select * from expense;";

ResultSet rs=stmt.executeQuery(query);

String date=jTextField1.getText();

String exp_type=jTextField2.getText();

String amt=jTextField3.getText();

43
if(jCheckBox1.isSelected())

{ //c+=jCheckBox1.getText()+"";

exp_type=jCheckBox1.getText()+"";

if(jCheckBox2.isSelected())

{ exp_type =jCheckBox2.getText()+"";

if(jCheckBox3.isSelected())

{exp_type=jCheckBox3.getText()+"";

String sql="insert into expense values('"+date+"','"+exp_type+"','"+amt+"');";

int rowEffected=stmt.executeUpdate(sql);

JOptionPane.showMessageDialog(null,"Successfully Added");

jTextField1.setText("");

jTextField2.setText("");

jTextField3.setText("");

rs.close();

stmt.close();

con.close();

44
catch(HeadlessException e)

System.out.println(e);

JOptionPane.showMessageDialog(null,"Error in Adding Expesne");

} catch (ClassNotFoundException e) {

System.out.println(e);

JOptionPane.showMessageDialog(null,"Error in Adding Expense");

catch (SQLException e) {

System.out.println(e);

JOptionPane.showMessageDialog(null,"Error in Adding Expesne");

4.4.6. New Employee Data (Module in File menu.)

45
import java.awt.HeadlessException;

import java.sql.*;

import javax.swing.JOptionPane;

Save Button

String job=(String)cbjob.getSelectedItem();

int sal=0;

if(job.equals("Manager"))

{ sal=50000;

pf.setEditable(true);}

if(job.equals("Cook"))

{sal=20000;

pf.setEditable(false);}

if(job.equals("Salesman"))

{ sal=15000;

pf.setEditable(true);}

if(job.equals("Receptionist"))

{sal=12000;

pf.setEditable(true);}

if(job.equals("Waiter"))

{sal=10000;

pf.setEditable(false);}

if(job.equals("Cleaner"))

{sal=5000;

pf.setEditable(false);}

46
txtsal.setText(""+sal);

try{Class.forName("com.mysql.jdbc.Driver");

Connection con=(Connection)DriverManager.getConnection

("jdbc:mysql://localhost/chinatown","root","oom");

Statement stmt=con.createStatement();

String query="select * from emp;";

ResultSet rs=stmt.executeQuery(query);

String a=txteno.getText();

String b=txtname.getText();

String c=(String)cbjob.getSelectedItem();

String d=(String)cbshift.getSelectedItem();

String e=txtsal.getText();

String f=txtHD.getText();

String g=new String (pf.getPassword());

String sql="insert into emp values('"+a+

"','"+b+"','"+c+"','"+d+"','"+e+"','"+f+"','"+g+"');";

int rowEffected=stmt.executeUpdate(sql);

JOptionPane.showMessageDialog(null,"Successfully SignedUp");

txteno.setText("");

txtname.setText("");

txtsal.setText("");

txtHD.setText("");

pf.setText("");

rs.close();

stmt.close();

47
con.close();

catch(HeadlessException e)

{JOptionPane.showMessageDialog(null,"Error in SignUp Process");

} catch (ClassNotFoundException e) {

JOptionPane.showMessageDialog(null,"Error in SignUp Process");

} // TODO add your handling code here:

catch (SQLException e) {

JOptionPane.showMessageDialog(null,"Error in SignUp Process");

4.4.7. Update Employee Data (Module in File menu.)

48
import java.awt.HeadlessException;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.ResultSet;

import java.sql.SQLException;

import java.sql.Statement;

import javax.swing.JOptionPane;

Find Button

String no=txteno.getText();

try{Class.forName("com.mysql.jdbc.Driver");

Connection
con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/chinatown","root","oom");

Statement stmt=con.createStatement();

String query="select * from emp where emp_no='"+no+"'";

ResultSet rs=stmt.executeQuery(query);

if(rs.next())

{ String empno=rs.getString("emp_no");

String HD=rs.getString("HireDate");

String job=rs.getString("Job");

String shift=rs.getString("shift");

String nam=rs.getString("name");

String sa=rs.getString("salary");

49
txtname.setText(""+nam);

txtHD.setText(""+HD);

txtsal.setText(""+sa);

cbjob.setSelectedItem(job);

cbshift.setSelectedItem(shift);

rs.close();

stmt.close();

con.close();

catch(ClassNotFoundException e)

{JOptionPane.showMessageDialog(null,"No Record Found");

} catch (SQLException e) {

JOptionPane.showMessageDialog(null,"No Record Found");

Update Button

try{

Class.forName("com.mysql.jdbc.Driver");

Connection
con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/chinatown","root","oom");

Statement stmt=con.createStatement();

String query="select * from emp;";

ResultSet rs=stmt.executeQuery(query);

50
String o=txteno.getText();

String a=txtname.getText();

String b=(String)cbjob.getSelectedItem();

String c=(String)cbshift.getSelectedItem();

String d=txtHD.getText();

String e=txtsal.getText();

String sql="update emp set Name='"+a+"', Job='"+b+

"', Shift='"+c+

"', HireDate='"+d+

"', salary='"+e+

"' where Emp_no='"+o+"';";

int rowsEffected=stmt.executeUpdate(sql);

txteno.setText("");

txtname.setText("");

txtHD.setText("");

txtsal.setText("");

JOptionPane.showMessageDialog(null,"Successfully Updated Your A/c");

rs.close();

stmt.close();

con.close();

51
catch(HeadlessException e) {

JOptionPane.showMessageDialog(null,"Error in Updation");

} catch (ClassNotFoundException e) {

JOptionPane.showMessageDialog(null,"Error in Updation");

} // TODO add your handling code here:

catch (SQLException e) {

JOptionPane.showMessageDialog(null,"Error in Updation");

Delete Button

try{

Class.forName("com.mysql.jdbc.Driver");

Connection
con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/chinatown","root","oom");

Statement stmt=con.createStatement();

String query="delete from emp where emp_no="+txteno.getText()+";";

stmt.executeUpdate(query);

JOptionPane.showMessageDialog(null,"Deleted Successfully");

txteno.setText("");

txtname.setText("");

txtHD.setText("");

txtsal.setText("");

} catch(HeadlessException e) {

JOptionPane.showMessageDialog(null,"Error in Deletion"); }

52
catch (ClassNotFoundException e) {

JOptionPane.showMessageDialog(null,"Error in Deletion");

} // TODO add your handling code here:

catch (SQLException e) {

JOptionPane.showMessageDialog(null,"Error in Deletion");

Back image button

new items().setVisible(true);

dispose();

 Backend of this project/Software.

Relations in Database.

TABLE – EMP.

53
TABLE - ITEMS.

TABLE – Customer

TABLE – Expense

54
Chapter 5

TESTING & TEST RESULTS

5.1 SOFTWARE TESTING

Software testing is a critical element of software quality assurance and represents the ultimate review of
specification design and coding. Testing is an exposure of a system to trial input to see whether software
meets correct output. Testing cannot be determined whether software meets user’s needs, only whether it
appears to confirm to requirements. Testing can show that a system is free of errors, only that it contains
error. Testing finds errors, it does not correct errors. Software success is a quality product, on time and
within cost. Through testing can reveal critical mistakes.

Testing should therefore, Validate Performance

Detects Errors

Identify Inconsistencies

5.2 Test Objective

 There is strong evidence that effective requirement management leads to overall project cost
savings.
 Requirement errors typically cost well over 10 times more to repair than other errors.
 Requirement errors typically comprise over 40% of all errors in a software project.
 Small reduction in the number of requirement errors pays big dividend in avoided rework costs
and schedule delays.
 System are not designed as entire systems nor are they tested as single systems the analyst must
perform both unit and system testing. For this different level testing are use:

55
5.2.1 Unit Testing

In unit testing Module is tested separately and the programmer simultaneously along with the coding of
the module performs it.

In unit testing the analyst tests the programs making up a system. For this reason, unit testing is
sometime called program testing. Unit testing gives stress on modules independently of one another, to
find errors. This helps the tester in detecting errors in coding and logic that are contained within that
module alone. The errors resulting from the interaction between modules are initially avoided.

Unit testing can be performed from the bottom up, Starting with smallest and lowest-level modules and
proceeding one at a time., for each module in Bottom-up testing a short program is used to execute the
module and provides the needed data, so that the module is asked to perform the way it will when
embedded within the larger system.

5.2.2 System Testing

This is performed after the system is put together. The system is tested against the system requirement to
check if all the requirements are met and if the system performs of specify by the requirements.

Testing is an important function to the success of the system. System testing makes a logical assumption
that if all the parts of the system are correct, the goal will be successfully activated. Another reason for
system testing is its utility as a user-oriented vehicle before implementation.

The function of testing is to detect the defects in the Software. The main goal testing is to uncover
requirement, design and coding errors in the programs.

5.2.3 MODULE TESTING


Module tests are typically dynamic white-box tests. This requires the execution of the software or parts
of the software. The software can be executed in the target system, an emulator, simulator or any other
suitable test environment.
The focus of the tests is:

56
 Set up of regression tests. This means the test environment once set up for a function can be re-
used to check its performance e.g. after maintenance.
 Coverage of the relevant state of the art test methods like equivalence class building, boundary
value analysis and condition coverage are used.

5.2.3 INTEGRATION TESTING


“If they all work individually, they should work when we put them together.” The problem of course is
“putting them together “. This can be done in two ways:
1. Top down integration: Modules are integrated by moving downwards through the control
hierarchy, beginning with main control module are incorporated into the structure in either a
depth first or breadth first manner.
2. Bottom up integration: It begins with construction and testing with atomic modules i.e. modules
at the lowest level of the program structure. Because modules are integrated from the bottom up,
processing required for the modules subordinate to a given level is always available and the need
of stubs is eliminated.

5.2.4 BLACK-BOX TESTING

Black-box testing is a method of software testing that tests the functionality of an application as opposed
to its internal structures or workings.
The system is tested just to assure whether it is meeting all the expectations or requirements from it,
tester is not concerned with the internal logic of the module or system to be tested. Some inputs are
given to system and it is observed whether the system is working as per the client’s requirements or not
or according to the requirements specified in SRS document. Specific knowledge of the application's
code/internal structure and programming knowledge in general is not required.
Test cases are built around specifications and requirements, i.e., what the application is supposed to do.
It uses external descriptions of the software, including specifications, requirements, and designs to
derive test cases. These tests can be functional or non-functional, though usually functional. The test
designer selects valid and invalid inputs and determines the correct output. There is no knowledge of the
test object's internal structure. This method of test can be applied to all levels of software
testing: unit, integration, functional, system and acceptance. It typically comprises most if not all testing

57
at higher levels, but can also dominate unit testing as well. Black box testing or functional testing is used
to check that the outputs of a program, given certain inputs, conform to the functional specification of
the program. The term black box indicates that the tester does not examine the internal implementation
of the program being executed

5.2.5 WHITE-BOX TESTING


A software testing technique where by explicit knowledge, the internal workings of the item being tested
are used to select the test data. Unlike black box testing, white box testing uses specific knowledge of
programming code to examine outputs. The test is accurate only if the tester knows what the program is
supposed to do. He or she can then see if the program diverges from its intended goal. White box testing
does not account for errors caused by omission, and all visible code must also be readable.

Contrary to black-box testing, software is viewed as a white-box, or glass-box in white-box testing, as


the structure and flow of the software under test are visible to the tester. Testing plans are made
according to the details of the software implementation, such as programming language, logic, and
styles. Test cases are derived from the program structure. White-box testing is also called glass-box
testing, logic-driven testing or design-based testing. There are many techniques available in white-box
testing, because the problem of intractability is eased by specific knowledge and attention on the
structure of the software under test.

58
Chapter 6

CONCLUSION
Now a day’s there is a big demand of different types of applications, which is because IT has become
the main part of our New World. There is a big need of different applications. People want application
for every specific task from work to entertainment.

The application has been tested on platform of java and found to be working as per the given criteria. It
can be safely concluded that the application possesses a highly efficient UI system and is working
properly and meeting to all the requirements of the user.

FUTURE SCOPE

Every project whether large or small has some limitations no matter however diligently
developed. In some cases limitations is small while in other cases they may be broad also. The new
system has got some limitations. Major areas where modifications can be done are as follows:

 Our system is not online so further it can be improved. We are working to take data on cloud.
 The security is limited so some additional arrangement could be made to provide more security
to the system.
 There is no Conversion of data that can be imported to excel or pdf. It soon will be upgraded for
that.

59
BIBLOGRAPHY

 http://wikipedia.com
 Java The Complete Reference, by Herbert Schildt

60

Potrebbero piacerti anche