Commit 96102e51 authored by liudong1993's avatar liudong1993

1、提成发放 直接 按订单收款金额发放 不扣除老师提成 + 返佣金额

parent 621dd23c
...@@ -828,25 +828,25 @@ namespace Edu.Module.Course ...@@ -828,25 +828,25 @@ namespace Edu.Module.Course
{ {
//续费订单 //续费订单
TRate = Convert.ToDecimal(TeacherRuleList.Where(x => x.SNO == 4).FirstOrDefault()?.Content ?? "0"); TRate = Convert.ToDecimal(TeacherRuleList.Where(x => x.SNO == 4).FirstOrDefault()?.Content ?? "0");
Remark = "教师续费订单提成:订单b2b返佣:" + bdCommission + ";订单业绩:" + (qitem.PreferPrice - qitem.DiscountMoney - bdCommission); Remark = "教师续费订单提成:订单b2b返佣:" + bdCommission + ";订单业绩:" + (qitem.PreferPrice - qitem.DiscountMoney);
} }
else if (qitem.ClassScrollType == 1) else if (qitem.ClassScrollType == 1)
{ {
//转介绍 //转介绍
TRate = Convert.ToDecimal(TeacherRuleList.Where(x => x.SNO == 1).FirstOrDefault()?.Content ?? "0"); TRate = Convert.ToDecimal(TeacherRuleList.Where(x => x.SNO == 1).FirstOrDefault()?.Content ?? "0");
Remark = "教师转介绍订单提成:订单b2b返佣:" + bdCommission + ";订单业绩:" + (qitem.PreferPrice - qitem.DiscountMoney - bdCommission); Remark = "教师转介绍订单提成:订单b2b返佣:" + bdCommission + ";订单业绩:" + (qitem.PreferPrice - qitem.DiscountMoney);
} }
else if (qitem.ClassScrollType == 2) { else if (qitem.ClassScrollType == 2) {
//新订单 //新订单
TRate = Convert.ToDecimal(TeacherRuleList.Where(x => x.SNO == 5).FirstOrDefault()?.Content ?? "0"); TRate = Convert.ToDecimal(TeacherRuleList.Where(x => x.SNO == 5).FirstOrDefault()?.Content ?? "0");
Remark = "教师试听订单提成:订单b2b返佣:" + bdCommission + ";订单业绩:" + (qitem.PreferPrice - qitem.DiscountMoney - bdCommission); Remark = "教师试听订单提成:订单b2b返佣:" + bdCommission + ";订单业绩:" + (qitem.PreferPrice - qitem.DiscountMoney);
} }
if (qitem.JoinType == Common.Enum.Sale.OrderJoinTypeEnum.Normal && qitem.OrderType == Common.Enum.Sale.OrderTypeEnum.StudyabroadOrder) { if (qitem.JoinType == Common.Enum.Sale.OrderJoinTypeEnum.Normal && qitem.OrderType == Common.Enum.Sale.OrderTypeEnum.StudyabroadOrder) {
//留学订单 //留学订单
decimal lxMoney = Convert.ToDecimal(TeacherRuleList.Where(x => x.SNO == 3).FirstOrDefault()?.Content ?? "0"); decimal lxMoney = Convert.ToDecimal(TeacherRuleList.Where(x => x.SNO == 3).FirstOrDefault()?.Content ?? "0");
Remark = "教师留学订单奖励:订单b2b返佣:" + bdCommission + ";订单业绩:" + (qitem.PreferPrice - qitem.DiscountMoney - bdCommission) + ";留学奖励" + lxMoney; Remark = "教师留学订单奖励:订单b2b返佣:" + bdCommission + ";订单业绩:" + (qitem.PreferPrice - qitem.DiscountMoney) + ";留学奖励" + lxMoney;
} }
decimal PushMoney = Math.Round((qitem.PreferPrice - qitem.DiscountMoney - bdCommission) * TRate / 100, 2, MidpointRounding.AwayFromZero); decimal PushMoney = Math.Round((qitem.PreferPrice - qitem.DiscountMoney) * TRate / 100, 2, MidpointRounding.AwayFromZero);
AchEmpList.Add(new RB_Sell_Achievements_Emp_ViewModel() AchEmpList.Add(new RB_Sell_Achievements_Emp_ViewModel()
{ {
EmpId = qitem.HelpEnterId, EmpId = qitem.HelpEnterId,
...@@ -861,7 +861,7 @@ namespace Edu.Module.Course ...@@ -861,7 +861,7 @@ namespace Edu.Module.Course
PushMoney = PushMoney, PushMoney = PushMoney,
RuleId = 0, RuleId = 0,
SaleMoney = 0, SaleMoney = 0,
OrderSaleMoney = qitem.PreferPrice - qitem.DiscountMoney - bdCommission, OrderSaleMoney = qitem.PreferPrice - qitem.DiscountMoney,
Type = 3, Type = 3,
Remark = Remark Remark = Remark
}); });
...@@ -898,7 +898,7 @@ namespace Edu.Module.Course ...@@ -898,7 +898,7 @@ namespace Edu.Module.Course
{ {
//当前订单的业绩 //当前订单的业绩
decimal bdCommission = bdList.Where(x => x.OrderId == qitem.OrderId).Sum(x => x.CommissionMoeny); decimal bdCommission = bdList.Where(x => x.OrderId == qitem.OrderId).Sum(x => x.CommissionMoeny);
decimal orderYj = qitem.PreferPrice - qitem.DiscountMoney - bdCommission; decimal orderYj = qitem.PreferPrice - qitem.DiscountMoney;
AchEmpList.Add(new RB_Sell_Achievements_Emp_ViewModel() AchEmpList.Add(new RB_Sell_Achievements_Emp_ViewModel()
{ {
EmpId = qitem.HelpEnterId, EmpId = qitem.HelpEnterId,
...@@ -966,7 +966,7 @@ namespace Edu.Module.Course ...@@ -966,7 +966,7 @@ namespace Edu.Module.Course
//当前订单的业绩 //当前订单的业绩
decimal bdCommission = bdList.Where(x => x.OrderId == qitem.OrderId).Sum(x => x.CommissionMoeny); decimal bdCommission = bdList.Where(x => x.OrderId == qitem.OrderId).Sum(x => x.CommissionMoeny);
decimal tCommission = AchEmpList.Where(x => x.Type == 3 && x.OrderId == qitem.OrderId).Sum(x => x.PushMoney); decimal tCommission = AchEmpList.Where(x => x.Type == 3 && x.OrderId == qitem.OrderId).Sum(x => x.PushMoney);
decimal orderYj = qitem.PreferPrice - qitem.DiscountMoney - bdCommission - tCommission; decimal orderYj = qitem.PreferPrice - qitem.DiscountMoney;
AchEmpList.Add(new RB_Sell_Achievements_Emp_ViewModel() AchEmpList.Add(new RB_Sell_Achievements_Emp_ViewModel()
{ {
EmpId = qitem.EnterID, EmpId = qitem.EnterID,
...@@ -995,7 +995,7 @@ namespace Edu.Module.Course ...@@ -995,7 +995,7 @@ namespace Edu.Module.Course
//当前订单的业绩 //当前订单的业绩
decimal bdCommission = bdList.Where(x => x.OrderId == qitem.OrderId).Sum(x => x.CommissionMoeny); decimal bdCommission = bdList.Where(x => x.OrderId == qitem.OrderId).Sum(x => x.CommissionMoeny);
decimal tCommission = AchEmpList.Where(x => x.Type == 3 && x.OrderId == qitem.OrderId).Sum(x => x.PushMoney); decimal tCommission = AchEmpList.Where(x => x.Type == 3 && x.OrderId == qitem.OrderId).Sum(x => x.PushMoney);
decimal orderYj = qitem.PreferPrice - qitem.DiscountMoney - bdCommission - tCommission; decimal orderYj = qitem.PreferPrice - qitem.DiscountMoney;
//int IsSureConsultTime = surList.Where(x => x.OrderId == qitem.OrderId).FirstOrDefault()?.OrderCount ?? 0; //int IsSureConsultTime = surList.Where(x => x.OrderId == qitem.OrderId).FirstOrDefault()?.OrderCount ?? 0;
AchEmpList.Add(new RB_Sell_Achievements_Emp_ViewModel() AchEmpList.Add(new RB_Sell_Achievements_Emp_ViewModel()
{ {
...@@ -1090,7 +1090,7 @@ namespace Edu.Module.Course ...@@ -1090,7 +1090,7 @@ namespace Edu.Module.Course
//当前订单的业绩 //当前订单的业绩
decimal bdCommission = bdList.Where(x => x.OrderId == qitem.OrderId).Sum(x => x.CommissionMoeny); decimal bdCommission = bdList.Where(x => x.OrderId == qitem.OrderId).Sum(x => x.CommissionMoeny);
decimal tCommission = AchEmpList.Where(x => x.Type == 3 && x.OrderId == qitem.OrderId).Sum(x => x.PushMoney); decimal tCommission = AchEmpList.Where(x => x.Type == 3 && x.OrderId == qitem.OrderId).Sum(x => x.PushMoney);
decimal orderYj = qitem.PreferPrice - qitem.DiscountMoney - bdCommission - tCommission; decimal orderYj = qitem.PreferPrice - qitem.DiscountMoney;
AchEmpList.Add(new RB_Sell_Achievements_Emp_ViewModel() AchEmpList.Add(new RB_Sell_Achievements_Emp_ViewModel()
{ {
EmpId = qitem.CourseConsultantId, EmpId = qitem.CourseConsultantId,
...@@ -1118,7 +1118,7 @@ namespace Edu.Module.Course ...@@ -1118,7 +1118,7 @@ namespace Edu.Module.Course
//当前订单的业绩 //当前订单的业绩
decimal bdCommission = bdList.Where(x => x.OrderId == qitem.OrderId).Sum(x => x.CommissionMoeny); decimal bdCommission = bdList.Where(x => x.OrderId == qitem.OrderId).Sum(x => x.CommissionMoeny);
decimal tCommission = AchEmpList.Where(x => x.Type == 3 && x.OrderId == qitem.OrderId).Sum(x => x.PushMoney); decimal tCommission = AchEmpList.Where(x => x.Type == 3 && x.OrderId == qitem.OrderId).Sum(x => x.PushMoney);
decimal orderYj = qitem.PreferPrice - qitem.DiscountMoney - bdCommission - tCommission; decimal orderYj = qitem.PreferPrice - qitem.DiscountMoney;
//int IsSureConsultTime = surList.Where(x => x.OrderId == qitem.OrderId).FirstOrDefault()?.OrderCount ?? 0; //int IsSureConsultTime = surList.Where(x => x.OrderId == qitem.OrderId).FirstOrDefault()?.OrderCount ?? 0;
AchEmpList.Add(new RB_Sell_Achievements_Emp_ViewModel() AchEmpList.Add(new RB_Sell_Achievements_Emp_ViewModel()
{ {
...@@ -1181,7 +1181,7 @@ namespace Edu.Module.Course ...@@ -1181,7 +1181,7 @@ namespace Edu.Module.Course
//当前订单的业绩 //当前订单的业绩
decimal bdCommission = bdList.Where(x => x.OrderId == qitem.OrderId).Sum(x => x.CommissionMoeny); decimal bdCommission = bdList.Where(x => x.OrderId == qitem.OrderId).Sum(x => x.CommissionMoeny);
decimal tCommission = AchEmpList.Where(x => x.Type == 3 && x.OrderId == qitem.OrderId).Sum(x => x.PushMoney); decimal tCommission = AchEmpList.Where(x => x.Type == 3 && x.OrderId == qitem.OrderId).Sum(x => x.PushMoney);
decimal orderYj = qitem.PreferPrice - qitem.DiscountMoney - bdCommission - tCommission; decimal orderYj = qitem.PreferPrice - qitem.DiscountMoney;
foreach (var emp in EmpList) foreach (var emp in EmpList)
{ {
AchEmpList.Add(new RB_Sell_Achievements_Emp_ViewModel() AchEmpList.Add(new RB_Sell_Achievements_Emp_ViewModel()
...@@ -1212,7 +1212,7 @@ namespace Edu.Module.Course ...@@ -1212,7 +1212,7 @@ namespace Edu.Module.Course
//当前订单的业绩 //当前订单的业绩
decimal bdCommission = bdList.Where(x => x.OrderId == qitem.OrderId).Sum(x => x.CommissionMoeny); decimal bdCommission = bdList.Where(x => x.OrderId == qitem.OrderId).Sum(x => x.CommissionMoeny);
decimal tCommission = AchEmpList.Where(x => x.Type == 3 && x.OrderId == qitem.OrderId).Sum(x => x.PushMoney); decimal tCommission = AchEmpList.Where(x => x.Type == 3 && x.OrderId == qitem.OrderId).Sum(x => x.PushMoney);
decimal orderYj = qitem.PreferPrice - qitem.DiscountMoney - bdCommission - tCommission; decimal orderYj = qitem.PreferPrice - qitem.DiscountMoney;
//int IsSureConsultTime = surList.Where(x => x.OrderId == qitem.OrderId).FirstOrDefault()?.OrderCount ?? 0; //int IsSureConsultTime = surList.Where(x => x.OrderId == qitem.OrderId).FirstOrDefault()?.OrderCount ?? 0;
foreach (var emp in EmpList) foreach (var emp in EmpList)
{ {
...@@ -1303,7 +1303,7 @@ namespace Edu.Module.Course ...@@ -1303,7 +1303,7 @@ namespace Edu.Module.Course
//当前订单的业绩 //当前订单的业绩
decimal bdCommission = bdList.Where(x => x.OrderId == qitem.OrderId).Sum(x => x.CommissionMoeny); decimal bdCommission = bdList.Where(x => x.OrderId == qitem.OrderId).Sum(x => x.CommissionMoeny);
decimal tCommission = AchEmpList.Where(x => x.Type == 3 && x.OrderId == qitem.OrderId).Sum(x => x.PushMoney); decimal tCommission = AchEmpList.Where(x => x.Type == 3 && x.OrderId == qitem.OrderId).Sum(x => x.PushMoney);
decimal orderYj = qitem.PreferPrice - qitem.DiscountMoney - bdCommission - tCommission; decimal orderYj = qitem.PreferPrice - qitem.DiscountMoney;
foreach (var emp in EmpList) foreach (var emp in EmpList)
{ {
AchEmpList.Add(new RB_Sell_Achievements_Emp_ViewModel() AchEmpList.Add(new RB_Sell_Achievements_Emp_ViewModel()
...@@ -1334,7 +1334,7 @@ namespace Edu.Module.Course ...@@ -1334,7 +1334,7 @@ namespace Edu.Module.Course
//当前订单的业绩 //当前订单的业绩
decimal bdCommission = bdList.Where(x => x.OrderId == qitem.OrderId).Sum(x => x.CommissionMoeny); decimal bdCommission = bdList.Where(x => x.OrderId == qitem.OrderId).Sum(x => x.CommissionMoeny);
decimal tCommission = AchEmpList.Where(x => x.Type == 3 && x.OrderId == qitem.OrderId).Sum(x => x.PushMoney); decimal tCommission = AchEmpList.Where(x => x.Type == 3 && x.OrderId == qitem.OrderId).Sum(x => x.PushMoney);
decimal orderYj = qitem.PreferPrice - qitem.DiscountMoney - bdCommission - tCommission; decimal orderYj = qitem.PreferPrice - qitem.DiscountMoney;
//int IsSureConsultTime = surList.Where(x => x.OrderId == qitem.OrderId).FirstOrDefault()?.OrderCount ?? 0; //int IsSureConsultTime = surList.Where(x => x.OrderId == qitem.OrderId).FirstOrDefault()?.OrderCount ?? 0;
foreach (var emp in EmpList) foreach (var emp in EmpList)
{ {
......
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