| 
					
				 | 
			
			
				@@ -1643,9 +1643,9 @@ namespace OASystem.API.Controllers 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             List<PostSyntheticalReceivableByDateRangeView> list_rst = _sqlSugar.SqlQueryable<PostSyntheticalReceivableByDateRangeView>(sql).ToList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            decimal sumAll_fr = 0M; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            decimal sumAll_pr = 0M; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            decimal sumAll_balance = 0M; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            decimal sumAll_fr = 0M; //应收 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            decimal sumAll_pr = 0M; //已收 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            decimal sumAll_balance = 0M; //尾款 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (list_rst.Count > 0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1667,8 +1667,8 @@ namespace OASystem.API.Controllers 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     decimal sum_fr = 0M; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     decimal sum_pr = 0M; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     string str_client = string.Empty; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    decimal sum_other = 0M; //收款退还 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    decimal sum_extra = 0M; //超支费用 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    //decimal sum_other = 0M; //收款退还 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    //decimal sum_extra = 0M; //超支费用 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     decimal balance = 0M; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     string str_schedule = string.Empty; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1695,29 +1695,42 @@ namespace OASystem.API.Controllers 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         str_client = str_client.TrimEnd(';'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    //3. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    string sql_other = string.Format(@" Select * From Fin_OtherPrice where diid = {0} and isdel = 0 and RefundType = 1 and PayType=1 ", diId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    List<Fin_OtherPrice> list_other = _sqlSugar.SqlQueryable<Fin_OtherPrice>(sql_other).ToList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    sum_other = list_other.Sum(s => s.Price); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    //4. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    string sql_extra = string.Format(@" Select c.* From Fin_GroupExtraCost f  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-Inner join Grp_CreditCardPayment c On f.Id = c.CId  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-Where c.CTable = 1015 And c.IsPay = 1 And f.IsDel = 0 And c.IsDel = 0 And f.DiId = {0} ", diId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    List<Grp_CreditCardPayment> list_extra = _sqlSugar.SqlQueryable<Grp_CreditCardPayment>(sql_extra).ToList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    sum_extra = list_extra.Sum(s => s.RMBPrice); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    item_rst.frPrice = (sum_fr + sum_extra).ToString("#0.00"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    item_rst.prPrice = (sum_pr - sum_other).ToString("#0.00"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    item_rst.balPrice = ((sum_fr + sum_extra) - (sum_pr - sum_other)).ToString("#0.00"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    //                    //3. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    //                    string sql_other = string.Format(@" Select * From Fin_OtherPrice where diid = {0} and isdel = 0 and RefundType = 1 and PayType=1 ", diId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    //                    List<Fin_OtherPrice> list_other = _sqlSugar.SqlQueryable<Fin_OtherPrice>(sql_other).ToList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    //                    sum_other = list_other.Sum(s => s.Price); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    //                    //4. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    //                    string sql_extra = string.Format(@" Select c.* From Fin_GroupExtraCost f  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    //Inner join Grp_CreditCardPayment c On f.Id = c.CId  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    //Where c.CTable = 1015 And c.IsPay = 1 And f.IsDel = 0 And c.IsDel = 0 And f.DiId = {0} ", diId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    //                    List<Grp_CreditCardPayment> list_extra = _sqlSugar.SqlQueryable<Grp_CreditCardPayment>(sql_extra).ToList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    //                    sum_extra = list_extra.Sum(s => s.RMBPrice); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    //item_rst.frPrice = (sum_fr + sum_extra).ToString("#0.00"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    //item_rst.prPrice = (sum_pr - sum_other).ToString("#0.00"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    //item_rst.balPrice = ((sum_fr + sum_extra) - (sum_pr - sum_other)).ToString("#0.00"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    //item_rst.prClient = str_client; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    //item_rst.schedule = str_schedule; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    //string tempVisitDate = Convert.ToDateTime(item_rst.visitDate).ToString("yyyy-MM-dd"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    //sumAll_fr += (sum_fr + sum_extra); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    //sumAll_pr += (sum_pr - sum_other); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    //sumAll_balance += ((sum_fr + sum_extra) - (sum_pr - sum_other)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    item_rst.frPrice = sum_fr.ToString("#0.00"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    item_rst.prPrice = sum_pr.ToString("#0.00"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    item_rst.balPrice = (sum_fr - sum_pr).ToString("#0.00"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     item_rst.prClient = str_client; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     item_rst.schedule = str_schedule; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     string tempVisitDate = Convert.ToDateTime(item_rst.visitDate).ToString("yyyy-MM-dd"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    sumAll_fr += (sum_fr + sum_extra); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    sumAll_pr += (sum_pr - sum_other); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    sumAll_balance += ((sum_fr + sum_extra) - (sum_pr - sum_other)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    sumAll_fr += sum_fr; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    sumAll_pr += sum_pr; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    sumAll_balance += sum_fr - sum_pr; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 |