[步骤]
[09:43:42] -------------------------------------------------------------
CODE:N0943422
Error:16_8623_1_-2146232060
SQL:select
tmpfee.SalesDay
,tmpfee.OrderSourceID
,tmpfee.BusinessAdminID
,(cast(tmpfee.SalesYear as varchar)+ N'年' + cast(tmpfee.SalesDay as varchar)+ N'月') as XAxis
,CAST(isnull(tmpfee.Profits,0) AS DECIMAL(28,14)) as OperateFee
,CAST(isnull(tmpfee.SalesPrice+tmpfee.TransportPay+tmpfee.SalesRefunds+tmpfee.PromotionRebates+tmpfee.OtherCredits+tmpfee.TaxIncome,0) AS DECIMAL(28,14)) as TotalIncome
,CAST(isnull(tmpfee.SalesPrice,0) AS DECIMAL(28,14)) as SalesPrice
,isnull(tmprest.OrderNum,0) OrderNum
,CAST(isnull(tmpfee.TransportPay,0) AS DECIMAL(28,14)) as TransportPay
,CAST(isnull(tmpfee.SalesRefunds,0) AS DECIMAL(28,14)) as RefundPrice
,CAST(isnull(tmpfee.SalesRefundsV2,0) AS DECIMAL(28,14)) as SalesRefundsV2
,CAST(isnull(tmpfee.PromotionRebates,0) AS DECIMAL(28,14)) as PromotionFee
,CAST(isnull(tmpfee.OtherCredits,0) AS DECIMAL(28,14)) as OtherIncomeAmount
,CAST(isnull(tmpfee.CommisionFee,0) AS DECIMAL(28,14)) as CommissionFee
,CAST(isnull(tmpfee.FBATransactionFees,0) AS DECIMAL(28,14)) as FBAOperateFee
,CAST(isnull(tmpfee.OrderSourceOtherDebits,0) AS DECIMAL(28,14)) as OrderSourceCost
,CAST(isnull(tmpfee.CostOfAdvertising,0) AS DECIMAL(28,14)) as CostOfAdvertising
,CAST(isnull(tmpfee.BuyPrice,0) AS DECIMAL(28,14)) as BuyPrice
,CAST(isnull(tmpfee.PackageFees,0) AS DECIMAL(28,14)) as PackageShipedPrice
,CAST(isnull(tmpfee.OverSeasShipFees,0) AS DECIMAL(28,14)) as OverseaShipPrice
,CAST(isnull(tmpfee.FirstLegFees,0) AS DECIMAL(28,14)) as FirstLegPrice
,CAST(isnull(tmpfee.TariffFees,0) AS DECIMAL(28,14)) as TraiffPrice
,CAST(isnull(tmpfee.ExchangeLost,0) AS DECIMAL(28,14)) as ExchangeLost
,CAST(isnull(tmpfee.SalesVatFees,0) AS DECIMAL(28,14)) as SalesVatFees
,CAST(isnull(tmpfee.SubsidyPrice,0) AS DECIMAL(28,14)) as SubsidyPrice
,CAST(isnull(tmpfee.PackagedCost,0) AS DECIMAL(28,14)) as PackagedCost
,CAST(isnull(tmpfee.TaxIncome,0) AS DECIMAL(28,14)) AS TaxIncome
from
(
select datepart(YEAR, ShipDate) SalesYear,
month(ShipDate) SalesDay
,OrderSourceID
,BusinessAdminID BusinessAdminID
,ABS(SUM((CASE WHEN ISNULL(SalesRefunds,0)=0 THEN 0 ELSE ISNULL(SalesRefunds,0)+ISNULL(PromotionRebates,0)+ISNULL(OtherCredits,0)+ISNULL(Tax,0)+ISNULL(MarketplaceFacilitatorTax,0) END))) SalesRefundsV2
,SUM(Profits) Profits,SUM(SalesPrice) SalesPrice,SUM(TransportPay) TransportPay,SUM(SalesRefunds) SalesRefunds,SUM(PromotionRebates) PromotionRebates,SUM(OtherCredits) OtherCredits
,SUM(CommisionFee) CommisionFee,SUM(FBATransactionFees) FBATransactionFees
,SUM(OrderSourceOtherDebits) OrderSourceOtherDebits
,SUM(CostOfAdvertising) CostOfAdvertising
,SUM((BuyPrice+ISNULL(DistributionPrice,0))) BuyPrice,SUM(PackagedCost) PackagedCost,SUM(PackageFees) PackageFees
,SUM(OverSeasShipFees) OverSeasShipFees,SUM(FirstLegFees) FirstLegFees,SUM(TariffFees) TariffFees,SUM(ExchangeLost) ExchangeLost
,SUM(ISNULL(SalesVatFee,0)) as SalesVatFees
,SUM(ISNULL(SubsidyPrice,0)) as SubsidyPrice
,Sum((ISNULL(Tax,0)+ISNULL(MarketplaceFacilitatorTax,0))) as TaxIncome
from RB_Report_OrderSettlement with(nolock)
=@StartDate and ShipDate
满意度:满意
价值验收:基本达成
原因备注:无