39 lines
1.3 KiB
Plaintext
39 lines
1.3 KiB
Plaintext
<!-- #include virtual = "lib/config.asp" -->
|
|
<%
|
|
Response.CharSet = "EUC-KR" 'ÇѱÛ
|
|
Response.AddHeader "Pragma","no-cache"
|
|
Response.AddHeader "cache-control", "no-staff"
|
|
Response.Expires = -1
|
|
|
|
dim cost_id : cost_id = request("cost_id")
|
|
dim cost_money : cost_money = request("cost_money")
|
|
dim query
|
|
|
|
dim executeCount : executeCount = 0
|
|
|
|
query = ""
|
|
query = query & " UPDATE Cost_Account SET "
|
|
query = query & " cost_money = '" & cost_money & "', "
|
|
query = query & " flag = case when '" & cost_money & "' = '0' and flag is not null then '0' else flag end "
|
|
query = query & " WHERE id = '" & cost_id & "' "
|
|
adoConn.Execute query, executeCount
|
|
|
|
if executeCount = 1 and cost_money = "0" then
|
|
query = ""
|
|
query = query & " UPDATE L "
|
|
query = query & " SET L.lunch_p_no = CASE B.cost_code WHEN 9 THEN NULL ELSE L.lunch_p_no END, "
|
|
query = query & " L.dinner_p_no = CASE B.cost_code WHEN 9 THEN L.dinner_p_no ELSE NULL END "
|
|
query = query & " FROM V_BUSI_COST B LEFT JOIN LOGIN L "
|
|
query = query & " ON B.job_date = CASE WHEN time < '0600' THEN DATEADD(Day, -1, L.date) ELSE L.date END "
|
|
query = query & " AND B.p_no = CASE B.cost_code WHEN 9 THEN L.lunch_p_no ELSE L.dinner_p_no END "
|
|
query = query & " WHERE B.id='" & cost_id & "' "
|
|
|
|
adoConn.Execute query
|
|
end if
|
|
|
|
if executeCount = 1 then
|
|
Response.Write "1"
|
|
else
|
|
Response.Write "0"
|
|
end if
|
|
%> |