Пример #1
0
 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))
Пример #2
0
 def product_list():
     """
     List all entered products.
     """
     Product.print_all()