<html xmlns="http://www.w3.org/1999/xhtml">
<!--#include file="../Inc/Conn.asp" -->
<!--#include file="../Inc/SK.Session.asp" -->
<!--#include file="../Inc/SK.Funtion.asp" -->
<%if Not (Getconfig("SK_Finance")="0" AND (Session("Manager")="1" OR (JudgePopedomTF(Session("UserName"),"SK700000000") AND JudgePopedomTF(Session("UserName"),"SK700000301")))) then Call ReturnError()%>
<%
if Not isnumeric(JCID(F("ID"))) then Call ReturnError10()
set rs=server.createobject("adodb.recordset")
sql="SELECT * from SK_Accounts where SK_Di=0 and SK_SalesOrders<>0 and AccountsID="&JCID(F("ID"))&""
rs.Open sql,conn,1,1
if rs.eof and rs.bof then Call ReturnError4()

'Mod
if RQ("Action")="Mod" and F("ID")<>"" and F("S_Feet")<>"" and F("S_BanksID")<>"" then
Call ChkIsOuter()
set rs=server.createobject("adodb.recordset")
sql="select * from SK_Accounts where SK_Di=0 and SK_SalesOrders<>0 and AccountsID="&JCID(F("ID"))&""
rs.open sql,conn,1,3
rs("SK_Feet")=NoCSSHackInput(F("S_Feet"))
rs("SK_BanksID")=NoCSSHackInput(F("S_BanksID"))
rs("SK_OpenBill")=NoCSSHackInput(F("S_OpenBill"))
rs("SK_Bill")=NoCSSHackInput(F("S_Bill"))
rs("SK_FinanceID")=Session("UID")
rs.Update
rs.Close 
set rs=Nothing
'Event Begin
if getconfig("SK_Event")=0 then
set rsEvent=server.createobject("adodb.recordset")
sqlEvent="select * from SK_SystemEvent"
rsEvent.open sqlEvent,conn,1,3
rsEvent.AddNew
rsEvent("SK_Title")="确定销售回款"
rsEvent("SK_User")=Session("UserName")
rsEvent("SK_Time")=Now()
rsEvent("SK_IP")=request.ServerVariables("Remote_Addr")
rsEvent.Update
rsEvent.Close 
set rsEvent=Nothing
end if
'Event End
Response.Write("<script LANGUAGE='javascript'>alert('恭喜你,操作成功！');window.close();window.opener.location.reload();</script>")
Response.End
end if
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312" />
<title>确定销售回款</title>
<META http-equiv=Page-Enter content=SKCRM>
<META http-equiv=Page-Exit content=SKCRM>
<META content="MSHTML 6.00.3790.2858" name=GENERATOR>
<LINK href="../images/style.css" type=text/css rel=stylesheet>
<script language="javascript" src="../Inc/Check.js"></script>
<script language="javascript" src="../Inc/Calendar.js"></script>
<script language="javascript" src="../Inc/jquery.js"></script>
<SCRIPT language=javascript src="../inc/Openwin.js"></SCRIPT>
<script>
window.onbeforeunload = function()
{
if (document.body.offsetWidth-50 < event.clientX && event.clientY<0)
{
return "是否关闭当前窗口？关闭本窗口将放弃确定信息！";
}
}
</script>
<style type="text/css">
<!--
body {
margin: 5px 0px 5px 0px;
overflow-x: hidden;
}
-->
</style>
</head>
<body>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
<TBODY>
<tr>
<td class="SK_Td_Top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="12" height="25"><img src="../images/tab_03.gif" width="12" height="25" /></td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="46%" valign="middle">确定销售回款</td>
<td width="54%"></td>
</tr>
</table></td>
<td width="16"><img src="../images/tab_07.gif" width="16" height="25" /></td>
</tr>
</table></td>
</tr>
<tr>
<td>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="8" background="../images/tab_12.gif"></td>
<td>

<form name="thisForm" id="form1" method="post" action="?Action=Mod" onSubmit="return Form1_Validator(this)"> 
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="b5d6e6">
<tr>
  <td width="13%" class="SK_Text2">确定状态</td>
  <td width="31%" class="SK_Text1"><select name="S_Feet" style="width:100">
    <option value="0" <%if Rs("SK_Feet")="0" then Response.Write("selected=""selected""")%>>未确定</option>
    <option value="1" <%if Rs("SK_Feet")="1" then Response.Write("selected=""selected""")%>>已确定</option>
  </select> <font color=red>*</font></td>
  <td width="10%" class="SK_Text2">收款账户</td>
  <td width="46%" class="SK_Text1"><select name="S_BanksID" style="width:100">
<%
set rsBanks = server.createobject("adodb.recordset")
rsBanks.open "SELECT * from SK_Banks",conn,1,1
for DD=1 to rsBanks.recordcount
selected=""
if rs("SK_BanksID")=rsBanks("BanksID") then selected="selected='selected'"
response.Write("<option "&selected&" value="&rsBanks("BanksID")&">"&rsBanks("SK_BankName")&"</option>")
rsBanks.movenext
next
rsBanks.close
set rsBanks=Nothing
%>
</select> <font color=red>*</font></td>
</tr>
<tr>
  <td class="SK_Text2">是否开票</td>
  <td class="SK_Text1"><select name="S_OpenBill" style="width:100">
    <option value="0" <%if Rs("SK_OpenBill")="0" then Response.Write("selected=""selected""")%>>未开票</option>
    <option value="1" <%if Rs("SK_OpenBill")="1" then Response.Write("selected=""selected""")%>>已开票</option>
  </select></td>
  <td class="SK_Text2">票据类别</td>
  <td class="SK_Text1"><select name="S_Bill" style="width:100">
<%
set rsBill=Server.createobject("adodb.recordset")
rsBill.open "SELECT * from SK_SystemCategory where SK_Di=143",conn,1,1
for Bill=1 to rsBill.recordcount
selected=""
if rs("SK_Bill")=rsBill("CategoryID") then selected="selected='selected'"
response.Write("<option "&selected&" value="&rsBill("CategoryID")&">"&rsBill("SK_Name")&"</option>")
rsBill.movenext
next
rsBill.close
set rsBill=Nothing
%>
</select></td>
</tr>

<tr>
<td colspan="4" class="SK_Text">
<input type="hidden" name="ID" value="<%=Rs("AccountsID")%>" >
<INPUT class="button1" type="submit" value=" 确定 "> 
<input type="button" value=" 关闭 " onClick="window.opener.location.reload();window.close();" class="button1">
</td>
</tr>
</table>
</form>

</td>
<td width="8" background="../images/tab_15.gif"></td>
</tr>
</table></td>
</tr>
<tr>
<td class="SK_Td_Foot">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%" height="20"><img src="../images/tab_18.gif" width="12" height="20" /></td>
<td width="98%" class="SK_Td_Page"></td>
<td width="1%"><img src="../images/tab_20.gif" width="16" height="20" /></td>
</tr>
</table>

</td>
</tr>
</TBODY>
</table>
</body>
<%
Call CloseDB()
%>
</html>