Commit 9672fe1f by 泽锋 李

fix

parent 54137166
......@@ -382,16 +382,14 @@ sum(t4.quantity_out_stock) as 'quantity_out_stock',
sum((t1.usable_stock * ifnull(t3.unit_price,0))) as 'usable_stock_amount',
sum((ifnull(t4.quantity_purchase,0) + ifnull(t4.quantity_transfer,0)) * ifnull(t3.unit_price,0)) as 'on_the_way_stock_amount',
sum(ifnull(t9.sales,0)) as 'lastweek_sales',
sum(ifnull(t9.sales_amount,0)) as 'lastweek_sales_amount',
t_cost_first.cost_first as 'cost_first'
sum(ifnull(t9.sales_amount,0)) as 'lastweek_sales_amount'
from
dc_base_stock as t1
left join dc_base_warehouse as dbw on t1.warehouse_code = dbw.warehouse_code
left join dc_base_sku as t3 on t1.bailun_sku = t3.bailun_sku
left join dc_mid_transit as t4 on t1.bailun_sku = t4.bailun_sku and t1.warehouse_code = t4.warehouse_code
left join dc_base_lastweek_data as t9 on t1.bailun_sku=t9.bailun_sku and t1.warehouse_code = t9.warehouse_code
left join dc_mid_cost_first as t_cost_first on t1.bailun_sku=t_cost_first.bailun_sku and t1.warehouse_code = t_cost_first.warehouse_code
";
if (search_data.has_tort != null)
{
......@@ -483,7 +481,9 @@ t16.lately_transfer_transporttype,
t16.lately_transfer_logisticsname,
t6.gmt_modified as 'turnover_gmt_modified',
t3.product_line_name as 'product_line_name'
t3.product_line_name as 'product_line_name',
t_cost_first.cost_first as 'cost_first'
from
dc_base_stock as t1
......@@ -498,6 +498,7 @@ left join dc_base_lastweek_data as t9 on t1.bailun_sku=t9.bailun_sku and t1.ware
left join dc_base_stock_extend as t10 on t1.bailun_sku=t10.bailun_sku and t1.warehouse_code = t10.warehouse_code
-- left join not_trans_view as t15 on t1.bailun_sku=t15.bailun_sku and t1.warehouse_code = t15.warehouse_code
left join dc_base_transfer_extend as t16 on t1.bailun_sku=t16.bailun_sku and t1.warehouse_code = t16.warehouse_code
left join dc_mid_cost_first as t_cost_first on t1.bailun_sku=t_cost_first.bailun_sku and t1.warehouse_code = t_cost_first.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