Commit a0869354 authored by liudong1993's avatar liudong1993

1

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