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

602 lines
21 KiB
Plaintext

<!-- #include virtual = "lib/config.asp" -->
<%
Response.CharSet="euc-kr"
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(10) '1:프로젝트 코드, 2:지출(입금)목적, 3:지출(입금)일자, 4:지출(입금)방법, 5:공급가액, 6:부가세액, 7:총액, 8:거래처, 9:프로젝트 코드, 10:품의서 문서번호
dim krc_no
dim print_type '1:보기, 2:진짜프린트
dim db_table_name
dim title_type
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 = "문서내용"
Max_Width =750
Curr_date = year(date) & "년 " & zeroformat(month(date),2) & "월 " & zeroformat(day(date),2) & "일"
''//==========================================
''2010년 3월 3일
'''인쇄여부 표시
if print_type = "2" then
query = "update 문서내용 set print_chk = 'Yes', print_cnt = print_cnt + 1 where 문서번호='" & d_no & "' "
adoConn.Execute query
end if
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
if session("admin_ip") = Request.ServerVariables("remote_host") then
else
query = query & " AND b.d_delok = 'N' "
end if
end if
rsc.Open query, adoConn, 1
if rsc.RecordCount > 0 Then
If rsc("문서제목") = "내근직수당지출결의서" Then
title="내근직 수당 지출결의서"
pay_type = "1"
Else
title="면접원 수당 지출결의서"
pay_type = "2"
End If
title_type = mid(replace(title," ",""), 1, 2)
work_month = rsc("target10")
sv = rsc("target12")
if IsNull(rsc("target21")) = False then
d_p_subject = split(rsc("target21"), "^//^")
d_p_child_sn = split(rsc("target20"), "^//^")
d_estimate_money = split(rsc("target13"), "^//^")
d_currentMoney = split(rsc("target14"), "^//^")
d_totalPay = split(rsc("target15"), "^//^")
d_chaPay = split(rsc("target16"), "^//^")
new_gubun = True
else
new_gubun = False
End if
overMoney_reason = split(rsc("target17"), "^//^")
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
tmp_txt6 = tmp_8(0)
tmp_txt7 = tmp_8(1)
tmp_txt8 = tmp_8(2)
tmp_txt9 = tmp_8(3)
tmp_txt10 = tmp_8(4)
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) = rsc("target7")
gap(8) = rsc("target8")
gap(9) = rsc("p_sn")
gap(10) = rsc("target9")
d_order_cnt = int(rsc("d_order_cnt"))
print_type = request("print_type")
''날자를 '-'에서 년,월로 교체
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
''로그저장
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 & "'" & Session("User_Number") & "', "
query = query & "'" & Session("loginuser") & "', "
query = query & "'문서열기', "
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") & "')"
if Request.ServerVariables("REMOTE_ADDr") = session("admin_ip") then
else
adoconn.execute query
end if
%>
<html>
<head>
<title><%=GNB_TITLE%></title>
<link rel="stylesheet" type="text/css" href="/css/basic.css">
</head>
<script src="/js/jquery.min.js"></script>
<script src="/js/jquery-ajax-call.js"></script>
<script src="/js/jquery.form.min.js"></script>
<link rel="stylesheet" href="/css/jquery-ui.min.css">
<script src="/js/jquery-ui.min.js"></script>
<script language="javascript" src="/js/common.js"></script>
<script type="text/javascript">
$(document).ready(function () {
direct_cost_detail=function (p_child_sn, work_month, sv, pay_type, cost_type, d_no, work_kind){
//var url = "../approval/doc_myun_pay_detail.asp?p_child_sn="+p_child_sn+"&work_month="+work_month+"&sv="+sv+"&pay_type="+pay_type+"&cost_type="+cost_type+"&krc_no="+d_no+"&work_kind="+escape(work_kind);
var url = "doc_myun_pay_print_ajax.asp?p_child_sn="+p_child_sn+"&work_month="+work_month+"&sv="+sv+"&pay_type="+pay_type+"&cost_type="+cost_type+"&krc_no="+d_no+"&work_kind="+escape(work_kind);
$("#m_detail").dialog({
autoOpen: false,
modal: true,
resizable: false,
position: { my: "center", at: "top" },
show: "blind",
width: "800",
height: "600",
title: "면접원/내근직 리스트",
open: function () {
$(".ui-widget-overlay").css({
opacity: 0.5,
filter: "Alpha(Opacity=50)",
backgroundColor: "gray"
});
},
close: function (event, ui) {
$("body").css({
overflow: 'inherit'
});
url = "";
$("#m_detail").html("");
}
});
$("#m_detail").load(url, function () {
$("#m_detail").dialog("open");
});
}
});
function win_close()
{
window.close();
}
function win_print()
{
var txt_prj_name = document.ess.txt_prj_name.value;
var txt_pay_target = document.ess.txt_pay_target.value;
var txt_date = document.ess.txt_date.value;
var sel_pay_type = document.ess.sel_pay_type.value;
var txt_pay = document.ess.txt_pay.value;
var txt_pay_vat = document.ess.txt_pay_vat.value;
var txt_pay_tot = document.ess.txt_pay_tot.value;
var txt_client = document.ess.txt_client.value;
var txt_p_sn = document.ess.txt_p_sn.value;
<%
if tmp_admin_chk = "1" then
%>
var txt_d_no = document.ess.txt_d_no.value;
<%
end if
%>
var url = "doc_myun_pay_print.asp"
url = url + "?txt_prj_name=" + txt_prj_name;
url = url + "&txt_pay_target=" + txt_pay_target;
url = url + "&txt_date=" + txt_date;
url = url + "&sel_pay_type=" + sel_pay_type;
url = url + "&txt_pay=" + txt_pay;
url = url + "&txt_pay_vat=" + txt_pay_vat;
url = url + "&txt_pay_tot=" + txt_pay_tot;
url = url + "&txt_client=" + txt_client;
url = url + "&print_type=2";
url = url + "&txt_p_sn=" + txt_p_sn;
<%
if tmp_admin_chk = "1" then
%>
url = url + "&txt_d_no=" + txt_d_no;
<%
end if
%>
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=180,scrollbars=yes,resizable=yes')
}
//-->
</script>
<div id="m_detail"></div><!-- m_detail Modal -->
<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%>">
<input type="hidden" name="x" value="<%=x%>">
<input type=hidden name = "txt_prj_name" value="<%=gap(1)%>">
<input type=hidden name = "txt_pay_target" value="<%=gap(2)%>">
<input type=hidden name = "txt_date" value="<%=gap(3)%>">
<input type=hidden name = "sel_pay_type" value="<%=gap(4)%>">
<input type=hidden name = "txt_pay" value="<%=gap(5)%>">
<input type=hidden name = "txt_pay_vat" value="<%=gap(6)%>">
<input type=hidden name = "txt_pay_tot" value="<%=gap(7)%>">
<input type=hidden name = "txt_client" value="<%=gap(8)%>">
<input type=hidden name = "txt_p_sn" value='<%=gap(9)%>'>
<input type=hidden name="txt_d_no" value='<%=gap(10)%>'>
<%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")) or Session("Depart_Code") = "18") 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="2" style="padding:0 0 10 0">
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse;">
<tr>
<td width="255">
<font color="blue" size="3" ><b><%=title%></b></font>
</td>
<td>
<!-- #include file = "inc_approval.asp" -->
</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"><%=d_no%></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>
<%
Dim pay_apply_username
pay_apply_username = ""
set adors2 = server.CreateObject("ADODB.RECORDSET")
query = "select p_name from person where p_no = '" & sv & "' "
adors2.open query, adoconn, adopenstatic, adlockreadonly
If adors2.recordCount > 0 Then
pay_apply_username = adors2("p_name")
End If
adors2.close
%>
<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="35%" class="tit7" align="center"><font class="tahoma"><%=work_month%></font></td>
<td width="15%" class="tit2" align="center">수당 담당자</td>
<td width="30%" class="tit7" align="center"><font class="tahoma"><%=pay_apply_username%></font></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="26%" class="tit2" align="center">프로젝트</td>
<td width="11%" class="tit2" align="center">예상직접비</td>
<td width="11%" class="tit2" align="center">누적비용</td>
<td width="11%" class="tit2" align="center">지출결의비용</td>
<td width="11%" class="tit2" align="center">예상잔액</td>
<td width="30%" class="tit2" align="center">사유</td>
</tr>
<%
Dim minus_money_flag, data_index
minus_money_flag = false
Dim total_estimate_money, total_currentMoney, total_Pay, total_chaPay
total_estimate_money = 0
total_currentMoney = 0
total_Pay = 0
total_chaPay = 0
for data_index = 0 To UBound(d_p_child_sn)-1
Dim tmp_p_child_sn
Dim tmp_p_subject
Dim tmp_estimate_money
Dim tmp_currentMoney
Dim tmp_totalPay
Dim tmp_chaPay
Dim tmp_overMoney_reason
replaceStr = CStr(data_index+1)+"^^"
tmp_p_child_sn = Replace(d_p_child_sn(data_index), replaceStr, "")
tmp_p_subject = Replace(d_p_subject(data_index), replaceStr, "")
tmp_estimate_money = Replace(d_estimate_money(data_index), replaceStr, "")
tmp_currentMoney = Replace(d_currentMoney(data_index), replaceStr, "")
tmp_totalPay = Replace(d_totalPay(data_index), replaceStr, "")
tmp_chaPay = Replace(d_chaPay(data_index), replaceStr, "")
tmp_overMoney_reason = Replace(overMoney_reason(data_index), replaceStr, "")
%>
<tr>
<td class="tit7"><font class="tahoma">[<%=tmp_p_child_sn%>]&nbsp;
<%if session("depart_code") = "0" or session("depart_code") = "18" or (session("depart_code") = "12" ) then %>
<img src="/images/common/btn_directcost_view.jpg" align="absmiddle" style="cursor:pointer; height: 14px;" onclick="direct_cost_detail('<%=tmp_p_child_sn%>', '<%=work_month%>', '<%=sv%>', 1, '<%="field"%>', '<%= d_no %>', '<%=replace(split(RIGHT(tmp_p_subject, 6), "(")(1), ")", "") %>')">
<%end if %>
<br><%=tmp_p_subject%></font></td>
<%
If CDbl(tmp_chaPay) < 0 Then
minus_money_flag = true
End If
%>
<%
tempPay = 0
%>
<td class="tit7" style="text-align: right;"><font class="tahoma"><%=tmp_estimate_money%></font></td>
<td class="tit7" style="text-align: right;"><font class="tahoma"><%=tmp_currentMoney%></font></td>
<td class="tit7" style="text-align: right;"><font class="tahoma"><%=tmp_totalPay%></font></td>
<td class="tit7" style="text-align: right;"><font class="tahoma"><%=tmp_chaPay%></font></td>
<td class="tit7" style="text-align: left;"><font class="tahoma"><%=tmp_overMoney_reason%></font></td>
<%
total_estimate_money = total_estimate_money + CDbl(tmp_estimate_money)
total_currentMoney = total_currentMoney + CDbl(tmp_currentMoney)
total_Pay = total_Pay + CDbl(tmp_totalPay)
total_chaPay = total_chaPay + CDbl(tmp_chaPay)
%>
</tr>
<%
Next
%>
<tr>
<td align="center" class="tit2"><font class="tahoma">합계</font></td>
<td align="right" class="tit2"><font class="tahoma"><%=FormatNumber(total_estimate_money, 0)%></font></td>
<td align="right" class="tit2"><font class="tahoma"><%=FormatNumber(total_currentMoney, 0)%></font></td>
<td align="right" class="tit2"><font class="tahoma"><%=FormatNumber(total_Pay, 0)%></font></td>
<td align="right" class="tit2"><font class="tahoma"><%=FormatNumber(total_chaPay, 0)%></font></td>
<td width="20%" class="tit2" style="text-align: right;">&nbsp;</td>
</tr>
</table>
</td>
</tr>
<input type=hidden name = "minus_money_flag" value='<%=minus_money_flag%>'>
<!-- #include file = "inc_myun_pay_reply.asp" -->
<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 width = "100%" src="/images/approval/docbg_btm.jpg"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
<%
end if
rsc.Close
%>