mmesa
5/29/2019 - 6:24 PM

Facturacion combo mágico

---
---Facturacion combo mágico
---
select * from tbl_peddet a join tbl_pedcab b on a.strTipDoc = b.strTipDoc and a.strNumDoc = b.strNumDoc 
where 
a.strcodlin = '100678' and a.strTipDoc = 'pd' and b.strCamGen = '201908' and b.logFacturado = 1
and strcodter not in (
	select distinct strcodter from tbl_facdet a join tbl_faccab b on a.strNumDoc = b.strNumDoc and a.strTipDoc = b.strTipDoc 
	where a.strAtributo = '9' and b.strTipDoc = 'fc' and b.strCamGen = '201908'
)