caipin 8 éve
szülő
commit
81f41bd561

+ 341 - 0
global/js/autoTag.js

@@ -0,0 +1,341 @@
+
+
+
+$(function() {
+	
+	$("#tags").blur(function(){
+		
+		var url="/checkClient";
+		
+		var name=$(this).val();
+		
+		$.ajax({
+			url:url,
+			type: "post",
+			cache: false,
+			dataType: "json",
+			data: {
+				name:name
+			},
+			global: true,
+			success: function(data){
+				
+				if(data.success){
+					$("#tags").css("background-color","#fff");
+				}else{
+					$("#tags").css("background-color","#f15b6c");
+				}
+			},
+			error:function(err){
+				$("#tags").css("background-color","#f15b6c");
+			}
+			});
+		
+		
+	});
+	
+	$("#tags").autocomplete({
+        source: function( request, response ) {
+            $.ajax({
+                url: "/searchClient",
+                dataType: "json",
+                data:{
+                    searchDbInforItem: request.term
+                },
+                success: function( data ) {
+                	
+                    response( $.map( data, function( item ) {
+                    	
+                        return {
+                            name:item.clientname+"-"+item.companyname,
+                            
+                            value: item.clientname+"-"+item.companyname
+                        }
+                    }));
+                }
+            });
+        },
+        minLength: 1,
+        select: function( event, ui ) {
+            $("#tags").val(ui.item.dbId);
+            
+        }
+    });
+
+	$("#tags2").blur(function(){
+		
+		var url="/checkClient";
+		
+		var name=$(this).val();
+		
+		$.ajax({
+			url:url,
+			type: "post",
+			cache: false,
+			dataType: "json",
+			data: {
+				name:name
+			},
+			global: true,
+			success: function(data){
+				
+				if(data.success){
+					$("#tags2").css("background-color","#fff");
+				}else{
+					$("#tags2").css("background-color","#f15b6c");
+				}
+			},
+			error:function(err){
+				$("#tags2").css("background-color","#f15b6c");
+			}
+			});
+		
+		
+	});
+	
+	$( "#tags2" ).autocomplete({
+        source: function( request, response ) {
+            $.ajax({
+                url: "/searchClient",
+                dataType: "json",
+                data:{
+                    searchDbInforItem: request.term
+                },
+                success: function( data ) {
+                	
+                    response( $.map( data, function( item ) {
+                    	
+                        return {
+                            name:item.clientname+"-"+item.companyname,
+                            
+                            value: item.clientname+"-"+item.companyname
+                        }
+                    }));
+                }
+            });
+        },
+        minLength: 1,
+        select: function( event, ui ) {
+        	//var str=ui.item.dbId;console.log(str);
+        	//var str2=str.split(" ");
+           $("#tags2").val(ui.item.dbId);
+            
+        }
+    });
+
+	
+$("#tags3").blur(function(){
+		
+		var url="/checkLongle";
+		
+		var name=$(this).val();
+		
+		$.ajax({
+			url:url,
+			type: "post",
+			cache: false,
+			dataType: "json",
+			data: {
+				name:name
+			},
+			global: true,
+			success: function(data){
+				
+				if(data.success){
+					$("#tags3").css("background-color","#fff");
+				}else{
+					$("#tags3").css("background-color","#f15b6c");
+				}
+			},
+			error:function(err){
+				$("#tags3").css("background-color","#f15b6c");
+			}
+			});
+		
+		
+	});
+	
+	$( "#tags3" ).autocomplete({
+        source: function( request, response ) {
+            $.ajax({
+                url: "/searchLongle",
+                dataType: "json",
+                data:{
+                    searchDbInforItem: request.term
+                },
+                success: function( data ) {
+                	
+                    response( $.map( data, function( item ) {
+                    	
+                        return {
+                            name:item.key_num+"-"+item.product,
+                            
+                            value: item.key_num+"-"+item.product
+                        }
+                    }));
+                }
+            });
+        },
+        max: 12,
+        minLength: 3,
+        select: function( event, ui ) {
+            $("#tags3").val(ui.item.dbId);
+            
+        }
+    });
+	
+	
+	$("#tags4").blur(function(){
+		
+		var url="/checkClient";
+		
+		var name=$(this).val();
+		
+		$.ajax({
+			url:url,
+			type: "post",
+			cache: false,
+			dataType: "json",
+			data: {
+				name:name
+			},
+			global: true,
+			success: function(data){
+				
+				if(data.success){
+					$("#tags4").css("background-color","#fff");
+				}else{
+					$("#tags4").css("background-color","#f15b6c");
+				}
+			},
+			error:function(err){
+				$("#tags4").css("background-color","#f15b6c");
+			}
+			});
+		
+		
+	});
+	
+	$( "#tags4" ).autocomplete({
+        source: function( request, response ) {
+            $.ajax({
+                url: "/searchClient",
+                dataType: "json",
+                data:{
+                    searchDbInforItem: request.term
+                },
+                success: function( data ) {
+                	
+                    response( $.map( data, function( item ) {
+                    	
+                        return {
+                            name:item.clientname+"-"+item.companyname,
+                            
+                            value: item.clientname+"-"+item.companyname
+                        }
+                    }));
+                }
+            });
+        },
+        minLength: 1,
+        select: function( event, ui ) {
+        	//var str=ui.item.dbId;console.log(str);
+        	//var str2=str.split(" ");
+           $("#tags4").val(ui.item.dbId);
+            
+        }
+    });
+	
+	
+$("#tags5").blur(function(){
+		
+		var url="/checkCompany";
+		
+		var name=$(this).val();
+		
+		$.ajax({
+			url:url,
+			type: "post",
+			cache: false,
+			dataType: "json",
+			data: {
+				name:name
+			},
+			global: true,
+			success: function(data){
+				
+				if(data.success){
+					$("#tags5").css("background-color","");
+					$("#contactPanelNew").html("<table><tbody><tr><td colspan='4'><input type='hidden' name='cid' value='"+data.data.cid+"'/><input type='submit' value='确定'  class='button' /></td></tr></tbody></table>");
+				}else{
+					$html='	<table><tbody>';
+					
+					$html+='<tr><th>单位传真</th><td><input type="text" name="fax"> </td><th>主页</th><td><input type="text" name="webservice"> </td></tr>';
+					$html+='<tr><th>单位地区</th><td colspan="3"><select name="lv21" id="lv21" onchange="dislv(\'lv21\',22);">';
+					$html+=data.nature['district'];
+					$html+='</select><span id="mlv22"><select><option></option></select></span>';
+					$html+='<span id="mlv23"><select><option></option></select></span>';
+					$html+='</td></tr>';
+					$html+='<tr><th>单位地址</th><td colspan="3"><input type="text" name="address"> </td></tr>';
+					$html+='<tr><th>单位性质</th><td colspan="5">';
+					
+					for(var i=1;i<=data.nature.naturelenght;i++){
+						$html+='<label><input type="checkbox" name="nature[]" value="'+data.nature[i]+'">'+data.nature[i]+'</label>&nbsp;';
+					}
+					
+					$html+='<tr><th>乘车路线</th><td colspan="3"><input type="text" name="ride"> </td></tr>';
+					$html+='<tr><th>地标建筑</th><td colspan="3"><input type="text" name="landmarks"> </td></tr>';
+					$html+='<tr><th>住宿参考</th><td colspan="3"><input type="text" name="stay"> </td></tr>';
+					$html+='<tr><td colspan="4"><input type="submit" value="确定"  class="button" /></td></tr>';
+						
+					$html+='</tbody></table>';
+					
+					$("#contactPanelNew").html($html);
+					$("#tags5").css("background-color","#f15b6c");
+				}
+			},
+			error:function(err){
+				$("#contactPanelNew").html("");
+				$("#tags5").css("background-color","#f15b6c");
+			}
+			});
+		
+		
+	});
+	
+	$( "#tags5" ).autocomplete({
+        source: function( request, response ) {
+            $.ajax({
+                url: "/searchCompany",
+                dataType: "json",
+                data:{
+                    searchDbInforItem: request.term
+                },
+                success: function( data ) {
+                	
+                    response( $.map( data, function( item ) {
+                    	
+                        return {
+                            name:item.companyname+"-"+item.local,
+                            
+                            value: item.companyname+"-"+item.local
+                        }
+                    }));
+                }
+            });
+        },
+        minLength: 1,
+        select: function( event, ui ) {
+        	//var str=ui.item.dbId;console.log(str);
+        	//var str2=str.split(" ");
+           $("#tags5").val(ui.item.dbId);
+            
+        }
+    });
+	
+	
+	
+	
+
+})
+

+ 54 - 1
global/js/invoice.js

@@ -1,10 +1,31 @@
 $(function() {
+	
+	$('a[node-express="untread"]').click(function() {
+		$('td[node-express="msg"]').html($(this).attr('title'));
+	});
+	
+	$("input[name='untreadPost']").click(function() {
+		$("table[post-box='ture']").hide();
+	});
+	
+	$("input[node-untread='post']").click(function() {
+		$("table[post-box='ture']").show();
+	});
+	
 	$("a[node-approval^='approval']").click(function() {
 		$("input[name='status']").val($(this).attr("diss-data"));
 		$("form[name='invoiceApproval']").submit();
 	});
 
-	$("a[node-post^='express']").click(function() {
+	$("a[node-invoice='droppedInvoice']").click(function() {
+		$("input[name='droppedIidKey']").val($(this).attr("diss-data"));
+	});
+	
+	$("a[node-invoice='untreadInvoice']").click(function() {
+		$("input[name='untreadIidKey']").val($(this).attr("diss-data"));
+	});
+	
+	$("a[node-post='express']").click(function() {
 		var postData = $(this).attr("post-data");
 		$("input[name='iidKey']").val(postData);
 		
@@ -34,4 +55,36 @@ $(function() {
 		});
 	});
 
+	$("a[node-post='express-msg']").click(function() {
+		var postData = $(this).attr("post-data");
+		
+		$("div[loading-msg='express-msg']").html("<img src='/global/img/loadIco.gif' />");
+		var url = "/ajaxGetInvoicePostDetail";
+		$.ajax({
+			url : url,
+			type : "post",
+			cache : false,
+			dataType : "json",
+			data : {
+				iidKey : postData
+			},
+			global : true,
+			success : function(data) {
+				if (data.status == 1) {
+					$("td[recipients-data='express-msg']").html(data.invoiceDetail.recipients);
+					$("td[recipientsPhone-data='express-msg']").html(data.invoiceDetail.recipientsPhone);
+					$("td[recipientsAddress-data='express-msg']").html(data.invoiceDetail.recipientsAddress);
+					$("td[mailItems-data='express-msg']").html(data.invoiceDetail.mailItems);
+					$("td[actualItems-data='express-msg']").html(data.invoiceDetail.actualItems);
+					$("td[expressCompany-data='express-msg']").html(data.invoiceDetail.expressCompany);
+					$("td[expressNumber-data='express-msg']").html(data.invoiceDetail.expressNumber+"&nbsp;<a target='_blank' href='http://www.kuaidi100.com/chaxun?com="+data.invoiceDetail.expressCom+"&nu="+data.invoiceDetail.expressNumber+"'>点击查询快递信息</a>");
+					$("div[loading-msg='express-msg']").html("");
+				} else
+					$("div[loading-msg='express-msg']").html("illegal request");
+			},
+			error : function(err) {
+			}
+		});
+	});
+	
 })

+ 28 - 0
global/js/invoice.validator.js

@@ -77,4 +77,32 @@ $(function () {
 	    }
 	});
 
+	$("form[name='invoiceExpress']").validator({
+		timely: 3,
+	    focusCleanup: true,
+	    theme:"yellow_top",
+	    fields: {
+	        'actualItems': 'required; ',
+	        'nu': 'required; ',
+	        'express': 'required; '
+	    }
+	});
+	
+	$("form[name='untreadInvoice']").validator({
+	    timely: 3,
+	    focusCleanup: true,
+	    rules: {
+	        isUntread: function() {
+	        	return $("input[node-untread='post']").prop('checked');
+	        }
+	    },
+	    fields: {
+	    	 untreadReason: 'required; '
+		    ,untreadPost: 'required; '
+			,untreadCompany: 'required(isUntread); '
+			,untreadNumber: 'required(isUntread); '
+			,untreadItems: 'required(isUntread); '
+	    }
+	});
+	
 })

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1177 - 0
global/js/jquery-ui.css


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 15003 - 0
global/js/jquery-ui.js


+ 1 - 0
protected/config/execute/invoice.ini

@@ -0,0 +1 @@
+,43,58,50,50

+ 1 - 0
protected/config/invoice/invoice.ini

@@ -0,0 +1 @@
+{"\u53d1\u7968\u6253\u5370":"43,58","\u53d1\u7968\u5ba1\u6279":",50"}

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

@@ -360,6 +360,17 @@ $route['*']['/invoicePrintDetail/:iid'] = array('InvoiceController', 'invoicePri
 $route['*']['/invoicePrintDo'] = array('InvoiceController', 'invoicePrintDo');
 $route['*']['/invoicePost'] = array('InvoiceController', 'invoicePost');
 $route['*']['/invoiceExpressAddDo'] = array('InvoiceController', 'invoiceExpressAddDo');
+$route['post']['/invoiceDroppedDo'] = array('InvoiceController', 'invoiceDroppedDo');
+$route['get']['/invoiceDelDo/:iid'] = array('InvoiceController', 'invoiceDelDo','extension'=>'.do');
+$route['*']['/invoiceEdit/:iid'] = array('InvoiceController', 'invoiceEdit','extension'=>'.html');
+$route['*']['/invoiceEditDo'] = array('InvoiceController', 'invoiceEditDo');
+$route['post']['/invoiceUntreadDo'] = array('InvoiceController', 'invoiceUntreadDo');
+$route['get']['/invoiceUntread'] = array('InvoiceController', 'invoiceUntread');
+$route['post']['/invoiceUntreadEstablishedDo'] = array('InvoiceController', 'invoiceUntreadEstablishedDo');
+
+$route['get']['/invoiceReceivables'] = array('InvoiceController', 'invoiceReceivables');
+
+
 $route['post']['/ajaxGetInvoicePostDetail'] = array('InvoiceController', 'ajaxGetInvoicePostDetail');
 
 //假期管理

+ 1 - 0
protected/controller/AdminController.php

@@ -836,6 +836,7 @@ class AdminController extends DooController {
 				'发票审批' => '',
 				'发票打印' => '',
 				'发票邮寄' => '',
+				'发票退票' => '',
 				'公司汇总查阅' => '' 
 		);
 		foreach ( $list as $key => $value ) {

+ 378 - 91
protected/controller/InvoiceController.php

@@ -37,10 +37,14 @@ class InvoiceController extends DooController {
 	function invoice() {
 		Doo::loadModel ( 'invoice' );
 		$invoice = new invoice ();
+		Doo::loadModel ( 'express' );
+		$express = new express ();
 		
-		$pendingInvoice = $invoice->getPendingByInvoice ();
+		$expressList = $express->getExpressByAll ();
+		$invoiceList = $invoice->getMyInvoice ( $_COOKIE ["staff"] );
 		
-		$data ['pendingInvoice'] = $pendingInvoice;
+		$data ['expressList'] = $expressList;
+		$data ['invoiceList'] = $invoiceList;
 		
 		$data ['memu'] = "invoice";
 		$data ['staff'] = $this->staff;
@@ -131,6 +135,8 @@ class InvoiceController extends DooController {
 					$moldManage [$value ['mold']] = $value ['staffList'];
 				elseif ($value ['mold'] == '发票邮寄')
 					$moldManage [$value ['mold']] = $value ['staffList'];
+				elseif ($value ['mold'] == '发票退票')
+					$moldManage [$value ['mold']] = $value ['staffList'];
 			}
 			
 			$item = array (
@@ -202,6 +208,256 @@ class InvoiceController extends DooController {
 		
 		return "/invoice";
 	}
+	function invoiceEdit() {
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		
+		$iid = isset ( $this->params ['iid'] ) ? $this->params ['iid'] : "";
+		$iid = $XDeode->decode ( $iid );
+		if (! is_numeric ( $iid ))
+			die ( 'illegal request' );
+		
+		Doo::loadModel ( 'invoice' );
+		$invoice = new invoice ();
+		Doo::loadModel ( 'invoiceOperationLog' );
+		$invoiceOperationLog = new invoiceOperationLog ();
+		
+		$invoiceDetail = $invoice->getInvoiceByIid ( $iid );
+		$operation = $invoiceOperationLog->getInvoiceOperationByDropped ( $iid );
+		
+		$data ['operation'] = $operation;
+		$data ['invoiceDetail'] = $invoiceDetail;
+		$data ['memu'] = "invoice";
+		$data ['staff'] = $this->staff;
+		$data ['receiptMemu'] = 'invoiceApproval';
+		$this->render ( "/admin/invoiceEdit", $data );
+	}
+	/**
+	 * 重新编辑退回的发票
+	 * @return string
+	 */
+	function invoiceEditDo() {
+		$iidKey = $this->get_args ( 'iidKey' ) ? $this->get_args ( 'iidKey' ) : '';
+		Doo::loadModel ( 'invoice' );
+		$invoice = new invoice ();
+		$iid = $invoice->authcode ( $iidKey );
+		if (! empty ( $iid ) && ! is_numeric ( $iid ))
+			die ( 'illegal request' );
+		
+		$cid = $this->get_args ( 'cid' ) ? $this->get_args ( 'cid' ) : 0;
+		$invoiceType = $this->get_args ( 'invoiceType' ) && is_numeric ( $this->get_args ( 'invoiceType' ) ) ? $this->get_args ( 'invoiceType' ) : 0;
+		$doPost = $this->get_args ( 'doPost' ) && is_numeric ( $this->get_args ( 'doPost' ) ) ? $this->get_args ( 'doPost' ) : 0;
+		$invoicePrice = $this->get_args ( 'invoicePrice' ) ? $this->get_args ( 'invoicePrice' ) : "";
+		$invoiceElement = $this->get_args ( 'invoiceElement' ) ? $this->get_args ( 'invoiceElement' ) : "";
+		$invoiceTitle = $this->get_args ( 'invoiceTitle' ) ? $this->get_args ( 'invoiceTitle' ) : "";
+		$invoiceCompany = $this->get_args ( 'invoiceCompany' ) ? $this->get_args ( 'invoiceCompany' ) : "";
+		$TIN = $this->get_args ( 'TIN' ) ? $this->get_args ( 'TIN' ) : "";
+		$address = $this->get_args ( 'address' ) ? $this->get_args ( 'address' ) : "";
+		$phone = $this->get_args ( 'phone' ) ? $this->get_args ( 'phone' ) : "";
+		$bank = $this->get_args ( 'bank' ) ? $this->get_args ( 'bank' ) : "";
+		$bankAccount = $this->get_args ( 'bankAccount' ) ? $this->get_args ( 'bankAccount' ) : "";
+		$recipients = $this->get_args ( 'recipients' ) ? $this->get_args ( 'recipients' ) : "";
+		$recipientsPhone = $this->get_args ( 'recipientsPhone' ) ? $this->get_args ( 'recipientsPhone' ) : "";
+		$recipientsAddress = $this->get_args ( 'recipientsAddress' ) ? $this->get_args ( 'recipientsAddress' ) : "";
+		
+		$mailItems = $this->get_args ( 'mailItems' ) ? $this->get_args ( 'mailItems' ) : "";
+		$remark = $this->get_args ( 'remark' ) ? $this->get_args ( 'remark' ) : "";
+		
+		if (! empty ( $cid ) && ! empty ( $invoicePrice ) && ! empty ( $invoiceElement ) && ! empty ( $iid )) {
+			
+			Doo::loadModel ( 'invoiceManage' );
+			$invoiceManage = new invoiceManage ();
+			Doo::loadModel ( 'invoiceOperationLog' );
+			$invoiceOperationLog = new invoiceOperationLog ();
+			
+			$cid = explode ( ':', $cid );
+			
+			$invoiceManageList = $invoiceManage->getInvoiceByAll ();
+			$invoiceManageDetail = $invoiceManage->getInvoiceByMold ( "发票审批" );
+			
+			$moldManage = array ();
+			foreach ( $invoiceManageList as $key => $value ) {
+				if ($value ['mold'] == '发票打印')
+					$moldManage [$value ['mold']] = $value ['staffList'];
+				elseif ($value ['mold'] == '发票邮寄')
+					$moldManage [$value ['mold']] = $value ['staffList'];
+				elseif ($value ['mold'] == '发票打印')
+					$moldManage [$value ['mold']] = $value ['staffList'];
+			}
+			
+			$item = array (
+					'iid' => $iid,
+					'cid' => $cid [0],
+					'categoryName' => $cid [1],
+					'invoiceElement' => $invoiceElement,
+					'invoicePrice' => $invoicePrice,
+					'invoiceType' => $invoiceType,
+					'doPost' => $doPost,
+					'status' => 1,
+					'updateTime' => date ( "Y-m-d H:i:s" ),
+					'remark' => $remark 
+			);
+			if ($invoiceType == 0)
+				$item += array (
+						'invoiceTitle' => $invoiceTitle 
+				);
+			else {
+				$item += array (
+						'invoiceCompany' => $invoiceCompany,
+						'TIN' => $TIN,
+						'address' => $address,
+						'phone' => $phone,
+						'bank' => $bank,
+						'bankAccount' => $bankAccount 
+				);
+			}
+			if ($doPost == 1) {
+				$item += array (
+						'recipients' => $recipients,
+						'recipientsPhone' => $recipientsPhone,
+						'recipientsAddress' => $recipientsAddress,
+						'mailItems' => $mailItems 
+				);
+			}
+			$invoice->setInvoiceByCondition ( $item );
+			
+			$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 );
+		}
+		
+		return "/invoice";
+	}
+	
+	/**
+	 * 终止开票
+	 */
+	function invoiceDroppedDo() {
+		$droppedIidKey = $this->get_args ( 'droppedIidKey' ) ? $this->get_args ( 'droppedIidKey' ) : '';
+		Doo::loadModel ( 'invoice' );
+		$invoice = new invoice ();
+		Doo::loadModel ( 'invoiceOperationLog' );
+		$invoiceOperationLog = new invoiceOperationLog ();
+		
+		$iid = $invoice->authcode ( $droppedIidKey );
+		if (! empty ( $iid ) && ! is_numeric ( $iid ))
+			die ( 'illegal request' );
+		
+		$item = array (
+				'iid' => $iid,
+				'status' => 4,
+				'updateTime' => date ( "Y-m-d H:i:s" ) 
+		);
+		$invoice->setInvoiceByCondition ( $item );
+		$item = array (
+				'date' => date ( "Y-m-d H:i:s" ),
+				'operation' => '终止了开票',
+				'status' => 4,
+				'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 );
+		return "/invoice";
+	}
+	/**
+	 * 申请退票
+	 */
+	function invoiceUntreadDo(){
+		$untreadIidKey = $this->get_args ( 'untreadIidKey' ) ? $this->get_args ( 'untreadIidKey' ) : '';
+		$untreadReason = $this->get_args ( 'untreadReason' ) ? $this->get_args ( 'untreadReason' ) : "";
+		$untreadPost = $this->get_args ( 'untreadPost' ) ? $this->get_args ( 'untreadPost' ) : "";
+		$untreadCompany = $this->get_args ( 'untreadCompany' ) ? $this->get_args ( 'untreadCompany' ) : "";
+		$untreadNumber = $this->get_args ( 'untreadNumber' ) ? $this->get_args ( 'untreadNumber' ) : "";
+		$untreadItems = $this->get_args ( 'untreadItems' ) ? $this->get_args ( 'untreadItems' ) : "";
+		
+		Doo::loadModel ( 'invoice' );
+		$invoice = new invoice ();
+		Doo::loadModel ( 'invoiceOperationLog' );
+		$invoiceOperationLog = new invoiceOperationLog ();
+		
+		$iid = $invoice->authcode ( $untreadIidKey );
+		if (! empty ( $iid ) && ! is_numeric ( $iid ))
+			die ( 'illegal request' );
+		
+		$item = array (
+				'iid' => $iid,
+				'untreadStatus' => 1,
+				'untreadReason' => $untreadReason,
+				'untreadPost' => $untreadPost,
+				'updateTime' => date ( "Y-m-d H:i:s" )
+		);
+		if($untreadPost==1){
+			$item += array (
+					'untreadCompany' => $untreadCompany,
+					'untreadNumber' => $untreadNumber,
+					'untreadItems' => $untreadItems
+			);
+		}
+		$invoice->setInvoiceByCondition ( $item );
+		$item = array (
+				'date' => date ( "Y-m-d H:i:s" ),
+				'operation' => '申请退票',
+				'status' => 7,
+				'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 );
+		
+		return "/invoice";
+	}
+	
+	/**
+	 * 删除已终止的开票
+	 */
+	function invoiceDelDo() {
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		Doo::loadModel ( 'invoice' );
+		$invoice = new invoice ();
+		Doo::loadModel ( 'invoiceOperationLog' );
+		$invoiceOperationLog = new invoiceOperationLog ();
+		
+		$iid = isset ( $this->params ['iid'] ) ? $this->params ['iid'] : "";
+		$iid = $XDeode->decode ( $iid );
+		
+		if (! is_numeric ( $iid ))
+			die ( 'illegal request' );
+		$invoiceDetail = $invoice->getMyInvoice ( $_COOKIE ["staff"], $iid );
+		if (empty ( $invoiceDetail ))
+			die ( 'illegal request' );
+		$item = array (
+				'iid' => $iid,
+				'isDelete' => 1,
+				'updateTime' => date ( "Y-m-d H:i:s" ) 
+		);
+		$invoice->setInvoiceByCondition ( $item );
+		$item = array (
+				'date' => date ( "Y-m-d H:i:s" ),
+				'operation' => '删除了已终止的发票',
+				'status' => 4,
+				'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 );
+		return "/invoice";
+	}
 	function invoiceApproval() {
 		Doo::loadModel ( 'invoice' );
 		$invoice = new invoice ();
@@ -261,7 +517,7 @@ class InvoiceController extends DooController {
 		
 		$data ['invoiceDetail'] = $invoiceDetail;
 		$data ['invoiceOperationLogList'] = $invoiceOperationLogList;
-		$data ['INVOICEKEY'] = $this->authcode ( $invoiceDetail ['iid'], '' );
+		$data ['INVOICEKEY'] = $invoice->authcode ( $invoiceDetail ['iid'], '' );
 		$data ['memu'] = "invoice";
 		$data ['staff'] = $this->staff;
 		$data ['receiptMemu'] = 'invoiceApproval';
@@ -278,18 +534,20 @@ class InvoiceController extends DooController {
 	 * @return string 如操作成功返回审批首页
 	 */
 	function invoiceApprovalDo() {
+		Doo::loadModel ( 'invoice' );
+		$invoice = new invoice ();
+		
 		$iid = $this->get_args ( 'invoiceKey' ) ? $this->get_args ( 'invoiceKey' ) : "";
 		$status = $this->get_args ( 'status' ) && is_numeric ( $this->get_args ( 'status' ) ) ? $this->get_args ( 'status' ) : 0;
 		$opinion = $this->get_args ( 'opinion' ) ? $this->get_args ( 'opinion' ) : "";
-		$iid = $this->authcode ( $iid );
+		$iid = $invoice->authcode ( $iid );
 		if (! is_numeric ( $iid ))
 			die ( 'illegal request' );
 		
 		if (! empty ( $iid ) && ! empty ( $status ) && ! empty ( $opinion )) {
 			if (! ($status == 2 || $status == 3 || $status == 4))
 				die ( 'illegal request' );
-			Doo::loadModel ( 'invoice' );
-			$invoice = new invoice ();
+			
 			Doo::loadModel ( 'invoiceOperationLog' );
 			$invoiceOperationLog = new invoiceOperationLog ();
 			
@@ -306,7 +564,7 @@ class InvoiceController extends DooController {
 			if ($status == 3) {
 				$invoice->status = $status;
 				$item = array (
-						'operation' => "退回" 
+						'operation' => $opinion 
 				);
 			} else {
 				if (empty ( $processApprovals )) {
@@ -342,7 +600,7 @@ class InvoiceController extends DooController {
 				}
 				
 				$item = array (
-						'operation' => "同意" 
+						'operation' => $opinion 
 				);
 				if (count ( $processApprovals ) == count ( $invoiceManage ) && $status != 4) {
 					$invoice->status = $status;
@@ -350,7 +608,7 @@ class InvoiceController extends DooController {
 				} elseif ($status == 4) {
 					$invoice->status = $status;
 					$item = array (
-							'operation' => "终止" 
+							'operation' => $opinion
 					);
 				}
 			}
@@ -460,7 +718,7 @@ class InvoiceController extends DooController {
 		
 		$data ['invoiceDetail'] = $invoiceDetail;
 		$data ['invoiceOperationLogList'] = $invoiceOperationLogList;
-		$data ['INVOICEKEY'] = $this->authcode ( $invoiceDetail ['iid'], '' );
+		$data ['INVOICEKEY'] = $invoice->authcode ( $invoiceDetail ['iid'], '' );
 		$data ['memu'] = "invoice";
 		$data ['staff'] = $this->staff;
 		$data ['receiptMemu'] = 'invoicePrint';
@@ -471,15 +729,17 @@ class InvoiceController extends DooController {
 	 * @since 1.0.0
 	 */
 	function invoicePrintDo() {
+		Doo::loadModel ( 'invoice' );
+		$invoice = new invoice ();
 		$iid = $this->get_args ( 'invoiceKey' ) ? $this->get_args ( 'invoiceKey' ) : "";
 		$invoiceNo = $this->get_args ( 'invoiceNo' ) ? $this->get_args ( 'invoiceNo' ) : "";
-		$iid = $this->authcode ( $iid );
+		
+		$iid = $invoice->authcode ( $iid );
 		if (! is_numeric ( $iid ))
 			die ( 'illegal request' );
 		if (! empty ( $iid ) && ! empty ( $invoiceNo )) {
 			
-			Doo::loadModel ( 'invoice' );
-			$invoice = new invoice ();
+			
 			Doo::loadModel ( 'invoiceOperationLog' );
 			$invoiceOperationLog = new invoiceOperationLog ();
 			
@@ -493,7 +753,7 @@ class InvoiceController extends DooController {
 					'printTime' => date ( "Y-m-d H:i:s" ),
 					'invoiceNo' => $invoiceNo 
 			);
-			$invoice->setPrintByInvoice ( $item );
+			$invoice->setInvoiceByCondition ( $item );
 			$item = array (
 					'date' => date ( "Y-m-d H:i:s" ),
 					'operation' => $invoiceNo,
@@ -515,16 +775,14 @@ class InvoiceController extends DooController {
 	function invoicePost() {
 		Doo::loadModel ( 'invoice' );
 		$invoice = new invoice ();
-		Doo::loadClass ( 'XDeode' );
-		$XDeode = new XDeode ( 5 );
+		Doo::loadModel ( 'express' );
+		$express = new express ();
 		
 		$invoicePost = $invoice->getPostByInvoice ();
-		$invoicePosted = $invoice->getPostedByInvoice ();
-		
-		foreach ( $invoicePost as $key => $value ) {
-			$invoicePost [$key] ['iidKey'] = $XDeode->encode ( $value ['iid'] );
-		}
+		$invoicePosted = $invoice->getPostByInvoice ( 1 );
+		$expressList = $express->getExpressByAll ();
 		
+		$data ['expressList'] = $expressList;
 		$data ['invoicePost'] = $invoicePost;
 		$data ['invoicePosted'] = $invoicePosted;
 		$data ['memu'] = "invoice";
@@ -532,17 +790,109 @@ class InvoiceController extends DooController {
 		$data ['receiptMemu'] = 'invoicePost';
 		$this->render ( "/admin/invoicePost", $data );
 	}
+	/**
+	 * 添加发票邮寄信息
+	 */
 	function invoiceExpressAddDo() {
+		Doo::loadModel ( 'invoice' );
+		$invoice = new invoice ();
+		
+		$iid = $this->get_args ( 'iidKey' ) ? $this->get_args ( 'iidKey' ) : "";
+		$expressCompany = $this->get_args ( 'express' ) ? $this->get_args ( 'express' ) : "";
+		$expressNumber = $this->get_args ( 'nu' ) ? $this->get_args ( 'nu' ) : "";
+		$actualItems = $this->get_args ( 'actualItems' ) ? $this->get_args ( 'actualItems' ) : "";
+		$iid = $iid = $invoice->authcode ( $iid );
+		if (! is_numeric ( $iid ) && empty ( $expressCompany ) && empty ( $expressNumber ) && empty ( $actualItems ))
+			die ( 'illegal request' );
+		
+		$item = array (
+				'iid' => $iid,
+				'postStatus' => 1,
+				'updateTime' => date ( "Y-m-d H:i:s" ),
+				'postTime' => date ( "Y-m-d H:i:s" ),
+				'expressCompany' => $expressCompany,
+				'expressNumber' => $expressNumber,
+				'actualItems' => $actualItems,
+				'poster' => $staff [0] ['username'] 
+		);
+		$invoice->setInvoiceByCondition ( $item );
+		return '/invoicePost';
 	}
 	/**
+	 * 退票处理页面
+	 */
+	function invoiceUntread(){
+		Doo::loadModel ( 'invoice' );
+		$invoice = new invoice ();
+		
+		$untreadInvoice=$invoice->getInvoiceByUntreadStatus(1);
+		$establishedInvoice=$invoice->getInvoiceByUntreadStatus(2);
+		
+		$data ['untreadInvoice'] = $untreadInvoice;
+		$data ['establishedInvoice'] = $establishedInvoice;
+		
+		$data ['memu'] = "invoice";
+		$data ['staff'] = $this->staff;
+		$data ['receiptMemu'] = 'invoiceUntread';
+		$this->render ( "/admin/invoiceUntread", $data );
+	}
+	
+	/**
+	 * 确认收到退回的发票,开票状态为退回
+	 */
+	function invoiceUntreadEstablishedDo(){
+		
+		$untreadIidKey = $this->get_args ( 'untreadIidKey' ) ? $this->get_args ( 'untreadIidKey' ) : '';
+		
+		Doo::loadModel ( 'invoice' );
+		$invoice = new invoice ();
+		Doo::loadModel ( 'invoiceOperationLog' );
+		$invoiceOperationLog = new invoiceOperationLog ();
+		
+		$iid = $invoice->authcode ( $untreadIidKey );
+		if (! empty ( $iid ) && ! is_numeric ( $iid ))
+			die ( 'illegal request' );
+		
+		$item = array (
+				'iid' => $iid,
+				'untreadStatus' => 2,
+				'updateTime' => date ( "Y-m-d H:i:s" )
+		);
+			
+		$invoice->setInvoiceByCondition ( $item );
+		$item = array (
+				'date' => date ( "Y-m-d H:i:s" ),
+				'operation' => '已确认退票',
+				'status' => 6,
+				'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 );
+		
+		return "/invoiceUntread";
+	}
+	
+	function invoiceReceivables(){
+		
+		$data ['memu'] = "invoice";
+		$data ['staff'] = $this->staff;
+		$data ['receiptMemu'] = 'invoiceReceivables';
+		$this->render ( "/admin/invoiceReceivables", $data );
+	}
+	
+	
+	/**
 	 * 异步获取一条发票的邮寄信息
 	 */
 	function ajaxGetInvoicePostDetail() {
-		Doo::loadClass ( 'XDeode' );
-		$XDeode = new XDeode ( 5 );
-		
 		$iid = $this->get_args ( 'iidKey' ) ? $this->get_args ( 'iidKey' ) : "";
-		$iid = $XDeode->decode ( $iid );
+		Doo::loadModel ( 'invoice' );
+		$invoice = new invoice ();
+		$iid = $invoice->authcode ( $iid );
+		
 		if (! is_numeric ( $iid )) {
 			echo json_encode ( array (
 					'status' => 0,
@@ -551,15 +901,12 @@ class InvoiceController extends DooController {
 			die ();
 		}
 		
-		Doo::loadModel ( 'invoice' );
-		$invoice = new invoice ();
-		$select="recipients,recipientsPhone,recipientsAddress,mailItems";
-		$invoiceDetail=$invoice->getInvoiceByIid($iid,$select);
+		$select = "iid,recipients,recipientsPhone,recipientsAddress,mailItems,expressCompany,expressNumber,actualItems";
+		$invoiceDetail = $invoice->getInvoiceByIid ( $iid, $select );
 		echo json_encode ( array (
 				'status' => 1,
-				'invoiceDetail' => $invoiceDetail
+				'invoiceDetail' => $invoiceDetail 
 		) );
-		
 	}
 	function _GetFileEXT($filename) {
 		$pics = explode ( '.', $filename );
@@ -587,66 +934,6 @@ class InvoiceController extends DooController {
 		} else
 			return false;
 	}
-	
-	/**
-	 * 加密或解密指定字符串
-	 *
-	 * @param string $string 要加密或解密的字符串
-	 * @param string $operation 当取值为'DECODE'时表示解密,否则为加密
-	 * @param string $key 加解密的key
-	 * @param $expiry 超时值
-	 *
-	 */
-	function authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) {
-		$ckey_length = 4;
-		if (! $key) {
-			$key = $this->INVOICEKEY;
-		}
-		$key = md5 ( $key );
-		$keya = md5 ( substr ( $key, 0, 16 ) );
-		$keyb = md5 ( substr ( $key, 16, 16 ) );
-		$keyc = $ckey_length ? ($operation == 'DECODE' ? substr ( $string, 0, $ckey_length ) : substr ( md5 ( microtime () ), - $ckey_length )) : '';
-		
-		$cryptkey = $keya . md5 ( $keya . $keyc );
-		$key_length = strlen ( $cryptkey );
-		
-		$string = $operation == 'DECODE' ? base64_decode ( substr ( $string, $ckey_length ) ) : sprintf ( '%010d', $expiry ? $expiry + time () : 0 ) . substr ( md5 ( $string . $keyb ), 0, 16 ) . $string;
-		$string_length = strlen ( $string );
-		
-		$result = '';
-		$box = range ( 0, 255 );
-		
-		$rndkey = array ();
-		for($i = 0; $i <= 255; $i ++) {
-			$rndkey [$i] = ord ( $cryptkey [$i % $key_length] );
-		}
-		
-		for($j = $i = 0; $i < 256; $i ++) {
-			$j = ($j + $box [$i] + $rndkey [$i]) % 256;
-			$tmp = $box [$i];
-			$box [$i] = $box [$j];
-			$box [$j] = $tmp;
-		}
-		
-		for($a = $j = $i = 0; $i < $string_length; $i ++) {
-			$a = ($a + 1) % 256;
-			$j = ($j + $box [$a]) % 256;
-			$tmp = $box [$a];
-			$box [$a] = $box [$j];
-			$box [$j] = $tmp;
-			$result .= chr ( ord ( $string [$i] ) ^ ($box [($box [$a] + $box [$j]) % 256]) );
-		}
-		
-		if ($operation == 'DECODE') {
-			if ((substr ( $result, 0, 10 ) == 0 || substr ( $result, 0, 10 ) - time () > 0) && substr ( $result, 10, 16 ) == substr ( md5 ( substr ( $result, 26 ) . $keyb ), 0, 16 )) {
-				return substr ( $result, 26 );
-			} else {
-				return '';
-			}
-		} else {
-			return $keyc . str_replace ( '=', '', base64_encode ( $result ) );
-		}
-	}
 }
 
 ?>

+ 25 - 25
protected/controller/ReceiptController.php

@@ -423,7 +423,7 @@ class ReceiptController extends DooController {
 		$cid=$this->get_args('cid')&&is_numeric($this->get_args('cid'))?$this->get_args('cid'):0;
 		$rid=$this->get_args('rid')&&is_numeric($this->get_args('rid'))?$this->get_args('rid'):0;
 		
-		if(!empty($verify)&&!empty($explanation)){
+		if(!empty($explanation)){
 			
 			Doo::loadModel('receipt');
 			Doo::loadModel('receiptDetail');
@@ -466,8 +466,9 @@ class ReceiptController extends DooController {
 				$receipt->status=7;
 			else 
 				$receipt->status=5;
-				
-			$receipt->verify=$verify;
+			
+			if ($receiptDetail['status']!=4&&!empty($verify))
+				$receipt->verify=$verify;
 			$receipt->executeCopy=$executeDetail['staff'];
 			$receipt->explanation=$explanation;
 			$receipt->update();
@@ -923,7 +924,7 @@ class ReceiptController extends DooController {
 		
 		//die;
 		
-		if(!empty($verify)&&!empty($cid)&&!empty($explanation)&&!empty($rid)){
+		if(!empty($cid)&&!empty($explanation)&&!empty($rid)){
 			
 			Doo::loadModel('receipt');
 			Doo::loadModel('receiptDetail');
@@ -940,7 +941,7 @@ class ReceiptController extends DooController {
 			$execute=new execute();
 			$executeDetail=$execute->getOne(array('where'=>'mold="借款执行人"','asArray'=>true));
 			
-			$receiptDetail=$receipt->getOne(array('where'=>'staff='.$this->staff[0]['sid'].' and status=5 and rid='.$rid,'asArray'=>true));
+			$receiptDetail=$receipt->getOne(array('where'=>'staff='.$this->staff[0]['sid'].' and (status=5 or status=4) and rid='.$rid,'asArray'=>true));
 			if(empty($receiptDetail))
 				die('参数错误');
 			
@@ -966,7 +967,8 @@ class ReceiptController extends DooController {
 			
 			
 			//修改审批流程加入角色
-			$receipt->verify=$verify;
+			if ($receiptDetail['status']!=4)
+				$receipt->verify=$verify;
 			
 			$receipt->explanation=$explanation;
 			$receipt->update(array('where'=>'rid='.$rid));
@@ -976,7 +978,8 @@ class ReceiptController extends DooController {
 			$loanReceipt->loanItem=json_encode($accountJson);
 			$loanReceipt->sum=number_format($sum, 2, '.', '');
 			$loanReceipt->cid=$cid;
-			$loanReceipt->verify=$verify;
+			if ($receiptDetail['status']!=4)
+				$loanReceipt->verify=$verify;
 			$loanReceipt->explanation=$explanation;
 			$receipt->executeCopy=$executeDetail['staff'];
 			
@@ -1703,8 +1706,6 @@ class ReceiptController extends DooController {
 		Doo::loadModel('receipt');
 		$receipt=new receipt();
 		
-		
-		
 		Doo::loadModel('L_category');
 		$Lcategory=new L_category();
 		Doo::loadModel('verify');
@@ -1714,8 +1715,6 @@ class ReceiptController extends DooController {
 		Doo::loadModel('staff');
 		$staff=new staff();
 		
-		
-		
 		$condition="";
 		if($item=="expenses")
 			$condition=" and Rtype=1 ";
@@ -1724,7 +1723,6 @@ class ReceiptController extends DooController {
 		elseif ($item=="remits")
 			$condition=" and Rtype=2 ";
 		
-			
 		$dateCondition=" and Year(date) =".$year;	
 		if(!empty($moth)){
 			$dateCondition=" and Year(date) =".$year." and Month(date) = ".$moth;	
@@ -1735,16 +1733,16 @@ class ReceiptController extends DooController {
 		if(empty($stList))
 			$stList=array('rePrice'=>0,'agPrice'=>0);
 			
-		$noPassSum=$receipt->receiptByYear($year,$this->staff[0]['sid']);
-			
-		$data['stList']=array('rePrice'=>$stList['rePrice'],'agPrice'=>$stList['agPrice'],'skPrice'=>($stList['rePrice']-$stList['agPrice']-$noPassSum['sum']));
-		$receiptList=$receipt->find(array('where'=>'staff='.$this->staff[0]['sid'].$condition.$dateCondition,'desc'=>'rid','asArray'=>true));
-
+		$noPassSum=$receipt->receiptByYear($dateCondition,$this->staff[0]['sid']);
+		if(!isset($noPassSum['sum']))
+			$noPassSum['sum']=0;
 		
 		
-		
-	$Locate=0;$roleId=0;$button=0;	
-	foreach ($receiptList as $key=>$value){
+		$data['stList']=array('rePrice'=>$stList['rePrice'],'agPrice'=>$stList['agPrice'],'skPrice'=>($noPassSum['sum']));
+		$receiptList=$receipt->find(array('where'=>'staff='.$this->staff[0]['sid'].$condition.$dateCondition,'desc'=>'rid','asArray'=>true));
+
+		$Locate=0;$roleId=0;$button=0;	
+		foreach ($receiptList as $key=>$value){
 			$receiptList[$key]['Locate']=$Locate;$Locate++;
 			$receiptList[$key]['reviseDetail']=array();
 			if (!empty($value['reviseDetail']))
@@ -4299,7 +4297,7 @@ $receiptList[$key]['verifyList']=$verifyList;
 		if ($sop!='SOP')
 			$sopString=" and staff=".$sop;
 		
-		$noPassSum=$receipt->receiptByYear($year,$this->staff[0]['sid']);
+		//$noPassSum=$receipt->receiptByYear($year,$this->staff[0]['sid']);
 			
 		$receiptList=$receipt->find(array('where'=>' (status=8 or status=9 )'.$condition.$dateCondition.$sopString,'desc'=>'rid','asArray'=>true));
 
@@ -4501,6 +4499,9 @@ $receiptList[$key]['verifyList']=$verifyList;
 		 echo json_encode(array('status'=>0,'receipt'=>array()));die; 	
 	}
 	
+	/*
+	 * 废弃
+	 */
 	function myReceipt(){
 		
 		//all approval past withdraw
@@ -5089,7 +5090,7 @@ $receiptList[$key]['verifyList']=$verifyList;
 		$cid=$this->get_args('cid')&&is_numeric($this->get_args('cid'))?$this->get_args('cid'):0;
 		$rid=$this->get_args('rid')&&is_numeric($this->get_args('rid'))?$this->get_args('rid'):0;
 		
-		if(!empty($verify)&&!empty($explanation)){
+		if(!empty($explanation)){
 			
 			Doo::loadModel('receipt');
 			Doo::loadModel('receiptDetail');
@@ -5100,8 +5101,6 @@ $receiptList[$key]['verifyList']=$verifyList;
 			Doo::loadModel('execute');
 			$execute=new execute();
 			
-			
-				
 			$receiptDetail=$receipt->getOne(array('where'=>'staff='.$this->staff[0]['sid'].' and rid='.$rid.' and (status=5 or status=7 or status=4)','asArray'=>true));
 			if(empty($receiptDetail))
 				return "/saeaBorad";
@@ -5166,7 +5165,8 @@ $receiptList[$key]['verifyList']=$verifyList;
 				else 
 					$receipt->status=5;
 			}
-			$receipt->verify=$verify;
+			if ($receiptDetail!=4&&!empty($verify))
+				$receipt->verify=$verify;
 			$receipt->executeCopy=$executeDetail['staff'];
 			
 			$receipt->explanation=$explanation;

+ 45 - 0
protected/model/express.php

@@ -0,0 +1,45 @@
+<?php
+Doo::loadCore ( 'db/DooModel' );
+/**
+ * 快递公司业务逻辑
+ * @author CP.
+ * @version 1.0
+ * @namespace express
+ * @package expressModel
+ */
+class express extends DooModel {
+	/**
+	 *
+	 * @var integer $eid 公司ID
+	 */
+	public $eid;
+	/**
+	 *
+	 * @var integer $company 公司名称
+	 */
+	public $company;
+	/**
+	 *
+	 * @var string $com 公司代码
+	 */
+	public $com;
+	public $_table = 'CLD_express';
+	public $_primarykey = 'iid';
+	public $_fields = array (
+			'eid',
+			'company',
+			'com' 
+	);
+	/**
+	 * 获取所有快递公司的相关信息
+	 * @return array|array() 返回所有数据
+	 */
+	public function getExpressByAll() {
+		$list = $this->find ( array (
+				'asArray' => TRUE 
+		) );
+		return $list;
+	}
+}
+
+?>

+ 183 - 21
protected/model/invoice.php

@@ -8,6 +8,7 @@ Doo::loadCore ( 'db/DooModel' );
  * @package invoiceModel
  */
 class invoice extends DooModel {
+	private $INVOICEKEY = "APPROVAL";
 	/**
 	 *
 	 * @var integer $iid 发票ID
@@ -153,11 +154,19 @@ class invoice extends DooModel {
 	public $expressCompany;
 	public $expressNumber;
 	public $actualItems;
+	public $poster;
+	public $untreadReason;
+	public $untreadPost;
+	public $untreadCompany;
+	public $untreadNumber;
+	public $untreadItems;
+	public $untreadStatus;
 	/**
 	 *
 	 * @var date $date 提交时间
 	 */
 	public $date;
+	public $isDelete;
 	/**
 	 *
 	 * @var date $updateTime 更新时间
@@ -168,6 +177,7 @@ class invoice extends DooModel {
 	 * @var date $printTime 打印时间
 	 */
 	public $printTime;
+	public $postTime;
 	public $_table = 'CLD_invoice';
 	public $_primarykey = 'iid';
 	public $_fields = array (
@@ -179,6 +189,7 @@ class invoice extends DooModel {
 			'status',
 			'printStatus',
 			'postStatus',
+			'untreadStatus',
 			'invoicePrice',
 			'moldManage',
 			'cid',
@@ -202,11 +213,19 @@ class invoice extends DooModel {
 			'expressCompany',
 			'expressNumber',
 			'actualItems',
+			'untreadReason',
+			'untreadPost',
+			'untreadCompany',
+			'untreadNumber',
+			'untreadItems',
+			'poster',
 			'sid',
 			'userName',
 			'date',
+			'isDelete',
 			'updateTime',
-			'printTime' 
+			'printTime',
+			'postTime' 
 	);
 	/**
 	 * 根据发票ID获取一条发票数据
@@ -227,6 +246,17 @@ class invoice extends DooModel {
 		$Detail = array ();
 		if (is_numeric ( $iid ) && ! empty ( $iid ))
 			$Detail = $this->getOne ( $condition );
+		$Detail ['expressCompany'] = '';
+		$Detail ['expressCom'] = '';
+		if (isset ( $Detail ['expressCompany'] ) && ! empty ( $Detail ['expressCompany'] )) {
+			$express = explode ( ":", $Detail ['expressCompany'] );
+			$Detail ['expressCompany'] = $express [0];
+			$Detail ['expressCom'] = $express [1];
+		}
+		$Detail ['iidKey'] = $this->authcode ( $Detail ['iid'], '' );
+		Doo::loadModel ( 'L_category' );
+		$lCategory = new L_category ();
+		$Detail ['category'] = $lCategory->getCategory ();
 		return $Detail;
 	}
 	/**
@@ -265,11 +295,11 @@ class invoice extends DooModel {
 		return $lid;
 	}
 	/**
-	 * 记录发票号并完成打印
-	 * @param array $item 发票号和完成打印状态数据
+	 * 根据参数字段更新相应字段(主键ID必须传)
+	 * @param array $item 相关需要更新的字段信息
 	 * @return number 返回发票ID
 	 */
-	public function setPrintByInvoice($item = array()) {
+	public function setInvoiceByCondition($item = array()) {
 		$lid = 0;
 		if (is_array ( $item ) && ! empty ( $item )) {
 			foreach ( $item as $key => $value ) {
@@ -301,39 +331,171 @@ class invoice extends DooModel {
 			) );
 		return $list;
 	}
+	
 	/**
-	 * 待修改 获取待处理发票的数据 其中包括退回`终止
-	 * @return unknown
+	 * 获得与我相关的发票数据,其中包含 处理中,待处理,最旧入账等数据;当iid有值时获取一条关于sid的发票
+	 * @param number $sid 用户ID
+	 * @param number $iid 发票ID
+	 * @return array|array()
 	 */
-	public function getPendingByInvoice() {
-		$list = $this->find ( array (
-				'where' => "status=3 or status=4",
-				'asArray' => TRUE 
-		) );
+	public function getMyInvoice($sid = 0, $iid = 0) {
+		Doo::loadModel ( 'invoiceOperationLog' );
+		$invoiceOperationLog = new invoiceOperationLog ();
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		$list = array ();
+		if (! empty ( $iid )) {
+			$list = $this->getOne ( array (
+					'where' => " sid=" . $sid . " and iid=" . $iid,
+					'asArray' => TRUE 
+			) );
+		} elseif (! empty ( $sid ) && empty ( $iid )) {
+			$list ['pendingInvoice'] = array ();
+			$list ['handleInvoice'] = array ();
+			$list ['pendingInvoice'] = $this->find ( array (
+					'where' => "((status=1) or (status=2 and printStatus=0) or ( status=2 and printStatus=1 and untreadStatus=1) )  and sid=" . $sid,
+					'desc' => 'iid',
+					'asArray' => TRUE 
+			) );
+			foreach ( $list ['pendingInvoice'] as $key => $value ) {
+				$list ['pendingInvoice'] [$key] ['OperationLog'] = $invoiceOperationLog->getInvoiceOperationLogByIid ( $value ['iid'], 'desc' );
+			}
+			
+			$list ['handleInvoice'] = $this->find ( 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=" . $sid,
+					'desc' => 'iid',
+					'asArray' => TRUE 
+			) );
+			foreach ( $list ['handleInvoice'] as $key => $value ) {
+				$list ['handleInvoice'] [$key] ['iidKey'] = $this->authcode ( $value ['iid'], '' );
+				$list ['handleInvoice'] [$key] ['iidKeyUrl'] = $XDeode->encode ( $value ['iid'] );
+				$list ['handleInvoice'] [$key] ['OperationLog'] = $invoiceOperationLog->getInvoiceOperationLogByIid ( $value ['iid'], 'desc' );
+			}
+		}
+		
 		return $list;
 	}
+	
 	/**
 	 * 获取需要邮寄的发票
-	 * @return array
+	 * @param integer $postStatus 0为获取需要邮寄的发票,1为获取已经邮寄的发票
+	 * @return array|array() 返回相关数据
 	 */
-	public function getPostByInvoice() {
+	public function getPostByInvoice($postStatus = 0) {
 		$list = $this->find ( array (
-				'where' => "postStatus=0 and doPost=1 and status=2",
+				'where' => "postStatus=" . $postStatus . " and doPost=1 and status=2",
 				'asArray' => TRUE 
 		) );
+		foreach ( $list as $key => $value ) {
+			$list [$key] ['iidKey'] = $this->authcode ( $value ['iid'], '' );
+			$list [$key] ['expressCompany'] = '';
+			$list [$key] ['expressCom'] = '';
+			if (! empty ( $value ['expressCompany'] )) {
+				$express = explode ( ":", $value ['expressCompany'] );
+				$list [$key] ['expressCompany'] = $express [0];
+				$list [$key] ['expressCom'] = $express [1];
+			}
+		}
 		return $list;
 	}
+	
 	/**
-	 * 获取已经邮寄过的发票
-	 * @return array
+	 * 根据退票状态获得相关数据,iid有值时只获得一条数据
+	 * @param number $untreadStatus 退票状态
+	 * @param number $iid 发票ID
 	 */
-	public function getPostedByInvoice() {
-		$list = $this->find ( array (
-				'where' => "postStatus=1 and doPost=1 and status=2",
-				'asArray' => TRUE 
-		) );
+	public function getInvoiceByUntreadStatus( $untreadStatus = 1,$iid = 0) {
+		if (empty ( $iid )) {
+			$list = $this->find ( array (
+					'where' => " printStatus=1 and untreadStatus=".$untreadStatus." and status=2 ",
+					'asArray' => TRUE 
+			) );
+			
+			if ($untreadStatus==2){
+				Doo::loadModel ( 'invoiceOperationLog' );
+				$invoiceOperationLog = new invoiceOperationLog ();
+			}
+			foreach ( $list as $key => $value ) {
+				$list [$key] ['iidKey'] = $this->authcode ( $value ['iid'], '' );
+				$list [$key] ['untreadCompany'] = '';
+				$list [$key] ['untreadCom'] = '';
+				if (! empty ( $value ['untreadCompany'] )) {
+					$express = explode ( ":", $value ['untreadCompany'] );
+					$list [$key] ['untreadCompany'] = $express [0];
+					$list [$key] ['untreadCom'] = $express [1];
+				}
+				if ($untreadStatus==2){
+					$list[$key] ['OperationLog']=$invoiceOperationLog->getInvoiceOperationByStatus($value['iid'],6);
+				}
+			}
+		} else {
+			$list = $this->getOne ( array (
+					'where' => "iid=" . $iid . " and printStatus=1 and untreadStatus=".$untreadStatus." and status=2",
+					'asArray' => TRUE 
+			) );
+		}
 		return $list;
 	}
+	
+	/**
+	 * 加密或解密指定字符串
+	 *
+	 * @param string $string 要加密或解密的字符串
+	 * @param string $operation 当取值为'DECODE'时表示解密,否则为加密
+	 * @param string $key 加解密的key
+	 * @param $expiry 超时值
+	 *
+	 */
+	function authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) {
+		$ckey_length = 4;
+		if (! $key) {
+			$key = $this->INVOICEKEY;
+		}
+		$key = md5 ( $key );
+		$keya = md5 ( substr ( $key, 0, 16 ) );
+		$keyb = md5 ( substr ( $key, 16, 16 ) );
+		$keyc = $ckey_length ? ($operation == 'DECODE' ? substr ( $string, 0, $ckey_length ) : substr ( md5 ( microtime () ), - $ckey_length )) : '';
+		
+		$cryptkey = $keya . md5 ( $keya . $keyc );
+		$key_length = strlen ( $cryptkey );
+		
+		$string = $operation == 'DECODE' ? base64_decode ( substr ( $string, $ckey_length ) ) : sprintf ( '%010d', $expiry ? $expiry + time () : 0 ) . substr ( md5 ( $string . $keyb ), 0, 16 ) . $string;
+		$string_length = strlen ( $string );
+		
+		$result = '';
+		$box = range ( 0, 255 );
+		
+		$rndkey = array ();
+		for($i = 0; $i <= 255; $i ++) {
+			$rndkey [$i] = ord ( $cryptkey [$i % $key_length] );
+		}
+		
+		for($j = $i = 0; $i < 256; $i ++) {
+			$j = ($j + $box [$i] + $rndkey [$i]) % 256;
+			$tmp = $box [$i];
+			$box [$i] = $box [$j];
+			$box [$j] = $tmp;
+		}
+		
+		for($a = $j = $i = 0; $i < $string_length; $i ++) {
+			$a = ($a + 1) % 256;
+			$j = ($j + $box [$a]) % 256;
+			$tmp = $box [$a];
+			$box [$a] = $box [$j];
+			$box [$j] = $tmp;
+			$result .= chr ( ord ( $string [$i] ) ^ ($box [($box [$a] + $box [$j]) % 256]) );
+		}
+		
+		if ($operation == 'DECODE') {
+			if ((substr ( $result, 0, 10 ) == 0 || substr ( $result, 0, 10 ) - time () > 0) && substr ( $result, 10, 16 ) == substr ( md5 ( substr ( $result, 26 ) . $keyb ), 0, 16 )) {
+				return substr ( $result, 26 );
+			} else {
+				return '';
+			}
+		} else {
+			return $keyc . str_replace ( '=', '', base64_encode ( $result ) );
+		}
+	}
 }
 
 ?>

+ 41 - 3
protected/model/invoiceOperationLog.php

@@ -22,7 +22,7 @@ class invoiceOperationLog extends DooModel {
 	 */
 	public $username;
 	/**
-	 * 
+	 *
 	 * @var string $category 办事处
 	 */
 	public $category;
@@ -105,17 +105,55 @@ class invoiceOperationLog extends DooModel {
 	 * 根据发票ID获取操作日志数据
 	 *
 	 * @param integer $iid 发票ID
+	 * @param integer $desc 获得一条操作日志最新或者最旧
 	 * @return array|array() 发票审批操作日志数据集
 	 */
-	public function getInvoiceOperationLogByIid($iid = 0) {
+	public function getInvoiceOperationLogByIid($iid = 0, $desc = '') {
 		$list = array ();
-		if (! empty ( $iid ) && is_numeric ( $iid ))
+		if (! empty ( $iid ) && is_numeric ( $iid ) && empty ( $desc ))
 			$list = $this->find ( array (
 					'where' => ' iid=' . $iid,
 					'asArray' => true 
 			) );
+		elseif (! empty ( $desc ))
+			$list = $this->getOne ( array (
+					'where' => 'iid=' . $iid,
+					$desc => 'lid',
+					'asArray' => true 
+			) );
+		return $list;
+	}
+	/**
+	 * 获得一条最新的退回操作记录
+	 * @param number $iid
+	 * @param string $desc
+	 * @return unknown
+	 */
+	public function getInvoiceOperationByDropped($iid = 0,$desc = 'desc') {
+		$list = $this->getOne ( array (
+				'where' => ' iid=' . $iid.' and status=3',
+				$desc => 'lid',
+				'asArray' => true 
+		) );
 		return $list;
 	}
+	
+	/**
+	 * 根据状态和发票ID获得一条最新的操作日志
+	 * @param number $iid
+	 * @param number $status
+	 * @param string $desc
+	 * @return unknown
+	 */
+	public function getInvoiceOperationByStatus($iid = 0,$status = 0,$desc = 'desc') {
+		$list = $this->getOne ( array (
+				'where' => 'iid=' . $iid.' and status='.$status,
+				$desc => 'lid',
+				'asArray' => true
+		) );
+		return $list;
+	}
+	
 }
 
 ?>

+ 2 - 2
protected/model/receipt.php

@@ -47,9 +47,9 @@ class receipt extends DooModel {
     public $_fields = array('aid', 'accountItem', 'staff', 'sum', 'date','pastDate' ,'cid', 'status', 'reviseDetail', 'revisePrice', 'verify','verifyStaff',
     'nowStaff','receiptOrder','explanation','notice','Rtype','loanItem','loanRid','loanSum','implementOpinions','isBK','executeCopy','executeStaff','verifyBreakup','executeDate');
 
-	function receiptByYear($year,$sid){
+	function receiptByYear($dateCondition,$sid){
     	//
-    	$sql = "select sum(sum) as sum from " . $this->_table . " where staff= '".$sid."' and Year(date) =".$year." and status=3 " ;
+    	$sql = "select sum(sum) as sum from " . $this->_table . " where staff= '".$sid."' ".$dateCondition." and status=2 ";
     	//echo '<div style="display:none">'.$sql.'</div>';
     	$query = Doo::db ()->query ( $sql );
 		$result = $query->fetch ();

+ 12 - 17
protected/view/admin/expensesEdi.html

@@ -36,9 +36,6 @@
 						<li><a id="examine" data="{{rid}}" href="javascript:void(0)">查看下一份费用审批</a></li>
 	  			</ul>
 				
-				
-				
-					
 	  			</form>
 	  		</div>
 	  		
@@ -172,9 +169,7 @@
 		  						<!-- if {{receiptDetail' value.button}}==4 -->
 		  						
 	  							<a href="javascript:void(0)" onClick="updateApprovalReceipt(1,{{receiptList' value.rid}})" class="buttonDone buttonBlock">同意支付</a>
-		  						<a href="/expensesRetreats/{{receiptList' value.rid}}" class="buttonBack" data-placement="top" data-toggle="ctooltip" data-original-title="上报人修改后由你继续审批">撤回</a>
-	  							<a href="javascript:void(0)" onClick="updateApprovalReceipt(3,{{receiptList' value.rid}})" class="buttonUndone" data-placement="top" data-toggle="ctooltip" data-original-title="终止报销单">终止</a>
-	  						
+		  						
 		  						<!-- endif -->
 		  					</div>
 		  					<div class="censorList clearfix censorHeight">
@@ -227,22 +222,22 @@
 		  						
 		  					</ul>
 		  					</div>
+		  					<div class="reportButton clearfix">
+		  					
+		  					
+		  					
+		  						<!-- if {{receiptDetail' value.button}}==4 -->
+		  						<a href="/expensesRetreats/{{receiptList' value.rid}}" class="buttonBack" data-placement="top" data-toggle="ctooltip" data-original-title="上报人修改后由你继续审批">撤回</a>
+	  							<a href="javascript:void(0)" onClick="updateApprovalReceipt(3,{{receiptList' value.rid}})" class="buttonUndone" data-placement="top" data-toggle="ctooltip" data-original-title="终止报销单">终止</a>
+	  						
+		  						<!-- endif -->
+		  					</div>
 	  					</form>
 	  				</div>
-	  				<!--<div class="seReport">
-	  					<div class="avtra"><img src="{{receiptList' value.staffDetail.avatar}}_2.jpg">{{receiptList' value.staffDetail.username}}</div>
-	  					<div class="taC">{{receiptList' value.staffDetail.category}}</div>
-	  				</div>-->
+	  				
 	  			</div>
 	  		<!-- endloop -->
 	  		
-	  		
-	  		
-	  		
-	  			
-	  			
-	  			
-	  			
 	  			
 	  		</div>
 			</div>

+ 120 - 74
protected/view/admin/invoice.html

@@ -1,4 +1,9 @@
 <!-- include 'header' -->
+<link rel=stylesheet href="<?= WEB_SITE_GLOBAL ?>css/jquery.validator.css">
+<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>js/jquery.validator.min.js"></script>
+<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>js/zh-CN.js"></script>
+<script src="<?= WEB_SITE_GLOBAL ?>js/invoice.validator.js"></script>
+<script src="<?= WEB_SITE_GLOBAL ?>js/invoice.js"></script>
 <body>
 	<div class="mainLayout">
 		<div class="mainMenu">
@@ -34,51 +39,67 @@
 								</table>
 							</div>
 							<div class="clearfix">
-								<!-- if !empty({{pendingInvoice}}) -->
+								
 								<legend><div class="fR"></div>待处理</legend>
+								<!-- if !empty({{invoiceList.handleInvoice}}) -->
 								<table class="table table-bordered table-condensed">
 									<tbody>
 									<tr><th class="taC" width="70">状态</th><th class="taC">开票单位(抬头)</th><th class="taC" width="90">开票金额</th><th class="taC">开票流水号</th><th class="taC">处理时间</th><th class="taC" width="120">操作</th></tr>
+									
+									<!-- loop invoiceList.handleInvoice -->
 									<tr>
-										<td><span class="colOrange">已退回</span></td>
-										<td>珠海XXXX公司</td>
-										<td><b>¥3000.00</b></td>
-										<td><a href="#invdetail" data-toggle="modal">#F20160316001</a></td>
-										<td>张少珊 2016-03-03 11:30:03</td>
-										<td width=""><div class="btn-group"><a class="button btn-red  btn-inline"  data-toggle="modal" href="#invalid">终止开票</a><a class="button btn-inline" href="invoice-edit.html">重新提交</a></div></td>
-									</tr>
-									<tr>
-										<td><span class="colRed">已终止</span></td>
-										<td>珠海XXXX公司</td>
-										<td><b>¥3000.00</b><sup>专</sup></td>
-										<td><a href="#invdetail" data-toggle="modal">#F20160316001</a></td>
-										<td>张少珊 2016-03-03 11:30:03</td>
-										<td width=""><a class="button btn-gray btn-block" href="">从待处理移除</a></td>
-									</tr>
-									<tr>
-										<td><span class="colRed">已退票</span></td>
-										<td>珠海XXXX公司</td>
-										<td><b>¥3000.00</b></td>
-										<td><a href="#invdetail" data-toggle="modal">#F20160316001</a></td>
-										<td>张少珊 2016-03-03 11:30:03</td>
-										<td width=""><a class="button btn-gray btn-block" href="">从待处理移除</a></td>
-									</tr>
-									<tr>
-										<td><span class="colBlue">已出票</span></td>
-										<td>珠海XXXX公司</td>
-										<td><b>¥3000.00</b></td>
-										<td><a href="#invdetail" data-toggle="modal">#F20160316001</a></td>
-										<td>张少珊 2016-03-03 11:30:03</td>
-										<td width=""><div class="btn-group"><a class="button btn-red  btn-inline" href="#return" data-toggle="modal">申请退票</a><a class="button btn-green" href="#recorded" data-toggle="modal">收款入账</a></div></td>
-									</tr>
-									<tr>
-										<td><span class="colBlue">已出票</span> <a href="#shipping" data-toggle="modal">邮寄</a></td>
-										<td>珠海XXXX公司</td>
-										<td><b>¥3000.00</b><sup>专</sup></td>
-										<td><a href="#invdetail" data-toggle="modal">#F20160316001</a></td>
-										<td>张少珊 2016-03-03 11:30:03</td>
-										<td width=""><div class="btn-group"><a class="button btn-red  btn-inline" href="#return" data-toggle="modal">申请退票</a><a class="button btn-green" href="#recorded" data-toggle="modal">收款入账</a></div></td>
+										<td>
+										<!-- if {{pendingInvoice' value.status}}==3  -->
+										<span class="colOrange">已退回</span>
+										<!-- elseif {{pendingInvoice' value.status}}==4 -->
+										<span class="colRed">已终止</span>
+										<!-- elseif {{pendingInvoice' value.status}}==2 and {{pendingInvoice' value.printStatus}}==1 and {{pendingInvoice' value.untreadStatus}}==0  -->
+										<span class="colBlue">已出票</span>
+										<!-- if {{pendingInvoice' value.doPost}}==1 -->
+										<a href="#shipping" data-toggle="modal">邮寄</a>
+										<!-- endif -->
+										<!-- elseif {{pendingInvoice' value.status}}==2 and {{pendingInvoice' value.printStatus}}==1 and {{pendingInvoice' value.untreadStatus}}==2  -->
+										<span class="colRed">已退票</span>
+										<!-- endif -->
+										</td>
+										<td>
+										<!-- if !empty({{pendingInvoice' value.invoiceType}}) -->
+	                                   	{{pendingInvoice' value.invoiceCompany}}
+	                                    <!-- else -->
+	                                    {{pendingInvoice' value.invoiceTitle}}
+	                                    <!-- endif -->
+										</td>
+										<td><!-- if !empty({{pendingInvoice' value.invoiceType}}) -->
+	                                    <b>¥{{pendingInvoice' value.invoicePrice}}</b><sup>专</sup>
+	                                    <!-- else -->
+	                                    <b>¥{{pendingInvoice' value.invoicePrice}}</b>
+	                                    <!-- endif --></td>
+										<td>
+										<a href="#invdetail" data-toggle="modal">{{invoiceList' value.invoiceSerial}}</a>
+										</td>
+										<td>{{invoiceList' value.OperationLog.username}} {{invoiceList' value.OperationLog.date}}</td>
+										<td width="">
+										<!-- if {{pendingInvoice' value.status}}==3  -->
+										<div class="btn-group">
+										<a class="button btn-red  btn-inline" diss-data="{{pendingInvoice' value.iidKey}}" node-invoice="droppedInvoice" data-toggle="modal" href="#invalid">终止开票</a>
+										<a class="button btn-inline" href="/invoiceEdit/{{pendingInvoice' value.iidKeyUrl}}.html">重新提交</a>
+										</div>
+										<!-- elseif {{pendingInvoice' value.status}}==4 -->
+										<a class="button btn-gray btn-block" href="/invoiceDelDo/{{pendingInvoice' value.iidKeyUrl}}.do">从待处理移除</a>
+										<!-- elseif {{pendingInvoice' value.status}}==2 and {{pendingInvoice' value.printStatus}}==1 and {{pendingInvoice' value.untreadStatus}}==0 -->
+										<div class="btn-group">
+										<a class="button btn-red  btn-inline" diss-data="{{pendingInvoice' value.iidKey}}" node-invoice="untreadInvoice" href="#return" data-toggle="modal">申请退票</a>
+										<a class="button btn-green" href="#recorded" data-toggle="modal">收款入账</a>
+										</div>
+										<!-- elseif {{pendingInvoice' value.status}}==2 and {{pendingInvoice' value.printStatus}}==1 and {{pendingInvoice' value.untreadStatus}}==2  -->
+										<a class="button btn-gray btn-block" href="/invoiceDelDo/{{pendingInvoice' value.iidKeyUrl}}.do">从待处理移除</a>
+										<!-- endif -->
+										</td>
 									</tr>
+									<!-- endloop -->
+									
+									
+									
 									</tbody>
 								</table>
 								<!-- else -->
@@ -87,40 +108,45 @@
 							</div>
 							<div class="clearfix">
 								<legend><div class="fR"></div>处理中</legend>
+								<!-- if !empty({{invoiceList.pendingInvoice}}) -->
 								<table class="table table-bordered table-condensed">
 									<tbody>
 									<tr><th class="taC" width="70">状态</th><th class="taC">开票单位(抬头)</th><th class="taC" width="90">开票金额</th><th class="taC">开票流水号</th><th class="taC">处理时间</th></tr>
+									<!-- loop invoiceList.pendingInvoice -->
 									<tr>
-										<td><span class="">审核中</span></td>
-										<td>珠海XXXX公司</td>
-										<td><b>¥3000.00</b></td>
-										<td><a href="#invdetail" data-toggle="modal">#F20160316001</a></td>
-										<td>张少珊 2016-03-03 11:30:03</td>
-									</tr>
-									<tr>
-										<td><span class="">审核中</span></td>
-										<td>珠海XXXX公司</td>
-										<td><b>¥3000.00</b></td>
-										<td><a href="#invdetail" data-toggle="modal">#F20160316001</a></td>
-										<td>张少珊 2016-03-03 11:30:03</td>
-									</tr>
-									<tr>
-										<td><span class="colBlue">出票中</span></td>
-										<td>珠海XXXX公司</td>
-										<td><b>¥3000.00</b></td>
-										<td><a href="#invdetail" data-toggle="modal">#F20160316001</a></td>
-										<td>张少珊 2016-03-03 11:30:03</td>
-									</tr>
-									<tr>
-										<td><span class="colRed">退票中</span></td>
-										<td>珠海XXXX公司</td>
-										<td><b>¥3000.00</b></td>
-										<td><a href="#invdetail" data-toggle="modal">#F20160316001</a></td>
-										<td>张少珊 2016-03-03 11:30:03</td>
+										<td>
+										<!-- if {{pendingInvoice' value.status}}==2 and {{pendingInvoice' value.printStatus}}==0 -->
+										<span class="colBlue">出票中</span>
+										 <!-- elseif {{pendingInvoice' value.status}}==1 -->
+										 <span class="">审核中</span>
+										  <!-- elseif {{pendingInvoice' value.status}}==2 and {{pendingInvoice' value.printStatus}}==1 and {{pendingInvoice' value.untreadStatus}}==1 -->
+										  <span class="colRed">退票中</span>
+										 <!-- endif -->
+										
+										</td>
+										<td>
+										<!-- if !empty({{pendingInvoice' value.invoiceType}}) -->
+	                                   	{{pendingInvoice' value.invoiceCompany}}
+	                                    <!-- else -->
+	                                    {{pendingInvoice' value.invoiceTitle}}
+	                                    <!-- endif -->
+										</td>
+										<td>
+										<!-- if !empty({{pendingInvoice' value.invoiceType}}) -->
+	                                    <b>¥{{pendingInvoice' value.invoicePrice}}</b><sup>专</sup>
+	                                    <!-- else -->
+	                                    <b>¥{{pendingInvoice' value.invoicePrice}}</b>
+	                                    <!-- endif --></td>
+										<td><a href="#invdetail" data-toggle="modal">{{invoiceList' value.invoiceSerial}}</a></td>
+										<td>{{invoiceList' value.OperationLog.username}} {{invoiceList' value.OperationLog.date}}</td>
 									</tr>
+									<!-- endloop -->
+									
 									</tbody>
 								</table>
+								<!-- else -->
 								<blockquote><p class="colGray">暂时没有正在处理的发票 </p></blockquote>
+								<!-- endif -->
 							</div>
 							<div class="clearfix">
 								<legend><div class="fR"><a href="invoice-pall.html">查看更多</a></div>最近入账</legend>
@@ -276,6 +302,8 @@
 	<!--弹出收款-->
 	<!--弹出终止-->
 	<div class="modal hide fade" id="invalid">
+		<form action="/invoiceDroppedDo"  method="post" name="droppedInvoice">
+		<input type="hidden" name='droppedIidKey' value="">
 		<div class="modal-dialog ">
 			<div class="modal-content">
 				<div class="modal-header">
@@ -285,14 +313,17 @@
 					终止后该发票申请将无法继续审批。
 				</div>
 				<div class="modal-footer">
-					<a href="#" class="button">是的</a>
+					<input type="submit" class="button" value="是的">
 					<a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
 				</div>
 			</div></div>
+		</form>
 	</div>
 	<!--终止-->
 	<!--弹出 退票-->
 	<div class="modal hide fade" id="return">
+	<form action="/invoiceUntreadDo" method="post" name="untreadInvoice">
+	<input type="hidden" name='untreadIidKey' value="">
 		<div class="modal-dialog ">
 			<div class="modal-content">
 				<div class="modal-header">
@@ -302,36 +333,51 @@
 					<table class="table table-bordered table-condensed">
 						<tbody>
 						<tr>
-							<th class="taC"><span class="colRed">*</span>退票原因</th><td><textarea class="span4" placeholder="请详细填写退票原因"></textarea></td>
+							<th class="taC"><span class="colRed">*</span>退票原因</th>
+							<td>
+							<textarea class="span4" name="untreadReason" placeholder="请详细填写退票原因"></textarea>
+							</td>
 						</tr>
 						<tr>
-							<th class="taC"><span class="colRed">*</span>是否邮寄</th><td><label class="radio inline"><input type="radio">是</label>
-							<label class="radio inline"><input type="radio">否</label></td>
+							<th class="taC"><span class="colRed">*</span>是否邮寄</th>
+							<td><label class="radio inline"><input name="untreadPost" node-untread='post' value="1" checked type="radio">是</label>
+							<label class="radio inline"><input name="untreadPost" value="0" type="radio">否</label>
+							</td>
 						</tr>
 						</tbody>
 					</table>
-					<table class="table table-bordered table-condensed">
+					<table post-box='ture' class="table table-bordered table-condensed">
 						<tbody>
 						<tr>
 							<th colspan="2" class="taC">退票邮寄信息</th>
 						</tr>
 						<tr>
 							<th class="taC" width="100"><span class="colRed">*</span>快递公司</th><td>
-							<select><option>顺丰速运</option><option>圆通速运</option></select></td>
+							<select name="untreadCompany">
+							<!-- loop expressList -->
+											<option value="{{expressList' value.company}}:{{expressList' value.com}}">{{expressList' value.company}}</option>
+											<!-- endloop -->
+							</select>
+							</td>
 						</tr>
 						<tr>
-							<th class="taC" width="100"><span class="colRed">*</span>快递单号</th><td><input type="text" placeholder="请正确填写单号,方便跟踪查询。"></td></tr>
+							<th class="taC" width="100"><span class="colRed">*</span>快递单号</th>
+							<td><input type="text" name="untreadNumber" placeholder="请正确填写单号,方便跟踪查询。"></td>
+						</tr>
 						<tr>
-							<th class="taC" width="100"><span class="colRed">*</span>邮寄物品</th><td><textarea class="span4" placeholder="请详细填写邮寄回总部的快递包含什么物件。"></textarea></td>
+							<th class="taC" width="100"><span class="colRed">*</span>邮寄物品</th>
+							<td><textarea class="span4" name="untreadItems" placeholder="请详细填写邮寄回总部的快递包含什么物件。"></textarea>
+							</td>
 						</tr>
 						</tbody>
 					</table>
 				</div>
 				<div class="modal-footer">
-					<a href="#" class="button">确认提交</a>
+					<input type="submit" class="button" value="确认提交">
 					<a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
 				</div>
 			</div></div>
+			</form>
 	</div>
 	<!--退票-->
 	<!--弹出入账-->

+ 3 - 12
protected/view/admin/invoiceAdd.html

@@ -47,16 +47,7 @@
 									<th class="taC"><span class="colRed">*</span>开票内容</th>
 									<td>
 									<select name="invoiceElement" id="invoiceElement">
-										<option value="纵横公路工程造价管理系统V9.0">纵横公路工程造价管理系统V9.0</option>
-										<option value="纵横公路造价编审软件V9.0">纵横公路造价编审软件V9.0</option>
-										<option value="纵横公路工程设计数量表算量软件V3.1">纵横公路工程设计数量表算量软件V3.1</option>
-										<option value="纵横公路工程计量支付决算一体化软件V3.1">纵横公路工程计量支付决算一体化软件V3.1</option>
-										<option value="建材在线">建材在线</option>
-										<option value="服务费">服务费</option>
-										<option value="培训费">培训费</option>
-										<option value="软件升级费">软件升级费</option>
-										<option value="软件报表定制费">软件报表定制费</option>
-										<option value="技术服务费">技术服务费</option>
+										<!-- include 'invoiceElement' -->
 									</select>
 								</td>
 								</tr>
@@ -90,8 +81,8 @@
 								<tr>
 									<th class="taC" width="150"><span class="colRed">*</span>单位名称</th>
 									<td><input type="text" name="invoiceCompany" id="invoiceCompany"></td>
-									<th class="taC" width="150"><span class="colRed">*</span>纳税人识别码</th
-									><td><input type="text" name="TIN" id="TIN"></td>
+									<th class="taC" width="150"><span class="colRed">*</span>纳税人识别码</th>
+									<td><input type="text" name="TIN" id="TIN"></td>
 
 								</tr>
 								

+ 158 - 0
protected/view/admin/invoiceEdit.html

@@ -0,0 +1,158 @@
+<!-- include 'header' -->
+<link rel=stylesheet href="<?= WEB_SITE_GLOBAL ?>css/jquery.validator.css"> 
+<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>js/jquery.validator.min.js"></script>
+<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>js/zh-CN.js"></script>
+<script src="<?= WEB_SITE_GLOBAL ?>js/invoice.validator.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">
+					<ul>
+						<!-- include 'invoiceMenu' -->
+					</ul>
+				</div>
+			</div>
+			<div class="adminContent autoHeight">
+				<legend>
+					开票重新申请
+				</legend>
+				<div class="borad-news">
+					<div class="saeaList">
+					<form action="/invoiceEditDo" method="post" id="invoice">
+						<input type="hidden" name="iidKey" value="{{invoiceDetail.iidKey}}">
+						<table class="table table-bordered table-condensed">
+							<tbody>
+							<tr>
+								<th class="taC">审批人退回意见</th>
+							</tr>
+							<tr>
+								<td colspan="3" class="colRed">{{operation.username}}:{{operation.operation}}</td>
+
+							</tr>
+							</tbody>
+						</table>
+						<table class="table table-bordered table-condensed">
+							<tbody>
+							<tr>
+								<th class="taC" width="150">所在办事处</th>
+								<td>
+									<select name="cid">
+									<!-- loop invoiceDetail.category -->
+									<option <!-- if {{category' value.cid}}=={{invoiceDetail.cid}} --> selected <!-- endif --> value="{{category' value.cid}}:{{category' value.title}}">{{category' value.title}}</option>
+									<!-- endloop -->
+									</select>
+								</td>
+								<th class="taC" width="150">备注</th><td><input name="remark" placeholder="" value="{{invoiceDetail.remark}}" type="text"></td>
+							</tr>
+							<tr>
+								<th class="taC"><span class="colRed">*</span>开票金额</th>
+								<td><input value="{{invoiceDetail.invoicePrice}}" name="invoicePrice" placeholder="输入开票金额" pattern="[0-9]" type="number" min="0" step="0.01">
+								</td>
+								<th class="taC"><span class="colRed">*</span>开票内容</th>
+								<td>
+								<select name="invoiceElement" >
+								<!-- include 'invoiceElement' -->
+							</select>
+							</td>
+							</tr>
+							<tr>
+								<th class="taC"><span class="colRed">*</span>发票类型</th><td colspan="3">
+								<label class="radio inline"><input name="invoiceType" id="invoicePlain" onclick="invoiceShow()"  value="0" <!-- if {{invoiceDetail.invoiceType}}==0 --> checked <!-- endif --> type="radio">增值税普通发票</label>
+								<label class="radio inline"><input name="invoiceType" id="invoiceSpecial" onclick="invoiceShow()"  value="1" <!-- if {{invoiceDetail.invoiceType}}==1 --> checked <!-- endif --> type="radio">增值税专用发票</label>
+							</td>
+							</tr>
+							</tbody>
+						</table>
+						<table id="plainInvoice_box" class="table table-bordered table-condensed" <!-- if {{invoiceDetail.invoiceType}}==1 --> style="display:none" <!-- endif --> >
+							<tbody>
+							<tr>
+								<th colspan="4" class="taC">增值税普通发票</th>
+							</tr>
+							<tr>
+								<th class="taC" width="150"><span class="colRed">*</span>发票抬头</th><td colspan="3"><input name="invoiceTitle" id="invoiceTitle" value="{{invoiceDetail.invoiceTitle}}" type="text" class="span6"></td>
+
+							</tr>
+							</tbody>
+						</table>
+						<table id="specialInvoice_box" class="table table-bordered table-condensed" <!-- if {{invoiceDetail.invoiceType}}==0 --> style="display:none" <!-- endif --> >
+							<tbody>
+							<tr>
+								<th colspan="4" class="taC">增值税专用发票</th>
+							</tr>
+							<tr>
+								<th class="taC" width="150"><span class="colRed">*</span>单位名称</th>
+								<td>
+								<input name="invoiceCompany" id="invoiceCompany" value="{{invoiceDetail.invoiceCompany}}" type="text">
+								</td>
+								<th class="taC" width="150"><span class="colRed">*</span>纳税人识别码</th>
+								<td><input name="TIN" id="TIN" value="{{invoiceDetail.TIN}}" type="text"></td>
+
+							</tr>
+							</tr>
+							<tr>
+								<th class="taC"><span class="colRed">*</span>注册地址</th>
+								<td><input type="text" value="{{invoiceDetail.address}}" name="address" id="address"></td>
+								<th class="taC"><span class="colRed">*</span>注册电话</th>
+								<td><input type="text" value="{{invoiceDetail.phone}}" name="phone" id="phone"></td>
+							</tr>
+							<tr>
+								<th class="taC"><span class="colRed">*</span>开户银行</th>
+								<td><input type="text" name="bank" id="bank" value="{{invoiceDetail.bank}}"></td>
+								<th class="taC"><span class="colRed">*</span>银行账户</th>
+								<td><input type="text" name="bankAccount" id="bankAccount" value="{{invoiceDetail.bankAccount}}"></td>
+							</tr>
+							</tbody>
+						</table>
+						<table class="table table-bordered table-condensed">
+							
+							<tr>
+								<th colspan="4" class="taC">邮寄信息</th>
+							</tr>
+							<tr>
+								<th class="taC" width="150"><span class="colRed">*</span>是否邮寄</th><td colspan="3">
+								<label class="radio inline">
+								<input type="radio" onclick="mailShow()" id="isMail" name="doPost" value="1" <!-- if {{invoiceDetail.doPost}}==1 --> checked <!-- endif -->  >是</label>
+								<label class="radio inline"><input type="radio" onclick="mailShow()" name="doPost" value="0" <!-- if {{invoiceDetail.doPost}}==0 --> checked <!-- endif --> >否</label>
+							</td>
+							</tr>
+							<tbody id="mail_box" <!-- if {{invoiceDetail.doPost}}==0 --> style="display:none" <!-- endif --> >
+							<tr>
+								<th class="taC" width="150"><span class="colRed">*</span>收件人</th>
+								<td><input type="text"  name="recipients" id="recipients" value="{{invoiceDetail.recipients}}" ></td>
+								<th class="taC" width="150"><span class="colRed">*</span>收件人手机/电话</th>
+								<td><input type="text" name="recipientsPhone" id="recipientsPhone" value="{{invoiceDetail.recipientsPhone}}" ></td>
+							</tr>
+							<tr>
+								<th class="taC" width="150"><span class="colRed">*</span>收件地址</th>
+								<td colspan="3"><input type="text" class="span6" name="recipientsAddress" id="recipientsAddress" value="{{invoiceDetail.recipientsAddress}}" ></td>
+							</tr>
+							<tr>
+								<th class="taC" width="150">邮寄物品</th>
+								<td colspan="3"><input name="mailItems" value="{{invoiceDetail.mailItems}}" placeholder="请详细填写需要邮寄的物品及数量,如:锁套装x1、合同x1" type="text" class="span6"></td>
+							</tr>
+							</tbody>
+						</table>
+						<p class="alert">重新提交审批,将由退回人继续审批,无需从头开始审批。</p>
+						<p class="taR"><button type="submit" class="button" href="#confirm" data-toggle="modal">重新审批</button></p>
+					</p>
+					</form>
+					
+					
+					
+				</div>
+			</div>
+		</div>
+	</div>
+ 	
+<script type="text/javascript">autoFlashHeight();</script>	
+</body>

+ 24 - 0
protected/view/admin/invoiceElement.html

@@ -0,0 +1,24 @@
+
+<!-- if isset({{invoiceDetail}}) -->
+<option <!-- if {{invoiceDetail.invoiceElement}}=='纵横公路工程造价管理系统V9.0' --> selected <!-- endif --> value="纵横公路工程造价管理系统V9.0">纵横公路工程造价管理系统V9.0</option>
+<option <!-- if {{invoiceDetail.invoiceElement}}=='纵横公路造价编审软件V9.0' --> selected <!-- endif --> value="纵横公路造价编审软件V9.0">纵横公路造价编审软件V9.0</option>
+<option <!-- if {{invoiceDetail.invoiceElement}}=='纵横公路工程设计数量表算量软件V3.1' --> selected <!-- endif --> value="纵横公路工程设计数量表算量软件V3.1">纵横公路工程设计数量表算量软件V3.1</option>
+<option <!-- if {{invoiceDetail.invoiceElement}}=='纵横公路工程计量支付决算一体化软件V3.1' --> selected <!-- endif --> value="纵横公路工程计量支付决算一体化软件V3.1">纵横公路工程计量支付决算一体化软件V3.1</option>
+<option <!-- if {{invoiceDetail.invoiceElement}}=='建材在线' --> selected <!-- endif --> value="建材在线">建材在线</option>
+<option <!-- if {{invoiceDetail.invoiceElement}}=='服务费' --> selected <!-- endif --> value="服务费">服务费</option>
+<option <!-- if {{invoiceDetail.invoiceElement}}=='培训费' --> selected <!-- endif --> value="培训费">培训费</option>
+<option <!-- if {{invoiceDetail.invoiceElement}}=='软件升级费' --> selected <!-- endif --> value="软件升级费">软件升级费</option>
+<option <!-- if {{invoiceDetail.invoiceElement}}=='软件报表定制费' --> selected <!-- endif --> value="软件报表定制费">软件报表定制费</option>
+<option <!-- if {{invoiceDetail.invoiceElement}}=='技术服务费' --> selected <!-- endif --> value="技术服务费">技术服务费</option>
+<!-- else -->
+<option value="纵横公路工程造价管理系统V9.0">纵横公路工程造价管理系统V9.0</option>
+<option value="纵横公路造价编审软件V9.0">纵横公路造价编审软件V9.0</option>
+<option value="纵横公路工程设计数量表算量软件V3.1">纵横公路工程设计数量表算量软件V3.1</option>
+<option value="纵横公路工程计量支付决算一体化软件V3.1">纵横公路工程计量支付决算一体化软件V3.1</option>
+<option value="建材在线">建材在线</option>
+<option value="服务费">服务费</option>
+<option value="培训费">培训费</option>
+<option value="软件升级费">软件升级费</option>
+<option value="软件报表定制费">软件报表定制费</option>
+<option value="技术服务费">技术服务费</option>
+<!-- endif -->

+ 5 - 5
protected/view/admin/invoiceMenu.html

@@ -10,7 +10,7 @@
 
 
 
-	<li class="topLine"><a href="invoice-input-billing.html">收款录入</a></li>
+	<li class="topLine"><a <!-- if {{receiptMemu}}=="invoiceReceivables" --> class="selected" <!-- endif --> href="/invoiceReceivables">收款录入</a></li>
 
 	<!-- if isInvoiceMoldShow({{staff.0.sid}},'发票审批') -->
 	<li><a
@@ -26,11 +26,11 @@
 	</a></li>
 	<!-- endif -->
 	<!-- if isInvoiceMoldShow({{staff.0.sid}},'发票邮寄') -->
-	<li class="news"><a
-			<!-- if {{receiptMemu}}=="invoicePost" --> class="selected" <!-- endif -->
-			href="/invoicePost">发票邮寄
+	<li class="news"><a <!-- if {{receiptMemu}}=="invoicePost" --> class="selected" <!-- endif --> href="/invoicePost">发票邮寄
 	</a></li>
 <!-- endif -->
-	<li><a href="invoice-return.html">发票退票</a></li>
+<!-- if isInvoiceMoldShow({{staff.0.sid}},'发票退票') -->
+	<li><a <!-- if {{receiptMemu}}=="invoiceUntread" --> class="selected" <!-- endif --> href="/invoiceUntread">发票退票</a></li>
+<!-- endif -->	
 	<li><a href="invoice-dlist-category-year.html">公司汇总</a></li>
 </ul>

+ 237 - 188
protected/view/admin/invoicePost.html

@@ -1,4 +1,8 @@
 <!-- include 'header' -->
+<link rel=stylesheet href="<?= WEB_SITE_GLOBAL ?>css/jquery.validator.css">
+<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>js/jquery.validator.min.js"></script>
+<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>js/zh-CN.js"></script>
+<script src="<?= WEB_SITE_GLOBAL ?>js/invoice.validator.js"></script>
 <script src="<?= WEB_SITE_GLOBAL ?>js/invoice.js"></script>
 <body>
 	<div class="mainLayout">
@@ -6,9 +10,10 @@
 			<div class="menuItem">
 				<a href="#" class="mLogo">CLD</a>
 				<ul>
-					<!-- include 'menuReceipt' --></ul>
+					<!-- include 'menuReceipt' -->
+				</ul>
 			</div>
-			
+
 		</div>
 		<div class="warpContent">
 			<div class="subMenu fL">
@@ -17,93 +22,100 @@
 				</div>
 			</div>
 			<div class="adminContent autoHeight">
-				<div class="borad-menu">
-				</div>
+				<div class="borad-menu"></div>
 				<div class="borad-news">
 					<div class="saeaList">
 						<div class="clearfix">
 							<!-- if !empty({{invoicePost}}) -->
-							<legend><div class="fR"></div>待邮寄</legend>
+							<legend>
+								<div class="fR"></div>
+								待邮寄
+							</legend>
 							<table class="table table-bordered table-condensed">
 								<tbody>
-								<tr><th class="taC">开票流水号</th><th class="taC">开票单位(抬头)</th><th class="taC">开票金额</th><th class="taC">提交开票</th><th class="taC">打印发票</th><th class="taC" width="120">操作</th></tr>
-								<!-- loop invoicePost -->
-								<tr>
-									<td><a href="#invdetail" data-toggle="modal">{{invoiceList' value.invoiceSerial}}</a></td>
-									<td>
-                                    <!-- if !empty({{invoiceList' value.invoiceType}}) -->
-                                   	{{invoiceList' value.invoiceCompany}}
-                                    <!-- else -->
-                                    {{invoiceList' value.invoiceTitle}}
-                                    <!-- endif -->
-                                    </td>
-									<td>
-                                    <!-- if !empty({{invoiceList' value.invoiceType}}) -->
-                                    <b>¥{{invoiceList' value.invoicePrice}}</b><sup>专</sup>
-                                    <!-- else -->
-                                    <b>¥{{invoiceList' value.invoicePrice}}</b>
-                                    <!-- endif -->
-                                    </td>
-									<td>{{invoiceList' value.categoryName}}{{invoiceList' value.userName}} {{invoiceList' value.date}}</td>
-									<td>{{invoiceList' value.userName}}&nbsp;{{invoiceList' value.printTime}}</td>
-									<td><a class="button btn-block"  node-post="express" post-data="{{invoicePost' value.iidKey}}" href="#addshipping" data-toggle="modal">邮寄发票</a></td>
-								</tr>
-								<!-- endloop -->
-								
+									<tr>
+										<th class="taC">开票流水号</th>
+										<th class="taC">开票单位(抬头)</th>
+										<th class="taC">开票金额</th>
+										<th class="taC">提交开票</th>
+										<th class="taC">打印发票</th>
+										<th class="taC" width="120">操作</th>
+									</tr>
+									<!-- loop invoicePost -->
+									<tr>
+										<td><a href="#invdetail" data-toggle="modal">{{invoiceList' value.invoiceSerial}}</a></td>
+										<td>
+											<!-- if !empty({{invoiceList' value.invoiceType}}) -->
+											{{invoiceList' value.invoiceCompany}} <!-- else -->
+											{{invoiceList' value.invoiceTitle}} <!-- endif -->
+										</td>
+										<td>
+											<!-- if !empty({{invoiceList' value.invoiceType}}) --> 
+											<b>¥{{invoiceList' value.invoicePrice}}</b><sup>专</sup> 
+											<!-- else --> <b>¥{{invoiceList' value.invoicePrice}}</b> 
+											<!-- endif -->
+										</td>
+										<td>{{invoiceList' value.categoryName}}{{invoiceList' value.userName}} {{invoiceList' value.date}}</td>
+										<td>{{invoiceList' value.userName}}&nbsp;{{invoiceList' value.printTime}}</td>
+										<td><a class="button btn-block" node-post="express"
+											post-data="{{invoicePost' value.iidKey}}" href="#addshipping"
+											data-toggle="modal">邮寄发票</a></td>
+									</tr>
+									<!-- endloop -->
+
 								</tbody>
 							</table>
 							<!-- else -->
-							<blockquote><p class="colGray">暂时没有需要邮寄的发票</p></blockquote>
+							<blockquote>
+								<p class="colGray">暂时没有需要邮寄的发票</p>
+							</blockquote>
 							<!-- endif -->
 						</div>
 						<div class="clearfix">
-							<legend><div class="fR"><a href="invoice-shipping-all.html">查看更多</a></div>最近邮寄发票</legend>
+							<legend>
+								<div class="fR">
+									<a href="invoice-shipping-all.html">查看更多</a>
+								</div>
+								最近邮寄发票
+							</legend>
 							<!-- if !empty({{invoicePosted}}) -->
 							<table class="table table-bordered table-condensed">
 								<tbody>
-								<tr><th class="taC">开票流水号</th><th class="taC">开票单位(抬头)</th><th class="taC">开票金额</th><th class="taC">提交开票</th><th class="taC">快递信息</th><th class="taC">邮寄发票</th></tr>
-								<!-- loop invoicePosted -->
-								<tr>
-									<td><a href="#invdetail" data-toggle="modal">{{invoiceList' value.invoiceSerial}}</a></td>
-									<td>
-                                    <!-- if !empty({{invoiceList' value.invoiceType}}) -->
-                                   	{{invoiceList' value.invoiceCompany}}
-                                    <!-- else -->
-                                    {{invoiceList' value.invoiceTitle}}
-                                    <!-- endif -->
-                                    </td>
-									<td>
-                                    <!-- if !empty({{invoiceList' value.invoiceType}}) -->
-                                    <b>¥{{invoiceList' value.invoicePrice}}</b><sup>专</sup>
-                                    <!-- else -->
-                                    <b>¥{{invoiceList' value.invoicePrice}}</b>
-                                    <!-- endif -->
-                                    </td>
-									<td>{{invoiceList' value.categoryName}}{{invoiceList' value.userName}} {{invoiceList' value.date}}</td>
-									<td>{{invoiceList' value.userName}}&nbsp;{{invoiceList' value.printTime}}</td>
-									<td><a class="button btn-block"  href="#addshipping" data-toggle="modal">邮寄发票</a></td>
-								</tr>
-								<!-- endloop -->
-								<tr>
-									<td><a href="#invdetail" data-toggle="modal">#F20160316001</a></td>
-									<td>珠海XXXX公司</td>
-									<td><b>¥3000.00</b></td>
-									<td>广东办刘飞 2016-03-03 12:20:20</td>
-									<td>顺丰速运:<a href="#shipping" data-toggle="modal">01239812382398</a></td>
-									<td>赵淑燕 2016-03-03 12:20:20</td>
-								</tr>
-								<tr>
-									<td><a href="#invdetail" data-toggle="modal">#F20160316001</a></td>
-									<td>珠海XXXX公司</td>
-									<td><b>¥3000.00</b><sup>专</sup></td>
-									<td>广东办刘飞 2016-03-03 12:20:20</td>
-									<td>顺丰速运:<a href="#shipping" data-toggle="modal">01239812382398</a></td>
-									<td>赵淑燕 2016-03-03 12:20:20</td>
-								</tr>
+									<tr>
+										<th class="taC">开票流水号</th>
+										<th class="taC">开票单位(抬头)</th>
+										<th class="taC">开票金额</th>
+										<th class="taC">提交开票</th>
+										<th class="taC">快递信息</th>
+										<th class="taC">邮寄发票</th>
+									</tr>
+									<!-- loop invoicePosted -->
+									<tr>
+										<td><a href="#invdetail" data-toggle="modal">{{invoiceList' value.invoiceSerial}}</a></td>
+										<td>
+											<!-- if !empty({{invoiceList' value.invoiceType}}) -->
+											{{invoiceList' value.invoiceCompany}} <!-- else -->
+											{{invoiceList' value.invoiceTitle}} <!-- endif -->
+										</td>
+										<td>
+											<!-- if !empty({{invoiceList' value.invoiceType}}) --> 
+											<b>¥{{invoiceList' value.invoicePrice}}</b><sup>专</sup> 
+											<!-- else --> <b>¥{{invoiceList' value.invoicePrice}}</b> 
+											<!-- endif -->
+										</td>
+										<td>{{invoiceList' value.categoryName}}{{invoiceList' value.userName}} {{invoiceList' value.date}}</td>
+											
+										<td>{{invoiceList' value.expressCompany}}:<a href="#shipping" node-post="express-msg" post-data="{{invoicePost' value.iidKey}}" data-toggle="modal">{{invoiceList' value.expressNumber}}</a></td>
+										<td>{{invoiceList' value.poster}} {{invoiceList' value.postTime}}</td>
+									</tr>
+									<!-- endloop -->
+									
 								</tbody>
 							</table>
 							<!-- else -->
-							<blockquote><p class="colGray">暂时没有已邮寄的发票</p></blockquote>
+							<blockquote>
+								<p class="colGray">暂时没有已邮寄的发票</p>
+							</blockquote>
 							<!-- endif -->
 						</div>
 					</div>
@@ -113,125 +125,162 @@
 	</div>
 
 	<!--弹出邮寄-->
-<div class="modal hide fade" id="addshipping">
-	<div class="modal-dialog">
-		<div class="modal-content">
-    <div class="modal-header">
-    <h3>邮寄物品</h3>
-    </div>
-    <form action="/invoiceExpressAddDo" method="post">
-    <input type="hidden" name="iidKey" value="">
-    <div class="modal-body saeaList">
-    	<div style='text-align:center' loading-msg='true'></div>
-		<table class="table table-bordered table-condensed">
-			<tbody>
-			<tr>
-				<th colspan="4" class="taC">申请邮寄信息</th>
-			</tr>
-			<tr>
-				<th class="taC" width="100">收件人</th><td recipients-data='true' ></td>
-				<th class="taC" width="100">收件人手机/电话</th><td recipientsPhone-data='true'></td>
-			</tr>
-			<tr>
-				<th class="taC" width="100">收件地址</th><td colspan="3" recipientsAddress-data='true'></td>
-			</tr>
-			<tr>
-				<th class="taC" width="100">邮寄物品</th><td colspan="3" mailItems-data='true'></td>
-			</tr>
-			</tbody>
-		</table>
-		<table class="table table-bordered table-condensed">
-			<tbody>
-			<tr>
-				<th colspan="2" class="taC">实际邮寄信息</th>
-			</tr>
-			<tr>
-				<th class="taC" width="100"><span class="colRed">*</span>快递公司</th><td>
-				<select><option>顺丰速运</option><option>圆通速运</option></select></td>
-			</tr>
-			<tr>
-				<th class="taC" width="100"><span class="colRed">*</span>快递单号</th><td><input type="text" placeholder="请正确填写单号,方便跟踪查询。"></td></tr>
-			<tr>
-				<th class="taC" width="100"><span class="colRed">*</span>邮寄物品</th><td><textarea class="span4" placeholder="请详细填写邮寄的快递包含什么物件。"></textarea></td>
-			</tr>
-			</tbody>
-		</table>
-    </div>
-	<div class="modal-footer">
-	    <a href="#" class="button" data-dismiss="modal">确定邮寄</a>
-	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
+	<div class="modal hide fade" id="addshipping">
+		<div class="modal-dialog">
+			<div class="modal-content">
+				<div class="modal-header">
+					<h3>邮寄物品</h3>
+				</div>
+				<form action="/invoiceExpressAddDo" name="invoiceExpress"
+					method="post">
+					<input type="hidden" name="iidKey" value="">
+					<div class="modal-body saeaList">
+						<div style='text-align: center' loading-msg='true'></div>
+						<table class="table table-bordered table-condensed">
+							<tbody>
+								<tr>
+									<th colspan="4" class="taC">申请邮寄信息</th>
+								</tr>
+								<tr>
+									<th class="taC" width="100">收件人</th>
+									<td recipients-data='true'></td>
+									<th class="taC" width="100">收件人手机/电话</th>
+									<td recipientsPhone-data='true'></td>
+								</tr>
+								<tr>
+									<th class="taC" width="100">收件地址</th>
+									<td colspan="3" recipientsAddress-data='true'></td>
+								</tr>
+								<tr>
+									<th class="taC" width="100">邮寄物品</th>
+									<td colspan="3" mailItems-data='true'></td>
+								</tr>
+							</tbody>
+						</table>
+						<table class="table table-bordered table-condensed">
+							<tbody>
+								<tr>
+									<th colspan="2" class="taC">实际邮寄信息</th>
+								</tr>
+								<tr>
+									<th class="taC" width="100"><span class="colRed">*</span>快递公司</th>
+									<td><select name="express">
+											<!-- loop expressList -->
+											<option value="{{expressList' value.company}}:{{expressList' value.com}}">{{expressList' value.company}}</option>
+											<!-- endloop -->
+
+									</select></td>
+								</tr>
+								<tr>
+									<th class="taC" width="100"><span class="colRed">*</span>快递单号</th>
+									<td><input type="text" name="nu"
+										placeholder="请正确填写单号,方便跟踪查询。"></td>
+								</tr>
+								<tr>
+									<th class="taC" width="100"><span class="colRed">*</span>邮寄物品</th>
+									<td><textarea name="actualItems" class="span4"
+											placeholder="请详细填写邮寄的快递包含什么物件。"></textarea></td>
+								</tr>
+							</tbody>
+						</table>
+					</div>
+					<div class="modal-footer">
+						<input type="submit" class="button" value="确定邮寄"> <a
+							href="#" class="button btn-gray" data-dismiss="modal"
+							aria-hidden="true">关闭</a>
+					</div>
+				</form>
+			</div>
+		</div>
 	</div>
-	</form>
-			</div></div>
-</div>
-    <!--邮寄-->
+	<!--邮寄-->
 	<!--弹出快递跟踪-->
-<div class="modal hide fade" id="shipping">
-	<div class="modal-dialog">
-		<div class="modal-content">
-    <div class="modal-header">
-    <h3>邮寄物品</h3>
-    </div>
-    <div class="modal-body saeaList">
-		<table class="table table-bordered table-condensed">
-			<tbody>
-			<tr>
-				<th colspan="4" class="taC">申请邮寄信息</th>
-			</tr>
-			<tr>
-				<th class="taC" width="100">收件人</th><td>陈工</td>
-				<th class="taC" width="100">收件人手机/电话</th><td>12345678901</td>
-			</tr>
-			<tr>
-				<th class="taC" width="100">收件地址</th><td colspan="3">广东省珠海市XXX路XXX号</td>
-			</tr>
-			<tr>
-				<th class="taC" width="100">邮寄物品</th><td colspan="3">合同x1、锁套装x1</td>
-			</tr>
-			</tbody>
-		</table>
-		<table class="table table-bordered table-condensed">
-			<tbody>
-			<tr>
-				<th colspan="4" class="taC">实际邮寄信息</th>
-			</tr>
-			<tr>
-				<th class="taC" width="100">快递公司</th><td>顺丰速运</td><th class="taC" width="100">快递单号</th><td>01239812382398</td></tr>
-			</tr>
-			<tr>
-
-			<tr>
-				<th class="taC" width="100">邮寄物品</th><td colspan="3">合同x1、锁套装x1</td>
-			</tr>
-			</tbody>
-		</table>
-		<table class="table table-bordered table-condensed">
-			<tbody>
-			<tr>
-				<th class="taC">快递跟踪</th>
-			</tr>
-			<tr>
-				<td class="taC">
-					<blockquote>
-						<p><span class="colGray">2016-11-22 周二 15:40:53</span>&nbsp;您的包裹已出库</p>
-					</blockquote>
-					<blockquote>
-						<p><span class="colGray">2016-11-22 周二 15:40:53</span>&nbsp;包裹正在等待揽收</p>
-					</blockquote>
-					<blockquote>
-						<p><span class="colGray">2016-11-21 周一 18:04:23</span>&nbsp;[泰州市]申通快递 兴化恒通婴儿用品公司收件员 已揽件</p>
-					</blockquote>
+	<div class="modal hide fade" id="shipping">
+		<div class="modal-dialog">
+			<div class="modal-content">
+				<div class="modal-header">
+					<h3>邮寄物品</h3>
+				</div>
+				<div class="modal-body saeaList">
+				<div style='text-align: center' loading-msg='express-msg'></div>
+					<table class="table table-bordered table-condensed">
+						<tbody>
+							<tr>
+								<th colspan="4" class="taC">申请邮寄信息</th>
+							</tr>
+							<tr>
+								<th class="taC" width="100">收件人</th>
+								<td recipients-data='express-msg'></td>
+								<th class="taC" width="100">收件人手机/电话</th>
+								<td recipientsPhone-data='express-msg'></td>
+							</tr>
+							<tr>
+								<th class="taC" width="100">收件地址</th>
+								<td recipientsAddress-data='express-msg' colspan="3"></td>
+							</tr>
+							<tr>
+								<th class="taC" width="100">邮寄物品</th>
+								<td mailItems-data='express-msg' colspan="3"></td>
+							</tr>
+						</tbody>
+					</table>
+					<table class="table table-bordered table-condensed">
+						<tbody>
+							<tr>
+								<th colspan="4" class="taC">实际邮寄信息</th>
+							</tr>
+							<tr>
+								<th class="taC" width="100">快递公司</th>
+								<td expressCompany-data='express-msg'></td>
+								<th class="taC" width="100">快递单号</th>
+								<td expressNumber-data='express-msg'></td>
+							</tr>
+							</tr>
+							<tr>
+							<tr>
+								<th class="taC" width="100">邮寄物品</th>
+								<td colspan="3" actualItems-data='express-msg'></td>
+							</tr>
+						</tbody>
+					</table>
+					<table style="display:none" class="table table-bordered table-condensed">
+						<tbody>
+							<tr>
+								<th class="taC">快递跟踪</th>
+							</tr>
+							<tr>
+								<td class="taC">
+									<blockquote>
+										<p>
+											<span class="colGray">2016-11-22 周二 15:40:53</span>&nbsp;您的包裹已出库
+										</p>
+									</blockquote>
+									<blockquote>
+										<p>
+											<span class="colGray">2016-11-22 周二 15:40:53</span>&nbsp;包裹正在等待揽收
+										</p>
+									</blockquote>
+									<blockquote>
+										<p>
+											<span class="colGray">2016-11-21 周一 18:04:23</span>&nbsp;[泰州市]申通快递
+											兴化恒通婴儿用品公司收件员 已揽件
+										</p>
+									</blockquote>
 
-				</td>
-			</tr>
-			</tbody>
-		</table>
-    </div>
-	<div class="modal-footer">
-	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
+								</td>
+							</tr>
+						</tbody>
+					</table>
+				</div>
+				<div class="modal-footer">
+					<a href="#" class="button btn-gray" data-dismiss="modal"
+						aria-hidden="true">关闭</a>
+				</div>
+			</div>
+		</div>
 	</div>
-			</div></div>
-</div>
-    <!--邮寄-->
-<script type="text/javascript">autoFlashHeight();</script>	
+	<!--邮寄-->
+	<script type="text/javascript">
+		autoFlashHeight();
+	</script>
 </body>

+ 218 - 0
protected/view/admin/invoiceReceivables.html

@@ -0,0 +1,218 @@
+<!-- include 'header' -->
+<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">
+				<div class="borad-menu">
+					<a href="#inputbill" data-toggle="modal" class="invoice">录入收款</a>
+				</div>
+				<div class="borad-news">
+					<div class="saeaList">
+						<div class="clearfix">
+							<legend><div class="fR"><a href="invoice-input-billing-all.html">查看更多</a></div>最近入账</legend>
+							<table class="table table-bordered table-condensed">
+								<tbody>
+								<tr><th class="taC" width="70">收款金额</th><th class="taC">银行到帐信息</th><th class="taC">银行/到帐时间</th><th class="taC">收款录入</th><th class="taC">收款认领</th></tr>
+								<tr>
+									<td><b>¥3000.00</b></td>
+									<td>张宇</td>
+									<td>广发银行珠海分行柠溪支行 2016-03-03</td>
+									<td>张少珊 2016-03-03</td>
+									<td>陈特 认领 2016-03-03</td>
+								</tr>
+								<tr>
+									<td><b>¥3000.00</b></td>
+									<td>张宇</td>
+									<td>广发银行珠海分行柠溪支行 2016-03-03</td>
+									<td>张少珊 2016-03-03</td>
+									<td>张少珊 转入 公共待认领款项 2016-03-03</td>
+								</tr>
+								<tr>
+									<td><b>¥3000.00</b></td>
+									<td>张宇</td>
+									<td>广发银行珠海分行柠溪支行 2016-03-03</td>
+									<td>张少珊 2016-03-03</td>
+									<td>张少珊 转入 办事处待认领款项 2016-03-03</td>
+								</tr>
+								<tr>
+									<td><b>¥3000.00</b></td>
+									<td>张宇</td>
+									<td>广发银行珠海分行柠溪支行 2016-03-03</td>
+									<td>张少珊 2016-03-03</td>
+									<td>张少珊 转入 刘飞 2016-03-03</td>
+								</tr>
+								</tbody>
+							</table>
+							<blockquote><p class="colGray">暂时没有已认领的收款</p></blockquote>
+						</div>
+					</div>
+				</div>
+			</div>
+		</div>
+	</div>
+
+	<!--弹出变更-->
+<div class="modal hide fade" id="receive">
+	<div class="modal-dialog">
+		<div class="modal-content">
+    <div class="modal-header">
+    <h3>变更认领人</h3>
+    </div>
+    <div class="modal-body">
+    	<form class="form-horizontal">
+			<div class="control-group">
+				<label class="control-label"><span class="colRed">*</span>办事处</label>
+				<div class="controls">
+					<select><option>公共待认领收款</option><option>广西办</option></select>
+				</div>
+			</div>
+			<div class="control-group">
+				<label class="control-label"></label>
+				<div class="controls">
+					<select><option>办事处待认领收款</option><option>姜栋</option></select>
+				</div>
+			</div>
+		</form>
+    </div>
+	<div class="modal-footer">
+	    <a href="#" class="button">确定</a>
+	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
+	</div>
+			</div></div>
+</div>
+    <!--弹出变更-->
+	<!--弹出修改-->
+<div class="modal hide fade" id="billeidt">
+	<div class="modal-dialog">
+		<div class="modal-content">
+    <div class="modal-header">
+    <h3>修改收款</h3>
+    </div>
+			<div class="modal-body saeaList">
+				<table class="table table-bordered table-condensed">
+					<tbody>
+					<tr>
+						<th class="taC" colspan="4">收款信息填写</th>
+					</tr>
+					<tr>
+						<th class="taC">收款金额</th><td><input value="0" placeholder="输入开票金额" pattern="[0-9]" min="0" step="0.01" type="number"></td>
+					</tr>
+					<tr>
+						<th class="taC">收款信息</th><td><input type="text"></td>
+					</tr>
+					<tr>
+						<th class="taC">收款银行</th><td>
+						<select>
+							<option>广发银行珠海分行柠溪支行</option>
+						</select></td>
+					</tr>
+					<tr>
+						<th class="taC">银行到帐时间</th><td><input type="date"></td>
+					</tr>
+					<tr>
+						<th class="taC">认领收款</th><td colspan="3">
+						<select>
+							<option>公共待认领款项</option>
+							<option>广东办</option>
+							<option>广西办</option>
+							<option>重庆办</option>
+						</select>
+
+						<select>
+							<option>办事处待认领款项</option>
+							<option>广东办-刘飞</option>
+						</select></td>
+					</tr>
+					</tbody></table>
+			</div>
+	<div class="modal-footer">
+	    <a href="#" class="button">确定</a>
+	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
+	</div>
+			</div></div>
+</div>
+    <!--弹出修改-->   
+	<!--弹出删除-->
+<div class="modal hide fade" id="billdel">
+	<div class="modal-dialog">
+		<div class="modal-content">
+    <div class="modal-header">
+    <h3>删除收款</h3>
+    </div>
+    <div class="modal-body">
+    	数据诚可贵,删除需谨慎!
+    </div>
+	<div class="modal-footer">
+	    <a href="#" class="button">删除</a>
+	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
+	</div>
+			</div></div>
+</div>
+    <!--弹出删除-->
+	<!--弹出(录入收款)-->
+	<div class="modal hide fade" id="inputbill">
+		<div class="modal-dialog ">
+			<div class="modal-content">
+				<div class="modal-header">
+					<h3>录入收款</h3>
+				</div>
+				<div class="modal-body saeaList">
+					<table class="table table-bordered table-condensed">
+						<tbody>
+						<tr>
+							<th class="taC" colspan="4">收款信息填写</th>
+						</tr>
+						<tr>
+							<th class="taC">收款金额</th><td><input value="0" placeholder="输入开票金额" pattern="[0-9]" min="0" step="0.01" type="number"></td>
+						</tr>
+						<tr>
+							<th class="taC">收款信息</th><td><input type="text"></td>
+						</tr>
+						<tr>
+							<th class="taC">收款银行</th><td>
+							<select>
+								<option>广发银行珠海分行柠溪支行</option>
+							</select></td>
+						</tr>
+						<tr>
+							<th class="taC">银行到帐时间</th><td><input type="date"></td>
+						</tr>
+						<tr>
+							<th class="taC">认领收款</th><td colspan="3">
+							<select>
+								<option>公共待认领款项</option>
+								<option>广东办</option>
+								<option>广西办</option>
+								<option>重庆办</option>
+							</select>
+
+							<select>
+								<option>办事处待认领款项</option>
+								<option>广东办-刘飞</option>
+							</select></td>
+						</tr>
+						</tbody></table>
+				</div>
+				<div class="modal-footer">
+					<a href="#" class="button" data-dismiss="modal" aria-hidden="true">确认录入</a>
+					<a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
+				</div>
+			</div></div>
+	</div>
+	<!--弹出内容-->
+<script type="text/javascript">autoFlashHeight();</script>	
+</body>

+ 157 - 0
protected/view/admin/invoiceUntread.html

@@ -0,0 +1,157 @@
+<!-- include 'header' -->
+<script src="<?= WEB_SITE_GLOBAL ?>js/invoice.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">
+				<div class="borad-menu">
+				</div>
+				<div class="borad-news">
+					<div class="saeaList">
+						<div class="clearfix">
+						<!-- if !empty({{untreadInvoice}}) -->
+							<legend><div class="fR"></div>待确认退票</legend>
+							<table class="table table-bordered table-condensed">
+								<tbody>
+								<tr><th class="taC">开票流水号</th><th class="taC">开票单位(抬头)</th><th class="taC">开票金额</th><th class="taC">提交退票</th><th class="taC">退票快递</th><th class="taC" width="120">操作</th></tr>
+								
+								<!-- loop untreadInvoice -->
+                                <tr>
+                                    <td><a href="#invdetail" data-toggle="modal">{{invoiceList' value.invoiceSerial}}</a></td>
+                                    <td>
+                                    <!-- if !empty({{invoiceList' value.invoiceType}}) -->
+                                   	{{invoiceList' value.invoiceCompany}}
+                                    <!-- else -->
+                                    {{invoiceList' value.invoiceTitle}}
+                                    <!-- endif -->
+                                    </td>
+                                    <td>
+                                    <!-- if !empty({{invoiceList' value.invoiceType}}) -->
+                                    <b>¥{{invoiceList' value.invoicePrice}}</b><sup>专</sup>
+                                    <!-- else -->
+                                    <b>¥{{invoiceList' value.invoicePrice}}</b>
+                                    <!-- endif -->
+                                    </td>
+                                    <td>{{invoiceList' value.categoryName}}{{invoiceList' value.userName}} {{invoiceList' value.date}}</td>
+                                    <td>{{invoiceList' value.untreadCompany}}:
+                                    <a href="#shipping" title="{{invoiceList' value.untreadItems}}" node-express="untread" data-toggle="modal">{{invoiceList' value.untreadNumber}}</a> 
+                                    <a target="_blank" href="http://www.kuaidi100.com/chaxun?com={{invoiceList' value.untreadCom}}&nu={{invoiceList' value.untreadNumber}}">点击查询快递信息</a> </td>
+                                    <td><a class="button btn-block" diss-data="{{pendingInvoice' value.iidKey}}" node-invoice="untreadInvoice"  href="#return" data-toggle="modal">确认退票</a></td>
+                                </tr>
+                                <!-- endloop -->
+								</tbody>
+							</table>
+							<!-- else -->
+							<blockquote><p class="colGray">暂时没有需要邮寄的发票</p></blockquote>
+							<!-- endif -->
+						</div>
+						<div class="clearfix">
+							<!-- if !empty({{establishedInvoice}}) -->
+							<legend><div class="fR"><a href="invoice-return-all.html">查看更多</a></div>最近退票</legend>
+							<table class="table table-bordered table-condensed">
+								<tbody>
+								<tr><th class="taC">开票流水号</th><th class="taC">开票单位(抬头)</th><th class="taC">开票金额</th><th class="taC">提交开票</th><th class="taC">快递信息</th><th class="taC">确认退票</th></tr>
+								
+								<!-- loop establishedInvoice -->
+                                <tr>
+                                    <td><a href="#invdetail" data-toggle="modal">{{invoiceList' value.invoiceSerial}}</a></td>
+                                    <td>
+                                    <!-- if !empty({{invoiceList' value.invoiceType}}) -->
+                                   	{{invoiceList' value.invoiceCompany}}
+                                    <!-- else -->
+                                    {{invoiceList' value.invoiceTitle}}
+                                    <!-- endif -->
+                                    </td>
+                                    <td>
+                                    <!-- if !empty({{invoiceList' value.invoiceType}}) -->
+                                    <b>¥{{invoiceList' value.invoicePrice}}</b><sup>专</sup>
+                                    <!-- else -->
+                                    <b>¥{{invoiceList' value.invoicePrice}}</b>
+                                    <!-- endif -->
+                                    </td>
+                                    <td>{{invoiceList' value.categoryName}}{{invoiceList' value.userName}} {{invoiceList' value.date}}</td>
+                                    <td>{{invoiceList' value.untreadCompany}}:
+                                    <a href="#shipping" title="{{invoiceList' value.untreadItems}}" node-express="untread" data-toggle="modal">{{invoiceList' value.untreadNumber}}</a> 
+                                    <a target="_blank" href="http://www.kuaidi100.com/chaxun?com={{invoiceList' value.untreadCom}}&nu={{invoiceList' value.untreadNumber}}">点击查询快递信息</a> </td>
+                                    <td>
+                                    {{establishedInvoice' value.OperationLog.username}} {{establishedInvoice' value.OperationLog.date}}
+                                    </td>
+                                </tr>
+                                <!-- endloop -->
+								</tbody>
+							</table>
+							<!-- else -->
+							<blockquote><p class="colGray">暂时没有已邮寄的发票</p></blockquote>
+							<!-- endif -->
+						</div>
+					</div>
+				</div>
+			</div>
+		</div>
+	</div>
+
+	<!--弹出退票确认-->
+<div class="modal hide fade" id="return">
+<form action="/invoiceUntreadEstablishedDo" method="post" name="untreadInvoice">
+	<input type="hidden" name='untreadIidKey' value="">
+	<div class="modal-dialog">
+		<div class="modal-content">
+    <div class="modal-header">
+    <h3>邮寄物品</h3>
+    </div>
+    <div class="modal-body">
+
+		若发票是邮寄回来的,请确认已经接收到发票。
+
+	</div>
+	<div class="modal-footer">
+		<input type="submit" class="button" value="确认退票">
+	   
+	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
+	</div>
+			</div></div>
+			</form>
+</div>
+    <!--退票确认-->
+	<!--弹出快递跟踪-->
+<div class="modal hide fade" id="shipping">
+	<div class="modal-dialog">
+		<div class="modal-content">
+    <div class="modal-header">
+    <h3>邮寄物品</h3>
+    </div>
+    <div class="modal-body saeaList">
+		<table class="table table-bordered table-condensed">
+			<tbody>
+			<tr>
+				<th class="taC">退票邮寄物品</th>
+			</tr>
+			<tr>
+				<td node-express="msg">发票</td>
+			</tr>
+			</tbody>
+		</table>
+		
+    </div>
+	<div class="modal-footer">
+	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
+	</div>
+			</div></div>
+</div>
+    <!--邮寄-->
+<script type="text/javascript">autoFlashHeight();</script>	
+</body>

+ 13 - 6
protected/view/admin/receiptburEdi.html

@@ -216,14 +216,11 @@
 		  					<div class="reportButton clearfix" style="display:" >
 		  					
 		  					
-	  							<a href="javascript:void(0)" onClick="updateApprovalReceipt(1,{{receiptList' value.rid}})" class="buttonDone buttonBlock">同意支付</a>
+	  							
 		  					
 		  						<!-- if {{receiptDetail' value.button}}==4 -->
+		  						<a href="javascript:void(0)" onClick="updateApprovalReceipt(1,{{receiptList' value.rid}})" class="buttonDone buttonBlock">同意支付</a>
 		  						
-		  						<a href="/approvalChe/{{receiptList' value.rid}}" class="buttonBack <!-- if {{receiptList' value.Rtype}}==1 --> buttonBlock  <!-- endif -->" data-placement="top" data-toggle="ctooltip" data-original-title="上报人修改后由你继续审批">撤回</a>
-	  							<!-- if {{receiptList' value.Rtype}}!=1 -->
-	  							<a href="javascript:void(0)" onClick="updateApprovalReceipt(3,{{receiptList' value.rid}})" class="buttonUndone" data-placement="top" data-toggle="ctooltip" data-original-title="终止报销单">终止</a>
-	  							<!-- endif -->
 	  						
 		  						<!-- endif -->
 		  					</div>
@@ -277,7 +274,17 @@
 		  						
 		  					</ul>
 		  					</div>
-
+					<div class="reportButton clearfix" style="display:" >
+		  					
+		  						<!-- if {{receiptDetail' value.button}}==4 -->
+		  						
+		  						<a href="/approvalChe/{{receiptList' value.rid}}" class="buttonBack <!-- if {{receiptList' value.Rtype}}==1 --> buttonBlock  <!-- endif -->" data-placement="top" data-toggle="ctooltip" data-original-title="上报人修改后由你继续审批">撤回</a>
+	  							<!-- if {{receiptList' value.Rtype}}!=1 -->
+	  							<a href="javascript:void(0)" onClick="updateApprovalReceipt(3,{{receiptList' value.rid}})" class="buttonUndone" data-placement="top" data-toggle="ctooltip" data-original-title="终止报销单">终止</a>
+	  							<!-- endif -->
+	  						
+		  						<!-- endif -->
+		  					</div>
 	  					</form>
 	  				</div>
 	  				

+ 10 - 9
protected/view/admin/remitApproval.html

@@ -108,18 +108,10 @@
 		  					</div>
 		  					
 		  					<div class="reportButton clearfix">
-		  					
-		  					
-		  					
 		  						<!-- if {{receiptDetail' value.button}}==4 -->
 		  						
 	  							<a href="javascript:void(0)" onClick="updateApprovalReceipt(1,{{receiptList' value.rid}})" class="buttonDone buttonBlock">同意支付</a>
-		  						<a href="/approvalChe/{{receiptList' value.rid}}" class="buttonBack" data-placement="top" data-toggle="ctooltip" data-original-title="上报人修改后由你继续审批">撤回</a>
-	  							<a href="javascript:void(0)" onClick="updateApprovalReceipt(3,{{receiptList' value.rid}})" class="buttonUndone" data-placement="top" data-toggle="ctooltip" data-original-title="终止报销单">终止</a>
-	  						
-	  						
-		  						<a href="javascript:void(0)" style="display:none" onClick="updateApprovalReceipt(1,{{receiptList' value.rid}})" class="buttonDone">同意支付</a>
-		  						<a href="javascript:void(0)" style="display:none" onClick="updateApprovalReceipt(3,{{receiptList' value.rid}})" class="buttonUndone">退回</a>
+		  						
 		  						<!-- endif -->
 		  					</div>
 		  					<div class="censorList clearfix censorHeight">
@@ -168,6 +160,15 @@
 		  						
 		  					</ul>
 		  					</div>
+		  					
+		  					<div class="reportButton clearfix">
+		  						<!-- if {{receiptDetail' value.button}}==4 -->
+		  						<a href="/approvalChe/{{receiptList' value.rid}}" class="buttonBack" data-placement="top" data-toggle="ctooltip" data-original-title="上报人修改后由你继续审批">撤回</a>
+	  							<a href="javascript:void(0)" onClick="updateApprovalReceipt(3,{{receiptList' value.rid}})" class="buttonUndone" data-placement="top" data-toggle="ctooltip" data-original-title="终止报销单">终止</a>
+	  						
+		  						<!-- endif -->
+		  					</div>
+		  					
 	  					</form>
 	  				</div>
 	  				<!--<div class="seReport">

+ 2 - 4
protected/view/admin/remitEdit.html

@@ -48,10 +48,8 @@
 	  						<tr><th class="taR">合计</th><td class="colGreen taR" id="agencyResult">¥{{cSum.agencySum}}</td></tr>
 	  						
 	  						<tr class="warning"><td class="taR"><b>本次报销费用合计</b></td><td class="colGreed taR"><b style="font-size:24px" id="RS">¥{{sum}}</b></td></tr>
-	  						
+	  						<!-- if {{receiptDetail.status}}!=4 -->
 	  						<tr><th colspan="2" class="taC">对公汇款审批</th></tr>
-	  						
-	  						
 	  						<tr>
 								<th>选择审批组</th>
 								<td class="taR">
@@ -66,7 +64,7 @@
 								</select>
 								</td>
 							</tr>
-	  						
+	  						<!-- endif -->
 	  						
 	  						
 	  						

+ 2 - 0
protected/view/admin/saeaLoanEdi.html

@@ -36,6 +36,7 @@
 	  						<!-- endloop -->
 	  						
 							<tr class="warning"><td class="taR"><b>本次借款费用合计</b></td><td class="colGreed taR"><b id="agencyResult" style="font-size:24px">¥0.00</b></td></tr>
+							<!-- if {{receiptInfo.status}}!=4 -->
 							<tr><th colspan="2" class="taC">借款审批</th></tr>
 							<tr>
 								<th>选择审批组</th>
@@ -51,6 +52,7 @@
 								</select>
 								</td>
 							</tr>
+							<!-- endif -->
 							<tr><th colspan="2" class="taC">产生费用所在办事处</th></tr>
 							<tr>
 								<th>选择办事处</th>

+ 3 - 5
protected/view/admin/saea_edit.html

@@ -81,21 +81,19 @@
 	  						<tr><th class="taR">合计</th><td class="colGreen taR" id="otherResult">¥{{cSum.otherSum}}</td></tr>
 	  						
 	  						<tr class="warning"><td class="taR"><b>本次报销费用合计</b></td><td class="colGreed taR"><b style="font-size:24px" id="RS">¥{{sum}}</b></td></tr>
+	  						<!-- if {{receiptDetail.status}}!=4 -->
 	  						<tr>
 								<th>选择审批组</th>
 								<td class="taR">
 								<select name="verify">
 								<!-- loop veList -->
 								<option <!-- if {{receiptDetail.verify}}=={{veList' value.vid}} --> selected <!-- endif --> value="{{veList' value.vid}}" >{{veList' value.description}}(
-								{{veList' value.staff}}
-								
-								
-								)</option>
+								{{veList' value.staff}})</option>
 								<!-- endloop -->
 								</select>
 								</td>
 							</tr>
-	  						
+	  						<!-- endif -->
 	  						<tr><th colspan="2" class="taC">产生费用所在办事处</th></tr>
 							<tr>
 								<th>选择办事处</th>

+ 2 - 2
protected/view/contacts_client.html

@@ -1,6 +1,6 @@
 <!-- include 'header' -->
-<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
-<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
+<link rel="stylesheet" href="<?= WEB_SITE_GLOBAL ?>/js/jquery-ui.css" />
+<script src="<?= WEB_SITE_GLOBAL ?>/js/jquery-ui.js"></script>
 <script src="<?= WEB_SITE_GLOBAL ?>/js/jquery.ui.core.js"></script>
 <script src="<?= WEB_SITE_GLOBAL ?>/js/jquery.ui.widget.js"></script>
 <script src="<?= WEB_SITE_GLOBAL ?>/js/jquery.ui.position.js"></script>

+ 2 - 2
protected/view/lock_look.html

@@ -1,6 +1,6 @@
 <!-- include 'header' -->
-<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
-<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
+<link rel="stylesheet" href="<?= WEB_SITE_GLOBAL ?>/js/jquery-ui.css" />
+<script src="<?= WEB_SITE_GLOBAL ?>/js/jquery-ui.js"></script>
 
 <script src="<?= WEB_SITE_GLOBAL ?>/js/jquery.ui.core.js"></script>
 <script src="<?= WEB_SITE_GLOBAL ?>/js/jquery.ui.widget.js"></script>