任务描述
暂无
需求描述

背景: 现有财务使用 销售成本表 rb_finance_Settlement  数据来源于利润表 RB_Report_OrderSettlement,

但因为店铺数据存在差异,现通过SQL 覆盖方式进行调整。 


问题来源:平台其他费用差异(ordersourceotherdebits),广告费差异(CostOfAdvertising)

select sum(ordersourceotherdebits) from RB_Report_OrderSettlement(NOLOCK) where customerid=1 and OrderSourceType in (1,2)
 and shiptime>'2021-11-01'
 and shiptime<'2021-11-30'
 --and ordersourceID='8596'
 --and ordersourceotherdebits <-5
 union
 select sum(ordersourceotherdebits)  from dbo.rb_finance_Settlement(NOLOCK) where customerid=1 and OrderSourceType in (1,2)
     and shiptime>'2021-11-01'
and shiptime<'2021-11-30'
--and ordersourceID='8596'
--and ordersourceotherdebits <-5



解决方案:


DECLARE @CustomerID INT 
DECLARE @OrderSourceType INT 
DECLARE @BeginTime NVARCHAR(20)
DECLARE @EndTime NVARCHAR(20)

SET @CustomerID=1
SET @OrderSourceType=2
SET @BeginTime='2021-11-01'
SET @EndTime='2021-12-01'
--修改Finance 11月Ebay OrderSourceOtherDebits<>0 数据 商户号为-2

UPDATE dbo.RB_Finance_Settlement SET CustomerID=-2 WHERE
CustomerID=@CustomerID
AND  OrderSourceType=@OrderSourceType
AND ShipTime>=@BeginTime
AND ShipTime<@EndTime
AND OrderSourceOtherDebits<>0;

--插入利润表到财务结算表
INSERT INTO RB_Finance_Settlement
(
    [CustomerID],
    [CheckDate],
    [SettlementDate],
    [OrderSourceID],
    [OrderSourceName],
    [PayTime],
    [ShipTime],
    [WarehouseID],
    [WareHouseName],
    [OrderSourceType],
    [OrderSourceTypeName],
    [Ordercode],
    [ClientOrderCode],
    [TransactionId],
    [SKU],
    [ClientSKU],
    [SellerSKU],
    [ProductNameCN],
    [SaleNum],
    [Currency],
    [ExchangeRMB],
    [USD_ExchangeRMB],
    [Country],
    [Profits],
    [Incomes],
    [SalesPrice],
    [TransportPay],
    [SalesRefunds],
    [PromotionRebates],
    [OtherCredits],
    [CommisionFee],
    [FBATransactionFees],
    [OrderSourceOtherDebits],
    [CostOfAdvertising],
    [BuyPrice],
    [PackageFees],
    [SalesAdminID],
    [SalesAdminName],
    [SalesTeamID],
    [SalesTeamName],
    [remark],
    [AddTime],
    [UpdateTime],
    [AddCommisionFee],
    [TransportID],
    [Transport_API_Class]
)
SELECT CustomerID,SettlementDate,SettlementDate,OrderSourceID,OrderSourceName,
PayTime,ShipTime,
WareHouseID,WareHouseName,OrderSourceType,OrderSourceTypeName,OrderCode,ClientOrderCode,
TransactionId,SKU,ClientSKU,SellerSKU,ProductNameCN,(ProductNum+ProdutNumUpdate) AS SaleNum,
Currency,ExchangeRMB,USD_ExchangeRMB,OrderSourceContry,Profits,Incomes,SalesPrice,TransportPay,
SalesRefunds,PromotionRebates,OtherCredits,CommisionFee,FBATransactionFees,OrderSourceOtherDebits,
CostOfAdvertising,BuyPrice,PackageFees,SalesAdminID,SalesAdminName,SalesTeamID,SalesTeamName,
'利润覆盖20211216' AS remark,
SettlementDate AS AddTime,SettlementDate AS UpdateTime,0 AS AddCommisionFee,TransportID,0 AS Transport_API_Class
FROM dbo.RB_Report_OrderSettlement(NOLOCK)
WHERE 
CustomerID=@CustomerID
AND  OrderSourceType=@OrderSourceType
AND ShipTime>=@BeginTime
AND ShipTime<@EndTime
AND OrderSourceOtherDebits<>0


时间范围: 7 -11 月。


验收标准
暂无
历史记录  
  1. 2021-12-21 16:41:00, 由 夏秋生 创建。
  2. 2021-12-22 10:16:03, 由 夏秋生 编辑。
    修改了 任务名称,区别为:
    001- 销售成本表其他费用_调整修复_无发版 ——测试设计
    001+ 销售成本表其他费用_调整修复_无发版 ——测试执行
    001- 销售成本表其他费用_调整修复_无发版 ——测试设计
    001+ 销售成本表其他费用_调整修复_无发版 ——测试执行
  3. 2021-12-22 10:16:28, 由 夏秋生 启动。
    修改了 实际开始,旧值为 "0000-00-00 00:00:00",新值为 "2021-12-22 10:16:23"。
    修改了 总计消耗,旧值为 "0",新值为 "0.2"。
    修改了 任务状态,旧值为 "wait",新值为 "doing"。
  4. 2021-12-22 14:28:49, 由 夏秋生 添加备注。

    测试通过,预计上线时间2021/12/28

    1..准备测试,RB_Report_OrderSettlement共39957条数据

    rb_finance_Settlement数据空

    执行服务按钮


    数据对比


    ordersourceotherdebits,CostOfAdvertising

    RB_Report_OrderSettlement与RB_Finance_Settlement表的ordersourceotherdebits,CostOfAdvertising,总数完全一致



  5. 2021-12-22 14:28:55, 由 夏秋生 完成。
    修改了 总计消耗,旧值为 "0.2",新值为 "0.3"。
    修改了 实际完成,旧值为 "",新值为 "2021-12-22 14:28:51"。
    修改了 任务状态,旧值为 "doing",新值为 "done"。
    修改了 预计剩余,旧值为 "2",新值为 "0"。
    修改了 由谁完成,旧值为 "",新值为 "xiaqiusheng"。
  6. 2021-12-22 14:29:20, 由 夏秋生 关闭。
    修改了 任务状态,旧值为 "done",新值为 "closed"。
    修改了 指派给 ,旧值为 "xiaqiusheng",新值为 "closed"。
    修改了 由谁关闭,旧值为 "",新值为 "xiaqiusheng"。
    修改了 关闭时间,旧值为 "0000-00-00 00:00:00",新值为 "2021-12-22 14:29:20"。
    修改了 关闭原因,旧值为 "",新值为 "done"。
所属迭代 【主干】产品中心12月第二个版本(2021年)
所属模块 赛盒科技  赛盒ERP管理系统   数据报表组
相关需求 销售成本表其他费用_调整修复_无发版
指派给 Closed 于 2021-12-22 14:29:20
任务类型 测试
任务标签 初始
开发组
任务状态 已关闭
进度 100%
优先级 P2
关键词
抄送给
由谁创建 夏秋生 于 2021-12-21 16:41:00
由谁完成 夏秋生 于 2021-12-22 14:28:51
由谁取消 暂无
由谁关闭 夏秋生 于 2021-12-22 14:29:20
关闭原因 已完成
最后编辑 夏秋生 于 2021-12-22 14:29:20
团队 最初预计 总计消耗 预计剩余
工时信息
最初预计 2工时
总计消耗 0.3工时
预计剩余 0工时
预计开始 0000-00-00
实际开始 2021-12-22
截止日期 0000-00-00