3002 - Local wallpaper kit prices (#63)

This commit is contained in:
Fredrik Ringqvist
2022-11-16 07:42:56 +01:00
committed by GitHub
parent 80dee6bd86
commit 1bf3765809
+34 -5
View File
@@ -165,17 +165,46 @@ def inquiry_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
# Prices in local currency
prices = {
'AT': 15.91,
'AU': 23.64,
'BE': 17.25,
'CA': 24,
'CH': 19.09,
'DE': 16.36,
'DK': 132.67,
'EE': 16.96,
'ES': 17.55,
'FI': 17.34,
'FR': 16.22,
'GB': 13.31,
'GLOBAL': 13.45,
'IE': 15.52,
'IT': 17.21,
'LU': 15.88,
'NL': 16.53,
'NO': 154.26,
'PL': 19.31,
'SE': 159.2,
'SG': 19.81,
'US': 19.81,
}
local_price = prices.get(market.name)
if (local_price):
# Note that the local wallpaper kit prices do not follow usual behaviour of multiplying by market exchange rate
price = local_price
else:
# Default/fallback price
price = prices.get('SE')
price *= market.exchange_rate
price *= market.price_adjustments
if reseller:
price *= (float(reseller.pricepremium) / 100) + 1
price *= market.exchange_rate
if inc_vat:
price *= market.vat