Kaynağa Gözat

培训班限制开票内容和邮寄物品
发票邮寄 记录上一次提交的邮寄单号,并直接填写入单号栏目

caipin 7 yıl önce
ebeveyn
işleme
4f8d076030

+ 25 - 26
protected/controller/InvoiceController.php

@@ -1304,6 +1304,14 @@ class InvoiceController extends DooController {
 		Doo::loadModel ( 'invoice' );
 		$invoice = new invoice ();
 		
+		
+		//加入限制必须填写入开票内容和邮寄物品
+		$invoiceStore = new invoiceStore ();
+		$isDetail=$invoiceStore->getInvoiceStoreByIsid($isid,'isid,trainId  ,invoiceElement,mailItemsJson');
+		if(empty($isDetail['invoiceElement'])||empty($isDetail['mailItemsJson'])){
+			header ( 'Content-Type:text/html;charset=utf-8' );
+			die ( 'illegal request! 请设置开票内容或邮寄物品' );
+		}
 		// 拷贝插入一条发票数据
 		$invoiceStore = new invoiceStore ();
 		$iid = $invoiceStore->setInvoiceStoreToApproval ( $isid );
@@ -1423,6 +1431,16 @@ class InvoiceController extends DooController {
 		
 		// 判断哪些已经加入审批过
 		
+		//加入限制必须填写入开票内容和邮寄物品
+		$invoiceStore = new invoiceStore ();
+		$isList=$invoiceStore->getInvoiceStoreInIsid($isidString,'isid,trainId  ,invoiceElement,mailItemsJson');
+		foreach ($isList as $key=>$value){
+			if(empty($value['invoiceElement'])||empty($value['mailItemsJson'])){
+				header ( 'Content-Type:text/html;charset=utf-8' );
+				die ( 'illegal request! 请设置开票内容或邮寄物品' );
+			}
+		}
+		
 		// 拷贝插入一条发票数据
 		$invoiceStore = new invoiceStore ();
 		$invoiceStore->setInvoiceStoreBatchToApproval ( $isidString );
@@ -1524,32 +1542,6 @@ class InvoiceController extends DooController {
 		);
 		$invoiceTraining->setInvoiceTrainByCondition ( $item );
 		
-		// Doo::loadModel ( 'invoiceOperationLog' );
-		// $item = array (
-		// 'date' => date ( "Y-m-d H:i:s" ),
-		// 'operation' => "创建",
-		// 'status' => 1,
-		// 'img' => $this->staff [0] ['avatar'],
-		// 'username' => $this->staff [0] ['username'],
-		// 'uid' => $this->staff [0] ['sid'],
-		// 'category' => $this->staff [0] ['category'],
-		// 'iid' => $iid
-		// );
-		
-		// $invoiceOperationLog = new invoiceOperationLog ();
-		// $invoiceOperationLog->setInvoiceOperationLog ( $item ,$iidString);
-		// $item = array (
-		// 'date' => date ( "Y-m-d H:i:s" ),
-		// 'operation' => "提交审批",
-		// 'status' => 1,
-		// 'img' => $this->staff [0] ['avatar'],
-		// 'username' => $this->staff [0] ['username'],
-		// 'uid' => $this->staff [0] ['sid'],
-		// 'category' => $this->staff [0] ['category'],
-		// 'iid' => $iid
-		// );
-		// $invoiceOperationLog->setInvoiceOperationLog ( $item );
-		
 		Doo::loadModel ( 'staff' );
 		$staff = new staff ();
 		$username2 = $staff->getOne ( array (
@@ -2400,6 +2392,11 @@ class InvoiceController extends DooController {
 		$invoicePosted = $invoice->getPostByInvoice ( 1 );
 		$expressList = $express->getExpressByAll ();
 		
+		$invoicePostExpress="";
+		if(isset($_COOKIE["invoicePostExpress"]))
+			$invoicePostExpress=$_COOKIE["invoicePostExpress"];
+		$this->data ['invoicePostExpress'] =$invoicePostExpress;
+		
 		$this->data ['expressList'] = $expressList;
 		$this->data ['invoicePost'] = $invoicePost;
 		$this->data ['invoicePosted'] = $invoicePosted;
@@ -2425,6 +2422,8 @@ class InvoiceController extends DooController {
 		
 		$invoicePrintDetail = $invoice->getInvoiceByIid ( $iid );
 		
+		setcookie('invoicePostExpress',$expressNumber);
+		
 		$item = array (
 				'iid' => $iid,
 				'postStatus' => 1,

+ 237 - 0
protected/view/admin/invoiceApprovalAchieveDevelopment.html

@@ -0,0 +1,237 @@
+<!-- include 'header' -->
+<script src="<?= WEB_SITE_GLOBAL ?>js/invoice.js"></script>
+<link href="<?= WEB_SITE_GLOBAL ?>css/datepicker.min.css" rel="stylesheet" type="text/css">
+<script src="<?= WEB_SITE_GLOBAL ?>js/datepicker.min.js"></script>
+<script src="<?= WEB_SITE_GLOBAL ?>js/datepicker.zh.js"></script>
+<link rel=stylesheet href="<?= WEB_SITE_GLOBAL ?>js/DataTables/jquery.dataTables.css"> 
+<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>js/DataTables/jquery.dataTables.min.js"></script>
+
+<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>js/dataTables.fixedColumns.min.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">
+				
+				<form action="/invoiceApprovalAchieveDevelopment/{{status}}" id="iaa" method="get" >
+				<ul class="cateList">
+						<li>
+							<a <!-- if {{status}}=='ALL' --> class="now" <!-- endif --> href="/invoiceApprovalAchieveDevelopment/ALL">所有</a>
+							<a <!-- if {{status}}=='PEND' --> class="now" <!-- endif --> href="/invoiceApprovalAchieveDevelopment/PEND" title="待审批发票">待审批发票</a>
+							<a <!-- if {{status}}=='APPROVED' --> class="now" <!-- endif --> href="/invoiceApprovalAchieveDevelopment/APPROVED" title="已审批发票">已审批发票</a>
+						</li>
+						<li>
+							<select name="invoiceType" node-invoiceType >
+								<option <!-- if {{invoiceType}}=='ALL' --> selected <!-- endif --> value="ALL">类型</option>
+								<option <!-- if {{invoiceType}}=='ORDINARY' --> selected <!-- endif --> value="ORDINARY">普通发票</option>
+								<option <!-- if {{invoiceType}}=='SPECIAL' --> selected <!-- endif --> value="SPECIAL">专用发票</option>
+							</select>
+						</li>
+						<li>
+							<select name="invoiceTrain" node-invoiceTrain >
+								<option <!-- if {{invoiceTrain}}=='ORDINARY' --> selected <!-- endif --> value="ORDINARY">个人发票</option>
+								<option <!-- if {{invoiceTrain}}=='TRAIN' --> selected <!-- endif --> value="TRAIN">培训班发票</option>
+							</select>
+						</li>
+						<li>
+						<div class="search">
+								<div class="input-append">
+									<input class="datepicker-here span3" name="date" value="{{dateString}}" placeholder="按时间筛选" type="text" data-range="true" data-multiple-dates-separator=" : " data-language="zh">
+									<button class="btn btn-small" type="submit">查询</button>
+								</div>
+							</div>
+						</li>
+						
+					</ul>
+					</form>
+				
+				
+				
+				
+				
+					
+				</div>
+				<div class="saeaList">
+				
+				
+				<table id="example" class="stripe row-border order-column" cellspacing="0" width="2400" >
+						<thead>
+							<tr class="thead">
+							<th>开票流水号</th>
+							<th>开票单位(抬头)</th>
+							<th>纳税人识别码</th>
+							<th>注册地址~电话</th>
+							<th>开户银行~账号</th>
+							<th>发票备注</th>
+							<th>收件人~电话</th>
+							<th>收件地址</th>
+							<th>邮寄物品</th>
+							
+							<th>开票内容</th>
+							<th>数量</th>
+							<th>单价</th>
+							<th>开票金额</th>
+							<th>提交开票</th>
+							<th>审批意见</th>
+							<th>完成审批</th>
+							</tr>
+						</thead>
+						<tbody>
+							
+						</tbody>
+						
+					</table>
+				
+				
+				
+				
+				
+				
+					
+				</div>
+						  		
+			  	
+			</div>
+		</div>
+	</div>
+	
+	
+	
+	
+<div loading-msg='true' style="position:absolute;  left:50%;  top:50%;  "></div>
+	<div class="modal  fade" id="approvalInvice">
+		
+		<div id="nc"></div>
+	</div>
+    <!--弹出内容-->        	
+<script type="text/javascript">autoFlashHeight();</script>	
+<script type="text/javascript">
+$(document).ready( function () {
+	
+	var table =$('#example').DataTable({
+		
+    	language: {
+    		"sProcessing": "处理中...",
+    		"sLengthMenu": "显示 _MENU_ 项结果",
+    		"sSearch": "搜索:",
+    		"sInfoEmpty": "显示第 0 至 0 项结果,共 0 项",
+    		"sEmptyTable": "表中数据为空",
+    		 "oPaginate": {
+    	            "sFirst": "首页",
+    	            "sPrevious": "上页",
+    	            "sNext": "下页",
+    	            "sLast": "末页"
+    	        },
+    		 "sInfo": "显示第 _START_ 至 _END_ 项结果,共 _TOTAL_ 项",
+    	},
+    	
+    	scrollY:        "700px",
+        scrollX:        true,
+        scrollCollapse: true,
+        paging:         true,
+        
+        serverSide: true,
+        ajax: {
+             url: '/ajaxGetinvoiceApprovalAchieveDevelopment',
+             type: 'POST',
+             "data": function ( d ) {
+                 return $.extend( {}, d, {
+                   "status": '{{status}}',
+                   'invoiceType':'{{invoiceType}}',
+                   'invoiceTrain':'{{invoiceTrain}}',
+                   'date':'{{dateString}}',
+                 } );
+               }
+        }
+
+    });
+	
+	
+	 
+	
+} );
+
+function nodeInvoiceApproval(iidKey){
+	var postData = iidKey;
+	var type =$(this).attr("data-type");
+	$("#nc").html('');
+	
+	$("div[loading-msg='true']").html("<img src='/global/img/loadIco.gif' />");
+	var url = "/ajaxGetInvoiceApprovalDetail";
+	$.ajax({
+		url : url,
+		type : "post",
+		cache : false,
+		dataType : "json",
+		data : {
+			serial : postData
+		},
+		global : true,
+		success : function(data) {
+			if (data.status == 1) {
+				$("#nc").html(data.html);
+			} else
+				$("div[loading-msg='true']").html("illegal request");
+		},
+		error : function(err) {
+			$("div[loading-msg='true']").html("");
+		}
+	});
+}
+
+function nodeInvoice(iidKey){		
+	
+	var postData = iidKey;
+	var type =$(this).attr("data-type");
+	$("#nc").html('');
+	var po='INVOICE';
+	
+	$("div[loading-msg='true']").html("<img src='/global/img/loadIco.gif' />");
+	var url = "/ajaxGetInvoiceInfoByType";
+	$.ajax({
+		url : url,
+		type : "post",
+		cache : false,
+		dataType : "json",
+		data : {
+			serial : postData,
+			type:po
+		},
+		global : true,
+		success : function(data) {
+			if (data.status == 1) {
+				$("div[loading-msg='true']").html("");
+				if(type=='receivables')
+					$("#nr").html(data.html);
+				else
+					$("#nc").html(data.html);
+			} else
+				$("div[loading-msg='true']").html("illegal request");
+		},
+		error : function(err) {
+			$("div[loading-msg='true']").html("");
+		}
+	});
+	}
+
+</script>
+
+
+</body>

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

@@ -179,7 +179,7 @@
 								<tr>
 									<th class="taC" width="100"><span class="colRed">*</span>快递单号</th>
 									<td><input type="text" name="nu"
-										placeholder="请正确填写单号,方便跟踪查询。"></td>
+										placeholder="请正确填写单号,方便跟踪查询。" value="{{invoicePostExpress}}"></td>
 								</tr>
 								<tr>
 									<th class="taC" width="100"><span class="colRed">*</span>邮寄物品</th>