Merge with eeb560416950cc9390199dfe448d08c6d9e66b39

This commit is contained in:
Elaine Tan 2012-10-19 17:04:03 +08:00
commit cf80ce5f72
30 changed files with 203 additions and 147 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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 "?";
}

View File

@ -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 + ")")

View File

@ -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<Fact> m_facts = null;

View File

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

View File

@ -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+")";

View File

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

View File

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

View File

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

View File

@ -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<Point,BigDecimal> s_conversions = null;
/** Product Conversion Map */

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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()

View File

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

View File

@ -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<Event>
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<Event>
{
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<Event>
//
}
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)

View File

@ -1385,7 +1385,7 @@ public class FindWindow extends Window implements EventListener<Event>, 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;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -24,48 +24,40 @@ Copyright (C) 2009 Idalica Corporation
<span class="section-head">Initially you can log into the system with the following users:
</span>
<table border="thin" cellpadding="5" cellspacing="0" style="margin-top: 10px; font-size: 8pt; background-color: transparent; border: 1px solid lightgray; border-collapse: collapse;">
<table cellpadding="5" cellspacing="0" style="margin-top: 10px; font-size: 8pt; background-color: transparent;">
<tbody><tr valign="top">
<th ><i><b>Usage</b></i>
</th><th><i><b>User</b></i>
</th><th><i><b>EMail</b></i>
</th><th><i><b>Password</b></i>
</th></tr>
<tr valign="top">
<td>System Management
</td><td>System
</td><td>System
</td><td>GardenAdmin
</td><td>admin @ gardenworld.com
</td><td>GardenAdmin
</td></tr>
<tr valign="top">
</td><td>GardenUser
</td><td>user @ gardenworld.com
</td><td>GardenUser
</td></tr>
<tr valign="top">
<td>System Management or any role/company
</td><td>SuperUser
</td><td>superuser @ idempiere.com
</td><td>System
</td></tr>
<tr valign="top">
<td>Sample Client Administration
</td><td>GardenAdmin
</td><td>GardenAdmin
</td><td>System
</td><td>system @ idempiere.com
</td><td>System
</td></tr>
<tr valign="top">
<td>Sample Client User
</td><td>GardenUser
</td><td>GardenUser
</td></tr>
</tbody>
</table>
</div>
]]>
</html>
</html>

View File

@ -9,7 +9,7 @@ Copyright (C) 2009 Idalica Corporation
<?component name="loginLinks" inline="true" macroURI="login-links.zul"?>
<div>
<vendorLogo/>
<loginInfo if="${desktop.execution.localName == &quot;ip-10-8-0-1.ec2.internal&quot; or desktop.execution.serverName == &quot;127.0.0.1&quot;}"/>
<loginInfo if="${desktop.execution.localName == &quot;ip-10-8-0-1.ec2.internal&quot; or desktop.execution.localName.startsWith(&quot;demo.&quot;)}"/>
<versionInfo/>
<loginLinks/>
</div>

View File

@ -15,7 +15,7 @@ Copyright (C) 2009 Idalica Corporation
}
</style>
<div class="loginLinksBox" if="${desktop.execution.localName == &quot;ip-10-8-0-1.ec2.internal&quot; or desktop.execution.serverName == &quot;127.0.0.1&quot;}"
<div class="loginLinksBox" if="${desktop.execution.localName == &quot;ip-10-8-0-1.ec2.internal&quot; or desktop.execution.localName.startsWith(&quot;demo.&quot;)}"
style="position: absolute; bottom: 5px;">
<toolbarbutton href="http://www.zkoss.org" image="http://www.zkoss.org/img/zkpowered_s.png"
@ -25,11 +25,11 @@ Copyright (C) 2009 Idalica Corporation
image="http://sfx-images.mozilla.org/affiliates/Buttons/firefox3/110x32_get_ffx.png"
target="_blank"
/>
<button href="http://www.adempiere.org" image="images/AD32.png"
tooltiptext="ADempiere Community" style="height:32px; width:32px" target="_blank"/>
<button href="http://www.idempiere.org" image="images/AD32.png"
tooltiptext="iDempiere Community" style="height:32px; width:32px" target="_blank"/>
</div>
<zscript if="${desktop.execution.localName == &quot;ip-10-8-0-1.ec2.internal&quot; or desktop.execution.serverName == &quot;127.0.0.1&quot;}">
<zscript if="${desktop.execution.localName == &quot;ip-10-8-0-1.ec2.internal&quot; or desktop.execution.localName.startsWith(&quot;demo.&quot;)}">
<![CDATA[
getFirefox.setHref("http://www.mozilla.com/?from=sfx&uid=0&t=306");
]]>

View File

@ -14,7 +14,16 @@ Copyright (C) 2009 Idalica Corporation
style="font-family:Arial,sans-serif; color:#578BB8; font-size:1em; font-weight: bold;" />
</hbox>
</div>
<div style="height: 90px" if="${desktop.execution.localName != &quot;ip-10-8-0-1.ec2.internal&quot;}">
<div style="background-color: #E5E5E5; margin: 5px;"
if="${desktop.execution.localName.startsWith(&quot;demo.&quot;)}">
<hbox align="center">
<toolbarbutton
href="http://www.idempiere.org" image="http://www.idempiere.org/_/rsrc/1341897488671/config/customLogo.gif?revision=2" target="_blank"/>
<label value="iDempiere Online Demonstration"
style="font-family:Arial,sans-serif; color:#578BB8; font-size:1.5em; font-weight: bold;" />
</hbox>
</div>
<div style="height: 90px" if="${desktop.execution.localName != &quot;ip-10-8-0-1.ec2.internal&quot; and ! desktop.execution.localName.startsWith(&quot;demo.&quot;)}">
<space/>
</div>