diff --git a/db/ddlutils/oracle/functions/get_Sysconfig.sql b/db/ddlutils/oracle/functions/get_Sysconfig.sql new file mode 100644 index 0000000000..2ea994f9b7 --- /dev/null +++ b/db/ddlutils/oracle/functions/get_Sysconfig.sql @@ -0,0 +1,45 @@ +/* + *This file is part of Adempiere ERP Bazaar + *http://www.adempiere.org + *Copyright (C) 2006-2008 victor.perez@e-evolution.com, e-Evolution + *This program is free software; you can redistribute it and/or + *modify it under the terms of the GNU General Public License + *as published by the Free Software Foundation; either version 2 + *of the License, or (at your option) any later version. + * + *This program is distributed in the hope that it will be useful, + *but WITHOUT ANY WARRANTY; without even the implied warranty of + *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + *GNU General Public License for more details. + * + *You should have received a copy of the GNU General Public License + *along with this program; if not, write to the Free Software + *Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.of + * + * Author: Carlos Ruiz (globalqss) + */ +CREATE OR REPLACE FUNCTION get_Sysconfig +( + sysconfig_name IN ad_sysconfig.name%TYPE, + defaultvalue IN ad_sysconfig.value%TYPE, + client_id IN ad_sysconfig.ad_client_id%TYPE, + org_id IN ad_sysconfig.ad_org_id%TYPE +) +RETURN ad_sysconfig.value%TYPE +AS + v_value ad_sysconfig.value%TYPE; +BEGIN + BEGIN + SELECT Value + INTO v_value FROM + (SELECT Value + FROM AD_SysConfig WHERE Name=sysconfig_name AND AD_Client_ID IN (0, client_id) AND AD_Org_ID IN (0, org_id) AND IsActive='Y' + ORDER BY AD_Client_ID DESC, AD_Org_ID DESC) + WHERE ROWNUM = 1; + EXCEPTION + WHEN NO_DATA_FOUND THEN + v_value := defaultvalue; + END; + RETURN v_value; +END get_Sysconfig; +/ diff --git a/db/ddlutils/postgresql/functions/get_Sysconfig.sql b/db/ddlutils/postgresql/functions/get_Sysconfig.sql new file mode 100644 index 0000000000..e226fd8b79 --- /dev/null +++ b/db/ddlutils/postgresql/functions/get_Sysconfig.sql @@ -0,0 +1,47 @@ +/* + *This file is part of Adempiere ERP Bazaar + *http://www.adempiere.org + *Copyright (C) 2006-2008 victor.perez@e-evolution.com, e-Evolution + *This program is free software; you can redistribute it and/or + *modify it under the terms of the GNU General Public License + *as published by the Free Software Foundation; either version 2 + *of the License, or (at your option) any later version. + * + *This program is distributed in the hope that it will be useful, + *but WITHOUT ANY WARRANTY; without even the implied warranty of + *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + *GNU General Public License for more details. + * + *You should have received a copy of the GNU General Public License + *along with this program; if not, write to the Free Software + *Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.of + * + * Author: Carlos Ruiz (globalqss) + */ +CREATE OR REPLACE FUNCTION get_Sysconfig +( + sysconfig_name ad_sysconfig.name%TYPE, + defaultvalue ad_sysconfig.value%TYPE, + client_id ad_sysconfig.ad_client_id%TYPE, + org_id ad_sysconfig.ad_org_id%TYPE +) +RETURNS ad_sysconfig.value%TYPE +AS +$BODY$ +DECLARE + v_value ad_sysconfig.value%TYPE; +BEGIN + BEGIN + SELECT Value + INTO STRICT v_value + FROM AD_SysConfig WHERE Name=sysconfig_name AND AD_Client_ID IN (0, client_id) AND AD_Org_ID IN (0, org_id) AND IsActive='Y' + ORDER BY AD_Client_ID DESC, AD_Org_ID DESC + LIMIT 1; + EXCEPTION + WHEN NO_DATA_FOUND THEN + v_value := defaultvalue; + END; + RETURN v_value; +END; +$BODY$ + LANGUAGE 'plpgsql'; \ No newline at end of file diff --git a/migration/354a-trunk/oracle/715_FR2988993.sql b/migration/354a-trunk/oracle/715_FR2988993.sql new file mode 100644 index 0000000000..08855ad299 --- /dev/null +++ b/migration/354a-trunk/oracle/715_FR2988993.sql @@ -0,0 +1,4 @@ +-- Apr 18, 2010 10:38:04 AM COT +-- FR2988993_Displaying 1 instead of 99999 +INSERT INTO AD_SysConfig (AD_Client_ID,AD_Org_ID,AD_SysConfig_ID,ConfigurationLevel,Created,CreatedBy,Description,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,50043,'C',TO_DATE('2010-04-18 10:38:03','YYYY-MM-DD HH24:MI:SS'),100,'Quantity to show for services in InfoProduct window','D','Y','QTY_TO_SHOW_FOR_SERVICES',TO_DATE('2010-04-18 10:38:03','YYYY-MM-DD HH24:MI:SS'),100,'99999') +; diff --git a/migration/354a-trunk/postgresql/715_FR2988993.sql b/migration/354a-trunk/postgresql/715_FR2988993.sql new file mode 100644 index 0000000000..e0a250f3d3 --- /dev/null +++ b/migration/354a-trunk/postgresql/715_FR2988993.sql @@ -0,0 +1,5 @@ +-- Apr 18, 2010 10:38:04 AM COT +-- FR2988993_Displaying 1 instead of 99999 +INSERT INTO AD_SysConfig (AD_Client_ID,AD_Org_ID,AD_SysConfig_ID,ConfigurationLevel,Created,CreatedBy,Description,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,50043,'C',TO_TIMESTAMP('2010-04-18 10:38:03','YYYY-MM-DD HH24:MI:SS'),100,'Quantity to show for services in InfoProduct window','D','Y','QTY_TO_SHOW_FOR_SERVICES',TO_TIMESTAMP('2010-04-18 10:38:03','YYYY-MM-DD HH24:MI:SS'),100,'99999') +; +