Commit a0869354 authored by liudong1993's avatar liudong1993

1

parent a95f3980
...@@ -1023,14 +1023,14 @@ namespace Edu.WebApi.Controllers.Finance ...@@ -1023,14 +1023,14 @@ namespace Edu.WebApi.Controllers.Finance
x.CreateByPhoto, x.CreateByPhoto,
x.TotalCourseFee, x.TotalCourseFee,
x.TotalClassHours, x.TotalClassHours,
TotalUnitPrice = Math.Round(x.TotalCourseFee / x.TotalClassHours, 2, MidpointRounding.AwayFromZero), TotalUnitPrice = x.TotalClassHours > 0 ? Math.Round(x.TotalCourseFee / x.TotalClassHours, 2, MidpointRounding.AwayFromZero) : 0,
x.TotalBookFee, x.TotalBookFee,
x.TotalClassFee, x.TotalClassFee,
x.TotalSub, x.TotalSub,
x.TotalDiscountMoney, x.TotalDiscountMoney,
x.TotalMoney, x.TotalMoney,
x.Status, x.Status,
IncomeList = x.FinanceList.Where(x => x.Type == WFTempLateClassEnum.IN).Select(z => new IncomeList = x.FinanceList.Where(t => t.Type == WFTempLateClassEnum.IN).Select(z => new
{ {
z.FrID, z.FrID,
TradeDate = z.TradeDate.HasValue ? z.TradeDate.Value.ToString("yyyy-MM-dd") : "", TradeDate = z.TradeDate.HasValue ? z.TradeDate.Value.ToString("yyyy-MM-dd") : "",
...@@ -1055,7 +1055,7 @@ namespace Edu.WebApi.Controllers.Finance ...@@ -1055,7 +1055,7 @@ namespace Edu.WebApi.Controllers.Finance
y.AccountTypeId y.AccountTypeId
}) })
}), }),
ExpendList = x.FinanceList.Where(x => x.Type == WFTempLateClassEnum.OUT).Select(z => new ExpendList = x.FinanceList.Where(t => t.Type == WFTempLateClassEnum.OUT).Select(z => new
{ {
z.FrID, z.FrID,
CreateDate = z.CreateDate.HasValue ? z.CreateDate.Value.ToString("yyyy-MM-dd") : "", CreateDate = z.CreateDate.HasValue ? z.CreateDate.Value.ToString("yyyy-MM-dd") : "",
...@@ -1080,8 +1080,8 @@ namespace Edu.WebApi.Controllers.Finance ...@@ -1080,8 +1080,8 @@ namespace Edu.WebApi.Controllers.Finance
y.AccountTypeId y.AccountTypeId
}) })
}), }),
PreferPrice = x.FinanceList.Where(x => x.Type == WFTempLateClassEnum.IN).Sum(x => (x.Money ?? 0) + (x.Fee ?? 0)), PreferPrice = x.FinanceList.Where(t => t.Type == WFTempLateClassEnum.IN)?.Sum(x => (x.Money ?? 0) + (x.Fee ?? 0))??0,
EffectiveClassHours = Math.Round(x.Income / x.Unit_Price,2,MidpointRounding.AwayFromZero), EffectiveClassHours = x.Unit_Price > 0 ? Math.Round(x.Income / x.Unit_Price,2,MidpointRounding.AwayFromZero) : 0,
x.Income, x.Income,
x.Expend, x.Expend,
x.UseBookFee, x.UseBookFee,
......
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