20231008项目合同大数据展示、费用计划加合计行

This commit is contained in:
2023-10-08 10:59:38 +08:00
parent b574fe7220
commit 3c3c531016
8 changed files with 122 additions and 47 deletions
@@ -182,6 +182,7 @@ namespace FineUIPro.Web.HSSE.CostGoods
orderby y.Year, x.SupSortIndex, x.SortIndex
select new { x.ExpenseDetailId, x.ExpenseId, y.Year, x.SupCostTypeId, x.SupCostTypeName, x.SupSortIndex, x.CostType, x.CostTypeName, x.SortIndex, x.CostMoney };
var getType = (from x in getDetail select new { x.SupSortIndex, x.SortIndex, x.CostType }).Distinct();
int j = 1;
foreach (var item in getType)
{
var getD = getDetail.FirstOrDefault(x => x.CostType == item.CostType);
@@ -208,8 +209,30 @@ namespace FineUIPro.Web.HSSE.CostGoods
}
row[r] = getDetail.Where(x => x.CostType == item.CostType).Sum(x => x.CostMoney ?? 0);
table.Rows.Add(row);
j = r + 1;
}
}
DataRow rowSum = table.NewRow();
rowSum[0] = SQLHelper.GetNewID();
rowSum[1] = "";
rowSum[2] = "合计";
int rSum = 3;
for (int i = 0; sDate + i <= eDate; i++)
{
var getV = getDetail.Where(x => x.Year == sDate + i );
if (getV.Count() > 0)
{
rowSum[rSum] = getV.Sum(x => x.CostMoney ?? 0);
}
else
{
rowSum[rSum] = 0.00;
}
rSum = rSum + 1;
}
table.Rows.Add(rowSum);
}