Daily time log fixes #1614

This commit is contained in:
Nabin Hait 2014-05-13 11:32:39 +05:30
parent b3bead2f06
commit b76061530e

View File

@ -8,8 +8,9 @@ from frappe.utils import flt
def execute(filters=None):
if not filters:
filters = {}
elif filters.get("to_date"):
filters["to_date"] = filters.get("to_date") + "24:00:00"
elif filters.get("from_date") or filters.get("to_date"):
filters["from_time"] = "00:00:00"
filters["to_time"] = "24:00:00"
columns = ["Time Log:Link/Time Log:120", "Employee::150", "From Datetime::140",
"To Datetime::140", "Hours::70", "Activity Type::120", "Task:Link/Task:150",
@ -69,9 +70,9 @@ def get_task_map():
def build_conditions(filters):
conditions = ""
if filters.get("from_date"):
conditions += " and from_time >= %(from_date)s"
conditions += " and from_time >= timestamp(%(from_date)s, %(from_time)s)"
if filters.get("to_date"):
conditions += " and to_time <= %(to_date)s"
conditions += " and to_time <= timestamp(%(to_date)s, %(to_time)s)"
from frappe.widgets.reportview import build_match_conditions
match_conditions = build_match_conditions("Time Log")