Kaynağa Gözat

行程单1 ok

caipin 5 yıl önce
ebeveyn
işleme
cb06f272f5

+ 3 - 2
protected/config/js.edition.conf.php

@@ -4,8 +4,9 @@ define ( "index", WEB_SITE_GLOBAL.'js/index.js?1.09' );
 define ( "receiptExtend", WEB_SITE_GLOBAL.'js/receiptExtend.js?1.03' );
 
 define ( "receipt", WEB_SITE_GLOBAL.'js/receipt.js?1.10' );
-define ( "itinerary", WEB_SITE_GLOBAL.'js/itinerary.js?1.13' );
-define ( "itineraryView", WEB_SITE_GLOBAL.'js/itineraryView.js?1.11' );
+define ( "itinerary", WEB_SITE_GLOBAL.'js/itinerary.js?1.23' );
+define ( "itinerary2", WEB_SITE_GLOBAL.'js/itinerary2.0.js?1.00' );
+define ( "itineraryView", WEB_SITE_GLOBAL.'js/itineraryView.js?1.12' );
 
 define ( "invoice", WEB_SITE_GLOBAL.'js/invoice.js?1.02' );
 define ( "payments", WEB_SITE_GLOBAL.'js/payments.js?1.03' );

+ 38 - 3
protected/controller/InvoiceController.php

@@ -193,6 +193,7 @@ class InvoiceController extends DooController {
 		// $hfreult = $this->msgSendToparty ( $msg, '', '', $toparty,'text' );
 	}
 	function invoice() {
+		
 		Doo::loadModel ( 'invoice' );
 		$invoice = new invoice ();
 		Doo::loadModel ( 'express' );
@@ -3481,17 +3482,51 @@ class InvoiceController extends DooController {
 				$invoiceReceivables = new invoiceReceivables ();
 				
 				$irDetails = $invoiceReceivables->getOne ( array (
-						'where' => " irid=" . $value . ' and bindStatus=1',
+						'where' => " irid=" . $value . ' ',
 						'asArray' => TRUE 
 				) );
+				
+				$bindPrice=$irDetails['bindPrice']-$invoiceDetails['invoicePrice'];
+				if($bindPrice<0){
+					$bindPrice=0;
+				}
+				
+				
+				
+				$iidExtend = explode ( ',', $irDetails ['iidExtend'] );
 				$item = array (
 						'irid' => $value,
 						'bindStatus' => 0,
 						'untreadStatus' => 1,
+						'bindPrice'=>$bindPrice,
 						'untreadStaff' => $invoiceDetails ['userName'],
 						'unbundlingTime' => date ( "Y-m-d H:i:s" ),
-						'iid' => 0 
 				);
+				
+				if($irDetails['iid']==$iid){
+					$item+=array(
+							'iid' => 0
+					);
+				}else{
+					foreach ($iidExtend as $iek=>$iev){
+						if($iev==$iid){
+							unset($iidExtend[$iek]);
+							break;
+						}
+					}
+					if(empty($iidExtend)){
+						$item+=array(
+								'iidExtend' => ''
+						);
+					}else{
+						$iidExtend=implode(",", $iidExtend);
+						$item+=array(
+								'iidExtend' => $iidExtend
+						);
+					}
+					
+				}
+				
 				$invoiceReceivables->setInvoiceReceivablesByCondition ( $item );
 				
 				if (! empty ( $irDetails )) {
@@ -4847,7 +4882,7 @@ class InvoiceController extends DooController {
 		
 //  		echo $detailM ['irid'].'/'.$sumBalance.'/'.$detail ['invoicePrice'];
 //  		die;
-		
+		$invoice = new invoice ();
 		$item = array (
 				'iid' => $detail ['iid'],
 				'irid' => $iridString

+ 3 - 3
protected/controller/MobileController.php

@@ -213,10 +213,10 @@ class MobileController extends DooController {
 		) );
 		
 		if ($did == 0) {
-			if ($staffDetail ['isadmin'])
+			//if ($staffDetail ['isadmin'])
 				$districtList = $district->get_lvByid ( 0, $did );
-			else
-				$districtList = $district->get_lvByStaffid ( 1, $sid );
+			//else
+			//	$districtList = $district->get_lvByStaffid ( 1, $sid );
 		} else {
 			
 			$districtList = $district->get_lvByid ( 0, $did );

+ 2 - 4
protected/controller/ReceiptController.php

@@ -494,10 +494,6 @@ class ReceiptController extends DooController {
 				}
 			}
 			
-			echo $itinerary;
-			
-			die;
-			
 			Doo::loadModel ( 'receipt' );
 			Doo::loadModel ( 'receiptDetail' );
 			Doo::loadModel ( 'accountItem' );
@@ -621,6 +617,7 @@ class ReceiptController extends DooController {
 			$receipt->explanation = $explanation;
 				
 			$receipt->receiptClass = $receiptClass;
+			
 			$receipt->itinerary=$itinerary;
 			
 			$receipt->remittanceName = $remittanceName;
@@ -730,6 +727,7 @@ class ReceiptController extends DooController {
 		$itinerary = $_POST['itinerary']  ? $_POST['itinerary'] : "";
 		
 		$itineraryList=json_decode($itinerary,true);
+		
 		foreach ($itineraryList as $key=>$value){
 			if(empty($value['departuredate'])||empty($value['departurecity'])){
 				header ( 'Content-Type:text/html;charset=utf-8' );

+ 5 - 1
protected/model/invoice.php

@@ -1052,7 +1052,11 @@ class invoice extends DooModel {
 					$list [$key] ['lossDetail'] = $detail;
 				}
 				
-				$lossDate= date('m',strtotime ( $list [$key] ['OperationLog'] ['date'] ));
+				$lossDate=0;
+				if(isset($list [$key] ['OperationLog'])){
+					$lossDate= date('m',strtotime ( $list [$key] ['OperationLog'] ['date'] ));
+				}
+				
 				$printMonth=date('m',strtotime ( $value['printTime']));
 				$list [$key] ['lossShow'] = false;
 				if($printMonth<$lossDate){

+ 2 - 1
protected/model/invoiceReceivables.php

@@ -188,7 +188,7 @@ class invoiceReceivables extends DooModel {
 		$sql = 'select group_concat(b.invoiceSerial) as invoiceSerial ,group_concat(b.iid) as invoiceId ,a.*
 				from ' . $this->_table . ' as a left join CLD_invoice as b on
 				find_in_set(b.iid,a.iidExtend) or a.iid=b.iid 
-				where a.bindStatus=0 and a.iid!=0 GROUP BY a.irid
+				where a.bindStatus=0 and (a.iid!=0 or a.iidExtend!="") GROUP BY a.irid
 				';
 		$query = Doo::db ()->query ( $sql );
 		$list = $query->fetchAll ();
@@ -576,6 +576,7 @@ class invoiceReceivables extends DooModel {
 			$invoiceList = $query->fetchAll ();
 		}
 // 		echo $sql;
+
 		Doo::loadClass ( 'XDeode' );
 		$XDeode = new XDeode ( 5 );
 		Doo::loadModel ( 'invoiceROLog' );

+ 3 - 3
protected/view/receipt/expensesDocPrint.html

@@ -220,7 +220,7 @@
 		  							<div class="avtra"><img src="{{receiptDetail' value' value.img}}_2.jpg" width="32"></div>
 		  							<div class="comment">
 		  								<p <!-- if {{receiptDetail' value' value.status}}!=2 --> class="colGray" <!-- endif --> ><span class="fR">{{receiptDetail' value' value.date}}</span>{{receiptDetail' value' value.username}} <!-- if {{receiptDetail' value' value.rolename}}!='' --> ({{receiptDetail' value' value.rolename}}) <!-- endif --></p>
-		  								<p>同意支付</p>
+		  								<p>提交审批</p>
 		  							</div>
 		  						</li>
 		  						<!-- endloop -->
@@ -369,7 +369,7 @@
 		  							<div class="avtra"><img src="{{receiptDetail' value' value.img}}_2.jpg" width="32"></div>
 		  							<div class="comment">
 		  								<p <!-- if {{receiptDetail' value' value.status}}!=2 --> class="colGray" <!-- endif --> ><span class="fR">{{receiptDetail' value' value.date}}</span>{{receiptDetail' value' value.username}} <!-- if {{receiptDetail' value' value.rolename}}!='' --> ({{receiptDetail' value' value.rolename}}) <!-- endif --></p>
-		  								<p>同意支付</p>
+		  								<p>{{receiptDetail' value' value.opinion}}</p>
 		  							</div>
 		  						</li>
 		  						<!-- endloop -->
@@ -546,7 +546,7 @@
 		  							<div class="avtra"><img src="{{receiptDetail' value' value.img}}_2.jpg" width="32"></div>
 		  							<div class="comment">
 		  								<p <!-- if {{receiptDetail' value' value.status}}!=2 --> class="colGray" <!-- endif --> ><span class="fR">{{receiptDetail' value' value.date}}</span>{{receiptDetail' value' value.username}} <!-- if {{receiptDetail' value' value.rolename}}!='' --> ({{receiptDetail' value' value.rolename}}) <!-- endif --></p>
-		  								<p>同意支付</p>
+		  								<p>{{receiptDetail' value' value.opinion}}</p>
 		  							</div>
 		  						</li>
 		  						<!-- endloop -->

+ 17 - 1
protected/view/receipt/feeTravel.html

@@ -35,6 +35,7 @@
 							<div class="seTable">
 								<input type="hidden" id="agencyR" value="0" /> <input
 									type="hidden" id="otherR" value="0" />
+									<input type="hidden" id="">
 								<form action="/addFeeTravel" name="recepitAdd" method="post">
 
 									<input type="hidden" name="iid" id="iid" value="" />
@@ -43,7 +44,7 @@
 									<table class="table table-bordered table-condensed table-hover">
 
 										<tr>
-											<th colspan="2" class="taC">行程详细</th>
+											<th colspan="2" class="taC">行程1#详细</th>
 										</tr>
 										<tbody itinerary >
 											
@@ -60,6 +61,20 @@
 										</tr>
 
 
+									<strokeNode>
+									</strokeNode>
+
+									<tbody strokeNode >
+									</tbody>
+									
+
+
+									<tr>
+									<th colspan="2" class="taC">
+									<a href="#" stroke="addNode" class="button" data-toggle="modal">添加新行程</a>
+									</th>
+									</tr>
+
 
 										<tr>
 											<th colspan="2" class="taC">差旅相关费用</th>
@@ -314,6 +329,7 @@
 		</script>
 		
 		<script src="<?= itinerary ?>"></script>
+		<script src="<?= itinerary2 ?>"></script>
 		<script>
 		
 			

+ 1 - 0
protected/view/receipt/feeTravelEdi.html

@@ -276,6 +276,7 @@
 		<script type="text/javascript">
 			autoFlashHeight();
 			var sessionStorageList='itineraryListEdi';
+			
 			sessionStorage.setItem("itineraryListEdi",'{{receiptDetail.itinerary}}');
 		</script>