Commit daf2289a authored by liudong1993's avatar liudong1993

1

parent 8e71c6fa
......@@ -254,16 +254,17 @@ namespace REBORN.Module.SellModule
foreach (var item in travellist)
{
var rmodel = rtlist.Where(x => x.OrderId == item.OrderId).FirstOrDefault();
item.TCID = rmodel.TCID ?? 0;
var tcmodel = tclist.Where(x => x.TCID == item.TCID).FirstOrDefault();
item.StartDate = rmodel.StartDate.HasValue ? rmodel.StartDate.Value.ToString("yyyy-MM-dd") : "";
item.TCNUM = rmodel.TCNUM;
item.TeamType = rmodel.TeamType ?? 0;
item.PriceTeamType = (int)(tcmodel?.PriceTeamType ?? PriceTeamTypeEnum.SanPing);
if (rmodel.TeamType == 0 && (tcmodel?.PriceTeamType ?? PriceTeamTypeEnum.SanPing) == PriceTeamTypeEnum.SanPing)
if (rmodel.TeamType == 1 && (tcmodel?.PriceTeamType ?? PriceTeamTypeEnum.SanPing) == PriceTeamTypeEnum.SanPing)
{
item.TCNUM += "(定制团)";
}
else if (rmodel.TeamType == 0 && (tcmodel?.PriceTeamType ?? PriceTeamTypeEnum.SanPing) == PriceTeamTypeEnum.OutTravel)
else if (rmodel.TeamType == 1 && (tcmodel?.PriceTeamType ?? PriceTeamTypeEnum.SanPing) == PriceTeamTypeEnum.OutTravel)
{
item.TCNUM += "(定制团)";
}
......@@ -301,7 +302,6 @@ namespace REBORN.Module.SellModule
item.IsOneDayOrder = rmodel.IsOneDay;
item.CurrencyName = "CNY";
item.StateName = rmodel.OrderState.GetEnumName();
item.TCID = rmodel.TCID ?? 0;
//团区分 台湾公司别 根据公司别本位币
var brmodel = branchList.Where(x => x.Id == rmodel.OutBranchId).FirstOrDefault();
......@@ -310,28 +310,28 @@ namespace REBORN.Module.SellModule
item.CurrencyName = currencyList.Where(x => x.ID == brmodel.StandardCurrencyId).FirstOrDefault()?.Code;
}
if (tcmodel != null)
{
if (tcmodel.TeamType > 0 || tcmodel.PriceTeamType == Common.Enum.Dmc.PriceTeamTypeEnum.SingleService)
{
var reportList = ReportList.Where(x => x.TCID == item.TCID).ToList();
//利润 直接根据人头比例分配
decimal TCProfit = reportList.Any() ? reportList.Sum(x => (x.ShiJiLiRun ?? 0) + (x.TiCheng ?? 0) - (x.YongJinShouRu ?? 0)) : 0;
decimal TotalPeople = OrderPeopleList.Where(x => x.TCID == item.TCID).FirstOrDefault()?.GuestNum ?? 0;
if (TotalPeople > 0)
item.OrderProfit = Math.Round(TCProfit * (rmodel.GuestNum ?? 0) / TotalPeople, 2, MidpointRounding.AwayFromZero);
}
else
{
//销售额
item.OrderProfit = 0;
//item.OrderAchievements = (rmodel.PreferPrice ?? 0) - (rmodel.DiscountMoney ?? 0) - (rmodel.RedEnvelopeMoney ?? 0);
}
if (tcmodel.TeamType == Common.Enum.Dmc.TeamTypeEnum.PacketGroup)
{
item.TCNUM += "(小包团)";
}
}
//if (tcmodel != null)
//{
// if (tcmodel.TeamType > 0 || tcmodel.PriceTeamType == Common.Enum.Dmc.PriceTeamTypeEnum.SingleService)
// {
// var reportList = ReportList.Where(x => x.TCID == item.TCID).ToList();
// //利润 直接根据人头比例分配
// decimal TCProfit = reportList.Any() ? reportList.Sum(x => (x.ShiJiLiRun ?? 0) + (x.TiCheng ?? 0) - (x.YongJinShouRu ?? 0)) : 0;
// decimal TotalPeople = OrderPeopleList.Where(x => x.TCID == item.TCID).FirstOrDefault()?.GuestNum ?? 0;
// if (TotalPeople > 0)
// item.OrderProfit = Math.Round(TCProfit * (rmodel.GuestNum ?? 0) / TotalPeople, 2, MidpointRounding.AwayFromZero);
// }
// else
// {
// //销售额
// item.OrderProfit = 0;
// //item.OrderAchievements = (rmodel.PreferPrice ?? 0) - (rmodel.DiscountMoney ?? 0) - (rmodel.RedEnvelopeMoney ?? 0);
// }
// if (tcmodel.TeamType == Common.Enum.Dmc.TeamTypeEnum.PacketGroup)
// {
// item.TCNUM += "(小包团)";
// }
//}
}
}
//内部酒店
......
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