|
|
|
|
<%
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
%>
| 수당 결재 기간 |
<%
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
else
Response.Write work_month
end if
%> |
수당 담당자 |
<%=pay_apply_username%> |
| 프로젝트코드 |
<%=p_child_sn%> |
프로젝트 명 |
<%
Query = " select p_sn, p_child_sn, p_subject from v_project_method "
Query = Query & " where p_child_sn = '" & p_child_sn & "' "
'Response.Write query & " "
adoRs.open Query, adoconn,adopenstatic, adlockreadonly
Dim tmp_p_subject
tmp_p_subject = ""
if adoRs.recordcount > 0 Then
tmp_p_subject = adoRs("p_subject")
End If
adoRs.close
%>
<%=tmp_p_subject%> |
|
| 비용세부항목 |
세부지출결의비용 |
예상직접비 |
누적비용(결재중 포함) |
예상잔액 |
<%
Query = " select p_child_sn, sebu, sum(est_money) as est_money, sum(accumulate_pay) as accumulate_pay, sum(pay) as pay, sum(food_pay) as food_pay "
Query = Query & " from ( "
Query = Query & " select p_child_sn, sebu, convert(numeric(18,0), est_money) as est_money, 0 as accumulate_pay, 0 as pay, 0 as food_pay "
Query = Query & " from ( "
Query = Query & " select * from direct_cost where left(p_sn, 2) >= '14' and hangmok = '49' and del_yes_no = 'no' and sebu != '해독원' "
Query = Query & " union all "
Query = Query & " select * from direct_cost where left(p_sn, 2) >= '14' and hangmok in ('감청','검증','에디팅','컨택','코더','펀칭','AS비용') and del_yes_no='no' "
Query = Query & " ) as T1 "
Query = Query & " where p_child_sn = '" & p_child_sn & "' "
Query = Query & " union all "
Query = Query & " select p_sn as p_child_sn, case when left(s_gubun, 2) = '추가' then "
Query = Query & " (select top 1 s_gubun from t_neakeun_pay where attribute01 = a.attribute01 and left(s_gubun, 2) <> '추가') +'_'+ s_gubun "
Query = Query & " else s_gubun end as sebu, 0 as est_money, isnull(s_sum, 0) as accumulate_pay, 0 as pay, "
Query = Query & " case when left(s_gubun, 2) <> '추가' then "
Query = Query & " ISNULL((select sum(s_sum) from t_neakeun_pay where attribute01 = a.attribute01 and left(s_gubun, 2) = '추가'),0) "
Query = Query & " else 0 end as food_pay "
Query = Query & " from t_neakeun_pay a "
Query = Query & " where pay_type = 1 and isnull(attribute05,'') <> '' and p_sn = '" & p_child_sn & "' "
Query = Query & " union all "
Query = Query & " select a.p_sn as p_child_sn, case when left(s_gubun, 2) = '추가' then "
Query = Query & " (select top 1 s_gubun from t_neakeun_pay where attribute01 = a.attribute01 and left(s_gubun, 2) <> '추가') +'_'+ s_gubun "
Query = Query & " else s_gubun end as sebu, 0 as est_money, 0 as accumulate_pay, isnull(a.s_sum, 0) as pay, 0 as food_pay "
Query = Query & " from t_neakeun_pay a left outer join neakeun_work nw on a.attribute01 = nw.id "
Query = Query & " where attribute01 in ( "
Query = Query & " select attribute01 from t_neakeun_pay np left join neakeun_work w on np.attribute01 = w.id "
Query = Query & " where pay_type = 1 and isnull(a.attribute05,'') = '" & krc_no & "' "
if work_month = "2022-04" Then
Query = Query & " and ((work_dt between '" & work_month & "-01' and '" & work_month & "-25' AND W.in_time + W.out_time + W.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 W.in_time + W.out_time + W.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 W.in_time + W.out_time + W.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 W.in_time + W.out_time + W.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 W.in_time + W.out_time + W.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 W.in_time + W.out_time + W.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 W.in_time + W.out_time + W.p_sebu_code = '000000004')) "
Query = Query & " and a.p_sn = '" & p_child_sn & "' and nw.p_sv_no = '" & sv & "' and s_gubun = '" & work_kind & "') "
Query = Query & " ) as T2 "
Query = Query & " group by p_child_sn, sebu "
Query = Query & " order by sebu "
'Response.Write query & " "
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
%>
| <%=adoRs("sebu")%> |
<%=FormatNumber(CDbl(adoRs("pay")), 0)%> |
<%if instr(1,adoRs("sebu"),"_") = false then %><%=FormatNumber(CDbl(adoRs("est_money")), 0)%><%end if %> |
<%=FormatNumber(CDbl(adoRs("accumulate_pay")), 0)%> |
<% chaPay = CDbl(adoRs("est_money")) - CDbl(adoRs("accumulate_pay")) - CDbl(adoRs("food_pay")) %>
color="red" <% end if %>><%if instr(1,adoRs("sebu"),"_") = false then %><%=FormatNumber(CDbl(chaPay), 0)%><%end if %> |
<%
total_estimate_money = total_estimate_money + CDbl(adoRs("est_money"))
total_currentMoney = total_currentMoney + CDbl(adoRs("accumulate_pay"))
total_Pay = total_Pay + CDbl(adoRs("pay"))
if instr(1,adoRs("sebu"),"_") = false then
total_chaPay = total_chaPay + CDbl(chaPay)
end if
%>
<%
adoRs.movenext
loop
end if
adoRs.close
%>
| 합계 |
<%=FormatNumber(total_Pay, 0)%> |
<%=FormatNumber(total_estimate_money, 0)%> |
<%=FormatNumber(total_currentMoney, 0)%> |
<%=FormatNumber(total_chaPay, 0)%> |
| 결재 상신 전에는 예상 잔액이 다르게 보일 수 있습니다. |
| 내근직성명 |
생년월일 |
업무 |
수당 |
추가수당(점심) |
합계 |
<%
Query = ""
Query = Query & " SELECT m_name, m_jumin, s_gubun, SUM(s_sum) as s_sum, SUM(add_1) as add_1, SUM(add_2) as add_2 FROM "&VbCrlf
Query = Query & " ( "&VbCrlf
Query = Query & " select a.m_name, a.m_jumin, s_gubun, s_sum, "&VbCrlf
Query = Query & " isnull((select s_sum from t_neakeun_pay where attribute01 = a.attribute01 and s_gubun = '추가수당1'), 0) as add_1, "&VbCrlf
Query = Query & " isnull((select s_sum from t_neakeun_pay where attribute01 = a.attribute01 and s_gubun = '추가수당2'), 0) as add_2 "&VbCrlf
Query = Query & " from t_neakeun_pay a "&VbCrlf
Query = Query & " left outer join neakeun_work nw on a.attribute01 = nw.id "&VbCrlf
Query = Query & " where pay_type = 1 and isnull(a.attribute05,'') = '" & krc_no & "' "
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 a.p_sn = '" & p_child_sn & "' and p_sv_no = '" & sv & "' "&VbCrlf
Query = Query & " and left(s_gubun, 2) <> '추가' and s_gubun = '" & work_kind & "' "&VbCrlf
Query = Query & " ) T "&VbCrlf
Query = Query & " group by m_name, m_jumin, s_gubun "&VbCrlf
Query = Query & " Order by m_name "&VbCrlf
'Response.Write query & " "
adoRs.open Query, adoconn,adopenstatic, adlockreadonly
Dim s_sum_sum, add_1_sum, add_2_sum
if adoRs.recordcount > 0 Then
do while not adoRs.eof
%>
|
', '<%=left(adoRs("m_jumin"), 6)%>', '<%=escape(adoRs("s_gubun"))%>');">
▼▲<%=adoRs("m_name")%> |
<%=left(adoRs("m_jumin"), 6)%> |
<%=adoRs("s_gubun")%> |
<%=FormatNumber(CDbl(adoRs("s_sum")), 0)%> |
<%=FormatNumber(CDbl(adoRs("add_1")), 0)%> |
<%=FormatNumber(CDbl(adoRs("s_sum")) + CDbl(adoRs("add_1")) + CDbl(adoRs("add_2")), 0)%> |
<%
s_sum_sum = s_sum_sum + CDbl(adoRs("s_sum"))
add_1_sum = add_1_sum + CDbl(adoRs("add_1"))
add_2_sum = add_2_sum + CDbl(adoRs("add_2"))
%>
|
<%
adoRs.movenext
loop
end if
adoRs.close
%>
| 합계 |
<%=FormatNumber(s_sum_sum, 0)%> |
<%=FormatNumber(add_1_sum, 0)%> |
<%=FormatNumber(s_sum_sum + add_1_sum + add_2_sum, 0)%> |
| 결재 상신 전에는 예상 잔액이 다르게 보일 수 있습니다. |
|
|
|