Files
KIN/ess/doc_prepayment2_ex_print.asp
2025-09-29 17:55:08 +09:00

607 lines
20 KiB
Plaintext

<!-- #include virtual = "lib/config.asp" -->
<%
dim tmpstr
dim Query
dim i, j
dim user_name(4) '현재 사용자,0:사원코드, 1:이름,2:직급,3:전화번호, 4:부서코드(명)
dim Max_Width
dim title
dim Curr_date '오늘날짜
dim Company(6)
dim krc_no '정산서의 문서번호
dim krc_no_estimate '가지급금지출결의서의 문서번호
dim gap(16)
dim gap_real(63)
dim print_type
dim tabindex
dim db_table_name
d_no = request("d_no")
x = request("x")
krc_no = d_no
print_type = request("print_type")
view_chk= request("view_chk")
db_table_name = "문서내용"
title="가지급금정산"
Max_Width =750
Curr_date = year(date) & "년 " & month(date) & "월 " & day(date) & "일"
query = "SELECT * "
query = query & "FROM 문서내용 as a "
query = query & " INNER JOIN Document as b on a.문서번호 = b.d_no "
query = query & "WHERE a.문서번호='" & d_no & "' "
if x = "99" then
else
query = query & " AND b.d_delok = 'N' "
end if
'Response.Write query &"<BR>"
rsc.Open query, adoConn, 1
if rsc.RecordCount > 0 then
tmp_date = split(rsc("d_write_date"), "-")
Curr_date = tmp_date(0) & "년 " & tmp_date(1) & "월 " & tmp_date(2) & "일"
tmp_0 = split(rsc("target97"), "^^")
user_name(0) = rsc("login_p_no") '사번
user_name(1) = tmp_0(0) '이름
user_name(2) = tmp_0(1) '직위 코드
user_name(3) = tmp_0(2) '직통 전화
user_name(4) = tmp_0(3) '부서코드
tmp_00 = split(rsc("target98"), "^^")
Company(1) = tmp_00(0)
Company(2) = tmp_00(1)
Company(3) = tmp_00(2)
Company(4) = tmp_00(3)
Company(5) = tmp_00(4)
Company(6) = tmp_00(5)
tmp_7 = split(rsc("target99"), "^^")
tmp_8 = split(rsc("target100"), "^^")
if instr(1,tmp_7(0), "반려") then
tmp_txt1 = tmp_7(0)
elseif instr(1,tmp_7(0), "<BR>") then
tmp_t1 = split(tmp_7(0), "<BR>")
tmp_txt1 = "<img src='/images/sign/" & tmp_t1(0) & "_" & tmp_t1(2) & ".jpg' border=0 width=40 height=40>"
else
tmp_txt1 = tmp_7(0)
end if
if instr(1,tmp_7(1), "반려") then
tmp_txt2 = tmp_7(1)
elseif instr(1,tmp_7(1), "<BR>") then
tmp_t2 = split(tmp_7(1), "<BR>")
tmp_txt2 = "<img src='/images/sign/" & tmp_t2(0) & "_" & tmp_t2(2) & ".jpg' border=0 width=40 height=40>"
else
tmp_txt2 = tmp_7(1)
end if
if instr(1,tmp_7(2), "반려") then
tmp_txt3 = tmp_7(2)
elseif instr(1,tmp_7(2), "<BR>") then
tmp_t3 = split(tmp_7(2), "<BR>")
tmp_txt3 = "<img src='/images/sign/" & tmp_t3(0) & "_" & tmp_t3(2) & ".jpg' border=0 width=40 height=40>"
else
tmp_txt3 = tmp_7(2)
end if
if instr(1,tmp_7(3), "반려") then
tmp_txt4 = tmp_7(3)
elseif instr(1,tmp_7(3), "<BR>") then
tmp_t4 = split(tmp_7(3), "<BR>")
tmp_txt4 = "<img src='/images/sign/" & tmp_t4(0) & "_" & tmp_t4(2) & ".jpg' border=0 width=40 height=40>"
else
tmp_txt4 = tmp_7(3)
end if
if instr(1,tmp_7(4), "반려") then
tmp_txt5 = tmp_7(4)
elseif instr(1,tmp_7(4), "<BR>") then
tmp_t5 = split(tmp_7(4), "<BR>")
tmp_txt5 = "<img src='/images/sign/" & tmp_t5(0) & "_" & tmp_t5(2) & ".jpg' border=0 width=40 height=40>"
else
tmp_txt5 = tmp_7(4)
end if
if instr(1,tmp_7(5), "반려") then
tmp_txt6 = tmp_7(5)
elseif instr(1,tmp_7(5), "<BR>") then
tmp_t6 = split(tmp_7(5), "<BR>")
tmp_txt6 = "<img src='/images/sign/" & tmp_t6(0) & "_" & tmp_t6(2) & ".jpg' border=0 width=40 height=40>"
else
tmp_txt6 = tmp_7(5)
end if
tmp_txt7 = tmp_8(0)
tmp_txt8 = tmp_8(1)
tmp_txt9 = tmp_8(2)
tmp_txt10 = tmp_8(3)
tmp_txt11 = tmp_8(4)
tmp_txt12 = tmp_8(5)
gap(1) = rsc("target1")
gap(2) = rsc("target2")
gap(3) = rsc("target3")
gap(4) = rsc("target4")
gap(5) = rsc("target5")
gap(6) = rsc("target6")
gap(7) = ViewWord(rsc("target7"))
gap(8) = rsc("target8")
gap(9) = rsc("target9")
gap(10) = rsc("target10")
gap(11) = ViewWord(rsc("target11"))
gap(16) = rsc("target17")
tmpstr = split(rsc("target12"),"^^")
for i=0 to ubound(tmpstr)
gap_real(i) = tmpstr(i)
'Response.Write i & " => " & gap_real(i) & "'<br>"
next
tmpstr = split(rsc("target13"),"^^")
for i=0 to ubound(tmpstr)
gap_real(i+24) = tmpstr(i)
' Response.Write i & " => " & gap_real(i) & "'<br>"
next
tmpstr = split(rsc("target14"),"^^")
for i=0 to ubound(tmpstr)
gap_real(i+36) = tmpstr(i)
' Response.Write i & " => " & gap_real(i) & "'<br>"
next
tmpstr = split(rsc("target15"),"^^")
'Response.Write ubound(tmpstr) & "<BR>"
for i=0 to ubound(tmpstr)
gap_real(i+59) = tmpstr(i)
'Response.Write i+59 & " => " & gap_real(i+59) & "'<br>"
next
d_order_cnt = int(rsc("d_order_cnt"))
%>
<html>
<head>
<title><%=GNB_TITLE%></title>
<link rel="stylesheet" type="text/css" href="/css/basic.css">
<script language="javascript" src="/js/common.js"></script>
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
</head>
<script language=javascript>
function win_close()
{
window.close();
}
function win_print(){
var txt_date_1 = document.ess.txt_date_1.value;
if (allTrim(txt_date_1) == ""){
alert("정산일자를 기록하세요");
document.ess.txt_date_1.focus();
return false;
}
var url = "doc_prepayment2_ex_print.asp";
url = url + "?txt_date_1=" + txt_date_1;
url = url + "&krc_no_estimate=" + document.ess.krc_no_estimate.value;
url = url + "&print_type=2";
document.ess.action=url;
document.ess.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();
}
function subit(a, b)
{
var tmp_txt;
var approve_pass;
if (a == 1)
{
tmp_txt = "부재자 ";
approve_pass = 1;
}
else
{
tmp_txt = "";
}
if (confirm(tmp_txt + "승인을 하시겠습니까?"))
{
document.ess.action = "allow_ok.asp?approve_pass="+approve_pass;
document.ess.action = "allow_ok.asp?approve_pass="+approve_pass+"&tmp_pass_psn="+b+"&title="+"<%=replace(title," ","")%>";
document.ess.submit();
}
}
function backit(a)
{
alert("사유를 작성해 주세요");
var url = "reason.asp?d_no="+a;
window.open(url,'','left=0,top=0,width=400,height=150,scrollbars=yes,resizable=yes')
}
//-->
</script>
<body topmargin="10" leftmargin="10" <%if cint(print_type) = 2 then%> onLoad="print_ie();" <% end if %>>
<form method='post' name='ess'>
<input type="hidden" name="d_no" value="<%=d_no%>">
<%if x = "99" then%>
<!-- #include file = "inc_delreason.asp" -->
<%end if '''if x = "99" then%>
<%
if cint(print_type) <> 2 and (d_order_cnt = "99" or d_order_cnt = "77") and (tmp_admin_chk = "1" or tmp_request_chk = "1" or int(rsc("login_p_no")) = int(Session("User_Number"))) then
%>
<!-- #include file = "inc_print.asp" -->
<%end if%>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td colspan="2" style="padding:20;">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td><img width = "100%" 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="5" style="padding:0 0 10 0">
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse;">
<tr>
<td width="255"><img src="/images/approval/doc_stit13_4.jpg"></td>
<td>
<!-- #include file = "inc_approval2.asp" -->
</td>
</tr>
</table>
</td>
</tr>
<tr height="24">
<td align="center" colspan="5" style="font-size:12px;">가지급금 정산 내역서</td>
</tr>
<tr height="25">
<td width="15%" align="center" class='tit2'>지급처</td>
<td width="35%" class='tit7'>
<font class="tahoma">
<%=gap(1)%>
<%tmpstr = split(gap(2),"-")%>
Tel.
<%=tmpstr(0)%> - <%=tmpstr(1)%> - <%=tmpstr(2)%>
</font>
</td>
<td width="15%" align="center" class='tit2' rowspan="4">가지급금 내역</td>
<td width="35%" align="center" class='tit7' rowspan="4">
<%=ViewWord(gap(7))%>&nbsp;
</td>
</tr>
<tr height="25">
<td width="15%" align="center" class='tit2'>지급처 담당자</td>
<td width="35%" class='tit7'>
<font class="tahoma">
<%=gap(3)%>
</font>
</td>
</tr>
<tr height="25">
<td width="15%" align="center" class='tit2'>지급일자</td>
<td width="35%" class='tit7'>
<font class="tahoma">
<%=gap(4)%>
</font>
</td>
</tr>
<tr height="25">
<td width="15%" align="center" class='tit2'>정산 예정일</td>
<td width="35%" class='tit7'>
<font class="tahoma">
<%=gap(5)%>
</font>
</td>
</tr>
<tr height="25">
<td width="15%" align="center" class='tit2'>지출사유</td>
<td width="35%" class='tit7'>
<font class="tahoma">
<%=gap(6)%>
</font>
</td>
<td width="15%" align="center" class='tit2'>계</td>
<td width="35%" class='tit7' align="right">
<font class="tahoma">
<%=gap(8)%> 원
</font>
</td>
</tr>
<%
'----------------------------------------------------------------------------------------
'### 프로젝트명에 해당하는 직접비가 있다면 링크함 - 2010년 1월 26일 수정
query = "SELECT * "
query = query & "FROM Document a "
query = query & " INNER JOIN 문서내용 b on a.d_no = b.문서번호 "
query = query & "WHERE a.d_delok = 'N' "
query = query & " AND a.d_name = '직접비' "
query = query & " AND b.p_sn = '" & rsc("p_sn") & "' "
'Response.Write query & "<BR>"
adoRs.open query, adoConn, 1
'Response.Write "adoRs.recordcount : " & adoRs.recordcount & "<BR>"
if adoRs.recordcount > 0 then
'tmp_link = " - <a href='direct_cost_print.asp?p_sn=" & rsc("p_sn") & "' target='_blank' class='blue'>직접비 보기</a>"
tmp_link = "<a href='direct_cost_print.asp?p_sn=" & rsc("p_sn") & "' target='_blank' class='blue'><img src='/images/approval/btn_directcost_view.jpg' align='absmiddle' style='CURSOR:pointer;'></a>"
else
tmp_link = ""
end if
adoRs.close
'----------------------------------------------------------------------------------------
%>
<tr height="25">
<td width="15%" align="center" class='tit2'>프로젝트</td>
<td width="35%" class='tit7'>
<font class="tahoma">
<%=gap(16)%>(<%=rsc("p_sn")%>)&nbsp;<%=tmp_link%>
</font>
</td>
<td width="15%" align="center" class='tit2'>부가세액</td>
<td width="35%" class='tit7' align="right">
<font class="tahoma">
<%=gap(9)%> 원
</font>
</td>
</tr>
<tr height="25">
<td width="15%" align="center" class='tit2'>지출 발의자</td>
<td width="35%" class='tit7' align="center">
<font class="tahoma">
<%=user_name(1)%>
</font>
</td>
<td width="15%" align="center" class='tit2'>가지급 합계액</td>
<td width="35%" class='tit7' align="right">
<font class="tahoma">
<%=gap(10)%> 원
</font>
</td>
</tr>
</table>
<input type="hidden" name=txt_target08 value="<%=replace(ViewWord(gap(11)),"<br>",chr(13))%>">
<table width="95%" cellpadding="3" cellspacing="0" border="0" style="border-collapse:collapse;">
<tr height="15">
<td align="center" class='tit2' colspan="4" style="font-size:12px;">세 부 정 산 내 역 (진 행 비)</td>
</tr>
<tr>
<%
tabindex = 10
for i=1 to 2 '사례비, 운반비
tabindex = tabindex + 1
%>
<td width="15%" align="center" class='tit7'><input type=text readonly value="<%=gap_real(tabindex-11)%>" size="15" id=text1 name=text1></td>
<%tabindex = tabindex + 1%>
<td width="35%" class='tit7' align="center">
<input type=text name="txt_target<%=zeroformat(tabindex,2)%>" OnKeyup="OnlyNumber(this);check_comma();" value="<%=gap_real(tabindex-11)%>" tabindex="<%=tabindex%>">&nbsp;원
</td>
<%
next
%>
</tr>
<%for i=1 to 3%>
<tr>
<%for j=(i-1) * 2+3 to (i-1) * 2+4 '임대료부터 우편료까지
tabindex = tabindex + 1'%>
<td width="15%" align="center" class='tit7'><input type=text readonly value="<%=gap_real(tabindex-11)%>" size="15" id=text2 name=text2></td>
<%tabindex = tabindex + 1%>
<td width="35%" class='tit7' align="center">
<input type=text name="txt_target<%=zeroformat(tabindex,2)%>" OnKeyup="OnlyNumber(this);check_comma();" value="<%=gap_real(tabindex-11)%>" tabindex="<%=tabindex%>">&nbsp;원
</td>
<%next%>
</tr>
<%next%>
<%for i=4 to 5%>
<tr>
<%for j=(i-1) * 2+3 to (i-1) * 2+4 '여분4개
tabindex = tabindex + 1'%>
<td width="15%" align="center" class='tit7'><input type=text value="<%=gap_real(tabindex-11)%>" size="15" name='txt_target<%=zeroformat(tabindex,2)%>'></td>
<%tabindex = tabindex + 1'%>
<td width="35%" class='tit7' align="center">
<input type=text name="txt_target<%=zeroformat(tabindex,2)%>" OnKeyup="OnlyNumber(this);check_comma();" value="<%=gap_real(tabindex-11)%>" tabindex="<%=tabindex%>">&nbsp;원
</td>
<%next%>
</tr>
<%next%>
<tr height="15">
<td align="center" class='tit2' colspan="4" style="font-size:12px;">세 부 정 산 내 역 (출 장 비)</td>
</tr>
<tr>
<%
for i=13 to 14 '항공료부터 교통비까지
tabindex = tabindex + 1
%>
<td width="15%" align="center" class='tit7'><input type=text readonly value="<%=gap_real(tabindex-11)%>" size="15" id=text3 name=text3></td>
<%tabindex = tabindex + 1%>
<td width="35%" class='tit7' align="center">
<input type=text name="txt_target<%=zeroformat(tabindex,2)%>" OnKeyup="OnlyNumber(this);check_comma();" value="<%=gap_real(tabindex-11)%>" tabindex="<%=tabindex%>">&nbsp;원
</td>
<%
next
%>
</tr>
<%for i=7 to 8%>
<tr>
<%for j=(i-1) * 2+3 to (i-1) * 2+4 '숙바료 부터 기타까지
tabindex = tabindex + 1'%>
<td width="15%" align="center" class='tit7'><input type=text readonly value="<%=gap_real(tabindex-11)%>" size="15" id=text4 name=text4></td>
<%tabindex = tabindex + 1'%>
<td width="35%" class='tit7' align="center">
<input type=text name="txt_target<%=zeroformat(tabindex,2)%>" OnKeyup="OnlyNumber(this);check_comma();" value="<%=gap_real(tabindex-11)%>" tabindex="<%=tabindex%>">&nbsp;원
</td>
<%next%>
</tr>
<%next%>
<tr height="15">
<td align="center" class='tit2' colspan="4" style="font-size:12px;">세 부 정 산 내 역 (기 타)</td>
</tr>
<tr>
<%
for i=19 to 20
tabindex = tabindex + 1
%>
<td width="15%" align="center" class='tit7'><input type=text value="<%=gap_real(tabindex-11)%>" size="15" name='txt_target<%=zeroformat(tabindex,2)%>' tabindex="<%=tabindex%>"></td>
<%tabindex = tabindex + 1%>
<td width="35%" class='tit7' align="center">
<input type=text name="txt_target<%=zeroformat(tabindex,2)%>" OnKeyup="OnlyNumber(this);check_comma();" value="<%=gap_real(tabindex-11)%>" tabindex="<%=tabindex%>">&nbsp;원
</td>
<%
next
%>
</tr>
<%for i=10 to 11%>
<tr>
<%for j=(i-1) * 2+3 to (i-1) * 2+4
tabindex = tabindex + 1'%>
<td width="15%" align="center" class='tit7'><input type=text value="<%=gap_real(tabindex-11)%>" size="15" name='txt_target<%=zeroformat(tabindex,2)%>' tabindex="<%=tabindex%>"></td>
<%tabindex = tabindex + 1'%>
<td width="35%" class='tit7' align="center">
<input type=text name="txt_target<%=zeroformat(tabindex,2)%>" OnKeyup="OnlyNumber(this);check_comma();" value="<%=gap_real(tabindex-11)%>" tabindex="<%=tabindex%>">&nbsp;원
</td>
<%next%>
</tr>
<%next%>
<tr height="15">
<td align="center" class='tit2' colspan="4" style="font-size:12px;">정 산 내 역</td>
</tr>
<%tabindex = tabindex + 1'%>
<tr height="30">
<td align="center" class='tit2' colspan="2">정산일자</td>
<td align="center" class='tit7' colspan="2">
<input type="text" class="gray" style="width:150;text-align:right" readonly name="txt_date_1"OnBlur="OnFormatDate(this)" OnFocus="OnReplaceDate(this)" OnKeyup="OnlyNumber(this)" value="<%=gap_real(59)%>">
<!--img src="/images/common/btn_calendar.jpg" align="absmiddle" OnClick="winopn('/include/calendar.html?actval=txt_date_1')" style="CURSOR:pointer;"-->
</td>
</tr>
<tr height="30">
<td width="15%" align="center" class='tit2' rowspan="2">가지급 정산</td>
<td width="35%" class='tit2' align="center">
총사용 금액
</td>
<td class='tit7' align="center" colspan="2">
<input type="text" class="gray" name="txt_target60" readonly value="<%=formatnumber(gap_real(60),0)%>" >&nbsp;원
</td>
</tr>
<tr height="30">
<td width="35%" class='tit7' align="center">
<input type="text" class="gray" name="txt_target61" readonly value="<%=gap_real(61)%>" >
</td>
<td class='tit7' align="center" colspan="2">
<input type="text" class="gray" name="txt_target62" readonly value="<%=formatnumber(gap_real(62),0)%>" >&nbsp;원
</td>
</tr>
<tr>
<td colspan="5" style="padding:10 0 0 0;">
<table border="0" cellspacing=0 cellpadding=0 width="100%">
<tr>
<td class='tit7'>
<br>
<font class="tahoma">
<%=ViewWord(gap(11))%>
</font>
<br>
</td>
</tr>
</table>
</td>
</tr>
<!-- #include file = "inc_reply.asp" -->
<%if print_type=2 then%>
<tr>
<td colspan="4" style="padding:20 0 0 0" align="right">
<pre><font class="tahoma"> 영 수 일 자 : 년 월 일</font></pre>
<pre><font class="tahoma"> 영 수 자 : (印)</font></pre>
</td>
</tr>
<%end if%>
<tr>
<td colspan="4" align="center" style="padding:15 0 5 0"><!-- #include virtual= "approval/inc_logo.asp" --></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><img width = "100%" src="/images/approval/docbg_btm.jpg"></td>
</tr>
</table>
</td>
</tr>
</table>
<%
'프로그램이 구려서 아래의 히든 값은 반드시 여기에 위치해야 함..
'위로 올리면 저장되는 값이 어긋남.
%>
<input type=hidden readonly name = 'krc_no_estimate' value="<%=krc_no_estimate%>">
</form>
</body>
</html>
<%
end if
rsc.Close
%>