Skip to content

Commit

Permalink
Merge 5d5e4d1 into f037b39
Browse files Browse the repository at this point in the history
  • Loading branch information
mkurek committed Jul 23, 2014
2 parents f037b39 + 5d5e4d1 commit 2e52264
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ralph_pricing/plugins/reports/ceilometer.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,17 @@ def costs(self, service, start, end, ventures, forecast=False, **kwargs):
start__lte=end,
end__gte=start
):
price = D(usage_price.price)
if forecast:
price = usage_price.forecast_price
else:
price = usage_price.price
up_start = max(start, usage_price.start)
up_end = min(end, usage_price.end)

ventures_usages = usage_type.dailyusage_set.filter(
date__gte=up_start,
date__lte=up_end,
pricing_venture__in=ventures,
).values('pricing_venture').annotate(value=Sum('value'))

for usage in ventures_usages:
Expand Down

0 comments on commit 2e52264

Please sign in to comment.