0% found this document useful (0 votes)
15 views17 pages

Computerscienceprojectc 12

Uploaded by

n823921
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views17 pages

Computerscienceprojectc 12

Uploaded by

n823921
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

SENIOR SECONDARY

Affiliated to CBSE, New Delhi(No-1931248)


KARAIMEDU, SIRKALI

BILL GENERATION

083 – COMPUTER SCIENCE PROJECT


REPORT FILE
2024-2025

SUBMITTED BY UNDER THE GUIDANCE OF


S. RAGHUL Mrs.B.SURYA MCA.,
XII - B PGT,COMPUTERSCIENCE
2412205

1
CERTIFICATE

This is to certify that RAGHUL.S of CLASS XII of Shri Natarajan

Memorial Public School has successfully completed project work entitled

"BILL GENERATION" under the guidance of Mrs.B.SURYA,

MCA.,PGT., (COMPUTER SCIENCE) for the purpose of practical

examination in Class XII during the academic year 2024-25.I certify that this

project is up to my expectation and as per the guidelines issued by CBSE.

DATE:

Internal Examiner External Examiner

Principal signature

2
ACKNOWLEDGEMENT

In the accomplishment of this project successfully, many people have best

owned upon me with their blessings and the heart pledged support, this time I am

utilizing to thank all the people who have been concerned with project.

Primarily I would like to thank my Computer Science teacher Mrs.B.SURYA MCA.,PGT

(COMPUTER SCIENCE), whose valuable guidance has been the ones that helped me patch

this project and make it full proof success her suggestions and her instructions has served as

the major contributor towards the completion of the project.

Then I would like to thank my parents and friends who have helped me with their valuable

suggestions and guidance has been helpful in various phases of the completion of the

project.

3
INDEX

 INTRODUCTION

 HARDWARE AND SOFTWARE REQUIRED

 IMPORTED FILES AND USED FUNCTIONS IN PYTHON

 TABLE CREATED IN MYSQL

 CODE

 OUTPUT

 BIBLIOGRAPHY

4
INTRODUCTION

In any business, the process of bill generation plays a pivotal role in maintaining smooth
financial operations. This essential task not only ensures that transactions are properly
recorded and payments are received on time, but it also helps in building trust and
transparency with customers. By systematically generating bills, businesses can
effectively manage their cash flow, maintain accurate financial records, and provide a
professional touch to their customer service. Whether it's for a small startup or a large
corporation, efficient bill generation is the backbone of a healthy financial structure,
paving the way for growth and sustainability.

Bill generation is crucial for several reasons, especially in businesses and organizations:

 Financial Management: Bills or invoices help in tracking sales and revenue. They
provide a record of transactions that is essential for financial reporting and tax
purposes.
 Legal Documentation: Invoices serve as legal documents that can be used in case
of disputes with customers. They provide evidence of the services rendered or
goods sold and the agreed-upon prices.
 Customer Relations: Clear and accurate billing helps in maintaining good
relationships with customers. It ensures transparency and trust, as customers can
see exactly what they are being charged for.
 Inventory Management: For businesses dealing with physical products, bills help
in managing inventory. They provide a record of what has been sold and what
remains in stock.
 Cash Flow Management: Proper bill generation helps in maintaining healthy cash
flow. It ensures that payments are tracked and overdue accounts are followed up.
 Business Analysis: Bills provide valuable data that can be analyzed to understand
business performance, customer behavior, and sales trends. This information can
be used to make informed business decisions.

5
HARDWARE AND SOFTWARE REQUIREMENT

Hardware Specification:

1. Processor : Dual core or above

2.Hard disk : 40 GB

3.RAM : 1024 MB

Software Specification:

1.Operating system : Windows 10 / 8 / 7

2.Platform : Python IDLE 3.10

. 3.Database : MySQL

. 4.Languages : Python

6
FILES IMPORTED IN PROJECT

import mysql.connector:

The mysql.connector provides the connect() method used to create connection between the

MySQL database and the python application.The syntax is given below. Syntax: Conn_obj =

mysql.connector.connect (host=<hostname>,user=<username>, Passwd=<password>)

FUNCTIONS USED IN PROJECT:

def():

It is a keyword that is used to define a function.

cursor():

It is a control structure that facilitates the row-by-row processing of record in the result set.

execute():

This function is used to execute the sql query and retrieve records using python.

Connect():

This function establishes connection between python and MySQL.

7
TABLES CREATED IN MYSQL:
1. customer_table

Columns:

customer_id (INT PRIMARY KEY)

customer_name (VARCHAR(50) NOT NULL)

customer_address (VARCHAR(255))

customer_city (VARCHAR(50))

customer_state (VARCHAR(50))

customer_mobile_number (INT)

2. item_table

Columns:

item_id (INT PRIMARY KEY )

serial_no (INT)

item_name (VARCHAR(100) NOT NULL)

price (DECIMAL(10,2) NOT NULL)

quantity (INT NOT NULL)

bill_id (INT FOREIGN KEY REFERENCES bill(bill_id))

8
3. bill_table

Columns:

bill_id (INT PRIMARY KEY) .

bill_date (DATE)

category (VARCHAR(20))

total_amount (DECIMAL(10,2) NOT NULL)

gst_rate (DECIMAL(5,2))

gst_amount (DECIMAL(10,2))

discount_rate (DECIMAL(5,2))

discount_amount (DECIMAL(10,2))

final_amount (DECIMAL(10,2) NOT NULL)

customer_id (INT FOREIGN KEY REFERENCES

9
SOURCE CODE:

import mysql.connector #mysqlconnector_package

conn=mysql.connector.connect(user='root',password='root',host='localhost',database=
'store') #here conn act as a connection object

myc=conn.cursor() #cursor_object

#details given by manager

o="y"
while(o=="y" or o=="Y"):
m=""" ,,,,*shop bill management receipt*,,,,
,,,,*tax invoice*,,,,
,,,,*AR Mart*,,,,
,,,,*shop no. 4 kanjurmarg navy colony*,,,,
,,,,*kanjurmarg 400042*,,,,
,,,,*mobile number-8421468850*,,,,"""
print(m)
c=str(input("enter your choice(S\C\E\G\X):"))
#press S for generating stationary bill
#press C for generating clothing bill
#press E for generating electrical appliances bill
#press G for generating grocery bill
#press X to exit from program

#CREATING STATIONARY BILL


if(c=="S" or c=="s"):
print("STATIONARY BILL")
date=input("invoice date:")
impt=int(input("no. of item purchase:"))
print("details of customer")
customer=str(input("customer's name:Mr./Miss:"))
address=str(input("customer's adress:"))
city=str(input("customer's city:"))
state=str(input("customer's state:"))
mobilenumber=int(input("customer's mobile number:"))
total=0
maxitem=41 # maximum number of items can be purchased at a time
if(impt<=maxitem):
for a in range(1,impt+1):
print("serial no:",a)
i=str(input("item:"))
rate=float(input("price of item in rupees:"))
qty=int(input("quantity of item purchased:"))
value=qty*rate # total price of product with no. of quantity
print("Total price:",value) # total amount of particular product
total=total+value # total amount of all products
sql="insert into item (serial_no,item_name,price,quantity)
values({},'{}',{},{})".format(a,i,rate,qty)
myc.execute(sql)
conn.commit()
print("Items Purchased Till Now:")
myc.execute('select * from item')
data=myc.fetchall()
for row in data:
print(row)
print("Total Amount:",total)
gst=28/100
gtax=total*gst #gst taxed amount
price=total+gtax # total amount of all products after adding gst

10
if(total<100):
print("Final price:",price)
elif(total>=100 and total<=800):
discount=5/100
dprice=total*discount # discount amount
print("Final price:",price-dprice)
elif(total>800 and total<=5000):
discount=15/100
dprice=total*discount
print("Final price:",price-dprice)
elif(total>5000 and total<=14000):
discount=20/100
dprice=total*discount
print("Final price:",price-dprice)
elif(total>14000):
discount=25/100
dprice=total*discount
print("Final price:",price-dprice)
else:
print(" Sorry You Can Only Buy 41 Items At A Time")
print("STATIONARY BILL")
#CREATING CLOTHING BILL
elif(c=="C" or c=="c"):
print("CLOTHING BILL")
date=input("invoice date:")
impt=int(input("no. of item purchase:"))
print("details of customer")
customer=str(input("customer's name:Mr./Miss:"))
adress=str(input("customer's adress:"))
city=str(input("customer's city:"))
state=str(input("customer's state:"))
mobilenumber=int(input("customer's mobile number:"))
total=0
maxitem=41 # maximum number of items can be purchased at a time

if(impt<=maxitem):
for a in range(1,impt+1):
print("serial no:",a)
i=str(input("item:"))
rate=float(input("price of item in rupees:"))
qty=int(input("quantity of item purchased:"))
value=qty*rate # total price of product with no. of quantity
print("Total price:",value) # total amount of particular product
total=total+value # total amount of all products
sql="insert into item (serial_no,item_name,price,quantity)
values({},'{}',{},{})".format(a,i,rate,qty)
myc.execute(sql)
conn.commit()
print("Items Purchased Till Now:")
myc.execute('select * from item')
data=myc.fetchall()
for row in data:
print(row)
print("Total Amount:",total)
gst=8/100
gtax=total*gst #gst taxed amount
price=total+gtax # total amount of all products after adding gst
if(total<800):
print("Final price:",price)
elif(total>=800 and total<=6000):
discount=5/100
dprice=total*discount # discount amount
print("Final price:",price-dprice)

11
elif(total>6000 and total<=11000):
discount=15/100
dprice=total*discount
print("Final price:",price-dprice)
elif(total>11000 and total<=15000):
discount=20/100
dprice=total*discount
print("Final price:",price-dprice)
elif(total>15000):
discount=25/100
dprice=total*discount
print("Final price:",price-dprice)
else:
print(" Sorry You Can Only Buy 41 Items At A Time")
print("CLOTHING BILL")
#CREATING ELECTRICAL APPLIANCES BILL
elif(c=="E" or c=="e"):
print("ELECTRICAL APPLIANCES BILL")
date=input("invoice date:")
impt=int(input("no. of item purchase:"))
print("details of customer")
customer=str(input("customer's name:Mr./Miss:"))
address=str(input("customer's adress:"))
city=str(input("customer's city:"))
state=str(input("customer's state:"))
mobilenumber=int(input("customer's mobile number:"))
total=0
maxitem=41 # maximum number of items can be purchased at a time
if(impt<=maxitem):
for a in range(1,impt+1):
print("serial no:",a)
i=str(input("item:"))
rate=float(input("price of item in rupees:"))
qty=int(input("quantity of item purchased:"))
value=qty*rate # total price of product with no. of quantity
print("Total price:",value) # total amount of particular product
total=total+value # total amount of all products
sql="insert into item (serial_no,item_name,price,quantity)
values({},'{}',{},{})".format(a,i,rate,qty)
myc.execute(sql)
conn.commit()
print("Items Purchased Till Now:")
myc.execute('select * from item')
data=myc.fetchall()
for row in data:
print(row)
print("Total Amount:",total)
gst=18/100
gtax=total*gst #gst taxed amount
price=total+gtax # total amount of all products after adding gst
if(total<1200):
print("Final price:",price)
elif(total>=1200 and total<=4000):
discount=5/100
dprice=total*discount # discount amount
print("Final price:",price-dprice)
elif(total>4000 and total<=7000):
discount=15/100
dprice=total*discount
print("Final price:",price-dprice)
elif(total>7000 and total<=12000):
discount=20/100
dprice=total*discount

12
print("Final price:",price-dprice)
elif(total>12000):
discount=25/100
dprice=total*discount
print("Final price:",price-dprice)
else:
print(" Sorry You Can Only Buy 41 Items At A Time")
print("ELECTRICAL APPLIANCES BILL")

#CREATING GROCERY BILL


elif(c=="G" or c=="g"):
print("GROCERY BILL")
date=input("invoice date:")
impt=int(input("no. of item purchase:"))
print("details of customer")
customer=str(input("customer's name:Mr./Miss:"))
address=str(input("customer's adress:"))
city=str(input("customer's city:"))
state=str(input("customer's state:"))
mobilenumber=int(input("customer's mobile number:"))
total=0
maxitem=41 # maximum number of items can be purchased at a time
if(impt<=maxitem):
for a in range(1,impt+1):
print("serial no:",a)
i=str(input("item:"))
rate=float(input("price of item in rupees:"))
qty=int(input("quantity of item purchased:"))
value=qty*rate # total price of product with no. of quantity
print("Total price:",value) # total amount of particular product
total=total+value # total amount of all products
sql="insert into item (serial_no,item_name,price,quantity)
values({},'{}',{},{})".format(a,i,rate,qty)
myc.execute(sql)
conn.commit()
print("Items Purchased Till Now:")
myc.execute('select * from item')
data=myc.fetchall()
for row in data:
print(row)
print("Total Amount:",total)
gst=4/100
gtax=total*gst #gst taxed amount
price=total+gtax # total amount of all products after adding gst
if(total<200):
print("Final price",price)
elif(total>=200 and total<=500):
discount=5/100
dprice=total*discount # discount amount
print("Final price:",price-dprice)
elif(total>500 and total<=900):
discount=15/100
dprice=total*discount
print("Final price:",price-dprice)
elif(total>900 and total<=15000):
discount=20/100
dprice=total*discount
print("Final price:",price-dprice)
elif(total>15000):
discount=25/100
dprice=total*discount

print("Final price:",price-dprice)

13
#final price is calculated after adding gst
else:
print(" Sorry You Can Only Buy 41 Items At A Time")
print("GROCERY BILL")
elif(c=="x" or c=="X"):
exit()
else:
print("PLEASE ENTER A VALID PRODUCT CATEGORY")
print(" S for generating stationary bill")
print(" C for generating clothing bill")
print(" E for generating electrical appliances bill")
print(" G for generating grocery bill")
t=""" ,,,,,,,THANK YOU,,,,,,,
,,,,VISIT US AGAIN,,,,
,[email protected],"""
print(t)
o=input("want to run again y/n or Y/N")

14
OUTPUT:

1.STRUCTURE OF ITEM TABLE IN SQL:

2.CREATING STATIONARY BILL USING PYTHON.

15
3.CREATING GROCERY BILL USING PYTHON

4.STRUCTURE AND LSIT OF DETAILS IN GROCERY BILL.

16
BIBLIOGRAPHY

 MySQL Documentation: https://dev.mysql.com/doc/

 Python Documentation: https://www.python.org/doc/

 W3Schools: https://www.w3schools.com/

 Stack Overflow: https://stackoverflow.com/

 Python MySQL Connector Documentation: https://dev.mysql.com/doc/connector-python/en/

17

You might also like