-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add new Doctype Bulk Leave Application (DRC-148) #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
MarcCon
wants to merge
18
commits into
version-15
Choose a base branch
from
drc-148
base: version-15
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
ec6b11c
feat: new bulk leave application doctype (drc-148)
MarcCon cd58815
fix: linter
MarcCon 3680fad
feat: add permissons
MarcCon 5f8f58d
fix: doctype fields changes
MarcCon 92cf635
feat: create leave application when approved
MarcCon 1dc2f86
feat: weekly off dates get added to table
MarcCon b3b13e3
feat: add from date and to date in child table
MarcCon d8a433b
fix(Bulk Leave Application): adjust permissions
PatrickDEissler c857107
feat: re-add to_date to grid view
PatrickDEissler cd10aaf
feat: set Leave Approver and limit options to valid approvers only
PatrickDEissler 5eab494
feat: adjust list view and general form styling
PatrickDEissler fcfc0fd
fix: adjust process (similiar to Leave Application = more consistent …
PatrickDEissler 51bbaf8
feat: link Leave Application with Bulk Leave Application
PatrickDEissler 086d2ba
feat: avoid holidays in weekly-offs
PatrickDEissler 9a15033
refactor: use hr utils function to get holidays
PatrickDEissler a918ad1
feat: create Attendances instead of Leave Applications
PatrickDEissler d48c741
fix(Attendance): calculate flexitime on_change to cover all use cases…
PatrickDEissler 922d0f8
Merge branch 'version-15' into drc-148
barredterra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
57 changes: 57 additions & 0 deletions
57
time_capture/time_capture/doctype/bulk_leave_application/bulk_leave_application.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| // Copyright (c) 2025, ALYF GmbH and contributors | ||
| // For license information, please see license.txt | ||
|
|
||
| // frappe.ui.form.on("Bulk Leave Application", { | ||
| // refresh(frm) { | ||
|
|
||
| // }, | ||
| // }); | ||
|
|
||
| frappe.ui.form.on("Bulk Leave Application", { | ||
| setup: function (frm) { | ||
| frm.set_query("leave_approver", function () { | ||
| return { | ||
| query: "hrms.hr.doctype.department_approver.department_approver.get_approvers", | ||
| filters: { | ||
| employee: frm.doc.employee, | ||
| doctype: "Leave Application", | ||
| }, | ||
| }; | ||
| }); | ||
| frm.set_query("employee", erpnext.queries.employee); | ||
| }, | ||
|
|
||
| from_date: function (frm) { | ||
| if (frm.doc.from_date && !frm.doc.to_date) { | ||
| var a_year_from_start = frappe.datetime.add_months(frm.doc.from_date, 12); | ||
| frm.set_value("to_date", frappe.datetime.add_days(a_year_from_start, -1)); | ||
| } | ||
| }, | ||
|
|
||
| employee: function (frm) { | ||
| frm.trigger("set_leave_approver"); | ||
| }, | ||
|
|
||
| set_leave_approver: function (frm) { | ||
| if (frm.doc.employee) { | ||
| return frappe.call({ | ||
| method: "hrms.hr.doctype.leave_application.leave_application.get_leave_approver", | ||
| args: { | ||
| employee: frm.doc.employee, | ||
| }, | ||
| callback: function (r) { | ||
| if (r && r.message) { | ||
| frm.set_value("leave_approver", r.message); | ||
| } | ||
| }, | ||
| }); | ||
| } | ||
| }, | ||
| }); | ||
|
|
||
| frappe.ui.form.on("Bulk Leave Application Date", { | ||
| from_date: function (frm, cdt, cdn) { | ||
| frappe.model.set_value(cdt, cdn, "to_date", locals[cdt][cdn].from_date); | ||
| }, | ||
| }); | ||
|
|
256 changes: 256 additions & 0 deletions
256
time_capture/time_capture/doctype/bulk_leave_application/bulk_leave_application.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,256 @@ | ||
| { | ||
| "actions": [], | ||
| "allow_rename": 1, | ||
| "creation": "2025-04-09 14:17:35.501172", | ||
| "doctype": "DocType", | ||
| "engine": "InnoDB", | ||
| "field_order": [ | ||
| "employee", | ||
| "employee_name", | ||
| "column_break_ihkc", | ||
| "leave_type", | ||
| "from_date", | ||
| "to_date", | ||
| "add_weekly_holidays", | ||
| "weekly_off", | ||
| "get_weekly_off_dates", | ||
| "dates_section", | ||
| "table_leaves", | ||
| "approval_section", | ||
| "leave_approver", | ||
| "column_break_lfyt", | ||
| "status", | ||
| "amended_from" | ||
| ], | ||
| "fields": [ | ||
| { | ||
| "fieldname": "employee", | ||
| "fieldtype": "Link", | ||
| "in_filter": 1, | ||
| "in_list_view": 1, | ||
| "label": "Employee", | ||
| "options": "Employee", | ||
| "reqd": 1 | ||
| }, | ||
| { | ||
| "fetch_from": "employee.employee_name", | ||
| "fieldname": "employee_name", | ||
| "fieldtype": "Data", | ||
| "label": "Employee Name" | ||
| }, | ||
| { | ||
| "fieldname": "column_break_ihkc", | ||
| "fieldtype": "Column Break" | ||
| }, | ||
| { | ||
| "fieldname": "leave_type", | ||
| "fieldtype": "Link", | ||
| "in_list_view": 1, | ||
| "label": "Leave Type", | ||
| "options": "Leave Type", | ||
| "reqd": 1 | ||
| }, | ||
| { | ||
| "fieldname": "approval_section", | ||
| "fieldtype": "Section Break", | ||
| "label": "Approval" | ||
| }, | ||
| { | ||
| "fieldname": "leave_approver", | ||
| "fieldtype": "Link", | ||
| "label": "Leave Approver", | ||
| "options": "User", | ||
| "reqd": 1 | ||
| }, | ||
| { | ||
| "fieldname": "column_break_lfyt", | ||
| "fieldtype": "Column Break" | ||
| }, | ||
| { | ||
| "allow_on_submit": 1, | ||
| "fieldname": "status", | ||
| "fieldtype": "Select", | ||
| "in_filter": 1, | ||
| "in_standard_filter": 1, | ||
| "label": "Status", | ||
| "no_copy": 1, | ||
| "options": "Open\nApproved\nRejected\nCancelled", | ||
| "permlevel": 1 | ||
| }, | ||
| { | ||
| "fieldname": "dates_section", | ||
| "fieldtype": "Section Break", | ||
| "label": "Dates" | ||
| }, | ||
| { | ||
| "fieldname": "amended_from", | ||
| "fieldtype": "Link", | ||
| "label": "Amended From", | ||
| "no_copy": 1, | ||
| "options": "Bulk Leave Application", | ||
| "print_hide": 1, | ||
| "read_only": 1, | ||
| "search_index": 1 | ||
| }, | ||
| { | ||
| "fieldname": "table_leaves", | ||
| "fieldtype": "Table", | ||
| "label": "Leaves", | ||
| "options": "Bulk Leave Application Date" | ||
| }, | ||
| { | ||
| "depends_on": "eval: doc.from_date && doc.to_date", | ||
| "fieldname": "add_weekly_holidays", | ||
| "fieldtype": "Section Break", | ||
| "label": "Add Weekly Holidays" | ||
| }, | ||
| { | ||
| "fieldname": "weekly_off", | ||
| "fieldtype": "Select", | ||
| "label": "Weekly Off", | ||
| "options": "\nSunday\nMonday\nTuesday\nWednesday\nThursday\nFriday\nSaturday" | ||
| }, | ||
| { | ||
| "fieldname": "get_weekly_off_dates", | ||
| "fieldtype": "Button", | ||
| "label": "Add to Holidays", | ||
| "options": "get_weekly_off_dates" | ||
| }, | ||
| { | ||
| "fieldname": "from_date", | ||
| "fieldtype": "Date", | ||
| "label": "From Date", | ||
| "reqd": 1 | ||
| }, | ||
| { | ||
| "fieldname": "to_date", | ||
| "fieldtype": "Date", | ||
| "label": "To Date", | ||
| "reqd": 1 | ||
| } | ||
| ], | ||
| "grid_page_length": 50, | ||
| "index_web_pages_for_search": 1, | ||
| "is_submittable": 1, | ||
| "links": [], | ||
| "modified": "2025-05-12 08:50:33.467370", | ||
| "modified_by": "Administrator", | ||
| "module": "Time Capture", | ||
| "name": "Bulk Leave Application", | ||
| "owner": "Administrator", | ||
| "permissions": [ | ||
| { | ||
| "amend": 1, | ||
| "cancel": 1, | ||
| "create": 1, | ||
| "delete": 1, | ||
| "email": 1, | ||
| "export": 1, | ||
| "print": 1, | ||
| "read": 1, | ||
| "report": 1, | ||
| "role": "System Manager", | ||
| "share": 1, | ||
| "submit": 1, | ||
| "write": 1 | ||
| }, | ||
| { | ||
| "create": 1, | ||
| "email": 1, | ||
| "export": 1, | ||
| "print": 1, | ||
| "read": 1, | ||
| "report": 1, | ||
| "role": "Employee", | ||
| "share": 1, | ||
| "submit": 1, | ||
| "write": 1 | ||
| }, | ||
| { | ||
| "create": 1, | ||
| "delete": 1, | ||
| "email": 1, | ||
| "export": 1, | ||
| "print": 1, | ||
| "read": 1, | ||
| "report": 1, | ||
| "role": "HR Manager", | ||
| "share": 1, | ||
| "submit": 1, | ||
| "write": 1 | ||
| }, | ||
| { | ||
| "email": 1, | ||
| "export": 1, | ||
| "permlevel": 1, | ||
| "print": 1, | ||
| "read": 1, | ||
| "report": 1, | ||
| "role": "All", | ||
| "share": 1 | ||
| }, | ||
| { | ||
| "create": 1, | ||
| "delete": 1, | ||
| "email": 1, | ||
| "export": 1, | ||
| "print": 1, | ||
| "read": 1, | ||
| "report": 1, | ||
| "role": "HR User", | ||
| "share": 1, | ||
| "submit": 1, | ||
| "write": 1 | ||
| }, | ||
| { | ||
| "delete": 1, | ||
| "email": 1, | ||
| "export": 1, | ||
| "print": 1, | ||
| "read": 1, | ||
| "report": 1, | ||
| "role": "Leave Approver", | ||
| "share": 1, | ||
| "submit": 1, | ||
| "write": 1 | ||
| }, | ||
| { | ||
| "email": 1, | ||
| "export": 1, | ||
| "permlevel": 1, | ||
| "print": 1, | ||
| "read": 1, | ||
| "report": 1, | ||
| "role": "Leave Approver", | ||
| "share": 1, | ||
| "write": 1 | ||
| }, | ||
| { | ||
| "email": 1, | ||
| "export": 1, | ||
| "permlevel": 1, | ||
| "print": 1, | ||
| "read": 1, | ||
| "report": 1, | ||
| "role": "HR User", | ||
| "share": 1, | ||
| "write": 1 | ||
| }, | ||
| { | ||
| "email": 1, | ||
| "export": 1, | ||
| "permlevel": 1, | ||
| "print": 1, | ||
| "read": 1, | ||
| "report": 1, | ||
| "role": "HR Manager", | ||
| "share": 1, | ||
| "write": 1 | ||
| } | ||
| ], | ||
| "row_format": "Dynamic", | ||
| "sort_field": "modified", | ||
| "sort_order": "DESC", | ||
| "states": [], | ||
| "title_field": "employee_name" | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.