main_menu.py
--------------------------------------------------------------------
from Banners import main_menu_banner, ordering_menu_banner
from Paper import paper_menu, paper_menu2
main_menu_banner()
def main_menu_0():
print_white_on_cyan = lambda x: cprint(x, 'white', 'on_cyan')
print_cyan = lambda x: cprint(x, 'cyan')
print_cyan("Below are a list of available items in inventory.")
print_cyan("Select the item of your choice to begin the ordering process:")
print_cyan("-------------------------------------------------------------")
print("")
print("1. Paper")
print("2. Pens")
print("3. Supplies")
print("")
selection = input("Enter the number for the item you would like to add: ")
print("")
if (selection == '1'):
paper_menu()
print("")
main_menu_0()
def main_menu2():
print_white_on_cyan = lambda x: cprint(x, 'white', 'on_cyan')
print_cyan = lambda x: cprint(x, 'cyan')
print_cyan("Below are a list of available items in inventory.")
print_cyan("Select the item of your choice to begin the ordering process:")
print_cyan("-------------------------------------------------------------")
print("")
print("1. Paper")
print("2. Pens")
print("3. Supplies")
print("")
selection = input("Enter the number for the item you would like to add: ")
print("")
if (selection == '1'):
paper_menu2()
print("")
Papers.py
---------------------------------------------------------------------
from main_menu import main_menu2
def paper_menu():
print("We have the following paper types to select from: ")
print("1. Paper type 1")
print("2. Paper type 2")
print("3. Paper type 3")
paper_selection = input("Enter the selection number for the paper type you would like to order.")
if (paper_selection == "1"):
print("You have selected Paper type 1.")
confirm_paper_selection = input("Is this correct? 'y/n'")
if (confirm_paper_selection == "y"):
quantity_paper_type_1 = input("Enter the amount of paper reams you would like to order.")
print(f"You have entered {quantity_paper_type_1} for {paper_selection}.")
confirm_quantity_paper_selection = input("Is this correct? 'y/n'")
if(confirm_quantity_paper_selection == "y" or confirm_quantity_paper_selection == "Y"):
print(f"You are about to place an order for {paper_selection} for ")
print(f"{quantity_paper_type_1}.")
dept_num = input("Enter the department number to bill the purchase to: ")
print(f"You entered {dept_num}.")
confirm_dept_num = input("Is this correct? 'y/n' ? ")
if (confirm_dept_num == "y" or confirm_dept_num == "Y"):
auth_code = int(input("Enter your authorisation code to continue:"))
if (auth_code == 456):
print("Authorisation code accepted.")
else:
print("Invalid authorisation code.")
auth_code2 = input("Re-enter authorisation")
if(auth_code2 == 456):
print("Authorisation code accepted.")
print("Would you like to complete your purchase or")
print("would you like to return to the main menu to add")
return_to_main_menu = input("additional items?")
if(return_to_main_menu == "y" or "Y"):
main_menu2()
else:
print("Invalid authorisation code.")
print("Program exiting...")
exit
def paper_menu2():
print("We have the following paper types to select from: ")
print("1. Paper type 1")
print("2. Paper type 2")
print("3. Paper type 3")
paper_selection = input("Enter the selection number for the paper type you would like to order.")
if (paper_selection == "1"):
print("You have selected Paper type 1.")
confirm_paper_selection = input("Is this correct? 'y/n'")
if (confirm_paper_selection == "y"):
quantity_paper_type_1 = input("Enter the amount of paper reams you would like to order.")
print(f"You have entered {quantity_paper_type_1} for {paper_selection}.")
confirm_quantity_paper_selection = input("Is this correct? 'y/n'")
if(confirm_quantity_paper_selection == "y" or confirm_quantity_paper_selection == "Y"):
print(f"You are about to place an order for {paper_selection} for ")
print(f"{quantity_paper_type_1}.")
dept_num = input("Enter the department number to bill the purchase to: ")
print(f"You entered {dept_num}.")
confirm_dept_num = input("Is this correct? 'y/n' ? ")
if (confirm_dept_num == "y" or confirm_dept_num == "Y"):
auth_code = int(input("Enter your authorisation code to continue:"))
if (auth_code == 456):
print("Authorisation code accepted.")
else:
print("Invalid authorisation code.")
auth_code2 = input("Re-enter authorisation")
if(auth_code2 == 456):
print("Authorisation code accepted.")
print("Would you like to (1.) Complete your purchase or")
print("would you like to (2.) Return to the main menu to add")
return_to_main_menu = input("additional items?")
if(return_to_main_menu == 1):
print("DEBUG: line 77.")
elif return_to_main_menu == 2 :
print("DEBUG: line 79.")
else:
exit
else:
print("Invalid authorisation code.")
print("Program exiting...")
exit
# else:
# other command
else:
print("DEBUG: line 87.")
# other command
else:
print("DEBUG: line 90.")
else:
print("DEBUG: line 92.")