Sfoglia il codice sorgente

费用汇款功能

caipin 8 anni fa
parent
commit
efe9218584

+ 33 - 0
global/js/receipt.js

@@ -416,6 +416,39 @@ $(function() {
 			});
 		
 	});
+	
+	
+	
+	$("a[node-invoice='INFO']").click(function() {
+		var postData = $(this).attr("data-isKey");
+		
+		$("div[loading-msg='true']").html("<img src='/global/img/loadIco.gif' />");
+		$("#nc").html('illegal request');
+		var url = "/ajaxGetReceiptDetails";
+		$.ajax({
+			url : url,
+			type : "post",
+			cache : false,
+			dataType : "json",
+			data : {
+				serial : postData
+				
+			},
+			global : true,
+			success : function(data) {
+				if (data.status == 1) {
+					//$("div[loading-msg='true']").html("");
+					
+					$("#nc").html(data.html);
+				} 
+			},
+			error : function(err) {
+				$("div[loading-msg='true']").html("");
+			}
+		});
+	});
+	
+	
 
 })
 

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

@@ -206,6 +206,10 @@ $route['*']['/expensesRetreats/:rid'] = array('ReceiptController', 'expensesRetr
 $route['*']['/hisImplement'] = array('ReceiptController', 'hisImplement');
 $route['*']['/hisImplement/:item'] = array('ReceiptController', 'hisImplement');
 
+$route['*']['/remittanceHky'] = array('ReceiptController', 'remittanceHky');
+$route['*']['/remittanceHky/:k/:page'] = array('ReceiptController', 'remittanceHky');
+$route['*']['/remittancep/:timeStamp'] = array('ReceiptController', 'remittancep','extension'=>'.html');
+$route['*']['/ajaxGetReceiptDetails'] = array('ReceiptController', 'ajaxGetReceiptDetails');
 
 
 $route['*']['/myReceipt'] = array('ReceiptController', 'myReceipt');

+ 457 - 17
protected/controller/ReceiptController.php

@@ -2303,7 +2303,6 @@ class ReceiptController extends DooController {
 						'asArray' => true 
 				) );
 			$verifyList = json_decode ( $verifyList ['staff'], true ); // status opinion
-			
 			$verifyStaff = json_decode ( $value ['verifyStaff'], true );
 			
 			Doo::loadModel ( 'role' );
@@ -3589,7 +3588,6 @@ class ReceiptController extends DooController {
 				$receipt->nowStaff = $nowStaff;
 				$receipt->verifyStaff = $vStaffString;
 				
-				
 				$loanReceipt->nowStaff = $nowStaff;
 				$loanReceipt->verifyStaff = $vStaffString;
 			} else {
@@ -3867,35 +3865,32 @@ class ReceiptController extends DooController {
 			return "/approvalExpenses/2";
 		}
 	}
-	
 	function ajaxExamineExe() {
 		$rid = $this->get_args ( 'rid' ) && is_numeric ( $this->get_args ( 'rid' ) ) ? $this->get_args ( 'rid' ) : 0;
-	
+		
 		Doo::loadModel ( 'receipt' );
 		$receipt = new receipt ();
 		Doo::loadClass ( 'XDeode' );
 		$XDeode = new XDeode ( 5 );
 		if (! empty ( $rid )) {
-				
+			
 			$rLRes = $receipt->find ( array (
 					'where' => 'executeCopy like \'%["' . $this->staff [0] ['sid'] . '%\' and executeStaff not like \'%{"' . $this->staff [0] ['sid'] . '%\' and (status=1 or status=6) and rid!=' . $rid,
-					'asArray' => true
+					'asArray' => true 
 			) );
-			$rLRes [0]['ridKey']=$XDeode->encode ( $rLRes [0] ['rid'] );
+			$rLRes [0] ['ridKey'] = $XDeode->encode ( $rLRes [0] ['rid'] );
 			echo json_encode ( array (
 					'status' => 1,
-					'receipt' => $rLRes [0]
+					'receipt' => $rLRes [0] 
 			) );
 			die ();
 		}
 		echo json_encode ( array (
 				'status' => 0,
-				'receipt' => array ()
+				'receipt' => array () 
 		) );
 		die ();
 	}
-	
-	
 	function implement() {
 		$rid = isset ( $this->params ['rid'] ) ? $this->params ['rid'] : 0;
 		Doo::loadClass ( 'XDeode' );
@@ -4343,7 +4338,7 @@ class ReceiptController extends DooController {
 		$implementOpinions = $this->get_args ( 'opinion' ) ? $this->get_args ( 'opinion' ) : "";
 		$amount = $this->get_args ( 'amount' ) && is_numeric ( $this->get_args ( 'amount' ) ) ? $this->get_args ( 'amount' ) : 0;
 		
-		if (! empty ( $rid )&&!empty($amount)) {
+		if (! empty ( $rid ) && ! empty ( $amount )) {
 			Doo::loadModel ( 'receipt' );
 			$receipt = new receipt ();
 			Doo::loadClass ( 'XDeode' );
@@ -4387,13 +4382,13 @@ class ReceiptController extends DooController {
 			} else {
 				$receipt->executeStaff = json_encode ( $executeStaff );
 			}
-			$receipt->amount=$amount;
+			$receipt->amount = $amount;
 			$receipt->update ( array (
 					'where' => 'rid=' . $rid 
 			) );
 		}
 		$ridKey = $XDeode->encode ( $rid );
-		return "/implement/".$ridKey.".html";
+		return "/implement/" . $ridKey . ".html";
 	}
 	function receiptburEdi() {
 		$rid = isset ( $this->params ['rid'] ) ? $this->params ['rid'] : 0;
@@ -4932,7 +4927,6 @@ class ReceiptController extends DooController {
 			$condition = " and Rtype=2 ";
 		$sopString = "";
 		
-		
 		$dateCondition = " and Year(date) =" . $year;
 		if ($sop != 'SOP')
 			$sopString = " and staff=" . $sop;
@@ -7097,6 +7091,451 @@ class ReceiptController extends DooController {
 		$data ['executeId'] = $this->executeId;
 		$this->render ( "/admin/saeaReportListReport", $data );
 	}
+	function remittanceHky() {
+		$year = $this->get_args ( 'year' ) ? $this->get_args ( 'year' ) : date ( "Y" );
+		$moth = $this->get_args ( 'moth' ) ? $this->get_args ( 'moth' ) : 'MONTH';
+		$day = $this->get_args ( 'day' ) ? $this->get_args ( 'day' ) : 'DAY';
+		
+		$page = isset ( $this->params ['page'] ) && is_numeric ( $this->params ['page'] ) ? $this->params ['page'] : 1;
+		$page_size = 15;
+		
+		$get = "?year=".$year."&moth=".$moth."&day=".$day;
+		
+		Doo::loadModel ( 'receipt' );
+		$receipt = new receipt ();
+		Doo::loadModel ( 'staff' );
+		$staff = new staff ();
+		
+		$dateCondition = " and Year(executeDate) =" . $year;
+		if ($moth != 'MONTH')
+			$dateCondition = " and Year(executeDate) =" . $year . " and Month(executeDate) = " . $moth;
+		if ($day != 'DAY'&&$moth != 'MONTH')
+			$dateCondition = " and Year(executeDate) =" . $year . " and Month(executeDate) = " . $moth . " and day(executeDate)=" . $day;
+			
+		$sql = ' (status =8 or status=9 ) and amount!=0  ' . $dateCondition;
+		$table='(SELECT count(*) FROM CLD_receipt WHERE '.$sql.' group by executeDate ) a ';
+		$pageinfo = $this->get_page ( $table, '  ', $page, $page_size, "remittanceHky", $get, "" );
+		$limit = $pageinfo ['lower'] . ',' . $page_size;
+		
+		$dayList = $receipt->find ( array (
+				'select' => 'executeDate,sum(amount) as amount',
+				'where' => $sql,
+				'desc' => 'executeDate',
+				'groupby' => 'executeDate',
+				'limit' => $limit,
+				'asArray' => true 
+		) );
+		//print_r($dayList);
+		foreach ( $dayList as $key => $value ) {
+			$remitString = "";
+			$receiptList = $receipt->find ( array (
+					'select' => 'rid,executeDate,amount,staff,cid',
+					'where' => '(status =8 or status=9 ) and amount!=0 and executeDate="' . $value ['executeDate'].'"',
+					'desc' => 'executeDate',
+					'asArray' => true 
+			) );
+			
+			foreach ( $receiptList as $k => $v ) {
+				$sinfo = $staff->getOne ( array (
+						'select' => 'username,category',
+						'where' => ' sid=' . $v ['staff'],
+						'asArray' => true 
+				) );
+				$remitString .= $sinfo ['category'] . '-' . $sinfo ['username'] . '(' . $v ['amount'] . ')&nbsp;&nbsp;';
+			}
+			$dayList [$key] ['staff'] = $remitString;
+			$dayList [$key] ['ridKey'] = strtotime ( $value ['executeDate'] );
+		}
+		
+		//print_r($dayList);
+		$mothHtml = "";
+		for($i = 1; $i <= 12; $i ++) {
+			if ($moth == $i)
+				$mothHtml .= '<option selected value="' . $i . '">' . $i . '月</option>';
+			else
+				$mothHtml .= '<option value="' . $i . '">' . $i . '月</option>';
+		}
+		$dayHtml = "";
+		if ($day != "DAY" || $moth != "MONTH") {
+			for($i = 1; $i <= 31; $i ++) {
+				if ($day == $i)
+					$dayHtml .= '<option value="' . $i . '" selected >' . $i . '日</option>';
+				else
+					$dayHtml .= '<option value="' . $i . '" >' . $i . '日</option>';
+			}
+		}
+		
+		$data ['page'] = $pageinfo;
+		$data ['year'] = $year;
+		$data ['moth'] = $moth;
+		$data ['day'] = $day;
+		$data ['get'] = $get;
+		$data ['dayHtml'] = $dayHtml;
+		$data ['mothHtml'] = $mothHtml;
+		$data ['receiptList'] = $dayList;
+		
+		$data ['memu'] = "receipt";
+		$data ['staff'] = $this->staff;
+		$data ['receiptMemu'] = 'remittanceHky';
+		$data ['verifyId'] = $this->verifyId;
+		$data ['executeId'] = $this->executeId;
+		$this->render ( "/admin/remittanceHky", $data );
+	}
+	
+	function remittancep(){
+		$timeStamp = isset ( $this->params ['timeStamp'] ) && is_numeric ( $this->params ['timeStamp'] ) ? $this->params ['timeStamp'] : 0;
+		
+		Doo::loadModel ( 'receipt' );
+		$receipt = new receipt ();
+		Doo::loadModel ( 'staff' );
+		$staff = new staff ();
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		
+		$dateCondition=' and executeDate="'.date('Y-m-d', $timeStamp).'"';
+		
+		$rplist = $receipt->find ( array (
+				'where' => ' (status =8 or status=9 ) and amount!=0  ' . $dateCondition,
+				'asArray' => true
+		) );
+		
+		$dayList = $receipt->find ( array (
+				'where' => ' (status =8 or status=9 ) and amount!=0  ' . $dateCondition,
+				'desc' => 'executeDate',
+				'groupby' => 'staff',
+				'asArray' => true
+		) );
+		
+		$html='';
+		foreach ( $dayList as $key => $value ) {
+			$sinfo = $staff->getOne ( array (
+					'select' => 'username,category',
+					'where' => ' sid=' . $value ['staff'],
+					'asArray' => true
+			) );
+			$html.='<table class="table table-bordered table-condensed"><thead><tr><th class="taC" colspan="3">'.$sinfo['category'].'-'.$sinfo['username'].'</th></tr></thead><tbody>
+					<tr><td class="taC">费用单号</td><td class="taC">汇款金额</td></tr>';
+			$au=0;
+			foreach ($rplist as $k=>$v){
+				if ($value ['staff']==$v['staff']){
+				$html.='<tr><td><a href="#saea-detail" node-invoice="INFO" data-iskey="'.$XDeode->encode ( $v ['rid'] ).'" data-toggle="modal">'.$v['receiptOrder'].'</a></td><td class="taR">¥'.$v['amount'].'</td></tr>';
+				$au+=$v['amount'];
+				}
+			}
+			$html.='<tr><td>合计</td><td class="taR"><b>¥'.$au.'</b></td></tr></tbody></table>';
+		}
+		$data ['html'] =$html;
+		
+		$data ['memu'] = "receipt";
+		$data ['staff'] = $this->staff;
+		$data ['receiptMemu'] = 'remittanceHky';
+		$data ['verifyId'] = $this->verifyId;
+		$data ['executeId'] = $this->executeId;
+		$this->render ( "/admin/remittancep", $data );
+	}
+	
+	function ajaxGetReceiptDetails(){
+		
+		$rid = $this->get_args ( 'serial' ) ? $this->get_args ( 'serial' ) : "";
+		
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		$rid=$XDeode->decode($rid);
+		
+		if (empty ( $rid )) {
+			echo json_encode ( array (
+					'status' => 2,
+					'msg' => 'illegal request'
+			) );
+			die ();
+		}
+		
+		Doo::loadModel ( 'receipt' );
+		$receipt = new receipt ();
+		Doo::loadModel ( 'staff' );
+		$staff = new staff ();
+		
+		$rinfo = $receipt->getOne ( array (
+				'where' => 'rid= ' . $rid,
+				'asArray' => true
+		) );
+		$sinfo = $staff->getOne ( array (
+				'select' => 'username,category',
+				'where' => ' sid=' . $rinfo ['staff'],
+				'asArray' => true
+		) );
+		
+		$rinfo['reviseDetail'] = array ();
+		if (! empty ( $rinfo ['reviseDetail'] ))
+			$rinfo['reviseDetail'] = json_decode ( $rinfo ['reviseDetail'], true );
+		$rinfo['accountItem'] = json_decode ( $rinfo ['accountItem'], true );
+		$rinfo['loanItem'] = json_decode ( $rinfo ['loanItem'], true );
+		$rinfo['category'] =  $sinfo ['category'];
+		$verifyStaff=array();
+		if (!empty($rinfo ['verifyStaff']))
+			$verifyStaff = json_decode ( $rinfo ['verifyStaff'], true );
+		
+		$relust = $rinfo ['sum'] - $rinfo ['loanSum'];
+		$rinfo ['relust'] = $relust;
+		$rinfo['relustCN'] = $this->num_to_rmb ( $relust );
+		$rinfo ['sumCN'] = $this->num_to_rmb ( $rinfo ['sum'] );
+		$rinfo ['loanSumCN'] = $this->num_to_rmb ( $rinfo ['loanSum'] );
+		$rinfo ['amountCN'] = $this->num_to_rmb ( $rinfo ['amount'] );
+		
+		// 费用执行人相关数据
+		$executeCopy = json_decode ( $rinfo ['executeCopy'], true );
+		$executeStaff = json_decode ( $rinfo ['executeStaff'], true );
+		foreach ( $executeCopy as $k => $v ) {
+			$executeCopy [$k] ['date'] = '';
+			$executeCopy [$k] ['opinion'] = '';
+			$executeCopy [$k] ['status'] = '';
+			if (! empty ( $executeStaff ))
+				foreach ( $executeStaff as $m => $u ) {
+					if ($v [0] == $m) {
+						$executeCopy [$k] ['date'] = $u ['date'];
+						$executeCopy [$k] ['opinion'] = $u ['opinion'];
+						$executeCopy [$k] ['status'] = $u ['status'];
+						break;
+					}
+				}
+		}
+		$rinfo ['executeCopy'] = $executeCopy;
+		
+		
+		$html='<div class="modal-dialog modal-lg"><div class="modal-content"><div class="modal-header"><h3>费用详情</h3></div><div class="modal-body saeaList">';
+		
+		
+		if ($rinfo['Rtype']==1){//借款费用
+			$html.='<table class="table table-bordered table-condensed table-hover"><tbody>
+					<tr><th colspan="2" class="taC">借款费用</th></tr>';
+				
+			foreach ($rinfo['loanItem']['借款费用'] as $value){
+				$html.='<tr><th>'.$value['name'].'</th>
+							<td  width="140" class="taR">¥'.$value['price'].'</td></tr>';
+			}
+			$html.='<tr><th class="taC" colspan="2">产生费用所在办事处</th></tr>
+						<tr><th style="text-align:center" colspan="2">'.$rinfo['category'].'</th></tr>
+						<tr><th class="taC" colspan="2">费用说明</th>
+						</tr><tr><td colspan="2">'.$rinfo['explanation'].'</td></tr>
+						<tr class="warning"><td class="taR"><b>('.$rinfo['receiptOrder'].')本次费用合计</b></td>
+						<td class="taR"><b style="font-size:24px">¥'.$rinfo['loanSum'].'</b><br>'.$rinfo['loanSumCN'].'</td></tr>
+						</tbody></table>';
+			if ($rinfo['loanRid']!=0&&!empty($rinfo['accountItem'])){
+				
+						
+				$html.='<table class="table table-bordered table-condensed table-hover"><tbody>';
+				
+				$html.='<tr><th colspan="2" class="taC">日常相关费用</th></tr>';
+				foreach ($rinfo['accountItem']['日常相关费用'] as $value){
+					$html.='<tr><th>'.$value['name'].'</th>
+							<td  width="140" class="taR">¥'.$value['price'].'</td></tr>';
+				}
+				$html.='<tr><th class="taR">合计</th>
+						<td class="colGreen taR">¥'.$rinfo['accountItem']['cSum']['agencySum'].'</td></tr>';
+				
+				$html.='<tr><th colspan="2" class="taC">差旅相关费用</th></tr>';
+				foreach ($rinfo['accountItem']['差旅相关费用'] as $value){
+					$html.='<tr><th>'.$value['name'].'</th>
+							<td  width="140" class="taR">¥'.$value['price'].'</td></tr>';
+				}
+				$html.='<tr><th class="taR">合计</th>
+						<td class="colGreen taR">¥'.$rinfo['accountItem']['cSum']['travelSum'].'</td></tr>';
+				
+				$html.='<tr><th colspan="2" class="taC">培训班费用</th></tr>';
+				foreach ($rinfo['accountItem']['培训班费用'] as $value){
+					$html.='<tr><th>'.$value['name'].'</th>
+							<td  width="140" class="taR">¥'.$value['price'].'</td></tr>';
+				}
+				$html.='<tr><th class="taR">合计</th>
+						<td class="colGreen taR">¥'.$rinfo['accountItem']['cSum']['trainSum'].'</td></tr>';
+				
+				$html.='<tr><th colspan="2" class="taC">其他</th></tr>';
+				foreach ($rinfo['accountItem']['其他'] as $value){
+					$html.='<tr><th>'.$value['name'].'</th>
+							<td  width="140" class="taR">¥'.$value['price'].'</td></tr>';
+				}
+				$html.='<tr><th class="taR">合计</th>
+						<td class="colGreen taR">¥'.$rinfo['accountItem']['cSum']['otherSum'].'</td></tr>';
+				
+				$html.='<tr><th colspan="2" class="taC">报销金额调整</th></tr>';
+				foreach ($rinfo['reviseDetail'] as $value){
+					$html.='<tr><th><span class="interval">|</span>'.$value['name'].':'.$value['description'].'</th>
+							<td class="taR">¥'.$value['price'].'</td></tr>';
+				}
+				$html.='<tr><th class="taR">合计</th>
+						<td class="colGreen taR">¥'.$rinfo['revisePrice'].'</td></tr>';
+				
+				$html.='<tr><th class="taC" colspan="2">产生费用所在办事处</th></tr>
+						<tr><th style="text-align:center" colspan="2">'.$rinfo['category'].'</th></tr>
+						<tr><th class="taC" colspan="2">报销说明</th></tr>		
+						<tr><td colspan="2">'.$rinfo['explanation'].'</td></tr>		
+						<tr class="warning"><td class="taR"><b>('.$rinfo['receiptOrder'].')本次报销费用合计</b></td>		
+						<td class="colGreed taR"><b style="font-size:24px">¥'.$rinfo['sum'].'</b><br>'.$rinfo['sumCN'].'</td></tr>		
+						<tr';
+				if($rinfo['relust']>=0){
+					$html.='class="success"';
+				}else{
+					$html.='class="error"';
+				}
+				$html.='><td class="taR"><b>借款结余</b></td>
+						<td class="taR"><b style="font-size:24px">¥'.$rinfo['relust'].'</b><br>'.$rinfo['relustCN'].'</td></tr>
+	  					</tbody></table>
+						';
+			}
+		}elseif ($rinfo['Rtype']==2){//对公汇款
+			
+			$html.='<table class="table table-bordered table-condensed table-hover"><tbody>
+					<tr><th colspan="2" class="taC">办事处相关费用</th></tr>';
+			
+			foreach ($rinfo['accountItem']['日常相关费用'] as $value){
+				$html.='<tr><th>'.$value['name'].'</th>
+							<td  width="140" class="taR">¥'.$value['price'].'</td></tr>';
+			}
+			$html.='<tr><th class="taR">合计</th>
+						<td class="colGreen taR">¥'.$rinfo['accountItem']['cSum']['agencySum'].'</td></tr>';
+			
+			$html.='<tr><th class="taC" colspan="2">产生费用所在办事处</th></tr>
+						<tr><th style="text-align:center" colspan="2">'.$rinfo['category'].'</th></tr>
+						<tr><th class="taC" colspan="2">费用说明</th>
+						</tr><tr><td colspan="2">'.$rinfo['explanation'].'</td></tr>
+						<tr class="warning"><td class="taR"><b>('.$rinfo['receiptOrder'].')本次费用合计</b></td>
+						<td class="taR"><b style="font-size:24px">¥'.$rinfo['sum'].'</b><br>'.$rinfo['sumCN'].'</td></tr>
+						</tbody></table>';
+		}else{
+			
+			$html.='<table class="table table-bordered table-condensed table-hover"><tbody>';
+			
+			$html.='<tr><th colspan="2" class="taC">日常相关费用</th></tr>';
+			foreach ($rinfo['accountItem']['日常相关费用'] as $value){
+				$html.='<tr><th>'.$value['name'].'</th>
+							<td  width="140" class="taR">¥'.$value['price'].'</td></tr>';
+			}
+			$html.='<tr><th class="taR">合计</th>
+						<td class="colGreen taR">¥'.$rinfo['accountItem']['cSum']['agencySum'].'</td></tr>';
+			
+			$html.='<tr><th colspan="2" class="taC">差旅相关费用</th></tr>';
+			foreach ($rinfo['accountItem']['差旅相关费用'] as $value){
+				$html.='<tr><th>'.$value['name'].'</th>
+							<td  width="140" class="taR">¥'.$value['price'].'</td></tr>';
+			}
+			$html.='<tr><th class="taR">合计</th>
+						<td class="colGreen taR">¥'.$rinfo['accountItem']['cSum']['travelSum'].'</td></tr>';
+			
+			$html.='<tr><th colspan="2" class="taC">培训班费用</th></tr>';
+			foreach ($rinfo['accountItem']['培训班费用'] as $value){
+				$html.='<tr><th>'.$value['name'].'</th>
+							<td  width="140" class="taR">¥'.$value['price'].'</td></tr>';
+			}
+			$html.='<tr><th class="taR">合计</th>
+						<td class="colGreen taR">¥'.$rinfo['accountItem']['cSum']['trainSum'].'</td></tr>';
+			
+			$html.='<tr><th colspan="2" class="taC">其他</th></tr>';
+			foreach ($rinfo['accountItem']['其他'] as $value){
+				$html.='<tr><th>'.$value['name'].'</th>
+							<td  width="140" class="taR">¥'.$value['price'].'</td></tr>';
+			}
+			$html.='<tr><th class="taR">合计</th>
+						<td class="colGreen taR">¥'.$rinfo['accountItem']['cSum']['otherSum'].'</td></tr>';
+			
+			$html.='<tr><th colspan="2" class="taC">报销金额调整</th></tr>';
+			foreach ($rinfo['reviseDetail'] as $value){
+				$html.='<tr><th><span class="interval">|</span>'.$value['name'].':'.$value['description'].'</th>
+							<td class="taR">¥'.$value['price'].'</td></tr>';
+			}
+			$html.='<tr><th class="taR">合计</th>
+						<td class="colGreen taR">¥'.$rinfo['revisePrice'].'</td></tr>';
+			
+			$html.='<tr><th class="taC" colspan="2">产生费用所在办事处</th></tr>
+						<tr><th style="text-align:center" colspan="2">'.$rinfo['category'].'</th></tr>
+						<tr><th class="taC" colspan="2">报销说明</th></tr>
+						<tr><td colspan="2">'.$rinfo['explanation'].'</td></tr>
+						<tr class="warning"><td class="taR"><b>('.$rinfo['receiptOrder'].')本次报销费用合计</b></td>
+						<td class="colGreed taR"><b style="font-size:24px">¥'.$rinfo['sum'].'</b><br>'.$rinfo['sumCN'].'</td></tr>';
+			
+			$html.='</tbody></table>';
+			
+			/*
+			 <table class="table table-bordered table-condensed table-hover">
+	  					<tbody>
+	  					
+	  						<tr><th colspan="2" class="taC">日常相关费用</th></tr>
+	  						<!-- loop receiptList' value.accountItem.日常相关费用 -->
+	  							<tr><th>{{receiptList' value' value.name}}</th><td width="140" class="taR">¥{{receiptList' value' value.price}}</td></tr>
+	  						<!-- endloop -->
+	  						<tr><th class="taR">合计</th><td class="colGreen taR">¥{{receiptList' value.accountItem.cSum.agencySum}}</td></tr>
+	  						
+	  						<tr><th colspan="2" class="taC">差旅相关费用</th></tr>
+	  						<!-- loop receiptDetail' value.accountItem.差旅相关费用 -->
+	  						<tr><th>{{receiptDetail' value' value.name}}</th><td width="140" class="taR">¥{{receiptDetail' value' value.price}}</td></tr>
+	  						<!-- endloop -->
+	  						<tr><th class="taR">合计</th><td class="colGreen taR">¥{{receiptDetail' value.accountItem.cSum.travelSum}}</td></tr>
+	  						
+	  						<tr><th colspan="2" class="taC">培训班费用</th></tr>
+	  						<!-- loop receiptDetail' value.accountItem.培训班费用 -->
+	  						<tr><th>{{receiptDetail' value' value.name}}</th><td  width="140" class="taR">¥{{receiptDetail' value' value.price}}</td></tr>
+	  						<!-- endloop -->
+	  						<tr><th class="taR">合计</th><td class="colGreen taR">¥{{receiptDetail' value.accountItem.cSum.trainSum}}</td></tr>
+	  						
+	  						<tr><th colspan="2" class="taC">其他</th></tr>
+	  						<!-- loop receiptDetail' value.accountItem.其他 -->
+	  						<tr><th>{{receiptDetail' value' value.name}}</th><td  width="140" class="taR">¥{{receiptDetail' value' value.price}}</td></tr>
+	  						<!-- endloop -->
+	  						<tr><th class="taR">合计</th><td class="colGreen taR">¥{{receiptDetail' value.accountItem.cSum.otherSum}}</td></tr>
+	  						
+	  						<tr><th colspan="2" class="taC">报销金额调整</th></tr>
+	  						<!-- loop receiptList' value.reviseDetail -->
+	  						<tr><th><span class="interval">|</span>{{receiptList' value' value.name}}:{{receiptList' value' value.description}}</th><td class="taR">¥{{receiptList' value' value.price}}</td></tr>
+	  						<!-- endloop -->
+	  						<tr><th class="taR">合计</th><td class="colOrange taR">¥{{receiptList' value.revisePrice}}</td></tr>
+	  						
+	  						<tr><th class="taC" colspan="2">产生费用所在办事处</th></tr>
+	  						<tr><th style="text-align:center" colspan="2">{{receiptDetail' value.category}}</th></tr>
+	  						<tr><th class="taC" colspan="2">报销说明</th></tr>
+	  						<tr><td colspan="2">{{receiptDetail' value.explanation}}</td></tr>
+	  						<tr class="warning"><td class="taR"><b>({{receiptDetail' value.receiptOrder}})本次报销费用合计</b></td>
+	  						<td class="colGreed taR"><b style="font-size:24px">¥{{receiptDetail' value.sum}}</b><br>{{receiptDetail' value.sumCN}}</td></tr>
+	  					
+	  						</tbody>
+	  					</table>
+			 */
+		}
+		//print_r($verifyStaff);die;
+		$html.='<table class="table table-bordered table-condensed"><tbody><tr><th class="taC" width="90">审批人</th><th class="taC">审批意见</th></tr>';
+		foreach ($verifyStaff as $key=>$value){
+			$key=trim(strtr($key,'_R','  '));
+			$sinfo = $staff->getOne ( array (
+					'select' => 'username',
+					'where' => ' sid=' . $key,
+					'asArray' => true
+			) );
+			$html.='<tr><td>'.$sinfo['username'].'</td><td>'.$value['opinion'].'</td></tr>';
+		}
+		$html.='</tbody></table>';
+		
+		$html.='<table class="table table-bordered table-condensed"><tbody><tr><th class="taC" width="90">执行人</th><th class="taC">执行意见</th></tr>';
+		foreach ($rinfo['executeCopy'] as $value){
+			$html.='<tr><td>'.$value[1].'</td><td>'.$value['opinion'].'</td></tr>';
+		}
+		$html.='</tbody></table>';
+		
+		$html.='<table class="table table-bordered table-condensed"><tr class="warning"><td class="taR"><b>汇款金额</b></td>
+				<td  width="140" class="taR"><b style="font-size:24px">¥'.$rinfo['amount'].'</b><br>'.$rinfo['amountCN'].'</td>
+			</tr></table>';
+		
+		
+		
+		$html.='</div><div class="modal-footer"><a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a></div></div></div>';
+		
+		echo json_encode ( array (
+				'status' => 1,
+				'html' => $html
+		) );
+		
+		die;
+		
+		
+	}
+	
 	function remittance() {
 		$year = $this->get_args ( 'year' ) ? $this->get_args ( 'year' ) : date ( 'Y' );
 		$month = $this->get_args ( 'month' ) ? $this->get_args ( 'month' ) : "";
@@ -7771,7 +8210,7 @@ class ReceiptController extends DooController {
 				// 微信企业号通知
 				$this->setWXMsg ( $rid, 1 );
 			}
-			$receipt->amount=$amount;
+			$receipt->amount = $amount;
 			$receipt->update ( array (
 					'where' => ' rid = ' . $rid 
 			) );
@@ -11057,9 +11496,10 @@ class ReceiptController extends DooController {
 	 */
 	public function get_table_count($table = "", $condition = "") {
 		// $sql = "select count(*) as count from " . $table . " where 1 " . $condition;
+		
 		$sql = "select count(*) as count from " . $table . " where 1 " . $condition;
 		
-		// echo $sql;die;
+		//echo $sql;die;
 		$query = Doo::db ()->query ( $sql );
 		$result = $query->fetch ();
 		return $result ['count'];

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

@@ -225,7 +225,7 @@
 	  						<tr><th class="taR">合计</th><td class="colGreen taR">¥{{receiptList' value.accountItem.cSum.agencySum}}</td></tr>
 	  						
 	  						
-	  						<tr><th class="taR">合计</th><td class="colGreen taR">¥{{receiptDetail' value.accountItem.cSum.otherSum}}</td></tr>
+	  						
 	  						<tr><th class="taC" colspan="2">产生费用所在办事处</th></tr>
 	  						<tr><th style="text-align:center" colspan="2">{{receiptDetail' value.category}}</th></tr>
 	  						<tr><th class="taC" colspan="2">报销说明</th></tr>

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

@@ -245,7 +245,7 @@
 	  						<tr><th class="taR">合计</th><td class="colGreen taR">¥{{receiptList' value.accountItem.cSum.agencySum}}</td></tr>
 	  						
 	  						
-	  						<tr><th class="taR">合计</th><td class="colGreen taR">¥{{receiptDetail' value.accountItem.cSum.otherSum}}</td></tr>
+	  						
 	  						<tr><th class="taC" colspan="2">产生费用所在办事处</th></tr>
 	  						<tr><th style="text-align:center" colspan="2">{{receiptDetail' value.category}}</th></tr>
 	  						<tr><th class="taC" colspan="2">报销说明</th></tr>

+ 17 - 15
protected/view/admin/receipt_menu.html

@@ -1,26 +1,28 @@
 <ul>
 <li class="saeaTitle">费用管理</li>
-						<li><a <!-- if {{receiptMemu}}=="saeaBorad" --> class="selected" <!-- endif -->  href="/saeaBorad" >公布板</a></li>
-						<li><a <!-- if {{receiptMemu}}=="expenses" --> class="selected" <!-- endif --> href="/expenses">我的费用</a></li>
-						<li><a href="/personalCollect" <!-- if {{receiptMemu}}=="personalCollect" --> class="selected" <!-- endif --> >费用汇总</a></li>
+	<li><a <!-- if {{receiptMemu}}=="saeaBorad" --> class="selected" <!-- endif -->  href="/saeaBorad" >公布板</a></li>
+	<li><a <!-- if {{receiptMemu}}=="expenses" --> class="selected" <!-- endif --> href="/expenses">我的费用</a></li>
+	<li><a href="/personalCollect" <!-- if {{receiptMemu}}=="personalCollect" --> class="selected" <!-- endif --> >费用汇总</a></li>
 						
-						<!-- if inarray({{staff.0.sid}},{{verifyId}}) || inarray({{staff.0.sid}},{{executeId}}) -->
+	<!-- if inarray({{staff.0.sid}},{{verifyId}}) || inarray({{staff.0.sid}},{{executeId}}) -->
 						
-						<li  class="topLine <!-- if  getGlobals('NEW') !=0 --> news <!-- endif --> "><a <!-- if {{receiptMemu}}=="approvalExpenses" --> class="selected" <!-- endif --> href="/approvalExpenses">费用审批</a></li>
+	<li  class="topLine <!-- if  getGlobals('NEW') !=0 --> news <!-- endif --> "><a <!-- if {{receiptMemu}}=="approvalExpenses" --> class="selected" <!-- endif --> href="/approvalExpenses">费用审批</a></li>
 						
-						<!-- if inarray({{staff.0.sid}},{{executeId}}) -->
-						<li <!-- if  getGlobals('NEW2') !=0 --> class="news" <!-- endif --> ><a <!-- if {{receiptMemu}}=="implement" --> class="selected" <!-- endif --> href="/hisImplement">费用执行</a></li>
-						<!-- endif -->
+	<!-- if inarray({{staff.0.sid}},{{executeId}}) -->
+	<li <!-- if  getGlobals('NEW2') !=0 --> class="news" <!-- endif --> ><a <!-- if {{receiptMemu}}=="implement" --> class="selected" <!-- endif --> href="/hisImplement">费用执行</a></li>			
+	<!-- endif -->
+				
+	<li><a <!-- if {{receiptMemu}}=="remittanceHky" --> class="selected" <!-- endif --> href="/remittanceHky">费用汇款</a></li>			
 						
-						<!-- if {{staff.0.cid}}==12 -->
-						<li><a href="/companyCategoryCollect" <!-- if {{receiptMemu}}=="companyCategoryCollect" --> class="selected" <!-- endif --> >公司汇总</a></li>
+	<!-- if {{staff.0.cid}}==12 -->
+	<li><a href="/companyCategoryCollect" <!-- if {{receiptMemu}}=="companyCategoryCollect" --> class="selected" <!-- endif --> >公司汇总</a></li>			
+	<!-- endif -->
+			
 						
-						<!-- endif -->
-						
-						<!-- endif -->
-						<li class="topLine"><a href="#welcome" data-toggle="modal">使用帮助</a></li>
+	<!-- endif -->
+	<li class="topLine"><a href="#welcome" data-toggle="modal">使用帮助</a></li>
 
-				</ul>
+	</ul>
 						<!--弹出邮寄-->
 <div class="modal fade" id="welcome">
 	<div class="modal-dialog">

+ 101 - 0
protected/view/admin/remittanceHky.html

@@ -0,0 +1,101 @@
+ <!-- include 'header' -->
+ <script src="<?= WEB_SITE_GLOBAL ?>js/receipt.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 'receipt_menu' -->
+					</ul>
+				</div>
+			</div>
+			<div class="adminContent autoHeight" style="height: 821px;">
+			<form action="/remittanceHky/0/1" id="up" method="get">
+			<input type="hidden" name="year" id="year"  />
+					<input type="hidden" name="moth" id="month" value="MONTH"  />
+					<input type="hidden" name="day" id="day" value="DAY"  />
+				<legend><div class="fR"></div>费用汇款</legend>
+				<div class="demandCate">
+					<ul class="cateList">
+	  					<li>
+	  					<select  id="Y" onchange="receiptYear();">
+	  					<!-- include 'year' -->
+	  					</select> 
+	  					<select  id="M" onchange="receiptMoth()">
+	  					<option value="MONTH" <!-- if {{moth}}=='MONTH' --> selected <!-- endif --> >月</option>
+	  					{{mothHtml}}
+	  					</select>
+	  					<select  id="D" onchange="receiptDay();">
+	  					<option value="DAY" <!-- if {{day}}=='DAY' --> selected <!-- endif --> >日</option>
+	  					{{dayHtml}}
+	  					</select>
+	  					
+						</li>
+					</ul>
+	  		</div>
+	  		</form>
+	  		<div class="saeaList">
+	  			<!--汇款单列表-->
+	  			<div class="entry">
+	  				<table class="table table-bordered table-condensed">
+	  					<thead>
+								<tr><th width="120">执行日期</th><th>总金额</th><th>收款人(汇款金额)</th><th></th></tr></thead>
+	  					<tbody>
+	  						<!-- loop receiptList -->
+								<tr>
+								<td>{{receiptList' value.executeDate}}</td>
+								<td>¥{{receiptList' value.amount}}</td>
+								<td>{{receiptList' value.staff}}</td>
+								<td><a href="/remittancep/{{receiptList' value.ridKey}}.html">详情</a>
+								</td>
+								</tr>
+							<!-- endloop -->	
+								
+	  					</tbody>
+	  				</table>
+	  				
+	  				<ul class="pagination fR">
+	  							<!-- if {{page.previous}}==0 -->
+								<li><a href="javascript:void(0)" title="上一页">&lt;</a></li>
+								<!-- else -->
+								<li><a href="/remittanceHky/0/{{page.previous}}{{get}}" title="上一页">&lt;</a></li>
+								<!-- endif -->	
+								
+	  							<!-- if {{page.on_page}}>=3 -->
+	  							<li><a href="/remittanceHky/0/1{{get}}" title="上一页">1</a></li>
+	  							<li class="point"><span>...</span></li>
+	  							<!-- endif -->
+	  							{{page.page}}
+	  							<!-- if {{page.on_page}}<3 && {{page.total_page}}>5 -->
+	  							<li><a href="/remittanceHky/0/4{{get}}" >4</a></li>
+	  							<li><a href="/remittanceHky/0/5{{get}}" >5</a></li>
+	  							<!-- endif -->
+	  							
+	  							<!-- if {{page.total_page}}>3 -->
+	  							<li class="point"><span>...</span></li>
+			  					<!-- endif -->
+			  					
+			  					<!-- if {{page.next}}=={{page.on_page}} -->
+								<li><a href="javascript:void(0)" title="下一页">&gt;</a></li>
+								<!-- else -->
+								<li><a href="/remittanceHky/0/{{page.next}}{{get}}" title="下一页">&gt;</a></li>
+								<!-- endif -->
+			  		</ul>
+	  				
+						
+	  			</div>
+	  		</div>
+			</div>
+		</div>
+	</div>
+<script type="text/javascript">autoFlashHeight();</script>
+</body>

+ 43 - 0
protected/view/admin/remittancep.html

@@ -0,0 +1,43 @@
+ <!-- include 'header' -->
+  <script src="<?= WEB_SITE_GLOBAL ?>js/receipt.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 'receipt_menu' -->
+					</ul>
+				</div>
+			</div>
+			<div class="adminContent autoHeight" style="height: 821px;">
+				<legend><div class="fR"></div>2017-05-01 执行详情</legend>
+				<div class="borad-news">
+					<div class="saeaList">
+							{{html}}
+							
+					</div>
+				</div>
+			</div>
+		</div>
+	</div>
+	<!--弹出费用详情-->
+	
+	<div class="modal  fade" id="saea-detail">
+		<div id="nc"></div>
+	</div>
+	
+<div class="modal hide fade" id="saea-detail">
+	
+</div>
+	<!--弹出费用详情-->
+<script type="text/javascript">autoFlashHeight();</script>
+</body>