IDEMPIERE-4723 Clean code org.adempiere.base/ akunagroup/ adempiere /base/imexp/model/print/process/util org.compiere (#915)

This commit is contained in:
Diego Ruiz 2021-10-11 10:49:41 +02:00 committed by GitHub
parent 21f022f2af
commit 7d7b2cf5b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 9 additions and 328 deletions

View File

@ -152,8 +152,6 @@ public class AddressLookup implements AddressLookupInterface {
// Get the root element.
Element doc = xmlDoc.getDocumentElement();
//System.out.println("Root Node: " + doc.getNodeName());
// Get the children.
NodeList DataElements = doc.getElementsByTagName("DataElement");
System.out.println("Number of DataElements: " + DataElements.getLength());
@ -318,10 +316,6 @@ public class AddressLookup implements AddressLookupInterface {
} else
log.log(Level.WARNING, "Postcode lookup error: " + postcode.getPostcode());
//if (postcode.getPostcode().length()==0)
// System.out.println("Postcode NOT found! ");
//else
return returnValue;
}

View File

@ -97,7 +97,6 @@ public class BaseActivator implements BundleActivator {
key = (String) enumeration.nextElement();
value = props.getProperty(key);
System.setProperty(key,value) ;
//System.out.println("Loaded Key: "+ key + "- Value :"+value);
}
}
}

View File

@ -167,8 +167,6 @@ public class RequestEventHandler extends AbstractEventHandler implements Managed
checkChange(r, ra, "C_Payment_ID");
checkChange(r, ra, "M_InOut_ID");
checkChange(r, ra, "M_RMA_ID");
// checkChange(ra, "C_Campaign_ID");
// checkChange(ra, "RequestAmt");
checkChange(r, ra, "IsInvoiced");
checkChange(r, ra, "C_Activity_ID");
checkChange(r, ra, "DateNextAction");
@ -204,15 +202,11 @@ public class RequestEventHandler extends AbstractEventHandler implements Managed
r.setLastResult(r.getResult());
// Reset
r.setConfidentialTypeEntry (r.getConfidentialType());
// r.setStartDate(null); //red1 - bug [ 1743159 ] Requests - Start Date is not retained.
r.setEndTime(null);
r.setR_StandardResponse_ID(0);
r.setR_MailText_ID(0);
r.setResult(null);
// globalqss - these fields must be cleared (waiting to open bug in sf)
// r.setM_ProductSpent_ID(0);
// r.setQtySpent(null);
// r.setQtyInvoiced(null);
}
return null;
@ -333,10 +327,6 @@ public class RequestEventHandler extends AbstractEventHandler implements Managed
if (rs.wasNull())
AD_Role_ID = -1;
// Don't send mail to oneself
// if (AD_User_ID == UpdatedBy)
// continue;
// No confidential to externals
if (AD_Role_ID == -1
&& (r.getConfidentialTypeEntry().equals(MRequest.CONFIDENTIALTYPE_Internal)

View File

@ -360,7 +360,6 @@ public abstract class AbstractExcelExporter
colnum++;
} // printed
} // for all columns
// m_workbook.setRepeatingRowsAndColumns(m_sheetCount, 0, 0, 0, 0);
}
protected int getNoOfParameter()

View File

@ -136,25 +136,17 @@ public class GridTabCSVExporter implements IGridTabExporter
//Details up to tab level 1
if(childs.size() > 0){
int specialDetDispayType = 0;
//int numOfTabs=0;
for(GridTab detail: childs){
//if(indxDetailSelected != detail.getTabNo())
//continue;
if(!detail.isDisplayed())
continue;
if(detail.getDisplayLogic()!=null){
//if(!currentRowOnly)
//numOfTabs--;
//TODO: it's need? DisplayLogic is evaluated when call detail.isDisplayed()
if(currentRowOnly && !Evaluator.evaluateLogic(detail,detail.getDisplayLogic()))
continue;
}
//comment this line if you want to export all tabs
//if(numOfTabs > 0)
//break;
if(detail.getTabLevel()>1)
continue;
@ -198,7 +190,6 @@ public class GridTabCSVExporter implements IGridTabExporter
specialDetDispayType = 0;
}
tabMapDetails.put(detail,gridFields);
//numOfTabs++;
}
gridFields = null;
}
@ -223,7 +214,7 @@ public class GridTabCSVExporter implements IGridTabExporter
int index =0;
int rowDetail=0;
int record_Id = 0;
// boolean isActiveRow = true;
gridTab.setCurrentRow(idxrow);
for(GridField field : getFields(gridTab)){
MColumn column = MColumn.get(Env.getCtx(), field.getAD_Column_ID());
@ -240,17 +231,10 @@ public class GridTabCSVExporter implements IGridTabExporter
}else{
value = resolveValue(gridTab, table, column, idxrow, headName);
}
//Ignore row
// if("IsActive".equals(headName) && value!=null && Boolean.valueOf((Boolean)value)==false){
// isActiveRow=false;
// break;
// }
row.put(headName,value);
idxfld++;
index++;
}
// if(!isActiveRow)
// continue;
if(specialHDispayType > 0 && record_Id > 0){
switch(specialHDispayType) {
@ -336,9 +320,6 @@ public class GridTabCSVExporter implements IGridTabExporter
if (tab.isReadOnly())
result = Msg.getMsg(Env.getCtx(),"FieldIsReadOnly", new Object[] {gridTab.getName()});
// if (gridTab.getTableName().endsWith("_Acct"))
// result = "Accounting Tab are not exported by default: "+ gridTab.getName();
return result;
}
@ -354,10 +335,7 @@ public class GridTabCSVExporter implements IGridTabExporter
for(Map.Entry<GridTab, GridField[]> childTabDetail : tabMapDetails.entrySet()) {
GridTab childTab = childTabDetail.getKey();
//String whereCla = getWhereClause (childTab ,record_Id ,keyColumnParent);
//childTab.getTableModel().dataRequery(whereCla, false, 0);
Map<String,Object> row = new HashMap<String,Object>();
// boolean isActiveRow = true;
if (childTab.getRowCount() > 0) {
int specialRecordId = 0;
for(GridField field : childTabDetail.getValue()){
@ -380,13 +358,8 @@ public class GridTabCSVExporter implements IGridTabExporter
row.put(headName,value);
if(value!=null)
hasDetails = true;
//Ignore row
// if(headName.contains("IsActive")&& value!=null && Boolean.valueOf((Boolean)value)==false){
// isActiveRow=false;
// break;
// }
}
if(/* isActiveRow && */ specialDetDispayType > 0 && specialRecordId > 0){
if(specialDetDispayType > 0 && specialRecordId > 0){
MLocation address = new MLocation (Env.getCtx(),specialRecordId,null);
for(String specialHeader:resolveSpecialColumnName(specialDetDispayType)){
String columnName = specialHeader.substring(specialHeader.indexOf(">")+1,specialHeader.length());
@ -411,8 +384,7 @@ public class GridTabCSVExporter implements IGridTabExporter
}
}
}
// if(isActiveRow)
activeRow.putAll(row);
activeRow.putAll(row);
}
if (hasDetails)
return activeRow;

View File

@ -948,9 +948,6 @@ public class GridTabCSVImporter implements IGridTabImporter
if (field.isParentValue())
continue;
// if (field.isReadOnly() && !field.isParentValue() && !field.isParentColumn())
// return new StringBuilder(Msg.getMsg(Env.getCtx(), "FieldIsReadOnly",new Object[] {header.get(i)}));
if (!(field.isDisplayed() || field.isDisplayedGrid()))
return new StringBuilder(Msg.getMsg(Env.getCtx(), "FieldNotDisplayed",new Object[] {header.get(i)}));
@ -984,7 +981,6 @@ public class GridTabCSVImporter implements IGridTabImporter
return new StringBuilder(Msg.getMsg(Env.getCtx(),id==-2?"ForeignMultipleResolved":"ForeignNotResolved",new Object[]{header.get(i),value}));
}
} else {
// no validation here
// TODO: we could validate length of string or min/max
}
}
@ -1001,9 +997,6 @@ public class GridTabCSVImporter implements IGridTabImporter
if(field == null)
return new StringBuilder(Msg.getMsg(Env.getCtx(), "NotAWindowField",new Object[] {sField}));
// if(field.isReadOnly() && !field.isParentValue())
// return new StringBuilder(Msg.getMsg(Env.getCtx(), "FieldIsReadOnly",new Object[] {field.getColumnName()}));
if(!(field.isDisplayed() || field.isDisplayedGrid()))
return new StringBuilder(Msg.getMsg(Env.getCtx(), "FieldNotDisplayed",new Object[] {field.getColumnName()}));
@ -1165,10 +1158,6 @@ public class GridTabCSVImporter implements IGridTabImporter
if(!field.isDisplayed(true))
continue;
// if(!isInsertMode() && !field.isEditable(true) && value!=null){
// logMsg = Msg.getMsg(Env.getCtx(), "FieldNotEditable", new Object[] {header.get(i)}) + "{" + value + "}";
// break;
// }
if("(null)".equals(value.toString().trim())){
logMsg = gridTab.setValue(field,null);
if(logMsg.equals(""))

View File

@ -98,7 +98,6 @@ public class GenericPO extends PO implements DocAction {
p_ctx = wrapper.source;
tableName = wrapper.tableName;
tableID = MTable.getTable_ID(tableName, this.get_TrxName());
// log.info("Table_ID: "+Table_ID);
POInfo poi = POInfo.getPOInfo(ctx, tableID, this.get_TrxName());
return poi;
}

View File

@ -51,7 +51,7 @@ public class MFreightShipmentProcessor implements IShipmentProcessor {
@Override
public boolean rateInquiry(Properties ctx, MShippingTransaction st, boolean isPriviledgedRate, String trxName) {
// st.setShippingRespMessage("In case of error set the message here");
MOrder order = new MOrder(ctx, st.getC_Order_ID(), trxName);
int freightCategoryId = order.getM_FreightCategory_ID();
Timestamp dateOrder = order.getDateOrdered();

View File

@ -271,12 +271,6 @@ extends AbstractExcelExporter
else if (MediaSizeName.NA_NUMBER_10_ENVELOPE.equals(mediaSizeName)) {
paperSize = HSSFPrintSetup.ENVELOPE_10_PAPERSIZE;
}
// else if (MediaSizeName..equals(mediaSizeName)) {
// paperSize = HSSFPrintSetup.ENVELOPE_DL_PAPERSIZE;
// }
// else if (MediaSizeName..equals(mediaSizeName)) {
// paperSize = HSSFPrintSetup.ENVELOPE_CS_PAPERSIZE;
// }
else if (MediaSizeName.MONARCH_ENVELOPE.equals(mediaSizeName)) {
paperSize = HSSFPrintSetup.ENVELOPE_MONARCH_PAPERSIZE;
}

View File

@ -71,11 +71,6 @@ public class Fill1099Extract extends SvrProcess
sql.append("amtbucket13, amtbucket14, amtbucket15, amtbucket16) ");
sql.append("SELECT ?, bp.ad_client_id, bp.ad_org_id, bp.isactive, bp.created, bp.createdby, ");
sql.append("bp.updated, bp.updatedby, bp.c_bpartner_id, bp.value, bp.name, bp.taxid, ");
/*Yvonne: should be the Invoice Address
sql.append("(SELECT MIN (c_location_id) ");
sql.append("FROM C_BPARTNER_LOCATION bpl ");
sql.append("WHERE bpl.c_bpartner_id = bp.c_bpartner_id) c_location_id, );"
*/
sql.append("bpl.c_location_id, ");
if (DB.isPostgreSQL())
sql.append("date_part('year', ?::timestamp), trunc(?::timestamp),");

View File

@ -62,62 +62,4 @@ public class OnlineShipmentProcess extends SvrProcess
return "@OK";
}
/*
private void validatePackage() throws Exception
{
if(m_package == null)
throw new Exception("No Package");
//Yvonne
if( m_package.get_Value(X_Shipping.COLUMN_IS_SHIP_ITN_REQ)!=null?((Boolean)m_package.get_Value(X_Shipping.COLUMN_IS_SHIP_ITN_REQ)).booleanValue():false && ( m_package.get_Value(X_Shipping.COLUMN_ITN) == null || ((String)m_package.get_Value(X_Shipping.COLUMN_ITN)).trim().length() == 0 ) )
{
int windowNo = X_Shipping.m_Window_No;
if (Ini.isClient())
{
try
{
Class cl = Class.forName("org.compiere.apps.ADialog");
Class paramTypes[] = {int.class, Container.class, String.class, String.class};
Object params[] = {windowNo, Env.getWindow(windowNo), "Package ITN for this shipment is blank.", "Are you sure you want to continue?"};
Method method = cl.getDeclaredMethod("ask", paramTypes);
Boolean ok = (Boolean) method.invoke(null, params);
if(!ok)
{
throw new Exception("Online shipment processing canceled by user.");
}
}
catch (Exception ex)
{
throw new AdempiereException(ex);
}
}
else
{
try
{
ClassLoader loader = Thread.currentThread().getContextClassLoader();
if (loader == null)
loader = this.getClass().getClassLoader();
Class<?> clazz = loader.loadClass("org.adempiere.webui.window.FDialog");
Class<?> clazz1 = loader.loadClass("org.zkoss.zk.ui.Component");
Method m = clazz.getMethod("ask", Integer.TYPE, clazz1, String.class, String.class);
Boolean returnCode = (Boolean)m.invoke(null, 0, null, "Packaget ITN for this shipment is blank.",
"Are you sure you want to continue?");
if(!returnCode)
{
throw new Exception("Online shipment processing canceled by user.");
}
}
catch (Exception e)
{
throw new AdempiereException(e);
}
}
}
}
*/
}

View File

@ -246,7 +246,6 @@ public class SalesOrderRateInquiryProcess extends SvrProcess
if ((ol.getM_Product_ID() > 0 && ol.getM_Product_ID() == ci.getM_ProductFreight_ID()) ||
(ol.getC_Charge_ID() > 0 && ol.getC_Charge_ID() == ci.getC_ChargeFreight_ID()))
{
// FreightAmt = FreightAmt.add(ol.getLineNetAmt());
continue;
}
else if (ol.getM_Product_ID() > 0)
@ -379,87 +378,38 @@ public class SalesOrderRateInquiryProcess extends SvrProcess
MShippingTransaction st = new MShippingTransaction(ctx, 0, trxName);
st.setAction(action);
// st.setAD_Client_ID(m_order.getAD_Client_ID());
st.setAD_Org_ID(m_order.getAD_Org_ID());
st.setAD_User_ID(m_order.getAD_User_ID());
st.setBill_Location_ID(m_order.getBill_Location_ID());
st.setBoxCount(BoxCount);
// st.setC_BP_ShippingAcct_ID(getC_BP_ShippingAcct_ID());
st.setC_BPartner_ID(m_order.getC_BPartner_ID());
st.setC_BPartner_Location_ID(m_order.getC_BPartner_Location_ID());
st.setC_Currency_ID(m_order.getC_Currency_ID());
// st.setC_Invoice_ID(0);
st.setC_Order_ID(m_order.getC_Order_ID());
st.setC_UOM_Length_ID(ci.getC_UOM_Length_ID());
st.setC_UOM_Weight_ID(ci.getC_UOM_Weight_ID());
// st.setCashOnDelivery(isCashOnDelivery());
st.setCODAmount(CODAmount);
st.setCustomsValue(CustomsValue);
// st.setDateReceived(getDateReceived());
// st.setDeliveryConfirmation(isDeliveryConfirmation());
// st.setDeliveryConfirmationType(getDeliveryConfirmationType());
// st.setDescription(getDescription());
// st.setDotHazardClassOrDivision(getDotHazardClassOrDivision());
// st.setDryIceWeight(getDryIceWeight());
st.setDutiesShipperAccount(DutiesShipperAccount);
// st.setFOB(getFOB());
st.setFreightAmt(FreightAmt);
st.setFreightCharges(MShippingTransaction.FREIGHTCHARGES_PrepaidAndBill);
// st.setHandlingCharge(getHandlingCharge());
// st.setHeight(getHeight());
// st.setHoldAddress(getHoldAddress());
// st.setHomeDeliveryPremiumDate(getHomeDeliveryPremiumDate());
// st.setHomeDeliveryPremiumPhone(getHomeDeliveryPremiumPhone());
// st.setHomeDeliveryPremiumType(getHomeDeliveryPremiumType());
// st.setInsurance(getInsurance());
// st.setInsuredAmount(getInsuredAmount());
// st.setIsAccessible(isAccessible());
st.setIsActive(m_order.isActive());
// st.setIsAddedHandling(isAddedHandling());
// st.setIsAlternateReturnAddress(isAlternateReturnAddress());
// st.setIsCargoAircraftOnly(isCargoAircraftOnly());
// st.setIsDryIce(isDryIce());
// st.setIsDutiable(isDutiable());
// st.setIsFutureDayShipment(isFutureDayShipment());
// st.setIsHazMat(isHazMat());
// st.setIsHoldAtLocation(isHoldAtLocation());
// st.setIsIgnoreZipNotFound(isIgnoreZipNotFound());
// st.setIsIgnoreZipStateNotMatch(isIgnoreZipStateNotMatch());
st.setIsPriviledgedRate(isPriviledgedRate);
st.setIsResidential(shipper.isResidential());
st.setIsSaturdayDelivery(shipper.isSaturdayDelivery());
// st.setIsSaturdayPickup(isSaturdayPickup());
// st.setIsVerbalConfirmation(isVerbalConfirmation());
// st.setLatestPickupTime(getLatestPickupTime());
// st.setLength(getLength());
// st.setM_InOut_ID(0);
// st.setM_Package_ID(getM_Package_ID());
st.setM_Shipper_ID(m_order.getM_Shipper_ID());
st.setM_ShipperLabels_ID(M_ShipperLabels_ID);
st.setM_ShipperPackaging_ID(M_ShipperPackaging_ID);
st.setM_ShipperPickupTypes_ID(M_ShipperPickupTypes_ID);
st.setM_ShippingProcessor_ID(shipper.getM_ShippingProcessor_ID());
st.setM_Warehouse_ID(m_order.getM_Warehouse_ID());
// st.setNotificationMessage(getNotificationMessage());
// st.setNotificationType(getNotificationType());
st.setPaymentRule(m_order.getPaymentRule());
st.setPOReference(m_order.getPOReference());
// st.setPrice(getPrice());
// st.setPriceActual(getPriceActual());
// st.setProcessed(isProcessed());
// st.setReceivedInfo(getReceivedInfo());
// st.setReturnBPartner_ID(getReturnBPartner_ID());
// st.setReturnLocation_ID(getReturnLocation_ID());
// st.setReturnUser_ID(getReturnUser_ID());
st.setSalesRep_ID(m_order.getSalesRep_ID());
st.setShipDate(m_order.getDatePromised());
st.setShipperAccount(ShipperAccount);
// st.setShippingRespMessage(ShippingRespMessage);
// st.setSurcharges(getSurcharges());
st.setTrackingInfo(shipper.getTrackingURL());
// st.setTrackingNo(getTrackingNo());
st.setWeight(TotalWeight);
// st.setWidth(getWidth());
st.saveEx();
for (int i = 0; i < packages.size(); i++)
@ -467,7 +417,6 @@ public class SalesOrderRateInquiryProcess extends SvrProcess
ShippingPackage shippingPackage = packages.get(i);
MShippingTransactionLine stl = new MShippingTransactionLine(st.getCtx(), 0, st.get_TrxName());
// stl.setAD_Client_ID(m_order.getAD_Client_ID());
stl.setAD_Org_ID(m_order.getAD_Org_ID());
stl.setC_UOM_Length_ID(ci.getC_UOM_Length_ID());
stl.setC_UOM_Weight_ID(ci.getC_UOM_Weight_ID());
@ -475,13 +424,8 @@ public class SalesOrderRateInquiryProcess extends SvrProcess
stl.setHeight(shippingPackage.getHeight());
stl.setIsActive(m_order.isActive());
stl.setLength(shippingPackage.getLength());
// stl.setM_PackageMPS_ID(0);
stl.setM_ShippingTransaction_ID(st.getM_ShippingTransaction_ID());
// stl.setMasterTrackingNo(getMasterTrackingNo());
// stl.setPrice(getPrice());
// stl.setProcessed(isProcessed());
stl.setSeqNo((i+1) * 10);
// stl.setTrackingNo(getTrackingNo());
stl.setWeight(shippingPackage.getWeight());
stl.setWidth(shippingPackage.getWidth());
stl.saveEx();

View File

@ -143,19 +143,6 @@ public class UUIDGenerator extends SvrProcess {
}
}
}
/*
// RELEASE WORK CODE
// following code could be used potentially to fill empty values on UU columns if they are already created
int cnt = DB.getSQLValue(null, "SELECT COUNT(1) FROM " + cTableName + " WHERE " + columnName + " IS NULL");
if (cnt > 0) {
addLog (0, null, null, cTableName);
//update db
updateAllUUID(MColumn.get(getCtx(), AD_Column_ID));
}
// END RELEASE WORK CODE
*/
}
} finally {
DB.close(rs,stmt);
@ -351,67 +338,4 @@ public class UUIDGenerator extends SvrProcess {
}
}
/*
// RELEASE WORK CODE
public static void updateAllUUID(MColumn column) {
MTable table = (MTable) column.getAD_Table();
int AD_Column_ID = DB.getSQLValue(null, "SELECT AD_Column_ID FROM AD_Column WHERE AD_Table_ID=? AND ColumnName=?", table.getAD_Table_ID(), table.getTableName()+"_ID");
StringBuilder sql = new StringBuilder("SELECT ");
String keyColumn = null;
// second script - just generate for tables with _ID primary key
//if (AD_Column_ID > 0)
// return;
if (AD_Column_ID > 0) {
keyColumn = table.getTableName()+"_ID";
} else if (DB.isOracle()) {
keyColumn = "rowid";
} else if (DB.isPostgreSQL()) {
keyColumn = "ctid";
}
// keyColumn = "*";
sql.append(keyColumn).append(",").append(table.getTableName()).append(".* FROM ").append(table.getTableName());
sql.append(" WHERE ").append(column.getColumnName()).append(" IS NULL ");
String updateSQL = null;
PreparedStatement stmt = null;
ResultSet rs = null;
Trx trx = null;
try {
trx = Trx.get(Trx.createTrxName("UUIDGen"), true);
trx.start();
stmt = DB.prepareStatement(sql.toString(), trx.getTrxName());
stmt.setFetchSize(100);
rs = stmt.executeQuery();
while (rs.next()) {
if (AD_Column_ID > 0) {
int recordId = rs.getInt(1);
UUID uuid = UUID.randomUUID();
updateSQL = "UPDATE "+table.getTableName()+" SET "+column.getColumnName()+"='" + uuid.toString() + "' WHERE "+keyColumn+"="+recordId;
DB.executeUpdateEx(updateSQL,null);
} else {
UUID uuid = UUID.randomUUID();
// String rowId = rs.getString(1);
// DB.executeUpdateEx(updateSQL+"'"+rowId+"'",new Object[]{uuid.toString()},null);
PO po = table.getPO(rs, null);
if (po.get_KeyColumns().length > 0) {
po.set_ValueOfColumn(column.getColumnName(), uuid.toString());
po.saveEx();
}
}
}
trx.commit();
} catch (SQLException e) {
if (trx != null)
trx.rollback();
throw new DBException(e);
} finally {
DB.close(rs, stmt);
if (trx != null)
trx.close();
}
}
// END RELEASE WORK CODE
*/
}

View File

@ -113,7 +113,7 @@ public class GenerateModel
String tableLike = null;
tableLike = "'%'"; // All tablesype
// tableLike = "'AD_OrgInfo', 'AD_Role', 'C_CashLine', 'C_Currency', 'C_Invoice', 'C_Order', 'C_Payment', 'M_InventoryLine', 'M_PriceList', 'M_Product', 'U_POSTerminal'"; // Only specific tables
if (args.length > 3)
tableLike = args[3];
if (log.isLoggable(Level.INFO)) log.info("Table Like: " + tableLike);

View File

@ -162,12 +162,6 @@ public class GenerateModelJPA
+ "/** if (").append(keyColumn).append(" == 0)"
+ "{").append(mandatory).append("} */\n"
+ "}" // Constructor End
// Short Constructor
// + "/** Short Constructor */\n"
// + "public ").append(className).append(" (Properties ctx, int ").append(keyColumn).append(")"
// + "{"
// + "this (ctx, ").append(keyColumn).append(", null);"
// + "}" // Constructor End
// Load Constructor
+ "/** Load Constructor \n@param ctx context\n@param rs result set \n@param trxName transaction\n*/\n"
@ -732,7 +726,6 @@ public class GenerateModelJPA
{
org.compiere.Adempiere.startupEnvironment(true);
CLogMgt.setLevel(Level.FINE);
// CLogMgt.setLevel(Level.ALL);
log.info("Generate Model $Revision: 1.5 $");
log.info("----------------------------------");
// first parameter

View File

@ -184,7 +184,6 @@ public class ModelClassGenerator
.append("\tprivate static final long serialVersionUID = ")
.append(String.format("%1$tY%1$tm%1$td", new Timestamp(System.currentTimeMillis())))
.append("L;").append(NL)
//.append("\tprivate static final long serialVersionUID = 1L;").append(NL)
// Standard Constructor
.append(NL)
@ -194,7 +193,7 @@ public class ModelClassGenerator
.append(" super (ctx, ").append(keyColumn).append(", trxName);").append(NL)
.append(" /** if (").append(keyColumn).append(" == 0)").append(NL)
.append(" {").append(NL)
.append(mandatory) //.append(NL)
.append(mandatory)
.append(" } */").append(NL)
.append(" }").append(NL)
// Constructor End
@ -208,23 +207,7 @@ public class ModelClassGenerator
.append(" }").append(NL)
// Load Constructor End
// TableName
// .append(NL)
// .append(" /** TableName=").append(tableName).append(" */").append(NL)
// .append(" public static final String Table_Name = \"").append(tableName).append("\";").append(NL)
// AD_Table_ID
// .append(NL)
// .append(" /** AD_Table_ID=").append(AD_Table_ID).append(" */").append(NL)
// .append(" public static final int Table_ID = MTable.getTable_ID(Table_Name);").append(NL)
// KeyNamePair
// .append(NL)
// .append(" protected static KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);").append(NL)
// accessLevel
// .append(NL)
// .append(" protected BigDecimal accessLevel = BigDecimal.valueOf(").append(accessLevel).append(");").append(NL)
.append(NL)
.append(" /** AccessLevel").append(NL)
.append(" * @return ").append(accessLevelInfo).append(NL)
@ -711,9 +694,6 @@ public class ModelClassGenerator
.append("throw new IllegalArgumentException (\"").append(columnName)
.append(" Invalid value - \" + ").append(columnName)
.append(" + \" - ").append(values).append("\");");
// [1762461] - Remove hardcoded list items checking in generated models
// if (found && !columnName.equals("EntityType"))
// sb.append (statement);
sb.append("\n");
return retValue.toString();
} // addListValidation
@ -762,18 +742,11 @@ public class ModelClassGenerator
if (c == ';' || c == '}')
{
fw.write (c);
if (sb.substring(i+1).startsWith("//")) {
//fw.write('\t');
} else {
//fw.write(NL);
}
}
// before & after
else if (c == '{')
{
//fw.write(NL);
fw.write (c);
//fw.write(NL);
}
else
fw.write (c);

View File

@ -214,17 +214,13 @@ public class ModelInterfaceGenerator
else
start.append(" public static final int Table_ID = MTable.getTable_ID(Table_Name);\n");
//.append(" protected KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);\n")
start.append(" KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);\n") // INFO - Should this be here???
.append(" /** AccessLevel = ").append(accessLevelInfo).append("\n")
.append(" */\n")
//.append(" protected BigDecimal AccessLevel = new BigDecimal(").append(accessLevel).append(");\n")
.append(" BigDecimal accessLevel = BigDecimal.valueOf(").append(accessLevel).append(");\n") // INFO - Should this be here???
.append(" /** Load Meta Data */\n")
//.append(" protected POInfo initPO (Properties ctx);")
//.append(" POInfo initPO (Properties ctx);") // INFO - Should this be here???
;
String end = "}";
@ -252,11 +248,6 @@ public class ModelInterfaceGenerator
+ "FROM AD_Column c "
+ "WHERE c.AD_Table_ID=?"
// + " AND c.ColumnName <> 'AD_Client_ID'"
// + " AND c.ColumnName <> 'AD_Org_ID'"
// + " AND c.ColumnName <> 'IsActive'"
// + " AND c.ColumnName NOT LIKE 'Created%'"
// + " AND c.ColumnName NOT LIKE 'Updated%' "
+ " AND c.IsActive='Y'"
+ (!Util.isEmpty(entityTypeFilter) ? " AND c." + entityTypeFilter : "")
+ " ORDER BY c.ColumnName";
@ -273,7 +264,6 @@ public class ModelInterfaceGenerator
int displayType = rs.getInt(4);
int AD_Reference_Value_ID = rs.getInt(5);
String defaultValue = rs.getString(6);
//int seqNo = rs.getInt(7);
int fieldLength = rs.getInt(8);
String ValueMin = rs.getString(9);
String ValueMax = rs.getString(10);
@ -575,8 +565,6 @@ public class ModelInterfaceGenerator
{
return
!"AD_Client_ID".equals(columnName)
//&& !"AD_Org_ID".equals(columnName)
//&& !"IsActive".equals(columnName)
&& !"Created".equals(columnName)
&& !"CreatedBy".equals(columnName)
&& !"Updated".equals(columnName)
@ -747,7 +735,6 @@ public class ModelInterfaceGenerator
else
{
// TODO - Handle other types
//sb.append("\tpublic I_"+columnName+" getI_").append(columnName).append("(){return null; };");
}
//
return referenceClassName;

View File

@ -37,7 +37,6 @@ public class ShippingUtil
+ " WHERE C_BPartner_ID = ? "
+ " AND AD_Org_ID = " + ad_org_id
+ " AND M_ShippingProcessor_ID IN (SELECT DISTINCT M_ShippingProcessor_ID FROM M_Shipper WHERE M_Shipper_ID = " + shipper_id + ")"
// + " AND M_Shipper_ID = " + shipper_id
+ " AND C_BPartner_Location_ID Is Not Null", c_bpartner_id);
if (accountLocationId <= 0)
{
@ -47,7 +46,6 @@ public class ShippingUtil
+ " FROM C_BP_ShippingAcct bps, C_BPartner_Location bpl, C_Location l "
+ " WHERE bps.C_BPartner_ID = ? "
+ " AND bps.M_ShippingProcessor_ID IN (SELECT DISTINCT M_ShippingProcessor_ID FROM M_Shipper WHERE M_Shipper_ID = " + shipper_id + ")"
// + " AND bps.M_Shipper_ID = " + shipper_id
+ " AND bps.C_BPartner_Location_ID = bpl.C_BPartner_Location_ID "
+ " AND bpl.C_Location_ID = l.C_Location_ID "
+ " AND l.Postal IS NOT NULL ", c_bpartner_id);

View File

@ -524,10 +524,6 @@ public final class Adempiere
log = CLogger.getCLogger(Adempiere.class);
// Greeting
if (log.isLoggable(Level.INFO)) log.info(getSummaryAscii());
// log.info(getAdempiereHome() + " - " + getJavaInfo() + " - " + getOSInfo());
// Load System environment
// EnvLoader.load(Ini.ENV_PREFIX);
// System properties
Ini.loadProperties (false);

View File

@ -43,7 +43,6 @@ class Base
System.out.println("** Before Init **"); //$NON-NLS-1$
getMemoryUsed();
Properties ctx = Login.initTest(false);
// Log.printProperties(System.getProperties(), "System", false);
//
System.gc(); // cleanup Init
//
@ -59,12 +58,7 @@ class Base
GridWindow w = new GridWindow(vo);
long endDef = System.currentTimeMillis();
System.out.println("Load Definition Time in ms = " + String.valueOf(endDef-startTime));
/*if (1==2) // optional step
{
w.loadCompete();
long endDefComplete = System.currentTimeMillis();
System.out.println("Load Definition Complete Time in ms = " + String.valueOf(endDefComplete-startTime));
}*/
w.query();
long endData = System.currentTimeMillis();
System.out.println("Load Data Time in ms = " + String.valueOf(endData-startTime));
@ -126,7 +120,6 @@ class Base
private static void listThreads()
{
Thread[] list = new Thread[Thread.activeCount()];
// int no = Thread.currentThread().enumerate(list);
for (int i = 0; i < list.length; i++)
{
if (list[i] != null)