Beispiel #1
0
def get_total_amount_for_order(order_num):
    total_amount = 0

    it = db_access_web.get_all_order_details_for_order(str(order_num))

    if it is not None:
        for row in it:
            quantity_ordered = row['quantityOrdered']
            price_each = row['priceEach']
            total_amount += float(quantity_ordered) * float(price_each)
    else:
        return 0

    return total_amount
def all_order_details(order_num):
    ord_det = get_all_order_details_for_order(order_num)
    min = 9999999
    for od in ord_det:
        # print(od)
        if min > od["priceEach"]:
            min = od["priceEach"]
    if len(ord_det) == 4:
        print("details passed")
    else:
        print("details failed")
    if min == 43.27:
        print("details passed")
    else:
        print("details failed")