Merge a308056929e6

This commit is contained in:
Heng Sin Low 2013-02-27 23:24:10 +08:00
commit e4cda7e0a8
43 changed files with 199 additions and 169 deletions

View File

@ -190,10 +190,11 @@ public class BOMValidate extends SvrProcess
{ {
MProductBOM productsBOM = productsBOMs[i]; MProductBOM productsBOM = productsBOMs[i];
MProduct pp = new MProduct(getCtx(), productsBOM.getM_ProductBOM_ID(), get_TrxName()); MProduct pp = new MProduct(getCtx(), productsBOM.getM_ProductBOM_ID(), get_TrxName());
if (!pp.isBOM()) if (!pp.isBOM()) {
if (log.isLoggable(Level.FINER)) log.finer(pp.getName()); if (log.isLoggable(Level.FINER)) log.finer(pp.getName());
else if (!validateOldProduct(pp)) } else if (!validateOldProduct(pp)) {
return false; return false;
}
} }
return true; return true;
} // validateOldProduct } // validateOldProduct

View File

@ -159,10 +159,9 @@ public class BOMVerify extends SvrProcess
{ {
MProductBOM productsBOM = productsBOMs[i]; MProductBOM productsBOM = productsBOMs[i];
MProduct pp = new MProduct(getCtx(), productsBOM.getM_ProductBOM_ID(), get_TrxName()); MProduct pp = new MProduct(getCtx(), productsBOM.getM_ProductBOM_ID(), get_TrxName());
if (!pp.isBOM()) if (!pp.isBOM()) {
if (log.isLoggable(Level.FINER)) log.finer(pp.getName()); if (log.isLoggable(Level.FINER)) log.finer(pp.getName());
else } else {
{
if (validproducts.contains(pp)) if (validproducts.contains(pp))
{ {
//Do nothing, no need to recheck //Do nothing, no need to recheck

View File

@ -256,10 +256,11 @@ public class ExpenseSOrder extends SvrProcess
} }
// Update TimeExpense Line // Update TimeExpense Line
tel.setC_OrderLine_ID(ol.getC_OrderLine_ID()); tel.setC_OrderLine_ID(ol.getC_OrderLine_ID());
if (tel.save()) if (tel.save()) {
if (log.isLoggable(Level.FINE)) log.fine("Updated " + tel + " with C_OrderLine_ID"); if (log.isLoggable(Level.FINE)) log.fine("Updated " + tel + " with C_OrderLine_ID");
else } else {
log.log(Level.SEVERE, "Not Updated " + tel + " with C_OrderLine_ID"); log.log(Level.SEVERE, "Not Updated " + tel + " with C_OrderLine_ID");
}
} // processLine } // processLine

View File

@ -357,14 +357,15 @@ public class InOutGenerate extends SvrProcess
createLine (order, line, deliver, storages, true); createLine (order, line, deliver, storages, true);
} }
// Manual // Manual
else if (MOrder.DELIVERYRULE_Manual.equals(order.getDeliveryRule())) else if (MOrder.DELIVERYRULE_Manual.equals(order.getDeliveryRule())) {
if (log.isLoggable(Level.FINE)) log.fine("Manual - OnHand=" + onHand if (log.isLoggable(Level.FINE)) log.fine("Manual - OnHand=" + onHand
+ " (Unconfirmed=" + unconfirmedShippedQty + " (Unconfirmed=" + unconfirmedShippedQty
+ ") - " + line); + ") - " + line);
else } else {
if (log.isLoggable(Level.FINE)) log.fine("Failed: " + order.getDeliveryRule() + " - OnHand=" + onHand if (log.isLoggable(Level.FINE)) log.fine("Failed: " + order.getDeliveryRule() + " - OnHand=" + onHand
+ " (Unconfirmed=" + unconfirmedShippedQty + " (Unconfirmed=" + unconfirmedShippedQty
+ "), ToDeliver=" + toDeliver + " - " + line); + "), ToDeliver=" + toDeliver + " - " + line);
}
} // for all order lines } // for all order lines
// Complete Order successful // Complete Order successful

View File

@ -311,10 +311,9 @@ public class ReplicationLocal extends SvrProcess
Object result = doIt (START, "sync", new Object[] // Merge Object result = doIt (START, "sync", new Object[] // Merge
{data.TableName, data.KeyColumns, sourceRS, targetRS, m_test, Boolean.TRUE}); {data.TableName, data.KeyColumns, sourceRS, targetRS, m_test, Boolean.TRUE});
boolean replicated = isReplicated(result); boolean replicated = isReplicated(result);
if (replicated) if (replicated) {
if (log.isLoggable(Level.FINE)) log.fine("mergeDataTable -> " + TableName + " - " + result); if (log.isLoggable(Level.FINE)) log.fine("mergeDataTable -> " + TableName + " - " + result);
else } else {
{
m_replicated = false; m_replicated = false;
log.severe ("mergeDataTable -> " + TableName + " - " + result); log.severe ("mergeDataTable -> " + TableName + " - " + result);
} }

View File

@ -144,10 +144,9 @@ public class RfQResponseRank extends SvrProcess
// Rank RfQ Line Qtys // Rank RfQ Line Qtys
respQtys = rfqQty.getResponseQtys(false); respQtys = rfqQty.getResponseQtys(false);
if (respQtys.length == 0) if (respQtys.length == 0) {
if (log.isLoggable(Level.FINE)) log.fine(" - No Qtys with valid Amounts"); if (log.isLoggable(Level.FINE)) log.fine(" - No Qtys with valid Amounts");
else } else {
{
Arrays.sort(respQtys, respQtys[0]); Arrays.sort(respQtys, respQtys[0]);
int lastRank = 1; // multiple rank #1 int lastRank = 1; // multiple rank #1
BigDecimal lastAmt = Env.ZERO; BigDecimal lastAmt = Env.ZERO;

View File

@ -283,10 +283,11 @@ public class SendMailText extends SvrProcess
boolean OK = EMail.SENT_OK.equals(email.send()); boolean OK = EMail.SENT_OK.equals(email.send());
new MUserMail(m_MailText, AD_User_ID, email).saveEx(); new MUserMail(m_MailText, AD_User_ID, email).saveEx();
// //
if (OK) if (OK) {
if (log.isLoggable(Level.FINE)) log.fine(to.getEMail()); if (log.isLoggable(Level.FINE)) log.fine(to.getEMail());
else } else {
log.warning("FAILURE - " + to.getEMail()); log.warning("FAILURE - " + to.getEMail());
}
StringBuilder msglog = new StringBuilder((OK ? "@OK@" : "@ERROR@")).append(" - ").append(to.getEMail()); StringBuilder msglog = new StringBuilder((OK ? "@OK@" : "@ERROR@")).append(" - ").append(to.getEMail());
addLog(0, null, null, msglog.toString()); addLog(0, null, null, msglog.toString());
return new Boolean(OK); return new Boolean(OK);

View File

@ -915,10 +915,11 @@ public abstract class Doc
return true; return true;
// //
boolean retValue = getBalance().signum() == 0; boolean retValue = getBalance().signum() == 0;
if (retValue) if (retValue) {
if (log.isLoggable(Level.FINE)) log.fine("Yes " + toString()); if (log.isLoggable(Level.FINE)) log.fine("Yes " + toString());
else } else {
log.warning("NO - " + toString()); log.warning("NO - " + toString());
}
return retValue; return retValue;
} // isBalanced } // isBalanced
@ -1032,10 +1033,11 @@ public abstract class Doc
{ {
setPeriod(); setPeriod();
boolean open = m_C_Period_ID > 0; boolean open = m_C_Period_ID > 0;
if (open) if (open) {
if (log.isLoggable(Level.FINE)) log.fine("Yes - " + toString()); if (log.isLoggable(Level.FINE)) log.fine("Yes - " + toString());
else } else {
log.warning("NO - " + toString()); log.warning("NO - " + toString());
}
return open; return open;
} // isPeriodOpen } // isPeriodOpen

View File

@ -255,10 +255,11 @@ public final class Fact
return true; return true;
BigDecimal balance = getSourceBalance(); BigDecimal balance = getSourceBalance();
boolean retValue = balance.signum() == 0; boolean retValue = balance.signum() == 0;
if (retValue) if (retValue) {
if (log.isLoggable(Level.FINER)) log.finer(toString()); if (log.isLoggable(Level.FINER)) log.finer(toString());
else } else {
log.warning ("NO - Diff=" + balance + " - " + toString()); log.warning ("NO - Diff=" + balance + " - " + toString());
}
return retValue; return retValue;
} // isSourceBalanced } // isSourceBalanced
@ -500,10 +501,11 @@ public final class Fact
return true; return true;
BigDecimal balance = getAcctBalance(); BigDecimal balance = getAcctBalance();
boolean retValue = balance.signum() == 0; boolean retValue = balance.signum() == 0;
if (retValue) if (retValue) {
if (log.isLoggable(Level.FINER)) log.finer(toString()); if (log.isLoggable(Level.FINER)) log.finer(toString());
else } else {
log.warning("NO - Diff=" + balance + " - " + toString()); log.warning("NO - Diff=" + balance + " - " + toString());
}
return retValue; return retValue;
} // isAcctBalanced } // isAcctBalanced

View File

@ -109,10 +109,9 @@ public class WebProjectDeploy extends SvrProcess
if (!m_idList.contains(new Integer(container.getCM_Container_ID()))) if (!m_idList.contains(new Integer(container.getCM_Container_ID())))
{ {
String name = container.getName(); String name = container.getName();
if (container.delete(true)) if (container.delete(true)) {
if (log.isLoggable(Level.FINE)) log.fine("Deleted: " + name); if (log.isLoggable(Level.FINE)) log.fine("Deleted: " + name);
else // e.g. was referenced } else { // e.g. was referenced
{
log.warning("Failed Delete: " + name); log.warning("Failed Delete: " + name);
addLog(0,null,null, "@Error@ @Delete@: " + name); addLog(0,null,null, "@Error@ @Delete@: " + name);
} }

View File

@ -3407,8 +3407,7 @@ public class GridTable extends AbstractTableModel
rows = maxRows; rows = maxRows;
} }
if (log.isLoggable(Level.FINE)) if (log.isLoggable(Level.FINE)) log.fine(info.toString());
if (log.isLoggable(Level.FINE)) log.fine(info.toString());
return rows; return rows;
} // open } // open

View File

@ -303,13 +303,13 @@ public abstract class Lookup extends AbstractListModel
m_loaded = true; m_loaded = true;
fireContentsChanged(this, 0, p_data.size()); fireContentsChanged(this, 0, p_data.size());
if (p_data.size() == 0) if (p_data.size() == 0) {
if (log.isLoggable(Level.FINE)) log.fine(getColumnName() + ": #0 - ms=" if (log.isLoggable(Level.FINE)) log.fine(getColumnName() + ": #0 - ms="
+ String.valueOf(System.currentTimeMillis()-startTime)); + String.valueOf(System.currentTimeMillis()-startTime));
else } else {
if (log.isLoggable(Level.FINE)) log.fine(getColumnName() + ": #" + p_data.size() + " - ms=" if (log.isLoggable(Level.FINE)) log.fine(getColumnName() + ": #" + p_data.size() + " - ms="
+ String.valueOf(System.currentTimeMillis()-startTime)); + String.valueOf(System.currentTimeMillis()-startTime));
}
} // fillComboBox } // fillComboBox

View File

@ -848,10 +848,11 @@ public final class MAllocationHdr extends X_C_AllocationHdr implements DocAction
MBPartner bp = new MBPartner(getCtx(), C_BPartner_ID, get_TrxName()); MBPartner bp = new MBPartner(getCtx(), C_BPartner_ID, get_TrxName());
bp.setTotalOpenBalance(); // recalculates from scratch bp.setTotalOpenBalance(); // recalculates from scratch
// bp.setSOCreditStatus(); // called automatically // bp.setSOCreditStatus(); // called automatically
if (bp.save()) if (bp.save()) {
if (log.isLoggable(Level.FINE)) log.fine(bp.toString()); if (log.isLoggable(Level.FINE)) log.fine(bp.toString());
else } else {
log.log(Level.SEVERE, "BP not updated - " + bp); log.log(Level.SEVERE, "BP not updated - " + bp);
}
} }
} // updateBP } // updateBP

View File

@ -210,10 +210,11 @@ public class MCStage extends X_CM_CStage
.append(getAD_Tree_ID()).append(",").append(get_ID()) .append(getAD_Tree_ID()).append(",").append(get_ID())
.append(", 0, 999)"); .append(", 0, 999)");
int no = DB.executeUpdate(sb.toString(), get_TrxName()); int no = DB.executeUpdate(sb.toString(), get_TrxName());
if (no > 0) if (no > 0) {
if (log.isLoggable(Level.FINE)) log.fine("#" + no + " - TreeType=CMS"); if (log.isLoggable(Level.FINE)) log.fine("#" + no + " - TreeType=CMS");
else } else {
log.warning("#" + no + " - TreeType=CMS"); log.warning("#" + no + " - TreeType=CMS");
}
return no > 0; return no > 0;
} }
/*if (success) { /*if (success) {
@ -235,10 +236,11 @@ public class MCStage extends X_CM_CStage
.append(" WHERE Node_ID=").append(get_IDOld()) .append(" WHERE Node_ID=").append(get_IDOld())
.append(" AND AD_Tree_ID=").append(getAD_Tree_ID()); .append(" AND AD_Tree_ID=").append(getAD_Tree_ID());
int no = DB.executeUpdate(sb.toString(), get_TrxName()); int no = DB.executeUpdate(sb.toString(), get_TrxName());
if (no > 0) if (no > 0) {
if (log.isLoggable(Level.FINE)) log.fine("#" + no + " - TreeType=CMS"); if (log.isLoggable(Level.FINE)) log.fine("#" + no + " - TreeType=CMS");
else } else {
log.warning("#" + no + " - TreeType=CMS"); log.warning("#" + no + " - TreeType=CMS");
}
return no > 0; return no > 0;
} // afterDelete } // afterDelete

View File

@ -444,10 +444,11 @@ public class MContainer extends X_CM_Container
getAD_Tree_ID ()).append (",").append (get_ID ()).append ( getAD_Tree_ID ()).append (",").append (get_ID ()).append (
", 0, 999)"); ", 0, 999)");
int no = DB.executeUpdate (sb.toString (), get_TrxName ()); int no = DB.executeUpdate (sb.toString (), get_TrxName ());
if (no > 0) if (no > 0) {
if (log.isLoggable(Level.FINE)) log.fine ("#" + no + " - TreeType=CMC"); if (log.isLoggable(Level.FINE)) log.fine ("#" + no + " - TreeType=CMC");
else } else {
log.warning ("#" + no + " - TreeType=CMC"); log.warning ("#" + no + " - TreeType=CMC");
}
return no > 0; return no > 0;
} }
return success; return success;
@ -488,10 +489,11 @@ public class MContainer extends X_CM_Container
.append (" WHERE Node_ID=").append (get_ID ()).append ( .append (" WHERE Node_ID=").append (get_ID ()).append (
" AND AD_Tree_ID=").append (getAD_Tree_ID ()); " AND AD_Tree_ID=").append (getAD_Tree_ID ());
int no = DB.executeUpdate (sb.toString (), get_TrxName ()); int no = DB.executeUpdate (sb.toString (), get_TrxName ());
if (no > 0) if (no > 0) {
if (log.isLoggable(Level.FINE)) log.fine ("#" + no + " - TreeType=CMC"); if (log.isLoggable(Level.FINE)) log.fine ("#" + no + " - TreeType=CMC");
else } else {
log.warning ("#" + no + " - TreeType=CMC"); log.warning ("#" + no + " - TreeType=CMC");
}
return no > 0; return no > 0;
} }
@ -511,10 +513,11 @@ public class MContainer extends X_CM_Container
" AND AD_Tree_ID=").append (getAD_Tree_ID ()); " AND AD_Tree_ID=").append (getAD_Tree_ID ());
int no = DB.executeUpdate (sb.toString (), get_TrxName ()); int no = DB.executeUpdate (sb.toString (), get_TrxName ());
// If 0 than there is nothing to delete which is okay. // If 0 than there is nothing to delete which is okay.
if (no > 0) if (no > 0) {
if (log.isLoggable(Level.FINE)) log.fine ("#" + no + " - TreeType=CMC"); if (log.isLoggable(Level.FINE)) log.fine ("#" + no + " - TreeType=CMC");
else } else {
log.warning ("#" + no + " - TreeType=CMC"); log.warning ("#" + no + " - TreeType=CMC");
}
return true; return true;
} // afterDelete } // afterDelete

View File

@ -724,12 +724,13 @@ public class MCost extends X_M_Cost
as, 0, ce.getM_CostElement_ID(), product.get_TrxName()); as, 0, ce.getM_CostElement_ID(), product.get_TrxName());
if (cost.is_new()) if (cost.is_new())
{ {
if (cost.save()) if (cost.save()) {
if (s_log.isLoggable(Level.CONFIG)) s_log.config("Std.Cost for " + product.getName() if (s_log.isLoggable(Level.CONFIG)) s_log.config("Std.Cost for " + product.getName()
+ " - " + as.getName()); + " - " + as.getName());
else } else {
s_log.warning("Not created: Std.Cost for " + product.getName() s_log.warning("Not created: Std.Cost for " + product.getName()
+ " - " + as.getName()); + " - " + as.getName());
}
} }
} }
else if (MAcctSchema.COSTINGLEVEL_Organization.equals(cl)) else if (MAcctSchema.COSTINGLEVEL_Organization.equals(cl))
@ -742,14 +743,15 @@ public class MCost extends X_M_Cost
as, o.getAD_Org_ID(), ce.getM_CostElement_ID(), product.get_TrxName()); as, o.getAD_Org_ID(), ce.getM_CostElement_ID(), product.get_TrxName());
if (cost.is_new()) if (cost.is_new())
{ {
if (cost.save()) if (cost.save()) {
if (s_log.isLoggable(Level.CONFIG)) s_log.config("Std.Cost for " + product.getName() if (s_log.isLoggable(Level.CONFIG)) s_log.config("Std.Cost for " + product.getName()
+ " - " + o.getName() + " - " + o.getName()
+ " - " + as.getName()); + " - " + as.getName());
else } else {
s_log.warning("Not created: Std.Cost for " + product.getName() s_log.warning("Not created: Std.Cost for " + product.getName()
+ " - " + o.getName() + " - " + o.getName()
+ " - " + as.getName()); + " - " + as.getName());
}
} }
} // for all orgs } // for all orgs
} }

View File

@ -243,10 +243,11 @@ public class MDiscountSchema extends X_M_DiscountSchema
// Price Breaks // Price Breaks
getBreaks(false); getBreaks(false);
BigDecimal Amt = Price.multiply(Qty); BigDecimal Amt = Price.multiply(Qty);
if (isQuantityBased()) if (isQuantityBased()) {
if (log.isLoggable(Level.FINER)) log.finer("Qty=" + Qty + ",M_Product_ID=" + M_Product_ID + ",M_Product_Category_ID=" + M_Product_Category_ID); if (log.isLoggable(Level.FINER)) log.finer("Qty=" + Qty + ",M_Product_ID=" + M_Product_ID + ",M_Product_Category_ID=" + M_Product_Category_ID);
else } else {
if (log.isLoggable(Level.FINER)) log.finer("Amt=" + Amt + ",M_Product_ID=" + M_Product_ID + ",M_Product_Category_ID=" + M_Product_Category_ID); if (log.isLoggable(Level.FINER)) log.finer("Amt=" + Amt + ",M_Product_ID=" + M_Product_ID + ",M_Product_Category_ID=" + M_Product_Category_ID);
}
for (int i = 0; i < m_breaks.length; i++) for (int i = 0; i < m_breaks.length; i++)
{ {
MDiscountSchemaBreak br = m_breaks[i]; MDiscountSchemaBreak br = m_breaks[i];

View File

@ -760,10 +760,8 @@ public final class MLookup extends Lookup implements Serializable
return; return;
} }
// //
if (CLogMgt.isLevelFiner()) if (log.isLoggable(Level.FINER)) log.finer(m_info.Column_ID + ", " + m_info.KeyColumn + ": " + sql.toString());
if (log.isLoggable(Level.FINER)) log.finer(m_info.Column_ID + ", " + m_info.KeyColumn + ": " + sql.toString()); if (log.isLoggable(Level.FINEST)) log.finest(m_info.KeyColumn + ": " + sql);
if (CLogMgt.isLevelFinest())
if (log.isLoggable(Level.FINEST)) log.finest(m_info.KeyColumn + ": " + sql);
// Reset // Reset
m_lookup.clear(); m_lookup.clear();

View File

@ -164,10 +164,11 @@ public class MMedia extends X_CM_Media
.append(getAD_Tree_ID()).append(",").append(get_ID()) .append(getAD_Tree_ID()).append(",").append(get_ID())
.append(", 0, 999)"); .append(", 0, 999)");
int no = DB.executeUpdate(sb.toString(), get_TrxName()); int no = DB.executeUpdate(sb.toString(), get_TrxName());
if (no > 0) if (no > 0) {
if (log.isLoggable(Level.FINE)) log.fine("#" + no + " - TreeType=CMM"); if (log.isLoggable(Level.FINE)) log.fine("#" + no + " - TreeType=CMM");
else } else {
log.warning("#" + no + " - TreeType=CMM"); log.warning("#" + no + " - TreeType=CMM");
}
return no > 0; return no > 0;
} }
return success; return success;
@ -187,10 +188,11 @@ public class MMedia extends X_CM_Media
.append(" WHERE Node_ID=").append(get_IDOld()) .append(" WHERE Node_ID=").append(get_IDOld())
.append(" AND AD_Tree_ID=").append(getAD_Tree_ID()); .append(" AND AD_Tree_ID=").append(getAD_Tree_ID());
int no = DB.executeUpdate(sb.toString(), get_TrxName()); int no = DB.executeUpdate(sb.toString(), get_TrxName());
if (no > 0) if (no > 0) {
if (log.isLoggable(Level.FINE)) log.fine("#" + no + " - TreeType=CMM"); if (log.isLoggable(Level.FINE)) log.fine("#" + no + " - TreeType=CMM");
else } else {
log.warning("#" + no + " - TreeType=CMM"); log.warning("#" + no + " - TreeType=CMM");
}
return no > 0; return no > 0;
} // afterDelete } // afterDelete

View File

@ -298,10 +298,11 @@ public class MPInstance extends X_AD_PInstance
seconds = 1; seconds = 1;
String updsql = "UPDATE AD_Process SET Statistic_Count=Statistic_Count+1, Statistic_Seconds=Statistic_Seconds+? WHERE AD_Process_ID=?"; String updsql = "UPDATE AD_Process SET Statistic_Count=Statistic_Count+1, Statistic_Seconds=Statistic_Seconds+? WHERE AD_Process_ID=?";
int no = DB.executeUpdate(updsql, new Object[] {seconds, getAD_Process_ID()}, true, null); // out of trx int no = DB.executeUpdate(updsql, new Object[] {seconds, getAD_Process_ID()}, true, null); // out of trx
if (no == 1) if (no == 1) {
if (log.isLoggable(Level.FINE)) log.fine("afterSave - Process Statistics updated Sec=" + seconds); if (log.isLoggable(Level.FINE)) log.fine("afterSave - Process Statistics updated Sec=" + seconds);
else } else {
log.warning("afterSave - Process Statistics not updated"); log.warning("afterSave - Process Statistics not updated");
}
} }
return success; return success;
} // afterSave } // afterSave

View File

@ -66,12 +66,13 @@ public class MStorageOnHand extends X_M_StorageOnHand
.setParameters(M_Locator_ID, M_Product_ID, M_AttributeSetInstance_ID) .setParameters(M_Locator_ID, M_Product_ID, M_AttributeSetInstance_ID)
.first(); .first();
if (retValue == null) if (retValue == null) {
if (s_log.isLoggable(Level.FINE)) s_log.fine("Not Found - M_Locator_ID=" + M_Locator_ID if (s_log.isLoggable(Level.FINE)) s_log.fine("Not Found - M_Locator_ID=" + M_Locator_ID
+ ", M_Product_ID=" + M_Product_ID + ", M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID); + ", M_Product_ID=" + M_Product_ID + ", M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID);
else } else {
if (s_log.isLoggable(Level.FINE)) s_log.fine("M_Locator_ID=" + M_Locator_ID if (s_log.isLoggable(Level.FINE)) s_log.fine("M_Locator_ID=" + M_Locator_ID
+ ", M_Product_ID=" + M_Product_ID + ", M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID); + ", M_Product_ID=" + M_Product_ID + ", M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID);
}
return retValue; return retValue;
} // get } // get
@ -380,7 +381,7 @@ public class MStorageOnHand extends X_M_StorageOnHand
storage.setQtyOnHand (storage.getQtyOnHand().add (diffQtyOnHand)); storage.setQtyOnHand (storage.getQtyOnHand().add (diffQtyOnHand));
if (s_log.isLoggable(Level.FINE)) { if (s_log.isLoggable(Level.FINE)) {
StringBuilder diffText = new StringBuilder("(OnHand=").append(diffQtyOnHand).append(") -> ").append(storage.toString()); StringBuilder diffText = new StringBuilder("(OnHand=").append(diffQtyOnHand).append(") -> ").append(storage.toString());
if (s_log.isLoggable(Level.FINE)) s_log.fine(diffText.toString()); s_log.fine(diffText.toString());
} }
return storage.save (trxName); return storage.save (trxName);
} // add } // add

View File

@ -74,12 +74,13 @@ public class MStorageReservation extends X_M_StorageReservation {
DB.close(rs, pstmt); DB.close(rs, pstmt);
rs = null; pstmt = null; rs = null; pstmt = null;
} }
if (retValue == null) if (retValue == null) {
if (s_log.isLoggable(Level.FINE)) s_log.fine("Not Found - M_Warehouse_ID=" + M_Warehouse_ID if (s_log.isLoggable(Level.FINE)) s_log.fine("Not Found - M_Warehouse_ID=" + M_Warehouse_ID
+ ", M_Product_ID=" + M_Product_ID + ", M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID + ", IsSOTrx=" + isSOTrx); + ", M_Product_ID=" + M_Product_ID + ", M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID + ", IsSOTrx=" + isSOTrx);
else } else {
if (s_log.isLoggable(Level.FINE)) s_log.fine("M_Warehouse_ID=" + M_Warehouse_ID if (s_log.isLoggable(Level.FINE)) s_log.fine("M_Warehouse_ID=" + M_Warehouse_ID
+ ", M_Product_ID=" + M_Product_ID + ", M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID + ", IsSOTrx=" + isSOTrx); + ", M_Product_ID=" + M_Product_ID + ", M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID + ", IsSOTrx=" + isSOTrx);
}
return retValue; return retValue;
} // get } // get
@ -257,7 +258,7 @@ public class MStorageReservation extends X_M_StorageReservation {
storage.setQty (storage.getQty().add(diffQty)); storage.setQty (storage.getQty().add(diffQty));
if (s_log.isLoggable(Level.FINE)) { if (s_log.isLoggable(Level.FINE)) {
StringBuilder diffText = new StringBuilder("(Qty=").append(diffQty).append(") -> ").append(storage.toString()); StringBuilder diffText = new StringBuilder("(Qty=").append(diffQty).append(") -> ").append(storage.toString());
if (s_log.isLoggable(Level.FINE)) s_log.fine(diffText.toString()); s_log.fine(diffText.toString());
} }
return storage.save (trxName); return storage.save (trxName);
} // add } // add

View File

@ -221,10 +221,11 @@ public class MTemplate extends X_CM_Template
getAD_Tree_ID ()).append (",").append (get_ID ()).append ( getAD_Tree_ID ()).append (",").append (get_ID ()).append (
", 0, 999)"); ", 0, 999)");
int no = DB.executeUpdate (sb.toString (), get_TrxName ()); int no = DB.executeUpdate (sb.toString (), get_TrxName ());
if (no > 0) if (no > 0) {
if (log.isLoggable(Level.FINE)) log.fine ("#" + no + " - TreeType=CMT"); if (log.isLoggable(Level.FINE)) log.fine ("#" + no + " - TreeType=CMT");
else } else {
log.warning ("#" + no + " - TreeType=CMT"); log.warning ("#" + no + " - TreeType=CMT");
}
return no > 0; return no > 0;
} }
if (!newRecord) if (!newRecord)
@ -262,10 +263,11 @@ public class MTemplate extends X_CM_Template
.append (" WHERE Node_ID=").append (get_IDOld ()).append ( .append (" WHERE Node_ID=").append (get_IDOld ()).append (
" AND AD_Tree_ID=").append (getAD_Tree_ID ()); " AND AD_Tree_ID=").append (getAD_Tree_ID ());
int no = DB.executeUpdate (sb.toString (), get_TrxName ()); int no = DB.executeUpdate (sb.toString (), get_TrxName ());
if (no > 0) if (no > 0) {
if (log.isLoggable(Level.FINE)) log.fine ("#" + no + " - TreeType=CMT"); if (log.isLoggable(Level.FINE)) log.fine ("#" + no + " - TreeType=CMT");
else } else {
log.warning ("#" + no + " - TreeType=CMT"); log.warning ("#" + no + " - TreeType=CMT");
}
return no > 0; return no > 0;
} // afterDelete } // afterDelete

View File

@ -2565,10 +2565,11 @@ public abstract class PO
// Something changed // Something changed
if (changes) if (changes)
{ {
if (m_trxName == null) if (m_trxName == null) {
if (log.isLoggable(Level.FINE)) log.fine(p_info.getTableName() + "." + where); if (log.isLoggable(Level.FINE)) log.fine(p_info.getTableName() + "." + where);
else } else {
if (log.isLoggable(Level.FINE)) log.fine("[" + m_trxName + "] - " + p_info.getTableName() + "." + where); if (log.isLoggable(Level.FINE)) log.fine("[" + m_trxName + "] - " + p_info.getTableName() + "." + where);
}
if (!updated) // Updated not explicitly set if (!updated) // Updated not explicitly set
{ {
Timestamp now = new Timestamp(System.currentTimeMillis()); Timestamp now = new Timestamp(System.currentTimeMillis());
@ -2674,10 +2675,11 @@ public abstract class PO
set_ValueNoCheck(p_info.getColumnName(uuidIndex), uuid.toString()); set_ValueNoCheck(p_info.getColumnName(uuidIndex), uuid.toString());
} }
} }
if (m_trxName == null) if (m_trxName == null) {
if (log.isLoggable(Level.FINE)) log.fine(p_info.getTableName() + " - " + get_WhereClause(true)); if (log.isLoggable(Level.FINE)) log.fine(p_info.getTableName() + " - " + get_WhereClause(true));
else } else {
if (log.isLoggable(Level.FINE)) log.fine("[" + m_trxName + "] - " + p_info.getTableName() + " - " + get_WhereClause(true)); if (log.isLoggable(Level.FINE)) log.fine("[" + m_trxName + "] - " + p_info.getTableName() + " - " + get_WhereClause(true));
}
// Set new DocumentNo // Set new DocumentNo
String columnName = "DocumentNo"; String columnName = "DocumentNo";
@ -3572,11 +3574,12 @@ public abstract class PO
.append(get_TableName()).append("_ID=").append(get_ID()).append(")"); .append(get_TableName()).append("_ID=").append(get_ID()).append(")");
// //
int no = DB.executeUpdate(sb.toString(), get_TrxName()); int no = DB.executeUpdate(sb.toString(), get_TrxName());
if (no > 0) if (no > 0) {
if (log.isLoggable(Level.FINE)) log.fine("#" + no); if (log.isLoggable(Level.FINE)) log.fine("#" + no);
else } else {
log.warning("#" + no log.warning("#" + no
+ " - Table=" + acctTable + " from " + acctBaseTable); + " - Table=" + acctTable + " from " + acctBaseTable);
}
//fall back to the slow java client update code //fall back to the slow java client update code
if (uuidColumnId > 0 && !uuidFunction) { if (uuidColumnId > 0 && !uuidFunction) {
@ -3651,10 +3654,11 @@ public abstract class PO
sb.append(" AND NOT EXISTS (SELECT * FROM " + MTree_Base.getNodeTableName(treeType) + " e " sb.append(" AND NOT EXISTS (SELECT * FROM " + MTree_Base.getNodeTableName(treeType) + " e "
+ "WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=").append(get_ID()).append(")"); + "WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=").append(get_ID()).append(")");
int no = DB.executeUpdate(sb.toString(), get_TrxName()); int no = DB.executeUpdate(sb.toString(), get_TrxName());
if (no > 0) if (no > 0) {
if (log.isLoggable(Level.FINE)) log.fine("#" + no + " - TreeType=" + treeType); if (log.isLoggable(Level.FINE)) log.fine("#" + no + " - TreeType=" + treeType);
else } else {
log.warning("#" + no + " - TreeType=" + treeType); log.warning("#" + no + " - TreeType=" + treeType);
}
if (uuidColumnId > 0 && !uuidFunction ) if (uuidColumnId > 0 && !uuidFunction )
{ {
@ -3681,10 +3685,11 @@ public abstract class PO
+ "WHERE t.AD_Tree_ID=n.AD_Tree_ID AND t.TreeType='") + "WHERE t.AD_Tree_ID=n.AD_Tree_ID AND t.TreeType='")
.append(treeType).append("')"); .append(treeType).append("')");
int no = DB.executeUpdate(sb.toString(), get_TrxName()); int no = DB.executeUpdate(sb.toString(), get_TrxName());
if (no > 0) if (no > 0) {
if (log.isLoggable(Level.FINE)) log.fine("#" + no + " - TreeType=" + treeType); if (log.isLoggable(Level.FINE)) log.fine("#" + no + " - TreeType=" + treeType);
else } else {
log.warning("#" + no + " - TreeType=" + treeType); log.warning("#" + no + " - TreeType=" + treeType);
}
return no > 0; return no > 0;
} // delete_Tree } // delete_Tree
@ -3743,10 +3748,11 @@ public abstract class PO
success = DB.executeUpdateEx(sql, trxName, QUERY_TIME_OUT) == 1; success = DB.executeUpdateEx(sql, trxName, QUERY_TIME_OUT) == 1;
else else
success = DB.executeUpdate(sql, trxName) == 1; success = DB.executeUpdate(sql, trxName) == 1;
if (success) if (success) {
if (log.isLoggable(Level.FINE)) log.fine("success" + (trxName == null ? "" : "[" + trxName + "]")); if (log.isLoggable(Level.FINE)) log.fine("success" + (trxName == null ? "" : "[" + trxName + "]"));
else } else {
log.log(Level.WARNING, "failed" + (trxName == null ? "" : " [" + trxName + "]")); log.log(Level.WARNING, "failed" + (trxName == null ? "" : " [" + trxName + "]"));
}
return success; return success;
} }
return true; return true;

View File

@ -109,10 +109,9 @@ public class PO_Record
.append(s_cascadeNames[i]) .append(s_cascadeNames[i])
.append(" WHERE AD_Table_ID=? AND Record_ID=?"); .append(" WHERE AD_Table_ID=? AND Record_ID=?");
int no = DB.executeUpdate(sql.toString(), params, false, trxName); int no = DB.executeUpdate(sql.toString(), params, false, trxName);
if (no > 0) if (no > 0) {
if (log.isLoggable(Level.CONFIG)) log.config(s_cascadeNames[i] + " (" + AD_Table_ID + "/" + Record_ID + ") #" + no); if (log.isLoggable(Level.CONFIG)) log.config(s_cascadeNames[i] + " (" + AD_Table_ID + "/" + Record_ID + ") #" + no);
else if (no < 0) } else if (no < 0) {
{
log.severe(s_cascadeNames[i] + " (" + AD_Table_ID + "/" + Record_ID + ") #" + no); log.severe(s_cascadeNames[i] + " (" + AD_Table_ID + "/" + Record_ID + ") #" + no);
return false; return false;
} }
@ -136,13 +135,12 @@ public class PO_Record
.append(s_parentChildNames[j]).append(" WHERE ") .append(s_parentChildNames[j]).append(" WHERE ")
.append(s_parentNames[j]).append("_ID=?)"); .append(s_parentNames[j]).append("_ID=?)");
int no = DB.executeUpdate(sql.toString(), params, false, trxName); int no = DB.executeUpdate(sql.toString(), params, false, trxName);
if (no > 0) if (no > 0) {
if (log.isLoggable(Level.CONFIG)) log.config(s_cascadeNames[i] + " " + s_parentNames[j] if (log.isLoggable(Level.CONFIG)) log.config(s_cascadeNames[i] + " " + s_parentNames[j]
+ " (" + AD_Table_ID + "/" + Record_ID + ") #" + no); + " (" + AD_Table_ID + "/" + Record_ID + ") #" + no);
else if (no < 0) } else if (no < 0) {
{
log.severe(s_cascadeNames[i] + " " + s_parentNames[j] log.severe(s_cascadeNames[i] + " " + s_parentNames[j]
+ " (" + AD_Table_ID + "/" + Record_ID + ") #" + no); + " (" + AD_Table_ID + "/" + Record_ID + ") #" + no);
return false; return false;
} }
} }
@ -231,7 +229,7 @@ public class PO_Record
int no = DB.executeUpdate(sql.toString(), null); int no = DB.executeUpdate(sql.toString(), null);
if (no > 0) if (no > 0)
if (log.isLoggable(Level.CONFIG)) log.config(s_cascadeNames[i] + " (" + AD_Table_ID + "/" + TableName if (log.isLoggable(Level.CONFIG)) log.config(s_cascadeNames[i] + " (" + AD_Table_ID + "/" + TableName
+ ") Invalid #" + no); + ") Invalid #" + no);
} }
} // validate } // validate

View File

@ -123,10 +123,11 @@ public class PrintFormatUtil
int AD_Column_ID = rs.getInt(1); int AD_Column_ID = rs.getInt(1);
String ColumnName = rs.getString(2); String ColumnName = rs.getString(2);
MPrintFormatItem pfi = MPrintFormatItem.createFromColumn (pf, AD_Column_ID, 0); MPrintFormatItem pfi = MPrintFormatItem.createFromColumn (pf, AD_Column_ID, 0);
if (pfi.get_ID() != 0) if (pfi.get_ID() != 0) {
if (log.isLoggable(Level.FINE)) log.fine("#" + ++counter + " - added " + ColumnName); if (log.isLoggable(Level.FINE)) log.fine("#" + ++counter + " - added " + ColumnName);
else } else {
log.warning("Not added: " + ColumnName); log.warning("Not added: " + ColumnName);
}
} }
} }
catch (Exception e) catch (Exception e)
@ -138,7 +139,7 @@ public class PrintFormatUtil
DB.close(rs, pstmt); DB.close(rs, pstmt);
rs = null; pstmt = null; rs = null; pstmt = null;
} }
if (counter == 0) if (counter == 0) {
if (log.isLoggable(Level.FINE)) log.fine("None" if (log.isLoggable(Level.FINE)) log.fine("None"
/** /**
+ " - " + sql + " - " + sql
@ -146,8 +147,9 @@ public class PrintFormatUtil
+ " - AD_Table_ID=" + pf.getAD_Table_ID() + " - AD_Table_ID=" + pf.getAD_Table_ID()
*/ */
); );
else } else {
if (log.isLoggable(Level.FINE)) log.fine("Added=" + counter); if (log.isLoggable(Level.FINE)) log.fine("Added=" + counter);
}
return counter; return counter;
} // addMissingColumns } // addMissingColumns

View File

@ -432,8 +432,7 @@ PrintEvent on Win32 Printer : \\MAIN\HP LaserJet 5L
PrintServiceAttributeSet - length=1 PrintServiceAttributeSet - length=1
queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount) queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
**/ **/
if (log.isLoggable(Level.FINE)) if (log.isLoggable(Level.FINE)) log.fine("attributeUpdate - " + psae);
if (log.isLoggable(Level.FINE)) log.fine("attributeUpdate - " + psae);
// PrintUtil.dump (psae.getAttributes()); // PrintUtil.dump (psae.getAttributes());
} // attributeUpdate } // attributeUpdate
@ -980,8 +979,7 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
return false; return false;
} }
if (log.isLoggable(Level.FINE)) if (log.isLoggable(Level.FINE)) log.fine(uri.toString());
if (log.isLoggable(Level.FINE)) log.fine(uri.toString());
try try
{ {
@ -1613,8 +1611,7 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
DB.close(rs, pstmt); DB.close(rs, pstmt);
rs = null; pstmt = null; rs = null; pstmt = null;
} }
if (log.isLoggable(Level.FINE)) if (log.isLoggable(Level.FINE)) log.fine("Order => " + what[0] + " ID=" + what[1]);
if (log.isLoggable(Level.FINE)) log.fine("Order => " + what[0] + " ID=" + what[1]);
return what; return what;
} // getDocumentWhat } // getDocumentWhat

View File

@ -135,10 +135,11 @@ public class ImageElement extends PrintElement
public ImageElement(Image image) public ImageElement(Image image)
{ {
m_image = image; m_image = image;
if (m_image != null) if (m_image != null) {
if (log.isLoggable(Level.FINE)) log.fine("Image=" + image); if (log.isLoggable(Level.FINE)) log.fine("Image=" + image);
else } else {
log.log(Level.WARNING, "Image is NULL"); log.log(Level.WARNING, "Image is NULL");
}
} // ImageElement } // ImageElement
/** /**
@ -151,10 +152,11 @@ public class ImageElement extends PrintElement
if (imageURL != null) if (imageURL != null)
{ {
m_image = Toolkit.getDefaultToolkit().createImage(imageURL); m_image = Toolkit.getDefaultToolkit().createImage(imageURL);
if (m_image != null) if (m_image != null) {
if (log.isLoggable(Level.FINE)) log.fine("URL=" + imageURL); if (log.isLoggable(Level.FINE)) log.fine("URL=" + imageURL);
else } else {
log.log(Level.WARNING, "Not loaded - URL=" + imageURL); log.log(Level.WARNING, "Not loaded - URL=" + imageURL);
}
} }
else else
log.log(Level.WARNING, "Invalid URL=" + imageURLstring); log.log(Level.WARNING, "Invalid URL=" + imageURLstring);
@ -169,10 +171,11 @@ public class ImageElement extends PrintElement
if (imageURL != null) if (imageURL != null)
{ {
m_image = Toolkit.getDefaultToolkit().createImage(imageURL); m_image = Toolkit.getDefaultToolkit().createImage(imageURL);
if (m_image != null) if (m_image != null) {
if (log.isLoggable(Level.FINE)) log.fine("URL=" + imageURL); if (log.isLoggable(Level.FINE)) log.fine("URL=" + imageURL);
else } else {
log.log(Level.WARNING, "Not loaded - URL=" + imageURL); log.log(Level.WARNING, "Not loaded - URL=" + imageURL);
}
} }
else else
log.severe ("ImageURL is NULL"); log.severe ("ImageURL is NULL");
@ -254,12 +257,13 @@ public class ImageElement extends PrintElement
byte[] imageData = mimage.getData(); byte[] imageData = mimage.getData();
if (imageData != null) if (imageData != null)
m_image = Toolkit.getDefaultToolkit().createImage(imageData); m_image = Toolkit.getDefaultToolkit().createImage(imageData);
if (m_image != null) if (m_image != null) {
if (log.isLoggable(Level.FINE)) log.fine(mimage.toString() if (log.isLoggable(Level.FINE)) log.fine(mimage.toString()
+ " - Size=" + imageData.length); + " - Size=" + imageData.length);
else } else {
log.log(Level.WARNING, mimage.toString() log.log(Level.WARNING, mimage.toString()
+ " - not loaded (must be gif or jpg) - record_ID=" + record_ID); + " - not loaded (must be gif or jpg) - record_ID=" + record_ID);
}
} // loadFromDB } // loadFromDB
@ -284,12 +288,13 @@ public class ImageElement extends PrintElement
byte[] imageData = attachment.getEntryData(0); byte[] imageData = attachment.getEntryData(0);
if (imageData != null) if (imageData != null)
m_image = Toolkit.getDefaultToolkit().createImage(imageData); m_image = Toolkit.getDefaultToolkit().createImage(imageData);
if (m_image != null) if (m_image != null) {
if (log.isLoggable(Level.FINE)) log.fine(attachment.getEntryName(0) if (log.isLoggable(Level.FINE)) log.fine(attachment.getEntryName(0)
+ " - Size=" + imageData.length); + " - Size=" + imageData.length);
else } else {
log.log(Level.WARNING, attachment.getEntryName(0) log.log(Level.WARNING, attachment.getEntryName(0)
+ " - not loaded (must be gif or jpg) - AD_PrintFormatItem_ID=" + AD_PrintFormatItem_ID); + " - not loaded (must be gif or jpg) - AD_PrintFormatItem_ID=" + AD_PrintFormatItem_ID);
}
} // loadAttachment } // loadAttachment
/************************************************************************** /**************************************************************************

View File

@ -409,11 +409,8 @@ public class LayoutEngine implements Pageable, Printable, Doc
height = m_footerHeight; height = m_footerHeight;
m_footer.setBounds (x, y, w, height); m_footer.setBounds (x, y, w, height);
if (log.isLoggable(Level.FINE)) if (log.isLoggable(Level.FINE)) log.fine("Paper=" + m_paper + ",HeaderHeight=" + m_headerHeight + ",FooterHeight=" + m_footerHeight
{
if (log.isLoggable(Level.FINE)) log.fine("Paper=" + m_paper + ",HeaderHeight=" + m_headerHeight + ",FooterHeight=" + m_footerHeight
+ " => Header=" + m_header + ",Contents=" + m_content + ",Footer=" + m_footer); + " => Header=" + m_header + ",Contents=" + m_content + ",Footer=" + m_footer);
}
} // calculatePageSize } // calculatePageSize
/** /**

View File

@ -505,10 +505,11 @@ public class CLogMgt
{ {
String key = pp[i].toString(); String key = pp[i].toString();
String value = p.getProperty(key); String value = p.getProperty(key);
if (logIt) if (logIt) {
if (log.isLoggable(Level.CONFIG)) log.config(key + "=" + value); if (log.isLoggable(Level.CONFIG)) log.config(key + "=" + value);
else } else {
System.out.println(" " + key + " = " + value); System.out.println(" " + key + " = " + value);
}
} }
} // printProperties } // printProperties

View File

@ -1667,10 +1667,11 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable
else if (resp.isOrganization()) else if (resp.isOrganization())
{ {
MOrgInfo org = MOrgInfo.get(getCtx(), m_po.getAD_Org_ID(), get_TrxName()); MOrgInfo org = MOrgInfo.get(getCtx(), m_po.getAD_Org_ID(), get_TrxName());
if (org.getSupervisor_ID() == 0) if (org.getSupervisor_ID() == 0) {
if (log.isLoggable(Level.FINE)) log.fine("No Supervisor for AD_Org_ID=" + m_po.getAD_Org_ID()); if (log.isLoggable(Level.FINE)) log.fine("No Supervisor for AD_Org_ID=" + m_po.getAD_Org_ID());
else } else {
sendEMail(client, org.getSupervisor_ID(), null, subject, message, pdf, text.isHtml()); sendEMail(client, org.getSupervisor_ID(), null, subject, message, pdf, text.isHtml());
}
} }
} }
} // sendEMail } // sendEMail

View File

@ -1254,10 +1254,9 @@ public abstract class Info extends CDialog
setCursor(Cursor.getDefaultCursor()); setCursor(Cursor.getDefaultCursor());
setStatusLine(Integer.toString(no) + " " + Msg.getMsg(Env.getCtx(), "SearchRows_EnterQuery"), false); setStatusLine(Integer.toString(no) + " " + Msg.getMsg(Env.getCtx(), "SearchRows_EnterQuery"), false);
setStatusDB(Integer.toString(no)); setStatusDB(Integer.toString(no));
if (no == 0) if (no == 0) {
if (log.isLoggable(Level.FINE)) log.fine(dataSql); if (log.isLoggable(Level.FINE)) log.fine(dataSql);
else } else {
{
p_table.getSelectionModel().setSelectionInterval(0, 0); p_table.getSelectionModel().setSelectionInterval(0, 0);
p_table.requestFocus(); p_table.requestFocus();
} }

View File

@ -78,7 +78,6 @@ import org.compiere.swing.CPanel;
import org.compiere.swing.CScrollPane; import org.compiere.swing.CScrollPane;
import org.compiere.swing.CollapsiblePanel; import org.compiere.swing.CollapsiblePanel;
import org.compiere.swing.TableCellNone; import org.compiere.swing.TableCellNone;
import org.compiere.util.CLogMgt;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
import org.compiere.util.DisplayType; import org.compiere.util.DisplayType;
import org.compiere.util.Env; import org.compiere.util.Env;
@ -1389,8 +1388,7 @@ public class GridController extends CPanel
*/ */
public void mouseClicked(MouseEvent e) public void mouseClicked(MouseEvent e)
{ {
if (CLogMgt.isLevelFinest()) if (log.isLoggable(Level.FINEST)) log.finest("" + this + " - " + e);
if (log.isLoggable(Level.FINEST)) log.finest("" + this + " - " + e);
} }
/** /**
* Mouse Pressed * Mouse Pressed

View File

@ -420,10 +420,11 @@ public final class VBPartner extends CDialog implements ActionListener
m_partner.setC_Greeting_ID(p.getKey()); m_partner.setC_Greeting_ID(p.getKey());
else else
m_partner.setC_Greeting_ID(0); m_partner.setC_Greeting_ID(0);
if (m_partner.save()) if (m_partner.save()) {
if (log.isLoggable(Level.FINE)) log.fine("C_BPartner_ID=" + m_partner.getC_BPartner_ID()); if (log.isLoggable(Level.FINE)) log.fine("C_BPartner_ID=" + m_partner.getC_BPartner_ID());
else } else {
ADialog.error(m_WindowNo, this, "BPartnerNotSaved"); ADialog.error(m_WindowNo, this, "BPartnerNotSaved");
}
// ***** Business Partner - Location ***** // ***** Business Partner - Location *****
if (m_pLocation == null) if (m_pLocation == null)
@ -433,10 +434,11 @@ public final class VBPartner extends CDialog implements ActionListener
m_pLocation.setPhone(fPhone.getText()); m_pLocation.setPhone(fPhone.getText());
m_pLocation.setPhone2(fPhone2.getText()); m_pLocation.setPhone2(fPhone2.getText());
m_pLocation.setFax(fFax.getText()); m_pLocation.setFax(fFax.getText());
if (m_pLocation.save()) if (m_pLocation.save()) {
if (log.isLoggable(Level.FINE)) log.fine("C_BPartner_Location_ID=" + m_pLocation.getC_BPartner_Location_ID()); if (log.isLoggable(Level.FINE)) log.fine("C_BPartner_Location_ID=" + m_pLocation.getC_BPartner_Location_ID());
else } else {
ADialog.error(m_WindowNo, this, "BPartnerNotSaved", Msg.translate(Env.getCtx(), "C_BPartner_Location_ID")); ADialog.error(m_WindowNo, this, "BPartnerNotSaved", Msg.translate(Env.getCtx(), "C_BPartner_Location_ID"));
}
// ***** Business Partner - User ***** // ***** Business Partner - User *****
String contact = fContact.getText(); String contact = fContact.getText();
@ -459,10 +461,11 @@ public final class VBPartner extends CDialog implements ActionListener
m_user.setPhone(fPhone.getText()); m_user.setPhone(fPhone.getText());
m_user.setPhone2(fPhone2.getText()); m_user.setPhone2(fPhone2.getText());
m_user.setFax(fFax.getText()); m_user.setFax(fFax.getText());
if (m_user.save()) if (m_user.save()) {
if (log.isLoggable(Level.FINE)) log.fine("AD_User_ID=" + m_user.getAD_User_ID()); if (log.isLoggable(Level.FINE)) log.fine("AD_User_ID=" + m_user.getAD_User_ID());
else } else {
ADialog.error(m_WindowNo, this, "BPartnerNotSaved", Msg.translate(Env.getCtx(), "AD_User_ID")); ADialog.error(m_WindowNo, this, "BPartnerNotSaved", Msg.translate(Env.getCtx(), "AD_User_ID"));
}
} }
return true; return true;
} // actionSave } // actionSave

View File

@ -1103,10 +1103,11 @@ public class VLookup extends JComponent
// No (unique) result // No (unique) result
if (id <= 0) if (id <= 0)
{ {
if (id == -3) if (id == -3) {
if (log.isLoggable(Level.FINE)) log.fine(m_columnName + " - Not Found - " + finalSQL); if (log.isLoggable(Level.FINE)) log.fine(m_columnName + " - Not Found - " + finalSQL);
else } else {
if (log.isLoggable(Level.FINE)) log.fine(m_columnName + " - Not Unique - " + finalSQL); if (log.isLoggable(Level.FINE)) log.fine(m_columnName + " - Not Unique - " + finalSQL);
}
m_value = null; // force re-display m_value = null; // force re-display
actionButton(m_text.getText()); actionButton(m_text.getText());
return; return;

View File

@ -449,10 +449,11 @@ public class VPAttributeDialog extends CDialog
break; break;
} }
} }
if (found) if (found) {
if (log.isLoggable(Level.FINE)) log.fine("Attribute=" + attribute.getName() + " #" + values.length + " - found: " + instance); if (log.isLoggable(Level.FINE)) log.fine("Attribute=" + attribute.getName() + " #" + values.length + " - found: " + instance);
else } else {
log.warning("Attribute=" + attribute.getName() + " #" + values.length + " - NOT found: " + instance); log.warning("Attribute=" + attribute.getName() + " #" + values.length + " - NOT found: " + instance);
}
} // setComboBox } // setComboBox
else else
if (log.isLoggable(Level.FINE)) log.fine("Attribute=" + attribute.getName() + " #" + values.length + " no instance"); if (log.isLoggable(Level.FINE)) log.fine("Attribute=" + attribute.getName() + " #" + values.length + " no instance");

View File

@ -436,9 +436,9 @@ public class WBPartner extends Window implements EventListener<Event>, ValueChan
else else
m_partner.setC_Greeting_ID(0); m_partner.setC_Greeting_ID(0);
if (m_partner.save()) if (m_partner.save()) {
if (log.isLoggable(Level.FINE)) log.fine("C_BPartner_ID=" + m_partner.getC_BPartner_ID()); if (log.isLoggable(Level.FINE)) log.fine("C_BPartner_ID=" + m_partner.getC_BPartner_ID());
else { } else {
FDialog.error(m_WindowNo, this, "BPartnerNotSaved"); FDialog.error(m_WindowNo, this, "BPartnerNotSaved");
m_partner = null; m_partner = null;
return false; return false;
@ -455,10 +455,11 @@ public class WBPartner extends Window implements EventListener<Event>, ValueChan
m_pLocation.setPhone2(fPhone2.getText()); m_pLocation.setPhone2(fPhone2.getText());
m_pLocation.setFax(fFax.getText()); m_pLocation.setFax(fFax.getText());
if (m_pLocation.save()) if (m_pLocation.save()) {
if (log.isLoggable(Level.FINE)) log.fine("C_BPartner_Location_ID=" + m_pLocation.getC_BPartner_Location_ID()); if (log.isLoggable(Level.FINE)) log.fine("C_BPartner_Location_ID=" + m_pLocation.getC_BPartner_Location_ID());
else } else {
FDialog.error(m_WindowNo, this, "BPartnerNotSaved", Msg.translate(Env.getCtx(), "C_BPartner_Location_ID")); FDialog.error(m_WindowNo, this, "BPartnerNotSaved", Msg.translate(Env.getCtx(), "C_BPartner_Location_ID"));
}
// ***** Business Partner - User ***** // ***** Business Partner - User *****
@ -489,10 +490,11 @@ public class WBPartner extends Window implements EventListener<Event>, ValueChan
m_user.setPhone2(fPhone2.getText()); m_user.setPhone2(fPhone2.getText());
m_user.setFax(fFax.getText()); m_user.setFax(fFax.getText());
if (m_user.save()) if (m_user.save()) {
if (log.isLoggable(Level.FINE)) log.fine("AD_User_ID=" + m_user.getAD_User_ID()); if (log.isLoggable(Level.FINE)) log.fine("AD_User_ID=" + m_user.getAD_User_ID());
else } else {
FDialog.error(m_WindowNo, this, "BPartnerNotSaved", Msg.translate(Env.getCtx(), "AD_User_ID")); FDialog.error(m_WindowNo, this, "BPartnerNotSaved", Msg.translate(Env.getCtx(), "AD_User_ID"));
}
} }
return true; return true;
} // actionSave } // actionSave

View File

@ -445,10 +445,9 @@ public class ResetPasswordPanel extends Window implements EventListener<Event>
user.setIsExpired(true); user.setIsExpired(true);
user.saveEx(); user.saveEx();
if (sendEmail(user, newPassword)) if (sendEmail(user, newPassword)) {
if (logger.isLoggable(Level.FINE)) logger.fine(user.getEMail()); if (logger.isLoggable(Level.FINE)) logger.fine(user.getEMail());
else } else {
{
if (errorMsg.length() > 0) if (errorMsg.length() > 0)
errorMsg += ", "; errorMsg += ", ";
errorMsg += user.getEMail(); errorMsg += user.getEMail();

View File

@ -538,6 +538,7 @@ public class RolePanel extends Window implements EventListener<Event>, Deferrabl
**/ **/
public void validateRoles() public void validateRoles()
{ {
Clients.clearBusy();
Comboitem lstItemRole = lstRole.getSelectedItem(); Comboitem lstItemRole = lstRole.getSelectedItem();
Comboitem lstItemClient = lstClient.getSelectedItem(); Comboitem lstItemClient = lstClient.getSelectedItem();
Comboitem lstItemOrg = lstOrganisation.getSelectedItem(); Comboitem lstItemOrg = lstOrganisation.getSelectedItem();

View File

@ -599,10 +599,11 @@ public class WPAttributeDialog extends Window implements EventListener<Event>
break; break;
} }
} }
if (found) if (found ){
if (log.isLoggable(Level.FINE)) log.fine("Attribute=" + attribute.getName() + " #" + values.length + " - found: " + instance); if (log.isLoggable(Level.FINE)) log.fine("Attribute=" + attribute.getName() + " #" + values.length + " - found: " + instance);
else } else {
log.warning("Attribute=" + attribute.getName() + " #" + values.length + " - NOT found: " + instance); log.warning("Attribute=" + attribute.getName() + " #" + values.length + " - NOT found: " + instance);
}
} // setComboBox } // setComboBox
else else
if (log.isLoggable(Level.FINE)) log.fine("Attribute=" + attribute.getName() + " #" + values.length + " no instance"); if (log.isLoggable(Level.FINE)) log.fine("Attribute=" + attribute.getName() + " #" + values.length + " no instance");

View File

@ -778,13 +778,14 @@ public class Allocation
String sql = "SELECT invoiceOpen(C_Invoice_ID, 0) " String sql = "SELECT invoiceOpen(C_Invoice_ID, 0) "
+ "FROM C_Invoice WHERE C_Invoice_ID=?"; + "FROM C_Invoice WHERE C_Invoice_ID=?";
BigDecimal open = DB.getSQLValueBD(trxName, sql, C_Invoice_ID); BigDecimal open = DB.getSQLValueBD(trxName, sql, C_Invoice_ID);
if (open != null && open.signum() == 0) { if (open != null && open.signum() == 0) {
sql = "UPDATE C_Invoice SET IsPaid='Y' " sql = "UPDATE C_Invoice SET IsPaid='Y' "
+ "WHERE C_Invoice_ID=" + C_Invoice_ID; + "WHERE C_Invoice_ID=" + C_Invoice_ID;
int no = DB.executeUpdate(sql, trxName); int no = DB.executeUpdate(sql, trxName);
if (log.isLoggable(Level.CONFIG)) log.config("Invoice #" + i + " is paid - updated=" + no); if (log.isLoggable(Level.CONFIG)) log.config("Invoice #" + i + " is paid - updated=" + no);
} else } else {
if (log.isLoggable(Level.CONFIG)) log.config("Invoice #" + i + " is not paid - " + open); if (log.isLoggable(Level.CONFIG)) log.config("Invoice #" + i + " is not paid - " + open);
}
} }
} }
// Test/Set Payment is fully allocated // Test/Set Payment is fully allocated

View File

@ -129,10 +129,9 @@ public class LoginLinkTag extends TagSupport
// Check Cookie // Check Cookie
String cookieUser = JSPEnv.getCookieWebUser ((HttpServletRequest)pageContext.getRequest()); String cookieUser = JSPEnv.getCookieWebUser ((HttpServletRequest)pageContext.getRequest());
if (cookieUser == null || cookieUser.trim().length() == 0) if (cookieUser == null || cookieUser.trim().length() == 0) {
if (log.isLoggable(Level.FINER)) log.finer ("(" + address + ") - no cookie"); if (log.isLoggable(Level.FINER)) log.finer ("(" + address + ") - no cookie");
else } else {
{
// Try to Load // Try to Load
wu = WebUser.get (ctx, cookieUser); wu = WebUser.get (ctx, cookieUser);
if (log.isLoggable(Level.FINER)) log.finer ("(" + address + ") - Cookie: " + wu); if (log.isLoggable(Level.FINER)) log.finer ("(" + address + ") - Cookie: " + wu);

View File

@ -97,10 +97,11 @@ public class StoreFilter implements javax.servlet.Filter
enc = request.getCharacterEncoding(); enc = request.getCharacterEncoding();
if (enc == null) if (enc == null)
request.setCharacterEncoding(WebEnv.ENCODING); request.setCharacterEncoding(WebEnv.ENCODING);
if (enc == null) if (enc == null) {
if (log.isLoggable(Level.FINER)) log.finer("Checked=" + uri); if (log.isLoggable(Level.FINER)) log.finer("Checked=" + uri);
else } else {
if (log.isLoggable(Level.FINER)) log.finer("Checked=" + uri + " - Enc=" + enc); if (log.isLoggable(Level.FINER)) log.finer("Checked=" + uri + " - Enc=" + enc);
}
} }
catch (Exception e) catch (Exception e)
{ {