|  | @@ -100,12 +100,13 @@ class InvoiceController extends DooController {
 | 
												
													
														
															|  |  		Doo::loadClass ( 'XDeode' );
 |  |  		Doo::loadClass ( 'XDeode' );
 | 
												
													
														
															|  |  		$XDeode = new XDeode ( 5 );
 |  |  		$XDeode = new XDeode ( 5 );
 | 
												
													
														
															|  |  		$sid = $XDeode->decode ( $_COOKIE ["staff"] );
 |  |  		$sid = $XDeode->decode ( $_COOKIE ["staff"] );
 | 
												
													
														
															|  | -		$expressList = $express->getExpressByAll ();
 |  | 
 | 
												
													
														
															|  | 
 |  | +		//$expressList = $express->getExpressByAll ();
 | 
												
													
														
															|  |  		$invoiceList = $invoice->getMyInvoice ( $sid );
 |  |  		$invoiceList = $invoice->getMyInvoice ( $sid );
 | 
												
													
														
															|  |  		
 |  |  		
 | 
												
													
														
															|  |  		// $list = $invoiceReceivables->getInvoiceReceivablesByClaim ( $this->staff [0] ['cid'], $this->staff [0] ['sid'] );
 |  |  		// $list = $invoiceReceivables->getInvoiceReceivablesByClaim ( $this->staff [0] ['cid'], $this->staff [0] ['sid'] );
 | 
												
													
														
															|  |  		
 |  |  		
 | 
												
													
														
															|  | -		$sql = 'status=2 and untreadStatus=3 and sid=' . $sid;
 |  | 
 | 
												
													
														
															|  | 
 |  | +		
 | 
												
													
														
															|  | 
 |  | +		$sql = 'status=2 and printStatus=1 and irid!="" and sid=' . $sid;
 | 
												
													
														
															|  |  		$list = $invoice->getInvoiceByUntreadStatusPage ( 4, $sql );
 |  |  		$list = $invoice->getInvoiceByUntreadStatusPage ( 4, $sql );
 | 
												
													
														
															|  |  		
 |  |  		
 | 
												
													
														
															|  |  		// print_r($list);
 |  |  		// print_r($list);
 | 
												
											
												
													
														
															|  | @@ -113,7 +114,7 @@ class InvoiceController extends DooController {
 | 
												
													
														
															|  |  		$this->data ['isMonth'] = $isMonth;
 |  |  		$this->data ['isMonth'] = $isMonth;
 | 
												
													
														
															|  |  		$this->data ['htm'] = $htm;
 |  |  		$this->data ['htm'] = $htm;
 | 
												
													
														
															|  |  		
 |  |  		
 | 
												
													
														
															|  | -		$this->data ['expressList'] = $expressList;
 |  | 
 | 
												
													
														
															|  | 
 |  | +		//$this->data ['expressList'] = $expressList;
 | 
												
													
														
															|  |  		$this->data ['invoiceList'] = $invoiceList;
 |  |  		$this->data ['invoiceList'] = $invoiceList;
 | 
												
													
														
															|  |  		
 |  |  		
 | 
												
													
														
															|  |  		$this->data ['receivablesList'] = $list;
 |  |  		$this->data ['receivablesList'] = $list;
 | 
												
											
												
													
														
															|  | @@ -599,8 +600,8 @@ class InvoiceController extends DooController {
 | 
												
													
														
															|  |  		return "/invoice";
 |  |  		return "/invoice";
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  |  	/**
 |  |  	/**
 | 
												
													
														
															|  | 
 |  | +	 * @deprecated
 | 
												
													
														
															|  |  	 * 申请退票 --需求变更 废弃
 |  |  	 * 申请退票 --需求变更 废弃
 | 
												
													
														
															|  | -	 */
 |  | 
 | 
												
													
														
															|  |  	function invoiceUntreadDo() {
 |  |  	function invoiceUntreadDo() {
 | 
												
													
														
															|  |  		$untreadIidKey = $this->get_args ( 'untreadIidKey' ) ? $this->get_args ( 'untreadIidKey' ) : '';
 |  |  		$untreadIidKey = $this->get_args ( 'untreadIidKey' ) ? $this->get_args ( 'untreadIidKey' ) : '';
 | 
												
													
														
															|  |  		$untreadReason = $this->get_args ( 'untreadReason' ) ? $this->get_args ( 'untreadReason' ) : "";
 |  |  		$untreadReason = $this->get_args ( 'untreadReason' ) ? $this->get_args ( 'untreadReason' ) : "";
 | 
												
											
												
													
														
															|  | @@ -656,7 +657,8 @@ class InvoiceController extends DooController {
 | 
												
													
														
															|  |  		
 |  |  		
 | 
												
													
														
															|  |  		return "/invoice";
 |  |  		return "/invoice";
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  | -	
 |  | 
 | 
												
													
														
															|  | 
 |  | +	*/
 | 
												
													
														
															|  | 
 |  | +		
 | 
												
													
														
															|  |  	/**
 |  |  	/**
 | 
												
													
														
															|  |  	 * 删除已终止的开票
 |  |  	 * 删除已终止的开票
 | 
												
													
														
															|  |  	 */
 |  |  	 */
 | 
												
											
												
													
														
															|  | @@ -1164,7 +1166,10 @@ class InvoiceController extends DooController {
 | 
												
													
														
															|  |  		$category = $lCategory->getCategory ();
 |  |  		$category = $lCategory->getCategory ();
 | 
												
													
														
															|  |  		$staffList = $staff->getStaffByCid ( $this->staff [0] ['cid'] );
 |  |  		$staffList = $staff->getStaffByCid ( $this->staff [0] ['cid'] );
 | 
												
													
														
															|  |  		
 |  |  		
 | 
												
													
														
															|  | -		$receivablesList = $invoiceReceivables->getInvoiceReceivablesByNew ();
 |  | 
 | 
												
													
														
															|  | 
 |  | +		$sql = 'bindStatus=1 and iid!=0';
 | 
												
													
														
															|  | 
 |  | +		$receivablesList = $invoiceReceivables->getInvoiceReceivablesByNew (4,$sql);
 | 
												
													
														
															|  | 
 |  | +
 | 
												
													
														
															|  | 
 |  | +		
 | 
												
													
														
															|  |  		// 获取未入账发票
 |  |  		// 获取未入账发票
 | 
												
													
														
															|  |  		$invoiceUnAccount = $invoice->getInvoiceByUnAccount ( $invoiceTC );
 |  |  		$invoiceUnAccount = $invoice->getInvoiceByUnAccount ( $invoiceTC );
 | 
												
													
														
															|  |  		
 |  |  		
 | 
												
											
												
													
														
															|  | @@ -1619,8 +1624,8 @@ class InvoiceController extends DooController {
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  |  	
 |  |  	
 | 
												
													
														
															|  |  	/**
 |  |  	/**
 | 
												
													
														
															|  | -	 * 收款绑定发票 ,一个收款只能绑定一个发票
 |  | 
 | 
												
													
														
															|  | -	 */
 |  | 
 | 
												
													
														
															|  | 
 |  | +	 * @deprecated
 | 
												
													
														
															|  | 
 |  | +	 * 收款绑定发票 ,一个收款只能绑定一个发票 --废弃
 | 
												
													
														
															|  |  	function invoiceBindReceivables() {
 |  |  	function invoiceBindReceivables() {
 | 
												
													
														
															|  |  		$claimKey = $this->get_args ( 'key' ) ? $this->get_args ( 'key' ) : "";
 |  |  		$claimKey = $this->get_args ( 'key' ) ? $this->get_args ( 'key' ) : "";
 | 
												
													
														
															|  |  		$invoiceKey = $this->get_args ( 'invoiceKey' ) ? $this->get_args ( 'invoiceKey' ) : "";
 |  |  		$invoiceKey = $this->get_args ( 'invoiceKey' ) ? $this->get_args ( 'invoiceKey' ) : "";
 | 
												
											
												
													
														
															|  | @@ -1682,10 +1687,11 @@ class InvoiceController extends DooController {
 | 
												
													
														
															|  |  		
 |  |  		
 | 
												
													
														
															|  |  		return "/invoiceReceivables";
 |  |  		return "/invoiceReceivables";
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  | 
 |  | +	*/
 | 
												
													
														
															|  |  	
 |  |  	
 | 
												
													
														
															|  |  	/**
 |  |  	/**
 | 
												
													
														
															|  | 
 |  | +	 * @deprecated
 | 
												
													
														
															|  |  	 * 发票收款完成--需求更变 废弃
 |  |  	 * 发票收款完成--需求更变 废弃
 | 
												
													
														
															|  | -	 */
 |  | 
 | 
												
													
														
															|  |  	function invoiceEnterReceivables() {
 |  |  	function invoiceEnterReceivables() {
 | 
												
													
														
															|  |  		$invoiceKey = $this->get_args ( 'key' ) ? $this->get_args ( 'key' ) : "";
 |  |  		$invoiceKey = $this->get_args ( 'key' ) ? $this->get_args ( 'key' ) : "";
 | 
												
													
														
															|  |  		// $invoiceClaim = $this->get_args ( 'invoiceClaim' ) ? $this->get_args ( 'invoiceClaim' ) : "";
 |  |  		// $invoiceClaim = $this->get_args ( 'invoiceClaim' ) ? $this->get_args ( 'invoiceClaim' ) : "";
 | 
												
											
												
													
														
															|  | @@ -1744,6 +1750,8 @@ class InvoiceController extends DooController {
 | 
												
													
														
															|  |  		
 |  |  		
 | 
												
													
														
															|  |  		return "/invoice";
 |  |  		return "/invoice";
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  | 
 |  | +	*/
 | 
												
													
														
															|  | 
 |  | +	
 | 
												
													
														
															|  |  	function invoiceAggregate() {
 |  |  	function invoiceAggregate() {
 | 
												
													
														
															|  |  		$year = $this->get_args ( 'year' ) ? $this->get_args ( 'year' ) : date ( "Y" );
 |  |  		$year = $this->get_args ( 'year' ) ? $this->get_args ( 'year' ) : date ( "Y" );
 | 
												
													
														
															|  |  		
 |  |  		
 | 
												
											
												
													
														
															|  | @@ -2365,8 +2373,8 @@ class InvoiceController extends DooController {
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  |  	
 |  |  	
 | 
												
													
														
															|  |  	/**
 |  |  	/**
 | 
												
													
														
															|  | -	 * 获得与我有关可收款的发票
 |  | 
 | 
												
													
														
															|  | -	 */
 |  | 
 | 
												
													
														
															|  | 
 |  | +	 * @deprecated
 | 
												
													
														
															|  | 
 |  | +	 * 获得与我有关可收款的发票  废弃
 | 
												
													
														
															|  |  	function ajaxGetInvoiceByStaff() {
 |  |  	function ajaxGetInvoiceByStaff() {
 | 
												
													
														
															|  |  		$irid = $this->get_args ( 'key' ) ? $this->get_args ( 'key' ) : "";
 |  |  		$irid = $this->get_args ( 'key' ) ? $this->get_args ( 'key' ) : "";
 | 
												
													
														
															|  |  		Doo::loadModel ( 'invoice' );
 |  |  		Doo::loadModel ( 'invoice' );
 | 
												
											
												
													
														
															|  | @@ -2429,6 +2437,7 @@ class InvoiceController extends DooController {
 | 
												
													
														
															|  |  				'html' => $html 
 |  |  				'html' => $html 
 | 
												
													
														
															|  |  		) );
 |  |  		) );
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  | 
 |  | +	*/
 | 
												
													
														
															|  |  	
 |  |  	
 | 
												
													
														
															|  |  	/**
 |  |  	/**
 | 
												
													
														
															|  |  	 * 获取一条收款信息
 |  |  	 * 获取一条收款信息
 | 
												
											
												
													
														
															|  | @@ -2523,8 +2532,8 @@ class InvoiceController extends DooController {
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  |  	
 |  |  	
 | 
												
													
														
															|  |  	/**
 |  |  	/**
 | 
												
													
														
															|  | 
 |  | +	 * @deprecated
 | 
												
													
														
															|  |  	 * --需求变更 废弃
 |  |  	 * --需求变更 废弃
 | 
												
													
														
															|  | -	 */
 |  | 
 | 
												
													
														
															|  |  	function ajaxCompareClaimPrice() {
 |  |  	function ajaxCompareClaimPrice() {
 | 
												
													
														
															|  |  		$irid = $this->get_args ( 'irid' ) ? $this->get_args ( 'irid' ) : "";
 |  |  		$irid = $this->get_args ( 'irid' ) ? $this->get_args ( 'irid' ) : "";
 | 
												
													
														
															|  |  		$invoiceKey = $this->get_args ( 'invoiceKey' ) ? $this->get_args ( 'invoiceKey' ) : "";
 |  |  		$invoiceKey = $this->get_args ( 'invoiceKey' ) ? $this->get_args ( 'invoiceKey' ) : "";
 | 
												
											
												
													
														
															|  | @@ -2654,10 +2663,11 @@ class InvoiceController extends DooController {
 | 
												
													
														
															|  |  				'isReceivables' => $isReceivables 
 |  |  				'isReceivables' => $isReceivables 
 | 
												
													
														
															|  |  		) );
 |  |  		) );
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  | 
 |  | +	*/
 | 
												
													
														
															|  |  	
 |  |  	
 | 
												
													
														
															|  |  	/**
 |  |  	/**
 | 
												
													
														
															|  | 
 |  | +	 * @deprecated
 | 
												
													
														
															|  |  	 * 从发票中移除已经入账的收款 --需求变更 废弃
 |  |  	 * 从发票中移除已经入账的收款 --需求变更 废弃
 | 
												
													
														
															|  | -	 */
 |  | 
 | 
												
													
														
															|  |  	function ajaxReceivablesRemove() {
 |  |  	function ajaxReceivablesRemove() {
 | 
												
													
														
															|  |  		$iridKey = $this->get_args ( 'key' ) ? $this->get_args ( 'key' ) : "";
 |  |  		$iridKey = $this->get_args ( 'key' ) ? $this->get_args ( 'key' ) : "";
 | 
												
													
														
															|  |  		$invoiceKey = $this->get_args ( 'invoiceKey' ) ? $this->get_args ( 'invoiceKey' ) : "";
 |  |  		$invoiceKey = $this->get_args ( 'invoiceKey' ) ? $this->get_args ( 'invoiceKey' ) : "";
 | 
												
											
												
													
														
															|  | @@ -2786,7 +2796,8 @@ class InvoiceController extends DooController {
 | 
												
													
														
															|  |  				'isReceivables' => $isReceivables 
 |  |  				'isReceivables' => $isReceivables 
 | 
												
													
														
															|  |  		) );
 |  |  		) );
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  | -	
 |  | 
 | 
												
													
														
															|  | 
 |  | +	*/
 | 
												
													
														
															|  | 
 |  | +		
 | 
												
													
														
															|  |  	/**
 |  |  	/**
 | 
												
													
														
															|  |  	 * 我的收款中 选择哪个发票入账,进行金额判断
 |  |  	 * 我的收款中 选择哪个发票入账,进行金额判断
 | 
												
													
														
															|  |  	 */
 |  |  	 */
 | 
												
											
												
													
														
															|  | @@ -2820,9 +2831,9 @@ class InvoiceController extends DooController {
 | 
												
													
														
															|  |  			) );
 |  |  			) );
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  |  	
 |  |  	
 | 
												
													
														
															|  | -	/*
 |  | 
 | 
												
													
														
															|  | 
 |  | +	/**
 | 
												
													
														
															|  | 
 |  | +	 * @deprecated
 | 
												
													
														
															|  |  	 * 获得与我有关收款数据 --需求变更 废弃
 |  |  	 * 获得与我有关收款数据 --需求变更 废弃
 | 
												
													
														
															|  | -	 */
 |  | 
 | 
												
													
														
															|  |  	function ajaxGetReceivalblesByStaff() {
 |  |  	function ajaxGetReceivalblesByStaff() {
 | 
												
													
														
															|  |  		$iid = $this->get_args ( 'key' ) ? $this->get_args ( 'key' ) : "";
 |  |  		$iid = $this->get_args ( 'key' ) ? $this->get_args ( 'key' ) : "";
 | 
												
													
														
															|  |  		Doo::loadModel ( 'invoiceReceivables' );
 |  |  		Doo::loadModel ( 'invoiceReceivables' );
 | 
												
											
												
													
														
															|  | @@ -2975,6 +2986,8 @@ class InvoiceController extends DooController {
 | 
												
													
														
															|  |  				'isReceivables' => $isReceivables 
 |  |  				'isReceivables' => $isReceivables 
 | 
												
													
														
															|  |  		) );
 |  |  		) );
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  | 
 |  | +	*/
 | 
												
													
														
															|  | 
 |  | +	
 | 
												
													
														
															|  |  	function ajaxGetInvoiceInfoByType() {
 |  |  	function ajaxGetInvoiceInfoByType() {
 | 
												
													
														
															|  |  		$type = $this->get_args ( 'type' ) ? $this->get_args ( 'type' ) : "";
 |  |  		$type = $this->get_args ( 'type' ) ? $this->get_args ( 'type' ) : "";
 | 
												
													
														
															|  |  		$serial = $this->get_args ( 'serial' ) ? $this->get_args ( 'serial' ) : "";
 |  |  		$serial = $this->get_args ( 'serial' ) ? $this->get_args ( 'serial' ) : "";
 | 
												
											
												
													
														
															|  | @@ -3615,11 +3628,13 @@ class InvoiceController extends DooController {
 | 
												
													
														
															|  |  				'asArray' => TRUE 
 |  |  				'asArray' => TRUE 
 | 
												
													
														
															|  |  		) );
 |  |  		) );
 | 
												
													
														
															|  |  		// 我的收款待入账
 |  |  		// 我的收款待入账
 | 
												
													
														
															|  | 
 |  | +		/*
 | 
												
													
														
															|  |  		$myClaim = $invoiceReceivables->getOne ( array (
 |  |  		$myClaim = $invoiceReceivables->getOne ( array (
 | 
												
													
														
															|  |  				'where' => " receivablesStaff like '" . $st [0] ['sid'] . "-%' and receivablesCategory like '" . $st [0] ['cid'] . ":%' and bindStatus=0",
 |  |  				'where' => " receivablesStaff like '" . $st [0] ['sid'] . "-%' and receivablesCategory like '" . $st [0] ['cid'] . ":%' and bindStatus=0",
 | 
												
													
														
															|  |  				'desc' => 'irid',
 |  |  				'desc' => 'irid',
 | 
												
													
														
															|  |  				'asArray' => TRUE 
 |  |  				'asArray' => TRUE 
 | 
												
													
														
															|  |  		) );
 |  |  		) );
 | 
												
													
														
															|  | 
 |  | +		*/
 | 
												
													
														
															|  |  		// 发票审批
 |  |  		// 发票审批
 | 
												
													
														
															|  |  		$approval = $invoice->getOne ( array (
 |  |  		$approval = $invoice->getOne ( array (
 | 
												
													
														
															|  |  				'where' => 'status=1 and pendingApprovals=' . $st [0] ['sid'],
 |  |  				'where' => 'status=1 and pendingApprovals=' . $st [0] ['sid'],
 | 
												
											
												
													
														
															|  | @@ -3646,19 +3661,19 @@ class InvoiceController extends DooController {
 | 
												
													
														
															|  |  		$new = array (
 |  |  		$new = array (
 | 
												
													
														
															|  |  				'GLOBAL' => FALSE,
 |  |  				'GLOBAL' => FALSE,
 | 
												
													
														
															|  |  				'pendingInvoice' => FALSE,
 |  |  				'pendingInvoice' => FALSE,
 | 
												
													
														
															|  | -				'myClaim' => FALSE,
 |  | 
 | 
												
													
														
															|  | 
 |  | +//				'myClaim' => FALSE,
 | 
												
													
														
															|  |  				'approval' => FALSE,
 |  |  				'approval' => FALSE,
 | 
												
													
														
															|  |  				'post' => FALSE,
 |  |  				'post' => FALSE,
 | 
												
													
														
															|  |  				'print' => FALSE,
 |  |  				'print' => FALSE,
 | 
												
													
														
															|  |  				'untread' => FALSE 
 |  |  				'untread' => FALSE 
 | 
												
													
														
															|  |  		);
 |  |  		);
 | 
												
													
														
															|  | -		
 |  | 
 | 
												
													
														
															|  | -		if (! empty ( $pendingInvoice ) || ! empty ( $myClaim ) || ! empty ( $approval ) || ! empty ( $post ) || ! empty ( $print ) || ! empty ( $untread ))
 |  | 
 | 
												
													
														
															|  | 
 |  | +		//|| ! empty ( $myClaim )
 | 
												
													
														
															|  | 
 |  | +		if (! empty ( $pendingInvoice )  || ! empty ( $approval ) || ! empty ( $post ) || ! empty ( $print ) || ! empty ( $untread ))
 | 
												
													
														
															|  |  			$new ['GLOBAL'] = TRUE;
 |  |  			$new ['GLOBAL'] = TRUE;
 | 
												
													
														
															|  |  		if (! empty ( $pendingInvoice ))
 |  |  		if (! empty ( $pendingInvoice ))
 | 
												
													
														
															|  |  			$new ['pendingInvoice'] = TRUE;
 |  |  			$new ['pendingInvoice'] = TRUE;
 | 
												
													
														
															|  | -		if (! empty ( $myClaim ))
 |  | 
 | 
												
													
														
															|  | -			$new ['myClaim'] = TRUE;
 |  | 
 | 
												
													
														
															|  | 
 |  | +// 		if (! empty ( $myClaim ))
 | 
												
													
														
															|  | 
 |  | +// 			$new ['myClaim'] = TRUE;
 | 
												
													
														
															|  |  		if (! empty ( $approval ))
 |  |  		if (! empty ( $approval ))
 | 
												
													
														
															|  |  			$new ['approval'] = TRUE;
 |  |  			$new ['approval'] = TRUE;
 | 
												
													
														
															|  |  		if (! empty ( $post ))
 |  |  		if (! empty ( $post ))
 |