More fixing on this type of error

strings using "=="
This commit is contained in:
Carlos Ruiz 2008-08-26 18:59:25 +00:00
parent 130a04d1e8
commit 2655b35b6a
15 changed files with 35 additions and 35 deletions

View File

@ -111,7 +111,7 @@ public class AssetDisposed extends SvrProcess
try { try {
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while (rs.next()){ while (rs.next()){
if (v_PostingType != rs.getString("PostingType") & v_PostingType != null) if (v_PostingType != null && (!v_PostingType.equals(rs.getString("PostingType"))))
{ {
sql = "UPDATE A_DEPRECIATION_WORKFILE " sql = "UPDATE A_DEPRECIATION_WORKFILE "
+ "SET A_ACCUMULATED_DEPR = " + v_Balance + "SET A_ACCUMULATED_DEPR = " + v_Balance

View File

@ -127,24 +127,24 @@ public class AssetRevalEntry extends SvrProcess
X_A_Asset_Reval_Index ARevalIndex = new X_A_Asset_Reval_Index (getCtx(), DB.getSQLValue(null ,sql), null); X_A_Asset_Reval_Index ARevalIndex = new X_A_Asset_Reval_Index (getCtx(), DB.getSQLValue(null ,sql), null);
MAsset Asset = new MAsset (getCtx(), rs.getInt("A_Asset_ID"), null); MAsset Asset = new MAsset (getCtx(), rs.getInt("A_Asset_ID"), null);
if (AssetReval.getA_Reval_Multiplier() == "IND") if (AssetReval.getA_Reval_Multiplier().equals(X_A_Asset_Reval_Entry.A_REVAL_MULTIPLIER_Index))
{ {
if (AssetReval.getA_Reval_Effective_Date() == "DA"){ if (AssetReval.getA_Reval_Effective_Date().equals(X_A_Asset_Reval_Entry.A_REVAL_EFFECTIVE_DATE_DateAquired)){
sql2 = "Select A_REVAL_MULTIPLIER from A_ASSET_REVAL_INDEX where A_REVAL_CODE = " + AssetReval.getA_Rev_Code() sql2 = "Select A_REVAL_MULTIPLIER from A_ASSET_REVAL_INDEX where A_REVAL_CODE = " + AssetReval.getA_Rev_Code()
+ " and A_EFFECTIVE_DATE = (select MAX(A_EFFECTIVE_DATE) from A_ASSET_REVAL_INDEX where A_EFFECTIVE_DATE < " + " and A_EFFECTIVE_DATE = (select MAX(A_EFFECTIVE_DATE) from A_ASSET_REVAL_INDEX where A_EFFECTIVE_DATE < "
+ Asset.getA_Asset_CreateDate() + Asset.getA_Asset_CreateDate()
+ ")"; + ")";
} }
else if (AssetReval.getA_Reval_Effective_Date() == "RD"){ else if (AssetReval.getA_Reval_Effective_Date().equals(X_A_Asset_Reval_Entry.A_REVAL_EFFECTIVE_DATE_RevaluationDate)){
sql2 = "Select A_REVAL_MULTIPLIER from A_ASSET_REVAL_INDEX where A_REVAL_CODE = " + AssetReval.getA_Rev_Code() sql2 = "Select A_REVAL_MULTIPLIER from A_ASSET_REVAL_INDEX where A_REVAL_CODE = " + AssetReval.getA_Rev_Code()
+ " and A_EFFECTIVE_DATE = (select MAX(A_EFFECTIVE_DATE) from A_ASSET_REVAL_INDEX where A_EFFECTIVE_DATE < " + " and A_EFFECTIVE_DATE = (select MAX(A_EFFECTIVE_DATE) from A_ASSET_REVAL_INDEX where A_EFFECTIVE_DATE < "
+ Asset.getA_Asset_RevalDate() + Asset.getA_Asset_RevalDate()
+ ")"; + ")";
} }
else if (AssetReval.getA_Reval_Effective_Date() == "SD"){ else if (AssetReval.getA_Reval_Effective_Date().equals(X_A_Asset_Reval_Entry.A_REVAL_EFFECTIVE_DATE_DateDepreciationStarted)){
sql2 = "Select A_REVAL_MULTIPLIER from A_ASSET_REVAL_INDEX where A_REVAL_CODE = " + AssetReval.getA_Rev_Code() sql2 = "Select A_REVAL_MULTIPLIER from A_ASSET_REVAL_INDEX where A_REVAL_CODE = " + AssetReval.getA_Rev_Code()
+ " and A_EFFECTIVE_DATE = (select MAX(A_EFFECTIVE_DATE) from A_ASSET_REVAL_INDEX where A_EFFECTIVE_DATE < " + " and A_EFFECTIVE_DATE = (select MAX(A_EFFECTIVE_DATE) from A_ASSET_REVAL_INDEX where A_EFFECTIVE_DATE < "
+ Asset.getAssetServiceDate() + Asset.getAssetServiceDate()
@ -269,25 +269,25 @@ public class AssetRevalEntry extends SvrProcess
DB.close(rs, pstmt); DB.close(rs, pstmt);
rs = null; pstmt = null; rs = null; pstmt = null;
} } } }
else if (AssetReval.getA_Reval_Multiplier() == "FAC") else if (AssetReval.getA_Reval_Multiplier().equals(X_A_Asset_Reval_Entry.A_REVAL_MULTIPLIER_Factor))
{ {
if (AssetReval.getA_Reval_Effective_Date() == "DA"){ if (AssetReval.getA_Reval_Effective_Date().equals(X_A_Asset_Reval_Entry.A_REVAL_EFFECTIVE_DATE_DateAquired)){
sql2 = "Select A_REVAL_MULTIPLIER from A_ASSET_REVAL_INDEX where A_REVAL_CODE = " + AssetReval.getA_Rev_Code() sql2 = "Select A_REVAL_MULTIPLIER from A_ASSET_REVAL_INDEX where A_REVAL_CODE = " + AssetReval.getA_Rev_Code()
+ " and A_EFFECTIVE_DATE = (select MAX(A_EFFECTIVE_DATE) from A_ASSET_REVAL_INDEX where A_EFFECTIVE_DATE < " + " and A_EFFECTIVE_DATE = (select MAX(A_EFFECTIVE_DATE) from A_ASSET_REVAL_INDEX where A_EFFECTIVE_DATE < "
+ Asset.getA_Asset_CreateDate() + Asset.getA_Asset_CreateDate()
+ ")"; + ")";
} }
else if (AssetReval.getA_Reval_Effective_Date() == "RD"){ else if (AssetReval.getA_Reval_Effective_Date().equals(X_A_Asset_Reval_Entry.A_REVAL_EFFECTIVE_DATE_RevaluationDate)){
sql2 = "Select A_REVAL_MULTIPLIER from A_ASSET_REVAL_INDEX where A_REVAL_CODE = " + AssetReval.getA_Rev_Code() sql2 = "Select A_REVAL_MULTIPLIER from A_ASSET_REVAL_INDEX where A_REVAL_CODE = " + AssetReval.getA_Rev_Code()
+ " and A_EFFECTIVE_DATE = (select MAX(A_EFFECTIVE_DATE) from A_ASSET_REVAL_INDEX where A_EFFECTIVE_DATE < " + " and A_EFFECTIVE_DATE = (select MAX(A_EFFECTIVE_DATE) from A_ASSET_REVAL_INDEX where A_EFFECTIVE_DATE < "
+ Asset.getA_Asset_RevalDate() + Asset.getA_Asset_RevalDate()
+ ")"; + ")";
} }
else if (AssetReval.getA_Reval_Effective_Date() == "SD"){ else if (AssetReval.getA_Reval_Effective_Date().equals(X_A_Asset_Reval_Entry.A_REVAL_EFFECTIVE_DATE_DateDepreciationStarted)){
sql2 = "Select A_REVAL_MULTIPLIER from A_ASSET_REVAL_INDEX where A_REVAL_CODE = " + AssetReval.getA_Rev_Code() sql2 = "Select A_REVAL_MULTIPLIER from A_ASSET_REVAL_INDEX where A_REVAL_CODE = " + AssetReval.getA_Rev_Code()
+ " and A_EFFECTIVE_DATE = (select MAX(A_EFFECTIVE_DATE) from A_ASSET_REVAL_INDEX where A_EFFECTIVE_DATE < " + " and A_EFFECTIVE_DATE = (select MAX(A_EFFECTIVE_DATE) from A_ASSET_REVAL_INDEX where A_EFFECTIVE_DATE < "
+ Asset.getAssetServiceDate() + Asset.getAssetServiceDate()

View File

@ -112,18 +112,18 @@ public class CalloutFA extends CalloutEngine
if (rs.next()) if (rs.next())
{ {
// Charges - Set Context // Charges - Set Context
if (rs.getString("DepreciationType")!= "TAB" | rs.getString("DepreciationType")!= "MAN") if ( (!rs.getString("DepreciationType").equals("TAB")) || (!rs.getString("DepreciationType").equals("MAN")) )
{ {
Env.setContext(ctx, WindowNo, "A_DEPRECIATION_MANUAL_PERIOD", ""); Env.setContext(ctx, WindowNo, "A_DEPRECIATION_MANUAL_PERIOD", "");
//mTab.setValue ("A_Depreciation_Manual_Period", null); //mTab.setValue ("A_Depreciation_Manual_Period", null);
mTab.setValue ("A_Depreciation_Manual_Amount", null); mTab.setValue ("A_Depreciation_Manual_Amount", null);
mTab.setValue ("A_Depreciation_Table_Header_ID", null); mTab.setValue ("A_Depreciation_Table_Header_ID", null);
} }
if (rs.getString("DepreciationType")== "TAB") if (rs.getString("DepreciationType").equals("TAB"))
{ {
mTab.setValue ("A_Depreciation_Manual_Amount", null); mTab.setValue ("A_Depreciation_Manual_Amount", null);
} }
if (rs.getString("DepreciationType")== "MAN") if (rs.getString("DepreciationType").equals("MAN"))
{ {
mTab.setValue ("A_Depreciation_Table_Header_ID", null); mTab.setValue ("A_Depreciation_Table_Header_ID", null);
} }

View File

@ -173,7 +173,7 @@ public class WebDoc
m_topRight.addElement(new img("http://www.adempiere.com/images/adempiere64x32.png") m_topRight.addElement(new img("http://www.adempiere.com/images/adempiere64x32.png")
.setAlign(AlignType.RIGHT).setAlt("Adempiere Inc.")); .setAlign(AlignType.RIGHT).setAlt("Adempiere Inc."));
else else
if(title == "") if(title.equals(""))
m_topRight.addElement(WebEnv.getLogo()); m_topRight.addElement(WebEnv.getLogo());
else else
m_topRight.addElement(new h1(title)); m_topRight.addElement(new h1(title));

View File

@ -424,7 +424,7 @@ public class LoginManager
// load Orgs // load Orgs
while (rs.next()) while (rs.next())
{ {
if(orgIds=="") if(orgIds.equals(""))
orgIds = orgIds+rs.getInt(1)+""; orgIds = orgIds+rs.getInt(1)+"";
else else
orgIds = orgIds+","+rs.getInt(1)+""; orgIds = orgIds+","+rs.getInt(1)+"";

View File

@ -161,7 +161,7 @@ public class POSManager
for(String discount : discounts) for(String discount : discounts)
{ {
if( discount == null || discount == "" ) if( discount == null || discount.equals("") )
{ {
discount = "0.0"; discount = "0.0";
} }

View File

@ -191,12 +191,12 @@ public class ElementManager
String msg = Msg.getElement(language, text, true); String msg = Msg.getElement(language, text, true);
if (msg == null || msg == "") if (msg == null || msg.equals(""))
{ {
msg = Msg.translate(language, text); msg = Msg.translate(language, text);
} }
if (msg == null || msg == "") if (msg == null || msg.equals(""))
{ {
msg = text; msg = text;
} }

View File

@ -329,14 +329,14 @@ public class CustomPOSReportAction extends POSDispatchAction
else if(dateRange.endsWith(Constants.CUSTOM_DATE_RANGE)) else if(dateRange.endsWith(Constants.CUSTOM_DATE_RANGE))
{ {
if((fromDate == null)||(fromDate == "")) if((fromDate == null)||(fromDate.equals("")))
{ {
message = new ActionMessage("error.required.fromDate"); message = new ActionMessage("error.required.fromDate");
messages.add(ActionMessages.GLOBAL_MESSAGE, message); messages.add(ActionMessages.GLOBAL_MESSAGE, message);
error = true; error = true;
} }
if((toDate == null)||(toDate == "")) if((toDate == null)||(toDate.equals("")))
{ {
message = new ActionMessage("error.required.toDate"); message = new ActionMessage("error.required.toDate");
messages.add(ActionMessages.GLOBAL_MESSAGE, message); messages.add(ActionMessages.GLOBAL_MESSAGE, message);

View File

@ -157,14 +157,14 @@ public class POSInfoAction extends POSDispatchAction
ActionMessage message = null; ActionMessage message = null;
if((bean.getFromDate()==null)||(bean.getFromDate()=="")) if((bean.getFromDate()==null)||(bean.getFromDate().equals("")))
{ {
message = new ActionMessage("error.required.fromDate"); message = new ActionMessage("error.required.fromDate");
messages.add(ActionMessages.GLOBAL_MESSAGE, message); messages.add(ActionMessages.GLOBAL_MESSAGE, message);
error = true; error = true;
} }
if((bean.getToDate()==null)||(bean.getToDate()=="")) if((bean.getToDate()==null)||(bean.getToDate().equals("")))
{ {
message = new ActionMessage("error.required.toDate"); message = new ActionMessage("error.required.toDate");
messages.add(ActionMessages.GLOBAL_MESSAGE, message); messages.add(ActionMessages.GLOBAL_MESSAGE, message);

View File

@ -129,7 +129,7 @@ public class POSOrderAction extends POSDispatchAction
{ {
for(String s : discountPercentage) for(String s : discountPercentage)
{ {
if(s == null || s == "") if(s == null || s.equals(""))
{ {
continue; continue;
} }
@ -153,7 +153,7 @@ public class POSOrderAction extends POSDispatchAction
for(String s : actualPrice) for(String s : actualPrice)
{ {
if(s == null || s == "") if(s == null || s.equals(""))
{ {
continue; continue;
} }

View File

@ -245,14 +245,14 @@ public class POSReportAction extends BaseDispatchAction
ActionMessage message = null; ActionMessage message = null;
if((bean.getFromDate()==null)||(bean.getFromDate()=="")) if((bean.getFromDate()==null)||(bean.getFromDate().equals("")))
{ {
message = new ActionMessage("error.required.fromDate"); message = new ActionMessage("error.required.fromDate");
messages.add(ActionMessages.GLOBAL_MESSAGE, message); messages.add(ActionMessages.GLOBAL_MESSAGE, message);
error = true; error = true;
} }
if((bean.getToDate()==null)||(bean.getToDate()=="")) if((bean.getToDate()==null)||(bean.getToDate().equals("")))
{ {
message = new ActionMessage("error.required.toDate"); message = new ActionMessage("error.required.toDate");
messages.add(ActionMessages.GLOBAL_MESSAGE, message); messages.add(ActionMessages.GLOBAL_MESSAGE, message);

View File

@ -197,13 +197,13 @@ public class POSSalesReportAction extends POSDispatchAction
boolean error = false; boolean error = false;
if((salesReportForm.getFromDate()==null)||(salesReportForm.getFromDate()=="")) if((salesReportForm.getFromDate()==null)||(salesReportForm.getFromDate().equals("")))
{ {
postGlobalError("error.required.startDate",request); postGlobalError("error.required.startDate",request);
error = true; error = true;
} }
if((salesReportForm.getToDate()==null)||(salesReportForm.getToDate()=="")) if((salesReportForm.getToDate()==null)||(salesReportForm.getToDate().equals("")))
{ {
postGlobalError("error.required.endDate",request); postGlobalError("error.required.endDate",request);
error = true; error = true;

View File

@ -553,7 +553,7 @@ public class PartialPOSOrderAction extends POSDispatchAction
for(String s : discountPercentage) for(String s : discountPercentage)
{ {
if(s == null || s == "") if(s == null || s.equals(""))
{ {
continue; continue;
} }
@ -571,7 +571,7 @@ public class PartialPOSOrderAction extends POSDispatchAction
for(String s : actualPrice) for(String s : actualPrice)
{ {
if(s == null || s == "") if(s == null || s.equals(""))
{ {
continue; continue;
} }

View File

@ -156,14 +156,14 @@ public class StockMovementReportAction extends POSDispatchAction
ActionMessages messages = new ActionMessages(); ActionMessages messages = new ActionMessages();
ActionMessage message = null; ActionMessage message = null;
if((bean.getFromDate()==null)||(bean.getFromDate()=="")) if((bean.getFromDate()==null)||(bean.getFromDate().equals("")))
{ {
message = new ActionMessage("error.required.fromDate"); message = new ActionMessage("error.required.fromDate");
messages.add(ActionMessages.GLOBAL_MESSAGE, message); messages.add(ActionMessages.GLOBAL_MESSAGE, message);
error = true; error = true;
} }
if((bean.getToDate()==null)||(bean.getToDate()=="")) if((bean.getToDate()==null)||(bean.getToDate().equals("")))
{ {
message = new ActionMessage("error.required.toDate"); message = new ActionMessage("error.required.toDate");
messages.add(ActionMessages.GLOBAL_MESSAGE, message); messages.add(ActionMessages.GLOBAL_MESSAGE, message);

View File

@ -217,7 +217,7 @@ public class WMerge extends ADForm implements EventListener, ValueChangeListener
if (name.equals("AD_Org_ID")) if (name.equals("AD_Org_ID"))
{ {
if (des == "from") if (des.equals("from"))
{ {
from[0].setValue(value); from[0].setValue(value);
fromIDs[0] = ((Integer)value).intValue(); fromIDs[0] = ((Integer)value).intValue();
@ -230,7 +230,7 @@ public class WMerge extends ADForm implements EventListener, ValueChangeListener
} }
else if (name.equals("C_BPartner_ID")) else if (name.equals("C_BPartner_ID"))
{ {
if (des == "from") if (des.equals("from"))
{ {
from[1].setValue(value); from[1].setValue(value);
fromIDs[1] = ((Integer)value).intValue(); fromIDs[1] = ((Integer)value).intValue();
@ -243,7 +243,7 @@ public class WMerge extends ADForm implements EventListener, ValueChangeListener
} }
else if (name.equals("M_Product_ID")) else if (name.equals("M_Product_ID"))
{ {
if (des == "from") if (des.equals("from"))
{ {
from[3].setValue(value); from[3].setValue(value);
fromIDs[3] = ((Integer)value).intValue(); fromIDs[3] = ((Integer)value).intValue();
@ -256,7 +256,7 @@ public class WMerge extends ADForm implements EventListener, ValueChangeListener
} }
else if (name.equals("AD_User_ID")) else if (name.equals("AD_User_ID"))
{ {
if (des == "from") if (des.equals("from"))
{ {
from[2].setValue(value); from[2].setValue(value);
fromIDs[2] = ((Integer)value).intValue(); fromIDs[2] = ((Integer)value).intValue();