Type Your School Name
Project Report
On
COSMETIC SHOP SYSTEM
…………………………………………..
(SESSION-……………)
………………………….
…...............
LOGO
ACKNOWLEDGEMENT
I would like to convey my heartful thanks to
……………………………. (Computer Science) who always
gave valuable suggestions & guidance for completion of my
project.
He helped me to understand & remember important details of
the project. My project has been a success only because of his
guidance.
I am especially indented & I am also beholden to my friends. And
finally I thank to the members of my family for their support &
encouragement.
CERTIFICATE
This is to certify that …………………… of class
………… of ……………………………. has
completed his project under my supervision. He has taken
proper care & shown sincerity in completion of this project.
I certify that this project is up to my expectation &
as per the guideline issued by CBSE.
…………………………..
(Computer Science faculty)
Content
1. Introduction
2. Flowchart Design
3. Database Structure
4. Source Code
5. Output
6. Requirement
7. Advantages and disadvantages
8. Conclusion
9. Bibliography
INTRODUCTION
Cosmetics Shop Management System is a complete solution for
managing a Shop, in other words, an enhanced tool that assists
in organizing the day-to-day activities of a Shop. There is the
need of an application for efficient management and handling
customer orders. This Cosmetics Shop Management System
keeps every record Shop and reducing paperwork.
These records are stored in the database with security. Your
data be a secure and only authorized person can take the copy
of data.
The main processes of the system focus on customer's request
where the system is able to search the most appropriate products
and deliver it to the customers. It should help the employees to
quickly identify the list of cosmetic product that have reached
the minimum quantity.
FLOWCHART DESIGN
DATABASE STRUCTURE
Table Name: cosmetic
Column Name Data type/Size Constraints
costid int(11) Primary key
costname varchar(30)
type varchar(15)
company varchar(15)
qty int(11)
price int(11)
des varchar(40)
Table Name: costinvoice
ColumnName Data Type Constraint
invoid int(11) Primary Key
costid int(11)
custnm varchar(25)
mobno varchar(15)
qty int(11)
status varchar(15)
invoiceno int(11)
amt int(11)
dateSP date
SOURCE CODE
File Name: cosmatic_menu.py
"""*************************************************************
THE MAIN FUNCTION OF PROGRAM
****************************************************************"""
import platform
import os
def myclear():
if platform.system()=="Windows":
print(os.system("cls"))
def intromain():
myclear()
print("***SMETIC*****MANAGEMENT****SYSTEM******PROJECT*******************")
print("***************************************************************************")
def intro():
print("*************************COSMETIC-MANAGEMENT***************************")
print("===========================================================")
print("****************************S=Y=S=T=E=M********************************")
print("PROJECT:")
print("MADE BY : ……………………")
print("---------------SCHOOL : DOON PUBLIC SCHOOL--------------------")
def main():
ch=0
myclear()
intromain()
print("=================MAIN MENU====================")
print("01. COSMETIC REPORT GENERATOR")
print("02. ADMINISTRATOR")
print("03. EXIT")
print("==============================================")
ch=int(input("Please Select Your Option (1-3)"))
return ch
def cosmetic_menu():
ch=0
intromain()
print("===========COSMETIC INFO MENU===========")
print("01. ADD COSMETIC INFORMATION")
print("02. MODIFY COSMETIC INFORMATION")
print("03. DELETE COSMETIC INFORMATION")
print("04. BACK TO MAIN")
print("==============================================")
ch=int(input("Please Select Your Option (1-4) "))
return ch
"""***************************************************************
ADMINSTRATOR COSMETIC FUNCTION
****************************************************************"""
def admin_menu1():
ch=0
myclear()
intromain()
print("=================COSMETIC ADD MENU====================")
print("1.CREATE COSMETIC DETAILS")
print("2.DISPLAY ALL CORMETIC DETAILS")
print("3.SEARCH RECORD BY COSMETIC PRODUCT ID")
print("4.SEARCH RECORD BY COSMETIC PRODUCT NAME")
print("5.SEARCH RECORD BY PRICE")
print("6.SEARCH RECORD BY TYPE")
print("7.SEARCH RECORD BY COMPANY")
print("8.BACK TO MAIN MENU")
ch=int(input("Please Enter Your Choice (1-8) "))
return ch
"""***************************************************************
ADMINSTRATOR GROSERY MAIN MENU FUNCTION
****************************************************************"""
def Cosmetic_ADM_menu():
ch=0
myclear()
intromain()
print("=================ADMIN MENU====================")
print("1.COSMETIC'S MENU")
print("2.COSMETIC'S SALE/PURCHASE")
print("3.BACK TO MAIN MENU")
ch=int(input("Please Enter Your Choice (1-3) "))
return ch
"""**********************************************************
MODIFY MENU
********************************************************"""
def modifyCosmetic_menu():
ch=0
myclear()
intromain()
print("===============MODIFY MENU==================")
print("1.MODIFY COSMETIC PRODUCT NAME")
print("2.MODIFY PRICE")
print("3.MODIFY QUANTITY")
print("4.MODIFY TYPE")
print("5.MODIFY COMPANY")
print("6.MODIFY DESCRIPTION")
print("7.BACK TO MAIN MENU")
ch=int(input("Please Enter Your Choice (1-7) "))
return ch
"""**********************************************************
REPORTS MENU
********************************************************"""
def SALE_PURCHASEmenu():
ch=0
myclear()
intromain()
print("===============SALE AND PURCHASE MENU==================")
print("1.COSMETIC PRODUCT SOLD OUT")
print("2.COSMETIC PRODUCT PURCHASED")
print("3.BACK TO MAIN MENU")
ch=int(input("Please Enter Your Choice (1-3) "))
return ch
def cosmeticinvoicereports():
ch=0
myclear()
intromain()
print("=================COSMETIC ADD MENU====================")
print("1.SEARCH AND PRINT SALE INVOICE")
print("2.SEARCH AND PRINT PURCHASE INVOICE")
print("3.DISPLAY ALL INVOICE(SALE/PURCHASE)")
print("4.SEARCH INVOICE BY DATEOFINVOICE")
print("5.BACK TO MAIN MENU")
ch=int(input("Please Enter Your Choice (1-5) "))
return ch
File Name: cosmatic.py
import os
import pymysql
--------SEARCH AND PRINT SALE INVOICE
def searchCOSinvoice():
try:
mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem")
C=mydb.cursor()
tot=0
gst=0
count=1
nettot=0
invo=int(input("Enter the Invoice No:"))
Query=("SELECT cosmetic.costname,costinvoice.amt,costinvoice.qty, costinvoice.dateSP,
costinvoice.custnm, costinvoice.mobno FROM cosmetic,costinvoice WHERE cosmetic.costid=
costinvoice.costid AND costinvoice.status='SALE' AND costinvoice.invoiceno=%s")
data=(invo,)
C.execute(Query,data)
rc=C.fetchall()
if rc:
print("----------------INVOICE: ",invo,"---------DATE: ",rc[0][3])
print("--NAME:--",rc[0][4],"-----------MOBILE NO.:",rc[0][5])
print("--------------------------SALE------------------------------")
print("S.NO.----|------------COSMETIC NAME-------------------TOTAL-----")
for rc1 in rc:
tot=tot+rc1[1]
print(count," |---",rc1[0],"ttttt |t",rc1[1])
count=count+1
gst=tot*12/100
nettot=tot+gst
print("============================================================")
print(" Total: ",tot)
print(" GST : ",gst)
print(" NETTOTAL: ",nettot)
input("----------------------Press any key-------------------------")
C.close()
mydb.close()
return rc
except:
mydb.close()
def searchPURinvoice():
try:
mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem")
C=mydb.cursor()
tot=0
gst=0
count=1
nettot=0
invo=int(input("Enter the Invoice No:"))
Query=("SELECT cosmetic.costname, costinvoice.amt, costinvoice.qty, costinvoice.dateSP,
costinvoice.custnm,costinvoice.mobno FROM cosmetic,costinvoice WHERE cosmetic.costid =
costinvoice.costid AND costinvoice.status='PURCHASE' AND costinvoice.invoiceno=%s")
data=(invo,)
C.execute(Query,data)
rc=C.fetchall()
if rc:
print("----------------INVOICE: ",invo,"---------DATE: ",rc[0][3])
print("--NAME:--",rc[0][4],"-----------MOBILE NO.:",rc[0][5])
print("--------------------------PURCHASE------------------------------")
print("S.NO.----|------------COSMETIC NAME-------------------TOTAL-----")
for rc1 in rc:
tot=tot+rc1[1]
print(count," |---",rc1[0],"ttttt |t",rc1[1])
count=count+1
gst=tot*12/100
nettot=tot+gst
print("============================================================")
print(" Total: ",tot)
print(" GST : ",gst)
print(" NETTOTAL: ",nettot)
input("----------------------Press any key-------------------------")
C.close()
mydb.close()
return rc
except:
mydb.close()
#----------display all invoice SALE or PURCHASE wise
def displayinvoiceSP():
try:
mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem")
C=mydb.cursor()
count=1
ch=int(input("Enter the Choice 1- SALE Wise 2- PURCHASE Wise:"))
Query=("SELECT cosmetic.costname,costinvoice.amt,costinvoice.qty,costinvoice.dateSP,
costinvoice.invoiceno FROM cosmetic,costinvoice WHERE cosmetic.costid=costinvoice.costid AND
costinvoice.status=%s")
if(ch==1):
data=('SALE',)
else:
data=('PURCHASE',)
C.execute(Query,data)
rc=C.fetchall()
if rc:
print("---------------------INVOICE LIST---------------------------")
print("------------------------------------------------------------")
print("S.NO.ttCOSTPROD-NAMEttQUANTITYttAMOUNTttDATEtINVOICE NO")
for rc1 in rc:
print(count,"tt",rc1[0],"tt",rc1[2],"tt",rc1[1],"tt",rc1[3],"t",rc1[4])
count=count+1
print("============================================================")
input("----------------------Press any key-------------------------")
C.close()
mydb.close()
return rc
except:
mydb.close()
#----------display all invoice SALE or PURCHASE by date
def displayinvoiceSPdate():
try:
mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem")
C=mydb.cursor()
count=1
ch=int(input("Enter the Choice 1- SALE Wise 2- PURCHASE Wise:"))
dt=input("Enter the date(yyyy-mm-dd)")
Query=("SELECT
cosmetic.costname,costinvoice.amt,costinvoice.qty,costinvoice.dateSP,costinvoice.invoiceno FROM
cosmetic,costinvoice WHERE cosmetic.costid=costinvoice.costid AND costinvoice.status=%s AND
costinvoice.dateSP=%s")
if(ch==1):
data=('SALE',dt)
info='SALE'
else:
data=('PURCHASE',dt)
info='PURCHASE'
C.execute(Query,data)
rc=C.fetchall()
if rc:
print("---------------------INVOICE LIST---------------------------")
print("---------------------",info,"---------------------------")
print("S.NO.ttCOSTPROD-NAMEttQUANTITYttAMOUNTttDATEttINVOICENO")
for rc1 in rc:
print(count,"tt",rc1[0],"tt",rc1[2],"tt",rc1[1],"tt",rc1[3],"tt",rc1[4])
count=count+1
print("============================================================")
input("----------------------Press any key-------------------------")
C.close()
mydb.close()
return rc
except:
mydb.close()
#--------------------------------
#---Search Product no
def prodsearchdata(scid):
try:
mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem")
C=mydb.cursor()
Query=("SELECT * FROM cosmetic WHERE costid=%s")
data=(scid,)
C.execute(Query,data)
rc=C.fetchone()
if rc:
print("COST-IDtCOST-NAMEtttPRICEtQUANTITYtPROD-TYPEtBRANDtDESCRIPTION")
print(rc[0],"t",rc[1],"ttt",rc[5],"t",rc[4],"t",rc[2],"t",rc[3],"t",rc[6])
input("--------------------press the key---------------------------------")
os.system('cls')
C.close()
mydb.close()
return rc
except:
mydb.close()
#---Search Product no
#----Modify Name of the Cosmetic Product
def search_mod_Prodnm():
try:
mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem")
C=mydb.cursor()
pno=int(input("ENTER Cosmetic Product No"))
rc1=prodsearchdata(pno)
if rc1:
pnm=input("Enter the new Costmetic Product name to update:")
Query=("UPDATE cosmetic SET costname=%s WHERE costid=%s")
data=(pnm,pno)
C.execute(Query,data)
mydb.commit()
print(C.rowcount, "record(s) affected")
C.close()
mydb.close()
except:
mydb.close()
#----Modify price of Product
def search_mod_price():
try:
mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem")
C=mydb.cursor()
pno=int(input("ENTER Cosmetic Product No"))
rc1=prodsearchdata(pno)
if rc1:
pr=int(input("Enter the price to update:"))
Query=("UPDATE cosmetic SET price=%s WHERE costid=%s")
data=(pr,pno)
C.execute(Query,data)
mydb.commit()
print(C.rowcount, "record(s) affected")
C.close()
mydb.close()
except:
mydb.close()
#----Modify Quantity of Product
def search_mod_qty():
try:
mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem")
C=mydb.cursor()
pno=int(input("ENTER Cosmetic Product No"))
rc1=prodsearchdata(pno)
if rc1: #--- and f==1:
qt=int(input("Enter the new Quantity to update:"))
Query=("UPDATE cosmetic SET qty=qty+%s WHERE costid=%s")
data=(qt,pno)
C.execute(Query,data)
mydb.commit()
print(C.rowcount, "record(s) affected")
C.close()
mydb.close()
except:
mydb.close()
#----Modify Type of Product
def search_mod_type():
try:
mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem")
C=mydb.cursor()
pno=int(input("ENTER Cosmetic Product No"))
rc1=prodsearchdata(pno)
if rc1:
ty=input("Enter the new Type to update:")
Query=("UPDATE cosmetic SET type=%s WHERE costid=%s")
data=(ty,pno)
C.execute(Query,data)
mydb.commit()
print(C.rowcount, "record(s) affected")
C.close()
mydb.close()
except:
mydb.close()
#----Modify company of Product
def search_mod_company():
try:
mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem")
C=mydb.cursor()
pno=int(input("ENTER Cosmetic Product No"))
rc1=prodsearchdata(pno)
if rc1:
ty=input("Enter the new Company to update:")
Query=("UPDATE cosmetic SET company=%s WHERE costid=%s")
data=(ty,pno)
C.execute(Query,data)
mydb.commit()
print(C.rowcount, "record(s) affected")
C.close()
mydb.close()
except:
mydb.close()
#----Modify company of Product
def search_mod_desc():
try:
mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem")
C=mydb.cursor()
pno=int(input("ENTER Cosmetic Product No"))
rc1=prodsearchdata(pno)
if rc1:
ds=input("Enter the new Description to update:")
Query=("UPDATE cosmetic SET des=%s WHERE costid=%s")
data=(ds,pno)
C.execute(Query,data)
mydb.commit()
print(C.rowcount, "record(s) affected")
C.close()
mydb.close()
except:
mydb.close()
#-- to generate the autonumbers
def giveno():
count=0
mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem")
mycursor=mydb.cursor()
query=("SELECT COUNT(*) FROM cosmetic")
q=("SELECT MAX(costid) FROM cosmetic")
mycursor.execute(query)
rc=mycursor.fetchone()
tmp=rc[0]
print(tmp)
if tmp==0:
count=int(input("Enter the New Cosmetic Product No:"))
else:
q=("SELECT MAX(costid) FROM cosmetic")
mycursor.execute(q)
rc=mycursor.fetchone()
count=rc[0]
count=count+1
mycursor.close()
mydb.close()
return count
#-To add new record of Products
def write_cosmeticrecord():
try:
mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem")
print(mydb)
C=mydb.cursor()
Query=("INSERT INTO cosmetic VALUES(%s,%s,%s,%s,%s,%s,%s)")
pno=giveno()
pdid=pno
pname=input("Enter Cosmetic Product Name")
pr=int(input("Enter Price"))
print("(Example:Compact/Eye shadow/Eye shadow/Lipstick/Moisturizer/Nail Polish/Face pack/etc.)")
ty=input("Enter Product Type:")
bnm=input("Enter Cosmetic Product Brand name")
qt=int(input("Enter quantity"))
dsc=input("Enter Product description")
data=(pdid,pname,ty,bnm,qt,pr,dsc)
C.execute(Query,data)
mydb.commit()
C.close()
mydb.close()
except:
mydb.close()
#--show all Cosmetic Products
def showallCosmeticprod():
try:
mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem")
C=mydb.cursor()
Query=("SELECT * FROM cosmetic")
#data=(scid,)
C.execute(Query)
rc=C.fetchall()
if rc:
print("COSTIDtCOSMETIC-NAMEtttPRICEtQUANTITYtCOST-TYPEtBRANDt
DESCRIPTION")
for x in rc:
print(x[0],"t",x[1],"ttt",x[5],"t",x[4],"t",x[2],"t",x[3],"t",x[6
input("--------------------press the key---------------------------------")
os.system('cls')
C.close()
mydb.close()
return rc
except:
mydb.close()
#----search and display Product by ID
def showprodID():
try:
mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem")
C=mydb.cursor()
scid=int(input("Enter the COSMETIC Product ID:"))
Query=("SELECT * FROM cosmetic WHERE costid=%s")
data=(scid,)
C.execute(Query,data)
rc=C.fetchone()
if rc:
print("COSTIDtCOSMETIC-NAMEtttPRICEtQUANTITYtTYPEtBRANDtDESCRIPTION")
print(rc[0],"t",rc[1],"ttt",rc[5],"t",rc[4],"t",rc[2],"t",rc[3],"t",rc[6])
input("--------------------press the key---------------------------------")
os.system('cls')
C.close()
mydb.close()
return rc
except:
mydb.close()
#----search and display Product Name
def showprodnm():
try:
mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem")
C=mydb.cursor()
scid=input("Enter the Costmetic Product Name:")
Query=("SELECT * FROM cosmetic WHERE costname=%s")
data=(scid,)
C.execute(Query,data)
rc=C.fetchone()
if rc:
print("COSTIDtCOSMETIC-NAMEtttPRICEtQUANTITYtTYPEtBRANDtDESCRIPTION")
print(rc[0],"t",rc[1],"ttt",rc[5],"t",rc[4],"t",rc[2],"t",rc[3],"t",rc[6])
input("--------------------press the key---------------------------------")
os.system('cls')
C.close()
mydb.close()
return rc
except:
mydb.close()
#----search and display Product by price
def showbyProdprice():
try:
mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem")
C=mydb.cursor()
low=int(input("Enter the Price lowest value:"))
high=int(input("Enter the Price Highest value:"))
Query=("SELECT * FROM grosproduct WHERE price BETWEEN %s AND %s ")
data=(low,high)
C.execute(Query,data)
rc=C.fetchall()
if rc:
print("COSTIDtCOSMETIC-NAMEtttPRICEtQUANTITYtTYPEtBRANDtDESCRIPTION")
for rc1 in rc:
print(rc1[0],"t",rc1[1],"ttt",rc1[5],"t",rc1[4],"t",rc1[2],"t",rc1[3],"t",rc1[6])
input("--------------------press the key---------------------------------")
os.system('cls')
C.close()
mydb.close()
return rc
except:
mydb.close()
#----search and display Product by type
def showProdtype():
try:
mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem")
C=mydb.cursor()
print("(Example:Compact/Eye shadow/Eye shadow/Lipstick/Moisturizer/Nail Polish/Face pack/etc.)")
scid=input("Enter the Cosmetic Product type:")
Query=("SELECT * FROM cosmetic WHERE type=%s")
data=(scid,)
C.execute(Query,data)
rc=C.fetchall()
if rc:
print("COSTIDtCOSMETIC-NAMEtttPRICEtQUANTITYtTYPEtBRANDtDESCRIPTION")
for rc1 in rc:
print(rc1[0],"t",rc1[1],"ttt",rc1[5],"t",rc1[4],"t",rc1[2],"t",rc1[3],"t",rc1[6])
input("--------------------press the key---------------------------------")
os.system('cls')
C.close()
mydb.close()
return rc
except:
mydb.close()
#----search and display Product by brand
def showProdcompy():
try:
mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem")
C=mydb.cursor()
scid=input("Enter the Cosmetic Product Brand name:")
Query=("SELECT * FROM cosmetic WHERE company=%s")
data=(scid,)
C.execute(Query,data)
rc=C.fetchall()
if rc:
print("COSTIDtCOSMETIC-NAMEtttPRICEtQUANTITYtTYPEtBRANDtDESCRIPTION")
for rc1 in rc:
print(rc1[0],"t",rc1[1],"ttt",rc1[5],"t",rc1[4],"t",rc1[2],"t",rc1[3],"t",rc1[6])
input("--------------------press the key---------------------------------")
os.system('cls')
C.close()
mydb.close()
return rc
except:
mydb.close()
#---delete the cosmetic record from the table
def deletecosmetic():
try:
mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem")
C=mydb.cursor()
gno=int(input("ENTER Cosmetic Product No"))
rc1=prodsearchdata(gno)
if rc1: #--- and f==1:
Query=("DELETE FROM cosmetic WHERE costid=%s")
data=(gno,)
C.execute(Query,data)
mydb.commit()
print(C.rowcount, "record(s) affected")
C.close()
mydb.close()
except:
mydb.close()
#-------invoice to sell the Cosmetic
def Med_Sale():
try:
mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem")
print(mydb)
C=mydb.cursor()
netamt=0
Query=("INSERT INTO costinvoice VALUES(%s,%s,%s,%s,%s,%s,%s,%s,%s)")
invono=int(input("Enter the invoice no:"))
dosp=input("Enter the date of sale(yyyy-mm-dd)")
custnm=input("Enter the Customer Name:")
mob=input("enter the mobile no:")
while True:
no=givemeno()
invoiceid=no
gno=int(input("Enter the Cosmetic Product no"))
rc1=prodsearchdata(gno)
if rc1:
qt=int(input("Enter the quantity:"))
pr=int(input("Enter the price"))
netamt=pr*qt
data=(invoiceid,gno,custnm,mob,qt,'SALE',invono,netamt,dosp)
C.execute(Query,data)
mydb.commit()
print(C.rowcount, "record(s) affected")
changeqty(gno,qt,'S')
else:
print("No such Cosmetic record please try again")
ch=input("Do you want to add more Cosmetic to sell(y/n)")
if(ch=='n' or ch=='N'):
break
C.close()
mydb.close()
except:
mydb.close()
#------Update the qty----
def changeqty(mno,qt,ch):
try:
mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem")
C=mydb.cursor()
if(ch=='S'):
Query=("UPDATE cosmetic SET qty=qty-%s WHERE costid=%s")
elif(ch=='A'):
Query=("UPDATE cosmetic SET qty=qty+%s WHERE costid=%s")
data=(qt,mno)
C.execute(Query,data)
mydb.commit()
print(C.rowcount, "record(s) affected")
C.close()
mydb.close()
except:
mydb.close()
#-------invoice to Purchase the Cosmetic
def Gar_Purchase():
try:
mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem")
print(mydb)
C=mydb.cursor()
netamt=0
Query=("INSERT INTO costinvoice VALUES(%s,%s,%s,%s,%s,%s,%s,%s,%s)")
invono=int(input("Enter the invoice no:"))
dosp=input("Enter the date of sale")
custnm=input("Enter the Distributer Name:")
mob=input("enter the mobile no:")
while True:
no=givemeno()
invoiceid=no
gno=int(input("Enter the Cosmetic Product no"))
rc1=prodsearchdata(gno)
if rc1:
qt=int(input("Enter the quantity:"))
pr=int(input("Enter the price"))
netamt=pr*qt
data=(invoiceid,gno,custnm,mob,qt,'PURCHASE',invono,netamt,dosp)
C.execute(Query,data)
mydb.commit()
print(C.rowcount, "record(s) affected")
changeqty(gno,qt,'A')
else:
print("No such Cosmetic record please try again")
ch=input("Do you want to add more Cosmetic to sell(y/n)")
if(ch=='n' or ch=='N'):
break
C.close()
mydb.close()
except:
mydb.close()
#-- to generate the autonumbers
def givemeno():
count=0
mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem")
print(mydb)
mycursor=mydb.cursor()
query=("SELECT COUNT(*) FROM costinvoice")
q=("SELECT MAX(costid) FROM costinvoice")
mycursor.execute(query)
rc=mycursor.fetchone()
tmp=rc[0]
print(tmp)
if tmp==0:
count=1
else:
q=("SELECT MAX(costid) FROM costinvoice")
mycursor.execute(q)
rc=mycursor.fetchone()
count=rc[0]
count=count+1
mycursor.close()
mydb.close()
return count
File Name: cosmaticmainpage.py
import cosmatic_menu as CM
import sys
import cosmatic as GM
def invoice_show():
choice1=CM.cosmeticinvoicereports()
while True:
if choice1==1:
GM.searchCOSinvoice()
break
elif choice1==2:
GM.searchPURinvoice()
break
elif choice1==3:
GM.displayinvoiceSP()
break
elif choice1==4:
GM.displayinvoiceSPdate()
break
elif choice1==5:
main()
else:
#print("Enter the correct choice")
input("Enter any key to continue")
choice1=0
invoice_show()
def modifycosmeticshow():
choice1=" "
choice1=CM.modifyCosmetic_menu()
while True:
if choice1==1:
GM.search_mod_Prodnm()
break
elif choice1==2:
#-------2.MODIFY PRICE
GM.search_mod_price()
break
elif choice1==3:
#-------3.MODIFY QUANTITY
GM.search_mod_qty()
break
elif choice1==4:
#-------4.MODIFY type
GM.search_mod_type()
break
elif choice1==5:
#-------5.MODIFY
GM.search_mod_company()
break
elif choice1==6:
GM.search_mod_desc()
break
elif choice1==7:
main()
else:
#print("Enter the correct choice")
input("Enter any key to continue")
modifycosmeticshow()
#-----------------COSMETIC MENU
def Cosmeticmenu_show():
choice1=" "
choice1=CM.Cosmetic_ADM_menu()
while True:
if choice1==1:
cosmeticmidmenu()
break
elif choice1==2:
salepurchase_show()
break
elif choice1==3:
main()
else:
print("Enter the correct choice")
input("Enter any key to continue")
Groserymenu_show()
#-------------------------
def cosmetic_show():
choice1=CM.admin_menu1()
while True:
if choice1==1:
GM.write_cosmeticrecord()
break
elif choice1==2:
GM.showallCosmeticprod()
break
elif choice1==3:
GM.showprodID()
break
elif choice1==4:
GM.showprodnm()
break
elif choice1==5:
GM.showbyProdprice()
break
elif choice1==6:
GM.showProdtype()
break
elif choice1==7:
GM.showProdcompy()
break
elif choice1==8:
main()
break
else:
print("Enter the correct choice")
input("Enter any key to continue")
choice1=0
cosmetic_show()
#--------administrator menu
def cosmeticmidmenu():
choice1=CM.cosmetic_menu()
while True:
if choice1==1:
cosmetic_show()
break
elif choice1==2:
modifycosmeticshow()
break
elif choice1==3:
GM.deletecosmetic()
break
elif choice1==4:
print("a")
break
else:
print("Enter the correct choice")
input("Enter any key to continue")
choice1=0
cosmeticmidmenu()
def salepurchase_show():
choice1=CM.SALE_PURCHASEmenu()
while True:
if choice1==1:
GM.Med_Sale()
break
elif choice1==2:
GM.Gar_Purchase()
break
elif choice1==3:
main()
else:
#print("Enter the correct choice")
input("Enter any key to continue")
choice1=0
salepurchase_show()
#-------------Main MENU------------------------------
def main():
CM.intro()
choice=0
while(True):
choice=CM.main()
if choice==1:
CM.myclear()
invoice_show()
elif choice==2:
CM.myclear()
Cosmeticmenu_show()
elif choice==3:
exit(1)
else:
print("Enter the correct choice")
input("Enter any key to continue")
main()
OUTPUTS
=================MAIN MENU====================
01. COSMETIC REPORT GENERATOR
02. ADMINISTRATOR
03. EXIT
==============================================
Please Select Your Option (1-3)
If choice: 1
=================COSMETIC ADD MENU====================
1.SEARCH AND PRINT SALE INVOICE
2.SEARCH AND PRINT PURCHASE INVOICE
3.DISPLAY ALL INVOICE(SALE/PURCHASE)
4.SEARCH INVOICE BY DATEOFINVOICE
5.BACK TO MAIN MENU
If choice : 1
Enter the Invoice No:5600
----------------INVOICE: 5600 ---------DATE: 2020-12-02
--NAME:-- Sam -----------MOBILE NO.: 885569632
--------------------------SALE------------------------------
S.NO.----|------------COSMETIC NAME-------------------TOTAL-----
1 |--- LipToGlow | 75
2 |--- M-Eye | 36
============================================================
Total: 111
GST : 13.32
NETTOTAL: 124.32
----------------------Press any key-------------------------
If choice : 3
Please Enter Your Choice (1-5) 3
Enter the Choice 1- SALE Wise 2- PURCHASE Wise:1
---------------------INVOICE LIST---------------------------
------------------------------------------------------------
S.NO. COSTPROD-NAME QUANTITY AMOUNT DATE INVOICE NO
1 LipToGlow 5 75 2020-12-02 5600
2 M-Eye 3 36 2020-12-02 5600
============================================================
If choice : 2
1.COSMETIC'S MENU
2.COSMETIC'S SALE/PURCHASE
3.BACK TO MAIN MENU
Please Enter Your Choice (1-3)
If choice : 1
===========COSMETIC INFO MENU===========
01. ADD COSMETIC INFORMATION
02. MODIFY COSMETIC INFORMATION
03. DELETE COSMETIC INFORMATION
04. BACK TO MAIN
==============================================
Please Select Your Option (1-4)
If choice : 1
=================COSMETIC ADD MENU====================
1.CREATE COSMETIC DETAILS
2.DISPLAY ALL CORMETIC DETAILS
3.SEARCH RECORD BY COSMETIC PRODUCT ID
4.SEARCH RECORD BY COSMETIC PRODUCT NAME
5.SEARCH RECORD BY PRICE
6.SEARCH RECORD BY TYPE
7.SEARCH RECORD BY COMPANY
8.BACK TO MAIN MENU
Please Enter Your Choice (1-8)
If choice: 1
Enter Cosmetic Product NameHairFLy
Enter Price785
(Example:Compact/Eye shadow/Eye shadow/Lipstick/Moisturizer/Nail Polish/Face pack/etc.)
Enter Product Type:Hair Dryer
Enter Cosmetic Product Brand nameFACE
Enter quantity10
Enter Product descriptionDryer
If choice: 2
Please Enter Your Choice (1-8) 2
COSTID COSMETIC-NAME PRICE QUANTITY COST-TYPE BRAND DESCRIPTION
1200 Lipstic 50 20 Lipstick Lakme Red colour lipstick box
1201 LipToGlow 15 45 Lip Glow Lakme Light lip glow
1202 M-Eye 12 22 Eye Shadow Lakme Shadow
1203 HairFLy 785 10 Hair Dryer FACE Dryer
If choice : Modify 2
===============MODIFY MENU==================
1.MODIFY COSMETIC PRODUCT NAME
2.MODIFY PRICE
3.MODIFY QUANTITY
4.MODIFY TYPE
5.MODIFY COMPANY
6.MODIFY DESCRIPTION
7.BACK TO MAIN MENU
Please Enter Your Choice (1-7)
REQUIREMENTS
HARDWARE REQUIRED
 Printer, to print the required documents of the project
 Processor : intel or any other
 Ram : 512 MB or above
 Harddisk : 80 GB or more
 SOFTWARE REQUIRED
 Operating system : Windows 7 or above
 Python 2 or above
 IDE Atom, PyCharm, Thonny, or any other.
 Database: MySQL
 WebServer: XAMPP
ADVANTAGES AND DISADVANTAGES
 Provide a Single environment from where an administrator can interact
with the beauty shop system resources within the beauty center network.
 Provides interface to interact with the beauty shop system
 Paperwork is removed.
 Customer records are records through this system
Disadvantage:
 The current system doesn’t allow the remote access of the cosmetic
system resources of one system with other
 This system need updating of product every time
CONCLUSION
In this project we put all the things that needed for the cosmetic
shop, to manage all the work related to products sale and purchase
and the customer’s information. But it need more updating as it can
be perfect for small shops of cosmetic.
BIBLIOGRAPHY
 www.mysql.org
 www.google.co.in
 www.w3schools.com
 www.tutorialspoint.com
 www.javapoint.com
 www.programiz.com
 www.guru99.com

Python Project On Cosmetic Shop system

  • 1.
    Type Your SchoolName Project Report On COSMETIC SHOP SYSTEM ………………………………………….. (SESSION-……………) …………………………. …............... LOGO
  • 2.
    ACKNOWLEDGEMENT I would liketo convey my heartful thanks to ……………………………. (Computer Science) who always gave valuable suggestions & guidance for completion of my project. He helped me to understand & remember important details of the project. My project has been a success only because of his guidance. I am especially indented & I am also beholden to my friends. And finally I thank to the members of my family for their support & encouragement.
  • 3.
    CERTIFICATE This is tocertify that …………………… of class ………… of ……………………………. has completed his project under my supervision. He has taken proper care & shown sincerity in completion of this project. I certify that this project is up to my expectation & as per the guideline issued by CBSE. ………………………….. (Computer Science faculty)
  • 4.
    Content 1. Introduction 2. FlowchartDesign 3. Database Structure 4. Source Code 5. Output 6. Requirement 7. Advantages and disadvantages 8. Conclusion 9. Bibliography
  • 5.
    INTRODUCTION Cosmetics Shop ManagementSystem is a complete solution for managing a Shop, in other words, an enhanced tool that assists in organizing the day-to-day activities of a Shop. There is the need of an application for efficient management and handling customer orders. This Cosmetics Shop Management System keeps every record Shop and reducing paperwork. These records are stored in the database with security. Your data be a secure and only authorized person can take the copy of data. The main processes of the system focus on customer's request where the system is able to search the most appropriate products and deliver it to the customers. It should help the employees to quickly identify the list of cosmetic product that have reached the minimum quantity.
  • 6.
  • 7.
    DATABASE STRUCTURE Table Name:cosmetic Column Name Data type/Size Constraints costid int(11) Primary key costname varchar(30) type varchar(15) company varchar(15) qty int(11) price int(11) des varchar(40) Table Name: costinvoice ColumnName Data Type Constraint invoid int(11) Primary Key costid int(11) custnm varchar(25) mobno varchar(15) qty int(11) status varchar(15) invoiceno int(11) amt int(11) dateSP date
  • 8.
    SOURCE CODE File Name:cosmatic_menu.py """************************************************************* THE MAIN FUNCTION OF PROGRAM ****************************************************************""" import platform import os def myclear(): if platform.system()=="Windows": print(os.system("cls")) def intromain(): myclear() print("***SMETIC*****MANAGEMENT****SYSTEM******PROJECT*******************") print("***************************************************************************") def intro(): print("*************************COSMETIC-MANAGEMENT***************************") print("===========================================================") print("****************************S=Y=S=T=E=M********************************") print("PROJECT:") print("MADE BY : ……………………") print("---------------SCHOOL : DOON PUBLIC SCHOOL--------------------") def main(): ch=0 myclear() intromain() print("=================MAIN MENU====================") print("01. COSMETIC REPORT GENERATOR") print("02. ADMINISTRATOR") print("03. EXIT") print("==============================================") ch=int(input("Please Select Your Option (1-3)")) return ch def cosmetic_menu(): ch=0 intromain() print("===========COSMETIC INFO MENU===========") print("01. ADD COSMETIC INFORMATION") print("02. MODIFY COSMETIC INFORMATION") print("03. DELETE COSMETIC INFORMATION") print("04. BACK TO MAIN") print("==============================================") ch=int(input("Please Select Your Option (1-4) ")) return ch
  • 9.
    """*************************************************************** ADMINSTRATOR COSMETIC FUNCTION ****************************************************************""" defadmin_menu1(): ch=0 myclear() intromain() print("=================COSMETIC ADD MENU====================") print("1.CREATE COSMETIC DETAILS") print("2.DISPLAY ALL CORMETIC DETAILS") print("3.SEARCH RECORD BY COSMETIC PRODUCT ID") print("4.SEARCH RECORD BY COSMETIC PRODUCT NAME") print("5.SEARCH RECORD BY PRICE") print("6.SEARCH RECORD BY TYPE") print("7.SEARCH RECORD BY COMPANY") print("8.BACK TO MAIN MENU") ch=int(input("Please Enter Your Choice (1-8) ")) return ch """*************************************************************** ADMINSTRATOR GROSERY MAIN MENU FUNCTION ****************************************************************""" def Cosmetic_ADM_menu(): ch=0 myclear() intromain() print("=================ADMIN MENU====================") print("1.COSMETIC'S MENU") print("2.COSMETIC'S SALE/PURCHASE") print("3.BACK TO MAIN MENU") ch=int(input("Please Enter Your Choice (1-3) ")) return ch """********************************************************** MODIFY MENU ********************************************************""" def modifyCosmetic_menu(): ch=0 myclear() intromain() print("===============MODIFY MENU==================") print("1.MODIFY COSMETIC PRODUCT NAME") print("2.MODIFY PRICE") print("3.MODIFY QUANTITY") print("4.MODIFY TYPE") print("5.MODIFY COMPANY") print("6.MODIFY DESCRIPTION")
  • 10.
    print("7.BACK TO MAINMENU") ch=int(input("Please Enter Your Choice (1-7) ")) return ch """********************************************************** REPORTS MENU ********************************************************""" def SALE_PURCHASEmenu(): ch=0 myclear() intromain() print("===============SALE AND PURCHASE MENU==================") print("1.COSMETIC PRODUCT SOLD OUT") print("2.COSMETIC PRODUCT PURCHASED") print("3.BACK TO MAIN MENU") ch=int(input("Please Enter Your Choice (1-3) ")) return ch def cosmeticinvoicereports(): ch=0 myclear() intromain() print("=================COSMETIC ADD MENU====================") print("1.SEARCH AND PRINT SALE INVOICE") print("2.SEARCH AND PRINT PURCHASE INVOICE") print("3.DISPLAY ALL INVOICE(SALE/PURCHASE)") print("4.SEARCH INVOICE BY DATEOFINVOICE") print("5.BACK TO MAIN MENU") ch=int(input("Please Enter Your Choice (1-5) ")) return ch File Name: cosmatic.py import os import pymysql --------SEARCH AND PRINT SALE INVOICE def searchCOSinvoice(): try: mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem") C=mydb.cursor() tot=0 gst=0 count=1 nettot=0 invo=int(input("Enter the Invoice No:")) Query=("SELECT cosmetic.costname,costinvoice.amt,costinvoice.qty, costinvoice.dateSP, costinvoice.custnm, costinvoice.mobno FROM cosmetic,costinvoice WHERE cosmetic.costid= costinvoice.costid AND costinvoice.status='SALE' AND costinvoice.invoiceno=%s") data=(invo,) C.execute(Query,data)
  • 11.
    rc=C.fetchall() if rc: print("----------------INVOICE: ",invo,"---------DATE:",rc[0][3]) print("--NAME:--",rc[0][4],"-----------MOBILE NO.:",rc[0][5]) print("--------------------------SALE------------------------------") print("S.NO.----|------------COSMETIC NAME-------------------TOTAL-----") for rc1 in rc: tot=tot+rc1[1] print(count," |---",rc1[0],"ttttt |t",rc1[1]) count=count+1 gst=tot*12/100 nettot=tot+gst print("============================================================") print(" Total: ",tot) print(" GST : ",gst) print(" NETTOTAL: ",nettot) input("----------------------Press any key-------------------------") C.close() mydb.close() return rc except: mydb.close() def searchPURinvoice(): try: mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem") C=mydb.cursor() tot=0 gst=0 count=1 nettot=0 invo=int(input("Enter the Invoice No:")) Query=("SELECT cosmetic.costname, costinvoice.amt, costinvoice.qty, costinvoice.dateSP, costinvoice.custnm,costinvoice.mobno FROM cosmetic,costinvoice WHERE cosmetic.costid = costinvoice.costid AND costinvoice.status='PURCHASE' AND costinvoice.invoiceno=%s") data=(invo,) C.execute(Query,data) rc=C.fetchall() if rc: print("----------------INVOICE: ",invo,"---------DATE: ",rc[0][3]) print("--NAME:--",rc[0][4],"-----------MOBILE NO.:",rc[0][5]) print("--------------------------PURCHASE------------------------------") print("S.NO.----|------------COSMETIC NAME-------------------TOTAL-----") for rc1 in rc: tot=tot+rc1[1] print(count," |---",rc1[0],"ttttt |t",rc1[1]) count=count+1
  • 12.
    gst=tot*12/100 nettot=tot+gst print("============================================================") print(" Total: ",tot) print("GST : ",gst) print(" NETTOTAL: ",nettot) input("----------------------Press any key-------------------------") C.close() mydb.close() return rc except: mydb.close() #----------display all invoice SALE or PURCHASE wise def displayinvoiceSP(): try: mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem") C=mydb.cursor() count=1 ch=int(input("Enter the Choice 1- SALE Wise 2- PURCHASE Wise:")) Query=("SELECT cosmetic.costname,costinvoice.amt,costinvoice.qty,costinvoice.dateSP, costinvoice.invoiceno FROM cosmetic,costinvoice WHERE cosmetic.costid=costinvoice.costid AND costinvoice.status=%s") if(ch==1): data=('SALE',) else: data=('PURCHASE',) C.execute(Query,data) rc=C.fetchall() if rc: print("---------------------INVOICE LIST---------------------------") print("------------------------------------------------------------") print("S.NO.ttCOSTPROD-NAMEttQUANTITYttAMOUNTttDATEtINVOICE NO") for rc1 in rc: print(count,"tt",rc1[0],"tt",rc1[2],"tt",rc1[1],"tt",rc1[3],"t",rc1[4]) count=count+1 print("============================================================") input("----------------------Press any key-------------------------") C.close() mydb.close() return rc except: mydb.close() #----------display all invoice SALE or PURCHASE by date def displayinvoiceSPdate(): try:
  • 13.
    mydb=pymysql.connect(host="localhost", user="root", passwd="",database="cosmeticsystem") C=mydb.cursor() count=1 ch=int(input("Enter the Choice 1- SALE Wise 2- PURCHASE Wise:")) dt=input("Enter the date(yyyy-mm-dd)") Query=("SELECT cosmetic.costname,costinvoice.amt,costinvoice.qty,costinvoice.dateSP,costinvoice.invoiceno FROM cosmetic,costinvoice WHERE cosmetic.costid=costinvoice.costid AND costinvoice.status=%s AND costinvoice.dateSP=%s") if(ch==1): data=('SALE',dt) info='SALE' else: data=('PURCHASE',dt) info='PURCHASE' C.execute(Query,data) rc=C.fetchall() if rc: print("---------------------INVOICE LIST---------------------------") print("---------------------",info,"---------------------------") print("S.NO.ttCOSTPROD-NAMEttQUANTITYttAMOUNTttDATEttINVOICENO") for rc1 in rc: print(count,"tt",rc1[0],"tt",rc1[2],"tt",rc1[1],"tt",rc1[3],"tt",rc1[4]) count=count+1 print("============================================================") input("----------------------Press any key-------------------------") C.close() mydb.close() return rc except: mydb.close() #-------------------------------- #---Search Product no def prodsearchdata(scid): try: mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem") C=mydb.cursor() Query=("SELECT * FROM cosmetic WHERE costid=%s") data=(scid,) C.execute(Query,data) rc=C.fetchone() if rc: print("COST-IDtCOST-NAMEtttPRICEtQUANTITYtPROD-TYPEtBRANDtDESCRIPTION") print(rc[0],"t",rc[1],"ttt",rc[5],"t",rc[4],"t",rc[2],"t",rc[3],"t",rc[6]) input("--------------------press the key---------------------------------") os.system('cls')
  • 14.
    C.close() mydb.close() return rc except: mydb.close() #---Search Productno #----Modify Name of the Cosmetic Product def search_mod_Prodnm(): try: mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem") C=mydb.cursor() pno=int(input("ENTER Cosmetic Product No")) rc1=prodsearchdata(pno) if rc1: pnm=input("Enter the new Costmetic Product name to update:") Query=("UPDATE cosmetic SET costname=%s WHERE costid=%s") data=(pnm,pno) C.execute(Query,data) mydb.commit() print(C.rowcount, "record(s) affected") C.close() mydb.close() except: mydb.close() #----Modify price of Product def search_mod_price(): try: mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem") C=mydb.cursor() pno=int(input("ENTER Cosmetic Product No")) rc1=prodsearchdata(pno) if rc1: pr=int(input("Enter the price to update:")) Query=("UPDATE cosmetic SET price=%s WHERE costid=%s") data=(pr,pno) C.execute(Query,data) mydb.commit() print(C.rowcount, "record(s) affected") C.close() mydb.close() except: mydb.close() #----Modify Quantity of Product def search_mod_qty(): try: mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem")
  • 15.
    C=mydb.cursor() pno=int(input("ENTER Cosmetic ProductNo")) rc1=prodsearchdata(pno) if rc1: #--- and f==1: qt=int(input("Enter the new Quantity to update:")) Query=("UPDATE cosmetic SET qty=qty+%s WHERE costid=%s") data=(qt,pno) C.execute(Query,data) mydb.commit() print(C.rowcount, "record(s) affected") C.close() mydb.close() except: mydb.close() #----Modify Type of Product def search_mod_type(): try: mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem") C=mydb.cursor() pno=int(input("ENTER Cosmetic Product No")) rc1=prodsearchdata(pno) if rc1: ty=input("Enter the new Type to update:") Query=("UPDATE cosmetic SET type=%s WHERE costid=%s") data=(ty,pno) C.execute(Query,data) mydb.commit() print(C.rowcount, "record(s) affected") C.close() mydb.close() except: mydb.close() #----Modify company of Product def search_mod_company(): try: mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem") C=mydb.cursor() pno=int(input("ENTER Cosmetic Product No")) rc1=prodsearchdata(pno) if rc1: ty=input("Enter the new Company to update:") Query=("UPDATE cosmetic SET company=%s WHERE costid=%s") data=(ty,pno) C.execute(Query,data) mydb.commit()
  • 16.
    print(C.rowcount, "record(s) affected") C.close() mydb.close() except: mydb.close() #----Modifycompany of Product def search_mod_desc(): try: mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem") C=mydb.cursor() pno=int(input("ENTER Cosmetic Product No")) rc1=prodsearchdata(pno) if rc1: ds=input("Enter the new Description to update:") Query=("UPDATE cosmetic SET des=%s WHERE costid=%s") data=(ds,pno) C.execute(Query,data) mydb.commit() print(C.rowcount, "record(s) affected") C.close() mydb.close() except: mydb.close() #-- to generate the autonumbers def giveno(): count=0 mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem") mycursor=mydb.cursor() query=("SELECT COUNT(*) FROM cosmetic") q=("SELECT MAX(costid) FROM cosmetic") mycursor.execute(query) rc=mycursor.fetchone() tmp=rc[0] print(tmp) if tmp==0: count=int(input("Enter the New Cosmetic Product No:")) else: q=("SELECT MAX(costid) FROM cosmetic") mycursor.execute(q) rc=mycursor.fetchone() count=rc[0] count=count+1 mycursor.close() mydb.close() return count
  • 17.
    #-To add newrecord of Products def write_cosmeticrecord(): try: mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem") print(mydb) C=mydb.cursor() Query=("INSERT INTO cosmetic VALUES(%s,%s,%s,%s,%s,%s,%s)") pno=giveno() pdid=pno pname=input("Enter Cosmetic Product Name") pr=int(input("Enter Price")) print("(Example:Compact/Eye shadow/Eye shadow/Lipstick/Moisturizer/Nail Polish/Face pack/etc.)") ty=input("Enter Product Type:") bnm=input("Enter Cosmetic Product Brand name") qt=int(input("Enter quantity")) dsc=input("Enter Product description") data=(pdid,pname,ty,bnm,qt,pr,dsc) C.execute(Query,data) mydb.commit() C.close() mydb.close() except: mydb.close() #--show all Cosmetic Products def showallCosmeticprod(): try: mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem") C=mydb.cursor() Query=("SELECT * FROM cosmetic") #data=(scid,) C.execute(Query) rc=C.fetchall() if rc: print("COSTIDtCOSMETIC-NAMEtttPRICEtQUANTITYtCOST-TYPEtBRANDt DESCRIPTION") for x in rc: print(x[0],"t",x[1],"ttt",x[5],"t",x[4],"t",x[2],"t",x[3],"t",x[6 input("--------------------press the key---------------------------------") os.system('cls') C.close() mydb.close() return rc except: mydb.close() #----search and display Product by ID def showprodID():
  • 18.
    try: mydb=pymysql.connect(host="localhost", user="root", passwd="",database="cosmeticsystem") C=mydb.cursor() scid=int(input("Enter the COSMETIC Product ID:")) Query=("SELECT * FROM cosmetic WHERE costid=%s") data=(scid,) C.execute(Query,data) rc=C.fetchone() if rc: print("COSTIDtCOSMETIC-NAMEtttPRICEtQUANTITYtTYPEtBRANDtDESCRIPTION") print(rc[0],"t",rc[1],"ttt",rc[5],"t",rc[4],"t",rc[2],"t",rc[3],"t",rc[6]) input("--------------------press the key---------------------------------") os.system('cls') C.close() mydb.close() return rc except: mydb.close() #----search and display Product Name def showprodnm(): try: mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem") C=mydb.cursor() scid=input("Enter the Costmetic Product Name:") Query=("SELECT * FROM cosmetic WHERE costname=%s") data=(scid,) C.execute(Query,data) rc=C.fetchone() if rc: print("COSTIDtCOSMETIC-NAMEtttPRICEtQUANTITYtTYPEtBRANDtDESCRIPTION") print(rc[0],"t",rc[1],"ttt",rc[5],"t",rc[4],"t",rc[2],"t",rc[3],"t",rc[6]) input("--------------------press the key---------------------------------") os.system('cls') C.close() mydb.close() return rc except: mydb.close() #----search and display Product by price def showbyProdprice(): try: mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem") C=mydb.cursor() low=int(input("Enter the Price lowest value:")) high=int(input("Enter the Price Highest value:")) Query=("SELECT * FROM grosproduct WHERE price BETWEEN %s AND %s ")
  • 19.
    data=(low,high) C.execute(Query,data) rc=C.fetchall() if rc: print("COSTIDtCOSMETIC-NAMEtttPRICEtQUANTITYtTYPEtBRANDtDESCRIPTION") for rc1in rc: print(rc1[0],"t",rc1[1],"ttt",rc1[5],"t",rc1[4],"t",rc1[2],"t",rc1[3],"t",rc1[6]) input("--------------------press the key---------------------------------") os.system('cls') C.close() mydb.close() return rc except: mydb.close() #----search and display Product by type def showProdtype(): try: mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem") C=mydb.cursor() print("(Example:Compact/Eye shadow/Eye shadow/Lipstick/Moisturizer/Nail Polish/Face pack/etc.)") scid=input("Enter the Cosmetic Product type:") Query=("SELECT * FROM cosmetic WHERE type=%s") data=(scid,) C.execute(Query,data) rc=C.fetchall() if rc: print("COSTIDtCOSMETIC-NAMEtttPRICEtQUANTITYtTYPEtBRANDtDESCRIPTION") for rc1 in rc: print(rc1[0],"t",rc1[1],"ttt",rc1[5],"t",rc1[4],"t",rc1[2],"t",rc1[3],"t",rc1[6]) input("--------------------press the key---------------------------------") os.system('cls') C.close() mydb.close() return rc except: mydb.close() #----search and display Product by brand def showProdcompy(): try: mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem") C=mydb.cursor() scid=input("Enter the Cosmetic Product Brand name:") Query=("SELECT * FROM cosmetic WHERE company=%s") data=(scid,) C.execute(Query,data) rc=C.fetchall()
  • 20.
    if rc: print("COSTIDtCOSMETIC-NAMEtttPRICEtQUANTITYtTYPEtBRANDtDESCRIPTION") for rc1in rc: print(rc1[0],"t",rc1[1],"ttt",rc1[5],"t",rc1[4],"t",rc1[2],"t",rc1[3],"t",rc1[6]) input("--------------------press the key---------------------------------") os.system('cls') C.close() mydb.close() return rc except: mydb.close() #---delete the cosmetic record from the table def deletecosmetic(): try: mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem") C=mydb.cursor() gno=int(input("ENTER Cosmetic Product No")) rc1=prodsearchdata(gno) if rc1: #--- and f==1: Query=("DELETE FROM cosmetic WHERE costid=%s") data=(gno,) C.execute(Query,data) mydb.commit() print(C.rowcount, "record(s) affected") C.close() mydb.close() except: mydb.close() #-------invoice to sell the Cosmetic def Med_Sale(): try: mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem") print(mydb) C=mydb.cursor() netamt=0 Query=("INSERT INTO costinvoice VALUES(%s,%s,%s,%s,%s,%s,%s,%s,%s)") invono=int(input("Enter the invoice no:")) dosp=input("Enter the date of sale(yyyy-mm-dd)") custnm=input("Enter the Customer Name:") mob=input("enter the mobile no:") while True: no=givemeno() invoiceid=no gno=int(input("Enter the Cosmetic Product no")) rc1=prodsearchdata(gno) if rc1:
  • 21.
    qt=int(input("Enter the quantity:")) pr=int(input("Enterthe price")) netamt=pr*qt data=(invoiceid,gno,custnm,mob,qt,'SALE',invono,netamt,dosp) C.execute(Query,data) mydb.commit() print(C.rowcount, "record(s) affected") changeqty(gno,qt,'S') else: print("No such Cosmetic record please try again") ch=input("Do you want to add more Cosmetic to sell(y/n)") if(ch=='n' or ch=='N'): break C.close() mydb.close() except: mydb.close() #------Update the qty---- def changeqty(mno,qt,ch): try: mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem") C=mydb.cursor() if(ch=='S'): Query=("UPDATE cosmetic SET qty=qty-%s WHERE costid=%s") elif(ch=='A'): Query=("UPDATE cosmetic SET qty=qty+%s WHERE costid=%s") data=(qt,mno) C.execute(Query,data) mydb.commit() print(C.rowcount, "record(s) affected") C.close() mydb.close() except: mydb.close() #-------invoice to Purchase the Cosmetic def Gar_Purchase(): try: mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem") print(mydb) C=mydb.cursor() netamt=0 Query=("INSERT INTO costinvoice VALUES(%s,%s,%s,%s,%s,%s,%s,%s,%s)") invono=int(input("Enter the invoice no:")) dosp=input("Enter the date of sale") custnm=input("Enter the Distributer Name:") mob=input("enter the mobile no:")
  • 22.
    while True: no=givemeno() invoiceid=no gno=int(input("Enter theCosmetic Product no")) rc1=prodsearchdata(gno) if rc1: qt=int(input("Enter the quantity:")) pr=int(input("Enter the price")) netamt=pr*qt data=(invoiceid,gno,custnm,mob,qt,'PURCHASE',invono,netamt,dosp) C.execute(Query,data) mydb.commit() print(C.rowcount, "record(s) affected") changeqty(gno,qt,'A') else: print("No such Cosmetic record please try again") ch=input("Do you want to add more Cosmetic to sell(y/n)") if(ch=='n' or ch=='N'): break C.close() mydb.close() except: mydb.close() #-- to generate the autonumbers def givemeno(): count=0 mydb=pymysql.connect(host="localhost", user="root", passwd="", database="cosmeticsystem") print(mydb) mycursor=mydb.cursor() query=("SELECT COUNT(*) FROM costinvoice") q=("SELECT MAX(costid) FROM costinvoice") mycursor.execute(query) rc=mycursor.fetchone() tmp=rc[0] print(tmp) if tmp==0: count=1 else: q=("SELECT MAX(costid) FROM costinvoice") mycursor.execute(q) rc=mycursor.fetchone() count=rc[0] count=count+1 mycursor.close() mydb.close() return count
  • 23.
    File Name: cosmaticmainpage.py importcosmatic_menu as CM import sys import cosmatic as GM def invoice_show(): choice1=CM.cosmeticinvoicereports() while True: if choice1==1: GM.searchCOSinvoice() break elif choice1==2: GM.searchPURinvoice() break elif choice1==3: GM.displayinvoiceSP() break elif choice1==4: GM.displayinvoiceSPdate() break elif choice1==5: main() else: #print("Enter the correct choice") input("Enter any key to continue") choice1=0 invoice_show() def modifycosmeticshow(): choice1=" " choice1=CM.modifyCosmetic_menu() while True: if choice1==1: GM.search_mod_Prodnm() break elif choice1==2: #-------2.MODIFY PRICE GM.search_mod_price() break elif choice1==3: #-------3.MODIFY QUANTITY GM.search_mod_qty() break elif choice1==4: #-------4.MODIFY type GM.search_mod_type() break elif choice1==5: #-------5.MODIFY GM.search_mod_company() break elif choice1==6: GM.search_mod_desc() break elif choice1==7: main() else: #print("Enter the correct choice") input("Enter any key to continue") modifycosmeticshow() #-----------------COSMETIC MENU def Cosmeticmenu_show(): choice1=" " choice1=CM.Cosmetic_ADM_menu() while True: if choice1==1: cosmeticmidmenu() break elif choice1==2: salepurchase_show() break elif choice1==3: main() else: print("Enter the correct choice") input("Enter any key to continue") Groserymenu_show() #------------------------- def cosmetic_show(): choice1=CM.admin_menu1() while True: if choice1==1: GM.write_cosmeticrecord() break elif choice1==2: GM.showallCosmeticprod() break elif choice1==3: GM.showprodID() break elif choice1==4: GM.showprodnm()
  • 24.
    break elif choice1==5: GM.showbyProdprice() break elif choice1==6: GM.showProdtype() break elifchoice1==7: GM.showProdcompy() break elif choice1==8: main() break else: print("Enter the correct choice") input("Enter any key to continue") choice1=0 cosmetic_show() #--------administrator menu def cosmeticmidmenu(): choice1=CM.cosmetic_menu() while True: if choice1==1: cosmetic_show() break elif choice1==2: modifycosmeticshow() break elif choice1==3: GM.deletecosmetic() break elif choice1==4: print("a") break else: print("Enter the correct choice") input("Enter any key to continue") choice1=0 cosmeticmidmenu() def salepurchase_show(): choice1=CM.SALE_PURCHASEmenu() while True: if choice1==1: GM.Med_Sale() break elif choice1==2: GM.Gar_Purchase() break elif choice1==3: main() else: #print("Enter the correct choice") input("Enter any key to continue") choice1=0 salepurchase_show() #-------------Main MENU------------------------------ def main(): CM.intro() choice=0 while(True): choice=CM.main() if choice==1: CM.myclear() invoice_show() elif choice==2: CM.myclear() Cosmeticmenu_show() elif choice==3: exit(1) else: print("Enter the correct choice") input("Enter any key to continue") main()
  • 25.
    OUTPUTS =================MAIN MENU==================== 01. COSMETICREPORT GENERATOR 02. ADMINISTRATOR 03. EXIT ============================================== Please Select Your Option (1-3) If choice: 1 =================COSMETIC ADD MENU==================== 1.SEARCH AND PRINT SALE INVOICE 2.SEARCH AND PRINT PURCHASE INVOICE 3.DISPLAY ALL INVOICE(SALE/PURCHASE) 4.SEARCH INVOICE BY DATEOFINVOICE 5.BACK TO MAIN MENU If choice : 1 Enter the Invoice No:5600 ----------------INVOICE: 5600 ---------DATE: 2020-12-02 --NAME:-- Sam -----------MOBILE NO.: 885569632 --------------------------SALE------------------------------ S.NO.----|------------COSMETIC NAME-------------------TOTAL----- 1 |--- LipToGlow | 75 2 |--- M-Eye | 36 ============================================================ Total: 111 GST : 13.32 NETTOTAL: 124.32 ----------------------Press any key------------------------- If choice : 3 Please Enter Your Choice (1-5) 3 Enter the Choice 1- SALE Wise 2- PURCHASE Wise:1 ---------------------INVOICE LIST--------------------------- ------------------------------------------------------------ S.NO. COSTPROD-NAME QUANTITY AMOUNT DATE INVOICE NO 1 LipToGlow 5 75 2020-12-02 5600 2 M-Eye 3 36 2020-12-02 5600 ============================================================ If choice : 2 1.COSMETIC'S MENU 2.COSMETIC'S SALE/PURCHASE 3.BACK TO MAIN MENU Please Enter Your Choice (1-3) If choice : 1 ===========COSMETIC INFO MENU===========
  • 26.
    01. ADD COSMETICINFORMATION 02. MODIFY COSMETIC INFORMATION 03. DELETE COSMETIC INFORMATION 04. BACK TO MAIN ============================================== Please Select Your Option (1-4) If choice : 1 =================COSMETIC ADD MENU==================== 1.CREATE COSMETIC DETAILS 2.DISPLAY ALL CORMETIC DETAILS 3.SEARCH RECORD BY COSMETIC PRODUCT ID 4.SEARCH RECORD BY COSMETIC PRODUCT NAME 5.SEARCH RECORD BY PRICE 6.SEARCH RECORD BY TYPE 7.SEARCH RECORD BY COMPANY 8.BACK TO MAIN MENU Please Enter Your Choice (1-8) If choice: 1 Enter Cosmetic Product NameHairFLy Enter Price785 (Example:Compact/Eye shadow/Eye shadow/Lipstick/Moisturizer/Nail Polish/Face pack/etc.) Enter Product Type:Hair Dryer Enter Cosmetic Product Brand nameFACE Enter quantity10 Enter Product descriptionDryer If choice: 2 Please Enter Your Choice (1-8) 2 COSTID COSMETIC-NAME PRICE QUANTITY COST-TYPE BRAND DESCRIPTION 1200 Lipstic 50 20 Lipstick Lakme Red colour lipstick box 1201 LipToGlow 15 45 Lip Glow Lakme Light lip glow 1202 M-Eye 12 22 Eye Shadow Lakme Shadow 1203 HairFLy 785 10 Hair Dryer FACE Dryer If choice : Modify 2 ===============MODIFY MENU================== 1.MODIFY COSMETIC PRODUCT NAME 2.MODIFY PRICE 3.MODIFY QUANTITY 4.MODIFY TYPE 5.MODIFY COMPANY 6.MODIFY DESCRIPTION 7.BACK TO MAIN MENU Please Enter Your Choice (1-7)
  • 27.
    REQUIREMENTS HARDWARE REQUIRED  Printer,to print the required documents of the project  Processor : intel or any other  Ram : 512 MB or above  Harddisk : 80 GB or more  SOFTWARE REQUIRED  Operating system : Windows 7 or above  Python 2 or above  IDE Atom, PyCharm, Thonny, or any other.  Database: MySQL  WebServer: XAMPP ADVANTAGES AND DISADVANTAGES  Provide a Single environment from where an administrator can interact with the beauty shop system resources within the beauty center network.  Provides interface to interact with the beauty shop system  Paperwork is removed.  Customer records are records through this system Disadvantage:  The current system doesn’t allow the remote access of the cosmetic system resources of one system with other  This system need updating of product every time
  • 28.
    CONCLUSION In this projectwe put all the things that needed for the cosmetic shop, to manage all the work related to products sale and purchase and the customer’s information. But it need more updating as it can be perfect for small shops of cosmetic. BIBLIOGRAPHY  www.mysql.org  www.google.co.in  www.w3schools.com  www.tutorialspoint.com  www.javapoint.com  www.programiz.com  www.guru99.com