match condition added in daily time log summary report
This commit is contained in:
parent
7da387100d
commit
1a738f72f4
@ -3,13 +3,13 @@ wn.query_reports["Daily Time Log Summary"] = {
|
||||
{
|
||||
"fieldname":"from_date",
|
||||
"label": "From Date",
|
||||
"fieldtype": "Datetime",
|
||||
"fieldtype": "Date",
|
||||
"default": wn.datetime.get_today()
|
||||
},
|
||||
{
|
||||
"fieldname":"to_date",
|
||||
"label": "To Date",
|
||||
"fieldtype": "Datetime",
|
||||
"fieldtype": "Date",
|
||||
"default": wn.datetime.get_today()
|
||||
},
|
||||
]
|
||||
|
@ -2,7 +2,11 @@ from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
def execute(filters=None):
|
||||
if not filters: filters = {}
|
||||
if not filters:
|
||||
filters = {}
|
||||
elif filters.get("to_date"):
|
||||
filters["to_date"] = filters.get("to_date") + "24:00:00"
|
||||
|
||||
columns = ["Employee::150", "From Datetime::120", "To Datetime::120", "Hours::70", "Task::150",
|
||||
"Project:Link/Project:120", "Status::70"]
|
||||
|
||||
@ -10,19 +14,19 @@ def execute(filters=None):
|
||||
|
||||
conditions = build_conditions(filters)
|
||||
time_logs = webnotes.conn.sql("""select * from `tabTime Log`
|
||||
where docstatus < 2 %s order by owner asc""" % (conditions,), filters, as_dict=1)
|
||||
|
||||
data = []
|
||||
profiles = [time_logs[0].owner]
|
||||
where docstatus < 2 %s order by owner asc""" % (conditions, ), filters, as_dict=1)
|
||||
|
||||
data = []
|
||||
if time_logs:
|
||||
profiles = [time_logs[0].owner]
|
||||
|
||||
for tl in time_logs:
|
||||
|
||||
if tl.owner not in profiles:
|
||||
profiles.append(tl.owner)
|
||||
data.append([])
|
||||
|
||||
data.append([profile_map[tl.owner], tl.from_time, tl.to_time, tl.hours,
|
||||
tl.task, tl.project, tl.status])
|
||||
tl.task, tl.project, tl.status])
|
||||
|
||||
return columns, data
|
||||
|
||||
@ -42,5 +46,10 @@ def build_conditions(filters):
|
||||
conditions += " and from_time >= %(from_date)s"
|
||||
if filters.get("to_date"):
|
||||
conditions += " and to_time <= %(to_date)s"
|
||||
|
||||
from webnotes.widgets.reportview import build_match_conditions
|
||||
match_conditions = build_match_conditions("Time Log")
|
||||
if match_conditions:
|
||||
conditions += " and %s" % match_conditions
|
||||
|
||||
return conditions
|
@ -67,7 +67,7 @@ erpnext.stock.StockReconciliation = erpnext.stock.StockController.extend({
|
||||
attach the modified file.");
|
||||
}
|
||||
} else if(this.frm.doc.docstatus == 1) {
|
||||
this.frm.set_intro("Cancelling this Stock Reconciliation will nullify it's effect.");
|
||||
this.frm.set_intro("Cancelling this Stock Reconciliation will nullify its effect.");
|
||||
this.show_stock_ledger();
|
||||
} else {
|
||||
this.frm.set_intro("");
|
||||
|
Loading…
x
Reference in New Issue
Block a user