You are on page 1of 70

BILLING SOFTWARE USING PYTHON:

Objective

This section presents a conceptual overview of the solution, and then provides an
introduction to its requirements.
Solution Concept

The E- Billing and Invoice System consist of:

 Customer, Products, Billing Generation: Automate the current manual bill


generation system and maintain the searchable customer, products database
and product invoice, maintain the data security, user rights.
 Report Generation: A Report Generation system will be developed for the user
and management of E- Billing and Invoicing System. This MIS system will have
both details and summary type reports for analysis the sales volume, sales trend,
available stock

Part of the solution will involve converting data from Microsoft Excel to the Database,
system can import existing customer, product data from predefined MS Excel, CSV
format. It reduces the data entry work and quick implementation of the system.

1
1. Introduction

1.1. Overview of Proposed System

1.1.1 Existing System:

The client uses MS Excel, and maintains their product list, customer list, and prints the
invoice, however it is not possible them to share the data from multiple system in multi
user environment, there is lot of duplicate work, and chance of mistake. When the
product price are changed they need to update each and every excel file. There is no
option to find and print previous saved invoice. There is no security; any body can access
any report and sensitive data, also no reports to find out the sales volume, stock list, and
summary report

1.1.2 Proposed System:

. This E-Billing and invoicing system is used to overcome the entire problem which they
are facing currently, and making complete atomization of manual billing and invoicing
system
2. System Analysis

The following preliminary lists are based on initial interviews

2.1 Business Requirements:

The business goal for the application is to support an increase the productivity and
complete automation of existing manual bill and invoice generation process. Business
requirements are discussed in the Scope section, with the following additional detail:

 Sales representatives need a method to store and access sales opportunity data,
and when a sale is generated, convert some or all of the information into a sales
order without re-entering information.
 Each sales representative should receive customer and sales data pertinent only to
them.
 The accountant should be able to enter or update product information in one
interface only, with all necessary product information being received by sales
staff.
 Manager must receive his or her customer and appointment data plus detailed and
rollup information for each sales representative on his or her team.
 The application should support the capability to use multi user environment.

 The MIS Executive should able to generate all type of reports as and when
required by the management.

The sales staff wants to improve their current ability to analyze their customers. In
particular, they want to focus on identifying their best customers and building long-term
relationships within that base. To enable them to accomplish this goal, they want to
extract meaningful data that easily answers the following questions:

 What are the early warning signs of problems?

 Who are my best customers across product lines?


 With whom do I focus my efforts for building a long-term relationship?
 What are my customers' issues as groups?

 Geographically, where are my best customers?

 What products are my customers buying and at what rate?

2.2 User Requirements:

User requirements are categorized by user type.


Sales Staff (Representatives and Managers)
 View the data in various ways, for example:

o Customers who are the top buyers of specific items

o Best customers based on criteria to be determined

o Best customers based on geographical analysis

o Drops in a customer's sales

 Store multilingual and multiregional information in the database rather than


relying on the sales staff to translate the information
 Identify which product prices have been modified, especially on current orders in
progress
 Use opportunity rules, which are statements that help the sales representative
convert an opportunity into a sale
 Add third-party data sources and financial evaluation tools

 Identify where promotions and programs would be the most beneficial

 Apply discounts to customer orders:

o Sales representatives can offer discounts up to 15 percent, or up to 20


percent with authorization.
o Sales managers can offer discounts up to 20 percent

 Enable capture, analysis, and sharing of data about a customer across the
company
 Use forecasts to establish sales goals
 Allow all staff to view all contacts, but allow each contact to be assigned to a sales
representative

Accountant

 Update product details, including price, photo, and description

 Add, delete, and update product specifications

 Generate stock reports and check the availability, order the item as and when
needed.

MIS Executive

 Generate Reports as per requirement.

 Share the data, and convert reports to different format like Text, CSV.

2.3 Operational Requirements:

The following requirements provide a high-level view of how the system will run:

 Processor usage should not exceed 80 percent during concurrent uses.

 Backups will occur incrementally throughout the day.

 A full weekly backup is required to WORM drives.

 Ensure that information is easy to access either, and meaningful for the sales
representative and the company.
 Minimize the technical knowledge that sales and marketing staff need to access
the data, generate ad hoc queries, track promotions, and view customer
segmentation information.
 Any change to information must be reflected immediately, and the changes must
be propagated to the search engine so that employees that perform searches see
this new information.
 The application should work with the existing communications and networking
infrastructure.
 The application should deploy with a minimum of additional operational
processes, manual or otherwise.

2.4 System Requirements:

These are additional constraints from a system perspective:

 Previous data of customer, product details must be imported in the new system.

 The administrator must be able to monitor everything from the IT department.

 The information must be accessible by everyone in the company as per the rights
specify.

Success Criteria

To determine the success of this project, the following metrics can be quantified and used
to analyze success factors.

Sales Automation

 Problem customer identification. Ability to identify top 10 developing problem


customers by sales representative.
 Identification of best customers across product lines and regions. All customers
can be sorted by the factors (to be determined) that rank them qualitatively.
Variable sorts and rankings can be chosen by the sales representative.
 Identification of issues across groups. All customers can be sorted by the issues
(to be determined) within group categories that can be updated. Variable sorts
and rankings can be chosen by the sales representative or other user.
 Analysis of quantities and rates of products. Products can be sorted by the
quantity and dates sold. Variable sorts and rankings can be chosen by the user.
2.5 Software and Hardware Requirement:

General Requirement for Server/Client:

Type Software Hardware


Work Station/ Node 1. Windows XP 1. P-4
2. VB Run time 2. RAM -256 MB
3. MS Office
Database Server 1.Win2000 Advance Server 1.P-4
2.RAM- 2GB
3.Hard Disk-160GB
4.RAID
Application Server 1.Win 2000 Advance Server 1.P-4
2.RAM- 1GB
3.Hard Disk-40GB
Development Tools and Technologies

SOFTWARE ENVIRONMENT:

INRODUCTION ABOUT PYTHON:

Python is an easy to learn, powerful programming language. It has efficient high-level data structures
and a simple but effective approach to object-oriented programming. Python’s elegant syntax and
dynamic typing, together with its interpreted nature, make it an ideal language for scripting and rapid
application development in many areas on most platforms.

The Python interpreter and the extensive standard library are freely available in source or binary
form for all major platforms from the Python Web site, https://www.python.org/, and may be freely
distributed. The same site also contains distributions of and pointers to many free third party Python
modules, programs and tools, and additional documentation.

The Python interpreter is easily extended with new functions and data types implemented in C or C+
+ (or other languages callable from C). Python is also suitable as an extension language for
customizable applications.

This tutorial introduces the reader informally to the basic concepts and features of the Python
language and system. It helps to have a Python interpreter handy for hands-on experience, but all
examples are self-contained, so the tutorial can be read off-line as well.

For a description of standard objects and modules, see The Python Standard Library. The Python
Language Reference gives a more formal definition of the language. To write extensions in C or C+
+, read Extending and Embedding the Python Interpreter and Python/C API Reference Manual.
There are also several books covering Python in depth.

This tutorial does not attempt to be comprehensive and cover every single feature, or even every
commonly used feature. Instead, it introduces many of Python’s most noteworthy features, and will
give you a good idea of the language’s flavor and style. After reading it, you will be able to read and
write Python modules and programs, and you will be ready to learn more about the various Python
library modules described in The Python Standard Library.

Data Structures

This chapter describes some things you’ve learned about already in more detail, and adds some new
things as well.

5.1. More on Lists

The list data type has some more methods. Here are all of the methods of list objects:

list.append(x)
Add an item to the end of the list. Equivalent to a[len(a):] = [x].

list.extend(iterable)
Extend the list by appending all the items from the iterable. Equivalent to a[len(a):] = iterable.

list.insert(i, x)
Insert an item at a given position. The first argument is the index of the element before which
to insert, so a.insert(0, x) inserts at the front of the list, and a.insert(len(a), x) is equivalent
to a.append(x).

list.remove(x)
Remove the first item from the list whose value is equal to x. It raises a ValueError if there is
no such item.

list.pop([i])
Remove the item at the given position in the list, and return it. If no index is
specified, a.pop() removes and returns the last item in the list. (The square brackets around
the i in the method signature denote that the parameter is optional, not that you should type
square brackets at that position. You will see this notation frequently in the Python Library
Reference.)

list.clear()
Remove all items from the list. Equivalent to del a[:].
list.index(x[, start[, end]])
Return zero-based index in the list of the first item whose value is equal to x. Raises
a ValueError if there is no such item.

The optional arguments start and end are interpreted as in the slice notation and are used to
limit the search to a particular subsequence of the list. The returned index is computed
relative to the beginning of the full sequence rather than the start argument.

list.count(x)
Return the number of times x appears in the list.

list.sort(*, key=None, reverse=False)
Sort the items of the list in place (the arguments can be used for sort customization,
see sorted() for their explanation).

list.reverse()
Reverse the elements of the list in place.

list.copy()
Return a shallow copy of the list. Equivalent to a[:].

Modules

If you quit from the Python interpreter and enter it again, the definitions you have made (functions
and variables) are lost. Therefore, if you want to write a somewhat longer program, you are better off
using a text editor to prepare the input for the interpreter and running it with that file as input instead.
This is known as creating a script. As your program gets longer, you may want to split it into several
files for easier maintenance. You may also want to use a handy function that you’ve written in
several programs without copying its definition into each program.

To support this, Python has a way to put definitions in a file and use them in a script or in an
interactive instance of the interpreter. Such a file is called a module; definitions from a module can
be imported into other modules or into the main module (the collection of variables that you have
access to in a script executed at the top level and in calculator mode).
A module is a file containing Python definitions and statements. The file name is the module name
with the suffix .py appended. Within a module, the module’s name (as a string) is available as the
value of the global variable __name__. For instance, use your favorite text editor to create a file
called fibo.py in the current directory with the following contents:

More on Modules

A module can contain executable statements as well as function definitions. These statements are
intended to initialize the module. They are executed only the first time the module name is
encountered in an import statement. 1 (They are also run if the file is executed as a script.)

Each module has its own private symbol table, which is used as the global symbol table by all
functions defined in the module. Thus, the author of a module can use global variables in the module
without worrying about accidental clashes with a user’s global variables. On the other hand, if you
know what you are doing you can touch a module’s global variables with the same notation used to
refer to its functions, modname.itemname.

Modules can import other modules. It is customary but not required to place all import statements at
the beginning of a module (or script, for that matter). The imported module names are placed in the
importing module’s global symbol table.

There is a variant of the import statement that imports names from a module directly into the
importing module’s symbol table. For example:

Input and Output

So far we’ve encountered two ways of writing values: expression statements and the print() function.


(A third way is using the write() method of file objects; the standard output file can be referenced
as sys.stdout. See the Library Reference for more information on this.)

Often you’ll want more control over the formatting of your output than simply printing space-
separated values. There are several ways to format output.
 To use formatted string literals, begin a string with f or F before the opening quotation mark
or triple quotation mark. Inside this string, you can write a Python expression
between { and } characters that can refer to variables or literal values

Reading and Writing Files

The first argument is a string containing the filename. The second argument is another string
containing a few characters describing the way in which the file will be used. mode can be 'r' when
the file will only be read, 'w' for only writing (an existing file with the same name will be erased),
and 'a' opens the file for appending; any data written to the file is automatically added to the
end. 'r+' opens the file for both reading and writing. The mode argument is optional; 'r' will be
assumed if it’s omitted.

Normally, files are opened in text mode, that means, you read and write strings from and to the file,
which are encoded in a specific encoding. If encoding is not specified, the default is platform
dependent (see open()). 'b' appended to the mode opens the file in binary mode: now the data is read
and written in the form of bytes objects. This mode should be used for all files that don’t contain text.

In text mode, the default when reading is to convert platform-specific line endings (\n on
Unix, \r\n on Windows) to just \n. When writing in text mode, the default is to convert occurrences
of \n back to platform-specific line endings. This behind-the-scenes modification to file data is fine
for text files, but will corrupt binary data like that in JPEG or EXE files. Be very careful to use
binary mode when reading and writing such files.

It is good practice to use the with keyword when dealing with file objects. The advantage is that the
file is properly closed after its suite finishes, even if an exception is raised at some point.
Using with is also much shorter than writing equivalent try-finally blocks:

Errors and Exceptions


Until now error messages haven’t been more than mentioned, but if you have tried out the
examples you have probably seen some. There are (at least) two distinguishable kinds of
errors: syntax errors and exceptions.

Syntax Errors
Syntax errors, also known as parsing errors, are perhaps the most common kind of complaint you get
while you are still learning Python:
The parser repeats the offending line and displays a little ‘arrow’ pointing at the earliest point in the
line where the error was detected. The error is caused by (or at least detected at) the
token preceding the arrow: in the example, the error is detected at the function print(), since a colon
(':') is missing before it. File name and line number are printed so you know where to look in case the
input came from a script.

Exceptions

Even if a statement or expression is syntactically correct, it may cause an error when an attempt is
made to execute it. Errors detected during execution are called exceptions and are not
unconditionally fatal: you will soon learn how to handle them in Python programs. Most exceptions
are not handled by programs, however, and result in error messages as shown here:

The last line of the error message indicates what happened. Exceptions come in different types, and
the type is printed as part of the message: the types in the example
are ZeroDivisionError, NameError and TypeError. The string printed as the exception type is the
name of the built-in exception that occurred. This is true for all built-in exceptions, but need not be
true for user-defined exceptions (although it is a useful convention). Standard exception names are
built-in identifiers (not reserved keywords).

The rest of the line provides detail based on the type of exception and what caused it.

The preceding part of the error message shows the context where the exception occurred, in the form
of a stack traceback. In general it contains a stack traceback listing source lines; however, it will not
display lines read from standard input.

Classes

Classes provide a means of bundling data and functionality together. Creating a new class creates a
new type of object, allowing new instances of that type to be made. Each class instance can have
attributes attached to it for maintaining its state. Class instances can also have methods (defined by
its class) for modifying its state.
Compared with other programming languages, Python’s class mechanism adds classes with a
minimum of new syntax and semantics. It is a mixture of the class mechanisms found in C++ and
Modula-3. Python classes provide all the standard features of Object Oriented Programming: the
class inheritance mechanism allows multiple base classes, a derived class can override any methods
of its base class or classes, and a method can call the method of a base class with the same name.
Objects can contain arbitrary amounts and kinds of data. As is true for modules, classes partake of
the dynamic nature of Python: they are created at runtime, and can be modified further after creation.

In C++ terminology, normally class members (including the data members) are public (except see
below Private Variables), and all member functions are virtual. As in Modula-3, there are no
shorthands for referencing the object’s members from its methods: the method function is declared
with an explicit first argument representing the object, which is provided implicitly by the call. As in
Smalltalk, classes themselves are objects. This provides semantics for importing and renaming.
Unlike C++ and Modula-3, built-in types can be used as base classes for extension by the user. Also,
like in C++, most built-in operators with special syntax (arithmetic operators, subscripting etc.) can
be redefined for class instances.

(Lacking universally accepted terminology to talk about classes, I will make occasional use of
Smalltalk and C++ terms. I would use Modula-3 terms, since its object-oriented semantics are closer
to those of Python than C++, but I expect that few readers have heard of it.)

9.1. A Word About Names and Objects

Objects have individuality, and multiple names (in multiple scopes) can be bound to the same object.
This is known as aliasing in other languages. This is usually not appreciated on a first glance at
Python, and can be safely ignored when dealing with immutable basic types (numbers, strings,
tuples). However, aliasing has a possibly surprising effect on the semantics of Python code involving
mutable objects such as lists, dictionaries, and most other types. This is usually used to the benefit of
the program, since aliases behave like pointers in some respects. For example, passing an object is
cheap since only a pointer is passed by the implementation; and if a function modifies an object
passed as an argument, the caller will see the change — this eliminates the need for two different
argument passing mechanisms as in Pascal.

9.2. Python Scopes and Namespaces


Before introducing classes, I first have to tell you something about Python’s scope rules. Class
definitions play some neat tricks with namespaces, and you need to know how scopes and
namespaces work to fully understand what’s going on. Incidentally, knowledge about this subject is
useful for any advanced Python programmer.

Let’s begin with some definitions.

A namespace is a mapping from names to objects. Most namespaces are currently implemented as
Python dictionaries, but that’s normally not noticeable in any way (except for performance), and it
may change in the future. Examples of namespaces are: the set of built-in names (containing
functions such as abs(), and built-in exception names); the global names in a module; and the local
names in a function invocation. In a sense the set of attributes of an object also form a namespace.
The important thing to know about namespaces is that there is absolutely no relation between names
in different namespaces; for instance, two different modules may both define a
function maximize without confusion — users of the modules must prefix it with the module name.

By the way, I use the word attribute for any name following a dot — for example, in the
expression z.real, real is an attribute of the object z. Strictly speaking, references to names in
modules are attribute references: in the expression modname.funcname, modname is a module object
and funcname is an attribute of it. In this case there happens to be a straightforward mapping between
the module’s attributes and the global names defined in the module: they share the same
namespace! 1

Attributes may be read-only or writable. In the latter case, assignment to attributes is possible.
Module attributes are writable: you can write modname.the_answer = 42. Writable attributes may
also be deleted with the del statement. For example, del modname.the_answer will remove the
attribute the_answer from the object named by modname.

Namespaces are created at different moments and have different lifetimes. The namespace containing
the built-in names is created when the Python interpreter starts up, and is never deleted. The global
namespace for a module is created when the module definition is read in; normally, module
namespaces also last until the interpreter quits. The statements executed by the top-level invocation
of the interpreter, either read from a script file or interactively, are considered part of a module
called __main__, so they have their own global namespace. (The built-in names actually also live in
a module; this is called builtins.)

The local namespace for a function is created when the function is called, and deleted when the
function returns or raises an exception that is not handled within the function. (Actually, forgetting
would be a better way to describe what actually happens.) Of course, recursive invocations each have
their own local namespace.

A scope is a textual region of a Python program where a namespace is directly accessible. “Directly
accessible” here means that an unqualified reference to a name attempts to find the name in the
namespace.

Although scopes are determined statically, they are used dynamically. At any time during execution,
there are 3 or 4 nested scopes whose namespaces are directly accessible:

 the innermost scope, which is searched first, contains the local names
 the scopes of any enclosing functions, which are searched starting with the nearest enclosing
scope, contains non-local, but also non-global names
 the next-to-last scope contains the current module’s global names
 the outermost scope (searched last) is the namespace containing built-in names

If a name is declared global, then all references and assignments go directly to the middle scope
containing the module’s global names. To rebind variables found outside of the innermost scope,
the nonlocal statement can be used; if not declared nonlocal, those variables are read-only (an
attempt to write to such a variable will simply create a new local variable in the innermost scope,
leaving the identically named outer variable unchanged).

Usually, the local scope references the local names of the (textually) current function. Outside
functions, the local scope references the same namespace as the global scope: the module’s
namespace. Class definitions place yet another namespace in the local scope.

It is important to realize that scopes are determined textually: the global scope of a function defined
in a module is that module’s namespace, no matter from where or by what alias the function is called.
On the other hand, the actual search for names is done dynamically, at run time — however, the
language definition is evolving towards static name resolution, at “compile” time, so don’t rely on
dynamic name resolution! (In fact, local variables are already determined statically.)

A special quirk of Python is that – if no global or nonlocal statement is in effect – assignments to


names always go into the innermost scope. Assignments do not copy data — they just bind names to
objects. The same is true for deletions: the statement del x removes the binding of x from the
namespace referenced by the local scope. In fact, all operations that introduce new names use the
local scope: in particular, import statements and function definitions bind the module or function
name in the local scope.

The global statement can be used to indicate that particular variables live in the global scope and
should be rebound there; the nonlocal statement indicates that particular variables live in an
enclosing scope and should be rebound there.

Virtual Environments and Packages


12.1. Introduction

Python applications will often use packages and modules that don’t come as part of the standard
library. Applications will sometimes need a specific version of a library, because the application may
require that a particular bug has been fixed or the application may be written using an obsolete
version of the library’s interface.

This means it may not be possible for one Python installation to meet the requirements of every
application. If application A needs version 1.0 of a particular module but application B needs version
2.0, then the requirements are in conflict and installing either version 1.0 or 2.0 will leave one
application unable to run.

The solution for this problem is to create a virtual environment, a self-contained directory tree that
contains a Python installation for a particular version of Python, plus a number of additional
packages.

Different applications can then use different virtual environments. To resolve the earlier example of
conflicting requirements, application A can have its own virtual environment with version 1.0
installed while application B has another virtual environment with version 2.0. If application B
requires a library be upgraded to version 3.0, this will not affect application A’s environment.
12.2. Creating Virtual Environments

The module used to create and manage virtual environments is called venv. venv will usually install
the most recent version of Python that you have available. If you have multiple versions of Python on
your system, you can select a specific Python version by running python3 or whichever version you
want.

To create a virtual environment, decide upon a directory where you want to place it, and run
the venv module as a script with the directory path:

What Now?

Reading this tutorial has probably reinforced your interest in using Python — you should be eager to
apply Python to solving your real-world problems. Where should you go to learn more?

This tutorial is part of Python’s documentation set. Some other documents in the set are:

 The Python Standard Library:

You should browse through this manual, which gives complete (though terse) reference
material about types, functions, and the modules in the standard library. The standard Python
distribution includes a lot of additional code. There are modules to read Unix mailboxes,
retrieve documents via HTTP, generate random numbers, parse command-line options, write
CGI programs, compress data, and many other tasks. Skimming through the Library
Reference will give you an idea of what’s available.
 Installing Python Modules explains how to install additional modules written by other Python
users.
 The Python Language Reference: A detailed explanation of Python’s syntax and semantics.
It’s heavy reading, but is useful as a complete guide to the language itself.

More Python resources:

 https://www.python.org: The major Python Web site. It contains code, documentation, and
pointers to Python-related pages around the Web. This Web site is mirrored in various places
around the world, such as Europe, Japan, and Australia; a mirror may be faster than the main
site, depending on your geographical location.
 https://docs.python.org: Fast access to Python’s documentation.
 https://pypi.org: The Python Package Index, previously also nicknamed the Cheese Shop 1, is
an index of user-created Python modules that are available for download. Once you begin
releasing code, you can register it here so that others can find it.
 https://code.activestate.com/recipes/langs/python/: The Python Cookbook is a sizable
collection of code examples, larger modules, and useful scripts. Particularly notable
contributions are collected in a book also titled Python Cookbook (O’Reilly & Associates,
ISBN 0-596-00797-3.)
 http://www.pyvideo.org collects links to Python-related videos from conferences and user-
group meetings.
 https://scipy.org: The Scientific Python project includes modules for fast array computations
and manipulations plus a host of packages for such things as linear algebra, Fourier
transforms, non-linear solvers, random number distributions, statistical analysis and the like.


3. System Design

3.1 UML Diagrams

3.1.1 Class Diagrams


3.1.2 Activity Diagrams
3.1.3 Sequence Diagrams

3.1.4 Data Flow Diagrams


3.2 Data Dictionary
Table : product_master

Owner: dbo

Destination DB name: ebill

Number of columns: 5

Number of indexes: 2

Number of foreign keys: 0

Extended attributes:

OnFileGroup PRIMARY

Clustered PK Yes

Columns Data Allow NULLsValue/ran


type
ge

Sno int Not allowed


ProdType nvarchar(60) Not allowed
ProdSubType nvarchar(60) Not allowed
Rate int Not allowed
isactive nvarchar(30) Not allowed

Indexes Type Columns


PK_ProductMaster_sno clustered, unique, sno

primary key located on


PRIMARY

Table : bill

Owner:dbo
Destination DB name: ebill

Number of columns: 15

Number of indexes: 3

Number of foreign keys: 0

Extended attributes:

OnFileGroup PRIMARY

Clustered PK Yes
Columns Data Allow Value/ra
type n
NULLs
ge
sno int Not allowed
invoiceno nvarchar(60) Not allowed
canme nvarchar(60) Not allowed
Invoice_date datetime Not allowed
location nvarchar(60) Not allowed
chalan_no int Not allowed
customer_name nvarchar(100) Not allowed
Customer_address1 nvarchar(100) Not allowed
Customer_address2 nvarchar(100) Allowed
Total_amt int Not allowed
discount int Not allowed
Amt_words nvarchar(100) Not allowed
Paid_type nvarchar(60) Not allowed
Cheque_no nvarchar(60) Allowed
Entry_date datetime Not allowed

Indexes Type Columns

PK_Bill_SNO clustered, unique, sno


primary key located on
PRIMARY
IX_bill_cname nonclustered located on
cname
PRIMARY invoiceno
IX_bill_invoiceno nonclustered, unique
located on PRIMARY

Table : bill_details

Owner: dbo

Destination DB name: ebill

Number of columns: 6

Number of indexes: 3
Number of foreign keys: 2

Extended attributes:

OnFileGroup PRIMARY

Clustered PK Yes

Columns Data type Allow Value/ran


NULLs ge
sno int Not allowed
Bill_sno int Not allowed
Prod_sno nvarchar(60) Not allowed
qty datetime Not allowed
rate nvarchar(60) Not allowed
amt int Not allowed

Indexes Type Columns

PK_Bill_details_SNO clustered, unique, sno


primary key located on
PRIMARY
IX_bill_details_bill_sno nonclustered located on
Bill_sno
PRIMARY Prod_sno
IX_bill_deatils_prod_sno nonclustered, unique

located on PRIMARY

Table : Company_master

Owner: dbo

Destination DB name: ebill

Number of columns: 7

Number of indexes: 2

Number of foreign keys: 0

Extended attributes:

OnFileGroup PRIMARY
Clustered PK Yes

Columns Data Allow Value/ra


type n
NULLs
ge

Company_name nvarchar(60) Not allowed


Address1 nvarchar(100) Not allowed
Address2 nvarchar(100) Allowed
city nvarchar(60) Not allowed
pin int Not allowed
telephone nvarchar(60) Not allowed
vatno nvarchar(60) Not allowed
Indexes Type Columns
PK_comapny_master_company clustered, unique, Comapnay_nam
primary key located on
_name e
PRIMARY
IX_ comapny_master_pin nonclustered located on pin

PRIMARY

Table : user_master

Owner: dbo

Destination DB name: ebill

Number of columns: 3

Number of indexes: 2

Number of foreign keys: 0

Extended attributes:

OnFileGroup PRIMARY

Clustered PK Yes

Columns Data Allow Value/ra


type n
NULLs
ge

user_name nvarchar(60) Not allowed


User_password nvarchar(60) Not allowed
User_type nvarchar(60) Allowed
Indexes Type Columns
PK_user_master_user_name clustered, unique, user_name
primary key located on
PRIMARY
IX_ user_master_user_type nonclustered located on
User_type
PRIMARY
4. Implementation

FrmLogin
# module mane: main
import read
import purchase
import write

again = "Y"
while again.upper() == "Y":
a = read.read_file()
b = purchase.purchase(a)
write.over_write(a, b)
again = input("\nDoes the any new customer waiting to buy product? ")
print("\nThank you for shopping from our store!!")
print("Please check your invoice for your shopping details, \nWhich we created txt file format for
you.")
"""
module name: purchase
function name: purchase
overview of this function:
1) Customer interaction for what and how much the want buy.
2) check the user interaction valid or not with exception handelling.
3) calculating the customer purchase product with discount(if discountable)
4) show the last update of the product
5) write the invoice for customer with unique naming
"""

def purchase(List):
L = List # assign list with variable name 'L'.
a_name = input("Please enter your name: ")
print("\nHello " + a_name + "! Welcome to our Electronic Store.\nLook at above and select
product as your choice.")
q = {} # assign empty dictionary with variable name 'q'.
flag = "Y"
while flag.upper() == "Y": # check and go if flag is 'Y' or 'y'.
product = input("\nWhat product do you want to buy? ")
product_name = product.upper() # change the string value in the upper case.

if product_name == L[0][0].upper() \
or product_name == L[1][0].upper() \
or product_name == L[2][0].upper(): # check the user entered product name with stock of
store
p = True
while p == True:
try:
p_quantity = int(input("How many " + product + " do you want to buy: "))
p = False
except: # executes, if customer entered unexpected value.
print("\t\tError!!!\nPlease enter integer value!! ")
if product_name == L[0][0].upper() and p_quantity <= int(L[0][2]):
q[product_name] = p_quantity
elif product_name == L[1][0].upper() and p_quantity <= int(L[1][2]):
q[product_name] = p_quantity
elif product_name == L[2][0].upper() and p_quantity <= int(L[2][2]):
q[product_name] = p_quantity
else:
print(
"\nSorry!! " + a_name + "!, " + product + " is out of stock.\nWe will add stock of " +
product + " later. \nLets hope, you will get this product after next shopping.\n")

flag = (input(a_name + " do you want buy more products?(Y/N)"))


else:
print("sorry!! " + product + " is not available in our store.")
print("\nChoose from following products please!")
print("--------------------------------------------")
print("PRODUCT\t\tPRICE\t\tQUANTITY")
print("--------------------------------------------")
for i in range(len(L)):
print(L[i][0], "\t\t", L[i][1], "\t\t",
L[i][2]) # print, last updated product name, quantity and price.
print("--------------------------------------------")

print("\nYou Choosed Items and it's Quantity respectively:\n", q, "\n")


'''
In the following operation:
1) change every string value in the upper case latter.
2) check what is the product entered by customer.
3) executes respective condition if product is phone or laptop or hdd entered by customer.
'''
f_amount = 0 # final amount
for keys in q.keys():
if keys == L[0][0].upper(): # executes this operation if product is phone entered by customer.
p_price = int(L[0][1])
p_num = int(q[keys])
p_amount = (p_price * p_num)
f_amount += (p_price * p_num)
print("\nTotal cost for phone: ", p_amount)
elif keys == L[1][0].upper(): # executes this operation if product is laptop entered by customer.
l_price = int(L[1][1])
l_num = int(q[keys])
l_amount = (l_price * l_num)
f_amount += (l_price * l_num)
print("Total cost for laptop: ", l_amount)
else: # executes this operation if product is hdd entered by customer.
h_price = int(L[2][1])
h_num = int(q[keys])
h_amount = (h_price * h_num)
f_amount += (h_price * h_num)
print("Total cost for HDD: ", h_amount)
print("\nYour discountable total amount is: ", f_amount)

'''
In the following operation:
1) ask to customer for expected discount % in total purchase amount.
2) check the total purchase amount which is dcustomer expected discountable or not.
3) check the total purchase amount which is basic discountable or not.
'''
disc = float(input("Please enter your expected discount (%): "))
dis = 0.0
if (f_amount >= 5000) and (f_amount < 10000):
discount = disc
if discount <= 5.0:
dis = (discount * f_amount) / 100
total = float(f_amount - dis)
print("You got your expected " + str(disc) + "% discount and amount is: ", dis)
else:
discount = 5.0
dis = (discount * f_amount) / 100
total = float(f_amount - dis)
print("You did not got your expected " + str(
disc) + "% discount\nBecause, your totel purchase is not meet the minimum criteria for " +
str(
disc) + "% discount.")
print("You got basic 5% discount and discounted amount is:", dis)
elif f_amount >= 10000:
discount = disc
if discount <= 10.0:
dis = (discount * f_amount) / 100
total = float(f_amount - dis)
print("You got your expected " + str(disc) + "% discount and amount is: ", dis)
else:
discount = 10.0
dis = (discount * f_amount) / 100
total = float(f_amount - dis)
print("You did not got your expected " + str(
disc) + "% discount\nBecause, your totel purchase is not meet the minimum criteria for " +
str(
disc) + "% discount.")
print("You got basic 10% discount and discounted amount is:", dis)
else:
discount = 0.0
total = float(f_amount)
print("You did not got your expected " + str(
disc) + "% discount\nBecause, your totel purchase is not meet the minimum criteria for " +
str(
disc) + "% discount.")
print("Your payable amount is: ", total)

'''
In the following operation:
1) write a each unique involve name which includes current date and time with customer name
as well.
2) write a purchase product name and details in file (invoice).
3) write a discounted amount and final payable amount in file (invoice).
'''

import datetime # import system date and time for create a unique invoive name.
dt = str(datetime.datetime.now().year) + "-" + str(datetime.datetime.now().month) + "-" + str(
datetime.datetime.now().day) + "-" + str(datetime.datetime.now().hour) + "-" + str(
datetime.datetime.now().minute) + "-" + str(datetime.datetime.now().second)
invoice = str(dt) # unique invoice
t = str(datetime.datetime.now().year) + "-" + str(datetime.datetime.now().month) + "-" + str(
datetime.datetime.now().day) # date
d = str(t) # date
u = str(datetime.datetime.now().hour) + ":" + str(datetime.datetime.now().minute) + ":" + str(
datetime.datetime.now().second) # time
e = str(u) # time

file = open(invoice + " (" + a_name + ").txt", "w") # generate a unique invoive name and open it
in write mode.
file.write("=============================================================")
file.write("\nELECTRONIC STORE\t\t\t\tINVOICE")
file.write("\n\nInvoice: " + invoice + "\t\tDate: " + d + "\n\t\t\t\t\tTime: " + e + "")
file.write("\nName of Customer: " + str(a_name) + "")
file.write("\n=============================================================
")
file.write("\nPARTICULAR\tQUANTITY\tUNIT PRICE\tTOTAL")
file.write("\n-------------------------------------------------------------")

for keys in q.keys(): # In this loop, write in a file only those product which is purchase by user.
if keys == "PHONE":
file.write(
str("\n" + str(keys) + " \t\t " + str(q['PHONE']) + " \t\t " + str(L[0][1]) + " \t\t " +
str(p_amount)))
elif keys == "LAPTOP":
file.write(str(
"\n" + str(keys) + " \t\t " + str(q['LAPTOP']) + " \t\t " + str(L[1][1]) + " \t\t " +
str(l_amount)))
else:
file.write(
str("\n" + str(keys) + " \t\t " + str(q['HDD']) + " \t\t " + str(L[2][1]) + " \t\t " +
str(h_amount)))

file.write("\n\n-------------------------------------------------------------")
file.write("\n\t\t\tYour discountable amount: " + str(f_amount))
file.write("\n-------------------------------------------------------------")
file.write("\n\t\t Your " + str(discount) + "% discounted amount is: " + str(dis))
file.write("\n-------------------------------------------------------------")
file.write("\n\t\t\t Your payable amount is: " + str(total))
file.write("\n-------------------------------------------------------------")
file.write("\n\n\tThank You " + a_name + " for your shopping.\n\t\tSee you again!")
file.write("\n=============================================================
")
file.close()
return q
# -*- coding: utf-8 -*-

from tkinter import *


from tkinter import messagebox
import random
import time;
import datetime

root = Tk()
root.geometry("950x525+0+0")
root.title("Billing Machine")

Tops = Frame(root, width=1350, height=750, bd=0, relief="raise")


Tops.pack(side=TOP)

f1 = Frame(root, width=900, height=525, bd=0, relief="raise")


f1.pack(side=LEFT)
f2 = Frame(root, width=440, height=525, bd=1, relief="raise")
f2.pack(side=TOP)

f1a = Frame(f1, width=900, height=330, bd=0, relief="raise")


f1a.pack(side=TOP)
f2a = Frame(f1, width=900, height=320, bd=0, relief="raise")
f2a.pack(side=BOTTOM)

f1aa = Frame(f1a, width=400, height=430, bd=0, relief="raise")


f1aa.pack(side=LEFT)
f1ab = Frame(f1a, width=400, height=430, bd=0, relief="raise")
f1ab.pack(side=RIGHT)

f2aa = Frame(f2a, width=450, height=330, bd=0, relief="raise")


f2aa.pack(side=LEFT)
f2ab = Frame(f2a, width=450, height=330, bd=1, relief="raise")
f2ab.pack(side=RIGHT)

lblInfo=Label(Tops, font=('arial',60,'bold'), text=" Online Billing System ", bd=10,


anchor='w')
lblInfo.grid(row=0, column=0)

#====Calculator=====

text_Input = StringVar()
operator=""
PaymentRef = StringVar()
pizza = StringVar()
burger = StringVar()
drink = StringVar()
HomeDelivery = StringVar()
PaidTax = StringVar()
SubTotal = StringVar()
TotalCost = StringVar()
Costofpizza = StringVar()
Costofburger = StringVar()
Costofdrink = StringVar()
CostofDelivery = StringVar()
DateofOrder = StringVar()

pizza.set(0)
burger.set(0)
drink.set(0)
HomeDelivery.set(0)
DateofOrder.set(time.strftime("%d/%m/%Y"))

def CostOfOrder():
pizzaPrice = float(pizza.get())
drinkPrice = float(drink.get())
burgerPrice = float(burger.get())
DeliveryCost = float(HomeDelivery.get())

pizzaCost = "₹", str('%.2f'%((pizzaPrice * 15.50)))


Costofpizza.set(pizzaCost)

drinkCost = "₹", str('%.2f'%((drinkPrice * 7.49)))


Costofdrink.set(drinkCost)

burgerCost = "₹", str('%.2f'%((burgerPrice * 5.50)))


Costofburger.set(burgerCost)

Delivery = "₹", str('%.2f'%((DeliveryCost * 4.50)))


CostofDelivery.set(Delivery)

ToC = "₹", str('%.2f'%((pizzaPrice * 15.50) + (drinkPrice * 7.49) + (burgerPrice * 5.50) +


(DeliveryCost * 4.50)))
SubTotal.set(ToC)
Tax = "₹", str('%.2f'%(((pizzaPrice * 15.50) + (drinkPrice * 7.49) + (burgerPrice * 5.50) +
(DeliveryCost * 4.50)) * 0.2))
PaidTax.set(Tax)
TaxPay = (((pizzaPrice * 15.50)+(drinkPrice * 7.49) + (burgerPrice * 5.50) + (DeliveryCost *
4.50)) * 0.2)
Cost = ((pizzaPrice * 15.50) + (drinkPrice * 7.49) + (burgerPrice * 5.50) + (DeliveryCost *
4.50))
CostofItems = "₹", str('%.2f'%(TaxPay + Cost))
TotalCost.set(CostofItems)

x = random.randint(10034, 699812)
randomRef = str(x)
PaymentRef.set("BILL" + randomRef)

def PayReference():
x = random.randint(10034, 699812)
randomRef = str(x)
PaymentRef.set("BILL" + randomRef)

def iExit():
qExit = messagebox.askyesno("Billing System", "Do you want to exit the system")
if qExit > 0:
root.destroy()
return

def Reset():
PaymentRef.set("")
pizza.set(0)
burger.set(0)
drink.set(0)
HomeDelivery.set(0)
PaidTax.set("")
SubTotal.set("")
TotalCost.set("")
Costofpizza.set("")
Costofdrink.set("")
Costofburger.set("")
CostofDelivery.set("")

def btnClick(numbers):
global operator
operator = operator + str(numbers)
text_Input.set(operator)
def btnClearDisplay():
global operator
operator=""
text_Input.set("")

def btnEqualsInput():
global operator
sumup = str(eval(operator))
text_Input.set(sumup)
operator=""

txtDisplay = Entry(f2, font=('arial',20, 'bold'), textvariable=text_Input, bd=5, insertwidth=9,


justify='right')
txtDisplay.grid(columnspan=4)
btn7=Button(f2, padx=16, pady=16, bd=8, fg="black",
font=('arial',20,'bold'),text="7",command=lambda:btnClick(7)).grid(row=1, column=0)
btn8=Button(f2, padx=16, pady=16, bd=8, fg="black",
font=('arial',20,'bold'),text="8",command=lambda:btnClick(8)).grid(row=1, column=1)
btn9=Button(f2, padx=16, pady=16, bd=8, fg="black",
font=('arial',20,'bold'),text="9",command=lambda:btnClick(9)).grid(row=1, column=2)
btnplus=Button(f2, padx=16, pady=16, bd=8, fg="black",
font=('arial',20,'bold'),text="+",command=lambda:btnClick("+")).grid(row=1, column=3)

btn4=Button(f2, padx=16, pady=16, bd=8, fg="black",


font=('arial',20,'bold'),text="4",command=lambda:btnClick(4)).grid(row=3, column=0)
btn5=Button(f2, padx=16, pady=16, bd=8, fg="black",
font=('arial',20,'bold'),text="5",command=lambda:btnClick(5)).grid(row=3, column=1)
btn6=Button(f2, padx=16, pady=16, bd=8, fg="black",
font=('arial',20,'bold'),text="6",command=lambda:btnClick(6)).grid(row=3, column=2)
btnSub=Button(f2, padx=16, pady=16, bd=8, fg="black",
font=('arial',20,'bold'),text="-",command=lambda:btnClick("-")).grid(row=3, column=3)
btn1=Button(f2, padx=16, pady=16, bd=8, fg="black",
font=('arial',20,'bold'),text="1",command=lambda:btnClick(1)).grid(row=4, column=0)
btn2=Button(f2, padx=16, pady=16, bd=8, fg="black",
font=('arial',20,'bold'),text="2",command=lambda:btnClick(2)).grid(row=4, column=1)
btn3=Button(f2, padx=16, pady=16, bd=8, fg="black",
font=('arial',20,'bold'),text="3",command=lambda:btnClick(3)).grid(row=4, column=2)
btnMult=Button(f2, padx=16, pady=16, bd=8, fg="black",
font=('arial',20,'bold'),text="*",command=lambda:btnClick("*")).grid(row=4, column=3)

btn0=Button(f2, padx=16, pady=16, bd=8, fg="black",


font=('arial',20,'bold'),text="0",command=lambda:btnClick(0)).grid(row=5, column=0)
btnClear=Button(f2, padx=16, pady=16, bd=8, fg="black",
font=('arial',20,'bold'),text="C",command=btnClearDisplay).grid(row=5, column=1)
btnEquals=Button(f2, padx=16, pady=16, bd=8, fg="black",
font=('arial',20,'bold'),text="=",command=btnEqualsInput).grid(row=5, column=2)
btnDiv=Button(f2, padx=16, pady=16, bd=8, fg="black",
font=('arial',20,'bold'),text="/",command=lambda:btnClick("/")).grid(row=5, column=3)

lblRef=Label(f1aa, font=('arial',16,'bold'), text="Sales Reference", bd=16, justify='left')


lblRef.grid(row=0,column=0)
txtRef=Entry(f1aa, font=('arial',16,'bold'), textvariable=PaymentRef, bd=5, insertwidth=2,
justify='left')
txtRef.grid(row=0, column=1)

lblpizza=Label(f1aa, font=('arial',16,'bold'), text="Pizza", bd=16, anchor='w')


lblpizza.grid(row=1,column=0)
txtpizza=Entry(f1aa, font=('arial',16,'bold'), textvariable=pizza, bd=5, insertwidth=2, justify='left')
txtpizza.grid(row=1, column=1)

lblburger=Label(f1aa, font=('arial',16,'bold'), text="Burger", bd=16, anchor='w')


lblburger.grid(row=2,column=0)
txtburger=Entry(f1aa, font=('arial',16,'bold'), textvariable=burger, bd=5, insertwidth=2, justify='left')
txtburger.grid(row=2, column=1)

lbldrink=Label(f1aa, font=('arial',16,'bold'), text="Cold Drinks", bd=16, anchor='w')


lbldrink.grid(row=3,column=0)
txtdrink=Entry(f1aa, font=('arial',16,'bold'), textvariable=drink, bd=5, insertwidth=2, justify='left')
txtdrink.grid(row=3, column=1)

lblHomeDelivery=Label(f1aa, font=('arial',16,'bold'), text="Home Delivery", bd=16, anchor='w')


lblHomeDelivery.grid(row=4,column=0)
txtHomeDelivery=Entry(f1aa, font=('arial',16,'bold'), textvariable=HomeDelivery, bd=5,
insertwidth=2, justify='left')
txtHomeDelivery.grid(row=4, column=1)

lblDateofOrder=Label(f1ab, font=('arial',16,'bold'), text="Date of Order", bd=16, anchor='w')


lblDateofOrder.grid(row=0,column=0)
txtDateofOrder=Entry(f1ab, font=('arial',16,'bold'), textvariable=DateofOrder, bd=5, insertwidth=2,
justify='left')
txtDateofOrder.grid(row=0, column=1)

lblCostofpizza=Label(f1ab, font=('arial',16,'bold'), text="Cost of Pizza", bd=16, anchor='w')


lblCostofpizza.grid(row=1,column=0)
txtCostofpizza=Entry(f1ab, font=('arial',16,'bold'), textvariable=Costofpizza, bd=5, insertwidth=2,
justify='left')
txtCostofpizza.grid(row=1, column=1)

lblCostofburger=Label(f1ab, font=('arial',16,'bold'), text="Cost of Burger", bd=16, anchor='w')


lblCostofburger.grid(row=2,column=0)
txtCostofburger=Entry(f1ab, font=('arial',16,'bold'), textvariable=Costofburger, bd=5, insertwidth=2,
justify='left')
txtCostofburger.grid(row=2, column=1)
lblCostofdrink=Label(f1ab, font=('arial',16,'bold'), text="Cost of Cold Drinks", bd=16, anchor='w')
lblCostofdrink.grid(row=3,column=0)
txtCostofdrink=Entry(f1ab, font=('arial',16,'bold'), textvariable=Costofdrink, bd=5, insertwidth=2,
justify='left')
txtCostofdrink.grid(row=3, column=1)

lblCostofDelivery=Label(f1ab, font=('arial',16,'bold'), text="Cost of Delivery", bd=16, anchor='w')


lblCostofDelivery.grid(row=4,column=0)
txtCostofDelivery=Entry(f1ab, font=('arial',16,'bold'), textvariable=CostofDelivery, bd=5,
insertwidth=2, justify='left')
txtCostofDelivery.grid(row=4, column=1)

lblPaidTax=Label(f2aa, font=('arial',16,'bold'), text="Paid Tax", bd=16, anchor='w')


lblPaidTax.grid(row=2,column=0)
txtPaidTax=Entry(f2aa, font=('arial',16,'bold'), textvariable=PaidTax, bd=5, insertwidth=2,
justify='left')
txtPaidTax.grid(row=2, column=1)

lblSubTotal=Label(f2aa, font=('arial',16,'bold'), text="Sub Total", bd=16, anchor='w')


lblSubTotal.grid(row=3,column=0)
txtSubTotal=Entry(f2aa, font=('arial',16,'bold'), textvariable=SubTotal, bd=5, insertwidth=2,
justify='left')
txtSubTotal.grid(row=3, column=1)

lblTotalCost=Label(f2aa, font=('arial',16,'bold'), text="Total Cost", bd=16, anchor='w')


lblTotalCost.grid(row=4,column=0)
txtTotalCost=Entry(f2aa, font=('arial',16,'bold'), textvariable=TotalCost, bd=5, insertwidth=2,
justify='left')
txtTotalCost.grid(row=4, column=1)

btnTotal=Button(f2ab, padx=16, pady=16, bd=8, fg="black", font=('arial',16,'bold'), width=20,


text="Total Cost", command=CostOfOrder).grid(row=0, column=0)
btnRefer=Button(f2ab, padx=16, pady=16, bd=8, fg="black", font=('arial',16,'bold'), width=20,
text="Sales Reference", command=PayReference).grid(row=0, column=1)
btnReset=Button(f2ab, padx=16, pady=16, bd=8, fg="black", font=('arial',16,'bold'), width=20,
text="Reset", command=Reset).grid(row=1, column=0)
btnExit=Button(f2ab, padx=16, pady=16, bd=8, fg="black", font=('arial',16,'bold'), width=20,
text="Exit", command=iExit).grid(row=1, column=1)

root.mainloop()

__author__ = 'iamhssingh'

from functools import partial


from tkinter import messagebox
from tkinter.tix import *

import compo.dbactions as actions


import compo.loggedin as log

# framebg = 'IndianRed1'
# labelbg = framebg
# labelfg = 'White'

# mainframebg = framebg
# buttonbg = 'Blue'
# reframebg = framebg

def addButton(row, col, master, text, imagez=None, command=None):


if command is not None and imagez is not None:
x = Button(master=master, text=text, image=imagez, command=command)
x.image = imagez
elif command is not None and imagez is None:
x = Button(master=master, text=text, command=command)
elif imagez is not None and command is None:
x = Button(master=master, text=text, image=imagez)
x.image = imagez
else:
x = Button(master=master, text=text)
x.grid(row=row, column=col)
return x

def addLabel(master, text, row, column, bg=None):


if bg is not None:
cname_label = Label(master=master, text=text, bg=bg, font=(12))
elif bg is None:
cname_label = Label(master=master, text=text, font=(12))
cname_label.grid(row=row, column=column)
return cname_label

def addEntry(master, textvar, row, column):


new_entry = Entry(master=master, textvariable=textvar)
new_entry.grid(row=row, column=column)
return new_entry

def logmein():
lstatus = actions.login(uname_var.get(), upwd_var.get())
if len(lstatus) > 0:
uid_var.set(lstatus[0])
ufname_var.set(lstatus[1])
ulname_var.set(lstatus[2])
mainwindow.destroy()
log.loggedin(uid_var.get(), ufname_var.get(), ulname_var.get())

def quit(window):
c = messagebox.askyesno(title="Exit?", message="Are you sure you want to exit?")
if c > 0:
window.destroy()

def registerme(frame):
rstatus.set(actions.register(uname_var.get(), ufname_var.get(), ulname_var.get(), upwd_var.get(),
ucpwd_var.get()))
if rstatus.get() == 1:
frame.destroy()
login()

def login():
mainwframe.destroy()
uname_var.set('')
upwd_var.set('')
mainwindow.geometry('480x180+600+250')
mainwindow.title('Login to Business Management')

mainframe = Frame(master=mainwindow, border=4, relief=RIDGE, padx=25, pady=25)


mainframe.pack(expand=1, fill=BOTH)

addLabel(mainframe, "User Name: ", 0, 0)


addLabel(mainframe, "Password: ", 1, 0)
addEntry(mainframe, uname_var, 0, 2)
addEntry(mainframe, upwd_var, 1, 2)
addLabel(mainframe, " ", 2, 0)
addLabel(mainframe, " ", 2, 1)
addLabel(mainframe, " ", 2, 2)

addButton(3, 0, mainframe, "Login", login_image2, partial(logmein))


addButton(3, 2, mainframe, "Cancel", cancel_image, partial(quit, mainwindow))
addButton(4, 1, mainframe, "About", None, lambda: messagebox.showinfo(title="About Creator",
message="THIS APPLICATION IS A CREATION
OF HIMANSHU SHANKAR"))
addButton(4, 0, mainframe, "About", None, lambda: messagebox.showinfo(title="About Creator",
message="THIS APPLICATION IS A CREATION
OF HIMANSHU SHANKAR"))
addButton(4, 2, mainframe, "About", None, lambda: messagebox.showinfo(title="About Creator",
message="THIS APPLICATION IS A CREATION
OF HIMANSHU SHANKAR"))

def register():
mainwframe.destroy()
mainwindow.geometry('450x255+600+250')
mainwindow.title('Register a New User')

register_frame = Frame(master=mainwindow, border=4, relief=RIDGE, padx=10, pady=25)


register_frame.pack(expand=1, fill=BOTH)

addLabel(register_frame, " ", 10, 0)


addLabel(register_frame, " ", 10, 1)
addLabel(register_frame, " ", 10, 2)
addLabel(register_frame, "User Name: ", 1, 0)
addLabel(register_frame, "First Name: ", 2, 0)
addLabel(register_frame, "Last Name: ", 3, 0)
addLabel(register_frame, "Password: ", 4, 0)
addLabel(register_frame, "Confirm Password: ", 5, 0)
addEntry(register_frame, uname_var, 1, 2)
addEntry(register_frame, ufname_var, 2, 2)
addEntry(register_frame, ulname_var, 3, 2)
addEntry(register_frame, upwd_var, 4, 2)
addEntry(register_frame, ucpwd_var, 5, 2)

addButton(11, 2, register_frame, "Cancel", cancel_image, partial(quit, mainwindow))


addButton(11, 0, register_frame, "Register", register_image, partial(registerme, register_frame))
addButton(12, 0, register_frame, "About", None, lambda: messagebox.showinfo(title="About
Creator",
message="THIS APPLICATION IS A
CREATION OF HIMANSHU SHANKAR"))
addButton(12, 1, register_frame, "About", None, lambda: messagebox.showinfo(title="About
Creator",
message="THIS APPLICATION IS A
CREATION OF HIMANSHU SHANKAR"))
addButton(12, 2, register_frame, "About", None, lambda: messagebox.showinfo(title="About
Creator",
message="THIS APPLICATION IS A
CREATION OF HIMANSHU SHANKAR"))

def mainconfirm():
if messagebox.askyesno("Quit", "Do you really wish to quit?"):
mainwindow.destroy()

mainwindow = Tk()
mainwindow.geometry('375x150+600+250')
mainwindow.title("Accounts Management")
mainwindow.protocol("WM_DELETE_WINDOW", mainconfirm)
# mainwindow.iconbitmap("media/images/am.ico")

login_image = PhotoImage(file="media/images/login.gif")
login_image2 = PhotoImage(file="media/images/login2.gif")
register_image = PhotoImage(file="media/images/register.gif")
cancel_image = PhotoImage(file="media/images/cancel.gif")

mainwframe = Frame(master=mainwindow, border=4, relief=RIDGE, padx=4, pady=4)


mainwframe.pack(expand=1, fill=BOTH)

addLabel(mainwframe, " ", 1, 1)


addLabel(mainwframe, " ", 3, 1)
addButton(2, 1, mainwframe, "Log In", login_image, login)
addButton(2, 3, mainwframe, "Register Here", register_image, register)
addButton(4, 1, mainwframe, "About", None, lambda: messagebox.showinfo(title="About Creator",
message="THIS APPLICATION IS A CREATION OF
HIMANSHU SHANKAR"))
addButton(4, 2, mainwframe, "About", None, lambda: messagebox.showinfo(title="About Creator",
message="THIS APPLICATION IS A CREATION OF
HIMANSHU SHANKAR"))
addButton(4, 3, mainwframe, "About", None, lambda: messagebox.showinfo(title="About Creator",
message="THIS APPLICATION IS A CREATION OF
HIMANSHU SHANKAR"))

uname_var = StringVar()
upwd_var = StringVar()
uid_var = IntVar()
ufname_var = StringVar()
ulname_var = StringVar()
ucpwd_var = StringVar()
lstatus = []

rstatus = IntVar()

mainwindow.mainloop()

5. Testing

System Development and Testing:

System Development is a process of conceiving the specification specified


in the designing stage into source code. Careful study and observation about system
designing were made and accordingly the system was coded to convert from designing
to source code, where visual Basic as the front end and OracleXE as the backend. The
System was developed such that it should be used for the future enhancement.
All the module of the system is combined and is put to the operational use. This
means that the new and old system are run in the parallel for sometimes, errors are
identified and the corresponding errors are to be concerned to get the required output.
The set of working programs and initialized tables are also provided for the easy start
of the user, in addition, system documentation is also provided, all users have been
trained to use the system.
This creates two problems,

 The time lag between the cause and appearance of the


problem.
 The effect of system errors on files and records within
the system.
Types of testing done:

5.1 Unit Testing:

Unit test is designed to ensure that the purpose for which it was designed for
which it was designed for is fulfilled. Each and every module was tested individually
with the test data and error messages were displayed for incorrect and sufficient for
entry works. All validation was tested to correctness. Test data were fed in and results
were checked for the maintenance module, to ensure that all tables created contained
nothing but valid data. Reverential integrity constraints specified as part of the table
definition was also tested.

5.2 Recovery Testing:

Many computer based systems must recover from faults and resume
processing within a pre-specified time. In some cases a system must be fault tolerant.ie
processing faults must not cause overall system function to cease. In the casers a system
failure must be corrected within a specified period of time or severe economic damage
will occur.

5.3 Security Testing:

Any computer-based system the manages sensitive information or cause


action that can improperly harm individual is a tablet for improper or illegal penetration
Security testing attempts to verify that protection mechanism built into a system will, in
fact protect it from improper penetration . During security testing, the tester plays the
role of the individual who desire to penetrate the system. The tester may attempt to
acquire passwords through external clerical means; may attack the system with custom
45
software designed to break down any defenses that have been constructed; may
overwhelm the System.

45
5.4 Performance Testing:

For real time and embedded system, software that provides required
functions but not confirm to performance requirements is unacceptable. Performance
testing is designed to test the run time performance of software within the context of an
integrated system. Performance testing occurs throughout all steps in the testing process.
Even at unit level, the performance of an individual module may be accessed as white
box test recon ducted. However, it is not until all system elements are fully integrated that
true performance of a system can be ascertained.

Performance Tests are sometimes coupled with stress testing and often
required other hardware and software implementation. It is often necessary to measure
Resource utilization .By incrementing a system the tester can uncover situations that lead
to degradation and possible system failure.

5.5 Integration Testing

In integration testing a system consisting of different modules is tested for problems


arising from component interaction. Integration testing should be developed from
the system specification. Firstly, a minimum configuration must be integrated and tested.
In my project I have done integration testing in a bottom up fashion i.e. in this project I
have started construction and testing with atomic modules. After unit testing the
modules are integrated one by one and then tested the system for problems arising
from component interaction.

5.6 White Box Testing

In white box testing knowing the internal working of the base, test can be conducted to
ensure that internal operations are performed according to specification and all internal
components have been adequately exercised. In white box testing logical path through the
software are tested by providing test cases that exercise specific set of conditions and
loops. Using white-box testing software developer can derive test case that

46
• Guarantee that all independent paths within a module have been exercised at least

47
once.

• Exercise all logical decisions on their true and false side.

• Exercise all loops at their boundaries and within their operational bound.

• Exercise internal data structure to ensure their validity.


6. Experimental Results

FrmLogin
(Module to Authenticate User)

FrmBill
(Create and modify bill and print the saved bill)
FrmBillSummary
(Show bill summary for particular date range)
FrmExportData
(Export product Data in FlexGrid and MS-Excel with formatting)
FrmCompanyInfo
(Add/Modify Company Info)
7. Conclusion

This project was developed to fulfill user and business requirement; however there are
lots of scope to improve the performance of the eBilling and Invoice System in the area
of user interface, database performance, and query processing time. Etc.

So there are many things for future enhancement of this project. The future enhancements
that are possible in the project are as follows.

 Linking and integration of any legacy system for accounting.

 Integration with travel agent through Web Services

 Connection to third-party OLAP applications

 Electronic Data Interchange (EDI) system between banks, other credit


verification agency and their vendors
 In the area of data security and system security.

 Provide more online tips and help.

 To optimize the query which is embedded in the system


8. References

Websites

 http://www.google.com

 http://www.microsoft.com

 http://www.programmer2programmer.net

 http://www.codeproject.com

 http://www.msdn.com.

 http://www.vb123.com

 http://www.vbcode.com

 http://www.sqltuner.com

You might also like