mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-24 15:39:20 +00:00
feat: sort timesheets by start time
(cherry picked from commit c82611aa62)
# Conflicts:
# erpnext/projects/doctype/timesheet/timesheet.py
This commit is contained in:
@@ -298,11 +298,15 @@ def get_projectwise_timesheet_data(project=None, parent=None, from_time=None, to
|
|||||||
if from_time and to_time:
|
if from_time and to_time:
|
||||||
condition += "AND CAST(tsd.from_time as DATE) BETWEEN %(from_time)s AND %(to_time)s"
|
condition += "AND CAST(tsd.from_time as DATE) BETWEEN %(from_time)s AND %(to_time)s"
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
query = f"""
|
query = f"""
|
||||||
SELECT
|
SELECT
|
||||||
=======
|
=======
|
||||||
return frappe.db.sql("""
|
return frappe.db.sql("""
|
||||||
|
=======
|
||||||
|
query = f"""
|
||||||
|
>>>>>>> c82611aa62 (feat: sort timesheets by start time)
|
||||||
SELECT
|
SELECT
|
||||||
|
|
||||||
>>>>>>> 1110f88e5a (feat: refactor and enhance sales invoice timesheet)
|
>>>>>>> 1110f88e5a (feat: refactor and enhance sales invoice timesheet)
|
||||||
@@ -358,9 +362,12 @@ def get_timesheet_detail_rate(timelog, currency):
|
|||||||
INNER JOIN `tabTimesheet` ts
|
INNER JOIN `tabTimesheet` ts
|
||||||
ON ts.name = tsd.parent
|
ON ts.name = tsd.parent
|
||||||
|
|
||||||
WHERE tsd.parenttype = 'Timesheet'
|
WHERE
|
||||||
AND tsd.docstatus=1 {0}
|
|
||||||
|
tsd.parenttype = 'Timesheet'
|
||||||
|
AND tsd.docstatus = 1
|
||||||
AND tsd.is_billable = 1
|
AND tsd.is_billable = 1
|
||||||
|
<<<<<<< HEAD
|
||||||
AND tsd.sales_invoice is null
|
AND tsd.sales_invoice is null
|
||||||
""".format(condition), {
|
""".format(condition), {
|
||||||
'project': project,
|
'project': project,
|
||||||
@@ -369,6 +376,22 @@ def get_timesheet_detail_rate(timelog, currency):
|
|||||||
'to_time': to_time
|
'to_time': to_time
|
||||||
}, as_dict=1)
|
}, as_dict=1)
|
||||||
>>>>>>> 1110f88e5a (feat: refactor and enhance sales invoice timesheet)
|
>>>>>>> 1110f88e5a (feat: refactor and enhance sales invoice timesheet)
|
||||||
|
=======
|
||||||
|
AND tsd.sales_invoice is NULL
|
||||||
|
{condition}
|
||||||
|
|
||||||
|
ORDER BY tsd.from_time ASC
|
||||||
|
"""
|
||||||
|
|
||||||
|
filters = {
|
||||||
|
"project": project,
|
||||||
|
"parent": parent,
|
||||||
|
"from_time": from_time,
|
||||||
|
"to_time": to_time
|
||||||
|
}
|
||||||
|
|
||||||
|
return frappe.db.sql(query, filters, as_dict=1)
|
||||||
|
>>>>>>> c82611aa62 (feat: sort timesheets by start time)
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
@frappe.validate_and_sanitize_search_inputs
|
@frappe.validate_and_sanitize_search_inputs
|
||||||
|
|||||||
Reference in New Issue
Block a user