caipin 5 년 전
부모
커밋
e670d9f9ae

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

@@ -143,6 +143,10 @@ $route['*']['/saeaLoanEdiDo'] = array('ReceiptController', 'saeaLoanEdiDo');
 $route['*']['/confirmation/:rid'] = array('ReceiptController', 'confirmation');
 $route['*']['/approvalExpenses'] = array('ReceiptController', 'approvalExpenses');
 $route['*']['/approvalExpenses/:status'] = array('ReceiptController', 'approvalExpenses');
+//费用报销单-分细小类
+$route['*']['/receiptFeeDiversion'] = array('ReceiptController', 'receiptFeeDiversion');
+
+
 //审批请求
 $route['*']['/expensesEdi/:rid'] = array('ReceiptController', 'expensesEdi');
 $route['*']['/expensesDefray'] = array('ReceiptController', 'expensesDefray');

+ 7 - 4
protected/controller/InvoiceController.php

@@ -5560,7 +5560,7 @@ class InvoiceController extends DooController {
 		if ($timeType == 'CREATE')
 			$descField = 'a.date';
 		
-		$con = '1';
+		$con = '';
 		if (! empty ( $D1 ) && ! empty ( $D2 ))
 			$con .= ' and ' . $descField . ' BETWEEN "' . $D1 . '" AND "' . $D2 . '" ';
 		elseif (! empty ( $D1 ) && empty ( $D2 ))
@@ -5586,9 +5586,12 @@ class InvoiceController extends DooController {
 				'previous' => '' 
 		);
 		
-		$sql = 'select a.iid 
-				from CLD_invoiceReceivables as a 
-				where ' . $con . ' group by a.irid  ';
+		if(!empty($con)){
+			$con=' where '.$con;
+		}
+		
+		$sql = 'select a.iid from CLD_invoiceReceivables as a
+				' . $con . ' group by a.irid  ';
 		
 		
 		

+ 14 - 0
protected/controller/ReceiptController.php

@@ -254,6 +254,20 @@ class ReceiptController extends DooController {
 	}
 	
 	/**
+	 * 费用报销单-导流入哪个细分类
+	 */
+	function receiptFeeDiversion(){
+		$feeType= $this->get_args ( 'feeType' ) ? $this->get_args ( 'feeType' ) : "";
+		if($feeType==2){
+			return '/receipt/feeTravel';
+		}elseif($feeType==3){
+			return '/receipt/feeAgency';
+		}else{
+			return '/receipt/feeInternalTrain';
+		}
+	}
+	
+	/**
 	 * 添加费用报销单页面
 	 */
 	function saeaCreate() {

+ 14 - 5
protected/model/invoiceReceivables.php

@@ -526,16 +526,25 @@ class invoiceReceivables extends DooModel {
 	function getInvoiceReceivablesByConditionPage($limit = 0, $con = "", $desc = 'desc', $descField = 'irid') {
 		if (empty ( $limit ))
 			return array ();
+			
+// 		$sql = 'select group_concat(b.invoiceSerial) as invoiceSerial ,group_concat(b.iid) as invoiceId ,a.*,b.invoicePrice
+// 				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 ' . $con . ' group by a.irid ORDER BY  ' . $descField . ' ' . $desc . ' limit ' . $limit . '
+// 				';
+		
+		if(!empty($con)){
+			$con=' where '.$con;
+		}
+		
+		$sql='select * from '.$this->_table.' as a '.$con.' ORDER BY '.$descField.' '.$desc.' limit '.$limit;
 		
-		$sql = 'select group_concat(b.invoiceSerial) as invoiceSerial ,group_concat(b.iid) as invoiceId ,a.*,b.invoicePrice
-				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 ' . $con . ' group by a.irid ORDER BY  ' . $descField . ' ' . $desc . ' limit ' . $limit . '
-				';
 		
 		$query = Doo::db ()->query ( $sql );
 		$list = $query->fetchAll ();
 		
+		print_r($list);
+		
 		Doo::loadClass ( 'XDeode' );
 		$XDeode = new XDeode ( 5 );
 		Doo::loadModel ( 'invoiceROLog' );

+ 9 - 0
protected/model/receipt.php

@@ -83,6 +83,15 @@ class receipt extends DooModel {
 			'statusTrain'
 	);
 
+	
+	
+	/*
+	 $this->query($sql, array_merge( $opt['param'], $where_values));
+	 
+	 */
+	
+	
+	
     /**
      * 获得培训班结算未收款
      */

+ 6 - 2
protected/view/receipt/receiptFee.html

@@ -263,11 +263,12 @@
     <div class="modal hide fade" id="receipt-add">
         <div class="modal-dialog">
             <div class="modal-content">
+            <form action="/receiptFeeDiversion" name="receiptFeeAdd" id="receiptFeeAdd" method="post">
                 <div class="modal-header">
                     <h3>选择申请类型</h3>
                 </div>
                 <div class="modal-body saeaList">
-                	<form action="/receiptFeeAdd" name="receiptFeeAdd" id="receiptFeeAdd" method="post">
+                	
                 	<div style="margin-bottom: 20px">
 						<label class="radio inline"><input type="radio" checked value="1" name="feeType">办事处相关费用</label>
 						<label class="radio inline"><input type="radio" value="2" name="feeType">差旅相关费用</label>
@@ -331,12 +332,15 @@
 							</tr>
 						</table>
 					</div>
-					</form>
+					
                 </div>
                 <div class="modal-footer">
                 	<a href="saea-receipt-add1.html" class="button" target="_blank">确认</a>
                     <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
                 </div>
+                
+                
+                </form>
             </div>
         </div>
     </div>