Commit 17075581 authored by Nicolas Wavrant's avatar Nicolas Wavrant

fixup! testResource: test unit price calculated by slice

parent 6d5ed61f
...@@ -1129,15 +1129,18 @@ class TestResource(ERP5TypeTestCase): ...@@ -1129,15 +1129,18 @@ class TestResource(ERP5TypeTestCase):
def testGetPriceWithBasePriceDefinedPerSlice(self): def testGetPriceWithBasePriceDefinedPerSlice(self):
""" """
Slices allow to apply a different price per item given the quantity of this
item ordered. See exemple
[unit quantity] [price defined for the units of this slice] [unit quantity] [price defined for the units of this slice]
0 -> 10 = 10 currency/unit 0 -> 10 = 10 currency/unit
11 -> 20 = 9 currency/unit 11 -> 20 = 9 currency/unit
21 -> inf = 8 currency/unit 21 -> inf = 8 currency/unit
unit -> price / unit So the price for an order of X unit is :
9 -> 10 currency/unit unit -> total order price -> price / unit
15 -> 9.66667 currency/unit 9 -> 90 currency -> 10 currency/unit
25 -> 9.2 currency/unit 15 -> 10*10+5*9 = 145 currency -> 9.66667 currency/unit
25 -> 20*10+10*9+5*8 = 230 currency -> 9.2 currency/unit
""" """
product_module = self.portal.getDefaultModule(self.product_portal_type) product_module = self.portal.getDefaultModule(self.product_portal_type)
product = product_module.newContent( product = product_module.newContent(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment