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({