diff --git a/Views/eva_limit_frame_groupView/eva_limit_frame_group_d.cshtml b/Views/eva_limit_frame_groupView/eva_limit_frame_group_d.cshtml
index 6581d44..237b7b2 100644
--- a/Views/eva_limit_frame_groupView/eva_limit_frame_group_d.cshtml
+++ b/Views/eva_limit_frame_groupView/eva_limit_frame_group_d.cshtml
@@ -128,25 +128,25 @@
-
- วงเงินในการเลื่อนเงินเดือน ร้อยละ
+
diff --git a/wwwroot/js/coregen.js b/wwwroot/js/coregen.js
index 0a4abf5..f0942e0 100644
--- a/wwwroot/js/coregen.js
+++ b/wwwroot/js/coregen.js
@@ -665,6 +665,16 @@ function coreFormatPrice(value, digits) {
var currency = 0;
if (value) {
currency = (value / 1).toFixed(digits);
+ } else {
+ currency = currency.toFixed(digits);
}
return currency.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
+
+function coreCurrencyToDecimal(currency) {
+ var number = 0;
+ if (currency) {
+ number = Number(currency.replace(/[^0-9.-]+/g, ""));
+ }
+ return number;
+}
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 235f6d9..dccb113 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
@@ -170,7 +170,7 @@ var eva_limit_frame_employee_setupTable = function (result) {
$.each(result, function (index_result, obj_result) {
/*console.log("index_result", index_result);
console.log("obj_result", obj_result);*/
- var digits = 2;
+ var digits = 3;
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);
@@ -179,7 +179,7 @@ var eva_limit_frame_employee_setupTable = function (result) {
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
+ obj_result.cost_of_living = currency_cost_of_living;
/*console.log(obj_result);*/
});
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 a728452..20d80e6 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
@@ -4,13 +4,14 @@ var eva_limit_frame_group_API = "/api/eva_limit_frame_group/";
//================= Form Data Customizaiton =========================================
function eva_limit_frame_group_FeedDataToForm(data) {
+ var digits = 3;
$("#eva_limit_frame_group_id").val(data.id);
$("#eva_limit_frame_group_frame_plan_guid").val(data.frame_plan_guid);
DropDownClearFormAndFeedWithData($("#eva_limit_frame_group_group_guid"), data, "id", "thegroup", "item_group_guid", data.group_guid);
$("#eva_limit_frame_group_limit_frame_295").val(data.limit_frame_295);
- $("#eva_limit_frame_group_total_salary").val(data.total_salary);
- $("#eva_limit_frame_group_total_salary_limit").val(data.total_salary_limit);
- $("#eva_limit_frame_group_total_salary_limit_rounded").val(data.total_salary_limit_rounded);
+ $("#eva_limit_frame_group_total_salary").val(coreFormatPrice(data.total_salary, digits));
+ $("#eva_limit_frame_group_total_salary_limit").val(coreFormatPrice(data.total_salary_limit, digits));
+ $("#eva_limit_frame_group_total_salary_limit_rounded").val(coreFormatPrice(data.total_salary_limit_rounded, digits));
$("#eva_limit_frame_group_remark").val(data.remark);
}
@@ -111,6 +112,7 @@ function funcCeilCalculateSalaryLimit(params) {
console.log("params", params);
var input_id = params.srcElement.id;
var val_input = params.srcElement.value;
+ var digits = 3;
var num_check = 10;
var val_divine = 100;
var val_decimal = 0;
@@ -118,9 +120,9 @@ function funcCeilCalculateSalaryLimit(params) {
if (val_input) {
val_decimal = Number(parseFloat(val_input));
}
- var val_salary = Number($("#eva_limit_frame_group_total_salary").val());
+ var val_salary = coreCurrencyToDecimal($("#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));
+ $("#eva_limit_frame_group_total_salary_limit").val(coreFormatPrice(cal_divine_salary, digits));
var cal_ceil = Math.ceil(cal_divine_salary);
console.log("cal_ceil", cal_ceil);
var str_ceil = cal_ceil.toString();
@@ -131,7 +133,7 @@ function funcCeilCalculateSalaryLimit(params) {
}
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));
+ $("#eva_limit_frame_group_total_salary_limit_rounded").val(coreFormatPrice(set_salary_limit_rounded, digits));
}