최남식 :: 20260225 :: 수당 결재 기간 변경

This commit is contained in:
2026-02-27 10:42:26 +09:00
parent 68df4200f0
commit 4d14279ff8
5 changed files with 166 additions and 47 deletions

View File

@@ -191,8 +191,19 @@
Query = Query & " where ((work_dt between '" & sel_month & "-01' and '" & sel_month & "-25' AND A.in_time + A.out_time + A.p_sebu_code <> '000000004') OR " Query = Query & " where ((work_dt between '" & sel_month & "-01' and '" & sel_month & "-25' AND A.in_time + A.out_time + A.p_sebu_code <> '000000004') OR "
Query = Query & " (work_dt between '" & sel_month & "-16' and cast(DATEADD(m,1,cast('" & sel_month & "-05' as date)) as varchar) " Query = Query & " (work_dt between '" & sel_month & "-16' and cast(DATEADD(m,1,cast('" & sel_month & "-05' as date)) as varchar) "
elseif sel_month > "2022-04" Then elseif sel_month > "2022-04" Then
Query = Query & " where ((work_dt between cast(DATEADD(m,-1,cast('" & sel_month & "-26' as date))as varchar) and '" & sel_month & "-25' AND A.in_time + A.out_time + A.p_sebu_code <> '000000004') OR " '<27>ֳ<EFBFBD><D6B3><EFBFBD> :: 20260225 :: <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>Ⱓ <20><><EFBFBD><EFBFBD>
Query = Query & " (work_dt between '" & sel_month & "-06' and cast(DATEADD(m,1,cast('" & sel_month & "-05' as date)) as varchar) " If Right(sel_month, 2) = "02" Then
'2<><32>: <20><><EFBFBD><EFBFBD> 26<32><36> ~ 2<><32> 28<32><38>(<28><><EFBFBD><EFBFBD>)
Query = Query & " where ((work_dt between cast(DATEADD(m,-1,cast('" & sel_month & "-26' as date)) as varchar(10)) and '" & sel_month & "-28' AND A.in_time + A.out_time + A.p_sebu_code <> '000000004') "
ElseIf CInt(Right(sel_month, 2)) < 3 Then
'2<><32> <20><><EFBFBD><EFBFBD>(1<><31> <20><>): <20><><EFBFBD><EFBFBD> 26<32><36> ~ <20>ش<EFBFBD><D8B4><EFBFBD> 25<32><35>
Query = Query & " where ((work_dt between cast(DATEADD(m,-1,cast('" & sel_month & "-26' as date)) as varchar(10)) and '" & sel_month & "-25' AND A.in_time + A.out_time + A.p_sebu_code <> '000000004') "
Else
'3<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20>ش<EFBFBD><D8B4><EFBFBD> 1<><31> ~ <20><><EFBFBD><EFBFBD>
Query = Query & " where ((work_dt between '" & sel_month & "-01' and convert(varchar(10),EOMONTH(cast('" & sel_month & "-01' as date)),23) AND A.in_time + A.out_time + A.p_sebu_code <> '000000004') "
End If
'Query = Query & " where ((work_dt between cast(DATEADD(m,-1,cast('" & sel_month & "-26' as date))as varchar) and '" & sel_month & "-25' AND A.in_time + A.out_time + A.p_sebu_code <> '000000004') "
Query = Query & " OR (work_dt between '" & sel_month & "-06' and cast(DATEADD(m,1,cast('" & sel_month & "-05' as date)) as varchar) "
else else
Query = Query & " where ((LEFT(work_dt, 7) = '" & sel_month & "' AND A.in_time + A.out_time + A.p_sebu_code <> '000000004') OR " Query = Query & " where ((LEFT(work_dt, 7) = '" & sel_month & "' AND A.in_time + A.out_time + A.p_sebu_code <> '000000004') OR "
Query = Query & " (work_dt between '" & sel_month & "-16' and cast(DATEADD(m,1,cast('" & sel_month & "-15' as date)) as varchar) " Query = Query & " (work_dt between '" & sel_month & "-16' and cast(DATEADD(m,1,cast('" & sel_month & "-15' as date)) as varchar) "
@@ -373,7 +384,17 @@
if sel_month = "2022-04" Then if sel_month = "2022-04" Then
query = query & " where date between '"&sel_month&"-01' and '"&sel_month&"-25' " query = query & " where date between '"&sel_month&"-01' and '"&sel_month&"-25' "
elseif sel_month > "2022-04" Then elseif sel_month > "2022-04" Then
query = query & " where date between cast(DATEADD(m,-1,cast('"&sel_month&"-26' as date))as varchar) and '"&sel_month&"-25' " If Right(sel_month, 2) = "02" Then
'2<><32>: <20><><EFBFBD><EFBFBD> 26<32><36> ~ 2<><32> 28<32><38>(<28><><EFBFBD><EFBFBD>)
query = query & " where date between cast(DATEADD(m,-1,cast('" & sel_month & "-26' as date)) as varchar) and '" & sel_month & "-28' "
ElseIf CInt(Right(sel_month, 2)) < 3 Then
'2<><32> <20><><EFBFBD><EFBFBD>(1<><31> <20><>): <20><><EFBFBD><EFBFBD> 26<32><36> ~ <20>ش<EFBFBD><D8B4><EFBFBD> 25<32><35>
query = query & " where date between cast(DATEADD(m,-1,cast('"&sel_month&"-26' as date))as varchar) and '"&sel_month&"-25' "
Else
'3<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20>ش<EFBFBD><D8B4><EFBFBD> 1<><31> ~ <20><><EFBFBD><EFBFBD>
query = query & " where date between '" & sel_month & "-01' and EOMONTH('" & sel_month & "-01') "
End If
'query = query & " where date between cast(DATEADD(m,-1,cast('"&sel_month&"-26' as date))as varchar) and '"&sel_month&"-25' "
else else
query = query & " where date like '" & sel_month & "%' " query = query & " where date like '" & sel_month & "%' "
end if end if

View File

@@ -222,7 +222,17 @@
if work_month = "2022-04" Then if work_month = "2022-04" Then
Response.Write work_month & "-01 ~ " & work_month & "-25" Response.Write work_month & "-01 ~ " & work_month & "-25"
elseif work_month > "2022-04" Then elseif work_month > "2022-04" Then
Response.Write DATEADD("m",-1,cdate(work_month & "-26")) & " ~ " & work_month & "-25" '<27>ֳ<EFBFBD><D6B3><EFBFBD> :: 20260225 :: <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>Ⱓ <20><><EFBFBD><EFBFBD>
If CDate(work_month & "-01") >= CDate("2026-03-01") Then
'2026<32><36> 3<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1<><31> ~ <20><><EFBFBD><EFBFBD>
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<32><36> 2<><32><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD> 26<32><36> ~ <20>̹<EFBFBD><CCB9><EFBFBD> <20><><EFBFBD><EFBFBD>
Response.Write DateAdd("m",-1, CDate(work_month & "-26")) & " ~ " & DateAdd("d",-1,DateAdd("m",1,CDate(work_month & "-01")))
Else
'2026<32><36> 3<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> 26<32><36> ~ <20>̹<EFBFBD><CCB9><EFBFBD> 25<32><35>
Response.Write DATEADD("m",-1,cdate(work_month & "-26")) & " ~ " & work_month & "-25"
End If
else else
Response.Write work_month Response.Write work_month
end if end if
@@ -297,8 +307,19 @@
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 & " 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) " 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 elseif work_month > "2022-04" Then
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') OR " '<27>ֳ<EFBFBD><D6B3><EFBFBD> :: 20260225 :: <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>Ⱓ <20><><EFBFBD><EFBFBD>
Query = Query & " (work_dt between '" & work_month & "-06' and cast(DATEADD(m,1,cast('" & work_month & "-05' as date)) as varchar) " If Right(work_month, 2) = "02" Then
'2<><32>: <20><><EFBFBD><EFBFBD> 26<32><36> ~ 2<><32> 28<32><38>(<28><><EFBFBD><EFBFBD>)
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<><32> <20><><EFBFBD><EFBFBD>(1<><31> <20><>): <20><><EFBFBD><EFBFBD> 26<32><36> ~ <20>ش<EFBFBD><D8B4><EFBFBD> 25<32><35>
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<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20>ش<EFBFBD><D8B4><EFBFBD> 1<><31> ~ <20><><EFBFBD><EFBFBD>
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 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 & " 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) " Query = Query & " (work_dt between '" & work_month & "-16' and cast(DATEADD(m,1,cast('" & work_month & "-15' as date)) as varchar) "
@@ -386,8 +407,19 @@
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 & " 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) " 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 elseif work_month > "2022-04" Then
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') OR " '<27>ֳ<EFBFBD><D6B3><EFBFBD> :: 20260225 :: <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>Ⱓ <20><><EFBFBD><EFBFBD>
Query = Query & " (work_dt between '" & work_month & "-06' and cast(DATEADD(m,1,cast('" & work_month & "-05' as date)) as varchar) " If Right(work_month, 2) = "02" Then
'2<><32>: <20><><EFBFBD><EFBFBD> 26<32><36> ~ 2<><32> 28<32><38>(<28><><EFBFBD><EFBFBD>)
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<><32> <20><><EFBFBD><EFBFBD>(1<><31> <20><>): <20><><EFBFBD><EFBFBD> 26<32><36> ~ <20>ش<EFBFBD><D8B4><EFBFBD> 25<32><35>
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<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20>ش<EFBFBD><D8B4><EFBFBD> 1<><31> ~ <20><><EFBFBD><EFBFBD>
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 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 & " 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) " Query = Query & " (work_dt between '" & work_month & "-16' and cast(DATEADD(m,1,cast('" & work_month & "-15' as date)) as varchar) "

View File

@@ -46,8 +46,19 @@
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 & " 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) " 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 elseif work_month > "2022-04" Then
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') OR " '<27>ֳ<EFBFBD><D6B3><EFBFBD> :: 20260225 :: <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>Ⱓ <20><><EFBFBD><EFBFBD>
Query = Query & " (work_dt between '" & work_month & "-06' and cast(DATEADD(m,1,cast('" & work_month & "-05' as date)) as varchar) " If Right(work_month, 2) = "02" Then
'2<><32>: <20><><EFBFBD><EFBFBD> 26<32><36> ~ 2<><32> 28<32><38>(<28><><EFBFBD><EFBFBD>)
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<><32> <20><><EFBFBD><EFBFBD>(1<><31> <20><>): <20><><EFBFBD><EFBFBD> 26<32><36> ~ <20>ش<EFBFBD><D8B4><EFBFBD> 25<32><35>
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<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20>ش<EFBFBD><D8B4><EFBFBD> 1<><31> ~ <20><><EFBFBD><EFBFBD>
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 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 & " 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) " Query = Query & " (work_dt between '" & work_month & "-16' and cast(DATEADD(m,1,cast('" & work_month & "-15' as date)) as varchar) "

View File

@@ -321,8 +321,19 @@
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 & " 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) " 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 elseif work_month > "2022-04" Then
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 " '<27>ֳ<EFBFBD><D6B3><EFBFBD> :: 20260225 :: <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>Ⱓ <20><><EFBFBD><EFBFBD>
query = query & " (work_dt between '" & work_month & "-06' and cast(DATEADD(m,1,cast('" & work_month & "-05' as date)) as varchar) " If Right(work_month, 2) = "02" Then
'2<><32>: <20><><EFBFBD><EFBFBD> 26<32><36> ~ 2<><32> 28<32><38>(<28><><EFBFBD><EFBFBD>)
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<><32> <20><><EFBFBD><EFBFBD>(1<><31> <20><>): <20><><EFBFBD><EFBFBD> 26<32><36> ~ <20>ش<EFBFBD><D8B4><EFBFBD> 25<32><35>
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<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20>ش<EFBFBD><D8B4><EFBFBD> 1<><31> ~ <20><><EFBFBD><EFBFBD>
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 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 & " 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) " query = query & " (work_dt between '" & work_month & "-16' and cast(DATEADD(m,1,cast('" & work_month & "-15' as date)) as varchar) "
@@ -341,7 +352,18 @@
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 & " 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) " 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 elseif work_month > "2022-04" Then
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 " '<27>ֳ<EFBFBD><D6B3><EFBFBD> :: 20260225 :: <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>Ⱓ <20><><EFBFBD><EFBFBD>
If Right(work_month, 2) = "02" Then
'2<><32>: <20><><EFBFBD><EFBFBD> 26<32><36> ~ 2<><32> 28<32><38>(<28><><EFBFBD><EFBFBD>)
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<><32> <20><><EFBFBD><EFBFBD>(1<><31> <20><>): <20><><EFBFBD><EFBFBD> 26<32><36> ~ <20>ش<EFBFBD><D8B4><EFBFBD> 25<32><35>
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<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20>ش<EFBFBD><D8B4><EFBFBD> 1<><31> ~ <20><><EFBFBD><EFBFBD>
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) " query = query & " (work_dt between '" & work_month & "-06' and cast(DATEADD(m,1,cast('" & work_month & "-05' as date)) as varchar) "
else 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 & " where ((LEFT(work_dt, 7) = '" & work_month & "' AND T.in_time + T.out_time + T.p_sebu_code <> '000000004') OR "
@@ -350,7 +372,7 @@
query = query & " AND T.in_time + T.out_time + T.p_sebu_code = '000000004')) " 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_sn = '" & p_sn_c & "' and isnull(T.attribute05,'') = '' "
query = query & " and p_sv_no = '" & sv & "' " query = query & " and p_sv_no = '" & sv & "' "
query = query & " group by T.id, m_name, m_jumin, LEFT(work_dt, 7)) " query = query & " group by T.id, m_name, m_jumin, LEFT(work_dt, 7)) "
adoconn.execute query adoconn.execute query
End if End if
@@ -369,7 +391,7 @@
query = query & " left outer join neakeun_work nw on t.attribute01 = nw.id " query = query & " left outer join neakeun_work nw on t.attribute01 = nw.id "
query = query & " WHERE isnull(t.attribute05,'') = '" & krc_no & "' " query = query & " WHERE isnull(t.attribute05,'') = '" & krc_no & "' "
query = query & " group by s_gubun, t.p_sn " query = query & " group by s_gubun, t.p_sn "
rsc.open query, adoconn,adopenstatic, adlockreadonly rsc.open query, adoconn,adopenstatic, adlockreadonly
do while not rsc.eof do while not rsc.eof
directQuery = " UPDATE direct_cost " directQuery = " UPDATE direct_cost "
@@ -381,7 +403,7 @@
dbin.Open adoConn dbin.Open adoConn
dbin.Execute directQuery, i dbin.Execute directQuery, i
dbin.Close dbin.Close
if i < 1 then if i < 1 then
Query = "select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȣ as krc_no from <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> " Query = "select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȣ as krc_no from <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "
query = query & " where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> = '" & replace(title, " ", "") & "' " query = query & " where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> = '" & replace(title, " ", "") & "' "
@@ -389,7 +411,7 @@
query = query & " order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȣ" query = query & " order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȣ"
Rs.open Query, adoconn,adopenstatic, adlockreadonly Rs.open Query, adoconn,adopenstatic, adlockreadonly
if Rs.recordcount <= 0 then if Rs.recordcount <= 0 then
krc_no = 0 krc_no = 0
else else
@@ -399,8 +421,8 @@
end if end if
Rs.close Rs.close
krc_no = int(krc_no) + 1 krc_no = int(krc_no) + 1
tmpstr = "KRC-" & year(date) & "-" tmpstr = "KRC-" & year(date) & "-"
tmpstr = tmpstr & "X-" tmpstr = tmpstr & "X-"
krc_no = tmpstr & ZeroFormat(krc_no,5) krc_no = tmpstr & ZeroFormat(krc_no,5)
Query = " insert into direct_cost(p_sn, krc_no, p_subject, hangmok, sebu, act_money, " Query = " insert into direct_cost(p_sn, krc_no, p_subject, hangmok, sebu, act_money, "
@@ -432,14 +454,14 @@
rsc.close rsc.close
Else Else
alert2 "<22>̹<EFBFBD> <20><><EFBFBD>簡 <20>Ϸ<EFBFBD><CFB7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>." alert2 "<22>̹<EFBFBD> <20><><EFBFBD>簡 <20>Ϸ<EFBFBD><CFB7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>."
End if End if
End if End if
'---------------------------------------------------------------------------------- '----------------------------------------------------------------------------------
elseif cint(print_type) = 1 then elseif cint(print_type) = 1 then
end if end if
%> %>
<html> <html>
@@ -507,7 +529,7 @@
var url = "doc_myun_pay_print.asp" var url = "doc_myun_pay_print.asp"
url = url + "?print_type=2"; url = url + "?print_type=2";
document.frm_money.action=url; document.frm_money.action=url;
var dataCount = document.frm_money.dataCount.value; var dataCount = document.frm_money.dataCount.value;
var minus_money_flag = "False"; var minus_money_flag = "False";
var p_progress_status; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȹ<EFBFBD><C8B9> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> var p_progress_status; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȹ<EFBFBD><C8B9> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
@@ -565,16 +587,16 @@
return false; return false;
} }
} }
} }
} }
document.frm_money.submit(); document.frm_money.submit();
} }
/* /*
function direct_cost_detail(p_child_sn, work_month, sv, pay_type, cost_type, d_no, work_kind) { 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); 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"); 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() function print_ie()
@@ -585,14 +607,14 @@
if(window.PPClose === false){ // Close not OK? 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'; 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.print(); // Print preview
window.PPClose = true; // Set Close Flag to OK. window.PPClose = true; // Set Close Flag to OK.
}else{ }else{
window.print(); window.print();
window.close(); window.close();
} }
} }
function clsit() function clsit()
{ {
@@ -616,10 +638,10 @@
<input type=hidden name = "txt_client" value="<%=gap(8)%>"> <input type=hidden name = "txt_client" value="<%=gap(8)%>">
<input type=hidden name = "txt_p_sn" value='<%=gap(9)%>'> <input type=hidden name = "txt_p_sn" value='<%=gap(9)%>'>
<input type=hidden name = "txt_d_no" value='<%=gap(10)%>'> <input type=hidden name = "txt_d_no" value='<%=gap(10)%>'>
<input type=hidden name = "title_type" value='<%=title_type%>'> <input type=hidden name = "title_type" value='<%=title_type%>'>
<input type=hidden name = "pay_type" value='<%=pay_type%>'> <input type=hidden name = "pay_type" value='<%=pay_type%>'>
<input type=hidden name = "work_month" value='<%=work_month%>'> <input type=hidden name = "work_month" value='<%=work_month%>'>
<input type=hidden name = "sv" value='<%=sv%>'> <input type=hidden name = "sv" value='<%=sv%>'>
<input type=hidden name = "p_sn_c" value='<%=p_sn_c%>'> <input type=hidden name = "p_sn_c" value='<%=p_sn_c%>'>
@@ -633,7 +655,7 @@
<%if approval_chk = "true" then%> <%if approval_chk = "true" then%>
<img src="/images/common/btn_approve.jpg" onClick="subit()" style="CURSOR:pointer;" title='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û' id="img_save"> <img src="/images/common/btn_approve.jpg" onClick="subit()" style="CURSOR:pointer;" title='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û' id="img_save">
<%else <%else
Response.Write "<font color='red' size=4><b><3E><><EFBFBD>ΰ<EFBFBD> ȥ<><C8A5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ȵ˴ϴ<CBB4>. <20><><EFBFBD>θ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC><EFBFBD></b></font>" Response.Write "<font color='red' size=4><b><3E><><EFBFBD>ΰ<EFBFBD> ȥ<><C8A5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ȵ˴ϴ<CBB4>. <20><><EFBFBD>θ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC><EFBFBD></b></font>"
end if%> end if%>
<img src="/images/common/btn_cancel.jpg" onClick="win_close();" style="CURSOR:pointer;" id="img_cancel"> <img src="/images/common/btn_cancel.jpg" onClick="win_close();" style="CURSOR:pointer;" id="img_cancel">
</td> </td>
@@ -658,7 +680,7 @@
tmp_title = "<22><>ǥ<EFBFBD>̻<EFBFBD>" tmp_title = "<22><>ǥ<EFBFBD>̻<EFBFBD>"
else else
tmp_title = "<22><>ȸ<EFBFBD><C8B8>" tmp_title = "<22><>ȸ<EFBFBD><C8B8>"
end if%> end if%>
<tr> <tr>
<td colspan="5" class="k_small" align="center" bgcolor="#F1F1F1"><3E><><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD>(<28>ҼӺμ<D3BA>)</td> <td colspan="5" class="k_small" align="center" bgcolor="#F1F1F1"><3E><><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD>(<28>ҼӺμ<D3BA>)</td>
@@ -837,7 +859,7 @@
set adors2 = server.CreateObject("ADODB.RECORDSET") set adors2 = server.CreateObject("ADODB.RECORDSET")
query = "select p_name from person where p_no = '" & sv & "' " query = "select p_name from person where p_no = '" & sv & "' "
adors2.open query, adoconn, adopenstatic, adlockreadonly adors2.open query, adoconn, adopenstatic, adlockreadonly
If adors2.recordCount > 0 Then If adors2.recordCount > 0 Then
pay_apply_username = adors2("p_name") pay_apply_username = adors2("p_name")
End If End If
@@ -852,10 +874,21 @@
if work_month = "2022-04" Then if work_month = "2022-04" Then
Response.Write work_month & "-01 ~ " & work_month & "-25" Response.Write work_month & "-01 ~ " & work_month & "-25"
elseif work_month > "2022-04" Then elseif work_month > "2022-04" Then
Response.Write DATEADD("m",-1,cdate(work_month & "-26")) & " ~ " & work_month & "-25" '<27>ֳ<EFBFBD><D6B3><EFBFBD> :: 20260225 :: <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>Ⱓ <20><><EFBFBD><EFBFBD>
If CDate(work_month & "-01") >= CDate("2026-03-01") Then
'2026<32><36> 3<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1<><31> ~ <20><><EFBFBD><EFBFBD>
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<32><36> 2<><32><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD> 26<32><36> ~ <20>̹<EFBFBD><CCB9><EFBFBD> <20><><EFBFBD><EFBFBD>
Response.Write DateAdd("m",-1, CDate(work_month & "-26")) & " ~ " & DateAdd("d",-1,DateAdd("m",1,CDate(work_month & "-01")))
Else
'2026<32><36> 3<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> 26<32><36> ~ <20>̹<EFBFBD><CCB9><EFBFBD> 25<32><35>
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 else
Response.Write work_month Response.Write work_month
end if end if
%></font></td> %></font></td>
<td width="15%" class="tit2" align="center"><3E><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></td> <td width="15%" class="tit2" align="center"><3E><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></td>
<td width="30%" class="tit7" align="center"><font class="tahoma"><%=pay_apply_username%></font></td> <td width="30%" class="tit7" align="center"><font class="tahoma"><%=pay_apply_username%></font></td>
@@ -873,7 +906,7 @@
<td width="11%" class="tit2" align="center"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǻ<EFBFBD><C7BA><EFBFBD></td> <td width="11%" class="tit2" align="center"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǻ<EFBFBD><C7BA><EFBFBD></td>
<td width="11%" class="tit2" align="center"><3E><><EFBFBD><EFBFBD><EFBFBD>ܾ<EFBFBD></td> <td width="11%" class="tit2" align="center"><3E><><EFBFBD><EFBFBD><EFBFBD>ܾ<EFBFBD></td>
<td width="30%" class="tit2" align="center"><3E><><EFBFBD><EFBFBD></td> <td width="30%" class="tit2" align="center"><3E><><EFBFBD><EFBFBD></td>
</tr> </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 = "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 "
@@ -884,15 +917,15 @@
Query = Query & " , s_gubun, pay_type " Query = Query & " , s_gubun, pay_type "
Query = Query & " , CASE WHEN s_gubun <> '<27>߰<EFBFBD><DFB0><EFBFBD><EFBFBD><EFBFBD>1' and s_gubun <> '<27>߰<EFBFBD><DFB0><EFBFBD><EFBFBD><EFBFBD>2' THEN isnull(SUM(s_sum), 0) END as pay " Query = Query & " , CASE WHEN s_gubun <> '<27>߰<EFBFBD><DFB0><EFBFBD><EFBFBD><EFBFBD>1' and s_gubun <> '<27>߰<EFBFBD><DFB0><EFBFBD><EFBFBD><EFBFBD>2' THEN isnull(SUM(s_sum), 0) END as pay "
Query = Query & " , CASE WHEN s_gubun = '<27>߰<EFBFBD><DFB0><EFBFBD><EFBFBD><EFBFBD>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 = '<27>߰<EFBFBD><DFB0><EFBFBD><EFBFBD><EFBFBD>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 = '<27>߰<EFBFBD><DFB0><EFBFBD><EFBFBD><EFBFBD>2' THEN isnull(sum(s_wan), 0) * (select cost from t_neakeun_pay_COST where type = 'dinner') END as dinner " Query = Query & " , CASE WHEN s_gubun = '<27>߰<EFBFBD><DFB0><EFBFBD><EFBFBD><EFBFBD>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 & " , p_progress_status, CASE WHEN nw.id IS NULL THEN 'N' else 'Y' end AS id "
Query = Query & " from " Query = Query & " from "
Query = Query & " ( " 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 & " 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 '<27>߰<EFBFBD>%' then " Query = Query & " case when tmp.s_gubun like '<27>߰<EFBFBD>%' then "
Query = Query & " ( " Query = Query & " ( "
Query = Query & " select top 1 s_gubun " Query = Query & " select top 1 s_gubun "
Query = Query & " from t_neakeun_pay " Query = Query & " from t_neakeun_pay "
Query = Query & " where attribute01 = tmp.attribute01 " Query = Query & " where attribute01 = tmp.attribute01 "
Query = Query & " and p_sn = tmp.p_sn and s_gubun not like '<27>߰<EFBFBD>%' " Query = Query & " and p_sn = tmp.p_sn and s_gubun not like '<27>߰<EFBFBD>%' "
Query = Query & " order by s_wan desc " Query = Query & " order by s_wan desc "
@@ -910,8 +943,19 @@
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 & " 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) " 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 elseif work_month > "2022-04" Then
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') OR " '<27>ֳ<EFBFBD><D6B3><EFBFBD> :: 20260225 :: <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>Ⱓ <20><><EFBFBD><EFBFBD>
Query = Query & " (work_dt between '" & work_month & "-06' and cast(DATEADD(m,1,cast('" & work_month & "-05' as date)) as varchar) " If Right(work_month, 2) = "02" Then
'2<><32>: <20><><EFBFBD><EFBFBD> 26<32><36> ~ 2<><32> 28<32><38>(<28><><EFBFBD><EFBFBD>)
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<><32> <20><><EFBFBD><EFBFBD>(1<><31> <20><>): <20><><EFBFBD><EFBFBD> 26<32><36> ~ <20>ش<EFBFBD><D8B4><EFBFBD> 25<32><35>
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<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20>ش<EFBFBD><D8B4><EFBFBD> 1<><31> ~ <20><><EFBFBD><EFBFBD>
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 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 & " 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) " Query = Query & " (work_dt between '" & work_month & "-16' and cast(DATEADD(m,1,cast('" & work_month & "-15' as date)) as varchar) "

View File

@@ -28,7 +28,18 @@ if MoneyDate = "2022-04" Then
elseif MoneyDate > "2022-04" Then 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> '''''''''''''''''''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 &" and ( work_dt between cast(DATEADD(m,-1,cast('"&MoneyDate&"-26' as date))as varchar) and '"&MoneyDate&"-25' " '<27>ֳ<EFBFBD><D6B3><EFBFBD> :: 20260225 :: <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>Ⱓ <20><><EFBFBD><EFBFBD>
If Right(MoneyDate, 2) = "02" Then
'2<><32>: <20><><EFBFBD><EFBFBD> 26<32><36> ~ 2<><32> 28<32><38>(<28><><EFBFBD><EFBFBD>)
query = query & " and (work_dt between cast(DATEADD(m,-1,cast('" & MoneyDate & "-26' as date)) as varchar(10)) and '" & MoneyDate & "-28' "
ElseIf CInt(Right(MoneyDate, 2)) < 3 Then
'2<><32> <20><><EFBFBD><EFBFBD>(1<><31> <20><>): <20><><EFBFBD><EFBFBD> 26<32><36> ~ <20>ش<EFBFBD><D8B4><EFBFBD> 25<32><35>
query = query & " and (work_dt between cast(DATEADD(m,-1,cast('" & MoneyDate & "-26' as date)) as varchar(10)) and '" & MoneyDate & "-25' "
Else
'3<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20>ش<EFBFBD><D8B4><EFBFBD> 1<><31> ~ <20><><EFBFBD><EFBFBD>
query = query & " and (work_dt between '" & MoneyDate & "-01' and convert(varchar(10),EOMONTH(cast('" & MoneyDate & "-01' as date)),23) "
End If
'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')))" 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> '''''''''''''''''''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&"' = '2023-07' and TMP.attribute05 in ('KRC-2023-t-00507','KRC-2023-t-00506','KRC-2023-t-00505'))"
@@ -53,7 +64,7 @@ query = query &" where D.d_order_cnt = '77'"&VbCrlf
if MoneyDate = "2022-04" Then 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 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 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 query = query &" and D.d_write_date between '"&MoneyDate&"-06' and cast(DATEADD(m,1,cast('"&MoneyDate&"-10' as date)) as varchar)"&VbCrlf
else else
query = query &" and D.d_write_date between '"&MoneyDate&"-16' and cast(DATEADD(m,1,cast('"&MoneyDate&"-15' as date)) as varchar)"&VbCrlf 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 end if
@@ -73,7 +84,7 @@ query = query &" where TMP.confirm_yn = 'Y' and s_sum <> '0' and D.d_order_c
if MoneyDate = "2022-04" Then 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 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 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 query = query &" and D.d_write_date between '"&MoneyDate&"-06' and cast(DATEADD(m,1,cast('"&MoneyDate&"-10' as date)) as varchar)"&VbCrlf
else else
query = query &" and D.d_write_date between '"&MoneyDate&"-16' and cast(DATEADD(m,1,cast('"&MoneyDate&"-15' as date)) as varchar)"&VbCrlf 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 end if