| 연구부서 |
프로젝트 번호 |
프로젝트 명 |
업무 |
실제 조사 시작날짜 |
실제 조사 종료날짜 |
총 투입시간 |
총 지출비용 |
<%
'--프로젝트 별 내근직 소요비용 검색-종료 프로젝트
query = " select isnull(d2.d_name,d1.d_name) as d_name, tmp.p_sn, tmp.p_child_sn as p_child_sn, isnull(tpm.p_subject,p.p_subject) as p_subject, tmp.p_sebu_code, tmp.s_gubun as p_sebu, "
query = query & " st_date, ed_date, job_total_time, s_sum, isnull(tpm.p_method_cd,'') as p_method_cd, isnull(tpm.p_sub_type,'') as p_sub_type "
query = query & " from ( "
query = query & " select nw.p_sn, tmp.p_sn as p_child_sn, s_gubun, ROUND(SUM(tmp.s_wan),2) as job_total_time, SUM(tmp.s_sum) as s_sum, MIN(work_dt) as st_date, MAX(work_dt) as ed_date, nw.p_sebu_code "
query = query & " from t_neakeun_pay tmp left outer join neakeun_work nw on tmp.attribute01 = convert(varchar(15),nw.id) "
query = query & " where s_gubun not like '추가%' "
query = query & " group by tmp.p_sn, tmp.s_gubun, nw.p_sn, nw.p_sebu_code "
query = query & " union "
query = query & " select nw.p_sn, tmp.p_sn as p_child_sn, s_gubun, '' as job_total_time, SUM(tmp.s_sum) as s_sum, MIN(work_dt) as st_date, MAX(work_dt) as ed_date, '0' as p_sebu_code "
query = query & " from t_neakeun_pay tmp left outer join neakeun_work nw on tmp.attribute01 = convert(varchar(15),nw.id) "
query = query & " where tmp.s_gubun like '추가%' "
query = query & " group by tmp.p_sn, tmp.s_gubun, nw.p_sn "
query = query & " ) tmp "
query = query & " left outer join T_PROJECT_METHOD tpm on tmp.p_child_sn = tpm.p_child_sn "
query = query & " left outer join project p on tmp.p_sn = p.p_sn "
query = query & " left outer join Depart d1 on tpm.p_rsch_dept = d1.d_code "
query = query & " left outer join Depart d2 on p.p_depart = d2.d_code "
query = query & " where tmp.p_child_sn != '' AND (p.p_field_complete = 1 or tpm.p_field_complete = 1) "
if p_sn <> "" then
query = query & " AND tmp.p_sn LIKE '%"& p_sn &"%' "
end if
if p_subject <> "" then
query = query & " AND (p.p_subject LIKE '%"&p_subject&"%' OR tpm.p_subject like '%"&p_subject&"%') "
end if
if work_type <> "" then
query = query & " AND tmp.p_sebu_code = '"&work_type&"' "
end if
if p_depart <> "" then
query = query & " AND (p.p_depart = '"&p_depart&"' OR tpm.p_rsch_dept = '"&p_depart&"') "
end if
if month_from <> "" then
query = query & " AND (tpm.p_field_date_st >= '"&year_from&"-"&month_from&"-00' OR P.p_field_st >= '"&year_from&"-"&month_from&"-00') "
end if
if month_to <> "" then
query = query & " AND (tpm.p_field_date_st <= '"&year_to&"-"&month_to&"-32' OR P.p_field_st <= '"&year_to&"-"&month_to&"-32') "
end if
query = query & " order by p_child_sn, p_sebu_code desc "
Adors.open query,adoconn,1
if Adors.recordcount > 0 then
tmp_p_sn = Adors("p_child_sn")
end if
subTime = 0
subTotal = 0
allTime = 0
allTotal = 0
for i=1 to Adors.recordcount
if not isnull(Adors("job_total_time")) then
subTime = subTime + Adors("job_total_time")
allTime = allTime + Adors("job_total_time")
end if
if not isnull(Adors("s_sum")) then
subTotal = subTotal + Adors("s_sum")
allTotal = allTotal + Adors("s_sum")
end if
%>
| <%= Adors("d_name")%> |
<%= Adors("p_child_sn")%> |
','<%=Adors("p_sub_type")%>','<%=Adors("p_method_cd")%>','<%=Adors("p_child_sn")%>')" class="blue"><%= Adors("p_subject")%> |
<%= Adors("p_sebu")%> |
<%= Adors("st_date")%> |
<%= Adors("ed_date")%> |
<%= Adors("job_total_time")%> |
<%= formatnumber(Adors("s_sum") ,0)%> |
<% Adors.movenext
if i < Adors.recordcount then
if tmp_p_sn <> Adors("p_child_sn") then
%>
| [<%= tmp_p_sn%>]프로젝트 소계 |
<%= subTime%> |
<%= formatnumber(subTotal,0)%> |
<%
tmp_p_sn = Adors("p_child_sn")
subTime = 0
subTotal = 0
end if
else
%>
| [<%= tmp_p_sn%>]프로젝트 소계 |
<%= subTime%> |
<%= formatnumber(subTotal,0)%> |
<%
end if
next
Adors.close
%>
| 총 합계 |
<%= allTime%> |
<%= formatnumber(allTotal,0)%> |
|
<% end if %>