Refactor: Improve Leave Application script with medical certificate validation and date checks#633
Merged
Merged
Conversation
…alidation and date checks.
MhmdSinanKT
approved these changes
Feb 7, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Feature description
The issue was that the Medical Certificate field in Leave Application was being shown for all leave applications where is_proof_document(checkbox) was enabled in the Leave Type, regardless of whether the leave duration exceeded the Medical Leave Required value configured in the Leave Type. The check for leave duration was not correctly ensuring that the Medical Certificate field would appear only when the leave duration was greater than the Medical Leave Required value.
Analysis and design (optional)
Analyse and attach the design documentation
Solution description
Refactored validation logic for Medical certificate field.
Ensured proper field visibility based on leave type and leave duration.
Output screenshots (optional)
Screencast from 02-07-2025 11:20:10 AM.webm
Areas affected and ensured
Leave Application form validation
Is there any existing behavior change of other features due to this code change?
Mention Yes or No. If Yes, provide the appropriate explanation.
Was this feature tested on the browsers?