diff --git a/app/models/money.py b/app/models/money.py index bfd58eb..3dd0cec 100644 --- a/app/models/money.py +++ b/app/models/money.py @@ -1,7 +1,6 @@ from sqlalchemy import Column, Integer,\ - DECIMAL, Text,\ + DECIMAL, TEXT,\ VARCHAR, TIMESTAMP, DATE -from datetime import datetime, timezone from database import Base diff --git a/app/routers/delivery.py b/app/routers/delivery.py index 9bf761e..0759841 100644 --- a/app/routers/delivery.py +++ b/app/routers/delivery.py @@ -71,8 +71,10 @@ async def calculate_delivery_final(delivery_id_order): if get_delivery.promo_id is not None: get_promo_amount = (float(get_delivery.gallons_delivered)) *(float(get_promo_data.money_off_delivery)) discount = (float(calc_total_oil)) - (float(get_promo_amount)) + discount_amount = get_promo_data.money_off_delivery else: discount = 0 + discount_amount = 0 # calculate fees total_amount_fees_from_delivery = (float(same_day_price) + float(prime_price)) @@ -101,7 +103,7 @@ async def calculate_delivery_final(delivery_id_order): total_amount_fee= total_amount_fees_from_delivery, total_amount=total_amount_delivery, taxes_paid=None, - total_discount_amount=get_promo_data.money_off_delivery, + total_discount_amount=discount_amount, total_discount_total=discount, total_profit_oil=profit_from_oil, total_profit=profit_from_stop,