소스 검색

更新流水完成

caipin 5 년 전
부모
커밋
012cd15be8

+ 1 - 0
global/js/receipt.js

@@ -547,6 +547,7 @@ $(function() {
 	        'trainStartDate':'required; ',
 	        'trainEndDate':'required; ',
 	        'participants':'required; ',
+	        'freeParticipants':'required; ',
 	        'trainAddress':'required; ',
 	    }
 	});

+ 2 - 2
protected/controller/AuthenticationController.php

@@ -17,8 +17,8 @@ class AuthenticationController extends DooController {
 			$staff=new staff();
 			Doo::loadModel('client');
 			$client=new client();
-			
-			$longleInfo=$longle->getOne(array ('where' => "key_num= '".$key."' and (status=3 or status=4 or status=5)",'asArray' => TRUE));
+			//status=3 or status=4 or status=5
+			$longleInfo=$longle->getOne(array ('where' => "key_num= '".$key."' and (status=3 or status=4 or status=5 or status=9)",'asArray' => TRUE));
 			if (empty($longleInfo)){
 				echo json_encode(array('list'=>array()));die;
 			}

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 26 - 15
protected/controller/InvoiceController.php


+ 1 - 1
protected/controller/InvoiceExtendController.php

@@ -596,7 +596,7 @@ class InvoiceExtendController extends DooController {
             $invoiceOperationLog->setInvoiceOperationLog ( $item );
 
         }
-        //return "/invoiceUntreadED";
+        return "/invoiceUntreadED";
     }
 
 	/**

+ 27 - 20
protected/controller/ReceiptAjaxController.php

@@ -165,10 +165,26 @@ class ReceiptAjaxController extends DooController {
 	
 		$detail = $receipt->getReceiptByRid ( $rid );
 		
-
+		
+		$payment=$this->_getReceiptTrainPayment($detail ['invoiceTrainId'],$detail ['trainLoanRid'],$rid);
+		
+		
+		$detail['payment']=$payment;
+		Doo::loadClass ( 'authcode.func' );
+		$detail['paymentAuthCode']=authcode($payment,'');
+		
+		echo json_encode ( array (
+				'status' => 1,
+				'detail' => $detail
+		) );
+	}
+	
+	function _getReceiptTrainPayment($invoiceTrainId,$trainLoanRid,$rid){
 		// 收入合计
 		Doo::loadModel ( 'invoiceTraining' );
 		$invoiceTraining = new invoiceTraining ();
+		Doo::loadModel ( 'receipt' );
+		$receipt = new receipt ();
 		$invoiceTrainingDetail = array (
 				'invoiceArriveAmount' => '0.00',
 				'RIAmount' => '0.00',
@@ -177,23 +193,22 @@ class ReceiptAjaxController extends DooController {
 				'invoiceArriveAmountM'=>'0.00',
 				'invoiceCompanyAmountM'=>'0.00'
 		);
-		if ($detail ['invoiceTrainId'] != 0) {
-			$invoiceTrainingDetail = $invoiceTraining->getInvoiceTrainingByItid ( $detail ['invoiceTrainId'] );
+		if ($invoiceTrainId != 0) {
+			$invoiceTrainingDetail = $invoiceTraining->getInvoiceTrainingByItid ( $invoiceTrainId );
 		}
-		// print_r($invoiceTrainingDetail);
 		$invoiceArriveAmount = $RIAmount = 0;
 		if (! empty ( $invoiceTrainingDetail )) {
 			$invoiceArriveAmount = $invoiceTrainingDetail ['invoiceArriveAmount'];
 			$RIAmount = $invoiceTrainingDetail ['RIAmount'];
 		}
-		
+			
 		// 备用金
 		$sum = 0;
-		if (! empty ( $receiptDetail ['trainLoanRid'] )) {
-			$receiptLoanDetail = $receipt->getReceiptByRid ( $detail ['trainLoanRid'] );
-			$sum = $receiptLoanDetail ['sum'];
+		if (! empty ( $trainLoanRid )) {
+			$receiptLoanDetailBak = $receipt->getReceiptByRid ( $trainLoanRid );
+			$sum = $receiptLoanDetailBak ['sum'];
 		}
-		
+			
 		// 支出项金额详情
 		// 项目金额合计
 		Doo::loadModel ( 'RItem' );
@@ -203,22 +218,14 @@ class ReceiptAjaxController extends DooController {
 		// 讲师获得
 		Doo::loadModel ( 'RILecturer' );
 		$RILecturer = new RILecturer ();
-		$RItemList = $RItem->getRItemByRid ( $rid );
+		$RItemList = $RItem->getRItemByRid ($rid );
 		$RILecturerList = $RILecturer->getRILecturerByRid ( $rid );
 		// 支出项金额详情
 		$aiData = $accountItem->getTrainingDetail ( $RItemList, $RILecturerList, $invoiceArriveAmount );
 		$categoryActualExpenditure = $aiData ['total'] - $aiData ['categoryActualExpenditure'];
-		
+			
 		$payment = $sum + $RIAmount - $categoryActualExpenditure;
-		
-		$detail['payment']=$payment;
-		Doo::loadClass ( 'authcode.func' );
-		$detail['paymentAuthCode']=authcode($payment,'');
-		
-		echo json_encode ( array (
-				'status' => 1,
-				'detail' => $detail
-		) );
+		return $payment;
 	}
 	
 	/**

+ 9 - 2
protected/controller/ReceiptController.php

@@ -2097,6 +2097,7 @@ class ReceiptController extends DooController {
 		$trainStartDate = $this->get_args ( 'trainStartDate' ) ? $this->get_args ( 'trainStartDate' ) : "";
 		$trainEndDate = $this->get_args ( 'trainEndDate' ) ? $this->get_args ( 'trainEndDate' ) : "";
 		$participants = $this->get_args ( 'participants' ) && is_numeric ( $this->get_args ( 'participants' ) ) ? $this->get_args ( 'participants' ) : 0;
+		$freeParticipants = $this->get_args ( 'freeParticipants' ) && is_numeric ( $this->get_args ( 'freeParticipants' ) ) ? $this->get_args ( 'freeParticipants' ) : 0;
 		$trainAddress = $this->get_args ( 'trainAddress' ) ? $this->get_args ( 'trainAddress' ) : "";
 		$trainRemarks = $this->get_args ( 'trainRemarks' ) ? $this->get_args ( 'trainRemarks' ) : "";
 		// 发票信息
@@ -2141,6 +2142,7 @@ class ReceiptController extends DooController {
 					'trainStartDate' => $trainStartDate,
 					'trainEndDate' => $trainEndDate,
 					'participants' => $participants,
+					'freeParticipants'=>$freeParticipants,
 					'trainAddress' => $trainAddress,
 					'trainRemarks' => $trainRemarks,
 					'creator' => $this->staff [0] ['sid'],
@@ -2423,6 +2425,7 @@ class ReceiptController extends DooController {
 		$trainStartDate = $this->get_args ( 'trainStartDate' ) ? $this->get_args ( 'trainStartDate' ) : "";
 		$trainEndDate = $this->get_args ( 'trainEndDate' ) ? $this->get_args ( 'trainEndDate' ) : "";
 		$participants = $this->get_args ( 'participants' ) && is_numeric ( $this->get_args ( 'participants' ) ) ? $this->get_args ( 'participants' ) : 0;
+		$freeParticipants = $this->get_args ( 'freeParticipants' ) && is_numeric ( $this->get_args ( 'freeParticipants' ) ) ? $this->get_args ( 'freeParticipants' ) : 0;
 		$trainAddress = $this->get_args ( 'trainAddress' ) ? $this->get_args ( 'trainAddress' ) : "";
 		$trainRemarks = $this->get_args ( 'trainRemarks' ) ? $this->get_args ( 'trainRemarks' ) : "";
 		// 发票信息
@@ -2463,6 +2466,7 @@ class ReceiptController extends DooController {
 					'trainStartDate' => $trainStartDate,
 					'trainEndDate' => $trainEndDate,
 					'participants' => $participants,
+					'freeParticipants'=>$freeParticipants,
 					'trainAddress' => $trainAddress,
 					'trainRemarks' => $trainRemarks 
 			);
@@ -6778,10 +6782,12 @@ class ReceiptController extends DooController {
 		if ($cidKey != 'ALL')
 			$cidString = " and cid=" . $cid;
 		
+			//汇款信息需要提取出来
 		if(!empty($receiptOrder)){
 				$receiptList = $receipt->find ( array (
 					'where' => $statusCon.' and receiptOrder like "%' . $receiptOrder . '%"',
 					'desc' => 'rid',
+					
 					'asArray' => true
 			) );
 			
@@ -6795,6 +6801,7 @@ class ReceiptController extends DooController {
 			$receiptList = $receipt->find ( array (
 					'where' => $statusCon . $condition . $dateCondition . $sopString . $cidString,
 					'desc' => 'rid',
+					
 					'asArray' => true
 			) );
 			
@@ -16418,8 +16425,8 @@ class ReceiptController extends DooController {
 			
 		// 备用金
 		$sum = 0;
-		if (! empty ( $value ['trainLoanRid'] )) {
-			$receiptLoanDetailBak = $receipt->getReceiptByRid ( trainLoanRid );
+		if (! empty ( $trainLoanRid )) {
+			$receiptLoanDetailBak = $receipt->getReceiptByRid ( $trainLoanRid );
 			$sum = $receiptLoanDetailBak ['sum'];
 		}
 			

+ 2 - 2
protected/controller/ReceiptExtendController.php

@@ -2237,8 +2237,8 @@ class ReceiptExtendController extends DooController {
 			
 		// 备用金
 		$sum = 0;
-		if (! empty ( $value ['trainLoanRid'] )) {
-			$receiptLoanDetailBak = $receipt->getReceiptByRid ( trainLoanRid );
+		if (! empty ( $trainLoanRid )) {
+			$receiptLoanDetailBak = $receipt->getReceiptByRid ( $trainLoanRid );
 			$sum = $receiptLoanDetailBak ['sum'];
 		}
 			

+ 5 - 1
protected/model/receiptTraining.php

@@ -16,6 +16,7 @@ class receiptTraining extends DooModel {
 	public $trainStartDate;
 	public $trainEndDate;
 	public $participants;
+	public $freeParticipants;
 	public $trainAddress;
 	public $trainRemarks;
 	public $creator;
@@ -33,6 +34,7 @@ class receiptTraining extends DooModel {
 			'trainStartDate',
 			'trainEndDate',
 			'participants',
+			'freeParticipants',
 			'trainAddress',
 			'trainRemarks',
 			'creator',
@@ -247,8 +249,10 @@ class receiptTraining extends DooModel {
 			) );
 		}
 		$detail ['rtidKey'] = '';
-		if (! empty ( $detail ))
+		if (! empty ( $detail )){
 			$detail ['rtidKey'] = $XDeode->encode ( $detail ['rtid'] );
+			$detail ['participantsTotal'] = $detail['participants']+$detail['freeParticipants'];
+		}
 		
 		return $detail;
 	}

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

@@ -264,7 +264,8 @@ $("input[autoIFBTIN]").autocomplete({
 				<div class="borad-news">
 					<div class="saeaList">
 						<form action="/invoiceAddDo"  method="post" id="invoice">
-						<input type="hidden" name="token" value="{{token}}">
+							<input type="hidden" name="token" value="{{token}}">
+							<input type="hidden" name="tokenTime" value="{{tokenTime}}">
 						<table class="table table-bordered table-condensed">
 								<tbody>
 								<blockquote><p class=""><a href="/invoiceAdd/AUTOFILL" copy-invoice>加载上一张开票信息</a></p></blockquote>

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

@@ -209,7 +209,8 @@ $("input[autoIFBTIN]").autocomplete({
 				<div class="borad-news">
 					<div class="saeaList">
 						<form action="/invoiceAddDo"  method="post" id="invoice">
-						<input type="hidden" name="token" value="{{token}}">
+							<input type="hidden" name="token" value="{{token}}">
+							<input type="hidden" name="tokenTime" value="{{tokenTime}}">
 						<table class="table table-bordered table-condensed">
 								<tbody>
 								

+ 22 - 7
protected/view/receipt/receiptTrain.html

@@ -89,11 +89,17 @@ $(function() {
 									<td>{{receiptTrainingDetail.trainEndDate}}</td>
 								</tr>
 								<tr>
-									<th class="taC"><span class="colRed" title="必填">*</span>参加人数</th>
+									<th class="taC"><span class="colRed" title="必填">*</span>缴费参加人数</th>
 									<td>{{receiptTrainingDetail.participants}}
 									</td>
+									<th class="taC"><span class="colRed" title="必填">*</span>免费参加人数</th>
+									<td>{{receiptTrainingDetail.freeParticipants}}</td>
+								
+									
+								</tr>
+								<tr>
 									<th class="taC"><span class="colRed" title="必填">*</span>培训班地址</th>
-									<td>{{receiptTrainingDetail.trainAddress}}</td>
+									<td colspan="3">{{receiptTrainingDetail.trainAddress}}</td>
 								</tr>
 								<tr>
 									<th class="taC">备注</th>
@@ -247,7 +253,7 @@ $(function() {
 								<tr>
 									<td colspan="5" class="taC colGray">备用金+办事处收款-办事处实际支出=付总部款</td>
 								</tr>
-								<tr><td colspan="5">学员:{{receiptTrainingDetail.participants}}人&nbsp;&nbsp;&nbsp;讲师:{{lectureCount}} 人</td></tr>
+								<tr><td colspan="5">学员:{{receiptTrainingDetail.participantsTotal}}人(缴费{{receiptTrainingDetail.participants}}&nbsp;免费{{receiptTrainingDetail.freeParticipants}})&nbsp;&nbsp;&nbsp;讲师:{{lectureCount}} 人</td></tr>
 						</tbody></table>
 			  			
 			  			
@@ -316,10 +322,19 @@ $(function() {
 						
 						<!-- if empty({{wbDetail}}) -->
 						<!-- if {{showType}}=='approval'&&inarray({{staff.0.sid}},{{verifyId}}) -->
-						<table class="table table-bordered table-condensed table-hover">
+						<table class="table table-bordered table-condensed table-hover " >
 							<tbody>
-								<tr><th colspan="2" class="taC">确认汇款金额</th></tr>
-								<tr><th>汇款金额(用于生成汇款单)</th>
+								<tr><th colspan="2" class="taC">费用结算</th></tr>
+								<th>结算结果<br><span class="colGray">("支出"由公司汇出,"收入"提交人需汇款至公司。)</span></th>
+								<td class="taR" width="200">
+								<!-- if {{payment}}>=0 -->
+					<span class="colGreen">收入</span>
+					<!-- else -->
+					<span class="colRed">支出</span>
+					<!-- endif -->
+								</td>
+								
+								<tr><th>汇款金额</th>
 								<td class="taR" width="200">
 								¥{{payment}}
 								<!-- 
@@ -406,7 +421,7 @@ $(function() {
 						<table class="table table-bordered table-condensed table-hover">
 									<tbody>
 										<tr><th colspan="2" class="taC">银行水流详情</th></tr>
-										<tr><th>流水类型("支出"由公司汇出,"收入"提交人汇款至公司。)</th>
+										<tr><th>结算结果<br><span class="colGray">("支出"由公司汇出,"收入"提交人需汇款至公司。)</span></th>
 										<td class="taR" width="200">
 										<!-- if {{wbDetail.expensesType}}==1 -->
 										收入

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

@@ -42,11 +42,15 @@
 									<td><input placeholder="必填" name="trainEndDate" id="trainEndDate" type="date"></td>
 								</tr>
 								<tr>
-									<th class="taC"><span class="colRed" title="必填">*</span>参加人数</th>
+									<th class="taC"><span class="colRed" title="必填">*</span>缴费参加人数</th>
 									<td><input name="participants" id="participants" value="1" placeholder="输入数量" pattern="[0-9]" type="number" min="1" step="1" aria-required="true" class="n-valid">
 									</td>
+									<th class="taC"><span class="colRed" title="必填">*</span>免费参加人数</th>
+									<td><input placeholder="必填" name="freeParticipants" id="freeParticipants"  value="0" placeholder="输入数量" pattern="[0-9]" type="number" min="1" step="1" aria-required="true" class="n-valid"></td>
+								</tr>
+								<tr>
 									<th class="taC"><span class="colRed" title="必填">*</span>培训班地址</th>
-									<td><input placeholder="必填" name="trainAddress" id="trainAddress" type="text"></td>
+									<td colspan="3"><input placeholder="必填" name="trainAddress" id="trainAddress" type="text"></td>
 								</tr>
 								<tr>
 									<th class="taC">备注</th><td colspan="3"><textarea placeholder="选填项" name="trainRemarks" id="trainRemarks" style="width:600px"></textarea></td>

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

@@ -52,8 +52,12 @@
 									<th class="taC"><span class="colRed" title="必填">*</span>参加人数</th>
 									<td><input name="participants" id="participants" value="{{receiptTrainingDetail.participants}}" placeholder="输入数量" pattern="[0-9]" type="number" min="1" step="1" aria-required="true" class="n-valid">
 									</td>
+									<th class="taC"><span class="colRed" title="必填">*</span>免费参加人数</th>
+									<td><input name="freeParticipants" id="freeParticipants"  value="{{receiptTrainingDetail.freeParticipants}}" placeholder="必填" placeholder="输入数量" pattern="[0-9]" type="number" min="1" step="1" aria-required="true" class="n-valid"></td>
+								</tr>
+								<tr>
 									<th class="taC"><span class="colRed" title="必填">*</span>培训班地址</th>
-									<td><input placeholder="必填" name="trainAddress" id="trainAddress" value="{{receiptTrainingDetail.trainAddress}}" type="text"></td>
+									<td colspan="3"><input placeholder="必填" name="trainAddress" id="trainAddress" value="{{receiptTrainingDetail.trainAddress}}" type="text"></td>
 								</tr>
 								<tr>
 									<th class="taC">备注</th><td colspan="3"><textarea placeholder="选填项" name="trainRemarks" id="trainRemarks" style="width:600px">{{receiptTrainingDetail.trainRemarks}}</textarea></td>
@@ -213,7 +217,7 @@
 								<tr>
 									<td colspan="5" class="taC colGray">备用金+办事处收款-办事处实际支出=付总部款</td>
 								</tr>
-								<tr><td colspan="5">学员:{{receiptTrainingDetail.participants}}人&nbsp;&nbsp;&nbsp;讲师:{{lectureCount}} 人</td></tr>
+								<tr><td colspan="5">学员:{{receiptTrainingDetail.participantsTotal}}人(缴费{{receiptTrainingDetail.participants}}&nbsp;免费{{receiptTrainingDetail.freeParticipants}})&nbsp;&nbsp;&nbsp;讲师:{{lectureCount}} 人</td></tr>
 						</tbody></table>
 			  			
 			  			

+ 1 - 1
protected/view/receipt/receiptWasteBook.html

@@ -224,7 +224,7 @@ $('select[expensesType]').change(function() {
 						</tr>
 						</tbody>
 						<!--收入出-->
-						<tbody id="INCOMEBox">
+						<tbody id="INCOMEBox" style="border-top:0px">
 						<tr>
 							<th class="taC">到款银行</th>
 							<td>