IceHrm v18.0
This commit is contained in:
@@ -1,26 +1,26 @@
|
||||
<?php
|
||||
if (!class_exists('SalaryAdminManager')) {
|
||||
class SalaryAdminManager extends AbstractModuleManager{
|
||||
class SalaryAdminManager extends AbstractModuleManager{
|
||||
|
||||
public function initializeUserClasses(){
|
||||
|
||||
}
|
||||
|
||||
public function initializeFieldMappings(){
|
||||
|
||||
}
|
||||
|
||||
public function initializeDatabaseErrorMappings(){
|
||||
|
||||
public function initializeUserClasses(){
|
||||
|
||||
}
|
||||
|
||||
public function initializeFieldMappings(){
|
||||
|
||||
}
|
||||
|
||||
public function initializeDatabaseErrorMappings(){
|
||||
|
||||
}
|
||||
|
||||
public function setupModuleClassDefinitions(){
|
||||
}
|
||||
|
||||
public function setupModuleClassDefinitions(){
|
||||
$this->addModelClass('SalaryComponentType');
|
||||
$this->addModelClass('SalaryComponent');
|
||||
$this->addModelClass('PayrollEmployee');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (!class_exists('SalaryComponentType')) {
|
||||
@@ -66,3 +66,20 @@ if (!class_exists('PayrollEmployee')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!class_exists('PayFrequency')) {
|
||||
class PayFrequency extends ICEHRM_Record {
|
||||
var $_table = 'PayFrequency';
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
$moduleName = 'salary';
|
||||
define('MODULE_PATH',dirname(__FILE__));
|
||||
include APP_BASE_PATH.'header.php';
|
||||
include APP_BASE_PATH.'mod-houlejslibs.inc.php';
|
||||
include APP_BASE_PATH.'modulejslibs.inc.php';
|
||||
|
||||
$moduleBuilder = new ModuleBuilder();
|
||||
|
||||
|
||||
@@ -79,162 +79,6 @@ SalaryComponentAdapter.method('getFormFields', function() {
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* DeductionAdapter
|
||||
*/
|
||||
|
||||
function DeductionAdapter(endPoint,tab,filter,orderBy) {
|
||||
this.initAdapter(endPoint,tab,filter,orderBy);
|
||||
}
|
||||
|
||||
DeductionAdapter.inherits(AdapterBase);
|
||||
|
||||
|
||||
|
||||
DeductionAdapter.method('getDataMapping', function() {
|
||||
return [
|
||||
"id",
|
||||
"name",
|
||||
"deduction_group"
|
||||
];
|
||||
});
|
||||
|
||||
DeductionAdapter.method('getHeaders', function() {
|
||||
return [
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Name" },
|
||||
{ "sTitle": "Calculation Group"}
|
||||
];
|
||||
});
|
||||
|
||||
DeductionAdapter.method('getFormFields', function() {
|
||||
|
||||
var rangeAmounts = [ "rangeAmounts", {"label":"Calculation Process","type":"datagroup",
|
||||
"form":[
|
||||
[ "lowerCondition", {"label":"Lower Limit Condition","type":"select","source":[["No Lower Limit","No Lower Limit"],["gt","Greater than"],["gte","Greater than or Equal"]]}],
|
||||
[ "lowerLimit", {"label":"Lower Limit","type":"text","validation":"float"}],
|
||||
[ "upperCondition", {"label":"Upper Limit Condition","type":"select","source":[["No Upper Limit","No Upper Limit"],["lt","Less than"],["lte","Less than or Equal"]]}],
|
||||
[ "upperLimit", {"label":"Upper Limit","type":"text","validation":"float"}],
|
||||
[ "amount", {"label":"Value","type":"text","validation":""}]
|
||||
],
|
||||
"html":'<div id="#_id_#" class="panel panel-default">#_delete_##_edit_#<div class="panel-body">#_renderFunction_#</div></div>',
|
||||
"validation":"none",
|
||||
"custom-validate-function":function (data){
|
||||
var res = {};
|
||||
res['valid'] = true;
|
||||
if(lowerCondition != 'No Lower Limit'){
|
||||
data.lowerLimit = 0;
|
||||
}
|
||||
if(upperCondition != 'No Upper Limit'){
|
||||
data.upperLimit = 0;
|
||||
}
|
||||
res['params'] = data;
|
||||
return res;
|
||||
},
|
||||
"render":function(item){
|
||||
var output = "";
|
||||
var getSymbol = function(text){
|
||||
var map = {};
|
||||
map['gt'] = '>';
|
||||
map['gte'] = '>=';
|
||||
map['lt'] = '<';
|
||||
map['lte'] = '<=';
|
||||
|
||||
return map[text];
|
||||
}
|
||||
if(item.lowerCondition != "No Lower Limit"){
|
||||
output += item.lowerLimit + " " + getSymbol(item.lowerCondition) + " ";
|
||||
}
|
||||
|
||||
if(item.upperCondition != "No Upper Limit"){
|
||||
output += " and ";
|
||||
output += getSymbol(item.upperCondition) + " " + item.upperLimit + " ";
|
||||
}
|
||||
if(output == ""){
|
||||
return "Deduction is "+item.amount + " for all ranges";
|
||||
}else{
|
||||
return "If salary component "+output+ " deduction is "+item.amount;
|
||||
}
|
||||
|
||||
|
||||
return output;
|
||||
|
||||
}
|
||||
|
||||
}];
|
||||
|
||||
return [
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
[ "name", {"label":"Name","type":"text","validation":""}],
|
||||
[ "componentType", {"label":"Salary Component Type","type":"select2multi","allow-null":true,"remote-source":["SalaryComponentType","id","name"]}],
|
||||
[ "component", {"label":"Salary Component","type":"select2multi","allow-null":true,"remote-source":["SalaryComponent","id","name"]}],
|
||||
[ "payrollColumn", {"label":"Payroll Report Column","type":"select2","allow-null":true,"remote-source":["PayrollColumn","id","name"]}],
|
||||
rangeAmounts,
|
||||
[ "deduction_group", {"label":"Calculation Group","type":"select2","allow-null":true,"null-label":"None","remote-source":["DeductionGroup","id","name"]}]
|
||||
|
||||
];
|
||||
});
|
||||
|
||||
/*
|
||||
DeductionAdapter.method('doCustomValidation', function(params) {
|
||||
if(params.type == "Fixed"){
|
||||
return null;
|
||||
}
|
||||
if(params.percentage_type == "On Component Type"){
|
||||
params.component = "NULL";
|
||||
if(params.componentType == "NULL"){
|
||||
return "Salary component type should be selected";
|
||||
}
|
||||
}else if(params.percentage_type == "On Component"){
|
||||
params.componentType = "NULL";
|
||||
if(params.component == "NULL"){
|
||||
return "Salary component should be selected";
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
});
|
||||
*/
|
||||
/*
|
||||
DeductionAdapter.method('postRenderForm', function(object, $tempDomObj) {
|
||||
|
||||
$tempDomObj.find("#field_componentType").hide();
|
||||
$tempDomObj.find("#field_percentage_type").hide();
|
||||
$tempDomObj.find("#field_component").hide();
|
||||
|
||||
|
||||
$tempDomObj.find("#percentage_type").off().on('change',function(e){
|
||||
if(e.val == "On Component"){
|
||||
$("#componentType").hide();
|
||||
$("#component").show();
|
||||
}else{
|
||||
$("#componentType").show();
|
||||
$("#component").hide();
|
||||
}
|
||||
});
|
||||
|
||||
$tempDomObj.find("#type").off().on('change',function(e){
|
||||
if(e.val == "Fixed"){
|
||||
$("#componentType").hide();
|
||||
$("#percentage_type").hide();
|
||||
$("#component").hide();
|
||||
}else{
|
||||
$("#percentage_type").show();
|
||||
if($("#percentage_type").select2('data').id == 'On Component'){
|
||||
$("#field_componentType").hide();
|
||||
$("#field_component").show();
|
||||
}else{
|
||||
$("#field_componentType").show();
|
||||
$("#field_component").hide();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
@@ -288,43 +132,3 @@ EmployeeSalaryAdapter.method('getFilters', function() {
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* DeductionGroupAdapter
|
||||
*/
|
||||
|
||||
function DeductionGroupAdapter(endPoint,tab,filter,orderBy) {
|
||||
this.initAdapter(endPoint,tab,filter,orderBy);
|
||||
}
|
||||
|
||||
DeductionGroupAdapter.inherits(AdapterBase);
|
||||
|
||||
|
||||
|
||||
DeductionGroupAdapter.method('getDataMapping', function() {
|
||||
return [
|
||||
"id",
|
||||
"name",
|
||||
"description"
|
||||
];
|
||||
});
|
||||
|
||||
DeductionGroupAdapter.method('getHeaders', function() {
|
||||
return [
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Name" },
|
||||
{ "sTitle": "Details" }
|
||||
];
|
||||
});
|
||||
|
||||
DeductionGroupAdapter.method('getFormFields', function() {
|
||||
return [
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
[ "name", {"label":"Name","type":"text","validation":""}],
|
||||
[ "description", {"label":"Details","type":"textarea","validation":"none"}]
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user