P5-7013 Move wallpaperkit price to api (#38)

This commit is contained in:
Niklas Fondberg
2021-03-24 11:44:35 +01:00
committed by GitHub
parent 464e2f1fa6
commit 2b452a573a
4 changed files with 76 additions and 0 deletions
+22
View File
@@ -511,3 +511,25 @@ def inquiry_price(
price = round_half_up(price)
return price
def wallpaper_kit_price(
market, reseller=None, rounded=True, inc_vat=True
):
# Hardcode price as it hasn't been updated for a long time
# price from "product-stockprices"
price = 143.2
price *= market.price_adjustments
if reseller:
price *= (float(reseller.pricepremium) / 100) + 1
price *= market.exchange_rate
if inc_vat:
price *= market.vat
if rounded:
price = round_half_up(price)
return price