Files
KIN/approval/doc_expense_approval_depart_print.asp
Choins e0b87ee2ab 2026년 그룹운영비 임시예산 반영
- <식대와 교통비>, <회식비와 기타항목> 통합
 - 디지털서비스본부는 그룹별 예산이 아닌 본부예산으로 통합
2026-02-02 17:05:00 +09:00

388 lines
13 KiB
Plaintext

<!-- #include virtual = "lib/config.asp" -->
<%
dim Query
dim i,j
dim user_name(4) '현재 사용자,0:사원코드, 1:이름,2:직급,3:전화번호, 4:부서코드(명)
dim Max_Width
dim title
dim target_name '발급대상자 이름
dim Curr_date '오늘날짜
dim Company(6)
dim Gap()
dim krc_no
dim Max_length '입력가능 줄수정의
dim print_type '1:보기, 2:진짜프린트
dim db_table_name
dim depart_cost_type
dim cost_type(2) ''지출방법 구분
dim groupfeeArr : groupfeeArr = "[]"
cost_type(1) = "개인법인카드"
cost_type(2) = "현금/개인카드"
db_table_name = "문서내용"
title="부서비신청서"
Max_length = request("txt_Max_length")
if cint(Max_length) = 0 then
Max_length = 14
end if
depart_cost_type = request("depart_cost_type")
Max_Width =750
'//-- 20210428 hwkim
'redim gap(Max_length,4) 'x:순서, y:1:일자, 2:세부항목, 3:금액, 4:지출방법, (0,0) : 총액
redim gap(Max_length,6) 'x:순서, y:1:일자, 2:세부항목, 3:금액, 4:지출방법, 5:프로젝트, 6:세부항목, (0,0) : 총액
Curr_date = year(date) & "년 " & zeroformat(month(date),2) & "월 " & zeroformat(day(date),2) & "일"
dim use_cost
use_cost = request("use_cost")
set rsm = server.CreateObject("ADODB.RECORDSET")
''//===============
''회사 회사명, 사업자등록번호, 대표자명, 주소 가져오기
Query = "select * from company"
adoRs.open Query, adoconn,adopenstatic, adlockreadonly
Company(1) = adors("com_name")
Company(2) = adors("사업자등록번호")
Company(3) = adors("대표자명")
Company(4) = adors("주소")
Company(5) = adors("법인등록번호")
Company(6) = adors("회사대표전화번호")
adoRs.close
''///===============
''로그인 사용자 정보
user_name(0) = Session("User_Number")
'Query = "SELECT p_name, p_team_name, p_rank_name, p_tel3 FROM project2.dbo.V_Person WHERE p_no = '" & user_name(0) & "'"
Query = "SELECT p_name, CASE WHEN p_team_name IN ( '솔루션개발그룹','데이터분석그룹','온라인서베이운영그룹', '디지털COMM그룹') THEN '디지털서비스본부' ELSE p_team_name END AS p_team_name, p_rank_name, p_tel3 FROM project2.dbo.V_Person WHERE p_no = '" & user_name(0) & "'"
adoRs.open Query, adoconn,adopenstatic, adlockreadonly
user_name(1) = adoRs("p_name") '이름
user_name(2) = adoRs("p_rank_name") '직위 코드
user_name(3) = adoRs("p_tel3") '직통 전화
user_name(4) = adoRs("p_team_name") '부서코드
adoRs.close
''////////========================
''값가져오기
for i = 1 to Max_length
gap(i, 1) = request("txt_date")(i)
gap(i, 2) = request("txt_HangMok")(i)
gap(i, 3) = request("txt_cost")(i)
gap(i, 4) = trim(Request("cost_type")(i))
gap(i, 5) = request("txt_pjt")(i) '프로젝트
gap(i, 6) = request("txt_bigo")(i) '세부항목
next
print_type = request("print_type")
tmp_txt1 = request("tmp_txt1")
tmp_txt2 = request("tmp_txt2")
tmp_txt3 = request("tmp_txt3")
tmp_txt4 = request("tmp_txt4")
tmp_txt5 = request("tmp_txt5")
tmp_txt6 = request("tmp_txt6")
tmp_txt7 = request("tmp_txt7")
tmp_txt8 = request("tmp_txt8")
tmp_txt9 = request("tmp_txt9")
tmp_txt10 = request("tmp_txt10")
if cint(print_type) = 2 then
''문서번호 정보
Query = "select 문서번호 as krc_no from " & db_table_name
query = query & " where 문서제목 = '" & replace(title, " ", "") & "' "
query = query & " and substring(문서번호,5,4) = '" & year(date) & "' "
query = query & " order by 문서번호"
adoRs.open Query, adoconn,adopenstatic, adlockreadonly
if adoRs.recordcount <= 0 then
krc_no = 0
else
adoRs.movelast
tmpstr = split(trim(adoRs("krc_no")),"-")
krc_no = tmpstr(3)
end if
adoRs.close
krc_no = int(krc_no) + 1
tmpstr = "KRC-" & year(date) & "-"
tmpstr = tmpstr & "w-"
krc_no = tmpstr & ZeroFormat(krc_no,5)
target97 = user_name(1) & "^^" & user_name(2) & "^^" & user_name(3) & "^^" & user_name(4)
target98 = Company(1) & "^^" & Company(2) & "^^" & Company(3) & "^^" & Company(4) & "^^" & Company(5) & "^^" & Company(6)
'====================================================================
'관련항목 만들기
%>
<!-- #include file = "inc_payapproval.asp" -->
<!-- #include file = "inc_payapproval_line.asp" -->
<!-- #include file = "inc_preapproval.asp" -->
<%
target99 = tmp_txt1 & "^^" & tmp_txt2 & "^^" & tmp_txt3 & "^^" & tmp_txt4 & "^^" & tmp_txt5
target100 = tmp_txt6 & "^^" & tmp_txt7 & "^^" & tmp_txt8 & "^^" & tmp_txt9 & "^^" & tmp_txt10
'Document table에 삽입
query = "INSERT INTO Document "
query = query & " (d_no, d_name, d_write_name, d_write_date, d_flag, d_type, "
query = query & " d_order_cnt, d_orders,"
query = query & " d_order1, d_order2, d_order3, d_order4, d_order5, "
query = query & " d_order6, d_order7, d_order8, d_order9, d_order10, "
query = query & " d_view, d_delok) "
query = query & "VALUES "
query = query & " ('" & krc_no & "', '부서비신청서', '" & Session("loginuser") & "', '" & date() & "', '14', '" & d_type & "', "
query = query & " '" & d_order_cnt & "', '" & d_orders & "', "
query = query & " '" & d_order1 & "', '" & d_order2 & "', '" & d_order3 & "', '" & d_order4 & "', '" & d_order5 & "', "
query = query & " '" & d_order6 & "', '" & d_order7 & "', '" & d_order8 & "', '" & d_order9 & "', '" & d_order10 & "', "
query = query & " 'Y', 'N') "
'Response.Write query & "<BR>"
adoconn.execute query
'====================================================================
'//========================
'내용 저장하기
query = "insert into " & db_table_name & " (문서번호, 문서제목, "
for i=1 to Max_length
'if gap(i,4) <> "선택" then
if gap(i,3) <> "" then
query =query & "target" & trim(i) & ", "
end if
next
query = query & " target20, target21, "
query = query & " target29, target30,"
query = query & " target97, target98, target99, target100, "
query = query & " 발급일, 발급시각, login_p_no, login_이름, login_ip) values ( "
query = query & "'" & krc_no & "', "
query = query & "'" & replace(title, " ", "") & "', "
for i=1 to Max_length
'if gap(i,4) <> "선택" then
if gap(i,3) <> "" then
gap(i,3) = replace(gap(i,3),",","")
gap(i,3) = replace(gap(i,3),"\","")
'''''query = query & "'" & gap(i,1) & "^^일반업무 - 기타^^" & gap(i,2) & "^^" & gap(i,3) & "^^99999^^" & gap(i,4) & "', "
'//-- 5:프로젝트, 2:항목, 6:세부항목, 3: 금액
'query = query & "'" & gap(i,1) & "^^일반업무 - 기타^^" & gap(i,5) & "^^" & gap(i,2) & "^^" & gap(i,6) & "^^" & gap(i,3) & "^^99999^^" & gap(i,4) & "', "
query = query & "'" & gap(i,1) & "^^일반업무 - 기타^^" & gap(i,2) & "^^" & gap(i,3) & "^^99999^^" & gap(i,4) & "^^" & gap(i,5)& "^^" & gap(i,6) & "', "
end if
next
if depart_cost_type = "1" then ' 그룹활동비
query = query & " '팀' , "
Elseif depart_cost_type = "2" then ' 그룹장활동비
query = query & " '장' , "
end if
query = query & "'" & session("Depart_Code") & "' ,"
query = query & "'" & Max_length & "', "
query = query & "'0', "
query = query & "'" & target97 & "', "
query = query & "'" & target98 & "', "
query = query & "'" & target99 & "', "
query = query & "'" & target100 & "', "
query = query & "'" & year(date) & "-" & zeroformat(month(date),2) & "-" & zeroformat(day(date),2) & "', "
query = query & "'" & time() & "', "
query = query & "'" & user_name(0) & "', "
query = query & "'" & user_name(1) & "', "
query = query & "'" & Session("USERIP") & "') "
' Response.Write query & "<br>"
adoconn.execute query
''로그저장
query = "insert into " & db_table_name & "_log (문서번호, 문서제목, 대상자_p_no, 대상자_이름, 내용,"
query = query & " 발급일, 발급시각, 발급자_p_no, 발급자_이름, 발급자_ip) values ( "
query = query & "'" & krc_no & "', "
query = query & "'" & replace(title, " ", "") & "', "
query = query & "'" & user_name(0) & "', "
query = query & "'" & user_name(1) & "', "
query = query & "'" & replace(title, " ", "") & "인쇄', "
query = query & "'" & year(date) & "-" & zeroformat(month(date),2) & "-" & zeroformat(day(date),2) & "', "
query = query & "'" & time() & "', "
query = query & "'" & user_name(0) & "', "
query = query & "'" & user_name(1) & "', "
query = query & "'" & Session("USERIP") & "')"
adoconn.execute query
groupfeeArr = "["
for i=1 to Max_length
'if gap(i,4) <> "선택" then
if gap(i,3) <> "" then
groupfeeArr = groupfeeArr & "{"
groupfeeArr = groupfeeArr & """d_no"":""" & krc_no & ""","
groupfeeArr = groupfeeArr & """hangmok"":""target" & cstr(i) & ""","
groupfeeArr = groupfeeArr & """gubun"":""" & "그룹" & iif(depart_cost_type = "2", "장", "") & "활동비" & ""","
groupfeeArr = groupfeeArr & """cost_date"":""" & gap(i,1) & ""","
groupfeeArr = groupfeeArr & """p_cd"":""" & gap(i,5) & ""","
groupfeeArr = groupfeeArr & """p_hangmok"":""" & gap(i,2) & ""","
groupfeeArr = groupfeeArr & """contents"":""" & gap(i,6) & ""","
groupfeeArr = groupfeeArr & """cost"":""" & gap(i,3) & """"
groupfeeArr = groupfeeArr & "},"
end if
next
groupfeeArr = mid(groupfeeArr, 1, len(groupfeeArr)-1)
groupfeeArr = groupfeeArr & "]"
'''////======================
for i = 1 to Max_length
if trim(gap(i, 1)) <> "" then
gap(i, 1) = mid(gap(i, 1),1,4) & "년 " & mid(gap(i, 1),6,2) & "월 " & mid(gap(i, 1),9,2) & "일"
end if
for j=1 to 4
if trim(gap(i, j)) = "" then
gap(i, j) = "&nbsp;"
end if
next
next
end if'''if cint(print_type) = 2 then
%>
<script language=javascript>
var groupfeeArr = <%=groupfeeArr%>;
function win_close()
{
history.go(-1);
}
function subit()
{
var txt_Max_length = document.frm_money_clean.txt_Max_length.value;
var url = "doc_expense_approval_depart_print.asp";
url = url + "?txt_Max_length=" + txt_Max_length;
url = url + "&print_type=2";
url = url + "&depart_cost_type=" + document.frm_money_clean.depart_cost_type.value;
document.frm_money_clean.action = url;
document.frm_money_clean.submit();
}
function clsit()
{
alert('등록 되었습니다');
if(parent.group_dialog != undefined){
parent.prevGroupfeeArr = parent.prevGroupfeeArr.concat(groupfeeArr);
parent.group_dialog.dialog("close");
}else{
opener.location.reload();
window.close();
}
}
</script>
<%if cint(print_type) = 1 then%>
<script>
window.onload = function () { subit(); };
</script>
<% end if %>
<%if cint(print_type) = 2 then%>
<script>
window.onload = function () { clsit(); };
</script>
<% end if %>
<form method='post' name='frm_money_clean'>
<td>
<input type="hidden" name="cutmenu" value="1" />
<input type=hidden name="txt_Max_length" value="<%=Max_length%>">
<%for i=1 to Max_length%>
<input type=hidden name="txt_date" value="<%=gap(i,1)%>">
<input type=hidden name="txt_HangMok" value="<%=gap(i,2)%>">
<input type=hidden name="txt_cost" value="<%=gap(i,3)%>">
<input type=hidden name="cost_type" value="<%=gap(i,4)%>">
<input type=hidden name="txt_pjt" value="<%=gap(i,5)%>">
<input type=hidden name="txt_bigo" value="<%=gap(i,6)%>">
<%next%>
<input type=hidden name="txt_cost_sum" value="<%=gap(0,0)%>">
<input type=hidden name="depart_cost_type" value="<%=depart_cost_type%>">
<input type=hidden name="use_cost" value="<%=use_cost%>">
<%
tmp_txt = "<p style='line-height:11pt;font-size:9pt;'>" & Session("loginuser") & "<BR>" & replace(date(), "-","") & "<BR>" & FormatDateTime(time,4)
tmp_txt = Session("loginuser") & "<BR>" & replace(date(), "-","") & "<BR>" & Session("User_Number")
if my_pos = 6 then '사장
tmp_txt1 = "전결"
tmp_txt2 = "전결"
tmp_txt3 = "전결"
tmp_txt4 = "전결"
tmp_txt5 = tmp_txt
tmp_txt6 = "/"
tmp_txt7 = "/"
tmp_txt8 = "/"
tmp_txt9 = "/"
tmp_txt10 = month(now()) & " / " & day(now())
elseif my_pos = 5 then '임원
tmp_txt1 = "전결"
tmp_txt2 = "전결"
tmp_txt3 = "전결"
tmp_txt4 = tmp_txt
tmp_txt5 = " "
tmp_txt6 = "/"
tmp_txt7 = "/"
tmp_txt8 = "/"
tmp_txt9 = month(now()) & " / " & day(now())
tmp_txt10 = "/"
elseif my_pos = 3 or my_pos = 4 then '부서장
tmp_txt1 = "전결"
tmp_txt2 = "전결"
tmp_txt3 = tmp_txt
tmp_txt4 = " "
tmp_txt5 = " "
tmp_txt6 = "/"
tmp_txt7 = "/"
tmp_txt8 = month(now()) & " / " & day(now())
tmp_txt9 = "/"
tmp_txt10 = "/"
elseif my_pos = 2 then '팀장
tmp_txt1 = tmp_txt
tmp_txt2 = "전결"
tmp_txt3 = " "
tmp_txt4 = " "
tmp_txt5 = " "
tmp_txt6 = month(now()) & " / " & day(now())
tmp_txt7 = "/"
tmp_txt8 = "/"
tmp_txt9 = "/"
tmp_txt10 = "/"
elseif my_pos = 1 then '팀 팀원
tmp_txt1 = tmp_txt
tmp_txt2 = " "
tmp_txt3 = " "
tmp_txt4 = " "
tmp_txt5 = " "
tmp_txt6 = month(now()) & " / " & day(now())
tmp_txt7 = "/"
tmp_txt8 = "/"
tmp_txt9 = "/"
tmp_txt10 = "/"
else '노팀 팀원
tmp_txt1 = tmp_txt
tmp_txt2 = "전결"
tmp_txt3 = " "
tmp_txt4 = " "
tmp_txt5 = " "
tmp_txt6 = month(now()) & " / " & day(now())
tmp_txt7 = "/"
tmp_txt8 = "/"
tmp_txt9 = "/"
tmp_txt10 = "/"
end if
%>
<input type="hidden" name="tmp_txt1" value="<%=tmp_txt1%>">
<input type="hidden" name="tmp_txt2" value="<%=tmp_txt2%>">
<input type="hidden" name="tmp_txt3" value="<%=tmp_txt3%>">
<input type="hidden" name="tmp_txt4" value="<%=tmp_txt4%>">
<input type="hidden" name="tmp_txt5" value="<%=tmp_txt5%>">
<input type="hidden" name="tmp_txt6" value="<%=tmp_txt6%>">
<input type="hidden" name="tmp_txt7" value="<%=tmp_txt7%>">
<input type="hidden" name="tmp_txt8" value="<%=tmp_txt8%>">
<input type="hidden" name="tmp_txt9" value="<%=tmp_txt9%>">
<input type="hidden" name="tmp_txt10" value="<%=tmp_txt10%>">
</td>
</form>