Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
commit
b4be22b3a4
@ -49,7 +49,7 @@ class DocType:
|
|||||||
emp_query = "select name from `tabEmployee` "
|
emp_query = "select name from `tabEmployee` "
|
||||||
if flag == 1:
|
if flag == 1:
|
||||||
emp_query += condition
|
emp_query += condition
|
||||||
e = sql(emp_query)
|
e = sql(emp_query, debug=1)
|
||||||
return e
|
return e
|
||||||
|
|
||||||
# ----------------
|
# ----------------
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
leave_types = sql("""
|
leave_types = sql("""
|
||||||
SELECT name FROM `tabLeave Type`
|
SELECT name FROM `tabLeave Type`
|
||||||
WHERE
|
WHERE
|
||||||
@ -57,7 +58,7 @@ try:
|
|||||||
if d[3] in colnames:
|
if d[3] in colnames:
|
||||||
# If exists, then append the leave type data
|
# If exists, then append the leave type data
|
||||||
if exists:
|
if exists:
|
||||||
res[ind][colnames.index(d[3])] = d[4] - d[5]
|
res[ind][colnames.index(d[3])] = flt(d[4]) - flt(d[5])
|
||||||
res[ind][len(colnames)-1] = sum(res[ind][3:-1])
|
res[ind][len(colnames)-1] = sum(res[ind][3:-1])
|
||||||
# Else create a new row in res
|
# Else create a new row in res
|
||||||
else:
|
else:
|
||||||
@ -65,7 +66,7 @@ try:
|
|||||||
new_row[0] = d[0]
|
new_row[0] = d[0]
|
||||||
new_row[1] = d[1]
|
new_row[1] = d[1]
|
||||||
new_row[2] = d[2]
|
new_row[2] = d[2]
|
||||||
new_row[colnames.index(d[3])] = d[4] - d[5]
|
new_row[colnames.index(d[3])] = flt(d[4]) - flt(d[5])
|
||||||
new_row[len(colnames)-1] = sum(new_row[3:-1])
|
new_row[len(colnames)-1] = sum(new_row[3:-1])
|
||||||
res.append(new_row)
|
res.append(new_row)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
|
@ -6,14 +6,13 @@ SELECT
|
|||||||
leave_alloc.total_leaves_allocated AS 'total_leaves_allocated',
|
leave_alloc.total_leaves_allocated AS 'total_leaves_allocated',
|
||||||
SUM(leave_app.total_leave_days) AS 'total_leaves_applied'
|
SUM(leave_app.total_leave_days) AS 'total_leaves_applied'
|
||||||
FROM
|
FROM
|
||||||
`tabLeave Allocation` AS leave_alloc,
|
`tabLeave Allocation` AS leave_alloc LEFT JOIN `tabLeave Application` AS leave_app
|
||||||
`tabLeave Application` AS leave_app
|
ON leave_alloc.employee=leave_app.employee AND
|
||||||
WHERE
|
|
||||||
leave_alloc.employee=leave_app.employee AND
|
|
||||||
leave_alloc.leave_type=leave_app.leave_type AND
|
leave_alloc.leave_type=leave_app.leave_type AND
|
||||||
leave_alloc.fiscal_year=leave_app.fiscal_year AND
|
leave_alloc.fiscal_year=leave_app.fiscal_year AND
|
||||||
leave_alloc.docstatus=1 AND
|
leave_app.docstatus=1
|
||||||
leave_app.docstatus=1 AND
|
WHERE
|
||||||
|
leave_alloc.docstatus=1 AND
|
||||||
leave_alloc.fiscal_year LIKE '%(fiscal_year)s%%' AND
|
leave_alloc.fiscal_year LIKE '%(fiscal_year)s%%' AND
|
||||||
leave_alloc.employee_name LIKE '%(employee_name)s%%'
|
leave_alloc.employee_name LIKE '%(employee_name)s%%'
|
||||||
GROUP BY
|
GROUP BY
|
||||||
|
Loading…
x
Reference in New Issue
Block a user