Browse Source

应收报表-增加超支费用计算

jiangjc 11 months ago
parent
commit
d11a1d3e34
1 changed files with 13 additions and 5 deletions
  1. 13 5
      OASystem/OASystem.Api/Controllers/FinancialController.cs

+ 13 - 5
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -1602,7 +1602,8 @@ namespace OASystem.API.Controllers
                     decimal sum_fr = 0M;
                     decimal sum_pr = 0M;
                     string str_client = string.Empty;
-                    decimal sum_other = 0M;
+                    decimal sum_other = 0M; //收款退还
+                    decimal sum_extra = 0M; //超支费用
                     decimal balance = 0M;
                     string str_schedule = string.Empty;
 
@@ -1634,17 +1635,24 @@ namespace OASystem.API.Controllers
                     List<Fin_OtherPrice> list_other = _sqlSugar.SqlQueryable<Fin_OtherPrice>(sql_other).ToList();
                     sum_other = list_other.Sum(s => s.Price);
 
-                    item_rst.frPrice = sum_fr.ToString("#0.00");
+                    //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_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;
+                    sumAll_fr += (sum_fr + sum_extra);
                     sumAll_pr += (sum_pr - sum_other);
-                    sumAll_balance += (sum_fr - (sum_pr - sum_other));
+                    sumAll_balance += ((sum_fr + sum_extra) - (sum_pr - sum_other));
 
                 }