code stringlengths 1 1.05M | repo_name stringlengths 6 83 | path stringlengths 3 242 | language stringclasses 222
values | license stringclasses 20
values | size int64 1 1.05M |
|---|---|---|---|---|---|
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe import _
def execute(filters: dict | None = None) -> tuple:
filters = frappe._dict(filters or {})
columns = get_columns()
data = get_data(filters)
chart = get_chart_dat... | 2302_79757062/hrms | hrms/hr/report/appraisal_overview/appraisal_overview.py | Python | agpl-3.0 | 3,485 |
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["Daily Work Summary Replies"] = {
filters: [
{
fieldname: "group",
label: __("Group"),
fieldtype: "Link",
options: "Daily Work Summary Group"... | 2302_79757062/hrms | hrms/hr/report/daily_work_summary_replies/daily_work_summary_replies.js | JavaScript | agpl-3.0 | 445 |
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe import _
from hrms.hr.doctype.daily_work_summary.daily_work_summary import get_user_emails_from_group
def execute(filters=None):
if not filters.group:
return [], []
c... | 2302_79757062/hrms | hrms/hr/report/daily_work_summary_replies/daily_work_summary_replies.py | Python | agpl-3.0 | 1,611 |
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["Employee Advance Summary"] = {
filters: [
{
fieldname: "employee",
label: __("Employee"),
fieldtype: "Link",
options: "Employee",
width: ... | 2302_79757062/hrms | hrms/hr/report/employee_advance_summary/employee_advance_summary.js | JavaScript | agpl-3.0 | 884 |
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe import _, msgprint
def execute(filters=None):
if not filters:
filters = {}
advances_list = get_advances(filters)
columns = get_columns()
if not advances_list:
ms... | 2302_79757062/hrms | hrms/hr/report/employee_advance_summary/employee_advance_summary.py | Python | agpl-3.0 | 2,386 |
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["Employee Analytics"] = {
filters: [
{
fieldname: "company",
label: __("Company"),
fieldtype: "Link",
options: "Company",
default: frappe.... | 2302_79757062/hrms | hrms/hr/report/employee_analytics/employee_analytics.js | JavaScript | agpl-3.0 | 562 |
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe import _
def execute(filters=None):
if not filters:
filters = {}
if not filters["company"]:
frappe.throw(_("{0} is mandatory").format(_("Company")))
columns = get... | 2302_79757062/hrms | hrms/hr/report/employee_analytics/employee_analytics.py | Python | agpl-3.0 | 2,667 |
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
frappe.query_reports["Employee Birthday"] = {
filters: [
{
fieldname: "month",
label: __("Month"),
fieldtype: "Select",
options: "Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug\nSep\n... | 2302_79757062/hrms | hrms/hr/report/employee_birthday/employee_birthday.js | JavaScript | agpl-3.0 | 729 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
from frappe import _
def execute(filters=None):
if not filters:
filters = {}
columns = get_columns()
data = get_employees(filters)
return columns, data
def get_colum... | 2302_79757062/hrms | hrms/hr/report/employee_birthday/employee_birthday.py | Python | agpl-3.0 | 1,324 |
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["Employee Exits"] = {
filters: [
{
fieldname: "from_date",
label: __("From Date"),
fieldtype: "Date",
default: frappe.datetime.add_months(fra... | 2302_79757062/hrms | hrms/hr/report/employee_exits/employee_exits.js | JavaScript | agpl-3.0 | 1,660 |
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# License: MIT. See LICENSE
from pypika import functions as fn
import frappe
from frappe import _
from frappe.query_builder import Order
from frappe.utils import getdate
def execute(filters=None):
columns = get_columns()
data = get_data(filters)... | 2302_79757062/hrms | hrms/hr/report/employee_exits/employee_exits.py | Python | agpl-3.0 | 6,408 |
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["Employee Hours Utilization Based On Timesheet"] = {
filters: [
{
fieldname: "company",
label: __("Company"),
fieldtype: "Link",
options: "Co... | 2302_79757062/hrms | hrms/hr/report/employee_hours_utilization_based_on_timesheet/employee_hours_utilization_based_on_timesheet.js | JavaScript | agpl-3.0 | 1,036 |
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe import _
from frappe.utils import flt, getdate
def execute(filters=None):
return EmployeeHoursReport(filters).run()
class EmployeeHoursReport:
"""Employee Hours Utiliz... | 2302_79757062/hrms | hrms/hr/report/employee_hours_utilization_based_on_timesheet/employee_hours_utilization_based_on_timesheet.py | Python | agpl-3.0 | 7,628 |
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
frappe.query_reports["Employee Leave Balance"] = {
filters: [
{
fieldname: "from_date",
label: __("From Date"),
fieldtype: "Date",
reqd: 1,
},
{
fieldname: "to_date",
... | 2302_79757062/hrms | hrms/hr/report/employee_leave_balance/employee_leave_balance.js | JavaScript | agpl-3.0 | 1,781 |
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from itertools import groupby
import frappe
from frappe import _
from frappe.utils import add_days, cint, flt, getdate
from hrms.hr.doctype.leave_allocation.leave_allocation import get_previous_all... | 2302_79757062/hrms | hrms/hr/report/employee_leave_balance/employee_leave_balance.py | Python | agpl-3.0 | 7,784 |
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["Employee Leave Balance Summary"] = {
filters: [
{
fieldname: "date",
label: __("Date"),
fieldtype: "Date",
reqd: 1,
default: frappe.datet... | 2302_79757062/hrms | hrms/hr/report/employee_leave_balance_summary/employee_leave_balance_summary.js | JavaScript | agpl-3.0 | 1,080 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
from frappe import _
from hrms.hr.doctype.leave_application.leave_application import get_leave_details
def execute(filters=None):
leave_types = frappe.db.sql_list("select na... | 2302_79757062/hrms | hrms/hr/report/employee_leave_balance_summary/employee_leave_balance_summary.py | Python | agpl-3.0 | 1,773 |
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.query_reports["Employees working on a holiday"] = {
filters: [
{
fieldname: "from_date",
label: __("From Date"),
fieldtype: "Date",
reqd: 1,
default: frappe.datetime.year_st... | 2302_79757062/hrms | hrms/hr/report/employees_working_on_a_holiday/employees_working_on_a_holiday.js | JavaScript | agpl-3.0 | 591 |
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe import _
def execute(filters=None):
if not filters:
filters = {}
columns = get_columns()
data = get_employees(filters)
return columns, data
def get_columns():
re... | 2302_79757062/hrms | hrms/hr/report/employees_working_on_a_holiday/employees_working_on_a_holiday.py | Python | agpl-3.0 | 1,668 |
// Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.query_reports["Leave Ledger"] = {
filters: [
{
fieldname: "from_date",
label: __("From Date"),
fieldtype: "Date",
reqd: 1,
default: frappe.defaults.get_default("year_start_d... | 2302_79757062/hrms | hrms/hr/report/leave_ledger/leave_ledger.js | JavaScript | agpl-3.0 | 2,535 |
# Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe import _
from frappe.query_builder.functions import Date
Filters = frappe._dict
def execute(filters: Filters = None) -> tuple:
columns = get_columns()
data = get_data(fi... | 2302_79757062/hrms | hrms/hr/report/leave_ledger/leave_ledger.py | Python | agpl-3.0 | 4,506 |
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
frappe.query_reports["Monthly Attendance Sheet"] = {
filters: [
{
fieldname: "month",
label: __("Month"),
fieldtype: "Select",
reqd: 1,
options: [
{ value: 1, label: __... | 2302_79757062/hrms | hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.js | JavaScript | agpl-3.0 | 3,060 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from calendar import monthrange
from itertools import groupby
import frappe
from frappe import _
from frappe.query_builder.functions import Count, Extract, Sum
from frappe.utils import cint,... | 2302_79757062/hrms | hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py | Python | agpl-3.0 | 18,920 |
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["Project Profitability"] = {
filters: [
{
fieldname: "company",
label: __("Company"),
fieldtype: "Link",
options: "Company",
default: frap... | 2302_79757062/hrms | hrms/hr/report/project_profitability/project_profitability.js | JavaScript | agpl-3.0 | 1,010 |
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe import _
from frappe.utils import cint, flt
def execute(filters=None):
data = get_data(filters)
columns = get_columns()
charts = get_chart_data(data)
return columns, da... | 2302_79757062/hrms | hrms/hr/report/project_profitability/project_profitability.py | Python | agpl-3.0 | 5,543 |
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["Recruitment Analytics"] = {
filters: [
{
fieldname: "company",
label: __("Company"),
fieldtype: "Link",
options: "Company",
default: frap... | 2302_79757062/hrms | hrms/hr/report/recruitment_analytics/recruitment_analytics.js | JavaScript | agpl-3.0 | 518 |
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe import _
def execute(filters=None):
if not filters:
filters = {}
filters = frappe._dict(filters)
columns = get_columns()
data = get_data(filters)
return columns,... | 2302_79757062/hrms | hrms/hr/report/recruitment_analytics/recruitment_analytics.py | Python | agpl-3.0 | 4,553 |
// Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.query_reports["Shift Attendance"] = {
filters: [
{
fieldname: "from_date",
label: __("From Date"),
fieldtype: "Date",
reqd: 1,
default: frappe.datetime.month_start(),
},
... | 2302_79757062/hrms | hrms/hr/report/shift_attendance/shift_attendance.js | JavaScript | agpl-3.0 | 1,595 |
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from datetime import timedelta
import frappe
from frappe import _
from frappe.utils import cint, flt, format_datetime, format_duration
def execute(filters=None):
columns = get_columns()
data = ge... | 2302_79757062/hrms | hrms/hr/report/shift_attendance/shift_attendance.py | Python | agpl-3.0 | 8,165 |
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.query_reports["Unpaid Expense Claim"] = {
filters: [
{
fieldname: "employee",
label: __("Employee"),
fieldtype: "Link",
options: "Employee",
},
],
};
| 2302_79757062/hrms | hrms/hr/report/unpaid_expense_claim/unpaid_expense_claim.js | JavaScript | agpl-3.0 | 297 |
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe import _
def execute(filters=None):
columns, data = [], []
columns = get_columns()
data = get_unclaimed_expese_claims(filters)
return columns, data
def get_columns()... | 2302_79757062/hrms | hrms/hr/report/unpaid_expense_claim/unpaid_expense_claim.py | Python | agpl-3.0 | 1,300 |
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.query_reports["Vehicle Expenses"] = {
filters: [
{
fieldname: "filter_based_on",
label: __("Filter Based On"),
fieldtype: "Select",
options: ["Fiscal Year", "Date Range"],
de... | 2302_79757062/hrms | hrms/hr/report/vehicle_expenses/vehicle_expenses.js | JavaScript | agpl-3.0 | 1,250 |
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe import _
from frappe.utils import flt
from erpnext.accounts.report.financial_statements import get_period_list
def execute(filters=None):
filters = frappe._dict(filters ... | 2302_79757062/hrms | hrms/hr/report/vehicle_expenses/vehicle_expenses.py | Python | agpl-3.0 | 4,630 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import datetime
import frappe
from frappe import _, qb
from frappe.model.document import Document
from frappe.query_builder import Criterion
from frappe.query_builder.custom import ConstantCo... | 2302_79757062/hrms | hrms/hr/utils.py | Python | agpl-3.0 | 25,711 |
frappe.ready(function () {
// bind events here
});
| 2302_79757062/hrms | hrms/hr/web_form/job_application/job_application.js | JavaScript | agpl-3.0 | 52 |
def get_context(context):
# do your magic here
pass
| 2302_79757062/hrms | hrms/hr/web_form/job_application/job_application.py | Python | agpl-3.0 | 54 |
import click
from hrms.setup import after_install as setup
def after_install():
try:
print("Setting up Frappe HR...")
setup()
click.secho("Thank you for installing Frappe HR!", fg="green")
except Exception as e:
BUG_REPORT_URL = "https://github.com/frappe/hrms/issues/new"
click.secho(
"Installation ... | 2302_79757062/hrms | hrms/install.py | Python | agpl-3.0 | 501 |
import frappe
from frappe import _
from frappe.utils import flt
class AppraisalMixin:
"""Mixin class for common validations in Appraisal doctypes"""
def validate_total_weightage(self, table_name: str, table_label: str) -> None:
if not self.get(table_name):
return
total_weightage = sum(flt(d.per_weightage) ... | 2302_79757062/hrms | hrms/mixins/appraisal.py | Python | agpl-3.0 | 604 |
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe import bold
class PWANotificationsMixin:
"""Mixin class for managing PWA updates"""
def notify_approval_status(self):
"""Send Leave Application & Expense Claim Approval... | 2302_79757062/hrms | hrms/mixins/pwa_notifications.py | Python | agpl-3.0 | 2,389 |
# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import json
import frappe
from frappe import _
from erpnext.accounts.doctype.account.account import get_account_currency
def make_company_fixtures(doc, method=None):
if not frappe.flags.c... | 2302_79757062/hrms | hrms/overrides/company.py | Python | agpl-3.0 | 4,077 |
# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from frappe import _
def get_dashboard_for_employee(data):
data["transactions"].extend(
[
{"label": _("Attendance"), "items": ["Attendance", "Attendance Request", "Employee Checkin"]},... | 2302_79757062/hrms | hrms/overrides/dashboard_overrides.py | Python | agpl-3.0 | 2,291 |
# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
from frappe import _
from frappe.model.naming import set_name_by_naming_series
from frappe.utils import add_years, cint, get_link_to_form, getdate
from erpnext.setup.doctype.emp... | 2302_79757062/hrms | hrms/overrides/employee_master.py | Python | agpl-3.0 | 4,609 |
# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
from frappe.utils import flt, nowdate
import erpnext
from erpnext.accounts.doctype.payment_entry.payment_entry import (
PaymentEntry,
get_bank_cash_account,
get_reference_det... | 2302_79757062/hrms | hrms/overrides/employee_payment_entry.py | Python | agpl-3.0 | 9,626 |
# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
from frappe.query_builder.functions import Max, Min, Sum
from frappe.utils import flt
from erpnext.projects.doctype.project.project import Project
class EmployeeProject(Projec... | 2302_79757062/hrms | hrms/overrides/employee_project.py | Python | agpl-3.0 | 1,965 |
# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from erpnext.projects.doctype.timesheet.timesheet import Timesheet
class EmployeeTimesheet(Timesheet):
def set_status(self):
self.status = {"0": "Draft", "1": "Submitted", "2": "Cancelled... | 2302_79757062/hrms | hrms/overrides/employee_timesheet.py | Python | agpl-3.0 | 532 |
import frappe
from hrms.overrides.company import make_salary_components, run_regional_setup
def execute():
for country in frappe.get_all("Company", pluck="country", distinct=True):
run_regional_setup(country)
make_salary_components(country)
| 2302_79757062/hrms | hrms/patches/post_install/create_country_fixtures.py | Python | agpl-3.0 | 249 |
import frappe
def execute():
frappe.delete_doc("DocType", "Employee Transfer Property", ignore_missing=True)
| 2302_79757062/hrms | hrms/patches/post_install/delete_employee_transfer_property_doctype.py | Python | agpl-3.0 | 112 |
# Copyright (c) 2019, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
def execute():
frappe.db.sql(
"""UPDATE `tabPrint Format`
SET module = 'Payroll'
WHERE name IN ('Salary Slip Based On Timesheet', 'Salary Slip Standard')"""
)
doctypes_moved = [
"Employe... | 2302_79757062/hrms | hrms/patches/post_install/move_doctype_reports_and_notification_from_hr_to_payroll.py | Python | agpl-3.0 | 1,198 |
# Copyright (c) 2019, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
def execute():
data = frappe.db.sql(
"""SELECT *
FROM `tabSingles`
WHERE
doctype = "HR Settings"
AND
field in (
"encrypt_salary_sli... | 2302_79757062/hrms | hrms/patches/post_install/move_payroll_setting_separately_from_hr_settings.py | Python | agpl-3.0 | 791 |
# Copyright (c) 2019, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
def execute():
if not (frappe.db.table_exists("Payroll Period") and frappe.db.table_exists("Taxable Salary Slab")):
return
if frappe.db.a_row_exists("Income Tax Slab"):
return
for doctype i... | 2302_79757062/hrms | hrms/patches/post_install/move_tax_slabs_from_payroll_period_to_income_tax_slab.py | Python | agpl-3.0 | 3,986 |
import frappe
from frappe.model.utils.rename_field import rename_field
def execute():
frappe.reload_doc("hr", "doctype", "hr_settings")
try:
# Rename the field
rename_field("HR Settings", "stop_birthday_reminders", "send_birthday_reminders")
# Reverse the value
old_value = frappe.db.get_single_value("HR S... | 2302_79757062/hrms | hrms/patches/post_install/rename_stop_to_send_birthday_reminders.py | Python | agpl-3.0 | 515 |
import frappe
def execute():
frappe.reload_doc("HR", "doctype", "Leave Allocation")
frappe.reload_doc("HR", "doctype", "Leave Ledger Entry")
frappe.db.sql(
"""
UPDATE `tabLeave Ledger Entry` as lle
SET company = (select company from `tabEmployee` where employee = lle.employee)
WHERE company IS NULL
"""
... | 2302_79757062/hrms | hrms/patches/post_install/set_company_in_leave_ledger_entry.py | Python | agpl-3.0 | 495 |
import frappe
# Set department value based on employee value
def execute():
doctypes_to_update = {
"hr": [
"Appraisal",
"Leave Allocation",
"Expense Claim",
"Salary Slip",
"Attendance",
"Training Feedback",
"Training Result Employee",
"Leave Application",
"Employee Advance",
"Trainin... | 2302_79757062/hrms | hrms/patches/post_install/set_department_for_doctypes.py | Python | agpl-3.0 | 881 |
import frappe
def execute():
frappe.reload_doc("payroll", "doctype", "employee_cost_center")
frappe.reload_doc("payroll", "doctype", "salary_structure_assignment")
employees = frappe.get_all("Employee", fields=["department", "payroll_cost_center", "name"])
employee_cost_center = {}
for d in employees:
cost_c... | 2302_79757062/hrms | hrms/patches/post_install/set_payroll_cost_centers.py | Python | agpl-3.0 | 1,052 |
import frappe
def execute():
PayrollEntry = frappe.qb.DocType("Payroll Entry")
status = (
frappe.qb.terms.Case()
.when(PayrollEntry.docstatus == 0, "Draft")
.when(PayrollEntry.docstatus == 1, "Submitted")
.else_("Cancelled")
)
(frappe.qb.update(PayrollEntry).set("status", status).where(PayrollEntry.stat... | 2302_79757062/hrms | hrms/patches/post_install/set_payroll_entry_status.py | Python | agpl-3.0 | 340 |
import frappe
def execute():
frappe.reload_doc("hr", "doctype", "training_event")
frappe.reload_doc("hr", "doctype", "training_event_employee")
# no need to run the update query as there is no old data
if not frappe.db.exists("Training Event Employee", {"attendance": ("in", ("Mandatory", "Optional"))}):
return... | 2302_79757062/hrms | hrms/patches/post_install/set_training_event_attendance.py | Python | agpl-3.0 | 592 |
import frappe
def execute():
frappe.clear_cache(doctype="Leave Type")
if frappe.db.has_column("Leave Type", "based_on_date_of_joining"):
LeaveType = frappe.qb.DocType("Leave Type")
frappe.qb.update(LeaveType).set(LeaveType.allocate_on_day, "Last Day").where(
(LeaveType.based_on_date_of_joining == 0) & (Leav... | 2302_79757062/hrms | hrms/patches/post_install/update_allocate_on_in_leave_type.py | Python | agpl-3.0 | 697 |
import frappe
def execute():
frappe.reload_doc("hr", "doctype", "employee_advance")
advance = frappe.qb.DocType("Employee Advance")
(
frappe.qb.update(advance)
.set(advance.status, "Returned")
.where(
(advance.docstatus == 1)
& ((advance.return_amount) & (advance.paid_amount == advance.return_amount))... | 2302_79757062/hrms | hrms/patches/post_install/update_employee_advance_status.py | Python | agpl-3.0 | 680 |
import frappe
def execute():
"""
Update Expense Claim status to Paid if:
- the entire required amount is already covered via linked advances
- the claim is partially paid via advances and the rest is reimbursed
"""
ExpenseClaim = frappe.qb.DocType("Expense Claim")
(
frappe.qb.update(Expense... | 2302_79757062/hrms | hrms/patches/post_install/update_expense_claim_status_for_paid_advances.py | Python | agpl-3.0 | 638 |
import frappe
from frappe.model.utils.rename_field import rename_field
from frappe.utils import cstr
def execute():
create_kras()
rename_fields()
update_kra_evaluation_method()
def create_kras():
# A new Link field `key_result_area` was added in the Appraisal Template Goal table
# Old field's (`kra` (Small Tex... | 2302_79757062/hrms | hrms/patches/post_install/update_performance_module_changes.py | Python | agpl-3.0 | 2,226 |
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
import frappe
def execute():
frappe.reload_doc("setup", "doctype", "employee")
if frappe.db.has_column("Employee", "reason_for_resignation"):
frappe.db.sql(
""" UPDATE `tabEmployee`
SET reason_for... | 2302_79757062/hrms | hrms/patches/post_install/update_reason_for_resignation_in_employee.py | Python | agpl-3.0 | 474 |
# Copyright (c) 2019, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
def execute():
frappe.reload_doc("hr", "doctype", "shift_assignment")
if frappe.db.has_column("Shift Assignment", "date"):
frappe.db.sql(
"""update `tabShift Assignment`
set end_d... | 2302_79757062/hrms | hrms/patches/post_install/update_start_end_date_for_old_shift_assignment.py | Python | agpl-3.0 | 433 |
# Copyright (c) 2019, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
from frappe import _
from frappe.model.utils.rename_field import rename_field
def execute():
frappe.reload_doc("payroll", "doctype", "Salary Component Account")
if frappe.db.has_column("Salary Comp... | 2302_79757062/hrms | hrms/patches/post_install/updates_for_multi_currency_payroll.py | Python | agpl-3.0 | 4,054 |
import frappe
def execute():
"""
Add `Expense Claim` to Repost settings
"""
allowed_types = ["Expense Claim"]
repost_settings = frappe.get_doc("Repost Accounting Ledger Settings")
for x in allowed_types:
repost_settings.append("allowed_types", {"document_type": x, "allowed": True})
repost_settings.save()
| 2302_79757062/hrms | hrms/patches/v14_0/add_expense_claim_to_repost_settings.py | Python | agpl-3.0 | 317 |
from frappe.custom.doctype.custom_field.custom_field import create_custom_field
def execute():
create_custom_field(
"Designation",
{
"fieldname": "appraisal_template",
"fieldtype": "Link",
"label": "Appraisal Template",
"options": "Appraisal Template",
"insert_after": "description",
"allow_in_q... | 2302_79757062/hrms | hrms/patches/v14_0/create_custom_field_for_appraisal_template.py | Python | agpl-3.0 | 344 |
from frappe.custom.doctype.custom_field.custom_field import create_custom_field
from hrms.payroll.doctype.salary_slip.salary_slip_loan_utils import if_lending_app_installed
@if_lending_app_installed
def execute():
create_custom_field(
"Loan Repayment",
{
"default": "0",
"depends_on": 'eval:doc.applicant_t... | 2302_79757062/hrms | hrms/patches/v14_0/create_custom_field_in_loan.py | Python | agpl-3.0 | 563 |
import frappe
def execute():
service_items = [
"Brake Oil",
"Brake Pad",
"Clutch Plate",
"Engine Oil",
"Oil Change",
"Wheels",
]
for item in service_items:
doc = frappe.new_doc("Vehicle Service Item")
doc.service_item = item
doc.insert(ignore_permissions=True, ignore_if_duplicate=True)
| 2302_79757062/hrms | hrms/patches/v14_0/create_vehicle_service_item.py | Python | agpl-3.0 | 310 |
from hrms.setup import add_non_standard_user_types
def execute():
add_non_standard_user_types()
| 2302_79757062/hrms | hrms/patches/v14_0/update_ess_user_access.py | Python | agpl-3.0 | 99 |
import frappe
def execute():
if frappe.db.exists("Custom Field", "Loan Repayment-repay_from_salary"):
frappe.db.set_value(
"Custom Field",
"Loan Repayment-repay_from_salary",
{"fetch_from": None, "fetch_if_empty": 0},
)
| 2302_79757062/hrms | hrms/patches/v14_0/update_loan_repayment_repay_from_salary.py | Python | agpl-3.0 | 236 |
import frappe
def execute():
salary_structure = frappe.qb.DocType("Salary Structure")
frappe.qb.update(salary_structure).set(salary_structure.payroll_frequency, "").where(
salary_structure.salary_slip_based_on_timesheet == 1
).run()
| 2302_79757062/hrms | hrms/patches/v14_0/update_payroll_frequency_to_none_if_salary_slip_is_based_on_timesheet.py | Python | agpl-3.0 | 240 |
import frappe
def execute():
if frappe.db.exists("Custom Field", {"name": "Loan Repayment-repay_from_salary"}):
frappe.db.set_value("Custom Field", {"name": "Loan Repayment-repay_from_salary"}, "fetch_if_empty", 1)
if frappe.db.exists("Custom Field", {"name": "Loan Repayment-payroll_payable_account"}):
frappe.... | 2302_79757062/hrms | hrms/patches/v14_0/update_repay_from_salary_and_payroll_payable_account_fields.py | Python | agpl-3.0 | 453 |
import frappe
def execute():
onboarding_template = frappe.qb.DocType("Employee Onboarding Template")
(
frappe.qb.update(onboarding_template)
.set(onboarding_template.title, onboarding_template.designation)
.where(onboarding_template.title.isnull())
).run()
separation_template = frappe.qb.DocType("Employee ... | 2302_79757062/hrms | hrms/patches/v14_0/update_title_in_employee_onboarding_and_separation_templates.py | Python | agpl-3.0 | 506 |
import frappe
from hrms.setup import add_lending_docperms_to_ess, update_user_type_doctype_limit
def execute():
if "lending" in frappe.get_installed_apps():
update_user_type_doctype_limit()
add_lending_docperms_to_ess()
| 2302_79757062/hrms | hrms/patches/v15_0/add_loan_docperms_to_ess.py | Python | agpl-3.0 | 228 |
import click
import frappe
def execute():
frappe_v = frappe.get_attr("frappe" + ".__version__")
hrms_v = frappe.get_attr("hrms" + ".__version__")
WIKI_URL = "https://github.com/frappe/hrms/wiki/Changes-to-branching-and-versioning"
if frappe_v.startswith("14") and hrms_v.startswith("15"):
message = f"""
Th... | 2302_79757062/hrms | hrms/patches/v15_0/check_version_compatibility_with_frappe.py | Python | agpl-3.0 | 708 |
import frappe
def execute():
settings = frappe.get_single("HR Settings")
settings.allow_employee_checkin_from_mobile_app = 1
settings.flags.ignore_mandatory = True
settings.flags.ignore_permissions = True
settings.save()
| 2302_79757062/hrms | hrms/patches/v15_0/enable_allow_checkin_setting.py | Python | agpl-3.0 | 228 |
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
def execute():
custom_fields = {
"Company": [
{
"fieldname": "hr_and_payroll_tab",
"fieldtype": "Tab Break",
"label": "HR & Payroll",
"insert_after": "credit_limit",
},
{
"fieldname": "hr_settings_section"... | 2302_79757062/hrms | hrms/patches/v15_0/make_hr_settings_tab_in_company_master.py | Python | agpl-3.0 | 488 |
from frappe.model.utils.rename_field import rename_field
def execute():
try:
rename_field("Salary Slip Loan", "loan_type", "loan_product")
except Exception as e:
if e.args[0] != 1054:
raise
| 2302_79757062/hrms | hrms/patches/v15_0/migrate_loan_type_to_loan_product.py | Python | agpl-3.0 | 202 |
import frappe
from frappe import _
from frappe.desk.doctype.notification_log.notification_log import make_notification_logs
from frappe.utils.user import get_system_managers
def execute():
if "lending" in frappe.get_installed_apps():
return
if frappe.db.a_row_exists("Salary Slip Loan"):
notify_existing_users()... | 2302_79757062/hrms | hrms/patches/v15_0/notify_about_loan_app_separation.py | Python | agpl-3.0 | 789 |
import frappe
from frappe.model.utils.rename_field import rename_field
def execute():
try:
rename_field("Leave Type", "encashment_threshold_days", "non_encashable_leaves")
except Exception as e:
if e.args[0] != 1054:
raise
if not frappe.db.has_column("Leave Encashment", "encashable_days"):
return
# se... | 2302_79757062/hrms | hrms/patches/v15_0/rename_and_update_leave_encashment_fields.py | Python | agpl-3.0 | 755 |
from frappe.model.utils.rename_field import rename_field
def execute():
try:
rename_field("Shift Type", "enable_entry_grace_period", "enable_late_entry_marking")
rename_field("Shift Type", "enable_exit_grace_period", "enable_early_exit_marking")
except Exception as e:
if e.args[0] != 1054:
raise
| 2302_79757062/hrms | hrms/patches/v15_0/rename_enable_late_entry_early_exit_grace_period.py | Python | agpl-3.0 | 311 |
import frappe
def execute():
FnF = frappe.qb.DocType("Full and Final Asset")
frappe.qb.update(FnF).set(FnF.action, "Return").where((FnF.action.isnull()) | (FnF.action == "")).run()
| 2302_79757062/hrms | hrms/patches/v15_0/set_default_asset_action_in_fnf.py | Python | agpl-3.0 | 185 |
import frappe
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
def execute():
custom_fields = {
"Employee": [
{
"fieldname": "employment_type",
"fieldtype": "Link",
"ignore_user_permissions": 1,
"label": "Employment Type",
"oldfieldname": "employment_type",
... | 2302_79757062/hrms | hrms/patches/v1_0/rearrange_employee_fields.py | Python | agpl-3.0 | 3,754 |
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on("Additional Salary", {
setup: function (frm) {
frm.add_fetch(
"salary_component",
"deduct_full_tax_on_selected_payroll_date",
"deduct_full_tax_on_selected_payroll_date"... | 2302_79757062/hrms | hrms/payroll/doctype/additional_salary/additional_salary.js | JavaScript | agpl-3.0 | 1,882 |
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe import _, bold
from frappe.model.document import Document
from frappe.utils import comma_and, date_diff, formatdate, get_link_to_form, getdate
from hrms.hr.utils import val... | 2302_79757062/hrms | hrms/payroll/doctype/additional_salary/additional_salary.py | Python | agpl-3.0 | 8,987 |
// Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on("Bulk Salary Structure Assignment", {
setup(frm) {
frm.trigger("set_queries");
hrms.setup_employee_filter_group(frm);
},
async refresh(frm) {
frm.page.clear_indicator();
... | 2302_79757062/hrms | hrms/payroll/doctype/bulk_salary_structure_assignment/bulk_salary_structure_assignment.js | JavaScript | agpl-3.0 | 7,130 |
# Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.query_builder.custom import ConstantColumn
from frappe.query_builder.functions import Coalesce
from frappe.que... | 2302_79757062/hrms | hrms/payroll/doctype/bulk_salary_structure_assignment/bulk_salary_structure_assignment.py | Python | agpl-3.0 | 3,723 |
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on("Employee Benefit Application", {
employee: function (frm) {
if (frm.doc.employee) {
frappe.run_serially([
() => frm.trigger("get_employee_currency"),
() => frm.trigg... | 2302_79757062/hrms | hrms/payroll/doctype/employee_benefit_application/employee_benefit_application.js | JavaScript | agpl-3.0 | 3,552 |
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import add_days, cstr, date_diff, flt, getdate, rounded
from hrms.hr.utils import (
get_holiday_dates... | 2302_79757062/hrms | hrms/payroll/doctype/employee_benefit_application/employee_benefit_application.py | Python | agpl-3.0 | 12,662 |
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class EmployeeBenefitApplicationDetail(Document):
pass
| 2302_79757062/hrms | hrms/payroll/doctype/employee_benefit_application_detail/employee_benefit_application_detail.py | Python | agpl-3.0 | 238 |
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on("Employee Benefit Claim", {
setup: function (frm) {
frm.set_query("earning_component", function () {
return {
query: "hrms.payroll.doctype.employee_benefit_application.em... | 2302_79757062/hrms | hrms/payroll/doctype/employee_benefit_claim/employee_benefit_claim.js | JavaScript | agpl-3.0 | 1,005 |
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import flt
from hrms.hr.utils import get_previous_claimed_amount, validate_active_employee
from hrms.p... | 2302_79757062/hrms | hrms/payroll/doctype/employee_benefit_claim/employee_benefit_claim.py | Python | agpl-3.0 | 9,231 |
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class EmployeeCostCenter(Document):
pass
| 2302_79757062/hrms | hrms/payroll/doctype/employee_cost_center/employee_cost_center.py | Python | agpl-3.0 | 223 |
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on("Employee Incentive", {
setup: function (frm) {
frm.set_query("employee", function () {
return {
filters: {
status: "Active",
},
};
});
frm.trigger("set_e... | 2302_79757062/hrms | hrms/payroll/doctype/employee_incentive/employee_incentive.js | JavaScript | agpl-3.0 | 1,526 |
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe import _
from frappe.model.document import Document
from hrms.hr.utils import validate_active_employee
class EmployeeIncentive(Document):
def validate(self):
validate_... | 2302_79757062/hrms | hrms/payroll/doctype/employee_incentive/employee_incentive.py | Python | agpl-3.0 | 1,277 |
// Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on("Employee Other Income", {
// refresh: function(frm) {
// }
});
| 2302_79757062/hrms | hrms/payroll/doctype/employee_other_income/employee_other_income.js | JavaScript | agpl-3.0 | 206 |
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class EmployeeOtherIncome(Document):
pass
| 2302_79757062/hrms | hrms/payroll/doctype/employee_other_income/employee_other_income.py | Python | agpl-3.0 | 225 |
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on("Employee Tax Exemption Category", {
refresh: function (frm) {},
});
| 2302_79757062/hrms | hrms/payroll/doctype/employee_tax_exemption_category/employee_tax_exemption_category.js | JavaScript | agpl-3.0 | 210 |
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from frappe.model.document import Document
class EmployeeTaxExemptionCategory(Document):
pass
| 2302_79757062/hrms | hrms/payroll/doctype/employee_tax_exemption_category/employee_tax_exemption_category.py | Python | agpl-3.0 | 218 |
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on("Employee Tax Exemption Declaration", {
setup: function (frm) {
frm.set_query("employee", function () {
return {
filters: {
status: "Active",
},
};
});
f... | 2302_79757062/hrms | hrms/payroll/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.js | JavaScript | agpl-3.0 | 1,670 |
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe.model.document import Document
from frappe.model.mapper import get_mapped_doc
from frappe.utils import flt
from hrms.hr.utils import (
calculate_annual_eligible_hra_exempt... | 2302_79757062/hrms | hrms/payroll/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.py | Python | agpl-3.0 | 2,499 |