From 6e17ab7ee07ac793a6967405014e0ca461c60368 Mon Sep 17 00:00:00 2001 From: Pairat Sangprasert Date: Sun, 28 Mar 2021 21:32:08 +0700 Subject: [PATCH 1/2] =?UTF-8?q?clickup=20#7a0d5z=20=E0=B8=97=E0=B8=B3?= =?UTF-8?q?=E0=B8=84=E0=B8=B3=E0=B8=99=E0=B8=A7=E0=B8=99=20"=E0=B8=A7?= =?UTF-8?q?=E0=B8=87=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99=E0=B9=83=E0=B8=99?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B9=80=E0=B8=A5=E0=B8=B7=E0=B9=88?= =?UTF-8?q?=E0=B8=AD=E0=B8=99=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99=E0=B9=80?= =?UTF-8?q?=E0=B8=94=E0=B8=B7=E0=B8=AD=E0=B8=99=20=E0=B8=97=E0=B8=B5?= =?UTF-8?q?=E0=B9=88=E0=B9=83=E0=B8=8A=E0=B9=89=E0=B8=88=E0=B8=A3=E0=B8=B4?= =?UTF-8?q?=E0=B8=87"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eva_limit_frame_group_d.cshtml | 3 ++- .../eva_limit_frame_group_d.js | 27 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) 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 f58ee7a..6581d44 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 @@ -129,7 +129,8 @@
- +
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)); + +} From 7f279c71a75adb213fe8663649c77f4d110870ac Mon Sep 17 00:00:00 2001 From: Pairat Sangprasert Date: Mon, 29 Mar 2021 01:26:37 +0700 Subject: [PATCH 2/2] =?UTF-8?q?=E0=B9=80=E0=B8=AA=E0=B8=A3=E0=B8=B4?= =?UTF-8?q?=E0=B8=A1=20clickup=20#7a0d5z=20=E0=B8=97=E0=B8=B5=E0=B9=88?= =?UTF-8?q?=E0=B8=9E=E0=B8=B5=E0=B9=88=E0=B8=95=E0=B9=89=E0=B8=99=E0=B8=82?= =?UTF-8?q?=E0=B8=AD=20=E0=B8=97=E0=B8=B3=20core=20function=20js=20?= =?UTF-8?q?=E0=B9=81=E0=B8=9B=E0=B8=A5=E0=B8=87=20=E0=B8=95=E0=B8=B1?= =?UTF-8?q?=E0=B8=A7=E0=B9=80=E0=B8=A5=E0=B8=82=E0=B9=80=E0=B8=9B=E0=B9=87?= =?UTF-8?q?=E0=B8=99=20format=20currency=20=E0=B9=84=E0=B8=A7=E0=B9=89?= =?UTF-8?q?=E0=B9=83=E0=B8=99=E0=B9=84=E0=B8=9F=E0=B8=A5=E0=B9=8C=20coreje?= =?UTF-8?q?n.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/js/coregen.js | 9 +++++++++ .../eva_limit_frame_employee.js | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+) 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_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({