caipin hace 8 años
padre
commit
42038ae275

+ 40 - 12
global/js/invoice.js

@@ -1,3 +1,5 @@
+
+
 $(function() {
 	
 	$('a[node-express="untread"]').click(function() {
@@ -143,6 +145,10 @@ $(function() {
 	
 	$('a[node-recording="true"]').click(function() {
 		var postData =  $(this).attr("data-key");
+		$("input[name='key']").val(postData);
+		$("input[name='invoiceKey']").val("");
+		$("p[node-msg='true']").hide();
+		$('tbody[data-invoice="myClaim"]').html("");
 		var url = "/ajaxGetInvoiceByStaff";
 		$.ajax({
 			url : url,
@@ -154,23 +160,45 @@ $(function() {
 			},
 			global : true,
 			success : function(data) {
-//				if (data.status == 1) {
-//					$("input[name='key']").val(postData);
-//					
-//					$("td[node-receivablesSerial]").html(data.detail.receivablesSerial);
-//					$("td[node-inputStaff]").html(data.detail.inputStaff+" "+data.detail.date);
-//					$("td[node-price]").html("<b>"+data.detail.receivablesPrice+"</b>");
-//					$("td[node-message]").html(data.detail.receivablesMessage);
-//					$("td[node-bank]").html(data.detail.receivablesBank);
-//					$("td[node-date]").html(data.detail.receivablesDate);
-//				} 
-				//else
-				//	$("div[loading-msg='true']").html("illegal request");
+				if (data.status == 1) {
+					$('tbody[data-invoice="myClaim"]').html(data.html);
+				} 
 			},
 			error : function(err) {
 			}
 		});
 	});
 	
+	$('a[node-receivalbles="bind"]').click(function() {
+		var postData =  $(this).attr("diss-data");
+		
+		$("input[name='key']").val(postData);
+		$("input[name='invoiceKey']").val("");
+		$("p[node-msg='true']").hide();
+		$('tbody[data-invoice="myReceivables"]').html("");
+		
+		var url = "/ajaxGetReceivalblesByStaff";
+		$.ajax({
+			url : url,
+			type : "post",
+			cache : false,
+			dataType : "json",
+			data : {
+				key : postData
+			},
+			global : true,
+			success : function(data) {
+				if (data.status == 1) {
+					$('tbody[data-invoice="myReceivables"]').html(data.html);
+				} 
+			},
+			error : function(err) {
+			}
+		});
+	});
+	
+	
+	
+	
 	
 })

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

@@ -373,12 +373,15 @@ $route['get']['/invoiceReceivablesClaim'] = array('InvoiceController', 'invoiceR
 $route['post']['/invoiceReceivablesDo'] = array('InvoiceController', 'invoiceReceivablesDo');
 $route['post']['/invoiceReceivablesAscription'] = array('InvoiceController', 'invoiceReceivablesAscription');
 $route['get']['/invoiceMyReceivables'] = array('InvoiceController', 'invoiceMyReceivables');
+$route['post']['/invoiceBindReceivables'] = array('InvoiceController', 'invoiceBindReceivables');
 
 
 $route['post']['/ajaxGetInvoicePostDetail'] = array('InvoiceController', 'ajaxGetInvoicePostDetail');
 $route['post']['/ajaxGetStaffByCategory'] = array('InvoiceController', 'ajaxGetStaffByCategory');
 $route['post']['/ajaxGetInvoiceReceivables'] = array('InvoiceController', 'ajaxGetInvoiceReceivables');
 $route['post']['/ajaxGetInvoiceByStaff'] = array('InvoiceController', 'ajaxGetInvoiceByStaff');
+$route['post']['/ajaxCompareClaimPrice'] = array('InvoiceController', 'ajaxCompareClaimPrice');
+$route['post']['/ajaxGetReceivalblesByStaff'] = array('InvoiceController', 'ajaxGetReceivalblesByStaff');
 
 
 //假期管理

+ 217 - 45
protected/controller/InvoiceController.php

@@ -875,11 +875,11 @@ class InvoiceController extends DooController {
 	function invoiceReceivables() {
 		Doo::loadModel ( 'L_category' );
 		$lCategory = new L_category ();
-		Doo::loadModel('staff');
-		$staff=new staff();
+		Doo::loadModel ( 'staff' );
+		$staff = new staff ();
 		
 		$category = $lCategory->getCategory ();
-		$staffList = $staff->getStaffByCid($this->staff[0]['cid']);
+		$staffList = $staff->getStaffByCid ( $this->staff [0] ['cid'] );
 		
 		$data ['staffList'] = $staffList;
 		$data ['category'] = $category;
@@ -895,7 +895,6 @@ class InvoiceController extends DooController {
 	 * @return string
 	 */
 	function invoiceReceivablesDo() {
-		
 		$receivablesPrice = $this->get_args ( 'receivablesPrice' ) ? $this->get_args ( 'receivablesPrice' ) : "";
 		$receivablesMessage = $this->get_args ( 'receivablesMessage' ) ? $this->get_args ( 'receivablesMessage' ) : "";
 		$receivablesBank = $this->get_args ( 'receivablesBank' ) ? $this->get_args ( 'receivablesBank' ) : "";
@@ -909,17 +908,17 @@ class InvoiceController extends DooController {
 		if (! empty ( $receivablesPrice ) && ! empty ( $receivablesMessage ) && ! empty ( $receivablesBank ) && ! empty ( $receivablesDate ) && ! empty ( $receivablesCategory ) && ! empty ( $receivablesStaff )) {
 			
 			$item = array (
-					'receivablesPrice' =>$receivablesPrice,
-					'receivablesMessage' =>$receivablesMessage,
-					'receivablesSerial' =>"#SK" . date ( "Ymd" ) . mt_rand ( 1000, 9999 ),
-					'receivablesBank' =>$receivablesBank,
-					'receivablesDate' =>$receivablesDate,
-					'inputStaff' =>$this->staff[0]['username'],
+					'receivablesPrice' => $receivablesPrice,
+					'receivablesMessage' => $receivablesMessage,
+					'receivablesSerial' => "#SK" . date ( "Ymd" ) . mt_rand ( 1000, 9999 ),
+					'receivablesBank' => $receivablesBank,
+					'receivablesDate' => $receivablesDate,
+					'inputStaff' => $this->staff [0] ['username'],
 					
-					'receivablesCategory' =>$receivablesCategory,
-					'receivablesStaff' => $receivablesStaff
+					'receivablesCategory' => $receivablesCategory,
+					'receivablesStaff' => $receivablesStaff 
 			);
-			$irid = $invoiceReceivables->addInvoiceReceivables( $item );
+			$irid = $invoiceReceivables->addInvoiceReceivables ( $item );
 		}
 		
 		return "/invoiceReceivables";
@@ -927,11 +926,11 @@ class InvoiceController extends DooController {
 	/**
 	 * 收款认领页面-包括公共认领 办事处认领 最近已认领数据
 	 */
-	function invoiceReceivablesClaim(){
+	function invoiceReceivablesClaim() {
 		Doo::loadModel ( 'invoiceReceivables' );
 		$invoiceReceivables = new invoiceReceivables ();
 		
-		$receivablesList=$invoiceReceivables->getInvoiceReceivablesByClaim($this->staff[0]['cid']);
+		$receivablesList = $invoiceReceivables->getInvoiceReceivablesByClaim ( $this->staff [0] ['cid'] );
 		
 		$data ['receivablesList'] = $receivablesList;
 		
@@ -944,35 +943,34 @@ class InvoiceController extends DooController {
 	/**
 	 * 管理员录入的收款 ,确认认领到谁的名下
 	 */
-	function invoiceReceivablesAscription(){
+	function invoiceReceivablesAscription() {
 		$irid = $this->get_args ( 'key' ) ? $this->get_args ( 'key' ) : "";
 		Doo::loadModel ( 'invoiceReceivables' );
 		$invoiceReceivables = new invoiceReceivables ();
 		
-		$detail=$invoiceReceivables->getInvoiceReceivablesByIrid($irid);
+		$detail = $invoiceReceivables->getInvoiceReceivablesByIrid ( $irid );
 		
-		if (!empty($detail)&&$detail['receivablesStaff']=='PUBLIC'){
+		if (! empty ( $detail ) && $detail ['receivablesStaff'] == 'PUBLIC') {
 			$item = array (
-				'irid' =>$detail['irid'],
-				'receivablesCategory' =>$this->staff[0]['cid'].":".$this->staff[0]['category'],
-				'receivablesStaff' => $this->staff[0]['sid']."-".$this->staff[0]['username'],
-				'confirmTime' => date ( "Y-m-d H:i:s" ),
-				'source' =>1
+					'irid' => $detail ['irid'],
+					'receivablesCategory' => $this->staff [0] ['cid'] . ":" . $this->staff [0] ['category'],
+					'receivablesStaff' => $this->staff [0] ['sid'] . "-" . $this->staff [0] ['username'],
+					'confirmTime' => date ( "Y-m-d H:i:s" ),
+					'source' => 1 
 			);
-			$invoiceReceivables->setInvoiceReceivablesByCondition( $item );
+			$invoiceReceivables->setInvoiceReceivablesByCondition ( $item );
 		}
 		
 		return "/invoiceReceivablesClaim";
 	}
 	
 	/**
-	 * 
 	 */
-	function invoiceMyReceivables(){
+	function invoiceMyReceivables() {
 		Doo::loadModel ( 'invoiceReceivables' );
 		$invoiceReceivables = new invoiceReceivables ();
 		
-		$list=$invoiceReceivables->getInvoiceReceivablesByClaim($this->staff[0]['cid'],$this->staff[0]['sid']);
+		$list = $invoiceReceivables->getInvoiceReceivablesByClaim ( $this->staff [0] ['cid'], $this->staff [0] ['sid'] );
 		
 		$data ['list'] = $list;
 		
@@ -983,33 +981,149 @@ class InvoiceController extends DooController {
 	}
 	
 	/**
+	 * 收款绑定发票 ,一个收款只能绑定一个发票
+	 */
+	function invoiceBindReceivables(){
+		$claimKey = $this->get_args ( 'key' ) ? $this->get_args ( 'key' ) : "";
+		$invoiceKey = $this->get_args ( 'invoiceKey' ) ? $this->get_args ( 'invoiceKey' ) : "";
+		
+		Doo::loadModel ( 'invoice' );
+		$invoice = new invoice ();
+		Doo::loadModel ( 'invoiceReceivables' );
+		$invoiceReceivables = new invoiceReceivables ();
+		
+		$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>');
+		}
+		
+		$item = array (
+				'irid' => $detailM['irid'],
+				'bindStatus' => 1,
+				'iid' => $detail['iid'],
+				'bindDate'=>date ( "Y-m-d H:i:s" )
+		);
+		$invoiceReceivables->setInvoiceReceivablesByCondition($item);
+		
+		$iridString="";
+		if (empty($detail['irid']))
+			$iridString=$detailM['irid'];
+		else 
+			$iridString=$detail['irid'].','.$detailM['irid'];
+		$item = array (
+				'iid' => $detail['iid'],
+				'irid' => $iridString
+		);
+		$invoice->setInvoiceByCondition($item);
+		return "/invoiceMyReceivables";
+	}
+	
+	/**
 	 * 获得与我有关可收款的发票
 	 */
-	function ajaxGetInvoiceByStaff(){
+	function ajaxGetInvoiceByStaff() {
 		$irid = $this->get_args ( 'key' ) ? $this->get_args ( 'key' ) : "";
 		Doo::loadModel ( 'invoice' );
 		$invoice = new invoice ();
 		
-		$list=$invoice->getInvoiceByReceivables($this->staff[0]['sid']);
+		$list = $invoice->getInvoiceByReceivables ( $this->staff [0] ['sid'] );
+		
+		$html = "";
+		foreach ( $list as $key => $value ) {
+			$html .= '<tr>
+					<td>' . $value ['invoiceElement'] . '</td>
+					<td>¥' . $value ['invoicePrice'] . '</td>';
+			if (! empty ( $value ['invoiceType'] )) {
+				$html .= '<td>增值税专用发票</td>
+							<td>' . $value ['invoiceCompany'] . '</td>';
+			} else {
+				$html .= '<td>增值税普通发票</td>
+							<td>' . $value ['invoiceTitle'] . '</td>';
+			}
+			
+			$html .= '<td><label><input type="radio" node-Claim="true" p-data="'.$value ['iidKey'].'" name="invoiceClaim"> 使用Ta</label></td></tr>
+					<script>
+					$(\'input[node-Claim="true"]\').click(function() {
+					
+						var invoiceKey=  $(this).attr("p-data");
+						var claimKey=$("input[name=\'key\']").val();
+						$("p[node-msg=\"true\"]").hide();
+						var url = "/ajaxCompareClaimPrice";
+						$.ajax({
+							url : url,
+							type : "post",
+							cache : false,
+							dataType : "json",
+							data : {
+								claimKey : claimKey,
+								invoiceKey:invoiceKey
+							},
+							global : true,
+							success : function(data) {
+								$("input[name=\'invoiceKey\']").val("'.$value ['iidKey'].'");
+								if (data.status == 1) {
+									
+									$("p[node-msg=\"true\"]").html("收款金额超出开票金额 ¥"+data.price+"元,请谨慎操作。");
+									$("p[node-msg=\"true\"]").show();
+								}
+							},
+							error : function(err) {
+							}
+						});
+					});
+					</script>
+					';
+		}
+		
 		echo json_encode ( array (
 				'status' => 1,
-				'list' => $list
+				'html' => $html 
 		) );
 	}
 	
+	function ajaxCompareClaimPrice(){
+		$claimKey = $this->get_args ( 'claimKey' ) ? $this->get_args ( 'claimKey' ) : "";
+		$invoiceKey = $this->get_args ( 'invoiceKey' ) ? $this->get_args ( 'invoiceKey' ) : "";
+		
+		Doo::loadModel ( 'invoice' );
+		$invoice = new invoice ();
+		Doo::loadModel ( 'invoiceReceivables' );
+		$invoiceReceivables = new invoiceReceivables ();
+		
+		$detail=$invoice->getInvoiceByIid($invoiceKey);
+		$detailM=$invoiceReceivables->getInvoiceReceivablesByIrid($claimKey);
+		
+		if ($detailM['receivablesPrice']>=$detail['invoicePrice']){
+			$price=$detailM['receivablesPrice']-$detail['invoicePrice'];
+			echo json_encode ( array (
+					'status' => 1,
+					'price'=>$price
+			) );
+		}else 
+			echo json_encode ( array (
+					'status' => 2
+			) );
+	}
+	
 	/**
 	 * 获取一条收款信息
 	 */
-	function ajaxGetInvoiceReceivables(){
+	function ajaxGetInvoiceReceivables() {
 		$irid = $this->get_args ( 'key' ) ? $this->get_args ( 'key' ) : "";
 		Doo::loadModel ( 'invoiceReceivables' );
 		$invoiceReceivables = new invoiceReceivables ();
 		
-		$detail=$invoiceReceivables->getInvoiceReceivablesByIrid($irid);
+		$detail = $invoiceReceivables->getInvoiceReceivablesByIrid ( $irid );
 		
 		echo json_encode ( array (
 				'status' => 1,
-				'detail' => $detail
+				'detail' => $detail 
 		) );
 	}
 	
@@ -1018,13 +1132,13 @@ class InvoiceController extends DooController {
 	 */
 	function ajaxGetStaffByCategory() {
 		$cid = $this->get_args ( 'cid' ) ? $this->get_args ( 'cid' ) : "";
-		Doo::loadModel('staff');
-		$staff=new staff();
-	
-		if ($cid=="PUBLIC"){
+		Doo::loadModel ( 'staff' );
+		$staff = new staff ();
+		
+		if ($cid == "PUBLIC") {
 			echo json_encode ( array (
 					'status' => 1,
-					'html' => '<option value="PUBLIC">办事处待认领款项</option>'
+					'html' => '<option value="PUBLIC">办事处待认领款项</option>' 
 			) );
 			die ();
 		}
@@ -1032,21 +1146,21 @@ class InvoiceController extends DooController {
 		if (! is_numeric ( $cid )) {
 			echo json_encode ( array (
 					'status' => 0,
-					'msg' => 'illegal request'
+					'msg' => 'illegal request' 
 			) );
 			die ();
 		}
-	
-		$staffList = $staff->getStaffByCid($cid);
 		
-		$html='<option value="PUBLIC">办事处待认领款项</option>';
-		foreach ($staffList as $key=>$value){
-			$html.='<option value="'.$value['sid'].'-'.$value['username'].'">'.$value['category'].'-'.$value['username'].'</option>';
+		$staffList = $staff->getStaffByCid ( $cid );
+		
+		$html = '<option value="PUBLIC">办事处待认领款项</option>';
+		foreach ( $staffList as $key => $value ) {
+			$html .= '<option value="' . $value ['sid'] . '-' . $value ['username'] . '">' . $value ['category'] . '-' . $value ['username'] . '</option>';
 		}
 		
 		echo json_encode ( array (
 				'status' => 1,
-				'html' => $html
+				'html' => $html 
 		) );
 	}
 	
@@ -1074,6 +1188,64 @@ class InvoiceController extends DooController {
 				'invoiceDetail' => $invoiceDetail 
 		) );
 	}
+	
+	/*
+	 * 获得与我有关收款数据
+	 */
+	function ajaxGetReceivalblesByStaff(){
+		$iid = $this->get_args ( 'key' ) ? $this->get_args ( 'key' ) : "";
+		Doo::loadModel ( 'invoiceReceivables' );
+		$invoiceReceivables = new invoiceReceivables ();
+		
+		$list =$invoiceReceivables->getInvoiceReceivablesByClaim($this->staff [0] ['cid'],$this->staff [0] ['sid']);
+		
+		
+		$html = "";
+		foreach ( $list['myClaim'] as $key => $value ) {
+			$html .= '<tr>
+					<td>' . $value ['receivablesPrice'] . '</td>
+					<td>¥' . $value ['receivablesMessage'] . '</td>
+					<td>' . $value ['receivablesBank'] . '</td>
+					<td>' . $value ['receivablesDate'] . '</td>';
+			$html .= '<td><label><input type="radio" node-Claim="true" p-data="'.$value ['iidKey'].'" name="invoiceClaim"> 使用Ta</label></td></tr>
+					<script>
+					$(\'input[node-Claim="true"]\').click(function() {
+						var invoiceKey=  $(this).attr("p-data");
+						var claimKey=$("input[name=\'key\']").val();
+						$("p[node-msg=\"true\"]").hide();
+						var url = "/ajaxCompareClaimPrice";
+						$.ajax({
+							url : url,
+							type : "post",
+							cache : false,
+							dataType : "json",
+							data : {
+								claimKey : claimKey,
+								invoiceKey:invoiceKey
+							},
+							global : true,
+							success : function(data) {
+								$("input[name=\'invoiceKey\']").val("'.$value ['iidKey'].'");
+								if (data.status == 1) {
+					
+									$("p[node-msg=\"true\"]").html("收款金额超出开票金额 ¥"+data.price+"元,请谨慎操作。");
+									$("p[node-msg=\"true\"]").show();
+								}
+							},
+							error : function(err) {
+							}
+						});
+					});
+					</script>
+					';
+		}
+		
+		echo json_encode ( array (
+				'status' => 1,
+				'html' => $html
+		) );
+	}
+	
 	function _GetFileEXT($filename) {
 		$pics = explode ( '.', $filename );
 		$num = count ( $pics );

+ 7 - 1
protected/model/invoice.php

@@ -161,6 +161,7 @@ class invoice extends DooModel {
 	public $untreadNumber;
 	public $untreadItems;
 	public $untreadStatus;
+	public $irid;
 	/**
 	 *
 	 * @var date $date 提交时间
@@ -194,6 +195,7 @@ class invoice extends DooModel {
 			'moldManage',
 			'cid',
 			'categoryName',
+			'irid',
 			'remark',
 			'invoiceElement',
 			'invoiceType',
@@ -234,6 +236,10 @@ class invoice extends DooModel {
 	 * @return array|array() 返回发票数据
 	 */
 	public function getInvoiceByIid($iid = 0, $select = "") {
+		
+		if (!is_numeric($iid))
+			$iid=$this->authcode($iid);
+		
 		$condition = array (
 				'where' => "iid=" . $iid,
 				'asArray' => TRUE 
@@ -242,7 +248,7 @@ class invoice extends DooModel {
 			$condition += array (
 					'select' => $select 
 			);
-		
+			
 		$Detail = array ();
 		if (is_numeric ( $iid ) && ! empty ( $iid ))
 			$Detail = $this->getOne ( $condition );

+ 23 - 5
protected/model/invoiceReceivables.php

@@ -10,6 +10,8 @@ Doo::loadCore ( 'db/DooModel' );
 class invoiceReceivables extends DooModel {
 	private $INVOICEKEY = "APPROVAL";
 	public $irid;
+	public $bindStatus;
+	public $iid;
 	public $receivablesPrice;
 	public $receivablesSerial;
 	public $receivablesMessage;
@@ -21,11 +23,14 @@ class invoiceReceivables extends DooModel {
 	public $source;
 	public $date;
 	public $confirmTime;
+	public $bindDate;
 	
 	public $_table = 'CLD_invoiceReceivables';
 	public $_primarykey = 'irid';
 	public $_fields = array (
 			'irid',
+			'bindStatus',
+			'iid',
 			'receivablesPrice',
 			'receivablesSerial',
 			'receivablesMessage',
@@ -36,13 +41,14 @@ class invoiceReceivables extends DooModel {
 			'inputStaff',
 			'source',
 			'date',
-			'confirmTime'
+			'confirmTime',
+			'bindDate'
 	);
 
 	public function getInvoiceReceivablesByClaim($cid=0,$sid=0){
 		if (empty($sid)){
 			$list['csClaim'] = $this->find ( array (
-					'where' => "receivablesCategory='public' and receivablesStaff='public' ",
+					'where' => "receivablesCategory='public' and receivablesStaff='public'  and bindStatus=0",
 					'desc' => 'irid',
 					'asArray' => TRUE
 			) );
@@ -52,7 +58,7 @@ class invoiceReceivables extends DooModel {
 			}
 			
 			$list['sClaim'] = $this->find ( array (
-					'where' => "receivablesCategory!='public' and receivablesStaff='public' and receivablesCategory like '".$cid.":%'",
+					'where' => "receivablesCategory!='public' and receivablesStaff='public' and receivablesCategory like '".$cid.":%' and bindStatus=0",
 					'desc' => 'irid',
 					'asArray' => TRUE
 			) );
@@ -61,7 +67,7 @@ class invoiceReceivables extends DooModel {
 			}
 			
 			$list['arClaim'] = $this->find ( array (
-					'where' => "receivablesCategory!='public' and receivablesStaff!='public' and receivablesCategory like '".$cid.":%'",
+					'where' => "receivablesCategory!='public' and receivablesStaff!='public' and receivablesCategory like '".$cid.":%' and bindStatus=0",
 					'desc' => 'irid',
 					'asArray' => TRUE
 			) );
@@ -73,7 +79,7 @@ class invoiceReceivables extends DooModel {
 		}
 		if (!empty($cid)&&!empty($sid)){
 			$list['myClaim'] = $this->find ( array (
-					'where' => " receivablesStaff like '".$sid."-%' and receivablesCategory like '".$cid.":%'",
+					'where' => " receivablesStaff like '".$sid."-%' and receivablesCategory like '".$cid.":%' and bindStatus=0",
 					'desc' => 'irid',
 					'asArray' => TRUE
 			) );
@@ -83,6 +89,18 @@ class invoiceReceivables extends DooModel {
 				$list ['myClaim'] [$key] ['sid'] = $staff [0];
 				$list ['myClaim'] [$key] ['username'] = $staff [1];
 			}
+			
+			$list['bindClaim'] = $this->find ( array (
+					'where' => " bindStatus=1 ",
+					'desc' => 'irid',
+					'limit'=>3,
+					'asArray' => TRUE
+			) );
+			Doo::loadModel ( 'invoice' );
+			$invoice = new invoice ();
+			foreach ( $list ['bindClaim'] as $key => $value ) {
+				$list ['bindClaim'] [$key] ['invoice']=$invoice->getInvoiceByIid($value['iid'],'iid,invoicePrice,invoiceSerial');
+			}
 		}
 		
 		return $list;

+ 10 - 4
protected/view/admin/invoice.html

@@ -89,7 +89,7 @@
 										<!-- elseif {{pendingInvoice' value.status}}==2 and {{pendingInvoice' value.printStatus}}==1 and {{pendingInvoice' value.untreadStatus}}==0 -->
 										<div class="btn-group">
 										<a class="button btn-red  btn-inline" diss-data="{{pendingInvoice' value.iidKey}}" node-invoice="untreadInvoice" href="#return" data-toggle="modal">申请退票</a>
-										<a class="button btn-green" href="#recorded" data-toggle="modal">收款入账</a>
+										<a class="button btn-green" diss-data="{{pendingInvoice' value.iidKey}}" node-receivalbles="bind" href="#recorded" data-toggle="modal">收款入账</a>
 										</div>
 										<!-- elseif {{pendingInvoice' value.status}}==2 and {{pendingInvoice' value.printStatus}}==1 and {{pendingInvoice' value.untreadStatus}}==2  -->
 										<a class="button btn-gray btn-block" href="/invoiceDelDo/{{pendingInvoice' value.iidKeyUrl}}.do">从待处理移除</a>
@@ -382,28 +382,34 @@
 	<!--退票-->
 	<!--弹出入账-->
 <div class="modal hide fade" id="recorded">
+
 	<div class="modal-dialog modal-lg">
 		<div class="modal-content">
     <div class="modal-header">
     <h3>发票入账</h3>
     </div>
+    <form action="/ibles" method="post" >
+		<input type="hidden" name="key" value="">
+		<input type="hidden" name="invoiceKey" value="">
     <div class="modal-body">
     	<p class="alert">发票与收款进行绑定,完成入账;入账后,已绑定发票的收款金额将作为您的最终销售收入。</p>
 		<table class="table table-bordered table-condensed">
 			<thead><th>金额</th><th>到款信息</th><th>到款银行</th><th>到款时间</th><th>入账操作</th></thead>
-			<tbody>
+			<tbody data-invoice="myReceivables" >
 			<tr class="success"><td>¥3000.00</td><td>李艳芬/鹅蛋山</td><td>广发银行珠海分行柠溪份支行</td><td>2016-04-11</td><td><label><input type="checkbox"> 使用Ta</label></td></tr>
 			<tr class=""><td>¥5000.00</td><td>到款信息</td><td>广发银行珠海分行柠溪份支行</td><td>2016-04-12</td><td><label><input type="checkbox"> 使用Ta</label></td></tr>
 			<tr class=""><td>¥6900.00</td><td>到款信息</td><td>广发银行珠海分行柠溪份支行</td><td>2016-04-13</td><td><label><input type="checkbox"> 使用Ta</label></td></tr>
 			</tbody>
 		</table>
-		<p class="alert alert-erro">收款金额超出开票金额 ¥2000.00元,请谨慎操作。</p>
+		<p node-msg='true' class="alert alert-erro hide">收款金额超出开票金额 ¥2000.00元,请谨慎操作。</p>
     </div>
 	<div class="modal-footer">
-		<a href="#" class="button " data-dismiss="modal" aria-hidden="true">确定入账</a>
+		<input type="submit" class="button" value="确定入账">
+		
 	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
 	</div>
 			</div></div>
+	</form>
 </div>
     <!--入账-->
 	<!--弹出邮寄-->