Scripts
// Asignar A Autorizar a MAG
update emdoc set suma = null where tipo = 'CP';
update emdoc set suma = 'Sin responsable A Autorizar' where tipo = 'CP' and id not in (select objeto from emresp where form = 'compras.comprobanteProveedor' and estado = 'A Autorizar' and objeto = emdoc.id);
insert into emresp(objeto, usuario, estado, form) select id, 15063, 'A Autorizar', 'compras.comprobanteProveedor' from emdoc where tipo = 'CP' and suma = 'Sin responsable A Autorizar';