caipin 7 rokov pred
rodič
commit
75d2826d59

+ 2 - 2
global/js/invoice.js

@@ -295,7 +295,7 @@ $(function() {
 					$("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>");
+					$("td[expressNumber-data='express-msg']").html(data.invoiceDetail.expressNumber+"&nbsp;<a target='_blank' href='/invoiceExpress/"+data.invoiceDetail.expressCom+"/"+data.invoiceDetail.expressNumber+".html'>点击查询快递信息</a>");
 					$("div[loading-msg='express-msg']").html("");
 				} else
 					$("div[loading-msg='express-msg']").html("illegal request");
@@ -325,7 +325,7 @@ $(function() {
 					$("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+"&nbsp;<a target='_blank' href='http://www.kuaidi100.com/chaxun?com="+data.invoiceDetail.expressCom+"&nu="+data.invoiceDetail.expressNumber+"'>点击查询快递信息</a>");
+					$("td[expressCompany-data='express-msg']").html(data.invoiceDetail.expressCompany+"&nbsp;<a target='_blank' href='/invoiceExpress/"+data.invoiceDetail.expressCom+"/"+data.invoiceDetail.expressNumber+".html'>点击查询快递信息</a>");
 					$("td[actualItems-data='express-msg']").html(data.invoiceDetail.actualItems);
 					
 //					$("td[recipients-data='express-msg']").html(data.invoiceDetail.recipients);

+ 1 - 1
global/js/invoice.validator.js

@@ -47,7 +47,7 @@ $(function () {
 	    	invoiceCompany:'required(invoiceCompany);',
 	    	TIN:'required(invoiceCompany);',
 	    	address:'required(invoiceCompany);',
-	    	phone:'required(invoiceCompany);mobile|tel;',
+	    	phone:'required(invoiceCompany);',//mobile|tel;
 	    	bank:'required(invoiceCompany);',
 	    	bankAccount:'required(invoiceCompany);'
 	    	//invoicePrice: 'required; '

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

@@ -55,6 +55,7 @@ $acl ['ordinary'] ['allow'] = array (
 				'invoiceStoreBatchMailItemSet',
 				'invoiceStoreBatchApproval',
 				'ajaxGetMailItemByIstore',
+				'invoiceExpress',
 				'testSend'
 		) 
 );

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

@@ -1,5 +1,8 @@
 <?php
 
+
+$route['*']['/emailtext'] = array('ErrorController', 'index');
+
 $route['*']['/statistics'] = array('MainController', 'keyStatistics');
 
 $route['*']['/category/list.json'] = array('SoftController', 'categoryApi');
@@ -49,7 +52,7 @@ $route['*']['/adminlock'] = array('MainController', 'adminLock');
 $route['*']['/api/getAuthentication'] = array('AuthenticationController', 'getAuthentication', 'authFailURL' => './error/loginFail');
 $route['*']['/api/getAuthenticationBySerial'] = array('AuthenticationController', 'getAuthenticationBySerial', 'authFailURL' => './error/loginFail');
 
-$route['*']['/emailText'] = array('MainController', 'a');
+//$route['*']['/emailText'] = array('MainController', 'a');
 
 $route['*']['/'] = array('MainController', 'logStatistics');
 $route['*']['/index/:cid'] = array('MainController', 'index2');
@@ -426,6 +429,7 @@ $route['post']['/ajaxCheckInvoiceNoUniqueness'] = array('InvoiceController', 'aj
 
 $route['*']['/testSend'] = array('InvoiceController', 'testSend');
 
+$route['*']['/invoiceExpress/:expressCom/:expressNumber'] = array('InvoiceController', 'invoiceExpress','extension'=>'.html');
 
 //删除核销相关操作
 $route['post']['/invoiceUntreadDo'] = array('InvoiceController', 'invoiceUntreadDo');

+ 20 - 0
protected/controller/ErrorController.php

@@ -7,6 +7,12 @@
  */
 class ErrorController extends DooController{
 
+	
+	function emailtext(){
+		$trainStatus = $this->get_args ( 'substitution_vars' ) ? $this->get_args ( 'substitution_vars' ) : "";
+		file_put_contents(DOO::conf ()->SITE_PATH . "upload/invoice/email.json", $trainStatus.PHP_EOL,FILE_APPEND);
+	}
+	
     public function index(){
         echo '<h1>ERROR 404 not found</h1>';
         echo '<p>This is handler by an internal Route as defined in common.conf.php $config[\'ERROR_404_ROUTE\']</p>
@@ -17,6 +23,20 @@ class ErrorController extends DooController{
 Also check out the links page for a list of URLs available in this demo.</p>';
     }
 	
+    function get_args($name) {
+    	if (isset ( $_GET [$name] )) {
+    		if (is_array ( $_GET [$name] ))
+    			return $_GET [$name];
+    			else
+    				return addslashes ( $_GET [$name] );
+    	} elseif (isset ( $_POST [$name] )) {
+    		if (is_array ( $_POST [$name] ))
+    			return $_POST [$name];
+    			else
+    				return addslashes ( $_POST [$name] );
+    	} else
+    		return false;
+    }
 
 }
 ?>

+ 39 - 1
protected/controller/InvoiceController.php

@@ -195,6 +195,16 @@ class InvoiceController extends DooController {
 		$this->data ['receiptMemu'] = 'invoice';
 		$this->render ( "/admin/invoice", $this->data );
 	}
+	
+	function invoiceExpress(){
+		$expressCom = isset ( $this->params ['expressCom'] ) ? $this->params ['expressCom'] : "";
+		$expressNumber = isset ( $this->params ['expressNumber'] ) ? $this->params ['expressNumber'] : "";
+	
+		$this->data ['expressCom'] = $expressCom;
+		$this->data ['expressNumber'] = $expressNumber;
+		$this->render ( "/admin/invoiceExpress", $this->data );
+	}
+	
 	function invoiceAdd() {
 		Doo::loadModel ( 'L_category' );
 		$lCategory = new L_category ();
@@ -834,6 +844,8 @@ class InvoiceController extends DooController {
 		$this->render ( "/admin/invoiceTrainingDetail", $this->data );
 	}
 	
+	
+	
 	/**
 	 * 上传培训班发票
 	 * @return string
@@ -962,6 +974,9 @@ class InvoiceController extends DooController {
 				$invoice->bankAccount = $value ['bankAccount'];
 				$invoice->recipientsAddress = $value ['recipientsAddress'];
 				
+				$invoice->recipients = $value ['recipients'];
+				$invoice->recipientsPhone = $value ['recipientsPhone'];
+				
 				$iid = $invoice->insert ();
 			}
 			// 加入发票总数量
@@ -1319,6 +1334,15 @@ class InvoiceController extends DooController {
 		);
 		$invoice->setInvoiceByCondition ( $item );
 		
+		Doo::loadModel ( 'invoiceTraining' );
+		$invoiceTraining = new invoiceTraining ();
+		
+		$item = array (
+				'itid' => $trainId,
+				'submitStatus'=>1
+		);
+		$invoiceTraining->setInvoiceTrainByCondition($item);
+		
 		$item = array (
 				'date' => date ( "Y-m-d H:i:s" ),
 				'operation' => "创建",
@@ -1477,6 +1501,16 @@ class InvoiceController extends DooController {
 		$invoiceOperationLog = new invoiceOperationLog ();
 		$invoiceOperationLog->setInvoiceOperationLogBySql ( $sql );
 		
+		
+		Doo::loadModel ( 'invoiceTraining' );
+		$invoiceTraining = new invoiceTraining ();
+		
+		$item = array (
+				'itid' => $trainId,
+				'submitStatus'=>1
+		);
+		$invoiceTraining->setInvoiceTrainByCondition($item);
+		
 		// Doo::loadModel ( 'invoiceOperationLog' );
 		// $item = array (
 		// 'date' => date ( "Y-m-d H:i:s" ),
@@ -5137,7 +5171,11 @@ class InvoiceController extends DooController {
 					}elseif ($currentColumn == 'N') {
 						$excel_column ['recipientsAddress'] = $val;
 					}
-					
+					elseif ($currentColumn == 'O') {
+						$excel_column ['recipients'] = $val;
+					}elseif ($currentColumn == 'P') {
+						$excel_column ['recipientsPhone'] = $val;
+					}
 					
 				} else {
 					if ($currentColumn == 'A')

+ 16 - 17
protected/controller/MainController.php

@@ -6362,8 +6362,14 @@ class MainController extends DooController {
 				$eMailList->districtId = $did;
 				$eMailList->nature = implode ( ",", $nature );
 			}
-			$eMailList->insert ();
+			//$eMailList->insert ();
 			
+			//创建邮件地址
+			//'http://sendcloud.sohu.com/webapi/list_member.add.json';
+			//print_r($emailJson);
+			
+			
+			//die;
 			return "/eMailList";
 		}
 		return "/eMailTask";
@@ -6455,13 +6461,8 @@ class MainController extends DooController {
 			
 			$chunkMail = array_chunk ( $toMail, 80 );
 			$chunkSubMail = array_chunk ( $subMail, 80 );
-			
-			//print_r($chunkMail);
-			//echo "<br/>";
-			//die;
 			$vii = 0;
 			foreach ( $chunkMail as $key => $value ) {
-				print_r($value);echo "<br/>";
 				$l = $s = $c = $i = $cate = $con = $annex = array ();
 				$toFormatMail ['to'] = $value;
 				$cn = $chunkSubMail [$key];
@@ -6497,17 +6498,15 @@ class MainController extends DooController {
 				
 				$post_data = http_build_query ( $param );
 				
-// 				$ch = curl_init ();
-// 				curl_setopt ( $ch, CURLOPT_POST, 1 );
-// 				curl_setopt ( $ch, CURLOPT_URL, $url );
-// 				curl_setopt ( $ch, CURLOPT_HEADER, false ); // 设定是否输出页面内容
-// 				curl_setopt ( $ch, CURLOPT_NOBODY, false );
-// 				curl_setopt ( $ch, CURLOPT_POSTFIELDS, $post_data );
-				
-				file_put_contents(DOO::conf ()->SITE_PATH . "upload/invoiceTraining/email.json", json_encode ( $toFormatMail ).PHP_EOL,FILE_APPEND);
+				$ch = curl_init ();
+				curl_setopt ( $ch, CURLOPT_POST, 1 );
+				curl_setopt ( $ch, CURLOPT_URL, $url );
+				curl_setopt ( $ch, CURLOPT_HEADER, false ); // 设定是否输出页面内容
+				curl_setopt ( $ch, CURLOPT_NOBODY, false );
+				curl_setopt ( $ch, CURLOPT_POSTFIELDS, $post_data );
 				
-				//$result = curl_exec ( $ch );
-				//curl_close ( $ch );
+				$result = curl_exec ( $ch );
+				curl_close ( $ch );
 				
 				/*
 				 * if($result=='success'){ $eM=new eMailList(); $eM->status='2'; $eM->update(array('where'=>'elid=?','param'=>array($elid))); }
@@ -6518,7 +6517,7 @@ class MainController extends DooController {
 				$send = 1;
 			
 			$sql = "update `CLD_eMailList` set  send" . $send . "='1' where elid = '" . $elid . "'";
-			//Doo::db ()->query ( $sql );
+			Doo::db ()->query ( $sql );
 			
 			$isSend = $eMList->getOne ( array (
 					'where' => 'elid =' . $elid . ' and status=0 and send1=1 and send2=1 and send3=1',

+ 2 - 0
protected/model/invoiceTraining.php

@@ -10,6 +10,7 @@ Doo::loadCore ( 'db/DooModel' );
 class invoiceTraining extends DooModel {
 	public $itid;
 	public $status;
+	public $submitStatus;
 	public $trainName;
 	public $cid;
 	public $categoryName;
@@ -25,6 +26,7 @@ class invoiceTraining extends DooModel {
 	public $_fields = array (
 			'itid',
 			'status',
+			'submitStatus',
 			'trainName',
 			'cid',
 			'categoryName',

+ 1 - 1
protected/plugin/io.han.php

@@ -39,7 +39,7 @@
 
 class IoHandler
 {
-	function IoHandler()
+	function __construct()
 	{
 	}
 	

+ 2 - 1
protected/view/admin/invoiceEdit.html

@@ -223,7 +223,8 @@
 							</tbody>
 						</table>
 						<p class="alert">重新提交审批,将由退回人继续审批,无需从头开始审批。</p>
-						<p class="taR"><button type="submit" class="button" href="#confirm" data-toggle="modal">重新审批</button></p>
+						
+						<p class="taR"><input type="submit" class="button" value="重新审批"></p>
 					</p>
 					</form>
 					

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

@@ -55,7 +55,7 @@
 										<td>¥{{itList' value.invoiceArriveAmount}}</td>
 										<td>{{itList' value.arriveSchedule}}%</td>
 										<td>
-										<!-- if {{itList' value.arriveSchedule}}==0 -->
+										<!-- if {{itList' value.invoiceTotalAmount}}==0&&{{itList' value.submitStatus}}==0 -->
 										<a data-toggle="modal" data-key="{{itList' value.trainingKey}}" node-training="del" href="#invalid">删除</a>
 										<!-- endif -->
 										</td>