clickup #6zrfkc

This commit is contained in:
Pairat Sangprasert
2021-04-15 16:09:50 +07:00
parent ddb4232254
commit ff22eababb
4 changed files with 25 additions and 13 deletions

View File

@@ -128,25 +128,25 @@
</div>
<div class="form-group col-md-4">
<label id="lab_eva_limit_frame_group_limit_frame_295" for="eva_limit_frame_group_limit_frame_295">กรอบวงเงินที่กันไว้</label>
<input class="form-control" type="number" id="eva_limit_frame_group_limit_frame_295" iLabel="กรอบวงเงินที่กันไว้" iRequire="false" iGroup="eva_limit_frame_group"
<label id="lab_eva_limit_frame_group_limit_frame_295" for="eva_limit_frame_group_limit_frame_295">วงเงินในการเลื่อนเงินเดือน ร้อยละ</label>
<input class="form-control" type="number" id="eva_limit_frame_group_limit_frame_295" iLabel="วงเงินในการเลื่อนเงินเดือน ร้อยละ" iRequire="false" iGroup="eva_limit_frame_group"
onchange="funcCeilCalculateSalaryLimit(event)" />
</div>
</div>
<div class='row'>
<div class="form-group col-md-4">
<label id="lab_eva_limit_frame_group_total_salary" for="eva_limit_frame_group_total_salary">อัตราเงินเดือนรวม</label>
<input disabled class="form-control" type="number" id="eva_limit_frame_group_total_salary" iLabel="อัตราเงินเดือนรวม" iRequire="false" iGroup="eva_limit_frame_group" />
<input disabled class="form-control" type="text" id="eva_limit_frame_group_total_salary" iLabel="อัตราเงินเดือนรวม" iRequire="false" iGroup="eva_limit_frame_group" />
</div>
<div class="form-group col-md-4">
<label id="lab_eva_limit_frame_group_total_salary_limit" for="eva_limit_frame_group_total_salary_limit">วงเงินในการเลื่อนเงินเดือน</label>
<input disabled class="form-control" type="number" id="eva_limit_frame_group_total_salary_limit" iLabel="วงเงินในการเลื่อนเงินเดือน" iRequire="false" iGroup="eva_limit_frame_group" />
<input disabled class="form-control" type="text" id="eva_limit_frame_group_total_salary_limit" iLabel="วงเงินในการเลื่อนเงินเดือน" iRequire="false" iGroup="eva_limit_frame_group" />
</div>
<div class="form-group col-md-4">
<label id="lab_eva_limit_frame_group_total_salary_limit_rounded" for="eva_limit_frame_group_total_salary_limit_rounded">วงเงินในการเลื่อนเงินเดือน ที่ใช้จริง</label>
<input disabled class="form-control" type="number" id="eva_limit_frame_group_total_salary_limit_rounded" iLabel="วงเงินในการเลื่อนเงินเดือน ที่ใช้จริง" iRequire="false" iGroup="eva_limit_frame_group" />
<input disabled class="form-control" type="text" id="eva_limit_frame_group_total_salary_limit_rounded" iLabel="วงเงินในการเลื่อนเงินเดือน ที่ใช้จริง" iRequire="false" iGroup="eva_limit_frame_group" />
</div>
</div>
<div class='row'>

View File

@@ -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;
}

View File

@@ -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);*/
});

View File

@@ -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));
}