<!-- include 'header' -->
<link rel=stylesheet href="<?= WEB_SITE_GLOBAL ?>css/jquery.validator.css">
<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>js/jquery.validator.min.js"></script>
<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>js/zh-CN.js"></script>
<script src="<?= WEB_SITE_GLOBAL ?>js/invoice.validator.js"></script>
<script src="<?= WEB_SITE_GLOBAL ?>js/invoice.js"></script>
<link href="<?= WEB_SITE_GLOBAL ?>css/datepicker.min.css" rel="stylesheet" type="text/css">
<script src="<?= WEB_SITE_GLOBAL ?>js/datepicker.min.js"></script>
<script src="<?= WEB_SITE_GLOBAL ?>js/datepicker.zh.js"></script>
<body>
	<div class="mainLayout">
		<div class="mainMenu">
			<div class="menuItem">
				<a href="#" class="mLogo">CLD</a>
				<ul>
					<!-- include 'menuReceipt' -->
				</ul>
			</div>
			
		</div>
		<div class="warpContent">
			<div class="subMenu fL">
				<div class="menuItem">
					<!-- include 'invoiceMenu' -->
				</div>
			</div>
			<div class="adminContent autoHeight">
				<legend>
					收款管理
					<a href="/invoiceAS">发票管理</a>
				</legend>
				<div class="demandCate">
				<form action="/invoiceReceivablesAS/1/{{status}}" id="iras" method="get">
					<ul class="cateList">
					<li>
						<a <!-- if {{status}}=='All' --> class="now" <!-- endif --> href="/invoiceReceivablesAS/1/All">所有</a>
	  					<a <!-- if {{status}}=='Claim' --> class="now" <!-- endif --> title="未认领" href="/invoiceReceivablesAS/1/Claim">未认领</a>
	  					<a <!-- if {{status}}=='Unclaimed' --> class="now" <!-- endif --> title="未入账" href="/invoiceReceivablesAS/1/Unclaimed" >未入账</a>
	  					<a <!-- if {{status}}=='Credited' --> class="now" <!-- endif --> title="已入账" href="/invoiceReceivablesAS/1/Credited" >已入账</a>
	  					<a <!-- if {{status}}=='BBN' --> class="now" <!-- endif --> title="已入账" href="/invoiceReceivablesAS/1/BBN" >批量导入</a>
	  					<a <!-- if {{status}}=='REFUND' --> class="now" <!-- endif --> title="已入账" href="/invoiceReceivablesAS/1/REFUND" >退款</a>
	  				</li>
					
	  					<li>
	  					<div class="search">
	  					<input type="radio" <!-- if {{timeType}}=='BIND' --> checked <!-- endif --> refreshData=time name="timeType" value="BIND">按到账时间
	  					 <input type="radio" <!-- if {{timeType}}=='CREATE' --> checked <!-- endif --> refreshData=time name="timeType"  value="CREATE">按录入时间
	  					<div class="input-append">
	  					
	  					<input class="datepicker-here span3" name="date" value="{{date}}" placeholder="按时间筛选" data-range="true" data-multiple-dates-separator=" : " data-language="zh" type="text">
	  					<button class="btn btn-small" type="submit">查询</button>
	  					</div>
	  					</div>
	  					
	  					</li>
	  					
						<li><div class="search"><div class="input-append">
									<input class="span3" data-irmMebSea placeholder="收款金额，收款信息，收款流水号" name="MebSea" value="{{MebSeaEn}}" type="text">
									<button class="btn btn-small" node-irmMebSea type="submit">搜索</button>
								</div>
							</div></li>
					</ul>
					</form>
	  			</div>
				<div class="saeaList">
		  		<table class="table table-hover">
					<tr class="thead">
					<th>收款流水号</th>
						
						<th>收款金额</th>
						<th>实际收款金额</th>
						
						<th>银行到账时间</th>
						<th>收款信息</th>
						<th>办事处</th>
						<th>收款银行</th>
						
						<th>录入收款</th>
						<th>收款认领</th>
						<th>发票入账</th>
						
						<th>退款</th>
						<th>关联新款</th>
						
						<th>开票流水号</th>
						<th>操作</th>
					</tr>
					
					<!-- loop list -->
						<tr>
						<td><a href="#billing" node-invoice='INFO' data-type="receivables" data-isKey="{{list' value.iridKeyK}}" data-toggle="modal">{{list' value.receivablesSerial}}</a></td>
						
						<td><b>￥{{list' value.OriginalPrice}}</b></td>
						<td><b class="colGreen">￥{{list' value.receivablesPrice}}</b></td>
						
						
						<td>{{list' value.receivablesDate}}</td>
						<td>{{list' value.receivablesMessage}}</td>
						<td>{{list' value.category}}</td>
						<td>{{list' value.receivablesBank}}</td>
						
						<td>{{list' value.inputStaff}} <br>{{list' value.date}}</td>
						<td>
						<!-- if {{list' value.receivablesCategory}}!='PUBLIC' -->
						{{list' value.irolg.operation}}<br/>{{list' value.confirmTime}}
						<!-- endif -->
						</td>
						<td>
						<!-- if {{list' value.bindStatus}}==1 -->
						{{list' value.accountClerk}}&nbsp;入账<br/>{{list' value.bindDate}}
						<!-- elseif {{list' value.bindStatus}}==0&&{{list' value.untreadStatus}}==1 -->
						{{list' value.untreadStaff}}&nbsp;退票<br/>{{list' value.unbundlingTime}}
						<!-- endif -->
						</td>
						
						
						<td>
						<!-- if {{list' value.bindStatus}}==0||{{list' value.bindStatus}}==2 -->
						{{list' value.refundLog}}
						<!-- endif -->
						</td>
						<td>
						
						<!-- if {{list' value.relationIrid}}!=0||{{list' value.bindStatus}}==2 -->
						{{list' value.relationLog}}
						<!-- endif -->
						
						</td>
						
						<td>
						<!-- loop list' value.invoiceList -->
							<a href="#invdetail" node-invoice='INFO' data-isKey="{{halfList' value' key}}" data-toggle="modal">{{halfList' value' value}}</a>&nbsp;
						<!-- endloop -->
						</td>
						
						<td>
						
						<!-- if {{list' value.bindStatus}}==2&&{{list' value.relationIrid}}==0 -->
						<a href="#receipt" dataKey="{{list' value.iridKey}}" node-newReceivables data-toggle="modal">关联新收款</a><br/>
						<!-- endif -->
						
						<!-- if {{list' value.bindStatus}}==0 -->
						<a href="#refund" dataKey="{{list' value.iridKey}}" node-refund data-toggle="modal">退款</a><br/>
						<!-- endif -->
						
						
						
						<!-- if {{list' value.receivablesStaff}}=='PUBLIC'&&{{list' value.iid}}==0&&{{list' value.receivablesPrice}}!=0 -->
							<a href="#receive" data-isKey="{{list' value.iridKey}}" node-alter data-toggle="modal">变更</a>
						<!-- elseif {{list' value.bindStatus}}==0&&{{list' value.receivablesStaff}}!='PUBLIC' -->	
						<a  href="#search-invoice" bind-invoice='receivables' node-key="{{list' value.iridKey}}" data-toggle="modal">查询发票</a>
							<!-- if {{list' value.untreadStatus}}==0&&{{list' value.receivablesPrice}}!=0 -->
							</br><a href="#receive" data-isKey="{{list' value.iridKey}}" node-alter data-toggle="modal">变更</a>
							<!-- endif -->
							<!-- if !empty({{list' value.iid}})||!empty({{list' value.iidExtend}}) -->
							</br><a href="#Unbundling" data-isKey="{{list' value.iridKey}}" node-unBundLing data-toggle="modal">解绑</a>
							<!-- endif -->
							
						<!-- elseif {{list' value.bindStatus}}==1 -->
						<a href="#Unbundling" data-isKey="{{list' value.iridKey}}" node-unBundLing data-toggle="modal">解绑</a>
						<!-- elseif {{list' value.bindStatus}}==0 &&(!empty({{list' value.iid}})||!empty({{list' value.iidExtend}})) -->
						<a href="#Unbundling" data-isKey="{{list' value.iridKey}}" node-unBundLing data-toggle="modal">解绑</a>
						<!-- endif -->
						
						<br/>
						<!-- if {{list' value.receivablesCategory}}=='PUBLIC' -->
						<a  href="#claim" node-claim="receivables" data-key="{{receivablesInput' value.iridKeyK}}" data-toggle="modal">设置认领</a>
						<!-- endif -->
						<!-- if {{list' value.bindStatus}}==0&&empty({{list' value.refundLog}})&&({{list' value.bindPrice}}==0) -->
						<a  href="#billdel" data-isKey="{{list' value.iridKey}}" node-irDelete data-toggle="modal">删除</a>
						<br/>
						<!-- endif -->
						</td>
						</tr>
					<!-- endloop -->
					
		  		</table>
					</div>
		  						<!--翻页-->
				<div class="demandPage">
					<ul class="pagination fL">
	  							<!-- if {{page.previous}}==0 -->
								<li><a href="javascript:void(0)" title="上一页">&lt;</a></li>
								<!-- else -->
								<li><a href="/invoiceReceivablesAS/{{page.previous}}{{get}}" title="上一页">&lt;</a></li>
								<!-- endif -->	
								
	  							<!-- if {{page.on_page}}>=3 -->
	  							<li><a href="/invoiceReceivablesAS/1{{get}}" title="上一页">1</a></li>
	  							<li class="point"><span>...</span></li>
	  							<!-- endif -->
	  							
	  							{{page.page}}
	  							
	  							<!-- if {{page.on_page}}<3 && {{page.total_page}}>5 -->
	  							<li><a href="/invoiceReceivablesAS/4{{get}}" >4</a></li>
	  							<li><a href="/invoiceReceivablesAS/5{{get}}" >5</a></li>
	  							<!-- endif -->
	  							
	  							<!-- if {{page.total_page}}>3 -->
	  							<li class="point"><span>...</span></li>
			  					<!-- endif -->
			  					
			  					<!-- if {{page.next}}=={{page.on_page}} -->
								<li><a href="javascript:void(0)" title="下一页">&gt;</a></li>
								<!-- else -->
								<li><a href="/invoiceReceivablesAS/{{page.next}}{{get}}" title="下一页">&gt;</a></li>
								<!-- endif -->
			  					
			  		</ul>
			  	</div>			
			</div>
		</div>
	</div>

<div loading-msg='true' style="position:absolute;  left:50%;  top:50%;  "></div>
	
	<div class="modal  fade" id="invdetail">
		
		<div id="nc"></div>
	</div>

<div class="modal hide fade" id="Unbundling" >

<form action="/invoiceUnBundLing" method="post" class="form-horizontal">
<input type="hidden" name="unBundKey" id="unBundKey" value >
	<div class="modal-dialog">
		<div class="modal-content">
    <div class="modal-header">
    <h3>收款与发票解绑</h3>
    </div>
    <div class="modal-body">
		<p>解绑后，发票与收款 可重新进行新的入账。</p>
			<table class="table table-bordered">
			<tbody node-unBundInvoice>
				<tr><td>#F20160316001</td><td>￥1000.00</td><td>珠海纵横公司</td><td>纵横公路工程造价管理系统V9.0</td><td><input type="radio"></td></tr>
				<tr><td>#F20160316003</td><td>￥1000.00</td><td>珠海纵横公司</td><td>纵横公路工程造价管理系统V9.0</td><td><input type="radio"></td></tr>
			</tbody>
			</table>
    </div>
	<div class="modal-footer">
	<input type="submit" class="button" value="确认解绑">

	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
	</div>
			</div></div>
</form>
</div>

	<!--弹出变更-->
<div class="modal hide fade" id="receive">
<form action="/invoiceReceivablesUpdateClaim" method="post" class="form-horizontal">
	<div class="modal-dialog">
		<div class="modal-content">
    <div class="modal-header">
    <h3>变更认领人</h3>
    </div>
    <div class="modal-body">
    	
    		<input type="hidden" name="claimKey" value >
    		<div loading-msg='categoryStaff'></div>
			<div class="control-group">
				<label class="control-label"><span class="colRed">*</span>办事处</label>
				<div class="controls">
					<select name="receivablesCategory" html-category>
					
					</select>
				</div>
			</div>
			<!-- 
			<div class="control-group" style="display:none">
				<label class="control-label"></label>
				<div class="controls">
					<select name="receivablesStaff-delete" html-staff>
					
					</select>
				</div>
			</div>
			 -->
    </div>
	<div class="modal-footer">
		<input type="submit" class="button" value="确定">
	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
	</div>
			</div></div>
			</form>
</div>
    <!--弹出变更-->
	<!--弹出修改-->
<div class="modal hide fade" id="billeidt">
<form action="/invoiceReceivablesUpdateClaim" method="post" name="receivablesInvoice">
	<input type="hidden" name="claimKey" id="claimuKey" value >
	<div class="modal-dialog">
		<div class="modal-content">
    <div class="modal-header">
    <h3>修改收款</h3>
    </div>
			<div class="modal-body saeaList">
				<table class="table table-bordered table-condensed">
						<tbody>
						<tr>
							<th class="taC" colspan="4">收款信息填写</th>
						</tr>
						<tr>
							<th class="taC">收款金额</th>
							<td>
							<input value="" name="receivablesPrice" placeholder="输入收款金额" pattern="[0-9]" min="0" step="0.01" type="number">
							</td>
						</tr>
						<tr>
							<th class="taC" >收款信息</th>
							<td>
							<input name="receivablesMessage" type="text">
							</td>
						</tr>
						<tr>
							<th class="taC">收款银行</th><td>
							<select name="receivablesBank" html-rbank>
								
							</select></td>
						</tr>
						<tr>
							<th class="taC">银行到账时间</th>
							<td><input name="receivablesDate" type="date"></td>
						</tr>
						<tr>
							<th class="taC">认领收款</th><td colspan="3">
							<select name="receivablesCategory" html-rcategory>
								
							</select>

							<select name="receivablesStaff" html-rstaff>
							
							</select></td>
						</tr>
						</tbody></table>
			</div>
	<div class="modal-footer">
	    <input type="submit" class="button" value="确定">
	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
	</div>
			</div></div>
			</form>
</div>
    <!--弹出修改-->   
	<!--弹出删除-->
<div class="modal hide fade" id="billdel">
<form action="/invoiceReceivablesDelete" method="post" name="receivablesInvoice">
<input type="hidden" name="claimKey" id="claimdKey" value >
	<div class="modal-dialog">
		<div class="modal-content">
    <div class="modal-header">
    <h3>删除收款</h3>
    </div>
    <div class="modal-body">
    	<p class="alert alert-block">需要删除该到款，请在以下输入框输入"   删除到款   "，再点击“确认删除”按钮。</p>
			<input style="width:100%;" type="text" name="skll" id="" placeholder="" aria-required="true" aria-invalid="true">
    </div>
	<div class="modal-footer">
	<input type="submit" class="button" value="删除">
	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
	</div>
			</div></div>
</form>
</div>
    <!--弹出删除-->
	
	<!--弹出（查询发票）-->
<div class="modal hide fade" id="search-invoice">
<form action="/invoiceBindReceivables" id="IBR" method="post">
		<input type="hidden" name="key" value="">
		<input type="hidden" name="invoiceKey" value="">
	<div class="modal-dialog modal-lg">
		<div class="modal-content">
			<div class="modal-header">
				<h3>查询发票</h3>
			</div>
			
			<div class="modal-body saeaList"  >
				<div node-receivablesHtml='true'>
					
				</div>
				
				
				
				<!--没找到对应开票-->
				<blockquote node-search='invoice' style="display:none">
					<p>暂时没有查询到“珠海XXXX公司”的未入账发票</p>
					<p><div class="input-append">
							<input class="datepicker-here span4" name='searchTitle' placeholder="你可以按关键词模糊搜索" data-range="true" data-multiple-dates-separator=" - " data-language="zh" type="text">
							<button class="btn btn-small" invoice-search='title' type="button">查询</button>
					</div></p>
				</blockquote>
				
				<div node-invoiceHtml='true'>
				<!--搜索结果-->
				<table class="table table-bordered table-condensed">
					<thead><tr><th>开票单位（抬头）</th><th>开票金额</th><th>提交开票</th><th>出票</th><th>开票流水号</th><th width="80">入账</th></tr></thead>
						
				</table>	
						
				</div>			
						
						
							
			</div>
			
			<div class="modal-footer">
				<a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
			</div>
		</div>
	</div>
	</form>
</div>
	
	
	<div class="modal hide fade" id="claim">
	<form action="/setInvoiceReceivablesClaim" id="SIRC" method="post">	
	<input type="hidden" name="iridKey" id="iridKey" value="">
	<input type="hidden" name="action"  value="invoiceReceivablesAS">
	<div class="modal-dialog">
		<div class="modal-content">
		<div class="modal-header">
		<h3>设置到款待认领</h3>
		</div>
		<div class="modal-body">
			<form class="form-horizontal">
			<div class="control-group">
				<label class="control-label"><span class="colRed">*</span>办事处</label>
				<div class="controls">
					<select name="receivablesCategory">

					<option post-data="PUBLIC" value="PUBLIC" >公共待认领款项</option>
					<!-- loop category -->
					<option <!-- if {{category' value.cid}} == {{staff.0.cid}}  --> selected <!-- endif --> post-data="{{category' value.cid}}" value="{{category' value.cid}}:{{category' value.title}}" >{{category' value.title}}</option>
					<!-- endloop -->


					</select>
				</div>
			</div>
		</form>
		</div>
	<div class="modal-footer">
			<input type="submit" class="button" value="确定">

			<a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
	</div>
			</div></div>
			
		</form>	
</div>
	
	
	 <!--弹出退款-->
<div class="modal hide fade" id="refund">
<form action="/setInvoiceReceivablesRefund" id="invoiceReceivablesRefund" method="post">	
	<input type="hidden" name="iridKey" id="iridKey" value="">
	<div class="modal-dialog">
		<div class="modal-content">
    <div class="modal-header">
    <h3>填写退款信息</h3>
    </div>
    <div class="modal-body saeaList">
    	<table class="table table-bordered table-condensed">
				<tbody>
				<tr>
					<th colspan="2" class="taC">
					<label class="radio inline"><input name="refundType" checked value='1' type="radio">全部退款</label>
					<label class="radio inline"><input name="refundType" value='0' type="radio">部分退款</label>
					</th>
				</tr>
				<tr>
					<th colspan="2" class="taC">退款信息</th>
				</tr>
				<tr>
					<th class="taC">退款单位名称</th>
					<td><input type="text" name="refundCompany" id="refundCompany" placeholder="请输入单位名称" aria-required="true" aria-invalid="true"></td>
				</tr>
				<tr>
					<th class="taC">退款的账号</th>
					<td><input type="text" name="refundNumber" id="refundNumber" placeholder="请输入账号" aria-required="true" aria-invalid="true"></td>
				</tr>
				<tr>
					<th class="taC">退款金额</th>
					<td><input type="text" name="refundPrice" id="refundPrice" placeholder="请输入退款金额" aria-required="true" aria-invalid="true"></td>
				</tr>
				<tr>
					<th class="taC">备注</th>
					<td><textarea name="refundRemarks" style="width:390px"></textarea></td>
				</tr>
				</tbody>
			</table>
    </div>
	<div class="modal-footer">
	    <input type="submit" class="button" value="确定">
	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
	</div>
			</div>
		</div>
		
	</form>
</div>
    <!--弹出退款-->
    
    <!--弹出退款-->
<div class="modal hide fade" id="refunded">
	<div class="modal-dialog">
		<div class="modal-content">
    <div class="modal-header">
    <h3>填写退款信息</h3>
    </div>
    <div class="modal-body saeaList">
    	<table class="table table-bordered table-condensed">
				<tbody >
				<th colspan="2" class="taC">退款信息</th>
				<tr>
					<th class="taC">退款单位名称</th>
					<td data-refundCompany ></td>
				</tr>
				<tr>
					<th class="taC">退款的账号</th>
					<td data-refundNumber ></td>
				</tr>
				<tr>
					<th class="taC">退款金额</th>
					<td data-refundPrice ></td>
				</tr>
				</tbody>
			</table>
    </div>
	<div class="modal-footer">
	    
	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
	</div>
			</div>
		</div>
</div>
    <!--弹出退款-->
    
    
    <!--弹出绑定新收款-->
<div class="modal hide fade" id="receipt">
<form action="/relationNewInvoiceReceivables" id="SIRC" method="post">	
<input type="hidden" name="iridKeyOld" id="iridKey" value="">
	<div class="modal-dialog">
		<div class="modal-content">
    <div class="modal-header">
    <h3>关联新联</h3>
    </div>
    <div class="modal-body">
    	<blockquote>
				<p></p><div class="input-append">
						<input class=" span4" placeholder="你可以按收款流水搜索" name='searchData' value='' type="text">
						<button class="btn btn-small" search-invoiceReceivables type="button">查询</button>
				</div><p></p>
			</blockquote>
			<table class="table table-bordered table-condensed">
				<tbody>
				<tr><th class="taC" width="70">收款金额</th><th class="taC">银行到帐信息</th><th class="taC">银行/到帐时间</th><th class="taC">收款认领</th><th class="taC">开票单位</th></tr>
				<tr htmlReceivables >
				
				</tr>
				</tbody>
			</table>
    </div>
	<div class="modal-footer">
	<input type="submit" class="button" value="关联新款">
	   
	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
	</div>
			</div>
		</div>
		</form>
</div>
    <!--弹出退款-->
	
	<div loading-msg='true' style="position:absolute;  left:50%;  top:50%;  "></div>
	
	<div class="modal  fade" id="billing">
		<div id="nr"></div>
	</div>
	
<script type="text/javascript">autoFlashHeight();</script>	
</body>