DECLARE @uid AS VARCHAR(20)

SELECT TOP 1 @uid = uid FROM gen_config

IF NOT EXISTS (SELECT 1 FROM gen_config WHERE config = 'calcularMargen' AND modulo = 'documentos')
BEGIN
	EXEC [dbo].[ins_gen_config]  @uid, '01', 1, 1, 'calcularMargen', '', 'documentos', '0', 'Se define como calcular el margen', NULL
END