Commit fdc174d4 authored by liudong1993's avatar liudong1993

1

parent b92d45a8
......@@ -677,11 +677,11 @@ GROUP BY ClassId;";
//预计退款金额
decimal backMoney = 0;
//违约金
decimal breakContractPrice = (orderModel.TotalClassHours - FinishHours) * classHourPrice * Convert.ToDecimal(0.1);
//decimal breakContractPrice = (orderModel.TotalClassHours - FinishHours) * classHourPrice * Convert.ToDecimal(0.1);
//可退总金额
decimal OrderMoney = orderModel.Income + orderModel.PlatformTax - orderModel.Refund - orderModel.CoursewareFee - orderModel.TextbookFee - orderModel.CommissionMoney;
backMoney = OrderMoney / orderModel.GuestNum - FinishHours * classHourPrice - breakContractPrice;
backMoney = OrderMoney / orderModel.GuestNum - FinishHours * classHourPrice;// - breakContractPrice; 违约金 先排除
return backMoney;
}
......
......@@ -171,7 +171,7 @@ GROUP BY g.RenewState";
public List<RB_Sell_Achievements_Emp_ViewModel> GetSellAchievementsRankStat(List<string> monthList, int group_Id)
{
string sql = $@"SELECT e.Type,e.EmpId,e.Rate,e.IsDept,p.Periods,SUM(e.PushMoney) as PushMoney,Max(e.SaleMoney) as SaleMoney,
SUM(e.OrderSaleMoney) as OrderSaleMoney,SUM(o.PreferPrice - o.DiscountMoney - o.PlatformTax - o.CoursewareFee - o.TotalClassHours - e.OrderSaleMoney) as CommissionMoney
SUM(e.OrderSaleMoney) as OrderSaleMoney,SUM(o.PreferPrice - o.DiscountMoney - o.PlatformTax - o.TextbookFee - e.OrderSaleMoney) as CommissionMoney
FROM rb_sell_achievements_emp e
INNER JOIN rb_sell_achievements_periods p on e.PeriodsId = p.Id
INNER JOIN rb_order o on e.OrderId = o.OrderId
......@@ -188,9 +188,9 @@ GROUP BY e.Type,e.EmpId,e.Rate,e.IsDept,p.Periods";
/// <returns></returns>
public List<RB_Sell_Achievements_Emp_ViewModel> GetAllRefundWaitPendingList(int group_Id)
{
string sql = $@"SELECT e.*,(o.Income - o.Refund - o.CoursewareFee - o.TotalClassHours) as OrderMoney,o.Refund FROM rb_sell_achievements_emp e
string sql = $@"SELECT e.*,(o.Income - o.Refund - o.TextbookFee) as OrderMoney,o.Refund FROM rb_sell_achievements_emp e
LEFT JOIN rb_order o on e.OrderId =o.OrderId
WHERE e.Group_Id={group_Id} and o.CreateTime >='2024-08-01' and e.GiveOutState =1 and (e.Type=2 or (e.Type=1 and e.IsDept=1)) and o.PreferPrice >0 and e.OrderSaleMoney <> (o.Income - o.Refund - o.CoursewareFee - o.TotalClassHours) and e.OrderId>0 and e.Remark not like '%退款回扣%'
WHERE e.Group_Id={group_Id} and o.CreateTime >='2024-08-01' and e.GiveOutState =1 and (e.Type=2 or (e.Type=1 and e.IsDept=1)) and o.PreferPrice >0 and e.OrderSaleMoney <> (o.Income - o.Refund - o.TextbookFee) and e.OrderId>0 and e.Remark not like '%退款回扣%'
ORDER BY e.OrderId ASC ";
return Get<RB_Sell_Achievements_Emp_ViewModel>(sql).ToList();
}
......
......@@ -1462,7 +1462,7 @@ namespace Edu.WebApi.Controllers.Finance
})
}),
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.Expend) / x.Unit_Price, 2, MidpointRounding.AwayFromZero) : 0,
EffectiveClassHours = x.Unit_Price > 0 ? Math.Round((x.Income > 0 ? (x.Income - x.Expend - x.TotalBookFee2 - x.TotalClassFee2) : (x.Income - x.Expend)) / 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