ABONOS_BI
CREATE TRIGGER ABONOS_BI FOR ABONOS
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
IF (NEW.ID IS NULL) THEN
NEW.ID = GEN_ID(GEN_ABONOS_ID,1);
END ^
CREATE TRIGGER ABONOS_ARTICULOS_BI FOR ABONOS_ARTICULOS
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_ABONOS_ARTICULOS_id,1); end ^
CREATE TRIGGER ABONOS_VENTAS_BI FOR ABONOS_VENTAS
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_ABONOS_VENTAS_id,1); end ^
CREATE TRIGGER ABONO_TICKETS_BI FOR ABONO_TICKETS
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_ABONO_TICKETS_id,1); end ^
CREATE TRIGGER ALMACENES_BI FOR ALMACENES
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_ALMACENES_id,1); end ^
CREATE TRIGGER ARTICULOS_DE_OC_BI FOR ARTICULOS_DE_OC
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_ARTICULOS_DE_OC_id,1); end ^
CREATE TRIGGER CACHE_BI FOR CACHE
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_cache_id,1); end ^
CREATE TRIGGER CAJAS_BI FOR CAJAS
ACTIVE BEFORE INSERT POSITION 0
as
begin
if (new.id is null) then
new.id = gen_id(gen_cajas_id,1);
end ^
CREATE TRIGGER CLIENTES_BI FOR CLIENTES
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
IF (NEW.NUMERO IS NULL) THEN
NEW.NUMERO = GEN_ID(GEN_CLIENTES_ID,1);
END ^
CREATE TRIGGER CLIENTESV2_BI FOR CLIENTESV2
ACTIVE BEFORE INSERT POSITION 0
AS BEGIN IF (NEW.ID IS NULL) THEN NEW.ID = GEN_ID(GEN_CLIENTESV2_ID, 1); END ^
CREATE TRIGGER COMISIONES_TARJETA_BI FOR COMISIONES_TARJETA
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_comisiones_tarjeta_id,1); end ^
CREATE TRIGGER CONCILIACION_PA_BI FOR CONCILIACION_PAGO_SERVICIOS
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_CONCILIACION_PA_id,1); end ^
CREATE TRIGGER CONFIGURACION_BI FOR CONFIGURACION
ACTIVE BEFORE INSERT POSITION 0
as
begin
if (new.id is null) then
new.id = gen_id(gen_configuracion_id,1);
end ^
CREATE TRIGGER CORTE_IMPUESTOS_BI FOR CORTE_IMPUESTOS_COBRADOS
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_CORTE_IMPUESTOS_id,1); end ^
CREATE TRIGGER CORTE_IMP_COBRA_BI FOR CORTE_IMP_COBRADOS_OPERACION
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_CORTE_IMP_COBRA_id,1); end ^
CREATE TRIGGER CORTE_MOVIMIENTOS_BI FOR CORTE_MOVIMIENTOS
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_CORTE_MOVIMIENTOS_id,1); end ^
CREATE TRIGGER CORTE_OPERACIONES_BI FOR CORTE_OPERACIONES
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_CORTE_OPERACIONES_id,1); end ^
CREATE TRIGGER CORTE_VENTAS_DE_BI FOR CORTE_VENTAS_DEPTO_OPERACIONES
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_CORTE_VENTAS_DE_id,1); end ^
CREATE TRIGGER CORTE_VENTAS_POR_DEPTO_BI FOR CORTE_VENTAS_POR_DEPTO
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_CORTE_VENTAS_POR_DEPTO_id,1); end ^
CREATE TRIGGER CREDITOS_ABONOS_BI FOR CREDITOS_ABONOS
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_CREDITOS_ABONOS_id,1); end ^
CREATE TRIGGER CRED_ABONOS_ARTS_BI FOR CREDITOS_ABONOS_ARTICULOS
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.ID is null) then new.ID = gen_id(GEN_CRED_ABONOS_ARTS_ID,1); end ^
CREATE TRIGGER CRED_ABONOS_IMPS_BI FOR CREDITOS_ABONOS_IMPUESTOS
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.ID is null) then new.ID = gen_id(GEN_CRED_ABONOS_IMPS_ID,1); end ^
CREATE TRIGGER CREDITOS_ABONOS_PAGOS_BI FOR CREDITOS_ABONOS_PAGOS
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_CREDITOS_ABONOS_PAGOS_id,1); end ^
CREATE TRIGGER CREDITOS_ABONOS_VENTAS_BI FOR CREDITOS_ABONOS_VENTAS
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_CREDITOS_ABONOS_VENTAS_id,1); end ^
CREATE TRIGGER CRED_ARTS_IMPS_BI FOR CREDITOS_ARTICULOS_IMPUESTOS
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.ID is null) then new.ID = gen_id(GEN_CRED_ARTS_IMPS_ID,1); end ^
CREATE TRIGGER CREDITOS_TRANSACCIONES_BI FOR CREDITOS_TRANSACCIONES
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_CREDITOS_TRANSACCIONES_id,1); end ^
CREATE TRIGGER DEPARTAMENTOS_BI FOR DEPARTAMENTOS
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_DEPARTAMENTOS_id,1); end ^
CREATE TRIGGER DEVOLUCIONES_BI FOR DEVOLUCIONES
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_DEVOLUCIONES_id,1); end ^
CREATE TRIGGER DEVOLUCIONES_ARTICULOS_BI FOR DEVOLUCIONES_ARTICULOS
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_DEVOLUCIONES_ARTICULOS_id,1); end ^
CREATE TRIGGER FACTURACION_CERTIFICADOS_BI FOR FACTURACION_CERTIFICADOS
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_FACTURACION_CERTIFICADOS_id,1); end ^
CREATE TRIGGER FACTURACION_CLIENTES_BI FOR FACTURACION_CLIENTES
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_FACTURACION_CLIENTES_id,1); end ^
CREATE TRIGGER FACTURACION_EMISORES_BI FOR FACTURACION_EMISORES
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_FACTURACION_EMISORES_id,1); end ^
CREATE TRIGGER FACTURACION_FOLIOS_BI FOR FACTURACION_FOLIOS
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_FACTURACION_FOLIOS_id,1); end ^
CREATE TRIGGER FACTURAS_BI FOR FACTURAS
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_facturas_id,1); end ^
CREATE TRIGGER FACTURAS_BI_FOLIO FOR FACTURAS
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.folio is null) then new.folio = gen_id(gen_FACTURAS_folio,1); end ^
CREATE TRIGGER HISTORIAL_INVENTARIO_BI FOR HISTORIAL_INVENTARIO
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_historial_inventario_id,1); end ^
CREATE TRIGGER IMPUESTOS_BI FOR IMPUESTOS
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_impuestos_id,1); end ^
CREATE TRIGGER IMPUESTOS_REGLAS_BI FOR IMPUESTOS_REGLAS
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_IMPUESTOS_REGLAS_id,1); end ^
CREATE TRIGGER INVENTARIO_AJUSTES_BI FOR INVENTARIO_AJUSTES
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_inventario_ajustes_id,1); end ^
CREATE TRIGGER INVENTARIO_HISTORIAL_BI FOR INVENTARIO_HISTORIAL
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_inventario_historial_id,1); end ^
CREATE TRIGGER INVENTARIO_RECIBOS_BI FOR INVENTARIO_RECIBOS
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_inventario_recibos_id,1); end ^
CREATE TRIGGER LISTA_DE_COMPRA_BI FOR LISTA_DE_COMPRA
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_LISTA_DE_COMPRA_id,1); end ^
CREATE TRIGGER MEDIDAS_BI FOR MEDIDAS
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_MEDIDAS_id,1); end ^
CREATE TRIGGER MOVIMIENTOS_BI FOR MOVIMIENTOS
ACTIVE BEFORE INSERT POSITION 0
as
begin
if (new.id is null) then
new.id = gen_id(gen_movimientos_id,1);
end ^
CREATE TRIGGER ORDENES_DE_COMPRA_BI FOR ORDENES_DE_COMPRA
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_ORDENES_DE_COMPRA_id,1); end ^
CREATE TRIGGER PAGOS_MIXTOS_BI FOR PAGOS_MIXTOS
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_pagos_mixtos_id,1); end ^
CREATE TRIGGER PRODUCTOS_BI FOR PRODUCTOS
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_PRODUCTOS_id,1); end ^
CREATE TRIGGER PRODUCTOS_CFDI_BI FOR PRODUCTOS_CFDI
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_PRODUCTOS_CFDI_id,1); end ^
CREATE TRIGGER PROMOCIONES_POR_CANTIDAD_BI FOR PROMOCIONES_POR_CANTIDAD
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_PROMOCIONES_POR_CANTIDAD_id,1); end ^
CREATE TRIGGER PROVEEDORES_BI FOR PROVEEDORES
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_PROVEEDORES_id,1); end ^
CREATE TRIGGER PROVEEDORES_BASE_BI FOR PROVEEDORES_BASE
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_proveedores_base_id,1); end ^
CREATE TRIGGER SINCRONIZACION_NUBE_BI FOR SINCRONIZACION_NUBE
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_sincronizacion_nube_id,1); end ^
CREATE TRIGGER TRANSACCIONES_PROSEPAGO_BI FOR TRANSACCIONES_PROSEPAGO
ACTIVE BEFORE INSERT POSITION 0
AS BEGIN IF (NEW.ID IS NULL) THEN NEW.ID = GEN_ID(GEN_TRANSACCIONES_PROSEPAGO_ID, 1); END ^
CREATE TRIGGER TURNOS_BI FOR TURNOS
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_TURNOS_id,1); end ^
CREATE TRIGGER USUARIOS_BI FOR USUARIOS
ACTIVE BEFORE INSERT POSITION 0
as
begin
if (new.id is null) then
new.id = gen_id(gen_usuarios_id,1);
end ^
CREATE TRIGGER VENTATICKETS_BI FOR VENTATICKETS
ACTIVE BEFORE INSERT POSITION 0
as
begin
if (new.id is null) then
new.id = gen_id(gen_ventatickets_id,1);
end ^
CREATE TRIGGER VENTATICKETS_ARTICULOS_BI FOR VENTATICKETS_ARTICULOS
ACTIVE BEFORE INSERT POSITION 0
as
begin
if (new.id is null) then
new.id = gen_id(gen_ventatickets_articulos_id,1);
end ^
CREATE TRIGGER VENTATICKETS_IMPUESTOS_BI FOR VENTATICKETS_IMPUESTOS
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_VENTATICKETS_IMPUESTOS_id,1); end ^
CREATE TRIGGER VENTA_DE_RECARGAS_BI FOR VENTA_DE_RECARGAS
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_VENTA_DE_RECARGAS_id,1); end ^
CREATE TRIGGER VENTA_RECARGA_BI FOR VENTA_RECARGA
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_VENTA_RECARGA_id,1); end ^
CREATE TRIGGER VENTA_SERVICIO_BI FOR VENTA_SERVICIO
ACTIVE BEFORE INSERT POSITION 0
as begin if (new.id is null) then new.id = gen_id(gen_VENTA_SERVICIO_id,1); end ^
SET TERM ; ^
COMMIT WORK;
GRANT USAGE ON SEQUENCE GEN_ABONOS_ARTICULOS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_ABONOS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_ABONOS_VENTAS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_ABONO_TICKETS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_ALMACENES_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_ARTICULOS_DE_OC_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_CACHE_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_CAJAS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_CLIENTESV2_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_CLIENTES_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_COMISIONES_TARJETA_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_CONCILIACION_PA_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_CONFIGURACION_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_CORTE_IMPUESTOS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_CORTE_IMP_COBRA_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_CORTE_MOVIMIENTOS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_CORTE_OPERACIONES_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_CORTE_VENTAS_DE_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_CORTE_VENTAS_POR_DEPTO_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_CREDITOS_ABONOS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_CREDITOS_ABONOS_PAGOS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_CREDITOS_ABONOS_VENTAS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_CREDITOS_TRANSACCIONES_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_CRED_ABONOS_ARTS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_CRED_ABONOS_IMPS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_CRED_ARTS_IMPS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_DEPARTAMENTOS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_DEVOLUCIONES_ARTICULOS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_DEVOLUCIONES_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_FACTURACION_CERTIFICADOS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_FACTURACION_CLIENTES_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_FACTURACION_EMISORES_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_FACTURACION_FOLIOS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_FACTURACION_INFORMES_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_FACTURAS_FOLIO TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_FACTURAS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_HISTORIAL_INVENTARIO_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_HISTORIAL_USUARIOS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_IMPUESTOS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_IMPUESTOS_REGLAS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_INVENTARIO_AJUSTES_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_INVENTARIO_HISTORIAL_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_INVENTARIO_RECIBOS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_LISTA_DE_COMPRA_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_MEDIDAS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_MOVIMIENTOS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_OPERACIONES_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_ORDENES_DE_COMPRA_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_PAGOS_MIXTOS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_PRODUCTOS_CFDI_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_PRODUCTOS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_PROMOCIONES_POR_CANTIDAD_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_PROVEEDORES_BASE_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_PROVEEDORES_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_SERVICIOS_CONSECUTIVO TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_SERVICIOS_REFERENCIA_ABONOS TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_SINCRONIZACION_NUBE_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_TICKETS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_TICKET_ARTICULOS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_TRANSACCIONES_PROSEPAGO_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_TURNOS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_USUARIOS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_VENTATICKETS_ARTICULOS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_VENTATICKETS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_VENTATICKETS_IMPUESTOS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_VENTA_DE_RECARGAS_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_VENTA_RECARGA_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE GEN_VENTA_SERVICIO_ID TO PUBLIC;
GRANT USAGE ON SEQUENCE INVENTARIOS_RECEPCION_FOLIO TO PUBLIC;
GRANT USAGE ON SEQUENCE INVENTARIO_AJUSTE_FOLIO TO PUBLIC;
COMMENT ON DOMAIN TFORMAPAGO IS 'Forma de pago - e (Efectivo), c (Credito), t (Tarjeta), v (Vales)';
COMMENT ON DOMAIN TTIPOFACTURA IS 'n - Normal, d - Global diaria, s - Global semanal, m - Global mensual';
COMMENT ON DOMAIN TTIPOMOVIMIENTO IS '''E'' - entradas ,''S'' salidas ,''P'' pagos';
COMMENT ON COLUMN MOVIMIENTOS.TIPO IS '''E'' - entradas ,''S'' salidas ,''P'' pagos';
COMMENT ON COLUMN USUARIOS.PERMISOS IS 'Una cadena de las acciones a las que tiene acceso separadas por ;';