diff --git a/org.adempiere.base.process/src/org/adempiere/process/ImmediateBankTransfer.java b/org.adempiere.base.process/src/org/adempiere/process/ImmediateBankTransfer.java index 6000dc6a42..24041ec454 100644 --- a/org.adempiere.base.process/src/org/adempiere/process/ImmediateBankTransfer.java +++ b/org.adempiere.base.process/src/org/adempiere/process/ImmediateBankTransfer.java @@ -249,7 +249,7 @@ public class ImmediateBankTransfer extends SvrProcess MCash cash = createCash(); MCashLine cashLines[]= createCashLines(cash); - StringBuilder processMsg = new StringBuilder(cash.getDocumentNo()); + StringBuilder processMsg = new StringBuilder().append(cash.getDocumentNo()); cash.setDocAction(p_docAction); if (!cash.processIt(p_docAction)) diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportInventory.java b/org.adempiere.base.process/src/org/compiere/process/ImportInventory.java index d1b86a13ad..a167e88939 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportInventory.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportInventory.java @@ -22,6 +22,7 @@ import java.sql.ResultSet; import java.sql.Timestamp; import java.util.logging.Level; +import org.adempiere.exceptions.AdempiereException; import org.compiere.model.MAcctSchema; import org.compiere.model.MAttributeSet; import org.compiere.model.MAttributeSetInstance; @@ -29,6 +30,7 @@ import org.compiere.model.MCost; import org.compiere.model.MInventory; import org.compiere.model.MInventoryLine; import org.compiere.model.MProduct; +import org.compiere.model.MProductCategoryAcct; import org.compiere.model.X_I_Inventory; import org.compiere.util.DB; import org.compiere.util.TimeUtil; @@ -356,12 +358,12 @@ public class ImportInventory extends SvrProcess x_isInternalUse = isInternalUse; noInsert++; } - + MProduct product = MProduct.get(getCtx(), imp.getM_Product_ID()); // Line int M_AttributeSetInstance_ID = 0; if ((imp.getLot() != null && imp.getLot().length() > 0) || (imp.getSerNo() != null && imp.getSerNo().length() > 0)) { - MProduct product = MProduct.get(getCtx(), imp.getM_Product_ID()); + if (product.isInstanceAttribute()) { MAttributeSet mas = product.getAttributeSet(); @@ -394,15 +396,28 @@ public class ImportInventory extends SvrProcess noInsertLine++; //@Trifon update Product cost record if Update costing is enabled if (p_UpdateCosting) { - MCost cost = MCost.get (MProduct.get(getCtx(), imp.getM_Product_ID()), /*M_AttributeSetInstance_ID*/ 0 - , acctSchema, p_AD_OrgTrx_ID, p_M_CostElement_ID, get_TrxName()); - cost.setCurrentCostPrice( imp.getCurrentCostPrice() ); - if (cost.save()) { - // nothing here. - } else { - log.log(Level.SEVERE, "Cost not saved!"); - break; + String costingLevel = null; + if(product.getM_Product_Category_ID() > 0){ + MProductCategoryAcct pca = MProductCategoryAcct.get(getCtx(), product.getM_Product_Category_ID(), p_C_AcctSchema_ID, get_TrxName()); + costingLevel = pca.getCostingLevel(); + if (costingLevel == null) { + costingLevel = acctSchema.getCostingLevel(); + } + } + + int costOrgID = p_AD_OrgTrx_ID; + int costASI = line.getM_AttributeSetInstance_ID(); + if (MAcctSchema.COSTINGLEVEL_Client.equals(costingLevel)){ + costOrgID = 0; + costASI = 0; + } else if (MAcctSchema.COSTINGLEVEL_Organization.equals(costingLevel)) { + costASI = 0; + } + MCost cost = MCost.get (MProduct.get(getCtx(), imp.getM_Product_ID()), costASI + , acctSchema, costOrgID, p_M_CostElement_ID, get_TrxName()); + cost.setCurrentCostPrice( imp.getCurrentCostPrice() ); + cost.saveEx(); } } } @@ -412,7 +427,7 @@ public class ImportInventory extends SvrProcess } catch (Exception e) { - log.log(Level.SEVERE, sql.toString(), e); + throw new AdempiereException(e); } // Set Error to indicator to not imported diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportOrder.java b/org.adempiere.base.process/src/org/compiere/process/ImportOrder.java index 06d12d54f5..08ecf97f96 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportOrder.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportOrder.java @@ -90,7 +90,7 @@ public class ImportOrder extends SvrProcess { StringBuilder sql = null; int no = 0; - String clientCheck = " AND AD_Client_ID=" + m_AD_Client_ID; + StringBuilder clientCheck = new StringBuilder(" AND AD_Client_ID=").append(m_AD_Client_ID); // **** Prepare **** diff --git a/org.adempiere.base.process/src/org/compiere/process/ProjectPhaseGenOrder.java b/org.adempiere.base.process/src/org/compiere/process/ProjectPhaseGenOrder.java index 5c6cd21aa3..393641b9a8 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ProjectPhaseGenOrder.java +++ b/org.adempiere.base.process/src/org/compiere/process/ProjectPhaseGenOrder.java @@ -77,7 +77,7 @@ public class ProjectPhaseGenOrder extends SvrProcess { MOrderLine ol = new MOrderLine(order); ol.setLine(fromPhase.getSeqNo()); - StringBuilder sb = new StringBuilder (fromPhase.getName()); + StringBuilder sb = new StringBuilder ().append(fromPhase.getName()); if (fromPhase.getDescription() != null && fromPhase.getDescription().length() > 0) sb.append(" - ").append(fromPhase.getDescription()); ol.setDescription(sb.toString()); @@ -122,7 +122,7 @@ public class ProjectPhaseGenOrder extends SvrProcess { MOrderLine ol = new MOrderLine(order); ol.setLine(tasks[i].getSeqNo()); - StringBuilder sb = new StringBuilder (tasks[i].getName()); + StringBuilder sb = new StringBuilder ().append(tasks[i].getName()); if (tasks[i].getDescription() != null && tasks[i].getDescription().length() > 0) sb.append(" - ").append(tasks[i].getDescription()); ol.setDescription(sb.toString()); diff --git a/org.adempiere.base.process/src/org/compiere/process/RequestEMailProcessor.java b/org.adempiere.base.process/src/org/compiere/process/RequestEMailProcessor.java index 7a8afb9cc9..854ff8a052 100644 --- a/org.adempiere.base.process/src/org/compiere/process/RequestEMailProcessor.java +++ b/org.adempiere.base.process/src/org/compiere/process/RequestEMailProcessor.java @@ -746,7 +746,7 @@ public class RequestEMailProcessor extends SvrProcess String deliveryMessage = null; if (content instanceof InputStream) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); InputStream is = (InputStream)content; int c; while ((c = is.read()) != -1) diff --git a/org.adempiere.base/src/org/adempiere/exceptions/TaxNotFoundException.java b/org.adempiere.base/src/org/adempiere/exceptions/TaxNotFoundException.java index 036d68c728..4cdeb8551e 100644 --- a/org.adempiere.base/src/org/adempiere/exceptions/TaxNotFoundException.java +++ b/org.adempiere.base/src/org/adempiere/exceptions/TaxNotFoundException.java @@ -92,7 +92,7 @@ public class TaxNotFoundException extends AdempiereException return "?"; } MLocation loc = MLocation.get(Env.getCtx(), C_Location_ID, null); - if (loc == null | loc.get_ID() != C_Location_ID) + if (loc == null || loc.get_ID() != C_Location_ID) { return "?"; } diff --git a/org.adempiere.base/src/org/adempiere/model/PromotionRule.java b/org.adempiere.base/src/org/adempiere/model/PromotionRule.java index f8bb5085a1..bbb505b252 100644 --- a/org.adempiere.base/src/org/adempiere/model/PromotionRule.java +++ b/org.adempiere.base/src/org/adempiere/model/PromotionRule.java @@ -337,7 +337,7 @@ public class PromotionRule { //optional promotion code filter String promotionCode = (String)order.get_Value("PromotionCode"); - StringBuffer sql = new StringBuffer(); + StringBuilder sql = new StringBuilder(); sql.append(select) .append(" WHERE") .append(" (" + bpFilter + ")") diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java b/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java index ff23a40b62..0b4795c0df 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java @@ -70,7 +70,7 @@ public class Doc_AllocationHdr extends Doc } // Doc_Allocation /** Tolerance G&L */ - private static final BigDecimal TOLERANCE = new BigDecimal (0.02); + private static final BigDecimal TOLERANCE = BigDecimal.valueOf(0.02); /** Facts */ private ArrayList m_facts = null; diff --git a/org.adempiere.base/src/org/compiere/db/CreateAdempiere.java b/org.adempiere.base/src/org/compiere/db/CreateAdempiere.java index fa1b96dffe..a74c73d929 100644 --- a/org.adempiere.base/src/org/compiere/db/CreateAdempiere.java +++ b/org.adempiere.base/src/org/compiere/db/CreateAdempiere.java @@ -417,7 +417,7 @@ public class CreateAdempiere if (def != null) { //jz: replace '' to \', otherwise exception - def.replaceAll("''", "\\'"); + def = def.replaceAll("''", "\\'"); sb.append(" DEFAULT ").append(def); } // Null diff --git a/org.adempiere.base/src/org/compiere/model/GridTabVO.java b/org.adempiere.base/src/org/compiere/model/GridTabVO.java index 8b6528c55d..5ccb0e36ca 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTabVO.java +++ b/org.adempiere.base/src/org/compiere/model/GridTabVO.java @@ -214,8 +214,8 @@ public class GridTabVO implements Evaluatee, Serializable if (vo.WhereClause == null) vo.WhereClause = ""; //jz col=null not good for Derby - if (vo.WhereClause.indexOf("=null")>0) - vo.WhereClause.replaceAll("=null", " IS NULL "); + if (vo.WhereClause.indexOf("=null")>0) + vo.WhereClause = vo.WhereClause.replaceAll("=null", " IS NULL "); // Where Clauses should be surrounded by parenthesis - teo_sarca, BF [ 1982327 ] if (vo.WhereClause.trim().length() > 0) { vo.WhereClause = "("+vo.WhereClause+")"; diff --git a/org.adempiere.base/src/org/compiere/model/MAsset.java b/org.adempiere.base/src/org/compiere/model/MAsset.java index 439c158f47..8ab6a316d4 100644 --- a/org.adempiere.base/src/org/compiere/model/MAsset.java +++ b/org.adempiere.base/src/org/compiere/model/MAsset.java @@ -442,7 +442,7 @@ public class MAsset extends X_A_Asset MAssetGroupAcct assetgrpacct = new MAssetGroupAcct (getCtx(), rs, get_TrxName()); MAssetAcct assetacct = new MAssetAcct (getCtx(), 0, get_TrxName()); isdepreciate = assetgrpacct.isProcessing(); - if (isDepreciated()== true | isdepreciate == true) + if (isDepreciated()== true || isdepreciate == true) { assetacct.setPostingType(assetgrpacct.getPostingType()); assetacct.setA_Split_Percent(assetgrpacct.getA_Split_Percent()); @@ -454,7 +454,7 @@ public class MAsset extends X_A_Asset assetacct.setA_Period_Start(1); - if (getUseLifeMonths() == 0 & getUseLifeYears() == 0){ + if (getUseLifeMonths() == 0 && getUseLifeYears() == 0){ assetacct.setA_Period_End(assetgrpacct.getUseLifeMonths()); asset.setUseLifeYears(assetgrpacct.getUseLifeYears()); asset.setUseLifeMonths(assetgrpacct.getUseLifeMonths()); @@ -541,7 +541,7 @@ public class MAsset extends X_A_Asset if (DB.getSQLValue(get_TrxName(), sql2, asset.getA_Asset_ID(),assetgrpacct.getPostingType())== 0) { - if (isDepreciated()== true | isdepreciate == true) + if (isDepreciated()== true || isdepreciate == true) { X_A_Depreciation_Workfile assetwk = new X_A_Depreciation_Workfile (getCtx(), 0, get_TrxName()); assetwk.setA_Asset_ID(p_A_Asset_ID); diff --git a/org.adempiere.base/src/org/compiere/model/MBPGroup.java b/org.adempiere.base/src/org/compiere/model/MBPGroup.java index f95ce75d06..c2f1e68556 100644 --- a/org.adempiere.base/src/org/compiere/model/MBPGroup.java +++ b/org.adempiere.base/src/org/compiere/model/MBPGroup.java @@ -217,7 +217,7 @@ public class MBPGroup extends X_C_BP_Group BigDecimal bd = super.getCreditWatchPercent(); if (bd.compareTo(Env.ZERO) != 0) return bd.divide(Env.ONEHUNDRED, 2, BigDecimal.ROUND_HALF_UP); - return new BigDecimal(0.90); + return BigDecimal.valueOf(0.90); } // getCreditWatchRatio diff --git a/org.adempiere.base/src/org/compiere/model/MDistribution.java b/org.adempiere.base/src/org/compiere/model/MDistribution.java index a63fd5c622..f479394dd2 100644 --- a/org.adempiere.base/src/org/compiere/model/MDistribution.java +++ b/org.adempiere.base/src/org/compiere/model/MDistribution.java @@ -270,12 +270,12 @@ public class MDistribution extends X_GL_Distribution */ public String validate() { - StringBuilder retValue = null; + String retValue = null; getLines(true); if (m_lines.length == 0) - retValue = new StringBuilder("@NoLines@"); + retValue = "@NoLines@"; else if (getPercentTotal().compareTo(Env.ONEHUNDRED) != 0) - retValue = new StringBuilder("@PercentTotal@ <> 100"); + retValue = "@PercentTotal@ <> 100"; else { // More then one line with 0 @@ -286,8 +286,8 @@ public class MDistribution extends X_GL_Distribution { if (lineFound >= 0 && m_lines[i].getPercent().compareTo(Env.ZERO) == 0) { - retValue = new StringBuilder("@Line@ ").append(lineFound) - .append(" + ").append(m_lines[i].getLine()).append(": == 0"); + retValue = "@Line@ " + lineFound + + " + " + m_lines[i].getLine() + ": == 0"; break; } lineFound = m_lines[i].getLine(); @@ -296,7 +296,7 @@ public class MDistribution extends X_GL_Distribution } setIsValid (retValue == null); - return retValue.toString(); + return retValue; } // validate diff --git a/org.adempiere.base/src/org/compiere/model/MUOMConversion.java b/org.adempiere.base/src/org/compiere/model/MUOMConversion.java index 5e683104a7..0829237a3c 100644 --- a/org.adempiere.base/src/org/compiere/model/MUOMConversion.java +++ b/org.adempiere.base/src/org/compiere/model/MUOMConversion.java @@ -229,145 +229,145 @@ public class MUOMConversion extends X_C_UOM_Conversion if (from.isMinute()) { if (to.isHour()) - return new BigDecimal(1.0/60.0); + return BigDecimal.valueOf(1.0/60.0); if (to.isDay()) - return new BigDecimal(1.0/1440.0); // 24 * 60 + return BigDecimal.valueOf(1.0/1440.0); // 24 * 60 if (to.isWorkDay()) - return new BigDecimal(1.0/480.0); // 8 * 60 + return BigDecimal.valueOf(1.0/480.0); // 8 * 60 if (to.isWeek()) - return new BigDecimal(1.0/10080.0); // 7 * 24 * 60 + return BigDecimal.valueOf(1.0/10080.0); // 7 * 24 * 60 if (to.isMonth()) - return new BigDecimal(1.0/43200.0); // 30 * 24 * 60 + return BigDecimal.valueOf(1.0/43200.0); // 30 * 24 * 60 if (to.isWorkMonth()) - return new BigDecimal(1.0/9600.0); // 4 * 5 * 8 * 60 + return BigDecimal.valueOf(1.0/9600.0); // 4 * 5 * 8 * 60 if (to.isYear()) - return new BigDecimal(1.0/525600.0); // 365 * 24 * 60 + return BigDecimal.valueOf(1.0/525600.0); // 365 * 24 * 60 } // Time - Hour if (from.isHour()) { if (to.isMinute()) - return new BigDecimal(60.0); + return BigDecimal.valueOf(60.0); if (to.isDay()) - return new BigDecimal(1.0/24.0); + return BigDecimal.valueOf(1.0/24.0); if (to.isWorkDay()) - return new BigDecimal(1.0/8.0); + return BigDecimal.valueOf(1.0/8.0); if (to.isWeek()) - return new BigDecimal(1.0/168.0); // 7 * 24 + return BigDecimal.valueOf(1.0/168.0); // 7 * 24 if (to.isMonth()) - return new BigDecimal(1.0/720.0); // 30 * 24 + return BigDecimal.valueOf(1.0/720.0); // 30 * 24 if (to.isWorkMonth()) - return new BigDecimal(1.0/160.0); // 4 * 5 * 8 + return BigDecimal.valueOf(1.0/160.0); // 4 * 5 * 8 if (to.isYear()) - return new BigDecimal(1.0/8760.0); // 365 * 24 + return BigDecimal.valueOf(1.0/8760.0); // 365 * 24 } // Time - Day if (from.isDay()) { if (to.isMinute()) - return new BigDecimal(1440.0); // 24 * 60 + return BigDecimal.valueOf(1440.0); // 24 * 60 if (to.isHour()) - return new BigDecimal(24.0); + return BigDecimal.valueOf(24.0); if (to.isWorkDay()) - return new BigDecimal(3.0); // 24 / 8 + return BigDecimal.valueOf(3.0); // 24 / 8 if (to.isWeek()) - return new BigDecimal(1.0/7.0); // 7 + return BigDecimal.valueOf(1.0/7.0); // 7 if (to.isMonth()) - return new BigDecimal(1.0/30.0); // 30 + return BigDecimal.valueOf(1.0/30.0); // 30 if (to.isWorkMonth()) - return new BigDecimal(1.0/20.0); // 4 * 5 + return BigDecimal.valueOf(1.0/20.0); // 4 * 5 if (to.isYear()) - return new BigDecimal(1.0/365.0); // 365 + return BigDecimal.valueOf(1.0/365.0); // 365 } // Time - WorkDay if (from.isWorkDay()) { if (to.isMinute()) - return new BigDecimal(480.0); // 8 * 60 + return BigDecimal.valueOf(480.0); // 8 * 60 if (to.isHour()) - return new BigDecimal(8.0); // 8 + return BigDecimal.valueOf(8.0); // 8 if (to.isDay()) - return new BigDecimal(1.0/3.0); // 24 / 8 + return BigDecimal.valueOf(1.0/3.0); // 24 / 8 if (to.isWeek()) - return new BigDecimal(1.0/5); // 5 + return BigDecimal.valueOf(1.0/5); // 5 if (to.isMonth()) - return new BigDecimal(1.0/20.0); // 4 * 5 + return BigDecimal.valueOf(1.0/20.0); // 4 * 5 if (to.isWorkMonth()) - return new BigDecimal(1.0/20.0); // 4 * 5 + return BigDecimal.valueOf(1.0/20.0); // 4 * 5 if (to.isYear()) - return new BigDecimal(1.0/240.0); // 4 * 5 * 12 + return BigDecimal.valueOf(1.0/240.0); // 4 * 5 * 12 } // Time - Week if (from.isWeek()) { if (to.isMinute()) - return new BigDecimal(10080.0); // 7 * 24 * 60 + return BigDecimal.valueOf(10080.0); // 7 * 24 * 60 if (to.isHour()) - return new BigDecimal(168.0); // 7 * 24 + return BigDecimal.valueOf(168.0); // 7 * 24 if (to.isDay()) - return new BigDecimal(7.0); + return BigDecimal.valueOf(7.0); if (to.isWorkDay()) - return new BigDecimal(5.0); + return BigDecimal.valueOf(5.0); if (to.isMonth()) - return new BigDecimal(1.0/4.0); // 4 + return BigDecimal.valueOf(1.0/4.0); // 4 if (to.isWorkMonth()) - return new BigDecimal(1.0/4.0); // 4 + return BigDecimal.valueOf(1.0/4.0); // 4 if (to.isYear()) - return new BigDecimal(1.0/50.0); // 50 + return BigDecimal.valueOf(1.0/50.0); // 50 } // Time - Month if (from.isMonth()) { if (to.isMinute()) - return new BigDecimal(43200.0); // 30 * 24 * 60 + return BigDecimal.valueOf(43200.0); // 30 * 24 * 60 if (to.isHour()) - return new BigDecimal(720.0); // 30 * 24 + return BigDecimal.valueOf(720.0); // 30 * 24 if (to.isDay()) - return new BigDecimal(30.0); // 30 + return BigDecimal.valueOf(30.0); // 30 if (to.isWorkDay()) - return new BigDecimal(20.0); // 4 * 5 + return BigDecimal.valueOf(20.0); // 4 * 5 if (to.isWeek()) - return new BigDecimal(4.0); // 4 + return BigDecimal.valueOf(4.0); // 4 if (to.isWorkMonth()) - return new BigDecimal(1.5); // 30 / 20 + return BigDecimal.valueOf(1.5); // 30 / 20 if (to.isYear()) - return new BigDecimal(1.0/12.0); // 12 + return BigDecimal.valueOf(1.0/12.0); // 12 } // Time - WorkMonth if (from.isWorkMonth()) { if (to.isMinute()) - return new BigDecimal(9600.0); // 4 * 5 * 8 * 60 + return BigDecimal.valueOf(9600.0); // 4 * 5 * 8 * 60 if (to.isHour()) - return new BigDecimal(160.0); // 4 * 5 * 8 + return BigDecimal.valueOf(160.0); // 4 * 5 * 8 if (to.isDay()) - return new BigDecimal(20.0); // 4 * 5 + return BigDecimal.valueOf(20.0); // 4 * 5 if (to.isWorkDay()) - return new BigDecimal(20.0); // 4 * 5 + return BigDecimal.valueOf(20.0); // 4 * 5 if (to.isWeek()) - return new BigDecimal(4.0); // 4 + return BigDecimal.valueOf(4.0); // 4 if (to.isMonth()) - return new BigDecimal(20.0/30.0); // 20 / 30 + return BigDecimal.valueOf(20.0/30.0); // 20 / 30 if (to.isYear()) - return new BigDecimal(1.0/12.0); // 12 + return BigDecimal.valueOf(1.0/12.0); // 12 } // Time - Year if (from.isYear()) { if (to.isMinute()) - return new BigDecimal(518400.0); // 12 * 30 * 24 * 60 + return BigDecimal.valueOf(518400.0); // 12 * 30 * 24 * 60 if (to.isHour()) - return new BigDecimal(8640.0); // 12 * 30 * 24 + return BigDecimal.valueOf(8640.0); // 12 * 30 * 24 if (to.isDay()) - return new BigDecimal(365.0); // 365 + return BigDecimal.valueOf(365.0); // 365 if (to.isWorkDay()) - return new BigDecimal(240.0); // 12 * 4 * 5 + return BigDecimal.valueOf(240.0); // 12 * 4 * 5 if (to.isWeek()) - return new BigDecimal(50.0); // 52 + return BigDecimal.valueOf(50.0); // 52 if (to.isMonth()) - return new BigDecimal(12.0); // 12 + return BigDecimal.valueOf(12.0); // 12 if (to.isWorkMonth()) - return new BigDecimal(12.0); // 12 + return BigDecimal.valueOf(12.0); // 12 } // return null; @@ -620,7 +620,7 @@ public class MUOMConversion extends X_C_UOM_Conversion /** Static Logger */ private static final CLogger s_log = CLogger.getCLogger(MUOMConversion.class); /** Indicator for Rate */ - private static final BigDecimal GETRATE = new BigDecimal(123.456); + private static final BigDecimal GETRATE = BigDecimal.valueOf(123.456); /** Conversion Map: Key=Point(from,to) Value=BigDecimal */ private static CCache s_conversions = null; /** Product Conversion Map */ diff --git a/org.adempiere.base/src/org/compiere/wf/MWFProcess.java b/org.adempiere.base/src/org/compiere/wf/MWFProcess.java index 500ffe95ac..ced3fb7862 100644 --- a/org.adempiere.base/src/org/compiere/wf/MWFProcess.java +++ b/org.adempiere.base/src/org/compiere/wf/MWFProcess.java @@ -291,13 +291,13 @@ public class MWFProcess extends X_AD_WF_Process // if (closedState == null) closedState = activityWFState; - else if (!closedState.equals(activityState)) + else if (!closedState.equals(activityState.getState())) { // Overwrite if terminated - if (WFSTATE_Terminated.equals(activityState)) + if (activityState.isTerminated()) closedState = activityWFState; // Overwrite if activity aborted and no other terminated - else if (WFSTATE_Aborted.equals(activityState) && !WFSTATE_Terminated.equals(closedState)) + else if (activityState.isAborted() && !WFSTATE_Terminated.equals(closedState)) closedState = activityWFState; } } diff --git a/org.adempiere.base/src/org/globalqss/process/CashFlow.java b/org.adempiere.base/src/org/globalqss/process/CashFlow.java index d107b980bd..98a763ffb4 100644 --- a/org.adempiere.base/src/org/globalqss/process/CashFlow.java +++ b/org.adempiere.base/src/org/globalqss/process/CashFlow.java @@ -225,7 +225,7 @@ public class CashFlow extends SvrProcess { open = open.subtract(paid); } if (open.scale() > curr.getStdPrecision()) - open.setScale(curr.getStdPrecision(), BigDecimal.ROUND_HALF_UP); + open = open.setScale(curr.getStdPrecision(), BigDecimal.ROUND_HALF_UP); BigDecimal invoiced = order.getGrandTotal().subtract(open); if (isPaySchedule) { MOrderPaySchedule[] schedule = MOrderPaySchedule.getOrderPaySchedule(getCtx(), order_id, 0, get_TrxName()); diff --git a/org.adempiere.replication/src/org/adempiere/process/rpl/exp/ExportHelper.java b/org.adempiere.replication/src/org/adempiere/process/rpl/exp/ExportHelper.java index 63a3223652..8ba36bd25b 100644 --- a/org.adempiere.replication/src/org/adempiere/process/rpl/exp/ExportHelper.java +++ b/org.adempiere.replication/src/org/adempiere/process/rpl/exp/ExportHelper.java @@ -420,7 +420,7 @@ public class ExportHelper { whereClause.append(" AND ").append(embeddedFormat.getWhereClause()); } String columnName = ""; - if(formatLine.getAD_Reference_ID()== DisplayType.Table | formatLine.getAD_Reference_ID()==DisplayType.Search) + if(formatLine.getAD_Reference_ID()== DisplayType.Table || formatLine.getAD_Reference_ID()==DisplayType.Search) { MColumn column = MColumn.get(masterPO.getCtx(), formatLine.getAD_Column_ID()); columnName = column.getColumnName(); diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoProduct.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoProduct.java index 9a22c64ccd..4ac9588740 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoProduct.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoProduct.java @@ -1206,7 +1206,7 @@ public class InfoProduct extends Info implements ActionListener, ChangeListener { CTabbedPane tab = (CTabbedPane) e.getSource(); - if(tab.getSelectedIndex() == 4 & warehouseTbl.getRowCount() > 0) + if(tab.getSelectedIndex() == 4 && warehouseTbl.getRowCount() > 0) { // If no warehouse row is selected in the warehouse tab, use the first warehouse // row to prevent array index out of bounds. BF 3051361 diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoAssetPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoAssetPanel.java index 9f69bd2e19..bd36b4ced6 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoAssetPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoAssetPanel.java @@ -281,7 +281,7 @@ public class InfoAssetPanel extends InfoPanel implements ValueChangeListener, Ev Integer C_BPartner_ID = null; - if (fBPartner_ID.getDisplay() != "") + if (!"".equals(fBPartner_ID.getDisplay())) C_BPartner_ID = (Integer)fBPartner_ID.getValue(); if (C_BPartner_ID != null) @@ -291,7 +291,7 @@ public class InfoAssetPanel extends InfoPanel implements ValueChangeListener, Ev Integer M_Product_ID = null; - if (fProduct_ID.getDisplay() != "") + if (!"".equals(fProduct_ID.getDisplay())) M_Product_ID = (Integer)fProduct_ID.getValue(); if (M_Product_ID != null) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoCashLinePanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoCashLinePanel.java index 0aa204d54a..9729962f57 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoCashLinePanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoCashLinePanel.java @@ -318,10 +318,10 @@ public class InfoCashLinePanel extends InfoPanel implements ValueChangeListener, if (fName.getText().length() > 0) sql.append(" AND UPPER(c.Name) LIKE ?"); - if (fCashBook_ID.getDisplay() != "") + if (!"".equals(fCashBook_ID.getDisplay())) sql.append(" AND c.C_CashBook_ID=?"); - if (fInvoice_ID.getDisplay() != "") + if (!"".equals(fInvoice_ID.getDisplay())) sql.append(" AND cl.C_Invoice_ID=?"); if (fDateFrom.getValue() != null || fDateTo.getValue() != null) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoInOutPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoInOutPanel.java index 30e922af02..7ad87867ab 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoInOutPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoInOutPanel.java @@ -299,7 +299,7 @@ public class InfoInOutPanel extends InfoPanel implements ValueChangeListener, Ev if (fPOReference.getText().length() > 0) sql.append(" AND UPPER(i.POReference) LIKE ?"); - if (fBPartner_ID.getDisplay() != "") + if (!"".equals(fBPartner_ID.getDisplay())) sql.append(" AND i.C_BPartner_ID=?"); if (fDateFrom.getValue() != null || fDateTo.getValue() != null) @@ -343,7 +343,7 @@ public class InfoInOutPanel extends InfoPanel implements ValueChangeListener, Ev if (fPOReference.getText().length() > 0) pstmt.setString(index++, getSQLText(fPOReference)); - if (fBPartner_ID.getDisplay() != "") + if (!"".equals(fBPartner_ID.getDisplay())) { Integer bp = (Integer)fBPartner_ID.getValue(); pstmt.setInt(index++, bp.intValue()); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java index 5e5162a59b..4f0d2834cc 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java @@ -1093,6 +1093,9 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM contentPanel.setSelectedIndex(0); } } + else if (event.getName().equals(Events.ON_CHANGE)) + { + } //default else { @@ -1108,9 +1111,11 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM progressWindow.doHighlighted(); } - private void hideBusyDialog() { - progressWindow.dispose(); - progressWindow = null; + private void hideBusyDialog() { + if (progressWindow != null) { + progressWindow.dispose(); + progressWindow = null; + } } public void onQueryCallback() diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPaymentPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPaymentPanel.java index 5d56de8eca..267d29701e 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPaymentPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPaymentPanel.java @@ -306,16 +306,22 @@ public class InfoPaymentPanel extends InfoPanel implements ValueChangeListener, if (fDocumentNo.getText().length() > 0) sql.append(" AND UPPER(p.DocumentNo) LIKE ?"); - if (fBPartner_ID.getDisplay() != "") + if (!"".equals(fBPartner_ID.getDisplay())) sql.append(" AND p.C_BPartner_ID=?"); if (fDateFrom.getValue() != null || fDateTo.getValue() != null) { - Date f = fDateFrom.getValue(); - Timestamp from = new Timestamp(f.getTime()); + Timestamp from = null; + if (fDateFrom.getValue() != null) { + Date f = fDateFrom.getValue(); + from = new Timestamp(f.getTime()); + } - Date t = fDateTo.getValue(); - Timestamp to = new Timestamp(t.getTime()); + Timestamp to = null; + if (fDateTo.getValue() != null) { + Date t = fDateTo.getValue(); + to = new Timestamp(t.getTime()); + } if (from == null && to != null) sql.append(" AND TRUNC(p.DateTrx) <= ?"); @@ -325,7 +331,7 @@ public class InfoPaymentPanel extends InfoPanel implements ValueChangeListener, sql.append(" AND TRUNC(p.DateTrx) BETWEEN ? AND ?"); } - if (fAmtFrom.getText() != "" || fAmtTo.getText() != "") + if (!"".equals(fAmtFrom.getText()) || !"".equals(fAmtTo.getText())) { BigDecimal from = new BigDecimal(fAmtFrom.getValue()); BigDecimal to = new BigDecimal(fAmtTo.getValue()); @@ -359,7 +365,7 @@ public class InfoPaymentPanel extends InfoPanel implements ValueChangeListener, if (fDocumentNo.getText().length() > 0) pstmt.setString(index++, getSQLText(fDocumentNo)); - if (fBPartner_ID.getDisplay() != "") + if (!"".equals(fBPartner_ID.getDisplay())) { Integer bp = (Integer)fBPartner_ID.getValue(); pstmt.setInt(index++, bp.intValue()); @@ -368,11 +374,17 @@ public class InfoPaymentPanel extends InfoPanel implements ValueChangeListener, if (fDateFrom.getValue() != null || fDateTo.getValue() != null) { - Date f = fDateFrom.getValue(); - Timestamp from = new Timestamp(f.getTime()); + Timestamp from = null; + if (fDateFrom.getValue() != null) { + Date f = fDateFrom.getValue(); + from = new Timestamp(f.getTime()); + } - Date t = fDateTo.getValue(); - Timestamp to = new Timestamp(t.getTime()); + Timestamp to = null; + if (fDateTo.getValue() != null) { + Date t = fDateTo.getValue(); + to = new Timestamp(t.getTime()); + } log.fine("Date From=" + from + ", To=" + to); @@ -387,7 +399,7 @@ public class InfoPaymentPanel extends InfoPanel implements ValueChangeListener, } } - if (fAmtFrom.getText() != "" || fAmtTo.getText() != "") + if (!"".equals(fAmtFrom.getText()) || !"".equals(fAmtTo.getText())) { BigDecimal from = new BigDecimal(fAmtFrom.getValue()); BigDecimal to = new BigDecimal(fAmtTo.getValue()); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/LoginPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/LoginPanel.java index 7f402e15be..46ee0356b8 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/LoginPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/LoginPanel.java @@ -34,6 +34,7 @@ import java.util.logging.Level; import org.adempiere.webui.AdempiereIdGenerator; import org.adempiere.webui.LayoutUtils; import org.adempiere.webui.apps.AEnv; +import org.adempiere.webui.component.Button; import org.adempiere.webui.component.Combobox; import org.adempiere.webui.component.ConfirmPanel; import org.adempiere.webui.component.Label; @@ -47,6 +48,7 @@ import org.adempiere.webui.theme.ITheme; import org.adempiere.webui.theme.ThemeManager; import org.adempiere.webui.util.BrowserToken; import org.adempiere.webui.util.UserPreference; +import org.adempiere.webui.window.FDialog; import org.adempiere.webui.window.LoginWindow; import org.compiere.Adempiere; import org.compiere.model.MClient; @@ -236,8 +238,14 @@ public class LoginPanel extends Window implements EventListener div = new Div(); div.setSclass(ITheme.LOGIN_BOX_FOOTER_CLASS); - ConfirmPanel pnlButtons = new ConfirmPanel(false); + ConfirmPanel pnlButtons = new ConfirmPanel(); pnlButtons.addActionListener(this); + + Button helpButton = pnlButtons.createButton(ConfirmPanel.A_HELP); + helpButton.addEventListener(Events.ON_CLICK, this); + helpButton.setSclass(ITheme.LOGIN_BUTTON_CLASS); + pnlButtons.addComponentsRight(helpButton); + LayoutUtils.addSclass(ITheme.LOGIN_BOX_FOOTER_PANEL_CLASS, pnlButtons); pnlButtons.setWidth(null); pnlButtons.getButton(ConfirmPanel.A_OK).setSclass(ITheme.LOGIN_BUTTON_CLASS); @@ -372,6 +380,10 @@ public class LoginPanel extends Window implements EventListener { validateLogin(); } + else if (event.getTarget().getId().equals(ConfirmPanel.A_HELP)) + { + openLoginHelp(); + } else if (event.getName().equals(Events.ON_SELECT)) { if(eventComp.getId().equals(lstLanguage.getId())) { @@ -405,6 +417,17 @@ public class LoginPanel extends Window implements EventListener // } + private void openLoginHelp() { + String helpURL = MSysConfig.getValue("LOGIN_HELP_URL", "http://wiki.idempiere.org/wiki/Login_Help"); + try { + Executions.getCurrent().sendRedirect(helpURL, "_blank"); + } + catch (Exception e) { + String message = e.getMessage(); + FDialog.warn(0, this, "URLnotValid", message); + } + } + private void onUserIdChange(int AD_User_ID) { String userName = txtUserId.getValue(); if (userName != null && userName.length() > 0 && AD_User_ID < 0) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java index a381614b41..2f33c99abd 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java @@ -1385,7 +1385,7 @@ public class FindWindow extends Window implements EventListener, ValueCha m_query.addRangeRestriction(ColumnSQL, parsedValue, parsedValue2, infoName, infoDisplay, infoDisplay_to, and, openBrackets); } - else if (isProductCategoryField && MQuery.OPERATORS[MQuery.EQUAL_INDEX].equals(op)) { + else if (isProductCategoryField && MQuery.OPERATORS[MQuery.EQUAL_INDEX].getValue().equals(Operator)) { if (!(parsedValue instanceof Integer)) { continue; } diff --git a/org.adempiere.ui.zk/theme/default/images/login-box-footer.png b/org.adempiere.ui.zk/theme/default/images/login-box-footer.png index 6e24eb60f4..562a0fcc8c 100644 Binary files a/org.adempiere.ui.zk/theme/default/images/login-box-footer.png and b/org.adempiere.ui.zk/theme/default/images/login-box-footer.png differ diff --git a/org.adempiere.ui.zk/theme/default/login-info.zul b/org.adempiere.ui.zk/theme/default/login-info.zul index dd088affd7..927b26d144 100644 --- a/org.adempiere.ui.zk/theme/default/login-info.zul +++ b/org.adempiere.ui.zk/theme/default/login-info.zul @@ -24,48 +24,40 @@ Copyright (C) 2009 Idalica Corporation Initially you can log into the system with the following users: - +
- - - - - + + - - - - - - - - -
Usage User +EMail Password
System Management -System -System +GardenAdmin +admin @ gardenworld.com +GardenAdmin
GardenUser +user @ gardenworld.com +GardenUser +
System Management or any role/company SuperUser +superuser @ idempiere.com System
Sample Client Administration -GardenAdmin -GardenAdmin +System +system @ idempiere.com +System
Sample Client User -GardenUser -GardenUser -
]]> - \ No newline at end of file + diff --git a/org.adempiere.ui.zk/theme/default/login-left.zul b/org.adempiere.ui.zk/theme/default/login-left.zul index 2f604cc016..787cda76e2 100644 --- a/org.adempiere.ui.zk/theme/default/login-left.zul +++ b/org.adempiere.ui.zk/theme/default/login-left.zul @@ -9,7 +9,7 @@ Copyright (C) 2009 Idalica Corporation
- +
diff --git a/org.adempiere.ui.zk/theme/default/login-links.zul b/org.adempiere.ui.zk/theme/default/login-links.zul index 51e8a63a9d..1668427d5f 100644 --- a/org.adempiere.ui.zk/theme/default/login-links.zul +++ b/org.adempiere.ui.zk/theme/default/login-links.zul @@ -15,7 +15,7 @@ Copyright (C) 2009 Idalica Corporation } - - + diff --git a/org.adempiere.ui.zk/theme/default/vendor-logo.zul b/org.adempiere.ui.zk/theme/default/vendor-logo.zul index bb6688bb03..dc8901e62d 100644 --- a/org.adempiere.ui.zk/theme/default/vendor-logo.zul +++ b/org.adempiere.ui.zk/theme/default/vendor-logo.zul @@ -14,7 +14,16 @@ Copyright (C) 2009 Idalica Corporation style="font-family:Arial,sans-serif; color:#578BB8; font-size:1em; font-weight: bold;" /> -
+
+ + + +
+