Commit b4599bbb by 泽锋 李

fix

parent a8ba8b01
...@@ -1977,7 +1977,9 @@ truncate table dc_report_cash_flow_sku_group_temp; ...@@ -1977,7 +1977,9 @@ truncate table dc_report_cash_flow_sku_group_temp;
update dc_report_cash_flow_sku_group set current_balance=current_income+current_expend ,last_balance=last_income+last_expend; update dc_report_cash_flow_sku_group set current_balance=current_income+current_expend ,last_balance=last_income+last_expend;
", datePar, commandTimeout: 0); ", datePar, commandTimeout: 0);
_connection.Execute(@" update dc_base_stock as t1, _connection.Execute(@"
update dc_base_stock set pay_amount_30=0,income_amount_30=0;
update dc_base_stock as t1,
( select bailun_sku,warehouse_code, abs(sum(case when data_type not in (2) then val else 0 end )) as 'pay_amount_30', ( select bailun_sku,warehouse_code, abs(sum(case when data_type not in (2) then val else 0 end )) as 'pay_amount_30',
sum(case when data_type in (2) then val else 0 end ) as 'income_amount_30' sum(case when data_type in (2) then val else 0 end ) as 'income_amount_30'
from dc_report_cash_flow_log where occur_time >=@btime and is_delete=0 and data_type in (2,3,5,8,9,10,11,12,13,14) GROUP BY bailun_sku,warehouse_code ) as t2 from dc_report_cash_flow_log where occur_time >=@btime and is_delete=0 and data_type in (2,3,5,8,9,10,11,12,13,14) GROUP BY bailun_sku,warehouse_code ) as t2
...@@ -1985,7 +1987,9 @@ set t1.pay_amount_30 =t2.pay_amount_30, t1.income_amount_30 = t2.income_amount_ ...@@ -1985,7 +1987,9 @@ set t1.pay_amount_30 =t2.pay_amount_30, t1.income_amount_30 = t2.income_amount_
where t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code; where t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code;
", new { btime = DateTime.Now.AddDays(-30).ToDayHome()},commandTimeout: 0); ", new { btime = DateTime.Now.AddDays(-30).ToDayHome()},commandTimeout: 0);
_connection.Execute(@" update dc_base_stock as t1, _connection.Execute(@"
update dc_base_stock set available_days=0;
update dc_base_stock as t1,
dc_auto_turnover as t2 dc_auto_turnover as t2
set t1.available_days = (t1.usable_stock / if(t2.daily_weighted_sales<=0,1,t2.daily_weighted_sales)) set t1.available_days = (t1.usable_stock / if(t2.daily_weighted_sales<=0,1,t2.daily_weighted_sales))
where t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code; where t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code;
......
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