-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
77 lines (66 loc) · 2.51 KB
/
app.py
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
from utils import *
def main():
while (True):
print_menu()
choice = is_integer(input("Enter Command Number: "))
print("\n")
if choice == 1:
try:
add_new_product()
except KeyError:
print("\nCode is not unique.")
elif choice == 2:
try:
add_new_supermarket()
except KeyError:
print("\nCode is not unique.")
elif choice == 3:
search_by_date()
elif choice == 4:
clear_product()
elif choice == 5:
print_menu_5()
c = is_integer(input("Enter Command Number: "))
if c == 1:
distribute_form_file()
elif c == 2:
warehouse_to_supermarkets()
else:
print("\nEnter a Valid Input From Menu")
elif choice == 6:
report()
elif choice == 7:
write_warehouse_file()
write_supermarket_file()
write_distribution_supermarkets()
return
else:
print("\nEnter a Valid Input From Menu")
def print_menu():
print("""\n
_________________________________________________________________
| |
| Menu |
|_______________________________________________________________|
| |
| 1- Add new product item to the ware house. |
| 2- Add new supermarket to the management system. |
| 3- List of items in the warehouse based on expiry date. |
| 4- Clear an item from the warehouse. |
| 5- Distribute products from the warehouse to a supermarket. |
| 6- Generate a report about the sales status of the warehouse. |
| 7- Exit |
|_______________________________________________________________|
""")
def print_menu_5():
print("""\n
________________________________________________________________
| 1- Distribute Form File. |
| 2- Distribute Manually. |
|_______________________________________________________________|
""")
if __name__ == '__main__':
read_warehouse_file()
read_supermarket_file()
read_distribution_supermarkets()
main()