update cxc_enc_movimiento
set doc_ref=num_doc
where cod_cia='001'
and sucursal='001'
and tip_doc='FAC'
and doc_ref in ('917780','917781')
and estado='N';

update inv_encabmovimiento
set doc_referen=num_docto
where cod_cia='001'
and sucursal='001'
and tip_movto='S'
and cod_movto='06'
and doc_referen in ('917780','917781')
and estado='A';



delete vendetfactura
where cia='001'
and sucursal='001'
and documento in (917780,917781);

delete venfactura
where cia='001'
and sucursal='001'
and documento in (917780,917781);

commit;