Bladeren bron

访问权限配置

caipin 8 jaren geleden
bovenliggende
commit
d02318175d

+ 40 - 2
global/js/invoice.js

@@ -1,4 +1,8 @@
-
+function receiptYear(){
+	 var form = $('#up'); 
+	 $('#year').val($('#Y').val());
+	 form.submit();  
+}
 
 $(function() {
 	
@@ -205,7 +209,41 @@ $(function() {
 		});
 	});
 	
-	
+	$("a[node-invoice='INFO']").click(function() {
+		var postData = $(this).attr("data-isKey");
+		var type =$(this).attr("data-type");
+		
+		var po='INVOICE';
+		if(type=='receivables')
+			po='RECEIVABLES';
+		
+		$("div[loading-msg='true']").html("<img src='/global/img/loadIco.gif' />");
+		var url = "/ajaxGetInvoiceInfoByType";
+		$.ajax({
+			url : url,
+			type : "post",
+			cache : false,
+			dataType : "json",
+			data : {
+				serial : postData,
+				type:po
+			},
+			global : true,
+			success : function(data) {
+				if (data.status == 1) {
+					$("div[loading-msg='true']").html("");
+					if(type=='receivables')
+						$("#nr").html(data.html);
+					else
+						$("#nc").html(data.html);
+				} else
+					$("div[loading-msg='true']").html("illegal request");
+			},
+			error : function(err) {
+				$("div[loading-msg='true']").html("");
+			}
+		});
+	});
 	
 	
 	

+ 3 - 0
index.php

@@ -3,6 +3,7 @@
 include './protected/config/common.conf.php';
 include './protected/config/routes.conf.php';
 include './protected/config/db.conf.php';
+include './protected/config/acl.conf.php';
 
 #Just include this for production mode
 //include $config['BASE_PATH'].'deployment/deploy.php';
@@ -17,6 +18,8 @@ Doo::conf()->set($config);
 # remove this if you wish to see the normal PHP error view.
 include $config['BASE_PATH'].'diagnostic/debug.php';
 
+Doo::acl()->rules=$acl;
+
 # database usage
 //Doo::useDbReplicate();	#for db replication master-slave usage
 //Doo::db()->setMap($dbmap);

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

@@ -0,0 +1,72 @@
+<?php
+$acl ['ordinary'] ['allow'] = array (
+		'InvoiceController' => array (
+				'invoice',
+				'invoiceAdd',
+				'invoiceAddDo',
+				'invoiceMyReceivables',
+				'invoiceReceivablesClaim',
+				'invoiceEnterReceivables',
+				'invoiceReceivablesAscription',
+				'invoiceBindReceivables',
+				'invoiceDroppedDo',
+				'invoiceEdit',
+				'invoiceEditDo',
+				'invoiceUntreadDo',
+				'invoiceDelDo',
+				'invoiceAchieve',
+				'ajaxGetInvoiceInfoByType',
+				'ajaxGetInvoiceReceivables',
+				'ajaxGetInvoicePostDetail',
+				'ajaxGetInvoiceByStaff',
+				'ajaxCompareInvoicePrice',
+				'ajaxGetReceivalblesByStaff',
+				'ajaxCompareClaimPrice',
+				'ajaxReceivablesRemove'
+		) 
+);
+$acl ['收款管理'] ['allow'] = array (
+		'InvoiceController' => array (
+				'invoiceReceivables',
+				'invoiceReceivablesDo',
+				'ajaxGetStaffByCategory'
+		) 
+);
+$acl ['发票审批'] ['allow'] = array (
+		'InvoiceController' => array (
+				'invoiceApproval',
+				'invoiceDetail',
+				'invoiceApprovalDo' 
+		) 
+);
+$acl ['发票打印'] ['allow'] = array (
+		'InvoiceController' => array (
+				'invoicePrint',
+				'invoicePrintDetail',
+				'invoicePrintDo'
+		) 
+);
+$acl ['发票邮寄'] ['allow'] = array (
+		'InvoiceController' => array (
+				'invoicePost',
+				'ajaxGetInvoicePostDetail',
+				'invoiceExpressAddDo'
+		) 
+);
+$acl ['发票退票'] ['allow'] = array (
+		'InvoiceController' => array (
+				'invoiceUntread',
+				'invoiceUntreadEstablishedDo'
+
+		)
+);
+$acl ['公司汇总查阅'] ['allow'] = array (
+		'InvoiceController' => array (
+				'invoiceAggregate',
+				'invoiceAggregateStaff',
+				'invoiceAggregateCategory'
+
+		)
+);
+
+?>

+ 36 - 22
protected/config/routes.conf.php

@@ -349,45 +349,59 @@ $route['*']['/adminInvoice'] = array('AdminController', 'adminInvoice');
 $route['*']['/addInvoiceManage'] = array('AdminController', 'addInvoiceManage');
 $route['*']['/delInvoiceManage/:uid/:iid'] = array('AdminController', 'delInvoiceManage');
 
+//普通
 $route['*']['/invoice'] = array('InvoiceController', 'invoice');
 $route['*']['/invoiceAdd'] = array('InvoiceController', 'invoiceAdd');
 $route['*']['/invoiceAddDo'] = array('InvoiceController', 'invoiceAddDo');
-$route['*']['/invoiceApproval'] = array('InvoiceController', 'invoiceApproval');
-$route['*']['/invoiceDetail/:iid'] = array('InvoiceController', 'invoiceDetail','extension'=>'.html');
-$route['*']['/invoiceApprovalDo'] = array('InvoiceController', 'invoiceApprovalDo');
-$route['*']['/invoicePrint'] = array('InvoiceController', 'invoicePrint');
-$route['*']['/invoicePrintDetail/:iid'] = array('InvoiceController', 'invoicePrintDetail','extension'=>'.html');
-$route['*']['/invoicePrintDo'] = array('InvoiceController', 'invoicePrintDo');
-$route['*']['/invoicePost'] = array('InvoiceController', 'invoicePost');
-$route['*']['/invoiceExpressAddDo'] = array('InvoiceController', 'invoiceExpressAddDo');
 $route['post']['/invoiceDroppedDo'] = array('InvoiceController', 'invoiceDroppedDo');
-$route['get']['/invoiceDelDo/:iid'] = array('InvoiceController', 'invoiceDelDo','extension'=>'.do');
 $route['*']['/invoiceEdit/:iid'] = array('InvoiceController', 'invoiceEdit','extension'=>'.html');
 $route['*']['/invoiceEditDo'] = array('InvoiceController', 'invoiceEditDo');
-$route['post']['/invoiceUntreadDo'] = array('InvoiceController', 'invoiceUntreadDo');
-$route['get']['/invoiceUntread'] = array('InvoiceController', 'invoiceUntread');
-$route['post']['/invoiceUntreadEstablishedDo'] = array('InvoiceController', 'invoiceUntreadEstablishedDo');
+$route['get']['/invoiceDelDo/:iid'] = array('InvoiceController', 'invoiceDelDo','extension'=>'.do');
+$route['get']['/invoiceMyReceivables'] = array('InvoiceController', 'invoiceMyReceivables');
 
-$route['get']['/invoiceReceivables'] = array('InvoiceController', 'invoiceReceivables');
 $route['get']['/invoiceReceivablesClaim'] = array('InvoiceController', 'invoiceReceivablesClaim');
-$route['post']['/invoiceReceivablesDo'] = array('InvoiceController', 'invoiceReceivablesDo');
+$route['post']['/invoiceEnterReceivables'] = array('InvoiceController', 'invoiceEnterReceivables');
+
 $route['post']['/invoiceReceivablesAscription'] = array('InvoiceController', 'invoiceReceivablesAscription');
-$route['get']['/invoiceMyReceivables'] = array('InvoiceController', 'invoiceMyReceivables');
 $route['post']['/invoiceBindReceivables'] = array('InvoiceController', 'invoiceBindReceivables');
-$route['post']['/invoiceEnterReceivables'] = array('InvoiceController', 'invoiceEnterReceivables');
+$route['post']['/invoiceUntreadDo'] = array('InvoiceController', 'invoiceUntreadDo');
 
-$route['get']['/invoiceAggregate'] = array('InvoiceController', 'invoiceAggregate');
-$route['get']['/invoiceAggregateStaff'] = array('InvoiceController', 'invoiceAggregateStaff');
-$route['get']['/invoiceAggregateCategory/:cid'] = array('InvoiceController', 'invoiceAggregateCategory');
+$route['get']['/invoiceAchieve'] = array('InvoiceController', 'invoiceAchieve');
 
-$route['post']['/ajaxGetInvoicePostDetail'] = array('InvoiceController', 'ajaxGetInvoicePostDetail');
-$route['post']['/ajaxGetStaffByCategory'] = array('InvoiceController', 'ajaxGetStaffByCategory');
+$route['post']['/ajaxGetInvoiceInfoByType'] = array('InvoiceController', 'ajaxGetInvoiceInfoByType');
 $route['post']['/ajaxGetInvoiceReceivables'] = array('InvoiceController', 'ajaxGetInvoiceReceivables');
 $route['post']['/ajaxGetInvoiceByStaff'] = array('InvoiceController', 'ajaxGetInvoiceByStaff');
-$route['post']['/ajaxCompareClaimPrice'] = array('InvoiceController', 'ajaxCompareClaimPrice');
 $route['post']['/ajaxCompareInvoicePrice'] = array('InvoiceController', 'ajaxCompareInvoicePrice');
 $route['post']['/ajaxGetReceivalblesByStaff'] = array('InvoiceController', 'ajaxGetReceivalblesByStaff');
+$route['post']['/ajaxCompareClaimPrice'] = array('InvoiceController', 'ajaxCompareClaimPrice');
 $route['post']['/ajaxReceivablesRemove'] = array('InvoiceController', 'ajaxReceivablesRemove');
+//发票审批
+$route['*']['/invoiceApproval'] = array('InvoiceController', 'invoiceApproval');
+$route['*']['/invoiceDetail/:iid'] = array('InvoiceController', 'invoiceDetail','extension'=>'.html');
+$route['*']['/invoiceApprovalDo'] = array('InvoiceController', 'invoiceApprovalDo');
+
+//发票打印
+$route['*']['/invoicePrint'] = array('InvoiceController', 'invoicePrint');
+$route['*']['/invoicePrintDetail/:iid'] = array('InvoiceController', 'invoicePrintDetail','extension'=>'.html');
+$route['*']['/invoicePrintDo'] = array('InvoiceController', 'invoicePrintDo');
+
+//发票邮寄
+$route['*']['/invoicePost'] = array('InvoiceController', 'invoicePost');
+$route['*']['/invoiceExpressAddDo'] = array('InvoiceController', 'invoiceExpressAddDo');
+$route['post']['/ajaxGetInvoicePostDetail'] = array('InvoiceController', 'ajaxGetInvoicePostDetail');
+
+//发票退票
+$route['get']['/invoiceUntread'] = array('InvoiceController', 'invoiceUntread');
+$route['post']['/invoiceUntreadEstablishedDo'] = array('InvoiceController', 'invoiceUntreadEstablishedDo');
+
+//收款管理
+$route['get']['/invoiceReceivables'] = array('InvoiceController', 'invoiceReceivables');
+$route['post']['/invoiceReceivablesDo'] = array('InvoiceController', 'invoiceReceivablesDo');
+$route['post']['/ajaxGetStaffByCategory'] = array('InvoiceController', 'ajaxGetStaffByCategory');
+//公司汇总查阅
+$route['*']['/invoiceAggregate'] = array('InvoiceController', 'invoiceAggregate');
+$route['*']['/invoiceAggregateStaff'] = array('InvoiceController', 'invoiceAggregateStaff');
+$route['*']['/invoiceAggregateCategory/:cid'] = array('InvoiceController', 'invoiceAggregateCategory');
 
 
 //假期管理

+ 254 - 24
protected/controller/InvoiceController.php

@@ -10,16 +10,64 @@
 class InvoiceController extends DooController {
 	public $staff;
 	private $INVOICEKEY = "APPROVAL";
+	private $INVOICECOLLECTPATH = "protected/cache/invoiceCollect/";
+	
+	public function beforeRun($resource, $action) {
+		Doo::loadModel ( "invoiceManage" );
+		$invoiceManage = new invoiceManage ();
+		header ( 'Content-Type:text/html;charset=utf-8' );
+		$moldList=$invoiceManage->getInvoiceByStaff($_COOKIE ["staff"]);
+		//print_r($moldList);
+		
+		if (empty($moldList))
+			$uGroups='ordinary';
+		else{
+			$flag=false;
+			array_push($moldList, array('mold'=>'ordinary'));
+			foreach ($moldList as $value){
+				//echo $value['mold'];
+				//echo $action;
+				
+				if (Doo::acl()->isAllowed($value['mold'], $resource, $action)){
+					$flag=true;
+					break;
+				}
+			}
+		}
+		/*
+		Doo::acl()->isAllowed($uGroups['groups'], $resource, $action);
+		*/	
+		//var_dump($flag) ;
+		if (!$flag)
+			die('illegal request');
+		
+		
+	}
+	
 	function __construct() {
 		if (isset ( $_COOKIE ["staff"] )) {
 			if (! empty ( $_COOKIE ["staff"] )) {
 				Doo::loadModel ( 'staff' );
 				$staff = new staff ();
-				Doo::loadModel ( "invoiceManage" );
-				$invoiceManage = new invoiceManage ();
+				
 				
 				// $invoiceManage
 				
+				
+				
+// 				$uname = $this->auth->getUname();
+// 				if ($uname) {
+// 					$uGroups = $this->users->getUidByname($this->auth->getUname());
+// 				} else {
+// 					$uGroups['groups'] = 'anonymous';
+// 				}
+// 				$falg = Doo::acl()->isAllowed($uGroups['groups'], $resource, $action);
+// 				if (!$falg)
+// 					return Doo::conf()->APP_URL;
+				
+				
+				
+				
 				$this->staff = $staff->getUserByIdList ( $_COOKIE ["staff"] );
 				return "/";
 			}
@@ -34,6 +82,7 @@ class InvoiceController extends DooController {
 			@header ( "Location: /login" );
 		}
 	}
+	
 	function invoice() {
 		Doo::loadModel ( 'invoice' );
 		$invoice = new invoice ();
@@ -41,13 +90,29 @@ class InvoiceController extends DooController {
 		$express = new express ();
 		Doo::loadModel ( 'invoiceReceivables' );
 		$invoiceReceivables = new invoiceReceivables ();
+		Doo::loadModel ( 'invoiceStatistics' );
+		$invoiceStatistics = new invoiceStatistics ();
+		
+		$isMonth = $invoiceStatistics->getStatisticsByMonth ();
+		
+		$year = date ( "Y" );
+		$tmp_date = date ( "Ym" );
+		$tmp_year = substr ( $tmp_date, 0, 4 );
+		$tmp_mon = substr ( $tmp_date, 4, 2 );
+		$tmp_forwardmonth = mktime ( 0, 0, 0, $tmp_mon - 1, 1, $tmp_year );
+		$fm_forward_month = date ( "m", $tmp_forwardmonth );
+		$path = SITE_PATH . $this->INVOICECOLLECTPATH . "invoiceCollect_" . $year . "_" . $fm_forward_month . ".htm";
+		$htm=$this->showCache($path);
 		
 		$expressList = $express->getExpressByAll ();
 		$invoiceList = $invoice->getMyInvoice ( $_COOKIE ["staff"] );
 		
 		$list = $invoiceReceivables->getInvoiceReceivablesByClaim ( $this->staff [0] ['cid'], $this->staff [0] ['sid'] );
 		
-		// print_r($list);
+		 //print_r($invoiceList);
+		
+		$data ['isMonth'] = $isMonth;
+		$data ['htm'] = $htm;
 		
 		$data ['expressList'] = $expressList;
 		$data ['invoiceList'] = $invoiceList;
@@ -249,7 +314,7 @@ class InvoiceController extends DooController {
 		$data ['invoiceDetail'] = $invoiceDetail;
 		$data ['memu'] = "invoice";
 		$data ['staff'] = $this->staff;
-		$data ['receiptMemu'] = 'invoiceApproval';
+		$data ['receiptMemu'] = 'invoice';
 		$this->render ( "/admin/invoiceEdit", $data );
 	}
 	/**
@@ -405,11 +470,20 @@ class InvoiceController extends DooController {
 		$invoice = new invoice ();
 		Doo::loadModel ( 'invoiceOperationLog' );
 		$invoiceOperationLog = new invoiceOperationLog ();
+		Doo::loadModel ( 'invoiceReceivables' );
+		$invoiceReceivables = new invoiceReceivables ();
 		
 		$iid = $invoice->authcode ( $untreadIidKey );
 		if (! empty ( $iid ) && ! is_numeric ( $iid ))
 			die ( 'illegal request' );
 		
+		$lt=$invoiceReceivables->getInvoiceReceivablesByIid($iid);
+			
+		if (empty($lt)){
+			header ( 'Content-Type:text/html;charset=utf-8' );
+			die('该发票有收款绑定,请先移除!');
+		}
+		
 		$item = array (
 				'iid' => $iid,
 				'untreadStatus' => 1,
@@ -508,8 +582,12 @@ class InvoiceController extends DooController {
 			$invoiceList [$key] ['lastApprover'] = $lastApprover;
 		}
 		
-		$data ['invoiceList'] = $invoiceList;
+		$ilist=$invoice->getInvoiceByProcessStatus();
+		
+		//print_r($ilist);
 		
+		$data ['invoiceList'] = $invoiceList;
+		$data ['ilist'] = $ilist;
 		$data ['memu'] = "invoice";
 		$data ['staff'] = $this->staff;
 		$data ['receiptMemu'] = 'invoiceApproval';
@@ -962,8 +1040,10 @@ class InvoiceController extends DooController {
 			elseif ($receivablesCategory != 'PUBLIC' && $receivablesStaff != 'PUBLIC') {
 				$receivablesStaff = explode ( '-', $receivablesStaff );
 				$item = array (
-						'operation' => $this->staff [0] ['username'] . " 转入 " . $receivablesStaff [1] 
+						'operation' => $this->staff [0] ['username'] . " 转入 " . $receivablesStaff [1],
+						'bindDate'=>date ( "Y-m-d H:i:s" )
 				);
+				
 			}
 			$item += array (
 					'date' => date ( "Y-m-d" ),
@@ -1069,9 +1149,25 @@ class InvoiceController extends DooController {
 	function invoiceMyReceivables() {
 		Doo::loadModel ( 'invoiceReceivables' );
 		$invoiceReceivables = new invoiceReceivables ();
+		Doo::loadModel ( 'invoiceStatistics' );
+		$invoiceStatistics = new invoiceStatistics ();
+		
+		$isMonth = $invoiceStatistics->getStatisticsByMonth ();
+		
+		$year = date ( "Y" );
+		$tmp_date = date ( "Ym" );
+		$tmp_year = substr ( $tmp_date, 0, 4 );
+		$tmp_mon = substr ( $tmp_date, 4, 2 );
+		$tmp_forwardmonth = mktime ( 0, 0, 0, $tmp_mon - 1, 1, $tmp_year );
+		$fm_forward_month = date ( "m", $tmp_forwardmonth );
+		$path = SITE_PATH . $this->INVOICECOLLECTPATH . "invoiceCollect_" . $year . "_" . $fm_forward_month . ".htm";
+		$htm=$this->showCache($path);
+		
 		
 		$list = $invoiceReceivables->getInvoiceReceivablesByClaim ( $this->staff [0] ['cid'], $this->staff [0] ['sid'] );
 		
+		$data ['isMonth'] = $isMonth;
+		$data ['htm'] = $htm;
 		$data ['list'] = $list;
 		
 		$data ['memu'] = "invoice";
@@ -1094,16 +1190,19 @@ class InvoiceController extends DooController {
 		Doo::loadModel ( 'invoiceOperationLog' );
 		$invoiceOperationLog = new invoiceOperationLog ();
 		
+		if (empty ( $invoiceKey ) || empty ( $claimKey ))
+			die ( 'illegal request' );
+		
 		$detail = $invoice->getInvoiceByIid ( $invoiceKey );
 		$detailM = $invoiceReceivables->getInvoiceReceivablesByIrid ( $claimKey );
 		
 		if (empty ( $detail ) && empty ( $detailM ))
 			die ( 'illegal request' );
 		
-		if ($detailM ['receivablesPrice'] >= $detail ['invoicePrice']) {
-			$price = $detailM ['receivablesPrice'] - $detail ['invoicePrice'];
-			die ( '<p>收款金额超出开票金额 ¥' . $price . '元,请谨慎操作</p><a href="/invoiceMyReceivables">返回</a>' );
-		}
+// 		if ($detailM ['receivablesPrice'] >= $detail ['invoicePrice']) {
+// 			$price = $detailM ['receivablesPrice'] - $detail ['invoicePrice'];
+// 			die ( '<p>收款金额超出开票金额 ¥' . $price . '元,请谨慎操作</p><a href="/invoiceMyReceivables">返回</a>' );
+// 		}
 		
 		$item = array (
 				'irid' => $detailM ['irid'],
@@ -1199,13 +1298,13 @@ class InvoiceController extends DooController {
 		return "/invoice";
 	}
 	function invoiceAggregate() {
+		$year = $this->get_args ( 'year' ) ? $this->get_args ( 'year' ) : date ( "Y" );
+		
 		Doo::loadModel ( 'invoiceStatistics' );
 		$invoiceStatistics = new invoiceStatistics ();
 		Doo::loadModel ( 'L_category' );
 		$Lcategory = new L_category ();
 		
-		$year = date ( "Y" );
-		
 		$isList = $invoiceStatistics->getInvoiceStatisticsByYear ( $year );
 		$LcategoryList = $Lcategory->getCategory ();
 		// print_r($isList);
@@ -1287,7 +1386,7 @@ class InvoiceController extends DooController {
 		$this->render ( "/admin/invoiceAggregate", $data );
 	}
 	function invoiceAggregateStaff() {
-		$year = date ( "Y" );
+		$year = $this->get_args ( 'year' ) ? $this->get_args ( 'year' ) : date ( "Y" );
 		
 		Doo::loadModel ( 'invoiceStatistics' );
 		$invoiceStatistics = new invoiceStatistics ();
@@ -1414,17 +1513,16 @@ class InvoiceController extends DooController {
 		$data ['receiptMemu'] = 'invoiceAggregate';
 		$this->render ( "/admin/invoiceAggregateStaff", $data );
 	}
-	
 	function invoiceAggregateCategory() {
 		Doo::loadClass ( 'XDeode' );
 		$XDeode = new XDeode ( 5 );
 		
-		$cid = isset ( $this->params ['cid'] ) ? $this->params ['cid'] : "";
+		$cid = $cidKey = isset ( $this->params ['cid'] ) ? $this->params ['cid'] : "";
 		$cid = $XDeode->decode ( $cid );
 		if (! is_numeric ( $cid ))
 			die ( 'illegal request' );
 		
-		$year = date ( "Y" );
+		$year = $this->get_args ( 'year' ) ? $this->get_args ( 'year' ) : date ( "Y" );
 		
 		Doo::loadModel ( 'invoiceStatistics' );
 		$invoiceStatistics = new invoiceStatistics ();
@@ -1435,8 +1533,8 @@ class InvoiceController extends DooController {
 		$isCategory = $invoiceStatistics->getInvoiceStatisticsByStaff ( $year, $cid );
 		$toteList = $invoiceStatistics->getInvoiceStatisticsByTote ( $year, $cid );
 		
-		if (empty($list))
-			die('该办事处没有成员');
+		if (empty ( $list ))
+			die ( '该办事处没有成员' );
 		$htmlA = $htmlB = $htmlC = $html = '';
 		foreach ( $list as $key => $value ) {
 			$htmlA = '<tr><th rowspan="3">' . $value ['username'] . '</th><th class="taC">开票</th>';
@@ -1459,7 +1557,7 @@ class InvoiceController extends DooController {
 						break;
 					}
 				}
-				if ($flag){
+				if ($flag) {
 					$htmlA .= '<td class="taR">-</td>';
 					$htmlB .= '<td class="taR">-</td>';
 					$htmlC .= '<td class="taR"><b>-</b></td>';
@@ -1475,7 +1573,7 @@ class InvoiceController extends DooController {
 			$html .= $htmlA . $htmlB . $htmlC;
 		}
 		
-		$htmlA = $htmlB = $htmlC ="";
+		$htmlA = $htmlB = $htmlC = "";
 		
 		$htmlA = '<tr><th rowspan="3">月合计</th><th class="taC">开票</th>';
 		$htmlB = '<tr><th class="taC">收款</th>';
@@ -1486,7 +1584,7 @@ class InvoiceController extends DooController {
 		for($month = 1; $month <= 12; $month ++) {
 			$flag = true;
 			foreach ( $isCategory ['statisticsMonth'] as $k => $v ) {
-				if ( $month == $v ['month']) {
+				if ($month == $v ['month']) {
 					$htmlA .= '<td class="taR colRed">¥' . $v ['invoicePrice'] . '</td>';
 					$htmlB .= '<td class="taR colOrange">¥' . $v ['receivablesPrice'] . '</td>';
 					$htmlC .= '<td class="taR colGreen"><b>¥' . $v ['accountPrice'] . '</b></td>';
@@ -1497,7 +1595,7 @@ class InvoiceController extends DooController {
 					break;
 				}
 			}
-			if ($flag){
+			if ($flag) {
 				$htmlA .= '<td class="taR">-</td>';
 				$htmlB .= '<td class="taR">-</td>';
 				$htmlC .= '<td class="taR"><b>-</b></td>';
@@ -1506,7 +1604,7 @@ class InvoiceController extends DooController {
 		$htmlA .= '<td class="taR colRed">' . $invoicePriceStaffYear . '</td>';
 		$htmlB .= '<td class="taR colOrange">' . $receivablesPriceStaffYear . '</td>';
 		$htmlC .= '<td class="taR colGreen"><b>' . $accountPriceStaffYear . '</b></td>';
-			
+		
 		$htmlA .= '</tr>';
 		$htmlB .= '</tr>';
 		$htmlC .= '</tr>';
@@ -1514,6 +1612,7 @@ class InvoiceController extends DooController {
 		
 		$data ['html'] = $html;
 		
+		$data ['cidKey'] = $cidKey;
 		$data ['slist'] = $list;
 		$data ['isList'] = $toteList;
 		$data ['year'] = $year;
@@ -1523,6 +1622,15 @@ class InvoiceController extends DooController {
 		$this->render ( "/admin/invoiceAggregateCategory", $data );
 	}
 	
+	function invoiceAchieve(){
+		
+		
+		$data ['memu'] = "invoice";
+		$data ['staff'] = $this->staff;
+		$data ['receiptMemu'] = 'invoiceAggregate';
+		$this->render ( "/admin/invoiceAchieve", $data );
+	}
+	
 	/**
 	 * 获得与我有关可收款的发票
 	 */
@@ -1731,7 +1839,7 @@ class InvoiceController extends DooController {
 		foreach ( $list as $key => $value ) {
 			$receivablesPrice += $value ['receivablesPrice'];
 		}
-		if ($receivablesPrice >= $detail ['invoicePrice']) {
+		if ($receivablesPrice > $detail ['invoicePrice']) {
 			$price = $receivablesPrice - $detail ['invoicePrice'];
 			$priceStatus = 1;
 		}
@@ -2081,12 +2189,134 @@ class InvoiceController extends DooController {
 				'priceStatus' => $priceStatus 
 		) );
 	}
+	function ajaxGetInvoiceInfoByType() {
+		$type = $this->get_args ( 'type' ) ? $this->get_args ( 'type' ) : "";
+		$serial = $this->get_args ( 'serial' ) ? $this->get_args ( 'serial' ) : "";
+		
+		if (empty($serial)){
+			echo json_encode ( array (
+					'status' => 2,
+					'msg' => 'illegal request'
+			) );
+			die();
+		}
+			
+		if ($type=='INVOICE'){
+			Doo::loadModel ( 'invoice' );
+			$invoice = new invoice ();
+			
+			$detail=$invoice->getInvoiceByIsid($serial,$this->staff[0]['sid']);
+			if (empty($detail))
+				$html='';
+			else{
+				$html='
+						<div class="modal-dialog modal-lg">
+				<div class="modal-content"><div class="modal-header"><h3>发票单详情</h3></div>
+				<div class="modal-body saeaList"><table class="table table-bordered table-condensed"><tbody>
+						<tr>
+							<th class="taC" width="150">开票流水号</th><td>'.$detail['invoiceSerial'].'</td>
+							<th class="taC" width="150">提交时间</th><td>'.$detail['date'].'</td>
+						</tr>
+						<tr>
+							<th class="taC" width="150">所在办事处</th><td>'.$detail['categoryName'].'('.$detail['userName'].')</td>
+							<th class="taC" width="150">备注</th><td>'.$detail['remark'].'</td>
+						</tr>
+						<tr>
+							<th class="taC">开票金额</th><td><b class="colOrange" style="font-size:18px">¥'.$detail['invoicePrice'].'</b></td>
+							<th class="taC">开票内容</th><td>'.$detail['invoiceElement'].'</td>
+						</tr></tbody></table>';
+				
+					if ($detail['invoiceType']==0)
+						$html.='<table class="table table-bordered table-condensed"><tbody><tr><th colspan="4" class="taC">增值税普通发票</th></tr><tr>
+							<th class="taC" width="150">发票抬头</th><td colspan="3">'.$detail['invoiceTitle'].'</td></tr></tbody></table>';
+					else
+						$html.='<table class="table table-bordered table-condensed"><tbody><tr><th colspan="4" class="taC">增值税专用发票</th></tr><tr>
+							<th class="taC" width="150">单位名称</th><td>'.$detail['invoiceCompany'].'</td>
+							<th class="taC" width="150">纳税人识别码</th><td>'.$detail['TIN'].'</td></tr><tr>
+							<th class="taC">注册地址</th><td>'.$detail['address'].'</td>
+							<th class="taC">注册电话</th><td>'.$detail['phone'].'</td>
+						</tr><tr>
+							<th class="taC">开户银行</th><td>'.$detail['bankAccount'].'</td>
+							<th class="taC">银行账户</th><td>'.$detail['bank'].'</td>
+						</tr></tbody></table>';
+					if ($detail['doPost']==1)
+						$html.='<table class="table table-bordered table-condensed"><tbody><tr><th colspan="4" class="taC">邮寄信息</th></tr><tr>
+							<th class="taC" width="150">收件人</th><td>'.$detail['recipients'].'</td>
+							<th class="taC" width="150">收件人手机/电话</th><td>'.$detail['recipientsPhone'].'</td>
+						</tr><tr>
+							<th class="taC" width="150">收件地址</th><td colspan="3">'.$detail['recipientsAddress'].'</td>
+						</tr><tr>
+							<th class="taC" width="150">邮寄物品</th><td colspan="3">'.$detail['mailItems'].'</td>
+						</tr></tbody></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();
+		}elseif ($type=='RECEIVABLES'){
+			Doo::loadModel ( 'invoiceReceivables' );
+			$invoiceReceivables = new invoiceReceivables ();
+			
+			$detail=$invoiceReceivables->getInvoiceReceivablesByIrsid($serial,$this->staff[0]['sid']);
+			if (empty($detail))
+				$html='';
+			else{
+				$html='<div class="modal-dialog modal-lg"><div class="modal-content"><div class="modal-header"><h3>收款单详情</h3></div><div class="modal-body saeaList"><table class="table table-bordered table-condensed">
+						<tbody><tr>
+							<th class="taC">收款流水号</th><td>'.$detail['receivablesSerial'].'</td>
+							<th class="taC">录入收款</th><td>'.$detail['inputStaff'].' '.$detail['date'].'</td>
+						</tr><tr>
+							<th class="taC">收款金额</th><td><b>¥'.$detail['receivablesPrice'].'</b></td>
+							<th class="taC">收款信息</th><td>'.$detail['receivablesMessage'].'</td>
+						</tr>
+						<tr>
+							<th class="taC">收款银行</th><td>'.$detail['receivablesBank'].'</td>
+							<th class="taC">银行到帐</th><td>'.$detail['receivablesDate'].'</td>
+						</tr>
+						<tr>
+							<th class="taC">认领收款</th><td colspan="3">'.$detail['inputStaff'].' 转入 '.$detail['username'].' '.$detail['bindDate'].'</td>
+						</tr>
+						</tbody></table></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 _GetFileEXT($filename) {
 		$pics = explode ( '.', $filename );
 		$num = count ( $pics );
 		return $pics [$num - 1];
 	}
 	
+	function showCache($path = "") {
+		if (file_exists ( $path )) {
+			$htm=file_get_contents($path);
+		}else{
+			Doo::loadModel ( 'invoiceStatistics' );
+			$invoiceStatistics = new invoiceStatistics ();
+				
+			$isBriefly = $invoiceStatistics->getBrieflyStatistics ();
+			$htm = '<tr><th class="taC">' . $isBriefly ['statisticsMonth'] [0] ['month'] . '月累计开票</th>
+				<td>¥' . $isBriefly ['statisticsMonth'] [0] ['invoicePrice'] . '</td>
+				<th class="taC">' . $isBriefly ['statisticsMonth'] [0] ['month'] . '月累计入账</th>
+				<td>¥' . $isBriefly ['statisticsMonth'] [0] ['accountPrice'] . '</td></tr>';
+			/*
+				'<tr><th class="taC">今年累计开票</th><td>¥' . $isBriefly ['statisticsYear'] [0] ['invoicePrice'] . '</td>
+				<th class="taC">今年累计入账</th><td>¥' . $isBriefly ['statisticsYear'] [0] ['accountPrice'] . '</td></tr>';
+				*/
+			file_put_contents ( $path, $htm, FILE_APPEND );
+		}
+		return $htm;
+	}
+	
 	/**
 	 * 获取get或者POST值
 	 *

+ 4 - 0
protected/controller/ReceiptController.php

@@ -2340,6 +2340,10 @@ $verifyDetail=$verify->find(array('where'=>' (staff not like "%\"'.$this->staff[
 			$approvalCondition=' and (status='.$status.' or status=6)  ';
 		}
 		
+		if($status==8){
+			$approvalCondition=' and (status='.$status.' or status=9)  ';
+		}
+		
 		//nowStaff like "%'.$this->staff[0]['sid'].'%"
 		$pageinfo['page']=array('previous'=>'');
 		if ($status==0){

+ 55 - 9
protected/model/invoice.php

@@ -228,8 +228,8 @@ class invoice extends DooModel {
 			'isDelete',
 			'updateTime',
 			'printTime',
-			'postTime' ,
-			'bindTime'
+			'postTime',
+			'bindTime' 
 	);
 	/**
 	 * 根据发票ID获取一条发票数据
@@ -238,9 +238,8 @@ class invoice extends DooModel {
 	 * @return array|array() 返回发票数据
 	 */
 	public function getInvoiceByIid($iid = 0, $select = "") {
-		
-		if (!is_numeric($iid))
-			$iid=$this->authcode($iid);
+		if (! is_numeric ( $iid ))
+			$iid = $this->authcode ( $iid );
 		
 		$condition = array (
 				'where' => "iid=" . $iid,
@@ -250,12 +249,11 @@ class invoice extends DooModel {
 			$condition += array (
 					'select' => $select 
 			);
-			
+		
 		$Detail = array ();
 		if (is_numeric ( $iid ) && ! empty ( $iid ))
 			$Detail = $this->getOne ( $condition );
 		
-		
 		$Detail ['expressCompany'] = '';
 		$Detail ['expressCom'] = '';
 		if (isset ( $Detail ['expressCompany'] ) && ! empty ( $Detail ['expressCompany'] )) {
@@ -269,6 +267,24 @@ class invoice extends DooModel {
 		$Detail ['category'] = $lCategory->getCategory ();
 		return $Detail;
 	}
+	public function getInvoiceByIsid($iid = "", $sid = 0) {
+		if (empty ( $iid ) || empty ( $sid ))
+			return array ();
+		
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		$iid = $XDeode->decode ( $iid );
+		if (! is_numeric ( $iid ))
+			return array ();
+		
+		$detail = $this->getOne ( array (
+				'where' => "iid= '" . $iid . "'", // and sid=".$sid,
+				'asArray' => TRUE 
+		) );
+		
+		return $detail;
+	}
+	
 	/**
 	 * 获取单个可以打印的发票数据
 	 * @param number $iid 发票id
@@ -369,6 +385,7 @@ class invoice extends DooModel {
 			) );
 			foreach ( $list ['pendingInvoice'] as $key => $value ) {
 				$list ['pendingInvoice'] [$key] ['OperationLog'] = $invoiceOperationLog->getInvoiceOperationLogByIid ( $value ['iid'], 'desc' );
+				$list ['pendingInvoice'] [$key] ['iidKeyUrl'] = $XDeode->encode ( $value ['iid'] );
 			}
 			
 			$list ['handleInvoice'] = $this->find ( array (
@@ -403,7 +420,7 @@ class invoice extends DooModel {
 			$list ['handleInvoice'] [$key] ['iidKeyUrl'] = $XDeode->encode ( $value ['iid'] );
 			// $list ['handleInvoice'] [$key] ['OperationLog'] = $invoiceOperationLog->getInvoiceOperationLogByIid ( $value ['iid'], 'desc' );
 		}
-		return $list['handleInvoice'];
+		return $list ['handleInvoice'];
 	}
 	
 	/**
@@ -412,12 +429,15 @@ class invoice extends DooModel {
 	 * @return array|array() 返回相关数据
 	 */
 	public function getPostByInvoice($postStatus = 0) {
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
 		$list = $this->find ( array (
 				'where' => "postStatus=" . $postStatus . " and doPost=1 and status=2",
 				'asArray' => TRUE 
 		) );
 		foreach ( $list as $key => $value ) {
 			$list [$key] ['iidKey'] = $this->authcode ( $value ['iid'], '' );
+			$list [$key] ['iidKeyK'] = $XDeode->encode ( $value ['iid'] );
 			$list [$key] ['expressCompany'] = '';
 			$list [$key] ['expressCom'] = '';
 			if (! empty ( $value ['expressCompany'] )) {
@@ -435,6 +455,8 @@ class invoice extends DooModel {
 	 * @param number $iid 发票ID
 	 */
 	public function getInvoiceByUntreadStatus($untreadStatus = 1, $iid = 0) {
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
 		if (empty ( $iid )) {
 			$list = $this->find ( array (
 					'where' => " printStatus=1 and untreadStatus=" . $untreadStatus . " and status=2 ",
@@ -447,6 +469,7 @@ class invoice extends DooModel {
 			}
 			foreach ( $list as $key => $value ) {
 				$list [$key] ['iidKey'] = $this->authcode ( $value ['iid'], '' );
+				$list [$key] ['iidKeyK'] = $XDeode->encode ( $value ['iid'] );
 				$list [$key] ['untreadCompany'] = '';
 				$list [$key] ['untreadCom'] = '';
 				if (! empty ( $value ['untreadCompany'] )) {
@@ -466,7 +489,30 @@ class invoice extends DooModel {
 		}
 		return $list;
 	}
-	
+	/**
+	 * 审批中获取相关数据 包括最近的一条操作记录
+	 * @param number $status.
+	 * @param number $limit.
+	 */
+	function getInvoiceByProcessStatus($limit = 4, $desc = 'desc') {
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		$list = $this->find ( array (
+				'where' => " (status=1 or status=3 or status=4) and processApprovals!=''",
+				'limit' => $limit,
+				$desc => 'iid',
+				'asArray' => TRUE 
+		) );
+		
+		Doo::loadModel ( 'invoiceOperationLog' );
+		$invoiceOperationLog = new invoiceOperationLog ();
+		
+		foreach ( $list as $key => $value ) {
+			$list [$key] ['iidKeyK'] = $XDeode->encode ( $value ['iid'] );
+			$list [$key] ['operationLog'] = $invoiceOperationLog->getInvoiceOperationLogByIid ( $value ['iid'], 'desc' );
+		}
+		return $list;
+	}
 	/**
 	 * 加密或解密指定字符串
 	 *

+ 19 - 7
protected/model/invoiceManage.php

@@ -41,20 +41,32 @@ class invoiceManage extends DooModel {
 					'where' => 'mold="' . $mold . '"',
 					'asArray' => TRUE 
 			) );
-			$detail ['staffList'] = json_decode ( $detail ['staff'],true );
+			$detail ['staffList'] = json_decode ( $detail ['staff'], true );
 		}
 		return $detail;
 	}
+	public function getInvoiceByStaff($sid = 0) {
+		$lsit=array();
+		if (! empty ( $sid ))
+			$lsit = $this->find ( array (
+					'select'=>'mold',
+					'where' => 'staff like "%[\"' . $sid . '\",%"',
+					'asArray' => TRUE 
+			) );
+		
+		return $lsit;
+	}
+	
 	/**
 	 * 获取所有管理组数据
 	 * @return array|array() 该管理组相关数据,人员数据数组化
 	 */
-	public function getInvoiceByAll(){
-		$lsit=$this->find(array (
-					'asArray' => TRUE 
-			));
-		foreach ($lsit as $key=>$value){
-			$lsit[$key]['staffList']=json_decode ( $value ['staff'],true );
+	public function getInvoiceByAll() {
+		$lsit = $this->find ( array (
+				'asArray' => TRUE 
+		) );
+		foreach ( $lsit as $key => $value ) {
+			$lsit [$key] ['staffList'] = json_decode ( $value ['staff'], true );
 		}
 		return $lsit;
 	}

+ 31 - 2
protected/model/invoiceReceivables.php

@@ -83,7 +83,7 @@ class invoiceReceivables extends DooModel {
 			}
 			
 			$list ['arClaim'] = $this->find ( array (
-					'where' => "receivablesCategory!='public' and receivablesStaff!='public' and receivablesCategory like '" . $cid . ":%' and bindStatus=0",
+					'where' => "receivablesCategory!='public' and receivablesStaff!='public' and receivablesCategory like '" . $cid . ":%' and receivablesStaff  like '".$sid."-%' and bindStatus=0",
 					'desc' => 'irid',
 					'asArray' => TRUE 
 			) );
@@ -115,8 +115,13 @@ class invoiceReceivables extends DooModel {
 			) );
 			Doo::loadModel ( 'invoice' );
 			$invoice = new invoice ();
+			Doo::loadClass ( 'XDeode' );
+			$XDeode = new XDeode ( 5 );
 			foreach ( $list ['bindClaim'] as $key => $value ) {
-				$list ['bindClaim'] [$key] ['invoice'] = $invoice->getInvoiceByIid ( $value ['iid'] );
+				$id=$invoice->getInvoiceByIid ( $value ['iid'] );
+				$id['iidKeyUrl']= $XDeode->encode ( $id ['iid'] );
+				$list ['bindClaim'] [$key] ['invoice'] = $id;
+				$list ['bindClaim'] [$key] ['iridKeyUrl'] = $XDeode->encode ( $value ['irid'] );
 			}
 		}
 		
@@ -180,6 +185,30 @@ class invoiceReceivables extends DooModel {
 		return $detail;
 	}
 	
+	public function getInvoiceReceivablesByIrsid($irid = "",$sid="") {
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		$irid = $XDeode->decode( $irid );
+		$detail = array ();
+		if (! empty ( $irid ) && is_numeric ( $irid )){
+			$detail = $this->getOne ( array (
+					'where' => " irid=" . $irid." and receivablesStaff like '".$sid."_%'",
+					'asArray' => TRUE
+			) );
+			
+			$detail ['sid'] = '';
+			$detail ['username'] = '';
+			if (!empty($detail ['receivablesStaff'])){
+			$staff = explode ( "-", $detail ['receivablesStaff'] );
+			$detail ['sid'] = $staff [0];
+			$detail ['username'] = $staff [1];
+			}
+			$detail ['iridKey'] = $XDeode->encode ( $detail ['irid'] );
+			$detail ['iridEn'] = $this->authcode ( $detail ['irid'], '' );
+		}
+		return $detail;
+	}
+	
 	/**
 	 * 添加一个收款
 	 * @param array $item 收款相关数据

+ 62 - 0
protected/model/invoiceStatistics.php

@@ -85,6 +85,12 @@ class invoiceStatistics extends DooModel {
 					'asArray' => TRUE
 			) );
 			
+			if (empty($list['statisticsYear'])){
+				$list['statisticsYear'][0]['invoicePrice']=0;
+				$list['statisticsYear'][0]['receivablesPrice']=0;
+				$list['statisticsYear'][0]['accountPrice']=0;
+			}
+				
 			$list['statisticsMonth'] = $this->find ( array (
 					'select'=>'sum(invoicePrice) as invoicePrice,sum(receivablesPrice) as receivablesPrice,sum(accountPrice) as accountPrice,Month(date) as month',
 					'where' => " cid!=0 and staff!=0 and Year(date) =" . $year . $sql,
@@ -195,6 +201,62 @@ class invoiceStatistics extends DooModel {
 		return $list;
 	}
 	
+	public function getStatisticsByMonth(){
+		$month=date("m");
+		$year=date("Y");
+		$list['statisticsMonth'] = $this->find ( array (
+				'select'=>'sum(invoicePrice) as invoicePrice,sum(receivablesPrice) as receivablesPrice,sum(accountPrice) as accountPrice,Month(date) as month',
+				'where' => " cid!=0 and staff!=0 and Year(date) =" . $year . " and Month(date)=".$month,
+				'groupby'=>'Month(date)',
+				'asArray' => TRUE
+		) );
+		if (empty($list['statisticsMonth'])){
+			$list['statisticsMonth'][0]['invoicePrice']=0;
+			$list['statisticsMonth'][0]['receivablesPrice']=0;
+			$list['statisticsMonth'][0]['accountPrice']=0;
+			$list['statisticsMonth'][0]['month']=$month;
+		}
+		$list['statisticsYear'] = $this->find ( array (
+				'select'=>'sum(invoicePrice) as invoicePrice,sum(receivablesPrice) as receivablesPrice,sum(accountPrice) as accountPrice,Year(date) as Year',
+				'where' => " cid!=0 and staff!=0 and Year(date) =" . $year ,
+				'groupby'=>'Year(date)',
+				'asArray' => TRUE
+		) );
+		if (empty($list['statisticsYear'])){
+			$list['statisticsYear'][0]['invoicePrice']=0;
+			$list['statisticsYear'][0]['receivablesPrice']=0;
+			$list['statisticsYear'][0]['accountPrice']=0;
+			$list['statisticsYear'][0]['month']=$month;
+		}
+		return $list;
+	}
+	
+	public function getBrieflyStatistics(){
+		$year=date("Y");
+		$month=date("m");
+		
+		$tmp_date=date("Ym");
+		$tmp_year=substr($tmp_date,0,4);
+		$tmp_mon =substr($tmp_date,4,2);
+		$tmp_forwardmonth=mktime(0,0,0,$tmp_mon-1,1,$tmp_year);
+		$fm_forward_month=date("m",$tmp_forwardmonth);
+		
+		$list['statisticsMonth'] = $this->find ( array (
+				'select'=>'sum(invoicePrice) as invoicePrice,sum(receivablesPrice) as receivablesPrice,sum(accountPrice) as accountPrice,Month(date) as month',
+				'where' => " cid!=0 and staff!=0 and Year(date) =" . $year . " and Month(date)=".$fm_forward_month,
+				'groupby'=>'Month(date)',
+				'asArray' => TRUE
+		) );
+		if (empty($list['statisticsMonth'])){
+			$list['statisticsMonth'][0]['invoicePrice']=0;
+			$list['statisticsMonth'][0]['receivablesPrice']=0;
+			$list['statisticsMonth'][0]['accountPrice']=0;
+			$list['statisticsMonth'][0]['month']=$fm_forward_month;
+		}
+		
+		
+		return $list;
+	}
 	
 }
 

+ 14 - 0
protected/view/admin/expensesCollect.html

@@ -86,6 +86,13 @@
 	  						<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>
@@ -317,6 +324,13 @@
 	  						<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>

+ 14 - 0
protected/view/admin/expensesDoc.html

@@ -97,6 +97,13 @@
 	  						<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>
@@ -357,6 +364,13 @@
 	  						<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>

+ 74 - 136
protected/view/admin/invoice.html

@@ -31,9 +31,11 @@
 							<div class="clearfix">
 								<table class="table table-bordered table-condensed">
 									<tbody>
-									<tr><th class="taC">本月累计开票</th><td>¥3999.00</td><th class="taC">本月累计入账</th><td>¥3999.00</td></tr>
-									<tr><th class="taC">10月累计开票</th><td>¥838,273.00</td><th class="taC">10月累计入账</th><td>¥838,273.00</td></tr>
-									<tr><th class="taC">今年累计开票</th><td>¥209,484,765.00</td><th class="taC">今年累计入账</th><td>¥209,484,765.00</td></tr>
+									<tr><th class="taC">本月累计开票</th><td>¥{{isMonth.statisticsMonth.0.invoicePrice}}</td>
+									<th class="taC">本月累计入账</th><td>¥{{isMonth.statisticsMonth.0.accountPrice}}</td></tr>
+									{{htm}}
+									<tr><th class="taC">今年累计开票</th><td>¥{{isMonth.statisticsYear.0.invoicePrice}}</td>
+									<th class="taC">今年累计入账</th><td>¥{{isMonth.statisticsYear.0.accountPrice}}</td></tr>
 									</tbody>
 
 								</table>
@@ -56,7 +58,7 @@
 										<!-- elseif {{pendingInvoice' value.status}}==2 and {{pendingInvoice' value.printStatus}}==1 and {{pendingInvoice' value.untreadStatus}}==0  -->
 										<span class="colBlue">已出票</span>
 										<!-- if {{pendingInvoice' value.doPost}}==1 -->
-										<a href="#shipping" data-toggle="modal">邮寄</a>
+										<a href="#shipping" node-post="express-msg" post-data="{{invoicePost' value.iidKey}}" data-toggle="modal">邮寄</a>
 										<!-- endif -->
 										<!-- elseif {{pendingInvoice' value.status}}==2 and {{pendingInvoice' value.printStatus}}==1 and {{pendingInvoice' value.untreadStatus}}==2  -->
 										<span class="colRed">已退票</span>
@@ -75,7 +77,7 @@
 	                                    <b>¥{{pendingInvoice' value.invoicePrice}}</b>
 	                                    <!-- endif --></td>
 										<td>
-										<a href="#invdetail" data-toggle="modal">{{invoiceList' value.invoiceSerial}}</a>
+										<a href="#invdetail" node-invoice='INFO' data-isKey="{{pendingInvoice' value.iidKeyUrl}}" data-toggle="modal">{{invoiceList' value.invoiceSerial}}</a>
 										</td>
 										<td>{{invoiceList' value.OperationLog.username}} {{invoiceList' value.OperationLog.date}}</td>
 										<td width="">
@@ -137,7 +139,7 @@
 	                                    <!-- else -->
 	                                    <b>¥{{pendingInvoice' value.invoicePrice}}</b>
 	                                    <!-- endif --></td>
-										<td><a href="#invdetail" data-toggle="modal">{{invoiceList' value.invoiceSerial}}</a></td>
+										<td><a href="#invdetail" node-invoice='INFO' data-isKey="{{pendingInvoice' value.iidKeyUrl}}" data-toggle="modal">{{invoiceList' value.invoiceSerial}}</a></td>
 										<td>{{invoiceList' value.OperationLog.username}} {{invoiceList' value.OperationLog.date}}</td>
 									</tr>
 									<!-- endloop -->
@@ -152,7 +154,7 @@
 							
 							
 							<!-- if !empty({{receivablesList.bindClaim}}) -->
-							<legend><div class="fR"><a href="invoice-billing-all.html">查看更多</a></div>最近入账</legend>
+							<legend><div class="fR"><a href="/invoiceAchieve">查看更多</a></div>最近入账</legend>
 							<table class="table table-bordered table-condensed">
 								<tbody>
 								<tr><th class="taC">开票单位(抬头)</th><th class="taC" width="90">开票金额</th><th class="taC">开票流水号</th><th class="taC" width="90">收款金额</th><th class="taC">收款流水号</th><th class="taC">处理时间</th></tr>
@@ -171,9 +173,9 @@
 	                                    <b>¥{{receivablesList' value.invoice.invoicePrice}}</b>
 	                                    <!-- endif -->
 										</td>
-										<td><a href="#invdetail" data-toggle="modal">{{receivablesList' value.invoice.invoiceSerial}}</a></td>
+										<td><a href="#invdetail" node-invoice='INFO' data-isKey="{{receivablesList' value.invoice.iidKeyUrl}}"  data-toggle="modal">{{receivablesList' value.invoice.invoiceSerial}}</a></td>
 										<td><b>¥{{receivablesList' value.receivablesPrice}}</b></td>
-										<td><a href="#billing" data-toggle="modal">{{receivablesList' value.receivablesSerial}}</a></td>
+										<td><a href="#billing" node-invoice='INFO' data-type="receivables" data-isKey="{{receivablesList' value.iridKeyUrl}}" data-toggle="modal">{{receivablesList' value.receivablesSerial}}</a></td>
 										<td>{{receivablesList' value.invoice.userName}} {{receivablesList' value.invoice.updateTime}}</td>
 									</tr>
 								<!-- endloop -->
@@ -191,117 +193,16 @@
 			</div>
 		</div>
 	</div>
+	<div loading-msg='true' style="position:absolute;  left:50%;  top:50%;  "></div>
 	<!--弹出(发票详情)-->
-	<div class="modal hide fade" id="invdetail">
-		<div class="modal-dialog modal-lg">
-			<div class="modal-content">
-				<div class="modal-header">
-					<h3>发票单详情</h3>
-				</div>
-				<div class="modal-body saeaList">
-					<table class="table table-bordered table-condensed">
-						<tbody>
-						<tr>
-							<th class="taC" width="150">开票流水号</th><td>#F20160316001</td>
-							<th class="taC" width="150">提交时间</th><td>2016-03-01 12:30:01</td>
-						</tr>
-						<tr>
-							<th class="taC" width="150">所在办事处</th><td>广东办(刘飞)</td>
-							<th class="taC" width="150">备注</th><td></td>
-						</tr>
-						<tr>
-							<th class="taC">开票金额</th><td><b class="colOrange" style="font-size:18px">¥20000.00</b></td>
-							<th class="taC">开票内容</th><td>纵横公路工程造价管理系统V9.0</td>
-						</tr>
-						</tbody>
-					</table>
-					<table class="table table-bordered table-condensed">
-						<tbody>
-						<tr>
-							<th colspan="4" class="taC">增值税普通发票</th>
-						</tr>
-						<tr>
-							<th class="taC" width="150">发票抬头</th><td colspan="3">珠海纵横创建软件有限公司</td>
-
-						</tr>
-						</tbody>
-					</table>
-					<table class="table table-bordered table-condensed">
-						<tbody>
-						<tr>
-							<th colspan="4" class="taC">增值税专用发票</th>
-						</tr>
-						<tr>
-							<th class="taC" width="150">单位名称</th><td>珠海纵横创建软件有限公司</td>
-							<th class="taC" width="150">纳税人识别码</th><td>1212123123123</td>
-
-						</tr>
-
-						<tr>
-							<th class="taC">注册地址</th><td>广东省珠海市香洲区银桦路8号24D</td>
-							<th class="taC">注册电话</th><td>0756-34324</td>
-						</tr>
-						<tr>
-							<th class="taC">开户银行</th><td>广发银行</td>
-							<th class="taC">银行账户</th><td>234324234</td>
-						</tr>
-						</tbody>
-					</table>
-					<table class="table table-bordered table-condensed">
-						<tbody>
-						<tr>
-							<th colspan="4" class="taC">邮寄信息</th>
-						</tr>
-						<tr>
-							<th class="taC" width="150">收件人</th><td>陈工</td>
-							<th class="taC" width="150">收件人手机/电话</th><td>12345678901</td>
-						</tr>
-						<tr>
-							<th class="taC" width="150">收件地址</th><td colspan="3">广东省珠海市XXX路XXX号</td>
-						</tr>
-						<tr>
-							<th class="taC" width="150">邮寄物品</th><td colspan="3">合同x1、锁套装x1</td>
-						</tr>
-						</tbody>
-					</table>
-				</div>
-				<div class="modal-footer">
-					<a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
-				</div>
-			</div></div>
+	<div class="modal  fade" id="invdetail">
+		
+		<div id="nc"></div>
 	</div>
 	<!--弹出发票详情-->
 	<!--弹出收款-->
-	<div class="modal hide fade" id="billing">
-		<div class="modal-dialog modal-lg">
-			<div class="modal-content">
-				<div class="modal-header">
-					<h3>收款单详情</h3>
-				</div>
-				<div class="modal-body saeaList">
-					<table class="table table-bordered table-condensed">
-						<tbody>
-						<tr>
-							<th class="taC">收款流水号</th><td>#SK20160316001</td>
-							<th class="taC">录入收款</th><td>张少珊 2015-04-12 11:30:02</td>
-						</tr>
-						<tr>
-							<th class="taC">收款金额</th><td><b>¥200000.00</b></td>
-							<th class="taC">收款信息</th><td>陈宇</td>
-						</tr>
-						<tr>
-							<th class="taC">收款银行</th><td>广发银行珠海分行柠溪支行</td>
-							<th class="taC">银行到帐</th><td>2016-04-11</td>
-						</tr>
-						<tr>
-							<th class="taC">认领收款</th><td colspan="3">张少珊 转入 陈特 2015-04-12 11:30:02</td>
-						</tr>
-						</tbody></table>
-				</div>
-				<div class="modal-footer">
-					<a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
-				</div>
-			</div></div>
+	<div class="modal  fade" id="billing">
+		<div id="nr"></div>
 	</div>
 	<!--弹出收款-->
 	<!--弹出终止-->
@@ -424,27 +325,64 @@
 </div>
     <!--入账-->
 	<!--弹出邮寄-->
-<div class="modal hide fade" id="shipping">
-	<div class="modal-dialog ">
-		<div class="modal-content">
-	<div class="modal-header">
-		<h3>邮寄物品</h3>
-	</div>
-	<div class="modal-body">
-		<p>申请物品:发票×1、软件锁套装x1</p>
-		<p>邮寄物品:<b>发票×1、软件锁套装x1</b></p>
-		<p>顺丰速运:01239812382398</p>
-		<br>
-		<ul>
-			<li>• 2016-04-09 20:16:17【珠海市】圆通速递 广东省珠海市收件员 已揽件</li>
-			<li>• 2016-04-09 20:16:17【珠海市】广东省珠海市香洲区2派件员:陈华辉 13676058042正在为您派件</li>
-		</ul>
-	</div>
-	<div class="modal-footer">
-		<a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
+	<div class="modal hide fade" id="shipping">
+		<div class="modal-dialog">
+			<div class="modal-content">
+				<div class="modal-header">
+					<h3>邮寄物品</h3>
+				</div>
+				<div class="modal-body saeaList">
+				<div style='text-align: center' loading-msg='express-msg'></div>
+					<table class="table table-bordered table-condensed">
+						<tbody>
+							<tr>
+								<th colspan="4" class="taC">申请邮寄信息</th>
+							</tr>
+							<tr>
+								<th class="taC" width="100">收件人</th>
+								<td recipients-data='express-msg'></td>
+								<th class="taC" width="100">收件人手机/电话</th>
+								<td recipientsPhone-data='express-msg'></td>
+							</tr>
+							<tr>
+								<th class="taC" width="100">收件地址</th>
+								<td recipientsAddress-data='express-msg' colspan="3"></td>
+							</tr>
+							<tr>
+								<th class="taC" width="100">邮寄物品</th>
+								<td mailItems-data='express-msg' colspan="3"></td>
+							</tr>
+						</tbody>
+					</table>
+					<table class="table table-bordered table-condensed">
+						<tbody>
+							<tr>
+								<th colspan="4" class="taC">实际邮寄信息</th>
+							</tr>
+							<tr>
+								<th class="taC" width="100">快递公司</th>
+								<td expressCompany-data='express-msg'></td>
+								<th class="taC" width="100">快递单号</th>
+								<td expressNumber-data='express-msg'></td>
+							</tr>
+							</tr>
+							<tr>
+							<tr>
+								<th class="taC" width="100">邮寄物品</th>
+								<td colspan="3" actualItems-data='express-msg'></td>
+							</tr>
+						</tbody>
+					</table>
+					
+				</div>
+				<div class="modal-footer">
+					<a href="#" class="button btn-gray" data-dismiss="modal"
+						aria-hidden="true">关闭</a>
+				</div>
+			</div>
+		</div>
 	</div>
-			</div></div>
-</div>
 	<!--邮寄-->
+
 <script type="text/javascript">autoFlashHeight();</script>	
 </body>

+ 84 - 0
protected/view/admin/invoiceAchieve.html

@@ -0,0 +1,84 @@
+<!-- include 'header' -->
+<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">
+					<!-- include 'invoiceMenu' -->
+				</div>
+			</div>
+			<div class="adminContent autoHeight">
+				<legend>
+				入账完成发票</legend>
+				<div class="demandCate">
+					<ul class="cateList">
+	  					<li><a class="now" href="#">最近一个月</a><a href="#">最近三个月</a><a href="#" >今年</a><a href="#" >更旧</a></li>
+						<li>
+							<div class="search">
+							<div class="input-append">
+								<input class="span3" type="text" placeholder="发票抬头、开票金额">
+								<button class="btn btn-small" type="button">搜索</button>
+							</div>
+						</li>
+	  			</ul>
+	  		</div>
+				<div class="saeaList">
+					<table class="table table-hover">
+						<tbody>
+						<tr class="thead"><th>开票流水号</th><th>开票金额</th><th>开票单位(抬头)</th><th>开票内容</th><th>收款流水号</th><th>收款金额</th><th>入账时间</th></tr>
+						<tr>
+							<td><a href="#invdetail" data-toggle="modal">#F20160316001</a></td>
+							<td><b>¥3000.00</b></td>
+							<td>珠海XXXX公司</td>
+							<td>纵横公路工程造价管理系统V9.0</td>
+							<td><a href="#" data-toggle="modal">#SK20160316001</a>,<a href="#" data-toggle="modal">#SK20160316001</a>,<a href="#" data-toggle="modal">#SK20160316001</a></td>
+							<td><b>¥3000.00</b></td>
+							<td>2016-03-03<br>11:30:03</td>
+						</tr>
+						<tr>
+							<td><a href="#invdetail" data-toggle="modal">#F20160316001</a></td>
+							<td><b>¥3000.00</b><sup>专</sup></td>
+							<td>珠海XXXX公司</td>
+							<td>纵横公路工程造价管理系统V9.0</td>
+							<td><a href="#" data-toggle="modal">#SK20160316001</a></td>
+							<td><b>¥3000.00</b></td>
+							<td>2016-03-03<br>11:30:03</td>
+						</tr>
+						<tr>
+							<td><a href="#invdetail" data-toggle="modal">#F20160316001</a></td>
+							<td><b>¥3000.00</b></td>
+							<td>珠海XXXX公司</td>
+							<td>纵横公路工程造价管理系统V9.0</td>
+							<td><a href="#" data-toggle="modal">#SK20160316001</a></td>
+							<td><b>¥3000.00</b></td>
+							<td>2016-03-03<br>11:30:03</td>
+						</tr>
+						</tbody>
+					</table>
+				</div>
+				<!--翻页-->
+				<div class="demandPage">
+					<ul class="pagination fL">
+						<li><a href="#">&lt;</a></li>
+						<li><a href="#">1</a></li>
+						<li class="active"><a href="#">2</a></li>
+						<li><a href="#">3</a></li>
+						<li><a href="#">4</a></li>
+						<li><a href="#">5</a></li>
+						<li><a href="#">&gt;</a></li>
+					</ul>
+			  	</div>
+			</div>
+		</div>
+	</div>
+<script type="text/javascript">autoFlashHeight();</script>	
+</body>

+ 4 - 1
protected/view/admin/invoiceAggregate.html

@@ -1,6 +1,7 @@
 <!-- include 'header' -->
 <link rel=stylesheet href="<?= WEB_SITE_GLOBAL ?>css/fixedheadertable.css">
 <script src="<?= WEB_SITE_GLOBAL ?>js/jquery.fixedheadertable.js"></script>
+<script src="<?= WEB_SITE_GLOBAL ?>js/invoice.js"></script>
 <body>
 	<div class="mainLayout">
 		<div class="mainMenu">
@@ -23,15 +24,17 @@
 					办事处 全年开票收款汇总
 				</legend>
 				<div class="demandCate">
+					<form action="/invoiceAggregate" id="up" method="post">
 					<ul class="cateList">
 						<li><a href="#" class="now">办事处</a><a href="/invoiceAggregateStaff">员工</a></li>
-						<li><select>
+						<li><select name="year" id="Y" onchange="receiptYear();">
 						<!-- include 'year' -->
 						</select></li>
 						<li>开票总计:¥{{isList.statisticsYear.0.invoicePrice}}</li>
 						<li>收款总计:¥{{isList.statisticsYear.0.receivablesPrice}}</li>
 						<li>完成入账:¥{{isList.statisticsYear.0.accountPrice}}</li>
 					</ul>
+					</form>
 				</div>
 				<div class="saeaList">
 					<div class="entry autoHeightI2" style="margin-bottom:0">

+ 4 - 1
protected/view/admin/invoiceAggregateCategory.html

@@ -1,6 +1,7 @@
 <!-- include 'header' -->
 <link rel=stylesheet href="<?= WEB_SITE_GLOBAL ?>css/fixedheadertable.css">
 <script src="<?= WEB_SITE_GLOBAL ?>js/jquery.fixedheadertable.js"></script>
+<script src="<?= WEB_SITE_GLOBAL ?>js/invoice.js"></script>
 <body>
 	<div class="mainLayout">
 		<div class="mainMenu">
@@ -23,14 +24,16 @@
 					{{slist.0.category}} 全年开票收款汇总
 				</legend>
 				<div class="demandCate">
+				<form action="/invoiceAggregateCategory/{{cidKey}}" id="up" method="get">
 					<ul class="cateList">
-						<li><select>
+						<li><select name="year" id="Y" onchange="receiptYear();">
 	<!-- include 'year' -->
 </select></li>
 						<li>开票总计:¥{{isList.statisticsYear.0.invoicePrice}}</li>
 						<li>收款总计:¥{{isList.statisticsYear.0.receivablesPrice}}</li>
 						<li>完成入账:¥{{isList.statisticsYear.0.accountPrice}}</li>
 					</ul>
+					</form>
 				</div>
 				<div class="saeaList">
 					<div class="entry autoHeightI2" style="margin-bottom:0">

+ 4 - 1
protected/view/admin/invoiceAggregateStaff.html

@@ -1,6 +1,7 @@
 <!-- include 'header' -->
 <link rel=stylesheet href="<?= WEB_SITE_GLOBAL ?>css/fixedheadertable.css">
 <script src="<?= WEB_SITE_GLOBAL ?>js/jquery.fixedheadertable.js"></script>
+<script src="<?= WEB_SITE_GLOBAL ?>js/invoice.js"></script>
 <body>
 	<div class="mainLayout">
 		<div class="mainMenu">
@@ -23,15 +24,17 @@
 					员工 全年开票收款汇总
 				</legend>
 				<div class="demandCate">
+					<form action="/invoiceAggregateStaff" id="up" method="post">
 					<ul class="cateList">
 						<li><a href="/invoiceAggregate">办事处</a><a href="javascript:void(0)" class="now">员工</a></li>
-						<li><select>
+						<li><select name="year" id="Y" onchange="receiptYear();">
 								<!-- include 'year' -->
 							</select></li>
 						<li>开票总计:¥{{isList.statisticsYear.0.invoicePrice}}</li>
 						<li>收款总计:¥{{isList.statisticsYear.0.receivablesPrice}}</li>
 						<li>完成入账:¥{{isList.statisticsYear.0.accountPrice}}</li>
 					</ul>
+					</form>
 				</div>
 				<div class="saeaList">
 					<div class="entry autoHeightI2" style="margin-bottom:0">

+ 39 - 109
protected/view/admin/invoiceApproval.html

@@ -1,4 +1,5 @@
 <!-- include 'header' -->
+<script src="<?= WEB_SITE_GLOBAL ?>js/invoice.js"></script>
 <body>
 	<div class="mainLayout">
 		<div class="mainMenu">
@@ -31,7 +32,7 @@
                                 <tr><th class="taC">开票流水号</th><th class="taC">开票单位(抬头)</th><th class="taC">开票金额</th><th class="taC">提交开票</th><th class="taC">上一位审批</th><th class="taC" width="120">操作</th></tr>
                                 <!-- loop invoiceList -->
                                 <tr>
-                                    <td><a href="#invdetail" data-toggle="modal">{{invoiceList' value.invoiceSerial}}</a></td>
+                                    <td><a href="#invdetail" node-invoice='INFO' data-isKey="{{invoiceList' value.iidKey}}" data-toggle="modal">{{invoiceList' value.invoiceSerial}}</a></td>
                                     <td>
                                     <!-- if !empty({{invoiceList' value.invoiceType}}) -->
                                    	{{invoiceList' value.invoiceCompany}}
@@ -60,128 +61,57 @@
                         </div>
                         
                         <div class="clearfix">
+                        	<!-- if !empty({{ilist}}) -->
                             <legend><div class="fR"><a href="invoice-approval-all.html">查看更多</a></div>最近审批完成</legend>
                             <table class="table table-bordered table-condensed">
                                 <tbody>
                                 <tr><th class="taC">开票流水号</th><th class="taC">开票单位(抬头)</th><th class="taC">开票金额</th><th class="taC">提交开票</th><th class="taC">完成审批</th></tr>
+                                <!-- loop ilist -->
                                 <tr>
-                                    <td><a href="#invdetail" data-toggle="modal">#F20160316001</a></td>
-                                    <td>珠海XXXX公司</td>
-                                    <td><b>¥3000.00</b></td>
-                                    <td>广东办刘飞 2016-03-03 12:20:20</td>
-                                    <td><span class="colGreen">同意</span> 黄爱玲 2016-03-03 12:20:20</td>
-                                </tr>
-                                <tr>
-                                    <td><a href="#invdetail" data-toggle="modal">#F20160316001</a></td>
-                                    <td>珠海XXXX公司</td>
-                                    <td><b>¥3000.00</b><sup>专</sup></td>
-                                    <td>广东办刘飞 2016-03-03 12:20:20</td>
-                                    <td><span class="colOrange">退回</span> 黄爱玲 2016-03-03 12:20:20</td>
-                                </tr>
-                                <tr>
-                                    <td><a href="#invdetail" data-toggle="modal">#F20160316001</a></td>
-                                    <td>珠海XXXX公司</td>
-                                    <td><b>¥3000.00</b><sup>专</sup></td>
-                                    <td>广东办刘飞 2016-03-03 12:20:20</td>
-                                    <td><span class="colRed">终止</span> 黄爱玲 2016-03-03 12:20:20</td>
+                                    <td><a href="#invdetail" node-invoice='INFO' data-isKey="{{pendingInvoice' value.iidKeyK}}" data-toggle="modal">{{ilist' value.invoiceSerial}}</a></td>
+                                    <td>
+										<!-- if !empty({{ilist' value.invoiceType}}) -->
+	                                   	{{ilist' value.invoiceCompany}}
+	                                    <!-- else -->
+	                                    {{ilist' value.invoiceTitle}}
+	                                    <!-- endif -->
+										
+									</td>
+                                    <td>
+									<!-- if !empty({{ilist' value.invoiceType}}) -->
+	                                    <b>¥{{ilist' value.invoicePrice}}</b><sup>专</sup>
+	                                    <!-- else -->
+	                                    <b>¥{{ilist' value.invoicePrice}}</b>
+	                                    <!-- endif -->
+									</td>
+                                    <td>{{ilist' value.categoryName}} {{ilist' value.userName}} {{ilist' value.date}}</td>
+                                    <td>
+                                    <!-- if {{ilist' value.operationLog.status}}==2 -->
+                                    <span class="colGreen">同意</span> 
+                                   <!-- elseif {{ilist' value.operationLog.status}}==3 -->
+                                   <span class="colOrange">退回</span>
+                                   <!-- elseif {{ilist' value.operationLog.status}}==4 -->
+                                   <span class="colRed">终止</span>
+                                   <!-- endif -->
+                                    	{{ilist' value.operationLog.username}} {{ilist' value.operationLog.date}}</td>
                                 </tr>
+                                 <!-- endloop -->
+                                
                                 </tbody>
                             </table>
+                            <!-- else -->
                             <blockquote><p class="colGray">暂时没有已审批的开票</p></blockquote>
+                            <!-- endif -->
                         </div>
                     </div>
                 </div>
 			</div>
 		</div>
 	</div>
-    <!--弹出(发票详情)-->
-<div class="modal hide fade" id="invdetail">
-    <div class="modal-dialog modal-lg">
-        <div class="modal-content">
-    <div class="modal-header">
-        <h3>发票单详情</h3>
-    </div>
-    <div class="modal-body">
-        <table class="table">
-            <thead>
-            <tr><td><span class="contactsTag tagCol-05">审核中</span></td><td colspan="3">2016-11-01 11:03:03<br>张少珊:审批意见</td></tr>
-            <tr><td><span class="contactsTag tagCol-02">出票中</span></td><td colspan="3">2016-11-01 11:03:03<br>赵淑燕:可以打印</td></tr>
-            <tr><td><span class="contactsTag tagCol-07">退回</span></td><td colspan="3" class="colRed">2016-11-01 11:03:03<br>赵淑燕:申请金额有误</td></tr>
-            <tr><td><span class="contactsTag tagCol-02">已出票</span></td><td colspan="3">赵淑燕 2016-11-01 11:03:03</td></tr>
-            <tr><td><span class="contactsTag tagCol-02">已出票</span></td><td colspan="3">张少珊 2016-11-01 11:03:03<br>圆通速运:1231243255232323</td></tr>
-            <tr><td><span class="contactsTag tagCol-04">终止</span></td><td colspan="3" class="colRed">2016-11-01 11:03:03<br>赵淑燕:终止意见</td></tr>
-            <tr><td><span class="contactsTag tagCol-06">作废</span></td><td colspan="3" class="colRed">2016-11-01 11:03:03<br>赵淑燕:作废意见</td></tr>
-            <tr><td><span class="contactsTag tagCol-01">入账完成</span></td><td colspan="3" class="">2016-11-01 11:03:03<br></td></tr>
-            </thead>
-            <tr>
-                <th>申请单号</th><td>#F20160316001</td>
-                <th>提交时间</th><td>2016-03-01 12:30:01</td>
-            </tr>
-            <tr><th width="50">金额</th><td colspan="3"><b class="colOrange">¥3000.00</b></td>
-            </tr>
-            <tr><th width="50">发票类型</th><td>普通发票</td>
-                <th width="50">开票内容</th><td>纵横公路工程造价管理系统V9.0</td>
-            </tr>
-            <!--普通发票-->
-            <tr><th width="50">发票抬头</th><td colspan="3">珠海纵横创建软件有限公司</td>
-            </tr>
-            <!--增值税发票-->
-            <tr><th width="50">单位名称</th><td>珠海纵横创建软件有限公司</td>
-                <th width="60" title="纳税人识别码">识别码</th><td>1212123123123</td>
-            </tr>
-            <tr>
-                <th width="50">注册地址</th><td>广东省珠海市香洲区银桦路8号24D</td>
-                <th width="50">注册电话</th><td>0756-34324</td>
-            </tr>
-            <tr>
-                <th width="50">开户银行</th><td>广发银行</td>
-                <th width="50">银行账号</th><td>234324234</td>
-            </tr>
-
-            <tr>
-                <th>备注</th><td colspan="3">备注内容</td>
-            </tr>
-        </table>
-        <table class="table">
-            <thead><tr><th width="50">邮寄信息</th><td></td>
-                <th width="60"></th><td></td></tr></thead>
-            <tr>
-            </tr>
-            <tr>
-                <th>地址</th><td colspan="3">广东省珠海市XXX路XXX号</td>
-            </tr>
-            <tr>
-                <th>收件人</th><td>陈工</td>
-                <th>手机/电话</th><td>12345678901</td>
-            </tr>
-            <tr>
-                <th>邮寄物品</th><td colspan="3">合同x1、锁套装x1</td>
-            </tr>
-        </table>
-        <table class="table">
-            <thead><tr><th width="50">收款信息</th><td></td>
-                <th width="60"></th><td></td></tr></thead>
-            <tr>
-            </tr>
-            <tr>
-                <th>收款金额</th><td>¥200000.00</td>
-                <th>收款信息</th><td>陈宇</td>
-            </tr>
-            <tr>
-                <th>收款银行</th><td>广发银行珠海分行柠溪支行</td>
-                <th>银行到帐</th><td>2016-04-11</td>
-            </tr>
-            <tr>
-                <th>录入收款</th><td>张少珊<br>2015-04-12 11:30:02</td>
-                <th>认领收款</th><td>张少珊 转入 陈特<br>2015-04-12 11:30:02</td>
-            </tr>
-        </table>
-    </div>
-    <div class="modal-footer">
-        <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
-    </div>
-            </div></div>
-</div>
-    <!--弹出内容-->      	
+	<div loading-msg='true' style="position:absolute;  left:50%;  top:50%;  "></div>
+    <div class="modal  fade" id="invdetail">
+		
+		<div id="nc"></div>
+	</div>    	
 <script type="text/javascript">autoFlashHeight();</script>	
 </body>

+ 3 - 0
protected/view/admin/invoiceMenu.html

@@ -32,5 +32,8 @@
 <!-- if isInvoiceMoldShow({{staff.0.sid}},'发票退票') -->
 	<li><a <!-- if {{receiptMemu}}=="invoiceUntread" --> class="selected" <!-- endif --> href="/invoiceUntread">发票退票</a></li>
 <!-- endif -->	
+
+<!-- if isInvoiceMoldShow({{staff.0.sid}},'公司汇总查阅') -->
 	<li><a <!-- if {{receiptMemu}}=="invoiceAggregate" --> class="selected" <!-- endif --> href="/invoiceAggregate">公司汇总</a></li>
+	<!-- endif -->
 </ul>

+ 15 - 5
protected/view/admin/invoiceMyReceivables.html

@@ -25,9 +25,11 @@
 						<div class="clearfix">
 							<table class="table table-bordered table-condensed">
 								<tbody>
-								<tr><th class="taC">本月累计收款</th><td>¥3999.00</td><th class="taC">本月累计入账</th><td>¥3999.00</td></tr>
-								<tr><th class="taC">10月累计收款</th><td>¥838,273.00</td><th class="taC">10月累计入账</th><td>¥838,273.00</td></tr>
-								<tr><th class="taC">今年累计收款</th><td>¥209,484,765.00</td><th class="taC">今年累计入账</th><td>¥209,484,765.00</td></tr>
+								<tr><th class="taC">本月累计开票</th><td>¥{{isMonth.statisticsMonth.0.invoicePrice}}</td>
+									<th class="taC">本月累计入账</th><td>¥{{isMonth.statisticsMonth.0.accountPrice}}</td></tr>
+									{{htm}}
+									<tr><th class="taC">今年累计开票</th><td>¥{{isMonth.statisticsYear.0.invoicePrice}}</td>
+									<th class="taC">今年累计入账</th><td>¥{{isMonth.statisticsYear.0.accountPrice}}</td></tr>
 								</tbody>
 
 							</table>
@@ -70,9 +72,9 @@
 								<tr>
 									<td>{{bindClaim' value.receivablesMessage}}</td>
 									<td><b>¥{{bindClaim' value.receivablesPrice}}</b></td>
-									<td><a href="#" data-toggle="modal">{{bindClaim' value.receivablesSerial}}</a></td>
+									<td><a href="#billing" node-invoice='INFO' data-type="receivables" data-isKey="{{receivablesList' value.iridKeyUrl}}" data-toggle="modal">{{bindClaim' value.receivablesSerial}}</a></td>
 									<td><b>¥{{bindClaim' value.invoice.invoicePrice}}</b></td>
-									<td><a href="#invdetail" data-toggle="modal">{{bindClaim' value.invoice.invoiceSerial}}</a></td>
+									<td><a href="#invdetail" node-invoice='INFO' data-isKey="{{receivablesList' value.invoice.iidKeyUrl}}"  data-toggle="modal">{{bindClaim' value.invoice.invoiceSerial}}</a></td>
 									<td>{{bindClaim' value.bindDate}}</td>
 								</tr>
 								<!-- endloop -->
@@ -88,6 +90,14 @@
 			</div>
 		</div>
 	</div>
+	<div loading-msg='true' style="position:absolute;  left:50%;  top:50%;  "></div>
+	<div class="modal  fade" id="invdetail">
+		
+		<div id="nc"></div>
+	</div>
+	<div class="modal  fade" id="billing">
+		<div id="nr"></div>
+	</div>
 	<!--弹出入账-->
 	<div class="modal hide fade" id="recorded">
 		<form action="/invoiceBindReceivables" method="post" >

+ 8 - 2
protected/view/admin/invoicePost.html

@@ -43,7 +43,7 @@
 									</tr>
 									<!-- loop invoicePost -->
 									<tr>
-										<td><a href="#invdetail" data-toggle="modal">{{invoiceList' value.invoiceSerial}}</a></td>
+										<td><a href="#invdetail" node-invoice='INFO' data-isKey="{{invoiceList' value.iidKeyK}}" data-toggle="modal">{{invoiceList' value.invoiceSerial}}</a></td>
 										<td>
 											<!-- if !empty({{invoiceList' value.invoiceType}}) -->
 											{{invoiceList' value.invoiceCompany}} <!-- else -->
@@ -91,7 +91,7 @@
 									</tr>
 									<!-- loop invoicePosted -->
 									<tr>
-										<td><a href="#invdetail" data-toggle="modal">{{invoiceList' value.invoiceSerial}}</a></td>
+										<td><a href="#invdetail" node-invoice='INFO' data-isKey="{{invoiceList' value.iidKeyK}}" data-toggle="modal">{{invoiceList' value.invoiceSerial}}</a></td>
 										<td>
 											<!-- if !empty({{invoiceList' value.invoiceType}}) -->
 											{{invoiceList' value.invoiceCompany}} <!-- else -->
@@ -194,6 +194,12 @@
 		</div>
 	</div>
 	<!--邮寄-->
+	
+	<div loading-msg='true' style="position:absolute;  left:50%;  top:50%;  "></div>
+    <div class="modal  fade" id="invdetail">
+		
+		<div id="nc"></div>
+	</div>
 	<!--弹出快递跟踪-->
 	<div class="modal hide fade" id="shipping">
 		<div class="modal-dialog">

+ 7 - 80
protected/view/admin/invoicePrint.html

@@ -1,4 +1,5 @@
 <!-- include 'header' -->
+<script src="<?= WEB_SITE_GLOBAL ?>js/invoice.js"></script>
 <body>
 	<div class="mainLayout">
 		<div class="mainMenu">
@@ -32,7 +33,7 @@
 								<tr><th class="taC">开票流水号</th><th class="taC">开票单位(抬头)</th><th class="taC">开票金额</th><th class="taC">提交开票</th><th class="taC">完成审批</th><th class="taC" width="120">操作</th></tr>
 								<!-- loop toPrint -->
                                 <tr>
-                                    <td><a href="#invdetail" data-toggle="modal">{{invoiceList' value.invoiceSerial}}</a></td>
+                                    <td><a href="#invdetail" node-invoice='INFO' data-isKey="{{invoiceList' value.iidKey}}" data-toggle="modal">{{invoiceList' value.invoiceSerial}}</a></td>
                                     <td>
                                     <!-- if !empty({{invoiceList' value.invoiceType}}) -->
                                    	{{invoiceList' value.invoiceCompany}}
@@ -68,7 +69,7 @@
 								<tr><th class="taC">开票流水号</th><th class="taC">开票单位(抬头)</th><th class="taC">开票金额</th><th class="taC">提交开票</th><th class="taC">发票号</th><th class="taC">打印发票</th></tr>
 								<!-- loop printed -->
                                 <tr>
-                                    <td><a href="#invdetail" data-toggle="modal">{{invoiceList' value.invoiceSerial}}</a></td>
+                                    <td><a href="#invdetail" node-invoice='INFO' data-isKey="{{invoiceList' value.iidKey}}" data-toggle="modal">{{invoiceList' value.invoiceSerial}}</a></td>
                                     <td>
                                     <!-- if !empty({{invoiceList' value.invoiceType}}) -->
                                    	{{invoiceList' value.invoiceCompany}}
@@ -100,85 +101,11 @@
 			</div>
 		</div>
 	</div>
-	<!--弹出(发票详情)-->
-<div class="modal hide fade" id="invdetail">
-    <div class="modal-header">
-    <h3>发票单详情</h3>
-    </div>
-    <div class="modal-body">
-    	<table class="table">
-    		<thead>
-    			<tr><td><span class="contactsTag tagCol-02">已出票</span></td><td colspan="3">黄爱玲 邮寄 2016-11-01 11:03:03<br>圆通速运:1231243255232323</td></tr>
-    		</thead>
-			<tr>
-				<th>申请单号</th><td>#F20160316001</td>
-				<th>提交时间</th><td>2016-03-01 12:30:01</td>
-			</tr>
-    		<tr><th width="50">金额</th><td><b class="colOrange">¥3000.00</b>
-				<th width="50">发票号</th><td>No.07957263</td></td>
-    		</tr>
-    		<tr><th width="50">发票类型</th><td>普通发票</td>
-    			<th width="50">开票内容</th><td>纵横公路工程造价管理系统V9.0</td>
-    		</tr>
-    		<!--普通发票-->
-    		<tr><th width="50">发票抬头</th><td colspan="3">珠海纵横创建软件有限公司</td>
-    		</tr>
-    		<!--增值税发票-->
-    		<tr><th width="50">单位名称</th><td>珠海纵横创建软件有限公司</td>
-    			<th width="60" title="纳税人识别码">识别码</th><td>1212123123123</td>
-    		</tr>
-    		<tr>
-    			<th width="50">注册地址</th><td>广东省珠海市香洲区银桦路8号24D</td>
-    			<th width="50">注册电话</th><td>0756-34324</td>
-    		</tr>
-    		<tr>
-    			<th width="50">开户银行</th><td>广发银行</td>
-    			<th width="50">银行账号</th><td>234324234</td>
-    		</tr>
-    		<tr>
-    			<th>备注</th><td colspan="3">备注内容</td>
-    		</tr>
-    	</table>
-    	<table class="table">
-    		<thead><tr><th width="50">邮寄信息</th><td></td>
-    			<th width="60"></th><td></td></tr></thead>
-    		<tr>
-    		</tr>
-    		<tr>
-    			<th>地址</th><td colspan="3">广东省珠海市XXX路XXX号</td>
-    		</tr>
-    		<tr>
-    			<th>收件人</th><td>陈工</td>
-    			<th>手机/电话</th><td>12345678901</td>
-    		</tr>
-            <tr>
-                <th>申请物品</th><td colspan="3">合同x1、锁套装x1</td>
-            </tr>
-    	</table>
-    	<table class="table">
-    		<thead><tr><th width="50">收款信息</th><td></td>
-    			<th width="60"></th><td></td></tr></thead>
-    		<tr>
-    		</tr>
-    		<tr>
-    			<th>收款金额</th><td>¥200000.00</td>
-    			<th>收款信息</th><td>陈宇</td>
-    		</tr>
-    		<tr>
-    			<th>收款银行</th><td>广发银行珠海分行柠溪支行</td>
-    			<th>银行到帐</th><td>2016-04-11</td>
-    		</tr>
-    		<tr>
-    			<th>录入收款</th><td>张少珊<br>2015-04-12 11:30:02</td>
-    			<th>认领收款</th><td>张少珊 转入 陈特<br>2015-04-12 11:30:02</td>
-    		</tr>
-    	</table>
-    </div>
-	<div class="modal-footer">
-	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
+	<div loading-msg='true' style="position:absolute;  left:50%;  top:50%;  "></div>
+    <div class="modal  fade" id="invdetail">
+		
+		<div id="nc"></div>
 	</div>
-</div>
-    <!--弹出内容-->   
 
     <!--弹出(打印发票)-->
 <div class="modal hide fade" id="editprint">

+ 7 - 3
protected/view/admin/invoiceUntread.html

@@ -31,7 +31,7 @@
 								
 								<!-- loop untreadInvoice -->
                                 <tr>
-                                    <td><a href="#invdetail" data-toggle="modal">{{invoiceList' value.invoiceSerial}}</a></td>
+                                    <td><a href="#invdetail" node-invoice='INFO' data-isKey="{{invoiceList' value.iidKeyK}}" data-toggle="modal">{{invoiceList' value.invoiceSerial}}</a></td>
                                     <td>
                                     <!-- if !empty({{invoiceList' value.invoiceType}}) -->
                                    	{{invoiceList' value.invoiceCompany}}
@@ -68,7 +68,7 @@
 								
 								<!-- loop establishedInvoice -->
                                 <tr>
-                                    <td><a href="#invdetail" data-toggle="modal">{{invoiceList' value.invoiceSerial}}</a></td>
+                                    <td><a href="#invdetail" node-invoice='INFO' data-isKey="{{invoiceList' value.iidKeyK}}" data-toggle="modal">{{invoiceList' value.invoiceSerial}}</a></td>
                                     <td>
                                     <!-- if !empty({{invoiceList' value.invoiceType}}) -->
                                    	{{invoiceList' value.invoiceCompany}}
@@ -103,7 +103,11 @@
 			</div>
 		</div>
 	</div>
-
+<div loading-msg='true' style="position:absolute;  left:50%;  top:50%;  "></div>
+    <div class="modal  fade" id="invdetail">
+		
+		<div id="nc"></div>
+	</div>
 	<!--弹出退票确认-->
 <div class="modal hide fade" id="return">
 <form action="/invoiceUntreadEstablishedDo" method="post" name="untreadInvoice">