Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hrms/hr/doctype/job_applicant/job_applicant.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ class JobApplicant(Document):
# end: auto-generated types

def onload(self):
job_offer = frappe.get_all("Job Offer", filters={"job_applicant": self.name})
job_offer = frappe.get_all("Job Offer", filters={"job_applicant": self.name, "docstatus": ["!=", 2]})
if job_offer:
self.get("__onload").job_offer = job_offer[0].name
self.set_onload("job_offer", job_offer[0].name)

employee = frappe.db.get_value("Employee", {"job_applicant": self.name}, "name") or ""
self.set_onload("employee", employee)
Expand Down
18 changes: 18 additions & 0 deletions hrms/hr/doctype/job_applicant/test_job_applicant.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,24 @@


class TestJobApplicant(HRMSTestSuite):
def test_onload_filters_out_cancelled_job_offer(self):
applicant = create_job_applicant()
job_offer = create_job_offer(job_applicant=applicant.name)
job_offer.submit()
job_offer.cancel()

applicant.onload()
onload = applicant.get("__onload") or {}
self.assertNotIn("job_offer", onload)

# positive case: active job offer should be loaded
active_job_offer = create_job_offer(job_applicant=applicant.name)
active_job_offer.submit()

applicant.onload()
onload = applicant.get("__onload") or {}
self.assertEqual(onload.get("job_offer"), active_job_offer.name)

def test_job_applicant_naming(self):
applicant = frappe.get_doc(
{
Expand Down
3 changes: 2 additions & 1 deletion hrms/hr/print_format/job_offer/job_offer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
"html": "{% set terms_exist = doc.terms and (doc.terms|striptags).strip() or \"\" %}\n\n{% if letter_head and not no_letterhead -%}\n <div class=\"letter-head\">{{ letter_head }}</div>\n <hr>\n{%- endif %}\n\n<div {% if terms_exist -%} class=\"page-break\" {%- endif %}>\n<p>\n\n<!-- job offer content starts here, <br> is used to create new lines -->\nDate: {{ doc.offer_date }}\n<br><br>\n\nDear {{ doc.applicant_name }}, \n\n<br><br>\n\nWe are pleased to appoint you in the services of {{ doc.company }} on the terms and conditions detailed in this letter.\n\n<br><br>\n\nYour designation shall be <b>{{ doc.designation }}</b>.\n\n<br><br>\n\n<!-- job offer terms and description from the table -->\n\n{%- if doc.offer_terms -%}\n {%- for row in doc.offer_terms -%}\n <b>{{ row.offer_term }}:</b> {{ row.value }}\n\n <br>\n {%- endfor -%}\n{%- endif -%}\n\n<br>\n\n<!-- job offer content continues -->\n\n\nPlease read the detailed terms as below. If you have any queries, feel free to get in touch with us.\nWe look forward to your long and fruitful career association with our organisation.\nIf you decide to join us, 'Welcome to {{ doc.company }} !'\n\n<br><br>\n\n<p class=\"strong\">\n\nYours truly,\n\n<br><br><br><br>\n\nAuthorized Signatory\n\n<br>\n\n{{ doc.company }}\n\n<!-- job offer content ends here -->\n\n</p>\n</div>\n\n<!-- job offer terms and conditions -->\n{% if terms_exist %}\n<div> {{ doc.terms }} </div>\n{% endif %}",
"idx": 0,
"line_breaks": 0,
"modified": "2018-02-15 03:03:55.844085",
"modified": "2026-08-13 23:59:20.941649",
"modified_by": "Administrator",
"module": "HR",
"name": "Job Offer",
"owner": "Administrator",
"print_format_builder": 0,
"print_format_for": "DocType",
"print_format_type": "Jinja",
"show_section_headings": 0,
"standard": "Yes"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
"font": "Default",
"idx": 0,
"line_breaks": 0,
"modified": "2020-01-21 17:24:16.705082",
"modified": "2026-08-13 23:59:20.941649",
"modified_by": "Administrator",
"module": "HR",
"name": "Standard Appointment Letter",
"owner": "Administrator",
"print_format_builder": 0,
"print_format_for": "DocType",
"print_format_type": "Jinja",
"raw_printing": 0,
"show_section_headings": 0,
Expand Down
11 changes: 11 additions & 0 deletions hrms/hr/report/appraisal_overview/appraisal_overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ frappe.query_reports["Appraisal Overview"] = {
options: "Company",
reqd: 1,
default: frappe.defaults.get_user_default("Company"),
on_change: (report) => {
frappe.query_report.set_filter_value("employee", "");
report.refresh();
},
},
{
fieldname: "appraisal_cycle",
Expand All @@ -23,6 +27,13 @@ frappe.query_reports["Appraisal Overview"] = {
fieldtype: "Link",
label: __("Employee"),
options: "Employee",
get_query: () => {
return {
filters: {
company: frappe.query_report.get_filter_value("company"),
},
};
},
},
{
fieldname: "department",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ frappe.query_reports["Employee Advance Summary"] = {
fieldtype: "Link",
options: "Employee",
width: "80",
get_query: () => {
return {
filters: {
company: frappe.query_report.get_filter_value("company"),
},
};
},
},
{
fieldname: "from_date",
Expand All @@ -31,6 +38,10 @@ frappe.query_reports["Employee Advance Summary"] = {
options: "Company",
default: frappe.defaults.get_user_default("Company"),
reqd: 1,
on_change: (report) => {
frappe.query_report.set_filter_value("employee", "");
report.refresh();
},
},
{
fieldname: "status",
Expand Down
21 changes: 21 additions & 0 deletions hrms/hr/report/employee_exits/employee_exits.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ frappe.query_reports["Employee Exits"] = {
label: __("Company"),
fieldtype: "Link",
options: "Company",
on_change: (report) => {
frappe.query_report.set_filter_value({
employee: "",
reports_to: "",
});
report.refresh();
},
},
{
fieldname: "department",
Expand All @@ -39,12 +46,26 @@ frappe.query_reports["Employee Exits"] = {
label: __("Employee"),
fieldtype: "Link",
options: "Employee",
get_query: () => {
return {
filters: {
company: frappe.query_report.get_filter_value("company"),
},
};
},
},
{
fieldname: "reports_to",
label: __("Reports To"),
fieldtype: "Link",
options: "Employee",
get_query: () => {
return {
filters: {
company: frappe.query_report.get_filter_value("company"),
},
};
},
},
{
fieldname: "interview_status",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ frappe.query_reports["Employee Hours Utilization Based On Timesheet"] = {
options: "Company",
default: frappe.defaults.get_user_default("Company"),
reqd: 1,
on_change: (report) => {
frappe.query_report.set_filter_value("employee", "");
report.refresh();
},
},
{
fieldname: "from_date",
Expand All @@ -31,6 +35,13 @@ frappe.query_reports["Employee Hours Utilization Based On Timesheet"] = {
label: __("Employee"),
fieldtype: "Link",
options: "Employee",
get_query: () => {
return {
filters: {
company: frappe.query_report.get_filter_value("company"),
},
};
},
},
{
fieldname: "department",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,23 @@ frappe.query_reports["Employee Leave Balance Summary"] = {
options: "Company",
reqd: 1,
default: frappe.defaults.get_user_default("Company"),
on_change: (report) => {
frappe.query_report.set_filter_value("employee", "");
report.refresh();
},
},
{
fieldname: "employee",
label: __("Employee"),
fieldtype: "Link",
options: "Employee",
get_query: () => {
return {
filters: {
company: frappe.query_report.get_filter_value("company"),
},
};
},
},
{
fieldname: "department",
Expand Down
11 changes: 11 additions & 0 deletions hrms/hr/report/leave_ledger/leave_ledger.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ frappe.query_reports["Leave Ledger"] = {
label: __("Employee"),
fieldtype: "Link",
options: "Employee",
get_query: () => {
return {
filters: {
company: frappe.query_report.get_filter_value("company"),
},
};
},
},
{
fieldname: "status",
Expand All @@ -48,6 +55,10 @@ frappe.query_reports["Leave Ledger"] = {
fieldtype: "Link",
options: "Company",
default: frappe.defaults.get_user_default("Company"),
on_change: (report) => {
frappe.query_report.set_filter_value("employee", "");
report.refresh();
},
},
{
fieldname: "department",
Expand Down
11 changes: 11 additions & 0 deletions hrms/hr/report/project_profitability/project_profitability.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ frappe.query_reports["Project Profitability"] = {
options: "Company",
default: frappe.defaults.get_user_default("Company"),
reqd: 1,
on_change: (report) => {
frappe.query_report.set_filter_value("employee", "");
report.refresh();
},
},
{
fieldname: "start_date",
Expand All @@ -37,6 +41,13 @@ frappe.query_reports["Project Profitability"] = {
label: __("Employee"),
fieldtype: "Link",
options: "Employee",
get_query: () => {
return {
filters: {
company: frappe.query_report.get_filter_value("company"),
},
};
},
},
{
fieldname: "project",
Expand Down
11 changes: 11 additions & 0 deletions hrms/hr/report/shift_attendance/shift_attendance.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ frappe.query_reports["Shift Attendance"] = {
label: __("Employee"),
fieldtype: "Link",
options: "Employee",
get_query: () => {
return {
filters: {
company: frappe.query_report.get_filter_value("company"),
},
};
},
},
{
fieldname: "shift",
Expand All @@ -42,6 +49,10 @@ frappe.query_reports["Shift Attendance"] = {
options: "Company",
reqd: 1,
default: frappe.defaults.get_user_default("Company"),
on_change: (report) => {
frappe.query_report.set_filter_value("employee", "");
report.refresh();
},
},
{
fieldname: "late_entry",
Expand Down
9 changes: 9 additions & 0 deletions hrms/payroll/doctype/additional_salary/additional_salary.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ frappe.ui.form.on("Additional Salary", {
});
},

is_recurring: function (frm) {
if (frm.doc.is_recurring) {
frm.set_value("payroll_date", null);
} else {
frm.set_value("from_date", null);
frm.set_value("to_date", null);
}
},

salary_component: function (frm) {
if (!frm.doc.ref_doctype) {
frm.trigger("get_salary_component_amount");
Expand Down
5 changes: 4 additions & 1 deletion hrms/payroll/doctype/additional_salary/additional_salary.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ class AdditionalSalary(Document):
# end: auto-generated types

def before_validate(self):
if self.payroll_date and self.is_recurring:
if self.is_recurring:
self.payroll_date = None
else:
self.from_date = None
self.to_date = None

def on_submit(self):
self.update_employee_referral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
"font": "Default",
"format_data": "[{\"fieldname\": \"print_heading_template\", \"fieldtype\": \"HTML\", \"options\": \" <h3 style=\\\"text-align: right;\\\">{{doc.name}}</h3><div><hr></div> \"}, {\"fieldtype\": \"Section Break\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"employee\"}, {\"print_hide\": 0, \"fieldname\": \"employee_name\"}, {\"print_hide\": 0, \"fieldname\": \"department\"}, {\"print_hide\": 0, \"fieldname\": \"designation\"}, {\"print_hide\": 0, \"fieldname\": \"branch\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"start_date\"}, {\"print_hide\": 0, \"fieldname\": \"end_date\"}, {\"print_hide\": 0, \"fieldname\": \"total_working_hours\"}, {\"print_hide\": 0, \"fieldname\": \"hour_rate\"}, {\"fieldtype\": \"Section Break\"}, {\"fieldtype\": \"Column Break\"}, {\"visible_columns\": [{\"print_hide\": 0, \"fieldname\": \"time_sheet\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"working_hours\", \"print_width\": \"\"}], \"print_hide\": 0, \"fieldname\": \"timesheets\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Section Break\"}, {\"fieldtype\": \"Column Break\"}, {\"visible_columns\": [{\"print_hide\": 0, \"fieldname\": \"salary_component\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"depends_on_payment_days\", \"print_width\": \"\"}], \"print_hide\": 0, \"fieldname\": \"earnings\"}, {\"fieldtype\": \"Column Break\"}, {\"visible_columns\": [{\"print_hide\": 0, \"fieldname\": \"salary_component\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"depends_on_payment_days\", \"print_width\": \"\"}], \"print_hide\": 0, \"fieldname\": \"deductions\"}, {\"fieldtype\": \"Section Break\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"gross_pay\"}, {\"print_hide\": 0, \"fieldname\": \"total_deduction\"}, {\"print_hide\": 0, \"fieldname\": \"net_pay\"}, {\"print_hide\": 0, \"fieldname\": \"rounded_total\"}, {\"print_hide\": 0, \"fieldname\": \"total_in_words\"}]",
"idx": 0,
"modified": "2016-08-21 21:02:59.896033",
"modified": "2026-08-14 01:00:28.515726",
"modified_by": "Administrator",
"module": "Payroll",
"name": "Salary Slip based on Timesheet",
"owner": "Administrator",
"print_format_builder": 1,
"print_format_for": "DocType",
"print_format_type": "Jinja",
"standard": "Yes"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
"line_breaks": 0,
"modified": "2026-08-25 12:24:25.294340",
"modified_by": "Administrator",
"module": "HR",
"module": "Payroll",
"name": "Salary Slip Standard",
"owner": "Administrator",
"print_format_builder": 1,
"print_format_for": "DocType",
"print_format_type": "Jinja",
"show_section_headings": 0,
"standard": "Yes"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"name": "Salary Slip with Year to Date",
"owner": "Administrator",
"print_format_builder": 0,
"print_format_for": "DocType",
"print_format_type": "Jinja",
"raw_printing": 0,
"show_section_headings": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ frappe.query_reports["Income Tax Computation"] = {
default: frappe.defaults.get_user_default("Company"),
width: "90px",
reqd: 1,
on_change: (report) => {
frappe.query_report.set_filter_value("employee", "");
report.refresh();
},
},
{
fieldname: "payroll_period",
Expand All @@ -27,6 +31,13 @@ frappe.query_reports["Income Tax Computation"] = {
fieldtype: "Link",
options: "Employee",
width: "90px",
get_query: () => {
return {
filters: {
company: frappe.query_report.get_filter_value("company"),
},
};
},
},
{
fieldname: "department",
Expand Down
11 changes: 11 additions & 0 deletions hrms/payroll/report/salary_register/salary_register.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ frappe.query_reports["Salary Register"] = {
fieldtype: "Link",
options: "Employee",
width: "100px",
get_query: () => {
return {
filters: {
company: frappe.query_report.get_filter_value("company"),
},
};
},
},
{
fieldname: "company",
Expand All @@ -42,6 +49,10 @@ frappe.query_reports["Salary Register"] = {
default: frappe.defaults.get_user_default("Company"),
width: "100px",
reqd: 1,
on_change: (report) => {
frappe.query_report.set_filter_value("employee", "");
report.refresh();
},
},
{
fieldname: "docstatus",
Expand Down
Loading