Commit 7db88b63 authored by 黄奎's avatar 黄奎

代码优化

parent 382d6e20
......@@ -2500,7 +2500,7 @@ namespace Edu.Module.Finance
{
Money = NewfinanceList.Where(y => y.Type == WFTempLateClassEnum.IN).Sum(x => x.Money.Value);
Fee = NewfinanceList.Where(x => x.Type == WFTempLateClassEnum.IN && x.Fee > 0).GroupBy(x => new { x.FrID, x.Fee }).Sum(x => x.Key.Fee ?? 0);
Money = Money - Fee;
Money -= Fee;
Money = NewfinanceList.Where(y => y.Type == WFTempLateClassEnum.OUT).Sum(x => x.Money.Value) - Money;
}
else
......@@ -2512,7 +2512,7 @@ namespace Edu.Module.Finance
//收
Money = NewfinanceList.Where(y => y.Type == WFTempLateClassEnum.IN && y.Is_Cashier == 1).Sum(x => x.Money.Value);
Fee = NewfinanceList.Where(x => x.Type == WFTempLateClassEnum.IN && x.Is_Cashier == 1 && x.Fee > 0).GroupBy(x => new { x.FrID, x.Fee }).Sum(x => x.Key.Fee ?? 0);
Money = Money - Fee;
Money -= Fee;
//支
Money = NewfinanceList.Where(y => y.Type == WFTempLateClassEnum.OUT && y.Is_Cashier == 1).Sum(x => x.Money.Value) - Money;
}
......@@ -2520,7 +2520,7 @@ namespace Edu.Module.Finance
{
Money = NewfinanceList.Where(y => y.Type == WFTempLateClassEnum.IN).Sum(x => x.Money.Value);
Fee = NewfinanceList.Where(x => x.Type == WFTempLateClassEnum.IN && x.Fee > 0).GroupBy(x => new { x.FrID, x.Fee }).Sum(x => x.Key.Fee ?? 0);
Money = Money - Fee;
Money -= Fee;
Money = NewfinanceList.Where(y => y.Type == WFTempLateClassEnum.OUT).Sum(x => x.Money.Value) - Money;
}
}
......@@ -2529,7 +2529,7 @@ namespace Edu.Module.Finance
//预付款 冲抵
Money = NewfinanceList.Sum(x => x.Money.Value);
Fee = NewfinanceList.Where(x => x.Fee > 0).GroupBy(x => new { x.FrID, x.Fee }).Sum(x => x.Key.Fee ?? 0);
Money = Money - Fee;
Money -= Fee;
var MatchList = NewfinanceList.Where(x => x.MatchMoney > 0).ToList();
if (MatchList.Count() > 0)
{
......@@ -2540,7 +2540,7 @@ namespace Edu.Module.Finance
{
DelMoney += MatchList.Where(x => x.FrID == item).FirstOrDefault()?.MatchMoney ?? 0;
}
Money = Money - DelMoney;
Money -= DelMoney;
}
}
else
......@@ -2549,13 +2549,13 @@ namespace Edu.Module.Finance
{
Money = NewfinanceList.Where(y => y.Is_Cashier == 1).Sum(x => x.Money.Value);
Fee = NewfinanceList.Where(x => x.Is_Cashier == 1 && x.Fee > 0).GroupBy(x => new { x.FrID, x.Fee }).Sum(x => x.Key.Fee ?? 0);
Money = Money - Fee;
Money -= Fee;
}
else
{
Money = NewfinanceList.Sum(x => x.Money.Value);
Fee = NewfinanceList.Where(x => x.Fee > 0).GroupBy(x => new { x.FrID, x.Fee }).Sum(x => x.Key.Fee ?? 0);
Money = Money - Fee;
Money -= Fee;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment