Created
October 22, 2013 15:59
-
-
Save jobelenus/7103289 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if num_days <= 3: | |
if order_is_shipping: | |
price = model.three_day_rate * qty | |
else: | |
price = model.four_day_rate * qty | |
elif num_days == 4: | |
price = model.four_day_rate * qty | |
elif num_days > 4: | |
days_amount = max(0, self._calculate_price_for_days(num_days-4, qty=qty, model=model)) | |
price = (model.four_day_rate * qty) + days_amount | |
ship_cost = max(0,model.shipping_cost) * qty if add_ship_cost else Decimal('0') | |
total = price + ship_cost |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment