|  | @@ -30,49 +30,49 @@ function isTimeTR($day = 3,$cTime) {
 | 
	
		
			
				|  |  |  	return $flag;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  function isInvoiceNew($type = "GLOBAL") {
 | 
	
		
			
				|  |  | -	Doo::loadModel ( 'invoice' );
 | 
	
		
			
				|  |  | -	$invoice = new invoice ();
 | 
	
		
			
				|  |  | -	Doo::loadModel ( 'invoiceReceivables' );
 | 
	
		
			
				|  |  | -	$invoiceReceivables = new invoiceReceivables ();
 | 
	
		
			
				|  |  | -	Doo::loadModel ( 'staff' );
 | 
	
		
			
				|  |  | -	$staff = new staff ();
 | 
	
		
			
				|  |  | +// 	Doo::loadModel ( 'invoice' );
 | 
	
		
			
				|  |  | +// 	$invoice = new invoice ();
 | 
	
		
			
				|  |  | +// 	Doo::loadModel ( 'invoiceReceivables' );
 | 
	
		
			
				|  |  | +// 	$invoiceReceivables = new invoiceReceivables ();
 | 
	
		
			
				|  |  | +// 	Doo::loadModel ( 'staff' );
 | 
	
		
			
				|  |  | +// 	$staff = new staff ();
 | 
	
		
			
				|  |  |  	
 | 
	
		
			
				|  |  | -	$st = $staff->getUserByIdList ( $_COOKIE ["staff"] );
 | 
	
		
			
				|  |  | +// 	$st = $staff->getUserByIdList ( $_COOKIE ["staff"] );
 | 
	
		
			
				|  |  |  	
 | 
	
		
			
				|  |  | -	// 我的发票待处理
 | 
	
		
			
				|  |  | -	$pendingInvoice = $invoice->getOne ( 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=" . $_COOKIE ["staff"],
 | 
	
		
			
				|  |  | -			'desc' => 'iid',
 | 
	
		
			
				|  |  | -			'asArray' => TRUE 
 | 
	
		
			
				|  |  | -	) );
 | 
	
		
			
				|  |  | -	// 我的收款待入账
 | 
	
		
			
				|  |  | -	$myClaim = $invoiceReceivables->getOne ( array (
 | 
	
		
			
				|  |  | -			'where' => " receivablesStaff like '" . $_COOKIE ["staff"] . "-%' and receivablesCategory like '" . $st [0] ['cid'] . ":%' and bindStatus=0",
 | 
	
		
			
				|  |  | -			'desc' => 'irid',
 | 
	
		
			
				|  |  | -			'asArray' => TRUE 
 | 
	
		
			
				|  |  | -	) );
 | 
	
		
			
				|  |  | -	// 发票审批
 | 
	
		
			
				|  |  | -	$approval = $invoice->getOne ( array (
 | 
	
		
			
				|  |  | -			'where' => 'status=1 and pendingApprovals=' . $_COOKIE ["staff"],
 | 
	
		
			
				|  |  | -			'desc' => 'iid',
 | 
	
		
			
				|  |  | -			'asArray' => true 
 | 
	
		
			
				|  |  | -	) );
 | 
	
		
			
				|  |  | -	// 发票邮寄
 | 
	
		
			
				|  |  | -	$post = $invoice->getOne ( array (
 | 
	
		
			
				|  |  | -			'where' => "postStatus=0 and doPost=1 and status=2",
 | 
	
		
			
				|  |  | -			'asArray' => TRUE 
 | 
	
		
			
				|  |  | -	) );
 | 
	
		
			
				|  |  | -	// 发票打印
 | 
	
		
			
				|  |  | -	$print = $invoice->getOne ( array (
 | 
	
		
			
				|  |  | -			'where' => "status=2 and printStatus=0 and moldManage like '%[\"" . $_COOKIE ["staff"] . "\",%'",
 | 
	
		
			
				|  |  | -			'desc' => 'iid',
 | 
	
		
			
				|  |  | -			'asArray' => TRUE 
 | 
	
		
			
				|  |  | -	) );
 | 
	
		
			
				|  |  | -	// 发票退票
 | 
	
		
			
				|  |  | -	$untread = $invoice->getOne ( array (
 | 
	
		
			
				|  |  | -			'where' => " printStatus=1 and untreadStatus=1 and status=2 ",
 | 
	
		
			
				|  |  | -			'asArray' => TRUE 
 | 
	
		
			
				|  |  | -	) );
 | 
	
		
			
				|  |  | +// 	// 我的发票待处理
 | 
	
		
			
				|  |  | +// 	$pendingInvoice = $invoice->getOne ( 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=" . $_COOKIE ["staff"],
 | 
	
		
			
				|  |  | +// 			'desc' => 'iid',
 | 
	
		
			
				|  |  | +// 			'asArray' => TRUE 
 | 
	
		
			
				|  |  | +// 	) );
 | 
	
		
			
				|  |  | +// 	// 我的收款待入账
 | 
	
		
			
				|  |  | +// 	$myClaim = $invoiceReceivables->getOne ( array (
 | 
	
		
			
				|  |  | +// 			'where' => " receivablesStaff like '" . $_COOKIE ["staff"] . "-%' and receivablesCategory like '" . $st [0] ['cid'] . ":%' and bindStatus=0",
 | 
	
		
			
				|  |  | +// 			'desc' => 'irid',
 | 
	
		
			
				|  |  | +// 			'asArray' => TRUE 
 | 
	
		
			
				|  |  | +// 	) );
 | 
	
		
			
				|  |  | +// 	// 发票审批
 | 
	
		
			
				|  |  | +// 	$approval = $invoice->getOne ( array (
 | 
	
		
			
				|  |  | +// 			'where' => 'status=1 and pendingApprovals=' . $_COOKIE ["staff"],
 | 
	
		
			
				|  |  | +// 			'desc' => 'iid',
 | 
	
		
			
				|  |  | +// 			'asArray' => true 
 | 
	
		
			
				|  |  | +// 	) );
 | 
	
		
			
				|  |  | +// 	// 发票邮寄
 | 
	
		
			
				|  |  | +// 	$post = $invoice->getOne ( array (
 | 
	
		
			
				|  |  | +// 			'where' => "postStatus=0 and doPost=1 and status=2",
 | 
	
		
			
				|  |  | +// 			'asArray' => TRUE 
 | 
	
		
			
				|  |  | +// 	) );
 | 
	
		
			
				|  |  | +// 	// 发票打印
 | 
	
		
			
				|  |  | +// 	$print = $invoice->getOne ( array (
 | 
	
		
			
				|  |  | +// 			'where' => "status=2 and printStatus=0 and moldManage like '%[\"" . $_COOKIE ["staff"] . "\",%'",
 | 
	
		
			
				|  |  | +// 			'desc' => 'iid',
 | 
	
		
			
				|  |  | +// 			'asArray' => TRUE 
 | 
	
		
			
				|  |  | +// 	) );
 | 
	
		
			
				|  |  | +// 	// 发票退票
 | 
	
		
			
				|  |  | +// 	$untread = $invoice->getOne ( array (
 | 
	
		
			
				|  |  | +// 			'where' => " printStatus=1 and untreadStatus=1 and status=2 ",
 | 
	
		
			
				|  |  | +// 			'asArray' => TRUE 
 | 
	
		
			
				|  |  | +// 	) );
 | 
	
		
			
				|  |  |  	
 | 
	
		
			
				|  |  |  	$new = array (
 | 
	
		
			
				|  |  |  			'GLOBAL' => FALSE,
 |