【问】按供应商查询流水有数据,销售报表无数据。 | ||
【适用版本】商云8 | 【模块】基本档案 | 【点击数】103 |
【知识编号】P2017011900018 | ||
【问题描述】按供应商查询流水有数据,销售报表无数据。 |
use hbposv8
–删除商品与供应商关系表
delete t_bd_supcust_item
go
–重新生成这部分商品与供应商关系表
insert into t_bd_supcust_item(item_no,branch_no,supcust_no,sale_way)
select item_no,(select sys_var_value from t_sys_system where sys_var_id like ‘%g_branch_no%’) as branch_no,main_supcust,item_sup_flag
from t_bd_item_info where
not exists(select * from t_bd_supcust_item where (item_no =t_bd_item_info.item_no)
and (supcust_no = t_bd_item_info.main_supcust)
and branch_no =(select sys_var_value from t_sys_system where sys_var_id like ‘%g_branch_no%’ ))
–更新日汇总数据
update t_rm_daysum set supcust_no=t_bd_item_info.main_supcust from t_bd_item_info
where t_rm_daysum.item_no=t_bd_item_info.item_no