diff --git a/hrms/hr/doctype/employee_attendance_tool/employee_attendance_tool.js b/hrms/hr/doctype/employee_attendance_tool/employee_attendance_tool.js index bca5686c8f..ff6420031f 100644 --- a/hrms/hr/doctype/employee_attendance_tool/employee_attendance_tool.js +++ b/hrms/hr/doctype/employee_attendance_tool/employee_attendance_tool.js @@ -118,7 +118,7 @@ frappe.ui.form.on("Employee Attendance Tool", { data: data, dynamicRowHeight: true, inlineFilters: true, - layout: "fixed", + layout: "fluid", cellHeight: 35, noDataMessage: __("No Data"), disableReorderColumn: true, diff --git a/hrms/hr/doctype/employee_attendance_tool/employee_attendance_tool.json b/hrms/hr/doctype/employee_attendance_tool/employee_attendance_tool.json index d955912fd4..dfcb0543c2 100644 --- a/hrms/hr/doctype/employee_attendance_tool/employee_attendance_tool.json +++ b/hrms/hr/doctype/employee_attendance_tool/employee_attendance_tool.json @@ -21,7 +21,8 @@ "column_break_kecn", "shift", "marked_attendance_section", - "marked_attendance_html" + "marked_attendance_html", + "column_break_khjs" ], "fields": [ { @@ -124,12 +125,16 @@ "fieldtype": "Link", "label": "Shift", "options": "Shift Type" + }, + { + "fieldname": "column_break_khjs", + "fieldtype": "Column Break" } ], "hide_toolbar": 1, "issingle": 1, "links": [], - "modified": "2024-03-27 13:09:37.447557", + "modified": "2024-07-08 20:02:36.408240", "modified_by": "Administrator", "module": "HR", "name": "Employee Attendance Tool", diff --git a/hrms/hr/doctype/interview/interview.js b/hrms/hr/doctype/interview/interview.js index b65758a608..7586e7fe68 100644 --- a/hrms/hr/doctype/interview/interview.js +++ b/hrms/hr/doctype/interview/interview.js @@ -23,60 +23,64 @@ frappe.ui.form.on("Interview", { ]); }, - add_custom_buttons: function (frm) { - if (frm.doc.docstatus != 2 && !frm.doc.__islocal) { - if (frm.doc.status === "Pending") { - frm.add_custom_button( - __("Reschedule Interview"), - function () { - frm.events.show_reschedule_dialog(frm); - frm.refresh(); - }, - __("Actions"), - ); - } + add_custom_buttons: async function (frm) { + if (frm.doc.docstatus === 2 || frm.doc.__islocal) return; - const allow_feedback_submission = frm.doc.interview_details.some( - (interviewer) => interviewer.interviewer === frappe.session.user, + if (frm.doc.status === "Pending") { + frm.add_custom_button( + __("Reschedule Interview"), + function () { + frm.events.show_reschedule_dialog(frm); + frm.refresh(); + }, + __("Actions"), ); + } - frappe.db.get_value( - "Interview Feedback", - { - interviewer: frappe.session.user, - interview: frm.doc.name, - docstatus: 1, - }, - "name", - (r) => { - if (Object.keys(r).length === 0) { - const button = frm.add_custom_button(__("Submit Feedback"), function () { - frappe.call({ - method: "hrms.hr.doctype.interview.interview.get_expected_skill_set", - args: { - interview_round: frm.doc.interview_round, - }, - callback: function (r) { - frm.events.show_feedback_dialog(frm, r.message); - frm.refresh(); - }, - }); - }); + const has_submitted_feedback = await frappe.db.get_value( + "Interview Feedback", + { + interviewer: frappe.session.user, + interview: frm.doc.name, + docstatus: ("!=", 2), + }, + "name", + )?.message?.name; - if (allow_feedback_submission) { - button.addClass("btn-primary"); - } else { - button - .prop("disabled", true) - .attr("title", __("Only interviewers can submit feedback")) - .tooltip({ delay: { show: 600, hide: 100 }, trigger: "hover" }); - } - } - }, - ); + if (has_submitted_feedback) return; + + const allow_feedback_submission = frm.doc.interview_details.some( + (interviewer) => interviewer.interviewer === frappe.session.user, + ); + + if (allow_feedback_submission) { + frm.page.set_primary_action(__("Submit Feedback"), () => { + frm.trigger("submit_feedback"); + }); + } else { + const button = frm.add_custom_button(__("Submit Feedback"), () => { + frm.trigger("submit_feedback"); + }); + button + .prop("disabled", true) + .attr("title", __("Only interviewers can submit feedback")) + .tooltip({ delay: { show: 600, hide: 100 }, trigger: "hover" }); } }, + submit_feedback: function (frm) { + frappe.call({ + method: "hrms.hr.doctype.interview.interview.get_expected_skill_set", + args: { + interview_round: frm.doc.interview_round, + }, + callback: function (r) { + frm.events.show_feedback_dialog(frm, r.message); + frm.refresh(); + }, + }); + }, + show_reschedule_dialog: function (frm) { let d = new frappe.ui.Dialog({ title: "Reschedule Interview", diff --git a/hrms/hr/doctype/job_offer/job_offer.json b/hrms/hr/doctype/job_offer/job_offer.json index e3d0fb3a93..85c420ac81 100644 --- a/hrms/hr/doctype/job_offer/job_offer.json +++ b/hrms/hr/doctype/job_offer/job_offer.json @@ -76,6 +76,8 @@ "reqd": 1 }, { + "fetch_from": "job_applicant.designation", + "fetch_if_empty": 1, "fieldname": "designation", "fieldtype": "Link", "in_list_view": 1, @@ -167,7 +169,7 @@ ], "is_submittable": 1, "links": [], - "modified": "2024-03-27 13:09:57.574961", + "modified": "2024-07-08 15:53:30.761581", "modified_by": "Administrator", "module": "HR", "name": "Job Offer", diff --git a/hrms/hr/doctype/leave_control_panel/leave_control_panel.js b/hrms/hr/doctype/leave_control_panel/leave_control_panel.js index 3fc8ffc85c..074806b8b8 100644 --- a/hrms/hr/doctype/leave_control_panel/leave_control_panel.js +++ b/hrms/hr/doctype/leave_control_panel/leave_control_panel.js @@ -185,30 +185,12 @@ frappe.ui.form.on("Leave Control Panel", { if (is_checked) selected_employees.push(frm.employees_datatable.datamanager.data[idx].employee); }); - frm.call({ - method: "allocate_leave", - doc: frm.doc, - args: { - employees: selected_employees, - }, - freeze: true, - freeze_message: __("Allocating Leave"), - }).then((r) => { - // don't refresh on complete failure - if (r.message.failed && !r.message.success) return; - frm.refresh(); - }); hrms.validate_mandatory_fields(frm, selected_employees); - frm.events.show_confirm_dialog(frm, selected_employees); - }, - show_confirm_dialog(frm, selected_employees) { frappe.confirm( - __("Allocate Leave to {0} employee(s)?", [selected_employees.length]), - () => { - frm.events.bulk_allocate_leave(frm, selected_employees); - }, + __("Allocate leaves to {0} employee(s)?", [selected_employees.length]), + () => frm.events.bulk_allocate_leave(frm, selected_employees), ); }, @@ -221,6 +203,10 @@ frappe.ui.form.on("Leave Control Panel", { }, freeze: true, freeze_message: __("Allocating Leave"), + }).then((r) => { + // don't refresh on complete failure + if (r.message.failed && !r.message.success) return; + frm.refresh(); }); }, }); diff --git a/hrms/payroll/doctype/bulk_salary_structure_assignment/bulk_salary_structure_assignment.js b/hrms/payroll/doctype/bulk_salary_structure_assignment/bulk_salary_structure_assignment.js index a786e34cee..f07fde30e5 100644 --- a/hrms/payroll/doctype/bulk_salary_structure_assignment/bulk_salary_structure_assignment.js +++ b/hrms/payroll/doctype/bulk_salary_structure_assignment/bulk_salary_structure_assignment.js @@ -197,7 +197,7 @@ frappe.ui.form.on("Bulk Salary Structure Assignment", { __(d), function () { const dialog = new frappe.ui.Dialog({ - title: __("Set {0} for Selected Employees", [__(d)]), + title: __("Set {0} for selected employees", [__(d)]), fields: [ { label: __(d), diff --git a/hrms/payroll/doctype/bulk_salary_structure_assignment/bulk_salary_structure_assignment.json b/hrms/payroll/doctype/bulk_salary_structure_assignment/bulk_salary_structure_assignment.json index 20fc55b362..4b3e41ae49 100644 --- a/hrms/payroll/doctype/bulk_salary_structure_assignment/bulk_salary_structure_assignment.json +++ b/hrms/payroll/doctype/bulk_salary_structure_assignment/bulk_salary_structure_assignment.json @@ -108,10 +108,12 @@ "label": "Employees HTML" }, { + "fetch_from": "salary_structure.company", "fieldname": "company", "fieldtype": "Link", "label": "Company", "options": "Company", + "read_only": 1, "reqd": 1 }, { @@ -145,7 +147,7 @@ "hide_toolbar": 1, "issingle": 1, "links": [], - "modified": "2024-03-27 13:06:42.973162", + "modified": "2024-07-09 19:33:40.135057", "modified_by": "Administrator", "module": "Payroll", "name": "Bulk Salary Structure Assignment", diff --git a/hrms/payroll/doctype/payroll_entry/payroll_entry.py b/hrms/payroll/doctype/payroll_entry/payroll_entry.py index 963c661ba5..997e9224c6 100644 --- a/hrms/payroll/doctype/payroll_entry/payroll_entry.py +++ b/hrms/payroll/doctype/payroll_entry/payroll_entry.py @@ -1421,13 +1421,17 @@ def show_payroll_submission_status(submitted, unsubmitted, payroll_entry): frappe.msgprint( _("Salary Slips submitted for period from {0} to {1}").format( payroll_entry.start_date, payroll_entry.end_date - ) + ), + title=_("Success"), + indicator="green", ) elif unsubmitted: frappe.msgprint( _("Could not submit some Salary Slips: {}").format( ", ".join(get_link_to_form("Salary Slip", entry) for entry in unsubmitted) - ) + ), + title=_("Failure"), + indicator="red", ) diff --git a/hrms/payroll/doctype/salary_slip/salary_slip.py b/hrms/payroll/doctype/salary_slip/salary_slip.py index 98fb01ecb0..2a96e99a65 100644 --- a/hrms/payroll/doctype/salary_slip/salary_slip.py +++ b/hrms/payroll/doctype/salary_slip/salary_slip.py @@ -560,7 +560,11 @@ def get_payment_days(self, include_holidays_in_total_working_days): if self.relieving_date: employee_status = frappe.db.get_value("Employee", self.employee, "status") if self.relieving_date < getdate(self.start_date) and employee_status != "Left": - frappe.throw(_("Employee relieved on {0} must be set as 'Left'").format(self.relieving_date)) + frappe.throw( + _("Employee {0} relieved on {1} must be set as 'Left'").format( + get_link_to_form("Employee", self.employee), formatdate(self.relieving_date) + ) + ) payment_days = date_diff(self.actual_end_date, self.actual_start_date) + 1