diff --git a/Views/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d.cshtml b/Views/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d.cshtml
index a7de766..d75552d 100644
--- a/Views/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d.cshtml
+++ b/Views/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d.cshtml
@@ -354,6 +354,13 @@
diff --git a/wwwroot/js/coregen.js b/wwwroot/js/coregen.js
index 9fb5bc1..0a4abf5 100644
--- a/wwwroot/js/coregen.js
+++ b/wwwroot/js/coregen.js
@@ -659,3 +659,12 @@ function GetMenu(module, mymenu, menu_url){
startLoad();
AjaxGetRequest(menu_url, refresh_menu, menu_error);
}
+
+
+function coreFormatPrice(value, digits) {
+ var currency = 0;
+ if (value) {
+ currency = (value / 1).toFixed(digits);
+ }
+ return currency.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
+}
diff --git a/wwwroot/js/eva_evaluation_achievement_process/eva_evaluation_achievement_process_inline.js b/wwwroot/js/eva_evaluation_achievement_process/eva_evaluation_achievement_process_inline.js
index c78d907..9712ad3 100644
--- a/wwwroot/js/eva_evaluation_achievement_process/eva_evaluation_achievement_process_inline.js
+++ b/wwwroot/js/eva_evaluation_achievement_process/eva_evaluation_achievement_process_inline.js
@@ -20,8 +20,8 @@ function eva_evaluation_achievement_process_FeedDataToForm(data, i, blankItem) {
$("#eva_evaluation_achievement_process_create_evaluation_detail_id_" + i).val(data.create_evaluation_detail_id);
$("#eva_evaluation_achievement_process_achievement_" + i).text(data.achievement);
$("#eva_evaluation_achievement_process_weight_" + i).text(data.weight);
- $("#eva_evaluation_achievement_process_score_" + i).val(data.score);
- $("#eva_evaluation_achievement_process_sumary_" + i).text(data.sumary);
+ $("#eva_evaluation_achievement_process_score_" + i).val(data.score.toFixed(3));
+ $("#eva_evaluation_achievement_process_sumary_" + i).text(data.sumary.toFixed(3));
//$("#eva_evaluation_achievement_process_target_score1_" + i).val(data.target_score1);
//$("#eva_evaluation_achievement_process_target_score2_" + i).val(data.target_score2);
//$("#eva_evaluation_achievement_process_target_score3_" + i).val(data.target_score3);
diff --git a/wwwroot/js/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2_inline.js b/wwwroot/js/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2_inline.js
index 89b2be8..5093eb7 100644
--- a/wwwroot/js/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2_inline.js
+++ b/wwwroot/js/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2_inline.js
@@ -1,5 +1,5 @@
function eva_evaluation_achievement_process2_ClearForm(i, blankItem) {
- var data = blankItem;
+ var data = blankItem;
$("#eva_evaluation_achievement_process2_id_" + i).val("");
$("#eva_evaluation_achievement_process2_create_evaluation_detail_id_" + i).val("");
$("#eva_evaluation_achievement_process2_achievement_" + i).text("");
@@ -21,26 +21,24 @@ function eva_evaluation_achievement_process2_FeedDataToForm(data, i, blankItem,
$("#eva_evaluation_achievement_process2_create_evaluation_detail_id_" + i).val(data.create_evaluation_detail_id);
$("#eva_evaluation_achievement_process2_achievement_" + i).text(data.achievement);
$("#eva_evaluation_achievement_process2_weight_" + i).text(data.weight);
-
+
//console.log(data);
- if(role_code === "2"){
- $("#eva_evaluation_achievement_process2_score_" + i).text(data.score);
- $("#eva_evaluation_achievement_process2_sumary_" + i).text(data.sumary);
- $("#eva_evaluation_achievement_process2_score2_" + i).val(data.score2);
- $("#eva_evaluation_achievement_process2_sumary2_" + i).text(data.sumary2);
- }
- else if(role_code === "3"){
- $("#eva_evaluation_achievement_process2_score_" + i).text(data.score2);
- $("#eva_evaluation_achievement_process2_sumary_" + i).text(data.sumary2);
- $("#eva_evaluation_achievement_process2_score2_" + i).val(data.score3);
- $("#eva_evaluation_achievement_process2_sumary2_" + i).text(data.sumary3);
- }
- else if(role_code === "4"){
- $("#eva_evaluation_achievement_process2_score_" + i).text(data.score3);
- $("#eva_evaluation_achievement_process2_sumary_" + i).text(data.sumary3);
- $("#eva_evaluation_achievement_process2_score2_" + i).val(data.score4);
- $("#eva_evaluation_achievement_process2_sumary2_" + i).text(data.sumary4);
+ if (role_code === "2") {
+ $("#eva_evaluation_achievement_process2_score_" + i).text(data.score.toFixed(3));
+ $("#eva_evaluation_achievement_process2_sumary_" + i).text(data.sumary.toFixed(3));
+ $("#eva_evaluation_achievement_process2_score2_" + i).val(data.score2.toFixed(3));
+ $("#eva_evaluation_achievement_process2_sumary2_" + i).text(data.sumary2.toFixed(3));
+ } else if (role_code === "3") {
+ $("#eva_evaluation_achievement_process2_score_" + i).text(data.score2.toFixed(3));
+ $("#eva_evaluation_achievement_process2_sumary_" + i).text(data.sumary2.toFixed(3));
+ $("#eva_evaluation_achievement_process2_score2_" + i).val(data.score3.toFixed(3));
+ $("#eva_evaluation_achievement_process2_sumary2_" + i).text(data.sumary3.toFixed(3));
+ } else if (role_code === "4") {
+ $("#eva_evaluation_achievement_process2_score_" + i).text(data.score3.toFixed(3));
+ $("#eva_evaluation_achievement_process2_sumary_" + i).text(data.sumary3.toFixed(3));
+ $("#eva_evaluation_achievement_process2_score2_" + i).val(data.score4.toFixed(3));
+ $("#eva_evaluation_achievement_process2_sumary2_" + i).text(data.sumary4.toFixed(3));
}
//$("#eva_evaluation_achievement_process2_target_score1_" + i).val(data.target_score1);
@@ -74,65 +72,65 @@ function eva_evaluation_achievement_process2_GetFromForm(obj, i) {
}
function eva_evaluation_achievement_process2_Save(id) {
- //Insert eva_evaluation_achievement_process2 List
- var eva_evaluation_achievement_process2 = [];
+ //Insert eva_evaluation_achievement_process2 List
+ var eva_evaluation_achievement_process2 = [];
$('#eva_evaluation_achievement_process2Body tr').each(function () {
var i = $(this).find("#rowCount").text();
- var eacheva_evaluation_achievement_process2 = eva_evaluation_achievement_process2_GetFromForm($(this), i);
- eva_evaluation_achievement_process2.push(eacheva_evaluation_achievement_process2);
- });
+ var eacheva_evaluation_achievement_process2 = eva_evaluation_achievement_process2_GetFromForm($(this), i);
+ eva_evaluation_achievement_process2.push(eacheva_evaluation_achievement_process2);
+ });
var successFunc = function (result) {
//AlertSuccess("ปรับปรุงข้อมูลเรียบร้อยแล้ว");
- endLoad();
+ endLoad();
};
- startLoad();
-//console.log(eva_evaluation_achievement_process2);
- AjaxPutRequest(apisite + '/api/eva_evaluation_achievement_process2/UpdateMultiple', eva_evaluation_achievement_process2, successFunc, AlertDanger);
+ startLoad();
+ //console.log(eva_evaluation_achievement_process2);
+ AjaxPutRequest(apisite + '/api/eva_evaluation_achievement_process2/UpdateMultiple', eva_evaluation_achievement_process2, successFunc, AlertDanger);
}
function eva_evaluation_achievement_process2_Get(a, blankItem, role_code) {
- $('#eva_evaluation_achievement_process2Body').empty();
+ $('#eva_evaluation_achievement_process2Body').empty();
- var successFunc = function (response) {
- //console.log(response);
- $.each(response, function (i, data) {
- var tag = '
';
- tag += ' | ';
- tag += ' | ';
- tag += ' | ';
- //tag += ' | ';
- //tag += ' | ';
- //tag += ' | ';
- //tag += ' | ';
- //tag += ' | ';
- tag += ' | ';
- tag += ' | ';
- tag += ' | ';
- tag += ' | ';
- tag += '
';
- $('#eva_evaluation_achievement_process2Body').append($(tag));
- eva_evaluation_achievement_process2_FeedDataToForm(data, (i + 1), blankItem, role_code);
- });
+ var successFunc = function (response) {
+ //console.log(response);
+ $.each(response, function (i, data) {
+ var tag = '
';
+ tag += ' | ';
+ tag += ' | ';
+ tag += ' | ';
+ //tag += ' | ';
+ //tag += ' | ';
+ //tag += ' | ';
+ //tag += ' | ';
+ //tag += ' | ';
+ tag += ' | ';
+ tag += ' | ';
+ tag += ' | ';
+ tag += ' | ';
+ tag += '
';
+ $('#eva_evaluation_achievement_process2Body').append($(tag));
+ eva_evaluation_achievement_process2_FeedDataToForm(data, (i + 1), blankItem, role_code);
+ });
eva_evaluation_achievement_process2_Summary();
-Oneva_evaluation_achievement_process2_scoreChange();
- endLoad();
- };
- startLoad();
-//console.log(apisite + "/api/eva_evaluation_achievement_process2?create_evaluation_detail_id="+a);
- AjaxGetRequest(apisite + "/api/eva_evaluation_achievement_process2?create_evaluation_detail_id="+a, successFunc, AlertDanger);
- //AjaxGetRequest(apisite + '/api/eva_evaluation_achievement_process2/GetListBycreate_evaluation_detail_id/' + a, successFunc, AlertDanger);
+ Oneva_evaluation_achievement_process2_scoreChange();
+ endLoad();
+ };
+ startLoad();
+ //console.log(apisite + "/api/eva_evaluation_achievement_process2?create_evaluation_detail_id="+a);
+ AjaxGetRequest(apisite + "/api/eva_evaluation_achievement_process2?create_evaluation_detail_id=" + a, successFunc, AlertDanger);
+ //AjaxGetRequest(apisite + '/api/eva_evaluation_achievement_process2/GetListBycreate_evaluation_detail_id/' + a, successFunc, AlertDanger);
}
-function CheckValidValueachievement(){
+function CheckValidValueachievement() {
$('#eva_evaluation_achievement_process2Body tr').each(function () {
var i = $(this).find("#rowCount").text();
var score = $("#eva_evaluation_achievement_process2_score2_" + i).val();
- if(score > 5) $("#eva_evaluation_achievement_process2_score2_" + i).val("");
- if(score < 1) $("#eva_evaluation_achievement_process2_score2_" + i).val("");
- });
+ if (score > 5) $("#eva_evaluation_achievement_process2_score2_" + i).val("");
+ if (score < 1) $("#eva_evaluation_achievement_process2_score2_" + i).val("");
+ });
}
function Oneva_evaluation_achievement_process2_scoreChange() {
@@ -146,7 +144,7 @@ function Oneva_evaluation_achievement_process2_scoreChange() {
$('#eva_evaluation_achievement_process2Body tr').each(function () {
var i = $(this).find("#rowCount").text();
var score_old = $("#eva_evaluation_achievement_process2_score_" + i).text();
- var score = $("#eva_evaluation_achievement_process2_score2_" + i).val();
+ var score = $("#eva_evaluation_achievement_process2_score2_" + i).val();
var weight = $("#eva_evaluation_achievement_process2_weight_" + i).text();
var total = (score * weight / 100).toFixed(3);
$("#eva_evaluation_achievement_process2_sumary2_" + i).text(total);
@@ -158,17 +156,17 @@ function Oneva_evaluation_achievement_process2_scoreChange() {
total_achievement_score_old += parseFloat(score_old);
total_achievement_old += parseFloat(total_old);
//console.log(score_old);
- });
+ });
$("#h_eva_evaluation_achievement_process2_weight").text(total_achievement_weight.toFixed(3));
$("#h_eva_evaluation_achievement_process2_score2").text(total_achievement.toFixed(3));
$("#h_eva_evaluation_achievement_process2_score").text(total_achievement_old.toFixed(3));
var w1 = parseFloat($("#w1").text());
- $("#x1").text((total_achievement_old*20).toFixed(3));
- $("#eva_create_evaluation_detail_summary2_total_summary_supervisor").text((total_achievement*20).toFixed(3));
- $("#eva_create_evaluation_detail_summary2_Final_summary_supervisor").text((total_achievement*20).toFixed(3));
- $("#eva_create_evaluation_detail_summary2_achievement_supervisor").text(((total_achievement*20)*w1/100).toFixed(3));
+ $("#x1").text((total_achievement_old * 20).toFixed(3));
+ $("#eva_create_evaluation_detail_summary2_total_summary_supervisor").text((total_achievement * 20).toFixed(3));
+ $("#eva_create_evaluation_detail_summary2_Final_summary_supervisor").text((total_achievement * 20).toFixed(3));
+ $("#eva_create_evaluation_detail_summary2_achievement_supervisor").text(((total_achievement * 20) * w1 / 100).toFixed(3));
calculationAllItem();
}
@@ -188,4 +186,4 @@ function eva_evaluation_achievement_process2_InitialForm(id, role_code) {
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_evaluation_achievement_process2/" + "GetBlankItem", successFunc, AlertDanger);
-}
+}
\ No newline at end of file
diff --git a/wwwroot/js/eva_evaluation_behavior/eva_evaluation_behavior.js b/wwwroot/js/eva_evaluation_behavior/eva_evaluation_behavior.js
index 8f6cbf0..fc74146 100644
--- a/wwwroot/js/eva_evaluation_behavior/eva_evaluation_behavior.js
+++ b/wwwroot/js/eva_evaluation_behavior/eva_evaluation_behavior.js
@@ -162,6 +162,7 @@ var eva_evaluation_behavior_setupTable = function (result) {
sum_b += v.weight;
});
$("#sum_b").text(sum_b);
+ $("#sum_weight_eva_evaluation_behavior").text(sum_b);
eva_evaluation_behaviorTableV = $('#eva_evaluation_behaviorTable').DataTable({
"processing": true,
diff --git a/wwwroot/js/eva_evaluation_behavior_process/eva_evaluation_behavior_process_inline.js b/wwwroot/js/eva_evaluation_behavior_process/eva_evaluation_behavior_process_inline.js
index 92cdce5..bf7026b 100644
--- a/wwwroot/js/eva_evaluation_behavior_process/eva_evaluation_behavior_process_inline.js
+++ b/wwwroot/js/eva_evaluation_behavior_process/eva_evaluation_behavior_process_inline.js
@@ -19,8 +19,8 @@ function eva_evaluation_behavior_process_FeedDataToForm(data, i, blankItem) {
$("#eva_evaluation_behavior_process_create_evaluation_detail_id_" + i).val(data.create_evaluation_detail_id);
$("#eva_evaluation_behavior_process_behavior_" + i).text(data.behavior);
$("#eva_evaluation_behavior_process_weight_" + i).text(data.weight);
- $("#eva_evaluation_behavior_process_score_" + i).val(data.score);
- $("#eva_evaluation_behavior_process_sumary_" + i).text(data.sumary);
+ $("#eva_evaluation_behavior_process_score_" + i).val(data.score.toFixed(3));
+ $("#eva_evaluation_behavior_process_sumary_" + i).text(data.sumary.toFixed(3));
//$("#eva_evaluation_behavior_process_target_score1_" + i).val(data.target_score1);
//$("#eva_evaluation_behavior_process_target_score2_" + i).val(data.target_score2);
//$("#eva_evaluation_behavior_process_target_score3_" + i).val(data.target_score3);
diff --git a/wwwroot/js/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2_inline.js b/wwwroot/js/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2_inline.js
index feaae17..5edbda6 100644
--- a/wwwroot/js/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2_inline.js
+++ b/wwwroot/js/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2_inline.js
@@ -21,22 +21,22 @@ function eva_evaluation_behavior_process2_FeedDataToForm(data, i, blankItem, rol
$("#eva_evaluation_behavior_process2_weight_" + i).val(data.weight);
if(role_code === "2"){
- $("#eva_evaluation_behavior_process2_score_" + i).text(data.score);
- $("#eva_evaluation_behavior_process2_sumary_" + i).text(data.sumary);
- $("#eva_evaluation_behavior_process2_score2_" + i).val(data.score2);
- $("#eva_evaluation_behavior_process2_sumary2_" + i).text(data.sumary2);
+ $("#eva_evaluation_behavior_process2_score_" + i).text(data.score.toFixed(3));
+ $("#eva_evaluation_behavior_process2_sumary_" + i).text(data.sumary.toFixed(3));
+ $("#eva_evaluation_behavior_process2_score2_" + i).val(data.score2.toFixed(3));
+ $("#eva_evaluation_behavior_process2_sumary2_" + i).text(data.sumary2.toFixed(3));
}
else if(role_code === "3"){
- $("#eva_evaluation_behavior_process2_score_" + i).text(data.score2);
- $("#eva_evaluation_behavior_process2_sumary_" + i).text(data.sumary2);
- $("#eva_evaluation_behavior_process2_score2_" + i).val(data.score3);
- $("#eva_evaluation_behavior_process2_sumary2_" + i).text(data.sumary3);
+ $("#eva_evaluation_behavior_process2_score_" + i).text(data.score2.toFixed(3));
+ $("#eva_evaluation_behavior_process2_sumary_" + i).text(data.sumary2.toFixed(3));
+ $("#eva_evaluation_behavior_process2_score2_" + i).val(data.score3.toFixed(3));
+ $("#eva_evaluation_behavior_process2_sumary2_" + i).text(data.sumary3.toFixed(3));
}
else if(role_code === "4"){
- $("#eva_evaluation_behavior_process2_score_" + i).text(data.score3);
- $("#eva_evaluation_behavior_process2_sumary_" + i).text(data.sumary3);
- $("#eva_evaluation_behavior_process2_score2_" + i).val(data.score4);
- $("#eva_evaluation_behavior_process2_sumary2_" + i).text(data.sumary4);
+ $("#eva_evaluation_behavior_process2_score_" + i).text(data.score3.toFixed(3));
+ $("#eva_evaluation_behavior_process2_sumary_" + i).text(data.sumary3.toFixed(3));
+ $("#eva_evaluation_behavior_process2_score2_" + i).val(data.score4.toFixed(3));
+ $("#eva_evaluation_behavior_process2_sumary2_" + i).text(data.sumary4.toFixed(3));
}
//$("#eva_evaluation_behavior_process2_target_score1_" + i).val(data.target_score1);
diff --git a/wwwroot/js/eva_limit_frame_employee/eva_limit_frame_employee.js b/wwwroot/js/eva_limit_frame_employee/eva_limit_frame_employee.js
index 6809648..235f6d9 100644
--- a/wwwroot/js/eva_limit_frame_employee/eva_limit_frame_employee.js
+++ b/wwwroot/js/eva_limit_frame_employee/eva_limit_frame_employee.js
@@ -165,6 +165,24 @@ function eva_limit_frame_employee_GoDelete(a) {
var eva_limit_frame_employeeTableV;
var eva_limit_frame_employee_setupTable = function (result) {
+ console.log("result", result);
+
+ $.each(result, function (index_result, obj_result) {
+ /*console.log("index_result", index_result);
+ console.log("obj_result", obj_result);*/
+ var digits = 2;
+ var currency_salary = coreFormatPrice(obj_result.salary, digits);
+ var currency_position_allowance = coreFormatPrice(obj_result.position_allowance, digits);
+ var currency_monthly_remuneration = coreFormatPrice(obj_result.monthly_remuneration, digits);
+ var currency_cost_of_living = coreFormatPrice(obj_result.cost_of_living, digits);
+
+ obj_result.salary = currency_salary;
+ obj_result.position_allowance = currency_position_allowance;
+ obj_result.monthly_remuneration = currency_monthly_remuneration;
+ obj_result.currency_cost_of_living = currency_cost_of_living
+ /*console.log(obj_result);*/
+ });
+
tmp = '"';
var groupColumn = 3;
eva_limit_frame_employeeTableV = $('#eva_limit_frame_employeeTable').DataTable({
diff --git a/wwwroot/js/eva_limit_frame_group/eva_limit_frame_group_d.js b/wwwroot/js/eva_limit_frame_group/eva_limit_frame_group_d.js
index bbb3884..a8d7cb7 100644
--- a/wwwroot/js/eva_limit_frame_group/eva_limit_frame_group_d.js
+++ b/wwwroot/js/eva_limit_frame_group/eva_limit_frame_group_d.js
@@ -106,4 +106,31 @@ function eva_limit_frame_group_GoDelete(a) {
//================= Multi-Selection Function =========================================
+function funcCeilCalculateSalaryLimit(params) {
+ console.log("params", params);
+ var input_id = params.srcElement.id;
+ var val_input = params.srcElement.value;
+ var num_check = 10;
+ var val_divine = 100;
+ var val_decimal = 0;
+ var after_cal = 0;
+ if (val_input) {
+ val_decimal = Number(parseFloat(val_input));
+ }
+ var val_salary = Number($("#eva_limit_frame_group_total_salary").val());
+ var cal_divine_salary = Number(((val_salary * val_decimal) / val_divine).toFixed(3));
+ $("#eva_limit_frame_group_total_salary_limit").val(cal_divine_salary.toFixed(3));
+ var cal_ceil = Math.ceil(cal_divine_salary);
+ console.log("cal_ceil", cal_ceil);
+ var str_ceil = cal_ceil.toString();
+ var split_ceil = str_ceil.split('');
+ var num_last = Number(split_ceil[split_ceil.length - 1]);
+ if (num_last) {
+ after_cal = num_check - num_last;
+ }
+ var set_salary_limit_rounded = cal_ceil + after_cal;
+ /*console.log("set_salary_limit_rounded", set_salary_limit_rounded);*/
+ $("#eva_limit_frame_group_total_salary_limit_rounded").val(set_salary_limit_rounded.toFixed(3));
+
+}