Files
KIN/approval/doc_expense_print_2014.asp

909 lines
38 KiB
Plaintext

<!-- #include virtual = "lib/config.asp" -->
<OBJECT RUNAT=Server PROGID=ADODB.Recordset id=rsp></OBJECT>
<%
''//=====================
''//=====================
''2013년 9월 27일자로
' 지출 결의서에 입금결의서를 추가하여 2개문서를 같은 프로그램에서 구동
'' 구분은 titie와 title_type로 구분
''//=====================
''//=====================
set uploadform = Server.CreateObject("DEXT.FileUpload")
uploadform.Codepage = 949
dim doc_type : doc_type = "doc_expense_print_2014"
dim tmpstr
dim Query
dim i
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(17) '1:프로젝트 코드, 2:지출(입금)목적, 3:지출(입금)일자, 4:지출(입금)방법, 5:공급가액, 6:부가세액, 7:총액, 8:거래처, 9:프로젝트 코드, 10:품의서 문서번호, 17:지급일자
dim krc_no
dim print_type '1:보기, 2:진짜프린트
dim db_table_name
dim title_type
db_table_name = "문서내용"
if uploadform("title_type") = "지출" then
title="지 출 결 의 서"
else
title="입 금 결 의 서"
end if
title_type = mid(replace(title," ",""), 1, 2)
Max_Width =750
Curr_date = year(date) & "년 " & zeroformat(month(date),2) & "월 " & zeroformat(day(date),2) & "일"
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) & "'"
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
'연구인지 실사인지
p_depart = Session("Depart_Code")
d_cost_type = uploadform("d_cost_type")
''////////========================
''값가져오기
gap(1) = uploadform("p_subject") '프로젝트 명
gap(1) = replace(gap(1), "@NPER@", "&")
gap(2) = uploadform("expence_reason") '메모
gap(3) = uploadform("expence_date") '입금일자
gap(4) = uploadform("expence_way") '입금방법
gap(5) = uploadform("expence_money") '공급가액
gap(6) = uploadform("expence_vat") '부가세액
gap(7) = uploadform("expence_sum") '입금총액
gap(8) = uploadform("expence_company") '거래처
gap(9) = uploadform("p_sn") '프로젝트 번호
'gap(10) = uploadform("txt_d_no") '품의문서
gap(12) = uploadform("expence_num") '증빙번호
gap(13) = uploadform("expence_company_num") '거래처 사업자등록번호
gap(14) = uploadform("expence_item") '대표품목
gap(15) = uploadform("expence_taxtype") '세금구분
gap(16) = uploadform("k_company") '회사
gap(17) = uploadform("payment_date") '지급일자
print_type = uploadform("print_type")
p_child_sn = uploadform("p_child_sn") '자식프로젝트번호(조사방법에 따라 갈림, 실사만 가져옴)
hangmok = uploadform("hangmok") '비용항목
sebu = uploadform("sebu") '세부내용
est = uploadform("est") '직접비예산
act_sum = uploadform("act_sum") '누적집행금액
gab_cha = uploadform("gab_cha") '차액
d_krc_no = uploadform("d_krc_no") '반려되었던 문서번호
if gab_cha = "" then
gab_cha = "0"
end if
minus_expence_reason = uploadform("minus_expence_reason") '추가사유
''///===============
'조사방법 가져오기
query = " SELECT TPMC.p_method_nm, p_child_sn "
query = query & " FROM T_PROJECT_METHOD TPM "
query = query & " LEFT OUTER JOIN T_PROJECT_METHOD_CD TPMC ON TPM.p_method_cd = TPMC.p_method_cd "
query = query & " WHERE p_sn = '"& gap(9) &"' "
query = query & " AND TPM.p_child_sn = '"& p_child_sn &"' "
'Response.Write query
rsp.Open query, adoConn, 1
p_method_nm = rsp("p_method_nm")
rsp.close
'Response.Write "est : " & est & "<BR>"
tmp_txt1 = uploadform("tmp_txt1")
tmp_txt2 = uploadform("tmp_txt2")
tmp_txt3 = uploadform("tmp_txt3")
tmp_txt4 = uploadform("tmp_txt4")
tmp_txt5 = uploadform("tmp_txt5")
tmp_txt6 = uploadform("tmp_txt6")
tmp_txt7 = uploadform("tmp_txt7")
tmp_txt8 = uploadform("tmp_txt8")
tmp_txt9 = uploadform("tmp_txt9")
tmp_txt10 = uploadform("tmp_txt10")
'response.Write gap(1) &" ,"& gap(2) &" ,"& gap(3) &" ,"& gap(4) &" ,"& gap(5) &" ,"& gap(6) &" ,"& gap(7) &" ,"& gap(8) &" ,"& gap(9) &" ,"& gap(10)&" ,"& hangmok &" ,"& sebu
'response.Write tmp_txt1 &" ,"& tmp_txt2 &" ,"& tmp_txt3 &" ,"& tmp_txt4 &" ,"& tmp_txt5 &" ,"& tmp_txt6 &" ,"& tmp_txt7 &" ,"& tmp_txt8 &" ,"& tmp_txt9 &" ,"& tmp_txt10
'비용 항목 가져오기
'response.Write "hangmok : " & hangmok & "<br>"
if hangmok <> "" then
query = " SELECT d_cost_name "
query = query & " FROM direct_costcode "
query = query & " WHERE id = '"& hangmok & "'"
query = query & " AND d_cost_parents = '0' "
'response.Write "query : " & query & "<br>"
rsp.Open query, adoConn, 1
hangmok_name = rsp("d_cost_name")
rsp.close
end if
'세부내용 가져오기
if sebu <> "" then
query = " SELECT d_cost_name "
query = query & " FROM direct_costcode "
query = query & " WHERE id = '"& sebu & "'"
rsp.Open query, adoConn, 1
sebu_name = rsp("d_cost_name")
rsp.close
end if
%>
<!-- #include file = "inc_payapproval.asp" -->
<!-- #include file = "inc_payapproval_line.asp" -->
<!-- #include file = "inc_preapproval.asp" -->
<%
if( Request.ServerVariables("REMOTE_ADDR") = "10.10.13.81" or Request.ServerVariables("REMOTE_ADDR") = "10.10.13.115" )then
response.write "<br> d_orders = "& d_orders
response.write "<br> d_order_cnt = "& d_order_cnt
response.write "<br> my_pos = "& my_pos
response.write "<br> tmp_dcode = "& tmp_dcode(d_code, 1)
response.write "<br> d_order4 = "& tmp_ess(tmp_dcode(d_code, 1), 0)
response.write "<br> d_order5 = "& tmp_ess(0, 0)
end if
if cint(print_type) = 2 then
gap(9) = gap(9)&"," '프로젝트는 이제 한건만 오기때문에 ','가 오지 않는다. 기존코드를 살리기 위함
'먼저 지 출 결 의 서의 문서번호 생성
''///===============
''문서번호 정보
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) & "-"
if title_type = "지출" then
tmpstr = tmpstr & "i-"
else
tmpstr = tmpstr & "S-"
end if
krc_no = tmpstr & ZeroFormat(krc_no,5)
tmp_p_sn = split(gap(9),",")
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)
'====================================================================
'관련항목 만들기
'tmp_money = int(replace(gap(7), ",", "")) '지출(입금)총액
'Response.Write "gap(5) : "&gap(5)
tmp_money = int(replace(gap(5), ",", "")) '공급가액
gab_cha = int(replace(gab_cha, ",", "")) '차액
%>
<%
target99 = tmp_txt1 & "^^" & tmp_txt2 & "^^" & tmp_txt3 & "^^" & tmp_txt4 & "^^" & tmp_txt5
target100 = tmp_txt6 & "^^" & tmp_txt7 & "^^" & tmp_txt8 & "^^" & tmp_txt9 & "^^" & tmp_txt10
'//========================
'내용 저장하기
query = "insert into " & db_table_name & " (문서번호, 문서제목, target1, target2, target3, target4, target5, "
query = query & " target6, target7, target8, target9, target18, target19, remark20, target10, target11, target12, target13, target14, target15, target16, target17, target20, target97,target98,target99,target100,p_sn, 발급일, 발급시각, login_p_no, login_이름,login_ip,remark1,remark19) values ( "
query = query & "'" & krc_no & "', "
query = query & "'" & replace(title, " ", "") & "', "
query = query & "'" & gap(1) & "', " '프로젝트명(target1)
query = query & "'" & CheckWord(gap(2)) & "', "
query = query & "'" & gap(3) & "', " '입금일자(target3)
query = query & "'" & gap(4) & "', " '입금방법(target4)
query = query & "'" & tmp_money & "', " '공급가액(target5)
query = query & "'" & gap(6) & "', " '부가세액(target6)
query = query & "'" & gap(7) & "', " '입금총액(target7)
query = query & "'" & gap(8) & "', " '거래처(target8)
query = query & "'" & gap(10) & "', " '품의문서(target9)
query = query & "'" & gap(12) & "', " '증빙번호(target18)
query = query & "'" & gap(13) & "|" & gap(14) & "|" & gap(15) & "', " '거래처사업자번호|세금타입|품목(target19)
query = query & "'" & gap(16) & "', " '회사
query = query & "'" & p_child_sn & "', " '자식프로젝트번호(target10),(조사방법에 따라 갈림, 실사만 가져옴)
query = query & "'" & hangmok & "', " '비용항목(target11)
query = query & "'" & sebu & "', " '세부내용(target12)
query = query & "'" & est & "', " '직접비예산(target13)
query = query & "'" & act_sum & "', " '누적집행금액(target14)
query = query & "'" & gab_cha & "', " '차액(target15)
query = query & "'" & d_cost_type & "', " '실사 or 연구(target16)
query = query & "'" & minus_expence_reason & "', " '추가사유(target17)
query = query & "'" & p_child_sn & "', " '자식프로젝트번호(target20)
query = query & "'" & target97 & "', "
query = query & "'" & target98 & "', "
query = query & "'" & target99 & "', "
query = query & "'" & target100 & "', "
query = query & "'" & gap(9) & "', " '프로젝트 번호
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") & "', '3', "
query = query & "'" & gap(17) & "') " '지급일자(remark19)
'Response.Write query & "<br>"
adoconn.execute query
'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 & "', '" & title_type & "결의서', '" & Session("loginuser") & "', '" & date() & "', '10', '" & 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
'====================================================================
''날자를 '-'에서 년,월로 교체
gap(3) = mid(gap(3),1,4) & "년 " & mid(gap(3),6,2) & "월 " & mid(gap(3),9,2) & "일"
for i=1 to 9
if trim(gap(i)) = "" then
gap(i) = "&nbsp;"
end if
next
for i=5 to 7
if gap(i) = "&nbsp;" then
gap(i) = "0"
end if
next
'(2014-07-30) 결재가 올라가면 direct_cost 테이블의 act_sum에 바로 업데이트 시킴. 반려나 결재취소시에는 해당 금액만큼 뺄 것임.
query = " SELECT est_money, act_money "
query = query & " FROM direct_cost "
query = query & " WHERE del_yes_no = 'no' "
query = query & " AND cost_type = '"& d_cost_type &"' "
query = query & " AND p_child_sn = '"& p_child_sn &"' "
query = query & " AND hangmok = '"& hangmok&"' "
query = query & " AND sebu = ( "
query = query & " SELECT d_cost_name "
query = query & " FROM direct_costcode "
query = query & " WHERE id = '"& sebu &"' "
query = query & " ) "
' Response.Write query & "<BR>"
rsm.Open query, adoConn, 1
If rsm.recordCount > 0 Then
act_money = rsm("act_money") + tmp_money
cha_money = act_money - rsm("est_money")
rsm.close
query = " UPDATE direct_cost "
query = query & " SET act_money = '"& act_money &"' "
query = query & " ,cha_money = '"& cha_money &"' "
query = query & " WHERE del_yes_no = 'no' "
query = query & " AND cost_type = '"& d_cost_type &"' "
query = query & " AND p_child_sn = '"& p_child_sn &"' "
query = query & " AND hangmok = '"& hangmok&"' "
query = query & " AND sebu = ( "
query = query & " SELECT d_cost_name "
query = query & " FROM direct_costcode "
query = query & " WHERE id = '"& sebu &"' "
query = query & " ) "
'Response.Write query & "<BR>"
adoconn.execute query
Else
act_money = tmp_money
cha_money = 0 - tmp_money
rsm.close
query = " SELECT d_cost_name "
query = query & " FROM direct_costcode "
query = query & " WHERE id = '"& sebu & "' "
rsm.Open query, adoConn, 1
tmp_sebu = rsm("d_cost_name")
rsm.close
query = "insert into direct_cost ("
query = query & " p_sn, krc_no, p_subject, hangmok, sebu, "
query = query & " act_money, cha_money, "
query = query & " modify_date, modify_time, modify_user, modify_user_code, modify_ip, write_count,p_subject_group, p_sn_group, cost_type, p_child_sn"
query = query & " ) values ("
query = query & "'" & tmp_p_sn(0) & "', "
query = query & "'" & krc_no & "', "
query = query & "'" & gap(1) & "', "
query = query & "'" & hangmok & "', "
query = query & "'" & tmp_sebu & "', "
query = query & "'" & tmp_money & "', "
query = query & "'" & cha_money & "', "
query = query & "'" & date() & "',"
query = query & "'" & time() & "',"
query = query & "'" & session("loginuser") & "', "
query = query & "'" & session("user_number") & "', "
query = query & "'" & Request.ServerVariables("REMOTE_HOST") & "', "
query = query & "'" & 1 & "', "
query = query & "'" & p_subject_group & "', "
query = query & "'" & p_sn_group & "', '" & d_cost_type & "', '" & p_child_sn & "')"
'Response.Write query & "<BR>"
adoconn.execute query
End if
if d_krc_no <> "" then
query = ""
query = query & " UPDATE document "
query = query & " SET d_view = 'N' "
query = query & " WHERE d_no = '" & d_krc_no & "' "
adoconn.execute query
end if
if uploadform("doc_attach_file").count > 0 Then
Set fso = Server.CreateObject("Scripting.FileSystemObject")
for i=1 To uploadform("doc_attach_file").count
if fso.FolderExists(Server.Mappath("/") & "/Upload/DOC_ATTACH/" & krc_no) = False Then
fso.CreateFolder Server.Mappath("/") & "/Upload/DOC_ATTACH/" & krc_no
End If
fso.MoveFile Server.Mappath("/") & uploadform("doc_attach_file")(i), Server.Mappath("/") & "/Upload/DOC_ATTACH/" & krc_no & "/" & krc_no & "_" & Cstr(i) & ".jpg"
Next
Set fso = Nothing
End If
end if
%>
<html>
<head>
<title><%=GNB_TITLE%></title>
<link rel="stylesheet" type="text/css" href="/css/basic.css">
<style>
.attach_div{
display: flex;
width: 100%;
}
.attach_preview{
display: flex;
width: 15%;
height: 70px;
border: 1px solid #ccc;
box-shadow: 1px 1px 2px 1px #b9b9b9;
justify-content: center;
align-items: center;
cursor: pointer;
margin: 4px;
}
.attach_preview > img{
max-width: 100%;
max-height: 100%;
}
</style>
</head>
<script src="/js/jquery.min.js"></script>
<script src="/js/jquery-ajax-call.js"></script>
<script src="/js/jquery.form.min.js"></script>
<script language=javascript>
function win_close()
{
window.close();
}
function subit()
{
$("#subit_btn").css("display", "none");
if(!confirm("결재 요청하시겠습니까?")){
$("#subit_btn").css("display", "");
return;
}
var p_subject = document.frm_money.p_subject.value;
p_subject = p_subject.replace(/&/gi, '@NPER@');
document.frm_money.p_subject.value = p_subject;
var url = "doc_expense_print_2014.asp";
document.frm_money.action=url;
document.frm_money.submit();
}
function print_ie()
{
//
if(navigator.userAgent.toLowerCase().indexOf('chrome') > -1){ // Chrome Browser Detected?
window.PPClose = false; // Clear Close Flag
window.onbeforeunload = function(){ // Before Window Close Event
if(window.PPClose === false){ // Close not OK?
return 'Leaving this page will block the parent window!\nPlease select "Stay on this Page option" and use the\nCancel button instead to close the Print Preview Window.\n';
}
}
window.print(); // Print preview
window.PPClose = true; // Set Close Flag to OK.
}else{
window.print();
window.close();
}
}
function clsit()
{
alert('결재요청 되었습니다');
self.close();
opener.movePage();
}
//-->
</script>
<body topmargin="10" leftmargin="10" <%if cint(print_type) = 2 then%> onLoad="clsit();" <% end if %>>
<form method='post' name='frm_money' enctype='multipart/form-data'>
<input type=hidden name = "p_subject" value="<%=gap(1)%>">
<input type=hidden name = "expence_reason" value="<%=gap(2)%>">
<input type=hidden name = "expence_date" value="<%=gap(3)%>">
<input type=hidden name = "expence_way" value="<%=gap(4)%>">
<input type=hidden name = "expence_money" value="<%=gap(5)%>">
<input type=hidden name = "expence_vat" value="<%=gap(6)%>">
<input type=hidden name = "expence_sum" value="<%=gap(7)%>">
<input type=hidden name = "expence_num" value="<%=gap(12)%>">
<input type=hidden name = "expence_company" value="<%=gap(8)%>">
<input type=hidden name = "p_sn" value='<%=gap(9)%>'>
<input type=hidden name = "txt_d_no" value='<%=gap(10)%>'>
<input type=hidden name = "d_krc_no" value='<%=d_krc_no%>'>
<input type=hidden name = "expence_company_num" value='<%=gap(13)%>'>
<input type=hidden name = "expence_taxtype" value='<%=gap(14)%>'>
<input type=hidden name = "expence_item" value='<%=gap(15)%>'>
<input type=hidden name = "k_company" value='<%=gap(16)%>'>
<input type=hidden name = "payment_date" value='<%=gap(17)%>'>
<input type=hidden name = "p_child_sn" value="<%=p_child_sn%>">
<input type=hidden name = "d_cost_type" value="<%=d_cost_type%>">
<input type=hidden name = "hangmok" value="<%=hangmok%>">
<input type=hidden name = "sebu" value="<%=sebu%>">
<input type=hidden name = "est" value="<%=est%>">
<input type=hidden name = "act_sum" value="<%=act_sum%>">
<input type=hidden name = "gab_cha" value="<%=gab_cha%>">
<input type=hidden name = "minus_expence_reason" value="<%=minus_expence_reason%>">
<input type=hidden name = "title_type" value='<%=title_type%>'>
<input type=hidden name = "print_type" value='2'>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td colspan="2" style="padding:20;">
<table cellpadding="0" cellspacing="0" border="0">
<%if cint(print_type) = 1 then%>
<tr>
<td style="padding:0 0 5 0;">
<img src="/images/common/btn_approve.jpg" onClick="subit()" id="subit_btn" style="CURSOR:pointer;" title='결재신청'>
<img src="/images/common/btn_cancel.jpg" onClick="win_close();" style="CURSOR:pointer;">
</td>
</tr>
<%end if%>
<tr>
<td><img src="/images/approval/docbg_top.jpg"></td>
</tr>
<tr>
<td width="710" align="center" style="padding:10;border-left:1px solid #dedede;border-right:1px solid #dedede;">
<table width="95%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td colspan="2" style="padding:0 0 10 0">
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse;">
<tr>
<td width="255">
<%if title_type = "지출" then%>
<img src="/images/approval/doc_stit08.jpg">
<%else%>
<img src="/images/approval/doc_stit24.jpg">
<%end if%>
</td>
<td>
<table width="100%" cellpadding="0" cellspacing="1" border="0" style="border-collapse:collapse;" bgcolor="#d8d8d8">
<%if cdate(formatdatetime(date,2)) > "2014-01-07" then
tmp_title = "대표이사"
else
tmp_title = "부회장"
end if%>
<tr>
<td colspan="5" class="k_small" align="center" bgcolor="#F1F1F1">지출결의 검토/승인</td>
<td colspan="4" class="k_small" align="center" bgcolor="#F1F1F1">지급 검토/승인</td>
</tr>
<tr>
<td width="11%" class="k_small" align="center" bgcolor="#F1F1F1">기안자</td>
<td width="11%" class="k_small" align="center" bgcolor="#F1F1F1">팀장</td>
<td width="11%" class="k_small" align="center" bgcolor="#F1F1F1">그룹장</td>
<td width="11%" class="k_small" align="center" bgcolor="#F1F1F1">본부장</td>
<td width="11%" class="k_small" align="center" bgcolor="#F1F1F1"><%=tmp_title%></td>
<td width="11%" class="k_small" align="center" bgcolor="#F1F1F1">담당자</td>
<td width="11%" class="k_small" align="center" bgcolor="#F1F1F1">그룹장</td>
<td width="11%" class="k_small" align="center" bgcolor="#F1F1F1">본부장</td>
<td width="11%" class="k_small" align="center" bgcolor="#F1F1F1"><%=tmp_title%></td>
</tr>
<%
'my_pos = "3"
'Response.Write "my_pos : " & my_pos & "<BR>"
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 = 0 or 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 = "/"
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%>">
<tr height="35">
<td bgcolor="#FFFFFF" align="center" class="k_small"><%=tmp_txt1%>&nbsp;</td>
<td bgcolor="#FFFFFF" align="center" class="k_small"><%=tmp_txt2%>&nbsp;</td>
<td bgcolor="#FFFFFF" align="center" class="k_small"><%=tmp_txt3%>&nbsp;</td>
<td bgcolor="#FFFFFF" align="center" class="k_small"><%=tmp_txt4%>&nbsp;</td>
<td bgcolor="#FFFFFF" align="center" class="k_small"><%=tmp_txt5%>&nbsp;</td>
<td bgcolor="#FFFFFF" align="center" class="k_small"></td>
<td bgcolor="#FFFFFF" align="center" class="k_small"></td>
<td bgcolor="#FFFFFF" align="center" class="k_small"></td>
<td bgcolor="#FFFFFF" align="center" class="k_small"></td>
</tr>
<tr height="18">
<td bgcolor="#FFFFFF" align="center" class="k_small"><%=tmp_txt6%></td>
<td bgcolor="#FFFFFF" align="center" class="k_small"><%=tmp_txt7%></td>
<td bgcolor="#FFFFFF" align="center" class="k_small"><%=tmp_txt8%></td>
<td bgcolor="#FFFFFF" align="center" class="k_small"><%=tmp_txt9%></td>
<td bgcolor="#FFFFFF" align="center" class="k_small"><%=tmp_txt10%></td>
<td bgcolor="#FFFFFF" align="center" class="k_small">/</td>
<td bgcolor="#FFFFFF" align="center" class="k_small">/</td>
<td bgcolor="#FFFFFF" align="center" class="k_small">/</td>
<td bgcolor="#FFFFFF" align="center" class="k_small">/</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2" bgcolor="#d8d8d8" height="1"></td>
</tr>
<tr>
<td width="20%" style="padding:7 0 7 20"><b>결&nbsp;의&nbsp;일&nbsp;자</b></td>
<td width="80%" class="tahoma"><%=Curr_date%></td>
</tr>
<tr>
<td colspan="2" bgcolor="#d8d8d8" height="1"></td>
</tr>
<tr>
<td width="20%" style="padding:7 0 7 20"><b>성&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;명</b></td>
<td width="80%"><%=user_name(1)%></td>
</tr>
<tr>
<td colspan="2" bgcolor="#d8d8d8" height="1"></td>
</tr>
<tr>
<td width="20%" style="padding:7 0 7 20"><b>소&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;속</b></td>
<td width="80%"><%=user_name(4)%></td>
</tr>
<tr>
<td colspan="2" bgcolor="#d8d8d8" height="1"></td>
</tr>
<tr>
<td width="20%" style="padding:7 0 7 20"><b>직&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;급</b></td>
<td width="80%"><%=user_name(2)%></td>
</tr>
<tr>
<td colspan="2" bgcolor="#d8d8d8" height="1"></td>
</tr>
<tr>
<td colspan="2" align="center" style="padding:10 0 10 0;font-size:14;font-family:dotum;"><b>하기의 프로젝트(업무)와 관련하여, <%=title_type%>을 결의하오니 승인하여 주시기 바랍니다.</b></td>
</tr>
<tr>
<td colspan="2" align="center" style="padding:10 0 0 0">
<table width="100%" cellpadding="5" cellspacing="0" border="0" style="border-collapse:collapse;">
<tr>
<td width="20%" class="tit2" align="center">프로젝트 명(업무)</td>
<td width="30%" class="tit7"><font class="tahoma"><%=gap(1)%>- (<%=gap(9) %>)</font></td>
<td width="20%" class="tit2" align="center">조사방법</td>
<td width="30%" class="tit7"><font class="tahoma"><%=p_method_nm%></font></td>
</tr>
<tr>
<td width="20%" class="tit2" align="center">비용항목</td>
<td width="30%" class="tit7"><font class="tahoma"><%=hangmok_name%></font></td>
<td width="20%" class="tit2" align="center">세부내용</td>
<td width="30%" class="tit7"><font class="tahoma"><%=sebu_name%></font></td>
</tr>
<tr>
<td width="20%" class="tit2" align="center">증빙일자</td>
<td width="30%" class="tit7"><font class="tahoma"><%=gap(3)%></font></td>
<td width="20%" class="tit2" align="center">증빙서류</td>
<td width="30%" class="tit7"><font class="tahoma"><%=gap(4)%></font></td>
</tr>
<tr>
<td class="tit2" align="center">공급가액</td>
<td class="tit7"><font class="tahoma"> <%=gap(5)%> 원</font></td>
<td class="tit2" align="center" <% If gap(12) = "" Then %> rowspan="2" <% End If %>><%=title_type%>총액</td>
<td class="tit7" <% If gap(12) = "" Then %> rowspan="2" <% End If %>><font class="tahoma"> <%=gap(7)%> 원</font></td>
</tr>
<tr>
<td width="20%" class="tit2" align="center">부가세액</td>
<td width="30%" class="tit7"><font class="tahoma"> <%=gap(6)%> 원</font></td>
<% If gap(12) <> "" Then %>
<td width="20%" class="tit2" align="center">증빙번호</td>
<td width="30%" class="tit7"><font class="tahoma"> <a href='javascript:taxInvoiceView();'><%=gap(12)%></a></font></td>
<% End If %>
</tr>
<tr>
<td class="tit2" align="center">거래처</td>
<td class="tit7"><font class="tahoma"><%=gap(8)%></font></td>
<td class="tit2" align="center">입금계좌</td>
<td class="tit7"><font class="tahoma">
<%if trim(gap(4)) = "세금계산서" then
Response.Write "첨부파일 참조"
else
Response.Write "해당 없음"
end if%>
</font></td>
</tr>
<tr>
<td width="20%" class="tit2" align="center">지급일자</td>
<td width="30%" class="tit7" colspan="3"><font class="tahoma"><%=gap(17)%></font></td>
</tr>
<% if cint(print_type) = 1 then %>
<tr>
<td class="tit2" align="center">증빙첨부</td>
<td colspan="3" class="tit7">
<div class="attach_div">
<% if uploadform("doc_attach")(1) <> "" Then %>
<%
set objImage = Server.CreateObject("DEXT.ImageProc")
objImage.AutoMakeFolder = True
For i=1 To uploadform("doc_attach").count
if true = objImage.SetSourceFile(uploadform("doc_attach")(i).TempFilePath) then
tmpFileName = "\Upload\DOC_ATTACH\tmp\" & date_time() & "_" & Session("User_Number") & "_" & Cstr(i) & ".jpg"
thumb_image = objImage.SaveasThumbnail(Server.MapPath("/") & tmpFileName, objImage.ImageWidth, objImage.ImageHeight, false)
%>
<input type="hidden" name="doc_attach_file" value="<%=tmpFileName%>" />
<div class="attach_preview">
<img src="<%=tmpFileName%>" />
</div>
<%
End If
Next
Set objImage = Nothing
%>
<% End If %>
</div>
</td>
</tr>
<% End If %>
</table>
</td>
</tr>
<tr>
<td colspan="2" align="center" style="padding:10 0 0 0">
<table width="100%" cellpadding="5" cellspacing="0" border="0" style="border-collapse:collapse;">
<tr class="expenseTotal">
<td width="20%" class="tit2" align="center">직접비 예산</td>
<td width="30%" class="tit7"><font class="tahoma"><%=est%>원</font></td>
<td width="20%" class="tit2" align="center">누적 집행 금액</td>
<td width="30%" class="tit7"><font class="tahoma"><%=act_sum%></font>원</td>
</tr>
<tr class="expenseTotal">
<td width="20%" class="tit2" align="center">집행 시 잔액</td>
<td width="30%" class="tit7"><font class="tahoma"><%=gab_cha%>원 </font></td>
<td colspan='2' width="50%" class="tit2" align="left">([잔액] = [직접비 예산] - [누적집행금액] - [공급가액])</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2" align="center" style="padding:10 0 0 0">
<table width="100%" cellpadding="5" cellspacing="0" border="0" style="border-collapse:collapse;">
<tr>
<td width="20%" class="tit2" align="center">비 고 (메모)</td>
<td width="80%" class="tit7"><font class="tahoma"><%=ViewWord(gap(2))%></font></td>
</tr>
</table>
</td>
</tr>
<tr class="expenseTotal">
<td colspan="2" align="center" style="padding:10 0 0 0">
<table width="100%" cellpadding="5" cellspacing="0" border="0" style="border-collapse:collapse;">
<tr>
<td width="20%" class="tit2" align="center">추가 사유</td>
<td width="80%" class="tit7"><font class="tahoma"><%=ViewWord(minus_expence_reason)%></font></td>
</tr>
</table>
</td>
</tr>
<%
if gap(10) <> "" then
%>
<tr>
<td colspan="2" align="center" style="padding:10 0 0 0">
<table width="100%" cellpadding="5" cellspacing="0" border="0" style="border-collapse:collapse;">
<tr>
<td width="20%" class="tit2" align="center">품의문서</td>
<td width="80%" class="tit7"><font class="tahoma"><%=gap(10)%></font></td>
</tr>
</table>
</td>
</tr>
<%
end if
%>
<tr>
<td colspan="2" style="padding:20 0 0 0" align="right">
<pre><font class="tahoma"> 영 수 일 자 : 년 월 일</font></pre>
<pre><font class="tahoma"> 영 수 자 : (印)</font></pre>
</td>
</tr>
<tr>
<td colspan="2" align="center" style="padding:15 0 5 0"><!-- #include virtual= "approval/inc_logo.asp" --></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><img src="/images/approval/docbg_btm.jpg"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<script>
var ntsUrl = "";
var ntsNum = "<%=gap(12)%>";
$(document).ready(function (){
var d_cost_type = "<%=d_cost_type%>";
if(d_cost_type == "support"){
$(".expenseTotal").css("display", "none");
}
$(document).on("click", ".attach_preview", function(){
window.open($(this).children("img").attr("src"), "_blank", "popup=1");
})
taxInvoicePopup();
});
function taxInvoicePopup(){
if(ntsNum != ""){
ajaxCallJson("/barobill/baro_api.asp", {"command":"GetTaxInvoicePopUpURLNK", "NTSConfirmNum":ntsNum, "Company":"kri"}, "", "POST", "taxInvoiceUrl()");
ajaxCallJson("/barobill/baro_api.asp", {"command":"GetTaxInvoicePopUpURLNK", "NTSConfirmNum":ntsNum, "Company":"krc"}, "", "POST", "taxInvoiceUrl()");
ajaxCallJson("/barobill/baro_api.asp", {"command":"GetTaxInvoicePopUpURLNK", "NTSConfirmNum":ntsNum, "Company":"krd"}, "", "POST", "taxInvoiceUrl()");
}
}
function taxInvoiceUrl(){
if(ajaxResponse != "-21002"){
ntsUrl = ajaxResponse;
<% if print_type = "1" Then %>
createTaxImage();
<% End If %>
}
}
function taxInvoiceView(){
if(ntsUrl != ""){
window.open(ntsUrl, "", "left=150, top=150, menubar=no, location=no, status=no, toolbar=no, width=960, height=800, scrollbars=yes ,resizable=no");
}else{
alert("전자세금계산서 번호가 아닙니다.\n종이세금계산서인 경우에는 첨부한 이미지를 확인하시기 바랍니다.");
}
}
function createTaxImage(){
$("body").append("<iframe id='taxIframe' style='visibility:hidden;width: 0;height: 0;' src=''></iframe>");
$("#taxIframe").attr("src", "/barobill/convImg/createTaxImg.asp"+"?ntsurl="+encodeURIComponent(ntsUrl)+"&ntsnum="+ntsNum);
}
</script>
</body>
</html>
<%
set uploadform = nothing
%>