Compare commits

...

110 Commits

Author SHA1 Message Date
Gamonoid
27779782fc Merge branch 'master' into v19.x 2016-12-14 12:52:08 +01:00
Gamonoid
04bafeec81 Merge branch 'v19.x' of https://github.com/gamonoid/icehrm into v19.x 2016-12-14 12:41:57 +01:00
Gamonoid
cc1ac5a75e fix dashboard error 2016-12-14 12:38:51 +01:00
Gamonoid
7528e5eabd Check updates 2016-12-06 18:14:19 +01:00
Gamonoid
ef72f8daa3 No need to have an extended login 2016-12-06 17:39:20 +01:00
Thilina Hasantha
967c69b04e Fix typo 2016-12-06 00:48:16 +01:00
Thilina Hasantha
a2a23a2bb4 Merge branch 'v19.x' 2016-12-05 23:43:13 +01:00
Thilina Hasantha
d022651a24 Fix https url installation issue 2016-12-05 23:42:29 +01:00
icehrm
a619f76b3a v19.0.OS (#35)
* Updates from pro v19

* Update travis

* Update db script

* Update docs

* change build script
2016-12-05 16:22:47 +01:00
Thilina Hasantha
9f0626c1f7 change build 2016-11-29 09:26:47 +01:00
Thilina Hasantha
ec85cfa521 Update ready 2016-11-29 00:19:56 +01:00
Thilina Hasantha
b15e432756 Update docs 2016-11-29 00:18:32 +01:00
Gamonoid
1b7bea571f Update db script 2016-11-28 16:45:05 +01:00
Gamonoid
1f60c4b217 Update travis 2016-11-25 17:27:24 +01:00
Gamonoid
ed739aa4e1 Updates from pro v19 2016-11-25 17:21:30 +01:00
Gamonoid
e6b4245334 Updates from pro v19 2016-11-25 17:20:39 +01:00
Gamonoid
4c171bfce3 PHP unit for build 2016-11-25 16:19:16 +01:00
Gamonoid
3bb3f038bf Approval Manager tester added 2016-11-25 16:15:41 +01:00
Gamonoid
4f6cdd98f8 add travis status 2016-11-25 15:06:29 +01:00
Gamonoid
81f7a97096 Fix travis-ci builds 2016-11-25 15:01:44 +01:00
Gamonoid
ab2a0293a6 fix travis-ci build path 2016-11-25 14:56:13 +01:00
Gamonoid
283ef1e377 fix travis-ci build path 2016-11-25 14:54:16 +01:00
Gamonoid
55f8ae364f fix travis-ci build path 2016-11-25 14:49:40 +01:00
Gamonoid
564ce43c18 fix travis-ci build path 2016-11-25 14:36:21 +01:00
Gamonoid
bd9e5acd65 fix travis-ci build path 2016-11-25 14:31:55 +01:00
Gamonoid
a4a38a1869 add ant buid 2016-11-25 14:29:23 +01:00
Gamonoid
e1aa2c1365 add ant buid 2016-11-25 14:09:17 +01:00
Gamonoid
b1bfd2f39d add ant buid 2016-11-25 14:05:58 +01:00
Gamonoid
4c3f27914b add ant buid 2016-11-25 14:04:02 +01:00
Gamonoid
214ab89ce8 add ant buid 2016-11-25 13:57:38 +01:00
Gamonoid
9348be0acd Add vagrant machine, new test and travis-ci config 2016-11-25 13:53:36 +01:00
Gamonoid
21c5d09bac Adding src dir 2016-11-25 11:39:25 +01:00
Thilina Hasantha
13085bcecc Remove submodule 2016-11-25 11:15:11 +01:00
Thilina Hasantha
9271156708 Adding sub module 2016-10-04 03:40:11 +02:00
Thilina Hasantha
6ac1320f6a no message 2016-10-04 03:28:35 +02:00
Thilina Hasantha
dcfc009938 Remove sub module 2016-10-04 03:23:36 +02:00
Thilina Hasantha
b9ba064dbb Adding isotope core submodule 2016-10-04 02:59:41 +02:00
Thilina Hasantha
f78f5592d3 Fix dashboard translations 2016-08-06 02:37:26 +05:30
Thilina Hasantha
d9f0d52eed Fix upgrade script 2016-08-05 13:37:56 +05:30
Thilina Hasantha
fb8e970f7e Update read me 2016-08-05 13:11:11 +05:30
Thilina Hasantha
e78331f5b3 Update readme 2016-08-05 09:43:37 +05:30
Thilina Hasantha
9e415d589e Update read 2016-08-05 09:42:02 +05:30
Thilina Hasantha
b2f83c51e4 Fix missing status change popup 2016-08-05 08:18:55 +05:30
Thilina Hasantha
585036b209 Add language setting 2016-08-04 20:30:13 +05:30
Thilina Hasantha
91c6867e2f Fix color issue 2016-08-04 19:33:58 +05:30
Thilina Hasantha
912ff56260 Add missing field 2016-08-04 17:37:35 +05:30
Thilina Hasantha
1bd4014cb9 Document loading error fix 2016-08-04 17:19:45 +05:30
Thilina Hasantha
d226a18912 style css fixes 2016-08-04 17:14:06 +05:30
Thilina Hasantha
1e9e6f31a2 Fix related to employee custom fields 2016-08-04 17:09:17 +05:30
Thilina Hasantha
698c5d3daa Fix document tab display issue 2016-08-04 15:10:15 +05:30
Thilina Hasantha
271a39b3d4 Color change 2016-08-04 14:53:23 +05:30
Thilina Hasantha
217664e636 Fix column count issue 2016-08-04 14:40:40 +05:30
Thilina Hasantha
6e4d32933b Fix lint error 2016-08-04 14:37:26 +05:30
Thilina Hasantha
a10fbba14a IceHrm v18.0 2016-08-04 14:27:59 +05:30
Thilina Hasantha
9e243073df Docker 2016-07-31 11:03:43 +05:30
Thilina Hasantha
1757421d9f Fix for php7 2016-06-10 03:23:41 +05:30
Thilina Hasantha
37299ac1a8 Change version to v16.1.OS 2016-05-05 20:35:33 +05:30
Thilina Hasantha
f614e0ebf0 Ready updated 2016-05-05 20:32:49 +05:30
Thilina Hasantha
66ced28bad v16.1 2016-05-05 20:29:17 +05:30
Thilina Hasantha
22a371eef9 Fix LDAP issue 2016-04-26 19:52:29 +05:30
Thilina Hasantha
143961cf3f Fix master data issue 2016-04-17 12:14:15 +05:30
Thilina Hasantha
aae74a8cc9 Fix ready link 2016-04-17 11:48:57 +05:30
Thilina Hasantha
3c89cb277c Preparing for v16.0.OS release 2016-04-17 11:34:30 +05:30
Thilina Hasantha
48619a086c Fix issues with DB script 2016-04-17 08:59:50 +05:30
Thilina Hasantha
ace8020028 Fix 2016-04-17 00:28:01 +05:30
Thilina Hasantha
acf281371b Adding travel module 2016-04-17 00:20:39 +05:30
Thilina Hasantha
39820b84e0 Fix js error 2016-04-16 23:53:03 +05:30
Thilina Hasantha
5656910eab Changes to db scripts 2016-04-16 22:00:33 +05:30
Thilina Hasantha
0594d84ed1 Remove leave settings from open source 2016-04-16 21:48:38 +05:30
Thilina Hasantha
fbd77cedf7 Fix 500 2016-04-16 21:44:03 +05:30
Thilina Hasantha
045e85f3ad Fix salary module issues 2016-04-16 17:44:27 +05:30
Thilina Hasantha
f6d5202ad5 Fix login page styles 2016-04-16 07:55:03 +05:30
Thilina Hasantha
31bb455d6f Release note v16.0
------------------
### Features
 * Advanced Employee Management Module is now included in IceHrm Open Source Edition
 * LDAP Module which was only available in IceHrm Enterprise is now included in open source also
 * Initial implementation of icehrm REST Api for reading employee details
 * Improvements to data filtering
 * Multiple tabs for settings module
 * Overtime reports - now its possible to calculate overtime for employees.compatible with US overtime rules
 * Logout the user if tried accessing an unauthorized module
 * Setting for updating module names

### Fixes
 * Fix issue: classes should be loaded even the module is disabled
 * Deleting the only Admin user is not allowed
 * Fixes for handling non UTF-8
 * Fix for non-mandatory select boxes are shown as mandatory
2016-04-15 20:24:39 +05:30
Thilina Hasantha
301ea64832 Changes to open source dashboard 2016-04-15 19:52:49 +05:30
Thilina Hasantha
6fd9ba20c8 Release note v15.3
------------------
### Fixes
 * Fix issue: classes should be loaded even the module is disabled
 * Deleting the only Admin user is not allowed
 * Fixes for handling non UTF-8
 * Fix for non-mandatory select boxes are shown as mandatory
2016-04-15 15:53:14 +05:30
Thilina Hasantha
9ffa8617e9 Adding overtime report classes 2016-03-13 23:55:54 +05:30
Thilina Hasantha
f25a3ffd75 Adding overtime report classes 2016-03-13 23:32:05 +05:30
Thilina Hasantha
712b2025f1 Adding some sample data for attendance 2016-03-13 13:36:40 +05:30
Thilina Hasantha
0b37e9b573 Change release version 2016-03-13 13:34:22 +05:30
Thilina Hasantha
c1cd17d7b0 Update all reports 2016-03-13 13:28:41 +05:30
Thilina Hasantha
43533c6570 Changes to db scripts 2016-03-13 13:19:08 +05:30
Thilina Hasantha
2041071d00 Release note v15.2
------------------

### Features
 * Overtime Reports
 * Overtime calculation for california

### Fixes
 * Fix issue: uncaught error when placeholder value is empty
 * Log email sending success status
 * Fix broken longer company name issue
 * Make the application accessible when client on an intranet with no internet connection
 * Fix issue: when a module is disabled other modules depend on it stops working
2016-03-13 12:30:20 +05:30
Thilina Hasantha
78faf64770 Fix sql issue 2016-02-25 15:31:10 +05:30
Thilina Hasantha
e2368e526b Fix timesheet report issue 2016-02-09 05:07:35 +05:30
Thilina Hasantha
76b3aff37d Adding upgrade scripts 2016-02-08 05:52:54 +05:30
Thilina Hasantha
078396d5d7 Upgrade to v15.0.OS 2016-02-08 04:25:58 +05:30
Thilina Hasantha
b99b6f6f77 Update Readme 2015-12-29 07:35:48 +05:30
Thilina Hasantha
4c97461ec6 Remove non functional dashboard icon 2015-12-27 05:56:28 +05:30
Thilina Hasantha
5b728aa551 Add purchase modules 2015-12-27 05:15:41 +05:30
Thilina Hasantha
cdbea02b46 Add purchase modules 2015-12-27 05:09:33 +05:30
Thilina Hasantha
e46aca54f9 Add quick access menu 2015-12-27 05:05:08 +05:30
Thilina Hasantha
cfdaeaad50 Add salary module 2015-12-27 05:03:40 +05:30
Thilina Hasantha
09071a0f21 Fix dashboard message 2015-12-27 04:48:05 +05:30
Thilina Hasantha
785c210c4e Travel report added 2015-12-27 04:47:35 +05:30
Thilina Hasantha
d0d57b6575 Read me updated 2015-12-13 19:14:51 +05:30
Thilina Hasantha
d2c3a2af28 Ready updated 2015-12-13 19:11:44 +05:30
Thilina Hasantha
8eb1f9f4be Update read 2015-12-13 18:56:11 +05:30
Thilina Hasantha
6b87fdfcd8 Adding more info 2015-12-13 18:28:34 +05:30
Thilina Hasantha
934388d769 Adding upgrade script 2015-12-13 18:20:55 +05:30
Thilina Hasantha
08b4d93bef More fixes for dashboard and GA 2015-12-13 17:49:01 +05:30
Thilina Hasantha
3016ef518d Improve dashboards 2015-12-13 16:44:05 +05:30
Thilina Hasantha
6798312a78 Improve dashboards 2015-12-13 16:43:34 +05:30
Thilina Hasantha
ea106119ab New features for modules 2015-12-13 15:21:23 +05:30
Thilina Hasantha
ca3492e30e Upgraded to latest icehrm core 2015-12-13 02:56:30 +05:30
Thilina Hasantha
8dacf2a8f1 Show all errors when debug log enabled 2015-11-06 04:41:14 +05:30
Thilina Hasantha
16ce8fe461 Remove unwanted menus 2015-10-11 12:01:08 +05:30
Thilina Hasantha
51f9897ca2 Documents module 2015-10-11 11:56:34 +05:30
Thilina Hasantha
208d62d167 Fix employee leave issue 2015-10-11 08:51:36 +05:30
Thilina Hasantha
7c5c28047d Fix missing table issue in script 2015-10-11 08:38:22 +05:30
Thilina Hasantha
2881319247 Fix dashboard leave issue 2015-10-11 08:26:10 +05:30
3647 changed files with 353830 additions and 5709 deletions

6
.gitignore vendored
View File

@@ -1,4 +1,8 @@
/.settings /.settings
/.buildpath /.buildpath
/.project /.project
/.idea /.idea/
/build
/deployment/clients/dev/data/
/deployment/clients/test/data/
/.vagrant

13
.travis.yml Normal file
View File

@@ -0,0 +1,13 @@
services:
- mysql
before_script:
- echo "USE mysql;\nUPDATE user SET password=PASSWORD('dev') WHERE user='root';\nFLUSH PRIVILEGES;\n" | mysql -u root
install:
- ant buildlocal
language: php
php:
- '5.5'
- '5.6'
- '7.0'
- nightly
#after_failure: "cat /tmp/icehrm.test.log"

View File

@@ -1,157 +0,0 @@
Release note v9.1
-----------------
### Fixes
*Add missing S3FileSystem class
Release note v9.0
-----------------
### Features
*New user interface
*Decimal leave counts supported
Release note v8.4
-----------------
### Fixes
* Fix leave carry forward rounding issues
* Fix issue: select2 default value not getting set for select2
* Fix issue: email not sent when admin changing leave status
Release note v8.3
-----------------
### Fixes
* Fix user table issue on windows, this will resolve errors such as: (Note that this fix has no effect on unix based installations)
* Admin not able to view user uploaded documents
* Admin not able to upload documants for users
* Admin can not view employee attendance records
* Employee projects can not be added
Release note v8.2
-----------------
### Features
*Instance verification added
Release note v8.1
-----------------
### Fixes
*Fixed bug that caused a fatal error in php v5.4
*aws2.7.11 phar file replaced by a aws2.7.11 extracted files
*old aws sdk removed
Release note v8.0
-----------------
### Features
*Admin dashbord module
*If the employee joined in current leave period, his leave entitlement is calculated proportional to joined date
*Improvements to reporting module
*Adding new employee time tracking report
*Join date for employees made mandatory
*Sending welcome email when a user is added
*Let users directly reply to admin user from any email sent out from icehrm
*All the users who are not admins must have an employee object attached
*Upgrade aws sdk to v2.7.11
*Allow employees to change password
*Use only the email address defined under user for sending mails
*Making work_email and private_email fields optional
### Fixes
*Upload dialog close button issue fixed
Release note v7.2
-----------------
*Fixes
*Some critical vulnerabilities are fixed as recommend by http://zeroscience.mk/en/
Release note v7.1
-----------------
*Features
*Improved company structure graph
*Leave notes implementation Supervisor can add a note when approving or rejecting leaves
*Filtering support
*Select boxes with long lists are now searchable
*Add/Edit/Delete company structure permissions added for managers
*Add ability to disable employee information editing
*Fixes
*Make loans editable only by admin
*Fix: permissions not getting applied to employee documents
*Fix error adding employee documents when no user assigned to the admin
*Code Quality
*Moving all module related code and data into module folders
Release note v6.0
-----------------
* Features
* Notifications for leaves and timesheets
* Leave module accrue and leave carry forward
* Employee leave entitlement sub module
* Ability to put system on debug mode
* Allow admins to see documents of all the employees at one place
* Backup data when deleting an employee
* Employee attendance report added
* Changes to time entry form in timesheet module to make time entry process faster
* Admin can make all projects available to employees or just the set of prjects assigned to them using Setting "Projects: Make All Projects Available to Employees"
* Employee document, date added field can not be changed by the employee anymore
* About dialog added for admins
* Fixes
* Fix default employee delete issue (when the default employee is deleted the admin user attached to it also get deleted)
* Fix user duplicate email issue
* Fix manager can not logout from switched employee
* Remove admin guide from non admin users
Release note v5.3
-----------------
* Fixes
* Fix missing employee name in employee details report
Release note v5.2
-----------------
* Fixes
* Remove unwanted error logs
* Fix attendance module employee permission issue
* Resolve warnings
* Remove add new button from subordinates module
* Adding administrators' guide
Release note v5.1
-----------------
* Fixes
* Fixing for non updating null fields
* https://bitbucket.org/thilina/icehrm-opensource/commits/df57308b53484a2e43ef5c72967ed1cd0dc756cc
Release note v5.0
-----------------
* Features
* New user permission implementation
* Adding new user level - Manager
* Fixes
* Fixing remote table loading issue
Release note v4.2
-----------------
* Fixes
* https://bitbucket.org/thilina/icehrm-opensource/issue/23/subordinate-leaves-pagination-not-working
* https://bitbucket.org/thilina/icehrm-opensource/issue/20/error-occured-while-time-punch
Release note v4.1
-----------------
* Features
* Better email format for notifications
* Convert upload dialog to a bootstrp model
* Fixes
* Fix error sending emails with amazon SES
* Fix errors related to XAMPP and WAMPP servers
* Fix php warnings and notifications
* Fix company structure graph issues
* Allow icehrm client to work without an internet connection
* Fix installer incorrect base url issue
* Fix empty user creation issue

29
Vagrantfile vendored Normal file
View File

@@ -0,0 +1,29 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "thilinah/jessie64_isotope"
config.vm.box_version = "0.0.1"
config.vm.network "private_network", ip: "192.168.40.40"
config.vm.synced_folder ".", "/vagrant", type: "nfs"
config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
vb.cpus = "2"
vb.name = "app.dev"
end
config.vm.provision "shell", inline: <<-SHELL
sudo apt-get update
SHELL
config.vm.hostname = "app.dev"
config.hostsupdater.aliases = [
"app.dev",
"app.app.dev",
"clients.app.dev"
]
end

119
build.xml
View File

@@ -3,21 +3,31 @@
<!-- By default, we assume all tools to be on the $PATH --> <!-- By default, we assume all tools to be on the $PATH -->
<property name="toolsdir" value=""/> <property name="toolsdir" value=""/>
<property name="destination" value="${basedir}/build/app"/> <property name="destination" value="${basedir}/build/app"/>
<property name="testdir" value="${basedir}/build/test"/>
<property name="origin" value="${basedir}/src"/> <property name="origin" value="${basedir}/src"/>
<property environment="env"/> <property environment="env"/>
<property name="env.appname" value="icehrm"/> <property name="env.appname" value="icehrm"/>
<property name="env.Version" value="dev"/> <property name="env.Version" value="dev"/>
<property name="installpath" value="/var/www/apps.gamonoid.com/icehrm-open-core"/> <property name="installpath" value="/var/www/apps.gamonoid.com/icehrm-open-core"/>
<property name="installLocalpath" value="/Applications/XAMPP/xamppfiles/htdocs/icehrm-open-core"/>
<target name="build" <target name="build"
depends="prepare,lint,phpunit,copyapp,release,install" depends="prepare,lint,copyapp,phpunit,release,install"
description=""/> description=""/>
<target name="buildlocal" <target name="buildlocal"
depends="prepare,copyapp" depends="prepare,copyapp"
description=""/> description=""/>
<target name="releaseapp"
depends="prepare,lint,copyapp,phpunit,release"
description=""/>
<target name="ice"
depends="copyapp_quick"
description=""/>
<target name="clean" <target name="clean"
unless="clean.done" unless="clean.done"
description="Cleanup build artifacts"> description="Cleanup build artifacts">
@@ -37,6 +47,7 @@
depends="clean" depends="clean"
description="Prepare for build"> description="Prepare for build">
<mkdir dir="${basedir}/build/api"/> <mkdir dir="${basedir}/build/api"/>
<mkdir dir="${basedir}/build/api"/>
<mkdir dir="${basedir}/build/coverage"/> <mkdir dir="${basedir}/build/coverage"/>
<mkdir dir="${basedir}/build/logs"/> <mkdir dir="${basedir}/build/logs"/>
<mkdir dir="${basedir}/build/pdepend"/> <mkdir dir="${basedir}/build/pdepend"/>
@@ -47,29 +58,6 @@
<mkdir dir="${basedir}/build/release/data/${env.appname}_${env.Version}"/> <mkdir dir="${basedir}/build/release/data/${env.appname}_${env.Version}"/>
<mkdir dir="${basedir}/src/lib"/> <mkdir dir="${basedir}/src/lib"/>
<copy todir="${basedir}/src/lib" overwrite="true">
<fileset dir="${basedir}/lib">
<include name="**/*"/>
</fileset>
</copy>
<copy todir="${basedir}/src" overwrite="true">
<fileset dir="${basedir}/core-ext">
<include name="**/*"/>
</fileset>
</copy>
<copy todir="${basedir}/src">
<fileset dir="${basedir}/ext">
<include name="**/*"/>
</fileset>
</copy>
<copy todir="${basedir}/src">
<fileset dir="${basedir}/tp">
<include name="**/*"/>
</fileset>
</copy>
<property name="prepare.done" value="true"/> <property name="prepare.done" value="true"/>
</target> </target>
@@ -80,6 +68,7 @@
<fileset dir="${basedir}/src"> <fileset dir="${basedir}/src">
<include name="**/*.php" /> <include name="**/*.php" />
<exclude name="composer/**"/>
<modified /> <modified />
</fileset> </fileset>
@@ -201,10 +190,41 @@
<exec executable="${toolsdir}phpdox"/> <exec executable="${toolsdir}phpdox"/>
</target> </target>
<target name="copyapp_quick"
description="Copy generated files to QA app">
<copy todir="${destination}" overwrite="true">
<fileset dir="${origin}">
<include name="**/*"/>
<exclude name="composer/**"/>
<exclude name="themecss/**"/>
<exclude name="themejs/**"/>
<exclude name="robo/**"/>
<exclude name="images/**"/>
</fileset>
</copy>
<copy todir="${destination}" overwrite="true">
<fileset dir="${basedir}/core-ext">
<include name="**/*"/>
</fileset>
</copy>
<copy todir="${destination}" overwrite="true">
<fileset dir="${basedir}/ext">
<include name="**/*"/>
</fileset>
</copy>
<copy todir="${testdir}" overwrite="true">
<fileset dir="${basedir}/test">
<include name="**/*"/>
</fileset>
</copy>
</target>
<target name="copyapp" <target name="copyapp"
depends=""
description="Copy generated files to QA app"> description="Copy generated files to QA app">
<delete includeemptydirs="true"> <delete includeemptydirs="true">
@@ -213,12 +233,36 @@
</fileset> </fileset>
</delete> </delete>
<copy todir="${destination}"> <copy todir="${destination}" overwrite="true">
<fileset dir="${origin}"> <fileset dir="${origin}">
<include name="**/*"/> <include name="**/*"/>
</fileset> </fileset>
</copy> </copy>
<copy todir="${destination}/lib" overwrite="true">
<fileset dir="${basedir}/lib">
<include name="**/*"/>
</fileset>
</copy>
<copy todir="${destination}" overwrite="true">
<fileset dir="${basedir}/core-ext">
<include name="**/*"/>
</fileset>
</copy>
<copy todir="${destination}" overwrite="true">
<fileset dir="${basedir}/ext">
<include name="**/*"/>
</fileset>
</copy>
<copy todir="${testdir}" overwrite="true">
<fileset dir="${basedir}/test">
<include name="**/*"/>
</fileset>
</copy>
</target> </target>
<target name="install" <target name="install"
@@ -233,8 +277,8 @@
<mkdir dir="${installpath}"/> <mkdir dir="${installpath}"/>
<copy todir="${installpath}"> <copy todir="${installpath}" overwrite="true">
<fileset dir="${origin}"> <fileset dir="${destination}">
<include name="**/*"/> <include name="**/*"/>
</fileset> </fileset>
</copy> </copy>
@@ -246,6 +290,25 @@
</delete> </delete>
</target> </target>
<target name="installLocal"
depends="copyapp"
description="">
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${installLocalpath}">
<include name="**/*"/>
</fileset>
</delete>
<mkdir dir="${installLocalpath}"/>
<copy todir="${installLocalpath}">
<fileset dir="${destination}">
<include name="**/*"/>
</fileset>
</copy>
</target>
<target name="release" <target name="release"
depends="copyapp" depends="copyapp"
description="Create a release"> description="Create a release">

0
config/database.yml Normal file
View File

View File

@@ -0,0 +1,90 @@
<?php
/*
This file is part of iCE Hrm.
iCE Hrm is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
iCE Hrm is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with iCE Hrm. If not, see <http://www.gnu.org/licenses/>.
------------------------------------------------------------------
Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
*/
$moduleName = 'dashboard';
define('MODULE_PATH',dirname(__FILE__));
include APP_BASE_PATH.'header.php';
include APP_BASE_PATH.'modulejslibs.inc.php';
?><div class="span9">
<div class="row">
<?php
$moduleManagers = BaseService::getInstance()->getModuleManagers();
$dashBoardList = array();
foreach($moduleManagers as $moduleManagerObj){
//Check if this is not an admin module
if($moduleManagerObj->getModuleType() != 'admin'){
continue;
}
$allowed = BaseService::getInstance()->isModuleAllowedForUser($moduleManagerObj);
if(!$allowed){
continue;
}
$item = $moduleManagerObj->getDashboardItem();
if(!empty($item)) {
$index = $moduleManagerObj->getDashboardItemIndex();
$dashBoardList[$index] = $item;
}
}
ksort($dashBoardList);
foreach($dashBoardList as $k=>$v){
echo LanguageManager::translateTnrText($v);
}
?>
</div>
<?php
if(class_exists("ProVersion")) {
$proVersion = new ProVersion();
if (strtotime($proVersion->licenseExpire) < time()) {
?>
<div class="callout callout-danger lead" style="font-size: 14px;">
<h4>Your IceHrm Pro License is Expired</h4>
<p style="font-weight: bold;">
Your IceHrm Pro license is expired. Even though you can continue to use the software you won't receive
software upgrades or security patches. Please renew your license.
<br/>
<br/>
<a href="https://icehrm.com/renew_icehrmpro.php" class="btn btn-success btm-xs"><i
class="fa fa-checkout"></i> Renew License</a>
</p>
</div>
<?php
}
}
?>
</div>
<script>
var modJsList = new Array();
modJsList['tabDashboard'] = new DashboardAdapter('Dashboard','Dashboard');
var modJs = modJsList['tabDashboard'];
</script>
<?php include APP_BASE_PATH.'footer.php';?>

View File

@@ -11,7 +11,7 @@ define('APP_DB', '_APP_DB_');
define('APP_USERNAME', '_APP_USERNAME_'); define('APP_USERNAME', '_APP_USERNAME_');
define('APP_PASSWORD', '_APP_PASSWORD_'); define('APP_PASSWORD', '_APP_PASSWORD_');
define('APP_HOST', '_APP_HOST_'); define('APP_HOST', '_APP_HOST_');
define('APP_CON_STR', 'mysql://'.APP_USERNAME.':'.APP_PASSWORD.'@'.APP_HOST.'/'.APP_DB); define('APP_CON_STR', 'mysqli://'.APP_USERNAME.':'.APP_PASSWORD.'@'.APP_HOST.'/'.APP_DB);
//file upload //file upload
define('FILE_TYPES', 'jpg,png,jpeg'); define('FILE_TYPES', 'jpg,png,jpeg');

View File

@@ -0,0 +1 @@
init log

View File

@@ -0,0 +1,82 @@
<?php
class LDAPManager {
private static $me = null;
private function __construct(){
}
public static function getInstance(){
if(empty(self::$me)){
self::$me = new LDAPManager();
}
return self::$me;
}
public function checkLDAPLogin($user, $password){
$ldap_host = SettingsManager::getInstance()->getSetting("LDAP: Server");
$ldap_port = SettingsManager::getInstance()->getSetting("LDAP: Port");
$ldap_dn = SettingsManager::getInstance()->getSetting("LDAP: Root DN");
$managerDN = SettingsManager::getInstance()->getSetting("LDAP: Manager DN");
$managerPassword = SettingsManager::getInstance()->getSetting("LDAP: Manager Password");
// connect to active directory
if(empty($ldap_port)){
$ldap_port = 389;
}
$ldap = ldap_connect($ldap_host, intval($ldap_port));
if(!$ldap){
return new IceResponse(IceResponse::ERROR,"Could not connect to LDAP Server");
}
LogManager::getInstance()->debug("LDAP Connect Result:".print_r($ldap,true));
if(SettingsManager::getInstance()->getSetting("LDAP: Version 3") == "1"){
ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);
}
ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0);
// verify user and password
$bind = @ldap_bind($ldap, $managerDN, $managerPassword);
LogManager::getInstance()->debug("LDAP Manager Bind:".print_r($bind,true));
if($bind) {
$userFilterStr = SettingsManager::getInstance()->getSetting("LDAP: User Filter");
$filter = str_replace("{}", $user, $userFilterStr); //"(uid=" . $user . ")";
$result = ldap_search($ldap, $ldap_dn, $filter);
LogManager::getInstance()->debug("LDAP Search Result:".print_r($result,true));
if(!$result){
exit("Unable to search LDAP server");
}
$entries = ldap_get_entries($ldap, $result);
LogManager::getInstance()->debug("LDAP Search Entries:".print_r($entries,true));
if(empty($entries) || !isset($entries[0]) || !isset($entries[0]['dn'])){
return new IceResponse(IceResponse::ERROR,"Invalid user");
}
$bind = @ldap_bind($ldap,$entries[0]['dn'], $password);
ldap_unbind($ldap);
if($bind){
return new IceResponse(IceResponse::SUCCESS, $entries[0]);
}else{
return new IceResponse(IceResponse::ERROR,"Invalid user");
}
} else {
return new IceResponse(IceResponse::ERROR,"Invalid manager user");
}
}
}

View File

@@ -7,7 +7,7 @@ class NotificationManager{
$this->baseService = $baseService; $this->baseService = $baseService;
} }
public function addNotification($toEmployee, $message, $action, $type, $toUserId = null, $fromSystem = false){ public function addNotification($toEmployee, $message, $action, $type, $toUserId = null, $fromSystem = false, $sendEmail = false){
$userEmp = new User(); $userEmp = new User();
@@ -63,6 +63,11 @@ class NotificationManager{
$ok = $noti->Save(); $ok = $noti->Save();
if(!$ok){ if(!$ok){
error_log("Error adding notification: ".$noti->ErrorMsg()); error_log("Error adding notification: ".$noti->ErrorMsg());
}else if($sendEmail){
$emailSender = BaseService::getInstance()->getEmailSender();
if(!empty($emailSender)){
$emailSender->sendEmailFromNotification($noti);
}
} }
} }

View File

@@ -0,0 +1,3 @@
<?php
//Nothing here
?>

View File

@@ -5,17 +5,31 @@ if(!defined('APP_NAME')){define('APP_NAME','ICE Hrm');}
if(!defined('FB_URL')){define('FB_URL', 'https://www.facebook.com/icehrm');}; if(!defined('FB_URL')){define('FB_URL', 'https://www.facebook.com/icehrm');};
if(!defined('TWITTER_URL')){define('TWITTER_URL', 'https://twitter.com/icehrmapp');}; if(!defined('TWITTER_URL')){define('TWITTER_URL', 'https://twitter.com/icehrmapp');};
if(defined('CLIENT_BASE_URL')) {
define('HOME_LINK_ADMIN', CLIENT_BASE_URL . "?g=admin&n=dashboard&m=admin_Admin"); define('HOME_LINK_ADMIN', CLIENT_BASE_URL . "?g=admin&n=dashboard&m=admin_Admin");
define('HOME_LINK_OTHERS', CLIENT_BASE_URL . "?g=modules&n=dashboard&m=module_Personal_Information"); define('HOME_LINK_OTHERS', CLIENT_BASE_URL . "?g=modules&n=dashboard&m=module_Personal_Information");
}
//Version //Version
define('VERSION', '13.1.OS'); define('VERSION', '19.0.OS');
define('CACHE_VALUE', '13.1'); define('CACHE_VALUE', '19.0.OS');
define('VERSION_DATE', '09/10/2015'); define('VERSION_NUMBER', '190');
define('VERSION_DATE', '19/11/2016');
if(!defined('CONTACT_EMAIL')){define('CONTACT_EMAIL','icehrm@gamonoid.com');} if(!defined('CONTACT_EMAIL')){define('CONTACT_EMAIL','icehrm@gamonoid.com');}
if(!defined('KEY_PREFIX')){define('KEY_PREFIX','IceHrm');} if(!defined('KEY_PREFIX')){define('KEY_PREFIX','IceHrm');}
if(!defined('APP_SEC')){define('APP_SEC','dbcs234d2saaqw');} if(!defined('APP_SEC')){define('APP_SEC','dbcs234d2s111');}
define('UI_SHOW_SWITCH_PROFILE', true); define('UI_SHOW_SWITCH_PROFILE', true);
define('CRON_LOG', '/var/log/nginx/icehrmcron.log'); define('CRON_LOG', '/var/log/nginx/icehrmcron.log');
define('MEMCACHE_HOST', '127.0.0.1');
define('MEMCACHE_PORT', '11211');
if(!defined('WK_HTML_PATH')){
define('WK_HTML_PATH', '/usr/bin/wkhtmltopdf');
}
define('ALL_CLIENT_BASE_PATH', '/vagrant/deployment/clients/');
define('CHECK_UPDATE_URL', 'https://icehrm.com/a.php?a=checkUpdate&');

View File

@@ -1,519 +0,0 @@
.redFont{
color: red;
}
.box_ws{
background: white;
border-left: 1px solid #DDD;
border-right: 1px solid #DDD;
border-bottom: 1px solid #DDD;
color: #555;
}
.cal_box_ws{
background: white;
border: 1px solid #DDD;
color: #555;
height: 100px;
}
.cal_box_ws .wd_date_full{
font-weight:bold;
font-size:10px;
float: right;
margin-right: 5px;
}
.cal_box_ws .wd_date{
font-size:10px;
float: right;
margin-right: 5px;
}
.nav-pills li a:hover{
background: #1D64AD;
color:white;
};
.navbar-inverse .brand, .navbar-inverse .nav > li > a {
font-weight: bold;
font-size: 12px;
}
.categoryWrap p{
font-size:16px;
font-weight:bold;
padding: 3px;
}
.categoryWrap p:hover{
font-size:16px;
font-weight:bold;
color:white;
background: gray;
padding: 3px;
cursor:pointer;
border-radius: 4px;
}
.resultLogo{
text-align: center;
}
.pbar{
font-weight:bold;
font-size:11px;
}
.pbar .progress{
height: 10px;
}
.bs-docs-sidenav {
width: 228px;
margin: 30px 0 0;
padding: 0;
background-color: #fff;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
-webkit-box-shadow: 0 1px 4px rgba(0,0,0,.065);
-moz-box-shadow: 0 1px 4px rgba(0,0,0,.065);
box-shadow: 0 1px 4px rgba(0,0,0,.065);
}
.bs-docs-sidenav > li > a {
display: block;
*width: 190px;
margin: 0 0 -1px;
padding: 8px 14px;
border: 1px solid #e5e5e5;
}
.bs-docs-sidenav > li:first-child > a {
-webkit-border-radius: 6px 6px 0 0;
-moz-border-radius: 6px 6px 0 0;
border-radius: 6px 6px 0 0;
}
.bs-docs-sidenav > li:last-child > a {
-webkit-border-radius: 0 0 6px 6px;
-moz-border-radius: 0 0 6px 6px;
border-radius: 0 0 6px 6px;
}
.bs-docs-sidenav > .active > a {
position: relative;
z-index: 2;
padding: 9px 15px;
border: 0;
text-shadow: 0 1px 0 rgba(0,0,0,.15);
-webkit-box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1);
-moz-box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1);
box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1);
}
/* Chevrons */
.bs-docs-sidenav .icon-chevron-right {
float: right;
margin-top: 2px;
margin-right: -6px;
opacity: .25;
}
.bs-docs-sidenav > li > a:hover {
background-color: #f5f5f5;
}
.bs-docs-sidenav a:hover .icon-chevron-right {
opacity: .5;
}
.bs-docs-sidenav .active .icon-chevron-right,
.bs-docs-sidenav .active a:hover .icon-chevron-right {
background-image: url(../img/glyphicons-halflings-white.png);
opacity: 1;
}
.bs-docs-sidenav.affix {
top: 40px;
}
.bs-docs-sidenav.affix-bottom {
position: absolute;
top: auto;
bottom: 270px;
}
/* Responsive
-------------------------------------------------- */
/* Desktop large
------------------------- */
@media (min-width: 1200px) {
.bs-docs-container {
max-width: 970px;
}
.bs-docs-sidenav {
width: 258px;
}
}
.reviewPoints{
margin-top:10px;
}
.reviewPoints .star{
margin-left: 10px;
}
.reviewBlock {
position: relative;
margin: 0px 0;
padding: 39px 19px 14px;
background-color: white;
border: 1px solid #DDD;
/*
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
*/
font-size:12px;
}
/*.reviewBlock::after {
content: attr(data-content);
position: absolute;
top: -1px;
left: -1px;
padding: 3px 7px;
font-size: 12px;
font-weight: bold;
background-color: whiteSmoke;
border: 1px solid #DDD;
color: #9DA0A4;
-webkit-border-radius: 4px 0 4px 0;
-moz-border-radius: 4px 0 4px 0;
border-radius: 4px 0 4px 0;
}*/
.box_ws{
background: white;
border-left: 1px solid #DDD;
border-right: 1px solid #DDD;
border-bottom: 1px solid #DDD;
color: #555;
}
.cal_box_ws{
background: white;
border: 1px solid #DDD;
color: #555;
height: 100px;
}
.cal_box_ws .wd_date_full{
font-weight:bold;
font-size:10px;
float: right;
margin-right: 5px;
}
.cal_box_ws .wd_date{
font-size:10px;
float: right;
margin-right: 5px;
}
.nav-pills li a:hover{
background: #1D64AD;
color:white;
};
.nav-tabs > li > a {
color:white;
}
.nav-tabs > li > a:hover{
color:#555;
}
.topheader {
background: -moz-linear-gradient(#829AA8, #405A6A);
background: -webkit-linear-gradient(#829AA8, #405A6A);
background: linear-gradient(#829AA8, #405A6A);
border: 1px solid #677C89;
border-bottom-color: #6B808D;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4),0 0px 10px rgba(0, 0, 0, 0.1);
}
.bgbody{
background: #FAFAFA;
background: -moz-linear-gradient(#FAFAFA, #EAEAEA);
background: -webkit-linear-gradient(#FAFAFA, #EAEAEA);
background: linear-gradient(#FAFAFA, #EAEAEA);
border-bottom: 1px solid #CACACA;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4),0 0px 10px rgba(0, 0, 0, 0.1);
}
.leftMenu{
background-color: #E9F1F4;
border-style: solid;
border-width: 1px 1px 2px;
border-color: #E9F1F4 #D8DEE2 #D8DEE2;
border-radius: 0 0 5px 5px;
}
.nav > li > a:hover {
text-decoration: none;
background-color: whitesmoke;
border-radius: 5px;
}
/*
.nav-list > .active > a, .nav-list > .active > a:hover{
color: white;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
background-color: #405A6A;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4),0 0px 10px rgba(0, 0, 0, 0.1);
border-radius: 5px;
}
*/
a {
color: #405A6A;
text-decoration: none;
}
.nav-header {
display: block;
padding: 3px 15px;
font-size: 15px;
font-weight: bold;
line-height: 20px;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
text-transform: none;
background: -moz-linear-gradient(#829AA8, #405A6A);
background: -webkit-linear-gradient(#829AA8, #405A6A);
background: linear-gradient(#829AA8, #405A6A);
color: white;
border-radius: 2px;
}
.modal-backdrop,
.modal-backdrop.fade.in {
opacity: 0.4;
filter: alpha(opacity=40);
}
.error{
color:red;
}
.columnMain{
font-weight: bold;
}
.borderBox{
padding-bottom: 10px;
padding-left: 10px;
padding-top: 10px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-border-radius: 5px;
margin-bottom: 20px;
-moz-box-shadow: 1px 3px 3px rgba(0, 0, 0, 0.1);
-webkit-box-shadow: 1px 3px 3px rgba(0, 0, 0, 0.1);
box-shadow: 1px 3px 3px rgba(0, 0, 0, 0.1);
border: 1px solid #EEE;
}
.iceicon_edit{
background-image: url("../images/edit.png");
}
.iceicon_delete{
background-image: url("../images/delete.png");
}
.iceicon_user{
background-image: url("../images/user.png");
}
.dropdown-menu{
z-index: 10000;
}
.lightface .lightfaceContent .lightfaceTitle {
font-size: 14px;
color: #fff;
background-color: #405A6A;
border: 1px solid #405A6A;
font-weight: bold;
margin: -1px;
margin-bottom: 0;
padding: 5px 10px;
line-height: 30px;
}
.label-ice, .badge-ice{
background-color: #405A6A;
}
.dataTables_processing{
position: absolute;
margin-left: 40px;
font-weight: bold;
font-size: 13px;
color: gray;
}
/*changes to full caledar*/
.fc-header-title h2 {
margin-top: 0;
white-space: nowrap;
font-size: 20px;
margin-left: 10px;
color:#405A6A;
}
table.dataTable{
font-size: 1.1em;
}
.form-horizontal{
font-size: 1.2em;
}
.form-horizontal .row{
margin-bottom: 10px;
}
.table.dataTable {width:100% !important;}
.iceLabel{
font-size: 12px !important;
font-weight: bold;
color: #3c8dbc;
}
.nav-tabs>li>a{
border-radius:0px;
}
.nav > li > a:hover {
border-radius:0px;
}
.btn {
-webkit-border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 0px;
}
/* select2 style overide */
.select2-choice{
border: none !important;
width: 100% !important;
border-radius: 0px !important;
background-color: #FFF !important;
background-image: none !important;
}
.select2-container{
padding:3px !important;
}
.select2-container-multi{
padding:0px !important;
border:none;
}
.select2-arrow{
background-image: none !important;
background: #FFF !important;
border: none !important;
}
.select2-drop-active {
/*border: 1px solid black !important;*/
border-top: none !important;
background: #f0f0f0 !important;
}
.logTime{
font-weight: bold;
font-size: 13px;
font-style: italic;
}
.popupForm{
border: none !important;
padding: 0px 19px 14px !important;
}
.content {
background: #FFF;
}
.wrapper {
background: #FFF;
}
.user-panel > .info > p {
margin-bottom: 9px;
max-width: 135px;
line-height: 17px;
}
.list-group-item-text{
margin-bottom:5px;
}
.list-group-item{
padding-bottom:30px;
}
/custom for v11.0 */
.table-bordered>thead>tr>th{
border:none !important;
}
.table-bordered>thead>tr>th, .table-bordered>thead>tr>td {
border-bottom-width: 2px;
border: none;
}
.table{
-webkit-transition: margin-left .15s linear;
transition: margin-left .15s linear;
-webkit-user-select: none;
background-color: #fff;
-webkit-box-shadow: 0 1px 2px 0 rgba(0,0,0,.2);
box-shadow: 0 1px 2px 0 rgba(0,0,0,.2);
}
.reviewBlock{
-webkit-box-sizing: border-box;
box-sizing: border-box
}
.treeview-menu li:hover{
font-weight:bold;
}

10
core-ext/lang/de-ext.po Normal file
View File

@@ -0,0 +1,10 @@
msgid ""
msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Language: English\n"
"Language-Team: IceHrm\n"
"Last-Translator: Thilina Hasantha\n"
"MIME-Version: 1.0\n"
"Project-Id-Version: 18.0\n"
"Report-Msgid-Bugs-To: https://icehrm.com\n"

10
core-ext/lang/en-ext.po Normal file
View File

@@ -0,0 +1,10 @@
msgid ""
msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Language: English\n"
"Language-Team: IceHrm\n"
"Last-Translator: Thilina Hasantha\n"
"MIME-Version: 1.0\n"
"Project-Id-Version: 18.0\n"
"Report-Msgid-Bugs-To: https://icehrm.com\n"

View File

@@ -0,0 +1,2 @@
<?php
//Nothing here

View File

@@ -1,317 +0,0 @@
<?php
define('CLIENT_PATH',dirname(__FILE__));
include ("config.base.php");
include ("include.common.php");
include("server.includes.inc.php");
if(empty($user)){
if(!empty($_REQUEST['username']) && !empty($_REQUEST['password'])){
$suser = null;
$ssoUserLoaded = false;
if(empty($suser)){
$suser = new User();
$suser->Load("(username = ? or email = ?) and password = ?",array($_REQUEST['username'],$_REQUEST['username'],md5($_REQUEST['password'])));
}
if($suser->password == md5($_REQUEST['password']) || $ssoUserLoaded){
$user = $suser;
SessionUtils::saveSessionObject('user', $user);
$suser->last_login = date("Y-m-d H:i:s");
$suser->Save();
if(!$ssoUserLoaded && !empty(BaseService::getInstance()->auditManager)){
BaseService::getInstance()->auditManager->user = $user;
BaseService::getInstance()->audit(IceConstants::AUDIT_AUTHENTICATION, "User Login");
}
if($user->user_level == "Admin"){
header("Location:".HOME_LINK_ADMIN);
}else{
header("Location:".HOME_LINK_OTHERS);
}
}else{
header("Location:".CLIENT_BASE_URL."login.php?f=1");
}
}
}else{
if($user->user_level == "Admin"){
header("Location:".HOME_LINK_ADMIN);
}else{
header("Location:".HOME_LINK_OTHERS);
}
}
$tuser = SessionUtils::getSessionObject('user');
//check user
$logoFileName = CLIENT_BASE_PATH."data/logo.png";
$logoFileUrl = CLIENT_BASE_URL."data/logo.png";
if(!file_exists($logoFileName)){
$logoFileUrl = BASE_URL."images/logo.png";
}
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title><?=APP_NAME?> Login v<?=VERSION?> &copy; http://icehrm.com</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="A Powerful But Simple Way to Manage Your Company and People. http://icehrm.com">
<meta name="author" content="http://gamonoid.com">
<!-- Le styles -->
<link href="<?=BASE_URL?>bootstrap/css/bootstrap.css" rel="stylesheet">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.js"></script>
<script src="<?=BASE_URL?>bootstrap/js/bootstrap.js"></script>
<script src="<?=BASE_URL?>js/jquery.placeholder.js"></script>
<script src="<?=BASE_URL?>js/jquery.dataTables.js"></script>
<script src="<?=BASE_URL?>js/bootstrap-datepicker.js"></script>
<link href="<?=BASE_URL?>bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
<link href="<?=BASE_URL?>css/DT_bootstrap.css?v=0.4" rel="stylesheet">
<link href="<?=BASE_URL?>css/datepicker.css" rel="stylesheet">
<link href="<?=BASE_URL?>css/style.css?v=<?=$cssVersion?>" rel="stylesheet">
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style type="text/css">
/* Override some defaults */
html, body {
background-color: #829AA8;
}
body {
padding-top: 40px;
}
.container {
width: 300px;
}
/* The white background content wrapper */
.container > .content {
background-color: #fff;
padding: 20px;
margin: 0 -20px;
-webkit-border-radius: 10px 10px 10px 10px;
-moz-border-radius: 10px 10px 10px 10px;
border-radius: 10px 10px 10px 10px;
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15);
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.15);
box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.login-form {
margin-left: 65px;
}
legend {
margin-right: -50px;
font-weight: bold;
color: #404040;
}
</style>
</head>
<body>
<div itemscope itemtype="http://schema.org/WebApplication" style="display: none;">
<span itemprop="name">IceHrm Pro</span> -
REQUIRES <span itemprop="operatingSystem">Windows, OSX, Linux</span>
<link itemprop="applicationCategory" href="http://icehrm.com"/>
RATING:
<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<span itemprop="ratingValue">4.5</span> (
<span itemprop="ratingCount">12</span> ratings )
</div>
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
Price: $<span itemprop="price">199.99</span>
<meta itemprop="priceCurrency" content="USD" />
</div>
</div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '<?=BaseService::getInstance()->getGAKey()?>', 'gamonoid.com');
ga('send', 'pageview');
</script>
<script type="text/javascript">
var key = "";
<?php if(isset($_REQUEST['key'])){?>
key = '<?=$_REQUEST['key']?>';
key = key.replace(/ /g,"+");
<?php }?>
$(document).ready(function() {
$(window).keydown(function(event){
if(event.keyCode == 13) {
event.preventDefault();
return false;
}
});
$("#password").keydown(function(event){
if(event.keyCode == 13) {
submitLogin();
return false;
}
});
});
function showForgotPassword(){
$("#loginForm").hide();
$("#requestPasswordChangeForm").show();
}
function requestPasswordChange(){
$("#requestPasswordChangeFormAlert").hide();
var id = $("#usernameChange").val();
$.post("service.php", {'a':'rpc','id':id}, function(data) {
if(data.status == "SUCCESS"){
$("#requestPasswordChangeFormAlert").show();
$("#requestPasswordChangeFormAlert").html(data.message);
}else{
$("#requestPasswordChangeFormAlert").show();
$("#requestPasswordChangeFormAlert").html(data.message);
}
},"json");
}
function changePassword(){
$("#newPasswordFormAlert").hide();
var password = $("#password").val();
var passwordValidation = function (str) {
var val = /^[a-zA-Z0-9]\w{6,}$/;
return str != null && val.test(str);
};
if(!passwordValidation(password)){
$("#newPasswordFormAlert").show();
$("#newPasswordFormAlert").html("Password may contain only letters, numbers and should be longer than 6 characters");
return;
}
$.post("service.php", {'a':'rsp','key':key,'pwd':password,"now":"1"}, function(data) {
if(data.status == "SUCCESS"){
top.location.href = "login.php?c=1";
}else{
$("#newPasswordFormAlert").show();
$("#newPasswordFormAlert").html(data.message);
}
},"json");
}
function submitLogin(){
$("#loginForm").submit();
}
</script>
<div class="container">
<?php if(defined('DEMO_MODE')){?>
<div class="content" style="top: 30px;
position: absolute;
left: 50px;
width: 380px;
height: 100px;">
<ul class="list-group" style="font-size:12px;">
<li style="padding-bottom:3px;" class="list-group-item">Admin: (Username = admin/ Password = admin)</li>
<li style="padding-bottom:3px;" class="list-group-item">Manager: (Username = manager/ Password = demouserpwd)</li>
<li style="padding-bottom:3px;" class="list-group-item">User: (Username = user1/ Password = demouserpwd)</li>
<li style="padding-bottom:3px;" class="list-group-item">User: (Username = user2/ Password = demouserpwd)</li>
</ul>
</div>
<?php }?>
<div class="content" style="margin-top:100px;">
<div class="row">
<div class="login-form">
<h2><img src="<?=$logoFileUrl?>"/></h2>
<?php if(!isset($_REQUEST['cp'])){?>
<form id="loginForm" action="login.php" method="POST">
<fieldset>
<div class="clearfix">
<div class="input-prepend">
<span class="add-on"><i class="icon-user"></i></span>
<input class="span2" type="text" id="username" name="username" placeholder="Username">
</div>
</div>
<div class="clearfix">
<div class="input-prepend">
<span class="add-on"><i class="icon-lock"></i></span>
<input class="span2" type="password" id="password" name="password" placeholder="Password">
</div>
</div>
<?php if(isset($_REQUEST['f'])){?>
<div class="clearfix alert alert-error" style="font-size:11px;width:147px;margin-bottom: 5px;">
Login failed
<?php if(isset($_REQUEST['fm'])){
echo $_REQUEST['fm'];
}?>
</div>
<?php } ?>
<?php if(isset($_REQUEST['c'])){?>
<div class="clearfix alert alert-info" style="font-size:11px;width:147px;margin-bottom: 5px;">
Password changed successfully
</div>
<?php } ?>
<button class="btn" style="margin-top: 5px;" type="button" onclick="submitLogin();return false;">Sign in&nbsp;&nbsp;<span class="icon-arrow-right"></span></button>
</fieldset>
<div class="clearfix">
<a href="" onclick="showForgotPassword();return false;" style="float:left;margin-top: 10px;">Forgot password</a>
<a href="<?=TWITTER_URL?>" target="_blank" style="float:right;"><img src="<?=BASE_URL?>images/32x32-Circle-53-TW.png"/></a>
<a href="<?=FB_URL?>" target="_blank" style="float:right;margin-right: 7px;"><img src="<?=BASE_URL?>images/32x32-Circle-54-FB.png"/></a>
</div>
<div class="clearfix">
<span style="font-size:9px;">&copy; <a href="http://icehrm.com" target="_blank">IceHrm - v<?=VERSION?></a> Developed by <a href="http://gamonoid.com" target="_blank">Gamonoid (Pvt) Ltd.</a></span>
</div>
</form>
<form id="requestPasswordChangeForm" style="display:none;" action="">
<fieldset>
<div class="clearfix">
<div class="input-prepend">
<span class="add-on"><i class="icon-user"></i></span>
<input class="span2" type="text" id="usernameChange" name="usernameChange" placeholder="Username or Email">
</div>
</div>
<div id="requestPasswordChangeFormAlert" class="clearfix alert alert-info" style="font-size:11px;width:147px;margin-bottom: 5px;display:none;">
</div>
<button class="btn" style="margin-top: 5px;" type="button" onclick="requestPasswordChange();return false;">Request Password Change&nbsp;&nbsp;<span class="icon-arrow-right"></span></button>
</fieldset>
</form>
<?php }else{?>
<form id="newPasswordForm" action="">
<fieldset>
<div class="clearfix">
<div class="input-prepend">
<span class="add-on"><i class="icon-lock"></i></span>
<input class="span2" type="password" id="password" name="password" placeholder="New Password">
</div>
</div>
<div id="newPasswordFormAlert" class="clearfix alert alert-error" style="font-size:11px;width:147px;margin-bottom: 5px;display:none;">
</div>
<button class="btn" style="margin-top: 5px;" type="button" onclick="changePassword();return false;">Change Password&nbsp;&nbsp;<span class="icon-arrow-right"></span></button>
</fieldset>
</form>
<?php }?>
</div>
</div>
</div>
</div> <!-- /container -->
</body>
</html>

View File

@@ -1,6 +1,19 @@
<?php <?php
class ICEHRM_Record extends ADOdb_Active_Record{ class ICEHRM_Record extends ADOdb_Active_Record{
var $keysToIgnore = array(
"_table",
"_dbat",
"_tableat",
"_where",
"_saved",
"_lasterr",
"_original",
"foreignName",
"a",
"t"
);
public function getAdminAccess(){ public function getAdminAccess(){
return array("get","element","save","delete"); return array("get","element","save","delete");
} }
@@ -61,6 +74,10 @@ class ICEHRM_Record extends ADOdb_Active_Record{
return $obj; return $obj;
} }
public function postProcessGetElement($obj){
return $obj;
}
public function getDefaultAccessLevel(){ public function getDefaultAccessLevel(){
return array("get","element","save","delete"); return array("get","element","save","delete");
} }
@@ -69,4 +86,53 @@ class ICEHRM_Record extends ADOdb_Active_Record{
return array( return array(
); );
} }
public function allowIndirectMapping(){
return false;
}
public function getDisplayName() {
return get_called_class();
}
public function getObjectKeys(){
$keys = array();
foreach($this as $k=>$v){
if(in_array($k,$this->keysToIgnore )){
continue;
}
if(is_array($v) || is_object($v)){
continue;
}
$keys[$k] = $k;
}
return $keys;
}
public function getCustomFields($obj){
$keys = array();
$objKeys = $this->getObjectKeys();
foreach($obj as $k=>$v){
if(isset($objKeys[$k])){
continue;
}
if(is_array($v) || is_object($v)){
continue;
}
if(in_array($k,$this->keysToIgnore )){
continue;
}
$keys[$k] = $k;
}
return $keys;
}
} }

View File

@@ -52,6 +52,41 @@
</div> </div>
<!-- Plain Message Modal --> <!-- Plain Message Modal -->
<!-- Data Message Modal -->
<div class="modal fade" id="dataMessageModel" tabindex="-1" role="dialog" aria-labelledby="dataMessageModelLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header" style="border-bottom:none;/*background-color: #3c8dbc;*/">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="margin-top:-10px;"><li class="fa fa-times"/></button>
</div>
<div class="modal-body">
<p id="dataMessageModelBody"></p>
</div>
</div>
</div>
</div>
<!-- Data Message Modal -->
<!-- Yes No Modal -->
<div class="modal fade" id="yesnoModel" tabindex="-1" role="dialog" aria-labelledby="yesnoModelLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button>
<h3 id="yesnoModelLabel" style="font-size: 17px;"></h3>
</div>
<div class="modal-body">
<p id="yesnoModelBody"></p>
</div>
<div class="modal-footer">
<button id="yesnoModelNoBtn" class="btn" onclick="modJs.cancelYesno();">No</button>
<button id="yesnoModelYesBtn" class="btn btn-primary">Yes</button>
</div>
</div>
</div>
</div>
<!-- Yes No Modal -->
<!-- Upload Modal --> <!-- Upload Modal -->
<div class="modal fade" id="uploadModel" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal fade" id="uploadModel" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
@@ -83,8 +118,8 @@
<p id="verifyModelBody"> <p id="verifyModelBody">
<b>Step 1:</b><br/> <b>Step 1:</b><br/>
Please get your Instance Key from here:<br/> Please get your Instance Key from here:<br/>
<a target="_blank" href="http://icehrm.com/generateInstanceKey.php?id=<?=$baseService->getInstanceId()?>"> <a target="_blank" href="https://icehrm.com/generateInstanceKey.php?id=<?=$baseService->getInstanceId()?>">
http://icehrm.com/generateInstanceKey.php?id=<?=$baseService->getInstanceId()?> https://icehrm.com/generateInstanceKey.php?id=<?=$baseService->getInstanceId()?>
</a> </a>
<br/><b>Step 2:</b><br/> <br/><b>Step 2:</b><br/>
@@ -122,10 +157,10 @@
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button>
<h3 id="myModalLabel">Switch Employee</h3> <h3 id="myModalLabel"><?=LanguageManager::tran('Switch Employee')?></h3>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<p>Select the employee to Edit</p> <p><?=LanguageManager::tran('Select The Employee to Switch Into')?></p>
<div style="border: solid 1px #EEE;"> <div style="border: solid 1px #EEE;">
<select id="switch_emp" style="width:100%;"> <select id="switch_emp" style="width:100%;">
<!-- <!--
@@ -141,11 +176,47 @@
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button> <button class="btn" data-dismiss="modal" aria-hidden="true"><?=LanguageManager::tran('Close')?></button>
<button class="btn btn-primary" onclick="modJs.setAdminProfile($('#switch_emp').val());return false;">Switch</button> <button class="btn btn-primary" onclick="modJs.setAdminProfile($('#switch_emp').val());return false;"><?=LanguageManager::tran('Switch')?></button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- Modal --> <!-- Modal -->
<?php }?> <?php }?>
<?php if(isset($itemNameLower)){?>
<div class="modal" id="<?=$itemNameLower?>StatusModel" tabindex="-1" role="dialog" aria-labelledby="messageModelLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button>
<h3 style="font-size: 17px;">Change <?=$itemName?> Status</h3>
</div>
<div class="modal-body">
<form id="expenseStatusForm">
<div class="control-group">
<label class="control-label" for="expense_status"><?=$itemName?> Status</label>
<div class="controls">
<select type="text" id="<?=$itemNameLower?>_status" class="form-control" name="<?=$itemNameLower?>_status" value="">
</select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="expense_status">Status Change Note</label>
<div class="controls">
<textarea id="<?=$itemNameLower?>_reason" class="form-control" name="<?=$itemNameLower?>_reason" maxlength="500"></textarea>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="modJs.changeStatus();">Change <?=$itemName?> Status</button>
<button class="btn" onclick="modJs.closeDialog();">Not Now</button>
</div>
</div>
</div>
</div>
<?php } ?>

61
core-ext/raml/api.raml Normal file
View File

@@ -0,0 +1,61 @@
#%RAML 0.8
---
title: IceHrm
baseUri: http://icehrm-hosted.gamonoid.com/api
version: 1
documentation:
- title: Authentication
content: !include documentation/authentication.md
- title: Responses
content: !include documentation/responses.md
/employee:
displayName: Employee
/list:
get:
is: [ paginated ]
description: Get a list of employees
responses:
200:
body:
application/json:
schema: !include schemas/employees.json
example: !include examples/employees.json
/{id}:
get:
description: Get an employee by id
responses:
200:
body:
application/json:
schema: !include schemas/employee.json
example: !include examples/employee.json
404:
description: Employee does not exist
body:
application/json:
schema: !include schemas/error.json
uriParameters:
id:
description: Employee id
type: integer
/candidate:
displayName: Candidate
/{id}:
get:
description: Get an employee by id
responses:
200:
body:
application/json:
schema: !include schemas/candidate.json
example: !include examples/candidate.json
404:
description: Candidate does not exist
body:
application/json:
schema: !include schemas/error.json
uriParameters:
id:
description: Candidate id
type: integer

View File

@@ -0,0 +1 @@
Admin users of icehrm can find the access token under System->Settings

View File

@@ -0,0 +1,9 @@
| Code | Description |
|------|--------------------|
| 200 | Ok |
| 201 | Created |
| 400 | Bad request |
| 401 | Not authorized |
| 403 | Forbidden |
| 404 | Resource not found |
| 500 | Server error |

View File

@@ -0,0 +1,53 @@
{
"id": "1",
"first_name": "Jhon",
"last_name": "Doe",
"nationality": "4",
"birthday": null,
"gender": "Male",
"marital_status": null,
"address1": null,
"address2": null,
"city": "New York",
"country": "US",
"province": null,
"postal_code": null,
"email": "icehrm+jhon@web-stalk.com",
"home_phone": "+1 455565656",
"mobile_phone": null,
"cv_title": "Software Engineer",
"cv": "cv_rYwHphV7xD5dOe1444302569136",
"cvtext": null,
"industry": null,
"profileImage": null,
"head_line": "",
"objective": "",
"work_history": "",
"education": "",
"skills": "",
"referees": "",
"linkedInUrl": null,
"linkedInData": null,
"totalYearsOfExperience": null,
"totalMonthsOfExperience": null,
"generatedCVFile": null,
"created": "2015-10-08 16:59:20",
"updated": "2015-10-08 16:59:20",
"expectedSalary": "0",
"preferedPositions": null,
"preferedJobtype": null,
"preferedCountries": null,
"tags": null,
"notes": null,
"calls": null,
"age": null,
"hash": "663fd20d1859344585f678a0f87b23522b8f9fce8c67c5290a609ce342b81442",
"linkedInProfileLink": null,
"linkedInProfileId": null,
"facebookProfileLink": null,
"facebookProfileId": null,
"twitterProfileLink": null,
"twitterProfileId": null,
"googleProfileLink": null,
"googleProfileId": null
}

View File

@@ -0,0 +1,75 @@
{
"id": "2",
"employee_id": "EMP002",
"first_name": "Lala",
"middle_name": "Nadila ",
"last_name": "Lamees",
"nationality": "175",
"birthday": "1984-03-12",
"gender": "Female",
"marital_status": "Single",
"ssn_num": "",
"nic_num": "4594567WE3",
"other_id": "4595567WE3",
"driving_license": "349-066-YUO",
"driving_license_exp_date": "2012-03-01",
"employment_status": "1",
"job_title": "8",
"pay_grade": "2",
"work_station_id": "W001",
"address1": "Green War Rd, 00123",
"address2": "",
"city": "Istanbul",
"country": "TR",
"province": null,
"postal_code": "909066",
"home_phone": "+960112345",
"mobile_phone": "+960112345",
"work_phone": "+960112345",
"work_email": "icehrm+manager@web-stalk.com",
"private_email": "icehrm+manager@web-stalk.com",
"joined_date": "2011-03-07",
"confirmation_date": "2012-02-14",
"supervisor": "1",
"indirect_supervisors": "[3,4]",
"department": "2",
"custom1": null,
"custom2": null,
"custom3": null,
"custom4": null,
"custom5": null,
"custom6": null,
"custom7": null,
"custom8": null,
"custom9": null,
"custom10": null,
"termination_date": "0000-00-00",
"notes": null,
"status": "Active",
"ethnicity": null,
"immigration_status": null,
"approver1": "5",
"approver2": "6",
"approver3": null,
"nationality_Name_id": [],
"nationality_Name": "Tajik",
"ethnicity_Name_id": [],
"ethnicity_Name": null,
"immigration_status_Name_id": [],
"immigration_status_Name": null,
"employment_status_Name_id": [],
"employment_status_Name": "Full Time Contract",
"job_title_Name_id": [],
"job_title_Name": "Pre-Sales Executive",
"pay_grade_Name_id": [],
"pay_grade_Name": "Executive",
"country_Name_id": [],
"country_Name": "Turkey",
"province_Name_id": [],
"province_Name": null,
"department_Name_id": [],
"department_Name": "Head Office",
"supervisor_Name_id": [],
"supervisor_Name": "IceHrm Employee",
"image": "http:\/\/app.app.dev\/images\/user_female.png"
}

View File

@@ -0,0 +1,23 @@
[
{
"id": "1",
"employee_id": "EMP001",
"first_name": "IceHrm",
"middle_name": "Sample",
"last_name": "Employee"
},
{
"id": "2",
"employee_id": "EMP002",
"first_name": "Lala",
"middle_name": "Nadila ",
"last_name": "Lamees"
},
{
"id": "3",
"employee_id": "EMP003",
"first_name": "Sofia",
"middle_name": "",
"last_name": "O'Sullivan"
}
]

View File

@@ -0,0 +1,27 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"email": {
"type": "string"
},
"first_name": {
"type": "string"
},
"last_name": {
"type": "string"
},
"cv_title": {
"type": "string"
}
},
"required": [
"id",
"employee_id",
"first_name",
"last_name"
]
}

View File

@@ -0,0 +1,27 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"employee_id": {
"type": "string"
},
"first_name": {
"type": "string"
},
"middle_name": {
"type": "string"
},
"last_name": {
"type": "string"
}
},
"required": [
"id",
"employee_id",
"first_name",
"last_name"
]
}

View File

@@ -0,0 +1,30 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"employee_id": {
"type": "string"
},
"first_name": {
"type": "string"
},
"middle_name": {
"type": "string"
},
"last_name": {
"type": "string"
}
},
"required": [
"id",
"employee_id",
"first_name",
"last_name"
]
}
}

View File

@@ -0,0 +1,39 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"messages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
]
}
},
"description": {
"type": "string"
}
},
"required": [
"messages",
"description"
]
}
},
"required": [
"error"
]
}

View File

@@ -1,3 +1,119 @@
INSERT INTO `Timezones`(`id`, `name`, `details`) VALUES
(1, 'Pacific/Midway', '(GMT-11:00) Midway Island'),
(2, 'US/Samoa', '(GMT-11:00) Samoa'),
(3, 'US/Hawaii', '(GMT-10:00) Hawaii'),
(4, 'US/Alaska', '(GMT-09:00) Alaska'),
(5, 'US/Pacific', '(GMT-08:00) Pacific Time (US, Canada)'),
(6, 'America/Tijuana', '(GMT-08:00) Tijuana'),
(7, 'US/Arizona', '(GMT-07:00) Arizona'),
(8, 'US/Mountain', '(GMT-07:00) Mountain Time (US, Canada)'),
(9, 'America/Chihuahua', '(GMT-07:00) Chihuahua'),
(10, 'America/Mazatlan', '(GMT-07:00) Mazatlan'),
(11, 'America/Mexico_City', '(GMT-06:00) Mexico City'),
(12, 'America/Monterrey', '(GMT-06:00) Monterrey'),
(13, 'Canada/Saskatchewan', '(GMT-06:00) Saskatchewan'),
(14, 'US/Central', '(GMT-06:00) Central Time (US , Canada)'),
(15, 'US/Eastern', '(GMT-05:00) Eastern Time (US , Canada)'),
(16, 'US/East-Indiana', '(GMT-05:00) Indiana (East)'),
(17, 'America/Bogota', '(GMT-05:00) Bogota'),
(18, 'America/Lima', '(GMT-05:00) Lima'),
(19, 'America/Caracas', '(GMT-04:30) Caracas'),
(20, 'Canada/Atlantic', '(GMT-04:00) Atlantic Time (Canada)'),
(21, 'America/La_Paz', '(GMT-04:00) La Paz'),
(22, 'America/Santiago', '(GMT-04:00) Santiago'),
(23, 'Canada/Newfoundland', '(GMT-03:30) Newfoundland'),
(24, 'America/Buenos_Aires', '(GMT-03:00) Buenos Aires'),
(25, 'Greenland', '(GMT-03:00) Greenland'),
(26, 'Atlantic/Stanley', '(GMT-02:00) Stanley'),
(27, 'Atlantic/Azores', '(GMT-01:00) Azores'),
(28, 'Atlantic/Cape_Verde', '(GMT-01:00) Cape Verde Is.'),
(29, 'Africa/Casablanca', '(GMT) Casablanca'),
(30, 'Europe/Dublin', '(GMT) Dublin'),
(31, 'Europe/Lisbon', '(GMT) Lisbon'),
(32, 'Europe/London', '(GMT) London'),
(33, 'Africa/Monrovia', '(GMT) Monrovia'),
(34, 'Europe/Amsterdam', '(GMT+01:00) Amsterdam'),
(35, 'Europe/Belgrade', '(GMT+01:00) Belgrade'),
(36, 'Europe/Berlin', '(GMT+01:00) Berlin'),
(37, 'Europe/Bratislava', '(GMT+01:00) Bratislava'),
(38, 'Europe/Brussels', '(GMT+01:00) Brussels'),
(39, 'Europe/Budapest', '(GMT+01:00) Budapest'),
(40, 'Europe/Copenhagen', '(GMT+01:00) Copenhagen'),
(41, 'Europe/Ljubljana', '(GMT+01:00) Ljubljana'),
(42, 'Europe/Madrid', '(GMT+01:00) Madrid'),
(43, 'Europe/Paris', '(GMT+01:00) Paris'),
(44, 'Europe/Prague', '(GMT+01:00) Prague'),
(45, 'Europe/Rome', '(GMT+01:00) Rome'),
(46, 'Europe/Sarajevo', '(GMT+01:00) Sarajevo'),
(47, 'Europe/Skopje', '(GMT+01:00) Skopje'),
(48, 'Europe/Stockholm', '(GMT+01:00) Stockholm'),
(49, 'Europe/Vienna', '(GMT+01:00) Vienna'),
(50, 'Europe/Warsaw', '(GMT+01:00) Warsaw'),
(51, 'Europe/Zagreb', '(GMT+01:00) Zagreb'),
(52, 'Europe/Athens', '(GMT+02:00) Athens'),
(53, 'Europe/Bucharest', '(GMT+02:00) Bucharest'),
(54, 'Africa/Cairo', '(GMT+02:00) Cairo'),
(55, 'Africa/Harare', '(GMT+02:00) Harare'),
(56, 'Europe/Helsinki', '(GMT+02:00) Helsinki'),
(57, 'Europe/Istanbul', '(GMT+02:00) Istanbul'),
(58, 'Asia/Jerusalem', '(GMT+02:00) Jerusalem'),
(59, 'Europe/Kiev', '(GMT+02:00) Kyiv'),
(60, 'Europe/Minsk', '(GMT+02:00) Minsk'),
(61, 'Europe/Riga', '(GMT+02:00) Riga'),
(62, 'Europe/Sofia', '(GMT+02:00) Sofia'),
(63, 'Europe/Tallinn', '(GMT+02:00) Tallinn'),
(64, 'Europe/Vilnius', '(GMT+02:00) Vilnius'),
(65, 'Asia/Baghdad', '(GMT+03:00) Baghdad'),
(66, 'Asia/Kuwait', '(GMT+03:00) Kuwait'),
(67, 'Africa/Nairobi', '(GMT+03:00) Nairobi'),
(68, 'Asia/Riyadh', '(GMT+03:00) Riyadh'),
(69, 'Europe/Moscow', '(GMT+03:00) Moscow'),
(70, 'Asia/Tehran', '(GMT+03:30) Tehran'),
(71, 'Asia/Baku', '(GMT+04:00) Baku'),
(72, 'Europe/Volgograd', '(GMT+04:00) Volgograd'),
(73, 'Asia/Muscat', '(GMT+04:00) Muscat'),
(74, 'Asia/Tbilisi', '(GMT+04:00) Tbilisi'),
(75, 'Asia/Yerevan', '(GMT+04:00) Yerevan'),
(76, 'Asia/Kabul', '(GMT+04:30) Kabul'),
(77, 'Asia/Karachi', '(GMT+05:00) Karachi'),
(78, 'Asia/Tashkent', '(GMT+05:00) Tashkent'),
(79, 'Asia/Kolkata', '(GMT+05:30) Kolkata'),
(80, 'Asia/Kathmandu', '(GMT+05:45) Kathmandu'),
(81, 'Asia/Yekaterinburg', '(GMT+06:00) Ekaterinburg'),
(82, 'Asia/Almaty', '(GMT+06:00) Almaty'),
(83, 'Asia/Dhaka', '(GMT+06:00) Dhaka'),
(84, 'Asia/Novosibirsk', '(GMT+07:00) Novosibirsk'),
(85, 'Asia/Bangkok', '(GMT+07:00) Bangkok'),
(86, 'Asia/Jakarta', '(GMT+07:00) Jakarta'),
(87, 'Asia/Krasnoyarsk', '(GMT+08:00) Krasnoyarsk'),
(88, 'Asia/Chongqing', '(GMT+08:00) Chongqing'),
(89, 'Asia/Hong_Kong', '(GMT+08:00) Hong Kong'),
(90, 'Asia/Kuala_Lumpur', '(GMT+08:00) Kuala Lumpur'),
(91, 'Australia/Perth', '(GMT+08:00) Perth'),
(92, 'Asia/Singapore', '(GMT+08:00) Singapore'),
(93, 'Asia/Taipei', '(GMT+08:00) Taipei'),
(94, 'Asia/Ulaanbaatar', '(GMT+08:00) Ulaan Bataar'),
(95, 'Asia/Urumqi', '(GMT+08:00) Urumqi'),
(96, 'Asia/Irkutsk', '(GMT+09:00) Irkutsk'),
(97, 'Asia/Seoul', '(GMT+09:00) Seoul'),
(98, 'Asia/Tokyo', '(GMT+09:00) Tokyo'),
(99, 'Australia/Adelaide', '(GMT+09:30) Adelaide'),
(100, 'Australia/Darwin', '(GMT+09:30) Darwin'),
(101, 'Asia/Yakutsk', '(GMT+10:00) Yakutsk'),
(102, 'Australia/Brisbane', '(GMT+10:00) Brisbane'),
(103, 'Australia/Canberra', '(GMT+10:00) Canberra'),
(104, 'Pacific/Guam', '(GMT+10:00) Guam'),
(105, 'Australia/Hobart', '(GMT+10:00) Hobart'),
(106, 'Australia/Melbourne', '(GMT+10:00) Melbourne'),
(107, 'Pacific/Port_Moresby', '(GMT+10:00) Port Moresby'),
(108, 'Australia/Sydney', '(GMT+10:00) Sydney'),
(109, 'Asia/Vladivostok', '(GMT+11:00) Vladivostok'),
(110, 'Asia/Magadan', '(GMT+12:00) Magadan'),
(111, 'Pacific/Auckland', '(GMT+12:00) Auckland'),
(112, 'Pacific/Fiji', '(GMT+12:00) Fiji');
INSERT INTO `CurrencyTypes`(`id`, `code`, `name`) VALUES INSERT INTO `CurrencyTypes`(`id`, `code`, `name`) VALUES
(3, 'AED', 'Utd. Arab Emir. Dirham'), (3, 'AED', 'Utd. Arab Emir. Dirham'),
(4, 'AFN', 'Afghanistan Afghani'), (4, 'AFN', 'Afghanistan Afghani'),
@@ -675,16 +791,52 @@ INSERT INTO `WorkDays` (`id`, `name`, `status`, `country`) VALUES
(7, 'Sunday', 'Non-working Day',NULL); (7, 'Sunday', 'Non-working Day',NULL);
INSERT INTO `Reports` (`id`, `name`, `details`, `parameters`, `query`, `paramOrder`, `type`) VALUES REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
(1, 'Employee Details Report', 'This report list all employee details and you can filter employees by department, employment status or job title', '[\r\n[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "employment_status", {"label":"Employment Status","type":"select2","remote-source":["EmploymentStatus","id","name"],"allow-null":true}],\r\n[ "job_title", {"label":"Job Title","type":"select2","remote-source":["JobTitle","id","name"],"allow-null":true}]\r\n]', 'Select id, employee_id as ''Employee ID'',\r\nconcat(`first_name`,'' '',`middle_name`,'' '', `last_name`) as ''Name'',\r\n(SELECT name from Nationality where id = nationality) as ''Nationality'',\r\nbirthday as ''Birthday'',\r\ngender as ''Gender'',\r\nmarital_status as ''Marital Status'',\r\nssn_num as ''SSN Number'',\r\nnic_num as ''NIC Number'',\r\nother_id as ''Other IDs'',\r\ndriving_license as ''Driving License Number'',\r\n(SELECT name from EmploymentStatus where id = employment_status) as ''Employment Status'',\r\n(SELECT name from JobTitles where id = job_title) as ''Job Title'',\r\n(SELECT name from PayGrades where id = pay_grade) as ''Pay Grade'',\r\nwork_station_id as ''Work Station ID'',\r\naddress1 as ''Address 1'',\r\naddress2 as ''Address 2'',\r\ncity as ''City'',\r\n(SELECT name from Country where code = country) as ''Country'',\r\n(SELECT name from Province where id = province) as ''Province'',\r\npostal_code as ''Postal Code'',\r\nhome_phone as ''Home Phone'',\r\nmobile_phone as ''Mobile Phone'',\r\nwork_phone as ''Work Phone'',\r\nwork_email as ''Work Email'',\r\nprivate_email as ''Private Email'',\r\njoined_date as ''Joined Date'',\r\nconfirmation_date as ''Confirmation Date'',\r\n(SELECT title from CompanyStructures where id = department) as ''Department'',\r\n(SELECT concat(`first_name`,'' '',`middle_name`,'' '', `last_name`,'' [Employee ID:'',`employee_id`,'']'') from Employees e1 where e1.id = e.supervisor) as ''Supervisor'' \r\nFROM Employees e _where_', '["department","employment_status","job_title"]', 'Query'), ('Employee Details Report', 'This report list all employee details and you can filter employees by department, employment status or job title', '[\r\n[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "employment_status", {"label":"Employment Status","type":"select2","remote-source":["EmploymentStatus","id","name"],"allow-null":true}],\r\n[ "job_title", {"label":"Job Title","type":"select2","remote-source":["JobTitle","id","name"],"allow-null":true}]\r\n]', 'Select id, employee_id as ''Employee ID'',\r\nconcat(`first_name`,'' '',`middle_name`,'' '', `last_name`) as ''Name'',\r\n(SELECT name from Nationality where id = nationality) as ''Nationality'',\r\nbirthday as ''Birthday'',\r\ngender as ''Gender'',\r\nmarital_status as ''Marital Status'',\r\nssn_num as ''SSN Number'',\r\nnic_num as ''NIC Number'',\r\nother_id as ''Other IDs'',\r\ndriving_license as ''Driving License Number'',\r\n(SELECT name from EmploymentStatus where id = employment_status) as ''Employment Status'',\r\n(SELECT name from JobTitles where id = job_title) as ''Job Title'',\r\n(SELECT name from PayGrades where id = pay_grade) as ''Pay Grade'',\r\nwork_station_id as ''Work Station ID'',\r\naddress1 as ''Address 1'',\r\naddress2 as ''Address 2'',\r\ncity as ''City'',\r\n(SELECT name from Country where code = country) as ''Country'',\r\n(SELECT name from Province where id = province) as ''Province'',\r\npostal_code as ''Postal Code'',\r\nhome_phone as ''Home Phone'',\r\nmobile_phone as ''Mobile Phone'',\r\nwork_phone as ''Work Phone'',\r\nwork_email as ''Work Email'',\r\nprivate_email as ''Private Email'',\r\njoined_date as ''Joined Date'',\r\nconfirmation_date as ''Confirmation Date'',\r\n(SELECT title from CompanyStructures where id = department) as ''Department'',\r\n(SELECT concat(`first_name`,'' '',`middle_name`,'' '', `last_name`,'' [Employee ID:'',`employee_id`,'']'') from Employees e1 where e1.id = e.supervisor) as ''Supervisor'' \r\nFROM Employees e _where_', '["department","employment_status","job_title"]', 'Query', 'Employee Information','CSV'),
(3, 'Employee Time Entry Report', 'This report list all employee time entries by employee, date range and project', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "project", {"label":"Project","type":"select","allow-null":true,"remote-source":["Project","id","name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeTimesheetReport', '["employee","date_start","date_end","status"]', 'Class'), ('Employee Attendance Report', 'This report list all employee attendance entries by employee and date range', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeAttendanceReport', '["employee","date_start","date_end"]', 'Class','Time Management','CSV'),
(4, 'Employee Attendance Report', 'This report list all employee attendance entries by employee and date range', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeAttendanceReport', '["employee","date_start","date_end"]', 'Class'), ('Employee Time Tracking Report', 'This report list employee working hours and attendance details for each day for a given period ', '[\r\n[ "employee", {"label":"Employee","type":"select2","allow-null":false,"remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeTimeTrackReport', '["employee","date_start","date_end"]', 'Class','Time Management','CSV');
(5, 'Employee Time Tracking Report', 'This report list employee working hours and attendance details for each day for a given period ', '[\r\n[ "employee", {"label":"Employee","type":"select2","allow-null":false,"remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeTimeTrackReport', '["employee","date_start","date_end"]', 'Class');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Employee Time Entry Report', 'View employee time entries by date range and project',
'[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "client", {"label":"Select Client","type":"select","allow-null":true,"null-label":"Not Selected","remote-source":["Client","id","name"]}],\r\n[ "project", {"label":"Or Project","type":"select","allow-null":true,"null-label":"All Projects","remote-source":["Project","id","name","getAllProjects"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]',
'EmployeeTimesheetReport', '["employee","client","project","date_start","date_end","status"]', 'Class','Time Management','CSV');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Active Employee Report', 'This report list employees who are currently active based on joined date and termination date ',
'[\r\n[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}]\r\n]',
'ActiveEmployeeReport',
'["department"]', 'Class','Employee Information','CSV');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`, `report_group`,`output`) VALUES
('New Hires Employee Report', 'This report list employees who are joined between given two dates ',
'[[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]',
'NewHiresEmployeeReport',
'["department","date_start","date_end"]', 'Class','Employee Information','CSV');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`, `report_group`,`output`) VALUES
('Terminated Employee Report', 'This report list employees who are terminated between given two dates ',
'[[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]',
'TerminatedEmployeeReport',
'["department","date_start","date_end"]', 'Class','Employee Information','CSV');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Travel Request Report', 'This report list employees travel requests for a specified period',
'[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}],\r\n[ "status", {"label":"Status","type":"select","source":[["NULL","All Statuses"],["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"],["Cancellation Requested","Cancellation Requested"],["Cancelled","Cancelled"]]}]\r\n]',
'TravelRequestReport',
'["employee","date_start","date_end","status"]', 'Class', 'Travel and Expense Management','CSV');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Employee Time Sheet Report', 'This report list all employee time sheets by employee and date range', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}],\r\n[ "status", {"label":"Status","allow-null":true,"null-label":"All Status","type":"select","source":[["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"]]}]\r\n]', 'EmployeeTimeSheetData', '["employee","date_start","date_end","status"]', 'Class','Time Management','CSV');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Company: Logo', '', '','[ "value", {"label":"Logo","type":"fileupload","validation":"none"}]'),
('Company: Name', 'Sample Company Pvt Ltd', 'Update your company name - For updating company logo copy a file named logo.png to /app/data/ folder', ''), ('Company: Name', 'Sample Company Pvt Ltd', 'Update your company name - For updating company logo copy a file named logo.png to /app/data/ folder', ''),
('Company: Description', 'This is a company using icehrm.com', '',''),
('Email: Enable', '1', '0 will disable all outgoing emails from modules. Value 1 will enable outgoing emails','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'), ('Email: Enable', '1', '0 will disable all outgoing emails from modules. Value 1 will enable outgoing emails','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
('Email: Mode', 'SMTP', 'SMTP, PHP Mailer or Amazon SES. SMTP = send emails using local or a remote smtp server. PHP Mailer = send emails using mail function provided by php. Amazon SES = send emails trough amazon Simple Email Service.','["value", {"label":"Value","type":"select","source":[["SMTP","SMTP"],["PHP Mailer","PHP Mailer"],["SES","Amazon SES"]]}]'), ('Email: Mode', 'SMTP', 'SMTP, PHP Mailer or Amazon SES. SMTP = send emails using local or a remote smtp server. PHP Mailer = send emails using mail function provided by php. Amazon SES = send emails trough amazon Simple Email Service.','["value", {"label":"Value","type":"select","source":[["SMTP","SMTP"],["PHP Mailer","PHP Mailer"],["SES","Amazon SES"]]}]'),
('Email: SMTP Host', 'localhost', 'SMTP host IP',''), ('Email: SMTP Host', 'localhost', 'SMTP host IP',''),
@@ -697,11 +849,69 @@ INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Email: Email From', 'icehrm@mydomain.com', '',''), ('Email: Email From', 'icehrm@mydomain.com', '',''),
('System: Do not pass JSON in request', '0', 'Select Yes if you are having trouble loading data for some tables','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'), ('System: Do not pass JSON in request', '0', 'Select Yes if you are having trouble loading data for some tables','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
('System: Reset Modules and Permissions', '0', 'Select this to reset module and permission information in Database (If you have done any changes to meta files)','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'), ('System: Reset Modules and Permissions', '0', 'Select this to reset module and permission information in Database (If you have done any changes to meta files)','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
('System: Reset Module Names', '0', 'Select this to reset module names in Database','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
('System: Add New Permissions', '0', 'Select this to add new permission changes done to meta.json file of any module','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'), ('System: Add New Permissions', '0', 'Select this to add new permission changes done to meta.json file of any module','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
('System: Debug Mode', '0', '','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'), ('System: Debug Mode', '0', '','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
('Projects: Make All Projects Available to Employees', '1', '','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'), ('Projects: Make All Projects Available to Employees', '1', '','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
('Leave: Share Calendar to Whole Company', '1', '','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
('Leave: CC Emails', '', 'Every email sent though leave module will be CC to these comma seperated list of emails addresses',''),
('Leave: BCC Emails', '', 'Every email sent though leave module will be BCC to these comma seperated list of emails addresses',''),
('Attendance: Time-sheet Cross Check', '0', 'Only allow users to add an entry to a timesheet only if they have marked atteandance for the selected period','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'), ('Attendance: Time-sheet Cross Check', '0', 'Only allow users to add an entry to a timesheet only if they have marked atteandance for the selected period','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
('Api: REST Api Enabled', '0', '','["value", {"label":"Value","type":"select","source":[["0","No"],["1","Yes"]]}]'); ('Api: REST Api Enabled', '1', '','["value", {"label":"Value","type":"select","source":[["0","No"],["1","Yes"]]}]'),
('Api: REST Api Token', 'Click on edit icon', '','["value", {"label":"Value","type":"placeholder"}]');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('LDAP: Enabled', '0', '','["value", {"label":"Value","type":"select","source":[["0","No"],["1","Yes"]]}]'),
('LDAP: Server', '', 'LDAP Server IP or DNS',''),
('LDAP: Port', '389', 'LDAP Server Port',''),
('LDAP: Root DN', '', 'e.g: dc=mycompany,dc=net',''),
('LDAP: Manager DN', '', 'e.g: cn=admin,dc=mycompany,dc=net',''),
('LDAP: Manager Password', '', 'Password of the manager user',''),
('LDAP: Version 3', '1', 'Are you using LDAP v3','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
('LDAP: User Filter', '', 'e.g: uid={}, we will replace {} with actual username provided by the user at the time of login','');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Recruitment: Show Quick Apply', '1', 'Show quick apply button when candidates are applying for jobs. Quick apply allow candidates to apply with minimum amount of information','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
('Recruitment: Show Apply', '1', 'Show apply button when candidates are applying for jobs','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Notifications: Send Document Expiry Emails', '1', '','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
('Notifications: Copy Document Expiry Emails to Manager', '1', '','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
('Expense: Pre-Approve Expenses', '0', '','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
('Travel: Pre-Approve Travel Request', '0', '','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Attendance: Use Department Time Zone', '0', '','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Travel: Allow Indirect Admins to Approve', '0', 'Allow indirect admins to approve travel requests','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Attendance: Overtime Calculation Class', 'BasicOvertimeCalculator', 'Set the method used to calculate overtime','["value", {"label":"Value","type":"select","source":[["BasicOvertimeCalculator","BasicOvertimeCalculator"],["CaliforniaOvertimeCalculator","CaliforniaOvertimeCalculator"]]}]');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Attendance: Overtime Calculation Period', 'Daily', 'Set the period for overtime calculation. (Affects attendance sheets)','["value", {"label":"Value","type":"select","source":[["Daily","Daily"],["Weekly","Weekly"]]}]');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Attendance: Overtime Start Hour', '8', 'Overtime calculation will start after an employee work this number of hours per day, 0 to indicate no overtime', ''),
('Attendance: Double time Start Hour', '12', 'Double time calculation will start after an employee work this number of hours per day, 0 to indicate no double time', '');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Attendance: Work Week Start Day', '0', 'Set the starting day of the work week','["value", {"label":"Value","type":"select","source":[["0","Sunday"],["1","Monday"],["2","Tuesday"],["3","Wednesday"],["4","Thursday"],["5","Friday"],["6","Saturday"]]}]');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('System: Allowed Countries', '', 'Only these countries will be allowed in select boxes','["value", {"label":"Value","type":"select2multi","remote-source":["Country","id","name"]}]');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('System: Allowed Currencies', '', 'Only these currencies will be allowed in select boxes','["value", {"label":"Value","type":"select2multi","remote-source":["CurrencyType","id","code+name"]}]');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('System: Allowed Nationality', '', 'Only these nationalities will be allowed in select boxes','["value", {"label":"Value","type":"select2multi","remote-source":["Nationality","id","name"]}]');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('System: Language', 'en', 'Current Language','["value", {"label":"Value","type":"select2","allow-null":false,"remote-source":["SupportedLanguage","name","description"]}]');
INSERT INTO `Certifications` (`id`, `name`, `description`) VALUES INSERT INTO `Certifications` (`id`, `name`, `description`) VALUES
@@ -746,10 +956,11 @@ INSERT INTO `CompanyStructures` (`id`, `title`, `description`, `address`, `type`
(3, 'Marketing Department', 'Marketing Department', 'PO Box 001002\nSample Road, Sample Town', 'Department', 'US', 2); (3, 'Marketing Department', 'Marketing Department', 'PO Box 001002\nSample Road, Sample Town', 'Department', 'US', 2);
INSERT INTO `Documents` (`id`, `name`, `details`) VALUES INSERT INTO `Documents` (`id`, `name`, `details`, `expire_notification`, `expire_notification_month`, `expire_notification_week`, `expire_notification_day`,`sign`,`created`, `updated`) VALUES
(1, 'ID Copy', 'Your ID copy'), (1, 'ID Copy', 'Your ID copy','Yes','Yes','Yes','Yes','No',NOW(), NOW()),
(2, 'Degree Ceritficate', 'Degree Ceritficate'), (2, 'Degree Certificate', 'Degree Certificate','Yes','Yes','Yes','Yes','Yes',NOW(), NOW()),
(3, 'Driving License', 'Driving License'); (3, 'Driving License', 'Driving License','Yes','Yes','Yes','Yes','Yes',NOW(), NOW());
INSERT INTO `Educations` (`id`, `name`, `description`) VALUES INSERT INTO `Educations` (`id`, `name`, `description`) VALUES
@@ -780,12 +991,213 @@ INSERT INTO `JobTitles` (`id`, `code`, `name`, `description`, `specification`) V
INSERT INTO `Languages` (`id`, `name`, `description`) VALUES INSERT INTO `Languages` (`id`, `name`, `description`) VALUES
(1, 'English', 'English'), (1, 'en', 'English'),
(2, 'French', 'French'), (2, 'fr', 'French'),
(3, 'German', 'German'), (3, 'de', 'German'),
(4, 'Chinese', 'Chinese'); (4, 'zh', 'Chinese'),
(5, 'aa', 'Afar'),
(6, 'ab', 'Abkhaz'),
(7, 'ae', 'Avestan'),
(8, 'af', 'Afrikaans'),
(9, 'ak', 'Akan'),
(10, 'am', 'Amharic'),
(11, 'an', 'Aragonese'),
(12, 'ar', 'Arabic'),
(13, 'as', 'Assamese'),
(14, 'av', 'Avaric'),
(15, 'ay', 'Aymara'),
(16, 'az', 'Azerbaijani'),
(17, 'ba', 'Bashkir'),
(18, 'be', 'Belarusian'),
(19, 'bg', 'Bulgarian'),
(20, 'bh', 'Bihari'),
(21, 'bi', 'Bislama'),
(22, 'bm', 'Bambara'),
(23, 'bn', 'Bengali'),
(24, 'bo', 'Tibetan Standard, Tibetan, Central'),
(25, 'br', 'Breton'),
(26, 'bs', 'Bosnian'),
(27, 'ca', 'Catalan; Valencian'),
(28, 'ce', 'Chechen'),
(29, 'ch', 'Chamorro'),
(30, 'co', 'Corsican'),
(31, 'cr', 'Cree'),
(32, 'cs', 'Czech'),
(33, 'cu', 'Old Church Slavonic, Church Slavic, Church Slavonic, Old Bulgarian, Old Slavonic'),
(34, 'cv', 'Chuvash'),
(35, 'cy', 'Welsh'),
(36, 'da', 'Danish'),
(37, 'dv', 'Divehi; Dhivehi; Maldivian;'),
(38, 'dz', 'Dzongkha'),
(39, 'ee', 'Ewe'),
(40, 'el', 'Greek, Modern'),
(41, 'eo', 'Esperanto'),
(42, 'es', 'Spanish; Castilian'),
(43, 'et', 'Estonian'),
(44, 'eu', 'Basque'),
(45, 'fa', 'Persian'),
(46, 'ff', 'Fula; Fulah; Pulaar; Pular'),
(47, 'fi', 'Finnish'),
(48, 'fj', 'Fijian'),
(49, 'fo', 'Faroese'),
(50, 'fy', 'Western Frisian'),
(51, 'ga', 'Irish'),
(52, 'gd', 'Scottish Gaelic; Gaelic'),
(53, 'gl', 'Galician'),
(54, 'gn', 'Guaraní'),
(55, 'gu', 'Gujarati'),
(56, 'gv', 'Manx'),
(57, 'ha', 'Hausa'),
(58, 'he', 'Hebrew (modern)'),
(59, 'hi', 'Hindi'),
(60, 'ho', 'Hiri Motu'),
(61, 'hr', 'Croatian'),
(62, 'ht', 'Haitian; Haitian Creole'),
(63, 'hu', 'Hungarian'),
(64, 'hy', 'Armenian'),
(65, 'hz', 'Herero'),
(66, 'ia', 'Interlingua'),
(67, 'id', 'Indonesian'),
(68, 'ie', 'Interlingue'),
(69, 'ig', 'Igbo'),
(70, 'ii', 'Nuosu'),
(71, 'ik', 'Inupiaq'),
(72, 'io', 'Ido'),
(73, 'is', 'Icelandic'),
(74, 'it', 'Italian'),
(75, 'iu', 'Inuktitut'),
(76, 'ja', 'Japanese (ja)'),
(77, 'jv', 'Javanese (jv)'),
(78, 'ka', 'Georgian'),
(79, 'kg', 'Kongo'),
(80, 'ki', 'Kikuyu, Gikuyu'),
(81, 'kj', 'Kwanyama, Kuanyama'),
(82, 'kk', 'Kazakh'),
(83, 'kl', 'Kalaallisut, Greenlandic'),
(84, 'km', 'Khmer'),
(85, 'kn', 'Kannada'),
(86, 'ko', 'Korean'),
(87, 'kr', 'Kanuri'),
(88, 'ks', 'Kashmiri'),
(89, 'ku', 'Kurdish'),
(90, 'kv', 'Komi'),
(91, 'kw', 'Cornish'),
(92, 'ky', 'Kirghiz, Kyrgyz'),
(93, 'la', 'Latin'),
(94, 'lb', 'Luxembourgish, Letzeburgesch'),
(95, 'lg', 'Luganda'),
(96, 'li', 'Limburgish, Limburgan, Limburger'),
(97, 'ln', 'Lingala'),
(98, 'lo', 'Lao'),
(99, 'lt', 'Lithuanian'),
(100, 'lu', 'Luba-Katanga'),
(101, 'lv', 'Latvian'),
(102, 'mg', 'Malagasy'),
(103, 'mh', 'Marshallese'),
(104, 'mi', 'Maori'),
(105, 'mk', 'Macedonian'),
(106, 'ml', 'Malayalam'),
(107, 'mn', 'Mongolian'),
(108, 'mr', 'Marathi (Mara?hi)'),
(109, 'ms', 'Malay'),
(110, 'mt', 'Maltese'),
(111, 'my', 'Burmese'),
(112, 'na', 'Nauru'),
(113, 'nb', 'Norwegian Bokmål'),
(114, 'nd', 'North Ndebele'),
(115, 'ne', 'Nepali'),
(116, 'ng', 'Ndonga'),
(117, 'nl', 'Dutch'),
(118, 'nn', 'Norwegian Nynorsk'),
(119, 'no', 'Norwegian'),
(120, 'nr', 'South Ndebele'),
(121, 'nv', 'Navajo, Navaho'),
(122, 'ny', 'Chichewa; Chewa; Nyanja'),
(123, 'oc', 'Occitan'),
(124, 'oj', 'Ojibwe, Ojibwa'),
(125, 'om', 'Oromo'),
(126, 'or', 'Oriya'),
(127, 'os', 'Ossetian, Ossetic'),
(128, 'pa', 'Panjabi, Punjabi'),
(129, 'pi', 'Pali'),
(130, 'pl', 'Polish'),
(131, 'ps', 'Pashto, Pushto'),
(132, 'pt', 'Portuguese'),
(133, 'qu', 'Quechua'),
(134, 'rm', 'Romansh'),
(135, 'rn', 'Kirundi'),
(136, 'ro', 'Romanian, Moldavian, Moldovan'),
(137, 'ru', 'Russian'),
(138, 'rw', 'Kinyarwanda'),
(139, 'sa', 'Sanskrit (Sa?sk?ta)'),
(140, 'sc', 'Sardinian'),
(141, 'sd', 'Sindhi'),
(142, 'se', 'Northern Sami'),
(143, 'sg', 'Sango'),
(144, 'si', 'Sinhala, Sinhalese'),
(145, 'sk', 'Slovak'),
(146, 'sl', 'Slovene'),
(147, 'sm', 'Samoan'),
(148, 'sn', 'Shona'),
(149, 'so', 'Somali'),
(150, 'sq', 'Albanian'),
(151, 'sr', 'Serbian'),
(152, 'ss', 'Swati'),
(153, 'st', 'Southern Sotho'),
(154, 'su', 'Sundanese'),
(155, 'sv', 'Swedish'),
(156, 'sw', 'Swahili'),
(157, 'ta', 'Tamil'),
(158, 'te', 'Telugu'),
(159, 'tg', 'Tajik'),
(160, 'th', 'Thai'),
(161, 'ti', 'Tigrinya'),
(162, 'tk', 'Turkmen'),
(163, 'tl', 'Tagalog'),
(164, 'tn', 'Tswana'),
(165, 'to', 'Tonga (Tonga Islands)'),
(166, 'tr', 'Turkish'),
(167, 'ts', 'Tsonga'),
(168, 'tt', 'Tatar'),
(169, 'tw', 'Twi'),
(170, 'ty', 'Tahitian'),
(171, 'ug', 'Uighur, Uyghur'),
(172, 'uk', 'Ukrainian'),
(173, 'ur', 'Urdu'),
(174, 'uz', 'Uzbek'),
(175, 've', 'Venda'),
(176, 'vi', 'Vietnamese'),
(177, 'vo', 'Volapük'),
(178, 'wa', 'Walloon'),
(179, 'wo', 'Wolof'),
(180, 'xh', 'Xhosa'),
(181, 'yi', 'Yiddish'),
(182, 'yo', 'Yoruba'),
(183, 'za', 'Zhuang, Chuang'),
(184, 'zu', 'Zulu');
INSERT INTO `SupportedLanguages` (`name`, `description`) VALUES
('en', 'English'),
('de', 'German'),
('fr', 'French'),
('pl', 'Polish'),
('it', 'Italian'),
('si', 'Sinhala'),
('zh', 'Chinese'),
('ja', 'Japanese'),
('hi', 'Hindi'),
('es', 'Spanish');
INSERT INTO `LeavePeriods` (`id`, `name`, `date_start`, `date_end`, `status`) VALUES
(3, 'Year 2015', '2015-01-01', '2015-12-31', 'Active'),
(4, 'Year 2016', '2016-01-01', '2016-12-31', 'Active'),
(5, 'Year 2017', '2017-01-01', '2017-12-31', 'Active');
INSERT INTO `LeaveTypes` (`id`, `name`, `supervisor_leave_assign`, `employee_can_apply`, `apply_beyond_current`, `leave_accrue`, `carried_forward`, `default_per_year`) VALUES
(1, 'Annual leave', 'No', 'Yes', 'No', 'No', 'No', 14),
(2, 'Casual leave', 'Yes', 'Yes', 'No', 'No', 'No', 7),
(3, 'Medical leave', 'Yes', 'Yes', 'Yes', 'No', 'No', 7);
INSERT INTO `PayGrades` (`id`, `name`, `currency`, `min_salary`, `max_salary`) VALUES INSERT INTO `PayGrades` (`id`, `name`, `currency`, `min_salary`, `max_salary`) VALUES
(1, 'Manager', 'SGD', '5000.00', '15000.00'), (1, 'Manager', 'SGD', '5000.00', '15000.00'),
@@ -854,6 +1266,7 @@ INSERT INTO `FieldNameMappings` (`type`, `name`, `textOrig`, `textMapped`, `disp
('Employee', 'termination_date', 'Termination Date', 'Termination Date', 'Form'), ('Employee', 'termination_date', 'Termination Date', 'Termination Date', 'Form'),
('Employee', 'supervisor', 'Supervisor', 'Supervisor', 'Table and Form'), ('Employee', 'supervisor', 'Supervisor', 'Supervisor', 'Table and Form'),
('Employee', 'department', 'Department', 'Department', 'Table and Form'), ('Employee', 'department', 'Department', 'Department', 'Table and Form'),
('Employee', 'indirect_supervisors', 'Indirect Supervisors', 'Indirect Supervisors', 'Form'),
('Employee', 'notes', 'Notes', 'Notes', 'Form'); ('Employee', 'notes', 'Notes', 'Notes', 'Form');
@@ -869,6 +1282,28 @@ INSERT INTO `CustomFields` (`type`, `name`, `data`,`display`) VALUES
('Employee', 'custom9', '', 'Hidden'), ('Employee', 'custom9', '', 'Hidden'),
('Employee', 'custom10', '', 'Hidden'); ('Employee', 'custom10', '', 'Hidden');
INSERT INTO `ImmigrationStatus` VALUES
(1,'Citizen'),
(2,'Permanent Resident'),
(3,'Work Permit Holder'),
(4,'Dependant Pass Holder');
INSERT INTO `Ethnicity` VALUES
(1,'White American'),
(2,'Black or African American'),
(3,'Native American'),
(4,'Alaska Native'),
(5,'Asian American'),
(6,'Native Hawaiian'),
(7,'Pacific Islander');
INSERT INTO `PayFrequency` VALUES
(1,'Bi Weekly'),
(2,'Weekly'),
(3,'Semi Monthly'),
(4,'Monthly'),
(5,'Yearly');
INSERT INTO `Employees` (`id`, `employee_id`, `first_name`, `middle_name`, `last_name`, `nationality`, `birthday`, `gender`, `marital_status`, `ssn_num`, `nic_num`, `other_id`, `driving_license`, `driving_license_exp_date`, `employment_status`, `job_title`, `pay_grade`, `work_station_id`, `address1`, `address2`, `city`, `country`, `province`, `postal_code`, `home_phone`, `mobile_phone`, `work_phone`, `work_email`, `private_email`, `joined_date`, `confirmation_date`, `supervisor`, `department`, `custom1`, `custom2`, `custom3`, `custom4`, `custom5`, `custom6`, `custom7`, `custom8`, `custom9`, `custom10`) VALUES INSERT INTO `Employees` (`id`, `employee_id`, `first_name`, `middle_name`, `last_name`, `nationality`, `birthday`, `gender`, `marital_status`, `ssn_num`, `nic_num`, `other_id`, `driving_license`, `driving_license_exp_date`, `employment_status`, `job_title`, `pay_grade`, `work_station_id`, `address1`, `address2`, `city`, `country`, `province`, `postal_code`, `home_phone`, `mobile_phone`, `work_phone`, `work_email`, `private_email`, `joined_date`, `confirmation_date`, `supervisor`, `department`, `custom1`, `custom2`, `custom3`, `custom4`, `custom5`, `custom6`, `custom7`, `custom8`, `custom9`, `custom10`) VALUES
(1, 'EMP001', 'IceHrm', 'Sample', 'Employee', 35, '1984-03-17 18:30:00', 'Male', 'Married', '', '294-38-3535', '294-38-3535', '', NULL, 3, 11, 2, '', '2772 Flynn Street', 'Willoughby', 'Willoughby', 'US', 41, '44094', '440-953-4578', '440-953-4578', '440-953-4578', 'icehrm+admin@web-stalk.com', 'icehrm+admin@web-stalk.com', '2005-08-03 18:00:00', '0000-00-00 00:00:00', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); (1, 'EMP001', 'IceHrm', 'Sample', 'Employee', 35, '1984-03-17 18:30:00', 'Male', 'Married', '', '294-38-3535', '294-38-3535', '', NULL, 3, 11, 2, '', '2772 Flynn Street', 'Willoughby', 'Willoughby', 'US', 41, '44094', '440-953-4578', '440-953-4578', '440-953-4578', 'icehrm+admin@web-stalk.com', 'icehrm+admin@web-stalk.com', '2005-08-03 18:00:00', '0000-00-00 00:00:00', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
@@ -879,14 +1314,268 @@ INSERT INTO `UserRoles` VALUES
INSERT INTO `Users` VALUES INSERT INTO `Users` VALUES
(1,'admin','icehrm+admin@web-stalk.com','21232f297a57a5a743894a0e4a801fc3',1,NULL,'Admin','',NULL,NULL,NULL); (1,'admin','icehrm+admin@web-stalk.com','21232f297a57a5a743894a0e4a801fc3',1,NULL,'Admin','',NULL,NULL,NULL,NULL,NULL);
INSERT INTO `SalaryComponentType` (`id`,`code`, `name`) VALUES INSERT INTO `SalaryComponentType` (`id`,`code`, `name`) VALUES
(1,'B001', 'Basic'), (1,'B001', 'Basic'),
(2,'B002', 'Allowance'); (2,'B002', 'Allowance'),
(3,'B003', 'Hourly');
INSERT INTO `SalaryComponent` VALUES INSERT INTO `SalaryComponent` (`id`,`name`, `componentType`) VALUES
(1,'Basic Salary', 1,''),(2,'Fixed Allowance', 1,''),(3,'Car Allowance', 2,''),(4,'Telephone Allowance', 2,''); (1,'Basic Salary', 1),
(2,'Fixed Allowance', 1),
(3,'Car Allowance', 2),
(4,'Telephone Allowance', 2),
(5,'Regular Hourly Pay', 3),
(6,'Overtime Hourly Pay', 3),
(7,'Double Time Hourly Pay', 3);
INSERT INTO `Courses` (`id`,`code`, `name`, `description`, `coordinator`, `trainer`, `trainer_info`, `paymentType`, `currency`, `cost`, `status`, `created`, `updated`) VALUES
(1,'C0001', 'Info Marketing', 'Learn how to Create and Outsource Info Marketing Products', 1, 'Tim Jhon', 'Tim Jhon has a background in business management and has been working with small business to establish their online presence','Company Sponsored','USD','55','Active',now(), now()),
(2,'C0002', 'People Management', 'Learn how to Manage People', 1, 'Tim Jhon', 'Tim Jhon has a background in business management and has been working with small business to establish their online presence','Company Sponsored','USD','59','Active',now(), now());
INSERT INTO `EmployementType` (`name`) VALUES
('Full-time'),
('Part-time'),
('Contract'),
('Temporary'),
('Other');
INSERT INTO `Benifits` (`name`) VALUES
('Retirement plan'),
('Health plan'),
('Life insurance'),
('Paid vacations');
INSERT INTO `ExperienceLevel` (`name`) VALUES
('Not Applicable'),
('Internship'),
('Entry level'),
('Associate'),
('Mid-Senior level'),
('Director'),
('Executive');
INSERT INTO `JobFunction` (`name`) VALUES
('Accounting/Auditing'),
('Administrative'),
('Advertising'),
('Business Analyst'),
('Financial Analyst'),
('Data Analyst'),
('Art/Creative'),
('Business Development'),
('Consulting'),
('Customer Service'),
('Distribution'),
('Design'),
('Education'),
('Engineering'),
('Finance'),
('General Business'),
('Health Care Provider'),
('Human Resources'),
('Information Technology'),
('Legal'),
('Management'),
('Manufacturing'),
('Marketing'),
('Other'),
('Public Relations'),
('Purchasing'),
('Product Management'),
('Project Management'),
('Production'),
('Quality Assurance'),
('Research'),
('Sales'),
('Science'),
('Strategy/Planning'),
('Supply Chain'),
('Training'),
('Writing/Editing');
INSERT INTO `EducationLevel` (`name`) VALUES
('Unspecified'),
('High School or equivalent'),
('Certification'),
('Vocational'),
('Associate Degree'),
('Bachelor\'s Degree'),
('Master\'s Degree'),
('Doctorate'),
('Professional'),
('Some College Coursework Completed'),
('Vocational - HS Diploma'),
('Vocational - Degree'),
('Some High School Coursework');
INSERT INTO `Crons` (`name`,`class`, `lastrun`, `frequency`, `time`, `type`, `status`) VALUES
('Email Sender Task', 'EmailSenderTask', NULL, 1, 1, 'Minutely', 'Enabled'),
('Document Expire Alert', 'DocumentExpiryNotificationTask', NULL, 1, (FLOOR( 1 + RAND( ) *58 )), 'Hourly', 'Enabled');
INSERT INTO `ExpensesPaymentMethods` (`name`) VALUES
('Cash'),
('Check'),
('Credit Card'),
('Debit Card');
INSERT INTO `ExpensesCategories` (`name`) VALUES
('Auto - Gas'),
('Auto - Insurance'),
('Auto - Maintenance'),
('Auto - Payment'),
('Transportation'),
('Bank Fees'),
('Dining Out'),
('Entertainment'),
('Hotel / Motel'),
('Insurance'),
('Interest Charges'),
('Loan Payment'),
('Medical'),
('Mileage'),
('Rent'),
('Rental Car'),
('Utility');
INSERT INTO `PayrollColumns` (`id`,`name`,`calculation_hook`,`salary_components`,`deductions`,`add_columns`,`sub_columns`,`editable`,`enabled`,`default_value`,`calculation_columns`,`calculation_function`) VALUES
(1,'Total Hours','AttendanceUtil_getTimeWorkedHours','','','','','No','Yes','0.00',NULL,NULL),
(2,'Regular Hours','AttendanceUtil_getRegularWorkedHours','','','','','No','Yes','0.00',NULL,NULL),
(3,'Overtime Hours','AttendanceUtil_getOverTimeWorkedHours','','','','','No','Yes','0.00',NULL,NULL),
(4,'Leave Hours','LeaveUtil_getLeaveHours','','','','','No','Yes','0.00',NULL,NULL);
INSERT INTO `PayrollColumnTemplates` (`name`,`columns`) VALUES
('All Columns','[\"1\",\"2\",\"3\",\"4\"]'),
('All Time Management Columns','[\"1\",\"2\",\"3\"]');
INSERT INTO `DataImport` (`name`, `dataType`, `details`, `columns`, `updated`, `created`) VALUES
('Employee Data Import', 'EmployeeDataImporter', '', '[{"name":"employee_id","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"Yes","id":"columns_7"},{"name":"first_name","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_3"},{"name":"middle_name","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_5"},{"name":"last_name","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_6"},{"name":"address1","title":"Address1","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_8"},{"name":"address2","title":"Address2","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_9"},{"name":"home_phone","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_14"},{"name":"mobile_phone","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_15"},{"name":"work_email","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_16"},{"name":"gender","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_17"},{"name":"marital_status","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_18"},{"name":"birthday","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_20"},{"name":"nationality","title":"Nationality","type":"Reference","dependOn":"Nationality","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_22"},{"name":"ethnicity","title":"Ethnicity","type":"Normal","dependOn":"Ethnicity","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_23"},{"name":"EmergencyContact/name","title":"","type":"Attached","dependOn":"EmergencyContact","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_24"},{"name":"EmergencyContact/relationship","title":"","type":"Attached","dependOn":"EmergencyContact","dependOnField":"relationship","isKeyField":"No","idField":"No","id":"columns_25"},{"name":"EmergencyContact/home_phone","title":"","type":"Attached","dependOn":"EmergencyContact","dependOnField":"home_phone","isKeyField":"No","idField":"No","id":"columns_26"},{"name":"ssn_num","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_31"},{"name":"job_title","title":"","type":"Reference","dependOn":"JobTitle","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_32"},{"name":"employment_status","title":"","type":"Reference","dependOn":"EmploymentStatus","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_33"},{"name":"joined_date","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_36"},{"name":"department","title":"","type":"Reference","dependOn":"CompanyStructure","dependOnField":"title","isKeyField":"Yes","idField":"No","id":"columns_38"}]', '2016-06-02 18:56:32', '2016-06-02 18:56:32'),
('Attendance Data Import', 'AttendanceDataImporter', '', '[{"name":"employee","title":"","type":"Reference","dependOn":"Employee","dependOnField":"employee_id","isKeyField":"Yes","idField":"No","id":"columns_1"},{"name":"in_time","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_2"},{"name":"out_time","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_3"},{"name":"note","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_4"}]', '2016-08-14 02:51:56', '2016-08-14 02:51:56');
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Time Entry Report', 'View your time entries by date range and project',
'[\r\n[ "client", {"label":"Select Client","type":"select","allow-null":true,"null-label":"Not Selected","remote-source":["Client","id","name"]}],\r\n[ "project", {"label":"Or Project","type":"select","allow-null":true,"null-label":"All Projects","remote-source":["Project","id","name","getAllProjects"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]',
'EmployeeTimesheetReport', '["client","project","date_start","date_end","status"]', 'Class','Time Management','CSV');
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Attendance Report', 'View your attendance entries by date range', '[\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeAttendanceReport', '["date_start","date_end"]', 'Class','Time Management','CSV');
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Time Tracking Report', 'View your working hours and attendance details for each day for a given period ', '[\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeTimeTrackReport', '["date_start","date_end"]', 'Class','Time Management','CSV');
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Travel Request Report', 'View travel requests for a specified period',
'[\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}],\r\n[ "status", {"label":"Status","type":"select","source":[["NULL","All Statuses"],["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"],["Cancellation Requested","Cancellation Requested"],["Cancelled","Cancelled"]]}]\r\n]',
'TravelRequestReport',
'["date_start","date_end","status"]', 'Class', 'Travel and Expense Management','CSV');
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Time Sheet Report', 'This report list all employee time sheets by employee and date range',
'[\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}],\r\n[ "status", {"label":"Status","allow-null":true,"null-label":"All Status","type":"select","source":[["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"]]}]\r\n]',
'EmployeeTimeSheetData',
'["date_start","date_end","status"]', 'Class','Time Management','CSV');
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Client Project Time Report', 'View your time entries for projects under a given client',
'[\r\n[ "client", {"label":"Select Client","type":"select","allow-null":false,"remote-source":["Client","id","name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]',
'ClientProjectTimeReport', '["client","date_start","date_end","status"]', 'Class','Time Management','PDF');
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Download Payslips', 'Download your payslips',
'[\r\n[ "payroll", {"label":"Select Payroll","type":"select","allow-null":false,"remote-source":["Payroll","id","name","getEmployeePayrolls"]}]]',
'PayslipReport', '["payroll"]', 'Class','Finance','PDF');
INSERT INTO `DeductionGroup` VALUES
(1,'Sri Lanka Payroll Calculation','');
INSERT INTO `PayslipTemplates` (`id`, `name`, `data`, `status`, `created`, `updated`) VALUES
(1, 'Sri Lanka - Default Payslip', '[{"type":"Company Logo","payrollColumn":"NULL","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"#000000","status":"Show","id":"data_1"},{"type":"Company Name","payrollColumn":"NULL","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"","status":"Show","id":"data_2"},{"type":"Separators","payrollColumn":"NULL","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"","status":"Show","id":"data_8"},{"type":"Payroll Column","payrollColumn":"5","label":"Basic Salary","text":"","status":"Show","id":"data_3"},{"type":"Payroll Column","payrollColumn":"6","label":"Fixed Allowance","text":"","status":"Show","id":"data_4"},{"type":"Payroll Column","payrollColumn":"7","label":"Gross Pay","text":"","status":"Show","id":"data_11"},{"type":"Separators","payrollColumn":"NULL","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"","status":"Show","id":"data_9"},{"type":"Text","payrollColumn":"NULL","label":"","text":"Deductions","status":"Show","id":"data_13"},{"type":"Payroll Column","payrollColumn":"8","label":"EPF Employee Contribution","text":"","status":"Show","id":"data_6"},{"type":"Payroll Column","payrollColumn":"13","label":"PAYE Tax","text":"","status":"Show","id":"data_14"},{"type":"Payroll Column","payrollColumn":"14","label":"Stamp Duty","text":"","status":"Show","id":"data_15"},{"type":"Payroll Column","payrollColumn":"15","label":"Total Deductions","text":"","status":"Show","id":"data_16"},{"type":"Separators","payrollColumn":"NULL","label":"","text":"","status":"Show","id":"data_17"},{"type":"Text","payrollColumn":"NULL","label":"","text":"Employer Contributions","status":"Show","id":"data_18"},{"type":"Payroll Column","payrollColumn":"9","label":"EPF Employer Contribution","text":"","status":"Show","id":"data_19"},{"type":"Payroll Column","payrollColumn":"7","label":"ETF Employer Contribution","text":"","status":"Show","id":"data_20"},{"type":"Separators","payrollColumn":"7","label":"","text":"","status":"Show","id":"data_21"},{"type":"Text","payrollColumn":"7","label":"","text":"Totals","status":"Show","id":"data_22"},{"type":"Payroll Column","payrollColumn":"11","label":"Total EPF 20%","text":"","status":"Show","id":"data_23"},{"type":"Payroll Column","payrollColumn":"12","label":"Total for PAYE","text":"","status":"Show","id":"data_24"},{"type":"Payroll Column","payrollColumn":"16","label":"Net Salary","text":"","status":"Show","id":"data_25"}]', NULL, '2016-06-29 22:07:12', '2016-06-29 22:07:12');
INSERT INTO `Payroll` VALUES
(1,'Sri Lanka Payroll Sample',4,1,NULL,'[\"5\",\"8\",\"9\",\"10\",\"6\",\"7\",\"11\",\"12\",\"13\",\"14\",\"15\",\"16\"]','2016-03-01','2016-03-31','Draft', 1);
INSERT INTO `PayrollColumns` VALUES
(5,'LK - Basic Salary',NULL,'[\"1\"]','[]','[]','[]',5,'No','Yes','0.00',NULL,NULL),
(6,'LK - Fixed Allowance',NULL,'[\"2\"]','[]','[]','[]',6,'No','Yes','0.00',NULL,NULL),
(7,'LK - Gross Pay',NULL,'[]','[]','[\"5\",\"6\"]','[]',7,'No','Yes','0.00',NULL,NULL),
(8,'LK - EPF Employee Contribution',NULL,'[]','[\"1\"]','[]','[]',8,'No','Yes','0.00',NULL,NULL),
(9,'LK - EPF Employer Contribution',NULL,'[]','[\"2\"]','[]','[]',9,'No','Yes','0.00',NULL,NULL),
(10,'LK - ETF Employer Contribution',NULL,'[]','[\"3\"]','[]','[]',10,'No','Yes','0.00',NULL,NULL),
(11,'LK - Total EPF 20%',NULL,'[]','[]','[\"8\",\"9\"]','[]',11,'No','Yes','0.00',NULL,NULL),
(12,'LK - Total for PAYE',NULL,'[]','[]','[\"7\"]','[]',12,'No','Yes','0.00',NULL,NULL),
(13,'LK - PAYE Tax',NULL,'[]','[\"4\"]','[]','[]',13,'No','Yes','0.00',NULL,NULL),
(14,'LK - Stamp Duty',NULL,'[]','[\"5\"]','[]','[]',14,'No','Yes','0.00',NULL,NULL),
(15,'LK - Total Deductions',NULL,'[]','[]','[\"8\",\"13\",\"14\"]','[]',15,'No','Yes','0.00',NULL,NULL),
(16,'LK - Salary to Bank',NULL,'[]','[]','[\"7\"]','[\"15\"]',16,'No','Yes','0.00',NULL,NULL);
INSERT INTO `Deductions` VALUES
(1,'EPF Employee Contribution','[]','[]',7,'[{\"lowerCondition\":\"No Lower Limit\",\"lowerLimit\":\"0\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":\"0\",\"amount\":\"X*0.08\",\"id\":\"rangeAmounts_1\"}]',1),
(2,'EPF Employer Contribution','[]','[]',7,'[{\"lowerCondition\":\"No Lower Limit\",\"lowerLimit\":\"0\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":\"0\",\"amount\":\"X*0.12\",\"id\":\"rangeAmounts_1\"}]',1),
(3,'ETF Employer Contribution','[]','[]',7,'[{\"lowerCondition\":\"No Lower Limit\",\"lowerLimit\":\"0\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":\"0\",\"amount\":\"X*0.03\",\"id\":\"rangeAmounts_1\"}]',1),
(4,'PAYE Tax','[]','[]',12,'[{\"lowerCondition\":\"No Lower Limit\",\"lowerLimit\":\"0\",\"upperCondition\":\"lte\",\"upperLimit\":\"62500\",\"amount\":\"0\",\"id\":\"rangeAmounts_1\"},{\"lowerCondition\":\"gt\",\"lowerLimit\":\"62500\",\"upperCondition\":\"lte\",\"upperLimit\":\"104167\",\"amount\":\"X*0.04 - 2500\",\"id\":\"rangeAmounts_2\"},{\"lowerCondition\":\"gt\",\"lowerLimit\":\"104167\",\"upperCondition\":\"lte\",\"upperLimit\":\"145833\",\"amount\":\"X*0.08 - 6667\",\"id\":\"rangeAmounts_3\"},{\"lowerCondition\":\"gt\",\"lowerLimit\":\"145833\",\"upperCondition\":\"lte\",\"upperLimit\":\"187500\",\"amount\":\"X*0.12-12500\",\"id\":\"rangeAmounts_4\"},{\"lowerCondition\":\"gt\",\"lowerLimit\":\"187500\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":\"0\",\"amount\":\"X*0.16 - 20000\",\"id\":\"rangeAmounts_5\"}]',1),
(5,'Stamp Duty','[]','[]',12,'[{\"lowerCondition\":\"No Lower Limit\",\"lowerLimit\":\"0\",\"upperCondition\":\"lte\",\"upperLimit\":\"25000\",\"amount\":\"0\",\"id\":\"rangeAmounts_1\"},{\"lowerCondition\":\"gt\",\"lowerLimit\":\"25000\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":\"0\",\"amount\":\"25\",\"id\":\"rangeAmounts_2\"}]',1);
INSERT INTO `DeductionGroup` VALUES
(2,'Ghana Payroll Calculation','');
INSERT INTO `PayslipTemplates` VALUES
(2,'Ghana Default','[{\"type\":\"Company Name\",\"payrollColumn\":\"NULL\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_1\"},{\"type\":\"Separators\",\"payrollColumn\":\"NULL\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_3\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"105\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_4\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"106\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_5\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"107\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_6\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"112\",\"label\":\"Total\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_7\"},{\"type\":\"Separators\",\"payrollColumn\":\"NULL\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_8\"},{\"type\":\"Text\",\"payrollColumn\":\"NULL\",\"label\":\"\",\"text\":\"Deductions \",\"status\":\"Show\",\"id\":\"data_9\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"109\",\"label\":\"SSNIT (5.5%)\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_10\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"113\",\"label\":\"Tax (1st Level 5%)\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_11\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"114\",\"label\":\"Tax (2nd Level 10%)\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_12\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"115\",\"label\":\"Tax (3rd Level 17.5%)\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_13\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"120\",\"label\":\"Tax (4th Level 25%)\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_14\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"121\",\"label\":\"Overtime Allow. Tax (5%)\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_15\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"122\",\"label\":\"Total (PAYE Tax)\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_16\"},{\"type\":\"Separators\",\"payrollColumn\":\"NULL\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_17\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"123\",\"label\":\"Sub Total\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_18\"},{\"type\":\"Separators\",\"payrollColumn\":\"NULL\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_19\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"125\",\"label\":\"Netto Monthly Salary\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_20\"}]',NULL,'2016-08-30 21:53:13','2016-08-30 21:53:13');
INSERT INTO `Payroll` VALUES
(6,'Ghana Payroll Sample',4,1,NULL,'[\"123\",\"125\",\"106\",\"124\",\"113\",\"114\",\"115\",\"121\",\"107\",\"120\",\"109\",\"105\",\"112\",\"108\",\"122\"]','2016-08-01','2016-08-31','Draft',2);
INSERT INTO `PayrollColumns` VALUES
(105,'GH - Salary (Basic)',NULL,'[\"1\"]','[]','[]','[]',1,'No','Yes','0.00','',''),
(106,'GH - Housing Allowance',NULL,'[]','[\"101\"]','[]','[]',2,'No','Yes','0.00','',''),
(107,'GH - Overtime Allowance',NULL,'[]','[\"102\"]','[]','[]',3,'No','Yes','0.00','',''),
(108,'GH - Total',NULL,'[]','[]','[\"106\",\"107\",\"105\"]','[]',4,'No','Yes','0.00','',''),
(109,'GH - SSNIT',NULL,'[]','[\"103\"]','[]','[]',5,'No','Yes','0.00','',''),
(112,'GH - Taxable Income',NULL,'[]','[]','[\"106\",\"105\"]','[\"109\"]',7,'No','Yes','0.00','',''),
(113,'GH - Next 108 GHC',NULL,'[]','[\"106\"]','[]','[]',9,'No','Yes','0.00','',''),
(114,'GH - Next 151 GHC',NULL,'[]','[\"107\"]','[]','[]',10,'No','Yes','0.00','',''),
(115,'GH - Next 2765 GHC',NULL,'[]','[\"108\"]','[]','[]',11,'No','Yes','0.00','',''),
(120,'GH - Remaining after 3240 GHC',NULL,'[]','[\"111\"]','[]','[]',12,'No','Yes','0.00','',''),
(121,'GH - Overtime Allow. Tax',NULL,'[]','[]','[]','[]',13,'No','Yes','0.00','[{\"name\":\"O\",\"column\":\"107\",\"id\":\"calculation_columns_1\"}]','O*0.05'),
(122,'GH - Total (PAYE Tax)',NULL,'[]','[]','[\"113\",\"114\",\"115\",\"120\",\"121\"]','[]',14,'No','Yes','0.00','',''),
(123,'GH - Deductions - Sub Total',NULL,'[]','[]','[\"109\",\"122\"]','[]',15,'No','Yes','0.00','',''),
(125,'GH - Final Total',NULL,'[]','[]','[\"108\"]','[\"123\"]',16,'No','Yes','0.00','','');
INSERT INTO `Deductions` VALUES
(101,'Housing Allowance (10%)','[]','[\"1\"]',NULL,'[{\"lowerCondition\":\"No Lower Limit\",\"lowerLimit\":0,\"upperCondition\":\"No Upper Limit\",\"upperLimit\":0,\"amount\":\"X*0.1\",\"id\":\"rangeAmounts_1\"}]',2),
(102,'Overtime Allowance (10%)','[]','[\"1\"]',NULL,'[{\"lowerCondition\":\"No Lower Limit\",\"lowerLimit\":0,\"upperCondition\":\"No Upper Limit\",\"upperLimit\":0,\"amount\":\"X*0.1\",\"id\":\"rangeAmounts_1\"}]',2),
(103,'SSNIT','[]','[\"1\"]',NULL,'[{\"lowerCondition\":\"No Lower Limit\",\"lowerLimit\":0,\"upperCondition\":\"No Upper Limit\",\"upperLimit\":0,\"amount\":\"X*0.055\",\"id\":\"rangeAmounts_1\"}]',2),
(104,'Tax - Ghana','[]','[]',NULL,'',2),
(106,'Next 108 GHC','[]','[]',112,'[{\"lowerCondition\":\"gte\",\"lowerLimit\":\"216\",\"upperCondition\":\"lt\",\"upperLimit\":\"324\",\"amount\":\"X*0.05\",\"id\":\"rangeAmounts_1\"},{\"lowerCondition\":\"gte\",\"lowerLimit\":\"324\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":0,\"amount\":\"5.4\",\"id\":\"rangeAmounts_2\"}]',2),
(107,'Next 151 GHC','[]','[]',112,'[{\"lowerCondition\":\"gte\",\"lowerLimit\":\"324\",\"upperCondition\":\"lt\",\"upperLimit\":\"475\",\"amount\":\"(X-324) * 0.1\",\"id\":\"rangeAmounts_1\"},{\"lowerCondition\":\"gte\",\"lowerLimit\":\"259\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":0,\"amount\":\"15.10\",\"id\":\"rangeAmounts_2\"}]',2),
(108,'Next 2765 GHC','[]','[]',112,'[{\"lowerCondition\":\"gte\",\"lowerLimit\":\"475\",\"upperCondition\":\"lt\",\"upperLimit\":\"3240\",\"amount\":\"(X - 475) * 0.175\",\"id\":\"rangeAmounts_1\"},{\"lowerCondition\":\"gte\",\"lowerLimit\":\"3240\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":0,\"amount\":\"483.88\",\"id\":\"rangeAmounts_2\"}]',2),
(111,'Remaining after 3240 GHC','[]','[]',112,'[{\"lowerCondition\":\"gte\",\"lowerLimit\":\"3240\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":0,\"amount\":\"(X-3240)*0.25\",\"id\":\"rangeAmounts_1\"}]',2);

View File

@@ -1,5 +1,19 @@
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
DELIMITER $$
CREATE FUNCTION generate_fname () RETURNS varchar(255)
BEGIN
RETURN ELT(FLOOR(1 + (RAND() * (100-1))), "James","Mary","John","Patricia","Robert","Linda","Michael","Barbara","William","Elizabeth","David","Jennifer","Richard","Maria","Charles","Susan","Joseph","Margaret","Thomas","Dorothy","Christopher","Lisa","Daniel","Nancy","Paul","Karen","Mark","Betty","Donald","Helen","George","Sandra","Kenneth","Donna","Steven","Carol","Edward","Ruth","Brian","Sharon","Ronald","Michelle","Anthony","Laura","Kevin","Sarah","Jason","Kimberly","Matthew","Deborah","Gary","Jessica","Timothy","Shirley","Jose","Cynthia","Larry","Angela","Jeffrey","Melissa","Frank","Brenda","Scott","Amy","Eric","Anna","Stephen","Rebecca","Andrew","Virginia","Raymond","Kathleen","Gregory","Pamela","Joshua","Martha","Jerry","Debra","Dennis","Amanda","Walter","Stephanie","Patrick","Carolyn","Peter","Christine","Harold","Marie","Douglas","Janet","Henry","Catherine","Carl","Frances","Arthur","Ann","Ryan","Joyce","Roger","Diane");
END$$
DELIMITER ;
DELIMITER $$
CREATE FUNCTION generate_lname () RETURNS varchar(255)
BEGIN
RETURN ELT(FLOOR(1 + (RAND() * (100-1))), "Smith","Johnson","Williams","Jones","Brown","Davis","Miller","Wilson","Moore","Taylor","Anderson","Thomas","Jackson","White","Harris","Martin","Thompson","Garcia","Martinez","Robinson","Clark","Rodriguez","Lewis","Lee","Walker","Hall","Allen","Young","Hernandez","King","Wright","Lopez","Hill","Scott","Green","Adams","Baker","Gonzalez","Nelson","Carter","Mitchell","Perez","Roberts","Turner","Phillips","Campbell","Parker","Evans","Edwards","Collins","Stewart","Sanchez","Morris","Rogers","Reed","Cook","Morgan","Bell","Murphy","Bailey","Rivera","Cooper","Richardson","Cox","Howard","Ward","Torres","Peterson","Gray","Ramirez","James","Watson","Brooks","Kelly","Sanders","Price","Bennett","Wood","Barnes","Ross","Henderson","Coleman","Jenkins","Perry","Powell","Long","Patterson","Hughes","Flores","Washington","Butler","Simmons","Foster","Gonzales","Bryant","Alexander","Russell","Griffin","Diaz","Hayes");
END$$
DELIMITER ;
INSERT INTO `CompanyStructures` (`id`, `title`, `description`, `address`, `type`, `country`, `parent`) VALUES INSERT INTO `CompanyStructures` (`id`, `title`, `description`, `address`, `type`, `country`, `parent`) VALUES
(4, 'Development Center', 'Development Center', 'PO Box 001002\nSample Road, Sample Town', 'Regional Office', 'SG', 1), (4, 'Development Center', 'Development Center', 'PO Box 001002\nSample Road, Sample Town', 'Regional Office', 'SG', 1),
@@ -10,12 +24,47 @@ INSERT INTO `CompanyStructures` (`id`, `title`, `description`, `address`, `type`
(9, 'Administration & HR', 'Administration and Human Resource', '', 'Department', 'SG', 4); (9, 'Administration & HR', 'Administration and Human Resource', '', 'Department', 'SG', 4);
INSERT INTO `Employees` (`id`, `employee_id`, `first_name`, `middle_name`, `last_name`, `nationality`, `birthday`, `gender`, `marital_status`, `ssn_num`, `nic_num`, `other_id`, `driving_license`, `driving_license_exp_date`, `employment_status`, `job_title`, `pay_grade`, `work_station_id`, `address1`, `address2`, `city`, `country`, `province`, `postal_code`, `home_phone`, `mobile_phone`, `work_phone`, `work_email`, `private_email`, `joined_date`, `confirmation_date`, `supervisor`, `department`, `custom1`, `custom2`, `custom3`, `custom4`, `custom5`, `custom6`, `custom7`, `custom8`, `custom9`, `custom10`,`indirect_supervisors`) VALUES
(2, 'EMP002', 'Lala', 'Nadila ', 'Lamees', 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+manager@web-stalk.com', 'icehrm+manager@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 1, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL),
(3, 'EMP003', 'Sofia', '', 'O''Sullivan', 4, '1975-08-28 18:30:00', 'Female', 'Married', '', '768-20-4394', '768-20-4394', '', NULL, 3, 10, 2, '', '2792 Trails End Road', 'Fort Lauderdale', 'Fort Lauderdale', 'US', 12, '33308', '954-388-3340', '954-388-3340', '954-388-3340', 'icehrm+user1@web-stalk.com', 'icehrm+user1@web-stalk.com', '2010-02-08 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,'[\"1\"]'),
(4, 'EMP004', 'Taylor', '', 'Holmes', 10, '1979-07-15 18:30:00', 'Male', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL);
INSERT INTO `Employees` (`id`, `employee_id`, `first_name`, `middle_name`, `last_name`, `nationality`, `birthday`, `gender`, `marital_status`, `ssn_num`, `nic_num`, `other_id`, `driving_license`, `driving_license_exp_date`, `employment_status`, `job_title`, `pay_grade`, `work_station_id`, `address1`, `address2`, `city`, `country`, `province`, `postal_code`, `home_phone`, `mobile_phone`, `work_phone`, `work_email`, `private_email`, `joined_date`, `confirmation_date`, `supervisor`, `department`, `custom1`, `custom2`, `custom3`, `custom4`, `custom5`, `custom6`, `custom7`, `custom8`, `custom9`, `custom10`) VALUES INSERT INTO `Employees` (`id`, `employee_id`, `first_name`, `middle_name`, `last_name`, `nationality`, `birthday`, `gender`, `marital_status`, `ssn_num`, `nic_num`, `other_id`, `driving_license`, `driving_license_exp_date`, `employment_status`, `job_title`, `pay_grade`, `work_station_id`, `address1`, `address2`, `city`, `country`, `province`, `postal_code`, `home_phone`, `mobile_phone`, `work_phone`, `work_email`, `private_email`, `joined_date`, `confirmation_date`, `supervisor`, `department`, `custom1`, `custom2`, `custom3`, `custom4`, `custom5`, `custom6`, `custom7`, `custom8`, `custom9`, `custom10`) VALUES
(2, 'EMP002', 'Lala', 'Nadila ', 'Lamees', 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+manager@web-stalk.com', 'icehrm+manager@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 1, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (5, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Male', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(3, 'EMP003', 'Sofia', '', 'O''Sullivan', 4, '1975-08-28 18:30:00', 'Female', 'Married', '', '768-20-4394', '768-20-4394', '', NULL, 3, 10, 2, '', '2792 Trails End Road', 'Fort Lauderdale', 'Fort Lauderdale', 'US', 12, '33308', '954-388-3340', '954-388-3340', '954-388-3340', 'icehrm+user1@web-stalk.com', 'icehrm+user1@web-stalk.com', '2010-02-08 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (6, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Male', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(4, 'EMP004', 'Taylor', '', 'Holmes', 10, '1979-07-15 18:30:00', 'Male', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); (7, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Male', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(8, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Male', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Male', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(10, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(11, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(12, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(13, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(14, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(15, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(16, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(17, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(18, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(19, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(20, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(21, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(22, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(23, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(24, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(25, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(26, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(27, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(28, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(29, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(30, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(31, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(32, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(33, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(34, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
UPDATE `Employees` set supervisor = 2, indirect_supervisors = '[3,4]', approver1 = 5, approver2 = 6, approver3 = 7 where id = 1;
UPDATE `Employees` set supervisor = 1, indirect_supervisors = '[3,4]', approver1 = 5, approver2 = 6 where id = 2;
UPDATE `Employees` set supervisor = 2, indirect_supervisors = '[1,4]', approver1 = 5 where id = 3;
INSERT INTO `EmergencyContacts` (`id`, `employee`, `name`, `relationship`, `home_phone`, `work_phone`, `mobile_phone`) VALUES INSERT INTO `EmergencyContacts` (`id`, `employee`, `name`, `relationship`, `home_phone`, `work_phone`, `mobile_phone`) VALUES
(1, 1, 'Emma Owns', 'Mother', '+874463422', '+874463422', '+874463422'), (1, 1, 'Emma Owns', 'Mother', '+874463422', '+874463422', '+874463422'),
@@ -36,10 +85,6 @@ INSERT INTO `EmployeeDependents` (`id`, `employee`, `name`, `relationship`, `dob
(2, 1, 'Mica Singroo', 'Other', '2000-06-13', ''); (2, 1, 'Mica Singroo', 'Other', '2000-06-13', '');
INSERT INTO `EmployeeDocuments` (`id`, `employee`, `document`, `date_added`, `valid_until`, `status`, `details`) VALUES
(1, 2, 2, '2013-01-08', '0000-00-00', 'Active', 'zxczx');
INSERT INTO `EmployeeEducations` (`id`, `education_id`, `employee`, `institute`, `date_start`, `date_end`) VALUES INSERT INTO `EmployeeEducations` (`id`, `education_id`, `employee`, `institute`, `date_start`, `date_end`) VALUES
(1, 1, 1, 'National University of Turky', '2004-02-03', '2006-06-13'), (1, 1, 1, 'National University of Turky', '2004-02-03', '2006-06-13'),
(2, 1, 2, 'MIT', '1995-02-21', '1999-10-12'); (2, 1, 2, 'MIT', '1995-02-21', '1999-10-12');
@@ -57,12 +102,38 @@ INSERT INTO `EmployeeProjects` (`id`, `employee`, `project`, `date_start`, `date
(5, 2, 3, '2013-02-24', '0000-00-00', 'Current', ''); (5, 2, 3, '2013-02-24', '0000-00-00', 'Current', '');
INSERT INTO `EmployeeSalary` (`employee`, `component`,`amount`, `details`) VALUES
(1, 1,'50000.00', ''),
(1, 2,'20000.00', ''),
(1, 3,'30000.00', ''),
(1, 4,'2000.00', ''),
INSERT INTO `EmployeeSalary` (`id`, `employee`, `component`, `pay_frequency`, `currency`, `amount`, `details`) VALUES (2, 1,'90500.00', ''),
(1, 1, 'Basic', 'Monthly', 131, '2700.00', ''), (2, 2,'40000.00', ''),
(2, 2, 'Basic Salary', 'Monthly', 151, '12000.00', ''), (2, 3,'50000.00', ''),
(3, 2, 'Travelling Allowance', 'Monthly', 131, '5000.00', '');
(3, 1,'131409.00', ''),
(3, 2,'143471.00', ''),
(3, 3,'50000.00', ''),
(3, 4,'30000.00', ''),
(4, 5,'1432.00', ''),
(4, 6,'2100.00', ''),
(5, 5,'1200.00', ''),
(5, 6,'1500.00', ''),
(5, 7,'2000.00', ''),
(5, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), ''),
(6, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), ''),
(7, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), ''),
(8, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), ''),
(9, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), ''),
(10, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), ''),
(11, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), ''),
(12, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), ''),
(13, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), ''),
(14, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), '');
INSERT INTO `EmployeeSkills` (`id`, `skill_id`, `employee`, `details`) VALUES INSERT INTO `EmployeeSkills` (`id`, `skill_id`, `employee`, `details`) VALUES
(1, 9, 1, 'Creating web sites'), (1, 9, 1, 'Creating web sites'),
@@ -70,10 +141,145 @@ INSERT INTO `EmployeeSkills` (`id`, `skill_id`, `employee`, `details`) VALUES
INSERT INTO `Users` (`id`, `username`, `email`, `password`, `employee`, `user_level`, `last_login`, `last_update`, `created`) VALUES
(2, 'manager', 'icehrm+manager@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 2, 'Manager', '2013-01-03 02:47:37', '2013-01-03 02:47:37', '2013-01-03 02:47:37'), INSERT INTO `LeaveRules` (`id`, `leave_type`, `job_title`, `employment_status`, `employee`, `supervisor_leave_assign`, `employee_can_apply`, `apply_beyond_current`, `leave_accrue`, `carried_forward`, `default_per_year`) VALUES
(3, 'user1', 'icehrm+user1@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 3, 'Employee', '2013-01-03 02:48:32', '2013-01-03 02:48:32', '2013-01-03 02:48:32'), (1, 1, 11, NULL, NULL, 'No', 'Yes', 'Yes', 'No', 'No', 25),
(4, 'user2', 'icehrm+user2@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 4, 'Employee', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'); (2, 2, NULL, NULL, 2, 'No', 'Yes', 'Yes', 'No', 'No', 10);
INSERT INTO `Users` (`id`, `username`, `email`, `password`, `employee`,`default_module`, `user_level`,`user_roles`, `last_login`, `last_update`, `created`) VALUES
(2, 'manager', 'icehrm+manager@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 2,NULL, 'Manager','', '2013-01-03 02:47:37', '2013-01-03 02:47:37', '2013-01-03 02:47:37'),
(3, 'user1', 'icehrm+user1@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 3,NULL, 'Employee','', '2013-01-03 02:48:32', '2013-01-03 02:48:32', '2013-01-03 02:48:32'),
(4, 'user2', 'icehrm+user2@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 4,NULL, 'Employee','', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'),
(5, 'user3', 'icehrm+user3@web-stalk.com', '4048bb914a704a0728549a26b92d8550', NULL,NULL, 'Other','["1"]', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'),
(6, 'user4', 'icehrm+user4@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 5,NULL, 'Manager','', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'),
(7, 'user5', 'icehrm+user5@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 6,NULL, 'Employee','', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'),
(8, 'user6', 'icehrm+user6@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 7,NULL, 'Employee','', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'),
(9, 'user7', 'icehrm+user7@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 8,NULL, 'Employee','', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'),
(10, 'user8', 'icehrm+user8@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 9,NULL, 'Employee','', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'),
(11, 'user9', 'icehrm+user9@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 10,NULL, 'Employee','', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55');
INSERT INTO `Job` VALUES
(1,'Software Engineer','More than 375,000 users world-wide rely on our software for their daily business as it makes creating graphical presentations so much easier, faster and more enjoyable. Among our customers are many renowned consulting companies and large international corporations.','More than 375,000 users world-wide rely on our software for their daily business as it makes creating graphical presentations so much easier, faster and more enjoyable. Among our customers are many renowned consulting companies and large international corporations.\n\nWe follow our own strategy and do not have to make compromises with regard to code quality and beauty, because think-cell is profitable and has no outside investors. We are flourishing without program managers, meetings, and marketing-driven deadlines. Our code quality is extraordinarily high because we only release software when it is ready. We are willing to do the leg work of developing sophisticated algorithms and refining our user interface, which makes working with think-cell’s software so satisfying.','Challenging C++ coding with high personal responsibility\nWork with a competent and creative team in a modern loft office in Berlin\nFamily-friendly working hours, no deadlines\nAbove-average salary (we offer our developers EUR 120,000 annually after one year of employment)\nFree supply of drinks, fruits, sweets and snacks\nFlat hierarchies and plenty of room for your ideas\nA full-time company nanny who is available for free when children are sick, or when you just feel like spending an evening out','[\"Health plan\",\"Paid vacations\"]',226,2,NULL,'JC001',1,NULL,7,14,9,151,'Yes',3500,5500,'job, engineer','Active','0000-00-00 00:00:00',NULL,'Text Only',1),
(2,'QA Senior Test Automation Engineer','As a QA Senior Test Automation Engineer at Rocket you will help us launch the most successful startup companies around the world.','As a QA Senior Test Automation Engineer at Rocket you will help us launch the most successful startup companies around the world.','Responsibilities:\n\nAutomated testing of web and mobile applications\nDevelop automated scenarios/scripts using Cucumber (for web applications) and Calabash (for mobile applications)\nOptimize existing test cases to get more stability and efficiency\nRun automated functional tests as well as performance and load tests\nAnalyze automated test results and report bugs to responsible employees\nSupport the test automation team during the whole development process (starting from the analysis of requirements up to the integration of automated test cases into the CI system (Jenkins)\n\n\nRequirements:\n\nSeveral years of experience as a Test Automation Engineer ( 5+ years )\nExperience with automated solutions such as Cucumber/Calabash, Gherkin, Selenium or similar tools/frameworks\nExperience with Ruby, Python, PHP, JAVA or similar programming languages\nExperience with source code controls like SVN, GIT, CVS\nFamiliarity with Continuous Integration and Delivery\nExperience in Agile Methodologies like Scrum and Kanban or extreme programming\nFluency in speaking & writing English skills\nISTQB certification\n Technology stack we use:\n\nTools: GitHub, Jira, Confluence, Bamboo, Jenkins, Testlink\nScrum, Kanban\nCucumber, Calabash, Capybara, JMeter','[\"Life insurance\"]',80,3,NULL,'JC002',3,NULL,5,14,6,151,'Yes',4000,4500,'','Active','0000-00-00 00:00:00',NULL,'Text Only',1),
(3,'Online Editor','Online Editors required for a reputed news agency','Online Editors required for a reputed news agency','','[]',129,NULL,NULL,'J0003',1,NULL,7,23,9,103,'No',0,0,'','Active','0001-01-01 00:00:00','attachment_BI5XQCYFxZO12W1447383181684','Image and Full Text',1);
INSERT INTO `Candidates` VALUES
(1,'Jhon','Doe',4,NULL,'Male',NULL,NULL,NULL,'New York','US',NULL,NULL,'icehrm+jhon@web-stalk.com','+1 455565656',NULL,'Software Engineer','cv_rYwHphV7xD5dOe1444302569136',NULL,NULL,NULL,'','','','','','',NULL,NULL,NULL,NULL,NULL,NULL,'2015-10-08 16:59:20','2015-10-08 16:59:20',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'663fd20d1859344585f678a0f87b23522b8f9fce8c67c5290a609ce342b81442',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO `Files` VALUES
(6,'attachment_BI5XQCYFxZO12W1447383181684','attachment_BI5XQCYFxZO12W1447383181684.png',1,'Job',2000,'2MB');
INSERT INTO `EmployeeDocuments` (`id`,`employee`, `document`, `date_added`, `valid_until`, `status`, `details`, `attachment`, `expire_notification_last`) VALUES
(1, 1, 1, CURDATE(), DATE_ADD(CURDATE(), INTERVAL 30 DAY), 'Active', '', NULL, -1),
(2, 1, 2, CURDATE(), DATE_ADD(CURDATE(), INTERVAL 7 DAY), 'Active', '', NULL, -1),
(3, 1, 3, CURDATE(), DATE_ADD(CURDATE(), INTERVAL 1 DAY), 'Active', '', NULL, -1);
INSERT INTO `Attendance` (`employee`,`in_time`,`out_time`,`note`) VALUES
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 30 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 30 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 29 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 29 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 28 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 28 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 27 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 27 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 26 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 26 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 25 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 25 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 24 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 24 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 21 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 21 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 20 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 20 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 19 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 19 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 18 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 18 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 17 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 17 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 16 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 16 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 15 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 15 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 30 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 30 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 29 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 29 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 28 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 28 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 27 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 27 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 26 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 26 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 25 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 25 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 24 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 24 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 30 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 30 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 29 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 29 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 28 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 28 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 27 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 27 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 26 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 26 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 25 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 25 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 24 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 24 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), '');
INSERT INTO `PayrollEmployees` VALUES
(1,1,4,151,'[]','[]',1),
(2,2,4,151,'[]','[]',1),
(3,3,4,151,'[]','[]',1),
(4,4,2,151,'[]','[]',1),
(5,5,2,151,'[]','[]',1),
(6,6,4,151,'[]','[]',1),
(7,7,4,151,'[]','[]',1),
(8,8,4,151,'[]','[]',1),
(9,9,4,151,'[]','[]',1),
(10,10,4,151,'[]','[]',1);
INSERT INTO `EmployeeLeaves` VALUES
(1,1,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 3 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 3 DAY))),'%Y-%m-%d'),'Test Reason 1','Pending',''),
(2,1,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 4 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 4 DAY))),'%Y-%m-%d'),'Test Reason 2','Approved',''),
(3,2,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 3 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 3 DAY))),'%Y-%m-%d'),'Test Reason 3','Approved',''),
(4,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 8 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 8 DAY))),'%Y-%m-%d'),'Test Reason 4','Pending',''),
(5,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 9 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 9 DAY))),'%Y-%m-%d'),'Test Reason 4','Pending',''),
(6,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 10 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 10 DAY))),'%Y-%m-%d'),'Test Reason 4','Pending',''),
(7,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 11 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 11 DAY))),'%Y-%m-%d'),'Test Reason 4','Pending',''),
(8,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 12 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 12 DAY))),'%Y-%m-%d'),'Test Reason 4','Pending',''),
(9,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 13 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 13 DAY))),'%Y-%m-%d'),'Test Reason 4','Pending',''),
(10,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 14 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 14 DAY))),'%Y-%m-%d'),'Test Reason 4','Pending',''),
(11,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 15 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 15 DAY))),'%Y-%m-%d'),'Test Reason 4','Pending',''),
(12,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 16 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 16 DAY))),'%Y-%m-%d'),'Test Reason 4','Pending',''),
(13,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 17 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 17 DAY))),'%Y-%m-%d'),'Test Reason 4','Pending',''),
(14,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 18 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 18 DAY))),'%Y-%m-%d'),'Test Reason 4','Pending',''),
(15,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 19 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 19 DAY))),'%Y-%m-%d'),'Test Reason 4','Pending',''),
(16,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 20 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 20 DAY))),'%Y-%m-%d'),'Test Reason 4','Pending',''),
(17,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 21 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 21 DAY))),'%Y-%m-%d'),'Test Reason 4','Pending',''),
(18,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))),'%Y-%m-%d'),'Test Reason 22','Pending','');
INSERT INTO `EmployeeLeaveDays` VALUES
(1,1,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 3 DAY))),'%Y-%m-%d'),'Full Day'),
(2,1,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 4 DAY))),'%Y-%m-%d'),'Half Day - Morning'),
(3,2,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 3 DAY))),'%Y-%m-%d'),'Half Day - Morning'),
(4,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 8 DAY))),'%Y-%m-%d'),'3 Hours - Morning'),
(5,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 9 DAY))),'%Y-%m-%d'),'Full Day'),
(6,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 10 DAY))),'%Y-%m-%d'),'Full Day'),
(7,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 11 DAY))),'%Y-%m-%d'),'Full Day'),
(8,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 12 DAY))),'%Y-%m-%d'),'Full Day'),
(9,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 13 DAY))),'%Y-%m-%d'),'Full Day'),
(10,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 14 DAY))),'%Y-%m-%d'),'Full Day'),
(11,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 15 DAY))),'%Y-%m-%d'),'Full Day'),
(12,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 16 DAY))),'%Y-%m-%d'),'Full Day'),
(13,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 17 DAY))),'%Y-%m-%d'),'Full Day'),
(14,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 18 DAY))),'%Y-%m-%d'),'Full Day'),
(15,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 19 DAY))),'%Y-%m-%d'),'Full Day'),
(16,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 20 DAY))),'%Y-%m-%d'),'Full Day'),
(17,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 21 DAY))),'%Y-%m-%d'),'Full Day'),
(18,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))),'%Y-%m-%d'),'Full Day');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Instance : ID', '0847429146712c108e23c435e8f93b4d', '',''),
('Instance: Key', 'UQHEYBx9H1eNR66nhNCNCz1WCDDhkjtx1OuJbO3ZQMt+8tfSGvuOH/YEHntRajY=', '','');
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -83,11 +289,3 @@ INSERT INTO `Users` (`id`, `username`, `email`, `password`, `employee`, `user_le

View File

@@ -1,248 +0,0 @@
/* Upgrade v10.2 to v11.0 */
ALTER TABLE `LeaveTypes` ADD COLUMN `leave_color` varchar(10) NULL;
create table `RestAccessTokens` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`userId` bigint(20) NOT NULL,
`hash` varchar(32) default null,
`token` varchar(500) default null,
`created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00',
primary key (`id`),
unique key `userId` (`userId`)
) engine=innodb default charset=utf8;
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Api: REST Api Enabled', '0', '','["value", {"label":"Value","type":"select","source":[["0","No"],["1","Yes"]]}]');
ALTER TABLE Employees ADD COLUMN `status` enum('Active','Terminated') default 'Active';
ALTER TABLE EmployeeLeaves MODIFY COLUMN `status` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending';
ALTER TABLE EmployeeLeaveLog MODIFY COLUMN `status_from` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending';
ALTER TABLE EmployeeLeaveLog MODIFY COLUMN `status_to` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending';
create table `ArchivedEmployees` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`ref_id` bigint(20) NOT NULL,
`employee_id` varchar(50) default null,
`first_name` varchar(100) default '' not null,
`last_name` varchar(100) default '' not null,
`gender` enum('Male','Female') default NULL,
`ssn_num` varchar(100) default '',
`nic_num` varchar(100) default '',
`other_id` varchar(100) default '',
`work_email` varchar(100) default null,
`joined_date` DATETIME default '0000-00-00 00:00:00',
`confirmation_date` DATETIME default '0000-00-00 00:00:00',
`supervisor` bigint(20) default null,
`department` bigint(20) default null,
`termination_date` DATETIME default '0000-00-00 00:00:00',
`notes` text default null,
`data` longtext default null,
primary key (`id`)
) engine=innodb default charset=utf8;
/* Upgrade v11.0 to v11.1 */
create table `FieldNameMappings` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`type` varchar(20) NOT NULL,
`name` varchar(20) NOT NULL,
`textOrig` varchar(200) default null,
`textMapped` varchar(200) default null,
`display` enum('Form','Table and Form','Hidden') default 'Form',
`created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
INSERT INTO `FieldNameMappings` (`type`, `name`, `textOrig`, `textMapped`, `display`) VALUES
('Employee', 'employee_id', 'Employee Number', 'Employee Number', 'Table and Form'),
('Employee', 'first_name', 'First Name', 'First Name', 'Table and Form'),
('Employee', 'middle_name', 'Middle Name', 'Middle Name', 'Form'),
('Employee', 'last_name', 'Last Name', 'Last Name', 'Table and Form'),
('Employee', 'nationality', 'Nationality', 'Nationality', 'Form'),
('Employee', 'ethnicity', 'Ethnicity', 'Ethnicity', 'Form'),
('Employee', 'immigration_status', 'Immigration Status', 'Immigration Status', 'Form'),
('Employee', 'birthday', 'Date of Birth', 'Date of Birth', 'Form'),
('Employee', 'gender', 'Gender', 'Gender', 'Form'),
('Employee', 'marital_status', 'Marital Status', 'Marital Status', 'Form'),
('Employee', 'ssn_num', 'SSN/NRIC', 'SSN/NRIC', 'Form'),
('Employee', 'nic_num', 'NIC', 'NIC', 'Form'),
('Employee', 'other_id', 'Other ID', 'Other ID', 'Form'),
('Employee', 'driving_license', 'Driving License No', 'Driving License No', 'Form'),
('Employee', 'employment_status', 'Employment Status', 'Employment Status', 'Form'),
('Employee', 'job_title', 'Job Title', 'Job Title', 'Form'),
('Employee', 'pay_grade', 'Pay Grade', 'Pay Grade', 'Form'),
('Employee', 'work_station_id', 'Work Station Id', 'Work Station Id', 'Form'),
('Employee', 'address1', 'Address Line 1', 'Address Line 1', 'Form'),
('Employee', 'address2', 'Address Line 2', 'Address Line 2', 'Form'),
('Employee', 'city', 'City', 'City', 'Form'),
('Employee', 'country', 'Country', 'Country', 'Form'),
('Employee', 'province', 'Province', 'Province', 'Form'),
('Employee', 'postal_code', 'Postal/Zip Code', 'Postal/Zip Code', 'Form'),
('Employee', 'home_phone', 'Home Phone', 'Home Phone', 'Form'),
('Employee', 'mobile_phone', 'Mobile Phone', 'Mobile Phone', 'Table and Form'),
('Employee', 'work_phone', 'Work Phone', 'Work Phone', 'Form'),
('Employee', 'work_email', 'Work Email', 'Work Email', 'Form'),
('Employee', 'private_email', 'Private Email', 'Private Email', 'Form'),
('Employee', 'joined_date', 'Joined Date', 'Joined Date', 'Form'),
('Employee', 'confirmation_date', 'Confirmation Date', 'Confirmation Date', 'Form'),
('Employee', 'termination_date', 'Termination Date', 'Termination Date', 'Form'),
('Employee', 'supervisor', 'Supervisor', 'Supervisor', 'Table and Form'),
('Employee', 'department', 'Department', 'Department', 'Table and Form'),
('Employee', 'notes', 'Notes', 'Notes', 'Form');
create table `CustomFields` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`type` varchar(20) NOT NULL,
`name` varchar(20) NOT NULL,
`data` text default null,
`display` enum('Form','Table and Form','Hidden') default 'Form',
`created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
INSERT INTO `CustomFields` (`type`, `name`, `data`,`display`) VALUES
('Employee', 'custom1', '', 'Hidden'),
('Employee', 'custom2', '', 'Hidden'),
('Employee', 'custom3', '', 'Hidden'),
('Employee', 'custom4', '', 'Hidden'),
('Employee', 'custom5', '', 'Hidden'),
('Employee', 'custom6', '', 'Hidden'),
('Employee', 'custom7', '', 'Hidden'),
('Employee', 'custom8', '', 'Hidden'),
('Employee', 'custom9', '', 'Hidden'),
('Employee', 'custom10', '', 'Hidden');
Alter table `Employees` MODIFY COLUMN `middle_name` varchar(100) default null;
Alter table `Employees` MODIFY COLUMN `last_name` varchar(100) default null;
Alter table `Employees` MODIFY COLUMN `ssn_num` varchar(100) default NULL;
Alter table `Employees` MODIFY COLUMN `nic_num` varchar(100) default NULL;
Alter table `Employees` MODIFY COLUMN `other_id` varchar(100) default NULL;
Alter table `Employees` MODIFY COLUMN `driving_license` varchar(100) default NULL;
Alter table `Employees` MODIFY COLUMN `work_station_id` varchar(100) default NULL;
Alter table `Employees` MODIFY COLUMN `address1` varchar(100) default NULL;
Alter table `Employees` MODIFY COLUMN `address2` varchar(100) default NULL;
Alter table `Employees` MODIFY COLUMN `city` varchar(150) default NULL;
Alter table `Employees` ADD COLUMN `ethnicity` bigint(20) default null;
Alter table `Employees` ADD COLUMN `immigration_status` bigint(20) default null;
Alter table `EmployeeSalary` MODIFY COLUMN `component` bigint(20) NOT NULL;
Alter table `EmployeeSalary` MODIFY COLUMN `currency` bigint(20) NULL;
INSERT INTO `SalaryComponentType` (`id`,`code`, `name`) VALUES
(1,'B001', 'Basic'),
(2,'B002', 'Allowance');
INSERT INTO `SalaryComponent` VALUES
(1,'Basic Salary', 1,''),(2,'Fixed Allowance', 1,''),(3,'Car Allowance', 2,''),(4,'Telephone Allowance', 2,'');
/* Upgrade v11.1 to v12.0 */
ALTER TABLE Users ADD COLUMN user_roles text null;
ALTER TABLE Users ADD COLUMN `default_module` bigint(20) null after `employee`;
ALTER TABLE Modules ADD COLUMN user_roles text null AFTER `user_levels`;
ALTER TABLE Modules ADD COLUMN label varchar(100) NOT NULL AFTER `name`;
create table `UserRoles` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) default null,
primary key (`id`),
unique key `name` (`name`)
) engine=innodb default charset=utf8;
ALTER TABLE `Users` CHANGE `user_level` `user_level` enum('Admin','Employee','Manager','Other') default NULL;
create table `EmployeeEducationsTemp` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`education_id` bigint(20) NULL,
`employee` bigint(20) NOT NULL,
`institute` varchar(400) default null,
`date_start` date default '0000-00-00',
`date_end` date default '0000-00-00',
primary key (`id`)
) engine=innodb default charset=utf8;
insert into EmployeeEducationsTemp select * from EmployeeEducations;
drop table EmployeeEducations;
create table `EmployeeEducations` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`education_id` bigint(20) NULL,
`employee` bigint(20) NOT NULL,
`institute` varchar(400) default null,
`date_start` date default '0000-00-00',
`date_end` date default '0000-00-00',
CONSTRAINT `Fk_EmployeeEducations_Educations` FOREIGN KEY (`education_id`) REFERENCES `Educations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeEducations_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
insert into EmployeeEducations select * from EmployeeEducationsTemp;
drop table EmployeeEducationsTemp;
UPDATE `Settings` set value = '1' where name = 'System: Reset Modules and Permissions';
UPDATE `Settings` set value = '1' where name = 'System: Add New Permissions';
create table `SalaryComponentType` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`code` varchar(10) NOT NULL,
`name` varchar(100) NOT NULL,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `SalaryComponent` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`componentType` bigint(20) NULL,
`details` text default null,
CONSTRAINT `Fk_SalaryComponent_SalaryComponentType` FOREIGN KEY (`componentType`) REFERENCES `SalaryComponentType` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `ImmigrationStatus` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Ethnicity` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployeeImmigrationStatus` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`status` bigint(20) NOT NULL,
CONSTRAINT `Fk_EmployeeImmigrationStatus_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeImmigrationStatus_Type` FOREIGN KEY (`status`) REFERENCES `ImmigrationStatus` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployeeEthnicity` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`ethnicity` bigint(20) NOT NULL,
CONSTRAINT `Fk_EmployeeEthnicity_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeEthnicity_Ethnicity` FOREIGN KEY (`ethnicity`) REFERENCES `Ethnicity` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;

View File

@@ -6,6 +6,8 @@ create table `CompanyStructures` (
`type` enum('Company','Head Office','Regional Office','Department','Unit','Sub Unit','Other') default NULL, `type` enum('Company','Head Office','Regional Office','Department','Unit','Sub Unit','Other') default NULL,
`country` varchar(2) not null default '0', `country` varchar(2) not null default '0',
`parent` bigint(20) NULL, `parent` bigint(20) NULL,
`timezone` varchar(100) not null default 'Europe/London',
`heads` varchar(255) NULL default NULL,
CONSTRAINT `Fk_CompanyStructures_Own` FOREIGN KEY (`parent`) REFERENCES `CompanyStructures` (`id`), CONSTRAINT `Fk_CompanyStructures_Own` FOREIGN KEY (`parent`) REFERENCES `CompanyStructures` (`id`),
primary key (`id`) primary key (`id`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
@@ -92,12 +94,25 @@ create table `Languages` (
primary key (`id`) primary key (`id`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
create table `SupportedLanguages` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) default null,
`description` varchar(100) default null,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Nationality` ( create table `Nationality` (
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) default null, `name` varchar(100) default null,
primary key (`id`) primary key (`id`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
CREATE TABLE `PayFrequency` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(200) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB default charset=utf8;
create table `Employees` ( create table `Employees` (
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee_id` varchar(50) default null, `employee_id` varchar(50) default null,
@@ -105,7 +120,7 @@ create table `Employees` (
`middle_name` varchar(100) default null, `middle_name` varchar(100) default null,
`last_name` varchar(100) default null, `last_name` varchar(100) default null,
`nationality` bigint(20) default null, `nationality` bigint(20) default null,
`birthday` DATETIME default '0000-00-00 00:00:00', `birthday` date default '0000-00-00',
`gender` enum('Male','Female') default NULL, `gender` enum('Male','Female') default NULL,
`marital_status` enum('Married','Single','Divorced','Widowed','Other') default NULL, `marital_status` enum('Married','Single','Divorced','Widowed','Other') default NULL,
`ssn_num` varchar(100) default NULL, `ssn_num` varchar(100) default NULL,
@@ -128,9 +143,10 @@ create table `Employees` (
`work_phone` varchar(50) default null, `work_phone` varchar(50) default null,
`work_email` varchar(100) default null, `work_email` varchar(100) default null,
`private_email` varchar(100) default null, `private_email` varchar(100) default null,
`joined_date` DATETIME default '0000-00-00 00:00:00', `joined_date` date default '0000-00-00',
`confirmation_date` DATETIME default '0000-00-00 00:00:00', `confirmation_date` date default '0000-00-00',
`supervisor` bigint(20) default null, `supervisor` bigint(20) default null,
`indirect_supervisors` varchar(250) default null,
`department` bigint(20) default null, `department` bigint(20) default null,
`custom1` varchar(250) default null, `custom1` varchar(250) default null,
`custom2` varchar(250) default null, `custom2` varchar(250) default null,
@@ -142,11 +158,14 @@ create table `Employees` (
`custom8` varchar(250) default null, `custom8` varchar(250) default null,
`custom9` varchar(250) default null, `custom9` varchar(250) default null,
`custom10` varchar(250) default null, `custom10` varchar(250) default null,
`termination_date` DATETIME default '0000-00-00 00:00:00', `termination_date` date default '0000-00-00',
`notes` text default null, `notes` text default null,
`status` enum('Active','Terminated') default 'Active', `status` enum('Active','Terminated') default 'Active',
`ethnicity` bigint(20) default null, `ethnicity` bigint(20) default null,
`immigration_status` bigint(20) default null, `immigration_status` bigint(20) default null,
`approver1` bigint(20) default null,
`approver2` bigint(20) default null,
`approver3` bigint(20) default null,
CONSTRAINT `Fk_Employee_Nationality` FOREIGN KEY (`nationality`) REFERENCES `Nationality` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `Fk_Employee_Nationality` FOREIGN KEY (`nationality`) REFERENCES `Nationality` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `Fk_Employee_JobTitle` FOREIGN KEY (`job_title`) REFERENCES `JobTitles` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `Fk_Employee_JobTitle` FOREIGN KEY (`job_title`) REFERENCES `JobTitles` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `Fk_Employee_EmploymentStatus` FOREIGN KEY (`employment_status`) REFERENCES `EmploymentStatus` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `Fk_Employee_EmploymentStatus` FOREIGN KEY (`employment_status`) REFERENCES `EmploymentStatus` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
@@ -160,6 +179,7 @@ create table `Employees` (
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
create table `ArchivedEmployees` ( create table `ArchivedEmployees` (
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`ref_id` bigint(20) NOT NULL, `ref_id` bigint(20) NOT NULL,
@@ -201,12 +221,18 @@ create table `Users` (
`last_login` timestamp default '0000-00-00 00:00:00', `last_login` timestamp default '0000-00-00 00:00:00',
`last_update` timestamp default '0000-00-00 00:00:00', `last_update` timestamp default '0000-00-00 00:00:00',
`created` timestamp default '0000-00-00 00:00:00', `created` timestamp default '0000-00-00 00:00:00',
`login_hash` varchar(64) default null,
`lang` bigint(20) default null,
CONSTRAINT `Fk_User_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `Fk_User_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `Fk_User_SupportedLanguages` FOREIGN KEY (`lang`) REFERENCES `SupportedLanguages` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
primary key (`id`), primary key (`id`),
unique key `username` (`username`) unique key `username` (`username`),
INDEX login_hash_index (`login_hash`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
create table `EmployeeSkills` ( create table `EmployeeSkills` (
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`skill_id` bigint(20) NULL, `skill_id` bigint(20) NULL,
@@ -283,12 +309,142 @@ create table `EmployeeDependents` (
create table `LeaveTypes` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`supervisor_leave_assign` enum('Yes','No') default 'Yes',
`employee_can_apply` enum('Yes','No') default 'Yes',
`apply_beyond_current` enum('Yes','No') default 'Yes',
`leave_accrue` enum('No','Yes') default 'No',
`carried_forward` enum('No','Yes') default 'No',
`default_per_year` decimal(10,3) NOT NULL,
`carried_forward_percentage` int(11) NULL default 0,
`carried_forward_leave_availability` int(11) NULL default 365,
`propotionate_on_joined_date` enum('No','Yes') default 'No',
`send_notification_emails` enum('Yes','No') default 'Yes',
`leave_group` bigint(20) NULL,
`leave_color` varchar(10) NULL,
`max_carried_forward_amount` int(11) NULL default 0,
primary key (`id`),
unique key (`name`)
) engine=innodb default charset=utf8;
create table `LeaveRules` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`leave_type` bigint(20) NOT NULL,
`job_title` bigint(20) NULL,
`employment_status` bigint(20) NULL,
`employee` bigint(20) NULL,
`supervisor_leave_assign` enum('Yes','No') default 'Yes',
`employee_can_apply` enum('Yes','No') default 'Yes',
`apply_beyond_current` enum('Yes','No') default 'Yes',
`leave_accrue` enum('No','Yes') default 'No',
`carried_forward` enum('No','Yes') default 'No',
`default_per_year` decimal(10,3) NOT NULL,
`carried_forward_percentage` int(11) NULL default 0,
`carried_forward_leave_availability` int(11) NULL default 365,
`propotionate_on_joined_date` enum('No','Yes') default 'No',
`leave_group` bigint(20) NULL,
`max_carried_forward_amount` int(11) NULL default 0,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `LeaveGroups` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`details` text default null,
`created` timestamp NULL default '0000-00-00 00:00:00',
`updated` timestamp NULL default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `LeaveGroupEmployees` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`leave_group` bigint(20) NOT NULL,
`created` timestamp NULL default '0000-00-00 00:00:00',
`updated` timestamp NULL default '0000-00-00 00:00:00',
CONSTRAINT `Fk_LeaveGroupEmployees_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_LeaveGroupEmployees_LeaveGroups` FOREIGN KEY (`leave_group`) REFERENCES `LeaveGroups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`),
unique key `LeaveGroupEmployees_employee` (`employee`)
) engine=innodb default charset=utf8;
create table `LeavePeriods` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`date_start` date default '0000-00-00',
`date_end` date default '0000-00-00',
`status` enum('Active','Inactive') default 'Inactive',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `WorkDays` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`status` enum('Full Day','Half Day','Non-working Day') default 'Full Day',
`country` bigint(20) DEFAULT NULL,
primary key (`id`),
unique key `workdays_name_country` (`name`,`country`)
) engine=innodb default charset=utf8;
create table `HoliDays` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`dateh` date default '0000-00-00',
`status` enum('Full Day','Half Day') default 'Full Day',
`country` bigint(20) DEFAULT NULL,
primary key (`id`),
unique key `holidays_dateh_country` (`dateh`,`country`)
) engine=innodb default charset=utf8;
create table `EmployeeLeaves` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`leave_type` bigint(20) NOT NULL,
`leave_period` bigint(20) NOT NULL,
`date_start` date default '0000-00-00',
`date_end` date default '0000-00-00',
`details` text default null,
`status` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled','Processing') default 'Pending',
`attachment` varchar(100) NULL,
CONSTRAINT `Fk_EmployeeLeaves_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeLeaves_LeaveTypes` FOREIGN KEY (`leave_type`) REFERENCES `LeaveTypes` (`id`),
CONSTRAINT `Fk_EmployeeLeaves_LeavePeriods` FOREIGN KEY (`leave_period`) REFERENCES `LeavePeriods` (`id`),
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployeeLeaveLog` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee_leave` bigint(20) NOT NULL,
`user_id` bigint(20) NULL,
`data` varchar(500) NOT NULL,
`status_from` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled','Processing') default 'Pending',
`status_to` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled','Processing') default 'Pending',
`created` timestamp default '0000-00-00 00:00:00',
CONSTRAINT `Fk_EmployeeLeaveLog_EmployeeLeaves` FOREIGN KEY (`employee_leave`) REFERENCES `EmployeeLeaves` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeLeaveLog_Users` FOREIGN KEY (`user_id`) REFERENCES `Users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployeeLeaveDays` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee_leave` bigint(20) NOT NULL,
`leave_date` date default '0000-00-00',
`leave_type` enum('Full Day','Half Day - Morning','Half Day - Afternoon','1 Hour - Morning','2 Hours - Morning','3 Hours - Morning','1 Hour - Afternoon','2 Hours - Afternoon','3 Hours - Afternoon') NOT NULL,
CONSTRAINT `Fk_EmployeeLeaveDays_EmployeeLeaves` FOREIGN KEY (`employee_leave`) REFERENCES `EmployeeLeaves` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Files` ( create table `Files` (
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL, `name` varchar(100) NOT NULL,
`filename` varchar(100) NOT NULL, `filename` varchar(100) NOT NULL,
`employee` bigint(20) NULL, `employee` bigint(20) NULL,
`file_group` varchar(100) NOT NULL, `file_group` varchar(100) NOT NULL,
`size` bigint(20) NULL,
`size_text` varchar(20) NULL,
primary key (`id`), primary key (`id`),
unique key `filename` (`filename`) unique key `filename` (`filename`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
@@ -313,7 +469,7 @@ create table `Projects` (
`client` bigint(20) NULL, `client` bigint(20) NULL,
`details` text default null, `details` text default null,
`created` timestamp default '0000-00-00 00:00:00', `created` timestamp default '0000-00-00 00:00:00',
`status` enum('Active','Inactive') default 'Active', `status` enum('Active','On Hold','Completed', 'Dropped') default 'Active',
CONSTRAINT `Fk_Projects_Client` FOREIGN KEY (`client`) REFERENCES `Clients` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `Fk_Projects_Client` FOREIGN KEY (`client`) REFERENCES `Clients` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
primary key (`id`) primary key (`id`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
@@ -368,9 +524,18 @@ create table `Documents` (
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL, `name` varchar(100) NOT NULL,
`details` text default null, `details` text default null,
`expire_notification` enum('Yes','No') default 'Yes',
`expire_notification_month` enum('Yes','No') default 'Yes',
`expire_notification_week` enum('Yes','No') default 'Yes',
`expire_notification_day` enum('Yes','No') default 'Yes',
`sign` enum('Yes','No') default 'Yes',
`sign_label` VARCHAR(500) default null,
`created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00',
primary key (`id`) primary key (`id`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
create table `EmployeeDocuments` ( create table `EmployeeDocuments` (
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL, `employee` bigint(20) NOT NULL,
@@ -380,8 +545,27 @@ create table `EmployeeDocuments` (
`status` enum('Active','Inactive','Draft') default 'Active', `status` enum('Active','Inactive','Draft') default 'Active',
`details` text default null, `details` text default null,
`attachment` varchar(100) NULL, `attachment` varchar(100) NULL,
`signature` text default null,
`expire_notification_last` int(4) NULL,
CONSTRAINT `Fk_EmployeeDocuments_Documents` FOREIGN KEY (`document`) REFERENCES `Documents` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `Fk_EmployeeDocuments_Documents` FOREIGN KEY (`document`) REFERENCES `Documents` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeDocuments_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `Fk_EmployeeDocuments_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`),
KEY `KEY_EmployeeDocuments_valid_until` (`valid_until`),
KEY `KEY_EmployeeDocuments_valid_until_status` (`valid_until`,`status`,`expire_notification_last`)
) engine=innodb default charset=utf8;
create table `CompanyDocuments` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`details` text default null,
`valid_until` date NULL,
`status` enum('Active','Inactive','Draft') default 'Active',
`notify_employees` enum('Yes','No') default 'Yes',
`attachment` varchar(100) NULL,
`share_departments` varchar(100) NULL,
`share_employees` varchar(100) NULL,
`share_userlevel` varchar(100) NULL,
primary key (`id`) primary key (`id`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
@@ -445,6 +629,8 @@ create table `Reports` (
`query` text default null, `query` text default null,
`paramOrder` varchar(500) NOT NULL, `paramOrder` varchar(500) NOT NULL,
`type` enum('Query','Class') default 'Query', `type` enum('Query','Class') default 'Query',
`report_group` varchar(500) NULL,
`output` varchar(15) NOT NULL default 'CSV',
primary key (`id`), primary key (`id`),
UNIQUE KEY `Reports_Name` (`name`) UNIQUE KEY `Reports_Name` (`name`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
@@ -507,6 +693,7 @@ create table `Notifications` (
`action` text default null, `action` text default null,
`type` varchar(100) NULL, `type` varchar(100) NULL,
`status` enum('Unread','Read') default 'Unread', `status` enum('Unread','Read') default 'Unread',
`employee` bigint(20) NULL,
CONSTRAINT `Fk_Notifications_Users` FOREIGN KEY (`touser`) REFERENCES `Users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `Fk_Notifications_Users` FOREIGN KEY (`touser`) REFERENCES `Users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`), primary key (`id`),
KEY `toUser_time` (`toUser`,`time`), KEY `toUser_time` (`toUser`,`time`),
@@ -522,7 +709,7 @@ create table `Courses` (
`trainer` varchar(300) NULL, `trainer` varchar(300) NULL,
`trainer_info` text default null, `trainer_info` text default null,
`paymentType` enum('Company Sponsored','Paid by Employee') default 'Company Sponsored', `paymentType` enum('Company Sponsored','Paid by Employee') default 'Company Sponsored',
`currency` varchar(3) not null, `currency` varchar(3) null,
`cost` decimal(12,2) DEFAULT 0.00, `cost` decimal(12,2) DEFAULT 0.00,
`status` enum('Active','Inactive') default 'Active', `status` enum('Active','Inactive') default 'Active',
`created` datetime default '0000-00-00 00:00:00', `created` datetime default '0000-00-00 00:00:00',
@@ -545,6 +732,7 @@ create table `TrainingSessions` (
`attachment` varchar(300) NULL, `attachment` varchar(300) NULL,
`created` datetime default '0000-00-00 00:00:00', `created` datetime default '0000-00-00 00:00:00',
`updated` datetime default '0000-00-00 00:00:00', `updated` datetime default '0000-00-00 00:00:00',
`requireProof` enum('Yes','No') default 'Yes',
CONSTRAINT `Fk_TrainingSessions_Courses` FOREIGN KEY (`course`) REFERENCES `Courses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `Fk_TrainingSessions_Courses` FOREIGN KEY (`course`) REFERENCES `Courses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`) primary key (`id`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
@@ -555,7 +743,8 @@ create table `EmployeeTrainingSessions` (
`employee` bigint(20) NOT NULL, `employee` bigint(20) NOT NULL,
`trainingSession` bigint(20) NULL, `trainingSession` bigint(20) NULL,
`feedBack` varchar(1500) NULL, `feedBack` varchar(1500) NULL,
`status` enum('Scheduled','Attended','Not-Attended') default 'Scheduled', `status` enum('Scheduled','Attended','Not-Attended','Completed') default 'Scheduled',
`proof` varchar(300) NULL,
CONSTRAINT `Fk_EmployeeTrainingSessions_TrainingSessions` FOREIGN KEY (`trainingSession`) REFERENCES `TrainingSessions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `Fk_EmployeeTrainingSessions_TrainingSessions` FOREIGN KEY (`trainingSession`) REFERENCES `TrainingSessions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeTrainingSessions_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `Fk_EmployeeTrainingSessions_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`) primary key (`id`)
@@ -604,11 +793,14 @@ create table `EmployeeTravelRecords` (
`travel_date` datetime NULL default '0000-00-00 00:00:00', `travel_date` datetime NULL default '0000-00-00 00:00:00',
`return_date` datetime NULL default '0000-00-00 00:00:00', `return_date` datetime NULL default '0000-00-00 00:00:00',
`details` varchar(500) default null, `details` varchar(500) default null,
`funding` decimal(10,3) NULL,
`currency` bigint(20) NULL,
`attachment1` varchar(100) NULL, `attachment1` varchar(100) NULL,
`attachment2` varchar(100) NULL, `attachment2` varchar(100) NULL,
`attachment3` varchar(100) NULL, `attachment3` varchar(100) NULL,
`created` timestamp NULL default '0000-00-00 00:00:00', `created` timestamp NULL default '0000-00-00 00:00:00',
`updated` timestamp NULL default '0000-00-00 00:00:00', `updated` timestamp NULL default '0000-00-00 00:00:00',
`status` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled','Processing') default 'Pending',
CONSTRAINT `Fk_EmployeeTravelRecords_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `Fk_EmployeeTravelRecords_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`) primary key (`id`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
@@ -646,7 +838,14 @@ create table `CustomFields` (
`display` enum('Form','Table and Form','Hidden') default 'Form', `display` enum('Form','Table and Form','Hidden') default 'Form',
`created` DATETIME default '0000-00-00 00:00:00', `created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00', `updated` DATETIME default '0000-00-00 00:00:00',
primary key (`id`) `field_type` varchar(20) NULL,
`field_label` varchar(50) NULL,
`field_validation` varchar(50) NULL,
`field_options` varchar(500) NULL,
`display_order` int(11) default 0,
`display_section` varchar(50) NULL,
primary key (`id`),
unique key `CustomFields_name` (`type`,`name`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
@@ -710,66 +909,559 @@ create table `EmployeeSalary` (
primary key (`id`) primary key (`id`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
create table `DeductionGroup` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`description` varchar(100) NOT NULL,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Deductions` ( create table `Deductions` (
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL, `name` varchar(100) NOT NULL,
`contributor` enum('Employee','Employer') default NULL, `componentType` varchar(250) NULL,
`type` enum('Fixed','Percentage') default NULL, `component` varchar(250) NULL,
`percentage_type` enum('On Component','On Component Type') default NULL, `payrollColumn` int(11) DEFAULT NULL,
`componentType` bigint(20) NULL,
`component` bigint(20) NULL,
`rangeAmounts` text default null, `rangeAmounts` text default null,
`country` bigint(20) NULL, `deduction_group` bigint(20) NULL,
CONSTRAINT `Fk_Deductions_Country` FOREIGN KEY (`country`) REFERENCES `Country` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `Fk_Deductions_DeductionGroup` FOREIGN KEY (`deduction_group`) REFERENCES `DeductionGroup` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
primary key (`id`) primary key (`id`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
create table `Tax` (
create table `PayrollEmployees` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`pay_frequency` int(11) default null,
`currency` bigint(20) NULL,
`deduction_exemptions` varchar(250) default null,
`deduction_allowed` varchar(250) default null,
`deduction_group` bigint(20) NULL,
CONSTRAINT `Fk_PayrollEmployee_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_PayrollEmployees_DeductionGroup` FOREIGN KEY (`deduction_group`) REFERENCES `DeductionGroup` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
primary key (`id`),
unique key `PayrollEmployees_employee` (`employee`)
) engine=innodb default charset=utf8;
CREATE TABLE `PayrollColumnTemplates` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(50) DEFAULT NULL,
`columns` varchar(500) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB default charset=utf8;
create table `Payroll` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(200) NULL,
`pay_period` bigint(20) NOT NULL,
`department` bigint(20) NOT NULL,
`column_template` bigint(20) NULL,
`columns` varchar(500) DEFAULT NULL,
`date_start` DATE NULL default '0000-00-00',
`date_end` DATE NULL default '0000-00-00',
`status` enum('Draft','Completed','Processing') default 'Draft',
`payslipTemplate` bigint(20) NULL,
primary key (`id`)
) engine=innodb default charset=utf8;
CREATE TABLE `PayrollData` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`payroll` bigint(20) NOT NULL,
`employee` bigint(20) NOT NULL,
`payroll_item` int(11) NOT NULL,
`amount` varchar(25) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `PayrollDataUniqueKey` (`payroll`,`employee`,`payroll_item`),
CONSTRAINT `Fk_PayrollData_Payroll` FOREIGN KEY (`payroll`) REFERENCES `Payroll` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB default charset=utf8;
CREATE TABLE `PayrollColumns` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) DEFAULT NULL,
`calculation_hook` varchar(200) DEFAULT NULL,
`salary_components` varchar(500) DEFAULT NULL,
`deductions` varchar(500) DEFAULT NULL,
`add_columns` varchar(500) DEFAULT NULL,
`sub_columns` varchar(500) DEFAULT NULL,
`colorder` int(11) DEFAULT NULL,
`editable` enum('Yes','No') default 'Yes',
`enabled` enum('Yes','No') default 'Yes',
`default_value` varchar(25) DEFAULT NULL,
`calculation_columns` varchar(500) DEFAULT NULL,
`calculation_function` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB default charset=utf8;
create table `EmployementType` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(250) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Industry` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(250) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `ExperienceLevel` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(250) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `JobFunction` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(250) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EducationLevel` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(250) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Benifits` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(250) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Tags` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(250) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Job` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`title` varchar(200) NOT NULL,
`shortDescription` text DEFAULT NULL,
`description` text DEFAULT NULL,
`requirements` text DEFAULT NULL,
`benefits` text DEFAULT NULL,
`country` bigint(20) DEFAULT NULL,
`company` bigint(20) DEFAULT NULL,
`department` VARCHAR(100) NULL,
`code` VARCHAR(20) NULL,
`employementType` bigint(20) DEFAULT NULL,
`industry` bigint(20) DEFAULT NULL,
`experienceLevel` bigint(20) DEFAULT NULL,
`jobFunction` bigint(20) DEFAULT NULL,
`educationLevel` bigint(20) DEFAULT NULL,
`currency` bigint(20) DEFAULT NULL,
`showSalary` enum('Yes','No') default NULL,
`salaryMin` bigint(20) DEFAULT NULL,
`salaryMax` bigint(20) DEFAULT NULL,
`keywords` text DEFAULT NULL,
`status` enum('Active','On hold','Closed') default NULL,
`closingDate` DATETIME default '0000-00-00 00:00:00',
`attachment` varchar(100) NULL,
`display` varchar(200) NOT NULL,
`postedBy` bigint(20) DEFAULT NULL,
INDEX `Job_status` (`status`),
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Candidates` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`first_name` varchar(100) default '' not null,
`last_name` varchar(100) default '' not null,
`nationality` bigint(20) default null,
`birthday` DATETIME default '0000-00-00 00:00:00',
`gender` enum('Male','Female') default NULL,
`marital_status` enum('Married','Single','Divorced','Widowed','Other') default NULL,
`address1` varchar(100) default '',
`address2` varchar(100) default '',
`city` varchar(150) default '',
`country` char(2) default null,
`province` bigint(20) default null,
`postal_code` varchar(20) default null,
`email` varchar(200) default null,
`home_phone` varchar(50) default null,
`mobile_phone` varchar(50) default null,
`cv_title` varchar(200) default '' not null,
`cv` varchar(150) NULL,
`cvtext` text NULL,
`industry` text DEFAULT NULL,
`profileImage` varchar(150) NULL,
`head_line` text DEFAULT NULL,
`objective` text DEFAULT NULL,
`work_history` text DEFAULT NULL,
`education` text DEFAULT NULL,
`skills` text DEFAULT NULL,
`referees` text DEFAULT NULL,
`linkedInUrl` varchar(500) DEFAULT NULL,
`linkedInData` text DEFAULT NULL,
`totalYearsOfExperience` int(11) default null,
`totalMonthsOfExperience` int(11) default null,
`htmlCVData` longtext DEFAULT NULL,
`generatedCVFile` varchar(150) DEFAULT NULL,
`created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00',
`expectedSalary` int(11) default null,
`preferedPositions` text default null,
`preferedJobtype` varchar(60) default null,
`preferedCountries` text default null,
`tags` text default null,
`notes` text default null,
`calls` text default null,
`age` int(11) default null,
`hash` varchar(100) DEFAULT NULL,
`linkedInProfileLink` varchar(250) DEFAULT NULL,
`linkedInProfileId` varchar(50) DEFAULT NULL,
`facebookProfileLink` varchar(250) DEFAULT NULL,
`facebookProfileId` varchar(50) DEFAULT NULL,
`twitterProfileLink` varchar(250) DEFAULT NULL,
`twitterProfileId` varchar(50) DEFAULT NULL,
`googleProfileLink` varchar(250) DEFAULT NULL,
`googleProfileId` varchar(50) DEFAULT NULL,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Applications` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`job` bigint(20) NOT NULL,
`candidate` bigint(20) DEFAULT NULL,
`created` DATETIME default '0000-00-00 00:00:00',
`referredByEmail` varchar(200) DEFAULT NULL,
`notes` text DEFAULT NULL,
primary key (`id`),
unique key (`job`,`candidate`),
CONSTRAINT `Fk_Applications_Job` FOREIGN KEY (`job`) REFERENCES `Job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_Applications_Candidates` FOREIGN KEY (`candidate`) REFERENCES `Candidates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) engine=innodb default charset=utf8;
create table `Interviews` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`job` bigint(20) NOT NULL,
`candidate` bigint(20) DEFAULT NULL,
`level` varchar(100) DEFAULT NULL,
`created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00',
`scheduled` DATETIME default '0000-00-00 00:00:00',
`location` varchar(500) DEFAULT NULL,
`mapId` bigint(20) NULL,
`status` varchar(100) default null,
`notes` text DEFAULT NULL,
primary key (`id`),
CONSTRAINT `Fk_Interviews_Job` FOREIGN KEY (`job`) REFERENCES `Job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_Interviews_Candidates` FOREIGN KEY (`candidate`) REFERENCES `Candidates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) engine=innodb default charset=utf8;
create table `Calls` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`job` bigint(20) NOT NULL,
`candidate` bigint(20) DEFAULT NULL,
`phone` varchar(20) default null,
`created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00',
`status` varchar(100) default null,
`notes` text DEFAULT NULL,
primary key (`id`),
CONSTRAINT `Fk_Calls_Job` FOREIGN KEY (`job`) REFERENCES `Job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_Calls_Candidates` FOREIGN KEY (`candidate`) REFERENCES `Candidates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) engine=innodb default charset=utf8;
create table `LeaveStartingBalance` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`leave_type` bigint(20) NOT NULL,
`employee` bigint(20) NULL,
`leave_period` bigint(20) NOT NULL,
`amount` decimal(10,3) NOT NULL,
`note` text DEFAULT NULL,
`created` datetime default '0000-00-00 00:00:00',
`updated` datetime default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Crons` (
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL, `name` varchar(100) NOT NULL,
`contributor` enum('Employee','Employer') default NULL, `class` varchar(100) NOT NULL,
`type` enum('Fixed','Percentage') default NULL, `lastrun` DATETIME default '0000-00-00 00:00:00',
`percentage_type` enum('On Component','On Component Type') default NULL, `frequency` int(4) NOT NULL,
`componentType` bigint(20) NULL, `time` varchar(50) NOT NULL,
`component` bigint(20) NULL, `type` enum('Minutely','Hourly','Daily','Weekly','Monthly','Yearly') default 'Hourly',
`rangeAmounts` text default null, `status` enum('Enabled','Disabled') default 'Enabled',
`country` bigint(20) NULL, primary key (`id`),
CONSTRAINT `Fk_Tax_Country` FOREIGN KEY (`country`) REFERENCES `Country` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, key `KEY_Crons_frequency` (`frequency`)
primary key (`id`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
create table `TaxRules` ( create table `Emails` (
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`apply` enum('Yes','No') default 'Yes', `subject` varchar(300) NOT NULL,
`application_type` enum('All','Condition - OR','Condition - AND') default 'All', `toEmail` varchar(300) NOT NULL,
`tax` bigint(20) NOT NULL, `template` text NULL,
`job_title` bigint(20) NULL, `params` text NULL,
`ethnicity` bigint(20) NULL, `cclist` varchar(500) NULL,
`nationality` bigint(20) NULL, `bcclist` varchar(500) NULL,
`immigration_status` bigint(20) NULL, `error` varchar(500) NULL,
`pay_grade` bigint(20) NULL, `created` DATETIME default '0000-00-00 00:00:00',
`country` bigint(20) NULL, `updated` DATETIME default '0000-00-00 00:00:00',
CONSTRAINT `Fk_TaxRules_Tax` FOREIGN KEY (`tax`) REFERENCES `Tax` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, `status` enum('Pending','Sent','Error') default 'Pending',
CONSTRAINT `Fk_TaxRules_Country` FOREIGN KEY (`country`) REFERENCES `Country` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, primary key (`id`),
primary key (`id`) key `KEY_Emails_status` (`status`),
key `KEY_Emails_created` (`created`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
create table `DeductionRules` (
create table `ExpensesCategories` (
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`apply` enum('Yes','No') default 'Yes', `name` varchar(500) NOT NULL,
`application_type` enum('All','Condition - OR','Condition - AND') default 'All', `created` timestamp NULL default '0000-00-00 00:00:00',
`deduction` bigint(20) NOT NULL, `updated` timestamp NULL default '0000-00-00 00:00:00',
`job_title` bigint(20) NULL, `pre_approve` enum('Yes','No') default 'Yes',
`ethnicity` bigint(20) NULL, primary key (`id`)
`nationality` bigint(20) NULL, ) engine=innodb default charset=utf8;
`immigration_status` bigint(20) NULL,
`pay_grade` bigint(20) NULL, create table `ExpensesPaymentMethods` (
`country` bigint(20) NULL, `id` bigint(20) NOT NULL AUTO_INCREMENT,
CONSTRAINT `Fk_DeductionRules_Deductions` FOREIGN KEY (`deduction`) REFERENCES `Deductions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, `name` varchar(500) NOT NULL,
CONSTRAINT `Fk_DeductionRules_Country` FOREIGN KEY (`country`) REFERENCES `Country` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, `created` timestamp NULL default '0000-00-00 00:00:00',
`updated` timestamp NULL default '0000-00-00 00:00:00',
primary key (`id`) primary key (`id`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
create table `EmployeeExpenses` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`expense_date` date NULL default '0000-00-00',
`payment_method` bigint(20) NOT NULL,
`transaction_no` varchar(300) NOT NULL,
`payee` varchar(500) NOT NULL,
`category` bigint(20) NOT NULL,
`notes` text,
`amount` decimal(10,3) NULL,
`currency` bigint(20) NULL,
`attachment1` varchar(100) NULL,
`attachment2` varchar(100) NULL,
`attachment3` varchar(100) NULL,
`created` timestamp NULL default '0000-00-00 00:00:00',
`updated` timestamp NULL default '0000-00-00 00:00:00',
`status` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled','Processing') default 'Pending',
CONSTRAINT `Fk_EmployeeExpenses_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeExpenses_pm` FOREIGN KEY (`payment_method`) REFERENCES `ExpensesPaymentMethods` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeExpenses_category` FOREIGN KEY (`category`) REFERENCES `ExpensesCategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Timezones` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) not null default '',
`details` varchar(255) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployeeDataHistory` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`type` varchar(100) not null,
`employee` bigint(20) NOT NULL,
`field` varchar(100) not null,
`old_value` varchar(500) default null,
`new_value` varchar(500) default null,
`description` varchar(800) default null,
`user` bigint(20) NULL,
`updated` timestamp default '0000-00-00 00:00:00',
`created` timestamp default '0000-00-00 00:00:00',
CONSTRAINT `Fk_EmployeeDataHistory_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeDataHistory_Users` FOREIGN KEY (`user`) REFERENCES `Users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployeeAttendanceSheets` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`date_start` date NOT NULL,
`date_end` date NOT NULL,
`status` enum('Approved','Pending','Rejected','Submitted') default 'Pending',
CONSTRAINT `Fk_EmployeeAttendanceSheets_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
UNIQUE KEY `EmployeeAttendanceSheetsKey` (`employee`,`date_start`,`date_end`),
KEY `EmployeeAttendanceSheets_date_end` (`date_end`),
primary key (`id`)
) engine=innodb default charset=utf8;
create table `CustomFieldValues` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`type` varchar(20) not null,
`name` varchar(60) not null,
`object_id` varchar(60) not null,
`value` text default NULL,
`updated` timestamp default '0000-00-00 00:00:00',
`created` timestamp default '0000-00-00 00:00:00',
primary key (`id`),
UNIQUE key `CustomFields_type_name_object_id` (`type`,`name`,`object_id`),
INDEX `CustomFields_type_object_id` (`type`,`object_id`)
) engine=innodb default charset=utf8;
create table `DataImport` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(60) not null,
`dataType` varchar(60) not null,
`details` text default NULL,
`columns` text default NULL,
`updated` timestamp default '0000-00-00 00:00:00',
`created` timestamp default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `DataImportFiles` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(60) not null,
`data_import_definition` varchar(200) not null,
`status` varchar(15) null,
`file` varchar(100) null,
`details` text default NULL,
`updated` timestamp default '0000-00-00 00:00:00',
`created` timestamp default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `UserReports` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`details` text default null,
`parameters` text default null,
`query` text default null,
`paramOrder` varchar(500) NOT NULL,
`type` enum('Query','Class') default 'Query',
`report_group` varchar(500) NULL,
`output` varchar(15) NOT NULL default 'CSV',
primary key (`id`),
UNIQUE KEY `UserReports_Name` (`name`)
) engine=innodb default charset=utf8;
create table `ReportFiles` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NULL,
`name` varchar(100) NOT NULL,
`attachment` varchar(100) NOT NULL,
`created` timestamp default '0000-00-00 00:00:00',
unique key `ReportFiles_attachment` (`attachment`),
primary key (`id`)
) engine=innodb default charset=utf8;
create table `PayslipTemplates` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`data` longtext NULL,
`status` enum('Show','Hide') default 'Show',
`created` timestamp default '0000-00-00 00:00:00',
`updated` timestamp default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployeeApprovals` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`type` varchar(100) NOT NULL,
`element` bigint(20) NOT NULL,
`approver` bigint(20) NULL,
`level` int(11) default 0,
`status` int(11) default 0,
`active` int(11) default 0,
`created` timestamp default '0000-00-00 00:00:00',
`updated` timestamp default '0000-00-00 00:00:00',
UNIQUE key `EmployeeApprovals_type_element_level` (`type`,`element`,`level`),
INDEX `EmployeeApprovals_type_element_status_level` (`type`,`element`,`status`,`level`),
INDEX `EmployeeApprovals_type_element` (`type`,`element`),
INDEX `EmployeeApprovals_type` (`type`),
primary key (`id`)
) engine=innodb default charset=utf8;
create table `StatusChangeLogs` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`type` varchar(100) NOT NULL,
`element` bigint(20) NOT NULL,
`user_id` bigint(20) NULL,
`data` varchar(500) NOT NULL,
`status_from` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled','Processing') default 'Pending',
`status_to` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled','Processing') default 'Pending',
`created` timestamp default '0000-00-00 00:00:00',
INDEX `EmployeeApprovals_type_element` (`type`,`element`),
primary key (`id`)
) engine=innodb default charset=utf8;
create table `OvertimeCategories` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(500) NOT NULL,
`created` timestamp NULL default '0000-00-00 00:00:00',
`updated` timestamp NULL default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployeeOvertime` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`start_time` timestamp NULL default '0000-00-00 00:00:00',
`end_time` timestamp NULL default '0000-00-00 00:00:00',
`category` bigint(20) NOT NULL,
`project` bigint(20) NULL,
`notes` text NULL,
`created` timestamp NULL default '0000-00-00 00:00:00',
`updated` timestamp NULL default '0000-00-00 00:00:00',
`status` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled','Processing') default 'Pending',
CONSTRAINT `Fk_EmployeeOvertime_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeOvertime_Category` FOREIGN KEY (`category`) REFERENCES `OvertimeCategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Forms` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`description` varchar(500) NULL,
`items` text NULL,
`created` timestamp NULL default '0000-00-00 00:00:00',
`updated` timestamp NULL default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployeeForms` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`form` bigint(20) NOT NULL,
`status` enum('Pending','Completed') default 'Pending',
`created` timestamp NULL default '0000-00-00 00:00:00',
`updated` timestamp NULL default '0000-00-00 00:00:00',
CONSTRAINT `Fk_EmployeeForms_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeForms_Forms` FOREIGN KEY (`form`) REFERENCES `Forms` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Migrations` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`file` varchar(50) NOT NULL,
`version` int(11) NOT NULL,
`created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00',
`status` enum('Pending','Up','Down','UpError','DownError') default 'Pending',
`last_error` varchar(500) NULL,
primary key (`id`),
unique key `KEY_Migrations_file` (`file`),
index `KEY_Migrations_status` (`status`),
index `KEY_Migrations_version` (`version`)
) engine=innodb default charset=utf8;

View File

@@ -0,0 +1,145 @@
ALTER TABLE EmployeeTravelRecords ADD COLUMN `funding` decimal(10,3) NULL AFTER `details`;
ALTER TABLE EmployeeTravelRecords ADD COLUMN `currency` bigint(20) NULL AFTER `funding`;
ALTER TABLE EmployeeTravelRecords ADD COLUMN `status` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending';
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`) VALUES
('Travel Request Report', 'This report list employees travel requests for a specified period',
'[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}],\r\n[ "status", {"label":"Status","type":"select","source":[["NULL","All Statuses"],["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"],["Cancellation Requested","Cancellation Requested"],["Cancelled","Cancelled"]]}]\r\n]',
'TravelRequestReport',
'["employee","date_start","date_end","status"]', 'Class');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Travel: Pre-Approve Travel Request', '0', '','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Attendance: Use Department Time Zone', '0', '','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
UPDATE `Settings` set value = '1' where name = 'System: Reset Modules and Permissions';
ALTER TABLE `CompanyStructures` ADD COLUMN `timezone` varchar(100) not null default 'Europe/London';
create table `Timezones` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) not null default '',
`details` varchar(255) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
INSERT INTO `Timezones`(`id`, `name`, `details`) VALUES
(1, 'Pacific/Midway', '(GMT-11:00) Midway Island'),
(2, 'US/Samoa', '(GMT-11:00) Samoa'),
(3, 'US/Hawaii', '(GMT-10:00) Hawaii'),
(4, 'US/Alaska', '(GMT-09:00) Alaska'),
(5, 'US/Pacific', '(GMT-08:00) Pacific Time (US &amp; Canada)'),
(6, 'America/Tijuana', '(GMT-08:00) Tijuana'),
(7, 'US/Arizona', '(GMT-07:00) Arizona'),
(8, 'US/Mountain', '(GMT-07:00) Mountain Time (US &amp; Canada)'),
(9, 'America/Chihuahua', '(GMT-07:00) Chihuahua'),
(10, 'America/Mazatlan', '(GMT-07:00) Mazatlan'),
(11, 'America/Mexico_City', '(GMT-06:00) Mexico City'),
(12, 'America/Monterrey', '(GMT-06:00) Monterrey'),
(13, 'Canada/Saskatchewan', '(GMT-06:00) Saskatchewan'),
(14, 'US/Central', '(GMT-06:00) Central Time (US &amp; Canada)'),
(15, 'US/Eastern', '(GMT-05:00) Eastern Time (US &amp; Canada)'),
(16, 'US/East-Indiana', '(GMT-05:00) Indiana (East)'),
(17, 'America/Bogota', '(GMT-05:00) Bogota'),
(18, 'America/Lima', '(GMT-05:00) Lima'),
(19, 'America/Caracas', '(GMT-04:30) Caracas'),
(20, 'Canada/Atlantic', '(GMT-04:00) Atlantic Time (Canada)'),
(21, 'America/La_Paz', '(GMT-04:00) La Paz'),
(22, 'America/Santiago', '(GMT-04:00) Santiago'),
(23, 'Canada/Newfoundland', '(GMT-03:30) Newfoundland'),
(24, 'America/Buenos_Aires', '(GMT-03:00) Buenos Aires'),
(25, 'Greenland', '(GMT-03:00) Greenland'),
(26, 'Atlantic/Stanley', '(GMT-02:00) Stanley'),
(27, 'Atlantic/Azores', '(GMT-01:00) Azores'),
(28, 'Atlantic/Cape_Verde', '(GMT-01:00) Cape Verde Is.'),
(29, 'Africa/Casablanca', '(GMT) Casablanca'),
(30, 'Europe/Dublin', '(GMT) Dublin'),
(31, 'Europe/Lisbon', '(GMT) Lisbon'),
(32, 'Europe/London', '(GMT) London'),
(33, 'Africa/Monrovia', '(GMT) Monrovia'),
(34, 'Europe/Amsterdam', '(GMT+01:00) Amsterdam'),
(35, 'Europe/Belgrade', '(GMT+01:00) Belgrade'),
(36, 'Europe/Berlin', '(GMT+01:00) Berlin'),
(37, 'Europe/Bratislava', '(GMT+01:00) Bratislava'),
(38, 'Europe/Brussels', '(GMT+01:00) Brussels'),
(39, 'Europe/Budapest', '(GMT+01:00) Budapest'),
(40, 'Europe/Copenhagen', '(GMT+01:00) Copenhagen'),
(41, 'Europe/Ljubljana', '(GMT+01:00) Ljubljana'),
(42, 'Europe/Madrid', '(GMT+01:00) Madrid'),
(43, 'Europe/Paris', '(GMT+01:00) Paris'),
(44, 'Europe/Prague', '(GMT+01:00) Prague'),
(45, 'Europe/Rome', '(GMT+01:00) Rome'),
(46, 'Europe/Sarajevo', '(GMT+01:00) Sarajevo'),
(47, 'Europe/Skopje', '(GMT+01:00) Skopje'),
(48, 'Europe/Stockholm', '(GMT+01:00) Stockholm'),
(49, 'Europe/Vienna', '(GMT+01:00) Vienna'),
(50, 'Europe/Warsaw', '(GMT+01:00) Warsaw'),
(51, 'Europe/Zagreb', '(GMT+01:00) Zagreb'),
(52, 'Europe/Athens', '(GMT+02:00) Athens'),
(53, 'Europe/Bucharest', '(GMT+02:00) Bucharest'),
(54, 'Africa/Cairo', '(GMT+02:00) Cairo'),
(55, 'Africa/Harare', '(GMT+02:00) Harare'),
(56, 'Europe/Helsinki', '(GMT+02:00) Helsinki'),
(57, 'Europe/Istanbul', '(GMT+02:00) Istanbul'),
(58, 'Asia/Jerusalem', '(GMT+02:00) Jerusalem'),
(59, 'Europe/Kiev', '(GMT+02:00) Kyiv'),
(60, 'Europe/Minsk', '(GMT+02:00) Minsk'),
(61, 'Europe/Riga', '(GMT+02:00) Riga'),
(62, 'Europe/Sofia', '(GMT+02:00) Sofia'),
(63, 'Europe/Tallinn', '(GMT+02:00) Tallinn'),
(64, 'Europe/Vilnius', '(GMT+02:00) Vilnius'),
(65, 'Asia/Baghdad', '(GMT+03:00) Baghdad'),
(66, 'Asia/Kuwait', '(GMT+03:00) Kuwait'),
(67, 'Africa/Nairobi', '(GMT+03:00) Nairobi'),
(68, 'Asia/Riyadh', '(GMT+03:00) Riyadh'),
(69, 'Europe/Moscow', '(GMT+03:00) Moscow'),
(70, 'Asia/Tehran', '(GMT+03:30) Tehran'),
(71, 'Asia/Baku', '(GMT+04:00) Baku'),
(72, 'Europe/Volgograd', '(GMT+04:00) Volgograd'),
(73, 'Asia/Muscat', '(GMT+04:00) Muscat'),
(74, 'Asia/Tbilisi', '(GMT+04:00) Tbilisi'),
(75, 'Asia/Yerevan', '(GMT+04:00) Yerevan'),
(76, 'Asia/Kabul', '(GMT+04:30) Kabul'),
(77, 'Asia/Karachi', '(GMT+05:00) Karachi'),
(78, 'Asia/Tashkent', '(GMT+05:00) Tashkent'),
(79, 'Asia/Kolkata', '(GMT+05:30) Kolkata'),
(80, 'Asia/Kathmandu', '(GMT+05:45) Kathmandu'),
(81, 'Asia/Yekaterinburg', '(GMT+06:00) Ekaterinburg'),
(82, 'Asia/Almaty', '(GMT+06:00) Almaty'),
(83, 'Asia/Dhaka', '(GMT+06:00) Dhaka'),
(84, 'Asia/Novosibirsk', '(GMT+07:00) Novosibirsk'),
(85, 'Asia/Bangkok', '(GMT+07:00) Bangkok'),
(86, 'Asia/Jakarta', '(GMT+07:00) Jakarta'),
(87, 'Asia/Krasnoyarsk', '(GMT+08:00) Krasnoyarsk'),
(88, 'Asia/Chongqing', '(GMT+08:00) Chongqing'),
(89, 'Asia/Hong_Kong', '(GMT+08:00) Hong Kong'),
(90, 'Asia/Kuala_Lumpur', '(GMT+08:00) Kuala Lumpur'),
(91, 'Australia/Perth', '(GMT+08:00) Perth'),
(92, 'Asia/Singapore', '(GMT+08:00) Singapore'),
(93, 'Asia/Taipei', '(GMT+08:00) Taipei'),
(94, 'Asia/Ulaanbaatar', '(GMT+08:00) Ulaan Bataar'),
(95, 'Asia/Urumqi', '(GMT+08:00) Urumqi'),
(96, 'Asia/Irkutsk', '(GMT+09:00) Irkutsk'),
(97, 'Asia/Seoul', '(GMT+09:00) Seoul'),
(98, 'Asia/Tokyo', '(GMT+09:00) Tokyo'),
(99, 'Australia/Adelaide', '(GMT+09:30) Adelaide'),
(100, 'Australia/Darwin', '(GMT+09:30) Darwin'),
(101, 'Asia/Yakutsk', '(GMT+10:00) Yakutsk'),
(102, 'Australia/Brisbane', '(GMT+10:00) Brisbane'),
(103, 'Australia/Canberra', '(GMT+10:00) Canberra'),
(104, 'Pacific/Guam', '(GMT+10:00) Guam'),
(105, 'Australia/Hobart', '(GMT+10:00) Hobart'),
(106, 'Australia/Melbourne', '(GMT+10:00) Melbourne'),
(107, 'Pacific/Port_Moresby', '(GMT+10:00) Port Moresby'),
(108, 'Australia/Sydney', '(GMT+10:00) Sydney'),
(109, 'Asia/Vladivostok', '(GMT+11:00) Vladivostok'),
(110, 'Asia/Magadan', '(GMT+12:00) Magadan'),
(111, 'Pacific/Auckland', '(GMT+12:00) Auckland'),
(112, 'Pacific/Fiji', '(GMT+12:00) Fiji');

View File

@@ -0,0 +1,586 @@
ALTER table `Reports` ADD COLUMN `report_group` varchar(500) NULL;
ALTER table `Employees` ADD COLUMN `indirect_supervisors` VARCHAR(250) default null after `supervisor`;
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Leave: Allow Indirect Admins to Approve', '0', 'Allow indirect admins to approve leave requests','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('System: Default Country', '0', 'Set the default Country','[ "value", {"label":"Country","type":"select2","remote-source":["Country","code","name"]}]');
UPDATE Reports set report_group = 'Employee Information' where name = 'Employee Details Report';
UPDATE Reports set report_group = 'Leave Management' where name = 'Employee Leaves Report';
UPDATE Reports set report_group = 'Time Management' where name = 'Employee Time Entry Report';
UPDATE Reports set report_group = 'Time Management' where name = 'Employee Attendance Report';
UPDATE Reports set report_group = 'Time Management' where name = 'Employee Time Tracking Report';
UPDATE Reports set report_group = 'Employee Information' where name = 'Active Employee Report';
UPDATE Reports set report_group = 'Employee Information' where name = 'New Hires Employee Report';
UPDATE Reports set report_group = 'Employee Information' where name = 'Terminated Employee Report';
UPDATE Reports set report_group = 'Leave Management' where name = 'Employee Leave Entitlement';
UPDATE Reports set report_group = 'Travel and Expense Management' where name = 'Travel Request Report';
UPDATE Reports set report_group = 'Travel and Expense Management' where name = 'Expense Report';
INSERT INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
('Employee Time Sheet Report', 'This report list all employee time sheets by employee and date range', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}],\r\n[ "status", {"label":"Status","allow-null":true,"null-label":"All Status","type":"select","source":[["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"]]}]\r\n]', 'EmployeeTimeSheetData', '["employee","date_start","date_end","status"]', 'Class','Time Management');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Files: Upload Files to S3', '0', '','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
('Files: Amazon S3 Key for File Upload', '', 'Please provide S3 Key for uploading files',''),
('Files: Amazone S3 Secret for File Upload', '', 'Please provide S3 Secret for uploading files',''),
('Files: S3 Bucket', '', 'Please provide S3 Bucket name for uploading files',''),
('Files: S3 Web Url', '', 'Please provide Url to the s3 bucket','');
create table `Crons` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`class` varchar(100) NOT NULL,
`lastrun` DATETIME default '0000-00-00 00:00:00',
`frequency` int(4) NOT NULL,
`time` varchar(50) NOT NULL,
`type` enum('Minutely','Hourly','Daily','Weekly','Monthly','Yearly') default 'Hourly',
`status` enum('Enabled','Disabled') default 'Enabled',
primary key (`id`),
key `KEY_Crons_frequency` (`frequency`)
) engine=innodb default charset=utf8;
INSERT INTO `Crons` (`name`,`class`, `lastrun`, `frequency`, `time`, `type`, `status`) VALUES
('Email Sender Task', 'EmailSenderTask', NULL, 1, 1, 'Minutely', 'Enabled'),
('Document Expire Alert', 'DocumentExpiryNotificationTask', NULL, 1, 1, 'Minutely', 'Enabled');
create table `LeaveTypes` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`supervisor_leave_assign` enum('Yes','No') default 'Yes',
`employee_can_apply` enum('Yes','No') default 'Yes',
`apply_beyond_current` enum('Yes','No') default 'Yes',
`leave_accrue` enum('No','Yes') default 'No',
`carried_forward` enum('No','Yes') default 'No',
`default_per_year` decimal(10,3) NOT NULL,
`carried_forward_percentage` int(11) NULL default 0,
`carried_forward_leave_availability` int(11) NULL default 365,
`propotionate_on_joined_date` enum('No','Yes') default 'No',
`send_notification_emails` enum('Yes','No') default 'Yes',
`leave_group` bigint(20) NULL,
`leave_color` varchar(10) NULL,
`max_carried_forward_amount` int(11) NULL default 0,
primary key (`id`),
unique key (`name`)
) engine=innodb default charset=utf8;
create table `LeaveRules` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`leave_type` bigint(20) NOT NULL,
`job_title` bigint(20) NULL,
`employment_status` bigint(20) NULL,
`employee` bigint(20) NULL,
`supervisor_leave_assign` enum('Yes','No') default 'Yes',
`employee_can_apply` enum('Yes','No') default 'Yes',
`apply_beyond_current` enum('Yes','No') default 'Yes',
`leave_accrue` enum('No','Yes') default 'No',
`carried_forward` enum('No','Yes') default 'No',
`default_per_year` decimal(10,3) NOT NULL,
`carried_forward_percentage` int(11) NULL default 0,
`carried_forward_leave_availability` int(11) NULL default 365,
`propotionate_on_joined_date` enum('No','Yes') default 'No',
`leave_group` bigint(20) NULL,
`max_carried_forward_amount` int(11) NULL default 0,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `LeaveGroups` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`details` text default null,
`created` timestamp NULL default '0000-00-00 00:00:00',
`updated` timestamp NULL default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `LeaveGroupEmployees` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`leave_group` bigint(20) NOT NULL,
`created` timestamp NULL default '0000-00-00 00:00:00',
`updated` timestamp NULL default '0000-00-00 00:00:00',
CONSTRAINT `Fk_LeaveGroupEmployees_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_LeaveGroupEmployees_LeaveGroups` FOREIGN KEY (`leave_group`) REFERENCES `LeaveGroups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`),
unique key `LeaveGroupEmployees_employee` (`employee`)
) engine=innodb default charset=utf8;
create table `LeavePeriods` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`date_start` date default '0000-00-00',
`date_end` date default '0000-00-00',
`status` enum('Active','Inactive') default 'Inactive',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `WorkDays` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`status` enum('Full Day','Half Day','Non-working Day') default 'Full Day',
`country` bigint(20) DEFAULT NULL,
primary key (`id`),
unique key `workdays_name_country` (`name`,`country`)
) engine=innodb default charset=utf8;
create table `HoliDays` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`dateh` date default '0000-00-00',
`status` enum('Full Day','Half Day') default 'Full Day',
`country` bigint(20) DEFAULT NULL,
primary key (`id`),
unique key `holidays_dateh_country` (`dateh`,`country`)
) engine=innodb default charset=utf8;
create table `EmployeeLeaves` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`leave_type` bigint(20) NOT NULL,
`leave_period` bigint(20) NOT NULL,
`date_start` date default '0000-00-00',
`date_end` date default '0000-00-00',
`details` text default null,
`status` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending',
`attachment` varchar(100) NULL,
CONSTRAINT `Fk_EmployeeLeaves_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeLeaves_LeaveTypes` FOREIGN KEY (`leave_type`) REFERENCES `LeaveTypes` (`id`),
CONSTRAINT `Fk_EmployeeLeaves_LeavePeriods` FOREIGN KEY (`leave_period`) REFERENCES `LeavePeriods` (`id`),
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployeeLeaveLog` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee_leave` bigint(20) NOT NULL,
`user_id` bigint(20) NULL,
`data` varchar(500) NOT NULL,
`status_from` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending',
`status_to` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending',
`created` timestamp default '0000-00-00 00:00:00',
CONSTRAINT `Fk_EmployeeLeaveLog_EmployeeLeaves` FOREIGN KEY (`employee_leave`) REFERENCES `EmployeeLeaves` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeLeaveLog_Users` FOREIGN KEY (`user_id`) REFERENCES `Users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployeeLeaveDays` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee_leave` bigint(20) NOT NULL,
`leave_date` date default '0000-00-00',
`leave_type` enum('Full Day','Half Day - Morning','Half Day - Afternoon','1 Hour - Morning','2 Hours - Morning','3 Hours - Morning','1 Hour - Afternoon','2 Hours - Afternoon','3 Hours - Afternoon') NOT NULL,
CONSTRAINT `Fk_EmployeeLeaveDays_EmployeeLeaves` FOREIGN KEY (`employee_leave`) REFERENCES `EmployeeLeaves` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Documents` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`details` text default null,
`expire_notification` enum('Yes','No') default 'Yes',
`expire_notification_month` enum('Yes','No') default 'Yes',
`expire_notification_week` enum('Yes','No') default 'Yes',
`expire_notification_day` enum('Yes','No') default 'Yes',
`sign` enum('Yes','No') default 'Yes',
`sign_label` VARCHAR(500) default null,
`created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployeeDocuments` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`document` bigint(20) NULL,
`date_added` date NOT NULL,
`valid_until` date NOT NULL,
`status` enum('Active','Inactive','Draft') default 'Active',
`details` text default null,
`attachment` varchar(100) NULL,
`signature` text default null,
`expire_notification_last` int(4) NULL,
CONSTRAINT `Fk_EmployeeDocuments_Documents` FOREIGN KEY (`document`) REFERENCES `Documents` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeDocuments_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`),
KEY `KEY_EmployeeDocuments_valid_until` (`valid_until`),
KEY `KEY_EmployeeDocuments_valid_until_status` (`valid_until`,`status`,`expire_notification_last`)
) engine=innodb default charset=utf8;
create table `CompanyDocuments` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`details` text default null,
`valid_until` date NOT NULL,
`status` enum('Active','Inactive','Draft') default 'Active',
`notify_employees` enum('Yes','No') default 'Yes',
`attachment` varchar(100) NULL,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Courses` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`code` varchar(300) NOT NULL,
`name` varchar(300) NOT NULL,
`description` text default null,
`coordinator` bigint(20) NULL,
`trainer` varchar(300) NULL,
`trainer_info` text default null,
`paymentType` enum('Company Sponsored','Paid by Employee') default 'Company Sponsored',
`currency` varchar(3) null,
`cost` decimal(12,2) DEFAULT 0.00,
`status` enum('Active','Inactive') default 'Active',
`created` datetime default '0000-00-00 00:00:00',
`updated` datetime default '0000-00-00 00:00:00',
CONSTRAINT `Fk_Courses_Employees` FOREIGN KEY (`coordinator`) REFERENCES `Employees` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `TrainingSessions` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(300) NOT NULL,
`course` bigint(20) NOT NULL,
`description` text default null,
`scheduled` datetime default '0000-00-00 00:00:00',
`dueDate` datetime default '0000-00-00 00:00:00',
`deliveryMethod` enum('Classroom','Self Study','Online') default 'Classroom',
`deliveryLocation` varchar(500) NULL,
`status` enum('Pending','Approved','Completed','Cancelled') default 'Pending',
`attendanceType` enum('Sign Up','Assign') default 'Sign Up',
`attachment` varchar(300) NULL,
`created` datetime default '0000-00-00 00:00:00',
`updated` datetime default '0000-00-00 00:00:00',
`requireProof` enum('Yes','No') default 'Yes',
CONSTRAINT `Fk_TrainingSessions_Courses` FOREIGN KEY (`course`) REFERENCES `Courses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployeeTrainingSessions` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`trainingSession` bigint(20) NULL,
`feedBack` varchar(1500) NULL,
`status` enum('Scheduled','Attended','Not-Attended','Completed') default 'Scheduled',
`proof` varchar(300) NULL,
CONSTRAINT `Fk_EmployeeTrainingSessions_TrainingSessions` FOREIGN KEY (`trainingSession`) REFERENCES `TrainingSessions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeTrainingSessions_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployementType` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(250) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Industry` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(250) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `ExperienceLevel` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(250) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `JobFunction` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(250) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EducationLevel` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(250) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Benifits` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(250) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Tags` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(250) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Job` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`title` varchar(200) NOT NULL,
`shortDescription` text DEFAULT NULL,
`description` text DEFAULT NULL,
`requirements` text DEFAULT NULL,
`benefits` text DEFAULT NULL,
`country` bigint(20) DEFAULT NULL,
`company` bigint(20) DEFAULT NULL,
`department` VARCHAR(100) NULL,
`code` VARCHAR(20) NULL,
`employementType` bigint(20) DEFAULT NULL,
`industry` bigint(20) DEFAULT NULL,
`experienceLevel` bigint(20) DEFAULT NULL,
`jobFunction` bigint(20) DEFAULT NULL,
`educationLevel` bigint(20) DEFAULT NULL,
`currency` bigint(20) DEFAULT NULL,
`showSalary` enum('Yes','No') default NULL,
`salaryMin` bigint(20) DEFAULT NULL,
`salaryMax` bigint(20) DEFAULT NULL,
`keywords` text DEFAULT NULL,
`status` enum('Active','On hold','Closed') default NULL,
`closingDate` DATETIME default '0000-00-00 00:00:00',
`attachment` varchar(100) NULL,
`display` varchar(200) NOT NULL,
`postedBy` bigint(20) DEFAULT NULL,
INDEX `Job_status` (`status`),
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Candidates` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`first_name` varchar(100) default '' not null,
`last_name` varchar(100) default '' not null,
`nationality` bigint(20) default null,
`birthday` DATETIME default '0000-00-00 00:00:00',
`gender` enum('Male','Female') default NULL,
`marital_status` enum('Married','Single','Divorced','Widowed','Other') default NULL,
`address1` varchar(100) default '',
`address2` varchar(100) default '',
`city` varchar(150) default '',
`country` char(2) default null,
`province` bigint(20) default null,
`postal_code` varchar(20) default null,
`email` varchar(200) default null,
`home_phone` varchar(50) default null,
`mobile_phone` varchar(50) default null,
`cv_title` varchar(200) default '' not null,
`cv` varchar(150) NULL,
`cvtext` text NULL,
`industry` text DEFAULT NULL,
`profileImage` varchar(150) NULL,
`head_line` text DEFAULT NULL,
`objective` text DEFAULT NULL,
`work_history` text DEFAULT NULL,
`education` text DEFAULT NULL,
`skills` text DEFAULT NULL,
`referees` text DEFAULT NULL,
`linkedInUrl` varchar(500) DEFAULT NULL,
`linkedInData` text DEFAULT NULL,
`totalYearsOfExperience` int(11) default null,
`totalMonthsOfExperience` int(11) default null,
`htmlCVData` longtext DEFAULT NULL,
`generatedCVFile` varchar(150) DEFAULT NULL,
`created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00',
`expectedSalary` int(11) default null,
`preferedPositions` text default null,
`preferedJobtype` varchar(60) default null,
`preferedCountries` text default null,
`tags` text default null,
`notes` text default null,
`calls` text default null,
`age` int(11) default null,
`hash` varchar(100) DEFAULT NULL,
`linkedInProfileLink` varchar(250) DEFAULT NULL,
`linkedInProfileId` varchar(50) DEFAULT NULL,
`facebookProfileLink` varchar(250) DEFAULT NULL,
`facebookProfileId` varchar(50) DEFAULT NULL,
`twitterProfileLink` varchar(250) DEFAULT NULL,
`twitterProfileId` varchar(50) DEFAULT NULL,
`googleProfileLink` varchar(250) DEFAULT NULL,
`googleProfileId` varchar(50) DEFAULT NULL,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Applications` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`job` bigint(20) NOT NULL,
`candidate` bigint(20) DEFAULT NULL,
`created` DATETIME default '0000-00-00 00:00:00',
`referredByEmail` varchar(200) DEFAULT NULL,
`notes` text DEFAULT NULL,
primary key (`id`),
unique key (`job`,`candidate`),
CONSTRAINT `Fk_Applications_Job` FOREIGN KEY (`job`) REFERENCES `Job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_Applications_Candidates` FOREIGN KEY (`candidate`) REFERENCES `Candidates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) engine=innodb default charset=utf8;
create table `Interviews` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`job` bigint(20) NOT NULL,
`candidate` bigint(20) DEFAULT NULL,
`level` varchar(100) DEFAULT NULL,
`created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00',
`scheduled` DATETIME default '0000-00-00 00:00:00',
`location` varchar(500) DEFAULT NULL,
`mapId` bigint(20) NULL,
`status` varchar(100) default null,
`notes` text DEFAULT NULL,
primary key (`id`),
CONSTRAINT `Fk_Interviews_Job` FOREIGN KEY (`job`) REFERENCES `Job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_Interviews_Candidates` FOREIGN KEY (`candidate`) REFERENCES `Candidates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) engine=innodb default charset=utf8;
create table `Calls` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`job` bigint(20) NOT NULL,
`candidate` bigint(20) DEFAULT NULL,
`phone` varchar(20) default null,
`created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00',
`status` varchar(100) default null,
`notes` text DEFAULT NULL,
primary key (`id`),
CONSTRAINT `Fk_Calls_Job` FOREIGN KEY (`job`) REFERENCES `Job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_Calls_Candidates` FOREIGN KEY (`candidate`) REFERENCES `Candidates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) engine=innodb default charset=utf8;
create table `LeaveStartingBalance` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`leave_type` bigint(20) NOT NULL,
`employee` bigint(20) NULL,
`leave_period` bigint(20) NOT NULL,
`amount` decimal(10,3) NOT NULL,
`note` text DEFAULT NULL,
`created` datetime default '0000-00-00 00:00:00',
`updated` datetime default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
INSERT INTO `WorkDays` (`id`, `name`, `status`, `country`) VALUES
(1, 'Monday', 'Full Day',NULL),
(2, 'Tuesday', 'Full Day',NULL),
(3, 'Wednesday', 'Full Day',NULL),
(4, 'Thursday', 'Full Day',NULL),
(5, 'Friday', 'Full Day',NULL),
(6, 'Saturday', 'Non-working Day',NULL),
(7, 'Sunday', 'Non-working Day',NULL);
INSERT INTO `Documents` (`id`, `name`, `details`, `expire_notification`, `expire_notification_month`, `expire_notification_week`, `expire_notification_day`,`sign`,`created`, `updated`) VALUES
(1, 'ID Copy', 'Your ID copy','Yes','Yes','Yes','Yes','No',NOW(), NOW()),
(2, 'Degree Certificate', 'Degree Certificate','Yes','Yes','Yes','Yes','Yes',NOW(), NOW()),
(3, 'Driving License', 'Driving License','Yes','Yes','Yes','Yes','Yes',NOW(), NOW());
INSERT INTO `HoliDays` (`id`, `name`, `dateh`, `status`) VALUES
(1, 'New Year''s Day', '2015-01-01', 'Full Day'),
(2, 'Christmas Day', '2015-12-25', 'Full Day');
INSERT INTO `LeavePeriods` (`id`, `name`, `date_start`, `date_end`, `status`) VALUES
(3, 'Year 2015', '2015-01-01', '2015-12-31', 'Active'),
(4, 'Year 2016', '2016-01-01', '2016-12-31', 'Active'),
(5, 'Year 2017', '2017-01-01', '2017-12-31', 'Active');
INSERT INTO `LeaveTypes` (`id`, `name`, `supervisor_leave_assign`, `employee_can_apply`, `apply_beyond_current`, `leave_accrue`, `carried_forward`, `default_per_year`) VALUES
(1, 'Annual leave', 'No', 'Yes', 'No', 'No', 'No', 14),
(2, 'Casual leave', 'Yes', 'Yes', 'No', 'No', 'No', 7),
(3, 'Medical leave', 'Yes', 'Yes', 'Yes', 'No', 'No', 7);
INSERT INTO `Courses` (`id`,`code`, `name`, `description`, `coordinator`, `trainer`, `trainer_info`, `paymentType`, `currency`, `cost`, `status`, `created`, `updated`) VALUES
(1,'C0001', 'Info Marketing', 'Learn how to Create and Outsource Info Marketing Products', 1, 'Tim Jhon', 'Tim Jhon has a background in business management and has been working with small business to establish their online presence','Company Sponsored','USD','55','Active',now(), now()),
(2,'C0002', 'People Management', 'Learn how to Manage People', 1, 'Tim Jhon', 'Tim Jhon has a background in business management and has been working with small business to establish their online presence','Company Sponsored','USD','59','Active',now(), now());
INSERT INTO `EmployementType` (`name`) VALUES
('Full-time'),
('Part-time'),
('Contract'),
('Temporary'),
('Other');
INSERT INTO `Benifits` (`name`) VALUES
('Retirement plan'),
('Health plan'),
('Life insurance'),
('Paid vacations');
INSERT INTO `ExperienceLevel` (`name`) VALUES
('Not Applicable'),
('Internship'),
('Entry level'),
('Associate'),
('Mid-Senior level'),
('Director'),
('Executive');
INSERT INTO `JobFunction` (`name`) VALUES
('Accounting/Auditing'),
('Administrative'),
('Advertising'),
('Business Analyst'),
('Financial Analyst'),
('Data Analyst'),
('Art/Creative'),
('Business Development'),
('Consulting'),
('Customer Service'),
('Distribution'),
('Design'),
('Education'),
('Engineering'),
('Finance'),
('General Business'),
('Health Care Provider'),
('Human Resources'),
('Information Technology'),
('Legal'),
('Management'),
('Manufacturing'),
('Marketing'),
('Other'),
('Public Relations'),
('Purchasing'),
('Product Management'),
('Project Management'),
('Production'),
('Quality Assurance'),
('Research'),
('Sales'),
('Science'),
('Strategy/Planning'),
('Supply Chain'),
('Training'),
('Writing/Editing');
INSERT INTO `EducationLevel` (`name`) VALUES
('Unspecified'),
('High School or equivalent'),
('Certification'),
('Vocational'),
('Associate Degree'),
('Bachelor\'s Degree'),
('Master\'s Degree'),
('Doctorate'),
('Professional'),
('Some College Coursework Completed'),
('Vocational - HS Diploma'),
('Vocational - Degree'),
('Some High School Coursework');

View File

@@ -0,0 +1,70 @@
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('System: Default Country', '0', 'Set the default Country','[ "value", {"label":"Country","type":"select2","remote-source":["Country","code","name"]}]');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Attendance: Overtime Calculation Class', 'BasicOvertimeCalculator', 'Set the method used to calculate overtime','["value", {"label":"Value","type":"select","source":[["BasicOvertimeCalculator","BasicOvertimeCalculator"],["CaliforniaOvertimeCalculator","CaliforniaOvertimeCalculator"]]}]');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Attendance: Overtime Start Hour', '8', 'Overtime calculation will start after an employee work this number of hours per day, 0 to indicate no overtime', ''),
('Attendance: Double time Start Hour', '12', 'Double time calculation will start after an employee work this number of hours per day, 0 to indicate no double time', '');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Attendance: Work Week Start Day', '0', 'Set the starting day of the work week','["value", {"label":"Value","type":"select","source":[["0","Sunday"],["1","Monday"],["2","Tuesday"],["3","Wednesday"],["4","Thursday"],["5","Friday"],["6","Saturday"]]}]');
ALTER table `Reports` ADD COLUMN `report_group` varchar(500) NULL;
UPDATE Reports set report_group = 'Employee Information' where name = 'Employee Details Report';
UPDATE Reports set report_group = 'Time Management' where name = 'Employee Time Entry Report';
UPDATE Reports set report_group = 'Time Management' where name = 'Employee Attendance Report';
UPDATE Reports set report_group = 'Time Management' where name = 'Employee Time Tracking Report';
UPDATE Reports set report_group = 'Employee Information' where name = 'Active Employee Report';
UPDATE Reports set report_group = 'Employee Information' where name = 'New Hires Employee Report';
UPDATE Reports set report_group = 'Employee Information' where name = 'Terminated Employee Report';
UPDATE Reports set report_group = 'Travel and Expense Management' where name = 'Travel Request Report';
REPLACE INTO `Reports` (`id`, `name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
(1, 'Employee Details Report', 'This report list all employee details and you can filter employees by department, employment status or job title', '[\r\n[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "employment_status", {"label":"Employment Status","type":"select2","remote-source":["EmploymentStatus","id","name"],"allow-null":true}],\r\n[ "job_title", {"label":"Job Title","type":"select2","remote-source":["JobTitle","id","name"],"allow-null":true}]\r\n]', 'Select id, employee_id as ''Employee ID'',\r\nconcat(`first_name`,'' '',`middle_name`,'' '', `last_name`) as ''Name'',\r\n(SELECT name from Nationality where id = nationality) as ''Nationality'',\r\nbirthday as ''Birthday'',\r\ngender as ''Gender'',\r\nmarital_status as ''Marital Status'',\r\nssn_num as ''SSN Number'',\r\nnic_num as ''NIC Number'',\r\nother_id as ''Other IDs'',\r\ndriving_license as ''Driving License Number'',\r\n(SELECT name from EmploymentStatus where id = employment_status) as ''Employment Status'',\r\n(SELECT name from JobTitles where id = job_title) as ''Job Title'',\r\n(SELECT name from PayGrades where id = pay_grade) as ''Pay Grade'',\r\nwork_station_id as ''Work Station ID'',\r\naddress1 as ''Address 1'',\r\naddress2 as ''Address 2'',\r\ncity as ''City'',\r\n(SELECT name from Country where code = country) as ''Country'',\r\n(SELECT name from Province where id = province) as ''Province'',\r\npostal_code as ''Postal Code'',\r\nhome_phone as ''Home Phone'',\r\nmobile_phone as ''Mobile Phone'',\r\nwork_phone as ''Work Phone'',\r\nwork_email as ''Work Email'',\r\nprivate_email as ''Private Email'',\r\njoined_date as ''Joined Date'',\r\nconfirmation_date as ''Confirmation Date'',\r\n(SELECT title from CompanyStructures where id = department) as ''Department'',\r\n(SELECT concat(`first_name`,'' '',`middle_name`,'' '', `last_name`,'' [Employee ID:'',`employee_id`,'']'') from Employees e1 where e1.id = e.supervisor) as ''Supervisor'' \r\nFROM Employees e _where_', '["department","employment_status","job_title"]', 'Query', 'Employee Information'),
(3, 'Employee Time Entry Report', 'This report list all employee time entries by employee, date range and project', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "project", {"label":"Project","type":"select","allow-null":true,"remote-source":["Project","id","name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeTimesheetReport', '["employee","date_start","date_end","status"]', 'Class','Time Management'),
(4, 'Employee Attendance Report', 'This report list all employee attendance entries by employee and date range', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeAttendanceReport', '["employee","date_start","date_end"]', 'Class','Time Management'),
(5, 'Employee Time Tracking Report', 'This report list employee working hours and attendance details for each day for a given period ', '[\r\n[ "employee", {"label":"Employee","type":"select2","allow-null":false,"remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeTimeTrackReport', '["employee","date_start","date_end"]', 'Class','Time Management');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
('Active Employee Report', 'This report list employees who are currently active based on joined date and termination date ',
'[\r\n[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}]\r\n]',
'ActiveEmployeeReport',
'["department"]', 'Class','Employee Information');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`, `report_group`) VALUES
('New Hires Employee Report', 'This report list employees who are joined between given two dates ',
'[[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]',
'NewHiresEmployeeReport',
'["department","date_start","date_end"]', 'Class','Employee Information');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
('Travel Request Report', 'This report list employees travel requests for a specified period',
'[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}],\r\n[ "status", {"label":"Status","type":"select","source":[["NULL","All Statuses"],["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"],["Cancellation Requested","Cancellation Requested"],["Cancelled","Cancelled"]]}]\r\n]',
'TravelRequestReport',
'["employee","date_start","date_end","status"]', 'Class', 'Travel and Expense Management');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
('Employee Time Sheet Report', 'This report list all employee time sheets by employee and date range', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}],\r\n[ "status", {"label":"Status","allow-null":true,"null-label":"All Status","type":"select","source":[["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"]]}]\r\n]', 'EmployeeTimeSheetData', '["employee","date_start","date_end","status"]', 'Class','Time Management');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
('Overtime Report', 'This report list all employee attendance entries by employee with overtime calculations', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'OvertimeReport', '["employee","date_start","date_end"]', 'Class','Time Management');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
('Overtime Summary Report', 'This report list all employee attendance entries by employee with overtime calculation summary', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'OvertimeSummaryReport', '["employee","date_start","date_end"]', 'Class','Time Management');
Alter table `Employees` modify column `joined_date` date default '0000-00-00';
Alter table `Employees` modify column `confirmation_date` date default '0000-00-00';
Alter table `Employees` modify column `termination_date` date default '0000-00-00';
Alter table `Employees` modify column `birthday` date default '0000-00-00';

View File

@@ -0,0 +1,839 @@
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
('Employee Details Report', 'This report list all employee details and you can filter employees by department, employment status or job title', '[\r\n[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "employment_status", {"label":"Employment Status","type":"select2","remote-source":["EmploymentStatus","id","name"],"allow-null":true}],\r\n[ "job_title", {"label":"Job Title","type":"select2","remote-source":["JobTitle","id","name"],"allow-null":true}]\r\n]', 'Select id, employee_id as ''Employee ID'',\r\nconcat(`first_name`,'' '',`middle_name`,'' '', `last_name`) as ''Name'',\r\n(SELECT name from Nationality where id = nationality) as ''Nationality'',\r\nbirthday as ''Birthday'',\r\ngender as ''Gender'',\r\nmarital_status as ''Marital Status'',\r\nssn_num as ''SSN Number'',\r\nnic_num as ''NIC Number'',\r\nother_id as ''Other IDs'',\r\ndriving_license as ''Driving License Number'',\r\n(SELECT name from EmploymentStatus where id = employment_status) as ''Employment Status'',\r\n(SELECT name from JobTitles where id = job_title) as ''Job Title'',\r\n(SELECT name from PayGrades where id = pay_grade) as ''Pay Grade'',\r\nwork_station_id as ''Work Station ID'',\r\naddress1 as ''Address 1'',\r\naddress2 as ''Address 2'',\r\ncity as ''City'',\r\n(SELECT name from Country where code = country) as ''Country'',\r\n(SELECT name from Province where id = province) as ''Province'',\r\npostal_code as ''Postal Code'',\r\nhome_phone as ''Home Phone'',\r\nmobile_phone as ''Mobile Phone'',\r\nwork_phone as ''Work Phone'',\r\nwork_email as ''Work Email'',\r\nprivate_email as ''Private Email'',\r\njoined_date as ''Joined Date'',\r\nconfirmation_date as ''Confirmation Date'',\r\n(SELECT title from CompanyStructures where id = department) as ''Department'',\r\n(SELECT concat(`first_name`,'' '',`middle_name`,'' '', `last_name`,'' [Employee ID:'',`employee_id`,'']'') from Employees e1 where e1.id = e.supervisor) as ''Supervisor'' \r\nFROM Employees e _where_', '["department","employment_status","job_title"]', 'Query', 'Employee Information'),
('Employee Time Entry Report', 'This report list all employee time entries by employee, date range and project', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "project", {"label":"Project","type":"select","allow-null":true,"remote-source":["Project","id","name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeTimesheetReport', '["employee","date_start","date_end","status"]', 'Class','Time Management'),
('Employee Attendance Report', 'This report list all employee attendance entries by employee and date range', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeAttendanceReport', '["employee","date_start","date_end"]', 'Class','Time Management'),
('Employee Time Tracking Report', 'This report list employee working hours and attendance details for each day for a given period ', '[\r\n[ "employee", {"label":"Employee","type":"select2","allow-null":false,"remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeTimeTrackReport', '["employee","date_start","date_end"]', 'Class','Time Management');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
('Active Employee Report', 'This report list employees who are currently active based on joined date and termination date ',
'[\r\n[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}]\r\n]',
'ActiveEmployeeReport',
'["department"]', 'Class','Employee Information');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`, `report_group`) VALUES
('New Hires Employee Report', 'This report list employees who are joined between given two dates ',
'[[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]',
'NewHiresEmployeeReport',
'["department","date_start","date_end"]', 'Class','Employee Information');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`, `report_group`) VALUES
('Terminated Employee Report', 'This report list employees who are terminated between given two dates ',
'[[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]',
'TerminatedEmployeeReport',
'["department","date_start","date_end"]', 'Class','Employee Information');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
('Employee Time Sheet Report', 'This report list all employee time sheets by employee and date range', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}],\r\n[ "status", {"label":"Status","allow-null":true,"null-label":"All Status","type":"select","source":[["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"]]}]\r\n]', 'EmployeeTimeSheetData', '["employee","date_start","date_end","status"]', 'Class','Time Management');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('LDAP: Enabled', '0', '','["value", {"label":"Value","type":"select","source":[["0","No"],["1","Yes"]]}]'),
('LDAP: Server', '', 'LDAP Server IP or DNS',''),
('LDAP: Port', '389', 'LDAP Server Port',''),
('LDAP: Root DN', '', 'e.g: dc=mycompany,dc=net',''),
('LDAP: Manager DN', '', 'e.g: cn=admin,dc=mycompany,dc=net',''),
('LDAP: Manager Password', '', 'Password of the manager user',''),
('LDAP: Version 3', '1', 'Are you using LDAP v3','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
('LDAP: User Filter', '', 'e.g: uid={}, we will replace {} with actual username provided by the user at the time of login','');
/* v15.0.PRO to v16.0.PRO */
ALTER TABLE `Users` ADD COLUMN `login_hash` varchar(64) default null;
ALTER TABLE `Users` ADD INDEX login_hash_index (`login_hash`);
INSERT INTO `ImmigrationStatus` VALUES
(1,'Citizen'),
(2,'Permanent Resident'),
(3,'Work Permit Holder'),
(4,'Dependant Pass Holder');
INSERT INTO `Ethnicity` VALUES
(1,'White American'),
(2,'Black or African American'),
(3,'Native American'),
(4,'Alaska Native'),
(5,'Asian American'),
(6,'Native Hawaiian'),
(7,'Pacific Islander');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Attendance: Overtime Calculation Class', 'BasicOvertimeCalculator', 'Set the method used to calculate overtime','["value", {"label":"Value","type":"select","source":[["BasicOvertimeCalculator","BasicOvertimeCalculator"],["CaliforniaOvertimeCalculator","CaliforniaOvertimeCalculator"]]}]');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Attendance: Work Week Start Day', '0', 'Set the starting day of the work week','["value", {"label":"Value","type":"select","source":[["0","Sunday"],["1","Monday"],["2","Tuesday"],["3","Wednesday"],["4","Thursday"],["5","Friday"],["6","Saturday"]]}]');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('System: Reset Module Names', '1', 'Select this to reset module names in Database','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Attendance: Overtime Start Hour', '8', 'Overtime calculation will start after an employee work this number of hours per day, 0 to indicate no overtime', ''),
('Attendance: Double time Start Hour', '12', 'Double time calculation will start after an employee work this number of hours per day, 0 to indicate no double time', ''),
('Api: REST Api Enabled', '1', '','["value", {"label":"Value","type":"select","source":[["0","No"],["1","Yes"]]}]'),
('Api: REST Api Token', 'Click on edit icon', '','["value", {"label":"Value","type":"placeholder"}]');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('System: Allowed Countries', '0', 'Only these countries will be allowed in select boxes','["value", {"label":"Value","type":"select2multi","remote-source":["Country","id","name"]}]');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('System: Allowed Currencies', '0', 'Only these currencies will be allowed in select boxes','["value", {"label":"Value","type":"select2multi","remote-source":["CurrencyType","id","code+name"]}]');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('System: Allowed Nationality', '', 'Only these nationalities will be allowed in select boxes','["value", {"label":"Value","type":"select2multi","remote-source":["Nationality","id","name"]}]');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
('Overtime Report', 'This report list all employee attendance entries by employee with overtime calculations', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'OvertimeReport', '["employee","date_start","date_end"]', 'Class','Time Management');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
('Overtime Summary Report', 'This report list all employee attendance entries by employee with overtime calculation summary', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'OvertimeSummaryReport', '["employee","date_start","date_end"]', 'Class','Time Management');
create table `EmployeeDataHistory` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`type` varchar(100) not null,
`employee` bigint(20) NOT NULL,
`field` varchar(100) not null,
`old_value` varchar(500) default null,
`new_value` varchar(500) default null,
`description` varchar(800) default null,
`user` bigint(20) NULL,
`updated` timestamp default '0000-00-00 00:00:00',
`created` timestamp default '0000-00-00 00:00:00',
CONSTRAINT `Fk_EmployeeDataHistory_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeDataHistory_Users` FOREIGN KEY (`user`) REFERENCES `Users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
Alter table `Employees` modify column `joined_date` date default '0000-00-00';
Alter table `Employees` modify column `confirmation_date` date default '0000-00-00';
Alter table `Employees` modify column `termination_date` date default '0000-00-00';
Alter table `Employees` modify column `birthday` date default '0000-00-00';
REPLACE INTO `FieldNameMappings` (`type`, `name`, `textOrig`, `textMapped`, `display`) VALUES
('Employee', 'indirect_supervisors', 'Indirect Supervisors', 'Indirect Supervisors', 'Form');
Update Crons set time = (FLOOR( 1 + RAND( ) *58 )), type = 'Hourly' where name = 'Document Expire Alert';
CREATE TABLE `PayFrequency` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(200) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB default charset=utf8;
INSERT INTO `PayFrequency` VALUES
(1,'Bi Weekly'),
(2,'Weekly'),
(3,'Semi Monthly'),
(4,'Monthly'),
(5,'Yearly');
CREATE TABLE `PayrollColumnTemplates` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(50) DEFAULT NULL,
`columns` varchar(500) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB default charset=utf8;
create table `Payroll` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(200) NULL,
`pay_period` bigint(20) NOT NULL,
`department` bigint(20) NOT NULL,
`column_template` bigint(20) NOT NULL,
`columns` varchar(500) DEFAULT NULL,
`date_start` DATE NULL default '0000-00-00',
`date_end` DATE NULL default '0000-00-00',
`status` enum('Draft','Completed','Processing') default 'Draft',
primary key (`id`)
) engine=innodb default charset=utf8;
CREATE TABLE `PayrollData` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`payroll` bigint(20) NOT NULL,
`employee` bigint(20) NOT NULL,
`payroll_item` int(11) NOT NULL,
`amount` varchar(25) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `PayrollDataUniqueKey` (`payroll`,`employee`,`payroll_item`),
CONSTRAINT `Fk_PayrollData_Payroll` FOREIGN KEY (`payroll`) REFERENCES `Payroll` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB default charset=utf8;
CREATE TABLE `PayrollColumns` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) DEFAULT NULL,
`calculation_hook` varchar(200) DEFAULT NULL,
`salary_components` varchar(500) DEFAULT NULL,
`deductions` varchar(500) DEFAULT NULL,
`add_columns` varchar(500) DEFAULT NULL,
`sub_columns` varchar(500) DEFAULT NULL,
`colorder` int(11) DEFAULT NULL,
`editable` enum('Yes','No') default 'Yes',
`enabled` enum('Yes','No') default 'Yes',
`default_value` varchar(25) DEFAULT NULL,
`calculation_columns` varchar(500) DEFAULT NULL,
`calculation_function` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB default charset=utf8;
INSERT INTO `PayrollColumns` (`id`,`name`,`calculation_hook`,`salary_components`,`deductions`,`add_columns`,`sub_columns`,`editable`) VALUES
(1,'Total Hours','AttendanceUtil_getTimeWorkedHours','','','','','No'),
(2,'Regular Hours','AttendanceUtil_getRegularWorkedHours','','','','','No'),
(3,'Overtime Hours','AttendanceUtil_getOverTimeWorkedHours','','','','','No'),
(4,'Leave Hours','LeaveUtil_getLeaveHours','','','','','No');
create table `PayrollEmployees` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`pay_frequency` int(11) default null,
`currency` bigint(20) NULL,
`deduction_exemptions` varchar(250) default null,
`deduction_allowed` varchar(250) default null,
CONSTRAINT `Fk_PayrollEmployee_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`),
unique key `PayrollEmployees_employee` (`employee`)
) engine=innodb default charset=utf8;
create table `DeductionGroup` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`description` varchar(100) NOT NULL,
primary key (`id`)
) engine=innodb default charset=utf8;
drop table `DeductionRules`;
drop table `Deductions`;
create table `Deductions` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`componentType` varchar(250) NULL,
`component` varchar(250) NULL,
`payrollColumn` int(11) DEFAULT NULL,
`rangeAmounts` text default null,
`deduction_group` bigint(20) NULL,
CONSTRAINT `Fk_Deductions_DeductionGroup` FOREIGN KEY (`deduction_group`) REFERENCES `DeductionGroup` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
Update Reports set parameters = '[\r\n[ "department", {"label":"Department (Company)","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}],\r\n[ "status", {"label":"Leave Status","type":"select","source":[["NULL","All Statuses"],["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"],["Cancellation Requested","Cancellation Requested"],["Cancelled","Cancelled"]]}]\r\n]' where name = "Employee Leaves Report";
Delete from `Settings` where name = 'System: Default Country';
create table `LeaveTypes` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`supervisor_leave_assign` enum('Yes','No') default 'Yes',
`employee_can_apply` enum('Yes','No') default 'Yes',
`apply_beyond_current` enum('Yes','No') default 'Yes',
`leave_accrue` enum('No','Yes') default 'No',
`carried_forward` enum('No','Yes') default 'No',
`default_per_year` decimal(10,3) NOT NULL,
`carried_forward_percentage` int(11) NULL default 0,
`carried_forward_leave_availability` int(11) NULL default 365,
`propotionate_on_joined_date` enum('No','Yes') default 'No',
`send_notification_emails` enum('Yes','No') default 'Yes',
`leave_group` bigint(20) NULL,
`leave_color` varchar(10) NULL,
`max_carried_forward_amount` int(11) NULL default 0,
primary key (`id`),
unique key (`name`)
) engine=innodb default charset=utf8;
create table `LeaveRules` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`leave_type` bigint(20) NOT NULL,
`job_title` bigint(20) NULL,
`employment_status` bigint(20) NULL,
`employee` bigint(20) NULL,
`supervisor_leave_assign` enum('Yes','No') default 'Yes',
`employee_can_apply` enum('Yes','No') default 'Yes',
`apply_beyond_current` enum('Yes','No') default 'Yes',
`leave_accrue` enum('No','Yes') default 'No',
`carried_forward` enum('No','Yes') default 'No',
`default_per_year` decimal(10,3) NOT NULL,
`carried_forward_percentage` int(11) NULL default 0,
`carried_forward_leave_availability` int(11) NULL default 365,
`propotionate_on_joined_date` enum('No','Yes') default 'No',
`leave_group` bigint(20) NULL,
`max_carried_forward_amount` int(11) NULL default 0,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `LeaveGroups` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`details` text default null,
`created` timestamp NULL default '0000-00-00 00:00:00',
`updated` timestamp NULL default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `LeaveGroupEmployees` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`leave_group` bigint(20) NOT NULL,
`created` timestamp NULL default '0000-00-00 00:00:00',
`updated` timestamp NULL default '0000-00-00 00:00:00',
CONSTRAINT `Fk_LeaveGroupEmployees_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_LeaveGroupEmployees_LeaveGroups` FOREIGN KEY (`leave_group`) REFERENCES `LeaveGroups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`),
unique key `LeaveGroupEmployees_employee` (`employee`)
) engine=innodb default charset=utf8;
create table `LeavePeriods` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`date_start` date default '0000-00-00',
`date_end` date default '0000-00-00',
`status` enum('Active','Inactive') default 'Inactive',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `WorkDays` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`status` enum('Full Day','Half Day','Non-working Day') default 'Full Day',
`country` bigint(20) DEFAULT NULL,
primary key (`id`),
unique key `workdays_name_country` (`name`,`country`)
) engine=innodb default charset=utf8;
create table `HoliDays` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`dateh` date default '0000-00-00',
`status` enum('Full Day','Half Day') default 'Full Day',
`country` bigint(20) DEFAULT NULL,
primary key (`id`),
unique key `holidays_dateh_country` (`dateh`,`country`)
) engine=innodb default charset=utf8;
create table `EmployeeLeaves` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`leave_type` bigint(20) NOT NULL,
`leave_period` bigint(20) NOT NULL,
`date_start` date default '0000-00-00',
`date_end` date default '0000-00-00',
`details` text default null,
`status` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending',
`attachment` varchar(100) NULL,
CONSTRAINT `Fk_EmployeeLeaves_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeLeaves_LeaveTypes` FOREIGN KEY (`leave_type`) REFERENCES `LeaveTypes` (`id`),
CONSTRAINT `Fk_EmployeeLeaves_LeavePeriods` FOREIGN KEY (`leave_period`) REFERENCES `LeavePeriods` (`id`),
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployeeLeaveLog` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee_leave` bigint(20) NOT NULL,
`user_id` bigint(20) NULL,
`data` varchar(500) NOT NULL,
`status_from` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending',
`status_to` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending',
`created` timestamp default '0000-00-00 00:00:00',
CONSTRAINT `Fk_EmployeeLeaveLog_EmployeeLeaves` FOREIGN KEY (`employee_leave`) REFERENCES `EmployeeLeaves` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeLeaveLog_Users` FOREIGN KEY (`user_id`) REFERENCES `Users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployeeLeaveDays` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee_leave` bigint(20) NOT NULL,
`leave_date` date default '0000-00-00',
`leave_type` enum('Full Day','Half Day - Morning','Half Day - Afternoon','1 Hour - Morning','2 Hours - Morning','3 Hours - Morning','1 Hour - Afternoon','2 Hours - Afternoon','3 Hours - Afternoon') NOT NULL,
CONSTRAINT `Fk_EmployeeLeaveDays_EmployeeLeaves` FOREIGN KEY (`employee_leave`) REFERENCES `EmployeeLeaves` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Documents` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`details` text default null,
`expire_notification` enum('Yes','No') default 'Yes',
`expire_notification_month` enum('Yes','No') default 'Yes',
`expire_notification_week` enum('Yes','No') default 'Yes',
`expire_notification_day` enum('Yes','No') default 'Yes',
`sign` enum('Yes','No') default 'Yes',
`sign_label` VARCHAR(500) default null,
`created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployeeDocuments` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`document` bigint(20) NULL,
`date_added` date NOT NULL,
`valid_until` date NOT NULL,
`status` enum('Active','Inactive','Draft') default 'Active',
`details` text default null,
`attachment` varchar(100) NULL,
`signature` text default null,
`expire_notification_last` int(4) NULL,
CONSTRAINT `Fk_EmployeeDocuments_Documents` FOREIGN KEY (`document`) REFERENCES `Documents` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeDocuments_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`),
KEY `KEY_EmployeeDocuments_valid_until` (`valid_until`),
KEY `KEY_EmployeeDocuments_valid_until_status` (`valid_until`,`status`,`expire_notification_last`)
) engine=innodb default charset=utf8;
create table `CompanyDocuments` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`details` text default null,
`valid_until` date NOT NULL,
`status` enum('Active','Inactive','Draft') default 'Active',
`notify_employees` enum('Yes','No') default 'Yes',
`attachment` varchar(100) NULL,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Courses` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`code` varchar(300) NOT NULL,
`name` varchar(300) NOT NULL,
`description` text default null,
`coordinator` bigint(20) NULL,
`trainer` varchar(300) NULL,
`trainer_info` text default null,
`paymentType` enum('Company Sponsored','Paid by Employee') default 'Company Sponsored',
`currency` varchar(3) null,
`cost` decimal(12,2) DEFAULT 0.00,
`status` enum('Active','Inactive') default 'Active',
`created` datetime default '0000-00-00 00:00:00',
`updated` datetime default '0000-00-00 00:00:00',
CONSTRAINT `Fk_Courses_Employees` FOREIGN KEY (`coordinator`) REFERENCES `Employees` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `TrainingSessions` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(300) NOT NULL,
`course` bigint(20) NOT NULL,
`description` text default null,
`scheduled` datetime default '0000-00-00 00:00:00',
`dueDate` datetime default '0000-00-00 00:00:00',
`deliveryMethod` enum('Classroom','Self Study','Online') default 'Classroom',
`deliveryLocation` varchar(500) NULL,
`status` enum('Pending','Approved','Completed','Cancelled') default 'Pending',
`attendanceType` enum('Sign Up','Assign') default 'Sign Up',
`attachment` varchar(300) NULL,
`created` datetime default '0000-00-00 00:00:00',
`updated` datetime default '0000-00-00 00:00:00',
`requireProof` enum('Yes','No') default 'Yes',
CONSTRAINT `Fk_TrainingSessions_Courses` FOREIGN KEY (`course`) REFERENCES `Courses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployeeTrainingSessions` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`trainingSession` bigint(20) NULL,
`feedBack` varchar(1500) NULL,
`status` enum('Scheduled','Attended','Not-Attended','Completed') default 'Scheduled',
`proof` varchar(300) NULL,
CONSTRAINT `Fk_EmployeeTrainingSessions_TrainingSessions` FOREIGN KEY (`trainingSession`) REFERENCES `TrainingSessions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeTrainingSessions_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `LeaveStartingBalance` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`leave_type` bigint(20) NOT NULL,
`employee` bigint(20) NULL,
`leave_period` bigint(20) NOT NULL,
`amount` decimal(10,3) NOT NULL,
`note` text DEFAULT NULL,
`created` datetime default '0000-00-00 00:00:00',
`updated` datetime default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
/* Sync with Default Schema */
create table `EmployementType` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(250) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Industry` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(250) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `ExperienceLevel` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(250) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `JobFunction` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(250) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EducationLevel` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(250) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Benifits` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(250) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Tags` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(250) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Job` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`title` varchar(200) NOT NULL,
`shortDescription` text DEFAULT NULL,
`description` text DEFAULT NULL,
`requirements` text DEFAULT NULL,
`benefits` text DEFAULT NULL,
`country` bigint(20) DEFAULT NULL,
`company` bigint(20) DEFAULT NULL,
`department` VARCHAR(100) NULL,
`code` VARCHAR(20) NULL,
`employementType` bigint(20) DEFAULT NULL,
`industry` bigint(20) DEFAULT NULL,
`experienceLevel` bigint(20) DEFAULT NULL,
`jobFunction` bigint(20) DEFAULT NULL,
`educationLevel` bigint(20) DEFAULT NULL,
`currency` bigint(20) DEFAULT NULL,
`showSalary` enum('Yes','No') default NULL,
`salaryMin` bigint(20) DEFAULT NULL,
`salaryMax` bigint(20) DEFAULT NULL,
`keywords` text DEFAULT NULL,
`status` enum('Active','On hold','Closed') default NULL,
`closingDate` DATETIME default '0000-00-00 00:00:00',
`attachment` varchar(100) NULL,
`display` varchar(200) NOT NULL,
`postedBy` bigint(20) DEFAULT NULL,
INDEX `Job_status` (`status`),
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Candidates` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`first_name` varchar(100) default '' not null,
`last_name` varchar(100) default '' not null,
`nationality` bigint(20) default null,
`birthday` DATETIME default '0000-00-00 00:00:00',
`gender` enum('Male','Female') default NULL,
`marital_status` enum('Married','Single','Divorced','Widowed','Other') default NULL,
`address1` varchar(100) default '',
`address2` varchar(100) default '',
`city` varchar(150) default '',
`country` char(2) default null,
`province` bigint(20) default null,
`postal_code` varchar(20) default null,
`email` varchar(200) default null,
`home_phone` varchar(50) default null,
`mobile_phone` varchar(50) default null,
`cv_title` varchar(200) default '' not null,
`cv` varchar(150) NULL,
`cvtext` text NULL,
`industry` text DEFAULT NULL,
`profileImage` varchar(150) NULL,
`head_line` text DEFAULT NULL,
`objective` text DEFAULT NULL,
`work_history` text DEFAULT NULL,
`education` text DEFAULT NULL,
`skills` text DEFAULT NULL,
`referees` text DEFAULT NULL,
`linkedInUrl` varchar(500) DEFAULT NULL,
`linkedInData` text DEFAULT NULL,
`totalYearsOfExperience` int(11) default null,
`totalMonthsOfExperience` int(11) default null,
`htmlCVData` longtext DEFAULT NULL,
`generatedCVFile` varchar(150) DEFAULT NULL,
`created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00',
`expectedSalary` int(11) default null,
`preferedPositions` text default null,
`preferedJobtype` varchar(60) default null,
`preferedCountries` text default null,
`tags` text default null,
`notes` text default null,
`calls` text default null,
`age` int(11) default null,
`hash` varchar(100) DEFAULT NULL,
`linkedInProfileLink` varchar(250) DEFAULT NULL,
`linkedInProfileId` varchar(50) DEFAULT NULL,
`facebookProfileLink` varchar(250) DEFAULT NULL,
`facebookProfileId` varchar(50) DEFAULT NULL,
`twitterProfileLink` varchar(250) DEFAULT NULL,
`twitterProfileId` varchar(50) DEFAULT NULL,
`googleProfileLink` varchar(250) DEFAULT NULL,
`googleProfileId` varchar(50) DEFAULT NULL,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Applications` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`job` bigint(20) NOT NULL,
`candidate` bigint(20) DEFAULT NULL,
`created` DATETIME default '0000-00-00 00:00:00',
`referredByEmail` varchar(200) DEFAULT NULL,
`notes` text DEFAULT NULL,
primary key (`id`),
unique key (`job`,`candidate`),
CONSTRAINT `Fk_Applications_Job` FOREIGN KEY (`job`) REFERENCES `Job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_Applications_Candidates` FOREIGN KEY (`candidate`) REFERENCES `Candidates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) engine=innodb default charset=utf8;
create table `Interviews` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`job` bigint(20) NOT NULL,
`candidate` bigint(20) DEFAULT NULL,
`level` varchar(100) DEFAULT NULL,
`created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00',
`scheduled` DATETIME default '0000-00-00 00:00:00',
`location` varchar(500) DEFAULT NULL,
`mapId` bigint(20) NULL,
`status` varchar(100) default null,
`notes` text DEFAULT NULL,
primary key (`id`),
CONSTRAINT `Fk_Interviews_Job` FOREIGN KEY (`job`) REFERENCES `Job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_Interviews_Candidates` FOREIGN KEY (`candidate`) REFERENCES `Candidates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) engine=innodb default charset=utf8;
create table `Calls` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`job` bigint(20) NOT NULL,
`candidate` bigint(20) DEFAULT NULL,
`phone` varchar(20) default null,
`created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00',
`status` varchar(100) default null,
`notes` text DEFAULT NULL,
primary key (`id`),
CONSTRAINT `Fk_Calls_Job` FOREIGN KEY (`job`) REFERENCES `Job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_Calls_Candidates` FOREIGN KEY (`candidate`) REFERENCES `Candidates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) engine=innodb default charset=utf8;
/* Add Missing Master Data */
INSERT INTO `WorkDays` (`id`, `name`, `status`, `country`) VALUES
(1, 'Monday', 'Full Day',NULL),
(2, 'Tuesday', 'Full Day',NULL),
(3, 'Wednesday', 'Full Day',NULL),
(4, 'Thursday', 'Full Day',NULL),
(5, 'Friday', 'Full Day',NULL),
(6, 'Saturday', 'Non-working Day',NULL),
(7, 'Sunday', 'Non-working Day',NULL);
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('System: Reset Module Names', '1', 'Select this to reset module names in Database','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
('Leave: Share Calendar to Whole Company', '1', '','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
('Leave: CC Emails', '', 'Every email sent though leave module will be CC to these comma seperated list of emails addresses',''),
('Leave: BCC Emails', '', 'Every email sent though leave module will be BCC to these comma seperated list of emails addresses',''),
('Api: REST Api Enabled', '1', '','["value", {"label":"Value","type":"select","source":[["0","No"],["1","Yes"]]}]'),
('Api: REST Api Token', 'Click on edit icon', '','["value", {"label":"Value","type":"placeholder"}]');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('LDAP: Enabled', '0', '','["value", {"label":"Value","type":"select","source":[["0","No"],["1","Yes"]]}]'),
('LDAP: Server', '', 'LDAP Server IP or DNS',''),
('LDAP: Port', '389', 'LDAP Server Port',''),
('LDAP: Root DN', '', 'e.g: dc=mycompany,dc=net',''),
('LDAP: Manager DN', '', 'e.g: cn=admin,dc=mycompany,dc=net',''),
('LDAP: Manager Password', '', 'Password of the manager user',''),
('LDAP: Version 3', '1', 'Are you using LDAP v3','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
('LDAP: User Filter', '', 'e.g: uid={}, we will replace {} with actual username provided by the user at the time of login','');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Leave: Allow Indirect Admins to Approve', '0', 'Allow indirect admins to approve leave requests','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
REPLACE INTO `Documents` (`id`, `name`, `details`, `expire_notification`, `expire_notification_month`, `expire_notification_week`, `expire_notification_day`,`sign`,`created`, `updated`) VALUES
(1, 'ID Copy', 'Your ID copy','Yes','Yes','Yes','Yes','No',NOW(), NOW()),
(2, 'Degree Certificate', 'Degree Certificate','Yes','Yes','Yes','Yes','Yes',NOW(), NOW()),
(3, 'Driving License', 'Driving License','Yes','Yes','Yes','Yes','Yes',NOW(), NOW());
REPLACE INTO `HoliDays` (`id`, `name`, `dateh`, `status`) VALUES
(1, 'New Year''s Day', '2015-01-01', 'Full Day'),
(2, 'Christmas Day', '2015-12-25', 'Full Day');
REPLACE INTO `LeavePeriods` (`id`, `name`, `date_start`, `date_end`, `status`) VALUES
(3, 'Year 2015', '2015-01-01', '2015-12-31', 'Active'),
(4, 'Year 2016', '2016-01-01', '2016-12-31', 'Active'),
(5, 'Year 2017', '2017-01-01', '2017-12-31', 'Active');
REPLACE INTO `LeaveTypes` (`id`, `name`, `supervisor_leave_assign`, `employee_can_apply`, `apply_beyond_current`, `leave_accrue`, `carried_forward`, `default_per_year`) VALUES
(1, 'Annual leave', 'No', 'Yes', 'No', 'No', 'No', 14),
(2, 'Casual leave', 'Yes', 'Yes', 'No', 'No', 'No', 7),
(3, 'Medical leave', 'Yes', 'Yes', 'Yes', 'No', 'No', 7);
REPLACE INTO `Courses` (`id`,`code`, `name`, `description`, `coordinator`, `trainer`, `trainer_info`, `paymentType`, `currency`, `cost`, `status`, `created`, `updated`) VALUES
(1,'C0001', 'Info Marketing', 'Learn how to Create and Outsource Info Marketing Products', 1, 'Tim Jhon', 'Tim Jhon has a background in business management and has been working with small business to establish their online presence','Company Sponsored','USD','55','Active',now(), now()),
(2,'C0002', 'People Management', 'Learn how to Manage People', 1, 'Tim Jhon', 'Tim Jhon has a background in business management and has been working with small business to establish their online presence','Company Sponsored','USD','59','Active',now(), now());
REPLACE INTO `EmployementType` (`name`) VALUES
('Full-time'),
('Part-time'),
('Contract'),
('Temporary'),
('Other');
REPLACE INTO `Benifits` (`name`) VALUES
('Retirement plan'),
('Health plan'),
('Life insurance'),
('Paid vacations');
REPLACE INTO `ExperienceLevel` (`name`) VALUES
('Not Applicable'),
('Internship'),
('Entry level'),
('Associate'),
('Mid-Senior level'),
('Director'),
('Executive');
REPLACE INTO `JobFunction` (`name`) VALUES
('Accounting/Auditing'),
('Administrative'),
('Advertising'),
('Business Analyst'),
('Financial Analyst'),
('Data Analyst'),
('Art/Creative'),
('Business Development'),
('Consulting'),
('Customer Service'),
('Distribution'),
('Design'),
('Education'),
('Engineering'),
('Finance'),
('General Business'),
('Health Care Provider'),
('Human Resources'),
('Information Technology'),
('Legal'),
('Management'),
('Manufacturing'),
('Marketing'),
('Other'),
('Public Relations'),
('Purchasing'),
('Product Management'),
('Project Management'),
('Production'),
('Quality Assurance'),
('Research'),
('Sales'),
('Science'),
('Strategy/Planning'),
('Supply Chain'),
('Training'),
('Writing/Editing');
REPLACE INTO `EducationLevel` (`name`) VALUES
('Unspecified'),
('High School or equivalent'),
('Certification'),
('Vocational'),
('Associate Degree'),
('Bachelor\'s Degree'),
('Master\'s Degree'),
('Doctorate'),
('Professional'),
('Some College Coursework Completed'),
('Vocational - HS Diploma'),
('Vocational - Degree'),
('Some High School Coursework');
REPLACE INTO `Crons` (`name`,`class`, `lastrun`, `frequency`, `time`, `type`, `status`) VALUES
('Email Sender Task', 'EmailSenderTask', NULL, 1, 1, 'Minutely', 'Enabled'),
('Document Expire Alert', 'DocumentExpiryNotificationTask', NULL, 1, (FLOOR( 1 + RAND( ) *58 )), 'Hourly', 'Enabled');
REPLACE INTO `ExpensesPaymentMethods` (`name`) VALUES
('Cash'),
('Check'),
('Credit Card'),
('Debit Card');
REPLACE INTO `ExpensesCategories` (`name`) VALUES
('Auto - Gas'),
('Auto - Insurance'),
('Auto - Maintenance'),
('Auto - Payment'),
('Transportation'),
('Bank Fees'),
('Dining Out'),
('Entertainment'),
('Hotel / Motel'),
('Insurance'),
('Interest Charges'),
('Loan Payment'),
('Medical'),
('Mileage'),
('Rent'),
('Rental Car'),
('Utility');

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,194 @@
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Overtime Report', 'This report list all employee attendance entries by employee with overtime calculations', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'OvertimeReport', '["employee","date_start","date_end"]', 'Class','Time Management','CSV');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Overtime Summary Report', 'This report list all employee attendance entries by employee with overtime calculation summary', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'OvertimeSummaryReport', '["employee","date_start","date_end"]', 'Class','Time Management','CSV');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Overtime Request Report',
'This report list employee overtime requests by employee, date range, overtime category and project',
'[[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],[ "date_start", {"label":"Start Date","type":"date"}],[ "date_end", {"label":"End Date","type":"date"}],[ "category", {"label":"Category","type":"select2","allow-null":true,"remote-source":["OvertimeCategory","id","name"]}],[ "project", {"label":"Project","type":"select2","allow-null":true,"remote-source":["Project","id","name"]}],[ "status", {"label":"Status","type":"select","source":[["NULL","All Statuses"],["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"],["Cancellation Requested","Cancellation Requested"],["Cancelled","Cancelled"],["Processing","Processing"]]}]]', 'OvertimeRequestReport', '["employee","date_start","date_end","category","project"]', 'Class','Time Management','CSV');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Overtime: Allow Indirect Admins to Approve', '0', 'Allow indirect admins to approve overtime requests','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Travel: Enable Multi Level Approvals', '0', 'Allow multi level approvals in travel module','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Overtime: Enable Multi Level Approvals', '0', 'Allow multi level approvals in overtime module','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('System: Company Structure Managers Enabled', '0', 'Allow Managers to View Employees in Their Company Structure, if They are Assigned as a Head of the Company Structure',
'["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('System: Child Company Structure Managers Enabled', '0', 'Allow Managers to View Employees in Their Company Structure and all Child Company Structures, if They are Assigned as a Head of the Company Structure',
'["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
delete from PayrollColumns;
INSERT INTO `PayrollColumns` (`id`,`name`,`calculation_hook`,`salary_components`,`deductions`,`add_columns`,`sub_columns`,`editable`,`enabled`,`default_value`,`calculation_columns`,`calculation_function`) VALUES
(1,'Total Hours','AttendanceUtil_getTimeWorkedHours','','','','','No','Yes','0.00',NULL,NULL),
(2,'Regular Hours','AttendanceUtil_getRegularWorkedHours','','','','','No','Yes','0.00',NULL,NULL),
(3,'Overtime Hours','AttendanceUtil_getOverTimeWorkedHours','','','','','No','Yes','0.00',NULL,NULL),
(4,'Leave Hours','LeaveUtil_getLeaveHours','','','','','No','Yes','0.00',NULL,NULL);
delete from DataImport where name = 'Sage50 Import - Employee Data';
INSERT INTO `DataImport` (`name`, `dataType`, `details`, `columns`, `updated`, `created`) VALUES
('Employee Data Import', 'EmployeeDataImporter', '', '[{"name":"employee_id","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"Yes","id":"columns_7"},{"name":"first_name","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_3"},{"name":"middle_name","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_5"},{"name":"last_name","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_6"},{"name":"address1","title":"Address1","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_8"},{"name":"address2","title":"Address2","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_9"},{"name":"home_phone","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_14"},{"name":"mobile_phone","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_15"},{"name":"work_email","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_16"},{"name":"gender","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_17"},{"name":"marital_status","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_18"},{"name":"birthday","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_20"},{"name":"nationality","title":"Nationality","type":"Reference","dependOn":"Nationality","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_22"},{"name":"ethnicity","title":"Ethnicity","type":"Normal","dependOn":"Ethnicity","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_23"},{"name":"EmergencyContact/name","title":"","type":"Attached","dependOn":"EmergencyContact","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_24"},{"name":"EmergencyContact/relationship","title":"","type":"Attached","dependOn":"EmergencyContact","dependOnField":"relationship","isKeyField":"No","idField":"No","id":"columns_25"},{"name":"EmergencyContact/home_phone","title":"","type":"Attached","dependOn":"EmergencyContact","dependOnField":"home_phone","isKeyField":"No","idField":"No","id":"columns_26"},{"name":"ssn_num","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_31"},{"name":"job_title","title":"","type":"Reference","dependOn":"JobTitle","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_32"},{"name":"employment_status","title":"","type":"Reference","dependOn":"EmploymentStatus","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_33"},{"name":"joined_date","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_36"},{"name":"department","title":"","type":"Reference","dependOn":"CompanyStructure","dependOnField":"title","isKeyField":"Yes","idField":"No","id":"columns_38"}]', '2016-06-02 18:56:32', '2016-06-02 18:56:32'),
('Attendance Data Import', 'AttendanceDataImporter', '', '[{"name":"employee","title":"","type":"Reference","dependOn":"Employee","dependOnField":"employee_id","isKeyField":"Yes","idField":"No","id":"columns_1"},{"name":"in_time","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_2"},{"name":"out_time","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_3"},{"name":"note","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_4"}]', '2016-08-14 02:51:56', '2016-08-14 02:51:56');
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Overtime Report', 'This report list all employee attendance entries by employee with overtime calculations', '[\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'OvertimeReport', '["employee","date_start","date_end"]', 'Class','Time Management','CSV');
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Overtime Summary Report', 'This report list all employee attendance entries by employee with overtime calculation summary', '[\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'OvertimeSummaryReport', '["date_start","date_end"]', 'Class','Time Management','CSV');
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Client Project Time Report', 'View your time entries for projects under a given client',
'[\r\n[ "client", {"label":"Select Client","type":"select","allow-null":false,"remote-source":["Client","id","name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]',
'ClientProjectTimeReport', '["client","date_start","date_end","status"]', 'Class','Time Management','PDF');
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Download Payslips', 'Download your payslips',
'[\r\n[ "payroll", {"label":"Select Payroll","type":"select","allow-null":false,"remote-source":["Payroll","id","name","getEmployeePayrolls"]}]]',
'PayslipReport', '["payroll"]', 'Class','Finance','PDF');
INSERT INTO `DeductionGroup` VALUES
(1,'Sri Lanka Payroll Calculation','');
INSERT INTO `PayslipTemplates` (`id`, `name`, `data`, `status`, `created`, `updated`) VALUES
(1, 'Sri Lanka - Default Payslip', '[{"type":"Company Logo","payrollColumn":"NULL","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"#000000","status":"Show","id":"data_1"},{"type":"Company Name","payrollColumn":"NULL","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"","status":"Show","id":"data_2"},{"type":"Separators","payrollColumn":"NULL","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"","status":"Show","id":"data_8"},{"type":"Payroll Column","payrollColumn":"5","label":"Basic Salary","text":"","status":"Show","id":"data_3"},{"type":"Payroll Column","payrollColumn":"6","label":"Fixed Allowance","text":"","status":"Show","id":"data_4"},{"type":"Payroll Column","payrollColumn":"7","label":"Gross Pay","text":"","status":"Show","id":"data_11"},{"type":"Separators","payrollColumn":"NULL","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"","status":"Show","id":"data_9"},{"type":"Text","payrollColumn":"NULL","label":"","text":"Deductions","status":"Show","id":"data_13"},{"type":"Payroll Column","payrollColumn":"8","label":"EPF Employee Contribution","text":"","status":"Show","id":"data_6"},{"type":"Payroll Column","payrollColumn":"13","label":"PAYE Tax","text":"","status":"Show","id":"data_14"},{"type":"Payroll Column","payrollColumn":"14","label":"Stamp Duty","text":"","status":"Show","id":"data_15"},{"type":"Payroll Column","payrollColumn":"15","label":"Total Deductions","text":"","status":"Show","id":"data_16"},{"type":"Separators","payrollColumn":"NULL","label":"","text":"","status":"Show","id":"data_17"},{"type":"Text","payrollColumn":"NULL","label":"","text":"Employer Contributions","status":"Show","id":"data_18"},{"type":"Payroll Column","payrollColumn":"9","label":"EPF Employer Contribution","text":"","status":"Show","id":"data_19"},{"type":"Payroll Column","payrollColumn":"7","label":"ETF Employer Contribution","text":"","status":"Show","id":"data_20"},{"type":"Separators","payrollColumn":"7","label":"","text":"","status":"Show","id":"data_21"},{"type":"Text","payrollColumn":"7","label":"","text":"Totals","status":"Show","id":"data_22"},{"type":"Payroll Column","payrollColumn":"11","label":"Total EPF 20%","text":"","status":"Show","id":"data_23"},{"type":"Payroll Column","payrollColumn":"12","label":"Total for PAYE","text":"","status":"Show","id":"data_24"},{"type":"Payroll Column","payrollColumn":"16","label":"Net Salary","text":"","status":"Show","id":"data_25"}]', NULL, '2016-06-29 22:07:12', '2016-06-29 22:07:12');
INSERT INTO `Payroll` VALUES
(1,'Sri Lanka Payroll Sample',4,1,NULL,'[\"5\",\"8\",\"9\",\"10\",\"6\",\"7\",\"11\",\"12\",\"13\",\"14\",\"15\",\"16\"]','2016-03-01','2016-03-31','Draft', 1);
INSERT INTO `PayrollColumns` VALUES
(5,'LK - Basic Salary',NULL,'[\"1\"]','[]','[]','[]',5,'No','Yes','0.00',NULL,NULL),
(6,'LK - Fixed Allowance',NULL,'[\"2\"]','[]','[]','[]',6,'No','Yes','0.00',NULL,NULL),
(7,'LK - Gross Pay',NULL,'[]','[]','[\"5\",\"6\"]','[]',7,'No','Yes','0.00',NULL,NULL),
(8,'LK - EPF Employee Contribution',NULL,'[]','[\"1\"]','[]','[]',8,'No','Yes','0.00',NULL,NULL),
(9,'LK - EPF Employer Contribution',NULL,'[]','[\"2\"]','[]','[]',9,'No','Yes','0.00',NULL,NULL),
(10,'LK - ETF Employer Contribution',NULL,'[]','[\"3\"]','[]','[]',10,'No','Yes','0.00',NULL,NULL),
(11,'LK - Total EPF 20%',NULL,'[]','[]','[\"8\",\"9\"]','[]',11,'No','Yes','0.00',NULL,NULL),
(12,'LK - Total for PAYE',NULL,'[]','[]','[\"7\"]','[]',12,'No','Yes','0.00',NULL,NULL),
(13,'LK - PAYE Tax',NULL,'[]','[\"4\"]','[]','[]',13,'No','Yes','0.00',NULL,NULL),
(14,'LK - Stamp Duty',NULL,'[]','[\"5\"]','[]','[]',14,'No','Yes','0.00',NULL,NULL),
(15,'LK - Total Deductions',NULL,'[]','[]','[\"8\",\"13\",\"14\"]','[]',15,'No','Yes','0.00',NULL,NULL),
(16,'LK - Salary to Bank',NULL,'[]','[]','[\"7\"]','[\"15\"]',16,'No','Yes','0.00',NULL,NULL);
INSERT INTO `Deductions` VALUES
(1,'EPF Employee Contribution','[]','[]',7,'[{\"lowerCondition\":\"No Lower Limit\",\"lowerLimit\":\"0\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":\"0\",\"amount\":\"X*0.08\",\"id\":\"rangeAmounts_1\"}]',1),
(2,'EPF Employer Contribution','[]','[]',7,'[{\"lowerCondition\":\"No Lower Limit\",\"lowerLimit\":\"0\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":\"0\",\"amount\":\"X*0.12\",\"id\":\"rangeAmounts_1\"}]',1),
(3,'ETF Employer Contribution','[]','[]',7,'[{\"lowerCondition\":\"No Lower Limit\",\"lowerLimit\":\"0\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":\"0\",\"amount\":\"X*0.03\",\"id\":\"rangeAmounts_1\"}]',1),
(4,'PAYE Tax','[]','[]',12,'[{\"lowerCondition\":\"No Lower Limit\",\"lowerLimit\":\"0\",\"upperCondition\":\"lte\",\"upperLimit\":\"62500\",\"amount\":\"0\",\"id\":\"rangeAmounts_1\"},{\"lowerCondition\":\"gt\",\"lowerLimit\":\"62500\",\"upperCondition\":\"lte\",\"upperLimit\":\"104167\",\"amount\":\"X*0.04 - 2500\",\"id\":\"rangeAmounts_2\"},{\"lowerCondition\":\"gt\",\"lowerLimit\":\"104167\",\"upperCondition\":\"lte\",\"upperLimit\":\"145833\",\"amount\":\"X*0.08 - 6667\",\"id\":\"rangeAmounts_3\"},{\"lowerCondition\":\"gt\",\"lowerLimit\":\"145833\",\"upperCondition\":\"lte\",\"upperLimit\":\"187500\",\"amount\":\"X*0.12-12500\",\"id\":\"rangeAmounts_4\"},{\"lowerCondition\":\"gt\",\"lowerLimit\":\"187500\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":\"0\",\"amount\":\"X*0.16 - 20000\",\"id\":\"rangeAmounts_5\"}]',1),
(5,'Stamp Duty','[]','[]',12,'[{\"lowerCondition\":\"No Lower Limit\",\"lowerLimit\":\"0\",\"upperCondition\":\"lte\",\"upperLimit\":\"25000\",\"amount\":\"0\",\"id\":\"rangeAmounts_1\"},{\"lowerCondition\":\"gt\",\"lowerLimit\":\"25000\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":\"0\",\"amount\":\"25\",\"id\":\"rangeAmounts_2\"}]',1);
INSERT INTO `DeductionGroup` VALUES
(2,'Ghana Payroll Calculation','');
INSERT INTO `PayslipTemplates` VALUES
(2,'Ghana Default','[{\"type\":\"Company Name\",\"payrollColumn\":\"NULL\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_1\"},{\"type\":\"Separators\",\"payrollColumn\":\"NULL\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_3\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"105\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_4\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"106\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_5\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"107\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_6\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"112\",\"label\":\"Total\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_7\"},{\"type\":\"Separators\",\"payrollColumn\":\"NULL\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_8\"},{\"type\":\"Text\",\"payrollColumn\":\"NULL\",\"label\":\"\",\"text\":\"Deductions \",\"status\":\"Show\",\"id\":\"data_9\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"109\",\"label\":\"SSNIT (5.5%)\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_10\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"113\",\"label\":\"Tax (1st Level 5%)\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_11\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"114\",\"label\":\"Tax (2nd Level 10%)\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_12\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"115\",\"label\":\"Tax (3rd Level 17.5%)\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_13\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"120\",\"label\":\"Tax (4th Level 25%)\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_14\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"121\",\"label\":\"Overtime Allow. Tax (5%)\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_15\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"122\",\"label\":\"Total (PAYE Tax)\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_16\"},{\"type\":\"Separators\",\"payrollColumn\":\"NULL\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_17\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"123\",\"label\":\"Sub Total\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_18\"},{\"type\":\"Separators\",\"payrollColumn\":\"NULL\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_19\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"125\",\"label\":\"Netto Monthly Salary\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_20\"}]',NULL,'2016-08-30 21:53:13','2016-08-30 21:53:13');
INSERT INTO `Payroll` VALUES
(6,'Ghana Payroll Sample',4,1,NULL,'[\"123\",\"125\",\"106\",\"124\",\"113\",\"114\",\"115\",\"121\",\"107\",\"120\",\"109\",\"105\",\"112\",\"108\",\"122\"]','2016-08-01','2016-08-31','Draft',2);
INSERT INTO `PayrollColumns` VALUES
(105,'GH - Salary (Basic)',NULL,'[\"1\"]','[]','[]','[]',1,'No','Yes','0.00','',''),
(106,'GH - Housing Allowance',NULL,'[]','[\"101\"]','[]','[]',2,'No','Yes','0.00','',''),
(107,'GH - Overtime Allowance',NULL,'[]','[\"102\"]','[]','[]',3,'No','Yes','0.00','',''),
(108,'GH - Total',NULL,'[]','[]','[\"106\",\"107\",\"105\"]','[]',4,'No','Yes','0.00','',''),
(109,'GH - SSNIT',NULL,'[]','[\"103\"]','[]','[]',5,'No','Yes','0.00','',''),
(112,'GH - Taxable Income',NULL,'[]','[]','[\"106\",\"105\"]','[\"109\"]',7,'No','Yes','0.00','',''),
(113,'GH - Next 108 GHC',NULL,'[]','[\"106\"]','[]','[]',9,'No','Yes','0.00','',''),
(114,'GH - Next 151 GHC',NULL,'[]','[\"107\"]','[]','[]',10,'No','Yes','0.00','',''),
(115,'GH - Next 2765 GHC',NULL,'[]','[\"108\"]','[]','[]',11,'No','Yes','0.00','',''),
(120,'GH - Remaining after 3240 GHC',NULL,'[]','[\"111\"]','[]','[]',12,'No','Yes','0.00','',''),
(121,'GH - Overtime Allow. Tax',NULL,'[]','[]','[]','[]',13,'No','Yes','0.00','[{\"name\":\"O\",\"column\":\"107\",\"id\":\"calculation_columns_1\"}]','O*0.05'),
(122,'GH - Total (PAYE Tax)',NULL,'[]','[]','[\"113\",\"114\",\"115\",\"120\",\"121\"]','[]',14,'No','Yes','0.00','',''),
(123,'GH - Deductions - Sub Total',NULL,'[]','[]','[\"109\",\"122\"]','[]',15,'No','Yes','0.00','',''),
(125,'GH - Final Total',NULL,'[]','[]','[\"108\"]','[\"123\"]',16,'No','Yes','0.00','','');
INSERT INTO `Deductions` VALUES
(101,'Housing Allowance (10%)','[]','[\"1\"]',NULL,'[{\"lowerCondition\":\"No Lower Limit\",\"lowerLimit\":0,\"upperCondition\":\"No Upper Limit\",\"upperLimit\":0,\"amount\":\"X*0.1\",\"id\":\"rangeAmounts_1\"}]',2),
(102,'Overtime Allowance (10%)','[]','[\"1\"]',NULL,'[{\"lowerCondition\":\"No Lower Limit\",\"lowerLimit\":0,\"upperCondition\":\"No Upper Limit\",\"upperLimit\":0,\"amount\":\"X*0.1\",\"id\":\"rangeAmounts_1\"}]',2),
(103,'SSNIT','[]','[\"1\"]',NULL,'[{\"lowerCondition\":\"No Lower Limit\",\"lowerLimit\":0,\"upperCondition\":\"No Upper Limit\",\"upperLimit\":0,\"amount\":\"X*0.055\",\"id\":\"rangeAmounts_1\"}]',2),
(104,'Tax - Ghana','[]','[]',NULL,'',2),
(106,'Next 108 GHC','[]','[]',112,'[{\"lowerCondition\":\"gte\",\"lowerLimit\":\"216\",\"upperCondition\":\"lt\",\"upperLimit\":\"324\",\"amount\":\"X*0.05\",\"id\":\"rangeAmounts_1\"},{\"lowerCondition\":\"gte\",\"lowerLimit\":\"324\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":0,\"amount\":\"5.4\",\"id\":\"rangeAmounts_2\"}]',2),
(107,'Next 151 GHC','[]','[]',112,'[{\"lowerCondition\":\"gte\",\"lowerLimit\":\"324\",\"upperCondition\":\"lt\",\"upperLimit\":\"475\",\"amount\":\"(X-324) * 0.1\",\"id\":\"rangeAmounts_1\"},{\"lowerCondition\":\"gte\",\"lowerLimit\":\"259\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":0,\"amount\":\"15.10\",\"id\":\"rangeAmounts_2\"}]',2),
(108,'Next 2765 GHC','[]','[]',112,'[{\"lowerCondition\":\"gte\",\"lowerLimit\":\"475\",\"upperCondition\":\"lt\",\"upperLimit\":\"3240\",\"amount\":\"(X - 475) * 0.175\",\"id\":\"rangeAmounts_1\"},{\"lowerCondition\":\"gte\",\"lowerLimit\":\"3240\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":0,\"amount\":\"483.88\",\"id\":\"rangeAmounts_2\"}]',2),
(111,'Remaining after 3240 GHC','[]','[]',112,'[{\"lowerCondition\":\"gte\",\"lowerLimit\":\"3240\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":0,\"amount\":\"(X-3240)*0.25\",\"id\":\"rangeAmounts_1\"}]',2);
ALTER table `Files` add column `size` bigint(20) NULL;
ALTER table `Files` add column `size_text` varchar(20) NULL;
ALTER table `CompanyDocuments` add column `share_departments` varchar(100) NULL;
ALTER table `CompanyDocuments` add column `share_employees` varchar(100) NULL;
ALTER table `CompanyDocuments` add column `share_userlevel` varchar(100) NULL;
ALTER table `CompanyDocuments` modify column `share_userlevel` varchar(100) NULL;
ALTER table `Notifications` add column `employee` bigint(20) NULL;
create table `Forms` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`description` varchar(500) NULL,
`items` text NULL,
`created` timestamp NULL default '0000-00-00 00:00:00',
`updated` timestamp NULL default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployeeForms` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`form` bigint(20) NOT NULL,
`status` enum('Pending','Completed') default 'Pending',
`created` timestamp NULL default '0000-00-00 00:00:00',
`updated` timestamp NULL default '0000-00-00 00:00:00',
CONSTRAINT `Fk_EmployeeForms_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeForms_Forms` FOREIGN KEY (`form`) REFERENCES `Forms` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Migrations` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`file` varchar(50) NOT NULL,
`version` int(11) NOT NULL,
`created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00',
`status` enum('Pending','Up','Down','UpError','DownError') default 'Pending',
`last_error` varchar(500) NULL,
primary key (`id`),
unique key `KEY_Migrations_file` (`file`),
index `KEY_Migrations_status` (`status`),
index `KEY_Migrations_version` (`version`)
) engine=innodb default charset=utf8;

View File

@@ -0,0 +1,18 @@
<?php
ini_set('error_log', 'data/icehrm.log');
define('CLIENT_NAME', 'icehrmpro');
define('APP_BASE_PATH', '/vagrant/build/app/');
define('CLIENT_BASE_PATH', '/vagrant/deployment/clients/dev/');
define('BASE_URL','http://app.app.dev/');
define('CLIENT_BASE_URL','http://clients.app.dev/dev/');
define('APP_DB', 'dev');
define('APP_USERNAME', 'dev');
define('APP_PASSWORD', 'dev');
define('APP_HOST', 'localhost');
define('APP_CON_STR', 'mysqli://'.APP_USERNAME.':'.APP_PASSWORD.'@'.APP_HOST.'/'.APP_DB);
//file upload
define('FILE_TYPES', 'jpg,png,jpeg');
define('MAX_FILE_SIZE_KB', 10 * 1024);

View File

@@ -0,0 +1,7 @@
<?php
if(php_sapi_name() != 'cli'){
exit();
}
include ('config.php');
include (APP_BASE_PATH.'crons/cron.php');

View File

@@ -0,0 +1,3 @@
<?php
include ('config.php');
include (APP_BASE_PATH.'data.php');

View File

@@ -0,0 +1 @@
Test File

View File

@@ -0,0 +1,18 @@
<?php
include ('config.php');
if(!isset($_REQUEST['g']) || !isset($_REQUEST['n'])){
header("Location:".CLIENT_BASE_URL."login.php");
exit();
}
$group = $_REQUEST['g'];
$name= $_REQUEST['n'];
$groups = array('admin','modules');
if($group == 'admin' || $group == 'modules'){
$name = str_replace("..","",$name);
$name = str_replace("/","",$name);
include APP_BASE_PATH.'/'.$group.'/'.$name.'/entry.php';
}else{
exit();
}

View File

@@ -0,0 +1,3 @@
<?php
include ('config.php');
include (APP_BASE_PATH.'fileupload.php');

View File

@@ -0,0 +1,3 @@
<?php
include ('config.php');
include (APP_BASE_PATH.'fileupload_page.php');

View File

@@ -0,0 +1,3 @@
<?php
include (APP_BASE_PATH.'header.php');

View File

@@ -0,0 +1,22 @@
<?php
if(!file_exists('config.php')){
header("Location:install/");
exit();
}
include ('config.php');
if(!isset($_REQUEST['g']) || !isset($_REQUEST['n'])){
header("Location:".CLIENT_BASE_URL."login.php");
exit();
}
$group = $_REQUEST['g'];
$name= $_REQUEST['n'];
$groups = array('admin','modules');
if($group == 'admin' || $group == 'modules'){
$name = str_replace("..","",$name);
$name = str_replace("/","",$name);
include APP_BASE_PATH.'/'.$group.'/'.$name.'/index.php';
}else{
exit();
}

View File

@@ -0,0 +1,3 @@
<?php
include ('config.php');
include (APP_BASE_PATH.'login.php');

View File

@@ -0,0 +1,3 @@
<?php
include ('config.php');
include (APP_BASE_PATH.'logout.php');

View File

@@ -0,0 +1,3 @@
<?php
include ('config.php');
include (APP_BASE_PATH.'rest.php');

View File

@@ -0,0 +1,3 @@
<?php
include ('config.php');
include (APP_BASE_PATH.'service.php');

View File

@@ -0,0 +1,18 @@
<?php
include ('config.php');
if(!isset($_REQUEST['g']) || !isset($_REQUEST['n'])){
header("Location:".CLIENT_BASE_URL."login.php");
exit();
}
$group = $_REQUEST['g'];
$name= $_REQUEST['n'];
$groups = array('admin','modules');
if($group == 'admin' || $group == 'modules'){
$name = str_replace("..","",$name);
$name = str_replace("/","",$name);
include APP_BASE_PATH.'/'.$group.'/'.$name.'/update.php';
}else{
exit();
}

View File

@@ -0,0 +1,18 @@
<?php
ini_set('error_log', 'data/icehrm.log');
define('CLIENT_NAME', 'icehrmpro');
define('APP_BASE_PATH', '/vagrant/build/app/');
define('CLIENT_BASE_PATH', '/vagrant/deployment/clients/test/');
define('BASE_URL','http://app.app.dev/');
define('CLIENT_BASE_URL','http://clients.app.dev/test/');
define('APP_DB', 'testing');
define('APP_USERNAME', 'testing');
define('APP_PASSWORD', 'testing');
define('APP_HOST', 'localhost');
define('APP_CON_STR', 'mysqli://'.APP_USERNAME.':'.APP_PASSWORD.'@'.APP_HOST.'/'.APP_DB);
//file upload
define('FILE_TYPES', 'jpg,png,jpeg');
define('MAX_FILE_SIZE_KB', 10 * 1024);

View File

@@ -0,0 +1,7 @@
<?php
if(php_sapi_name() != 'cli'){
exit();
}
include ('config.php');
include (APP_BASE_PATH.'crons/cron.php');

View File

@@ -0,0 +1,3 @@
<?php
include ('config.php');
include (APP_BASE_PATH.'data.php');

View File

@@ -0,0 +1 @@
Test File

View File

@@ -0,0 +1,18 @@
<?php
include ('config.php');
if(!isset($_REQUEST['g']) || !isset($_REQUEST['n'])){
header("Location:".CLIENT_BASE_URL."login.php");
exit();
}
$group = $_REQUEST['g'];
$name= $_REQUEST['n'];
$groups = array('admin','modules');
if($group == 'admin' || $group == 'modules'){
$name = str_replace("..","",$name);
$name = str_replace("/","",$name);
include APP_BASE_PATH.'/'.$group.'/'.$name.'/entry.php';
}else{
exit();
}

View File

@@ -0,0 +1,3 @@
<?php
include ('config.php');
include (APP_BASE_PATH.'fileupload.php');

View File

@@ -0,0 +1,3 @@
<?php
include ('config.php');
include (APP_BASE_PATH.'fileupload_page.php');

View File

@@ -0,0 +1,3 @@
<?php
include (APP_BASE_PATH.'header.php');

View File

@@ -0,0 +1,22 @@
<?php
if(!file_exists('config.php')){
header("Location:install/");
exit();
}
include ('config.php');
if(!isset($_REQUEST['g']) || !isset($_REQUEST['n'])){
header("Location:".CLIENT_BASE_URL."login.php");
exit();
}
$group = $_REQUEST['g'];
$name= $_REQUEST['n'];
$groups = array('admin','modules');
if($group == 'admin' || $group == 'modules'){
$name = str_replace("..","",$name);
$name = str_replace("/","",$name);
include APP_BASE_PATH.'/'.$group.'/'.$name.'/index.php';
}else{
exit();
}

View File

@@ -0,0 +1,3 @@
<?php
include ('config.php');
include (APP_BASE_PATH.'login.php');

View File

@@ -0,0 +1,3 @@
<?php
include ('config.php');
include (APP_BASE_PATH.'logout.php');

View File

@@ -0,0 +1,3 @@
<?php
include ('config.php');
include (APP_BASE_PATH.'rest.php');

View File

@@ -0,0 +1,3 @@
<?php
include ('config.php');
include (APP_BASE_PATH.'service.php');

View File

@@ -0,0 +1,18 @@
<?php
include ('config.php');
if(!isset($_REQUEST['g']) || !isset($_REQUEST['n'])){
header("Location:".CLIENT_BASE_URL."login.php");
exit();
}
$group = $_REQUEST['g'];
$name= $_REQUEST['n'];
$groups = array('admin','modules');
if($group == 'admin' || $group == 'modules'){
$name = str_replace("..","",$name);
$name = str_replace("/","",$name);
include APP_BASE_PATH.'/'.$group.'/'.$name.'/update.php';
}else{
exit();
}

2
docker/docker.md Normal file
View File

@@ -0,0 +1,2 @@
https://hub.docker.com/r/thilinah/icehrm/
docker run -i -t -p 192.168.99.100:80:80 thilinah/icehrm /bin/start.sh

30
docker/start.sh Normal file
View File

@@ -0,0 +1,30 @@
#!/bin/bash
service nginx start
service php5-fpm start
service mysql start
if [ -d "/usr/share/nginx/www/" ]; then
echo 'Already Installed'
else
echo 'Installing IceHrm'
cd /usr/share/nginx
curl -s https://api.github.com/repos/gamonoid/icehrm/releases/latest | jq -r ".assets[] | select(.name) | .browser_download_url" | grep '.zip' | xargs wget
ls | grep 'zip' | xargs unzip
mv `ls -d */ | grep icehrm | head -1` www/
rm *.zip
echo 'Your MySQL root password : icehrmpwd'
echo "Following will be needed during installation"
echo "--------------------------------------------"
echo 'IceHrm Database : icehrmdb'
echo 'IceHrm User : icehrmuser'
echo 'IceHrm User Password : icehrmuserpwd'
echo 'IceHrm Database host : localhost'
echo 'Please visit your docker installation url to begin installation.'
fi
/bin/bash

View File

@@ -41,7 +41,7 @@ class AttendanceActionManager extends SubActionManager{
//check if dates are differnet //check if dates are differnet
if(!empty($outDate) && $inDate != $outDate){ if(!empty($outDate) && $inDate != $outDate){
return new IceResponse(IceResponse::ERROR,"Attendance entry should be within a single day"); return new IceResponse(IceResponse::ERROR,LanguageManager::tran("Attendance entry should be within a single day"));
} }
//compare dates //compare dates

View File

@@ -19,6 +19,52 @@ if (!class_exists('AttendanceAdminManager')) {
$this->addModelClass('Attendance'); $this->addModelClass('Attendance');
} }
public function getDashboardItemData(){
$data = array();
$attendance = new Attendance();
$data['numberOfAttendanceLastWeek'] = $attendance->Count("in_time > '".date("Y-m-d H:i:s",strtotime("-1 week"))."'");
if(empty($data['numberOfAttendanceLastWeek'])){
$data['numberOfAttendanceLastWeek'] = 0;
}
return $data;
}
public function initQuickAccessMenu(){
UIManager::getInstance()->addQuickAccessMenuItem("Clocked In Employees","fa-clock-o",CLIENT_BASE_URL."?g=admin&n=attendance&m=admin_Employees#tabAttendanceStatus",array("Admin","Manager"));
}
public function initCalculationHooks(){
$this->addCalculationHook('AttendanceUtil_getTimeWorkedHours','Total Hours from Attendance','AttendanceUtil','getTimeWorkedHours');
$this->addCalculationHook('AttendanceUtil_getRegularWorkedHours','Total Regular Hours from Attendance','AttendanceUtil','getRegularWorkedHours');
$this->addCalculationHook('AttendanceUtil_getOverTimeWorkedHours','Total Overtime Hours from Attendance','AttendanceUtil','getOverTimeWorkedHours');
$this->addCalculationHook('AttendanceUtil_getWeeklyRegularWorkedHours','Total Weekly Regular Hours from Attendance','AttendanceUtil','getWeeklyBasedRegularHours');
$this->addCalculationHook('AttendanceUtil_getWeeklyOverTimeWorkedHours','Total Weekly Overtime Hours from Attendance','AttendanceUtil','getWeeklyBasedOvertimeHours');
}
}
}
if (!class_exists('AttendanceDashboardManager')) {
class AttendanceDashboardManager extends AbstractModuleManager{
public function initializeUserClasses(){
}
public function initializeFieldMappings(){
}
public function initializeDatabaseErrorMappings(){
}
public function setupModuleClassDefinitions(){
$this->addModelClass('Attendance');
}
} }
} }
@@ -174,3 +220,338 @@ if (!class_exists('AttendanceStatus')) {
} }
} }
} }
if (!class_exists('AttendanceUtil')) {
class AttendanceUtil{
public function getAttendanceSummary($employeeId, $startDate, $endDate){
$startTime = $startDate." 00:00:00";
$endTime = $endDate." 23:59:59";
$attendance = new Attendance();
$atts = $attendance->Find("employee = ? and in_time >= ? and out_time <= ?",array($employeeId, $startTime, $endTime));
$atCalClassName = SettingsManager::getInstance()->getSetting('Attendance: Overtime Calculation Class');
$atCal = new $atCalClassName();
$atSum = $atCal->getDataSeconds($atts, $startDate, true);
return $atSum;
}
public function getTimeWorkedHours($employeeId, $startDate, $endDate){
$atSum = $this->getAttendanceSummary($employeeId, $startDate, $endDate);
return round(($atSum['t']/60)/60,2);
}
public function getRegularWorkedHours($employeeId, $startDate, $endDate){
$atSum = $this->getAttendanceSummary($employeeId, $startDate, $endDate);
return round(($atSum['r']/60)/60,2);
}
public function getOverTimeWorkedHours($employeeId, $startDate, $endDate){
$atSum = $this->getAttendanceSummary($employeeId, $startDate, $endDate);
return round(($atSum['o']/60)/60,2);
}
public function getWeeklyBasedRegularHours($employeeId, $startDate, $endDate){
$atSum = $this->getWeeklyBasedOvertimeSummary($employeeId, $startDate, $endDate);
return round(($atSum['r']/60)/60,2);
}
public function getWeeklyBasedOvertimeHours($employeeId, $startDate, $endDate){
$atSum = $this->getWeeklyBasedOvertimeSummary($employeeId, $startDate, $endDate);
return round(($atSum['o']/60)/60,2);
}
public function getWeeklyBasedOvertimeSummary($employeeId, $startDate, $endDate){
$attendance = new Attendance();
$atTimeByWeek = array();
//Find weeks starting from sunday and ending from saturday in day period
$weeks = $this->getWeeklyDays($startDate,$endDate);
foreach($weeks as $k=>$week){
$startTime = $week[0]." 00:00:00";
$endTime = $week[count($week) - 1]." 23:59:59";
$atts = $attendance->Find("employee = ? and in_time >= ? and out_time <= ?",array($employeeId, $startTime, $endTime));
foreach($atts as $atEntry){
if($atEntry->out_time == "0000-00-00 00:00:00" || empty($atEntry->out_time)){
continue;
}
if(!isset($atTimeByWeek[$k])){
$atTimeByWeek[$k] = 0;
}
$diff = strtotime($atEntry->out_time) - strtotime($atEntry->in_time);
if($diff < 0){
$diff = 0;
}
$atTimeByWeek[$k] += $diff;
}
}
$overtimeStarts = SettingsManager::getInstance()->getSetting('Attendance: Overtime Start Hour');
$overtimeStarts = (is_numeric($overtimeStarts))?floatval($overtimeStarts)*60*60*5:0;
$regTime = 0;
$overTime = 0;
foreach($atTimeByWeek as $value){
if($value > $overtimeStarts){
$regTime += $overtimeStarts;
$overTime = $value - $overtimeStarts;
}else{
$regTime += $value;
}
}
return array('r'=>$regTime,'o'=>$overTime);
}
private function getWeeklyDays($startDate,$endDate){
$start = new DateTime($startDate);
$end = new DateTime($endDate.' 23:59');
$interval = new DateInterval('P1D');
$dateRange = new DatePeriod($start, $interval, $end);
$weekNumber = 1;
$weeks = array();
foreach ($dateRange as $date) {
$weeks[$weekNumber][] = $date->format('Y-m-d');
if ($date->format('w') == 6) {
$weekNumber++;
}
}
return $weeks;
}
}
}
if (!class_exists('BasicOvertimeCalculator')) {
class BasicOvertimeCalculator{
public function createAttendanceSummary($atts){
$atTimeByDay = array();
foreach($atts as $atEntry){
if($atEntry->out_time == "0000-00-00 00:00:00" || empty($atEntry->out_time)){
continue;
}
$atDate = date("Y-m-d",strtotime($atEntry->in_time));
if(!isset($atTimeByDay[$atDate])){
$atTimeByDay[$atDate] = 0;
}
$diff = strtotime($atEntry->out_time) - strtotime($atEntry->in_time);
if($diff < 0){
$diff = 0;
}
$atTimeByDay[$atDate] += $diff;
}
return $atTimeByDay;
}
public function calculateOvertime($atTimeByDay){
$overtimeStarts = SettingsManager::getInstance()->getSetting('Attendance: Overtime Start Hour');
$doubletimeStarts = SettingsManager::getInstance()->getSetting('Attendance: Double time Start Hour');
$overtimeStarts = (is_numeric($overtimeStarts))?floatval($overtimeStarts)*60*60:0;
$doubletimeStarts = (is_numeric($doubletimeStarts))?floatval($doubletimeStarts)*60*60:0;
$atTimeByDayNew = array();
foreach($atTimeByDay as $k=>$v){
$atTimeByDayNewEntry = array("t"=>$v,"r"=>0,"o"=>0,"d"=>0);
if($overtimeStarts > 0 && $v > $overtimeStarts){
$atTimeByDayNewEntry["r"] = $overtimeStarts;
if($doubletimeStarts > 0 && $doubletimeStarts > $overtimeStarts){
//calculate double time
if($v > $doubletimeStarts){
$atTimeByDayNewEntry['d'] = $v - $doubletimeStarts;
$atTimeByDayNewEntry['o'] = $doubletimeStarts - $overtimeStarts;
}else{
$atTimeByDayNewEntry['d'] = 0 ;
$atTimeByDayNewEntry['o'] = $v - $overtimeStarts;
}
}else{
//ignore double time
$atTimeByDayNewEntry['o'] = $v - $overtimeStarts;
}
}else{
//ignore overtime
$atTimeByDayNewEntry['r'] = $v;
}
$atTimeByDayNew[$k] = $atTimeByDayNewEntry;
}
return $atTimeByDayNew;
}
protected function removeAdditionalDays($atSummary, $actualStartDate){
$newAtSummary = array();
foreach($atSummary as $k => $v){
if(strtotime($k) >= strtotime($actualStartDate)){
$newAtSummary[$k] = $v;
}
}
return $newAtSummary;
}
public function getData($atts, $actualStartDate, $aggregate = false){
$atSummary = $this->createAttendanceSummary($atts);
$overtime = $this->calculateOvertime($this->removeAdditionalDays($atSummary, $actualStartDate));
if($aggregate){
$overtime = $this->aggregateData($overtime);
return $this->convertToHoursAggregated($overtime);
}else{
return $this->convertToHours($overtime);
}
}
public function getDataSeconds($atts, $actualStartDate, $aggregate = false){
$atSummary = $this->createAttendanceSummary($atts);
$overtime = $this->calculateOvertime($this->removeAdditionalDays($atSummary, $actualStartDate));
if($aggregate){
$overtime = $this->aggregateData($overtime);
return $overtime;
}else{
return $overtime;
}
}
public function convertToHours($overtime){
foreach($overtime as $k=>$v){
$overtime[$k]['t'] = $this->convertToHoursAndMinutes($overtime[$k]['t']);
$overtime[$k]['r'] = $this->convertToHoursAndMinutes($overtime[$k]['r']);
$overtime[$k]['o'] = $this->convertToHoursAndMinutes($overtime[$k]['o']);
$overtime[$k]['d'] = $this->convertToHoursAndMinutes($overtime[$k]['d']);
}
return $overtime;
}
public function convertToHoursAggregated($overtime){
$overtime['t'] = $this->convertToHoursAndMinutes($overtime['t']);
$overtime['r'] = $this->convertToHoursAndMinutes($overtime['r']);
$overtime['o'] = $this->convertToHoursAndMinutes($overtime['o']);
$overtime['d'] = $this->convertToHoursAndMinutes($overtime['d']);
return $overtime;
}
protected function aggregateData($overtime){
$ag = array("t"=>0,"r"=>0,"o"=>0,"d"=>0);
foreach($overtime as $k=>$v){
$ag['t'] += $v['t'];
$ag['r'] += $v['r'];
$ag['o'] += $v['o'];
$ag['d'] += $v['d'];
}
return $ag;
}
public function convertToHoursAndMinutes($val){
$sec = $val % 60;
$minutesTot = ($val - $sec)/60;
$minutes = $minutesTot % 60;
$hours = ($minutesTot - $minutes)/60;
if($hours < 10){
$hours = "0".$hours;
}
if($minutes < 10){
$minutes = "0".$minutes;
}
return $hours.":".$minutes;
}
}
}
if (!class_exists('CaliforniaOvertimeCalculator')) {
class CaliforniaOvertimeCalculator extends BasicOvertimeCalculator{
public function getData($atts, $actualStartDate, $aggregate = false){
if(count($atts) == 0){
return array();
}
$atSummary = $this->createAttendanceSummary($atts);
$overtime = $this->calculateOvertime($atSummary);
$workWeekStartDate = SettingsManager::getInstance()->getSetting('Attendance: Work Week Start Day');
//TODO - just assume a work week from Sunday to Saturday
//Find first Sunday in array
$firstDate = null;
//Find double time days (7th work day of a week without a break)
$doubleTimeDates = array();
$prvDate = null;
$consecutiveWorkDays = 1;
foreach($overtime as $k=>$v){
if($firstDate == null) {
$dw = date("w", strtotime($k));
if ($dw == $workWeekStartDate) {
$firstDate = $k;
}
}
if($firstDate != null){
if($prvDate != null && date('Y-m-d', strtotime('-1 day',strtotime($k))) == $prvDate){
$consecutiveWorkDays++;
if($consecutiveWorkDays == 7){
//This is a double time day
$overtime[$k]['d'] = $overtime[$k]['d'] + $overtime[$k]['o'];
$overtime[$k]['o'] = 0;
}
}
//Resetting $consecutiveWorkDays at the start of the work week
if($prvDate != null && date( "w", strtotime($k)) == $workWeekStartDate){
$consecutiveWorkDays = 1;
$prvDate = null;
}
$prvDate = $k;
}
}
$overtime = $this->removeAdditionalDays($overtime, $actualStartDate);
if($aggregate){
$overtime = $this->aggregateData($overtime);
return $this->convertToHoursAggregated($overtime);
}else{
return $this->convertToHours($overtime);
}
}
}
}

View File

@@ -0,0 +1,18 @@
<div class="col-lg-3 col-xs-12">
<div class="small-box bg-yellow">
<div class="inner">
<h3>
<t>Attendance</t>
</h3>
<p id="numberOfAttendanceLastWeek">
#_numberOfAttendanceLastWeek_# <t>Entries Last Week</t>
</p>
</div>
<div class="icon">
<i class="ion ion-clock"></i>
</div>
<a href="#_moduleLink_#" class="small-box-footer" id="attendanceLink">
<t>Monitor Attendance</t> <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>

View File

@@ -28,11 +28,8 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
?><div class="span9"> ?><div class="span9">
<ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;"> <ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;">
<li class="active"><a id="tabAttendance" href="#tabPageAttendance">Monitor Attendance</a></li> <li class="active"><a id="tabAttendance" href="#tabPageAttendance"><?=LanguageManager::tran('Monitor Attendance')?></a></li>
<li class=""><a id="tabAttendanceStatus" href="#tabPageAttendanceStatus">Current Clocked In Status</a></li> <li class=""><a id="tabAttendanceStatus" href="#tabPageAttendanceStatus"><?=LanguageManager::tran('Current Clocked In Status')?></a></li>
<!--
<li class=""><a id="tabAttendanceData" href="#tabPageAttendanceData">Attendance Data Update</a></li>
-->
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@@ -52,20 +49,6 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
</div> </div>
</div> </div>
<!--
<div class="tab-pane" id="tabPageAttendanceData">
<div class="control-group" id="field__id_">
<div class="controls">
<textarea class="input-xxlarge" placeholder="Insert CSV data to submit" type="textarea" width="96%" rows="100" id="attendanceData" name="attendanceData"></textarea>
</div>
</div>
<div class="control-group">
<div class="controls">
<button onclick="return false;" class="btn">Update Attendance Data</button>
</div>
</div>
</div>
-->
</div> </div>

View File

@@ -158,6 +158,13 @@ AttendanceAdapter.method('saveFailCallback', function(callBackData) {
this.showMessage("Error saving attendance entry", callBackData); this.showMessage("Error saving attendance entry", callBackData);
}); });
AttendanceAdapter.method('isSubProfileTable', function() {
if(this.user.user_level == "Admin"){
return false;
}else{
return true;
}
});
/* /*
@@ -216,3 +223,12 @@ AttendanceStatusAdapter.method('getActionButtonsHtml', function(id,data) {
} }
return html; return html;
}); });
AttendanceStatusAdapter.method('isSubProfileTable', function() {
if(this.user.user_level == "Admin"){
return false;
}else{
return true;
}
});

View File

@@ -3,7 +3,8 @@
"menu":"Employees", "menu":"Employees",
"order":"8", "order":"8",
"icon":"fa-clock-o", "icon":"fa-clock-o",
"user_levels":["Admin"], "user_levels":["Admin","Manager"],
"dashboardPosition":5,
"permissions": "permissions":
{} {}

View File

@@ -21,6 +21,14 @@ if (!class_exists('Company_structureAdminManager')) {
$this->addModelClass('CompanyStructure'); $this->addModelClass('CompanyStructure');
} }
public function getDashboardItemData(){
$data = array();
$company = new CompanyStructure();
$data['numberOfCompanyStuctures'] = $company->Count("1 = 1");
return $data;
}
} }
} }
@@ -48,5 +56,70 @@ if (!class_exists('CompanyStructure')) {
return new IceResponse(IceResponse::SUCCESS,""); return new IceResponse(IceResponse::SUCCESS,"");
} }
public static function getAllChildCompanyStructures($companyStructureId){
$structures = array();
$companyStructure = new CompanyStructure();
$companyStructure->Load("id = ?",array($companyStructureId));
if($companyStructure->id != $companyStructureId || empty($companyStructure->id)){
return new IceResponse(IceResponse::ERROR, array());
}
self::getChildCompanyStructures($companyStructure, $structures);
$structures[$companyStructure->id] = $companyStructure;
return new IceResponse(IceResponse::SUCCESS, array_values($structures));
}
private static function getChildCompanyStructures($companyStructure, &$structures){
$child = new CompanyStructure();
$children = $child->Find("parent = ?",array($companyStructure->id));
if(!empty($children)){
foreach($children as $c){
if(isset($structures[$c->id])){
continue;
}
$structures[$c->id] = $c;
self::getChildCompanyStructures($c, $structures);
}
}
}
public static function isHeadOfCompanyStructure($companyStructureId, $profileId){
$companyStructure = new CompanyStructure();
$companyStructure->Load("id = ?",array($companyStructureId));
if(isset($companyStructure->heads) && !empty($companyStructure->heads)){
$heads = json_decode($companyStructure->heads);
if(is_array($heads) && !empty($heads) && in_array($profileId, $heads)){
return true;
}
}
return false;
}
}
}
if (!class_exists('Timezone')) {
class Timezone extends ICEHRM_Record {
var $_table = 'Timezones';
public function getAdminAccess(){
return array("get","element","save","delete");
}
public function getManagerAccess(){
return array("get","element","save","delete");
}
public function getUserAccess(){
return array("get","element");
}
} }
} }

View File

@@ -0,0 +1,17 @@
<div class="col-lg-3 col-xs-12">
<div class="small-box bg-green">
<div class="inner">
<h3><t>Company</t></h3>
<p id="numberOfCompanyStuctures">
#_numberOfCompanyStuctures_# <t>Departments</t>
</p>
</div>
<div class="icon">
<i class="ion ion-shuffle"></i>
</div>
<a href="#_moduleLink_#" class="small-box-footer" id="companyLink">
<t>Manage</t> <t>Company</t> <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>

View File

@@ -54,8 +54,8 @@ path.link {
<div class="span9"> <div class="span9">
<ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;"> <ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;">
<li class="active"><a id="tabCompanyStructure" href="#tabPageCompanyStructure">Company Structure</a></li> <li class="active"><a id="tabCompanyStructure" href="#tabPageCompanyStructure"><?=LanguageManager::tran('Company Structure')?></a></li>
<li><a id="tabCompanyGraph" href="#tabPageCompanyGraph">Company Graph</a></li> <li><a id="tabCompanyGraph" href="#tabPageCompanyGraph"><?=LanguageManager::tran('Company Graph')?></a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">

View File

@@ -17,6 +17,7 @@ CompanyStructureAdapter.method('getDataMapping', function() {
"address", "address",
"type", "type",
"country", "country",
"timezone",
"parent" "parent"
]; ];
}); });
@@ -28,6 +29,7 @@ CompanyStructureAdapter.method('getHeaders', function() {
{ "sTitle": "Address","bSortable":false}, { "sTitle": "Address","bSortable":false},
{ "sTitle": "Type"}, { "sTitle": "Type"},
{ "sTitle": "Country", "sClass": "center" }, { "sTitle": "Country", "sClass": "center" },
{ "sTitle": "Time Zone"},
{ "sTitle": "Parent Structure"} { "sTitle": "Parent Structure"}
]; ];
}); });
@@ -39,8 +41,10 @@ CompanyStructureAdapter.method('getFormFields', function() {
[ "description", {"label":"Details","type":"textarea","validation":""}], [ "description", {"label":"Details","type":"textarea","validation":""}],
[ "address", {"label":"Address","type":"textarea","validation":"none"}], [ "address", {"label":"Address","type":"textarea","validation":"none"}],
[ "type", {"label":"Type","type":"select","source":[["Company","Company"],["Head Office","Head Office"],["Regional Office","Regional Office"],["Department","Department"],["Unit","Unit"],["Sub Unit","Sub Unit"],["Other","Other"]]}], [ "type", {"label":"Type","type":"select","source":[["Company","Company"],["Head Office","Head Office"],["Regional Office","Regional Office"],["Department","Department"],["Unit","Unit"],["Sub Unit","Sub Unit"],["Other","Other"]]}],
[ "country", {"label":"Country","type":"select","remote-source":["Country","code","name"]}], [ "country", {"label":"Country","type":"select2","remote-source":["Country","code","name"]}],
[ "parent", {"label":"Parent Structure","type":"select","allow-null":true,"remote-source":["CompanyStructure","id","title"]}] [ "timezone", {"label":"Time Zone","type":"select2","allow-null":false,"remote-source":["Timezone","name","details"]}],
[ "parent", {"label":"Parent Structure","type":"select","allow-null":true,"remote-source":["CompanyStructure","id","title"]}],
[ "heads", {"label":"Heads","type":"select2multi","allow-null":true,"remote-source":["Employee","id","first_name+last_name"]}]
]; ];
}); });
@@ -298,7 +302,7 @@ CompanyGraphAdapter.method('fixCyclicParent', function(sourceData) {
}); });
CompanyGraphAdapter.method('getHelpLink', function () { CompanyGraphAdapter.method('getHelpLink', function () {
return 'http://blog.icehrm.com/?page_id=61'; return 'http://blog.icehrm.com/docs/companystructure/';
}); });

View File

@@ -4,6 +4,7 @@
"order":"2", "order":"2",
"icon":"fa-building-o", "icon":"fa-building-o",
"user_levels":["Admin","Manager"], "user_levels":["Admin","Manager"],
"dashboardPosition":2,
"permissions": "permissions":
{ {

View File

@@ -40,13 +40,25 @@ class DashboardActionManager extends SubActionManager{
$attendance = new Attendance(); $attendance = new Attendance();
$data['numberOfAttendanceLastWeek'] = $attendance->Count("in_time > '".date("Y-m-d H:i:s",strtotime("-1 week"))."'"); $data['numberOfAttendanceLastWeek'] = $attendance->Count("in_time > '".date("Y-m-d H:i:s",strtotime("-1 week"))."'");
if(empty($data['numberOfAttendanceLastWeek'])){
$data['numberOfAttendanceLastWeek'] = 0;
}
$empLeave = new EmployeeLeave(); $empLeave = new EmployeeLeave();
$data['numberOfLeaves'] = $empLeave->Count("date_start > '".date("Y-m-d")."'"); $data['numberOfLeaves'] = $empLeave->Count("date_start > '".date("Y-m-d")."'");
$timeEntry = new EmployeeTimeEntry(); $timeEntry = new EmployeeTimeEntry();
$data['numberOfAttendanceLastWeek'] = $attendance->Count("in_time > '".date("Y-m-d H:i:s",strtotime("-1 week"))."'"); $data['numberOfAttendanceLastWeek'] = $timeEntry->Count("in_time > '".date("Y-m-d H:i:s",strtotime("-1 week"))."'");
$candidate = new Candidate();
$data['numberOfCandidates'] = $candidate->Count("1 = 1");
$job = new Job();
$data['numberOfJobs'] = $job->Count("status = 'Active'");
$course = new Course();
$data['numberOfCourses'] = $course->Count("1 = 1");
return new IceResponse(IceResponse::SUCCESS,$data); return new IceResponse(IceResponse::SUCCESS,$data);

View File

@@ -26,166 +26,37 @@ define('MODULE_PATH',dirname(__FILE__));
include APP_BASE_PATH.'header.php'; include APP_BASE_PATH.'header.php';
include APP_BASE_PATH.'modulejslibs.inc.php'; include APP_BASE_PATH.'modulejslibs.inc.php';
?><div class="span9"> ?><div class="span9">
<div id="iceannon">
<div class="callout callout-warning lead" style="font-size: 14px;">
<h4>Why not upgrade to IceHrm Pro Version</h4>
<p>
IceHrm Pro is the feature rich upgrade to IceHrm open source version. It comes with improved modules for
employee management, leave management, LDAP support and number of other features over open source version.
Hit this <a href="http://icehrm.com/#compare" class="btn btn-primary btn-xs target="_blank">link</a> to do a full one to one comparison.
Also you can learn more about IceHrm Pro <a href="http://blog.icehrm.com/icehrm-pro/" class="btn btn-primary btn-xs" target="_blank">here</a>
<br/>
<br/>
<a href="http://icehrm.com/modules.php" class="btn btn-success btm-xs" target="_blank"><i class="fa fa-checkout"></i> Buy IceHrm Pro</a>
</p>
</div>
</div>
<div class="row"> <div class="row">
<div class="col-lg-3 col-xs-6"> <?php
<!-- small box --> $moduleManagers = BaseService::getInstance()->getModuleManagers();
<div class="small-box bg-aqua"> $dashBoardList = array();
<div class="inner"> foreach($moduleManagers as $moduleManagerObj){
<h3>
People
</h3>
<p id="numberOfEmployees">
.. Employees
</p>
</div>
<div class="icon">
<i class="ion ion-person-stalker"></i>
</div>
<a href="#" class="small-box-footer" id="employeeLink">
Manage Employees <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div><!-- ./col -->
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-green">
<div class="inner">
<h3 id="numberOfCompanyStuctures">..</h3>
<p >
Company Structures
</p>
</div>
<div class="icon">
<i class="ion ion-shuffle"></i>
</div>
<a href="#" class="small-box-footer" id="companyLink">
Manage Company <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div><!-- ./col -->
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-yellow">
<div class="inner">
<h3>Users</h3>
<p id="numberOfUsers">
.. Users
</p>
</div>
<div class="icon">
<i class="ion ion-person-add"></i>
</div>
<a href="#" class="small-box-footer" id="usersLink">
Manage Users <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div><!-- ./col -->
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-red">
<div class="inner">
<h3 id="numberOfProjects">..</h3>
<p>
Active Projects
</p>
</div>
<div class="icon">
<i class="ion ion-pie-graph"></i>
</div>
<a href="#" class="small-box-footer" id="projectsLink">
Update Clients/Projects <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div><!-- ./col -->
</div>
<div class="row"> //Check if this is not an admin module
<div class="col-lg-3 col-xs-6"> if($moduleManagerObj->getModuleType() != 'admin'){
<!-- small box --> continue;
<div class="small-box bg-yellow"> }
<div class="inner">
<h3>
Attendance
</h3>
<p id="numberOfAttendanceLastWeek">
.. Entries Last Week
</p>
</div>
<div class="icon">
<i class="ion ion-clock"></i>
</div>
<a href="#" class="small-box-footer" id="attendanceLink">
Monitor Attendance <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div><!-- ./col -->
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-red">
<div class="inner">
<h3 id="numberOfLeaves">..</h3>
<p >Upcoming Leaves</p>
</div>
<div class="icon">
<i class="ion ion-calendar"></i>
</div>
<a href="#" class="small-box-footer" id="leaveLink">
Leave Management <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div><!-- ./col -->
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-teal">
<div class="inner">
<h3>Reports</h3>
<p>
View / Download Reports
</p>
</div>
<div class="icon">
<i class="ion ion-document-text"></i>
</div>
<a href="#" class="small-box-footer" id="reportsLink">
Create a Report <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div><!-- ./col -->
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-green">
<div class="inner">
<h3>Settings</h3>
<p>
Configure IceHrm
</p>
</div>
<div class="icon">
<i class="ion ion-settings"></i>
</div>
<a href="#" class="small-box-footer" id="settingsLink">
Update Settings <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div><!-- ./col -->
</div>
$allowed = BaseService::getInstance()->isModuleAllowedForUser($moduleManagerObj);
if(!$allowed){
continue;
}
$item = $moduleManagerObj->getDashboardItem();
if(!empty($item)) {
$index = $moduleManagerObj->getDashboardItemIndex();
$dashBoardList[$index] = $item;
}
}
ksort($dashBoardList);
foreach($dashBoardList as $k=>$v){
echo LanguageManager::translateTnrText($v);
}
?>
</div>
</div> </div>
@@ -196,6 +67,7 @@ modJsList['tabDashboard'] = new DashboardAdapter('Dashboard','Dashboard');
var modJs = modJsList['tabDashboard']; var modJs = modJsList['tabDashboard'];
/*
$("#employeeLink").attr("href",modJs.getCustomUrl('?g=admin&n=employees&m=admin_Admin')); $("#employeeLink").attr("href",modJs.getCustomUrl('?g=admin&n=employees&m=admin_Admin'));
$("#companyLink").attr("href",modJs.getCustomUrl('?g=admin&n=company_structure&m=admin_Admin')); $("#companyLink").attr("href",modJs.getCustomUrl('?g=admin&n=company_structure&m=admin_Admin'));
$("#usersLink").attr("href",modJs.getCustomUrl('?g=admin&n=users&m=admin_System')); $("#usersLink").attr("href",modJs.getCustomUrl('?g=admin&n=users&m=admin_System'));
@@ -204,20 +76,17 @@ $("#attendanceLink").attr("href",modJs.getCustomUrl('?g=admin&n=attendance&m=adm
$("#leaveLink").attr("href",modJs.getCustomUrl('?g=admin&n=leaves&m=admin_Admin')); $("#leaveLink").attr("href",modJs.getCustomUrl('?g=admin&n=leaves&m=admin_Admin'));
$("#reportsLink").attr("href",modJs.getCustomUrl('?g=admin&n=reports&m=admin_Reports')); $("#reportsLink").attr("href",modJs.getCustomUrl('?g=admin&n=reports&m=admin_Reports'));
$("#settingsLink").attr("href",modJs.getCustomUrl('?g=admin&n=settings&m=admin_System')); $("#settingsLink").attr("href",modJs.getCustomUrl('?g=admin&n=settings&m=admin_System'));
$("#jobsLink").attr("href",modJs.getCustomUrl('?g=admin&n=jobpositions&m=admin_Recruitment'));
$("#candidatesLink").attr("href",modJs.getCustomUrl('?g=admin&n=candidates&m=admin_Recruitment'));
$("#trainingLink").attr("href",modJs.getCustomUrl('?g=admin&n=training&m=admin_Admin'));
$("#travelLink").attr("href",modJs.getCustomUrl('?g=admin&n=travel&m=admin_Employees'));
$("#documentLink").attr("href",modJs.getCustomUrl('?g=admin&n=documents&m=admin_Employees'));
$("#expenseLink").attr("href",modJs.getCustomUrl('?g=admin&n=expenses&m=admin_Employees'));
$("#permissionLink").attr("href",modJs.getCustomUrl('?g=admin&n=permissions&m=admin_System'));
$("#upgradeLink").attr("href",modJs.getCustomUrl('?g=admin&n=billing&m=admin_System'));
modJs.getInitData(); modJs.getInitData();
*/
$(document).ready(function(){
try{
$.ajax({
url : "https://icehrm-public.s3.amazonaws.com/icehrmnews.html",
success : function(result){
$('#iceannon').html(result);
}
});
}catch(e){}
});
</script> </script>
<?php include APP_BASE_PATH.'footer.php';?> <?php include APP_BASE_PATH.'footer.php';?>

View File

@@ -62,12 +62,15 @@ DashboardAdapter.method('getInitData', function() {
DashboardAdapter.method('getInitDataSuccessCallBack', function(data) { DashboardAdapter.method('getInitDataSuccessCallBack', function(data) {
$("#numberOfEmployees").html(data['numberOfEmployees']+" Employees"); $("#numberOfEmployees").html(data['numberOfEmployees']+" Employees");
$("#numberOfCompanyStuctures").html(data['numberOfCompanyStuctures']); $("#numberOfCompanyStuctures").html(data['numberOfCompanyStuctures']+" Departments");
$("#numberOfUsers").html(data['numberOfUsers']+" Users"); $("#numberOfUsers").html(data['numberOfUsers']+" Users");
$("#numberOfProjects").html(data['numberOfProjects']); $("#numberOfProjects").html(data['numberOfProjects']+" Active Projects");
$("#numberOfAttendanceLastWeek").html(data['numberOfAttendanceLastWeek']+" Entries Last Week"); $("#numberOfAttendanceLastWeek").html(data['numberOfAttendanceLastWeek']+" Entries Last Week");
$("#numberOfLeaves").html(data['numberOfLeaves']); $("#numberOfLeaves").html(data['numberOfLeaves']+" Upcoming");
$("#numberOfTimeEntries").html(data['numberOfTimeEntries']); $("#numberOfTimeEntries").html(data['numberOfTimeEntries']);
$("#numberOfCandidates").html(data['numberOfCandidates']+" Candidates");
$("#numberOfJobs").html(data['numberOfJobs']+" Active");
$("#numberOfCourses").html(data['numberOfCourses']+" Courses");
}); });

View File

@@ -3,7 +3,7 @@
"menu":"Admin", "menu":"Admin",
"order":"1", "order":"1",
"icon":"fa-desktop", "icon":"fa-desktop",
"user_levels":["Admin"], "user_levels":["Admin","Other"],
"permissions": "permissions":
{ {

View File

@@ -1,69 +0,0 @@
<?php
if (!class_exists('DocumentsAdminManager')) {
class DocumentsAdminManager extends AbstractModuleManager{
public function initializeUserClasses(){
}
public function initializeFieldMappings(){
$this->addFileFieldMapping('EmployeeDocument', 'attachment', 'name');
}
public function initializeDatabaseErrorMappings(){
$this->addDatabaseErrorMapping('CONSTRAINT `Fk_EmployeeDocuments_Documents` FOREIGN KEY','Can not delete Document Type, users have already uploaded these types of documents');
}
public function setupModuleClassDefinitions(){
$this->addModelClass('Document');
$this->addModelClass('EmployeeDocument');
}
}
}
if (!class_exists('Document')) {
class Document extends ICEHRM_Record {
var $_table = 'Documents';
public function getAdminAccess(){
return array("get","element","save","delete");
}
public function getUserAccess(){
return array();
}
}
}
if (!class_exists('EmployeeDocument')) {
class EmployeeDocument extends ICEHRM_Record {
var $_table = 'EmployeeDocuments';
public function getAdminAccess(){
return array("get","element","save","delete");
}
public function getManagerAccess(){
return array("get","element","save","delete");
}
public function getUserAccess(){
return array("get");
}
public function getUserOnlyMeAccess(){
return array("element","save","delete");
}
public function Insert(){
if(empty($this->date_added)){
$this->date_added = date("Y-m-d H:i:s");
}
return parent::Insert();
}
}
}

View File

@@ -1,64 +0,0 @@
<?php
/*
This file is part of iCE Hrm.
iCE Hrm is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
iCE Hrm is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with iCE Hrm. If not, see <http://www.gnu.org/licenses/>.
------------------------------------------------------------------
Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
*/
$moduleName = 'documents';
define('MODULE_PATH',dirname(__FILE__));
include APP_BASE_PATH.'header.php';
include APP_BASE_PATH.'modulejslibs.inc.php';
?><div class="span9">
<ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;">
<li class="active"><a id="tabDocument" href="#tabPageDocument">Document Types</a></li>
<li class=""><a id="tabEmployeeDocument" href="#tabPageEmployeeDocument">Employee Documents</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tabPageDocument">
<div id="Document" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="DocumentForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
</div>
<div class="tab-pane" id="tabPageEmployeeDocument">
<div id="EmployeeDocument" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="EmployeeDocumentForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
</div>
</div>
</div>
<script>
var modJsList = new Array();
modJsList['tabDocument'] = new DocumentAdapter('Document','Document');
modJsList['tabEmployeeDocument'] = new EmployeeDocumentAdapter('EmployeeDocument','EmployeeDocument');
var modJs = modJsList['tabDocument'];
</script>
<?php include APP_BASE_PATH.'footer.php';?>

View File

@@ -1,107 +0,0 @@
/**
* Author: Thilina Hasantha
*/
/**
* DocumentAdapter
*/
function DocumentAdapter(endPoint) {
this.initAdapter(endPoint);
}
DocumentAdapter.inherits(AdapterBase);
DocumentAdapter.method('getDataMapping', function() {
return [
"id",
"name",
"details"
];
});
DocumentAdapter.method('getHeaders', function() {
return [
{ "sTitle": "ID" ,"bVisible":false},
{ "sTitle": "Name" },
{ "sTitle": "Details"}
];
});
DocumentAdapter.method('getFormFields', function() {
return [
[ "id", {"label":"ID","type":"hidden"}],
[ "name", {"label":"Name","type":"text","validation":""}],
[ "details", {"label":"Details","type":"textarea","validation":"none"}]
];
});
DocumentAdapter.method('getHelpLink', function () {
return 'http://blog.icehrm.com/?page_id=88';
});
function EmployeeDocumentAdapter(endPoint) {
this.initAdapter(endPoint);
}
EmployeeDocumentAdapter.inherits(AdapterBase);
EmployeeDocumentAdapter.method('getDataMapping', function() {
return [
"id",
"employee",
"document",
"details",
"date_added",
"status",
"attachment"
];
});
EmployeeDocumentAdapter.method('getHeaders', function() {
return [
{ "sTitle": "ID" ,"bVisible":false},
{ "sTitle": "Employee" },
{ "sTitle": "Document" },
{ "sTitle": "Details" },
{ "sTitle": "Date Added"},
{ "sTitle": "Status"},
{ "sTitle": "Attachment","bVisible":false}
];
});
EmployeeDocumentAdapter.method('getFormFields', function() {
return [
[ "id", {"label":"ID","type":"hidden"}],
[ "employee", {"label":"Employee","type":"select2","remote-source":["Employee","id","first_name+last_name"]}],
[ "document", {"label":"Document","type":"select2","remote-source":["Document","id","name"]}],
[ "date_added", {"label":"Date Added","type":"date","validation":""}],
[ "valid_until", {"label":"Valid Until","type":"date","validation":"none"}],
[ "status", {"label":"Status","type":"select","source":[["Active","Active"],["Inactive","Inactive"],["Draft","Draft"]]}],
[ "details", {"label":"Details","type":"textarea","validation":"none"}],
[ "attachment", {"label":"Attachment","type":"fileupload","validation":"none"}]
];
});
EmployeeDocumentAdapter.method('getFilters', function() {
return [
[ "employee", {"label":"Employee","type":"select2","remote-source":["Employee","id","first_name+last_name"]}]
];
});
EmployeeDocumentAdapter.method('getActionButtonsHtml', function(id,data) {
var html = '<div style="width:80px;"><img class="tableActionButton" src="_BASE_images/edit.png" style="cursor:pointer;" rel="tooltip" title="Edit" onclick="modJs.edit(_id_);return false;"></img><img class="tableActionButton" src="_BASE_images/download.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Download Document" onclick="download(\'_attachment_\');return false;"></img><img class="tableActionButton" src="_BASE_images/delete.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Delete" onclick="modJs.deleteRow(_id_);return false;"></img></div>';
html = html.replace(/_id_/g,id);
html = html.replace(/_attachment_/g,data[6]);
html = html.replace(/_BASE_/g,this.baseUrl);
return html;
});

View File

@@ -1,11 +0,0 @@
{
"label":"Document Management",
"menu":"Employees",
"order":"2",
"icon":"fa-files-o",
"user_levels":["Admin"],
"permissions":
{
}
}

View File

@@ -0,0 +1,44 @@
ICEHRM END USER LICENSE AGREEMENT
NOTICE TO ALL USERS: BY PURCHASING THE MODULE, YOU (EITHER AN INDIVIDUAL OR A SINGLE ENTITY) CONSENT TO BE BOUND BY AND BECOME A PARTY TO THIS AGREEMENT.
All references to "Software" herein shall be deemed to include the software license with which you will be provided by Gamonoid Media Pvt Ltd, as part of the Software.
1. LICENSE GRANT. Subject to the payment of the applicable licence fees, and subject to the terms and conditions of this Agreement, ICEHRM hereby grants to you a non-exclusive, non-transferable right to use one copy of the specified version of the Software and the accompanying documentation (the "Documentation") for the term of this Agreement solely for your own internal business purposes. You may install one copy of the Software for production use.
.
2. USE. The Software is licensed as a single product; it may not be used on more than one ICEHRM Server at a time. The Software is "in use" on a Server when its installed on a Server. You shall not, nor permit any third party to copy (other than as expressly permitted herein). You shall not rent, lease or lend the Software to any other person, nor transfer or sub-licence your licence rights to any other person.
3. TERM. This Agreement is effective until terminated as set forth herein. This Agreement will terminate automatically if you fail to comply with any of the conditions, limitations or other requirements described herein. Upon any termination of this Agreement, you must immediately destroy all copies of the Software and the Documentation. You may terminate this Agreement at any point by destroying all copies of the Software and the Documentation.
4. SUPPORT. Gamonoid Media Pvt Ltd will provide you support according to the support agreement subscribed by the company.
5. OWNERSHIP RIGHTS. The Software is protected by copyright laws. ICEHRM and Gamonoid Media Pvt Ltd own and retain all right, title and interest in and to the Software, including all copyrights, patents, trademarks and other intellectual property rights therein. Your possession, installation, or use of the Software does not transfer to you any title to the intellectual property in the Software, and you will not acquire any rights to the Software except as expressly set forth in this Agreement.
6. LIMITED WARRANTY. You may not rent, lease, loan or resell the Software. You may not permit third parties to benefit from the use or functionality of the Software via a timesharing, service bureau or other arrangement, except to the extent such use is specified in the applicable list price or product packaging for the Software. You may not transfer any of the rights granted to you under this Agreement. You may not modify, or create derivative works based upon, the Software in whole or in part. You may not copy the Software or Documentation except as expressly permitted in Section 1 above. You may not remove any proprietary notices or labels on the Software. All rights not expressly set forth hereunder are reserved by ICEHRM. ICEHRM reserves the right to periodically conduct audits upon advance written notice to verify compliance with the terms of this Agreement.
7. WARRANTY and DISCLAIMER.
(i) Gamonoid Media Pvt Ltd. warrants that for 30 days from first download or installation the Software will perform substantially in accordance with the functionality described in the Documentation (http://blog.icehrm.com) when operated properly and in the manner specified in the Documentation.
(ii) You accept all responsibility for the selection of this Software to meet your requirements.
(iii) Gamonoid Media Pvt Ltd. does not warrant that the Software and/or the Documentation will be suitable for such requirements nor that any use will be uninterrupted and error free.
(iv) The warranty in (i) shall not apply if you (a) make or cause to be made any modifications to this Software, (b) use the Software in a manner for which it was not intended or (c) use the Software other than as permitted under this Agreement.
(vii) The warranties and conditions stated in this Agreement are in lieu of all other conditions, warranties or other terms concerning the supply or purported supply of, failure to supply or delay in supplying the Software or the Documentation which might but for this paragraph (vii) have effect between the ICEHRM and you or would otherwise be implied into or incorporated into this Agreement or any collateral contract, whether by statute, common law or otherwise, all of which are hereby excluded (including, without limitation, the implied conditions, warranties or other terms as to satisfactory quality, fitness for purpose or as to the use of reasonable skill and care).
8. LIMITATION of LIABILITY. Gamonoid Media Pvt Ltd. shall have no liability (whether in contract, tort, restitution or otherwise) for any of the following losses or damage (whether such losses or damage were foreseen, foreseeable, known or otherwise):
- Loss of revenue;
- Loss of actual or anticipated profits (including for loss of profits on contracts);
- Loss of the use of money;
- Loss of anticipated savings;
- Loss of business;
- Loss of opportunity;
- Loss of goodwill;
- Loss of reputation;
- Loss of, damage to or corruption of data;
or
Any indirect or consequential loss or damage howsoever caused (including, for the avoidance of doubt, where such loss or damage is of the type specified in paragraph (ii), (a) to (ii), (i).
The ICEHRM liability (whether in contract, tort, restitution or otherwise) arising out of or in connection with the supply of the Software shall in no circumstances exceed a sum equal to the amount equally paid by you for the Software.
The construction and interpretation of this Agreement shall be governed in accordance with the laws of Sri Lanka. The parties hereby submit to the jurisdiction of the courts of Sri Lanka save that ICEHRM as claimant shall be entitled to initiate proceedings in any court of competent jurisdiction.
This Agreement contains the entire understanding of the parties with respect to the subject matter hereof and supersedes all and any prior understandings, undertakings and promises between you and ICEHRM, whether oral or in writing, which have been given or may be implied from anything written or said in negotiations between us or our representatives prior to this Agreement and all prior agreements between the parties relating to the matters aforesaid shall cease to have effect as from the Effective Date.

View File

@@ -0,0 +1,7 @@
This module is licensed under IceHrm Commercial License, which can be found in LICENSE.txt.
You are allowed to make any modification required to these module, but only allowed to use
the module in one production server (even with modifications).
Installation
------------
Copy this module into <icehrm path>/admin/ directory

View File

@@ -0,0 +1,165 @@
<?php
class EmployeesActionManager extends SubActionManager{
public function terminateEmployee($req){
$employee = new Employee();
$employee->Load("id = ?",array($req->id));
if(empty($employee->id)){
return new IceResponse(IceResponse::ERROR, "Employee Not Found");
}
$employee->termination_date = date('Y-m-d H:i:s');
$employee->status = 'Terminated';
$ok = $employee->Save();
if(!$ok){
return new IceResponse(IceResponse::ERROR, "Error occured while terminating employee");
}
return new IceResponse(IceResponse::SUCCESS, $employee);
//$user = BaseService::getInstance()->getUserFromProfileId($employee->id);
}
public function activateEmployee($req){
$employee = new Employee();
$employee->Load("id = ?",array($req->id));
if(empty($employee->id)){
return new IceResponse(IceResponse::ERROR, "Employee Not Found");
}
$employee->termination_date = NULL;
$employee->status = 'Active';
$ok = $employee->Save();
if(!$ok){
return new IceResponse(IceResponse::ERROR, "Error occurred while activating employee");
}
return new IceResponse(IceResponse::SUCCESS, $employee);
//$user = BaseService::getInstance()->getUserFromProfileId($employee->id);
}
public function deleteEmployee($req){
$employee = new Employee();
$employee->Load("id = ?",array($req->id));
if(empty($employee->id)){
return new IceResponse(IceResponse::ERROR, "Employee Not Found");
}
$archived = new ArchivedEmployee();
$archived->ref_id = $employee->id;
$archived->employee_id = $employee->employee_id;
$archived->first_name = $employee->first_name;
$archived->last_name = $employee->last_name;
$archived->gender = $employee->gender;
$archived->ssn_num = $employee->ssn_num;
$archived->nic_num = $employee->nic_num;
$archived->other_id = $employee->other_id;
$archived->work_email = $employee->work_email;
$archived->joined_date = $employee->joined_date;
$archived->confirmation_date = $employee->confirmation_date;
$archived->supervisor = $employee->supervisor;
$archived->department = $employee->department;
$archived->termination_date = $employee->termination_date;
$archived->notes = $employee->notes;
//$archived = BaseService::getInstance()->cleanUpAdoDB($archived);
$mapping = '{"nationality":["Nationality","id","name"],"employment_status":["EmploymentStatus","id","name"],"job_title":["JobTitle","id","name"],"pay_grade":["PayGrade","id","name"],"country":["Country","code","name"],"province":["Province","id","name"],"department":["CompanyStructure","id","title"],"supervisor":["Employee","id","first_name+last_name"]}';
$employeeEnriched = BaseService::getInstance()->getElement('Employee',$employee->id,$mapping,true);
$employeeEnriched = BaseService::getInstance()->cleanUpAdoDB($employeeEnriched);
$data = new stdClass();
$data->enrichedEmployee = $employeeEnriched;
$data->timesheets = $this->getEmployeeData($employee->id, new EmployeeTimeSheet());
$data->timesheetEntries = $this->getEmployeeData($employee->id, new EmployeeTimeEntry());
$data->attendance = $this->getEmployeeData($employee->id, new Attendance());
$data->documents = $this->getEmployeeData($employee->id, new EmployeeDocument());
if(class_exists('EmployeeTrainingSession')){
$data->trainingSessions = $this->getEmployeeData($employee->id, new EmployeeTrainingSession());
}
$data->travelRecords = $this->getEmployeeData($employee->id, new EmployeeTravelRecord());
$data->qualificationSkills = $this->getEmployeeData($employee->id, new EmployeeSkill());
$data->qualificationEducation = $this->getEmployeeData($employee->id, new EmployeeEducation());
$data->qualificationCertifications = $this->getEmployeeData($employee->id, new EmployeeCertification());
$data->qualificationLanguages = $this->getEmployeeData($employee->id, new EmployeeLanguage());
$data->salary = $this->getEmployeeData($employee->id, new EmployeeSalary());
$data->dependants = $this->getEmployeeData($employee->id, new EmployeeDependent());
$data->emergencyContacts = $this->getEmployeeData($employee->id, new EmergencyContact());
$data->projects = $this->getEmployeeData($employee->id, new EmployeeProject());
$data->leaves = $this->getEmployeeData($employee->id, new EmployeeLeave());
$data->leaveDays = $this->getEmployeeData($employee->id, new EmployeeLeaveDay());
$archived->data = json_encode($data, JSON_PRETTY_PRINT);
$ok = $archived->Save();
if(!$ok){
return new IceResponse(IceResponse::ERROR, "Error occurred while archiving employee");
}
$ok = $employee->Delete();
if(!$ok){
return new IceResponse(IceResponse::ERROR, "Error occurred while deleting employee");
}
return new IceResponse(IceResponse::SUCCESS, $archived);
}
public function downloadArchivedEmployee($req){
if($this->baseService->currentUser->user_level != 'Admin'){
echo "Error: Permission denied";
exit();
}
$employee = new ArchivedEmployee();
$employee->Load("id = ?",array($req->id));
if(empty($employee->id)){
return new IceResponse(IceResponse::ERROR, "Employee Not Found");
}
$employee->data = json_decode($employee->data);
$employee = $this->baseService->cleanUpAdoDB($employee);
$str = json_encode($employee, JSON_PRETTY_PRINT);
$filename = uniqid();
$file = fopen("/tmp/".$filename,"w");
fwrite($file,$str);
fclose($file);
$downloadFileName = "employee_".$employee->id."_".str_replace(" ", "_", $employee->first_name)."_".str_replace(" ", "_", $employee->last_name).".txt";
header("Pragma: public"); // required
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Description: File Transfer");
header("Content-Type: image/jpg");
header('Content-Disposition: attachment; filename="'.$downloadFileName.'"');
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize("/tmp/".$filename));
readfile("/tmp/".$filename);
exit();
}
private function getEmployeeData($id, $obj){
$data = array();
$objs = $obj->Find("employee = ?",array($id));
foreach($objs as $entry){
$data[] = BaseService::getInstance()->cleanUpAdoDB($entry);
}
return $data;
}
}

View File

@@ -8,6 +8,14 @@ if (!class_exists('EmployeesAdminManager')) {
public function initializeFieldMappings(){ public function initializeFieldMappings(){
}
public function setupRestEndPoints(){
\NoahBuscher\Macaw\Macaw::get(REST_API_PATH.'employee/(:any)', function($pathParams) {
$empRestEndPoint = new EmployeeRestEndPoint();
$empRestEndPoint->process('get',$pathParams);
});
} }
public function initializeDatabaseErrorMappings(){ public function initializeDatabaseErrorMappings(){
@@ -18,6 +26,22 @@ if (!class_exists('EmployeesAdminManager')) {
public function setupModuleClassDefinitions(){ public function setupModuleClassDefinitions(){
$this->addModelClass('Employee'); $this->addModelClass('Employee');
$this->addModelClass('EmploymentStatus'); $this->addModelClass('EmploymentStatus');
$this->addModelClass('EmployeeApproval');
}
public function getDashboardItemData(){
$data = array();
$emp = new Employee();
$data['numberOfEmployees'] = $emp->Count("1 = 1");
return $data;
}
public function initQuickAccessMenu(){
UIManager::getInstance()->addQuickAccessMenuItem("View Employees","fa-users",CLIENT_BASE_URL."?g=admin&n=employees&m=admin_Employees",array("Admin","Manager"));
UIManager::getInstance()->addQuickAccessMenuItem("Add a New Employee","fa-edit",CLIENT_BASE_URL."?g=admin&n=employees&m=admin_Employees&action=new",array("Admin"));
} }
} }
@@ -26,6 +50,43 @@ if (!class_exists('EmployeesAdminManager')) {
if (!class_exists('Employee')) { if (!class_exists('Employee')) {
class Employee extends ICEHRM_Record { class Employee extends ICEHRM_Record {
var $oldObj = null;
var $oldObjOrig = null;
var $historyUpdateList = array();
var $historyFieldsToTrack = array(
"employee_id"=>"employee_id",
"first_name"=>"first_name",
"middle_name"=>"middle_name",
"last_name"=>"last_name",
"nationality"=>"nationality_Name",
"birthday"=>"birthday",
"gender"=>"gender",
"marital_status"=>"marital_status",
"ssn_num"=>"ssn_num",
"nic_num"=>"nic_num",
"other_id"=>"other_id",
"employment_status"=>"employment_status_Name",
"job_title"=>"job_title_Name",
"pay_grade"=>"pay_grade_Name",
"work_station_id"=>"work_station_id",
"address1"=>"address1",
"address2"=>"address2",
"city"=>"city_Name",
"country"=>"country_Name",
"province"=>"province_Name",
"postal_code"=>"postal_code",
"home_phone"=>"home_phone",
"mobile_phone"=>"mobile_phone",
"work_phone"=>"work_phone",
"work_email"=>"work_email",
"private_email"=>"private_email",
"joined_date"=>"joined_date",
"confirmation_date"=>"confirmation_date",
"supervisor"=>"supervisor_Name",
"indirect_supervisors"=>"indirect_supervisors",
"department"=>"department_Name"
);
public function getAdminAccess(){ public function getAdminAccess(){
return array("get","element","save","delete"); return array("get","element","save","delete");
} }
@@ -46,10 +107,165 @@ if (!class_exists('Employee')) {
return "id"; return "id";
} }
private function initHistory($obj){
$oldObjOrig = new Employee();
$oldObjOrig->Load("id = ?",array($obj->id));
$this->oldObjOrig = $oldObjOrig;
$mapping = '{"nationality":["Nationality","id","name"],"employment_status":["EmploymentStatus","id","name"],"job_title":["JobTitle","id","name"],"pay_grade":["PayGrade","id","name"],"country":["Country","code","name"],"province":["Province","id","name"],"department":["CompanyStructure","id","title"],"supervisor":["Employee","id","first_name+last_name"]}';
$this->oldObj = BaseService::getInstance()->getElement('Employee',$obj->id,$mapping,true);
}
private function saveHistory($obj){
$oldObj = $this->oldObj;
$oldObjOrig = $this->oldObjOrig;
$mapping = '{"nationality":["Nationality","id","name"],"employment_status":["EmploymentStatus","id","name"],"job_title":["JobTitle","id","name"],"pay_grade":["PayGrade","id","name"],"country":["Country","code","name"],"province":["Province","id","name"],"department":["CompanyStructure","id","title"],"supervisor":["Employee","id","first_name+last_name"]}';
$objEnriched = BaseService::getInstance()->getElement('Employee',$obj->id,$mapping,true);
foreach($this->historyFieldsToTrack as $k => $v){
if(empty($oldObjOrig->$k) && $obj->$k = '[]'){
continue;
}
if(empty($obj->$k) && $oldObjOrig->$k = '0000-00-00'){
continue;
}
if($oldObjOrig->$k != $obj->$k){
$enrichNewVal = '';
$enrichOldVal = '';
if($k == 'indirect_supervisors'){
if(!empty($obj->$k) && $obj->$k != '[]'){
$newIndeirectSupervisorIds = json_decode($obj->$k);
foreach($newIndeirectSupervisorIds as $id){
$item = BaseService::getInstance()->getItemFromCache("Employee", $id);
if($enrichNewVal != ""){
$enrichNewVal .= ", ";
}
$enrichNewVal .= $item->first_name." ".$item->last_name;
}
}
if(!empty($oldObjOrig->$k) && $oldObjOrig->$k != '[]'){
$oldIndeirectSupervisorIds = json_decode($oldObjOrig->$k);
foreach($oldIndeirectSupervisorIds as $id){
$item = BaseService::getInstance()->getItemFromCache("Employee", $id);
if($enrichOldVal != ""){
$enrichOldVal .= ", ";
}
$enrichOldVal .= $item->first_name." ".$item->last_name;
}
}
}else{
$enrichOldVal = $oldObj->$v;
$enrichNewVal = $objEnriched->$v;
}
$this->historyUpdateList[] = array($obj->id,$k,$enrichOldVal,$enrichNewVal);
}
}
while(count($this->historyUpdateList)){
$ele = array_pop($this->historyUpdateList);
BaseService::getInstance()->addHistoryItem("Employee","Employee",$ele[0],$ele[1],$ele[2],$ele[3]);
}
}
public function executePreSaveActions($obj){
if(empty($obj->status)){
$obj->status = 'Active';
}
return new IceResponse(IceResponse::SUCCESS,$obj);
}
public function executePreUpdateActions($obj){
$this->initHistory($obj);
return new IceResponse(IceResponse::SUCCESS,$obj);
}
public function executePostUpdateActions($obj){
$this->saveHistory($obj);
}
public function postProcessGetData($obj){
$obj = FileService::getInstance()->updateSmallProfileImage($obj);
return $obj;
}
public function getVirtualFields(){
return array(
"image"
);
}
public function getActiveEmployees(){
$employee = new Employee();
$list = $employee->Find("status = ?",array('Active'));
return $list;
}
public function getActiveSubordinateEmployees(){
$employee = new Employee();
if(BaseService::getInstance()->currentUser->user_level != 'Admin'){
$cemp = BaseService::getInstance()->getCurrentProfileId();
$list = $employee->Find("status = ? and supervisor = ?",array('Active', $cemp));
}else{
$list = $employee->Find("status = ?",array('Active'));
}
return $list;
}
public static function cleanEmployeeData($obj){
unset($obj->keysToIgnore);
unset($obj->historyFieldsToTrack);
unset($obj->historyUpdateList);
unset($obj->oldObjOrig);
unset($obj->oldObj);
return $obj;
}
var $_table = 'Employees'; var $_table = 'Employees';
} }
} }
if (!class_exists('ArchivedEmployee')) {
class ArchivedEmployee extends ICEHRM_Record {
public function getAdminAccess(){
return array("get","element","save","delete");
}
public function getManagerAccess(){
return array("get","element","save");
}
public function getUserAccess(){
return array("get");
}
public function getUserOnlyMeAccess(){
return array("element","save");
}
public function getUserOnlyMeAccessField(){
return "id";
}
var $_table = 'ArchivedEmployees';
}
}
if (!class_exists('EmploymentStatus')) { if (!class_exists('EmploymentStatus')) {
class EmploymentStatus extends ICEHRM_Record { class EmploymentStatus extends ICEHRM_Record {
@@ -69,3 +285,62 @@ if (!class_exists('EmploymentStatus')) {
} }
} }
if (!class_exists('EmployeeApproval')) {
class EmployeeApproval extends ICEHRM_Record {
var $_table = 'EmployeeApprovals';
public function getAdminAccess(){
return array("get","element","save","delete");
}
public function getManagerAccess(){
return array("get","element","save");
}
public function getUserAccess(){
return array();
}
}
}
if (!class_exists('EmployeeRestEndPoint')) {
class EmployeeRestEndPoint extends RestEndPoint{
public function get($parameter){
if(empty($parameter)){
return new IceResponse(IceResponse::ERROR, "Employee ID not provided");
}
if($parameter === 'list'){
$emp = new Employee();
$emps = $emp->Find("1=1");
$newEmps = array();
foreach($emps as $emp){
$employee = new stdClass();
$employee->id = $emp->id;
$employee->employee_id = $emp->employee_id;
$employee->first_name = $emp->first_name;
$employee->middle_name = $emp->middle_name;
$employee->last_name = $emp->last_name;
$newEmps[] = $employee;
}
return new IceResponse(IceResponse::SUCCESS, $newEmps);
}else{
$mapping = '{"nationality":["Nationality","id","name"],"ethnicity":["Ethnicity","id","name"],"immigration_status":["ImmigrationStatus","id","name"],"employment_status":["EmploymentStatus","id","name"],"job_title":["JobTitle","id","name"],"pay_grade":["PayGrade","id","name"],"country":["Country","code","name"],"province":["Province","id","name"],"department":["CompanyStructure","id","title"],"supervisor":["Employee","id","first_name+last_name"]}';
$emp = BaseService::getInstance()->getElement('Employee',$parameter,$mapping,true);
if(!empty($emp)){
$emp = Employee::cleanEmployeeData($emp);
return new IceResponse(IceResponse::SUCCESS,$emp);
}
return new IceResponse(IceResponse::ERROR, "Employee not found" ,404);
}
}
}
}

View File

@@ -0,0 +1,253 @@
<div class="row">
<div class="col-xs-12 col-md-2">
<div class="row-fluid">
<div class="col-xs-12" style="text-align: center;">
<img id="profile_image__id_" src="" class="img-polaroid img-thumbnail" style="max-width: 140px;max-height: 140px;">
</div>
</div>
</div>
<div class="col-xs-12 col-md-10">
<div class="row-fluid">
<div class="col-md-12"><h2 id="name"></h2></div>
</div>
<div class="row-fluid">
<div class="col-md-12">
<p>
<i class="fa fa-phone"></i> <span id="mobile_phone"></span>&nbsp;&nbsp;
<i class="fa fa-envelope"></i> <span id="work_email"></span>
</p>
</div>
</div>
<div class="row-fluid">
<div class="col-xs-12" style="font-size:18px;border-bottom: 1px solid #DDD;margin-bottom: 10px;padding-bottom: 10px;">
<button id="employeeProfileEditInfo" class="btn btn-small btn-success" onclick="modJs.edit(_id_);" style="margin-right:10px;"><i class="fa fa-edit"></i> Edit Info</button>
<button id="employeeUploadProfileImage" onclick="showUploadDialog('profile_image__id_','Upload Profile Image','profile_image',_id_,'profile_image__id_','src','url','image');return false;" class="btn btn-small btn-primary" type="button" style="margin-right:10px;"><i class="fa fa-upload"></i> Upload Profile Image</button>
<button id="employeeDeleteProfileImage" onclick="modJs.deleteProfileImage(_id_);return false;" class="btn btn-small btn-warning" type="button" style="margin-right:10px;"><i class="fa fa-times"></i> Delete Profile Image</button>
</div>
</div>
<div class="row-fluid" style="border-top: 1px;">
<div class="col-xs-6 col-md-4" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;font-size:13px;">#_label_employee_id_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="employee_id"></label>
</div>
<div class="col-xs-6 col-md-4" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;">#_label_nic_num_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="nic_num"></label>
</div>
<div class="col-xs-6 col-md-4" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;">#_label_ssn_num_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="ssn_num"></label>
</div>
</div>
</div>
</div>
<ul class="nav nav-tabs" id="subModTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;">
<li class="active"><a id="tabBasic" href="#tabPageBasic">Basic Information</a></li>
<li class=""><a id="tabQualifications" href="#tabPageQualifications">Qualifications</a></li>
<li class=""><a id="tabFamily" href="#tabPageFamily">Family</a></li>
<li class=""><a id="tabDocuments" href="#tabPageDocuments">Documents</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane sub-tab active" id="tabPageBasic">
<div class="row" style="margin-left:10px;margin-top:20px;">
<div class="panel panel-default" style="width:97.5%;">
<div class="panel-heading"><h4>Personal Information</h4></div>
<div class="panel-body" id="cont_personal_information">
<div class="col-xs-6 col-md-3" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;">#_label_driving_license_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="driving_license"></label>
</div>
<div class="col-xs-6 col-md-3" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;">#_label_other_id_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="other_id"></label>
</div>
<div class="col-xs-6 col-md-3" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;">#_label_birthday_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="birthday"></label>
</div>
<div class="col-xs-6 col-md-3" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;">#_label_gender_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="gender"></label>
</div>
<div class="col-xs-6 col-md-3" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;">#_label_nationality_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="nationality_Name"></label>
</div>
<div class="col-xs-6 col-md-3" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;">#_label_marital_status_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="marital_status"></label>
</div>
<div class="col-xs-6 col-md-3" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;">#_label_joined_date_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="joined_date"></label>
</div>
</div>
</div>
</div>
<div class="row" style="margin-left:10px;margin-top:20px;">
<div class="panel panel-default" style="width:97.5%;">
<div class="panel-heading"><h4>Contact Information</h4></div>
<div class="panel-body" id="cont_contact_information">
<div class="col-xs-6 col-md-3" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;">#_label_address1_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="address1"></label>
</div>
<div class="col-xs-6 col-md-3" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;">#_label_address2_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="address2"></label>
</div>
<div class="col-xs-6 col-md-3" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;">#_label_city_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="city"></label>
</div>
<div class="col-xs-6 col-md-3" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;">#_label_country_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="country_Name"></label>
</div>
<div class="col-xs-6 col-md-3" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;">#_label_postal_code_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="postal_code"></label>
</div>
<div class="col-xs-6 col-md-3" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;">#_label_home_phone_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="home_phone"></label>
</div>
<div class="col-xs-6 col-md-3" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;">#_label_work_phone_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="work_phone"></label>
</div>
<div class="col-xs-6 col-md-3" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;">#_label_private_email_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="private_email"></label>
</div>
</div>
</div>
</div>
<div class="row" style="margin-left:10px;margin-top:20px;">
<div class="panel panel-default" style="width:97.5%;">
<div class="panel-heading"><h4>Job Details</h4></div>
<div class="panel-body" id="cont_job_details">
<div class="col-xs-6 col-md-3" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;">#_label_job_title_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="job_title_Name"></label>
</div>
<div class="col-xs-6 col-md-3" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;">#_label_employment_status_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="employment_status_Name"></label>
</div>
<div class="col-xs-6 col-md-3" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;">#_label_supervisor_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="supervisor_Name"></label>
</div>
<div class="col-xs-6 col-md-3" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;">Direct Reports</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="subordinates"></label>
</div>
<div class="col-xs-6 col-md-3" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;">#_label_department_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="department_Name"></label>
</div>
</div>
</div>
</div>
<div id="customFieldsCont">
</div>
<div class="modal" id="adminUsersModel" tabindex="-1" role="dialog" aria-labelledby="messageModelLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button>
<h3 style="font-size: 17px;">Change User Password</h3>
</div>
<div class="modal-body">
<form id="adminUsersChangePwd">
<div class="control-group">
<div class="controls">
<span class="label label-warning" id="adminUsersChangePwd_error" style="display:none;"></span>
</div>
</div>
<div class="control-group" id="field_newpwd">
<label class="control-label" for="newpwd">New Password</label>
<div class="controls">
<input class="" type="password" id="newpwd" name="newpwd" value="" class="form-control"/>
<span class="help-inline" id="help_newpwd"></span>
</div>
</div>
<div class="control-group" id="field_conpwd">
<label class="control-label" for="conpwd">Confirm Password</label>
<div class="controls">
<input class="" type="password" id="conpwd" name="conpwd" value="" class="form-control"/>
<span class="help-inline" id="help_conpwd"></span>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="modJs.changePasswordConfirm();">Change Password</button>
<button class="btn" onclick="modJs.closeChangePassword();">Not Now</button>
</div>
</div>
</div>
</div>
</div><!-- End tabPageBasic -->
<div class="tab-pane sub-tab" id="tabPageQualifications">
<div class="row" style="margin-top:20px;">
<div class="col-md-3 sub-column">
<div id="EmployeeSkillSubTab" class="" data-content="List" style="padding-left:5px;">
</div>
</div>
<div class="col-md-3 sub-column">
<div id="EmployeeEducationSubTab" class="" data-content="List" style="padding-left:5px;">
</div>
</div>
<div class="col-md-3 sub-column">
<div id="EmployeeCertificationSubTab" class="" data-content="List" style="padding-left:5px;">
</div>
</div>
<div class="col-md-3 sub-column">
<div id="EmployeeLanguageSubTab" class="" data-content="List" style="padding-left:5px;">
</div>
</div>
</div><!-- End tabPageQualifications -->
</div>
<div class="tab-pane sub-tab" id="tabPageFamily">
<div class="row" style="margin-top:20px;">
<div class="col-md-6 sub-column">
<div id="EmployeeEmergencyContactSubTab" class="" data-content="List" style="padding-left:5px;">
</div>
</div>
<div class="col-md-6 sub-column">
<div id="EmployeeDependentSubTab" class="" data-content="List" style="padding-left:5px;">
</div>
</div>
</div>
</div>
<div class="tab-pane sub-tab" id="tabPageDocuments">
<div class="row" style="margin-top:20px;">
<div class="col-md-12">
<div id="EmployeeDocumentSubTab" class="" data-content="List" style="padding-left:5px;">
</div>
</div>
</div><!-- End tabPageQualifications -->
</div>
</div><!-- End tab-content -->

View File

@@ -0,0 +1,19 @@
<div class="col-lg-3 col-xs-12">
<div class="small-box bg-aqua">
<div class="inner">
<h3>
<t>People</t>
</h3>
<p id="numberOfEmployees">
#_numberOfEmployees_# <t>Employees</t>
</p>
</div>
<div class="icon">
<i class="ion ion-person-stalker"></i>
</div>
<a href="#_moduleLink_#" class="small-box-footer" id="employeeLink">
<t>Manage</t> <t>Employees</t> <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>

View File

@@ -0,0 +1,108 @@
ALTER TABLE Employees ADD COLUMN `status` enum('Active','Terminated') default 'Active';
create table `ArchivedEmployees` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`ref_id` bigint(20) NOT NULL,
`employee_id` varchar(50) default null,
`first_name` varchar(100) default '' not null,
`last_name` varchar(100) default '' not null,
`gender` enum('Male','Female') default NULL,
`ssn_num` varchar(100) default '',
`nic_num` varchar(100) default '',
`other_id` varchar(100) default '',
`work_email` varchar(100) default null,
`joined_date` DATETIME default '0000-00-00 00:00:00',
`confirmation_date` DATETIME default '0000-00-00 00:00:00',
`supervisor` bigint(20) default null,
`department` bigint(20) default null,
`termination_date` DATETIME default '0000-00-00 00:00:00',
`notes` text default null,
`data` longtext default null,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `FieldNameMappings` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`type` varchar(20) NOT NULL,
`name` varchar(20) NOT NULL,
`textOrig` varchar(200) default null,
`textMapped` varchar(200) default null,
`display` enum('Form','Table and Form','Hidden') default 'Form',
`created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
INSERT INTO `FieldNameMappings` (`type`, `name`, `textOrig`, `textMapped`, `display`) VALUES
('Employee', 'employee_id', 'Employee Number', 'Employee Number', 'Table and Form'),
('Employee', 'first_name', 'First Name', 'First Name', 'Table and Form'),
('Employee', 'middle_name', 'Middle Name', 'Middle Name', 'Form'),
('Employee', 'last_name', 'Last Name', 'Last Name', 'Table and Form'),
('Employee', 'nationality', 'Nationality', 'Nationality', 'Form'),
('Employee', 'birthday', 'Date of Birth', 'Date of Birth', 'Form'),
('Employee', 'gender', 'Gender', 'Gender', 'Form'),
('Employee', 'marital_status', 'Marital Status', 'Marital Status', 'Form'),
('Employee', 'ssn_num', 'SSN/NRIC', 'SSN/NRIC', 'Form'),
('Employee', 'nic_num', 'NIC', 'NIC', 'Form'),
('Employee', 'other_id', 'Other ID', 'Other ID', 'Form'),
('Employee', 'driving_license', 'Driving License No', 'Driving License No', 'Form'),
('Employee', 'employment_status', 'Employment Status', 'Employment Status', 'Form'),
('Employee', 'job_title', 'Job Title', 'Job Title', 'Form'),
('Employee', 'pay_grade', 'Pay Grade', 'Pay Grade', 'Form'),
('Employee', 'work_station_id', 'Work Station Id', 'Work Station Id', 'Form'),
('Employee', 'address1', 'Address Line 1', 'Address Line 1', 'Form'),
('Employee', 'address2', 'Address Line 2', 'Address Line 2', 'Form'),
('Employee', 'city', 'City', 'City', 'Form'),
('Employee', 'country', 'Country', 'Country', 'Form'),
('Employee', 'province', 'Province', 'Province', 'Form'),
('Employee', 'postal_code', 'Postal/Zip Code', 'Postal/Zip Code', 'Form'),
('Employee', 'home_phone', 'Home Phone', 'Home Phone', 'Form'),
('Employee', 'mobile_phone', 'Mobile Phone', 'Mobile Phone', 'Table and Form'),
('Employee', 'work_phone', 'Work Phone', 'Work Phone', 'Form'),
('Employee', 'work_email', 'Work Email', 'Work Email', 'Form'),
('Employee', 'private_email', 'Private Email', 'Private Email', 'Form'),
('Employee', 'joined_date', 'Joined Date', 'Joined Date', 'Form'),
('Employee', 'confirmation_date', 'Confirmation Date', 'Confirmation Date', 'Form'),
('Employee', 'termination_date', 'Termination Date', 'Termination Date', 'Form'),
('Employee', 'supervisor', 'Supervisor', 'Supervisor', 'Table and Form'),
('Employee', 'department', 'Department', 'Department', 'Table and Form'),
('Employee', 'notes', 'Notes', 'Notes', 'Form');
create table `CustomFields` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`type` varchar(20) NOT NULL,
`name` varchar(20) NOT NULL,
`data` text default null,
`display` enum('Form','Table and Form','Hidden') default 'Form',
`created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
INSERT INTO `CustomFields` (`type`, `name`, `data`,`display`) VALUES
('Employee', 'custom1', '', 'Hidden'),
('Employee', 'custom2', '', 'Hidden'),
('Employee', 'custom3', '', 'Hidden'),
('Employee', 'custom4', '', 'Hidden'),
('Employee', 'custom5', '', 'Hidden'),
('Employee', 'custom6', '', 'Hidden'),
('Employee', 'custom7', '', 'Hidden'),
('Employee', 'custom8', '', 'Hidden'),
('Employee', 'custom9', '', 'Hidden'),
('Employee', 'custom10', '', 'Hidden');
Alter table `Employees` MODIFY COLUMN `middle_name` varchar(100) default null;
Alter table `Employees` MODIFY COLUMN `last_name` varchar(100) default null;
Alter table `Employees` MODIFY COLUMN `ssn_num` varchar(100) default NULL;
Alter table `Employees` MODIFY COLUMN `nic_num` varchar(100) default NULL;
Alter table `Employees` MODIFY COLUMN `other_id` varchar(100) default NULL;
Alter table `Employees` MODIFY COLUMN `driving_license` varchar(100) default NULL;
Alter table `Employees` MODIFY COLUMN `work_station_id` varchar(100) default NULL;
Alter table `Employees` MODIFY COLUMN `address1` varchar(100) default NULL;
Alter table `Employees` MODIFY COLUMN `address2` varchar(100) default NULL;
Alter table `Employees` MODIFY COLUMN `city` varchar(150) default NULL;

View File

@@ -4,10 +4,41 @@ $moduleName = 'employees';
define('MODULE_PATH',dirname(__FILE__)); define('MODULE_PATH',dirname(__FILE__));
include APP_BASE_PATH.'header.php'; include APP_BASE_PATH.'header.php';
include APP_BASE_PATH.'modulejslibs.inc.php'; include APP_BASE_PATH.'modulejslibs.inc.php';
$fieldNameMap = BaseService::getInstance()->getFieldNameMappings("Employee");
$customFields = BaseService::getInstance()->getCustomFields("Employee");
?><div class="span9"> ?><div class="span9">
<ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;"> <ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;">
<li class="active"><a id="tabEmployee" href="#tabPageEmployee">Employees</a></li> <?php if($user->user_level != "Admin"){
?>
<li class="active"><a id="tabEmployee" href="#tabPageEmployee"><?=LanguageManager::tran('Employees (Direct Reports)')?></a></li>
<?php }else{ ?>
<li class="active"><a id="tabEmployee" href="#tabPageEmployee"><?=LanguageManager::tran('Employees')?></a></li>
<?php }?>
<?php if($user->user_level == "Admin"){
?>
<li><a id="tabEmployeeSkill" href="#tabPageEmployeeSkill"><?=LanguageManager::tran('Skills')?></a></li>
<li><a id="tabEmployeeEducation" href="#tabPageEmployeeEducation"><?=LanguageManager::tran('Education')?></a></li>
<li><a id="tabEmployeeCertification" href="#tabPageEmployeeCertification"><?=LanguageManager::tran('Certifications')?></a></li>
<li><a id="tabEmployeeLanguage" href="#tabPageEmployeeLanguage"><?=LanguageManager::tran('Languages')?></a></li>
<li><a id="tabEmployeeDependent" href="#tabPageEmployeeDependent"><?=LanguageManager::tran('Dependents')?></a></li>
<li><a id="tabEmergencyContact" href="#tabPageEmergencyContact"><?=LanguageManager::tran('Emergency Contacts')?></a></li>
<?php if (class_exists('DocumentsAdminManager')) {?>
<li><a id="tabEmployeeDocument" href="#tabPageEmployeeDocument"><?=LanguageManager::tran('Documents')?></a></li>
<?php } ?>
<?php }?>
<?php if($user->user_level == "Admin"){
?>
<li class="dropdown">
<a href="#" id="terminatedEmployeeMenu" class="dropdown-toggle" data-toggle="dropdown" aria-controls="terminatedEmployeeMenu-contents"><?=LanguageManager::tran('Deactivated Employees')?> <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu" aria-labelledby="terminatedEmployeeMenu" id="terminatedEmployeeMenu-contents">
<li><a id="tabTerminatedEmployee" href="#tabPageTerminatedEmployee"><?=LanguageManager::tran('Temporarily Deactivated Employees')?></a></li>
<li><a id="tabArchivedEmployee" href="#tabPageArchivedEmployee"><?=LanguageManager::tran('Terminated Employee Data')?></a></li>
</ul>
</li>
<?php }?>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@@ -19,16 +50,161 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
</div> </div>
</div> </div>
<div class="tab-pane" id="tabPageEmployeeSkill">
<div id="EmployeeSkill" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="EmployeeSkillForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
</div>
<div class="tab-pane" id="tabPageEmployeeEducation">
<div id="EmployeeEducation" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="EmployeeEducationForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
</div>
<div class="tab-pane" id="tabPageEmployeeCertification">
<div id="EmployeeCertification" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="EmployeeCertificationForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
</div>
<div class="tab-pane" id="tabPageEmployeeLanguage">
<div id="EmployeeLanguage" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="EmployeeLanguageForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
</div>
<div class="tab-pane" id="tabPageEmployeeDependent">
<div id="EmployeeDependent" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="EmployeeDependentForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
</div>
<div class="tab-pane" id="tabPageEmergencyContact">
<div id="EmergencyContact" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="EmergencyContactForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
</div>
<div class="tab-pane" id="tabPageArchivedEmployee">
<div id="ArchivedEmployee" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="ArchivedEmployeeForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
</div>
<div class="tab-pane" id="tabPageTerminatedEmployee">
<div id="TerminatedEmployee" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="TerminatedEmployeeForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
</div>
<?php if (class_exists('DocumentsAdminManager')) {?>
<div class="tab-pane" id="tabPageEmployeeDocument">
<div id="EmployeeDocument" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="EmployeeDocumentForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
</div>
<?php } ?>
</div> </div>
</div> </div>
<script> <script>
var modJsList = new Array(); var modJsList = new Array();
modJsList['tabEmployee'] = new EmployeeAdapter('Employee'); <?php if($user->user_level != "Admin"){
?>
modJsList['tabEmployee'] = new EmployeeAdapter('Employee','Employee',{"status":"Active"});
modJsList['tabEmployee'].setShowAddNew(false);
<?php
}else{
?>
modJsList['tabEmployee'] = new EmployeeAdapter('Employee','Employee',{"status":"Active"});
<?php
}
?>
modJsList['tabEmployee'].setRemoteTable(true); modJsList['tabEmployee'].setRemoteTable(true);
modJsList['tabEmployee'].setFieldNameMap(<?=json_encode($fieldNameMap)?>);
modJsList['tabEmployee'].setCustomFields(<?=json_encode($customFields)?>);
modJsList['tabEmployeeSkill'] = new EmployeeSkillAdapter('EmployeeSkill');
modJsList['tabEmployeeSkill'].setRemoteTable(true);
modJsList['tabEmployeeEducation'] = new EmployeeEducationAdapter('EmployeeEducation');
modJsList['tabEmployeeEducation'].setRemoteTable(true);
modJsList['tabEmployeeCertification'] = new EmployeeCertificationAdapter('EmployeeCertification');
modJsList['tabEmployeeCertification'].setRemoteTable(true);
modJsList['tabEmployeeLanguage'] = new EmployeeLanguageAdapter('EmployeeLanguage');
modJsList['tabEmployeeLanguage'].setRemoteTable(true);
modJsList['tabEmployeeDependent'] = new EmployeeDependentAdapter('EmployeeDependent');
modJsList['tabEmployeeDependent'].setRemoteTable(true);
modJsList['tabEmergencyContact'] = new EmergencyContactAdapter('EmergencyContact');
modJsList['tabEmergencyContact'].setRemoteTable(true);
modJsList['tabEmployeeImmigration'] = new EmployeeImmigrationAdapter('EmployeeImmigration');
modJsList['tabEmployeeImmigration'].setRemoteTable(true);
modJsList['tabArchivedEmployee'] = new ArchivedEmployeeAdapter('ArchivedEmployee');
modJsList['tabArchivedEmployee'].setRemoteTable(true);
modJsList['tabArchivedEmployee'].setShowAddNew(false);
modJsList['tabTerminatedEmployee'] = new TerminatedEmployeeAdapter('Employee','TerminatedEmployee',{"status":"Terminated"});
modJsList['tabTerminatedEmployee'].setRemoteTable(true);
modJsList['tabTerminatedEmployee'].setShowAddNew(false);
<?php if (class_exists('DocumentsAdminManager')) {?>
modJsList['tabEmployeeDocument'] = new EmployeeDocumentAdapter('EmployeeDocument','EmployeeDocument');
modJsList['tabTerminatedEmployee'].setRemoteTable(true);
<?php } ?>
var modJs = modJsList['tabEmployee']; var modJs = modJsList['tabEmployee'];
</script> </script>
<div class="modal" id="createUserModel" tabindex="-1" role="dialog" aria-labelledby="messageModelLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button>
<h3 style="font-size: 17px;"><?=LanguageManager::tran('Employee Saved Successfully')?></h3>
</div>
<div class="modal-body">
<?=LanguageManager::tran('Employee needs a User to login to IceHrm. Do you want to create a user for this employee now?')?> <br/><br/><?=LanguageManager::tran('You can do this later through Users module if required.')?>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="modJs.createUser();">Yes</button>
<button class="btn" onclick="modJs.closeCreateUser();">No</button>
</div>
</div>
</div>
</div>
<?php include APP_BASE_PATH.'footer.php';?> <?php include APP_BASE_PATH.'footer.php';?>

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,8 @@
"menu":"Employees", "menu":"Employees",
"order":"1", "order":"1",
"icon":"fa-users", "icon":"fa-users",
"user_levels":["Admin"], "user_levels":["Admin","Manager"],
"dashboardPosition":1,
"permissions": "permissions":
{ {

View File

@@ -0,0 +1,82 @@
<?php
if (!class_exists('FieldnamesAdminManager')) {
class FieldnamesAdminManager extends AbstractModuleManager{
public function initializeUserClasses(){
}
public function initializeFieldMappings(){
}
public function initializeDatabaseErrorMappings(){
}
public function setupModuleClassDefinitions(){
$this->addModelClass('FieldNameMapping');
$this->addModelClass('CustomField');
}
}
}
if (!class_exists('FieldNameMapping')) {
class FieldNameMapping extends ICEHRM_Record {
var $_table = 'FieldNameMappings';
public function getAdminAccess(){
return array("get","element","save","delete");
}
public function getUserAccess(){
return array();
}
public function getAnonymousAccess(){
return array("get","element");
}
}
}
if (!class_exists('CustomField')) {
class CustomField extends ICEHRM_Record {
var $_table = 'CustomFields';
public function getAdminAccess(){
return array("get","element","save","delete");
}
public function getUserAccess(){
return array();
}
public function getAnonymousAccess(){
return array("get","element");
}
public function validateSave($obj){
$type = $obj->type;
$baseObject = new $type();
$fields = $baseObject->getObjectKeys();
if(isset($fields[$obj->name])){
return new IceResponse(IceResponse::ERROR,"Column name already exists by default");
}
$cf = new CustomField();
if(empty($obj->id)){
$cf->Load("type = ? and name = ?",array($obj->type, $obj->name));
if($cf->name == $obj->name){
return new IceResponse(IceResponse::ERROR,"Another custom field with same name has already been added");
}
}else{
$cf->Load("type = ? and name = ? and id <> ?",array($obj->type, $obj->name, $obj->id));
if($cf->name == $obj->name){
return new IceResponse(IceResponse::ERROR,"Another custom field with same name has already been added");
}
}
return new IceResponse(IceResponse::SUCCESS,"");
}
}
}

Some files were not shown because too many files have changed in this diff Show More