최초커밋
This commit is contained in:
123
inspection/Ajax_Money.asp
Normal file
123
inspection/Ajax_Money.asp
Normal file
@@ -0,0 +1,123 @@
|
||||
<!-- #include virtual = "lib/config.asp" -->
|
||||
<!-- #include virtual = "include/JSON_2.0.4.asp" -->
|
||||
<%
|
||||
Response.CharSet="euc-kr"
|
||||
Response.AddHeader "Pragma","no-cache"
|
||||
Response.AddHeader "cache-control", "no-staff"
|
||||
Response.Expires = -1
|
||||
|
||||
MoneyDate = Request("MoneyDate")
|
||||
|
||||
query = ""
|
||||
query = query &" select *, CASE WHEN p_subject LIKE '%KRC%' THEN 'KRC' WHEN p_subject LIKE '%KRD%' THEN 'KRD' ELSE 'KRI' END as comp from"&VbCrlf
|
||||
query = query &" ("&VbCrlf
|
||||
query = query &" --<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28>ڵ<EFBFBD> <20><><EFBFBD><EFBFBD>)"&VbCrlf
|
||||
query = query &" select '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' as m_n, TMP.m_name, left(m.M_JUMIN,6) + '-' + right(m.M_JUMIN,7) as M_JUMIN, M.m_mobile, b.b_fullname, isnull(m.m_b_no,'') m_b_no, TMP.p_sn, TPM.p_subject, work_dt, D.d_write_date, s_gubun,"&VbCrlf
|
||||
query = query &" s_pay_unit, s_wan, s_sum, convert(varchar(15),insert_dt,23) as insert_dt, p.p_no, p.p_name, isnull(tmp.attribute05, ' ') as attribute05"&VbCrlf
|
||||
query = query &" from project2.dbo.t_neakeun_pay TMP WITH(NOLOCK) "&VbCrlf
|
||||
query = query &" LEFT OUTER JOIN project2.dbo.neakeun_work NW WITH(NOLOCK) ON TMP.attribute01 = cast(NW.id as varchar)"&VbCrlf
|
||||
query = query &" LEFT OUTER JOIN project2.dbo.T_PROJECT_METHOD TPM WITH(NOLOCK) ON TMP.p_sn = TPM.p_child_sn"&VbCrlf
|
||||
query = query &" LEFT OUTER JOIN project2.dbo.person P WITH(NOLOCK) on TMP.insert_user = p.p_no"&VbCrlf
|
||||
query = query &" LEFT OUTER JOIN project2.dbo.man M WITH(NOLOCK) ON left(tmp.m_jumin,6) = LEFT(m.m_jumin,6) and TMP.m_name = m.m_name"&VbCrlf
|
||||
query = query &" LEFT OUTER JOIN project2.dbo.bank B WITH(NOLOCK) ON m.M_bank = b.b_code"&VbCrlf
|
||||
query = query &" LEFT OUTER JOIN project2.dbo.Document D WITH(NOLOCK) ON isnull(TMP.attribute05,'') = D.d_no"&VbCrlf
|
||||
query = query &" where D.d_order_cnt = '77' "
|
||||
if MoneyDate = "2022-04" Then
|
||||
query = query &" and work_dt between '"&MoneyDate&"-01' and '"&MoneyDate&"-25' "
|
||||
elseif MoneyDate > "2022-04" Then
|
||||
'''''''''''''''''''20230807 <20><><EFBFBD>ؼ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ϵ<EFBFBD><CFB5>ڵ<EFBFBD><DAB5><EFBFBD> Ư<><C6AF> <20><><EFBFBD><EFBFBD> 2023-07<30><37><EFBFBD><EFBFBD> <20><><EFBFBD>ü<EFBFBD> <20>ֵ<EFBFBD><D6B5><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
'''''''''''''''''''query = query &" and work_dt between cast(DATEADD(m,-1,cast('"&MoneyDate&"-26' as date))as varchar) and '"&MoneyDate&"-25' "
|
||||
query = query &" and ( work_dt between cast(DATEADD(m,-1,cast('"&MoneyDate&"-26' as date))as varchar) and '"&MoneyDate&"-25' "
|
||||
query = query &" or ( '"&MoneyDate&"' = '2023-07' and TMP.attribute05 in ('KRC-2023-t-00507','KRC-2023-t-00506','KRC-2023-t-00505')))"
|
||||
'''''''''''''''''''20241205 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ξ<EFBFBD> å<><C3A5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ϵ<EFBFBD><CFB5>ڵ<EFBFBD><DAB5><EFBFBD> Ư<><C6AF> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(n) 2024-11<31><31><EFBFBD><EFBFBD> <20><><EFBFBD>ü<EFBFBD> <20>ֵ<EFBFBD><D6B5><EFBFBD> <20><><EFBFBD><EFBFBD> but <20>ݿ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
' query = query &" or ( '"&MoneyDate&"' = '2023-07' and TMP.attribute05 in ('KRC-2023-t-00507','KRC-2023-t-00506','KRC-2023-t-00505'))"
|
||||
' query = query &" or ( '"&MoneyDate&"' = '2024-11' and TMP.attribute05 in ('KRC-2024-t-01104')))"
|
||||
else
|
||||
query = query & " and LEFT(work_dt, 7) = '" & MoneyDate & "' "
|
||||
end if
|
||||
query = query &" AND NW.in_time + NW.out_time + NW.p_sebu_code <> '000000004'"&VbCrlf
|
||||
query = query &" "&VbCrlf
|
||||
query = query &" union all"&VbCrlf
|
||||
query = query &" --<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28>ڵ<EFBFBD>)"&VbCrlf
|
||||
query = query &" select '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' as m_n, TMP.m_name, left(m.M_JUMIN,6) + '-' + right(m.M_JUMIN,7) as M_JUMIN, M.m_mobile, b.b_fullname, isnull(m.m_b_no,'') m_b_no, TMP.p_sn, TPM.p_subject, work_dt, D.d_write_date, s_gubun,"&VbCrlf
|
||||
query = query &" s_pay_unit, s_wan, s_sum, convert(varchar(15),insert_dt,23) as insert_dt, p.p_no, p.p_name, isnull(tmp.attribute05, ' ') as attribute05"&VbCrlf
|
||||
query = query &" from project2.dbo.t_neakeun_pay TMP WITH(NOLOCK)"&VbCrlf
|
||||
query = query &" LEFT OUTER JOIN project2.dbo.neakeun_work NW WITH(NOLOCK) ON TMP.attribute01 = cast(NW.id as varchar)"&VbCrlf
|
||||
query = query &" LEFT OUTER JOIN project2.dbo.T_PROJECT_METHOD TPM WITH(NOLOCK) ON TMP.p_sn = TPM.p_child_sn"&VbCrlf
|
||||
query = query &" LEFT OUTER JOIN project2.dbo.person P WITH(NOLOCK) on TMP.insert_user = p.p_no"&VbCrlf
|
||||
query = query &" LEFT OUTER JOIN project2.dbo.man M WITH(NOLOCK) ON left(tmp.m_jumin,6) = LEFT(m.m_jumin,6) and TMP.m_name = m.m_name"&VbCrlf
|
||||
query = query &" LEFT OUTER JOIN project2.dbo.bank B WITH(NOLOCK) ON m.M_bank = b.b_code"&VbCrlf
|
||||
query = query &" LEFT OUTER JOIN project2.dbo.Document D WITH(NOLOCK) ON isnull(TMP.attribute05,'') = D.d_no"&VbCrlf
|
||||
query = query &" where D.d_order_cnt = '77'"&VbCrlf
|
||||
if MoneyDate = "2022-04" Then
|
||||
query = query &" and D.d_write_date between '"&MoneyDate&"-16' and cast(DATEADD(m,1,cast('"&MoneyDate&"-05' as date)) as varchar)"&VbCrlf
|
||||
elseif MoneyDate > "2022-04" Then
|
||||
query = query &" and D.d_write_date between '"&MoneyDate&"-06' and cast(DATEADD(m,1,cast('"&MoneyDate&"-05' as date)) as varchar)"&VbCrlf
|
||||
else
|
||||
query = query &" and D.d_write_date between '"&MoneyDate&"-16' and cast(DATEADD(m,1,cast('"&MoneyDate&"-15' as date)) as varchar)"&VbCrlf
|
||||
end if
|
||||
query = query &" AND NW.in_time + NW.out_time + NW.p_sebu_code = '000000004'"&VbCrlf
|
||||
query = query &" "&VbCrlf
|
||||
query = query &" union all"&VbCrlf
|
||||
query = query &" --<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(CATI)"&VbCrlf
|
||||
query = query &" select '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' as m_n, TMP.m_name, left(m.M_JUMIN,6) + '-' + right(m.M_JUMIN,7) as M_JUMIN, M.m_mobile, b.b_fullname, isnull(m.m_b_no,'') m_b_no, TMP.p_sn, TPM.p_subject, TMP.work_dt, D.d_write_date, s_gubun,"&VbCrlf
|
||||
query = query &" s_pay_unit, s_wan + isnull(add_count, 0) as s_wan, s_sum, convert(varchar(15),insert_dt,23) as insert_dt, p.p_no, p.p_name, isnull(tmp.attribute05, ' ') as attribute05"&VbCrlf
|
||||
query = query &" from project2.dbo.t_myun_pay TMP WITH(NOLOCK)"&VbCrlf
|
||||
query = query &" LEFT OUTER JOIN project2.dbo.T_PROJECT_METHOD TPM WITH(NOLOCK) ON TMP.p_sn = TPM.p_child_sn"&VbCrlf
|
||||
query = query &" LEFT OUTER JOIN project2.dbo.person P WITH(NOLOCK) on TMP.insert_user = p.p_no"&VbCrlf
|
||||
query = query &" LEFT OUTER JOIN project2.dbo.man M WITH(NOLOCK) ON left(tmp.m_jumin,6) = LEFT(m.m_jumin,6) and TMP.m_name = m.m_name"&VbCrlf
|
||||
query = query &" LEFT OUTER JOIN project2.dbo.bank B WITH(NOLOCK) ON m.M_bank = b.b_code"&VbCrlf
|
||||
query = query &" LEFT OUTER JOIN project2.dbo.Document D WITH(NOLOCK) ON isnull(TMP.attribute05,'') = D.d_no"&VbCrlf
|
||||
query = query &" where TMP.confirm_yn = 'Y' and s_sum <> '0' and D.d_order_cnt = '77'"&VbCrlf
|
||||
if MoneyDate = "2022-04" Then
|
||||
query = query &" and D.d_write_date between '"&MoneyDate&"-16' and cast(DATEADD(m,1,cast('"&MoneyDate&"-05' as date)) as varchar)"&VbCrlf
|
||||
elseif MoneyDate > "2022-04" Then
|
||||
query = query &" and D.d_write_date between '"&MoneyDate&"-06' and cast(DATEADD(m,1,cast('"&MoneyDate&"-05' as date)) as varchar)"&VbCrlf
|
||||
else
|
||||
query = query &" and D.d_write_date between '"&MoneyDate&"-16' and cast(DATEADD(m,1,cast('"&MoneyDate&"-15' as date)) as varchar)"&VbCrlf
|
||||
end if
|
||||
query = query &" ) T"&VbCrlf
|
||||
query = query &" order by p_sn, s_gubun"&VbCrlf
|
||||
'Response.Write query
|
||||
Rs.Open query, adoConn, 1
|
||||
set json = jsObject()
|
||||
Redim data(Rs.recordcount-1)
|
||||
iCnt = 0
|
||||
|
||||
if not Rs.eof then
|
||||
while not Rs.eof
|
||||
set MoneyList = jsObject()
|
||||
MoneyList("Company") = Rs("comp")
|
||||
MoneyList("P_Sn") = Rs("p_sn")
|
||||
MoneyList("P_Subject") = Rs("p_subject")
|
||||
MoneyList("P_Name") = Rs("m_name")
|
||||
MoneyList("M_Jumin") = Rs("M_JUMIN")
|
||||
MoneyList("M_Work") = Rs("s_gubun")
|
||||
MoneyList("Danga") = Rs("s_pay_unit")
|
||||
MoneyList("Cnt") = Rs("s_wan")
|
||||
MoneyList("Allowance") = Rs("s_sum")
|
||||
MoneyList("WorkDate") = Rs("work_dt")
|
||||
MoneyList("Doc_Date") = Rs("d_write_date")
|
||||
MoneyList("M_Phone") = Rs("m_mobile")
|
||||
MoneyList("M_Bank") = Rs("b_fullname")
|
||||
MoneyList("M_Acount") = CStr(Rs("m_b_no"))
|
||||
MoneyList("P_No") = Rs("p_no")
|
||||
MoneyList("P_SV") = Rs("p_name")
|
||||
MoneyList("ConfirmDate") = Rs("insert_dt")
|
||||
MoneyList("D_No") = Rs("attribute05")
|
||||
MoneyList("M_Gubun") = Rs("m_n")
|
||||
set data(iCnt) = MoneyList
|
||||
iCnt = iCnt + 1
|
||||
Rs.movenext
|
||||
wend
|
||||
json("recordsTotal") = Rs.recordcount
|
||||
json("recordsFiltered") = Rs.recordcount
|
||||
json("data") = data
|
||||
Else
|
||||
json("data") = ""
|
||||
End If
|
||||
|
||||
Rs.close
|
||||
|
||||
response.write toJSON(json)
|
||||
%>
|
||||
Reference in New Issue
Block a user