Browse Source

培训班结算 上线更新

caipin 6 years ago
parent
commit
fdd94cff9d

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

@@ -472,6 +472,9 @@ $acl ['RECEIPTSEXTEND'] ['allow'] = array (
 				'receiptTrainImplementDo',
 				'receiptTrainImplementWateDo',
 				'receiptTrainItemDelDo',
+				'receiptTrainAssistEdi',
+				'receiptTrainAssistAddDo',
+				'receiptTrainAssistDelDo',
 		)
 );
 $acl ['RECEIPTSAJAX'] ['allow'] = array (

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

@@ -255,6 +255,10 @@ $route['*']['/receiptTrainItemAddDo'] = array('ReceiptController', 'receiptTrain
 $route['*']['/receiptTrainItemAddDo/:payType'] = array('ReceiptController', 'receiptTrainItemAddDo');
 $route['*']['/receiptTrainItemDelDo/:riidKey/:ridKey'] = array('ReceiptExtendController', 'receiptTrainItemDelDo');
 
+$route['*']['/receiptTrainAssistEdi/:rid'] = array('ReceiptExtendController', 'receiptTrainAssistEdi','extension'=>'.html');
+$route['*']['/receiptTrainAssistAddDo'] = array('ReceiptExtendController', 'receiptTrainAssistAddDo');
+$route['*']['/receiptTrainAssistDelDo/:aidKey/:ridKey'] = array('ReceiptExtendController', 'receiptTrainAssistDelDo');
+
 
 $route['*']['/receiptTrainLecturerEdi/:rid'] = array('ReceiptController', 'receiptTrainLecturerEdi','extension'=>'.html');
 $route['*']['/receiptTrainLecturerAddDo'] = array('ReceiptController', 'receiptTrainLecturerAddDo');

+ 164 - 35
protected/controller/ReceiptController.php

@@ -127,6 +127,7 @@ class ReceiptController extends DooController {
 				
 				// 判断执行人的审批权限
 				$executeList = $execute->find ( array (
+						'where'=>'mold !="日常收支"',
 						'select' => 'staff',
 						'asArray' => true 
 				) );
@@ -218,7 +219,11 @@ class ReceiptController extends DooController {
 			$receiptDetail [$key] ['category'] = $category ['title'];
 		}
 		// print_r($receiptLogList);
+		Doo::loadModel ( 'RAssist' );
+		$RAssist = new RAssist ();
+		$receiptExtendList=$RAssist->getRAssistBySid($this->staff[0]['sid']);
 		
+		$data ['receiptExtendList'] = $receiptExtendList;
 		$data ['receiptLogList'] = $receiptLogList;
 		$data ['receiptDetail'] = $receiptDetail;
 		
@@ -2122,7 +2127,7 @@ class ReceiptController extends DooController {
 	/**
 	 * 添加培训班结算
 	 */
-	function receiptTrainAddDo() {
+	function receiptTrainAddDo() {//include Doo::conf ()->BASE_PATH . 'diagnostic/debug.php';
 		// 培训班信息
 		$trainName = $this->get_args ( 'trainName' ) ? $this->get_args ( 'trainName' ) : "";
 		$trainStartDate = $this->get_args ( 'trainStartDate' ) ? $this->get_args ( 'trainStartDate' ) : "";
@@ -2225,24 +2230,26 @@ class ReceiptController extends DooController {
 		$receiptTraining = new receiptTraining ();
 		
 		$receiptDetail = $receipt->getReceiptByRid ( $rid );
-		if (! ($receiptDetail ['status'] == 5 || $receiptDetail ['status'] == 4))
-			die ();
+		if (! ($receiptDetail ['status'] == 5 || $receiptDetail ['status'] == 4)){
+			die ('illegal request--status');
+		}
 		
 		$receiptTrainingDetail = $receiptTraining->getReceiptTrainingByRtid ( $receiptDetail ['trainId'] );
 		
 		// 汇总表合计
-		// 收入合计
+		// 收入合计--加入开票合计
 		Doo::loadModel ( 'invoiceTraining' );
 		$invoiceTraining = new invoiceTraining ();
 		$invoiceTrainingDetail = array (
 				'invoiceArriveAmount' => 0,
 				'RIAmount' => 0,
-				'invoiceTotalAmount' => 0 ,
+				'invoiceTotalAmount' => 0,
 				'invoiceCompanyAmount'=>0
 		);
 		if ($receiptDetail ['invoiceTrainId'] != 0) {
 			$invoiceTrainingDetail = $invoiceTraining->getInvoiceTrainingByItid ( $receiptDetail ['invoiceTrainId'] );
 		}
+		
 		// print_r($invoiceTrainingDetail);
 		$invoiceArriveAmount = $RIAmount = 0;
 		if (! empty ( $invoiceTrainingDetail )) {
@@ -2267,41 +2274,82 @@ class ReceiptController extends DooController {
 		$aiData = $accountItem->getTrainingDetail ( $RItemList, $RILecturerList, $invoiceArriveAmount );
 		// print_r($aiData);
 		
-		// 利润
-		$data ['profit'] = $invoiceArriveAmount - $aiData ['total'];
-		$data ['companyProfit'] = $data ['profit'] * 0.6;
-		$data ['categoryProfit'] = $data ['profit'] * 0.4;
+	// 利润
+		$profit=$invoiceArriveAmount - $aiData ['total'];
+		$companyProfit=$profit * 0.6;
+		$categoryProfit=$profit * 0.4;
+		
+		$data ['profit'] = number_format ( $profit, 2 );
+		$data ['companyProfit'] = number_format ($companyProfit, 2, '.', '' );
+		$data ['categoryProfit'] = number_format ( $categoryProfit, 2, '.', '' );
+		//发票利润
+		$data ['invoiceProfit'] = $invoiceTrainingDetail ['invoiceTotalAmount'] - $aiData ['total'];
+		$data ['invoiceCompanyProfit'] = $data ['invoiceProfit'] * 0.6;//发票公司利润
+		$data ['invoiceCategoryProfit'] = $data ['invoiceProfit'] * 0.4;
+		
 		// print_r($aiData['dataList']);
-		$data ['categoryActualExpenditure'] = $aiData ['total'] - $aiData ['categoryActualExpenditure'];
+		$categoryActualExpenditure= $aiData ['total'] - $aiData ['categoryActualExpenditure'];
+		$data ['categoryActualExpenditure'] = number_format ( $categoryActualExpenditure, 2 );
 		// 备用金
 		$sum = 0;
 		$data ['receiptLoanDetail'] = array (
-				'sum' => 0 
+				'sum' => '0.00' 
 		);
 		if (! empty ( $receiptDetail ['trainLoanRid'] )) {
 			$data ['receiptLoanDetail'] = $receipt->getReceiptByRid ( $receiptDetail ['trainLoanRid'] );
 			$sum = $data ['receiptLoanDetail'] ['sum'];
 		}
-		$data ['payment'] = $sum + $RIAmount - $data ['categoryActualExpenditure'];
 		
-		$data ['total'] = $aiData ['total'];
+		$payment=$sum + $RIAmount - $categoryActualExpenditure;
+		$data ['payment'] = number_format ( $payment, 2 );
+		
+		$data ['total'] = number_format ( $aiData ['total'], 2 );
 		$data ['aiCount'] = count ( $aiData ['dataList'] ) + 5;
 		$data ['aiList'] = $aiData ['dataList'];
 		
 		// 占比计算
 		if ($invoiceArriveAmount != 0) {
-			$data ['totalProportion'] = number_format ( $aiData ['total'] / $invoiceArriveAmount, 4, '.', '' ) * 100;
-			$data ['profitProportion'] = number_format ( $data ['profit'] / $invoiceArriveAmount, 4, '.', '' ) * 100;
-			$data ['sumProportion'] = number_format ( $sum / $invoiceArriveAmount, 4, '.', '' ) * 100;
-			$data ['invoiceTotalAmountProportion'] = number_format ( $data ['invoiceTrainingDetail'] ['invoiceCompanyAmount'] / $invoiceArriveAmount, 4, '.', '' ) * 100;
-			$data ['RIAmountProportion'] = number_format ( $data ['invoiceTrainingDetail'] ['RIAmount'] / $invoiceArriveAmount, 4, '.', '' ) * 100;
-			$data ['companyProfitProportion'] = number_format ( $data ['companyProfit'] / $invoiceArriveAmount, 4, '.', '' ) * 100;
-			$data ['categoryProportion'] = number_format ( $data ['categoryProfit'] / $invoiceArriveAmount, 4, '.', '' ) * 100;
-			$data ['categoryActualExpenditureProportion'] = number_format ( $data ['categoryActualExpenditure'] / $invoiceArriveAmount, 4, '.', '' ) * 100;
-			$data ['paymentProportion'] = number_format ( $data ['payment'] / $invoiceArriveAmount, 4, '.', '' ) * 100;
+			$data ['totalProportion'] = number_format ( $aiData ['total'] / $invoiceArriveAmount, 2, '.', '' ) * 100;
+			$data ['profitProportion'] = number_format ( $profit / $invoiceArriveAmount, 2, '.', '' ) * 100;
+			$data ['sumProportion'] = number_format ( $sum / $invoiceArriveAmount, 2, '.', '' ) * 100;
+			$data ['invoiceTotalAmountProportion'] = number_format ( $data ['invoiceTrainingDetail'] ['invoiceCompanyAmount'] / $invoiceArriveAmount, 2, '.', '' ) * 100;
+			$data ['RIAmountProportion'] = number_format ( $data ['invoiceTrainingDetail'] ['RIAmount'] / $invoiceArriveAmount, 2, '.', '' ) * 100;
+			$data ['companyProfitProportion'] = number_format ( $companyProfit / $invoiceArriveAmount, 2, '.', '' ) * 100;
+			$data ['categoryProportion'] = number_format ( $categoryProfit / $invoiceArriveAmount, 2, '.', '' ) * 100;
+			$data ['categoryActualExpenditureProportion'] = number_format ( $categoryActualExpenditure / $invoiceArriveAmount, 2, '.', '' ) * 100;
+			$data ['paymentProportion'] = number_format ( $payment / $invoiceArriveAmount, 2, '.', '' ) * 100;
 		} else {
 			$data ['totalProportion'] = $data ['profitProportion'] = $data ['sumProportion'] = $data ['invoiceTotalAmountProportion'] = $data ['RIAmountProportion'] = $data ['companyProfitProportion'] = $data ['categoryActualExpenditureProportion'] = $data ['paymentProportion'] = $data ['categoryProportion'] = 0;
 		}
+		//发票金额占比计算
+		if ($invoiceTrainingDetail ['invoiceTotalAmount'] != 0) {
+			//支出
+			$data ['invoicetotalProportion'] = number_format ( $aiData ['total'] / $invoiceTrainingDetail ['invoiceTotalAmount'], 4, '.', '' ) * 100;
+			//利润
+			$data ['invoiceprofitProportion'] = number_format ( $data ['invoiceProfit'] / $invoiceTrainingDetail ['invoiceTotalAmount'], 4, '.', '' ) * 100;
+			//公司利润
+			$data ['invoicecompanyProfitProportion'] = number_format ( $data ['invoiceCompanyProfit'] / $invoiceTrainingDetail ['invoiceTotalAmount'], 4, '.', '' ) * 100;
+			//办事处利润
+			$data ['invoicecategoryProportion'] = number_format ( $data ['invoiceCategoryProfit'] / $invoiceTrainingDetail ['invoiceTotalAmount'], 4, '.', '' ) * 100;
+			//公司收款
+			$data ['invoiceTotalAmountProportionB'] = number_format ( $data ['invoiceTrainingDetail'] ['invoiceCompanyAmount'] / $invoiceTrainingDetail ['invoiceTotalAmount'], 2, '.', '' ) * 100;
+			//备用金
+			$data ['invoicesumProportion'] = number_format ( $sum / $invoiceTrainingDetail ['invoiceTotalAmount'], 2, '.', '' ) * 100;
+			//办事处收款
+			$data ['invoiceRIAmountProportion'] = number_format ( $data ['invoiceTrainingDetail'] ['RIAmount'] / $invoiceTrainingDetail ['invoiceTotalAmount'], 2, '.', '' ) * 100;
+			//办事处实际支出
+			$data ['ICAEP'] = number_format ( $categoryActualExpenditure / $invoiceTrainingDetail ['invoiceTotalAmount'], 2, '.', '' ) * 100;
+			//付总部款
+			$data ['invoicepaymentProportion'] = number_format ( $payment / $invoiceTrainingDetail ['invoiceTotalAmount'], 2, '.', '' ) * 100;
+		}else{
+			$data ['invoiceprofitProportion'] =$data ['invoiceRIAmountProportion'] =$data ['invoicetotalProportion'] =$data ['invoiceTotalAmountProportionB'] =$data ['invoicesumProportion'] =$data ['ICAEP'] =$data ['invoicepaymentProportion'] =$data ['invoicecompanyProfitProportion'] =$data ['invoicecategoryProportion'] =0;
+		}
+		
+		//讲师人数
+		Doo::loadModel ( 'RILecturer' );
+		$RILecturer = new RILecturer ();
+		$RILecturerList = $RILecturer->getRILecturerByRid ( $rid );
+		$data['lectureCount']=count($RILecturerList);
 		
 		// 审批组
 		Doo::loadModel ( 'verify' );
@@ -2800,14 +2848,14 @@ class ReceiptController extends DooController {
 		
 		// 支出项信息
 		$item = $this->get_args ( 'item' ) ? $this->get_args ( 'item' ) : "";
-		$price = $this->get_args ( 'price' ) ? $this->get_args ( 'price' ) : "";
+		$price = $this->get_args ( 'price' ) ? $this->get_args ( 'price' ) : 0;
 		$date = $this->get_args ( 'date' ) ? $this->get_args ( 'date' ) : "";
 		$inputer = $this->get_args ( 'inputer' ) ? $this->get_args ( 'inputer' ) : "";
 		$describe = $this->get_args ( 'describe' ) ? $this->get_args ( 'describe' ) : "";
 		
 		$payType = isset ( $this->params ['payType'] ) ? $this->params ['payType'] : '';
 		
-		if (! empty ( $ridKey ) && ! empty ( $item ) && ! empty ( $price ) && ! empty ( $date ) && ! empty ( $inputer )) {
+		if (! empty ( $ridKey ) && ! empty ( $item ) &&  is_numeric( $price ) && ! empty ( $date ) && ! empty ( $inputer )) {
 			Doo::loadClass ( 'XDeode' );
 			$XDeode = new XDeode ( 5 );
 			Doo::loadModel ( 'RItem' );
@@ -2826,8 +2874,19 @@ class ReceiptController extends DooController {
 			$RItem->price = $price;
 			$RItem->date = $date;
 			$RItem->inputer = $inputer;
+			
+			$order = array (
+					"\r\n",
+					"\n",
+					"\r"
+			);
+			$replace = '<br/>';
+			$describe = str_replace ( $order, $replace, $describe );
 			$RItem->describe = $describe;
 			
+			$RItem->creater=$this->staff['0']['username'];
+			$RItem->creatDate=date ( "Y-m-d H:i:s" ) ;
+			
 			$RItem->insert ();
 			
 			// 添加公司汇总
@@ -2841,10 +2900,10 @@ class ReceiptController extends DooController {
 			$rdInfo = $receiptDetail->getReceiptDetailByRIC ( $rid, $item, '培训班费用' );
 			if (empty ( $rdInfo )) {
 				$receiptDetail = new receiptDetail ();
-				$receiptDetail->staff = $this->staff [0] ['sid'];
+				$receiptDetail->staff = $rInfo ['staff'];
 				$receiptDetail->item = $item;
 				$receiptDetail->itemCategory = '培训班费用';
-				$receiptDetail->price = number_format ( $price, 2, '.', '' );
+				$receiptDetail->price =  $price;
 				$receiptDetail->date = date ( "Y-m-d" );
 				$receiptDetail->cid = $rInfo ['cid'];
 				$receiptDetail->rid = $rid;
@@ -2852,7 +2911,7 @@ class ReceiptController extends DooController {
 				$receiptDetail->insert ();
 			} else {
 				$receiptDetail = new receiptDetail ();
-				$rdInfo ['price'] += number_format ( $price, 2, '.', '' );
+				$rdInfo ['price'] +=  $price;
 				$receiptDetail->price = $rdInfo ['price'];
 				$receiptDetail->update ( array (
 						'where' => 'rid=' . $rid . ' and item like "' . $item . '" and itemCategory like "培训班费用"' 
@@ -2860,11 +2919,50 @@ class ReceiptController extends DooController {
 			}
 			//更新费用合计金额
 			$receipt = new receipt ();
-			$receipt->sum=$rInfo['sum']+number_format ( $price, 2, '.', '' );
+			$receipt->sum=$rInfo['sum']+ $price;
 			$receipt->update ( array (
 					'where' => 'rid=' . $rid 
 			) );
 			
+			
+			//汇总金额--提交审批之后有 支出项时 需要更新汇总
+			if($payType=='company'){
+				Doo::loadModel ( "statistics" );
+				$statistics = new statistics ();
+				
+				
+				$dateArray = explode ( "-", $rInfo ['date'] );
+				$dateCondition = " and Year(date) =" . $dateArray [0] . " and Month(date) = " . $dateArray [1];
+				
+				$stat = $statistics->getOne ( array (
+						'where' => 'staff=' . $rInfo ['staff'] . $dateCondition,
+						'asArray' => true
+				) );
+				if (!empty($stat)){
+					//$statistics->agPrice = $stat ['agPrice'] + $price;
+					$statistics->rePrice = $stat ['rePrice'] + $price;
+					
+					$statistics->update ( array (
+							'where' => 'sid=' . $stat ['sid']
+					) );
+				}
+				
+// 				Doo::loadModel ( "itemStatistics" );
+// 				$itemStatistics = new itemStatistics ();
+// 				$iStatistics = $itemStatistics->getOne ( array (
+// 						'where' => 'staff=' . $rInfo ['staff'] . ' and itemCategory="' . $this->TRAIN . '"' . $dateCondition,
+// 						'asArray' => true
+// 				) );
+// 				if (!empty($iStatistics)){
+// 					$itemStatistics->price = $iStatistics ['price']+$price;
+// 					$itemStatistics->update ( array (
+// 							'where' => 'sid=' . $iStatistics ['sid']
+// 					) );
+// 				}
+				
+			}
+			
+			
 			$XDeode = new XDeode ( 7 );
 			if($payType=='company'){
 				return '/receiptTrainItem/approval/' . $XDeode->encode ( $rid ) . '.html';
@@ -2872,7 +2970,7 @@ class ReceiptController extends DooController {
 				return '/receiptTrainItemEdi/' . $XDeode->encode ( $rid ) . '.html';
 			}
 		} else
-			die ( 'illegal request' );
+			die ( 'illegal request-dataError' );
 	}
 	
 	/**
@@ -2933,6 +3031,8 @@ class ReceiptController extends DooController {
 		$this->render ( "/receipt/receiptTrainLecturerEdi", $data );
 	}
 	
+	
+	
 	/**
 	 * 添加讲师
 	 */
@@ -2987,7 +3087,7 @@ class ReceiptController extends DooController {
 			$rdInfo = $receiptDetail->getReceiptDetailByRIC ( $rid, '讲课费', '培训班费用' );
 			if (empty ( $rdInfo )) {
 				$receiptDetail = new receiptDetail ();
-				$receiptDetail->staff = $this->staff [0] ['sid'];
+				$receiptDetail->staff = $rInfo ['staff'];
 				$receiptDetail->item = '讲课费';
 				$receiptDetail->itemCategory = '培训班费用';
 				$receiptDetail->price = number_format ( $price, 2, '.', '' );
@@ -2998,12 +3098,17 @@ class ReceiptController extends DooController {
 				$receiptDetail->insert ();
 			} else {
 				$receiptDetail = new receiptDetail ();
-				$rdInfo ['price'] += number_format ( $price, 2, '.', '' );
+				$rdInfo ['price'] +=  $price;
 				$receiptDetail->price = $rdInfo ['price'];
 				$receiptDetail->update ( array (
 						'where' => 'rid=' . $rid . ' and item like "' . '讲课费' . '" and itemCategory like "培训班费用"' 
 				) );
 			}
+			$receipt = new receipt ();
+			$receipt->sum=$rInfo['sum']+$price;
+			$receipt->update ( array (
+					'where' => 'rid=' . $rid
+			) );
 			
 			$XDeode = new XDeode ( 7 );
 			return '/receiptTrainLecturerEdi/' . $XDeode->encode ( $rid ) . '.html';
@@ -3030,12 +3135,36 @@ class ReceiptController extends DooController {
 		
 		if (is_numeric ( $rid ) && is_numeric ( $rlid )) {
 			$receiptDetail = $receipt->getReceiptByRid ( $rid );
-			if (!($receiptDetail ['status'] == 5||$receiptDetail ['status'] == 4))
+			if (!($receiptDetail ['status'] == 5||$receiptDetail ['status'] == 4)){
 				die ( 'illegal request-status' );
+			}
 			
+			$detail=$RILecturer->getRILecturerByRlid($rlid);
+			if (empty($detail)){
+				die ( 'illegal request-data' );
+			}
 			$RILecturer->delete ( array (
 					'where' => 'rid=' . $rid . ' and rlid=' . $rlid 
 			) );
+			
+			//更新费用合计金额
+			$rInfo = $receipt->getReceiptByRid ( $rid );
+			$receipt = new receipt ();
+			$receipt->sum= $receiptDetail['sum']-$detail['price'];
+			$receipt->update ( array (
+					'where' => 'rid=' . $rid
+			) );
+			Doo::loadModel ( 'receiptDetail' );
+			$receiptDetail = new receiptDetail ();
+			$rdInfo = $receiptDetail->getReceiptDetailByRIC ( $rid, '讲课费', '培训班费用' );
+			$receiptDetail = new receiptDetail ();
+			$rdInfo ['price'] -= number_format ( $detail['price'], 2, '.', '' );
+			$receiptDetail->price = $rdInfo ['price'];
+			$receiptDetail->update ( array (
+					'where' => 'rid=' . $rid . ' and item like "' . '讲课费' . '" and itemCategory like "培训班费用"'
+			) );
+			
+			
 			$XDeode = new XDeode ( 7 );
 			return '/receiptTrainLecturerEdi/' . $XDeode->encode ( $rid ) . '.html';
 		} else
@@ -3889,7 +4018,7 @@ class ReceiptController extends DooController {
 		if (empty ( $status ))
 			$status = $this->get_args ( 'status' ) && is_numeric ( $this->get_args ( 'status' ) ) ? $this->get_args ( 'status' ) : 0;
 		
-		$page_size = 2;
+		$page_size = 8;
 		$page = isset ( $this->params ['page'] ) && is_numeric ( $this->params ['page'] ) ? $this->params ['page'] : 1;
 		
 		$vidList = array ();
@@ -9490,7 +9619,7 @@ class ReceiptController extends DooController {
 			
 			if (empty ( $receiptDetail ) || $nsflag)
 				return "/approvalExpenses/pendApproval";
-			
+				
 			$verifyDetail = $verify->getOne ( array (
 					'where' => ' vid =' . $receiptDetail ['verify'],
 					'asArray' => true 
@@ -10036,7 +10165,7 @@ class ReceiptController extends DooController {
 			$approvalCondition = ' and status=2 and (nowStaff like "%,' . $this->staff [0] ['sid'] . '%" or nowStaff like "%' . $this->staff [0] ['sid'] . ',%" or nowStaff=' . $this->staff [0] ['sid'] . ' )';
 			$receipt = new receipt ();
 			$rd = $receipt->getOne ( array (
-					'where' => 'status!=5 ' . $approvalCondition . ' and verify in(' . $vid . ')',
+					'where' => 'status!=5 ' . $approvalCondition . ' and verify in(' . $vid . ') and Rtype!=3',
 					'asc' => 'rid',
 					'asArray' => true 
 			) );

+ 11 - 3
protected/model/accountItem.php

@@ -70,7 +70,7 @@ class accountItem extends DooModel {
 				if($v['name']=='讲课费'){
 				}elseif($v['name']=='办公费'&&$value['item']=='办公费'){
 					if($value['payType']==0){
-						$aiList[$k]['categoryPrice']+=$value['price'];
+						$aiList[$k]['categoryPrice']=$aiList[$k]['categoryPrice']+$value['price'];
 						$total+=$value['price'];
 					}elseif($value['payType']==1){
 						$aiList[$k]['companyPrice']+=$value['price'];
@@ -92,7 +92,7 @@ class accountItem extends DooModel {
 					unset($RItemList[$key]);
 				}else{
 					if ($v['name']==$value['item']){
-						$aiList[$k]['price']+=$value['price'];
+						$aiList[$k]['price']=$aiList[$k]['price']+$value['price'];
 						$total+=$value['price'];
 						unset($RItemList[$key]);
 					}
@@ -156,7 +156,15 @@ class accountItem extends DooModel {
 	 			}
 			}
 			
- 			
+			//$aiList[$k]['companyPrice']=number_format ($aiList[$k]['companyPrice'],2);
+			$aiList[$k]['outsideTaxPrice']=number_format ($aiList[$k]['outsideTaxPrice'],2);
+			$aiList[$k]['outsideNoTaxPrice']=number_format ($aiList[$k]['outsideNoTaxPrice'],2);
+			$aiList[$k]['insidePrice']=number_format ($aiList[$k]['insidePrice'],2);
+			
+			$aiList[$k]['companyPrice']=number_format ($aiList[$k]['companyPrice'],2);
+			$aiList[$k]['categoryPrice']=number_format ($aiList[$k]['categoryPrice'],2);
+			$aiList[$k]['priceFormat']=number_format ($aiList[$k]['price'],2);
+			
 		}
 		
 		return array('dataList'=>$aiList,'total'=>$total,'categoryActualExpenditure'=>$categoryActualExpenditure);

+ 1 - 0
protected/model/invoiceTraining.php

@@ -401,6 +401,7 @@ class invoiceTraining extends DooModel {
 				}
 			}
 		}
+		//echo var_dump($detail ['invoiceTotalAmount'] ) ;
 		//print_r($detail);
 		return $detail;
 	}

+ 2 - 0
protected/model/receipt.php

@@ -132,6 +132,8 @@ class receipt extends DooModel {
 		$rinfo['category']=$Lcategory->getCategoryById($rinfo['cid']);
 		$rinfo['staffDetail']=$staff->getStaffBySid($rinfo['staff']);
 		
+		//$rinfo['sum']=number_format ($rinfo['sum'],2);
+		
 		return $rinfo;
 	}
 	

+ 4 - 0
protected/view/admin/implement.html

@@ -19,6 +19,8 @@
 				</div>
 			</div>
 			<div class="adminContent autoHeight" style="height: 821px;">
+			
+			<div class="borad-news">
 				<legend><div class="fR"></div>以下费用需要您执行</legend>
 				
 				<div class="demandCate">
@@ -554,6 +556,8 @@
 	  				
 	  				
 	  				</div>
+	  				
+	  				</div>
 	  					
 	  					
 	  					

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

@@ -249,7 +249,7 @@
 							<!-- endif -->
 							</div>
 							
-							<div class="clearfix">
+							<div class="clearfix" style="display:none;">
 							<legend><div class="fR"><a href="/invoiceUntreadED">查看更多</a></div>已退发票</legend>
 							<!-- if !empty({{untreadStatusList}}) -->
 								<table class="table table-bordered table-condensed">

+ 54 - 2
protected/view/admin/saeaBorad.html

@@ -1,7 +1,6 @@
 <!-- include 'header' -->
 
 
-
 <body>
 	<div class="mainLayout">
 		<div class="mainMenu">
@@ -89,13 +88,66 @@
 										 <a class="button btn-inline" href="/approvedReceipt/{{receiptDetail' value.rid}}">提交审批</a>
 										<!-- elseif {{receiptDetail' value.Rtype}}==3 and ({{receiptDetail' value.status}}==5 or {{receiptDetail' value.status}}==4)  -->
 										 <a class="button btn-gray  btn-inline" href="/receiptTrainEdi/{{receiptDetail' value.ridKey}}.html">返回编辑</a>
-										 <a class="button btn-inline" href="#">提交审批</a>
+										
+										<form action="/receiptTrainDo" method="post" id="receiptTrainApproval" class="nice-validator n-default" novalidate="novalidate">
+				<input type="hidden" name="ridKey" value='{{receiptDetail' value.ridKey}}'>
+				<legend><div class="fR"><button type="submit" class="button" href="#confirm" data-toggle="modal">提交审批</button></div>
+				</legend>
+			</form>
+										
+										 
 										<!-- endif -->
 										</div>
 										</td>
 										</tr>
 										<!-- endloop -->
 										
+										<!-- loop receiptExtendList -->
+										<tr>
+										<!-- if {{receiptDetail' value.Rtype}}==1 -->
+										<th>借款</th>
+										<!-- elseif {{receiptDetail' value.Rtype}}==2 -->
+										<th>对公汇款</th>
+										<!-- elseif {{receiptDetail' value.Rtype}}==3 -->
+										<th>培训班结算</th>
+										<!-- else -->
+										<th>报销单</th>
+										<!-- endif -->
+										
+										<td>
+										<!-- if {{receiptLogList' value.Rtype}}==3 -->
+										
+										<a href="/receiptTrain/info/{{receiptDetail' value.ridKey7}}.html" >{{receiptLogList' value.receiptOrder}}</a>
+										<!-- else -->
+										<a href="/expensesCollect/{{receiptDetail' value.rid}}">{{receiptDetail' value.receiptOrder}}</a>
+										<!-- endif -->
+										</td>
+										<td class="taR">¥{{receiptDetail' value.sum}}
+										<!-- if  {{receiptDetail' value.status}}==7 and {{receiptDetail' value.Rtype}}==1 -->
+										<br/>¥{{receiptDetail' value.loanSum}}
+										<!-- endif -->
+										</td>
+										<td>
+										<!-- if {{receiptDetail' value.Rtype}}==1 and {{receiptDetail' value.status}}==8  -->
+										<span class="colGreen">借款完成</span>
+										<!-- elseif  {{receiptDetail' value.status}}==5 or {{receiptDetail' value.status}}==7 -->
+										未提交
+										<!-- elseif  {{receiptDetail' value.status}}==4 -->
+										<span class="colOrange">撤回</span>
+										<!-- endif -->
+										</td>
+										<td width="120">
+										<div class="btn-group">
+										<!-- if {{receiptDetail' value.Rtype}}==3 and ({{receiptDetail' value.status}}==5 or {{receiptDetail' value.status}}==4)  -->
+										 <a class="button  btn-block" href="/receiptTrainEdi/{{receiptDetail' value.ridKey7}}.html">协作</a>
+										<!-- endif -->
+										</div>
+										</td>
+										</tr>
+										<!-- endloop -->
+										
+										
+										
 										</tbody>
 									</table>
 								</div>

+ 1 - 8
protected/view/admin/saeaLoanAddReceipt.html

@@ -194,14 +194,7 @@
 	  						
 	  						
 	  						<tr><th colspan="2" class="taC">培训班费用</th></tr>
-	  						<!-- loop acItem -->
-		  						<!-- if {{acItem' value.category}} =="培训班费用" -->
-	  						<tr>
-	  						<th>{{acItem' value.name}}</th>
-	  						<td  width="200" class="taR">¥<input type="number" id="train_{{acItem' value.aid}}" name="train[]" value="0" placeholder="输入{{acItem' value.name}}" pattern="[0-9]" step="0.01" min="0" class="span2"></td>
-	  						</tr>
-	  							<!-- endif -->
-	  						<!-- endloop -->
+	  						<td colspan="2" class="taC"><p style="font-size:24px;margin:30px">如借款用于培训班,请在培训班结算中添加。</p></td>
 	  						
 	  						<tr><th class="taR">合计</th><td class="colGreen taR" id="trainResult">¥0.00</td></tr>