ปรับปรุงสูตรการคำนวณต่างๆ
This commit is contained in:
@@ -99,7 +99,12 @@ var cur_dep = "";
|
||||
|
||||
var successFunc = function (response) {
|
||||
console.log(response);
|
||||
var sum_current_salary = 0;
|
||||
|
||||
$.each(response, function (i, data) {
|
||||
|
||||
sum_current_salary += data.sarary;
|
||||
|
||||
var tag = "";
|
||||
if(cur_dep !== data.emp_department_name){
|
||||
tag += '<tr><td colspan="16">'+data.emp_department_name+'</td></tr>';
|
||||
@@ -176,8 +181,14 @@ if(cur_dep !== data.emp_department_name){
|
||||
|
||||
$('#eva_adjust_postponement_detail_quota_02Body').append($(tag));
|
||||
eva_adjust_postponement_detail_quota_02_FeedDataToForm(data, (i + 1), blankItem);
|
||||
|
||||
});
|
||||
CalculateRemainQuota();
|
||||
|
||||
$("#eva_adjust_postponement_quota_limit").val(sum_current_salary);
|
||||
|
||||
Oneva_adjust_postponement_quota_limit_frame_quotaChange();
|
||||
|
||||
//CalculateRemainQuota();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
|
||||
@@ -129,8 +129,8 @@ function Oneva_adjust_postponement_normal_limit_frameChange(){
|
||||
var limit_frame = $("#eva_adjust_postponement_normal_limit_frame").val();
|
||||
limit_frame = Math.round(limit_frame*100)/100;
|
||||
$("#eva_adjust_postponement_normal_limit_frame").val(limit_frame);
|
||||
// $("#eva_adjust_postponement_normal_limit_quota").val(Math.round( Math.ceil(limit*limit_frame)/1000)*10 );
|
||||
$("#eva_adjust_postponement_normal_limit_quota").maskMoney('mask',Math.round( Math.ceil(limit*limit_frame)/1000)*10 );
|
||||
//$("#eva_adjust_postponement_normal_limit_quota").val(Math.ceil((limit*limit_frame/1000))*10);
|
||||
$("#eva_adjust_postponement_normal_limit_quota").maskMoney('mask',Math.ceil((limit*limit_frame/1000))*10);
|
||||
|
||||
}
|
||||
|
||||
@@ -148,7 +148,6 @@ function Oneva_adjust_postponement_normal_percentageChange(){
|
||||
|
||||
function Oneva_adjust_postponement_detail_normal_02_promoted_percentageChanged(){
|
||||
var current_quota = $("#eva_adjust_postponement_normal_limit_quota").val().replace(/[,-]/g,'');
|
||||
console.log("yy");
|
||||
var sum_postpone = 0;
|
||||
|
||||
$('#eva_adjust_postponement_detail_normal_02Body tr').each(function () {
|
||||
|
||||
@@ -4,6 +4,7 @@ var eva_adjust_postponement_quota_API = "/api/eva_adjust_postponement_quota/";
|
||||
//================= Form Data Customizaiton =========================================
|
||||
|
||||
function eva_adjust_postponement_quota_FeedDataToForm(data) {
|
||||
console.log(data.limit);
|
||||
$("#eva_adjust_postponement_quota_id").val(data.id);
|
||||
$("#eva_adjust_postponement_quota_fiscal_year").val(data.fiscal_year);
|
||||
$("#eva_adjust_postponement_quota_theDate").val(formatDate(data.theDate));
|
||||
@@ -133,13 +134,13 @@ function Oneva_adjust_postponement_quota_limit_frame_quotaChange() {
|
||||
//$("#eva_adjust_postponement_quota_limit").maskMoney('mask', limit);
|
||||
|
||||
limit_quota = limit_frame_quota * limit / 100;
|
||||
$("#eva_adjust_postponement_quota_limit_quota").val(limit_quota);
|
||||
//$("#eva_adjust_postponement_quota_limit_quota").maskMoney('mask', limit_quota);
|
||||
//$("#eva_adjust_postponement_quota_limit_quota").val(Math.ceil(limit_quota/10)*10);
|
||||
$("#eva_adjust_postponement_quota_limit_quota").maskMoney('mask', Math.ceil(limit_quota/10)*10);
|
||||
CalculateRemainQuota();
|
||||
}
|
||||
|
||||
function CalculateRemainQuota() {
|
||||
console.log("xx");
|
||||
//console.log("xx");
|
||||
var sum_receive_quota = 0;
|
||||
var limit_quota = parseFloat($("#eva_adjust_postponement_quota_limit_quota").val().replace(/[,-]/g,''));
|
||||
|
||||
@@ -170,8 +171,8 @@ console.log("xx");
|
||||
|
||||
var remain_quota = limit_quota - sum_receive_quota;
|
||||
|
||||
$("#remain_quota").val(remain_quota);
|
||||
//$("#remain_quota").maskMoney('mask', remain_quota);
|
||||
//$("#remain_quota").val(remain_quota);
|
||||
$("#remain_quota").maskMoney('mask', remain_quota);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ $("#eva_create_evaluation_detail_agreement_chief_fullname").text(data.chief_full
|
||||
$("#eva_create_evaluation_detail_agreement_chief_position").text(data.chief_position);
|
||||
$("#eva_create_evaluation_detail_agreement_create_evaluation_id").val(data.create_evaluation_id);
|
||||
|
||||
$("#remark_hrm_work_record").val(data.remark_hrm_work_record);
|
||||
$("#remark_hrm_work_record").text(data.remark_hrm_work_record);
|
||||
|
||||
status_self = data.status_self;
|
||||
CheckPermission();
|
||||
|
||||
@@ -50,7 +50,7 @@ DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_process_org_id
|
||||
$("#eva_create_evaluation_detail_process_search_employee_code").val(data.search_employee_code);
|
||||
$("#eva_create_evaluation_detail_process_search_employee_fullname").val(data.search_employee_fullname);
|
||||
|
||||
$("#remark_hrm_work_record").val(data.remark_hrm_work_record);
|
||||
$("#remark_hrm_work_record").text(data.remark_hrm_work_record);
|
||||
|
||||
searchVacation();
|
||||
|
||||
|
||||
@@ -28,6 +28,8 @@ var item_level_score;
|
||||
|
||||
function eva_create_evaluation_detail_process_FeedDataToForm(data) {
|
||||
|
||||
console.log(data);
|
||||
|
||||
$("#date_from").val(formatDate(data.start_date));
|
||||
$("#date_to").val(formatDate(data.end_date));
|
||||
|
||||
@@ -47,7 +49,7 @@ DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_process_org_id
|
||||
$("#eva_create_evaluation_detail_process_search_employee_code").val(data.search_employee_code);
|
||||
$("#eva_create_evaluation_detail_process_search_employee_fullname").val(data.search_employee_fullname);
|
||||
|
||||
$("#remark_hrm_work_record").val(data.remark_hrm_work_record);
|
||||
$("#remark_hrm_work_record").text(data.remark_hrm_work_record);
|
||||
|
||||
searchVacation();
|
||||
|
||||
@@ -99,7 +101,7 @@ function eva_create_evaluation_detail_process_SetEditForm(a) {
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
console.log(apisite + eva_create_evaluation_detail_process_API + a+"/d2");
|
||||
|
||||
AjaxGetRequest(apisite + eva_create_evaluation_detail_process_API + a+"/d2", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user