-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreporting.py
More file actions
39 lines (30 loc) · 950 Bytes
/
reporting.py
File metadata and controls
39 lines (30 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import mysql.connector as m
mycon=m.connect(host="localhost",user="root",passwd="0099",database="APARTMENTMANAGEMENT")
cur=mycon.cursor()
def TotalDues():
cur.execute("SELECT SUM(AMOUNT_PAID) FROM MAINTENANCE_FEE")
s1=cur.fetchone()
print("\nTOTAL DUES")
print("______________")
print("\n",s1[0])
def CollectedAmount():
cur.execute("SELECT SUM(AMOUNT_DUE) FROM MAINTENANCE_FEE")
s2=cur.fetchone()
print("\nTOTAL COLLECTED AMOUNT")
print("________________________________")
print("\n",s2[0])
def mainreporting():
while True:
print("\n1.TO VIEW TOTAL DUES")
print("2.TO VIEW TOTAL COLLECTED AMOUNT")
print("3.EXIT")
ch=int(input("\nENTER YOUR CHOICE:"))
if ch==1:
TotalDues()
elif ch==2:
CollectedAmount()
elif ch==3:
mycon.close()
break
else:
print("INVALID CHOICE")