mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 02:01:21 +00:00
Merge branch 'develop' into hr-separation
This commit is contained in:
@@ -379,11 +379,11 @@ def get_users_for_project(doctype, txt, searchfield, start, page_len, filters):
|
||||
or full_name like %(txt)s)
|
||||
{fcond} {mcond}
|
||||
order by
|
||||
if(locate(%(_txt)s, name), locate(%(_txt)s, name), 99999),
|
||||
if(locate(%(_txt)s, full_name), locate(%(_txt)s, full_name), 99999),
|
||||
(case when locate(%(_txt)s, name) > 0 then locate(%(_txt)s, name) else 99999 end),
|
||||
(case when locate(%(_txt)s, full_name) > 0 then locate(%(_txt)s, full_name) else 99999 end)
|
||||
idx desc,
|
||||
name, full_name
|
||||
limit %(start)s, %(page_len)s""".format(
|
||||
limit %(page_len)s offset %(start)s""".format(
|
||||
**{
|
||||
"key": searchfield,
|
||||
"fcond": get_filters_cond(doctype, filters, conditions),
|
||||
|
||||
@@ -28,7 +28,7 @@ def daily_reminder():
|
||||
for drafts in draft:
|
||||
number_of_drafts = drafts[0]
|
||||
update = frappe.db.sql(
|
||||
"""SELECT name,date,time,progress,progress_details FROM `tabProject Update` WHERE `tabProject Update`.project = %s AND date = DATE_ADD(CURDATE(), INTERVAL -1 DAY);""",
|
||||
"""SELECT name,date,time,progress,progress_details FROM `tabProject Update` WHERE `tabProject Update`.project = %s AND date = DATE_ADD(CURRENT_DATE, INTERVAL -1 DAY);""",
|
||||
project_name,
|
||||
)
|
||||
email_sending(project_name, frequency, date_start, date_end, progress, number_of_drafts, update)
|
||||
@@ -39,7 +39,7 @@ def email_sending(
|
||||
):
|
||||
|
||||
holiday = frappe.db.sql(
|
||||
"""SELECT holiday_date FROM `tabHoliday` where holiday_date = CURDATE();"""
|
||||
"""SELECT holiday_date FROM `tabHoliday` where holiday_date = CURRENT_DATE;"""
|
||||
)
|
||||
msg = (
|
||||
"<p>Project Name: "
|
||||
|
||||
@@ -281,7 +281,7 @@ def get_project(doctype, txt, searchfield, start, page_len, filters):
|
||||
%(mcond)s
|
||||
{search_condition}
|
||||
order by name
|
||||
limit %(start)s, %(page_len)s""".format(
|
||||
limit %(page_len)s offset %(start)s""".format(
|
||||
search_columns=search_columns, search_condition=search_cond
|
||||
),
|
||||
{
|
||||
|
||||
@@ -40,7 +40,9 @@ class TestTimesheet(unittest.TestCase):
|
||||
emp = make_employee("test_employee_6@salary.com")
|
||||
|
||||
timesheet = make_timesheet(emp, simulate=True, is_billable=1)
|
||||
sales_invoice = make_sales_invoice(timesheet.name, "_Test Item", "_Test Customer")
|
||||
sales_invoice = make_sales_invoice(
|
||||
timesheet.name, "_Test Item", "_Test Customer", currency="INR"
|
||||
)
|
||||
sales_invoice.due_date = nowdate()
|
||||
sales_invoice.submit()
|
||||
timesheet = frappe.get_doc("Timesheet", timesheet.name)
|
||||
|
||||
@@ -317,7 +317,7 @@ def get_timesheet(doctype, txt, searchfield, start, page_len, filters):
|
||||
ts.status in ('Submitted', 'Payslip') and tsd.parent = ts.name and
|
||||
tsd.docstatus = 1 and ts.total_billable_amount > 0
|
||||
and tsd.parent LIKE %(txt)s {condition}
|
||||
order by tsd.parent limit %(start)s, %(page_len)s""".format(
|
||||
order by tsd.parent limit %(page_len)s offset %(start)s""".format(
|
||||
condition=condition
|
||||
),
|
||||
{
|
||||
@@ -483,7 +483,7 @@ def get_timesheets_list(
|
||||
tsd.project IN %(projects)s
|
||||
)
|
||||
ORDER BY `end_date` ASC
|
||||
LIMIT {0}, {1}
|
||||
LIMIT {1} offset {0}
|
||||
""".format(
|
||||
limit_start, limit_page_length
|
||||
),
|
||||
|
||||
@@ -25,7 +25,7 @@ def query_task(doctype, txt, searchfield, start, page_len, filters):
|
||||
case when `%s` like %s then 0 else 1 end,
|
||||
`%s`,
|
||||
subject
|
||||
limit %s, %s"""
|
||||
limit %s offset %s"""
|
||||
% (searchfield, "%s", "%s", match_conditions, "%s", searchfield, "%s", searchfield, "%s", "%s"),
|
||||
(search_string, search_string, order_by_string, order_by_string, start, page_len),
|
||||
(search_string, search_string, order_by_string, order_by_string, page_len, start),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user