Commit 65ab02d8 authored by Mark Orlando Molina's avatar Mark Orlando Molina Committed by Víctor Martínez Romanos
Browse files

Fixed BUG-45763: Added "Sint Maarten" and "Curaçao" new countries

Also "Netherlands Antilles" was deactivated
parent d1340508
......@@ -3205,7 +3205,7 @@
<!--260--> <C_COUNTRY_ID><![CDATA[260]]></C_COUNTRY_ID>
<!--260--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
<!--260--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
<!--260--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
<!--260--> <ISACTIVE><![CDATA[N]]></ISACTIVE>
<!--260--> <CREATED><![CDATA[2011-02-22 17:06:39.0]]></CREATED>
<!--260--> <CREATEDBY><![CDATA[0]]></CREATEDBY>
<!--260--> <UPDATED><![CDATA[2011-02-22 17:06:39.0]]></UPDATED>
......@@ -5006,6 +5006,46 @@
<!--350--> <IBANCOUNTRY><![CDATA[ME]]></IBANCOUNTRY>
<!--350--></C_COUNTRY>
<!--56589EEE91534A9C8AA2DDF487EF542D--><C_COUNTRY>
<!--56589EEE91534A9C8AA2DDF487EF542D--> <C_COUNTRY_ID><![CDATA[56589EEE91534A9C8AA2DDF487EF542D]]></C_COUNTRY_ID>
<!--56589EEE91534A9C8AA2DDF487EF542D--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
<!--56589EEE91534A9C8AA2DDF487EF542D--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
<!--56589EEE91534A9C8AA2DDF487EF542D--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
<!--56589EEE91534A9C8AA2DDF487EF542D--> <CREATED><![CDATA[2021-01-25 10:06:39.0]]></CREATED>
<!--56589EEE91534A9C8AA2DDF487EF542D--> <CREATEDBY><![CDATA[0]]></CREATEDBY>
<!--56589EEE91534A9C8AA2DDF487EF542D--> <UPDATED><![CDATA[2021-01-25 10:06:39.0]]></UPDATED>
<!--56589EEE91534A9C8AA2DDF487EF542D--> <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
<!--56589EEE91534A9C8AA2DDF487EF542D--> <NAME><![CDATA[Sint Maarten]]></NAME>
<!--56589EEE91534A9C8AA2DDF487EF542D--> <DESCRIPTION><![CDATA[Sint Maarten]]></DESCRIPTION>
<!--56589EEE91534A9C8AA2DDF487EF542D--> <COUNTRYCODE><![CDATA[SX]]></COUNTRYCODE>
<!--56589EEE91534A9C8AA2DDF487EF542D--> <HASREGION><![CDATA[N]]></HASREGION>
<!--56589EEE91534A9C8AA2DDF487EF542D--> <REGIONNAME><![CDATA[State]]></REGIONNAME>
<!--56589EEE91534A9C8AA2DDF487EF542D--> <DISPLAYSEQUENCE><![CDATA[@C@, @P@]]></DISPLAYSEQUENCE>
<!--56589EEE91534A9C8AA2DDF487EF542D--> <HASPOSTAL_ADD><![CDATA[N]]></HASPOSTAL_ADD>
<!--56589EEE91534A9C8AA2DDF487EF542D--> <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
<!--56589EEE91534A9C8AA2DDF487EF542D--> <C_CURRENCY_ID><![CDATA[284]]></C_CURRENCY_ID>
<!--56589EEE91534A9C8AA2DDF487EF542D--></C_COUNTRY>
<!--911EFDC31736411FB27977333E9D2F35--><C_COUNTRY>
<!--911EFDC31736411FB27977333E9D2F35--> <C_COUNTRY_ID><![CDATA[911EFDC31736411FB27977333E9D2F35]]></C_COUNTRY_ID>
<!--911EFDC31736411FB27977333E9D2F35--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
<!--911EFDC31736411FB27977333E9D2F35--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
<!--911EFDC31736411FB27977333E9D2F35--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
<!--911EFDC31736411FB27977333E9D2F35--> <CREATED><![CDATA[2021-01-25 10:08:45.0]]></CREATED>
<!--911EFDC31736411FB27977333E9D2F35--> <CREATEDBY><![CDATA[0]]></CREATEDBY>
<!--911EFDC31736411FB27977333E9D2F35--> <UPDATED><![CDATA[2021-01-25 10:08:45.0]]></UPDATED>
<!--911EFDC31736411FB27977333E9D2F35--> <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
<!--911EFDC31736411FB27977333E9D2F35--> <NAME><![CDATA[Curaçao]]></NAME>
<!--911EFDC31736411FB27977333E9D2F35--> <DESCRIPTION><![CDATA[Curaçao]]></DESCRIPTION>
<!--911EFDC31736411FB27977333E9D2F35--> <COUNTRYCODE><![CDATA[CW]]></COUNTRYCODE>
<!--911EFDC31736411FB27977333E9D2F35--> <HASREGION><![CDATA[N]]></HASREGION>
<!--911EFDC31736411FB27977333E9D2F35--> <REGIONNAME><![CDATA[State]]></REGIONNAME>
<!--911EFDC31736411FB27977333E9D2F35--> <DISPLAYSEQUENCE><![CDATA[@C@, @P@]]></DISPLAYSEQUENCE>
<!--911EFDC31736411FB27977333E9D2F35--> <HASPOSTAL_ADD><![CDATA[N]]></HASPOSTAL_ADD>
<!--911EFDC31736411FB27977333E9D2F35--> <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
<!--911EFDC31736411FB27977333E9D2F35--> <C_CURRENCY_ID><![CDATA[284]]></C_CURRENCY_ID>
<!--911EFDC31736411FB27977333E9D2F35--></C_COUNTRY>
<!--9F557A143F1D4295897F07DFDFDB4074--><C_COUNTRY>
<!--9F557A143F1D4295897F07DFDFDB4074--> <C_COUNTRY_ID><![CDATA[9F557A143F1D4295897F07DFDFDB4074]]></C_COUNTRY_ID>
<!--9F557A143F1D4295897F07DFDFDB4074--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
......
/*
*************************************************************************
* The contents of this file are subject to the Openbravo Public License
* Version 1.1 (the "License"), being the Mozilla Public License
* Version 1.1 with a permitted attribution clause; you may not use this
* file except in compliance with the License. You may obtain a copy of
* the License at http://www.openbravo.com/legal/license.html
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
* The Original Code is Openbravo ERP.
* The Initial Developer of the Original Code is Openbravo SLU
* All portions are Copyright (C) 2021 Openbravo SLU
* All Rights Reserved.
* Contributor(s): ______________________________________.
************************************************************************
*/
package org.openbravo.modulescript;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.servlet.ServletException;
import org.openbravo.database.ConnectionProvider;
public class AddSintMaartenAndCuracao extends ModuleScript {
//This module script has been created due to issue 45763
@Override
public void execute() {
try {
ConnectionProvider cp = getConnectionProvider();
AddSintMaartenAndCuracaoData.deactivateNetherlandAntilles(cp);
AddSintMaartenAndCuracaoData.addSintMaartenCountry(cp);
AddSintMaartenAndCuracaoData.addCuracaoCountry(cp);
} catch (Exception e) {
handleError(e);
}
}
@Override
protected ModuleScriptExecutionLimits getModuleScriptExecutionLimits() {
return new ModuleScriptExecutionLimits("0", null,
new OpenbravoVersion(3,0,212000));
}
@Override
protected boolean executeOnInstall() {
return false;
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!--
*************************************************************************
* The contents of this file are subject to the Openbravo Public License
* Version 1.1 (the "License"), being the Mozilla Public License
* Version 1.1 with a permitted attribution clause; you may not use this
* file except in compliance with the License. You may obtain a copy of
* the License at http://www.openbravo.com/legal/license.html
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
* The Original Code is Openbravo ERP.
* The Initial Developer of the Original Code is Openbravo SLU
* All portions are Copyright (C) 2021 Openbravo SLU
* All Rights Reserved.
* Contributor(s): ______________________________________.
************************************************************************
-->
<SqlClass name="AddSintMaartenAndCuracaoData" package="org.openbravo.modulescript">
<SqlClassComment></SqlClassComment>
<SqlMethod name="select" type="preparedStatement" return="multiple">
<SqlMethodComment></SqlMethodComment>
<Sql><![CDATA[
SELECT '' as ad_client_id FROM DUAL
]]>
</Sql>
</SqlMethod>
<SqlMethod name="deactivateNetherlandAntilles" type="preparedStatement" return="rowcount">
<SqlMethodComment></SqlMethodComment>
<Sql><![CDATA[
UPDATE c_country SET isactive='N' WHERE c_country_id='260' AND isactive='Y'
]]>
</Sql>
</SqlMethod>
<SqlMethod name="addSintMaartenCountry" type="preparedStatement" return="rowcount">
<SqlMethodComment></SqlMethodComment>
<Sql><![CDATA[
INSERT INTO c_country(
c_country_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby,
name, description, countrycode, hasregion, regionname, displaysequence,
haspostal_add, isdefault, c_currency_id)
SELECT '56589EEE91534A9C8AA2DDF487EF542D', '0', '0', 'Y', now(), '0', now(), '0',
'Sint Maarten', 'Sint Maarten', 'SX', 'N', 'State', '@C@, @P@',
'N', 'N', '284'
FROM DUAL
WHERE NOT EXISTS
(SELECT 1 FROM c_country WHERE c_country_ID = '56589EEE91534A9C8AA2DDF487EF542D')
]]>
</Sql>
</SqlMethod>
<SqlMethod name="addCuracaoCountry" type="preparedStatement" return="rowcount">
<SqlMethodComment></SqlMethodComment>
<Sql><![CDATA[
INSERT INTO c_country(
c_country_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby,
name, description, countrycode, hasregion, regionname, displaysequence,
haspostal_add, isdefault, c_currency_id)
SELECT '911EFDC31736411FB27977333E9D2F35', '0', '0', 'Y', now(), '0', now(), '0',
'Curaçao', 'Curaçao', 'CW', 'N', 'State', '@C@, @P@',
'N', 'N', '284'
FROM DUAL
WHERE NOT EXISTS
(SELECT 1 FROM c_country WHERE c_country_ID = '911EFDC31736411FB27977333E9D2F35')
]]>
</Sql>
</SqlMethod>
</SqlClass>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment