###Venta de tickets no cancelados y no facturados ~~~ select v.sys_pk,v.referencia,v.fecha,v.impuesto3,v.subtotal,(v.impuesto3+v.subtotal)+(select efectivo from venta inner join movcaja on venta.referencia=movcaja.referencia where movcaja.documento=34) as total,v.notas from venta v left join movcaja m on v.imovcaja=m.sys_pk where v.documento=6 and v.statusadministrativo<>99 and v.aplicadoa is null; ~~~