<!-- 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>

<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>

<script src="<?= receiptExtend ?>"></script>
<script>
$(function() {
$('select[expensesType]').change(function() {
	 var payVal=$(this).val();
	 if(payVal=="INCOME"){
		 $('#INCOMEBox').show();
		 $('#EXPENDITUREBox').hide();
	 }else if(payVal=="EXPENDITURE"){
		 $('#INCOMEBox').hide();
		 $('#EXPENDITUREBox').show();
	 }
});

	$('input[RPrice]').keyup(function() {
		var payVal=$(this).val();
		var val=payVal.replace(',','');
		$(this).val(val);
	});
	//expenditurePrice
	//
})
</script>

<body>
	<div class="mainLayout">
		<div class="mainMenu">
			<div class="menuItem">
				<a href="#" class="mLogo">CLD</a>
				<ul>
					<!-- include '../admin/menuReceipt' -->
				</ul>
			</div>
		</div>
		<div class="warpContent">
			<div class="subMenu fL">
				<div class="menuItem">
					<!-- include '../admin/receipt_menu' -->
				</div>
			</div>
				<div class="adminContent autoHeight">
					<div class="saea-borad">
						<div class="borad-news">
							<div class="saeaList">
								<div class="clearfix">
									<legend><div class="fR"></div>需要您处理</legend>
									<table class="table table-bordered table-condensed">
										<tbody>
										<tr><th class="taC" width="140">费用类型</th>
										<th class="taC">单号</th>
										<th class="taC">金额</th>
										<th class="taC">汇款金额</th>
										<th class="taC">结算费用</th>
										<th class="taC">状态</th>
										<th class="taC">操作</th></tr>
										<!-- loop receiptList -->
										<tr>
										<th>
										<!-- if {{receiptDetail' value.Rtype}}==1 --> 
										<!-- if {{receiptDetail' value.isBK}}==0 --> 
										借款
										<!-- elseif {{receiptDetail' value.isBK}}==1 --> 
										借款(报销)
										<!-- endif --> 
	  							<!-- elseif {{receiptDetail' value.Rtype}}==2 --> 
	  							对公汇款
	  							<!-- elseif {{receiptDetail' value.Rtype}}==3 --> 
	  							培训班结算
	  							<!-- elseif {{receiptDetail' value.Rtype}}==0 --> 
	  							 报销单 
	  							 <!-- endif --> 
										
										</th>
										<td>
										
										<!-- if {{receiptList' value.Rtype}}==3 -->
										
										<a href="/receiptTrain/info/{{receiptList' value.ridKey7}}.html" >{{receiptLogList' value.receiptOrder}}</a>
										<!-- else -->
										<a href="/expensesDoc/{{receiptList' value.rid}}">{{receiptDetail' value.receiptOrder}}</a>
										<!-- endif -->
										
										
										
										</td>
										<td class="taR">￥{{receiptList' value.sum}}</td>
										
										<td class="taR">￥
										<!-- if {{receiptList' value.Rtype}}==1 -->
											<!-- if {{receiptList' value.isBK}}==1 -->
											{{receiptList' value.balanceABS}}
											<!-- else -->
											{{receiptList' value.amountABS}}
											<!-- endif -->
										<!-- else -->
										{{receiptList' value.amountABS}}
										<!-- endif -->
										</td>
										
										<td class="taR">
										
										<!-- if {{receiptList' value.Rtype}}==2||{{receiptList' value.Rtype}}==0 --> 
							<span class="colRed">支出</span>￥{{receiptList' value.sum}}
							<!-- else -->
								<!-- if {{receiptList' value.Rtype}}==1 -->
									<!-- if {{receiptList' value.balance}}>=0 -->
									<span class="colRed">支出</span>
									<!-- else -->
									<span class="colGreen">收入</span>
									<!-- endif -->
									￥{{receiptList' value.balanceABS}}
								<!-- elseif {{receiptList' value.Rtype}}==3 -->
									<!-- if {{receiptList' value.payment}}<=0 -->
									<span class="colRed">支出</span>
									<!-- else -->
									<span class="colGreen">收入</span>
									<!-- endif -->
									￥{{receiptList' value.paymentABS}}
								<!-- endif -->
							
							<!-- endif -->
										
										</td>
										
										<td>
										<!-- if {{receiptDetail' value.status}}==2 --> 
										<span class="">审批中</span>
										<!-- elseif {{receiptDetail' value.status}}==1 or {{receiptDetail' value.status}}==6 -->
										<span class="colBlue">执行中</span>
										<!-- endif --> 
										</td>
										<td width="120">
<a class="button btn-block" receiptWasteDetail data="{{receiptList' value.ridKey}}"  href="#in-income" data-toggle="modal">录入流水</a>
										</td>
										</tr>
										<!-- endloop -->
										</tbody>
									</table>
								</div>
							</div>
						</div>
					</div>
			</div>
	<!--弹出录入流水-->
<div class="modal fade" id="in-income">
	<div class="modal-dialog">
		<div class="modal-content">
		<form action="/receiptWasteBookAddDo" name="recepitAdd" method="post" class="nice-validator n-yellow" novalidate="novalidate">
		<input type="hidden" name="ridKey" id="ridKey" value="">
		<input type="hidden" name="paymentAuthCode" id="paymentAuthCode" value="">
		
		    <div class="modal-header">
		    	<h3>生成流水</h3>
		    </div>
		    <div class="modal-body saeaList">
		    
		    	<div class="alert alert-erro">生成流水后，该费用在执行后将不再自动生成流水。</div>
				<table class="table table-bordered table-condensed">
					<tr>
					<th class="taC">费用类别</th>
					<td id='Rtype'>报销单</td>
					<th class="taC">状态</th>
					<td id='status'></td>
					</tr>
					<tr>
					<th class="taC">金额</th><td id='sum'></td>
					<th class="taC">汇款金额</th><td id='amount'></td>
					</tr>
				</table>
				
				<table class="table table-bordered table-condensed">
					<thead>
						<tr>
							<th class="taC">流水类型</th>
							<td>
								<div id="receiptTrainType" class="hide">
								<select name="expensesType" expensesType id="expensesType" >
									<option value="INCOME">收入</option>
									<option value="EXPENDITURE">支出</option>
								</select>
								<p>"支出"由公司汇出，"收入"提交人汇款至公司。</p>
								</div>
								<div id="receiptType" class="hide">
								
								</div>
							</td>
						</tr>
						</thead>
						<!--支出-->
						<tbody id="EXPENDITUREBox" class="hide">
						<tr>
							<th class="taC">支出银行</th>
							<td>
								
								<select name="expenditureBank" id="expenditureBank">
									<option value="CGBDeposit">纵横广发</option>
									<option value="ICBCDeposit">纵横工行</option>
									<option value="HUADeposit">华润银行</option>
									<option value="PersonalDeposit">个人广发</option>
									</select>
								
							</td>
						</tr>
						<tr>
							<th class="taC">金额</th>
							<td><input type="text" name="expenditurePrice" RPrice id="expenditurePrice" value=""></td>
						</tr>
						<tr>
							<th class="taC">备注</th>
							<td><textarea name="expenditureRemarks"></textarea></td>
						</tr>
						<tr>
							<th class="taC">录入时间</th>
							<td><input class="datepicker-here span3" name="expenditureInputDate" value='{{inputDate}}' placeholder="按时间筛选" type="text" data-timepicker="true" data-language="zh" data-time-format="hh:ii:00"></td>
						</tr>
						</tbody>
						<!--收入出-->
						<tbody id="INCOMEBox" style="border-top:0px">
						<tr>
							<th class="taC">到款银行</th>
							<td>
								<select name="receivedBank" id="receivedBank">
									<option value="CGBDeposit">纵横广发</option>
									<option value="ICBCDeposit">纵横工行</option>
									<option value="HUADeposit">华润银行</option>
									<option value="PersonalDeposit">个人广发</option>
									</select>
							</td>
						</tr>
						<tr>
							<th class="taC">金额</th>
							<td>
							<div id="receiptTrainPrice" class="hide">
							<input type="text" name="receivedPrice" RPrice id="receivedPrice" value="">
							</div>
							<div id="receiptPrice" class="hide">
							</div>
							</td>
						</tr>
						<tr>
							<th class="taC">备注</th>
							<td><textarea name="receivedRemarks"></textarea></td>
						</tr>
						<tr>
							<th class="taC">录入时间</th>
							<td><input class="datepicker-here span3" name="receivedInputDate" value='{{inputDate}}' placeholder="按时间筛选" type="text" data-timepicker="true" data-language="zh" data-time-format="hh:ii:00"></td>
						</tr>
						</tbody>
				</table>
				
				
		    </div>
			<div class="modal-footer">
			<input type="submit" value="确认录入" class="button">
				
				<a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
			</div>
			</form>
			
		</div>
	</div>
</div>
    <!--邮寄-->
<script type="text/javascript">autoFlashHeight();</script>
</body>
