hg merge release-2.0 (merge release2 into development)

This commit is contained in:
Carlos Ruiz 2014-04-16 17:58:44 -05:00
commit 1dd6fecce4
11 changed files with 137 additions and 33 deletions

View File

@ -0,0 +1,15 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Apr 11, 2014 10:56:44 AM COT
-- IDEMPIERE-1877 Product Info Window Implementation broke the usage of barcode reader
UPDATE AD_InfoColumn SET IsIdentifier='Y',Updated=TO_DATE('2014-04-11 10:56:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200003
;
-- Apr 11, 2014 10:56:47 AM COT
UPDATE AD_InfoColumn SET IsIdentifier='Y',Updated=TO_DATE('2014-04-11 10:56:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200004
;
SELECT register_migration_script('201404111058_IDEMPIERE-1877.sql') FROM dual
;

View File

@ -0,0 +1,12 @@
-- Apr 11, 2014 10:56:44 AM COT
-- IDEMPIERE-1877 Product Info Window Implementation broke the usage of barcode reader
UPDATE AD_InfoColumn SET IsIdentifier='Y',Updated=TO_TIMESTAMP('2014-04-11 10:56:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200003
;
-- Apr 11, 2014 10:56:47 AM COT
UPDATE AD_InfoColumn SET IsIdentifier='Y',Updated=TO_TIMESTAMP('2014-04-11 10:56:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200004
;
SELECT register_migration_script('201404111058_IDEMPIERE-1877.sql') FROM dual
;

View File

@ -924,6 +924,12 @@ public class GridTabCSVImporter implements IGridTabImporter
break;
}
}
}else if(isForeing && masterRecord==null && gridTab.getTabLevel()>0){
Object master =gridTab.getParentTab().getValue(foreignColumn);
if (master!=null && value!=null && !master.toString().equals(value)){
logMsg = header.get(i)+" - "+Msg.getMsg(Env.getCtx(),"DiffParentValue", new Object[] {master.toString(),value});
break;
}
}else if (masterRecord==null && isDetail){
MColumn column = MColumn.get(Env.getCtx(),field.getAD_Column_ID());
String foreignTable = column.getReferenceTableName();

View File

@ -1706,6 +1706,10 @@ public class MInOut extends X_M_InOut implements DocAction
if ( isSOTrx() || !isDropShip() || getC_Order_ID() == 0 )
return null;
int linkedOrderID = new MOrder (getCtx(), getC_Order_ID(), get_TrxName()).getLink_Order_ID();
if (linkedOrderID <= 0)
return null;
// Document Type
int C_DocTypeTarget_ID = 0;
MDocType[] shipmentTypes = MDocType.getOfDocBaseType(getCtx(), MDocType.DOCBASETYPE_MaterialDelivery);
@ -1720,18 +1724,12 @@ public class MInOut extends X_M_InOut implements DocAction
MInOut dropShipment = copyFrom(this, getMovementDate(), getDateAcct(),
C_DocTypeTarget_ID, !isSOTrx(), false, get_TrxName(), true);
int linkedOrderID = new MOrder (getCtx(), getC_Order_ID(), get_TrxName()).getLink_Order_ID();
if (linkedOrderID != 0)
{
dropShipment.setC_Order_ID(linkedOrderID);
dropShipment.setC_Order_ID(linkedOrderID);
// get invoice id from linked order
int invID = new MOrder (getCtx(), linkedOrderID, get_TrxName()).getC_Invoice_ID();
if ( invID != 0 )
dropShipment.setC_Invoice_ID(invID);
}
else
return null;
// get invoice id from linked order
int invID = new MOrder (getCtx(), linkedOrderID, get_TrxName()).getC_Invoice_ID();
if ( invID != 0 )
dropShipment.setC_Invoice_ID(invID);
dropShipment.setC_BPartner_ID(getDropShip_BPartner_ID());
dropShipment.setC_BPartner_Location_ID(getDropShip_Location_ID());

View File

@ -131,7 +131,7 @@ public class MInfoWindow extends X_AD_InfoWindow
Query query = new Query(getCtx(), MTable.get(getCtx(), I_AD_InfoColumn.Table_ID), I_AD_InfoColumn.COLUMNNAME_AD_InfoWindow_ID+"=?", get_TrxName());
List<MInfoColumn> list = query.setParameters(getAD_InfoWindow_ID())
.setOnlyActiveRecords(true)
.setOrderBy(I_AD_InfoColumn.COLUMNNAME_SeqNo)
.setOrderBy("SeqNo, AD_InfoColumn_ID")
.list();
for(int i = list.size() - 1; i >= 0; i--) {
MInfoColumn infoColumn = list.get(i);
@ -145,7 +145,7 @@ public class MInfoWindow extends X_AD_InfoWindow
Query query = new Query(getCtx(), MTable.get(getCtx(), I_AD_InfoColumn.Table_ID), I_AD_InfoColumn.COLUMNNAME_AD_InfoWindow_ID+"=?", get_TrxName());
List<MInfoColumn> list = query.setParameters(getAD_InfoWindow_ID())
.setOnlyActiveRecords(true)
.setOrderBy(I_AD_InfoColumn.COLUMNNAME_SeqNo)
.setOrderBy("SeqNo, AD_InfoColumn_ID")
.list();
return list.toArray(new MInfoColumn[0]);
}

View File

@ -25,6 +25,7 @@ import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.Statement;
@ -2373,4 +2374,92 @@ public final class DB
}
return false;
}
/**
* Get an array of objects from sql (one per each column on the select clause), column indexing starts with 0
* @param trxName trx
* @param sql sql
* @param params array of parameters
* @return null if not found
* @throws DBException if there is any SQLException
*/
public static List<Object> getSQLValueObjectsEx(String trxName, String sql, Object... params) {
List<Object> retValue = new ArrayList<Object>();
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
pstmt = prepareStatement(sql, trxName);
setParameters(pstmt, params);
rs = pstmt.executeQuery();
ResultSetMetaData rsmd = rs.getMetaData();
if (rs.next()) {
for (int i=1; i<=rsmd.getColumnCount(); i++) {
Object obj = rs.getObject(i);
if (rs.wasNull())
retValue.add(null);
else
retValue.add(obj);
}
} else {
retValue = null;
}
}
catch (SQLException e)
{
throw new DBException(e, sql);
}
finally
{
close(rs, pstmt);
rs = null; pstmt = null;
}
return retValue;
}
/**
* Get an array of arrays of objects from sql (one per each row, and one per each column on the select clause), column indexing starts with 0
* WARNING: This method must be used just for queries returning few records, using it for many records implies heavy memory consumption
* @param trxName trx
* @param sql sql
* @param params array of parameters
* @return null if not found
* @throws DBException if there is any SQLException
*/
public static List<List<Object>> getSQLArrayObjectsEx(String trxName, String sql, Object... params) {
List<List<Object>> rowsArray = new ArrayList<List<Object>>();
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
pstmt = prepareStatement(sql, trxName);
setParameters(pstmt, params);
rs = pstmt.executeQuery();
ResultSetMetaData rsmd = rs.getMetaData();
while (rs.next()) {
List<Object> retValue = new ArrayList<Object>();
for (int i=1; i<=rsmd.getColumnCount(); i++) {
Object obj = rs.getObject(i);
if (rs.wasNull())
retValue.add(null);
else
retValue.add(obj);
}
rowsArray.add(retValue);
}
}
catch (SQLException e)
{
throw new DBException(e, sql);
}
finally
{
close(rs, pstmt);
rs = null; pstmt = null;
}
if (rowsArray.size() == 0)
return null;
return rowsArray;
}
} // DB

View File

@ -973,6 +973,7 @@ public class MWorkflow extends X_AD_Workflow
if (!docAction.equals(po.get_Value(column.getColumnName())))
{
po.set_ValueOfColumn(column.getColumnName(), docAction);
po.saveEx();
}
ProcessInfo processInfo = new ProcessInfo (((DocAction)po).getDocumentInfo(),column.getAD_Process_ID(),po.get_Table_ID(),po.get_ID());
processInfo.setTransactionName(po.get_TrxName());

View File

@ -297,18 +297,6 @@ public class PackInHandler extends DefaultHandler {
setupHandlers();
} else {
Element e = stack.pop();
if (e.contents != null && e.contents.length() > 0)
{
if (e.contents.toString().length() != e.contents.toString().trim().length())
{
String trim = e.attributes.getValue("trim");
if (!(trim != null && trim.equals("false")))
{
String s = e.contents.toString().trim();
e.contents = new StringBuffer(s);
}
}
}
if (stack.isEmpty())
{
try {

View File

@ -31,11 +31,6 @@ public class PoExporter {
private void addTextElement(String qName, String text, AttributesImpl atts) {
try {
//default trim to false for print item label since trailing space is commonly use
//for formatting purpose
if (qName.equalsIgnoreCase("PrintName") || qName.equalsIgnoreCase("UserLevel")) {
atts.addAttribute("", "", "trim", "CDATA", "false");
}
transformerHandler.startElement("", "", qName, atts);
append(text);
transformerHandler.endElement("", "", qName);

View File

@ -182,8 +182,7 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL
}
private void processQueryValue() {
//try first 2 only
for(int i = 0; i < identifiers.size() && i < 2; i++) {
for (int i = 0; i < identifiers.size(); i++) {
WEditor editor = identifiers.get(i);
editor.setValue(queryValue);
testCount();

View File

@ -122,7 +122,8 @@ public class InfoGeneralPanel extends InfoPanel implements EventListener<Event>
if (queryValue != null && queryValue.length() > 0)
{
MTable table = MTable.get(Env.getCtx(), p_tableName);
if (table.getIdentifierColumns().length > 1)
if ( table.getIdentifierColumns().length > 1
&& !p_tableName.startsWith("AD_")) // 32 AD tables with identifiers containing _
{
String separator = I_C_ElementValue.Table_Name.equalsIgnoreCase(p_tableName) ? "-" : "_";
if (txt2.isVisible())