1131 lines
56 KiB
Plaintext
1131 lines
56 KiB
Plaintext
<!-- #include virtual = "lib/config.asp" -->
|
|
<%
|
|
''//=====================
|
|
''//=====================
|
|
''2013년 9월 27일자로
|
|
' 지출 결의서에 입금결의서를 추가하여 2개문서를 같은 프로그램에서 구동
|
|
'' 구분은 titie와 title_type로 구분
|
|
''//=====================
|
|
''//=====================
|
|
|
|
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 approval_chk
|
|
dim title_type
|
|
|
|
dim d_p_subject
|
|
dim d_p_child_sn
|
|
dim d_estimate_money
|
|
dim d_currentMoney
|
|
dim d_totalPay
|
|
dim d_chaPay
|
|
|
|
|
|
|
|
db_table_name = "문서내용"
|
|
approval_chk = "true"
|
|
|
|
pay_type = request("pay_type")
|
|
p_sn_c = request("p_sn_c")
|
|
work_month = request("work_month")
|
|
sv = request("sv")
|
|
print_type = request("print_type")
|
|
|
|
dim pay_month
|
|
dim key_day
|
|
|
|
if Session("loginuser") = "신상운" or Session("loginuser") = "양영은" then
|
|
sql = "select ver as key_day from information where program='인트라넷페이입력기준날자(경영지원실)'"
|
|
elseif Session("loginuser") = "김홍근" then
|
|
sql = "select ver as key_day from information where program='인트라넷페이입력기준날자(김홍근만)'"
|
|
else
|
|
sql = "select ver as key_day from information where program='인트라넷페이입력기준날자(자료조사부)'"
|
|
end if
|
|
rsc.open sql, adoConn,adopenstatic, adlockreadonly
|
|
key_day = rsc.fields("key_day")
|
|
rsc.close
|
|
|
|
|
|
if cint(day(date)) >= 1 and cint(day(date)) <= cint(key_day) then '1일 에서 5일 사이면 종료날짜가 금번달 5일인것 찾기
|
|
if cint(month(date)) = 1 then '1월 이면 전년도 12월 자료
|
|
'수당 입력시 기준이 되는 날짜~! 쉽게 말해서 수당 지급 날짜가 된다~!
|
|
pay_month = year(date) & "-01-15"
|
|
else
|
|
'수당 입력시 기준이 되는 날짜~! 쉽게 말해서 수당 지급 날짜가 된다~!
|
|
pay_month = year(date) & "-" & zeroformat(month(date),2) & "-15"
|
|
end If
|
|
else
|
|
if cint(month(date)) = 12 then '12월 이면 종료날짜가 다음년도 1월5일 인것 찾기
|
|
'수당 입력시 기준이 되는 날짜~! 쉽게 말해서 수당 지급 날짜가 된다~!
|
|
pay_month = year(date) + 1 & "-01-15"
|
|
Else
|
|
'수당 입력시 기준이 되는 날짜~! 쉽게 말해서 수당 지급 날짜가 된다~!
|
|
pay_month = year(date) & "-" & zeroformat(month(date)+1,2) & "-15"
|
|
end If
|
|
end if
|
|
|
|
If pay_type = 1 Then
|
|
title="내근직 수당 지출결의서"
|
|
Else
|
|
title="면접원 수당 지출결의서"
|
|
End if
|
|
|
|
d_no = request("d_no")
|
|
If cint(print_type) = 0 Then
|
|
|
|
|
|
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 & "' "
|
|
query = query & " AND b.d_delok = 'N' "
|
|
|
|
rsc.Open query, adoConn, 1
|
|
if rsc.RecordCount > 0 Then
|
|
If rsc("문서제목") = "내근직수당지출결의서" Then
|
|
pay_type = "1"
|
|
Else
|
|
pay_type = "2"
|
|
End If
|
|
tmp_d_order_cnt = rsc("d_order_cnt")
|
|
startDT = rsc("target10")
|
|
endDT = rsc("target11")
|
|
overMoney_reason = rsc("target17")
|
|
End if
|
|
End if
|
|
|
|
title_type = mid(replace(title," ",""), 1, 7)
|
|
|
|
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")
|
|
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
|
|
|
|
|
|
''////////========================
|
|
''값가져오기
|
|
gap(1) = request("txt_prj_name")
|
|
gap(2) = request("txt_pay_target")
|
|
gap(3) = request("txt_date")
|
|
gap(4) = request("sel_pay_type")
|
|
gap(5) = request("txt_pay")
|
|
gap(6) = request("txt_pay_vat")
|
|
gap(7) = request("txt_pay_tot")
|
|
gap(8) = request("txt_client")
|
|
gap(9) = request("txt_p_sn")
|
|
gap(10) = request("txt_d_no")
|
|
|
|
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 문서내용 "
|
|
query = query & " where 문서번호 like 'KRC-" & year(date) & "-t-%' "
|
|
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 & "t-"
|
|
krc_no = tmpstr & ZeroFormat(krc_no,5)
|
|
'Response.Write "krc_no : " & krc_no & "<BR>"
|
|
|
|
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)
|
|
'====================================================================
|
|
|
|
dataCount = request("dataCount")
|
|
overMoney_reason = ""
|
|
d_estimate_money = ""
|
|
d_currentMoney = ""
|
|
d_totalPay = ""
|
|
d_chaPay = ""
|
|
d_p_child_sn = ""
|
|
d_p_subject = ""
|
|
|
|
Dim overMoney_reason_count
|
|
overMoney_reason_count = 0
|
|
|
|
For i = 1 To request("overMoney_reason").count
|
|
If Trim(request("overMoney_reason")(i)) <> "" Then
|
|
overMoney_reason_count = overMoney_reason_count + 1
|
|
End if
|
|
d_p_subject = d_p_subject + ( cstr(i) + "^^" + request("p_subject")(i) + "^//^" )
|
|
d_p_child_sn = d_p_child_sn + ( cstr(i) + "^^" + request("p_sn")(i) + "^//^" )
|
|
overMoney_reason = overMoney_reason + ( cstr(i) + "^^" + request("overMoney_reason")(i) + "^//^" )
|
|
d_estimate_money = d_estimate_money + ( cstr(i) + "^^" + request("estimate_money")(i) + "^//^" )
|
|
d_currentMoney = d_currentMoney + ( cstr(i) + "^^" + request("currentMoney")(i) + "^//^" )
|
|
d_totalPay = d_totalPay + ( cstr(i) + "^^" + request("totalPay")(i) + "^//^" )
|
|
d_chaPay = d_chaPay + ( cstr(i) + "^^" + request("chaPay")(i) + "^//^" )
|
|
Next
|
|
%>
|
|
<!-- #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 & "', '" & 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') "
|
|
|
|
adoconn.execute query
|
|
|
|
query = "insert into 문서내용 (문서번호, 문서제목, target1, target2, target3, target4, target5, "
|
|
query = query & " target6, target7, target8, target9, target10, target11, target12, target13, target14, target15, target16, target17, target20, target21, target97,target98,target99,target100,p_sn, 발급일, 발급시각, login_p_no, login_이름,login_ip) values ( "
|
|
query = query & "'" & krc_no & "', "
|
|
query = query & "'" & replace(title, " ", "") & "', "
|
|
query = query & "'" & gap(1) & "', "
|
|
query = query & "'" & CheckWord(gap(2)) & "', "
|
|
query = query & "'" & gap(3) & "', "
|
|
query = query & "'" & gap(4) & "', "
|
|
query = query & "'" & gap(5) & "', "
|
|
query = query & "'" & gap(6) & "', "
|
|
query = query & "'" & gap(7) & "', "
|
|
query = query & "'" & gap(8) & "', "
|
|
query = query & "'" & gap(10) & "', "
|
|
|
|
query = query & "'" & work_month & "', "
|
|
query = query & "'" & work_month & "', "
|
|
query = query & "'" & sv & "', "
|
|
query = query & "'" & d_estimate_money & "', "
|
|
query = query & "'" & d_currentMoney & "', "
|
|
query = query & "'" & d_totalPay & "', "
|
|
query = query & "'" & d_chaPay & "', "
|
|
query = query & "'" & overMoney_reason & "', "
|
|
query = query & "'" & d_p_child_sn & "', "
|
|
query = query & "'" & d_p_subject & "', "
|
|
|
|
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") & "') "
|
|
|
|
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") & "')"
|
|
'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) = " "
|
|
end if
|
|
Next
|
|
|
|
for i=5 to 7
|
|
if gap(i) = " " then
|
|
gap(i) = "0"
|
|
end if
|
|
next
|
|
|
|
If replace(title, " ", "") = "내근직수당지출결의서" Or replace(title, " ", "") = "면접원수당지출결의서" Then
|
|
|
|
query = " Update man "
|
|
query = query & " set m_last_work_date = convert(varchar(10), GETDATE(), 23) "
|
|
query = query & " where id in "
|
|
query = query & " (SELECT (select id from man where m_name=T.m_name and left(m_jumin,6)+'0000000' = T.m_jumin) as id FROM "
|
|
query = query & " (select tn.*, nw.in_time, nw.out_time, nw.p_sebu_code, p_sv_no from T_NEAKEUN_PAY tn left outer join neakeun_work nw on tn.attribute01 = nw.id) T "
|
|
if work_month = "2022-04" Then
|
|
query = query & " where ((work_dt between '" & work_month & "-01' and '" & work_month & "-25' AND T.in_time + T.out_time + T.p_sebu_code <> '000000004') OR "
|
|
query = query & " (work_dt between '" & work_month & "-16' and cast(DATEADD(m,1,cast('" & work_month & "-05' as date)) as varchar) "
|
|
elseif work_month > "2022-04" Then
|
|
'최남식 :: 20260225 :: 수당 결재 기간 변경
|
|
If Right(work_month, 2) = "02" Then
|
|
'2월: 전달 26일 ~ 2월 28일(고정)
|
|
query = query & " where ((work_dt between cast(DATEADD(m,-1,cast('" & work_month & "-26' as date)) as varchar(10)) and '" & work_month & "-28' AND T.in_time + T.out_time + T.p_sebu_code <> '000000004') "
|
|
ElseIf CInt(Right(work_month, 2)) < 3 Then
|
|
'2월 이전(1월 등): 전달 26일 ~ 해당달 25일
|
|
query = query & " where ((work_dt between cast(DATEADD(m,-1,cast('" & work_month & "-26' as date)) as varchar(10)) and '" & work_month & "-25' AND T.in_time + T.out_time + T.p_sebu_code <> '000000004') "
|
|
Else
|
|
'3월부터: 해당달 1일 ~ 말일
|
|
query = query & " where ((work_dt between '" & work_month & "-01' and convert(varchar(10),EOMONTH(cast('" & work_month & "-01' as date)),23) AND T.in_time + T.out_time + T.p_sebu_code <> '000000004') "
|
|
End If
|
|
'query = query & " where ((work_dt between cast(DATEADD(m,-1,cast('" & work_month & "-26' as date))as varchar) and '" & work_month & "-25' AND T.in_time + T.out_time + T.p_sebu_code <> '000000004') "
|
|
query = query & " OR (work_dt between '" & work_month & "-06' and cast(DATEADD(m,1,cast('" & work_month & "-05' as date)) as varchar) "
|
|
else
|
|
query = query & " where ((LEFT(work_dt, 7) = '" & work_month & "' AND T.in_time + T.out_time + T.p_sebu_code <> '000000004') OR "
|
|
query = query & " (work_dt between '" & work_month & "-16' and cast(DATEADD(m,1,cast('" & work_month & "-15' as date)) as varchar) "
|
|
end if
|
|
query = query & " AND T.in_time + T.out_time + T.p_sebu_code = '000000004')) "
|
|
query = query & " and p_sn = '" & p_sn_c & "' and isnull(T.attribute05,'') = '' "
|
|
query = query & " and p_sv_no = '" & sv & "' "
|
|
query = query & " group by m_name, m_jumin) "
|
|
adoconn.execute query
|
|
|
|
query = " UPDATE t_neakeun_pay "
|
|
query = query & " SET attribute05 = '" & krc_no & "' , pay_month = '" & pay_month & "' "
|
|
query = query & " WHERE id in (SELECT T.id FROM "
|
|
query = query & " (select tn.*, nw.in_time, nw.out_time, nw.p_sebu_code, p_sv_no from T_NEAKEUN_PAY tn left outer join neakeun_work nw on tn.attribute01 = nw.id) T "
|
|
if work_month = "2022-04" Then
|
|
query = query & " where ((work_dt between '" & work_month & "-01' and '" & work_month & "-25' AND T.in_time + T.out_time + T.p_sebu_code <> '000000004') OR "
|
|
query = query & " (work_dt between '" & work_month & "-16' and cast(DATEADD(m,1,cast('" & work_month & "-05' as date)) as varchar) "
|
|
elseif work_month > "2022-04" Then
|
|
'최남식 :: 20260225 :: 수당 결재 기간 변경
|
|
If Right(work_month, 2) = "02" Then
|
|
'2월: 전달 26일 ~ 2월 28일(고정)
|
|
query = query & " where ((work_dt between cast(DATEADD(m,-1,cast('" & work_month & "-26' as date)) as varchar(10)) and '" & work_month & "-28' AND T.in_time + T.out_time + T.p_sebu_code <> '000000004') "
|
|
ElseIf CInt(Right(work_month, 2)) < 3 Then
|
|
'2월 이전(1월 등): 전달 26일 ~ 해당달 25일
|
|
query = query & " where ((work_dt between cast(DATEADD(m,-1,cast('" & work_month & "-26' as date)) as varchar(10)) and '" & work_month & "-25' AND T.in_time + T.out_time + T.p_sebu_code <> '000000004') "
|
|
Else
|
|
'3월부터: 해당달 1일 ~ 말일
|
|
query = query & " where ((work_dt between '" & work_month & "-01' and convert(varchar(10),EOMONTH(cast('" & work_month & "-01' as date)),23) AND T.in_time + T.out_time + T.p_sebu_code <> '000000004') "
|
|
End If
|
|
'query = query & " where ((work_dt between cast(DATEADD(m,-1,cast('" & work_month & "-26' as date))as varchar) and '" & work_month & "-25' AND T.in_time + T.out_time + T.p_sebu_code <> '000000004') OR "
|
|
query = query & " (work_dt between '" & work_month & "-06' and cast(DATEADD(m,1,cast('" & work_month & "-05' as date)) as varchar) "
|
|
else
|
|
query = query & " where ((LEFT(work_dt, 7) = '" & work_month & "' AND T.in_time + T.out_time + T.p_sebu_code <> '000000004') OR "
|
|
query = query & " (work_dt between '" & work_month & "-16' and cast(DATEADD(m,1,cast('" & work_month & "-15' as date)) as varchar) "
|
|
end if
|
|
query = query & " AND T.in_time + T.out_time + T.p_sebu_code = '000000004')) "
|
|
query = query & " and p_sn = '" & p_sn_c & "' and isnull(T.attribute05,'') = '' "
|
|
query = query & " and p_sv_no = '" & sv & "' "
|
|
query = query & " group by T.id, m_name, m_jumin, LEFT(work_dt, 7)) "
|
|
adoconn.execute query
|
|
End if
|
|
|
|
'2014-12-26 면접원, 내근직 지출 결의서 일 경우 ------------------------------------
|
|
If d_order_cnt = 77 Then
|
|
if tmp_d_order_cnt <> "77" then
|
|
|
|
set dbin = server.CreateObject("ADODB.CONNECTION")
|
|
|
|
query = " SELECT t.p_sn, s_gubun, SUM(s_sum) as s_sum "
|
|
query = query & " FROM (select tmp.p_sn, tmp.m_name, tmp.m_jumin, tmp.work_dt, "
|
|
query = query & " case when tmp.s_gubun like '추가%' then ( "
|
|
query = query & " select top 1 s_gubun from t_neakeun_pay "
|
|
query = query & " where attribute01 = tmp.attribute01 and s_gubun not like '추가%' order by s_wan desc ) "
|
|
query = query & " else tmp.s_gubun end as s_gubun, s_sum, attribute01, attribute05 from t_neakeun_pay tmp) t "
|
|
query = query & " left outer join neakeun_work nw on t.attribute01 = nw.id "
|
|
query = query & " WHERE isnull(t.attribute05,'') = '" & krc_no & "' "
|
|
query = query & " group by s_gubun, t.p_sn "
|
|
|
|
rsc.open query, adoconn,adopenstatic, adlockreadonly
|
|
do while not rsc.eof
|
|
directQuery = " UPDATE direct_cost "
|
|
directQuery = directQuery & " set act_money = act_money + " & rsc("s_sum") & " , "
|
|
directQuery = directQuery & " cha_money = cha_money + " & rsc("s_sum") & " "
|
|
directQuery = directQuery & " where p_child_sn = '" & rsc("p_sn") & "' "
|
|
directQuery = directQuery & " and del_yes_no = 'no' and sebu = '" & rsc("s_gubun") & "' "
|
|
|
|
dbin.Open adoConn
|
|
dbin.Execute directQuery, i
|
|
dbin.Close
|
|
|
|
if i < 1 then
|
|
Query = "select 문서번호 as krc_no from 문서내용 "
|
|
query = query & " where 문서제목 = '" & replace(title, " ", "") & "' "
|
|
query = query & " and substring(문서번호,5,4) = '" & year(date) & "' "
|
|
query = query & " order by 문서번호"
|
|
|
|
Rs.open Query, adoconn,adopenstatic, adlockreadonly
|
|
|
|
if Rs.recordcount <= 0 then
|
|
krc_no = 0
|
|
else
|
|
Rs.movelast
|
|
tmpstr = split(trim(Rs("krc_no")),"-")
|
|
krc_no = tmpstr(3)
|
|
end if
|
|
Rs.close
|
|
krc_no = int(krc_no) + 1
|
|
tmpstr = "KRC-" & year(date) & "-"
|
|
tmpstr = tmpstr & "X-"
|
|
krc_no = tmpstr & ZeroFormat(krc_no,5)
|
|
|
|
Query = " insert into direct_cost(p_sn, krc_no, p_subject, hangmok, sebu, act_money, "
|
|
Query = Query & " modify_date, modify_time, modify_user, modify_user_code, modify_ip, del_yes_no, cost_type, p_child_sn) "
|
|
Query = Query & " values( "
|
|
Query = Query & " left('" & rsc("p_sn") & "',7), "
|
|
Query = Query & " '" & krc_no & "', "
|
|
Query = Query & " (select p_subject from T_PROJECT_METHOD where p_child_sn = '" & rsc("p_sn") & "'), "
|
|
Query = Query & " '49', "
|
|
Query = Query & " '" & rsc("s_gubun") & "', "
|
|
Query = Query & " '" & rsc("s_sum") & "', "
|
|
Query = Query & " convert(char(10),GETDATE(),23), "
|
|
Query = Query & " convert(char(10),GETDATE(),24), "
|
|
Query = Query & " '"& Session("loginuser") &"', "
|
|
Query = Query & " '"& Session("User_Number") &"', "
|
|
Query = Query & " '"& Session("USERIP") &"', "
|
|
Query = Query & " 'no', "
|
|
Query = Query & " 'field', "
|
|
Query = Query & " '" & rsc("p_sn") & "') "
|
|
|
|
'Response.Write "Query :" & Query
|
|
dbin.Open adoConn
|
|
dbin.Execute Query
|
|
dbin.Close
|
|
end if
|
|
|
|
rsc.movenext
|
|
loop
|
|
rsc.close
|
|
Else
|
|
alert2 "이미 결재가 완료된 문서입니다."
|
|
End if
|
|
End if
|
|
'----------------------------------------------------------------------------------
|
|
|
|
|
|
elseif cint(print_type) = 1 then
|
|
|
|
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 language=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);
|
|
url = "../ess/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 subit() {
|
|
document.getElementById("img_save").style.display = "none";
|
|
document.getElementById("img_cancel").style.display = "none";
|
|
if (!confirm("결재 상신을 하시겠습니까?")) {
|
|
document.getElementById("img_save").style.display = "inline";
|
|
document.getElementById("img_cancel").style.display = "inline";
|
|
return false;
|
|
}
|
|
var url = "doc_myun_pay_print.asp"
|
|
url = url + "?print_type=2";
|
|
document.frm_money.action=url;
|
|
|
|
var dataCount = document.frm_money.dataCount.value;
|
|
var minus_money_flag = "False";
|
|
var p_progress_status; //수행계획서 결재 여부
|
|
var p_sn;
|
|
var nw; //내근직 업무일지 여부
|
|
|
|
for (var i = 0; i < dataCount; i++) {
|
|
if (dataCount > 1) {
|
|
minus_money_flag = document.frm_money.minus_money_flag[i].value;
|
|
} else {
|
|
minus_money_flag = document.frm_money.minus_money_flag.value;
|
|
}
|
|
if (dataCount > 1) {
|
|
p_progress_status = document.frm_money.p_progress_status[i].value;
|
|
} else {
|
|
p_progress_status = document.frm_money.p_progress_status.value;
|
|
}
|
|
if (dataCount > 1) {
|
|
p_sn = document.frm_money.p_sn[i].value;
|
|
} else {
|
|
p_sn = document.frm_money.p_sn.value;
|
|
}
|
|
if (dataCount > 1) {
|
|
nw = document.frm_money.nw[i].value;
|
|
} else {
|
|
nw = document.frm_money.nw.value;
|
|
}
|
|
|
|
if (p_progress_status != "") {
|
|
alert(p_sn + "의 수행계획서가 결재를 받지 않았습니다.\n먼저 수행계획서 결재를 받아주세요");
|
|
document.getElementById("img_save").style.display = "inline";
|
|
document.getElementById("img_cancel").style.display = "inline";
|
|
return false;
|
|
}
|
|
if (nw == "") {
|
|
alert("내근직 업무일지가 존재하지 않습니다.\n IT팀에 문의해주세요.");
|
|
document.getElementById("img_save").style.display = "inline";
|
|
document.getElementById("img_cancel").style.display = "inline";
|
|
return false;
|
|
}
|
|
|
|
if(minus_money_flag == "True"){
|
|
if (dataCount > 1) {
|
|
if(document.frm_money.overMoney_reason[i].value == ""){
|
|
alert("수당이 초과된 프로젝트가 존재 합니다.\n사유를 작성 하세요.");
|
|
document.getElementById("img_save").style.display = "inline";
|
|
document.getElementById("img_cancel").style.display = "inline";
|
|
return false;
|
|
}
|
|
} else {
|
|
if(document.frm_money.overMoney_reason.value == ""){
|
|
alert("수당이 초과된 프로젝트가 존재 합니다.\n사유를 작성 하세요.");
|
|
document.getElementById("img_save").style.display = "inline";
|
|
document.getElementById("img_cancel").style.display = "inline";
|
|
return false;
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
document.frm_money.submit();
|
|
}
|
|
/*
|
|
function direct_cost_detail(p_child_sn, work_month, sv, pay_type, cost_type, d_no, work_kind) {
|
|
url = "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);
|
|
window.open(url,"","left=50 ,top=0, menubar=no, location=no ,status=no ,toolbar=no ,width=780, height=600 ,scrollbars=yes ,resizable=yes");
|
|
}
|
|
*/
|
|
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.location.reload();
|
|
}
|
|
</script>
|
|
<div id="m_detail"></div><!-- m_detail Modal -->
|
|
<body topmargin="10" leftmargin="10" <%if cint(print_type) = 2 then%> onLoad="clsit();" <% end if %>>
|
|
|
|
<form method='post' name='frm_money'>
|
|
|
|
<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)%>'>
|
|
<input type=hidden name = "title_type" value='<%=title_type%>'>
|
|
|
|
<input type=hidden name = "pay_type" value='<%=pay_type%>'>
|
|
<input type=hidden name = "work_month" value='<%=work_month%>'>
|
|
<input type=hidden name = "sv" value='<%=sv%>'>
|
|
<input type=hidden name = "p_sn_c" value='<%=p_sn_c%>'>
|
|
|
|
<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;">
|
|
<%if approval_chk = "true" then%>
|
|
<img src="/images/common/btn_approve.jpg" onClick="subit()" style="CURSOR:pointer;" title='결재신청' id="img_save">
|
|
<%else
|
|
Response.Write "<font color='red' size=4><b>본부가 혼재된 프로젝트는 결재 상신이 안됩니다. 본부를 구분하세요</b></font>"
|
|
end if%>
|
|
<img src="/images/common/btn_cancel.jpg" onClick="win_close();" style="CURSOR:pointer;" id="img_cancel">
|
|
</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">
|
|
<font color="blue" size="3" ><b><%=title%></b></font>
|
|
</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 = 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%>">
|
|
<tr height="35">
|
|
<td bgcolor="#FFFFFF" align="center" class="k_small"><%=tmp_txt1%> </td>
|
|
<td bgcolor="#FFFFFF" align="center" class="k_small"><%=tmp_txt2%> </td>
|
|
<td bgcolor="#FFFFFF" align="center" class="k_small"><%=tmp_txt3%> </td>
|
|
<td bgcolor="#FFFFFF" align="center" class="k_small"><%=tmp_txt4%> </td>
|
|
<td bgcolor="#FFFFFF" align="center" class="k_small"><%=tmp_txt5%> </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>결 의 일 자</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>성 명</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>소 속</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>직 급</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"><%
|
|
if work_month = "2022-04" Then
|
|
Response.Write work_month & "-01 ~ " & work_month & "-25"
|
|
elseif work_month > "2022-04" Then
|
|
'최남식 :: 20260225 :: 수당 결재 기간 변경
|
|
If CDate(work_month & "-01") >= CDate("2026-03-01") Then
|
|
'2026년 3월부터 1일 ~ 말일
|
|
Response.Write CDate(work_month & "-01") & " ~ " & DateAdd("d",-1,DateAdd("m",1,CDate(work_month & "-01")))
|
|
ElseIf CDate(work_month & "-01") = CDate("2026-02-01") Then
|
|
'2026년 2월만: 전달 26일 ~ 이번달 말일
|
|
Response.Write DateAdd("m",-1, CDate(work_month & "-26")) & " ~ " & DateAdd("d",-1,DateAdd("m",1,CDate(work_month & "-01")))
|
|
Else
|
|
'2026년 3월이전은 전달 26일 ~ 이번달 25일
|
|
Response.Write DATEADD("m",-1,cdate(work_month & "-26")) & " ~ " & work_month & "-25"
|
|
End If
|
|
'Response.Write DATEADD("m",-1,cdate(work_month & "-26")) & " ~ " & work_month & "-25"
|
|
else
|
|
Response.Write work_month
|
|
end if
|
|
%></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>
|
|
|
|
<%
|
|
Query = "select d_no, p_sn, isnull(p_subject, (select p_subject from V_PROJECT_METHOD where p_sn = T.p_sn )) as p_subject, s_gubun, isnull(SUM(pay), 0) as pay, isnull(SUM(lunch), 0) as lunch, isnull(SUM(dinner), 0) as dinner "
|
|
Query = Query & " ,isnull(Case when p_progress_status != '008' then '[수행계획서 미결재]' end,'') as p_progress_status "
|
|
Query = Query & " ,isnull(cast(id as varchar(100)),'') as nw "
|
|
Query = Query & "from ( "
|
|
Query = Query & " select isnull(A.attribute05,'') as d_no , A.p_sn, C.p_subject "
|
|
Query = Query & " , s_gubun, pay_type "
|
|
Query = Query & " , CASE WHEN s_gubun <> '추가수당1' and s_gubun <> '추가수당2' THEN isnull(SUM(s_sum), 0) END as pay "
|
|
Query = Query & " , CASE WHEN s_gubun = '추가수당1' THEN isnull(sum(s_wan), 0) * (select cost from t_neakeun_pay_COST where type = 'lunch') END as lunch "
|
|
Query = Query & " , CASE WHEN s_gubun = '추가수당2' THEN isnull(sum(s_wan), 0) * (select cost from t_neakeun_pay_COST where type = 'dinner') END as dinner "
|
|
Query = Query & " , p_progress_status, CASE WHEN nw.id IS NULL THEN 'N' else 'Y' end AS id "
|
|
Query = Query & " from "
|
|
Query = Query & " ( "
|
|
Query = Query & " select tmp.p_sn, tmp.m_name, tmp.m_jumin, tmp.work_dt, tmp.attribute01, tmp.attribute05, tmp.pay_type, tmp.s_wan, "
|
|
Query = Query & " case when tmp.s_gubun like '추가%' then "
|
|
Query = Query & " ( "
|
|
Query = Query & " select top 1 s_gubun "
|
|
Query = Query & " from t_neakeun_pay "
|
|
Query = Query & " where attribute01 = tmp.attribute01 "
|
|
Query = Query & " and p_sn = tmp.p_sn and s_gubun not like '추가%' "
|
|
Query = Query & " order by s_wan desc "
|
|
Query = Query & " ) "
|
|
Query = Query & " else tmp.s_gubun end as s_gubun, s_sum "
|
|
Query = Query & " from t_neakeun_pay tmp "
|
|
Query = Query & " ) as A "
|
|
Query = Query & " left outer join v_project as B "
|
|
Query = Query & " on A.p_sn = B.p_sn "
|
|
Query = Query & " left outer join v_project_method as C "
|
|
Query = Query & " on A.p_sn = C.p_child_sn "
|
|
Query = Query & " left outer join neakeun_work nw on a.attribute01 = nw.id "
|
|
Query = Query & " where pay_type = 1 "
|
|
if work_month = "2022-04" Then
|
|
Query = Query & " and ((work_dt between '" & work_month & "-01' and '" & work_month & "-25' AND NW.in_time + NW.out_time + NW.p_sebu_code <> '000000004') OR "
|
|
Query = Query & " (work_dt between '" & work_month & "-16' and cast(DATEADD(m,1,cast('" & work_month & "-05' as date)) as varchar) "
|
|
elseif work_month > "2022-04" Then
|
|
'최남식 :: 20260225 :: 수당 결재 기간 변경
|
|
If Right(work_month, 2) = "02" Then
|
|
'2월: 전달 26일 ~ 2월 28일(고정)
|
|
Query = Query & " and ((work_dt between cast(DATEADD(m,-1,cast('" & work_month & "-26' as date)) as varchar(10)) and '" & work_month & "-28' AND NW.in_time + NW.out_time + NW.p_sebu_code <> '000000004') "
|
|
ElseIf CInt(Right(work_month, 2)) < 3 Then
|
|
'2월 이전(1월 등): 전달 26일 ~ 해당달 25일
|
|
Query = Query & " and ((work_dt between cast(DATEADD(m,-1,cast('" & work_month & "-26' as date)) as varchar(10)) and '" & work_month & "-25' AND NW.in_time + NW.out_time + NW.p_sebu_code <> '000000004') "
|
|
Else
|
|
'3월부터: 해당달 1일 ~ 말일
|
|
Query = Query & " and ((work_dt between '" & work_month & "-01' and convert(varchar(10),EOMONTH(cast('" & work_month & "-01' as date)),23) AND NW.in_time + NW.out_time + NW.p_sebu_code <> '000000004') "
|
|
End If
|
|
'Query = Query & " and ((work_dt between cast(DATEADD(m,-1,cast('" & work_month & "-26' as date))as varchar) and '" & work_month & "-25' AND NW.in_time + NW.out_time + NW.p_sebu_code <> '000000004') "
|
|
Query = Query & " OR (work_dt between '" & work_month & "-06' and cast(DATEADD(m,1,cast('" & work_month & "-05' as date)) as varchar) "
|
|
else
|
|
Query = Query & " and ((LEFT(work_dt, 7) = '" & work_month & "' AND NW.in_time + NW.out_time + NW.p_sebu_code <> '000000004') OR "
|
|
Query = Query & " (work_dt between '" & work_month & "-16' and cast(DATEADD(m,1,cast('" & work_month & "-15' as date)) as varchar) "
|
|
end if
|
|
Query = Query & " AND NW.in_time + NW.out_time + NW.p_sebu_code = '000000004')) "
|
|
Query = Query & " and p_sv_no = '" & sv & "' and A.p_sn = '"& p_sn_c &"' "
|
|
Query = Query & " group by isnull(A.attribute05,'') ,A.p_sn, C.p_subject, s_gubun, pay_type, p_progress_status, nw.id "
|
|
Query = Query & ") as T "
|
|
Query = Query & "where d_no = '" & d_no & "' "
|
|
Query = Query & "group by d_no, p_sn, p_subject, s_gubun, pay_type, p_progress_status, id "
|
|
|
|
'Response.Write query & "<BR>"
|
|
adoRs.open Query, adoconn,adopenstatic, adlockreadonly
|
|
|
|
Dim total_estimate_money, total_currentMoney, total_Pay, total_chaPay
|
|
total_estimate_money = 0
|
|
total_currentMoney = 0
|
|
total_Pay = 0
|
|
total_chaPay = 0
|
|
|
|
Dim minus_money_flag, dataCount
|
|
dataCount = 0
|
|
if adoRs.recordcount > 0 Then
|
|
dataCount = adoRs.recordcount
|
|
do while not adoRs.eof
|
|
minus_money_flag = False
|
|
|
|
Query = "select p_sn, p_child_sn, SUM(convert(numeric(18,0), est_money)) as est_money from ( "
|
|
Query = Query & " select * from direct_cost where p_sn like '" & Left(adoRs("p_sn"), 2) & "%' and hangmok = '49' and del_yes_no = 'no' and sebu = '" & adoRs("s_gubun") & "' "
|
|
Query = Query & ") as T "
|
|
If Len(adoRs("p_sn")) > 9 Then
|
|
Query = Query & "where p_child_sn = '" & adoRs("p_sn") & "' "
|
|
Else
|
|
Query = Query & "where p_sn = '" & adoRs("p_sn") & "' "
|
|
End If
|
|
Query = Query & "group by p_sn, p_child_sn "
|
|
|
|
'response.Write query & "<br>"
|
|
|
|
adors2.open Query, adoconn,adopenstatic, adlockreadonly
|
|
Dim estimate_money
|
|
estimate_money = 0
|
|
if adors2.recordcount > 0 Then
|
|
estimate_money = adors2("est_money")
|
|
End If
|
|
adors2.close
|
|
|
|
Query = ""
|
|
Query = Query & " select p_sn, isnull(sum(s_sum), 0) as pay "
|
|
Query = Query & " from "
|
|
Query = Query & " ( "
|
|
Query = Query & " select tmp.p_sn, tmp.m_name, tmp.m_jumin, tmp.work_dt, "
|
|
Query = Query & " case when tmp.s_gubun like '추가%' then "
|
|
Query = Query & " ( "
|
|
Query = Query & " select top 1 s_gubun "
|
|
Query = Query & " from t_neakeun_pay "
|
|
Query = Query & " where attribute01 = tmp.attribute01 "
|
|
Query = Query & " and p_sn = tmp.p_sn and s_gubun not like '추가%' "
|
|
Query = Query & " order by s_wan desc "
|
|
Query = Query & " ) "
|
|
Query = Query & " else tmp.s_gubun end as s_gubun, s_sum "
|
|
Query = Query & " from t_neakeun_pay tmp "
|
|
Query = Query & " where isnull(pay_month,'') <> '' "
|
|
Query = Query & " and isnull(attribute05,'') <> '' "
|
|
Query = Query & " and p_sn = '" & adoRs("p_sn") & "' "
|
|
Query = Query & " ) T "
|
|
Query = Query & " where s_gubun = '" & adoRs("s_gubun") & "' "
|
|
Query = Query & " group by p_sn "
|
|
|
|
'response.Write query & "<br>"
|
|
adors2.open Query, adoconn,adopenstatic, adlockreadonly
|
|
Dim currentMoney
|
|
currentMoney = 0
|
|
|
|
if adors2.recordcount > 0 Then
|
|
currentMoney = adors2("pay")
|
|
End If
|
|
|
|
'response.Write adors2.recordcount & "//" & currentMoney & "<br>"
|
|
adors2.close
|
|
|
|
|
|
Dim totalPay, chaPay
|
|
totalPay = CDbl(adoRs("pay"))+CDbl(adoRs("lunch"))+CDbl(adoRs("dinner"))
|
|
chaPay = CDbl(estimate_money) - CDbl(currentMoney) - CDbl(totalPay)
|
|
|
|
If CDbl(estimate_money) * 1.03 - CDbl(currentMoney) - CDbl(totalPay) < 0 Then ' 예산의 3프로를 더 줌
|
|
minus_money_flag = true
|
|
End if
|
|
%>
|
|
<tr>
|
|
<td class="tit7">
|
|
<font class="tahoma">[<%=adoRs("p_sn")%>]
|
|
<%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('<%=adoRs("p_sn")%>', '<%=work_month%>', '<%=sv%>', 1, '<%="field"%>', '<%= d_no %>', '<%=adoRs("s_gubun") %>')">
|
|
<%end if %>
|
|
<br><%=adoRs("p_subject")%></font>
|
|
<font class="tahoma" <% if CDbl(chaPay) < 0 then %> color="red" <% end if %>><%=adoRs("p_progress_status")%></font>
|
|
<% if adoRs("nw") = "" then %>
|
|
<font class="tahoma" <% if CDbl(chaPay) < 0 then %> color="red" <% end if %>>♣♧업무일지 없음♧♣</font>
|
|
<% end if %>
|
|
<br />
|
|
<span style="color:green;">(<%=adoRs("s_gubun") %>)</span>
|
|
<input name = "p_progress_status" type="hidden" value="<%=adoRs("p_progress_status")%>" />
|
|
<input name = "nw" type="hidden" value="<%=adoRs("nw")%>" />
|
|
<input name = "p_subject" type="hidden" value="<%=adoRs("p_subject")%>(<%=adoRs("s_gubun") %>)" />
|
|
<input name = "p_sn" type="hidden" value="<%=adoRs("p_sn")%>" />
|
|
</td>
|
|
<td class="tit7" style="text-align: right;"><font class="tahoma"><%=FormatNumber(CDbl(estimate_money), 0)%></font></td>
|
|
<td class="tit7" style="text-align: right;"><font class="tahoma"><%=FormatNumber(CDbl(currentMoney), 0)%></font></td>
|
|
<td class="tit7" style="text-align: right;"><font class="tahoma"><%=FormatNumber(CDbl(totalPay), 0)%></font></td>
|
|
<td class="tit7" style="text-align: right;"><font class="tahoma" <% if CDbl(chaPay) < 0 then %> color="red" <% end if %>><%=FormatNumber(CDbl(chaPay), 0)%></font></td>
|
|
<td class="tit7" style="text-align: right;">
|
|
<input type=hidden name = "s_gubun" value='<%=adoRs("s_gubun") %>'>
|
|
<input type=hidden name = "estimate_money" value='<%=FormatNumber(CDbl(estimate_money), 0)%>'>
|
|
<input type=hidden name = "currentMoney" value='<%=FormatNumber(CDbl(currentMoney), 0)%>'>
|
|
<input type=hidden name = "totalPay" value='<%=FormatNumber(CDbl(totalPay), 0)%>'>
|
|
<input type=hidden name = "chaPay" value='<%=FormatNumber(CDbl(chaPay), 0)%>'>
|
|
|
|
|
|
<input type=hidden name = "minus_money_flag" value='<%=minus_money_flag%>'>
|
|
<input type="text" name="overMoney_reason" value="<%=overMoney_reason%>" style="width: 98%;"
|
|
<% If minus_money_flag = false Then %> readonly <% End If %> />
|
|
</td>
|
|
<%
|
|
total_estimate_money = total_estimate_money + CDbl(estimate_money)
|
|
total_currentMoney = total_currentMoney + CDbl(currentMoney)
|
|
total_Pay = total_Pay + CDbl(totalPay)
|
|
total_chaPay = total_chaPay + CDbl(chaPay)
|
|
%>
|
|
</tr>
|
|
<%
|
|
adoRs.movenext
|
|
loop
|
|
end if
|
|
adoRs.close
|
|
%>
|
|
<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;"> </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<input type=hidden name = "dataCount" value='<%=dataCount%>'>
|
|
<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>
|
|
|
|
</body>
|
|
</html> |