refactor material prices
This commit is contained in:
@@ -2,7 +2,7 @@ from flask import Blueprint, request, jsonify, abort
|
||||
from api.models.product import Material
|
||||
from api.models.contract_customer import ContractCustomer
|
||||
from api.models import market as market_model
|
||||
from api.lib.prices import wallpaper_price, old_canvas_price, old_canvas_diy_frame_price
|
||||
from api.lib.prices import wallpaper_price, old_canvas_price, old_canvas_diy_frame_price, material_price
|
||||
from api.lib.limits import calculate_canvas_limits
|
||||
from api.validators import validate_territory, validate_number, validate_keys_exists
|
||||
|
||||
@@ -36,7 +36,8 @@ def wallpaper():
|
||||
data.append({
|
||||
'material': material.name,
|
||||
'material_id': material.id,
|
||||
'price': wallpaper_price(width, height, material.price, market, reseller=reseller),
|
||||
'material_price': material_price(material, market, reseller=reseller, inc_vat=True),
|
||||
'price': wallpaper_price(width, height, material, market, reseller=reseller),
|
||||
})
|
||||
|
||||
return jsonify(data=data)
|
||||
@@ -63,7 +64,7 @@ def canvas():
|
||||
'framed': framed,
|
||||
'width': width,
|
||||
'height': height,
|
||||
'price': old_canvas_price(width, height, material.price, market, reseller=reseller, framed=framed)
|
||||
'price': old_canvas_price(width, height, material, market, reseller=reseller, framed=framed)
|
||||
})
|
||||
|
||||
return jsonify(data=data)
|
||||
|
||||
Reference in New Issue
Block a user