
/*------ ATD 176711 ------*/
select quant, estestrate, qtdereserv, * from itemfilest where codpro in ('10793','12608','12609','00658','04676','11962') and filial = 17

select sum(a.quant),b.est,a.codpro,b.tpo from itnfentcad a, nfentracad b
where a.numord=b.numord and a.codpro='10793' and a.filial='17' and b.atualiz=1
group by b.est,a.codpro,b.tpo
order by b.tpo

select sum(a.quant),b.est,a.codpro,b.tpo from itnfsaicad a, nfsaidacad b
where a.numord=b.numord and a.codpro='10793' and a.filial='17' and b.atualiz=1
group by b.est,a.codpro,b.tpo
order by b.tpo

select quant, quantent, sitfat, numordfat, reserva, quantdisp, filial, filialretirada, filialtransferencia, * from itemclicad where codpro = 10793 
	and filial = 17 or filialretirada = 17 or filialtransferencia = 17