Files
KIN/inspection/myun_neakeun_state.asp
2025-09-29 17:55:08 +09:00

211 lines
14 KiB
Plaintext

<!-- #include virtual = "include/header.asp" -->
<%
dim command
command = Request("command")
p_sn = request("p_sn")
work_type = request("work_type")
neakeun_jumin = request("neakeun_jumin")
neakeun_name = request("neakeun_name")
work_date_st = request("work_date_st")
work_date_ed = request("work_date_ed")
if work_date_st = "" or isnull(work_date_st) then
work_date_st = date()
end if
if work_date_ed = "" or isnull(work_date_ed) then
work_date_ed = date()
end if
dim sum_job_add_time
dim sum_all_work_time
dim sum_job_lunch_time
dim sum_job_dinner_time
dim sum_expected_pay
if command <> "excel" then
%>
<!-- #include virtual = "include/left.asp" -->
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<div class="content-header">
<h1>내근직별 지급누계</h1>
</div>
<!-- /.content-header -->
<!-- Main content -->
<div class="content-body">
<div class="content">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<%
End If
if command = "excel" then
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition","attachment;filename=내근직별_지급누계.xls"
end if
%>
<%if command <> "excel" then%>
<% Dim f_menu : f_menu = "np" %>
<!-- #include file = "f_menu.asp" -->
<%End If%>
<form name="pms" method="post">
<table width="1200px" class="table table-sm table-sm2 table-bordered table-head tr-colors">
<%if command <> "excel" then%>
<tr>
<td width="15%" height="30px" align="center" >생년월일</td>
<td width="35%" height="30px" ><input name="neakeun_jumin" type="text" value="<%=neakeun_jumin %>" style="width:200px" ></td>
<td width="15%" height="30px" align="center" >이름</td>
<td width="35%" height="30px" ><input name="neakeun_name" type="text" value="<%=neakeun_name %>" style="width:200px" ></td>
</tr>
<tr>
<td width="15%" height="30px" align="center" >근무 일자</td>
<td width="35%" height="30px" >
<input type="text" style="width:100px;text-align:right;" name="work_date_st" class="selectDate" readonly value="<%=work_date_st%>">
&nbsp&nbsp<b>~</b>&nbsp&nbsp
<input type="text" style="width:100px;text-align:right;" name="work_date_ed" class="selectDate" readonly value="<%=work_date_ed%>">
</td>
<%
query = " select *"
query = query & " from direct_costcode "
query = query & " where d_cost_kind = 'field' "
query = query & " and d_cost_useyn = 'y' "
query = query & " and d_cost_parents = '2' "
Adors.Open query, adoConn, 1
%>
<td width="15%" height="30px" align="center" >업무</td>
<td width="35%" height="30px" >
<select name="work_type">
<option value="">전체</option>
<% for i=1 to Adors.recordcount %>
<option value="<%=Adors("d_cost_code")%>" <% if CStr(Adors("d_cost_code")) = work_type then %>selected <%end if %>><%=Adors("d_cost_name") %></option>
<% Adors.movenext
next
Adors.close
%>
</select>
</td>
</tr>
<tr>
<td align="center" colspan="4" class='pt-2'>
<img src="/images/common/btn_search.jpg" align="absmiddle" style="cursor:pointer" onclick="search('search')">
<img src="/images/common/btn_excel.jpg" align="absmiddle" onclick="search('excel')" style='CURSOR:pointer;' title ='엑셀로 내보내기'></p>
</td>
</tr>
<%end if %>
<% if command <> "" then %>
<tr>
<td align="center" colspan="4">
<table class="table table-sm table-sm2 table-bordered table-head tr-colors">
<tr>
<td align="center" >생년월일</td>
<td align="center" >이름</td>
<td align="center" >가감내역</td>
<td align="center" >총투입시간</td>
<td align="center" >중식</td>
<td align="center" >석식</td>
<td align="center" >지급예정비용</td>
</tr>
<%
'--프로젝트 별 내근직 소요비용 검색-종료 프로젝트
query = " select neakeun_jumin, neakeun_name "
query = query & " , sum(job_add_time) as job_add_time "
query = query & " , round(sum(job_in_time),2) as job_total_time "
query = query & " , sum(isnull(convert(int, job_lunch_yn), 0)) as job_lunch_yn "
query = query & " , sum(isnull(convert(int, job_dinner_yn), 0)) as job_dinner_yn "
query = query & " , s_sum "
query = query & " from ( "
query = query & " select neakeun_jumin, neakeun_name, date "
query = query & " , sum(convert(float, job_add_time)) as job_add_time "
query = query & " , sum(job_in_time) as job_in_time "
query = query & " , job_lunch_yn "
query = query & " , job_dinner_yn "
query = query & " from neakeun_work "
query = query & " where job_confirm_yn = 'Y' and date between '"&work_date_st&"' and '"&work_date_ed&"' "
if work_type <> "" then
query = query & " AND p_sebu_code = '"&work_type&"' "
end if
query = query & " group by neakeun_jumin, neakeun_name, date, job_lunch_yn, job_dinner_yn "
query = query & " ) as T left outer join ( "
query = query & " select m_name, m_jumin, SUM(s_sum) as s_sum "
query = query & " from t_neakeun_pay "
query = query & " where work_dt between '"&work_date_st&"' and '"&work_date_ed&"' "
query = query & " group by m_name, m_jumin "
query = query & " ) tmp on t.neakeun_jumin = tmp.m_jumin and t.neakeun_name = tmp.m_name "
query = query & " where neakeun_jumin != '' "
if neakeun_jumin <> "" then
query = query & " AND left(neakeun_jumin, 7) like '%"&neakeun_jumin&"%' "
end if
if neakeun_name <> "" then
query = query & " AND neakeun_name like '%"&neakeun_name&"%' "
end if
query = query & " group by neakeun_jumin, neakeun_name, s_sum "
query = query & " order by neakeun_name "
Adors.open query,adoconn,1
sum_job_add_time = 0
sum_all_work_time = 0
sum_job_lunch_time = 0
sum_job_dinner_time = 0
sum_expected_pay = 0
for i=1 to Adors.recordcount
if not isnull(Adors("neakeun_jumin")) then
sum_job_add_time = sum_job_add_time + Adors("job_add_time")
sum_all_work_time = sum_all_work_time + Adors("job_total_time")
sum_job_lunch_time = sum_job_lunch_time + Adors("job_lunch_yn")
sum_job_dinner_time = sum_job_dinner_time + Adors("job_dinner_yn")
sum_expected_pay = sum_expected_pay + Adors("s_sum")
end if
%>
<tr>
<td align="center"><%= left(Adors("neakeun_jumin"), 7)%></td>
<td align="center"><%= Adors("neakeun_name")%></td>
<td align="center"><%= Adors("job_add_time")%></td>
<td align="center"><%= Adors("job_total_time")%></td>
<td align="center"><%= Adors("job_lunch_yn")%></td>
<td align="center"><%= Adors("job_dinner_yn")%></td>
<td align="center"><%= formatnumber(Adors("s_sum"),0)%></td>
</tr>
<% Adors.movenext
next
Adors.close
%>
<tr>
<td align="right" colspan="2"><b>총 합계</b></td>
<td align="center"><b><%= sum_job_add_time%></b></td>
<td align="center"><b><%= sum_all_work_time%></b></td>
<td align="center"><b><%= sum_job_lunch_time%></b></td>
<td align="center"><b><%= sum_job_dinner_time%></b></td>
<td align="center"><b><%= formatnumber(sum_expected_pay,0)%></b></td>
</tr>
</table>
</td>
</tr>
<% end if %>
</table>
</form>
<%if command <> "excel" then%>
</div>
</div>
</div>
</div>
</div>
<!-- /.content -->
<!-- REQUIRED SCRIPTS -->
<script>
$(function(){
$(".selectDate").datepicker();
});
function search(a) {
document.pms.action = "myun_neakeun_state.asp?command=" + a;
document.pms.submit();
}
</script>
</div>
<!-- /.content-wrapper -->
<!-- #include virtual = "include/footer.asp" -->
<% end if %>