Selaa lähdekoodia

审批分页相关功能

caipin 8 vuotta sitten
vanhempi
commit
b5efd64c26

+ 46 - 2
global/js/invoice.js

@@ -355,9 +355,14 @@ $(function() {
 			success : function(data) {
 				if (data.status == 1) {
 					
-					$("input[name='claimuKey']").val(postData);
-					$("select[html-rcategory]").html(data.categoryHtml);
+					$("input[name='receivablesPrice']").val(data.detail.receivablesPrice);
+					$("input[name='receivablesMessage']").val(data.detail.receivablesMessage);
+					$("input[name='receivablesDate']").val(data.detail.receivablesDate);
+					
+					$("select[html-rbank]").html(data.rbankHtml);
 					
+					$("input[id='claimuKey']").val(postData);
+					$("select[html-rcategory]").html(data.categoryHtml);
 					$("select[html-rstaff]").html(data.staffHtml);
 				} else
 					$("div[loading-msg='categoryStaff']").html("illegal request");
@@ -368,4 +373,43 @@ $(function() {
 		});
 	});
 	
+	
+	$("a[node-irDelete]").click(function() {
+		
+		var postData = $(this).attr("data-isKey");
+		$("input[id='claimdKey']").val(postData);
+		
+		//$("div[loading-msg='true']").html("<img src='/global/img/loadIco.gif' />");
+//		var url = "/ajaxGetInvoiceReceivablesByStaff";
+//		$.ajax({
+//			url : url,
+//			type : "post",
+//			cache : false,
+//			dataType : "json",
+//			data : {
+//				postData : postData
+//			},
+//			global : true,
+//			success : function(data) {
+//				if (data.status == 1) {
+//					
+//					$("input[name='receivablesPrice']").val(data.detail.receivablesPrice);
+//					$("input[name='receivablesMessage']").val(data.detail.receivablesMessage);
+//					$("input[name='receivablesDate']").val(data.detail.receivablesDate);
+//					
+//					$("select[html-rbank]").html(data.rbankHtml);
+//					
+//					$("input[id='claimuKey']").val(postData);
+//					$("select[html-rcategory]").html(data.categoryHtml);
+//					$("select[html-rstaff]").html(data.staffHtml);
+//				} else
+//					$("div[loading-msg='categoryStaff']").html("illegal request");
+//			},
+//			error : function(err) {
+//				$("div[loading-msg='true']").html("");
+//			}
+//		});
+	});
+	
+	
 })

+ 3 - 1
protected/config/acl.conf.php

@@ -31,6 +31,7 @@ $acl ['收款管理'] ['allow'] = array (
 				'invoiceReceivables',
 				'invoiceReceivablesDo',
 				'invoiceReceivablesUpdateClaim',
+				'invoiceReceivablesDelete',
 				'invoiceReceivablesAS',
 				'ajaxGetStaffByCategory',
 				'ajaxGetInvoiceReceivablesByStaff'
@@ -40,7 +41,8 @@ $acl ['发票审批'] ['allow'] = array (
 		'InvoiceController' => array (
 				'invoiceApproval',
 				'invoiceDetail',
-				'invoiceApprovalDo' 
+				'invoiceApprovalDo',
+				'invoiceApprovalAchieve'
 		) 
 );
 $acl ['发票打印'] ['allow'] = array (

+ 6 - 2
protected/config/routes.conf.php

@@ -387,12 +387,17 @@ $route['post']['/ajaxReceivablesRemove'] = array('InvoiceController', 'ajaxRecei
 $route['*']['/invoiceApproval'] = array('InvoiceController', 'invoiceApproval');
 $route['*']['/invoiceDetail/:iid'] = array('InvoiceController', 'invoiceDetail','extension'=>'.html');
 $route['*']['/invoiceApprovalDo'] = array('InvoiceController', 'invoiceApprovalDo');
+$route['get']['/invoiceApprovalAchieve'] = array('InvoiceController', 'invoiceApprovalAchieve');
+$route['get']['/invoiceApprovalAchieve/:page'] = array('InvoiceController', 'invoiceApprovalAchieve');
+$route['get']['/invoiceApprovalAchieve/:page/:date'] = array('InvoiceController', 'invoiceApprovalAchieve');
+$route['get']['/invoiceApprovalAchieve/:page/:date/:MebSea'] = array('InvoiceController', 'invoiceApprovalAchieve');
 
 //发票打印
 $route['*']['/invoicePrint'] = array('InvoiceController', 'invoicePrint');
 $route['*']['/invoicePrintDetail/:iid'] = array('InvoiceController', 'invoicePrintDetail','extension'=>'.html');
 $route['*']['/invoicePrintDo'] = array('InvoiceController', 'invoicePrintDo');
 
+
 //发票邮寄
 $route['*']['/invoicePost'] = array('InvoiceController', 'invoicePost');
 $route['*']['/invoiceExpressAddDo'] = array('InvoiceController', 'invoiceExpressAddDo');
@@ -405,11 +410,11 @@ $route['post']['/invoiceUntreadEstablishedDo'] = array('InvoiceController', 'inv
 $route['get']['/invoiceReceivables'] = array('InvoiceController', 'invoiceReceivables');
 $route['post']['/invoiceReceivablesDo'] = array('InvoiceController', 'invoiceReceivablesDo');
 $route['post']['/invoiceReceivablesUpdateClaim'] = array('InvoiceController', 'invoiceReceivablesUpdateClaim');
+$route['post']['/invoiceReceivablesDelete'] = array('InvoiceController', 'invoiceReceivablesDelete');
 
 $route['post']['/ajaxGetStaffByCategory'] = array('InvoiceController', 'ajaxGetStaffByCategory');
 $route['post']['/ajaxGetInvoiceReceivablesByStaff'] = array('InvoiceController', 'ajaxGetInvoiceReceivablesByStaff');
 
-
 $route['get']['/invoiceReceivablesAS'] = array('InvoiceController', 'invoiceReceivablesAS');
 $route['get']['/invoiceReceivablesAS/:page'] = array('InvoiceController', 'invoiceReceivablesAS');
 $route['get']['/invoiceReceivablesAS/:page/:status'] = array('InvoiceController', 'invoiceReceivablesAS');
@@ -421,7 +426,6 @@ $route['*']['/invoiceAggregate'] = array('InvoiceController', 'invoiceAggregate'
 $route['*']['/invoiceAggregateStaff'] = array('InvoiceController', 'invoiceAggregateStaff');
 $route['*']['/invoiceAggregateCategory/:cid'] = array('InvoiceController', 'invoiceAggregateCategory');
 
-
 //假期管理
 $route['*']['/myList'] = array('HolidayController', 'myList');
 $route['*']['/myList/:yearnum'] = array('HolidayController', 'myList');

+ 113 - 14
protected/controller/InvoiceController.php

@@ -110,7 +110,8 @@ class InvoiceController extends DooController {
 		
 		// $list = $invoiceReceivables->getInvoiceReceivablesByClaim ( $this->staff [0] ['cid'], $this->staff [0] ['sid'] );
 		
-		$list = $invoice->getInvoiceByUntreadStatusPage ( 4, $_COOKIE ["staff"] );
+		$sql = 'status=2 and untreadStatus=3 and sid=' . $_COOKIE ["staff"];
+		$list = $invoice->getInvoiceByUntreadStatusPage ( 4, $sql );
 		
 		// print_r($list);
 		
@@ -480,7 +481,7 @@ class InvoiceController extends DooController {
 		if (! empty ( $iid ) && ! is_numeric ( $iid ))
 			die ( 'illegal request' );
 		
-		$lt = $invoiceReceivables->getInvoiceReceivablesByIid ( $iid );
+		$lt = $invoiceReceivables->getInvoiceReceivablesByIid ( $untreadIidKey );
 		
 		if (! empty ( $lt )) {
 			header ( 'Content-Type:text/html;charset=utf-8' );
@@ -1037,7 +1038,7 @@ class InvoiceController extends DooController {
 			
 			$irid = $invoiceReceivables->addInvoiceReceivables ( $item );
 			
-			$item=array();
+			$item = array ();
 			// 收款操作日志
 			if ($receivablesCategory == 'PUBLIC' && $receivablesStaff == 'PUBLIC')
 				$item = array (
@@ -1125,23 +1126,19 @@ class InvoiceController extends DooController {
 		$invoiceReceivables = new invoiceReceivables ();
 		Doo::loadModel ( 'invoiceROLog' );
 		$invoiceROLog = new invoiceROLog ();
-		$con = ' and iid=0 and receivablesCategory!="PUBLIC" and receivablesStaff!="PUBLIC"';
+		$con = ' and iid=0 and bindStatus=0'; // and receivablesCategory!="PUBLIC" and receivablesStaff!="PUBLIC"
 		$detail = $invoiceReceivables->getInvoiceReceivablesByIrid ( $claimKey, $con );
 		if (empty ( $detail ))
 			die ( 'illegal request' );
 		
 		$invoiceReceivables = new invoiceReceivables ();
 		
-		/*
-		 * 'receivablesPrice' => $receivablesPrice, 'receivablesMessage' => $receivablesMessage, 'receivablesSerial' => "#SK" . date ( "Ymd" ) . mt_rand ( 1000, 9999 ), 'receivablesBank' => $receivablesBank, 'receivablesDate' => $receivablesDate, 'inputStaff' => $this->staff [0] ['username'], 'date' => date ( "Y-m-d" ), 'receivablesCategory' => $receivablesCategory, 'receivablesStaff' => $receivablesStaff
-		 */
-		
 		$item = array (
 				'irid' => $detail ['irid'] 
 		);
 		if ($receivablesCategory != 'PUBLIC' && $receivablesStaff != 'PUBLIC') {
 			$item += array (
-					'confirmTime' => date ( "Y-m-d H:i:s" )
+					'confirmTime' => date ( "Y-m-d H:i:s" ) 
 			);
 		}
 		if (! empty ( $receivablesCategory ))
@@ -1152,10 +1149,26 @@ class InvoiceController extends DooController {
 			$item += array (
 					'receivablesStaff' => $receivablesStaff 
 			);
+		if (! empty ( $receivablesPrice ))
+			$item += array (
+					'receivablesPrice' => $receivablesPrice 
+			);
+		if (! empty ( $receivablesMessage ))
+			$item += array (
+					'receivablesMessage' => $receivablesMessage 
+			);
+		if (! empty ( $receivablesBank ))
+			$item += array (
+					'receivablesBank' => $receivablesBank 
+			);
+		if (! empty ( $receivablesDate ))
+			$item += array (
+					'receivablesDate' => $receivablesDate 
+			);
 		$invoiceReceivables->setInvoiceReceivablesByCondition ( $item );
 		
 		// 收款操作日志
-		$item=array();
+		$item = array ();
 		if ($receivablesCategory == 'PUBLIC' && $receivablesStaff == 'PUBLIC')
 			$item = array (
 					'operation' => $this->staff [0] ['username'] . " 转入 公共待认领款项 " 
@@ -1183,6 +1196,23 @@ class InvoiceController extends DooController {
 		
 		return '/invoiceReceivablesAS';
 	}
+	function invoiceReceivablesDelete() {
+		$claimKey = $this->get_args ( 'claimKey' ) ? $this->get_args ( 'claimKey' ) : "";
+		
+		if (empty ( $claimKey ))
+			die ( 'illegal request' );
+		
+		Doo::loadModel ( 'invoiceReceivables' );
+		$invoiceReceivables = new invoiceReceivables ();
+		
+		$con = ' and iid=0 and bindStatus=0 and receivablesStaff="PUBLIC"';
+		$detail = $invoiceReceivables->getInvoiceReceivablesByIrid ( $claimKey, $con );
+		if (empty ( $detail ))
+			die ( 'illegal request' );
+		
+		$invoiceReceivables->delInvoiceReceivablesByIrid ( $detail ['irid'] );
+		return '/invoiceReceivablesAS';
+	}
 	
 	/**
 	 * 管理员录入的收款 ,确认认领到谁的名下.统计收款金额
@@ -1741,7 +1771,7 @@ class InvoiceController extends DooController {
 		
 		$limit = $pageinfo ['lower'] . ',' . $page_size;
 		
-		$list = $invoice->getInvoiceByUntreadStatusPage ( $limit, $_COOKIE ["staff"], $con );
+		$list = $invoice->getInvoiceByUntreadStatusPage ( $limit, $sql );
 		// print_r($pageinfo);
 		$this->data ['MebSeaEn'] = $MebSea;
 		$this->data ['MebSea'] = urlencode ( $MebSea );
@@ -1857,6 +1887,53 @@ class InvoiceController extends DooController {
 		$this->data ['receiptMemu'] = 'invoiceReceivables';
 		$this->render ( "/admin/invoiceReceivablesAS", $this->data );
 	}
+	function invoiceApprovalAchieve() {
+		Doo::loadModel ( 'invoice' );
+		$invoice = new invoice ();
+		
+		
+		$MebSea = isset ( $this->params ['MebSea'] ) ? urldecode ( $this->params ['MebSea'] ) : '';
+		
+		$page_size = 2;
+		$page = isset ( $this->params ['page'] ) && is_numeric ( $this->params ['page'] ) ? $this->params ['page'] : 1;
+		$date = isset ( $this->params ['date'] ) ? $this->params ['date'] : 'MONTHO';
+		
+		$get = "/" . $date;
+		
+		$con = '';
+		if ($date == 'MONTHO')
+			$con = ' and updateTime>DATE_SUB(CURDATE(), INTERVAL 1 MONTH)';
+		elseif ($date == 'MONTHT')
+			$con = ' and updateTime>DATE_SUB(CURDATE(), INTERVAL 3 MONTH)';
+		elseif ($date == 'MONTHY')
+			$con = ' and updateTime>DATE_SUB(CURDATE(), INTERVAL 1 YEAR)';
+		
+		if (! empty ( $MebSea )) {
+			$con .= ' and ( invoiceTitle like "%' . $MebSea . '%" or invoiceCompany like "%' . $MebSea . '%" or invoicePrice like "%' . $MebSea . '%" )';
+			$get .= "/" . $MebSea;
+		}
+		$pageinfo ['page'] = array (
+				'previous' => '' 
+		);
+		$sql = '(status=1 or status=3 or status=4) and processApprovals!=""'. $con;
+		$pageinfo = $this->get_page ( "CLD_invoice", $sql, $page, $page_size, "invoiceApprovalAchieve", $get, "" );
+		
+		$limit = $pageinfo ['lower'] . ',' . $page_size;
+		
+		$list = $invoice->getInvoiceByUntreadStatusPage ( $limit, $sql );
+	//print_r($list);
+		$this->data ['MebSeaEn'] = $MebSea;
+		$this->data ['MebSea'] = urlencode ( $MebSea );
+		$this->data ['get'] = $get;
+		$this->data ['page'] = $pageinfo;
+		$this->data ['list'] = $list;
+		$this->data ['date'] = $date;
+		
+		$this->data ['memu'] = "invoice";
+		$this->data ['staff'] = $this->staff;
+		$this->data ['receiptMemu'] = 'invoiceApproval';
+		$this->render ( "/admin/invoiceApprovalAchieve", $this->data );
+	}
 	
 	/**
 	 * 获得与我有关可收款的发票
@@ -2467,8 +2544,12 @@ class InvoiceController extends DooController {
 		if ($type == 'INVOICE') {
 			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 {
@@ -2511,7 +2592,22 @@ class InvoiceController extends DooController {
 						</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){
+						$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>';	
+				}
 				$html .= '</div><div class="modal-footer"><a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a></div></div></div>';
 			}
 			echo json_encode ( array (
@@ -2595,11 +2691,14 @@ class InvoiceController extends DooController {
 				$staffHtml .= '<option selected value="' . $value ['sid'] . '-' . $value ['username'] . '">' . $value ['category'] . '-' . $value ['username'] . '</option>';
 		}
 		
+		$rbankHtml = '<option value="广发银行珠海分行柠溪支行">广发银行珠海分行柠溪支行</option>';
+		
 		echo json_encode ( array (
 				'status' => 1,
 				'categoryHtml' => $categoryHtml,
-				'staffHtml' => $staffHtml ,
-				'detail'=>$detail
+				'staffHtml' => $staffHtml,
+				'rbankHtml' => $rbankHtml,
+				'detail' => $detail 
 		) );
 	}
 	function _GetFileEXT($filename) {

+ 7 - 3
protected/model/invoice.php

@@ -515,12 +515,12 @@ class invoice extends DooModel {
 		}
 		return $list;
 	}
-	function getInvoiceByUntreadStatusPage($limit = 0, $sid = 0, $con = "", $desc = 'desc') {
-		if (empty ( $limit ) || empty ( $sid ))
+	function getInvoiceByUntreadStatusPage($limit = 0, $con = "", $desc = 'desc') {
+		if (empty ( $limit ) || empty ( $con ))
 			return array ();
 		
 		$list = $this->find ( array (
-				'where' => " status=2 and untreadStatus=3 and sid=" . $sid.$con,
+				'where' => $con,
 				'limit' => $limit,
 				$desc => 'iid',
 				'asArray' => TRUE 
@@ -529,10 +529,14 @@ class invoice extends DooModel {
 		$XDeode = new XDeode ( 5 );
 		Doo::loadModel ( 'invoiceReceivables' );
 		$invoiceReceivables = new invoiceReceivables ();
+		Doo::loadModel ( 'invoiceOperationLog' );
+		$invoiceOperationLog = new invoiceOperationLog ();
+		
 		
 		foreach ( $list as $key => $value ) {
 			$list [$key] ['iidKeyK'] = $XDeode->encode ( $value ['iid'] );
 			$list [$key] ['irList'] = $invoiceReceivables->getInvoiceReceivablesInIridString ( $value ['irid'] );
+			$list [$key] ['operationLog'] = $invoiceOperationLog->getInvoiceOperationLogByIid( $value ['iid'], 'desc' );
 			$list [$key] ['sumPrice'] = 0;
 			if (! empty ( $list [$key] ['irList'] ))
 				$list [$key] ['sumPrice'] = $list [$key] ['irList'] [0] ['sumPrice'];

+ 56 - 51
protected/model/invoiceReceivables.php

@@ -140,16 +140,18 @@ class invoiceReceivables extends DooModel {
 		$iid = $this->authcode ( $iid );
 		$list = array ();
 		if (! empty ( $iid ) && is_numeric ( $iid )) {
+			
 			$sql = '';
 			if ($bindStatus == 1)
 				$sql = " and bindStatus=1";
-			elseif ($bindStatus == 0)
+			elseif ($bindStatus === 0)
 				$sql = " and bindStatus=0";
 			$list = $this->find ( array (
 					'where' => " iid=" . $iid . $sql,
 					'asArray' => TRUE 
 			) );
 		}
+		
 		foreach ( $list as $key => $value ) {
 			$list [$key] ['iidKey'] = $this->authcode ( $value ['irid'], '' );
 			$staff = explode ( "-", $value ['receivablesStaff'] );
@@ -167,16 +169,16 @@ class invoiceReceivables extends DooModel {
 					'asArray' => TRUE 
 			) );
 		
-		$price=0;
-		$serial=0;
+		$price = 0;
+		$serial = 0;
 		Doo::loadClass ( 'XDeode' );
 		$XDeode = new XDeode ( 5 );
-		foreach ($list as $key=>$value){
-			$price+=$value['receivablesPrice'];
+		foreach ( $list as $key => $value ) {
+			$price += $value ['receivablesPrice'];
 			$list [$key] ['iridKeyK'] = $XDeode->encode ( $value ['irid'] );
 		}
-		if (!empty($list))
-			$list[0]['sumPrice']=$price;
+		if (! empty ( $list ))
+			$list [0] ['sumPrice'] = $price;
 		return $list;
 	}
 	/**
@@ -185,20 +187,22 @@ class invoiceReceivables extends DooModel {
 	 * @param string $con 附加获取收款条件 可以为空
 	 * @return unknown[]|mixed[]|string[]
 	 */
-	public function getInvoiceReceivablesByIrid($irid = "",$con="") {
+	public function getInvoiceReceivablesByIrid($irid = "", $con = "") {
 		Doo::loadClass ( 'XDeode' );
 		$XDeode = new XDeode ( 5 );
 		$irid = $this->authcode ( $irid );
 		$detail = array ();
 		if (! empty ( $irid ) && is_numeric ( $irid ))
 			$detail = $this->getOne ( array (
-					'where' => " irid=" . $irid.$con,
+					'where' => " irid=" . $irid . $con,
 					'asArray' => TRUE 
 			) );
 		
+		if (empty($detail))
+			return $detail;
 		$detail ['cid'] = '';
 		$detail ['title'] = '';
-		if ($detail ['receivablesCategory']!="PUBLIC"){
+		if ($detail ['receivablesCategory'] != "PUBLIC") {
 			$category = explode ( ":", $detail ['receivablesCategory'] );
 			$detail ['cid'] = $category [0];
 			$detail ['title'] = $category [1];
@@ -206,7 +210,7 @@ class invoiceReceivables extends DooModel {
 		
 		$detail ['sid'] = '';
 		$detail ['username'] = '';
-		if ($detail ['receivablesStaff']!="PUBLIC"){
+		if ($detail ['receivablesStaff'] != "PUBLIC") {
 			$staff = explode ( "-", $detail ['receivablesStaff'] );
 			$detail ['sid'] = $staff [0];
 			$detail ['username'] = $staff [1];
@@ -216,9 +220,6 @@ class invoiceReceivables extends DooModel {
 		$detail ['iridEn'] = $this->authcode ( $detail ['irid'], '' );
 		return $detail;
 	}
-	
-	
-	
 	public function getInvoiceReceivablesByIrsid($irid = "", $sid = "") {
 		Doo::loadClass ( 'XDeode' );
 		$XDeode = new XDeode ( 5 );
@@ -281,55 +282,59 @@ class invoiceReceivables extends DooModel {
 	 * @return unknown
 	 */
 	public function getInvoiceReceivablesInIrid($irid = '') {
-		if (empty($irid))
-			return array();
+		if (empty ( $irid ))
+			return array ();
 		
 		$list = $this->find ( array (
 				'where' => " irid in(" . $irid . ")",
 				'asArray' => TRUE 
 		) );
-		foreach ($list as $key=>$value){
-			
+		foreach ( $list as $key => $value ) {
 		}
 		return $list;
 	}
-	
 	function getReceivablesByUntreadStatusPage($limit = 0, $con = "", $desc = 'desc') {
 		if (empty ( $limit ))
 			return array ();
-	
-			$list = $this->find ( array (
-					'where' => $con,//" bindStatus=1 and receivablesStaff like '" . $sid . "_%' ".$con,
-					'limit' => $limit,
-					$desc => 'irid',
-					'asArray' => TRUE
-			) );
-			Doo::loadClass ( 'XDeode' );
-			$XDeode = new XDeode ( 5 );
-			Doo::loadModel ( 'invoice' );
-			$invoice = new invoice ();
-			Doo::loadModel ( 'invoiceROLog' );
-			$invoiceROLog = new invoiceROLog ();
-			
-			foreach ( $list as $key => $value ) {
-				$list [$key] ['iridKeyK'] = $XDeode->encode ( $value ['irid'] );
-				$list [$key] ['iridKey'] = $this->authcode ( $value ['irid'],'' );
-				if (isset($value ['iid'])&&!empty($value ['iid'])){
-					
-					$list [$key] ['iidKeyK'] = $XDeode->encode ( $value ['iid'] );
-					$list [$key] ['irList'] = $invoice->getInvoiceByIid( $value ['iid'] );
-				}else{
-					$list [$key] ['iidKeyK']='';
-					$list [$key] ['irList']=array('invoiceSerial'=>'');
-				}
-				$list [$key]['irolg']=$invoiceROLog->getInvoiceROLogByIrid($value ['irid'],'desc');
-// 				$list [$key] ['sumPrice'] = 0;
-// 				if (! empty ( $list [$key] ['irList'] ))
-// 					$list [$key] ['sumPrice'] = $list [$key] ['irList'] [0] ['sumPrice'];
-					// $list [$key] ['operationLog'] = $invoiceOperationLog->getInvoiceOperationLogByIid ( $value ['iid'], 'desc' );
+		
+		$list = $this->find ( array (
+				'where' => $con, // " bindStatus=1 and receivablesStaff like '" . $sid . "_%' ".$con,
+				'limit' => $limit,
+				$desc => 'irid',
+				'asArray' => TRUE 
+		) );
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		Doo::loadModel ( 'invoice' );
+		$invoice = new invoice ();
+		Doo::loadModel ( 'invoiceROLog' );
+		$invoiceROLog = new invoiceROLog ();
+		
+		foreach ( $list as $key => $value ) {
+			$list [$key] ['iridKeyK'] = $XDeode->encode ( $value ['irid'] );
+			$list [$key] ['iridKey'] = $this->authcode ( $value ['irid'], '' );
+			if (isset ( $value ['iid'] ) && ! empty ( $value ['iid'] )) {
+				
+				$list [$key] ['iidKeyK'] = $XDeode->encode ( $value ['iid'] );
+				$list [$key] ['irList'] = $invoice->getInvoiceByIid ( $value ['iid'] );
+			} else {
+				$list [$key] ['iidKeyK'] = '';
+				$list [$key] ['irList'] = array (
+						'invoiceSerial' => '' 
+				);
 			}
-	
-			return $list;
+			$list [$key] ['irolg'] = $invoiceROLog->getInvoiceROLogByIrid ( $value ['irid'], 'desc' );
+			// $list [$key] ['sumPrice'] = 0;
+			// if (! empty ( $list [$key] ['irList'] ))
+			// $list [$key] ['sumPrice'] = $list [$key] ['irList'] [0] ['sumPrice'];
+			// $list [$key] ['operationLog'] = $invoiceOperationLog->getInvoiceOperationLogByIid ( $value ['iid'], 'desc' );
+		}
+		
+		return $list;
+	}
+	function delInvoiceReceivablesByIrid($irid = 0) {
+		if (!empty($irid)&&is_numeric($irid))
+			$this->delete(array('where'=>'irid='.$irid));
 	}
 	
 	/**

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

@@ -154,7 +154,7 @@
 							
 							
 							
-							<legend><div class="fR"><a href="/invoiceAchieve">查看更多</a></div>最近入账</legend>
+							<legend><div class="fR"><a href="/invoiceAchieve">查看更多</a></div>最近核销</legend>
 							<!-- if !empty({{receivablesList}}) -->
 							<table class="table table-bordered table-condensed">
 								<tbody>

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

@@ -63,7 +63,7 @@
                         
                         <div class="clearfix">
                         	
-                            <legend><div class="fR"><a href="invoice-approval-all.html">查看更多</a></div>最近审批完成</legend>
+                            <legend><div class="fR"><a href="/invoiceApprovalAchieve">查看更多</a></div>最近审批完成</legend>
                             <!-- if !empty({{ilist}}) -->
                             <table class="table table-bordered table-condensed">
                                 <tbody>

+ 209 - 0
protected/view/admin/invoiceApprovalAchieve.html

@@ -0,0 +1,209 @@
+<!-- include 'header' -->
+<script src="<?= WEB_SITE_GLOBAL ?>js/invoice.js"></script>
+<body>
+	<div class="mainLayout">
+		<div class="mainMenu">
+			<div class="menuItem">
+				<a href="#" class="mLogo">CLD</a>
+				<ul>
+					<!-- include 'menuReceipt' -->
+				</ul>
+			</div>
+		</div>
+		<div class="warpContent">
+			<div class="subMenu fL">
+				<div class="menuItem">
+					<!-- include 'invoiceMenu' -->
+				</div>
+			</div>
+			<div class="adminContent autoHeight">
+				<legend>
+					已审批发票
+				</legend>
+				<div class="demandCate">
+					<ul class="cateList">
+						<li><a <!-- if {{date}}=='MONTHO' --> class="now" <!-- endif --> href="/invoiceApprovalAchieve/1/MONTHO/{{MebSea}}">最近一个月</a>
+	  					<a <!-- if {{date}}=='MONTHT' --> class="now" <!-- endif --> href="/invoiceApprovalAchieve/1/MONTHT/{{MebSea}}">最近三个月</a>
+	  					<a <!-- if {{date}}=='MONTHY' --> class="now" <!-- endif --> href="/invoiceApprovalAchieve/1/MONTHY/{{MebSea}}" >今年</a>
+	  					<a <!-- if {{date}}=='MONTHA' --> class="now" <!-- endif --> href="/invoiceApprovalAchieve/1/MONTHA/{{MebSea}}" >更旧</a></li>
+						<li>
+							<div class="search">
+								<div class="input-append">
+									<form action="/invoiceApprovalAchieve/1/{{date}}" id="ira" method="get" >
+								<input class="span3" type="text"  data-irmMebSea value="{{MebSeaEn}}" placeholder="发票抬头、开票金额">
+								<button class="btn btn-small" node-iramMebSea type="button">搜索</button>
+								</form>
+								</div>
+							</div></li>
+					</ul>
+				</div>
+				<div class="saeaList">
+					<table class="table table-hover">
+						<tbody>
+						<tr class="thead"><th>开票流水号</th><th>开票单位(抬头)</th><th>开票金额</th><th>提交开票</th><th>完成审批</th></tr>
+						
+						<!-- loop list -->
+						<tr>
+							<td><a href="#invdetail" node-invoice='INFO' data-isKey="{{pendingInvoice' value.iidKeyK}}" data-toggle="modal">{{list' value.invoiceSerial}}</a></td>
+							<td><!-- if !empty({{list' value.invoiceType}}) -->
+	                                   	{{list' value.invoiceCompany}}
+	                                    <!-- else -->
+	                                    {{list' value.invoiceTitle}}
+	                                    <!-- endif --></td>
+							
+							<td>
+							<!-- if !empty({{list' value.invoiceType}}) -->
+	                        <b>¥{{list' value.invoicePrice}}</b><sup>专</sup>
+	                          <!-- else -->
+	                          <b>¥{{list' value.invoicePrice}}</b>
+	                          <!-- endif -->
+							</td>
+							
+							<td>{{list' value.categoryName}}{{list' value.userName}} {{list' value.date}}</td>
+							<td>
+							  <!-- if {{ilist' value.operationLog.status}}==2 -->
+                                    <span class="colGreen">同意</span> 
+                                   <!-- elseif {{ilist' value.operationLog.status}}==3 -->
+                                   <span class="colOrange">退回</span>
+                                   <!-- elseif {{ilist' value.operationLog.status}}==4 -->
+                                   <span class="colRed">终止</span>
+                                   <!-- endif -->
+                                    	{{ilist' value.operationLog.username}} {{ilist' value.operationLog.date}}
+							</td>
+							
+						</tr>
+						<!-- endloop -->
+						
+						
+						</tbody>
+					</table>
+				</div>
+						  		<!--翻页-->
+				<div class="demandPage">
+					<ul class="pagination fL">
+	  							<!-- if {{page.previous}}==0 -->
+								<li><a href="javascript:void(0)" title="上一页">&lt;</a></li>
+								<!-- else -->
+								<li><a href="/invoiceApprovalAchieve/{{page.previous}}{{get}}" title="上一页">&lt;</a></li>
+								<!-- endif -->	
+								
+	  							<!-- if {{page.on_page}}>=3 -->
+	  							<li><a href="/invoiceApprovalAchieve/1{{get}}" title="上一页">1</a></li>
+	  							<li class="point"><span>...</span></li>
+	  							<!-- endif -->
+	  							
+	  							{{page.page}}
+	  							
+	  							<!-- if {{page.on_page}}<3 && {{page.total_page}}>5 -->
+	  							<li><a href="/invoiceApprovalAchieve/4{{get}}" >4</a></li>
+	  							<li><a href="/invoiceApprovalAchieve/5{{get}}" >5</a></li>
+	  							<!-- endif -->
+	  							
+	  							<!-- if {{page.total_page}}>3 -->
+	  							<li class="point"><span>...</span></li>
+			  					<!-- endif -->
+			  					
+			  					<!-- if {{page.next}}=={{page.on_page}} -->
+								<li><a href="javascript:void(0)" title="下一页">&gt;</a></li>
+								<!-- else -->
+								<li><a href="/invoiceApprovalAchieve/{{page.next}}{{get}}" title="下一页">&gt;</a></li>
+								<!-- endif -->
+			  					
+			  		</ul>
+			  	</div>				
+			</div>
+		</div>
+	</div>
+	<!--弹出(录入收款)-->
+<div class="modal hide fade" id="inputbill">
+    <div class="modal-header">
+    <h3>录入收款</h3>
+    </div>
+    <div class="modal-body">
+    	<form>
+    		<div class="control-group">
+              <label class="control-label"><span class="colRed">*</span>到款金额</label>
+              <div class="controls">
+                <input value="0" placeholder="输入开票金额" pattern="[0-9]" min="0" step="0.01" type="number">
+              </div>
+            </div>
+    		<div class="control-group">
+              <label class="control-label"><span class="colRed">*</span>到款信息</label>
+              <div class="controls">
+                <input type="text">
+              </div>
+            </div>
+    		<div class="control-group">
+              <label class="control-label"><span class="colRed">*</span>到款银行</label>
+              <div class="controls">
+                <select>
+	            	<option>广发银行珠海分行柠溪支行</option>
+	            </select>
+              </div>
+            </div>
+    		<div class="control-group">
+              <label class="control-label"><span class="colRed">*</span>银行到款时间</label>
+              <div class="controls">
+                <input type="date">
+              </div>
+            </div>
+    		<div class="control-group">
+              <label class="control-label">指定认领人</label>
+              <div class="controls">
+                <select>
+	            	<option>待认领款项</option>
+	            	<option>广东办-刘飞</option>
+	            </select>
+              </div>
+            </div>
+    		<div class="control-group">
+              <label class="control-label">未收款发票</label>
+              <div class="controls">
+                <select>
+	            	<option>¥30000.00-珠海XXXXXXX公司-441027465</option>
+	            	<option>¥40000.00-珠海XXXXXXX公司-441027465</option>
+	            </select>
+              </div>
+            </div>
+    	</form>
+    </div>
+	<div class="modal-footer">
+	    <a href="#" class="button" data-dismiss="modal" aria-hidden="true">确认录入</a>
+	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
+	</div>
+</div>
+    <!--弹出内容-->
+	<!--弹出(录入收款)-->
+<div class="modal hide fade" id="receive">
+    <div class="modal-header">
+    <h3>认领收款</h3>
+    </div>
+    <div class="modal-body">
+    	<table class="table">
+    		<thead><tr><th width="50">收款信息</th><td></td>
+    			<th width="60"></th><td></td></tr></thead>
+    		<tr>
+    		</tr>
+    		<tr>
+    			<th>收款金额</th><td><b class="colOrange">¥200000.00</b></td>
+    			<th>收款信息</th><td>陈宇</td>
+    		</tr>
+    		<tr>
+    			<th>收款银行</th><td>广发银行珠海分行柠溪支行</td>
+    			<th>银行到帐</th><td>2016-04-11</td>
+    		</tr>
+    		<tr>
+    			<th>录入收款</th><td>张少珊<br>2015-04-12 11:30:02</td>
+    			<th></th><td></td>
+    		</tr>
+    	</table>
+    	<p class="colRed">请确认该收款属于您</p>
+    </div>
+	<div class="modal-footer">
+	    <a href="#" class="button" data-dismiss="modal" aria-hidden="true">确认认领</a>
+	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
+	</div>
+</div>
+    <!--弹出内容-->        	
+<script type="text/javascript">autoFlashHeight();</script>	
+</body>

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

@@ -111,7 +111,7 @@
 					<h3>收款入账</h3>
 				</div>
 				<div class="modal-body">
-					<p class="alert alert-block">收款与发票进行绑定,完成入账;入账后,收款金额将作为您的最终销售收入。</p>
+					<p class="alert alert-block">收款与发票进行绑定,完成入账;已绑定收款的发票,进行核销,核销金额将作为你的最终销售收入。</p>
 					<table class="table table-bordered table-condensed">
 						<thead><th>开票内容</th><th>开票金额</th><th>发票类型</th><th>单位/抬头</th><th>入账操作</th></thead>
 						<tbody data-invoice="myClaim">

+ 11 - 7
protected/view/admin/invoiceReceivablesAS.html

@@ -81,7 +81,8 @@
 						</td>
 						<td>
 						<!-- if {{list' value.receivablesStaff}}=='PUBLIC' -->
-							<a href="#billeidt" data-isKey="{{list' value.iridKey}}" node-irUpdate  data-toggle="modal">修改</a> <a  href="#billdel" data-toggle="modal">删除</a>
+							<a href="#billeidt" data-isKey="{{list' value.iridKey}}" node-irUpdate  data-toggle="modal">修改</a> 
+							<a  href="#billdel" data-isKey="{{list' value.iridKey}}" node-irDelete data-toggle="modal">删除</a>
 						<!-- elseif {{list' value.receivablesStaff}}!='PUBLIC'&&{{list' value.iid}}==0  -->
 							<a href="#receive" data-isKey="{{list' value.iridKey}}" node-alter data-toggle="modal">变更</a>
 						<!-- endif -->
@@ -176,8 +177,8 @@
     <!--弹出变更-->
 	<!--弹出修改-->
 <div class="modal hide fade" id="billeidt">
-<form action="/invoicesDo" method="post" name="receivablesInvoice">
-<input type="hidden" name="claimuKey" value >
+<form action="/invoiceReceivablesUpdateClaim" method="post" name="receivablesInvoice">
+	<input type="hidden" name="claimKey" id="claimuKey" value >
 	<div class="modal-dialog">
 		<div class="modal-content">
     <div class="modal-header">
@@ -203,8 +204,8 @@
 						</tr>
 						<tr>
 							<th class="taC">收款银行</th><td>
-							<select name="receivablesBank">
-								<option>广发银行珠海分行柠溪支行</option>
+							<select name="receivablesBank" html-rbank>
+								
 							</select></td>
 						</tr>
 						<tr>
@@ -224,7 +225,7 @@
 						</tbody></table>
 			</div>
 	<div class="modal-footer">
-	    <a href="#" class="button">确定</a>
+	    <input type="submit" class="button" value="确定">
 	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
 	</div>
 			</div></div>
@@ -233,6 +234,8 @@
     <!--弹出修改-->   
 	<!--弹出删除-->
 <div class="modal hide fade" id="billdel">
+<form action="/invoiceReceivablesDelete" method="post" name="receivablesInvoice">
+<input type="hidden" name="claimKey" id="claimdKey" value >
 	<div class="modal-dialog">
 		<div class="modal-content">
     <div class="modal-header">
@@ -242,10 +245,11 @@
     	数据诚可贵,删除需谨慎!
     </div>
 	<div class="modal-footer">
-	    <a href="#" class="button">删除</a>
+	<input type="submit" class="button" value="删除">
 	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
 	</div>
 			</div></div>
+</form>
 </div>
     <!--弹出删除-->
 	<

+ 5 - 2
protected/view/admin/invoiceUntread.html

@@ -48,9 +48,12 @@
                                     <!-- endif -->
                                     </td>
                                     <td>{{invoiceList' value.categoryName}}{{invoiceList' value.userName}} {{invoiceList' value.date}}</td>
-                                    <td>{{invoiceList' value.untreadCompany}}:
+                                    <td>
+                                    <!-- if !empty({{invoiceList' value.untreadNumber}}) -->
+                                    {{invoiceList' value.untreadCompany}}:
                                     <a href="#shipping" title="{{invoiceList' value.untreadItems}}" node-express="untread" data-toggle="modal">{{invoiceList' value.untreadNumber}}</a> 
-                                    <a target="_blank" href="http://www.kuaidi100.com/chaxun?com={{invoiceList' value.untreadCom}}&nu={{invoiceList' value.untreadNumber}}">查询快递</a> </td>
+                                    <a target="_blank" href="http://www.kuaidi100.com/chaxun?com={{invoiceList' value.untreadCom}}&nu={{invoiceList' value.untreadNumber}}">查询快递</a> 
+                                    <!-- endif --></td>
                                     <td><a class="button btn-block" diss-data="{{pendingInvoice' value.iidKey}}" node-invoice="untreadInvoice"  href="#return" data-toggle="modal">确认退票</a></td>
                                 </tr>
                                 <!-- endloop -->