0% found this document useful (0 votes)
24 views2 pages

Bill

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views2 pages

Bill

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

print('========= Welcome To Theobroma Company ===========')

print("************* Please Enter Your Details ***************")


# Function to calculate total amount including GST
def calculate_total_amount(order):
total_amount = sum(item['quantity'] * item['price']
for item in order['cakes'])
gst_amount = total_amount * 0.18 # Assuming GST rate is 18%
total_amount += gst_amount
return total_amount

# Function to generate and print the bill


def generate_bill(customer, order):
print("********** Online Cake Bill **********")
print(f"Customer Name: {customer['name']}")
print(f"Address: {customer['address']}")
print(f"Phone No: {customer['phone']}")

print("\n********** Ordered Cakes **********")


for item in order['cakes']:
print(
f"{item['weight']} kg Cake x {item['quantity']} = {item['weight'] * item['quantity']}

# Prompt for mode of payment


mode_of_payment = input("Enter mode of payment (Cash/Card/UPI): ")

# Display mode of payment in the bill


print("\n********** Payment Details **********")
print(f"Mode of Payment: {mode_of_payment}")

total_amount = calculate_total_amount(order)
print("\n********** Total Amount **********")
print(f"Total Amount (including GST): Rs. {total_amount:.2f}")
print("Thank you for choosing our services!")

# Function to take customer details and cake orders


def take_order():
customer = {}
order = {'cakes': []}

# Get customer details


customer['name'] = input("Enter your name: ")
customer['address'] = input("Enter your address: ")
customer['phone'] = input("Enter your phone number: ")

# Cake menu
cake_menu = [
{'name': 'Chocolate Cake', 'weight': 1, 'price': 500},
{'name': 'Vanilla Cake', 'weight': 1, 'price': 450},
{'name': 'Dutch truffle Cake', 'weight': 1, 'price': 550},
{'name': 'Diwali Cake', 'weight': 1, 'price': 550},
{'name': 'Holi Cake', 'weight': 1, 'price': 550},
{'name': 'butterscotch Cake', 'weight': 1, 'price': 550},

# Get cake orders


while True:
print("\n********** Cake Menu **********")
for i, cake in enumerate(cake_menu, start=1):
print(f"{i}. {cake['name']} - Rs. {cake['price']} per kg")

1
choice = input(
"Enter the cake number you want to order (0 to finish): ")
if choice == '0':
break

cake_choice = cake_menu[int(choice) - 1]
weight = float(
input(f"How many kg of {cake_choice['name']} would you like to order? "))
quantity = int(input("Enter the quantity: "))

order['cakes'].append(
{'weight': weight, 'quantity': quantity, 'price': cake_choice['price']})

# Display the bill


generate_bill(customer, order)

# Main program
take_order()

You might also like