11-10-2018, 12:23 PM
Buenas Carlos, ejecuta estos 3 scripts (uno a uno) en SISTEMA->MANTENIMIENTO->Pestaña CONSOLA DB:
create table almacen_complementg2 select * from almacen_complementg;
insert into almacen_complementg (id_centro,id_empresa,id_almacen,id_tipo_comg,id_complementog,cantidad,stock_minimo,complementog,variacion,desc_variacion)
select "01","001","01",id_tipo_comg,id_complementog,0,0,complementog,0,"" from complementog where cafeteria = "S" and id_complementog not in (select id_complementog from almacen_complementg2);
drop table almacen_complementg2;
create table almacen_complementg2 select * from almacen_complementg;
insert into almacen_complementg (id_centro,id_empresa,id_almacen,id_tipo_comg,id_complementog,cantidad,stock_minimo,complementog,variacion,desc_variacion)
select "01","001","01",id_tipo_comg,id_complementog,0,0,complementog,0,"" from complementog where cafeteria = "S" and id_complementog not in (select id_complementog from almacen_complementg2);
drop table almacen_complementg2;