P5-4783 add different designer pricepremium for each product group

This commit is contained in:
Martin Carlsson
2020-02-24 10:07:43 +01:00
committed by GitHub
parent b6437b3d25
commit fcf79ca75a
5 changed files with 63 additions and 63 deletions
+6 -6
View File
@@ -6,7 +6,7 @@ from api.lib.limits import calculate_canvas_limits
from api.lib import pwinty
def m2_price(
def wallpaper_m2_price(
material,
market,
designer=None,
@@ -19,7 +19,7 @@ def m2_price(
price = material.price / 100.0
if designer:
price *= (float(designer.pricepremium) / 100) + 1
price *= (float(designer.pricepremium_wallpaper) / 100) + 1
if reseller:
price *= (float(reseller.pricepremium) / 100) + 1
@@ -50,7 +50,7 @@ def wallpaper_price(
rounded=True,
inc_vat=True,
):
price = m2_price(
price = wallpaper_m2_price(
material, market, designer, reseller, inquiry, rounded=False, inc_vat=False
)
@@ -135,7 +135,7 @@ def canvas_price(
price *= market.price_adjustments
if designer:
price *= (float(designer.pricepremium) / 100) + 1
price *= (float(designer.pricepremium_canvas) / 100) + 1
if reseller:
price *= (float(reseller.pricepremium) / 100) + 1
@@ -232,7 +232,7 @@ def poster_price(
price *= market.price_adjustments
if designer:
price *= (float(designer.pricepremium) / 100) + 1
price *= (float(designer.pricepremium_poster) / 100) + 1
if reseller:
price *= (float(reseller.pricepremium) / 100) + 1
@@ -416,7 +416,7 @@ def framed_print_price(
price *= market.price_adjustments
if designer:
price *= (float(designer.pricepremium) / 100) + 1
price *= (float(designer.pricepremium_framed_print) / 100) + 1
if reseller:
price *= (float(reseller.pricepremium) / 100) + 1