This commit is contained in:
LAPTOP-KB8JC2K2\acer
2021-09-01 16:32:23 +07:00
parent f1dad78f66
commit 095d8b1a60
6 changed files with 32 additions and 5 deletions

View File

@@ -200,6 +200,9 @@ namespace TodoAPI2.Models
startDate = fk_external_linkageResult2.packing_date, startDate = fk_external_linkageResult2.packing_date,
endDate = endDate, endDate = endDate,
salary_max = fk_external_linkageResult2.salary_max,
themax = fk_external_linkageResult2.themax,
isActive = m_eva_adjust_postponement_detail_normal_02.isActive, isActive = m_eva_adjust_postponement_detail_normal_02.isActive,
Created = m_eva_adjust_postponement_detail_normal_02.created, Created = m_eva_adjust_postponement_detail_normal_02.created,
Updated = m_eva_adjust_postponement_detail_normal_02.updated Updated = m_eva_adjust_postponement_detail_normal_02.updated

View File

@@ -60,5 +60,8 @@ namespace TodoAPI2.Models
public DateTime? startDate { get; set; } public DateTime? startDate { get; set; }
public DateTime? endDate { get; set; } public DateTime? endDate { get; set; }
public decimal? salary_max { get; set; }
public decimal? themax { get; set; }
} }
} }

View File

@@ -97,7 +97,7 @@ ELSE null END) as remark_hrm_work_record,
org_type_depart.department_degree_id, he.timerecorder_id, org_type_depart.department_degree_id, he.timerecorder_id,
(select count(*) from hrm_resigns where hrm_resigns.employee_id = he.employee_id) as count_resigns, (select count(*) from hrm_resigns where hrm_resigns.employee_id = he.employee_id) as count_resigns,
he.workingstatus he.workingstatus, cylinder.salary_max, cylinder.themax
from public.hrm_employees as he from public.hrm_employees as he
left join public.hrm_position_types as hpt on he.position_type_id=hpt.id left join public.hrm_position_types as hpt on he.position_type_id=hpt.id
@@ -110,6 +110,7 @@ left join public.hrm_employee_types as het on het.id = he.employee_type_id
left join public.users as u on u.employee_id = he.employee_id left join public.users as u on u.employee_id = he.employee_id
left join public.org_type_departments as org_type_depart on orgdata.department_type_id = org_type_depart.id left join public.org_type_departments as org_type_depart on orgdata.department_type_id = org_type_depart.id
left join public.org_type_department_colors as org_depart_color on org_type_depart.department_degree_id = org_depart_color.id left join public.org_type_department_colors as org_depart_color on org_type_depart.department_degree_id = org_depart_color.id
left join eva_salary_cylinder as cylinder on cylinder.position_type=he.position_type_id and cylinder.position_level=he.position_level_id
left join (select orgdata.id,orgdata2.id as id2, left join (select orgdata.id,orgdata2.id as id2,
case when orgdata2.department_name is not null then case when orgdata2.department_name is not null then
concat(orgdata2.department_name,' - ',orgdata.department_name) concat(orgdata2.department_name,' - ',orgdata.department_name)
@@ -245,6 +246,14 @@ order by sorting_dep.sort_order, hpt.position_type_id, hpl.position_level_id, em
i.count_resigns = 0; i.count_resigns = 0;
} }
i.workingstatus = dr["workingstatus"].ToString(); i.workingstatus = dr["workingstatus"].ToString();
if (dr["salary_max"] != DBNull.Value)
{
i.salary_max = Convert.ToDecimal(dr["salary_max"]);
}
if (dr["themax"] != DBNull.Value)
{
i.themax = Convert.ToDecimal(dr["themax"]);
}
result.Add(i); result.Add(i);
} }

View File

@@ -73,6 +73,9 @@ namespace TodoAPI2.Models
public string workingstatus { get; set; } public string workingstatus { get; set; }
public decimal? salary_max { get; set; }
public decimal? themax { get; set; }
public int? worked_month // ทำงานมาแล้วกี่เดือน public int? worked_month // ทำงานมาแล้วกี่เดือน
{ {
get get

View File

@@ -1,5 +1,5 @@
function eva_adjust_postponement_detail_normal_02_ClearForm(i, blankItem) { function eva_adjust_postponement_detail_normal_02_ClearForm(i, blankItem) {
var data = blankItem;
$("#eva_adjust_postponement_detail_normal_02_id_" + i).val(""); $("#eva_adjust_postponement_detail_normal_02_id_" + i).val("");
$("#eva_adjust_postponement_detail_normal_02_adjust_postponement_id_" + i).val(""); $("#eva_adjust_postponement_detail_normal_02_adjust_postponement_id_" + i).val("");
$("#eva_adjust_postponement_detail_normal_02_employee_id_" + i).val(""); $("#eva_adjust_postponement_detail_normal_02_employee_id_" + i).val("");
@@ -21,7 +21,8 @@
$("#eva_adjust_postponement_detail_normal_02_total_score_" + i).text(""); $("#eva_adjust_postponement_detail_normal_02_total_score_" + i).text("");
$("#eva_adjust_postponement_detail_normal_02_eva_result_" + i).text(""); $("#eva_adjust_postponement_detail_normal_02_eva_result_" + i).text("");
$("#eva_adjust_postponement_detail_normal_02_salary_max_" + i).text("");
$("#eva_adjust_postponement_detail_normal_02_themax_" + i).text("");
} }
function eva_adjust_postponement_detail_normal_02_FeedDataToForm(data, i, blankItem) { function eva_adjust_postponement_detail_normal_02_FeedDataToForm(data, i, blankItem) {
@@ -53,7 +54,8 @@ function eva_adjust_postponement_detail_normal_02_FeedDataToForm(data, i, blankI
$("#eva_adjust_postponement_detail_normal_02_total_score_" + i).text(data.total_score); $("#eva_adjust_postponement_detail_normal_02_total_score_" + i).text(data.total_score);
$("#eva_adjust_postponement_detail_normal_02_eva_result_" + i).text(data.eva_result); $("#eva_adjust_postponement_detail_normal_02_eva_result_" + i).text(data.eva_result);
$("#eva_adjust_postponement_detail_normal_02_salary_max_" + i).text(data.salary_max);
$("#eva_adjust_postponement_detail_normal_02_themax_" + i).text(data.themax);
} }
function eva_adjust_postponement_detail_normal_02_GetFromForm(obj, i) { function eva_adjust_postponement_detail_normal_02_GetFromForm(obj, i) {
@@ -135,7 +137,7 @@ function eva_adjust_postponement_detail_normal_02_Get(a, blankItem) {
tag += '<td><input disabled class="form-control" id="eva_adjust_postponement_detail_normal_02_total_promote_' + (i + 1) + '" /></td>'; tag += '<td><input disabled class="form-control" id="eva_adjust_postponement_detail_normal_02_total_promote_' + (i + 1) + '" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_new_sarary_' + (i + 1) + '" /></td>'; tag += '<td><p id="eva_adjust_postponement_detail_normal_02_new_sarary_' + (i + 1) + '" /></td>';
tag += '<td><input class="form-control" id="eva_adjust_postponement_detail_normal_02_new_cost_living_' + (i + 1) + '" /></td>'; tag += '<td><input class="form-control" id="eva_adjust_postponement_detail_normal_02_new_cost_living_' + (i + 1) + '" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_remark_' + (i + 1) + '" /></td>'; tag += '<td><p id="eva_adjust_postponement_detail_normal_02_remark_' + (i + 1) + '" /><p id="eva_adjust_postponement_detail_normal_02_salary_max_' + (i + 1) + '" /><p id="eva_adjust_postponement_detail_normal_02_themax_' + (i + 1) + '" /></td>';
tag += '</tr>'; tag += '</tr>';
if (data.position_allowance > 0) { if (data.position_allowance > 0) {

View File

@@ -159,11 +159,18 @@ function Oneva_adjust_postponement_detail_normal_02_promoted_percentageChanged(m
percentage = Math.round(percentage * 1000) / 1000; percentage = Math.round(percentage * 1000) / 1000;
$("#eva_adjust_postponement_detail_normal_02_promoted_percentage_" + i).val(percentage.toFixed(3)); $("#eva_adjust_postponement_detail_normal_02_promoted_percentage_" + i).val(percentage.toFixed(3));
var salary_max = parseFloat($(this).find("#eva_adjust_postponement_detail_normal_02_salary_max_" + i).text().replace(/[,-]/g, ''));
var themax = parseFloat($(this).find("#eva_adjust_postponement_detail_normal_02_themax_" + i).text().replace(/[,-]/g, ''));
var middle = parseFloat($(this).find("#eva_adjust_postponement_detail_normal_02_middle_" + i).text().replace(/[,-]/g, '')); var middle = parseFloat($(this).find("#eva_adjust_postponement_detail_normal_02_middle_" + i).text().replace(/[,-]/g, ''));
var old_salary = parseFloat($(this).find("#eva_adjust_postponement_detail_normal_02_sarary_" + i).text().replace(/[,-]/g, '')); var old_salary = parseFloat($(this).find("#eva_adjust_postponement_detail_normal_02_sarary_" + i).text().replace(/[,-]/g, ''));
var new_added = Math.ceil(((percentage * middle) / 100) / 10) * 10; var new_added = Math.ceil(((percentage * middle) / 100) / 10) * 10;
var new_salary = parseFloat(old_salary + new_added); var new_salary = parseFloat(old_salary + new_added);
if (new_salary > salary_max) {
alert("เงินเดือนเกินกรอบวงเงินขั้นสูงของพนักงานคือ " + formatNumber(themax) + " บาท แต่สามารถหยอดได้ถึง " + formatNumber(salary_max) + " บาท กรุณาหยอดร้อยละที่ได้เลื่อนอีกครั้งค่ะ");
}
var format_new_added = coreFormatPrice(new_added, 3); var format_new_added = coreFormatPrice(new_added, 3);
$("#eva_adjust_postponement_detail_normal_02_total_promote_" + i).val(format_new_added); $("#eva_adjust_postponement_detail_normal_02_total_promote_" + i).val(format_new_added);