hg merge release-1.0c (merge release1 into release2)

This commit is contained in:
Carlos Ruiz 2013-12-11 18:34:48 -05:00
commit 6c63b156a7
14 changed files with 107 additions and 15 deletions

View File

@ -21,7 +21,7 @@ AS
CURSOR CUR_BPLoc IS
SELECT IsRemitTo, C_Location_ID
FROM C_BPartner_Location
WHERE C_BPartner_ID=p_C_BPartner_ID
WHERE C_BPartner_ID=p_C_BPartner_ID AND IsActive='Y'
ORDER BY IsRemitTo DESC;
BEGIN
FOR l IN CUR_BPLoc LOOP
@ -31,4 +31,4 @@ BEGIN
END LOOP;
RETURN v_C_Location_ID;
END bpartnerRemitLocation;
/
/

View File

@ -9,7 +9,7 @@ BEGIN
FOR l IN
SELECT IsRemitTo, C_Location_ID
FROM C_BPartner_Location
WHERE C_BPartner_ID=p_C_BPartner_ID
WHERE C_BPartner_ID=p_C_BPartner_ID AND IsActive='Y'
ORDER BY IsRemitTo DESC
LOOP
IF (v_C_Location_ID IS NULL) THEN

View File

@ -0,0 +1,38 @@
CREATE OR REPLACE FUNCTION bpartnerRemitLocation
(
p_C_BPartner_ID C_BPartner.C_BPartner_ID%TYPE
)
RETURN NUMBER
/*************************************************************************
* The contents of this file are subject to the Compiere License. You may
* obtain a copy of the License at http://www.compiere.org/license.html
* Software is on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for details. Code: Compiere ERP+CRM
* Copyright (C) 1999-2002 Jorg Janke, ComPiere, Inc. All Rights Reserved.
*************************************************************************
* $Id: C_BPartner_RemitLocation.SQL,v 1.1 2006/04/21 17:51:58 jjanke Exp $
***
* Title: Return the first RemitTo C_Location_ID of a Business Partner
* Description:
*
************************************************************************/
AS
v_C_Location_ID NUMBER := NULL;
CURSOR CUR_BPLoc IS
SELECT IsRemitTo, C_Location_ID
FROM C_BPartner_Location
WHERE C_BPartner_ID=p_C_BPartner_ID AND IsActive='Y'
ORDER BY IsRemitTo DESC;
BEGIN
FOR l IN CUR_BPLoc LOOP
IF (v_C_Location_ID IS NULL) THEN
v_C_Location_ID := l.C_Location_ID;
END IF;
END LOOP;
RETURN v_C_Location_ID;
END bpartnerRemitLocation;
/
SELECT register_migration_script('201312110939_IDEMPIERE-1625.sql') FROM dual
;

View File

@ -0,0 +1,27 @@
CREATE OR REPLACE FUNCTION bpartnerRemitLocation(p_C_BPartner_ID C_BPartner.C_BPartner_ID%TYPE)
RETURNS numeric AS $body$
DECLARE
v_C_Location_ID NUMERIC := NULL;
l RECORD;
BEGIN
FOR l IN
SELECT IsRemitTo, C_Location_ID
FROM C_BPartner_Location
WHERE C_BPartner_ID=p_C_BPartner_ID AND IsActive='Y'
ORDER BY IsRemitTo DESC
LOOP
IF (v_C_Location_ID IS NULL) THEN
v_C_Location_ID := l.C_Location_ID;
END IF;
END LOOP;
RETURN v_C_Location_ID;
END;
$body$ LANGUAGE plpgsql;
SELECT register_migration_script('201312110939_IDEMPIERE-1625.sql') FROM dual
;

View File

@ -81,8 +81,9 @@ public class ExpenseTypesFromAccounts extends SvrProcess {
ProcessInfoParameter[] para = getParameter();
for (int i = 0; i < para.length; i++) {
String name = para[i].getParameterName();
if (para[i].getParameter() == null);
else if (name.equals("M_Product_Category_ID")) {
if (para[i].getParameter() == null) {
// nothing
} else if (name.equals("M_Product_Category_ID")) {
m_productCategoryId = para[i].getParameterAsInt();
} else if (name.equals("C_AcctSchema_ID")) {
m_acctSchemaId = para[i].getParameterAsInt();

View File

@ -94,6 +94,8 @@ public class MGoal extends X_PA_Goal
DB.close(rs, pstmt);
rs = null; pstmt = null;
}
if (list.size() == 0)
s_log.log (Level.WARNING, Msg.getMsg(ctx, "FindZeroRecords"));
MGoal[] retValue = new MGoal[list.size ()];
list.toArray (retValue);
return retValue;

View File

@ -862,7 +862,7 @@ public class MInvoiceLine extends X_C_InvoiceLine
setPrice();
// IDEMPIERE-1574 Sales Order Line lets Price under the Price Limit when updating
// Check PriceLimit
boolean enforce = m_IsSOTrx && m_parent.getM_PriceList().isEnforcePriceLimit();
boolean enforce = m_IsSOTrx && getParent().getM_PriceList().isEnforcePriceLimit();
if (enforce && MRole.getDefault().isOverwritePriceLimit())
enforce = false;
// Check Price Limit?

View File

@ -872,7 +872,7 @@ public class MOrderLine extends X_C_OrderLine
getProductPricing(m_M_PriceList_ID);
// IDEMPIERE-1574 Sales Order Line lets Price under the Price Limit when updating
// Check PriceLimit
boolean enforce = m_IsSOTrx && m_parent.getM_PriceList().isEnforcePriceLimit();
boolean enforce = m_IsSOTrx && getParent().getM_PriceList().isEnforcePriceLimit();
if (enforce && MRole.getDefault().isOverwritePriceLimit())
enforce = false;
// Check Price Limit?

View File

@ -608,7 +608,7 @@ public final class DisplayType
if (fieldLength == 1)
return "CHAR(" + fieldLength + ")";
else
return "NVARCHAR2(" + fieldLength + ")";
return "VARCHAR2(" + fieldLength + ")";
}
if (displayType == DisplayType.Color) // this condition is never reached - filtered above in isID
{
@ -635,7 +635,7 @@ public final class DisplayType
if (!DisplayType.isText(displayType))
s_log.severe("Unhandled Data Type = " + displayType);
return "NVARCHAR2(" + fieldLength + ")";
return "VARCHAR2(" + fieldLength + ")";
} // getSQLDataType
/**

View File

@ -547,7 +547,7 @@ public final class EMail implements Serializable
try
{
m_from = new InternetAddress (newFrom, true);
if (MSysConfig.getBooleanValue(MSysConfig.MAIL_SEND_BCC_TO_FROM, false, Env.getAD_Client_ID(Env.getCtx())));
if (MSysConfig.getBooleanValue(MSysConfig.MAIL_SEND_BCC_TO_FROM, false, Env.getAD_Client_ID(Env.getCtx())))
addBcc(newFrom);
}
catch (Exception e)

View File

@ -64,6 +64,11 @@ public final class Attachment extends CDialog
*/
private static final long serialVersionUID = 2497487523050526742L;
/**
* Save the last path selected
*/
private static String lastPath = null;
/**
* Constructor.
* loads Attachment, if ID <> 0
@ -424,7 +429,8 @@ public final class Attachment extends CDialog
private void loadFile()
{
log.info("");
JFileChooser chooser = new JFileChooser();
JFileChooser chooser = new JFileChooser(lastPath);
chooser.setDialogType(JFileChooser.OPEN_DIALOG);
chooser.setDialogTitle(Msg.getMsg(Env.getCtx(), "AttachmentNew"));
chooser.setMultiSelectionEnabled(true);
@ -463,6 +469,10 @@ public final class Attachment extends CDialog
}
}
}
// Save path of file
if (files.length>0) {
lastPath = files[0].getParentFile().getAbsolutePath();
}
} // getFileName
/**

View File

@ -282,7 +282,8 @@ public class ProcessParameterPanel extends Panel implements
Row row = new Row();
// The Editor
WEditor editor = WebEditorFactory.getEditor(mField, false);
WEditor editor = WebEditorFactory.getEditor(mField, false);
editor.setProcessParameter(true);
editor.getComponent().addEventListener(Events.ON_FOCUS, this);
editor.getComponent().addEventListener(Events.ON_BLUR, this);
editor.addValueChangeListener(this);
@ -337,6 +338,7 @@ public class ProcessParameterPanel extends Panel implements
m_mFields2.add(mField2);
// The Editor
WEditor editor2 = WebEditorFactory.getEditor(mField2, false);
editor2.setProcessParameter(true);
//override attribute
editor2.getComponent().setWidgetAttribute("columnName", mField2.getColumnName()+"_To");
editor2.getComponent().addEventListener(Events.ON_FOCUS, this);

View File

@ -14,6 +14,7 @@ public class WViewPI extends ADForm {
this.setSclass("window-view-pi");
WPerformanceIndicator.Options options = new WPerformanceIndicator.Options();
WPAPanel paPanel = WPAPanel.get(options);
appendChild(paPanel);
if (paPanel != null)
appendChild(paPanel);
}
}

View File

@ -91,6 +91,8 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
protected WEditorPopupMenu popupMenu;
private boolean tableEditor;
private boolean isProcessParameter;
public WEditor(Component comp, GridField gridField) {
this(comp, gridField, -1);
@ -208,7 +210,8 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
label = new Label("");
label.setValue(strLabel);
label.setTooltiptext(description);
label.setMandatory(mandatory);
this.setMandatory (mandatory);
if (readOnly || !updateable)
@ -546,7 +549,7 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
}
public boolean isMandatoryStyle() {
return mandatory && !readOnly && getGridField().isEditable(true) && isNullOrEmpty();
return mandatory && !readOnly && (isProcessParameter || getGridField().isEditable(true)) && isNullOrEmpty();
}
public boolean isNullOrEmpty() {
@ -632,6 +635,14 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
}
return false;
}
public boolean isProcessParameter() {
return isProcessParameter;
}
public void setProcessParameter(boolean isProcessParameter) {
this.isProcessParameter = isProcessParameter;
}
private static final String STYLE_ZOOMABLE_LABEL = "cursor: pointer; text-decoration: underline;";
private static final String STYLE_NORMAL_LABEL = "color: #333;";