<%
Dim temp_minus_yyyy
temp_minus_yyyy = 0
%>
<%for i=cint(year(date)+temp_minus_yyyy) to 2021 step -1 %>
selected<%end if%> ><%=i%>
<%next%>
조회
1. 계약실적
부서
수주실적
수행실적
예상직접비
예상공헌이익
<% '1. 계약실적 쿼리문
query = ""
query = query & " SELECT team_name, team_cd, "&VbCrlf
query = query & " SUM(p_total_cost) as p_total_cost, "&VbCrlf
query = query & " SUM(p_cont_cost) as p_cont_cost, SUM(est_money) as est_money, "&VbCrlf
query = query & " SUM(act_money) as act_money, SUM(cost_money) as cost_money, "&VbCrlf
query = query & " SUM(entertain_money) as entertain_money, SUM(tf_money) as tf_money, "&VbCrlf
query = query & " SUM(benefit) as benefit "&VbCrlf
query = query & " FROM "&VbCrlf
query = query & " ( "&VbCrlf
query = query & " SELECT team_name, team_cd, p_sn, "&VbCrlf'p_total_cost, "
query = query & " case when LEFT(p_sn, 2) = '" &RIGHT(tmp_year, 2)-1& "' Then "&VbCrlf
query = query & " case when SUM(p_total_cost)='0' Then SUM(p_cont_cost) else SUM(p_total_cost) end "&VbCrlf
query = query & " else SUM(p_total_cost) end as p_total_cost, "&VbCrlf '##### 이월 프로젝트의 수주실적 총 합계 -> 0원이면 수주실적 = 수행실적(2018-10-24)
query = query & " p_decide_date, "&VbCrlf
query = query & " weeknum, "&VbCrlf
query = query & " SUM(p_cont_cost) as p_cont_cost, SUM(est_money) as est_money, "&VbCrlf
query = query & " SUM(act_money) as act_money, SUM(cost_money) as cost_money, "&VbCrlf
query = query & " SUM(entertain_money) as entertain_money, SUM(tf_money) as tf_money, "&VbCrlf
query = query & " SUM(benefit) as benefit "&VbCrlf
query = query & " FROM #statistics_next "&VbCrlf
query = query & " WHERE ( substring(p_decide_date, 1,4) = '" & tmp_year & "' OR ( substring(p_decide_date, 1,4) = '" & tmp_year - 1 & "' AND p_statistics = '" & tmp_year & "')) "&VbCrlf
query = query & " GROUP BY team_name, team_cd, p_sn, p_decide_date, weeknum "&VbCrlf
query = query & " ) T "&VbCrlf
query = query & " where 1=1 "&VbCrlf
query = query & " GROUP BY team_name, team_cd "&VbCrlf
query = query & " ORDER BY team_name "&VbCrlf
'Response.Write query & " "
adors.Open query, adoconn, adOpenStatic, adLockReadOnly
if adors.RecordCount > 0 then
%>
<%
sum_total_cost = 0
sum_cont_cost = 0
sum_est_money = 0
sum_benefit = 0
For i = 1 To adors.RecordCount
%>
')"><%=adors("team_name")%>
<%=formatnumber(adors("p_total_cost"),0) %>
<%=formatnumber(adors("p_cont_cost"),0) %>
<%=formatnumber(adors("est_money"),0) %>
<%=formatnumber(adors("benefit"),0) %>
<%
sum_total_cost = sum_total_cost + cdbl(adors("p_total_cost"))
sum_cont_cost = sum_cont_cost + cdbl(adors("p_cont_cost"))
sum_est_money = sum_est_money + cdbl(adors("est_money"))
sum_benefit = sum_benefit + cdbl(adors("benefit"))
adors.MoveNext
Next
%>
합 계
<%=formatnumber(sum_total_cost,0) %>
<%=formatnumber(sum_cont_cost,0) %>
<%=formatnumber(sum_est_money,0) %>
<%=formatnumber(sum_benefit,0) %>
<%
end if' if adors.RecordCount > 0 then
adors.Close
%>
2. 진행실적
부서
수행실적
예상직접비
실제직접비+진행비
예상공헌이익
<% '2. 진행실적 쿼리문
query = ""
query = query & " SELECT team_name, team_cd, "
query = query & " SUM(p_total_cost) as p_total_cost, "
query = query & " SUM(p_cont_cost) as p_cont_cost, SUM(est_money) as est_money, "
query = query & " SUM(act_money) as act_money, SUM(cost_money) as cost_money, "
query = query & " SUM(entertain_money) as entertain_money, SUM(tf_money) as tf_money, "
query = query & " SUM(benefit) as benefit "
query = query & " FROM "
query = query & " ( "
query = query & " SELECT team_name, team_cd, p_sn, p_total_cost, "
query = query & " SUM(p_cont_cost) as p_cont_cost, SUM(est_money) as est_money, "
query = query & " SUM(act_money) as act_money, SUM(cost_money) as cost_money, "
query = query & " SUM(entertain_money) as entertain_money, SUM(tf_money) as tf_money, "
query = query & " SUM(benefit) as benefit "
query = query & " FROM #statistics_next "&VbCrlf
query = query & " WHERE (LEFT(p_sn, 2) = '" & RIGHT(tmp_year, 2) & "' OR (LEFT(p_sn, 2) = '" & RIGHT(tmp_year, 2) - 1 & "' AND p_statistics = '" & tmp_year & "')) "&VbCrlf
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 진행 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
query = query & " AND p_progress_status = '008' AND complete_yn = '0' "
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ↑↑ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
query = query & " GROUP BY team_name, team_cd, p_sn, p_total_cost "
query = query & " ) T "
query = query & " where 1=1 "&VbCrlf
query = query & " GROUP BY team_name, team_cd "
query = query & " ORDER BY team_name "
'Response.Write query & " "
If tmp_year <> "0000" then
adors.Open query, adoconn,adOpenStatic,adLockReadOnly
if adors.RecordCount > 0 then
%>
<%
sum_cont_cost = 0
sum_est_money = 0
sum_act_money = 0
sum_benefit = 0
For i = 1 To adors.RecordCount
%>
')"><%=adors("team_name")%>
<%=formatnumber(adors("p_cont_cost"),0) %>
<%=formatnumber(adors("est_money"),0) %>
<%=formatnumber(cdbl(adors("act_money")) + cdbl(adors("cost_money")) + cdbl(adors("entertain_money")) + cdbl(adors("tf_money")),0) %>
<%=formatnumber(adors("benefit"),0) %>
<%
sum_cont_cost = sum_cont_cost + cdbl(adors("p_cont_cost"))
sum_est_money = sum_est_money + cdbl(adors("est_money"))
sum_act_money = sum_act_money + cdbl(adors("act_money")) + cdbl(adors("cost_money")) + cdbl(adors("entertain_money")) + cdbl(adors("tf_money"))
sum_benefit = sum_benefit + cdbl(adors("benefit"))
adors.movenext
next
%>
합 계
<%=formatnumber(sum_cont_cost,0) %>
<%=formatnumber(sum_est_money,0) %>
<%=formatnumber(sum_act_money,0) %>
<%=formatnumber(sum_benefit,0) %>
<%
end if' if adors.RecordCount > 0 then
adors.Close
End if
%>
3. 종료실적
부서
수행실적
예상직접비
실제직접비+진행비
공헌이익
<%
query = ""
query = query & " SELECT team_name, team_cd, "
query = query & " SUM(p_total_cost) as p_total_cost, "
query = query & " SUM(p_cont_cost) as p_cont_cost, SUM(est_money) as est_money, "
query = query & " SUM(act_money) as act_money, SUM(cost_money) as cost_money, "
query = query & " SUM(entertain_money) as entertain_money, SUM(tf_money) as tf_money, "
query = query & " SUM(benefit) as benefit "
query = query & " FROM "
query = query & " ( "
query = query & " SELECT LEFT(p_con_date_end, 7) as p_con_date_end, team_name, team_cd, p_sn, p_total_cost, "
query = query & " SUM(p_cont_cost) as p_cont_cost, SUM(est_money) as est_money, "
query = query & " SUM(act_money) as act_money, SUM(cost_money) as cost_money, "
query = query & " SUM(entertain_money) as entertain_money, SUM(tf_money) as tf_money, "
query = query & " SUM(benefit) as benefit "
query = query & " FROM #statistics_next "&VbCrlf
query = query & " WHERE p_statistics = '" & tmp_year & "' "
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 종료 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
query = query & " AND complete_yn = '1' "
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ↑↑ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
query = query & " GROUP BY LEFT(p_con_date_end, 7), team_name, team_cd, p_sn, p_total_cost "
query = query & " ) T "
query = query & " where 1=1 "&VbCrlf
query = query & " GROUP BY team_name, team_cd "
query = query & " ORDER BY team_name "
'Response.Write query & " "
If tmp_year <> "0000" then
adors.Open query, adoconn,adOpenStatic,adLockReadOnly
if adors.RecordCount > 0 then
%>
<%
sum_cont_cost = 0
sum_est_money = 0
sum_act_money = 0
sum_benefit = 0
For i = 1 To adors.RecordCount
%>
')"><%=adors("team_name")%>
<%=formatnumber(adors("p_cont_cost"),0) %>
<%=formatnumber(adors("est_money"),0) %>
<%=formatnumber(cdbl(adors("act_money")) + cdbl(adors("cost_money")) + cdbl(adors("entertain_money")) + cdbl(adors("tf_money")),0) %>
<%=formatnumber(adors("benefit"),0) %>
<%
sum_cont_cost = sum_cont_cost + cdbl(adors("p_cont_cost"))
sum_est_money = sum_est_money + cdbl(adors("est_money"))
sum_act_money = sum_act_money + cdbl(adors("act_money")) + cdbl(adors("cost_money")) + cdbl(adors("entertain_money")) + cdbl(adors("tf_money"))
sum_benefit = sum_benefit + cdbl(adors("benefit"))
adors.movenext
next
%>
합 계
<%=formatnumber(sum_cont_cost,0) %>
<%=formatnumber(sum_est_money,0) %>
<%=formatnumber(sum_act_money,0) %>
<%=formatnumber(sum_benefit,0) %>
<%
end if' if adors.RecordCount > 0 then
adors.Close
End if
%>