|  | @@ -3762,7 +3762,7 @@ class InvoiceController extends DooController {
 | 
	
		
			
				|  |  |  		$categoryList = $category->getCategoryInCid ( implode ( ',', $cidList ) );
 | 
	
		
			
				|  |  |  		
 | 
	
		
			
				|  |  |  		$cid = $XDeode->decode ( $cidKey );
 | 
	
		
			
				|  |  | -		
 | 
	
		
			
				|  |  | +		$month=date("m", strtotime("-1 month"));
 | 
	
		
			
				|  |  |  		$redis = new Redis ();
 | 
	
		
			
				|  |  |  		$redis->connect ( '127.0.0.1', '6379' );
 | 
	
		
			
				|  |  |  		
 | 
	
	
		
			
				|  | @@ -3774,8 +3774,11 @@ class InvoiceController extends DooController {
 | 
	
		
			
				|  |  |  			$isMC = $invoiceStatistics->getInvoiceStatistiscsMothByCategory ( $cid );
 | 
	
		
			
				|  |  |  			$schedule = $invoice->getInvoiceScheduleByCid ( $cid );
 | 
	
		
			
				|  |  |  			
 | 
	
		
			
				|  |  | +			
 | 
	
		
			
				|  |  | +			
 | 
	
		
			
				|  |  |  			// 获得办事处人员下的汇总
 | 
	
		
			
				|  |  |  			$slist = $staff->getStaffByCid ( $cid );
 | 
	
		
			
				|  |  | +			$ismsbMonth = $invoiceStatistics->getISMSByCategoryByMonth( $cid,$month );//上一个月的汇总
 | 
	
		
			
				|  |  |  			$ismsb = $invoiceStatistics->getISMSByCategory ( $cid ); // 当月汇总
 | 
	
		
			
				|  |  |  			$ISAS = $invoiceStatistics->getISASByCategory ( $cid ); // 全部汇总
 | 
	
		
			
				|  |  |  			$scheduleStaff = $invoice->getInvoiceScheduleByCidGroupSid ( $cid ); // 完成度
 | 
	
	
		
			
				|  | @@ -3788,6 +3791,17 @@ class InvoiceController extends DooController {
 | 
	
		
			
				|  |  |  				$slist [$key] ['receivablesAllPrice'] = 0;
 | 
	
		
			
				|  |  |  				$slist [$key] ['accountAllPrice'] = 0;
 | 
	
		
			
				|  |  |  				$slist [$key] ['schedule'] = 0;
 | 
	
		
			
				|  |  | +				$slist [$key] ['invoiceMonthPrice'] = 0;
 | 
	
		
			
				|  |  | +				$slist [$key] ['receivablesMonthPrice'] = 0;
 | 
	
		
			
				|  |  | +				$slist [$key] ['accountMonthPrice'] = 0;
 | 
	
		
			
				|  |  | +				
 | 
	
		
			
				|  |  | +				foreach ($ismsbMonth as $y=>$l){
 | 
	
		
			
				|  |  | +					if ($value ['sid'] == $l ['staff']) {
 | 
	
		
			
				|  |  | +						$slist [$key] ['invoiceMonthPrice'] = $l ['invoicePrice'];
 | 
	
		
			
				|  |  | +						$slist [$key] ['receivablesMonthPrice'] = $l ['receivablesPrice'];
 | 
	
		
			
				|  |  | +						$slist [$key] ['accountMonthPrice'] = $l ['accountPrice'];
 | 
	
		
			
				|  |  | +					}
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  |  				
 | 
	
		
			
				|  |  |  				foreach ( $ismsb as $k => $v ) {
 | 
	
		
			
				|  |  |  					if ($value ['sid'] == $v ['staff']) {
 | 
	
	
		
			
				|  | @@ -3827,6 +3841,7 @@ class InvoiceController extends DooController {
 | 
	
		
			
				|  |  |  			$this->data ['schedule'] = json_decode ( $redisValue [0], true );
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  		
 | 
	
		
			
				|  |  | +		$this->data ['month'] = $month;
 | 
	
		
			
				|  |  |  		$this->data ['categoryList'] = $categoryList;
 | 
	
		
			
				|  |  |  		
 | 
	
		
			
				|  |  |  		$this->data ['memu'] = "invoice";
 | 
	
	
		
			
				|  | @@ -4316,52 +4331,52 @@ 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 = 12;
 | 
	
		
			
				|  |  | -		$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 approvalTime>DATE_SUB(CURDATE(), INTERVAL 1 MONTH)';
 | 
	
		
			
				|  |  | -		elseif ($date == 'MONTHT')
 | 
	
		
			
				|  |  | -			$con = ' and approvalTime>DATE_SUB(CURDATE(), INTERVAL 3 MONTH)';
 | 
	
		
			
				|  |  | -		elseif ($date == 'MONTHY')
 | 
	
		
			
				|  |  | -			$con = ' and approvalTime>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=2 or status=3 or status=4) and processApprovals!=""' . $con; // echo $sql;
 | 
	
		
			
				|  |  | -		$pageinfo = $this->get_page ( "CLD_invoice", $sql, $page, $page_size, "invoiceApprovalAchieve", $get, "" );
 | 
	
		
			
				|  |  | -		
 | 
	
		
			
				|  |  | -		$limit = $pageinfo ['lower'] . ',' . $page_size;
 | 
	
		
			
				|  |  | -		
 | 
	
		
			
				|  |  | -		$list = $invoice->getInvoiceByUntreadStatusPage ( $limit, $sql, 'desc', 2 );
 | 
	
		
			
				|  |  | -		// 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 );
 | 
	
		
			
				|  |  | -	}
 | 
	
		
			
				|  |  | +// 	function invoiceApprovalAchieve() {
 | 
	
		
			
				|  |  | +// 		Doo::loadModel ( 'invoice' );
 | 
	
		
			
				|  |  | +// 		$invoice = new invoice ();
 | 
	
		
			
				|  |  | +		
 | 
	
		
			
				|  |  | +// 		$MebSea = isset ( $this->params ['MebSea'] ) ? urldecode ( $this->params ['MebSea'] ) : '';
 | 
	
		
			
				|  |  | +		
 | 
	
		
			
				|  |  | +// 		$page_size = 12;
 | 
	
		
			
				|  |  | +// 		$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 approvalTime>DATE_SUB(CURDATE(), INTERVAL 1 MONTH)';
 | 
	
		
			
				|  |  | +// 		elseif ($date == 'MONTHT')
 | 
	
		
			
				|  |  | +// 			$con = ' and approvalTime>DATE_SUB(CURDATE(), INTERVAL 3 MONTH)';
 | 
	
		
			
				|  |  | +// 		elseif ($date == 'MONTHY')
 | 
	
		
			
				|  |  | +// 			$con = ' and approvalTime>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=2 or status=3 or status=4) and processApprovals!=""' . $con; // echo $sql;
 | 
	
		
			
				|  |  | +// 		$pageinfo = $this->get_page ( "CLD_invoice", $sql, $page, $page_size, "invoiceApprovalAchieve", $get, "" );
 | 
	
		
			
				|  |  | +		
 | 
	
		
			
				|  |  | +// 		$limit = $pageinfo ['lower'] . ',' . $page_size;
 | 
	
		
			
				|  |  | +		
 | 
	
		
			
				|  |  | +// 		$list = $invoice->getInvoiceByUntreadStatusPage ( $limit, $sql, 'desc', 2 );
 | 
	
		
			
				|  |  | +// 		// 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 );
 | 
	
		
			
				|  |  | +// 	}
 | 
	
		
			
				|  |  |  	
 | 
	
		
			
				|  |  |  	/**
 | 
	
		
			
				|  |  |  	 * 获得审批发票的信息以及审批页面
 | 
	
	
		
			
				|  | @@ -4516,7 +4531,7 @@ class InvoiceController extends DooController {
 | 
	
		
			
				|  |  |  /**
 | 
	
		
			
				|  |  |   * 获得审批发票分页数据
 | 
	
		
			
				|  |  |   */
 | 
	
		
			
				|  |  | -function ajaxGetinvoiceApprovalAchieveDevelopment() {
 | 
	
		
			
				|  |  | +function ajaxGetinvoiceApprovalAchieve() {
 | 
	
		
			
				|  |  |  	Doo::loadModel ( 'invoice' );
 | 
	
		
			
				|  |  |  	$invoice = new invoice ();
 | 
	
		
			
				|  |  |  	Doo::loadModel ( 'staff' );
 | 
	
	
		
			
				|  | @@ -4538,11 +4553,11 @@ function ajaxGetinvoiceApprovalAchieveDevelopment() {
 | 
	
		
			
				|  |  |  	
 | 
	
		
			
				|  |  |  	$con = '';
 | 
	
		
			
				|  |  |  	if ($status == 'ALL')
 | 
	
		
			
				|  |  | -		$con = ' and isDelete=0 ';
 | 
	
		
			
				|  |  | +		$con = ' (status=1 or status=2 or status=3 or status=4) and isDelete=0 ';
 | 
	
		
			
				|  |  |  	elseif ($status == 'PEND')
 | 
	
		
			
				|  |  | -		$con = ' and isDelete=0  and status=1';
 | 
	
		
			
				|  |  | +		$con = '  isDelete=0  and status=1';
 | 
	
		
			
				|  |  |  	elseif ($status == 'APPROVED')
 | 
	
		
			
				|  |  | -		$con = ' and isDelete=0  and status=2';
 | 
	
		
			
				|  |  | +		$con = '  isDelete=0  and status=2';
 | 
	
		
			
				|  |  |  	
 | 
	
		
			
				|  |  |  	if ($invoiceType == 'ORDINARY')
 | 
	
		
			
				|  |  |  		$con .= ' and invoiceType=0 ';
 | 
	
	
		
			
				|  | @@ -4577,7 +4592,7 @@ function ajaxGetinvoiceApprovalAchieveDevelopment() {
 | 
	
		
			
				|  |  |  	$pageinfo ['page'] = array (
 | 
	
		
			
				|  |  |  			'previous' => '' 
 | 
	
		
			
				|  |  |  	);
 | 
	
		
			
				|  |  | -	$sql = '(status=1 or status=2 or status=3 or status=4)  ' . $con;
 | 
	
		
			
				|  |  | +	$sql = '  ' . $con;
 | 
	
		
			
				|  |  |  	$pageinfo = $this->get_page ( "CLD_invoice", $sql, $page, $page_size, "invoiceApprovalAchieve", '', "" );
 | 
	
		
			
				|  |  |  	
 | 
	
		
			
				|  |  |  	$limit = $page . ',' . $page_size;
 | 
	
	
		
			
				|  | @@ -4594,6 +4609,12 @@ function ajaxGetinvoiceApprovalAchieveDevelopment() {
 | 
	
		
			
				|  |  |  	foreach ( $list as $key => $value ) {
 | 
	
		
			
				|  |  |  		$irDetail = array ();
 | 
	
		
			
				|  |  |  		
 | 
	
		
			
				|  |  | +		
 | 
	
		
			
				|  |  | +		if ($value ['status'] == 1) {
 | 
	
		
			
				|  |  | +			array_push ( $irDetail, '<a href="#approvalInvice" onclick="nodeInvoiceApproval(\'' . $value ['iidKeyK'] . '\')" data-toggle="modal">审批发票</a>' );
 | 
	
		
			
				|  |  | +		} else
 | 
	
		
			
				|  |  | +			array_push ( $irDetail, '' );
 | 
	
		
			
				|  |  | +		
 | 
	
		
			
				|  |  |  		array_push ( $irDetail, '<a href="#approvalInvice" onclick="nodeInvoice(\'' . $value ['iidKeyK'] . '\')"  data-toggle="modal">' . $value ['invoiceSerial'] . '</a>' );
 | 
	
		
			
				|  |  |  		
 | 
	
		
			
				|  |  |  		if ($value ['invoiceType'] == 1)
 | 
	
	
		
			
				|  | @@ -4628,9 +4649,7 @@ function ajaxGetinvoiceApprovalAchieveDevelopment() {
 | 
	
		
			
				|  |  |  			array_push ( $irDetail, '<span class="colOrange">退回</span>' . $value ['OL'] ['username'] . $value ['OL'] ['date'] );
 | 
	
		
			
				|  |  |  		elseif ($value ['status'] == 4)
 | 
	
		
			
				|  |  |  			array_push ( $irDetail, '<span class="colRed">终止</span>' . $value ['OL'] ['username'] . $value ['OL'] ['date'] );
 | 
	
		
			
				|  |  | -		elseif ($value ['status'] == 1) {
 | 
	
		
			
				|  |  | -			array_push ( $irDetail, '<a href="#approvalInvice" onclick="nodeInvoiceApproval(\'' . $value ['iidKeyK'] . '\')" data-toggle="modal">审批发票</a>' );
 | 
	
		
			
				|  |  | -		} else
 | 
	
		
			
				|  |  | +		else 
 | 
	
		
			
				|  |  |  			array_push ( $irDetail, '' );
 | 
	
		
			
				|  |  |  		
 | 
	
		
			
				|  |  |  		array_push ( $approvalList, $irDetail );
 | 
	
	
		
			
				|  | @@ -4650,7 +4669,7 @@ function ajaxGetinvoiceApprovalAchieveDevelopment() {
 | 
	
		
			
				|  |  |  /**
 | 
	
		
			
				|  |  |   * 审批发票查看更多--重构
 | 
	
		
			
				|  |  |   */
 | 
	
		
			
				|  |  | -function invoiceApprovalAchieveDevelopment() {
 | 
	
		
			
				|  |  | +function invoiceApprovalAchieve() {
 | 
	
		
			
				|  |  |  	$status = isset ( $this->params ['status'] ) ? $this->params ['status'] : 'ALL';
 | 
	
		
			
				|  |  |  	$invoiceType = $this->get_args ( 'invoiceType' ) ? $this->get_args ( 'invoiceType' ) : "ALL";
 | 
	
		
			
				|  |  |  	$invoiceTrain = $this->get_args ( 'invoiceTrain' ) ? $this->get_args ( 'invoiceTrain' ) : "ORDINARY";
 | 
	
	
		
			
				|  | @@ -4685,7 +4704,7 @@ function invoiceApprovalAchieveDevelopment() {
 | 
	
		
			
				|  |  |  	$this->data ['memu'] = "invoice";
 | 
	
		
			
				|  |  |  	$this->data ['staff'] = $this->staff;
 | 
	
		
			
				|  |  |  	$this->data ['receiptMemu'] = 'invoiceApproval';
 | 
	
		
			
				|  |  | -	$this->render ( "/admin/invoiceApprovalAchieveDevelopment", $this->data );
 | 
	
		
			
				|  |  | +	$this->render ( "/admin/invoiceApprovalAchieve", $this->data );
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  function invoiceTAchieve() {
 | 
	
		
			
				|  |  |  	Doo::loadModel ( 'invoice' );
 |