Employee Leave Management System

mahbubdiit 28,249 views 56 slides Apr 23, 2017
Slide 1
Slide 1 of 56
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56

About This Presentation

Practical Project On
Employee Leave Management System
For
Newgen Technology Limited
(Babylon Garments Limited)


Slide Content

Practical Project On
Employee Leave Management System
For
Newgen Technology Limited
(Babylon Garments Limited)



Supervisor:
Ms. Nayeema Rahman
Lecturer
Daffodil Institute of IT




Submitted by:
Md. Mahbub Alam
ID: 000788896
B.Sc (Hons) in BIT
University of Greenwich

Executive Summary
This documentation is provides some information about Employee Leave management System. The
Employee Leave management System application is responsible for applies leave, calculation of leave, and
leave approval. This application components related to an employee’s “Leave Life cycle” while at an
organization. These activities include the Enterprise Structure, Cross-Application Components and
Organizational Management. This module is The University of Greenwich project will be implementing in
whole or in part at this time.

Acknowledgement
I would like to mention our sincere gratitude towards University of Greenwich, for giving us the
opportunity to carry out our project.
I would like to express our heart full gratitude towards our guide, Ms. Nayeema Rahman for her
invaluable advice for the successful completion of this dissertation.
I also like to extend our sincere thanks to the staff of DIIT for their invaluable help and support.
Finally, I take this opportunity to mention our sincere thanks to one and all those who helped us
directly or indirectly for the completion of our project.

Table of Contents
Executive Summary .................................................................................................................................. 2
Acknowledgement.................................................................................................................................... 3
Chapter 1 - Introduction............................................................................................................................ 6
Chapter 2 - Initial Study............................................................................................................................. 7
2.1 Background of the project................................................................................................................ 7
2.2 Problem Area .................................................................................................................................. 7
2.3 Possible Solution ............................................................................................................................. 8
Chapter 3 - Literature Review .................................................................................................................... 9
3.1 - Fact and Finding ............................................................................................................................ 9
Chapter 4 - Methodology ........................................................................................................................ 11
4.1 What to use .................................................................................................................................. 11
4.2 Why to use.................................................................................................................................... 12
4.3 Section of methodology ................................................................................................................. 12
4.4 Implementation plans.................................................................................................................... 12
Chapter 5 - Planning ............................................................................................................................... 13
5.1 Project Plan................................................................................................................................... 13
5.1.1 Management Plan ................................................................................................................... 13
5.1.2 Resource Allocation (H/W, S/W, Models, Documentation)......................................................... 13
5.1.3 Activity Network Diagram ........................................................................................................ 14
5.1.4 Gantt chart ............................................................................................................................. 15
5.2 Risk Management.......................................................................................................................... 15
5.2.1 Risk identification.................................................................................................................... 15
5.2.2 Risk assessment ...................................................................................................................... 15
5.2.3 Risk precaution/ Action plan .................................................................................................... 15
5.2.4 Steps taken for possible risks ................................................................................................... 16
5.3 Quality Management ..................................................................................................................... 17
5.3.1 Rules applied to maintain quality ............................................................................................. 17
5.3.2 Quality plan and measuring meter ........................................................................................... 17
Chapter 6 - Feasibility Plan ...................................................................................................................... 19
6.1 All possibility type of feasibility ...................................................................................................... 19
6.2 Cost Benefit Analysis ..................................................................................................................... 19
Chapter 7 - Foundation Plan .................................................................................................................... 21
7.1 Problem Area Identification ........................................................................................................... 21
7.1.1 Interview ................................................................................................................................ 21
7.1.2 Observation ............................................................................................................................ 23

7.2 Possibility Solution ........................................................................................................................ 23
7.3 What Technology to be implemented (Client/ Web/ Standalone) ..................................................... 24
7.4 Recommendations and Justification ............................................................................................... 24
Chapter 8 - Exploration ........................................................................................................................... 25
8.1 Prototype of new System ............................................................................................................... 26
Chapter 9 - Engineering........................................................................................................................... 27
9.1 New System Modules .................................................................................................................... 27
9.2 Peters Chen ERD Diagram .............................................................................................................. 27
9.3 Sequence Diagram......................................................................................................................... 28
9.4 Component Diagram ..................................................................................................................... 28
9.5 Deployment Diagram..................................................................................................................... 29
9.6 System Interface Design/ Prototype ............................................................................................... 30
Chapter 10 - Deployment/ Development.................................................................................................. 31
10.1 Core Module Coding Samples....................................................................................................... 31
Chapter 11 - Testing................................................................................................................................ 49
11.1 Testing against time boxes, Required tests, User Acceptance test plan ........................................... 49
11.2 Fault Handling Techniques ........................................................................................................... 50
11.3 Quality Assurance encompasses Testing ....................................................................................... 50
11.4 Test Case .................................................................................................................................... 51
Chapter 12 - Implementation .................................................................................................................. 54
12.1 Training ...................................................................................................................................... 54
Chapter 13 - Lessons Learned .................................................................................................................. 55
13.1 What have I learned .................................................................................................................... 55
13.2 What problem I have faced .......................................................................................................... 55
Chapter 15 – Conclusion ......................................................................................................................... 56

Chapter 1 - Introduction

Before any new system starts to work a decision is required on the basis of the initial study. An initial
study is used to determine what information systems are needed to support the needs of the business of
what Information Technology would be most appropriate. At the end of this stage minimum outputs are:
 A brief discussion of the proposed system.
 An estimation of the project cost.
 A possible completion date for the work.

Dhaka city is the busiest city here in Bangladesh. There are plenty of organization, shops etc. Among all
these “Babylon Garments Limited” is the name of the organization which has huge number of employee. The
employee leave management system of Babylon Garments Limited is currently being maintained manually.
Therefore according to other hi-fi garments etc. Babylon Garments Limited wants to implement a new
system, which will be computerized.

Chapter 2 - Initial Study
2.1 Background of the project
In the existing Leave Record Management System, every organization follows manual procedure in
which employee enters information in a record book. At the end of each year, Administration Department
calculates leave/s of every member which is a time taking process and there are chances of losing data or
errors in the records.
This module is a single Employee Leave Management System that is critical for HR tasks and keeps
the record of vital information regarding working leaves. It intelligently adapts to HR policy of the
management and allows employees and their line managers to manage leaves and replacements (if
required). In this module, Head of Department (HOD) will have permissions to look after data of every
employee of their department. HOD can approve leave through this application and can view leave
information of every individual.
This application can be used in a garment to reduce processing work load. This project’s main idea is
to develop an online centralized application connected to database which will maintain employee leaves.
Leave management application will reduce paperwork and maintain record in a more efficient & systematic
way. This module will also help to calculate the number of leaves taken yearly.

2.2 Problem Area
Babylon Garments Limited has about seven thousands staff. Nowadays, although others company
have Employee Leave Management System. Some leave management data are store in Microsoft Excel and
Information is record in manual filing system. The problems in this previous
Systems are:
i. The many processes of leave application require time and energy.
The staffs have to fill the details on the leave application form. After that, there have to get the
annual leave balance from the clerk. The clerk will record the leave application form. The clerk will get the
permission from the branch manager.
ii. The staffs have to refer to the clerk to know their yearly leave amounts and balance.
The staffs have to get the yearly leave balance from the clerk to fill in application form. There will
have the problem if the clerks take a leave or not in office.
iii. The clerk has to record all kind of leaves in one record book.
There are many kind of leave beside yearly leave. Because of that, the clerk has to record the other
leaves in a record book.
iv. Leave report for each staff are design on paper.
For management purpose, the manager needs a leave report for each staff. However, the clerk only
record on paper and the record will be check every year.

2.3 Possible Solution
Above are certain objectives that should be gain in this project:
 To apply leave online (staffs)
 To receive leave application from staff online by auto generated email (Approver)
 To approve or reject staff leave application by auto generated email (Approver)
 To calculate leave balance from a fix amount of annual leave
 To record all leave information in database
 To generate report based on staffs leave

Chapter 3 - Literature Review
The literature review and project methodology is a chapter that describes the analysis and findings
on passed research, case study or research that relates with this project, Employee Leave Management
System for Babylon Garments Limited and it also review the selected approach or methodology used in this
system detail.

3.1 - Fact and Finding
Leave Management System is the important system in administration department in all company.
However, the management is different for each company. Some company still comfort with the manual
system and the other make change the system from manual to computerize to make the management more
effective.
Leave time is a comprehensive and flexible leave management system enabling us to enter and
manage leave requests according to company rules. This time of the year, many employers face a formidable
task of juggling and approving leaves applications. Employer need to ensure they are keeping staff happy but
retaining the right workforce to do the job for themselves and customers over Eid-New Year - , traditionally a
time with high priorities on maintenance and preparations for the year ahead. This company develop an
automated payroll and leave management systems which offers an on-line leave management system
designed to radically simplify for employees and employers alike the process of planning, applying for and
approving leave. This system eliminates paperwork and cuts delay by enabling employees and supervisors to
action time-off applications simply by entering the dates and type of leave being sought after the employee
has viewed his or her entitlements online. Employees used a personal ID code to get immediate access to
their entitlements, while managers can at a glance see all employees' leave history, leave balances, pending
leave applications and approved. The benefit of the system is saves time by eliminating paperwork,
enhances employee satisfaction by speeding up the process and helps managers by ensuring compliance
with company policies. Their system is a web-based, there is no software to install or support and no
additional hardware required to operate the system.
The purpose system did not include in the payroll management because it is not include in project
scopes.

Refer to Workteach in their website, leave time is a comprehensive and flexible leave management
system enabling us to enter and manage leave requests according to company rules. Mantract Pty Ltd is one
of Software Company that develops Leave Management System. Base on their experience, this time of the
year, many employers face a formidable task of juggling and approving leaves applications. Employer need
to ensure they are keeping staff happy but retaining the right workforce to do the job for themselves and
customers over Christmas-New Year - , traditionally a time with high priorities on maintenance and
preparations for the year ahead. This company develop outsourced automated payroll and leave
management systems which offers an on-line leave management system designed to radically simplify for
employees and employers alike the process of planning, applying for and approving leave. This system
eliminates paperwork and cuts delay by enabling employees and supervisors to action time-off applications
simply by entering the dates and type of leave being sought after the employee has voiced his or her
entitlements online. Managers can in turn view the applications on a graphical leave planner where they can
see the overall pattern of leave applications and personnel availability, helping them to make prompt
informed decisions on approvals and staffing levels. Employees used a personal ID code to get immediate
access to their entitlements, while managers can at a glance see all employees' leave history, leave balances,

pending leave applications, authorizations, authorizations awaited and statutory holidays. The benefit of the
system is saves time by eliminating paperwork, enhances employee satisfaction by speeding up the process
and helps managers by ensuring compliance with company policies. Their system is a web-based, there is no
software to install or support and no additional hardware required to operate the system.
From the research that have been done, Employee Leave Management System for Babylon
Garments Limited have a little different than Mantract system. The purpose system did not include in the
payroll management because it is not include in project scopes.

Chapter 4 - Methodology
4.1 What to use
In this system development, OOAD (Object-oriented System Analysis and Design) is the best
approach than traditional structured approach. This methodology is using UML (Unified Modeling
Language).It is because base on John W.Satzinger, the object oriented approach has the potential to reduce
errors, reduce costs, and increase flexibility because of its inherent features.
The development of the project consists of five SDLC (Software Development Life Cycle) phases .The
phases are:
I. Planning Phase
In this phase, the first step is making a research in finding the best project to propose. After get
information about the project, proposal is submitted. The proposal consists of the project background,
problem area, objectives and project requirements. This is the most important thing to do in phase planning.
Besides that, the faculty has accommodated a flow that need to be follow by the student. From the
schedule, the student can plan the best way in managing time to develop the project. Gantt chart are
develop base on schedule and time that given by the lecturer to submit those entire thing needed.
II. Analysis Phase
First of all, the analysis has to done to know the view of whole system to develop. The content of the
proposal is the result from the analysis.
In this chapter, the important thing need is make more research to captured key functionality,
system process and tolls needed. This finding and research can be done via internet, journal, books and
article. The finding should be described and elaborate in diagram, chart and table to make the system easier
to understand in process of develop later.
Many analyses must be done to know the business process of the as-is system and to-be system.
Analysis about requirement and functionality of the system is very important in process to develop the
system.
III. Design Phases
Based on the analysis phase, the design will be done. The design phase is consisting of 3 activities.
The activities are:
a. Logical design
This activity involves class diagram and interaction diagram
b. Interface design
The activity includes navigation design, output design and input design.
c. Database design
This activity defines logical data model, detail explanation for each entity, description of the
association, cardinality and relationship.

iv. Testing Phase
In this phase, the all functionality system are testing and confirm that there are no error and record
the entire not function requirement and correct it.
v. Implement Phase
After all phase have been perfectly done, the system will be implemented to the server and the
system can be used.


4.2 Why to use
Project management ensures that available resources are used in the most effective and efficient
manner. It is a combination of steps and techniques to keep a project's schedule and budget in line.

4.3 Section of methodology
Project Management Methodology consists of five stages:
 Initiating
 Planning
 Executing
 Controlling
 Closing


4.4 Implementation plans
The implementation phase is starting at process installing hardware and software requirements.
Installation hardware is setting up the server hardware requirements specification. Then, the operating
system installation, which is, Ubuntu 12.04, Ant compiler, Java JDK (1.6) and Oracle 10g are installing
following the steps that required.
This will be testing and debugging, until it is ready to be delivered. The actual is created and
customizes the tables.
The testing process is to be doing to test the system application operation. After testing is
concluded, the final documentation is reviewed and printed, and end users are trained. The system is in full
operation at the end of the phase but will be continuously evaluated and fine-tuned.

Chapter 5 - Planning
5.1 Project Plan
5.1.1 Management Plan
In-charges and approver are encouraged to work with all employees who have added extra leave to
develop an excess Employee Leave Management Plan (ELMP) to reduce the liability. An ELMP is an
agreement between the employee and employer that designates actions for reducing excess leave accrual in
a timely manner. This may involve setting leave dates, arranging for a cash payment of leave, or formally
deferring leave (all subject to Industrial Agreement/Award conditions). An ELMP must also take into
consideration the additional leave that will fall due during the ELMP timeframe.
Employee:
• Applicant can apply for leave to the system
• System will send a mail to Approver and applicant
• See number of day when apply for leave after all deduction of public holiday and official holiday
• Able to see total, applied/ pending, Approved and balanced leaves for each leave type
• Have to input from date, to date, leave type, reason, description and his/her approver

Approver:
• Approver can see a leave requests as a list
• After his approval he will got a mail also the applicant of the leave request
• Add leave type
• Add Leave Reason
• Add public holiday

Department In-charge:
• He will approve after approval of approver
• After his approval he will got a mail also the applicant of the leave request


5.1.2 Resource Allocation (H/W, S/W, Models, Documentation)
Hardware:
Operating System: Ubuntu 12.04
Processor: 1.7 GHz or better
RAM: 1 GB or better
Hard Drive: 20 GB or better

Software:
Java SDK (1.6), Ant compiler, Oracle Database

5.1.3 Activity Network Diagram

Pic – Activity Network Diagram

5.1.4 Gantt chart

Pic – Gantt chart

5.2 Risk Management
5.2.1 Risk identification
 Hardware loss or damage
 Environmental pollution
 Less expert system administrator
 Manage no backup service
5.2.2 Risk assessment
When the risk analysis process has been completed, it is necessary to compare the estimated risks
against appropriate risk criteria established by the Babylon Garments Limited after consultation with the
financial services portfolio committee and the Audit Committee.

5.2.3 Risk precaution/ Action plan
Preventative maintenance and timely repair of assets, a high qualitative standard of workmanship
and diligent compliance with the law are some of the strategies that could be implemented to avoid risk.
However, the Babylon Garments Limited acknowledges that in some cases the risk event must first occur
before any practicable steps can be taken to avoid the risk.

5.2.4 Steps taken for possible risks
When risk cannot be avoided, the effect of loss can often be minimized in terms of frequency and
severity, e.g. restricting access to Babylon Garments Limited offices after hours and the use of security
devices on all computers, to reduce the risk of theft. In the most severe cases the only effective manner of
preventing exposure to risk may, where the possibility of a catastrophic risk event happening with certainty,
is to cease undertaking the specific activity.
In some cases risk can be transferred to others, usually by contract. The most common method of
risk transfer is to purchase of insurance since the policy actually shifts the financial risk of loss, contractually,
from the BGL to the insurance company.
Insurance:
(a) The Chief Financial Officer must, in respect of all those instances that the BGL Manager identified
risk transfer by means of insurance as the most effective and efficient risk treatment strategy, subject to the
supply chain management policy, take out adequate insurance cover and must manage the BGL's insurance
reserve fund to cover such risks, as the BGL Manager may determine.
(b) A departmental head must, at the request of the Chief Financial Officer by written notice declare
the assets held, allocated to or used by her/his department, the risks against which they should be insured
and such other information as may be considered necessary.
(c) A departmental head must at the request of the Chief Financial Officer notify her/him without
delay of all property acquired, leased or rented and which must be insured against fire, accident or loss of
any nature and of any changes in structure, heating or occupation of any buildings or items which are
insured.
(d) A departmental head must notify the Chief Financial Officer of the amounts in respect of which
new insurance cover must be taken out, or of any changes in existing insurance, having regard for the
replacement costs of assets.
(e) A departmental head must notify the Chief Financial Officer immediately after any occurrence of
fire or damage to, or loss of, any asset of the BGL. A departmental head must thereafter complete the
appropriate claim form and supply an estimate of the costs to repair such damage or loss.
(f) A departmental head must in the same manner inform the Chief Financial Officer of any injuries
to or damage sustained by any employee or a third party that could lead to a claim against the BGL.
(g) A departmental head must notify the Chief Financial Officer of any assets that, in her/his opinion
should be insured against political insurgence and malicious damage or any other risk and the amounts for
which such assets should be insured. The Chief Financial Officer must report such requests to the BGL
Manager.
(h) The Chief Financial Officer must-
(i) Keep a record of all insurance policies of the BGL
(ii) Ensure payment of all premiums with regard to such insurance
(iii) Ensure that all claims arising from such policies are completed and submitted

5.3 Quality Management
5.3.1 Rules applied to maintain quality
Total quality management can be summarized as a management system for a customer-focused
organization that involves all employees in continual improvement. It uses strategy, data, and effective
communications to integrate the quality discipline into the culture and activities of the organization.
 Customer-focused: The customer ultimately determines the level of quality. No matter what
an organization does to foster quality improvement—training employees, integrating quality
into the design process, upgrading computers or software, or buying new measuring tools—
the customer determines whether the efforts were worthwhile.
 Total employee involvement: All employees participate in working toward common goals.
Total employee commitment can only be obtained after fear has been driven from the
workplace, when empowerment has occurred, and management has provided the proper
environment. High-performance work systems integrate continuous improvement efforts
with normal business operations. Self-managed work teams are one form of empowerment.
 Process-centered: A fundamental part of QM is a focus on process thinking. A process is a
series of steps that take inputs from suppliers (internal or external) and transforms them
into outputs that are delivered to customers (again, either internal or external). The steps
required to carry out the process are defined, and performance measures are continuously
monitored in order to detect unexpected variation.
 Integrated system: Although an organization may consist of many different functional
specialties often organized into vertically structured departments, it is the horizontal
processes interconnecting these functions that are the focus of QM.
 Strategic and systematic approach: A critical part of the management of quality is the
strategic and systematic approach to achieving an organization’s vision, mission, and goals.
This process, called strategic planning or strategic management, includes the formulation of
a strategic plan that integrates quality as a core component.
 Continual improvement: A major thrust of QM is continual process improvement. Continual
improvement drives an organization to be both analytical and creative in finding ways to
become more competitive and more effective at meeting stakeholder expectations.
 Fact-based decision making: In order to know how well an organization is performing, data
on performance measures are necessary. QM requires that an organization continually
collect and analyse data in order to improve decision making accuracy, achieve consensus,
and allow prediction based on past history.
 Communications: During times of organizational change, as well as part of day-to-day
operation, effective communications plays a large part in maintaining morale and in
motivating employees at all levels. Communications involve strategies, method, and
timeliness.
These elements are considered so essential to QM that many organizations define them, in some
format, as a set of core values and principles on which the organization is to operate.

5.3.2 Quality plan and measuring meter
 Top management learns about and decides to commit to QM. QM is identified as one of the
organization’s strategies.
 The organization assesses current culture, customer satisfaction, and quality management systems.
 Top management identifies core values and principles to be used, and communicates them.

 A TQM master plan is developed on the basis of steps 1, 2, and 3.
 The organization identifies and prioritizes their demands and aligns products and services to meet
those demands.
 Management maps the critical processes through which the organization needs.
 Management oversees the formation of teams for process improvement efforts.
 The momentum of the QM effort is managed by the steering committee.
 Managers contribute individually to the effort through hosting planning, training, coaching, or other
methods.
 Daily process management and standardization take place.
 Progress is evaluated and the plan is revised as needed.
 Constant employee awareness and feedback on status are provided and a reward/recognition
process is established.

Chapter 6 - Feasibility Plan
6.1 All possibility type of feasibility
 The proposed system will be developed in web based completely and it is required to use web
technologies appropriately. Technology to build the overall system is available
 Currently available web technology- Java, html, xml etc.
 Server: Apache tomcat, apache, IIS
 RDBMS: Oracle, MySql, MS sql server
 The system is developed using java as the main development language due to security need and
Apache tomcat has to the web server due to high reliability and flexibility in between platform.
derby database is use for development and oracle will be used for production server for the system,
due to flexibility and security
 Availability of the chosen technologies: all the chosen technology is widely used in the world and is
available for free. Oracle will be licence version and without oracle all are open source software.
 Maturity of the technology apache over 50% of the server in the world are apache therefor the
technology is considered to be mature enough to be used
 Source availability: these open source software sources are available widely and knowledge is freely
available through the internet

6.2 Cost Benefit Analysis
We can divide the cost in to the few categories.
 Development and purchasing costs
o Hardware (Currently the got enough hardware facilities)
o Software
 Operating System (Ubuntu - free)
 Main software need to build the system(ofBiz Framework – Open source)
 Others software (All are free)
 Installation and data entry costs
o Install the system
o Training the staff
o Enter previous data into system
 Operational Costs
o Maintenance of the system
o Updating the software
 Personal costs
o Maintenance staff cost
o Operational staff cost
Expenses
Price
Database/year 1,20,000
Maintenance 30,000
Total 1,50,000

Expenses
Database
Maintenance

Chapter 7 - Foundation Plan
7.1 Problem Area Identification
 Leave application is a lengthy process
 Fully paper dependant
 Need more time
 Complicated process
 Employee always run here and there with their application
 Complex to manage
 Sometime data missing
 Employee are not happy with manual system
 Costly to manage because Babylon have huge number of employee
 Every day 150-200 employee take leaves
 Some are half day, casual, medical, earn leave etc. so categorization problem
7.1.1 Interview
Name of interviewer: Md. Mahbub Alam
Position: Software Developer. Interview place: Newgen Technology Limited, Dhaka

Time Date Person Interviewing and Title
09:30 am 04/04/2014 Shamsudin Rusho (Head of HR)
11:30 am 04/04/2014 Ershadul Haq (Senior Manager HR)
09:30 am 05/04/2014 Amin Ahmed (Assistant Manager HR)

Discussion Record:
Discussion Record
System: HR Name: HR Sheet -1
Participants: Head of HR Date: 04/04/2014
Objective/Agenda: Meet with Head of HR Location: Dhaka
Duration: 1 hour 30 minutes
Result: The purpose of our discussion is understands their business
function and makes them understand what we are going to do. We
Cross reference

covers with the leave of the business .How they conduct their leave
and what sort of problem.
They are facing which problem. How can they remove their particular
problem by our system? As a result they agree with us for developing
a system.









Discussion Record
System: HR Name: HR Sheet-2
Participants: Senior Manager HR Date: 04/04/2014
Objective/Agenda: Meet with Senior Manager HR Location:
Duration: 2 Hours 5 Minutes
Result: the purpose of our discussion is understands their leave
function and makes them understand what we are going to be.
We converse with the quality manager about their planning
process of the business what sort of problem they are facing to
control of product quality. We collect those documents. How can
they remove their particular problem by our system? As a result
they agree with us for developing a system on their business.
Cross reference

7.1.2 Observation
 They are related to the expected internal financial performance of the organization
 The goal of this organization actually pursues, how manage the leave easily for employee
 Save cost
 Save overhead time
 Save data for future use
 Increase performance in work efforts
 Gain employee satisfaction

7.2 Possibility Solution
 Proposed system interface is so user friendly
 Web based so anywhere user can access though internet
 Manage data into database so data is secured and schedule backup script will be run in background
 Time save to overhead costing will be minimized
 Overall Requirement List

Discussion Record
System: Assistant Manager HR Name: HR Sheet-3
Participants: Assistant Manager HR Date: 04/04/2014
Objective/Agenda: Meet with Assistant Manager HR


Location: Dhaka
Duration: 4 Hours 50 Minutes
Result: the purpose of our discussion is understands their
managing function and makes them understand what we are
going to be. We converse with the planning manager about their
planning process of the leave management what sort of problem
they are facing to maintain planning documents. We collect those
documents. How can they remove their particular problem by our
system? As a result they agree with us for developing a system.
Cross reference

7.3 What Technology to be implemented (Client/ Web/ Standalone)
This proposed system will implement in a web server. Apache tomcat will responsible to run the application.
Apache Ant will help us a lot regarding this issue.

7.4 Recommendations and Justification
 Easy to manage this application
 Need less time to modify
 Cost effective
 Almost all supporting software are open source
 Very easy to coding and huge number of developer supporting forum and blog
 User friendly interface
 Using jquery and ajax user interfaces are more user friendly

Chapter 8 - Exploration
The existing Leave Management System of Babylon garments limited is manual. It is a lengthy
process and these processes are not optimized. The Human Resource Department and/or the Manager are
the competent authorities for the approval or refusal of leave depending on the type of leave. The Leave
Management System is initiated with the submission of an application by an employee for leave. This
application must be submitted to the Controlling Officer at least two weeks ahead (with the exception of
casual leave and the quarantine leave) from the date of commencement of the leave applied for. The
controlling officer is responsible for checking out the eligibilities of the employee for the type of leave s/he
has applied for. If the applicant is eligible then the controlling officer submits the application to the
Manager. The work of the Manager is the most complicated as s/he is responsible for the synchronization of
the leave. Moreover, he is also accountable for the smooth functionality of the branch. In case of Earned
Leave with full pay, Medical Leave, Quarantine Leave and Casual Leave the Manager has the sole authority
to grant or refuse the leave. If the Manager allows an employee for leave, s/he should inform the HRD by
submitting a report, which will contain the details about the approved leave. For these types of leave the
HRD do not allow any alternative employee. For the other four types of leave the Manager sends the
application to the Human Resource Department for approval. Then the HRD takes their decision and let the
Manager know the result by an official letter. Then the Manager informs the applicant. So, an employee
cannot but wait for a long time to know the decision of the competent authority. Sometime the HRD sends a
backup officer to the branch if they approve the leave of an employee for a long period of time.
Furthermore, the Branch Manager is supposed to send an annual report informing the leave status
of a calendar year to the HRD. Each branch maintains a register for the leave associated affairs. The
Controlling Officer use to maintain this log. The Branch Manager uses this register to prepare the annual
report. As the annual leave report is nothing but the summary of the leave register for a particular year, it is
not that much helpful for taking any managerial decision. There is no opportunity to analyze the report and
find out the scopes for improvements as the HRD is not getting any instant data from the report. They are
getting present year’s leave status in the following year. As a result the top management is not being able to
utilize the report in a proper manner. So, the existing Leave Management System is a time consuming one. It
needs to be more optimized and more synchronized which will lead the management to have a more
proficient system to support the total employee management scheme.

8.1 Prototype of new System

Pic – Login Screen



Pic – After login success of Admin user

Chapter 9 - Engineering
Explicitly identify the requirements to be satisfied by the proposed system.

9.1 New System Modules
Discuss functional improvements, including new capabilities. Discuss improvements of degree.
These are upgrades to existing capabilities.

9.2 Peters Chen ERD Diagram

Pic – Chen Diagram

9.3 Sequence Diagram


Pic – Sequence Diagram

9.4 Component Diagram

Pic - Component Diagram

9.5 Deployment Diagram

Pic - Deployment Diagram

9.6 System Interface Design/ Prototype

Pic – Waiting list leave for approval


Pic - Reset Leave (For Fiscal year)

Chapter 10 - Deployment/ Development
10.1 Core Module Coding Samples
<>===================================<>
Contoller
<>===================================<>
<?xml version="1.0" encoding="UTF -8"?>

<site-conf xmlns:xsi="http://www.w3.org/2001/XMLSchema -instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/site -conf.xsd">
<description>Human Resources Manager Module Site Configuration File</description>
<handler name="service -multi" type="request"
class="org.ofbiz.webapp.event.ServiceMultiEventHandler" />
<!-- Request Mappings -->
<request-map uri="view">
<security https="true" auth="false" />
<response name="success" type="request" value="main" />
</request-map>

<request-map uri="main">
<security https="true" auth="true" />
<response name="success" type="view" value="EmplLeaveAdd" />
</request-map>
<request-map uri="FindEmplLeaves">
<security https="true" auth="true" />
<response name="success" type="view" value="FindE mplLeaves" />
</request-map>
<request-map uri="EmplLeavesListForAdmin">
<security https="true" auth="true" />
<response name="success" type="view" value="EmplLeavesListForAdmin" />
</request-map>

<request-map uri="EmplLeaveAdd"><! -- added for emlpoyee leave View -->
<security https="true" auth="true" />
<response name="success" type="view" value="EmplLeaveAdd" />
</request-map>

<request-map uri="ResetEmployeeLeavesSatus">
<security https="true" auth="true" />
<event type="java" path="org.ofbiz.humanres.LeaveEvents"
invoke="fiscalYearResetService" />
<response name="success" type="view" value="LeaveResetAdmin" />
<response name="error" type="view" value="LeaveResetAdmin" />
</request-map>

<request-map uri="createEmployeeLea ve"><!-- Save Leave Request -->
<security https="true" auth="true" />
<event type="service" invoke="createEmplLeave" />
<response name="success" type="request" value="sendEmailForLeaveToAdmin" />
<response name="error" type="view" value="EmplLeaveA dd" />
</request-map>

<!--=================================Leave apply for
admin============================ -->

<request-map uri="LeaveListAdmin">
<security https="true" auth="true" />
<event type="java" path="org.ofbiz.humanres.LeaveEvents"
invoke="employeeLeaveSummaryView" />
<response name="success" type="view" value="ProttayEmployeeLeavesViewAdmin"
/>
</request-map>

<request-map uri="AdminLeaveAdd"><! -- added for emlpoyee leave View -->
<security https="true" auth="true" />
<response name="success" type="view" value="AdminLeaveAdd" />
</request-map>

<request-map uri="createAdminLeave"><! -- Save Leave Request -->
<security https="true" auth="true" />

<event type="service" invoke="createEmplLeave" />
<response name="success" type="request" value="sendEmailToLeaveFromAdmin" />
<response name="error" type="view" value="AdminLeaveAdd" />
</request-map>

<request-map uri="sendEmailToLeaveFromAdmin"><! -- Send mail to Admin after Save
Leave Request -->
<security https="true" a uth="true" />
<event type="service" invoke="sendEmailForLeave"
path="component://humanres/servicedef/services.xml" />
<response name="success" type="request"
value="ProttayEmployeeLeavesViewAdmin" />
<response name="error" type="view" value="ProttayE mployeeLeavesViewAdmin" />
</request-map>

<!--=====================End================ -->

<request-map uri="sendEmailForLeaveToAdmin"><! -- Send mail to Admin after Save
Leave Request -->
<security https="true" auth="true" />
<event type="service" invoke="sendEmailForLeave"
path="component://humanres/servicedef/services.xml" />
<response name="success" type="request" value="ProttayEmployeeLeavesView" />
<response name="error" type="view" value="ProttayEmployeeLeavesView" />
</request-map>
<request-map uri="sendEmailForLeaveToEmployee"><! -- Send mail to Employee after
send Email to Admin -->
<security https="true" auth="true" />
<event type="service" invoke="sendEmailForLeaveReverse"
path="component://humanres/servicedef/services.xml" />
<response name="success" type="view" value="EmplLeaveAdd" />
<response name="error" type="view" value="EmplLeaveAdd" />
</request-map>
<!-- end -->
<request-map uri="SearchEmplLeaves">
<security https="true" auth="true" />
<response name="success" type="view" value="SearchEmplLeaves" />
</request-map>
<request-map uri="EditEmplLeave">
<security https="true" auth="true" />
<response name="success" type="view" value="EditEmplLeave" />
</request-map>
<request-map uri="deleteEmplLeave">
<security https="true" auth="true" />
<event type="service" invoke="deleteEmplLeave" />
<response name="success" type="view" value="FindEmplLeaves" />
<response name="error" type="view" value="FindEmplLeaves" />
</request-map>
<request-map uri="EditEmplLeaveTypes">
<security https="true" auth="true" />
<response name="success" type="view" value="EditEmplLeaveTypes" />
</request-map>
<!-- added for employye leave types -->
<request-map uri="AddEmplLeaveTypes">
<security https="true" auth="true" / >
<response name="success" type="view" value="AddEmplLeaveTypes" />
</request-map>
<request-map uri="ListEmplLeaveTypes">
<security https="true" auth="true" />
<response name="success" type="view" value="ListEmplLeaveTypes" />
</request-map>
<request-map uri="NewEditEmplLeaveTypes">
<security https="true" auth="true" />
<response name="success" type="view" value="NewEditEmplLeaveTypes" />
</request-map>
<!-- end -->
<request-map uri="createEmplLeaveType">
<security https="true" auth="true" />
<event type="service" invoke="createEmplLeaveType" />
<response name="success" type="view" value="EditEmplLeaveTypes" />
<response name="error" type="view" value="EditEmplLeaveTypes" />
</request-map>
<request-map uri="updateEmplLeav eType">

<security https="true" auth="true" />
<event type="service" invoke="updateEmplLeaveType" />
<response name="success" type="view" value="EditEmplLeaveTypes" />
<response name="error" type="view" value="EditEmplLeaveTypes" />
</request-map>
<request-map uri="deleteEmplLeaveType">
<security https="true" auth="true" />
<event type="service" invoke="deleteEmplLeaveType" />
<response name="success" type="view" value="EditEmplLeaveTypes" />
<response name="error" type="view" value="EditEm plLeaveTypes" />
</request-map>

<request-map uri="calculateLeaveWithoutHoliday">
<security https="true" auth="true" />
<event type="service" invoke="calculateLeaveWithoutHoliday" />
<response name="success" type="request" value="json" />
<response name="error" type="request" value="json" />
</request-map>
<view-map name="EmplLeaveAdd" type="screen"
page="component://humanres/widget/EmplLeaveScreens.xml#EmplLeaveAdd" />
<!--Leave apply for admin -->
<view-map name="AdminLeaveAdd" type="screen"
page="component://humanres/widget/EmplLeaveScreens.xml#AdminLeaveAdd" />
<view-map name="EditEmplLeaveStatusDetail" type="screen"
page="component://humanres/widget/EmplLeaveScreens.xml#EditEmplLeaveStatusDetail" />
<view-map name="EditEmployeeLeaves" type ="screen"
page="component://humanres/widget/EmployeeScreens.xml#EditEmployeeLeaves" />
<view-map name="ProttayEmployeeLeavesView" type="screen"
page="component://humanres/widget/EmployeeScreens.xml#EmployeeLeavesView" />
<view-map name="LeaveResetAdmin" type="screen"
page="component://humanres/widget/EmplLeaveScreens.xml#LeaveResetAdmin" />
<view-map name="ProttayEmployeeLeavesViewAdmin" type="screen"
page="component://humanres/widget/EmployeeScreens.xml#ProttayEmployeeLeavesViewAdmin" />
<view-map name="SearchEmplLeaves" type="screen"
page="component://humanres/widget/EmplLeaveScreens.xml#SearchEmplLeaves" />
<!-- end -->
<view-map name="EditEmplLeave" type="screen"
page="component://humanres/widget/EmplLeaveScreens.xml#EditEmplLeave" />
<view-map name="EditEmplLeaveTypes" type="screen"
page="component://humanres/widget/GlobalHRSettingScreens.xml#EditEmplLeaveTypes" />
<view-map name="NewEditEmplLeaveTypes" type="screen"
page="component://humanres/widget/GlobalHRSettingScreens.xml#NewEditEmplLeaveType s" />

<view-map name="AddEmplLeaveTypes" type="screen"
page="component://humanres/widget/GlobalHRSettingScreens.xml#AddEmplLeaveTypes" />
<view-map name="ListEmplLeaveTypes" type="screen"
page="component://humanres/widget/GlobalHRSettingScreens.xml#List EmplLeaveTypes" />
<!-- end -->
<view-map name="EditEmplLeaveReasonTypes" type="screen"
page="component://humanres/widget/GlobalHRSettingScreens.xml#EditEmplLeaveReasonTypes" />
<!-- added for employee leave reason type -->
<view-map name="AddEmplLeave ReasonTypes" type="screen"
page="component://humanres/widget/GlobalHRSettingScreens.xml#AddEmplLeaveReasonTypes" />
<view-map name="ListEmplLeaveReasonTypes" type="screen"
page="component://humanres/widget/GlobalHRSettingScreens.xml#ListEmplLeaveReasonTyp es" />
<!-- end -->
<view-map name="FindLeaveApprovals" type="screen"
page="component://humanres/widget/EmplLeaveScreens.xml#FindLeaveApprovals" />
<view-map name="EditEmplLeaveStatus" type="screen"
page="component://humanres/widget/EmplLeaveScreens.xml #EditEmplLeaveStatus" />
<view-map name="EditInternalOrgFtl" type="screen"
page="component://humanres/widget/EmplPositionScreens.xml#EditInternalOrgFtl" />
<view-map name="RemoveInternalOrgFtl" type="screen"
page="component://humanres/widget/EmplPosition Screens.xml#RemoveInternalOrgFtl" />
<view-map name="ProttayPositionResponsibilities" type="screen"
page="component://humanres/widget/EmplPositionScreens.xml#ProttayPositionResponsibilities"
/>


<!-- ==================Employee Finacial Accounts======== ============= -->
<view-map name="EditFinAccounts" type="screen"
page="component://humanres/widget/EmployeeScreens.xml#EditFinAccounts" />

<view-map name="viewUpdateFinacialAccounts" type="screen"
page="component://humanres/widget/EmployeeScreens.xml#updateFinAccounts" />

</site-conf>




<>===================================<>
EmplLeaveScreen.xml
<>===================================<>
<?xml version="1.0" encoding="UTF -8"?>
<screens xmlns:xsi="ht tp://www.w3.org/2001/XMLSchema -instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget -screen.xsd">
<screen name="FindEmplLeaves">
<section>
<actions>
<set field="titleProperty" value="HumanResFindEmplLeave" />
<set field="headerItem" value="Leave" />
<set field="tabButtonItem" value="EmployeeLeave" />
<set field="partyId" from -field="parameters.partyId" />
<set field="leaveTypeId" from -field="parameters.leaveTypeId" />
<set field="fromDate" from -field="parameters.fromDate" />
<set field="emplLeaveCtx" from -field="parameters" />
<service service-name="humanResManagerPermission" result -
map="permResult">
<field-map field-name="mainAction" value="ADMIN" />
</service>
<set field="hasAdminPer mission" from-
field="permResult.hasPermission" />
</actions>
<widgets>
<decorator-screen name="main-decorator"
location="${parameters.mainDecoratorLocation}">
<decorator-section name="pre-body">
<include-menu name="EmplLeaveTabBar"
location="component://humanres/widget/HumanresMenus.xml" />
</decorator-section>
<decorator-section name="body">

<section>
<condition>
<if-has-permission
permission="HUMANRES" action="_VIEW" />
</condition>
<widgets>
<decorator-screen
name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
<!--<decorator-section
name="menu-bar"> <section> <widgets> <container style="button -bar"> <link
target="EditEmplLeave" text="${uiL abelMap.HumanResNewLeave}" style="buttontext create"/>
</container> </widgets> </section> </decorator -section> -->
<decorator-section
name="search-options">
<include-form
name="FindEmplLeaves" location="component://humanres/widget/forms/ EmplLeaveForms.xml" />
<include-menu
location="component://humanres/widget/HumanresMenus.xml" name="EmplLeavesActionMenu" />
</decorator-section>
<decorator-section
name="search-results">
<include-form
name="ListEmplLeaves" location="component://humanres/widget/forms/EmplLeaveForms.xml" />
</decorator-section>
</decorator-screen>
</widgets>
</section>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>

<!-- Added for Employee leave Approval -->
<screen name="EmplLeavesListForAdmin">
<section>
<actions>
<set field="titleProperty"
value="PageTitleViewPartyEmplLeavesListForAdmin" />
<set field="tabButtonItem" value="EmplLeavesListForAdmin" />
<set field="headerItem" value="Leave" />
<set field="actionButtonItem" value="profile" />
<set field="parameters.partyId" value="${parameters.partyId}"
default-value="${userLogin.partyId}" />

<entity-condition list="approvers" entity -
name="UserLoginSecurityGroup" filter -by-date="true">
<condition-list>
<condition-expr field-name="groupId"
operator="equals" value="HUMANRES_ADMIN" />
<condition-expr field-name="userLoginId"
operator="not-equals" value="admin" />
</condition-list>
</entity-condition>

<set field="approverPartyId" value="${userLogin.partyId}" />
<service service-name="findEmplLeave" auto -field-map="true"
result-map="emplLeaveResult" />
<set field="result"
value="${emplLeaveResult.employeeLea veList}" />

<entity-and list="leaveInfo" entity -name="PartyContactMech">
<field-map field-name="partyId"
value="${result[0].partyId}" />
</entity-and>
<entity-and list="listContactMech" entity -name="ContactMech">
<field-map field-name="contactMechId"
value="${leaveInfo[0].contactMechId}" />
</entity-and>

<entity-and list="leaveInfo1" entity -name="PartyContactMech">
<field-map field-name="partyId"
value="${userLogin.partyId}" />
</entity-and>
<entity-and list="listContactMech1" entity -name="ContactMech">
<field-map field-name="contactMechId"
value="${leaveInfo1[0].contactMechId}" />
</entity-and>
<entity-and entity-name="UserLogin" list="userLoginList">
<field-map field-name="partyId"
value="${result[0].partyId}" />
</entity-and>
<set field="emplId" from -field="userLoginList[0].userLoginId"
/>
<!-- <set field="sendFrom"
value="${listContactMech[0].infoString}"/> <set field="sendTo"
value="${listContactMech1[0].infoString}"/> -->
<set field="subject" value="Leave Status Changed" />
<set field="bodyText" value="Leave status changed successfuly."
/>

</actions>
<widgets>
<decorator-screen name="main-decorator"
location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">

<include-menu
location="component://humanres/widget/HumanresMenus.xml" name="LeaveSubmissionActionMenu"
/>
<!-- <include-menu
location="component://humanres/widget/HumanresMenus.xml" name="ContactNavigationMenu"/ > --
>

<screenlet title="Leave Request Waiting For
Approval">

<section>
<widgets>
<include-form
name="ListEmplLeavesForAdmin"
location="component://humanres/widget/forms/EmplLeaveForms.xml" />
</widgets>
</section>
</screenlet>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>

<!-- This screen is designed for resetting the leave -->
<screen name="LeaveResetAdmin">
<section>
<actions>
<set field="titleProperty" value="HumanResLeaveReset" />
<set field="headerItem" value="Leave" />
<set field="actionButtonItem" value="ResetEmployeeLeave" />

</actions>

<widgets>
<decorator-screen name="main-decorator"
location="${parameters .mainDecoratorLocation}">
<decorator-section name="body">
<include-menu
location="component://humanres/widget/HumanresMenus.xml" name="LeaveSubmissionActionMenu"
/>
<screenlet title="Reset Leave">
<include-form name="LeaveResetAdmin "
location="component://humanres/widget/forms/EmplLeaveForms.xml" />
</screenlet>
</decorator-section>
</decorator-screen>
</widgets>

</section>
</screen>

<screen name="LeaveListAdmin">
<section>
<actions>
<set field="titleProperty" value="HumanResListLeaveStatistics"
/>
<set field="headerItem" value="Leave" />
<set field="tabButtonItem" value="ProttayEmployeeLeavesView" />
<set field="actionButtonItem" value="Leave" />
<set field="parameters.part yId" value="${parameters.partyId}"
default-value="${userLogin.partyId}" />
<set field="result" from -field="parameters.result" />
</actions>

<widgets>
<decorator-screen name="main-decorator"
location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">

<include-menu
location="component://humanres/widget/HumanresMenus.xml" name="LeaveSubmissionActionMenu"
/>
<!-- <include-form name="EmplLeavesList"
location="component://humanres/widget/forms/EmployeeForms.xml " /> -->
<screenlet collapsible="true"
title="${uiLabelMap.HumanResListEmplLeaveStatistics}" id="employee_leave">
<include-form name="EmplLeavesList"
location="component://humanres/widget/forms/EmployeeForms.xml" />
</screenlet>
</decorator-section>
</decorator-screen>
</widgets>

</section>
</screen>

<screen name="ProttayEmployeeLeavesView">
<section>
<actions>
<set field="titleProperty" value="PageTitleEditApprovalStatus"
/>
<set field="tabButtonItem" value="Leave" />
<set field="partyId" from -field="parameters.partyId" />
<set field="leaveTypeId" from -field="parameters.leaveTypeId" />
<set field="fromDate" from -field="parameters.fromDate" />
<set field="headerItem" value="Leave" />
</actions>

<widgets>
<decorator-screen name="main-decorator"
location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<screenlet id="AddEmplLeavePanel" title="Apply For
Leave" collapsible="true">

</screenlet>
<include-menu
location="component://humanres/widget/HumanresMenus.xml"
name="ApplyForLeaveNavigationMenu" />
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>

<!-- <screen name="LeaveApplyAdmin"> <section> <ac tions> <set field="titleProperty"
value="PageTitleViewPartyEmplLeavesListForAdmin" /> <set field="tabButtonItem"
value="EmplLeavesListForAdmin" /> <set field="headerItem" value="Leave"/> <set
field="actionButtonItem" value="LeaveApplyAdmin" /> <set field=" titleProperty"
value="HumanResEditEmplLeave" /> <set field="partyId" from -field="parameters.partyId"
default-value="${userLogin.partyId}" /> <entity -one entity-name="EmplLeave" value -
field="leaveApp" /> <entity -and list="approvers" entity -name="UserLoginSecurityGroup">
<field-map field-name="groupId" value="HUMANRES_ADMIN" /> </entity -and> <entity-condition
list="approvers" entity -name="UserLoginSecurityGroup" filter -by-date="true"> <condition -
list> <condition-expr field-name="groupId" operator="equals"
value="HUMANRES_ADMIN" /> <condition -expr field-name="userLoginId"
operator="not-equals" value="admin" /> </condition -list> </entity-condition> <entity-and
list="leaveInfo" entity -name="PartyContactMech"> <field -map field-name="partyId" from-
field="userLogin.partyId"/> </entity -and> <entity-and list="listContactMech" entity -
name="ContactMech"> <field -map field-name="contactMechId"
value="${leaveInfo[0].contactMechId}"/> <field -map field-name="contactMechTypeId"
value="EMAIL_ADDRESS"/> </entity -and> <entity-and list="leaveInfo1" entity -
name="PartyContactMech"> <field -map field-name="partyId" value="hradmin"/> </entity -and>
<entity-and list="listContactMech1" entity -name="ContactMech"> <field -map field-
name="contactMechId" value="${leaveInfo1[0].contactMechId} "/> <field-map field-
name="contactMechTypeId"
value="EMAIL_ADDRESS"/> </entity -and> <set field="subject" value="New Leave
Application"/> <set field="bodyText" value="A new applicationn for leave created
successfully"/> </actions> <widgets> <decorator -screen name="main-decorator"
location="${parameters.mainDecoratorLocation}"> <decorator -section name="body"> <include -
menu location="component://humanres/widget/HumanresMenus.xml"
name="LeaveSubmissionActionMenu" /> <screenlet id="AddEmplLeavePanel" title="A pply For
Leave" collapsible="true"> <include -form name="EditEmplLeave"
location="component://humanres/widget/forms/EmplLeaveForms.xml" /> </screenlet>
</decorator-section> </decorator -screen> </widgets> </section> </screen> -->

<!-- added for employee le ave -->
<screen name="SearchEmplLeaves">
<section>
<actions>
<set field="titleProperty" value="HumanResFindEmplLeave" />
<set field="headerItem" value="LeaveEmployee" />
<set field="tabButtonItem" value="EmployeeLeave" />
<set field="partyId" from -field="parameters.partyId" />
<set field="leaveTypeId" from -field="parameters.leaveTypeId" />

<set field="fromDate" from -field="parameters.fromDate" />
<set field="emplLeaveCtx" from -field="parameters" />
<service service-name="humanResManagerPermission" result -
map="permResult">
<field-map field-name="mainAction" value="ADMIN" />
</service>
<set field="hasAdminPermission" from -
field="permResult.hasPermission" />
</actions>
<widgets>
<decorator-screen name="main-decorator"
location="${parameters.mainDecoratorLocation}">
<decorator-section name="pre-body">
<include-menu name="EmplLeaveTabBar"
location="component://humanres/widget/HumanresMenus.xml" />
</decorator-section>
<decorator-section name="body">
<section>
<condition>
<if-has-permission
permission="HUMANRES" action="_VIEW" />
</condition>
<widgets>
<decorator-screen
name="FindScreenDecorator" location="component://common/widget/Comm onScreens.xml">
<!--<decorator-section
name="menu-bar"> <section> <widgets> <container style="button -bar"> <link
target="EditEmplLeave" text="${uiLabelMap.HumanResNewLeave}" style="buttontext create"/>
</container> </widgets> </section> </decorato r-section> -->
<decorator-section
name="search-options">
<include-menu
location="component://humanres/widget/HumanresMenus.xml" name="EmplLeavesActionMenu" />
<include-form
name="FindEmplLeaves" location="component://humanres/w idget/forms/EmplLeaveForms.xml" />
</decorator-section>
<decorator-section
name="search-results">
<include-form
name="ListEmplLeaves" location="component://humanres/widget/forms/EmplLeaveForms.xml" />
</decorator-section>
</decorator-screen>
</widgets>
</section>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
<!-- end -->
<screen name="FindLeaveApprovals">
<section>
<actions>
<set field="titleProperty" value="PageTitleFindApprovals" />
<set field="tabButtonItem" value="Approval" />
<set field="headerItem" value="Leave" />
<service service-name="humanResManagerPermission" result -
map="permResult">
<field-map field-name="mainAction" value="ADMIN" />
</service>
<set field="hasAdminPermission" from -
field="permResult.hasPermission" />
<set field="approverPartyId" from -
field="parameters.userLogin.partyId" />
</actions>
<widgets>
<decorator-screen name="main-decorator"
location="${parameters.mainDecoratorLocation}">
<decorator-section name="pre-body">
<include-menu name="EmplLeaveTabBar"
location="component://humanres/widget/HumanresMenus.xml" />
</decorator-section>
<decorator-section name="body">

<section>
<condition>
<if-has-permission
permission="HUMANRES" action="_VIEW" />
</condition>
<widgets>
<decorator-screen
name="FindScreenDecorator" location="component://common/widg et/CommonScreens.xml">

<decorator-section
name="search-options">
<include-menu
name="LeaveApprovalActionMenu" location="component://humanres/widget/HumanresMenus.xml" />
<include-form
name="FindLeaveApprovals" location="compon ent://humanres/widget/forms/EmplLeaveForms.xml"
/>
</decorator-section>
<decorator-section
name="search-results">
<include-form
name="ListLeaveApprovals" location="component://humanres/widget/forms/EmplLeaveForms.xml"
/>
</decorator-section>
</decorator-screen>
</widgets>
<fail-widgets>
<label
style="h3">${uiLabelMap.HumanResViewPermissionError}
</label>
</fail-widgets>
</section>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>

</screens>


<>===================================<>
HumanresMenus.xml
<>===================================<>
<?xml version="1.0" encoding="UTF -8"?>

<menus xmlns:xsi="http://www.w3.org/2001/XMLSchema -instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget -menu.xsd">
<menu name="HumanResAppBar" title="${uiLabelMap.HumanResManager}" default -menu-
item-name="profile" id="app -navigation" type="simple" default-selected-style="selected"
menu-container-style="button-bar tab-bar" selected-menuitem-context-field-
name="headerItem">
<menu-item name="Leave" title="${uiLabelMap.HumanResEmplLeave}">
<condition>
<if-has-permission permission="HU MANRES" action="_ADMIN" />
</condition>
<link target="EmplLeavesListForAdmin" />
</menu-item>
<!-- THis is for Normal User -->
<menu-item name="LeaveEmployee" title="${uiLabelMap.HumanResEmplLeave}">
<condition>
<not>
<if-has-permission permission="HUMANRES" action="_ADMIN"
/>
</not>
</condition>
<link target="ProttayEmployeeLeavesView?partyId=${userLogin.partyId}"
/>
</menu-item>
<!-- <menu-item name="PaySlip" title="Payslip"> <condition> <not> <if -has-
permission permission="HUMANRES" action="_ADMIN"/> </not> </condition> <link
target="PaySlipIndividual?partyId=${userLogin.partyId}" /> </menu -item> <menu-item
name="SalaryProcess" title="${uiLabelMap.salary}"> <condition> <if -has-permission
permission="HUMANRES" action=" _EXEC" /> </condition> <link target="SalaryProcess" />

</menu-item> <menu-item name="PayrollConfig" title="${uiLabelMap.HumanResSalaryConfig}">
<condition><if-has-permission permission="HUMANRES" action="_ADMIN" /></condition> <link
target="PayrollConfig" /> </menu-item> -->
<menu-item name="GlobalHRSettings"
title="${uiLabelMap.HumanResGlobalHRSettings}">
<condition>
<if-has-permission permission="HUMANRES" action="_ADMIN" />
</condition>
<link target="ListEmplLeaveTypes" />
</menu-item>

<!-- <menu-item name="ChangeRequestForApprover"
title="${uiLabelMap.HumanResChangeRequest}"> <condition> <if -has-permission
permission="HUMANRES" action="_ADMIN" /> </condition> <link
target="ChangeRequestForApprover" /> </menu -item> <menu-item name="profile"
title="Profile" > <link target="EmployeeProfile?partyId=${userLogin.partyId}" /> </menu -
item> -->
<!-- Organization Menu for HR -->
<!-- <menu-item name="organization" title="Organization"> <condition> <if -
has-permission permission="HUMANRES" act ion="_ADMIN" /> </condition> <link
target="OrganizationMain" /> </menu -item> -->
<menu-item name="security" title="Security">
<condition>
<if-has-permission permission="HUMANRES" action="_ADMIN" />
</condition>
<link target="FindSecurityGrou p" />
</menu-item>
</menu>
<menu name="EmplLeavesCreateMenu" default -menu-item-name="AddEmplLeaves" default -
selected-style="selected" type="simple" menu -container-style="button-bar tab-bar"
selected-menuitem-context-field-name="tabButtonItem">
<menu-item name="AddEmplLeaves" selected -style="selected" title="Apply for
Leave">
<link target="EmplLeaveAdd" />
</menu-item>
</menu>
<!--Leave apply for admin -->
<menu name="AdminLeaveCreateMenu" default -menu-item-name="AddEmplLeaves" default -
selected-style="selected" type="simple" menu -container-style="button-bar tab-bar"
selected-menuitem-context-field-name="tabButtonItem">
<menu-item name="AddEmplLeaves" selected -style="selected" title="Apply for
Leave">
<link target="AdminLeaveAdd" />
</menu-item>
</menu>
<menu name="LeaveEmployees" default -menu-item-name="LeaveEmployees" default -
selected-style="selected" type="simple" menu -container-style="button-bar tab-bar"
selected-menuitem-context-field-name="tabButtonItem">
<menu-item name="LeaveEmployees" selected-style="selected" title="Back to
Leave">
<link target="ProttayEmployeeLeavesView?partyId=${userLogin.partyId}"
/>
</menu-item>
</menu>
<menu name="LeaveEmployeesForAdmins" default -menu-item-name="LeaveEmployees"
default-selected-style="selected" type="simple" menu -container-style="button-bar tab-bar"
selected-menuitem-context-field-name="tabButtonItem">
<menu-item name="LeaveEmployeesForAdmins" selected -style="selected"
title="Back to Leave request approval">
<link target="EmplLeavesListForAdmin" />
</menu-item>
</menu>
<!-- added for employee leave -->
<menu name="EmplLeavesActionMenu" default -menu-item-name="SearchEmplLeaves"
default-selected-style="selected" type="simple" menu -container-style="left-hr-action-menu"
selected-menuitem-context-field-name="actionButtonItem">
<menu-item name="AddEmplLeaves" selected -style="selected">
<link target="EditEmplLeave" style="hr -add-icon" />
</menu-item>
<menu-item name="SearchEmplLeaves" selected -style="selected">
<link target="SearchEmplLeaves" style="hr -search-icon" />
</menu-item>
</menu>

<!-- end -->
<!-- added for leave approval -->
<menu name="LeaveApprovalActionMenu" default -menu-item-name="SearchLeaveApprovals"
default-selected-style="selected" type="simple" menu -container-style="left-hr-action-menu"
selected-menuitem-context-field-name="actionButtonItem">
<menu-item name="SearchLeaveApprovals" selected -style="selected">
<link target="FindLeaveApprovals" style="hr -search-icon" />
</menu-item>
</menu>
<!-- end -->

</menus>


<>===================================<>
EmplLeaveForms.xml
<>===================================<>
<?xml version="1.0" encoding="UTF -8"?>

<forms xmlns:xsi="http://www.w3.org/2001/XMLSchema -instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget -form.xsd">
<form name="FindEmplLeaves" type="single" target="FindEmplLeaves"
odd-row-style="header-row" default-table-style="basic-table">
<auto-fields-entity entity-name="EmplLeave" default -field-type="find"/>
<field name="partyId" title="${uiLabelMap.PartyPartyId}"><lookup target -form-
name="LookupPartyName"/></field>
<field name="leaveTypeId">
<drop-down allow-empty="true">
<entity-options description="${description}" key -field-name="leaveTypeId"
entity-name="EmplLeaveType"/>
</drop-down>
</field>
<field name="emplLeaveReasonTypeId">
<drop-down allow-empty="true">
<entity-options description="${description}" key -field-
name="emplLeaveReasonTypeId" entity -name="EmplLeaveReasonType"/>
</drop-down>
</field>
<field name="leaveStatus">
<drop-down allow-empty="true">
<entity-options description="${description}" key -field-name="statusId"
entity-name="StatusItem">
<entity-constraint name="statusTypeId" operator="equals"
value="LEAVE_STATUS"/>
<entity-order-by field-name="description"/>
</entity-options>
</drop-down>
</field>
<field name="approverPartyId"><lookup target -form-name="LookupPartyName"/></field>
<field name="description"><hidden/></field>
<field name="noConditionFind"><h idden value="Y"/><!-- if this isn't there then
with all fields empty no query will be done --></field>
<field name="searchButton" title="${uiLabelMap.CommonFind}" widget -
style="smallSubmit"><submit button -type="button"/></field>
</form>
<form name="EditEmplLeaveStatus" type="single" target="updateEmplLeaveStatus" default -
map-name="leaveApp">
<auto-fields-service service-name="updateEmplLeaveStatus" map -name="leaveApp"/>
<field name="partyId"><display/></field>
<field name="approverPartyId"><display/></field>
<field name="leaveTypeId"><display/></field>
<field name="emplLeaveReasonTypeId"><display/></field>
<field name="fromDate"><display/></field>
<field name="thruDate"><display/></fie ld>
<field name="description"><display/></field>
<field name="leaveStatus" title="${uiLabelMap.HumanResLeaveStatus}">
<drop-down allow-empty="false">
<entity-options description="${description}" key -field-name="statusId"
entity-name="StatusItem">
<entity-constraint name="statusTypeId" operator="equals"
value="LEAVE_STATUS"/>
<entity-order-by field-name="description"/>
</entity-options>

</drop-down>
</field>
<field name="leaveStatus" use -
when="leaveApp!=null&amp;&amp;leaveApp.getString(&quot;leaveStatus&quot;).equals(&quot;LEA
VE_REJECTED&quot;)"><display></display></field>
<field name="submitButton" title="${uiLabelMap.Common Update}" widget-
style="smallSubmit"><submit button -type="button"/></field>
</form>
</forms>


<>===================================<>
services.xml
<>===================================<>
<?xml version="1.0" encoding="UTF -8"?>

<services xmlns:xsi="http://www.w3.org/2001/XMLSchema -instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
<description>Human Resources Services</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
<service name="updateEmpl LeaveStatus" engine="java" default -entity-name="EmplLeave"
location="org.ofbiz.humanres.LeaveEvents" invoke="updateEmplLeaveStatus" auth="true">
<description>Update Leave Approval Status</description>
<permission-service service-name="humanResManagerPe rmission" main-
action="UPDATE" />

<attribute name="approverPartyId" type="String" mode="IN" optional="true" />
<attribute name="partyId" type="String" mode="IN" optional="true" />
<attribute name="fromDate" type="Timestamp" mode="IN" optional="true" />
<attribute name="thruDate" type="Timestamp" mode="IN" optional="true" />
<attribute name="leaveTypeId" type="String" mode="IN" optional="true" />
<attribute name="leaveAction" type="String" mode="IN" optional="true" />
<attribute name="emplLeav eReasonTypeId" type="String" mode="IN"
optional="true" />
<attribute name="leaveStatus" type="String" mode="IN" optional="true" />
<attribute name="description" type="String" mode="IN" optional="true" />
<attribute name="remarks" type="String" mode=" IN" optional="true" />
<attribute name="customTimePeriodId" type="String" mode="IN"
optional="false" />
<attribute name="isSuccess" type="String" mode="OUT" optional="true" />


</service>

<service name="sendEmailForLeave" engine="java"
location="org.ofbiz.humanres.LeaveEvents" invoke="sendEmailForLeaveToAdmin" auth="true">
<description>Send an email for leave</description>
<implements service="createCommunicationEventWithoutPermission" />
<auto-attributes mode="IN" include="pk" optional="false " />
<auto-attributes mode="IN" include="nonpk" optional="true" />
<attribute name="partyId" type="String" mode="IN" optional="true" />
<attribute name="approverPartyId" type="String" mode="IN" optional="true" />
<!-- <attribute name="sendFrom" type="String" mode="IN" optional="false"/>
<attribute name="sendTo" type="String" mode="IN" optional="false"/> -->
<attribute name="subject" type="String" mode="IN" optional="true" />
<attribute name="bodyText" type="String" m ode="IN" optional="true" allow -
html="safe" />
</service>
<service name="sendEmailForLeaveAccepted" engine="java"
location="org.ofbiz.humanres.LeaveEvents" invoke="sendEmailForLeaveAccepted" auth="true">
<description>Send an email for leave</description >
<implements service="createCommunicationEventWithoutPermission" />
<auto-attributes mode="IN" include="pk" optional="false" />
<auto-attributes mode="IN" include="nonpk" optional="true" />
<attribute name="partyId" type="String" mode="IN" optiona l="true" />
<attribute name="approverPartyId" type="String" mode="IN" optional="true" />
<!-- <attribute name="sendFrom" type="String" mode="IN" optional="false"/>
<attribute name="sendTo" type="String" mode="IN" optional="false"/> -->
<attribute name="subject" type="String" mode="IN" optional="true" />
<attribute name="bodyText" type="String" mode="IN" optional="true" allow -
html="safe" />
</service>

<service name="sendEmailForLeaveRejected" engine="java"
location="org.ofbiz.humanres.LeaveEvents" invoke="sendEmailForLeaveRejected" auth="true">
<description>Send an email for leave</description>
<implements service="createCommunicationEventWithoutPermission" />
<auto-attributes mode="IN" include="pk" optional="false" />
<auto-attributes mode="IN" include="nonpk" optional="true" />
<attribute name="partyId" type="String" mode="IN" optional="true" />
<attribute name="approverPartyId" type="String" mode="IN" optional="true" />
<!-- <attribute name="sendFrom" type="String" mode="IN" optional ="false"/>
<attribute name="sendTo" type="String" mode="IN" optional="false"/> -->
<attribute name="subject" type="String" mode="IN" optional="true" />
<attribute name="bodyText" type="String" mode="IN" optional="true" allow -
html="safe" />
</service>
<service name="sendEmailForLeaveReverse" engine="simple"
location="component://humanres/script/org/ofbiz/humanres/HumanResServices.xml"
invoke="sendEmailForLeaveReverse">
<description>Send an email for leave</description>
<implements service="createCommunicationEventWithoutPermission" />
<attribute name="partyId" type="String" mode="IN" optional="true" />
<attribute name="approverPartyId" type="String" mode="IN" optional="false"
/>
<attribute name="sendFrom" type="String" mode="I N" optional="false" />
<attribute name="sendTo" type="String" mode="IN" optional="false" />
<attribute name="subject" type="String" mode="IN" optional="true" />
<attribute name="bodyText" type="String" mode="IN" optional="true" allow -
html="safe" />
</service>
</services>

<>===================================<>
HumenResService.xml
<>===================================<>
<?xml version="1.0" encoding="UTF -8"?>

<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema -instance"
xsi:noNamespaceSchema Location="http://ofbiz.apache.org/dtds/simple -methods-v2.xsd">
<simple-method method-name="getArithmeticSettingsInline" short -
description="getArithmeticSettingsInline">
<property-to-field resource="arithmetic" property="finaccount.decimals"
field="roundingDecimals" default="2"/>
<property-to-field resource="arithmetic"
property="finaccount.roundingSimpleMethod" field="roundingMode" default="HalfUp"/>
<log level="verbose" message="Got settings from arithmetic.properties:
roundingDecimals=${roundingDecimals}, roundingMode=${roundingMode}"/>
</simple-method>

<!-- update PartyContent and PartyContentDetail by HR admin for photo approval -->
<simple-method method-name="updateContentByHradminForEmployee" short -
description="Update partyContentTypeId of PartyContent and PartyContentDetail">
<entity-one entity-name="PartyContent" value -field="lookedUpValue"/>
<set-pk-fields value-field="lookedUpValue" map="parameters"/>
<set-nonpk-fields value-field="lookedUpValue" map="parameters"/>
<remove-value value-field="lookedUpValue"/>

<set field="lookedUpValue.partyContentTypeId" value="INTERNAL" />
<create-value value-field="lookedUpValue"/>

<set field="successMessage" value="Photo Approved Successfully"/>
</simple-method>
<simple-method method-name="updateFinAccount" short -description="Update a Financial
Account">
<call-simple-method method-name="getArithmeticSettingsInline"/>

<entity-one entity-name="FinAccount" value -field="lookedUpValue"/>
<!-- <field-to-result field="lookedUpValue.replenishPaymentId" result -
name="oldReplenishPaymentId"/>
<field-to-result field="lookedUpValue.replenishLevel" result -
name="oldReplenishLevel"/> -->

<!-- handle statusId change stuff; first put the current statusId in the
oldStatusId result -->

<!-- <field-to-result field="lookedUpValue.statusId" result -name="oldStatusId"/> -
->
<if>
<condition>
<and>
<not><if-empty field="parameters.statusId"></if -empty></not>
<if-compare-field operator="not-equals" field="lookedUpValue.statusId"
to-field="parameters.statusId"></if -compare-field>
</and>
</condition>
<then>
<!-- if the record exists there should be a statusId, but just in case
make it so it won't blow up -->
<if-not-empty field="lookedUpValue.statusId">
<!-- if statusId change is not in the StatusValidChange list,
complain... -->
<entity-one entity-name="StatusValidChange" value -
field="statusValidChange" auto -field-map="false">
<field-map field-name="statusId" from-
field="lookedUpValue.statusId"/>
<field-map field-name="statusIdTo" from -
field="parameters.statusId"/>
</entity-one>
<if-empty field="statusValidChange">
<!-- no valid change record found? return an error... -->
<add-error>
<fail-property resource="CommonUiLabels"
property="CommonErrorNoStatusValidChange"/>
</add-error>
<check-errors/>
</if-empty>
</if-not-empty>

<!-- before we set the nonpk fields, if the statusId is different save a
status history record -->
<set-service-fields service-name="createFinAccountStatus" map="parameters"
to-map="createFinAccountStatusMap"/>
<call-service service-name="createFinAccountStatus" in -map-
name="createFinAccountStatusMap"/>
</then>
<else>
<if-compare field="lookedUpValue.statusId" operator="equals"
value="FNACT_MANFROZEN">
<add-error>
<fail-property resource="AccountingErrorUiLabels"
property="AccountingFinAccountInactiveStatusError"/>
</add-error>
</if-compare>
<if-compare field="lookedUpValue.statusId" operator="equals"
value="FNACT_CANCELLED">
<add-error>
<fail-property resource="AccountingErrorUiLabels"
property="AccountingFinAccountStatusNotValidError"/>
</add-error>
</if-compare>
<check-errors/>
</else>
</if>

<set-nonpk-fields map="parameters" value -field="lookedUpValue"/>

<!-- make sure the replenishLevel is a sane number -->
<calculate field="lookedUpValue.replenishLevel" decimal -
scale="${roundingDecimals}" rounding -mode="${roundingMode}">
<calcop operator="get" field="lookedUpValue.replenishLev el"/>
</calculate>
<store-value value-field="lookedUpValue"/>

<!-- <field-to-result field="lookedUpValue.replenishPaymentId" result -
name="replenishPaymentId"/>
<field-to-result field="lookedUpValue.replenishLevel" result -
name="replenishLevel"/>

<field-to-result field="lookedUpValue.finAccountId" result -name="finAccountId"/> -
->
<field-to-result field="parameters.partyId" result -name="partyId"/>
<set field="successMessage" value="Financial Account Upda ted Successfully"/>
</simple-method>
</simple-methods>


<>===================================<>
LeaveEvents.java
<>===================================<>
package org.ofbiz.humanres;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import javolution.util.FastList;
import javolution.util.FastMap;

import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilDateTime;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilProperties;
import org.ofbiz.base.util.UtilVali date;
import org.ofbiz.entity.Delegator;
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
import org.ofbiz.entity.condition.EntityCondition;
import org.ofbiz.entity.condition.EntityConditionList;
import org.ofbiz.entity .condition.EntityExpr;
import org.ofbiz.entity.condition.EntityOperator;
import org.ofbiz.entity.util.EntityFindOptions;
import org.ofbiz.entity.util.EntityListIterator;
import org.ofbiz.entity.util.EntityUtil;
import org.ofbiz.humanres.prottay.salary.util s.EmailUtils;
import org.ofbiz.humanres.prottay.salary.utils.SalaryUtils;
import org.ofbiz.product.store.ProductStoreWorker;
import org.ofbiz.service.DispatchContext;
import org.ofbiz.service.GenericServiceException;
import org.ofbiz.service.LocalDispatcher;
import org.ofbiz.service.ModelService;
import org.ofbiz.service.ServiceUtil;

public class LeaveEvents {
public static final String module = LeaveEvents.class.getName();
public static String getLeaveActionDefaultValue( String leaveStatus){

if (leaveStatus.equals("LEAVE_REVIEWED")){ return "LEAVE_WAIT_FOR_RECOM";}
else if (leaveStatus.equals("LEAVE_RECOMMENDED")){ return
"LEAVE_WAIT_FOR_APPR";}
else return "";
}

public static boolean showApprover(String sta tus){

if (status.equals("LEAVE_REVIEWED") || status.equals("LEAVE_RECOMMENDED"))
return true;

return false;
}
public static Map<String, Object> sendLeaveEmail(DispatchContext ctx, Map<String, ?
extends Object> context, String fromId, String toId, String leaveAction) {

Map<String, Object> result = FastMap.newInstance();
Delegator delegator = ctx.getDelegator();
String partyId = toId;
String approverPartyId = fromId;
String sendFrom = "";
String sendToApproved = "";
String footerMessage = "This message is automatically generated by Prottay. If you
think it was sent incorrectly, please contact your Prottay administrator.";
Locale locale = (Locale) context.get("locale");
GenericValue userLogin = (GenericValue) context.get("userLogin");


String fromTitle = ""; //person or employee
String fromMailType = "";
String fromMailDescription = "";
String fromAction = "";

String toTitle = ""; //hradmin or any other approver
String toMailType = "";
String toMailDescription = "";
String toAction = "";

String successMessage = "";

boolean emailSendToEmployee = false;
boolean emailSendToApprover = false;

if (leaveAction.equals("LEAVE_CREATED")){

emailSendToEmployee = true;
emailSendToApprover = true;

fromTitle = "Prottay Leave Apply Notifica tion";
fromMailType = "Leave Apply";
fromMailDescription = "Apply for leave";
fromAction= "Wait for approval and you will get the notificaton soon";

toTitle = "Prottay Leave Request Notification";
toMailType = "Leave Request";
toMailDescription = "Apply for leave and requested to approve";
toAction = "This Request can be checked
https://prottay.newgenbdworks.net/humanres/control/EmplLeavesListForAdmin ";

successMessage = "Leave Applied Successfully";

}else if (leaveAction.equals("LEAVE_REJECTED")){

emailSendToEmployee = true;
emailSendToApprover = true;

fromTitle = "Prottay Leave Rejected Notifica tion";
fromMailType = "Leave Rejected";
fromMailDescription = "Applied leave is rejected";
fromAction = "Please check your leave in your profile";

toTitle = "Prottay Leave Rejected Notification";
toMailType = "Leave Reject";
toMailDescription = "Applied leave is rejected";
toAction = "Please check your leave in your profile";

successMessage = "Applied Leave is rejected";

} else if (leaveAction.equal s("LEAVE_REVIEWED")){

emailSendToEmployee = false;
emailSendToApprover = true;

toTitle = "Prottay Leave Reviewed Notification";
toMailType = "Leave Request to Review";
toMailDescription = "Apply for leave and requested to review";
toAction = "This Request can be checked
https://prottay.newgenbdworks.net/humanres/control/EmplLeavesListForAdmin ";

successMessage = "Applied Leave is reviewed";

} else if (leaveAction.equals("LEAVE_WAIT_FOR_RECOM")){

emailSendToEmployee = false;
emailSendToApprover = true;

toTitle = "Prottay Leave Recommend Notification";
toMailType = "Leave Request to Rec ommend";
toMailDescription = "Apply for leave and requested to recommend";
toAction = "This Request can be checked
https://prottay.newgenbdworks.net/humanres/control/EmplLeavesListForAdmin ";

successMessage = "Applied L eave is waiting for recommendation";

} else if (leaveAction.equals("LEAVE_WAIT_FOR_APPR")){

emailSendToEmployee = false;
emailSendToApprover = true;

toTitle = "Prottay Leave Approval Noti fication";
toMailType = "Leave Request to Approve";
toMailDescription = "Apply for leave and requested to approve";
toAction = "This Request can be checked
https://prottay.newgenbdworks.net/humanres/control/EmplLeavesListForAdmin ";

successMessage = "Applied Leave is waiting for approval";

} else if (leaveAction.equals("LEAVE_APPROVED")){

emailSendToEmployee = true;
emailSendToApprover = true;

fromTitle = "Prottay Leave Approved Notification";
fromMailType = "Leave Approved";
fromMailDescription = "Applied leave is approved";
fromAction= "Please check your leave in your profile";

toTitle = "Prottay Leave Acceptance Notification";
toMailType = "Leave Acceptance";
toMailDescription = "Applied leave is accepted";
toAction = "This Request can be checked
https://prottay.newgenbdworks.net/humanres/control/EmplLeavesListForAdmin " ;

successMessage = "Applied Leave is approved";

} else if (leaveAction.equals("LEAVE_RECOMMENDED")){

emailSendToEmployee = false;
emailSendToApprover = true;

fromTitle = "Prottay Leave Recommend Notification";
fromMailType = "Leave Recommended";
fromMailDescription = "Applied leave is Recommended";
fromAction= "Please check your leave in your profile";

toTitle = "Prottay Leave Recommend Notification";
toMailType = "Leave Recommendation";
toMailDescription = "Applied leave is recommended";
toAction = "This Request can be checked
https://prottay.newgenbdworks.net/humanres/control/EmplL eavesListForAdmin ";

successMessage = "Applied Leave is recommended";
}

if (UtilValidate.isEmpty(partyId)) {
return
ServiceUtil.returnError(UtilProperties.getMessage(ServiceUtil.resource,
"serviceUtil.party_id_missing", locale));
}
//get the sendFrom value using partyId
sendFrom = EmailUtils.getEmailByParty(delegator, partyId);
if (sendFrom.trim().equals(""))

successMessage = successMessage.concat(", Employee Email is not
found");
//get the sendTo value using approverPartyId
sendToApproved = EmailUtils.getEmailByParty(delegator, approverPartyId);
if (sendToApproved.trim().equals(""))
successMessage = successMessage.concat(", Approver Email is not
found");

//send email to human admin
Map<String, Object> emailCtx = FastMap.newInstance();

//set the body parameters
Map<String, Object> bodyParameters = FastMap.newInstance();

bodyParameters.put("title", toTitle);
bodyParameters.put("mailType", toMailType);
bodyParameters.put("mailDescription", toMailDescription);
bodyParameters.put("action", toAction);
bodyParameters.put("priority", "High");
bodyParameters.put("footerMsg", footer Message);

emailCtx.put("sendTo", sendToApproved);
emailCtx.put("sendFrom",sendFrom);
emailCtx.put("userLogin", userLogin);
emailCtx.put("bodyParameters", bodyParameters);

if (emailSendToApprover && !sendToApproved.equals("")){
try {
EmailUtils.sendProttayMail(ctx, emailCtx,bodyParameters);

} catch (Exception e) {
}
}

//send mail to requested person
bodyParameters.put("title", fromTitle);
bodyParameters.put("mailType", fromMailType);
bodyParameters.put("mailDescription", fromMailDescription);
bodyParameters.put("action", fromAction);
bodyParameters.put("priority", "High") ;
bodyParameters.put("footerMsg", footerMessage);

emailCtx.put("sendTo", sendFrom);
emailCtx.put("sendFrom",sendToApproved);
emailCtx.put("userLogin", userLogin);
emailCtx.put("bodyParameters", bodyParameters);

if (emailSendToEmployee && !sendFrom.equals("")){
try {
EmailUtils.sendProttayMail(ctx, emailCtx,bodyParameters);

} catch (Exception e) {
//return ServiceUtil.re turnError("send email failed");
successMessage = successMessage.concat(", Send Email failed");

}
}

result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS);
result.put(ModelService.SUCCESS_MESSA GE, successMessage);
/*result.put(ModelService.ERROR_MESSAGE, "Leave will not proceed due to some
error.");*/

return result;

}
}

Chapter 11 - Testing
11.1 Testing against time boxes, Required tests, User Acceptance test plan



Pic – Test against time boxes, required boxes, user acceptance test plan

11.2 Fault Handling Techniques

Pic – fault handling techniques

11.3 Quality Assurance encompasses Testing

Pic – Quality assurance encompasses testing
11.4 Test Case
Test case #1-1(login panel):
S.no Description Expected
result
Tc-1.1.1 Tc-1.1.2 Tc-1.1.3
1. The user enters the
LMS URL into the
address bar and clicks
go button
Login page
prompted
Correct Correct Correct
2. The user enters the
username
No response user1 approver incharge
3. The user enters the
password
No response hradmin hradmin hradmin
4. Clicks login button User profiles
open
Correct Correct Correct

Test case # 1-2(login panel):
S.no Description Expected
result
Tc-1.2.1 Tc-1.2.2 Tc-1.2.3
1. The user enters the
LMS URL into the
address bar and clicks
go button
Login page
prompted
Correct Correct Correct
2. The user enters the
username
No response user1 approver incharge
3. The user enters the
password
No response empty Mgnr garbage
4. Clicks login button Invalid
Username or
Password
Correct Correct Correct
5. The user enters the
password
No response hradmin hradmin hradmin
6. Clicks login button User profiles
open
Correct Correct Correct

Test case # 2-1(leave application form):
S.no Description Expected
result
Tc-2.1.1 Tc-2.1.1 Tc-2.1.2 Tc-2.1.3 Tc-2.1.4 Tc-2.1.5 Tc-2.1.6
1. The user
clicks on
apply for
leave
button.
A window
is opened
where user
can apply
for leave.
Correct

Correct

Correct

Correct

Correct

Correct

Correct

2. The user
selects
leave type
from the
leave type
combo
box.
No
response
by the
system.
Sick leave Sick leave Casual leave Casual leave Earn leave Earn leave Leave
without
pay

3. The user
selects
start date.
A calendar
is opened.
04/16/2014 04/16/2014 04/18/2014 04/18/2014 04/20/2014 04/20/2014 04/28/2014
4. The user
selects end
date.
A calendar
is opened.
04/17/2014 04/30/2014 04/18/2014 04/22/2014 04/20/2014 04/20/2014 04/28/2014
5. The user
enters the
reason for
the leave
in the
reason text
area.
The system
does not
allow the
user to
enter the
reason of
more than
160
characters.
I am
suffering
from fever.
Doctor has
advised me
to rest.
Please grant
me leave
for one day.
I am
suffering
from fever.
Doctor has
advised me
to rest.
Please grant
me leave
for one day.
I am
suffering
from fever.
Doctor has
advised me
to rest.
please grant
My brother
is coming
from UK
tomorrow.
So I have to
pick him
from the
airport. Plz
grant me 1
day leave.
My brother
is coming
from UK
tomorrow.
So I have to
pick him
from the
airport. Plz
grant me 1
day leave.
I wanna go
on a tour of
Pakistan
with my
family.
Grant me
leave
please.
I wanna go
on a tour of
Pakistan
with my
family.
Grant me
leave
please.
Empty

6. The user
clicks
submit
button.
“Leave
submitted
successfully
please
wait for the
approval”
Correct. Correct. Correct. Correct. Correct. Correct. Correct.

Test case # 3-1(Add leave type):
S.no Description Expected result Tc-3.1.1 Tc-
3.1.2
1. The incharge
clicks on the
add leave type
option.
A screen is prompted
where user can enter
the name of leave
type to be added to
the system.
Correct

Correct

2. The incharge
enter name of
the leave type.
No response. Accounts

1

3. The incharge
presses add
type button.
The leave is added to
the system.
Correct

Correct


Test case # 4-1(leave Approval/Rejection):
S.no Description Expected
result
Tc-4.1.1
1. approver clicks on
Leave list menu
A page
prompted
contain
information of
leaves
correct
2. approver choose
Accept/Reject button
An email sent
to both
incharge and
approver
accept

3. incharge choose view
deatil button
employee
detail is
opened
View detail.
4. incharge choose
Accept/Reject button
An email sent
to both
incharge and
employee
accept

Chapter 12 - Implementation
After all phase have been perfectly done, the system will be implemented to the server and the
system can be used.
12.1 Training
Employer: Providing training with documentation & explain what’s going on.
Employee: Employee within a department form field groups of ideally 20 to 30 members.

Chapter 13 - Lessons Learned
13.1 What have I learned
Here I have learned about HR specially leave of a company. How they manage employee leave and
hat type of calculation occurred in every month. Especially Every year leave calculation is much more
complex but I have learned how to manage it.



13.2 What problem I have faced
Here I also phase some problem in multilevel leave approval. I am so happy about that to learn it. I
personally solve this problem and Babylon Garments Limited head of HR also amazed about this issue.

Chapter 15 – Conclusion
The proposed Leave Management System will make the whole leave management process efficient.
Users will be able to know their leave status. The employees may be applying for leave from their home as
well. This supporting software will help the management in decision making in case of leave related affairs.
Moreover, it will ensure less paper works and as a result the whole process will be swift and reliable.