Files
KIN/approval/doc_listall.asp

475 lines
20 KiB
Plaintext

<!-- #include virtual = "include/header.asp" -->
<!-- #include virtual = "include/left.asp" -->
<%
''문서의 종류는 db의 document table의 group by d_name
dim title()
Max_Title = 26
dim sel_type
redim title(Max_Title, 3)
dim sel_year
dim doc_year_list()
sel_year = cstr(year(now))
if request("sel_year") <> "" then
sel_year = request("sel_year")
end if
query = "select distinct 문서제목 from 문서내용 order by 문서제목"
Rs.Open query, adoConn, 1
redim title(Rs.recordcount, 3)
title(0, 1) = "전체"
i=0
do while not Rs.eof
i = i + 1
title(i , 1) = Rs("문서제목")
Rs.movenext
loop
Rs.close
query = "select distinct left(발급일,4) as 발급일 from 문서내용 order by left(발급일,4) desc"
Rs.Open query, adoConn, 1
redim doc_year_list(Rs.recordCount)
i=0
do while not Rs.eof
i = i + 1
doc_year_list(i) = Rs("발급일")
Rs.movenext
loop
Rs.close
sel_type = request("sel_type")
if trim(sel_type) = "" then
sel_type = "0"
end if
x = request("x")
p_hotvalue = request("p_hotvalue")
if request("gotopage") <> "" then
tmp_currentpage = request("gotopage")
else
tmp_currentpage = 1
end if
%>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<div class="content-header">
<h1>문서 모음</h1>
</div>
<!-- /.content-header -->
<!-- Main content -->
<div class="content-body">
<div class="content">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<form name="approval" method="post">
<%
query = ""
query = query & " SELECT d_no, d_name, p_sn, part, d_orders, del_yes_no, del_user_name, del_reason, login_이름, "
query = query & " d_write_date, login_p_no, target2, target3, target4, target5, target8, target15, target20, target30, "
query = query & " ISNULL(U.use_cost, '') AS use_cost "
query = query & " FROM Document a WITH(NOLOCK) "
query = query & " INNER JOIN 문서내용 b WITH(NOLOCK) on a.d_no = b.문서번호 "
query = query & " LEFT OUTER JOIN direct_costcode D1 WITH(NOLOCK) ON CONVERT(VARCHAR(5), b.target11) = CONVERT(VARCHAR(5), D1.id) "
query = query & " LEFT OUTER JOIN direct_costcode D2 WITH(NOLOCK) ON CONVERT(VARCHAR(5), b.target12) = CONVERT(VARCHAR(5), D2.id) "
query = query & " LEFT OUTER JOIN ( "
query = query & " SELECT CONVERT(VARCHAR(20), target9) AS target9, SUM(CONVERT(MONEY, (REPLACE(CONVERT(VARCHAR(50), target5), ',','')))) AS use_cost "
query = query & " FROM 문서내용 WITH(NOLOCK) "
query = query & " WHERE 문서제목='지출결의서' AND del_yes_no='no' AND CONVERT(VARCHAR(20), target9) <> '' "
query = query & " GROUP BY CONVERT(VARCHAR(20), target9) "
query = query & " ) U ON b.문서번호 = U.target9 "
query = query & " WHERE d_no LIKE 'KRC-" & sel_year & "%' "
query = query & " AND a.d_orders = b.login_p_no "
If sel_type <> "0" Then
query = query & " AND a.d_name = '" & title(sel_type, 1) & "' "
Else
query = query & " AND a.d_name NOT IN ('업무일지', '기기예약신청서', '예상직접비 보고서', '부서비신청서') "
End If
If p_hotvalue <> "" Then
query = query & " AND ( "
query = query & " b.p_sn LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " a.d_write_name LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " D1.d_cost_name LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " D2.d_cost_name LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " a.d_no LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target8 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target9 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target20 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target21 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target22 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target23 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target24 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target25 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target26 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target27 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target28 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target29 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target30 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target31 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target32 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target33 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target34 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target35 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target36 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target37 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target38 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target39 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target40 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target41 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target42 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target43 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target44 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target45 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target46 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target47 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target48 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target49 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' OR "
query = query & " b.target50 LIKE '%" & replace(p_hotvalue, "_", "[_]") & "%' "
query = query & " ) "
End If
query = query & " ORDER BY a.d_sn DESC "
'end if
'response.write query
Rs.Open query, adoConn, 1
tmp_count = Rs.RecordCount
%>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding:5">
발급일 :
<select name="sel_year" onchange="javascript:subit(0);">
<%
for i=1 To ubound(doc_year_list)
%>
<option value="<%=doc_year_list(i) %>" <%if doc_year_list(i) = sel_year then %> selected <% end if %>><%=doc_year_list(i) %>년</option>
<%
next
%>
</select> 목록결과 : 총 <b class="tahoma_orange"><%=formatnumber(tmp_count,0)%></b>개의 항목이 있습니다.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<%if tmp_project_chk = "1" OR tmp_admin_chk = "1" then%>
문서종류
<select name="sel_type" onchange="subit('2')" >
<%for i = 0 to ubound(title)%>
<OPTION value='<%=i%>' <%if cint(sel_type) = cint(i) then%>selected<%end if%>><% if title(i,1) = "접대비보고서" then response.write "마케팅비" else response.Write title(i,1) end if %></option>
<%next%>
</select>
<%end if%>
&nbsp;&nbsp;&nbsp;
<input type="text" name='p_hotvalue' style="width:120;text-align:center;" value="<%=p_hotvalue%>">
<img src="/images/common/btn_smallsrch.gif" align="absmiddle" onClick="subit('1')" style="cursor:hand;"> <b class="tahoma_orange">&nbsp;&nbsp; 작성자, 프로젝트 코드, 거래처, 항목, 세부, 문서번호, 품의문서로 검색 가능</b>
</td>
</tr>
<tr>
<td align="center">
<table class="table table-sm table-sm2 table-bordered table-head tr-colors">
<tr>
<td width="5%" align="center" height="24" >No.</td>
<td align="center" height="24" >문서분류</td>
<td width="14%" align="center" height="24" >거래처</td>
<td width="8%"align="center" height="24" >증빙일</td>
<td width="8%"align="center" height="24" >작성일</td>
<td width="4%"align="center" height="24" >작성자</td>
<td width="5%" align="center" height="24" >요청</td>
<%if tmp_admin_chk = "1" then%>
<td width="7%" align="center" height="24" >취소여부</td>
<%end if%>
</tr>
<%
if Rs.RecordCount > 0 then
Rs.PageSize = 20
tmp_ok = 1
PageCount = Rs.PageCount
Rs.absolutepage = tmp_Currentpage
tmp_total_record = Rs.RecordCount
tmp_for = clng(tmp_total_record) - ((clng(tmp_Currentpage) - 1) * Rs.PageSize)
if Rs.PageSize <= tmp_for then
if Rs.RecordCount <= Rs.PageSize then
tmp_for = Rs.recordcount
else
tmp_for = Rs.PageSize
end if
else
tmp_for = tmp_for
end if
for i = 1 to tmp_for
tmp_txt = "완료"
if Cint(tmp_Currentpage)=1 then
Num=clng(tmp_total_record)- i+1
else
Num=clng(tmp_total_record) - ((clng(tmp_Currentpage) - 1) * Rs.PageSize) - i +1
end if
tmp_flag = mid(Rs("d_no"), 10, 1)
if Rs("d_name") = "직접비" then
tmpstr = Rs("p_sn")
else
tmpstr = Rs("d_no")
end if
if Rs("d_name") = "문화체육비신청서" then
tmp_flag = "o2"
end If
if Rs("d_name") = "면접원수당지출결의서" then
tmp_flag = "t2"
end If
if tmp_buy_chk = "1" then
if Rs("part") = "1" then
tmp_text = "발송완료"
else
tmp_text = "미발송"
end if
else
if Rs("d_orders") <> Rs("login_p_no") then
tmp_text = "처리대기"
else
tmp_text = "처리완료"
end if
end if
%>
<!--- Loop Set Start --->
<tr>
<td align="center" height="24" ><%=Num%></td>
<td align="left" height="24"><a href="javascript:openit('<%=tmp_flag%>','<%=Rs("d_no")%>','1','<%=x%>','<%=Rs("p_sn") %>')" class="blue"><% if Rs("d_name") = "부서비신청서" then response.Write "그룹(장)활동비" else if Rs("d_name") = "접대비보고서" then response.write "마케팅비" else response.Write Rs("d_name") end if%></a>&nbsp<font >(<%=Rs("d_no")%>)</font>
<%
if (tmp_project_chk = "1" or tmp_admin_chk = "1") and mid(Rs("d_no"),10,1) = "V" then '프로젝트 계약보고서만
tmp_subject = ""
if instr(1,Rs("target2"), "^^") > 0 then
tmp_1 = split(Rs("target2"), "^^")
tmp_subject = tmp_1(2)
end if
%>
- <font ><%=tmp_subject%></font>
<%
end if
%>
<%if Rs("p_sn") <> "" then '프로젝트 계약보고서만%>
<% if Rs("d_name") = "지출결의서" then %>
-<font >(<%=Rs("target20")%>)</font>
<% else %>
-<font >(<%=Rs("p_sn")%>)</font>
<% end if %>
<%end if
if mid(Rs("d_name"),1,2) = "지출" or mid(Rs("d_name"),1,2) = "입금" or mid(Rs("d_name"),1,3) = "가지급" or Rs("d_name") = "품의서" or Rs("d_name") = "교육참가신청서" or _
Rs("d_name") = "부서비신청서" or Rs("d_name") = "접대비보고서" then
if Rs("d_name") = "지출결의서" or Rs("d_name") = "입금결의서" or Rs("d_name") = "교육참가신청서" or Rs("d_name") = "품의서" then
if not isnull(Rs("target5")) then
tmpstr = formatnumber(Rs("target5"), 0)
end if
elseif Rs("d_name") = "가지급금지출2" or Rs("d_name") = "가지급금지출" then
if not isnull(Rs("target8")) then
tmpstr = Rs("target8")
end if
elseif Rs("d_name") = "가지급금정산" or Rs("d_name") = "가지급금정산2" then
tmpstr_spl = split(Rs("target15"),"^^")
tmpstr = formatnumber(tmpstr_spl(1),0)
elseif Rs("d_name") = "부서비신청서" or Rs("d_name") = "지출정산승인신청서" then
if not isnull(Rs("target30")) then
tmpstr = formatnumber(Rs("target30"), 0)
end if
elseif Rs("d_name") = "접대비보고서" then
if not isnull(Rs("target30")) or Rs("target30") <> 0 then
tmpstr = formatnumber(Rs("target4"), 0)
end if
end if
if tmpstr <> "" then '금액 합계(vat 별도)%>
-<font ><b>(금액(Vat 별도) : <%=tmpstr%>)</b></font>
<%
end if
if Rs("d_name") = "품의서" then
%>
-<font ><b>(잔액:<%=FormatNumber(cLng(Rs("target5")) - cLng(Rs("use_cost")), 0)%>)</b></font>
<%
end if
%>
<%end if%>
</td>
<td align="center" height="24" >
<% if Rs("d_name")="지출결의서" or Rs("d_name")="품의서" or Rs("d_name")="자금집행서" or Rs("d_name")="입금결의서" then %>
<%=Rs("target8") %>
<% end if %>
</td>
<td align="center" height="24" >
<% if Rs("d_name")="지출결의서" or Rs("d_name")="자금집행서" or Rs("d_name")="입금결의서" then%>
<%=Rs("target3")%>
<% end if%>
</td>
<td align="center" height="24" ><%=Rs("d_write_date")%></td>
<td align="center" height="24" class="k_darkorange"><%=Rs("login_이름")%></td>
<td align="center" height="24" class="k_darkorange"><%=tmp_text%></td>
<%if tmp_admin_chk = "1" then
if lcase(Rs("del_yes_no")) = "yes" then
if Rs("del_user_name") = Rs("login_이름") then
tmp_text = "취소"
else
tmp_text = Rs("del_user_name") & " 반려<br>" & Rs("del_reason")
end if
else
tmp_text = "정상"
end if%>
<td align="center" height="24" class="k_darkorange"><%=tmp_text%></td>
<%end if%>
</tr>
<%
Rs.MoveNext
next
end if
Rs.Close
%>
</table>
<%=Pagelist("doc_listall.asp",tmp_currentpage ,tmp_bcolor , "", pagecount, "&b_type=" & b_type & "&sel_type=" & sel_type & "&p_hotvalue=" & p_hotvalue & "&sel_year=" & sel_year)%>
</td>
</tr>
</table>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- /.content -->
<!-- REQUIRED SCRIPTS -->
<script>
function subit(a) {
if (a == 1) {
if (document.approval.p_hotvalue.value == '') {
alert("내용을 입력해 주세요");
document.approval.p_hotvalue.value = "";
document.approval.p_hotvalue.focus();
return false;
}
document.approval.action = 'doc_listall.asp';
document.approval.submit();
}
else {
document.approval.action = 'doc_listall.asp';
document.approval.submit();
}
}
function openit(z, x, c, v, p_sn) {
if (z == 'C') {
var url = '/ess/doc_infochange_print.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v;
}
else if (z == 'D') {
var url = '/ess/doc_reinstatement_print.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v;
}
else if (z == 'E') {
var url = '/ess/doc_timeoff_print.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v;
}
else if (z == 'F') {
var url = '/ess/doc_vacation_print.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v + '&clear_chk=1';
}
else if (z == 'H') {
var url = '/ess/doc_official_print.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v;
}
else if (z == 'i' || z == 'S') {
if (z == 'i') {
var title_type = "지출";
}
else// z == 'S')
{
var title_type = "입금";
}
if (new_project_2014(p_sn) == "1") {
var url = '/ess/doc_expense_print.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v + '&title_type+' + title_type; ;
} else {
var url = '/ess/doc_expense_print_2014.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v + '&title_type+' + title_type; ;
}
}
else if (z == 'A') {
var title_type = "지출";
var url = '/ess/doc_expense2_print_2014.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v + '&title_type+' + title_type;
}
else if (z == 'M') {
var url = '/ess/doc_commute_print.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v;
}
else if (z == 'N') {
var url = '/ess/doc_entertainment_print.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v;
}
else if (z == 'o') {
var url = '/ess/doc_expense_approval_print.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v;
}
else if (z == 'o2') {
var url = '/ess/doc_culture_physicaleducation_print.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v;
}
else if (z == 'P') {
var url = '/ess/doc_prepayment_print.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v;
}
else if (z == 'Q') {
var url = '/ess/doc_prepayment_ex_print.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v;
}
else if (z == 'R') {
var url = '/ess/doc_cardiary_print.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v;
}
else if (z == 'U') {
var url = '/ess/doc_directcost_modi_print.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v;
}
else if (z == 'V') {
if (new_project_2014(p_sn) == "1") {
var url = '/ess/project_report.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v;
} else {
var url = '/ess/project_report_2014.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v;
}
}
else if (z == 'w') {
var url = '/ess/doc_expense_approval_depart_print.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v;
}
else if (z == 'X') {
var url = '/ess/direct_cost_print.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v;
}
else if (z == 'Y') {
var url = '/ess/물품구매서_print.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v;
}
else if (z == 'Z') //교육참가신청서
{
var url = '/ess/doc_education_print.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v;
}
else if (z == 'PMS') {
var url = '/project/project_list2_chk.asp?p_sn=' + x;
}
else if (z == '0') {
var url = '/ess/doc_consultation_print.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v;
}
else if (z == '1') {
var url = '/ess/doc_business_print.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v;
}
else if (z == '2') {
var url = '/ess/doc_field_print.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v;
}
else if (z == '3') {
var url = '/ess/doc_businessreport_print.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v;
}
else if (z == '4') { //가지급금 지출2
var url = '/ess/doc_prepayment2_print.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v;
}
else if (z == '5') { //가지급금 지출2 정산
var url = '/ess/doc_prepayment2_ex_print.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v;
}
else if (z == 'r') {
var url = '/ess/doc_expense2_print.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v + '&title_type+' + title_type;
}
else if (z == 't') {
var url = '/ess/doc_myun_pay_print.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v + '&title_type+' + title_type;
}
else if (z == 't2') {
var url = '/ess/doc_myun_pay_print2.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v + '&title_type+' + title_type;
}
else if (z == 'u') {
var url = '/ess/update_project_money.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v + '&title_type+' + title_type;
}
else if (z == '7') {
var url = '/ess/doc_device_print.asp?d_no=' + x + '&view_chk=' + c + '&x=' + v;
}
window.open(url, '', 'left=0,top=0,width=1000,height=1000,scrollbars=yes,resizable=yes');
}
</script>
</div>
<!-- /.content-wrapper -->
<!-- #include virtual = "include/footer.asp" -->