diff --git a/Views/vw_limit_frame_planView/vw_limit_frame_plan_d.cshtml b/Views/vw_limit_frame_planView/vw_limit_frame_plan_d.cshtml index c8eea4e..0a4cf40 100644 --- a/Views/vw_limit_frame_planView/vw_limit_frame_plan_d.cshtml +++ b/Views/vw_limit_frame_planView/vw_limit_frame_plan_d.cshtml @@ -55,61 +55,30 @@ -
-
+
-
- - -
- -
+
-
-
+ +
+
- -
- -
- - +
-
-
- - -
- -
- - -
-
-
-
-
- - - -
-
-
@@ -120,18 +89,63 @@ - + - + + + + + + + + + + + + + + + + + + + + + + +
เครื่องมือ
+ + +
+ + + + + +
+ + + +
+ +
+
+ + + +
+
+ @section FooterPlaceHolder{ diff --git a/wwwroot/js/eva_limit_frame_group/eva_limit_frame_group.js b/wwwroot/js/eva_limit_frame_group/eva_limit_frame_group.js index 094f27c..77c2c6f 100644 --- a/wwwroot/js/eva_limit_frame_group/eva_limit_frame_group.js +++ b/wwwroot/js/eva_limit_frame_group/eva_limit_frame_group.js @@ -158,11 +158,19 @@ function eva_limit_frame_group_GoDelete(a) { var eva_limit_frame_groupTableV; var eva_limit_frame_group_setupTable = function (result) { - + let num_row = 1; + let sum_total_salary = 0; + let sum_total_salary_limit = 0; + let sum_total_salary_limit_rounded = 0; + let sum_emp_qty = 0; $.each(result, function (index_result, obj_result) { /*console.log("index_result", index_result); console.log("obj_result", obj_result);*/ + sum_total_salary += Number(obj_result.total_salary); + sum_total_salary_limit += Number(obj_result.total_salary_limit); + sum_total_salary_limit_rounded += Number(obj_result.total_salary_limit_rounded); + var currency_total_salary = coreFormatPrice(obj_result.total_salary, limit_frame_group_digits); var currency_total_salary_limit = coreFormatPrice(obj_result.total_salary_limit, limit_frame_group_digits); var currency_total_salary_limit_rounded = coreFormatPrice(obj_result.total_salary_limit_rounded, limit_frame_group_digits); @@ -170,9 +178,22 @@ var eva_limit_frame_group_setupTable = function (result) { obj_result.total_salary = currency_total_salary; obj_result.total_salary_limit = currency_total_salary_limit; obj_result.total_salary_limit_rounded = currency_total_salary_limit_rounded; + obj_result.num_row = num_row; + obj_result.emp_qty = 0; + sum_emp_qty += obj_result.emp_qty; + num_row++; }); + /*console.log("sum_total_salary", sum_total_salary); + console.log("sum_total_salary_limit", sum_total_salary_limit); + console.log("sum_total_salary_limit_rounded", sum_total_salary_limit_rounded); + console.log("sum_emp_qty", sum_emp_qty);*/ + $("#sum_total_salary").text(coreFormatPrice(sum_total_salary, limit_frame_group_digits)); + $("#sum_total_salary_limit").text(coreFormatPrice(sum_total_salary_limit, limit_frame_group_digits)); + $("#sum_total_salary_limit_rounded").text(coreFormatPrice(sum_total_salary_limit_rounded, limit_frame_group_digits)); + $("#sum_emp_qty").text(sum_emp_qty); + tmp = '"'; eva_limit_frame_groupTableV = $('#eva_limit_frame_groupTable').DataTable({ "processing": true, @@ -182,13 +203,14 @@ var eva_limit_frame_group_setupTable = function (result) { // "style": 'multi' //}, "columns": [ - //{ "data": "" }, { "data": "id" }, + { "data": "num_row" }, { "data": "group_guid_eva_evaluation_group_code" }, - { "data": "limit_frame_295" }, { "data": "total_salary" }, + { "data": "limit_frame_295" }, { "data": "total_salary_limit" }, { "data": "total_salary_limit_rounded" }, + { "data": "emp_qty" }, { "data": "remark_formatted" }, ], "columnDefs": [ diff --git a/wwwroot/js/vw_limit_frame_plan/vw_limit_frame_plan_d.js b/wwwroot/js/vw_limit_frame_plan/vw_limit_frame_plan_d.js index 29e0ff6..9bcdba4 100644 --- a/wwwroot/js/vw_limit_frame_plan/vw_limit_frame_plan_d.js +++ b/wwwroot/js/vw_limit_frame_plan/vw_limit_frame_plan_d.js @@ -14,6 +14,8 @@ function vw_limit_frame_plan_FeedDataToForm(data) { $("#vw_limit_frame_plan_limit_frame_005_total").val(coreFormatPrice(data.limit_frame_005_total, limit_frame_digits)); $("#vw_limit_frame_plan_limit_frame_005_total_rounded").val(coreFormatPrice(data.limit_frame_005_total_rounded, limit_frame_digits)); + // สำหรับ แสดง กันวงเงินร้อยละ ใช้จริง + changeForRealLimitFrame(); } function vw_limit_frame_plan_GetFromForm() { @@ -138,4 +140,17 @@ function funcCalculateCeilTotalRoundedLimitFramePlan(params) { } var set_salary_limit_rounded = cal_ceil + after_cal; $("#vw_limit_frame_plan_limit_frame_005_total_rounded").val(coreFormatPrice(set_salary_limit_rounded, limit_frame_digits)); +} + + +function changeForRealLimitFrame() { + let val_input_limit_frame = $("#vw_limit_frame_plan_limit_frame_005").val(); + let real_limit_frame = 0; + if (val_input_limit_frame) { + real_limit_frame = Number(val_input_limit_frame); + } + real_limit_frame = real_limit_frame.toFixed(2); + /*console.log(real_limit_frame);*/ + $("#text_real_limit_frame").text("กันวงเงินร้อยละ " + real_limit_frame + " ใช้จริง"); + return real_limit_frame; } \ No newline at end of file