Commit 28676fdd authored by Georgios Dagkakis's avatar Georgios Dagkakis

erp5_trade, OrderModule_activateGetOrderStatList: make at_date inclusive

Also:
- fix parameter name to be the same as what request has
- Formatting and trailing whitespaces fixes
parent 8d0f298f
...@@ -5,7 +5,10 @@ category_tool = portal.portal_categories ...@@ -5,7 +5,10 @@ category_tool = portal.portal_categories
request = container.REQUEST request = container.REQUEST
from_date = request.get('from_date', None) from_date = request.get('from_date', None)
to_date = request.get('at_date', None) at_date = request.get('at_date', None)
if at_date:
at_date = at_date.latestTime()
aggregation_level = request.get('aggregation_level', None) aggregation_level = request.get('aggregation_level', None)
report_group_by = request.get('group_by', None) report_group_by = request.get('group_by', None)
# get all category # get all category
...@@ -51,16 +54,16 @@ elif aggregation_level == "week": ...@@ -51,16 +54,16 @@ elif aggregation_level == "week":
elif aggregation_level == "day": elif aggregation_level == "day":
date_format = "%Y-%m-%d" date_format = "%Y-%m-%d"
params = {"delivery.start_date":(from_date, to_date)} params = {"delivery.start_date":(from_date, at_date)}
query=None query=None
if from_date is not None and to_date is not None: if from_date is not None and at_date is not None:
params = {"delivery.start_date":(from_date, to_date)} params = {"delivery.start_date": (from_date, at_date)}
query = Query(range="minngt", **params) query = Query(range="minngt", **params)
elif from_date is not None: elif from_date is not None:
params = {"delivery.start_date":from_date} params = {"delivery.start_date": from_date}
query = Query(range="min", **params) query = Query(range="min", **params)
elif to_date is not None: elif at_date is not None:
params = {"delivery.start_date":to_date} params = {"delivery.start_date": at_date}
query = Query(range="ngt", **params) query = Query(range="ngt", **params)
select_params = {"select_list" : ['source_section_title', 'destination_section_title', select_params = {"select_list" : ['source_section_title', 'destination_section_title',
......
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