Hi,
I wish to do some enhancement in existing Leave functionality in OFBiz.
Existing functionalities :
- Currently employee can create leave by selecting his approver.
- Approver will approve the leave applied by the employee.
New functionalities are :
- Admin party can credit leave balance to only at the beginning of
financial year to a party's leave account
- When employee creates a leave application, weekends and
organization wide holidays won't be considered as a part of leave application.
- Whenever employee's leave application is approved, corresponding no.
of leaves will get deducted from his/her account
- Employee will be able to see his/her current leave balance.
So for this :
I have decided to added a new field "noOfLeaves" in EmplLeave Table.
And for crediting the leaves and holidays I have created two new entityes as
shown below.
CreditEmplLeave table keeps track of the current leave balance for an employee.
Holiday will maintain all the holidays in an organization.
<entity entity-name="EmplLeave"
package-name="org.ofbiz.humanres.employment"
title="Employee Leave Entity">
<field name="partyId" type="id-ne"/>
<field name="leaveTypeId" type="id-ne"/>
<field name="emplLeaveReasonTypeId" type="id-ne"/>
<field name="fromDate" type="date-time"/>
<field name="thruDate" type="date-time"/>
<field name="noOfLeaves" type="fixed-point"/>
<field name="approverPartyId" type="id-ne"/>
<field name="leaveStatus" type="short-varchar"/>
<field name="description" type="description"/>
<prim-key field="partyId"/>
<prim-key field="leaveTypeId"/>
<prim-key field="fromDate"/>
<relation type="one" fk-name="EMPL_LEAVE_PRTY" rel-entity-name="Party">
<key-map field-name="partyId"/>
</relation>
<relation type="one" fk-name="EMPL_LEAVE_ELETP"
rel-entity-name="EmplLeaveType">
<key-map field-name="leaveTypeId"/>
</relation>
<relation type="one" fk-name="EMP_LEAV_REAS_ELTP"
rel-entity-name="EmplLeaveReasonType">
<key-map field-name="emplLeaveReasonTypeId"/>
</relation>
<relation type="one" fk-name="EMPL_LEAVE_APPR" title="Approver"
rel-entity-name="Party">
<key-map field-name="approverPartyId" rel-field-name="partyId"/>
</relation>
</entity>
<entity entity-name="CreditEmplLeave"
package-name="org.ofbiz.humanres.employment"
title="Credit Employee Leave Entity">
<field name="partyId" type="id-ne"/>
<field name="totalLeaves" type="fixed-point"/>
<prim-key field="partyId"/>
<relation type="one" fk-name="CRED_EMPL_LEAVE_PRTY"
rel-entity-name="Party">
<key-map field-name="partyId"/>
</relation>
</entity>
<entity entity-name="Holiday"
package-name="org.ofbiz.humanres.employment"
title="Holiday's in organization">
<field name="holidayId" type="id-ne"/>
<field name="holiday" type="description"/>
<prim-key field="holidayId"/>
</entity>
Please give your suggestions on this.
Thanks & regards,
Swapnil Sawant
________________________________
This Email may contain confidential or privileged information for the intended
recipient (s) If you are not the intended recipient, please do not use or
disseminate the information, notify the sender and delete it from your system.
______________________________________________________________________