3002 - Local wallpaper kit prices (#63)
This commit is contained in:
+34
-5
@@ -165,17 +165,46 @@ def inquiry_price(
|
|||||||
def wallpaper_kit_price(
|
def wallpaper_kit_price(
|
||||||
market, reseller=None, rounded=True, inc_vat=True
|
market, reseller=None, rounded=True, inc_vat=True
|
||||||
):
|
):
|
||||||
# Hardcode price as it hasn't been updated for a long time
|
# Prices in local currency
|
||||||
# price from "product-stockprices"
|
prices = {
|
||||||
price = 143.2
|
'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
|
price *= market.price_adjustments
|
||||||
|
|
||||||
if reseller:
|
if reseller:
|
||||||
price *= (float(reseller.pricepremium) / 100) + 1
|
price *= (float(reseller.pricepremium) / 100) + 1
|
||||||
|
|
||||||
price *= market.exchange_rate
|
|
||||||
|
|
||||||
if inc_vat:
|
if inc_vat:
|
||||||
price *= market.vat
|
price *= market.vat
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user