This commit is contained in:
Rushabh Mehta
2013-05-09 11:42:35 +05:30
70 changed files with 865 additions and 241 deletions

View File

@@ -152,7 +152,7 @@ class DocType(TransactionBase):
d.e_modified_amount = round(flt(d.e_amount)*flt(self.doc.payment_days)/cint(self.doc.total_days_in_month), 2)
elif not self.doc.payment_days:
d.e_modified_amount = 0
self.doc.gross_pay += d.e_modified_amount
self.doc.gross_pay += flt(d.e_modified_amount)
def calculate_ded_total(self):
"""
@@ -165,7 +165,7 @@ class DocType(TransactionBase):
elif not self.doc.payment_days:
d.d_modified_amount = 0
self.doc.total_deduction += d.d_modified_amount
self.doc.total_deduction += flt(d.d_modified_amount)
def calculate_net_pay(self):
"""

View File

@@ -169,6 +169,14 @@ wn.module_page["HR"] = [
"label":wn._("Employee Leave Balance"),
route: "query-report/Employee Leave Balance"
},
{
"label":wn._("Employee Birthday"),
route: "query-report/Employee Birthday"
},
{
"label":wn._("Employee Information"),
route: "Report2/Employee/Employee Information"
},
]
}
];

View File

View File

@@ -0,0 +1,19 @@
wn.query_reports["Employee Birthday"] = {
"filters": [
{
"fieldname":"month",
"label": "Month",
"fieldtype": "Select",
"options": "Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug\nSep\nOct\nNov\nDec",
"default": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov",
"Dec"][wn.datetime.str_to_obj(wn.datetime.get_today()).getMonth()],
},
{
"fieldname":"company",
"label": "Company",
"fieldtype": "Link",
"options": "Company",
"default": wn.defaults.get_user_default("company")
}
]
}

View File

@@ -0,0 +1,50 @@
# ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from __future__ import unicode_literals
import webnotes
from webnotes.utils import flt
def execute(filters=None):
if not filters: filters = {}
columns = get_columns()
data = get_employees(filters)
return columns, data
def get_columns():
return [
"Employee:Link/Employee:120", "Date of Birth:Date:100", "Branch:Link/Branch:120",
"Department:Link/Department:120", "Designation:Link/Designation:120", "Gender::60",
"Company:Link/Company:120"
]
def get_employees(filters):
conditions = get_conditions(filters)
return webnotes.conn.sql("""select name, date_of_birth, branch, department, designation,
gender, company from tabEmployee where status = 'Active' %s""" % conditions, as_list=1)
def get_conditions(filters):
conditions = ""
if filters.get("month"):
month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov",
"Dec"].index(filters["month"]) + 1
conditions += " and month(date_of_birth) = '%s'" % month
if filters.get("company"): conditions += " and company = '%s'" % filters["company"]
return conditions

View File

@@ -0,0 +1,21 @@
[
{
"creation": "2013-05-06 17:56:03",
"docstatus": 0,
"modified": "2013-05-06 17:56:03",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Report",
"is_standard": "Yes",
"name": "__common__",
"ref_doctype": "Employee",
"report_name": "Employee Birthday",
"report_type": "Script Report"
},
{
"doctype": "Report",
"name": "Employee Birthday"
}
]

View File

@@ -0,0 +1,22 @@
[
{
"creation": "2013-05-06 18:43:53",
"docstatus": 0,
"modified": "2013-05-06 18:47:43",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Report",
"is_standard": "Yes",
"json": "{\"filters\":[],\"columns\":[[\"name\",\"Employee\"],[\"employee_number\",\"Employee\"],[\"date_of_joining\",\"Employee\"],[\"branch\",\"Employee\"],[\"department\",\"Employee\"],[\"designation\",\"Employee\"],[\"gender\",\"Employee\"],[\"status\",\"Employee\"],[\"company\",\"Employee\"],[\"employment_type\",\"Employee\"],[\"grade\",\"Employee\"],[\"reports_to\",\"Employee\"],[\"company_email\",\"Employee\"]],\"sort_by\":\"Employee.bank_ac_no\",\"sort_order\":\"desc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}",
"name": "__common__",
"ref_doctype": "Employee",
"report_name": "Employee Information",
"report_type": "Report Builder"
},
{
"doctype": "Report",
"name": "Employee Information"
}
]