Browse Source

我的带入账发票

caipin 7 năm trước cách đây
mục cha
commit
a3aade74a1

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

@@ -26,7 +26,7 @@ $acl ['ordinary'] ['allow'] = array (
 				'ajaxCompareInvoicePrice',
 				//新加普通
 				'invoiceUntreadIsAchieve',
-				
+				'invoiceMyUnAccountAchieve',
 				//删除核销相关操作
 				'invoiceUntreadDo',
 				//'ajaxGetReceivalblesByStaff',

+ 1 - 0
protected/config/routes.conf.php

@@ -397,6 +397,7 @@ $route['post']['/ajaxCompareInvoicePrice'] = array('InvoiceController', 'ajaxCom
 //普通新加路由
 $route['get']['/invoiceUntreadIsAchieve'] = array('InvoiceController', 'invoiceUntreadIsAchieve');
 $route['get']['/invoiceUntreadIsAchieve/:page'] = array('InvoiceController', 'invoiceUntreadIsAchieve');
+$route['get']['/invoiceMyUnAccountAchieve'] = array('InvoiceController', 'invoiceMyUnAccountAchieve');
 
 
 

+ 56 - 7
protected/controller/InvoiceController.php

@@ -80,11 +80,6 @@ class InvoiceController extends DooController {
 		Doo::loadModel ( 'invoice' );
 		$invoice = new invoice ();
 		
-// 		Doo::loadModel ( 'express' );
-// 		$express = new express ();
-// 		$expressList = $express->getExpressByAll ();
-// 		$this->data ['expressList'] = $expressList;
-		
 // 		Doo::loadModel ( 'invoiceReceivables' );
 // 		$invoiceReceivables = new invoiceReceivables ();
 // 		$list = $invoiceReceivables->getInvoiceReceivablesByClaim ( $this->staff [0] ['cid'], $this->staff [0] ['sid'] );
@@ -110,14 +105,19 @@ class InvoiceController extends DooController {
 		
 		$sql = 'status=2 and printStatus=1 and irid!="" and sid=' . $sid;
 		$list = $invoice->getInvoiceByUntreadStatusPage ( 4, $sql );
+		//我的待入账发票
+		$sql = "status=2 and printStatus=1 and untreadStatus=0 and irid='' and ( (doPost=1 and postStatus=1) or doPost=0 )  and isDelete=0 and sid=" . $sid;
+		$myInvoiceUnAccount = $invoice->getInvoiceByUntreadStatusPage ( 4, $sql );
 		
-		// print_r($list);
+		
+		//print_r($myInvoiceUnAccount);
 		
 		$this->data ['isMonth'] = $isMonth;
 		$this->data ['htm'] = $htm;
 		
 		$this->data ['invoiceList'] = $invoiceList;
 		$this->data ['receivablesList'] = $list;
+		$this->data ['myInvoiceUnAccount'] = $myInvoiceUnAccount;
 		
 		$this->data ['memu'] = "invoice";
 		$this->data ['staff'] = $this->staff;
@@ -1078,7 +1078,7 @@ class InvoiceController extends DooController {
 		);
 		$invoice->setInvoiceByCondition ( $item );
 		
-		 $this->setWXMsg ( $iid );
+		 //$this->setWXMsg ( $iid );
 		
 		return '/invoicePost';
 	}
@@ -2252,6 +2252,55 @@ class InvoiceController extends DooController {
 		$this->data ['receiptMemu'] = 'invoice';
 		$this->render ( "/admin/invoiceAchieve", $this->data );
 	}
+	
+	function invoiceMyUnAccountAchieve() {
+		Doo::loadModel ( 'invoice' );
+		$invoice = new invoice ();
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		$sid = $XDeode->decode ( $_COOKIE ["staff"] );
+		$MebSea = isset ( $this->params ['MebSea'] ) ? urldecode ( $this->params ['MebSea'] ) : '';
+	
+		$page_size = 18;
+		$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=2 and untreadStatus=3 and sid=' . $sid . $con;
+			$pageinfo = $this->get_page ( "CLD_invoice", $sql, $page, $page_size, "invoiceAchieve", $get, "" );
+	
+			$limit = $pageinfo ['lower'] . ',' . $page_size;
+	
+			$list = $invoice->getInvoiceByUntreadStatusPage ( $limit, $sql );
+			// print_r($pageinfo);
+			$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'] = 'invoice';
+			$this->render ( "/admin/invoiceAchieve", $this->data );
+	}
+	
 	function invoiceReceivablesAchieve() {
 		Doo::loadModel ( 'invoiceReceivables' );
 		$invoiceReceivables = new invoiceReceivables ();

+ 1 - 1
protected/model/invoice.php

@@ -464,7 +464,7 @@ class invoice extends DooModel {
 			$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 doPost=1 and postStatus=1  and isDelete=0 ".$title,
+				'where' => "status=2 and printStatus=1 and untreadStatus=0 and irid='' and ( (doPost=1 and postStatus=1) or doPost=0 ) and isDelete=0 ".$title,
 				'desc' => 'iid',
 				'asArray' => TRUE 
 		));

+ 4 - 1
protected/plugin/TemplateTag.php

@@ -18,10 +18,13 @@ Doo::conf ()->TEMPLATE_GLOBAL_TAGS = array (
 		'make_date',
 		'inarray',
 		'getGlobals',
+		'countArray',
 		'isInvoiceMoldShow'
 );
 
-
+function countArray($list=array()){
+	return count($list);
+}
 
 function isTimeTR($day = 3,$cTime) {
 	$flag=false;

+ 36 - 0
protected/view/admin/invoice.html

@@ -158,10 +158,46 @@
 								<blockquote><p class="colGray">暂时没有正在处理的发票 </p></blockquote>
 								<!-- endif -->
 							</div>
+							
+							
 							<div class="clearfix">
+								<legend><div class="fR"><a href="/invoiceMyUnAccountAchieve">查看更多</a></div>待入账({{countArray(myInvoiceUnAccount)}})</legend>
+								<!-- if !empty({{myInvoiceUnAccount}}) -->
+								<table class="table table-bordered table-condensed">
+									<tbody>
+									<tr><th class="taC">开票单位(抬头)</th><th class="taC" width="90">开票金额</th><th class="taC">开票流水号</th><th class="taC" width="90">收款金额</th><th class="taC">出票时间</th></tr>
+									<!-- loop myInvoiceUnAccount -->
+									<tr>
+										<td>
+											<!-- if !empty({{myInvoiceUnAccount' value.invoiceType}}) -->
+	                                   	{{myInvoiceUnAccount' value.invoiceCompany}}
+	                                    <!-- else -->
+	                                    {{myInvoiceUnAccount' value.invoiceTitle}}
+	                                    <!-- endif -->
+										</td>
+										<td>
+										<!-- if !empty({{myInvoiceUnAccount' value.invoiceType}}) -->
+	                                    <b>¥{{myInvoiceUnAccount' value.invoicePrice}}</b><sup>专</sup>
+	                                    <!-- else -->
+	                                    <b>¥{{myInvoiceUnAccount' value.invoicePrice}}</b>
+	                                    <!-- endif -->
+										</td>
+										<td><a href="#invdetail" node-invoice='INFO' data-isKey="{{myInvoiceUnAccount' value.iidKeyK}}" data-toggle="modal">{{myInvoiceUnAccount' value.invoiceSerial}}</a></td>
+										<td><b>{{myInvoiceUnAccount' value.irList.0.price}}</b></td>
+										<td>2016-03-03 11:30:03</td>
+									</tr>
+									<!-- endloop -->
+									
+									</tbody>
+								</table>
+								<!-- else -->
+								<blockquote><p class="colGray">暂时没有待入账的发票 </p></blockquote>
+								<!-- endif -->
+							</div>
 							
 							
 							
+							<div class="clearfix">
 							<legend><div class="fR"><a href="/invoiceAchieve">查看更多</a></div>最近入账</legend>
 							<!-- if !empty({{receivablesList}}) -->
 							<table class="table table-bordered table-condensed">