diff --git a/org.idempiere.webservices/META-INF/cxf/services.xml b/org.idempiere.webservices/META-INF/cxf/services.xml index da7b9f577d..318c6f5de7 100644 --- a/org.idempiere.webservices/META-INF/cxf/services.xml +++ b/org.idempiere.webservices/META-INF/cxf/services.xml @@ -12,7 +12,7 @@ - + diff --git a/org.idempiere.webservices/Notes/HowToAddNewWebService.txt b/org.idempiere.webservices/Notes/HowToAddNewWebService.txt index 169c5043aa..045bd2ce31 100644 --- a/org.idempiere.webservices/Notes/HowToAddNewWebService.txt +++ b/org.idempiere.webservices/Notes/HowToAddNewWebService.txt @@ -1,29 +1,29 @@ -How to add a new WebService in 3E_WebServices +How to add a new WebService in idempiere WebServices i.e. we're going to add a webservice to complete documents the new webservice will have the following parameters: -* ADLoginRequest - it's already defined in ADInterface/src/xsd/schema.xsd with the following parameters: +* ADLoginRequest - it's already defined in WEB-INF/xsd/idempiere-schema.xsd with the following parameters: user, pass, lang, ClientID, RoleID, OrgID, WarehouseID, stage * TableName String -> M_InOut * Record_ID int -> 1000002 * DocStatus String -> CO -Note, if you need to define new datatypes you need to define them in ADInterface/src/xsd/schema.xsd -and generate the pl3xe.jar again with this command: - scomp -out ./lib/pl3xE.jar ADInterface/src/xsd/schema.xsd +Note, if you need to define new datatypes you need to define them in WEB-INF/xsd/idempiere-schema.xsd +and generate the idempiere-xmlbeans.jar again with this command: + scomp -out ./WEB-INF/lib/idempiere-xmlbeans.jar ./WEB-INF/xsd/idempiere-schema.xsd scomp will generate the corresponding classes to manipulate the xml objects from the messages The method will be called modelSetDocAction - the model in name indicates that the web service is going to be based on model classes, current web services are based in UI instead of model. So, we add this line: - public StandardResponseDocument modelSetDocAction(String tableName, int recordID, String newDocStatus, ADLoginRequestDocument reqlogin) throws XFireFault; -at the interface 3E_WebServices/ADInterface/src/main/com/_3e/ADInterface/ADService.java + public StandardResponseDocument modelSetDocAction(String tableName, int recordID, String newDocStatus, ADLoginRequestDocument reqlogin); +at the interface WEB-INF/src/org/idempiere/adinterface/ADService.java NOTE: In parameters, complex data must be at the end Now, we need to implement the method, so we open the file -3E_WebServices/ADInterface/src/main/com/_3e/ADInterface/ADServiceImpl.java +WEB-INF/src/org/idempiere/adinterface/ADServiceImpl.java And add the new method and define the corresponding logic within. diff --git a/org.idempiere.webservices/Notes/notes.txt b/org.idempiere.webservices/Notes/notes.txt deleted file mode 100644 index 71fbd02ad9..0000000000 --- a/org.idempiere.webservices/Notes/notes.txt +++ /dev/null @@ -1,42 +0,0 @@ -== structure of exchanged data records: - - - - - - - - ... - - - - ... - - - - ... - - - -== Example. Still not finished! -open questions: -Where does it specify Table name? - - - - - 100000 - - - - - - 100000 - - - - - - - - \ No newline at end of file diff --git a/org.idempiere.webservices/WEB-INF/src/com/bizidium/ws/CompositeService.java b/org.idempiere.webservices/WEB-INF/src/com/trekglobal/ws/CompositeService.java similarity index 93% rename from org.idempiere.webservices/WEB-INF/src/com/bizidium/ws/CompositeService.java rename to org.idempiere.webservices/WEB-INF/src/com/trekglobal/ws/CompositeService.java index 667dcfae57..cbe13cd555 100644 --- a/org.idempiere.webservices/WEB-INF/src/com/bizidium/ws/CompositeService.java +++ b/org.idempiere.webservices/WEB-INF/src/com/trekglobal/ws/CompositeService.java @@ -1,4 +1,4 @@ -package com.bizidium.ws; +package com.trekglobal.ws; import javax.jws.WebService; import javax.jws.soap.SOAPBinding; diff --git a/org.idempiere.webservices/WEB-INF/src/com/bizidium/ws/CompositeServiceImpl.java b/org.idempiere.webservices/WEB-INF/src/com/trekglobal/ws/CompositeServiceImpl.java similarity index 95% rename from org.idempiere.webservices/WEB-INF/src/com/bizidium/ws/CompositeServiceImpl.java rename to org.idempiere.webservices/WEB-INF/src/com/trekglobal/ws/CompositeServiceImpl.java index 5553086823..7bd57121cf 100644 --- a/org.idempiere.webservices/WEB-INF/src/com/bizidium/ws/CompositeServiceImpl.java +++ b/org.idempiere.webservices/WEB-INF/src/com/trekglobal/ws/CompositeServiceImpl.java @@ -11,7 +11,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * *****************************************************************************/ -package com.bizidium.ws; +package com.trekglobal.ws; import java.util.ArrayList; import java.util.Properties; @@ -52,7 +52,7 @@ import org.idempiere.webservices.AbstractService; * @author Deepak Pansheriya * */ -@WebService(endpointInterface = "com.bizidium.ws.CompositeService", serviceName = "compositeInterface" ,targetNamespace="http://idempiere.org/ADInterface/1_0") +@WebService(endpointInterface = "com.trekglobal.ws.CompositeService", serviceName = "compositeInterface" ,targetNamespace="http://idempiere.org/ADInterface/1_0") public class CompositeServiceImpl extends AbstractService implements CompositeService { private static CLogger log = CLogger.getCLogger(CompositeServiceImpl.class); diff --git a/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/ADDataStatusListener.java b/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/ADDataStatusListener.java deleted file mode 100644 index 104f7f0549..0000000000 --- a/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/ADDataStatusListener.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.idempiere.adinterface; - -import java.util.Properties; - -import org.compiere.model.DataStatusEvent; -import org.compiere.model.DataStatusListener; -import org.compiere.util.CLogger; -import org.compiere.util.Msg; - - -public class ADDataStatusListener implements DataStatusListener { - - protected static CLogger log = CLogger.getCLogger( ADDataStatusListener.class); - public String m_status_data; - public boolean m_is_status_error; - public String m_error_message; - public String m_error_info; - public boolean m_is_error; - private Properties m_ctx; - - public ADDataStatusListener( Properties _ctx ) - { - m_ctx = _ctx; - m_is_status_error = false; - m_is_error = false; - } - - public void dataStatusChanged(DataStatusEvent e) - { - this.m_status_data = e.getInfo(); - - - //String dbInfo = e.getMessage(); - //if (curTab != null && curTab.isQueryActive()) - // dbInfo = "[ " + dbInfo + " ]"; - //m_status_db = dbInfo; - - log.info( "dataStatusChanged : "+e.getMessage() +" "+e.getInfo()+" "+e.getAD_Message()+" "); - //System.out.println( "dataStatusChanged : "+e.getMessage() +" "+e.getInfo()+" "+e.getAD_Message()+" "); - - // Set Message / Info - if (e.getAD_Message() != null || e.getInfo() != null) - { - StringBuilder sb = new StringBuilder(); - String msg = e.getMessage(); - if (msg != null && msg.length() > 0) - sb.append(Msg.getMsg(m_ctx, e.getAD_Message())); - String info = e.getInfo(); - if (info != null && info.length() > 0) - { - if (sb.length() > 0 && !sb.toString().trim().endsWith(":")) - sb.append(": "); - sb.append(info); - } - if (sb.length() > 0) - { - int pos = sb.indexOf("\n"); - if (pos != -1) // replace CR/NL - sb.replace(pos, pos+1, " - "); - setStatusLine (sb.toString (), e.isError ()); - } - } - - // Confirm Error - if (e.isError() && !e.isConfirmed()) - { - m_is_error = true; - m_error_message = e.getAD_Message(); - m_error_info = e.getInfo(); - //setStatusError( Msg.getMsg(m_ctx, e.getAD_Message()), Msg.getMsg(m_ctx, e.getInfo())); - e.setConfirmed(true); // show just once - if GridTable.setCurrentRow is involved the status event is re-issued - } else - m_is_error = false; - } - - public void setStatusLine( String msg, boolean is_error ) - { - this.m_status_data = msg ; - this.m_is_status_error = is_error; - //else - // this.m_status_data = " "+msg+" "; - } - - - - -} diff --git a/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/ADInfo.java b/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/ADInfo.java deleted file mode 100644 index e5074ee477..0000000000 --- a/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/ADInfo.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.idempiere.adinterface; - -import java.sql.PreparedStatement; -import java.sql.SQLException; - -import org.idempiere.adInterface.x10.DataRow; - -public interface ADInfo { - public void setParameters( PreparedStatement pstmt, boolean forCount) throws SQLException; - //public String getSQLWhere(); - public String getSQL(); - public String getSQLCount(); - - public DataRow getColumns(); - -} diff --git a/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/ADLookup.java b/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/ADLookup.java index 18bc42bd7b..c0b11ae5c3 100644 --- a/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/ADLookup.java +++ b/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/ADLookup.java @@ -1,26 +1,9 @@ package org.idempiere.adinterface; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; -import java.util.logging.Level; - -import org.compiere.model.GridField; import org.compiere.model.Lookup; -import org.compiere.model.MLookup; -import org.compiere.model.MRole; import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; import org.compiere.util.KeyNamePair; import org.compiere.util.ValueNamePair; -import org.compiere.util.WebSessionCtx; - -import org.idempiere.adInterface.x10.DataField; -import org.idempiere.adInterface.x10.DataRow; -import org.idempiere.adInterface.x10.DataSet; import org.idempiere.adInterface.x10.LookupValue; import org.idempiere.adInterface.x10.LookupValues; @@ -31,469 +14,11 @@ import org.idempiere.adInterface.x10.LookupValues; * GridField na GridField * GridField */ - -// TODO: Implement a better replacement for ROWNUM / LIMIT syntax - public class ADLookup { - - - static final int TYPE_PRODUCT = 001; - static final int TYPE_ORDER = 002; - static final int TYPE_BUISNESS_PARTNER = 002; - - private String m_columnName; - private int m_type; - private String m_tableName; - private String m_keyColumnName; - private Boolean IsQueryJoin; - private boolean m_isSOTRX; - - private final int MAX_PRODUCT_ROWS=500; - - private WebSessionCtx wsc; - private Lookup m_lookup; protected static CLogger log = CLogger.getCLogger(ADLookup.class); - public ADLookup( String columnName ) - { - m_columnName = columnName; - - } - - - public ArrayList GetLookupData() - { - - return null; - } - - - - private String getWhereClause( String keyColumn, DataRow params ) { - String whereClause = "IsSummary='N'"; - String lookupColumn = keyColumn; - return whereClause; - } - - private DataSet getResult( org.idempiere.adinterface.ADInfo info, DataSet ds, int count, String mode ) { - if ("count".equals(mode) && count > 1) { - DataRow dr = ds.addNewDataRow(); - DataField df = dr.addNewField(); - df.setVal( ""+count ); - df.setColumn( "__count" ); - df.setType( "string" ); - return ds; - } - - try { - - PreparedStatement pstmt = DB.prepareStatement( info.getSQL(), null ); - info.setParameters( pstmt, false ); - ResultSet rs = pstmt.executeQuery(); - while (rs.next()) - { - DataRow dr = ds.addNewDataRow(); - DataField df = null; - //DataField df = dr.addNewField(); - - DataRow cols = info.getColumns(); - - for (int i=0; i< cols.sizeOfFieldArray(); i++ ) { - df = dr.addNewField(); - DataField f = cols.getFieldArray(i); - //if ("string".equalsIgnoreCase(f.getType())) { - { - df.setVal(rs.getString( i + 1 )); - df.setColumn( f.getColumn() ); - df.setType( f.getType() ); - df.setLval( f.getLval() ); - } - } - - } - rs.close(); - pstmt.close(); - } - catch (Exception e) - { - System.out.println( e.getMessage() ); - } - return ds; - } - - - - - public void getLookupSearchValues( DataRow adr, DataSet ds, Properties ctx, int windowNo ) - { - //String whereClause = getWhere(adr); - String whereClause = getWhereClause(m_columnName, adr); - String finalSQL=""; - - IsQueryJoin = false; - - String mode = "normal"; - for (int i=0; i< adr.sizeOfFieldArray(); i++) { - DataField f = adr.getFieldArray(i); - if ("mode".equalsIgnoreCase(f.getColumn())) mode = f.getVal(); - } - - - ADInfo info = null; - - // TODO: Implement info for generic lookups !! - - if (m_columnName.equals("C_BPartner_ID")) - { - //finalSQL = getBuisnessPartnerSQL(whereClause, adr); - info = new InfoBPartner( adr, whereClause ); - } else if (m_columnName.equals("M_Product_ID")) - { - info = new InfoProduct( adr, whereClause, ctx, windowNo ); - //finalSQL = getProductSQL(whereClause); - }else if (m_columnName.equals("C_Order_ID")) { - //finalSQL = getOrderAccessSQL(whereClause); - } - if (finalSQL.equals("")) { - //finalSQL = getDirectAccessSQL(whereClause); - } - - - //Sprawdzam czy przy wykonaniu FinalSql zwr�ci mi 0, 1 lub wiele wierszy - //Je�eli zwr�ci mi 0 wierszy to ko�cz� - //Je�eli zwr�ci mi 1 wiersz to ko�cowy wynik b�dzie kwerend� normaln� (w przypadku join�w, np.: bp zostanie wykonana alternatywna kwerenda bez join�w) - //Je�eli zwr�ci mi n wierszy to zwracam je - int id = 0; - log.info("Starting execution to base"); - try - { - /* - PreparedStatement pstmt = DB.prepareStatement( finalSQL ); - info.setParameters( pstmt, true); - ResultSet rs = pstmt.executeQuery(); - //Wykonuje zapytanie do bazy z "normalnym" sql i sprawdzam ile, mam wierszy wyniku - int ile = 0; - while (rs.next()) - { - ile = ile+1; - }*/ - int ile = 0; - finalSQL = info!=null ? info.getSQLCount() : ""; - PreparedStatement pstmt = DB.prepareStatement(finalSQL, null); - if (info!=null) info.setParameters (pstmt, true); - ResultSet rs = pstmt.executeQuery(); - if (rs.next()) - ile = rs.getInt(1); - rs.close(); - pstmt.close(); - - System.out.println("Znalaz�em " + ile + " wierszy / rekord�w"); - //Je�eli jest 0 wierszy to ko�czymy - //w kliencie spowoduje to wyswietlenie pustego okna lookUp - if (ile==0) - { - System.out.println("Nie znalaz�em rekord�w. W kliencie zostanie wy�wietlone okno LookUp'a bez rekord�w."); - } - //Je�eli jest tylko jeden wiersz to odpowiednie tabele b�d� wywo�ywane bez - //join�w - if ((ile==1)) - { - System.out.println("Znalaz�em 1 rekord wi�c szukam dla bez join. W kliencie zostanie automatycznie uzupe�niona warto�c"); - IsQueryJoin = false; - } - //Jesli wiecej niz jeden to uzywamy join�w - //Spowoduje to wyswietlenie rekord�w spe�niajacych kryterium - //w oknie LookUp'a - if (ile>1) - { - System.out.println("Znalaz�em wi�cej ni� 1 rekord wi�c szukam dla whereClause i z joinami. W kliencie zostanie wy�wietlone LookUpWindow z przefiltrowanymi rekordami."); - IsQueryJoin = true; - - } - ds = getResult(info, ds, ile, mode); - } - catch (Exception e) - { - log.log(Level.SEVERE, finalSQL, e); - id = -2; - } - // No (unique) result - if (id <= 0) - { - if (id == 0) - log.fine("Not Found - " + finalSQL); - else - log.fine("Not Unique - " + finalSQL); - //m_value = null; // force re-display - //actionButton(m_text.getText()); - //return r; - } - log.fine("Unique ID=" + id); - - } // actionText - - /** - * Generate Access SQL for Search. - * The SQL returns the ID of the value entered - * Also sets m_tableName and m_keyColumnName - * @param text uppercase text for LIKE comparison - * @return sql or "" - * Example - * SELECT C_Payment_ID FROM C_Payment WHERE UPPER(DocumentNo) LIKE x OR ... - */ - @SuppressWarnings("unused") - private String getDirectAccessSQL (String text) - { - //Tutaj trzeba doda� dodatkowe pole dla odpowiednich typ�w wyszukiwania w selectach - StringBuffer sql = new StringBuffer(); - m_tableName = m_columnName.substring(0, m_columnName.length()-3); // without _ID - m_keyColumnName = m_columnName; - if (m_columnName.equals("C_Invoice_ID")) - { - sql.append("SELECT C_Invoice_ID, DocumentNo FROM C_Invoice WHERE UPPER(DocumentNo) LIKE ") - .append(DB.TO_STRING(text)); - } - else if (m_columnName.equals("M_InOut_ID")) - { - sql.append("SELECT M_InOut_ID, '' FROM M_InOut WHERE UPPER(DocumentNo) LIKE ") - .append(DB.TO_STRING(text)); - } - else if (m_columnName.equals("C_Payment_ID")) - { - sql.append("SELECT C_Payment_ID, DocumentNo FROM C_Payment WHERE UPPER(DocumentNo) LIKE ") - .append(DB.TO_STRING(text)); - } - else if (m_columnName.equals("GL_JournalBatch_ID")) - { - sql.append("SELECT GL_JournalBatch_ID, '' FROM GL_JournalBatch WHERE UPPER(DocumentNo) LIKE ") - .append(DB.TO_STRING(text)); - } - else if (m_columnName.equals("SalesRep_ID")) - { - sql.append("SELECT AD_User_ID, NAME FROM AD_User WHERE UPPER(Name) LIKE ") - .append(DB.TO_STRING(text)); - m_tableName = "AD_User"; - m_keyColumnName = "AD_User_ID"; - } - - // Predefined - if (sql.length() > 0) - { - String wc = getWhereClause(); - if (wc != null && wc.length() > 0) - sql.append(" AND ").append(wc); - sql.append(" AND IsActive='Y'"); - - if (DB.isOracle()) - sql.append(" AND ROWNUM < "+MAX_PRODUCT_ROWS+" "); - // *** - //log.finest("(predefined) " + sql.toString()); - - String sqlret = MRole.getDefault().addAccessSQL(sql.toString(), - m_tableName, MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); - - if (DB.isPostgreSQL()) - sqlret = sqlret + " LIMIT "+MAX_PRODUCT_ROWS; - - return sqlret; - } - - // Check if it is a Table Reference - // TODO dorobic obsluge where z ad_ref_table !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - if (m_lookup != null && m_lookup instanceof MLookup) - { - int AD_Reference_ID = ((MLookup)m_lookup).getAD_Reference_Value_ID(); - if (AD_Reference_ID != 0) - { - String query = "SELECT kc.ColumnName, dc.ColumnName, t.TableName " - + "FROM AD_Ref_Table rt" - + " INNER JOIN AD_Column kc ON (rt.AD_Key=kc.AD_Column_ID)" - + " INNER JOIN AD_Column dc ON (rt.AD_Display=dc.AD_Column_ID)" - + " INNER JOIN AD_Table t ON (rt.AD_Table_ID=t.AD_Table_ID) " - + "WHERE rt.AD_Reference_ID=?"; - String displayColumnName = null; - PreparedStatement pstmt = null; - try - { - pstmt = DB.prepareStatement(query, null); - pstmt.setInt(1, AD_Reference_ID); - ResultSet rs = pstmt.executeQuery(); - if (rs.next()) - { - m_keyColumnName = rs.getString(1); - displayColumnName = rs.getString(2); - m_tableName = rs.getString(3); - } - rs.close(); - pstmt.close(); - pstmt = null; - } - catch (Exception e) - { - //log.log(Level.SEVERE, "getDirectAccessSQL", e); - } - try - { - if (pstmt != null) - pstmt.close(); - pstmt = null; - } - catch (Exception e) - { - pstmt = null; - } - if (displayColumnName != null) - { - sql = new StringBuffer(); - sql.append("SELECT ").append(m_keyColumnName).append(", "+displayColumnName) // kolec - bylo m_displayColumnName - .append(" FROM ").append(m_tableName) - .append(" WHERE UPPER(").append(displayColumnName) - .append(") LIKE ").append(DB.TO_STRING(text)) - .append(" AND IsActive='Y'"); - - if (DB.isOracle()) - sql.append(" AND ROWNUM < "+MAX_PRODUCT_ROWS+" "); - String wc = getWhereClause(); - if (wc != null && wc.length() > 0) - sql.append(" AND ").append(wc); - // *** - //log.finest("(Table) " + sql.toString()); - - String sqlret = MRole.getDefault().addAccessSQL(sql.toString(), - m_tableName, MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); - - if (DB.isPostgreSQL()) - sqlret = sqlret + " LIMIT "+MAX_PRODUCT_ROWS; - - return sqlret; - } - } // Table Reference - } // MLookup - - /** Check Well Known Columns of Table - assumes TableDir **/ - String query = "SELECT t.TableName, c.ColumnName " - + "FROM AD_Column c " - + " INNER JOIN AD_Table t ON (c.AD_Table_ID=t.AD_Table_ID AND t.IsView='N') " - + "WHERE (c.ColumnName IN ('DocumentNo', 'Value', 'Name') OR c.IsIdentifier='Y')" - + " AND c.AD_Reference_ID IN (10,14)" - + " AND EXISTS (SELECT * FROM AD_Column cc WHERE cc.AD_Table_ID=t.AD_Table_ID" - + " AND cc.IsKey='Y' AND cc.ColumnName=?)"; - m_keyColumnName = m_columnName; - sql = new StringBuffer(); - PreparedStatement pstmt = null; - try - { - pstmt = DB.prepareStatement(query, null); - pstmt.setString(1, m_keyColumnName); - ResultSet rs = pstmt.executeQuery(); - while (rs.next()) - { - if (sql.length() != 0) - sql.append(" OR "); - m_tableName = rs.getString(1); - sql.append("UPPER(").append(rs.getString(2)).append(") LIKE ").append(DB.TO_STRING(text)); - } - rs.close(); - pstmt.close(); - pstmt = null; - } - catch (SQLException ex) - { - log.log(Level.SEVERE, "getDirectAccessSQL", ex); - } - try - { - if (pstmt != null) - pstmt.close(); - } - catch (SQLException ex1) - { - } - pstmt = null; - // - if (sql.length() == 0) - { - log.log(Level.SEVERE, "(TableDir) - no standard/identifier columns"); - return ""; - } - // - StringBuffer retValue = new StringBuffer ("SELECT ") - .append(m_columnName).append(" , NAME").append(" FROM ").append(m_tableName) - .append(" WHERE ").append(sql) - .append(" AND IsActive='Y' "); - - if (DB.isOracle()) - retValue.append(" AND ROWNUM < "+MAX_PRODUCT_ROWS+" "); - String wc = getWhereClause(); - if (wc != null && wc.length() > 0) - retValue.append(" AND ").append(wc); - // *** - log.finest("(TableDir) " + sql.toString()); - - String sqlret = MRole.getDefault().addAccessSQL(retValue.toString(), - m_tableName, MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); - - if (DB.isPostgreSQL()) - sqlret = sqlret + " LIMIT "+MAX_PRODUCT_ROWS; - - return sqlret; - } // getDirectAccessSQL - - /** - * Get Where Clause - * @return where clause or "" - */ - private String getWhereClause() - { - String whereClause = ""; - if (m_lookup == null) - return ""; - if (m_lookup.getZoomQuery() != null) - whereClause = m_lookup.getZoomQuery().getWhereClause(); - String validation = m_lookup.getValidation(); - if (whereClause.length() == 0) - whereClause = validation; - else - if (validation.length()>0) // kolec - whereClause += " AND " + validation; - // log.finest("ZoomQuery=" + (m_lookup.getZoomQuery()==null ? "" : m_lookup.getZoomQuery().getWhereClause()) - // + ", Validation=" + m_lookup.getValidation()); - if (whereClause.indexOf('@') != -1) - { - String validated = Env.parseContext(wsc.ctx, m_lookup.getWindowNo(), whereClause, false); - if (validated.length() == 0) - log.severe("Cannot Parse=" + whereClause); - else - { - log.fine("Parsed: " + validated); - return validated; - } - } - return whereClause; - } // getWhereClause - - - - - - public static void fillLookupValues( LookupValues lvs, KeyNamePair[] kp ) - { - if (kp!=null && lvs != null) - for (int i=0; i 0) - { - int x = -1; - for (int i=0; i 0) - { - KeyNamePair[] orgs = login.getOrgs(clients[0]); - // load org - if (orgs != null && orgs.length > 0) - { - KeyNamePair[] whs = login.getWarehouses(orgs[0]); - // - login.loadPreferences(orgs[0], null, null, null); - } - } - } - // - Env.setContext(ctx, "#Date", "2006-01-26"); - // logger.exiting("Env", "initTest"); - return ctx; - } // testInit - */ - - - /** * Check Login information and set context. * @returns true if login info are OK diff --git a/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/CompiereUtil.java b/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/CompiereUtil.java index dad7c4dd04..d92153c7a6 100644 --- a/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/CompiereUtil.java +++ b/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/CompiereUtil.java @@ -20,7 +20,6 @@ public class CompiereUtil { { if (s_initOK) { - //log.info(context.getServletContextName()); return true; } @@ -44,7 +43,6 @@ public class CompiereUtil { return false; // Logging now initiated - //log.info(info.toString()); // Properties ctx = new Properties(); @@ -53,11 +51,6 @@ public class CompiereUtil { @SuppressWarnings("unused") MSystem system = MSystem.get(ctx); - // Env.setContext( ctx, "#AD_Language", "pl_PL" ); - //client.sendEMail(client.getRequestEMail(), - // "Server started: " + system.getName() - // ,"ServerInfo: " + context.getServerInfo() - //); return s_initOK; } diff --git a/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/InfoBPartner.java b/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/InfoBPartner.java deleted file mode 100644 index 6aef6f1360..0000000000 --- a/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/InfoBPartner.java +++ /dev/null @@ -1,312 +0,0 @@ -package org.idempiere.adinterface; - -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.util.ArrayList; - -import org.compiere.model.MRole; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -import org.idempiere.adInterface.x10.DataField; -import org.idempiere.adInterface.x10.DataRow; - - -public class InfoBPartner implements ADInfo { - - private static String s_partnerFROM = "C_BPartner" - + " LEFT OUTER JOIN C_BPartner_Location l ON (C_BPartner.C_BPartner_ID=l.C_BPartner_ID AND l.IsActive='Y')" - + " LEFT OUTER JOIN AD_User c ON (C_BPartner.C_BPartner_ID=c.C_BPartner_ID AND (c.C_BPartner_Location_ID IS NULL OR c.C_BPartner_Location_ID=l.C_BPartner_Location_ID) AND c.IsActive='Y')" - + " LEFT OUTER JOIN C_Location a ON (l.C_Location_ID=a.C_Location_ID)"; - - private DataRow params; - private boolean m_isSOTrx = true; - private String m_tableName = "C_BPartner"; - - public InfoBPartner(DataRow dr, String whereClause) { - params = dr; - m_isSOTrx = true; // TODO - - StringBuilder where = new StringBuilder(); - where.append("C_BPartner.IsSummary='N' AND C_BPartner.IsActive='Y'"); - if (whereClause != null && whereClause.length() > 0) - where.append(" AND ").append(whereClause); - - prepareTable(s_partnerFROM, where.toString(), "C_BPartner.Value"); - - setupParamsFromDataRow(); - } - - void setupParamsFromDataRow() { - for (int i=0; i< params.sizeOfFieldArray(); i++) { - DataField f = params.getFieldArray(i); - System.out.println(f.getColumn() +" - '"+f.getVal()+"'"); - if ("value".equalsIgnoreCase(f.getColumn())) fieldValue = f.getVal(); - if ("name".equalsIgnoreCase(f.getColumn())) fieldName = f.getVal(); - if ("contact".equalsIgnoreCase(f.getColumn())) fieldContact = f.getVal(); - if ("checkCustomer".equalsIgnoreCase(f.getColumn())) checkCustomer = "Y".equalsIgnoreCase(f.getVal()); - if ("checkAND".equalsIgnoreCase(f.getColumn())) checkAND = "Y".equalsIgnoreCase(f.getVal()); - } - } - - String fieldValue = ""; - String fieldName = ""; - String fieldContact = ""; - String fieldEMail = ""; - String fieldPhone = ""; - - String fieldPostal = ""; - boolean checkAND = false; - boolean checkCustomer = false; - - - - protected CLogger log = CLogger.getCLogger(getClass()); - - - - public String getSQLWhere() - { - ArrayList list = new ArrayList(); - // => Value - String value = fieldValue.toUpperCase(); - if (!(value.equals("") || value.equals("%"))) - list.add ("UPPER(C_BPartner.Value) LIKE ?"); - // => Name - String name = fieldName.toUpperCase(); - if (!(name.equals("") || name.equals("%"))) - list.add ("UPPER(C_BPartner.Name) LIKE ?"); - // => Contact - String contact = fieldContact.toUpperCase(); - if (!(contact.equals("") || contact.equals("%"))) - list.add ("UPPER(c.Name) LIKE ?"); - // => EMail - String email = fieldEMail.toUpperCase(); - if (!(email.equals("") || email.equals("%"))) - list.add ("UPPER(c.EMail) LIKE ?"); - // => Phone - String phone = fieldPhone.toUpperCase(); - if (!(phone.equals("") || phone.equals("%"))) - list.add ("UPPER(c.Phone) LIKE ?"); - // => Postal - String postal = fieldPostal.toUpperCase(); - if (!(postal.equals("") || postal.equals("%"))) - list.add ("UPPER(a.Postal) LIKE ?"); - - StringBuilder sql = new StringBuilder(); - int size = list.size(); - // Just one - if (size == 1) - sql.append(" AND ").append(list.get(0)); - else if (size > 1) - { - boolean AND = checkAND; - sql.append(" AND "); - if (!AND) - sql.append("("); - for (int i = 0; i < size; i++) - { - if (i > 0) - sql.append(AND ? " AND " : " OR "); - sql.append(list.get(i)); - } - if (!AND) - sql.append(")"); - } - - // Static SQL - if (checkCustomer) - { - sql.append(" AND "); - if (m_isSOTrx) - sql.append ("C_BPartner.IsCustomer='Y'"); - else - sql.append ("C_BPartner.IsVendor='Y'"); - } - System.out.println( sql.toString() ); - return sql.toString(); - } // getSQLWhere - - - - public void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException - { - int index = 1; - // => Value - String value = fieldValue.toUpperCase(); - if (!(value.equals("") || value.equals("%"))) - { - if (!value.endsWith("%")) - value += "%"; - pstmt.setString(index++, value); - log.fine("Value: " + value); - } - // => Name - String name = fieldName.toUpperCase(); - if (!(name.equals("") || name.equals("%"))) - { - if (!name.endsWith("%")) - name += "%"; - pstmt.setString(index++, name); - log.fine("Name: " + name); - } - // => Contact - String contact = fieldContact.toUpperCase(); - if (!(contact.equals("") || contact.equals("%"))) - { - if (!contact.endsWith("%")) - contact += "%"; - pstmt.setString(index++, contact); - log.fine("Contact: " + contact); - } - // => EMail - String email = fieldEMail.toUpperCase(); - if (!(email.equals("") || email.equals("%"))) - { - if (!email.endsWith("%")) - email += "%"; - pstmt.setString(index++, email); - log.fine("EMail: " + email); - } - // => Phone - String phone = fieldPhone.toUpperCase(); - if (!(phone.equals("") || phone.equals("%"))) - { - if (!phone.endsWith("%")) - phone += "%"; - pstmt.setString(index++, phone); - log.fine("Phone: " + phone); - } - // => Postal - String postal = fieldPostal.toUpperCase(); - if (!(postal.equals("") || postal.equals("%"))) - { - if (!postal.endsWith("%")) - postal += "%"; - pstmt.setString(index++, postal); - log.fine("Postal: " + postal); - } - } // setParameters - - String m_sqlMain = ""; - String m_sqlCount = ""; - String m_sqlOrder = ""; - - - protected void prepareTable ( String from, String staticWhere, String orderBy) - { - - StringBuilder sql = new StringBuilder ("SELECT "); - // add columns & sql - sql.append( " C_BPartner.C_BPartner_ID, C_BPartner.Value, C_BPartner.Name, c.Name AS Contact, " ); - sql.append( " C_BPartner.SO_CreditLimit-C_BPartner.SO_CreditUsed AS SO_CreditAvailable, "); - sql.append( " C_BPartner.SO_CreditUsed, c.Phone, a.Postal, a.City, C_BPartner.TotalOpenBalance, C_BPartner.ActualLifetimeValue "); - - sql.append( " FROM ").append(from); - // - sql.append(" WHERE ").append(staticWhere); - m_sqlMain = sql.toString(); - m_sqlCount = "SELECT COUNT(*) FROM " + from + " WHERE " + staticWhere; - // - m_sqlOrder = ""; - if (orderBy != null && orderBy.length() > 0) - m_sqlOrder = " ORDER BY " + orderBy; - - //if (m_keyColumnIndex == -1) - // log.log(Level.SEVERE, "No KeyColumn - " + sql); - - } // prepareTable - - - public DataRow getColumns() { - DataRow col = DataRow.Factory.newInstance(); - DataField f = null; - - f = col.addNewField(); //0 - f.setType("int"); - f.setColumn("key" ); - f.setLval("20,0"); - - f = col.addNewField(); //1 - f.setType("string"); - f.setColumn("value" ); - f.setLval("20,100"); - - f = col.addNewField(); //2 - f.setType("string"); - f.setColumn("name" ); - f.setLval("20, 140"); - - f = col.addNewField(); //3 - f.setType("string"); - f.setColumn("contact" ); - f.setLval("20, 70"); - - f = col.addNewField(); //4 - f.setType("string"); - f.setColumn("SO_CreditAvailable" ); - f.setLval("20, 50"); - - f = col.addNewField(); //5 - f.setType("string"); - f.setColumn("SO_CreditUsed" ); - f.setLval("20, 40"); - - f = col.addNewField(); //6 - f.setType("string"); - f.setColumn("Phone" ); - f.setLval("20,50"); - - f = col.addNewField(); //7 - f.setType("string"); - f.setColumn("Postal" ); - f.setLval("20, 40"); - - f = col.addNewField(); //8 - f.setType("string"); - f.setColumn("City" ); - f.setLval("20, 50"); - - f = col.addNewField(); //9 - f.setType("string"); - f.setColumn("TotalOpenBalance" ); - f.setLval("10,50"); - - f = col.addNewField(); //10 - f.setType("string"); - f.setColumn("ActualLifetimeValue" ); - f.setLval("10,50"); - - return col; - } - - - public String getSQL() { - String dynWhere = getSQLWhere(); - StringBuilder sql = new StringBuilder (m_sqlMain); - if (dynWhere.length() > 0) - sql.append(dynWhere); // includes first AND - sql.append(m_sqlOrder); - String dataSql = Msg.parseTranslation(Env.getCtx(), sql.toString()); // Variables - dataSql = MRole.getDefault().addAccessSQL(dataSql, m_tableName, - MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO); - - return dataSql; - } - - public String getSQLCount() { - String dynWhere = getSQLWhere(); - StringBuilder sql = new StringBuilder (m_sqlCount); - if (dynWhere.length() > 0) - sql.append(dynWhere); // includes first AND - String countSql = Msg.parseTranslation(Env.getCtx(), sql.toString()); // Variables - countSql = MRole.getDefault().addAccessSQL(countSql, m_tableName, - MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO); - //log.finer(countSql); - - return countSql; - - } - -} diff --git a/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/InfoProduct.java b/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/InfoProduct.java deleted file mode 100644 index 0d9cac450b..0000000000 --- a/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/InfoProduct.java +++ /dev/null @@ -1,473 +0,0 @@ -package org.idempiere.adinterface; - -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Properties; -import java.util.logging.Level; - -import org.compiere.minigrid.IDColumn; -import org.compiere.model.MRole; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Msg; - -import org.idempiere.adInterface.x10.DataField; -import org.idempiere.adInterface.x10.DataRow; - - -public class InfoProduct implements ADInfo { - - private static final String s_productFrom = - "M_Product p" - + " LEFT OUTER JOIN M_ProductPrice pr ON (p.M_Product_ID=pr.M_Product_ID AND pr.IsActive='Y')" - + " LEFT OUTER JOIN M_AttributeSet pa ON (p.M_AttributeSet_ID=pa.M_AttributeSet_ID)"; - - private DataRow params; - //private boolean m_isSOTrx = true; - //private String m_tableName = "M_Product"; - - Properties m_ctx; - int p_WindowNo; - - public InfoProduct(DataRow dr, String whereClause, Properties ctx, int WindowNo) { - params = dr; - m_ctx = ctx; - p_WindowNo = WindowNo; - - this.getProductLayout(); - - this.M_PriceList_ID = Env.getContextAsInt( m_ctx, "#M_PriceList_ID"); - - M_PriceList_Version_ID = findPLV (M_PriceList_ID); -/* // Set Value or Name - if (value.startsWith("@") && value.endsWith("@")) - fieldName.setText(value.substring(1,value.length()-1)); - else - fieldValue.setText(value); - // Set Warehouse - if (M_Warehouse_ID == 0) - M_Warehouse_ID = Env.getContextAsInt(Env.getCtx(), "#M_Warehouse_ID"); - - //fillPicks(M_PriceList_ID); - int M_PriceList_Version_ID = 0; //findPLV (M_PriceList_ID); - // Set Value or Name -*/ - // Set Warehouse // TODO - if (M_Warehouse_ID == 0) - M_Warehouse_ID = Env.getContextAsInt( m_ctx, "#M_Warehouse_ID"); - - //if (M_Warehouse_ID != 0) - // setWarehouse (M_Warehouse_ID); - // Set PriceList Version - //if (M_PriceList_Version_ID != 0) - // setPriceListVersion (M_PriceList_Version_ID); - - // Create Grid - StringBuilder where = new StringBuilder(); - where.append("p.IsActive='Y'"); - if (M_Warehouse_ID != 0) - where.append(" AND p.IsSummary='N'"); - // dynamic Where Clause - //if (p_whereClause != null && p_whereClause.length() > 0) - // where.append(" AND ") // replace fully qalified name with alias - // .append(Util.replace(p_whereClause, "M_Product.", "p.")); - // - - prepareTable(s_productFrom, where.toString(), "QtyAvailable DESC, Margin DESC" ); - - setupParamsFromDataRow(); - } - - void setupParamsFromDataRow() { - for (int i=0; i< params.sizeOfFieldArray(); i++) { - DataField f = params.getFieldArray(i); - System.out.println(f.getColumn() +" - '"+f.getVal()+"'"); - if ("value".equalsIgnoreCase(f.getColumn())) fieldValue = f.getVal(); - if ("name".equalsIgnoreCase(f.getColumn())) fieldName = f.getVal(); - if ("name".equalsIgnoreCase(f.getColumn())) fieldName = f.getVal(); - if ("upc".equalsIgnoreCase(f.getColumn())) fieldUPC = f.getVal(); - if ("upc".equalsIgnoreCase(f.getColumn())) fieldUPC = f.getVal(); - if ("sku".equalsIgnoreCase(f.getColumn())) fieldSKU = f.getVal(); - if ("M_PriceList_Version_ID".equalsIgnoreCase(f.getColumn())) M_PriceList_Version_ID = Integer.parseInt(f.getVal()); - if ("M_Warehouse_ID".equalsIgnoreCase(f.getColumn())) M_Warehouse_ID = Integer.parseInt(f.getVal()); - } - } - - - protected CLogger log = CLogger.getCLogger(getClass()); - - String m_pAttributeWhere = null; - String fieldValue =""; - String fieldName =""; - String fieldUPC =""; - String fieldSKU =""; - //int M_PriceList_Version_ID = 1000037; //104; - //int M_Warehouse_ID = 1000001; //103; - //int M_PriceList_ID = 1000022; //101 - int M_PriceList_Version_ID = 104; - int M_Warehouse_ID = 103; - int M_PriceList_ID = 101; - - String getSQLWhere() { - StringBuilder where = new StringBuilder(); - - // Optional PLV - //int M_PriceList_Version_ID = 0; - if (M_PriceList_Version_ID != 0) - where.append(" AND pr.M_PriceList_Version_ID=?"); - - // Product Attribute Search - if (m_pAttributeWhere != null) - { - where.append(m_pAttributeWhere); - return where.toString(); - } - - // => Value - String value = fieldValue.toUpperCase(); - if (!(value.equals("") || value.equals("%"))) { - where.append(" AND UPPER(p.Value) LIKE ?"); - } - - // => Name - String name = fieldName.toUpperCase(); - if (!(name.equals("") || name.equals("%"))) - where.append(" AND UPPER(p.Name) LIKE ?"); - - // => UPC - String upc = fieldUPC.toUpperCase(); - if (!(upc.equals("") || upc.equals("%"))) - where.append(" AND UPPER(p.UPC) LIKE ?"); - - // => SKU - String sku = fieldSKU.toUpperCase(); - if (!(sku.equals("") || sku.equals("%"))) - where.append(" AND UPPER(p.SKU) LIKE ?"); - - return where.toString(); - } // getSQLWhere - - /** - * Set Parameters for Query - * (as defined in getSQLWhere) - * - * @param pstmt pstmt - * @param forCount for counting records - * @throws SQLException - */ - public void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException - { - int index = 1; - - //M_Warehouse_ID = 103; - //this.M_PriceList_Version_ID = 104; - //this.M_PriceList_ID = 101; - - //fieldValue = "%tree%"; - - // => Warehouse - //int M_Warehouse_ID = 0; - if (!forCount) // parameters in select - { - for (int i = 0; i < s_productLayout.length; i++) - { - if (s_productLayout[i].getColSQL().indexOf("?") != -1) - pstmt.setInt(index++, M_Warehouse_ID); - } - } - log.fine("M_Warehouse_ID=" + M_Warehouse_ID + " (" + (index-1) + "*)"); - - // => PriceList - //int M_PriceList_Version_ID = 0; - - if (M_PriceList_Version_ID != 0) - { - pstmt.setInt(index++, M_PriceList_Version_ID); - log.fine("M_PriceList_Version_ID=" + M_PriceList_Version_ID); - } - // Rest of Parameter in Query for Attribute Search - if (m_pAttributeWhere != null) - return; - - // => Value - String value = fieldValue.toUpperCase(); - if (!(value.equals("") || value.equals("%"))) - { - if (!value.endsWith("%")) - value += "%"; - pstmt.setString(index++, value); - log.fine("Value: " + value); - } - - // => Name - String name = fieldName.toUpperCase(); - if (!(name.equals("") || name.equals("%"))) - { - if (!name.endsWith("%")) - name += "%"; - pstmt.setString(index++, name); - log.fine("Name: " + name); - } - - // => UPC - String upc = fieldUPC.toUpperCase(); - if (!(upc.equals("") || upc.equals("%"))) - { - if (!upc.endsWith("%")) - upc += "%"; - pstmt.setString(index++, upc); - log.fine("UPC: " + upc); - } - - // => SKU - String sku = fieldSKU.toUpperCase(); - if (!(sku.equals("") || sku.equals("%"))) - { - if (!sku.endsWith("%")) - sku += "%"; - pstmt.setString(index++, sku); - log.fine("SKU: " + sku); - } - - } // setParameters - - - String m_sqlMain = ""; - String m_sqlCount = ""; - String m_sqlOrder = ""; - - int m_keyColumnIndex = -1; - - protected void prepareTable ( String from, String staticWhere, String orderBy) - { - - StringBuilder sql = new StringBuilder ("SELECT "); - - for (int i = 0; i < s_productLayout.length; i++) - { - if (i > 0) - sql.append(", "); - sql.append(s_productLayout[i].getColSQL()); - // adding ID column - if (s_productLayout[i].isIDcol()) - sql.append(",").append(s_productLayout[i].getIDcolSQL()); - // add to model - //p_table.addColumn(s_productLayout[i].getColHeader()); - //if (s_productLayout[i].isColorColumn()) - //p_table.setColorColumn(i); - if (s_productLayout[i].getColClass() == IDColumn.class) - m_keyColumnIndex = i; - } - - sql.append( " FROM ").append(from); - // - sql.append(" WHERE ").append(staticWhere); - m_sqlMain = sql.toString(); - m_sqlCount = "SELECT COUNT(*) FROM " + from + " WHERE " + staticWhere; - // - m_sqlOrder = ""; - if (orderBy != null && orderBy.length() > 0) - m_sqlOrder = " ORDER BY " + orderBy; - - //if (m_keyColumnIndex == -1) - // log.log(Level.SEVERE, "No KeyColumn - " + sql); - - } // prepareTable - - - Info_Column[] s_productLayout = null; - - private Info_Column[] getProductLayout() { - ArrayList list = new ArrayList(); - list.add(new Info_Column(" ", "p.M_Product_ID", IDColumn.class)); - list.add(new Info_Column(Msg.translate(Env.getCtx(), "Discontinued").substring(0, 1), "p.Discontinued", Boolean.class)); - list.add(new Info_Column(Msg.translate(Env.getCtx(), "Value"), "p.Value", String.class)); - list.add(new Info_Column(Msg.translate(Env.getCtx(), "Name"), "p.Name", String.class)); - list.add(new Info_Column(Msg.translate(Env.getCtx(), "QtyAvailable"), "bomQtyAvailable(p.M_Product_ID,?,0) AS QtyAvailable", Double.class, true, true, null)); - list.add(new Info_Column(Msg.translate(Env.getCtx(), "PriceList"), "bomPriceList(p.M_Product_ID, pr.M_PriceList_Version_ID) AS PriceList", BigDecimal.class)); - list.add(new Info_Column(Msg.translate(Env.getCtx(), "PriceStd"), "bomPriceStd(p.M_Product_ID, pr.M_PriceList_Version_ID) AS PriceStd", BigDecimal.class)); - list.add(new Info_Column(Msg.translate(Env.getCtx(), "QtyOnHand"), "bomQtyOnHand(p.M_Product_ID,?,0) AS QtyOnHand", Double.class)); - list.add(new Info_Column(Msg.translate(Env.getCtx(), "QtyReserved"), "bomQtyReserved(p.M_Product_ID,?,0) AS QtyReserved", Double.class)); - list.add(new Info_Column(Msg.translate(Env.getCtx(), "QtyOrdered"), "bomQtyOrdered(p.M_Product_ID,?,0) AS QtyOrdered", Double.class)); - /*if (isUnconfirmed()) - { - list.add(new Info_Column(Msg.translate(Env.getCtx(), "QtyUnconfirmed"), "(SELECT SUM(c.TargetQty) FROM M_InOutLineConfirm c INNER JOIN M_InOutLine il ON (c.M_InOutLine_ID=il.M_InOutLine_ID) INNER JOIN M_InOut i ON (il.M_InOut_ID=i.M_InOut_ID) WHERE c.Processed='N' AND i.M_Warehouse_ID=? AND il.M_Product_ID=p.M_Product_ID) AS QtyUnconfirmed", Double.class)); - list.add(new Info_Column(Msg.translate(Env.getCtx(), "QtyUnconfirmedMove"), "(SELECT SUM(c.TargetQty) FROM M_MovementLineConfirm c INNER JOIN M_MovementLine ml ON (c.M_MovementLine_ID=ml.M_MovementLine_ID) INNER JOIN M_Locator l ON (ml.M_LocatorTo_ID=l.M_Locator_ID) WHERE c.Processed='N' AND l.M_Warehouse_ID=? AND ml.M_Product_ID=p.M_Product_ID) AS QtyUnconfirmedMove", Double.class)); - }*/ - list.add(new Info_Column(Msg.translate(Env.getCtx(), "Margin"), "bomPriceStd(p.M_Product_ID, pr.M_PriceList_Version_ID)-bomPriceLimit(p.M_Product_ID, pr.M_PriceList_Version_ID) AS Margin", BigDecimal.class)); - list.add(new Info_Column(Msg.translate(Env.getCtx(), "PriceLimit"), "bomPriceLimit(p.M_Product_ID, pr.M_PriceList_Version_ID) AS PriceLimit", BigDecimal.class)); - list.add(new Info_Column(Msg.translate(Env.getCtx(), "IsInstanceAttribute"), "pa.IsInstanceAttribute", Boolean.class)); - s_productLayout = new Info_Column[list.size()]; - list.toArray(s_productLayout); - //INDEX_NAME = 3; - //INDEX_PATTRIBUTE = s_productLayout.length - 1; // last item - return s_productLayout; - - } - - public DataRow getColumns() { - DataRow col = DataRow.Factory.newInstance(); - DataField f = null; - f = col.addNewField(); //0 - f.setType("int"); - f.setLval("20, 0"); - f.setColumn("key" ); - - f = col.addNewField(); //1 - f.setType("string"); - f.setLval("1, 15"); - f.setColumn("Discontinued" ); - - f = col.addNewField(); //2 - f.setType("string"); - f.setLval("40, 110"); - f.setColumn("Value" ); - - f = col.addNewField(); //3 - f.setType("string"); - f.setLval("60, 140"); - f.setColumn("Name" ); - - f = col.addNewField(); //4 - f.setType("string"); - f.setLval("10, 50"); - f.setColumn("QtyAvailable" ); - - f = col.addNewField(); //5 - f.setType("string"); - f.setLval("10, 50"); - f.setColumn("PriceList" ); - - f = col.addNewField(); //6 - f.setType("string"); - f.setLval("10, 50"); - f.setColumn("PriceStd" ); - - f = col.addNewField(); //7 - f.setType("string"); - f.setLval("10, 50"); - f.setColumn("QtyOnHand" ); - - f = col.addNewField(); //8 - f.setType("string"); - f.setLval("10, 50"); - f.setColumn("QtyReserved" ); - - f = col.addNewField(); //9 - f.setType("string"); - f.setLval("10, 50"); - f.setColumn("QtyOrdered" ); - - f = col.addNewField(); //10 - f.setType("string"); - f.setLval("10, 50"); - f.setColumn("Margin" ); - - f = col.addNewField(); //10 - f.setType("string"); - f.setLval("10, 50"); - f.setColumn("PriceLimit" ); - - f = col.addNewField(); //10 - f.setType("string"); - f.setLval("1, 20"); - f.setColumn("IsInstanceAttribute" ); - - - return col; - } - - - public String getSQL() { - String dynWhere = getSQLWhere(); - StringBuilder sql = new StringBuilder (m_sqlMain); - if (dynWhere.length() > 0) - sql.append(dynWhere); // includes first AND - - sql.append(m_sqlOrder); - - System.out.println( "GetSQL = "+sql.toString()); - String dataSql = Msg.parseTranslation(Env.getCtx(), sql.toString()); // Variables - dataSql = MRole.getDefault().addAccessSQL(dataSql, "p", - MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO); - - return dataSql; - } - - public String getSQLCount() { - String dynWhere = getSQLWhere(); - StringBuilder sql = new StringBuilder (m_sqlCount); - if (dynWhere.length() > 0) - sql.append(dynWhere); // includes first AND - - String countSql = Msg.parseTranslation(Env.getCtx(), sql.toString()); // Variables - countSql = MRole.getDefault().addAccessSQL(countSql, "p", - MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO); - //log.finer(countSql); - - - return countSql; - - } - - /** - * Find Price List Version and update context - * - * @param M_PriceList_ID price list - * @return M_PriceList_Version_ID price list version - */ - private int findPLV (int M_PriceList_ID) - { - Timestamp priceDate = null; - // Sales Order Date - String dateStr = Env.getContext(m_ctx, p_WindowNo, "DateOrdered"); - if (dateStr != null && dateStr.length() > 0) - priceDate = Env.getContextAsDate( m_ctx, p_WindowNo, "DateOrdered"); - else // Invoice Date - { - dateStr = Env.getContext(m_ctx, p_WindowNo, "DateInvoiced"); - if (dateStr != null && dateStr.length() > 0) - priceDate = Env.getContextAsDate(m_ctx, p_WindowNo, "DateInvoiced"); - } - // Today - if (priceDate == null) - priceDate = new Timestamp(System.currentTimeMillis()); - // - log.config("M_PriceList_ID=" + M_PriceList_ID + " - " + priceDate); - int retValue = 0; - String sql = "SELECT plv.M_PriceList_Version_ID, plv.ValidFrom " - + "FROM M_PriceList pl, M_PriceList_Version plv " - + "WHERE pl.M_PriceList_ID=plv.M_PriceList_ID" - + " AND plv.IsActive='Y'" - + " AND pl.M_PriceList_ID=? " // 1 - + "ORDER BY plv.ValidFrom DESC"; - // find newest one - try - { - PreparedStatement pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, M_PriceList_ID); - ResultSet rs = pstmt.executeQuery(); - while (rs.next() && retValue == 0) - { - Timestamp plDate = rs.getTimestamp(2); - if (!priceDate.before(plDate)) - retValue = rs.getInt(1); - } - rs.close(); - pstmt.close(); - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - } - Env.setContext(m_ctx, p_WindowNo, "M_PriceList_Version_ID", retValue); - return retValue; - } // findPLV - - -} diff --git a/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/Info_Column.java b/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/Info_Column.java deleted file mode 100644 index 3d79ace50f..0000000000 --- a/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/Info_Column.java +++ /dev/null @@ -1,143 +0,0 @@ -/****************************************************************************** - * The contents of this file are subject to the Compiere License Version 1.1 - * ("License"); You may not use this file except in compliance with the License - * You may obtain a copy of the License at http://www.compiere.org/license.html - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for - * the specific language governing rights and limitations under the License. - * The Original Code is Compiere ERP & CRM Smart Business Solution. The Initial - * Developer of the Original Code is Jorg Janke. Portions created by Jorg Janke - * are Copyright (C) 1999-2005 Jorg Janke. - * All parts are Copyright (C) 1999-2005 ComPiere, Inc. All Rights Reserved. - * Contributor(s): ______________________________________. - *****************************************************************************/ -package org.idempiere.adinterface; - -/** - * Info Column Details - * - * @author Jorg Janke - * @version $Id: Info_Column.java,v 1.7 2005/12/17 19:55:47 jjanke Exp $ - */ -public class Info_Column -{ - /** - * Create Info Column (r/o and not color column) - * - * @param colHeader Column Header - * @param colSQL SQL select code for column - * @param colClass class of column - determines display - */ - public Info_Column (String colHeader, String colSQL, Class colClass) - { - this(colHeader, colSQL, colClass, true, false, null); - } // Info_Column - - /** - * Create Info Column (r/o and not color column) - * - * @param colHeader Column Header - * @param colSQL SQL select code for column - * @param colClass class of column - determines display - * @param IDcolSQL SQL select for the ID of the for the displayed column (KeyNamePair) - */ - public Info_Column (String colHeader, String colSQL, Class colClass, String IDcolSQL) - { - this(colHeader, colSQL, colClass, true, false, IDcolSQL); - } // Info_Column - - /** - * Create Info Column - * - * @param colHeader Column Header - * @param colSQL SQL select code for column - * @param colClass class of column - determines display - * @param readOnly column is read only - * @param colorColumn if true, value of column determines foreground color - * @param IDcolSQL SQL select for the ID of the for the displayed column - */ - public Info_Column (String colHeader, String colSQL, Class colClass, - boolean readOnly, boolean colorColumn, String IDcolSQL) - { - setColHeader(colHeader); - setColSQL(colSQL); - setColClass(colClass); - setReadOnly(readOnly); - setColorColumn(colorColumn); - setIDcolSQL(IDcolSQL); - } // Info_Column - - - private String m_colHeader; - private String m_colSQL; - private Class m_colClass; - private boolean m_readOnly; - private boolean m_colorColumn; - private String m_IDcolSQL = ""; - - public Class getColClass() - { - return m_colClass; - } - public String getColHeader() - { - return m_colHeader; - } - public String getColSQL() - { - return m_colSQL; - } - public boolean isReadOnly() - { - return m_readOnly; - } - public void setColClass(Class colClass) - { - m_colClass = colClass; - } - public void setColHeader(String colHeader) - { - m_colHeader = colHeader; - if (colHeader != null) - { - int index = colHeader.indexOf('&'); - if (index != -1) - m_colHeader = colHeader.substring(0, index) + colHeader.substring(index+1); - } - } - public void setColSQL(String colSQL) - { - m_colSQL = colSQL; - } - public void setReadOnly(boolean readOnly) - { - m_readOnly = readOnly; - } - public void setColorColumn(boolean colorColumn) - { - m_colorColumn = colorColumn; - } - public boolean isColorColumn() - { - return m_colorColumn; - } - /** - * Add ID column SQL for the displayed column - * The Class for this should be KeyNamePair - */ - public void setIDcolSQL(String IDcolSQL) - { - m_IDcolSQL = IDcolSQL; - if (m_IDcolSQL == null) - m_IDcolSQL = ""; - } - public String getIDcolSQL() - { - return m_IDcolSQL; - } - public boolean isIDcol() - { - return m_IDcolSQL.length() > 0; - } -} // infoColumn - diff --git a/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/Process.java b/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/Process.java index 80673cb8c9..74e4cfcc02 100644 --- a/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/Process.java +++ b/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/Process.java @@ -2,8 +2,6 @@ package org.idempiere.adinterface; import java.io.ByteArrayOutputStream; import java.io.CharArrayWriter; -import java.io.File; -import java.io.IOException; import java.math.BigDecimal; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -16,7 +14,6 @@ import java.util.logging.Level; import net.sf.compilo.report.ReportProcessor; import net.sf.jasperreports.engine.JasperPrint; -import org.compiere.model.GridField; import org.compiere.model.GridTab; import org.compiere.model.Lookup; import org.compiere.model.MAllocationHdr; @@ -48,7 +45,6 @@ import org.compiere.util.NamePair; import org.compiere.util.Trx; import org.compiere.wf.MWFProcess; import org.compiere.wf.MWorkflow; - import org.idempiere.adInterface.x10.DataField; import org.idempiere.adInterface.x10.DataRow; import org.idempiere.adInterface.x10.GetProcessParamsDocument; @@ -334,7 +330,7 @@ public class Process { ReportEngine re=null; if (!jasperreport) re = start(pi); - //ReportEngine.get(m_cs.getM_ctx(), pi); + if (re == null && !jasperreport) { //b��d: "Nie uda�o si� uruchomi� silnika raport�w (ReportEngine)", @@ -344,19 +340,14 @@ public class Process { try { boolean ok = false; - File file; String file_type = "pdf"; if (!jasperreport) { - //file = File.createTempFile("WProcess", ".pdf"); - //ok = re.createPDF(file); MPrintFormat pf = re.getPrintFormat(); if (pf.isTableBased()) { CharArrayWriter wr = new CharArrayWriter(); - //file = File.createTempFile("WProcess", ".xls"); ok = ReportEngineEx.createEXCEL_HTML_wr( re, m_cs.getM_ctx(), wr, false, re.getPrintFormat().getLanguage() ); - //ok = re.createXML( file ); file_type ="xls"; String data = wr.toString(); if (data!=null) @@ -818,7 +809,6 @@ public class Process { */ static public ReportEngine startFinReport (ProcessInfo pi) { - int AD_Client_ID = Env.getAD_Client_ID(Env.getCtx()); // Create Query from Parameters String TableName = pi.getAD_Process_ID() == 202 ? "T_Report" : "T_ReportStatement"; @@ -1042,48 +1032,6 @@ public class Process { } - /*private static void ProcessDocAction(GridField field, int record_id, WWindowStatus ws) - throws IOException - { - //select sel = new select(); - LookupValues lvs = LookupValues.Factory.newInstance(); //sel.setName("SetDocAction"); - renderDocActionOptions(lvs, ws.curTab); - //frm.addElement(new input("hidden", "action", "DocAction")); - - //center.addElement( WebUtil.createClosePopupButton() ); - - }*/ - - public void doPost() throws IOException { - String column_name = "";//WebUtil.getParameter(request, "ColumnName"); - String action = "";//WebUtil.getParameter(request, "action"); - - WWindowStatus ws = null; //WWindowStatus.get(request); - - - String DA = ""; //WebUtil.getParameter(request, "SetDocAction"); - ws.curTab.setValue("DocAction", DA); - - if (ws.curTab.needSave(true, false)) //slain - nie wyrzucaj bledu, jesli nie musiales zapisac - //if (! cmd_save(ws)) - { - - //doc.addWindowCenter(false).addElement("B��d zapisu..." ); - //return; - } - - GridField f = ws.curTab.getField( column_name ); - int process_id = f.getAD_Process_ID(); - int record_id = ws.curTab.getRecord_ID(); - String qs = - "AD_Process_ID="+Integer.toString(process_id) +"&"+ - "AD_Record_ID="+Integer.toString(record_id); - - //RequestDispatcher disp = this.getServletContext().getRequestDispatcher("/WProcess?runas=get&"+qs); - //disp.forward(request, response); - - return; - } // doPost diff --git a/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/WWindowStatus.java b/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/WWindowStatus.java deleted file mode 100644 index 2d9043f4cf..0000000000 --- a/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/WWindowStatus.java +++ /dev/null @@ -1,205 +0,0 @@ -package org.idempiere.adinterface; - -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; - -import org.compiere.model.GridTab; -import org.compiere.model.GridWindow; -import org.compiere.model.GridWindowVO; -import org.compiere.model.MQuery; - -/* - * ADEMPIERE/COMPIERE - * - * A: - * Replace GridWindowVO with GridWindowVO - * GridWindow with GridWindow - * GridTab with GridTab - */ - -public class WWindowStatus -{ - public static class AD_WrongTabException extends Exception - { - /** - * - */ - private static final long serialVersionUID = -8949499217396844364L; - - public AD_WrongTabException( String msg ) { - super(msg); - } - } - - public static WWindowStatus get (Map cache, int WinNo, boolean changeTab, int TabNo, boolean changeRow, /*int RowNo*/int RecordID ) //throws AD_WrongTabException - { - WWindowStatus ws = (WWindowStatus)cache.get(new Integer(WinNo)); - if (ws != null) - { - if (changeTab &&ws.curTab.getTabNo()!=TabNo) - { - //if (!changeTab) - // return null; - //throw ws.new AD_WrongTabException(""); - WWindowStatus.changeTabIfNeeded( ws, TabNo ); - ws.updateRecIDMap(); - } - /* - if (changeRow) - { - if (RowNo<0) RowNo = 0; - if (ws.curTab.getCurrentRow() != RowNo) - { - int r = ws.curTab.navigate(RowNo); - if (r==-1) - ws.curTab.dataRefresh(); - } - }*/ - // zakladamy ze dostajemy teraz RecordID zamiast RowNo; - if (changeRow) { - int RowNo = ws.getRowNoFromRecordID( RecordID ); - - if (RowNo<0) RowNo = 0; - if (ws.curTab.getCurrentRow() != RowNo) - { - int r = ws.curTab.navigate(RowNo); - if (r==-1) - ws.curTab.dataRefresh(); - } - } - - } - -// ADEMPIERE/COMPIERE - if (ws!=null && !ws.curTab.getTableModel().isOpen()) - ws.curTab.getTableModel(). - open(0); // adempiere - //open(); // compiere - - return ws; - } // get - - - /************************************************************************** - * Constructor - First Tab - First Row - Single Row. - *
- * Initialize Formats - * @param GridWindowVO window VO - */ - public WWindowStatus ( GridWindowVO GridWindowVO) - { - mWindow = new GridWindow(GridWindowVO); - curTab = mWindow.getTab(0); - curTab.setSingleRow(true); - - ctx = GridWindowVO.ctx; - m_needSave = false; - - ads = new ADDataStatusListener(ctx); - curTab.addDataStatusListener( ads ); - - RecordIDMap = new HashMap(); - } // WWindowStatus - - - /** The GridWindow */ - protected GridWindow mWindow; - /** The current GridTab */ - protected GridTab curTab; - - - /** Window Context */ - public Properties ctx = null; - - public ADDataStatusListener ads = null; - - public int TabNo = 0; - public MQuery findQuery = null; - public boolean hasFindParams = false; - public boolean findQueryApplied = false; - public boolean m_needSave = false; - - - /** - * String representation - * @return String representation - */ - public String toString() - { - return "WWindowStatus[" + mWindow - + " - " + curTab + "]"; - } // toString - - - - public static void changeTabIfNeeded(WWindowStatus ws, int TabNo) - { - if (ws.curTab.getTabNo() != TabNo) // tab change - { - //ws.curTab = ws.mWindow.getTab(TabNo); - if (TabNo > ws.curTab.getTabNo()) - { - //if (ws.curTab.getTableModel().isInserting() ) // kolec - // return; - - ws.curTab.removeDataStatusListener( ws.ads ); - // ADEMPIERE/COMPIERE - ws.mWindow.initTab(TabNo); //adempiere specific - ws.curTab = ws.mWindow.getTab(TabNo); - ws.curTab.addDataStatusListener( ws.ads ); - ws.curTab.query(ws.mWindow.isTransaction()); // false - ws.curTab.navigate(0); - ws.m_needSave = false; - ws.updateRecIDMap(); - } - // move back - else if (TabNo < ws.curTab.getTabNo()) - { - ws.curTab.removeDataStatusListener( ws.ads ); -// ADEMPIERE/COMPIERE - ws.mWindow.initTab(TabNo); //adempiere specific - ws.curTab = ws.mWindow.getTab(TabNo); - ws.curTab.addDataStatusListener( ws.ads ); - // ws.curTab.dataRefresh(); // bylo - ws.curTab.query(ws.mWindow.isTransaction()); // false - ws.curTab.navigate(0); - ws.m_needSave = false; - ws.updateRecIDMap(); - } - } - } - - - - Map RecordIDMap = null; - - public int getRowNoFromRecordID( int RecordID ) { - Integer rowNo = this.RecordIDMap.get( RecordID ); - if (rowNo == null) rowNo = new Integer(-1); - System.out.println("getRowNo From RecID "+RecordID+" = "+rowNo.intValue()); - return rowNo.intValue(); - } - - public Map getRecordIDMap() { - return RecordIDMap; - } - - public void updateRecIDMap() { - int rc = curTab.getRowCount(); - int initRowNo = 0; - - //Map RecordIDMap = ws.getRecordIDMap(); - - RecordIDMap.clear(); - - for (int lineNo = initRowNo; lineNo < rc; lineNo++) - { - int recID = curTab.getKeyID( lineNo ); - //System.out.println(""+lineNo+" - "+recID); - RecordIDMap.put( recID, lineNo ); - - } - } - -} // WWindowStatus diff --git a/org.idempiere.webservices/testScripts/idempiere-composite-soapui-project.xml b/org.idempiere.webservices/testScripts/idempiere-composite-soapui-project.xml new file mode 100644 index 0000000000..4b4353f4a0 --- /dev/null +++ b/org.idempiere.webservices/testScripts/idempiere-composite-soapui-project.xml @@ -0,0 +1,658 @@ + +http://localhost:9191/ADInterface/services/compositeInterface?wsdl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]>http://schemas.xmlsoap.org/wsdl/http://localhost:9191/ADInterface/services/compositeInterface<xml-fragment/>UTF-8http://localhost:9191/ADInterface/services/compositeInterface + + + <_0:compositeOperation> + <_0:CompositeRequest> + <_0:ADLoginRequest> + <_0:user>WebService + <_0:pass>WebService + <_0:lang>en_US + <_0:ClientID>11 + <_0:RoleID>50004 + <_0:OrgID>11 + <_0:WarehouseID>103 + <_0:stage>9 + + <_0:serviceType>SyncOrder + <_0:operations> + <_0:operation preCommit="false" postCommit="false"> + <_0:TargetPort>createUpdateData + <_0:ModelCRUD> + <_0:serviceType>CreateBPartner + <_0:TableName>C_BPartner + <_0:RecordID>0 + <_0:Action>CreateUpdate + <_0:DataRow> + <_0:field column="Name"> + <_0:val>Trek Global + + <_0:field column="email"> + <_0:val>dpansheriya@trekglobal.com + + <_0:field column="TaxID"> + <_0:val>830.085.359-4 + + <_0:field column="IsVendor"> + <_0:val>Y + + <_0:field column="IsCustomer"> + <_0:val>N + + <_0:field column="IsTaxExempt"> + <_0:val>N + + <_0:field column="C_BP_Group_ID"> + <_0:val>104 + + + + + <_0:operation preCommit="false" postCommit="false"> + <_0:TargetPort>createUpdateData + <_0:ModelCRUD> + <_0:serviceType>CreateUpdateUser + <_0:TableName>AD_User + <_0:RecordID>0 + <_0:Action>CreateUpdate + <_0:DataRow> + <_0:field column="Name"> + <_0:val>Deepak Pansheriya + + <_0:field column="EMail"> + <_0:val>dpansheriya@trekglobal.com + + <_0:field column="C_BPartner_ID"> + <_0:val>@C_BPartner.C_BPartner_ID + + <_0:field column="Phone"> + <_0:val>9228785734 + + + + + <_0:operation preCommit="false" postCommit="false"> + <_0:TargetPort>createUpdateData + <_0:ModelCRUD> + <_0:serviceType>CreateUpdateLocation1 + <_0:TableName>C_Location + <_0:RecordID>0 + <_0:Action>CreateUpdate + <_0:DataRow> + <_0:field column="C_Country_ID" lval="United States"/> + <_0:field column="Address1"> + <_0:val>1625 Cowboy Chaps Place + + <_0:field column="Address2"> + <_0:val> + + <_0:field column="C_Region_ID" lval="NV"/> + <_0:field column="RegionName"> + <_0:val>NV + + <_0:field column="Postal"> + <_0:val>89002 + + <_0:field column="City"> + <_0:val>Henderson + + + + + <_0:operation preCommit="false" postCommit="false"> + <_0:TargetPort>createUpdateData + <_0:ModelCRUD> + <_0:serviceType>CreateUpdateBPLocation + <_0:TableName>C_BPartner_Location + <_0:RecordID>0 + <_0:Action>CreateUpdate + <_0:DataRow> + <_0:field column="C_BPartner_ID"> + <_0:val>@C_BPartner.C_BPartner_ID + + <_0:field column="C_Location_ID"> + <_0:val>@C_Location.C_Location_ID + + <_0:field column="IsShipTo"> + <_0:val>True + + <_0:field column="IsBillTo"> + <_0:val>True + + + + + <_0:operation preCommit="false" postCommit="false"> + <_0:TargetPort>createUpdateData + <_0:ModelCRUD> + <_0:serviceType>CreateUpdateUser + <_0:TableName>AD_User + <_0:RecordID>0 + <_0:Action>CreateUpdate + <_0:DataRow> + <_0:field column="EMail"> + <_0:val>dpansheriya@trekglobal.com + + <_0:field column="C_BPartner_ID"> + <_0:val>@C_BPartner.C_BPartner_ID + + <_0:field column="C_BPartner_Location_ID"> + <_0:val>@C_BPartner_Location.C_BPartner_Location_ID + + + + + <_0:operation preCommit="false" postCommit="false"> + <_0:TargetPort>createUpdateData + <_0:ModelCRUD> + <_0:serviceType>createOrderRecord + <_0:TableName>C_Order + <_0:RecordID>0 + <_0:Action>CreateUpdate + <_0:DataRow> + <_0:field column="M_Warehouse_ID"> + <_0:val>50001 + + <_0:field column="DocumentNo"> + <_0:val>DEEPTEST03 + + <_0:field column="AD_User_ID"> + <_0:val>@AD_User.AD_User_ID + + <_0:field column="C_BPartner_ID"> + <_0:val>@C_BPartner.C_BPartner_ID + + <_0:field column="C_BPartner_Location_ID"> + <_0:val>@C_BPartner_Location.C_BPartner_Location_ID + + <_0:field column="Bill_BPartner_ID"> + <_0:val>@C_BPartner.C_BPartner_ID + + <_0:field column="Bill_Location_ID"> + <_0:val>@C_BPartner_Location.C_BPartner_Location_ID + + <_0:field column="C_DocTypeTarget_ID"> + <_0:val>132 + + + <_0:field column="FreightCostRule" lval="Freight included"/> + <_0:field column="FreightAmt"> + <_0:val>6 + + + + + <_0:operation preCommit="true" postCommit="false"> + <_0:TargetPort>createUpdateData + <_0:ModelCRUD> + <_0:serviceType>CreateOrderLine + <_0:TableName>C_OrderLine + <_0:RecordID>0 + <_0:Action>CreateUpdate + <_0:DataRow> + <_0:field column="AD_Org_ID"> + <_0:val>11 + + <_0:field column="AD_Client_ID"> + <_0:val>11 + + + <_0:field column="C_Order_ID"> + <_0:val>@C_Order.C_Order_ID + + <_0:field column="M_Product_ID"> + <_0:val>140 + + <_0:field column="QtyEntered"> + <_0:val>1 + + <_0:field column="QtyOrdered"> + <_0:val>1 + + <_0:field column="Line"> + <_0:val>10 + + <_0:field column="PriceEntered"> + <_0:val>12 + + <_0:field column="PriceActual"> + <_0:val>13 + + + + + + <_0:operation preCommit="false" postCommit="false"> + <_0:TargetPort>createUpdateData + <_0:ModelCRUD> + <_0:serviceType>CreateOrderLine + <_0:TableName>C_OrderLine + <_0:RecordID>0 + <_0:Action>CreateUpdate + <_0:DataRow> + <_0:field column="C_Order_ID"> + <_0:val>@C_Order.C_Order_ID + + <_0:field column="M_Product_ID"> + <_0:val>123 + + <_0:field column="QtyEntered"> + <_0:val>2 + + <_0:field column="QtyOrdered"> + <_0:val>2 + + <_0:field column="Line"> + <_0:val>10 + + <_0:field column="PriceEntered"> + <_0:val>14 + + <_0:field column="PriceActual"> + <_0:val>15 + + + + + + <_0:operation preCommit="true" postCommit="true"> + <_0:TargetPort>setDocAction + <_0:ModelSetDocAction> + <_0:serviceType>CompleteOrder + <_0:tableName>C_Order + <_0:recordID>0 + <_0:recordIDVariable>@C_Order.C_Order_ID + <_0:docAction>CO + + + + + + +]]> \ No newline at end of file