|
|
|
|
<%
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 startDT <> "" then %><%=startDT%> ~ <%=endDT%><% else %>프로젝트단위<%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_method_cd from T_PROJECT_METHOD where p_child_sn = '" & p_child_sn & "' "
adoRs.open Query, adoconn,adopenstatic, adlockreadonly
if adoRs.recordcount > 0 Then
p_method_cd = adoRs("p_method_cd")
end if
adoRs.close
%>
<%
Query = " select p_child_sn, sebu, sum(est_money) as est_money, sum(accumulate_pay) as accumulate_pay, sum(pay) as 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 "
Query = Query & " from ( "
Query = Query & " select * from direct_cost where left(p_sn, 2) >= '15' and hangmok = '48' and del_yes_no = 'no' and p_child_sn = '" & p_child_sn & "' union all"
Query = Query & " select * from direct_cost where left(p_sn, 2) >= '15' and hangmok = '49' and sebu = '해독원' and del_yes_no = 'no' and p_child_sn = '" & p_child_sn & "' "
Query = Query & " ) as T1 "
Query = Query & " union all "
Query = Query & " select p_sn as p_child_sn, est_money as sebu, "
Query = Query & " 0 as est_money, isnull("
Query = Query & " case when s_gubun = 'FF' then s_sum - s_sum + add_money + (s_pay_unit * (s_wan + add_count)) else s_sum end"
Query = Query & " , 0) as accumulate_pay, 0 as pay "
Query = Query & " from t_myun_pay "
Query = Query & " where pay_type = 2 and isnull(attribute05,'') <> '' and p_sn = '" & p_child_sn & "' "
Query = Query & " union all "
Query = Query & " select p_sn as p_child_sn, est_money as sebu, "
Query = Query & " 0 as est_money, 0 as accumulate_pay, isnull("
Query = Query & " case when s_gubun = 'FF' then s_sum - s_sum + add_money + (s_pay_unit * (s_wan + add_count)) else s_sum end"
Query = Query & " , 0) as pay "
Query = Query & " from t_myun_pay "
Query = Query & " where pay_type = 2 and isnull(attribute05,'') = '" & krc_no & "' and p_sn = '" & p_child_sn & "' and confirm_yn = 'Y' "
Query = Query & " union all "
Query = Query & " select '" & p_child_sn & "' as p_child_sn, '교육비' as sebu, "
Query = Query & " 0 as est_money, isnull((select sum(s_sum - add_money - (s_pay_unit * (s_wan + add_count))) from T_MYUN_PAY where p_sn = '" & p_child_sn & "' and pay_type = 2 and isnull(attribute05,'') <> '' and s_ot = 'Y' and confirm_yn = 'Y'), 0) as accumulate_pay, 0 as pay "
Query = Query & " union all "
Query = Query & " select '" & p_child_sn & "' as p_child_sn, '교육비' as sebu, "
Query = Query & " 0 as est_money, 0 as accumulate_pay, isnull((select sum(s_sum - add_money - (s_pay_unit * (s_wan + add_count))) from T_MYUN_PAY where p_sn = '" & p_child_sn & "' and pay_type = 2 and isnull(attribute05,'') = '" & krc_no & "' and s_ot = 'Y' and confirm_yn = 'Y'),'0') as pay "
Query = Query & " union all "
Query = Query & " SELECT CONVERT(varchar, target10) AS p_sn, DC.d_cost_name, "
Query = Query & " 0 AS est_money, sum(CONVERT(NUMERIC(18, 0), CONVERT(varchar, target5))) AS accumulate_pay, "
Query = Query & " 0 AS pay "
Query = Query & " FROM 문서내용 M LEFT JOIN direct_costcode DC ON CONVERT(integer, CONVERT(varchar, M.target12)) = DC.id "
Query = Query & " WHERE del_yes_no='no' AND (target11 LIKE '48' OR (target11 LIKE '49' AND target12 LIKE '77')) "
Query = Query & " AND CONVERT(varchar, target10) = '" & p_child_sn & "' "
Query = Query & " GROUP BY CONVERT(varchar, target10), DC.d_cost_name "
Query = Query & " ) as T2 "
Query = Query & " group by p_child_sn, sebu "
Query = Query & " order by est_money desc "
'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
'-- 미사용 if p_method_cd <> "2" and adoRs("sebu") = "교육비" Then '-- 해당조건으로 교육비가 나오고 안나오고 함(교육비를 무조건 나오게 할경우 해당 내용(조건)을 주석처리 할것!!(20171217) --> 필요없는 조건임
'-- 미사용 else
%>
| <%=adoRs("sebu")%> |
<%=FormatNumber(CDbl(adoRs("pay")), 0)%> |
<%=FormatNumber(CDbl(adoRs("est_money")), 0)%> |
<%=FormatNumber(CDbl(adoRs("accumulate_pay")), 0)%> |
<% chaPay = CDbl(adoRs("est_money")) - CDbl(adoRs("accumulate_pay")) %>
color="red" <% end if %>><%=FormatNumber(CDbl(chaPay), 0)%> |
<%
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"))
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)%> |
| 결재 상신 전에는 예상 잔액이 다르게 보일 수 있습니다. |
| 하단 리스트 중 배경색상이 [ ] 인 리스트는 내근직 업무일지가 있는 면접원 입니다. |
| |
| 면접원성명 |
생년월일 |
부수/일당 |
단가 |
TOK(일 수) |
추가부수 |
추가수당 |
<%if p_method_cd = "1" then %>추가(TS)<% else %>교육비<% end if %> |
합계 |
사유보기 |
<%
Query = " select m_name, m_jumin, sum(s_wan) as s_wan, s_pay_unit, count(*) as day_cnt, isnull(money_type, case when T.s_gubun = 'ETC' then '기타' else '' end) as money_type, SUM(food_cost) as food_cost, SUM(s_sum) as s_sum, sum(add_count) as add_count, sum(add_money) as add_money, sum(total_sum) as total_sum, sum(nw_cnt) as nw_cnt from "&VbCrlf
Query = Query & " (select m_name, left(m_jumin,6) as m_jumin, s_wan, s_pay_unit, money_type, s_gubun, "&VbCrlf
Query = Query & " case when money_type = '부수' and lunch = 'Y' then 5000 else 0 end + case when money_type = '부수' and dinner = 'Y' then 5000 else 0 end + "&VbCrlf
Query = Query & " case when isnull(s_ot,'N') <> 'N' then s_sum - (s_pay_unit * (add_count + s_wan) + add_money) else 0 end as food_cost, "&VbCrlf
Query = Query & " s_sum - (case when money_type = '부수' and lunch = 'Y' then 5000 else 0 end + case when money_type = '부수' and dinner = 'Y' then 5000 else 0 end + "&VbCrlf
Query = Query & " case when isnull(s_ot,'N') <> 'N' then s_sum - (s_pay_unit * (add_count + s_wan) + add_money) else 0 end ) - (s_pay_unit * add_count) - add_money as s_sum , isnull(add_count,'0') as add_count, add_money, s_sum as total_sum, isnull(nwc.nw_cnt, 0) as nw_cnt "&VbCrlf
Query = Query & " from T_MYUN_PAY TMP "&VbCrlf
Query = Query & " left outer join ( "&VbCrlf
Query = Query & " SELECT neakeun_name, LEFT(neakeun_jumin, 6) as neakeun_jumin, date, COUNT(*) as nw_cnt "&VbCrlf
Query = Query & " FROM neakeun_work "&VbCrlf
Query = Query & " GROUP BY neakeun_name, LEFT(neakeun_jumin, 6), date "&VbCrlf
Query = Query & " ) nwc on TMP.m_name = nwc.neakeun_name AND LEFT(TMP.m_jumin, 6) = nwc.neakeun_jumin AND TMP.work_dt = nwc.date "&VbCrlf
Query = Query & " where pay_type = 2 and isnull(attribute05,'') = '" & krc_no & "' and p_sn = '" & p_child_sn & "' and confirm_yn = 'Y' ) T "&VbCrlf
Query = Query & " group by m_name, m_jumin, s_pay_unit, money_type, s_gubun "&VbCrlf
Query = Query & " order by m_name, money_type, s_pay_unit "&VbCrlf
'Response.Write query & " "
adoRs.open Query, adoconn,adopenstatic, adlockreadonly
dim total_s_wan
dim total_food_cost, total_total_sum, total_add_count, total_add_money
total_s_wan = 0
total_food_cost = 0
total_total_sum = 0
total_add_count = 0
total_add_money = 0
if adoRs.recordcount > 0 Then
do while not adoRs.eof
%>
| 0 then %> style="background-color:#F6CEF5;" <% end if %>><%=adoRs("m_name") %> |
0 then %> style="background-color:#F6CEF5;" <% end if %>><%=adoRs("m_jumin") %> |
0 then %> style="background-color:#F6CEF5;" <% end if %>> color="blue" <% end if %>><%=adoRs("money_type") %> |
0 then %> style="background-color:#F6CEF5;" <% end if %>><%=FormatNumber(adoRs("s_pay_unit"), 0) %> |
0 then %> style="background-color:#F6CEF5;" <% end if %>><% if adoRs("money_type") <> "일당" then %><%=FormatNumber(adoRs("s_wan"), 1) %><%else %><%= FormatNumber(adoRs("day_cnt"), 0)%><% end if %> |
0 then %> style="background-color:#F6CEF5;" <% end if %>><% if adoRs("money_type") <> "일당" then %><%=FormatNumber(adoRs("add_count"), 0) %><% end if %> |
0 then %> style="background-color:#F6CEF5;" <% end if %>><%=FormatNumber(adoRs("add_money"), 0) %> |
0 then %> style="background-color:#F6CEF5;" <% end if %>><% if adoRs("money_type") <> "일당" then %><%=FormatNumber(adoRs("food_cost"), 0) %><% end if %> |
0 then %> style="background-color:#F6CEF5;" <% end if %>><%=FormatNumber(adoRs("total_sum"), 0) %> |
0 then %> style="background-color:#F6CEF5;" <% end if %>><%if FormatNumber(adoRs("add_count"), 0) <> 0 OR FormatNumber(adoRs("add_money"), 0) <> 0 then %>', '<%=adoRs("m_jumin") %>', '<%= krc_no %>', '<%= p_child_sn %>');">보기<%else %>없음<%end if %> |
<%
total_s_wan = total_s_wan + cdbl(adoRs("s_wan"))
total_food_cost = total_food_cost + cdbl(adoRs("food_cost"))
total_total_sum = total_total_sum + cdbl(adoRs("total_sum"))
total_add_count = total_add_count + cdbl(adoRs("add_count"))
total_add_money = total_add_money + cdbl(adoRs("add_money"))
adoRs.movenext
loop
end if
adoRs.close
%>
| 합계 |
<%=FormatNumber(total_s_wan, 1)%> |
<%=FormatNumber(total_add_count, 0)%> |
<%=FormatNumber(total_add_money, 0)%> |
<%=FormatNumber(total_food_cost, 0)%> |
<%=FormatNumber(total_total_sum, 0)%> |
|
|
|
|