Browse Source

日常支出

caipin 4 years ago
parent
commit
2f0f6be016

+ 7 - 2
global/js/itinerary.js

@@ -366,11 +366,16 @@ function fnTotTravelPrice(){
 //构建费用说明
 function buildFeeTravelItem(feeTraveItem){
 	
-	var html='';
+	var html='';let detail='';
 	for(let i=0;i<feeTraveItem.length;i++){
 		html+='<tr class="remove" ><th>'+feeTraveItem[i].name+'</th>';
+		
+		if(!(typeof feeTraveItem[i].detail==='undefined')){
+			detail=feeTraveItem[i].detail.replace(new RegExp("<br/>", "gm"), '\n');
+		}
+		
 		html+='<td class="taR"><p>¥<input type="number" itemId_'+feeTraveItem[i].id+' data="'+feeTraveItem[i].name+'" dataId="'+feeTraveItem[i].id+'" value="'+feeTraveItem[i].price+'" placeholder="输入费用" pattern="[0-9]" step="1" min="0"class="span2"></p>'+
-		'<p><textarea type="text"  itemDetail_'+feeTraveItem[i].id+' placeholder="填写费用说明" rows="2" style=" width: 350px; margin: 10px 0px 0px 12px; height: 65px;">'+feeTraveItem[i].detail+'</textarea></p></td>';
+		'<p><textarea type="text"  itemDetail_'+feeTraveItem[i].id+' placeholder="填写费用说明" rows="2" style=" width: 350px; margin: 10px 0px 0px 12px; height: 65px;">'+detail+'</textarea></p></td>';
 		//html+='<td><textarea type="text"  itemDetail_'+feeTraveItem[i].id+' placeholder="填写费用说明">'+feeTraveItem[i].detail+'</textarea> </td>';
 		html+='<td><a href="#" removeFeeTravelItem >移除</a></td></tr>';
 	}

+ 1 - 1
global/js/itinerary2func.js

@@ -49,7 +49,7 @@ function buildItinerary(list,strokeId,strokeIndex){
 			}
 			html+='<tr><th>'+feeTraveItem[k].name+'<p class="colGray">'+detail+'</p></th><td width="200" class="taR">¥'+feeTraveItem[k].price+'</td></tr>';
 		}
-		html+='<tr><th class="taR">合计</th><td class="colGreen taR">¥'+price+'</td></tr>';
+		html+='<tr><th class="taR">合计</th><td class="colGreen taR">¥'+price.toFixed(2)+'</td></tr>';
 	}
 	return html;
 }

+ 376 - 349
global/js/payments.js

@@ -1,400 +1,427 @@
 
-$(function() {
-	
-	$('select[node-payMentsSelect]').change(function() {
-		 var payVal=$(this).val();
-		 $('#INCOMEBox').hide();
-		 $('#EXPENDITUREBox').hide();
-		 $('#FinancialBox').hide();
-		 $('#Bank').hide();
-
-		 if(payVal=="INCOME"){
-			 $('#INCOMEBox').show();
-		 }else if(payVal=="EXPENDITURE"){
-			 $('#EXPENDITUREBox').show();
-		 }else if(payVal=="FinancialBox"){
+$(function () {
+
+	//理财部分下拉交互
+	$('select[name="outlayOperatingType"]').change(function () {
+		var operatingType = $(this).val();
+		$('tr[outlay_finances_Node]').hide();
+		$('tr[outlay_bank_node]').hide();
+
+		if (operatingType == "finances") {
+			$('tr[outlay_finances_Node]').show();
+		} else if (operatingType == "bank") {
+			$('tr[outlay_bank_node]').show();
+		}
+	});
+
+	$('select[name="revenueOperatingType"]').change(function () {
+		var operatingType = $(this).val();
+		$('tr[revenue_finances_Node]').hide();
+		$('tr[revenue_bank_node]').hide();
+
+		if (operatingType == "finances") {
+			$('tr[revenue_finances_Node]').show();
+		} else if (operatingType == "bank") {
+			$('tr[revenue_bank_node]').show();
+		}
+	});
+
+	$('select[node-payMentsSelect]').change(function () {
+		var payVal = $(this).val();
+		$('#INCOMEBox').hide();
+		$('#EXPENDITUREBox').hide();
+		$('#FinancialBox').hide();
+		$('#Bank').hide();
+
+		if (payVal == "INCOME") {
+			$('#INCOMEBox').show();
+		} else if (payVal == "EXPENDITURE") {
+			$('#EXPENDITUREBox').show();
+		} else if (payVal == "FinancialBox") {
 			$('#FinancialBox').show();
-		 }else if(payVal=="Bank"){
+		} else if (payVal == "Bank") {
 			$('#Bank').show();
 		}
 	});
-	
-	$('select[node-accountTypeSelect]').change(function() {
-		 var payVal=$(this).val();
+
+
+
+	$('select[node-accountTypeSelect]').change(function () {
+		var payVal = $(this).val();
 		$('tr[node-incomeBank]').show();
-		 if(payVal=="1"){
-			 $('div[node-accountMsg1]').show();
-			 $('div[node-accountMsg2]').hide();
-			 $('div[node-accountMsg4]').hide();
-			 $('div[node-accountMsg7]').hide();
-			 $('div[node-accountMsg9]').hide();
-		 }else if(payVal=="2"){
-			 $('div[node-accountMsg1]').hide();
-			 $('div[node-accountMsg2]').show();
-			 $('div[node-accountMsg4]').hide();
-			 $('div[node-accountMsg7]').hide();
-			 $('div[node-accountMsg9]').hide();
-		 }else if(payVal=="4"){
-			 $('div[node-accountMsg1]').hide();
-			 $('div[node-accountMsg2]').hide();
-			 $('div[node-accountMsg4]').show();
-			 $('div[node-accountMsg7]').hide();
-			 $('div[node-accountMsg9]').hide();
-		 }else if(payVal=="7"){
-			 $('div[node-accountMsg1]').hide();
-			 $('div[node-accountMsg2]').hide();
-			 $('div[node-accountMsg4]').hide();
-			 $('div[node-accountMsg7]').show();
-			 $('div[node-accountMsg9]').hide();
-		 }else if(payVal=="9"){
-			 $('div[node-accountMsg1]').hide();
-			 $('div[node-accountMsg2]').hide();
-			 $('div[node-accountMsg4]').hide();
-			 $('div[node-accountMsg7]').hide();
-			 $('div[node-accountMsg9]').show();
-		 }else if(payVal=="11"||payVal=="12"){
-			 $('tr[node-incomeBank]').hide();
-
-		 }else{
-			 $('div[node-accountMsg1]').hide();
-			 $('div[node-accountMsg2]').hide();
-			 $('div[node-accountMsg4]').hide();
-			 $('div[node-accountMsg7]').hide();
-			 $('div[node-accountMsg9]').hide();
-		 }
+		if (payVal == "1") {
+			$('div[node-accountMsg1]').show();
+			$('div[node-accountMsg2]').hide();
+			$('div[node-accountMsg4]').hide();
+			$('div[node-accountMsg7]').hide();
+			$('div[node-accountMsg9]').hide();
+		} else if (payVal == "2") {
+			$('div[node-accountMsg1]').hide();
+			$('div[node-accountMsg2]').show();
+			$('div[node-accountMsg4]').hide();
+			$('div[node-accountMsg7]').hide();
+			$('div[node-accountMsg9]').hide();
+		} else if (payVal == "4") {
+			$('div[node-accountMsg1]').hide();
+			$('div[node-accountMsg2]').hide();
+			$('div[node-accountMsg4]').show();
+			$('div[node-accountMsg7]').hide();
+			$('div[node-accountMsg9]').hide();
+		} else if (payVal == "7") {
+			$('div[node-accountMsg1]').hide();
+			$('div[node-accountMsg2]').hide();
+			$('div[node-accountMsg4]').hide();
+			$('div[node-accountMsg7]').show();
+			$('div[node-accountMsg9]').hide();
+		} else if (payVal == "9") {
+			$('div[node-accountMsg1]').hide();
+			$('div[node-accountMsg2]').hide();
+			$('div[node-accountMsg4]').hide();
+			$('div[node-accountMsg7]').hide();
+			$('div[node-accountMsg9]').show();
+		} else if (payVal == "11" || payVal == "12") {
+			$('tr[node-incomeBank]').hide();
+
+		} else {
+			$('div[node-accountMsg1]').hide();
+			$('div[node-accountMsg2]').hide();
+			$('div[node-accountMsg4]').hide();
+			$('div[node-accountMsg7]').hide();
+			$('div[node-accountMsg9]').hide();
+		}
 	});
-	
-	$('select[node-expenditureTypeSelect]').change(function() {
-		 var payVal=$(this).val();
+
+	$('select[node-expenditureTypeSelect]').change(function () {
+		var payVal = $(this).val();
 		$('tr[node-expenditureBank]').show();
-		 if(payVal=="3"){
-			 $('div[node-expenditureMsg3]').show();
-			 $('div[node-expenditureMsg4]').hide();
-			 $('div[node-expenditureMsg6]').hide();
-		 }else if(payVal=="4"){
-			 $('div[node-expenditureMsg3]').hide();
-			 $('div[node-expenditureMsg4]').show();
-			 $('div[node-expenditureMsg6]').hide();
-		 }else if(payVal=="6"){
-			 $('div[node-expenditureMsg3]').hide();
-			 $('div[node-expenditureMsg4]').hide();
-			 $('div[node-expenditureMsg6]').show();
-		 }else if(payVal=="8"||payVal=="9"){
-			 $('tr[node-expenditureBank]').hide();
-		 }else{
-			 $('div[node-expenditureMsg3]').hide();
-			 $('div[node-expenditureMsg4]').hide();
-			 $('div[node-expenditureMsg6]').hide();
-		 }
+		if (payVal == "3") {
+			$('div[node-expenditureMsg3]').show();
+			$('div[node-expenditureMsg4]').hide();
+			$('div[node-expenditureMsg6]').hide();
+		} else if (payVal == "4") {
+			$('div[node-expenditureMsg3]').hide();
+			$('div[node-expenditureMsg4]').show();
+			$('div[node-expenditureMsg6]').hide();
+		} else if (payVal == "6") {
+			$('div[node-expenditureMsg3]').hide();
+			$('div[node-expenditureMsg4]').hide();
+			$('div[node-expenditureMsg6]').show();
+		} else if (payVal == "8" || payVal == "9") {
+			$('tr[node-expenditureBank]').hide();
+		} else {
+			$('div[node-expenditureMsg3]').hide();
+			$('div[node-expenditureMsg4]').hide();
+			$('div[node-expenditureMsg6]').hide();
+		}
 	});
-	
-	$('select[node-accountTypeSearch]').change(function() {
-		
+
+	$('select[node-accountTypeSearch]').change(function () {
+
 		$("#submitType").val(1);
-		 $('#iaa').submit();
+		$('#iaa').submit();
 	});
-	$('select[node-expenditureTypeSearch]').change(function() {
-		
+	$('select[node-expenditureTypeSearch]').change(function () {
+
 		$("#submitType").val(2);
-		 $('#iaa').submit();
+		$('#iaa').submit();
 	});
-	
-	$('select[select-wasteBook]').change(function() {
-		 $('#ira').submit();
+
+	$('select[select-wasteBook]').change(function () {
+		$('#ira').submit();
 	});
-	
-	
-	$('a[node-income=detail]').click(function() {
-		
-		var key=$(this).attr("data-isKey");
+
+
+	$('a[node-income=detail]').click(function () {
+
+		var key = $(this).attr("data-isKey");
 		$('div[node-accountMsg1]').hide();
-		 $('div[node-accountMsg2]').hide();
-		 $('div[node-accountMsg4]').hide();
-		 $('div[node-accountMsg7]').hide();
-		
+		$('div[node-accountMsg2]').hide();
+		$('div[node-accountMsg4]').hide();
+		$('div[node-accountMsg7]').hide();
+
 		var url = "/ajaxGetPaymentsByAid";
 		$.ajax({
-			url : url,
-			type : "post",
-			cache : false,
-			dataType : "json",
-			data : {
-				serial : key,
+			url: url,
+			type: "post",
+			cache: false,
+			dataType: "json",
+			data: {
+				serial: key,
 			},
-			global : true,
-			success : function(data) {
+			global: true,
+			success: function (data) {
 				if (data.status == 1) {
-					$("#accountTypeEdi").find("option[value='"+data.detail.accountType+"']").attr("selected",true);
-					 $('div[node-accountMsg'+data.detail.accountType+']').show();
-					 $("input[name=accountMsg"+data.detail.accountType+"][value="+data.detail.accountMsg+"]").attr("checked",true);
-					 
-					 $("#receivedBank").find("option[value='"+data.detail.receivedBank+"']").attr("selected",true);
-					 
-					 $("#receivedPrice").val(data.detail.receivedPrice);
-					 $("#receivedMsg").val(data.detail.receivedMsg);
-					 $("#receivedDate").val(data.detail.receivedDate);
-					 $("#aidKeyIncome").val(data.detail.aidKey);
-					 
+					$("#accountTypeEdi").find("option[value='" + data.detail.accountType + "']").attr("selected", true);
+					$('div[node-accountMsg' + data.detail.accountType + ']').show();
+					$("input[name=accountMsg" + data.detail.accountType + "][value=" + data.detail.accountMsg + "]").attr("checked", true);
+
+					$("#receivedBank").find("option[value='" + data.detail.receivedBank + "']").attr("selected", true);
+
+					$("#receivedPrice").val(data.detail.receivedPrice);
+					$("#receivedMsg").val(data.detail.receivedMsg);
+					$("#receivedDate").val(data.detail.receivedDate);
+					$("#aidKeyIncome").val(data.detail.aidKey);
+
 				} else
 					$("div[loading-msg='true']").html("illegal request");
 			},
-			error : function(err) {
+			error: function (err) {
 				$("div[loading-msg='true']").html("");
 				$("#nr").html('');
 			}
 		});
 	});
-	
-$('a[node-EXPENDITURE=detail]').click(function() {
-		
-		var key=$(this).attr("data-isKey");
+
+	$('a[node-EXPENDITURE=detail]').click(function () {
+
+		var key = $(this).attr("data-isKey");
 		$('div[node-expenditureMsg3]').hide();
-		
+
 		var url = "/ajaxGetPaymentsByAid";
 		$.ajax({
-			url : url,
-			type : "post",
-			cache : false,
-			dataType : "json",
-			data : {
-				serial : key,
+			url: url,
+			type: "post",
+			cache: false,
+			dataType: "json",
+			data: {
+				serial: key,
 			},
-			global : true,
-			success : function(data) {
+			global: true,
+			success: function (data) {
 				if (data.status == 1) {
-					$("#expenditureTypeEdi").find("option[value='"+data.detail.expenditureType+"']").attr("selected",true);
-					 $('div[node-expenditureMsg'+data.detail.expenditureType+']').show();
-					 $("input[name=expenditureMsg"+data.detail.expenditureType+"][value="+data.detail.expenditureMsg+"]").attr("checked",true);
-					 $("#expenditureBank").find("option[value='"+data.detail.expenditureBank+"']").attr("selected",true);
-					
-					 $("#expenditurePrice").val(data.detail.expenditurePrice);
-					
-					 $("#aidKeyExpenditure").val(data.detail.aidKey);
+					$("#expenditureTypeEdi").find("option[value='" + data.detail.expenditureType + "']").attr("selected", true);
+					$('div[node-expenditureMsg' + data.detail.expenditureType + ']').show();
+					$("input[name=expenditureMsg" + data.detail.expenditureType + "][value=" + data.detail.expenditureMsg + "]").attr("checked", true);
+					$("#expenditureBank").find("option[value='" + data.detail.expenditureBank + "']").attr("selected", true);
+
+					$("#expenditurePrice").val(data.detail.expenditurePrice);
+
+					$("#aidKeyExpenditure").val(data.detail.aidKey);
 				} else
 					$("div[loading-msg='true']").html("illegal request");
 			},
-			error : function(err) {
+			error: function (err) {
 				$("div[loading-msg='true']").html("");
 				$("#nr").html('');
 			}
 		});
 	});
-	
-
-$('a[del-income=detail]').click(function() {
-	
-	var key=$(this).attr("data-isKey");
-	$("#aidKeyDel").val(key);
-	
-});
-
-$('a[node-pay=waste]').click(function() {
-	
-	var key=$(this).attr("data-key");
-	var url = "/ajaxGetPaymentsByAid";
-	
-	$.ajax({
-		url : url,
-		type : "post",
-		cache : false,
-		dataType : "json",
-		data : {
-			serial : key,
-		},
-		global : true,
-		success : function(data) {
-			if (data.status == 1) {
-				$("#WI-wasteStaff").html(data.detail.staffDetail.username+'-'+data.detail.staffDetail.category);
-				
-				$("#WI-bookSerial").html(data.detail.bookSerial);
-				$("#WI-expenditureMsg").html(data.detail.expenditureTypeMsg);
-				$("#WI-expenditurePrice").html(data.detail.expenditurePrice);
-				$("#WI-expenditureBank").html(data.detail.expenditureBank);
-				$("#WI-expenditureDate").html(data.detail.expenditureDate);
-				$("#WI-remarks").html(data.detail.remarks);
-				
-			} else
-				$("div[loading-msg='true']").html("illegal request");
-		},
-		error : function(err) {
-			$("div[loading-msg='true']").html("");
-		}
+
+
+	$('a[del-income=detail]').click(function () {
+
+		var key = $(this).attr("data-isKey");
+		$("#aidKeyDel").val(key);
+
 	});
-});
-
-$('a[node-income=waste]').click(function() {
-	
-	var key=$(this).attr("data-key");
-	var url = "/ajaxGetPaymentsByAid";
-	
-	$.ajax({
-		url : url,
-		type : "post",
-		cache : false,
-		dataType : "json",
-		data : {
-			serial : key,
-		},
-		global : true,
-		success : function(data) {
-			if (data.status == 1) {
-				$("#IN-wasteStaff").html(data.detail.staffDetail.username+'-'+data.detail.staffDetail.category);
-				
-				$("#IN-bookSerial").html(data.detail.bookSerial);
-				$("#IN-expenditureMsg").html(data.detail.incomeTypeMsg);
-				$("#IN-expenditurePrice").html(data.detail.receivedPrice);
-				$("#IN-expenditureBank").html(data.detail.receivedBank);
-				$("#IN-expenditureDate").html(data.detail.receivedDate);
-				$("#IN-remarks").html(data.detail.remarks);
-				
-			} else
-				$("div[loading-msg='true']").html("illegal request");
-		},
-		error : function(err) {
-			$("div[loading-msg='true']").html("");
-		}
+
+	$('a[node-pay=waste]').click(function () {
+
+		var key = $(this).attr("data-key");
+		var url = "/ajaxGetPaymentsByAid";
+
+		$.ajax({
+			url: url,
+			type: "post",
+			cache: false,
+			dataType: "json",
+			data: {
+				serial: key,
+			},
+			global: true,
+			success: function (data) {
+				if (data.status == 1) {
+					$("#WI-wasteStaff").html(data.detail.staffDetail.username + '-' + data.detail.staffDetail.category);
+
+					$("#WI-bookSerial").html(data.detail.bookSerial);
+					$("#WI-expenditureMsg").html(data.detail.expenditureTypeMsg);
+					$("#WI-expenditurePrice").html(data.detail.expenditurePrice);
+					$("#WI-expenditureBank").html(data.detail.expenditureBank);
+					$("#WI-expenditureDate").html(data.detail.expenditureDate);
+					$("#WI-remarks").html(data.detail.remarks);
+
+				} else
+					$("div[loading-msg='true']").html("illegal request");
+			},
+			error: function (err) {
+				$("div[loading-msg='true']").html("");
+			}
+		});
 	});
-});
-
-$('a[node-ir=waste]').click(function() {
-	
-	var key=$(this).attr("data-key");
-	var url = "/ajaxGetWasteinvoiceReceivables";
-	
-	$.ajax({
-		url : url,
-		type : "post",
-		cache : false,
-		dataType : "json",
-		data : {
-			serial : key,
-		},
-		global : true,
-		success : function(data) {
-			if (data.status == 1) {
-				$("#IR-wasteStaff").html(data.detail.inputStaff);
-				
-				$("#IR-bookSerial").html(data.detail.receivablesSerial);
-				$("#IR-expenditureMsg").html(data.detail.receivablesMessage);
-				$("#IR-expenditurePrice").html(data.detail.OriginalPrice);
-				$("#IR-expenditureBank").html(data.detail.receivablesBank);
-				$("#IR-expenditureDate").html(data.detail.receivablesDate);
-				
-				
-			} else
-				$("div[loading-msg='true']").html("illegal request");
-		},
-		error : function(err) {
-			$("div[loading-msg='true']").html("");
-		}
+
+	$('a[node-income=waste]').click(function () {
+
+		var key = $(this).attr("data-key");
+		var url = "/ajaxGetPaymentsByAid";
+
+		$.ajax({
+			url: url,
+			type: "post",
+			cache: false,
+			dataType: "json",
+			data: {
+				serial: key,
+			},
+			global: true,
+			success: function (data) {
+				if (data.status == 1) {
+					$("#IN-wasteStaff").html(data.detail.staffDetail.username + '-' + data.detail.staffDetail.category);
+
+					$("#IN-bookSerial").html(data.detail.bookSerial);
+					$("#IN-expenditureMsg").html(data.detail.incomeTypeMsg);
+					$("#IN-expenditurePrice").html(data.detail.receivedPrice);
+					$("#IN-expenditureBank").html(data.detail.receivedBank);
+					$("#IN-expenditureDate").html(data.detail.receivedDate);
+					$("#IN-remarks").html(data.detail.remarks);
+
+				} else
+					$("div[loading-msg='true']").html("illegal request");
+			},
+			error: function (err) {
+				$("div[loading-msg='true']").html("");
+			}
+		});
 	});
-});
-
-
-$('a[node-i=waste]').click(function() {
-	
-	var key=$(this).attr("data-key");
-	var url = "/ajaxGetWasteInvoice";
-	
-	$.ajax({
-		url : url,
-		type : "post",
-		cache : false,
-		dataType : "json",
-		data : {
-			serial : key,
-		},
-		global : true,
-		success : function(data) {
-			if (data.status == 1) {
-				$("#IR-wasteStaff").html(data.detail.userName);
-				
-				$("#IR-bookSerial").html(data.detail.invoiceNo);
-				$("#IR-expenditureMsg").html(data.detail.invoiceElement);
-				$("#IR-expenditurePrice").html(data.detail.invoicePrice);
-				$("#IR-expenditureBank").html(data.detail.receivablesBank);
-				$("#IR-expenditureDate").html(data.detail.bindTime);
-				
-				
-			} else
-				$("div[loading-msg='true']").html("illegal request");
-		},
-		error : function(err) {
-			$("div[loading-msg='true']").html("");
-		}
+
+	$('a[node-ir=waste]').click(function () {
+
+		var key = $(this).attr("data-key");
+		var url = "/ajaxGetWasteinvoiceReceivables";
+
+		$.ajax({
+			url: url,
+			type: "post",
+			cache: false,
+			dataType: "json",
+			data: {
+				serial: key,
+			},
+			global: true,
+			success: function (data) {
+				if (data.status == 1) {
+					$("#IR-wasteStaff").html(data.detail.inputStaff);
+
+					$("#IR-bookSerial").html(data.detail.receivablesSerial);
+					$("#IR-expenditureMsg").html(data.detail.receivablesMessage);
+					$("#IR-expenditurePrice").html(data.detail.OriginalPrice);
+					$("#IR-expenditureBank").html(data.detail.receivablesBank);
+					$("#IR-expenditureDate").html(data.detail.receivablesDate);
+
+
+				} else
+					$("div[loading-msg='true']").html("illegal request");
+			},
+			error: function (err) {
+				$("div[loading-msg='true']").html("");
+			}
+		});
 	});
-});
-
-
-
-$('a[node-ir11=waste]').click(function() {
-	
-	var key=$(this).attr("data-key");
-	var url = "/ajaxGetWasteinvoiceReceivables";
-	
-	$.ajax({
-		url : url,
-		type : "post",
-		cache : false,
-		dataType : "json",
-		data : {
-			serial : key,
-		},
-		global : true,
-		success : function(data) {
-			if (data.status == 1) {
-				$("#IR11-wasteStaff").html(data.detail.inputStaff);
-				
-				$("#IR11-bookSerial").html(data.detail.receivablesSerial);
-				$("#IR11-expenditureMsg").html(data.detail.receivablesMessage);
-				$("#IR11-expenditurePrice").html(data.detail.refundPrice);
-				$("#IR11-expenditureBank").html(data.detail.receivablesBank);
-				$("#IR11-expenditureDate").html(data.detail.receivablesDate);
-				
-				
-			} else
-				$("div[loading-msg='true']").html("illegal request");
-		},
-		error : function(err) {
-			$("div[loading-msg='true']").html("");
-		}
+
+
+	$('a[node-i=waste]').click(function () {
+
+		var key = $(this).attr("data-key");
+		var url = "/ajaxGetWasteInvoice";
+
+		$.ajax({
+			url: url,
+			type: "post",
+			cache: false,
+			dataType: "json",
+			data: {
+				serial: key,
+			},
+			global: true,
+			success: function (data) {
+				if (data.status == 1) {
+					$("#IR-wasteStaff").html(data.detail.userName);
+
+					$("#IR-bookSerial").html(data.detail.invoiceNo);
+					$("#IR-expenditureMsg").html(data.detail.invoiceElement);
+					$("#IR-expenditurePrice").html(data.detail.invoicePrice);
+					$("#IR-expenditureBank").html(data.detail.receivablesBank);
+					$("#IR-expenditureDate").html(data.detail.bindTime);
+
+
+				} else
+					$("div[loading-msg='true']").html("illegal request");
+			},
+			error: function (err) {
+				$("div[loading-msg='true']").html("");
+			}
+		});
 	});
-});
-
-
-$('a[node-receipt=waste]').click(function() {
-	
-	var key=$(this).attr("data-key");
-	var accountTypeKey=$(this).attr("data-accountTypeKey");
-	var url = "/ajaxGetWasteReceipt";
-	
-	$("#wasteReceipt").html('');
-	
-	$.ajax({
-		url : url,
-		type : "post",
-		cache : false,
-		dataType : "json",
-		data : {
-			serial : key,
-			accountTypeKey:accountTypeKey
-		},
-		global : true,
-		success : function(data) {
-			if (data.status == 1) {
-				$("#wasteReceipt").html(data.html);
-				
-			} else
-				$("div[loading-msg='true']").html("illegal request");
-		},
-		error : function(err) {
-			$("div[loading-msg='true']").html("");
-		}
+
+
+
+	$('a[node-ir11=waste]').click(function () {
+
+		var key = $(this).attr("data-key");
+		var url = "/ajaxGetWasteinvoiceReceivables";
+
+		$.ajax({
+			url: url,
+			type: "post",
+			cache: false,
+			dataType: "json",
+			data: {
+				serial: key,
+			},
+			global: true,
+			success: function (data) {
+				if (data.status == 1) {
+					$("#IR11-wasteStaff").html(data.detail.inputStaff);
+
+					$("#IR11-bookSerial").html(data.detail.receivablesSerial);
+					$("#IR11-expenditureMsg").html(data.detail.receivablesMessage);
+					$("#IR11-expenditurePrice").html(data.detail.refundPrice);
+					$("#IR11-expenditureBank").html(data.detail.receivablesBank);
+					$("#IR11-expenditureDate").html(data.detail.receivablesDate);
+
+
+				} else
+					$("div[loading-msg='true']").html("illegal request");
+			},
+			error: function (err) {
+				$("div[loading-msg='true']").html("");
+			}
+		});
 	});
-});
+
+
+	$('a[node-receipt=waste]').click(function () {
+
+		var key = $(this).attr("data-key");
+		var accountTypeKey = $(this).attr("data-accountTypeKey");
+		var url = "/ajaxGetWasteReceipt";
+
+		$("#wasteReceipt").html('');
+
+		$.ajax({
+			url: url,
+			type: "post",
+			cache: false,
+			dataType: "json",
+			data: {
+				serial: key,
+				accountTypeKey: accountTypeKey
+			},
+			global: true,
+			success: function (data) {
+				if (data.status == 1) {
+					$("#wasteReceipt").html(data.html);
+
+				} else
+					$("div[loading-msg='true']").html("illegal request");
+			},
+			error: function (err) {
+				$("div[loading-msg='true']").html("");
+			}
+		});
+	});
+
 
 
 
-	
 })
 

+ 5 - 5
global/js/receiptExtend.js

@@ -29,7 +29,7 @@ $(function() {
 					$("#receiptTrainPrice").hide();
 					$("#receiptPrice").show();
 					$("#paymentAuthCode").val('');
-					$("#receiptPrice").html('¥'+data.detail.sum);
+					$("#receiptPrice").html('¥'+Math.abs(data.detail.sum).toFixed(2));
 					
 					if(data.detail.Rtype==0){
 						$("#Rtype").html('报销单');
@@ -41,7 +41,7 @@ $(function() {
 						}else if(data.detail.isBK==1){
 							$("#Rtype").html('借款(报销)');
 							var rsum =Math.abs((data.detail.sum-data.detail.loanSum));
-							$("#receiptPrice").html('¥'+rsum);
+							$("#receiptPrice").html('¥'+rsum.toFixed(2));
 							if(rsum>=0){
 								$("#receiptType").html('<span class="colGreen">收入</span>');
 							}else{
@@ -59,7 +59,7 @@ $(function() {
 						}else{
 							$("#receiptType").html('<span class="colRed">支出</span>');
 						}
-						$("#receiptPrice").html('¥'+Math.abs(data.detail.payment));
+						$("#receiptPrice").html('¥'+Math.abs(data.detail.payment).toFixed(2));
 						$("#paymentAuthCode").val(data.detail.paymentAuthCode);
 //						$("#receiptTrainType").show();
 //						$("#receiptType").hide();
@@ -77,9 +77,9 @@ $(function() {
 					$("#sum").html('¥'+data.detail.sum);
 					if(data.detail.amount!=null){
 						if(data.detail.isBK==1){
-							$("#amount").html('¥'+rsum);
+							$("#amount").html('¥'+rsum.toFixed(2));
 						}else{
-							$("#amount").html('¥'+data.detail.amount);
+							$("#amount").html('¥'+data.detail.amount.toFixed(2));
 						}
 					}else{
 						$("#amount").html('¥0');

+ 3 - 3
protected/config/js.edition.conf.php

@@ -1,15 +1,15 @@
 <?php
 
 define ( "index", WEB_SITE_GLOBAL.'js/index.js?1.09' );
-define ( "receiptExtend", WEB_SITE_GLOBAL.'js/receiptExtend.js?1.03' );
+define ( "receiptExtend", WEB_SITE_GLOBAL.'js/receiptExtend.js?1.05' );
 
 define ( "receipt", WEB_SITE_GLOBAL.'js/receipt.js?1.10' );
-define ( "itinerary", WEB_SITE_GLOBAL.'js/itinerary.js?1.25' );
+define ( "itinerary", WEB_SITE_GLOBAL.'js/itinerary.js?1.27' );
 define ( "itineraryView", WEB_SITE_GLOBAL.'js/itineraryView.js?1.12' );
 
 
 define ( "itinerary2", WEB_SITE_GLOBAL.'js/itinerary2.0.js?1.00' );
-define ( "itinerary2func", WEB_SITE_GLOBAL.'js/itinerary2func.js?1.00' );
+define ( "itinerary2func", WEB_SITE_GLOBAL.'js/itinerary2func.js?1.01' );
 define ( "itineraryView2", WEB_SITE_GLOBAL.'js/itineraryView2.0.js?1.12' );
 
 define ( "invoice", WEB_SITE_GLOBAL.'js/invoice.js?1.02' );

+ 61 - 40
protected/controller/ReceiptController.php

@@ -475,7 +475,6 @@ class ReceiptController extends DooController {
 		
 		$itineraryJson=json_decode($itinerary,true);
 		
-		$itineraryDate=array();$sql=array();
 		foreach ($itineraryJson as $k=>$v){
 			foreach ($v as $kk=>$vv){
 				foreach ($vv as $key=>$value){
@@ -483,6 +482,15 @@ class ReceiptController extends DooController {
 						header ( 'Content-Type:text/html;charset=utf-8' );
 						die ( '有行程的日期未设置' );
 					}
+				}
+			}
+		}
+		
+		
+		$itineraryDate=array();$sql=array();
+		foreach ($itineraryJson as $k=>$v){
+			foreach ($v as $kk=>$vv){
+				foreach ($vv as $key=>$value){
 					if($key==0){
 						array_push($itineraryDate, $value['departuredate']);
 						array_push($itineraryDate, substr($value['arrivalsdate'],1));
@@ -954,9 +962,15 @@ class ReceiptController extends DooController {
 		//$receiptDetail['itinerary']=str_replace('\n','<br/>',$receiptDetail['itinerary']);
 		
 		//nl2br($receiptDetail['explanation']);
+		Doo::loadModel ( 'itinerary' );
+		$itinerary = new itinerary ();
+		$itinerary->delete(array('where' => 'rid=' . $receiptDetail['rid'] ));
+		
 		
 		$receiptDetail['explanation']= str_replace('<br/>',"\n",$receiptDetail['explanation']);
 		
+		$receiptDetail['itinerary']=str_replace('\n','<br/>',$receiptDetail['itinerary']);
+		
 		$data ['category'] = $lCategory->find ( array (
 				'asArray' => true 
 		) );
@@ -1005,6 +1019,7 @@ class ReceiptController extends DooController {
 		
 		
 		$receiptClass = $this->get_args ( 'receiptClass' ) ? $this->get_args ( 'receiptClass' ) : "";
+		$traveVer = $this->get_args ( 'traveVer' ) ? $this->get_args ( 'traveVer' ) : "trave2";
 		$itinerary = $_POST['itinerary'];
 		
 		$verify = $this->get_args ( 'verify' ) && is_numeric ( $this->get_args ( 'verify' ) ) ? $this->get_args ( 'verify' ) : 0;
@@ -1032,6 +1047,17 @@ class ReceiptController extends DooController {
 				die ( '请填写联行号' );
 			}
 			
+			if($traveVer!='trave1'){
+				if($receiptClass=='trave'){
+					//TODO 日期检测
+					if($this->_verificationItinerary($itinerary)){
+						header ( 'Content-Type:text/html;charset=utf-8' );
+						die ( '已申请过类此日期的行程' );
+					}
+				}
+			}
+			
+			
 			Doo::loadModel ( 'receipt' );
 			Doo::loadModel ( 'receiptDetail' );
 			Doo::loadModel ( 'accountItem' );
@@ -8209,7 +8235,7 @@ class ReceiptController extends DooController {
 			
 			if ($value['Rtype']==1){
 			$receiptList [$key] ['relust'] = $value['sum']-$value['loanSum'];
-			$receiptList [$key] ['relustABS'] = abs($receiptList [$key] ['relust']);
+			$receiptList [$key] ['relustABS'] = sprintf("%.2f",abs($receiptList [$key] ['relust']));
 			}elseif($value['Rtype']==3){
 				// 收入合计
 				Doo::loadModel ( 'invoiceTraining' );
@@ -12291,6 +12317,10 @@ class ReceiptController extends DooController {
 				// if ($receivedBank == '个人广发') {
 				// 	die ( '个人广发  illegal request' );
 				// }
+				
+				// echo $receivedBank;
+				// die;
+
 				// 添加一条收入
 				$accountBook = new accountBook ();
 				$accountBook->accountType = 10;
@@ -12338,6 +12368,9 @@ class ReceiptController extends DooController {
 				// 添加一条理财支出
 				$accountBank = 'CGBDeposit';
 				$expenditureBank = '纵横广发';
+				if($accountMsg=='个人(GR)'){
+					$expenditureBank = '个人广发';
+				}
 				$dailyExpenditureType = 4;
 				if ($accountType == 9) {
 					$accountBank = 'ICBCDeposit';
@@ -12369,14 +12402,15 @@ class ReceiptController extends DooController {
 				);
 				$accountBookStatistics->setAccountBookStatistics ( $item );
 				
-				// 添加一条支出理财流水
+				//TODO -新增理财为个人时的情况 添加一条支出理财流水
 				$accountTypeWaste = 5;
 				if ($accountMsg == '公司固定') {
 					$accountTypeWaste = 9;
 				} elseif ($accountMsg == '公司活期') {
 					$accountTypeWaste = 10;
-				} elseif ($accountMsg == '个人(GR)') {
-					$accountBank = 'PersonalDeposit';
+				} elseif ($receivedBank == '个人广发') {
+					$accountTypeWaste = 9;
+					$accountBank = 'ICBCDeposit';
 				}
 				$itemWaste = array (
 						'expensesType' => 2,
@@ -12631,37 +12665,16 @@ class ReceiptController extends DooController {
                 );
                 $wasteBook->setAccountBookStatistics ( $itemWaste );
 
-                // 添加一笔收入流水
-//                if($expenditureType==8){
-//                    $dailyIncomeType='11';
-//                }elseif($expenditureType==9){
-//                    $dailyIncomeType='12';
-//                }
-//                $wasteBook = new wasteBook ();
-//                $itemWaste = array (
-//                    'expensesType' => 1,
-//                    'accountType' => 6,
-//                    'accountPriceShow' => $expenditurePrice,
-//                    'accountPrice' => $expenditurePrice,
-//                    'dataID' => $expenditureId,
-//
-//                    'dailyIncomeType' => $dailyIncomeType,
-//                    'accountBank' => $accountBank,
-//                    'category' => $this->staff [0] ['category'],
-//                    'cid' => $this->staff [0] ['cid'],
-//                    'name' => $this->staff [0] ['username'],
-//                    'sid' => $this->staff [0] ['sid'],
-//                    'inputDate' => date ( "Y-m-d H:i:s" )
-//                );
-//                $wasteBook->setAccountBookStatistics ( $itemWaste );
-
-
+			//TODO 日常支出 个人理财情况的相关修改
             }elseif ($expenditureType == 4 || $expenditureType == 6) {
 				
-				if ($expenditureBank == '个人广发') {
-					die ( '个人广发  illegal request' );
-				}
+				// if ($expenditureBank == '个人广发') {
+				// 	die ( '个人广发  illegal request' );
+				// }
 				
+				// echo $expenditureMsg;
+				// die;
+
 				// 添加一笔日常支出
 				$accountBook = new accountBook ();
 				$accountBook->expensesType = 2;
@@ -12694,11 +12707,14 @@ class ReceiptController extends DooController {
 				$itemWaste = array (
 						'accountPrice' => - $expenditurePrice 
 				);
-				if ($expenditureBank == '个人广发') {
-					$itemWaste = array (
-							'accountPrice' => $expenditurePrice 
-					);
+				if($expenditureMsg!='个人(GR)'){
+					if ($expenditureBank == '个人广发') {
+						$itemWaste = array (
+								'accountPrice' => $expenditurePrice 
+						);
+					}
 				}
+				
 				$itemWaste += array (
 						'expensesType' => 2,
 						'accountType' => 5,
@@ -12722,6 +12738,8 @@ class ReceiptController extends DooController {
 					$accountBank = 'ICBCDeposit';
 					$receivedBank = '纵横工行';
 					$dailyIncomeType = 9;
+				}elseif($expenditureMsg=='个人(GR)'){
+					$receivedBank = '个人广发';
 				}
 				$accountBook = new accountBook ();
 				$accountBook->expensesType = 1;
@@ -12747,13 +12765,14 @@ class ReceiptController extends DooController {
 						'expensesType' => 3 
 				);
 				$accountBookStatistics->setAccountBookStatistics ( $item );
-				// 添加一笔收入流水
+				//TODO 修改理财收入 添加一笔收入流水
 				if ($expenditureMsg == '公司固定') {
 					$accountTypeWaste = 9;
 				} elseif ($expenditureMsg == '公司活期') {
 					$accountTypeWaste = 10;
 				} elseif ($expenditureMsg == '个人(GR)') {
-					$accountBank = 'PersonalDeposit';
+					$accountTypeWaste = 9;
+					$accountBank = 'ICBCDeposit';
 				}
 				$itemWaste = array (
 						'expensesType' => 1,
@@ -14634,7 +14653,7 @@ class ReceiptController extends DooController {
 				if ($v ['accountBank'] == 'CGBDeposit' && $key == 'CGBDeposit') {
 					$waste ['financial'] ['fixed'] ['CGBDeposit'] = $value  + $v ['accountPrice'];
 				}
-				// 工商
+				// 工商---已经转变成个人理财固定代表含义
 				if ($v ['accountBank'] == 'ICBCDeposit' && $key == 'ICBCDeposit') {
 					$waste ['financial'] ['fixed'] ['ICBCDeposit'] = $value  + $v ['accountPrice'];
 				}
@@ -14645,6 +14664,8 @@ class ReceiptController extends DooController {
 			}
 		}
 		
+		$waste ['bank'] ['ICBCDeposit'] = sprintf("%.2f", $waste ['bank'] ['ICBCDeposit']);
+		
 		return $waste;
 	}
 	function lyt() {

+ 197 - 47
protected/controller/ReceiptExtendController.php

@@ -13,48 +13,7 @@ class ReceiptExtendController extends DooController {
 	public $TRAVEL = "差旅相关费用";
 	public $TRAIN = "培训班费用";
 	public $OTHER = "其他";
-	private $MYREVEIPTCACHEPATH = "protected/cache/myReceipt/";
-	private $PERSONALCOLLECTCACHEPATH = "protected/cache/personalCollect/";
-	private $CATEGORYCOLLECTPATH = "protected/cache/categoryCollect/";
-	private $STAFFCOLLECTPATH = "protected/cache/staffCollect/";
-	private function showCache($path) {
-		if (file_exists ( $path )) {
-			echo "<!DOCTYPE html>";
-			include $path;
-			die ();
-		}
-	}
-	private function cacheFile($path) {
-		$content = ob_get_contents ();
-		$fp = fopen ( $path, "w" );
-		fwrite ( $fp, $content );
-		fclose ( $fp );
-	}
-	private function collectHtml($receiptCollectList = array(), $itemCategory = "日常相关费用", $classType = "b") {
-		$collectHtml = "";
-		$sumPrice = 0.00;
-		for($i = 1; $i <= 12; $i ++) {
-			$falg = true;
-			foreach ( $receiptCollectList as $key => $value ) {
-				if ($value ['itemCategory'] == $itemCategory && $value ['month'] == $i) {
-					$sumPrice += $value ['price'];
-					if ($classType == "b") {
-						$collectHtml .= '<td class="colGreen taR">¥' . $value ['price'] . '</td>';
-						$falg = false;
-						break;
-					} else {
-						$collectHtml .= '<td class="taR">¥' . $value ['price'] . '</td>';
-						$falg = false;
-						break;
-					}
-				}
-			}
-			if ($falg)
-				$collectHtml .= '<td class="taR">-</td>';
-		}
-		$collectHtml .= '<td class="taR colGreen">¥' . $sumPrice . '</td>';
-		return $collectHtml;
-	}
+	
 	public function beforeRun($resource, $action) {
 		Doo::loadClass ( 'XDeode' );
 		$XDeode = new XDeode ( 5 );
@@ -170,6 +129,199 @@ class ReceiptExtendController extends DooController {
 	}
 	
 	/**
+	 * 生成一个日常支出
+	 *
+	 * @param [type] $accountBook
+	 * @param [type] $expensesType
+	 * @param [type] $outlayAccountType
+	 * @param [type] $outlayAccountMsg
+	 * @param [type] $outlayPrice
+	 * @param [type] $outlayBank
+	 * @param [type] $outlayDate
+	 * @param [type] $outlayRemarks
+	 * @return void
+	 */
+	private function _saveOutlayAB($accountBook,$expensesType,$outlayAccountType,$outlayMsg,$outlayPrice,$outlayBank,$outlayDate,$outlayRemarks,$outlayAccountMsg){
+		$accountBook->expensesType = $expensesType;
+		$accountBook->expenditureType = $outlayAccountType;
+		$accountBook->expenditureMsg = $outlayMsg;
+		$accountBook->expenditurePrice = $outlayPrice;
+		$accountBook->expenditureBank = $outlayBank;
+		$accountBook->expenditureDate = $outlayDate;
+		$accountBook->depositMethod=$outlayAccountMsg;
+		$accountBook->remarks = $outlayRemarks;
+		$accountBook->bookSerial = "#IN" . date("Ymd") . mt_rand(1000, 9999);
+		$accountBook->inputDate = date("Y-m-d H:i:s");
+		$accountBook->inputStaff = $this->staff[0]['sid'];
+		$id = $accountBook->insert();
+		return $id;
+	}
+
+	/**
+	 * 产生一条汇总信息
+	 *
+	 * @param [type] $abDetail
+	 * @param [type] $accountBookStatistics
+	 * @return void
+	 */
+	private function _saveAccountBookStatistics($abDetail,$accountBookStatistics){
+		$item = array(
+			'date' => date("Y-m-d"),
+			'expenditureType' => $abDetail['expenditureType'],
+			'expenditureMsg' => $abDetail['expenditureMsg'],
+			'aid' => $abDetail['aid'],
+			'payPrice' => $abDetail['expenditurePrice'],
+			'expensesType' => $abDetail['expensesType']
+		);
+		$accountBookStatistics->setAccountBookStatistics($item);
+	}
+
+	/**
+	 * 理财相关操作
+	 *
+	 * @return void
+	 */
+	function paymentsFinancesDo(){
+		//支出部分
+		$outlayOperatingType = $this->get_args ( 'outlayOperatingType' ) ? $this->get_args ( 'outlayOperatingType' ) : "";
+		$outlayAccountType = $this->get_args ( 'outlayAccountType' ) ? $this->get_args ( 'outlayAccountType' ) : "";
+		$outlayAccountMsg = $this->get_args ( 'outlayAccountMsg' ) ? $this->get_args ( 'outlayAccountMsg' ) : "";
+		$outlayBank = $this->get_args ( 'outlayBank' ) ? $this->get_args ( 'outlayBank' ) : "";
+		$outlayMsg = $this->get_args ( 'outlayMsg' ) ? $this->get_args ( 'outlayMsg' ) : "";
+		$outlayDate = $this->get_args ( 'outlayDate' ) ? $this->get_args ( 'outlayDate' ) : "";
+		$outlayRemarks = $this->get_args ( 'outlayRemarks' ) ? $this->get_args ( 'outlayRemarks' ) : "";
+		
+		$outlayPrice = is_numeric ( $this->get_args ( 'outlayPrice' ) ) ? $this->get_args ( 'outlayPrice' ) : 0;
+		//收入部分
+		$revenueOperatingType = $this->get_args ( 'revenueOperatingType' ) ? $this->get_args ( 'revenueOperatingType' ) : "";
+		$revenueAccountType = $this->get_args ( 'revenueAccountType' ) ? $this->get_args ( 'revenueAccountType' ) : "";
+		$revenueAccountMsg = $this->get_args ( 'revenueAccountMsg' ) ? $this->get_args ( 'revenueAccountMsg' ) : "";
+		$revenueBank = $this->get_args ( 'revenueBank' ) ? $this->get_args ( 'revenueBank' ) : "";
+		$revenueMsg = $this->get_args ( 'revenueMsg' ) ? $this->get_args ( 'revenueMsg' ) : "";
+		$revenueDate = $this->get_args ( 'revenueDate' ) ? $this->get_args ( 'revenueDate' ) : "";
+		$revenueRemarks = $this->get_args ( 'revenueRemarks' ) ? $this->get_args ( 'revenueRemarks' ) : "";
+		
+		$revenuePrice = is_numeric ( $this->get_args ( 'revenuePrice' ) ) ? $this->get_args ( 'revenuePrice' ) : 0;
+
+		//信息完整性检查
+		if(!empty ( $outlayOperatingType ) &&!empty ( $outlayAccountType ) && ! empty ( $outlayPrice ) && ! empty ( $outlayMsg ) && ! empty ( $outlayBank ) && ! empty ( $outlayDate ) && !empty($outlayAccountMsg) &&
+		!empty ( $revenueOperatingType ) &&!empty ( $revenueAccountType ) && ! empty ( $revenuePrice ) && ! empty ( $revenueMsg ) && ! empty ( $revenueBank ) && ! empty ( $revenueDate )){
+			Doo::loadClass ( 'XDeode' );
+			$XDeode = new XDeode ( 5 );
+			Doo::loadModel ( "accountBook" );
+			Doo::loadModel ( "accountBookStatistics" );
+			Doo::loadModel ( 'wasteBook' );
+
+			//处理支出信息
+			//1.1-理财支出
+			if($outlayOperatingType=='finances'){
+				//信息完整性判断
+				$accountType='';
+				if ($outlayAccountMsg == '固定') {
+					$accountType = 9;
+				} elseif ($outlayAccountMsg == '活期') {
+					$accountType = 10;
+				}
+				if(empty($accountType)){
+					die ( '固定或活期  illegal request' );
+				}
+				
+				//流水使用
+				$accountBank='';
+				if($outlayAccountType=='广发理财'){
+					$accountBank='CGBDeposit';
+				}elseif($outlayAccountType=='工行理财'){
+					$accountBank = 'ICBCDeposit';
+				}elseif($outlayAccountType=='个人理财(广发)'){
+					$accountBank = 'CGBPersonalDeposit';
+				}
+				if(empty($accountBank)){
+					die ( '理财银行  illegal request' );
+				}
+
+				//1-1-1-日常支出
+				 $accountBook = new accountBook ();
+				// $accountBook->expensesType = 2;
+				// $accountBook->expenditureType = $outlayAccountType;
+				// $accountBook->expenditureMsg = $outlayAccountMsg;
+				// $accountBook->expenditurePrice = $outlayPrice;
+				// $accountBook->expenditureBank = $outlayBank;
+				// $accountBook->expenditureDate = $outlayDate;
+				// $accountBook->remarks = $outlayRemarks;
+				// $accountBook->bookSerial = "#IN" . date ( "Ymd" ) . mt_rand ( 1000, 9999 );
+				// $accountBook->inputDate = date ( "Y-m-d H:i:s" );
+				// $accountBook->inputStaff = $this->staff [0] ['sid'];
+				// $outlayId = $accountBook->insert ();
+				$outlayId =$this->_saveOutlayAB($accountBook,2,11,$outlayMsg,$outlayPrice,$outlayAccountType,$outlayDate,$outlayRemarks,$outlayAccountMsg);
+				//1-1-2 理财支出汇总
+				$abDetail = $accountBook->getAccountBookByAid ( $outlayId );
+				$accountBookStatistics = new accountBookStatistics ();
+				$this->_saveAccountBookStatistics($abDetail,$accountBookStatistics);
+				// $item = array (
+				// 		'date' => date ( "Y-m-d" ),
+				// 		'expenditureType' => $abDetail ['expenditureType'],
+				// 		'expenditureMsg' => $abDetail ['expenditureMsg'],
+				// 		'aid' => $abDetail ['aid'],
+				// 		'payPrice' => $abDetail ['expenditurePrice'],
+				// 		'expensesType' => $abDetail ['expensesType'] 
+				// );
+				// $accountBookStatistics->setAccountBookStatistics ( $item );
+				//1-1-3 理财-流水支出
+				$wasteBook = new wasteBook ();
+				$itemWaste = array (
+						'expensesType' => 2,
+						'accountType' => $accountType,
+						'dailyExpenditureType' => $outlayAccountType,
+						'accountPriceShow' => $outlayPrice,
+						'accountPrice' => - $outlayPrice,
+						'dataID' => $outlayId,
+						'accountBank' => $accountBank,
+						'category' => $this->staff [0] ['category'],
+						'cid' => $this->staff [0] ['cid'],
+						'name' => $this->staff [0] ['username'],
+						'sid' => $this->staff [0] ['sid'],
+						'inputDate' => $outlayDate ,
+						'createAt'=>date ( "Y-m-d H:i:s" ),
+						'synPaymentDate'=>1,
+				);		
+				$wasteBook->setAccountBookStatistics ( $itemWaste );
+
+			}
+			//1.2-银行支出
+			if($outlayOperatingType=='bank'){
+				
+				$accountBank = '';
+				if ($outlayBank == '纵横广发') {
+					$accountBank = 'CGBDeposit';
+				} elseif ($outlayBank == '纵横工行') {
+					$accountBank = 'ICBCDeposit';
+				} elseif ($outlayBank == '华润银行') {
+					$accountBank = 'HUADeposit';
+				} elseif ($outlayBank == '个人广发') {
+					$accountBank = 'PersonalDeposit';
+				}
+				if (empty ( $accountBank )){
+					die ( 'illegal request' );
+				}
+
+				//1-2-1-日常支出
+				$accountBook = new accountBook ();
+				$outlayId =$this->_saveOutlayAB($accountBook,2,7,$outlayAccountMsg,$outlayPrice,$outlayBank,$outlayDate,$outlayRemarks);
+				//1-2-2 理财支出汇总
+				$abDetail = $accountBook->getAccountBookByAid ( $outlayId );
+				$accountBookStatistics = new accountBookStatistics ();
+				$this->_saveAccountBookStatistics($abDetail,$accountBookStatistics);
+				//1-1-3 理财-流水支出
+
+
+			}
+
+
+		}
+		return '/payments';
+	}
+
+	/**
 	 * 查看审批培训班结算
 	 */
 	function receiptTrain() {
@@ -2249,13 +2401,13 @@ class ReceiptExtendController extends DooController {
 			$receiptList[$key]['balance']='';
 			if($value['Rtype']==1){
 				$receiptList[$key]['balance']=$value['sum']-=$value['loanSum'];
-				$receiptList[$key]['balanceABS']=abs($receiptList[$key]['balance']);
+				$receiptList[$key]['balanceABS']=sprintf("%.2f",abs($receiptList[$key]['balance']));
 			}elseif($value['Rtype']==3){
 				$payment=$this->_getReceiptTrainPayment($value['invoiceTrainId'],$value['trainLoanRid'],$value['rid']);
 				$receiptList[$key]['payment']=$payment;
-				$receiptList[$key]['paymentABS']=abs($payment);
+				$receiptList[$key]['paymentABS']=sprintf("%.2f",abs($payment));
 			}
-			$receiptList[$key]['amountABS']=abs($value['amount']);
+			$receiptList[$key]['amountABS']=sprintf("%.2f",abs($value['amount']));
 		}
 		
 		
@@ -3217,5 +3369,3 @@ class ReceiptExtendController extends DooController {
 		return $on_page != 0 ? $on_page - 1 : $on_page;
 	}
 }
-
-?>

+ 2 - 0
protected/model/accountBook.php

@@ -5,6 +5,7 @@ class accountBook extends DooModel {
 	public $expensesType;
 	public $accountType;
 	public $accountMsg;
+	public $depositMethod;
 	public $receivedPrice;
 	public $receivedMsg;
 	public $receivedBank;
@@ -27,6 +28,7 @@ class accountBook extends DooModel {
 			'expensesType',
 			'accountType',
 			'accountMsg',
+			'depositMethod',
 			'receivedPrice',
 			'receivedMsg',
 			'receivedBank',

+ 47 - 46
protected/view/expenses/payments.html

@@ -251,9 +251,7 @@
 				<div class="modal-header">
 					<h3>录入日常收支</h3>
 				</div>
-				<div class="modal-body saeaList">
-				
-				
+				<div class="modal-body saeaList" style="max-height:490px !important;">
 				
 					<table class="table table-bordered table-condensed">
 						<tbody>
@@ -273,7 +271,7 @@
 
 				<!-- 理财 -->
 				<div id="FinancialBox" style="display:none">
-				<form action="/paymentsIncomeDo" method="post" id="paymentsIncome" class="nice-validator n-default" novalidate="novalidate"></form>
+				<form action="/paymentsFinancesDo" method="post" id="paymentsIncome" class="nice-validator n-default" novalidate="novalidate">
 				<table class="table table-bordered table-condensed">
 					<tbody>
 						<tr>
@@ -289,55 +287,53 @@
 										<tr>
 											<th class="taC">支出</th>
 											<td>
-												<select>
-													<option>理财</option>
-													<option>银行</option>
+												<select name="outlayOperatingType" >
+													<option value="finances">理财</option>
+													<option value="bank">银行</option>
 												</select>
 											</td>
 										</tr>
-										<tr>
+										<tr outlay_finances_Node >
 											<th class="taC">理财</th>
 											<td>
-												<select>
-													<option>广发理财</option>
-													<option>工行理财</option>
+												<select name="outlayAccountType" >
+													<option value='广发理财'>广发理财</option>
+													<option value='工行理财'>工行理财</option>
+													<option value='个人理财(广发)'>个人理财(广发)</option>
 												</select>
 
-												<div node-accountMsg7 >
-													可提取余额:¥{{statisticsList.financingPrice.0.financingPrice}}
-													<br/>
-													<label class="radio inline"><input name="accountMsg7" value="公司固定" checked type="radio">公司固定</label>
-													<label class="radio inline"><input name="accountMsg7" value="公司活期" type="radio">公司活期</label>
-													<label class="radio inline"><input name="accountMsg7" value="个人(GR)" type="radio">个人(GR)</label>
+												<div>
+													<label class="radio inline"><input name="outlayAccountMsg" value="固定" checked type="radio">固定</label>
+													<label class="radio inline"><input name="outlayAccountMsg" value="活期" type="radio">活期</label>
+													<!-- <label class="radio inline"><input name="outlayAccountMsg" value="个人理财固定" type="radio">个人理财固定</label> -->
 												</div>
 											</td>
 										</tr>
-										<tr node-incomeBank>
+										<tr outlay_bank_node style="display: none;">
 											<th class="taC">银行</th>
 											<td>
-												<select name="receivedBank">
+												<select name="outlayBank">
 													<option value="纵横广发">纵横广发</option>
-													<option value="个人广发">个人广发</option>
-													<option value="华润银行">(广发)纵横知道</option>
+													<option value="个人存款">个人存款</option>
 													<option value="纵横工行">纵横工行</option>
 												</select>
 											</td>
 										</tr>
 										<tr>
 											<th class="taC">支出金额</th>
-											<td><input value="0" placeholder="输入开票金额" pattern="[0-9]" min="0" step="0.01" type="number"></td>
+											<td><input name="outlayPrice" value="0" placeholder="输入开票金额" pattern="[0-9]" min="0" step="0.01" type="number"></td>
 										</tr>
 										<tr>
 											<th class="taC">支出信息</th>
-											<td><input type="text"></td>
+											<td><input name="outlayMsg" type="text"></td>
 										</tr>
 										<tr>
 											<th class="taC">银行支出时间</th>
-											<td><input type="date"></td>
+											<td><input name="outlayDate" type="date" value="{{date}}"></td>
 										</tr>
 										<tr>
 											<th class="taC">备注</th>
-											<td><textarea class="form-control" name="remarks" rows="3"></textarea></td>
+											<td><textarea name="outlayRemarks" class="form-control" name="remarks" rows="3"></textarea></td>
 										</tr>
 									</tbody>
 								</table>
@@ -352,56 +348,53 @@
 										<tr>
 											<th class="taC">收款</th>
 											<td>
-												<select>
-													<option>理财</option>
-													<option>银行</option>
+												<select name="revenueOperatingType">
+													<option value="finances">理财</option>
+													<option value="bank">银行</option>
 												</select>
 											</td>
 										</tr>
-										<tr>
+										<tr revenue_finances_Node >
 											<th class="taC">理财</th>
 											<td>
-												<select>
-													<option>广发理财</option>
-													<option>工行理财</option>
+												<select name="revenueAccountType" >
+													<option value='7'>广发理财</option>
+													<option value='9'>工行理财</option>
 												</select>
 
-												<div node-accountMsg7 >
-													可提取余额:¥{{statisticsList.financingPrice.0.financingPrice}}
-													<br/>
-													<label class="radio inline"><input name="accountMsg7" value="公司固定" checked type="radio">公司固定</label>
-													<label class="radio inline"><input name="accountMsg7" value="公司活期" type="radio">公司活期</label>
-													<label class="radio inline"><input name="accountMsg7" value="个人(GR)" type="radio">个人(GR)</label>
+												<div>
+													<label class="radio inline"><input name="revenueAccountMsg" value="公司固定" checked type="radio">公司固定</label>
+													<label class="radio inline"><input name="revenueAccountMsg" value="公司活期" type="radio">公司活期</label>
+													<label class="radio inline"><input name="revenueAccountMsg" value="个人理财固定" type="radio">个人理财固定</label>
 												</div>
 											</td>
 										</tr>
 
-										<tr node-incomeBank>
+										<tr revenue_bank_node style="display: none;">
 											<th class="taC">银行</th>
 											<td>
-												<select name="receivedBank">
+												<select name="revenueBank">
 													<option value="纵横广发">纵横广发</option>
-													<option value="个人广发">个人广发</option>
-													<option value="华润银行">(广发)纵横知道</option>
+													<option value="个人存款">个人存款</option>
 													<option value="纵横工行">纵横工行</option>
 												</select>
 											</td>
 										</tr>
 										<tr>
 											<th class="taC">收款金额</th>
-											<td><input name="receivedPrice" id="receivedPrice"  value="0" placeholder="输入开票金额" pattern="[0-9]" min="0" step="0.01" type="number"></td>
+											<td><input name="revenuePrice"  value="0" placeholder="输入开票金额" pattern="[0-9]" min="0" step="0.01" type="number"></td>
 										</tr>
 										<tr>
-											<th class="taC">收款信息</th><td><input name="receivedMsg" id="receivedMsg"  value="" type="text"></td>
+											<th class="taC">收款信息</th><td><input name="revenueMsg" id="receivedMsg"  value="" type="text"></td>
 										</tr>
 										
 										<tr>
-											<th class="taC">银行到款时间</th><td><input name="receivedDate" id="receivedDate"  value="{{date}}" type="date"></td>
+											<th class="taC">银行到款时间</th><td><input name="revenueDate" id="receivedDate"  value="{{date}}" type="date"></td>
 										</tr>
 										
 										<tr>
 											<th class="taC">备注</th>
-											<td><textarea class="form-control" name="remarks" rows="3"></textarea></td>
+											<td><textarea class="form-control" name="revenueRemarks" rows="3"></textarea></td>
 										</tr>
 									</tbody>
 								</table>
@@ -409,6 +402,13 @@
 						</tr>
 					</tbody>
 				</table>
+
+				<div class="modal-footer">
+					<input type="submit" value="确认录入" class="button">
+					<a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
+				</div>
+
+			</form>
 				</div>
 
 				<!-- 银行互转 -->
@@ -521,6 +521,7 @@
 								
 								<option value='7'>广发理财</option>
 								<option value='9'>工行理财</option>
+								
 								<option value='11'>广发存款</option>
 								<option value='12'>工行存款</option>
 

+ 1 - 0
protected/view/receipt/feeTravelEdi.html

@@ -37,6 +37,7 @@
 
 									<input type="hidden" name="rid" value="{{rid}}"/>
 			  				<input type="hidden" name="receiptClass" value="trave"/>
+			  				<input type="hidden" name="traveVer" value="trave1"/>
 							<input type="hidden" name="itinerary" id="itinerary" value="" />
 
 									<table class="table table-bordered table-condensed table-hover">