รวม code ปรับปรุงตาม change request จากทีม

This commit is contained in:
Nakorn Rientrakrunchai
2020-04-26 13:27:10 +07:00
parent f353f73d17
commit 60dd022bea
29 changed files with 496 additions and 93 deletions

View File

@@ -95,5 +95,31 @@ namespace TodoAPI2.Controllers
return StatusCode(500, $"Exception while get specific item. {ex.Message}");
}
}
/// <summary>
/// GetLeaveOfEmployee
/// </summary>
/// <remarks>
/// </remarks>
/// <returns>Return list of items by specifced keyword</returns>
/// <response code="200">Returns the item</response>
/// <response code="500">Error Occurred</response>
[HttpGet("GetLeaveOfEmployee")]
[ProducesResponseType(typeof(List<employee_leaveViewModel>), 200)]
[ProducesResponseType(400)]
[ProducesResponseType(500)]
//[ValidateAntiForgeryToken]
public IActionResult GetLeaveOfEmployee(int employee_id, DateTime? start_date, DateTime? end_date)
{
try
{
return Ok(_repository.GetLeaveOfEmployee(employee_id, start_date, end_date));
}
catch (Exception ex)
{
_logger.LogCritical($"Exception while get list of items.", ex);
return StatusCode(500, $"Exception while get list of items. {ex.Message}");
}
}
}
}

View File

@@ -110,7 +110,7 @@ namespace TodoAPI2.Models
&& (m_eva_adjust_postponement_detail_normal_02.adjust_postponement_id == model.adjust_postponement_id || !model.adjust_postponement_id.HasValue)
&& fk_create_detailResult.employee_id == m_eva_adjust_postponement_detail_normal_02.employee_id
orderby m_eva_adjust_postponement_detail_normal_02.created descending
orderby fk_external_linkageResult2.department_name, fk_external_linkageResult2.fullname
select new eva_adjust_postponement_detail_normal_02ViewModel()
{
id = m_eva_adjust_postponement_detail_normal_02.id,
@@ -131,6 +131,8 @@ namespace TodoAPI2.Models
total_score = fk_create_detailResult.score_supervisor,
eva_result = fk_create_detailResult.level_score_supervisor,
emp_department_name = fk_external_linkageResult2.department_name,
adjust_postponement_id_eva_adjust_postponement_fiscal_year = fk_eva_adjust_postponementResult1.fiscal_year,
isActive = m_eva_adjust_postponement_detail_normal_02.isActive,

View File

@@ -48,5 +48,6 @@ namespace TodoAPI2.Models
public int? adjust_postponement_id_eva_adjust_postponement_fiscal_year { get; set; }
public string emp_department_name { get; set; }
}
}

View File

@@ -114,7 +114,7 @@ namespace TodoAPI2.Models
&& (m_eva_adjust_postponement_detail_quota_02.adjust_postponement_quota_id == model.adjust_postponement_quota_id || !model.adjust_postponement_quota_id.HasValue)
&& (fk_create_detailResult.employee_id == m_eva_adjust_postponement_detail_quota_02.employee_id || fk_create_detailResult == null)
orderby m_eva_adjust_postponement_detail_quota_02.created descending
orderby fk_external_linkageResult2.department_name, fk_external_linkageResult2.fullname
select new eva_adjust_postponement_detail_quota_02ViewModel()
{
id = m_eva_adjust_postponement_detail_quota_02.id,
@@ -134,6 +134,7 @@ namespace TodoAPI2.Models
emp_fullname = fk_external_linkageResult2.fullname,
emp_position = fk_external_linkageResult2.position_name,
emp_level = fk_external_linkageResult2.position_level_text,
emp_department_name = fk_external_linkageResult2.department_name,
total_score = fk_create_detailResult.score_supervisor,
eva_result = fk_create_detailResult.level_score_supervisor,

View File

@@ -52,5 +52,6 @@ namespace TodoAPI2.Models
public int? adjust_postponement_quota_id_eva_adjust_postponement_fiscal_year { get; set; }
public string emp_department_name { get; set; }
}
}

View File

@@ -41,5 +41,6 @@ namespace TodoAPI2.Models
public string org_id_external_linkage_external_name { get; set; }
public string create_evaluation_id_description { get; set; }
}
}

View File

@@ -86,7 +86,7 @@ namespace TodoAPI2.Models
employee_code = fk_external_employee.employee_no,
employee_fullname = fk_external_employee.fullname,
employee_position = fk_external_employee.position_name,
employee_position_type = fk_external_employee.employee_type_name,
employee_position_type = fk_external_employee.position_type_name,
employee_position_level = fk_external_employee.position_level_text,
employee_org = fk_external_employee.department_name,
chief_fullname = fk_external_chief.fullname,

View File

@@ -88,6 +88,7 @@ namespace TodoAPI2.Models
employee_position_type = fk_external_employee.position_type_name,
employee_position_level = fk_external_employee.position_level_text,
employee_org = fk_external_employee.department_name,
employee_id = m_eva_create_evaluation_detail_process.employee_id,
chief_fullname = fk_external_chief.fullname,
chief_position = fk_external_chief.position_name,
create_evaluation_id = m_eva_create_evaluation_detail_process.create_evaluation_id,
@@ -192,6 +193,7 @@ namespace TodoAPI2.Models
{
id = m_eva_create_evaluation_detail_process.id,
evaluation_round = fk_eva_create_evaluationResult10.eva_performance_plan.theTime.ToString(),
employee_id = m_eva_create_evaluation_detail_process.employee_id,
employee_code = fk_external_employee.employee_no,
employee_fullname = fk_external_employee.fullname,
employee_position = fk_external_employee.position_name,

View File

@@ -28,6 +28,8 @@ namespace TodoAPI2.Models
public string employee_org { get; set; }
public int? employee_id { get; set; }
public string chief_fullname { get; set; }
public string chief_position { get; set; }

View File

@@ -16,6 +16,8 @@ namespace TodoAPI2.Models
int? GetLeader(int? emp_id);
external_employeeViewModel GetEmployeeForLogin(int? user_id);
external_employeeWithSelectionViewModel GetBlankItem();
employee_leaveViewModel GetLeaveOfEmployee(int employee_id, DateTime? start_date, DateTime? end_date);
}
}

View File

@@ -83,7 +83,7 @@ left join public.{0}DepartmentData{0} as orgdata on orgdata.id = he.department_i
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
where he.workingstatus = 'สถานะปฏิบัติงาน' and he.deleted_at is null and mpn.deleted_at is null
and opd.deleted_at is null and htm.deleted_at is null
and opd.deleted_at is null --and htm.deleted_at is null
order by he.firstname,he.lastname;
", '"'.ToString());
var para = db.GetParameterListNpgsql();
@@ -161,7 +161,7 @@ left join public.org_position_datas as opd on opd.position_id = mpn.position_id
left join public.hrm_title_masters as htm on htm.id = he.prefix_card_name
left join public.users as u on u.employee_id = he.employee_id
where he.workingstatus = 'สถานะปฏิบัติงาน' and he.deleted_at is null and mpn.deleted_at is null
and opd.deleted_at is null and htm.deleted_at is null
and opd.deleted_at is null --and htm.deleted_at is null
and u.id=@user_id;
";
var para = db.GetParameterListNpgsql();
@@ -198,6 +198,196 @@ and u.id=@user_id;
}
}
public employee_leaveViewModel GetLeaveOfEmployee(int employee_id, DateTime? start_date, DateTime? end_date)
{
var sql = string.Format(@"
select {0}b{0}.{0}employee_id{0}, (
SELECT SUM(tad_general.total_dayoff) FROM tad_general_leaves as tad_general
LEFT JOIN tad_leave_types as leave_type ON tad_general.leave_type_id = CAST(leave_type.id as varchar)
WHERE tad_general.deleted_at is null
AND leave_type.deleted_at is null
AND leave_type.id = 2
AND tad_general.employee_id = b.employee_id
AND tad_general.status = '3'
AND tad_general.start_date >= @start_date
AND tad_general.end_date <= @end_date
) as sum_day_sick_leave, (
SELECT COUNT(tad_general.*) FROM tad_general_leaves as tad_general
LEFT JOIN tad_leave_types as leave_type ON tad_general.leave_type_id = CAST(leave_type.id as varchar)
WHERE tad_general.deleted_at is null
AND leave_type.deleted_at is null
AND leave_type.id = 2
AND tad_general.employee_id = b.employee_id
AND tad_general.status = '3'
AND tad_general.start_date >= @start_date
AND tad_general.end_date <= @end_date
) as count_sick_leave, (
SELECT SUM(tad_general.total_dayoff) FROM tad_general_leaves as tad_general
LEFT JOIN tad_leave_types as leave_type ON tad_general.leave_type_id = CAST(leave_type.id as varchar)
WHERE tad_general.deleted_at is null
AND leave_type.deleted_at is null
AND leave_type.id = 4
AND tad_general.employee_id = b.employee_id
AND tad_general.status = '3'
AND tad_general.start_date >= @start_date
AND tad_general.end_date <= @end_date
) as sum_day_personal_leave, (
SELECT COUNT(tad_general.*) FROM tad_general_leaves as tad_general
LEFT JOIN tad_leave_types as leave_type ON tad_general.leave_type_id = CAST(leave_type.id as varchar)
WHERE tad_general.deleted_at is null
AND leave_type.deleted_at is null
AND leave_type.id = 4
AND tad_general.employee_id = b.employee_id
AND tad_general.status = '3'
AND tad_general.start_date >= @start_date
AND tad_general.end_date <= @end_date
) as count_personal_leave, (
SELECT SUM(tad_general.total_dayoff) FROM tad_general_leaves as tad_general
LEFT JOIN tad_leave_types as leave_type ON tad_general.leave_type_id = CAST(leave_type.id as varchar)
WHERE tad_general.deleted_at is null
AND leave_type.deleted_at is null
AND leave_type.id = 1
AND tad_general.employee_id = b.employee_id
AND tad_general.status = '3'
AND tad_general.start_date >= @start_date
AND tad_general.end_date <= @end_date
) as sum_day_vacation_leave, (
SELECT COUNT(tad_general.*) FROM tad_general_leaves as tad_general
LEFT JOIN tad_leave_types as leave_type ON tad_general.leave_type_id = CAST(leave_type.id as varchar)
WHERE tad_general.deleted_at is null
AND leave_type.deleted_at is null
AND leave_type.id = 1
AND tad_general.employee_id = b.employee_id
AND tad_general.status = '3'
AND tad_general.start_date >= @start_date
AND tad_general.end_date <= @end_date
) as count_vacation_leave, (
SELECT COUNT(DISTINCT tad_stop.date) FROM tad_stop_workings as tad_stop
WHERE tad_stop.deleted_at is null
AND tad_stop.employee_id = b.employee_id
AND tad_stop.date BETWEEN @start_date AND @end_date
) as count_stop_working, (
SELECT COUNT(prs_time_result.id) FROM tad_processing_time_results as prs_time_result
LEFT JOIN tad_processing_times as prs_time ON prs_time_result.processing_time_id = prs_time.id
WHERE prs_time_result.deleted_at is null
AND prs_time.deleted_at is null
AND prs_time_result.employee_id = b.employee_id
AND prs_time_result.time_in is not null
AND prs_time_result.time_out is not null
AND prs_time_result.late is not null
AND prs_time_result.date BETWEEN @start_date AND @end_date
) as count_late_tad_processing_time_results, (
SELECT COUNT(prs_time_result.id) FROM tad_processing_time_results as prs_time_result
LEFT JOIN tad_processing_times as prs_time ON prs_time_result.processing_time_id = prs_time.id
WHERE prs_time_result.deleted_at is null
AND prs_time.deleted_at is null
AND prs_time_result.employee_id = b.employee_id
AND prs_time_result.time_in is null
AND prs_time_result.time_out is null
AND prs_time_result.record_type = 'Absence'
AND prs_time_result.date BETWEEN @start_date AND @end_date
) as count_absence_tad_processing_time_results, (
SELECT SUM(tad_general.total_dayoff) FROM tad_general_leaves as tad_general
LEFT JOIN tad_leave_types as leave_type ON tad_general.leave_type_id = CAST(leave_type.id as varchar)
WHERE tad_general.deleted_at is null
AND leave_type.deleted_at is null
AND leave_type.id in (2,4)
AND tad_general.employee_id = b.employee_id
AND tad_general.status = '3'
AND tad_general.start_date >= @start_date
AND tad_general.end_date <= @end_date
) as sum_day_sick_personal_leave, (
SELECT COUNT(tad_general.*) FROM tad_general_leaves as tad_general
LEFT JOIN tad_leave_types as leave_type ON tad_general.leave_type_id = CAST(leave_type.id as varchar)
WHERE tad_general.deleted_at is null
AND leave_type.deleted_at is null
AND leave_type.id in (2,4)
AND tad_general.employee_id = b.employee_id
AND tad_general.status = '3'
AND tad_general.start_date >= @start_date
AND tad_general.end_date <= @end_date
) as count_sick_personal_leave from {0}tad_table_workings{0} as {0}a{0} left join {0}hrm_employees{0} as {0}b{0} on {0}a{0}.{0}employee_id{0} = {0}b{0}.{0}employee_id{0} left join {0}tad_workshifts{0} as {0}c{0} on {0}a{0}.{0}workshift_id{0} = {0}c{0}.{0}id{0} where {0}a{0}.{0}deleted_at{0} is null and {0}b{0}.{0}deleted_at{0} is null and {0}c{0}.{0}deleted_at{0} is null and {0}b{0}.{0}employee_id{0} = @employee_id
", '"'.ToString());
var para = db.GetParameterListNpgsql();
var p_employee_id = new NpgsqlParameter("employee_id", DbType.Int32);
p_employee_id.Value = employee_id;
para.Add(p_employee_id);
var p_start_date = new NpgsqlParameter("start_date", DbType.Date);
p_start_date.Value = start_date;
para.Add(p_start_date);
var p_end_date = new NpgsqlParameter("end_date", DbType.Date);
p_end_date.Value = end_date;
para.Add(p_end_date);
DataTable dt = db.ExecuteDataTableNpgsql(sql, para);
var dr = dt.Rows[0];
var i = new employee_leaveViewModel();
i.sum_day_sick_leave = 0;
i.count_sick_leave = 0;
i.sum_day_personal_leave = 0;
i.count_personal_leave = 0;
i.sum_day_vacation_leave = 0;
i.count_vacation_leave = 0;
i.count_stop_working = 0;
i.count_late_tad_processing_time_results = 0;
i.count_absence_tad_processing_time_results = 0;
i.sum_day_sick_personal_leave = 0;
i.count_sick_personal_leave = 0;
if (dr["sum_day_sick_leave"] != DBNull.Value)
{
i.sum_day_sick_leave = Convert.ToInt32(dr["sum_day_sick_leave"]);
}
if (dr["count_sick_leave"] != DBNull.Value)
{
i.count_sick_leave = Convert.ToInt32(dr["count_sick_leave"]);
}
if (dr["sum_day_personal_leave"] != DBNull.Value)
{
i.sum_day_personal_leave = Convert.ToInt32(dr["sum_day_personal_leave"]);
}
if (dr["count_personal_leave"] != DBNull.Value)
{
i.count_personal_leave = Convert.ToInt32(dr["count_personal_leave"]);
}
if (dr["sum_day_vacation_leave"] != DBNull.Value)
{
i.sum_day_vacation_leave = Convert.ToInt32(dr["sum_day_vacation_leave"]);
}
if (dr["count_vacation_leave"] != DBNull.Value)
{
i.count_vacation_leave = Convert.ToInt32(dr["count_vacation_leave"]);
}
if (dr["count_stop_working"] != DBNull.Value)
{
i.count_stop_working = Convert.ToInt32(dr["count_stop_working"]);
}
if (dr["count_late_tad_processing_time_results"] != DBNull.Value)
{
i.count_late_tad_processing_time_results = Convert.ToInt32(dr["count_late_tad_processing_time_results"]);
}
if (dr["count_absence_tad_processing_time_results"] != DBNull.Value)
{
i.count_absence_tad_processing_time_results = Convert.ToInt32(dr["count_absence_tad_processing_time_results"]);
}
if (dr["sum_day_sick_personal_leave"] != DBNull.Value)
{
i.sum_day_sick_personal_leave = Convert.ToInt32(dr["sum_day_sick_personal_leave"]);
}
if (dr["count_sick_personal_leave"] != DBNull.Value)
{
i.count_sick_personal_leave = Convert.ToInt32(dr["count_sick_personal_leave"]);
}
return i;
}
public external_employeeWithSelectionViewModel GetBlankItem()
{
var i = new external_employeeWithSelectionViewModel();

View File

@@ -11,6 +11,20 @@ using TTSW.Common;
namespace TodoAPI2.Models
{
public class employee_leaveViewModel
{
public int? sum_day_sick_leave { get; set; }
public int? count_sick_leave { get; set; }
public int? sum_day_personal_leave { get; set; }
public int? count_personal_leave { get; set; }
public int? sum_day_vacation_leave { get; set; }
public int? count_vacation_leave { get; set; }
public int? count_stop_working { get; set; }
public int? count_late_tad_processing_time_results { get; set; }
public int? count_absence_tad_processing_time_results { get; set; }
public int? sum_day_sick_personal_leave { get; set; }
public int? count_sick_personal_leave { get; set; }
}
public class external_employeeViewModel
{
public int id { get; set; }

View File

@@ -73,10 +73,6 @@
</div>
<div class="right-zone">
<div style="display: flex;">
<input type="text" class="form-control search" style="border:none" placeholder="Search">
</div>
<div style="display: flex; padding-top:6px;">
<span class="allfontsize" data-fontsize="1" style="font-size:18px; width:20px; height:30px; display:flex; align-items:center; justify-content:center;">A</span>
<span class="allfontsize" data-fontsize="2" style="font-size:22px; width:20px; height:30px; display:flex; align-items:center; justify-content:center;">A</span>

View File

@@ -65,22 +65,12 @@
</div>
<div class="right-zone">
<div style="display: flex;">
<input type="text" class="form-control search" style="border:none" placeholder="Search">
</div>
<div style="display: flex; padding-top:6px;">
<span class="allfontsize" data-fontsize="1" style="font-size:18px; width:20px; height:30px; display:flex; align-items:center; justify-content:center;">A</span>
<span class="allfontsize" data-fontsize="2" style="font-size:22px; width:20px; height:30px; display:flex; align-items:center; justify-content:center;">A</span>
<span class="allfontsize" data-fontsize="3" style="font-size:26px; width:20px; height:30px; display:flex; align-items:center; justify-content:center; font-weight:bold;">A</span>
</div>
<div style="display: flex; cursor: pointer; position: relative;" id="toggle-chat-list">
<a href="@Environment.GetEnvironmentVariable("SiteInformation_chatsite")" style="color: unset; display: flex">
<i class="fa fa-comments" style="font-size: 18px;"></i>
<div id="chat-noti" class="badge badge-danger" style="display: none;"></div>
</a>
</div>
<div>
<div data-toggle="dropdown" style="display: flex; cursor: pointer; align-items: center;">

View File

@@ -29,6 +29,7 @@
<div class="row">
<div class="col-md-12">
<input class="form-control" type="hidden" id="eva_create_evaluation_detail_process_id" />
<input class="form-control" type="hidden" id="eva_create_evaluation_detail_process_employee_id" />
<input class="form-control" type="hidden" id="eva_create_evaluation_detail_process_create_evaluation_id" />
<div class='row'>
@@ -104,16 +105,16 @@
ข้อมูลการลา ณ วันที่
</div>
<div class="col-md-3">
<input type="text" class="form-control" />
<input class="form-control" type="text" id="date_from" data-provide="datepicker" data-date-language="th-th" iLabel="วันที่เริ่ม" />
</div>
<div class="col-md-1">
ถึง
</div>
<div class="col-md-3">
<input type="text" class="form-control" />
<input class="form-control" type="text" id="date_to" data-provide="datepicker" data-date-language="th-th" iLabel="วันที่สิ้นสุด" />
</div>
<div class="col-md-2">
<button type="button" class="btn btn-outline" onclick="javascript:alert('กำลังจัดทำ')" style="background-color: #fff;">ค้นหา</button>
<button type="button" class="btn btn-outline" onclick="javascript:searchVacation();" style="background-color: #fff;">ค้นหา</button>
</div>
</div>
<div class="row">
@@ -139,16 +140,16 @@
<td>ครั้ง</td>
</tr>
<tr>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td><p id="sum_day_sick_leave"></p></td> @*ลาป่วย วัน*@
<td><p id="count_sick_leave"></p></td> @*ลาป่วย ครั้ง*@
<td><p id="sum_day_personal_leave"></p></td> @*ลากิจ วัน*@
<td><p id="count_personal_leave"></p></td> @*ลากิจ ครั้ง*@
<td><p id="sum_day_vacation_leave"></p></td> @*ลาพักผ่อน*@
<td><p id="count_stop_working"></p></td> @*ขอกลับก่อนเวลา*@
<td><p id="count_late_tad_processing_time_results"></p></td> @*สาย*@
<td><p id="count_absence_tad_processing_time_results"></p></td> @*ขาด*@
<td><p id="sum_day_sick_personal_leave"></p></td> @*รวม (ป่วย/กิจ) วัน*@
<td><p id="count_sick_personal_leave"></p></td> @*รวม (ป่วย/กิจ) ครั้ง*@
</tr>
</table>
</div>
@@ -400,6 +401,55 @@
SetupValidationRemark("eva_create_evaluation_detail_process");
SetupValidationRemark("eva_create_evaluation_detail_review01");
});
function searchVacation_GetFromForm() {
var searchVacationObject = new Object();
searchVacationObject.start_date = formatDateForGetParameter(getDate($("#date_from").val()));
searchVacationObject.end_date = formatDateForGetParameter(getDate($("#date_to").val()));
searchVacationObject.employee_id = $("#eva_create_evaluation_detail_process_employee_id").val();
console.log(searchVacationObject);
return searchVacationObject;
}
function searchVacation() {
if($("#date_from").val() === "") {
alert("กรุณาระบุ วันเริ่มต้น");
return;
}
if($("#date_to").val() === "") {
alert("กรุณาระบุ วันสิ้นสุด");
return;
}
var employee_API = "/api/external_employee/";
var successFunc = function (result) {
searchVacation_FeedDataToForm(result);
endLoad();
};
var p = $.param(searchVacation_GetFromForm());
startLoad();
AjaxGetRequest(apisite + employee_API + "GetLeaveOfEmployee?"+p, successFunc, AlertDanger);
}
function searchVacation_FeedDataToForm(data) {
$("#sum_day_sick_leave").text(data.sum_day_sick_leave);
$("#count_sick_leave").text(data.count_sick_leave);
$("#sum_day_personal_leave").text(data.sum_day_personal_leave);
$("#count_personal_leave").text(data.count_personal_leave);
$("#sum_day_vacation_leave").text(data.sum_day_vacation_leave);
$("#count_stop_working").text(data.count_stop_working);
$("#count_late_tad_processing_time_results").text(data.count_late_tad_processing_time_results);
$("#count_absence_tad_processing_time_results").text(data.count_absence_tad_processing_time_results);
$("#sum_day_sick_personal_leave").text(data.sum_day_sick_personal_leave);
$("#count_sick_personal_leave").text(data.count_sick_personal_leave);
}
</script>
}

View File

@@ -79,6 +79,7 @@
<div class="row">
<div class="col-md-12">
<input class="form-control" type="hidden" id="eva_create_evaluation_detail_process_id" />
<input class="form-control" type="hidden" id="eva_create_evaluation_detail_process_employee_id" />
<input class="form-control" type="hidden" id="eva_create_evaluation_detail_process_create_evaluation_id" />
<div class='row'>
@@ -108,7 +109,7 @@
<label id="lab_eva_create_evaluation_detail_process_employee_position" for="eva_create_evaluation_detail_process_employee_position">ตำแหน่ง</label>
<p class="form-control" id="eva_create_evaluation_detail_process_employee_position" />
</div>
<div class="form-group col-md-4">
<label id="lab_eva_create_evaluation_detail_process_employee_position_level" for="eva_create_evaluation_detail_process_employee_position_level">ระดับตำแหน่ง</label>
@@ -155,16 +156,16 @@
ข้อมูลการลา ณ วันที่
</div>
<div class="col-md-3">
<input type="text" class="form-control" />
<input class="form-control" type="text" id="date_from" data-provide="datepicker" data-date-language="th-th" iLabel="วันที่เริ่ม" />
</div>
<div class="col-md-1">
ถึง
</div>
<div class="col-md-3">
<input type="text" class="form-control" />
<input class="form-control" type="text" id="date_to" data-provide="datepicker" data-date-language="th-th" iLabel="วันที่สิ้นสุด" />
</div>
<div class="col-md-2">
<button type="button" class="btn btn-outline" onclick="javascript:alert('กำลังจัดทำ')" style="background-color: #fff;">ค้นหา</button>
<button type="button" class="btn btn-outline" onclick="javascript:searchVacation();" style="background-color: #fff;">ค้นหา</button>
</div>
</div>
@@ -192,16 +193,16 @@
<td>ครั้ง</td>
</tr>
<tr>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td><p id="sum_day_sick_leave"></p></td> @*ลาป่วย วัน*@
<td><p id="count_sick_leave"></p></td> @*ลาป่วย ครั้ง*@
<td><p id="sum_day_personal_leave"></p></td> @*ลากิจ วัน*@
<td><p id="count_personal_leave"></p></td> @*ลากิจ ครั้ง*@
<td><p id="sum_day_vacation_leave"></p></td> @*ลาพักผ่อน*@
<td><p id="count_stop_working"></p></td> @*ขอกลับก่อนเวลา*@
<td><p id="count_late_tad_processing_time_results"></p></td> @*สาย*@
<td><p id="count_absence_tad_processing_time_results"></p></td> @*ขาด*@
<td><p id="sum_day_sick_personal_leave"></p></td> @*รวม (ป่วย/กิจ) วัน*@
<td><p id="count_sick_personal_leave"></p></td> @*รวม (ป่วย/กิจ) ครั้ง*@
</tr>
</table>
</div>
@@ -675,6 +676,53 @@
}
}
function searchVacation_GetFromForm() {
var searchVacationObject = new Object();
searchVacationObject.start_date = formatDateForGetParameter(getDate($("#date_from").val()));
searchVacationObject.end_date = formatDateForGetParameter(getDate($("#date_to").val()));
searchVacationObject.employee_id = $("#eva_create_evaluation_detail_process_employee_id").val();
console.log(searchVacationObject);
return searchVacationObject;
}
function searchVacation() {
if($("#date_from").val() === "") {
alert("กรุณาระบุ วันเริ่มต้น");
return;
}
if($("#date_to").val() === "") {
alert("กรุณาระบุ วันสิ้นสุด");
return;
}
var employee_API = "/api/external_employee/";
var successFunc = function (result) {
searchVacation_FeedDataToForm(result);
endLoad();
};
var p = $.param(searchVacation_GetFromForm());
startLoad();
AjaxGetRequest(apisite + employee_API + "GetLeaveOfEmployee?"+p, successFunc, AlertDanger);
}
function searchVacation_FeedDataToForm(data) {
$("#sum_day_sick_leave").text(data.sum_day_sick_leave);
$("#count_sick_leave").text(data.count_sick_leave);
$("#sum_day_personal_leave").text(data.sum_day_personal_leave);
$("#count_personal_leave").text(data.count_personal_leave);
$("#sum_day_vacation_leave").text(data.sum_day_vacation_leave);
$("#count_stop_working").text(data.count_stop_working);
$("#count_late_tad_processing_time_results").text(data.count_late_tad_processing_time_results);
$("#count_absence_tad_processing_time_results").text(data.count_absence_tad_processing_time_results);
$("#sum_day_sick_personal_leave").text(data.sum_day_sick_personal_leave);
$("#count_sick_personal_leave").text(data.count_sick_personal_leave);
}
</script>
}

View File

@@ -28,12 +28,12 @@
<div class="form-group col-md-3">
<label id='lab_s_rep_leave_total_employee_id' for='s_rep_leave_total_employee_id'>ชื่อ - สกุล</label>
<select class="form-control" id="s_rep_leave_total_employee_id" iLabel="ชื่อ - สกุล" iRequire="true" iGroup="s_rep_leave_total" title='ชื่อ - สกุล' placeholder='ชื่อ - สกุล'></select>
<select class="form-control" id="s_rep_leave_total_employee_id" iLabel="ชื่อ - สกุล" iRequire="false" iGroup="s_rep_leave_total" title='ชื่อ - สกุล' placeholder='ชื่อ - สกุล'></select>
</div>
<div class="form-group col-md-3">
<label id='lab_s_rep_leave_total_org_id' for='s_rep_leave_total_org_id'>หน่วยงาน</label>
<select class="form-control" id="s_rep_leave_total_org_id" iLabel="หน่วยงาน" iRequire="true" iGroup="s_rep_leave_total" title='หน่วยงาน' placeholder='หน่วยงาน'></select>
<select class="form-control" id="s_rep_leave_total_org_id" iLabel="หน่วยงาน" iRequire="false" iGroup="s_rep_leave_total" title='หน่วยงาน' placeholder='หน่วยงาน'></select>
</div>
<div class="form-group col-md-3">

View File

@@ -3461,6 +3461,16 @@
<response code="200">Returns the item</response>
<response code="500">Error Occurred</response>
</member>
<member name="M:TodoAPI2.Controllers.external_employeeController.GetLeaveOfEmployee(System.Int32,System.Nullable{System.DateTime},System.Nullable{System.DateTime})">
<summary>
GetLeaveOfEmployee
</summary>
<remarks>
</remarks>
<returns>Return list of items by specifced keyword</returns>
<response code="200">Returns the item</response>
<response code="500">Error Occurred</response>
</member>
<member name="M:TodoAPI2.Controllers.external_linkageController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.external_linkageController},TodoAPI2.Models.Iexternal_linkageService)">
<summary>
Default constructure for dependency injection

View File

@@ -95,7 +95,7 @@ a:hover {
}
.form-control {
color: #777 !important;
color: #000000 !important;
font-size: .8rem;
}
@@ -118,7 +118,7 @@ a:hover {
.form-control {
box-shadow: none;
color: #c2c2c2;
color: #000000;
}

View File

@@ -184,7 +184,7 @@ div.auth-wrapper .alert {
}
.title-login {
color: #67757c;
color: #000000;
font-size: 19px;
line-height: 26px;
margin: 26px 0 8px;
@@ -202,7 +202,7 @@ div.auth-wrapper .alert {
}
.font-remember {
color: #67757c;
color: #000000;
font-size: 19px;
line-height: 26px;
margin-left: 8px;
@@ -266,7 +266,7 @@ div.auth-wrapper .alert {
#sidebar-right .chat-list .chat-item .name {
margin-left: 17px;
color: #67757c;
color: #000000;
font-weight: 700;
font-size: 19px;
text-overflow: ellipsis;
@@ -401,7 +401,7 @@ div.auth-wrapper .alert {
padding: 9px 0;
display: -webkit-box;
display: flex;
color: #67757c;
color: #000000;
font-size: 19px;
line-height: 1
}
@@ -850,7 +850,7 @@ img.custom-avatar {
}
.breadcrumb-item.active {
color: #a2b8bf
color: #000000
}
@media (max-width:768px) {
@@ -862,7 +862,7 @@ img.custom-avatar {
}
label {
color: #67757c;
color: #000000;
font-weight: 700;
font-size: 19px;
margin: 0
@@ -981,12 +981,12 @@ input.is-invalid:focus {
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
border-color: #67757c transparent transparent;
border-color: #000000 transparent transparent;
border-width: 5px 5px 0
}
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
border-color: transparent transparent #67757c;
border-color: transparent transparent #000000;
border-width: 0 5px 5px
}
@@ -1131,7 +1131,7 @@ input.form-control[readonly]~.display-date.form-control {
.file-list>div:nth-child(2) {
font-size: 19px;
font-weight: 700;
color: #67757c
color: #000000
}
.modal {

View File

@@ -9,7 +9,7 @@ Website: http://thevectorlab.net/
@import url("//fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic,800,800italic");
body {
color: #797979;
color: #000000;
background: #f1f2f7;
font-family: "Open Sans", sans-serif;
padding: 0px !important;
@@ -1511,7 +1511,7 @@ h3.timeline-title {
padding: 14px 15px;
text-align: center;
border-right: 1px solid #d5d8df;
color: #797979;
color: #000000;
}
.card-footer.revenue-foot ul li a:hover,
@@ -1970,7 +1970,7 @@ ul.ft-link li a i {
}
.fontawesome-icon-list a {
color: #797979;
color: #000000;
}
.fontawesome-icon-list a:hover {
@@ -2004,7 +2004,7 @@ ul.ft-link li a i {
}
.menu-list a {
color: #797979;
color: #000000;
}
.menu-list a:hover {
@@ -2378,7 +2378,7 @@ ul.inbox-pagination li {
.sender-dropdown {
background: #eaeaea;
padding: 0 3px;
color: #777;
color: #000000;
font-size: 10px;
}
@@ -2967,14 +2967,14 @@ ul.amounts li {
}
.dataTables_paginate.paging_bootstrap.pagination li a {
color: #797979;
color: #000000;
padding: 5px 10px;
display: inline-block;
}
.dataTables_paginate.paging_bootstrap.pagination li:hover a,
.dataTables_paginate.paging_bootstrap.pagination li.active a {
color: #797979;
color: #000000;
background: #eee;
border-radius: 3px;
-webkit-border-radius: 3px;
@@ -3115,7 +3115,7 @@ ul.amounts li {
.tab-head .nav-tabs>li.active>a:focus {
background-color: #f1f2f7;
border-color: #f1f2f7;
color: #797979;
color: #000000;
}
/*general page*/
@@ -5239,7 +5239,7 @@ tr.odd.gradeU td.sorting_1 {
.pricing-head h2 {
padding: 30px 0;
background: #777777;
background: #000000777;
color: #fff;
font-size: 50px;
font-weight: 100;
@@ -5329,7 +5329,7 @@ tr.odd.gradeU td.sorting_1 {
margin-bottom: 5px;
border-radius: 4px;
-webkit-border-radius: 4px;
color: #797979;
color: #000000;
-webkit-transition: all 0.3s ease;
-moz-transition: all 0.3s ease;
-o-transition: all 0.3s ease;
@@ -6300,7 +6300,7 @@ a.guest-on i {
display: inline-block;
border: 1px solid #ddd;
padding: 3px 10px;
color: #797979;
color: #000000;
border-radius: 4px;
font-size: 12px;
}

View File

@@ -1,4 +1,9 @@

function formatNumber(num) {
if(num === "" || num === null) return "";
return num.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,')
}
function getUrlParameter(sParam) {
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
sURLVariables = sPageURL.split('&'),

View File

@@ -24,13 +24,13 @@ function eva_adjust_postponement_detail_normal_02_FeedDataToForm(data, i, blankI
$("#eva_adjust_postponement_detail_normal_02_id_" + i).val(data.id);
$("#eva_adjust_postponement_detail_normal_02_adjust_postponement_id_" + i).val(data.adjust_postponement_id);
$("#eva_adjust_postponement_detail_normal_02_employee_id_" + i).val(data.employee_id);
$("#eva_adjust_postponement_detail_normal_02_sarary_" + i).text(data.sarary);
$("#eva_adjust_postponement_detail_normal_02_cost_living_" + i).text(data.cost_living);
$("#eva_adjust_postponement_detail_normal_02_middle_" + i).text(data.middle);
$("#eva_adjust_postponement_detail_normal_02_sarary_" + i).text(formatNumber(data.sarary));
$("#eva_adjust_postponement_detail_normal_02_cost_living_" + i).text(formatNumber(data.cost_living));
$("#eva_adjust_postponement_detail_normal_02_middle_" + i).text(formatNumber(data.middle));
$("#eva_adjust_postponement_detail_normal_02_promoted_percentage_" + i).val(data.promoted_percentage);
$("#eva_adjust_postponement_detail_normal_02_total_promote_" + i).val(data.total_promote);
$("#eva_adjust_postponement_detail_normal_02_new_sarary_" + i).text(data.new_sarary);
$("#eva_adjust_postponement_detail_normal_02_new_cost_living_" + i).text(data.new_cost_living);
$("#eva_adjust_postponement_detail_normal_02_new_sarary_" + i).text(formatNumber(data.new_sarary));
$("#eva_adjust_postponement_detail_normal_02_new_cost_living_" + i).text(formatNumber(data.new_cost_living));
$("#eva_adjust_postponement_detail_normal_02_remark_" + i).text(data.remark);
$("#eva_adjust_postponement_detail_normal_02_emp_code_" + i).text(data.emp_code);
$("#eva_adjust_postponement_detail_normal_02_emp_fullname_" + i).text(data.emp_fullname);
@@ -69,9 +69,12 @@ function eva_adjust_postponement_detail_normal_02_Save(id) {
//Insert eva_adjust_postponement_detail_normal_02 List
var eva_adjust_postponement_detail_normal_02 = [];
$('#eva_adjust_postponement_detail_normal_02Body tr').each(function () {
var i = $(this).find("#rowCount").text();
var eacheva_adjust_postponement_detail_normal_02 = eva_adjust_postponement_detail_normal_02_GetFromForm($(this), i);
eva_adjust_postponement_detail_normal_02.push(eacheva_adjust_postponement_detail_normal_02);
var i = $(this).find("#rowCount").text();
if(i){
//console.log(i);
var eacheva_adjust_postponement_detail_normal_02 = eva_adjust_postponement_detail_normal_02_GetFromForm($(this), i);
eva_adjust_postponement_detail_normal_02.push(eacheva_adjust_postponement_detail_normal_02);
}
});
//console.log(eva_adjust_postponement_detail_normal_02);
var successFunc = function (result) {
@@ -88,8 +91,19 @@ function eva_adjust_postponement_detail_normal_02_Get(a, blankItem) {
var successFunc = function (response) {
//console.log(response);
var cur_dep = "";
$.each(response, function (i, data) {
var tag = '<tr>';
var tag = "";
if(cur_dep !== data.emp_department_name){
cur_dep = data.emp_department_name;
tag = "<tr><td colspan='15'><span>"+cur_dep+"</span></td></tr>";
}
tag += '<tr>';
tag += '<td><label id="rowCount">' + (i + 1) + '</label><input type="hidden" id="isActive_' + (i + 1) + '_eva_adjust_postponement_detail_normal_02" value="1" /><input class="form-control" type="hidden" id="eva_adjust_postponement_detail_normal_02_id_' + (i + 1)+'" /><input class="form-control" type="hidden" id="eva_adjust_postponement_detail_normal_02_adjust_postponement_id_' + (i + 1)+'" /><input class="form-control" type="hidden" id="eva_adjust_postponement_detail_normal_02_employee_id_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_emp_code_' + (i + 1)+'" /></td>';

View File

@@ -26,16 +26,16 @@ function eva_adjust_postponement_detail_quota_02_FeedDataToForm(data, i, blankIt
$("#eva_adjust_postponement_detail_quota_02_id_" + i).val(data.id);
$("#eva_adjust_postponement_detail_quota_02_adjust_postponement_quota_id_" + i).val(data.adjust_postponement_quota_id);
$("#eva_adjust_postponement_detail_quota_02_employee_id_" + i).val(data.employee_id);
$("#eva_adjust_postponement_detail_quota_02_sarary_" + i).text(data.sarary);
$("#eva_adjust_postponement_detail_quota_02_cost_living_" + i).text(data.cost_living);
$("#eva_adjust_postponement_detail_quota_02_middle_" + i).text(data.middle);
$("#eva_adjust_postponement_detail_quota_02_promoted_percentage_" + i).text(data.promoted_percentage);
$("#eva_adjust_postponement_detail_quota_02_total_promote_" + i).text(data.total_promote);
$("#eva_adjust_postponement_detail_quota_02_new_sarary_" + i).text(data.new_sarary);
$("#eva_adjust_postponement_detail_quota_02_new_cost_living_" + i).text(data.new_cost_living);
$("#eva_adjust_postponement_detail_quota_02_sarary_" + i).text(formatNumber(data.sarary));
$("#eva_adjust_postponement_detail_quota_02_cost_living_" + i).text(formatNumber(data.cost_living));
$("#eva_adjust_postponement_detail_quota_02_middle_" + i).text(formatNumber(data.middle));
$("#eva_adjust_postponement_detail_quota_02_promoted_percentage_" + i).text(formatNumber(data.promoted_percentage));
$("#eva_adjust_postponement_detail_quota_02_total_promote_" + i).text(formatNumber(data.total_promote));
$("#eva_adjust_postponement_detail_quota_02_new_sarary_" + i).text(formatNumber(data.new_sarary));
$("#eva_adjust_postponement_detail_quota_02_new_cost_living_" + i).text(formatNumber(data.new_cost_living));
$("#eva_adjust_postponement_detail_quota_02_remark_" + i).text(data.remark);
$("#eva_adjust_postponement_detail_quota_02_receive_quota_" + i).val(data.receive_quota);
$("#eva_adjust_postponement_detail_quota_02_new_sarary_with_quota_" + i).text(data.new_sarary_with_quota);
$("#eva_adjust_postponement_detail_quota_02_new_sarary_with_quota_" + i).text(formatNumber(data.new_sarary_with_quota));
$("#eva_adjust_postponement_detail_quota_02_emp_code_" + i).text(data.emp_code);
$("#eva_adjust_postponement_detail_quota_02_emp_fullname_" + i).text(data.emp_fullname);
$("#eva_adjust_postponement_detail_quota_02_emp_position_" + i).text(data.emp_position);
@@ -76,8 +76,11 @@ function eva_adjust_postponement_detail_quota_02_Save(id) {
var eva_adjust_postponement_detail_quota_02 = [];
$('#eva_adjust_postponement_detail_quota_02Body tr').each(function () {
var i = $(this).find("#rowCount").text();
var eacheva_adjust_postponement_detail_quota_02 = eva_adjust_postponement_detail_quota_02_GetFromForm($(this), i);
if(i){
var eacheva_adjust_postponement_detail_quota_02 = eva_adjust_postponement_detail_quota_02_GetFromForm($(this), i);
eva_adjust_postponement_detail_quota_02.push(eacheva_adjust_postponement_detail_quota_02);
}
});
var successFunc = function (result) {
@@ -92,9 +95,16 @@ function eva_adjust_postponement_detail_quota_02_Get(a, blankItem) {
$('#eva_adjust_postponement_detail_quota_02Body').empty();
var cur_dep = "";
var successFunc = function (response) {
$.each(response, function (i, data) {
var tag = '<tr>';
var tag = "";
if(cur_dep !== data.emp_department_name){
tag += '<tr><td colspan="16">'+data.emp_department_name+'</td></tr>';
}
tag += '<tr>';
tag += '<td><label id="rowCount">' + (i + 1) + '</label><input type="hidden" id="isActive_' + (i + 1) + '_eva_adjust_postponement_detail_quota_02" value="1" /><input class="form-control" type="hidden" id="eva_adjust_postponement_detail_quota_02_id_' + (i + 1)+'" /><input class="form-control" type="hidden" id="eva_adjust_postponement_detail_quota_02_adjust_postponement_quota_id_' + (i + 1)+'" /><input class="form-control" type="hidden" id="eva_adjust_postponement_detail_quota_02_employee_id_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_emp_code_' + (i + 1)+'" /></td>';

View File

@@ -159,10 +159,10 @@ function Oneva_adjust_postponement_detail_normal_02_promoted_percentageChanged()
var new_salary = parseFloat(old_salary + new_added);
$("#eva_adjust_postponement_detail_normal_02_total_promote_" + i).val(new_added);
$("#eva_adjust_postponement_detail_normal_02_new_sarary_" + i).text(new_salary);
$("#eva_adjust_postponement_detail_normal_02_new_sarary_" + i).text(formatNumber(new_salary));
if(new_salary < 13285){
$("#eva_adjust_postponement_detail_normal_02_new_cost_living_" + i).text(1000);
$("#eva_adjust_postponement_detail_normal_02_new_cost_living_" + i).text(formatNumber(1000));
}else{
$("#eva_adjust_postponement_detail_normal_02_new_cost_living_" + i).text(0);
}

View File

@@ -149,10 +149,10 @@ function CalculateRemainQuota(){
$("#eva_adjust_postponement_detail_quota_02_receive_quota_" + i).val(receive_quota);
var new_sarary_with_quota = new_sarary + receive_quota;
$("#eva_adjust_postponement_detail_quota_02_new_sarary_with_quota_" + i).text(new_sarary_with_quota);
$("#eva_adjust_postponement_detail_quota_02_new_sarary_with_quota_" + i).text(formatNumber(new_sarary_with_quota));
if(new_sarary_with_quota < 13285){
$("#eva_adjust_postponement_detail_quota_02_new_cost_living_" + i).text(1000);
$("#eva_adjust_postponement_detail_quota_02_new_cost_living_" + i).text(formatNumber(1000));
}else{
$("#eva_adjust_postponement_detail_quota_02_new_cost_living_" + i).text(0);
}

View File

@@ -28,6 +28,7 @@ var item_level_score;
function eva_create_evaluation_detail_process_FeedDataToForm(data) {
$("#eva_create_evaluation_detail_process_id").val(data.id);
$("#eva_create_evaluation_detail_process_employee_id").val(data.employee_id);
$("#eva_create_evaluation_detail_process_evaluation_round").text(data.evaluation_round);
$("#eva_create_evaluation_detail_process_employee_code").text(data.employee_code);
$("#eva_create_evaluation_detail_process_employee_fullname").text(data.employee_fullname);

View File

@@ -27,7 +27,9 @@ function cal_level(){
var item_level_score;
function eva_create_evaluation_detail_process_FeedDataToForm(data) {
$("#eva_create_evaluation_detail_process_id").val(data.id);
$("#eva_create_evaluation_detail_process_employee_id").val(data.employee_id);
$("#eva_create_evaluation_detail_process_evaluation_round").text(data.evaluation_round);
$("#eva_create_evaluation_detail_process_employee_code").text(data.employee_code);
$("#eva_create_evaluation_detail_process_employee_fullname").text(data.employee_fullname);

View File

@@ -180,6 +180,41 @@ console.log(result);
"render": function (data, type, row, meta) {
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_salary_cylinder_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_salary_cylinder_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
}
},
{
"targets": 3,
"data": "temporary_min",
"render": function (data, type, row, meta) {
return formatNumber(data);
}
},
{
"targets": 4,
"data": "themin",
"render": function (data, type, row, meta) {
return formatNumber(data);
}
},
{
"targets": 5,
"data": "themax",
"render": function (data, type, row, meta) {
return formatNumber(data);
}
},
{
"targets": 6,
"data": "middle",
"render": function (data, type, row, meta) {
return formatNumber(data);
}
},
{
"targets": 7,
"data": "cost_living",
"render": function (data, type, row, meta) {
return formatNumber(data);
}
}],
"language": {
"url": appsite + "/DataTables-1.10.16/thai.json"