Lyyyi hai 2 semanas
pai
achega
6d5a95d193
Modificáronse 1 ficheiros con 24 adicións e 24 borrados
  1. 24 24
      OASystem/OASystem.Api/Controllers/StatisticsController.cs

+ 24 - 24
OASystem/OASystem.Api/Controllers/StatisticsController.cs

@@ -8042,6 +8042,19 @@ WHERE
 
         #region 企业利润
 
+        /// <summary>
+        /// 日常费用排除项
+        /// </summary>
+        private readonly List<int> _priceTypeIds = new List<int>()
+        {
+            686, // 信用卡还款
+            687, // 张总私人费用
+            688, // 代报销社保生育补贴
+            306, // 人事行政费用-张总家用类
+            325, // 会展部备用金
+            689  // 团组签证保险
+        };
+
         /// <summary>
         /// 企业利润 infos
         /// </summary>
@@ -8609,18 +8622,8 @@ WHERE
             var groupItems = data.GroupItems;
             var dailyItems = data.DailyItems;
 
-            var priceTypeIds = new List<int>() {
-                686, // 686 信用卡还款
-                687, // 687 张总私人费用
-                688, // 688 代报销社保生育补贴
-                688, // 688 代报销社保生育补贴
-                306, // 306 人事行政费用-张总家用类
-                325, // 325 会展部备用金
-                689, // 689 团组签证保险
-            };
-
             var companyDailyItems = dailyItems
-                .Where(x => !priceTypeIds.Contains(x.PriceTypeId))
+                .Where(x => !_priceTypeIds.Contains(x.PriceTypeId))
                 .GroupBy(x => x.CompanyName)
                 .Select(g => new { CompanyName = g.Key, CNYTotal = g.Sum(x => x.CNYTotal) })
                 .OrderBy(x => x.CNYTotal)
@@ -8789,17 +8792,6 @@ WHERE
             DateTime monthBegin = new DateTime(monthBase.Year, monthBase.Month, 1);
             DateTime monthEnd = monthBegin.AddMonths(1).AddSeconds(-1); // 自动处理 28/30/31 天及跨年
 
-            //业务类型
-            var priceTypeIds = new List<int>() {
-                686, //686 信用卡还款
-                687, //687 张总私人费用
-                688, //688 代报销社保生育补贴
-                688, //688 代报销社保生育补贴
-                306, //306 人事行政费用-张总家用类
-                325, //325 会展部备用金
-                689, //689 团组签证保险
-            };
-
             var montData = await CorporateProfitInfos(monthBegin.ToString("yyyy-MM-dd HH:mm:ss"), monthEnd.ToString("yyyy-MM-dd HH:mm:ss"));
             var monthGroupItems = montData.GroupItems;
             var monthDailyItems = montData.DailyItems;
@@ -8894,7 +8886,7 @@ WHERE
                 designer.SetDataSource("YearDepartFixedFees", yearDepartFixedExpenses.ToString("#0.00"));  //本年各部门基础固定费用明细费用
 
                 // 填表时间
-                string fillingTime = $"填报时间:{DateTime.Now.ToString("yyyy.MM.dd")}";
+                string fillingTime = $"填报时间:{DateTime.Now:yyyy.MM.dd}";
                 designer.SetDataSource("FillingTime", fillingTime);
                 #endregion
 
@@ -9220,7 +9212,7 @@ WHERE
 
                 #endregion
 
-                // 办公费用
+                // 办公费用 
                 // 月
                 decimal officePirceMonth = monthStaffCostTotal + monthWorkCostTotal + monthSalesCostTotal + monthOtherCostTotal + monthDyhCostTotal + monthBasicCostTotal;
                 designer.SetDataSource("officePirceMonth", officePirceMonth.ToString("#0.00"));
@@ -9229,6 +9221,14 @@ WHERE
                 decimal officePirceYear = yearStaffCostTotal + yearWorkCostTotal + yearSalesCostTotal + yearOtherCostTotal + yearDyhCostTotal + yearBasicCostTotal;
                 designer.SetDataSource("officePirceYear", officePirceYear.ToString("#0.00"));
 
+                // 排除不统计的费用类型后的小计
+                // 月
+                decimal officePirceMonth1 = monthDailyItems.Where(x => !_priceTypeIds.Contains(x.PriceTypeId)).Sum(x => x.ItemTotal);
+                designer.SetDataSource("officePirceMonth1", officePirceMonth1.ToString("#0.00"));
+
+                // 年
+                decimal officePirceYear1 = yearDailyItems.Where(x => !_priceTypeIds.Contains(x.PriceTypeId)).Sum(x => x.ItemTotal);
+                designer.SetDataSource("officePirceYear1", officePirceYear1.ToString("#0.00"));
 
                 //designer.SetDataSource("DailyView", dailyViewItems);
                 var dt = CommonFun.ToDataTableArray(dailyViewItems);