{load(fhead)}
<body class="mainbg">
	<div id="mainhearder"><span>您的位置：<a href="{$vd['root']}index.php?m=mod_b2b&c=Dealer&a=home">经销商管理系统</a> >> 财务管理 >> 销售提成报表查询</span></div>
	<div id="hearder"><span>自有商品收入报表</span></div>
	<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
	<td class="tableleft">
		<form name="sellhistory" method="post" action="index.php?m=mod_agent&c=trade&tpl=sup&tradetype=12&{$vd['op']}">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" class="table1">
		<tr>
		<td width="22%" class="tableleft1">查询类型：</td>
		<td width="78%" align="left" class="tableright1">
			<select name="tradetype" id="tradetype" class="search_selectlong">
    	{#Option($vd['tradetypes'], $vd['tradetype'])}
    	</select>
		</td>
		</tr>
		<tr>
		<td class="tableleft1">查询时间段：</td>
		<td align="left" class="tableright1">
    <input type="text" name="startdate" value="{$vd['startdate']}" class="input" id="startdate"/>
    <strong>至</strong>&nbsp;<input type="text" name="enddate" value="{$vd['enddate']}" class="input" id="enddate"/>
    </td>
		</tr>
		<tr>
		<td class="tableleft1">&nbsp;</td>
		<td align="left" class="tableright1"><input type="submit" name="Submit222" value="确认查询" class="button"> <input type="reset" name="reset" value="重置查询" class="button"></td>
		</tr>
		</table>
		</form>
	</td>
	</tr>
	</table>
	<br>
	<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
	<td class="tableleft">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" class="table">
		<tr class="tabletitle">
      <td width="15%" class="heardertop1">交易类型</td>
      <td width="15%" class="heardertop1">收入({$vd['lang']['moneyunit']})</td>
      <td width="15%" class="heardertop1">支出({$vd['lang']['moneyunit']})</td>
      <td width="15%" class="heardertop1">变化后({$vd['lang']['moneyunit']})</td> 
      <td width="10%" class="heardertop1">操作员</td>
      <td width="15%" class="heardertop1">交易日期</td>
      <td width="15%" class="heardertop1">交易详细</td>
    </tr>
    <!--$income=0;$outcome=0;foreach($vd['items'] as $item) {-->
    <tr class="stline" onmouseover="this.className='nd'" onmouseout="this.className='stline'">
      <td>{#TradeType($item['tradetype'])}</td>
      <td><!--if($item['income'] != ''){ echo '+ '.round($item['income'], 3);}--></td>
      <td><!--if($item['outcome'] != ''){ echo '- '.round($item['outcome'], 3);}--></td>
      <td><font color="#ff0000">{$item['fat']}</font></td> 
      <td>{#Operator($vd['agent'][7], $item['operator'], $vd['agent'][9], $item['otherside'])}</td>
      <td>{$item['createdate']}</td>
      <td>
      	<!--if($item['outcome']>0){-->
      	{$item['content']}
      	<!--}else{-->
        <a href="index.php?m=mod_agent&c=AOrder&a=detail&ordno={$item['ordno']}">
        <font color="#0000ff">查看</font>
        </a>
        <!--}-->
      </td>
    </tr>
    <!--$income=$income+$item['income'];$outcome=$outcome+$item['outcome'];}-->
    <tr class="thr">
      <td align="center">
        本页统计</td>
      <td align="center">
        <!--if($income != ''){ echo round($income, 3);}-->&nbsp;</td>
      <td align="center">
        <!--if($outcome != ''){ echo round($outcome, 3);}-->&nbsp;</td>
      <td colspan="5">&nbsp;</td>
    </tr>
    <tr class="thr">
      <td align="center">
        查询统计</td>
      <td align="center">
        <!--if($vd['record']['income'] != ''){ echo round($vd['record']['income'], 3);}-->&nbsp;</td>
      <td align="center">
        <!--if($vd['record']['outcome'] != ''){ echo round($vd['record']['outcome'], 3);}-->&nbsp;</td>
      <td colspan="6">&nbsp;</td>
    </tr>
		</table>
	</td>
	</tr>
	</table>
	<div id="page" align="right">
		{load(fhead)}
	</div>
	
</body>
</html>
