Browse Source

更新结算代码

caipin 6 years ago
parent
commit
f870c0ec25
39 changed files with 1677 additions and 514 deletions
  1. 2 2
      global/js/index.js
  2. 93 96
      protected/cache/staffCollect/staffCollect_2015_.htmls
  3. 15 2
      protected/config/acl.conf.php
  4. 1 1
      protected/config/execute/execute.ini
  5. 37 3
      protected/config/routes.conf.php
  6. 169 2
      protected/controller/AdminController.php
  7. 154 14
      protected/controller/InvoiceController.php
  8. 431 115
      protected/controller/MainController.php
  9. 301 157
      protected/controller/ReceiptController.php
  10. 1 0
      protected/controller/SoftController.php
  11. 7 7
      protected/model/accountItem.php
  12. 26 2
      protected/model/invoice.php
  13. 19 7
      protected/model/invoiceTraining.php
  14. 4 1
      protected/model/longle.php
  15. 86 0
      protected/model/receipt.php
  16. 6 6
      protected/model/receiptDetail.php
  17. 5 2
      protected/model/receiptLog.php
  18. 1 5
      protected/view/admin/adminInvoice.html
  19. 1 5
      protected/view/admin/adminInvoiceCategory.html
  20. 1 5
      protected/view/admin/adminInvoiceCompany.html
  21. 14 1
      protected/view/admin/approvalExpenses.html
  22. 12 2
      protected/view/admin/expenses.html
  23. 19 4
      protected/view/admin/hisImplement.html
  24. 144 39
      protected/view/admin/implement.html
  25. 31 0
      protected/view/admin/invoice.html
  26. 20 2
      protected/view/admin/invoiceAS.html
  27. 1 1
      protected/view/admin/invoiceAdd.html
  28. 2 2
      protected/view/admin/invoicePrint.html
  29. 1 1
      protected/view/admin/invoicePrintStayAchieve.html
  30. 5 0
      protected/view/admin/invoiceTrainingDetail.html
  31. 4 4
      protected/view/admin/invoiceUntreadIsAchieve.html
  32. 5 3
      protected/view/admin/receiptStatisticsStaffDetail.html
  33. 2 1
      protected/view/admin/receipt_menu.html
  34. 20 4
      protected/view/admin/saeaBorad.html
  35. 22 13
      protected/view/admin/saeaStaffCollectB.html
  36. 3 1
      protected/view/admin/saea_create.html
  37. 1 1
      protected/view/admin/saea_edit.html
  38. 10 2
      protected/view/admin/staffCollectMonthDetail.html
  39. 1 1
      protected/view/header.html

+ 2 - 2
global/js/index.js

@@ -1058,7 +1058,7 @@ function addClientByCompany(cid){
 		global: true,
 		success: function(data){
 
-			$html='<form name="adcl" action="/addClient" method="post" onsubmit="return checkadcl2()">';
+			$html='<form name="adcl" action="/addClientByCompany" method="post" onsubmit="return checkadcl2()">';
 			$html+='<input type="hidden" name="companyKey" id="companyKey" value="'+data.data.companyKey+'" >';
 			$html+='<div class="contactInfo"><div class="contactPanel"><table><tbody>';
 			$html+='<tr><th>姓名</th><td><span data-placement="bottom" data-toggle="ctooltip" data-original-title="*必填;请填写真实姓名" onmouseover="ctooltipon(this)"><input type="text" name="clientname" id="adclientname"  style="width:55%"></span>';
@@ -1070,7 +1070,7 @@ function addClientByCompany(cid){
 				$html+='<tr><th>备注</th><td colspan="4"><span data-placement="bottom" data-toggle="ctooltip" data-original-title=""><input type="text" id="mark" name="mark" value=""></span></td></tr>';
 				$html+='</tr></tbody></table></div><div class="contactPanel"><table>';
 				
-				$html+='<tbody><tr><th>单位</th><td colspan="5"><input type="text" name="companyname" id="adcompanyname" value="'+data.data.companyname+'"> </td></tr>';
+				$html+='<tbody><tr><th>单位</th><td colspan="5"><input type="text" name="companyname" readonly id="adcompanyname" value="'+data.data.companyname+'"> </td></tr>';
 				
 				$html+='<tr><th>地区</th><td colspan="5"><span data-placement="bottom" data-toggle="ctooltip" data-original-title="暂不提供修改" onmouseover="ctooltipon(this)">'+data.data.dishtml+'</span></td></tr>';
 				$html+='<tr><th>单位地址</th><td colspan="5"><input type="text" id="address" value="'+data.data.address+'" name="address"> </td></tr>';

+ 93 - 96
protected/cache/staffCollect/staffCollect_2015_.htmls

@@ -3,41 +3,77 @@
 <head>
 	<meta charset=utf-8> 
 	<title>CLD.System</title> 
-	
 	<link rel="shortcut icon" href="http://cld.com/global/images/favicon.ico"> 
 	<meta name=copyright content=smartcost.com.cn> 
 	<link rel=stylesheet href="http://cld.com/global/css/global.css"> 
-	<script src="http://cld.com/global/js/jquery-1.7.1.min.js"></script> 
+	<script src="http://cld.com/global/js/jquery-1.7.2.min.js"></script>
+	<script type="text/javascript" src="http://cld.com/global/js/jquery.infinitescroll.min.js"></script> 
 	<script src="http://cld.com/global/js/global.js"></script>
-</head>
-<script src="http://cld.com/global/js/receipt.js"></script>
+	<script src="http://cld.com/global/js/index.js?1"></script></head>
+
+<script type="text/javascript" src="http://cld.com/global/js/receipt.js?1"></script>
+<script type="text/javascript" >
+</script>
 <body>
 	<div class="mainLayout">
 		<div class="mainMenu">
 			<div class="menuItem">
 				<a href="#" class="mLogo">CLD</a>
 				<ul>
-					<li data-placement="right" data-toggle="ctooltip" data-original-title="信息中心" class="topLine"><a href="/" class="icon-  ">B</a></li>
-<li data-placement="right" data-toggle="ctooltip" data-original-title="通讯录"><a href="/contacts" class="icon- ">A</a></li>
+					
+<li data-placement="right" data-toggle="ctooltip" data-original-title="信息中心" class="topLine">
+<a href="/" class="icon-  ">B</a>
+</li>
+
+<li data-placement="right" data-toggle="ctooltip" data-original-title="通讯录">
+<a href="/contacts" class="icon- ">A</a>
+</li>
+
 <li data-placement="right" data-toggle="ctooltip" data-original-title="在线锁库">
-<a href="/keyonline" class="icon- ">C</a></li>
+<a href="/keyonline" class="icon- ">C</a>
+</li>
+
+
+<li  data-placement="right" data-toggle="ctooltip" class="topLine " data-original-title="费用管理"  >
+<a href="/saeaBorad" class="icon-  selected " >U</a>
+</li>  
+
+<li data-placement="right" data-toggle="ctooltip"  data-original-title="发票申请">
+<a href="/invoice" class="icon- ">D</a>
+</li>
+
+
+<li data-placement="right" data-toggle="ctooltip"  class="news"  data-original-title="人资管理">
+<a href="/hr" class="icon- ">m</a>
+</li>
+
+
+
+
 
-<li class="hide"><a href="#">E</a></li>
-<li class="hide"><a href="#">D</a></li> 
 
-<li data-placement="right" class="topLine  news  " data-toggle="ctooltip" data-original-title="费用管理" ><a href="/saeaBorad" class="icon-  selected " >U</a></li>  
- 
-<li data-placement="right" data-toggle="ctooltip"  data-original-title="发票申请"><a href="/invoice" class="icon- ">D</a></li>
- 
- <li data-placement="right" data-toggle="ctooltip" data-original-title="邮件推广">  
-<a href="/eMailTask" class="icon- ">Z</a></li>
 <li data-placement="right" data-toggle="ctooltip" data-original-title="假期管理">
- <a href="/myList" class="icon- ">X</a></li>
-<li data-placement="right" data-toggle="ctooltip" data-original-title="APP" class="topLine">
-<a href="/app" class="icon- ">Y</a></li>
-<li data-placement="right" data-toggle="ctooltip" data-original-title="个人设置" ><a href="/adminmyinfo" class="icon- " >F</a></li> 
+    <a href="/myList" class="icon- ">X</a>
+</li>
+    
+<li data-placement="right" data-toggle="ctooltip" data-original-title="邮件推广">  
+<a href="/eMailTask" class="icon- ">Z</a></li>    
+    
+<li data-placement="right" data-toggle="ctooltip" class="topLine" data-original-title="APP" >
+<a href="/app" class="icon- ">Y</a>
+</li>
+
+
+<li data-placement="right" style="display:none" data-toggle="ctooltip" data-original-title="个人设置" ><a href="/adminmyinfo" class="icon- " >F</a></li> 
+
+<li data-placement="right" data-toggle="ctooltip" data-original-title="个人设置" >
+<a href="/settingEmployeeInfo" class="icon- " >F</a>
+</li> 
+
 <li data-placement="right" data-toggle="ctooltip" data-original-title="退出系统"><a href="/out" class="icon-">G</a></li>
-									</ul>
+					
+					
+														</ul>
 			</div>
 		</div>
 		<div class="warpContent">
@@ -50,17 +86,33 @@
 	<li><a  href="/expenses">我的费用</a></li>
 	<li><a href="/personalCollect"  >费用汇总</a></li>
 						
+						
+						
+<li><a href="/payments"   >日常收支</a></li>
+						
+						
 							
 	<li  class="topLine  "><a  href="/approvalExpenses/pendApproval">费用审批</a></li>
 						
-		<li  class="news"  ><a  href="/hisImplement">费用执行</a></li>			
+
+<li  class=""><a  href="/receiptWasteBook">费用流水</a></li>						
+						
+						
+		<li  ><a  href="/hisImplement">费用执行</a></li>			
 					
 	<li><a  href="/remittanceHky">费用汇款</a></li>			
 						
-		<li><a href="/companyCategoryCollect"  class="selected"  >公司汇总</a></li>			
-				
+	
+			
 						
-		<li class="topLine"><a href="#welcome" data-toggle="modal">使用帮助</a></li>
+			<li><a href="/companyCategoryCollect"  class="selected"  >公司汇总</a></li>			
+		
+		
+	<li><a href="/paymentsCollect"  >日常收支汇总</a></li>
+	<li><a href="/wasteBook"  >公司流水</a></li>
+		
+	
+	<li class="topLine"><a href="#welcome" data-toggle="modal">使用帮助</a></li>
 
 	</ul>
 						<!--弹出邮寄-->
@@ -135,7 +187,8 @@
 <option  selected  value="2015">2015</option>
 <option  value="2016">2016</option>
 <option  value="2017">2017</option>
-<option  value="2018">2018</option>	  					</select> 
+<option  value="2018">2018</option>
+<option  value="2019">2019</option>	  					</select> 
 	  					
 	  					
 	  					<select onchange="javascript:location.href=this.value;">
@@ -185,31 +238,17 @@
 	  						<th class="taC" width="110">总计</th>
 	  						</tr>
 	  							  						<tr>
-	  						<th rowspan="5">安徽办</th><td><a href="/staffCollectDetail/陈帅">陈帅</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  						<th rowspan="4">安徽办</th><td><a href="/staffCollectDetail/陈帅">陈帅</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
 	  							  						<tr>
 	  						<td><a href="/staffCollectDetail/范月光">范月光</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
 	  							  						<tr>
 	  						<td><a href="/staffCollectDetail/林森">林森</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
 	  							  						<tr>
-	  						<td><a href="/staffCollectDetail/xmlwww">xmlwww</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
-	  							  						<tr>
 	  						<th class="taR">小计</th><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
 				<td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
 				<td class="taR">¥0</td><td class="taR">¥0</td>	  						</tr>
 	  							  						<tr>
-	  						<th rowspan="5">甘肃办</th><td><a href="/staffCollectDetail/王涛">王涛</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
-	  							  						<tr>
-	  						<td><a href="/staffCollectDetail/苟彦刚">苟彦刚</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
-	  							  						<tr>
-	  						<td><a href="/staffCollectDetail/舒媚">舒媚</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
-	  							  						<tr>
-	  						<td><a href="/staffCollectDetail/李满花">李满花</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
-	  							  						<tr>
-	  						<th class="taR">小计</th><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
-				<td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
-				<td class="taR">¥0</td><td class="taR">¥0</td>	  						</tr>
-	  							  						<tr>
-	  						<th rowspan="6">广东办</th><td><a href="/staffCollectDetail/刘飞">刘飞</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  						<th rowspan="8">广东办</th><td><a href="/staffCollectDetail/刘飞">刘飞</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
 	  							  						<tr>
 	  						<td><a href="/staffCollectDetail/王洪生">王洪生</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
 	  							  						<tr>
@@ -219,65 +258,15 @@
 	  							  						<tr>
 	  						<td><a href="/staffCollectDetail/封冬梅">封冬梅</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
 	  							  						<tr>
-	  						<th class="taR">小计</th><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
-				<td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
-				<td class="taR">¥0</td><td class="taR">¥0</td>	  						</tr>
-	  							  						<tr>
-	  						<th rowspan="3">广西办</th><td><a href="/staffCollectDetail/黄巾桃">黄巾桃</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
-	  							  						<tr>
-	  						<td><a href="/staffCollectDetail/陈叶婷">陈叶婷</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
-	  							  						<tr>
-	  						<th class="taR">小计</th><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
-				<td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
-				<td class="taR">¥0</td><td class="taR">¥0</td>	  						</tr>
-	  							  						<tr>
-	  						<th rowspan="4">江西办</th><td><a href="/staffCollectDetail/祝海宾">祝海宾</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
-	  							  						<tr>
-	  						<td><a href="/staffCollectDetail/王文鹏">王文鹏</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
-	  							  						<tr>
-	  						<td><a href="/staffCollectDetail/蔡晚君">蔡晚君</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  						<td><a href="/staffCollectDetail/李四测试1">李四测试1</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
 	  							  						<tr>
-	  						<th class="taR">小计</th><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
-				<td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
-				<td class="taR">¥0</td><td class="taR">¥0</td>	  						</tr>
-	  							  						<tr>
-	  						<th rowspan="4">四川办</th><td><a href="/staffCollectDetail/罗杰">罗杰</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
-	  							  						<tr>
-	  						<td><a href="/staffCollectDetail/全冰">全冰</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
-	  							  						<tr>
-	  						<td><a href="/staffCollectDetail/汪琴">汪琴</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  						<td><a href="/staffCollectDetail/纵横SC">纵横SC</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
 	  							  						<tr>
 	  						<th class="taR">小计</th><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
 				<td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
 				<td class="taR">¥0</td><td class="taR">¥0</td>	  						</tr>
 	  							  						<tr>
-	  						<th rowspan="6">重庆办</th><td><a href="/staffCollectDetail/王星植">王星植</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
-	  							  						<tr>
-	  						<td><a href="/staffCollectDetail/张文远">张文远</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
-	  							  						<tr>
-	  						<td><a href="/staffCollectDetail/方淑静">方淑静</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
-	  							  						<tr>
-	  						<td><a href="/staffCollectDetail/李清学">李清学</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
-	  							  						<tr>
-	  						<td><a href="/staffCollectDetail/周洪波">周洪波</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
-	  							  						<tr>
-	  						<th class="taR">小计</th><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
-				<td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
-				<td class="taR">¥0</td><td class="taR">¥0</td>	  						</tr>
-	  							  						<tr>
-	  						<th rowspan="5">内蒙办</th><td><a href="/staffCollectDetail/罗发明">罗发明</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
-	  							  						<tr>
-	  						<td><a href="/staffCollectDetail/孙燕娇">孙燕娇</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
-	  							  						<tr>
-	  						<td><a href="/staffCollectDetail/张晓娟">张晓娟</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
-	  							  						<tr>
-	  						<td><a href="/staffCollectDetail/杨卫东">杨卫东</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
-	  							  						<tr>
-	  						<th class="taR">小计</th><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
-				<td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
-				<td class="taR">¥0</td><td class="taR">¥0</td>	  						</tr>
-	  							  						<tr>
-	  						<th rowspan="19">总部</th><td><a href="/staffCollectDetail/谭玉堂">谭玉堂</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  						<th rowspan="23">总部</th><td><a href="/staffCollectDetail/谭玉堂">谭玉堂</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
 	  							  						<tr>
 	  						<td><a href="/staffCollectDetail/何银龄">何银龄</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
 	  							  						<tr>
@@ -309,10 +298,18 @@
 	  							  						<tr>
 	  						<td><a href="/staffCollectDetail/付青青">付青青</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
 	  							  						<tr>
-	  						<td><a href="/staffCollectDetail/王丰">王丰</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
-	  							  						<tr>
 	  						<td><a href="/staffCollectDetail/欧桃珍">欧桃珍</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
 	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/温秀娟">温秀娟</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/纵横知道">纵横知道</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/sha">sha</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/操作日志">操作日志</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
+	  						<td><a href="/staffCollectDetail/黄嘉玲">黄嘉玲</a></td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR colGreen"><b>¥0</b></td>	  						</tr>
+	  							  						<tr>
 	  						<th class="taR">小计</th><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
 				<td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td><td class="taR">¥0</td>
 				<td class="taR">¥0</td><td class="taR">¥0</td>	  						</tr>

+ 15 - 2
protected/config/acl.conf.php

@@ -270,7 +270,8 @@ $acl ['INVOICE'] ['allow'] = array (
 				'ajaxGetInvoiceApprovalDetail',
 				'ajaxInvoicePushNotice',
 				'invoiceAddFill',
-				'ajaxGetInvoiceByNew'
+				'ajaxGetInvoiceByNew',
+				'invoiceUntreadED'
 		)
 );
 //信息中心
@@ -313,6 +314,7 @@ $acl ['DIRECTORIES'] ['allow'] = array (
 				'ajaxDeleteTagCompany',
 				'remindCL',
 				'DoEdiTag',
+				'addClientByCompany'
 		)
 );
 
@@ -450,7 +452,7 @@ $acl ['RECEIPTS'] ['allow'] = array (
 				'receiptTrainLecturerAddDo',
 				'receiptTrainLecturerDelDo',
 				'h5Upload',
-				'receiptTrainApprovalDo',
+				'receiptTrainDo',
 		)
 );
 $acl ['RECEIPTSEXTEND'] ['allow'] = array (
@@ -460,12 +462,23 @@ $acl ['RECEIPTSEXTEND'] ['allow'] = array (
 				'receiptTrainInvoice',
 				'receiptTrainItem',
 				'receiptTrainLecturer',
+				'receiptTrainApproval',
 				'receiptWasteBook',
+				'receiptWasteBookAddDo',
+				'receiptTrainApprovalDo',
+				'receiptTrainApprovalBackDo',
+				'invoiceReceivablesStrikeAddDo',
+				'receiptTrainImplement',
+				'receiptTrainImplementDo',
+				'receiptTrainImplementWateDo',
+				'receiptTrainItemDelDo',
 		)
 );
 $acl ['RECEIPTSAJAX'] ['allow'] = array (
 		'ReceiptAjaxController' => array (
 				'ajaxGetReceiptTrainLoan',
+				'ajaxSetRceiptAmountByRid',
+				'ajaxGetReceiptDetailByJson',
 		)
 );
 //人资

+ 1 - 1
protected/config/execute/execute.ini

@@ -1 +1 @@
-,41,41,41,41,58,42,42,42
+,41,41,41,41,58,42,42,42,50

+ 37 - 3
protected/config/routes.conf.php

@@ -108,7 +108,9 @@ $route['*']['/adminReceiptLecturer'] = array('AdminController', 'adminReceiptLec
 $route['*']['/adminReceiptLecturerAddDo'] = array('AdminController', 'adminReceiptLecturerAddDo');
 $route['*']['/adminReceiptLecturerDelDo/:lidKey'] = array('AdminController', 'adminReceiptLecturerDelDo');
 
-
+$route['*']['/adminInvoiceTrain'] = array('AdminController', 'adminInvoiceTrain');
+$route['*']['/delInvoiceTrainManage/:sidKey/:icidKey'] = array('AdminController', 'delInvoiceTrainManage');
+$route['*']['/addInvoiceTrainManage'] = array('AdminController', 'addInvoiceTrainManage');
 
 $route['*']['/addRole'] = array('AdminController', 'addRole');
 $route['*']['/adminRole'] = array('AdminController', 'adminRole');
@@ -190,7 +192,7 @@ $route['*']['/eMail'] = array('ReceiptController', 'eMail');
 
 $route['*']['/revocationAdjustment/:sidKey/:price/:ridKey/:reviseKey'] = array('ReceiptController', 'revocationAdjustment');
 
-$route['*']['/staffCollectMonthDetail/:year/:month'] = array('ReceiptController', 'staffCollectMonthDetail');
+$route['*']['/staffCollectMonthDetail/:year/:month/:nature'] = array('ReceiptController', 'staffCollectMonthDetail');
 $route['*']['/staffCollectMonthDetail2/:year/:month'] = array('ReceiptController', 'staffCollectMonthDetail2');
 
 $route['*']['/staffCollectMonthDetail'] = array('ReceiptController', 'staffCollectMonthDetail');
@@ -250,11 +252,14 @@ $route['*']['/receiptTrainReceivablesDelDo'] = array('ReceiptController', 'recei
 
 $route['*']['/receiptTrainItemEdi/:rid'] = array('ReceiptController', 'receiptTrainItemEdi','extension'=>'.html');
 $route['*']['/receiptTrainItemAddDo'] = array('ReceiptController', 'receiptTrainItemAddDo');
+$route['*']['/receiptTrainItemAddDo/:payType'] = array('ReceiptController', 'receiptTrainItemAddDo');
+$route['*']['/receiptTrainItemDelDo/:riidKey/:ridKey'] = array('ReceiptExtendController', 'receiptTrainItemDelDo');
+
 
 $route['*']['/receiptTrainLecturerEdi/:rid'] = array('ReceiptController', 'receiptTrainLecturerEdi','extension'=>'.html');
 $route['*']['/receiptTrainLecturerAddDo'] = array('ReceiptController', 'receiptTrainLecturerAddDo');
 $route['*']['/receiptTrainLecturerDelDo'] = array('ReceiptController', 'receiptTrainLecturerDelDo');
-$route['*']['/receiptTrainApprovalDo'] = array('ReceiptController', 'receiptTrainApprovalDo');
+$route['*']['/receiptTrainDo'] = array('ReceiptController', 'receiptTrainDo');
 
 $route['*']['/receiptTrain/:ridKey'] = array('ReceiptExtendController', 'receiptTrain','extension'=>'.html');
 $route['*']['/receiptTrain/:showType/:ridKey'] = array('ReceiptExtendController', 'receiptTrain','extension'=>'.html');
@@ -262,9 +267,35 @@ $route['*']['/receiptTrainLoan/:showType/:ridKey'] = array('ReceiptExtendControl
 $route['*']['/receiptTrainInvoice/:showType/:ridKey'] = array('ReceiptExtendController', 'receiptTrainInvoice','extension'=>'.html');
 $route['*']['/receiptTrainItem/:showType/:ridKey'] = array('ReceiptExtendController', 'receiptTrainItem','extension'=>'.html');
 $route['*']['/receiptTrainLecturer/:showType/:ridKey'] = array('ReceiptExtendController', 'receiptTrainLecturer','extension'=>'.html');
+$route['*']['/receiptTrainApproval/:showType/:ridKey'] = array('ReceiptExtendController', 'receiptTrainApproval','extension'=>'.html');
+$route['*']['/receiptTrainApprovalDo'] = array('ReceiptExtendController', 'receiptTrainApprovalDo');
+$route['*']['/receiptTrainApprovalBackDo'] = array('ReceiptExtendController', 'receiptTrainApprovalBackDo');
+$route['*']['/invoiceReceivablesStrikeAddDo'] = array('ReceiptExtendController', 'invoiceReceivablesStrikeAddDo');
+
+$route['*']['/receiptTrainImplement/:ridKey'] = array('ReceiptExtendController', 'receiptTrainImplement','extension'=>'.html');
+$route['*']['/receiptTrainImplementDo'] = array('ReceiptExtendController', 'receiptTrainImplementDo');
+$route['*']['/receiptTrainImplementWateDo'] = array('ReceiptExtendController', 'receiptTrainImplementWateDo');
+
+
+
+$route['*']['/ajaxSetRceiptAmountByRid'] = array('ReceiptAjaxController', 'ajaxSetRceiptAmountByRid');
+$route['*']['/ajaxGetReceiptDetailByJson'] = array('ReceiptAjaxController', 'ajaxGetReceiptDetailByJson');
 
 $route['*']['/receiptWasteBook'] = array('ReceiptExtendController', 'receiptWasteBook');
 
+$route['*']['/receiptWasteBookAddDo'] = array('ReceiptExtendController', 'receiptWasteBookAddDo');
+
+
+
+
+
+
+
+
+//添加客户
+$route['*']['/addClientByCompany'] = array('MainController', 'addClientByCompany');
+
+
 
 //邮件群发
 $route['*']['/eMailTask'] = array('MainController', 'eMailTask');
@@ -506,6 +537,9 @@ $route['get']['/invoiceUntreadAchieve/:page'] = array('InvoiceController', 'invo
 $route['get']['/invoiceUntreadAchieve/:page/:date'] = array('InvoiceController', 'invoiceTAchieve');
 $route['get']['/invoiceUntreadAchieve/:page/:date/:MebSea'] = array('InvoiceController', 'invoiceTAchieve');
 
+$route['get']['/invoiceUntreadED'] = array('InvoiceController', 'invoiceUntreadED');
+
+
 //新加路由
 $route['post']['/invoiceLossDo'] = array('InvoiceController', 'invoiceLossDo');
 

+ 169 - 2
protected/controller/AdminController.php

@@ -1112,7 +1112,7 @@ class AdminController extends DooController {
 				}
 			}
 		}
-		
+		$data ['invoiceMemu'] = "Invoice";
 		$data ['invoice'] = $execute;
 		$data ['memu'] = "invoice";
 		$data ['staff'] = $this->staff;
@@ -1441,6 +1441,7 @@ class AdminController extends DooController {
 		$data ['categoryList'] = $categoryList;
 		$data ['invoiceStaff'] = json_encode ( $invoiceStaff );
 		
+		$data ['invoiceMemu'] = "InvoiceCompany";
 		$data ['memu'] = "invoice";
 		$data ['staff'] = $this->staff;
 		$this->render ( "/admin/adminInvoiceCompany", $data );
@@ -1554,6 +1555,172 @@ class AdminController extends DooController {
 	}
 	
 	/**
+	 * 培训班查看权限
+	 */
+	function adminInvoiceTrain(){
+		
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		Doo::loadModel ( 'staff' );
+		$staff = new staff ();
+		Doo::loadModel ( "invoiceTrainManage" );
+		$invoiceCompanyManage = new invoiceTrainManage ();
+		Doo::loadModel ( 'L_category' );
+		$category = new L_category ();
+		
+		$categoryList = $category->getCategory ();
+		$managelist = $invoiceCompanyManage->find ( array (
+				'asArray' => true
+		) );
+		$staffList = $staff->getStaff ();
+		
+		$invoiceStaff = array ();
+		foreach ( $categoryList as $key => $value ) {
+			$invoiceStaff [$value ['cidKey']] = array ();
+			$categoryList [$key] ['html'] = '';
+			foreach ( $staffList as $k => $v ) {
+				$ul = array ();
+				if ($value ['cid'] == $v ['cid']) {
+					array_push ( $ul, $v ['sidKey'] );
+					array_push ( $ul, $v ['username'] );
+					array_push ( $invoiceStaff [$value ['cidKey']], $ul );
+				}
+			}
+				
+			foreach ( $managelist as $e => $a ) {
+				if ($value ['cid'] == $a ['cid']) {
+					$name = json_decode ( $a ['staff'] );
+					$staffString = "";
+					foreach ( $name as $y => $l ) {
+						$sidKey = $XDeode->encode ( $l [0] );
+						$icidKey = $XDeode->encode ( $a ['icid'] );
+						$staffString .= $l [1] . '<a href="javascript:if(window.confirm(\'确认删除?\'))window.location=\'/delInvoiceTrainManage/' . $sidKey . '/' . $icidKey . '\'"  role="button" title="删除" class="icon-">k</a>&nbsp;';
+					}
+					$categoryList [$key] ['html'] = $staffString;
+					break;
+				}
+			}
+		}
+		
+		$data ['categoryList'] = $categoryList;
+		$data ['invoiceStaff'] = json_encode ( $invoiceStaff );
+		
+		$data ['invoiceMemu'] = "InvoiceTrain";
+		$data ['memu'] = "invoice";
+		$data ['staff'] = $this->staff;
+		$this->render ( "/admin/adminInvoiceTrain", $data );
+		
+	}
+	
+	/**
+	 * 添加办事处查看权限
+	 */
+	function addInvoiceTrainManage() {
+		$cidKey = $this->get_args ( 'cidKey' ) ? $this->get_args ( 'cidKey' ) : "";
+		$sidKey = $this->get_args ( 'sidKey' ) ? $this->get_args ( 'sidKey' ) : "";
+	
+		if (! empty ( $cidKey ) && ! empty ( $sidKey )) {
+			Doo::loadModel ( "invoiceTrainManage" );
+			$invoiceCompanyManage = new invoiceTrainManage ();
+			Doo::loadClass ( 'XDeode' );
+			$XDeode = new XDeode ( 5 );
+			Doo::loadModel ( 'staff' );
+			$staff = new staff ();
+				
+			$cid = $XDeode->decode ( $cidKey );
+			$sid = $XDeode->decode ( $sidKey );
+			if (! is_numeric ( $cid ) || ! is_numeric ( $sid ))
+				die ( 'illegal request' );
+					
+				$icm = $invoiceCompanyManage->getOne ( array (
+						'where' => 'cid =' . $cid,
+						'asArray' => true
+				) );
+				$staffDetail = $staff->getStaffBySid ( $sid );
+					
+				if (empty ( $icm )) {
+					$invoiceCompanyManage = new invoiceTrainManage ();
+					$list = array ();
+	
+					$info = array (
+							$staffDetail ['sid'],
+							$staffDetail ['username']
+					);
+					array_push ( $list, $info );
+	
+					$invoiceCompanyManage->cid = $cid;
+					$invoiceCompanyManage->staff = json_encode ( $list );
+	
+					$invoiceCompanyManage->insert ();
+				} else {
+					$invoiceCompanyManage = new invoiceTrainManage ();
+					$list = json_decode ( $icm ['staff'], true );
+	
+					$flag = true;
+					foreach ( $list as $key => $value ) {
+						if ($value [0] == $sid) {
+							$flag = false;
+							break;
+						}
+					}
+					if ($flag) {
+						$info = array (
+								$staffDetail ['sid'],
+								$staffDetail ['username']
+						);
+						array_push ( $list, $info );
+					}
+					$invoiceCompanyManage->staff = json_encode ( $list );
+					$invoiceCompanyManage->update ( array (
+							'where' => 'icid = ' . $icm ['icid']
+					) );
+				}
+				return '/adminInvoiceTrain';
+		}
+		die ( 'illegal request' );
+	}
+	
+	/**
+	 * 去除查看办事处汇总人员
+	 */
+	function delInvoiceTrainManage() {
+		$sidKey = isset ( $this->params ['sidKey'] ) ? $this->params ['sidKey'] : '';
+		$icidKey = isset ( $this->params ['icidKey'] ) ? $this->params ['icidKey'] : '';
+	
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+	
+		$icid = $XDeode->decode ( $icidKey );
+		$sid = $XDeode->decode ( $sidKey );
+		if (! is_numeric ( $icid ) || ! is_numeric ( $sid ))
+			die ( 'illegal request' );
+	
+			Doo::loadModel ( "invoiceTrainManage" );
+			$invoiceCompanyManage = new invoiceTrainManage ();
+	
+			$icmDetail = $invoiceCompanyManage->getInvoiceCMByIcid ( $icid );
+			if (empty ( $icmDetail ))
+				die ( 'illegal request' );
+	
+				$list = json_decode ( $icmDetail ['staff'], true );
+	
+				foreach ( $list as $k => $v ) {
+					if ($v [0] == $sid) {
+						unset ( $list [$k] );
+						break;
+					}
+				}
+				$invoiceCompanyManage = new invoiceTrainManage ();
+				$invoiceCompanyManage->staff = json_encode ( $list );
+				$invoiceCompanyManage->update ( array (
+						'where' => 'icid = ' . $icmDetail ['icid']
+				) );
+	
+				return '/adminInvoiceTrain';
+	}
+	
+	
+	/**
 	 * 开票办事处权限设置
 	 */
 	function adminInvoiceCategory() {
@@ -1601,7 +1768,7 @@ class AdminController extends DooController {
 		}
 		
 		// print_r($invoiceStaff);
-		
+		$data ['invoiceMemu'] = "InvoiceCategory";
 		$data ['categoryList'] = $categoryList;
 		$data ['invoiceStaff'] = json_encode ( $invoiceStaff );
 		

File diff suppressed because it is too large
+ 154 - 14
protected/controller/InvoiceController.php


+ 431 - 115
protected/controller/MainController.php

@@ -58,11 +58,11 @@ class MainController extends DooController {
 		// 主权限获得与判断
 		Doo::loadModel ( 'staff' );
 		$staff = new staff ();
-		$detail=array();
-		if(isset($_COOKIE ["staff"]))
+		$detail = array ();
+		if (isset ( $_COOKIE ["staff"] ))
 			$detail = $staff->getStaffBySid ( $_COOKIE ["staff"] );
-		else 
-			$detail['sid']=0;
+		else
+			$detail ['sid'] = 0;
 		
 		$flag = false;
 		$accessModular = 'EMAIL';
@@ -73,23 +73,22 @@ class MainController extends DooController {
 		}
 		
 		if ($flag === false) {
-		$accessModular = 'INFORMATION';
-		if (empty ( $detail ['cldAccessArray'] ))
-			return '/settingEmployeeInfo';
-		else {
-			
-			if (in_array ( $accessModular, $detail ['cldAccessArray'] )) {
-				if (Doo::acl ()->isAllowed ( $accessModular, $resource, $action )) {
-					$flag = true;
+			$accessModular = 'INFORMATION';
+			if (empty ( $detail ['cldAccessArray'] ))
+				return '/settingEmployeeInfo';
+			else {
+				
+				if (in_array ( $accessModular, $detail ['cldAccessArray'] )) {
+					if (Doo::acl ()->isAllowed ( $accessModular, $resource, $action )) {
+						$flag = true;
+					} else {
+						$flag = false;
+					}
 				} else {
 					$flag = false;
 				}
-			} else {
-				$flag = false;
 			}
 		}
-		}
-		
 		
 		if ($flag === false) {
 			$accessModular = 'DIRECTORIES';
@@ -127,14 +126,12 @@ class MainController extends DooController {
 			}
 		}
 		
-		if ($detail['sid']==superHR&&!$flag)
+		if ($detail ['sid'] == superHR && ! $flag)
 			return '/settingEmployeeInfo';
-		elseif(! $flag&&$action=='logStatistics')
+		elseif (! $flag && $action == 'logStatistics')
 			return '/settingEmployeeInfo';
-		elseif(! $flag)
+		elseif (! $flag)
 			die ( 'illegal request' );
-			
-		
 	}
 	function __construct() {
 		
@@ -161,7 +158,6 @@ class MainController extends DooController {
 		}
 	}
 	
-	
 	/**
 	 * 优化actionLog表
 	 */
@@ -208,7 +204,7 @@ class MainController extends DooController {
 		$data ['login'] = "";
 		if (! empty ( $passwork ))
 			$data ['login'] = "inputErrow";
-			
+		
 		$this->render ( "/login", $data );
 	}
 	function out() {
@@ -317,7 +313,7 @@ class MainController extends DooController {
 		 */
 		
 		$staffList = $staff->find ( array (
-				'where' => ' username!="admin" ' . $staffCondition . $staffCondition.' and nature!=4 and pendStatus!=4 and pendStatus!=1 and pendStatus!=2 ',
+				'where' => ' username!="admin" ' . $staffCondition . $staffCondition . ' and nature!=4 and pendStatus!=4 and pendStatus!=1 and pendStatus!=2 ',
 				'asArray' => true 
 		) );
 		
@@ -599,7 +595,7 @@ class MainController extends DooController {
 		// echo $staffCondition;
 		// Doo::db()->beginTransaction();
 		$staffList = $staff->find ( array (
-				'where' => ' username !="admin"' . $staffCondition.' and nature!=4 and pendStatus!=4 and pendStatus!=1 and pendStatus!=2 ',
+				'where' => ' username !="admin"' . $staffCondition . ' and nature!=4 and pendStatus!=4 and pendStatus!=1 and pendStatus!=2 ',
 				'asArray' => true 
 		) );
 		
@@ -710,9 +706,8 @@ class MainController extends DooController {
 			$redisCid = '';
 		}
 		
-		//if(!empty($did))
-		//	$categoryCondition=$categoryCondition.' and departmentID='.$did;
-		
+		// if(!empty($did))
+		// $categoryCondition=$categoryCondition.' and departmentID='.$did;
 		
 		$redisKey = date ( 'Y-m-d' ) . 'SL_' . $redisCid . '_' . $redisSid;
 		$redisValue = $redis->get ( $redisKey );
@@ -990,7 +985,7 @@ class MainController extends DooController {
 		}
 		
 		$staffList = $staff->find ( array (
-				'where' => ' username!="admin"' . $staffCondition.' and nature!=4 and pendStatus!=4 and pendStatus!=1 and pendStatus!=2 ',
+				'where' => ' username!="admin"' . $staffCondition . ' and nature!=4 and pendStatus!=4 and pendStatus!=1 and pendStatus!=2 ',
 				'asArray' => true 
 		) );
 		
@@ -1448,8 +1443,7 @@ class MainController extends DooController {
 		return "/receive";
 	}
 	function addClient() {
-		
-		$companyKey =$this->get_args ( 'companyKey' ) ? $this->get_args ( 'companyKey' ) : "";
+		$companyKey = $this->get_args ( 'companyKey' ) ? $this->get_args ( 'companyKey' ) : "";
 		
 		$clientname = $this->get_args ( 'clientname' ) ? $this->get_args ( 'clientname' ) : "";
 		$gender = $this->get_args ( 'gender' ) ? $this->get_args ( 'gender' ) : "";
@@ -1481,7 +1475,7 @@ class MainController extends DooController {
 		
 		$clientname = trim ( $clientname );
 		
-		//$companyname = trim ( $companyname );
+		// $companyname = trim ( $companyname );
 		
 		if (empty ( $companyname ))
 			return "/contacts";
@@ -1514,12 +1508,13 @@ class MainController extends DooController {
 			Doo::loadModel ( 'district' );
 			$district = new district ();
 			
-			//修改
+			// 修改
 			Doo::loadClass ( 'XDeode' );
 			$XDeode = new XDeode ( 5 );
-			$comId = $XDeode->decode ( $companyKey );
+			//$comId = $XDeode->decode ( $companyKey );
+			
 			$companyInfo = $company->getOne ( array (
-					'where' => "cid = '" . $comId . "'",
+					'where' => "companyname like '" . $companyname . "'",
 					"asArray" => true 
 			) );
 			
@@ -1567,11 +1562,8 @@ class MainController extends DooController {
 				$company->stay = $stay;
 			
 			if (empty ( $companyInfo )) {
-				
 				$company->companyname = $companyname;
-				
 				$company->staffid = $this->staff [0] ['sid'];
-				
 				$cid = $company->insert ();
 			} else { // 不编辑公司,地区判断,作为新公司
 			         // $cid=$companyInfo['cid'];
@@ -1793,6 +1785,335 @@ class MainController extends DooController {
 		
 		return "/contacts";
 	}
+	function addClientByCompany() {
+		$companyKey = $this->get_args ( 'companyKey' ) ? $this->get_args ( 'companyKey' ) : "";
+		
+		$clientname = $this->get_args ( 'clientname' ) ? $this->get_args ( 'clientname' ) : "";
+		$gender = $this->get_args ( 'gender' ) ? $this->get_args ( 'gender' ) : "";
+		$nicename = $this->get_args ( 'nicename' ) ? $this->get_args ( 'nicename' ) : "";
+		$telephone = $this->get_args ( 'telephone' ) ? $this->get_args ( 'telephone' ) : "";
+		$phone = $this->get_args ( 'phone' ) ? $this->get_args ( 'phone' ) : "";
+		$email = $this->get_args ( 'email' ) ? $this->get_args ( 'email' ) : "";
+		$qq = $this->get_args ( 'qq' ) ? $this->get_args ( 'qq' ) : "";
+		$tid = $this->get_args ( 'tid' ) ? $this->get_args ( 'tid' ) : "";
+		//$companyname = $this->get_args ( 'companyname' ) ? $this->get_args ( 'companyname' ) : "";
+		
+		$local1 = $this->get_args ( 'lv21' ) ? $this->get_args ( 'lv21' ) : "";
+		$local2 = $this->get_args ( 'lv22' ) ? $this->get_args ( 'lv22' ) : "";
+		$local3 = $this->get_args ( 'lv23' ) ? $this->get_args ( 'lv23' ) : "";
+		
+		$nature = $this->get_args ( 'nature' ) ? $this->get_args ( 'nature' ) : "";
+		
+		$fax = $this->get_args ( 'fax' ) ? $this->get_args ( 'fax' ) : "";
+		$webservice = $this->get_args ( 'webservice' ) ? $this->get_args ( 'webservice' ) : "";
+		$department = $this->get_args ( 'department' ) ? $this->get_args ( 'department' ) : "";
+		$position = $this->get_args ( 'position' ) ? $this->get_args ( 'position' ) : "";
+		$office = $this->get_args ( 'office' ) ? $this->get_args ( 'office' ) : "";
+		$address = $this->get_args ( 'address' ) ? $this->get_args ( 'address' ) : "";
+		$ride = $this->get_args ( 'ride' ) ? $this->get_args ( 'ride' ) : "";
+		$landmarks = $this->get_args ( 'landmarks' ) ? $this->get_args ( 'landmarks' ) : "";
+		$priority = $this->get_args ( 'priority' ) ? $this->get_args ( 'priority' ) : "";
+		$stay = $this->get_args ( 'stay' ) ? $this->get_args ( 'stay' ) : "";
+		$mark = $this->get_args ( 'mark' ) ? $this->get_args ( 'mark' ) : "";
+		
+		$clientname = trim ( $clientname );
+		
+		if (empty ( $this->staff [0] ['sid'] ))
+			return "/contacts";
+		
+		if (! empty ( $clientname )) {
+			
+			// 相同的公司和客户
+			Doo::loadModel ( 'company' );
+			$company = new company ();
+			Doo::loadModel ( 'client' );
+			$client = new client ();
+			
+			$redis = new Redis ();
+			$redis->connect ( '127.0.0.1', '6379' );
+			
+			$cinfo = $client->getClientByNameT ( $clientname );
+			
+			
+			Doo::loadModel ( 'district' );
+			$district = new district ();
+			
+			// 修改
+			Doo::loadClass ( 'XDeode' );
+			$XDeode = new XDeode ( 5 );
+			$comId = $XDeode->decode ( $companyKey );
+			$companyInfo = $company->getOne ( array (
+					'where' => "cid = '" . $comId . "'",
+					"asArray" => true 
+			) );
+			
+			// 更新公司信息
+			$lv1 = $district->getbyid ( $local1 );
+			$lv2 = $district->getbyid ( $local2 );
+			$lv3 = $district->getbyid ( $local3 );
+			
+			if (empty ( $lv1 ))
+				$lv1 [0] ['name'] = "";
+			
+			if (empty ( $lv2 ))
+				$lv2 [0] ['name'] = "";
+			if (empty ( $lv3 ))
+				$lv3 [0] ['name'] = "";
+			
+// 			if (! empty ( $local1 ) && ! empty ( $local2 ))
+// 				$company->local = $lv1 [0] ['name'] . "," . $lv2 [0] ['name'] . "," . $lv3 [0] ['name'];
+			
+// 			if (! empty ( $nature ))
+// 				$company->nature = implode ( ',', $nature );
+			
+// 			if (! empty ( $fax ))
+// 				$company->fax = $fax;
+			
+// 			if (! empty ( $webservice ))
+// 				$company->webservice = $webservice;
+			
+// 			if (! empty ( $address ))
+// 				$company->address = $address;
+			
+// 			if (! empty ( $ride ))
+// 				$company->ride = $ride;
+			
+// 			if (! empty ( $landmarks ))
+// 				$company->landmarks = $landmarks;
+			
+// 			if (! empty ( $office ))
+// 				$company->office = $office;
+			
+// 			if (! empty ( $local1 ) && ! empty ( $local2 ))
+// 				$company->district = $local1 . "," . $local2 . "," . $local3;
+			
+// 			if (! empty ( $stay ))
+// 				$company->stay = $stay;
+			
+				
+			$cid = $companyInfo ['cid'];
+			if (empty ( $companyInfo )) {
+				
+			} else { // 不编辑公司,地区判断,作为新公司
+			         // $cid=$companyInfo['cid'];
+			         //
+			         // $companyname=$companyInfo['companyname'];
+			         //
+			         // $company->cid=$cid;
+			         //
+			         // $company->update();
+// 				$diqu = $local1 . "," . $local2 . "," . $local3;
+// 				$cid = $companyInfo ['cid'];
+// 				$company2 = new company ();
+// 				$companyList = $company2->find ( array (
+// 						'where' => " companyname like '" . $companyname . "'",
+// 						"asArray" => true 
+// 				) );
+				
+// 				$falg = false;
+// 				// print_r($companyList);
+// 				foreach ( $companyList as $key => $value ) {
+// 					if ($value ['district'] != $diqu) {
+// 						$falg = true;
+// 					} elseif ($value ['district'] == $diqu) {
+// 						$falg = false;
+// 						$cid = $value ['cid'];
+// 						break;
+// 					}
+// 				}
+				
+// 				if ($falg) {
+// 					$company->companyname = $companyname;
+// 					$company->staffid = $this->staff [0] ['sid'];
+// 					$cid = $company->insert ();
+// 				}
+			}
+			
+			Doo::loadModel ( 'client_staff' );
+			$client_staff = new client_staff ();
+			
+			$client->clientname = $clientname;
+			$client->gender = $gender;
+			$client->priority = $priority;
+			
+			if (! empty ( $nicename ))
+				$client->nicename = $nicename;
+			if (! empty ( $telephone ))
+				$client->telephone = $telephone;
+			if (! empty ( $phone ))
+				$client->phone = $phone;
+			if (! empty ( $email ))
+				$client->email = $email;
+			if (! empty ( $qq ) && is_numeric ( $qq ))
+				$client->qq = $qq;
+			
+			$client->companyid = $cid;
+			$client->companyname = $companyInfo['companyname'];
+			$client->district = $local1 . "," . $local2 . "," . $local3;
+			// echo $client->district;
+			// die;
+			
+			if (! empty ( $tid ))
+				$client->tag = implode ( ',', $tid );
+			
+			if (! empty ( $fax ))
+				$client->fax = $fax;
+			
+			if (! empty ( $webservice ))
+				$client->webservice = $webservice;
+			
+			if (! empty ( $department ))
+				$client->department = $department;
+			
+			if (! empty ( $position ))
+				$client->position = $position;
+			
+			if (! empty ( $office ))
+				$client->office = $office;
+			
+			if (! empty ( $address ))
+				$client->address = $address;
+			
+			if (! empty ( $ride ))
+				$client->ride = $ride;
+			
+			if (! empty ( $landmarks ))
+				$client->landmarks = $landmarks;
+			
+			if (! empty ( $stay ))
+				$client->stay = $stay;
+			
+			if (! empty ( $mark ))
+				$client->mark = $mark;
+			
+			$id = $client->insert ();
+			
+			$client_staff->cid = $id;
+			$client_staff->sid = $this->staff [0] ['sid'];
+			$client_staff->insert ();
+			
+			// 加入地区记录
+			Doo::loadModel ( "district_staff" );
+			$district_staff = new district_staff ();
+			$district_staff->did = $lv1 [0] ['id'];
+			$district_staff->sid = $this->staff [0] ['sid'];
+			$district_staff->insert ();
+			
+			// 日常行为
+			Doo::loadModel ( "action_log" );
+			$action_log = new action_log ();
+			
+			$action_log->action = $this->staff [0] ['category'] . '<b href="javascript:void(0)" onclick="showStaff(\'' . $this->staff [0] ['sid'] . '\')" >' . $this->staff [0] ['username'] . '</b>添加了<a href="javascript:void(0)" onclick="showClick(\'' . $id . '\')">' . $clientname . '</a>(' . $companyInfo['companyname'] . ')';
+			$action_log->sid = $this->staff [0] ['sid'];
+			$action_log->cid = $this->staff [0] ['cid'];
+			$action_log->updatetime = date ( "Y-m-d" );
+			$action_log->time = date ( "H:i" );
+			$action_log->status = 1;
+			$action_log->districtid = $local1 . "," . $local2 . "," . $local3;
+			$action_log->city = $lv1 [0] ['name'];
+			$action_log->province = $lv2 [0] ['name'];
+			if (isset ( $nature [0] ))
+				$action_log->nature = $nature [0];
+			$action_log->company = $companyInfo['companyname'];
+			$action_log->class = $action_log->iconContacts;
+			$action_log->insert ();
+			
+			// 事实更新信息中心记录数量 需要更新3个redis 内的值
+			$categoryCondition = " and cid=" . $this->staff [0] ['cid'];
+			$sidCondition = " and sid=" . $this->staff [0] ['sid'];
+			
+			// actionlog免查询值 $alCondition='';
+			$alCondition = ' aid>' . REMIT . ' and ';
+			
+			// 个人添加数量redis值
+			$redisKeyCS = date ( 'Y-m-d' ) . 'SC_' . $this->staff [0] ['cid'] . '_' . $this->staff [0] ['sid'];
+			$action_log = new action_log ();
+			$actionLogClient = $action_log->find ( array (
+					'select' => 'date_format(updatetime,"%m-%d") as updatetime,COUNT(*) as count',
+					'where' => $alCondition . " status=1" . $sidCondition . $categoryCondition . ' and date_sub(curdate(), INTERVAL 30 DAY) <= date(updatetime)',
+					'groupby' => 'date_format(updatetime,"%m-%d")',
+					'asArray' => true 
+			) );
+			
+			$statisticsClient = array ();
+			for($d = 0; $d <= 29; $d ++) {
+				$MD = date ( "m-d", strtotime ( "-" . $d . " day" ) );
+				$falgClient = true;
+				
+				foreach ( $actionLogClient as $value ) {
+					if ($value ['updatetime'] == $MD) {
+						array_push ( $statisticsClient, $value ['count'] );
+						$falgClient = false;
+						break;
+					}
+				}
+				if ($falgClient)
+					array_push ( $statisticsClient, 0 );
+			}
+			$statisticsClient = array_reverse ( $statisticsClient );
+			$jsc = json_encode ( $statisticsClient );
+			$redis->set ( $redisKeyCS, $jsc );
+			
+			// 办事处添加数量reids值
+			$redisKeyC = date ( 'Y-m-d' ) . 'SC_' . $this->staff [0] ['cid'] . '_';
+			$action_log = new action_log ();
+			$actionLogClient = $action_log->find ( array (
+					'select' => 'date_format(updatetime,"%m-%d") as updatetime,COUNT(*) as count',
+					'where' => $alCondition . " status=1" . $categoryCondition . ' and date_sub(curdate(), INTERVAL 30 DAY) <= date(updatetime)',
+					'groupby' => 'date_format(updatetime,"%m-%d")',
+					'asArray' => true 
+			) );
+			
+			$statisticsClient = array ();
+			for($d = 0; $d <= 29; $d ++) {
+				$MD = date ( "m-d", strtotime ( "-" . $d . " day" ) );
+				$falgClient = true;
+				
+				foreach ( $actionLogClient as $value ) {
+					if ($value ['updatetime'] == $MD) {
+						array_push ( $statisticsClient, $value ['count'] );
+						$falgClient = false;
+						break;
+					}
+				}
+				if ($falgClient)
+					array_push ( $statisticsClient, 0 );
+			}
+			$statisticsClient = array_reverse ( $statisticsClient );
+			$jsc = json_encode ( $statisticsClient );
+			$redis->set ( $redisKeyC, $jsc );
+			
+			// 全员添加数量的redis值
+			$redisKey = date ( 'Y-m-d' ) . 'SC__';
+			$action_log = new action_log ();
+			$actionLogClient = $action_log->find ( array (
+					'select' => 'date_format(updatetime,"%m-%d") as updatetime,COUNT(*) as count',
+					'where' => $alCondition . ' status=1  and date_sub(curdate(), INTERVAL 30 DAY) <= date(updatetime)',
+					'groupby' => 'date_format(updatetime,"%m-%d")',
+					'asArray' => true 
+			) );
+			$statisticsClient = array ();
+			for($d = 0; $d <= 29; $d ++) {
+				$MD = date ( "m-d", strtotime ( "-" . $d . " day" ) );
+				$falgClient = true;
+				
+				foreach ( $actionLogClient as $value ) {
+					if ($value ['updatetime'] == $MD) {
+						array_push ( $statisticsClient, $value ['count'] );
+						$falgClient = false;
+						break;
+					}
+				}
+				if ($falgClient)
+					array_push ( $statisticsClient, 0 );
+			}
+			$statisticsClient = array_reverse ( $statisticsClient );
+			$jsc = json_encode ( $statisticsClient );
+			$redis->set ( $redisKey, $jsc );
+		}
+		
+		return "/contacts";
+	}
 	function mycompany() {
 		$search = $this->get_args ( 'search' ) ? $this->get_args ( 'search' ) : "";
 		$districtLv = $this->get_args ( 'districtLv' ) ? $this->get_args ( 'districtLv' ) : 0;
@@ -2467,7 +2788,7 @@ class MainController extends DooController {
 		if (! empty ( $cid ))
 			$data ['staffList'] = $staff->getStaffByCid ( $cid );
 		else
-			$data ['staffList'] = $staff->getStaff (true);
+			$data ['staffList'] = $staff->getStaff ( true );
 		
 		foreach ( $data ['staffList'] as $key => $value ) {
 			if (! empty ( $value ['birthday'] )) {
@@ -3548,32 +3869,29 @@ class MainController extends DooController {
 			Doo::loadClass ( 'XDeode' );
 			$XDeode = new XDeode ( 5 );
 			
-			
 			$districtInfo = $district->get_lv ( 1 );
 			
-			$companyInfo = $client->getClientByCompanyId ( $cid );
-			
-			$companyInfo = $companyInfo [0];
+// 			$companyInfo = $client->getClientByCompanyId ( $cid );
+// 			$companyInfo = $companyInfo [0];
 			
-			$cInfo = $company->getOne ( array (
+			$companyInfo = $company->getOne ( array (
 					'where' => "cid = " . $cid,
 					'asArray' => TRUE 
 			) );
 			
-			$companyInfo ['companyKey'] = $XDeode->encode( $cInfo['cid'] );
+			$companyInfo ['companyKey'] = $XDeode->encode ( $companyInfo ['cid'] );
 			
-			$companyInfo ['address'] = $cInfo ['address'];
+// 			$companyInfo ['companyname'] = $cInfo ['companyname'];
+// 			$companyInfo ['address'] = $cInfo ['address'];
 			
-			$companyInfo ['ride'] = $cInfo ['ride'];
-			$companyInfo ['landmarks'] = $cInfo ['landmarks'];
-			$companyInfo ['stay'] = $cInfo ['stay'];
+// 			$companyInfo ['ride'] = $cInfo ['ride'];
+// 			$companyInfo ['landmarks'] = $cInfo ['landmarks'];
+// 			$companyInfo ['stay'] = $cInfo ['stay'];
 			
-			$artld = explode ( ',', $cInfo ['local'] );
-			
-			$districtid = explode ( ',', $cInfo ['district'] );
+			$artld = explode ( ',', $companyInfo ['local'] );
+			$districtid = explode ( ',', $companyInfo ['district'] );
 			
 			$html = "";
-			
 			$html .= '<select  name="lv21" id="lv31" onchange="dislv(\'lv31\',\'32\');"><option value="' . $districtid [0] . '">' . $artld [0] . '</option>';
 			
 			// foreach ($districtInfo as $key=>$value){
@@ -3595,9 +3913,7 @@ class MainController extends DooController {
 	  					</span>';
 			
 			$companyInfo ['dishtml'] = $html;
-			
 			$companyInfo ['natureAr'] = $this->nature;
-			
 			$companyInfo ['natureArlenght'] = 12;
 			
 			echo json_encode ( array (
@@ -5588,65 +5904,65 @@ class MainController extends DooController {
 	/**
 	 * 微信通知设置
 	 */
-// 	function notificationConf() {
-// 		Doo::loadModel ( "notificationConf" );
-// 		$notificationConf = new notificationConf ();
-		
-// 		$detail = $notificationConf->getNotificationConfBySid ( $this->staff [0] ['sid'] );
-		
-// 		$rule = json_decode ( $detail ['conf'], true );
-		
-// 		$data ['rule'] = $rule;
-// 		$data ['memu'] = "notificationConf";
-// 		$data ['staff'] = $this->staff;
-		
-// 		$this->render ( "/admin/invoiceNotificationConf", $data );
-// 	}
-// 	function ajaxSetNotificationConf() {
-// 		$notificationType = $this->get_args ( 'notificationType' ) ? $this->get_args ( 'notificationType' ) : "";
-// 		$notificationValue = $this->get_args ( 'notificationValue' ) ? $this->get_args ( 'notificationValue' ) : '';
-		
-// 		if (! empty ( $notificationType ) && ! empty ( $notificationValue ) && ! empty ( $this->staff [0] ['sid'] )) {
-// 			Doo::loadModel ( "notificationConf" );
-// 			$notificationConf = new notificationConf ();
-			
-// 			$detail = $notificationConf->getNotificationConfBySid ( $this->staff [0] ['sid'] );
-			
-// 			if (empty ( $detail )) {
-// 				$rule = array (
-// 						$notificationType => $notificationValue 
-// 				);
-// 				$rule = json_encode ( $rule );
-// 				$item = array (
-// 						'sid' => $this->staff [0] ['sid'],
-// 						'conf' => $rule 
-// 				);
-				
-// 				$notificationConf->addNotification ( $item );
-// 			} else {
-// 				$rule = json_decode ( $detail ['conf'], true );
-// 				$rule [$notificationType] = $notificationValue;
-// 				$rule = json_encode ( $rule );
-// 				$item = array (
-// 						'nid' => $detail ['nid'],
-// 						'conf' => $rule 
-// 				);
-// 				$notificationConf->setNotificationByCondition ( $item );
-// 			}
-// 			echo json_encode ( array (
-// 					'status' => 1,
-// 					'msgType' => $notificationType,
-// 					'msg' => '' 
-// 			) );
-// 			die ();
-// 		}
-// 		echo json_encode ( array (
-// 				'status' => 2,
-// 				'msgType' => $notificationType,
-// 				'msg' => 'illegal request' 
-// 		) );
-// 		die ();
-// 	}
+	// function notificationConf() {
+	// Doo::loadModel ( "notificationConf" );
+	// $notificationConf = new notificationConf ();
+	
+	// $detail = $notificationConf->getNotificationConfBySid ( $this->staff [0] ['sid'] );
+	
+	// $rule = json_decode ( $detail ['conf'], true );
+	
+	// $data ['rule'] = $rule;
+	// $data ['memu'] = "notificationConf";
+	// $data ['staff'] = $this->staff;
+	
+	// $this->render ( "/admin/invoiceNotificationConf", $data );
+	// }
+	// function ajaxSetNotificationConf() {
+	// $notificationType = $this->get_args ( 'notificationType' ) ? $this->get_args ( 'notificationType' ) : "";
+	// $notificationValue = $this->get_args ( 'notificationValue' ) ? $this->get_args ( 'notificationValue' ) : '';
+	
+	// if (! empty ( $notificationType ) && ! empty ( $notificationValue ) && ! empty ( $this->staff [0] ['sid'] )) {
+	// Doo::loadModel ( "notificationConf" );
+	// $notificationConf = new notificationConf ();
+	
+	// $detail = $notificationConf->getNotificationConfBySid ( $this->staff [0] ['sid'] );
+	
+	// if (empty ( $detail )) {
+	// $rule = array (
+	// $notificationType => $notificationValue
+	// );
+	// $rule = json_encode ( $rule );
+	// $item = array (
+	// 'sid' => $this->staff [0] ['sid'],
+	// 'conf' => $rule
+	// );
+	
+	// $notificationConf->addNotification ( $item );
+	// } else {
+	// $rule = json_decode ( $detail ['conf'], true );
+	// $rule [$notificationType] = $notificationValue;
+	// $rule = json_encode ( $rule );
+	// $item = array (
+	// 'nid' => $detail ['nid'],
+	// 'conf' => $rule
+	// );
+	// $notificationConf->setNotificationByCondition ( $item );
+	// }
+	// echo json_encode ( array (
+	// 'status' => 1,
+	// 'msgType' => $notificationType,
+	// 'msg' => ''
+	// ) );
+	// die ();
+	// }
+	// echo json_encode ( array (
+	// 'status' => 2,
+	// 'msgType' => $notificationType,
+	// 'msg' => 'illegal request'
+	// ) );
+	// die ();
+	// }
 	function eMailTask() {
 		Doo::loadModel ( 'tag' );
 		$tag = new tag ();
@@ -6329,7 +6645,7 @@ class MainController extends DooController {
 			$annexEXT = $this->_GetFileEXT ( $_FILES ["annex"] ["name"] );
 			$annexName = "";
 			if (isset ( $_FILES ['annex'] ['name'] )) {
-				if ((($annexEXT == "doc")|| ($annexEXT == "docx")  || ($annexEXT == "xls") || ($annexEXT == "pdf") || ($annexEXT == "ppt") || ($annexEXT == "txt") || ($annexEXT == "smr") || ($annexEXT == "spu") || ($annexEXT == "zip") || ($annexEXT == "rar") || ($annexEXT == "jpg") || ($annexEXT == "png")) && ($_FILES ["annex"] ["size"] < 10485760)) {
+				if ((($annexEXT == "doc") || ($annexEXT == "docx") || ($annexEXT == "xls") || ($annexEXT == "pdf") || ($annexEXT == "ppt") || ($annexEXT == "txt") || ($annexEXT == "smr") || ($annexEXT == "spu") || ($annexEXT == "zip") || ($annexEXT == "rar") || ($annexEXT == "jpg") || ($annexEXT == "png")) && ($_FILES ["annex"] ["size"] < 10485760)) {
 					$path = DOO::conf ()->SITE_PATH . "upload/emailAnnex/";
 					if (! file_exists ( $path . $_FILES ["annex"] ["name"] )) {
 						$fileName = time () . "." . $annexEXT;

+ 301 - 157
protected/controller/ReceiptController.php

@@ -2225,7 +2225,7 @@ class ReceiptController extends DooController {
 		$receiptTraining = new receiptTraining ();
 		
 		$receiptDetail = $receipt->getReceiptByRid ( $rid );
-		if ($receiptDetail ['status'] != 5)
+		if (! ($receiptDetail ['status'] == 5 || $receiptDetail ['status'] == 4))
 			die ();
 		
 		$receiptTrainingDetail = $receiptTraining->getReceiptTrainingByRtid ( $receiptDetail ['trainId'] );
@@ -2234,17 +2234,23 @@ class ReceiptController extends DooController {
 		// 收入合计
 		Doo::loadModel ( 'invoiceTraining' );
 		$invoiceTraining = new invoiceTraining ();
-		$invoiceTrainingDetail=array('invoiceArriveAmount'=>0,'RIAmount'=>0,'invoiceTotalAmount'=>0);
-		if ($receiptDetail ['invoiceTrainId']!=0){
-		$invoiceTrainingDetail = $invoiceTraining->getInvoiceTrainingByItid ( $receiptDetail ['invoiceTrainId'] );
+		$invoiceTrainingDetail = array (
+				'invoiceArriveAmount' => 0,
+				'RIAmount' => 0,
+				'invoiceTotalAmount' => 0 ,
+				'invoiceCompanyAmount'=>0
+		);
+		if ($receiptDetail ['invoiceTrainId'] != 0) {
+			$invoiceTrainingDetail = $invoiceTraining->getInvoiceTrainingByItid ( $receiptDetail ['invoiceTrainId'] );
 		}
 		// print_r($invoiceTrainingDetail);
-		$invoiceArriveAmount=$RIAmount=0;
-		if(!empty($invoiceTrainingDetail)){
-			$invoiceArriveAmount=$invoiceTrainingDetail ['invoiceArriveAmount'];
-			$RIAmount=$invoiceTrainingDetail ['RIAmount'];
+		$invoiceArriveAmount = $RIAmount = 0;
+		if (! empty ( $invoiceTrainingDetail )) {
+			$invoiceArriveAmount = $invoiceTrainingDetail ['invoiceArriveAmount'];
+			$RIAmount = $invoiceTrainingDetail ['RIAmount'];
 		}
 		$data ['invoiceTrainingDetail'] = $invoiceTrainingDetail;
+		//print_r($invoiceTrainingDetail);
 		// 支出项目
 		Doo::loadModel ( 'accountItem' );
 		$accountItem = new accountItem ();
@@ -2259,7 +2265,7 @@ class ReceiptController extends DooController {
 		$RILecturerList = $RILecturer->getRILecturerByRid ( $rid );
 		// 支出项金额详情
 		$aiData = $accountItem->getTrainingDetail ( $RItemList, $RILecturerList, $invoiceArriveAmount );
-		//print_r($aiData);
+		// print_r($aiData);
 		
 		// 利润
 		$data ['profit'] = $invoiceArriveAmount - $aiData ['total'];
@@ -2268,10 +2274,13 @@ class ReceiptController extends DooController {
 		// print_r($aiData['dataList']);
 		$data ['categoryActualExpenditure'] = $aiData ['total'] - $aiData ['categoryActualExpenditure'];
 		// 备用金
-		$sum=0;$data ['receiptLoanDetail']=array('sum'=>0);
-		if (!empty($receiptDetail ['trainLoanRid'])){
-		$data ['receiptLoanDetail'] = $receipt->getReceiptByRid ( $receiptDetail ['trainLoanRid'] );
-		$sum=$data ['receiptLoanDetail'] ['sum'];
+		$sum = 0;
+		$data ['receiptLoanDetail'] = array (
+				'sum' => 0 
+		);
+		if (! empty ( $receiptDetail ['trainLoanRid'] )) {
+			$data ['receiptLoanDetail'] = $receipt->getReceiptByRid ( $receiptDetail ['trainLoanRid'] );
+			$sum = $data ['receiptLoanDetail'] ['sum'];
 		}
 		$data ['payment'] = $sum + $RIAmount - $data ['categoryActualExpenditure'];
 		
@@ -2280,22 +2289,20 @@ class ReceiptController extends DooController {
 		$data ['aiList'] = $aiData ['dataList'];
 		
 		// 占比计算
-		if($invoiceArriveAmount!=0){
-			$data ['totalProportion'] = number_format ( $aiData ['total'] / $invoiceArriveAmount, 2, '.', '' ) * 100;
-			$data ['profitProportion'] = number_format ( $data ['profit'] / $invoiceArriveAmount, 2, '.', '' ) * 100;
-			$data ['sumProportion'] = number_format ( $sum / $invoiceArriveAmount, 2, '.', '' ) * 100;
-			$data ['invoiceTotalAmountProportion'] = number_format ( $data ['invoiceTrainingDetail'] ['invoiceTotalAmount'] / $invoiceArriveAmount, 2, '.', '' ) * 100;
-			$data ['RIAmountProportion'] = number_format ( $data ['invoiceTrainingDetail'] ['RIAmount'] / $invoiceArriveAmount, 2, '.', '' ) * 100;
-			$data ['companyProfitProportion'] = number_format ( $data ['companyProfit'] / $invoiceArriveAmount, 2, '.', '' ) * 100;
-			$data ['categoryProportion'] = number_format ( $data ['categoryProfit'] / $invoiceArriveAmount, 2, '.', '' ) * 100;
-			$data ['categoryActualExpenditureProportion'] = number_format ( $data ['categoryActualExpenditure'] / $invoiceArriveAmount, 2, '.', '' ) * 100;
-			$data ['paymentProportion'] = number_format ( $data ['payment'] / $invoiceArriveAmount, 2, '.', '' ) * 100;
-		}else{
-			$data ['totalProportion'] =$data ['profitProportion'] = $data ['sumProportion'] = $data ['invoiceTotalAmountProportion'] = $data ['RIAmountProportion'] 
-			= $data ['companyProfitProportion'] = $data ['categoryActualExpenditureProportion'] = $data ['paymentProportion']=$data ['categoryProportion'] = 0;
+		if ($invoiceArriveAmount != 0) {
+			$data ['totalProportion'] = number_format ( $aiData ['total'] / $invoiceArriveAmount, 4, '.', '' ) * 100;
+			$data ['profitProportion'] = number_format ( $data ['profit'] / $invoiceArriveAmount, 4, '.', '' ) * 100;
+			$data ['sumProportion'] = number_format ( $sum / $invoiceArriveAmount, 4, '.', '' ) * 100;
+			$data ['invoiceTotalAmountProportion'] = number_format ( $data ['invoiceTrainingDetail'] ['invoiceCompanyAmount'] / $invoiceArriveAmount, 4, '.', '' ) * 100;
+			$data ['RIAmountProportion'] = number_format ( $data ['invoiceTrainingDetail'] ['RIAmount'] / $invoiceArriveAmount, 4, '.', '' ) * 100;
+			$data ['companyProfitProportion'] = number_format ( $data ['companyProfit'] / $invoiceArriveAmount, 4, '.', '' ) * 100;
+			$data ['categoryProportion'] = number_format ( $data ['categoryProfit'] / $invoiceArriveAmount, 4, '.', '' ) * 100;
+			$data ['categoryActualExpenditureProportion'] = number_format ( $data ['categoryActualExpenditure'] / $invoiceArriveAmount, 4, '.', '' ) * 100;
+			$data ['paymentProportion'] = number_format ( $data ['payment'] / $invoiceArriveAmount, 4, '.', '' ) * 100;
+		} else {
+			$data ['totalProportion'] = $data ['profitProportion'] = $data ['sumProportion'] = $data ['invoiceTotalAmountProportion'] = $data ['RIAmountProportion'] = $data ['companyProfitProportion'] = $data ['categoryActualExpenditureProportion'] = $data ['paymentProportion'] = $data ['categoryProportion'] = 0;
 		}
 		
-		
 		// 审批组
 		Doo::loadModel ( 'verify' );
 		$verify = new verify ();
@@ -2343,7 +2350,7 @@ class ReceiptController extends DooController {
 		$verify = new verify ();
 		
 		$receiptDetail = $receipt->getReceiptByRid ( $rid );
-		if ($receiptDetail ['status'] != 5)
+		if (! ($receiptDetail ['status'] == 5 || $receiptDetail ['status'] == 4))
 			die ();
 		
 		$receiptTrainingDetail = $receiptTraining->getReceiptTrainingByRtid ( $receiptDetail ['trainId'] );
@@ -2469,8 +2476,8 @@ class ReceiptController extends DooController {
 			
 			$receiptDetail = $receipt->getReceiptByRid ( $rid );
 			$receiptLoanDetail = $receipt->getReceiptByRid ( $ridLoan );
-			// 不合法的数据
-			if ($receiptDetail ['status'] != 5 || $receiptDetail ['Rtype'] != 3) {
+			// 不合法的数据if (!($receiptDetail ['status'] == 5||$receiptDetail ['status'] == 4))
+			if ((! ($receiptDetail ['status'] == 5 || $receiptDetail ['status'] == 4)) || $receiptDetail ['Rtype'] != 3) {
 				die ( 'illegal request-receiptError' );
 			}
 			if ($receiptLoanDetail ['status'] != 8 || $receiptLoanDetail ['Rtype'] != 1) {
@@ -2519,8 +2526,8 @@ class ReceiptController extends DooController {
 			
 			$receiptDetail = $receipt->getReceiptByRid ( $rid );
 			$receiptLoanDetail = $receipt->getReceiptByRid ( $ridLoan );
-			// 不合法的数据
-			if ($receiptDetail ['status'] != 5 || $receiptDetail ['Rtype'] != 3) {
+			// 不合法的数据 !($receiptDetail ['status'] == 5||$receiptDetail ['status'] == 4)
+			if ((! ($receiptDetail ['status'] == 5 || $receiptDetail ['status'] == 4)) || $receiptDetail ['Rtype'] != 3) {
 				die ( 'illegal request-receiptError' );
 			}
 			if ($receiptLoanDetail ['status'] != 10 || $receiptLoanDetail ['Rtype'] != 1) {
@@ -2570,7 +2577,7 @@ class ReceiptController extends DooController {
 		$invoiceTraining = new invoiceTraining ();
 		
 		$receiptDetail = $receipt->getReceiptByRid ( $rid );
-		if ($receiptDetail ['status'] != 5)
+		if (! ($receiptDetail ['status'] == 5 || $receiptDetail ['status'] == 4))
 			die ();
 		$receiptTrainingDetail = $receiptTraining->getReceiptTrainingByRtid ( $receiptDetail ['trainId'] );
 		
@@ -2619,10 +2626,10 @@ class ReceiptController extends DooController {
 			$receiptDetail = $receipt->getReceiptByRid ( $rid );
 			$invoiceTrainDetail = $invoiceTraining->getInvoiceTrainingByItid ( $itid );
 			// 不合法的数据
-			if ($receiptDetail ['status'] != 5 || $receiptDetail ['Rtype'] != 3) {
+			if ((! ($receiptDetail ['status'] == 5 || $receiptDetail ['status'] == 4)) || $receiptDetail ['Rtype'] != 3) {
 				die ( 'illegal request-receiptError' );
 			}
-			if (empty ( $invoiceTrainDetail )) {
+			if (empty ( $invoiceTrainDetail ) || $invoiceTrainDetail ['bindReceipt'] == 1) {
 				die ( 'illegal request-receipLoantError' );
 			}
 			// 培训班结算挂钩借款
@@ -2633,6 +2640,17 @@ class ReceiptController extends DooController {
 			);
 			$receipt->setReceiptByCondition ( $item );
 			
+			$invoiceTraining = new invoiceTraining ();
+			$item = array (
+					'bindReceipt' => 1,
+					'itid' => $itid 
+			);
+			$invoiceTraining->setInvoiceTrainByCondition ( $item );
+			
+			
+			
+			
+			
 			$XDeode = new XDeode ( 7 );
 			return "/receiptTrainInvoiceEdi/" . $XDeode->encode ( $rid ) . ".html";
 		} else
@@ -2695,14 +2713,23 @@ class ReceiptController extends DooController {
 		
 		if (is_numeric ( $rid ) && is_numeric ( $itid )) {
 			$receiptDetail = $receipt->getReceiptByRid ( $rid );
-			if ($receiptDetail ['status'] != 5)
+			if (!($receiptDetail ['status'] == 5||$receiptDetail ['status'] == 4)){
 				die ( 'illegal request-status' );
+			}
 			
 			$receipt = new receipt ();
 			$receipt->rid = $rid;
 			$receipt->invoiceTrainId = 0;
 			$receipt->update ();
 			
+			Doo::loadModel ( 'invoiceTraining' );
+			$invoiceTraining = new invoiceTraining ();
+			$item = array (
+					'bindReceipt' => 0,
+					'itid' => $itid 
+			);
+			$invoiceTraining->setInvoiceTrainByCondition ( $item );
+			
 			$RIExtend->delete ( array (
 					'where' => 'rid=' . $rid 
 			) );
@@ -2735,14 +2762,19 @@ class ReceiptController extends DooController {
 		$accountItem = new accountItem ();
 		
 		$receiptDetail = $receipt->getReceiptByRid ( $rid );
-		if ($receiptDetail ['status'] != 5)
+		if (!($receiptDetail ['status'] == 5||$receiptDetail ['status'] == 4))
 			die ();
 		$receiptTrainingDetail = $receiptTraining->getReceiptTrainingByRtid ( $receiptDetail ['trainId'] );
 		
 		$RItemList = $RItem->getRItemByRid ( $rid );
 		$aiList = $accountItem->getAccountBookByCategory ( '培训班费用' );
+// 		foreach ($aiList as $key=>$value){//不需要添加税款,在添加收入时自动添加
+// 			if($value['name']=='税款'){
+// 				unset($aiList[$key]);break;
+// 			}
+// 		}
 		
-		// print_r($RItemList);
+		//print_r($aiList);
 		$data ['RItemList'] = $RItemList;
 		$data ['aiList'] = $aiList;
 		
@@ -2761,7 +2793,7 @@ class ReceiptController extends DooController {
 	}
 	
 	/**
-	 * 添加支出项
+	 * 添加支出项  需要修改 费用金额合计
 	 */
 	function receiptTrainItemAddDo() {
 		$ridKey = $this->get_args ( 'ridKey' ) ? $this->get_args ( 'ridKey' ) : "";
@@ -2773,6 +2805,8 @@ class ReceiptController extends DooController {
 		$inputer = $this->get_args ( 'inputer' ) ? $this->get_args ( 'inputer' ) : "";
 		$describe = $this->get_args ( 'describe' ) ? $this->get_args ( 'describe' ) : "";
 		
+		$payType = isset ( $this->params ['payType'] ) ? $this->params ['payType'] : '';
+		
 		if (! empty ( $ridKey ) && ! empty ( $item ) && ! empty ( $price ) && ! empty ( $date ) && ! empty ( $inputer )) {
 			Doo::loadClass ( 'XDeode' );
 			$XDeode = new XDeode ( 5 );
@@ -2783,6 +2817,9 @@ class ReceiptController extends DooController {
 			if (! is_numeric ( $rid ))
 				die ( 'illegal request' );
 			
+			if($payType=='company'){
+				$RItem->payType = 1;
+			}	
 			$RItem->rid = $rid;
 			$RItem->item = $item;
 			
@@ -2821,9 +2858,19 @@ class ReceiptController extends DooController {
 						'where' => 'rid=' . $rid . ' and item like "' . $item . '" and itemCategory like "培训班费用"' 
 				) );
 			}
+			//更新费用合计金额
+			$receipt = new receipt ();
+			$receipt->sum=$rInfo['sum']+number_format ( $price, 2, '.', '' );
+			$receipt->update ( array (
+					'where' => 'rid=' . $rid 
+			) );
 			
 			$XDeode = new XDeode ( 7 );
-			return '/receiptTrainItemEdi/' . $XDeode->encode ( $rid ) . '.html';
+			if($payType=='company'){
+				return '/receiptTrainItem/approval/' . $XDeode->encode ( $rid ) . '.html';
+			}else{
+				return '/receiptTrainItemEdi/' . $XDeode->encode ( $rid ) . '.html';
+			}
 		} else
 			die ( 'illegal request' );
 	}
@@ -2852,7 +2899,7 @@ class ReceiptController extends DooController {
 		$lecturer = new lecturer ();
 		
 		$receiptDetail = $receipt->getReceiptByRid ( $rid );
-		if ($receiptDetail ['status'] != 5)
+		if (!($receiptDetail ['status'] == 5||$receiptDetail ['status'] == 4))
 			die ();
 		$receiptTrainingDetail = $receiptTraining->getReceiptTrainingByRtid ( $receiptDetail ['trainId'] );
 		
@@ -2983,7 +3030,7 @@ class ReceiptController extends DooController {
 		
 		if (is_numeric ( $rid ) && is_numeric ( $rlid )) {
 			$receiptDetail = $receipt->getReceiptByRid ( $rid );
-			if ($receiptDetail ['status'] != 5)
+			if (!($receiptDetail ['status'] == 5||$receiptDetail ['status'] == 4))
 				die ( 'illegal request-status' );
 			
 			$RILecturer->delete ( array (
@@ -2998,8 +3045,8 @@ class ReceiptController extends DooController {
 	/**
 	 * 培训班提交审批
 	 */
-	function receiptTrainApprovalDo() {
-		$ridKey = $this->get_args ( 'ridKey' ) ? $this->get_args ( 'ridKey' ) : "";;
+	function receiptTrainDo() {
+		$ridKey = $this->get_args ( 'ridKey' ) ? $this->get_args ( 'ridKey' ) : "";
 		
 		Doo::loadClass ( 'XDeode' );
 		$XDeode = new XDeode ( 7 );
@@ -3012,7 +3059,6 @@ class ReceiptController extends DooController {
 		Doo::loadModel ( 'statistics' );
 		$statistics = new statistics ();
 		
-		
 		Doo::loadModel ( "verify" );
 		$verify = new verify ();
 		
@@ -3104,7 +3150,7 @@ class ReceiptController extends DooController {
 		$receiptLog->rid = $rid;
 		$receiptLog->insert ();
 		
-		//写入列表项
+		// 写入列表项
 		Doo::loadModel ( 'accountItem' );
 		$accountItem = new accountItem ();
 		$aItem = $accountItem->getAccountBookByCategory ( '培训班费用' );
@@ -3119,52 +3165,51 @@ class ReceiptController extends DooController {
 		$RILecturerList = $RILecturer->getRILecturerByRid ( $rid );
 		// 支出项金额详情
 		$aiData = $accountItem->getTrainingDetail ( $RItemList, $RILecturerList, 0 );
-		//print_r($aItem);
-		//print_r($aiData);
-
+		// print_r($aItem);
+		// print_r($aiData);
+		
 		$accountJson [$this->AGENCY] = $accountJson [$this->TRAVEL] = $accountJson [$this->TRAIN] = $accountJson [$this->OTHER] = array ();
 		$ag = $tr = $ta = $ot = 0;
 		$sum = $agencySum = $travelSum = $trainSum = $otherSum = 0;
-			
+		
 		foreach ( $aItem as $key => $value ) {
 			if ($value ['category'] == $this->TRAIN) {
 				
-				foreach ($aiData['dataList'] as $k=>$v){
-					if ($value ['name'] == $v['name']) {
+				foreach ( $aiData ['dataList'] as $k => $v ) {
+					if ($value ['name'] == $v ['name']) {
 						array_push ( $accountJson [$this->TRAIN], array (
 								'aid' => $value ['aid'],
 								'name' => $value ['name'],
-								'price' => number_format ( $v['price'], 2, '.', '' )
+								'price' => number_format ( $v ['price'], 2, '.', '' ) 
 						) );
-						$sum += $v['price'];
-						$trainSum += $v['price'];
-						unset($aiData['dataList'][$k]);
+						$sum += $v ['price'];
+						$trainSum += $v ['price'];
+						unset ( $aiData ['dataList'] [$k] );
 						break;
 					}
 				}
-				
 			}
 		}
 		$accountJson ['cSum'] = array (
 				'agencySum' => number_format ( $agencySum, 2, '.', '' ),
 				'travelSum' => number_format ( $travelSum, 2, '.', '' ),
 				'trainSum' => number_format ( $trainSum, 2, '.', '' ),
-				'otherSum' => number_format ( $otherSum, 2, '.', '' )
+				'otherSum' => number_format ( $otherSum, 2, '.', '' ) 
 		);
-			
+		
 		// 报销单
 		$receipt = new receipt ();
- 		$receipt->accountItem = json_encode ( $accountJson );
- 		$receipt->sum = number_format ( $sum, 2, '.', '' );
- 		$receipt->update ( array (
-					'where' => 'rid=' . $rid
-			) );
-		//print_r($accountJson);
+		$receipt->accountItem = json_encode ( $accountJson );
+		$receipt->sum = number_format ( $sum, 2, '.', '' );
+		$receipt->update ( array (
+				'where' => 'rid=' . $rid 
+		) );
+		// print_r($accountJson);
 		// statistics item 统计写入
 		$dateArray = explode ( "-", $receiptDetailList ['date'] );
 		$dateCondition = " and Year(date) =" . $dateArray [0] . " and Month(date) = " . $dateArray [1];
 		
-		$accountItem =  $accountJson ;
+		$accountItem = $accountJson;
 		
 		$stat = $statistics->getOne ( array (
 				'where' => 'staff=' . $this->staff [0] ['sid'] . $dateCondition,
@@ -3297,6 +3342,8 @@ class ReceiptController extends DooController {
 		$year = $this->get_args ( 'year' ) ? $this->get_args ( 'year' ) : date ( "Y" );
 		$moth = $this->get_args ( 'moth' ) ? $this->get_args ( 'moth' ) : "";
 		
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 7 );
 		Doo::loadModel ( 'receipt' );
 		$receipt = new receipt ();
 		
@@ -3316,6 +3363,8 @@ class ReceiptController extends DooController {
 			$condition = " and Rtype=0 ";
 		elseif ($item == "remits")
 			$condition = " and Rtype=2 ";
+		elseif ($item == "train")
+		$condition = " and Rtype=3 ";
 		
 		$dateCondition = " and Year(date) =" . $year;
 		if (! empty ( $moth )) {
@@ -3520,6 +3569,9 @@ class ReceiptController extends DooController {
 					'asArray' => true 
 			) );
 			$receiptList [$key] ['button'] = $button;
+			
+			$receiptList [$key] ['ridKey'] =$XDeode->encode( $value ['rid'] );
+			
 		}
 		
 		// print_r($receiptList);die;
@@ -3576,7 +3628,7 @@ class ReceiptController extends DooController {
 		Doo::loadModel ( 'loanReceipt' );
 		$loanReceipt = new loanReceipt ();
 		
-		$receiptList = $receipt->find ( array (
+		$receiptList = $receipt->find ( array (//去掉
 				'where' => 'staff=' . $this->staff [0] ['sid'] . ' and rid=' . $rid,
 				'desc' => 'rid',
 				'asArray' => true 
@@ -3830,7 +3882,7 @@ class ReceiptController extends DooController {
 		$cid = $this->get_args ( 'cid' ) ? $this->get_args ( 'cid' ) : 0;
 		$sid = $this->get_args ( 'sid' ) ? $this->get_args ( 'sid' ) : 0;
 		
-		// $this->get_args ( 'date' ) ? $this->get_args ( 'date' ) :"";
+		$receiptOrder=$this->get_args ( 'receiptOrder' ) ? $this->get_args ( 'receiptOrder' ) :"";
 		
 		// echo $rdate;
 		
@@ -3931,23 +3983,35 @@ class ReceiptController extends DooController {
 				'previous' => '' 
 		);
 		
-		if ($status == 'done' || $status == 'termination' || $status == 'finish') { // $dateCondition .
-			$pageinfo = $this->get_page ( "CLD_receipt", $cateCondition . $staffCondition . $approvalCondition . $dateCondition . ' and verify in (' . $vid . ') and status!=5', $page, $page_size, "approvalExpenses/" . $status, $get, "" );
-			
-			$receiptList = $receipt->find ( array ( // $dateCondition.
-					'where' => 'status!=5  ' . $cateCondition . $staffCondition . $approvalCondition . $dateCondition . ' and verify in (' . $vid . ')',
-					'limit' => $pageinfo ['lower'] . ',' . $page_size,
-					'desc' => 'rid',
-					'asArray' => true 
-			) );
-		} else {
+		if(!empty($receiptOrder)){
+			$pageinfo = $this->get_page ( "CLD_receipt", ' and receiptOrder like "%' . $receiptOrder . '%"', $page, $page_size, "approvalExpenses/" . $status, $get, "" );
 			$receiptList = $receipt->find ( array ( // $dateCondition
-					'where' => 'status!=5 ' . $cateCondition . $staffCondition . $approvalCondition . $dateCondition . ' and verify in (' . $vid . ')',
+					'where' => 'receiptOrder like "%' . $receiptOrder . '%"',
 					'desc' => 'rid',
-					'asArray' => true 
+					'asArray' => true
 			) );
-			// echo 'status!=5 ' . $cateCondition . $staffCondition . $approvalCondition . ' and verify in (' . $vid . ')';
+		}else{
+			if ($status == 'done' || $status == 'termination' || $status == 'finish') { // $dateCondition .
+				$pageinfo = $this->get_page ( "CLD_receipt", $cateCondition . $staffCondition . $approvalCondition . $dateCondition . ' and verify in (' . $vid . ') and status!=5', $page, $page_size, "approvalExpenses/" . $status, $get, "" );
+					
+				$receiptList = $receipt->find ( array ( // $dateCondition.
+						'where' => 'status!=5  ' . $cateCondition . $staffCondition . $approvalCondition . $dateCondition . ' and verify in (' . $vid . ')',
+						'limit' => $pageinfo ['lower'] . ',' . $page_size,
+						'desc' => 'rid',
+						'asArray' => true
+				) );
+			} else {
+				$receiptList = $receipt->find ( array ( // $dateCondition
+						'where' => 'status!=5 ' . $cateCondition . $staffCondition . $approvalCondition . $dateCondition . ' and verify in (' . $vid . ')',
+						'desc' => 'rid',
+						'asArray' => true
+				) );
+				// echo 'status!=5 ' . $cateCondition . $staffCondition . $approvalCondition . ' and verify in (' . $vid . ')';
+			}
 		}
+		
+		
+		
 		$rLRes = $receipt->find ( array (
 				'where' => 'status=2 and (nowStaff like "%,' . $this->staff [0] ['sid'] . '%" or nowStaff like "%' . $this->staff [0] ['sid'] . ',%" or nowStaff=' . $this->staff [0] ['sid'] . ' )' . $cateCondition . $staffCondition . ' and verify in (' . $vid . ')',
 				'desc' => 'rid',
@@ -3960,14 +4024,12 @@ class ReceiptController extends DooController {
 		Doo::loadClass ( 'XDeode' );
 		$XDeode = new XDeode ( 7 );
 		
-		
-		
 		$Locate = 0;
 		
 		$reportList = $reportCateList = array ();
 		foreach ( $receiptList as $key => $value ) {
 			
-			$receiptList [$key] ['ridKey'] = $XDeode->encode( $value['rid'] );
+			$receiptList [$key] ['ridKey'] = $XDeode->encode ( $value ['rid'] );
 			
 			$receiptList [$key] ['Locate'] = $Locate;
 			$Locate ++;
@@ -4091,6 +4153,7 @@ class ReceiptController extends DooController {
 		
 		// print_r($receiptList);
 		
+		$data['receiptOrder']=$receiptOrder;
 		$data ['memu'] = "receipt";
 		$data ['staff'] = $this->staff;
 		$data ['receiptMemu'] = 'approvalExpenses';
@@ -5602,7 +5665,13 @@ class ReceiptController extends DooController {
 		$Locate = 0;
 		$roleId = 0;
 		$button = 0;
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		
 		foreach ( $receiptList as $key => $value ) {
+			
+			$receiptList[$key]['ridKey']=$XDeode->encode ( $value['rid'] );
+			
 			$button2 = 0;
 			$receiptList [$key] ['Locate'] = $Locate;
 			$Locate ++;
@@ -5818,7 +5887,29 @@ class ReceiptController extends DooController {
 			$receiptList [$key] ['relustCN'] = $this->num_to_rmb ( $relust );
 		}
 		
-		// print_r($receiptList[$key]['executeList']);
+		
+		// 是否写入过流水
+		$accountType = 0;
+		if ($receiptList [0] ['Rtype'] == 0) {
+			$accountType = 3;
+		} elseif ($receiptList [0] ['Rtype'] == 1) {
+			if ($receiptList [0] ['Rtype'] == 0) {
+				$accountType = 1;
+			} elseif ($receiptList [0] ['Rtype'] == 1) {
+				$accountType = 2;
+			}
+		} elseif ($receiptList [0] ['Rtype'] == 2) {
+			$accountType = 4;
+		} elseif ($receiptList [0] ['Rtype'] == 3) {
+			$accountType = 12;
+		}
+		Doo::loadModel ( 'wasteBook' );
+		$wasteBook = new wasteBook ();
+		$wbDetail = $wasteBook->getWateBookByAD ( $accountType, $receiptList [0] ['rid'] );
+		$data ['wbDetail'] = $wbDetail;
+		
+		
+		//print_r($receiptList);
 		
 		$data ['receiptList'] = $receiptList;
 		$data ['memu'] = "receipt";
@@ -5831,29 +5922,28 @@ class ReceiptController extends DooController {
 	function implementDo() {
 		$rid = $this->get_args ( 'rid' ) && is_numeric ( $this->get_args ( 'rid' ) ) ? $this->get_args ( 'rid' ) : 0;
 		$implementOpinions = $this->get_args ( 'opinion' ) ? $this->get_args ( 'opinion' ) : "";
-		$amount = $this->get_args ( 'amount' ) && is_numeric ( $this->get_args ( 'amount' ) ) ? $this->get_args ( 'amount' ) : '';
 		
-		$accountBank = $this->get_args ( 'accountBank' ) ? $this->get_args ( 'accountBank' ) : "";
+// 		$amount = $this->get_args ( 'amount' ) && is_numeric ( $this->get_args ( 'amount' ) ) ? $this->get_args ( 'amount' ) : '';
+// 		$accountBank = $this->get_args ( 'accountBank' ) ? $this->get_args ( 'accountBank' ) : "";
+		
+// 		$ab = '';
+// 		if ($accountBank == 'CGBDeposit')
+// 			$ab = '纵横广发';
+// 		elseif ($accountBank == 'ICBCDeposit')
+// 			$ab = '纵横工行';
+// 		elseif ($accountBank == 'HUADeposit')
+// 			$ab = '华润银行';
+// 		elseif ($accountBank == 'PersonalDeposit')
+// 			$ab = '个人广发';
+// 		if (empty ( $ab ))
+// 			die ( 'illegal request--22' );
 		
-		$ab = '';
-		if ($accountBank == 'CGBDeposit')
-			$ab = '纵横广发';
-		elseif ($accountBank == 'ICBCDeposit')
-			$ab = '纵横工行';
-		elseif ($accountBank == 'HUADeposit')
-			$ab = '华润银行';
-		elseif ($accountBank == 'PersonalDeposit')
-			$ab = '个人广发';
-		
-		if (empty ( $ab ))
-			die ( 'illegal request' );
-		
-		if (! empty ( $rid ) && $amount != '') {
+		if (! empty ( $rid )) {
 			Doo::loadModel ( 'receipt' );
 			$receipt = new receipt ();
 			
-			Doo::loadClass ( 'XDeode' );
-			$XDeode = new XDeode ( 5 );
+// 			Doo::loadClass ( 'XDeode' );
+// 			$XDeode = new XDeode ( 5 );
 			
 			// $rinfo = $receipt->getOne ( array (
 			// 'where' => 'rid=' . $rid,
@@ -5918,31 +6008,31 @@ class ReceiptController extends DooController {
 			) );
 			
 			// 公司流水记录
-			Doo::loadModel ( 'wasteBook' );
-			$wasteBook = new wasteBook ();
-			
-			$abDetail = $wasteBook->getAccountBookByAid ( 2, $accountType, $rid );
-			// 银行
-			if (empty ( $abDetail ) && ! empty ( $amount )) {
-				$item = array (
-						'dataID' => $rid,
-						'expensesType' => 2,
-						'accountType' => $accountType,
+// 			Doo::loadModel ( 'wasteBook' );
+// 			$wasteBook = new wasteBook ();
+			
+// 			$abDetail = $wasteBook->getAccountBookByAid ( 2, $accountType, $rid );
+// 			// 银行
+// 			if (empty ( $abDetail ) && ! empty ( $amount )) {
+// 				$item = array (
+// 						'dataID' => $rid,
+// 						'expensesType' => 2,
+// 						'accountType' => $accountType,
 						
-						'accountPriceShow' => $amount,
+// 						'accountPriceShow' => $amount,
 						
-						'accountPrice' => - $amount,
-						'accountBank' => $accountBank,
-						'category' => $rinfo ['category'] [0] ['title'],
-						'cid' => $rinfo ['category'] [0] ['cid'],
-						'name' => $rinfo ['staffDetail'] ['username'],
-						'sid' => $rinfo ['staffDetail'] ['sid'],
-						'inputDate' => date ( "Y-m-d H:i:s" ) 
-				);
-				$wasteBook->setAccountBookStatistics ( $item );
-			}
-		}
-		$ridKey = $XDeode->encode ( $rid );
+// 						'accountPrice' => - $amount,
+// 						'accountBank' => $accountBank,
+// 						'category' => $rinfo ['category'] [0] ['title'],
+// 						'cid' => $rinfo ['category'] [0] ['cid'],
+// 						'name' => $rinfo ['staffDetail'] ['username'],
+// 						'sid' => $rinfo ['staffDetail'] ['sid'],
+// 						'inputDate' => date ( "Y-m-d H:i:s" ) 
+// 				);
+// 				$wasteBook->setAccountBookStatistics ( $item );
+// 			}
+		}
+		//$ridKey = $XDeode->encode ( $rid );
 		
 		return "/hisImplement";
 		
@@ -6494,9 +6584,10 @@ class ReceiptController extends DooController {
 		$sop = $this->get_args ( 'sop' ) ? $this->get_args ( 'sop' ) : 'SOP';
 		
 		$status = $this->get_args ( 'status' ) ? $this->get_args ( 'status' ) : 'pendImplement';
-		
 		$cidKey = $this->get_args ( 'cidKey' ) ? $this->get_args ( 'cidKey' ) : 'ALL';
 		
+		$receiptOrder=$this->get_args ( 'receiptOrder' ) ? $this->get_args ( 'receiptOrder' ) :"";
+		
 		Doo::loadClass ( 'XDeode' );
 		$XDeode = new XDeode ( 5 );
 		Doo::loadModel ( 'receipt' );
@@ -6511,7 +6602,7 @@ class ReceiptController extends DooController {
 		$staff = new staff ();
 		Doo::loadClass ( 'XDeode' );
 		$XDeode = new XDeode ( 5 );
-		
+		$XDeode7 = new XDeode ( 7 );
 		$cid = $XDeode->decode ( $cidKey );
 		
 		$condition = "";
@@ -6522,6 +6613,8 @@ class ReceiptController extends DooController {
 			$condition = " and Rtype=0 ";
 		elseif ($item == "remits")
 			$condition = " and Rtype=2 ";
+		elseif($item == "train")
+			$condition = " and Rtype=3 ";
 		
 		$statusCon = '(status=8 or status=9 or status=1 or status=6 )';
 		$sopString = $cidString = "";
@@ -6548,18 +6641,34 @@ class ReceiptController extends DooController {
 		if ($cidKey != 'ALL')
 			$cidString = " and cid=" . $cid;
 		
-		$receiptList = $receipt->find ( array (
-				'where' => $statusCon . $condition . $dateCondition . $sopString . $cidString,
-				'desc' => 'rid',
-				'asArray' => true 
-		) );
+		if(!empty($receiptOrder)){
+				$receiptList = $receipt->find ( array (
+					'where' => $statusCon.' and receiptOrder like "%' . $receiptOrder . '%"',
+					'desc' => 'rid',
+					'asArray' => true
+			) );
+			
+			// 员工筛选
+			$receiptList2 = $receipt->find ( array (
+					'where' => $statusCon.' and receiptOrder like "%' . $receiptOrder . '%"',
+					'desc' => 'rid',
+					'asArray' => true
+			) );
+		}else{
+			$receiptList = $receipt->find ( array (
+					'where' => $statusCon . $condition . $dateCondition . $sopString . $cidString,
+					'desc' => 'rid',
+					'asArray' => true
+			) );
+			
+			// 员工筛选
+			$receiptList2 = $receipt->find ( array (
+					'where' => $statusCon . $condition . $dateCondition,
+					'desc' => 'rid',
+					'asArray' => true
+			) );
+		}
 		
-		// 员工筛选
-		$receiptList2 = $receipt->find ( array (
-				'where' => $statusCon . $condition . $dateCondition,
-				'desc' => 'rid',
-				'asArray' => true 
-		) );
 		$sopStaff = array ();
 		foreach ( $receiptList2 as $key => $value ) {
 			$staffDetail = $staff->getOne ( array (
@@ -6596,6 +6705,7 @@ class ReceiptController extends DooController {
 		$staffBatchNumber = 100001;
 		$remittanceList = array ();
 		foreach ( $receiptList as $key => $value ) {
+			$receiptList [$key] ['ridKey7'] = $XDeode7->encode ( $value ['rid'] );
 			$receiptList [$key] ['ridKey'] = $XDeode->encode ( $value ['rid'] );
 			$receiptList [$key] ['Texe'] = 'false';
 			if (strstr ( $value ['executeCopy'], '["' . $this->staff [0] ['sid'] . '"' ) != false) {
@@ -6821,6 +6931,7 @@ class ReceiptController extends DooController {
 		$data ['item'] = $item;
 		$data ['year'] = $year;
 		$data ['moth'] = $moth;
+		$data['receiptOrder']=$receiptOrder;
 		$data ['day'] = $day;
 		$data ['sop'] = $sop;
 		$this->render ( "/admin/hisImplement", $data );
@@ -7329,6 +7440,7 @@ class ReceiptController extends DooController {
 					$ot ++;
 				}
 			}
+			
 			$accountJson ['cSum'] = array (
 					'agencySum' => number_format ( $agencySum, 2, '.', '' ),
 					'travelSum' => number_format ( $travelSum, 2, '.', '' ),
@@ -9377,7 +9489,7 @@ class ReceiptController extends DooController {
 			}
 			
 			if (empty ( $receiptDetail ) || $nsflag)
-				return "/approval";
+				return "/approvalExpenses/pendApproval";
 			
 			$verifyDetail = $verify->getOne ( array (
 					'where' => ' vid =' . $receiptDetail ['verify'],
@@ -10740,6 +10852,7 @@ class ReceiptController extends DooController {
 	}
 	function staffCollect() {
 		$year = $this->get_args ( 'year' ) ? $this->get_args ( 'year' ) : date ( "Y" );
+		$nature = $this->get_args ( 'nature' ) ? $this->get_args ( 'nature' ) : 'ONJOB';//
 		
 		$path = SITE_PATH . $this->STAFFCOLLECTPATH . "staffCollect_" . $year . "_.htmls";
 		// $this->showCache($path);
@@ -10767,6 +10880,16 @@ class ReceiptController extends DooController {
 		}
 		$cidString = implode ( ',', $cidList );
 		
+		$naturecon='';
+		if ($nature=='ONJOB'){
+			$naturecon=' and (nature!=4 )';
+		}elseif($nature=='LEAVEJOB'){
+			$naturecon=' and (nature=4 )';
+		}else{
+			die ( 'illegal request--nature' );
+		}
+			
+		
 		// statistics html
 		$stList = $statistics->statisticsByComPanyYear ( $year, $this->staff [0] ['sid'], $cidString );
 		if (empty ( $stList ))
@@ -10782,7 +10905,7 @@ class ReceiptController extends DooController {
 		
 		// ---
 		$staffList = $staff->find ( array (
-				'where' => 'username !="admin"',
+				'where' => 'username !="admin" '.$naturecon,
 				'asArray' => true 
 		) );
 		$LcategoryList = $Lcategory->find ( array (
@@ -10797,7 +10920,7 @@ class ReceiptController extends DooController {
 		
 		$categoryList = $staff->find ( array (
 				'select' => 'COUNT(*) as count,cid,category',
-				'where' => 'username !="admin" and cid in (' . $cidString . ')',
+				'where' => 'username !="admin" and cid in (' . $cidString . ') '.$naturecon,
 				'groupby' => 'cid',
 				'asArray' => true 
 		) );
@@ -10900,6 +11023,7 @@ class ReceiptController extends DooController {
 		$data ['companyTotalHtml'] = $collectHtml;
 		$data ['total'] = $total;
 		
+		$data ['nature'] =$nature;
 		$data ['year'] = $year;
 		
 		$data ['memu'] = "receipt";
@@ -12749,18 +12873,6 @@ class ReceiptController extends DooController {
 		$data ['executeId'] = $this->executeId;
 		$this->render ( "/expenses/paymentsCollectDay", $data );
 	}
-	function ajaxGetPaymentsByAid() {
-		$serial = $this->get_args ( 'serial' ) ? $this->get_args ( 'serial' ) : "";
-		Doo::loadModel ( "accountBook" );
-		$accountBook = new accountBook ();
-		
-		$detail = $accountBook->getAccountBookByAid ( $serial );
-		
-		echo json_encode ( array (
-				'status' => 1,
-				'detail' => $detail 
-		) );
-	}
 	
 	// 公司流水
 	function wasteBook() {
@@ -13022,6 +13134,18 @@ class ReceiptController extends DooController {
 				'detail' => $detail 
 		) );
 	}
+	function ajaxGetPaymentsByAid() {
+		$serial = $this->get_args ( 'serial' ) ? $this->get_args ( 'serial' ) : "";
+		Doo::loadModel ( "accountBook" );
+		$accountBook = new accountBook ();
+	
+		$detail = $accountBook->getAccountBookByAid ( $serial );
+	
+		echo json_encode ( array (
+				'status' => 1,
+				'detail' => $detail
+		) );
+	}
 	function ajaxGetWasteInvoice() {
 		$serial = $this->get_args ( 'serial' ) ? $this->get_args ( 'serial' ) : "";
 		
@@ -13703,6 +13827,11 @@ class ReceiptController extends DooController {
 		if (! $month)
 			$month = isset ( $this->params ['month'] ) ? $this->params ['month'] : 1;
 		
+		$nature = $this->get_args ( 'nature' ) ? $this->get_args ( 'nature' ) : "";
+		if (! $nature){
+				$nature = isset ( $this->params ['nature'] ) ? $this->params ['nature'] : 'ONJOB';
+		}
+			
 		Doo::loadModel ( 'staff' );
 		$staff = new staff ();
 		Doo::loadModel ( "receiptDetail" );
@@ -13724,13 +13853,22 @@ class ReceiptController extends DooController {
 		}
 		$cidString = implode ( ',', $cidList );
 		
+		$naturecon='';
+		if ($nature=='ONJOB'){
+			$naturecon=' and (nature!=4 )';
+		}elseif($nature=='LEAVEJOB'){
+			$naturecon=' and (nature=4 )';
+		}else{
+			die ( 'illegal request--nature' );
+		}
+		
 		$staffList = $staff->find ( array (
-				'where' => 'username!="admin" and cid in (' . $cidString . ')',
+				'where' => 'username!="admin" and cid in (' . $cidString . ')'.$naturecon,
 				'asArray' => true 
 		) );
 		$categoryList = $staff->find ( array (
 				'select' => 'COUNT(*) as count,cid,category',
-				'where' => 'username !="admin" and cid in (' . $cidString . ')',
+				'where' => 'username !="admin" and cid in (' . $cidString . ')'.$naturecon,
 				'groupby' => 'cid',
 				'asArray' => true 
 		) );
@@ -14138,6 +14276,8 @@ class ReceiptController extends DooController {
 		$data ['monthHtml'] = $monthHtml;
 		$data ['year'] = $year;
 		$data ['month'] = $month;
+		$data ['nature'] = $nature;
+		
 		
 		$data ['memu'] = "receipt";
 		$data ['staff'] = $this->staff;
@@ -14613,7 +14753,7 @@ class ReceiptController extends DooController {
 				// 金额调整和费用查看
 				$revisePrice += $value ['revisePrice'];
 				$receiptItemHtml .= '<td class="taR">' . $value ['revisePrice'] . '</td>';
-				$receiptItemHtml .= '<td class="taR"><a href="#detail" data-toggle="modal" onclick=showExplanation("' . $value ['explanation'] . '")>查看</a></td>';
+				$receiptItemHtml .= '<td class="taR"><a href="#detail" data-toggle="modal" id="sen'.$key.'" data="' . htmlspecialchars($value ['explanation']) . '" onclick=showExplanation() >查看</a></td>';
 				$list [$key] ['receiptItemHtml'] = $receiptItemHtml;
 			}
 			
@@ -14627,12 +14767,16 @@ class ReceiptController extends DooController {
 				$count = count ( $itemList [$value] ) + 1;
 				$itemHtml .= '<th class="taC" colspan="' . $count . '">' . $value . '</th>';
 				$categoryHtml .= '<th class="taC">合计</th>';
+				$sumfalg=true;
 				foreach ( $rtl as $rtlValue ) {
 					if ($rtlValue ['itemCategory'] == $value) {
 						$receiptTotalHtml .= '<th>' . $rtlValue ['price'] . '</th>';
+						$sumfalg=false;
 						break;
 					}
 				}
+				if ($sumfalg)
+					$receiptTotalHtml .= '<th></th>';
 				
 				foreach ( $itemList [$value] as $k => $v ) {
 					$categoryHtml .= '<th class="taC">' . $v ['name'] . '</th>';

+ 1 - 0
protected/controller/SoftController.php

@@ -93,6 +93,7 @@ class SoftController extends DooController {
 				$longle->category=$value['title'];
 				$longle->SerialNumber=$value['serialnumber'];
 				$longle->version=$value['version'];
+				$longle->licences=$value['licences'];
 				$lid=$longle->insert();
 
 				//锁日志记录

+ 7 - 7
protected/model/accountItem.php

@@ -62,7 +62,7 @@ class accountItem extends DooModel {
 				'asArray' => TRUE
 		) );
 		
-		$total=0;$categoryActualExpenditure='';
+		$total=0;$categoryActualExpenditure=0;
 		foreach ($aiList as $k=>$v){
 			$aiList[$k]['price']=$aiList[$k]['companyPrice']=$aiList[$k]['categoryPrice']=0;
 			$aiList[$k]['insidePrice']=$aiList[$k]['outsideNoTaxPrice']=$aiList[$k]['outsideTaxPrice']=0;
@@ -138,21 +138,21 @@ class accountItem extends DooModel {
 			if ($invoiceArriveAmount!=0){
 	 			if($v['name']=='办公费'||$v['name']=='邮寄费'){
 	 				$proportion=$aiList[$k]['categoryPrice']/$invoiceArriveAmount;
-	 				$aiList[$k]['categoryProportion']=number_format ( $proportion, 2, '.', '' )*100;
+	 				$aiList[$k]['categoryProportion']=number_format ( $proportion, 4, '.', '' )*100;
 	 				$proportion=$aiList[$k]['companyPrice']/$invoiceArriveAmount;
-	 				$aiList[$k]['companyProportion']=number_format ( $proportion, 2, '.', '' )*100;
+	 				$aiList[$k]['companyProportion']=number_format ( $proportion, 4, '.', '' )*100;
 	 			}elseif($v['name']=='讲课费'){
 	 				$proportion=$aiList[$k]['insidePrice']/$invoiceArriveAmount;
-	 				$aiList[$k]['insideProportion']=number_format ( $proportion, 2, '.', '' )*100;
+	 				$aiList[$k]['insideProportion']=number_format ( $proportion, 4, '.', '' )*100;
 	 				
 	 				$proportion=$aiList[$k]['outsideTaxPrice']/$invoiceArriveAmount;
-	 				$aiList[$k]['outsideTaxProportion']=number_format ( $proportion, 2, '.', '' )*100;
+	 				$aiList[$k]['outsideTaxProportion']=number_format ( $proportion, 4, '.', '' )*100;
 	 				
 	 				$proportion=$aiList[$k]['outsideNoTaxPrice']/$invoiceArriveAmount;
-	 				$aiList[$k]['outsideNoTaxProportion']=number_format ( $proportion, 2, '.', '' )*100;
+	 				$aiList[$k]['outsideNoTaxProportion']=number_format ( $proportion, 4, '.', '' )*100;
 	 			}else{
 	 				$proportion=$aiList[$k]['price']/$invoiceArriveAmount;
-	 				$aiList[$k]['proportion']=number_format ( $proportion, 2, '.', '' )*100;
+	 				$aiList[$k]['proportion']=number_format ( $proportion, 4, '.', '' )*100;
 	 			}
 			}
 			

+ 26 - 2
protected/model/invoice.php

@@ -331,9 +331,10 @@ class invoice extends DooModel {
 // 		return $detail;
 	}
 	
+	//办事处收款 有问题
 	function sumOfInvoiceByItid($itidSql=0){
 		$sql = 'select sum(a.invoicePrice) as invoicePrice ,a.trainId as trainId,a.iid
-				from ' . $this->_table . ' as a left join  CLD_RIExtend  as b on (a.iid=b.iid)
+				from CLD_RIExtend  as b left join ' . $this->_table . ' as a  on (a.iid=b.iid)
 				where (a.trainId in (' . $itidSql . ') and a.status=2 and a.printStatus=1 and  a.untreadStatus=3) or b.RIstatus=1
 				GROUP BY a.trainId';
 		$query = Doo::db ()->query ( $sql );
@@ -475,6 +476,23 @@ class invoice extends DooModel {
 		$query = Doo::db ()->query ( $sql );
 		return $result = $query->fetchAll ();
 	}
+	
+	/**
+	 * 公司收款汇总
+	 * @param unknown $itidSql
+	 */
+	function sumOfInvoiceRecelvablesCompany($itidSql) {
+		$sql = 'select sum(b.receivablesPrice) as receivablesPrice ,a.trainId,count(*) as count
+ 				from ' . $this->_table . ' as a left join CLD_invoiceReceivables as b on (a.iid=b.iid)
+ 				where a.trainId in (' . $itidSql . ') and b.receivablesBank!="财务录入" and a.status=2 and a.printStatus=1 and ( a.untreadStatus=3) and a.irid!=""
+ 				GROUP BY a.trainId';
+	
+		$query = Doo::db ()->query ( $sql );
+	
+		return $result = $query->fetchAll ();
+	}
+	
+	//
 	function sumOfInvoiceRecelvablesTrain($itidSql) {
 		// $sql = 'select sum(b.receivablesPrice) as receivablesPrice ,a.trainId,count(*) as count
 		// from ' . $this->_table . ' as a left join CLD_invoiceReceivables as b on find_in_set(a.irid,b.irid)
@@ -484,11 +502,14 @@ class invoice extends DooModel {
  				from ' . $this->_table . ' as a left join CLD_invoiceReceivables as b on (a.iid=b.iid)
  				where a.trainId in (' . $itidSql . ') and a.status=2 and a.printStatus=1 and (a.untreadStatus =0 or a.untreadStatus=3) and a.irid!="" 
  				GROUP BY a.trainId';
-		
+
 		$query = Doo::db ()->query ( $sql );
 		
 		return $result = $query->fetchAll ();
 	}
+	
+	
+	
 	// 获得培训班发票
 	function getInvoiceByTrainingCount($itid = 0) {
 		if (empty ( $itid ))
@@ -695,6 +716,8 @@ class invoice extends DooModel {
 		return $list;
 	}
 	
+	
+	
 	/**
 	 * 获得所有未入账发票
 	 * @param number $invoiceTC 发票title
@@ -873,6 +896,7 @@ class invoice extends DooModel {
 			$list [$key] ['count'] = $listCount;
 			$list [$key] ['iidKey'] = $this->authcode ( $value ['iid'], '' );
 			$list [$key] ['iidKeyK'] = $XDeode->encode ( $value ['iid'] );
+			$list [$key] ['trainIdKey'] = $XDeode->encode ( $value ['trainId'] );
 			
 			$list [$key] ['untreadCompany'] = '';
 			$list [$key] ['untreadCom'] = '';

+ 19 - 7
protected/model/invoiceTraining.php

@@ -9,6 +9,7 @@ Doo::loadCore ( 'db/DooModel' );
  */
 class invoiceTraining extends DooModel {
 	public $itid;
+	public $bindReceipt;
 	public $status;
 	public $submitStatus;
 	public $trainName;
@@ -26,6 +27,7 @@ class invoiceTraining extends DooModel {
 	public $_primarykey = 'itid';
 	public $_fields = array (
 			'itid',
+			'bindReceipt',
 			'status',
 			'submitStatus',
 			'trainName',
@@ -110,9 +112,9 @@ class invoiceTraining extends DooModel {
 	 * @param number $SStatus
 	 * @return string
 	 */
-	function getInvoiceTrainBySettlementStatus($SStatus = 0, $cid = 0) {
+	function getInvoiceTrainBySettlementStatus($SStatus = 0, $cid = 0,$bindReceipt) {
 		$condition = array (
-				'where' => " settlementStatus=" . $SStatus . ' and cid=' . $cid,
+				'where' => " settlementStatus=" . $SStatus . ' and cid=' . $cid. ' and bindReceipt=' . $bindReceipt,
 				'asArray' => TRUE 
 		);
 		$list = $this->find ( $condition );
@@ -147,7 +149,7 @@ class invoiceTraining extends DooModel {
 		$lCategory = new L_category ();
 		
 		$condition = array (
-				'where' => "(status= 0 or status=1) and ( cid=" . $cid . " or creator=" . $sid . " )",
+				'where' => "(status= 0 or status=1) and ( cid in (" . $cid . ") or creator=" . $sid . " )",
 				// 'limit' => 8,
 				'asArray' => TRUE 
 		);
@@ -224,7 +226,7 @@ class invoiceTraining extends DooModel {
 				$this->$key = $value;
 			}
 			
-			if (! empty ( $isid )) {
+			if (! empty ( $itid )) {
 				$condition = array (
 						'where' => "itid in (" . $itid . ")",
 						'asArray' => TRUE 
@@ -247,7 +249,7 @@ class invoiceTraining extends DooModel {
 		$lCategory = new L_category ();
 		
 		$condition = array (
-				'where' => "status= '" . $status . "' and  (cid=" . $cid . " or creator=" . $sid . " )",
+				'where' => "status= '" . $status . "' and  (cid in(" . $cid . ") or creator=" . $sid . " )",
 				// 'limit' => 8,
 				'asArray' => TRUE 
 		);
@@ -351,12 +353,14 @@ class invoiceTraining extends DooModel {
 			Doo::loadModel ( 'invoice' );
 			$invoice = new invoice ();
 			
-			$invoiceList = $invoiceRecelvablesList = array ();
+			$invoiceList=$companyList=$RIList = $invoiceRecelvablesList = array ();
 			if (! empty ( $itid )) {
 				$itidSql = $itid;
-				
+				//培训班收款
 				$invoiceList = $invoice->sumOfinvoiceTrain ( $itidSql );
 				$invoiceRecelvablesList = $invoice->sumOfInvoiceRecelvablesTrain ( $itidSql );
+				//公司收款
+				$companyList = $invoice->sumOfInvoiceRecelvablesCompany ( $itidSql );
 				//获得办事处已收款
 				$RIList=$invoice->sumOfInvoiceByItid($itid);
 			}
@@ -388,6 +392,14 @@ class invoiceTraining extends DooModel {
 					break;
 				}
 			}
+			//公司已收款
+			$detail ['invoiceCompanyAmount']=0;
+			foreach ($companyList as $key=>$value){
+				if ($detail ['itid'] == $value ['trainId']) {
+					$detail ['invoiceCompanyAmount'] = $value ['receivablesPrice'];
+					break;
+				}
+			}
 		}
 		//print_r($detail);
 		return $detail;

+ 4 - 1
protected/model/longle.php

@@ -20,12 +20,15 @@ class longle extends DooModel {
 	public $responsible;
 	public $client;
 	public $clientid;
+	public $licences;
 	public $SerialNumber;
 	
 	
 	public $_table = 'CLD_longle';
 	public $_primarykey = 'lid';
-	public $_fields = array ('lid', 'year', 'cid','category','product_id', 'status','statuslog','statusT', 'key_num','SerialNumber','product','alloted_time', 'make_day','version', 'responsible','client','clientid' );
+	public $_fields = array ('lid', 'year', 'cid','category','product_id', 'status','statuslog','statusT', 'key_num','SerialNumber','product','alloted_time', 'make_day','version', 'responsible','client','clientid'
+			,'licences'
+	);
 	
 	public function getLongleByStatus($year=0,$cid=0,$staff=0,$status=0,$search="",$productW=""){
 		

+ 86 - 0
protected/model/receipt.php

@@ -126,12 +126,49 @@ class receipt extends DooModel {
 		
 		$rinfo['ridKey']=$XDeode->encode ( $rinfo ['rid'] );
 		$rinfo['trainLoanRidKey']=$XDeode->encode ( $rinfo ['trainLoanRid'] );
+		$XDeode = new XDeode ( 7 );
+		$rinfo['ridKey7']=$XDeode->encode ( $rinfo ['rid'] );
+		
 		$rinfo['category']=$Lcategory->getCategoryById($rinfo['cid']);
 		$rinfo['staffDetail']=$staff->getStaffBySid($rinfo['staff']);
 		
 		return $rinfo;
 	}
 	
+	function getReceiptByinvoiceTrainId($invoiceTrainId = '') {
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+	
+		Doo::loadModel ( 'L_category' );
+		$Lcategory = new L_category ();
+		Doo::loadModel ( 'staff' );
+		$staff = new staff ();
+	
+		if (! is_numeric ( $invoiceTrainId ))
+			$invoiceTrainId = $XDeode->decode ( $invoiceTrainId );
+	
+	
+			$rinfo = $this->getOne ( array (
+					'where' => 'invoiceTrainId=' . $invoiceTrainId,
+					'asArray' => true
+			) );
+	
+			if (empty($rinfo)){
+				return array();
+			}
+			
+			$rinfo['ridKey']=$XDeode->encode ( $rinfo ['rid'] );
+			$rinfo['trainLoanRidKey']=$XDeode->encode ( $rinfo ['trainLoanRid'] );
+			$XDeode = new XDeode ( 7 );
+			$rinfo['ridKey7']=$XDeode->encode ( $rinfo ['rid'] );
+	
+			$rinfo['category']=$Lcategory->getCategoryById($rinfo['cid']);
+			$rinfo['staffDetail']=$staff->getStaffBySid($rinfo['staff']);
+	
+			return $rinfo;
+	}
+	
+	
 	/**
 	 * 默认获得10条
 	 * @param unknown $sid
@@ -160,6 +197,55 @@ class receipt extends DooModel {
 	}
 	
 	/**
+	 * 获得需要记录流水的费用
+	 * @param unknown $status
+	 * @return string
+	 */
+	function getReceiptByWaste(){
+		
+		$list = $this->find ( array (
+				'where' => 'status=2 or status=6 or status=1',
+				'asArray' => true
+		) );
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		$XDeode7 = new XDeode ( 7 );
+		Doo::loadModel ( 'wasteBook' );
+		$wasteBook = new wasteBook ();
+		
+		$accountType=0;
+		foreach ($list as $key=>$value){
+			$list[$key]['ridKey7']=$XDeode7->encode ( $list[$key] ['rid'] );
+			$list[$key]['ridKey']=$XDeode->encode ( $list[$key] ['rid'] );
+			
+			if ($list[$key] ['Rtype']==0){
+				$accountType=3;
+			}elseif ($list[$key] ['Rtype']==1){
+				if($list[$key] ['Rtype']==0){
+					$accountType=1;
+				}elseif($list[$key] ['Rtype']==1){
+					$accountType=2;
+				}
+			}elseif ($list[$key] ['Rtype']==2){
+				$accountType=4;
+			}elseif ($list[$key] ['Rtype']==3){
+				$accountType=12;
+			}
+			//是否已经生成流水
+			$wbDetail=array();
+			if (!empty($accountType)){
+				$wbDetail=$wasteBook->getWateBookByAD($accountType,$list[$key] ['rid']);
+				if (!empty($wbDetail)){
+					unset($list[$key]);
+				}
+			}else{
+				unset($list[$key]);
+			}
+		}
+		return $list;
+	}
+	
+	/**
 	 * 根据参数字段更新相应字段(主键ID必须传)
 	 * @param array $item 相关需要更新的字段信息
 	 * @return number 返回发票ID

+ 6 - 6
protected/model/receiptDetail.php

@@ -34,9 +34,9 @@ class receiptDetail extends DooModel {
     	if(empty($sid))
     		return array();
     	$list=$this->find ( array (
-    			'select' => 'staff,item,sum(price) as price,itemCategory,Month(date) as month',
-    			'where' => 'staff=' . $sid . " and status=1 and Year(date)=" . $year . ' and Month(date)=' . $month,
-    			'groupby' => 'item,Month(date),itemCategory',
+    			'select' => 'staff,item,sum(price) as price,itemCategory,Month(pastDate) as month',
+    			'where' => 'staff=' . $sid . " and status=1 and Year(pastDate)=" . $year . ' and Month(pastDate)=' . $month,
+    			'groupby' => 'item,Month(pastDate),itemCategory',
     			'asArray' => true
     	) );
     	return $list;
@@ -53,9 +53,9 @@ class receiptDetail extends DooModel {
     	if(empty($sid))
     		return array();
     	$list=$this->find ( array (
-    			'select' => 'staff,sum(price) as price,itemCategory,Month(date) as month',
-    			'where' => 'staff=' . $sid . " and status=1 and Year(date)=" . $year . ' and Month(date)=' . $month,
-    			'groupby' => 'Month(date),itemCategory',
+    			'select' => 'staff,sum(price) as price,itemCategory,Month(pastDate) as month',
+    			'where' => 'staff=' . $sid . " and status=1 and Year(pastDate)=" . $year . ' and Month(pastDate)=' . $month,
+    			'groupby' => 'Month(pastDate),itemCategory',
     			'asArray' => true
     	) );
     	return $list;

+ 5 - 2
protected/model/receiptLog.php

@@ -23,10 +23,13 @@ class receiptLog extends DooModel {
 
  	function getReceiptLogByUid($uid){
     	$sql = "select a.receiptOrder,a.sum,a.status,a.Rtype,a.rid from CLD_receipt  as a left join " . $this->_table . " as b on (a.rid=b.rid)  where a.staff= '".$uid."' group by a.rid ORDER BY a.rid DESC" ;
-		
     	$query = Doo::db ()->query ( $sql );
-		
 		$result = $query->fetchAll ();
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 7 );
+		foreach ($result as $key=>$value){
+			$result [$key] ['ridKey'] = $XDeode->encode ( $value ['rid'] );
+		}
 		
 		return $result;
     }

+ 1 - 5
protected/view/admin/adminInvoice.html

@@ -20,11 +20,7 @@
 			</div>
 			<div class="adminContent autoHeight">
 		    <div class="subNav">
-		    	<ul class="navTabs">
-					  <li class="active"><a href="javascript:void(0)">员工权限</a></li>
-					  <li ><a href="/adminInvoiceCategory">办事处汇总权限</a></li>
-					  <li ><a href="/adminInvoiceCompany">应收款权限</a></li>
-					</ul>
+		    	<!-- include 'adminInvoiceMenu' -->
 				</div>
 				
 				<!-- loop invoice -->

+ 1 - 5
protected/view/admin/adminInvoiceCategory.html

@@ -25,11 +25,7 @@
 			</div>
 			<div class="adminContent autoHeight">
 				<div class="subNav">
-					<ul class="navTabs">
-						<li><a href="/adminInvoice">员工权限</a></li>
-						<li class="active"><a href="javascript:void(0)">办事处汇总权限</a></li>
-						<li><a href="/adminInvoiceCompany">应收款权限</a></li>
-					</ul>
+					<!-- include 'adminInvoiceMenu' -->
 				</div>
 					<form>
 					<legend>添加办事处汇总权限</legend>

+ 1 - 5
protected/view/admin/adminInvoiceCompany.html

@@ -24,11 +24,7 @@
 			</div>
 			<div class="adminContent autoHeight">
 				<div class="subNav">
-					<ul class="navTabs">
-						<li><a href="/adminInvoice">员工权限</a></li>
-						<li><a href="/adminInvoiceCategory">办事处汇总权限</a></li>
-						<li class="active"><a href="/adminInvoiceCompany">应收款权限</a></li>
-					</ul>
+					<!-- include 'adminInvoiceMenu' -->
 				</div>
 					<form>
 					<legend>添加应收款权限</legend>

+ 14 - 1
protected/view/admin/approvalExpenses.html

@@ -1,5 +1,5 @@
  <!-- include 'header' -->
-  <script src="<?= WEB_SITE_GLOBAL ?>js/receipt.js"></script>
+  <script src="<?= receipt ?>"></script>
 <body>
 	<div class="mainLayout">
 		<div class="mainMenu">
@@ -88,6 +88,15 @@
 	  						</select>
 	  					</li>
 	  					<!-- endif -->
+	  					
+	  					<li>
+	  						<div class="search">
+									<div class="input-append">
+			  						<input name="receiptOrder" class="span3" placeholder="单号搜索" type="text" value="{{receiptOrder}}">
+			  						<input type="submit" class="btn btn-small" value="搜索">
+			  					</div>
+		  				</div>
+	  					</li>
 	  				</ul>
 	  				
 	  			</form>
@@ -162,8 +171,12 @@
 	  									<a class="button" target="_blank" href="/receiptburEdi/{{receiptDetail' value.rid}}">去审批</a>
 	  								<!-- endif -->
 	  							<!-- else --> 
+	  							<!-- if {{receiptDetail' value.Rtype}}==3 --> 
+	  							<a  target="_blank" href="/receiptTrain/approval/{{receiptDetail' value.ridKey}}.html">详情</a>
+	  							<!-- else -->
 	  							<a  target="_blank" href="/expensesDoc/{{receiptDetail' value.rid}}">详情</a>
 	  							<!-- endif --> 
+	  							<!-- endif --> 
 	  							</td>
 	  						</tr>
 	  					<!-- endloop -->	

+ 12 - 2
protected/view/admin/expenses.html

@@ -33,6 +33,7 @@
 						<a href="/expenses/expenses" <!-- if {{item}}=="expenses" --> class="now" <!-- endif --> >借款申请</a>
 						<a href="/expenses/receipts" <!-- if {{item}}=="receipts" --> class="now" <!-- endif --> >报销单</a>
 						<a href="/expenses/remits" <!-- if {{item}}=="remits" --> class="now" <!-- endif --> >对公汇款</a>
+						<a href="/expenses/train" <!-- if {{item}}=="train" --> class="now" <!-- endif --> >培训班结算</a>
 						</li>
 					
 	  					<li>
@@ -63,8 +64,10 @@
 			  					借款申请
 			  				<!-- elseif {{receiptList' value.Rtype}}==2 -->
 			  					对公汇款
-			  				<!-- else -->	
+			  				<!-- elseif {{receiptList' value.Rtype}}==0 -->	
 			  					报销单
+			  				<!-- elseif {{receiptList' value.Rtype}}==3 -->	
+			  					培训班结算
 			  				<!-- endif -->
 							</td>
 							<td class="taR ">
@@ -100,7 +103,14 @@
 							<!-- endif -->
 							
 							</td>
-							<td><a href="/expensesCollect/{{receiptList' value.rid}}" target="_blank">详情</a></td>
+							<td>
+							<!-- if {{receiptList' value.Rtype}}==3 -->
+								<a href="/receiptTrain/info/{{receiptList' value.ridKey}}.html" target="_blank">详情</a>
+								
+							<!-- else -->	
+			  					<a href="/expensesCollect/{{receiptList' value.rid}}" target="_blank">详情</a>
+			  				<!-- endif -->
+							</td>
 						</tr>
 						<!-- endloop -->
 						

+ 19 - 4
protected/view/admin/hisImplement.html

@@ -34,6 +34,7 @@
 							<a href="/hisImplement/expenses" <!-- if {{item}}=="expenses" --> class="now" <!-- endif --> >借款</a>
 							<a href="/hisImplement/receipts" <!-- if {{item}}=="receipts" --> class="now" <!-- endif --> >报销单</a>
 							<a href="/hisImplement/remits" <!-- if {{item}}=="remits" --> class="now" <!-- endif --> >对公汇款</a>
+							<a href="/hisImplement/train" <!-- if {{item}}=="train" --> class="now" <!-- endif --> >培训班结算</a>
 						</li>
 						
 						<li>
@@ -57,6 +58,14 @@
 		  					{{sopHtml}}
 		  					</select>
 						</li>
+						<li>
+							<div class="search">
+								<div class="input-append">
+	  						<input name="receiptOrder" class="span3" placeholder="单号搜索" type="text" value="{{receiptOrder}}">
+	  						<input type="submit" class="btn btn-small" value="搜索">
+	  						</div>
+	  					</div>
+	  				</li>
 						
 	  			</ul>
 	  			</form>
@@ -88,7 +97,9 @@
 			  					借款申请
 			  				<!-- elseif {{receiptList' value.Rtype}}==2 -->
 			  					对公汇款
-			  				<!-- else -->	
+			  				<!-- elseif {{receiptList' value.Rtype}}==3 -->
+			  					培训班结算
+			  				<!-- elseif {{receiptList' value.Rtype}}==0 -->	
 			  					报销单
 			  				<!-- endif -->
 							</td>
@@ -149,7 +160,9 @@
 			  					借款申请
 			  				<!-- elseif {{receiptList' value.Rtype}}==2 -->
 			  					对公汇款
-			  				<!-- else -->	
+			  				<!-- elseif {{receiptList' value.Rtype}}==3 -->
+			  					培训班结算
+			  				<!-- elseif {{receiptList' value.Rtype}}==0 -->	
 			  					报销单
 			  				<!-- endif -->
 							</td>
@@ -189,13 +202,15 @@
 							</td>
 							<td>
 							
+							<!-- if {{receiptList' value.Rtype}}==3 -->
+								<a href="/receiptTrain/implement/{{receiptList' value.ridKey7}}.html" class="button" target="_blank">去执行</a>
+							<!-- else -->
 							<!-- if {{receiptList' value.Texe}}=='true'&&{{receiptList' value.TRexe}}=='true'&&({{receiptList' value.status}}==1 || {{receiptList' value.status}}==6) -->
 								<a href="/implement/{{receiptList' value.ridKey}}.html" class="button" target="_blank">去执行</a>
 							<!-- else -->
 							<a href="/expensesDoc/{{receiptList' value.rid}}" target="_blank">详情</a>
-							
 							<!-- endif -->
-							
+							<!-- endif -->
 							</td>
 						</tr>
 						

+ 144 - 39
protected/view/admin/implement.html

@@ -200,29 +200,67 @@
 	  					<!-- endif -->
 	  				
 	  				<br/>
-	  					<table class="table table-bordered table-condensed table-hover">
+	  					
+	  				
+	  				<!-- if empty({{wbDetail}}) -->
+	  				<form action="/receiptTrainImplementWateDo"  method="post" class="nice-validator n-yellow" novalidate="novalidate">
+						<input type="hidden" name="ridKey" value="{{receiptDetail' value.ridKey}}">
+						<input type="hidden" name="actionType" value="NOTRAIN">
+						
+						<table class="table table-bordered table-condensed table-hover">
 							<tbody>
 								<tr><th colspan="2" class="taC">确认汇款金额</th></tr>
-								<tr><th>汇款金额(用于生成汇款单)</th>
-								<td class="taR" width="200">¥
-								
-								<input placeholder="输入汇款金额" pattern="[0-9]" data-tm="{{receiptDetail' value.sum}}" id="amountLoan" step="1" min="0" value="{{receiptList' value.amount}}" class="span2" type="number">
-								<button class="btn btn-small" node-qmk="tm" data='amountLoan'  type="button">取值</button>
+								<tr><th>汇款金额(用于生成汇款单)</th><td class="taR" width="220">¥
+									<input name='amount' placeholder="输入汇款金额" pattern="[0-9]" step="1" min="0" class="span2" type="number">
+								</td></tr>
+								<tr><th>流水类型("支出"由公司汇出,"收入"提交人汇款至公司。)</th>
+								<td class="taR" width="200">
 								
+								<select name="expensesType" >
+									<option value="INCOME">收入</option>
+									<option value="EXPENDITURE">支出</option>
+								</select>
 								
 								</td></tr>
-								
-								<tr><th>支付银行</th><td class="taR" width="200">
-								<select name="accountBank" id="accountBankSelectLoan">
+										
+								<tr><th>银行</th>
+								<td class="taR" width="200">
+								<select name="bank" id="bank">
 									<option value="CGBDeposit">纵横广发</option>
 									<option value="ICBCDeposit">纵横工行</option>
 									<option value="HUADeposit">华润银行</option>
 									<option value="PersonalDeposit">个人广发</option>
 									</select>
-									</td></tr>
-								
-							</tbody>
+								</td></tr>
+										
+								</tbody>
+								</table>
+								<input class="fR button" type="submit" value="确定生成流水">
+						</form>
+	  				<!-- else -->
+						<div class="alert alert-erro" style="margin:0">该费用已生成流水。</div>
+						<br/>
+						<table class="table table-bordered table-condensed table-hover">
+									<tbody>
+										<tr><th colspan="2" class="taC">银行水流详情</th></tr>
+										<tr><th>流水类型("支出"由公司汇出,"收入"提交人汇款至公司。)</th>
+										<td class="taR" width="200">
+										<!-- if {{wbDetail.expensesType}}==1 -->
+										收入
+										<!-- elseif {{wbDetail.expensesType}}==2 -->
+										支出
+										<!-- endif -->
+										</td></tr>
+										<tr><th>汇款金额</th><td class="taR" width="220">¥{{receiptDetail' value.amount}}
+										</td></tr>
+										<tr><th>提交人</th><td class="taR" width="220">
+										{{wbDetail.category}}-{{wbDetail.name}}</td></tr>
+										<tr><th>备注</th><td class="taR" width="220">{{wbDetail.remarks}}
+										</td></tr>
+										</tbody>
 						</table>
+						<!-- endif -->
+	  				
 	  				
 	  				
 					</div>
@@ -369,29 +407,64 @@
 	  					</table>
 	  					
 	  					<br/>
-	  					<table class="table table-bordered table-condensed table-hover">
+	  					<!-- if empty({{wbDetail}}) -->
+	  				<form action="/receiptTrainImplementWateDo"  method="post" class="nice-validator n-yellow" novalidate="novalidate">
+						<input type="hidden" name="ridKey" value="{{receiptDetail' value.ridKey}}">
+						<input type="hidden" name="actionType" value="NOTRAIN">
+						
+						<table class="table table-bordered table-condensed table-hover">
 							<tbody>
 								<tr><th colspan="2" class="taC">确认汇款金额</th></tr>
-								<tr><th>汇款金额(用于生成汇款单)</th>
-								<td class="taR" width="200">¥
-								
-								<input placeholder="输入汇款金额" pattern="[0-9]" data-tm="{{receiptDetail' value.sum}}" id="amountPublic" step="1" min="0" value="{{receiptList' value.amount}}" class="span2" type="number">
-								<button class="btn btn-small" node-qmk="tm" data='amountPublic'  type="button">取值</button>
-								
+								<tr><th>汇款金额(用于生成汇款单)</th><td class="taR" width="220">¥
+									<input name='amount' placeholder="输入汇款金额" pattern="[0-9]" step="1" min="0" class="span2" type="number">
 								</td></tr>
+								<tr><th>流水类型("支出"由公司汇出,"收入"提交人汇款至公司。)</th>
+								<td class="taR" width="200">
 								
+								<select name="expensesType" >
+									<option value="INCOME">收入</option>
+									<option value="EXPENDITURE">支出</option>
+								</select>
 								
-								<tr><th>支付银行</th><td class="taR" width="200">
-								<select name="accountBank" id="accountBankSelectPublic">
+								</td></tr>
+										
+								<tr><th>银行</th>
+								<td class="taR" width="200">
+								<select name="bank" id="bank">
 									<option value="CGBDeposit">纵横广发</option>
 									<option value="ICBCDeposit">纵横工行</option>
 									<option value="HUADeposit">华润银行</option>
 									<option value="PersonalDeposit">个人广发</option>
 									</select>
-									</td></tr>
-								
-							</tbody>
+								</td></tr>
+										
+								</tbody>
+								</table>
+								<input class="fR button" type="submit" value="确定生成流水">
+						</form>
+	  				<!-- else -->
+						<div class="alert alert-erro" style="margin:0">该费用已生成流水。</div>
+						<br/>
+						<table class="table table-bordered table-condensed table-hover">
+									<tbody>
+										<tr><th colspan="2" class="taC">银行水流详情</th></tr>
+										<tr><th>流水类型("支出"由公司汇出,"收入"提交人汇款至公司。)</th>
+										<td class="taR" width="200">
+										<!-- if {{wbDetail.expensesType}}==1 -->
+										收入
+										<!-- elseif {{wbDetail.expensesType}}==2 -->
+										支出
+										<!-- endif -->
+										</td></tr>
+										<tr><th>汇款金额</th><td class="taR" width="220">¥{{receiptDetail' value.amount}}
+										</td></tr>
+										<tr><th>提交人</th><td class="taR" width="220">
+										{{wbDetail.category}}-{{wbDetail.name}}</td></tr>
+										<tr><th>备注</th><td class="taR" width="220">{{wbDetail.remarks}}
+										</td></tr>
+										</tbody>
 						</table>
+						<!-- endif -->
 	  					
 	  				</div>
 	  				
@@ -567,32 +640,64 @@
 	  					</table>
 	  					
 	  					<br/>
-	  					<table class="table table-bordered table-condensed table-hover">
+	  					<!-- if empty({{wbDetail}}) -->
+	  				<form action="/receiptTrainImplementWateDo"  method="post" class="nice-validator n-yellow" novalidate="novalidate">
+						<input type="hidden" name="ridKey" value="{{receiptDetail' value.ridKey}}">
+						<input type="hidden" name="actionType" value="NOTRAIN">
+						
+						<table class="table table-bordered table-condensed table-hover">
 							<tbody>
 								<tr><th colspan="2" class="taC">确认汇款金额</th></tr>
-								<tr><th>汇款金额(用于生成汇款单)</th><td class="taR" width="200">¥
-								
-								
-								
-								
-								
-								<input placeholder="输入汇款金额" data-tm="{{receiptDetail' value.sum}}" pattern="[0-9]" id="amountReceipt" step="1" min="0" value="{{receiptList' value.amount}}" class="span2" type="number">
-								<button class="btn btn-small" node-qmk="tm" data='amountReceipt'  type="button">取值</button>
+								<tr><th>汇款金额(用于生成汇款单)</th><td class="taR" width="220">¥
+									<input name='amount' placeholder="输入汇款金额" pattern="[0-9]" step="1" min="0" class="span2" type="number">
+								</td></tr>
+								<tr><th>流水类型("支出"由公司汇出,"收入"提交人汇款至公司。)</th>
+								<td class="taR" width="200">
 								
+								<select name="expensesType" >
+									<option value="INCOME">收入</option>
+									<option value="EXPENDITURE">支出</option>
+								</select>
 								
-								<tr><th>支付银行</th><td class="taR" width="200">
-								<select name="accountBank" id="accountBankSelectReceipt">
+								</td></tr>
+										
+								<tr><th>银行</th>
+								<td class="taR" width="200">
+								<select name="bank" id="bank">
 									<option value="CGBDeposit">纵横广发</option>
 									<option value="ICBCDeposit">纵横工行</option>
 									<option value="HUADeposit">华润银行</option>
 									<option value="PersonalDeposit">个人广发</option>
 									</select>
-									</td></tr>
-								
-								
 								</td></tr>
-							</tbody>
+										
+								</tbody>
+								</table>
+								<input class="fR button" type="submit" value="确定生成流水">
+						</form>
+	  				<!-- else -->
+						<div class="alert alert-erro" style="margin:0">该费用已生成流水。</div>
+						<br/>
+						<table class="table table-bordered table-condensed table-hover">
+									<tbody>
+										<tr><th colspan="2" class="taC">银行水流详情</th></tr>
+										<tr><th>流水类型("支出"由公司汇出,"收入"提交人汇款至公司。)</th>
+										<td class="taR" width="200">
+										<!-- if {{wbDetail.expensesType}}==1 -->
+										收入
+										<!-- elseif {{wbDetail.expensesType}}==2 -->
+										支出
+										<!-- endif -->
+										</td></tr>
+										<tr><th>汇款金额</th><td class="taR" width="220">¥{{wbDetail.accountPriceShow}}
+										</td></tr>
+										<tr><th>提交人</th><td class="taR" width="220">
+										{{wbDetail.category}}-{{wbDetail.name}}</td></tr>
+										<tr><th>备注</th><td class="taR" width="220">{{wbDetail.remarks}}
+										</td></tr>
+										</tbody>
 						</table>
+						<!-- endif -->
 	  					
 	  				</div>
 	  				

+ 31 - 0
protected/view/admin/invoice.html

@@ -247,8 +247,39 @@
 							<!-- else -->
 							<blockquote><p class="colGray">暂时没有入账完成的收款</p></blockquote>
 							<!-- endif -->
+							</div>
 							
+							<div class="clearfix">
+							<legend><div class="fR"><a href="/invoiceUntreadED">查看更多</a></div>已退发票</legend>
+							<!-- if !empty({{untreadStatusList}}) -->
+								<table class="table table-bordered table-condensed">
+									<tbody>
+									<tr><th class="taC">开票单位(抬头)</th><th class="taC" width="90">开票金额</th><th class="taC">开票流水号</th><th class="taC" width="90">发票号</th><th class="taC">处理时间</th></tr>
+									<!-- loop untreadStatusList -->
+									<tr>
+										<td><!-- if !empty({{receivablesList' value.invoiceType}}) -->
+	                                   	{{receivablesList' value.invoiceCompany}}
+	                                    <!-- else -->
+	                                    {{receivablesList' value.invoiceTitle}}
+	                                    <!-- endif --></td>
+										<td><!-- if !empty({{pendingInvoice' value.invoiceType}}) -->
+	                                    <b>¥{{receivablesList' value.invoicePrice}}</b><sup>专</sup>
+	                                    <!-- else -->
+	                                    <b>¥{{receivablesList' value.invoicePrice}}</b>
+	                                    <!-- endif --></td>
+										<td><a href="#invdetail" node-invoice='INFO' data-isKey="{{receivablesList' value.iidKeyK}}"  data-toggle="modal">{{receivablesList' value.invoiceSerial}}</a></td>
+										<td>{{receivablesList' value.invoiceNo}}</td>
+										<td>{{untreadStatusList' value.OperationLog.username}} {{untreadStatusList' value.OperationLog.date}}</td>
+									</tr>
+									<!-- endloop -->
+									</tbody>
+								</table>
+								<!-- else -->
+								<blockquote><p class="colGray">暂时没有退票完成的发票 </p></blockquote>
+								<!-- endif -->
 							</div>
+							
+							
 						</div>
 					</div>
 				</div>

+ 20 - 2
protected/view/admin/invoiceAS.html

@@ -58,12 +58,21 @@
 				<div class="saeaList">
 					<table class="table table-hover">
 						<tbody>
-						<tr class="thead"><th>开票流水号</th><th>开票金额</th><th>开票单位(抬头)</th><th>开票内容</th><th>出票时间</th><th>发票号</th><th>收款流水号</th><th>收款金额</th>
+						<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></tr>
 						<!-- loop list -->
 						<tr>
-							<td><a href="#invdetail" node-invoice='INFO' data-isKey="{{list' value.iidKeyK}}" data-toggle="modal">{{list' value.invoiceSerial}}</a></td>
+							<td>
+							<a href="#invdetail" node-invoice='INFO' data-isKey="{{list' value.iidKeyK}}" data-toggle="modal">
+							{{list' value.invoiceSerial}}</a>
+							<!-- if {{list' value.untreadStatus}}==2  -->
+								(退票)
+							<!-- endif -->
+							</td>
 							<td>
 								<!-- if !empty({{list' value.invoiceType}}) -->
 	                        	<b>¥{{list' value.invoicePrice}}</b><sup>专</sup>
@@ -71,6 +80,15 @@
 	                          <b>¥{{list' value.invoicePrice}}</b>
 	                          <!-- endif -->
 							</td>
+							
+							<td>
+							<!-- if {{list' value.settlementType}}==1  -->
+								培训班(<a href="/invoiceTrainingDetail/{{list' value.trainIdKey}}.html" target="_blank">查看</a>)
+							<!-- else -->
+								软件销售
+							<!-- endif -->
+							</td>
+							
 							<td>
 								<!-- if !empty({{list' value.invoiceType}}) -->
 	                                   	{{list' value.invoiceCompany}}

+ 1 - 1
protected/view/admin/invoiceAdd.html

@@ -57,7 +57,7 @@
 									<th class="taC"><span class="colRed">*</span>开票金额</th>
 									<td colspan="3">
 									
-										<p class="colGray">数量*单价=开票金额</p>
+										<p class="colGray">数量*单价=开票金额&nbsp;&nbsp;&nbsp;&nbsp;<span class="colRed">根据公司规定:专用发票总金额暂时不能超过10000.00(一万)元。</span></p>
 										<b class="colOrange" id="tp" style="font-size:18px">¥0</b>
 									
 									<input value="0"  placeholder="输入开票金额" pattern="[0-9]" name="invoicePrice" id="invoicePrice" type="hidden" min="0" step="0.01">

+ 2 - 2
protected/view/admin/invoicePrint.html

@@ -62,8 +62,8 @@
 						</div>
 						
 						
-						<div class="clearfix">
-							<legend><div class="fR"><a href="/invoicePrintAchieve">查看更多</a></div>最近打印发票</legend>
+						<div class="clearfix"><!-- /invoicePrintAchieve -->
+							<legend><div class="fR"><a href="/invoicePrintStayAchieve/1/PRINTED">查看更多</a></div>最近打印发票</legend>
 							<!-- if !empty({{printed}}) -->
 							<table class="table table-bordered table-condensed">
 								<tbody>

+ 1 - 1
protected/view/admin/invoicePrintStayAchieve.html

@@ -79,7 +79,7 @@
 							<div class="search">
 								<div class="input-append">
 									
-								<input class="span3" type="text" name="MebSea"  data-irmMebSea value="{{MebSeaEn}}" placeholder="发票抬头、开票金额">
+								<input class="span3" type="text" name="MebSea"  data-irmMebSea value="{{MebSeaEn}}" placeholder="发票抬头、开票金额、发票号">
 								<button class="btn btn-small" node-iramMebSea type="submit">搜索</button>
 								
 								</div>

+ 5 - 0
protected/view/admin/invoiceTrainingDetail.html

@@ -89,6 +89,7 @@ table.DTFC_Cloned thead,table.DTFC_Cloned tfoot{background-color:white}div.DTFC_
 				<legend>
 				{{iTrainDetail.trainName}}</legend>
 				<div class="demandCate">
+				<!-- if empty({{receiptDetail}})||(!({{receiptDetail.status}}==8||{{receiptDetail.status}}==9)) -->
 				<form action="/invoiceTrainingDetail/{{itid}}.html" id="its" method="get" class="nice-validator n-default" novalidate="novalidate">
 					<ul class="cateList">
 						<li>
@@ -113,6 +114,7 @@ table.DTFC_Cloned thead,table.DTFC_Cloned tfoot{background-color:white}div.DTFC_
 						</li>
 	  			</ul>
 	  			</form>
+	  			<!-- endif -->
 	  		</div>
 				<div class="saeaList">
 					<table id="example" class="stripe row-border order-column" cellspacing="0" width="2400" >
@@ -156,6 +158,7 @@ table.DTFC_Cloned thead,table.DTFC_Cloned tfoot{background-color:white}div.DTFC_
 			</div>
 		</div>
 	</div>
+	<!-- if empty({{receiptDetail}})||(!({{receiptDetail.status}}==8||{{receiptDetail.status}}==9)) -->
 	<!--设置邮寄物品-->
 	<div class="modal hide fade" id="confirm-erro">
 
@@ -505,6 +508,8 @@ table.DTFC_Cloned thead,table.DTFC_Cloned tfoot{background-color:white}div.DTFC_
 			</div>
 			</form>
 			</div>
+			
+			<!-- endif -->
 					<!--导入-->
 <script type="text/javascript">
 $(document).ready( function () {

+ 4 - 4
protected/view/admin/invoiceUntreadIsAchieve.html

@@ -30,7 +30,7 @@
 				<div class="demandCate">
 				<form action="/invoiceUntreadIsAchieve/1" id="ira" method="get" >
 					<ul class="cateList">
-						<li>
+						<!-- <li >
 							<div class="search">
 								<div class="input-append">
 									<input class="datepicker-here span3" name="date" value="{{date}}" placeholder="按时间筛选" type="text" data-range="true"
@@ -39,9 +39,9 @@
 									<button class="btn btn-small" type="submit">查询</button>
 								</div>
 							</div></li>						<li>
-							<div class="search">
+							<div class="search"> -->
 							<div class="input-append">
-								<input class="span3" type="text" name="MebSea" value="{{MebSeaEn}}" placeholder="发票抬头、开票金额">
+								<input class="span3" type="text" name="MebSea" value="{{MebSeaEn}}" placeholder="发票">
 								<button class="btn btn-small" type="submit">搜索</button>
 							</div>
 						</li>
@@ -88,7 +88,7 @@
 					</table>
 				</div>
 						  		<!--翻页-->
-				<div class="demandPage">
+				<div class="demandPage" style='display:none'>
 					<ul class="pagination fL">
 	  							<!-- if {{page.previous}}==0 -->
 								<li><a href="javascript:void(0)" title="上一页">&lt;</a></li>

+ 5 - 3
protected/view/admin/receiptStatisticsStaffDetail.html

@@ -1,5 +1,5 @@
 <!-- include 'header' -->
-<script src="<?= WEB_SITE_GLOBAL ?>js/receipt.js"></script>
+<script src="<?= receipt ?>"></script>
 <link rel=stylesheet href="<?= WEB_SITE_GLOBAL ?>css/fixedheadertable.css"> 
 <script src="<?= WEB_SITE_GLOBAL ?>js/jquery.fixedheadertable.js"></script>
 
@@ -107,8 +107,10 @@
     <!--弹出内容-->
 <script type="text/javascript">autoFlashHeight();
 
-function showExplanation(html){
-	$('#explanationHtml').html(html);
+function showExplanation(key){
+	var data=$("#sen"+key).attr('data');
+	console.log(data);
+	$('#explanationHtml').html(data);
 }
 
 </script>

+ 2 - 1
protected/view/admin/receipt_menu.html

@@ -13,7 +13,8 @@
 						
 	<li  class="topLine <!-- if  getGlobals('NEW') !=0 --> news <!-- endif --> "><a <!-- if {{receiptMemu}}=="approvalExpenses" --> class="selected" <!-- endif --> href="/approvalExpenses/pendApproval">费用审批</a></li>
 						
-						
+
+<li  class=""><a <!-- if {{receiptMemu}}=="receiptWasteBook" --> class="selected" <!-- endif --> href="/receiptWasteBook">费用流水</a></li>						
 						
 						
 	<!-- if inarray({{staff.0.sid}},{{executeId}}) -->

+ 20 - 4
protected/view/admin/saeaBorad.html

@@ -47,7 +47,14 @@
 										<th>报销单</th>
 										<!-- endif -->
 										
-										<td><a href="/expensesCollect/{{receiptDetail' value.rid}}">{{receiptDetail' value.receiptOrder}}</a></td>
+										<td>
+										<!-- if {{receiptLogList' value.Rtype}}==3 -->
+										
+										<a href="/receiptTrain/info/{{receiptDetail' value.ridKey}}.html" >{{receiptLogList' value.receiptOrder}}</a>
+										<!-- else -->
+										<a href="/expensesCollect/{{receiptDetail' value.rid}}">{{receiptDetail' value.receiptOrder}}</a>
+										<!-- endif -->
+										</td>
 										<td class="taR">¥{{receiptDetail' value.sum}}
 										<!-- if  {{receiptDetail' value.status}}==7 and {{receiptDetail' value.Rtype}}==1 -->
 										<br/>¥{{receiptDetail' value.loanSum}}
@@ -80,7 +87,7 @@
 										 <!-- elseif  ({{receiptDetail' value.status}}==4 or {{receiptDetail' value.status}}==7) and {{receiptDetail' value.Rtype}}==1 and {{receiptDetail' value.isBK}}==1 -->
 										 <a class="button btn-gray  btn-inline" href="/saeaLoanReceiptEdi/{{receiptDetail' value.ridKey}}.html">返回编辑</a>
 										 <a class="button btn-inline" href="/approvedReceipt/{{receiptDetail' value.rid}}">提交审批</a>
-										<!-- elseif {{receiptDetail' value.Rtype}}==3 and {{receiptDetail' value.status}}==5  -->
+										<!-- elseif {{receiptDetail' value.Rtype}}==3 and ({{receiptDetail' value.status}}==5 or {{receiptDetail' value.status}}==4)  -->
 										 <a class="button btn-gray  btn-inline" href="/receiptTrainEdi/{{receiptDetail' value.ridKey}}.html">返回编辑</a>
 										 <a class="button btn-inline" href="#">提交审批</a>
 										<!-- endif -->
@@ -104,10 +111,19 @@
 										<th>借款</th>
 										<!-- elseif {{receiptLogList' value.Rtype}}==2 -->
 										<th>对公汇款</th>
-										<!-- else -->
+										<!-- elseif {{receiptLogList' value.Rtype}}==3 -->
+										<th>培训班结算</th>
+										<!-- elseif {{receiptLogList' value.Rtype}}==0 -->
 										<th>报销单</th>
 										<!-- endif -->
-										<td><a href="/expensesCollect/{{receiptLogList' value.rid}}" >{{receiptLogList' value.receiptOrder}}</a></td>
+										<td>
+										<!-- if {{receiptLogList' value.Rtype}}==3 -->
+										
+										<a href="/receiptTrain/info/{{receiptLogList' value.ridKey}}.html" >{{receiptLogList' value.receiptOrder}}</a>
+										<!-- else -->
+										<a href="/expensesCollect/{{receiptLogList' value.rid}}" >{{receiptLogList' value.receiptOrder}}</a>
+										<!-- endif -->
+										</td>
 										<td class="taR">¥{{receiptLogList' value.sum}}</td>
 										<td>
 										 <!-- if {{receiptDetail' value.status}}==1 or {{receiptDetail' value.status}}==6 --> 

+ 22 - 13
protected/view/admin/saeaStaffCollectB.html

@@ -1,5 +1,7 @@
 <!-- include 'header' -->
-<script src="<?= WEB_SITE_GLOBAL ?>js/receipt.js"></script>
+<script type="text/javascript" src="<?= receipt ?>"></script>
+<script type="text/javascript" >
+</script>
 <body>
 	<div class="mainLayout">
 		<div class="mainMenu">
@@ -32,23 +34,30 @@
 	  					
 	  					<select onchange="javascript:location.href=this.value;">
 	<option value="/staffCollect">全年</option>
-	<option value="/staffCollectMonthDetail/{{year}}/1">1月</option>
-	<option value="/staffCollectMonthDetail/{{year}}/2">2月</option>
-	<option value="/staffCollectMonthDetail/{{year}}/3">3月</option>
-	<option value="/staffCollectMonthDetail/{{year}}/4">4月</option>
-	<option value="/staffCollectMonthDetail/{{year}}/5">5月</option>
-	<option value="/staffCollectMonthDetail/{{year}}/6">6月</option>
-	<option value="/staffCollectMonthDetail/{{year}}/7">7月</option>
-	<option value="/staffCollectMonthDetail/{{year}}/8">8月</option>
-	<option value="/staffCollectMonthDetail/{{year}}/9">9月</option>
-	<option value="/staffCollectMonthDetail/{{year}}/10">10月</option>
-	<option value="/staffCollectMonthDetail/{{year}}/11">11月</option>
-	<option value="/staffCollectMonthDetail/{{year}}/12">12月</option>
+	<option value="/staffCollectMonthDetail/{{year}}/1/{{nature}}">1月</option>
+	<option value="/staffCollectMonthDetail/{{year}}/2/{{nature}}">2月</option>
+	<option value="/staffCollectMonthDetail/{{year}}/3/{{nature}}">3月</option>
+	<option value="/staffCollectMonthDetail/{{year}}/4/{{nature}}">4月</option>
+	<option value="/staffCollectMonthDetail/{{year}}/5/{{nature}}">5月</option>
+	<option value="/staffCollectMonthDetail/{{year}}/6/{{nature}}">6月</option>
+	<option value="/staffCollectMonthDetail/{{year}}/7/{{nature}}">7月</option>
+	<option value="/staffCollectMonthDetail/{{year}}/8/{{nature}}">8月</option>
+	<option value="/staffCollectMonthDetail/{{year}}/9/{{nature}}">9月</option>
+	<option value="/staffCollectMonthDetail/{{year}}/10/{{nature}}">10月</option>
+	<option value="/staffCollectMonthDetail/{{year}}/11/{{nature}}">11月</option>
+	<option value="/staffCollectMonthDetail/{{year}}/12/{{nature}}">12月</option>
 	</select>
 	  					
 	  					
 	  </li>
 
+	  			<li><select name="nature" id="Y" onchange="receiptYear();">
+	  					<option <!-- if {{nature}}=='ONJOB' --> selected <!-- endif --> value="ONJOB" >在职</option>
+	<option <!-- if {{nature}}=='LEAVEJOB' --> selected <!-- endif --> value="LEAVEJOB">离职</option>
+	  					</select> 		
+	  					
+	  </li>
+
 	<li>报销总计:¥{{stList.rePrice}}</li>
 	<li>同意支付:<span class="colGreen">¥{{stList.agPrice}}</span></li>
 	<li>审批中:¥{{stList.skPrice}}</li>

+ 3 - 1
protected/view/admin/saea_create.html

@@ -40,10 +40,12 @@
 	  						<tr><th colspan="2" class="taC">日常相关费用</th></tr>
 	  						<!-- loop acItem -->
 		  						<!-- if {{acItem' value.category}} =="日常相关费用" -->
-		  						<tr>
+		  						
+		  						<tr <!-- if {{acItem' value.name}}=='市内出租费' --> style="display:none" <!-- endif --> >
 		  						<th>{{acItem' value.name}}</th>
 		  						<td  width="200" class="taR">¥<input type="number" id="agency_{{acItem' value.aid}}" name="agency[]" value="0" placeholder="输入{{acItem' value.name}}" pattern="[0-9]" step="0.01" min="0" class="span2">
 		  						</td></tr>
+		  						
 		  						<!-- endif -->
 	  						<!-- endloop -->
 	  						<tr><th class="taR">合计</th><td class="colGreen taR" id="agencyResult">¥0.00</td></tr>

+ 1 - 1
protected/view/admin/saea_edit.html

@@ -42,7 +42,7 @@
 	  						<tr><th colspan="2" class="taC">日常相关费用</th></tr>
 	  						<!-- loop acItem -->
 		  						<!-- if {{acItem' value.category}} =="日常相关费用" -->
-		  						<tr>
+		  						<tr <!-- if {{acItem' value.name}}=='市内出租费' --> style="display:none" <!-- endif --> >
 		  						<th>{{acItem' value.name}}</th>
 		  						<td  width="200" class="taR">
 		  						¥<input type="number" <!-- if !empty({{acItem' value.price}}) --> value="{{acItem' value.price}}" <!-- else --> value="0" <!-- endif --> id="agency_{{acItem' value.aid}}" name="agency[]"  placeholder="输入{{acItem' value.name}}" pattern="[0-9]" step="0.01" min="0" class="span2">

+ 10 - 2
protected/view/admin/staffCollectMonthDetail.html

@@ -1,5 +1,5 @@
 <!-- include 'header' -->
-<script src="<?= WEB_SITE_GLOBAL ?>js/receipt.js"></script>
+<script type="text/javascript" src="<?= receipt ?>"></script>
 <link rel=stylesheet href="<?= WEB_SITE_GLOBAL ?>css/fixedheadertable.css"> 
 <script src="<?= WEB_SITE_GLOBAL ?>js/jquery.fixedheadertable.js"></script>
 <body>
@@ -31,7 +31,15 @@
 	  					</select> 
 	  					 <select name="month" id="M" onchange="receiptYear();">
 		{{monthHtml}}
-	</select> <a target="_blank" href="/staffCollectMonthDetail2/{{year}}/{{month}}">导出</a></li>
+	</select> 
+	
+	<select name="nature" id="Y" onchange="receiptYear();">
+	  					<option <!-- if {{nature}}=='ONJOB' --> selected <!-- endif --> value="ONJOB" >在职</option>
+	<option <!-- if {{nature}}=='LEAVEJOB' --> selected <!-- endif --> value="LEAVEJOB">离职</option>
+	  					</select> 	
+	
+	
+	<a target="_blank" href="/staffCollectMonthDetail2/{{year}}/{{month}}">导出</a></li>
 	  					<li><b>{{month}}月</b>报销总计:¥{{stList.rePrice}}</li>
 	  					<li><b>{{month}}月</b>同意支付:<span class="colGreen">¥{{stList.agPrice}}</span></li>
 	  					<li><b>{{month}}月</b>审批中:¥{{stList.skPrice}}</li>

+ 1 - 1
protected/view/header.html

@@ -9,7 +9,7 @@
 	<script src="<?= WEB_SITE_GLOBAL ?>js/jquery-1.7.2.min.js"></script>
 	<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>js/jquery.infinitescroll.min.js"></script> 
 	<script src="<?= WEB_SITE_GLOBAL ?>js/global.js"></script>
-	<!-- if !isset({{noindexjs}}) --><script src="<?= WEB_SITE_GLOBAL ?>js/index.js?20170316"></script><!-- endif -->
+	<!-- if !isset({{noindexjs}}) --><script src="<?= index ?>"></script><!-- endif -->
 </head>
 
 <!-- if isStaffCompleteMsg() -->