Billing
This commit is contained in:
parent
a37df75f57
commit
3c9b5a4c19
|
@ -259,12 +259,18 @@ class OrderTests(BaseTestCase):
|
||||||
groups = []
|
groups = []
|
||||||
prev = None
|
prev = None
|
||||||
for rate in rates:
|
for rate in rates:
|
||||||
elif not prev or (not rate.is_combinable and prev.plan != rate.plan):
|
if rate.quantity <= metric:
|
||||||
|
if not prev or (not rate.is_combinable and prev.plan != rate.plan):
|
||||||
groups.append([rate])
|
groups.append([rate])
|
||||||
else:
|
else:
|
||||||
groups[-1].append(rate)
|
groups[-1].append(rate)
|
||||||
|
results = []
|
||||||
for group in groups:
|
for group in groups:
|
||||||
for rates in group:
|
ini = None
|
||||||
|
for rate in group:
|
||||||
|
if not ini:
|
||||||
|
ini = rate.quantity
|
||||||
|
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue