2021-01-31 11:59:37 +01:00
|
|
|
import math
|
2021-02-03 10:46:22 +01:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import time
|
2021-02-04 20:41:12 +01:00
|
|
|
import random
|
2021-01-31 11:59:37 +01:00
|
|
|
|
2021-01-31 15:18:27 +01:00
|
|
|
#----------------CLASS---KEY------------------------------------------
|
2021-01-31 11:59:37 +01:00
|
|
|
|
2021-01-31 12:59:55 +01:00
|
|
|
class Key:
|
2021-01-31 11:59:37 +01:00
|
|
|
how_many_keys = 0
|
|
|
|
|
2021-01-31 15:18:27 +01:00
|
|
|
# Initialisation of keys
|
2021-01-31 11:59:37 +01:00
|
|
|
def __init__(self, keynumber):
|
|
|
|
self.number = keynumber
|
2021-02-04 20:41:12 +01:00
|
|
|
self.possessor = "Rezeption"
|
2021-01-31 11:59:37 +01:00
|
|
|
|
|
|
|
#where are the keys
|
|
|
|
def status_key(self, keynumber=None):
|
2021-02-04 20:41:12 +01:00
|
|
|
print("Schlüssel", self.number, "im Besitz", self.possessor)
|
2021-01-31 11:59:37 +01:00
|
|
|
|
|
|
|
def hand_out_key(self, keynumber, Guest):
|
|
|
|
self.possessor = Guest
|
|
|
|
|
|
|
|
def get_back_key(self, keynumber):
|
2021-02-04 20:41:12 +01:00
|
|
|
self.possessor = "Rezeption"
|
2021-01-31 11:59:37 +01:00
|
|
|
|
2021-01-31 15:18:27 +01:00
|
|
|
# Generates all the keys, two for each room
|
|
|
|
# results in keynumbers: 11, 12, 21, 22, 31, 32, 41, 42
|
2021-01-31 11:59:37 +01:00
|
|
|
key_list = []
|
|
|
|
for i in range(11, 42, 10):
|
2021-01-31 12:59:55 +01:00
|
|
|
a = "key_" + str(i) + " = Key(" + str(i) + ")"
|
2021-01-31 11:59:37 +01:00
|
|
|
exec(a)
|
|
|
|
a2 = "key_list.append(key_" + str(i) + ")"
|
|
|
|
exec(a2)
|
|
|
|
|
2021-01-31 12:59:55 +01:00
|
|
|
b = "key_" + str(i+1) + " = Key(" + str(i+1) + ")"
|
2021-01-31 11:59:37 +01:00
|
|
|
exec(b)
|
|
|
|
b2 = "key_list.append(key_" + str(i+1) + ")"
|
|
|
|
exec(b2)
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-31 15:18:27 +01:00
|
|
|
#----------------CLASS---CLIENT------------------------------------------
|
2021-02-04 20:41:12 +01:00
|
|
|
checked_in_list = []
|
|
|
|
client_list = []
|
|
|
|
all_clients = []
|
2021-01-31 11:59:37 +01:00
|
|
|
|
|
|
|
class Client():
|
|
|
|
months = ['Januar', 'Februar','März','April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember']
|
2021-02-04 20:41:12 +01:00
|
|
|
|
2021-01-31 11:59:37 +01:00
|
|
|
clients = 0
|
2021-02-04 20:41:12 +01:00
|
|
|
def __init__(self, name: str, surname: str, client_num: str, room: str, period, key_num: int, bookings, status: bool,\
|
|
|
|
checked_in: bool):
|
2021-01-31 11:59:37 +01:00
|
|
|
self.name = name
|
|
|
|
self.surname = surname
|
|
|
|
self.client_num = client_num
|
2021-02-02 10:29:40 +01:00
|
|
|
self.room = None
|
2021-01-31 11:59:37 +01:00
|
|
|
self.period = period
|
2021-02-02 10:29:40 +01:00
|
|
|
self.key_num = 0
|
2021-02-02 12:11:47 +01:00
|
|
|
self.bookings = []
|
2021-02-02 10:29:40 +01:00
|
|
|
self.status = False
|
2021-02-04 20:41:12 +01:00
|
|
|
self.checked_in = checked_in
|
2021-01-31 11:59:37 +01:00
|
|
|
|
|
|
|
# Automatic status adjustment
|
|
|
|
if len(self.bookings) >= 4:
|
|
|
|
self.status = True
|
|
|
|
Client.clients += 1
|
2021-02-02 10:29:40 +01:00
|
|
|
|
2021-02-04 20:41:12 +01:00
|
|
|
def check_in(self, room, key_num, period):
|
2021-02-03 19:33:46 +01:00
|
|
|
print("Check In")
|
2021-02-04 20:41:12 +01:00
|
|
|
self.checked_in = True
|
2021-02-03 19:33:46 +01:00
|
|
|
self.period = str(period)
|
2021-02-03 17:08:52 +01:00
|
|
|
room_list[reference.index(str(room))].occupy(self.surname, self.period)
|
|
|
|
self.room = str(room)
|
2021-02-02 12:11:47 +01:00
|
|
|
num_ = "key_" + str(key_num) + ".hand_out_key(" + str(key_num) + "," + "'" + str(self.surname) + "')"
|
2021-02-02 10:29:40 +01:00
|
|
|
try:
|
|
|
|
exec(num_)
|
|
|
|
self.key_num = key_num
|
2021-02-04 20:41:12 +01:00
|
|
|
checked_in_list.append(self.client_num)
|
|
|
|
client_list.remove(str(self.client_num))
|
|
|
|
if self.status == True:
|
|
|
|
print("Der Kunde besitzt VIP Previlegien. Er erhält kostenloses \
|
|
|
|
Frühstück sowie die kostenlose Benutzung der Mini-Bar.")
|
2021-02-02 10:29:40 +01:00
|
|
|
except:
|
2021-02-02 12:11:47 +01:00
|
|
|
("Schlüssel mit Daten nicht gefunden.")
|
|
|
|
new_bill = add_bill(self.name, self.surname, self.client_num, room, self.period)
|
|
|
|
return new_bill
|
2021-02-03 16:17:45 +01:00
|
|
|
|
|
|
|
def check_out(self):
|
|
|
|
room_list[reference.index(self.room)].free()
|
|
|
|
key_num = self.key_num
|
|
|
|
num_ = "key_" + str(key_num) + ".get_back_key(" + str(key_num)+ ")"
|
2021-02-04 20:41:12 +01:00
|
|
|
|
2021-02-03 16:17:45 +01:00
|
|
|
try:
|
|
|
|
exec(num_)
|
|
|
|
print("Der Gast ist erfolgreich ausgecheckt worden.")
|
2021-02-04 20:41:12 +01:00
|
|
|
self.checked_in = False
|
|
|
|
self.room = None
|
|
|
|
self.period = None
|
|
|
|
self.key_num = None
|
|
|
|
checked_in_list.remove(self.client_num)
|
|
|
|
client_list.append(self.client_num)
|
2021-02-03 16:17:45 +01:00
|
|
|
except:
|
|
|
|
("Schlüssel mit Daten nicht gefunden.")
|
|
|
|
|
|
|
|
|
2021-02-02 12:11:47 +01:00
|
|
|
|
|
|
|
def client_bill(self, bill_num):
|
|
|
|
self.bookings.append(str(bill_num))
|
2021-02-02 10:29:40 +01:00
|
|
|
|
2021-02-03 16:17:45 +01:00
|
|
|
def client_bill_delete(self, bill_num):
|
|
|
|
if bill_num in self.bookings:
|
|
|
|
self.bookings.remove(bill_num)
|
|
|
|
print("Rechnung wurde beim Gast", self.client_num, "gelöscht.")
|
|
|
|
|
2021-02-04 20:41:12 +01:00
|
|
|
def vip_status(self):
|
|
|
|
if len(self.bookings) > 3:
|
|
|
|
self.status = True
|
2021-01-31 11:59:37 +01:00
|
|
|
# Length of stay as print
|
|
|
|
def period_print(self):
|
|
|
|
stay_period = []
|
2021-01-31 14:08:29 +01:00
|
|
|
num_string = ""
|
2021-01-31 11:59:37 +01:00
|
|
|
for i in self.period:
|
2021-01-31 14:08:29 +01:00
|
|
|
if i.isnumeric():
|
|
|
|
num_string += i
|
|
|
|
if i == ",":
|
|
|
|
stay_period.append(num_string)
|
|
|
|
num_string = ""
|
|
|
|
|
|
|
|
stay_period.append(num_string)
|
2021-01-31 11:59:37 +01:00
|
|
|
|
|
|
|
stay_period = tuple(stay_period)
|
|
|
|
# Same month
|
|
|
|
if stay_period[1] == stay_period[3]:
|
|
|
|
days = int(stay_period[0]) - int(stay_period[2])
|
2021-02-03 10:46:22 +01:00
|
|
|
month_num = int(stay_period[1]) - 1
|
2021-01-31 11:59:37 +01:00
|
|
|
month_print = Client.months[month_num]
|
|
|
|
print("Der Kunde bleibt", abs(days), "Tage.")
|
|
|
|
print("Vom", stay_period[0], "bis", stay_period[2], month_print)
|
|
|
|
# Across months
|
|
|
|
if stay_period[1] != stay_period[3]:
|
2021-01-31 14:08:29 +01:00
|
|
|
# Stay period more than 1 month
|
|
|
|
if int(stay_period[3]) - int(stay_period[1]) > 1:
|
|
|
|
days = 28 - int(stay_period[0]) + int(stay_period[2]) + \
|
|
|
|
((int(stay_period[3]) - int(stay_period[1])-1) * 28)
|
|
|
|
# Stay period
|
|
|
|
else:
|
|
|
|
days = 28 - int(stay_period[0]) + int(stay_period[2])
|
|
|
|
|
2021-01-31 11:59:37 +01:00
|
|
|
month_num_1 = int(stay_period[1]) - 1
|
|
|
|
month_num_2 = int(stay_period[3]) - 1
|
|
|
|
month_print_1 = Client.months[month_num_1]
|
|
|
|
month_print_2 = Client.months[month_num_2]
|
|
|
|
print("Der Kunde bleibt", abs(days), "Tage.")
|
|
|
|
print("Vom", stay_period[0], month_print_1, "bis", stay_period[2], month_print_2)
|
|
|
|
|
|
|
|
|
|
|
|
# Client information
|
|
|
|
def info(self, action = None):
|
|
|
|
dic_ = {"Name" : self.name,
|
|
|
|
"Nachname" : self.surname,
|
|
|
|
"Kundennummer" : self.client_num,
|
2021-02-02 10:12:23 +01:00
|
|
|
"Zimmer" : self.room,
|
2021-01-31 11:59:37 +01:00
|
|
|
"Aufenthaltsdauer": self.period,
|
|
|
|
"Schlüsselnummer" : self.key_num,
|
|
|
|
"Buchungen" : self.bookings,
|
2021-02-04 20:41:12 +01:00
|
|
|
"VIP-Status" : self.status,
|
|
|
|
"Eingecheckt" : self.checked_in
|
2021-01-31 11:59:37 +01:00
|
|
|
}
|
|
|
|
if action != None:
|
|
|
|
# If asked client information is stay period
|
|
|
|
if action == "Aufenthaltsdauer":
|
|
|
|
client_num = self.client_num
|
|
|
|
stay = str(client_num)+ ".period_print()"
|
|
|
|
exec(stay)
|
|
|
|
# If asked client information is different
|
|
|
|
if action != "Aufenthaltsdauer":
|
|
|
|
for i in dic_:
|
|
|
|
if i == action:
|
|
|
|
print(action, "ist", dic_[i])
|
|
|
|
else:
|
|
|
|
for i in dic_:
|
|
|
|
print(i.ljust(16), ": ", dic_[i])
|
2021-02-03 16:17:45 +01:00
|
|
|
|
2021-01-31 11:59:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-03 10:46:22 +01:00
|
|
|
#w43 = Client("David", "Gebert", "w43", "Suite", "01,02,03,03", 22, (51,61,77), False)
|
|
|
|
#w43.period_print()
|
2021-01-31 15:18:27 +01:00
|
|
|
|
2021-02-02 12:11:47 +01:00
|
|
|
|
2021-01-31 15:18:27 +01:00
|
|
|
#----------------CLASS--ROOM------------------------------------------
|
|
|
|
|
|
|
|
''' Implementierung der Klasse Zimmer '''
|
|
|
|
|
|
|
|
class Room:
|
|
|
|
|
2021-02-02 10:12:23 +01:00
|
|
|
def __init__(self, room_number, guest=None, period=None):
|
2021-01-31 15:18:27 +01:00
|
|
|
self.number = room_number
|
|
|
|
self.occupied = False
|
|
|
|
self.resident = None
|
|
|
|
self.period = None
|
|
|
|
|
|
|
|
# Room gets occupied by a client
|
|
|
|
def occupy(self, guest, period):
|
|
|
|
self.occupied = True
|
|
|
|
self.resident = guest
|
|
|
|
self.period = period
|
|
|
|
|
|
|
|
# Room is no longer occupied
|
|
|
|
def free(self):
|
|
|
|
self.occupied = False
|
|
|
|
self.resident = None
|
|
|
|
self.period = None
|
|
|
|
|
2021-02-04 20:41:12 +01:00
|
|
|
def is_free(self, client_num, room_name, period):
|
2021-02-03 19:33:46 +01:00
|
|
|
|
|
|
|
occupied = self.period
|
|
|
|
if occupied == None:
|
|
|
|
room_types = [["Single", 10], ["Double", 20], ["Suite", 30], ["Panorama_Suite", 40]]
|
|
|
|
for i in room_types:
|
|
|
|
if i[0] == room_name:
|
|
|
|
key_num = i[1]+1
|
2021-02-04 20:41:12 +01:00
|
|
|
#print("Der Kunde erhält den Schlüssel", key_num)
|
2021-02-03 19:33:46 +01:00
|
|
|
|
2021-02-04 20:41:12 +01:00
|
|
|
check = "exec(" + str(client_num) + ".check_in(" + "'" + str(room_name) + "'" + "," + str(key_num)\
|
|
|
|
+ "," + "'" + str(period) + "'" +"))"
|
2021-02-03 19:33:46 +01:00
|
|
|
print(check)
|
|
|
|
exec(check)
|
|
|
|
|
2021-02-04 20:41:12 +01:00
|
|
|
else:
|
|
|
|
stay_period = []
|
|
|
|
num_string = ""
|
|
|
|
for i in self.period:
|
|
|
|
if i.isnumeric():
|
|
|
|
num_string += i
|
|
|
|
if i == ",":
|
|
|
|
stay_period.append(num_string)
|
|
|
|
num_string = ""
|
|
|
|
|
|
|
|
stay_period.append(num_string)
|
|
|
|
|
|
|
|
stay_period_new = []
|
|
|
|
num_string = ""
|
|
|
|
for i in period:
|
|
|
|
if i.isnumeric():
|
|
|
|
num_string += i
|
|
|
|
if i == ",":
|
|
|
|
stay_period_new.append(num_string)
|
|
|
|
num_string = ""
|
|
|
|
|
|
|
|
stay_period_new.append(num_string)
|
|
|
|
#print(stay_period, stay_period_new)
|
|
|
|
|
|
|
|
if int(stay_period[3]) < int(stay_period_new[1]):
|
|
|
|
room_types = [["Single", 10], ["Double", 20], ["Suite", 30], ["Panorama_Suite", 40]]
|
|
|
|
for i in room_types:
|
|
|
|
if i[0] == room_name:
|
|
|
|
key_num = i[1]+1
|
|
|
|
#print("Der Kunde erhält den Schlüssel", key_num)
|
|
|
|
|
|
|
|
check = "exec(" + str(client_num) + ".check_in(" + "'" + str(room_name) + "'" + "," + str(key_num)\
|
|
|
|
+ "," + "'" + str(period) + "'" +"))"
|
|
|
|
print(check)
|
|
|
|
exec(check)
|
|
|
|
|
|
|
|
|
|
|
|
if int(stay_period[3]) > int(stay_period_new[1]):
|
|
|
|
print("Das Zimmer", room_name, " ist in dem gewünschten Zeitraum belegt.")
|
|
|
|
|
|
|
|
if int(stay_period[3]) == int(stay_period_new[1]):
|
|
|
|
if int(stay_period[0]) > int(stay_period_new[2]):
|
|
|
|
print("Das Zimmer", room_name, " ist in dem gewünschten Zeitraum belegt.")
|
|
|
|
|
|
|
|
if int(stay_period[0]) <= int(stay_period_new[2]):
|
|
|
|
room_types = [["Single", 10], ["Double", 20], ["Suite", 30], ["Panorama_Suite", 40]]
|
|
|
|
for i in room_types:
|
|
|
|
if i[0] == room_name:
|
|
|
|
key_num = i[1]+1
|
|
|
|
#print("Der Kunde erhält den Schlüssel", key_num)
|
|
|
|
|
|
|
|
check = "exec(" + str(client_num) + ".check_in(" + "'" + str(room_name) + "'" + "," + str(key_num)\
|
|
|
|
+ "," + "'" + str(period) + "'" +"))"
|
|
|
|
print(check)
|
|
|
|
exec(check)
|
2021-02-03 19:33:46 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def is_occupied(self, room_name, period):
|
|
|
|
if self.period == None:
|
|
|
|
print("Das Zimmer", str(room_name)," ist frei.")
|
|
|
|
if self.period != None:
|
|
|
|
stay_period = []
|
|
|
|
num_string = ""
|
|
|
|
for i in self.period:
|
|
|
|
if i.isnumeric():
|
|
|
|
num_string += i
|
|
|
|
if i == ",":
|
|
|
|
stay_period.append(num_string)
|
|
|
|
num_string = ""
|
|
|
|
|
|
|
|
stay_period.append(num_string)
|
|
|
|
|
|
|
|
stay_period_new = []
|
|
|
|
num_string = ""
|
|
|
|
for i in period:
|
|
|
|
if i.isnumeric():
|
|
|
|
num_string += i
|
|
|
|
if i == ",":
|
|
|
|
stay_period_new.append(num_string)
|
|
|
|
num_string = ""
|
|
|
|
|
|
|
|
stay_period_new.append(num_string)
|
|
|
|
#print(stay_period, stay_period_new)
|
|
|
|
|
2021-02-04 20:41:12 +01:00
|
|
|
if int(stay_period[3]) < int(stay_period_new[1]):
|
|
|
|
print(stay_period[3], stay_period_new[1])
|
2021-02-03 19:33:46 +01:00
|
|
|
print("Das Zimmer", room_name, "ist in dem gewünschten Zeitraum frei.")
|
2021-02-04 20:41:12 +01:00
|
|
|
|
|
|
|
if int(stay_period[3]) > int(stay_period_new[1]):
|
2021-02-03 19:33:46 +01:00
|
|
|
print("Das Zimmer", room_name, " ist in dem gewünschten Zeitraum belegt.")
|
2021-02-04 20:41:12 +01:00
|
|
|
|
|
|
|
if int(stay_period[3]) == int(stay_period_new[1]):
|
|
|
|
if int(stay_period[2]) > int(stay_period_new[0]):
|
2021-02-03 19:33:46 +01:00
|
|
|
print("Das Zimmer", room_name, " ist in dem gewünschten Zeitraum belegt.")
|
2021-02-04 20:41:12 +01:00
|
|
|
#print(stay_period[2], stay_period_new[0])
|
|
|
|
if int(stay_period[2]) <= int(stay_period_new[0]):
|
|
|
|
print("Das Zimmer", room_name, "ist in dem gewünschten Zeitraum frei.")
|
|
|
|
#print(stay_period[2], stay_period_new[0])
|
2021-02-03 19:33:46 +01:00
|
|
|
|
2021-02-02 10:12:23 +01:00
|
|
|
# room information
|
|
|
|
def info(self, action = None):
|
|
|
|
dic_ = {"Nummer" : self.number,
|
|
|
|
"Gast" : self.resident,
|
|
|
|
}
|
|
|
|
|
|
|
|
if action != None:
|
|
|
|
if action == "Nummer":
|
2021-02-04 20:41:12 +01:00
|
|
|
print("Das Zimmer hat die Nummer", dic_["Nummer"])
|
2021-02-02 10:12:23 +01:00
|
|
|
|
|
|
|
if action == "Gast":
|
|
|
|
if dic_["Gast"] != None:
|
2021-02-04 20:41:12 +01:00
|
|
|
print("Das Zimmer", str(self.number), "ist gerade vom Gast", dic_["Gast"], "belegt")
|
2021-02-02 10:12:23 +01:00
|
|
|
else:
|
2021-02-04 20:41:12 +01:00
|
|
|
print("Das Zimmer", str(self.number), "ist im Moment nicht belegt.")
|
2021-02-02 10:12:23 +01:00
|
|
|
|
|
|
|
else:
|
|
|
|
for i in dic_:
|
2021-02-03 16:17:45 +01:00
|
|
|
print(i.ljust(16), ": ", dic_[i])
|
|
|
|
|
2021-02-02 10:12:23 +01:00
|
|
|
|
|
|
|
# Generates all the rooms
|
2021-02-02 12:11:47 +01:00
|
|
|
# nr.10-"Single", nr.20-"Double", nr.30-"Suite", nr.40-"Panorama_Suite"
|
|
|
|
reference = ["Single", "Double", "Suite", "Panorama_Suite"]
|
|
|
|
room_types = [["Single", 10], ["Double", 20], ["Suite", 30], ["Panorama_Suite", 40]]
|
2021-02-02 10:12:23 +01:00
|
|
|
room_list = []
|
|
|
|
for i in room_types:
|
2021-02-02 12:11:47 +01:00
|
|
|
tmp = i[0] + " = Room(" + str(i[1]) + ")"
|
|
|
|
exec(tmp)
|
|
|
|
tmp = "room_list.append(" + str(i[0]) + ")"
|
2021-02-02 10:12:23 +01:00
|
|
|
exec(tmp)
|
2021-02-03 10:46:22 +01:00
|
|
|
|
2021-02-02 12:11:47 +01:00
|
|
|
|
|
|
|
#----------------CLASS--ACCOUNTING----------------------------
|
|
|
|
|
|
|
|
class Accounting():
|
|
|
|
all_bills = []
|
|
|
|
counter = 0
|
|
|
|
def __init__(self, name:str, surname:str, client_num:str, room:str, period:str, bill_num:str, bill_status:bool):
|
|
|
|
print("Wird Ausgeführt")
|
|
|
|
self.name = name
|
|
|
|
self.surname = surname
|
|
|
|
self.client_num = client_num
|
|
|
|
self.period = period
|
|
|
|
self.bill_num = bill_num
|
|
|
|
self.bill_status = bill_status
|
|
|
|
Accounting.counter += 1
|
|
|
|
|
|
|
|
room_types = [["Single", 10], ["Double", 20], ["Suite", 30], ["Panorama_Suite", 40]]
|
|
|
|
for i in room_types:
|
|
|
|
if i[0] == room:
|
|
|
|
self.room = i[1]
|
|
|
|
|
|
|
|
var = str(client_num) + ".client_bill(" + "'" + bill_num + "'" + ")"
|
|
|
|
print(var)
|
|
|
|
exec(var)
|
|
|
|
|
|
|
|
def show_bill(self):
|
|
|
|
|
|
|
|
stay_period = []
|
|
|
|
num_string = ""
|
|
|
|
for i in self.period:
|
|
|
|
if i.isnumeric():
|
|
|
|
num_string += i
|
|
|
|
if i == ",":
|
|
|
|
stay_period.append(num_string)
|
|
|
|
num_string = ""
|
|
|
|
|
|
|
|
stay_period.append(num_string)
|
|
|
|
|
|
|
|
stay_period = tuple(stay_period)
|
|
|
|
# Same month
|
|
|
|
|
|
|
|
if stay_period[1] == stay_period[3]:
|
|
|
|
days = int(stay_period[0]) - int(stay_period[2])
|
|
|
|
|
|
|
|
# Across months
|
|
|
|
if stay_period[1] != stay_period[3]:
|
|
|
|
# Stay period more than 1 month
|
|
|
|
if int(stay_period[3]) - int(stay_period[1]) > 1:
|
|
|
|
days = 28 - int(stay_period[0]) + int(stay_period[2]) + \
|
|
|
|
((int(stay_period[3]) - int(stay_period[1])-1) * 28)
|
|
|
|
# Stay period
|
|
|
|
else:
|
|
|
|
days = 28 - int(stay_period[0]) + int(stay_period[2])
|
2021-02-03 10:46:22 +01:00
|
|
|
days = abs(days)
|
2021-02-02 12:11:47 +01:00
|
|
|
costs = int(days) * int(self.room)
|
|
|
|
|
|
|
|
"""_______________________________________________________________________"""
|
|
|
|
lines = [[] for i in range(13)]
|
|
|
|
lines[0].append( '┌─────────────────────────────┐')
|
|
|
|
lines[1].append( '│ Rechnung │')
|
|
|
|
lines[2].append( '│ │')
|
|
|
|
lines[3].append( '│Kunde: {} {} '.format(self.name, self.surname))
|
|
|
|
lines[4].append( '│Zimmer: {} '.format(self.room))
|
|
|
|
lines[5].append( '│Anz. Tage:{} '.format(days))
|
|
|
|
lines[6].append( '│pro Nacht:{}€ '.format(self.room))
|
|
|
|
lines[7].append( '│Kosten: {}€ '.format(costs))
|
|
|
|
lines[8].append( '│ ')
|
|
|
|
lines[9].append( '│Rech. Nr.:{} '.format(self.bill_num,))
|
|
|
|
lines[10].append('│Beglichen:{} '.format(self.bill_status))
|
|
|
|
lines[11].append('│ │')
|
|
|
|
lines[12].append('└─────────────────────────────┘')
|
|
|
|
|
|
|
|
for i in lines:
|
|
|
|
print(i[0])
|
|
|
|
|
|
|
|
|
|
|
|
def pay_bill(self):
|
|
|
|
self.bill_status = True
|
|
|
|
print("Rechnung", self.bill_num, "wurde bezahlt.")
|
|
|
|
|
2021-02-03 16:17:45 +01:00
|
|
|
def delete_bill(self, bill_num):
|
2021-02-04 20:41:12 +01:00
|
|
|
for i in all_clients:
|
2021-02-03 16:17:45 +01:00
|
|
|
var = str(i) + ".client_bill_delete(" + "'" + bill_num + "'" + ")"
|
|
|
|
exec(var)
|
2021-02-04 20:41:12 +01:00
|
|
|
var_ = str(i) + ".check_out()"
|
|
|
|
exec(var_)
|
2021-02-03 16:17:45 +01:00
|
|
|
|
|
|
|
|
2021-02-02 12:11:47 +01:00
|
|
|
def __del__(self):
|
|
|
|
print("Rechnung wurde storniert.")
|
|
|
|
|
|
|
|
|
|
|
|
#r43 = Accounting("Karl", "Otto", 16, 21,"2,3,4,5", "", False)
|
|
|
|
|
|
|
|
#-------------YOU---ARE--LEAVING--CLASS--ACCOUNTING----------------------------
|
2021-02-03 10:46:22 +01:00
|
|
|
#-------------ADDITIONAL--ACCOUNTING--METHODS--------------------------
|
|
|
|
bill_list = []
|
2021-02-02 12:11:47 +01:00
|
|
|
|
|
|
|
|
|
|
|
def add_bill(name, surname, client_num, room, period):
|
|
|
|
bill_numb = "r" + str(Accounting.counter)
|
|
|
|
|
|
|
|
c = bill_numb + " = Accounting(" + '"' + str(name) + '"' + "," + '"' + \
|
|
|
|
str(surname) + '"' + "," + '"' + str(client_num) + '"' + "," + '"' + str(room) + '"' + "," + '"' + str(period) + \
|
|
|
|
'"' + "," + '"'+ str(bill_numb) + '"' + ", False)"
|
|
|
|
bill_list.append(bill_numb)
|
|
|
|
return c
|
|
|
|
|
2021-02-03 10:46:22 +01:00
|
|
|
|
2021-02-02 12:11:47 +01:00
|
|
|
def show_single_bill():
|
2021-02-03 10:46:22 +01:00
|
|
|
print("Volgenden Rechnungsnummern stehen zur Auswahl:")
|
|
|
|
print(bill_list)
|
2021-02-02 12:11:47 +01:00
|
|
|
while True:
|
|
|
|
k = input("Rechnungsnummer? ")
|
2021-02-03 16:17:45 +01:00
|
|
|
if k in bill_list or k == "abbrechen":
|
2021-02-02 12:11:47 +01:00
|
|
|
break
|
2021-02-03 16:17:45 +01:00
|
|
|
if k != "abbrechen":
|
|
|
|
try:
|
|
|
|
c = str(k) + ".show_bill()"
|
|
|
|
exec(c)
|
|
|
|
except:
|
|
|
|
print("Rechnung wurde nicht gefunden.")
|
2021-02-02 12:11:47 +01:00
|
|
|
|
2021-02-03 10:46:22 +01:00
|
|
|
def pay_your_bill():
|
|
|
|
print("Folgenden Rechnungsnummern stehen zur Auswahl:")
|
|
|
|
print(bill_list)
|
|
|
|
print("Rechungsnummer? ")
|
|
|
|
while True:
|
|
|
|
bill =input().strip().lower()
|
2021-02-03 16:17:45 +01:00
|
|
|
if bill in bill_list or bill == "abbrechen":
|
2021-02-03 10:46:22 +01:00
|
|
|
break
|
2021-02-03 16:17:45 +01:00
|
|
|
if bill != "abbrechen":
|
|
|
|
try:
|
|
|
|
c = str(bill) + ".pay_bill()"
|
|
|
|
exec(c)
|
|
|
|
except:
|
|
|
|
print("Rechung wurde nicht gefunden.")
|
2021-02-02 12:11:47 +01:00
|
|
|
|
2021-02-03 16:17:45 +01:00
|
|
|
def delete_bill(bill_numb):
|
|
|
|
k = str(bill_numb) + ".delete_bill(bill_numb)"
|
|
|
|
exec(k)
|
2021-02-04 20:41:12 +01:00
|
|
|
|
2021-02-03 16:17:45 +01:00
|
|
|
|
2021-02-03 10:46:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#-------------ADDITIONAL---CLIENT---METHODS-------------------------
|
|
|
|
|
2021-02-04 20:41:12 +01:00
|
|
|
|
2021-02-03 10:46:22 +01:00
|
|
|
|
|
|
|
def clear():
|
|
|
|
if os.name == "posix":
|
|
|
|
os.system("clear")
|
|
|
|
elif os.name in ("nt", "dos", "ce"):
|
|
|
|
os.system('cls')
|
|
|
|
else:
|
|
|
|
print(80 * "\n")
|
|
|
|
|
|
|
|
|
|
|
|
def add_client():
|
2021-02-03 17:08:52 +01:00
|
|
|
while True:
|
|
|
|
name = input("Name : ")
|
|
|
|
if name.isalpha():
|
|
|
|
break
|
|
|
|
while True:
|
|
|
|
surname = input("Nachname :")
|
|
|
|
if surname.isalpha():
|
|
|
|
break
|
|
|
|
|
2021-02-03 19:33:46 +01:00
|
|
|
period = None
|
2021-02-03 10:46:22 +01:00
|
|
|
client_num = "c" + str(Client.clients)
|
|
|
|
room_num = None
|
|
|
|
key_num = None
|
|
|
|
c = str(client_num) + " = Client(" + '"' + str(name) + '"' + "," + '"' + \
|
|
|
|
str(surname) + '"' + "," + '"' + str(client_num) + '"' + "," + '"' + str(room_num) \
|
2021-02-04 20:41:12 +01:00
|
|
|
+ '"' + "," + '"' + str(period) + '"' + "," + '"'+ str(key_num) + '"' + ",[], False, False)"
|
|
|
|
#print(c)
|
2021-02-03 10:46:22 +01:00
|
|
|
client_list.append(client_num)
|
2021-02-04 20:41:12 +01:00
|
|
|
all_clients.append(client_num)
|
2021-02-03 10:46:22 +01:00
|
|
|
return c
|
|
|
|
|
|
|
|
|
|
|
|
k = add_client()
|
2021-02-02 12:11:47 +01:00
|
|
|
exec(k)
|
2021-02-03 10:46:22 +01:00
|
|
|
|
2021-02-04 20:41:12 +01:00
|
|
|
j = c0.check_in("Suite",31, "2,3,4,5")
|
2021-02-03 10:46:22 +01:00
|
|
|
exec(j)
|
2021-02-03 16:17:45 +01:00
|
|
|
#print(c0.info())
|
2021-02-03 10:46:22 +01:00
|
|
|
clear()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dir_path = os.path.dirname(os.path.realpath(__file__))
|
|
|
|
|
|
|
|
|
|
|
|
imported = True
|
|
|
|
try:
|
|
|
|
import simpleaudio
|
|
|
|
except ModuleNotFoundError:
|
|
|
|
imported = False
|
|
|
|
|
|
|
|
|
|
|
|
def play_sound():
|
|
|
|
if imported:
|
|
|
|
wave_obj = simpleaudio.WaveObject.from_wave_file\
|
|
|
|
(os.path.join(dir_path, "grandhotel.wav"))
|
|
|
|
play_obj = wave_obj.play()
|
|
|
|
return play_obj
|
|
|
|
return None
|
|
|
|
|
|
|
|
def stop_sound(play_obj):
|
|
|
|
if play_obj is not None:
|
|
|
|
play_obj.stop()
|
|
|
|
|
|
|
|
|
|
|
|
def ascii_print():
|
|
|
|
with open('ascii_print_hotel', 'r', encoding='utf8') as ascii_:
|
|
|
|
for line in ascii_:
|
|
|
|
sys.stdout.write(line)
|
|
|
|
time.sleep(0.1)
|
2021-02-03 16:17:45 +01:00
|
|
|
|
|
|
|
|
2021-02-04 20:41:12 +01:00
|
|
|
system_list = ["1", "2", "3", "4", "5"]
|
|
|
|
"""-------------START-----INTERFACE--------------------"""
|
2021-02-03 10:46:22 +01:00
|
|
|
input("Start?")
|
|
|
|
clear()
|
2021-02-03 16:17:45 +01:00
|
|
|
#Intro
|
2021-02-03 10:46:22 +01:00
|
|
|
play_obj = play_sound()
|
|
|
|
|
2021-02-03 16:17:45 +01:00
|
|
|
#Logo Print
|
|
|
|
ascii_print()
|
2021-02-03 10:46:22 +01:00
|
|
|
|
2021-02-03 16:17:45 +01:00
|
|
|
|
2021-02-04 20:41:12 +01:00
|
|
|
print("\t\tWELCOME TO THE GRAND BUDAPEST HOTEL SYSTEM")
|
|
|
|
input("\t\t\tPress enter to continue")
|
2021-02-03 10:46:22 +01:00
|
|
|
clear()
|
|
|
|
|
|
|
|
while True:
|
|
|
|
print("Im System stehen Ihnen verschiedene Funktionen zur Verfügung.\n")
|
2021-02-04 20:41:12 +01:00
|
|
|
print("""
|
|
|
|
1.Buchhaltung
|
|
|
|
2.Kundenverwaltung
|
|
|
|
3.Zimmerverwaltung
|
|
|
|
4.Schlüsselverwaltung
|
|
|
|
5.Dienstpläne\n""")
|
2021-02-03 10:46:22 +01:00
|
|
|
while True:
|
|
|
|
print("Welches der folgenden Systeme möchten Sie öffnen?")
|
|
|
|
system = input().strip().lower()
|
2021-02-03 16:17:45 +01:00
|
|
|
if system in system_list or system == "beenden":
|
2021-02-03 10:46:22 +01:00
|
|
|
break
|
|
|
|
else:
|
|
|
|
clear()
|
|
|
|
print("Bitte wählen Sie aus einem der bestehenden Systeme aus.")
|
|
|
|
print("""
|
2021-02-04 20:41:12 +01:00
|
|
|
1.Buchhaltung
|
|
|
|
2.Kundenverwaltung
|
|
|
|
3.Zimmerverwaltung
|
|
|
|
4.Schlüsselverwaltung
|
|
|
|
5.Dienstpläne\n""")
|
2021-02-03 10:46:22 +01:00
|
|
|
|
2021-02-03 17:08:52 +01:00
|
|
|
#"""-----------INTERFACE-----ACCOUNTING------------------"""
|
2021-02-03 16:25:03 +01:00
|
|
|
|
2021-02-04 20:41:12 +01:00
|
|
|
if system == "1": #Accounting
|
2021-02-03 10:46:22 +01:00
|
|
|
clear()
|
|
|
|
|
|
|
|
while True:
|
|
|
|
print("Willkommen in der Buchhaltung")
|
|
|
|
print("Welche der folgenen Aktionen möchten Sie ausführen")
|
|
|
|
print("""
|
|
|
|
1. Rechnung anzeigen
|
|
|
|
2. Rechnung bezahlen
|
|
|
|
3. Rechnung löschen
|
|
|
|
Abbrechen
|
|
|
|
|
|
|
|
""")
|
|
|
|
account = input().strip().lower()
|
|
|
|
if account == "1":
|
|
|
|
print("Rechnung anzeigen\n")
|
|
|
|
show_single_bill()
|
2021-02-03 16:17:45 +01:00
|
|
|
input()
|
2021-02-03 10:46:22 +01:00
|
|
|
clear()
|
2021-02-03 16:17:45 +01:00
|
|
|
continue
|
|
|
|
|
2021-02-03 10:46:22 +01:00
|
|
|
if account == "2":
|
|
|
|
print("Rechung bezahlen\n")
|
|
|
|
pay_your_bill()
|
2021-02-03 16:17:45 +01:00
|
|
|
input()
|
2021-02-03 10:46:22 +01:00
|
|
|
clear()
|
2021-02-03 16:17:45 +01:00
|
|
|
continue
|
|
|
|
|
|
|
|
if account == "3":
|
|
|
|
print("Rechnung löschen\n")
|
|
|
|
while True:
|
|
|
|
print("Folgenden Rechnungsnummern stehen zur Auswahl:")
|
|
|
|
print(bill_list)
|
|
|
|
print("Rechungsnummer? ")
|
|
|
|
bill_numb =input().strip().lower()
|
|
|
|
if bill_numb in bill_list or bill_numb == "abbrechen":
|
|
|
|
break
|
|
|
|
|
|
|
|
if bill_numb == "abbrechen":
|
|
|
|
clear()
|
|
|
|
break
|
|
|
|
else:
|
|
|
|
delete_bill(bill_numb) # Delete bill at client
|
|
|
|
|
2021-02-04 20:41:12 +01:00
|
|
|
bill_list.remove(bill_numb) # Delete bill at bill_list
|
|
|
|
|
2021-02-03 16:17:45 +01:00
|
|
|
delete_ = "del " + bill_numb
|
|
|
|
exec(delete_) # Delete bill in system
|
2021-02-04 20:41:12 +01:00
|
|
|
|
|
|
|
####
|
|
|
|
#Kunde auschecken
|
|
|
|
####
|
2021-02-03 16:17:45 +01:00
|
|
|
input()
|
|
|
|
clear()
|
|
|
|
continue
|
|
|
|
|
|
|
|
if account == "abbrechen":
|
2021-02-03 10:46:22 +01:00
|
|
|
clear()
|
|
|
|
break
|
2021-02-03 16:25:03 +01:00
|
|
|
|
2021-02-03 17:08:52 +01:00
|
|
|
#"""-----------INTERFACE-----CLIENT------------------"""
|
2021-02-03 16:25:03 +01:00
|
|
|
|
2021-02-04 20:41:12 +01:00
|
|
|
if system == "2": #Client
|
2021-02-03 16:25:03 +01:00
|
|
|
clear()
|
2021-02-04 20:41:12 +01:00
|
|
|
while True:
|
2021-02-03 10:46:22 +01:00
|
|
|
|
2021-02-04 20:41:12 +01:00
|
|
|
print("Willkommen in der Kundenverwaltung")
|
|
|
|
print("Welche der folgenen Aktionen möchten Sie ausführen")
|
|
|
|
print("""
|
2021-02-03 16:25:03 +01:00
|
|
|
1. Kunde hinzufügen
|
|
|
|
2. Kunde anzeigen
|
|
|
|
3. Kunde einchecken
|
2021-02-04 20:41:12 +01:00
|
|
|
4. Kunde auschecken
|
|
|
|
5. Freie Zimmer über Zeitraum anzeigen.
|
2021-02-03 16:25:03 +01:00
|
|
|
Abbrechen
|
|
|
|
|
|
|
|
""")
|
|
|
|
|
2021-02-04 20:41:12 +01:00
|
|
|
client = input().strip().lower()
|
|
|
|
if client == "1":
|
|
|
|
print("Kunde hinzufügen\n")
|
|
|
|
c = add_client()
|
|
|
|
exec(c)
|
|
|
|
clear()
|
|
|
|
continue
|
|
|
|
|
|
|
|
if client == "2":
|
|
|
|
print("Kunde anzeigen\n")
|
|
|
|
print(all_clients)
|
|
|
|
while True:
|
|
|
|
k = input("Über welchen Kunden wollen sie sich Information anzeigen lassen? ")
|
|
|
|
if k in all_clients:
|
|
|
|
break
|
|
|
|
else:
|
|
|
|
print("Dieser Kunde ist leider nicht im System.")
|
|
|
|
c = str(k) + ".info()"
|
|
|
|
exec(c)
|
|
|
|
input()
|
|
|
|
clear()
|
|
|
|
continue
|
2021-02-03 16:25:03 +01:00
|
|
|
|
2021-02-04 20:41:12 +01:00
|
|
|
if client == "3":
|
|
|
|
print("Kunde einchecken\n")
|
|
|
|
print("Welchen Kunden möchten Sie einchecken?")
|
|
|
|
|
|
|
|
print(client_list)
|
|
|
|
while True:
|
|
|
|
client = input()
|
|
|
|
if client in client_list:
|
|
|
|
break
|
|
|
|
while True:
|
|
|
|
print(reference)
|
|
|
|
print("Zimmerauswahl")
|
|
|
|
room_ = input()
|
|
|
|
if room_ in reference:
|
|
|
|
break
|
|
|
|
else:
|
|
|
|
print("Dieses Zimmer ist in unserem Hotel leider nicht vorhanden.")
|
2021-02-03 19:33:46 +01:00
|
|
|
print("Aufenthaltszeitraum")
|
|
|
|
while True:
|
|
|
|
day_arrival = input("Anreisetag: ")
|
|
|
|
if day_arrival.isdigit() and 0 < int(day_arrival) and int(day_arrival) < 28:
|
|
|
|
break
|
|
|
|
while True:
|
|
|
|
month_arrival = input("Anreisemonat: ")
|
|
|
|
if month_arrival.isdigit() and 0 < int(month_arrival) and int(month_arrival) < 12:
|
|
|
|
break
|
|
|
|
while True:
|
|
|
|
day_depature = input("Abreisetag: ")
|
|
|
|
if day_depature.isdigit() and 0 < int(day_depature) and int(day_depature) < 28:
|
|
|
|
break
|
|
|
|
while True:
|
|
|
|
month_depature = input("Abreisemonat: ")
|
|
|
|
if month_depature.isdigit() and 0 < int(month_depature) and int(month_depature) < 12:
|
|
|
|
break
|
|
|
|
|
|
|
|
period = str(day_arrival) + "," +str(month_arrival) + "," + str(day_depature) + "," + str(month_depature)
|
2021-02-03 16:25:03 +01:00
|
|
|
|
2021-02-04 20:41:12 +01:00
|
|
|
check_ = str(room_) + ".is_free(" + "'" + str(client) + "'" + "," + "'" + str(room_) \
|
|
|
|
+ "'" + "," + "'" + str(period) + "'" + ")"
|
|
|
|
print(check_)
|
|
|
|
exec(check_)
|
2021-02-03 19:33:46 +01:00
|
|
|
|
|
|
|
|
2021-02-04 20:41:12 +01:00
|
|
|
clear()
|
|
|
|
continue
|
|
|
|
|
|
|
|
if client == "4":
|
|
|
|
print("Auschecken\n")
|
|
|
|
print("Welchen Gast möchten Sie auschecken?")
|
|
|
|
print(checked_in_list)
|
|
|
|
while True:
|
|
|
|
client = input()
|
|
|
|
if client in checked_in_list:
|
|
|
|
checking_out = str(client) + ".check_out()"
|
|
|
|
exec(checking_out)
|
|
|
|
break
|
|
|
|
if client == "abbrechen":
|
|
|
|
break
|
|
|
|
|
2021-02-03 17:08:52 +01:00
|
|
|
|
2021-02-04 20:41:12 +01:00
|
|
|
clear()
|
|
|
|
continue
|
2021-02-03 16:25:03 +01:00
|
|
|
|
|
|
|
|
2021-02-04 20:41:12 +01:00
|
|
|
if client == "5":
|
|
|
|
print("Freie Zimmer anzeigen\n")
|
|
|
|
while True:
|
|
|
|
print("In welchem Zeitraum möchten Sie schauen, ob Zimmer frei sind?")
|
|
|
|
print("Aufenthaltszeitraum")
|
|
|
|
while True:
|
|
|
|
day_arrival = input("Anreisetag: ")
|
|
|
|
if day_arrival.isdigit() and 0 < int(day_arrival) and int(day_arrival) < 28:
|
|
|
|
break
|
|
|
|
while True:
|
|
|
|
month_arrival = input("Anreisemonat: ")
|
|
|
|
if month_arrival.isdigit() and 0 < int(month_arrival) and int(month_arrival) < 12:
|
|
|
|
break
|
|
|
|
while True:
|
|
|
|
day_depature = input("Abreisetag: ")
|
|
|
|
if day_depature.isdigit() and 0 < int(day_depature) and int(day_depature) < 28:
|
|
|
|
break
|
|
|
|
while True:
|
|
|
|
month_depature = input("Abreisemonat: ")
|
|
|
|
if month_depature.isdigit() and 0 < int(month_depature) and int(month_depature) < 12:
|
|
|
|
break
|
|
|
|
|
|
|
|
period = str(day_arrival) + "," +str(month_arrival) + "," + str(day_depature) + "," + str(month_depature)
|
|
|
|
#print(period)
|
|
|
|
for i in reference:
|
|
|
|
k = str(i) + ".is_occupied(" + "'" + str(i) + "'" + "," + "'" + str(period) + "'" + ")"
|
|
|
|
#print(k)
|
|
|
|
exec(k)
|
|
|
|
input()
|
|
|
|
clear()
|
|
|
|
continue
|
2021-02-03 16:25:03 +01:00
|
|
|
|
2021-02-04 20:41:12 +01:00
|
|
|
if client == "abbrechen":
|
|
|
|
input()
|
|
|
|
clear()
|
|
|
|
break
|
2021-02-03 16:25:03 +01:00
|
|
|
|
2021-02-03 17:08:52 +01:00
|
|
|
#"""-----------INTERFACE-----ROOM------------------"""
|
2021-02-03 10:46:22 +01:00
|
|
|
|
2021-02-04 20:41:12 +01:00
|
|
|
if system == "3": #Room
|
|
|
|
clear()
|
|
|
|
while True:
|
|
|
|
print("\nWillkommen in der Zimmerverwaltung")
|
|
|
|
print("Welche der folgenen Aktionen möchten Sie ausführen")
|
|
|
|
print("""
|
|
|
|
1. Zimmerstatus anzeigen
|
|
|
|
Abbrechen
|
|
|
|
""")
|
|
|
|
|
|
|
|
room_input = input().strip().lower()
|
|
|
|
if room_input == "1":
|
|
|
|
while True:
|
|
|
|
print("Zimmerstatus anzeigen\n")
|
|
|
|
print(reference)
|
|
|
|
print("Name des Zimmers:")
|
|
|
|
dorm = input()
|
|
|
|
if dorm in reference:
|
|
|
|
print("""
|
|
|
|
1. Ale Informationen
|
|
|
|
2. Nummer
|
|
|
|
3.Gast""")
|
|
|
|
|
|
|
|
dorm_info = input()
|
|
|
|
if dorm_info == "1":
|
|
|
|
print("Zimmer:", dorm)
|
|
|
|
dorm_exec = str(dorm) + ".info()"
|
|
|
|
exec(dorm_exec)
|
|
|
|
input()
|
|
|
|
clear()
|
|
|
|
break
|
|
|
|
if dorm_info == "2":
|
|
|
|
print("Zimmer:", dorm)
|
|
|
|
dorm_exec = str(dorm) + ".info("+ "'Nummer'" +")"
|
|
|
|
exec(dorm_exec)
|
|
|
|
input()
|
|
|
|
clear()
|
|
|
|
break
|
|
|
|
if dorm_info == "3":
|
|
|
|
print("Zimmer:", dorm)
|
|
|
|
dorm_exec = str(dorm) + ".info("+ "'Gast'" +")"
|
|
|
|
exec(dorm_exec)
|
|
|
|
input()
|
|
|
|
clear()
|
|
|
|
break
|
|
|
|
if dorm_info == "abbrechen":
|
|
|
|
clear()
|
|
|
|
break
|
|
|
|
|
|
|
|
if room_input == "abbrechen":
|
|
|
|
clear()
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
|
|
if system == "4": #Key
|
|
|
|
clear()
|
|
|
|
while True:
|
|
|
|
print("Willkommen in der Schlüsselverwaltung")
|
|
|
|
print("Welche der folgenen Aktionen möchten Sie ausführen")
|
|
|
|
print("""
|
|
|
|
1. Schlüsselstatus anzeigen
|
|
|
|
Abbrechen""")
|
|
|
|
|
|
|
|
key_input = input().strip().lower()
|
|
|
|
if key_input == "1":
|
|
|
|
while True:
|
|
|
|
print("Schlüsselstatus anzeigen\n")
|
|
|
|
all_key_numbers = ["11", "12", "21", "22", "31", "32", "41", "42"]
|
|
|
|
print(all_key_numbers)
|
|
|
|
key_num = input("Schlüsselnummer ")
|
|
|
|
print("")
|
|
|
|
if key_num in all_key_numbers:
|
|
|
|
key_print = "key_" + key_num + ".status_key()"
|
|
|
|
exec(key_print)
|
|
|
|
input()
|
|
|
|
clear()
|
|
|
|
break
|
|
|
|
if key_num == "abbrechen":
|
|
|
|
clear()
|
|
|
|
break
|
|
|
|
else:
|
|
|
|
print("Was ist schief gelaufen")
|
|
|
|
if key_input == "abbrechen":
|
|
|
|
clear()
|
|
|
|
break
|
|
|
|
|
|
|
|
if system == "5": #duty_roster
|
|
|
|
clear()
|
|
|
|
def duty_roster_write():
|
|
|
|
with open('dienstplan.txt', 'w', encoding='utf8') as d:
|
|
|
|
employees = ['M. Gustave', 'Zero Mustafa', 'M. Jean', 'Agatha', 'M. Chuck']
|
|
|
|
job = ['Concierge', 'Lobby-Boy', 'Rezeptionist', 'Portier']
|
|
|
|
i = 1
|
|
|
|
while i < 53:
|
|
|
|
random.shuffle(employees)
|
|
|
|
random.shuffle(job)
|
|
|
|
a = "KW" + str(i)
|
|
|
|
d.write(a + "#" + employees[0] + ": " + job[0] + "#" + employees[1]\
|
|
|
|
+ ": " + job[1] + "#" + employees[2] + ": " + job[2] + "#" + employees[3] + ": " \
|
|
|
|
+ job[3] + "#" + "frei: " + employees[4] + "\n")
|
|
|
|
i += 1
|
|
|
|
|
|
|
|
def duty_roster_read():
|
|
|
|
with open('dienstplan.txt', 'r', encoding='utf8') as d:
|
|
|
|
for line in d:
|
|
|
|
print(line)
|
|
|
|
|
|
|
|
while True:
|
|
|
|
print("\nWillkommen dei den Dienstplänen")
|
|
|
|
print("Welche der folgenen Aktionen möchten Sie ausführen")
|
|
|
|
print("""
|
|
|
|
1. Dienstplan erstellen und anzeigen
|
|
|
|
2. Dienstplan exportieren
|
|
|
|
3. Dienstplan importieren
|
|
|
|
Abbrechen""")
|
|
|
|
|
|
|
|
duty = input().strip().lower()
|
|
|
|
if duty == "1":
|
|
|
|
try:
|
|
|
|
duty_roster_write()
|
|
|
|
duty_roster_read()
|
|
|
|
except:
|
|
|
|
print("Es konnte kein Dienstplan erstellt werden.")
|
|
|
|
input()
|
|
|
|
clear()
|
|
|
|
continue
|
|
|
|
if duty == "2":
|
|
|
|
try:
|
|
|
|
duty_roster_write()
|
|
|
|
print("Der Dienstplan wurde erfolgreich exportiert.")
|
|
|
|
except:
|
|
|
|
print("Der Diensplan konnte nicht exportiert werden.")
|
|
|
|
input()
|
|
|
|
clear()
|
|
|
|
continue
|
|
|
|
if duty == "3":
|
|
|
|
try:
|
|
|
|
duty_roster_read()
|
|
|
|
except:
|
|
|
|
print("Es konnte kein Dienstplan unter dem Namen \
|
|
|
|
dienstplan.txt im Verzeichnis gefunden werden.")
|
|
|
|
input()
|
|
|
|
clear()
|
|
|
|
continue
|
|
|
|
if duty == "abbrechen":
|
|
|
|
input()
|
|
|
|
clear()
|
|
|
|
break
|
|
|
|
|
|
|
|
|
2021-02-03 10:46:22 +01:00
|
|
|
|
|
|
|
|
2021-02-03 16:17:45 +01:00
|
|
|
if system == "beenden":
|
|
|
|
clear()
|
|
|
|
print("The Grand Budapest Hotel wünscht noch einen angenehmen Tag.")
|
|
|
|
print("Auf Wiedersehen!")
|
|
|
|
break
|
2021-02-03 10:46:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#break
|
2021-02-04 20:41:12 +01:00
|
|
|
|