Merge branch 'master' into edge
This commit is contained in:
commit
ded4848a5e
@ -19,23 +19,29 @@ def execute(filters=None):
|
|||||||
time_logs = webnotes.conn.sql("""select * from `tabTime Log`
|
time_logs = webnotes.conn.sql("""select * from `tabTime Log`
|
||||||
where docstatus < 2 %s order by owner asc""" % (conditions, ), filters, as_dict=1)
|
where docstatus < 2 %s order by owner asc""" % (conditions, ), filters, as_dict=1)
|
||||||
|
|
||||||
data = []
|
|
||||||
if time_logs:
|
if time_logs:
|
||||||
profiles = [time_logs[0].owner]
|
profiles = [time_logs[0].owner]
|
||||||
|
|
||||||
total_hours = 0
|
data = []
|
||||||
|
total_hours = total_employee_hours = count = 0
|
||||||
for tl in time_logs:
|
for tl in time_logs:
|
||||||
if tl.owner not in profiles:
|
if tl.owner not in profiles:
|
||||||
profiles.append(tl.owner)
|
profiles.append(tl.owner)
|
||||||
data.append([])
|
data.append(["", "", "", "Total", total_employee_hours, "", "", "", "", ""])
|
||||||
|
total_employee_hours = 0
|
||||||
|
|
||||||
data.append([tl.name, profile_map[tl.owner], tl.from_time, tl.to_time, tl.hours,
|
data.append([tl.name, profile_map[tl.owner], tl.from_time, tl.to_time, tl.hours,
|
||||||
tl.activity_type, tl.task, task_map.get(tl.task), tl.project, tl.status])
|
tl.activity_type, tl.task, task_map.get(tl.task), tl.project, tl.status])
|
||||||
|
|
||||||
|
count += 1
|
||||||
total_hours += flt(tl.hours)
|
total_hours += flt(tl.hours)
|
||||||
|
total_employee_hours += flt(tl.hours)
|
||||||
|
|
||||||
|
if count == len(time_logs):
|
||||||
|
data.append(["", "", "", "Total Hours", total_employee_hours, "", "", "", "", ""])
|
||||||
|
|
||||||
if total_hours:
|
if total_hours:
|
||||||
data.append(["", "", "", "Total", total_hours, "", "", "", "", ""])
|
data.append(["", "", "", "Grand Total", total_hours, "", "", "", "", ""])
|
||||||
|
|
||||||
return columns, data
|
return columns, data
|
||||||
|
|
||||||
|
|||||||
@ -29,12 +29,12 @@ class DocType:
|
|||||||
|
|
||||||
def get_transactions(self, arg=None):
|
def get_transactions(self, arg=None):
|
||||||
return {
|
return {
|
||||||
"transactions": "\n".join([''] + [i[0] for i in
|
"transactions": "\n".join([''] + sorted(list(set(
|
||||||
sql("""select `tabDocField`.`parent`
|
webnotes.conn.sql_list("""select parent
|
||||||
FROM `tabDocField`, `tabDocType`
|
from `tabDocField` where fieldname='naming_series'""")
|
||||||
WHERE `tabDocField`.`fieldname` = 'naming_series'
|
+ webnotes.conn.sql_list("""select dt from `tabCustom Field`
|
||||||
and `tabDocType`.name=`tabDocField`.parent
|
where fieldname='naming_series'""")
|
||||||
order by `tabDocField`.parent""")]),
|
)))),
|
||||||
"prefixes": "\n".join([''] + [i[0] for i in
|
"prefixes": "\n".join([''] + [i[0] for i in
|
||||||
sql("""select name from tabSeries""")])
|
sql("""select name from tabSeries""")])
|
||||||
}
|
}
|
||||||
@ -89,7 +89,6 @@ class DocType:
|
|||||||
'property': prop,
|
'property': prop,
|
||||||
'value': prop_dict[prop],
|
'value': prop_dict[prop],
|
||||||
'property_type': 'Select',
|
'property_type': 'Select',
|
||||||
'select_doctype': doctype
|
|
||||||
})
|
})
|
||||||
ps.save(1)
|
ps.save(1)
|
||||||
|
|
||||||
@ -101,11 +100,18 @@ class DocType:
|
|||||||
from core.doctype.doctype.doctype import DocType
|
from core.doctype.doctype.doctype import DocType
|
||||||
dt = DocType()
|
dt = DocType()
|
||||||
|
|
||||||
parent = sql("""select dt.name from `tabDocField` df, `tabDocType` dt
|
parent = list(set(
|
||||||
where dt.name = df.parent and df.fieldname='naming_series' and dt.name != %s""",
|
webnotes.conn.sql_list("""select dt.name
|
||||||
self.doc.select_doc_for_series)
|
from `tabDocField` df, `tabDocType` dt
|
||||||
sr = ([webnotes.model.doctype.get_property(p[0], 'options', 'naming_series'), p[0]]
|
where dt.name = df.parent and df.fieldname='naming_series' and dt.name != %s""",
|
||||||
for p in parent)
|
self.doc.select_doc_for_series)
|
||||||
|
+ webnotes.conn.sql_list("""select dt.name
|
||||||
|
from `tabCustom Field` df, `tabDocType` dt
|
||||||
|
where dt.name = df.dt and df.fieldname='naming_series' and dt.name != %s""",
|
||||||
|
self.doc.select_doc_for_series)
|
||||||
|
))
|
||||||
|
sr = [[webnotes.model.doctype.get_property(p, 'options', 'naming_series'), p]
|
||||||
|
for p in parent]
|
||||||
options = self.scrub_options_list(self.doc.set_options.split("\n"))
|
options = self.scrub_options_list(self.doc.set_options.split("\n"))
|
||||||
for series in options:
|
for series in options:
|
||||||
dt.validate_series(series, self.doc.select_doc_for_series)
|
dt.validate_series(series, self.doc.select_doc_for_series)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user