IDEMPIERE-764 Some tablenames starts with X whereas they have centralized IDs / X_CommodityShipment

This commit is contained in:
Carlos Ruiz 2013-03-18 14:24:36 -05:00
parent 7eaf68465b
commit 1dae118cb9
5 changed files with 231 additions and 53 deletions

View File

@ -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
;

View File

@ -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
;

View File

@ -20,15 +20,15 @@ import java.math.BigDecimal;
import java.sql.Timestamp; import java.sql.Timestamp;
import org.compiere.util.KeyNamePair; import org.compiere.util.KeyNamePair;
/** Generated Interface for X_CommodityShipment /** Generated Interface for M_CommodityShipment
* @author iDempiere (generated) * @author iDempiere (generated)
* @version Release 1.0a * @version Release 1.0a
*/ */
public interface I_X_CommodityShipment public interface I_M_CommodityShipment
{ {
/** TableName=X_CommodityShipment */ /** TableName=M_CommodityShipment */
public static final String Table_Name = "X_CommodityShipment"; public static final String Table_Name = "M_CommodityShipment";
/** AD_Table_ID=200045 */ /** AD_Table_ID=200045 */
public static final int Table_ID = 200045; public static final int Table_ID = 200045;
@ -162,21 +162,21 @@ public interface I_X_CommodityShipment
*/ */
public int getUpdatedBy(); public int getUpdatedBy();
/** Column name X_CommodityShipment_ID */ /** Column name M_CommodityShipment_ID */
public static final String COLUMNNAME_X_CommodityShipment_ID = "X_CommodityShipment_ID"; public static final String COLUMNNAME_M_CommodityShipment_ID = "M_CommodityShipment_ID";
/** Set X_CommodityShipment */ /** Set M_CommodityShipment */
public void setX_CommodityShipment_ID (int X_CommodityShipment_ID); public void setM_CommodityShipment_ID (int M_CommodityShipment_ID);
/** Get X_CommodityShipment */ /** Get M_CommodityShipment */
public int getX_CommodityShipment_ID(); public int getM_CommodityShipment_ID();
/** Column name X_CommodityShipment_UU */ /** Column name M_CommodityShipment_UU */
public static final String COLUMNNAME_X_CommodityShipment_UU = "X_CommodityShipment_UU"; public static final String COLUMNNAME_M_CommodityShipment_UU = "M_CommodityShipment_UU";
/** Set X_CommodityShipment_UU */ /** Set M_CommodityShipment_UU */
public void setX_CommodityShipment_UU (String X_CommodityShipment_UU); public void setM_CommodityShipment_UU (String M_CommodityShipment_UU);
/** Get X_CommodityShipment_UU */ /** Get M_CommodityShipment_UU */
public String getX_CommodityShipment_UU(); public String getM_CommodityShipment_UU();
} }

View File

@ -235,12 +235,12 @@ public class MShippingTransaction extends X_M_ShippingTransaction
return MShippingTransaction.FREIGHTCHARGES_3rdParty.equals(getFreightCharges()); 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(); 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("WHERE M_Product_ID IN (0, ?) OR M_Product_ID IS NULL ");
sql.append("AND AD_Client_ID IN (0, ?) "); sql.append("AND AD_Client_ID IN (0, ?) ");
sql.append("AND AD_Org_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()) if(rs.next())
{ {
commodityShipment = new X_X_CommodityShipment(getCtx(), rs, null); commodityShipment = new X_M_CommodityShipment(getCtx(), rs, null);
} }
} }
catch (Exception e) catch (Exception e)
@ -271,38 +271,38 @@ public class MShippingTransaction extends X_M_ShippingTransaction
} }
if(commodityShipment == null) if(commodityShipment == null)
commodityShipment = new X_X_CommodityShipment(getCtx(), 0, null); commodityShipment = new X_M_CommodityShipment(getCtx(), 0, null);
return commodityShipment; return commodityShipment;
} }
public int getCommodityShipmentID(int M_Product_ID) public int getCommodityShipmentID(int M_Product_ID)
{ {
X_X_CommodityShipment commodityShipment = getCommodityShipment(M_Product_ID); X_M_CommodityShipment commodityShipment = getCommodityShipment(M_Product_ID);
return commodityShipment.getX_CommodityShipment_ID(); return commodityShipment.getM_CommodityShipment_ID();
} }
public String getCommodityDescription(int M_Product_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(); return commodityShipment.getDescription();
} }
public String getHarmonizedCode(int M_Product_ID) 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(); return commodityShipment.getHarmonizedCode();
} }
public String getExportLicenseNum(int M_Product_ID) 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(); return commodityShipment.getExportLicenseNum();
} }
public String getCountryOfManufacture(int M_Product_ID) 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(); int countryId = commodityShipment.getCountryOfManufacture();
X_C_Country c = new X_C_Country(getCtx(), countryId, null); X_C_Country c = new X_C_Country(getCtx(), countryId, null);
return c.getCountryCode(); return c.getCountryCode();

View File

@ -20,10 +20,10 @@ package org.compiere.model;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.util.Properties; import java.util.Properties;
/** Generated Model for X_CommodityShipment /** Generated Model for M_CommodityShipment
* @author iDempiere (generated) * @author iDempiere (generated)
* @version Release 1.0a - $Id$ */ * @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; private static final long serialVersionUID = 20121207L;
/** Standard Constructor */ /** 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); super (ctx, M_CommodityShipment_ID, trxName);
/** if (X_CommodityShipment_ID == 0) /** if (M_CommodityShipment_ID == 0)
{ {
setCountryOfManufacture (0); setCountryOfManufacture (0);
setHarmonizedCode (null); setHarmonizedCode (null);
setX_CommodityShipment_ID (0); setM_CommodityShipment_ID (0);
} */ } */
} }
/** Load Constructor */ /** 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); super (ctx, rs, trxName);
} }
@ -66,7 +66,7 @@ public class X_X_CommodityShipment extends PO implements I_X_CommodityShipment,
public String toString() public String toString()
{ {
StringBuffer sb = new StringBuffer ("X_X_CommodityShipment[") StringBuffer sb = new StringBuffer ("X_M_CommodityShipment[")
.append(get_ID()).append("]"); .append(get_ID()).append("]");
return sb.toString(); return sb.toString();
} }
@ -161,37 +161,37 @@ public class X_X_CommodityShipment extends PO implements I_X_CommodityShipment,
return ii.intValue(); return ii.intValue();
} }
/** Set X_CommodityShipment. /** Set M_CommodityShipment.
@param X_CommodityShipment_ID X_CommodityShipment */ @param M_CommodityShipment_ID M_CommodityShipment */
public void setX_CommodityShipment_ID (int X_CommodityShipment_ID) public void setM_CommodityShipment_ID (int M_CommodityShipment_ID)
{ {
if (X_CommodityShipment_ID < 1) if (M_CommodityShipment_ID < 1)
set_ValueNoCheck (COLUMNNAME_X_CommodityShipment_ID, null); set_ValueNoCheck (COLUMNNAME_M_CommodityShipment_ID, null);
else 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. /** Get M_CommodityShipment.
@return X_CommodityShipment */ @return M_CommodityShipment */
public int getX_CommodityShipment_ID () 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) if (ii == null)
return 0; return 0;
return ii.intValue(); return ii.intValue();
} }
/** Set X_CommodityShipment_UU. /** Set M_CommodityShipment_UU.
@param X_CommodityShipment_UU X_CommodityShipment_UU */ @param M_CommodityShipment_UU M_CommodityShipment_UU */
public void setX_CommodityShipment_UU (String X_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. /** Get M_CommodityShipment_UU.
@return X_CommodityShipment_UU */ @return M_CommodityShipment_UU */
public String getX_CommodityShipment_UU () public String getM_CommodityShipment_UU ()
{ {
return (String)get_Value(COLUMNNAME_X_CommodityShipment_UU); return (String)get_Value(COLUMNNAME_M_CommodityShipment_UU);
} }
} }