<!--#include virtual="/show/adminhead.asp"-->
<!--#include file="adminleft.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<%
call logquanxian("e3",1)
link="adminjiesuan_c.asp?act="
act=SafeRequest("act")
cwku=SafeRequest("cwku")

if act="caiwu" then
usercaiwuid=SafeRequest("usercaiwuid")
czid=SafeRequest("usercaiwuid")
uid=SafeRequest("uid")
end if

if act="took" then
uid=SafeRequest("uid")
cid=SafeRequest("cid")
cwku=SafeRequest("cwku")
caiwuchuliid=SafeRequest("caiwuchuliid")

sql="select aycaiwuisjs,aycaiwuuser,aycaiwuid from "&cwku&" where aycaiwuid="&cid&" and aycaiwuuser="&uid&"" 
rs.open sql,conn,1,3
if not(rs.bof and rs.eof) then
rs("aycaiwuisjs")=1
rs.update
end if
rs.close
call PopErr2("财务记录处理成功","adminjiesuan_c.asp?act=caiwu&cwku="&cwku&"&usercaiwuid="&caiwuchuliid&"&uid="&uid)
end if

if act="alltook" then
uid=SafeRequestform("uid")
cwku=SafeRequestform("cwku")
caiwuchuliid=SafeRequestform("caiwuchuliid")
list1=SafeRequestform("list1")

	delid=split(list1,",")
	
	For dianka=0 To Ubound(delid) 
	sql="select aycaiwuisjs,aycaiwuuser,aycaiwuid from "&cwku&" where aycaiwuid="&trim(delid(dianka))&" and aycaiwuuser="&uid&"" 
	rs.open sql,conn,1,3
	if not(rs.bof and rs.eof) then
	rs("aycaiwuisjs")=1
	rs.update
	end if
	rs.close
	next

call PopErr2("财务记录处理成功","adminjiesuan_c.asp?act=caiwu&cwku="&cwku&"&usercaiwuid="&caiwuchuliid&"&uid="&uid)

end if



if act="delcw" then

cid=SafeRequest("cid")
czid=SafeRequest("czid")
uid=SafeRequest("uid")

sql="select aycaiwuuser,aycaiwuid from "&cwku&" where aycaiwuid="&cid&" and aycaiwuuser="&uid&"" 
rs.open sql,conn,1,3
if not(rs.bof and rs.eof) then
rs.delete
end if
rs.close

call PopErr2("财务记录处理成功","adminjiesuan_c.asp?act=caiwu&usercaiwuid="&czid&"&uid="&uid)
end if



%>
 
<title><%=webname%>-最高权限-商户结算-自动结算模式</title> 

<DIV id=main1200> 
<%call webleft()%>
<DIV id=main_right>
<DIV id=main_right_content>
<STYLE>.apply_style {
	POSITION: absolute
}
.right_title A {
	LINE-HEIGHT: 27px; WIDTH: 126px; DISPLAY: inline-block; BACKGROUND: url(<%=ossurl%>images/bg22.gif) no-repeat; HEIGHT: 27px
}
.right_title A.current {
	BACKGROUND: url(<%=ossurl%>images/main_right_title_bg.gif) no-repeat; COLOR: #fff; FONT-WEIGHT: bold
}
.table_style_1 TD {
	HEIGHT: 38px
}
.table_style_home_info TD {
	PADDING-BOTTOM: 0px; PADDING-LEFT: 10px; PADDING-RIGHT: 0px; HEIGHT: 30px; PADDING-TOP: 0px
}
</STYLE>
<SCRIPT LANGUAGE="JavaScript">
var checkflag1 = "false";
function check1(field) {
if (checkflag1 == "false") {
for (i = 0; i < field.length; i++) {
field[i].checked = true;}
checkflag1 = "true";
return "false"; }
else {
for (i = 0; i < field.length; i++) {
field[i].checked = false; }
checkflag1 = "false";
return "true"; }
}

function unselectall1()
{
    if(document.myform.chkAll1.checked){
	document.myform.chkAll1.checked = document.myform.chkAll1.checked&0;
	checkflag1 = "false";
    } 	
}
</script>
<DIV class=right_titleadmin>&nbsp;&nbsp;详细记录</DIV>
<DIV class=main>

<br>
<form action="?act=alltook" method="post" name="myform" id="myform">
<TABLE width="99%" border="0" cellpadding="0" cellspacing="0" class="table_style_a1">
  <TBODY>
  

    <TR>
    <TD width="5%" align="center" class="border_bottom border_right">&nbsp;</TD>
    <TD width="10%" align="center" class="border_bottom border_right">财务ID</TD>
    <TD width="10%" align="center" class="border_bottom border_right" style="font-weight: bold">商户名</TD>
    <TD width="11%" align="center" class="border_bottom border_right">状态</TD>
    <TD width="12%" align="center" class="border_bottom border_right" style="font-weight: bold">方向</TD>
    <TD width="11%" align="center" class="border_bottom border_right" style="font-weight: bold">金额</TD>
    <TD width="10%" align="center" class="border_bottom border_right" style="font-weight: bold">时间</TD>
    <TD width="11%" align="center" class="border_bottom border_right" style="font-weight: bold">结算状态</TD>
    <TD width="20%" align="center" class="border_bottom">操作</TD>
    </TR>
<%
zongshu=0
rukuan=0
koukuan=0
butongji=0
caiwuchuliid=split(usercaiwuid,",")
For chuliid=0 To Ubound(caiwuchuliid) 

sql="select * from "&cwku&" where aycaiwuid="&caiwuchuliid(chuliid)&" and aycaiwuuser="&uid&"" 
rs.open sql,conn,1,1
if not(rs.bof and rs.eof) then
%> 

  <TR onmouseover=this.bgColor='#D2FFFF' onmouseout=this.bgColor='#ffffff'>
    <TD align="center" class="border_bottom border_right"><input name="list1" type="checkbox" id="list1" value="<%=rs("aycaiwuid")%>" onClick="unselectall1()"></TD>
    <TD align="center" class="border_bottom border_right"><%=rs("aycaiwuid")%></TD>
    <TD align="center" class="border_bottom border_right"><%=rs("aycaiwuuser")%></TD>
    <TD align="center" class="border_bottom border_right">
	<%
	if rs("aycaiwuzt")=0 then response.Write("<span style='color:#FF0000'>未处理</span>")
	if rs("aycaiwuzt")=1 then response.Write("<span style='color:#00CC00'>成功</span>")
	if rs("aycaiwuzt")=2 then response.Write("<span style='color:#FF0000'>失败</span>")
	%></TD>
    <TD align="center" class="border_bottom border_right">
    <%
'财务类别 0入款 1结算/提现 2支出 3充值 4买家返款 5消费 6开通追加消保(消费) 7取消消保(入款) 8引荐返点 9自助提现 10点卡余额入款 11冻结 12寄卖商品预支入款 13商户寄卖预支金额平台支出 
'14秒结算手续费 15加急手续费 16自动结算手续费 17收款 18代理入款 19代售入款
'不处理财务类别 1结算/提现 3充值 6开通追加消保(消费) 9自助提现 12寄卖商品预支入款 13商户寄卖预支金额平台支出 14秒结算手续费 15 加急手续费 16自动结算手续费
	'入款类别

	if rs("aycaiwuleibie")=0 then response.Write("<span style='color:#090'>+入款</span>")
	if rs("aycaiwuleibie")=4 then response.Write("<span style='color:#090'>+买家返款</span>")
	if rs("aycaiwuleibie")=7 then response.Write("<span style='color:#090'>+取消消保(入款)</span>")
	if rs("aycaiwuleibie")=8 then response.Write("<span style='color:#090'>+引荐返点</span>")
	if rs("aycaiwuleibie")=10 then response.Write("<span style='color:#090'>+点卡余额入款</span>")
	if rs("aycaiwuleibie")=12 then response.Write("<span style='color:#090'>+寄卖商品预支入款</span>")
	if rs("aycaiwuleibie")=17 then response.Write("<span style='color:#090'>+收款</span>")
	if rs("aycaiwuleibie")=18 then response.Write("<span style='color:#090'>+代理入款</span>")
	if rs("aycaiwuleibie")=19 then response.Write("<span style='color:#090'>+代售入款</span>")
	
	if rs("aycaiwuleibie")=0 or rs("aycaiwuleibie")=4 or rs("aycaiwuleibie")=7 or rs("aycaiwuleibie")=8 or rs("aycaiwuleibie")=10 or rs("aycaiwuleibie")=12 or rs("aycaiwuleibie")=17 or rs("aycaiwuleibie")=18 or rs("aycaiwuleibie")=19 then
	rukuan=ccur(rukuan)+ccur(rs("aycaiwujine"))
	end if
	
	'支出类别
	if rs("aycaiwuleibie")=2 then response.Write("<span style='color:#F00'>-支出</span>")
	if rs("aycaiwuleibie")=5 then response.Write("<span style='color:#F00'>-消费</span>")
	if rs("aycaiwuleibie")=6 then response.Write("<span style='color:#F00'>-开通追加消保(消费)</span>")
	if rs("aycaiwuleibie")=11 then response.Write("<span style='color:#F00'>-冻结</span>")

	if rs("aycaiwuleibie")=2 or rs("aycaiwuleibie")=5 or rs("aycaiwuleibie")=6 or rs("aycaiwuleibie")=11 then
	kouchu=ccur(kouchu)+ccur(rs("aycaiwujine"))
	end if

 	'不统计类别
	if rs("aycaiwuleibie")=1 then response.Write("结算/提现")
	if rs("aycaiwuleibie")=3 then response.Write("充值")
	if rs("aycaiwuleibie")=9 then response.Write("手动提现")
	if rs("aycaiwuleibie")=13 then response.Write("商户寄卖预支金额平台支出")
	if rs("aycaiwuleibie")=14 then response.Write("秒结算手续费")
	if rs("aycaiwuleibie")=15 then response.Write("加急手续费")
	if rs("aycaiwuleibie")=16 then response.Write("自动结算手续费")
	
	if rs("aycaiwuleibie")=1 or rs("aycaiwuleibie")=3 or rs("aycaiwuleibie")=9 or rs("aycaiwuleibie")=13 or rs("aycaiwuleibie")=14 or rs("aycaiwuleibie")=15 or rs("aycaiwuleibie")=16 then
	butongji=ccur(butongji)+ccur(rs("aycaiwujine"))
	end if
	
	%></TD>
    <TD align="center" class="border_bottom border_right"><%=rs("aycaiwujine")%>元</TD>
	<%zongshu=ccur(zongshu)+ccur(rs("aycaiwujine"))%>
    <TD align="center" class="border_bottom border_right"><%=rs("aycaiwudate")%></TD>
    <TD align="center" class="border_bottom border_right">
	<%
	if rs("aycaiwuisjs")=0 then response.Write("<a href=?act=took&cid="&rs("aycaiwuid")&"&uid="&uid&"&cwku="&cwku&"&caiwuchuliid="&czid&" style='color:#FF0000'>未结算</a>")
	if rs("aycaiwuisjs")=1 then response.Write("<span style='color:#00CC00'>已结算</span>")
	%>
    </TD> 
    <TD align="center" class="border_bottom"><a onClick="javascript:return confirm('您确定要操作吗？');" href="?act=delcw&cid=<%=rs("aycaiwuid")%>&uid=<%=uid%>&cwku=<%=cwku%>">删除财务</a></TD>
  </TR>

<%
end if
rs.close

next
%>

<tr>
<td colspan="9">
<input name="uid" type="hidden" id="uid" value="<%=uid%>" />
<input name="cwku" type="hidden" id="cwku" value="<%=cwku%>" />
<input name="caiwuchuliid" type="hidden" id="caiwuchuliid" value="<%=czid%>" />
<input name="chkAll1" type="checkbox" id="chkAll1" onClick="this.value=check1(this.form.list1)" value="checkbox">&nbsp;全选&nbsp;<input type="submit" name="Submit" value=" 转已结算状态 ">   
总金额 <%=zongshu%>
账期入款金额 <%=rukuan%>
账期扣款金额 <%=koukuan%>
账期不统计金额 <%=butongji%>
账期应结算金额 <%=ccur(rukuan)-ccur(koukuan)%>
</td>
</tr>

  </TBODY></TABLE>
	</form>

</DIV></DIV>
<DIV class=clear></DIV></DIV>
</DIV>
<SCRIPT>
$(function(){
$('.left_title').each(function(){
   $(this).click(function(){
	   var index=$('.left_title').index(this);
	   if($(this).next().hasClass('hide_m')){
		   $(this).next().removeClass('hide_m');
           $(this).next().show();		 
		   $(this).find('img').attr('src','<%=ossurl%>images/expansion.gif');
		   $.cookie('m_index_'+index,'',{expires:0});
	   } else {
	       $(this).next().hide();
		   $(this).next().addClass('hide_m');
		   $(this).find('img').attr('src','<%=ossurl%>images/shrank.gif');		   
		   $.cookie('m_index_'+index,'none',{expires:365});
	   }
   })
})

$('.left_title').each(function(){
	var index=$('.left_title').index(this);
    $(this).next().css('display',$.cookie('m_index_'+index) ? $.cookie('m_index_'+index) : '');
	if($.cookie('m_index_'+index)){
	    $(this).next().addClass('hide_m');
	}
	$(this).find('img').attr('src',$.cookie('m_index_'+index) ? '<%=ossurl%>images/shrank.gif' : '<%=ossurl%>images/expansion.gif');
})
})

</SCRIPT>


<!--#include virtual="/show/footadmin.asp"-->

