diff --git a/migration/i1.0a-release/oracle/201303181413_IDEMPIERE-764.sql b/migration/i1.0a-release/oracle/201303181413_IDEMPIERE-764.sql new file mode 100644 index 0000000000..87efc513e5 --- /dev/null +++ b/migration/i1.0a-release/oracle/201303181413_IDEMPIERE-764.sql @@ -0,0 +1,89 @@ +-- IDEMPIERE-764 Some tablenames starts with X whereas they have centralized IDs +ALTER TABLE X_CommodityShipment RENAME TO M_CommodityShipment +; + +ALTER TABLE M_CommodityShipment RENAME COLUMN X_CommodityShipment_ID TO M_CommodityShipment_ID +; + +ALTER TABLE M_CommodityShipment RENAME COLUMN X_CommodityShipment_UU TO M_CommodityShipment_UU +; + +-- Mar 18, 2013 2:10:54 PM COT +UPDATE AD_Table SET TableName='M_CommodityShipment', Name='CommodityShipment',Updated=TO_DATE('2013-03-18 14:10:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=200045 +; + +-- Mar 18, 2013 2:10:54 PM COT +UPDATE AD_Table_Trl SET IsTranslated='N' WHERE AD_Table_ID=200045 +; + +-- Mar 18, 2013 2:10:55 PM COT +UPDATE AD_Sequence SET Description='Table M_CommodityShipment', Name='M_CommodityShipment',Updated=TO_DATE('2013-03-18 14:10:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Sequence_ID=200041 +; + +-- Mar 18, 2013 2:11:27 PM COT +UPDATE AD_Element SET ColumnName='M_CommodityShipment_ID', Name='Commodity Shipment', PrintName='Commodity Shipment',Updated=TO_DATE('2013-03-18 14:11:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=200317 +; + +-- Mar 18, 2013 2:11:27 PM COT +UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=200317 +; + +-- Mar 18, 2013 2:11:27 PM COT +UPDATE AD_Column SET ColumnName='M_CommodityShipment_ID', Name='Commodity Shipment', Description=NULL, Help=NULL WHERE AD_Element_ID=200317 +; + +-- Mar 18, 2013 2:11:27 PM COT +UPDATE AD_Process_Para SET ColumnName='M_CommodityShipment_ID', Name='Commodity Shipment', Description=NULL, Help=NULL, AD_Element_ID=200317 WHERE UPPER(ColumnName)='M_COMMODITYSHIPMENT_ID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL +; + +-- Mar 18, 2013 2:11:27 PM COT +UPDATE AD_Process_Para SET ColumnName='M_CommodityShipment_ID', Name='Commodity Shipment', Description=NULL, Help=NULL WHERE AD_Element_ID=200317 AND IsCentrallyMaintained='Y' +; + +-- Mar 18, 2013 2:11:27 PM COT +UPDATE AD_InfoColumn SET ColumnName='M_CommodityShipment_ID', Name='Commodity Shipment', Description=NULL, Help=NULL WHERE AD_Element_ID=200317 AND IsCentrallyMaintained='Y' +; + +-- Mar 18, 2013 2:11:27 PM COT +UPDATE AD_Field SET Name='Commodity Shipment', Description=NULL, Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=200317) AND IsCentrallyMaintained='Y' +; + +-- Mar 18, 2013 2:11:27 PM COT +UPDATE AD_PrintFormatItem SET PrintName='Commodity Shipment', Name='Commodity Shipment' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=AD_PrintFormatItem.AD_Column_ID AND c.AD_Element_ID=200317) +; + +-- Mar 18, 2013 2:11:37 PM COT +UPDATE AD_Element SET ColumnName='M_CommodityShipment_UU', Name='M_CommodityShipment_UU', PrintName='M_CommodityShipment_UU',Updated=TO_DATE('2013-03-18 14:11:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=200318 +; + +-- Mar 18, 2013 2:11:37 PM COT +UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=200318 +; + +-- Mar 18, 2013 2:11:37 PM COT +UPDATE AD_Column SET ColumnName='M_CommodityShipment_UU', Name='M_CommodityShipment_UU', Description=NULL, Help=NULL WHERE AD_Element_ID=200318 +; + +-- Mar 18, 2013 2:11:37 PM COT +UPDATE AD_Process_Para SET ColumnName='M_CommodityShipment_UU', Name='M_CommodityShipment_UU', Description=NULL, Help=NULL, AD_Element_ID=200318 WHERE UPPER(ColumnName)='M_COMMODITYSHIPMENT_UU' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL +; + +-- Mar 18, 2013 2:11:37 PM COT +UPDATE AD_Process_Para SET ColumnName='M_CommodityShipment_UU', Name='M_CommodityShipment_UU', Description=NULL, Help=NULL WHERE AD_Element_ID=200318 AND IsCentrallyMaintained='Y' +; + +-- Mar 18, 2013 2:11:37 PM COT +UPDATE AD_InfoColumn SET ColumnName='M_CommodityShipment_UU', Name='M_CommodityShipment_UU', Description=NULL, Help=NULL WHERE AD_Element_ID=200318 AND IsCentrallyMaintained='Y' +; + +-- Mar 18, 2013 2:11:37 PM COT +UPDATE AD_Field SET Name='M_CommodityShipment_UU', Description=NULL, Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=200318) AND IsCentrallyMaintained='Y' +; + +-- Mar 18, 2013 2:11:37 PM COT +UPDATE AD_PrintFormatItem SET PrintName='M_CommodityShipment_UU', Name='M_CommodityShipment_UU' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=AD_PrintFormatItem.AD_Column_ID AND c.AD_Element_ID=200318) +; + +SELECT register_migration_script('201303181413_IDEMPIERE-764.sql') FROM dual +; + diff --git a/migration/i1.0a-release/postgresql/201303181413_IDEMPIERE-764.sql b/migration/i1.0a-release/postgresql/201303181413_IDEMPIERE-764.sql new file mode 100644 index 0000000000..0b3b83b3b7 --- /dev/null +++ b/migration/i1.0a-release/postgresql/201303181413_IDEMPIERE-764.sql @@ -0,0 +1,89 @@ +-- IDEMPIERE-764 Some tablenames starts with X whereas they have centralized IDs +ALTER TABLE X_CommodityShipment RENAME TO M_CommodityShipment +; + +ALTER TABLE M_CommodityShipment RENAME X_CommodityShipment_ID TO M_CommodityShipment_ID +; + +ALTER TABLE M_CommodityShipment RENAME X_CommodityShipment_UU TO M_CommodityShipment_UU +; + +-- Mar 18, 2013 2:10:54 PM COT +UPDATE AD_Table SET TableName='M_CommodityShipment', Name='CommodityShipment',Updated=TO_TIMESTAMP('2013-03-18 14:10:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=200045 +; + +-- Mar 18, 2013 2:10:54 PM COT +UPDATE AD_Table_Trl SET IsTranslated='N' WHERE AD_Table_ID=200045 +; + +-- Mar 18, 2013 2:10:55 PM COT +UPDATE AD_Sequence SET Description='Table M_CommodityShipment', Name='M_CommodityShipment',Updated=TO_TIMESTAMP('2013-03-18 14:10:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Sequence_ID=200041 +; + +-- Mar 18, 2013 2:11:27 PM COT +UPDATE AD_Element SET ColumnName='M_CommodityShipment_ID', Name='Commodity Shipment', PrintName='Commodity Shipment',Updated=TO_TIMESTAMP('2013-03-18 14:11:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=200317 +; + +-- Mar 18, 2013 2:11:27 PM COT +UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=200317 +; + +-- Mar 18, 2013 2:11:27 PM COT +UPDATE AD_Column SET ColumnName='M_CommodityShipment_ID', Name='Commodity Shipment', Description=NULL, Help=NULL WHERE AD_Element_ID=200317 +; + +-- Mar 18, 2013 2:11:27 PM COT +UPDATE AD_Process_Para SET ColumnName='M_CommodityShipment_ID', Name='Commodity Shipment', Description=NULL, Help=NULL, AD_Element_ID=200317 WHERE UPPER(ColumnName)='M_COMMODITYSHIPMENT_ID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL +; + +-- Mar 18, 2013 2:11:27 PM COT +UPDATE AD_Process_Para SET ColumnName='M_CommodityShipment_ID', Name='Commodity Shipment', Description=NULL, Help=NULL WHERE AD_Element_ID=200317 AND IsCentrallyMaintained='Y' +; + +-- Mar 18, 2013 2:11:27 PM COT +UPDATE AD_InfoColumn SET ColumnName='M_CommodityShipment_ID', Name='Commodity Shipment', Description=NULL, Help=NULL WHERE AD_Element_ID=200317 AND IsCentrallyMaintained='Y' +; + +-- Mar 18, 2013 2:11:27 PM COT +UPDATE AD_Field SET Name='Commodity Shipment', Description=NULL, Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=200317) AND IsCentrallyMaintained='Y' +; + +-- Mar 18, 2013 2:11:27 PM COT +UPDATE AD_PrintFormatItem SET PrintName='Commodity Shipment', Name='Commodity Shipment' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=AD_PrintFormatItem.AD_Column_ID AND c.AD_Element_ID=200317) +; + +-- Mar 18, 2013 2:11:37 PM COT +UPDATE AD_Element SET ColumnName='M_CommodityShipment_UU', Name='M_CommodityShipment_UU', PrintName='M_CommodityShipment_UU',Updated=TO_TIMESTAMP('2013-03-18 14:11:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=200318 +; + +-- Mar 18, 2013 2:11:37 PM COT +UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=200318 +; + +-- Mar 18, 2013 2:11:37 PM COT +UPDATE AD_Column SET ColumnName='M_CommodityShipment_UU', Name='M_CommodityShipment_UU', Description=NULL, Help=NULL WHERE AD_Element_ID=200318 +; + +-- Mar 18, 2013 2:11:37 PM COT +UPDATE AD_Process_Para SET ColumnName='M_CommodityShipment_UU', Name='M_CommodityShipment_UU', Description=NULL, Help=NULL, AD_Element_ID=200318 WHERE UPPER(ColumnName)='M_COMMODITYSHIPMENT_UU' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL +; + +-- Mar 18, 2013 2:11:37 PM COT +UPDATE AD_Process_Para SET ColumnName='M_CommodityShipment_UU', Name='M_CommodityShipment_UU', Description=NULL, Help=NULL WHERE AD_Element_ID=200318 AND IsCentrallyMaintained='Y' +; + +-- Mar 18, 2013 2:11:37 PM COT +UPDATE AD_InfoColumn SET ColumnName='M_CommodityShipment_UU', Name='M_CommodityShipment_UU', Description=NULL, Help=NULL WHERE AD_Element_ID=200318 AND IsCentrallyMaintained='Y' +; + +-- Mar 18, 2013 2:11:37 PM COT +UPDATE AD_Field SET Name='M_CommodityShipment_UU', Description=NULL, Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=200318) AND IsCentrallyMaintained='Y' +; + +-- Mar 18, 2013 2:11:37 PM COT +UPDATE AD_PrintFormatItem SET PrintName='M_CommodityShipment_UU', Name='M_CommodityShipment_UU' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=AD_PrintFormatItem.AD_Column_ID AND c.AD_Element_ID=200318) +; + +SELECT register_migration_script('201303181413_IDEMPIERE-764.sql') FROM dual +; + diff --git a/org.adempiere.base/src/org/compiere/model/I_X_CommodityShipment.java b/org.adempiere.base/src/org/compiere/model/I_M_CommodityShipment.java similarity index 85% rename from org.adempiere.base/src/org/compiere/model/I_X_CommodityShipment.java rename to org.adempiere.base/src/org/compiere/model/I_M_CommodityShipment.java index ba59256eaa..d702d17493 100644 --- a/org.adempiere.base/src/org/compiere/model/I_X_CommodityShipment.java +++ b/org.adempiere.base/src/org/compiere/model/I_M_CommodityShipment.java @@ -20,15 +20,15 @@ import java.math.BigDecimal; import java.sql.Timestamp; import org.compiere.util.KeyNamePair; -/** Generated Interface for X_CommodityShipment +/** Generated Interface for M_CommodityShipment * @author iDempiere (generated) * @version Release 1.0a */ -public interface I_X_CommodityShipment +public interface I_M_CommodityShipment { - /** TableName=X_CommodityShipment */ - public static final String Table_Name = "X_CommodityShipment"; + /** TableName=M_CommodityShipment */ + public static final String Table_Name = "M_CommodityShipment"; /** AD_Table_ID=200045 */ public static final int Table_ID = 200045; @@ -162,21 +162,21 @@ public interface I_X_CommodityShipment */ public int getUpdatedBy(); - /** Column name X_CommodityShipment_ID */ - public static final String COLUMNNAME_X_CommodityShipment_ID = "X_CommodityShipment_ID"; + /** Column name M_CommodityShipment_ID */ + public static final String COLUMNNAME_M_CommodityShipment_ID = "M_CommodityShipment_ID"; - /** Set X_CommodityShipment */ - public void setX_CommodityShipment_ID (int X_CommodityShipment_ID); + /** Set M_CommodityShipment */ + public void setM_CommodityShipment_ID (int M_CommodityShipment_ID); - /** Get X_CommodityShipment */ - public int getX_CommodityShipment_ID(); + /** Get M_CommodityShipment */ + public int getM_CommodityShipment_ID(); - /** Column name X_CommodityShipment_UU */ - public static final String COLUMNNAME_X_CommodityShipment_UU = "X_CommodityShipment_UU"; + /** Column name M_CommodityShipment_UU */ + public static final String COLUMNNAME_M_CommodityShipment_UU = "M_CommodityShipment_UU"; - /** Set X_CommodityShipment_UU */ - public void setX_CommodityShipment_UU (String X_CommodityShipment_UU); + /** Set M_CommodityShipment_UU */ + public void setM_CommodityShipment_UU (String M_CommodityShipment_UU); - /** Get X_CommodityShipment_UU */ - public String getX_CommodityShipment_UU(); + /** Get M_CommodityShipment_UU */ + public String getM_CommodityShipment_UU(); } diff --git a/org.adempiere.base/src/org/compiere/model/MShippingTransaction.java b/org.adempiere.base/src/org/compiere/model/MShippingTransaction.java index 99a3529ae4..a8112860d1 100644 --- a/org.adempiere.base/src/org/compiere/model/MShippingTransaction.java +++ b/org.adempiere.base/src/org/compiere/model/MShippingTransaction.java @@ -235,12 +235,12 @@ public class MShippingTransaction extends X_M_ShippingTransaction return MShippingTransaction.FREIGHTCHARGES_3rdParty.equals(getFreightCharges()); } - public X_X_CommodityShipment getCommodityShipment(int M_Product_ID) + public X_M_CommodityShipment getCommodityShipment(int M_Product_ID) { - X_X_CommodityShipment commodityShipment = null; + X_M_CommodityShipment commodityShipment = null; StringBuilder sql = new StringBuilder(); - sql.append("SELECT * FROM X_CommodityShipment "); + sql.append("SELECT * FROM M_CommodityShipment "); sql.append("WHERE M_Product_ID IN (0, ?) OR M_Product_ID IS NULL "); sql.append("AND AD_Client_ID IN (0, ?) "); sql.append("AND AD_Org_ID IN (0, ?) "); @@ -258,7 +258,7 @@ public class MShippingTransaction extends X_M_ShippingTransaction if(rs.next()) { - commodityShipment = new X_X_CommodityShipment(getCtx(), rs, null); + commodityShipment = new X_M_CommodityShipment(getCtx(), rs, null); } } catch (Exception e) @@ -271,38 +271,38 @@ public class MShippingTransaction extends X_M_ShippingTransaction } if(commodityShipment == null) - commodityShipment = new X_X_CommodityShipment(getCtx(), 0, null); + commodityShipment = new X_M_CommodityShipment(getCtx(), 0, null); return commodityShipment; } public int getCommodityShipmentID(int M_Product_ID) { - X_X_CommodityShipment commodityShipment = getCommodityShipment(M_Product_ID); - return commodityShipment.getX_CommodityShipment_ID(); + X_M_CommodityShipment commodityShipment = getCommodityShipment(M_Product_ID); + return commodityShipment.getM_CommodityShipment_ID(); } public String getCommodityDescription(int M_Product_ID) { - X_X_CommodityShipment commodityShipment = getCommodityShipment(M_Product_ID); + X_M_CommodityShipment commodityShipment = getCommodityShipment(M_Product_ID); return commodityShipment.getDescription(); } public String getHarmonizedCode(int M_Product_ID) { - X_X_CommodityShipment commodityShipment = getCommodityShipment(M_Product_ID); + X_M_CommodityShipment commodityShipment = getCommodityShipment(M_Product_ID); return commodityShipment.getHarmonizedCode(); } public String getExportLicenseNum(int M_Product_ID) { - X_X_CommodityShipment commodityShipment = getCommodityShipment(M_Product_ID); + X_M_CommodityShipment commodityShipment = getCommodityShipment(M_Product_ID); return commodityShipment.getExportLicenseNum(); } public String getCountryOfManufacture(int M_Product_ID) { - X_X_CommodityShipment commodityShipment = getCommodityShipment(M_Product_ID); + X_M_CommodityShipment commodityShipment = getCommodityShipment(M_Product_ID); int countryId = commodityShipment.getCountryOfManufacture(); X_C_Country c = new X_C_Country(getCtx(), countryId, null); return c.getCountryCode(); diff --git a/org.adempiere.base/src/org/compiere/model/X_X_CommodityShipment.java b/org.adempiere.base/src/org/compiere/model/X_M_CommodityShipment.java similarity index 77% rename from org.adempiere.base/src/org/compiere/model/X_X_CommodityShipment.java rename to org.adempiere.base/src/org/compiere/model/X_M_CommodityShipment.java index a70595e29c..a3549d2502 100644 --- a/org.adempiere.base/src/org/compiere/model/X_X_CommodityShipment.java +++ b/org.adempiere.base/src/org/compiere/model/X_M_CommodityShipment.java @@ -20,10 +20,10 @@ package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; -/** Generated Model for X_CommodityShipment +/** Generated Model for M_CommodityShipment * @author iDempiere (generated) * @version Release 1.0a - $Id$ */ -public class X_X_CommodityShipment extends PO implements I_X_CommodityShipment, I_Persistent +public class X_M_CommodityShipment extends PO implements I_M_CommodityShipment, I_Persistent { /** @@ -32,19 +32,19 @@ public class X_X_CommodityShipment extends PO implements I_X_CommodityShipment, private static final long serialVersionUID = 20121207L; /** Standard Constructor */ - public X_X_CommodityShipment (Properties ctx, int X_CommodityShipment_ID, String trxName) + public X_M_CommodityShipment (Properties ctx, int M_CommodityShipment_ID, String trxName) { - super (ctx, X_CommodityShipment_ID, trxName); - /** if (X_CommodityShipment_ID == 0) + super (ctx, M_CommodityShipment_ID, trxName); + /** if (M_CommodityShipment_ID == 0) { setCountryOfManufacture (0); setHarmonizedCode (null); - setX_CommodityShipment_ID (0); + setM_CommodityShipment_ID (0); } */ } /** Load Constructor */ - public X_X_CommodityShipment (Properties ctx, ResultSet rs, String trxName) + public X_M_CommodityShipment (Properties ctx, ResultSet rs, String trxName) { super (ctx, rs, trxName); } @@ -66,7 +66,7 @@ public class X_X_CommodityShipment extends PO implements I_X_CommodityShipment, public String toString() { - StringBuffer sb = new StringBuffer ("X_X_CommodityShipment[") + StringBuffer sb = new StringBuffer ("X_M_CommodityShipment[") .append(get_ID()).append("]"); return sb.toString(); } @@ -161,37 +161,37 @@ public class X_X_CommodityShipment extends PO implements I_X_CommodityShipment, return ii.intValue(); } - /** Set X_CommodityShipment. - @param X_CommodityShipment_ID X_CommodityShipment */ - public void setX_CommodityShipment_ID (int X_CommodityShipment_ID) + /** Set M_CommodityShipment. + @param M_CommodityShipment_ID M_CommodityShipment */ + public void setM_CommodityShipment_ID (int M_CommodityShipment_ID) { - if (X_CommodityShipment_ID < 1) - set_ValueNoCheck (COLUMNNAME_X_CommodityShipment_ID, null); + if (M_CommodityShipment_ID < 1) + set_ValueNoCheck (COLUMNNAME_M_CommodityShipment_ID, null); else - set_ValueNoCheck (COLUMNNAME_X_CommodityShipment_ID, Integer.valueOf(X_CommodityShipment_ID)); + set_ValueNoCheck (COLUMNNAME_M_CommodityShipment_ID, Integer.valueOf(M_CommodityShipment_ID)); } - /** Get X_CommodityShipment. - @return X_CommodityShipment */ - public int getX_CommodityShipment_ID () + /** Get M_CommodityShipment. + @return M_CommodityShipment */ + public int getM_CommodityShipment_ID () { - Integer ii = (Integer)get_Value(COLUMNNAME_X_CommodityShipment_ID); + Integer ii = (Integer)get_Value(COLUMNNAME_M_CommodityShipment_ID); if (ii == null) return 0; return ii.intValue(); } - /** Set X_CommodityShipment_UU. - @param X_CommodityShipment_UU X_CommodityShipment_UU */ - public void setX_CommodityShipment_UU (String X_CommodityShipment_UU) + /** Set M_CommodityShipment_UU. + @param M_CommodityShipment_UU M_CommodityShipment_UU */ + public void setM_CommodityShipment_UU (String M_CommodityShipment_UU) { - set_Value (COLUMNNAME_X_CommodityShipment_UU, X_CommodityShipment_UU); + set_Value (COLUMNNAME_M_CommodityShipment_UU, M_CommodityShipment_UU); } - /** Get X_CommodityShipment_UU. - @return X_CommodityShipment_UU */ - public String getX_CommodityShipment_UU () + /** Get M_CommodityShipment_UU. + @return M_CommodityShipment_UU */ + public String getM_CommodityShipment_UU () { - return (String)get_Value(COLUMNNAME_X_CommodityShipment_UU); + return (String)get_Value(COLUMNNAME_M_CommodityShipment_UU); } } \ No newline at end of file