<#include "../../inc/layout.html">
<@layout title="应收应付汇总表" js="fa/payReceivAbles/rptsum.js">
<style>
html{overflow:auto;}
.comboDiv{position:absolute;left:90px;}
.comboDiv div{height:30px;}
</style>
<div class="wrapper" ms-controller="view">
  <div class="mod-search cf" ms-if="nprint">
    <div class="fl">
      <ul class="ul-inline">
        <li>
        	<label>来往单位:</label>
        	<input type="text" id="customer" class="ui-input" autocomplete="off" style="width:216px;" ms-keyup="qryCustomer(this.value)" ms-click="qryCustomer(this.value)" ms-duplex="query.customer_name" query-rule="required;"ms-query-msg="(type>1?'客户':'供应商')+'必选！'">
		    <div class="comboDiv" style="width:260px;" ms-visible="custComboV">
		    	<div ms-repeat="customerList" ms-click="chooseCust(el)">{{el.sn}}&nbsp;&nbsp;{{el.name}}</div>
		    </div>
        </li>
        <li ms-if="false">
          <label>日期:</label>
          <input type="text" id="beginDate" class="ui-input ui-datepicker-input" ms-duplex="query.start_date">
          <span>-
          <input type="text" id="endDate" class="ui-input ui-datepicker-input"ms-duplex="query.end_date">
        </li>
        <li>
        <a class="ui-btn mrb" ms-click="loadData" title="查询"><i class="fa fa-search"></i></a>
        </li>
      </ul>
    </div>
    <div class="fr">
    <a class="ui-btn mrb" ms-click="printRpt" title="打印"><i class="fa fa-print"></i></a>
<!--     <a class="ui-btn mrb" id="btn_down" title="导出"><i class="fa fa-download"></i></a> -->
    </div>
  </div>
  <div class="bills">
    <p style="font-size:24px;text-align:center;">
    	<span ms-if="type_==1">应收</span><span ms-if="type_==0">应付</span>汇总报表
    </p>
    <p>
<span class="fr">制表人：{{user.realname}}&nbsp;&nbsp;制表日期：${(now?string('yyyy年MM月dd日'))}</span>
    </p>
	<table class="table table-bordered table-striped able-hover">
		<thead>
			<tr>
				<th>来往单位</th>
				<th ms-if="type_==1">应收金额</th>
				<th ms-if="type_==1">实收金额</th>
				<th ms-if="type_==1">应收余额</th>
				<th ms-if="type_==0">应付金额</th>
				<th ms-if="type_==0">实付金额</th>
				<th ms-if="type_==0">应付余额</th>
			</tr>
		</thead>
		<tbody>
			<tr ms-repeat="list">
				<td>{{el.customer_name}}&nbsp;[{{el.csttype|csttype}}]</td>
				<td align="right">{{el.amt|money}}</td>
				<td align="right">{{el.pay_amt|money}}</td>
				<td align="right">{{(el.amt-el.pay_amt)|money}}</td>
			</tr>
		</tbody>
		<tfoot>
			<tr>
				<td align="right"><b>合计</b></td>
				<td align="right">{{userData.amt0|money}}</td>
				<td align="right">{{userData.amt1|money}}</td>
				<td align="right">{{userData.amt2|money}}</td>
			</tr>
		</tfoot>
	</table>
  </div>
</div>
<script>
var type=${type!0};</script>
</@layout>