Computerscienceprojectc 12
Computerscienceprojectc 12
BILL GENERATION
1
CERTIFICATE
examination in Class XII during the academic year 2024-25.I certify that this
DATE:
Principal signature
2
ACKNOWLEDGEMENT
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.
(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
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
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:
2.Hard disk : 40 GB
3.RAM : 1024 MB
Software Specification:
. 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 =
def():
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():
7
TABLES CREATED IN MYSQL:
1. customer_table
Columns:
customer_address (VARCHAR(255))
customer_city (VARCHAR(50))
customer_state (VARCHAR(50))
customer_mobile_number (INT)
2. item_table
Columns:
serial_no (INT)
8
3. bill_table
Columns:
bill_date (DATE)
category (VARCHAR(20))
gst_rate (DECIMAL(5,2))
gst_amount (DECIMAL(10,2))
discount_rate (DECIMAL(5,2))
discount_amount (DECIMAL(10,2))
9
SOURCE CODE:
conn=mysql.connector.connect(user='root',password='root',host='localhost',database=
'store') #here conn act as a connection object
myc=conn.cursor() #cursor_object
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
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")
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:
15
3.CREATING GROCERY BILL USING PYTHON
16
BIBLIOGRAPHY
W3Schools: https://www.w3schools.com/
17