|
|
@@ -28,6 +28,6 @@ WHERE t3.STATUS = '审核'
|
|
|
AND t1.siteid = $siteid$
|
|
|
and t3.sys_enterpriseid=$sys_enterpriseid$
|
|
|
AND ifnull( t1.isclose, 0 )= 0
|
|
|
- and t1.sa_orderitemsid not in (select sa_orderitemsid from sa_dispatch_items where sa_dispatchid=$sa_dispatchid$)
|
|
|
+ and if(ifnull(t2.batchcontrol,0)!=0,1=1,t1.sa_orderitemsid not in (select sa_orderitemsid from sa_dispatch_items where sa_dispatchid=$sa_dispatchid$))
|
|
|
and t1.sa_orderitemsid not in(select t1.sa_orderitemsid from (select t1.sa_orderitemsid,t1.siteid,SUM(t1.qty) qty from sa_dispatch_items t1 inner join sa_dispatch t2 on t1.sa_dispatchid=t2.sa_dispatchid and t1.siteid=t2.siteid where t2.status in('新建','提交') group by t1.sa_orderitemsid,t1.siteid) t1 inner join sa_orderitems t3 on t1.sa_orderitemsid=t3.sa_orderitemsid and t1.siteid=t3.siteid where t3.undeliqty=t1.qty)
|
|
|
and $where$
|