Bläddra i källkod

收款入账发票

caipin 7 år sedan
förälder
incheckning
6cb546e0c4

+ 32 - 0
global/js/invoice.js

@@ -268,6 +268,38 @@ $(function() {
 		});
 	});
 	
+	
+	$("a[node-invoiceReceivables='INFO']").click(function() {
+		var postData = $(this).attr("data-isKey");
+		
+		var po='IRTC';
+		
+		$("div[loading-msg='true']").html("<img src='/global/img/loadIco.gif' />");
+		var url = "/ajaxGetInvoiceInfoByType";
+		$.ajax({
+			url : url,
+			type : "post",
+			cache : false,
+			dataType : "json",
+			data : {
+				serial : postData,
+				type:po
+			},
+			global : true,
+			success : function(data) {
+				if (data.status == 1) {
+					$("div[loading-msg='true']").html("");
+					$("#inKey").val(data.iidKey);
+					$("#irtc").html(data.html);
+				} else
+					$("div[loading-msg='true']").html("illegal request");
+			},
+			error : function(err) {
+				$("div[loading-msg='true']").html("");
+			}
+		});
+	});
+	
 	$("a[node-invoice='INFO']").click(function() {
 		var postData = $(this).attr("data-isKey");
 		var type =$(this).attr("data-type");

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

@@ -6,13 +6,13 @@ $acl ['ordinary'] ['allow'] = array (
 				'invoiceAddDo',
 				'invoiceMyReceivables',
 				'invoiceReceivablesClaim',
-				'invoiceEnterReceivables',
+				
 				'invoiceReceivablesAscription',
 				'invoiceBindReceivables',
 				'invoiceDroppedDo',
 				'invoiceEdit',
 				'invoiceEditDo',
-				'invoiceUntreadDo',
+				
 				'invoiceDelDo',
 				'invoiceAchieve',
 				'invoiceReceivablesAchieve',
@@ -21,11 +21,19 @@ $acl ['ordinary'] ['allow'] = array (
 				'ajaxGetInvoicePostDetail',
 				'ajaxGetInvoiceByStaff',
 				'ajaxCompareInvoicePrice',
+				
+				
+				
+				//删除核销相关操作
+				//'invoiceUntreadDo',
 				'ajaxGetReceivalblesByStaff',
-				'ajaxCompareClaimPrice',
-				'ajaxReceivablesRemove'
+				//'ajaxCompareClaimPrice',
+				//'ajaxReceivablesRemove'
+				//'invoiceEnterReceivables',
+				
 		) 
 );
+
 $acl ['收款管理'] ['allow'] = array (
 		'InvoiceController' => array (
 				'invoiceReceivables',
@@ -34,7 +42,9 @@ $acl ['收款管理'] ['allow'] = array (
 				'invoiceReceivablesDelete',
 				'invoiceReceivablesAS',
 				'ajaxGetStaffByCategory',
-				'ajaxGetInvoiceReceivablesByStaff'
+				'ajaxGetInvoiceReceivablesByStaff',
+				//新加入账相关权限
+				'invoiceCompareClaimPrice'
 		) 
 );
 $acl ['发票审批'] ['allow'] = array (

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

@@ -375,11 +375,11 @@ $route['get']['/invoiceDelDo/:iid'] = array('InvoiceController', 'invoiceDelDo',
 $route['get']['/invoiceMyReceivables'] = array('InvoiceController', 'invoiceMyReceivables');
 
 $route['get']['/invoiceReceivablesClaim'] = array('InvoiceController', 'invoiceReceivablesClaim');
-$route['post']['/invoiceEnterReceivables'] = array('InvoiceController', 'invoiceEnterReceivables');
+
 
 $route['post']['/invoiceReceivablesAscription'] = array('InvoiceController', 'invoiceReceivablesAscription');
 $route['post']['/invoiceBindReceivables'] = array('InvoiceController', 'invoiceBindReceivables');
-$route['post']['/invoiceUntreadDo'] = array('InvoiceController', 'invoiceUntreadDo');
+
 
 $route['get']['/invoiceAchieve'] = array('InvoiceController', 'invoiceAchieve');
 $route['get']['/invoiceAchieve/:page'] = array('InvoiceController', 'invoiceAchieve');
@@ -395,9 +395,17 @@ $route['post']['/ajaxGetInvoiceInfoByType'] = array('InvoiceController', 'ajaxGe
 $route['post']['/ajaxGetInvoiceReceivables'] = array('InvoiceController', 'ajaxGetInvoiceReceivables');
 $route['post']['/ajaxGetInvoiceByStaff'] = array('InvoiceController', 'ajaxGetInvoiceByStaff');
 $route['post']['/ajaxCompareInvoicePrice'] = array('InvoiceController', 'ajaxCompareInvoicePrice');
+
+
+
+
+//删除核销相关操作
+$route['post']['/invoiceUntreadDo'] = array('InvoiceController', 'invoiceUntreadDo');
 $route['post']['/ajaxGetReceivalblesByStaff'] = array('InvoiceController', 'ajaxGetReceivalblesByStaff');
 $route['post']['/ajaxCompareClaimPrice'] = array('InvoiceController', 'ajaxCompareClaimPrice');
 $route['post']['/ajaxReceivablesRemove'] = array('InvoiceController', 'ajaxReceivablesRemove');
+$route['post']['/invoiceEnterReceivables'] = array('InvoiceController', 'invoiceEnterReceivables');
+
 //发票审批
 $route['*']['/invoiceApproval'] = array('InvoiceController', 'invoiceApproval');
 $route['*']['/invoiceDetail/:iid'] = array('InvoiceController', 'invoiceDetail','extension'=>'.html');
@@ -439,7 +447,9 @@ $route['get']['/invoiceUntreadAchieve/:page/:date'] = array('InvoiceController',
 $route['get']['/invoiceUntreadAchieve/:page/:date/:MebSea'] = array('InvoiceController', 'invoiceTAchieve');
 
 //收款管理
-$route['get']['/invoiceReceivables'] = array('InvoiceController', 'invoiceReceivables');
+$route['*']['/invoiceReceivables'] = array('InvoiceController', 'invoiceReceivables');
+
+
 $route['post']['/invoiceReceivablesDo'] = array('InvoiceController', 'invoiceReceivablesDo');
 $route['post']['/invoiceReceivablesUpdateClaim'] = array('InvoiceController', 'invoiceReceivablesUpdateClaim');
 $route['post']['/invoiceReceivablesDelete'] = array('InvoiceController', 'invoiceReceivablesDelete');
@@ -453,6 +463,12 @@ $route['get']['/invoiceReceivablesAS/:page/:status'] = array('InvoiceController'
 $route['get']['/invoiceReceivablesAS/:page/:status/:year'] = array('InvoiceController', 'invoiceReceivablesAS');
 $route['get']['/invoiceReceivablesAS/:page/:status/:year/:month'] = array('InvoiceController', 'invoiceReceivablesAS');
 $route['get']['/invoiceReceivablesAS/:page/:status/:year/:month/:MebSea'] = array('InvoiceController', 'invoiceReceivablesAS');
+//收款管理新加路由
+$route['post']['/invoiceCompareClaimPrice'] = array('InvoiceController', 'invoiceCompareClaimPrice');
+
+
+
+
 //公司汇总查阅
 $route['*']['/invoiceAggregate'] = array('InvoiceController', 'invoiceAggregate');
 $route['*']['/invoiceAggregateStaff'] = array('InvoiceController', 'invoiceAggregateStaff');

+ 4 - 0
protected/controller/AuthenticationController.php

@@ -27,6 +27,9 @@ class AuthenticationController extends DooController {
 			$staffInfo=$staff->getOne(array ('where' => "username= '".$longleInfo['responsible']."'",'asArray' => TRUE));
 			$productCount=explode('+', $longleInfo['product']);
 			
+			
+			
+			$list['product']=strtr($longleInfo['product'],"+","  ");
 			$list['productCount']=count($productCount);
 			$list['key_num']=$key;
 			$list['telephone']=$staffInfo['telephone'];
@@ -69,6 +72,7 @@ class AuthenticationController extends DooController {
 			$staffInfo=$staff->getOne(array ('where' => "username= '".$longleInfo['responsible']."'",'asArray' => TRUE));
 			$productCount=explode('+', $longleInfo['product']);
 			
+			$list['product']=strtr($longleInfo['product'],"+","  ");
 			$list['productCount']=count($productCount);
 			$list['key_num']=$longleInfo['key_num'];
 			$list['telephone']=$staffInfo['telephone'];

+ 332 - 8
protected/controller/InvoiceController.php

@@ -543,8 +543,8 @@ class InvoiceController extends DooController {
 						'recipients' => $recipients,
 						'recipientsPhone' => $recipientsPhone,
 						'recipientsAddress' => $recipientsAddress,
-						'mailItems' => $mailString ,
-						'mailItemsJson'=>json_encode($mailList)
+						'mailItems' => $mailString,
+						'mailItemsJson' => json_encode ( $mailList ) 
 				);
 			}
 			$invoice->setInvoiceByCondition ( $item );
@@ -599,7 +599,7 @@ class InvoiceController extends DooController {
 		return "/invoice";
 	}
 	/**
-	 * 申请退票
+	 * 申请退票 --需求变更 废弃
 	 */
 	function invoiceUntreadDo() {
 		$untreadIidKey = $this->get_args ( 'untreadIidKey' ) ? $this->get_args ( 'untreadIidKey' ) : '';
@@ -1147,19 +1147,45 @@ class InvoiceController extends DooController {
 		return "/invoiceUntread";
 	}
 	function invoiceReceivables() {
+		$invoiceTC = $this->get_args ( 'invoiceTC' ) ? $this->get_args ( 'invoiceTC' ) : '';
+		
 		Doo::loadModel ( 'L_category' );
 		$lCategory = new L_category ();
 		Doo::loadModel ( 'staff' );
 		$staff = new staff ();
 		Doo::loadModel ( 'invoiceReceivables' );
 		$invoiceReceivables = new invoiceReceivables ();
+		Doo::loadModel ( 'invoice' );
+		$invoice = new invoice ();
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
 		
 		$category = $lCategory->getCategory ();
 		$staffList = $staff->getStaffByCid ( $this->staff [0] ['cid'] );
 		
 		$receivablesList = $invoiceReceivables->getInvoiceReceivablesByNew ();
-		// print_r($receivablesList);
+		// 获取未入账发票
+		$invoiceUnAccount = $invoice->getInvoiceByUnAccount ( $invoiceTC );
+		
+		foreach ( $invoiceUnAccount as $key => $value ) {
+			$invoiceUnAccount [$key] ['iidKey'] = $XDeode->encode ( $value ['iid'] );
+			
+			$lastApprover = json_decode ( $value ['processApprovals'], true );
+			if (! empty ( $lastApprover )) {
+				$lastApproverKey = array_keys ( $lastApprover );
+				$lastApprover = end ( $lastApprover );
+				
+				$staffDetail = $staff->getOne ( array (
+						'where' => 'sid=' . end ( $lastApproverKey ),
+						'asArray' => true 
+				) );
+				$lastApprover ['username'] = $staffDetail ['username'];
+			}
+			$invoiceUnAccount [$key] ['lastApprover'] = $lastApprover;
+		}
 		
+		$this->data ['year'] = date ( 'Y' );
+		$this->data ['invoiceUnAccount'] = $invoiceUnAccount;
 		$this->data ['receivablesList'] = $receivablesList;
 		$this->data ['staffList'] = $staffList;
 		$this->data ['category'] = $category;
@@ -1171,6 +1197,119 @@ class InvoiceController extends DooController {
 	}
 	
 	/**
+	 * 新添加收款直接入账发票
+	 */
+	function invoiceCompareClaimPrice() {
+		// 收款录入
+		$iidKey = $this->get_args ( 'iidKey' ) ? $this->get_args ( 'iidKey' ) : "";
+		
+		$receivablesPrice = $this->get_args ( 'receivablesPrice' ) ? $this->get_args ( 'receivablesPrice' ) : "";
+		$receivablesMessage = $this->get_args ( 'receivablesMessage' ) ? $this->get_args ( 'receivablesMessage' ) : "";
+		$receivablesBank = $this->get_args ( 'receivablesBank' ) ? $this->get_args ( 'receivablesBank' ) : "";
+		$receivablesDate = $this->get_args ( 'receivablesDate' ) ? $this->get_args ( 'receivablesDate' ) : "";
+		
+		if (! empty ( $receivablesPrice ) && ! empty ( $receivablesMessage ) && ! empty ( $receivablesBank ) && ! empty ( $receivablesDate ) && ! empty ( $iidKey )) {
+			Doo::loadModel ( 'invoiceReceivables' );
+			$invoiceReceivables = new invoiceReceivables ();
+			Doo::loadModel ( 'invoiceROLog' );
+			$invoiceROLog = new invoiceROLog ();
+			Doo::loadModel ( 'invoiceStatistics' );
+			$invoiceStatistics = new invoiceStatistics ();
+			Doo::loadModel ( 'invoice' );
+			$invoice = new invoice ();
+			Doo::loadClass ( 'XDeode' );
+			$XDeode = new XDeode ( 5 );
+			Doo::loadModel ( 'invoiceOperationLog' );
+			$invoiceOperationLog = new invoiceOperationLog ();
+			
+			$iidKey = $XDeode->decode ( $iidKey );
+			
+			$invoiceDetail = $invoice->getInvoiceByIid ( $iidKey );
+			$receivablesSerial="#SK" . date ( "Ymd" ) . mt_rand ( 1000, 9999 );
+			
+			// 收款录入
+			$item = array (
+					'receivablesPrice' => $receivablesPrice,
+					'receivablesMessage' => $receivablesMessage,
+					'receivablesSerial' => $receivablesSerial,
+					'receivablesBank' => $receivablesBank,
+					'receivablesDate' => $receivablesDate,
+					'inputStaff' => $this->staff [0] ['username'],
+					'date' => date ( "Y-m-d" ),
+					'receivablesCategory' => $invoiceDetail ['cid'] . ':' . $invoiceDetail ['categoryName'],
+					'receivablesStaff' => $invoiceDetail ['sid'] . '-' . $invoiceDetail ['userName'],
+					'confirmTime' => date ( "Y-m-d H:i:s" ) 
+			);
+			
+			$irid = $invoiceReceivables->addInvoiceReceivables ( $item );
+			
+			$item = array ();
+			// 收款操作日志
+			$item = array (
+					'operation' => $this->staff [0] ['username'] . " 转入 " . $invoiceDetail ['userName'] 
+			);
+			$item += array (
+					'date' => date ( "Y-m-d" ),
+					'status' => 1,
+					'img' => $this->staff [0] ['avatar'],
+					'username' => $this->staff [0] ['username'],
+					'uid' => $this->staff [0] ['sid'],
+					'category' => $this->staff [0] ['category'],
+					'irid' => $irid 
+			);
+			$invoiceROLog->setInvoiceROLog ( $item );
+			// 收款统计
+			$item = array (
+					'date' => date ( "Y-m-d H:i:s" ),
+					'priceClass' => 2,
+					'irid' => $irid,
+					'cid' => $invoiceDetail ['cid'],
+					'staff' => $invoiceDetail ['sid'],
+					'receivablesPrice' => $receivablesPrice 
+			);
+			$invoiceStatistics->setInvoiceStatisticsByCondition ( $item );
+			
+			// 收款 入 发票
+			$detail = $invoiceDetail;
+			
+			$iridString = "";
+			if (empty ( $detail ['irid'] ))
+				$iridString = $irid;
+			else
+				$iridString = $detail ['irid'] . ',' . $irid;
+			
+			$item = array (
+					'irid' => $iridString,
+					'bindTime' => date ( "Y-m-d H:i:s" ),
+					'updateTime' => date ( "Y-m-d H:i:s" ),
+					'iid' => $detail ['iid'] 
+			);
+			$invoice->setInvoiceByCondition ( $item );
+			
+			// 操作日志
+			$item = array (
+					'date' => date ( "Y-m-d H:i:s" ),
+					'operation' => "收款入账" . $receivablesSerial . "到发票" . $detail ['invoiceSerial'],
+					'status' => 8,
+					'img' => $this->staff [0] ['avatar'],
+					'username' => $this->staff [0] ['username'],
+					'uid' => $this->staff [0] ['sid'],
+					'category' => $this->staff [0] ['category'],
+					'iid' => $detail ['iid'] 
+			);
+			$invoiceOperationLog->setInvoiceOperationLog ( $item );
+		}
+		
+		return '/invoiceReceivables';
+	}
+	
+	/**
+	 * 检索未入账发票数据
+	 */
+	function sir() {
+	}
+	
+	/**
 	 * 录入收款数据
 	 * @return string
 	 */
@@ -1527,7 +1666,7 @@ class InvoiceController extends DooController {
 	}
 	
 	/**
-	 * 发票收款完成
+	 * 发票收款完成--需求更变 废弃
 	 */
 	function invoiceEnterReceivables() {
 		$invoiceKey = $this->get_args ( 'key' ) ? $this->get_args ( 'key' ) : "";
@@ -2009,7 +2148,7 @@ class InvoiceController extends DooController {
 		Doo::loadModel ( 'invoiceReceivables' );
 		$invoiceReceivables = new invoiceReceivables ();
 		
-		$MebSea = isset ( $this->params ['MebSea'] ) ? urldecode ( $this->params ['MebSea'] ) : '';
+		$MebSea = isset ( $this->params ['MebSea'] ) ? addslashes ( urldecode ( $this->params ['MebSea'] ) ) : '';
 		
 		$page_size = 12;
 		$page = isset ( $this->params ['page'] ) && is_numeric ( $this->params ['page'] ) ? $this->params ['page'] : 1;
@@ -2364,6 +2503,10 @@ class InvoiceController extends DooController {
 				'invoiceDetail' => $invoiceDetail 
 		) );
 	}
+	
+	/**
+	 * --需求变更 废弃
+	 */
 	function ajaxCompareClaimPrice() {
 		$irid = $this->get_args ( 'irid' ) ? $this->get_args ( 'irid' ) : "";
 		$invoiceKey = $this->get_args ( 'invoiceKey' ) ? $this->get_args ( 'invoiceKey' ) : "";
@@ -2495,7 +2638,7 @@ class InvoiceController extends DooController {
 	}
 	
 	/**
-	 * 从发票中移除已经入账的收款
+	 * 从发票中移除已经入账的收款 --需求变更 废弃
 	 */
 	function ajaxReceivablesRemove() {
 		$iridKey = $this->get_args ( 'key' ) ? $this->get_args ( 'key' ) : "";
@@ -2660,7 +2803,7 @@ class InvoiceController extends DooController {
 	}
 	
 	/*
-	 * 获得与我有关收款数据
+	 * 获得与我有关收款数据 --需求变更 废弃
 	 */
 	function ajaxGetReceivalblesByStaff() {
 		$iid = $this->get_args ( 'key' ) ? $this->get_args ( 'key' ) : "";
@@ -2942,6 +3085,91 @@ class InvoiceController extends DooController {
 					'html' => $html 
 			) );
 			die ();
+		} elseif ($type == 'IRTC') {
+			
+			Doo::loadModel ( 'invoice' );
+			$invoice = new invoice ();
+			Doo::loadModel ( 'invoiceOperationLog' );
+			$invoiceOperationLog = new invoiceOperationLog ();
+			
+			$detail = $invoice->getInvoiceByIsid ( $serial, $this->staff [0] ['sid'] );
+			$invoiceOperationLogList = $invoiceOperationLog->getInvoiceOperationLogByIid ( $detail ['iid'] );
+			
+			if (empty ( $detail ))
+				$html = '';
+			else {
+				$html = '
+						<table class="table table-bordered table-condensed"><tbody>
+						<tr>
+							<th class="taC" width="150">开票流水号</th><td>' . $detail ['invoiceSerial'] . '</td>
+							<th class="taC" width="150">提交时间</th><td>' . $detail ['date'] . '</td>
+						</tr>
+						<tr>
+							<th class="taC" width="150">所在办事处</th><td>' . $detail ['categoryName'] . '(' . $detail ['userName'] . ')</td>
+							<th class="taC" width="150">备注</th><td>' . $detail ['remark'] . '</td>
+						</tr>
+						<tr>
+							<th class="taC">开票金额</th><td><b class="colOrange" style="font-size:18px">¥' . $detail ['invoicePrice'] . '</b></td>
+							<th class="taC">开票内容</th><td>' . $detail ['invoiceElement'] . '</td>
+						</tr></tbody></table>';
+				
+				if ($detail ['invoiceType'] == 0)
+					$html .= '<table class="table table-bordered table-condensed"><tbody>
+							<tr><th colspan="4" class="taC">增值税普通发票</th></tr><tr>
+							<th class="taC" width="150">发票抬头</th><td >' . $detail ['invoiceTitle'] . '</td>
+							<th class="taC" width="150">纳税人识别码</th><td>' . $detail ['TIN'] . '</td>
+									</tr>';
+				else
+					$html .= '<table class="table table-bordered table-condensed"><tbody>
+							<tr><th colspan="4" class="taC">增值税专用发票</th></tr><tr>
+							<th class="taC" width="150">单位名称</th><td>' . $detail ['invoiceCompany'] . '</td>
+							<th class="taC" width="150">纳税人识别码</th><td>' . $detail ['TIN'] . '</td></tr>
+			
+									';
+				
+				$html .= '<tr>
+							<th class="taC">注册地址</th><td>' . $detail ['address'] . '</td>
+							<th class="taC">注册电话</th><td>' . $detail ['phone'] . '</td>
+						</tr>
+						<tr>
+							<th class="taC">开户银行</th><td>' . $detail ['bankAccount'] . '</td>
+							<th class="taC">银行账户</th><td>' . $detail ['bank'] . '</td>
+						</tr></tbody></table>';
+				
+				if ($detail ['doPost'] == 1)
+					$html .= '<table class="table table-bordered table-condensed"><tbody><tr><th colspan="4" class="taC">邮寄信息</th></tr><tr>
+							<th class="taC" width="150">收件人</th><td>' . $detail ['recipients'] . '</td>
+							<th class="taC" width="150">收件人手机/电话</th><td>' . $detail ['recipientsPhone'] . '</td>
+						</tr><tr>
+							<th class="taC" width="150">收件地址</th><td colspan="3">' . $detail ['recipientsAddress'] . '</td>
+						</tr><tr>
+							<th class="taC" width="150">邮寄物品</th><td colspan="3">' . $detail ['mailItems'] . '</td>
+						</tr></tbody></table>';
+				if (! empty ( $invoiceOperationLogList )) {
+					$html .= '<table class="table table-bordered table-condensed"><tbody><tr><th width="60%" class="taC">审批流程</th></tr><tr><td>';
+					foreach ( $invoiceOperationLogList as $key => $value ) {
+						if ($value ['status'] == 1 || $value ['status'] == 2 || $value ['status'] == 3 || $value ['status'] == 4) {
+							$html .= '<blockquote><p><span class="colGray">' . $value ['date'] . '</span>&nbsp;
+							' . $value ['category'] . '-' . $value ['username'] . '&nbsp;';
+							if ($value ['status'] == 2) {
+								$html .= '<span class="colGreen">同意</span>';
+							} elseif ($value ['status'] == 3) {
+								$html .= '<span class="colOrange">退回</span>';
+							} elseif ($value ['status'] == 5) {
+								$html .= '<span class="colGreen">打印</span>';
+							}
+							$html .= $value ['operation'] . '</p></blockquote>';
+						}
+					}
+					$html .= '</td></tr></tbody></table>';
+				}
+			}
+			echo json_encode ( array (
+					'status' => 1,
+					'html' => $html,
+					'iidKey' => $serial 
+			) );
+			die ();
 		}
 	}
 	function ajaxGetInvoiceReceivablesByStaff() {
@@ -3043,6 +3271,102 @@ class InvoiceController extends DooController {
 		} else
 			return false;
 	}
+	function SafeFilter(&$arr) {
+		$ra = Array (
+				'/([\x00-\x08,\x0b-\x0c,\x0e-\x19])/',
+				'/script/',
+				'/javascript/',
+				'/vbscript/',
+				'/expression/',
+				'/applet/',
+				'/meta/',
+				'/xml/',
+				'/blink/',
+				'/link/',
+				'/style/',
+				'/embed/',
+				'/object/',
+				'/frame/',
+				'/layer/',
+				'/title/',
+				'/bgsound/',
+				'/base/',
+				'/onload/',
+				'/onunload/',
+				'/onchange/',
+				'/onsubmit/',
+				'/onreset/',
+				'/onselect/',
+				'/onblur/',
+				'/onfocus/',
+				'/onabort/',
+				'/onkeydown/',
+				'/onkeypress/',
+				'/onkeyup/',
+				'/onclick/',
+				'/ondblclick/',
+				'/onmousedown/',
+				'/onmousemove/',
+				'/onmouseout/',
+				'/onmouseover/',
+				'/onmouseup/',
+				'/onunload/' 
+		);
+		
+		if (is_array ( $arr )) {
+			foreach ( $arr as $key => $value ) {
+				if (! is_array ( $value )) {
+					if (! get_magic_quotes_gpc ()) // 不对magic_quotes_gpc转义过的字符使用addslashes(),避免双重转义。
+{
+						$value = addslashes ( $value ); // 给单引号(')、双引号(")、反斜线(\)与 NUL(NULL 字符)加上反斜线转义
+					}
+					$value = preg_replace ( $ra, '', $value ); // 删除非打印字符,粗暴式过滤xss可疑字符串
+					$arr [$key] = htmlentities ( strip_tags ( $value ) ); // 去除 HTML 和 PHP 标记并转换为 HTML 实体
+				} else {
+					SafeFilter ( $arr [$key] );
+				}
+			}
+		}
+	}
+	
+	/**
+	 * Escape String
+	 *
+	 * @access public
+	 * @param string
+	 * @param bool whether or not the string will be used in a LIKE condition
+	 * @return string
+	 */
+	function escape_str($str, $like = FALSE) {
+		if (is_array ( $str )) {
+			foreach ( $str as $key => $val ) {
+				$str [$key] = $this->escape_str ( $val, $like );
+			}
+			return $str;
+		}
+		
+		var_dump ( Doo::db ()->getDbObject () );
+		die ();
+		
+		if (function_exists ( 'mysql_real_escape_string' ) and is_resource ( Doo::db ()->getDbObject () )) { // Doo::db ()->getDbObject()
+			$str = mysql_real_escape_string ( $str, Doo::db ()->getDbObject () );
+		} elseif (function_exists ( 'mysql_escape_string' )) {
+			$str = mysql_escape_string ( $str );
+		} else {
+			$str = addslashes ( $str );
+		}
+		// escape LIKE condition wildcards
+		if ($like === TRUE) {
+			$str = str_replace ( array (
+					'%',
+					'_' 
+			), array (
+					'\\%',
+					'\\_' 
+			), $str );
+		}
+		return $str;
+	}
 	
 	/**
 	 * 获得分页数据

+ 3 - 0
protected/controller/MainController.php

@@ -54,6 +54,9 @@ class MainController extends DooController {
 	);
 	public $webPath = "http://cld.smartcost.com.cn/upload/emailAnnex/";
 	function __construct() {
+		
+		//phpinfo();die;
+		
 		// include './protected/config/common.conf.php';
 		// include $config['BASE_PATH'].'diagnostic/debug.php';
 		if (isset ( $_COOKIE ["staff"] )) {

+ 28 - 100
protected/controller/ReceiptController.php

@@ -31,29 +31,6 @@ class ReceiptController extends DooController {
 		fclose ( $fp );
 	}
 	
-	// private function getExeCount(){
-	// Doo::loadModel('receipt');
-	// $receipt=new receipt();
-	// $receiptList=$receipt->find(array('where'=>'(executeCopy like \'%["'.$this->staff[0]['sid'].'%\' and executeStaff NOT LIKE \'%'.$this->staff[0]['sid'].'%\' ) and (status=1 or status=6)','desc'=>'rid','asArray'=>true));
-	
-	// return count($receiptList);
-	// }
-	
-	// private function getReceiptCount(){
-	
-	// $status=2;
-	// $year=date('Y');
-	
-	// Doo::loadModel('receipt');
-	// $receipt=new receipt();
-	
-	// $dateCondition=" and Year(date) =".$year;
-	
-	// $approvalCondition=' and (nowStaff like "%,'.$this->staff[0]['sid'].'%" or nowStaff like "%'.$this->staff[0]['sid'].',%" or nowStaff='.$this->staff[0]['sid'].' ) ';
-	// $receiptList=$receipt->find(array('where'=>' status='.$status.$dateCondition.$approvalCondition,'desc'=>'rid','asArray'=>true));
-	
-	// return count($receiptList);
-	// }
 	private function collectHtml($receiptCollectList = array(), $itemCategory = "日常相关费用", $classType = "b") {
 		$collectHtml = "";
 		$sumPrice = 0.00;
@@ -3590,8 +3567,10 @@ class ReceiptController extends DooController {
 					'asArray' => true 
 			) );
 			
-			if (empty ( $receiptDetail ))
-				return "/approval";
+			
+			
+			if (empty ( $receiptDetail )||$receiptDetail['nowStaff']!=$this->staff['0']['sid'])
+				return "/approvalExpenses/pendApproval";
 			
 			$verifyDetail = $verify->getOne ( array (
 					'where' => ' vid =' . $receiptDetail ['verify'],
@@ -3957,6 +3936,8 @@ class ReceiptController extends DooController {
 				$loanReceipt->status = 1;
 				$loanReceipt->pastDate = date ( "Y-m-d" );
 				
+				$loanReceipt->amount = $receiptDetail ['amount'];
+				
 				$loanReceipt->update ( array (
 						'where' => ' rid = ' . $receiptDetail ['loanRid'] 
 				) );
@@ -4600,7 +4581,6 @@ class ReceiptController extends DooController {
 					'asArray' => true 
 			) );
 			$verifyList = json_decode ( $verifyList ['staff'], true ); // status opinion
-			
 			$verifyStaff = json_decode ( $value ['verifyStaff'], true );
 			
 			Doo::loadModel ( 'role' );
@@ -4612,13 +4592,10 @@ class ReceiptController extends DooController {
 			$roleArrayCopy = array ();
 			foreach ( $verifyList as $k => $v ) {
 				// init verifyStaff
-				
 				if ($v [1] == 'ROLE') {
-					
 					if (! empty ( $verifyStaff )) {
 						$endStaffArray = end ( $verifyStaff );
 					}
-					
 					$roleVerify = json_decode ( $v [3], true );
 					$roleKey = $k;
 					$roleArray = array ();
@@ -4746,7 +4723,7 @@ class ReceiptController extends DooController {
 				elseif ($value ['status'] == 3)
 					$htmlLoan .= '<li class="undone" >';
 				
-				$htmlLoan .= '<div class="avtra"><img src="' . $value [2] . '_2.jpg"></div>';
+				$htmlLoan .= '<div class="avtra"><img width="32" src="' . $value [2] . '_2.jpg"></div>';
 				$htmlLoan .= '<div class="comment"><p class="colGray">' . $value ['1'] . '<span class="fR">' . $value ['date'] . '</span>';
 				if (isset ( $value ['rolename'] ))
 					$htmlLoan .= $value ['rolename'];
@@ -4755,7 +4732,8 @@ class ReceiptController extends DooController {
 			$data ['loanDate'] = $loanList [0] ['date'];
 		}
 		$data ['htmlLoan'] = $htmlLoan;
-		
+		$data['loanReceiptDate']=$loanList [0] ['date'];
+		//$data ['LoanReceipt']=$loanList[0];
 		// print_r($loanList);
 		
 		$Locate = 0;
@@ -4993,10 +4971,10 @@ class ReceiptController extends DooController {
 		
 		$data ['enclosurHtml'] = $enclosurHtml;
 		$data ['rolename'] = $rolename ['name'];
-		// $data['datetij']=$tijdate['date'];
+		
 		$data ['mothHtml'] = $mothHtml;
 		
-		// print_r($receiptList);
+		 //print_r($receiptList);
 		$data ['rid'] = $rid;
 		$data ['tijdate'] = $tijdate ['date'];
 		$data ['receiptList'] = $receiptList;
@@ -6342,70 +6320,7 @@ class ReceiptController extends DooController {
 		$dateCondition = " and Year(date) =" . $dateArray [0] . " and Month(date) = " . $dateArray [1];
 		
 		$accountItem = json_decode ( $receiptDetailList ['accountItem'], true );
-		// print_r($accountItem['cSum']['agencySum']);die;
-		// foreach ($accountItem['cSum'] as $key=>$value){
-		// if($key=="agencySum"){
-		// $iStatistics=$itemStatistics->getOne(array('where'=>'staff='.$this->staff[0]['sid'].' and itemCategory="'.$this->AGENCY.'"'.$dateCondition,'asArray'=>true));
-		// if(empty($iStatistics)){
-		// $itemStatistics->cid=$this->staff[0]['cid'];
-		// $itemStatistics->staff=$this->staff[0]['sid'];
-		// $itemStatistics->price=$value;
-		// $itemStatistics->itemCategory=$this->AGENCY;
-		// $itemStatistics->date=date("Y-m-d");
-		// $itemStatistics->insert();
-		// }else{
-		// if (!empty($value)){
-		// $itemStatistics->price=$value+$iStatistics['price'];
-		// $itemStatistics->update(array('where'=>'sid='.$iStatistics['sid']));
-		// }
-		// }
-		// }elseif($key=="travelSum"){
-		// $iStatistics=$itemStatistics->getOne(array('where'=>'staff='.$this->staff[0]['sid'].' and itemCategory="'.$this->TRAVEL.'"'.$dateCondition,'asArray'=>true));
-		// if(empty($iStatistics)){
-		// $itemStatistics->cid=$this->staff[0]['cid'];
-		// $itemStatistics->staff=$this->staff[0]['sid'];
-		// $itemStatistics->price=$value;
-		// $itemStatistics->itemCategory=$this->TRAVEL;
-		// $itemStatistics->date=date("Y-m-d");
-		// $itemStatistics->insert();
-		// }else{
-		// if (!empty($value)){
-		// $itemStatistics->price=$value+$iStatistics['price'];
-		// $itemStatistics->update(array('where'=>'sid='.$iStatistics['sid']));
-		// }
-		// }
-		// }elseif($key=="trainSum"){
-		// $iStatistics=$itemStatistics->getOne(array('where'=>'staff='.$this->staff[0]['sid'].' and itemCategory="'.$this->TRAIN.'"'.$dateCondition,'asArray'=>true));
-		// if(empty($iStatistics)){
-		// $itemStatistics->cid=$this->staff[0]['cid'];
-		// $itemStatistics->staff=$this->staff[0]['sid'];
-		// $itemStatistics->price=$value;
-		// $itemStatistics->itemCategory=$this->TRAIN;
-		// $itemStatistics->date=date("Y-m-d");
-		// $itemStatistics->insert();
-		// }else{
-		// if (!empty($value)){
-		// $itemStatistics->price=$value+$iStatistics['price'];
-		// $itemStatistics->update(array('where'=>'sid='.$iStatistics['sid']));
-		// }
-		// }
-		// }elseif($key=="otherSum"){
-		// $iStatistics=$itemStatistics->getOne(array('where'=>'staff='.$this->staff[0]['sid'].' and itemCategory="'.$this->OTHER.'"'.$dateCondition,'asArray'=>true));
-		// if(empty($iStatistics)){
-		// $itemStatistics->cid=$this->staff[0]['cid'];
-		// $itemStatistics->staff=$this->staff[0]['sid'];
-		// $itemStatistics->price=$value;
-		// $itemStatistics->itemCategory=$this->OTHER;
-		// $itemStatistics->date=date("Y-m-d");
-		// $itemStatistics->insert();
-		// }else{
-		// if (!empty($value)){
-		// $itemStatistics->price=$value+$iStatistics['price'];
-		// $itemStatistics->update(array('where'=>'sid='.$iStatistics['sid']));
-		// }
-		// }
-		// }
-		// }
+		
 		
 		$stat = $statistics->getOne ( array (
 				'where' => 'staff=' . $this->staff [0] ['sid'] . $dateCondition,
@@ -9600,6 +9515,9 @@ class ReceiptController extends DooController {
 			$r13 = 0;
 			$r14 = 0;
 			$r15 = 0;
+			$r16=0;
+			$r17=0;
+			$r18=0;
 			$c1 = 0;
 			$c2 = 0;
 			$c3 = 0;
@@ -9661,7 +9579,11 @@ class ReceiptController extends DooController {
 								'广告费',
 								'团队建设费',
 								'物业管理费',
-								'宽带费' 
+								'宽带费',
+								'人员薪酬',
+								'公积金',
+								'社保'
+								
 						);
 						foreach ( $item as $va ) {
 							$falg = true;
@@ -9697,6 +9619,12 @@ class ReceiptController extends DooController {
 											$r14 += $v ['price'];
 										if ($va == '宽带费')
 											$r15 += $v ['price'];
+										if ($va == '公积金')
+											$r16 += $v ['price'];
+										if ($va == '社保')
+											$r17 += $v ['price'];
+										if ($va == '人员薪酬')
+											$r18 += $v ['price'];
 										$psum += $v ['price'];
 										$html .= '<td class="taR">' . $v ['price'] . '</td>';
 										$falg = false;
@@ -9886,7 +9814,7 @@ class ReceiptController extends DooController {
 					} else {
 						$receiptL ['日常相关费用'] = '<td class="colGreen taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td>
 		  						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td>
-		  						<td class="taR">-</td><td class="taR">-</td>';
+		  						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td>';
 						$receiptL ['差旅相关费用'] = '<td class="colGreen taR">-</td><td class="taR">-</td>
 		  						<td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td>';
 						$receiptL ['培训班费用'] = '<td class="colGreen taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td><td class="taR">-</td>
@@ -9912,7 +9840,7 @@ class ReceiptController extends DooController {
 			}
 			$receiptL ['日常相关费用'] = '<td class="colGreen taR">' . $r12 . '</td><td class="taR">' . $r1 . '</td><td class="taR">' . $r2 . '</td><td class="taR">' . $r3 . '</td><td class="taR">' . $r4 . '</td><td class="taR">' . $r5 . '</td>
 		  						<td class="taR">' . $r6 . '</td><td class="taR">' . $r7 . '</td><td class="taR">' . $r8 . '</td><td class="taR">' . $r9 . '</td><td class="taR">' . $r10 . '</td><td class="taR">' . $r11 . '</td><td class="taR">' . $r13 . '</td>
-		  						<td class="taR">' . $r14 . '</td><td class="taR">' . $r15 . '</td>';
+		  						<td class="taR">' . $r14 . '</td><td class="taR">' . $r15 . '</td><td class="taR">' . $r18 . '</td> <td class="taR">' . $r16 . '</td><td class="taR">' . $r17 . '</td>';
 			$receiptL ['差旅相关费用'] = '<td class="colGreen taR">' . $c6 . '</td><td class="taR">' . $c1 . '</td>
 		  						<td class="taR">' . $c2 . '</td><td class="taR">' . $c3 . '</td><td class="taR">' . $c4 . '</td><td class="taR">' . $c5 . '</td>';
 			$receiptL ['培训班费用'] = '<td class="colGreen taR">' . $p9 . '</td><td class="taR">' . $p1 . '</td><td class="taR">' . $p2 . '</td><td class="taR">' . $p3 . '</td><td class="taR">' . $p4 . '</td>

+ 28 - 5
protected/model/invoice.php

@@ -260,11 +260,11 @@ class invoice extends DooModel {
 			$express = explode ( ":", $Detail ['expressCompany'] );
 			$Detail ['expressCompany'] = $express [0];
 			$Detail ['expressCom'] = $express [1];
-		}else{
+		} else {
 			$Detail ['expressCompany'] = '';
 			$Detail ['expressCom'] = '';
 		}
-			
+		
 		$Detail ['iidKey'] = $this->authcode ( $Detail ['iid'], '' );
 		Doo::loadModel ( 'L_category' );
 		$lCategory = new L_category ();
@@ -393,7 +393,8 @@ class invoice extends DooModel {
 			}
 			
 			$list ['handleInvoice'] = $this->find ( array (
-					'where' => "(status=3 or status=4 or (status=2 and printStatus=1 and untreadStatus=0 ) or (status=2 and printStatus=1 and untreadStatus=2 )  )  and isDelete=0 and sid=" . $sid,
+					// 需求变更 -去除出票状态的数据 or (status=2 and printStatus=1 and untreadStatus=0 ) or (status=2 and printStatus=1 and untreadStatus=2 )
+					'where' => "(status=3 or status=4 or ((status=2 and printStatus=1 and untreadStatus=0 ) or status=2 and printStatus=1 and untreadStatus=2 )  )  and isDelete=0 and sid=" . $sid,
 					'desc' => 'iid',
 					'asArray' => TRUE 
 			) );
@@ -408,6 +409,29 @@ class invoice extends DooModel {
 	}
 	
 	/**
+	 * 获得所有未入账发票
+	 * @param number $invoiceTC 发票title
+	 */
+	public function getInvoiceByUnAccount($invoiceTC='') {
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		
+		$title="";
+		if (!empty($invoiceTC))
+			$title=' and (invoiceTitle like "%'.$invoiceTC.'%" or invoiceCompany like "%'.$invoiceTC.'%" )';
+		
+		$list = $this->find ( array (
+				'where' => "status=2 and printStatus=1 and untreadStatus=0 and irid=''  and isDelete=0 ".$title,
+				'desc' => 'iid',
+				'asArray' => TRUE 
+		));
+		foreach ( $list as $key => $value ) {
+			$list [$key] ['iidKeyUrl'] = $XDeode->encode ( $value ['iid'] );
+		}
+		return $list;
+	}
+	
+	/**
 	 * 获得与我有关可收款的发票,已经出票的发票
 	 * @param number $sid 开票人ID
 	 */
@@ -534,7 +558,6 @@ class invoice extends DooModel {
 		Doo::loadModel ( 'invoiceOperationLog' );
 		$invoiceOperationLog = new invoiceOperationLog ();
 		
-		
 		foreach ( $list as $key => $value ) {
 			$list [$key] ['iidKey'] = $this->authcode ( $value ['iid'], '' );
 			$list [$key] ['iidKeyK'] = $XDeode->encode ( $value ['iid'] );
@@ -548,7 +571,7 @@ class invoice extends DooModel {
 			}
 			
 			$list [$key] ['irList'] = $invoiceReceivables->getInvoiceReceivablesInIridString ( $value ['irid'] );
-			$list [$key] ['operationLog'] = $invoiceOperationLog->getInvoiceOperationLogByIid( $value ['iid'], 'desc' );
+			$list [$key] ['operationLog'] = $invoiceOperationLog->getInvoiceOperationLogByIid ( $value ['iid'], 'desc' );
 			$list [$key] ['OperationLog'] = $invoiceOperationLog->getInvoiceOperationByStatus ( $value ['iid'], 6 );
 			$list [$key] ['sumPrice'] = 0;
 			if (! empty ( $list [$key] ['irList'] ))

+ 2 - 1
protected/model/invoiceReceivables.php

@@ -190,7 +190,8 @@ class invoiceReceivables extends DooModel {
 	public function getInvoiceReceivablesByIrid($irid = "", $con = "") {
 		Doo::loadClass ( 'XDeode' );
 		$XDeode = new XDeode ( 5 );
-		$irid = $this->authcode ( $irid );
+		if (!is_numeric($irid))
+			$irid = $this->authcode ( $irid );
 		$detail = array ();
 		if (! empty ( $irid ) && is_numeric ( $irid ))
 			$detail = $this->getOne ( array (

+ 2 - 1
protected/model/loanReceipt.php

@@ -31,12 +31,13 @@ class loanReceipt extends DooModel {
    	
     public $explanation;
     public $notice;
+    public $amount;
     
     public $_table = 'CLD_loanReceipt';
     public $_primarykey = 'rid';
     
     public $_fields = array('aid', 'accountItem', 'staff', 'sum', 'date','pastDate' ,'cid', 'status', 'reviseDetail', 'revisePrice', 'verify','verifyStaff',
-    'nowStaff','receiptOrder','explanation','notice','Rtype','loanItem','verifyBreakup');
+    'nowStaff','receiptOrder','explanation','notice','Rtype','loanItem','verifyBreakup','amount');
 
 	function receiptByYear($year,$sid){
     	//

+ 9 - 1
protected/view/admin/invoiceMyReceivables.html

@@ -34,6 +34,12 @@
 
 							</table>
 						</div>
+						
+						
+						
+						
+						
+						
 						<div class="clearfix">
 							
 							<legend><div class="fR"></div>待入账</legend>
@@ -53,7 +59,9 @@
 									{{myClaim' value.username}} 认领  {{myClaim' value.confirmTime}}
 									<!-- endif -->
 									</td>
-									<td width=""><a class="button btn-green  btn-block" data-key="{{myClaim' value.iidKey}}" node-recording="true" href="#recorded" data-toggle="modal">收款入账</a></td>
+									<td width="">
+<a class="button btn-green  btn-block" data-key="{{myClaim' value.iidKey}}" node-recording="true" href="#recorded" data-toggle="modal">收款入账</a>
+									</td>
 								</tr>
 								<!-- endloop -->
 								

+ 160 - 1
protected/view/admin/invoiceReceivables.html

@@ -25,8 +25,100 @@
 				<div class="borad-menu">
 					<a href="#inputbill" data-toggle="modal" class="invoice">录入收款</a>
 				</div>
+				
+				
 				<div class="borad-news">
 					<div class="saeaList">
+					
+						<div class="clearfix">
+							<legend><div class="fR"><a href="/invoiceReceivablesAS/1/Unclaimed/{{year}}/All/">查看所有</a></div>未入账发票</legend>
+							<div class="input-append">
+							<form action="/invoiceReceivables" id="ira" method="post">
+									<input name="invoiceTC" class="datepicker-here span6" placeholder="输入开票单位查询" data-range="true" data-multiple-dates-separator=" - " data-language="zh" type="text">
+									
+								<input type="submit" value="查询" class="btn btn-small">
+									
+							</form>
+							</div>
+							<table class="table table-bordered table-condensed">
+								<thead><tr><th>开票单位(抬头)</th><th>开票金额</th><th>提交开票</th><th>出票</th><th>开票流水号</th><th width="80">入账</th></tr></thead>
+								<tbody>
+								<!-- loop invoiceUnAccount -->
+									<tr>
+									<td><!-- if !empty({{invoiceUnAccount' value.invoiceType}}) -->
+	                                   	{{invoiceUnAccount' value.invoiceCompany}}
+	                                    <!-- else -->
+	                                    {{invoiceUnAccount' value.invoiceTitle}}
+	                                    <!-- endif -->
+	                                    </td>
+									<td>
+										<!-- if !empty({{invoiceUnAccount' value.invoiceType}}) -->
+	                                    <b>¥{{invoiceUnAccount' value.invoicePrice}}</b><sup>专</sup>
+	                                    <!-- else -->
+	                                    <b>¥{{invoiceUnAccount' value.invoicePrice}}</b>
+	                                    <!-- endif -->
+									</td>
+									<td>{{invoiceUnAccount' value.categoryName}}{{invoiceUnAccount' value.userName}} {{invoiceUnAccount' value.date}}</td>
+									<td>{{invoiceUnAccount' value.lastApprover.username}}&nbsp;{{invoiceUnAccount' value.printTime}}</td>
+									<td>
+									<a href="#invdetail" node-invoice='INFO' data-isKey="{{invoiceUnAccount' value.iidKeyUrl}}" data-toggle="modal">{{invoiceUnAccount' value.invoiceSerial}}</a>
+									</td>
+									<td><a class="button btn-block" href="#recorded" node-invoiceReceivables='INFO' data-isKey="{{invoiceUnAccount' value.iidKeyUrl}}" data-toggle="modal">入账</a></td>
+									</tr>
+									<!-- endloop -->
+								</tbody>
+							</table>
+						</div>
+					
+					
+					
+					<div class="clearfix">
+							<legend><div class="fR"><a href="/invoiceReceivablesAS/1/Unclaimed/{{year}}/All/">查看所有</a></div>最近认领&amp;录入</legend>
+							<table class="table table-bordered table-condensed">
+								<tbody>
+								<tr><th class="taC" width="70">收款金额</th><th class="taC">银行到帐信息</th><th class="taC">银行/到帐时间</th><th class="taC">收款录入</th><th class="taC">收款认领</th><th class="taC">开票单位</th><th class="taC" width="80">绑定发票</th></tr>
+								<tr>
+									<td><b>¥3000.00</b></td>
+									<td>张宇</td>
+									<td>广发银行珠海分行柠溪支行<br>2016-03-03</td>
+									<td>张少珊 2016-03-03<br>公共待认领款项</td>
+									<td>总部-陈特<br>2016-03-03</td>
+									<td>珠海XXX公司</td>
+									<td><a class="button btn-block" href="#search-invoice" data-toggle="modal">查询发票</a></td>
+								</tr>
+								<tr>
+									<td><b>¥3000.00</b></td>
+									<td>张宇</td>
+									<td>广发银行珠海分行柠溪支行<br>2016-03-03</td>
+									<td>张少珊 2016-03-03<br>公共待认领款项</td>
+									<td>广东办-刘飞<br>2016-03-0</td>
+									<td>珠海XXX公司</td>
+									<td><a class="button btn-block" href="#search-invoice" data-toggle="modal">查询发票</a></td>
+								</tr>
+								<tr>
+									<td><b>¥3000.00</b></td>
+									<td>张宇</td>
+									<td>广发银行珠海分行柠溪支行<br>2016-03-03</td>
+									<td>张少珊 2016-03-03<br>公共待认领款项</td>
+									<td> </td>
+									<td> </td>
+									<td></td>
+								</tr>
+								<tr>
+									<td><b>¥3000.00</b></td>
+									<td>张宇</td>
+									<td>广发银行珠海分行柠溪支行<br>2016-03-03</td>
+									<td>张少珊 2016-03-03<br>办事处待认领款项</td>
+									<td>广东办-刘飞<br>2016-03-03</td>
+									<td>珠海XXX公司</td>
+									<td><a class="button btn-block" href="#search-invoice" data-toggle="modal">查询发票</a></td>
+								</tr>
+								</tbody>
+							</table>
+							<blockquote><p class="colGray">暂时没有已认领的收款</p></blockquote>
+						</div>
+					
+					
 						<div class="clearfix">
 							<!-- if !empty({{receivablesList}}) -->
 							<legend><div class="fR"><a href="/invoiceReceivablesAS">查看更多</a></div>最近入账</legend>
@@ -55,6 +147,72 @@
 		</div>
 	</div>
 
+<!--弹出(发票详情)-->
+	<div class="modal  fade" id="invdetail">
+		
+		<div id="nc"></div>
+	</div>
+	<!--弹出发票详情-->
+	
+	
+	
+	<div class="modal hide fade" id="recorded">
+	<div class="modal-dialog modal-lg">
+		<div class="modal-content">
+		
+		<form action="/invoiceCompareClaimPrice" method="post" name="receivablesInvoice">
+			<input type="hidden" name="iidKey" id="inKey" value="">
+			<div class="modal-header">
+				<h3>发票入账</h3>
+			</div>
+			<div class="modal-body saeaList">
+			
+				<table class="table table-bordered table-condensed">
+					<tbody>
+					<tr>
+						<th class="taC" colspan="4">收款信息填写</th>
+					</tr>
+					<tr>
+						<th class="taC">收款金额</th><td><input  name="receivablesPrice" placeholder="输入开票金额" pattern="[0-9]" min="0" step="0.01" type="number"></td>
+					</tr>
+					<tr>
+						<th class="taC">收款信息</th><td><input type="text" name="receivablesMessage"  ></td>
+					</tr>
+					<tr>
+						<th class="taC">收款银行</th><td>
+						<select name="receivablesBank">
+								<option>广发银行珠海分行柠溪支行</option>
+							</select>
+							</td>
+					</tr>
+					<tr>
+						<th class="taC">银行到帐时间</th><td><input name="receivablesDate"  type="date"></td>
+					</tr>
+					</tbody>
+				</table>
+				
+				
+				<div id="irtc"></div>
+				
+				
+				
+				
+			</div>
+			<div class="modal-footer">
+				<input type="submit" class="button"  value="确认入账">
+				
+				<a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
+			</div>
+			
+		</form>
+			
+		</div>
+	</div>
+</div>
+	
+	
+	
+	
 	
 	<!--弹出(录入收款)-->
 	<div class="modal hide fade" id="inputbill">
@@ -86,7 +244,8 @@
 							<th class="taC">收款银行</th><td>
 							<select name="receivablesBank">
 								<option>广发银行珠海分行柠溪支行</option>
-							</select></td>
+							</select>
+							</td>
 						</tr>
 						<tr>
 							<th class="taC">银行到帐时间</th>

+ 27 - 3
protected/view/admin/receiptburEdi.html

@@ -27,7 +27,7 @@
 				<div class="demandCate">
 				<input type="hidden" name="status" value="{{receiptList.0.status}}"></input>
 					<ul class="cateList">
-						<li><a href="/approvalExpenses/{{receiptList.0.status}}">返回</a></li>
+						<li><a href="/approvalExpenses/pendApproval">返回</a></li>
 						<li><a id="examine" data="{{rid}}" href="javascript:void(0)">查看下一份费用审批</a></li>
 	  			</ul>
 	  		</div>
@@ -59,7 +59,13 @@
 							</tr><tr><td colspan="2">{{receiptDetail' value.explanation}}</td></tr>
 							
 							<tr class="warning"><td class="taR"><b>({{receiptDetail' value.receiptOrder}})本次费用合计</b></td>
-							<td class="taR"><b style="font-size:24px">¥{{receiptDetail' value.loanSum}}</b><br>{{receiptDetail' value.loanSumCN}}</td></tr>
+							<td class="taR"><b style="font-size:24px">¥{{receiptDetail' value.loanSum}}</b><br>{{receiptDetail' value.loanSumCN}}</td>
+							</tr>
+							
+							<tr class="warning" style="display:none"><td class="taR"><b>确认汇款金额</b></td>
+							<td class="taR"><b style="font-size:24px">¥{{receiptDetail' value.loanSum}}</b><br>{{receiptDetail' value.loanSumCN}}</td>
+							</tr>
+							
 							</tbody>
 						</table>
 				
@@ -243,14 +249,32 @@
 		  					<div class="censorList clearfix censorHeight">
 		  					<ul>
 		  					
+		  					<!-- if {{receiptList' value.Rtype}}==1 -->
+		  					<li class="post" >
+		  							<div class="avtra"><img src="{{receiptList' value.staffDetail.avatar}}_2.jpg" width="32"></div>
+		  							<div class="comment">
+		  								<p><span class="fR">{{loanReceiptDate}}</span>{{receiptList' value.staffDetail.username}}</p>
+		  								<p>提交审批</p>
+		  							</div>
+		  						</li>
+		  					
+		  					{{htmlLoan}}
 		  					
+		  					<!-- endif -->
 		  					
 		  					
 		  						<!-- if {{empty(receiptDetail' value.rlList)}} -->
 		  						<li class="post" >
 		  							<div class="avtra"><img src="{{receiptList' value.staffDetail.avatar}}_2.jpg" width="32"></div>
 		  							<div class="comment">
-		  								<p><span class="fR">{{tijdate}}</span>{{receiptList' value.staffDetail.username}}</p>
+		  								<p><span class="fR">
+		  								<!-- if {{receiptList' value.Rtype}}==1 -->
+		  								{{receiptList' value.date}}
+		  								
+		  								<!-- else -->
+		  								{{tijdate}}
+		  								<!-- endif -->
+		  								</span>{{receiptList' value.staffDetail.username}}</p>
 		  								<p>提交审批</p>
 		  							</div>
 		  						</li>

+ 6 - 1
protected/view/admin/staffCollectMonthDetail.html

@@ -49,7 +49,7 @@
 	  						<th class="taC" rowspan="3">员工/费用项</th>
 	  						<th class="taC" rowspan="3">{{year}}年{{month}}月费用合计</th>
 	  						
-	  						<th class="taC" colspan="15">日常相关费用</th>
+	  						<th class="taC" colspan="18">日常相关费用</th>
 	  						<th class="taC" colspan="6">差旅相关费用</th>
 	  						<th class="taC" colspan="9">培训班费用</th>
 	  						<th class="taC" colspan="5">其他</th>
@@ -71,6 +71,11 @@
 	  						<th class="taC">团队建设费</th>
 	  						<th class="taC">物业管理费</th>
 	  						<th class="taC">宽带费</th>
+	  						<th class="taC">人员薪酬</th>
+	  						
+	  						
+	  						<th class="taC">公积金</th>
+	  						<th class="taC">社保</th>
 	  						
 	  						<th class="taC">合计</th>
 	  						<th class="taC">往来交通费</th>