문서 작성

<% '//-- 20210705 hwkim set rsc2 = server.CreateObject("ADODB.RECORDSET") web_position = "문서결재 : 문서작성" dim title dim Query dim tmpstr dim tmpstr2 dim i dim max_cnt '문서내용 테이블에서 원하는 문서를 가져온 갯수 dim Max_Width dim db_table_name dim Currdate dim sel_month Currdate = year(date) & "-" & zeroformat(month(date),2) & "-" & zeroformat(day(date),2) db_table_name = "문서내용" Max_Width =750 title=request("title") sel_month = request("sel_month") if trim(sel_month) = "" then sel_month = mid(date,1,7) end If tmp_button = "결재취소" tmp_btn_name = "approval/btn_approval_cancel" web_position = "문서결재 : 진행문서" x = "1" %>
※ 수당 지출결의서의 기존 입력 자료를 보여줍니다.
월별 보기  내근직 면접원
<% set adors2 = server.CreateObject("ADODB.RECORDSET") max_cnt = 0 i = 0 Dim total_pay, total_lunch, total_dinner total_pay = 0 total_lunch = 0 total_dinner = 0 Query = " select d_no, p_sn, pay_type, SUM(pay) as pay, isnull(SUM(lunch), 0) as lunch, isnull(SUM(dinner), 0) as dinner, sv " Query = Query & " from ( " Query = Query & " select isnull(A.attribute05,'') as d_no, p_sn, " Query = Query & " s_gubun, pay_type, LEFT(work_dt, 7) as work_dt, " Query = Query & " CASE WHEN s_gubun <> '추가수당1' and s_gubun <> '추가수당2' THEN isnull(SUM(s_sum), 0) ELSE 0 END as pay, " Query = Query & " CASE WHEN s_gubun = '추가수당1' THEN isnull(sum(s_sum), 0) END as lunch, " Query = Query & " CASE WHEN s_gubun = '추가수당2' THEN isnull(sum(s_sum), 0) END as dinner, " Query = Query & " p_sv_no as sv " Query = Query & " from (select tn.*, nw.in_time, nw.out_time, nw.p_sebu_code, nw.p_sv_no from T_NEAKEUN_PAY tn left outer join neakeun_work nw on tn.attribute01 = nw.id) as A " if sel_month = "2022-04" Then Query = Query & " where ((work_dt between '" & sel_month & "-01' and '" & sel_month & "-25' AND A.in_time + A.out_time + A.p_sebu_code <> '000000004') OR " Query = Query & " (work_dt between '" & sel_month & "-16' and cast(DATEADD(m,1,cast('" & sel_month & "-05' as date)) as varchar) " elseif sel_month > "2022-04" Then Query = Query & " where ((work_dt between cast(DATEADD(m,-1,cast('" & sel_month & "-26' as date))as varchar) and '" & sel_month & "-25' AND A.in_time + A.out_time + A.p_sebu_code <> '000000004') OR " Query = Query & " (work_dt between '" & sel_month & "-06' and cast(DATEADD(m,1,cast('" & sel_month & "-05' as date)) as varchar) " else Query = Query & " where ((LEFT(work_dt, 7) = '" & sel_month & "' AND A.in_time + A.out_time + A.p_sebu_code <> '000000004') OR " Query = Query & " (work_dt between '" & sel_month & "-16' and cast(DATEADD(m,1,cast('" & sel_month & "-15' as date)) as varchar) " end if Query = Query & " AND A.in_time + A.out_time + A.p_sebu_code = '000000004')) " If (Session("Depart_Code") = 12) or (Session("Depart_Code") = 17) And Session("teamplace") < 3 Then Query = Query & " and p_sv_no = '" & Session("User_Number") & "' " end if Query = Query & " group by A.attribute05, p_sn, s_gubun, pay_type, LEFT(work_dt, 7), p_sv_no " Query = Query & " ) as T " Query = Query & " group by d_no, p_sn, pay_type, sv " 'response.write Query adors.open Query, adoconn, adopenstatic, adlockreadonly If adors.recordCount > 0 Then For z = 1 To adors.recordCount max_cnt = max_cnt + 1 Dim approval_flag approval_flag = 1 If Trim(adoRs("d_no")) <> "" Then approval_flag = 0 End if %> <% Dim pay_apply_username pay_apply_username = "" query = "select p_name from person where p_no = '" & adoRs("sv") & "' " adors2.open query, adoconn, adopenstatic, adlockreadonly If adors2.recordCount > 0 Then pay_apply_username = adors2("p_name") End If adors2.close Dim document_no, document_status document_no = "" document_status = "" document_no = Trim(adoRs("d_no")) query = "SELECT * " query = query & " FROM 문서내용 as a " query = query & " INNER JOIN Document as b on a.문서번호 = b.d_no " query = query & " WHERE a.문서번호='" & document_no & "' " query = query & " AND b.d_delok = 'N' " rsc.Open query, adoConn, 1 if rsc.RecordCount > 0 Then If rsc("d_order_cnt") = "77" Then document_status = "결재완료" ElseIf rsc("d_order_cnt") = "99" Then document_status = "반려" Else document_status = "결재중" End If Else document_no = "" approval_flag = 1 End If rsc.close '//-- 20210705 hwkim Dim project_name_list : project_name_list = "" if adoRs("p_sn") = "99999" then tmp_value = tmp_value & "일반업무" Else if len(adoRs("p_sn") ) < 5 then '///========================= '///========================= '2013.1.2 김제열 추가 : 임시프로젝트를 올해뿐만 아니라 전해 것에서도 찾도록 함 ' 임시로 해야할지 말아야 할지 고민해야 함 query = "select * from project2_pre where p_sn_tmp = '" & adoRs("p_sn") & "'" & _ " and (substring(write_date, 1, 4) = '" & left(date(), 4) & "' " & _ " OR substring(write_date, 1, 4) = '" & left(date(), 4) - 1 & "') " 'Response.Write "query : " & query & "
" rsc2.Open query,adoconn,1 project_name_list = " ["& adoRs("p_sn") &"]  "& rsc2("p_subject_tmp") rsc2.Close elseif len(adoRs("p_sn") ) > 9 Then query = "select * from t_project_method where p_child_sn = '" & adoRs("p_sn") & "'" 'Response.Write "query : " & query & "
" rsc2.Open query,adoconn,1 project_name_list = " ["& adoRs("p_sn") &"]  "& rsc2("p_subject") rsc2.Close Else 'query = "select p_subject from V_PROJECT where p_sn = '" & rsc("p_sn") & "'" query = "select p_subject from V_PROJECT where p_sn = '" & adoRs("p_sn") & "'" 'Response.Write "query : " & query & "
" rsc2.Open query, adoConn, 1 If rsc2.RecordCount > 0 Then project_name_list = " ["& adoRs("p_sn") &"]  "& rsc2("p_subject") & ", " End if rsc2.Close end if end if %> <% total_pay = total_pay + CDbl(adoRs("pay")) total_lunch = total_lunch + CDbl(adoRs("lunch")) total_dinner = total_dinner + CDbl(adoRs("dinner")) %> <% adors.moveNext next End if adoRs.close max_cnt = max_cnt + 1 %>
선택 문서번호 담당자 수당구분 수당 추가수당1 추가수당2 문서상태
','<%=adoRs("p_sn")%>','<%=approval_flag%>', '<%=document_no%>','<%=adoRs("sv")%>');" id=radio4 name=radio4> <%=document_no %>     <%=project_name_list %> <%=pay_apply_username%> <% If adoRs("pay_type") = 1 then %> 내근직수당 <% Else %> 면접원수당 <% End if %> <%=FormatNumber(CDbl(adoRs("pay")), 0)%> <%=FormatNumber(CDbl(adoRs("lunch")), 0)%> <%=FormatNumber(CDbl(adoRs("dinner")), 0)%> <% If document_status = "결재중" Then %> <% Else %> <%=document_status%> <% End If %>
합계 <%=FormatNumber(total_pay, 0)%> <%=FormatNumber(total_lunch, 0)%> <%=FormatNumber(total_dinner, 0)%> <%=FormatNumber((total_pay+total_lunch+total_dinner), 0)%>



※ 면접원 & 내근직 수당 정보 컨펌 현황 입니다.
※ 컨펌하지 않은 데이터를 나타내며, 컨펌 하지 않은 데이터는 지출결의서 상에 포함되지 않습니다.
<% query = " select 1 as pay_type, date, A.p_child_sn, " query = query & " case when P.p_name is null then '담당자미정' else P.p_name end as p_name, COUNT(*) as count " query = query & " from neakeun_work as A " query = query & " left outer join person as P on A.p_sv_no = P.p_no " if sel_month = "2022-04" Then query = query & " where date between '"&sel_month&"-01' and '"&sel_month&"-25' " elseif sel_month > "2022-04" Then query = query & " where date between cast(DATEADD(m,-1,cast('"&sel_month&"-26' as date))as varchar) and '"&sel_month&"-25' " else query = query & " where date like '" & sel_month & "%' " end if query = query & " and (job_confirm_yn <> 'Y' or job_confirm_yn is null) " query = query & " and A.in_time + A.out_time <> '00000000' " query = query & " group by date, A.p_child_sn, P.p_name " query = query & " order by date " 'response.Write query adoRs.open query, adoconn, adopenstatic, adlockreadonly Dim project_apply_username Dim not_confirm_cnt Dim user_NotSeting_cnt not_confirm_cnt = 0 '##### 컨펌 'N' or is null의 갯수 (2018-02-26 김종휘) user_NotSeting_cnt = 0 If adors.recordCount > 0 Then For i = 1 To adors.recordCount project_apply_username = adoRs("p_name") Dim view_flag view_flag = True If (Session("Depart_Code") = 12 or Session("Depart_Code") = 17) And Session("teamplace") < 3 Then If project_apply_username <> session("loginuser") Then view_flag = false End If End If If view_flag = True Then not_confirm_cnt = not_confirm_cnt + 1 %> <% End if adors.moveNext next End if adoRs.close %>
번호 수당구분 수당 일자 프로젝트코드 컴펌 안된 갯수 담당자
<%=i%> <% If adoRs("pay_type") = 1 then %> 내근직수당 <% Else %> 면접원수당 <% End if %> <%=adoRs("date")%> <%=adoRs("p_child_sn")%> <%=adoRs("count")%> <%=project_apply_username%>