Commit 6ae68ef5 authored by liudong1993's avatar liudong1993

1

parent 0d5b03a7
...@@ -10683,7 +10683,10 @@ namespace REBORN.Module.FinanceModule ...@@ -10683,7 +10683,10 @@ namespace REBORN.Module.FinanceModule
#region 更新单项产品金额 #region 更新单项产品金额
if ((financeModel.OrderSource == OrderResourceEnum.Visia && financeModel.OrderID > 0) || financeModel.OtherType == 61 || financeModel.OtherType == 66 || financeModel.OtherType == 67 || financeModel.OtherType == 80 || financeModel.OtherType == 83) if ((financeModel.OrderSource == OrderResourceEnum.Visia && financeModel.OrderID > 0) || financeModel.OtherType == 61 || financeModel.OtherType == 66 || financeModel.OtherType == 67 || financeModel.OtherType == 80 || financeModel.OtherType == 83)
{ {
flag = RefundOrder(financeModel.FrID, userInfo); if (financeModel.Status != FinanceAuditStatus.Temporary)
{
flag = RefundOrder(financeModel.FrID, userInfo);
}
} }
#endregion #endregion
if (flag && logflag) if (flag && logflag)
......
...@@ -655,12 +655,12 @@ sum(o.OrderProfit) as OrderProfit,sum(o.OrderSalesMoney) as OrderSalesMoney,SUM( ...@@ -655,12 +655,12 @@ sum(o.OrderProfit) as OrderProfit,sum(o.OrderSalesMoney) as OrderSalesMoney,SUM(
from( from(
select o.OrderId,{branchSql},o.PreferPrice,o.Income,o.Refund,o.PlatformTax,o.ZaiTuMoney,o.DiscountMoney,o.RedEnvelopeMoney,o.GuestNum,o.PreferTipAmount,(case when IFNULL(o.PreferTipAmount,0)>=IFNULL(o.CompensationMoney,0) then o.CompensationMoney else 0 end)as CompensationMoney, select o.OrderId,{branchSql},o.PreferPrice,o.Income,o.Refund,o.PlatformTax,o.ZaiTuMoney,o.DiscountMoney,o.RedEnvelopeMoney,o.GuestNum,o.PreferTipAmount,(case when IFNULL(o.PreferTipAmount,0)>=IFNULL(o.CompensationMoney,0) then o.CompensationMoney else 0 end)as CompensationMoney,
case when (p.TeamType>0 or p.PriceTeamType =7) and r.TCID is not null and r.TGuestNum >0 then ROUND(r.ShiJiLiRun * IFNULL(o.GuestNum,0)/r.TGuestNum,2) else 0 end as OrderProfit, case when (p.TeamType>0 or p.PriceTeamType =7) and r.TCID is not null and r.TGuestNum >0 then ROUND(r.ShiJiLiRun * IFNULL(o.GuestNum,0)/r.TGuestNum,2) else 0 end as OrderProfit,
case when p.TeamType>0 or p.PriceTeamType =7 then 0 else IFNULL(o.PreferPrice,0)- IFNULL(o.DiscountMoney,0) -IFNULL(o.RedEnvelopeMoney,0) end as OrderSalesMoney,SUM(IFNULL(o.Meet,0)) AS Meet case when p.TeamType>0 or p.PriceTeamType =7 then 0 else IFNULL(o.PreferPrice,0)- IFNULL(o.DiscountMoney,0) -IFNULL(o.RedEnvelopeMoney,0) end as OrderSalesMoney,IFNULL(o.Meet,0) AS Meet
FROM rb_travel_order o FROM rb_travel_order o
LEFT JOIN rb_travel_price p on o.TCID =p.TCID LEFT JOIN rb_travel_price p on o.TCID =p.TCID
left join left join
(SELECT r.TCID,SUM(case when r.TCID in(16381,17415,17606,17879) then case when r.TCID =16381 then 33285 else case when r.TCID =17415 then 37815 else case when r.TCID =17606 then 35820 else 32715 end end end else IFNULL(r.ShiJiLiRun,0) + IFNULL(r.TiCheng,0) - IFNULL(r.YongJinShouRu,0) end) AS ShiJiLiRun,sum(IFNULL(GuestNum,0)) as TGuestNum (SELECT r.TCID,SUM(case when r.TCID in(16381,17415,17606,17879) then case when r.TCID =16381 then 33285 else case when r.TCID =17415 then 37815 else case when r.TCID =17606 then 35820 else 32715 end end end else IFNULL(r.ShiJiLiRun,0) + IFNULL(r.TiCheng,0) - IFNULL(r.YongJinShouRu,0) end) AS ShiJiLiRun,sum(IFNULL(GuestNum,0)) as TGuestNum
FROM {(Config.IsOnline ? "uat_reborn_datastatistics" : "reborn_datastatistics")}.rb_revenuereport r WHERE r.Rb_Group_Id =2 and r.DataType =1 and r.Type =1 and r.StartDate >='2023-01-01' GROUP BY r.TCID) r on r.TCID =o.TCID FROM {(Config.IsOnline ? "uat_reborn_datastatistics" : "reborn_datastatistics")}.rb_revenuereport r WHERE r.Rb_Group_Id ={demodel.GroupId} and r.DataType =1 and r.Type =1 and r.StartDate >='2023-01-01' GROUP BY r.TCID) r on r.TCID =o.TCID
{(demodel.LineId > 0 || demodel.CommissionType > 0 ? "LEFT JOIN rb_travel_config c on p.ConfigID = c.ID" : "")} {(demodel.LineId > 0 || demodel.CommissionType > 0 ? "LEFT JOIN rb_travel_config c on p.ConfigID = c.ID" : "")}
{(!string.IsNullOrEmpty(demodel.CustomerName) ? "LEFT JOIN rb_travel_guest g on o.CRMGuestId = g.Id" : "")} {(!string.IsNullOrEmpty(demodel.CustomerName) ? "LEFT JOIN rb_travel_guest g on o.CRMGuestId = g.Id" : "")}
{(demodel.BranchId > 0 ? $"LEFT JOIN {(Config.IsOnline ? "uat_reborn_user" : "reborn_user")}.rb_employee e on o.EnterID = e.EmployeeId" : "")} {(demodel.BranchId > 0 ? $"LEFT JOIN {(Config.IsOnline ? "uat_reborn_user" : "reborn_user")}.rb_employee e on o.EnterID = e.EmployeeId" : "")}
......
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