<% Function My_IsNumeric(value) My_IsNumeric = False If IsNull(value) Then Exit Function My_IsNumeric = IsNumeric(CStr(value)) End Function %>

Dashboard

<% tmp_year = request("tmp_year") tmp_week = request("tmp_week") now_month = request("now_month") if tmp_year = "" then tmp_year = year(date) end if if( 2020 >= tmp_year )then tmp_year = year(date) end if if( tmp_year > 2022 )then tmp_year = year(date) end if 'default query = " select yearnum, weeknum, sdate, edate, CONVERT(varchar(7), sdate, 120) AS now_month " query = query &" , CONVERT(varchar(7), dateadd(year,-1,sdate), 120) AS pre_month " query = query &" , CASE WHEN DATEPART(mm,sdate) < 4 THEN DATEPART(yy,sdate) - 1 ELSE DATEPART(yy,sdate) END diy_month " query = query &" FROM project2.dbo.BG_WEEKNUM with(nolock) " query = query &" WHERE del_yn = 'N' " query = query &" and yearnum = '"& tmp_year &"' " if tmp_week = "" then query = query &" AND CONVERT(VARCHAR(10), getdate(), 120) BETWEEN sdate AND edate " else query = query &" AND weeknum = '"& tmp_week &"' " end if ' response.write query adors.Open query, adoconn, adOpenStatic, adLockReadOnly 'adminView_hwkim(query) ' response.write "
----------query-------------"& query &"
" ' response.write "
----------adors.RecordCount-------------"& adors.RecordCount &"
" ' response.write "
----------yearnum-------------"& adors("yearnum") &"
" ' response.write "
----------weeknum-------------"& adors("weeknum") &"
" ' response.write "
----------diy_month-------------"& adors("diy_month") &"
" ' response.write "
----------year(date)-------------"& year(date) &"-12-15" ' response.write "
" tmp_now_weeknum = adors("weeknum") tmp_sdate = adors("sdate") tmp_edate = adors("edate") tmp_now_month = adors("now_month") tmp_pre_month = adors("pre_month") tmp_diy_month = adors("diy_month") tmp_diy_month = tmp_diy_month &"-04" adors.Close if tmp_week = "" then tmp_week = tmp_now_weeknum end if Dim arr_hd_sum() Dim tmp_max_weeknum : tmp_max_weeknum = (tmp_now_weeknum + 2) if( tmp_max_weeknum > 54 )then tmp_max_weeknum = 54 end if ' response.write " year = "& tmp_year ' response.write " weeknum = "& tmp_week ' response.write " tmp_sdate = "& tmp_sdate ' response.write " tmp_edate = "& tmp_edate ' response.write "
" Dim arr(15,3), arrSUM(30,17), arrSUMTT(30) arr(0,0) = "BG_CODE" : arr(0,3) = "F": arr(0,1) = "Business Line" :arr(0,2) = "T" arr(1,0) = "GP" : arr(1,3) = "F": arr(1,1) = "Group #" :arr(1,2) = "T" arr(2,0) = "cro" : arr(2,3) = "I": arr(2,1) = "이월 매출 금액
(Carry-over)" :arr(2,2) = "I" arr(3,0) = "ctt_pre_ww" : arr(3,3) = "F": arr(3,1) = "전주 계약" :arr(3,2) = "I" arr(4,0) = "ctt" : arr(4,3) = "F": arr(4,1) = "당월계약
("& tmp_now_month &"월)" :arr(4,2) = "I" arr(5,0) = "ctt_pre_mm" : arr(5,3) = "I": arr(5,1) = "작년 동월 계약
("& tmp_pre_month &"월)" :arr(5,2) = "I" arr(6,0) = "mm_dif" : arr(6,3) = "F": arr(6,1) = "월 비교(%)" :arr(6,2) = "P" arr(7,0) = "ctt_add" : arr(7,3) = "F": arr(7,1) = "올해 누적계약
("& tmp_diy_month &"~"& tmp_now_month &")" :arr(7,2) = "I" arr(8,0) = "ctt_add_pre" : arr(8,3) = "I": arr(8,1) = "작년 누적계약
(20.4~20.11)" :arr(8,2) = "I" arr(9,0) = "ctt_add_dif" : arr(9,3) = "F": arr(9,1) = "누적 계약 비교" :arr(9,2) = "P" arr(10,0) = "sales_goal" : arr(10,3) = "I": arr(10,1) = "매출 목표
21.04.01~22.03.31
(Carry over 포함)" :arr(10,2) = "I" arr(11,0) = "sales_pre_amount" : arr(11,3) = "F": arr(11,1) = "매출
예상액" :arr(11,2) = "I" arr(12,0) = "sales_goal_per" : arr(12,3) = "F": arr(12,1) = "매출 목표
달성율" :arr(12,2) = "P" arr(13,0) = "sales_wip" : arr(13,3) = "I": arr(13,1) = "20년 WIP
결산 매출" :arr(13,2) = "I" arr(14,0) = "sales_year_dif" : arr(14,3) = "F": arr(14,1) = "올해 Vs.전년
비교" :arr(14,2) = "P" ' 전주 계약, 당월 계약, 올해 누적계약 Dim arrvalW(15,3), arrvalM(15,3), arrvalC(15,3) '//-- 전주 계약 query = "" query = query & " SELECT p_depart_dep "&VbCrlf query = query & " , sum(p_total_cost) total_cost "&VbCrlf query = query & " FROM T_PROJECT_BASE tpb "&VbCrlf query = query & " WHERE 1 = 1 and p_state = 'P' AND CONVERT(varchar(10), p_decide_date, 120) BETWEEN '"& tmp_sdate &"'AND '"& tmp_edate &"' "&VbCrlf '//-- p_state = 'P' 수주 query = query & " GROUP BY p_depart_dep "&VbCrlf 'Response.Write query & "
" 'adminView_hwkim("
1. 전주 계약
") 'adminView_hwkim(query) adors.Open query, adoconn, adOpenStatic, adLockReadOnly if adors.RecordCount > 0 then For i = 1 To adors.RecordCount arrvalW(i,0) = adors("p_depart_dep") arrvalW(i,1) = adors("total_cost") 'response.write "//"& adors("p_depart_dep") & arrvalW(i,0) & arrvalW(i,1) adors.MoveNext Next end if adors.Close '//-- 당월 계약 query = "" query = query & " SELECT p_depart_dep "&VbCrlf query = query & " , sum(p_total_cost) total_cost "&VbCrlf query = query & " FROM T_PROJECT_BASE tpb "&VbCrlf query = query & " WHERE 1 = 1 and p_state = 'P' AND CONVERT(varchar(7), p_decide_date, 120) = '"& tmp_now_month &"' "&VbCrlf '//-- p_state = 'P' 수주 query = query & " GROUP BY p_depart_dep "&VbCrlf 'Response.Write query & "
" 'adminView_hwkim("
2. 당월 계약
") 'adminView_hwkim(query) adors.Open query, adoconn, adOpenStatic, adLockReadOnly if adors.RecordCount > 0 then For i = 1 To adors.RecordCount arrvalM(i,0) = adors("p_depart_dep") arrvalM(i,1) = adors("total_cost") 'response.write "//"& adors("p_depart_dep") & arrvalM(i,0) & arrvalM(i,1) adors.MoveNext Next end if adors.Close '//-- 올해 누적계약 query = "" query = query & " SELECT p_depart_dep "&VbCrlf query = query & " , sum(p_total_cost) total_cost "&VbCrlf query = query & " FROM T_PROJECT_BASE tpb "&VbCrlf query = query & " WHERE 1 = 1 and p_state = 'P' AND CONVERT(varchar(7), p_decide_date, 120) BETWEEN '"& tmp_diy_month &"'AND '"& tmp_now_month &"' "&VbCrlf '//-- p_state = 'P' 수주 query = query & " GROUP BY p_depart_dep "&VbCrlf 'Response.Write query & "
" 'adminView_hwkim("
3. 올해 누적계약
") 'adminView_hwkim(query) adors.Open query, adoconn, adOpenStatic, adLockReadOnly if adors.RecordCount > 0 then For i = 1 To adors.RecordCount arrvalC(i,0) = adors("p_depart_dep") arrvalC(i,1) = adors("total_cost") 'response.write "//"& adors("p_depart_dep") & arrvalC(i,0) & arrvalC(i,1) adors.MoveNext Next end if adors.Close %> <% query = " SELECT bc.idx as bc_idx "&vbCrLf query = query & " , bc.BG_CODE "&vbCrLf query = query & " , bc.BL "&vbCrLf query = query & " , bc.GP "&vbCrLf query = query & " , bc.team_cd "&vbCrLf query = query & " , bc.subtotal_key "&vbCrLf query = query & " , (CASE WHEN isnull(bwd.idx,'0') = 0 THEN 'insert' ELSE 'update' END) input_yn "&vbCrLf query = query & " , bwd.idx as bwd_idx "&vbCrLf query = query & " , isnull(bwd.yearnum,'"& tmp_year &"') yearnum "&vbCrLf query = query & " , isnull(bwd.weeknum,'"& tmp_week &"') weeknum "&vbCrLf query = query & " , bwd.cro "&vbCrLf query = query & " , bwd.ctt_pre_ww "&vbCrLf query = query & " , bwd.ctt "&vbCrLf query = query & " , bwd.ctt_pre_mm "&vbCrLf query = query & " , bwd.mm_dif "&vbCrLf query = query & " , bwd.ctt_add "&vbCrLf query = query & " , bwd.ctt_add_pre "&vbCrLf query = query & " , bwd.ctt_add_dif "&vbCrLf query = query & " , bwd.sales_goal "&vbCrLf query = query & " , bwd.sales_pre_amount "&vbCrLf query = query & " , bwd.sales_goal_per "&vbCrLf query = query & " , bwd.sales_wip "&vbCrLf query = query & " , bwd.sales_year_dif "&vbCrLf query = query & " FROM BG_CATEGORY bc "&vbCrLf query = query & " LEFT OUTER JOIN BG_WEEKNUM_DATA bwd "&vbCrLf query = query & " ON bc.BG_CODE = bwd.BG_CODE "&vbCrLf query = query & " AND bwd.del_yn = 'N' "&vbCrLf query = query & " AND bwd.yearnum = '"& tmp_year &"' "&vbCrLf query = query & " AND bwd.weeknum = '"& tmp_week &"' "&vbCrLf query = query & "WHERE bc.del_yn = 'N' "&vbCrLf query = query & "ORDER BY bc.sortnum ASC " adors.Open query, adoconn, adOpenStatic, adLockReadOnly 'response.write "
----------query-------------

"& query &"

" 'response.write "
----------adors.RecordCount-------------"& adors.RecordCount &"///" 'response.write "
-----------------------"& adors("yearnum") &"///" 'response.write "
-----------------------"& adors("weeknum") &"///" 'response.write "
-----------------------"& year(date) &"-12-15" 'response.write "
" tmp_now_weeknum = adors("weeknum") '//-- adors.Close %>
등록년도 <% NowYear = year(date()) %>    (<%=tmp_sdate %> ~ <%=tmp_edate %> )   
<% 'response.write "
-----------------------"& Request.ServerVariables("REMOTE_ADDR") 'response.write "
-----------------------"& session("admin_ip") if( session("admin_ip") <> "" or ( session("User_Number") = "20190301" or session("User_Number") = "20191202" ) )then '조기혜 대체 김현정 'response.write "
-----------------------"& session("admin_ip") &"---------" %>
     
<% end if %>
<% for i = 1 to 14 step 1 %>
<%=arr(i,3) %>.<%=arr(i,1) %>
<% next %>
<% for ii = 1 to adors.RecordCount 'response.write "-----------------"& InStr(adors("GP"), "Subtotal") if( InStr(adors("GP"), "Subtotal") > 0 )then div_list_bgcolor = "divTableRow_subtotal" Else div_list_bgcolor = "" End If if( adors("GP") = "Total" )then div_list_bgcolor = "divTableRow_total" end if %>
<%'=adors("team_cd") %> <% for i = 0 to 14 step 1 tmp_div_type = "" tmp_input_type = "text" 'if( arr(i,0) = "BG_CODE" or arr(i,0) = "GP" )then ' tmp_input_type = "hidden" 'end if view_val_acc = "" view_val = adors(arr(i,0)) '//----------------------------------------------------- '//-- cols select case i case "0": tmp_div_type = "none" tmp_input_type = "hidden" select case adors(arr(i,0)): case "BG00001","BG00002","BG00003","BG00004","BG00005","BG00006","BG00007","BG00008","BG00009": view_val = "Research&Consulting" case "BG00010","BG00011","BG00012","BG00013","BG00014": view_val = "Data Innovation" case "BG00015","BG00016","BG00017": view_val = "Digital Convergence" case else: view_val = "Total" end select case "1": tmp_input_type = "hidden" view_val = adors(arr(i,0)) case else: view_val = adors(arr(i,0)) '//-- 집계 'arrSUM(30,17) '//arrSUM(ii,i) = adors(arr(i,0)) arrSUMTT(ii) = adors("subtotal_key") '//-- subtotal 확인키 'response.write arrSUM(ii,i) 'response.write "///"& adors("subtotal_key") if( left(adors("subtotal_key"),2) <> "st" and adors("subtotal_key") <> "tt" )then arrSUM(ii,i) = adors(arr(i,0)) end if end select '//----------------------------------------------------- '/////view_val = 0 'ctt_pre_ww" ' 전주 계약 if( arr(i,0) = "ctt_pre_ww" )then for aw = 0 to Ubound(arrvalW) 'response.write aw&" - "& arrvalW(aw,0) 'response.write "--- "& adors("team_cd") &" - "& arrvalW(aw,0) &" - "& arrvalW(aw,1) if( trim(adors("team_cd")) = trim(arrvalW(aw,0)) )then 'response.write "***--- "& adors("team_cd") &" - "& arrvalW(aw,0) &" - "& arrvalW(aw,1) view_val_acc = arrvalW(aw,1) end if next 'response.write "--- "& adors("team_cd") 'response.write "--- "& arr(i,0) 'response.write "--- "& adors("ctt_pre_ww") 'response.write "--- "& adors("ctt_pre_mm") end if '//-- 당월계약 ctt if( arr(i,0) = "ctt" )then for aw = 0 to Ubound(arrvalM) 'response.write aw&" - "& arrvalM(aw,0) 'response.write "--- "& adors("team_cd") &" - "& arrvalM(aw,0) &" - "& arrvalM(aw,1) if( trim(adors("team_cd")) = trim(arrvalM(aw,0)) )then 'response.write "***--- "& adors("team_cd") &" - "& arrvalM(aw,0) &" - "& arrvalM(aw,1) view_val_acc = arrvalM(aw,1) end if next 'response.write "--- "& adors("team_cd") 'response.write "--- "& arr(i,0) 'response.write "--- "& adors("ctt") 'response.write "--- "& adors("ctt_pre_mm") end if '//-- 월 비교(%) '//-- ctt/ctt_pre_mm*100 if( arr(i,0) = "mm_dif" )then if( adors("ctt_pre_mm") > 0 )then view_val = adors("ctt") / adors("ctt_pre_mm") else view_val = 0 end if if( view_val > 0 )then view_val = view_val * 100 end if 'response.write "--- "& arr(i,0) 'response.write "--- "& adors("ctt") 'response.write "--- "& adors("ctt_pre_mm") end if '//-- .올해 누적계약 arrvalC if( arr(i,0) = "ctt_add" )then for aw = 0 to Ubound(arrvalC) 'response.write aw&" - "& arrvalC(aw,0) 'response.write "--- "& adors("team_cd") &" - "& arrvalC(aw,0) &" - "& arrvalC(aw,1) if( trim(adors("team_cd")) = trim(arrvalC(aw,0)) )then 'response.write "***--- "& adors("team_cd") &" - "& arrvalC(aw,0) &" - "& arrvalC(aw,1) view_val_acc = arrvalC(aw,1) end if next 'response.write "--- "& adors("team_cd") 'response.write "--- "& arr(i,0) 'response.write "--- "& adors("ctt") 'response.write "--- "& adors("ctt_pre_mm") end if '//-- 누적 계약 비교 '//-- ctt_add/ctt_add_pre*100 if( arr(i,0) = "ctt_add_dif" )then if( adors("ctt_add_pre") > 0 )then view_val = adors("ctt_add") / adors("ctt_add_pre") else view_val = 0 end if if( view_val > 0 )then view_val = view_val * 100 end if 'response.write "--- "& arr(i,0) 'response.write "--- "& adors("ctt_add") 'response.write "--- "& adors("ctt_add_pre") end if '//-- 매출 목표 달성율 '//-- sales_goal/sales_pre_amount*100 if( arr(i,0) = "sales_goal_per" )then if( adors("sales_pre_amount") > 0 )then view_val = adors("sales_goal") / adors("sales_pre_amount") else view_val = 0 end if if( view_val > 0 )then view_val = view_val * 100 end if 'response.write "--- "& arr(i,0) 'response.write "--- "& adors("sales_goal") 'response.write "--- "& adors("sales_pre_amount") end if '//-- 올해 Vs.전년 '//-- sales_goal/sales_wip*100 if( arr(i,0) = "sales_year_dif" )then if( adors("sales_wip") > 0 )then view_val = adors("sales_goal") / adors("sales_wip") else view_val = 0 end if if( view_val > 0 )then view_val = view_val * 100 end if 'response.write "--- "& arr(i,0) 'response.write "--- "& adors("sales_goal") 'response.write "--- "& adors("sales_wip") end if '//----------------------------------------------------- '//-- subtotal, total select case i case "0": case "1": case else: if( arr(i,2) = "P" )then '--per는 저장된 데이터 자동 계산 view_val_acc = arr(i,2) else '//-- subtotal if( left(adors("subtotal_key"),2) = "st" )then subtotal_sum = 0 subtotal_gb = right(adors("subtotal_key"),1) for is_acc = 0 to ii if( subtotal_gb = arrSUMTT(is_acc) )then 'response.write "
** "& subtotal_gb &" - "& arrSUMTT(is_acc) &" "& arrSUM(is_acc,i) &" **" subtotal_sum = subtotal_sum + arrSUM(is_acc,i) end if next arrSUM(ii,i) = subtotal_sum view_val_acc = subtotal_sum end if '//-- total if( adors("subtotal_key") = "tt" )then subtotal_sum = 0 for is_acc = 0 to ii if( left(arrSUMTT(is_acc),2) <> "st" and arrSUMTT(is_acc) <> "tt" )then 'response.write "
** "& left(arrSUMTT(is_acc),2) &" - "& arrSUMTT(is_acc) &" "& arrSUM(is_acc,i) &" **" subtotal_sum = subtotal_sum + arrSUM(is_acc,i) end if next arrSUM(ii,i) = subtotal_sum view_val_acc = subtotal_sum end if end if end select '//----------------------------------------------------- 'Response.Write "IsNull(view_val_acc) : //"& view_val_acc &"// " & IsNull(view_val_acc) & "
" 'Response.Write "IsEmpty(view_val_acc) : " & IsEmpty(view_val_acc) & "
" 'Response.Write "len(view_val_acc) : " & len(view_val_acc) & "
" 'Response.Write "My_IsNumeric(view_val_acc) : " & My_IsNumeric(view_val_acc) & "
" if( len(view_val_acc) > 0 and My_IsNumeric(view_val_acc) = True )then view_val_acc = formatNumber(view_val_acc,0) end if 'response.write "*"& view_val_acc 'Response.Write "IsNull(view_val) : //"& view_val &"// " & IsNull(view_val) & "
" 'Response.Write "IsEmpty(view_val) : " & IsEmpty(view_val) & "
" if( arr(i,2) = "I" and IsNull(view_val) = False )then 'view_val = formatNumber(view_val,6) view_val = formatNumber(view_val,0) end if if( arr(i,2) = "P" and IsNull(view_val) = False )then 'view_val = formatNumber(view_val,6) &" %" 'view_val = formatNumber(view_val,2) &" %" view_val = formatNumber(view_val,0) &" %" end if '//-- 수동입력 아닌 부분은 hidden 'if( arr(i,3) = "F" )then ' tmp_input_type = "hidden" 'end if '//-- % 로 나오는 부분은 hidden if( arr(i,2) = "P" )then tmp_input_type = "hidden" end if %>
<%'=arrSUM(ii,i) &"
"%> <%=view_val %>
<% next %>
<% adors.MoveNext next '//-- 집계테이블 확인용 ''response.write "" ''for ii =0 to 30 '' for i = 0 to 17 '' response.write "" '' next '' response.write "" ''next '' ''response.write "" %>
<% adors.Close %>

<% query = "" query = query & " SELECT team_name, team_cd, p_subject "&VbCrlf query = query & " , p_total_cost , p_cont_cost "&VbCrlf query = query & " , CONVERT(varchar(10), p_input_dt, 120) p_input_dt "&VbCrlf query = query & " , CONVERT(varchar(10), p_decide_date, 120) p_decide_date "&VbCrlf query = query & " FROM T_PROJECT_BASE tpb "&VbCrlf query = query & " LEFT OUTER JOIN (SELECT team_cd, team_name, id AS tg_idx FROM TEAM_GROUP TG WHERE TG.div_use = '1' ) TG "&VbCrlf query = query & " ON p_depart_dep = team_cd "&VbCrlf 'query = query & " WHERE 1 = 1 and p_state = 'P' AND CONVERT(varchar(10), p_input_dt, 120) BETWEEN '"& tmp_sdate &"'AND '"& tmp_edate &"' "&VbCrlf query = query & " WHERE 1 = 1 and p_state = 'P' AND CONVERT(varchar(10), p_decide_date, 120) BETWEEN '"& tmp_sdate &"'AND '"& tmp_edate &"' "&VbCrlf query = query & " ORDER BY TG.tg_idx asc " 'Response.Write query & "
" adors.Open query, adoconn, adOpenStatic, adLockReadOnly if adors.RecordCount > 0 then sum_cont_cost = 0 For i = 1 To adors.RecordCount %> <% sum_cont_cost = sum_cont_cost + cdbl(adors("p_total_cost")) adors.MoveNext Next %> <% else %> <% end if adors.Close %>
전주 계약 프로젝트 리스트 ( <%=tmp_sdate %> ~ <%=tmp_edate %> )
부서 날짜 프로젝트명 금액
<%=adors("team_name") %> <%=adors("p_decide_date") %> <%=adors("p_subject") %> <%=formatnumber(adors("p_total_cost"),0) %>
합 계 합 계 <%=formatnumber(sum_cont_cost,0) %>
조회된 리스트가 없습니다
  <% query = "" query = query & " SELECT team_name, team_cd, p_subject "&VbCrlf query = query & " , p_total_cost , p_cont_cost "&VbCrlf query = query & " , CONVERT(varchar(10), p_input_dt, 120) p_input_dt "&VbCrlf query = query & " , CONVERT(varchar(10), p_decide_date, 120) p_decide_date "&VbCrlf query = query & " FROM T_PROJECT_BASE tpb "&VbCrlf query = query & " LEFT OUTER JOIN (SELECT team_cd, team_name, id AS tg_idx FROM TEAM_GROUP TG WHERE TG.div_use = '1' ) TG "&VbCrlf query = query & " ON p_depart_dep = team_cd "&VbCrlf query = query & " WHERE 1 = 1 "&VbCrlf 'query = query & " and p_state = 'P' "&VbCrlf '수주 query = query & " and p_state = 'K' "&VbCrlf '제안 'query = query & " AND CONVERT(varchar(10), p_input_dt, 120) >= '2021-01-01' "&VbCrlf ''query = query & " AND CONVERT(varchar(10), p_input_dt, 120) BETWEEN '"& tmp_sdate &"'AND '"& tmp_edate &"' "&VbCrlf query = query & " ORDER BY TG.tg_idx asc " 'Response.Write query & "
" adors.Open query, adoconn, adOpenStatic, adLockReadOnly if adors.RecordCount > 0 then sum_cont_cost = 0 For i = 1 To adors.RecordCount %> <% sum_cont_cost = sum_cont_cost + cdbl(adors("p_cont_cost")) adors.MoveNext Next %> <% else %> <% end if adors.Close %>
계약가능 프로젝트 리스트
부서 날짜 프로젝트명 제안금액
<%=adors("team_name") %> <%=adors("p_input_dt") %> <%=adors("p_subject") %> <%=formatnumber(adors("p_cont_cost"),0) %>
합 계 합 계 <%=formatnumber(sum_cont_cost,0) %>
조회된 리스트가 없습니다