|
@@ -25,7 +25,7 @@ FROM st_stockbill_items t1
|
|
|
left join plm_itemextend t6 on t2.siteid = t6.siteid and t2.itemid = t6.itemid
|
|
|
left join sa_agents t7 on t7.sys_enterpriseid=t8.sys_enterpriseid and t7.siteid=t8.siteid
|
|
|
left join sys_enterprise t9 on t9.sys_enterpriseid=t8.sys_enterpriseid and t9.siteid=t8.siteid
|
|
|
-where t4.rb=1 and t1.siteid = $siteid$ and t4.sys_enterpriseid in (select sys_enterpriseid from sys_enterprise_tradefield where sa_saleareaid in $sa_saleareaids$)
|
|
|
+where t4.rb=1 and t1.siteid = $siteid$ and $where$ and t4.sys_enterpriseid in (select sys_enterpriseid from sys_enterprise_tradefield where sa_saleareaid in $sa_saleareaids$)
|
|
|
union all
|
|
|
SELECT t1.st_stockbill_itemsid detailid,
|
|
|
t4.st_stockbillid id,
|