def make_sale(): """ Make a sale of product to customer. """ Customer.print_all() customer_id = input("\nCustomer id:\n") Product.print_all() product_id = input("\nProduct id:\n") quantity = input("\nQuantity\n") try: customer = Customer.get_by_id(customer_id) check = customer.purchase(product_id, quantity) bcolors.print_success(check) except ValueError as e: bcolors.print_fail(str(e))
def customer_list(): """ List all entered customers. """ Customer.print_all()