From 988f40d1939ad4f6e31af882301389daa89dfdc0 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 20 Sep 2012 10:57:45 -0500 Subject: [PATCH 01/79] IDEMPIERE-422 Complete Native Sequence feature / Fixing as latest changes on MSequence for IDEMPIERE-332 broke native sequence feature --- .../src/org/compiere/model/MSequence.java | 26 +++++++++---- .../src/org/compiere/model/SystemIDs.java | 4 +- .../process/EnableNativeSequence.java | 39 ++++++++----------- 3 files changed, 38 insertions(+), 31 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MSequence.java b/org.adempiere.base/src/org/compiere/model/MSequence.java index 1db1ce3627..b01099eb49 100644 --- a/org.adempiere.base/src/org/compiere/model/MSequence.java +++ b/org.adempiere.base/src/org/compiere/model/MSequence.java @@ -682,6 +682,25 @@ public class MSequence extends X_AD_Sequence { boolean SYSTEM_NATIVE_SEQUENCE = MSysConfig.getBooleanValue(MSysConfig.SYSTEM_NATIVE_SEQUENCE,false); + if (tableID && SYSTEM_NATIVE_SEQUENCE) + { + int next_id = MSequence.getNextID(Env.getAD_Client_ID(ctx), TableName, trxName); + if (next_id == -1) + { + MSequence seq = new MSequence (ctx, 0, trxName); + seq.setClientOrg(0, 0); + seq.setName(TableName); + seq.setDescription("Table " + TableName); + seq.setIsTableID(tableID); + seq.saveEx(); + next_id = seq.getCurrentNext(); + } + if (! CConnection.get().getDatabase().createSequence(TableName+"_SQ", 1, 0 , 99999999, next_id, trxName)) + return false; + + return true; + } + MSequence seq = new MSequence (ctx, 0, trxName); if (tableID) seq.setClientOrg(0, 0); @@ -697,13 +716,6 @@ public class MSequence extends X_AD_Sequence } seq.setIsTableID(tableID); seq.saveEx(); - - if (tableID && SYSTEM_NATIVE_SEQUENCE) - { - int next_id = seq.getCurrentNext(); - if (! CConnection.get().getDatabase().createSequence(TableName+"_SQ", 1, 0 , 99999999, next_id, trxName)) - return false; - } return true; } // createTableSequence diff --git a/org.adempiere.base/src/org/compiere/model/SystemIDs.java b/org.adempiere.base/src/org/compiere/model/SystemIDs.java index 552bb6cdc6..51f0911701 100644 --- a/org.adempiere.base/src/org/compiere/model/SystemIDs.java +++ b/org.adempiere.base/src/org/compiere/model/SystemIDs.java @@ -16,6 +16,7 @@ *****************************************************************************/ package org.compiere.model; + /** * List all hardcoded ID used in the code * @author Carlos Ruiz, Nicolas Micoud, ... @@ -146,5 +147,6 @@ public class SystemIDs public final static int WINDOW_WAREHOUSE_LOCATOR = 139; public final static int WINDOW_WINDOW_TAB_FIELD = 102; - public final static int SYSCONFIG_USER_HASH_PASSWORD = 200013; + public final static int SYSCONFIG_USER_HASH_PASSWORD = 200013; + public final static int SYSCONFIG_SYSTEM_NATIVE_SEQUENCE = 50016; } diff --git a/org.adempiere.base/src/org/eevolution/process/EnableNativeSequence.java b/org.adempiere.base/src/org/eevolution/process/EnableNativeSequence.java index 4ef65b594e..91e243437e 100644 --- a/org.adempiere.base/src/org/eevolution/process/EnableNativeSequence.java +++ b/org.adempiere.base/src/org/eevolution/process/EnableNativeSequence.java @@ -18,6 +18,8 @@ package org.eevolution.process; +import static org.compiere.model.SystemIDs.PROCESS_AD_NATIVE_SEQUENCE_ENABLE; + import java.util.List; import java.util.Properties; import java.util.logging.Level; @@ -29,12 +31,11 @@ import org.compiere.model.MSequence; import org.compiere.model.MSysConfig; import org.compiere.model.MTable; import org.compiere.model.Query; -import static org.compiere.model.SystemIDs.*; +import org.compiere.model.SystemIDs; import org.compiere.model.X_AD_Table; import org.compiere.process.ProcessInfo; import org.compiere.process.SvrProcess; import org.compiere.util.CLogMgt; -import org.compiere.util.DB; import org.compiere.util.Env; /** @@ -53,16 +54,20 @@ public class EnableNativeSequence extends SvrProcess { } // prepare - protected String doIt() + protected String doIt() throws Exception { boolean SYSTEM_NATIVE_SEQUENCE = MSysConfig.getBooleanValue(MSysConfig.SYSTEM_NATIVE_SEQUENCE,false); - if(SYSTEM_NATIVE_SEQUENCE) + if (SYSTEM_NATIVE_SEQUENCE) { throw new AdempiereException("Native Sequence is Actived"); } - setSystemNativeSequence(true); - boolean ok = false; + // update the sysconfig key to Y out of trx and reset the cache + MSysConfig conf = new MSysConfig(getCtx(), SystemIDs.SYSCONFIG_SYSTEM_NATIVE_SEQUENCE, null); + conf.setValue("Y"); + conf.saveEx(); + MSysConfig.resetCache(); + try { createSequence("AD_Sequence", null); @@ -77,14 +82,11 @@ public class EnableNativeSequence extends SvrProcess { createSequence(table, get_TrxName()); } - ok = true; - } - finally - { - if (!ok) - { - setSystemNativeSequence(false); - } + } catch (Exception e) { + // reset to N on exception + conf.setValue("N"); + conf.saveEx(); + throw e; } return "@OK@"; @@ -109,15 +111,6 @@ public class EnableNativeSequence extends SvrProcess createSequence(MTable.get(getCtx(), tableName), trxName); } - private void setSystemNativeSequence(boolean value) - { - DB.executeUpdateEx("UPDATE AD_SysConfig SET Value=? WHERE Name='SYSTEM_NATIVE_SEQUENCE'", - new Object[]{value ? "Y" : "N"}, - null // trxName - ); - MSysConfig.resetCache(); - } - /** * Main test * @param args From dcc0773920d3bd09575657d7f07b1db6a2c0b91c Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 21 Sep 2012 09:24:30 -0500 Subject: [PATCH 02/79] IDEMPIERE-382 Prevent users to go to detail tabs if link fields are not filled (zk) --- .../adempiere/webui/component/AbstractADTab.java | 15 ++++++++++----- .../src/org/adempiere/webui/panel/ADSortTab.java | 11 ++++++++--- .../src/org/adempiere/webui/panel/ADTabpanel.java | 10 +++++++++- .../webui/panel/AbstractADWindowPanel.java | 1 + .../org/adempiere/webui/panel/IADTabpanel.java | 5 +++++ 5 files changed, 33 insertions(+), 9 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/AbstractADTab.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/AbstractADTab.java index 31e9727607..522e606662 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/AbstractADTab.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/AbstractADTab.java @@ -122,7 +122,7 @@ public abstract class AbstractADTab extends AbstractUIPart implements IADTab if (newIndex != oldIndex) { - canJump = canNavigateTo(oldIndex, newIndex); + canJump = canNavigateTo(oldIndex, newIndex, true); if (canJump) { prepareContext(newIndex, newTab); @@ -204,8 +204,12 @@ public abstract class AbstractADTab extends AbstractUIPart implements IADTab } return true; } - + public boolean canNavigateTo(int fromIndex, int toIndex) { + return canNavigateTo(fromIndex, toIndex, false); + } + + public boolean canNavigateTo(int fromIndex, int toIndex, boolean checkRecordID) { IADTabpanel newTab = tabPanelList.get(toIndex); if (newTab instanceof ADTabpanel) { @@ -222,8 +226,7 @@ public abstract class AbstractADTab extends AbstractUIPart implements IADTab IADTabpanel oldTabpanel = fromIndex >= 0 ? tabPanelList.get(fromIndex) : null; if (oldTabpanel != null) { - IADTabpanel oldTab = oldTabpanel; - if (newTab.getTabLevel() > oldTab.getTabLevel()) + if (newTab.getTabLevel() > oldTabpanel.getTabLevel()) { int currentLevel = newTab.getTabLevel(); for (int i = toIndex - 1; i >= 0; i--) @@ -239,8 +242,10 @@ public abstract class AbstractADTab extends AbstractUIPart implements IADTab currentLevel = tabPanel.getTabLevel(); } } + if (canJump && checkRecordID && oldTabpanel.getRecord_ID() <= 0) + canJump = false; } - } + } } return canJump; } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADSortTab.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADSortTab.java index 3173bcdbd7..433341c326 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADSortTab.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADSortTab.java @@ -68,9 +68,10 @@ import org.zkoss.zul.event.ListDataEvent; */ public class ADSortTab extends Panel implements IADTabpanel { - - private static final long serialVersionUID = 4289328613547509587L; - private int m_AD_ColumnSortOrder_ID; + /** + * + */ + private static final long serialVersionUID = 4461514427222034848L; /** * Sort Tab Constructor @@ -869,6 +870,10 @@ public class ADSortTab extends Panel implements IADTabpanel return gridTab.getTabLevel(); } + public int getRecord_ID() { + return gridTab.getRecord_ID(); + } + public String getTitle() { return gridTab.getName(); } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADTabpanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADTabpanel.java index 0bb4fe591a..c982cee1c6 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADTabpanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADTabpanel.java @@ -98,7 +98,7 @@ DataStatusListener, IADTabpanel /** * */ - private static final long serialVersionUID = -975129028953555569L; + private static final long serialVersionUID = -6082680802978974909L; private static final String ON_DEFER_SET_SELECTED_NODE = "onDeferSetSelectedNode"; @@ -670,6 +670,14 @@ DataStatusListener, IADTabpanel return gridTab.getTabLevel(); } + /** + * @return The record ID of this Tabpanel + */ + public int getRecord_ID() + { + return gridTab.getRecord_ID(); + } + /** * Is panel need refresh * @return boolean diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java index 7175aff183..577873f164 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java @@ -1025,6 +1025,7 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To FDialog.warn(curWindowNo, "TabSwitchJumpGo", title); if (callback != null) callback.onCallback(false); + return; } IADTabpanel oldTabpanel = curTabpanel; diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/IADTabpanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/IADTabpanel.java index 655b0b8c8c..76509b9bb4 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/IADTabpanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/IADTabpanel.java @@ -33,6 +33,11 @@ public interface IADTabpanel extends Component, Evaluatee { */ public int getTabLevel(); + /** + * @return record ID + */ + public int getRecord_ID(); + /** * @return true if refresh is not needed */ From 5c1d614ec932b6679fe4f8ea72b6e7485bd16f4e Mon Sep 17 00:00:00 2001 From: Nicolas Micoud Date: Thu, 20 Sep 2012 13:55:22 +0200 Subject: [PATCH 03/79] IDEMPIERE 382 - Swing --- .../src/org/compiere/grid/VTabbedPane.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VTabbedPane.java b/org.adempiere.ui.swing/src/org/compiere/grid/VTabbedPane.java index 78796784d1..846f379e3b 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VTabbedPane.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/VTabbedPane.java @@ -272,12 +272,14 @@ public class VTabbedPane extends CTabbedPane if (oldC != null && oldC instanceof GridController) { GridController oldGC = (GridController)oldC; - if (newGC.getTabLevel() > oldGC.getTabLevel()+1) + if ((newGC.getTabLevel() > oldGC.getTabLevel()+1) + || (newGC.getTabLevel() > oldGC.getTabLevel() && oldGC.getMTab().getRecord_ID() <=0)) // TabLevel increase and parent ID <=0 IDEMPIERE 382 { // validate // Search for right tab GridController rightGC = null; - boolean canJump = true; + //boolean canJump = true; + boolean canJump = oldGC.getMTab().getRecord_ID() <=0 ? false : true; // IDEMPIERE 382 int currentLevel = newGC.getTabLevel(); for (int i = index-1; i >=0; i--) { From ae107dbb6493025677c3ad69e2779c14cfe78fcc Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 21 Sep 2012 19:21:59 -0500 Subject: [PATCH 04/79] =?UTF-8?q?IDEMPIERE-308=20Performance:=20Replace=20?= =?UTF-8?q?use=20of=20StringBuffer=20and=20String=20concatenation=20with?= =?UTF-8?q?=20StringBuilder=20/=20thanks=20to=20Richard=20Morales=20and=20?= =?UTF-8?q?David=20Pe=C3=B1uela?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../compiere/process/ColumnEncryption.java | 29 +- .../compiere/process/DunningRunCreate.java | 163 +++-- .../process/InventoryCountCreate.java | 78 +- .../compiere/process/M_PriceList_Create.java | 677 +++++++++--------- .../org/compiere/process/ReplenishReport.java | 312 ++++---- .../process/ReplenishReportProduction.java | 337 ++++----- .../org/adempiere/process/UUIDGenerator.java | 57 +- .../util/AbstractDocumentSearch.java | 72 +- .../adempiere/util/ModelClassGenerator.java | 60 +- .../util/ModelInterfaceGenerator.java | 80 +-- .../impexp/OFXBankStatementHandler.java | 44 +- .../impexp/OFXFileBankStatementLoader.java | 4 +- .../src/org/compiere/model/MLanguage.java | 42 +- .../src/org/compiere/model/MPasswordRule.java | 10 +- .../src/org/compiere/util/Language.java | 8 +- .../adempiere/apps/graph/HtmlDashboard.java | 105 +-- .../src/org/compiere/apps/search/Find.java | 114 +-- .../webui/apps/form/WFileImport.java | 23 +- .../webui/install/WTranslationDialog.java | 24 +- .../adempiere/webui/window/FindWindow.java | 61 +- .../src/org/compiere/db/DB_Oracle.java | 51 +- 21 files changed, 1210 insertions(+), 1141 deletions(-) diff --git a/org.adempiere.base.process/src/org/compiere/process/ColumnEncryption.java b/org.adempiere.base.process/src/org/compiere/process/ColumnEncryption.java index 9d8d1fb265..2e962db6c7 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ColumnEncryption.java +++ b/org.adempiere.base.process/src/org/compiere/process/ColumnEncryption.java @@ -162,14 +162,18 @@ public class ColumnEncryption extends SvrProcess { // Length Test if (p_MaxLength != 0) { - String testClear = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + StringBuilder testClear = new StringBuilder(); + testClear.append("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); while (testClear.length() < p_MaxLength) - testClear += testClear; - testClear = testClear.substring(0, p_MaxLength); - log.config("Test=" + testClear + " (" + p_MaxLength + ")"); + testClear.append(testClear); + testClear.delete(p_MaxLength,testClear.length()); + StringBuilder msglog = new StringBuilder() + .append("Test=").append(testClear.toString()).append(" (").append(p_MaxLength).append(")"); + log.config(msglog.toString()); // - String encString = SecureEngine.encrypt(testClear); + String encString = SecureEngine.encrypt(testClear.toString()); int encLength = encString.length(); + addLog(0, null, null, "Test Max Length=" + testClear.length() + " -> " + encLength); if (encLength <= column.getFieldLength()) @@ -272,12 +276,12 @@ public class ColumnEncryption extends SvrProcess { int recordsEncrypted = 0; String idColumnName = tableName + "_ID"; - StringBuffer selectSql = new StringBuffer(); + StringBuilder selectSql = new StringBuilder(); selectSql.append("SELECT " + idColumnName + "," + columnName); selectSql.append(" FROM " + tableName); selectSql.append(" ORDER BY " + idColumnName); - StringBuffer updateSql = new StringBuffer(); + StringBuilder updateSql = new StringBuilder(); updateSql.append("UPDATE " + tableName); updateSql.append(" SET " + columnName + "=?"); updateSql.append(" WHERE " + idColumnName + "=?"); @@ -321,13 +325,12 @@ public class ColumnEncryption extends SvrProcess { * @return The length of the encrypted column. */ private int encryptedColumnLength(int colLength) { - String str = ""; + StringBuilder str = new StringBuilder(); for (int i = 0; i < colLength; i++) { - str += "1"; - } - str = SecureEngine.encrypt(str); - + str.append("1"); + } + str = new StringBuilder(SecureEngine.encrypt(str.toString())); return str.length(); } // encryptedColumnLength @@ -347,7 +350,7 @@ public class ColumnEncryption extends SvrProcess { int rowsEffected = -1; // Select SQL - StringBuffer selectSql = new StringBuffer(); + StringBuilder selectSql = new StringBuilder(); selectSql.append("SELECT FieldLength"); selectSql.append(" FROM AD_Column"); selectSql.append(" WHERE AD_Column_ID=?"); diff --git a/org.adempiere.base.process/src/org/compiere/process/DunningRunCreate.java b/org.adempiere.base.process/src/org/compiere/process/DunningRunCreate.java index eea780f567..23874911ee 100644 --- a/org.adempiere.base.process/src/org/compiere/process/DunningRunCreate.java +++ b/org.adempiere.base.process/src/org/compiere/process/DunningRunCreate.java @@ -135,39 +135,41 @@ public class DunningRunCreate extends SvrProcess private int addInvoices(MDunningLevel level) { int count = 0; - String sql = "SELECT i.C_Invoice_ID, i.C_Currency_ID," - + " i.GrandTotal*i.MultiplierAP," - + " invoiceOpen(i.C_Invoice_ID,i.C_InvoicePaySchedule_ID)*MultiplierAP," - + " COALESCE(daysBetween(?,ips.DueDate),paymentTermDueDays(i.C_PaymentTerm_ID,i.DateInvoiced,?))," // ##1/2 - + " i.IsInDispute, i.C_BPartner_ID, i.C_InvoicePaySchedule_ID " - + "FROM C_Invoice_v i " - + " LEFT OUTER JOIN C_InvoicePaySchedule ips ON (i.C_InvoicePaySchedule_ID=ips.C_InvoicePaySchedule_ID) " - + "WHERE i.IsPaid='N' AND i.AD_Client_ID=?" // ##3 - + " AND i.DocStatus IN ('CO','CL')" - + " AND (i.DunningGrace IS NULL OR i.DunningGrace0) { - String sqlAppend = ""; + StringBuilder sqlAppend = new StringBuilder(); for (MDunningLevel element : previousLevels) { - sqlAppend += " AND i.C_Invoice_ID IN (SELECT C_Invoice_ID FROM C_DunningRunLine WHERE " + - "C_DunningRunEntry_ID IN (SELECT C_DunningRunEntry_ID FROM C_DunningRunEntry WHERE " + - "C_DunningRun_ID IN (SELECT C_DunningRun_ID FROM C_DunningRunEntry WHERE " + - "C_DunningLevel_ID=" + element.get_ID () + ")) AND Processed<>'N')"; + sqlAppend.append(" AND i.C_Invoice_ID IN (SELECT C_Invoice_ID FROM C_DunningRunLine WHERE "); + sqlAppend.append("C_DunningRunEntry_ID IN (SELECT C_DunningRunEntry_ID FROM C_DunningRunEntry WHERE "); + sqlAppend.append("C_DunningRun_ID IN (SELECT C_DunningRun_ID FROM C_DunningRunEntry WHERE "); + sqlAppend.append("C_DunningLevel_ID="); + sqlAppend.append(element.get_ID ()); + sqlAppend.append(")) AND Processed<>'N')"); } - sql += sqlAppend; + sql.append(sqlAppend.toString()); } } // ensure that we do only dunn what's not yet dunned, so we lookup the max of last Dunn Date which was processed - sql2 = "SELECT COUNT(*), COALESCE(DAYSBETWEEN(MAX(dr2.DunningDate), MAX(dr.DunningDate)),0)" - + "FROM C_DunningRun dr2, C_DunningRun dr" - + " INNER JOIN C_DunningRunEntry dre ON (dr.C_DunningRun_ID=dre.C_DunningRun_ID)" - + " INNER JOIN C_DunningRunLine drl ON (dre.C_DunningRunEntry_ID=drl.C_DunningRunEntry_ID) " - + "WHERE dr2.C_DunningRun_ID=? AND drl.C_Invoice_ID=?"; // ##1 ##2 + sql2.append("SELECT COUNT(*), COALESCE(DAYSBETWEEN(MAX(dr2.DunningDate), MAX(dr.DunningDate)),0)"); + sql2.append("FROM C_DunningRun dr2, C_DunningRun dr"); + sql2.append(" INNER JOIN C_DunningRunEntry dre ON (dr.C_DunningRun_ID=dre.C_DunningRun_ID)"); + sql2.append(" INNER JOIN C_DunningRunLine drl ON (dre.C_DunningRunEntry_ID=drl.C_DunningRunEntry_ID) "); + sql2.append("WHERE dr2.C_DunningRun_ID=? AND drl.C_Invoice_ID=?"); // ##1 ##2 BigDecimal DaysAfterDue = level.getDaysAfterDue(); int DaysBetweenDunning = level.getDaysBetweenDunning(); @@ -200,7 +204,7 @@ public class DunningRunCreate extends SvrProcess ResultSet rs = null; try { - pstmt = DB.prepareStatement (sql, get_TrxName()); + pstmt = DB.prepareStatement (sql.toString(), get_TrxName()); pstmt.setTimestamp(1, m_run.getDunningDate()); pstmt.setTimestamp(2, m_run.getDunningDate()); pstmt.setInt (3, m_run.getAD_Client_ID()); @@ -212,7 +216,7 @@ public class DunningRunCreate extends SvrProcess else if (p_C_BP_Group_ID != 0) pstmt.setInt (7, p_C_BP_Group_ID); // - pstmt2 = DB.prepareStatement (sql2, get_TrxName()); + pstmt2 = DB.prepareStatement (sql2.toString(), get_TrxName()); // rs = pstmt.executeQuery (); while (rs.next ()) @@ -225,9 +229,15 @@ public class DunningRunCreate extends SvrProcess boolean IsInDispute = "Y".equals(rs.getString(6)); int C_BPartner_ID = rs.getInt(7); int C_InvoicePaySchedule_ID = rs.getInt(8); - log.fine("DaysAfterDue: " + DaysAfterDue.intValue() + " isShowAllDue: " + level.isShowAllDue()); - log.fine("C_Invoice_ID - DaysDue - GrandTotal: " + C_Invoice_ID + " - " + DaysDue + " - " + GrandTotal); - log.fine("C_InvoicePaySchedule_ID: " + C_InvoicePaySchedule_ID); + + StringBuilder msglog = new StringBuilder() + .append("DaysAfterDue: ").append(DaysAfterDue.intValue()).append(" isShowAllDue: ").append(level.isShowAllDue()); + log.fine(msglog.toString()); + msglog = new StringBuilder() + .append("C_Invoice_ID - DaysDue - GrandTotal: ").append(C_Invoice_ID).append(" - ").append(DaysDue).append(" - ").append(GrandTotal); + log.fine(msglog.toString()); + msglog = new StringBuilder("C_InvoicePaySchedule_ID: ").append(C_InvoicePaySchedule_ID); + log.fine(msglog.toString()); // // Check for Dispute if (!p_IncludeInDispute && IsInDispute) @@ -317,10 +327,12 @@ public class DunningRunCreate extends SvrProcess } catch (BPartnerNoAddressException e) { - String msg = "@Skip@ @C_Invoice_ID@ " + MInvoice.get(getCtx(), C_Invoice_ID).getDocumentInfo() - + ", @C_BPartner_ID@ " + MBPartner.get(getCtx(), C_BPartner_ID).getName() - + " @No@ @IsActive@ @C_BPartner_Location_ID@"; - getProcessInfo().addLog(getProcessInfo().getAD_PInstance_ID(), null, null, msg); + StringBuilder msg = new StringBuilder("@Skip@ @C_Invoice_ID@ "); + msg.append(MInvoice.get(getCtx(), C_Invoice_ID).getDocumentInfo().toString()); + msg.append(", @C_BPartner_ID@ "); + msg.append(MBPartner.get(getCtx(), C_BPartner_ID).getName().toString()); + msg.append(" @No@ @IsActive@ @C_BPartner_Location_ID@"); + getProcessInfo().addLog(getProcessInfo().getAD_PInstance_ID(), null, null, msg.toString()); return false; } @@ -349,42 +361,44 @@ public class DunningRunCreate extends SvrProcess */ private int addPayments(MDunningLevel level) { - String sql = "SELECT C_Payment_ID, C_Currency_ID, PayAmt," - + " paymentAvailable(C_Payment_ID), C_BPartner_ID " - + "FROM C_Payment_v p " - + "WHERE AD_Client_ID=?" // ##1 - + " AND IsAllocated='N' AND C_BPartner_ID IS NOT NULL" - + " AND C_Charge_ID IS NULL" - + " AND DocStatus IN ('CO','CL')" - // Only BP(Group) with Dunning defined - + " AND EXISTS (SELECT * FROM C_DunningLevel dl " - + "WHERE dl.C_DunningLevel_ID=?" // // ##2 - + " AND dl.C_Dunning_ID IN " - + "(SELECT COALESCE(bp.C_Dunning_ID, bpg.C_Dunning_ID) " - + "FROM C_BPartner bp" - + " INNER JOIN C_BP_Group bpg ON (bp.C_BP_Group_ID=bpg.C_BP_Group_ID) " - + "WHERE p.C_BPartner_ID=bp.C_BPartner_ID))"; + StringBuilder sql = new StringBuilder("SELECT C_Payment_ID, C_Currency_ID, PayAmt,"); + sql.append(" paymentAvailable(C_Payment_ID), C_BPartner_ID "); + sql.append("FROM C_Payment_v p "); + sql.append("WHERE AD_Client_ID=?"); // ##1 + sql.append(" AND IsAllocated='N' AND C_BPartner_ID IS NOT NULL"); + sql.append(" AND C_Charge_ID IS NULL"); + sql.append(" AND DocStatus IN ('CO','CL')"); + //Only BP(Group) with Dunning defined + sql.append(" AND EXISTS (SELECT * FROM C_DunningLevel dl "); + sql.append("WHERE dl.C_DunningLevel_ID=?"); + sql.append(" AND dl.C_Dunning_ID IN "); + sql.append("(SELECT COALESCE(bp.C_Dunning_ID, bpg.C_Dunning_ID) "); + sql.append("FROM C_BPartner bp"); + sql.append(" INNER JOIN C_BP_Group bpg ON (bp.C_BP_Group_ID=bpg.C_BP_Group_ID) "); + sql.append("WHERE p.C_BPartner_ID=bp.C_BPartner_ID))"); + if (p_C_BPartner_ID != 0) - sql += " AND C_BPartner_ID=?"; // ##3 + sql.append(" AND C_BPartner_ID=?"); // ##3 else if (p_C_BP_Group_ID != 0) - sql += " AND EXISTS (SELECT * FROM C_BPartner bp " - + "WHERE p.C_BPartner_ID=bp.C_BPartner_ID AND bp.C_BP_Group_ID=?)"; // ##3 + sql.append(" AND EXISTS (SELECT * FROM C_BPartner bp ") + .append("WHERE p.C_BPartner_ID=bp.C_BPartner_ID AND bp.C_BP_Group_ID=?)"); // ##3 // If it is not a statement we will add lines only if InvoiceLines exists, // because we do not want to dunn for money we owe the customer! if (!level.isStatement()) - sql += " AND C_BPartner_ID IN (SELECT C_BPartner_ID FROM C_DunningRunEntry WHERE C_DunningRun_ID=" + m_run.get_ID () + ")"; + sql.append(" AND C_BPartner_ID IN (SELECT C_BPartner_ID FROM C_DunningRunEntry WHERE C_DunningRun_ID=") + .append(m_run.get_ID ()).append(")"); // show only receipts / if only Sales if (p_OnlySOTrx) - sql += " AND IsReceipt='Y'"; + sql.append(" AND IsReceipt='Y'"); if ( p_AD_Org_ID != 0 ) - sql += " AND p.AD_Org_ID=" + p_AD_Org_ID; + sql.append(" AND p.AD_Org_ID=").append(p_AD_Org_ID); int count = 0; PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement (sql, get_TrxName()); + pstmt = DB.prepareStatement (sql.toString(), get_TrxName()); pstmt.setInt (1, getAD_Client_ID()); pstmt.setInt (2, level.getC_DunningLevel_ID()); if (p_C_BPartner_ID != 0) @@ -413,7 +427,7 @@ public class DunningRunCreate extends SvrProcess } catch (Exception e) { - log.log(Level.SEVERE, sql, e); + log.log(Level.SEVERE, sql.toString(), e); getProcessInfo().addLog(getProcessInfo().getAD_PInstance_ID(), null, null, e.getLocalizedMessage()); } finally @@ -441,10 +455,13 @@ public class DunningRunCreate extends SvrProcess entry = m_run.getEntry (C_BPartner_ID, p_C_Currency_ID, p_SalesRep_ID, c_DunningLevel_ID); } catch (BPartnerNoAddressException e) { MPayment payment = new MPayment(getCtx(), C_Payment_ID, null); - String msg = "@Skip@ @C_Payment_ID@ " + payment.getDocumentInfo() - + ", @C_BPartner_ID@ " + MBPartner.get(getCtx(), C_BPartner_ID).getName() - + " @No@ @IsActive@ @C_BPartner_Location_ID@"; - getProcessInfo().addLog(getProcessInfo().getAD_PInstance_ID(), null, null, msg); + + StringBuilder msg = new StringBuilder("@Skip@ @C_Payment_ID@ "); + msg.append(payment.getDocumentInfo().toString()); + msg.append(", @C_BPartner_ID@ "); + msg.append(MBPartner.get(getCtx(), C_BPartner_ID).getName().toString()); + msg.append(" @No@ @IsActive@ @C_BPartner_Location_ID@"); + getProcessInfo().addLog(getProcessInfo().getAD_PInstance_ID(), null, null, msg.toString()); return false; } if (entry.get_ID() == 0) diff --git a/org.adempiere.base.process/src/org/compiere/process/InventoryCountCreate.java b/org.adempiere.base.process/src/org/compiere/process/InventoryCountCreate.java index 60982695d1..71f55f9c6e 100644 --- a/org.adempiere.base.process/src/org/compiere/process/InventoryCountCreate.java +++ b/org.adempiere.base.process/src/org/compiere/process/InventoryCountCreate.java @@ -135,36 +135,37 @@ public class InventoryCountCreate extends SvrProcess // Create Null Storage records if (p_QtyRange != null && p_QtyRange.equals("=")) { - String sql = "INSERT INTO M_Storage " - + "(AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy," - + " M_Locator_ID, M_Product_ID, M_AttributeSetInstance_ID," - + " QtyOnHand, QtyReserved, QtyOrdered, DateLastInventory) " - + "SELECT l.AD_CLIENT_ID, l.AD_ORG_ID, 'Y', SysDate, 0,SysDate, 0," - + " l.M_Locator_ID, p.M_Product_ID, 0," - + " 0,0,0,null " - + "FROM M_Locator l" - + " INNER JOIN M_Product p ON (l.AD_Client_ID=p.AD_Client_ID) " - + "WHERE l.M_Warehouse_ID=" + m_inventory.getM_Warehouse_ID(); + StringBuilder sql = new StringBuilder("INSERT INTO M_Storage "); + sql.append("(AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,"); + sql.append(" M_Locator_ID, M_Product_ID, M_AttributeSetInstance_ID,"); + sql.append(" QtyOnHand, QtyReserved, QtyOrdered, DateLastInventory) "); + sql.append("SELECT l.AD_CLIENT_ID, l.AD_ORG_ID, 'Y', SysDate, 0,SysDate, 0,"); + sql.append(" l.M_Locator_ID, p.M_Product_ID, 0,"); + sql.append(" 0,0,0,null "); + sql.append("FROM M_Locator l"); + sql.append(" INNER JOIN M_Product p ON (l.AD_Client_ID=p.AD_Client_ID) "); + sql.append("WHERE l.M_Warehouse_ID="); + sql.append(m_inventory.getM_Warehouse_ID()); + if (p_M_Locator_ID != 0) - sql += " AND l.M_Locator_ID=" + p_M_Locator_ID; - sql += " AND l.IsDefault='Y'" - + " AND p.IsActive='Y' AND p.IsStocked='Y' and p.ProductType='I'" - + " AND NOT EXISTS (SELECT * FROM M_Storage s" - + " INNER JOIN M_Locator sl ON (s.M_Locator_ID=sl.M_Locator_ID) " - + "WHERE sl.M_Warehouse_ID=l.M_Warehouse_ID" - + " AND s.M_Product_ID=p.M_Product_ID)"; - int no = DB.executeUpdate(sql, get_TrxName()); + sql.append(" AND l.M_Locator_ID=").append(p_M_Locator_ID); + sql.append(" AND l.IsDefault='Y'") + .append(" AND p.IsActive='Y' AND p.IsStocked='Y' and p.ProductType='I'") + .append(" AND NOT EXISTS (SELECT * FROM M_Storage s") + .append(" INNER JOIN M_Locator sl ON (s.M_Locator_ID=sl.M_Locator_ID) ") + .append("WHERE sl.M_Warehouse_ID=l.M_Warehouse_ID") + .append(" AND s.M_Product_ID=p.M_Product_ID)"); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("'0' Inserted #" + no); } - - StringBuffer sql = new StringBuffer( - "SELECT s.M_Product_ID, s.M_Locator_ID, s.M_AttributeSetInstance_ID," - + " s.QtyOnHand, p.M_AttributeSet_ID " - + "FROM M_Product p" - + " INNER JOIN M_Storage s ON (s.M_Product_ID=p.M_Product_ID)" - + " INNER JOIN M_Locator l ON (s.M_Locator_ID=l.M_Locator_ID) " - + "WHERE l.M_Warehouse_ID=?" - + " AND p.IsActive='Y' AND p.IsStocked='Y' and p.ProductType='I'"); + + StringBuilder sql = new StringBuilder("SELECT s.M_Product_ID, s.M_Locator_ID, s.M_AttributeSetInstance_ID,"); + sql.append(" s.QtyOnHand, p.M_AttributeSet_ID "); + sql.append("FROM M_Product p"); + sql.append(" INNER JOIN M_Storage s ON (s.M_Product_ID=p.M_Product_ID)"); + sql.append(" INNER JOIN M_Locator l ON (s.M_Locator_ID=l.M_Locator_ID) "); + sql.append("WHERE l.M_Warehouse_ID=?"); + sql.append(" AND p.IsActive='Y' AND p.IsStocked='Y' and p.ProductType='I'"); // if (p_M_Locator_ID != 0) sql.append(" AND s.M_Locator_ID=?"); @@ -182,15 +183,17 @@ public class InventoryCountCreate extends SvrProcess sql.append(" AND UPPER(p.Value) LIKE ?"); // if (p_M_Product_Category_ID != 0) - sql.append(" AND p.M_Product_Category_ID IN (" + getSubCategoryWhereClause(p_M_Product_Category_ID) + ")"); + sql.append(" AND p.M_Product_Category_ID IN (") + .append(getSubCategoryWhereClause(p_M_Product_Category_ID)) + .append(")"); // Do not overwrite existing records if (!p_DeleteOld) - sql.append(" AND NOT EXISTS (SELECT * FROM M_InventoryLine il " - + "WHERE il.M_Inventory_ID=?" - + " AND il.M_Product_ID=s.M_Product_ID" - + " AND il.M_Locator_ID=s.M_Locator_ID" - + " AND COALESCE(il.M_AttributeSetInstance_ID,0)=COALESCE(s.M_AttributeSetInstance_ID,0))"); + sql.append(" AND NOT EXISTS (SELECT * FROM M_InventoryLine il ") + .append("WHERE il.M_Inventory_ID=?") + .append(" AND il.M_Product_ID=s.M_Product_ID") + .append(" AND il.M_Locator_ID=s.M_Locator_ID") + .append(" AND COALESCE(il.M_AttributeSetInstance_ID,0)=COALESCE(s.M_AttributeSetInstance_ID,0))"); // + " AND il.M_AttributeSetInstance_ID=s.M_AttributeSetInstance_ID)"); // sql.append(" ORDER BY l.Value, p.Value, s.QtyOnHand DESC"); // Locator/Product @@ -373,7 +376,7 @@ public class InventoryCountCreate extends SvrProcess * @throws AdempiereSystemError if a loop is detected */ private String getSubCategoriesString(int productCategoryId, Vector categories, int loopIndicatorId) throws AdempiereSystemError { - String ret = ""; + StringBuilder ret = new StringBuilder(); final Iterator iter = categories.iterator(); while (iter.hasNext()) { SimpleTreeNode node = (SimpleTreeNode) iter.next(); @@ -381,11 +384,12 @@ public class InventoryCountCreate extends SvrProcess if (node.getNodeId() == loopIndicatorId) { throw new AdempiereSystemError("The product category tree contains a loop on categoryId: " + loopIndicatorId); } - ret = ret + getSubCategoriesString(node.getNodeId(), categories, loopIndicatorId) + ","; + ret.append(getSubCategoriesString(node.getNodeId(), categories, loopIndicatorId)); + ret.append(","); } } - log.fine(ret); - return ret + productCategoryId; + log.fine(ret.toString()); + return ret.toString() + productCategoryId; } /** diff --git a/org.adempiere.base.process/src/org/compiere/process/M_PriceList_Create.java b/org.adempiere.base.process/src/org/compiere/process/M_PriceList_Create.java index 1eaea717a5..9e85ad04f0 100644 --- a/org.adempiere.base.process/src/org/compiere/process/M_PriceList_Create.java +++ b/org.adempiere.base.process/src/org/compiere/process/M_PriceList_Create.java @@ -79,10 +79,10 @@ public class M_PriceList_Create extends SvrProcess { */ protected String doIt() throws Exception { - String sql; - String sqlupd; - String sqldel; - String sqlins; + StringBuilder sql = new StringBuilder(); + StringBuilder sqlupd = new StringBuilder(); + StringBuilder sqldel = new StringBuilder(); + StringBuilder sqlins = new StringBuilder(); int cntu = 0; int cntd = 0; int cnti = 0; @@ -96,62 +96,61 @@ public class M_PriceList_Create extends SvrProcess { //Checking Prerequisites //PO Prices must exists // - sqlupd = "UPDATE M_Product_PO " + " SET PriceList = 0 " - + " WHERE PriceList IS NULL "; + sqlupd.append("UPDATE M_Product_PO SET PriceList = 0 ") + .append(" WHERE PriceList IS NULL "); - cntu = DB.executeUpdate(sqlupd, get_TrxName()); + cntu = DB.executeUpdate(sqlupd.toString(), get_TrxName()); if (cntu == -1) raiseError( "Update The PriceList to zero of M_Product_PO WHERE PriceList IS NULL", - sqlupd); + sqlupd.toString()); totu += cntu; log.fine("Updated " + cntu); - sqlupd = "UPDATE M_Product_PO " + " SET PriceLastPO = 0 " - + " WHERE PriceLastPO IS NULL "; + sqlupd = new StringBuilder("UPDATE M_Product_PO SET PriceLastPO = 0 "); + sqlupd.append(" WHERE PriceLastPO IS NULL "); - cntu = DB.executeUpdate(sqlupd, get_TrxName()); + cntu = DB.executeUpdate(sqlupd.toString(), get_TrxName()); if (cntu == -1) raiseError( "Update The PriceListPO to zero of M_Product_PO WHERE PriceLastPO IS NULL", - sqlupd); + sqlupd.toString()); totu += cntu; log.fine("Updated " + cntu); - sqlupd = "UPDATE M_Product_PO " - + " SET PricePO = PriceLastPO " - + " WHERE (PricePO IS NULL OR PricePO = 0) AND PriceLastPO <> 0 "; + sqlupd = new StringBuilder("UPDATE M_Product_PO SET PricePO = PriceLastPO "); + sqlupd.append(" WHERE (PricePO IS NULL OR PricePO = 0) AND PriceLastPO <> 0 "); - cntu = DB.executeUpdate(sqlupd, get_TrxName()); + cntu = DB.executeUpdate(sqlupd.toString(), get_TrxName()); if (cntu == -1) raiseError( "Update The PricePO to PriceLastPO of M_Product_PO WHERE (PricePO IS NULL OR PricePO = 0) AND PriceLastPO <> 0 ", - sqlupd); + sqlupd.toString()); totu += cntu; log.fine("Updated " + cntu); - sqlupd = "UPDATE M_Product_PO " + " SET PricePO = 0 " - + " WHERE PricePO IS NULL "; + sqlupd = new StringBuilder("UPDATE M_Product_PO SET PricePO = 0 "); + sqlupd.append(" WHERE PricePO IS NULL "); - cntu = DB.executeUpdate(sqlupd, get_TrxName()); + cntu = DB.executeUpdate(sqlupd.toString(), get_TrxName()); if (cntu == -1) raiseError( "Update The PricePO to Zero of M_Product_PO WHERE PricePO IS NULL", - sqlupd); + sqlupd.toString()); totu += cntu; log.fine("Updated " + cntu); // // Set default current vendor // - sqlupd = "UPDATE M_Product_PO " + " SET IsCurrentVendor = 'Y' " - + " WHERE IsCurrentVendor = 'N' " + " AND NOT EXISTS " - + " (SELECT pp.M_Product_ID " + " FROM M_Product_PO pp " - + " WHERE pp.M_Product_ID = M_Product_PO.M_Product_ID" - + " GROUP BY pp.M_Product_ID HAVING COUNT(*) > 1) "; + sqlupd = new StringBuilder("UPDATE M_Product_PO SET IsCurrentVendor = 'Y' "); + sqlupd.append(" WHERE IsCurrentVendor = 'N' AND NOT EXISTS "); + sqlupd.append(" (SELECT pp.M_Product_ID FROM M_Product_PO pp "); + sqlupd.append(" WHERE pp.M_Product_ID = M_Product_PO.M_Product_ID"); + sqlupd.append(" GROUP BY pp.M_Product_ID HAVING COUNT(*) > 1) "); - cntu = DB.executeUpdate(sqlupd, get_TrxName()); + cntu = DB.executeUpdate(sqlupd.toString(), get_TrxName()); if (cntu == -1) - raiseError("Update IsCurrentVendor to Y of M_Product_PO ", sqlupd); + raiseError("Update IsCurrentVendor to Y of M_Product_PO ", sqlupd.toString()); totu += cntu; log.fine("Updated " + cntu); @@ -161,26 +160,26 @@ public class M_PriceList_Create extends SvrProcess { // // Make sure that we have only one active product // - sql = "SELECT DISTINCT M_Product_ID FROM M_Product_PO po " - + " WHERE IsCurrentVendor='Y' AND IsActive='Y' " - + " AND EXISTS (SELECT M_Product_ID " - + " FROM M_Product_PO x " - + " WHERE x.M_Product_ID=po.M_Product_ID " - + " AND IsCurrentVendor='Y' AND IsActive='Y' " - + " GROUP BY M_Product_ID " + " HAVING COUNT(*) > 1 ) "; + sql.append("SELECT DISTINCT M_Product_ID FROM M_Product_PO po "); + sql.append(" WHERE IsCurrentVendor='Y' AND IsActive='Y' "); + sql.append(" AND EXISTS (SELECT M_Product_ID "); + sql.append(" FROM M_Product_PO x "); + sql.append(" WHERE x.M_Product_ID=po.M_Product_ID "); + sql.append(" AND IsCurrentVendor='Y' AND IsActive='Y' "); + sql.append(" GROUP BY M_Product_ID ").append(" HAVING COUNT(*) > 1 ) "); PreparedStatement Cur_Duplicates = null; - Cur_Duplicates = DB.prepareStatement(sql, get_TrxName()); + Cur_Duplicates = DB.prepareStatement(sql.toString(), get_TrxName()); ResultSet dupl = Cur_Duplicates.executeQuery(); while (dupl.next()) { - sql = "SELECT M_Product_ID " + " ,C_BPartner_ID " - + " FROM M_Product_PO " + " WHERE IsCurrentVendor = 'Y' " - + " AND IsActive = 'Y' " - + " AND M_Product_ID = " + dupl.getInt("M_Product_ID") - + " ORDER BY PriceList DESC"; + sql = new StringBuilder("SELECT M_Product_ID ,C_BPartner_ID "); + sql.append(" FROM M_Product_PO WHERE IsCurrentVendor = 'Y' "); + sql.append(" AND IsActive = 'Y' "); + sql.append(" AND M_Product_ID = ").append(dupl.getInt("M_Product_ID")); + sql.append(" ORDER BY PriceList DESC"); PreparedStatement Cur_Vendors = null; - Cur_Vendors = DB.prepareStatement(sql, get_TrxName()); + Cur_Vendors = DB.prepareStatement(sql.toString(), get_TrxName()); ResultSet Vend = Cur_Vendors.executeQuery(); // @@ -189,17 +188,17 @@ public class M_PriceList_Create extends SvrProcess { Vend.next(); while (Vend.next()) { - sqlupd = "UPDATE M_Product_PO " - + " SET IsCurrentVendor = 'N' " - + " WHERE M_Product_ID= " + Vend.getInt("M_Product_ID") - + " AND C_BPartner_ID= " - + Vend.getInt("C_BPartner_ID"); - - cntu = DB.executeUpdate(sqlupd, get_TrxName()); + sqlupd = new StringBuilder("UPDATE M_Product_PO "); + sqlupd.append(" SET IsCurrentVendor = 'N' "); + sqlupd.append(" WHERE M_Product_ID= ").append(Vend.getInt("M_Product_ID")); + sqlupd.append(" AND C_BPartner_ID= "); + sqlupd.append(Vend.getInt("C_BPartner_ID")); + + cntu = DB.executeUpdate(sqlupd.toString(), get_TrxName()); if (cntu == -1) raiseError( "Update IsCurrentVendor to N of M_Product_PO for a M_Product_ID and C_BPartner_ID ingresed", - sqlupd); + sqlupd.toString()); totu += cntu; log.fine("Updated " + cntu); @@ -219,12 +218,12 @@ public class M_PriceList_Create extends SvrProcess { // Delete Old Data // if (p_DeleteOld.equals("Y")) { - sqldel = "DELETE M_ProductPrice " - + " WHERE M_PriceList_Version_ID = " - + p_PriceList_Version_ID; - cntd = DB.executeUpdate(sqldel, get_TrxName()); + sqldel.append("DELETE M_ProductPrice ") + .append(" WHERE M_PriceList_Version_ID = ") + .append(p_PriceList_Version_ID); + cntd = DB.executeUpdate(sqldel.toString(), get_TrxName()); if (cntd == -1) - raiseError(" DELETE M_ProductPrice ", sqldel); + raiseError(" DELETE M_ProductPrice ", sqldel.toString()); totd += cntd; Message = "@Deleted@=" + cntd + " - "; log.fine("Deleted " + cntd); @@ -232,43 +231,47 @@ public class M_PriceList_Create extends SvrProcess { // // Get PriceList Info // - sql = "SELECT p.C_Currency_ID " + " , c.StdPrecision " - + " , v.AD_Client_ID " + " , v.AD_Org_ID " + " , v.UpdatedBy " - + " , v.M_DiscountSchema_ID " - + " , M_PriceList_Version_Base_ID " + " FROM M_PriceList p " - + " ,M_PriceList_Version v " + " ,C_Currency c " - + " WHERE p.M_PriceList_ID = v.M_PriceList_ID " - + " AND p.C_Currency_ID = c.C_Currency_ID" - + " AND v.M_PriceList_Version_ID = " + p_PriceList_Version_ID; + sql = new StringBuilder("SELECT p.C_Currency_ID , c.StdPrecision "); + sql.append(" , v.AD_Client_ID , v.AD_Org_ID , v.UpdatedBy "); + sql.append(" , v.M_DiscountSchema_ID "); + sql.append(" , M_PriceList_Version_Base_ID FROM M_PriceList p "); + sql.append(" ,M_PriceList_Version v ,C_Currency c "); + sql.append(" WHERE p.M_PriceList_ID = v.M_PriceList_ID "); + sql.append(" AND p.C_Currency_ID = c.C_Currency_ID"); + sql.append(" AND v.M_PriceList_Version_ID = ").append(p_PriceList_Version_ID); + PreparedStatement curgen = null; - curgen = DB.prepareStatement(sql, get_TrxName()); + curgen = DB.prepareStatement(sql.toString(), get_TrxName()); ResultSet v = curgen.executeQuery(); while (v.next()) { // // For All Discount Lines in Sequence // - sql = "SELECT m_discountschemaline_id" - + ",ad_client_id,ad_org_id,isactive,created,createdby,updated,updatedby" - + ",m_discountschema_id,seqno,m_product_category_id,c_bpartner_id,m_product_id" - + ",conversiondate,list_base,list_addamt,list_discount,list_rounding,list_minamt" - + ",list_maxamt,list_fixed,std_base,std_addamt,std_discount,std_rounding" - + ",std_minamt,std_maxamt,std_fixed,limit_base,limit_addamt,limit_discount" - + ",limit_rounding,limit_minamt,limit_maxamt,limit_fixed,group1,group2,c_conversiontype_id" - + " FROM M_DiscountSchemaLine" - + " WHERE M_DiscountSchema_ID=" - + v.getInt("M_DiscountSchema_ID") - + " AND IsActive='Y' ORDER BY SeqNo"; + sql = new StringBuilder("SELECT m_discountschemaline_id"); + sql.append(",ad_client_id,ad_org_id,isactive,created,createdby,updated,updatedby"); + sql.append(",m_discountschema_id,seqno,m_product_category_id,c_bpartner_id,m_product_id"); + sql.append(",conversiondate,list_base,list_addamt,list_discount,list_rounding,list_minamt"); + sql.append(",list_maxamt,list_fixed,std_base,std_addamt,std_discount,std_rounding"); + sql.append(",std_minamt,std_maxamt,std_fixed,limit_base,limit_addamt,limit_discount"); + sql.append(",limit_rounding,limit_minamt,limit_maxamt,limit_fixed,group1,group2,c_conversiontype_id"); + sql.append(" FROM M_DiscountSchemaLine"); + sql.append(" WHERE M_DiscountSchema_ID="); + sql.append(v.getInt("M_DiscountSchema_ID")); + sql.append(" AND IsActive='Y' ORDER BY SeqNo"); + PreparedStatement Cur_DiscountLine = null; - Cur_DiscountLine = DB.prepareStatement(sql, get_TrxName()); + Cur_DiscountLine = DB.prepareStatement(sql.toString(), get_TrxName()); ResultSet dl = Cur_DiscountLine.executeQuery(); while (dl.next()) { // //Clear Temporary Table // - sqldel = "DELETE FROM T_Selection WHERE AD_PInstance_ID="+ m_AD_PInstance_ID; - cntd = DB.executeUpdate(sqldel, get_TrxName()); + sqldel = new StringBuilder("DELETE FROM T_Selection WHERE AD_PInstance_ID="); + sqldel.append(m_AD_PInstance_ID); + + cntd = DB.executeUpdate(sqldel.toString(), get_TrxName()); if (cntd == -1) - raiseError(" DELETE T_Selection ", sqldel); + raiseError(" DELETE T_Selection ", sqldel.toString()); totd += cntd; log.fine("Deleted " + cntd); // @@ -281,29 +284,30 @@ public class M_PriceList_Create extends SvrProcess { // //Create Selection from M_Product_PO // - sqlins = "INSERT INTO T_Selection (AD_PInstance_ID, T_Selection_ID) " - + " SELECT DISTINCT " + m_AD_PInstance_ID +", po.M_Product_ID " - + " FROM M_Product p, M_Product_PO po" - + " WHERE p.M_Product_ID=po.M_Product_ID " - + " AND (p.AD_Client_ID=" + v.getInt("AD_Client_ID") + " OR p.AD_Client_ID=0)" - + " AND p.IsActive='Y' AND po.IsActive='Y' AND po.IsCurrentVendor='Y' " + sqlins.append("INSERT INTO T_Selection (AD_PInstance_ID, T_Selection_ID) "); + sqlins.append( " SELECT DISTINCT ").append(m_AD_PInstance_ID).append(", po.M_Product_ID "); + sqlins.append(" FROM M_Product p, M_Product_PO po"); + sqlins.append(" WHERE p.M_Product_ID=po.M_Product_ID "); + sqlins.append(" AND (p.AD_Client_ID=").append(v.getInt("AD_Client_ID")).append(" OR p.AD_Client_ID=0)"); + sqlins.append(" AND p.IsActive='Y' AND po.IsActive='Y' AND po.IsCurrentVendor='Y' "); // //Optional Restrictions // // globalqss - detected bug, JDBC returns zero for null values // so we're going to use NULLIF(value, 0) - + " AND (NULLIF(" + dl.getInt("M_Product_Category_ID") + ",0) IS NULL" - + " OR p.M_Product_Category_ID IN (" + getSubCategoryWhereClause(dl.getInt("M_Product_Category_ID")) + "))"; + sqlins.append(" AND (NULLIF(").append(dl.getInt("M_Product_Category_ID")).append(",0) IS NULL"); + sqlins.append(" OR p.M_Product_Category_ID IN (").append(getSubCategoryWhereClause(dl.getInt("M_Product_Category_ID"))) + .append("))"); if(dl_Group1 != null) - sqlins = sqlins + " AND (p.Group1=?)"; + sqlins.append(" AND (p.Group1=?)"); if (dl_Group2 != null) - sqlins = sqlins + " AND (p.Group2=?)"; - sqlins = sqlins + " AND (NULLIF(" + dl.getInt("C_BPartner_ID") + ",0) IS NULL " - + " OR po.C_BPartner_ID=" + dl.getInt("C_BPartner_ID") + ")" - + " AND (NULLIF(" + dl.getInt("M_Product_ID") + ",0) IS NULL " - + " OR p.M_Product_ID=" + dl.getInt("M_Product_ID") + ")"; + sqlins.append(" AND (p.Group2=?)"); + sqlins.append(" AND (NULLIF(").append(dl.getInt("C_BPartner_ID")).append(",0) IS NULL "); + sqlins.append(" OR po.C_BPartner_ID=").append(dl.getInt("C_BPartner_ID")).append(")"); + sqlins.append(" AND (NULLIF(").append(dl.getInt("M_Product_ID")).append(",0) IS NULL "); + sqlins.append(" OR p.M_Product_ID=").append(dl.getInt("M_Product_ID")).append(")"); - CPreparedStatement stmt = DB.prepareStatement(sqlins, get_TrxName()); + CPreparedStatement stmt = DB.prepareStatement(sqlins.toString(), get_TrxName()); int i = 1; @@ -315,7 +319,7 @@ public class M_PriceList_Create extends SvrProcess { cnti = stmt.executeUpdate(); if (cnti == -1) - raiseError(" INSERT INTO T_Selection ", sqlins); + raiseError(" INSERT INTO T_Selection ", sqlins.toString()); toti += cnti; log.fine("Inserted " + cnti); @@ -323,36 +327,37 @@ public class M_PriceList_Create extends SvrProcess { // // Create Selection from existing PriceList // - sqlins = "INSERT INTO T_Selection (AD_PInstance_ID, T_Selection_ID)" - + " SELECT DISTINCT " + m_AD_PInstance_ID +", p.M_Product_ID" - + " FROM M_Product p, M_ProductPrice pp" - + " WHERE p.M_Product_ID=pp.M_Product_ID" - + " AND pp.M_PriceList_Version_ID = " + v.getInt("M_PriceList_Version_Base_ID") - + " AND p.IsActive='Y' AND pp.IsActive='Y'" + sqlins = new StringBuilder("INSERT INTO T_Selection (AD_PInstance_ID, T_Selection_ID)"); + sqlins.append(" SELECT DISTINCT ").append(m_AD_PInstance_ID).append(", p.M_Product_ID"); + sqlins.append(" FROM M_Product p, M_ProductPrice pp"); + sqlins.append(" WHERE p.M_Product_ID=pp.M_Product_ID"); + sqlins.append(" AND pp.M_PriceList_Version_ID = ").append(v.getInt("M_PriceList_Version_Base_ID")); + sqlins.append(" AND p.IsActive='Y' AND pp.IsActive='Y'"); // //Optional Restrictions // - + " AND (NULLIF(" + dl.getInt("M_Product_Category_ID") + ",0) IS NULL" - + " OR p.M_Product_Category_ID IN (" + getSubCategoryWhereClause(dl.getInt("M_Product_Category_ID")) + "))"; + sqlins.append(" AND (NULLIF(").append(dl.getInt("M_Product_Category_ID")).append(",0) IS NULL"); + sqlins.append(" OR p.M_Product_Category_ID IN (").append(getSubCategoryWhereClause(dl.getInt("M_Product_Category_ID"))) + .append("))"); if(dl_Group1 != null) - sqlins = sqlins + " AND (p.Group1=?)"; + sqlins.append(" AND (p.Group1=?)"); if (dl_Group2 != null) - sqlins = sqlins + " AND (p.Group2=?)"; - sqlins = sqlins + " AND (NULLIF(" + dl.getInt("C_BPartner_ID") + ",0) IS NULL OR EXISTS " - + "(SELECT m_product_id,c_bpartner_id,ad_client_id,ad_org_id,isactive" - + ",created,createdby,updated,updatedby,iscurrentvendor,c_uom_id" - + ",c_currency_id,pricelist,pricepo,priceeffective,pricelastpo" - + ",pricelastinv,vendorproductno,upc,vendorcategory,discontinued" - + ",discontinuedby,order_min,order_pack,costperorder" - + ",deliverytime_promised,deliverytime_actual,qualityrating" - + ",royaltyamt,group1,group2" - + ",manufacturer FROM M_Product_PO po WHERE po.M_Product_ID=p.M_Product_ID" - + " AND po.C_BPartner_ID=" + dl.getInt("C_BPartner_ID") + "))" - + " AND (NULLIF(" + dl.getInt("M_Product_ID") + ",0) IS NULL " - + " OR p.M_Product_ID=" + dl.getInt("M_Product_ID") + ")"; + sqlins.append(" AND (p.Group2=?)"); + sqlins.append(" AND (NULLIF(").append(dl.getInt("C_BPartner_ID")).append(",0) IS NULL OR EXISTS "); + sqlins.append("(SELECT m_product_id,c_bpartner_id,ad_client_id,ad_org_id,isactive"); + sqlins.append(",created,createdby,updated,updatedby,iscurrentvendor,c_uom_id"); + sqlins.append(",c_currency_id,pricelist,pricepo,priceeffective,pricelastpo"); + sqlins.append(",pricelastinv,vendorproductno,upc,vendorcategory,discontinued"); + sqlins.append(",discontinuedby,order_min,order_pack,costperorder"); + sqlins.append(",deliverytime_promised,deliverytime_actual,qualityrating"); + sqlins.append(",royaltyamt,group1,group2"); + sqlins.append(",manufacturer FROM M_Product_PO po WHERE po.M_Product_ID=p.M_Product_ID"); + sqlins.append(" AND po.C_BPartner_ID=").append(dl.getInt("C_BPartner_ID")).append("))"); + sqlins.append(" AND (NULLIF(").append(dl.getInt("M_Product_ID")).append(",0) IS NULL "); + sqlins.append(" OR p.M_Product_ID=").append(dl.getInt("M_Product_ID")).append(")"); - CPreparedStatement stmt = DB.prepareStatement(sqlins, get_TrxName()); + CPreparedStatement stmt = DB.prepareStatement(sqlins.toString(), get_TrxName()); int i = 1; if (dl_Group1!=null) @@ -364,7 +369,7 @@ public class M_PriceList_Create extends SvrProcess { if (cnti == -1) raiseError( " INSERT INTO T_Selection from existing PriceList", - sqlins); + sqlins.toString()); toti += cnti; log.fine("Inserted " + cnti); @@ -378,15 +383,15 @@ public class M_PriceList_Create extends SvrProcess { V_temp = v.getInt("M_PriceList_Version_Base_ID"); if (v.wasNull() || V_temp != p_PriceList_Version_ID) { - sqldel = "DELETE M_ProductPrice pp" - + " WHERE pp.M_PriceList_Version_ID = " - + p_PriceList_Version_ID - + " AND EXISTS (SELECT t_selection_id FROM T_Selection s WHERE pp.M_Product_ID=s.T_Selection_ID" - + " AND s.AD_PInstance_ID=" + m_AD_PInstance_ID + ")"; + sqldel = new StringBuilder("DELETE M_ProductPrice pp"); + sqldel.append(" WHERE pp.M_PriceList_Version_ID = "); + sqldel.append(p_PriceList_Version_ID); + sqldel.append(" AND EXISTS (SELECT t_selection_id FROM T_Selection s WHERE pp.M_Product_ID=s.T_Selection_ID"); + sqldel.append(" AND s.AD_PInstance_ID=").append(m_AD_PInstance_ID).append(")"); - cntd = DB.executeUpdate(sqldel, get_TrxName()); + cntd = DB.executeUpdate(sqldel.toString(), get_TrxName()); if (cntd == -1) - raiseError(" DELETE M_ProductPrice ", sqldel); + raiseError(" DELETE M_ProductPrice ", sqldel.toString()); totd += cntd; Message = Message + ", @Deleted@=" + cntd; log.fine("Deleted " + cntd); @@ -406,71 +411,71 @@ public class M_PriceList_Create extends SvrProcess { //Copy and Convert from Product_PO // { - sqlins = "INSERT INTO M_ProductPrice " - + "(M_PriceList_Version_ID" - + " ,M_Product_ID " - + " ,AD_Client_ID" - + " , AD_Org_ID" - + " , IsActive" - + " , Created" - + " , CreatedBy" - + " , Updated" - + " , UpdatedBy" - + " , PriceList" - + " , PriceStd" - + " , PriceLimit) " - + "SELECT " - + p_PriceList_Version_ID - + " ,po.M_Product_ID " - + " ," - + v.getInt("AD_Client_ID") - + " ," - + v.getInt("AD_Org_ID") - + " ,'Y'" - + " ,SysDate," - + v.getInt("UpdatedBy") - + " ,SysDate," - + v.getInt("UpdatedBy") - // - //Price List - // - + " ,COALESCE(currencyConvert(po.PriceList, po.C_Currency_ID, " - + v.getInt("C_Currency_ID") - + ", ? , " - + dl.getInt("C_ConversionType_ID") - + ", " - + v.getInt("AD_Client_ID") - + ", " - + v.getInt("AD_Org_ID") - + "),0)" - - // Price Std - + " ,COALESCE(currencyConvert(po.PriceList, po.C_Currency_ID, " - + v.getInt("C_Currency_ID") - + ", ? , " - + dl.getInt("C_ConversionType_ID") - + ", " - + v.getInt("AD_Client_ID") - + ", " - + v.getInt("AD_Org_ID") - + "),0)" - - // Price Limit - + " ,COALESCE(currencyConvert(po.PricePO ,po.C_Currency_ID, " - + v.getInt("C_Currency_ID") - + ",? , " - + dl.getInt("C_ConversionType_ID") - + ", " - + v.getInt("AD_Client_ID") - + ", " - + v.getInt("AD_Org_ID") - + "),0)" - + " FROM M_Product_PO po " - + " WHERE EXISTS (SELECT * FROM T_Selection s WHERE po.M_Product_ID=s.T_Selection_ID" - + " AND s.AD_PInstance_ID=" + m_AD_PInstance_ID + ") " - + " AND po.IsCurrentVendor='Y' AND po.IsActive='Y'"; + sqlins = new StringBuilder("INSERT INTO M_ProductPrice "); + sqlins.append("(M_PriceList_Version_ID"); + sqlins.append(" ,M_Product_ID "); + sqlins.append(" ,AD_Client_ID"); + sqlins.append(" , AD_Org_ID"); + sqlins.append(" , IsActive"); + sqlins.append(" , Created"); + sqlins.append(" , CreatedBy"); + sqlins.append(" , Updated"); + sqlins.append(" , UpdatedBy"); + sqlins.append(" , PriceList"); + sqlins.append(" , PriceStd"); + sqlins.append(" , PriceLimit) "); + sqlins.append("SELECT "); + sqlins.append(p_PriceList_Version_ID); + sqlins.append(" ,po.M_Product_ID "); + sqlins.append(" ,"); + sqlins.append(v.getInt("AD_Client_ID")); + sqlins.append(" ,"); + sqlins.append(v.getInt("AD_Org_ID")); + sqlins.append(" ,'Y'"); + sqlins.append(" ,SysDate,"); + sqlins.append(v.getInt("UpdatedBy")); + sqlins.append(" ,SysDate,"); + sqlins.append(v.getInt("UpdatedBy")); + // + //Price List + // + sqlins.append(" ,COALESCE(currencyConvert(po.PriceList, po.C_Currency_ID, "); + sqlins.append(v.getInt("C_Currency_ID")); + sqlins.append(", ? , "); + sqlins.append(dl.getInt("C_ConversionType_ID")); + sqlins.append(", "); + sqlins.append(v.getInt("AD_Client_ID")); + sqlins.append(", "); + sqlins.append(v.getInt("AD_Org_ID")); + sqlins.append("),0)"); + + // Price Std + sqlins.append(" ,COALESCE(currencyConvert(po.PriceList, po.C_Currency_ID, "); + sqlins.append(v.getInt("C_Currency_ID")); + sqlins.append(", ? , "); + sqlins.append(dl.getInt("C_ConversionType_ID")); + sqlins.append(", "); + sqlins.append(v.getInt("AD_Client_ID")); + sqlins.append(", "); + sqlins.append(v.getInt("AD_Org_ID")); + sqlins.append("),0)"); + + // Price Limit + sqlins.append(" ,COALESCE(currencyConvert(po.PricePO ,po.C_Currency_ID, "); + sqlins.append(v.getInt("C_Currency_ID")); + sqlins.append(",? , "); + sqlins.append(dl.getInt("C_ConversionType_ID")); + sqlins.append(", "); + sqlins.append(v.getInt("AD_Client_ID")); + sqlins.append(", "); + sqlins.append(v.getInt("AD_Org_ID")); + sqlins.append("),0)"); + sqlins.append(" FROM M_Product_PO po "); + sqlins.append(" WHERE EXISTS (SELECT * FROM T_Selection s WHERE po.M_Product_ID=s.T_Selection_ID"); + sqlins.append(" AND s.AD_PInstance_ID=").append(m_AD_PInstance_ID).append(") "); + sqlins.append(" AND po.IsCurrentVendor='Y' AND po.IsActive='Y'"); - PreparedStatement pstmt = DB.prepareStatement(sqlins, + PreparedStatement pstmt = DB.prepareStatement(sqlins.toString(), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE, get_TrxName()); pstmt.setTimestamp(1, dl.getTimestamp("ConversionDate")); @@ -481,68 +486,68 @@ public class M_PriceList_Create extends SvrProcess { if (cnti == -1) raiseError( " INSERT INTO T_Selection from existing PriceList", - sqlins); + sqlins.toString()); toti += cnti; log.fine("Inserted " + cnti); } else { // //Copy and Convert from other PriceList_Version // - sqlins = "INSERT INTO M_ProductPrice " - + " (M_PriceList_Version_ID, M_Product_ID," - + " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy," - + " PriceList, PriceStd, PriceLimit)" - + " SELECT " - + p_PriceList_Version_ID - + ", pp.M_Product_ID," - + v.getInt("AD_Client_ID") - + ", " - + v.getInt("AD_Org_ID") - + ", 'Y', SysDate, " - + v.getInt("UpdatedBy") - + ", SysDate, " - + v.getInt("UpdatedBy") - + " ," - // Price List - + "COALESCE(currencyConvert(pp.PriceList, pl.C_Currency_ID, " - + v.getInt("C_Currency_ID") - + ", ?, " - + dl.getInt("C_ConversionType_ID") - + ", " - + v.getInt("AD_Client_ID") - + ", " - + v.getInt("AD_Org_ID") - + "),0)," - // Price Std - + "COALESCE(currencyConvert(pp.PriceStd,pl.C_Currency_ID, " - + v.getInt("C_Currency_ID") - + " , ? , " - + dl.getInt("C_ConversionType_ID") - + ", " - + v.getInt("AD_Client_ID") - + ", " - + v.getInt("AD_Org_ID") - + "),0)," - //Price Limit - + " COALESCE(currencyConvert(pp.PriceLimit,pl.C_Currency_ID, " - + v.getInt("C_Currency_ID") - + " , ? , " - + dl.getInt("C_ConversionType_ID") - + ", " - + v.getInt("AD_Client_ID") - + ", " - + v.getInt("AD_Org_ID") - + "),0)" - + " FROM M_ProductPrice pp" - + " INNER JOIN M_PriceList_Version plv ON (pp.M_PriceList_Version_ID=plv.M_PriceList_Version_ID)" - + " INNER JOIN M_PriceList pl ON (plv.M_PriceList_ID=pl.M_PriceList_ID)" - + " WHERE pp.M_PriceList_Version_ID=" - + v.getInt("M_PriceList_Version_Base_ID") - + " AND EXISTS (SELECT * FROM T_Selection s WHERE pp.M_Product_ID=s.T_Selection_ID" - + " AND s.AD_PInstance_ID=" + m_AD_PInstance_ID + ")" - + "AND pp.IsActive='Y'"; + sqlins = new StringBuilder("INSERT INTO M_ProductPrice "); + sqlins.append(" (M_PriceList_Version_ID, M_Product_ID,"); + sqlins.append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,"); + sqlins.append(" PriceList, PriceStd, PriceLimit)"); + sqlins.append(" SELECT "); + sqlins.append(p_PriceList_Version_ID); + sqlins.append(", pp.M_Product_ID,"); + sqlins.append(v.getInt("AD_Client_ID")); + sqlins.append(", "); + sqlins.append(v.getInt("AD_Org_ID")); + sqlins.append(", 'Y', SysDate, "); + sqlins.append(v.getInt("UpdatedBy")); + sqlins.append(", SysDate, "); + sqlins.append(v.getInt("UpdatedBy")); + sqlins.append(" ,"); + // Price List + sqlins.append("COALESCE(currencyConvert(pp.PriceList, pl.C_Currency_ID, "); + sqlins.append(v.getInt("C_Currency_ID")); + sqlins.append(", ?, "); + sqlins.append(dl.getInt("C_ConversionType_ID")); + sqlins.append(", "); + sqlins.append(v.getInt("AD_Client_ID")); + sqlins.append(", "); + sqlins.append(v.getInt("AD_Org_ID")); + sqlins.append("),0),"); + // Price Std + sqlins.append("COALESCE(currencyConvert(pp.PriceStd,pl.C_Currency_ID, "); + sqlins.append(v.getInt("C_Currency_ID")); + sqlins.append(" , ? , "); + sqlins.append(dl.getInt("C_ConversionType_ID")); + sqlins.append(", "); + sqlins.append(v.getInt("AD_Client_ID")); + sqlins.append(", "); + sqlins.append(v.getInt("AD_Org_ID")); + sqlins.append("),0),"); + //Price Limit + sqlins.append(" COALESCE(currencyConvert(pp.PriceLimit,pl.C_Currency_ID, "); + sqlins.append(v.getInt("C_Currency_ID")); + sqlins.append(" , ? , "); + sqlins.append(dl.getInt("C_ConversionType_ID")); + sqlins.append(", "); + sqlins.append(v.getInt("AD_Client_ID")); + sqlins.append(", "); + sqlins.append(v.getInt("AD_Org_ID")); + sqlins.append("),0)"); + sqlins.append(" FROM M_ProductPrice pp"); + sqlins.append(" INNER JOIN M_PriceList_Version plv ON (pp.M_PriceList_Version_ID=plv.M_PriceList_Version_ID)"); + sqlins.append(" INNER JOIN M_PriceList pl ON (plv.M_PriceList_ID=pl.M_PriceList_ID)"); + sqlins.append(" WHERE pp.M_PriceList_Version_ID="); + sqlins.append(v.getInt("M_PriceList_Version_Base_ID")); + sqlins.append(" AND EXISTS (SELECT * FROM T_Selection s WHERE pp.M_Product_ID=s.T_Selection_ID"); + sqlins.append(" AND s.AD_PInstance_ID=").append(m_AD_PInstance_ID).append(")"); + sqlins.append("AND pp.IsActive='Y'"); - PreparedStatement pstmt = DB.prepareStatement(sqlins, + PreparedStatement pstmt = DB.prepareStatement(sqlins.toString(), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE, get_TrxName()); pstmt.setTimestamp(1, dl.getTimestamp("ConversionDate")); @@ -554,7 +559,7 @@ public class M_PriceList_Create extends SvrProcess { if (cnti == -1) raiseError( " INSERT INTO T_Selection from existing PriceList", - sqlins); + sqlins.toString()); toti += cnti; log.fine("Inserted " + cnti); @@ -563,23 +568,24 @@ public class M_PriceList_Create extends SvrProcess { // // Calculation // - sqlupd = "UPDATE M_ProductPrice p " - + " SET PriceList = (DECODE( '" - + dl.getString("List_Base") - + "', 'S', PriceStd, 'X', PriceLimit, PriceList)" - + " + ?) * (1 - ?/100)," + " PriceStd = (DECODE('" - + dl.getString("Std_Base") - + "', 'L', PriceList, 'X', PriceLimit, PriceStd) " - + " + ?) * (1 - ?/100), " + " PriceLimit = (DECODE('" - + dl.getString("Limit_Base") - + "', 'L', PriceList, 'S', PriceStd, PriceLimit) " - + " + ?) * (1 - ? /100) " - + " WHERE M_PriceList_Version_ID = " - + p_PriceList_Version_ID - + " AND EXISTS (SELECT * FROM T_Selection s " - + " WHERE s.T_Selection_ID = p.M_Product_ID" - + " AND s.AD_PInstance_ID=" + m_AD_PInstance_ID + ")"; - PreparedStatement pstmu = DB.prepareStatement(sqlupd, + sqlupd = new StringBuilder("UPDATE M_ProductPrice p "); + sqlupd.append(" SET PriceList = (DECODE( '"); + sqlupd.append(dl.getString("List_Base")); + sqlupd.append("', 'S', PriceStd, 'X', PriceLimit, PriceList)"); + sqlupd.append(" + ?) * (1 - ?/100), PriceStd = (DECODE('"); + sqlupd.append(dl.getString("Std_Base")); + sqlupd.append("', 'L', PriceList, 'X', PriceLimit, PriceStd) "); + sqlupd.append(" + ?) * (1 - ?/100), ").append(" PriceLimit = (DECODE('"); + sqlupd.append(dl.getString("Limit_Base")); + sqlupd.append("', 'L', PriceList, 'S', PriceStd, PriceLimit) "); + sqlupd.append(" + ?) * (1 - ? /100) "); + sqlupd.append(" WHERE M_PriceList_Version_ID = "); + sqlupd.append(p_PriceList_Version_ID); + sqlupd.append(" AND EXISTS (SELECT * FROM T_Selection s "); + sqlupd.append(" WHERE s.T_Selection_ID = p.M_Product_ID"); + sqlupd.append(" AND s.AD_PInstance_ID=").append(m_AD_PInstance_ID).append(")"); + + PreparedStatement pstmu = DB.prepareStatement(sqlupd.toString(), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE, get_TrxName()); @@ -593,59 +599,60 @@ public class M_PriceList_Create extends SvrProcess { cntu = pstmu.executeUpdate(); if (cntu == -1) - raiseError("Update M_ProductPrice ", sqlupd); + raiseError("Update M_ProductPrice ", sqlupd.toString()); totu += cntu; log.fine("Updated " + cntu); // //Rounding (AD_Reference_ID=155) // - sqlupd = "UPDATE M_ProductPrice p " - + " SET PriceList = DECODE('" - + dl.getString("List_Rounding") + "'," - + " 'N', PriceList, " - + " '0', ROUND(PriceList, 0)," //Even .00 - + " 'D', ROUND(PriceList, 1)," //Dime .10 - + " 'T', ROUND(PriceList, -1), " //Ten 10.00 - + " '5', ROUND(PriceList*20,0)/20," //Nickle .05 - + " 'Q', ROUND(PriceList*4,0)/4," //Quarter .25 - + " '9', CASE" //Whole 9 or 5 - + " WHEN MOD(ROUND(PriceList),10)<=5 THEN ROUND(PriceList)+(5-MOD(ROUND(PriceList),10))" - + " WHEN MOD(ROUND(PriceList),10)>5 THEN ROUND(PriceList)+(9-MOD(ROUND(PriceList),10)) END," - + " ROUND(PriceList, " + v.getInt("StdPrecision") - + "))," //Currency - + " PriceStd = DECODE('" + dl.getString("Std_Rounding") - + "'," + " 'N', PriceStd, " - + " '0', ROUND(PriceStd, 0), " //Even .00 - + " 'D', ROUND(PriceStd, 1), " //Dime .10 - + "'T', ROUND(PriceStd, -1)," //Ten 10.00 - + "'5', ROUND(PriceStd*20,0)/20," //Nickle .05 - + "'Q', ROUND(PriceStd*4,0)/4," //Quarter .25 - + " '9', CASE" //Whole 9 or 5 - + " WHEN MOD(ROUND(PriceStd),10)<=5 THEN ROUND(PriceStd)+(5-MOD(ROUND(PriceStd),10))" - + " WHEN MOD(ROUND(PriceStd),10)>5 THEN ROUND(PriceStd)+(9-MOD(ROUND(PriceStd),10)) END," - + "ROUND(PriceStd, " + v.getInt("StdPrecision") + "))," //Currency - + "PriceLimit = DECODE('" - + dl.getString("Limit_Rounding") + "', " - + " 'N', PriceLimit, " - + " '0', ROUND(PriceLimit, 0), " // Even .00 - + " 'D', ROUND(PriceLimit, 1), " // Dime .10 - + " 'T', ROUND(PriceLimit, -1), " // Ten 10.00 - + " '5', ROUND(PriceLimit*20,0)/20, " // Nickle .05 - + " 'Q', ROUND(PriceLimit*4,0)/4, " //Quarter .25 - + " '9', CASE" //Whole 9 or 5 - + " WHEN MOD(ROUND(PriceLimit),10)<=5 THEN ROUND(PriceLimit)+(5-MOD(ROUND(PriceLimit),10))" - + " WHEN MOD(ROUND(PriceLimit),10)>5 THEN ROUND(PriceLimit)+(9-MOD(ROUND(PriceLimit),10)) END," - + " ROUND(PriceLimit, " + v.getInt("StdPrecision") - + ")) " // Currency - + " WHERE M_PriceList_Version_ID=" - + p_PriceList_Version_ID - + " AND EXISTS (SELECT * FROM T_Selection s " - + " WHERE s.T_Selection_ID=p.M_Product_ID" - + " AND s.AD_PInstance_ID=" + m_AD_PInstance_ID + ")"; - cntu = DB.executeUpdate(sqlupd, get_TrxName()); + sqlupd = new StringBuilder("UPDATE M_ProductPrice p "); + sqlupd.append(" SET PriceList = DECODE('"); + sqlupd.append(dl.getString("List_Rounding")).append("',"); + sqlupd.append(" 'N', PriceList, "); + sqlupd.append(" '0', ROUND(PriceList, 0),"); //Even .00 + sqlupd.append(" 'D', ROUND(PriceList, 1),"); //Dime .10 + sqlupd.append(" 'T', ROUND(PriceList, -1), "); //Ten 10.00 + sqlupd.append(" '5', ROUND(PriceList*20,0)/20,"); //Nickle .05 + sqlupd.append(" 'Q', ROUND(PriceList*4,0)/4,"); //Quarter .25 + sqlupd.append(" '9', CASE"); //Whole 9 or 5 + sqlupd.append(" WHEN MOD(ROUND(PriceList),10)<=5 THEN ROUND(PriceList)+(5-MOD(ROUND(PriceList),10))"); + sqlupd.append(" WHEN MOD(ROUND(PriceList),10)>5 THEN ROUND(PriceList)+(9-MOD(ROUND(PriceList),10)) END,"); + sqlupd.append(" ROUND(PriceList, ").append(v.getInt("StdPrecision")); + sqlupd.append(")),");//Currency + sqlupd.append(" PriceStd = DECODE('").append(dl.getString("Std_Rounding")); + sqlupd.append("',").append(" 'N', PriceStd, "); + sqlupd.append(" '0', ROUND(PriceStd, 0), "); //Even .00 + sqlupd.append(" 'D', ROUND(PriceStd, 1), "); //Dime .10 + sqlupd.append("'T', ROUND(PriceStd, -1),"); //Ten 10.00) + sqlupd.append("'5', ROUND(PriceStd*20,0)/20,"); //Nickle .05 + sqlupd.append("'Q', ROUND(PriceStd*4,0)/4,"); //Quarter .25 + sqlupd.append(" '9', CASE"); //Whole 9 or 5 + sqlupd.append(" WHEN MOD(ROUND(PriceStd),10)<=5 THEN ROUND(PriceStd)+(5-MOD(ROUND(PriceStd),10))"); + sqlupd.append(" WHEN MOD(ROUND(PriceStd),10)>5 THEN ROUND(PriceStd)+(9-MOD(ROUND(PriceStd),10)) END,"); + sqlupd.append("ROUND(PriceStd, ").append(v.getInt("StdPrecision")).append(")),"); //Currency + sqlupd.append("PriceLimit = DECODE('"); + sqlupd.append(dl.getString("Limit_Rounding")).append("', "); + sqlupd.append(" 'N', PriceLimit, "); + sqlupd.append(" '0', ROUND(PriceLimit, 0), "); // Even .00 + sqlupd.append(" 'D', ROUND(PriceLimit, 1), "); // Dime .10 + sqlupd.append(" 'T', ROUND(PriceLimit, -1), "); // Ten 10.00 + sqlupd.append(" '5', ROUND(PriceLimit*20,0)/20, "); // Nickle .05 + sqlupd.append(" 'Q', ROUND(PriceLimit*4,0)/4, "); //Quarter .25 + sqlupd.append(" '9', CASE"); //Whole 9 or 5 + sqlupd.append(" WHEN MOD(ROUND(PriceLimit),10)<=5 THEN ROUND(PriceLimit)+(5-MOD(ROUND(PriceLimit),10))"); + sqlupd.append(" WHEN MOD(ROUND(PriceLimit),10)>5 THEN ROUND(PriceLimit)+(9-MOD(ROUND(PriceLimit),10)) END,"); + sqlupd.append(" ROUND(PriceLimit, ").append(v.getInt("StdPrecision")); + sqlupd.append(")) "); // Currency + sqlupd.append(" WHERE M_PriceList_Version_ID="); + sqlupd.append(p_PriceList_Version_ID); + sqlupd.append(" AND EXISTS (SELECT * FROM T_Selection s "); + sqlupd.append(" WHERE s.T_Selection_ID=p.M_Product_ID"); + sqlupd.append(" AND s.AD_PInstance_ID=").append(m_AD_PInstance_ID).append(")"); + + cntu = DB.executeUpdate(sqlupd.toString(), get_TrxName()); if (cntu == -1) - raiseError("Update M_ProductPrice ", sqlupd); + raiseError("Update M_ProductPrice ", sqlupd.toString()); totu += cntu; log.fine("Updated " + cntu); @@ -653,24 +660,25 @@ public class M_PriceList_Create extends SvrProcess { // //Fixed Price overwrite // - sqlupd = "UPDATE M_ProductPrice p " - + " SET PriceList = DECODE('" - + dl.getString("List_Base") + "', 'F', " - + dl.getDouble("List_Fixed") + ", PriceList), " - + " PriceStd = DECODE('" - + dl.getString("Std_Base") + "', 'F', " - + dl.getDouble("Std_Fixed") + ", PriceStd)," - + " PriceLimit = DECODE('" - + dl.getString("Limit_Base") + "', 'F', " - + dl.getDouble("Limit_Fixed") + ", PriceLimit)" - + " WHERE M_PriceList_Version_ID=" - + p_PriceList_Version_ID - + " AND EXISTS (SELECT * FROM T_Selection s" - + " WHERE s.T_Selection_ID=p.M_Product_ID" - + " AND s.AD_PInstance_ID=" + m_AD_PInstance_ID + ")"; - cntu = DB.executeUpdate(sqlupd, get_TrxName()); + sqlupd = new StringBuilder("UPDATE M_ProductPrice p "); + sqlupd.append(" SET PriceList = DECODE('"); + sqlupd.append(dl.getString("List_Base")).append("', 'F', "); + sqlupd.append(dl.getDouble("List_Fixed")).append(", PriceList), "); + sqlupd.append(" PriceStd = DECODE('"); + sqlupd.append(dl.getString("Std_Base")).append("', 'F', "); + sqlupd.append(dl.getDouble("Std_Fixed")).append(", PriceStd),"); + sqlupd.append(" PriceLimit = DECODE('"); + sqlupd.append(dl.getString("Limit_Base")).append("', 'F', "); + sqlupd.append(dl.getDouble("Limit_Fixed")).append(", PriceLimit)"); + sqlupd.append(" WHERE M_PriceList_Version_ID="); + sqlupd.append(p_PriceList_Version_ID); + sqlupd.append(" AND EXISTS (SELECT * FROM T_Selection s"); + sqlupd.append(" WHERE s.T_Selection_ID=p.M_Product_ID"); + sqlupd.append(" AND s.AD_PInstance_ID=").append(m_AD_PInstance_ID).append(")"); + + cntu = DB.executeUpdate(sqlupd.toString(), get_TrxName()); if (cntu == -1) - raiseError("Update M_ProductPrice ", sqlupd); + raiseError("Update M_ProductPrice ", sqlupd.toString()); totu += cntu; log.fine("Updated " + cntu); @@ -685,10 +693,10 @@ public class M_PriceList_Create extends SvrProcess { // // Delete Temporary Selection // - sqldel = "DELETE FROM T_Selection "; - cntd = DB.executeUpdate(sqldel, get_TrxName()); + sqldel = new StringBuilder("DELETE FROM T_Selection "); + cntd = DB.executeUpdate(sqldel.toString(), get_TrxName()); if (cntd == -1) - raiseError(" DELETE T_Selection ", sqldel); + raiseError(" DELETE T_Selection ", sqldel.toString()); totd += cntd; log.fine("Deleted " + cntd); @@ -753,7 +761,7 @@ public class M_PriceList_Create extends SvrProcess { * @throws AdempiereSystemError if a loop is detected */ private String getSubCategoriesString(int productCategoryId, Vector categories, int loopIndicatorId) throws AdempiereSystemError { - String ret = ""; + StringBuilder ret = new StringBuilder(); final Iterator iter = categories.iterator(); while (iter.hasNext()) { SimpleTreeNode node = (SimpleTreeNode) iter.next(); @@ -761,11 +769,12 @@ public class M_PriceList_Create extends SvrProcess { if (node.getNodeId() == loopIndicatorId) { throw new AdempiereSystemError("The product category tree contains a loop on categoryId: " + loopIndicatorId); } - ret = ret + getSubCategoriesString(node.getNodeId(), categories, loopIndicatorId) + ","; + ret.append(getSubCategoriesString(node.getNodeId(), categories, loopIndicatorId)); + ret.append(","); } } - log.fine(ret); - return ret + productCategoryId; + log.fine(ret.toString()); + return ret.toString() + productCategoryId; } /** @@ -793,6 +802,6 @@ public class M_PriceList_Create extends SvrProcess { } } - + } // M_PriceList_Create \ No newline at end of file diff --git a/org.adempiere.base.process/src/org/compiere/process/ReplenishReport.java b/org.adempiere.base.process/src/org/compiere/process/ReplenishReport.java index d92f406c2f..0b22b09164 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ReplenishReport.java +++ b/org.adempiere.base.process/src/org/compiere/process/ReplenishReport.java @@ -100,10 +100,11 @@ public class ReplenishReport extends SvrProcess */ protected String doIt() throws Exception { - log.info("M_Warehouse_ID=" + p_M_Warehouse_ID - + ", C_BPartner_ID=" + p_C_BPartner_ID - + " - ReplenishmentCreate=" + p_ReplenishmentCreate - + ", C_DocType_ID=" + p_C_DocType_ID); + StringBuilder msglog = new StringBuilder("M_Warehouse_ID=").append(p_M_Warehouse_ID) + .append(", C_BPartner_ID=").append(p_C_BPartner_ID) + .append(" - ReplenishmentCreate=").append(p_ReplenishmentCreate) + .append(", C_DocType_ID=").append(p_C_DocType_ID); + log.info(msglog.toString()); if (p_ReplenishmentCreate != null && p_C_DocType_ID == 0) throw new AdempiereUserError("@FillMandatory@ @C_DocType_ID@"); @@ -138,56 +139,57 @@ public class ReplenishReport extends SvrProcess private void prepareTable() { // Level_Max must be >= Level_Max - String sql = "UPDATE M_Replenish" - + " SET Level_Max = Level_Min " - + "WHERE Level_Max < Level_Min"; - int no = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("UPDATE M_Replenish") + .append(" SET Level_Max = Level_Min ") + .append("WHERE Level_Max < Level_Min"); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Corrected Max_Level=" + no); // Minimum Order should be 1 - sql = "UPDATE M_Product_PO" - + " SET Order_Min = 1 " - + "WHERE Order_Min IS NULL OR Order_Min < 1"; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE M_Product_PO") + .append(" SET Order_Min = 1 ") + .append("WHERE Order_Min IS NULL OR Order_Min < 1"); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Corrected Order Min=" + no); // Pack should be 1 - sql = "UPDATE M_Product_PO" - + " SET Order_Pack = 1 " - + "WHERE Order_Pack IS NULL OR Order_Pack < 1"; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE M_Product_PO") + .append(" SET Order_Pack = 1 ") + .append("WHERE Order_Pack IS NULL OR Order_Pack < 1"); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Corrected Order Pack=" + no); // Set Current Vendor where only one vendor - sql = "UPDATE M_Product_PO p" - + " SET IsCurrentVendor='Y' " - + "WHERE IsCurrentVendor<>'Y'" - + " AND EXISTS (SELECT pp.M_Product_ID FROM M_Product_PO pp " - + "WHERE p.M_Product_ID=pp.M_Product_ID " - + "GROUP BY pp.M_Product_ID " - + "HAVING COUNT(*) = 1)"; - no = DB.executeUpdate(sql, get_TrxName()); + + sql = new StringBuilder("UPDATE M_Product_PO p") + .append(" SET IsCurrentVendor='Y' ") + .append("WHERE IsCurrentVendor<>'Y'") + .append(" AND EXISTS (SELECT pp.M_Product_ID FROM M_Product_PO pp ") + .append("WHERE p.M_Product_ID=pp.M_Product_ID ") + .append("GROUP BY pp.M_Product_ID ") + .append("HAVING COUNT(*) = 1)"); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Corrected CurrentVendor(Y)=" + no); // More then one current vendor - sql = "UPDATE M_Product_PO p" - + " SET IsCurrentVendor='N' " - + "WHERE IsCurrentVendor = 'Y'" - + " AND EXISTS (SELECT pp.M_Product_ID FROM M_Product_PO pp " - + "WHERE p.M_Product_ID=pp.M_Product_ID AND pp.IsCurrentVendor='Y' " - + "GROUP BY pp.M_Product_ID " - + "HAVING COUNT(*) > 1)"; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE M_Product_PO p") + .append(" SET IsCurrentVendor='N' ") + .append("WHERE IsCurrentVendor = 'Y'") + .append(" AND EXISTS (SELECT pp.M_Product_ID FROM M_Product_PO pp ") + .append("WHERE p.M_Product_ID=pp.M_Product_ID AND pp.IsCurrentVendor='Y' ") + .append("GROUP BY pp.M_Product_ID ") + .append("HAVING COUNT(*) > 1)"); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Corrected CurrentVendor(N)=" + no); // Just to be sure - sql = "DELETE T_Replenish WHERE AD_PInstance_ID=" + getAD_PInstance_ID(); - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("DELETE T_Replenish WHERE AD_PInstance_ID=").append(getAD_PInstance_ID()); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Delete Existing Temp=" + no); } // prepareTable @@ -198,146 +200,146 @@ public class ReplenishReport extends SvrProcess */ private void fillTable (MWarehouse wh) throws Exception { - String sql = "INSERT INTO T_Replenish " - + "(AD_PInstance_ID, M_Warehouse_ID, M_Product_ID, AD_Client_ID, AD_Org_ID," - + " ReplenishType, Level_Min, Level_Max," - + " C_BPartner_ID, Order_Min, Order_Pack, QtyToOrder, ReplenishmentCreate) " - + "SELECT " + getAD_PInstance_ID() - + ", r.M_Warehouse_ID, r.M_Product_ID, r.AD_Client_ID, r.AD_Org_ID," - + " r.ReplenishType, r.Level_Min, r.Level_Max," - + " po.C_BPartner_ID, po.Order_Min, po.Order_Pack, 0, "; + StringBuilder sql = new StringBuilder("INSERT INTO T_Replenish "); + sql.append("(AD_PInstance_ID, M_Warehouse_ID, M_Product_ID, AD_Client_ID, AD_Org_ID,"); + sql.append(" ReplenishType, Level_Min, Level_Max,"); + sql.append(" C_BPartner_ID, Order_Min, Order_Pack, QtyToOrder, ReplenishmentCreate) "); + sql.append("SELECT ").append(getAD_PInstance_ID()); + sql.append(", r.M_Warehouse_ID, r.M_Product_ID, r.AD_Client_ID, r.AD_Org_ID,"); + sql.append(" r.ReplenishType, r.Level_Min, r.Level_Max,"); + sql.append(" po.C_BPartner_ID, po.Order_Min, po.Order_Pack, 0, "); + if (p_ReplenishmentCreate == null) - sql += "null"; + sql.append("null"); else - sql += "'" + p_ReplenishmentCreate + "'"; - sql += " FROM M_Replenish r" - + " INNER JOIN M_Product_PO po ON (r.M_Product_ID=po.M_Product_ID) " - + "WHERE po.IsCurrentVendor='Y'" // Only Current Vendor - + " AND r.ReplenishType<>'0'" - + " AND po.IsActive='Y' AND r.IsActive='Y'" - + " AND r.M_Warehouse_ID=" + p_M_Warehouse_ID; + sql.append("'").append(p_ReplenishmentCreate).append("'"); + sql.append(" FROM M_Replenish r"); + sql.append(" INNER JOIN M_Product_PO po ON (r.M_Product_ID=po.M_Product_ID) "); + sql.append("WHERE po.IsCurrentVendor='Y'"); // Only Current Vendor + sql.append(" AND r.ReplenishType<>'0'"); + sql.append(" AND po.IsActive='Y' AND r.IsActive='Y'"); + sql.append(" AND r.M_Warehouse_ID=").append(p_M_Warehouse_ID); if (p_C_BPartner_ID != 0) - sql += " AND po.C_BPartner_ID=" + p_C_BPartner_ID; - int no = DB.executeUpdate(sql, get_TrxName()); - log.finest(sql); + sql.append(" AND po.C_BPartner_ID=").append(p_C_BPartner_ID); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); + log.finest(sql.toString()); log.fine("Insert (1) #" + no); if (p_C_BPartner_ID == 0) { - sql = "INSERT INTO T_Replenish " - + "(AD_PInstance_ID, M_Warehouse_ID, M_Product_ID, AD_Client_ID, AD_Org_ID," - + " ReplenishType, Level_Min, Level_Max," - + " C_BPartner_ID, Order_Min, Order_Pack, QtyToOrder, ReplenishmentCreate) " - + "SELECT " + getAD_PInstance_ID() - + ", r.M_Warehouse_ID, r.M_Product_ID, r.AD_Client_ID, r.AD_Org_ID," - + " r.ReplenishType, r.Level_Min, r.Level_Max," - + " 0, 1, 1, 0, "; + sql = new StringBuilder("INSERT INTO T_Replenish "); + sql.append("(AD_PInstance_ID, M_Warehouse_ID, M_Product_ID, AD_Client_ID, AD_Org_ID,"); + sql.append(" ReplenishType, Level_Min, Level_Max,"); + sql.append(" C_BPartner_ID, Order_Min, Order_Pack, QtyToOrder, ReplenishmentCreate) "); + sql.append("SELECT ").append(getAD_PInstance_ID()); + sql.append(", r.M_Warehouse_ID, r.M_Product_ID, r.AD_Client_ID, r.AD_Org_ID,"); + sql.append(" r.ReplenishType, r.Level_Min, r.Level_Max,"); + sql.append(" 0, 1, 1, 0, "); if (p_ReplenishmentCreate == null) - sql += "null"; + sql.append("null"); else - sql += "'" + p_ReplenishmentCreate + "'"; - sql += " FROM M_Replenish r " - + "WHERE r.ReplenishType<>'0' AND r.IsActive='Y'" - + " AND r.M_Warehouse_ID=" + p_M_Warehouse_ID - + " AND NOT EXISTS (SELECT * FROM T_Replenish t " - + "WHERE r.M_Product_ID=t.M_Product_ID" - + " AND AD_PInstance_ID=" + getAD_PInstance_ID() + ")"; - no = DB.executeUpdate(sql, get_TrxName()); + sql.append("'").append(p_ReplenishmentCreate).append("'"); + sql.append(" FROM M_Replenish r "); + sql.append("WHERE r.ReplenishType<>'0' AND r.IsActive='Y'"); + sql.append(" AND r.M_Warehouse_ID=").append(p_M_Warehouse_ID); + sql.append(" AND NOT EXISTS (SELECT * FROM T_Replenish t "); + sql.append("WHERE r.M_Product_ID=t.M_Product_ID"); + sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()).append(")"); + no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Insert (BP) #" + no); } - - sql = "UPDATE T_Replenish t SET " - + "QtyOnHand = (SELECT COALESCE(SUM(QtyOnHand),0) FROM M_Storage s, M_Locator l WHERE t.M_Product_ID=s.M_Product_ID" - + " AND l.M_Locator_ID=s.M_Locator_ID AND l.M_Warehouse_ID=t.M_Warehouse_ID)," - + "QtyReserved = (SELECT COALESCE(SUM(QtyReserved),0) FROM M_Storage s, M_Locator l WHERE t.M_Product_ID=s.M_Product_ID" - + " AND l.M_Locator_ID=s.M_Locator_ID AND l.M_Warehouse_ID=t.M_Warehouse_ID)," - + "QtyOrdered = (SELECT COALESCE(SUM(QtyOrdered),0) FROM M_Storage s, M_Locator l WHERE t.M_Product_ID=s.M_Product_ID" - + " AND l.M_Locator_ID=s.M_Locator_ID AND l.M_Warehouse_ID=t.M_Warehouse_ID)"; + sql = new StringBuilder("UPDATE T_Replenish t SET "); + sql.append("QtyOnHand = (SELECT COALESCE(SUM(QtyOnHand),0) FROM M_Storage s, M_Locator l WHERE t.M_Product_ID=s.M_Product_ID"); + sql.append(" AND l.M_Locator_ID=s.M_Locator_ID AND l.M_Warehouse_ID=t.M_Warehouse_ID),"); + sql.append("QtyReserved = (SELECT COALESCE(SUM(QtyReserved),0) FROM M_Storage s, M_Locator l WHERE t.M_Product_ID=s.M_Product_ID"); + sql.append(" AND l.M_Locator_ID=s.M_Locator_ID AND l.M_Warehouse_ID=t.M_Warehouse_ID),"); + sql.append("QtyOrdered = (SELECT COALESCE(SUM(QtyOrdered),0) FROM M_Storage s, M_Locator l WHERE t.M_Product_ID=s.M_Product_ID"); + sql.append(" AND l.M_Locator_ID=s.M_Locator_ID AND l.M_Warehouse_ID=t.M_Warehouse_ID)"); if (p_C_DocType_ID != 0) - sql += ", C_DocType_ID=" + p_C_DocType_ID; - sql += " WHERE AD_PInstance_ID=" + getAD_PInstance_ID(); - no = DB.executeUpdate(sql, get_TrxName()); + sql.append(", C_DocType_ID=").append(p_C_DocType_ID); + sql.append(" WHERE AD_PInstance_ID=").append(getAD_PInstance_ID()); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Update #" + no); // Delete inactive products and replenishments - sql = "DELETE T_Replenish r " - + "WHERE (EXISTS (SELECT * FROM M_Product p " - + "WHERE p.M_Product_ID=r.M_Product_ID AND p.IsActive='N')" - + " OR EXISTS (SELECT * FROM M_Replenish rr " - + " WHERE rr.M_Product_ID=r.M_Product_ID AND rr.IsActive='N'" - + " AND rr.M_Warehouse_ID=" + p_M_Warehouse_ID + " ))" - + " AND AD_PInstance_ID=" + getAD_PInstance_ID(); - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("DELETE T_Replenish r "); + sql.append("WHERE (EXISTS (SELECT * FROM M_Product p "); + sql.append("WHERE p.M_Product_ID=r.M_Product_ID AND p.IsActive='N')"); + sql.append(" OR EXISTS (SELECT * FROM M_Replenish rr "); + sql.append(" WHERE rr.M_Product_ID=r.M_Product_ID AND rr.IsActive='N'"); + sql.append(" AND rr.M_Warehouse_ID=").append(p_M_Warehouse_ID).append(" ))"); + sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Delete Inactive=" + no); // Ensure Data consistency - sql = "UPDATE T_Replenish SET QtyOnHand = 0 WHERE QtyOnHand IS NULL"; - no = DB.executeUpdate(sql, get_TrxName()); - sql = "UPDATE T_Replenish SET QtyReserved = 0 WHERE QtyReserved IS NULL"; - no = DB.executeUpdate(sql, get_TrxName()); - sql = "UPDATE T_Replenish SET QtyOrdered = 0 WHERE QtyOrdered IS NULL"; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE T_Replenish SET QtyOnHand = 0 WHERE QtyOnHand IS NULL"); + no = DB.executeUpdate(sql.toString(), get_TrxName()); + sql = new StringBuilder("UPDATE T_Replenish SET QtyReserved = 0 WHERE QtyReserved IS NULL"); + no = DB.executeUpdate(sql.toString(), get_TrxName()); + sql = new StringBuilder("UPDATE T_Replenish SET QtyOrdered = 0 WHERE QtyOrdered IS NULL"); + no = DB.executeUpdate(sql.toString(), get_TrxName()); // Set Minimum / Maximum Maintain Level // X_M_Replenish.REPLENISHTYPE_ReorderBelowMinimumLevel - sql = "UPDATE T_Replenish" - + " SET QtyToOrder = CASE WHEN QtyOnHand - QtyReserved + QtyOrdered <= Level_Min " - + " THEN Level_Max - QtyOnHand + QtyReserved - QtyOrdered " - + " ELSE 0 END " - + "WHERE ReplenishType='1'" - + " AND AD_PInstance_ID=" + getAD_PInstance_ID(); - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE T_Replenish"); + sql.append(" SET QtyToOrder = CASE WHEN QtyOnHand - QtyReserved + QtyOrdered <= Level_Min "); + sql.append(" THEN Level_Max - QtyOnHand + QtyReserved - QtyOrdered "); + sql.append(" ELSE 0 END "); + sql.append("WHERE ReplenishType='1'"); + sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Update Type-1=" + no); // // X_M_Replenish.REPLENISHTYPE_MaintainMaximumLevel - sql = "UPDATE T_Replenish" - + " SET QtyToOrder = Level_Max - QtyOnHand + QtyReserved - QtyOrdered " - + "WHERE ReplenishType='2'" - + " AND AD_PInstance_ID=" + getAD_PInstance_ID(); - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE T_Replenish"); + sql.append(" SET QtyToOrder = Level_Max - QtyOnHand + QtyReserved - QtyOrdered "); + sql.append("WHERE ReplenishType='2'" ); + sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Update Type-2=" + no); // Minimum Order Quantity - sql = "UPDATE T_Replenish" - + " SET QtyToOrder = Order_Min " - + "WHERE QtyToOrder < Order_Min" - + " AND QtyToOrder > 0" - + " AND AD_PInstance_ID=" + getAD_PInstance_ID(); - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE T_Replenish"); + sql.append(" SET QtyToOrder = Order_Min "); + sql.append("WHERE QtyToOrder < Order_Min"); + sql.append(" AND QtyToOrder > 0" ); + sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Set MinOrderQty=" + no); // Even dividable by Pack - sql = "UPDATE T_Replenish" - + " SET QtyToOrder = QtyToOrder - MOD(QtyToOrder, Order_Pack) + Order_Pack " - + "WHERE MOD(QtyToOrder, Order_Pack) <> 0" - + " AND QtyToOrder > 0" - + " AND AD_PInstance_ID=" + getAD_PInstance_ID(); - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE T_Replenish"); + sql.append(" SET QtyToOrder = QtyToOrder - MOD(QtyToOrder, Order_Pack) + Order_Pack "); + sql.append("WHERE MOD(QtyToOrder, Order_Pack) <> 0"); + sql.append(" AND QtyToOrder > 0"); + sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Set OrderPackQty=" + no); // Source from other warehouse if (wh.getM_WarehouseSource_ID() != 0) { - sql = "UPDATE T_Replenish" - + " SET M_WarehouseSource_ID=" + wh.getM_WarehouseSource_ID() - + " WHERE AD_PInstance_ID=" + getAD_PInstance_ID(); - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE T_Replenish"); + sql.append(" SET M_WarehouseSource_ID=").append(wh.getM_WarehouseSource_ID()); + sql.append(" WHERE AD_PInstance_ID=").append(getAD_PInstance_ID()); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Set Source Warehouse=" + no); } // Check Source Warehouse - sql = "UPDATE T_Replenish" - + " SET M_WarehouseSource_ID = NULL " - + "WHERE M_Warehouse_ID=M_WarehouseSource_ID" - + " AND AD_PInstance_ID=" + getAD_PInstance_ID(); - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE T_Replenish"); + sql.append(" SET M_WarehouseSource_ID = NULL "); + sql.append("WHERE M_Warehouse_ID=M_WarehouseSource_ID"); + sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Set same Source Warehouse=" + no); @@ -381,10 +383,10 @@ public class ReplenishReport extends SvrProcess } } // Delete rows where nothing to order - sql = "DELETE T_Replenish " - + "WHERE QtyToOrder < 1" - + " AND AD_PInstance_ID=" + getAD_PInstance_ID(); - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("DELETE T_Replenish "); + sql.append("WHERE QtyToOrder < 1"); + sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Delete No QtyToOrder=" + no); } // fillTable @@ -395,7 +397,7 @@ public class ReplenishReport extends SvrProcess private void createPO() { int noOrders = 0; - String info = ""; + StringBuilder info = new StringBuilder(); // MOrder order = null; MWarehouse wh = null; @@ -424,7 +426,8 @@ public class ReplenishReport extends SvrProcess return; log.fine(order.toString()); noOrders++; - info += " - " + order.getDocumentNo(); + info.append(" - "); + info.append(order.getDocumentNo()); } MOrderLine line = new MOrderLine (order); line.setM_Product_ID(replenish.getM_Product_ID()); @@ -432,7 +435,7 @@ public class ReplenishReport extends SvrProcess line.setPrice(); line.saveEx(); } - m_info = "#" + noOrders + info; + m_info = "#" + noOrders + info.toString(); log.info(m_info); } // createPO @@ -442,7 +445,7 @@ public class ReplenishReport extends SvrProcess private void createRequisition() { int noReqs = 0; - String info = ""; + StringBuilder info = new StringBuilder(); // MRequisition requisition = null; MWarehouse wh = null; @@ -467,7 +470,8 @@ public class ReplenishReport extends SvrProcess return; log.fine(requisition.toString()); noReqs++; - info += " - " + requisition.getDocumentNo(); + info.append(" - "); + info.append(requisition.getDocumentNo()); } // MRequisitionLine line = new MRequisitionLine(requisition); @@ -477,7 +481,7 @@ public class ReplenishReport extends SvrProcess line.setPrice(); line.saveEx(); } - m_info = "#" + noReqs + info; + m_info = "#" + noReqs + info.toString(); log.info(m_info); } // createRequisition @@ -487,7 +491,7 @@ public class ReplenishReport extends SvrProcess private void createMovements() { int noMoves = 0; - String info = ""; + StringBuilder info = new StringBuilder(); // MClient client = null; MMovement move = null; @@ -523,7 +527,7 @@ public class ReplenishReport extends SvrProcess return; log.fine(move.toString()); noMoves++; - info += " - " + move.getDocumentNo(); + info.append(" - ").append(move.getDocumentNo()); } // To int M_LocatorTo_ID = wh.getDefaultLocator().getM_Locator_ID(); @@ -579,7 +583,7 @@ public class ReplenishReport extends SvrProcess private void createDO() throws Exception { int noMoves = 0; - String info = ""; + StringBuilder info = new StringBuilder(); // MClient client = null; MDDOrder order = null; @@ -646,7 +650,7 @@ public class ReplenishReport extends SvrProcess return; log.fine(order.toString()); noMoves++; - info += " - " + order.getDocumentNo(); + info.append(" - ").append(order.getDocumentNo()); } // To @@ -726,16 +730,16 @@ public class ReplenishReport extends SvrProcess */ private X_T_Replenish[] getReplenish (String where) { - String sql = "SELECT * FROM T_Replenish " - + "WHERE AD_PInstance_ID=? AND C_BPartner_ID > 0 "; + StringBuilder sql = new StringBuilder("SELECT * FROM T_Replenish "); + sql.append("WHERE AD_PInstance_ID=? AND C_BPartner_ID > 0 "); if (where != null && where.length() > 0) - sql += " AND " + where; - sql += " ORDER BY M_Warehouse_ID, M_WarehouseSource_ID, C_BPartner_ID"; + sql.append(" AND ").append(where); + sql.append(" ORDER BY M_Warehouse_ID, M_WarehouseSource_ID, C_BPartner_ID"); ArrayList list = new ArrayList(); PreparedStatement pstmt = null; try { - pstmt = DB.prepareStatement (sql, get_TrxName()); + pstmt = DB.prepareStatement (sql.toString(), get_TrxName()); pstmt.setInt (1, getAD_PInstance_ID()); ResultSet rs = pstmt.executeQuery (); while (rs.next ()) @@ -746,7 +750,7 @@ public class ReplenishReport extends SvrProcess } catch (Exception e) { - log.log(Level.SEVERE, sql, e); + log.log(Level.SEVERE, sql.toString(), e); } try { @@ -769,16 +773,16 @@ public class ReplenishReport extends SvrProcess */ private X_T_Replenish[] getReplenishDO (String where) { - String sql = "SELECT * FROM T_Replenish " - + "WHERE AD_PInstance_ID=? "; + StringBuilder sql = new StringBuilder("SELECT * FROM T_Replenish "); + sql.append("WHERE AD_PInstance_ID=? "); if (where != null && where.length() > 0) - sql += " AND " + where; - sql += " ORDER BY M_Warehouse_ID, M_WarehouseSource_ID, C_BPartner_ID"; + sql.append(" AND ").append(where); + sql.append(" ORDER BY M_Warehouse_ID, M_WarehouseSource_ID, C_BPartner_ID"); ArrayList list = new ArrayList(); PreparedStatement pstmt = null; try { - pstmt = DB.prepareStatement (sql, get_TrxName()); + pstmt = DB.prepareStatement (sql.toString(), get_TrxName()); pstmt.setInt (1, getAD_PInstance_ID()); ResultSet rs = pstmt.executeQuery (); while (rs.next ()) @@ -789,7 +793,7 @@ public class ReplenishReport extends SvrProcess } catch (Exception e) { - log.log(Level.SEVERE, sql, e); + log.log(Level.SEVERE, sql.toString(), e); } try { diff --git a/org.adempiere.base.process/src/org/compiere/process/ReplenishReportProduction.java b/org.adempiere.base.process/src/org/compiere/process/ReplenishReportProduction.java index 9ddc83163c..7344a68727 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ReplenishReportProduction.java +++ b/org.adempiere.base.process/src/org/compiere/process/ReplenishReportProduction.java @@ -1,4 +1,5 @@ /****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * @@ -108,10 +109,11 @@ public class ReplenishReportProduction extends SvrProcess */ protected String doIt() throws Exception { - log.info("M_Warehouse_ID=" + p_M_Warehouse_ID - + ", C_BPartner_ID=" + p_C_BPartner_ID - + " - ReplenishmentCreate=" + p_ReplenishmentCreate - + ", C_DocType_ID=" + p_C_DocType_ID); + StringBuilder msglog = new StringBuilder("M_Warehouse_ID=").append(p_M_Warehouse_ID) + .append(", C_BPartner_ID=").append(p_C_BPartner_ID) + .append(" - ReplenishmentCreate=").append(p_ReplenishmentCreate) + .append(", C_DocType_ID=").append(p_C_DocType_ID); + log.info(msglog.toString()); if (p_ReplenishmentCreate != null && p_C_DocType_ID == 0 && !p_ReplenishmentCreate.equals("PRD")) throw new AdempiereUserError("@FillMandatory@ @C_DocType_ID@"); @@ -148,56 +150,56 @@ public class ReplenishReportProduction extends SvrProcess private void prepareTable() { // Level_Max must be >= Level_Max - String sql = "UPDATE M_Replenish" - + " SET Level_Max = Level_Min " - + "WHERE Level_Max < Level_Min"; - int no = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("UPDATE M_Replenish") + .append(" SET Level_Max = Level_Min ") + .append("WHERE Level_Max < Level_Min"); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Corrected Max_Level=" + no); // Minimum Order should be 1 - sql = "UPDATE M_Product_PO" - + " SET Order_Min = 1 " - + "WHERE Order_Min IS NULL OR Order_Min < 1"; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE M_Product_PO") + .append(" SET Order_Min = 1 ") + .append("WHERE Order_Min IS NULL OR Order_Min < 1"); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Corrected Order Min=" + no); // Pack should be 1 - sql = "UPDATE M_Product_PO" - + " SET Order_Pack = 1 " - + "WHERE Order_Pack IS NULL OR Order_Pack < 1"; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE M_Product_PO") + .append(" SET Order_Pack = 1 ") + .append("WHERE Order_Pack IS NULL OR Order_Pack < 1"); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Corrected Order Pack=" + no); // Set Current Vendor where only one vendor - sql = "UPDATE M_Product_PO p" - + " SET IsCurrentVendor='Y' " - + "WHERE IsCurrentVendor<>'Y'" - + " AND EXISTS (SELECT pp.M_Product_ID FROM M_Product_PO pp " - + "WHERE p.M_Product_ID=pp.M_Product_ID " - + "GROUP BY pp.M_Product_ID " - + "HAVING COUNT(*) = 1)"; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE M_Product_PO p") + .append(" SET IsCurrentVendor='Y' ") + .append("WHERE IsCurrentVendor<>'Y'") + .append(" AND EXISTS (SELECT pp.M_Product_ID FROM M_Product_PO pp ") + .append("WHERE p.M_Product_ID=pp.M_Product_ID ") + .append("GROUP BY pp.M_Product_ID ") + .append("HAVING COUNT(*) = 1)"); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Corrected CurrentVendor(Y)=" + no); // More then one current vendor - sql = "UPDATE M_Product_PO p" - + " SET IsCurrentVendor='N' " - + "WHERE IsCurrentVendor = 'Y'" - + " AND EXISTS (SELECT pp.M_Product_ID FROM M_Product_PO pp " - + "WHERE p.M_Product_ID=pp.M_Product_ID AND pp.IsCurrentVendor='Y' " - + "GROUP BY pp.M_Product_ID " - + "HAVING COUNT(*) > 1)"; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE M_Product_PO p") + .append(" SET IsCurrentVendor='N' ") + .append("WHERE IsCurrentVendor = 'Y'") + .append(" AND EXISTS (SELECT pp.M_Product_ID FROM M_Product_PO pp ") + .append("WHERE p.M_Product_ID=pp.M_Product_ID AND pp.IsCurrentVendor='Y' ") + .append("GROUP BY pp.M_Product_ID ") + .append("HAVING COUNT(*) > 1)"); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Corrected CurrentVendor(N)=" + no); // Just to be sure - sql = "DELETE T_Replenish WHERE AD_PInstance_ID=" + getAD_PInstance_ID(); - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("DELETE T_Replenish WHERE AD_PInstance_ID=").append(getAD_PInstance_ID()); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Delete Existing Temp=" + no); } // prepareTable @@ -208,170 +210,170 @@ public class ReplenishReportProduction extends SvrProcess */ private void fillTable (MWarehouse wh) throws Exception { - String sql = "INSERT INTO T_Replenish " - + "(AD_PInstance_ID, M_Warehouse_ID, M_Product_ID, AD_Client_ID, AD_Org_ID," - + " ReplenishType, Level_Min, Level_Max," - + " C_BPartner_ID, Order_Min, Order_Pack, QtyToOrder, ReplenishmentCreate) " - + "SELECT " + getAD_PInstance_ID() - + ", r.M_Warehouse_ID, r.M_Product_ID, r.AD_Client_ID, r.AD_Org_ID," - + " r.ReplenishType, r.Level_Min, r.Level_Max," - + " po.C_BPartner_ID, po.Order_Min, po.Order_Pack, 0, "; + StringBuilder sql = new StringBuilder("INSERT INTO T_Replenish "); + sql.append("(AD_PInstance_ID, M_Warehouse_ID, M_Product_ID, AD_Client_ID, AD_Org_ID,"); + sql.append(" ReplenishType, Level_Min, Level_Max,"); + sql.append(" C_BPartner_ID, Order_Min, Order_Pack, QtyToOrder, ReplenishmentCreate) "); + sql.append("SELECT ").append(getAD_PInstance_ID()); + sql.append(", r.M_Warehouse_ID, r.M_Product_ID, r.AD_Client_ID, r.AD_Org_ID,"); + sql.append(" r.ReplenishType, r.Level_Min, r.Level_Max,"); + sql.append(" po.C_BPartner_ID, po.Order_Min, po.Order_Pack, 0, "); if (p_ReplenishmentCreate == null) - sql += "null"; + sql.append("null"); else - sql += "'" + p_ReplenishmentCreate + "'"; - sql += " FROM M_Replenish r" - + " INNER JOIN M_Product_PO po ON (r.M_Product_ID=po.M_Product_ID) " - + " INNER JOIN M_Product p ON (p.M_Product_ID=po.M_Product_ID) " - + "WHERE po.IsCurrentVendor='Y'" // Only Current Vendor - + " AND r.ReplenishType<>'0'" - + " AND po.IsActive='Y' AND r.IsActive='Y'" - + " AND r.M_Warehouse_ID=" + p_M_Warehouse_ID; + sql.append("'").append(p_ReplenishmentCreate).append("'"); + sql.append(" FROM M_Replenish r"); + sql.append(" INNER JOIN M_Product_PO po ON (r.M_Product_ID=po.M_Product_ID) "); + sql.append(" INNER JOIN M_Product p ON (p.M_Product_ID=po.M_Product_ID) "); + sql.append("WHERE po.IsCurrentVendor='Y'"); // Only Current Vendor + sql.append(" AND r.ReplenishType<>'0'"); + sql.append(" AND po.IsActive='Y' AND r.IsActive='Y'"); + sql.append(" AND r.M_Warehouse_ID=").append(p_M_Warehouse_ID); if (p_C_BPartner_ID != 0) - sql += " AND po.C_BPartner_ID=" + p_C_BPartner_ID; + sql.append(" AND po.C_BPartner_ID=").append(p_C_BPartner_ID); if ( p_M_Product_Category_ID != 0 ) - sql += " AND p.M_Product_Category_ID=" + p_M_Product_Category_ID; + sql.append(" AND p.M_Product_Category_ID=").append(p_M_Product_Category_ID); if ( isKanban != null ) - sql += " AND p.IsKanban = '" + isKanban + "' "; - int no = DB.executeUpdate(sql, get_TrxName()); - log.finest(sql); + sql.append(" AND p.IsKanban = '").append(isKanban).append("' "); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); + log.finest(sql.toString()); log.fine("Insert (1) #" + no); if (p_C_BPartner_ID == 0) { - sql = "INSERT INTO T_Replenish " - + "(AD_PInstance_ID, M_Warehouse_ID, M_Product_ID, AD_Client_ID, AD_Org_ID," - + " ReplenishType, Level_Min, Level_Max," - + " C_BPartner_ID, Order_Min, Order_Pack, QtyToOrder, ReplenishmentCreate) " - + "SELECT " + getAD_PInstance_ID() - + ", r.M_Warehouse_ID, r.M_Product_ID, r.AD_Client_ID, r.AD_Org_ID," - + " r.ReplenishType, r.Level_Min, r.Level_Max," - + " 0, 1, 1, 0, "; + sql = new StringBuilder("INSERT INTO T_Replenish "); + sql.append("(AD_PInstance_ID, M_Warehouse_ID, M_Product_ID, AD_Client_ID, AD_Org_ID,"); + sql.append(" ReplenishType, Level_Min, Level_Max,"); + sql.append(" C_BPartner_ID, Order_Min, Order_Pack, QtyToOrder, ReplenishmentCreate) "); + sql.append("SELECT ").append(getAD_PInstance_ID()); + sql.append(", r.M_Warehouse_ID, r.M_Product_ID, r.AD_Client_ID, r.AD_Org_ID,"); + sql.append(" r.ReplenishType, r.Level_Min, r.Level_Max,"); + sql.append(" 0, 1, 1, 0, "); if (p_ReplenishmentCreate == null) - sql += "null"; + sql.append("null"); else - sql += "'" + p_ReplenishmentCreate + "'"; - sql += " FROM M_Replenish r " - + " INNER JOIN M_Product p ON (p.M_Product_ID=r.M_Product_ID) " - + "WHERE r.ReplenishType<>'0' AND r.IsActive='Y'" - + " AND r.M_Warehouse_ID=" + p_M_Warehouse_ID - + " AND NOT EXISTS (SELECT * FROM T_Replenish t " - + "WHERE r.M_Product_ID=t.M_Product_ID" - + " AND AD_PInstance_ID=" + getAD_PInstance_ID() + ")"; + sql.append("'").append(p_ReplenishmentCreate).append("'"); + sql.append(" FROM M_Replenish r "); + sql.append(" INNER JOIN M_Product p ON (p.M_Product_ID=r.M_Product_ID) "); + sql.append("WHERE r.ReplenishType<>'0' AND r.IsActive='Y'"); + sql.append(" AND r.M_Warehouse_ID=").append(p_M_Warehouse_ID); + sql.append(" AND NOT EXISTS (SELECT * FROM T_Replenish t "); + sql.append("WHERE r.M_Product_ID=t.M_Product_ID"); + sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()).append(")"); if ( p_M_Product_Category_ID != 0 ) - sql += " AND p.M_Product_Category_ID=" + p_M_Product_Category_ID; + sql.append(" AND p.M_Product_Category_ID=").append(p_M_Product_Category_ID); if ( isKanban != null ) - sql += " AND p.IsKanban = '" + isKanban + "' "; - no = DB.executeUpdate(sql, get_TrxName()); + sql.append(" AND p.IsKanban = '").append(isKanban).append("' "); + no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Insert (BP) #" + no); } - sql = "UPDATE T_Replenish t SET " - + "QtyOnHand = (SELECT COALESCE(SUM(QtyOnHand),0) FROM M_Storage s, M_Locator l WHERE t.M_Product_ID=s.M_Product_ID" - + " AND l.M_Locator_ID=s.M_Locator_ID AND l.M_Warehouse_ID=t.M_Warehouse_ID)," - + "QtyReserved = (SELECT COALESCE(SUM(QtyReserved),0) FROM M_Storage s, M_Locator l WHERE t.M_Product_ID=s.M_Product_ID" - + " AND l.M_Locator_ID=s.M_Locator_ID AND l.M_Warehouse_ID=t.M_Warehouse_ID)," - + "QtyOrdered = (SELECT COALESCE(SUM(QtyOrdered),0) FROM M_Storage s, M_Locator l WHERE t.M_Product_ID=s.M_Product_ID" - + " AND l.M_Locator_ID=s.M_Locator_ID AND l.M_Warehouse_ID=t.M_Warehouse_ID)"; + sql = new StringBuilder("UPDATE T_Replenish t SET "); + sql.append("QtyOnHand = (SELECT COALESCE(SUM(QtyOnHand),0) FROM M_Storage s, M_Locator l WHERE t.M_Product_ID=s.M_Product_ID"); + sql.append(" AND l.M_Locator_ID=s.M_Locator_ID AND l.M_Warehouse_ID=t.M_Warehouse_ID),"); + sql.append("QtyReserved = (SELECT COALESCE(SUM(QtyReserved),0) FROM M_Storage s, M_Locator l WHERE t.M_Product_ID=s.M_Product_ID"); + sql.append(" AND l.M_Locator_ID=s.M_Locator_ID AND l.M_Warehouse_ID=t.M_Warehouse_ID),"); + sql.append("QtyOrdered = (SELECT COALESCE(SUM(QtyOrdered),0) FROM M_Storage s, M_Locator l WHERE t.M_Product_ID=s.M_Product_ID"); + sql.append(" AND l.M_Locator_ID=s.M_Locator_ID AND l.M_Warehouse_ID=t.M_Warehouse_ID)"); if (p_C_DocType_ID != 0) - sql += ", C_DocType_ID=" + p_C_DocType_ID; - sql += " WHERE AD_PInstance_ID=" + getAD_PInstance_ID(); - no = DB.executeUpdate(sql, get_TrxName()); + sql.append(", C_DocType_ID=").append(p_C_DocType_ID); + sql.append(" WHERE AD_PInstance_ID=").append(getAD_PInstance_ID()); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Update #" + no); // add production lines - sql = "UPDATE T_Replenish t SET " - + "QtyReserved = QtyReserved - COALESCE((SELECT COALESCE(SUM(MovementQty),0) FROM M_ProductionLine p, M_Locator l WHERE t.M_Product_ID=p.M_Product_ID" - + " AND l.M_Locator_ID=p.M_Locator_ID AND l.M_Warehouse_ID=t.M_Warehouse_ID AND MovementQty < 0 AND p.Processed = 'N'),0)," - + "QtyOrdered = QtyOrdered + COALESCE((SELECT COALESCE(SUM(MovementQty),0) FROM M_ProductionLine p, M_Locator l WHERE t.M_Product_ID=p.M_Product_ID" - + " AND l.M_Locator_ID=p.M_Locator_ID AND l.M_Warehouse_ID=t.M_Warehouse_ID AND MovementQty > 0 AND p.Processed = 'N'),0)"; + sql = new StringBuilder("UPDATE T_Replenish t SET "); + sql.append("QtyReserved = QtyReserved - COALESCE((SELECT COALESCE(SUM(MovementQty),0) FROM M_ProductionLine p, M_Locator l WHERE t.M_Product_ID=p.M_Product_ID"); + sql.append(" AND l.M_Locator_ID=p.M_Locator_ID AND l.M_Warehouse_ID=t.M_Warehouse_ID AND MovementQty < 0 AND p.Processed = 'N'),0),"); + sql.append("QtyOrdered = QtyOrdered + COALESCE((SELECT COALESCE(SUM(MovementQty),0) FROM M_ProductionLine p, M_Locator l WHERE t.M_Product_ID=p.M_Product_ID"); + sql.append(" AND l.M_Locator_ID=p.M_Locator_ID AND l.M_Warehouse_ID=t.M_Warehouse_ID AND MovementQty > 0 AND p.Processed = 'N'),0)"); if (p_C_DocType_ID != 0) - sql += ", C_DocType_ID=" + p_C_DocType_ID; - sql += " WHERE AD_PInstance_ID=" + getAD_PInstance_ID(); - no = DB.executeUpdate(sql, get_TrxName()); + sql.append(", C_DocType_ID=").append(p_C_DocType_ID); + sql.append(" WHERE AD_PInstance_ID=").append(getAD_PInstance_ID()); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Update #" + no); // Delete inactive products and replenishments - sql = "DELETE T_Replenish r " - + "WHERE (EXISTS (SELECT * FROM M_Product p " - + "WHERE p.M_Product_ID=r.M_Product_ID AND p.IsActive='N')" - + " OR EXISTS (SELECT * FROM M_Replenish rr " - + " WHERE rr.M_Product_ID=r.M_Product_ID AND rr.IsActive='N'" - + " AND rr.M_Warehouse_ID=" + p_M_Warehouse_ID + " ))" - + " AND AD_PInstance_ID=" + getAD_PInstance_ID(); - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("DELETE T_Replenish r "); + sql.append("WHERE (EXISTS (SELECT * FROM M_Product p "); + sql.append("WHERE p.M_Product_ID=r.M_Product_ID AND p.IsActive='N')"); + sql.append(" OR EXISTS (SELECT * FROM M_Replenish rr "); + sql.append(" WHERE rr.M_Product_ID=r.M_Product_ID AND rr.IsActive='N'"); + sql.append(" AND rr.M_Warehouse_ID=").append(p_M_Warehouse_ID).append(" ))"); + sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Delete Inactive=" + no); // Ensure Data consistency - sql = "UPDATE T_Replenish SET QtyOnHand = 0 WHERE QtyOnHand IS NULL"; - no = DB.executeUpdate(sql, get_TrxName()); - sql = "UPDATE T_Replenish SET QtyReserved = 0 WHERE QtyReserved IS NULL"; - no = DB.executeUpdate(sql, get_TrxName()); - sql = "UPDATE T_Replenish SET QtyOrdered = 0 WHERE QtyOrdered IS NULL"; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE T_Replenish SET QtyOnHand = 0 WHERE QtyOnHand IS NULL"); + no = DB.executeUpdate(sql.toString(), get_TrxName()); + sql = new StringBuilder("UPDATE T_Replenish SET QtyReserved = 0 WHERE QtyReserved IS NULL"); + no = DB.executeUpdate(sql.toString(), get_TrxName()); + sql = new StringBuilder("UPDATE T_Replenish SET QtyOrdered = 0 WHERE QtyOrdered IS NULL"); + no = DB.executeUpdate(sql.toString(), get_TrxName()); // Set Minimum / Maximum Maintain Level // X_M_Replenish.REPLENISHTYPE_ReorderBelowMinimumLevel - sql = "UPDATE T_Replenish" - + " SET QtyToOrder = CASE WHEN QtyOnHand - QtyReserved + QtyOrdered <= Level_Min " - + " THEN Level_Max - QtyOnHand + QtyReserved - QtyOrdered " - + " ELSE 0 END " - + "WHERE ReplenishType='1'" - + " AND AD_PInstance_ID=" + getAD_PInstance_ID(); - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE T_Replenish"); + sql.append(" SET QtyToOrder = CASE WHEN QtyOnHand - QtyReserved + QtyOrdered <= Level_Min "); + sql.append(" THEN Level_Max - QtyOnHand + QtyReserved - QtyOrdered "); + sql.append(" ELSE 0 END "); + sql.append("WHERE ReplenishType='1'"); + sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Update Type-1=" + no); // // X_M_Replenish.REPLENISHTYPE_MaintainMaximumLevel - sql = "UPDATE T_Replenish" - + " SET QtyToOrder = Level_Max - QtyOnHand + QtyReserved - QtyOrdered " - + "WHERE ReplenishType='2'" - + " AND AD_PInstance_ID=" + getAD_PInstance_ID(); - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE T_Replenish"); + sql.append(" SET QtyToOrder = Level_Max - QtyOnHand + QtyReserved - QtyOrdered "); + sql.append("WHERE ReplenishType='2'" ); + sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Update Type-2=" + no); // Minimum Order Quantity - sql = "UPDATE T_Replenish" - + " SET QtyToOrder = Order_Min " - + "WHERE QtyToOrder < Order_Min" - + " AND QtyToOrder > 0" - + " AND AD_PInstance_ID=" + getAD_PInstance_ID(); - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE T_Replenish"); + sql.append(" SET QtyToOrder = Order_Min "); + sql.append("WHERE QtyToOrder < Order_Min"); + sql.append(" AND QtyToOrder > 0" ); + sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Set MinOrderQty=" + no); // Even dividable by Pack - sql = "UPDATE T_Replenish" - + " SET QtyToOrder = QtyToOrder - MOD(QtyToOrder, Order_Pack) + Order_Pack " - + "WHERE MOD(QtyToOrder, Order_Pack) <> 0" - + " AND QtyToOrder > 0" - + " AND AD_PInstance_ID=" + getAD_PInstance_ID(); - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE T_Replenish"); + sql.append(" SET QtyToOrder = QtyToOrder - MOD(QtyToOrder, Order_Pack) + Order_Pack "); + sql.append("WHERE MOD(QtyToOrder, Order_Pack) <> 0"); + sql.append(" AND QtyToOrder > 0"); + sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Set OrderPackQty=" + no); // Source from other warehouse if (wh.getM_WarehouseSource_ID() != 0) { - sql = "UPDATE T_Replenish" - + " SET M_WarehouseSource_ID=" + wh.getM_WarehouseSource_ID() - + " WHERE AD_PInstance_ID=" + getAD_PInstance_ID(); - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE T_Replenish"); + sql.append(" SET M_WarehouseSource_ID=").append(wh.getM_WarehouseSource_ID()); + sql.append(" WHERE AD_PInstance_ID=").append(getAD_PInstance_ID()); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Set Source Warehouse=" + no); } // Check Source Warehouse - sql = "UPDATE T_Replenish" - + " SET M_WarehouseSource_ID = NULL " - + "WHERE M_Warehouse_ID=M_WarehouseSource_ID" - + " AND AD_PInstance_ID=" + getAD_PInstance_ID(); - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE T_Replenish"); + sql.append(" SET M_WarehouseSource_ID = NULL " ); + sql.append("WHERE M_Warehouse_ID=M_WarehouseSource_ID"); + sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Set same Source Warehouse=" + no); @@ -415,10 +417,10 @@ public class ReplenishReportProduction extends SvrProcess } } // Delete rows where nothing to order - sql = "DELETE T_Replenish " - + "WHERE QtyToOrder < 1" - + " AND AD_PInstance_ID=" + getAD_PInstance_ID(); - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("DELETE T_Replenish "); + sql.append("WHERE QtyToOrder < 1"); + sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Delete No QtyToOrder=" + no); @@ -430,7 +432,7 @@ public class ReplenishReportProduction extends SvrProcess private void createPO() { int noOrders = 0; - String info = ""; + StringBuilder info = new StringBuilder(); // MOrder order = null; MWarehouse wh = null; @@ -459,7 +461,8 @@ public class ReplenishReportProduction extends SvrProcess return; log.fine(order.toString()); noOrders++; - info += " - " + order.getDocumentNo(); + info.append(" - "); + info.append(order.getDocumentNo()); } MOrderLine line = new MOrderLine (order); line.setM_Product_ID(replenish.getM_Product_ID()); @@ -467,7 +470,7 @@ public class ReplenishReportProduction extends SvrProcess line.setPrice(); line.saveEx(); } - m_info = "#" + noOrders + info; + m_info = "#" + noOrders + info.toString(); log.info(m_info); } // createPO @@ -477,7 +480,7 @@ public class ReplenishReportProduction extends SvrProcess private void createRequisition() { int noReqs = 0; - String info = ""; + StringBuilder info = new StringBuilder(); // MRequisition requisition = null; MWarehouse wh = null; @@ -502,7 +505,8 @@ public class ReplenishReportProduction extends SvrProcess return; log.fine(requisition.toString()); noReqs++; - info += " - " + requisition.getDocumentNo(); + info.append(" - "); + info.append(requisition.getDocumentNo()); } // MRequisitionLine line = new MRequisitionLine(requisition); @@ -512,7 +516,7 @@ public class ReplenishReportProduction extends SvrProcess line.setPrice(); line.saveEx(); } - m_info = "#" + noReqs + info; + m_info = "#" + noReqs + info.toString(); log.info(m_info); } // createRequisition @@ -522,7 +526,7 @@ public class ReplenishReportProduction extends SvrProcess private void createMovements() { int noMoves = 0; - String info = ""; + StringBuilder info = new StringBuilder(); // MClient client = null; MMovement move = null; @@ -558,7 +562,7 @@ public class ReplenishReportProduction extends SvrProcess return; log.fine(move.toString()); noMoves++; - info += " - " + move.getDocumentNo(); + info.append(" - ").append(move.getDocumentNo()); } // To int M_LocatorTo_ID = wh.getDefaultLocator().getM_Locator_ID(); @@ -603,7 +607,7 @@ public class ReplenishReportProduction extends SvrProcess } else { - m_info = "#" + noMoves + info; + m_info = "#" + noMoves + info.toString(); log.info(m_info); } } // Create Inventory Movements @@ -614,7 +618,7 @@ public class ReplenishReportProduction extends SvrProcess private void createDO() throws Exception { int noMoves = 0; - String info = ""; + StringBuilder info = new StringBuilder(); // MClient client = null; MDDOrder order = null; @@ -681,7 +685,7 @@ public class ReplenishReportProduction extends SvrProcess return; log.fine(order.toString()); noMoves++; - info += " - " + order.getDocumentNo(); + info.append(" - ").append(order.getDocumentNo()); } // To @@ -750,7 +754,7 @@ public class ReplenishReportProduction extends SvrProcess } else { - m_info = "#" + noMoves + info; + m_info = "#" + noMoves + info.toString(); log.info(m_info); } } // create Distribution Order @@ -760,7 +764,7 @@ public class ReplenishReportProduction extends SvrProcess private void createProduction() { int noProds = 0; - String info = ""; + StringBuilder info = new StringBuilder(); // MProduction production = null; MWarehouse wh = null; @@ -811,11 +815,12 @@ public class ReplenishReportProduction extends SvrProcess production.saveEx(get_TrxName()); log.fine(production.toString()); noProds++; - info += " - " + production.getDocumentNo(); + info.append(" - "); + info.append(production.getDocumentNo()); } } - m_info = "#" + noProds + info; + m_info = "#" + noProds + info.toString(); log.info(m_info); } // createRequisition @@ -825,16 +830,16 @@ public class ReplenishReportProduction extends SvrProcess */ private X_T_Replenish[] getReplenish (String where) { - String sql = "SELECT * FROM T_Replenish " - + "WHERE AD_PInstance_ID=? "; + StringBuilder sql = new StringBuilder("SELECT * FROM T_Replenish "); + sql.append("WHERE AD_PInstance_ID=? "); if (where != null && where.length() > 0) - sql += " AND " + where; - sql += " ORDER BY M_Warehouse_ID, M_WarehouseSource_ID, C_BPartner_ID"; + sql.append(" AND ").append(where); + sql.append(" ORDER BY M_Warehouse_ID, M_WarehouseSource_ID, C_BPartner_ID"); ArrayList list = new ArrayList(); PreparedStatement pstmt = null; try { - pstmt = DB.prepareStatement (sql, get_TrxName()); + pstmt = DB.prepareStatement (sql.toString(), get_TrxName()); pstmt.setInt (1, getAD_PInstance_ID()); ResultSet rs = pstmt.executeQuery (); while (rs.next ()) @@ -845,7 +850,7 @@ public class ReplenishReportProduction extends SvrProcess } catch (Exception e) { - log.log(Level.SEVERE, sql, e); + log.log(Level.SEVERE, sql.toString(), e); } try { diff --git a/org.adempiere.base/src/org/adempiere/process/UUIDGenerator.java b/org.adempiere.base/src/org/adempiere/process/UUIDGenerator.java index 75188890e0..30a95be6ce 100644 --- a/org.adempiere.base/src/org/adempiere/process/UUIDGenerator.java +++ b/org.adempiere.base/src/org/adempiere/process/UUIDGenerator.java @@ -76,15 +76,15 @@ public class UUIDGenerator extends SvrProcess { tableName = tableName.trim(); if (!tableName.endsWith("%")) tableName = tableName + "%"; - String sql = "SELECT AD_Table_ID, TableName FROM AD_Table WHERE TableName like ? AND IsView = 'N' AND IsActive='Y'"; + StringBuilder sql = new StringBuilder("SELECT AD_Table_ID, TableName FROM AD_Table WHERE TableName like ? AND IsView = 'N' AND IsActive='Y'"); if (DB.isOracle()) { - sql = sql + " ESCAPE '\' "; + sql.append(" ESCAPE '\' "); } PreparedStatement stmt = null; ResultSet rs = null; int count = 0; try { - stmt = DB.prepareStatement(sql, null); + stmt = DB.prepareStatement(sql.toString(), null); stmt.setString(1, tableName); rs = stmt.executeQuery(); while(rs.next()) { @@ -133,7 +133,7 @@ public class UUIDGenerator extends SvrProcess { public static void updateUUID(MColumn column, String trxName) { MTable table = (MTable) column.getAD_Table(); int AD_Column_ID = DB.getSQLValue(null, "SELECT AD_Column_ID FROM AD_Column WHERE AD_Table_ID=? AND ColumnName=?", table.getAD_Table_ID(), table.getTableName()+"_ID"); - StringBuffer sql = new StringBuffer("SELECT "); + StringBuilder sql = new StringBuilder("SELECT "); String keyColumn = null; List compositeKeys = null; if (AD_Column_ID > 0) { @@ -151,19 +151,16 @@ public class UUIDGenerator extends SvrProcess { } sql.append(" FROM ").append(table.getTableName()); sql.append(" WHERE ").append(column.getColumnName()).append(" IS NULL "); - StringBuffer updateSQL = new StringBuffer(); - updateSQL.append("UPDATE "); + StringBuilder updateSQL = new StringBuilder("UPDATE "); updateSQL.append(table.getTableName()); updateSQL.append(" SET "); updateSQL.append(column.getColumnName()); updateSQL.append("=? WHERE "); if (AD_Column_ID > 0) { - updateSQL.append(keyColumn); - updateSQL.append("=?"); + updateSQL.append(keyColumn).append("=?"); } else { for(String s : compositeKeys) { - updateSQL.append(s); - updateSQL.append("=? AND "); + updateSQL.append(s).append("=? AND "); } int length = updateSQL.length(); updateSQL.delete(length-5, length); // delete last AND @@ -235,7 +232,7 @@ public class UUIDGenerator extends SvrProcess { tableName = tableName.toLowerCase(); } int noColumns = 0; - String sql = null; + StringBuilder sql = null; // ResultSet rs = null; try @@ -244,13 +241,13 @@ public class UUIDGenerator extends SvrProcess { while (rs.next()) { noColumns++; - String columnName = rs.getString ("COLUMN_NAME"); - if (!columnName.equalsIgnoreCase(column.getColumnName())) + StringBuilder columnName = new StringBuilder(rs.getString ("COLUMN_NAME")); + if (!columnName.toString().equalsIgnoreCase(column.getColumnName())) continue; // update existing column boolean notNull = DatabaseMetaData.columnNoNulls == rs.getInt("NULLABLE"); - sql = column.getSQLModify(table, column.isMandatory() != notNull); + sql = new StringBuilder(column.getSQLModify(table, column.isMandatory() != notNull)); break; } } @@ -261,20 +258,20 @@ public class UUIDGenerator extends SvrProcess { // No Table if (noColumns == 0) - sql = table.getSQLCreate (); + sql = new StringBuilder(table.getSQLCreate ()); // No existing column else if (sql == null) - sql = column.getSQLAdd(table); + sql = new StringBuilder(column.getSQLAdd(table)); - int no = 0; + int no = 0; if (sql.indexOf(DB.SQLSTATEMENT_SEPARATOR) == -1) { - no = DB.executeUpdate(sql, false, null); - addLog (0, null, new BigDecimal(no), sql); + no = DB.executeUpdate(sql.toString(), false, null); + addLog (0, null, new BigDecimal(no), sql.toString()); } else { - String statements[] = sql.split(DB.SQLSTATEMENT_SEPARATOR); + String statements[] = sql.toString().split(DB.SQLSTATEMENT_SEPARATOR); for (int i = 0; i < statements.length; i++) { int count = DB.executeUpdate(statements[i], false, null); @@ -285,25 +282,25 @@ public class UUIDGenerator extends SvrProcess { if (no != -1) { - String indexName = column.getColumnName()+"_idx"; + StringBuilder indexName = new StringBuilder(column.getColumnName()).append("_idx"); if (indexName.length() > 30) { int i = indexName.length() - 31; - indexName = column.getColumnName().substring(0, column.getColumnName().length() - i); - indexName = indexName + "_uu_idx"; + indexName = new StringBuilder(column.getColumnName().substring(0, column.getColumnName().length() - i)); + indexName.append("_uu_idx"); } - String indexSql = "CREATE UNIQUE INDEX " + indexName + " ON " + tableName - + "(" + column.getColumnName() +")"; - DB.executeUpdateEx(indexSql, null); + StringBuilder indexSql = new StringBuilder("CREATE UNIQUE INDEX ").append(indexName).append(" ON ").append(tableName) + .append("(").append(column.getColumnName()).append(")"); + DB.executeUpdateEx(indexSql.toString(), null); } if (no == -1) { - String msg = "@Error@ "; + StringBuilder msg = new StringBuilder("@Error@ "); ValueNamePair pp = CLogger.retrieveError(); if (pp != null) - msg = pp.getName() + " - "; - msg += sql; - throw new AdempiereUserError (msg); + msg = new StringBuilder(pp.getName()).append(" - "); + msg.append(sql); + throw new AdempiereUserError (msg.toString()); } } catch (SQLException e) { throw new DBException(e); diff --git a/org.adempiere.base/src/org/adempiere/util/AbstractDocumentSearch.java b/org.adempiere.base/src/org/adempiere/util/AbstractDocumentSearch.java index ab455fdadd..3e203157a1 100644 --- a/org.adempiere.base/src/org/adempiere/util/AbstractDocumentSearch.java +++ b/org.adempiere.base/src/org/adempiere/util/AbstractDocumentSearch.java @@ -64,8 +64,10 @@ public abstract class AbstractDocumentSearch { */ public boolean openDocumentsByDocumentNo(String searchString) { windowOpened = false; - - log.fine("Search started with String: " + searchString); + StringBuilder msglog = new StringBuilder(); + + msglog.append("Search started with String: ").append(searchString); + log.fine(msglog.toString()); // Check if / how many transaction-codes are used if (! Util.isEmpty(searchString)) { @@ -73,7 +75,7 @@ public abstract class AbstractDocumentSearch { List codeList = new ArrayList(); boolean codeSearch = true; - StringBuffer search = new StringBuffer(); + StringBuilder search = new StringBuilder(); // Analyze String to separate transactionCodes from searchString for (int i = 0; i < codes.length; i++) { @@ -99,12 +101,15 @@ public abstract class AbstractDocumentSearch { // Start the search for every single code if (codeList.size() > 0) { for (int i = 0; i < codeList.size(); i++) { - log.fine("Search with Transaction: '" + codeList.get(i) + "' for: '" - + search.toString() + "'"); + msglog = new StringBuilder("Search with Transaction: '"); + msglog.append(codeList.get(i)).append("' for: '") + .append(search.toString()).append("'"); + log.fine(msglog.toString()); getID(codeList.get(i), search.toString()); } } else { - log.fine("Search without Transaction: " + search.toString()); + msglog = new StringBuilder("Search without Transaction: ").append(search.toString()); + log.fine(msglog.toString()); getID(null, search.toString()); } } else { @@ -125,8 +130,10 @@ public abstract class AbstractDocumentSearch { ResultSet rsPO = null; PreparedStatement pstmtSO = null; PreparedStatement pstmtPO = null; - String sqlSO = null; - String sqlPO = null; + StringBuilder sqlSO = null; + StringBuilder sqlPO = null; + StringBuilder msglog = null; + final Properties ctx = Env.getCtx(); final MRole role = MRole.get(ctx, Env.getAD_Role_ID(ctx), Env.getAD_User_ID(ctx), true); @@ -138,21 +145,22 @@ public abstract class AbstractDocumentSearch { // SearchDefinition with a given table and column if (msd.getSearchType().equals(MSearchDefinition.SEARCHTYPE_TABLE)) { MColumn column = new MColumn(Env.getCtx(), msd.getAD_Column_ID(), null); - sqlSO = "SELECT " + table.getTableName() + "_ID FROM " + table.getTableName() + " "; + sqlSO = new StringBuilder("SELECT ").append(table.getTableName()).append("_ID FROM ").append(table.getTableName()) + .append(" "); // search for an Integer if (msd.getDataType().equals(MSearchDefinition.DATATYPE_INTEGER)) { - sqlSO += "WHERE " + column.getColumnName() + "=?"; + sqlSO.append("WHERE ").append(column.getColumnName()).append("=?"); // search for a String } else { - sqlSO += "WHERE UPPER(" + column.getColumnName()+ ") LIKE UPPER(?)"; + sqlSO.append("WHERE UPPER(").append(column.getColumnName()).append(") LIKE UPPER(?)"); } if (msd.getPO_Window_ID() != 0) { - sqlPO = sqlSO + " AND IsSOTrx='N'"; - sqlSO += " AND IsSOTrx='Y'"; + sqlPO = new StringBuilder(sqlSO.toString()).append(" AND IsSOTrx='N'"); + sqlSO.append(" AND IsSOTrx='Y'"); } - pstmtSO = DB.prepareStatement(sqlSO, null); - pstmtPO = DB.prepareStatement(sqlPO, null); + pstmtSO = DB.prepareStatement(sqlSO.toString(), null); + pstmtPO = DB.prepareStatement(sqlPO.toString(), null); // search for a Integer if (msd.getDataType().equals(MSearchDefinition.DATATYPE_INTEGER)) { pstmtSO.setInt(1, Integer.valueOf(searchString.replaceAll("\\D", ""))); @@ -168,11 +176,11 @@ public abstract class AbstractDocumentSearch { } // SearchDefinition with a special query } else if (msd.getSearchType().equals(MSearchDefinition.SEARCHTYPE_QUERY)) { - sqlSO = msd.getQuery(); - pstmtSO = DB.prepareStatement(sqlSO, null); + sqlSO = new StringBuilder(msd.getQuery()); + pstmtSO = DB.prepareStatement(sqlSO.toString(), null); // count '?' in statement int count = 1; - for (char c : sqlSO.toCharArray()) { + for (char c : sqlSO.toString().toCharArray()) { if (c == '?') { count++; } @@ -186,15 +194,17 @@ public abstract class AbstractDocumentSearch { } } if (pstmtSO != null) { - log.fine("SQL Sales: " + sqlSO); + msglog = new StringBuilder("SQL Sales: ").append(sqlSO.toString()); + log.fine(msglog.toString()); rsSO = pstmtSO.executeQuery(); Vector idSO = new Vector(); while (rsSO.next()) { idSO.add(new Integer(rsSO.getInt(1))); } if (role.getWindowAccess(msd.getAD_Window_ID()) != null) { - log.fine("Open Window: " + msd.getAD_Window_ID() + " / Table: " - + table.getTableName() + " / Number of Results: " + idSO.size()); + msglog = new StringBuilder("Open Window: ").append(msd.getAD_Window_ID()).append(" / Table: ") + .append(table.getTableName()).append(" / Number of Results: ").append(idSO.size()); + log.fine(msglog.toString()); if (idSO.size() == 0 && (searchString == null || searchString.trim().length() == 0)) { // No search string - open the window with new record @@ -207,15 +217,17 @@ public abstract class AbstractDocumentSearch { } } if (pstmtPO != null) { - log.fine("SQL Purchase: " + sqlPO); + msglog = new StringBuilder("SQL Purchase: ").append(sqlPO); + log.fine(msglog.toString()); rsPO = pstmtPO.executeQuery(); Vector idPO = new Vector(); while (rsPO.next()) { idPO.add(new Integer(rsPO.getInt(1))); } if (role.getWindowAccess(msd.getPO_Window_ID()) != null) { - log.fine("Open Window: " + msd.getPO_Window_ID() + " / Table: " - + table.getTableName() + " / Number of Results: " + idPO.size()); + msglog = new StringBuilder("Open Window: ").append(msd.getPO_Window_ID()).append(" / Table: ") + .append(table.getTableName()).append(" / Number of Results: ").append(idPO.size()); + log.fine(msglog.toString()); openWindow(idPO, table.getTableName(), msd.getPO_Window_ID()); } else { log.warning("Role is not allowed to view this window"); @@ -253,17 +265,13 @@ public abstract class AbstractDocumentSearch { if (ids == null || ids.size() == 0) { return; } - StringBuffer whereString = new StringBuffer(); - whereString.append(" "); - whereString.append(tableName); - whereString.append("_ID"); + StringBuilder whereString = new StringBuilder(" ").append(tableName).append("_ID"); // create query string if (ids.size() == 1) { if (ids.get(0).intValue() == 0) { whereString = null; } else { - whereString.append("="); - whereString.append(ids.get(0).intValue()); + whereString.append("=").append(ids.get(0).intValue()); } } else { whereString.append(" IN ("); @@ -276,12 +284,14 @@ public abstract class AbstractDocumentSearch { } } } + log.fine(whereString.toString()); final MQuery query = new MQuery(tableName); query.addRestriction(whereString.toString()); final boolean ok = openWindow(windowId, query); if (!ok) { - log.severe("Unable to open window: " + whereString.toString()); + StringBuilder msglog = new StringBuilder("Unable to open window: ").append(whereString.toString()); + log.severe(msglog.toString()); } if (!windowOpened && ok) windowOpened = true; diff --git a/org.adempiere.base/src/org/adempiere/util/ModelClassGenerator.java b/org.adempiere.base/src/org/adempiere/util/ModelClassGenerator.java index f51cbb15e8..728f1c3585 100644 --- a/org.adempiere.base/src/org/adempiere/util/ModelClassGenerator.java +++ b/org.adempiere.base/src/org/adempiere/util/ModelClassGenerator.java @@ -75,8 +75,8 @@ public class ModelClassGenerator this.packageName = packageName; // create column access methods - StringBuffer mandatory = new StringBuffer(); - StringBuffer sb = createColumns(AD_Table_ID, mandatory); + StringBuilder mandatory = new StringBuilder(); + StringBuilder sb = createColumns(AD_Table_ID, mandatory); // Header String className = createHeader(AD_Table_ID, sb, mandatory, packageName); @@ -105,7 +105,7 @@ public class ModelClassGenerator * @param packageName package name * @return class name */ - private String createHeader (int AD_Table_ID, StringBuffer sb, StringBuffer mandatory, String packageName) + private String createHeader (int AD_Table_ID, StringBuilder sb, StringBuilder mandatory, String packageName) { String tableName = ""; int accessLevel = 0; @@ -147,7 +147,7 @@ public class ModelClassGenerator String keyColumn = tableName + "_ID"; String className = "X_" + tableName; // - StringBuffer start = new StringBuffer () + StringBuilder start = new StringBuilder() .append (ModelInterfaceGenerator.COPY) .append ("/** Generated Model - DO NOT CHANGE */").append(NL) .append("package " + packageName + ";").append(NL) @@ -248,7 +248,7 @@ public class ModelClassGenerator .append(" }").append(NL) ; - StringBuffer end = new StringBuffer ("}"); + StringBuilder end = new StringBuilder ("}"); // sb.insert(0, start); sb.append(end); @@ -262,9 +262,9 @@ public class ModelClassGenerator * @param mandatory init call for mandatory columns * @return set/get method */ - private StringBuffer createColumns (int AD_Table_ID, StringBuffer mandatory) + private StringBuilder createColumns (int AD_Table_ID, StringBuilder mandatory) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); String sql = "SELECT c.ColumnName, c.IsUpdateable, c.IsMandatory," // 1..3 + " c.AD_Reference_ID, c.AD_Reference_Value_ID, DefaultValue, SeqNo, " // 4..7 + " c.FieldLength, c.ValueMin, c.ValueMax, c.VFormat, c.Callout, " // 8..12 @@ -319,8 +319,10 @@ public class ModelClassGenerator isKeyNamePairCreated = true; } else { - throw new RuntimeException("More than one primary identifier found " - + " (AD_Table_ID=" + AD_Table_ID + ", ColumnName=" + columnName + ")"); + + StringBuilder msgException = new StringBuilder("More than one primary identifier found ") + .append(" (AD_Table_ID=").append(AD_Table_ID).append(", ColumnName=").append(columnName).append(")"); + throw new RuntimeException(msgException.toString()); } } } @@ -357,7 +359,7 @@ public class ModelClassGenerator * @param IsEncrypted stored encrypted @return set/get method */ - private String createColumnMethods (StringBuffer mandatory, + private String createColumnMethods (StringBuilder mandatory, String columnName, boolean isUpdateable, boolean isMandatory, int displayType, int AD_Reference_ID, int fieldLength, String defaultValue, String ValueMin, String ValueMax, String VFormat, @@ -384,7 +386,7 @@ public class ModelClassGenerator setValue = "\t\tset_ValueNoCheckE"; } - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); // TODO - New functionality // 1) Must understand which class to reference @@ -542,7 +544,7 @@ public class ModelClassGenerator // ****** Set Comment ****** - public void generateJavaSetComment(String columnName, String propertyName, String description, StringBuffer result) { + public void generateJavaSetComment(String columnName, String propertyName, String description, StringBuilder result) { result.append(NL) .append("\t/** Set ").append(propertyName).append(".").append(NL) @@ -558,7 +560,7 @@ public class ModelClassGenerator } // ****** Get Comment ****** - public void generateJavaGetComment(String propertyName, String description, StringBuffer result) { + public void generateJavaGetComment(String propertyName, String description, StringBuilder result) { result.append(NL) .append("\t/** Get ").append(propertyName); @@ -584,18 +586,18 @@ public class ModelClassGenerator public static final String NEXTACTION_None = "N"; public static final String NEXTACTION_FollowUp = "F"; */ - private String addListValidation (StringBuffer sb, int AD_Reference_ID, + private String addListValidation (StringBuilder sb, int AD_Reference_ID, String columnName) { - StringBuffer retValue = new StringBuffer(); + StringBuilder retValue = new StringBuilder(); retValue.append("\n\t/** ").append(columnName).append(" AD_Reference_ID=").append(AD_Reference_ID) .append(" */") .append("\n\tpublic static final int ").append(columnName.toUpperCase()) .append("_AD_Reference_ID=").append(AD_Reference_ID).append(";"); // boolean found = false; - StringBuffer values = new StringBuffer("Reference_ID=") + StringBuilder values = new StringBuilder("Reference_ID=") .append(AD_Reference_ID); - StringBuffer statement = new StringBuffer(); + StringBuilder statement = new StringBuilder(); // String sql = "SELECT Value, Name FROM AD_Ref_List WHERE AD_Reference_ID=? ORDER BY AD_Ref_List_ID"; PreparedStatement pstmt = null; @@ -625,7 +627,7 @@ public class ModelClassGenerator // Name (SmallTalkNotation) String name = rs.getString(2); char[] nameArray = name.toCharArray(); - StringBuffer nameClean = new StringBuffer(); + StringBuilder nameClean = new StringBuilder(); boolean initCap = true; for (int i = 0; i < nameArray.length; i++) { @@ -678,10 +680,10 @@ public class ModelClassGenerator DB.close(rs, pstmt); rs = null; pstmt = null; } - statement.append(")" - + "; " - + "else " - + "throw new IllegalArgumentException (\"").append(columnName) + statement.append(")") + .append("; ") + .append("else ") + .append("throw new IllegalArgumentException (\"").append(columnName) .append(" Invalid value - \" + ").append(columnName) .append(" + \" - ").append(values).append("\");"); // [1762461] - Remove hardcoded list items checking in generated models @@ -697,13 +699,13 @@ public class ModelClassGenerator * * @param displayType int @return method code */ - private StringBuffer createKeyNamePair (String columnName, int displayType) + private StringBuilder createKeyNamePair (String columnName, int displayType) { String method = "get" + columnName + "()"; if (displayType != DisplayType.String) method = "String.valueOf(" + method + ")"; - StringBuffer sb = new StringBuffer(NL) + StringBuilder sb = new StringBuilder(NL) .append(" /** Get Record ID/ColumnName").append(NL) .append(" @return ID/ColumnName pair").append(NL) .append(" */").append(NL) @@ -722,7 +724,7 @@ public class ModelClassGenerator * @param sb string buffer * @param fileName file name */ - private void writeToFile (StringBuffer sb, String fileName) + private void writeToFile (StringBuilder sb, String fileName) { try { @@ -797,7 +799,7 @@ public class ModelClassGenerator * Generate java imports * @param sb */ - private void createImports(StringBuffer sb) { + private void createImports(StringBuilder sb) { for (String name : s_importClasses) { sb.append("import ").append(name).append(";").append(NL); } @@ -810,7 +812,7 @@ public class ModelClassGenerator */ public String toString() { - StringBuffer sb = new StringBuffer ("GenerateModel[").append("]"); + StringBuilder sb = new StringBuilder("GenerateModel[").append("]"); return sb.toString(); } @@ -839,7 +841,7 @@ public class ModelClassGenerator if (!tableLike.startsWith("'") || !tableLike.endsWith("'")) tableLike = "'" + tableLike + "'"; - StringBuffer entityTypeFilter = new StringBuffer(); + StringBuilder entityTypeFilter = new StringBuilder(); if (entityType != null && entityType.trim().length() > 0) { entityTypeFilter.append("EntityType IN ("); @@ -877,7 +879,7 @@ public class ModelClassGenerator file.mkdirs(); // complete sql - StringBuffer sql = new StringBuffer(); + StringBuilder sql = new StringBuilder(); sql.append("SELECT AD_Table_ID ") .append("FROM AD_Table ") .append("WHERE (TableName IN ('RV_WarehousePrice','RV_BPartner')") // special views diff --git a/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java b/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java index 24ef048802..f48826c658 100644 --- a/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java +++ b/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java @@ -109,8 +109,8 @@ public class ModelInterfaceGenerator public ModelInterfaceGenerator(int AD_Table_ID, String directory, String packageName) { this.packageName = packageName; // create column access methods - StringBuffer mandatory = new StringBuffer(); - StringBuffer sb = createColumns(AD_Table_ID, mandatory); + StringBuilder mandatory = new StringBuilder(); + StringBuilder sb = createColumns(AD_Table_ID, mandatory); // Header String tableName = createHeader(AD_Table_ID, sb, mandatory); @@ -134,7 +134,7 @@ public class ModelInterfaceGenerator * @param packageName package name * @return class name */ - private String createHeader(int AD_Table_ID, StringBuffer sb, StringBuffer mandatory) { + private String createHeader(int AD_Table_ID, StringBuilder sb, StringBuilder mandatory) { String tableName = ""; int accessLevel = 0; String sql = "SELECT TableName, AccessLevel FROM AD_Table WHERE AD_Table_ID=?"; @@ -162,18 +162,18 @@ public class ModelInterfaceGenerator if (tableName == null) throw new RuntimeException("TableName not found for ID=" + AD_Table_ID); // - String accessLevelInfo = accessLevel + " "; + StringBuilder accessLevelInfo = new StringBuilder(accessLevel).append(" "); if (accessLevel >= 4 ) - accessLevelInfo += "- System "; + accessLevelInfo.append("- System "); if (accessLevel == 2 || accessLevel == 3 || accessLevel == 6 || accessLevel == 7) - accessLevelInfo += "- Client "; + accessLevelInfo.append("- Client "); if (accessLevel == 1 || accessLevel == 3 || accessLevel == 5 || accessLevel == 7) - accessLevelInfo += "- Org "; + accessLevelInfo.append("- Org "); // String className = "I_" + tableName; // - StringBuffer start = new StringBuffer() + StringBuilder start = new StringBuilder() .append (COPY) .append("package ").append(packageName).append(";").append(NL) ; @@ -216,7 +216,7 @@ public class ModelInterfaceGenerator //.append(" POInfo initPO (Properties ctx);") // INFO - Should this be here??? ; - StringBuffer end = new StringBuffer("}"); + StringBuilder end = new StringBuilder("}"); // sb.insert(0, start); sb.append(end); @@ -231,8 +231,8 @@ public class ModelInterfaceGenerator * @param mandatory init call for mandatory columns * @return set/get method */ - private StringBuffer createColumns(int AD_Table_ID, StringBuffer mandatory) { - StringBuffer sb = new StringBuffer(); + private StringBuilder createColumns(int AD_Table_ID, StringBuilder mandatory) { + StringBuilder sb = new StringBuilder(); String sql = "SELECT c.ColumnName, c.IsUpdateable, c.IsMandatory," // 1..3 + " c.AD_Reference_ID, c.AD_Reference_Value_ID, DefaultValue, SeqNo, " // 4..7 + " c.FieldLength, c.ValueMin, c.ValueMax, c.VFormat, c.Callout, " // 8..12 @@ -321,7 +321,7 @@ public class ModelInterfaceGenerator * @param IsEncrypted stored encrypted * @return set/get method */ - private String createColumnMethods(StringBuffer mandatory, + private String createColumnMethods(StringBuilder mandatory, String columnName, boolean isUpdateable, boolean isMandatory, int displayType, int AD_Reference_ID, int fieldLength, String defaultValue, String ValueMin, String ValueMax, @@ -333,7 +333,7 @@ public class ModelInterfaceGenerator if (defaultValue == null) defaultValue = ""; - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); if (isGenerateSetter(columnName)) { @@ -375,7 +375,7 @@ public class ModelInterfaceGenerator } // ****** Set/Get Comment ****** - public void generateJavaComment(String startOfComment, String propertyName, String description, StringBuffer result) { + public void generateJavaComment(String startOfComment, String propertyName, String description, StringBuilder result) { result.append("\n") .append("\t/** ").append(startOfComment).append(" ") .append(propertyName); @@ -392,7 +392,7 @@ public class ModelInterfaceGenerator * @param sb string buffer * @param fileName file name */ - private void writeToFile(StringBuffer sb, String fileName) { + private void writeToFile(StringBuilder sb, String fileName) { try { File out = new File(fileName); Writer fw = new OutputStreamWriter(new FileOutputStream(out, false), "UTF-8"); @@ -462,7 +462,7 @@ public class ModelInterfaceGenerator * Generate java imports * @param sb */ - private void createImports(StringBuffer sb) { + private void createImports(StringBuilder sb) { for (String name : s_importClasses) { sb.append("import ").append(name).append(";"); //.append(NL); } @@ -634,13 +634,13 @@ public class ModelInterfaceGenerator public static String getReferenceClassName(int AD_Table_ID, String columnName, int displayType, int AD_Reference_ID) { - String referenceClassName = null; + StringBuilder referenceClassName = null; // if (displayType == DisplayType.TableDir || (displayType == DisplayType.Search && AD_Reference_ID == 0)) { String refTableName = MQuery.getZoomTableName(columnName); // teo_sarca: BF [ 1817768 ] Isolate hardcoded table direct columns - referenceClassName = "I_"+refTableName; + referenceClassName = new StringBuilder("I_").append(refTableName); MTable table = MTable.get(Env.getCtx(), refTableName); if (table != null) @@ -649,7 +649,7 @@ public class ModelInterfaceGenerator String modelpackage = getModelPackage(entityType) ; if (modelpackage != null) { - referenceClassName = modelpackage+"."+referenceClassName; + referenceClassName = new StringBuilder(".").append(referenceClassName); } if (!isGenerateModelGetterForEntity(AD_Table_ID, entityType)) { @@ -691,11 +691,11 @@ public class ModelInterfaceGenerator final int refDisplayType = rs.getInt(3); if (refDisplayType == DisplayType.ID) { - referenceClassName = "I_"+refTableName; + referenceClassName = new StringBuilder("I_").append(refTableName); String modelpackage = getModelPackage(entityType); if (modelpackage != null) { - referenceClassName = modelpackage+"."+referenceClassName; + referenceClassName = new StringBuilder(modelpackage).append(".").append(referenceClassName); } if (!isGenerateModelGetterForEntity(AD_Table_ID, entityType)) { @@ -716,19 +716,19 @@ public class ModelInterfaceGenerator } else if (displayType == DisplayType.Location) { - referenceClassName = "I_C_Location"; + referenceClassName = new StringBuilder("I_C_Location"); } else if (displayType == DisplayType.Locator) { - referenceClassName = "I_M_Locator"; + referenceClassName = new StringBuilder("I_M_Locator"); } else if (displayType == DisplayType.Account) { - referenceClassName = "I_C_ValidCombination"; + referenceClassName = new StringBuilder("I_C_ValidCombination"); } else if (displayType == DisplayType.PAttribute) { - referenceClassName = "I_M_AttributeSetInstance"; + referenceClassName = new StringBuilder("I_M_AttributeSetInstance"); } else { @@ -736,7 +736,7 @@ public class ModelInterfaceGenerator //sb.append("\tpublic I_"+columnName+" getI_").append(columnName).append("(){return null; };"); } // - return referenceClassName; + return referenceClassName.toString(); } @@ -746,7 +746,7 @@ public class ModelInterfaceGenerator * @return string representation */ public String toString() { - StringBuffer sb = new StringBuffer("GenerateModel[").append("]"); + StringBuilder sb = new StringBuilder("GenerateModel[").append("]"); return sb.toString(); } @@ -775,16 +775,16 @@ public class ModelInterfaceGenerator if (!tableLike.startsWith("'") || !tableLike.endsWith("'")) tableLike = "'" + tableLike + "'"; - StringBuffer entityTypeFilter = new StringBuffer(); + StringBuilder entityTypeFilter = new StringBuilder(); if (entityType != null && entityType.trim().length() > 0) { entityTypeFilter.append("EntityType IN ("); StringTokenizer tokenizer = new StringTokenizer(entityType, ","); int i = 0; while(tokenizer.hasMoreTokens()) { - String token = tokenizer.nextToken().trim(); - if (!token.startsWith("'") || !token.endsWith("'")) - token = "'" + token + "'"; + StringBuilder token = new StringBuilder(tokenizer.nextToken().trim()); + if (!token.toString().startsWith("'") || !token.toString().endsWith("'")) + token = new StringBuilder("'").append(token).append("'"); if (i > 0) entityTypeFilter.append(","); entityTypeFilter.append(token); @@ -797,23 +797,23 @@ public class ModelInterfaceGenerator entityTypeFilter.append("EntityType IN ('U','A')"); } - String directory = sourceFolder.trim(); + StringBuilder directory = new StringBuilder(sourceFolder.trim()); String packagePath = packageName.replace(".", File.separator); - if (!(directory.endsWith("/") || directory.endsWith("\\"))) + if (!(directory.toString().endsWith("/") || directory.toString().endsWith("\\"))) { - directory = directory + File.separator; + directory.append(File.separator); } if (File.separator.equals("/")) - directory = directory.replaceAll("[\\\\]", File.separator); + directory = new StringBuilder(directory.toString().replaceAll("[\\\\]", File.separator)); else - directory = directory.replaceAll("[/]", File.separator); - directory = directory + packagePath; - file = new File(directory); + directory = new StringBuilder(directory.toString().replaceAll("[/]", File.separator)); + directory = new StringBuilder(directory).append(packagePath); + file = new File(directory.toString()); if (!file.exists()) file.mkdirs(); // complete sql - StringBuffer sql = new StringBuffer(); + StringBuilder sql = new StringBuilder(); sql.append("SELECT AD_Table_ID ") .append("FROM AD_Table ") .append("WHERE (TableName IN ('RV_WarehousePrice','RV_BPartner')") // special views @@ -833,7 +833,7 @@ public class ModelInterfaceGenerator rs = pstmt.executeQuery(); while (rs.next()) { - new ModelInterfaceGenerator(rs.getInt(1), directory, packageName); + new ModelInterfaceGenerator(rs.getInt(1), directory.toString(), packageName); count++; } } diff --git a/org.adempiere.base/src/org/compiere/impexp/OFXBankStatementHandler.java b/org.adempiere.base/src/org/compiere/impexp/OFXBankStatementHandler.java index 20e3187d75..a5e6e858c2 100644 --- a/org.adempiere.base/src/org/compiere/impexp/OFXBankStatementHandler.java +++ b/org.adempiere.base/src/org/compiere/impexp/OFXBankStatementHandler.java @@ -56,8 +56,8 @@ public abstract class OFXBankStatementHandler extends DefaultHandler { protected MBankStatementLoader m_controller; - protected String m_errorMessage = ""; - protected String m_errorDescription = ""; + protected StringBuffer m_errorMessage; + protected StringBuffer m_errorDescription; protected BufferedReader m_reader = null; protected SAXParser m_parser; @@ -177,8 +177,8 @@ public abstract class OFXBankStatementHandler extends DefaultHandler boolean result = false; if (controller == null) { - m_errorMessage = "ErrorInitializingParser"; - m_errorDescription = "ImportController is a null reference"; + m_errorMessage = new StringBuffer("ErrorInitializingParser"); + m_errorDescription = new StringBuffer("ImportController is a null reference"); return result; } this.m_controller = controller; @@ -190,13 +190,13 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } catch(ParserConfigurationException e) { - m_errorMessage = "ErrorInitializingParser"; - m_errorDescription = "Unable to configure SAX parser: " + e.getMessage(); + m_errorMessage = new StringBuffer("ErrorInitializingParser"); + m_errorDescription = new StringBuffer("Unable to configure SAX parser: ").append(e.getMessage()); } catch(SAXException e) { - m_errorMessage = "ErrorInitializingParser"; - m_errorDescription = "Unable to initialize SAX parser: " + e.getMessage(); + m_errorMessage = new StringBuffer("ErrorInitializingParser"); + m_errorDescription = new StringBuffer("Unable to initialize SAX parser: ").append(e.getMessage()); } return result; } // init @@ -217,7 +217,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler { BufferedReader reader = new BufferedReader(new InputStreamReader(is)); reader.mark(HEADER_SIZE + 100); - StringBuffer header = new StringBuffer(""); + StringBuilder header = new StringBuilder(); for (int i = 0; i < HEADER_SIZE; i++) { header.append(reader.readLine()); @@ -250,8 +250,8 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } catch(IOException e) { - m_errorMessage = "ErrorReadingData"; - m_errorDescription = e.getMessage(); + m_errorMessage = new StringBuffer("ErrorReadingData"); + m_errorDescription = new StringBuffer(e.getMessage()); return result; } @@ -311,13 +311,13 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } catch(SAXException e) { - m_errorMessage = "ErrorParsingData"; - m_errorDescription = e.getMessage(); + m_errorMessage = new StringBuffer("ErrorParsingData"); + m_errorDescription = new StringBuffer(e.getMessage()); } catch(IOException e) { - m_errorMessage = "ErrorReadingData"; - m_errorDescription = e.getMessage(); + m_errorMessage = new StringBuffer("ErrorReadingData"); + m_errorDescription = new StringBuffer(e.getMessage()); } return result; @@ -536,7 +536,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler */ if (!validOFX) { - m_errorDescription = "Invalid OFX syntax: " + qName; + m_errorDescription = new StringBuffer("Invalid OFX syntax: ").append(qName); throw new SAXException("Invalid OFX syntax: " + qName); } if (qName.equals(XML_STMTTRN_TAG)) @@ -721,7 +721,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler catch(Exception e) { - m_errorDescription = "Invalid data: " + value + " <-> " + e.getMessage(); + m_errorDescription = new StringBuffer("Invalid data: ").append(value).append(" <-> ").append(e.getMessage()); throw new SAXException("Invalid data: " + value); } @@ -731,9 +731,9 @@ public abstract class OFXBankStatementHandler extends DefaultHandler { if (!m_controller.saveLine()) { - m_errorMessage = m_controller.getErrorMessage(); - m_errorDescription = m_controller.getErrorDescription(); - throw new SAXException(m_errorMessage); + m_errorMessage = new StringBuffer(m_controller.getErrorMessage()); + m_errorDescription = new StringBuffer(m_controller.getErrorDescription()); + throw new SAXException(m_errorMessage.toString()); } } } @@ -766,7 +766,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler */ public String getLastErrorMessage() { - return m_errorMessage; + return m_errorMessage.toString(); } /** @@ -775,7 +775,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler */ public String getLastErrorDescription() { - return m_errorDescription; + return m_errorDescription.toString(); } /** diff --git a/org.adempiere.base/src/org/compiere/impexp/OFXFileBankStatementLoader.java b/org.adempiere.base/src/org/compiere/impexp/OFXFileBankStatementLoader.java index ecfb9936fe..4b8a4cfa4f 100644 --- a/org.adempiere.base/src/org/compiere/impexp/OFXFileBankStatementLoader.java +++ b/org.adempiere.base/src/org/compiere/impexp/OFXFileBankStatementLoader.java @@ -69,8 +69,8 @@ public final class OFXFileBankStatementLoader extends OFXBankStatementHandler im } catch(Exception e) { - m_errorMessage = "ErrorReadingData"; - m_errorDescription = ""; + m_errorMessage = new StringBuffer("ErrorReadingData"); + m_errorDescription = new StringBuffer(); } return result; diff --git a/org.adempiere.base/src/org/compiere/model/MLanguage.java b/org.adempiere.base/src/org/compiere/model/MLanguage.java index 885a79df09..12d6754825 100644 --- a/org.adempiere.base/src/org/compiere/model/MLanguage.java +++ b/org.adempiere.base/src/org/compiere/model/MLanguage.java @@ -162,9 +162,10 @@ public class MLanguage extends X_AD_Language */ public String toString() { - return "MLanguage[" + getAD_Language() + "-" + getName() - + ",Language=" + getLanguageISO() + ",Country=" + getCountryCode() - + "]"; + StringBuilder str = new StringBuilder("MLanguage[").append(getAD_Language()).append("-").append(getName()) + .append(",Language=").append(getLanguageISO()).append(",Country=").append(getCountryCode()) + .append("]"); + return str.toString(); } // toString /** @@ -214,7 +215,7 @@ public class MLanguage extends X_AD_Language // some short formats have only one M and d (e.g. ths US) if (sFormat.indexOf("MM") == -1 && sFormat.indexOf("dd") == -1) { - StringBuffer nFormat = new StringBuffer(""); + StringBuilder nFormat = new StringBuilder(); for (int i = 0; i < sFormat.length(); i++) { if (sFormat.charAt(i) == 'M') @@ -235,7 +236,7 @@ public class MLanguage extends X_AD_Language if (m_dateFormat.toPattern().indexOf("yyyy") == -1) { sFormat = m_dateFormat.toPattern(); - StringBuffer nFormat = new StringBuffer(""); + StringBuilder nFormat = new StringBuilder(); for (int i = 0; i < sFormat.length(); i++) { if (sFormat.charAt(i) == 'y') @@ -365,8 +366,8 @@ public class MLanguage extends X_AD_Language */ private int deleteTable (String tableName) { - String sql = "DELETE FROM "+tableName+" WHERE AD_Language=?"; - int no = DB.executeUpdateEx(sql, new Object[]{getAD_Language()}, get_TrxName()); + StringBuilder sql = new StringBuilder("DELETE FROM ").append(tableName).append(" WHERE AD_Language=?"); + int no = DB.executeUpdateEx(sql.toString(), new Object[]{getAD_Language()}, get_TrxName()); log.fine(tableName + " #" + no); return no; } // deleteTable @@ -420,27 +421,28 @@ public class MLanguage extends X_AD_Language // Insert Statement int AD_User_ID = Env.getAD_User_ID(getCtx()); String keyColumn = baseTable + "_ID"; - String insert = "INSERT INTO " + tableName - + "(AD_Language,IsTranslated, AD_Client_ID,AD_Org_ID, " - + "Createdby,UpdatedBy, " - + keyColumn + cols + ") " - + "SELECT '" + getAD_Language() + "','N', AD_Client_ID,AD_Org_ID, " - + AD_User_ID + "," + AD_User_ID + ", " - + keyColumn + cols - + " FROM " + baseTable - + " WHERE " + keyColumn + " NOT IN (SELECT " + keyColumn - + " FROM " + tableName - + " WHERE AD_Language='" + getAD_Language() + "')"; + StringBuilder insert = new StringBuilder("INSERT INTO ").append(tableName) + .append("(AD_Language,IsTranslated, AD_Client_ID,AD_Org_ID, ") + .append("Createdby,UpdatedBy, ") + .append(keyColumn).append(cols).append(") ") + .append("SELECT '").append(getAD_Language()).append("','N', AD_Client_ID,AD_Org_ID, ") + .append(AD_User_ID).append(",").append(AD_User_ID).append(", ") + .append(keyColumn).append(cols) + .append(" FROM ").append(baseTable) + .append(" WHERE ").append(keyColumn).append(" NOT IN (SELECT ").append(keyColumn) + .append(" FROM ").append(tableName) + .append(" WHERE AD_Language='").append(getAD_Language()).append("')"); // + " WHERE (" + keyColumn + ",'" + getAD_Language()+ "') NOT IN (SELECT " // + keyColumn + ",AD_Language FROM " + tableName + ")"; - int no = DB.executeUpdateEx(insert, null, get_TrxName()); + int no = DB.executeUpdateEx(insert.toString(), null, get_TrxName()); // IDEMPIERE-99 Language Maintenance does not create UUIDs MTable table = MTable.get(getCtx(), tableName); MColumn column = table.getColumn(PO.getUUIDColumnName(tableName)); if (column != null) UUIDGenerator.updateUUID(column, get_TrxName()); // - log.fine(tableName + " #" + no); + StringBuilder msglog = new StringBuilder(tableName).append(" #").append(no); + log.fine(msglog.toString()); return no; } // addTable diff --git a/org.adempiere.base/src/org/compiere/model/MPasswordRule.java b/org.adempiere.base/src/org/compiere/model/MPasswordRule.java index 8cc579ad68..f4b7469304 100644 --- a/org.adempiere.base/src/org/compiere/model/MPasswordRule.java +++ b/org.adempiere.base/src/org/compiere/model/MPasswordRule.java @@ -197,11 +197,10 @@ public class MPasswordRule extends X_AD_PasswordRule { passwordData.setUsername(username); RuleResult result = validator.validate(passwordData); if (!result.isValid()) { - StringBuffer error = new StringBuffer(Msg.getMsg(getCtx(), "PasswordErrors")); + StringBuilder error = new StringBuilder(Msg.getMsg(getCtx(), "PasswordErrors")); error.append(": ["); for (String msg : validator.getMessages(result)) { - error.append(" "); - error.append(msg); + error.append(" ").append(msg); } error.append(" ]"); throw new AdempiereException(error.toString()); @@ -213,8 +212,9 @@ public class MPasswordRule extends X_AD_PasswordRule { Properties props = null; InputStream in = null; try { - String file = "vtpassword_messages_" + Env.getLoginLanguage(getCtx()).getLocale().getLanguage() + ".properties"; - in = this.getClass().getResourceAsStream(file); + StringBuilder file = new StringBuilder("vtpassword_messages_").append(Env.getLoginLanguage(getCtx()).getLocale().getLanguage()) + .append(".properties"); + in = this.getClass().getResourceAsStream(file.toString()); if (in != null) { props = new Properties(); props.load(in); diff --git a/org.adempiere.base/src/org/compiere/util/Language.java b/org.adempiere.base/src/org/compiere/util/Language.java index 98f403a249..0bf73da8c5 100644 --- a/org.adempiere.base/src/org/compiere/util/Language.java +++ b/org.adempiere.base/src/org/compiere/util/Language.java @@ -282,7 +282,9 @@ public class Language implements Serializable String language = lang.substring(0,2); String country = lang.substring(3); Locale locale = new Locale(language, country); - log.info ("Adding Language=" + language + ", Country=" + country + ", Locale=" + locale); + StringBuilder msglog = new StringBuilder() + .append("Adding Language=").append(language).append(", Country=").append(country).append(", Locale=").append(locale); + log.info (msglog.toString()); Language ll = new Language (lang, lang, locale); // Add to Languages ArrayList list = new ArrayList(Arrays.asList(s_languages)); @@ -626,7 +628,7 @@ public class Language implements Serializable if (m_dateFormat.toPattern().indexOf("yyyy") == -1) { sFormat = m_dateFormat.toPattern(); - StringBuffer nFormat = new StringBuffer(""); + StringBuilder nFormat = new StringBuilder(); for (int i = 0; i < sFormat.length(); i++) { if (sFormat.charAt(i) == 'y') @@ -701,7 +703,7 @@ public class Language implements Serializable */ public String toString() { - StringBuffer sb = new StringBuffer("Language=["); + StringBuilder sb = new StringBuilder("Language=["); sb.append(m_name).append(",Locale=").append(m_locale.toString()) .append(",AD_Language=").append(m_AD_Language) .append(",DatePattern=").append(getDBdatePattern()) diff --git a/org.adempiere.ui.swing/src/org/adempiere/apps/graph/HtmlDashboard.java b/org.adempiere.ui.swing/src/org/adempiere/apps/graph/HtmlDashboard.java index c74a734d99..dbea264cc5 100644 --- a/org.adempiere.ui.swing/src/org/adempiere/apps/graph/HtmlDashboard.java +++ b/org.adempiere.ui.swing/src/org/adempiere/apps/graph/HtmlDashboard.java @@ -108,7 +108,7 @@ public class HtmlDashboard extends JPanel implements MouseListener, private String createHTML(PAGE_TYPE requestPage){ - String result = ""; + StringBuilder result = new StringBuilder(""); // READ CSS URL url = getClass().getClassLoader(). @@ -118,27 +118,28 @@ public class HtmlDashboard extends JPanel implements MouseListener, ins = new InputStreamReader(url.openStream()); BufferedReader bufferedReader = new BufferedReader( ins ); String cssLine; - result += ""; + result.append(cssLine).append("\n"); + result.append(""); } catch (IOException e1) { log.log(Level.SEVERE, e1.getLocalizedMessage(), e1); } //System.out.println(result); switch (requestPage) { case PAGE_LOGO: - result += "" - + "
" - + "" - + "" - //+ "" - + "
" - + ""; + + result.append("") + .append("
") + .append("") + .append("") + .append("
") + .append(""); break; + case PAGE_HOME: //************************************************************** - result += // "" - "
\n"; + + result.append("
\n");// "" queryZoom = null; queryZoom = new ArrayList(); String appendToHome = null; @@ -164,21 +165,22 @@ public class HtmlDashboard extends JPanel implements MouseListener, String descriptionTrl = dp.get_Translation(MDashboardContent.COLUMNNAME_Description); if (appendToHome != null) { if (descriptionTrl != null) - result += "

" + descriptionTrl + "

\n"; - result += stripHtml(appendToHome, false) + "
\n"; + result.append("

").append(descriptionTrl).append("

\n"); + result.append(stripHtml(appendToHome, false)).append("
\n"); } if (dc.getAD_Menu_ID() > 0) { - result += "" - + descriptionTrl - + "
\n"); + result.append(""); + result.append(descriptionTrl.toString()); + result.append("
\n"); + } - result += "
\n"; + result.append("
\n"); //result += "table id: " + rs.getInt("AD_TABLE_ID"); if (dc.getPA_Goal_ID() > 0) - result += goalsDetail(dc.getPA_Goal_ID()); + result.append(goalsDetail(dc.getPA_Goal_ID())); } } catch (Exception e) @@ -188,13 +190,13 @@ public class HtmlDashboard extends JPanel implements MouseListener, finally { } - result += "


\n" - + "
\n\n\n"; + result.append("


\n") + .append("
\n\n\n"); break; default: //************************************************************** log.warning("Unknown option - "+requestPage); } - return result; + return result.toString(); } private void createDashboardPreference() @@ -215,30 +217,33 @@ public class HtmlDashboard extends JPanel implements MouseListener, preference.setLine(dc.getLine()); preference.setPA_DashboardContent_ID(dc.getPA_DashboardContent_ID()); - if (!preference.save()) - log.log(Level.SEVERE, "Failed to create dashboard preference " + preference.toString()); + if (!preference.save()){ + StringBuilder msglog = new StringBuilder("Failed to create dashboard preference ").append(preference.toString()); + log.log(Level.SEVERE, msglog.toString()); + } } } ArrayList queryZoom = null; //new ArrayList(); private String goalsDetail(int AD_Table_ID) { //TODO link to goals - String output = ""; - if (m_goals==null) return output; + StringBuilder output = new StringBuilder(); + if (m_goals==null) return output.toString(); for (int i = 0; i < m_goals.length; i++) { MMeasureCalc mc = MMeasureCalc.get(Env.getCtx(), m_goals[i].getMeasure().getPA_MeasureCalc_ID()); if (AD_Table_ID == m_goals[i].getPA_Goal_ID()){// mc.getAD_Table_ID()) { - output += "\n\n"; - output += "\n"; - output += "\n"; + output.append("
" + m_goals[i].getName() + "
Target" + m_goals[i].getMeasureTarget() + "
Actual" + m_goals[i].getMeasureActual() + "
\n\n"); + output.append("\n"); + output.append("\n"); + //if (mc.getTableName()!=null) output += "table: " + mc.getAD_Table_ID() + "
\n"; Graph barPanel = new Graph(m_goals[i]); GraphColumn[] bList = barPanel.getGraphColumnList(); MQuery query = null; - output += "\n"; + output.append("\n"); for (int k=0; k0) output += ""; + if (k>0) output.append(""); if (bgc.getAchievement() != null) // Single Achievement { MAchievement a = bgc.getAchievement(); @@ -270,33 +275,33 @@ public class HtmlDashboard extends JPanel implements MouseListener, bgc.getMeasureDisplay(), bgc.getDate(), bgc.getID(), MRole.getDefault()); // logged in role } - output += ""; + output.append(""); } - output += "" - + "" - + "
").append(m_goals[i].getName()).append("
Target").append(m_goals[i].getMeasureTarget()).append("
Actual").append(m_goals[i].getMeasureActual()).append("
" + m_goals[i].getXAxisText() + "
").append(m_goals[i].getXAxisText()).append("
"+ bgc.getLabel() + ""; + output.append("").append(bgc.getLabel()).append(""); if (query != null) { - output += "" - + bgc.getValue() - + "
\n"; + output.append("") + .append(bgc.getValue()) + .append("
\n"); queryZoom.add(query); } else { log.info("Nothing to zoom to - " + bgc); - output += bgc.getValue(); + output.append(bgc.getValue()); } - output += "
" - + m_goals[i].getDescription() - + "
" - + stripHtml(m_goals[i].getColorSchema().getDescription(), true) - + "
\n"; + output.append("") + .append("") + .append(m_goals[i].getDescription()) + .append("
") + .append(stripHtml(m_goals[i].getColorSchema().getDescription(), true)) + .append("") + .append("\n"); bList = null; barPanel = null; } } - return output; + return output.toString(); } private String stripHtml(String htmlString, boolean all) { diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/Find.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/Find.java index 612f4dd75d..df2f718517 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/Find.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/search/Find.java @@ -670,16 +670,16 @@ public final class Find extends CDialog { GridField field = m_findFields[c]; String columnName = field.getColumnName(); - String header = field.getHeader(); + StringBuilder header = new StringBuilder(field.getHeader()); if (header == null || header.length() == 0) { - header = Msg.translate(Env.getCtx(), columnName); + header = new StringBuilder(Msg.translate(Env.getCtx(), columnName)); if (header == null || header.length() == 0) continue; } if (field.isKey()) - header += (" (ID)"); - ValueNamePair pp = new ValueNamePair(columnName, header); + header.append((" (ID)")); + ValueNamePair pp = new ValueNamePair(columnName, header.toString()); // System.out.println(pp + " = " + field); items.add(pp); } @@ -1011,6 +1011,8 @@ public final class Find extends CDialog private void cmd_ok_Simple() { // Create Query String + StringBuilder msglog; + m_query = new MQuery(m_tableName); m_query.addRestriction(Env.parseContext(Env.getCtx(), m_targetWindowNo, m_whereExtended, false)); if (hasValue && !valueField.getText().equals("%") && valueField.getText().length() != 0) @@ -1054,32 +1056,33 @@ public final class Find extends CDialog Object value = ved.getValue(); if (value != null && value.toString().length() > 0) { - String ColumnName = ((Component)ved).getName (); - log.fine(ColumnName + "=" + value); + StringBuilder ColumnName = new StringBuilder(((Component)ved).getName ()); + msglog = new StringBuilder(ColumnName).append("=").append(value); + log.fine(msglog.toString()); // globalqss - Carlos Ruiz - 20060711 // fix a bug with virtualColumn + isSelectionColumn not yielding results - GridField field = getTargetMField(ColumnName); + GridField field = getTargetMField(ColumnName.toString()); boolean isProductCategoryField = isProductCategoryField(field.getAD_Column_ID()); - String ColumnSQL = field.getColumnSQL(false); + StringBuilder ColumnSQL = new StringBuilder(field.getColumnSQL(false)); // // Be more permissive for String columns if (isSearchLike(field)) { - String valueStr = value.toString().toUpperCase(); - if (!valueStr.endsWith("%")) - valueStr += "%"; + StringBuilder valueStr = new StringBuilder(value.toString().toUpperCase()); + if (!valueStr.toString().endsWith("%")) + valueStr.append("%"); // - ColumnSQL = "UPPER("+ColumnSQL+")"; + ColumnSQL = new StringBuilder("UPPER(").append(ColumnSQL).append(")"); value = valueStr; } // if (value.toString().indexOf('%') != -1) - m_query.addRestriction(ColumnSQL, MQuery.LIKE, value, ColumnName, ved.getDisplay()); + m_query.addRestriction(ColumnSQL.toString(), MQuery.LIKE, value, ColumnName.toString(), ved.getDisplay()); else if (isProductCategoryField && value instanceof Integer) m_query.addRestriction(getSubCategoryWhereClause(((Integer) value).intValue())); else - m_query.addRestriction(ColumnSQL, MQuery.EQUAL, value, ColumnName, ved.getDisplay()); + m_query.addRestriction(ColumnSQL.toString(), MQuery.EQUAL, value, ColumnName.toString(), ved.getDisplay()); /* if (value.toString().indexOf('%') != -1) m_query.addRestriction(ColumnName, MQuery.LIKE, value, ColumnName, ved.getDisplay()); @@ -1152,7 +1155,7 @@ public final class Find extends CDialog // m_query = new MQuery(m_tableName); m_query.addRestriction(Env.parseContext(Env.getCtx(), m_targetWindowNo, m_whereExtended, false)); - StringBuffer code = new StringBuffer(); + StringBuilder code = new StringBuilder(); int openBrackets = 0; for (int row = 0; row < advancedTable.getRowCount(); row++) { @@ -1160,17 +1163,17 @@ public final class Find extends CDialog Object column = advancedTable.getValueAt(row, INDEX_COLUMNNAME); if (column == null) continue; - String ColumnName = column instanceof ValueNamePair ? - ((ValueNamePair)column).getValue() : column.toString(); - String infoName = column.toString(); + StringBuilder ColumnName = new StringBuilder(column instanceof ValueNamePair ? + ((ValueNamePair)column).getValue() : column.toString()); + StringBuilder infoName = new StringBuilder(column.toString()); // - GridField field = getTargetMField(ColumnName); + GridField field = getTargetMField(ColumnName.toString()); if (field == null) continue; boolean isProductCategoryField = isProductCategoryField(field.getAD_Column_ID()); - String ColumnSQL = field.getColumnSQL(false); + StringBuilder ColumnSQL = new StringBuilder(field.getColumnSQL(false)); - String lBrackets = (String) advancedTable.getValueAt(row, INDEX_LEFTBRACKET); + StringBuilder lBrackets = new StringBuilder((String) advancedTable.getValueAt(row, INDEX_LEFTBRACKET)); if ( lBrackets != null ) openBrackets += lBrackets.length(); String rBrackets = (String) advancedTable.getValueAt(row, INDEX_RIGHTBRACKET); @@ -1193,12 +1196,12 @@ public final class Find extends CDialog if ( MQuery.OPERATORS[MQuery.EQUAL_INDEX].equals(op) || MQuery.OPERATORS[MQuery.NOT_EQUAL_INDEX].equals(op) ) { - m_query.addRestriction(ColumnSQL, Operator, null, - infoName, null, and, openBrackets); + m_query.addRestriction(ColumnSQL.toString(), Operator, null, + infoName.toString(), null, and, openBrackets); if (code.length() > 0) code.append(SEGMENT_SEPARATOR); - code.append(ColumnName) + code.append(ColumnName.toString()) .append(FIELD_SEPARATOR) .append(Operator) .append(FIELD_SEPARATOR) @@ -1238,8 +1241,8 @@ public final class Find extends CDialog String infoDisplay_to = value2.toString(); if (parsedValue2 == null) continue; - m_query.addRangeRestriction(ColumnSQL, parsedValue, parsedValue2, - infoName, infoDisplay, infoDisplay_to, and, openBrackets); + m_query.addRangeRestriction(ColumnSQL.toString(), parsedValue, parsedValue2, + infoName.toString(), infoDisplay, infoDisplay_to, and, openBrackets); } else if (isProductCategoryField && MQuery.OPERATORS[MQuery.EQUAL_INDEX].equals(op)) { if (!(parsedValue instanceof Integer)) { @@ -1250,12 +1253,12 @@ public final class Find extends CDialog .addRestriction(getSubCategoryWhereClause(((Integer) parsedValue).intValue()), and, openBrackets); } else - m_query.addRestriction(ColumnSQL, Operator, parsedValue, - infoName, infoDisplay, and, openBrackets); + m_query.addRestriction(ColumnSQL.toString(), Operator, parsedValue, + infoName.toString(), infoDisplay, and, openBrackets); if (code.length() > 0) code.append(SEGMENT_SEPARATOR); - code.append(ColumnName) + code.append(ColumnName.toString()) .append(FIELD_SEPARATOR) .append(Operator) .append(FIELD_SEPARATOR) @@ -1273,17 +1276,17 @@ public final class Find extends CDialog } Object selected = fQueryName.getSelectedItem(); if (selected != null && saveQuery) { - String name = selected.toString(); - if (Util.isEmpty(name, true)) + StringBuilder name = new StringBuilder(selected.toString()); + if (Util.isEmpty(name.toString(), true)) { ADialog.warn(m_targetWindowNo, this, "FillMandatory", Msg.translate(Env.getCtx(), "Name")); return; } - MUserQuery uq = MUserQuery.get(Env.getCtx(), m_AD_Tab_ID, name); + MUserQuery uq = MUserQuery.get(Env.getCtx(), m_AD_Tab_ID, name.toString()); if (uq == null && code.length() > 0) { uq = new MUserQuery (Env.getCtx(), 0, null); - uq.setName (name); + uq.setName (name.toString()); uq.setAD_Tab_ID(m_AD_Tab_ID); //red1 UserQuery [ 1798539 ] taking in new field from Compiere uq.setAD_User_ID(Env.getAD_User_ID(Env.getCtx())); //red1 - [ 1798539 ] missing in Compiere delayed source :-) } @@ -1291,11 +1294,11 @@ public final class Find extends CDialog { if (uq.delete(true)) { - ADialog.info (m_targetWindowNo, this, "Deleted", name); + ADialog.info (m_targetWindowNo, this, "Deleted", name.toString()); refreshUserQueries(); } else - ADialog.warn (m_targetWindowNo, this, "DeleteError", name); + ADialog.warn (m_targetWindowNo, this, "DeleteError", name.toString()); return; } @@ -1304,11 +1307,11 @@ public final class Find extends CDialog // if (uq.save()) { - ADialog.info (m_targetWindowNo, this, "Saved", name); + ADialog.info (m_targetWindowNo, this, "Saved", name.toString()); refreshUserQueries(); } else - ADialog.warn (m_targetWindowNo, this, "SaveError", name); + ADialog.warn (m_targetWindowNo, this, "SaveError", name.toString()); } } // cmd_save @@ -1347,7 +1350,7 @@ public final class Find extends CDialog private String getSubCategoryWhereClause(int productCategoryId) { //if a node with this id is found later in the search we have a loop in the tree int subTreeRootParentId = 0; - String retString = " M_Product_Category_ID IN ("; + StringBuilder retString = new StringBuilder(" M_Product_Category_ID IN ("); String sql = " SELECT M_Product_Category_ID, M_Product_Category_Parent_ID FROM M_Product_Category"; final Vector categories = new Vector(100); Statement stmt = null; @@ -1361,20 +1364,20 @@ public final class Find extends CDialog } categories.add(new SimpleTreeNode(rs.getInt(1), rs.getInt(2))); } - retString += getSubCategoriesString(productCategoryId, categories, subTreeRootParentId); - retString += ") "; + retString.append(getSubCategoriesString(productCategoryId, categories, subTreeRootParentId)); + retString.append(") "); } catch (SQLException e) { log.log(Level.SEVERE, sql, e); - retString = ""; + retString = new StringBuilder(); } catch (AdempiereSystemError e) { log.log(Level.SEVERE, sql, e); - retString = ""; + retString = new StringBuilder(); } finally { DB.close(rs, stmt); rs = null; stmt = null; } - return retString; + return retString.toString(); } /** @@ -1386,7 +1389,7 @@ public final class Find extends CDialog * @throws AdempiereSystemError if a loop is detected */ private String getSubCategoriesString(int productCategoryId, Vector categories, int loopIndicatorId) throws AdempiereSystemError { - String ret = ""; + StringBuilder ret = new StringBuilder(); final Iterator iter = categories.iterator(); while (iter.hasNext()) { SimpleTreeNode node = (SimpleTreeNode) iter.next(); @@ -1394,11 +1397,11 @@ public final class Find extends CDialog if (node.getNodeId() == loopIndicatorId) { throw new AdempiereSystemError("The product category tree contains a loop on categoryId: " + loopIndicatorId); } - ret = ret + getSubCategoriesString(node.getNodeId(), categories, loopIndicatorId) + ","; + ret.append(getSubCategoriesString(node.getNodeId(), categories, loopIndicatorId)).append(","); } } - log.fine(ret); - return ret + productCategoryId; + log.fine(ret.toString()); + return ret.toString() + productCategoryId; } /** @@ -1469,7 +1472,8 @@ public final class Find extends CDialog } catch (Exception e) { - log.log(Level.SEVERE, in + "(" + in.getClass() + ")" + e); + StringBuilder msglog = new StringBuilder(in.toString()).append("(").append(in.getClass()).append(")").append(e); + log.log(Level.SEVERE, msglog.toString()); time = DisplayType.getDateFormat(dt).parse(in.toString()).getTime(); } return new Timestamp(time); @@ -1484,7 +1488,7 @@ public final class Find extends CDialog String error = ex.getLocalizedMessage(); if (error == null || error.length() == 0) error = ex.toString(); - StringBuffer errMsg = new StringBuffer(); + StringBuilder errMsg = new StringBuilder(); errMsg.append(field.getColumnName()).append(" = ").append(in).append(" - ").append(error); // ADialog.error(0, this, "ValidationError", errMsg.toString()); @@ -1502,7 +1506,8 @@ public final class Find extends CDialog */ private Object parseString(GridField field, String in) { - log.log(Level.FINE, "Parse: " +field + ":" + in); + StringBuilder msglog = new StringBuilder("Parse: ").append(field).append(":").append(in); + log.log(Level.FINE, msglog.toString()); if (in == null) return null; int dt = field.getDisplayType(); @@ -1531,7 +1536,8 @@ public final class Find extends CDialog } catch (Exception e) { - log.log(Level.SEVERE, in + "(" + in.getClass() + ")" + e); + msglog = new StringBuilder(in.toString()).append("(").append(in.getClass()).append(")").append(e); + log.log(Level.SEVERE,msglog.toString()); time = DisplayType.getDateFormat(dt).parse(in).getTime(); } return new Timestamp(time); @@ -1611,7 +1617,7 @@ public final class Find extends CDialog private int getNoOfRecords (MQuery query, boolean alertZeroRecords) { log.config("" + query); - StringBuffer sql = new StringBuffer("SELECT COUNT(*) FROM "); + StringBuilder sql = new StringBuilder("SELECT COUNT(*) FROM "); sql.append(m_tableName); boolean hasWhere = false; if (m_whereExtended != null && m_whereExtended.length() > 0) @@ -1677,8 +1683,8 @@ public final class Find extends CDialog */ private void setStatusDB (int currentCount) { - String text = " " + currentCount + " / " + m_total + " "; - statusBar.setStatusDB(text); + StringBuilder text = new StringBuilder(" ").append(currentCount).append(" / ").append(m_total).append(" "); + statusBar.setStatusDB(text.toString()); } // setDtatusDB diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WFileImport.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WFileImport.java index 1342abcd3e..e428ef961b 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WFileImport.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WFileImport.java @@ -31,7 +31,6 @@ import java.sql.SQLException; import java.util.ArrayList; import java.util.logging.Level; -import org.adempiere.webui.AdempiereWebUI; import org.adempiere.webui.component.Button; import org.adempiere.webui.component.ConfirmPanel; import org.adempiere.webui.component.Label; @@ -51,18 +50,17 @@ import org.compiere.util.Env; import org.compiere.util.Ini; import org.compiere.util.Msg; import org.zkoss.util.media.Media; -import org.zkoss.zk.ui.IdSpace; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; import org.zkoss.zk.ui.event.UploadEvent; import org.zkoss.zul.Borderlayout; import org.zkoss.zul.Center; -import org.zkoss.zul.North; -import org.zkoss.zul.South; import org.zkoss.zul.Div; import org.zkoss.zul.Hbox; +import org.zkoss.zul.North; import org.zkoss.zul.Separator; +import org.zkoss.zul.South; /** * Fixed length file import @@ -367,18 +365,18 @@ public class WFileImport extends ADForm implements EventListener // not safe see p108 Network pgm String s = null; - String concat = ""; + StringBuilder concat = new StringBuilder(); while ((s = in.readLine()) != null) { m_data.add(s); - concat += s; - concat += "\n"; + concat.append(s); + concat.append("\n"); if (m_data.size() < MAX_LOADED_LINES) { - rawData.setValue(concat); + rawData.setValue(concat.toString()); } } in.close(); @@ -399,12 +397,13 @@ public class WFileImport extends ADForm implements EventListener if (m_data.size() > 0) length = m_data.get(index).toString().length(); - info.setValue(Msg.getMsg(Env.getCtx(), "Records") + "=" + m_data.size() - + ", " + Msg.getMsg(Env.getCtx(), "Length") + "=" + length + " "); + StringBuilder msginfo = new StringBuilder(Msg.getMsg(Env.getCtx(), "Records")).append("=").append(m_data.size()).append(", ") + .append(Msg.getMsg(Env.getCtx(), "Length")).append("=").append(length).append(" "); + info.setValue(msginfo.toString()); //setCursor (Cursor.getDefaultCursor()); - - log.config("Records=" + m_data.size() + ", Length=" + length); + StringBuilder msglog = new StringBuilder("Records=").append(m_data.size()).append(", Length=").append(length); + log.config(msglog.toString()); } // cmd_loadFile /** diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/install/WTranslationDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/install/WTranslationDialog.java index 517d03a6e4..5dfeb22806 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/install/WTranslationDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/install/WTranslationDialog.java @@ -205,43 +205,43 @@ public class WTranslationDialog extends TranslationController implements IFormCo statusBar.setStatusLine(directory); Translation t = new Translation(Env.getCtx()); - String msg = t.validateLanguage(AD_Language.getValue()); + StringBuilder msg = new StringBuilder(t.validateLanguage(AD_Language.getValue())); if (msg.length() > 0) { - FDialog.error(m_WindowNo, form, "LanguageSetupError", msg); + FDialog.error(m_WindowNo, form, "LanguageSetupError", msg.toString()); return; } // All Tables if (AD_Table.getValue().equals("")) { - msg = ""; + msg = new StringBuilder(); for (int i = 1; i < cbTable.getItemCount(); i++) { AD_Table = (ValueNamePair)cbTable.getItemAtIndex(i).toValueNamePair(); // Carlos Ruiz - globalqss - improve output message from translation import process - msg += AD_Table.getValue() + " " + (imp - ? t.importTrl (directory, AD_Client_ID, AD_Language.getValue(), AD_Table.getValue()) - : t.exportTrl (directory, AD_Client_ID, AD_Language.getValue(), AD_Table.getValue())) + " "; + msg.append(AD_Table.getValue()).append(" ").append((imp + ? t.importTrl (directory, AD_Client_ID, AD_Language.getValue(), AD_Table.getValue()) + : t.exportTrl (directory, AD_Client_ID, AD_Language.getValue(), AD_Table.getValue()))).append(" "); } if(msg == null || msg.length() == 0) - msg = (imp ? "Import" : "Export") + " Successful. [" + directory + "]"; + msg = new StringBuilder((imp ? "Import" : "Export")).append(" Successful. [").append(directory).append("]"); - statusBar.setStatusLine(msg); + statusBar.setStatusLine(msg.toString()); } else // single table { msg = null; - msg = imp + msg = new StringBuilder(imp ? t.importTrl (directory, AD_Client_ID, AD_Language.getValue(), AD_Table.getValue()) - : t.exportTrl (directory, AD_Client_ID, AD_Language.getValue(), AD_Table.getValue()); + : t.exportTrl (directory, AD_Client_ID, AD_Language.getValue(), AD_Table.getValue())); if(msg == null || msg.length() == 0) - msg = (imp ? "Import" : "Export") + " Successful. [" + directory + "]"; + msg = new StringBuilder(imp ? "Import" : "Export").append(" Successful. [").append(directory).append("]"); - statusBar.setStatusLine(msg); + statusBar.setStatusLine(msg.toString()); } } // actionPerformed diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java index b7bac58731..e2b2ec0db4 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java @@ -892,17 +892,17 @@ public class FindWindow extends Window implements EventListener, ValueCha GridField field = m_findFields[c]; String columnName = field.getColumnName(); - String header = field.getHeader(); + StringBuilder header = new StringBuilder(field.getHeader()); if (header == null || header.length() == 0) { - header = Msg.translate(Env.getCtx(), columnName); + header = new StringBuilder(Msg.translate(Env.getCtx(), columnName)); if (header == null || header.length() == 0) continue; } if (field.isKey()) - header += (" (ID)"); - ValueNamePair pp = new ValueNamePair(columnName, header); + header.append((" (ID)")); + ValueNamePair pp = new ValueNamePair(columnName, header.toString()); items.add(pp); } ValueNamePair[] cols = new ValueNamePair[items.size()]; @@ -1248,7 +1248,8 @@ public class FindWindow extends Window implements EventListener, ValueCha } catch (Exception e) { - log.log(Level.SEVERE, in + "(" + in.getClass() + ")" + e); + StringBuilder msglog = new StringBuilder(in.toString()).append("(").append(in.getClass()).append(")").append(e); + log.log(Level.SEVERE, msglog.toString()); time = DisplayType.getDateFormat(dt).parse(in).getTime(); } @@ -1290,7 +1291,7 @@ public class FindWindow extends Window implements EventListener, ValueCha // m_query = new MQuery(m_tableName); m_query.addRestriction(Env.parseContext(Env.getCtx(), m_targetWindowNo, m_whereExtended, false)); - StringBuffer code = new StringBuffer(); + StringBuilder code = new StringBuilder(); int openBrackets = 0; @@ -1675,7 +1676,8 @@ public class FindWindow extends Window implements EventListener, ValueCha if (value != null && value.toString().length() > 0) { String ColumnName = wed.getColumnName(); - log.fine(ColumnName + "=" + value); + StringBuilder msglog = new StringBuilder(ColumnName).append("=").append(value); + log.fine(msglog.toString()); // globalqss - Carlos Ruiz - 20060711 // fix a bug with virtualColumn + isSelectionColumn not yielding results @@ -1686,25 +1688,25 @@ public class FindWindow extends Window implements EventListener, ValueCha } boolean isProductCategoryField = isProductCategoryField(field.getAD_Column_ID()); - String ColumnSQL = field.getColumnSQL(false); + StringBuilder ColumnSQL = new StringBuilder(field.getColumnSQL(false)); // // Be more permissive for String columns if (isSearchLike(field)) { - String valueStr = value.toString().toUpperCase(); - if (!valueStr.endsWith("%")) - valueStr += "%"; + StringBuilder valueStr = new StringBuilder(value.toString().toUpperCase()); + if (!valueStr.toString().endsWith("%")) + valueStr.append("%"); // - ColumnSQL = "UPPER("+ColumnSQL+")"; - value = valueStr; + ColumnSQL = new StringBuilder("UPPER(").append(ColumnSQL).append(")"); + value = valueStr.toString(); } // if (value.toString().indexOf('%') != -1) - m_query.addRestriction(ColumnSQL, MQuery.LIKE, value, ColumnName, wed.getDisplay()); + m_query.addRestriction(ColumnSQL.toString(), MQuery.LIKE, value, ColumnName, wed.getDisplay()); else if (isProductCategoryField && value instanceof Integer) m_query.addRestriction(getSubCategoryWhereClause(((Integer) value).intValue())); else - m_query.addRestriction(ColumnSQL, MQuery.EQUAL, value, ColumnName, wed.getDisplay()); + m_query.addRestriction(ColumnSQL.toString(), MQuery.EQUAL, value, ColumnName, wed.getDisplay()); /* if (value.toString().indexOf('%') != -1) @@ -1760,7 +1762,7 @@ public class FindWindow extends Window implements EventListener, ValueCha if (null!=selectedHistoryItem && selectedHistoryItem.toString().length() > 0 && getHistoryDays(selectedHistoryValue) > 0) { - StringBuffer where = new StringBuffer(); + StringBuilder where = new StringBuilder(); where.append("Created >= "); where.append("SysDate-").append(getHistoryDays(selectedHistoryValue)); m_query.addRestriction(where.toString()); @@ -1822,7 +1824,7 @@ public class FindWindow extends Window implements EventListener, ValueCha private int getNoOfRecords (MQuery query, boolean alertZeroRecords) { log.config("" + query); - StringBuffer sql = new StringBuffer("SELECT COUNT(*) FROM "); + StringBuilder sql = new StringBuilder("SELECT COUNT(*) FROM "); sql.append(m_tableName); boolean hasWhere = false; if (m_whereExtended != null && m_whereExtended.length() > 0) @@ -1902,7 +1904,7 @@ public class FindWindow extends Window implements EventListener, ValueCha private String getSubCategoryWhereClause(int productCategoryId) { //if a node with this id is found later in the search we have a loop in the tree int subTreeRootParentId = 0; - String retString = " M_Product_Category_ID IN ("; + StringBuilder retString = new StringBuilder(" M_Product_Category_ID IN ("); String sql = " SELECT M_Product_Category_ID, M_Product_Category_Parent_ID FROM M_Product_Category"; final Vector categories = new Vector(100); try { @@ -1914,18 +1916,18 @@ public class FindWindow extends Window implements EventListener, ValueCha } categories.add(new SimpleTreeNode(rs.getInt(1), rs.getInt(2))); } - retString += getSubCategoriesString(productCategoryId, categories, subTreeRootParentId); - retString += ") "; + retString.append(getSubCategoriesString(productCategoryId, categories, subTreeRootParentId)) + .append(") "); rs.close(); stmt.close(); } catch (SQLException e) { log.log(Level.SEVERE, sql, e); - retString = ""; + retString = new StringBuilder(); } catch (AdempiereSystemError e) { log.log(Level.SEVERE, sql, e); - retString = ""; + retString = new StringBuilder(); } - return retString; + return retString.toString(); } // getSubCategoryWhereClause @@ -1938,7 +1940,7 @@ public class FindWindow extends Window implements EventListener, ValueCha * @throws AdempiereSystemError if a loop is detected **/ private String getSubCategoriesString(int productCategoryId, Vector categories, int loopIndicatorId) throws AdempiereSystemError { - String ret = ""; + StringBuilder ret = new StringBuilder(); final Iterator iter = categories.iterator(); while (iter.hasNext()) { SimpleTreeNode node = (SimpleTreeNode) iter.next(); @@ -1946,11 +1948,11 @@ public class FindWindow extends Window implements EventListener, ValueCha if (node.getNodeId() == loopIndicatorId) { throw new AdempiereSystemError("The product category tree contains a loop on categoryId: " + loopIndicatorId); } - ret = ret + getSubCategoriesString(node.getNodeId(), categories, loopIndicatorId) + ","; + ret.append(getSubCategoriesString(node.getNodeId(), categories, loopIndicatorId)).append(","); } } - log.fine(ret); - return ret + productCategoryId; + log.fine(ret.toString()); + return ret.toString() + productCategoryId; } // getSubCategoriesString @@ -2021,7 +2023,8 @@ public class FindWindow extends Window implements EventListener, ValueCha } catch (Exception e) { - log.log(Level.SEVERE, in + "(" + in.getClass() + ")" + e); + StringBuilder msglog = new StringBuilder(in.toString()).append("(").append(in.getClass()).append(")").append(e); + log.log(Level.SEVERE, msglog.toString()); time = DisplayType.getDateFormat(dt).parse(in.toString()).getTime(); } return new Timestamp(time); @@ -2036,7 +2039,7 @@ public class FindWindow extends Window implements EventListener, ValueCha String error = ex.getLocalizedMessage(); if (error == null || error.length() == 0) error = ex.toString(); - StringBuffer errMsg = new StringBuffer(); + StringBuilder errMsg = new StringBuilder(); errMsg.append(field.getColumnName()).append(" = ").append(in).append(" - ").append(error); // FDialog.error(0, this, "ValidationError", errMsg.toString()); diff --git a/org.compiere.db.oracle.provider/src/org/compiere/db/DB_Oracle.java b/org.compiere.db.oracle.provider/src/org/compiere/db/DB_Oracle.java index 7f90634411..49dffd9315 100644 --- a/org.compiere.db.oracle.provider/src/org/compiere/db/DB_Oracle.java +++ b/org.compiere.db.oracle.provider/src/org/compiere/db/DB_Oracle.java @@ -194,17 +194,17 @@ public class DB_Oracle implements AdempiereDatabase */ public String getConnectionURL (CConnection connection) { - StringBuffer sb = null; + StringBuilder sb = null; // Server Connections (bequeath) if (connection.isBequeath()) { - sb = new StringBuffer ("jdbc:oracle:oci8:@"); + sb = new StringBuilder("jdbc:oracle:oci8:@"); // bug: does not work if there is more than one db instance - use Net8 // sb.append(connection.getDbName()); } else // thin driver { - sb = new StringBuffer ("jdbc:oracle:thin:@"); + sb = new StringBuilder("jdbc:oracle:thin:@"); // direct connection if (connection.isViaFirewall()) { @@ -305,11 +305,11 @@ public class DB_Oracle implements AdempiereDatabase */ public String toString() { - StringBuffer sb = new StringBuffer("DB_Oracle["); + StringBuilder sb = new StringBuilder("DB_Oracle["); sb.append(m_connectionURL); try { - StringBuffer logBuffer = new StringBuffer(50); + StringBuilder logBuffer = new StringBuilder(50); logBuffer.append("# Connections: ").append(m_ds.getNumConnections()); logBuffer.append(" , # Busy Connections: ").append(m_ds.getNumBusyConnections()); logBuffer.append(" , # Idle Connections: ").append(m_ds.getNumIdleConnections()); @@ -334,7 +334,7 @@ public class DB_Oracle implements AdempiereDatabase return null; } - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); try { sb.append("# Connections: ").append(m_ds.getNumConnections()); @@ -431,7 +431,7 @@ public class DB_Oracle implements AdempiereDatabase return "SysDate"; } - StringBuffer dateString = new StringBuffer("TO_DATE('"); + StringBuilder dateString = new StringBuilder("TO_DATE('"); // YYYY-MM-DD HH24:MI:SS.mmmm JDBC Timestamp format String myDate = time.toString(); if (dayOnly) @@ -462,7 +462,7 @@ public class DB_Oracle implements AdempiereDatabase * */ public String TO_CHAR (String columnName, int displayType, String AD_Language) { - StringBuffer retValue = new StringBuffer("TRIM(TO_CHAR("); + StringBuilder retValue = new StringBuilder("TRIM(TO_CHAR("); retValue.append(columnName); // Numbers @@ -699,9 +699,10 @@ public class DB_Oracle implements AdempiereDatabase + getConnectionURL(connection) + " - UserID=" + connection.getDbUid()); */ - System.err.println("Cannot connect to database: " - + getConnectionURL(connection) - + " - UserID=" + connection.getDbUid()); + StringBuilder msgerr = new StringBuilder("Cannot connect to database: ") + .append(getConnectionURL(connection)) + .append(" - UserID=").append(connection.getDbUid()); + System.err.println(msgerr.toString()); } } @@ -987,22 +988,22 @@ public class DB_Oracle implements AdempiereDatabase try { String myString1 = "123456789 12345678"; - String myString = ""; + StringBuilder myString = new StringBuilder(); for (int i = 0; i < 99; i++) - myString += myString1 + (char)('a'+i) + "\n"; + myString.append(myString1).append((char)('a'+i)).append("\n"); System.out.println(myString.length()); - System.out.println(Util.size(myString)); + System.out.println(Util.size(myString.toString())); // - myString = Util.trimSize(myString, 2000); + myString = new StringBuilder(Util.trimSize(myString.toString(), 2000)); System.out.println(myString.length()); - System.out.println(Util.size(myString)); + System.out.println(Util.size(myString.toString())); // Connection conn2 = db.getCachedConnection(cc, true, Connection.TRANSACTION_READ_COMMITTED); /** **/ PreparedStatement pstmt = conn2.prepareStatement ("INSERT INTO X_Test(Text1, Text2) values(?,?)"); - pstmt.setString(1, myString); // NVARCHAR2 column - pstmt.setString(2, myString); // VARCHAR2 column + pstmt.setString(1, myString.toString()); // NVARCHAR2 column + pstmt.setString(2, myString.toString()); // VARCHAR2 column System.out.println(pstmt.executeUpdate()); /** **/ Statement stmt = conn2.createStatement(); @@ -1158,12 +1159,12 @@ public class DB_Oracle implements AdempiereDatabase public boolean createSequence(String name , int increment , int minvalue , int maxvalue ,int start , String trxName) { int no = DB.executeUpdate("DROP SEQUENCE "+name.toUpperCase(), trxName); - no = DB.executeUpdateEx("CREATE SEQUENCE "+name.toUpperCase() - + " MINVALUE " + minvalue - + " MAXVALUE " + maxvalue - + " START WITH " + start - + " INCREMENT BY " + increment +" CACHE 20", trxName) - ; + StringBuilder msgDB = new StringBuilder("CREATE SEQUENCE ").append(name.toUpperCase()) + .append(" MINVALUE ").append(minvalue) + .append(" MAXVALUE ").append(maxvalue) + .append(" START WITH ").append(start) + .append(" INCREMENT BY ").append(increment).append(" CACHE 20"); + no = DB.executeUpdateEx(msgDB.toString(), trxName); if(no == -1 ) return false; else @@ -1223,7 +1224,7 @@ public class DB_Oracle implements AdempiereDatabase String[] keyColumns = po.get_KeyColumns(); if (keyColumns != null && keyColumns.length > 0 && !po.is_new()) { - StringBuffer sqlBuffer = new StringBuffer(" SELECT "); + StringBuilder sqlBuffer = new StringBuilder(" SELECT "); sqlBuffer.append(keyColumns[0]) .append(" FROM ") .append(po.get_TableName()) From 502bd015c1f827d7b78cc5c6d07df07038638fc8 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 21 Sep 2012 19:27:59 -0500 Subject: [PATCH 05/79] =?UTF-8?q?IDEMPIERE-308=20Performance:=20Replace=20?= =?UTF-8?q?use=20of=20StringBuffer=20and=20String=20concatenation=20with?= =?UTF-8?q?=20StringBuilder=20/=20review=20classes=20on=20org.adempiere.ba?= =?UTF-8?q?se.process=20/=20thanks=20to=20Richard=20Morales=20and=20David?= =?UTF-8?q?=20Pe=C3=B1uela?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adempiere/process/ASPGenerateFields.java | 6 +- .../adempiere/process/ASPGenerateLevel.java | 8 +- .../process/ApplyMigrationScripts.java | 27 +-- .../process/ClientAcctProcessor.java | 15 +- .../process/ExpenseTypesFromAccounts.java | 6 +- .../src/org/adempiere/process/Export.java | 12 +- .../org/adempiere/process/HouseKeeping.java | 22 +-- .../process/ImmediateBankTransfer.java | 22 ++- .../adempiere/process/ImportPriceList.java | 178 +++++++++--------- .../adempiere/process/InOutGenerateRMA.java | 8 +- .../adempiere/process/InitialClientSetup.java | 41 ++-- .../adempiere/process/InvoiceGenerateRMA.java | 17 +- .../process/PrepareMigrationScripts.java | 30 +-- .../org/adempiere/process/UpdateRoleMenu.java | 4 +- 14 files changed, 210 insertions(+), 186 deletions(-) diff --git a/org.adempiere.base.process/src/org/adempiere/process/ASPGenerateFields.java b/org.adempiere.base.process/src/org/adempiere/process/ASPGenerateFields.java index 57c5ffeedb..3e0453de57 100644 --- a/org.adempiere.base.process/src/org/adempiere/process/ASPGenerateFields.java +++ b/org.adempiere.base.process/src/org/adempiere/process/ASPGenerateFields.java @@ -89,9 +89,9 @@ public class ASPGenerateFields extends SvrProcess */ protected String doIt () throws Exception { - log.info("ASP_Status=" + p_ASP_Status - + ", ASP_Tab_ID=" + p_ASP_Tab_ID - ); + StringBuilder msglog = new StringBuilder("ASP_Status=").append(p_ASP_Status) + .append(", ASP_Tab_ID=").append(p_ASP_Tab_ID); + log.info(msglog.toString()); X_ASP_Tab asptab = new X_ASP_Tab(getCtx(), p_ASP_Tab_ID, get_TrxName()); p_ASP_Level_ID = asptab.getASP_Window().getASP_Level_ID(); diff --git a/org.adempiere.base.process/src/org/adempiere/process/ASPGenerateLevel.java b/org.adempiere.base.process/src/org/adempiere/process/ASPGenerateLevel.java index 4f408b6c70..deb77fce45 100644 --- a/org.adempiere.base.process/src/org/adempiere/process/ASPGenerateLevel.java +++ b/org.adempiere.base.process/src/org/adempiere/process/ASPGenerateLevel.java @@ -107,10 +107,10 @@ public class ASPGenerateLevel extends SvrProcess */ protected String doIt () throws Exception { - log.info("ASP_Status=" + p_ASP_Status - + ", AD_Menu_ID=" + p_AD_Menu_ID - + ", IsGenerateFields=" + p_IsGenerateFields - ); + StringBuilder msglog = new StringBuilder("ASP_Status=").append(p_ASP_Status) + .append(", AD_Menu_ID=").append(p_AD_Menu_ID) + .append(", IsGenerateFields=").append(p_IsGenerateFields); + log.info(msglog.toString()); MClientInfo clientInfo = MClientInfo.get(getCtx(), getAD_Client_ID(), get_TrxName()); int AD_Tree_ID = clientInfo.getAD_Tree_Menu_ID(); diff --git a/org.adempiere.base.process/src/org/adempiere/process/ApplyMigrationScripts.java b/org.adempiere.base.process/src/org/adempiere/process/ApplyMigrationScripts.java index 09b53dcfd2..0c2debd39f 100644 --- a/org.adempiere.base.process/src/org/adempiere/process/ApplyMigrationScripts.java +++ b/org.adempiere.base.process/src/org/adempiere/process/ApplyMigrationScripts.java @@ -51,16 +51,16 @@ public class ApplyMigrationScripts extends SvrProcess { protected String doIt() throws Exception { // TODO Auto-generated method stub log.info("Applying migrations scripts"); - String sql = "select ad_migrationscript_id, script, name from ad_migrationscript where isApply = 'Y' and status = 'IP' order by name, created"; - PreparedStatement pstmt = DB.prepareStatement(sql, this.get_TrxName()); + StringBuilder sql = new StringBuilder() + .append("select ad_migrationscript_id, script, name from ad_migrationscript where isApply = 'Y' and status = 'IP' order by name, created"); + PreparedStatement pstmt = DB.prepareStatement(sql.toString(), this.get_TrxName()); ResultSet rs = pstmt.executeQuery(); while (rs.next()) { byte[] scriptArray = rs.getBytes(2); int seqID = rs.getInt(1); boolean execOk = true; try { - StringBuffer tmpSql = new StringBuffer(); - tmpSql = new StringBuffer(new String(scriptArray)); + StringBuilder tmpSql = new StringBuilder(new String(scriptArray)); if (tmpSql.length() > 0) { log.info("Executing script " + rs.getString(3)); @@ -70,12 +70,12 @@ public class ApplyMigrationScripts extends SvrProcess { } catch (SQLException e) { execOk = false; e.printStackTrace(); - log.saveError("Error", "Script: " + rs.getString(3) + " - " - + e.getMessage()); + StringBuilder msglog = new StringBuilder("Script: ").append(rs.getString(3)).append(" - ").append(e.getMessage()); + log.saveError("Error", msglog.toString()); log.severe(e.getMessage()); } finally { - sql = "UPDATE ad_migrationscript SET status = ? , isApply = 'N' WHERE ad_migrationscript_id = ? "; - pstmt = DB.prepareStatement(sql, this.get_TrxName()); + sql = new StringBuilder("UPDATE ad_migrationscript SET status = ? , isApply = 'N' WHERE ad_migrationscript_id = ? "); + pstmt = DB.prepareStatement(sql.toString(), this.get_TrxName()); if (execOk) { pstmt.setString(1, "CO"); pstmt.setInt(2, seqID); @@ -91,8 +91,8 @@ public class ApplyMigrationScripts extends SvrProcess { } } catch (SQLException e) { e.printStackTrace(); - log.saveError("Error", "Script: " + rs.getString(3) + " - " - + e.getMessage()); + StringBuilder msglog = new StringBuilder("Script: ").append(rs.getString(3)).append(" - ").append(e.getMessage()); + log.saveError("Error", msglog.toString()); log.severe(e.getMessage()); } } @@ -110,7 +110,7 @@ public class ApplyMigrationScripts extends SvrProcess { public boolean executeScript(String sql, String fileName) { BufferedReader reader = new BufferedReader(new StringReader(sql)); - StringBuffer sqlBuf = new StringBuffer(); + StringBuilder sqlBuf = new StringBuilder(); String line; boolean statementReady = false; boolean execOk = true; @@ -151,8 +151,9 @@ public class ApplyMigrationScripts extends SvrProcess { } catch (SQLException e) { e.printStackTrace(); execOk = false; - log.saveError("Error", "Script: " + fileName + " - " - + e.getMessage() + ". The line that caused the error is the following ==> " + sqlBuf); + StringBuilder msglog = new StringBuilder("Script: ").append(fileName).append(" - ") + .append(e.getMessage()).append(". The line that caused the error is the following ==> ").append(sqlBuf); + log.saveError("Error", msglog.toString()); log.severe(e.getMessage()); } finally { stmt.close(); diff --git a/org.adempiere.base.process/src/org/adempiere/process/ClientAcctProcessor.java b/org.adempiere.base.process/src/org/adempiere/process/ClientAcctProcessor.java index 32e6501279..7fac5486a6 100644 --- a/org.adempiere.base.process/src/org/adempiere/process/ClientAcctProcessor.java +++ b/org.adempiere.base.process/src/org/adempiere/process/ClientAcctProcessor.java @@ -96,7 +96,8 @@ public class ClientAcctProcessor extends SvrProcess */ protected String doIt () throws Exception { - log.info("C_AcctSchema_ID=" + p_C_AcctSchema_ID + ", AD_Table_ID=" + p_AD_Table_ID); + StringBuilder msglog = new StringBuilder("C_AcctSchema_ID=").append(p_C_AcctSchema_ID).append(", AD_Table_ID=").append(p_AD_Table_ID); + log.info(msglog.toString()); if (! MClient.isClientAccounting()) throw new AdempiereUserError(Msg.getMsg(getCtx(), "ClientAccountingNotEnabled")); @@ -145,7 +146,7 @@ public class ClientAcctProcessor extends SvrProcess && p_AD_Table_ID != AD_Table_ID) continue; - StringBuffer sql = new StringBuffer ("SELECT DISTINCT ProcessedOn FROM ").append(TableName) + StringBuilder sql = new StringBuilder("SELECT DISTINCT ProcessedOn FROM ").append(TableName) .append(" WHERE AD_Client_ID=? AND ProcessedOn 0) m_summary.append("(Errors=").append(countError[i]).append(")"); m_summary.append(" - "); - log.finer(getName() + ": " + m_summary.toString()); + StringBuilder msglog = new StringBuilder(getName()).append(": ").append(m_summary.toString()); + log.finer(msglog.toString()); } else - log.finer(getName() + ": " + TableName + " - no work"); + { + StringBuilder msglog = new StringBuilder(getName()).append(": ").append(TableName).append(" - no work"); + log.finer(msglog.toString()); + } } } // postSession diff --git a/org.adempiere.base.process/src/org/adempiere/process/ExpenseTypesFromAccounts.java b/org.adempiere.base.process/src/org/adempiere/process/ExpenseTypesFromAccounts.java index 8036029d88..efd6182c00 100644 --- a/org.adempiere.base.process/src/org/adempiere/process/ExpenseTypesFromAccounts.java +++ b/org.adempiere.base.process/src/org/adempiere/process/ExpenseTypesFromAccounts.java @@ -224,9 +224,9 @@ public class ExpenseTypesFromAccounts extends SvrProcess { } } - String returnStr = addCount + " products added."; - if (skipCount>0) returnStr += " " + skipCount + " products skipped."; - return(returnStr); + StringBuilder returnStr = new StringBuilder(addCount).append(" products added."); + if (skipCount>0) returnStr.append(" ").append(skipCount).append(" products skipped."); + return(returnStr.toString()); } diff --git a/org.adempiere.base.process/src/org/adempiere/process/Export.java b/org.adempiere.base.process/src/org/adempiere/process/Export.java index 232ff8cd5d..4695cf27de 100644 --- a/org.adempiere.base.process/src/org/adempiere/process/Export.java +++ b/org.adempiere.base.process/src/org/adempiere/process/Export.java @@ -102,7 +102,7 @@ public class Export extends SvrProcess AD_Table_ID = getTable_ID(); // C_Invoice; AD_Table_ID = 318 - StringBuffer sb = new StringBuffer ("AD_Table_ID=").append(AD_Table_ID); + StringBuilder sb = new StringBuilder("AD_Table_ID=").append(AD_Table_ID); sb.append("; Record_ID=").append(getRecord_ID()); // Parameter ProcessInfoParameter[] para = getParameter(); @@ -154,7 +154,7 @@ public class Export extends SvrProcess } MEXPFormat exportFormat = new MEXPFormat(getCtx(), EXP_Format_ID, get_TrxName()); - StringBuffer sql = new StringBuffer("SELECT * ") + StringBuilder sql = new StringBuilder("SELECT * ") .append("FROM ").append(table.getTableName()).append(" ") .append("WHERE ").append(po.get_KeyColumns()[0]).append("=?") ; @@ -270,7 +270,8 @@ public class Export extends SvrProcess } } }*/ - log.info("EXP Field - column=["+column.getColumnName()+"]; value=" + value); + StringBuilder msglog = new StringBuilder("EXP Field - column=[").append(column.getColumnName()).append("]; value=").append(value); + log.info(msglog.toString()); if (valueString != null && !"".equals(valueString) && !"null".equals(valueString)) { Text newText = outDocument.createTextNode(valueString); newElement.appendChild(newText); @@ -331,7 +332,8 @@ public class Export extends SvrProcess } } }*/ - log.info("EXP Field - column=["+column.getColumnName()+"]; value=" + value); + StringBuilder msglog = new StringBuilder("EXP Field - column=[").append(column.getColumnName()).append("]; value=").append(value); + log.info(msglog.toString()); if (valueString != null && !"".equals(valueString) && !"null".equals(valueString)) { rootElement.setAttribute(formatLine.getValue(), valueString); elementHasValue = true; @@ -348,7 +350,7 @@ public class Export extends SvrProcess MTable tableEmbedded = MTable.get(getCtx(), embeddedFormat.getAD_Table_ID()); log.info("Table Embedded = " + tableEmbedded); - StringBuffer sql = new StringBuffer("SELECT * ") + StringBuilder sql = new StringBuilder("SELECT * ") .append("FROM ").append(tableEmbedded.getTableName()).append(" ") .append("WHERE ").append(masterPO.get_KeyColumns()[0]).append("=?") //+ "WHERE " + po.get_WhereClause(false) diff --git a/org.adempiere.base.process/src/org/adempiere/process/HouseKeeping.java b/org.adempiere.base.process/src/org/adempiere/process/HouseKeeping.java index 5771049235..3f2ca7bfd1 100644 --- a/org.adempiere.base.process/src/org/adempiere/process/HouseKeeping.java +++ b/org.adempiere.base.process/src/org/adempiere/process/HouseKeeping.java @@ -83,10 +83,10 @@ public class HouseKeeping extends SvrProcess{ int nodel = 0; if (houseKeeping.isSaveInHistoric()){ - String sql = "INSERT INTO hst_"+tableName + " SELECT * FROM " + tableName; + StringBuilder sql = new StringBuilder("INSERT INTO hst_").append(tableName).append(" SELECT * FROM ").append(tableName); if (whereClause != null && whereClause.length() > 0) - sql = sql + " WHERE " + whereClause; - noins = DB.executeUpdate(sql, get_TrxName()); + sql.append(" WHERE ").append(whereClause); + noins = DB.executeUpdate(sql.toString(), get_TrxName()); if (noins == -1) throw new AdempiereSystemError("Cannot insert into hst_"+tableName); addLog("@Inserted@ " + noins); @@ -98,15 +98,15 @@ public class HouseKeeping extends SvrProcess{ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); String dateString = dateFormat.format(date); FileWriter file = new FileWriter(pathFile+File.separator+tableName+dateString+".xml"); - String sql = "SELECT * FROM " + tableName; + StringBuilder sql = new StringBuilder("SELECT * FROM ").append(tableName); if (whereClause != null && whereClause.length() > 0) - sql = sql + " WHERE " + whereClause; + sql.append(" WHERE ").append(whereClause); PreparedStatement pstmt = null; ResultSet rs = null; StringBuffer linexml = null; try { - pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt = DB.prepareStatement(sql.toString(), get_TrxName()); rs = pstmt.executeQuery(); while (rs.next()) { GenericPO po = new GenericPO(tableName, getCtx(), rs, get_TrxName()); @@ -130,10 +130,10 @@ public class HouseKeeping extends SvrProcess{ addLog("@Exported@ " + noexp); }//XmlExport - String sql = "DELETE FROM " + tableName; + StringBuilder sql = new StringBuilder("DELETE FROM ").append(tableName); if (whereClause != null && whereClause.length() > 0) - sql = sql + " WHERE " + whereClause; - nodel = DB.executeUpdate(sql, get_TrxName()); + sql.append(" WHERE ").append(whereClause); + nodel = DB.executeUpdate(sql.toString(), get_TrxName()); if (nodel == -1) throw new AdempiereSystemError("Cannot delete from " + tableName); Timestamp time = new Timestamp(date.getTime()); @@ -141,7 +141,7 @@ public class HouseKeeping extends SvrProcess{ houseKeeping.setLastDeleted(nodel); houseKeeping.saveEx(); addLog("@Deleted@ " + nodel); - String msg = Msg.getElement(getCtx(), tableName + "_ID") + " #" + nodel; - return msg; + StringBuilder msg = new StringBuilder(Msg.getElement(getCtx(), tableName + "_ID")).append(" #").append(nodel); + return msg.toString(); }//doIt } diff --git a/org.adempiere.base.process/src/org/adempiere/process/ImmediateBankTransfer.java b/org.adempiere.base.process/src/org/adempiere/process/ImmediateBankTransfer.java index 52ef194a4a..6000dc6a42 100644 --- a/org.adempiere.base.process/src/org/adempiere/process/ImmediateBankTransfer.java +++ b/org.adempiere.base.process/src/org/adempiere/process/ImmediateBankTransfer.java @@ -114,10 +114,11 @@ public class ImmediateBankTransfer extends SvrProcess */ protected String doIt() throws Exception { - log.info("From Bank="+p_From_C_BankAccount_ID+" - To Bank="+p_To_C_BankAccount_ID - + " - C_CashBook_ID="+p_C_CashBook_ID+" - Amount="+p_Amount+" - Name="+p_Name - + " - Description="+p_Description+ " - Statement Date="+p_StatementDate+ - " - Date Account="+p_DateAcct); + StringBuilder msglog = new StringBuilder("From Bank=").append(p_From_C_BankAccount_ID).append(" - To Bank=").append(p_To_C_BankAccount_ID) + .append(" - C_CashBook_ID=").append(p_C_CashBook_ID).append(" - Amount=").append(p_Amount).append(" - Name=").append(p_Name) + .append(" - Description=").append(p_Description).append(" - Statement Date=").append(p_StatementDate) + .append(" - Date Account=").append(p_DateAcct); + log.info(msglog.toString()); if (p_To_C_BankAccount_ID == 0 || p_From_C_BankAccount_ID == 0) throw new IllegalArgumentException("Banks required"); @@ -248,17 +249,18 @@ public class ImmediateBankTransfer extends SvrProcess MCash cash = createCash(); MCashLine cashLines[]= createCashLines(cash); - StringBuffer processMsg = new StringBuffer(cash.getDocumentNo()); + StringBuilder processMsg = new StringBuilder(cash.getDocumentNo()); cash.setDocAction(p_docAction); if (!cash.processIt(p_docAction)) { processMsg.append(" (NOT Processed)"); - log.warning("Cash Processing failed: " + cash + " - " + cash.getProcessMsg()); - addLog(cash.getC_Cash_ID(), cash.getStatementDate(), null, - "Cash Processing failed: " + cash + " - " - + cash.getProcessMsg() - + " / please complete it manually"); + StringBuilder msglog = new StringBuilder("Cash Processing failed: ").append(cash).append(" - ").append(cash.getProcessMsg()); + log.warning(msglog.toString()); + msglog = new StringBuilder("Cash Processing failed: ").append(cash).append(" - ") + .append(cash.getProcessMsg()) + .append(" / please complete it manually"); + addLog(cash.getC_Cash_ID(), cash.getStatementDate(), null,msglog.toString()); throw new IllegalStateException("Cash Processing failed: " + cash + " - " + cash.getProcessMsg()); } if (!cash.save()) diff --git a/org.adempiere.base.process/src/org/adempiere/process/ImportPriceList.java b/org.adempiere.base.process/src/org/adempiere/process/ImportPriceList.java index 1f936430bf..7b21482a91 100755 --- a/org.adempiere.base.process/src/org/adempiere/process/ImportPriceList.java +++ b/org.adempiere.base.process/src/org/adempiere/process/ImportPriceList.java @@ -88,9 +88,9 @@ public class ImportPriceList extends SvrProcess */ protected String doIt() throws Exception { - StringBuffer sql = null; + StringBuilder sql = null; int no = 0; - String clientCheck = " AND AD_Client_ID=" + m_AD_Client_ID; + StringBuilder clientCheck = new StringBuilder(" AND AD_Client_ID=").append(m_AD_Client_ID); int m_discountschema_id = DB.getSQLValue(get_TrxName(), "SELECT MIN(M_DiscountSchema_ID) FROM M_DiscountSchema WHERE DiscountType='P' AND IsActive='Y' AND AD_Client_ID=?", @@ -103,81 +103,81 @@ public class ImportPriceList extends SvrProcess // Delete Old Imported if (m_deleteOldImported) { - sql = new StringBuffer ("DELETE I_PriceList " + sql = new StringBuilder("DELETE I_PriceList " + "WHERE I_IsImported='Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.info("Delete Old Impored =" + no); } // Set Client, Org, IsActive, Created/Updated, EnforcePriceLimit, IsSOPriceList, IsTaxIncluded, PricePrecision - sql = new StringBuffer ("UPDATE I_PriceList " - + "SET AD_Client_ID = COALESCE (AD_Client_ID, ").append(m_AD_Client_ID).append(")," - + " AD_Org_ID = COALESCE (AD_Org_ID, 0)," - + " IsActive = COALESCE (IsActive, 'Y')," - + " Created = COALESCE (Created, SysDate)," - + " CreatedBy = COALESCE (CreatedBy, 0)," - + " Updated = COALESCE (Updated, SysDate)," - + " UpdatedBy = COALESCE (UpdatedBy, 0)," - + " EnforcePriceLimit = COALESCE (EnforcePriceLimit, 'N')," - + " IsSOPriceList = COALESCE (IsSOPriceList, 'N')," - + " IsTaxIncluded = COALESCE (IsTaxIncluded, 'N')," - + " PricePrecision = COALESCE (PricePrecision, 2)," - + " I_ErrorMsg = ' '," - + " I_IsImported = 'N' " - + "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); + sql = new StringBuilder("UPDATE I_PriceList ") + .append("SET AD_Client_ID = COALESCE (AD_Client_ID, ").append(m_AD_Client_ID).append("),") + .append(" AD_Org_ID = COALESCE (AD_Org_ID, 0),") + .append(" IsActive = COALESCE (IsActive, 'Y'),") + .append(" Created = COALESCE (Created, SysDate),") + .append(" CreatedBy = COALESCE (CreatedBy, 0),") + .append(" Updated = COALESCE (Updated, SysDate),") + .append(" UpdatedBy = COALESCE (UpdatedBy, 0),") + .append(" EnforcePriceLimit = COALESCE (EnforcePriceLimit, 'N'),") + .append(" IsSOPriceList = COALESCE (IsSOPriceList, 'N'),") + .append(" IsTaxIncluded = COALESCE (IsTaxIncluded, 'N'),") + .append(" PricePrecision = COALESCE (PricePrecision, 2),") + .append(" I_ErrorMsg = ' ',") + .append(" I_IsImported = 'N' ") + .append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.info("Reset=" + no); // Set Optional BPartner - sql = new StringBuffer ("UPDATE I_PriceList " - + "SET C_BPartner_ID=(SELECT C_BPartner_ID FROM C_BPartner p" - + " WHERE I_PriceList.BPartner_Value=p.Value AND I_PriceList.AD_Client_ID=p.AD_Client_ID) " - + "WHERE C_BPartner_ID IS NULL AND BPartner_Value IS NOT NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_PriceList ") + .append("SET C_BPartner_ID=(SELECT C_BPartner_ID FROM C_BPartner p") + .append(" WHERE I_PriceList.BPartner_Value=p.Value AND I_PriceList.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE C_BPartner_ID IS NULL AND BPartner_Value IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.info("BPartner=" + no); // - sql = new StringBuffer ("UPDATE I_PriceList " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid BPartner,' " - + "WHERE C_BPartner_ID IS NULL AND BPartner_Value IS NOT NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_PriceList ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid BPartner,' ") + .append("WHERE C_BPartner_ID IS NULL AND BPartner_Value IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning("Invalid BPartner=" + no); // Product - sql = new StringBuffer ("UPDATE I_PriceList " - + "SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p" - + " WHERE I_PriceList.ProductValue=p.Value AND I_PriceList.AD_Client_ID=p.AD_Client_ID) " - + "WHERE M_Product_ID IS NULL AND ProductValue IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder("UPDATE I_PriceList ") + .append("SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p") + .append(" WHERE I_PriceList.ProductValue=p.Value AND I_PriceList.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE M_Product_ID IS NULL AND ProductValue IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Product from Value=" + no); - sql = new StringBuffer ("UPDATE I_PriceList " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Product, ' " - + "WHERE M_Product_ID IS NULL AND (ProductValue IS NOT NULL)" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_PriceList ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Product, ' ") + .append("WHERE M_Product_ID IS NULL AND (ProductValue IS NOT NULL)") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Product=" + no); // **** Find Price List // Name - sql = new StringBuffer ("UPDATE I_PriceList " - + "SET M_PriceList_ID=(SELECT M_PriceList_ID FROM M_PriceList p" - + " WHERE I_PriceList.Name=p.Name AND I_PriceList.AD_Client_ID=p.AD_Client_ID) " - + "WHERE M_PriceList_ID IS NULL" - + " AND I_IsImported='N'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_PriceList ") + .append("SET M_PriceList_ID=(SELECT M_PriceList_ID FROM M_PriceList p") + .append(" WHERE I_PriceList.Name=p.Name AND I_PriceList.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE M_PriceList_ID IS NULL") + .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.info("Price List Existing Value=" + no); // **** Find Price List Version // List Name (ID) + ValidFrom - sql = new StringBuffer ("UPDATE I_PriceList " - + "SET M_PriceList_Version_ID=(SELECT M_PriceList_Version_ID FROM M_PriceList_Version p" - + " WHERE I_PriceList.ValidFrom=p.ValidFrom AND I_PriceList.M_PriceList_ID=p.M_PriceList_ID) " - + "WHERE M_PriceList_ID IS NOT NULL AND M_PriceList_Version_ID IS NULL" - + " AND I_IsImported='N'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_PriceList ") + .append("SET M_PriceList_Version_ID=(SELECT M_PriceList_Version_ID FROM M_PriceList_Version p") + .append(" WHERE I_PriceList.ValidFrom=p.ValidFrom AND I_PriceList.M_PriceList_ID=p.M_PriceList_ID) ") + .append("WHERE M_PriceList_ID IS NOT NULL AND M_PriceList_Version_ID IS NULL") + .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.info("Price List Version Existing Value=" + no); @@ -208,55 +208,55 @@ public class ImportPriceList extends SvrProcess */ // Set Currency - sql = new StringBuffer ("UPDATE I_PriceList " - + "SET ISO_Code=(SELECT ISO_Code FROM C_Currency c" - + " INNER JOIN C_AcctSchema a ON (a.C_Currency_ID=c.C_Currency_ID)" - + " INNER JOIN AD_ClientInfo ci ON (a.C_AcctSchema_ID=ci.C_AcctSchema1_ID)" - + " WHERE ci.AD_Client_ID=I_PriceList.AD_Client_ID) " - + "WHERE C_Currency_ID IS NULL AND ISO_Code IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder("UPDATE I_PriceList ") + .append("SET ISO_Code=(SELECT ISO_Code FROM C_Currency c") + .append(" INNER JOIN C_AcctSchema a ON (a.C_Currency_ID=c.C_Currency_ID)") + .append(" INNER JOIN AD_ClientInfo ci ON (a.C_AcctSchema_ID=ci.C_AcctSchema1_ID)") + .append(" WHERE ci.AD_Client_ID=I_PriceList.AD_Client_ID) ") + .append("WHERE C_Currency_ID IS NULL AND ISO_Code IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Currency Default=" + no); // - sql = new StringBuffer ("UPDATE I_PriceList " - + "SET C_Currency_ID=(SELECT C_Currency_ID FROM C_Currency c" - + " WHERE I_PriceList.ISO_Code=c.ISO_Code AND c.AD_Client_ID IN (0,I_PriceList.AD_Client_ID)) " - + "WHERE C_Currency_ID IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_PriceList ") + .append("SET C_Currency_ID=(SELECT C_Currency_ID FROM C_Currency c") + .append(" WHERE I_PriceList.ISO_Code=c.ISO_Code AND c.AD_Client_ID IN (0,I_PriceList.AD_Client_ID)) ") + .append("WHERE C_Currency_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.info("doIt- Set Currency=" + no); // - sql = new StringBuffer ("UPDATE I_PriceList " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Currency,' " - + "WHERE C_Currency_ID IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_PriceList ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Currency,' ") + .append("WHERE C_Currency_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning("Invalid Currency=" + no); // Mandatory Name or PriceListID - sql = new StringBuffer ("UPDATE I_PriceList " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Mandatory Name or PriceListID,' " - + "WHERE Name IS NULL AND M_PriceList_ID IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_PriceList ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Mandatory Name or PriceListID,' ") + .append("WHERE Name IS NULL AND M_PriceList_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning("No Mandatory Name=" + no); // Mandatory ValidFrom or PriceListVersionID - sql = new StringBuffer ("UPDATE I_PriceList " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Mandatory ValidFrom or PriceListVersionID,' " - + "WHERE ValidFrom IS NULL AND M_PriceList_Version_ID IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_PriceList ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Mandatory ValidFrom or PriceListVersionID,' ") + .append("WHERE ValidFrom IS NULL AND M_PriceList_Version_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning("No Mandatory ValidFrom=" + no); // Mandatory BreakValue if BPartner set - sql = new StringBuffer ("UPDATE I_PriceList " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Mandatory BreakValue,' " - + "WHERE BreakValue IS NULL AND (C_BPartner_ID IS NOT NULL OR BPartner_Value IS NOT NULL)" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_PriceList ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Mandatory BreakValue,' ") + .append("WHERE BreakValue IS NULL AND (C_BPartner_ID IS NOT NULL OR BPartner_Value IS NOT NULL)") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning("No Mandatory BreakValue=" + no); @@ -273,7 +273,7 @@ public class ImportPriceList extends SvrProcess // Go through Records log.fine("start inserting/updating ..."); - sql = new StringBuffer ("SELECT * FROM I_PriceList WHERE I_IsImported='N'") + sql = new StringBuilder ("SELECT * FROM I_PriceList WHERE I_IsImported='N'") .append(clientCheck); PreparedStatement pstmt_setImported = null; PreparedStatement pstmt = null; @@ -300,7 +300,8 @@ public class ImportPriceList extends SvrProcess M_PriceList_ID = 0; } boolean newPriceList = M_PriceList_ID == 0; - log.fine("I_PriceList_ID=" + I_PriceList_ID + ", M_PriceList_ID=" + M_PriceList_ID); + StringBuilder msglog = new StringBuilder("I_PriceList_ID=").append(I_PriceList_ID).append(", M_PriceList_ID=").append(M_PriceList_ID); + log.fine(msglog.toString()); MPriceList pricelist = null; // PriceList @@ -315,8 +316,8 @@ public class ImportPriceList extends SvrProcess } else { - StringBuffer sql0 = new StringBuffer ("UPDATE I_PriceList i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert Price List failed")) + StringBuilder sql0 = new StringBuilder ("UPDATE I_PriceList i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert Price List failed")) .append("WHERE I_PriceList_ID=").append(I_PriceList_ID); DB.executeUpdate(sql0.toString(), get_TrxName()); continue; @@ -334,7 +335,8 @@ public class ImportPriceList extends SvrProcess M_PriceList_Version_ID = 0; } boolean newPriceListVersion = M_PriceList_Version_ID == 0; - log.fine("I_PriceList_ID=" + I_PriceList_ID + ", M_PriceList_Version_ID=" + M_PriceList_Version_ID); + msglog = new StringBuilder("I_PriceList_ID=").append(I_PriceList_ID).append(", M_PriceList_Version_ID=").append(M_PriceList_Version_ID); + log.fine(msglog.toString()); MPriceListVersion pricelistversion = null; // PriceListVersion @@ -352,8 +354,8 @@ public class ImportPriceList extends SvrProcess } else { - StringBuffer sql0 = new StringBuffer ("UPDATE I_PriceList i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert Price List Version failed")) + StringBuilder sql0 = new StringBuilder ("UPDATE I_PriceList i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert Price List Version failed")) .append("WHERE I_PriceList_ID=").append(I_PriceList_ID); DB.executeUpdate(sql0.toString(), get_TrxName()); continue; @@ -401,8 +403,8 @@ public class ImportPriceList extends SvrProcess } else { - StringBuffer sql0 = new StringBuffer ("UPDATE I_PriceList i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert/Update Product Price Vendor Break Version failed")) + StringBuilder sql0 = new StringBuilder ("UPDATE I_PriceList i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert/Update Product Price Vendor Break Version failed")) .append("WHERE I_PriceList_ID=").append(I_PriceList_ID); DB.executeUpdate(sql0.toString(), get_TrxName()); continue; @@ -432,8 +434,8 @@ public class ImportPriceList extends SvrProcess } else { - StringBuffer sql0 = new StringBuffer ("UPDATE I_PriceList i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert/Update Product Price failed")) + StringBuilder sql0 = new StringBuilder ("UPDATE I_PriceList i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert/Update Product Price failed")) .append("WHERE I_PriceList_ID=").append(I_PriceList_ID); DB.executeUpdate(sql0.toString(), get_TrxName()); continue; @@ -460,9 +462,9 @@ public class ImportPriceList extends SvrProcess } // Set Error to indicator to not imported - sql = new StringBuffer ("UPDATE I_PriceList " - + "SET I_IsImported='N', Updated=SysDate " - + "WHERE I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_PriceList ") + .append("SET I_IsImported='N', Updated=SysDate ") + .append("WHERE I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); addLog (0, null, new BigDecimal (no), "@Errors@"); addLog (0, null, new BigDecimal (noInsertpl), "@M_PriceList_ID@: @Inserted@"); diff --git a/org.adempiere.base.process/src/org/adempiere/process/InOutGenerateRMA.java b/org.adempiere.base.process/src/org/adempiere/process/InOutGenerateRMA.java index c28a6e0c82..7ed7e7dc8c 100644 --- a/org.adempiere.base.process/src/org/adempiere/process/InOutGenerateRMA.java +++ b/org.adempiere.base.process/src/org/adempiere/process/InOutGenerateRMA.java @@ -236,8 +236,9 @@ public class InOutGenerateRMA extends SvrProcess if (shipmentLines.length == 0) { - log.log(Level.WARNING, "No shipment lines created: M_RMA_ID=" - + M_RMA_ID + ", M_InOut_ID=" + shipment.get_ID()); + StringBuilder msglog = new StringBuilder("No shipment lines created: M_RMA_ID=") + .append(M_RMA_ID).append(", M_InOut_ID=").append(shipment.get_ID()); + log.log(Level.WARNING, msglog.toString()); } StringBuffer processMsg = new StringBuffer(shipment.getDocumentNo()); @@ -245,7 +246,8 @@ public class InOutGenerateRMA extends SvrProcess if (!shipment.processIt(p_docAction)) { processMsg.append(" (NOT Processed)"); - log.warning("Shipment Processing failed: " + shipment + " - " + shipment.getProcessMsg()); + StringBuilder msglog = new StringBuilder("Shipment Processing failed: ").append(shipment).append(" - ").append(shipment.getProcessMsg()); + log.warning(msglog.toString()); throw new IllegalStateException("Shipment Processing failed: " + shipment + " - " + shipment.getProcessMsg()); } diff --git a/org.adempiere.base.process/src/org/adempiere/process/InitialClientSetup.java b/org.adempiere.base.process/src/org/adempiere/process/InitialClientSetup.java index 2d4c6d2cf2..bcc9c14e46 100644 --- a/org.adempiere.base.process/src/org/adempiere/process/InitialClientSetup.java +++ b/org.adempiere.base.process/src/org/adempiere/process/InitialClientSetup.java @@ -149,24 +149,26 @@ public class InitialClientSetup extends SvrProcess */ protected String doIt () throws Exception { - log.info("InitialClientSetup" - + ": ClientName=" + p_ClientName - + ", OrgValue=" + p_OrgValue - + ", OrgName=" + p_OrgName - + ", AdminUserName=" + p_AdminUserName - + ", NormalUserName=" + p_NormalUserName - + ", C_Currency_ID=" + p_C_Currency_ID - + ", C_Country_ID=" + p_C_Country_ID - + ", C_Region_ID=" + p_C_Region_ID - + ", CityName=" + p_CityName - + ", C_City_ID=" + p_C_City_ID - + ", IsUseBPDimension=" + p_IsUseBPDimension - + ", IsUseProductDimension=" + p_IsUseProductDimension - + ", IsUseProjectDimension=" + p_IsUseProjectDimension - + ", IsUseCampaignDimension=" + p_IsUseCampaignDimension - + ", IsUseSalesRegionDimension=" + p_IsUseSalesRegionDimension - + ", CoAFile=" + p_CoAFile - ); + + StringBuilder msglog = new StringBuilder("InitialClientSetup") + .append(": ClientName=").append(p_ClientName) + .append(", OrgValue=").append(p_OrgValue) + .append(", OrgName=").append(p_OrgName) + .append(", AdminUserName=").append(p_AdminUserName) + .append(", NormalUserName=").append(p_NormalUserName) + .append(", C_Currency_ID=").append(p_C_Currency_ID) + .append(", C_Country_ID=").append(p_C_Country_ID) + .append(", C_Region_ID=").append(p_C_Region_ID) + .append(", CityName=").append(p_CityName) + .append(", C_City_ID=").append(p_C_City_ID) + .append(", IsUseBPDimension=").append(p_IsUseBPDimension) + .append(", IsUseProductDimension=").append(p_IsUseProductDimension) + .append(", IsUseProjectDimension=").append(p_IsUseProjectDimension) + .append(", IsUseCampaignDimension=").append(p_IsUseCampaignDimension) + .append(", IsUseSalesRegionDimension=").append(p_IsUseSalesRegionDimension) + .append(", CoAFile=").append(p_CoAFile); + + log.info(msglog.toString()); // Validations @@ -196,7 +198,8 @@ public class InitialClientSetup extends SvrProcess if (p_C_City_ID > 0) { MCity city = MCity.get(getCtx(), p_C_City_ID); if (! city.getName().equals(p_CityName)) { - log.info("City name changed from " + p_CityName + " to " + city.getName()); + msglog = new StringBuilder("City name changed from ").append(p_CityName).append(" to ").append(city.getName()); + log.info(msglog.toString()); p_CityName = city.getName(); } } diff --git a/org.adempiere.base.process/src/org/adempiere/process/InvoiceGenerateRMA.java b/org.adempiere.base.process/src/org/adempiere/process/InvoiceGenerateRMA.java index f336e8262b..de7d5e0239 100644 --- a/org.adempiere.base.process/src/org/adempiere/process/InvoiceGenerateRMA.java +++ b/org.adempiere.base.process/src/org/adempiere/process/InvoiceGenerateRMA.java @@ -165,8 +165,9 @@ public class InvoiceGenerateRMA extends SvrProcess { if (rmaLine.getM_InOutLine_ID() == 0) { - throw new IllegalStateException("No customer return line - RMA = " - + rma.getDocumentNo() + ", Line = " + rmaLine.getLine()); + StringBuilder msgiste = new StringBuilder("No customer return line - RMA = ") + .append(rma.getDocumentNo()).append(", Line = ").append(rmaLine.getLine()); + throw new IllegalStateException(msgiste.toString()); } MInvoiceLine invLine = new MInvoiceLine(invoice); @@ -197,17 +198,19 @@ public class InvoiceGenerateRMA extends SvrProcess if (invoiceLines.length == 0) { - log.log(Level.WARNING, "No invoice lines created: M_RMA_ID=" - + M_RMA_ID + ", M_Invoice_ID=" + invoice.get_ID()); + StringBuilder msglog = new StringBuilder("No invoice lines created: M_RMA_ID=") + .append(M_RMA_ID).append(", M_Invoice_ID=").append(invoice.get_ID()); + log.log(Level.WARNING, msglog.toString()); } - StringBuffer processMsg = new StringBuffer(invoice.getDocumentNo()); + StringBuilder processMsg = new StringBuilder(invoice.getDocumentNo()); if (!invoice.processIt(p_docAction)) { processMsg.append(" (NOT Processed)"); - log.warning("Invoice Processing failed: " + invoice + " - " + invoice.getProcessMsg()); - throw new IllegalStateException("Invoice Processing failed: " + invoice + " - " + invoice.getProcessMsg()); + StringBuilder msg = new StringBuilder("Invoice Processing failed: ").append(invoice).append(" - ").append(invoice.getProcessMsg()); + log.warning(msg.toString()); + throw new IllegalStateException(msg.toString()); } if (!invoice.save()) diff --git a/org.adempiere.base.process/src/org/adempiere/process/PrepareMigrationScripts.java b/org.adempiere.base.process/src/org/adempiere/process/PrepareMigrationScripts.java index b594eedb0e..5cda31c6c8 100644 --- a/org.adempiere.base.process/src/org/adempiere/process/PrepareMigrationScripts.java +++ b/org.adempiere.base.process/src/org/adempiere/process/PrepareMigrationScripts.java @@ -72,18 +72,19 @@ public class PrepareMigrationScripts extends SvrProcess { }; dirList = dir.listFiles(filter); - log.info("Searching for SQL files in the " + dir + " directory"); + StringBuilder msglog = new StringBuilder("Searching for SQL files in the ").append(dir).append(" directory"); + log.info(msglog.toString()); - String msg = ""; + StringBuilder msg = new StringBuilder(); // Get Filenames for (int i = 0; i < dirList.length; i++) { fileName.add(dirList[i].toString() .substring(directory.length() + 1)); - log - .fine("Found file [" - + fileName.get(i) - + "]. Finding out if the script has or hasn't been applied yet..."); + msglog = new StringBuilder("Found file [") + .append(fileName.get(i)) + .append("]. Finding out if the script has or hasn't been applied yet..."); + log.fine(msglog.toString()); try { // First of all, check if the script hasn't been applied yet... String checkScript = "select ad_migrationscript_id from ad_migrationscript where name = ?"; @@ -92,15 +93,16 @@ public class PrepareMigrationScripts extends SvrProcess { pstmt.setString(1, fileName.get(i)); ResultSet rs = pstmt.executeQuery(); if (rs.next()) { - log.warning("Script " + fileName.get(i) - + " already in the database"); + msglog = new StringBuilder("Script ").append(fileName.get(i)) + .append(" already in the database"); + log.warning(msglog.toString()); pstmt.close(); continue; } pstmt.close(); // first use a Scanner to get each line Scanner scanner = new Scanner(dirList[i]); - StringBuffer body = new StringBuffer(); + StringBuilder body = new StringBuilder(); boolean blHeader = false; boolean blBody = false; boolean isFirstLine = true; @@ -215,8 +217,9 @@ public class PrepareMigrationScripts extends SvrProcess { if (result > 0) log.info("Header inserted. Now inserting the script body"); else { - log.severe("Script " + fileName.get(i) + " failed!"); - msg = msg + "Script " + fileName.get(i) + " failed!"; + msglog = new StringBuilder("Script ").append(fileName.get(i)).append(" failed!"); + log.severe(msglog.toString()); + msg.append(msglog); continue; } sql = "UPDATE AD_MigrationScript SET script = ? WHERE AD_MigrationScript_ID = ?"; @@ -228,8 +231,9 @@ public class PrepareMigrationScripts extends SvrProcess { if (result > 0) log.info("Script Body inserted."); else { - log.severe("Script Body " + fileName.get(i) + " failed!"); - msg = msg + "Script Body " + fileName.get(i) + " failed!"; + msglog = new StringBuilder("Script Body ").append(fileName.get(i)).append(" failed!"); + log.severe(msglog.toString()); + msg.append(msglog.toString()); pstmt = DB .prepareStatement( "DELETE FROM ad_migrationscript WHERE ad_migrationscript_id = ?", diff --git a/org.adempiere.base.process/src/org/adempiere/process/UpdateRoleMenu.java b/org.adempiere.base.process/src/org/adempiere/process/UpdateRoleMenu.java index 1a84514874..10fe21634a 100644 --- a/org.adempiere.base.process/src/org/adempiere/process/UpdateRoleMenu.java +++ b/org.adempiere.base.process/src/org/adempiere/process/UpdateRoleMenu.java @@ -38,9 +38,9 @@ public class UpdateRoleMenu extends SvrProcess private MRoleMenu addUpdateRole(Properties ctx, int roleId, int menuId, boolean active, String trxName) { - String whereClause = "AD_Role_ID=" + roleId + " AND U_WebMenu_ID=" + menuId; + StringBuilder whereClause = new StringBuilder("AD_Role_ID=").append(roleId).append(" AND U_WebMenu_ID=").append(menuId); - int roleMenuIds[] = MRoleMenu.getAllIDs(MRoleMenu.Table_Name, whereClause, trxName); + int roleMenuIds[] = MRoleMenu.getAllIDs(MRoleMenu.Table_Name, whereClause.toString(), trxName); MRoleMenu roleMenu; From ec69327826a2c7e067b6a6f09cc5e9392e0702e3 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 21 Sep 2012 19:35:02 -0500 Subject: [PATCH 06/79] =?UTF-8?q?IDEMPIERE-362=20Hide=20things=20that=20do?= =?UTF-8?q?n't=20work=20on=20iDempiere=20/=20Dictionary=20work=20/=20Thank?= =?UTF-8?q?s=20to=20David=20Pe=C3=B1uela?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../oracle/914_IDEMPIERE-362.sql | 742 ++++++++++++++++++ .../postgresql/914_IDEMPIERE-362.sql | 742 ++++++++++++++++++ 2 files changed, 1484 insertions(+) create mode 100644 migration/360lts-release/oracle/914_IDEMPIERE-362.sql create mode 100644 migration/360lts-release/postgresql/914_IDEMPIERE-362.sql diff --git a/migration/360lts-release/oracle/914_IDEMPIERE-362.sql b/migration/360lts-release/oracle/914_IDEMPIERE-362.sql new file mode 100644 index 0000000000..6cf3958e25 --- /dev/null +++ b/migration/360lts-release/oracle/914_IDEMPIERE-362.sql @@ -0,0 +1,742 @@ +-- Sep 17, 2012 5:20:18 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 17:20:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=295 +; + +-- Sep 17, 2012 5:20:26 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-17 17:20:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=226 +; + +-- Sep 17, 2012 5:20:57 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 17:20:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=300 +; + +-- Sep 17, 2012 5:21:11 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-17 17:21:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=231 +; + +-- Sep 17, 2012 5:23:52 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 17:23:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=499 +; + +-- Sep 17, 2012 5:23:57 PM COT +UPDATE AD_Process SET IsActive='N',Updated=TO_DATE('2012-09-17 17:23:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=308 +; + +-- Sep 17, 2012 5:24:38 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 17:24:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53090 +; + +-- Sep 17, 2012 5:24:44 PM COT +UPDATE AD_Process SET IsActive='N',Updated=TO_DATE('2012-09-17 17:24:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=53070 +; + +-- Sep 17, 2012 5:24:44 PM COT +UPDATE AD_Menu SET Name='Prepare Migration Scripts', Description=NULL, IsActive='N',Updated=TO_DATE('2012-09-17 17:24:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53090 +; + +-- Sep 17, 2012 5:24:44 PM COT +UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=53090 +; + +-- Sep 17, 2012 5:25:38 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 17:25:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=448 +; + +-- Sep 17, 2012 5:25:42 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-17 17:25:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=317 +; + +-- Sep 17, 2012 5:26:20 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 17:26:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=449 +; + +-- Sep 17, 2012 5:26:25 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-17 17:26:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=316 +; + +-- Sep 17, 2012 5:35:04 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-17 17:35:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=310 +; + +-- Sep 17, 2012 5:35:04 PM COT +UPDATE AD_Menu SET Name='Auction Buyer', Description='Maintain Auction Buyer Information', IsActive='N',Updated=TO_DATE('2012-09-17 17:35:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=442 +; + +-- Sep 17, 2012 5:39:52 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-17 17:39:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=309 +; + +-- Sep 17, 2012 5:39:52 PM COT +UPDATE AD_Menu SET Name='Auction Seller', Description='Maintain Auction Seller Information', IsActive='N',Updated=TO_DATE('2012-09-17 17:39:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=443 +; + +-- Sep 17, 2012 5:40:54 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 17:40:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=447 +; + +-- Sep 17, 2012 5:41:00 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-17 17:41:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=307 +; + +-- Sep 17, 2012 5:41:52 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 17:41:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=453 +; + +-- Sep 17, 2012 5:41:56 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-17 17:41:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=308 +; + +-- Sep 17, 2012 5:45:35 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 17:45:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=52000 +; + +-- Sep 17, 2012 5:46:02 PM COT +UPDATE AD_Process SET IsActive='N',Updated=TO_DATE('2012-09-17 17:46:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=52003 +; + +-- Sep 17, 2012 5:46:02 PM COT +UPDATE AD_Menu SET Name='Update Role Menu', Description=NULL, IsActive='N',Updated=TO_DATE('2012-09-17 17:46:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=52000 +; + +-- Sep 17, 2012 5:46:02 PM COT +UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=52000 +; + +-- Sep 17, 2012 5:51:42 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 17:51:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=52002 +; + +-- Sep 17, 2012 5:51:51 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-17 17:51:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=52000 +; + +-- Sep 17, 2012 5:58:52 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 17:58:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=52003 +; + +-- Sep 17, 2012 5:58:57 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-17 17:58:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=52001 +; + +-- Sep 17, 2012 5:59:52 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 17:59:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=52004 +; + +-- Sep 17, 2012 5:59:59 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-17 17:59:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=52002 +; + +-- Sep 17, 2012 6:00:47 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 18:00:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=52005 +; + +-- Sep 17, 2012 6:00:52 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-17 18:00:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=52003 +; + +-- Sep 17, 2012 6:01:46 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 18:01:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53013 +; + +-- Sep 17, 2012 6:01:51 PM COT +UPDATE AD_Process SET IsActive='N',Updated=TO_DATE('2012-09-17 18:01:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=53002 +; + +-- Sep 17, 2012 6:01:51 PM COT +UPDATE AD_Menu SET Name='Setup Web POS', Description=NULL, IsActive='N',Updated=TO_DATE('2012-09-17 18:01:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53013 +; + +-- Sep 17, 2012 6:01:51 PM COT +UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=53013 +; + +-- Sep 17, 2012 6:02:44 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 18:02:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53196 +; + +-- Sep 17, 2012 6:02:49 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-17 18:02:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53065 +; + +-- Sep 17, 2012 6:02:49 PM COT +UPDATE AD_Menu SET Name='Web POS Terminal', Description=NULL, IsActive='N',Updated=TO_DATE('2012-09-17 18:02:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53196 +; + +-- Sep 17, 2012 6:02:49 PM COT +UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=53196 +; + +-- Sep 18, 2012 2:17:00 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 14:17:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=392 +; + +-- Sep 18, 2012 2:17:59 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 14:17:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=389 +; + +-- Sep 18, 2012 2:18:04 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 14:18:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=287 +; + +-- Sep 18, 2012 2:18:55 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 14:18:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=390 +; + +-- Sep 18, 2012 2:19:00 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 14:19:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=290 +; + +-- Sep 18, 2012 5:29:19 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 17:29:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=391 +; + +-- Sep 18, 2012 5:29:29 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 17:29:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=289 +; + +-- Sep 18, 2012 5:30:50 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 17:30:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=590 +; + +-- Sep 18, 2012 5:30:55 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 17:30:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=386 +; + +-- Sep 18, 2012 5:31:26 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 17:31:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=591 +; + +-- Sep 18, 2012 5:31:30 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 17:31:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=387 +; + +-- Sep 18, 2012 5:32:23 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 17:32:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=592 +; + +-- Sep 18, 2012 5:32:27 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 17:32:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=388 +; + +-- Sep 18, 2012 5:34:02 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 17:34:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=593 +; + +-- Sep 18, 2012 5:34:09 PM COT +UPDATE AD_Process SET IsActive='N',Updated=TO_DATE('2012-09-18 17:34:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=350 +; + +-- Sep 18, 2012 5:34:09 PM COT +UPDATE AD_Menu SET Name='Rebuild Index', Description=NULL, IsActive='N',Updated=TO_DATE('2012-09-18 17:34:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=593 +; + +-- Sep 18, 2012 5:34:09 PM COT +UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=593 +; + +-- Sep 18, 2012 5:52:15 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 17:52:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=573 +; + +-- Sep 18, 2012 5:52:20 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 17:52:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=379 +; + +-- Sep 18, 2012 5:53:08 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 17:53:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=574 +; + +-- Sep 18, 2012 5:53:14 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 17:53:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=376 +; + +-- Sep 18, 2012 5:54:07 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 17:54:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=576 +; + +-- Sep 18, 2012 5:54:11 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 17:54:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=375 +; + +-- Sep 18, 2012 5:58:59 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 17:58:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=579 +; + +-- Sep 18, 2012 5:59:05 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 17:59:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=373 +; + +-- Sep 18, 2012 5:59:45 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 17:59:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=584 +; + +-- Sep 18, 2012 5:59:50 PM COT +UPDATE AD_Process SET IsActive='N',Updated=TO_DATE('2012-09-18 17:59:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=345 +; + +-- Sep 18, 2012 6:00:23 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:00:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=587 +; + +-- Sep 18, 2012 6:00:28 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:00:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=383 +; + +-- Sep 18, 2012 6:01:07 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:01:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=588 +; + +-- Sep 18, 2012 6:01:11 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:01:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=384 +; + +-- Sep 18, 2012 6:07:03 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:07:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=52001 +; + +-- Sep 18, 2012 6:07:49 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:07:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=460 +; + +-- Sep 18, 2012 6:10:10 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:10:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53264 +; + +-- Sep 18, 2012 6:10:15 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:10:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53109 +; + +-- Sep 18, 2012 6:10:15 PM COT +UPDATE AD_Menu SET Name='Import Product Planning', Description=NULL, IsActive='N',Updated=TO_DATE('2012-09-18 18:10:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53264 +; + +-- Sep 18, 2012 6:10:15 PM COT +UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=53264 +; + +-- Sep 18, 2012 6:17:14 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:17:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=371 +; + +-- Sep 18, 2012 6:17:19 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:17:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=269 +; + +-- Sep 18, 2012 6:20:15 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:20:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=375 +; + +-- Sep 18, 2012 6:20:19 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:20:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=273 +; + +-- Sep 18, 2012 6:20:50 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:20:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=380 +; + +-- Sep 18, 2012 6:20:56 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:20:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=274 +; + +-- Sep 18, 2012 6:21:33 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:21:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=415 +; + +-- Sep 18, 2012 6:21:37 PM COT +UPDATE AD_Process SET IsActive='N',Updated=TO_DATE('2012-09-18 18:21:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=239 +; + +-- Sep 18, 2012 6:22:07 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:22:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=416 +; + +-- Sep 18, 2012 6:22:16 PM COT +UPDATE AD_Process SET IsActive='N',Updated=TO_DATE('2012-09-18 18:22:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=240 +; + +-- Sep 18, 2012 6:22:37 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:22:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=372 +; + +-- Sep 18, 2012 6:23:27 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:23:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=559 +; + +-- Sep 18, 2012 6:23:31 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:23:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=367 +; + +-- Sep 18, 2012 6:24:03 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:24:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=560 +; + +-- Sep 18, 2012 6:24:07 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:24:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=368 +; + +-- Sep 18, 2012 6:24:45 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:24:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=561 +; + +-- Sep 18, 2012 6:24:49 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:24:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=369 +; + +-- Sep 18, 2012 6:25:23 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:25:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=562 +; + +-- Sep 18, 2012 6:25:27 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:25:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=370 +; + +-- Sep 18, 2012 6:26:03 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:26:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=563 +; + +-- Sep 18, 2012 6:26:08 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:26:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=371 +; + +-- Sep 18, 2012 6:26:54 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:26:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=564 +; + +-- Sep 18, 2012 6:26:59 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:26:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=372 +; + +-- Sep 18, 2012 6:31:03 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:31:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=488 +; + +-- Sep 18, 2012 6:31:07 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:31:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=335 +; + +-- Sep 18, 2012 6:31:49 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:31:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=489 +; + +-- Sep 18, 2012 6:31:53 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:31:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=336 +; + +-- Sep 18, 2012 6:32:54 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:32:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=241 +; + +-- Sep 18, 2012 6:32:59 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:32:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=198 +; + +-- Sep 18, 2012 6:35:18 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:35:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=288 +; + +-- Sep 18, 2012 6:35:24 PM COT +UPDATE AD_Process SET IsActive='N',Updated=TO_DATE('2012-09-18 18:35:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=170 +; + +-- Sep 18, 2012 6:36:45 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:36:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53132 +; + +-- Sep 18, 2012 6:36:50 PM COT +UPDATE AD_Form SET IsActive='N',Updated=TO_DATE('2012-09-18 18:36:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Form_ID=53010 +; + +-- Sep 18, 2012 6:39:43 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:39:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=187 +; + +-- Sep 18, 2012 6:39:49 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:39:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=175 +; + +-- Sep 18, 2012 6:40:25 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:40:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=358 +; + +-- Sep 18, 2012 6:40:31 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:40:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=261 +; + +-- Sep 18, 2012 6:41:15 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:41:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=477 +; + +-- Sep 18, 2012 6:41:19 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:41:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=329 +; + +-- Sep 18, 2012 6:42:01 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:42:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=504 +; + +-- Sep 18, 2012 6:42:05 PM COT +UPDATE AD_Process SET IsActive='N',Updated=TO_DATE('2012-09-18 18:42:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=311 +; + +-- Sep 18, 2012 6:42:46 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:42:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=360 +; + +-- Sep 18, 2012 6:42:52 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:42:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=262 +; + +-- Sep 18, 2012 6:43:26 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:43:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=498 +; + +-- Sep 18, 2012 6:43:32 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:43:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=340 +; + +-- Sep 18, 2012 6:44:09 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:44:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=532 +; + +-- Sep 18, 2012 6:44:12 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:44:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=353 +; + +-- Sep 18, 2012 6:45:08 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:45:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53187 +; + +-- Sep 18, 2012 6:45:11 PM COT +UPDATE AD_Process SET IsActive='N',Updated=TO_DATE('2012-09-18 18:45:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=53152 +; + +-- Sep 18, 2012 6:45:11 PM COT +UPDATE AD_Menu SET Name='Immediate Bank Transfer', Description=NULL, IsActive='N',Updated=TO_DATE('2012-09-18 18:45:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53187 +; + +-- Sep 18, 2012 6:45:11 PM COT +UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=53187 +; + +-- Sep 18, 2012 6:45:48 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:45:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53256 +; + +-- Sep 18, 2012 6:45:53 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:45:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53104 +; + +-- Sep 18, 2012 6:46:37 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:46:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=173 +; + +-- Sep 18, 2012 6:46:43 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:46:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=160 +; + +-- Sep 18, 2012 6:47:44 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:47:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=284 +; + +-- Sep 18, 2012 6:47:48 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:47:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=220 +; + +-- Sep 18, 2012 6:48:25 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:48:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=344 +; + +-- Sep 18, 2012 6:48:30 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:48:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=253 +; + +-- Sep 18, 2012 6:51:14 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:51:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=547 +; + +-- Sep 18, 2012 6:51:19 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:51:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=359 +; + +-- Sep 18, 2012 6:51:50 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:51:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=550 +; + +-- Sep 18, 2012 6:51:54 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:51:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=361 +; + +-- Sep 18, 2012 6:52:26 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:52:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=551 +; + +-- Sep 18, 2012 6:52:30 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:52:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=362 +; + +-- Sep 18, 2012 6:55:48 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:55:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53169 +; + +-- Sep 19, 2012 10:29:42 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:29:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=54416 +; + +-- Sep 19, 2012 10:37:37 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:37:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=9286 +; + +-- Sep 19, 2012 10:41:21 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:41:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11517 +; + +-- Sep 19, 2012 10:41:38 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:41:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11520 +; + +-- Sep 19, 2012 10:41:44 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:41:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11521 +; + +-- Sep 19, 2012 10:41:48 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:41:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11519 +; + +-- Sep 19, 2012 10:41:53 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:41:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11516 +; + +-- Sep 19, 2012 10:41:56 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:41:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11518 +; + +-- Sep 19, 2012 10:42:05 AM COT +UPDATE AD_Tab SET IsActive='N',Updated=TO_DATE('2012-09-19 10:42:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Tab_ID=707 +; + +-- Sep 19, 2012 10:43:29 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:43:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=1494 +; + +-- Sep 19, 2012 10:43:36 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:43:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=2074 +; + +-- Sep 19, 2012 10:43:41 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:43:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=1597 +; + +-- Sep 19, 2012 10:43:45 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:43:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=1492 +; + +-- Sep 19, 2012 10:43:49 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:43:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=1495 +; + +-- Sep 19, 2012 10:43:56 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:43:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=2611 +; + +-- Sep 19, 2012 10:44:00 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:44:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=2612 +; + +-- Sep 19, 2012 10:44:08 AM COT +UPDATE AD_Tab SET IsActive='N',Updated=TO_DATE('2012-09-19 10:44:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Tab_ID=214 +; + +-- Sep 19, 2012 10:50:54 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:50:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=12360 +; + +-- Sep 19, 2012 10:52:39 AM COT +UPDATE AD_Window SET IsBetaFunctionality='N',Updated=TO_DATE('2012-09-19 10:52:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=229 +; + +-- Sep 19, 2012 10:52:56 AM COT +UPDATE AD_Window SET IsBetaFunctionality='N',Updated=TO_DATE('2012-09-19 10:52:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=312 +; + +-- Sep 19, 2012 10:53:44 AM COT +UPDATE AD_Window SET IsBetaFunctionality='N',Updated=TO_DATE('2012-09-19 10:53:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53015 +; + +-- Sep 19, 2012 10:54:05 AM COT +UPDATE AD_Window SET IsBetaFunctionality='N',Updated=TO_DATE('2012-09-19 10:54:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53016 +; + +-- Sep 20, 2012 6:12:15 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-20 18:12:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=288 +; + +-- Sep 20, 2012 6:12:15 PM COT +UPDATE AD_Menu SET Name='Knowledge Base', Description='Maintain Knowledge Base', IsActive='N',Updated=TO_DATE('2012-09-20 18:12:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=388 +; + +-- Sep 20, 2012 6:13:16 PM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-20 18:13:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=55432 +; + +-- Sep 20, 2012 6:13:24 PM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-20 18:13:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=55433 +; + +-- Sep 20, 2012 6:13:44 PM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-20 18:13:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=50171 +; + +-- Sep 20, 2012 6:14:47 PM COT +UPDATE AD_Column SET DefaultValue='N',Updated=TO_DATE('2012-09-20 18:14:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=50201 +; + +-- Sep 20, 2012 6:14:51 PM COT +UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-20 18:14:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=50201 +; + +-- Sep 20, 2012 6:15:15 PM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-20 18:15:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=50171 +; + +-- Sep 20, 2012 6:15:24 PM COT +UPDATE AD_Column SET DefaultValue='N',Updated=TO_DATE('2012-09-20 18:15:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=55333 +; + +-- Sep 20, 2012 6:15:26 PM COT +UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-20 18:15:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=55333 +; + +-- Sep 20, 2012 6:15:38 PM COT +UPDATE AD_Column SET DefaultValue='N',Updated=TO_DATE('2012-09-20 18:15:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=55332 +; + +-- Sep 20, 2012 6:15:41 PM COT +UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-20 18:15:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=55332 +; + +-- Sep 20, 2012 6:16:02 PM COT +ALTER TABLE AD_Role MODIFY Allow_Info_MRP CHAR(1) DEFAULT 'N' +; + +-- Sep 20, 2012 6:16:03 PM COT +UPDATE AD_Role SET Allow_Info_MRP='N' WHERE Allow_Info_MRP IS NULL +; + +-- Sep 20, 2012 6:16:33 PM COT +ALTER TABLE AD_Role MODIFY Allow_Info_CRP CHAR(1) DEFAULT 'N' +; + +-- Sep 20, 2012 6:16:34 PM COT +UPDATE AD_Role SET Allow_Info_CRP='N' WHERE Allow_Info_CRP IS NULL +; + +-- Sep 20, 2012 6:17:03 PM COT +ALTER TABLE AD_Role MODIFY Allow_Info_CashJournal CHAR(1) DEFAULT 'N' +; + +UPDATE AD_Role SET Allow_Info_CashJournal='N', Allow_Info_MRP='N', Allow_Info_CRP='N' +; + +SELECT register_migration_script('914_IDEMPIERE-362.sql') FROM dual +; diff --git a/migration/360lts-release/postgresql/914_IDEMPIERE-362.sql b/migration/360lts-release/postgresql/914_IDEMPIERE-362.sql new file mode 100644 index 0000000000..fd123042fe --- /dev/null +++ b/migration/360lts-release/postgresql/914_IDEMPIERE-362.sql @@ -0,0 +1,742 @@ +-- Sep 17, 2012 5:20:18 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:20:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=295 +; + +-- Sep 17, 2012 5:20:26 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:20:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=226 +; + +-- Sep 17, 2012 5:20:57 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:20:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=300 +; + +-- Sep 17, 2012 5:21:11 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:21:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=231 +; + +-- Sep 17, 2012 5:23:52 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:23:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=499 +; + +-- Sep 17, 2012 5:23:57 PM COT +UPDATE AD_Process SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:23:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=308 +; + +-- Sep 17, 2012 5:24:38 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:24:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53090 +; + +-- Sep 17, 2012 5:24:44 PM COT +UPDATE AD_Process SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:24:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=53070 +; + +-- Sep 17, 2012 5:24:44 PM COT +UPDATE AD_Menu SET Name='Prepare Migration Scripts', Description=NULL, IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:24:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53090 +; + +-- Sep 17, 2012 5:24:44 PM COT +UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=53090 +; + +-- Sep 17, 2012 5:25:38 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:25:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=448 +; + +-- Sep 17, 2012 5:25:42 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:25:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=317 +; + +-- Sep 17, 2012 5:26:20 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:26:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=449 +; + +-- Sep 17, 2012 5:26:25 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:26:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=316 +; + +-- Sep 17, 2012 5:35:04 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:35:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=310 +; + +-- Sep 17, 2012 5:35:04 PM COT +UPDATE AD_Menu SET Name='Auction Buyer', Description='Maintain Auction Buyer Information', IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:35:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=442 +; + +-- Sep 17, 2012 5:39:52 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:39:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=309 +; + +-- Sep 17, 2012 5:39:52 PM COT +UPDATE AD_Menu SET Name='Auction Seller', Description='Maintain Auction Seller Information', IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:39:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=443 +; + +-- Sep 17, 2012 5:40:54 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:40:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=447 +; + +-- Sep 17, 2012 5:41:00 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:41:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=307 +; + +-- Sep 17, 2012 5:41:52 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:41:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=453 +; + +-- Sep 17, 2012 5:41:56 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:41:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=308 +; + +-- Sep 17, 2012 5:45:35 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:45:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=52000 +; + +-- Sep 17, 2012 5:46:02 PM COT +UPDATE AD_Process SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:46:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=52003 +; + +-- Sep 17, 2012 5:46:02 PM COT +UPDATE AD_Menu SET Name='Update Role Menu', Description=NULL, IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:46:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=52000 +; + +-- Sep 17, 2012 5:46:02 PM COT +UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=52000 +; + +-- Sep 17, 2012 5:51:42 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:51:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=52002 +; + +-- Sep 17, 2012 5:51:51 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:51:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=52000 +; + +-- Sep 17, 2012 5:58:52 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:58:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=52003 +; + +-- Sep 17, 2012 5:58:57 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:58:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=52001 +; + +-- Sep 17, 2012 5:59:52 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:59:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=52004 +; + +-- Sep 17, 2012 5:59:59 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:59:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=52002 +; + +-- Sep 17, 2012 6:00:47 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 18:00:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=52005 +; + +-- Sep 17, 2012 6:00:52 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 18:00:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=52003 +; + +-- Sep 17, 2012 6:01:46 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 18:01:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53013 +; + +-- Sep 17, 2012 6:01:51 PM COT +UPDATE AD_Process SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 18:01:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=53002 +; + +-- Sep 17, 2012 6:01:51 PM COT +UPDATE AD_Menu SET Name='Setup Web POS', Description=NULL, IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 18:01:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53013 +; + +-- Sep 17, 2012 6:01:51 PM COT +UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=53013 +; + +-- Sep 17, 2012 6:02:44 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 18:02:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53196 +; + +-- Sep 17, 2012 6:02:49 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 18:02:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53065 +; + +-- Sep 17, 2012 6:02:49 PM COT +UPDATE AD_Menu SET Name='Web POS Terminal', Description=NULL, IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 18:02:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53196 +; + +-- Sep 17, 2012 6:02:49 PM COT +UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=53196 +; + +-- Sep 18, 2012 2:17:00 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 14:17:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=392 +; + +-- Sep 18, 2012 2:17:59 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 14:17:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=389 +; + +-- Sep 18, 2012 2:18:04 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 14:18:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=287 +; + +-- Sep 18, 2012 2:18:55 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 14:18:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=390 +; + +-- Sep 18, 2012 2:19:00 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 14:19:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=290 +; + +-- Sep 18, 2012 5:29:19 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:29:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=391 +; + +-- Sep 18, 2012 5:29:29 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:29:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=289 +; + +-- Sep 18, 2012 5:30:50 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:30:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=590 +; + +-- Sep 18, 2012 5:30:55 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:30:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=386 +; + +-- Sep 18, 2012 5:31:26 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:31:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=591 +; + +-- Sep 18, 2012 5:31:30 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:31:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=387 +; + +-- Sep 18, 2012 5:32:23 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:32:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=592 +; + +-- Sep 18, 2012 5:32:27 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:32:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=388 +; + +-- Sep 18, 2012 5:34:02 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:34:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=593 +; + +-- Sep 18, 2012 5:34:09 PM COT +UPDATE AD_Process SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:34:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=350 +; + +-- Sep 18, 2012 5:34:09 PM COT +UPDATE AD_Menu SET Name='Rebuild Index', Description=NULL, IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:34:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=593 +; + +-- Sep 18, 2012 5:34:09 PM COT +UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=593 +; + +-- Sep 18, 2012 5:52:15 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:52:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=573 +; + +-- Sep 18, 2012 5:52:20 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:52:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=379 +; + +-- Sep 18, 2012 5:53:08 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:53:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=574 +; + +-- Sep 18, 2012 5:53:14 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:53:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=376 +; + +-- Sep 18, 2012 5:54:07 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:54:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=576 +; + +-- Sep 18, 2012 5:54:11 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:54:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=375 +; + +-- Sep 18, 2012 5:58:59 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:58:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=579 +; + +-- Sep 18, 2012 5:59:05 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:59:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=373 +; + +-- Sep 18, 2012 5:59:45 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:59:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=584 +; + +-- Sep 18, 2012 5:59:50 PM COT +UPDATE AD_Process SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:59:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=345 +; + +-- Sep 18, 2012 6:00:23 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:00:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=587 +; + +-- Sep 18, 2012 6:00:28 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:00:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=383 +; + +-- Sep 18, 2012 6:01:07 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:01:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=588 +; + +-- Sep 18, 2012 6:01:11 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:01:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=384 +; + +-- Sep 18, 2012 6:07:03 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:07:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=52001 +; + +-- Sep 18, 2012 6:07:49 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:07:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=460 +; + +-- Sep 18, 2012 6:10:10 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:10:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53264 +; + +-- Sep 18, 2012 6:10:15 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:10:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53109 +; + +-- Sep 18, 2012 6:10:15 PM COT +UPDATE AD_Menu SET Name='Import Product Planning', Description=NULL, IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:10:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53264 +; + +-- Sep 18, 2012 6:10:15 PM COT +UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=53264 +; + +-- Sep 18, 2012 6:17:14 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:17:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=371 +; + +-- Sep 18, 2012 6:17:19 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:17:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=269 +; + +-- Sep 18, 2012 6:20:15 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:20:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=375 +; + +-- Sep 18, 2012 6:20:19 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:20:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=273 +; + +-- Sep 18, 2012 6:20:50 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:20:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=380 +; + +-- Sep 18, 2012 6:20:56 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:20:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=274 +; + +-- Sep 18, 2012 6:21:33 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:21:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=415 +; + +-- Sep 18, 2012 6:21:37 PM COT +UPDATE AD_Process SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:21:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=239 +; + +-- Sep 18, 2012 6:22:07 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:22:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=416 +; + +-- Sep 18, 2012 6:22:16 PM COT +UPDATE AD_Process SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:22:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=240 +; + +-- Sep 18, 2012 6:22:37 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:22:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=372 +; + +-- Sep 18, 2012 6:23:27 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:23:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=559 +; + +-- Sep 18, 2012 6:23:31 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:23:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=367 +; + +-- Sep 18, 2012 6:24:03 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:24:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=560 +; + +-- Sep 18, 2012 6:24:07 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:24:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=368 +; + +-- Sep 18, 2012 6:24:45 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:24:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=561 +; + +-- Sep 18, 2012 6:24:49 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:24:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=369 +; + +-- Sep 18, 2012 6:25:23 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:25:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=562 +; + +-- Sep 18, 2012 6:25:27 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:25:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=370 +; + +-- Sep 18, 2012 6:26:03 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:26:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=563 +; + +-- Sep 18, 2012 6:26:08 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:26:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=371 +; + +-- Sep 18, 2012 6:26:54 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:26:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=564 +; + +-- Sep 18, 2012 6:26:59 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:26:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=372 +; + +-- Sep 18, 2012 6:31:03 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:31:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=488 +; + +-- Sep 18, 2012 6:31:07 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:31:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=335 +; + +-- Sep 18, 2012 6:31:49 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:31:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=489 +; + +-- Sep 18, 2012 6:31:53 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:31:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=336 +; + +-- Sep 18, 2012 6:32:54 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:32:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=241 +; + +-- Sep 18, 2012 6:32:59 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:32:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=198 +; + +-- Sep 18, 2012 6:35:18 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:35:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=288 +; + +-- Sep 18, 2012 6:35:24 PM COT +UPDATE AD_Process SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:35:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=170 +; + +-- Sep 18, 2012 6:36:45 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:36:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53132 +; + +-- Sep 18, 2012 6:36:50 PM COT +UPDATE AD_Form SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:36:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Form_ID=53010 +; + +-- Sep 18, 2012 6:39:43 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:39:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=187 +; + +-- Sep 18, 2012 6:39:49 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:39:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=175 +; + +-- Sep 18, 2012 6:40:25 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:40:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=358 +; + +-- Sep 18, 2012 6:40:31 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:40:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=261 +; + +-- Sep 18, 2012 6:41:15 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:41:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=477 +; + +-- Sep 18, 2012 6:41:19 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:41:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=329 +; + +-- Sep 18, 2012 6:42:01 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:42:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=504 +; + +-- Sep 18, 2012 6:42:05 PM COT +UPDATE AD_Process SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:42:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=311 +; + +-- Sep 18, 2012 6:42:46 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:42:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=360 +; + +-- Sep 18, 2012 6:42:52 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:42:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=262 +; + +-- Sep 18, 2012 6:43:26 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:43:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=498 +; + +-- Sep 18, 2012 6:43:32 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:43:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=340 +; + +-- Sep 18, 2012 6:44:09 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:44:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=532 +; + +-- Sep 18, 2012 6:44:12 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:44:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=353 +; + +-- Sep 18, 2012 6:45:08 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:45:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53187 +; + +-- Sep 18, 2012 6:45:11 PM COT +UPDATE AD_Process SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:45:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=53152 +; + +-- Sep 18, 2012 6:45:11 PM COT +UPDATE AD_Menu SET Name='Immediate Bank Transfer', Description=NULL, IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:45:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53187 +; + +-- Sep 18, 2012 6:45:11 PM COT +UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=53187 +; + +-- Sep 18, 2012 6:45:48 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:45:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53256 +; + +-- Sep 18, 2012 6:45:53 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:45:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53104 +; + +-- Sep 18, 2012 6:46:37 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:46:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=173 +; + +-- Sep 18, 2012 6:46:43 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:46:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=160 +; + +-- Sep 18, 2012 6:47:44 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:47:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=284 +; + +-- Sep 18, 2012 6:47:48 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:47:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=220 +; + +-- Sep 18, 2012 6:48:25 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:48:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=344 +; + +-- Sep 18, 2012 6:48:30 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:48:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=253 +; + +-- Sep 18, 2012 6:51:14 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:51:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=547 +; + +-- Sep 18, 2012 6:51:19 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:51:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=359 +; + +-- Sep 18, 2012 6:51:50 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:51:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=550 +; + +-- Sep 18, 2012 6:51:54 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:51:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=361 +; + +-- Sep 18, 2012 6:52:26 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:52:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=551 +; + +-- Sep 18, 2012 6:52:30 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:52:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=362 +; + +-- Sep 18, 2012 6:55:48 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:55:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53169 +; + +-- Sep 19, 2012 10:29:42 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:29:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=54416 +; + +-- Sep 19, 2012 10:37:37 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:37:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=9286 +; + +-- Sep 19, 2012 10:41:21 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:41:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11517 +; + +-- Sep 19, 2012 10:41:38 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:41:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11520 +; + +-- Sep 19, 2012 10:41:44 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:41:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11521 +; + +-- Sep 19, 2012 10:41:48 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:41:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11519 +; + +-- Sep 19, 2012 10:41:53 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:41:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11516 +; + +-- Sep 19, 2012 10:41:56 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:41:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11518 +; + +-- Sep 19, 2012 10:42:05 AM COT +UPDATE AD_Tab SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:42:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Tab_ID=707 +; + +-- Sep 19, 2012 10:43:29 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:43:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=1494 +; + +-- Sep 19, 2012 10:43:36 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:43:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=2074 +; + +-- Sep 19, 2012 10:43:41 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:43:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=1597 +; + +-- Sep 19, 2012 10:43:45 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:43:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=1492 +; + +-- Sep 19, 2012 10:43:49 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:43:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=1495 +; + +-- Sep 19, 2012 10:43:56 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:43:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=2611 +; + +-- Sep 19, 2012 10:44:00 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:44:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=2612 +; + +-- Sep 19, 2012 10:44:08 AM COT +UPDATE AD_Tab SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:44:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Tab_ID=214 +; + +-- Sep 19, 2012 10:50:54 AM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:50:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=12360 +; + +-- Sep 19, 2012 10:52:39 AM COT +UPDATE AD_Window SET IsBetaFunctionality='N',Updated=TO_TIMESTAMP('2012-09-19 10:52:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=229 +; + +-- Sep 19, 2012 10:52:56 AM COT +UPDATE AD_Window SET IsBetaFunctionality='N',Updated=TO_TIMESTAMP('2012-09-19 10:52:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=312 +; + +-- Sep 19, 2012 10:53:44 AM COT +UPDATE AD_Window SET IsBetaFunctionality='N',Updated=TO_TIMESTAMP('2012-09-19 10:53:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53015 +; + +-- Sep 19, 2012 10:54:05 AM COT +UPDATE AD_Window SET IsBetaFunctionality='N',Updated=TO_TIMESTAMP('2012-09-19 10:54:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53016 +; + +-- Sep 20, 2012 6:12:15 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 18:12:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=288 +; + +-- Sep 20, 2012 6:12:15 PM COT +UPDATE AD_Menu SET Name='Knowledge Base', Description='Maintain Knowledge Base', IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 18:12:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=388 +; + +-- Sep 20, 2012 6:13:16 PM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 18:13:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=55432 +; + +-- Sep 20, 2012 6:13:24 PM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 18:13:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=55433 +; + +-- Sep 20, 2012 6:13:44 PM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 18:13:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=50171 +; + +-- Sep 20, 2012 6:14:47 PM COT +UPDATE AD_Column SET DefaultValue='N',Updated=TO_TIMESTAMP('2012-09-20 18:14:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=50201 +; + +-- Sep 20, 2012 6:14:51 PM COT +UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 18:14:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=50201 +; + +-- Sep 20, 2012 6:15:15 PM COT +UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 18:15:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=50171 +; + +-- Sep 20, 2012 6:15:24 PM COT +UPDATE AD_Column SET DefaultValue='N',Updated=TO_TIMESTAMP('2012-09-20 18:15:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=55333 +; + +-- Sep 20, 2012 6:15:26 PM COT +UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 18:15:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=55333 +; + +-- Sep 20, 2012 6:15:38 PM COT +UPDATE AD_Column SET DefaultValue='N',Updated=TO_TIMESTAMP('2012-09-20 18:15:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=55332 +; + +-- Sep 20, 2012 6:15:41 PM COT +UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 18:15:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=55332 +; + +-- Sep 20, 2012 6:16:02 PM COT +INSERT INTO t_alter_column values('ad_role','Allow_Info_MRP','CHAR(1)',null,'N') +; + +-- Sep 20, 2012 6:16:03 PM COT +UPDATE AD_Role SET Allow_Info_MRP='N' WHERE Allow_Info_MRP IS NULL +; + +-- Sep 20, 2012 6:16:33 PM COT +INSERT INTO t_alter_column values('ad_role','Allow_Info_CRP','CHAR(1)',null,'N') +; + +-- Sep 20, 2012 6:16:34 PM COT +UPDATE AD_Role SET Allow_Info_CRP='N' WHERE Allow_Info_CRP IS NULL +; + +-- Sep 20, 2012 6:17:03 PM COT +INSERT INTO t_alter_column values('ad_role','Allow_Info_CashJournal','CHAR(1)',null,'N') +; + +UPDATE AD_Role SET Allow_Info_CashJournal='N', Allow_Info_MRP='N', Allow_Info_CRP='N' +; + +SELECT register_migration_script('914_IDEMPIERE-362.sql') FROM dual +; From 0c0e46fc20669e3e9c9d4cc1fd21f715579fbb6f Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 21 Sep 2012 20:18:25 -0500 Subject: [PATCH 07/79] IDEMPIERE-366 Improve Role Inheritance / Fix wrong migration script --- .../oracle/917_IDEMPIERE-366.sql | 63 +++++++++++++++++++ .../postgresql/917_IDEMPIERE-366.sql | 63 +++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 migration/360lts-release/oracle/917_IDEMPIERE-366.sql create mode 100644 migration/360lts-release/postgresql/917_IDEMPIERE-366.sql diff --git a/migration/360lts-release/oracle/917_IDEMPIERE-366.sql b/migration/360lts-release/oracle/917_IDEMPIERE-366.sql new file mode 100644 index 0000000000..3f7374483f --- /dev/null +++ b/migration/360lts-release/oracle/917_IDEMPIERE-366.sql @@ -0,0 +1,63 @@ +-- Sep 21, 2012 8:07:08 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''SOO'', ''POO'') AND C_DocType.DocSubTypeSO=''RM'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@ AND IsSOTrx=''N''',Updated=TO_DATE('2012-09-21 20:07:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52066 +; + +-- Sep 21, 2012 8:07:15 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARR'', ''APP'') AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_DATE('2012-09-21 20:07:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=149 +; + +-- Sep 21, 2012 8:07:20 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''DOO'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_DATE('2012-09-21 20:07:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52004 +; + +-- Sep 21, 2012 8:07:24 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''MMM'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_DATE('2012-09-21 20:07:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=201 +; + +-- Sep 21, 2012 8:07:28 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''MMR'', ''MMS'') AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_DATE('2012-09-21 20:07:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=125 +; + +-- Sep 21, 2012 8:07:42 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''MMR'') AND C_DocType.IsSOTrx=''N'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_DATE('2012-09-21 20:07:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52054 +; + +-- Sep 21, 2012 8:08:05 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''SOO'', ''POO'') AND C_DocType.DocSubTypeSO=''RM'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@ AND C_DocType.IsSOTrx=''N''',Updated=TO_DATE('2012-09-21 20:08:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52066 +; + +-- Sep 21, 2012 8:08:26 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''MMI'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_DATE('2012-09-21 20:08:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=209 +; + +-- Sep 21, 2012 8:08:30 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''GLJ'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_DATE('2012-09-21 20:08:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=102 +; + +-- Sep 21, 2012 8:08:36 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARI'', ''API'',''ARC'',''APC'') AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_DATE('2012-09-21 20:08:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=173 +; + +-- Sep 21, 2012 8:08:41 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''GLD'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_DATE('2012-09-21 20:08:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=121 +; + +-- Sep 21, 2012 8:08:47 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARI'', ''API'',''ARC'',''APC'') AND C_DocType.IsSOTrx=''@IsSOTrx@'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_DATE('2012-09-21 20:08:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=124 +; + +SELECT register_migration_script('917_IDEMPIERE-366.sql') FROM dual +; + diff --git a/migration/360lts-release/postgresql/917_IDEMPIERE-366.sql b/migration/360lts-release/postgresql/917_IDEMPIERE-366.sql new file mode 100644 index 0000000000..e3422a79c9 --- /dev/null +++ b/migration/360lts-release/postgresql/917_IDEMPIERE-366.sql @@ -0,0 +1,63 @@ +-- Sep 21, 2012 8:07:08 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''SOO'', ''POO'') AND C_DocType.DocSubTypeSO=''RM'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@ AND IsSOTrx=''N''',Updated=TO_TIMESTAMP('2012-09-21 20:07:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52066 +; + +-- Sep 21, 2012 8:07:15 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARR'', ''APP'') AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-21 20:07:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=149 +; + +-- Sep 21, 2012 8:07:20 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''DOO'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-21 20:07:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52004 +; + +-- Sep 21, 2012 8:07:24 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''MMM'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-21 20:07:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=201 +; + +-- Sep 21, 2012 8:07:28 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''MMR'', ''MMS'') AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-21 20:07:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=125 +; + +-- Sep 21, 2012 8:07:42 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''MMR'') AND C_DocType.IsSOTrx=''N'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-21 20:07:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52054 +; + +-- Sep 21, 2012 8:08:05 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''SOO'', ''POO'') AND C_DocType.DocSubTypeSO=''RM'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@ AND C_DocType.IsSOTrx=''N''',Updated=TO_TIMESTAMP('2012-09-21 20:08:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52066 +; + +-- Sep 21, 2012 8:08:26 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''MMI'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-21 20:08:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=209 +; + +-- Sep 21, 2012 8:08:30 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''GLJ'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-21 20:08:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=102 +; + +-- Sep 21, 2012 8:08:36 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARI'', ''API'',''ARC'',''APC'') AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-21 20:08:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=173 +; + +-- Sep 21, 2012 8:08:41 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''GLD'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-21 20:08:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=121 +; + +-- Sep 21, 2012 8:08:47 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARI'', ''API'',''ARC'',''APC'') AND C_DocType.IsSOTrx=''@IsSOTrx@'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-21 20:08:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=124 +; + +SELECT register_migration_script('917_IDEMPIERE-366.sql') FROM dual +; + From e02f28f62d38e0f53467b907d48128518ef4cfa5 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 21 Sep 2012 20:39:40 -0500 Subject: [PATCH 08/79] IDEMPIERE-308 Performance: Replace use of StringBuffer and String concatenation with StringBuilder / Fix error on model generator --- .../src/org/adempiere/util/ModelInterfaceGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java b/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java index f48826c658..594c138526 100644 --- a/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java +++ b/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java @@ -649,7 +649,7 @@ public class ModelInterfaceGenerator String modelpackage = getModelPackage(entityType) ; if (modelpackage != null) { - referenceClassName = new StringBuilder(".").append(referenceClassName); + referenceClassName = new StringBuilder(modelpackage).append(".").append(referenceClassName); } if (!isGenerateModelGetterForEntity(AD_Table_ID, entityType)) { From 7b0fe332a5202806cee6b39e0bf89275a7a86681 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 21 Sep 2012 20:40:08 -0500 Subject: [PATCH 09/79] IDEMPIERE-362 Hide things that don't work on iDempiere --- .../src/org/compiere/model/I_AD_Role.java | 54 ++++---- .../src/org/compiere/model/X_AD_Role.java | 116 +++++++----------- .../pipo/handler/RoleElementHandler.java | 12 +- .../src/org/compiere/apps/AMenu.java | 24 ++-- .../src/org/compiere/apps/APanel.java | 24 ++-- .../src/org/compiere/apps/form/FormFrame.java | 8 +- .../src/org/compiere/print/Viewer.java | 24 ++-- .../adempiere/webui/dashboard/DPViews.java | 16 +-- 8 files changed, 122 insertions(+), 156 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/I_AD_Role.java b/org.adempiere.base/src/org/compiere/model/I_AD_Role.java index ab6fe4d37e..36fbd07052 100644 --- a/org.adempiere.base/src/org/compiere/model/I_AD_Role.java +++ b/org.adempiere.base/src/org/compiere/model/I_AD_Role.java @@ -18,12 +18,11 @@ package org.compiere.model; import java.math.BigDecimal; import java.sql.Timestamp; -import org.compiere.model.*; import org.compiere.util.KeyNamePair; /** Generated Interface for AD_Role * @author Adempiere (generated) - * @version 360LTS.015 + * @version Release 3.6.0LTS */ public interface I_AD_Role { @@ -36,7 +35,7 @@ public interface I_AD_Role KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); - /** AccessLevel = 6 - System - Client + /** AccessLevel = - System - Client */ BigDecimal accessLevel = BigDecimal.valueOf(6); @@ -76,6 +75,15 @@ public interface I_AD_Role */ public int getAD_Role_ID(); + /** Column name AD_Role_UU */ + public static final String COLUMNNAME_AD_Role_UU = "AD_Role_UU"; + + /** Set AD_Role_UU */ + public void setAD_Role_UU (String AD_Role_UU); + + /** Get AD_Role_UU */ + public String getAD_Role_UU(); + /** Column name AD_Tree_Menu_ID */ public static final String COLUMNNAME_AD_Tree_Menu_ID = "AD_Tree_Menu_ID"; @@ -133,24 +141,6 @@ public interface I_AD_Role /** Get Allow Info BPartner */ public boolean isAllow_Info_BPartner(); - /** Column name Allow_Info_CashJournal */ - public static final String COLUMNNAME_Allow_Info_CashJournal = "Allow_Info_CashJournal"; - - /** Set Allow Info CashJournal */ - public void setAllow_Info_CashJournal (boolean Allow_Info_CashJournal); - - /** Get Allow Info CashJournal */ - public boolean isAllow_Info_CashJournal(); - - /** Column name Allow_Info_CRP */ - public static final String COLUMNNAME_Allow_Info_CRP = "Allow_Info_CRP"; - - /** Set Allow Info CRP */ - public void setAllow_Info_CRP (boolean Allow_Info_CRP); - - /** Get Allow Info CRP */ - public boolean isAllow_Info_CRP(); - /** Column name Allow_Info_InOut */ public static final String COLUMNNAME_Allow_Info_InOut = "Allow_Info_InOut"; @@ -169,15 +159,6 @@ public interface I_AD_Role /** Get Allow Info Invoice */ public boolean isAllow_Info_Invoice(); - /** Column name Allow_Info_MRP */ - public static final String COLUMNNAME_Allow_Info_MRP = "Allow_Info_MRP"; - - /** Set Allow Info MRP */ - public void setAllow_Info_MRP (boolean Allow_Info_MRP); - - /** Get Allow Info MRP */ - public boolean isAllow_Info_MRP(); - /** Column name Allow_Info_Order */ public static final String COLUMNNAME_Allow_Info_Order = "Allow_Info_Order"; @@ -441,6 +422,19 @@ public interface I_AD_Role */ public boolean isManual(); + /** Column name IsMasterRole */ + public static final String COLUMNNAME_IsMasterRole = "IsMasterRole"; + + /** Set Master Role. + * A master role cannot be assigned to users, it is intended to define access to menu option and documents and inherit to other roles + */ + public void setIsMasterRole (boolean IsMasterRole); + + /** Get Master Role. + * A master role cannot be assigned to users, it is intended to define access to menu option and documents and inherit to other roles + */ + public boolean isMasterRole(); + /** Column name IsMenuAutoExpand */ public static final String COLUMNNAME_IsMenuAutoExpand = "IsMenuAutoExpand"; diff --git a/org.adempiere.base/src/org/compiere/model/X_AD_Role.java b/org.adempiere.base/src/org/compiere/model/X_AD_Role.java index ef96d7d83b..66072cb9b8 100644 --- a/org.adempiere.base/src/org/compiere/model/X_AD_Role.java +++ b/org.adempiere.base/src/org/compiere/model/X_AD_Role.java @@ -25,14 +25,14 @@ import org.compiere.util.KeyNamePair; /** Generated Model for AD_Role * @author Adempiere (generated) - * @version 360LTS.015 - $Id$ */ + * @version Release 3.6.0LTS - $Id$ */ public class X_AD_Role extends PO implements I_AD_Role, I_Persistent { /** * */ - private static final long serialVersionUID = 20120412L; + private static final long serialVersionUID = 20120921L; /** Standard Constructor */ public X_AD_Role (Properties ctx, int AD_Role_ID, String trxName) @@ -46,16 +46,10 @@ public class X_AD_Role extends PO implements I_AD_Role, I_Persistent setAllow_Info_Asset (true); // Y setAllow_Info_BPartner (true); -// Y - setAllow_Info_CashJournal (true); -// Y - setAllow_Info_CRP (true); // Y setAllow_Info_InOut (true); // Y setAllow_Info_Invoice (true); -// Y - setAllow_Info_MRP (true); // Y setAllow_Info_Order (true); // Y @@ -80,7 +74,10 @@ public class X_AD_Role extends PO implements I_AD_Role, I_Persistent // N setIsDiscountAllowedOnTotal (false); setIsDiscountUptoLimitPrice (false); - setIsManual (false); + setIsManual (true); +// Y + setIsMasterRole (false); +// N setIsMenuAutoExpand (false); // N setIsPersonalAccess (false); @@ -154,6 +151,20 @@ public class X_AD_Role extends PO implements I_AD_Role, I_Persistent return ii.intValue(); } + /** Set AD_Role_UU. + @param AD_Role_UU AD_Role_UU */ + public void setAD_Role_UU (String AD_Role_UU) + { + set_Value (COLUMNNAME_AD_Role_UU, AD_Role_UU); + } + + /** Get AD_Role_UU. + @return AD_Role_UU */ + public String getAD_Role_UU () + { + return (String)get_Value(COLUMNNAME_AD_Role_UU); + } + public org.compiere.model.I_AD_Tree getAD_Tree_Menu() throws RuntimeException { return (org.compiere.model.I_AD_Tree)MTable.get(getCtx(), org.compiere.model.I_AD_Tree.Table_Name) @@ -273,48 +284,6 @@ public class X_AD_Role extends PO implements I_AD_Role, I_Persistent return false; } - /** Set Allow Info CashJournal. - @param Allow_Info_CashJournal Allow Info CashJournal */ - public void setAllow_Info_CashJournal (boolean Allow_Info_CashJournal) - { - set_Value (COLUMNNAME_Allow_Info_CashJournal, Boolean.valueOf(Allow_Info_CashJournal)); - } - - /** Get Allow Info CashJournal. - @return Allow Info CashJournal */ - public boolean isAllow_Info_CashJournal () - { - Object oo = get_Value(COLUMNNAME_Allow_Info_CashJournal); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - - /** Set Allow Info CRP. - @param Allow_Info_CRP Allow Info CRP */ - public void setAllow_Info_CRP (boolean Allow_Info_CRP) - { - set_Value (COLUMNNAME_Allow_Info_CRP, Boolean.valueOf(Allow_Info_CRP)); - } - - /** Get Allow Info CRP. - @return Allow Info CRP */ - public boolean isAllow_Info_CRP () - { - Object oo = get_Value(COLUMNNAME_Allow_Info_CRP); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - /** Set Allow Info InOut. @param Allow_Info_InOut Allow Info InOut */ public void setAllow_Info_InOut (boolean Allow_Info_InOut) @@ -357,27 +326,6 @@ public class X_AD_Role extends PO implements I_AD_Role, I_Persistent return false; } - /** Set Allow Info MRP. - @param Allow_Info_MRP Allow Info MRP */ - public void setAllow_Info_MRP (boolean Allow_Info_MRP) - { - set_Value (COLUMNNAME_Allow_Info_MRP, Boolean.valueOf(Allow_Info_MRP)); - } - - /** Get Allow Info MRP. - @return Allow Info MRP */ - public boolean isAllow_Info_MRP () - { - Object oo = get_Value(COLUMNNAME_Allow_Info_MRP); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - /** Set Allow Info Order. @param Allow_Info_Order Allow Info Order */ public void setAllow_Info_Order (boolean Allow_Info_Order) @@ -822,6 +770,30 @@ public class X_AD_Role extends PO implements I_AD_Role, I_Persistent return false; } + /** Set Master Role. + @param IsMasterRole + A master role cannot be assigned to users, it is intended to define access to menu option and documents and inherit to other roles + */ + public void setIsMasterRole (boolean IsMasterRole) + { + set_Value (COLUMNNAME_IsMasterRole, Boolean.valueOf(IsMasterRole)); + } + + /** Get Master Role. + @return A master role cannot be assigned to users, it is intended to define access to menu option and documents and inherit to other roles + */ + public boolean isMasterRole () + { + Object oo = get_Value(COLUMNNAME_IsMasterRole); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + /** Set Auto expand menu. @param IsMenuAutoExpand If ticked, the menu is automatically expanded diff --git a/org.adempiere.pipo.legacy/src/org/adempiere/pipo/handler/RoleElementHandler.java b/org.adempiere.pipo.legacy/src/org/adempiere/pipo/handler/RoleElementHandler.java index 319856ce80..c992ba168b 100644 --- a/org.adempiere.pipo.legacy/src/org/adempiere/pipo/handler/RoleElementHandler.java +++ b/org.adempiere.pipo.legacy/src/org/adempiere/pipo/handler/RoleElementHandler.java @@ -173,7 +173,7 @@ public class RoleElementHandler extends AbstractElementHandler { m_Role.setAllow_Info_Account(Boolean.valueOf(atts.getValue("AllowInfoAccount"))); m_Role.setAllow_Info_Asset(Boolean.valueOf(atts.getValue("AllowInfoAsset"))); m_Role.setAllow_Info_BPartner(Boolean.valueOf(atts.getValue("AllowInfoBPartner"))); - m_Role.setAllow_Info_CashJournal(Boolean.valueOf(atts.getValue("AllowInfoCashJournal"))); + // m_Role.setAllow_Info_CashJournal(Boolean.valueOf(atts.getValue("AllowInfoCashJournal"))); m_Role.setAllow_Info_InOut(Boolean.valueOf(atts.getValue("AllowInfoInOut"))); m_Role.setAllow_Info_Invoice(Boolean.valueOf(atts.getValue("AllowInfoInvoice"))); m_Role.setAllow_Info_Order(Boolean.valueOf(atts.getValue("AllowInfoOrder"))); @@ -181,8 +181,8 @@ public class RoleElementHandler extends AbstractElementHandler { m_Role.setAllow_Info_Product(Boolean.valueOf(atts.getValue("AllowInfoProduct"))); m_Role.setAllow_Info_Resource(Boolean.valueOf(atts.getValue("AllowInfoResource"))); m_Role.setAllow_Info_Schedule(Boolean.valueOf(atts.getValue("AllowInfoSchedule"))); - m_Role.setAllow_Info_Schedule(Boolean.valueOf(atts.getValue("AllowInfoCRP"))); - m_Role.setAllow_Info_Schedule(Boolean.valueOf(atts.getValue("AllowInfoMRP"))); + //m_Role.setAllow_Info_CRP(Boolean.valueOf(atts.getValue("AllowInfoCRP"))); + //m_Role.setAllow_Info_MRP(Boolean.valueOf(atts.getValue("AllowInfoMRP"))); if (m_Role.save(getTrxName(ctx)) == true) { @@ -504,7 +504,7 @@ public class RoleElementHandler extends AbstractElementHandler { atts.addAttribute("", "", "AllowInfoAccount", "CDATA", Boolean.toString(m_Role.isAllow_Info_Account())); atts.addAttribute("", "", "AllowInfoAsset", "CDATA", Boolean.toString(m_Role.isAllow_Info_Asset())); atts.addAttribute("", "", "AllowInfoBPartner", "CDATA", Boolean.toString(m_Role.isAllow_Info_BPartner())); - atts.addAttribute("", "", "AllowInfoCashJournal", "CDATA", Boolean.toString(m_Role.isAllow_Info_CashJournal())); + // atts.addAttribute("", "", "AllowInfoCashJournal", "CDATA", Boolean.toString(m_Role.isAllow_Info_CashJournal())); atts.addAttribute("", "", "AllowInfoInOut", "CDATA", Boolean.toString(m_Role.isAllow_Info_InOut())); atts.addAttribute("", "", "AllowInfoInvoice", "CDATA", Boolean.toString(m_Role.isAllow_Info_Invoice())); atts.addAttribute("", "", "AllowInfoOrder", "CDATA", Boolean.toString(m_Role.isAllow_Info_Order())); @@ -512,8 +512,8 @@ public class RoleElementHandler extends AbstractElementHandler { atts.addAttribute("", "", "AllowInfoProduct", "CDATA", Boolean.toString(m_Role.isAllow_Info_Product())); atts.addAttribute("", "", "AllowInfoResource", "CDATA", Boolean.toString(m_Role.isAllow_Info_Resource())); atts.addAttribute("", "", "AllowInfoSchedule", "CDATA", Boolean.toString(m_Role.isAllow_Info_Schedule())); - atts.addAttribute("", "", "AllowInfoCRP", "CDATA", Boolean.toString(m_Role.isAllow_Info_CRP())); - atts.addAttribute("", "", "AllowInfoMRP", "CDATA", Boolean.toString(m_Role.isAllow_Info_MRP())); + // atts.addAttribute("", "", "AllowInfoCRP", "CDATA", Boolean.toString(m_Role.isAllow_Info_CRP())); + // atts.addAttribute("", "", "AllowInfoMRP", "CDATA", Boolean.toString(m_Role.isAllow_Info_MRP())); return atts; } diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/AMenu.java b/org.adempiere.ui.swing/src/org/compiere/apps/AMenu.java index d778e761e0..5c14a1df1c 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/AMenu.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/AMenu.java @@ -453,14 +453,14 @@ public final class AMenu extends CFrame AEnv.addMenuItem("InfoSchedule", null, null, mView, this); } //FR [ 1966328 ] - if (MRole.getDefault().isAllow_Info_MRP()) - { - AEnv.addMenuItem("InfoMRP", "Info", null, mView, this); - } - if (MRole.getDefault().isAllow_Info_CRP()) - { - AEnv.addMenuItem("InfoCRP", "Info", null, mView, this); - } +// if (MRole.getDefault().isAllow_Info_MRP()) +// { +// AEnv.addMenuItem("InfoMRP", "Info", null, mView, this); +// } +// if (MRole.getDefault().isAllow_Info_CRP()) +// { +// AEnv.addMenuItem("InfoCRP", "Info", null, mView, this); +// } mView.addSeparator(); if (MRole.getDefault().isAllow_Info_Order()) { @@ -478,10 +478,10 @@ public final class AMenu extends CFrame { AEnv.addMenuItem("InfoPayment", "Info", null, mView, this); } - if (MRole.getDefault().isAllow_Info_CashJournal()) - { - AEnv.addMenuItem("InfoCashLine", "Info", null, mView, this); - } +// if (MRole.getDefault().isAllow_Info_CashJournal()) +// { +// AEnv.addMenuItem("InfoCashLine", "Info", null, mView, this); +// } if (MRole.getDefault().isAllow_Info_Resource()) { AEnv.addMenuItem("InfoAssignment", "Info", null, mView, this); diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/APanel.java b/org.adempiere.ui.swing/src/org/compiere/apps/APanel.java index 4edaa405bd..6474485315 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/APanel.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/APanel.java @@ -387,14 +387,14 @@ public final class APanel extends CPanel AEnv.addMenuItem("InfoSchedule", null, null, mView, this); } //FR [ 1966328 ] - if (MRole.getDefault().isAllow_Info_MRP()) - { - AEnv.addMenuItem("InfoMRP", "Info", null, mView, this); - } - if (MRole.getDefault().isAllow_Info_CRP()) - { - AEnv.addMenuItem("InfoCRP", "Info", null, mView, this); - } +// if (MRole.getDefault().isAllow_Info_MRP()) +// { +// AEnv.addMenuItem("InfoMRP", "Info", null, mView, this); +// } +// if (MRole.getDefault().isAllow_Info_CRP()) +// { +// AEnv.addMenuItem("InfoCRP", "Info", null, mView, this); +// } mView.addSeparator(); if (MRole.getDefault().isAllow_Info_Order()) { @@ -412,10 +412,10 @@ public final class APanel extends CPanel { AEnv.addMenuItem("InfoPayment", "Info", null, mView, this); } - if (MRole.getDefault().isAllow_Info_CashJournal()) - { - AEnv.addMenuItem("InfoCashLine", "Info", null, mView, this); - } +// if (MRole.getDefault().isAllow_Info_CashJournal()) +// { +// AEnv.addMenuItem("InfoCashLine", "Info", null, mView, this); +// } if (MRole.getDefault().isAllow_Info_Resource()) { AEnv.addMenuItem("InfoAssignment", "Info", null, mView, this); diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/FormFrame.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/FormFrame.java index cb74544c3e..48dd5fb435 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/FormFrame.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/form/FormFrame.java @@ -190,10 +190,10 @@ public class FormFrame extends CFrame { AEnv.addMenuItem("InfoPayment", "Info", null, mView, this); } - if (MRole.getDefault().isAllow_Info_CashJournal()) - { - AEnv.addMenuItem("InfoCashLine", "Info", null, mView, this); - } +// if (MRole.getDefault().isAllow_Info_CashJournal()) +// { +// AEnv.addMenuItem("InfoCashLine", "Info", null, mView, this); +// } if (MRole.getDefault().isAllow_Info_Resource()) { AEnv.addMenuItem("InfoAssignment", "Info", null, mView, this); diff --git a/org.adempiere.ui.swing/src/org/compiere/print/Viewer.java b/org.adempiere.ui.swing/src/org/compiere/print/Viewer.java index 09edc4e2df..189c138db9 100644 --- a/org.adempiere.ui.swing/src/org/compiere/print/Viewer.java +++ b/org.adempiere.ui.swing/src/org/compiere/print/Viewer.java @@ -543,14 +543,14 @@ public class Viewer extends CFrame AEnv.addMenuItem("InfoSchedule", null, null, mView, this); } //FR [ 1966328 ] - if (MRole.getDefault().isAllow_Info_MRP()) - { - AEnv.addMenuItem("InfoMRP", "Info", null, mView, this); - } - if (MRole.getDefault().isAllow_Info_CRP()) - { - AEnv.addMenuItem("InfoCRP", "Info", null, mView, this); - } +// if (MRole.getDefault().isAllow_Info_MRP()) +// { +// AEnv.addMenuItem("InfoMRP", "Info", null, mView, this); +// } +// if (MRole.getDefault().isAllow_Info_CRP()) +// { +// AEnv.addMenuItem("InfoCRP", "Info", null, mView, this); +// } mView.addSeparator(); if (MRole.getDefault().isAllow_Info_Order()) { @@ -568,10 +568,10 @@ public class Viewer extends CFrame { AEnv.addMenuItem("InfoPayment", "Info", null, mView, this); } - if (MRole.getDefault().isAllow_Info_CashJournal()) - { - AEnv.addMenuItem("InfoCashLine", "Info", null, mView, this); - } +// if (MRole.getDefault().isAllow_Info_CashJournal()) +// { +// AEnv.addMenuItem("InfoCashLine", "Info", null, mView, this); +// } if (MRole.getDefault().isAllow_Info_Resource()) { AEnv.addMenuItem("InfoAssignment", "Info", null, mView, this); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPViews.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPViews.java index d903f0d438..86e4bd5104 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPViews.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPViews.java @@ -116,14 +116,14 @@ public class DPViews extends DashboardPanel implements EventListener { btnViewItem.addEventListener(Events.ON_CLICK, this); vbox.appendChild(btnViewItem); } - if (MRole.getDefault().isAllow_Info_CashJournal()) - { - ToolBarButton btnViewItem = new ToolBarButton("InfoCashLine"); - btnViewItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "InfoCashLine"))); - btnViewItem.setImage("/images/Info16.png"); - btnViewItem.addEventListener(Events.ON_CLICK, this); - vbox.appendChild(btnViewItem); - } +// if (MRole.getDefault().isAllow_Info_CashJournal()) +// { +// ToolBarButton btnViewItem = new ToolBarButton("InfoCashLine"); +// btnViewItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "InfoCashLine"))); +// btnViewItem.setImage("/images/Info16.png"); +// btnViewItem.addEventListener(Events.ON_CLICK, this); +// vbox.appendChild(btnViewItem); +// } if (MRole.getDefault().isAllow_Info_Resource()) { ToolBarButton btnViewItem = new ToolBarButton("InfoAssignment"); From a9ba8f51ecdee27a9043cd8151e09f3eeadbe4ca Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 21 Sep 2012 21:24:43 -0500 Subject: [PATCH 10/79] IDEMPIERE-436 AdempiereActivator is not able to run 2Pack --- .../src/org/adempiere/plugin/utils/AdempiereActivator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/AdempiereActivator.java b/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/AdempiereActivator.java index 7ae0a580a9..75296cb2ec 100644 --- a/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/AdempiereActivator.java +++ b/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/AdempiereActivator.java @@ -62,12 +62,12 @@ public class AdempiereActivator implements BundleActivator { } protected void packIn(String trxName) { - URL packout = this.getClass().getClassLoader().getResource("/META-INF/2Pack.zip"); + URL packout = context.getBundle().getEntry("/META-INF/2Pack.zip"); if (packout != null) { IDictionaryService service = Service.locate(IDictionaryService.class); try { // copy the resource to a temporary file to process it with 2pack - InputStream stream = this.getClass().getResourceAsStream("/META-INF/2Pack.zip"); + InputStream stream = context.getBundle().getEntry("/META-INF/2Pack.zip").openStream(); File zipfile = File.createTempFile(getName(), ".zip"); FileOutputStream zipstream = new FileOutputStream(zipfile); byte[] buffer = new byte[1024]; From 1ab3ea6f0033b4d9ac3032b203da95b11e0bcf83 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 24 Sep 2012 15:44:28 -0500 Subject: [PATCH 11/79] IDEMPIERE-207 GL Journal Generator --- .../oracle/918_IDEMPIERE-207.sql | 1509 +++++++++++++++++ .../postgresql/918_IDEMPIERE-207.sql | 1509 +++++++++++++++++ .../compiere/model/I_GL_JournalGenerator.java | 255 +++ .../model/I_GL_JournalGeneratorLine.java | 274 +++ .../model/I_GL_JournalGeneratorSource.java | 203 +++ .../org/compiere/model/MJournalGenerator.java | 87 + .../compiere/model/MJournalGeneratorLine.java | 86 + .../model/MJournalGeneratorSource.java | 69 + .../compiere/model/X_GL_JournalGenerator.java | 344 ++++ .../model/X_GL_JournalGeneratorLine.java | 396 +++++ .../model/X_GL_JournalGeneratorSource.java | 246 +++ .../globalqss/process/GLJournalGenerate.java | 538 ++++++ 12 files changed, 5516 insertions(+) create mode 100644 migration/360lts-release/oracle/918_IDEMPIERE-207.sql create mode 100644 migration/360lts-release/postgresql/918_IDEMPIERE-207.sql create mode 100644 org.adempiere.base/src/org/compiere/model/I_GL_JournalGenerator.java create mode 100644 org.adempiere.base/src/org/compiere/model/I_GL_JournalGeneratorLine.java create mode 100644 org.adempiere.base/src/org/compiere/model/I_GL_JournalGeneratorSource.java create mode 100644 org.adempiere.base/src/org/compiere/model/MJournalGenerator.java create mode 100644 org.adempiere.base/src/org/compiere/model/MJournalGeneratorLine.java create mode 100644 org.adempiere.base/src/org/compiere/model/MJournalGeneratorSource.java create mode 100644 org.adempiere.base/src/org/compiere/model/X_GL_JournalGenerator.java create mode 100644 org.adempiere.base/src/org/compiere/model/X_GL_JournalGeneratorLine.java create mode 100644 org.adempiere.base/src/org/compiere/model/X_GL_JournalGeneratorSource.java create mode 100644 org.adempiere.base/src/org/globalqss/process/GLJournalGenerate.java diff --git a/migration/360lts-release/oracle/918_IDEMPIERE-207.sql b/migration/360lts-release/oracle/918_IDEMPIERE-207.sql new file mode 100644 index 0000000000..753e713c9f --- /dev/null +++ b/migration/360lts-release/oracle/918_IDEMPIERE-207.sql @@ -0,0 +1,1509 @@ +-- Sep 24, 2012 12:16:27 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO AD_Window (AD_Window_ID,WindowType,IsSOTrx,IsDefault,IsBetaFunctionality,EntityType,Name,IsActive,Created,UpdatedBy,CreatedBy,Updated,AD_Org_ID,AD_Client_ID,Processing) VALUES (200013,'M','Y','N','N','D','GL Journal Generator','Y',TO_DATE('2012-09-24 12:16:25','YYYY-MM-DD HH24:MI:SS'),100,100,TO_DATE('2012-09-24 12:16:25','YYYY-MM-DD HH24:MI:SS'),0,0,'N') +; + +-- Sep 24, 2012 12:16:27 PM COT +INSERT INTO AD_Window_Trl (AD_Language,AD_Window_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Window_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Window t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Window_ID=200013 AND NOT EXISTS (SELECT * FROM AD_Window_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Window_ID=t.AD_Window_ID) +; + +-- Sep 24, 2012 12:16:28 PM COT +INSERT INTO AD_Table (IsSecurityEnabled,AccessLevel,AD_Window_ID,AD_Table_ID,IsHighVolume,ImportTable,IsView,IsChangeLog,EntityType,IsDeleteable,ReplicationType,TableName,Name,AD_Client_ID,IsActive,AD_Org_ID,CreatedBy,Updated,UpdatedBy,Created) VALUES ('N','3',200013,200021,'N','N','N','Y','D','Y','L','GL_JournalGenerator','GL Journal Generator',0,'Y',0,100,TO_DATE('2012-09-24 12:16:27','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2012-09-24 12:16:27','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:28 PM COT +INSERT INTO AD_Table_Trl (AD_Language,AD_Table_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Table_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Table t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Table_ID=200021 AND NOT EXISTS (SELECT * FROM AD_Table_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Table_ID=t.AD_Table_ID) +; + +-- Sep 24, 2012 12:16:28 PM COT +INSERT INTO AD_Sequence (IncrementNo,StartNewYear,CurrentNextSys,IsTableID,StartNo,CurrentNext,IsAudited,IsAutoSequence,AD_Sequence_ID,Description,Name,AD_Org_ID,AD_Client_ID,Updated,UpdatedBy,Created,CreatedBy,IsActive) VALUES (1,'N',200000,'Y',1000000,1000000,'N','Y',200021,'Table GL_JournalGenerator','GL_JournalGenerator',0,0,TO_DATE('2012-09-24 12:16:28','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2012-09-24 12:16:28','YYYY-MM-DD HH24:MI:SS'),100,'Y') +; + +-- Sep 24, 2012 12:16:29 PM COT +INSERT INTO AD_Element (AD_Element_ID,ColumnName,EntityType,Name,PrintName,AD_Client_ID,Created,Updated,IsActive,AD_Org_ID,CreatedBy,UpdatedBy) VALUES (200134,'GL_JournalGenerator_ID','D','GL Journal Generator','GL Journal Generator',0,TO_DATE('2012-09-24 12:16:28','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-24 12:16:28','YYYY-MM-DD HH24:MI:SS'),'Y',0,100,100) +; + +-- Sep 24, 2012 12:16:29 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,PO_Name,Name,Description,PrintName,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.PO_Name,t.Name,t.Description,t.PrintName,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200134 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 12:16:30 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200494,200021,'D',1,'Y','N','N','N',22,'N',13,'Y','Y',200134,'N','N','N','GL_JournalGenerator_ID','GL Journal Generator',100,TO_DATE('2012-09-24 12:16:29','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:16:29','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:30 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200494 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:30 PM COT +CREATE TABLE GL_JournalGenerator (GL_JournalGenerator_ID NUMBER(10) NOT NULL, CONSTRAINT GL_JournalGenerator_Key PRIMARY KEY (GL_JournalGenerator_ID)) +; + +-- Sep 24, 2012 12:16:30 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('@#AD_Client_ID@',200495,200021,'D',1,'Y','N','N','A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','N',22,'N',19,'Y','N',102,'N','N','N','AD_Client_ID','Client/Tenant for this installation.','Client',100,TO_DATE('2012-09-24 12:16:30','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:16:30','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:30 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200495 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:30 PM COT +ALTER TABLE GL_JournalGenerator ADD AD_Client_ID NUMBER(10) NOT NULL +; + +-- Sep 24, 2012 12:16:31 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,AD_Val_Rule_ID,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('@#AD_Org_ID@',200496,200021,'D',1,'Y','N','N','An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','N',22,'N',19,'Y',104,'N',113,'N','N','N','AD_Org_ID','Organizational entity within client','Organization',100,TO_DATE('2012-09-24 12:16:31','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:16:31','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:31 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200496 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:31 PM COT +ALTER TABLE GL_JournalGenerator ADD AD_Org_ID NUMBER(10) NOT NULL +; + +-- Sep 24, 2012 12:16:32 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200497,200021,'D',1,'Y','N','N','The Created field indicates the date that this record was created.','N',7,'N',16,'Y','N',245,'N','N','N','Created','Date this record was created','Created',100,TO_DATE('2012-09-24 12:16:31','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:16:31','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:32 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200497 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:32 PM COT +ALTER TABLE GL_JournalGenerator ADD Created DATE NOT NULL +; + +-- Sep 24, 2012 12:16:32 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200498,200021,'D',1,110,'Y','N','N','The Created By field indicates the user who created this record.','N',22,'N',18,'Y','N',246,'N','N','N','CreatedBy','User who created this records','Created By',100,TO_DATE('2012-09-24 12:16:32','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:16:32','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:32 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200498 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:32 PM COT +ALTER TABLE GL_JournalGenerator ADD CreatedBy NUMBER(10) NOT NULL +; + +-- Sep 24, 2012 12:16:33 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200499,200021,'D',1,'N','N','N','A description is limited to 255 characters.','N',255,'Y',10,'Y','N',275,'N','Y','N','Description','Optional short description of the record','Description',100,TO_DATE('2012-09-24 12:16:32','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:16:32','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:33 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200499 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:33 PM COT +ALTER TABLE GL_JournalGenerator ADD Description NVARCHAR2(255) DEFAULT NULL +; + +-- Sep 24, 2012 12:16:33 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200500,200021,'D',1,'N','N','N','The Help field contains a hint, comment or help about the use of this item.','N',2000,'N',14,'Y','N',326,'N','Y','N','Help','Comment or Hint','Comment/Help',100,TO_DATE('2012-09-24 12:16:33','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:16:33','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:33 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200500 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:33 PM COT +ALTER TABLE GL_JournalGenerator ADD Help NVARCHAR2(2000) DEFAULT NULL +; + +-- Sep 24, 2012 12:16:34 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('Y',200501,200021,'D',1,'Y','N','N','There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports. +There are two reasons for de-activating and not deleting records: +(1) The system requires the record for audit purposes. +(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','N',1,'N',20,'Y','N',348,'N','Y','N','IsActive','The record is active in the system','Active',100,TO_DATE('2012-09-24 12:16:34','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:16:34','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:34 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200501 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:34 PM COT +ALTER TABLE GL_JournalGenerator ADD IsActive CHAR(1) DEFAULT 'Y' CHECK (IsActive IN ('Y','N')) NOT NULL +; + +-- Sep 24, 2012 12:16:35 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,SeqNo,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200502,200021,'D',1,'Y','N','Y',1,'The name of an entity (record) is used as an default search option in addition to the search key. The name is up to 60 characters in length.','N',60,'Y',10,'Y','N',469,'N','Y','N','Name','Alphanumeric identifier of the entity','Name',100,TO_DATE('2012-09-24 12:16:34','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:16:34','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:35 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200502 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:35 PM COT +ALTER TABLE GL_JournalGenerator ADD Name NVARCHAR2(60) NOT NULL +; + +-- Sep 24, 2012 12:16:36 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200503,200021,'D',1,'Y','N','N','The Updated field indicates the date that this record was updated.','N',7,'N',16,'Y','N',607,'N','N','N','Updated','Date this record was updated','Updated',100,TO_DATE('2012-09-24 12:16:35','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:16:35','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:36 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200503 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:36 PM COT +ALTER TABLE GL_JournalGenerator ADD Updated DATE NOT NULL +; + +-- Sep 24, 2012 12:16:36 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200504,200021,'D',1,110,'Y','N','N','The Updated By field indicates the user who updated this record.','N',22,'N',18,'Y','N',608,'N','N','N','UpdatedBy','User who updated this records','Updated By',100,TO_DATE('2012-09-24 12:16:36','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:16:36','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:36 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200504 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:36 PM COT +ALTER TABLE GL_JournalGenerator ADD UpdatedBy NUMBER(10) NOT NULL +; + +-- Sep 24, 2012 12:16:37 PM COT +INSERT INTO AD_Element (AD_Element_ID,ColumnName,EntityType,Name,PrintName,AD_Client_ID,Created,Updated,IsActive,AD_Org_ID,CreatedBy,UpdatedBy) VALUES (200135,'C_ElementValueAdjustDR_ID','D','Account Adjust DR','Account Adjust DR',0,TO_DATE('2012-09-24 12:16:36','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-24 12:16:36','YYYY-MM-DD HH24:MI:SS'),'Y',0,100,100) +; + +-- Sep 24, 2012 12:16:37 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,PO_Name,Name,Description,PrintName,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.PO_Name,t.Name,t.Description,t.PrintName,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200135 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 12:16:37 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,AD_Val_Rule_ID,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200505,200021,'D',0,362,'N','N','N','N',10,'N',18,'Y',252,'N',200135,'N','Y','N','C_ElementValueAdjustDR_ID','Account Adjust DR',100,TO_DATE('2012-09-24 12:16:37','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:16:37','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:37 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200505 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:37 PM COT +ALTER TABLE GL_JournalGenerator ADD C_ElementValueAdjustDR_ID NUMBER(10) DEFAULT NULL +; + +-- Sep 24, 2012 12:16:38 PM COT +INSERT INTO AD_Element (AD_Element_ID,ColumnName,EntityType,Name,PrintName,AD_Client_ID,Created,Updated,IsActive,AD_Org_ID,CreatedBy,UpdatedBy) VALUES (200136,'C_ElementValueAdjustCR_ID','D','Account Adjust CR','Account Adjust CR',0,TO_DATE('2012-09-24 12:16:37','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-24 12:16:37','YYYY-MM-DD HH24:MI:SS'),'Y',0,100,100) +; + +-- Sep 24, 2012 12:16:38 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,PO_Name,Name,Description,PrintName,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.PO_Name,t.Name,t.Description,t.PrintName,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200136 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 12:16:38 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,AD_Val_Rule_ID,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200506,200021,'D',0,362,'N','N','N','N',10,'N',18,'Y',252,'N',200136,'N','Y','N','C_ElementValueAdjustCR_ID','Account Adjust CR',100,TO_DATE('2012-09-24 12:16:38','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:16:38','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:38 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200506 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:38 PM COT +ALTER TABLE GL_JournalGenerator ADD C_ElementValueAdjustCR_ID NUMBER(10) DEFAULT NULL +; + +-- Sep 24, 2012 12:16:39 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,AD_Val_Rule_ID,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200507,200021,'D',0,'N','N','N','The Document Type determines document sequence and processing rules','N',10,'N',19,'Y',102,'N',196,'N','Y','N','C_DocType_ID','Document type or rules','Document Type',100,TO_DATE('2012-09-24 12:16:39','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:16:39','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:39 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200507 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:39 PM COT +ALTER TABLE GL_JournalGenerator ADD C_DocType_ID NUMBER(10) DEFAULT NULL +; + +-- Sep 24, 2012 12:16:40 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,AD_Val_Rule_ID,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('@GL_Category_ID@',200508,200021,'D',0,'N','N','N','The General Ledger Category is an optional, user defined method of grouping journal lines.','N',10,'N',19,'Y',118,'N',309,'N','Y','N','GL_Category_ID','General Ledger Category','GL Category',100,TO_DATE('2012-09-24 12:16:39','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:16:39','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:40 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200508 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:40 PM COT +ALTER TABLE GL_JournalGenerator ADD GL_Category_ID NUMBER(10) DEFAULT NULL +; + +-- Sep 24, 2012 12:16:40 PM COT +INSERT INTO AD_Element (AD_Element_ID,ColumnName,EntityType,Name,PrintName,AD_Client_ID,Created,Updated,IsActive,AD_Org_ID,CreatedBy,UpdatedBy) VALUES (200137,'GenerateGLJournal','D','Generate GL Journal','Generate GL Journal',0,TO_DATE('2012-09-24 12:16:40','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-24 12:16:40','YYYY-MM-DD HH24:MI:SS'),'Y',0,100,100) +; + +-- Sep 24, 2012 12:16:40 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,PO_Name,Name,Description,PrintName,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.PO_Name,t.Name,t.Description,t.PrintName,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200137 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 12:16:41 PM COT +INSERT INTO AD_Process (AD_Process_ID,IsDirectPrint,IsReport,AccessLevel,IsBetaFunctionality,WorkflowValue,ShowHelp,EntityType,Statistic_Seconds,Statistic_Count,Classname,Value,Name,AD_Org_ID,AD_Client_ID,Updated,UpdatedBy,CreatedBy,Created,IsActive) VALUES (200010,'N','N','3','N',NULL,'Y','D',0,0,'org.globalqss.process.GLJournalGenerate','GLJournalGenerate','Generate GL Journal',0,0,TO_DATE('2012-09-24 12:16:40','YYYY-MM-DD HH24:MI:SS'),100,100,TO_DATE('2012-09-24 12:16:40','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 24, 2012 12:16:41 PM COT +INSERT INTO AD_Process_Trl (AD_Language,AD_Process_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_ID=200010 AND NOT EXISTS (SELECT * FROM AD_Process_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_ID=t.AD_Process_ID) +; + +-- Sep 24, 2012 12:16:42 PM COT +INSERT INTO AD_Process_Para (IsRange,AD_Process_Para_ID,FieldLength,AD_Process_ID,IsCentrallyMaintained,DefaultValue2,AD_Reference_ID,SeqNo,IsMandatory,DefaultValue,AD_Element_ID,EntityType,Name,ColumnName,IsActive,AD_Client_ID,UpdatedBy,Updated,CreatedBy,Created,AD_Org_ID) VALUES ('Y',200036,10,200010,'Y','@SQL=SELECT firstof(SYSDATE,''MM'')-1 FROM DUAL',15,10,'Y','@SQL=SELECT firstof(add_months(SYSDATE,-1),''MM'') FROM DUAL',1479,'D','Processing date','ProcessingDate','Y',0,100,TO_DATE('2012-09-24 12:16:41','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2012-09-24 12:16:41','YYYY-MM-DD HH24:MI:SS'),0) +; + +-- Sep 24, 2012 12:16:42 PM COT +INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=200036 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID) +; + +-- Sep 24, 2012 12:16:42 PM COT +INSERT INTO AD_Process_Para (IsRange,AD_Process_Para_ID,FieldLength,Help,AD_Process_ID,IsCentrallyMaintained,AD_Reference_ID,SeqNo,IsMandatory,DefaultValue,AD_Element_ID,EntityType,Name,ColumnName,Description,IsActive,AD_Client_ID,UpdatedBy,Updated,CreatedBy,Created,AD_Org_ID) VALUES ('N',200037,10,'The Accounting Date indicates the date to be used on the General Ledger account entries generated from this document. It is also used for any currency conversion.',200010,'Y',15,20,'Y','@#Date@',263,'D','Account Date','DateAcct','Accounting Date','Y',0,100,TO_DATE('2012-09-24 12:16:42','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2012-09-24 12:16:42','YYYY-MM-DD HH24:MI:SS'),0) +; + +-- Sep 24, 2012 12:16:42 PM COT +INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=200037 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID) +; + +-- Sep 24, 2012 12:16:43 PM COT +INSERT INTO AD_Process_Para (IsRange,AD_Process_Para_ID,FieldLength,AD_Process_ID,IsCentrallyMaintained,AD_Reference_ID,SeqNo,IsMandatory,DefaultValue,AD_Element_ID,EntityType,Name,ColumnName,Description,IsActive,AD_Client_ID,UpdatedBy,Updated,CreatedBy,Created,AD_Org_ID) VALUES ('N',200038,10,200010,'Y',20,30,'Y','Y',1667,'D','Simulation','IsSimulation','Performing the function is only simulated','Y',0,100,TO_DATE('2012-09-24 12:16:42','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2012-09-24 12:16:42','YYYY-MM-DD HH24:MI:SS'),0) +; + +-- Sep 24, 2012 12:16:43 PM COT +INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=200038 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID) +; + +-- Sep 24, 2012 12:16:43 PM COT +INSERT INTO AD_Process_Para (IsRange,AD_Process_Para_ID,FieldLength,Help,AD_Process_ID,IsCentrallyMaintained,AD_Reference_ID,AD_Val_Rule_ID,SeqNo,IsMandatory,AD_Reference_Value_ID,AD_Element_ID,EntityType,Name,ColumnName,Description,IsActive,AD_Client_ID,UpdatedBy,Updated,CreatedBy,Created,AD_Org_ID) VALUES ('N',200039,10,'You find the current status in the Document Status field. The options are listed in a popup',200010,'Y',17,219,40,'N',135,287,'D','Document Action','DocAction','The targeted status of the document','Y',0,100,TO_DATE('2012-09-24 12:16:43','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2012-09-24 12:16:43','YYYY-MM-DD HH24:MI:SS'),0) +; + +-- Sep 24, 2012 12:16:43 PM COT +INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=200039 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID) +; + +-- Sep 24, 2012 12:16:44 PM COT +INSERT INTO AD_Process_Para (IsRange,AD_Process_Para_ID,FieldLength,Help,AD_Process_ID,IsCentrallyMaintained,AD_Reference_ID,SeqNo,IsMandatory,AD_Element_ID,EntityType,Name,ColumnName,Description,IsActive,AD_Client_ID,UpdatedBy,Updated,CreatedBy,Created,AD_Org_ID) VALUES ('N',200040,30,'The document number is usually automatically generated by the system and determined by the document type of the document. If the document is not saved, the preliminary number is displayed in "<>".',200010,'Y',10,50,'N',290,'D','Document No','DocumentNo','Document sequence number of the document','Y',0,100,TO_DATE('2012-09-24 12:16:43','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2012-09-24 12:16:43','YYYY-MM-DD HH24:MI:SS'),0) +; + +-- Sep 24, 2012 12:16:44 PM COT +INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=200040 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID) +; + +-- Sep 24, 2012 12:16:44 PM COT +INSERT INTO AD_Process_Para (IsRange,AD_Process_Para_ID,FieldLength,Help,AD_Process_ID,IsCentrallyMaintained,AD_Reference_ID,SeqNo,IsMandatory,AD_Reference_Value_ID,AD_Element_ID,EntityType,Name,ColumnName,Description,IsActive,AD_Client_ID,UpdatedBy,Updated,CreatedBy,Created,AD_Org_ID) VALUES ('N',200041,10,'A Business Partner is anyone with whom you transact. This can include Vendor, Customer, Employee or Salesperson',200010,'Y',30,60,'N',138,187,'D','Business Partner ','C_BPartner_ID','Identifies a Business Partner','Y',0,100,TO_DATE('2012-09-24 12:16:44','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2012-09-24 12:16:44','YYYY-MM-DD HH24:MI:SS'),0) +; + +-- Sep 24, 2012 12:16:44 PM COT +INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=200041 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID) +; + +-- Sep 24, 2012 12:16:45 PM COT +INSERT INTO AD_Process_Para (IsRange,AD_Process_Para_ID,FieldLength,Help,AD_Process_ID,IsCentrallyMaintained,AD_Reference_ID,SeqNo,IsMandatory,AD_Reference_Value_ID,AD_Element_ID,EntityType,Name,ColumnName,Description,IsActive,AD_Client_ID,UpdatedBy,Updated,CreatedBy,Created,AD_Org_ID) VALUES ('N',200042,10,'Identifies an item which is either purchased or sold in this organization.',200010,'Y',30,70,'N',162,454,'D','Product','M_Product_ID','Product, Service, Item','Y',0,100,TO_DATE('2012-09-24 12:16:44','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2012-09-24 12:16:44','YYYY-MM-DD HH24:MI:SS'),0) +; + +-- Sep 24, 2012 12:16:45 PM COT +INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=200042 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID) +; + +-- Sep 24, 2012 12:16:46 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,AD_Process_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200509,200021,'D',0,'N','N','N','N',10,'N',28,'Y','N',200137,200010,'N','Y','N','GenerateGLJournal','Generate GL Journal',100,TO_DATE('2012-09-24 12:16:45','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:16:45','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:46 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200509 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:46 PM COT +ALTER TABLE GL_JournalGenerator ADD GenerateGLJournal CHAR(10) DEFAULT NULL +; + +-- Sep 24, 2012 12:16:47 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('@$C_AcctSchema_ID@',200510,200021,'D',0,'N','N','N','An Accounting Schema defines the rules used in accounting such as costing method, currency and calendar','N',22,'N',19,'Y','N',181,'N','Y','N','C_AcctSchema_ID','Rules for accounting','Accounting Schema',100,TO_DATE('2012-09-24 12:16:46','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:16:46','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:47 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200510 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:47 PM COT +ALTER TABLE GL_JournalGenerator ADD C_AcctSchema_ID NUMBER(10) DEFAULT NULL +; + +-- Sep 24, 2012 12:16:48 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('A',200511,200021,'D',0,125,'N','N','N','The Posting Type indicates the type of amount (Actual, Budget, Reservation, Commitment, Statistical) the transaction.','N',1,'N',17,'Y','N',514,'N','Y','N','PostingType','The type of posted amount for the transaction','PostingType',100,TO_DATE('2012-09-24 12:16:47','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:16:47','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:48 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200511 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:48 PM COT +ALTER TABLE GL_JournalGenerator ADD PostingType CHAR(1) DEFAULT 'A' +; + +-- Sep 24, 2012 12:16:48 PM COT +INSERT INTO AD_Tab (IsSingleRow,AD_Window_ID,SeqNo,IsTranslationTab,IsSortTab,AD_Tab_ID,AD_Table_ID,CommitWarning,HasTree,IsInfoTab,IsReadOnly,TabLevel,IsInsertRecord,IsAdvancedTab,EntityType,Name,AD_Client_ID,AD_Org_ID,CreatedBy,Updated,Created,IsActive,UpdatedBy,Processing) VALUES ('Y',200013,10,'N','N',200020,200021,NULL,'N','Y','N',0,'Y','N','D','GL Journal Generator',0,0,100,TO_DATE('2012-09-24 12:16:48','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-24 12:16:48','YYYY-MM-DD HH24:MI:SS'),'Y',100,'N') +; + +-- Sep 24, 2012 12:16:48 PM COT +INSERT INTO AD_Tab_Trl (AD_Language,AD_Tab_ID, Help,CommitWarning,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Tab_ID, t.Help,t.CommitWarning,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Tab t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Tab_ID=200020 AND NOT EXISTS (SELECT * FROM AD_Tab_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Tab_ID=t.AD_Tab_ID) +; + +-- Sep 24, 2012 12:16:49 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200020,22,'Y','N','N',200495,'N',10,'Y',200511,'N','A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','D','Client/Tenant for this installation.','Client',100,0,'Y',TO_DATE('2012-09-24 12:16:48','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:16:48','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:49 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200511 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:16:50 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200020,22,'Y','Y','N',200496,'N',20,'Y',200512,'N','An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','D','Organizational entity within client','Organization',100,0,'Y',TO_DATE('2012-09-24 12:16:49','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:16:49','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:50 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200512 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:16:50 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200020,60,'Y','N','N',200502,'N',30,'Y',200513,'N','The name of an entity (record) is used as an default search option in addition to the search key. The name is up to 60 characters in length.','D','Alphanumeric identifier of the entity','Name',100,0,'Y',TO_DATE('2012-09-24 12:16:50','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:16:50','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:50 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200513 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:16:51 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200020,255,'Y','N','N',200499,'N',40,'Y',200514,'N','A description is limited to 255 characters.','D','Optional short description of the record','Description',100,0,'Y',TO_DATE('2012-09-24 12:16:50','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:16:50','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:51 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200514 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:16:51 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200020,2000,'Y','N','N',200500,'N',50,'Y',200515,'N','The Help field contains a hint, comment or help about the use of this item.','D','Comment or Hint','Comment/Help',100,0,'Y',TO_DATE('2012-09-24 12:16:51','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:16:51','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:51 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200515 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:16:52 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200020,10,'Y','N','N',200507,'N',60,'Y',200516,'N','The Document Type determines document sequence and processing rules','D','Document type or rules','Document Type',100,0,'Y',TO_DATE('2012-09-24 12:16:51','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:16:51','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:52 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200516 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:16:52 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200020,10,'Y','N','N',200508,'N',70,'Y',200517,'N','The General Ledger Category is an optional, user defined method of grouping journal lines.','D','General Ledger Category','GL Category',100,0,'Y',TO_DATE('2012-09-24 12:16:52','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:16:52','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:52 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200517 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:16:53 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200020,1,'Y','Y','N',200511,'N',80,'Y',200518,'N','The Posting Type indicates the type of amount (Actual, Budget, Reservation, Commitment, Statistical) the transaction.','D','The type of posted amount for the transaction','PostingType',100,0,'Y',TO_DATE('2012-09-24 12:16:52','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:16:52','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:53 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200518 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:16:53 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200020,22,'Y','N','N',200510,'N',90,'Y',200519,'N','An Accounting Schema defines the rules used in accounting such as costing method, currency and calendar','D','Rules for accounting','Accounting Schema',100,0,'Y',TO_DATE('2012-09-24 12:16:53','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:16:53','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:53 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200519 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:16:54 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200020,10,'Y','N','N',200505,'N',100,'Y',200520,'N','D','Account Adjust DR',100,0,'Y',TO_DATE('2012-09-24 12:16:53','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:16:53','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:54 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200520 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:16:54 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200020,10,'Y','Y','N',200506,'N',110,'Y',200521,'N','D','Account Adjust CR',100,0,'Y',TO_DATE('2012-09-24 12:16:54','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:16:54','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:54 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200521 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:16:55 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200020,10,'Y','N','N',200509,'N',120,'Y',200522,'N','D','Generate GL Journal',100,0,'Y',TO_DATE('2012-09-24 12:16:54','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:16:54','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:55 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200522 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:16:55 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200020,1,'Y','N','N',200501,'N',130,'Y',200523,'N','There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports. +There are two reasons for de-activating and not deleting records: +(1) The system requires the record for audit purposes. +(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','D','The record is active in the system','Active',100,0,'Y',TO_DATE('2012-09-24 12:16:55','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:16:55','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:55 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200523 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:16:56 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200020,22,'N','N','N',200494,'N',0,'Y',200524,'N','D','GL Journal Generator',100,0,'Y',TO_DATE('2012-09-24 12:16:55','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:16:55','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:56 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200524 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:16:56 PM COT +INSERT INTO AD_Table (IsSecurityEnabled,AccessLevel,AD_Window_ID,AD_Table_ID,IsHighVolume,ImportTable,IsView,IsChangeLog,EntityType,IsDeleteable,ReplicationType,TableName,Name,AD_Client_ID,IsActive,AD_Org_ID,CreatedBy,Updated,UpdatedBy,Created) VALUES ('N','3',200013,200022,'N','N','N','Y','D','Y','L','GL_JournalGeneratorLine','Generator Line',0,'Y',0,100,TO_DATE('2012-09-24 12:16:56','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2012-09-24 12:16:56','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:56 PM COT +INSERT INTO AD_Table_Trl (AD_Language,AD_Table_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Table_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Table t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Table_ID=200022 AND NOT EXISTS (SELECT * FROM AD_Table_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Table_ID=t.AD_Table_ID) +; + +-- Sep 24, 2012 12:16:57 PM COT +INSERT INTO AD_Sequence (IncrementNo,StartNewYear,CurrentNextSys,IsTableID,StartNo,CurrentNext,IsAudited,IsAutoSequence,AD_Sequence_ID,Description,Name,AD_Org_ID,AD_Client_ID,Updated,UpdatedBy,Created,CreatedBy,IsActive) VALUES (1,'N',200000,'Y',1000000,1000000,'N','Y',200022,'Table GL_JournalGeneratorLine','GL_JournalGeneratorLine',0,0,TO_DATE('2012-09-24 12:16:56','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2012-09-24 12:16:56','YYYY-MM-DD HH24:MI:SS'),100,'Y') +; + +-- Sep 24, 2012 12:16:57 PM COT +INSERT INTO AD_Element (AD_Element_ID,ColumnName,EntityType,Name,PrintName,AD_Client_ID,Created,Updated,IsActive,AD_Org_ID,CreatedBy,UpdatedBy) VALUES (200138,'GL_JournalGeneratorLine_ID','D','Generator Line','Generator Line',0,TO_DATE('2012-09-24 12:16:57','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-24 12:16:57','YYYY-MM-DD HH24:MI:SS'),'Y',0,100,100) +; + +-- Sep 24, 2012 12:16:58 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,PO_Name,Name,Description,PrintName,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.PO_Name,t.Name,t.Description,t.PrintName,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200138 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 12:16:58 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200512,200022,'D',1,'Y','N','N','N',22,'N',13,'Y','Y',200138,'N','N','N','GL_JournalGeneratorLine_ID','Generator Line',100,TO_DATE('2012-09-24 12:16:58','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:16:58','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:58 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200512 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:58 PM COT +CREATE TABLE GL_JournalGeneratorLine (GL_JournalGeneratorLine_ID NUMBER(10) NOT NULL, CONSTRAINT GL_JournalGeneratorLine_Key PRIMARY KEY (GL_JournalGeneratorLine_ID)) +; + +-- Sep 24, 2012 12:16:59 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('@#AD_Client_ID@',200513,200022,'D',1,'Y','N','N','A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','N',22,'N',19,'Y','N',102,'N','N','N','AD_Client_ID','Client/Tenant for this installation.','Client',100,TO_DATE('2012-09-24 12:16:58','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:16:58','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:59 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200513 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:59 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD AD_Client_ID NUMBER(10) NOT NULL +; + +-- Sep 24, 2012 12:16:59 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,AD_Val_Rule_ID,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('@#AD_Org_ID@',200514,200022,'D',1,'Y','N','N','An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','N',22,'N',19,'Y',104,'N',113,'N','N','N','AD_Org_ID','Organizational entity within client','Organization',100,TO_DATE('2012-09-24 12:16:59','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:16:59','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:59 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200514 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:59 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD AD_Org_ID NUMBER(10) NOT NULL +; + +-- Sep 24, 2012 12:17:00 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200515,200022,'D',1,'Y','N','N','The Created field indicates the date that this record was created.','N',7,'N',16,'Y','N',245,'N','N','N','Created','Date this record was created','Created',100,TO_DATE('2012-09-24 12:16:59','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:16:59','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:00 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200515 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:00 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD Created DATE NOT NULL +; + +-- Sep 24, 2012 12:17:00 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200516,200022,'D',1,110,'Y','N','N','The Created By field indicates the user who created this record.','N',22,'N',18,'Y','N',246,'N','N','N','CreatedBy','User who created this records','Created By',100,TO_DATE('2012-09-24 12:17:00','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:00','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:00 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200516 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:00 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD CreatedBy NUMBER(10) NOT NULL +; + +-- Sep 24, 2012 12:17:01 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200517,200022,'D',1,'N','N','N','A description is limited to 255 characters.','N',255,'Y',10,'Y','N',275,'N','Y','N','Description','Optional short description of the record','Description',100,TO_DATE('2012-09-24 12:17:00','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:00','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:01 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200517 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:01 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD Description NVARCHAR2(255) DEFAULT NULL +; + +-- Sep 24, 2012 12:17:02 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200518,200022,'D',1,'N','N','N','The Help field contains a hint, comment or help about the use of this item.','N',2000,'N',14,'Y','N',326,'N','Y','N','Help','Comment or Hint','Comment/Help',100,TO_DATE('2012-09-24 12:17:01','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:01','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:02 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200518 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:02 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD Help NVARCHAR2(2000) DEFAULT NULL +; + +-- Sep 24, 2012 12:17:03 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('Y',200519,200022,'D',1,'Y','N','N','There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports. +There are two reasons for de-activating and not deleting records: +(1) The system requires the record for audit purposes. +(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','N',1,'N',20,'Y','N',348,'N','Y','N','IsActive','The record is active in the system','Active',100,TO_DATE('2012-09-24 12:17:02','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:02','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:03 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200519 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:03 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD IsActive CHAR(1) DEFAULT 'Y' CHECK (IsActive IN ('Y','N')) NOT NULL +; + +-- Sep 24, 2012 12:17:03 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200520,200022,'D',1,'Y','N','Y',1,'Y',22,'N',19,'Y','N',200134,'N','N','N','GL_JournalGenerator_ID','GL Journal Generator',100,TO_DATE('2012-09-24 12:17:03','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:03','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:03 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200520 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:03 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD GL_JournalGenerator_ID NUMBER(10) NOT NULL +; + +-- Sep 24, 2012 12:17:04 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200521,200022,'D',1,'Y','N','N','The Updated field indicates the date that this record was updated.','N',7,'N',16,'Y','N',607,'N','N','N','Updated','Date this record was updated','Updated',100,TO_DATE('2012-09-24 12:17:03','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:03','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:04 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200521 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:04 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD Updated DATE NOT NULL +; + +-- Sep 24, 2012 12:17:04 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200522,200022,'D',1,110,'Y','N','N','The Updated By field indicates the user who updated this record.','N',22,'N',18,'Y','N',608,'N','N','N','UpdatedBy','User who updated this records','Updated By',100,TO_DATE('2012-09-24 12:17:04','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:04','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:04 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200522 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:04 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD UpdatedBy NUMBER(10) NOT NULL +; + +-- Sep 24, 2012 12:17:05 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,SeqNo,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('@SQL=SELECT NVL(MAX(SeqNo),0)+10 AS DefaultValue FROM GL_JournalGeneratorLine WHERE GL_JournalGenerator_ID=@GL_JournalGenerator_ID@',200523,200022,'D',1,'Y','N','Y',2,'The Sequence indicates the order of records','N',22,'N',11,'Y','N',566,'N','Y','N','SeqNo','Method of ordering records; lowest number comes first','Sequence',100,TO_DATE('2012-09-24 12:17:04','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:04','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:05 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200523 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:05 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD SeqNo NUMBER(10) NOT NULL +; + +-- Sep 24, 2012 12:17:06 PM COT +INSERT INTO AD_Element (AD_Element_ID,ColumnName,EntityType,Name,PrintName,AD_Client_ID,Created,Updated,IsActive,AD_Org_ID,CreatedBy,UpdatedBy) VALUES (200139,'C_ElementValueDR_ID','D','Account DR','Account DR',0,TO_DATE('2012-09-24 12:17:05','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-24 12:17:05','YYYY-MM-DD HH24:MI:SS'),'Y',0,100,100) +; + +-- Sep 24, 2012 12:17:06 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,PO_Name,Name,Description,PrintName,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.PO_Name,t.Name,t.Description,t.PrintName,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200139 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 12:17:06 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,AD_Val_Rule_ID,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200524,200022,'D',0,362,'N','N','N','N',10,'N',18,'Y',252,'N',200139,'N','Y','N','C_ElementValueDR_ID','Account DR',100,TO_DATE('2012-09-24 12:17:06','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:06','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:06 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200524 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:06 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD C_ElementValueDR_ID NUMBER(10) DEFAULT NULL +; + +-- Sep 24, 2012 12:17:07 PM COT +INSERT INTO AD_Element (AD_Element_ID,ColumnName,EntityType,Name,PrintName,AD_Client_ID,Created,Updated,IsActive,AD_Org_ID,CreatedBy,UpdatedBy) VALUES (200140,'C_ElementValueCR_ID','D','Account CR','Account CR',0,TO_DATE('2012-09-24 12:17:06','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-24 12:17:06','YYYY-MM-DD HH24:MI:SS'),'Y',0,100,100) +; + +-- Sep 24, 2012 12:17:07 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,PO_Name,Name,Description,PrintName,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.PO_Name,t.Name,t.Description,t.PrintName,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200140 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 12:17:07 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,AD_Val_Rule_ID,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200525,200022,'D',0,362,'N','N','N','N',10,'N',18,'Y',252,'N',200140,'N','Y','N','C_ElementValueCR_ID','Account CR',100,TO_DATE('2012-09-24 12:17:07','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:07','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:07 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200525 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:07 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD C_ElementValueCR_ID NUMBER(10) DEFAULT NULL +; + +-- Sep 24, 2012 12:17:08 PM COT +INSERT INTO AD_Element (AD_Element_ID,ColumnName,EntityType,Name,PrintName,AD_Client_ID,Created,Updated,IsActive,AD_Org_ID,CreatedBy,UpdatedBy) VALUES (200141,'BPDimensionType','D','Type of BP Dimension','Type of BP Dimension',0,TO_DATE('2012-09-24 12:17:07','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-24 12:17:07','YYYY-MM-DD HH24:MI:SS'),'Y',0,100,100) +; + +-- Sep 24, 2012 12:17:08 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,PO_Name,Name,Description,PrintName,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.PO_Name,t.Name,t.Description,t.PrintName,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200141 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 12:17:08 PM COT +INSERT INTO AD_Reference (AD_Reference_ID,ValidationType,EntityType,Name,AD_Client_ID,AD_Org_ID,CreatedBy,Updated,IsActive,Created,UpdatedBy) VALUES (200008,'L','D','GL_JournalGeneratorLine BPDimensionType',0,0,100,TO_DATE('2012-09-24 12:17:08','YYYY-MM-DD HH24:MI:SS'),'Y',TO_DATE('2012-09-24 12:17:08','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:08 PM COT +INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=200008 AND NOT EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID) +; + +-- Sep 24, 2012 12:17:09 PM COT +INSERT INTO AD_Ref_List (AD_Ref_List_ID,AD_Reference_ID,EntityType,Value,Name,CreatedBy,Updated,UpdatedBy,Created,AD_Org_ID,IsActive,AD_Client_ID) VALUES (200027,200008,'D','C','Column',100,TO_DATE('2012-09-24 12:17:09','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2012-09-24 12:17:09','YYYY-MM-DD HH24:MI:SS'),0,'Y',0) +; + +-- Sep 24, 2012 12:17:09 PM COT +INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=200027 AND NOT EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID) +; + +-- Sep 24, 2012 12:17:10 PM COT +INSERT INTO AD_Ref_List (AD_Ref_List_ID,AD_Reference_ID,EntityType,Value,Name,CreatedBy,Updated,UpdatedBy,Created,AD_Org_ID,IsActive,AD_Client_ID) VALUES (200028,200008,'D','F','Fixed',100,TO_DATE('2012-09-24 12:17:09','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2012-09-24 12:17:09','YYYY-MM-DD HH24:MI:SS'),0,'Y',0) +; + +-- Sep 24, 2012 12:17:10 PM COT +INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=200028 AND NOT EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID) +; + +-- Sep 24, 2012 12:17:10 PM COT +INSERT INTO AD_Ref_List (AD_Ref_List_ID,AD_Reference_ID,EntityType,Value,Name,CreatedBy,Updated,UpdatedBy,Created,AD_Org_ID,IsActive,AD_Client_ID) VALUES (200029,200008,'D','S','Same',100,TO_DATE('2012-09-24 12:17:10','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2012-09-24 12:17:10','YYYY-MM-DD HH24:MI:SS'),0,'Y',0) +; + +-- Sep 24, 2012 12:17:10 PM COT +INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=200029 AND NOT EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID) +; + +-- Sep 24, 2012 12:17:11 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200526,200022,'D',0,200008,'N','N','N','N',1,'N',17,'Y','N',200141,'N','Y','N','BPDimensionType','Type of BP Dimension',100,TO_DATE('2012-09-24 12:17:10','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:10','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:11 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200526 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:11 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD BPDimensionType CHAR(1) DEFAULT NULL +; + +-- Sep 24, 2012 12:17:11 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200527,200022,'D',0,138,'N','N','N','A Business Partner is anyone with whom you transact. This can include Vendor, Customer, Employee or Salesperson','N',10,'N',30,'Y','N',187,'N','Y','N','C_BPartner_ID','Identifies a Business Partner','Business Partner ',100,TO_DATE('2012-09-24 12:17:11','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:11','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:11 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200527 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:11 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD C_BPartner_ID NUMBER(10) DEFAULT NULL +; + +-- Sep 24, 2012 12:17:12 PM COT +INSERT INTO AD_Element (AD_Element_ID,ColumnName,EntityType,Name,PrintName,AD_Client_ID,Created,Updated,IsActive,AD_Org_ID,CreatedBy,UpdatedBy) VALUES (200142,'BPColumn','D','BP Column','BP Column',0,TO_DATE('2012-09-24 12:17:12','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-24 12:17:12','YYYY-MM-DD HH24:MI:SS'),'Y',0,100,100) +; + +-- Sep 24, 2012 12:17:12 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,PO_Name,Name,Description,PrintName,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.PO_Name,t.Name,t.Description,t.PrintName,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200142 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 12:17:13 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200528,200022,'D',0,'N','N','N','N',100,'N',10,'Y','N',200142,'N','Y','N','BPColumn','BP Column',100,TO_DATE('2012-09-24 12:17:12','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:12','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:13 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200528 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:13 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD BPColumn NVARCHAR2(100) DEFAULT NULL +; + +-- Sep 24, 2012 12:17:13 PM COT +INSERT INTO AD_Element (AD_Element_ID,ColumnName,EntityType,Name,PrintName,AD_Client_ID,Created,Updated,IsActive,AD_Org_ID,CreatedBy,UpdatedBy) VALUES (200143,'IsCopyAllDimensions','D','Copy All Dimensions','Copy All Dimensions',0,TO_DATE('2012-09-24 12:17:13','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-24 12:17:13','YYYY-MM-DD HH24:MI:SS'),'Y',0,100,100) +; + +-- Sep 24, 2012 12:17:13 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,PO_Name,Name,Description,PrintName,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.PO_Name,t.Name,t.Description,t.PrintName,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200143 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 12:17:14 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('N',200529,200022,'D',0,'Y','N','N','N',1,'N',20,'Y','N',200143,'N','Y','N','IsCopyAllDimensions','Copy All Dimensions',100,TO_DATE('2012-09-24 12:17:13','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:13','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:14 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200529 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:14 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD IsCopyAllDimensions CHAR(1) DEFAULT 'N' CHECK (IsCopyAllDimensions IN ('Y','N')) NOT NULL +; + +-- Sep 24, 2012 12:17:15 PM COT +INSERT INTO AD_Element (AD_Element_ID,ColumnName,EntityType,Name,PrintName,AD_Client_ID,Created,Updated,IsActive,AD_Org_ID,CreatedBy,UpdatedBy) VALUES (200144,'IsSameProduct','D','Same Product','Same Product',0,TO_DATE('2012-09-24 12:17:14','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-24 12:17:14','YYYY-MM-DD HH24:MI:SS'),'Y',0,100,100) +; + +-- Sep 24, 2012 12:17:15 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,PO_Name,Name,Description,PrintName,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.PO_Name,t.Name,t.Description,t.PrintName,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200144 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 12:17:15 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('N',200530,200022,'D',0,'Y','N','N','N',1,'N',20,'Y','N',200144,'N','Y','N','IsSameProduct','Same Product',100,TO_DATE('2012-09-24 12:17:15','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:15','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:15 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200530 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:15 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD IsSameProduct CHAR(1) DEFAULT 'N' CHECK (IsSameProduct IN ('Y','N')) NOT NULL +; + +-- Sep 24, 2012 12:17:16 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('1',200531,200022,'D',0,'N','N','N','The Multiplier Amount indicates the amount to multiply the total amount generated by this commission run by.','N',14,'N',22,'Y','N',1545,'N','Y','N','AmtMultiplier','Multiplier Amount for generating commissions','Multiplier Amount',100,TO_DATE('2012-09-24 12:17:15','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:15','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:16 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200531 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:16 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD AmtMultiplier NUMBER DEFAULT 1 +; + +-- Sep 24, 2012 12:17:16 PM COT +INSERT INTO AD_Element (AD_Element_ID,ColumnName,EntityType,Name,PrintName,AD_Client_ID,Created,Updated,IsActive,AD_Org_ID,CreatedBy,UpdatedBy) VALUES (200145,'RoundFactor','D','Round Factor','Round Factor',0,TO_DATE('2012-09-24 12:17:16','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-24 12:17:16','YYYY-MM-DD HH24:MI:SS'),'Y',0,100,100) +; + +-- Sep 24, 2012 12:17:16 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,PO_Name,Name,Description,PrintName,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.PO_Name,t.Name,t.Description,t.PrintName,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200145 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 12:17:17 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('0',200532,200022,'D',0,'N','N','N','N',22,'N',11,'Y','N',200145,'N','Y','N','RoundFactor','Round Factor',100,TO_DATE('2012-09-24 12:17:16','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:16','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:17 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200532 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:17 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD RoundFactor NUMBER(10) DEFAULT 0 +; + +-- Sep 24, 2012 12:17:18 PM COT +INSERT INTO AD_Tab (IsSingleRow,AD_Window_ID,SeqNo,IsTranslationTab,IsSortTab,AD_Tab_ID,AD_Table_ID,CommitWarning,HasTree,IsInfoTab,IsReadOnly,AD_Column_ID,TabLevel,IsInsertRecord,IsAdvancedTab,EntityType,Name,AD_Client_ID,AD_Org_ID,CreatedBy,Updated,Created,IsActive,UpdatedBy,Processing) VALUES ('Y',200013,20,'N','N',200021,200022,NULL,'N','Y','N',200520,1,'Y','N','D','Generator Line',0,0,100,TO_DATE('2012-09-24 12:17:17','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-24 12:17:17','YYYY-MM-DD HH24:MI:SS'),'Y',100,'N') +; + +-- Sep 24, 2012 12:17:18 PM COT +INSERT INTO AD_Tab_Trl (AD_Language,AD_Tab_ID, Help,CommitWarning,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Tab_ID, t.Help,t.CommitWarning,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Tab t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Tab_ID=200021 AND NOT EXISTS (SELECT * FROM AD_Tab_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Tab_ID=t.AD_Tab_ID) +; + +-- Sep 24, 2012 12:17:18 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,22,'Y','N','N',200513,'N',10,'Y',200525,'N','A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','D','Client/Tenant for this installation.','Client',100,0,'Y',TO_DATE('2012-09-24 12:17:18','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:17:18','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:18 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200525 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:19 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,22,'Y','Y','N',200514,'N',20,'Y',200526,'N','An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','D','Organizational entity within client','Organization',100,0,'Y',TO_DATE('2012-09-24 12:17:18','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:17:18','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:19 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200526 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:19 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,22,'Y','N','N',200520,'N',30,'Y',200527,'N','D','GL Journal Generator',100,0,'Y',TO_DATE('2012-09-24 12:17:19','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:17:19','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:19 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200527 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:20 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,22,'Y','N','N',200523,'N',40,'Y',200528,'N','The Sequence indicates the order of records','D','Method of ordering records; lowest number comes first','Sequence',100,0,'Y',TO_DATE('2012-09-24 12:17:19','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:17:19','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:20 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200528 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:20 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,255,'Y','N','N',200517,'N',50,'Y',200529,'N','A description is limited to 255 characters.','D','Optional short description of the record','Description',100,0,'Y',TO_DATE('2012-09-24 12:17:20','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:17:20','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:20 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200529 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:21 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,2000,'Y','N','N',200518,'N',60,'Y',200530,'N','The Help field contains a hint, comment or help about the use of this item.','D','Comment or Hint','Comment/Help',100,0,'Y',TO_DATE('2012-09-24 12:17:20','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:17:20','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:21 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200530 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:21 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,10,'Y','N','N',200524,'N',70,'Y',200531,'N','D','Account DR',100,0,'Y',TO_DATE('2012-09-24 12:17:21','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:17:21','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:21 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200531 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:22 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,10,'Y','Y','N',200525,'N',80,'Y',200532,'N','D','Account CR',100,0,'Y',TO_DATE('2012-09-24 12:17:21','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:17:21','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:22 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200532 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:22 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,1,'Y','N','N',200526,'N',90,'Y',200533,'N','D','Type of BP Dimension',100,0,'Y',TO_DATE('2012-09-24 12:17:22','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:17:22','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:22 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200533 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:23 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,DisplayLogic,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,10,'Y','Y','N',200527,'N',100,'Y',200534,'N','A Business Partner is anyone with whom you transact. This can include Vendor, Customer, Employee or Salesperson','@BPDimensionType@=F','D','Identifies a Business Partner','Business Partner ',100,0,'Y',TO_DATE('2012-09-24 12:17:22','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:17:22','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:23 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200534 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:23 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,DisplayLogic,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,100,'Y','Y','N',200528,'N',110,'Y',200535,'N','@BPDimensionType@=C','D','BP Column',100,0,'Y',TO_DATE('2012-09-24 12:17:23','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:17:23','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:23 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200535 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:24 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,1,'Y','N','N',200530,'N',120,'Y',200536,'N','D','Same Product',100,0,'Y',TO_DATE('2012-09-24 12:17:23','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:17:23','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:24 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200536 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:24 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,1,'Y','N','N',200529,'N',130,'Y',200537,'N','D','Copy All Dimensions',100,0,'Y',TO_DATE('2012-09-24 12:17:24','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:17:24','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:24 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200537 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:25 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,14,'Y','N','N',200531,'N',140,'Y',200538,'N','The Multiplier Amount indicates the amount to multiply the total amount generated by this commission run by.','D','Multiplier Amount for generating commissions','Multiplier Amount',100,0,'Y',TO_DATE('2012-09-24 12:17:24','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:17:24','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:25 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200538 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:25 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,22,'Y','Y','N',200532,'N',150,'Y',200539,'N','D','Round Factor',100,0,'Y',TO_DATE('2012-09-24 12:17:25','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:17:25','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:25 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200539 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:26 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,1,'Y','N','N',200519,'N',160,'Y',200540,'N','There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports. +There are two reasons for de-activating and not deleting records: +(1) The system requires the record for audit purposes. +(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','D','The record is active in the system','Active',100,0,'Y',TO_DATE('2012-09-24 12:17:25','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:17:25','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:26 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200540 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:26 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,22,'N','N','N',200512,'N',0,'Y',200541,'N','D','Generator Line',100,0,'Y',TO_DATE('2012-09-24 12:17:26','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:17:26','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:26 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200541 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:27 PM COT +INSERT INTO AD_Table (IsSecurityEnabled,AccessLevel,AD_Window_ID,AD_Table_ID,IsHighVolume,ImportTable,IsView,IsChangeLog,EntityType,IsDeleteable,ReplicationType,TableName,Name,AD_Client_ID,IsActive,AD_Org_ID,CreatedBy,Updated,UpdatedBy,Created) VALUES ('N','3',200013,200023,'N','N','N','Y','D','Y','L','GL_JournalGeneratorSource','Generator Source',0,'Y',0,100,TO_DATE('2012-09-24 12:17:27','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2012-09-24 12:17:27','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:27 PM COT +INSERT INTO AD_Table_Trl (AD_Language,AD_Table_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Table_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Table t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Table_ID=200023 AND NOT EXISTS (SELECT * FROM AD_Table_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Table_ID=t.AD_Table_ID) +; + +-- Sep 24, 2012 12:17:28 PM COT +INSERT INTO AD_Sequence (IncrementNo,StartNewYear,CurrentNextSys,IsTableID,StartNo,CurrentNext,IsAudited,IsAutoSequence,AD_Sequence_ID,Description,Name,AD_Org_ID,AD_Client_ID,Updated,UpdatedBy,Created,CreatedBy,IsActive) VALUES (1,'N',200000,'Y',1000000,1000000,'N','Y',200023,'Table GL_JournalGeneratorSource','GL_JournalGeneratorSource',0,0,TO_DATE('2012-09-24 12:17:27','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2012-09-24 12:17:27','YYYY-MM-DD HH24:MI:SS'),100,'Y') +; + +-- Sep 24, 2012 12:17:28 PM COT +INSERT INTO AD_Element (AD_Element_ID,ColumnName,EntityType,Name,PrintName,AD_Client_ID,Created,Updated,IsActive,AD_Org_ID,CreatedBy,UpdatedBy) VALUES (200146,'GL_JournalGeneratorSource_ID','D','Generator Source','Generator Source',0,TO_DATE('2012-09-24 12:17:28','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-24 12:17:28','YYYY-MM-DD HH24:MI:SS'),'Y',0,100,100) +; + +-- Sep 24, 2012 12:17:28 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,PO_Name,Name,Description,PrintName,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.PO_Name,t.Name,t.Description,t.PrintName,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200146 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 12:17:29 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200533,200023,'D',1,'Y','N','N','N',22,'N',13,'Y','Y',200146,'N','N','N','GL_JournalGeneratorSource_ID','Generator Source',100,TO_DATE('2012-09-24 12:17:28','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:28','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:29 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200533 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:29 PM COT +CREATE TABLE GL_JournalGeneratorSource (GL_JournalGeneratorSource_ID NUMBER(10) NOT NULL, CONSTRAINT GL_JournalGeneratorSource_Key PRIMARY KEY (GL_JournalGeneratorSource_ID)) +; + +-- Sep 24, 2012 12:17:30 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('@#AD_Client_ID@',200534,200023,'D',1,'Y','N','N','A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','N',22,'N',19,'Y','N',102,'N','N','N','AD_Client_ID','Client/Tenant for this installation.','Client',100,TO_DATE('2012-09-24 12:17:29','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:29','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:30 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200534 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:30 PM COT +ALTER TABLE GL_JournalGeneratorSource ADD AD_Client_ID NUMBER(10) NOT NULL +; + +-- Sep 24, 2012 12:17:30 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,AD_Val_Rule_ID,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('@#AD_Org_ID@',200535,200023,'D',1,'Y','N','N','An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','N',22,'N',19,'Y',104,'N',113,'N','N','N','AD_Org_ID','Organizational entity within client','Organization',100,TO_DATE('2012-09-24 12:17:30','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:30','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:30 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200535 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:30 PM COT +ALTER TABLE GL_JournalGeneratorSource ADD AD_Org_ID NUMBER(10) NOT NULL +; + +-- Sep 24, 2012 12:17:31 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200536,200023,'D',1,'Y','N','N','The Created field indicates the date that this record was created.','N',7,'N',16,'Y','N',245,'N','N','N','Created','Date this record was created','Created',100,TO_DATE('2012-09-24 12:17:30','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:30','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:31 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200536 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:31 PM COT +ALTER TABLE GL_JournalGeneratorSource ADD Created DATE NOT NULL +; + +-- Sep 24, 2012 12:17:31 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200537,200023,'D',1,110,'Y','N','N','The Created By field indicates the user who created this record.','N',22,'N',18,'Y','N',246,'N','N','N','CreatedBy','User who created this records','Created By',100,TO_DATE('2012-09-24 12:17:31','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:31','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:31 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200537 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:31 PM COT +ALTER TABLE GL_JournalGeneratorSource ADD CreatedBy NUMBER(10) NOT NULL +; + +-- Sep 24, 2012 12:17:32 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200538,200023,'D',1,'N','N','N','The Help field contains a hint, comment or help about the use of this item.','N',2000,'N',14,'Y','N',326,'N','Y','N','Help','Comment or Hint','Comment/Help',100,TO_DATE('2012-09-24 12:17:31','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:31','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:32 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200538 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:32 PM COT +ALTER TABLE GL_JournalGeneratorSource ADD Help NVARCHAR2(2000) DEFAULT NULL +; + +-- Sep 24, 2012 12:17:32 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('Y',200539,200023,'D',1,'Y','N','N','There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports. +There are two reasons for de-activating and not deleting records: +(1) The system requires the record for audit purposes. +(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','N',1,'N',20,'Y','N',348,'N','Y','N','IsActive','The record is active in the system','Active',100,TO_DATE('2012-09-24 12:17:32','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:32','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:32 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200539 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:33 PM COT +ALTER TABLE GL_JournalGeneratorSource ADD IsActive CHAR(1) DEFAULT 'Y' CHECK (IsActive IN ('Y','N')) NOT NULL +; + +-- Sep 24, 2012 12:17:33 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200540,200023,'D',1,'Y','N','N','The Updated field indicates the date that this record was updated.','N',7,'N',16,'Y','N',607,'N','N','N','Updated','Date this record was updated','Updated',100,TO_DATE('2012-09-24 12:17:33','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:33','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:33 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200540 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:33 PM COT +ALTER TABLE GL_JournalGeneratorSource ADD Updated DATE NOT NULL +; + +-- Sep 24, 2012 12:17:34 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200541,200023,'D',1,110,'Y','N','N','The Updated By field indicates the user who updated this record.','N',22,'N',18,'Y','N',608,'N','N','N','UpdatedBy','User who updated this records','Updated By',100,TO_DATE('2012-09-24 12:17:33','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:33','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:34 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200541 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:34 PM COT +ALTER TABLE GL_JournalGeneratorSource ADD UpdatedBy NUMBER(10) NOT NULL +; + +-- Sep 24, 2012 12:17:34 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200542,200023,'D',0,'Y','N','N','Y',10,'N',19,'Y','N',200138,'N','N','N','GL_JournalGeneratorLine_ID','Generator Line',100,TO_DATE('2012-09-24 12:17:34','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:34','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:34 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200542 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:34 PM COT +ALTER TABLE GL_JournalGeneratorSource ADD GL_JournalGeneratorLine_ID NUMBER(10) NOT NULL +; + +-- Sep 24, 2012 12:17:35 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,AD_Val_Rule_ID,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200543,200023,'D',0,182,'Y','N','N','Account Elements can be natural accounts or user defined values.','N',10,'N',18,'Y',252,'N',198,'N','Y','N','C_ElementValue_ID','Account Element','Account Element',100,TO_DATE('2012-09-24 12:17:34','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:34','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:35 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200543 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:35 PM COT +ALTER TABLE GL_JournalGeneratorSource ADD C_ElementValue_ID NUMBER(10) NOT NULL +; + +-- Sep 24, 2012 12:17:35 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('1',200544,200023,'D',0,'Y','N','N','The Multiplier Amount indicates the amount to multiply the total amount generated by this commission run by.','N',1,'N',22,'Y','N',1545,'N','Y','N','AmtMultiplier','Multiplier Amount for generating commissions','Multiplier Amount',100,TO_DATE('2012-09-24 12:17:35','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:35','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:35 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200544 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:36 PM COT +ALTER TABLE GL_JournalGeneratorSource ADD AmtMultiplier NUMBER DEFAULT 1 NOT NULL +; + +-- Sep 24, 2012 12:17:36 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200545,200023,'D',0,'N','N','N','N',14,'N',11,'Y','N',200145,'N','Y','N','RoundFactor','Round Factor',100,TO_DATE('2012-09-24 12:17:36','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:36','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:36 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200545 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:36 PM COT +ALTER TABLE GL_JournalGeneratorSource ADD RoundFactor NUMBER(10) DEFAULT NULL +; + +-- Sep 24, 2012 12:17:37 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200546,200023,'D',0,'N','N','N','The General Ledger Category is an optional, user defined method of grouping journal lines.','N',10,'N',19,'Y','N',309,'N','Y','N','GL_Category_ID','General Ledger Category','GL Category',100,TO_DATE('2012-09-24 12:17:36','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-09-24 12:17:36','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:37 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200546 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:37 PM COT +ALTER TABLE GL_JournalGeneratorSource ADD GL_Category_ID NUMBER(10) DEFAULT NULL +; + +-- Sep 24, 2012 12:17:38 PM COT +INSERT INTO AD_Tab (IsSingleRow,AD_Window_ID,SeqNo,IsTranslationTab,IsSortTab,AD_Tab_ID,AD_Table_ID,CommitWarning,HasTree,IsInfoTab,IsReadOnly,AD_Column_ID,TabLevel,IsInsertRecord,IsAdvancedTab,EntityType,Name,AD_Client_ID,AD_Org_ID,CreatedBy,Updated,Created,IsActive,UpdatedBy,Processing) VALUES ('N',200013,30,'N','N',200022,200023,NULL,'N','Y','N',200542,2,'Y','N','D','Generator Source',0,0,100,TO_DATE('2012-09-24 12:17:37','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-24 12:17:37','YYYY-MM-DD HH24:MI:SS'),'Y',100,'N') +; + +-- Sep 24, 2012 12:17:38 PM COT +INSERT INTO AD_Tab_Trl (AD_Language,AD_Tab_ID, Help,CommitWarning,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Tab_ID, t.Help,t.CommitWarning,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Tab t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Tab_ID=200022 AND NOT EXISTS (SELECT * FROM AD_Tab_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Tab_ID=t.AD_Tab_ID) +; + +-- Sep 24, 2012 12:17:38 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200022,22,'Y','N','N',200534,'N',10,'Y',200542,'N','A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','D','Client/Tenant for this installation.','Client',100,0,'Y',TO_DATE('2012-09-24 12:17:38','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:17:38','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:38 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200542 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:39 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200022,22,'Y','Y','N',200535,'N',20,'Y',200543,'N','An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','D','Organizational entity within client','Organization',100,0,'Y',TO_DATE('2012-09-24 12:17:38','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:17:38','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:39 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200543 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:39 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200022,10,'Y','N','N',200542,'N',30,'Y',200544,'N','D','Generator Line',100,0,'Y',TO_DATE('2012-09-24 12:17:39','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:17:39','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:39 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200544 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:40 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200022,10,'Y','N','N',200543,'N',40,'Y',200545,'N','Account Elements can be natural accounts or user defined values.','D','Account Element','Account Element',100,0,'Y',TO_DATE('2012-09-24 12:17:39','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:17:39','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:40 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200545 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:40 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200022,10,'Y','Y','N',200546,'N',50,'Y',200546,'N','The General Ledger Category is an optional, user defined method of grouping journal lines.','D','General Ledger Category','GL Category',100,0,'Y',TO_DATE('2012-09-24 12:17:40','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:17:40','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:40 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200546 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:41 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200022,1,'Y','N','N',200544,'N',60,'Y',200547,'N','The Multiplier Amount indicates the amount to multiply the total amount generated by this commission run by.','D','Multiplier Amount for generating commissions','Multiplier Amount',100,0,'Y',TO_DATE('2012-09-24 12:17:40','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:17:40','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:41 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200547 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:41 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200022,14,'Y','Y','N',200545,'N',70,'Y',200548,'N','D','Round Factor',100,0,'Y',TO_DATE('2012-09-24 12:17:41','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:17:41','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:41 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200548 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:42 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200022,2000,'Y','N','N',200538,'N',80,'Y',200549,'N','The Help field contains a hint, comment or help about the use of this item.','D','Comment or Hint','Comment/Help',100,0,'Y',TO_DATE('2012-09-24 12:17:41','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:17:41','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:42 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200549 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:43 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200022,1,'Y','N','N',200539,'N',90,'Y',200550,'N','There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports. +There are two reasons for de-activating and not deleting records: +(1) The system requires the record for audit purposes. +(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','D','The record is active in the system','Active',100,0,'Y',TO_DATE('2012-09-24 12:17:42','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:17:42','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:43 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200550 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:44 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200022,22,'N','N','N',200533,'N',0,'Y',200551,'N','D','Generator Source',100,0,'Y',TO_DATE('2012-09-24 12:17:43','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 12:17:43','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:44 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200551 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:44 PM COT +update AD_Field set isallowcopy='N' where AD_Field_ID=(select ad_field_id from ad_field where name ='Sequence' and ad_tab_id=(select ad_tab_id from ad_tab where name='Generator Line' and entitytype='D')) +; + +-- Sep 24, 2012 12:17:44 PM COT +update ad_column set mandatorylogic='@BPDimensionType@=C' where columnname='BPColumn' and ad_table_id=(select ad_table_id from ad_table where tablename='GL_JournalGeneratorLine') +; + +-- Sep 24, 2012 12:17:44 PM COT +update ad_column set mandatorylogic='@BPDimensionType@=F' where columnname='C_BPartner_ID' and ad_table_id=(select ad_table_id from ad_table where tablename='GL_JournalGeneratorLine') +; + +-- Sep 24, 2012 12:17:44 PM COT +ALTER TABLE GL_JournalGenerator ADD (CONSTRAINT CAcctSchema_QSSJournalGenerato FOREIGN KEY (C_AcctSchema_ID) REFERENCES C_AcctSchema); + +ALTER TABLE GL_JournalGenerator ADD (CONSTRAINT CDocType_QSSJournalGenerator FOREIGN KEY (C_DocType_ID) REFERENCES C_DocType); + +ALTER TABLE GL_JournalGenerator ADD (CONSTRAINT CElementValueAdjustCR_QSSJourn FOREIGN KEY (C_ElementValueAdjustCR_ID) REFERENCES C_ElementValue); + +ALTER TABLE GL_JournalGenerator ADD (CONSTRAINT CElementValueAdjustDR_QSSJourn FOREIGN KEY (C_ElementValueAdjustDR_ID) REFERENCES C_ElementValue); + +ALTER TABLE GL_JournalGenerator ADD (CONSTRAINT GLCategory_QSSJournalGenerator FOREIGN KEY (GL_Category_ID) REFERENCES GL_Category); + +ALTER TABLE GL_JournalGeneratorLine ADD (CONSTRAINT CBPartner_QSSJournalGeneratorL FOREIGN KEY (C_BPartner_ID) REFERENCES C_BPartner); + +ALTER TABLE GL_JournalGeneratorLine ADD (CONSTRAINT CElementValueCR_QSSJournalGene FOREIGN KEY (C_ElementValueCR_ID) REFERENCES C_ElementValue); + +ALTER TABLE GL_JournalGeneratorLine ADD (CONSTRAINT CElementValueDR_QSSJournalGene FOREIGN KEY (C_ElementValueDR_ID) REFERENCES C_ElementValue); + +ALTER TABLE GL_JournalGeneratorLine ADD (CONSTRAINT QSSJournalGenerator_QSSJournal FOREIGN KEY (GL_JournalGenerator_ID) REFERENCES GL_JournalGenerator); + +ALTER TABLE GL_JournalGeneratorSource ADD (CONSTRAINT CElementValue_QSSJournalGenera FOREIGN KEY (C_ElementValue_ID) REFERENCES C_ElementValue); + +ALTER TABLE GL_JournalGeneratorSource ADD (CONSTRAINT QSSJournalGeneratorLine_QSSJou FOREIGN KEY (GL_JournalGeneratorLine_ID) REFERENCES GL_JournalGeneratorLine); + +-- Sep 24, 2012 12:17:45 PM COT +INSERT INTO AD_Menu (AD_Window_ID,AD_Menu_ID,IsSummary,Action,IsSOTrx,IsReadOnly,EntityType,Name,Created,IsActive,UpdatedBy,AD_Client_ID,CreatedBy,Updated,AD_Org_ID) VALUES (200013,200019,'N','W','N','N','D','GL Journal Generator',TO_DATE('2012-09-24 12:17:44','YYYY-MM-DD HH24:MI:SS'),'Y',100,0,100,TO_DATE('2012-09-24 12:17:44','YYYY-MM-DD HH24:MI:SS'),0) +; + +-- Sep 24, 2012 12:17:45 PM COT +INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Menu_ID, t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Menu_ID=200019 AND NOT EXISTS (SELECT * FROM AD_Menu_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Menu_ID=t.AD_Menu_ID) +; + +-- Sep 24, 2012 12:17:45 PM COT +INSERT INTO AD_TREENODEMM(AD_Client_ID, AD_Org_ID, CreatedBy, UpdatedBy, Parent_ID, SeqNo, AD_Tree_ID, Node_ID)VALUES(0, 0, 0, 0, 278,13, 10, 200019) +; + +-- Sep 24, 2012 1:52:05 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('GL_JournalGenerator_UU',200154,'U','GL_JournalGenerator_UU','GL_JournalGenerator_UU','ce1c9845-c843-4171-a29e-58ba1a00b7a5',0,TO_DATE('2012-09-24 13:52:05','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-24 13:52:05','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Sep 24, 2012 1:52:05 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200154 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 1:52:05 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID) VALUES (1.00,200021,200554,'U','N','N','N','N',36,'N',10,'N',200154,'036bbd32-d2b8-4977-aa89-63d03b982c9d','N','Y','N','GL_JournalGenerator_UU','GL_JournalGenerator_UU',100,TO_DATE('2012-09-24 13:52:05','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-24 13:52:05','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Sep 24, 2012 1:52:05 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200554 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 1:52:05 PM COT +-- IDEMPIERE-207 GL Journal Generator +ALTER TABLE GL_JournalGenerator ADD GL_JournalGenerator_UU NVARCHAR2(36) DEFAULT NULL +; + +-- Sep 24, 2012 1:52:06 PM COT +-- IDEMPIERE-207 GL Journal Generator +CREATE UNIQUE INDEX GL_JournalGenerator_UU_idx ON gl_journalgenerator(GL_JournalGenerator_UU) +; + +-- Sep 24, 2012 1:52:06 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('GL_JournalGeneratorLine_UU',200155,'U','GL_JournalGeneratorLine_UU','GL_JournalGeneratorLine_UU','01031500-7362-453d-b5c2-59e493651afd',0,TO_DATE('2012-09-24 13:52:06','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-24 13:52:06','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Sep 24, 2012 1:52:06 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200155 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 1:52:07 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID) VALUES (1.00,200022,200555,'U','N','N','N','N',36,'N',10,'N',200155,'3084f1fd-f809-4379-aaeb-b7539cb982bd','N','Y','N','GL_JournalGeneratorLine_UU','GL_JournalGeneratorLine_UU',100,TO_DATE('2012-09-24 13:52:06','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-24 13:52:06','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Sep 24, 2012 1:52:07 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200555 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 1:52:07 PM COT +-- IDEMPIERE-207 GL Journal Generator +ALTER TABLE GL_JournalGeneratorLine ADD GL_JournalGeneratorLine_UU NVARCHAR2(36) DEFAULT NULL +; + +-- Sep 24, 2012 1:52:07 PM COT +-- IDEMPIERE-207 GL Journal Generator +CREATE UNIQUE INDEX GL_JournalGeneratorLine_UU_idx ON gl_journalgeneratorline(GL_JournalGeneratorLine_UU) +; + +-- Sep 24, 2012 1:52:07 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('GL_JournalGeneratorSource_UU',200156,'U','GL_JournalGeneratorSource_UU','GL_JournalGeneratorSource_UU','c14d313c-2e81-461d-8b8f-9a33913bbaeb',0,TO_DATE('2012-09-24 13:52:07','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-24 13:52:07','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Sep 24, 2012 1:52:07 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200156 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 1:52:08 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID) VALUES (1.00,200023,200556,'U','N','N','N','N',36,'N',10,'N',200156,'2f6ca282-6903-4207-907a-6cff865d8867','N','Y','N','GL_JournalGeneratorSource_UU','GL_JournalGeneratorSource_UU',100,TO_DATE('2012-09-24 13:52:07','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-24 13:52:07','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Sep 24, 2012 1:52:08 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200556 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 1:52:08 PM COT +-- IDEMPIERE-207 GL Journal Generator +ALTER TABLE GL_JournalGeneratorSource ADD GL_JournalGeneratorSource_UU NVARCHAR2(36) DEFAULT NULL +; + +-- Sep 24, 2012 1:52:08 PM COT +-- IDEMPIERE-207 GL Journal Generator +CREATE UNIQUE INDEX GL_JournalGeneratorSource_U_uu_idx ON gl_journalgeneratorsource(GL_JournalGeneratorSource_UU) +; + +-- Sep 24, 2012 2:13:33 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO GL_JournalGenerator (GL_JournalGenerator_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,Description,Help,IsActive,Name,Updated,UpdatedBy,C_ElementValueAdjustDR_ID,C_ElementValueAdjustCR_ID,C_DocType_ID,GL_Category_ID,GenerateGLJournal,C_AcctSchema_ID,PostingType,GL_JournalGenerator_UU) VALUES (200000,11,0,TO_DATE('2012-09-24 14:13:32','YYYY-MM-DD HH24:MI:SS'),100,'Step 1 - close Revenue/Expense to Income Summary','Processing date start on 1900 - execute on adjustment period','Y','Year-End Closing Sample - step 1',TO_DATE('2012-09-24 14:13:32','YYYY-MM-DD HH24:MI:SS'),100,771,771,115,108,'N',101,'A','d7614300-365f-4cca-b7c3-0085310c35d2') +; + +-- Sep 24, 2012 2:16:26 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO GL_JournalGeneratorLine (IsCopyAllDimensions,IsSameProduct,GL_JournalGeneratorLine_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,Description,IsActive,GL_JournalGenerator_ID,Updated,UpdatedBy,SeqNo,AmtMultiplier,RoundFactor,GL_JournalGeneratorLine_UU) VALUES ('Y','N',200000,11,0,TO_DATE('2012-09-24 14:16:25','YYYY-MM-DD HH24:MI:SS'),100,'Close 4 Sales','Y',200000,TO_DATE('2012-09-24 14:16:25','YYYY-MM-DD HH24:MI:SS'),100,10,-1.000000000000,2,'d6c7e2eb-3c82-4a1f-9439-7ee7b0c61020') +; + +-- Sep 24, 2012 2:16:59 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO GL_JournalGeneratorSource (GL_JournalGeneratorSource_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy,GL_JournalGeneratorLine_ID,C_ElementValue_ID,AmtMultiplier,RoundFactor,GL_JournalGeneratorSource_UU) VALUES (200000,11,0,TO_DATE('2012-09-24 14:16:58','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_DATE('2012-09-24 14:16:58','YYYY-MM-DD HH24:MI:SS'),100,200000,632,1,2,'970de838-635a-4c09-b4ed-7b3ae59ed8a6') +; + +-- Sep 24, 2012 2:17:23 PM COT +-- IDEMPIERE-207 GL Journal Generator +UPDATE GL_JournalGeneratorLine SET Description='Close Sales and Other Income',Updated=TO_DATE('2012-09-24 14:17:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE GL_JournalGeneratorLine_ID=200000 +; + +-- Sep 24, 2012 2:17:35 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO GL_JournalGeneratorSource (GL_JournalGeneratorSource_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy,GL_JournalGeneratorLine_ID,C_ElementValue_ID,AmtMultiplier,RoundFactor,GL_JournalGeneratorSource_UU) VALUES (200001,11,0,TO_DATE('2012-09-24 14:17:35','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_DATE('2012-09-24 14:17:35','YYYY-MM-DD HH24:MI:SS'),100,200000,704,1,2,'57af9f43-577a-4ed0-9519-b6fd5bced6e0') +; + +-- Sep 24, 2012 2:25:28 PM COT +-- IDEMPIERE-207 GL Journal Generator +UPDATE GL_JournalGeneratorLine SET Description='Close (4) Sales and (80) Other Income',Updated=TO_DATE('2012-09-24 14:25:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE GL_JournalGeneratorLine_ID=200000 +; + +-- Sep 24, 2012 2:26:24 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO GL_JournalGeneratorLine (IsCopyAllDimensions,IsSameProduct,GL_JournalGeneratorLine_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,Description,IsActive,GL_JournalGenerator_ID,Updated,UpdatedBy,SeqNo,AmtMultiplier,RoundFactor,GL_JournalGeneratorLine_UU) VALUES ('Y','N',200001,11,0,TO_DATE('2012-09-24 14:26:24','YYYY-MM-DD HH24:MI:SS'),100,'Close (5) Cost of Goods Sold','Y',200000,TO_DATE('2012-09-24 14:26:24','YYYY-MM-DD HH24:MI:SS'),100,20,-1.000000000000,2,'4c1a5d2a-e48f-4315-ac80-14544e25b568') +; + +-- Sep 24, 2012 2:29:17 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO GL_JournalGeneratorSource (GL_JournalGeneratorSource_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy,GL_JournalGeneratorLine_ID,C_ElementValue_ID,AmtMultiplier,RoundFactor,GL_JournalGeneratorSource_UU) VALUES (200002,11,0,TO_DATE('2012-09-24 14:29:17','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_DATE('2012-09-24 14:29:17','YYYY-MM-DD HH24:MI:SS'),100,200001,429,1,2,'f4f9fdfc-14dc-4fb6-9af7-e856a584afab') +; + +-- Sep 24, 2012 2:29:42 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO GL_JournalGeneratorLine (IsCopyAllDimensions,IsSameProduct,GL_JournalGeneratorLine_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,Description,IsActive,GL_JournalGenerator_ID,Updated,UpdatedBy,SeqNo,AmtMultiplier,RoundFactor,GL_JournalGeneratorLine_UU) VALUES ('Y','N',200002,11,0,TO_DATE('2012-09-24 14:29:42','YYYY-MM-DD HH24:MI:SS'),100,'Close (6) Expenses','Y',200000,TO_DATE('2012-09-24 14:29:42','YYYY-MM-DD HH24:MI:SS'),100,30,-1.000000000000,2,'6a1fa3f1-78e7-4174-86b2-9aabf59322bc') +; + +-- Sep 24, 2012 2:30:46 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO GL_JournalGeneratorSource (GL_JournalGeneratorSource_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy,GL_JournalGeneratorLine_ID,C_ElementValue_ID,AmtMultiplier,RoundFactor,GL_JournalGeneratorSource_UU) VALUES (200003,11,0,TO_DATE('2012-09-24 14:30:45','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_DATE('2012-09-24 14:30:45','YYYY-MM-DD HH24:MI:SS'),100,200002,449,1,2,'ea2bbf84-169a-4b34-892f-ef5ad109c823') +; + +-- Sep 24, 2012 2:31:12 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO GL_JournalGeneratorLine (IsCopyAllDimensions,IsSameProduct,GL_JournalGeneratorLine_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,Description,IsActive,GL_JournalGenerator_ID,Updated,UpdatedBy,SeqNo,AmtMultiplier,RoundFactor,GL_JournalGeneratorLine_UU) VALUES ('Y','N',200003,11,0,TO_DATE('2012-09-24 14:31:12','YYYY-MM-DD HH24:MI:SS'),100,'Close (7) Expenses','Y',200000,TO_DATE('2012-09-24 14:31:12','YYYY-MM-DD HH24:MI:SS'),100,40,-1.000000000000,2,'54db5016-489f-4756-a106-f93a9ad0be8a') +; + +-- Sep 24, 2012 2:32:03 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO GL_JournalGeneratorSource (GL_JournalGeneratorSource_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy,GL_JournalGeneratorLine_ID,C_ElementValue_ID,AmtMultiplier,RoundFactor,GL_JournalGeneratorSource_UU) VALUES (200004,11,0,TO_DATE('2012-09-24 14:32:02','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_DATE('2012-09-24 14:32:02','YYYY-MM-DD HH24:MI:SS'),100,200003,783,1,2,'a78c163f-05c6-47ae-8ea2-f63b9d11ef7a') +; + +-- Sep 24, 2012 2:32:17 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO GL_JournalGeneratorLine (IsCopyAllDimensions,IsSameProduct,GL_JournalGeneratorLine_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,Description,IsActive,GL_JournalGenerator_ID,Updated,UpdatedBy,SeqNo,AmtMultiplier,RoundFactor,GL_JournalGeneratorLine_UU) VALUES ('Y','N',200004,11,0,TO_DATE('2012-09-24 14:32:17','YYYY-MM-DD HH24:MI:SS'),100,'Close (82) Other Expense and (83) Expense (Absorbed)','Y',200000,TO_DATE('2012-09-24 14:32:17','YYYY-MM-DD HH24:MI:SS'),100,50,-1.000000000000,2,'8c9e465f-49dd-4145-a2a2-12ac48973418') +; + +-- Sep 24, 2012 2:33:17 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO GL_JournalGeneratorSource (GL_JournalGeneratorSource_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy,GL_JournalGeneratorLine_ID,C_ElementValue_ID,AmtMultiplier,RoundFactor,GL_JournalGeneratorSource_UU) VALUES (200005,11,0,TO_DATE('2012-09-24 14:33:15','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_DATE('2012-09-24 14:33:15','YYYY-MM-DD HH24:MI:SS'),100,200004,716,1,2,'0d0629f8-87ec-4909-8b1e-a480fc90118d') +; + +-- Sep 24, 2012 2:33:27 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO GL_JournalGeneratorSource (GL_JournalGeneratorSource_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy,GL_JournalGeneratorLine_ID,C_ElementValue_ID,AmtMultiplier,RoundFactor,GL_JournalGeneratorSource_UU) VALUES (200006,11,0,TO_DATE('2012-09-24 14:33:27','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_DATE('2012-09-24 14:33:27','YYYY-MM-DD HH24:MI:SS'),100,200004,50008,1,2,'79807f6d-c9f2-49db-b573-2dd0a087a1ee') +; + +-- Sep 24, 2012 2:38:28 PM COT +-- IDEMPIERE-207 GL Journal Generator +UPDATE AD_Tab SET OrderByClause='SeqNo',Updated=TO_DATE('2012-09-24 14:38:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=200021 +; + +-- Sep 24, 2012 2:52:41 PM COT +INSERT INTO GL_JournalGenerator (GL_JournalGenerator_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,Description,Help,IsActive,Name,Updated,UpdatedBy,C_ElementValueAdjustDR_ID,C_ElementValueAdjustCR_ID,C_DocType_ID,GL_Category_ID,GenerateGLJournal,C_AcctSchema_ID,PostingType,GL_JournalGenerator_UU) VALUES (200001,11,0,TO_DATE('2012-09-24 14:52:41','YYYY-MM-DD HH24:MI:SS'),100,'Step 1 - close Income Summary to Retained Earnings','Executed on year-end - must be executed after -> Year-End Closing Sample - step 1','Y','Year-End Closing Sample - step 2',TO_DATE('2012-09-24 14:52:41','YYYY-MM-DD HH24:MI:SS'),100,631,631,115,108,'N ',101,'A','c81431ee-d7a3-4123-9ebb-12b41a1364f4') +; + +-- Sep 24, 2012 3:00:46 PM COT +INSERT INTO GL_JournalGeneratorLine (IsCopyAllDimensions,IsSameProduct,GL_JournalGeneratorLine_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,Description,IsActive,GL_JournalGenerator_ID,Updated,UpdatedBy,SeqNo,C_ElementValueCR_ID,AmtMultiplier,RoundFactor,GL_JournalGeneratorLine_UU) VALUES ('N','N',200005,11,0,TO_DATE('2012-09-24 15:00:46','YYYY-MM-DD HH24:MI:SS'),100,'Move Income Summary to Retained Earnings','Y',200001,TO_DATE('2012-09-24 15:00:46','YYYY-MM-DD HH24:MI:SS'),100,10,771,1,2,'56b30bc0-aee2-4649-b527-80daeec4b8fb') +; + +-- Sep 24, 2012 3:04:50 PM COT +INSERT INTO GL_JournalGeneratorSource (GL_JournalGeneratorSource_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy,GL_JournalGeneratorLine_ID,C_ElementValue_ID,AmtMultiplier,RoundFactor,GL_JournalGeneratorSource_UU) VALUES (200008,11,0,TO_DATE('2012-09-24 15:04:49','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_DATE('2012-09-24 15:04:49','YYYY-MM-DD HH24:MI:SS'),100,200005,771,1,2,'edb1ff7a-496c-460e-b798-dae6fd26c22c') +; + +-- Sep 24, 2012 3:39:41 PM COT +UPDATE AD_Column SET AD_Reference_Value_ID=362,Updated=TO_DATE('2012-09-24 15:39:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200217 +; + +UPDATE AD_Field SET XPosition=3 WHERE AD_Tab_ID IN (200020,200021,200022) AND IsSameLine='Y' AND IsActive='Y'; + +UPDATE AD_Field SET XPosition=1 WHERE AD_Tab_ID IN (200020,200021,200022) AND IsSameline='N' AND IsActive='Y'; + +UPDATE AD_Field SET ColumnSpan=1 WHERE AD_Tab_ID IN (200020,200021,200022) AND DisplayLength<30 AND IsActive='Y'; + +UPDATE AD_Field SET ColumnSpan=3 WHERE AD_Tab_ID IN (200020,200021,200022) AND DisplayLength>=30 AND IsActive='Y'; + +UPDATE AD_Field SET NumLines=3 WHERE AD_Tab_ID IN (200020,200021,200022) AND AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Reference_ID=14) AND IsActive='Y'; + +UPDATE AD_Field SET NumLines=5 WHERE AD_Tab_ID IN (200020,200021,200022) AND AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Reference_ID=36) AND IsActive='Y'; + +UPDATE AD_Field SET NumLines=8 WHERE AD_Tab_ID IN (200020,200021,200022) AND AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Reference_ID=34) AND IsActive='Y'; + +UPDATE AD_Field SET ColumnSpan=2 WHERE AD_Tab_ID IN (200020,200021,200022) AND AD_Field_ID IN (SELECT AD_Field_ID FROM AD_Field WHERE XPosition=1 AND ColumnSpan=1 AND IsActive='Y'); + +UPDATE AD_Field SET XPosition=4,ColumnSpan=2 WHERE AD_Tab_ID IN (200020,200021,200022) AND AD_Field_ID IN (SELECT AD_Field_ID FROM AD_Field WHERE XPosition=3 AND ColumnSpan=1 AND IsActive='Y'); + +UPDATE AD_Field SET XPosition=XPosition+1 WHERE AD_Tab_ID IN (200020,200021,200022) AND AD_Field_ID IN (SELECT fi.AD_Field_ID FROM AD_Field fi INNER JOIN AD_Column c ON (fi.AD_Column_ID=C.AD_Column_ID) WHERE c.AD_Reference_ID in (20,28) AND fi.IsActive='Y'); + +UPDATE AD_Field SET ColumnSpan=5 WHERE AD_Tab_ID IN (200020,200021,200022) AND AD_Field_ID IN (SELECT AD_Field_ID FROM AD_Field WHERE XPosition=1 AND ColumnSpan=3 AND IsActive='Y'); + +SELECT register_migration_script('918_IDEMPIERE-207.sql') FROM dual +; + diff --git a/migration/360lts-release/postgresql/918_IDEMPIERE-207.sql b/migration/360lts-release/postgresql/918_IDEMPIERE-207.sql new file mode 100644 index 0000000000..777f1c07de --- /dev/null +++ b/migration/360lts-release/postgresql/918_IDEMPIERE-207.sql @@ -0,0 +1,1509 @@ +-- Sep 24, 2012 12:16:27 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO AD_Window (AD_Window_ID,WindowType,IsSOTrx,IsDefault,IsBetaFunctionality,EntityType,Name,IsActive,Created,UpdatedBy,CreatedBy,Updated,AD_Org_ID,AD_Client_ID,Processing) VALUES (200013,'M','Y','N','N','D','GL Journal Generator','Y',TO_TIMESTAMP('2012-09-24 12:16:25','YYYY-MM-DD HH24:MI:SS'),100,100,TO_TIMESTAMP('2012-09-24 12:16:25','YYYY-MM-DD HH24:MI:SS'),0,0,'N') +; + +-- Sep 24, 2012 12:16:27 PM COT +INSERT INTO AD_Window_Trl (AD_Language,AD_Window_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Window_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Window t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Window_ID=200013 AND NOT EXISTS (SELECT * FROM AD_Window_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Window_ID=t.AD_Window_ID) +; + +-- Sep 24, 2012 12:16:28 PM COT +INSERT INTO AD_Table (IsSecurityEnabled,AccessLevel,AD_Window_ID,AD_Table_ID,IsHighVolume,ImportTable,IsView,IsChangeLog,EntityType,IsDeleteable,ReplicationType,TableName,Name,AD_Client_ID,IsActive,AD_Org_ID,CreatedBy,Updated,UpdatedBy,Created) VALUES ('N','3',200013,200021,'N','N','N','Y','D','Y','L','GL_JournalGenerator','GL Journal Generator',0,'Y',0,100,TO_TIMESTAMP('2012-09-24 12:16:27','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2012-09-24 12:16:27','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:28 PM COT +INSERT INTO AD_Table_Trl (AD_Language,AD_Table_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Table_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Table t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Table_ID=200021 AND NOT EXISTS (SELECT * FROM AD_Table_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Table_ID=t.AD_Table_ID) +; + +-- Sep 24, 2012 12:16:28 PM COT +INSERT INTO AD_Sequence (IncrementNo,StartNewYear,CurrentNextSys,IsTableID,StartNo,CurrentNext,IsAudited,IsAutoSequence,AD_Sequence_ID,Description,Name,AD_Org_ID,AD_Client_ID,Updated,UpdatedBy,Created,CreatedBy,IsActive) VALUES (1,'N',200000,'Y',1000000,1000000,'N','Y',200021,'Table GL_JournalGenerator','GL_JournalGenerator',0,0,TO_TIMESTAMP('2012-09-24 12:16:28','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2012-09-24 12:16:28','YYYY-MM-DD HH24:MI:SS'),100,'Y') +; + +-- Sep 24, 2012 12:16:29 PM COT +INSERT INTO AD_Element (AD_Element_ID,ColumnName,EntityType,Name,PrintName,AD_Client_ID,Created,Updated,IsActive,AD_Org_ID,CreatedBy,UpdatedBy) VALUES (200134,'GL_JournalGenerator_ID','D','GL Journal Generator','GL Journal Generator',0,TO_TIMESTAMP('2012-09-24 12:16:28','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-24 12:16:28','YYYY-MM-DD HH24:MI:SS'),'Y',0,100,100) +; + +-- Sep 24, 2012 12:16:29 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,PO_Name,Name,Description,PrintName,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.PO_Name,t.Name,t.Description,t.PrintName,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200134 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 12:16:30 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200494,200021,'D',1,'Y','N','N','N',22,'N',13,'Y','Y',200134,'N','N','N','GL_JournalGenerator_ID','GL Journal Generator',100,TO_TIMESTAMP('2012-09-24 12:16:29','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:29','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:30 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200494 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:30 PM COT +CREATE TABLE GL_JournalGenerator (GL_JournalGenerator_ID NUMERIC(10) NOT NULL, CONSTRAINT GL_JournalGenerator_Key PRIMARY KEY (GL_JournalGenerator_ID)) +; + +-- Sep 24, 2012 12:16:30 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('@#AD_Client_ID@',200495,200021,'D',1,'Y','N','N','A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','N',22,'N',19,'Y','N',102,'N','N','N','AD_Client_ID','Client/Tenant for this installation.','Client',100,TO_TIMESTAMP('2012-09-24 12:16:30','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:30','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:30 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200495 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:30 PM COT +ALTER TABLE GL_JournalGenerator ADD COLUMN AD_Client_ID NUMERIC(10) NOT NULL +; + +-- Sep 24, 2012 12:16:31 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,AD_Val_Rule_ID,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('@#AD_Org_ID@',200496,200021,'D',1,'Y','N','N','An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','N',22,'N',19,'Y',104,'N',113,'N','N','N','AD_Org_ID','Organizational entity within client','Organization',100,TO_TIMESTAMP('2012-09-24 12:16:31','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:31','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:31 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200496 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:31 PM COT +ALTER TABLE GL_JournalGenerator ADD COLUMN AD_Org_ID NUMERIC(10) NOT NULL +; + +-- Sep 24, 2012 12:16:32 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200497,200021,'D',1,'Y','N','N','The Created field indicates the date that this record was created.','N',7,'N',16,'Y','N',245,'N','N','N','Created','Date this record was created','Created',100,TO_TIMESTAMP('2012-09-24 12:16:31','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:31','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:32 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200497 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:32 PM COT +ALTER TABLE GL_JournalGenerator ADD COLUMN Created TIMESTAMP NOT NULL +; + +-- Sep 24, 2012 12:16:32 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200498,200021,'D',1,110,'Y','N','N','The Created By field indicates the user who created this record.','N',22,'N',18,'Y','N',246,'N','N','N','CreatedBy','User who created this records','Created By',100,TO_TIMESTAMP('2012-09-24 12:16:32','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:32','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:32 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200498 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:32 PM COT +ALTER TABLE GL_JournalGenerator ADD COLUMN CreatedBy NUMERIC(10) NOT NULL +; + +-- Sep 24, 2012 12:16:33 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200499,200021,'D',1,'N','N','N','A description is limited to 255 characters.','N',255,'Y',10,'Y','N',275,'N','Y','N','Description','Optional short description of the record','Description',100,TO_TIMESTAMP('2012-09-24 12:16:32','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:32','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:33 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200499 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:33 PM COT +ALTER TABLE GL_JournalGenerator ADD COLUMN Description VARCHAR(255) DEFAULT NULL +; + +-- Sep 24, 2012 12:16:33 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200500,200021,'D',1,'N','N','N','The Help field contains a hint, comment or help about the use of this item.','N',2000,'N',14,'Y','N',326,'N','Y','N','Help','Comment or Hint','Comment/Help',100,TO_TIMESTAMP('2012-09-24 12:16:33','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:33','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:33 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200500 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:33 PM COT +ALTER TABLE GL_JournalGenerator ADD COLUMN Help VARCHAR(2000) DEFAULT NULL +; + +-- Sep 24, 2012 12:16:34 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('Y',200501,200021,'D',1,'Y','N','N','There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports. +There are two reasons for de-activating and not deleting records: +(1) The system requires the record for audit purposes. +(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','N',1,'N',20,'Y','N',348,'N','Y','N','IsActive','The record is active in the system','Active',100,TO_TIMESTAMP('2012-09-24 12:16:34','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:34','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:34 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200501 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:34 PM COT +ALTER TABLE GL_JournalGenerator ADD COLUMN IsActive CHAR(1) DEFAULT 'Y' CHECK (IsActive IN ('Y','N')) NOT NULL +; + +-- Sep 24, 2012 12:16:35 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,SeqNo,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200502,200021,'D',1,'Y','N','Y',1,'The name of an entity (record) is used as an default search option in addition to the search key. The name is up to 60 characters in length.','N',60,'Y',10,'Y','N',469,'N','Y','N','Name','Alphanumeric identifier of the entity','Name',100,TO_TIMESTAMP('2012-09-24 12:16:34','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:34','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:35 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200502 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:35 PM COT +ALTER TABLE GL_JournalGenerator ADD COLUMN Name VARCHAR(60) NOT NULL +; + +-- Sep 24, 2012 12:16:36 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200503,200021,'D',1,'Y','N','N','The Updated field indicates the date that this record was updated.','N',7,'N',16,'Y','N',607,'N','N','N','Updated','Date this record was updated','Updated',100,TO_TIMESTAMP('2012-09-24 12:16:35','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:35','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:36 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200503 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:36 PM COT +ALTER TABLE GL_JournalGenerator ADD COLUMN Updated TIMESTAMP NOT NULL +; + +-- Sep 24, 2012 12:16:36 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200504,200021,'D',1,110,'Y','N','N','The Updated By field indicates the user who updated this record.','N',22,'N',18,'Y','N',608,'N','N','N','UpdatedBy','User who updated this records','Updated By',100,TO_TIMESTAMP('2012-09-24 12:16:36','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:36','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:36 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200504 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:36 PM COT +ALTER TABLE GL_JournalGenerator ADD COLUMN UpdatedBy NUMERIC(10) NOT NULL +; + +-- Sep 24, 2012 12:16:37 PM COT +INSERT INTO AD_Element (AD_Element_ID,ColumnName,EntityType,Name,PrintName,AD_Client_ID,Created,Updated,IsActive,AD_Org_ID,CreatedBy,UpdatedBy) VALUES (200135,'C_ElementValueAdjustDR_ID','D','Account Adjust DR','Account Adjust DR',0,TO_TIMESTAMP('2012-09-24 12:16:36','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-24 12:16:36','YYYY-MM-DD HH24:MI:SS'),'Y',0,100,100) +; + +-- Sep 24, 2012 12:16:37 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,PO_Name,Name,Description,PrintName,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.PO_Name,t.Name,t.Description,t.PrintName,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200135 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 12:16:37 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,AD_Val_Rule_ID,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200505,200021,'D',0,362,'N','N','N','N',10,'N',18,'Y',252,'N',200135,'N','Y','N','C_ElementValueAdjustDR_ID','Account Adjust DR',100,TO_TIMESTAMP('2012-09-24 12:16:37','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:37','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:37 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200505 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:37 PM COT +ALTER TABLE GL_JournalGenerator ADD COLUMN C_ElementValueAdjustDR_ID NUMERIC(10) DEFAULT NULL +; + +-- Sep 24, 2012 12:16:38 PM COT +INSERT INTO AD_Element (AD_Element_ID,ColumnName,EntityType,Name,PrintName,AD_Client_ID,Created,Updated,IsActive,AD_Org_ID,CreatedBy,UpdatedBy) VALUES (200136,'C_ElementValueAdjustCR_ID','D','Account Adjust CR','Account Adjust CR',0,TO_TIMESTAMP('2012-09-24 12:16:37','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-24 12:16:37','YYYY-MM-DD HH24:MI:SS'),'Y',0,100,100) +; + +-- Sep 24, 2012 12:16:38 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,PO_Name,Name,Description,PrintName,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.PO_Name,t.Name,t.Description,t.PrintName,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200136 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 12:16:38 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,AD_Val_Rule_ID,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200506,200021,'D',0,362,'N','N','N','N',10,'N',18,'Y',252,'N',200136,'N','Y','N','C_ElementValueAdjustCR_ID','Account Adjust CR',100,TO_TIMESTAMP('2012-09-24 12:16:38','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:38','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:38 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200506 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:38 PM COT +ALTER TABLE GL_JournalGenerator ADD COLUMN C_ElementValueAdjustCR_ID NUMERIC(10) DEFAULT NULL +; + +-- Sep 24, 2012 12:16:39 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,AD_Val_Rule_ID,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200507,200021,'D',0,'N','N','N','The Document Type determines document sequence and processing rules','N',10,'N',19,'Y',102,'N',196,'N','Y','N','C_DocType_ID','Document type or rules','Document Type',100,TO_TIMESTAMP('2012-09-24 12:16:39','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:39','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:39 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200507 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:39 PM COT +ALTER TABLE GL_JournalGenerator ADD COLUMN C_DocType_ID NUMERIC(10) DEFAULT NULL +; + +-- Sep 24, 2012 12:16:40 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,AD_Val_Rule_ID,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('@GL_Category_ID@',200508,200021,'D',0,'N','N','N','The General Ledger Category is an optional, user defined method of grouping journal lines.','N',10,'N',19,'Y',118,'N',309,'N','Y','N','GL_Category_ID','General Ledger Category','GL Category',100,TO_TIMESTAMP('2012-09-24 12:16:39','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:39','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:40 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200508 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:40 PM COT +ALTER TABLE GL_JournalGenerator ADD COLUMN GL_Category_ID NUMERIC(10) DEFAULT NULL +; + +-- Sep 24, 2012 12:16:40 PM COT +INSERT INTO AD_Element (AD_Element_ID,ColumnName,EntityType,Name,PrintName,AD_Client_ID,Created,Updated,IsActive,AD_Org_ID,CreatedBy,UpdatedBy) VALUES (200137,'GenerateGLJournal','D','Generate GL Journal','Generate GL Journal',0,TO_TIMESTAMP('2012-09-24 12:16:40','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-24 12:16:40','YYYY-MM-DD HH24:MI:SS'),'Y',0,100,100) +; + +-- Sep 24, 2012 12:16:40 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,PO_Name,Name,Description,PrintName,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.PO_Name,t.Name,t.Description,t.PrintName,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200137 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 12:16:41 PM COT +INSERT INTO AD_Process (AD_Process_ID,IsDirectPrint,IsReport,AccessLevel,IsBetaFunctionality,WorkflowValue,ShowHelp,EntityType,Statistic_Seconds,Statistic_Count,Classname,Value,Name,AD_Org_ID,AD_Client_ID,Updated,UpdatedBy,CreatedBy,Created,IsActive) VALUES (200010,'N','N','3','N',NULL,'Y','D',0,0,'org.globalqss.process.GLJournalGenerate','GLJournalGenerate','Generate GL Journal',0,0,TO_TIMESTAMP('2012-09-24 12:16:40','YYYY-MM-DD HH24:MI:SS'),100,100,TO_TIMESTAMP('2012-09-24 12:16:40','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 24, 2012 12:16:41 PM COT +INSERT INTO AD_Process_Trl (AD_Language,AD_Process_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_ID=200010 AND NOT EXISTS (SELECT * FROM AD_Process_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_ID=t.AD_Process_ID) +; + +-- Sep 24, 2012 12:16:42 PM COT +INSERT INTO AD_Process_Para (IsRange,AD_Process_Para_ID,FieldLength,AD_Process_ID,IsCentrallyMaintained,DefaultValue2,AD_Reference_ID,SeqNo,IsMandatory,DefaultValue,AD_Element_ID,EntityType,Name,ColumnName,IsActive,AD_Client_ID,UpdatedBy,Updated,CreatedBy,Created,AD_Org_ID) VALUES ('Y',200036,10,200010,'Y','@SQL=SELECT firstof(SYSDATE,''MM'')-1 FROM DUAL',15,10,'Y','@SQL=SELECT firstof(add_months(SYSDATE,-1),''MM'') FROM DUAL',1479,'D','Processing date','ProcessingDate','Y',0,100,TO_TIMESTAMP('2012-09-24 12:16:41','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2012-09-24 12:16:41','YYYY-MM-DD HH24:MI:SS'),0) +; + +-- Sep 24, 2012 12:16:42 PM COT +INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=200036 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID) +; + +-- Sep 24, 2012 12:16:42 PM COT +INSERT INTO AD_Process_Para (IsRange,AD_Process_Para_ID,FieldLength,Help,AD_Process_ID,IsCentrallyMaintained,AD_Reference_ID,SeqNo,IsMandatory,DefaultValue,AD_Element_ID,EntityType,Name,ColumnName,Description,IsActive,AD_Client_ID,UpdatedBy,Updated,CreatedBy,Created,AD_Org_ID) VALUES ('N',200037,10,'The Accounting Date indicates the date to be used on the General Ledger account entries generated from this document. It is also used for any currency conversion.',200010,'Y',15,20,'Y','@#Date@',263,'D','Account Date','DateAcct','Accounting Date','Y',0,100,TO_TIMESTAMP('2012-09-24 12:16:42','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2012-09-24 12:16:42','YYYY-MM-DD HH24:MI:SS'),0) +; + +-- Sep 24, 2012 12:16:42 PM COT +INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=200037 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID) +; + +-- Sep 24, 2012 12:16:43 PM COT +INSERT INTO AD_Process_Para (IsRange,AD_Process_Para_ID,FieldLength,AD_Process_ID,IsCentrallyMaintained,AD_Reference_ID,SeqNo,IsMandatory,DefaultValue,AD_Element_ID,EntityType,Name,ColumnName,Description,IsActive,AD_Client_ID,UpdatedBy,Updated,CreatedBy,Created,AD_Org_ID) VALUES ('N',200038,10,200010,'Y',20,30,'Y','Y',1667,'D','Simulation','IsSimulation','Performing the function is only simulated','Y',0,100,TO_TIMESTAMP('2012-09-24 12:16:42','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2012-09-24 12:16:42','YYYY-MM-DD HH24:MI:SS'),0) +; + +-- Sep 24, 2012 12:16:43 PM COT +INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=200038 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID) +; + +-- Sep 24, 2012 12:16:43 PM COT +INSERT INTO AD_Process_Para (IsRange,AD_Process_Para_ID,FieldLength,Help,AD_Process_ID,IsCentrallyMaintained,AD_Reference_ID,AD_Val_Rule_ID,SeqNo,IsMandatory,AD_Reference_Value_ID,AD_Element_ID,EntityType,Name,ColumnName,Description,IsActive,AD_Client_ID,UpdatedBy,Updated,CreatedBy,Created,AD_Org_ID) VALUES ('N',200039,10,'You find the current status in the Document Status field. The options are listed in a popup',200010,'Y',17,219,40,'N',135,287,'D','Document Action','DocAction','The targeted status of the document','Y',0,100,TO_TIMESTAMP('2012-09-24 12:16:43','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2012-09-24 12:16:43','YYYY-MM-DD HH24:MI:SS'),0) +; + +-- Sep 24, 2012 12:16:43 PM COT +INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=200039 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID) +; + +-- Sep 24, 2012 12:16:44 PM COT +INSERT INTO AD_Process_Para (IsRange,AD_Process_Para_ID,FieldLength,Help,AD_Process_ID,IsCentrallyMaintained,AD_Reference_ID,SeqNo,IsMandatory,AD_Element_ID,EntityType,Name,ColumnName,Description,IsActive,AD_Client_ID,UpdatedBy,Updated,CreatedBy,Created,AD_Org_ID) VALUES ('N',200040,30,'The document number is usually automatically generated by the system and determined by the document type of the document. If the document is not saved, the preliminary number is displayed in "<>".',200010,'Y',10,50,'N',290,'D','Document No','DocumentNo','Document sequence number of the document','Y',0,100,TO_TIMESTAMP('2012-09-24 12:16:43','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2012-09-24 12:16:43','YYYY-MM-DD HH24:MI:SS'),0) +; + +-- Sep 24, 2012 12:16:44 PM COT +INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=200040 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID) +; + +-- Sep 24, 2012 12:16:44 PM COT +INSERT INTO AD_Process_Para (IsRange,AD_Process_Para_ID,FieldLength,Help,AD_Process_ID,IsCentrallyMaintained,AD_Reference_ID,SeqNo,IsMandatory,AD_Reference_Value_ID,AD_Element_ID,EntityType,Name,ColumnName,Description,IsActive,AD_Client_ID,UpdatedBy,Updated,CreatedBy,Created,AD_Org_ID) VALUES ('N',200041,10,'A Business Partner is anyone with whom you transact. This can include Vendor, Customer, Employee or Salesperson',200010,'Y',30,60,'N',138,187,'D','Business Partner ','C_BPartner_ID','Identifies a Business Partner','Y',0,100,TO_TIMESTAMP('2012-09-24 12:16:44','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2012-09-24 12:16:44','YYYY-MM-DD HH24:MI:SS'),0) +; + +-- Sep 24, 2012 12:16:44 PM COT +INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=200041 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID) +; + +-- Sep 24, 2012 12:16:45 PM COT +INSERT INTO AD_Process_Para (IsRange,AD_Process_Para_ID,FieldLength,Help,AD_Process_ID,IsCentrallyMaintained,AD_Reference_ID,SeqNo,IsMandatory,AD_Reference_Value_ID,AD_Element_ID,EntityType,Name,ColumnName,Description,IsActive,AD_Client_ID,UpdatedBy,Updated,CreatedBy,Created,AD_Org_ID) VALUES ('N',200042,10,'Identifies an item which is either purchased or sold in this organization.',200010,'Y',30,70,'N',162,454,'D','Product','M_Product_ID','Product, Service, Item','Y',0,100,TO_TIMESTAMP('2012-09-24 12:16:44','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2012-09-24 12:16:44','YYYY-MM-DD HH24:MI:SS'),0) +; + +-- Sep 24, 2012 12:16:45 PM COT +INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=200042 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID) +; + +-- Sep 24, 2012 12:16:46 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,AD_Process_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200509,200021,'D',0,'N','N','N','N',10,'N',28,'Y','N',200137,200010,'N','Y','N','GenerateGLJournal','Generate GL Journal',100,TO_TIMESTAMP('2012-09-24 12:16:45','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:45','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:46 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200509 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:46 PM COT +ALTER TABLE GL_JournalGenerator ADD COLUMN GenerateGLJournal CHAR(10) DEFAULT NULL +; + +-- Sep 24, 2012 12:16:47 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('@$C_AcctSchema_ID@',200510,200021,'D',0,'N','N','N','An Accounting Schema defines the rules used in accounting such as costing method, currency and calendar','N',22,'N',19,'Y','N',181,'N','Y','N','C_AcctSchema_ID','Rules for accounting','Accounting Schema',100,TO_TIMESTAMP('2012-09-24 12:16:46','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:46','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:47 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200510 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:47 PM COT +ALTER TABLE GL_JournalGenerator ADD COLUMN C_AcctSchema_ID NUMERIC(10) DEFAULT NULL +; + +-- Sep 24, 2012 12:16:48 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('A',200511,200021,'D',0,125,'N','N','N','The Posting Type indicates the type of amount (Actual, Budget, Reservation, Commitment, Statistical) the transaction.','N',1,'N',17,'Y','N',514,'N','Y','N','PostingType','The type of posted amount for the transaction','PostingType',100,TO_TIMESTAMP('2012-09-24 12:16:47','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:47','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:48 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200511 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:48 PM COT +ALTER TABLE GL_JournalGenerator ADD COLUMN PostingType CHAR(1) DEFAULT 'A' +; + +-- Sep 24, 2012 12:16:48 PM COT +INSERT INTO AD_Tab (IsSingleRow,AD_Window_ID,SeqNo,IsTranslationTab,IsSortTab,AD_Tab_ID,AD_Table_ID,CommitWarning,HasTree,IsInfoTab,IsReadOnly,TabLevel,IsInsertRecord,IsAdvancedTab,EntityType,Name,AD_Client_ID,AD_Org_ID,CreatedBy,Updated,Created,IsActive,UpdatedBy,Processing) VALUES ('Y',200013,10,'N','N',200020,200021,NULL,'N','Y','N',0,'Y','N','D','GL Journal Generator',0,0,100,TO_TIMESTAMP('2012-09-24 12:16:48','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-24 12:16:48','YYYY-MM-DD HH24:MI:SS'),'Y',100,'N') +; + +-- Sep 24, 2012 12:16:48 PM COT +INSERT INTO AD_Tab_Trl (AD_Language,AD_Tab_ID, Help,CommitWarning,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Tab_ID, t.Help,t.CommitWarning,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Tab t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Tab_ID=200020 AND NOT EXISTS (SELECT * FROM AD_Tab_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Tab_ID=t.AD_Tab_ID) +; + +-- Sep 24, 2012 12:16:49 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200020,22,'Y','N','N',200495,'N',10,'Y',200511,'N','A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','D','Client/Tenant for this installation.','Client',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:48','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:16:48','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:49 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200511 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:16:50 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200020,22,'Y','Y','N',200496,'N',20,'Y',200512,'N','An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','D','Organizational entity within client','Organization',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:49','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:16:49','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:50 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200512 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:16:50 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200020,60,'Y','N','N',200502,'N',30,'Y',200513,'N','The name of an entity (record) is used as an default search option in addition to the search key. The name is up to 60 characters in length.','D','Alphanumeric identifier of the entity','Name',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:50','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:16:50','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:50 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200513 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:16:51 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200020,255,'Y','N','N',200499,'N',40,'Y',200514,'N','A description is limited to 255 characters.','D','Optional short description of the record','Description',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:50','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:16:50','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:51 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200514 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:16:51 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200020,2000,'Y','N','N',200500,'N',50,'Y',200515,'N','The Help field contains a hint, comment or help about the use of this item.','D','Comment or Hint','Comment/Help',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:51','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:16:51','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:51 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200515 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:16:52 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200020,10,'Y','N','N',200507,'N',60,'Y',200516,'N','The Document Type determines document sequence and processing rules','D','Document type or rules','Document Type',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:51','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:16:51','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:52 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200516 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:16:52 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200020,10,'Y','N','N',200508,'N',70,'Y',200517,'N','The General Ledger Category is an optional, user defined method of grouping journal lines.','D','General Ledger Category','GL Category',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:52','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:16:52','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:52 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200517 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:16:53 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200020,1,'Y','Y','N',200511,'N',80,'Y',200518,'N','The Posting Type indicates the type of amount (Actual, Budget, Reservation, Commitment, Statistical) the transaction.','D','The type of posted amount for the transaction','PostingType',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:52','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:16:52','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:53 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200518 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:16:53 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200020,22,'Y','N','N',200510,'N',90,'Y',200519,'N','An Accounting Schema defines the rules used in accounting such as costing method, currency and calendar','D','Rules for accounting','Accounting Schema',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:53','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:16:53','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:53 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200519 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:16:54 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200020,10,'Y','N','N',200505,'N',100,'Y',200520,'N','D','Account Adjust DR',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:53','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:16:53','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:54 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200520 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:16:54 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200020,10,'Y','Y','N',200506,'N',110,'Y',200521,'N','D','Account Adjust CR',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:54','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:16:54','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:54 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200521 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:16:55 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200020,10,'Y','N','N',200509,'N',120,'Y',200522,'N','D','Generate GL Journal',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:54','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:16:54','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:55 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200522 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:16:55 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200020,1,'Y','N','N',200501,'N',130,'Y',200523,'N','There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports. +There are two reasons for de-activating and not deleting records: +(1) The system requires the record for audit purposes. +(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','D','The record is active in the system','Active',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:55','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:16:55','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:55 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200523 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:16:56 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200020,22,'N','N','N',200494,'N',0,'Y',200524,'N','D','GL Journal Generator',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:55','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:16:55','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:56 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200524 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:16:56 PM COT +INSERT INTO AD_Table (IsSecurityEnabled,AccessLevel,AD_Window_ID,AD_Table_ID,IsHighVolume,ImportTable,IsView,IsChangeLog,EntityType,IsDeleteable,ReplicationType,TableName,Name,AD_Client_ID,IsActive,AD_Org_ID,CreatedBy,Updated,UpdatedBy,Created) VALUES ('N','3',200013,200022,'N','N','N','Y','D','Y','L','GL_JournalGeneratorLine','Generator Line',0,'Y',0,100,TO_TIMESTAMP('2012-09-24 12:16:56','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2012-09-24 12:16:56','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:16:56 PM COT +INSERT INTO AD_Table_Trl (AD_Language,AD_Table_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Table_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Table t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Table_ID=200022 AND NOT EXISTS (SELECT * FROM AD_Table_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Table_ID=t.AD_Table_ID) +; + +-- Sep 24, 2012 12:16:57 PM COT +INSERT INTO AD_Sequence (IncrementNo,StartNewYear,CurrentNextSys,IsTableID,StartNo,CurrentNext,IsAudited,IsAutoSequence,AD_Sequence_ID,Description,Name,AD_Org_ID,AD_Client_ID,Updated,UpdatedBy,Created,CreatedBy,IsActive) VALUES (1,'N',200000,'Y',1000000,1000000,'N','Y',200022,'Table GL_JournalGeneratorLine','GL_JournalGeneratorLine',0,0,TO_TIMESTAMP('2012-09-24 12:16:56','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2012-09-24 12:16:56','YYYY-MM-DD HH24:MI:SS'),100,'Y') +; + +-- Sep 24, 2012 12:16:57 PM COT +INSERT INTO AD_Element (AD_Element_ID,ColumnName,EntityType,Name,PrintName,AD_Client_ID,Created,Updated,IsActive,AD_Org_ID,CreatedBy,UpdatedBy) VALUES (200138,'GL_JournalGeneratorLine_ID','D','Generator Line','Generator Line',0,TO_TIMESTAMP('2012-09-24 12:16:57','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-24 12:16:57','YYYY-MM-DD HH24:MI:SS'),'Y',0,100,100) +; + +-- Sep 24, 2012 12:16:58 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,PO_Name,Name,Description,PrintName,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.PO_Name,t.Name,t.Description,t.PrintName,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200138 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 12:16:58 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200512,200022,'D',1,'Y','N','N','N',22,'N',13,'Y','Y',200138,'N','N','N','GL_JournalGeneratorLine_ID','Generator Line',100,TO_TIMESTAMP('2012-09-24 12:16:58','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:58','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:58 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200512 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:58 PM COT +CREATE TABLE GL_JournalGeneratorLine (GL_JournalGeneratorLine_ID NUMERIC(10) NOT NULL, CONSTRAINT GL_JournalGeneratorLine_Key PRIMARY KEY (GL_JournalGeneratorLine_ID)) +; + +-- Sep 24, 2012 12:16:59 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('@#AD_Client_ID@',200513,200022,'D',1,'Y','N','N','A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','N',22,'N',19,'Y','N',102,'N','N','N','AD_Client_ID','Client/Tenant for this installation.','Client',100,TO_TIMESTAMP('2012-09-24 12:16:58','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:58','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:59 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200513 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:59 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD COLUMN AD_Client_ID NUMERIC(10) NOT NULL +; + +-- Sep 24, 2012 12:16:59 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,AD_Val_Rule_ID,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('@#AD_Org_ID@',200514,200022,'D',1,'Y','N','N','An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','N',22,'N',19,'Y',104,'N',113,'N','N','N','AD_Org_ID','Organizational entity within client','Organization',100,TO_TIMESTAMP('2012-09-24 12:16:59','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:59','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:16:59 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200514 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:16:59 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD COLUMN AD_Org_ID NUMERIC(10) NOT NULL +; + +-- Sep 24, 2012 12:17:00 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200515,200022,'D',1,'Y','N','N','The Created field indicates the date that this record was created.','N',7,'N',16,'Y','N',245,'N','N','N','Created','Date this record was created','Created',100,TO_TIMESTAMP('2012-09-24 12:16:59','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:16:59','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:00 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200515 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:00 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD COLUMN Created TIMESTAMP NOT NULL +; + +-- Sep 24, 2012 12:17:00 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200516,200022,'D',1,110,'Y','N','N','The Created By field indicates the user who created this record.','N',22,'N',18,'Y','N',246,'N','N','N','CreatedBy','User who created this records','Created By',100,TO_TIMESTAMP('2012-09-24 12:17:00','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:00','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:00 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200516 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:00 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD COLUMN CreatedBy NUMERIC(10) NOT NULL +; + +-- Sep 24, 2012 12:17:01 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200517,200022,'D',1,'N','N','N','A description is limited to 255 characters.','N',255,'Y',10,'Y','N',275,'N','Y','N','Description','Optional short description of the record','Description',100,TO_TIMESTAMP('2012-09-24 12:17:00','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:00','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:01 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200517 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:01 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD COLUMN Description VARCHAR(255) DEFAULT NULL +; + +-- Sep 24, 2012 12:17:02 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200518,200022,'D',1,'N','N','N','The Help field contains a hint, comment or help about the use of this item.','N',2000,'N',14,'Y','N',326,'N','Y','N','Help','Comment or Hint','Comment/Help',100,TO_TIMESTAMP('2012-09-24 12:17:01','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:01','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:02 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200518 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:02 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD COLUMN Help VARCHAR(2000) DEFAULT NULL +; + +-- Sep 24, 2012 12:17:03 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('Y',200519,200022,'D',1,'Y','N','N','There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports. +There are two reasons for de-activating and not deleting records: +(1) The system requires the record for audit purposes. +(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','N',1,'N',20,'Y','N',348,'N','Y','N','IsActive','The record is active in the system','Active',100,TO_TIMESTAMP('2012-09-24 12:17:02','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:02','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:03 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200519 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:03 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD COLUMN IsActive CHAR(1) DEFAULT 'Y' CHECK (IsActive IN ('Y','N')) NOT NULL +; + +-- Sep 24, 2012 12:17:03 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200520,200022,'D',1,'Y','N','Y',1,'Y',22,'N',19,'Y','N',200134,'N','N','N','GL_JournalGenerator_ID','GL Journal Generator',100,TO_TIMESTAMP('2012-09-24 12:17:03','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:03','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:03 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200520 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:03 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD COLUMN GL_JournalGenerator_ID NUMERIC(10) NOT NULL +; + +-- Sep 24, 2012 12:17:04 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200521,200022,'D',1,'Y','N','N','The Updated field indicates the date that this record was updated.','N',7,'N',16,'Y','N',607,'N','N','N','Updated','Date this record was updated','Updated',100,TO_TIMESTAMP('2012-09-24 12:17:03','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:03','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:04 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200521 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:04 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD COLUMN Updated TIMESTAMP NOT NULL +; + +-- Sep 24, 2012 12:17:04 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200522,200022,'D',1,110,'Y','N','N','The Updated By field indicates the user who updated this record.','N',22,'N',18,'Y','N',608,'N','N','N','UpdatedBy','User who updated this records','Updated By',100,TO_TIMESTAMP('2012-09-24 12:17:04','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:04','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:04 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200522 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:04 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD COLUMN UpdatedBy NUMERIC(10) NOT NULL +; + +-- Sep 24, 2012 12:17:05 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,SeqNo,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('@SQL=SELECT NVL(MAX(SeqNo),0)+10 AS DefaultValue FROM GL_JournalGeneratorLine WHERE GL_JournalGenerator_ID=@GL_JournalGenerator_ID@',200523,200022,'D',1,'Y','N','Y',2,'The Sequence indicates the order of records','N',22,'N',11,'Y','N',566,'N','Y','N','SeqNo','Method of ordering records; lowest number comes first','Sequence',100,TO_TIMESTAMP('2012-09-24 12:17:04','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:04','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:05 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200523 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:05 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD COLUMN SeqNo NUMERIC(10) NOT NULL +; + +-- Sep 24, 2012 12:17:06 PM COT +INSERT INTO AD_Element (AD_Element_ID,ColumnName,EntityType,Name,PrintName,AD_Client_ID,Created,Updated,IsActive,AD_Org_ID,CreatedBy,UpdatedBy) VALUES (200139,'C_ElementValueDR_ID','D','Account DR','Account DR',0,TO_TIMESTAMP('2012-09-24 12:17:05','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-24 12:17:05','YYYY-MM-DD HH24:MI:SS'),'Y',0,100,100) +; + +-- Sep 24, 2012 12:17:06 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,PO_Name,Name,Description,PrintName,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.PO_Name,t.Name,t.Description,t.PrintName,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200139 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 12:17:06 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,AD_Val_Rule_ID,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200524,200022,'D',0,362,'N','N','N','N',10,'N',18,'Y',252,'N',200139,'N','Y','N','C_ElementValueDR_ID','Account DR',100,TO_TIMESTAMP('2012-09-24 12:17:06','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:06','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:06 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200524 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:06 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD COLUMN C_ElementValueDR_ID NUMERIC(10) DEFAULT NULL +; + +-- Sep 24, 2012 12:17:07 PM COT +INSERT INTO AD_Element (AD_Element_ID,ColumnName,EntityType,Name,PrintName,AD_Client_ID,Created,Updated,IsActive,AD_Org_ID,CreatedBy,UpdatedBy) VALUES (200140,'C_ElementValueCR_ID','D','Account CR','Account CR',0,TO_TIMESTAMP('2012-09-24 12:17:06','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-24 12:17:06','YYYY-MM-DD HH24:MI:SS'),'Y',0,100,100) +; + +-- Sep 24, 2012 12:17:07 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,PO_Name,Name,Description,PrintName,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.PO_Name,t.Name,t.Description,t.PrintName,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200140 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 12:17:07 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,AD_Val_Rule_ID,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200525,200022,'D',0,362,'N','N','N','N',10,'N',18,'Y',252,'N',200140,'N','Y','N','C_ElementValueCR_ID','Account CR',100,TO_TIMESTAMP('2012-09-24 12:17:07','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:07','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:07 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200525 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:07 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD COLUMN C_ElementValueCR_ID NUMERIC(10) DEFAULT NULL +; + +-- Sep 24, 2012 12:17:08 PM COT +INSERT INTO AD_Element (AD_Element_ID,ColumnName,EntityType,Name,PrintName,AD_Client_ID,Created,Updated,IsActive,AD_Org_ID,CreatedBy,UpdatedBy) VALUES (200141,'BPDimensionType','D','Type of BP Dimension','Type of BP Dimension',0,TO_TIMESTAMP('2012-09-24 12:17:07','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-24 12:17:07','YYYY-MM-DD HH24:MI:SS'),'Y',0,100,100) +; + +-- Sep 24, 2012 12:17:08 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,PO_Name,Name,Description,PrintName,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.PO_Name,t.Name,t.Description,t.PrintName,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200141 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 12:17:08 PM COT +INSERT INTO AD_Reference (AD_Reference_ID,ValidationType,EntityType,Name,AD_Client_ID,AD_Org_ID,CreatedBy,Updated,IsActive,Created,UpdatedBy) VALUES (200008,'L','D','GL_JournalGeneratorLine BPDimensionType',0,0,100,TO_TIMESTAMP('2012-09-24 12:17:08','YYYY-MM-DD HH24:MI:SS'),'Y',TO_TIMESTAMP('2012-09-24 12:17:08','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:08 PM COT +INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=200008 AND NOT EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID) +; + +-- Sep 24, 2012 12:17:09 PM COT +INSERT INTO AD_Ref_List (AD_Ref_List_ID,AD_Reference_ID,EntityType,Value,Name,CreatedBy,Updated,UpdatedBy,Created,AD_Org_ID,IsActive,AD_Client_ID) VALUES (200027,200008,'D','C','Column',100,TO_TIMESTAMP('2012-09-24 12:17:09','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2012-09-24 12:17:09','YYYY-MM-DD HH24:MI:SS'),0,'Y',0) +; + +-- Sep 24, 2012 12:17:09 PM COT +INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=200027 AND NOT EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID) +; + +-- Sep 24, 2012 12:17:10 PM COT +INSERT INTO AD_Ref_List (AD_Ref_List_ID,AD_Reference_ID,EntityType,Value,Name,CreatedBy,Updated,UpdatedBy,Created,AD_Org_ID,IsActive,AD_Client_ID) VALUES (200028,200008,'D','F','Fixed',100,TO_TIMESTAMP('2012-09-24 12:17:09','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2012-09-24 12:17:09','YYYY-MM-DD HH24:MI:SS'),0,'Y',0) +; + +-- Sep 24, 2012 12:17:10 PM COT +INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=200028 AND NOT EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID) +; + +-- Sep 24, 2012 12:17:10 PM COT +INSERT INTO AD_Ref_List (AD_Ref_List_ID,AD_Reference_ID,EntityType,Value,Name,CreatedBy,Updated,UpdatedBy,Created,AD_Org_ID,IsActive,AD_Client_ID) VALUES (200029,200008,'D','S','Same',100,TO_TIMESTAMP('2012-09-24 12:17:10','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2012-09-24 12:17:10','YYYY-MM-DD HH24:MI:SS'),0,'Y',0) +; + +-- Sep 24, 2012 12:17:10 PM COT +INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=200029 AND NOT EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID) +; + +-- Sep 24, 2012 12:17:11 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200526,200022,'D',0,200008,'N','N','N','N',1,'N',17,'Y','N',200141,'N','Y','N','BPDimensionType','Type of BP Dimension',100,TO_TIMESTAMP('2012-09-24 12:17:10','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:10','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:11 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200526 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:11 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD COLUMN BPDimensionType CHAR(1) DEFAULT NULL +; + +-- Sep 24, 2012 12:17:11 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200527,200022,'D',0,138,'N','N','N','A Business Partner is anyone with whom you transact. This can include Vendor, Customer, Employee or Salesperson','N',10,'N',30,'Y','N',187,'N','Y','N','C_BPartner_ID','Identifies a Business Partner','Business Partner ',100,TO_TIMESTAMP('2012-09-24 12:17:11','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:11','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:11 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200527 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:11 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD COLUMN C_BPartner_ID NUMERIC(10) DEFAULT NULL +; + +-- Sep 24, 2012 12:17:12 PM COT +INSERT INTO AD_Element (AD_Element_ID,ColumnName,EntityType,Name,PrintName,AD_Client_ID,Created,Updated,IsActive,AD_Org_ID,CreatedBy,UpdatedBy) VALUES (200142,'BPColumn','D','BP Column','BP Column',0,TO_TIMESTAMP('2012-09-24 12:17:12','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-24 12:17:12','YYYY-MM-DD HH24:MI:SS'),'Y',0,100,100) +; + +-- Sep 24, 2012 12:17:12 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,PO_Name,Name,Description,PrintName,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.PO_Name,t.Name,t.Description,t.PrintName,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200142 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 12:17:13 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200528,200022,'D',0,'N','N','N','N',100,'N',10,'Y','N',200142,'N','Y','N','BPColumn','BP Column',100,TO_TIMESTAMP('2012-09-24 12:17:12','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:12','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:13 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200528 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:13 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD COLUMN BPColumn VARCHAR(100) DEFAULT NULL +; + +-- Sep 24, 2012 12:17:13 PM COT +INSERT INTO AD_Element (AD_Element_ID,ColumnName,EntityType,Name,PrintName,AD_Client_ID,Created,Updated,IsActive,AD_Org_ID,CreatedBy,UpdatedBy) VALUES (200143,'IsCopyAllDimensions','D','Copy All Dimensions','Copy All Dimensions',0,TO_TIMESTAMP('2012-09-24 12:17:13','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-24 12:17:13','YYYY-MM-DD HH24:MI:SS'),'Y',0,100,100) +; + +-- Sep 24, 2012 12:17:13 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,PO_Name,Name,Description,PrintName,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.PO_Name,t.Name,t.Description,t.PrintName,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200143 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 12:17:14 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('N',200529,200022,'D',0,'Y','N','N','N',1,'N',20,'Y','N',200143,'N','Y','N','IsCopyAllDimensions','Copy All Dimensions',100,TO_TIMESTAMP('2012-09-24 12:17:13','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:13','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:14 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200529 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:14 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD COLUMN IsCopyAllDimensions CHAR(1) DEFAULT 'N' CHECK (IsCopyAllDimensions IN ('Y','N')) NOT NULL +; + +-- Sep 24, 2012 12:17:15 PM COT +INSERT INTO AD_Element (AD_Element_ID,ColumnName,EntityType,Name,PrintName,AD_Client_ID,Created,Updated,IsActive,AD_Org_ID,CreatedBy,UpdatedBy) VALUES (200144,'IsSameProduct','D','Same Product','Same Product',0,TO_TIMESTAMP('2012-09-24 12:17:14','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-24 12:17:14','YYYY-MM-DD HH24:MI:SS'),'Y',0,100,100) +; + +-- Sep 24, 2012 12:17:15 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,PO_Name,Name,Description,PrintName,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.PO_Name,t.Name,t.Description,t.PrintName,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200144 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 12:17:15 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('N',200530,200022,'D',0,'Y','N','N','N',1,'N',20,'Y','N',200144,'N','Y','N','IsSameProduct','Same Product',100,TO_TIMESTAMP('2012-09-24 12:17:15','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:15','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:15 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200530 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:15 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD COLUMN IsSameProduct CHAR(1) DEFAULT 'N' CHECK (IsSameProduct IN ('Y','N')) NOT NULL +; + +-- Sep 24, 2012 12:17:16 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('1',200531,200022,'D',0,'N','N','N','The Multiplier Amount indicates the amount to multiply the total amount generated by this commission run by.','N',14,'N',22,'Y','N',1545,'N','Y','N','AmtMultiplier','Multiplier Amount for generating commissions','Multiplier Amount',100,TO_TIMESTAMP('2012-09-24 12:17:15','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:15','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:16 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200531 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:16 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD COLUMN AmtMultiplier NUMERIC DEFAULT '1' +; + +-- Sep 24, 2012 12:17:16 PM COT +INSERT INTO AD_Element (AD_Element_ID,ColumnName,EntityType,Name,PrintName,AD_Client_ID,Created,Updated,IsActive,AD_Org_ID,CreatedBy,UpdatedBy) VALUES (200145,'RoundFactor','D','Round Factor','Round Factor',0,TO_TIMESTAMP('2012-09-24 12:17:16','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-24 12:17:16','YYYY-MM-DD HH24:MI:SS'),'Y',0,100,100) +; + +-- Sep 24, 2012 12:17:16 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,PO_Name,Name,Description,PrintName,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.PO_Name,t.Name,t.Description,t.PrintName,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200145 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 12:17:17 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('0',200532,200022,'D',0,'N','N','N','N',22,'N',11,'Y','N',200145,'N','Y','N','RoundFactor','Round Factor',100,TO_TIMESTAMP('2012-09-24 12:17:16','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:16','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:17 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200532 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:17 PM COT +ALTER TABLE GL_JournalGeneratorLine ADD COLUMN RoundFactor NUMERIC(10) DEFAULT '0' +; + +-- Sep 24, 2012 12:17:18 PM COT +INSERT INTO AD_Tab (IsSingleRow,AD_Window_ID,SeqNo,IsTranslationTab,IsSortTab,AD_Tab_ID,AD_Table_ID,CommitWarning,HasTree,IsInfoTab,IsReadOnly,AD_Column_ID,TabLevel,IsInsertRecord,IsAdvancedTab,EntityType,Name,AD_Client_ID,AD_Org_ID,CreatedBy,Updated,Created,IsActive,UpdatedBy,Processing) VALUES ('Y',200013,20,'N','N',200021,200022,NULL,'N','Y','N',200520,1,'Y','N','D','Generator Line',0,0,100,TO_TIMESTAMP('2012-09-24 12:17:17','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-24 12:17:17','YYYY-MM-DD HH24:MI:SS'),'Y',100,'N') +; + +-- Sep 24, 2012 12:17:18 PM COT +INSERT INTO AD_Tab_Trl (AD_Language,AD_Tab_ID, Help,CommitWarning,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Tab_ID, t.Help,t.CommitWarning,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Tab t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Tab_ID=200021 AND NOT EXISTS (SELECT * FROM AD_Tab_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Tab_ID=t.AD_Tab_ID) +; + +-- Sep 24, 2012 12:17:18 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,22,'Y','N','N',200513,'N',10,'Y',200525,'N','A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','D','Client/Tenant for this installation.','Client',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:18','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:17:18','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:18 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200525 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:19 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,22,'Y','Y','N',200514,'N',20,'Y',200526,'N','An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','D','Organizational entity within client','Organization',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:18','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:17:18','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:19 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200526 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:19 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,22,'Y','N','N',200520,'N',30,'Y',200527,'N','D','GL Journal Generator',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:19','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:17:19','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:19 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200527 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:20 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,22,'Y','N','N',200523,'N',40,'Y',200528,'N','The Sequence indicates the order of records','D','Method of ordering records; lowest number comes first','Sequence',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:19','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:17:19','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:20 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200528 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:20 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,255,'Y','N','N',200517,'N',50,'Y',200529,'N','A description is limited to 255 characters.','D','Optional short description of the record','Description',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:20','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:17:20','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:20 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200529 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:21 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,2000,'Y','N','N',200518,'N',60,'Y',200530,'N','The Help field contains a hint, comment or help about the use of this item.','D','Comment or Hint','Comment/Help',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:20','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:17:20','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:21 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200530 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:21 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,10,'Y','N','N',200524,'N',70,'Y',200531,'N','D','Account DR',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:21','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:17:21','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:21 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200531 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:22 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,10,'Y','Y','N',200525,'N',80,'Y',200532,'N','D','Account CR',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:21','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:17:21','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:22 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200532 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:22 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,1,'Y','N','N',200526,'N',90,'Y',200533,'N','D','Type of BP Dimension',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:22','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:17:22','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:22 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200533 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:23 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,DisplayLogic,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,10,'Y','Y','N',200527,'N',100,'Y',200534,'N','A Business Partner is anyone with whom you transact. This can include Vendor, Customer, Employee or Salesperson','@BPDimensionType@=F','D','Identifies a Business Partner','Business Partner ',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:22','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:17:22','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:23 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200534 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:23 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,DisplayLogic,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,100,'Y','Y','N',200528,'N',110,'Y',200535,'N','@BPDimensionType@=C','D','BP Column',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:23','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:17:23','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:23 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200535 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:24 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,1,'Y','N','N',200530,'N',120,'Y',200536,'N','D','Same Product',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:23','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:17:23','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:24 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200536 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:24 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,1,'Y','N','N',200529,'N',130,'Y',200537,'N','D','Copy All Dimensions',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:24','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:17:24','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:24 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200537 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:25 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,14,'Y','N','N',200531,'N',140,'Y',200538,'N','The Multiplier Amount indicates the amount to multiply the total amount generated by this commission run by.','D','Multiplier Amount for generating commissions','Multiplier Amount',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:24','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:17:24','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:25 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200538 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:25 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,22,'Y','Y','N',200532,'N',150,'Y',200539,'N','D','Round Factor',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:25','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:17:25','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:25 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200539 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:26 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,1,'Y','N','N',200519,'N',160,'Y',200540,'N','There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports. +There are two reasons for de-activating and not deleting records: +(1) The system requires the record for audit purposes. +(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','D','The record is active in the system','Active',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:25','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:17:25','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:26 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200540 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:26 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200021,22,'N','N','N',200512,'N',0,'Y',200541,'N','D','Generator Line',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:26','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:17:26','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:26 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200541 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:27 PM COT +INSERT INTO AD_Table (IsSecurityEnabled,AccessLevel,AD_Window_ID,AD_Table_ID,IsHighVolume,ImportTable,IsView,IsChangeLog,EntityType,IsDeleteable,ReplicationType,TableName,Name,AD_Client_ID,IsActive,AD_Org_ID,CreatedBy,Updated,UpdatedBy,Created) VALUES ('N','3',200013,200023,'N','N','N','Y','D','Y','L','GL_JournalGeneratorSource','Generator Source',0,'Y',0,100,TO_TIMESTAMP('2012-09-24 12:17:27','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2012-09-24 12:17:27','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:27 PM COT +INSERT INTO AD_Table_Trl (AD_Language,AD_Table_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Table_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Table t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Table_ID=200023 AND NOT EXISTS (SELECT * FROM AD_Table_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Table_ID=t.AD_Table_ID) +; + +-- Sep 24, 2012 12:17:28 PM COT +INSERT INTO AD_Sequence (IncrementNo,StartNewYear,CurrentNextSys,IsTableID,StartNo,CurrentNext,IsAudited,IsAutoSequence,AD_Sequence_ID,Description,Name,AD_Org_ID,AD_Client_ID,Updated,UpdatedBy,Created,CreatedBy,IsActive) VALUES (1,'N',200000,'Y',1000000,1000000,'N','Y',200023,'Table GL_JournalGeneratorSource','GL_JournalGeneratorSource',0,0,TO_TIMESTAMP('2012-09-24 12:17:27','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2012-09-24 12:17:27','YYYY-MM-DD HH24:MI:SS'),100,'Y') +; + +-- Sep 24, 2012 12:17:28 PM COT +INSERT INTO AD_Element (AD_Element_ID,ColumnName,EntityType,Name,PrintName,AD_Client_ID,Created,Updated,IsActive,AD_Org_ID,CreatedBy,UpdatedBy) VALUES (200146,'GL_JournalGeneratorSource_ID','D','Generator Source','Generator Source',0,TO_TIMESTAMP('2012-09-24 12:17:28','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-24 12:17:28','YYYY-MM-DD HH24:MI:SS'),'Y',0,100,100) +; + +-- Sep 24, 2012 12:17:28 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,PO_Name,Name,Description,PrintName,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.PO_Name,t.Name,t.Description,t.PrintName,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200146 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 12:17:29 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200533,200023,'D',1,'Y','N','N','N',22,'N',13,'Y','Y',200146,'N','N','N','GL_JournalGeneratorSource_ID','Generator Source',100,TO_TIMESTAMP('2012-09-24 12:17:28','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:28','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:29 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200533 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:29 PM COT +CREATE TABLE GL_JournalGeneratorSource (GL_JournalGeneratorSource_ID NUMERIC(10) NOT NULL, CONSTRAINT GL_JournalGeneratorSource_Key PRIMARY KEY (GL_JournalGeneratorSource_ID)) +; + +-- Sep 24, 2012 12:17:30 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('@#AD_Client_ID@',200534,200023,'D',1,'Y','N','N','A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','N',22,'N',19,'Y','N',102,'N','N','N','AD_Client_ID','Client/Tenant for this installation.','Client',100,TO_TIMESTAMP('2012-09-24 12:17:29','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:29','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:30 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200534 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:30 PM COT +ALTER TABLE GL_JournalGeneratorSource ADD COLUMN AD_Client_ID NUMERIC(10) NOT NULL +; + +-- Sep 24, 2012 12:17:30 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,AD_Val_Rule_ID,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('@#AD_Org_ID@',200535,200023,'D',1,'Y','N','N','An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','N',22,'N',19,'Y',104,'N',113,'N','N','N','AD_Org_ID','Organizational entity within client','Organization',100,TO_TIMESTAMP('2012-09-24 12:17:30','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:30','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:30 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200535 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:30 PM COT +ALTER TABLE GL_JournalGeneratorSource ADD COLUMN AD_Org_ID NUMERIC(10) NOT NULL +; + +-- Sep 24, 2012 12:17:31 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200536,200023,'D',1,'Y','N','N','The Created field indicates the date that this record was created.','N',7,'N',16,'Y','N',245,'N','N','N','Created','Date this record was created','Created',100,TO_TIMESTAMP('2012-09-24 12:17:30','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:30','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:31 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200536 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:31 PM COT +ALTER TABLE GL_JournalGeneratorSource ADD COLUMN Created TIMESTAMP NOT NULL +; + +-- Sep 24, 2012 12:17:31 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200537,200023,'D',1,110,'Y','N','N','The Created By field indicates the user who created this record.','N',22,'N',18,'Y','N',246,'N','N','N','CreatedBy','User who created this records','Created By',100,TO_TIMESTAMP('2012-09-24 12:17:31','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:31','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:31 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200537 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:31 PM COT +ALTER TABLE GL_JournalGeneratorSource ADD COLUMN CreatedBy NUMERIC(10) NOT NULL +; + +-- Sep 24, 2012 12:17:32 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200538,200023,'D',1,'N','N','N','The Help field contains a hint, comment or help about the use of this item.','N',2000,'N',14,'Y','N',326,'N','Y','N','Help','Comment or Hint','Comment/Help',100,TO_TIMESTAMP('2012-09-24 12:17:31','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:31','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:32 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200538 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:32 PM COT +ALTER TABLE GL_JournalGeneratorSource ADD COLUMN Help VARCHAR(2000) DEFAULT NULL +; + +-- Sep 24, 2012 12:17:32 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('Y',200539,200023,'D',1,'Y','N','N','There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports. +There are two reasons for de-activating and not deleting records: +(1) The system requires the record for audit purposes. +(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','N',1,'N',20,'Y','N',348,'N','Y','N','IsActive','The record is active in the system','Active',100,TO_TIMESTAMP('2012-09-24 12:17:32','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:32','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:32 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200539 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:33 PM COT +ALTER TABLE GL_JournalGeneratorSource ADD COLUMN IsActive CHAR(1) DEFAULT 'Y' CHECK (IsActive IN ('Y','N')) NOT NULL +; + +-- Sep 24, 2012 12:17:33 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200540,200023,'D',1,'Y','N','N','The Updated field indicates the date that this record was updated.','N',7,'N',16,'Y','N',607,'N','N','N','Updated','Date this record was updated','Updated',100,TO_TIMESTAMP('2012-09-24 12:17:33','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:33','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:33 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200540 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:33 PM COT +ALTER TABLE GL_JournalGeneratorSource ADD COLUMN Updated TIMESTAMP NOT NULL +; + +-- Sep 24, 2012 12:17:34 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200541,200023,'D',1,110,'Y','N','N','The Updated By field indicates the user who updated this record.','N',22,'N',18,'Y','N',608,'N','N','N','UpdatedBy','User who updated this records','Updated By',100,TO_TIMESTAMP('2012-09-24 12:17:33','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:33','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:34 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200541 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:34 PM COT +ALTER TABLE GL_JournalGeneratorSource ADD COLUMN UpdatedBy NUMERIC(10) NOT NULL +; + +-- Sep 24, 2012 12:17:34 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200542,200023,'D',0,'Y','N','N','Y',10,'N',19,'Y','N',200138,'N','N','N','GL_JournalGeneratorLine_ID','Generator Line',100,TO_TIMESTAMP('2012-09-24 12:17:34','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:34','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:34 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200542 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:34 PM COT +ALTER TABLE GL_JournalGeneratorSource ADD COLUMN GL_JournalGeneratorLine_ID NUMERIC(10) NOT NULL +; + +-- Sep 24, 2012 12:17:35 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,AD_Val_Rule_ID,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200543,200023,'D',0,182,'Y','N','N','Account Elements can be natural accounts or user defined values.','N',10,'N',18,'Y',252,'N',198,'N','Y','N','C_ElementValue_ID','Account Element','Account Element',100,TO_TIMESTAMP('2012-09-24 12:17:34','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:34','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:35 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200543 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:35 PM COT +ALTER TABLE GL_JournalGeneratorSource ADD COLUMN C_ElementValue_ID NUMERIC(10) NOT NULL +; + +-- Sep 24, 2012 12:17:35 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('1',200544,200023,'D',0,'Y','N','N','The Multiplier Amount indicates the amount to multiply the total amount generated by this commission run by.','N',1,'N',22,'Y','N',1545,'N','Y','N','AmtMultiplier','Multiplier Amount for generating commissions','Multiplier Amount',100,TO_TIMESTAMP('2012-09-24 12:17:35','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:35','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:35 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200544 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:36 PM COT +ALTER TABLE GL_JournalGeneratorSource ADD COLUMN AmtMultiplier NUMERIC DEFAULT '1' NOT NULL +; + +-- Sep 24, 2012 12:17:36 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200545,200023,'D',0,'N','N','N','N',14,'N',11,'Y','N',200145,'N','Y','N','RoundFactor','Round Factor',100,TO_TIMESTAMP('2012-09-24 12:17:36','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:36','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:36 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200545 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:36 PM COT +ALTER TABLE GL_JournalGeneratorSource ADD COLUMN RoundFactor NUMERIC(10) DEFAULT NULL +; + +-- Sep 24, 2012 12:17:37 PM COT +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200546,200023,'D',0,'N','N','N','The General Ledger Category is an optional, user defined method of grouping journal lines.','N',10,'N',19,'Y','N',309,'N','Y','N','GL_Category_ID','General Ledger Category','GL Category',100,TO_TIMESTAMP('2012-09-24 12:17:36','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:36','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 24, 2012 12:17:37 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200546 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 12:17:37 PM COT +ALTER TABLE GL_JournalGeneratorSource ADD COLUMN GL_Category_ID NUMERIC(10) DEFAULT NULL +; + +-- Sep 24, 2012 12:17:38 PM COT +INSERT INTO AD_Tab (IsSingleRow,AD_Window_ID,SeqNo,IsTranslationTab,IsSortTab,AD_Tab_ID,AD_Table_ID,CommitWarning,HasTree,IsInfoTab,IsReadOnly,AD_Column_ID,TabLevel,IsInsertRecord,IsAdvancedTab,EntityType,Name,AD_Client_ID,AD_Org_ID,CreatedBy,Updated,Created,IsActive,UpdatedBy,Processing) VALUES ('N',200013,30,'N','N',200022,200023,NULL,'N','Y','N',200542,2,'Y','N','D','Generator Source',0,0,100,TO_TIMESTAMP('2012-09-24 12:17:37','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-24 12:17:37','YYYY-MM-DD HH24:MI:SS'),'Y',100,'N') +; + +-- Sep 24, 2012 12:17:38 PM COT +INSERT INTO AD_Tab_Trl (AD_Language,AD_Tab_ID, Help,CommitWarning,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Tab_ID, t.Help,t.CommitWarning,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Tab t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Tab_ID=200022 AND NOT EXISTS (SELECT * FROM AD_Tab_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Tab_ID=t.AD_Tab_ID) +; + +-- Sep 24, 2012 12:17:38 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200022,22,'Y','N','N',200534,'N',10,'Y',200542,'N','A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','D','Client/Tenant for this installation.','Client',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:38','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:17:38','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:38 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200542 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:39 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200022,22,'Y','Y','N',200535,'N',20,'Y',200543,'N','An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','D','Organizational entity within client','Organization',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:38','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:17:38','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:39 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200543 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:39 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200022,10,'Y','N','N',200542,'N',30,'Y',200544,'N','D','Generator Line',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:39','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:17:39','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:39 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200544 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:40 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200022,10,'Y','N','N',200543,'N',40,'Y',200545,'N','Account Elements can be natural accounts or user defined values.','D','Account Element','Account Element',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:39','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:17:39','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:40 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200545 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:40 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200022,10,'Y','Y','N',200546,'N',50,'Y',200546,'N','The General Ledger Category is an optional, user defined method of grouping journal lines.','D','General Ledger Category','GL Category',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:40','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:17:40','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:40 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200546 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:41 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200022,1,'Y','N','N',200544,'N',60,'Y',200547,'N','The Multiplier Amount indicates the amount to multiply the total amount generated by this commission run by.','D','Multiplier Amount for generating commissions','Multiplier Amount',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:40','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:17:40','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:41 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200547 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:41 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200022,14,'Y','Y','N',200545,'N',70,'Y',200548,'N','D','Round Factor',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:41','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:17:41','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:41 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200548 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:42 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200022,2000,'Y','N','N',200538,'N',80,'Y',200549,'N','The Help field contains a hint, comment or help about the use of this item.','D','Comment or Hint','Comment/Help',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:41','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:17:41','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:42 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200549 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:43 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200022,1,'Y','N','N',200539,'N',90,'Y',200550,'N','There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports. +There are two reasons for de-activating and not deleting records: +(1) The system requires the record for audit purposes. +(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','D','The record is active in the system','Active',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:42','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:17:42','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:43 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200550 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:44 PM COT +INSERT INTO AD_Field (SortNo,AD_Tab_ID,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,200022,22,'N','N','N',200533,'N',0,'Y',200551,'N','D','Generator Source',100,0,'Y',TO_TIMESTAMP('2012-09-24 12:17:43','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 12:17:43','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 24, 2012 12:17:44 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200551 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 12:17:44 PM COT +update AD_Field set isallowcopy='N' where AD_Field_ID=(select ad_field_id from ad_field where name ='Sequence' and ad_tab_id=(select ad_tab_id from ad_tab where name='Generator Line' and entitytype='D')) +; + +-- Sep 24, 2012 12:17:44 PM COT +update ad_column set mandatorylogic='@BPDimensionType@=C' where columnname='BPColumn' and ad_table_id=(select ad_table_id from ad_table where tablename='GL_JournalGeneratorLine') +; + +-- Sep 24, 2012 12:17:44 PM COT +update ad_column set mandatorylogic='@BPDimensionType@=F' where columnname='C_BPartner_ID' and ad_table_id=(select ad_table_id from ad_table where tablename='GL_JournalGeneratorLine') +; + +-- Sep 24, 2012 12:17:44 PM COT +ALTER TABLE GL_JournalGenerator ADD CONSTRAINT CAcctSchema_QSSJournalGenerato FOREIGN KEY (C_AcctSchema_ID) REFERENCES C_AcctSchema DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE GL_JournalGenerator ADD CONSTRAINT CDocType_QSSJournalGenerator FOREIGN KEY (C_DocType_ID) REFERENCES C_DocType DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE GL_JournalGenerator ADD CONSTRAINT CElementValueAdjustCR_QSSJourn FOREIGN KEY (C_ElementValueAdjustCR_ID) REFERENCES C_ElementValue DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE GL_JournalGenerator ADD CONSTRAINT CElementValueAdjustDR_QSSJourn FOREIGN KEY (C_ElementValueAdjustDR_ID) REFERENCES C_ElementValue DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE GL_JournalGenerator ADD CONSTRAINT GLCategory_QSSJournalGenerator FOREIGN KEY (GL_Category_ID) REFERENCES GL_Category DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE GL_JournalGeneratorLine ADD CONSTRAINT CBPartner_QSSJournalGeneratorL FOREIGN KEY (C_BPartner_ID) REFERENCES C_BPartner DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE GL_JournalGeneratorLine ADD CONSTRAINT CElementValueCR_QSSJournalGene FOREIGN KEY (C_ElementValueCR_ID) REFERENCES C_ElementValue DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE GL_JournalGeneratorLine ADD CONSTRAINT CElementValueDR_QSSJournalGene FOREIGN KEY (C_ElementValueDR_ID) REFERENCES C_ElementValue DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE GL_JournalGeneratorLine ADD CONSTRAINT QSSJournalGenerator_QSSJournal FOREIGN KEY (GL_JournalGenerator_ID) REFERENCES GL_JournalGenerator DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE GL_JournalGeneratorSource ADD CONSTRAINT CElementValue_QSSJournalGenera FOREIGN KEY (C_ElementValue_ID) REFERENCES C_ElementValue DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE GL_JournalGeneratorSource ADD CONSTRAINT QSSJournalGeneratorLine_QSSJou FOREIGN KEY (GL_JournalGeneratorLine_ID) REFERENCES GL_JournalGeneratorLine DEFERRABLE INITIALLY DEFERRED; + +-- Sep 24, 2012 12:17:45 PM COT +INSERT INTO AD_Menu (AD_Window_ID,AD_Menu_ID,IsSummary,"action",IsSOTrx,IsReadOnly,EntityType,Name,Created,IsActive,UpdatedBy,AD_Client_ID,CreatedBy,Updated,AD_Org_ID) VALUES (200013,200019,'N','W','N','N','D','GL Journal Generator',TO_TIMESTAMP('2012-09-24 12:17:44','YYYY-MM-DD HH24:MI:SS'),'Y',100,0,100,TO_TIMESTAMP('2012-09-24 12:17:44','YYYY-MM-DD HH24:MI:SS'),0) +; + +-- Sep 24, 2012 12:17:45 PM COT +INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Menu_ID, t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Menu_ID=200019 AND NOT EXISTS (SELECT * FROM AD_Menu_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Menu_ID=t.AD_Menu_ID) +; + +-- Sep 24, 2012 12:17:45 PM COT +INSERT INTO AD_TREENODEMM(AD_Client_ID, AD_Org_ID, CreatedBy, UpdatedBy, Parent_ID, SeqNo, AD_Tree_ID, Node_ID)VALUES(0, 0, 0, 0, 278,13, 10, 200019) +; + +-- Sep 24, 2012 1:52:05 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('GL_JournalGenerator_UU',200154,'U','GL_JournalGenerator_UU','GL_JournalGenerator_UU','ce1c9845-c843-4171-a29e-58ba1a00b7a5',0,TO_TIMESTAMP('2012-09-24 13:52:05','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-24 13:52:05','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Sep 24, 2012 1:52:05 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200154 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 1:52:05 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID) VALUES (1.00,200021,200554,'U','N','N','N','N',36,'N',10,'N',200154,'036bbd32-d2b8-4977-aa89-63d03b982c9d','N','Y','N','GL_JournalGenerator_UU','GL_JournalGenerator_UU',100,TO_TIMESTAMP('2012-09-24 13:52:05','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-24 13:52:05','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Sep 24, 2012 1:52:05 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200554 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 1:52:05 PM COT +-- IDEMPIERE-207 GL Journal Generator +ALTER TABLE GL_JournalGenerator ADD COLUMN GL_JournalGenerator_UU VARCHAR(36) DEFAULT NULL +; + +-- Sep 24, 2012 1:52:06 PM COT +-- IDEMPIERE-207 GL Journal Generator +CREATE UNIQUE INDEX GL_JournalGenerator_UU_idx ON gl_journalgenerator(GL_JournalGenerator_UU) +; + +-- Sep 24, 2012 1:52:06 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('GL_JournalGeneratorLine_UU',200155,'U','GL_JournalGeneratorLine_UU','GL_JournalGeneratorLine_UU','01031500-7362-453d-b5c2-59e493651afd',0,TO_TIMESTAMP('2012-09-24 13:52:06','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-24 13:52:06','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Sep 24, 2012 1:52:06 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200155 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 1:52:07 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID) VALUES (1.00,200022,200555,'U','N','N','N','N',36,'N',10,'N',200155,'3084f1fd-f809-4379-aaeb-b7539cb982bd','N','Y','N','GL_JournalGeneratorLine_UU','GL_JournalGeneratorLine_UU',100,TO_TIMESTAMP('2012-09-24 13:52:06','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-24 13:52:06','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Sep 24, 2012 1:52:07 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200555 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 1:52:07 PM COT +-- IDEMPIERE-207 GL Journal Generator +ALTER TABLE GL_JournalGeneratorLine ADD COLUMN GL_JournalGeneratorLine_UU VARCHAR(36) DEFAULT NULL +; + +-- Sep 24, 2012 1:52:07 PM COT +-- IDEMPIERE-207 GL Journal Generator +CREATE UNIQUE INDEX GL_JournalGeneratorLine_UU_idx ON gl_journalgeneratorline(GL_JournalGeneratorLine_UU) +; + +-- Sep 24, 2012 1:52:07 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('GL_JournalGeneratorSource_UU',200156,'U','GL_JournalGeneratorSource_UU','GL_JournalGeneratorSource_UU','c14d313c-2e81-461d-8b8f-9a33913bbaeb',0,TO_TIMESTAMP('2012-09-24 13:52:07','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-24 13:52:07','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Sep 24, 2012 1:52:07 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200156 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 1:52:08 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID) VALUES (1.00,200023,200556,'U','N','N','N','N',36,'N',10,'N',200156,'2f6ca282-6903-4207-907a-6cff865d8867','N','Y','N','GL_JournalGeneratorSource_UU','GL_JournalGeneratorSource_UU',100,TO_TIMESTAMP('2012-09-24 13:52:07','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-24 13:52:07','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Sep 24, 2012 1:52:08 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200556 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 1:52:08 PM COT +-- IDEMPIERE-207 GL Journal Generator +ALTER TABLE GL_JournalGeneratorSource ADD COLUMN GL_JournalGeneratorSource_UU VARCHAR(36) DEFAULT NULL +; + +-- Sep 24, 2012 1:52:08 PM COT +-- IDEMPIERE-207 GL Journal Generator +CREATE UNIQUE INDEX GL_JournalGeneratorSource_U_uu_idx ON gl_journalgeneratorsource(GL_JournalGeneratorSource_UU) +; + +-- Sep 24, 2012 2:13:33 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO GL_JournalGenerator (GL_JournalGenerator_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,Description,Help,IsActive,Name,Updated,UpdatedBy,C_ElementValueAdjustDR_ID,C_ElementValueAdjustCR_ID,C_DocType_ID,GL_Category_ID,GenerateGLJournal,C_AcctSchema_ID,PostingType,GL_JournalGenerator_UU) VALUES (200000,11,0,TO_TIMESTAMP('2012-09-24 14:13:32','YYYY-MM-DD HH24:MI:SS'),100,'Step 1 - close Revenue/Expense to Income Summary','Processing date start on 1900 - execute on adjustment period','Y','Year-End Closing Sample - step 1',TO_TIMESTAMP('2012-09-24 14:13:32','YYYY-MM-DD HH24:MI:SS'),100,771,771,115,108,'N',101,'A','d7614300-365f-4cca-b7c3-0085310c35d2') +; + +-- Sep 24, 2012 2:16:26 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO GL_JournalGeneratorLine (IsCopyAllDimensions,IsSameProduct,GL_JournalGeneratorLine_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,Description,IsActive,GL_JournalGenerator_ID,Updated,UpdatedBy,SeqNo,AmtMultiplier,RoundFactor,GL_JournalGeneratorLine_UU) VALUES ('Y','N',200000,11,0,TO_TIMESTAMP('2012-09-24 14:16:25','YYYY-MM-DD HH24:MI:SS'),100,'Close 4 Sales','Y',200000,TO_TIMESTAMP('2012-09-24 14:16:25','YYYY-MM-DD HH24:MI:SS'),100,10,-1.000000000000,2,'d6c7e2eb-3c82-4a1f-9439-7ee7b0c61020') +; + +-- Sep 24, 2012 2:16:59 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO GL_JournalGeneratorSource (GL_JournalGeneratorSource_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy,GL_JournalGeneratorLine_ID,C_ElementValue_ID,AmtMultiplier,RoundFactor,GL_JournalGeneratorSource_UU) VALUES (200000,11,0,TO_TIMESTAMP('2012-09-24 14:16:58','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_TIMESTAMP('2012-09-24 14:16:58','YYYY-MM-DD HH24:MI:SS'),100,200000,632,1,2,'970de838-635a-4c09-b4ed-7b3ae59ed8a6') +; + +-- Sep 24, 2012 2:17:23 PM COT +-- IDEMPIERE-207 GL Journal Generator +UPDATE GL_JournalGeneratorLine SET Description='Close Sales and Other Income',Updated=TO_TIMESTAMP('2012-09-24 14:17:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE GL_JournalGeneratorLine_ID=200000 +; + +-- Sep 24, 2012 2:17:35 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO GL_JournalGeneratorSource (GL_JournalGeneratorSource_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy,GL_JournalGeneratorLine_ID,C_ElementValue_ID,AmtMultiplier,RoundFactor,GL_JournalGeneratorSource_UU) VALUES (200001,11,0,TO_TIMESTAMP('2012-09-24 14:17:35','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_TIMESTAMP('2012-09-24 14:17:35','YYYY-MM-DD HH24:MI:SS'),100,200000,704,1,2,'57af9f43-577a-4ed0-9519-b6fd5bced6e0') +; + +-- Sep 24, 2012 2:25:28 PM COT +-- IDEMPIERE-207 GL Journal Generator +UPDATE GL_JournalGeneratorLine SET Description='Close (4) Sales and (80) Other Income',Updated=TO_TIMESTAMP('2012-09-24 14:25:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE GL_JournalGeneratorLine_ID=200000 +; + +-- Sep 24, 2012 2:26:24 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO GL_JournalGeneratorLine (IsCopyAllDimensions,IsSameProduct,GL_JournalGeneratorLine_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,Description,IsActive,GL_JournalGenerator_ID,Updated,UpdatedBy,SeqNo,AmtMultiplier,RoundFactor,GL_JournalGeneratorLine_UU) VALUES ('Y','N',200001,11,0,TO_TIMESTAMP('2012-09-24 14:26:24','YYYY-MM-DD HH24:MI:SS'),100,'Close (5) Cost of Goods Sold','Y',200000,TO_TIMESTAMP('2012-09-24 14:26:24','YYYY-MM-DD HH24:MI:SS'),100,20,-1.000000000000,2,'4c1a5d2a-e48f-4315-ac80-14544e25b568') +; + +-- Sep 24, 2012 2:29:17 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO GL_JournalGeneratorSource (GL_JournalGeneratorSource_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy,GL_JournalGeneratorLine_ID,C_ElementValue_ID,AmtMultiplier,RoundFactor,GL_JournalGeneratorSource_UU) VALUES (200002,11,0,TO_TIMESTAMP('2012-09-24 14:29:17','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_TIMESTAMP('2012-09-24 14:29:17','YYYY-MM-DD HH24:MI:SS'),100,200001,429,1,2,'f4f9fdfc-14dc-4fb6-9af7-e856a584afab') +; + +-- Sep 24, 2012 2:29:42 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO GL_JournalGeneratorLine (IsCopyAllDimensions,IsSameProduct,GL_JournalGeneratorLine_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,Description,IsActive,GL_JournalGenerator_ID,Updated,UpdatedBy,SeqNo,AmtMultiplier,RoundFactor,GL_JournalGeneratorLine_UU) VALUES ('Y','N',200002,11,0,TO_TIMESTAMP('2012-09-24 14:29:42','YYYY-MM-DD HH24:MI:SS'),100,'Close (6) Expenses','Y',200000,TO_TIMESTAMP('2012-09-24 14:29:42','YYYY-MM-DD HH24:MI:SS'),100,30,-1.000000000000,2,'6a1fa3f1-78e7-4174-86b2-9aabf59322bc') +; + +-- Sep 24, 2012 2:30:46 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO GL_JournalGeneratorSource (GL_JournalGeneratorSource_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy,GL_JournalGeneratorLine_ID,C_ElementValue_ID,AmtMultiplier,RoundFactor,GL_JournalGeneratorSource_UU) VALUES (200003,11,0,TO_TIMESTAMP('2012-09-24 14:30:45','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_TIMESTAMP('2012-09-24 14:30:45','YYYY-MM-DD HH24:MI:SS'),100,200002,449,1,2,'ea2bbf84-169a-4b34-892f-ef5ad109c823') +; + +-- Sep 24, 2012 2:31:12 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO GL_JournalGeneratorLine (IsCopyAllDimensions,IsSameProduct,GL_JournalGeneratorLine_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,Description,IsActive,GL_JournalGenerator_ID,Updated,UpdatedBy,SeqNo,AmtMultiplier,RoundFactor,GL_JournalGeneratorLine_UU) VALUES ('Y','N',200003,11,0,TO_TIMESTAMP('2012-09-24 14:31:12','YYYY-MM-DD HH24:MI:SS'),100,'Close (7) Expenses','Y',200000,TO_TIMESTAMP('2012-09-24 14:31:12','YYYY-MM-DD HH24:MI:SS'),100,40,-1.000000000000,2,'54db5016-489f-4756-a106-f93a9ad0be8a') +; + +-- Sep 24, 2012 2:32:03 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO GL_JournalGeneratorSource (GL_JournalGeneratorSource_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy,GL_JournalGeneratorLine_ID,C_ElementValue_ID,AmtMultiplier,RoundFactor,GL_JournalGeneratorSource_UU) VALUES (200004,11,0,TO_TIMESTAMP('2012-09-24 14:32:02','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_TIMESTAMP('2012-09-24 14:32:02','YYYY-MM-DD HH24:MI:SS'),100,200003,783,1,2,'a78c163f-05c6-47ae-8ea2-f63b9d11ef7a') +; + +-- Sep 24, 2012 2:32:17 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO GL_JournalGeneratorLine (IsCopyAllDimensions,IsSameProduct,GL_JournalGeneratorLine_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,Description,IsActive,GL_JournalGenerator_ID,Updated,UpdatedBy,SeqNo,AmtMultiplier,RoundFactor,GL_JournalGeneratorLine_UU) VALUES ('Y','N',200004,11,0,TO_TIMESTAMP('2012-09-24 14:32:17','YYYY-MM-DD HH24:MI:SS'),100,'Close (82) Other Expense and (83) Expense (Absorbed)','Y',200000,TO_TIMESTAMP('2012-09-24 14:32:17','YYYY-MM-DD HH24:MI:SS'),100,50,-1.000000000000,2,'8c9e465f-49dd-4145-a2a2-12ac48973418') +; + +-- Sep 24, 2012 2:33:17 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO GL_JournalGeneratorSource (GL_JournalGeneratorSource_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy,GL_JournalGeneratorLine_ID,C_ElementValue_ID,AmtMultiplier,RoundFactor,GL_JournalGeneratorSource_UU) VALUES (200005,11,0,TO_TIMESTAMP('2012-09-24 14:33:15','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_TIMESTAMP('2012-09-24 14:33:15','YYYY-MM-DD HH24:MI:SS'),100,200004,716,1,2,'0d0629f8-87ec-4909-8b1e-a480fc90118d') +; + +-- Sep 24, 2012 2:33:27 PM COT +-- IDEMPIERE-207 GL Journal Generator +INSERT INTO GL_JournalGeneratorSource (GL_JournalGeneratorSource_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy,GL_JournalGeneratorLine_ID,C_ElementValue_ID,AmtMultiplier,RoundFactor,GL_JournalGeneratorSource_UU) VALUES (200006,11,0,TO_TIMESTAMP('2012-09-24 14:33:27','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_TIMESTAMP('2012-09-24 14:33:27','YYYY-MM-DD HH24:MI:SS'),100,200004,50008,1,2,'79807f6d-c9f2-49db-b573-2dd0a087a1ee') +; + +-- Sep 24, 2012 2:38:28 PM COT +-- IDEMPIERE-207 GL Journal Generator +UPDATE AD_Tab SET OrderByClause='SeqNo',Updated=TO_TIMESTAMP('2012-09-24 14:38:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=200021 +; + +-- Sep 24, 2012 2:52:41 PM COT +INSERT INTO GL_JournalGenerator (GL_JournalGenerator_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,Description,Help,IsActive,Name,Updated,UpdatedBy,C_ElementValueAdjustDR_ID,C_ElementValueAdjustCR_ID,C_DocType_ID,GL_Category_ID,GenerateGLJournal,C_AcctSchema_ID,PostingType,GL_JournalGenerator_UU) VALUES (200001,11,0,TO_TIMESTAMP('2012-09-24 14:52:41','YYYY-MM-DD HH24:MI:SS'),100,'Step 1 - close Income Summary to Retained Earnings','Executed on year-end - must be executed after -> Year-End Closing Sample - step 1','Y','Year-End Closing Sample - step 2',TO_TIMESTAMP('2012-09-24 14:52:41','YYYY-MM-DD HH24:MI:SS'),100,631,631,115,108,'N ',101,'A','c81431ee-d7a3-4123-9ebb-12b41a1364f4') +; + +-- Sep 24, 2012 3:00:46 PM COT +INSERT INTO GL_JournalGeneratorLine (IsCopyAllDimensions,IsSameProduct,GL_JournalGeneratorLine_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,Description,IsActive,GL_JournalGenerator_ID,Updated,UpdatedBy,SeqNo,C_ElementValueCR_ID,AmtMultiplier,RoundFactor,GL_JournalGeneratorLine_UU) VALUES ('N','N',200005,11,0,TO_TIMESTAMP('2012-09-24 15:00:46','YYYY-MM-DD HH24:MI:SS'),100,'Move Income Summary to Retained Earnings','Y',200001,TO_TIMESTAMP('2012-09-24 15:00:46','YYYY-MM-DD HH24:MI:SS'),100,10,771,1,2,'56b30bc0-aee2-4649-b527-80daeec4b8fb') +; + +-- Sep 24, 2012 3:04:50 PM COT +INSERT INTO GL_JournalGeneratorSource (GL_JournalGeneratorSource_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy,GL_JournalGeneratorLine_ID,C_ElementValue_ID,AmtMultiplier,RoundFactor,GL_JournalGeneratorSource_UU) VALUES (200008,11,0,TO_TIMESTAMP('2012-09-24 15:04:49','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_TIMESTAMP('2012-09-24 15:04:49','YYYY-MM-DD HH24:MI:SS'),100,200005,771,1,2,'edb1ff7a-496c-460e-b798-dae6fd26c22c') +; + +-- Sep 24, 2012 3:39:41 PM COT +UPDATE AD_Column SET AD_Reference_Value_ID=362,Updated=TO_TIMESTAMP('2012-09-24 15:39:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200217 +; + +UPDATE AD_Field SET XPosition=3 WHERE AD_Tab_ID IN (200020,200021,200022) AND IsSameLine='Y' AND IsActive='Y'; + +UPDATE AD_Field SET XPosition=1 WHERE AD_Tab_ID IN (200020,200021,200022) AND IsSameline='N' AND IsActive='Y'; + +UPDATE AD_Field SET ColumnSpan=1 WHERE AD_Tab_ID IN (200020,200021,200022) AND DisplayLength<30 AND IsActive='Y'; + +UPDATE AD_Field SET ColumnSpan=3 WHERE AD_Tab_ID IN (200020,200021,200022) AND DisplayLength>=30 AND IsActive='Y'; + +UPDATE AD_Field SET NumLines=3 WHERE AD_Tab_ID IN (200020,200021,200022) AND AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Reference_ID=14) AND IsActive='Y'; + +UPDATE AD_Field SET NumLines=5 WHERE AD_Tab_ID IN (200020,200021,200022) AND AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Reference_ID=36) AND IsActive='Y'; + +UPDATE AD_Field SET NumLines=8 WHERE AD_Tab_ID IN (200020,200021,200022) AND AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Reference_ID=34) AND IsActive='Y'; + +UPDATE AD_Field SET ColumnSpan=2 WHERE AD_Tab_ID IN (200020,200021,200022) AND AD_Field_ID IN (SELECT AD_Field_ID FROM AD_Field WHERE XPosition=1 AND ColumnSpan=1 AND IsActive='Y'); + +UPDATE AD_Field SET XPosition=4,ColumnSpan=2 WHERE AD_Tab_ID IN (200020,200021,200022) AND AD_Field_ID IN (SELECT AD_Field_ID FROM AD_Field WHERE XPosition=3 AND ColumnSpan=1 AND IsActive='Y'); + +UPDATE AD_Field SET XPosition=XPosition+1 WHERE AD_Tab_ID IN (200020,200021,200022) AND AD_Field_ID IN (SELECT fi.AD_Field_ID FROM AD_Field fi INNER JOIN AD_Column c ON (fi.AD_Column_ID=C.AD_Column_ID) WHERE c.AD_Reference_ID in (20,28) AND fi.IsActive='Y'); + +UPDATE AD_Field SET ColumnSpan=5 WHERE AD_Tab_ID IN (200020,200021,200022) AND AD_Field_ID IN (SELECT AD_Field_ID FROM AD_Field WHERE XPosition=1 AND ColumnSpan=3 AND IsActive='Y'); + +SELECT register_migration_script('918_IDEMPIERE-207.sql') FROM dual +; + diff --git a/org.adempiere.base/src/org/compiere/model/I_GL_JournalGenerator.java b/org.adempiere.base/src/org/compiere/model/I_GL_JournalGenerator.java new file mode 100644 index 0000000000..5821f3623d --- /dev/null +++ b/org.adempiere.base/src/org/compiere/model/I_GL_JournalGenerator.java @@ -0,0 +1,255 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * + * This program is free software, you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY, without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program, if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.math.BigDecimal; +import java.sql.Timestamp; +import org.compiere.util.KeyNamePair; + +/** Generated Interface for GL_JournalGenerator + * @author Adempiere (generated) + * @version Release 3.6.0LTS + */ +public interface I_GL_JournalGenerator +{ + + /** TableName=GL_JournalGenerator */ + public static final String Table_Name = "GL_JournalGenerator"; + + /** AD_Table_ID=200021 */ + public static final int Table_ID = 200021; + + KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); + + /** AccessLevel = - Client - Org + */ + BigDecimal accessLevel = BigDecimal.valueOf(3); + + /** Load Meta Data */ + + /** Column name AD_Client_ID */ + public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID"; + + /** Get Client. + * Client/Tenant for this installation. + */ + public int getAD_Client_ID(); + + /** Column name AD_Org_ID */ + public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID"; + + /** Set Organization. + * Organizational entity within client + */ + public void setAD_Org_ID (int AD_Org_ID); + + /** Get Organization. + * Organizational entity within client + */ + public int getAD_Org_ID(); + + /** Column name C_AcctSchema_ID */ + public static final String COLUMNNAME_C_AcctSchema_ID = "C_AcctSchema_ID"; + + /** Set Accounting Schema. + * Rules for accounting + */ + public void setC_AcctSchema_ID (int C_AcctSchema_ID); + + /** Get Accounting Schema. + * Rules for accounting + */ + public int getC_AcctSchema_ID(); + + public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException; + + /** Column name C_DocType_ID */ + public static final String COLUMNNAME_C_DocType_ID = "C_DocType_ID"; + + /** Set Document Type. + * Document type or rules + */ + public void setC_DocType_ID (int C_DocType_ID); + + /** Get Document Type. + * Document type or rules + */ + public int getC_DocType_ID(); + + public org.compiere.model.I_C_DocType getC_DocType() throws RuntimeException; + + /** Column name C_ElementValueAdjustCR_ID */ + public static final String COLUMNNAME_C_ElementValueAdjustCR_ID = "C_ElementValueAdjustCR_ID"; + + /** Set Account Adjust CR */ + public void setC_ElementValueAdjustCR_ID (int C_ElementValueAdjustCR_ID); + + /** Get Account Adjust CR */ + public int getC_ElementValueAdjustCR_ID(); + + public org.compiere.model.I_C_ElementValue getC_ElementValueAdjustCR() throws RuntimeException; + + /** Column name C_ElementValueAdjustDR_ID */ + public static final String COLUMNNAME_C_ElementValueAdjustDR_ID = "C_ElementValueAdjustDR_ID"; + + /** Set Account Adjust DR */ + public void setC_ElementValueAdjustDR_ID (int C_ElementValueAdjustDR_ID); + + /** Get Account Adjust DR */ + public int getC_ElementValueAdjustDR_ID(); + + public org.compiere.model.I_C_ElementValue getC_ElementValueAdjustDR() throws RuntimeException; + + /** Column name Created */ + public static final String COLUMNNAME_Created = "Created"; + + /** Get Created. + * Date this record was created + */ + public Timestamp getCreated(); + + /** Column name CreatedBy */ + public static final String COLUMNNAME_CreatedBy = "CreatedBy"; + + /** Get Created By. + * User who created this records + */ + public int getCreatedBy(); + + /** Column name Description */ + public static final String COLUMNNAME_Description = "Description"; + + /** Set Description. + * Optional short description of the record + */ + public void setDescription (String Description); + + /** Get Description. + * Optional short description of the record + */ + public String getDescription(); + + /** Column name GenerateGLJournal */ + public static final String COLUMNNAME_GenerateGLJournal = "GenerateGLJournal"; + + /** Set Generate GL Journal */ + public void setGenerateGLJournal (String GenerateGLJournal); + + /** Get Generate GL Journal */ + public String getGenerateGLJournal(); + + /** Column name GL_Category_ID */ + public static final String COLUMNNAME_GL_Category_ID = "GL_Category_ID"; + + /** Set GL Category. + * General Ledger Category + */ + public void setGL_Category_ID (int GL_Category_ID); + + /** Get GL Category. + * General Ledger Category + */ + public int getGL_Category_ID(); + + public org.compiere.model.I_GL_Category getGL_Category() throws RuntimeException; + + /** Column name GL_JournalGenerator_ID */ + public static final String COLUMNNAME_GL_JournalGenerator_ID = "GL_JournalGenerator_ID"; + + /** Set GL Journal Generator */ + public void setGL_JournalGenerator_ID (int GL_JournalGenerator_ID); + + /** Get GL Journal Generator */ + public int getGL_JournalGenerator_ID(); + + /** Column name GL_JournalGenerator_UU */ + public static final String COLUMNNAME_GL_JournalGenerator_UU = "GL_JournalGenerator_UU"; + + /** Set GL_JournalGenerator_UU */ + public void setGL_JournalGenerator_UU (String GL_JournalGenerator_UU); + + /** Get GL_JournalGenerator_UU */ + public String getGL_JournalGenerator_UU(); + + /** Column name Help */ + public static final String COLUMNNAME_Help = "Help"; + + /** Set Comment/Help. + * Comment or Hint + */ + public void setHelp (String Help); + + /** Get Comment/Help. + * Comment or Hint + */ + public String getHelp(); + + /** Column name IsActive */ + public static final String COLUMNNAME_IsActive = "IsActive"; + + /** Set Active. + * The record is active in the system + */ + public void setIsActive (boolean IsActive); + + /** Get Active. + * The record is active in the system + */ + public boolean isActive(); + + /** Column name Name */ + public static final String COLUMNNAME_Name = "Name"; + + /** Set Name. + * Alphanumeric identifier of the entity + */ + public void setName (String Name); + + /** Get Name. + * Alphanumeric identifier of the entity + */ + public String getName(); + + /** Column name PostingType */ + public static final String COLUMNNAME_PostingType = "PostingType"; + + /** Set PostingType. + * The type of posted amount for the transaction + */ + public void setPostingType (String PostingType); + + /** Get PostingType. + * The type of posted amount for the transaction + */ + public String getPostingType(); + + /** Column name Updated */ + public static final String COLUMNNAME_Updated = "Updated"; + + /** Get Updated. + * Date this record was updated + */ + public Timestamp getUpdated(); + + /** Column name UpdatedBy */ + public static final String COLUMNNAME_UpdatedBy = "UpdatedBy"; + + /** Get Updated By. + * User who updated this records + */ + public int getUpdatedBy(); +} diff --git a/org.adempiere.base/src/org/compiere/model/I_GL_JournalGeneratorLine.java b/org.adempiere.base/src/org/compiere/model/I_GL_JournalGeneratorLine.java new file mode 100644 index 0000000000..5eed4b775e --- /dev/null +++ b/org.adempiere.base/src/org/compiere/model/I_GL_JournalGeneratorLine.java @@ -0,0 +1,274 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * + * This program is free software, you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY, without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program, if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.math.BigDecimal; +import java.sql.Timestamp; +import org.compiere.util.KeyNamePair; + +/** Generated Interface for GL_JournalGeneratorLine + * @author Adempiere (generated) + * @version Release 3.6.0LTS + */ +public interface I_GL_JournalGeneratorLine +{ + + /** TableName=GL_JournalGeneratorLine */ + public static final String Table_Name = "GL_JournalGeneratorLine"; + + /** AD_Table_ID=200022 */ + public static final int Table_ID = 200022; + + KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); + + /** AccessLevel = - Client - Org + */ + BigDecimal accessLevel = BigDecimal.valueOf(3); + + /** Load Meta Data */ + + /** Column name AD_Client_ID */ + public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID"; + + /** Get Client. + * Client/Tenant for this installation. + */ + public int getAD_Client_ID(); + + /** Column name AD_Org_ID */ + public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID"; + + /** Set Organization. + * Organizational entity within client + */ + public void setAD_Org_ID (int AD_Org_ID); + + /** Get Organization. + * Organizational entity within client + */ + public int getAD_Org_ID(); + + /** Column name AmtMultiplier */ + public static final String COLUMNNAME_AmtMultiplier = "AmtMultiplier"; + + /** Set Multiplier Amount. + * Multiplier Amount for generating commissions + */ + public void setAmtMultiplier (BigDecimal AmtMultiplier); + + /** Get Multiplier Amount. + * Multiplier Amount for generating commissions + */ + public BigDecimal getAmtMultiplier(); + + /** Column name BPColumn */ + public static final String COLUMNNAME_BPColumn = "BPColumn"; + + /** Set BP Column */ + public void setBPColumn (String BPColumn); + + /** Get BP Column */ + public String getBPColumn(); + + /** Column name BPDimensionType */ + public static final String COLUMNNAME_BPDimensionType = "BPDimensionType"; + + /** Set Type of BP Dimension */ + public void setBPDimensionType (String BPDimensionType); + + /** Get Type of BP Dimension */ + public String getBPDimensionType(); + + /** Column name C_BPartner_ID */ + public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID"; + + /** Set Business Partner . + * Identifies a Business Partner + */ + public void setC_BPartner_ID (int C_BPartner_ID); + + /** Get Business Partner . + * Identifies a Business Partner + */ + public int getC_BPartner_ID(); + + public org.compiere.model.I_C_BPartner getC_BPartner() throws RuntimeException; + + /** Column name C_ElementValueCR_ID */ + public static final String COLUMNNAME_C_ElementValueCR_ID = "C_ElementValueCR_ID"; + + /** Set Account CR */ + public void setC_ElementValueCR_ID (int C_ElementValueCR_ID); + + /** Get Account CR */ + public int getC_ElementValueCR_ID(); + + public org.compiere.model.I_C_ElementValue getC_ElementValueCR() throws RuntimeException; + + /** Column name C_ElementValueDR_ID */ + public static final String COLUMNNAME_C_ElementValueDR_ID = "C_ElementValueDR_ID"; + + /** Set Account DR */ + public void setC_ElementValueDR_ID (int C_ElementValueDR_ID); + + /** Get Account DR */ + public int getC_ElementValueDR_ID(); + + public org.compiere.model.I_C_ElementValue getC_ElementValueDR() throws RuntimeException; + + /** Column name Created */ + public static final String COLUMNNAME_Created = "Created"; + + /** Get Created. + * Date this record was created + */ + public Timestamp getCreated(); + + /** Column name CreatedBy */ + public static final String COLUMNNAME_CreatedBy = "CreatedBy"; + + /** Get Created By. + * User who created this records + */ + public int getCreatedBy(); + + /** Column name Description */ + public static final String COLUMNNAME_Description = "Description"; + + /** Set Description. + * Optional short description of the record + */ + public void setDescription (String Description); + + /** Get Description. + * Optional short description of the record + */ + public String getDescription(); + + /** Column name GL_JournalGenerator_ID */ + public static final String COLUMNNAME_GL_JournalGenerator_ID = "GL_JournalGenerator_ID"; + + /** Set GL Journal Generator */ + public void setGL_JournalGenerator_ID (int GL_JournalGenerator_ID); + + /** Get GL Journal Generator */ + public int getGL_JournalGenerator_ID(); + + public org.compiere.model.I_GL_JournalGenerator getGL_JournalGenerator() throws RuntimeException; + + /** Column name GL_JournalGeneratorLine_ID */ + public static final String COLUMNNAME_GL_JournalGeneratorLine_ID = "GL_JournalGeneratorLine_ID"; + + /** Set Generator Line */ + public void setGL_JournalGeneratorLine_ID (int GL_JournalGeneratorLine_ID); + + /** Get Generator Line */ + public int getGL_JournalGeneratorLine_ID(); + + /** Column name GL_JournalGeneratorLine_UU */ + public static final String COLUMNNAME_GL_JournalGeneratorLine_UU = "GL_JournalGeneratorLine_UU"; + + /** Set GL_JournalGeneratorLine_UU */ + public void setGL_JournalGeneratorLine_UU (String GL_JournalGeneratorLine_UU); + + /** Get GL_JournalGeneratorLine_UU */ + public String getGL_JournalGeneratorLine_UU(); + + /** Column name Help */ + public static final String COLUMNNAME_Help = "Help"; + + /** Set Comment/Help. + * Comment or Hint + */ + public void setHelp (String Help); + + /** Get Comment/Help. + * Comment or Hint + */ + public String getHelp(); + + /** Column name IsActive */ + public static final String COLUMNNAME_IsActive = "IsActive"; + + /** Set Active. + * The record is active in the system + */ + public void setIsActive (boolean IsActive); + + /** Get Active. + * The record is active in the system + */ + public boolean isActive(); + + /** Column name IsCopyAllDimensions */ + public static final String COLUMNNAME_IsCopyAllDimensions = "IsCopyAllDimensions"; + + /** Set Copy All Dimensions */ + public void setIsCopyAllDimensions (boolean IsCopyAllDimensions); + + /** Get Copy All Dimensions */ + public boolean isCopyAllDimensions(); + + /** Column name IsSameProduct */ + public static final String COLUMNNAME_IsSameProduct = "IsSameProduct"; + + /** Set Same Product */ + public void setIsSameProduct (boolean IsSameProduct); + + /** Get Same Product */ + public boolean isSameProduct(); + + /** Column name RoundFactor */ + public static final String COLUMNNAME_RoundFactor = "RoundFactor"; + + /** Set Round Factor */ + public void setRoundFactor (int RoundFactor); + + /** Get Round Factor */ + public int getRoundFactor(); + + /** Column name SeqNo */ + public static final String COLUMNNAME_SeqNo = "SeqNo"; + + /** Set Sequence. + * Method of ordering records; + lowest number comes first + */ + public void setSeqNo (int SeqNo); + + /** Get Sequence. + * Method of ordering records; + lowest number comes first + */ + public int getSeqNo(); + + /** Column name Updated */ + public static final String COLUMNNAME_Updated = "Updated"; + + /** Get Updated. + * Date this record was updated + */ + public Timestamp getUpdated(); + + /** Column name UpdatedBy */ + public static final String COLUMNNAME_UpdatedBy = "UpdatedBy"; + + /** Get Updated By. + * User who updated this records + */ + public int getUpdatedBy(); +} diff --git a/org.adempiere.base/src/org/compiere/model/I_GL_JournalGeneratorSource.java b/org.adempiere.base/src/org/compiere/model/I_GL_JournalGeneratorSource.java new file mode 100644 index 0000000000..f71ff03230 --- /dev/null +++ b/org.adempiere.base/src/org/compiere/model/I_GL_JournalGeneratorSource.java @@ -0,0 +1,203 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * + * This program is free software, you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY, without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program, if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.math.BigDecimal; +import java.sql.Timestamp; +import org.compiere.util.KeyNamePair; + +/** Generated Interface for GL_JournalGeneratorSource + * @author Adempiere (generated) + * @version Release 3.6.0LTS + */ +public interface I_GL_JournalGeneratorSource +{ + + /** TableName=GL_JournalGeneratorSource */ + public static final String Table_Name = "GL_JournalGeneratorSource"; + + /** AD_Table_ID=200023 */ + public static final int Table_ID = 200023; + + KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); + + /** AccessLevel = - Client - Org + */ + BigDecimal accessLevel = BigDecimal.valueOf(3); + + /** Load Meta Data */ + + /** Column name AD_Client_ID */ + public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID"; + + /** Get Client. + * Client/Tenant for this installation. + */ + public int getAD_Client_ID(); + + /** Column name AD_Org_ID */ + public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID"; + + /** Set Organization. + * Organizational entity within client + */ + public void setAD_Org_ID (int AD_Org_ID); + + /** Get Organization. + * Organizational entity within client + */ + public int getAD_Org_ID(); + + /** Column name AmtMultiplier */ + public static final String COLUMNNAME_AmtMultiplier = "AmtMultiplier"; + + /** Set Multiplier Amount. + * Multiplier Amount for generating commissions + */ + public void setAmtMultiplier (BigDecimal AmtMultiplier); + + /** Get Multiplier Amount. + * Multiplier Amount for generating commissions + */ + public BigDecimal getAmtMultiplier(); + + /** Column name C_ElementValue_ID */ + public static final String COLUMNNAME_C_ElementValue_ID = "C_ElementValue_ID"; + + /** Set Account Element. + * Account Element + */ + public void setC_ElementValue_ID (int C_ElementValue_ID); + + /** Get Account Element. + * Account Element + */ + public int getC_ElementValue_ID(); + + public org.compiere.model.I_C_ElementValue getC_ElementValue() throws RuntimeException; + + /** Column name Created */ + public static final String COLUMNNAME_Created = "Created"; + + /** Get Created. + * Date this record was created + */ + public Timestamp getCreated(); + + /** Column name CreatedBy */ + public static final String COLUMNNAME_CreatedBy = "CreatedBy"; + + /** Get Created By. + * User who created this records + */ + public int getCreatedBy(); + + /** Column name GL_Category_ID */ + public static final String COLUMNNAME_GL_Category_ID = "GL_Category_ID"; + + /** Set GL Category. + * General Ledger Category + */ + public void setGL_Category_ID (int GL_Category_ID); + + /** Get GL Category. + * General Ledger Category + */ + public int getGL_Category_ID(); + + public org.compiere.model.I_GL_Category getGL_Category() throws RuntimeException; + + /** Column name GL_JournalGeneratorLine_ID */ + public static final String COLUMNNAME_GL_JournalGeneratorLine_ID = "GL_JournalGeneratorLine_ID"; + + /** Set Generator Line */ + public void setGL_JournalGeneratorLine_ID (int GL_JournalGeneratorLine_ID); + + /** Get Generator Line */ + public int getGL_JournalGeneratorLine_ID(); + + public org.compiere.model.I_GL_JournalGeneratorLine getGL_JournalGeneratorLine() throws RuntimeException; + + /** Column name GL_JournalGeneratorSource_ID */ + public static final String COLUMNNAME_GL_JournalGeneratorSource_ID = "GL_JournalGeneratorSource_ID"; + + /** Set Generator Source */ + public void setGL_JournalGeneratorSource_ID (int GL_JournalGeneratorSource_ID); + + /** Get Generator Source */ + public int getGL_JournalGeneratorSource_ID(); + + /** Column name GL_JournalGeneratorSource_UU */ + public static final String COLUMNNAME_GL_JournalGeneratorSource_UU = "GL_JournalGeneratorSource_UU"; + + /** Set GL_JournalGeneratorSource_UU */ + public void setGL_JournalGeneratorSource_UU (String GL_JournalGeneratorSource_UU); + + /** Get GL_JournalGeneratorSource_UU */ + public String getGL_JournalGeneratorSource_UU(); + + /** Column name Help */ + public static final String COLUMNNAME_Help = "Help"; + + /** Set Comment/Help. + * Comment or Hint + */ + public void setHelp (String Help); + + /** Get Comment/Help. + * Comment or Hint + */ + public String getHelp(); + + /** Column name IsActive */ + public static final String COLUMNNAME_IsActive = "IsActive"; + + /** Set Active. + * The record is active in the system + */ + public void setIsActive (boolean IsActive); + + /** Get Active. + * The record is active in the system + */ + public boolean isActive(); + + /** Column name RoundFactor */ + public static final String COLUMNNAME_RoundFactor = "RoundFactor"; + + /** Set Round Factor */ + public void setRoundFactor (int RoundFactor); + + /** Get Round Factor */ + public int getRoundFactor(); + + /** Column name Updated */ + public static final String COLUMNNAME_Updated = "Updated"; + + /** Get Updated. + * Date this record was updated + */ + public Timestamp getUpdated(); + + /** Column name UpdatedBy */ + public static final String COLUMNNAME_UpdatedBy = "UpdatedBy"; + + /** Get Updated By. + * User who updated this records + */ + public int getUpdatedBy(); +} diff --git a/org.adempiere.base/src/org/compiere/model/MJournalGenerator.java b/org.adempiere.base/src/org/compiere/model/MJournalGenerator.java new file mode 100644 index 0000000000..b274de6968 --- /dev/null +++ b/org.adempiere.base/src/org/compiere/model/MJournalGenerator.java @@ -0,0 +1,87 @@ +/********************************************************************** +* This file is part of iDempiere ERP Open Source * +* http://www.idempiere.org * +* * +* Copyright (C) Contributors * +* * +* This program is free software; you can redistribute it and/or * +* modify it under the terms of the GNU General Public License * +* as published by the Free Software Foundation; either version 2 * +* of the License, or (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU General Public License * +* along with this program; if not, write to the Free Software * +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * +* MA 02110-1301, USA. * +* * +* Contributors: * +* - Carlos Ruiz - globalqss * +**********************************************************************/ +package org.compiere.model; + +import java.sql.ResultSet; +import java.util.List; +import java.util.Properties; + +import org.compiere.util.CLogger; + +/** + * GL Journal Generator Model + * + * @author Carlos Ruiz - GlobalQSS + */ +public class MJournalGenerator extends X_GL_JournalGenerator +{ + /** + * + */ + private static final long serialVersionUID = -8044550395699815424L; + + /** Logger */ + private static CLogger s_log = CLogger.getCLogger(MJournalGenerator.class); + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param GL_JournalGenerator_ID id + * @param trxName transaction + */ + public MJournalGenerator (Properties ctx, int GL_JournalGenerator_ID, String trxName) + { + super (ctx, GL_JournalGenerator_ID, trxName); + } // MJournalGenerator + + /** + * Load Constructor + * @param ctx ctx + * @param rs result set + * @param trxName transaction + */ + public MJournalGenerator (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MJournalGenerator + + /** + * Get Journal Generator Lines of Journal Generator + * @return lines + */ + public MJournalGeneratorLine[] getLines () + { + List list = new Query(getCtx(), MJournalGeneratorLine.Table_Name, "GL_JournalGenerator_ID=?", get_TrxName()) + .setOnlyActiveRecords(true) + .setParameters(getGL_JournalGenerator_ID()) + .setOrderBy(MJournalGeneratorLine.COLUMNNAME_SeqNo) + .list(); + // + MJournalGeneratorLine[] lines = new MJournalGeneratorLine[list.size()]; + list.toArray(lines); + return lines; + } // getLines + +} // MJournalGenerator diff --git a/org.adempiere.base/src/org/compiere/model/MJournalGeneratorLine.java b/org.adempiere.base/src/org/compiere/model/MJournalGeneratorLine.java new file mode 100644 index 0000000000..113b20f515 --- /dev/null +++ b/org.adempiere.base/src/org/compiere/model/MJournalGeneratorLine.java @@ -0,0 +1,86 @@ +/********************************************************************** +* This file is part of iDempiere ERP Open Source * +* http://www.idempiere.org * +* * +* Copyright (C) Contributors * +* * +* This program is free software; you can redistribute it and/or * +* modify it under the terms of the GNU General Public License * +* as published by the Free Software Foundation; either version 2 * +* of the License, or (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU General Public License * +* along with this program; if not, write to the Free Software * +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * +* MA 02110-1301, USA. * +* * +* Contributors: * +* - Carlos Ruiz - globalqss * +**********************************************************************/ +package org.compiere.model; + +import java.sql.ResultSet; +import java.util.List; +import java.util.Properties; + +import org.compiere.util.CLogger; + +/** + * GL Journal Generator Model + * + * @author Carlos Ruiz - GlobalQSS + */ +public class MJournalGeneratorLine extends X_GL_JournalGeneratorLine +{ + /** + * + */ + private static final long serialVersionUID = -8151648371117046820L; + + /** Logger */ + private static CLogger s_log = CLogger.getCLogger(MJournalGeneratorLine.class); + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param GL_JournalGeneratorLine_ID id + * @param trxName transaction + */ + public MJournalGeneratorLine (Properties ctx, int GL_JournalGeneratorLine_ID, String trxName) + { + super (ctx, GL_JournalGeneratorLine_ID, trxName); + } // MJournalGeneratorLine + + /** + * Load Constructor + * @param ctx ctx + * @param rs result set + * @param trxName transaction + */ + public MJournalGeneratorLine (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MJournalGeneratorLine + + /** + * Get Journal Generator Sources of Journal Generator Line + * @return sources + */ + public MJournalGeneratorSource[] getSources () + { + List list = new Query(getCtx(), MJournalGeneratorSource.Table_Name, "GL_JournalGeneratorLine_ID=?", get_TrxName()) + .setOnlyActiveRecords(true) + .setParameters(getGL_JournalGeneratorLine_ID()) + .list(); + // + MJournalGeneratorSource[] sources = new MJournalGeneratorSource[list.size()]; + list.toArray(sources); + return sources; + } // getSources + +} // MJournalGeneratorLine diff --git a/org.adempiere.base/src/org/compiere/model/MJournalGeneratorSource.java b/org.adempiere.base/src/org/compiere/model/MJournalGeneratorSource.java new file mode 100644 index 0000000000..6ebc83ea1a --- /dev/null +++ b/org.adempiere.base/src/org/compiere/model/MJournalGeneratorSource.java @@ -0,0 +1,69 @@ +/********************************************************************** +* This file is part of iDempiere ERP Open Source * +* http://www.idempiere.org * +* * +* Copyright (C) Contributors * +* * +* This program is free software; you can redistribute it and/or * +* modify it under the terms of the GNU General Public License * +* as published by the Free Software Foundation; either version 2 * +* of the License, or (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU General Public License * +* along with this program; if not, write to the Free Software * +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * +* MA 02110-1301, USA. * +* * +* Contributors: * +* - Carlos Ruiz - globalqss * +**********************************************************************/ +package org.compiere.model; + +import java.sql.ResultSet; +import java.util.Properties; + +import org.compiere.util.CLogger; + +/** + * GL Journal Generator Model + * + * @author Carlos Ruiz - GlobalQSS + */ +public class MJournalGeneratorSource extends X_GL_JournalGeneratorSource +{ + /** + * + */ + private static final long serialVersionUID = 7489445330989092988L; + + /** Logger */ + private static CLogger s_log = CLogger.getCLogger(MJournalGeneratorSource.class); + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param GL_JournalGeneratorSource_ID id + * @param trxName transaction + */ + public MJournalGeneratorSource (Properties ctx, int GL_JournalGeneratorSource_ID, String trxName) + { + super (ctx, GL_JournalGeneratorSource_ID, trxName); + } // MJournalGeneratorSource + + /** + * Load Constructor + * @param ctx ctx + * @param rs result set + * @param trxName transaction + */ + public MJournalGeneratorSource (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MJournalGeneratorSource + +} // MJournalGeneratorSource diff --git a/org.adempiere.base/src/org/compiere/model/X_GL_JournalGenerator.java b/org.adempiere.base/src/org/compiere/model/X_GL_JournalGenerator.java new file mode 100644 index 0000000000..1080918bf7 --- /dev/null +++ b/org.adempiere.base/src/org/compiere/model/X_GL_JournalGenerator.java @@ -0,0 +1,344 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * + * This program is free software, you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY, without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program, if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +/** Generated Model - DO NOT CHANGE */ +package org.compiere.model; + +import java.sql.ResultSet; +import java.util.Properties; +import org.compiere.util.KeyNamePair; + +/** Generated Model for GL_JournalGenerator + * @author Adempiere (generated) + * @version Release 3.6.0LTS - $Id$ */ +public class X_GL_JournalGenerator extends PO implements I_GL_JournalGenerator, I_Persistent +{ + + /** + * + */ + private static final long serialVersionUID = 20120924L; + + /** Standard Constructor */ + public X_GL_JournalGenerator (Properties ctx, int GL_JournalGenerator_ID, String trxName) + { + super (ctx, GL_JournalGenerator_ID, trxName); + /** if (GL_JournalGenerator_ID == 0) + { + setGL_JournalGenerator_ID (0); + setName (null); + } */ + } + + /** Load Constructor */ + public X_GL_JournalGenerator (Properties ctx, ResultSet rs, String trxName) + { + super (ctx, rs, trxName); + } + + /** AccessLevel + * @return 3 - Client - Org + */ + protected int get_AccessLevel() + { + return accessLevel.intValue(); + } + + /** Load Meta Data */ + protected POInfo initPO (Properties ctx) + { + POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName()); + return poi; + } + + public String toString() + { + StringBuffer sb = new StringBuffer ("X_GL_JournalGenerator[") + .append(get_ID()).append("]"); + return sb.toString(); + } + + public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException + { + return (org.compiere.model.I_C_AcctSchema)MTable.get(getCtx(), org.compiere.model.I_C_AcctSchema.Table_Name) + .getPO(getC_AcctSchema_ID(), get_TrxName()); } + + /** Set Accounting Schema. + @param C_AcctSchema_ID + Rules for accounting + */ + public void setC_AcctSchema_ID (int C_AcctSchema_ID) + { + if (C_AcctSchema_ID < 1) + set_Value (COLUMNNAME_C_AcctSchema_ID, null); + else + set_Value (COLUMNNAME_C_AcctSchema_ID, Integer.valueOf(C_AcctSchema_ID)); + } + + /** Get Accounting Schema. + @return Rules for accounting + */ + public int getC_AcctSchema_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_AcctSchema_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public org.compiere.model.I_C_DocType getC_DocType() throws RuntimeException + { + return (org.compiere.model.I_C_DocType)MTable.get(getCtx(), org.compiere.model.I_C_DocType.Table_Name) + .getPO(getC_DocType_ID(), get_TrxName()); } + + /** Set Document Type. + @param C_DocType_ID + Document type or rules + */ + public void setC_DocType_ID (int C_DocType_ID) + { + if (C_DocType_ID < 0) + set_Value (COLUMNNAME_C_DocType_ID, null); + else + set_Value (COLUMNNAME_C_DocType_ID, Integer.valueOf(C_DocType_ID)); + } + + /** Get Document Type. + @return Document type or rules + */ + public int getC_DocType_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_DocType_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public org.compiere.model.I_C_ElementValue getC_ElementValueAdjustCR() throws RuntimeException + { + return (org.compiere.model.I_C_ElementValue)MTable.get(getCtx(), org.compiere.model.I_C_ElementValue.Table_Name) + .getPO(getC_ElementValueAdjustCR_ID(), get_TrxName()); } + + /** Set Account Adjust CR. + @param C_ElementValueAdjustCR_ID Account Adjust CR */ + public void setC_ElementValueAdjustCR_ID (int C_ElementValueAdjustCR_ID) + { + if (C_ElementValueAdjustCR_ID < 1) + set_Value (COLUMNNAME_C_ElementValueAdjustCR_ID, null); + else + set_Value (COLUMNNAME_C_ElementValueAdjustCR_ID, Integer.valueOf(C_ElementValueAdjustCR_ID)); + } + + /** Get Account Adjust CR. + @return Account Adjust CR */ + public int getC_ElementValueAdjustCR_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_ElementValueAdjustCR_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public org.compiere.model.I_C_ElementValue getC_ElementValueAdjustDR() throws RuntimeException + { + return (org.compiere.model.I_C_ElementValue)MTable.get(getCtx(), org.compiere.model.I_C_ElementValue.Table_Name) + .getPO(getC_ElementValueAdjustDR_ID(), get_TrxName()); } + + /** Set Account Adjust DR. + @param C_ElementValueAdjustDR_ID Account Adjust DR */ + public void setC_ElementValueAdjustDR_ID (int C_ElementValueAdjustDR_ID) + { + if (C_ElementValueAdjustDR_ID < 1) + set_Value (COLUMNNAME_C_ElementValueAdjustDR_ID, null); + else + set_Value (COLUMNNAME_C_ElementValueAdjustDR_ID, Integer.valueOf(C_ElementValueAdjustDR_ID)); + } + + /** Get Account Adjust DR. + @return Account Adjust DR */ + public int getC_ElementValueAdjustDR_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_ElementValueAdjustDR_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Description. + @param Description + Optional short description of the record + */ + public void setDescription (String Description) + { + set_Value (COLUMNNAME_Description, Description); + } + + /** Get Description. + @return Optional short description of the record + */ + public String getDescription () + { + return (String)get_Value(COLUMNNAME_Description); + } + + /** Set Generate GL Journal. + @param GenerateGLJournal Generate GL Journal */ + public void setGenerateGLJournal (String GenerateGLJournal) + { + set_Value (COLUMNNAME_GenerateGLJournal, GenerateGLJournal); + } + + /** Get Generate GL Journal. + @return Generate GL Journal */ + public String getGenerateGLJournal () + { + return (String)get_Value(COLUMNNAME_GenerateGLJournal); + } + + public org.compiere.model.I_GL_Category getGL_Category() throws RuntimeException + { + return (org.compiere.model.I_GL_Category)MTable.get(getCtx(), org.compiere.model.I_GL_Category.Table_Name) + .getPO(getGL_Category_ID(), get_TrxName()); } + + /** Set GL Category. + @param GL_Category_ID + General Ledger Category + */ + public void setGL_Category_ID (int GL_Category_ID) + { + if (GL_Category_ID < 1) + set_Value (COLUMNNAME_GL_Category_ID, null); + else + set_Value (COLUMNNAME_GL_Category_ID, Integer.valueOf(GL_Category_ID)); + } + + /** Get GL Category. + @return General Ledger Category + */ + public int getGL_Category_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_GL_Category_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set GL Journal Generator. + @param GL_JournalGenerator_ID GL Journal Generator */ + public void setGL_JournalGenerator_ID (int GL_JournalGenerator_ID) + { + if (GL_JournalGenerator_ID < 1) + set_ValueNoCheck (COLUMNNAME_GL_JournalGenerator_ID, null); + else + set_ValueNoCheck (COLUMNNAME_GL_JournalGenerator_ID, Integer.valueOf(GL_JournalGenerator_ID)); + } + + /** Get GL Journal Generator. + @return GL Journal Generator */ + public int getGL_JournalGenerator_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_GL_JournalGenerator_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set GL_JournalGenerator_UU. + @param GL_JournalGenerator_UU GL_JournalGenerator_UU */ + public void setGL_JournalGenerator_UU (String GL_JournalGenerator_UU) + { + set_Value (COLUMNNAME_GL_JournalGenerator_UU, GL_JournalGenerator_UU); + } + + /** Get GL_JournalGenerator_UU. + @return GL_JournalGenerator_UU */ + public String getGL_JournalGenerator_UU () + { + return (String)get_Value(COLUMNNAME_GL_JournalGenerator_UU); + } + + /** Set Comment/Help. + @param Help + Comment or Hint + */ + public void setHelp (String Help) + { + set_Value (COLUMNNAME_Help, Help); + } + + /** Get Comment/Help. + @return Comment or Hint + */ + public String getHelp () + { + return (String)get_Value(COLUMNNAME_Help); + } + + /** Set Name. + @param Name + Alphanumeric identifier of the entity + */ + public void setName (String Name) + { + set_Value (COLUMNNAME_Name, Name); + } + + /** Get Name. + @return Alphanumeric identifier of the entity + */ + public String getName () + { + return (String)get_Value(COLUMNNAME_Name); + } + + /** Get Record ID/ColumnName + @return ID/ColumnName pair + */ + public KeyNamePair getKeyNamePair() + { + return new KeyNamePair(get_ID(), getName()); + } + + /** PostingType AD_Reference_ID=125 */ + public static final int POSTINGTYPE_AD_Reference_ID=125; + /** Actual = A */ + public static final String POSTINGTYPE_Actual = "A"; + /** Budget = B */ + public static final String POSTINGTYPE_Budget = "B"; + /** Commitment = E */ + public static final String POSTINGTYPE_Commitment = "E"; + /** Statistical = S */ + public static final String POSTINGTYPE_Statistical = "S"; + /** Reservation = R */ + public static final String POSTINGTYPE_Reservation = "R"; + /** Set PostingType. + @param PostingType + The type of posted amount for the transaction + */ + public void setPostingType (String PostingType) + { + + set_Value (COLUMNNAME_PostingType, PostingType); + } + + /** Get PostingType. + @return The type of posted amount for the transaction + */ + public String getPostingType () + { + return (String)get_Value(COLUMNNAME_PostingType); + } +} \ No newline at end of file diff --git a/org.adempiere.base/src/org/compiere/model/X_GL_JournalGeneratorLine.java b/org.adempiere.base/src/org/compiere/model/X_GL_JournalGeneratorLine.java new file mode 100644 index 0000000000..e9aca8cad5 --- /dev/null +++ b/org.adempiere.base/src/org/compiere/model/X_GL_JournalGeneratorLine.java @@ -0,0 +1,396 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * + * This program is free software, you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY, without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program, if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +/** Generated Model - DO NOT CHANGE */ +package org.compiere.model; + +import java.math.BigDecimal; +import java.sql.ResultSet; +import java.util.Properties; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; + +/** Generated Model for GL_JournalGeneratorLine + * @author Adempiere (generated) + * @version Release 3.6.0LTS - $Id$ */ +public class X_GL_JournalGeneratorLine extends PO implements I_GL_JournalGeneratorLine, I_Persistent +{ + + /** + * + */ + private static final long serialVersionUID = 20120924L; + + /** Standard Constructor */ + public X_GL_JournalGeneratorLine (Properties ctx, int GL_JournalGeneratorLine_ID, String trxName) + { + super (ctx, GL_JournalGeneratorLine_ID, trxName); + /** if (GL_JournalGeneratorLine_ID == 0) + { + setGL_JournalGenerator_ID (0); + setGL_JournalGeneratorLine_ID (0); + setIsCopyAllDimensions (false); +// N + setIsSameProduct (false); +// N + setSeqNo (0); +// @SQL=SELECT NVL(MAX(SeqNo),0)+10 AS DefaultValue FROM GL_JournalGeneratorLine WHERE GL_JournalGenerator_ID=@GL_JournalGenerator_ID@ + } */ + } + + /** Load Constructor */ + public X_GL_JournalGeneratorLine (Properties ctx, ResultSet rs, String trxName) + { + super (ctx, rs, trxName); + } + + /** AccessLevel + * @return 3 - Client - Org + */ + protected int get_AccessLevel() + { + return accessLevel.intValue(); + } + + /** Load Meta Data */ + protected POInfo initPO (Properties ctx) + { + POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName()); + return poi; + } + + public String toString() + { + StringBuffer sb = new StringBuffer ("X_GL_JournalGeneratorLine[") + .append(get_ID()).append("]"); + return sb.toString(); + } + + /** Set Multiplier Amount. + @param AmtMultiplier + Multiplier Amount for generating commissions + */ + public void setAmtMultiplier (BigDecimal AmtMultiplier) + { + set_Value (COLUMNNAME_AmtMultiplier, AmtMultiplier); + } + + /** Get Multiplier Amount. + @return Multiplier Amount for generating commissions + */ + public BigDecimal getAmtMultiplier () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_AmtMultiplier); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** Set BP Column. + @param BPColumn BP Column */ + public void setBPColumn (String BPColumn) + { + set_Value (COLUMNNAME_BPColumn, BPColumn); + } + + /** Get BP Column. + @return BP Column */ + public String getBPColumn () + { + return (String)get_Value(COLUMNNAME_BPColumn); + } + + /** BPDimensionType AD_Reference_ID=200008 */ + public static final int BPDIMENSIONTYPE_AD_Reference_ID=200008; + /** Column = C */ + public static final String BPDIMENSIONTYPE_Column = "C"; + /** Fixed = F */ + public static final String BPDIMENSIONTYPE_Fixed = "F"; + /** Same = S */ + public static final String BPDIMENSIONTYPE_Same = "S"; + /** Set Type of BP Dimension. + @param BPDimensionType Type of BP Dimension */ + public void setBPDimensionType (String BPDimensionType) + { + + set_Value (COLUMNNAME_BPDimensionType, BPDimensionType); + } + + /** Get Type of BP Dimension. + @return Type of BP Dimension */ + public String getBPDimensionType () + { + return (String)get_Value(COLUMNNAME_BPDimensionType); + } + + public org.compiere.model.I_C_BPartner getC_BPartner() throws RuntimeException + { + return (org.compiere.model.I_C_BPartner)MTable.get(getCtx(), org.compiere.model.I_C_BPartner.Table_Name) + .getPO(getC_BPartner_ID(), get_TrxName()); } + + /** Set Business Partner . + @param C_BPartner_ID + Identifies a Business Partner + */ + public void setC_BPartner_ID (int C_BPartner_ID) + { + if (C_BPartner_ID < 1) + set_Value (COLUMNNAME_C_BPartner_ID, null); + else + set_Value (COLUMNNAME_C_BPartner_ID, Integer.valueOf(C_BPartner_ID)); + } + + /** Get Business Partner . + @return Identifies a Business Partner + */ + public int getC_BPartner_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_BPartner_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public org.compiere.model.I_C_ElementValue getC_ElementValueCR() throws RuntimeException + { + return (org.compiere.model.I_C_ElementValue)MTable.get(getCtx(), org.compiere.model.I_C_ElementValue.Table_Name) + .getPO(getC_ElementValueCR_ID(), get_TrxName()); } + + /** Set Account CR. + @param C_ElementValueCR_ID Account CR */ + public void setC_ElementValueCR_ID (int C_ElementValueCR_ID) + { + if (C_ElementValueCR_ID < 1) + set_Value (COLUMNNAME_C_ElementValueCR_ID, null); + else + set_Value (COLUMNNAME_C_ElementValueCR_ID, Integer.valueOf(C_ElementValueCR_ID)); + } + + /** Get Account CR. + @return Account CR */ + public int getC_ElementValueCR_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_ElementValueCR_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public org.compiere.model.I_C_ElementValue getC_ElementValueDR() throws RuntimeException + { + return (org.compiere.model.I_C_ElementValue)MTable.get(getCtx(), org.compiere.model.I_C_ElementValue.Table_Name) + .getPO(getC_ElementValueDR_ID(), get_TrxName()); } + + /** Set Account DR. + @param C_ElementValueDR_ID Account DR */ + public void setC_ElementValueDR_ID (int C_ElementValueDR_ID) + { + if (C_ElementValueDR_ID < 1) + set_Value (COLUMNNAME_C_ElementValueDR_ID, null); + else + set_Value (COLUMNNAME_C_ElementValueDR_ID, Integer.valueOf(C_ElementValueDR_ID)); + } + + /** Get Account DR. + @return Account DR */ + public int getC_ElementValueDR_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_ElementValueDR_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Description. + @param Description + Optional short description of the record + */ + public void setDescription (String Description) + { + set_Value (COLUMNNAME_Description, Description); + } + + /** Get Description. + @return Optional short description of the record + */ + public String getDescription () + { + return (String)get_Value(COLUMNNAME_Description); + } + + public org.compiere.model.I_GL_JournalGenerator getGL_JournalGenerator() throws RuntimeException + { + return (org.compiere.model.I_GL_JournalGenerator)MTable.get(getCtx(), org.compiere.model.I_GL_JournalGenerator.Table_Name) + .getPO(getGL_JournalGenerator_ID(), get_TrxName()); } + + /** Set GL Journal Generator. + @param GL_JournalGenerator_ID GL Journal Generator */ + public void setGL_JournalGenerator_ID (int GL_JournalGenerator_ID) + { + if (GL_JournalGenerator_ID < 1) + set_ValueNoCheck (COLUMNNAME_GL_JournalGenerator_ID, null); + else + set_ValueNoCheck (COLUMNNAME_GL_JournalGenerator_ID, Integer.valueOf(GL_JournalGenerator_ID)); + } + + /** Get GL Journal Generator. + @return GL Journal Generator */ + public int getGL_JournalGenerator_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_GL_JournalGenerator_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Get Record ID/ColumnName + @return ID/ColumnName pair + */ + public KeyNamePair getKeyNamePair() + { + return new KeyNamePair(get_ID(), String.valueOf(getGL_JournalGenerator_ID())); + } + + /** Set Generator Line. + @param GL_JournalGeneratorLine_ID Generator Line */ + public void setGL_JournalGeneratorLine_ID (int GL_JournalGeneratorLine_ID) + { + if (GL_JournalGeneratorLine_ID < 1) + set_ValueNoCheck (COLUMNNAME_GL_JournalGeneratorLine_ID, null); + else + set_ValueNoCheck (COLUMNNAME_GL_JournalGeneratorLine_ID, Integer.valueOf(GL_JournalGeneratorLine_ID)); + } + + /** Get Generator Line. + @return Generator Line */ + public int getGL_JournalGeneratorLine_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_GL_JournalGeneratorLine_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set GL_JournalGeneratorLine_UU. + @param GL_JournalGeneratorLine_UU GL_JournalGeneratorLine_UU */ + public void setGL_JournalGeneratorLine_UU (String GL_JournalGeneratorLine_UU) + { + set_Value (COLUMNNAME_GL_JournalGeneratorLine_UU, GL_JournalGeneratorLine_UU); + } + + /** Get GL_JournalGeneratorLine_UU. + @return GL_JournalGeneratorLine_UU */ + public String getGL_JournalGeneratorLine_UU () + { + return (String)get_Value(COLUMNNAME_GL_JournalGeneratorLine_UU); + } + + /** Set Comment/Help. + @param Help + Comment or Hint + */ + public void setHelp (String Help) + { + set_Value (COLUMNNAME_Help, Help); + } + + /** Get Comment/Help. + @return Comment or Hint + */ + public String getHelp () + { + return (String)get_Value(COLUMNNAME_Help); + } + + /** Set Copy All Dimensions. + @param IsCopyAllDimensions Copy All Dimensions */ + public void setIsCopyAllDimensions (boolean IsCopyAllDimensions) + { + set_Value (COLUMNNAME_IsCopyAllDimensions, Boolean.valueOf(IsCopyAllDimensions)); + } + + /** Get Copy All Dimensions. + @return Copy All Dimensions */ + public boolean isCopyAllDimensions () + { + Object oo = get_Value(COLUMNNAME_IsCopyAllDimensions); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Same Product. + @param IsSameProduct Same Product */ + public void setIsSameProduct (boolean IsSameProduct) + { + set_Value (COLUMNNAME_IsSameProduct, Boolean.valueOf(IsSameProduct)); + } + + /** Get Same Product. + @return Same Product */ + public boolean isSameProduct () + { + Object oo = get_Value(COLUMNNAME_IsSameProduct); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Round Factor. + @param RoundFactor Round Factor */ + public void setRoundFactor (int RoundFactor) + { + set_Value (COLUMNNAME_RoundFactor, Integer.valueOf(RoundFactor)); + } + + /** Get Round Factor. + @return Round Factor */ + public int getRoundFactor () + { + Integer ii = (Integer)get_Value(COLUMNNAME_RoundFactor); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Sequence. + @param SeqNo + Method of ordering records; lowest number comes first + */ + public void setSeqNo (int SeqNo) + { + set_Value (COLUMNNAME_SeqNo, Integer.valueOf(SeqNo)); + } + + /** Get Sequence. + @return Method of ordering records; lowest number comes first + */ + public int getSeqNo () + { + Integer ii = (Integer)get_Value(COLUMNNAME_SeqNo); + if (ii == null) + return 0; + return ii.intValue(); + } +} \ No newline at end of file diff --git a/org.adempiere.base/src/org/compiere/model/X_GL_JournalGeneratorSource.java b/org.adempiere.base/src/org/compiere/model/X_GL_JournalGeneratorSource.java new file mode 100644 index 0000000000..7ede65679b --- /dev/null +++ b/org.adempiere.base/src/org/compiere/model/X_GL_JournalGeneratorSource.java @@ -0,0 +1,246 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * + * This program is free software, you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY, without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program, if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +/** Generated Model - DO NOT CHANGE */ +package org.compiere.model; + +import java.math.BigDecimal; +import java.sql.ResultSet; +import java.util.Properties; +import org.compiere.util.Env; + +/** Generated Model for GL_JournalGeneratorSource + * @author Adempiere (generated) + * @version Release 3.6.0LTS - $Id$ */ +public class X_GL_JournalGeneratorSource extends PO implements I_GL_JournalGeneratorSource, I_Persistent +{ + + /** + * + */ + private static final long serialVersionUID = 20120924L; + + /** Standard Constructor */ + public X_GL_JournalGeneratorSource (Properties ctx, int GL_JournalGeneratorSource_ID, String trxName) + { + super (ctx, GL_JournalGeneratorSource_ID, trxName); + /** if (GL_JournalGeneratorSource_ID == 0) + { + setAmtMultiplier (Env.ZERO); +// 1 + setC_ElementValue_ID (0); + setGL_JournalGeneratorLine_ID (0); + setGL_JournalGeneratorSource_ID (0); + } */ + } + + /** Load Constructor */ + public X_GL_JournalGeneratorSource (Properties ctx, ResultSet rs, String trxName) + { + super (ctx, rs, trxName); + } + + /** AccessLevel + * @return 3 - Client - Org + */ + protected int get_AccessLevel() + { + return accessLevel.intValue(); + } + + /** Load Meta Data */ + protected POInfo initPO (Properties ctx) + { + POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName()); + return poi; + } + + public String toString() + { + StringBuffer sb = new StringBuffer ("X_GL_JournalGeneratorSource[") + .append(get_ID()).append("]"); + return sb.toString(); + } + + /** Set Multiplier Amount. + @param AmtMultiplier + Multiplier Amount for generating commissions + */ + public void setAmtMultiplier (BigDecimal AmtMultiplier) + { + set_Value (COLUMNNAME_AmtMultiplier, AmtMultiplier); + } + + /** Get Multiplier Amount. + @return Multiplier Amount for generating commissions + */ + public BigDecimal getAmtMultiplier () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_AmtMultiplier); + if (bd == null) + return Env.ZERO; + return bd; + } + + public org.compiere.model.I_C_ElementValue getC_ElementValue() throws RuntimeException + { + return (org.compiere.model.I_C_ElementValue)MTable.get(getCtx(), org.compiere.model.I_C_ElementValue.Table_Name) + .getPO(getC_ElementValue_ID(), get_TrxName()); } + + /** Set Account Element. + @param C_ElementValue_ID + Account Element + */ + public void setC_ElementValue_ID (int C_ElementValue_ID) + { + if (C_ElementValue_ID < 1) + set_Value (COLUMNNAME_C_ElementValue_ID, null); + else + set_Value (COLUMNNAME_C_ElementValue_ID, Integer.valueOf(C_ElementValue_ID)); + } + + /** Get Account Element. + @return Account Element + */ + public int getC_ElementValue_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_ElementValue_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public org.compiere.model.I_GL_Category getGL_Category() throws RuntimeException + { + return (org.compiere.model.I_GL_Category)MTable.get(getCtx(), org.compiere.model.I_GL_Category.Table_Name) + .getPO(getGL_Category_ID(), get_TrxName()); } + + /** Set GL Category. + @param GL_Category_ID + General Ledger Category + */ + public void setGL_Category_ID (int GL_Category_ID) + { + if (GL_Category_ID < 1) + set_Value (COLUMNNAME_GL_Category_ID, null); + else + set_Value (COLUMNNAME_GL_Category_ID, Integer.valueOf(GL_Category_ID)); + } + + /** Get GL Category. + @return General Ledger Category + */ + public int getGL_Category_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_GL_Category_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public org.compiere.model.I_GL_JournalGeneratorLine getGL_JournalGeneratorLine() throws RuntimeException + { + return (org.compiere.model.I_GL_JournalGeneratorLine)MTable.get(getCtx(), org.compiere.model.I_GL_JournalGeneratorLine.Table_Name) + .getPO(getGL_JournalGeneratorLine_ID(), get_TrxName()); } + + /** Set Generator Line. + @param GL_JournalGeneratorLine_ID Generator Line */ + public void setGL_JournalGeneratorLine_ID (int GL_JournalGeneratorLine_ID) + { + if (GL_JournalGeneratorLine_ID < 1) + set_ValueNoCheck (COLUMNNAME_GL_JournalGeneratorLine_ID, null); + else + set_ValueNoCheck (COLUMNNAME_GL_JournalGeneratorLine_ID, Integer.valueOf(GL_JournalGeneratorLine_ID)); + } + + /** Get Generator Line. + @return Generator Line */ + public int getGL_JournalGeneratorLine_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_GL_JournalGeneratorLine_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Generator Source. + @param GL_JournalGeneratorSource_ID Generator Source */ + public void setGL_JournalGeneratorSource_ID (int GL_JournalGeneratorSource_ID) + { + if (GL_JournalGeneratorSource_ID < 1) + set_ValueNoCheck (COLUMNNAME_GL_JournalGeneratorSource_ID, null); + else + set_ValueNoCheck (COLUMNNAME_GL_JournalGeneratorSource_ID, Integer.valueOf(GL_JournalGeneratorSource_ID)); + } + + /** Get Generator Source. + @return Generator Source */ + public int getGL_JournalGeneratorSource_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_GL_JournalGeneratorSource_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set GL_JournalGeneratorSource_UU. + @param GL_JournalGeneratorSource_UU GL_JournalGeneratorSource_UU */ + public void setGL_JournalGeneratorSource_UU (String GL_JournalGeneratorSource_UU) + { + set_Value (COLUMNNAME_GL_JournalGeneratorSource_UU, GL_JournalGeneratorSource_UU); + } + + /** Get GL_JournalGeneratorSource_UU. + @return GL_JournalGeneratorSource_UU */ + public String getGL_JournalGeneratorSource_UU () + { + return (String)get_Value(COLUMNNAME_GL_JournalGeneratorSource_UU); + } + + /** Set Comment/Help. + @param Help + Comment or Hint + */ + public void setHelp (String Help) + { + set_Value (COLUMNNAME_Help, Help); + } + + /** Get Comment/Help. + @return Comment or Hint + */ + public String getHelp () + { + return (String)get_Value(COLUMNNAME_Help); + } + + /** Set Round Factor. + @param RoundFactor Round Factor */ + public void setRoundFactor (int RoundFactor) + { + set_Value (COLUMNNAME_RoundFactor, Integer.valueOf(RoundFactor)); + } + + /** Get Round Factor. + @return Round Factor */ + public int getRoundFactor () + { + Integer ii = (Integer)get_Value(COLUMNNAME_RoundFactor); + if (ii == null) + return 0; + return ii.intValue(); + } +} \ No newline at end of file diff --git a/org.adempiere.base/src/org/globalqss/process/GLJournalGenerate.java b/org.adempiere.base/src/org/globalqss/process/GLJournalGenerate.java new file mode 100644 index 0000000000..f5ff17f00c --- /dev/null +++ b/org.adempiere.base/src/org/globalqss/process/GLJournalGenerate.java @@ -0,0 +1,538 @@ +/********************************************************************** +* This file is part of iDempiere ERP Open Source * +* http://www.idempiere.org * +* * +* Copyright (C) Contributors * +* * +* This program is free software; you can redistribute it and/or * +* modify it under the terms of the GNU General Public License * +* as published by the Free Software Foundation; either version 2 * +* of the License, or (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU General Public License * +* along with this program; if not, write to the Free Software * +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * +* MA 02110-1301, USA. * +* * +* Contributors: * +* - Carlos Ruiz - globalqss * +**********************************************************************/ +package org.globalqss.process; + +import java.math.BigDecimal; +import java.math.MathContext; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.List; +import java.util.logging.Level; + +import org.adempiere.exceptions.AdempiereException; +import org.adempiere.exceptions.DBException; +import org.compiere.model.MAccount; +import org.compiere.model.MAcctSchema; +import org.compiere.model.MAcctSchemaElement; +import org.compiere.model.MBPartner; +import org.compiere.model.MConversionType; +import org.compiere.model.MElementValue; +import org.compiere.model.MJournal; +import org.compiere.model.MJournalGenerator; +import org.compiere.model.MJournalGeneratorLine; +import org.compiere.model.MJournalGeneratorSource; +import org.compiere.model.MJournalLine; +import org.compiere.model.MProduct; +import org.compiere.model.MTable; +import org.compiere.model.PO; +import org.compiere.process.ProcessInfoParameter; +import org.compiere.process.SvrProcess; +import org.compiere.report.MReportTree; +import org.compiere.util.DB; +import org.compiere.util.Env; + +/** + * GL Journal Generator + * + * @author Carlos Ruiz - Quality Systems & Solutions - globalqss + */ +public class GLJournalGenerate extends SvrProcess +{ + /** Processing date from/to */ + private Timestamp p_ProcessingDateFrom; + private Timestamp p_ProcessingDateTo; + /** Date of GL Journal */ + private Timestamp p_DateAcct; + /** Flag is simulation */ + private boolean p_IsSimulation = true; + /** Document Action */ + private String p_DocAction = null; + /** Document No */ + private String p_DocumentNo; + /** BPartner to filter */ + private int p_C_BPartner_ID = 0; + /** Product to filter */ + private int p_M_Product_ID = 0; + /* The Journal Generator */ + private int p_QSS_JournalGenerator_ID; + + /** + * Prepare - e.g., get Parameters. + */ + protected void prepare() + { + ProcessInfoParameter[] para = getParameter(); + for (int i = 0; i < para.length; i++) + { + String name = para[i].getParameterName(); + if (name.equals("ProcessingDate")) { + p_ProcessingDateFrom = (Timestamp)para[i].getParameter(); + p_ProcessingDateTo = (Timestamp)para[i].getParameter_To(); + } + else if (name.equals("DateAcct")) + p_DateAcct = (Timestamp)para[i].getParameter(); + else if (name.equals("IsSimulation")) + p_IsSimulation = para[i].getParameterAsBoolean(); + else if (name.equals("DocAction")) + p_DocAction = (String) para[i].getParameter(); + else if (name.equals("DocumentNo")) + p_DocumentNo = (String) para[i].getParameter(); + else if (name.equals("C_BPartner_ID")) + p_C_BPartner_ID = para[i].getParameterAsInt(); + else if (name.equals("M_Product_ID")) + p_M_Product_ID = para[i].getParameterAsInt(); + else + log.log(Level.SEVERE, "Unknown Parameter: " + name); + } + p_QSS_JournalGenerator_ID = getRecord_ID(); + } // prepare + + + /** + * Perform process. + * @return Message + * @throws Exception + */ + protected String doIt() throws Exception + { + log.info("QSS_Journal_Generator_ID=" + p_QSS_JournalGenerator_ID + + ", ProcessingDate=" + p_ProcessingDateFrom + "/" + p_ProcessingDateTo + + ", DateAcct=" + p_DateAcct + + ", IsSimulation=" + p_IsSimulation + + ", DocAction=" + p_DocAction + + ", DocumentNo=" + p_DocumentNo + + ", C_BPartner_ID=" + p_C_BPartner_ID + + ", M_Product_ID=" + p_M_Product_ID + ); + + MJournalGenerator journalGenerator = new MJournalGenerator(getCtx(), p_QSS_JournalGenerator_ID, get_TrxName()); + MAcctSchema as = (MAcctSchema) journalGenerator.getC_AcctSchema(); + + BigDecimal totalAmount = Env.ZERO; + List> listDimOut = new ArrayList>(); + List> listColOut = new ArrayList>(); + List listDrAmtOut = new ArrayList(); + List listCrAmtOut = new ArrayList(); + List listAccountOut = new ArrayList(); + List listLinesOut = new ArrayList(); + + for (MJournalGeneratorLine line : journalGenerator.getLines()) { + int idxBPColumn = -1; + + List groupColumns = new ArrayList(); + groupColumns.add("AD_Client_ID"); + if (line.isCopyAllDimensions()) { + for (MAcctSchemaElement element : as.getAcctSchemaElements()) { + String columnName = MAcctSchemaElement.getColumnName(element.getElementType()); + if (! groupColumns.contains(columnName)) + groupColumns.add(columnName); + } + } else { + if (MJournalGeneratorLine.BPDIMENSIONTYPE_Same.equals(line.getBPDimensionType())) + groupColumns.add("C_BPartner_ID"); + else if (MJournalGeneratorLine.BPDIMENSIONTYPE_Column.equals(line.getBPDimensionType())) { + String[] parts = line.getBPColumn().split("\\."); + String tablename = parts[0]; + groupColumns.add(tablename + "_ID"); + idxBPColumn = groupColumns.size()-1; + } + + if (line.isSameProduct()) + groupColumns.add("M_Product_ID"); + } + String groupBy = ""; + for (String column : groupColumns) { + if (groupBy.length() == 0) + groupBy += column; + else + groupBy += ","+column; + } + List> listDim = new ArrayList>(); + List listAmt = new ArrayList(); + + int p_AD_Org_ID = line.getAD_Org_ID(); + if (p_AD_Org_ID == 0) + p_AD_Org_ID = journalGenerator.getAD_Org_ID(); + if (p_AD_Org_ID == 0) + p_AD_Org_ID = Env.getAD_Org_ID(getCtx()); + for (MJournalGeneratorSource source : line.getSources()) { + String sql = + "SELECT SUM(AmtAcctDr-AmtAcctCr), " + + groupBy + + " FROM Fact_Acct " + + " WHERE PostingType='A' " + + " AND IsActive='Y' " + + " AND DateAcct BETWEEN ? AND ? " + + " AND C_AcctSchema_ID=? " + + " AND AD_Client_ID=? "; + if (p_AD_Org_ID > 0) + sql += " AND AD_Org_ID=" + p_AD_Org_ID; + if (p_C_BPartner_ID > 0) + sql += " AND C_BPartner_ID=" + p_C_BPartner_ID; + if (p_M_Product_ID > 0) + sql += " AND M_Product_ID=" + p_M_Product_ID; + if (source.getGL_Category_ID() > 0) + sql += " AND GL_Category_ID=" + source.getGL_Category_ID(); + sql += " AND ("; + /* TODO: Get all accounts below tree of source */ + sql += MReportTree.getWhereClause(getCtx(), 0, MAcctSchemaElement.ELEMENTTYPE_Account, source.getC_ElementValue_ID()); + sql += ")"; + sql += " GROUP BY " + groupBy; + + PreparedStatement pstmt = null; + ResultSet rs = null; + try + { + pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt.setTimestamp(1, p_ProcessingDateFrom); + pstmt.setTimestamp(2, p_ProcessingDateTo); + pstmt.setInt(3, journalGenerator.getC_AcctSchema_ID()); + pstmt.setInt(4, getAD_Client_ID()); + rs = pstmt.executeQuery(); + while (rs.next()) { + BigDecimal sourceAmt = rs.getBigDecimal(1); + if (sourceAmt != null && sourceAmt.signum() != 0) { + sourceAmt = applyMultiplierAndFactor(sourceAmt, source.getAmtMultiplier(), source.getRoundFactor()); + + List dimensions = new ArrayList(); + int idxCol = 0; + for (String column : groupColumns) { + if (idxBPColumn == idxCol) { + // Assign the BPDIMENSIONTYPE_Column to the output BP + int bpIdOut = 0; + String[] parts = line.getBPColumn().split("\\."); + String tablename = parts[0]; + String columnname = parts[1]; + int id = rs.getInt(column); + if (id > 0) { + MTable table = MTable.get(getCtx(), tablename); + PO po = table.getPO(id, get_TrxName()); + bpIdOut = po.get_ValueAsInt(columnname); + } + dimensions.add(bpIdOut); + } else { + dimensions.add(rs.getInt(column)); + } + idxCol++; + } + + if (listDim.contains(dimensions)) { + int idx = listDim.indexOf(dimensions); + BigDecimal dimAmt = listAmt.get(idx); + dimAmt = dimAmt.add(sourceAmt); + listAmt.set(idx, dimAmt); + } else { + listDim.add(dimensions); + listAmt.add(sourceAmt); + } + } + } + } + catch (SQLException e) + { + //log.log(Level.SEVERE, sql, getSQLException(e)); + throw new DBException(e, sql); + } + finally + { + DB.close(rs, pstmt); + rs = null; pstmt = null; + } + + } + + /* Ready, here I have the input array with all sources to take into account, construct the output */ + + List columnsOut = new ArrayList(); + if (line.isCopyAllDimensions()) { + columnsOut = groupColumns; + } else { + columnsOut.add("AD_Client_ID"); + if ( MJournalGeneratorLine.BPDIMENSIONTYPE_Same.equals(line.getBPDimensionType()) + || MJournalGeneratorLine.BPDIMENSIONTYPE_Fixed.equals(line.getBPDimensionType()) + || MJournalGeneratorLine.BPDIMENSIONTYPE_Column.equals(line.getBPDimensionType())) + columnsOut.add("C_BPartner_ID"); + if (line.isSameProduct()) + columnsOut.add("M_Product_ID"); + } + + for (int i = 0; i < listDim.size(); i++) { + List dimensions = listDim.get(i); + BigDecimal amount = listAmt.get(i); + + List dimensionsOut = new ArrayList(); + if (amount != null && amount.signum() != 0) { + amount = applyMultiplierAndFactor(amount, line.getAmtMultiplier(), line.getRoundFactor()); + + if (line.isCopyAllDimensions()) { + dimensionsOut = dimensions; + } else { + /* First dimension is always AD_Client_ID */ + dimensionsOut.add(dimensions.get(0)); + if (MJournalGeneratorLine.BPDIMENSIONTYPE_Same.equals(line.getBPDimensionType())) { + dimensionsOut.add(dimensions.get(groupColumns.indexOf("C_BPartner_ID"))); + } else if (MJournalGeneratorLine.BPDIMENSIONTYPE_Fixed.equals(line.getBPDimensionType())) { + dimensionsOut.add(line.getC_BPartner_ID()); + } else if (MJournalGeneratorLine.BPDIMENSIONTYPE_Column.equals(line.getBPDimensionType())) { + String[] parts = line.getBPColumn().split("\\."); + String tablename = parts[0]; + dimensionsOut.add(dimensions.get(groupColumns.indexOf(tablename + "_ID"))); + } + + if (line.isSameProduct()) { + dimensionsOut.add(dimensions.get(groupColumns.indexOf("M_Product_ID"))); + } + } + + if (line.getC_ElementValueDR_ID() > 0) { + listAccountOut.add(line.getC_ElementValueDR_ID()); + listDrAmtOut.add(amount); + listCrAmtOut.add(Env.ZERO); + listDimOut.add(dimensionsOut); + listColOut.add(columnsOut); + listLinesOut.add(line); + totalAmount = totalAmount.add(amount); + } + if (line.getC_ElementValueCR_ID() > 0) { + listAccountOut.add(line.getC_ElementValueCR_ID()); + listDrAmtOut.add(Env.ZERO); + listCrAmtOut.add(amount); + listDimOut.add(dimensionsOut); + listColOut.add(columnsOut); + listLinesOut.add(line); + totalAmount = totalAmount.subtract(amount); + } + if (line.getC_ElementValueDR_ID() == 0 && line.getC_ElementValueCR_ID() == 0 && line.isCopyAllDimensions()) { + int accountId = dimensions.get(groupColumns.indexOf("Account_ID")); + listAccountOut.add(accountId); + if (amount.signum() > 0) { + listDrAmtOut.add(amount); + listCrAmtOut.add(Env.ZERO); + totalAmount = totalAmount.add(amount); + } else { + listDrAmtOut.add(Env.ZERO); + listCrAmtOut.add(amount.negate()); + totalAmount = totalAmount.add(amount); + } + listDimOut.add(dimensionsOut); + listColOut.add(columnsOut); + listLinesOut.add(line); + } + } + } + } // generatorLines + + // Add adjust line + if (totalAmount.signum() < 0 && journalGenerator.getC_ElementValueAdjustDR_ID() > 0) { + listAccountOut.add(journalGenerator.getC_ElementValueAdjustDR_ID()); + listDrAmtOut.add(totalAmount.negate()); + listCrAmtOut.add(Env.ZERO); + listDimOut.add(null); + listColOut.add(null); + listLinesOut.add(null); + } else if (totalAmount.signum() > 0 && journalGenerator.getC_ElementValueAdjustCR_ID() > 0) { + listAccountOut.add(journalGenerator.getC_ElementValueAdjustCR_ID()); + listDrAmtOut.add(Env.ZERO); + listCrAmtOut.add(totalAmount); + listDimOut.add(null); + listColOut.add(null); + listLinesOut.add(null); + } + + MJournal j = null; + int lineNo = 10; + /* Ready, here we have an array of output calculated journals, let's process them */ + for (int i = 0; i < listDimOut.size(); i++) { + List dimensions = listDimOut.get(i); + List columnsOut = listColOut.get(i); + BigDecimal dr = listDrAmtOut.get(i); + BigDecimal cr = listCrAmtOut.get(i); + int accountId = listAccountOut.get(i); + MJournalGeneratorLine line = listLinesOut.get(i); + + if (p_IsSimulation) { + MElementValue ev = new MElementValue(getCtx(), accountId, get_TrxName()); + String msg = "Account=" + ev.getValue() + + ", DR=" + dr + + ", CR=" + cr; + int idxcol = 0; + if (columnsOut != null) { + for (String col : columnsOut) { + int id = dimensions.get(idxcol); + if (id == 0) + continue; + if ("C_BPartner_ID".equals(col)) { + MBPartner bp = MBPartner.get(getCtx(), id); + msg += ", C_BPartner=" + bp.getValue(); + } else if ("M_Product_ID".equals(col)) { + MProduct pr = MProduct.get(getCtx(), id); + msg += ", M_Product=" + pr.getValue(); + } else if ("AD_Client_ID".equals(col)) { + } else { + msg += ", " + col + "=" + id; + } + idxcol++; + } + } + addLog(msg); + } else { + /* Create journals */ + if (j == null) { + // * Create a GL Journal + // conversion type = default + j = new MJournal(getCtx(), 0, get_TrxName()); + if (journalGenerator.getAD_Org_ID() > 0) + j.setAD_Org_ID(journalGenerator.getAD_Org_ID()); + else + j.setAD_Org_ID(Env.getAD_Org_ID(getCtx())); + j.setC_Currency_ID(as.getC_Currency_ID()); + j.setC_DocType_ID(journalGenerator.getC_DocType_ID()); + j.setControlAmt(Env.ZERO); + j.setDateAcct(p_DateAcct); + j.setDateDoc(p_DateAcct); + j.setDescription(journalGenerator.getDescription()); + j.setDocumentNo(p_DocumentNo); + j.setGL_Category_ID(journalGenerator.getGL_Category_ID()); + j.setPostingType(journalGenerator.getPostingType()); + j.setC_AcctSchema_ID(as.getC_AcctSchema_ID()); + j.setC_ConversionType_ID(MConversionType.getDefault(as.getAD_Client_ID())); + j.saveEx(); + } + // Create the journal lines + MJournalLine jl = new MJournalLine(j); + jl.setLine(lineNo); + lineNo += 10; + MAccount combination; + { + int AD_Client_ID = getAD_Client_ID(); + int AD_Org_ID = 0; + if (line != null) + AD_Org_ID = line.getAD_Org_ID(); + if (AD_Org_ID == 0) + AD_Org_ID = journalGenerator.getAD_Org_ID(); + if (AD_Org_ID == 0) + AD_Org_ID = Env.getAD_Org_ID(getCtx()); + int C_AcctSchema_ID = journalGenerator.getC_AcctSchema_ID(); + int Account_ID = accountId; + int C_SubAcct_ID = 0; + + int M_Product_ID = 0; + int C_BPartner_ID = 0; + int AD_OrgTrx_ID = 0; + int C_LocFrom_ID = 0; + int C_LocTo_ID = 0; + int C_SalesRegion_ID = 0; + int C_Project_ID = 0; + int C_Campaign_ID = 0; + int C_Activity_ID = 0; + int User1_ID = 0; + int User2_ID = 0; + int UserElement1_ID = 0; + int UserElement2_ID = 0; + if (columnsOut != null) { + int idxcol = 0; + for (String col : columnsOut) { + int id = dimensions.get(idxcol); + if ("M_Product_ID".equals(col)) + M_Product_ID = id; + else if ("C_BPartner_ID".equals(col)) + C_BPartner_ID = id; + else if ("AD_OrgTrx_ID".equals(col)) + AD_OrgTrx_ID = id; + else if ("C_LocFrom_ID".equals(col)) + C_LocFrom_ID = id; + else if ("C_LocTo_ID".equals(col)) + C_LocTo_ID = id; + else if ("C_SalesRegion_ID".equals(col)) + C_SalesRegion_ID = id; + else if ("C_Project_ID".equals(col)) + C_Project_ID = id; + else if ("C_Campaign_ID".equals(col)) + C_Campaign_ID = id; + else if ("C_Activity_ID".equals(col)) + C_Activity_ID = id; + else if ("User1_ID".equals(col)) + User1_ID = id; + else if ("User2_ID".equals(col)) + User2_ID = id; + else if ("UserElement1_ID".equals(col)) + UserElement1_ID = id; + else if ("UserElement2_ID".equals(col)) + UserElement2_ID = id; + + idxcol++; + } + } + combination = MAccount.get(getCtx(), AD_Client_ID, + AD_Org_ID, C_AcctSchema_ID, Account_ID, + C_SubAcct_ID, M_Product_ID, C_BPartner_ID, + AD_OrgTrx_ID, C_LocFrom_ID, C_LocTo_ID, + C_SalesRegion_ID, C_Project_ID, C_Campaign_ID, + C_Activity_ID, User1_ID, User2_ID, UserElement1_ID, + UserElement2_ID); + if (combination == null) + throw new AdempiereException("Could not create combination"); + } + jl.setC_ValidCombination_ID(combination); + if (line != null) + jl.setDescription(line.getDescription()); + jl.setAmtSourceDr(dr); + jl.setAmtAcctDr(dr); + jl.setAmtSourceCr(cr); + jl.setAmtAcctCr(cr); + jl.saveEx(); + } + } + + if (j != null && p_DocAction != null) { + // DocAction + if (!j.processIt(p_DocAction)) + throw new AdempiereException("Could not " + p_DocAction + " journal"); + j.saveEx(); + } + + return "@OK@" + (j != null ? " @Created@ @GL_Journal_ID@=" + j.getDocumentNo() : ""); + } // doIt + + private BigDecimal applyMultiplierAndFactor(BigDecimal sourceAmt, BigDecimal amtMultiplier, int roundFactor) { + if (amtMultiplier.compareTo(Env.ONE) != 0) + sourceAmt = sourceAmt.multiply(amtMultiplier, MathContext.UNLIMITED); + + if (roundFactor < 0) { + BigDecimal divisor = new BigDecimal(Math.pow(10, -roundFactor)); + sourceAmt = sourceAmt.divide(divisor, MathContext.UNLIMITED); + sourceAmt = sourceAmt.setScale(0, BigDecimal.ROUND_HALF_UP); + sourceAmt = sourceAmt.multiply(divisor, MathContext.UNLIMITED); + sourceAmt = sourceAmt.setScale(0, BigDecimal.ROUND_HALF_UP); + } else { + sourceAmt = sourceAmt.setScale(roundFactor, BigDecimal.ROUND_HALF_UP); + } + return sourceAmt; + } + +} // GLJournalGenerate From 8de7da2ea551dfc9f369a14af6471f3d9de63cc5 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 24 Sep 2012 16:31:22 -0500 Subject: [PATCH 12/79] IDEMPIERE-382 Prevent users to go to detail tabs if link fields are not filled / fix problem with zero ID tables --- .../src/org/compiere/grid/VTabbedPane.java | 6 ++++-- .../src/org/adempiere/webui/component/AbstractADTab.java | 8 ++++++-- .../WEB-INF/src/org/adempiere/webui/panel/ADSortTab.java | 5 +++++ .../WEB-INF/src/org/adempiere/webui/panel/ADTabpanel.java | 8 ++++++++ .../src/org/adempiere/webui/panel/IADTabpanel.java | 5 +++++ 5 files changed, 28 insertions(+), 4 deletions(-) diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VTabbedPane.java b/org.adempiere.ui.swing/src/org/compiere/grid/VTabbedPane.java index 846f379e3b..8c4bddfa12 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VTabbedPane.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/VTabbedPane.java @@ -26,6 +26,7 @@ import org.compiere.apps.ADialog; import org.compiere.apps.APanel; import org.compiere.model.DataStatusEvent; import org.compiere.model.GridTab; +import org.compiere.model.MTable; import org.compiere.swing.CTabbedPane; import org.compiere.util.CLogger; import org.compiere.util.Env; @@ -272,14 +273,15 @@ public class VTabbedPane extends CTabbedPane if (oldC != null && oldC instanceof GridController) { GridController oldGC = (GridController)oldC; + int zeroValid = (MTable.isZeroIDTable(oldGC.getMTab().getTableName()) ? 1 : 0); if ((newGC.getTabLevel() > oldGC.getTabLevel()+1) - || (newGC.getTabLevel() > oldGC.getTabLevel() && oldGC.getMTab().getRecord_ID() <=0)) // TabLevel increase and parent ID <=0 IDEMPIERE 382 + || (newGC.getTabLevel() > oldGC.getTabLevel() && oldGC.getMTab().getRecord_ID()+zeroValid <=0)) // TabLevel increase and parent ID <=0 IDEMPIERE 382 { // validate // Search for right tab GridController rightGC = null; //boolean canJump = true; - boolean canJump = oldGC.getMTab().getRecord_ID() <=0 ? false : true; // IDEMPIERE 382 + boolean canJump = oldGC.getMTab().getRecord_ID()+zeroValid <=0 ? false : true; // IDEMPIERE 382 int currentLevel = newGC.getTabLevel(); for (int i = index-1; i >=0; i--) { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/AbstractADTab.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/AbstractADTab.java index 522e606662..cb7a22bce6 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/AbstractADTab.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/AbstractADTab.java @@ -29,6 +29,7 @@ import org.adempiere.webui.part.AbstractUIPart; import org.compiere.model.DataStatusEvent; import org.compiere.model.GridField; import org.compiere.model.GridTab; +import org.compiere.model.MTable; import org.compiere.util.CLogger; import org.compiere.util.Env; import org.compiere.util.Evaluator; @@ -242,8 +243,11 @@ public abstract class AbstractADTab extends AbstractUIPart implements IADTab currentLevel = tabPanel.getTabLevel(); } } - if (canJump && checkRecordID && oldTabpanel.getRecord_ID() <= 0) - canJump = false; + if (canJump && checkRecordID ) { + int zeroValid = (MTable.isZeroIDTable(oldTabpanel.getTableName()) ? 1 : 0); + if (oldTabpanel.getRecord_ID() + zeroValid <= 0) + canJump = false; + } } } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADSortTab.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADSortTab.java index 433341c326..e1641dd27a 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADSortTab.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADSortTab.java @@ -870,6 +870,11 @@ public class ADSortTab extends Panel implements IADTabpanel return gridTab.getTabLevel(); } + public String getTableName() + { + return gridTab.getTableName(); + } + public int getRecord_ID() { return gridTab.getRecord_ID(); } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADTabpanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADTabpanel.java index c982cee1c6..9510a7620c 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADTabpanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADTabpanel.java @@ -670,6 +670,14 @@ DataStatusListener, IADTabpanel return gridTab.getTabLevel(); } + /** + * @return The tablename of this Tabpanel + */ + public String getTableName() + { + return gridTab.getTableName(); + } + /** * @return The record ID of this Tabpanel */ diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/IADTabpanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/IADTabpanel.java index 76509b9bb4..93ae8da7b1 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/IADTabpanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/IADTabpanel.java @@ -33,6 +33,11 @@ public interface IADTabpanel extends Component, Evaluatee { */ public int getTabLevel(); + /** + * @return tablename + */ + public String getTableName(); + /** * @return record ID */ From b01b1a02d17b155385d50dac41150f10c611cfd6 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 25 Sep 2012 09:41:21 -0500 Subject: [PATCH 13/79] IDEMPIERE-439 Chinese Characters not on PDF / Thanks to Paul Bowden (phib) for the bug report and the fix --- .../compiere/print/layout/StringElement.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/print/layout/StringElement.java b/org.adempiere.base/src/org/compiere/print/layout/StringElement.java index 885d7a8dc2..3a5b258d45 100644 --- a/org.adempiere.base/src/org/compiere/print/layout/StringElement.java +++ b/org.adempiere.base/src/org/compiere/print/layout/StringElement.java @@ -470,10 +470,19 @@ public class StringElement extends PrintElement { layout = new TextLayout (iter, g2D.getFontRenderContext()); yPen = yPos + layout.getAscent(); - // layout.draw(g2D, xPen, yPen); - g2D.setFont(m_font); - g2D.setPaint(m_paint); - g2D.drawString(iter, xPen, yPen); + + boolean fastDraw = LayoutEngine.s_FASTDRAW; + if (fastDraw && !isView && !is8Bit) + fastDraw = false; + + if ( fastDraw ) + { + g2D.setFont(m_font); + g2D.setPaint(m_paint); + g2D.drawString(iter, xPen, yPen); + } + else + layout.draw(g2D, xPen, yPen); // yPos += layout.getAscent() + layout.getDescent() + layout.getLeading(); if (width < layout.getAdvance()) From bda4e5736dd2b13212842d870950cd18f16b4fd0 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 25 Sep 2012 12:54:09 -0500 Subject: [PATCH 14/79] =?UTF-8?q?IDEMPIERE-308=20Performance:=20Replace=20?= =?UTF-8?q?with=20StringBuilder=20/=20Thanks=20to=20Richard=20Morales=20an?= =?UTF-8?q?d=20David=20Pe=C3=B1uela?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/org/compiere/process/CopyOrder.java | 3 +- .../src/org/compiere/process/CopyRole.java | 38 ++-- .../compiere/process/DistributionCreate.java | 6 +- .../org/compiere/process/DistributionRun.java | 179 ++++++++++-------- .../org/compiere/process/DunningPrint.java | 37 ++-- .../compiere/process/DunningRunCreate.java | 12 +- .../src/org/compiere/process/EMailTest.java | 6 +- 7 files changed, 155 insertions(+), 126 deletions(-) diff --git a/org.adempiere.base.process/src/org/compiere/process/CopyOrder.java b/org.adempiere.base.process/src/org/compiere/process/CopyOrder.java index e9f8bdf5b9..ee4b3485d7 100644 --- a/org.adempiere.base.process/src/org/compiere/process/CopyOrder.java +++ b/org.adempiere.base.process/src/org/compiere/process/CopyOrder.java @@ -112,7 +112,8 @@ public class CopyOrder extends SvrProcess // // Env.setSOTrx(getCtx(), newOrder.isSOTrx()); // return "@C_Order_ID@ " + newOrder.getDocumentNo(); - return dt.getName() + ": " + newOrder.getDocumentNo(); + StringBuilder msgreturn = new StringBuilder(dt.getName()).append(": ").append(newOrder.getDocumentNo()); + return msgreturn.toString(); } // doIt } // CopyOrder \ No newline at end of file diff --git a/org.adempiere.base.process/src/org/compiere/process/CopyRole.java b/org.adempiere.base.process/src/org/compiere/process/CopyRole.java index 3e44b87133..bcf9344d65 100755 --- a/org.adempiere.base.process/src/org/compiere/process/CopyRole.java +++ b/org.adempiere.base.process/src/org/compiere/process/CopyRole.java @@ -88,8 +88,8 @@ public class CopyRole extends SvrProcess String table = tables[i]; String keycolumn = keycolumns[i]; - String sql = "DELETE FROM " + table + " WHERE AD_Role_ID = " + m_AD_Role_ID_To; - int no = DB.executeUpdateEx(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("DELETE FROM ").append(table).append(" WHERE AD_Role_ID = ").append(m_AD_Role_ID_To); + int no = DB.executeUpdateEx(sql.toString(), get_TrxName()); addLog(action++, null, BigDecimal.valueOf(no), "Old records deleted from " + table ); final boolean column_IsReadWrite = @@ -97,29 +97,29 @@ public class CopyRole extends SvrProcess && !table.equals(I_AD_Role_Included.Table_Name); final boolean column_SeqNo = table.equals(I_AD_Role_Included.Table_Name); - sql = "INSERT INTO " + table - + " (AD_Client_ID, AD_Org_ID, Created, CreatedBy, Updated, UpdatedBy, " - + "AD_Role_ID, " + keycolumn +", isActive"; + sql = new StringBuilder("INSERT INTO ").append(table) + .append(" (AD_Client_ID, AD_Org_ID, Created, CreatedBy, Updated, UpdatedBy, ") + .append( "AD_Role_ID, ").append(keycolumn).append(", isActive"); if (column_SeqNo) - sql += ", SeqNo "; + sql.append(", SeqNo "); if (column_IsReadWrite) - sql += ", isReadWrite) "; + sql.append(", isReadWrite) "); else - sql += ") "; - sql += "SELECT " + m_AD_Client_ID - + ", "+ m_AD_Org_ID - + ", getdate(), "+ Env.getAD_User_ID(Env.getCtx()) - + ", getdate(), "+ Env.getAD_User_ID(Env.getCtx()) - + ", " + m_AD_Role_ID_To - + ", " + keycolumn - + ", IsActive "; + sql.append(") "); + sql.append("SELECT ").append(m_AD_Client_ID) + .append(", ").append(m_AD_Org_ID) + .append(", getdate(), ").append(Env.getAD_User_ID(Env.getCtx())) + .append(", getdate(), ").append(Env.getAD_User_ID(Env.getCtx())) + .append(", ").append(m_AD_Role_ID_To) + .append(", ").append(keycolumn) + .append(", IsActive "); if (column_SeqNo) - sql += ", SeqNo "; + sql.append(", SeqNo "); if (column_IsReadWrite) - sql += ", isReadWrite "; - sql += "FROM " + table + " WHERE AD_Role_ID = " + m_AD_Role_ID_From; + sql.append(", isReadWrite "); + sql.append("FROM ").append(table).append(" WHERE AD_Role_ID = ").append(m_AD_Role_ID_From); - no = DB.executeUpdateEx (sql, get_TrxName()); + no = DB.executeUpdateEx (sql.toString(), get_TrxName()); addLog(action++, null, new BigDecimal(no), "New records inserted into " + table ); } diff --git a/org.adempiere.base.process/src/org/compiere/process/DistributionCreate.java b/org.adempiere.base.process/src/org/compiere/process/DistributionCreate.java index a9afa634b0..a12321a18d 100644 --- a/org.adempiere.base.process/src/org/compiere/process/DistributionCreate.java +++ b/org.adempiere.base.process/src/org/compiere/process/DistributionCreate.java @@ -151,11 +151,13 @@ public class DistributionCreate extends SvrProcess // Update Qty if (m_singleOrder != null) { - m_singleOrder.setDescription("# " + counter + " - " + m_totalQty); + StringBuilder msg = new StringBuilder("# ").append(counter).append(" - ").append(m_totalQty); + m_singleOrder.setDescription(msg.toString()); m_singleOrder.saveEx(); } - return "@Created@ #" + counter + " - @Qty@=" + m_totalQty; + StringBuilder msgreturn = new StringBuilder("@Created@ #").append(counter).append(" - @Qty@=").append(m_totalQty); + return msgreturn.toString(); } // doIt /** diff --git a/org.adempiere.base.process/src/org/compiere/process/DistributionRun.java b/org.adempiere.base.process/src/org/compiere/process/DistributionRun.java index 5a0a112930..176056b6b8 100644 --- a/org.adempiere.base.process/src/org/compiere/process/DistributionRun.java +++ b/org.adempiere.base.process/src/org/compiere/process/DistributionRun.java @@ -320,10 +320,12 @@ public class DistributionRun extends SvrProcess for (int j = 0; j < m_runLines.length; j++) { MDistributionRunLine runLine = m_runLines[j]; - if (runLine.isActualMinGtTotal()) - throw new Exception ("Line " + runLine.getLine() - + " Sum of Min Qty=" + runLine.getActualMin() - + " is greater than Total Qty=" + runLine.getTotalQty()); + if (runLine.isActualMinGtTotal()){ + StringBuilder msg = new StringBuilder("Line ").append(runLine.getLine()) + .append(" Sum of Min Qty=").append(runLine.getActualMin()) + .append(" is greater than Total Qty=").append(runLine.getTotalQty()); + throw new Exception (msg.toString()); + } if (allocationEqTotal && !runLine.isActualAllocationEqTotal()) allocationEqTotal = false; } // for all run lines @@ -378,8 +380,9 @@ public class DistributionRun extends SvrProcess } } } // for all detail lines - throw new Exception ("Cannot adjust Difference = " + difference - + " - You need to change Total Qty or Min Qty"); + StringBuilder msgexc = new StringBuilder("Cannot adjust Difference = ").append(difference) + .append(" - You need to change Total Qty or Min Qty"); + throw new Exception (msgexc.toString()); } else // Distibute { @@ -394,9 +397,11 @@ public class DistributionRun extends SvrProcess ratioTotal = ratioTotal.add(detail.getRatio()); } } - if (ratioTotal.compareTo(Env.ZERO) == 0) - throw new Exception ("Cannot distribute Difference = " + difference - + " - You need to change Total Qty or Min Qty"); + if (ratioTotal.compareTo(Env.ZERO) == 0){ + StringBuilder msgexc = new StringBuilder("Cannot distribute Difference = ").append(difference) + .append(" - You need to change Total Qty or Min Qty"); + throw new Exception (msgexc.toString()); + } // Distribute for (int i = 0; i < m_details.length; i++) { @@ -542,8 +547,8 @@ public class DistributionRun extends SvrProcess product = MProduct.get (getCtx(), detail.getM_Product_ID()); if (p_IsTest) { - addLog(0,null, detail.getActualAllocation(), - bp.getName() + " - " + product.getName()); + StringBuilder msglog = new StringBuilder(bp.getName()).append(" - ").append(product.getName()); + addLog(0,null, detail.getActualAllocation(), msglog.toString()); continue; } @@ -566,8 +571,8 @@ public class DistributionRun extends SvrProcess log.log(Level.SEVERE, "OrderLine not saved"); return false; } - addLog(0,null, detail.getActualAllocation(), order.getDocumentNo() - + ": " + bp.getName() + " - " + product.getName()); + StringBuilder msglog = new StringBuilder(order.getDocumentNo()).append(": ").append(bp.getName()).append(" - ").append(product.getName()); + addLog(0,null, detail.getActualAllocation(), msglog.toString()); } // finish order order = null; @@ -584,40 +589,40 @@ public class DistributionRun extends SvrProcess private int insertDetailsDistributionDemand() { // Handle NULL - String sql = "UPDATE M_DistributionRunLine SET MinQty = 0 WHERE MinQty IS NULL"; - int no = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("UPDATE M_DistributionRunLine SET MinQty = 0 WHERE MinQty IS NULL"); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); - sql = "UPDATE M_DistributionListLine SET MinQty = 0 WHERE MinQty IS NULL"; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE M_DistributionListLine SET MinQty = 0 WHERE MinQty IS NULL"); + no = DB.executeUpdate(sql.toString(), get_TrxName()); // Delete Old - sql = "DELETE FROM T_DistributionRunDetail WHERE M_DistributionRun_ID=" - + p_M_DistributionRun_ID; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("DELETE FROM T_DistributionRunDetail WHERE M_DistributionRun_ID=") + .append(p_M_DistributionRun_ID); + no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("insertDetails - deleted #" + no); // Insert New - sql = "INSERT INTO T_DistributionRunDetail " - + "(M_DistributionRun_ID, M_DistributionRunLine_ID, M_DistributionList_ID, M_DistributionListLine_ID," - + "AD_Client_ID,AD_Org_ID, IsActive, Created,CreatedBy, Updated,UpdatedBy," - + "C_BPartner_ID, C_BPartner_Location_ID, M_Product_ID," - + "Ratio, MinQty, Qty) " - +"SELECT MAX(rl.M_DistributionRun_ID), MAX(rl.M_DistributionRunLine_ID),MAX(ll.M_DistributionList_ID), MAX(ll.M_DistributionListLine_ID), " - +"MAX(rl.AD_Client_ID),MAX(rl.AD_Org_ID), MAX(rl.IsActive), MAX(rl.Created),MAX(rl.CreatedBy), MAX(rl.Updated),MAX(rl.UpdatedBy), " - +"MAX(ll.C_BPartner_ID), MAX(ll.C_BPartner_Location_ID), MAX(rl.M_Product_ID)," + sql = new StringBuilder("INSERT INTO T_DistributionRunDetail ") + .append("(M_DistributionRun_ID, M_DistributionRunLine_ID, M_DistributionList_ID, M_DistributionListLine_ID,") + .append("AD_Client_ID,AD_Org_ID, IsActive, Created,CreatedBy, Updated,UpdatedBy,") + .append("C_BPartner_ID, C_BPartner_Location_ID, M_Product_ID,") + .append("Ratio, MinQty, Qty) " ) + .append("SELECT MAX(rl.M_DistributionRun_ID), MAX(rl.M_DistributionRunLine_ID),MAX(ll.M_DistributionList_ID), MAX(ll.M_DistributionListLine_ID), ") + .append("MAX(rl.AD_Client_ID),MAX(rl.AD_Org_ID), MAX(rl.IsActive), MAX(rl.Created),MAX(rl.CreatedBy), MAX(rl.Updated),MAX(rl.UpdatedBy), ") + .append("MAX(ll.C_BPartner_ID), MAX(ll.C_BPartner_Location_ID), MAX(rl.M_Product_ID),") // Ration for this process is equal QtyToDeliver - +"COALESCE (SUM(ol.QtyOrdered-ol.QtyDelivered-TargetQty), 0) , " + .append("COALESCE (SUM(ol.QtyOrdered-ol.QtyDelivered-TargetQty), 0) , ") // Min Qty for this process is equal to TargetQty - +" 0 , 0 FROM M_DistributionRunLine rl " - +"INNER JOIN M_DistributionList l ON (rl.M_DistributionList_ID=l.M_DistributionList_ID) " - +"INNER JOIN M_DistributionListLine ll ON (rl.M_DistributionList_ID=ll.M_DistributionList_ID) " - +"INNER JOIN DD_Order o ON (o.C_BPartner_ID=ll.C_BPartner_ID AND o.DocStatus IN ('DR','IN')) " - +"INNER JOIN DD_OrderLine ol ON (ol.DD_Order_ID=o.DD_Order_ID AND ol.M_Product_ID=rl.M_Product_ID) " - +"INNER JOIN M_Locator loc ON (loc.M_Locator_ID=ol.M_Locator_ID AND loc.M_Warehouse_ID="+p_M_Warehouse_ID+") " - +"WHERE rl.M_DistributionRun_ID="+p_M_DistributionRun_ID+" AND rl.IsActive='Y' AND ll.IsActive='Y' AND ol.DatePromised <= "+DB.TO_DATE(p_DatePromised) - +" GROUP BY o.M_Shipper_ID , ll.C_BPartner_ID, ol.M_Product_ID"; + .append(" 0 , 0 FROM M_DistributionRunLine rl ") + .append("INNER JOIN M_DistributionList l ON (rl.M_DistributionList_ID=l.M_DistributionList_ID) ") + .append("INNER JOIN M_DistributionListLine ll ON (rl.M_DistributionList_ID=ll.M_DistributionList_ID) ") + .append("INNER JOIN DD_Order o ON (o.C_BPartner_ID=ll.C_BPartner_ID AND o.DocStatus IN ('DR','IN')) ") + .append("INNER JOIN DD_OrderLine ol ON (ol.DD_Order_ID=o.DD_Order_ID AND ol.M_Product_ID=rl.M_Product_ID) ") + .append("INNER JOIN M_Locator loc ON (loc.M_Locator_ID=ol.M_Locator_ID AND loc.M_Warehouse_ID=").append(p_M_Warehouse_ID).append(") ") + .append("WHERE rl.M_DistributionRun_ID=").append(p_M_DistributionRun_ID).append(" AND rl.IsActive='Y' AND ll.IsActive='Y' AND ol.DatePromised <= ").append(DB.TO_DATE(p_DatePromised)) + .append(" GROUP BY o.M_Shipper_ID , ll.C_BPartner_ID, ol.M_Product_ID"); //+ " BETWEEN "+ DB.TO_DATE(p_DatePromised) +" AND "+ DB.TO_DATE(p_DatePromised_To) - no = DB.executeUpdate(sql, get_TrxName()); + no = DB.executeUpdate(sql.toString(), get_TrxName()); List records = new Query(getCtx(), MDistributionRunDetail.Table_Name, @@ -647,16 +652,20 @@ public class DistributionRun extends SvrProcess private BigDecimal getQtyDemand(int M_Product_ID) { - StringBuffer sql = new StringBuffer("SELECT SUM (QtyOrdered-QtyDelivered-TargetQty) FROM DD_OrderLine ol INNER JOIN M_Locator l ON (l.M_Locator_ID=ol.M_Locator_ID) INNER JOIN DD_Order o ON (o.DD_Order_ID=ol.DD_Order_ID) "); - //sql.append(" WHERE o.DocStatus IN ('DR','IN') AND ol.DatePromised BETWEEN ? AND ? AND l.M_Warehouse_ID=? AND ol.M_Product_ID=? GROUP BY M_Product_ID, l.M_Warehouse_ID"); - sql.append(" WHERE o.DocStatus IN ('DR','IN') AND ol.DatePromised <= ? AND l.M_Warehouse_ID=? AND ol.M_Product_ID=? GROUP BY M_Product_ID, l.M_Warehouse_ID"); - - + String sql = "SELECT SUM (QtyOrdered-QtyDelivered-TargetQty) " + + "FROM DD_OrderLine ol " + + "INNER JOIN M_Locator l ON (l.M_Locator_ID=ol.M_Locator_ID) " + + "INNER JOIN DD_Order o ON (o.DD_Order_ID=ol.DD_Order_ID) " + + " WHERE o.DocStatus IN ('DR','IN') " + + "AND ol.DatePromised <= ? " + + "AND l.M_Warehouse_ID=? " + + "AND ol.M_Product_ID=? " + + "GROUP BY M_Product_ID, l.M_Warehouse_ID"; PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement (sql.toString(), get_TrxName()); + pstmt = DB.prepareStatement (sql, get_TrxName()); pstmt.setTimestamp(1, p_DatePromised); //pstmt.setTimestamp(2, p_DatePromised_To); pstmt.setInt(2, p_M_Warehouse_ID); @@ -692,37 +701,37 @@ public class DistributionRun extends SvrProcess private int insertDetailsDistribution() { // Handle NULL - String sql = "UPDATE M_DistributionRunLine SET MinQty = 0 WHERE MinQty IS NULL"; - int no = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("UPDATE M_DistributionRunLine SET MinQty = 0 WHERE MinQty IS NULL"); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); - sql = "UPDATE M_DistributionListLine SET MinQty = 0 WHERE MinQty IS NULL"; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE M_DistributionListLine SET MinQty = 0 WHERE MinQty IS NULL"); + no = DB.executeUpdate(sql.toString(), get_TrxName()); // Delete Old - sql = "DELETE FROM T_DistributionRunDetail WHERE M_DistributionRun_ID=" - + p_M_DistributionRun_ID; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("DELETE FROM T_DistributionRunDetail WHERE M_DistributionRun_ID=") + .append(p_M_DistributionRun_ID); + no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("insertDetails - deleted #" + no); // Insert New - sql = "INSERT INTO T_DistributionRunDetail " - + "(M_DistributionRun_ID, M_DistributionRunLine_ID, M_DistributionList_ID, M_DistributionListLine_ID," - + "AD_Client_ID,AD_Org_ID, IsActive, Created,CreatedBy, Updated,UpdatedBy," - + "C_BPartner_ID, C_BPartner_Location_ID, M_Product_ID," - + "Ratio, MinQty, Qty) " - +"SELECT rl.M_DistributionRun_ID, rl.M_DistributionRunLine_ID,ll.M_DistributionList_ID, ll.M_DistributionListLine_ID, " - +"rl.AD_Client_ID,rl.AD_Org_ID, rl.IsActive, rl.Created,rl.CreatedBy, rl.Updated,rl.UpdatedBy, " - +"ll.C_BPartner_ID, ll.C_BPartner_Location_ID, rl.M_Product_ID, 0 , " - +"ol.TargetQty AS MinQty , 0 FROM M_DistributionRunLine rl " - +"INNER JOIN M_DistributionList l ON (rl.M_DistributionList_ID=l.M_DistributionList_ID) " - +"INNER JOIN M_DistributionListLine ll ON (rl.M_DistributionList_ID=ll.M_DistributionList_ID) " - +"INNER JOIN DD_Order o ON (o.C_BPartner_ID=ll.C_BPartner_ID) " - +"INNER JOIN DD_OrderLine ol ON (ol.DD_Order_ID=o.DD_Order_ID AND ol.M_Product_ID=rl.M_Product_ID) AND ol.DatePromised" + sql = new StringBuilder("INSERT INTO T_DistributionRunDetail ") + .append("(M_DistributionRun_ID, M_DistributionRunLine_ID, M_DistributionList_ID, M_DistributionListLine_ID,") + .append("AD_Client_ID,AD_Org_ID, IsActive, Created,CreatedBy, Updated,UpdatedBy,") + .append("C_BPartner_ID, C_BPartner_Location_ID, M_Product_ID,") + .append("Ratio, MinQty, Qty) ") + .append("SELECT rl.M_DistributionRun_ID, rl.M_DistributionRunLine_ID,ll.M_DistributionList_ID, ll.M_DistributionListLine_ID, ") + .append("rl.AD_Client_ID,rl.AD_Org_ID, rl.IsActive, rl.Created,rl.CreatedBy, rl.Updated,rl.UpdatedBy, ") + .append("ll.C_BPartner_ID, ll.C_BPartner_Location_ID, rl.M_Product_ID, 0 , ") + .append("ol.TargetQty AS MinQty , 0 FROM M_DistributionRunLine rl ") + .append("INNER JOIN M_DistributionList l ON (rl.M_DistributionList_ID=l.M_DistributionList_ID) ") + .append("INNER JOIN M_DistributionListLine ll ON (rl.M_DistributionList_ID=ll.M_DistributionList_ID) ") + .append("INNER JOIN DD_Order o ON (o.C_BPartner_ID=ll.C_BPartner_ID) ") + .append("INNER JOIN DD_OrderLine ol ON (ol.DD_Order_ID=o.DD_Order_ID AND ol.M_Product_ID=rl.M_Product_ID) AND ol.DatePromised") //+ " BETWEEN " + DB.TO_DATE(p_DatePromised) +" AND "+ DB.TO_DATE(p_DatePromised_To) - + "<="+DB.TO_DATE(p_DatePromised) - +" INNER JOIN M_Locator loc ON (loc.M_Locator_ID=ol.M_Locator_ID AND loc.M_Warehouse_ID="+p_M_Warehouse_ID+") " - +" WHERE rl.M_DistributionRun_ID="+p_M_DistributionRun_ID+" AND l.RatioTotal<>0 AND rl.IsActive='Y' AND ll.IsActive='Y'"; - no = DB.executeUpdate(sql, get_TrxName()); + .append( "<=").append(DB.TO_DATE(p_DatePromised)) + .append(" INNER JOIN M_Locator loc ON (loc.M_Locator_ID=ol.M_Locator_ID AND loc.M_Warehouse_ID=").append(p_M_Warehouse_ID).append(") ") + .append(" WHERE rl.M_DistributionRun_ID=").append(p_M_DistributionRun_ID).append(" AND l.RatioTotal<>0 AND rl.IsActive='Y' AND ll.IsActive='Y'"); + no = DB.executeUpdate(sql.toString(), get_TrxName()); Query query = MTable.get(getCtx(), I_T_DistributionRunDetail.Table_ID). createQuery(MDistributionRunDetail.COLUMNNAME_M_DistributionRun_ID + "=?", get_TrxName()); @@ -772,9 +781,9 @@ public class DistributionRun extends SvrProcess { MDistributionRunDetail detail = m_details[i]; - StringBuffer sql = new StringBuffer("SELECT * FROM DD_OrderLine ol INNER JOIN DD_Order o ON (o.DD_Order_ID=ol.DD_Order_ID) INNER JOIN M_Locator l ON (l.M_Locator_ID=ol.M_Locator_ID) "); + String sql = "SELECT * FROM DD_OrderLine ol INNER JOIN DD_Order o ON (o.DD_Order_ID=ol.DD_Order_ID) INNER JOIN M_Locator l ON (l.M_Locator_ID=ol.M_Locator_ID) "; //sql.append(" WHERE o.DocStatus IN ('DR','IN') AND o.C_BPartner_ID = ? AND M_Product_ID=? AND l.M_Warehouse_ID=? AND ol.DatePromised BETWEEN ? AND ? "); - sql.append(" WHERE o.DocStatus IN ('DR','IN') AND o.C_BPartner_ID = ? AND M_Product_ID=? AND l.M_Warehouse_ID=? AND ol.DatePromised <=?"); + sql = sql + " WHERE o.DocStatus IN ('DR','IN') AND o.C_BPartner_ID = ? AND M_Product_ID=? AND l.M_Warehouse_ID=? AND ol.DatePromised <=?"; PreparedStatement pstmt = null; ResultSet rs = null; @@ -930,12 +939,12 @@ public class DistributionRun extends SvrProcess if(p_ConsolidateDocument) { - String whereClause = "DocStatus IN ('DR','IN') AND AD_Org_ID=" + bp.getAD_OrgBP_ID_Int() + " AND " + - MDDOrder.COLUMNNAME_C_BPartner_ID +"=? AND " + - MDDOrder.COLUMNNAME_M_Warehouse_ID +"=? AND " + - MDDOrder.COLUMNNAME_DatePromised +"<=? "; + StringBuilder whereClause = new StringBuilder("DocStatus IN ('DR','IN') AND AD_Org_ID=").append(bp.getAD_OrgBP_ID_Int()).append(" AND ") + .append(MDDOrder.COLUMNNAME_C_BPartner_ID).append("=? AND ") + .append(MDDOrder.COLUMNNAME_M_Warehouse_ID).append("=? AND ") + .append(MDDOrder.COLUMNNAME_DatePromised).append("<=? "); - order = new Query(getCtx(), MDDOrder.Table_Name, whereClause, get_TrxName()) + order = new Query(getCtx(), MDDOrder.Table_Name, whereClause.toString(), get_TrxName()) .setParameters(new Object[]{lastC_BPartner_ID, ws[0].getM_Warehouse_ID(), p_DatePromised}) .setOrderBy(MDDOrder.COLUMNNAME_DatePromised +" DESC") .first(); @@ -988,8 +997,8 @@ public class DistributionRun extends SvrProcess product = MProduct.get (getCtx(), detail.getM_Product_ID()); if (p_IsTest) { - addLog(0,null, detail.getActualAllocation(), - bp.getName() + " - " + product.getName()); + StringBuilder msglog = new StringBuilder(bp.getName()).append(" - ").append(product.getName()); + addLog(0,null, detail.getActualAllocation(), msglog.toString()); continue; } @@ -1017,7 +1026,9 @@ public class DistributionRun extends SvrProcess String Description =""; if (m_run.getName() != null) Description =Description.concat(m_run.getName()); - line.setDescription(Description + " " +Msg.translate(getCtx(), "Qty")+ " = " +QtyAllocation+" "); + StringBuilder msgline = new StringBuilder(Description).append(" ").append(Msg.translate(getCtx(), "Qty")) + .append(" = ").append(QtyAllocation).append(" "); + line.setDescription(msgline.toString()); //line.setConfirmedQty(QtyAllocation); line.saveEx(); } @@ -1032,7 +1043,8 @@ public class DistributionRun extends SvrProcess Description =""; if (m_run.getName() != null) Description =Description.concat(m_run.getName()); - line.setDescription(Description + " " +Msg.translate(getCtx(), "Qty")+ " = " +QtyAllocation+" "); + StringBuilder msgline = new StringBuilder(Description).append(" ").append(Msg.translate(getCtx(), "Qty")).append(" = ").append(QtyAllocation).append(" "); + line.setDescription(msgline.toString()); line.setQty(line.getQtyEntered().add(QtyAllocation)); //line.setConfirmedQty(line.getConfirmedQty().add( QtyAllocation)); line.saveEx(); @@ -1064,12 +1076,15 @@ public class DistributionRun extends SvrProcess String Description =""; if (m_run.getName() != null) Description =Description.concat(m_run.getName()); - line.setDescription(Description + " " +Msg.translate(getCtx(), "Qty")+ " = " +detail.getActualAllocation()+" "); + StringBuilder msgline = new StringBuilder(Description).append(" ").append(Msg.translate(getCtx(), "Qty")).append(" = ") + .append(detail.getActualAllocation()).append(" "); + line.setDescription(msgline.toString()); line.saveEx(); } - addLog(0,null, detail.getActualAllocation(), order.getDocumentNo() - + ": " + bp.getName() + " - " + product.getName()); + StringBuilder msglog = new StringBuilder(order.getDocumentNo()) + .append(": ").append(bp.getName()).append(" - ").append(product.getName()); + addLog(0,null, detail.getActualAllocation(), msglog.toString()); } // finish order order = null; diff --git a/org.adempiere.base.process/src/org/compiere/process/DunningPrint.java b/org.adempiere.base.process/src/org/compiere/process/DunningPrint.java index bc6e42bdc1..d801c80cc9 100644 --- a/org.adempiere.base.process/src/org/compiere/process/DunningPrint.java +++ b/org.adempiere.base.process/src/org/compiere/process/DunningPrint.java @@ -132,7 +132,8 @@ public class DunningPrint extends SvrProcess MBPartner bp = new MBPartner (getCtx(), entry.getC_BPartner_ID(), get_TrxName()); if (bp.get_ID() == 0) { - addLog (entry.get_ID(), null, null, "@NotFound@: @C_BPartner_ID@ " + entry.getC_BPartner_ID()); + StringBuilder msglog = new StringBuilder("@NotFound@: @C_BPartner_ID@ ").append(entry.getC_BPartner_ID()); + addLog (entry.get_ID(), null, null,msglog.toString() ); errors++; continue; } @@ -142,13 +143,15 @@ public class DunningPrint extends SvrProcess { if (to.get_ID() == 0) { - addLog (entry.get_ID(), null, null, "@NotFound@: @AD_User_ID@ - " + bp.getName()); + StringBuilder msglog = new StringBuilder("@NotFound@: @AD_User_ID@ - ").append(bp.getName()); + addLog (entry.get_ID(), null, null,msglog.toString()); errors++; continue; } else if (to.getEMail() == null || to.getEMail().length() == 0) { - addLog (entry.get_ID(), null, null, "@NotFound@: @EMail@ - " + to.getName()); + StringBuilder msglog = new StringBuilder("@NotFound@: @EMail@ - ").append(to.getName()); + addLog (entry.get_ID(), null, null, msglog.toString()); errors++; continue; } @@ -163,8 +166,9 @@ public class DunningPrint extends SvrProcess bp.getName(), MDunningRunEntry.Table_ID, entry.getC_DunningRunEntry_ID(), - entry.getC_BPartner_ID()); - info.setDescription(bp.getName() + ", Amt=" + entry.getAmt()); + entry.getC_BPartner_ID()); + StringBuilder msginfo = new StringBuilder(bp.getName()).append(", Amt=").append(entry.getAmt()); + info.setDescription(msginfo.toString()); ReportEngine re = null; if (format != null) re = new ReportEngine(getCtx(), format, query, info); @@ -174,8 +178,9 @@ public class DunningPrint extends SvrProcess EMail email = client.createEMail(to.getEMail(), null, null); if (!email.isValid()) { - addLog (entry.get_ID(), null, null, - "@RequestActionEMailError@ Invalid EMail: " + to); + StringBuilder msglog = new StringBuilder( + "@RequestActionEMailError@ Invalid EMail: ").append(to); + addLog (entry.get_ID(), null, null,msglog.toString() ); errors++; continue; } @@ -193,7 +198,8 @@ public class DunningPrint extends SvrProcess // if (re != null) { File attachment = re.getPDF(File.createTempFile("Dunning", ".pdf")); - log.fine(to + " - " + attachment); + StringBuilder msglog = new StringBuilder(to.toString()).append(" - ").append(attachment); + log.fine(msglog.toString()); email.addAttachment(attachment); } // @@ -202,15 +208,16 @@ public class DunningPrint extends SvrProcess um.saveEx(); if (msg.equals(EMail.SENT_OK)) { - addLog (entry.get_ID(), null, null, - bp.getName() + " @RequestActionEMailOK@"); + StringBuilder msglog = new StringBuilder( + bp.getName()).append(" @RequestActionEMailOK@"); + addLog (entry.get_ID(), null, null,msglog.toString()); count++; printed = true; } else { - addLog (entry.get_ID(), null, null, - bp.getName() + " @RequestActionEMailError@ " + msg); + StringBuilder msglog = new StringBuilder(bp.getName()).append(" @RequestActionEMailError@ ").append(msg); + addLog (entry.get_ID(), null, null,msglog.toString() ); errors++; } } @@ -233,8 +240,10 @@ public class DunningPrint extends SvrProcess run.setProcessed(true); run.saveEx(); } - if (p_EMailPDF) - return "@Sent@=" + count + " - @Errors@=" + errors; + if (p_EMailPDF){ + StringBuilder msgreturn = new StringBuilder("@Sent@=").append(count).append(" - @Errors@=").append(errors); + return msgreturn.toString(); + } return "@Printed@=" + count; } // doIt diff --git a/org.adempiere.base.process/src/org/compiere/process/DunningRunCreate.java b/org.adempiere.base.process/src/org/compiere/process/DunningRunCreate.java index 23874911ee..8635da3c13 100644 --- a/org.adempiere.base.process/src/org/compiere/process/DunningRunCreate.java +++ b/org.adempiere.base.process/src/org/compiere/process/DunningRunCreate.java @@ -169,7 +169,7 @@ public class DunningRunCreate extends SvrProcess sql.append(" AND i.AD_Org_ID=").append(p_AD_Org_ID); // log.info(sql); - StringBuilder sql2= new StringBuilder(); + String sql2= ""; // if sequentially we must check for other levels with smaller days for // which this invoice is not yet included! @@ -190,11 +190,11 @@ public class DunningRunCreate extends SvrProcess } } // ensure that we do only dunn what's not yet dunned, so we lookup the max of last Dunn Date which was processed - sql2.append("SELECT COUNT(*), COALESCE(DAYSBETWEEN(MAX(dr2.DunningDate), MAX(dr.DunningDate)),0)"); - sql2.append("FROM C_DunningRun dr2, C_DunningRun dr"); - sql2.append(" INNER JOIN C_DunningRunEntry dre ON (dr.C_DunningRun_ID=dre.C_DunningRun_ID)"); - sql2.append(" INNER JOIN C_DunningRunLine drl ON (dre.C_DunningRunEntry_ID=drl.C_DunningRunEntry_ID) "); - sql2.append("WHERE dr2.C_DunningRun_ID=? AND drl.C_Invoice_ID=?"); // ##1 ##2 + sql2 = "SELECT COUNT(*), COALESCE(DAYSBETWEEN(MAX(dr2.DunningDate), MAX(dr.DunningDate)),0)" + + "FROM C_DunningRun dr2, C_DunningRun dr" + + " INNER JOIN C_DunningRunEntry dre ON (dr.C_DunningRun_ID=dre.C_DunningRun_ID)" + + " INNER JOIN C_DunningRunLine drl ON (dre.C_DunningRunEntry_ID=drl.C_DunningRunEntry_ID) " + + "WHERE dr2.C_DunningRun_ID=? AND drl.C_Invoice_ID=?"; // ##1 ##2 BigDecimal DaysAfterDue = level.getDaysAfterDue(); int DaysBetweenDunning = level.getDaysBetweenDunning(); diff --git a/org.adempiere.base.process/src/org/compiere/process/EMailTest.java b/org.adempiere.base.process/src/org/compiere/process/EMailTest.java index 4c01a601b5..ea2c6b6612 100644 --- a/org.adempiere.base.process/src/org/compiere/process/EMailTest.java +++ b/org.adempiere.base.process/src/org/compiere/process/EMailTest.java @@ -55,7 +55,8 @@ public class EMailTest extends SvrProcess // Test Client Mail String clientTest = client.testEMail(); - addLog(0, null, null, client.getName() + ": " + clientTest); + StringBuilder msglog = new StringBuilder(client.getName()).append(": ").append(clientTest); + addLog(0, null, null, msglog.toString()); // Test Client DocumentDir if (!Ini.isClient()) @@ -75,7 +76,8 @@ public class EMailTest extends SvrProcess { MStore store = wstores[i]; String test = store.testEMail(); - addLog(0, null, null, store.getName() + ": " + test); + msglog = new StringBuilder(store.getName()).append(": ").append(test); + addLog(0, null, null, msglog.toString()); } return clientTest; From d9d27e699088bf1715e0ea4830ddf48b28edbfe3 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 25 Sep 2012 13:05:52 -0500 Subject: [PATCH 15/79] =?UTF-8?q?IDEMPIERE-308=20Performance:=20Replace=20?= =?UTF-8?q?with=20StringBuilder=20/=20Thanks=20to=20Richard=20Morales=20an?= =?UTF-8?q?d=20David=20Pe=C3=B1uela?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../compiere/install/LanguageMaintenance.java | 4 +- .../process/AD_PrintPaper_Default.java | 16 +- .../process/AcctSchemaDefaultCopy.java | 693 +++++++++--------- .../org/compiere/process/AllocationAuto.java | 46 +- .../org/compiere/process/AllocationReset.java | 16 +- .../org/compiere/process/AssetDelivery.java | 8 +- .../org/compiere/process/BOMFlagValidate.java | 46 +- .../process/BankStatementPayment.java | 12 +- .../compiere/process/ChangeLogProcess.java | 13 +- .../compiere/process/ColumnEncryption.java | 104 +-- .../src/org/compiere/process/ColumnSync.java | 8 +- .../org/compiere/process/CommissionCalc.java | 152 ++-- 12 files changed, 571 insertions(+), 547 deletions(-) diff --git a/org.adempiere.base.process/src/org/compiere/install/LanguageMaintenance.java b/org.adempiere.base.process/src/org/compiere/install/LanguageMaintenance.java index 2ae5313105..8880b2f6b9 100644 --- a/org.adempiere.base.process/src/org/compiere/install/LanguageMaintenance.java +++ b/org.adempiere.base.process/src/org/compiere/install/LanguageMaintenance.java @@ -108,8 +108,8 @@ public class LanguageMaintenance extends SvrProcess m_language.saveEx(); } } - - return "@Deleted@=" + deleteNo + " - @Inserted@=" + insertNo; + StringBuilder msgreturn = new StringBuilder("@Deleted@=").append(deleteNo).append(" - @Inserted@=").append(insertNo); + return msgreturn.toString(); } // doIt diff --git a/org.adempiere.base.process/src/org/compiere/process/AD_PrintPaper_Default.java b/org.adempiere.base.process/src/org/compiere/process/AD_PrintPaper_Default.java index 8021cb4b63..ae5cae8077 100644 --- a/org.adempiere.base.process/src/org/compiere/process/AD_PrintPaper_Default.java +++ b/org.adempiere.base.process/src/org/compiere/process/AD_PrintPaper_Default.java @@ -61,21 +61,21 @@ public class AD_PrintPaper_Default extends SvrProcess */ protected String doIt() throws Exception { - StringBuffer sql = new StringBuffer(""); + StringBuilder sql = new StringBuilder(); int cnt = 0; log.info("Set Print Format"); try { - sql.append("UPDATE AD_PrintFormat pf " - + "SET AD_PrintPaper_ID = " + p_Record_ID + " " - + "WHERE EXISTS (SELECT * FROM AD_PrintPaper pp " - + "WHERE pf.AD_PrintPaper_ID=pp.AD_PrintPaper_ID " - + "AND IsLandscape = (SELECT IsLandscape FROM AD_PrintPaper " - + "WHERE AD_PrintPaper_ID=" + p_Record_ID + "))"); + sql.append("UPDATE AD_PrintFormat pf ") + .append("SET AD_PrintPaper_ID = ").append(p_Record_ID).append(" ") + .append("WHERE EXISTS (SELECT * FROM AD_PrintPaper pp ") + .append("WHERE pf.AD_PrintPaper_ID=pp.AD_PrintPaper_ID ") + .append("AND IsLandscape = (SELECT IsLandscape FROM AD_PrintPaper ") + .append("WHERE AD_PrintPaper_ID=").append(p_Record_ID).append("))"); if (p_AD_Client_ID != -1) { - sql.append(" AND AD_Client_ID = " + p_AD_Client_ID); + sql.append(" AND AD_Client_ID = ").append(p_AD_Client_ID); } cnt = DB.executeUpdate(sql.toString(), get_TrxName()); log.info("Updated " + cnt + " columns"); diff --git a/org.adempiere.base.process/src/org/compiere/process/AcctSchemaDefaultCopy.java b/org.adempiere.base.process/src/org/compiere/process/AcctSchemaDefaultCopy.java index 49b0f8ed10..b24410a39c 100644 --- a/org.adempiere.base.process/src/org/compiere/process/AcctSchemaDefaultCopy.java +++ b/org.adempiere.base.process/src/org/compiere/process/AcctSchemaDefaultCopy.java @@ -76,7 +76,7 @@ public class AcctSchemaDefaultCopy extends SvrProcess if (acct == null || acct.get_ID() == 0) throw new AdempiereSystemError("Default Not Found - C_AcctSchema_ID=" + p_C_AcctSchema_ID); - String sql = null; + StringBuilder sql; int updated = 0; int created = 0; int updatedTotal = 0; @@ -85,88 +85,88 @@ public class AcctSchemaDefaultCopy extends SvrProcess // Update existing Product Category if (p_CopyOverwriteAcct) { - sql = "UPDATE M_Product_Category_Acct pa " - + "SET P_Revenue_Acct=" + acct.getP_Revenue_Acct() - + ", P_Expense_Acct=" + acct.getP_Expense_Acct() - + ", P_CostAdjustment_Acct=" + acct.getP_CostAdjustment_Acct() - + ", P_InventoryClearing_Acct=" + acct.getP_InventoryClearing_Acct() - + ", P_Asset_Acct=" + acct.getP_Asset_Acct() - + ", P_COGS_Acct=" + acct.getP_COGS_Acct() - + ", P_PurchasePriceVariance_Acct=" + acct.getP_PurchasePriceVariance_Acct() - + ", P_InvoicePriceVariance_Acct=" + acct.getP_InvoicePriceVariance_Acct() - + ", P_AverageCostVariance_Acct=" + acct.getP_AverageCostVariance_Acct() - + ", P_TradeDiscountRec_Acct=" + acct.getP_TradeDiscountRec_Acct() - + ", P_TradeDiscountGrant_Acct=" + acct.getP_TradeDiscountGrant_Acct() - + ", P_WIP_Acct=" + acct.getP_WIP_Acct() - + ", P_FloorStock_Acct=" + acct.getP_FloorStock_Acct() - + ", P_MethodChangeVariance_Acct=" + acct.getP_MethodChangeVariance_Acct() - + ", P_UsageVariance_Acct=" + acct.getP_UsageVariance_Acct() - + ", P_RateVariance_Acct=" + acct.getP_RateVariance_Acct() - + ", P_MixVariance_Acct=" + acct.getP_MixVariance_Acct() - + ", P_Labor_Acct=" + acct.getP_Labor_Acct() - + ", P_Burden_Acct=" + acct.getP_Burden_Acct() - + ", P_CostOfProduction_Acct=" + acct.getP_CostOfProduction_Acct() - + ", P_OutsideProcessing_Acct=" + acct.getP_OutsideProcessing_Acct() - + ", P_Overhead_Acct=" + acct.getP_Overhead_Acct() - + ", P_Scrap_Acct=" + acct.getP_Scrap_Acct() - + ", Updated=SysDate, UpdatedBy=0 " - + "WHERE pa.C_AcctSchema_ID=" + p_C_AcctSchema_ID - + " AND EXISTS (SELECT * FROM M_Product_Category p " - + "WHERE p.M_Product_Category_ID=pa.M_Product_Category_ID)"; - updated = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE M_Product_Category_Acct pa ") + .append("SET P_Revenue_Acct=").append(acct.getP_Revenue_Acct()) + .append(", P_Expense_Acct=").append(acct.getP_Expense_Acct()) + .append(", P_CostAdjustment_Acct=").append(acct.getP_CostAdjustment_Acct()) + .append(", P_InventoryClearing_Acct=").append(acct.getP_InventoryClearing_Acct()) + .append(", P_Asset_Acct=").append(acct.getP_Asset_Acct()) + .append(", P_COGS_Acct=").append(acct.getP_COGS_Acct()) + .append(", P_PurchasePriceVariance_Acct=").append(acct.getP_PurchasePriceVariance_Acct()) + .append(", P_InvoicePriceVariance_Acct=").append(acct.getP_InvoicePriceVariance_Acct()) + .append(", P_AverageCostVariance_Acct=").append(acct.getP_AverageCostVariance_Acct()) + .append(", P_TradeDiscountRec_Acct=").append(acct.getP_TradeDiscountRec_Acct()) + .append(", P_TradeDiscountGrant_Acct=").append(acct.getP_TradeDiscountGrant_Acct()) + .append(", P_WIP_Acct=").append(acct.getP_WIP_Acct()) + .append(", P_FloorStock_Acct=").append(acct.getP_FloorStock_Acct()) + .append(", P_MethodChangeVariance_Acct=").append(acct.getP_MethodChangeVariance_Acct()) + .append(", P_UsageVariance_Acct=").append(acct.getP_UsageVariance_Acct()) + .append(", P_RateVariance_Acct=").append(acct.getP_RateVariance_Acct()) + .append(", P_MixVariance_Acct=").append(acct.getP_MixVariance_Acct()) + .append(", P_Labor_Acct=").append(acct.getP_Labor_Acct()) + .append(", P_Burden_Acct=").append(acct.getP_Burden_Acct()) + .append(", P_CostOfProduction_Acct=").append(acct.getP_CostOfProduction_Acct()) + .append(", P_OutsideProcessing_Acct=").append(acct.getP_OutsideProcessing_Acct()) + .append(", P_Overhead_Acct=").append(acct.getP_Overhead_Acct()) + .append(", P_Scrap_Acct=").append(acct.getP_Scrap_Acct()) + .append(", Updated=SysDate, UpdatedBy=0 ") + .append("WHERE pa.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) + .append(" AND EXISTS (SELECT * FROM M_Product_Category p ") + .append("WHERE p.M_Product_Category_ID=pa.M_Product_Category_ID)"); + updated = DB.executeUpdate(sql.toString(), get_TrxName()); addLog(0, null, new BigDecimal(updated), "@Updated@ @M_Product_Category_ID@"); updatedTotal += updated; } // Insert new Product Category - sql = "INSERT INTO M_Product_Category_Acct " - + "(M_Product_Category_ID, C_AcctSchema_ID," - + " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy," - + " P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct," - + " P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_AverageCostVariance_Acct," - + " P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct," - + " P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct," - + " P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct) " - + " SELECT p.M_Product_Category_ID, acct.C_AcctSchema_ID," - + " p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0," - + " acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct," - + " acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_AverageCostVariance_Acct," - + " acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct," - + " acct.P_WIP_Acct,acct.P_FloorStock_Acct,acct.P_MethodChangeVariance_Acct,acct.P_UsageVariance_Acct,acct.P_RateVariance_Acct," - + " acct.P_MixVariance_Acct,acct.P_Labor_Acct,acct.P_Burden_Acct,acct.P_CostOfProduction_Acct,acct.P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct " - + "FROM M_Product_Category p" - + " INNER JOIN C_AcctSchema_Default acct ON (p.AD_Client_ID=acct.AD_Client_ID) " - + "WHERE acct.C_AcctSchema_ID=" + p_C_AcctSchema_ID - + " AND NOT EXISTS (SELECT * FROM M_Product_Category_Acct pa " - + "WHERE pa.M_Product_Category_ID=p.M_Product_Category_ID" - + " AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID)"; - created = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("INSERT INTO M_Product_Category_Acct ") + .append("(M_Product_Category_ID, C_AcctSchema_ID,") + .append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,") + .append(" P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct,") + .append(" P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_AverageCostVariance_Acct,") + .append(" P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct," ) + .append(" P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct,") + .append(" P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct) ") + .append(" SELECT p.M_Product_Category_ID, acct.C_AcctSchema_ID,") + .append(" p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,") + .append(" acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct,") + .append(" acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_AverageCostVariance_Acct,") + .append(" acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct,") + .append(" acct.P_WIP_Acct,acct.P_FloorStock_Acct,acct.P_MethodChangeVariance_Acct,acct.P_UsageVariance_Acct,acct.P_RateVariance_Acct,") + .append(" acct.P_MixVariance_Acct,acct.P_Labor_Acct,acct.P_Burden_Acct,acct.P_CostOfProduction_Acct,acct.P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct ") + .append("FROM M_Product_Category p") + .append(" INNER JOIN C_AcctSchema_Default acct ON (p.AD_Client_ID=acct.AD_Client_ID) ") + .append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) + .append(" AND NOT EXISTS (SELECT * FROM M_Product_Category_Acct pa ") + .append("WHERE pa.M_Product_Category_ID=p.M_Product_Category_ID") + .append(" AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID)"); + created = DB.executeUpdate(sql.toString(), get_TrxName()); addLog(0, null, new BigDecimal(created), "@Created@ @M_Product_Category_ID@"); createdTotal += created; if (!p_CopyOverwriteAcct) // Insert new Products { - sql = "INSERT INTO M_Product_Acct " - + "(M_Product_ID, C_AcctSchema_ID," - + " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy," - + " P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct," - + " P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_AverageCostVariance_Acct," - + " P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, " - + " P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct," - + " P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct) " - + "SELECT p.M_Product_ID, acct.C_AcctSchema_ID," - + " p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0," - + " acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct," - + " acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_AverageCostVariance_Acct," - + " acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct," - + " acct.P_WIP_Acct,acct.P_FloorStock_Acct,acct.P_MethodChangeVariance_Acct,acct.P_UsageVariance_Acct,acct.P_RateVariance_Acct," - + " acct.P_MixVariance_Acct,acct.P_Labor_Acct,acct.P_Burden_Acct,acct.P_CostOfProduction_Acct,acct.P_OutsideProcessing_Acct,acct.P_Overhead_Acct,acct.P_Scrap_Acct " - + "FROM M_Product p" - + " INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)" - + "WHERE acct.C_AcctSchema_ID=" + p_C_AcctSchema_ID - + " AND p.M_Product_Category_ID=acct.M_Product_Category_ID" - + " AND NOT EXISTS (SELECT * FROM M_Product_Acct pa " - + "WHERE pa.M_Product_ID=p.M_Product_ID" - + " AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID)"; - created = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("INSERT INTO M_Product_Acct ") + .append("(M_Product_ID, C_AcctSchema_ID,") + .append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,") + .append(" P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct,") + .append(" P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_AverageCostVariance_Acct,") + .append(" P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, ") + .append(" P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct,") + .append(" P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct) ") + .append("SELECT p.M_Product_ID, acct.C_AcctSchema_ID,") + .append(" p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,") + .append(" acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct,") + .append(" acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_AverageCostVariance_Acct,") + .append(" acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct,") + .append(" acct.P_WIP_Acct,acct.P_FloorStock_Acct,acct.P_MethodChangeVariance_Acct,acct.P_UsageVariance_Acct,acct.P_RateVariance_Acct,") + .append(" acct.P_MixVariance_Acct,acct.P_Labor_Acct,acct.P_Burden_Acct,acct.P_CostOfProduction_Acct,acct.P_OutsideProcessing_Acct,acct.P_Overhead_Acct,acct.P_Scrap_Acct ") + .append("FROM M_Product p") + .append(" INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)") + .append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) + .append(" AND p.M_Product_Category_ID=acct.M_Product_Category_ID") + .append(" AND NOT EXISTS (SELECT * FROM M_Product_Acct pa ") + .append("WHERE pa.M_Product_ID=p.M_Product_ID") + .append(" AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID)"); + created = DB.executeUpdate(sql.toString(), get_TrxName()); addLog(0, null, new BigDecimal(created), "@Created@ @M_Product_ID@"); createdTotal += created; } @@ -175,51 +175,51 @@ public class AcctSchemaDefaultCopy extends SvrProcess // Update Business Partner Group if (p_CopyOverwriteAcct) { - sql = "UPDATE C_BP_Group_Acct a " - + "SET C_Receivable_Acct=" + acct.getC_Receivable_Acct() - + ", C_Receivable_Services_Acct=" + acct.getC_Receivable_Services_Acct() - + ", C_Prepayment_Acct=" + acct.getC_Prepayment_Acct() - + ", V_Liability_Acct=" + acct.getV_Liability_Acct() - + ", V_Liability_Services_Acct=" + acct.getV_Liability_Services_Acct() - + ", V_Prepayment_Acct=" + acct.getV_Prepayment_Acct() - + ", PayDiscount_Exp_Acct=" + acct.getPayDiscount_Exp_Acct() - + ", PayDiscount_Rev_Acct=" + acct.getPayDiscount_Rev_Acct() - + ", WriteOff_Acct=" + acct.getWriteOff_Acct() - + ", NotInvoicedReceipts_Acct=" + acct.getNotInvoicedReceipts_Acct() - + ", UnEarnedRevenue_Acct=" + acct.getUnEarnedRevenue_Acct() - + ", NotInvoicedRevenue_Acct=" + acct.getNotInvoicedRevenue_Acct() - + ", NotInvoicedReceivables_Acct=" + acct.getNotInvoicedReceivables_Acct() - + ", Updated=SysDate, UpdatedBy=0 " - + "WHERE a.C_AcctSchema_ID=" + p_C_AcctSchema_ID - + " AND EXISTS (SELECT * FROM C_BP_Group_Acct x " - + "WHERE x.C_BP_Group_ID=a.C_BP_Group_ID)"; - updated = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE C_BP_Group_Acct a ") + .append("SET C_Receivable_Acct=").append(acct.getC_Receivable_Acct()) + .append(", C_Receivable_Services_Acct=").append(acct.getC_Receivable_Services_Acct()) + .append(", C_Prepayment_Acct=").append(acct.getC_Prepayment_Acct()) + .append(", V_Liability_Acct=").append(acct.getV_Liability_Acct()) + .append(", V_Liability_Services_Acct=").append(acct.getV_Liability_Services_Acct()) + .append(", V_Prepayment_Acct=").append(acct.getV_Prepayment_Acct()) + .append(", PayDiscount_Exp_Acct=").append(acct.getPayDiscount_Exp_Acct()) + .append(", PayDiscount_Rev_Acct=").append(acct.getPayDiscount_Rev_Acct()) + .append(", WriteOff_Acct=").append(acct.getWriteOff_Acct()) + .append(", NotInvoicedReceipts_Acct=").append(acct.getNotInvoicedReceipts_Acct()) + .append(", UnEarnedRevenue_Acct=").append(acct.getUnEarnedRevenue_Acct()) + .append(", NotInvoicedRevenue_Acct=").append(acct.getNotInvoicedRevenue_Acct()) + .append(", NotInvoicedReceivables_Acct=").append(acct.getNotInvoicedReceivables_Acct()) + .append(", Updated=SysDate, UpdatedBy=0 ") + .append("WHERE a.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) + .append(" AND EXISTS (SELECT * FROM C_BP_Group_Acct x ") + .append("WHERE x.C_BP_Group_ID=a.C_BP_Group_ID)"); + updated = DB.executeUpdate(sql.toString(), get_TrxName()); addLog(0, null, new BigDecimal(updated), "@Updated@ @C_BP_Group_ID@"); updatedTotal += updated; } // Insert Business Partner Group - sql = "INSERT INTO C_BP_Group_Acct " - + "(C_BP_Group_ID, C_AcctSchema_ID," - + " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy," - + " C_Receivable_Acct, C_Receivable_Services_Acct, C_PrePayment_Acct," - + " V_Liability_Acct, V_Liability_Services_Acct, V_PrePayment_Acct," - + " PayDiscount_Exp_Acct, PayDiscount_Rev_Acct, WriteOff_Acct," - + " NotInvoicedReceipts_Acct, UnEarnedRevenue_Acct," - + " NotInvoicedRevenue_Acct, NotInvoicedReceivables_Acct) " - + "SELECT x.C_BP_Group_ID, acct.C_AcctSchema_ID," - + " x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0," - + " acct.C_Receivable_Acct, acct.C_Receivable_Services_Acct, acct.C_PrePayment_Acct," - + " acct.V_Liability_Acct, acct.V_Liability_Services_Acct, acct.V_PrePayment_Acct," - + " acct.PayDiscount_Exp_Acct, acct.PayDiscount_Rev_Acct, acct.WriteOff_Acct," - + " acct.NotInvoicedReceipts_Acct, acct.UnEarnedRevenue_Acct," - + " acct.NotInvoicedRevenue_Acct, acct.NotInvoicedReceivables_Acct " - + "FROM C_BP_Group x" - + " INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) " - + "WHERE acct.C_AcctSchema_ID=" + p_C_AcctSchema_ID - + " AND NOT EXISTS (SELECT * FROM C_BP_Group_Acct a " - + "WHERE a.C_BP_Group_ID=x.C_BP_Group_ID" - + " AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)"; - created = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("INSERT INTO C_BP_Group_Acct ") + .append("(C_BP_Group_ID, C_AcctSchema_ID,") + .append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,") + .append(" C_Receivable_Acct, C_Receivable_Services_Acct, C_PrePayment_Acct,") + .append(" V_Liability_Acct, V_Liability_Services_Acct, V_PrePayment_Acct,") + .append(" PayDiscount_Exp_Acct, PayDiscount_Rev_Acct, WriteOff_Acct,") + .append(" NotInvoicedReceipts_Acct, UnEarnedRevenue_Acct,") + .append(" NotInvoicedRevenue_Acct, NotInvoicedReceivables_Acct) ") + .append("SELECT x.C_BP_Group_ID, acct.C_AcctSchema_ID,") + .append(" x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,") + .append(" acct.C_Receivable_Acct, acct.C_Receivable_Services_Acct, acct.C_PrePayment_Acct,") + .append(" acct.V_Liability_Acct, acct.V_Liability_Services_Acct, acct.V_PrePayment_Acct,") + .append(" acct.PayDiscount_Exp_Acct, acct.PayDiscount_Rev_Acct, acct.WriteOff_Acct,") + .append(" acct.NotInvoicedReceipts_Acct, acct.UnEarnedRevenue_Acct,") + .append(" acct.NotInvoicedRevenue_Acct, acct.NotInvoicedReceivables_Acct ") + .append("FROM C_BP_Group x") + .append(" INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) ") + .append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) + .append(" AND NOT EXISTS (SELECT * FROM C_BP_Group_Acct a ") + .append("WHERE a.C_BP_Group_ID=x.C_BP_Group_ID") + .append(" AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)"); + created = DB.executeUpdate(sql.toString(), get_TrxName()); addLog(0, null, new BigDecimal(created), "@Created@ @C_BP_Group_ID@"); createdTotal += created; @@ -227,69 +227,69 @@ public class AcctSchemaDefaultCopy extends SvrProcess // Update Business Partner - Employee if (p_CopyOverwriteAcct) { - sql = "UPDATE C_BP_Employee_Acct a " - + "SET E_Expense_Acct=" + acct.getE_Expense_Acct() - + ", E_Prepayment_Acct=" + acct.getE_Prepayment_Acct() - + ", Updated=SysDate, UpdatedBy=0 " - + "WHERE a.C_AcctSchema_ID=" + p_C_AcctSchema_ID - + " AND EXISTS (SELECT * FROM C_BP_Employee_Acct x " - + "WHERE x.C_BPartner_ID=a.C_BPartner_ID)"; - updated = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE C_BP_Employee_Acct a ") + .append("SET E_Expense_Acct=").append(acct.getE_Expense_Acct()) + .append(", E_Prepayment_Acct=").append(acct.getE_Prepayment_Acct()) + .append(", Updated=SysDate, UpdatedBy=0 ") + .append("WHERE a.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) + .append(" AND EXISTS (SELECT * FROM C_BP_Employee_Acct x ") + .append("WHERE x.C_BPartner_ID=a.C_BPartner_ID)"); + updated = DB.executeUpdate(sql.toString(), get_TrxName()); addLog(0, null, new BigDecimal(updated), "@Updated@ @C_BPartner_ID@ @IsEmployee@"); updatedTotal += updated; } // Insert new Business Partner - Employee - sql = "INSERT INTO C_BP_Employee_Acct " - + "(C_BPartner_ID, C_AcctSchema_ID," - + " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy," - + " E_Expense_Acct, E_Prepayment_Acct) " - + "SELECT x.C_BPartner_ID, acct.C_AcctSchema_ID," - + " x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0," - + " acct.E_Expense_Acct, acct.E_Prepayment_Acct " - + "FROM C_BPartner x" - + " INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) " - + "WHERE acct.C_AcctSchema_ID=" + p_C_AcctSchema_ID - + " AND NOT EXISTS (SELECT * FROM C_BP_Employee_Acct a " - + "WHERE a.C_BPartner_ID=x.C_BPartner_ID" - + " AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)"; - created = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("INSERT INTO C_BP_Employee_Acct ") + .append("(C_BPartner_ID, C_AcctSchema_ID,") + .append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,") + .append(" E_Expense_Acct, E_Prepayment_Acct) ") + .append("SELECT x.C_BPartner_ID, acct.C_AcctSchema_ID,") + .append(" x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,") + .append(" acct.E_Expense_Acct, acct.E_Prepayment_Acct ") + .append("FROM C_BPartner x") + .append(" INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) ") + .append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) + .append(" AND NOT EXISTS (SELECT * FROM C_BP_Employee_Acct a ") + .append("WHERE a.C_BPartner_ID=x.C_BPartner_ID") + .append(" AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)"); + created = DB.executeUpdate(sql.toString(), get_TrxName()); addLog(0, null, new BigDecimal(created), "@Created@ @C_BPartner_ID@ @IsEmployee@"); createdTotal += created; // if (!p_CopyOverwriteAcct) { - sql = "INSERT INTO C_BP_Customer_Acct " - + "(C_BPartner_ID, C_AcctSchema_ID," - + " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy," - + " C_Receivable_Acct, C_Receivable_Services_Acct, C_PrePayment_Acct) " - + "SELECT p.C_BPartner_ID, acct.C_AcctSchema_ID," - + " p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0," - + " acct.C_Receivable_Acct, acct.C_Receivable_Services_Acct, acct.C_PrePayment_Acct " - + "FROM C_BPartner p" - + " INNER JOIN C_BP_Group_Acct acct ON (acct.C_BP_Group_ID=p.C_BP_Group_ID)" - + "WHERE acct.C_AcctSchema_ID=" + p_C_AcctSchema_ID // # - + " AND p.C_BP_Group_ID=acct.C_BP_Group_ID" - + " AND NOT EXISTS (SELECT * FROM C_BP_Customer_Acct ca " - + "WHERE ca.C_BPartner_ID=p.C_BPartner_ID" - + " AND ca.C_AcctSchema_ID=acct.C_AcctSchema_ID)"; - created = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("INSERT INTO C_BP_Customer_Acct ") + .append("(C_BPartner_ID, C_AcctSchema_ID,") + .append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,") + .append(" C_Receivable_Acct, C_Receivable_Services_Acct, C_PrePayment_Acct) ") + .append("SELECT p.C_BPartner_ID, acct.C_AcctSchema_ID,") + .append(" p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,") + .append(" acct.C_Receivable_Acct, acct.C_Receivable_Services_Acct, acct.C_PrePayment_Acct ") + .append("FROM C_BPartner p") + .append(" INNER JOIN C_BP_Group_Acct acct ON (acct.C_BP_Group_ID=p.C_BP_Group_ID)") + .append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) // # + .append(" AND p.C_BP_Group_ID=acct.C_BP_Group_ID") + .append(" AND NOT EXISTS (SELECT * FROM C_BP_Customer_Acct ca ") + .append("WHERE ca.C_BPartner_ID=p.C_BPartner_ID") + .append(" AND ca.C_AcctSchema_ID=acct.C_AcctSchema_ID)"); + created = DB.executeUpdate(sql.toString(), get_TrxName()); addLog(0, null, new BigDecimal(created), "@Created@ @C_BPartner_ID@ @IsCustomer@"); createdTotal += created; // - sql = "INSERT INTO C_BP_Vendor_Acct " - + "(C_BPartner_ID, C_AcctSchema_ID," - + " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy," - + " V_Liability_Acct, V_Liability_Services_Acct, V_PrePayment_Acct) " - + "SELECT p.C_BPartner_ID, acct.C_AcctSchema_ID," - + " p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0," - + " acct.V_Liability_Acct, acct.V_Liability_Services_Acct, acct.V_PrePayment_Acct " - + "FROM C_BPartner p" - + " INNER JOIN C_BP_Group_Acct acct ON (acct.C_BP_Group_ID=p.C_BP_Group_ID)" - + "WHERE acct.C_AcctSchema_ID=" + p_C_AcctSchema_ID // # - + " AND p.C_BP_Group_ID=acct.C_BP_Group_ID" - + " AND NOT EXISTS (SELECT * FROM C_BP_Vendor_Acct va " - + "WHERE va.C_BPartner_ID=p.C_BPartner_ID AND va.C_AcctSchema_ID=acct.C_AcctSchema_ID)"; - created = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("INSERT INTO C_BP_Vendor_Acct ") + .append("(C_BPartner_ID, C_AcctSchema_ID,") + .append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,") + .append(" V_Liability_Acct, V_Liability_Services_Acct, V_PrePayment_Acct) ") + .append("SELECT p.C_BPartner_ID, acct.C_AcctSchema_ID,") + .append(" p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,") + .append(" acct.V_Liability_Acct, acct.V_Liability_Services_Acct, acct.V_PrePayment_Acct ") + .append("FROM C_BPartner p") + .append(" INNER JOIN C_BP_Group_Acct acct ON (acct.C_BP_Group_ID=p.C_BP_Group_ID)") + .append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) // # + .append(" AND p.C_BP_Group_ID=acct.C_BP_Group_ID") + .append(" AND NOT EXISTS (SELECT * FROM C_BP_Vendor_Acct va ") + .append("WHERE va.C_BPartner_ID=p.C_BPartner_ID AND va.C_AcctSchema_ID=acct.C_AcctSchema_ID)"); + created = DB.executeUpdate(sql.toString(), get_TrxName()); addLog(0, null, new BigDecimal(created), "@Created@ @C_BPartner_ID@ @IsVendor@"); createdTotal += created; } @@ -297,34 +297,34 @@ public class AcctSchemaDefaultCopy extends SvrProcess // Update Warehouse if (p_CopyOverwriteAcct) { - sql = "UPDATE M_Warehouse_Acct a " - + "SET W_Inventory_Acct=" + acct.getW_Inventory_Acct() - + ", W_Differences_Acct=" + acct.getW_Differences_Acct() - + ", W_Revaluation_Acct=" + acct.getW_Revaluation_Acct() - + ", W_InvActualAdjust_Acct=" + acct.getW_InvActualAdjust_Acct() - + ", Updated=SysDate, UpdatedBy=0 " - + "WHERE a.C_AcctSchema_ID=" + p_C_AcctSchema_ID - + " AND EXISTS (SELECT * FROM M_Warehouse_Acct x " - + "WHERE x.M_Warehouse_ID=a.M_Warehouse_ID)"; - updated = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE M_Warehouse_Acct a ") + .append("SET W_Inventory_Acct=").append(acct.getW_Inventory_Acct()) + .append(", W_Differences_Acct=").append(acct.getW_Differences_Acct()) + .append(", W_Revaluation_Acct=").append(acct.getW_Revaluation_Acct()) + .append(", W_InvActualAdjust_Acct=").append(acct.getW_InvActualAdjust_Acct()) + .append(", Updated=SysDate, UpdatedBy=0 ") + .append("WHERE a.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) + .append(" AND EXISTS (SELECT * FROM M_Warehouse_Acct x ") + .append("WHERE x.M_Warehouse_ID=a.M_Warehouse_ID)"); + updated = DB.executeUpdate(sql.toString(), get_TrxName()); addLog(0, null, new BigDecimal(updated), "@Updated@ @M_Warehouse_ID@"); updatedTotal += updated; } // Insert new Warehouse - sql = "INSERT INTO M_Warehouse_Acct " - + "(M_Warehouse_ID, C_AcctSchema_ID," - + " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy," - + " W_Inventory_Acct, W_Differences_Acct, W_Revaluation_Acct, W_InvActualAdjust_Acct) " - + "SELECT x.M_Warehouse_ID, acct.C_AcctSchema_ID," - + " x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0," - + " acct.W_Inventory_Acct, acct.W_Differences_Acct, acct.W_Revaluation_Acct, acct.W_InvActualAdjust_Acct " - + "FROM M_Warehouse x" - + " INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) " - + "WHERE acct.C_AcctSchema_ID=" + p_C_AcctSchema_ID - + " AND NOT EXISTS (SELECT * FROM M_Warehouse_Acct a " - + "WHERE a.M_Warehouse_ID=x.M_Warehouse_ID" - + " AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)"; - created = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("INSERT INTO M_Warehouse_Acct ") + .append("(M_Warehouse_ID, C_AcctSchema_ID,") + .append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,") + .append(" W_Inventory_Acct, W_Differences_Acct, W_Revaluation_Acct, W_InvActualAdjust_Acct) ") + .append("SELECT x.M_Warehouse_ID, acct.C_AcctSchema_ID,") + .append(" x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,") + .append(" acct.W_Inventory_Acct, acct.W_Differences_Acct, acct.W_Revaluation_Acct, acct.W_InvActualAdjust_Acct ") + .append("FROM M_Warehouse x") + .append(" INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) ") + .append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) + .append(" AND NOT EXISTS (SELECT * FROM M_Warehouse_Acct a ") + .append("WHERE a.M_Warehouse_ID=x.M_Warehouse_ID") + .append(" AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)"); + created = DB.executeUpdate(sql.toString(), get_TrxName()); addLog(0, null, new BigDecimal(created), "@Created@ @M_Warehouse_ID@"); createdTotal += created; @@ -332,32 +332,32 @@ public class AcctSchemaDefaultCopy extends SvrProcess // Update Project if (p_CopyOverwriteAcct) { - sql = "UPDATE C_Project_Acct a " - + "SET PJ_Asset_Acct=" + acct.getPJ_Asset_Acct() - + ", PJ_WIP_Acct=" + acct.getPJ_Asset_Acct() - + ", Updated=SysDate, UpdatedBy=0 " - + "WHERE a.C_AcctSchema_ID=" + p_C_AcctSchema_ID - + " AND EXISTS (SELECT * FROM C_Project_Acct x " - + "WHERE x.C_Project_ID=a.C_Project_ID)"; - updated = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE C_Project_Acct a ") + .append("SET PJ_Asset_Acct=").append(acct.getPJ_Asset_Acct()) + .append(", PJ_WIP_Acct=").append(acct.getPJ_Asset_Acct()) + .append(", Updated=SysDate, UpdatedBy=0 ") + .append("WHERE a.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) + .append(" AND EXISTS (SELECT * FROM C_Project_Acct x ") + .append("WHERE x.C_Project_ID=a.C_Project_ID)"); + updated = DB.executeUpdate(sql.toString(), get_TrxName()); addLog(0, null, new BigDecimal(updated), "@Updated@ @C_Project_ID@"); updatedTotal += updated; } // Insert new Projects - sql = "INSERT INTO C_Project_Acct " - + "(C_Project_ID, C_AcctSchema_ID," - + " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy," - + " PJ_Asset_Acct, PJ_WIP_Acct) " - + "SELECT x.C_Project_ID, acct.C_AcctSchema_ID," - + " x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0," - + " acct.PJ_Asset_Acct, acct.PJ_WIP_Acct " - + "FROM C_Project x" - + " INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) " - + "WHERE acct.C_AcctSchema_ID=" + p_C_AcctSchema_ID - + " AND NOT EXISTS (SELECT * FROM C_Project_Acct a " - + "WHERE a.C_Project_ID=x.C_Project_ID" - + " AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)"; - created = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("INSERT INTO C_Project_Acct ") + .append("(C_Project_ID, C_AcctSchema_ID,") + .append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,") + .append(" PJ_Asset_Acct, PJ_WIP_Acct) ") + .append("SELECT x.C_Project_ID, acct.C_AcctSchema_ID,") + .append(" x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,") + .append(" acct.PJ_Asset_Acct, acct.PJ_WIP_Acct ") + .append("FROM C_Project x") + .append(" INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) ") + .append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) + .append(" AND NOT EXISTS (SELECT * FROM C_Project_Acct a ") + .append("WHERE a.C_Project_ID=x.C_Project_ID") + .append(" AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)"); + created = DB.executeUpdate(sql.toString(), get_TrxName()); addLog(0, null, new BigDecimal(created), "@Created@ @C_Project_ID@"); createdTotal += created; @@ -365,35 +365,35 @@ public class AcctSchemaDefaultCopy extends SvrProcess // Update Tax if (p_CopyOverwriteAcct) { - sql = "UPDATE C_Tax_Acct a " - + "SET T_Due_Acct=" + acct.getT_Due_Acct() - + ", T_Liability_Acct=" + acct.getT_Liability_Acct() - + ", T_Credit_Acct=" + acct.getT_Credit_Acct() - + ", T_Receivables_Acct=" + acct.getT_Receivables_Acct() - + ", T_Expense_Acct=" + acct.getT_Expense_Acct() - + ", Updated=SysDate, UpdatedBy=0 " - + "WHERE a.C_AcctSchema_ID=" + p_C_AcctSchema_ID - + " AND EXISTS (SELECT * FROM C_Tax_Acct x " - + "WHERE x.C_Tax_ID=a.C_Tax_ID)"; - updated = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE C_Tax_Acct a ") + .append("SET T_Due_Acct=").append(acct.getT_Due_Acct()) + .append(", T_Liability_Acct=").append(acct.getT_Liability_Acct()) + .append(", T_Credit_Acct=").append(acct.getT_Credit_Acct()) + .append(", T_Receivables_Acct=").append(acct.getT_Receivables_Acct()) + .append(", T_Expense_Acct=").append(acct.getT_Expense_Acct()) + .append(", Updated=SysDate, UpdatedBy=0 ") + .append("WHERE a.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) + .append(" AND EXISTS (SELECT * FROM C_Tax_Acct x ") + .append("WHERE x.C_Tax_ID=a.C_Tax_ID)"); + updated = DB.executeUpdate(sql.toString(), get_TrxName()); addLog(0, null, new BigDecimal(updated), "@Updated@ @C_Tax_ID@"); updatedTotal += updated; } // Insert new Tax - sql = "INSERT INTO C_Tax_Acct " - + "(C_Tax_ID, C_AcctSchema_ID," - + " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy," - + " T_Due_Acct, T_Liability_Acct, T_Credit_Acct, T_Receivables_Acct, T_Expense_Acct) " - + "SELECT x.C_Tax_ID, acct.C_AcctSchema_ID," - + " x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0," - + " acct.T_Due_Acct, acct.T_Liability_Acct, acct.T_Credit_Acct, acct.T_Receivables_Acct, acct.T_Expense_Acct " - + "FROM C_Tax x" - + " INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) " - + "WHERE acct.C_AcctSchema_ID=" + p_C_AcctSchema_ID - + " AND NOT EXISTS (SELECT * FROM C_Tax_Acct a " - + "WHERE a.C_Tax_ID=x.C_Tax_ID" - + " AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)"; - created = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("INSERT INTO C_Tax_Acct ") + .append("(C_Tax_ID, C_AcctSchema_ID,") + .append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,") + .append(" T_Due_Acct, T_Liability_Acct, T_Credit_Acct, T_Receivables_Acct, T_Expense_Acct) ") + .append("SELECT x.C_Tax_ID, acct.C_AcctSchema_ID,") + .append(" x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,") + .append(" acct.T_Due_Acct, acct.T_Liability_Acct, acct.T_Credit_Acct, acct.T_Receivables_Acct, acct.T_Expense_Acct ") + .append("FROM C_Tax x") + .append(" INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) ") + .append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) + .append(" AND NOT EXISTS (SELECT * FROM C_Tax_Acct a ") + .append("WHERE a.C_Tax_ID=x.C_Tax_ID") + .append(" AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)"); + created = DB.executeUpdate(sql.toString(), get_TrxName()); addLog(0, null, new BigDecimal(created), "@Created@ @C_Tax_ID@"); createdTotal += created; @@ -401,48 +401,48 @@ public class AcctSchemaDefaultCopy extends SvrProcess // Update BankAccount if (p_CopyOverwriteAcct) { - sql = "UPDATE C_BankAccount_Acct a " - + "SET B_InTransit_Acct=" + acct.getB_InTransit_Acct() - + ", B_Asset_Acct=" + acct.getB_Asset_Acct() - + ", B_Expense_Acct=" + acct.getB_Expense_Acct() - + ", B_InterestRev_Acct=" + acct.getB_InterestRev_Acct() - + ", B_InterestExp_Acct=" + acct.getB_InterestExp_Acct() - + ", B_Unidentified_Acct=" + acct.getB_Unidentified_Acct() - + ", B_UnallocatedCash_Acct=" + acct.getB_UnallocatedCash_Acct() - + ", B_PaymentSelect_Acct=" + acct.getB_PaymentSelect_Acct() - + ", B_SettlementGain_Acct=" + acct.getB_SettlementGain_Acct() - + ", B_SettlementLoss_Acct=" + acct.getB_SettlementLoss_Acct() - + ", B_RevaluationGain_Acct=" + acct.getB_RevaluationGain_Acct() - + ", B_RevaluationLoss_Acct=" + acct.getB_RevaluationLoss_Acct() - + ", Updated=SysDate, UpdatedBy=0 " - + "WHERE a.C_AcctSchema_ID=" + p_C_AcctSchema_ID - + " AND EXISTS (SELECT * FROM C_BankAccount_Acct x " - + "WHERE x.C_BankAccount_ID=a.C_BankAccount_ID)"; - updated = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE C_BankAccount_Acct a ") + .append("SET B_InTransit_Acct=").append(acct.getB_InTransit_Acct()) + .append(", B_Asset_Acct=").append(acct.getB_Asset_Acct()) + .append(", B_Expense_Acct=").append(acct.getB_Expense_Acct()) + .append(", B_InterestRev_Acct=").append(acct.getB_InterestRev_Acct()) + .append(", B_InterestExp_Acct=").append(acct.getB_InterestExp_Acct()) + .append(", B_Unidentified_Acct=").append(acct.getB_Unidentified_Acct()) + .append(", B_UnallocatedCash_Acct=").append(acct.getB_UnallocatedCash_Acct()) + .append(", B_PaymentSelect_Acct=").append(acct.getB_PaymentSelect_Acct()) + .append(", B_SettlementGain_Acct=").append(acct.getB_SettlementGain_Acct()) + .append(", B_SettlementLoss_Acct=").append(acct.getB_SettlementLoss_Acct()) + .append(", B_RevaluationGain_Acct=").append(acct.getB_RevaluationGain_Acct()) + .append(", B_RevaluationLoss_Acct=").append(acct.getB_RevaluationLoss_Acct()) + .append(", Updated=SysDate, UpdatedBy=0 ") + .append("WHERE a.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) + .append(" AND EXISTS (SELECT * FROM C_BankAccount_Acct x ") + .append("WHERE x.C_BankAccount_ID=a.C_BankAccount_ID)"); + updated = DB.executeUpdate(sql.toString(), get_TrxName()); addLog(0, null, new BigDecimal(updated), "@Updated@ @C_BankAccount_ID@"); updatedTotal += updated; } // Insert new BankAccount - sql = "INSERT INTO C_BankAccount_Acct " - + "(C_BankAccount_ID, C_AcctSchema_ID," - + " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy," - + " B_InTransit_Acct, B_Asset_Acct, B_Expense_Acct, B_InterestRev_Acct, B_InterestExp_Acct," - + " B_Unidentified_Acct, B_UnallocatedCash_Acct, B_PaymentSelect_Acct," - + " B_SettlementGain_Acct, B_SettlementLoss_Acct," - + " B_RevaluationGain_Acct, B_RevaluationLoss_Acct) " - + "SELECT x.C_BankAccount_ID, acct.C_AcctSchema_ID," - + " x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0," - + " acct.B_InTransit_Acct, acct.B_Asset_Acct, acct.B_Expense_Acct, acct.B_InterestRev_Acct, acct.B_InterestExp_Acct," - + " acct.B_Unidentified_Acct, acct.B_UnallocatedCash_Acct, acct.B_PaymentSelect_Acct," - + " acct.B_SettlementGain_Acct, acct.B_SettlementLoss_Acct," - + " acct.B_RevaluationGain_Acct, acct.B_RevaluationLoss_Acct " - + "FROM C_BankAccount x" - + " INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) " - + "WHERE acct.C_AcctSchema_ID=" + p_C_AcctSchema_ID - + " AND NOT EXISTS (SELECT * FROM C_BankAccount_Acct a " - + "WHERE a.C_BankAccount_ID=x.C_BankAccount_ID" - + " AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)"; - created = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("INSERT INTO C_BankAccount_Acct ") + .append("(C_BankAccount_ID, C_AcctSchema_ID,") + .append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,") + .append(" B_InTransit_Acct, B_Asset_Acct, B_Expense_Acct, B_InterestRev_Acct, B_InterestExp_Acct,") + .append(" B_Unidentified_Acct, B_UnallocatedCash_Acct, B_PaymentSelect_Acct,") + .append(" B_SettlementGain_Acct, B_SettlementLoss_Acct,") + .append(" B_RevaluationGain_Acct, B_RevaluationLoss_Acct) ") + .append("SELECT x.C_BankAccount_ID, acct.C_AcctSchema_ID,") + .append(" x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,") + .append(" acct.B_InTransit_Acct, acct.B_Asset_Acct, acct.B_Expense_Acct, acct.B_InterestRev_Acct, acct.B_InterestExp_Acct,") + .append(" acct.B_Unidentified_Acct, acct.B_UnallocatedCash_Acct, acct.B_PaymentSelect_Acct,") + .append(" acct.B_SettlementGain_Acct, acct.B_SettlementLoss_Acct,") + .append(" acct.B_RevaluationGain_Acct, acct.B_RevaluationLoss_Acct ") + .append("FROM C_BankAccount x") + .append(" INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) ") + .append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) + .append(" AND NOT EXISTS (SELECT * FROM C_BankAccount_Acct a ") + .append("WHERE a.C_BankAccount_ID=x.C_BankAccount_ID") + .append(" AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)"); + created = DB.executeUpdate(sql.toString(), get_TrxName()); addLog(0, null, new BigDecimal(created), "@Created@ @C_BankAccount_ID@"); createdTotal += created; @@ -450,31 +450,31 @@ public class AcctSchemaDefaultCopy extends SvrProcess // Update Withholding if (p_CopyOverwriteAcct) { - sql = "UPDATE C_Withholding_Acct a " - + "SET Withholding_Acct=" + acct.getWithholding_Acct() - + ", Updated=SysDate, UpdatedBy=0 " - + "WHERE a.C_AcctSchema_ID=" + p_C_AcctSchema_ID - + " AND EXISTS (SELECT * FROM C_Withholding_Acct x " - + "WHERE x.C_Withholding_ID=a.C_Withholding_ID)"; - updated = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE C_Withholding_Acct a ") + .append("SET Withholding_Acct=").append(acct.getWithholding_Acct()) + .append(", Updated=SysDate, UpdatedBy=0 ") + .append("WHERE a.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) + .append(" AND EXISTS (SELECT * FROM C_Withholding_Acct x ") + .append("WHERE x.C_Withholding_ID=a.C_Withholding_ID)"); + updated = DB.executeUpdate(sql.toString(), get_TrxName()); addLog(0, null, new BigDecimal(updated), "@Updated@ @C_Withholding_ID@"); updatedTotal += updated; } // Insert new Withholding - sql = "INSERT INTO C_Withholding_Acct " - + "(C_Withholding_ID, C_AcctSchema_ID," - + " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy," - + " Withholding_Acct) " - + "SELECT x.C_Withholding_ID, acct.C_AcctSchema_ID," - + " x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0," - + " acct.Withholding_Acct " - + "FROM C_Withholding x" - + " INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) " - + "WHERE acct.C_AcctSchema_ID=" + p_C_AcctSchema_ID - + " AND NOT EXISTS (SELECT * FROM C_Withholding_Acct a " - + "WHERE a.C_Withholding_ID=x.C_Withholding_ID" - + " AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)"; - created = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("INSERT INTO C_Withholding_Acct ") + .append("(C_Withholding_ID, C_AcctSchema_ID,") + .append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,") + .append(" Withholding_Acct) ") + .append("SELECT x.C_Withholding_ID, acct.C_AcctSchema_ID,") + .append(" x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,") + .append(" acct.Withholding_Acct ") + .append("FROM C_Withholding x") + .append(" INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) ") + .append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) + .append(" AND NOT EXISTS (SELECT * FROM C_Withholding_Acct a ") + .append("WHERE a.C_Withholding_ID=x.C_Withholding_ID") + .append(" AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)"); + created = DB.executeUpdate(sql.toString(), get_TrxName()); addLog(0, null, new BigDecimal(created), "@Created@ @C_Withholding_ID@"); createdTotal += created; @@ -482,31 +482,31 @@ public class AcctSchemaDefaultCopy extends SvrProcess // Update Charge if (p_CopyOverwriteAcct) { - sql = "UPDATE C_Charge_Acct a " - + "SET Ch_Expense_Acct=" + acct.getCh_Expense_Acct() - + ", Updated=SysDate, UpdatedBy=0 " - + "WHERE a.C_AcctSchema_ID=" + p_C_AcctSchema_ID - + " AND EXISTS (SELECT * FROM C_Charge_Acct x " - + "WHERE x.C_Charge_ID=a.C_Charge_ID)"; - updated = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE C_Charge_Acct a ") + .append("SET Ch_Expense_Acct=").append(acct.getCh_Expense_Acct()) + .append(", Updated=SysDate, UpdatedBy=0 ") + .append("WHERE a.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) + .append(" AND EXISTS (SELECT * FROM C_Charge_Acct x ") + .append("WHERE x.C_Charge_ID=a.C_Charge_ID)"); + updated = DB.executeUpdate(sql.toString(), get_TrxName()); addLog(0, null, new BigDecimal(updated), "@Updated@ @C_Charge_ID@"); updatedTotal += updated; } // Insert new Charge - sql = "INSERT INTO C_Charge_Acct " - + "(C_Charge_ID, C_AcctSchema_ID," - + " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy," - + " Ch_Expense_Acct) " - + "SELECT x.C_Charge_ID, acct.C_AcctSchema_ID," - + " x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0," - + " acct.Ch_Expense_Acct " - + "FROM C_Charge x" - + " INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) " - + "WHERE acct.C_AcctSchema_ID=" + p_C_AcctSchema_ID - + " AND NOT EXISTS (SELECT * FROM C_Charge_Acct a " - + "WHERE a.C_Charge_ID=x.C_Charge_ID" - + " AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)"; - created = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("INSERT INTO C_Charge_Acct ") + .append("(C_Charge_ID, C_AcctSchema_ID,") + .append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,") + .append(" Ch_Expense_Acct) ") + .append("SELECT x.C_Charge_ID, acct.C_AcctSchema_ID,") + .append(" x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,") + .append(" acct.Ch_Expense_Acct ") + .append("FROM C_Charge x") + .append(" INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) ") + .append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) + .append(" AND NOT EXISTS (SELECT * FROM C_Charge_Acct a ") + .append("WHERE a.C_Charge_ID=x.C_Charge_ID") + .append(" AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)"); + created = DB.executeUpdate(sql.toString(), get_TrxName()); addLog(0, null, new BigDecimal(created), "@Created@ @C_Charge_ID@"); createdTotal += created; @@ -514,41 +514,42 @@ public class AcctSchemaDefaultCopy extends SvrProcess // Update Cashbook if (p_CopyOverwriteAcct) { - sql = "UPDATE C_Cashbook_Acct a " - + "SET CB_Asset_Acct=" + acct.getCB_Asset_Acct() - + ", CB_Differences_Acct=" + acct.getCB_Differences_Acct() - + ", CB_CashTransfer_Acct=" + acct.getCB_CashTransfer_Acct() - + ", CB_Expense_Acct=" + acct.getCB_Expense_Acct() - + ", CB_Receipt_Acct=" + acct.getCB_Receipt_Acct() - + ", Updated=SysDate, UpdatedBy=0 " - + "WHERE a.C_AcctSchema_ID=" + p_C_AcctSchema_ID - + " AND EXISTS (SELECT * FROM C_Cashbook_Acct x " - + "WHERE x.C_Cashbook_ID=a.C_Cashbook_ID)"; - updated = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE C_Cashbook_Acct a ") + .append("SET CB_Asset_Acct=").append(acct.getCB_Asset_Acct()) + .append(", CB_Differences_Acct=").append(acct.getCB_Differences_Acct()) + .append(", CB_CashTransfer_Acct=").append(acct.getCB_CashTransfer_Acct()) + .append(", CB_Expense_Acct=").append(acct.getCB_Expense_Acct()) + .append(", CB_Receipt_Acct=").append(acct.getCB_Receipt_Acct()) + .append(", Updated=SysDate, UpdatedBy=0 ") + .append("WHERE a.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) + .append(" AND EXISTS (SELECT * FROM C_Cashbook_Acct x ") + .append("WHERE x.C_Cashbook_ID=a.C_Cashbook_ID)"); + updated = DB.executeUpdate(sql.toString(), get_TrxName()); addLog(0, null, new BigDecimal(updated), "@Updated@ @C_Cashbook_ID@"); updatedTotal += updated; } // Insert new Cashbook - sql = "INSERT INTO C_Cashbook_Acct " - + "(C_Cashbook_ID, C_AcctSchema_ID," - + " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy," - + " CB_Asset_Acct, CB_Differences_Acct, CB_CashTransfer_Acct," - + " CB_Expense_Acct, CB_Receipt_Acct) " - + "SELECT x.C_Cashbook_ID, acct.C_AcctSchema_ID," - + " x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0," - + " acct.CB_Asset_Acct, acct.CB_Differences_Acct, acct.CB_CashTransfer_Acct," - + " acct.CB_Expense_Acct, acct.CB_Receipt_Acct " - + "FROM C_Cashbook x" - + " INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) " - + "WHERE acct.C_AcctSchema_ID=" + p_C_AcctSchema_ID - + " AND NOT EXISTS (SELECT * FROM C_Cashbook_Acct a " - + "WHERE a.C_Cashbook_ID=x.C_Cashbook_ID" - + " AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)"; - created = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("INSERT INTO C_Cashbook_Acct ") + .append("(C_Cashbook_ID, C_AcctSchema_ID,") + .append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,") + .append(" CB_Asset_Acct, CB_Differences_Acct, CB_CashTransfer_Acct,") + .append(" CB_Expense_Acct, CB_Receipt_Acct) ") + .append("SELECT x.C_Cashbook_ID, acct.C_AcctSchema_ID,") + .append(" x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,") + .append(" acct.CB_Asset_Acct, acct.CB_Differences_Acct, acct.CB_CashTransfer_Acct,") + .append(" acct.CB_Expense_Acct, acct.CB_Receipt_Acct ") + .append("FROM C_Cashbook x") + .append(" INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) ") + .append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) + .append(" AND NOT EXISTS (SELECT * FROM C_Cashbook_Acct a ") + .append("WHERE a.C_Cashbook_ID=x.C_Cashbook_ID") + .append(" AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)"); + created = DB.executeUpdate(sql.toString(), get_TrxName()); addLog(0, null, new BigDecimal(created), "@Created@ @C_Cashbook_ID@"); createdTotal += created; - return "@Created@=" + createdTotal + ", @Updated@=" + updatedTotal; + StringBuilder msgreturn = new StringBuilder("@Created@=").append(createdTotal).append(", @Updated@=").append(updatedTotal); + return msgreturn.toString(); } // doIt } // AcctSchemaDefaultCopy diff --git a/org.adempiere.base.process/src/org/compiere/process/AllocationAuto.java b/org.adempiere.base.process/src/org/compiere/process/AllocationAuto.java index 2da99b4bff..361eb27c8e 100644 --- a/org.adempiere.base.process/src/org/compiere/process/AllocationAuto.java +++ b/org.adempiere.base.process/src/org/compiere/process/AllocationAuto.java @@ -170,7 +170,8 @@ public class AllocationAuto extends SvrProcess } } // - return "@Created@ #" + countBP + "/" + countAlloc; + StringBuilder msgreturn = new StringBuilder("@Created@ #").append(countBP).append("/").append(countAlloc); + return msgreturn.toString(); } // doIt /** @@ -258,19 +259,19 @@ public class AllocationAuto extends SvrProcess private MPayment[] getPayments (int C_BPartner_ID) { ArrayList list = new ArrayList(); - String sql = "SELECT * FROM C_Payment " - + "WHERE IsAllocated='N' AND Processed='Y' AND C_BPartner_ID=?" - + " AND IsPrepayment='N' AND C_Charge_ID IS NULL "; + StringBuilder sql = new StringBuilder("SELECT * FROM C_Payment ") + .append("WHERE IsAllocated='N' AND Processed='Y' AND C_BPartner_ID=?") + .append(" AND IsPrepayment='N' AND C_Charge_ID IS NULL "); if (ONLY_AP.equals(p_APAR)) - sql += "AND IsReceipt='N' "; + sql.append("AND IsReceipt='N' "); else if (ONLY_AR.equals(p_APAR)) - sql += "AND IsReceipt='Y' "; - sql += "ORDER BY DateTrx"; + sql.append("AND IsReceipt='Y' "); + sql.append("ORDER BY DateTrx"); PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement (sql, get_TrxName()); + pstmt = DB.prepareStatement (sql.toString(), get_TrxName()); pstmt.setInt (1, C_BPartner_ID); rs = pstmt.executeQuery (); while (rs.next ()) @@ -288,7 +289,7 @@ public class AllocationAuto extends SvrProcess } catch (Exception e) { - log.log(Level.SEVERE, sql, e); + log.log(Level.SEVERE, sql.toString(), e); } finally { @@ -308,18 +309,18 @@ public class AllocationAuto extends SvrProcess private MInvoice[] getInvoices (int C_BPartner_ID) { ArrayList list = new ArrayList(); - String sql = "SELECT * FROM C_Invoice " - + "WHERE IsPaid='N' AND Processed='Y' AND C_BPartner_ID=? "; + StringBuilder sql = new StringBuilder("SELECT * FROM C_Invoice ") + .append("WHERE IsPaid='N' AND Processed='Y' AND C_BPartner_ID=? "); if (ONLY_AP.equals(p_APAR)) - sql += "AND IsSOTrx='N' "; + sql.append("AND IsSOTrx='N' "); else if (ONLY_AR.equals(p_APAR)) - sql += "AND IsSOTrx='Y' "; - sql += "ORDER BY DateInvoiced"; + sql.append("AND IsSOTrx='Y' "); + sql.append("ORDER BY DateInvoiced"); PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement (sql, get_TrxName()); + pstmt = DB.prepareStatement (sql.toString(), get_TrxName()); pstmt.setInt (1, C_BPartner_ID); rs = pstmt.executeQuery (); while (rs.next ()) @@ -336,7 +337,7 @@ public class AllocationAuto extends SvrProcess } catch (Exception e) { - log.log(Level.SEVERE, sql, e); + log.log(Level.SEVERE, sql.toString(), e); } finally { @@ -768,8 +769,9 @@ public class AllocationAuto extends SvrProcess if (allocatedPayments.compareTo(allocatedInvoices) != 0) { - throw new AdempiereSystemError("Allocated Payments=" + allocatedPayments - + " <> Invoices=" + allocatedInvoices); + StringBuilder msg = new StringBuilder("Allocated Payments=").append(allocatedPayments) + .append(" <> Invoices=").append(allocatedInvoices); + throw new AdempiereSystemError(msg.toString()); } processAllocation(); return 1; @@ -828,9 +830,11 @@ public class AllocationAuto extends SvrProcess if (m_allocation == null) return true; boolean success = m_allocation.processIt(MAllocationHdr.DOCACTION_Complete); - if (!success) - throw new IllegalStateException("Allocation Process Failed "+ m_allocation.getDocumentNo() + - " " + m_allocation.getProcessMsg()); + if (!success){ + StringBuilder msg = new StringBuilder("Allocation Process Failed ").append(m_allocation.getDocumentNo()) + .append(" ").append( m_allocation.getProcessMsg()); + throw new IllegalStateException(msg.toString()); + } else m_allocation.saveEx(); addLog(0, m_allocation.getDateAcct(), null, m_allocation.getDescription()); diff --git a/org.adempiere.base.process/src/org/compiere/process/AllocationReset.java b/org.adempiere.base.process/src/org/compiere/process/AllocationReset.java index ed3be596c5..02381cea71 100644 --- a/org.adempiere.base.process/src/org/compiere/process/AllocationReset.java +++ b/org.adempiere.base.process/src/org/compiere/process/AllocationReset.java @@ -115,14 +115,14 @@ public class AllocationReset extends SvrProcess } // Selection - StringBuffer sql = new StringBuffer("SELECT * FROM C_AllocationHdr ah " - + "WHERE EXISTS (SELECT * FROM C_AllocationLine al " - + "WHERE ah.C_AllocationHdr_ID=al.C_AllocationHdr_ID"); + StringBuilder sql = new StringBuilder("SELECT * FROM C_AllocationHdr ah ") + .append("WHERE EXISTS (SELECT * FROM C_AllocationLine al ") + .append("WHERE ah.C_AllocationHdr_ID=al.C_AllocationHdr_ID"); if (p_C_BPartner_ID != 0) sql.append(" AND al.C_BPartner_ID=?"); else if (p_C_BP_Group_ID != 0) - sql.append(" AND EXISTS (SELECT * FROM C_BPartner bp " - + "WHERE bp.C_BPartner_ID=al.C_BPartner_ID AND bp.C_BP_Group_ID=?)"); + sql.append(" AND EXISTS (SELECT * FROM C_BPartner bp ") + .append("WHERE bp.C_BPartner_ID=al.C_BPartner_ID AND bp.C_BP_Group_ID=?)"); else sql.append(" AND AD_Client_ID=?"); if (p_DateAcct_From != null) @@ -132,9 +132,9 @@ public class AllocationReset extends SvrProcess // Do not delete Cash Trx sql.append(" AND al.C_CashLine_ID IS NULL)"); // Open Period - sql.append(" AND EXISTS (SELECT * FROM C_Period p" - + " INNER JOIN C_PeriodControl pc ON (p.C_Period_ID=pc.C_Period_ID AND pc.DocBaseType='CMA') " - + "WHERE ah.DateAcct BETWEEN p.StartDate AND p.EndDate)"); + sql.append(" AND EXISTS (SELECT * FROM C_Period p") + .append(" INNER JOIN C_PeriodControl pc ON (p.C_Period_ID=pc.C_Period_ID AND pc.DocBaseType='CMA') ") + .append("WHERE ah.DateAcct BETWEEN p.StartDate AND p.EndDate)"); // PreparedStatement pstmt = null; ResultSet rs = null; diff --git a/org.adempiere.base.process/src/org/compiere/process/AssetDelivery.java b/org.adempiere.base.process/src/org/compiere/process/AssetDelivery.java index ef98f1ca85..3c6393d7ed 100644 --- a/org.adempiere.base.process/src/org/compiere/process/AssetDelivery.java +++ b/org.adempiere.base.process/src/org/compiere/process/AssetDelivery.java @@ -112,10 +112,10 @@ public class AssetDelivery extends SvrProcess return msg; } // - StringBuffer sql = new StringBuffer ("SELECT A_Asset_ID, GuaranteeDate " - + "FROM A_Asset a" - + " INNER JOIN M_Product p ON (a.M_Product_ID=p.M_Product_ID) " - + "WHERE "); + StringBuilder sql = new StringBuilder("SELECT A_Asset_ID, GuaranteeDate ") + .append("FROM A_Asset a") + .append(" INNER JOIN M_Product p ON (a.M_Product_ID=p.M_Product_ID) ") + .append("WHERE "); if (m_A_Asset_Group_ID != 0) sql.append("a.A_Asset_Group_ID=").append(m_A_Asset_Group_ID).append(" AND "); if (m_M_Product_ID != 0) diff --git a/org.adempiere.base.process/src/org/compiere/process/BOMFlagValidate.java b/org.adempiere.base.process/src/org/compiere/process/BOMFlagValidate.java index eba3847126..9d2ab983e3 100644 --- a/org.adempiere.base.process/src/org/compiere/process/BOMFlagValidate.java +++ b/org.adempiere.base.process/src/org/compiere/process/BOMFlagValidate.java @@ -44,17 +44,17 @@ public class BOMFlagValidate extends SvrProcess { { //Select Products where there's a BOM, and there are no lines - String sql = "SELECT Name, M_Product_ID FROM M_Product WHERE IsBOM = 'Y' AND " + - "M_Product_ID NOT IN (SELECT M_Product_ID FROM M_Product_BOM ) AND "; + StringBuilder sql = new StringBuilder("SELECT Name, M_Product_ID FROM M_Product WHERE IsBOM = 'Y' AND ") + .append("M_Product_ID NOT IN (SELECT M_Product_ID FROM M_Product_BOM ) AND "); if (p_M_Product_Category_ID == 0) - sql += "AD_Client_ID= ?"; + sql.append("AD_Client_ID= ?"); else - sql += "M_Product_Category_ID= ?"; + sql.append("M_Product_Category_ID= ?"); PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement (sql, get_TrxName()); + pstmt = DB.prepareStatement (sql.toString(), get_TrxName()); if (p_M_Product_Category_ID == 0) pstmt.setInt (1, Env.getAD_Client_ID(getCtx())); else @@ -63,7 +63,8 @@ public class BOMFlagValidate extends SvrProcess { while (rs.next()) { - addLog(0, null, null, rs.getString(1) + " BOM without BOM lines", MProduct.Table_ID, rs.getInt(2)); + StringBuilder msglog=new StringBuilder(rs.getString(1)).append(" BOM without BOM lines"); + addLog(0, null, null, msglog.toString(), MProduct.Table_ID, rs.getInt(2)); } } catch (SQLException e) { throw e; @@ -74,13 +75,13 @@ public class BOMFlagValidate extends SvrProcess { PreparedStatement upstmt = null; try { - String update = "UPDATE M_Product SET IsBOM = 'N' WHERE IsBOM = 'Y' AND M_Product_ID NOT IN " + - "(SELECT M_Product_ID FROM M_Product_BOM ) AND "; + StringBuilder update = new StringBuilder("UPDATE M_Product SET IsBOM = 'N' WHERE IsBOM = 'Y' AND M_Product_ID NOT IN ") + .append("(SELECT M_Product_ID FROM M_Product_BOM ) AND "); if (p_M_Product_Category_ID == 0) - update += "AD_Client_ID= ?"; + update.append("AD_Client_ID= ?"); else - update += "M_Product_Category_ID= ?"; - upstmt = DB.prepareStatement (update, get_TrxName()); + update.append("M_Product_Category_ID= ?"); + upstmt = DB.prepareStatement (update.toString(), get_TrxName()); if (p_M_Product_Category_ID == 0) upstmt.setInt (1, Env.getAD_Client_ID(getCtx())); else @@ -99,17 +100,17 @@ public class BOMFlagValidate extends SvrProcess { { //Select Products where there's a BOM, and there are no lines - String sql = "SELECT Name, M_Product_ID FROM M_Product WHERE IsBOM = 'N' AND " + - "M_Product_ID IN (SELECT M_Product_ID FROM M_Product_BOM ) AND "; + StringBuilder sql = new StringBuilder("SELECT Name, M_Product_ID FROM M_Product WHERE IsBOM = 'N' AND ") + .append("M_Product_ID IN (SELECT M_Product_ID FROM M_Product_BOM ) AND "); if (p_M_Product_Category_ID == 0) - sql += "AD_Client_ID= ?"; + sql.append("AD_Client_ID= ?"); else - sql += "M_Product_Category_ID= ?"; + sql.append("M_Product_Category_ID= ?"); PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement (sql, get_TrxName()); + pstmt = DB.prepareStatement (sql.toString(), get_TrxName()); if (p_M_Product_Category_ID == 0) pstmt.setInt (1, Env.getAD_Client_ID(getCtx())); else @@ -118,7 +119,8 @@ public class BOMFlagValidate extends SvrProcess { while (rs.next()) { - addLog(0, null, null, rs.getString(1) + " not BOM with BOM lines", MProduct.Table_ID, rs.getInt(2)); + StringBuilder msglog = new StringBuilder(rs.getString(1)).append(" not BOM with BOM lines"); + addLog(0, null, null, msglog.toString(), MProduct.Table_ID, rs.getInt(2)); } } catch (SQLException e) { throw e; @@ -127,15 +129,15 @@ public class BOMFlagValidate extends SvrProcess { rs = null; pstmt = null; } - String update = "UPDATE M_Product SET ISBOM = 'Y' WHERE IsBOM = 'N' AND M_Product_ID IN " + - "(SELECT M_Product_ID FROM M_Product_BOM ) AND "; + StringBuilder update = new StringBuilder("UPDATE M_Product SET ISBOM = 'Y' WHERE IsBOM = 'N' AND M_Product_ID IN ") + .append("(SELECT M_Product_ID FROM M_Product_BOM ) AND "); if (p_M_Product_Category_ID == 0) - update += "AD_Client_ID= ?"; + update.append("AD_Client_ID= ?"); else - update += "M_Product_Category_ID= ?"; + update.append("M_Product_Category_ID= ?"); PreparedStatement upstmt = null; try { - upstmt = DB.prepareStatement (update, get_TrxName()); + upstmt = DB.prepareStatement (update.toString(), get_TrxName()); if (p_M_Product_Category_ID == 0) upstmt.setInt (1, Env.getAD_Client_ID(getCtx())); else diff --git a/org.adempiere.base.process/src/org/compiere/process/BankStatementPayment.java b/org.adempiere.base.process/src/org/compiere/process/BankStatementPayment.java index dec65b121a..f51b0efd05 100644 --- a/org.adempiere.base.process/src/org/compiere/process/BankStatementPayment.java +++ b/org.adempiere.base.process/src/org/compiere/process/BankStatementPayment.java @@ -101,10 +101,10 @@ public class BankStatementPayment extends SvrProcess ibs.setTrxAmt(payment.getPayAmt(true)); ibs.saveEx(); // - String retString = "@C_Payment_ID@ = " + payment.getDocumentNo(); + StringBuilder retString = new StringBuilder("@C_Payment_ID@ = ").append(payment.getDocumentNo()); if (payment.getOverUnderAmt().signum() != 0) - retString += " - @OverUnderAmt@=" + payment.getOverUnderAmt(); - return retString; + retString.append(" - @OverUnderAmt@=").append(payment.getOverUnderAmt()); + return retString.toString(); } // createPayment - Import /** @@ -133,10 +133,10 @@ public class BankStatementPayment extends SvrProcess bsl.setPayment(payment); bsl.saveEx(); // - String retString = "@C_Payment_ID@ = " + payment.getDocumentNo(); + StringBuilder retString = new StringBuilder("@C_Payment_ID@ = ").append(payment.getDocumentNo()); if (payment.getOverUnderAmt().signum() != 0) - retString += " - @OverUnderAmt@=" + payment.getOverUnderAmt(); - return retString; + retString.append(" - @OverUnderAmt@=").append(payment.getOverUnderAmt()); + return retString.toString(); } // createPayment diff --git a/org.adempiere.base.process/src/org/compiere/process/ChangeLogProcess.java b/org.adempiere.base.process/src/org/compiere/process/ChangeLogProcess.java index 5b4aea2219..f96fb2aeb5 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ChangeLogProcess.java +++ b/org.adempiere.base.process/src/org/compiere/process/ChangeLogProcess.java @@ -146,8 +146,8 @@ public class ChangeLogProcess extends SvrProcess } // final call executeStatement(); - - return "@OK@: " + m_ok + " - @Errors@: " + m_errors + " - @Failed@: " + m_checkFailed; + StringBuilder msgreturn = new StringBuilder("@OK@: ").append(m_ok).append(" - @Errors@: ").append(m_errors).append(" - @Failed@: ").append(m_checkFailed); + return msgreturn.toString(); } // doIt @@ -369,7 +369,7 @@ public class ChangeLogProcess extends SvrProcess // Changed Tables + " AND EXISTS (SELECT * FROM AD_ChangeLog l " + "WHERE t.AD_Table_ID=l.AD_Table_ID)"; - StringBuffer update = null; + StringBuilder update = null; PreparedStatement pstmt = null; ResultSet rs = null; try @@ -384,14 +384,15 @@ public class ChangeLogProcess extends SvrProcess String columnName = tableName + "_ID"; if (tableName.equals("AD_Ref_Table")) columnName = "AD_Reference_ID"; - update = new StringBuffer ("UPDATE AD_ChangeLog SET IsCustomization='Y' " - + "WHERE AD_Table_ID=").append(table.getAD_Table_ID()); + update = new StringBuilder ("UPDATE AD_ChangeLog SET IsCustomization='Y' ") + .append("WHERE AD_Table_ID=").append(table.getAD_Table_ID()); update.append (" AND Record_ID IN (SELECT ") .append (columnName) .append (" FROM ").append(tableName) .append (" WHERE EntityType IN ('D','C'))"); int no = DB.executeUpdate(update.toString(), get_TrxName()); - log.config(table.getTableName() + " = " + no); + StringBuilder msglog = new StringBuilder(table.getTableName()).append(" = ").append(no); + log.config(msglog.toString()); updateNo += no; } diff --git a/org.adempiere.base.process/src/org/compiere/process/ColumnEncryption.java b/org.adempiere.base.process/src/org/compiere/process/ColumnEncryption.java index 2e962db6c7..ab927ecfec 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ColumnEncryption.java +++ b/org.adempiere.base.process/src/org/compiere/process/ColumnEncryption.java @@ -129,33 +129,42 @@ public class ColumnEncryption extends SvrProcess { } // Start - addLog(0, null, null, "Encryption Class = " - + SecureEngine.getClassName()); + StringBuilder msglog = new StringBuilder("Encryption Class = ") + .append(SecureEngine.getClassName()); + addLog(0, null, null, msglog.toString()); boolean error = false; // Test Value if (p_TestValue != null && p_TestValue.length() > 0) { String encString = SecureEngine.encrypt(p_TestValue); - addLog(0, null, null, "Encrypted Test Value=" + encString); + msglog = new StringBuilder("Encrypted Test Value=").append(encString); + addLog(0, null, null, msglog.toString()); String clearString = SecureEngine.decrypt(encString); - if (p_TestValue.equals(clearString)) - addLog(0, null, null, "Decrypted=" + clearString - + " (same as test value)"); + if (p_TestValue.equals(clearString)){ + msglog = new StringBuilder("Decrypted=").append(clearString) + .append(" (same as test value)"); + addLog(0, null, null, msglog.toString()); + } else { - addLog(0, null, null, "Decrypted=" + clearString - + " (NOT the same as test value - check algorithm)"); + msglog = new StringBuilder("Decrypted=").append(clearString) + .append(" (NOT the same as test value - check algorithm)"); + addLog(0, null, null, msglog.toString()); error = true; } int encLength = encString.length(); - addLog(0, null, null, "Test Length=" + p_TestValue.length() - + " -> " + encLength); - if (encLength <= column.getFieldLength()) - addLog(0, null, null, "Encrypted Length (" + encLength - + ") fits into field (" + column.getFieldLength() + ")"); + msglog = new StringBuilder("Test Length=").append(p_TestValue.length()) + .append(" -> ").append(encLength); + addLog(0, null, null, msglog.toString()); + if (encLength <= column.getFieldLength()){ + msglog = new StringBuilder("Encrypted Length (").append(encLength) + .append(") fits into field (").append(column.getFieldLength()).append(")"); + addLog(0, null, null, msglog.toString()); + } else { - addLog(0, null, null, "Encrypted Length (" + encLength - + ") does NOT fit into field (" - + column.getFieldLength() + ") - resize field"); + msglog = new StringBuilder("Encrypted Length (").append(encLength) + .append(") does NOT fit into field (") + .append(column.getFieldLength()).append(") - resize field"); + addLog(0, null, null, msglog.toString()); error = true; } } @@ -167,22 +176,25 @@ public class ColumnEncryption extends SvrProcess { while (testClear.length() < p_MaxLength) testClear.append(testClear); testClear.delete(p_MaxLength,testClear.length()); - StringBuilder msglog = new StringBuilder() + msglog = new StringBuilder() .append("Test=").append(testClear.toString()).append(" (").append(p_MaxLength).append(")"); log.config(msglog.toString()); // String encString = SecureEngine.encrypt(testClear.toString()); int encLength = encString.length(); - - addLog(0, null, null, "Test Max Length=" + testClear.length() - + " -> " + encLength); - if (encLength <= column.getFieldLength()) - addLog(0, null, null, "Encrypted Max Length (" + encLength - + ") fits into field (" + column.getFieldLength() + ")"); + msglog = new StringBuilder("Test Max Length=").append(testClear.length()) + .append(" -> ").append(encLength); + addLog(0, null, null, msglog.toString()); + if (encLength <= column.getFieldLength()){ + msglog = new StringBuilder("Encrypted Max Length (").append(encLength) + .append(") fits into field (").append(column.getFieldLength()).append(")"); + addLog(0, null, null, msglog.toString()); + } else { - addLog(0, null, null, "Encrypted Max Length (" + encLength - + ") does NOT fit into field (" - + column.getFieldLength() + ") - resize field"); + msglog = new StringBuilder("Encrypted Max Length (").append(encLength) + .append(") does NOT fit into field (") + .append(column.getFieldLength()).append(") - resize field"); + addLog(0, null, null, msglog.toString()); error = true; } } @@ -227,14 +239,18 @@ public class ColumnEncryption extends SvrProcess { } if (p_IsEncrypted != column.isEncrypted()) { - if (error || !p_ChangeSetting) - addLog(0, null, null, "Encryption NOT changed - Encryption=" - + column.isEncrypted()); + if (error || !p_ChangeSetting){ + msglog = new StringBuilder("Encryption NOT changed - Encryption=") + .append(column.isEncrypted()); + addLog(0, null, null, msglog.toString()); + } else { column.setIsEncrypted(p_IsEncrypted); - if (column.save()) - addLog(0, null, null, "Encryption CHANGED - Encryption=" - + column.isEncrypted()); + if (column.save()){ + msglog = new StringBuilder("Encryption CHANGED - Encryption=") + .append(column.isEncrypted()); + addLog(0, null, null, msglog.toString()); + } else addLog(0, null, null, "Save Error"); } @@ -274,17 +290,17 @@ public class ColumnEncryption extends SvrProcess { private int encryptColumnContents(String columnName, String tableName) throws Exception { int recordsEncrypted = 0; - String idColumnName = tableName + "_ID"; + StringBuilder idColumnName = new StringBuilder(tableName).append("_ID"); StringBuilder selectSql = new StringBuilder(); - selectSql.append("SELECT " + idColumnName + "," + columnName); - selectSql.append(" FROM " + tableName); - selectSql.append(" ORDER BY " + idColumnName); + selectSql.append("SELECT ").append(idColumnName).append(",").append(columnName); + selectSql.append(" FROM ").append(tableName); + selectSql.append(" ORDER BY ").append(idColumnName); StringBuilder updateSql = new StringBuilder(); - updateSql.append("UPDATE " + tableName); - updateSql.append(" SET " + columnName + "=?"); - updateSql.append(" WHERE " + idColumnName + "=?"); + updateSql.append("UPDATE ").append(tableName); + updateSql.append(" SET ").append(columnName).append("=?"); + updateSql.append(" WHERE ").append(idColumnName).append("=?"); PreparedStatement selectStmt = null; PreparedStatement updateStmt = null; @@ -357,16 +373,16 @@ public class ColumnEncryption extends SvrProcess { // Alter SQL StringBuffer alterSql = new StringBuffer(); - alterSql.append("ALTER TABLE " + tableName); - alterSql.append(" MODIFY " + columnName); + alterSql.append("ALTER TABLE ").append(tableName); + alterSql.append(" MODIFY ").append(columnName); alterSql.append(" NVARCHAR2("); - alterSql.append(length + ") "); + alterSql.append(length).append(") "); // Update SQL StringBuffer updateSql = new StringBuffer(); updateSql.append("UPDATE AD_Column"); - updateSql.append(" SET FieldLength=" + length); - updateSql.append(" WHERE AD_Column_ID=" + columnID); + updateSql.append(" SET FieldLength=").append(length); + updateSql.append(" WHERE AD_Column_ID=").append(columnID); PreparedStatement selectStmt = null; diff --git a/org.adempiere.base.process/src/org/compiere/process/ColumnSync.java b/org.adempiere.base.process/src/org/compiere/process/ColumnSync.java index 8fa9351c4d..4d02367b69 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ColumnSync.java +++ b/org.adempiere.base.process/src/org/compiere/process/ColumnSync.java @@ -140,12 +140,12 @@ public class ColumnSync extends SvrProcess if (no == -1) { - String msg = "@Error@ "; + StringBuilder msg = new StringBuilder("@Error@ "); ValueNamePair pp = CLogger.retrieveError(); if (pp != null) - msg = pp.getName() + " - "; - msg += sql; - throw new AdempiereUserError (msg); + msg = new StringBuilder(pp.getName()).append(" - "); + msg.append(sql); + throw new AdempiereUserError (msg.toString()); } return sql; } finally { diff --git a/org.adempiere.base.process/src/org/compiere/process/CommissionCalc.java b/org.adempiere.base.process/src/org/compiere/process/CommissionCalc.java index a08eda4b84..424c3b8977 100644 --- a/org.adempiere.base.process/src/org/compiere/process/CommissionCalc.java +++ b/org.adempiere.base.process/src/org/compiere/process/CommissionCalc.java @@ -89,10 +89,10 @@ public class CommissionCalc extends SvrProcess comRun.setStartDate(p_StartDate); // 01-Jan-2000 - 31-Jan-2001 - USD SimpleDateFormat format = DisplayType.getDateFormat(DisplayType.Date); - String description = format.format(p_StartDate) - + " - " + format.format(m_EndDate) - + " - " + MCurrency.getISO_Code(getCtx(), m_com.getC_Currency_ID()); - comRun.setDescription(description); + StringBuilder description = new StringBuilder(format.format(p_StartDate)) + .append(" - ").append(format.format(m_EndDate)) + .append(" - ").append(MCurrency.getISO_Code(getCtx(), m_com.getC_Currency_ID())); + comRun.setDescription(description.toString()); if (!comRun.save()) throw new AdempiereSystemError ("Could not save Commission Run"); @@ -104,94 +104,94 @@ public class CommissionCalc extends SvrProcess if (!comAmt.save()) throw new AdempiereSystemError ("Could not save Commission Amt"); // - StringBuffer sql = new StringBuffer(); + StringBuilder sql = new StringBuilder(); if (MCommission.DOCBASISTYPE_Receipt.equals(m_com.getDocBasisType())) { if (m_com.isListDetails()) { - sql.append("SELECT h.C_Currency_ID, (l.LineNetAmt*al.Amount/h.GrandTotal) AS Amt," - + " (l.QtyInvoiced*al.Amount/h.GrandTotal) AS Qty," - + " NULL, l.C_InvoiceLine_ID, p.DocumentNo||'_'||h.DocumentNo," - + " COALESCE(prd.Value,l.Description), h.DateInvoiced " - + "FROM C_Payment p" - + " INNER JOIN C_AllocationLine al ON (p.C_Payment_ID=al.C_Payment_ID)" - + " INNER JOIN C_Invoice h ON (al.C_Invoice_ID = h.C_Invoice_ID)" - + " INNER JOIN C_InvoiceLine l ON (h.C_Invoice_ID = l.C_Invoice_ID) " - + " LEFT OUTER JOIN M_Product prd ON (l.M_Product_ID = prd.M_Product_ID) " - + "WHERE p.DocStatus IN ('CL','CO','RE')" - + " AND h.IsSOTrx='Y'" - + " AND p.AD_Client_ID = ?" - + " AND p.DateTrx BETWEEN ? AND ?"); + sql.append("SELECT h.C_Currency_ID, (l.LineNetAmt*al.Amount/h.GrandTotal) AS Amt,") + .append(" (l.QtyInvoiced*al.Amount/h.GrandTotal) AS Qty,") + .append(" NULL, l.C_InvoiceLine_ID, p.DocumentNo||'_'||h.DocumentNo,") + .append(" COALESCE(prd.Value,l.Description), h.DateInvoiced ") + .append("FROM C_Payment p") + .append(" INNER JOIN C_AllocationLine al ON (p.C_Payment_ID=al.C_Payment_ID)") + .append(" INNER JOIN C_Invoice h ON (al.C_Invoice_ID = h.C_Invoice_ID)") + .append(" INNER JOIN C_InvoiceLine l ON (h.C_Invoice_ID = l.C_Invoice_ID) ") + .append(" LEFT OUTER JOIN M_Product prd ON (l.M_Product_ID = prd.M_Product_ID) ") + .append("WHERE p.DocStatus IN ('CL','CO','RE')") + .append(" AND h.IsSOTrx='Y'") + .append(" AND p.AD_Client_ID = ?") + .append(" AND p.DateTrx BETWEEN ? AND ?"); } else { - sql.append("SELECT h.C_Currency_ID, SUM(l.LineNetAmt*al.Amount/h.GrandTotal) AS Amt," - + " SUM(l.QtyInvoiced*al.Amount/h.GrandTotal) AS Qty," - + " NULL, NULL, NULL, NULL, MAX(h.DateInvoiced) " - + "FROM C_Payment p" - + " INNER JOIN C_AllocationLine al ON (p.C_Payment_ID=al.C_Payment_ID)" - + " INNER JOIN C_Invoice h ON (al.C_Invoice_ID = h.C_Invoice_ID)" - + " INNER JOIN C_InvoiceLine l ON (h.C_Invoice_ID = l.C_Invoice_ID) " - + "WHERE p.DocStatus IN ('CL','CO','RE')" - + " AND h.IsSOTrx='Y'" - + " AND p.AD_Client_ID = ?" - + " AND p.DateTrx BETWEEN ? AND ?"); + sql.append("SELECT h.C_Currency_ID, SUM(l.LineNetAmt*al.Amount/h.GrandTotal) AS Amt,") + .append(" SUM(l.QtyInvoiced*al.Amount/h.GrandTotal) AS Qty,") + .append(" NULL, NULL, NULL, NULL, MAX(h.DateInvoiced) ") + .append("FROM C_Payment p") + .append(" INNER JOIN C_AllocationLine al ON (p.C_Payment_ID=al.C_Payment_ID)") + .append(" INNER JOIN C_Invoice h ON (al.C_Invoice_ID = h.C_Invoice_ID)") + .append(" INNER JOIN C_InvoiceLine l ON (h.C_Invoice_ID = l.C_Invoice_ID) ") + .append("WHERE p.DocStatus IN ('CL','CO','RE')") + .append(" AND h.IsSOTrx='Y'") + .append(" AND p.AD_Client_ID = ?") + .append(" AND p.DateTrx BETWEEN ? AND ?"); } } else if (MCommission.DOCBASISTYPE_Order.equals(m_com.getDocBasisType())) { if (m_com.isListDetails()) { - sql.append("SELECT h.C_Currency_ID, l.LineNetAmt, l.QtyOrdered, " - + "l.C_OrderLine_ID, NULL, h.DocumentNo," - + " COALESCE(prd.Value,l.Description),h.DateOrdered " - + "FROM C_Order h" - + " INNER JOIN C_OrderLine l ON (h.C_Order_ID = l.C_Order_ID)" - + " LEFT OUTER JOIN M_Product prd ON (l.M_Product_ID = prd.M_Product_ID) " - + "WHERE h.DocStatus IN ('CL','CO')" - + " AND h.IsSOTrx='Y'" - + " AND h.AD_Client_ID = ?" - + " AND h.DateOrdered BETWEEN ? AND ?"); + sql.append("SELECT h.C_Currency_ID, l.LineNetAmt, l.QtyOrdered, ") + .append("l.C_OrderLine_ID, NULL, h.DocumentNo,") + .append(" COALESCE(prd.Value,l.Description),h.DateOrdered ") + .append("FROM C_Order h") + .append(" INNER JOIN C_OrderLine l ON (h.C_Order_ID = l.C_Order_ID)") + .append(" LEFT OUTER JOIN M_Product prd ON (l.M_Product_ID = prd.M_Product_ID) ") + .append("WHERE h.DocStatus IN ('CL','CO')") + .append(" AND h.IsSOTrx='Y'") + .append(" AND h.AD_Client_ID = ?") + .append(" AND h.DateOrdered BETWEEN ? AND ?"); } else { - sql.append("SELECT h.C_Currency_ID, SUM(l.LineNetAmt) AS Amt," - + " SUM(l.QtyOrdered) AS Qty, " - + "NULL, NULL, NULL, NULL, MAX(h.DateOrdered) " - + "FROM C_Order h" - + " INNER JOIN C_OrderLine l ON (h.C_Order_ID = l.C_Order_ID) " - + "WHERE h.DocStatus IN ('CL','CO')" - + " AND h.IsSOTrx='Y'" - + " AND h.AD_Client_ID = ?" - + " AND h.DateOrdered BETWEEN ? AND ?"); + sql.append("SELECT h.C_Currency_ID, SUM(l.LineNetAmt) AS Amt,") + .append(" SUM(l.QtyOrdered) AS Qty, ") + .append("NULL, NULL, NULL, NULL, MAX(h.DateOrdered) ") + .append("FROM C_Order h") + .append(" INNER JOIN C_OrderLine l ON (h.C_Order_ID = l.C_Order_ID) ") + .append("WHERE h.DocStatus IN ('CL','CO')") + .append(" AND h.IsSOTrx='Y'") + .append(" AND h.AD_Client_ID = ?") + .append(" AND h.DateOrdered BETWEEN ? AND ?"); } } else // Invoice Basis { if (m_com.isListDetails()) { - sql.append("SELECT h.C_Currency_ID, l.LineNetAmt, l.QtyInvoiced, " - + "NULL, l.C_InvoiceLine_ID, h.DocumentNo," - + " COALESCE(prd.Value,l.Description),h.DateInvoiced " - + "FROM C_Invoice h" - + " INNER JOIN C_InvoiceLine l ON (h.C_Invoice_ID = l.C_Invoice_ID)" - + " LEFT OUTER JOIN M_Product prd ON (l.M_Product_ID = prd.M_Product_ID) " - + "WHERE h.DocStatus IN ('CL','CO','RE')" - + " AND h.IsSOTrx='Y'" - + " AND h.AD_Client_ID = ?" - + " AND h.DateInvoiced BETWEEN ? AND ?"); + sql.append("SELECT h.C_Currency_ID, l.LineNetAmt, l.QtyInvoiced, ") + .append("NULL, l.C_InvoiceLine_ID, h.DocumentNo,") + .append(" COALESCE(prd.Value,l.Description),h.DateInvoiced ") + .append("FROM C_Invoice h") + .append(" INNER JOIN C_InvoiceLine l ON (h.C_Invoice_ID = l.C_Invoice_ID)") + .append(" LEFT OUTER JOIN M_Product prd ON (l.M_Product_ID = prd.M_Product_ID) ") + .append("WHERE h.DocStatus IN ('CL','CO','RE')") + .append(" AND h.IsSOTrx='Y'") + .append(" AND h.AD_Client_ID = ?") + .append(" AND h.DateInvoiced BETWEEN ? AND ?"); } else { - sql.append("SELECT h.C_Currency_ID, SUM(l.LineNetAmt) AS Amt," - + " SUM(l.QtyInvoiced) AS Qty, " - + "NULL, NULL, NULL, NULL, MAX(h.DateInvoiced) " - + "FROM C_Invoice h" - + " INNER JOIN C_InvoiceLine l ON (h.C_Invoice_ID = l.C_Invoice_ID) " - + "WHERE h.DocStatus IN ('CL','CO','RE')" - + " AND h.IsSOTrx='Y'" - + " AND h.AD_Client_ID = ?" - + " AND h.DateInvoiced BETWEEN ? AND ?"); + sql.append("SELECT h.C_Currency_ID, SUM(l.LineNetAmt) AS Amt,") + .append(" SUM(l.QtyInvoiced) AS Qty, ") + .append("NULL, NULL, NULL, NULL, MAX(h.DateInvoiced) ") + .append("FROM C_Invoice h") + .append(" INNER JOIN C_InvoiceLine l ON (h.C_Invoice_ID = l.C_Invoice_ID) ") + .append("WHERE h.DocStatus IN ('CL','CO','RE')") + .append(" AND h.IsSOTrx='Y'") + .append(" AND h.AD_Client_ID = ?") + .append(" AND h.DateInvoiced BETWEEN ? AND ?"); } } // CommissionOrders/Invoices @@ -221,19 +221,19 @@ public class CommissionCalc extends SvrProcess sql.append(" AND h.C_BPartner_ID=").append(lines[i].getC_BPartner_ID()); // BPartner Group if (lines[i].getC_BP_Group_ID() != 0) - sql.append(" AND h.C_BPartner_ID IN " - + "(SELECT C_BPartner_ID FROM C_BPartner WHERE C_BP_Group_ID=").append(lines[i].getC_BP_Group_ID()).append(")"); + sql.append(" AND h.C_BPartner_ID IN ") + .append("(SELECT C_BPartner_ID FROM C_BPartner WHERE C_BP_Group_ID=").append(lines[i].getC_BP_Group_ID()).append(")"); // Sales Region if (lines[i].getC_SalesRegion_ID() != 0) - sql.append(" AND h.C_BPartner_Location_ID IN " - + "(SELECT C_BPartner_Location_ID FROM C_BPartner_Location WHERE C_SalesRegion_ID=").append(lines[i].getC_SalesRegion_ID()).append(")"); + sql.append(" AND h.C_BPartner_Location_ID IN ") + .append("(SELECT C_BPartner_Location_ID FROM C_BPartner_Location WHERE C_SalesRegion_ID=").append(lines[i].getC_SalesRegion_ID()).append(")"); // Product if (lines[i].getM_Product_ID() != 0) sql.append(" AND l.M_Product_ID=").append(lines[i].getM_Product_ID()); // Product Category if (lines[i].getM_Product_Category_ID() != 0) - sql.append(" AND l.M_Product_ID IN " - + "(SELECT M_Product_ID FROM M_Product WHERE M_Product_Category_ID=").append(lines[i].getM_Product_Category_ID()).append(")"); + sql.append(" AND l.M_Product_ID IN ") + .append("(SELECT M_Product_ID FROM M_Product WHERE M_Product_Category_ID=").append(lines[i].getM_Product_Category_ID()).append(")"); // Payment Rule if (lines[i].getPaymentRule() != null) sql.append(" AND h.PaymentRule='").append(lines[i].getPaymentRule()).append("'"); @@ -254,9 +254,9 @@ public class CommissionCalc extends SvrProcess // Save Last Run m_com.setDateLastRun (p_StartDate); m_com.saveEx(); - - return "@C_CommissionRun_ID@ = " + comRun.getDocumentNo() - + " - " + comRun.getDescription(); + StringBuilder msgreturn = new StringBuilder("@C_CommissionRun_ID@ = ").append(comRun.getDocumentNo()) + .append(" - ").append(comRun.getDescription()); + return msgreturn.toString(); } // doIt /** From 0347e6f4e8bdbb01f56a4bb41a0eb5f6f64c6c34 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 25 Sep 2012 13:51:07 -0500 Subject: [PATCH 16/79] IDEMPIERE-221 Implement password policies / Thanks to Juliana Corredor --- .../src/org/compiere/model/MPasswordRule.java | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/model/MPasswordRule.java b/org.adempiere.base/src/org/compiere/model/MPasswordRule.java index f4b7469304..0516bde83a 100644 --- a/org.adempiere.base/src/org/compiere/model/MPasswordRule.java +++ b/org.adempiere.base/src/org/compiere/model/MPasswordRule.java @@ -29,6 +29,7 @@ import java.util.Properties; import org.adempiere.exceptions.AdempiereException; import org.compiere.util.Env; import org.compiere.util.Msg; +import org.compiere.util.Util; import edu.vt.middleware.dictionary.ArrayWordList; import edu.vt.middleware.dictionary.WordListDictionary; @@ -64,7 +65,7 @@ public class MPasswordRule extends X_AD_PasswordRule { /** * */ - private static final long serialVersionUID = 7376091524332484101L; + private static final long serialVersionUID = 5454698615095632059L; /** * @param ctx @@ -93,6 +94,27 @@ public class MPasswordRule extends X_AD_PasswordRule { return pass; } + + @Override + protected boolean beforeSave (boolean newRecord) + { + if (isUsingDictionary()) { + StringBuilder msg = new StringBuilder(); + if (Util.isEmpty(getPathDictionary())) { + msg.append(Msg.getElement(getCtx(), COLUMNNAME_PathDictionary)); + } + if (getDictWordLength() <= 0) { + if (msg.length() > 0) + msg.append(", "); + msg.append(Msg.getElement(getCtx(), COLUMNNAME_DictWordLength)); + } + if (msg.length() > 0) { + log.saveError("FillMandatory", msg.toString()); + return false; + } + } + return true; + } public void validate(String username, String newPassword) throws AdempiereException { From 7863ff524c561a6b479a7decac9e076f3ed56550 Mon Sep 17 00:00:00 2001 From: Elaine Tan Date: Wed, 26 Sep 2012 16:09:53 +0800 Subject: [PATCH 17/79] IDEMPIERE-374 Change password must be changed to be a form instead of a process - revise save error message --- org.adempiere.base/src/org/compiere/model/MUser.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MUser.java b/org.adempiere.base/src/org/compiere/model/MUser.java index eea203901f..6e1da3ac82 100644 --- a/org.adempiere.base/src/org/compiere/model/MUser.java +++ b/org.adempiere.base/src/org/compiere/model/MUser.java @@ -902,7 +902,7 @@ public class MUser extends X_AD_User if (email_login && getPassword() != null && getPassword().length() > 0) { // email is mandatory for users with password if (getEMail() == null || getEMail().length() == 0) { - log.saveError("FillMandatory", Msg.getElement(getCtx(), COLUMNNAME_EMail)); + log.saveError("SaveError", Msg.getMsg(getCtx(), "FillMandatory") + Msg.getElement(getCtx(), COLUMNNAME_EMail)); return false; } // email with password must be unique on the same tenant @@ -910,7 +910,7 @@ public class MUser extends X_AD_User "SELECT COUNT(*) FROM AD_User WHERE Password IS NOT NULL AND EMail=? AND AD_Client_ID=? AND AD_User_ID!=?", getEMail(), getAD_Client_ID(), getAD_User_ID()); if (cnt > 0) { - log.saveError("SaveErrorNotUnique", Msg.getElement(getCtx(), COLUMNNAME_EMail)); + log.saveError("SaveError", Msg.getMsg(getCtx(), "SaveErrorNotUnique", true) + Msg.getElement(getCtx(), COLUMNNAME_EMail)); return false; } } From 5827730776a124218ab40daddd32c25925758c79 Mon Sep 17 00:00:00 2001 From: Nicolas Micoud Date: Mon, 30 Jul 2012 16:51:09 +0200 Subject: [PATCH 18/79] IDEMPIERE-319 - Enhancement for Map and Route buttons --- .../org/compiere/grid/ed/VLocationDialog.java | 25 +++++++++++++++++-- .../webui/window/WLocationDialog.java | 23 +++++++++++++++-- 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocationDialog.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocationDialog.java index 81435b0e81..a2c1bcea76 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocationDialog.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocationDialog.java @@ -498,7 +498,7 @@ public class VLocationDialog extends CDialog //BEGIN fernandinho/ricardo else if (e.getSource() == toLink) { - String urlString = MLocation.LOCATION_MAPS_URL_PREFIX + m_location.getMapsLocation(); + String urlString = MLocation.LOCATION_MAPS_URL_PREFIX + getFullAdress(); String message = null; try @@ -520,7 +520,7 @@ public class VLocationDialog extends CDialog String urlString = MLocation.LOCATION_MAPS_ROUTE_PREFIX + MLocation.LOCATION_MAPS_SOURCE_ADDRESS + orgLocation.getMapsLocation() + //org - MLocation.LOCATION_MAPS_DESTINATION_ADDRESS + m_location.getMapsLocation(); //partner + MLocation.LOCATION_MAPS_DESTINATION_ADDRESS + getFullAdress(); //partner String message = null; try { @@ -803,4 +803,25 @@ public class VLocationDialog extends CDialog } + /** returns a string that contains all fields of current form */ + String getFullAdress() + { + MRegion region = null; + + if (fRegion.getSelectedItem()!=null) + region = new MRegion(Env.getCtx(), ((MRegion)fRegion.getSelectedItem()).getC_Region_ID(), null); + + MCountry c = (MCountry)fCountry.getSelectedItem(); + + String address = ""; + address = address + (fAddress1.getText() != null ? fAddress1.getText() + ", " : ""); + address = address + (fAddress2.getText() != null ? fAddress2.getText() + ", " : ""); + address = address + (fCity.getText() != null ? fCity.getText() + ", " : ""); + if (region != null) + address = address + (region.getName() != null ? region.getName() + ", " : ""); + + address = address + (c.getName() != null ? c.getName() : ""); + return address.replace(" ", "+"); + } + } // VLocationDialog diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocationDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocationDialog.java index 2dbacd733f..f1ad945e2b 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocationDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocationDialog.java @@ -540,7 +540,7 @@ public class WLocationDialog extends Window implements EventListener } else if (toLink.equals(event.getTarget())) { - String urlString = MLocation.LOCATION_MAPS_URL_PREFIX + m_location.getMapsLocation(); + String urlString = MLocation.LOCATION_MAPS_URL_PREFIX + getFullAdress(); String message = null; try { Executions.getCurrent().sendRedirect(urlString, "_blank"); @@ -559,7 +559,7 @@ public class WLocationDialog extends Window implements EventListener String urlString = MLocation.LOCATION_MAPS_ROUTE_PREFIX + MLocation.LOCATION_MAPS_SOURCE_ADDRESS + orgLocation.getMapsLocation() + //org - MLocation.LOCATION_MAPS_DESTINATION_ADDRESS + m_location.getMapsLocation(); //partner + MLocation.LOCATION_MAPS_DESTINATION_ADDRESS + getFullAdress(); //partner String message = null; try { Executions.getCurrent().sendRedirect(urlString, "_blank"); @@ -700,5 +700,24 @@ public class WLocationDialog extends Window implements EventListener } super.dispose(); } + /** returns a string that contains all fields of current form */ + String getFullAdress() + { + MRegion region = null; + if (lstRegion.getSelectedItem()!=null) + region = new MRegion(Env.getCtx(), ((MRegion)lstRegion.getSelectedItem().getValue()).getC_Region_ID(), null); + + MCountry c = (MCountry)lstCountry.getSelectedItem().getValue(); + + String address = ""; + address = address + (txtAddress1.getText() != null ? txtAddress1.getText() + ", " : ""); + address = address + (txtAddress2.getText() != null ? txtAddress2.getText() + ", " : ""); + address = address + (txtCity.getText() != null ? txtCity.getText() + ", " : ""); + if (region != null) + address = address + (region.getName() != null ? region.getName() + ", " : ""); + + address = address + (c.getName() != null ? c.getName() : ""); + return address.replace(" ", "+"); + } } From e251dbbc26c9bba0e4633bda763603cd135f8f78 Mon Sep 17 00:00:00 2001 From: Nicolas Micoud Date: Wed, 12 Sep 2012 10:30:23 -0500 Subject: [PATCH 19/79] IDEMPIERE-229 - Bug with Process parameter range (Swing) --- .../src/org/compiere/apps/ProcessParameterPanel.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ProcessParameterPanel.java b/org.adempiere.ui.swing/src/org/compiere/apps/ProcessParameterPanel.java index 4bbfde4afd..cb36accfec 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ProcessParameterPanel.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/ProcessParameterPanel.java @@ -47,6 +47,7 @@ import org.compiere.swing.CPanel; import org.compiere.util.CLogger; import org.compiere.util.DB; import org.compiere.util.Env; +import org.compiere.util.Msg; /** * Process Parameter Panel, based on existing ProcessParameter dialog. @@ -529,6 +530,8 @@ public class ProcessParameterPanel extends CPanel implements VetoableChangeListe if (sb.length() > 0) sb.append(", "); sb.append(field.getHeader()); + if (m_vEditors2.get(i) != null) // is a range + sb.append(" (").append(Msg.getMsg(Env.getCtx(), "From")).append(")"); } else field.setError(false); @@ -536,15 +539,16 @@ public class ProcessParameterPanel extends CPanel implements VetoableChangeListe VEditor vEditor2 = (VEditor)m_vEditors2.get(i); if (vEditor2 != null) { - Object data2 = vEditor.getValue(); + Object data2 = vEditor2.getValue(); GridField field2 = (GridField)m_mFields2.get(i); if (data2 == null || data2.toString().length() == 0) { - field.setInserting (true); // set editable (i.e. updateable) otherwise deadlock + field2.setInserting (true); // set editable (i.e. updateable) otherwise deadlock field2.setError(true); if (sb.length() > 0) sb.append(", "); - sb.append(field.getHeader()); + sb.append(field2.getHeader()); + sb.append(" (").append(Msg.getMsg(Env.getCtx(), "To")).append(")"); } else field2.setError(false); From af759b7134863a4142fb8016878d164c444cccce Mon Sep 17 00:00:00 2001 From: Nicolas Micoud Date: Wed, 12 Sep 2012 10:37:48 -0500 Subject: [PATCH 20/79] IDEMPIERE-417 - Update BPLocation.Name --- .../org/compiere/model/MBPartnerLocation.java | 338 +++++++++--------- .../src/org/compiere/model/MLocation.java | 9 + 2 files changed, 182 insertions(+), 165 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MBPartnerLocation.java b/org.adempiere.base/src/org/compiere/model/MBPartnerLocation.java index 62b0a90ab5..07f54b9b06 100644 --- a/org.adempiere.base/src/org/compiere/model/MBPartnerLocation.java +++ b/org.adempiere.base/src/org/compiere/model/MBPartnerLocation.java @@ -20,18 +20,18 @@ import java.sql.ResultSet; import java.util.List; import java.util.Properties; - /** - * Partner Location Model - * - * @author Jorg Janke - * @version $Id: MBPartnerLocation.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $ - * @author Teo Sarca, www.arhipac.ro - *
  • FR [ 2788465 ] MBPartnerLocation.getForBPartner method add trxName - * https://sourceforge.net/tracker/index.php?func=detail&aid=2788465&group_id=176962&atid=879335 + * Partner Location Model + * + * @author Jorg Janke + * @version $Id: MBPartnerLocation.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $ + * @author Teo Sarca, www.arhipac.ro
  • FR [ 2788465 ] + * MBPartnerLocation.getForBPartner method add trxName + * https://sourceforge + * .net/tracker/index.php?func=detail&aid=2788465&group_id + * =176962&atid=879335 */ -public class MBPartnerLocation extends X_C_BPartner_Location -{ +public class MBPartnerLocation extends X_C_BPartner_Location { /** * */ @@ -39,148 +39,216 @@ public class MBPartnerLocation extends X_C_BPartner_Location /** * Get Locations for BPartner - * @param ctx context - * @param C_BPartner_ID bp + * + * @param ctx + * context + * @param C_BPartner_ID + * bp * @return array of locations - * @deprecated Since 3.5.3a. Please use {@link #getForBPartner(Properties, int, String)}. + * @deprecated Since 3.5.3a. Please use + * {@link #getForBPartner(Properties, int, String)}. */ - public static MBPartnerLocation[] getForBPartner (Properties ctx, int C_BPartner_ID) - { + public static MBPartnerLocation[] getForBPartner(Properties ctx, + int C_BPartner_ID) { return getForBPartner(ctx, C_BPartner_ID, null); } - + /** * Get Locations for BPartner - * @param ctx context - * @param C_BPartner_ID bp + * + * @param ctx + * context + * @param C_BPartner_ID + * bp * @param trxName * @return array of locations */ - public static MBPartnerLocation[] getForBPartner (Properties ctx, int C_BPartner_ID, String trxName) - { - List list = new Query(ctx, Table_Name, "C_BPartner_ID=?", trxName) - .setParameters(C_BPartner_ID) - .list(); - MBPartnerLocation[] retValue = new MBPartnerLocation[list.size ()]; - list.toArray (retValue); + public static MBPartnerLocation[] getForBPartner(Properties ctx, + int C_BPartner_ID, String trxName) { + List list = new Query(ctx, Table_Name, + "C_BPartner_ID=?", trxName).setParameters(C_BPartner_ID).list(); + MBPartnerLocation[] retValue = new MBPartnerLocation[list.size()]; + list.toArray(retValue); return retValue; - } // getForBPartner - + } // getForBPartner + /************************************************************************** - * Default Constructor - * @param ctx context - * @param C_BPartner_Location_ID id - * @param trxName transaction + * Default Constructor + * + * @param ctx + * context + * @param C_BPartner_Location_ID + * id + * @param trxName + * transaction */ - public MBPartnerLocation (Properties ctx, int C_BPartner_Location_ID, String trxName) - { - super (ctx, C_BPartner_Location_ID, trxName); - if (C_BPartner_Location_ID == 0) - { - setName ("."); + public MBPartnerLocation(Properties ctx, int C_BPartner_Location_ID, + String trxName) { + super(ctx, C_BPartner_Location_ID, trxName); + if (C_BPartner_Location_ID == 0) { + setName("."); // - setIsShipTo (true); - setIsRemitTo (true); - setIsPayFrom (true); - setIsBillTo (true); + setIsShipTo(true); + setIsRemitTo(true); + setIsPayFrom(true); + setIsBillTo(true); } - } // MBPartner_Location + } // MBPartner_Location /** - * BP Parent Constructor - * @param bp partner + * BP Parent Constructor + * + * @param bp + * partner */ - public MBPartnerLocation (MBPartner bp) - { - this (bp.getCtx(), 0, bp.get_TrxName()); + public MBPartnerLocation(MBPartner bp) { + this(bp.getCtx(), 0, bp.get_TrxName()); setClientOrg(bp); - // may (still) be 0 - set_ValueNoCheck ("C_BPartner_ID", new Integer(bp.getC_BPartner_ID())); - } // MBPartner_Location + // may (still) be 0 + set_ValueNoCheck("C_BPartner_ID", new Integer(bp.getC_BPartner_ID())); + } // MBPartner_Location /** - * Constructor from ResultSet row - * @param ctx context - * @param rs current row of result set to be loaded - * @param trxName transaction + * Constructor from ResultSet row + * + * @param ctx + * context + * @param rs + * current row of result set to be loaded + * @param trxName + * transaction */ - public MBPartnerLocation (Properties ctx, ResultSet rs, String trxName) - { + public MBPartnerLocation(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); - } // MBPartner_Location + } // MBPartner_Location + + /** Cached Location */ + private MLocation m_location = null; + /** Unique Name */ + private String m_uniqueName = null; + private int m_unique = 0; - /** Cached Location */ - private MLocation m_location = null; - /** Unique Name */ - private String m_uniqueName = null; - private int m_unique = 0; - /** - * Get Location/Address - * @param requery requery - * @return location + * Get Location/Address + * + * @param requery + * requery + * @return location */ - public MLocation getLocation (boolean requery) - { + public MLocation getLocation(boolean requery) { if (m_location == null) - m_location = MLocation.get (getCtx(), getC_Location_ID(), get_TrxName()); + m_location = MLocation.get(getCtx(), getC_Location_ID(), + get_TrxName()); return m_location; - } // getLoaction + } // getLoaction /** - * String Representation - * @return info + * String Representation + * + * @return info */ - public String toString () - { - StringBuffer sb = new StringBuffer ("MBPartner_Location[ID=") - .append(get_ID()) - .append(",C_Location_ID=").append(getC_Location_ID()) - .append(",Name=").append(getName()) - .append ("]"); - return sb.toString (); - } // toString + public String toString() { + StringBuffer sb = new StringBuffer("MBPartner_Location[ID=") + .append(get_ID()).append(",C_Location_ID=") + .append(getC_Location_ID()).append(",Name=").append(getName()) + .append("]"); + return sb.toString(); + } // toString - /************************************************************************** - * Before Save. - * - Set Name - * @param newRecord new - * @return save + * Before Save. - Set Name + * + * @param newRecord + * new + * @return save */ - protected boolean beforeSave (boolean newRecord) - { + protected boolean beforeSave(boolean newRecord) { if (getC_Location_ID() == 0) return false; - // Set New Name + // Set New Name if (!newRecord) return true; MLocation address = getLocation(true); + setName(getBPLocName(address)); + return true; + } // beforeSave + + /** + * Make name Unique + * + * @param address + * address + */ + private void makeUnique(MLocation address) { + m_uniqueName = ""; + + // 0 - City + if (m_unique >= 0 || m_uniqueName.length() == 0) { + String xx = address.getCity(); + if (xx != null && xx.length() > 0) + m_uniqueName = xx; + } + // 1 + Address1 + if (m_unique >= 1 || m_uniqueName.length() == 0) { + String xx = address.getAddress1(); + if (xx != null && xx.length() > 0) { + if (m_uniqueName.length() > 0) + m_uniqueName += " "; + m_uniqueName += xx; + } + } + // 2 + Address2 + if (m_unique >= 2 || m_uniqueName.length() == 0) { + String xx = address.getAddress2(); + if (xx != null && xx.length() > 0) { + if (m_uniqueName.length() > 0) + m_uniqueName += " "; + m_uniqueName += xx; + } + } + // 3 - Region + if (m_unique >= 3 || m_uniqueName.length() == 0) { + String xx = address.getRegionName(true); + if (xx != null && xx.length() > 0) { + if (m_uniqueName.length() > 0) + m_uniqueName += " "; + m_uniqueName += xx; + } + } + // 4 - ID + if (m_unique >= 4 || m_uniqueName.length() == 0) { + int id = get_ID(); + if (id == 0) + id = address.get_ID(); + m_uniqueName += "#" + id; + } + } // makeUnique + + public String getBPLocName(MLocation address) { m_uniqueName = getName(); - m_unique = MSysConfig.getIntValue(MSysConfig.START_VALUE_BPLOCATION_NAME, 0, getAD_Client_ID(), getAD_Org_ID()); + m_unique = MSysConfig.getIntValue("START_VALUE_BPLOCATION_NAME", 0, + getAD_Client_ID(), getAD_Org_ID()); if (m_unique < 0 || m_unique > 4) m_unique = 0; - if (m_uniqueName != null && m_uniqueName.equals(".")) { - // default + if (m_uniqueName != null) { // && m_uniqueName.equals(".")) { + // default m_uniqueName = null; makeUnique(address); } - - // Check uniqueness - MBPartnerLocation[] locations = getForBPartner(getCtx(), getC_BPartner_ID()); + + // Check uniqueness + MBPartnerLocation[] locations = getForBPartner(getCtx(), + getC_BPartner_ID()); boolean unique = locations.length == 0; - while (!unique) - { + while (!unique) { unique = true; - for (int i = 0; i < locations.length; i++) - { + for (int i = 0; i < locations.length; i++) { MBPartnerLocation location = locations[i]; if (location.getC_BPartner_Location_ID() == get_ID()) continue; - if (m_uniqueName.equals(location.getName())) - { - //m_uniqueName = null; + if (m_uniqueName.equals(location.getName())) { + // m_uniqueName = null; m_unique++; makeUnique(address); unique = false; @@ -188,67 +256,7 @@ public class MBPartnerLocation extends X_C_BPartner_Location } } } - setName (m_uniqueName); - return true; - } // beforeSave - - /** - * Make name Unique - * @param address address - */ - private void makeUnique (MLocation address) - { - - m_uniqueName = ""; + return m_uniqueName; + } - // 0 - City - if (m_unique >= 0 || m_uniqueName.length() == 0) - { - String xx = address.getCity(); - if (xx != null && xx.length() > 0) - m_uniqueName = xx; - } - // 1 + Address1 - if (m_unique >= 1 || m_uniqueName.length() == 0) - { - String xx = address.getAddress1(); - if (xx != null && xx.length() > 0) - { - if (m_uniqueName.length() > 0) - m_uniqueName += " "; - m_uniqueName += xx; - } - } - // 2 + Address2 - if (m_unique >= 2 || m_uniqueName.length() == 0) - { - String xx = address.getAddress2(); - if (xx != null && xx.length() > 0) - { - if (m_uniqueName.length() > 0) - m_uniqueName += " "; - m_uniqueName += xx; - } - } - // 3 - Region - if (m_unique >= 3 || m_uniqueName.length() == 0) - { - String xx = address.getRegionName(true); - if (xx != null && xx.length() > 0) - { - if (m_uniqueName.length() > 0) - m_uniqueName += " "; - m_uniqueName += xx; - } - } - // 4 - ID - if (m_unique >= 4 || m_uniqueName.length() == 0) - { - int id = get_ID(); - if (id == 0) - id = address.get_ID(); - m_uniqueName += "#" + id; - } - } // makeUnique - -} // MBPartnerLocation +} // MBPartnerLocation diff --git a/org.adempiere.base/src/org/compiere/model/MLocation.java b/org.adempiere.base/src/org/compiere/model/MLocation.java index 78d223b67a..7571b09589 100644 --- a/org.adempiere.base/src/org/compiere/model/MLocation.java +++ b/org.adempiere.base/src/org/compiere/model/MLocation.java @@ -654,6 +654,15 @@ public class MLocation extends X_C_Location implements Comparator MAccount.updateValueDescription(getCtx(), "(C_LocFrom_ID=" + getC_Location_ID() + " OR C_LocTo_ID=" + getC_Location_ID() + ")", get_TrxName()); + + //Update BP_Location name IDEMPIERE 417 + int bplID = DB.getSQLValueEx(get_TrxName(), "SELECT C_BPartner_Location_ID FROM C_BPartner_Location WHERE C_Location_ID = " + getC_Location_ID()); + if (bplID>0) + { + MBPartnerLocation bpl = new MBPartnerLocation(getCtx(), bplID, get_TrxName()); + bpl.setName(bpl.getBPLocName(this)); + bpl.saveEx(); + } return success; } // afterSave From d20678cab83be16356b41acd366cb4025508fa4f Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 12 Sep 2012 10:47:44 -0500 Subject: [PATCH 21/79] IDEMPIERE-417 Update BPLocation.Name --- .../org/compiere/model/MBPartnerLocation.java | 8 ++-- .../src/org/compiere/model/MLocation.java | 14 +++--- .../src/org/compiere/grid/ed/VLocation.java | 28 +++-------- .../org/compiere/grid/ed/VLocationDialog.java | 46 +++++++++++++++--- .../webui/editor/WLocationEditor.java | 10 +--- .../webui/window/WLocationDialog.java | 47 ++++++++++++++++--- 6 files changed, 99 insertions(+), 54 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MBPartnerLocation.java b/org.adempiere.base/src/org/compiere/model/MBPartnerLocation.java index 07f54b9b06..e4e5b48c20 100644 --- a/org.adempiere.base/src/org/compiere/model/MBPartnerLocation.java +++ b/org.adempiere.base/src/org/compiere/model/MBPartnerLocation.java @@ -167,10 +167,10 @@ public class MBPartnerLocation extends X_C_BPartner_Location { return false; // Set New Name - if (!newRecord) - return true; - MLocation address = getLocation(true); - setName(getBPLocName(address)); + if (".".equals(getName())) { + MLocation address = getLocation(true); + setName(getBPLocName(address)); + } return true; } // beforeSave diff --git a/org.adempiere.base/src/org/compiere/model/MLocation.java b/org.adempiere.base/src/org/compiere/model/MLocation.java index 7571b09589..d49e9d0c5d 100644 --- a/org.adempiere.base/src/org/compiere/model/MLocation.java +++ b/org.adempiere.base/src/org/compiere/model/MLocation.java @@ -656,12 +656,14 @@ public class MLocation extends X_C_Location implements Comparator + " OR C_LocTo_ID=" + getC_Location_ID() + ")", get_TrxName()); //Update BP_Location name IDEMPIERE 417 - int bplID = DB.getSQLValueEx(get_TrxName(), "SELECT C_BPartner_Location_ID FROM C_BPartner_Location WHERE C_Location_ID = " + getC_Location_ID()); - if (bplID>0) - { - MBPartnerLocation bpl = new MBPartnerLocation(getCtx(), bplID, get_TrxName()); - bpl.setName(bpl.getBPLocName(this)); - bpl.saveEx(); + if (get_TrxName().startsWith(PO.LOCAL_TRX_PREFIX)) { // saved without trx + int bplID = DB.getSQLValueEx(get_TrxName(), "SELECT C_BPartner_Location_ID FROM C_BPartner_Location WHERE C_Location_ID = " + getC_Location_ID()); + if (bplID>0) + { + MBPartnerLocation bpl = new MBPartnerLocation(getCtx(), bplID, get_TrxName()); + bpl.setName(bpl.getBPLocName(this)); + bpl.saveEx(); + } } return success; } // afterSave diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocation.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocation.java index 9cfc0a0e52..ec08b06d30 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocation.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocation.java @@ -353,7 +353,7 @@ public class VLocation extends JComponent // log.config( "actionPerformed - " + m_value); VLocationDialog ld = new VLocationDialog(AEnv.getFrame(this), - Msg.getMsg(Env.getCtx(), "Location"), m_value); + Msg.getMsg(Env.getCtx(), "Location"), m_value, m_GridField); ld.setVisible(true); Object oldValue = getValue(); m_value = ld.getValue(); @@ -364,27 +364,11 @@ public class VLocation extends JComponent return; // Data Binding - try - { - int C_Location_ID = 0; - if (m_value != null) - C_Location_ID = m_value.getC_Location_ID(); - Integer ii = new Integer(C_Location_ID); - - if (C_Location_ID != 0) - fireVetoableChange(m_columnName, oldValue, ii); - setValue(ii); - if (ii.equals(oldValue) && m_GridTab != null && m_GridField != null) - { - // force Change - user does not realize that embedded object is already saved. - m_GridTab.processFieldChange(m_GridField); - } - } - catch (PropertyVetoException pve) - { - log.log(Level.SEVERE, "VLocation.actionPerformed", pve); - } - + int C_Location_ID = 0; + if (m_value != null) + C_Location_ID = m_value.getC_Location_ID(); + Integer ii = new Integer(C_Location_ID); + setValue(ii); } // actionPerformed /** diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocationDialog.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocationDialog.java index 6926d2c89f..88152127eb 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocationDialog.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocationDialog.java @@ -39,6 +39,8 @@ import javax.swing.SwingConstants; import org.compiere.apps.ADialog; import org.compiere.apps.AEnv; import org.compiere.apps.ConfirmPanel; +import org.compiere.model.GridField; +import org.compiere.model.MBPartnerLocation; import org.compiere.model.MCountry; import org.compiere.model.MLocation; import org.compiere.model.MOrgInfo; @@ -50,8 +52,10 @@ import org.compiere.swing.CLabel; import org.compiere.swing.CPanel; import org.compiere.swing.CTextField; import org.compiere.util.CLogger; +import org.compiere.util.DB; import org.compiere.util.Env; import org.compiere.util.Msg; +import org.compiere.util.Trx; import com.akunagroup.uk.postcode.AddressLookupInterface; import com.akunagroup.uk.postcode.Postcode; @@ -90,6 +94,8 @@ public class VLocationDialog extends CDialog private int m_WindowNo = 0; + private GridField m_GridField = null; + /** * Constructor * @@ -99,7 +105,12 @@ public class VLocationDialog extends CDialog */ public VLocationDialog (Frame frame, String title, MLocation location) { + this(frame, title, location, null); + } // VLocationDialog + + public VLocationDialog(Frame frame, String title, MLocation location, GridField gridField) { super(frame, title, true); + m_GridField = gridField; //m_WindowNo = WindowNo; try { @@ -143,7 +154,7 @@ public class VLocationDialog extends CDialog fOnline.addActionListener(this); fRegion.addActionListener(this); AEnv.positionCenterWindow(frame, this); - } // VLocationDialog + } private boolean m_change = false; private MLocation m_location; @@ -574,6 +585,8 @@ public class VLocationDialog extends CDialog */ private boolean action_OK() { + Trx trx = Trx.get(Trx.createTrxName("VLocationDialog"), true); + m_location.set_TrxName(trx.getTrxName()); m_location.setAddress1(fAddress1.getText()); m_location.setAddress2(fAddress2.getText()); m_location.setAddress3(fAddress3.getText()); @@ -593,14 +606,35 @@ public class VLocationDialog extends CDialog else m_location.setC_Region_ID(0); // Save changes - if(m_location.save()) + boolean success = false; + if (m_location.save()) { - return true; + // IDEMPIERE-417 Force Update BPLocation.Name + if (m_GridField != null && m_GridField.getGridTab() != null + && "C_BPartner_Location".equals(m_GridField.getGridTab().getTableName())) + { + m_GridField.getGridTab().setValue("Name", "."); + success = true; + } else { + //Update BP_Location name IDEMPIERE 417 + int bplID = DB.getSQLValueEx(trx.getTrxName(), "SELECT C_BPartner_Location_ID FROM C_BPartner_Location WHERE C_Location_ID = " + m_location.getC_Location_ID()); + if (bplID>0) + { + MBPartnerLocation bpl = new MBPartnerLocation(Env.getCtx(), bplID, trx.getTrxName()); + bpl.setName(bpl.getBPLocName(m_location)); + if (bpl.save()) + success = true; + } + } } - else - { - return false; + if (success) { + trx.commit(); + } else { + trx.rollback(); } + trx.close(); + + return success; } // actionOK /** diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WLocationEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WLocationEditor.java index d2ca26b81c..e4043be53e 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WLocationEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WLocationEditor.java @@ -164,7 +164,7 @@ public class WLocationEditor extends WEditor implements EventListener, Pr if ("onClick".equals(event.getName())) { log.config( "actionPerformed - " + m_value); - final WLocationDialog ld = new WLocationDialog(Msg.getMsg(Env.getCtx(), "Location"), m_value); + final WLocationDialog ld = new WLocationDialog(Msg.getMsg(Env.getCtx(), "Location"), m_value, gridField); ld.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener() { @Override @@ -179,14 +179,6 @@ public class WLocationEditor extends WEditor implements EventListener, Pr if (m_value != null) C_Location_ID = m_value.getC_Location_ID(); Integer ii = new Integer(C_Location_ID); - // force Change - user does not realize that embedded object is already saved. - ValueChangeEvent valuechange = new ValueChangeEvent(WLocationEditor.this,getColumnName(),null,null); - fireValueChange(valuechange); // resets m_mLocation - if (C_Location_ID != 0) - { - ValueChangeEvent vc = new ValueChangeEvent(WLocationEditor.this,getColumnName(),null,ii); - fireValueChange(vc); - } setValue(ii); } }); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocationDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocationDialog.java index 33932ae62e..167adc8b94 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocationDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocationDialog.java @@ -36,13 +36,17 @@ import org.adempiere.webui.component.Panel; import org.adempiere.webui.component.Row; import org.adempiere.webui.component.Textbox; import org.adempiere.webui.component.Window; +import org.compiere.model.GridField; +import org.compiere.model.MBPartnerLocation; import org.compiere.model.MCountry; import org.compiere.model.MLocation; import org.compiere.model.MOrgInfo; import org.compiere.model.MRegion; import org.compiere.util.CLogger; +import org.compiere.util.DB; import org.compiere.util.Env; import org.compiere.util.Msg; +import org.compiere.util.Trx; import org.zkoss.zk.ui.Executions; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; @@ -125,10 +129,16 @@ public class WLocationDialog extends Window implements EventListener private Button toLink; private Button toRoute; + private GridField m_GridField = null; //END public WLocationDialog(String title, MLocation location) { + this (title, location, null); + } + + public WLocationDialog(String title, MLocation location, GridField gridField) { + m_GridField = gridField; m_location = location; if (m_location == null) m_location = new MLocation (Env.getCtx(), 0, null); @@ -511,7 +521,7 @@ public class WLocationDialog extends Window implements EventListener return; } - if(action_OK()) + if (action_OK()) { m_change = true; inOKAction = false; @@ -626,6 +636,8 @@ public class WLocationDialog extends Window implements EventListener */ private boolean action_OK() { + Trx trx = Trx.get(Trx.createTrxName("WLocationDialog"), true); + m_location.set_TrxName(trx.getTrxName()); m_location.setAddress1(txtAddress1.getValue()); m_location.setAddress2(txtAddress2.getValue()); m_location.setAddress3(txtAddress3.getValue()); @@ -645,15 +657,36 @@ public class WLocationDialog extends Window implements EventListener { m_location.setC_Region_ID(0); } - // Save chnages - if(m_location.save()) + // Save changes + boolean success = false; + if (m_location.save()) { - return true; + // IDEMPIERE-417 Force Update BPLocation.Name + if (m_GridField != null && m_GridField.getGridTab() != null + && "C_BPartner_Location".equals(m_GridField.getGridTab().getTableName())) + { + m_GridField.getGridTab().setValue("Name", "."); + success = true; + } else { + //Update BP_Location name IDEMPIERE 417 + int bplID = DB.getSQLValueEx(trx.getTrxName(), "SELECT C_BPartner_Location_ID FROM C_BPartner_Location WHERE C_Location_ID = " + m_location.getC_Location_ID()); + if (bplID>0) + { + MBPartnerLocation bpl = new MBPartnerLocation(Env.getCtx(), bplID, trx.getTrxName()); + bpl.setName(bpl.getBPLocName(m_location)); + if (bpl.save()) + success = true; + } + } } - else - { - return false; + if (success) { + trx.commit(); + } else { + trx.rollback(); } + trx.close(); + + return success; } // actionOK @Override From de3f840d0a0423114c967c18d311a692c628cfa2 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 12 Sep 2012 11:04:59 -0500 Subject: [PATCH 22/79] IDEMPIERE-417 Update BPLocation.Name --- .../src/org/compiere/grid/ed/VLocation.java | 20 ++++++++++++++----- .../org/compiere/grid/ed/VLocationDialog.java | 2 ++ .../webui/editor/WLocationEditor.java | 8 ++++++++ .../webui/window/WLocationDialog.java | 2 ++ 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocation.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocation.java index ec08b06d30..26d2bb5f3a 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocation.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocation.java @@ -364,11 +364,21 @@ public class VLocation extends JComponent return; // Data Binding - int C_Location_ID = 0; - if (m_value != null) - C_Location_ID = m_value.getC_Location_ID(); - Integer ii = new Integer(C_Location_ID); - setValue(ii); + try + { + int C_Location_ID = 0; + if (m_value != null) + C_Location_ID = m_value.getC_Location_ID(); + Integer ii = new Integer(C_Location_ID); + + if (C_Location_ID != 0) + fireVetoableChange(m_columnName, oldValue, ii); + setValue(ii); + } + catch (PropertyVetoException pve) + { + log.log(Level.SEVERE, "VLocation.actionPerformed", pve); + } } // actionPerformed /** diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocationDialog.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocationDialog.java index 88152127eb..81435b0e81 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocationDialog.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocationDialog.java @@ -624,6 +624,8 @@ public class VLocationDialog extends CDialog bpl.setName(bpl.getBPLocName(m_location)); if (bpl.save()) success = true; + } else { + success = true; } } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WLocationEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WLocationEditor.java index e4043be53e..ec87df8043 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WLocationEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WLocationEditor.java @@ -179,6 +179,14 @@ public class WLocationEditor extends WEditor implements EventListener, Pr if (m_value != null) C_Location_ID = m_value.getC_Location_ID(); Integer ii = new Integer(C_Location_ID); + // force Change - user does not realize that embedded object is already saved. + ValueChangeEvent valuechange = new ValueChangeEvent(WLocationEditor.this,getColumnName(),null,null); + fireValueChange(valuechange); // resets m_mLocation + if (C_Location_ID != 0) + { + ValueChangeEvent vc = new ValueChangeEvent(WLocationEditor.this,getColumnName(),null,ii); + fireValueChange(vc); + } setValue(ii); } }); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocationDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocationDialog.java index 167adc8b94..2dbacd733f 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocationDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocationDialog.java @@ -676,6 +676,8 @@ public class WLocationDialog extends Window implements EventListener bpl.setName(bpl.getBPLocName(m_location)); if (bpl.save()) success = true; + } else { + success = true; } } } From 308e056b95d00a788f8368c54f9a1d969ec6255b Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 12 Sep 2012 18:54:19 -0500 Subject: [PATCH 23/79] Fixed 'IsSOTrx' context for window / noticed from revision 3e74fe09f8cf that is required both times - before setting the tabs and after setSelectedIndex that reset the variable --- .../org/adempiere/webui/panel/AbstractADWindowPanel.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java index 7db0b7384b..f5157ea0ca 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java @@ -310,7 +310,8 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To gridWindow = new GridWindow(gWindowVO, true); title = gridWindow.getName(); - // Set AutoNew for Window + // Set SO/AutoNew for Window + Env.setContext(ctx, curWindowNo, "IsSOTrx", gridWindow.isSOTrx()); if (!autoNew && gridWindow.isTransaction()) { Env.setAutoNew(ctx, curWindowNo, true); @@ -360,8 +361,8 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To curTabIndex = 0; adTab.setSelectedIndex(0); - // all fields context for window is clear at AbstractADTab.prepareContext, set IsSOTrx for window - Env.setContext(ctx, curWindowNo, "IsSOTrx", gridWindow.isSOTrx()); + // all fields context for window is clear at AbstractADTab.prepareContext, set again IsSOTrx for window + Env.setContext(ctx, curWindowNo, "IsSOTrx", gridWindow.isSOTrx()); toolbar.enableTabNavigation(adTab.getTabCount() > 1); toolbar.enableFind(true); adTab.evaluate(null); From 7f85ffeaf8a71be8804374db0ea86a6653ac726f Mon Sep 17 00:00:00 2001 From: Juliana Corredor Date: Wed, 12 Sep 2012 19:23:38 -0500 Subject: [PATCH 24/79] IDEMPIERE-366 Improve Role Inheritance --- .../oracle/899-IDEMPIERE-366.sql | 368 ++++++++++++++++++ .../postgresql/899-IDEMPIERE-366.sql | 365 +++++++++++++++++ .../src/org/compiere/model/MRole.java | 248 ++++++++---- .../src/org/compiere/util/Login.java | 1 + .../src/compiere/model/MyValidator.java | 6 +- 5 files changed, 907 insertions(+), 81 deletions(-) create mode 100644 migration/360lts-release/oracle/899-IDEMPIERE-366.sql create mode 100644 migration/360lts-release/postgresql/899-IDEMPIERE-366.sql diff --git a/migration/360lts-release/oracle/899-IDEMPIERE-366.sql b/migration/360lts-release/oracle/899-IDEMPIERE-366.sql new file mode 100644 index 0000000000..5381d6f9ef --- /dev/null +++ b/migration/360lts-release/oracle/899-IDEMPIERE-366.sql @@ -0,0 +1,368 @@ +-- Sep 4, 2012 10:34:50 AM COT +-- Element Master Role +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('IsMasterRole',200117,'D','MasterRole','MasterRole','4bad6035-f81b-4e25-81d9-bbf55b099113',0,TO_DATE('2012-09-04 10:34:49','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-04 10:34:49','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Sep 4, 2012 10:34:50 AM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200117 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 4, 2012 10:36:19 AM COT +-- Column master Role +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection,DefaultValue) VALUES (0,156,200410,'D','Y','N','N',0,'N',1,'N',20,'N','N',200117,'N','Y','5ec60b3e-f1a7-447c-a7ea-f3575dcb24d4','N','Y','N','IsMasterRole','MasterRole','Y',100,TO_DATE('2012-09-04 10:36:18','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-04 10:36:18','YYYY-MM-DD HH24:MI:SS'),100,0,0,'N') +; + +-- Sep 4, 2012 10:36:19 AM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200410 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + + +-- Sep 4, 2012 10:37:58 AM COT +-- Field Master Role +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',119,1,'N','N',200410,'Y',200411,'N','D','MasterRole','Y','N','b57a3894-98be-44fa-a834-6883c8824d92',100,0,TO_DATE('2012-09-04 10:37:58','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-04 10:37:58','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 4, 2012 10:37:58 AM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200411 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 4, 2012 10:38:27 AM COT +-- seq +UPDATE AD_Field SET SeqNo=440,IsDisplayed='Y' WHERE AD_Field_ID=200411 +; + +-- Sep 4, 2012 10:38:40 AM COT +-- Position web +UPDATE AD_Field SET XPosition=2,Updated=TO_DATE('2012-09-04 10:38:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200411 +; + + +-- Sep 4, 2012 4:12:10 PM COT +-- Validation for just Master Role in included roles +INSERT INTO AD_Val_Rule (Code,AD_Val_Rule_ID,EntityType,Name,Type,AD_Val_Rule_UU,CreatedBy,UpdatedBy,Updated,Created,AD_Client_ID,IsActive,AD_Org_ID) VALUES ('AD_Role.IsMasterRole=''Y''',200006,'D','MasterRoles','S','5d5fa599-0937-4e88-905b-b0814fc7fc84',100,100,TO_DATE('2012-09-04 16:12:08','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-04 16:12:08','YYYY-MM-DD HH24:MI:SS'),0,'Y',0) +; + + +-- Sep 4, 2012 4:13:06 PM COT +UPDATE AD_Column SET AD_Val_Rule_ID=200006, IsUpdateable='N',Updated=TO_DATE('2012-09-04 16:13:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=57949 +; + +-- Sep 4, 2012 4:55:32 PM COT +-- Display Logic Window Role +UPDATE AD_Tab SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-04 16:55:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=351 +; + +-- Sep 4, 2012 4:55:40 PM COT +-- Display Logic Window Role +UPDATE AD_Tab SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-04 16:55:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=120 +; + +-- Sep 4, 2012 4:55:53 PM COT +-- Display Logic Window Role +UPDATE AD_Tab SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-04 16:55:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=53240 +; + +-- Sep 5, 2012 2:26:43 PM COT +-- Roles are manual for default +UPDATE AD_Column SET DefaultValue='Y',Updated=TO_DATE('2012-09-05 14:26:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=9593 +; + +-- Sep 11, 2012 6:56:24 PM COT +ALTER TABLE AD_Role ADD IsMasterRole CHAR(1) DEFAULT 'N' CHECK (IsMasterRole IN ('Y','N')) NOT NULL +; + +-- Sep 11, 2012 6:56:46 PM COT +ALTER TABLE AD_Role MODIFY IsManual CHAR(1) DEFAULT 'Y' +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=200411 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=930 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=931 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=59592 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=59591 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=130,IsDisplayed='Y' WHERE AD_Field_ID=10126 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=140,IsDisplayed='Y' WHERE AD_Field_ID=52018 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=8740 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=5227 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=11006 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=11003 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=190,IsDisplayed='Y' WHERE AD_Field_ID=11002 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=200,IsDisplayed='Y' WHERE AD_Field_ID=8311 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=210,IsDisplayed='Y' WHERE AD_Field_ID=10813 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=220,IsDisplayed='Y' WHERE AD_Field_ID=11256 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=230,IsDisplayed='Y' WHERE AD_Field_ID=11257 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=240,IsDisplayed='Y' WHERE AD_Field_ID=8313 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=250,IsDisplayed='Y' WHERE AD_Field_ID=8314 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=260,IsDisplayed='Y' WHERE AD_Field_ID=8312 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=270,IsDisplayed='Y' WHERE AD_Field_ID=8310 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=280,IsDisplayed='Y' WHERE AD_Field_ID=12367 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=290,IsDisplayed='Y' WHERE AD_Field_ID=12368 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=300,IsDisplayed='Y' WHERE AD_Field_ID=12641 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=310,IsDisplayed='Y' WHERE AD_Field_ID=200071 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=320,IsDisplayed='Y' WHERE AD_Field_ID=50168 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=330,IsDisplayed='Y' WHERE AD_Field_ID=50169 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=340,IsDisplayed='Y' WHERE AD_Field_ID=50170 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=350,IsDisplayed='Y' WHERE AD_Field_ID=50171 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=360,IsDisplayed='Y' WHERE AD_Field_ID=50172 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=370,IsDisplayed='Y' WHERE AD_Field_ID=50173 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=380,IsDisplayed='Y' WHERE AD_Field_ID=50174 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=390,IsDisplayed='Y' WHERE AD_Field_ID=50175 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=400,IsDisplayed='Y' WHERE AD_Field_ID=50176 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=410,IsDisplayed='Y' WHERE AD_Field_ID=50177 +; + +-- Sep 11, 2012 8:39:23 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=420,IsDisplayed='Y' WHERE AD_Field_ID=50178 +; + +-- Sep 11, 2012 8:39:23 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=430,IsDisplayed='Y' WHERE AD_Field_ID=55432 +; + +-- Sep 11, 2012 8:39:23 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=440,IsDisplayed='Y' WHERE AD_Field_ID=55433 +; + +-- Sep 11, 2012 8:43:59 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Element SET Name='Master Role', Description='A master role cannot be assigned to users, it is intended to define access to menu option and documents and inherit to other roles', PrintName='Master Role',Updated=TO_DATE('2012-09-11 20:43:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=200117 +; + +-- Sep 11, 2012 8:43:59 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=200117 +; + +-- Sep 11, 2012 8:43:59 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Column SET ColumnName='IsMasterRole', Name='Master Role', Description='A master role cannot be assigned to users, it is intended to define access to menu option and documents and inherit to other roles', Help=NULL WHERE AD_Element_ID=200117 +; + +-- Sep 11, 2012 8:43:59 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Process_Para SET ColumnName='IsMasterRole', Name='Master Role', Description='A master role cannot be assigned to users, it is intended to define access to menu option and documents and inherit to other roles', Help=NULL, AD_Element_ID=200117 WHERE UPPER(ColumnName)='ISMASTERROLE' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL +; + +-- Sep 11, 2012 8:43:59 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Process_Para SET ColumnName='IsMasterRole', Name='Master Role', Description='A master role cannot be assigned to users, it is intended to define access to menu option and documents and inherit to other roles', Help=NULL WHERE AD_Element_ID=200117 AND IsCentrallyMaintained='Y' +; + +-- Sep 11, 2012 8:43:59 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET Name='Master Role', Description='A master role cannot be assigned to users, it is intended to define access to menu option and documents and inherit to other roles', Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=200117) AND IsCentrallyMaintained='Y' +; + +-- Sep 11, 2012 8:43:59 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_PrintFormatItem pi SET PrintName='Master Role', Name='Master Role' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=200117) +; + +-- Sep 11, 2012 10:48:11 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''GLJ'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_DATE('2012-09-11 22:48:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=102 +; + +-- Sep 12, 2012 11:38:13 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARI'', ''API'',''ARC'',''APC'') AND C_DocType.IsSOTrx=''@IsSOTrx@'' AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_DATE('2012-09-12 11:38:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=124 +; + + +-- Sep 12, 2012 11:40:18 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''GLD'' AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_DATE('2012-09-12 11:40:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=121 +; + +-- Sep 12, 2012 11:41:16 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARI'', ''API'',''ARC'',''APC'') AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_DATE('2012-09-12 11:41:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=173 +; + +-- Sep 12, 2012 11:41:30 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''MMI'' AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_DATE('2012-09-12 11:41:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=209 +; + +-- Sep 12, 2012 11:41:39 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''MMR'') AND IsSOTrx=''N'' AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_DATE('2012-09-12 11:41:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52054 +; + + +-- Sep 12, 2012 11:41:55 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''MMR'', ''MMS'') AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_DATE('2012-09-12 11:41:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=125 +; + +-- Sep 12, 2012 11:42:02 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''MMM'' AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_DATE('2012-09-12 11:42:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=201 +; + +-- Sep 12, 2012 11:42:08 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''DOO'' AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_DATE('2012-09-12 11:42:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52004 +; + +-- Sep 12, 2012 11:42:16 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''SOO'', ''POO'') AND C_DocType.DocSubTypeSO=''RM'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@ AND IsSOTrx=''N'' AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_DATE('2012-09-12 11:42:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52066 +; + + +-- Sep 12, 2012 6:20:08 PM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''MMI'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_DATE('2012-09-12 18:20:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=209 +; + + +-- Sep 12, 2012 6:28:44 PM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARR'', ''APP'') AND AD_Client_ID=@AD_Client_ID@',Updated=TO_DATE('2012-09-12 18:28:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=149 +; + + +UPDATE AD_System + SET LastMigrationScriptApplied='899_IDEMPIERE_366.sql' +WHERE LastMigrationScriptApplied<'899_IDEMPIERE_366.sql' + OR LastMigrationScriptApplied IS NULL +; + diff --git a/migration/360lts-release/postgresql/899-IDEMPIERE-366.sql b/migration/360lts-release/postgresql/899-IDEMPIERE-366.sql new file mode 100644 index 0000000000..3257868f03 --- /dev/null +++ b/migration/360lts-release/postgresql/899-IDEMPIERE-366.sql @@ -0,0 +1,365 @@ +-- Sep 4, 2012 10:34:50 AM COT +-- Element Master Role +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('IsMasterRole',200117,'D','MasterRole','MasterRole','4bad6035-f81b-4e25-81d9-bbf55b099113',0,TO_TIMESTAMP('2012-09-04 10:34:49','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-04 10:34:49','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Sep 4, 2012 10:34:50 AM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200117 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 4, 2012 10:36:19 AM COT +-- Column master Role +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection,DefaultValue) VALUES (0,156,200410,'D','Y','N','N',0,'N',1,'N',20,'N','N',200117,'N','Y','5ec60b3e-f1a7-447c-a7ea-f3575dcb24d4','N','Y','N','IsMasterRole','MasterRole','Y',100,TO_TIMESTAMP('2012-09-04 10:36:18','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-04 10:36:18','YYYY-MM-DD HH24:MI:SS'),100,0,0,'N') +; + +-- Sep 4, 2012 10:36:19 AM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200410 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 4, 2012 10:37:58 AM COT +-- Field Master Role +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',119,1,'N','N',200410,'Y',200411,'N','D','MasterRole','Y','N','b57a3894-98be-44fa-a834-6883c8824d92',100,0,TO_TIMESTAMP('2012-09-04 10:37:58','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-04 10:37:58','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 4, 2012 10:37:58 AM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200411 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 4, 2012 10:38:27 AM COT +-- seq +UPDATE AD_Field SET SeqNo=440,IsDisplayed='Y' WHERE AD_Field_ID=200411 +; + +-- Sep 4, 2012 10:38:40 AM COT +-- Position web +UPDATE AD_Field SET XPosition=2,Updated=TO_TIMESTAMP('2012-09-04 10:38:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200411 +; + +-- Sep 4, 2012 4:12:10 PM COT +-- Validation for just Master Role in included roles +INSERT INTO AD_Val_Rule (Code,AD_Val_Rule_ID,EntityType,Name,Type,AD_Val_Rule_UU,CreatedBy,UpdatedBy,Updated,Created,AD_Client_ID,IsActive,AD_Org_ID) VALUES ('AD_Role.IsMasterRole=''Y''',200006,'D','MasterRoles','S','5d5fa599-0937-4e88-905b-b0814fc7fc84',100,100,TO_TIMESTAMP('2012-09-04 16:12:08','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-04 16:12:08','YYYY-MM-DD HH24:MI:SS'),0,'Y',0) +; + +-- Sep 4, 2012 4:13:06 PM COT +UPDATE AD_Column SET AD_Val_Rule_ID=200006, IsUpdateable='N',Updated=TO_TIMESTAMP('2012-09-04 16:13:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=57949 +; + +-- Sep 4, 2012 4:55:32 PM COT +-- Display Logic Window Role +UPDATE AD_Tab SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-04 16:55:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=351 +; + +-- Sep 4, 2012 4:55:40 PM COT +-- Display Logic Window Role +UPDATE AD_Tab SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-04 16:55:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=120 +; + +-- Sep 4, 2012 4:55:53 PM COT +-- Display Logic Window Role +UPDATE AD_Tab SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-04 16:55:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=53240 +; + + +-- Sep 5, 2012 2:26:43 PM COT +-- Roles are manual for default +UPDATE AD_Column SET DefaultValue='Y',Updated=TO_TIMESTAMP('2012-09-05 14:26:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=9593 +; + +-- Sep 11, 2012 6:56:24 PM COT +ALTER TABLE AD_Role ADD COLUMN IsMasterRole CHAR(1) DEFAULT 'N' CHECK (IsMasterRole IN ('Y','N')) NOT NULL +; + +-- Sep 11, 2012 6:56:46 PM COT +INSERT INTO t_alter_column values('ad_role','IsManual','CHAR(1)','not null','Y') +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=200411 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=930 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=931 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=59592 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=59591 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=130,IsDisplayed='Y' WHERE AD_Field_ID=10126 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=140,IsDisplayed='Y' WHERE AD_Field_ID=52018 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=8740 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=5227 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=11006 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=11003 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=190,IsDisplayed='Y' WHERE AD_Field_ID=11002 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=200,IsDisplayed='Y' WHERE AD_Field_ID=8311 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=210,IsDisplayed='Y' WHERE AD_Field_ID=10813 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=220,IsDisplayed='Y' WHERE AD_Field_ID=11256 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=230,IsDisplayed='Y' WHERE AD_Field_ID=11257 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=240,IsDisplayed='Y' WHERE AD_Field_ID=8313 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=250,IsDisplayed='Y' WHERE AD_Field_ID=8314 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=260,IsDisplayed='Y' WHERE AD_Field_ID=8312 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=270,IsDisplayed='Y' WHERE AD_Field_ID=8310 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=280,IsDisplayed='Y' WHERE AD_Field_ID=12367 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=290,IsDisplayed='Y' WHERE AD_Field_ID=12368 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=300,IsDisplayed='Y' WHERE AD_Field_ID=12641 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=310,IsDisplayed='Y' WHERE AD_Field_ID=200071 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=320,IsDisplayed='Y' WHERE AD_Field_ID=50168 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=330,IsDisplayed='Y' WHERE AD_Field_ID=50169 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=340,IsDisplayed='Y' WHERE AD_Field_ID=50170 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=350,IsDisplayed='Y' WHERE AD_Field_ID=50171 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=360,IsDisplayed='Y' WHERE AD_Field_ID=50172 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=370,IsDisplayed='Y' WHERE AD_Field_ID=50173 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=380,IsDisplayed='Y' WHERE AD_Field_ID=50174 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=390,IsDisplayed='Y' WHERE AD_Field_ID=50175 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=400,IsDisplayed='Y' WHERE AD_Field_ID=50176 +; + +-- Sep 11, 2012 8:39:22 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=410,IsDisplayed='Y' WHERE AD_Field_ID=50177 +; + +-- Sep 11, 2012 8:39:23 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=420,IsDisplayed='Y' WHERE AD_Field_ID=50178 +; + +-- Sep 11, 2012 8:39:23 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=430,IsDisplayed='Y' WHERE AD_Field_ID=55432 +; + +-- Sep 11, 2012 8:39:23 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET SeqNo=440,IsDisplayed='Y' WHERE AD_Field_ID=55433 +; + +-- Sep 11, 2012 8:43:59 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Element SET Name='Master Role', Description='A master role cannot be assigned to users, it is intended to define access to menu option and documents and inherit to other roles', PrintName='Master Role',Updated=TO_TIMESTAMP('2012-09-11 20:43:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=200117 +; + +-- Sep 11, 2012 8:43:59 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=200117 +; + +-- Sep 11, 2012 8:43:59 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Column SET ColumnName='IsMasterRole', Name='Master Role', Description='A master role cannot be assigned to users, it is intended to define access to menu option and documents and inherit to other roles', Help=NULL WHERE AD_Element_ID=200117 +; + +-- Sep 11, 2012 8:43:59 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Process_Para SET ColumnName='IsMasterRole', Name='Master Role', Description='A master role cannot be assigned to users, it is intended to define access to menu option and documents and inherit to other roles', Help=NULL, AD_Element_ID=200117 WHERE UPPER(ColumnName)='ISMASTERROLE' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL +; + +-- Sep 11, 2012 8:43:59 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Process_Para SET ColumnName='IsMasterRole', Name='Master Role', Description='A master role cannot be assigned to users, it is intended to define access to menu option and documents and inherit to other roles', Help=NULL WHERE AD_Element_ID=200117 AND IsCentrallyMaintained='Y' +; + +-- Sep 11, 2012 8:43:59 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Field SET Name='Master Role', Description='A master role cannot be assigned to users, it is intended to define access to menu option and documents and inherit to other roles', Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=200117) AND IsCentrallyMaintained='Y' +; + +-- Sep 11, 2012 8:43:59 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_PrintFormatItem SET PrintName='Master Role', Name='Master Role' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=AD_PrintFormatItem.AD_Column_ID AND c.AD_Element_ID=200117) +; + +-- Sep 11, 2012 10:48:11 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''GLJ'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-11 22:48:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=102 +; + +-- Sep 12, 2012 11:38:13 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARI'', ''API'',''ARC'',''APC'') AND C_DocType.IsSOTrx=''@IsSOTrx@'' AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_TIMESTAMP('2012-09-12 11:38:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=124 +; + + +-- Sep 12, 2012 11:40:18 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''GLD'' AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_TIMESTAMP('2012-09-12 11:40:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=121 +; + +-- Sep 12, 2012 11:41:16 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARI'', ''API'',''ARC'',''APC'') AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_TIMESTAMP('2012-09-12 11:41:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=173 +; + +-- Sep 12, 2012 11:41:30 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''MMI'' AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_TIMESTAMP('2012-09-12 11:41:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=209 +; + +-- Sep 12, 2012 11:41:39 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''MMR'') AND IsSOTrx=''N'' AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_TIMESTAMP('2012-09-12 11:41:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52054 +; + +-- Sep 12, 2012 11:41:55 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''MMR'', ''MMS'') AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_TIMESTAMP('2012-09-12 11:41:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=125 +; + +-- Sep 12, 2012 11:42:02 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''MMM'' AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_TIMESTAMP('2012-09-12 11:42:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=201 +; + +-- Sep 12, 2012 11:42:08 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''DOO'' AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_TIMESTAMP('2012-09-12 11:42:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52004 +; + +-- Sep 12, 2012 11:42:16 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''SOO'', ''POO'') AND C_DocType.DocSubTypeSO=''RM'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@ AND IsSOTrx=''N'' AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_TIMESTAMP('2012-09-12 11:42:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52066 +; + + +-- Sep 12, 2012 6:20:08 PM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''MMI'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-12 18:20:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=209 +; + +-- Sep 12, 2012 6:28:44 PM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARR'', ''APP'') AND AD_Client_ID=@AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-12 18:28:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=149 +; + + + +UPDATE AD_System + SET LastMigrationScriptApplied='899_IDEMPIERE_366.sql' +WHERE LastMigrationScriptApplied<'899_IDEMPIERE_366.sql' + OR LastMigrationScriptApplied IS NULL +; + diff --git a/org.adempiere.base/src/org/compiere/model/MRole.java b/org.adempiere.base/src/org/compiere/model/MRole.java index 871e5e394b..8717c5ca17 100644 --- a/org.adempiere.base/src/org/compiere/model/MRole.java +++ b/org.adempiere.base/src/org/compiere/model/MRole.java @@ -16,6 +16,9 @@ *****************************************************************************/ package org.compiere.model; +import static org.compiere.model.SystemIDs.USER_SUPERUSER; +import static org.compiere.model.SystemIDs.USER_SYSTEM; + import java.io.Serializable; import java.lang.reflect.Array; import java.sql.PreparedStatement; @@ -27,10 +30,10 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.Map.Entry; import java.util.Properties; import java.util.Set; import java.util.Vector; -import java.util.Map.Entry; import java.util.logging.Level; import org.adempiere.exceptions.AdempiereException; @@ -42,7 +45,6 @@ import org.compiere.util.Ini; import org.compiere.util.KeyNamePair; import org.compiere.util.Msg; import org.compiere.util.Trace; -import static org.compiere.model.SystemIDs.*; /** * Role Model. @@ -60,7 +62,7 @@ public final class MRole extends X_AD_Role /** * */ - private static final long serialVersionUID = 3684323160980498188L; + private static final long serialVersionUID = 2716871587637082891L; /** * Get Default (Client) Role @@ -1467,7 +1469,9 @@ public final class MRole extends X_AD_Role if (m_windowAccess == null) { m_windowAccess = new HashMap(100); - + // first get the window access from the included and substitute roles + mergeIncludedAccess("m_windowAccess"); // Load included accesses - metas-2009_0021_AP1_G94 + // and now get the window access directly from this role MClient client = MClient.get(getCtx(), getAD_Client_ID()); String ASPFilter = ""; if (client.isUseASP()) @@ -1504,16 +1508,26 @@ public final class MRole extends X_AD_Role + " AND ce.AD_Tab_ID IS NULL " + " AND ce.AD_Field_ID IS NULL " + " AND ce.ASP_Status = 'H')"; // Hide - String sql = "SELECT AD_Window_ID, IsReadWrite FROM AD_Window_Access WHERE AD_Role_ID=? AND IsActive='Y'" + ASPFilter; + String sql = "SELECT AD_Window_ID, IsReadWrite, IsActive FROM AD_Window_Access WHERE AD_Role_ID=?" + ASPFilter; PreparedStatement pstmt = null; ResultSet rs = null; + HashMap directAccess = new HashMap(100); try { pstmt = DB.prepareStatement(sql, get_TrxName()); pstmt.setInt(1, getAD_Role_ID()); rs = pstmt.executeQuery(); - while (rs.next()) - m_windowAccess.put(new Integer(rs.getInt(1)), new Boolean("Y".equals(rs.getString(2)))); + while (rs.next()) { + Integer winId = new Integer(rs.getInt(1)); + if ("N".equals(rs.getString(3))) { + // inactive window on direct access + if (m_windowAccess.containsKey(winId)) { + m_windowAccess.remove(winId); + } + } else { + directAccess.put(winId, new Boolean("Y".equals(rs.getString(2)))); + } + } } catch (Exception e) { @@ -1524,23 +1538,11 @@ public final class MRole extends X_AD_Role DB.close(rs, pstmt); } // + setAccessMap("m_windowAccess", mergeAccess(getAccessMap("m_windowAccess"), directAccess, true)); log.fine("#" + m_windowAccess.size()); - mergeIncludedAccess("m_windowAccess"); // Load included accesses - metas-2009_0021_AP1_G94 } // reload Boolean retValue = m_windowAccess.get(AD_Window_ID); - // - // Check included roles - metas-2009_0021_AP1_G94 - if (retValue == null) - { - for (MRole includedRole : getIncludedRoles(false)) - { - retValue = includedRole.getWindowAccess(AD_Window_ID); - if (retValue != null) - break; - } - } - // - // log.fine("getWindowAccess - AD_Window_ID=" + AD_Window_ID + " - " + retValue); + log.fine("getWindowAccess - AD_Window_ID=" + AD_Window_ID + " - " + retValue); return retValue; } // getWindowAccess @@ -1554,7 +1556,9 @@ public final class MRole extends X_AD_Role if (m_processAccess == null) { m_processAccess = new HashMap(50); - + // first get the process access from the included and substitute roles + mergeIncludedAccess("m_processAccess"); // Load included accesses - metas-2009_0021_AP1_G94 + // and now get the process access directly from this role MClient client = MClient.get(getCtx(), getAD_Client_ID()); String ASPFilter = ""; if (client.isUseASP()) @@ -1589,16 +1593,26 @@ public final class MRole extends X_AD_Role + " AND ce.AD_Process_ID IS NOT NULL " + " AND ce.AD_Process_Para_ID IS NULL " + " AND ce.ASP_Status = 'H')"; // Hide - String sql = "SELECT AD_Process_ID, IsReadWrite FROM AD_Process_Access WHERE AD_Role_ID=? AND IsActive='Y'" + ASPFilter; + String sql = "SELECT AD_Process_ID, IsReadWrite, IsActive FROM AD_Process_Access WHERE AD_Role_ID=?" + ASPFilter; PreparedStatement pstmt = null; ResultSet rs = null; + HashMap directAccess = new HashMap(100); try { pstmt = DB.prepareStatement(sql, get_TrxName()); pstmt.setInt(1, getAD_Role_ID()); rs = pstmt.executeQuery(); - while (rs.next()) - m_processAccess.put(new Integer(rs.getInt(1)), new Boolean("Y".equals(rs.getString(2)))); + while (rs.next()) { + Integer procId = new Integer(rs.getInt(1)); + if ("N".equals(rs.getString(3))) { + // inactive process on direct access + if (m_processAccess.containsKey(procId)) { + m_processAccess.remove(procId); + } + } else { + directAccess.put(procId, new Boolean("Y".equals(rs.getString(2)))); + } + } } catch (Exception e) { @@ -1608,7 +1622,7 @@ public final class MRole extends X_AD_Role { DB.close(rs, pstmt); } - mergeIncludedAccess("m_processAccess"); // Load included accesses - metas-2009_0021_AP1_G94 + setAccessMap("m_processAccess", mergeAccess(getAccessMap("m_processAccess"), directAccess, true)); } // reload Boolean retValue = m_processAccess.get(AD_Process_ID); return retValue; @@ -1624,6 +1638,9 @@ public final class MRole extends X_AD_Role if (m_taskAccess == null) { m_taskAccess = new HashMap(10); + // first get the task access from the included and substitute roles + mergeIncludedAccess("m_taskAccess"); // Load included accesses - metas-2009_0021_AP1_G94 + // and now get the task access directly from this role MClient client = MClient.get(getCtx(), getAD_Client_ID()); String ASPFilter = ""; if (client.isUseASP()) @@ -1656,16 +1673,26 @@ public final class MRole extends X_AD_Role + " AND ce.IsActive = 'Y' " + " AND ce.AD_Task_ID IS NOT NULL " + " AND ce.ASP_Status = 'H')"; // Hide - String sql = "SELECT AD_Task_ID, IsReadWrite FROM AD_Task_Access WHERE AD_Role_ID=? AND IsActive='Y'" + ASPFilter; + String sql = "SELECT AD_Task_ID, IsReadWrite, IsActive FROM AD_Task_Access WHERE AD_Role_ID=?" + ASPFilter; PreparedStatement pstmt = null; ResultSet rs = null; + HashMap directAccess = new HashMap(100); try { pstmt = DB.prepareStatement(sql, get_TrxName()); pstmt.setInt(1, getAD_Role_ID()); rs = pstmt.executeQuery(); - while (rs.next()) - m_taskAccess.put(new Integer(rs.getInt(1)), new Boolean("Y".equals(rs.getString(2)))); + while (rs.next()) { + Integer taskId = new Integer(rs.getInt(1)); + if ("N".equals(rs.getString(3))) { + // inactive task on direct access + if (m_taskAccess.containsKey(taskId)) { + m_taskAccess.remove(taskId); + } + } else { + directAccess.put(taskId, new Boolean("Y".equals(rs.getString(2)))); + } + } } catch (Exception e) { @@ -1675,7 +1702,7 @@ public final class MRole extends X_AD_Role { DB.close(rs, pstmt); } - mergeIncludedAccess("m_taskAccess"); // Load included accesses - metas-2009_0021_AP1_G94 + setAccessMap("m_taskAccess", mergeAccess(getAccessMap("m_taskAccess"), directAccess, true)); } // reload Boolean retValue = m_taskAccess.get(AD_Task_ID); return retValue; @@ -1691,7 +1718,9 @@ public final class MRole extends X_AD_Role if (m_formAccess == null) { m_formAccess = new HashMap(20); - + // first get the form access from the included and substitute roles + mergeIncludedAccess("m_formAccess"); // Load included accesses - metas-2009_0021_AP1_G94 + // and now get the form access directly from this role MClient client = MClient.get(getCtx(), getAD_Client_ID()); String ASPFilter = ""; if (client.isUseASP()) @@ -1724,16 +1753,26 @@ public final class MRole extends X_AD_Role + " AND ce.IsActive = 'Y' " + " AND ce.AD_Form_ID IS NOT NULL " + " AND ce.ASP_Status = 'H')"; // Hide - String sql = "SELECT AD_Form_ID, IsReadWrite FROM AD_Form_Access WHERE AD_Role_ID=? AND IsActive='Y'" + ASPFilter; + String sql = "SELECT AD_Form_ID, IsReadWrite, IsActive FROM AD_Form_Access WHERE AD_Role_ID=?" + ASPFilter; PreparedStatement pstmt = null; ResultSet rs = null; + HashMap directAccess = new HashMap(100); try { pstmt = DB.prepareStatement(sql, get_TrxName()); pstmt.setInt(1, getAD_Role_ID()); rs = pstmt.executeQuery(); - while (rs.next()) - m_formAccess.put(new Integer(rs.getInt(1)), new Boolean("Y".equals(rs.getString(2)))); + while (rs.next()) { + Integer formId = new Integer(rs.getInt(1)); + if ("N".equals(rs.getString(3))) { + // inactive form on direct access + if (m_formAccess.containsKey(formId)) { + m_formAccess.remove(formId); + } + } else { + directAccess.put(formId, new Boolean("Y".equals(rs.getString(2)))); + } + } } catch (Exception e) { @@ -1743,23 +1782,11 @@ public final class MRole extends X_AD_Role { DB.close(rs, pstmt); } - mergeIncludedAccess("m_formAccess"); // Load included accesses - metas-2009_0021_AP1_G94 + setAccessMap("m_formAccess", mergeAccess(getAccessMap("m_formAccess"), directAccess, true)); } // reload Boolean retValue = m_formAccess.get(AD_Form_ID); - // - // Check included roles - metas-2009_0021_AP1_G94 - if (retValue == null) - { - for (MRole includedRole : getIncludedRoles(false)) - { - retValue = includedRole.getFormAccess(AD_Form_ID); - if (retValue != null) - break; - } - } - // return retValue; - } // getTaskAccess + } // getFormAccess /** * Get Workflow Access @@ -1771,6 +1798,9 @@ public final class MRole extends X_AD_Role if (m_workflowAccess == null) { m_workflowAccess = new HashMap(20); + // first get the workflow access from the included and substitute roles + mergeIncludedAccess("m_workflowAccess"); // Load included accesses - metas-2009_0021_AP1_G94 + // and now get the workflow access directly from this role MClient client = MClient.get(getCtx(), getAD_Client_ID()); String ASPFilter = ""; if (client.isUseASP()) @@ -1803,16 +1833,26 @@ public final class MRole extends X_AD_Role + " AND ce.IsActive = 'Y' " + " AND ce.AD_Workflow_ID IS NOT NULL " + " AND ce.ASP_Status = 'H')"; // Hide - String sql = "SELECT AD_Workflow_ID, IsReadWrite FROM AD_Workflow_Access WHERE AD_Role_ID=? AND IsActive='Y'" + ASPFilter; + String sql = "SELECT AD_Workflow_ID, IsReadWrite, IsActive FROM AD_Workflow_Access WHERE AD_Role_ID=?" + ASPFilter; PreparedStatement pstmt = null; ResultSet rs = null; + HashMap directAccess = new HashMap(100); try { pstmt = DB.prepareStatement(sql, get_TrxName()); pstmt.setInt(1, getAD_Role_ID()); rs = pstmt.executeQuery(); - while (rs.next()) - m_workflowAccess.put(new Integer(rs.getInt(1)), new Boolean("Y".equals(rs.getString(2)))); + while (rs.next()) { + Integer formId = new Integer(rs.getInt(1)); + if ("N".equals(rs.getString(3))) { + // inactive workflow on direct access + if (m_workflowAccess.containsKey(formId)) { + m_workflowAccess.remove(formId); + } + } else { + directAccess.put(formId, new Boolean("Y".equals(rs.getString(2)))); + } + } } catch (Exception e) { @@ -1822,7 +1862,7 @@ public final class MRole extends X_AD_Role { DB.close(rs, pstmt); } - mergeIncludedAccess("m_workflowAccess"); // Load included accesses - metas-2009_0021_AP1_G94 + setAccessMap("m_workflowAccess", mergeAccess(getAccessMap("m_workflowAccess"), directAccess, true)); } // reload Boolean retValue = m_workflowAccess.get(AD_Workflow_ID); return retValue; @@ -2449,8 +2489,8 @@ public final class MRole extends X_AD_Role * @return number of valid actions in the String[] options * @see metas-2009_0021_AP1_G94 */ - public int checkActionAccess(int clientId, int docTypeId, String[] options, int maxIndex) - { + public int checkActionAccess(int clientId, int docTypeId, String[] options, + int maxIndex) { if (maxIndex <= 0) return maxIndex; // @@ -2460,45 +2500,96 @@ public final class MRole extends X_AD_Role params.add(docTypeId); // final StringBuffer sql_values = new StringBuffer(); - for (int i = 0; i < maxIndex; i++) - { + for (int i = 0; i < maxIndex; i++) { if (sql_values.length() > 0) sql_values.append(","); sql_values.append("?"); params.add(options[i]); } // - final String sql = "SELECT DISTINCT rl.Value FROM AD_Document_Action_Access a" - + " INNER JOIN AD_Ref_List rl ON (rl.AD_Reference_ID=135 and rl.AD_Ref_List_ID=a.AD_Ref_List_ID)" - + " WHERE a.IsActive='Y' AND a.AD_Client_ID=? AND a.C_DocType_ID=?" // #1,2 - + " AND rl.Value IN ("+sql_values+")" - + " AND "+getIncludedRolesWhereClause("a.AD_Role_ID", params) - ; PreparedStatement pstmt = null; ResultSet rs = null; - try - { + PreparedStatement pstmt1 = null; + ResultSet rs1 = null; + String sql=null; + + List roles = getIncludedRoles(true); + try { + + if (roles.size() > 0) { + + MDocType doc = new MDocType(getCtx(), docTypeId, get_TrxName()); + Vector option = new Vector(); + for (int j = 0; j < options.length; j++) { + if (options[j] != null) + option.add(options[j]); + } + + String sql1 = "SELECT rl.Value" + + " FROM AD_Document_Action_Access da1" + + " INNER JOIN AD_Ref_List rl ON (rl.AD_Reference_ID=135 and rl.AD_Ref_List_ID=da1.AD_Ref_List_ID)" + + " INNER JOIN AD_Role_Included ri ON (da1.AD_Role_ID=ri.Included_Role_ID)" + + " INNER JOIN AD_Role ro ON (ri.AD_Role_ID=ro.AD_Role_ID)" + + " INNER JOIN C_Doctype ty ON (da1.C_Doctype_ID=ty.C_Doctype_ID)" + + " WHERE ro.AD_Role_ID=?" + + " AND ty.DocBaseType IN (?)" + + " AND da1.IsActive='Y'"; + + pstmt1 = DB.prepareStatement(sql1, get_TrxName()); + pstmt1.setInt(1, getAD_Role_ID()); + pstmt1.setString(2, doc.getDocBaseType()); + + s_log.info(sql1 + " : " + getAD_Role_ID() + " " + + doc.getDocBaseType()); + rs1 = pstmt1.executeQuery(); + + while (rs1.next() && rs1 != null) { + String op = rs1.getString(1); + if (option.contains(op)) { + validOptions.add(op); + } + + } + + } + + sql = "SELECT DISTINCT rl.Value, a.IsActive FROM AD_Document_Action_Access a" + + " INNER JOIN AD_Ref_List rl ON (rl.AD_Reference_ID=135 and rl.AD_Ref_List_ID=a.AD_Ref_List_ID)" + + " WHERE a.AD_Client_ID=? AND a.C_DocType_ID=?" // #1,2 + + " AND rl.Value IN (" + + sql_values + + ")" + + " AND " + + getIncludedRolesWhereClause("a.AD_Role_ID", params); + pstmt = DB.prepareStatement(sql, null); DB.setParameters(pstmt, params); + s_log.info(sql + " : " ); rs = pstmt.executeQuery(); - while (rs.next()) - { + while (rs.next()) { String op = rs.getString(1); - validOptions.add(op); + String active=rs.getString(2); + if(active.equals("N") && validOptions.contains(op) ){ + validOptions.remove(op); + }else{ + if(!validOptions.contains(op)) + validOptions.add(op); + } } + validOptions.toArray(options); - } - catch (SQLException e) - { + } catch (SQLException e) { log.log(Level.SEVERE, sql, e); - } - finally - { + } finally { DB.close(rs, pstmt); - rs = null; pstmt = null; + DB.close(rs1, pstmt1); + rs = null; + pstmt = null; + rs1 = null; + pstmt1 = null; } // - int newMaxIndex = validOptions.size(); + int newMaxIndex = validOptions.size(); return newMaxIndex; } @@ -2529,7 +2620,7 @@ public final class MRole extends X_AD_Role } } - System.out.println("Include "+role); + s_log.info("Include "+role); this.m_includedRoles.add(role); role.setParentRole(this); role.m_includedSeqNo = seqNo; @@ -2717,7 +2808,7 @@ public final class MRole extends X_AD_Role { if (array1 == null) { - System.out.println("null !!!"); + s_log.info("array1 null !!!"); } List list = new ArrayList(); for (T po : array1) @@ -2803,7 +2894,7 @@ public final class MRole extends X_AD_Role } // end for array1 if (!found) { - //System.out.println("add "+o2); + //s_log.info("add "+o2); list.add(o2); } } @@ -2964,4 +3055,5 @@ public final class MRole extends X_AD_Role whereClause.insert(0, roleColumnSQL+" IN (").append(")"); return whereClause.toString(); } + } // MRole diff --git a/org.adempiere.base/src/org/compiere/util/Login.java b/org.adempiere.base/src/org/compiere/util/Login.java index 47e3740c4e..db1f9d9cbc 100644 --- a/org.adempiere.base/src/org/compiere/util/Login.java +++ b/org.adempiere.base/src/org/compiere/util/Login.java @@ -1526,6 +1526,7 @@ public class Login sql.append("u.EMail=?"); else sql.append("COALESCE(u.LDAPUser,u.Name)=?"); + sql.append(" AND r.IsMasterRole='N'"); sql.append(" AND u.IsActive='Y'").append(" AND EXISTS (SELECT * FROM AD_Client c WHERE u.AD_Client_ID=c.AD_Client_ID AND c.IsActive='Y')"); sql.append(" ORDER BY r.Name"); diff --git a/org.adempiere.extend/src/compiere/model/MyValidator.java b/org.adempiere.extend/src/compiere/model/MyValidator.java index ee09625e2b..cb50223f09 100644 --- a/org.adempiere.extend/src/compiere/model/MyValidator.java +++ b/org.adempiere.extend/src/compiere/model/MyValidator.java @@ -218,15 +218,15 @@ public class MyValidator implements ModelValidator } // toString /** - * Sample Validator Before Save Properties - to set mandatory properties on users + * Sample Validator BefoMRolere Save Properties - to set mandatory properties on users * avoid users changing properties */ public void beforeSaveProperties() { // not for SuperUser or role SysAdmin if ( m_AD_User_ID == 0 // System || m_AD_User_ID == 100 // SuperUser - || m_AD_Role_ID == 0 // System Administrator - || m_AD_Role_ID == 1000000) // ECO Admin + || m_AD_Role_ID == 0) // System Administrator + return; log.info("Setting default Properties"); From 951765ccd0ee3fd090826e896eacfe7b7e5f5070 Mon Sep 17 00:00:00 2001 From: Elaine Tan Date: Thu, 13 Sep 2012 16:29:23 +0800 Subject: [PATCH 25/79] IDEMPIERE-375 Implement Forgot my Password - add validation to check new password differ from old password and change the security question design --- .../oracle/910_IDEMPIERE-375.sql | 36 +++++ .../postgresql/910_IDEMPIERE-375.sql | 36 +++++ .../src/org/compiere/model/MSysConfig.java | 1 + .../src/org/compiere/apps/ALogin.java | 49 ++++--- .../webui/panel/ChangePasswordPanel.java | 37 +++-- .../webui/panel/ResetPasswordPanel.java | 136 ++++++++++++++---- 6 files changed, 221 insertions(+), 74 deletions(-) create mode 100644 migration/360lts-release/oracle/910_IDEMPIERE-375.sql create mode 100644 migration/360lts-release/postgresql/910_IDEMPIERE-375.sql diff --git a/migration/360lts-release/oracle/910_IDEMPIERE-375.sql b/migration/360lts-release/oracle/910_IDEMPIERE-375.sql new file mode 100644 index 0000000000..2468a24ef1 --- /dev/null +++ b/migration/360lts-release/oracle/910_IDEMPIERE-375.sql @@ -0,0 +1,36 @@ +-- Sep 12, 2012 6:56:41 PM SGT +-- IDEMPIERE-375 Implement Forgot my Password +INSERT INTO AD_SysConfig (AD_SysConfig_ID,EntityType,ConfigurationLevel,Value,Description,AD_SysConfig_UU,Created,Updated,AD_Client_ID,AD_Org_ID,CreatedBy,IsActive,UpdatedBy,Name) VALUES (200020,'D','S','Y','New password must differs from the old password','13b5a576-7b91-471b-8b40-05589dd585f7',TO_DATE('2012-09-12 18:56:39','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-12 18:56:39','YYYY-MM-DD HH24:MI:SS'),0,0,100,'Y',100,'CHANGE_PASSWORD_MUST_DIFFER') +; + +-- Sep 12, 2012 6:57:05 PM SGT +-- IDEMPIERE-375 Implement Forgot my Password +UPDATE AD_Column SET FieldLength=1024,Updated=TO_DATE('2012-09-12 18:57:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200457 +; + +-- Sep 12, 2012 6:57:13 PM SGT +-- IDEMPIERE-375 Implement Forgot my Password +ALTER TABLE AD_User MODIFY SecurityQuestion NVARCHAR2(1024) DEFAULT NULL +; + +-- Sep 12, 2012 6:58:41 PM SGT +-- IDEMPIERE-375 Implement Forgot my Password +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','New Password must differ from Old Password',200066,'U','0d873a03-0980-4725-8a4f-a6954e4ee59e','NewPasswordMustDiffer','Y',TO_DATE('2012-09-12 18:58:40','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-09-12 18:58:40','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 12, 2012 6:58:41 PM SGT +-- IDEMPIERE-375 Implement Forgot my Password +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200066 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Sep 12, 2012 6:58:45 PM SGT +-- IDEMPIERE-375 Implement Forgot my Password +UPDATE AD_Message SET EntityType='D',Updated=TO_DATE('2012-09-12 18:58:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200066 +; + +UPDATE AD_User u SET SecurityQuestion = ( +SELECT MAX(m.MsgText) FROM AD_Message m WHERE m.Value = u.SecurityQuestion) +WHERE u.SecurityQuestion IS NOT NULL; + +SELECT register_migration_script('910_IDEMPIERE-375.sql') FROM dual +; \ No newline at end of file diff --git a/migration/360lts-release/postgresql/910_IDEMPIERE-375.sql b/migration/360lts-release/postgresql/910_IDEMPIERE-375.sql new file mode 100644 index 0000000000..9a48a4c4e3 --- /dev/null +++ b/migration/360lts-release/postgresql/910_IDEMPIERE-375.sql @@ -0,0 +1,36 @@ +-- Sep 12, 2012 6:56:41 PM SGT +-- IDEMPIERE-375 Implement Forgot my Password +INSERT INTO AD_SysConfig (AD_SysConfig_ID,EntityType,ConfigurationLevel,Value,Description,AD_SysConfig_UU,Created,Updated,AD_Client_ID,AD_Org_ID,CreatedBy,IsActive,UpdatedBy,Name) VALUES (200020,'D','S','Y','New password must differs from the old password','13b5a576-7b91-471b-8b40-05589dd585f7',TO_TIMESTAMP('2012-09-12 18:56:39','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-12 18:56:39','YYYY-MM-DD HH24:MI:SS'),0,0,100,'Y',100,'CHANGE_PASSWORD_MUST_DIFFER') +; + +-- Sep 12, 2012 6:57:05 PM SGT +-- IDEMPIERE-375 Implement Forgot my Password +UPDATE AD_Column SET FieldLength=1024,Updated=TO_TIMESTAMP('2012-09-12 18:57:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200457 +; + +-- Sep 12, 2012 6:57:13 PM SGT +-- IDEMPIERE-375 Implement Forgot my Password +INSERT INTO t_alter_column values('ad_user','SecurityQuestion','VARCHAR(1024)',null,'NULL') +; + +-- Sep 12, 2012 6:58:41 PM SGT +-- IDEMPIERE-375 Implement Forgot my Password +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','New Password must differ from Old Password',200066,'U','0d873a03-0980-4725-8a4f-a6954e4ee59e','NewPasswordMustDiffer','Y',TO_TIMESTAMP('2012-09-12 18:58:40','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-09-12 18:58:40','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 12, 2012 6:58:41 PM SGT +-- IDEMPIERE-375 Implement Forgot my Password +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200066 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Sep 12, 2012 6:58:45 PM SGT +-- IDEMPIERE-375 Implement Forgot my Password +UPDATE AD_Message SET EntityType='D',Updated=TO_TIMESTAMP('2012-09-12 18:58:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200066 +; + +UPDATE AD_User u SET SecurityQuestion = ( +SELECT MAX(m.MsgText) FROM AD_Message m WHERE m.Value = u.SecurityQuestion) +WHERE u.SecurityQuestion IS NOT NULL; + +SELECT register_migration_script('910_IDEMPIERE-375.sql') FROM dual +; \ No newline at end of file diff --git a/org.adempiere.base/src/org/compiere/model/MSysConfig.java b/org.adempiere.base/src/org/compiere/model/MSysConfig.java index 3fcab94481..12cb81d600 100644 --- a/org.adempiere.base/src/org/compiere/model/MSysConfig.java +++ b/org.adempiere.base/src/org/compiere/model/MSysConfig.java @@ -95,6 +95,7 @@ public class MSysConfig extends X_AD_SysConfig public static final String USER_LOCKING_MAX_LOGIN_ATTEMPT = "USER_LOCKING_MAX_LOGIN_ATTEMPT"; public static final String USER_LOCKING_MAX_INACTIVE_PERIOD_DAY = "USER_LOCKING_MAX_INACTIVE_PERIOD_DAY"; public static final String USER_LOCKING_MAX_PASSWORD_AGE_DAY = "USER_LOCKING_MAX_PASSWORD_AGE_DAY"; + public static final String CHANGE_PASSWORD_MUST_DIFFER = "CHANGE_PASSWORD_MUST_DIFFER"; public static final String ProductUOMConversionUOMValidate = "ProductUOMConversionUOMValidate"; public static final String ProductUOMConversionRateValidate = "ProductUOMConversionRateValidate"; public static final String SYSTEM_INSERT_CHANGELOG = "SYSTEM_INSERT_CHANGELOG"; diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ALogin.java b/org.adempiere.ui.swing/src/org/compiere/apps/ALogin.java index 25aaad2561..3d05870ddd 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ALogin.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/ALogin.java @@ -120,9 +120,6 @@ public final class ALogin extends CDialog private static final int CONNECTED_OK = 0; private static final int CONNECTED_OK_WITH_PASSWORD_EXPIRED = 1; -/* private static final int NO_OF_SECURITY_QUESTION = 5; - private static final String SECURITY_QUESTION_PREFIX = "SecurityQuestion_"; -*/ private CPanel mainPanel = new CPanel(new BorderLayout()); private CTabbedPane loginTabPane = new CTabbedPane(); private CPanel connectionPanel = new CPanel(); @@ -169,11 +166,11 @@ public final class ALogin extends CDialog private JPasswordField txtNewPassword = new JPasswordField(); private JPasswordField txtRetypeNewPassword = new JPasswordField(); // -/* private CLabel lblSecurityQuestion = new CLabel(); + private CLabel lblSecurityQuestion = new CLabel(); private CLabel lblAnswer = new CLabel(); - private VComboBox lstSecurityQuestion = new VComboBox(); + private CTextField txtSecurityQuestion = new CTextField(); private CTextField txtAnswer = new CTextField(); -*/ + /** Server Connection */ private CConnection m_cc; /** Application User */ @@ -382,22 +379,18 @@ public final class ALogin extends CDialog lblRetypeNewPassword.setHorizontalAlignment(SwingConstants.RIGHT); lblRetypeNewPassword.setText(Msg.getMsg(m_ctx, "New Password Confirm")); -/* lstSecurityQuestion.setName("lstSecurityQuestion"); + txtSecurityQuestion.setName("txtSecurityQuestion"); lblSecurityQuestion.setRequestFocusEnabled(false); - lblSecurityQuestion.setLabelFor(lstSecurityQuestion); + lblSecurityQuestion.setLabelFor(txtSecurityQuestion); lblSecurityQuestion.setHorizontalAlignment(SwingConstants.RIGHT); lblSecurityQuestion.setText(Msg.getMsg(m_ctx, "SecurityQuestion")); - lstSecurityQuestion.removeAllItems(); - for (int i = 1; i <= NO_OF_SECURITY_QUESTION; i++) - lstSecurityQuestion.addItem(new ValueNamePair(SECURITY_QUESTION_PREFIX + i, Msg.getMsg(m_ctx, SECURITY_QUESTION_PREFIX + i))); - txtAnswer.setName("txtAnswer"); lblAnswer.setRequestFocusEnabled(false); lblAnswer.setLabelFor(txtAnswer); lblAnswer.setHorizontalAlignment(SwingConstants.RIGHT); lblAnswer.setText(Msg.getMsg(m_ctx, "Answer")); -*/ + changePasswordPanel.setLayout(changePasswordPanelLayout); changePasswordPanel.add(lblOldPassword, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 @@ -412,15 +405,15 @@ public final class ALogin extends CDialog ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); changePasswordPanel.add(txtRetypeNewPassword, new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); -/* changePasswordPanel.add(lblSecurityQuestion, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 + changePasswordPanel.add(lblSecurityQuestion, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); - changePasswordPanel.add(lstSecurityQuestion, new GridBagConstraints(1, 3, 1, 1, 1.0, 0.0 + changePasswordPanel.add(txtSecurityQuestion, new GridBagConstraints(1, 3, 1, 1, 1.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); changePasswordPanel.add(lblAnswer, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0 ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); changePasswordPanel.add(txtAnswer, new GridBagConstraints(1, 4, 1, 1, 1.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); -*/ loginTabPane.add(changePasswordPanel, res.getString("ChangePassword")); + loginTabPane.add(changePasswordPanel, res.getString("ChangePassword")); loginTabPane.setEnabledAt(TAB_CHANGE_PASSWORD, false); // @@ -656,12 +649,9 @@ public final class ALogin extends CDialog String newPassword = new String(txtNewPassword.getPassword()); String retypeNewPassword = new String(txtRetypeNewPassword.getPassword()); -/* String securityQuestion = null; - if (lstSecurityQuestion.getSelectedItem() != null) - securityQuestion = ((ValueNamePair) lstSecurityQuestion.getSelectedItem()).getValue(); - + String securityQuestion = txtSecurityQuestion.getText(); String answer = txtAnswer.getText(); -*/ + if (Util.isEmpty(oldPassword)) { statusBar.setStatusLine(Msg.getMsg(m_ctx, "OldPasswordMandatory"), true); @@ -680,7 +670,7 @@ public final class ALogin extends CDialog return; } -/* if (Util.isEmpty(securityQuestion)) + if (Util.isEmpty(securityQuestion)) { statusBar.setStatusLine(Msg.getMsg(m_ctx, "SecurityQuestionMandatory"), true); return; @@ -691,13 +681,22 @@ public final class ALogin extends CDialog statusBar.setStatusLine(Msg.getMsg(m_ctx, "AnswerMandatory"), true); return; } -*/ + String m_userPassword = new String(m_pwd); if (!oldPassword.equals(m_userPassword)) { statusBar.setStatusLine(Msg.getMsg(m_ctx, "OldPasswordNoMatch"), true); return; } + + if (MSysConfig.getBooleanValue(MSysConfig.CHANGE_PASSWORD_MUST_DIFFER, true)) + { + if (oldPassword.equals(newPassword)) + { + statusBar.setStatusLine(Msg.getMsg(m_ctx, "NewPasswordMustDiffer"), true); + return; + } + } Trx trx = null; try @@ -721,9 +720,9 @@ public final class ALogin extends CDialog user.setPassword(newPassword); user.setIsExpired(false); -/* user.setSecurityQuestion(securityQuestion); + user.setSecurityQuestion(securityQuestion); user.setAnswer(answer); -*/ if (!user.save(trx.getTrxName())) + if (!user.save(trx.getTrxName())) { trx.rollback(); statusBar.setStatusLine("Could not update user", true); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ChangePasswordPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ChangePasswordPanel.java index 734e325eef..49a3609304 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ChangePasswordPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ChangePasswordPanel.java @@ -20,7 +20,6 @@ import java.util.Properties; import org.adempiere.exceptions.AdempiereException; import org.adempiere.webui.AdempiereIdGenerator; import org.adempiere.webui.LayoutUtils; -import org.adempiere.webui.component.Combobox; import org.adempiere.webui.component.ConfirmPanel; import org.adempiere.webui.component.Label; import org.adempiere.webui.component.Textbox; @@ -29,6 +28,7 @@ import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.theme.ITheme; import org.adempiere.webui.theme.ThemeManager; import org.adempiere.webui.window.LoginWindow; +import org.compiere.model.MSysConfig; import org.compiere.model.MUser; import org.compiere.util.CLogger; import org.compiere.util.Env; @@ -75,10 +75,10 @@ public class ChangePasswordPanel extends Window implements EventListener private Label lblRetypeNewPassword; private Label lblSecurityQuestion; private Label lblAnswer; - private Combobox lstSecurityQuestion; private Textbox txtOldPassword; private Textbox txtNewPassword; private Textbox txtRetypeNewPassword; + private Textbox txtSecurityQuestion; private Textbox txtAnswer; public ChangePasswordPanel(Properties ctx, LoginWindow loginWindow, String userName, String userPassword, boolean show, KeyNamePair[] clientsKNPairs) @@ -168,7 +168,7 @@ public class ChangePasswordPanel extends Window implements EventListener td = new Td(); td.setSclass(ITheme.LOGIN_FIELD_CLASS); tr.appendChild(td); - td.appendChild(lstSecurityQuestion); + td.appendChild(txtSecurityQuestion); tr = new Tr(); tr.setId("rowAnswer"); @@ -215,18 +215,7 @@ public class ChangePasswordPanel extends Window implements EventListener lblAnswer = new Label(); lblAnswer.setId("lblAnswer"); lblAnswer.setValue(Msg.getMsg(m_ctx, "Answer")); - - lstSecurityQuestion = new Combobox(); - lstSecurityQuestion.setAutocomplete(true); - lstSecurityQuestion.setAutodrop(true); - lstSecurityQuestion.setId("lstSecurityQuestion"); - lstSecurityQuestion.setAttribute(AdempiereIdGenerator.ZK_COMPONENT_PREFIX_ATTRIBUTE, "unq" + lstSecurityQuestion.getId()); - lstSecurityQuestion.setWidth("220px"); - lstSecurityQuestion.getItems().clear(); - for (int i = 1; i <= ResetPasswordPanel.NO_OF_SECURITY_QUESTION; i++) - lstSecurityQuestion.appendItem(Msg.getMsg(m_ctx, ResetPasswordPanel.SECURITY_QUESTION_PREFIX + i), ResetPasswordPanel.SECURITY_QUESTION_PREFIX + i); - txtOldPassword = new Textbox(); txtOldPassword.setId("txtOldPassword"); txtOldPassword.setType("password"); @@ -248,6 +237,12 @@ public class ChangePasswordPanel extends Window implements EventListener txtRetypeNewPassword.setCols(25); txtRetypeNewPassword.setWidth("220px"); + txtSecurityQuestion = new Textbox(); + txtSecurityQuestion.setId("txtSecurityQuestion"); + txtSecurityQuestion.setAttribute(AdempiereIdGenerator.ZK_COMPONENT_PREFIX_ATTRIBUTE, "unq" + txtSecurityQuestion.getId()); + txtSecurityQuestion.setCols(25); + txtSecurityQuestion.setWidth("220px"); + txtAnswer = new Textbox(); txtAnswer.setId("txtAnswer"); // txtAnswer.setType("password"); @@ -273,12 +268,8 @@ public class ChangePasswordPanel extends Window implements EventListener { String oldPassword = txtOldPassword.getValue(); String newPassword = txtNewPassword.getValue(); - String retypeNewPassword = txtRetypeNewPassword.getValue(); - - String securityQuestion = null; - if (lstSecurityQuestion.getSelectedItem() != null) - securityQuestion = (String) lstSecurityQuestion.getSelectedItem().getValue(); - + String retypeNewPassword = txtRetypeNewPassword.getValue(); + String securityQuestion = txtSecurityQuestion.getValue(); String answer = txtAnswer.getValue(); if (Util.isEmpty(oldPassword)) @@ -298,6 +289,12 @@ public class ChangePasswordPanel extends Window implements EventListener if (!oldPassword.equals(m_userPassword)) throw new IllegalArgumentException(Msg.getMsg(m_ctx, "OldPasswordNoMatch")); + + if (MSysConfig.getBooleanValue(MSysConfig.CHANGE_PASSWORD_MUST_DIFFER, true)) + { + if (oldPassword.equals(newPassword)) + throw new IllegalArgumentException(Msg.getMsg(m_ctx, "NewPasswordMustDiffer")); + } Trx trx = null; try diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java index dede9b63f2..868776173f 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java @@ -23,7 +23,6 @@ import java.util.Properties; import org.adempiere.exceptions.AdempiereException; import org.adempiere.webui.AdempiereIdGenerator; import org.adempiere.webui.LayoutUtils; -import org.adempiere.webui.component.Combobox; import org.adempiere.webui.component.ConfirmPanel; import org.adempiere.webui.component.Label; import org.adempiere.webui.component.Textbox; @@ -67,9 +66,7 @@ public class ResetPasswordPanel extends Window implements EventListener private static CLogger logger = CLogger.getCLogger(ResetPasswordPanel.class); - private static final int MAX_RESET_PASSWORD_TRIES = 3; - protected static final int NO_OF_SECURITY_QUESTION = 5; - protected static final String SECURITY_QUESTION_PREFIX = "SecurityQuestion_"; + private static final int MAX_RESET_PASSWORD_TRIES = 3; private static final String RESET_PASSWORD_MAIL_TEXT_NAME = "Reset Password"; private LoginWindow wndLogin; @@ -86,9 +83,11 @@ public class ResetPasswordPanel extends Window implements EventListener private Label lblSecurityQuestion; private Label lblAnswer; private Label lblUserId; - private Combobox lstSecurityQuestion; + private Label lblEmail; + private Textbox txtSecurityQuestion; private Textbox txtAnswer; private Textbox txtUserId; + private Textbox txtEmail; public ResetPasswordPanel(Properties ctx, LoginWindow loginWindow, String userName, boolean noSecurityQuestion) { @@ -100,6 +99,8 @@ public class ResetPasswordPanel extends Window implements EventListener initComponents(); init(); this.setId("resetPasswordPanel"); + + loadData(); } private void init() @@ -145,6 +146,18 @@ public class ResetPasswordPanel extends Window implements EventListener } else { + tr = new Tr(); + tr.setId("rowEmail"); + table.appendChild(tr); + td = new Td(); + tr.appendChild(td); + td.setSclass(ITheme.LOGIN_LABEL_CLASS); + td.appendChild(lblEmail); + td = new Td(); + td.setSclass(ITheme.LOGIN_FIELD_CLASS); + tr.appendChild(td); + td.appendChild(txtEmail); + tr = new Tr(); tr.setId("rowSecurityQuestion"); table.appendChild(tr); @@ -155,7 +168,7 @@ public class ResetPasswordPanel extends Window implements EventListener td = new Td(); td.setSclass(ITheme.LOGIN_FIELD_CLASS); tr.appendChild(td); - td.appendChild(lstSecurityQuestion); + td.appendChild(txtSecurityQuestion); tr = new Tr(); tr.setId("rowAnswer"); @@ -200,6 +213,10 @@ public class ResetPasswordPanel extends Window implements EventListener } else { + lblEmail = new Label(); + lblEmail.setId("lblEmail"); + lblEmail.setValue(Msg.getMsg(m_ctx, "EMail")); + lblSecurityQuestion = new Label(); lblSecurityQuestion.setId("lblSecurityQuestion"); lblSecurityQuestion.setValue(Msg.getMsg(m_ctx, "SecurityQuestion")); @@ -208,16 +225,19 @@ public class ResetPasswordPanel extends Window implements EventListener lblAnswer.setId("lblAnswer"); lblAnswer.setValue(Msg.getMsg(m_ctx, "Answer")); - lstSecurityQuestion = new Combobox(); - lstSecurityQuestion.setAutocomplete(true); - lstSecurityQuestion.setAutodrop(true); - lstSecurityQuestion.setId("lstSecurityQuestion"); - lstSecurityQuestion.setAttribute(AdempiereIdGenerator.ZK_COMPONENT_PREFIX_ATTRIBUTE, "unq" + lstSecurityQuestion.getId()); - lstSecurityQuestion.setWidth("220px"); + txtEmail = new Textbox(); + txtEmail.setId("txtEmail"); + txtEmail.setAttribute(AdempiereIdGenerator.ZK_COMPONENT_PREFIX_ATTRIBUTE, "unq" + txtEmail.getId()); + txtEmail.setCols(25); + txtEmail.setWidth("220px"); + txtEmail.setReadonly(false); - lstSecurityQuestion.getItems().clear(); - for (int i = 1; i <= NO_OF_SECURITY_QUESTION; i++) - lstSecurityQuestion.appendItem(Msg.getMsg(m_ctx, SECURITY_QUESTION_PREFIX + i), SECURITY_QUESTION_PREFIX + i); + txtSecurityQuestion = new Textbox(); + txtSecurityQuestion.setId("txtSecurityQuestion"); + txtSecurityQuestion.setAttribute(AdempiereIdGenerator.ZK_COMPONENT_PREFIX_ATTRIBUTE, "unq" + txtSecurityQuestion.getId()); + txtSecurityQuestion.setCols(25); + txtSecurityQuestion.setWidth("220px"); + txtSecurityQuestion.setReadonly(true); txtAnswer = new Textbox(); txtAnswer.setId("txtAnswer"); @@ -225,14 +245,49 @@ public class ResetPasswordPanel extends Window implements EventListener txtAnswer.setAttribute(AdempiereIdGenerator.ZK_COMPONENT_PREFIX_ATTRIBUTE, "unq" + txtAnswer.getId()); txtAnswer.setCols(25); txtAnswer.setWidth("220px"); + txtAnswer.setReadonly(true); } - } + } + + private void loadData() + { + boolean email_login = MSysConfig.getBooleanValue(MSysConfig.USE_EMAIL_FOR_LOGIN, false); + if (email_login) + { + txtEmail.setText(m_userName); + loadSecurityQuestion(); + } + } + + private void loadSecurityQuestion() + { + String email = txtEmail.getValue(); + if (Util.isEmpty(email)) + throw new IllegalArgumentException(Msg.getMsg(m_ctx, "FillMandatory") + " " + lblEmail.getValue()); + + // Assume user with same email uses the same password and security question + StringBuilder sql = new StringBuilder("SELECT SecurityQuestion "); + sql.append("FROM AD_User "); + sql.append("WHERE IsActive='Y' "); + sql.append("AND EMail=? "); + sql.append("AND SecurityQuestion IS NOT NULL "); + sql.append("ORDER BY AD_Client_ID DESC"); + + String securityQuestion = DB.getSQLValueString(null, sql.toString(), email); + txtSecurityQuestion.setValue(securityQuestion); + + txtEmail.setReadonly(true); + txtAnswer.setReadonly(false); + } public void onEvent(Event event) { if (event.getTarget().getId().equals(ConfirmPanel.A_OK)) { - validateResetPassword(); + if (txtAnswer.isReadonly()) + validateEmail(); + else + validateResetPassword(); } else if (event.getTarget().getId().equals(ConfirmPanel.A_CANCEL)) { @@ -241,7 +296,36 @@ public class ResetPasswordPanel extends Window implements EventListener } } - public void validateResetPassword() + private void validateEmail() + { + String email = txtEmail.getValue(); + if (Util.isEmpty(email)) + throw new IllegalArgumentException(Msg.getMsg(m_ctx, "FillMandatory") + " " + lblEmail.getValue()); + + StringBuilder whereClause = new StringBuilder("Password IS NOT NULL "); + whereClause.append("AND COALESCE(LDAPUser,Name)=? "); + whereClause.append("AND EMail=? "); + whereClause.append(" AND") + .append(" EXISTS (SELECT * FROM AD_User_Roles ur") + .append(" INNER JOIN AD_Role r ON (ur.AD_Role_ID=r.AD_Role_ID)") + .append(" WHERE ur.AD_User_ID=AD_User.AD_User_ID AND ur.IsActive='Y' AND r.IsActive='Y') AND ") + .append(" EXISTS (SELECT * FROM AD_Client c") + .append(" WHERE c.AD_Client_ID=AD_User.AD_Client_ID") + .append(" AND c.IsActive='Y') AND ") + .append(" AD_User.IsActive='Y'"); + + List users = new Query(m_ctx, MUser.Table_Name, whereClause.toString(), null) + .setParameters(m_userName, email) + .setOrderBy(MUser.COLUMNNAME_AD_User_ID) + .list(); + + if (users.size() == 0) + throw new AdempiereException(Msg.getMsg(m_ctx, "InvalidUserNameAndEmail")); + + loadSecurityQuestion(); + } + + private void validateResetPassword() { List users = null; if (m_noSecurityQuestion) @@ -278,10 +362,8 @@ public class ResetPasswordPanel extends Window implements EventListener } else { - String securityQuestion = null; - if (lstSecurityQuestion.getSelectedItem() != null) - securityQuestion = (String) lstSecurityQuestion.getSelectedItem().getValue(); - + String email = txtEmail.getValue(); + String securityQuestion = txtSecurityQuestion.getValue(); String answer = txtAnswer.getValue(); if (Util.isEmpty(securityQuestion)) @@ -290,12 +372,8 @@ public class ResetPasswordPanel extends Window implements EventListener if (Util.isEmpty(answer)) throw new IllegalArgumentException(Msg.getMsg(m_ctx, "AnswerMandatory")); - boolean email_login = MSysConfig.getBooleanValue(MSysConfig.USE_EMAIL_FOR_LOGIN, false); StringBuilder whereClause = new StringBuilder("Password IS NOT NULL AND "); - if (email_login) - whereClause.append("EMail=?"); - else - whereClause.append("COALESCE(LDAPUser,Name)=?"); + whereClause.append("EMail=?"); whereClause.append(" AND") .append(" EXISTS (SELECT * FROM AD_User_Roles ur") .append(" INNER JOIN AD_Role r ON (ur.AD_Role_ID=r.AD_Role_ID)") @@ -308,7 +386,7 @@ public class ResetPasswordPanel extends Window implements EventListener .append(" AND AD_User.Answer=?"); users = new Query(m_ctx, MUser.Table_Name, whereClause.toString(), null) - .setParameters(m_userName, securityQuestion, answer) + .setParameters(email, securityQuestion, answer) .setOrderBy(MUser.COLUMNNAME_AD_User_ID) .list(); } @@ -358,7 +436,7 @@ public class ResetPasswordPanel extends Window implements EventListener if (errorMsg.length() > 0) errorMsg += ", "; errorMsg += user.getEMail(); - throw new AdempiereException("Failed to send email to user - " + user.getEMail()); + throw new AdempiereException(Msg.getMsg(m_ctx, "RequestActionEMailError") + ": " + user.getEMail()); } } From 4403c3bb68de0e0d6eb45fae66c6a4e661ad9460 Mon Sep 17 00:00:00 2001 From: Elaine Tan Date: Thu, 13 Sep 2012 17:19:11 +0800 Subject: [PATCH 26/79] IDEMPIERE-375 Implement Forgot my Password - fix NPE --- .../src/org/adempiere/webui/panel/ResetPasswordPanel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java index 868776173f..bfb591318d 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java @@ -284,7 +284,7 @@ public class ResetPasswordPanel extends Window implements EventListener { if (event.getTarget().getId().equals(ConfirmPanel.A_OK)) { - if (txtAnswer.isReadonly()) + if (txtAnswer != null && txtAnswer.isReadonly()) validateEmail(); else validateResetPassword(); From cdf2d1ef07f68496a2a95b7e8718b423c000f952 Mon Sep 17 00:00:00 2001 From: Elaine Tan Date: Thu, 13 Sep 2012 17:59:14 +0800 Subject: [PATCH 27/79] IDEMPIERE-375 Implement Forgot my Password - fix the query to load security question --- .../org/adempiere/webui/panel/ResetPasswordPanel.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java index bfb591318d..6b089d1d70 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java @@ -265,15 +265,20 @@ public class ResetPasswordPanel extends Window implements EventListener if (Util.isEmpty(email)) throw new IllegalArgumentException(Msg.getMsg(m_ctx, "FillMandatory") + " " + lblEmail.getValue()); - // Assume user with same email uses the same password and security question + // TODO: Validation for user with same email uses the same password and security question StringBuilder sql = new StringBuilder("SELECT SecurityQuestion "); sql.append("FROM AD_User "); sql.append("WHERE IsActive='Y' "); + boolean email_login = MSysConfig.getBooleanValue(MSysConfig.USE_EMAIL_FOR_LOGIN, false); + if (email_login) + sql.append("AND EMail=? "); + else + sql.append("AND COALESCE(LDAPUser,Name)=? "); sql.append("AND EMail=? "); - sql.append("AND SecurityQuestion IS NOT NULL "); + sql.append("AND SecurityQuestion IS NOT NULL "); sql.append("ORDER BY AD_Client_ID DESC"); - String securityQuestion = DB.getSQLValueString(null, sql.toString(), email); + String securityQuestion = DB.getSQLValueString(null, sql.toString(), m_userName, email); txtSecurityQuestion.setValue(securityQuestion); txtEmail.setReadonly(true); From da2893b14ed0c1f19e1dc0dfd2191089fc2cc36d Mon Sep 17 00:00:00 2001 From: Deepak Pansheriya Date: Thu, 13 Sep 2012 17:26:05 +0530 Subject: [PATCH 28/79] Idempiere-364 Fixing grid refreshing issue after customization. --- .../org/adempiere/webui/panel/AbstractADWindowPanel.java | 7 ++----- .../org/adempiere/webui/panel/CustomizeGridViewPanel.java | 8 ++++++++ .../adempiere/webui/window/CustomizeGridViewDialog.java | 8 +++++++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java index a5d7d12311..14c3946950 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java @@ -2533,11 +2533,8 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To gridFieldIds.add(fields[i].getAD_Field_ID()); } - if (CustomizeGridViewDialog.showCustomize(0, curTab.getAD_Tab_ID(), columnsWidth,gridFieldIds)) { + + CustomizeGridViewDialog.showCustomize(0, curTab.getAD_Tab_ID(), columnsWidth,gridFieldIds,tabPanel.getGridView()); - if (tabPanel.getGridView() != null) { - tabPanel.getGridView().reInit(); - } - } } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/CustomizeGridViewPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/CustomizeGridViewPanel.java index 965a1ed618..e64778291f 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/CustomizeGridViewPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/CustomizeGridViewPanel.java @@ -29,6 +29,7 @@ import java.util.logging.Level; import org.adempiere.model.MTabCustomization; import org.adempiere.webui.component.Button; import org.adempiere.webui.component.Checkbox; +import org.adempiere.webui.component.GridPanel; import org.adempiere.webui.component.Label; import org.adempiere.webui.component.ListHead; import org.adempiere.webui.component.ListHeader; @@ -67,6 +68,7 @@ public class CustomizeGridViewPanel extends Panel private static final long serialVersionUID = 4289328613547509587L; private Map m_columnsWidth; ArrayList tableSeqs; + GridPanel gridPanel = null; /** * Sort Tab Constructor * @@ -562,6 +564,9 @@ public class CustomizeGridViewPanel extends Panel m_saved = true; FDialog.info(m_WindowNo, null, "Saved"); getParent().detach(); + if(gridPanel!=null){ + gridPanel.reInit(); + } } else { FDialog.error(m_WindowNo, null, "SaveError", custom.toString()); } @@ -760,5 +765,8 @@ public class CustomizeGridViewPanel extends Panel public boolean isSaved() { return m_saved; } + public void setGridPanel(GridPanel gridPanel){ + this.gridPanel = gridPanel; + } } //ADSortTab diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/CustomizeGridViewDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/CustomizeGridViewDialog.java index 7f2d006827..cc0623ec13 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/CustomizeGridViewDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/CustomizeGridViewDialog.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.Map; import org.adempiere.webui.apps.AEnv; +import org.adempiere.webui.component.GridPanel; import org.adempiere.webui.component.Window; import org.adempiere.webui.panel.CustomizeGridViewPanel; import org.compiere.util.Env; @@ -49,6 +50,10 @@ public class CustomizeGridViewDialog extends Window { public boolean isSaved() { return customizePanel.isSaved(); } + + public void setGridPanel(GridPanel gridPanel){ + customizePanel.setGridPanel(gridPanel); + } /** * Show User customize (modal) @@ -56,9 +61,10 @@ public class CustomizeGridViewDialog extends Window { * @param AD_Tab_ID * @param columnsWidth */ - public static boolean showCustomize (int WindowNo, int AD_Tab_ID, Map columnsWidth,ArrayList gridFieldIds) + public static boolean showCustomize (int WindowNo, int AD_Tab_ID, Map columnsWidth,ArrayList gridFieldIds,GridPanel gridPanel) { CustomizeGridViewDialog customizeWindow = new CustomizeGridViewDialog(WindowNo, AD_Tab_ID, Env.getAD_User_ID(Env.getCtx()), columnsWidth,gridFieldIds); + customizeWindow.setGridPanel(gridPanel); AEnv.showWindow(customizeWindow); return customizeWindow.isSaved(); } // showProduct From 35d23b0cdf8166fe22b0f41f6038f191c1d290aa Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 13 Sep 2012 15:23:28 -0500 Subject: [PATCH 29/79] IDEMPIERE-375 Implement Forgot my Password / Implement back the list of security questions and save the question instead the key --- .../webui/panel/ChangePasswordPanel.java | 30 ++++++++++++------- .../webui/panel/ResetPasswordPanel.java | 11 ++++++- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ChangePasswordPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ChangePasswordPanel.java index 49a3609304..048a40ab02 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ChangePasswordPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ChangePasswordPanel.java @@ -20,6 +20,7 @@ import java.util.Properties; import org.adempiere.exceptions.AdempiereException; import org.adempiere.webui.AdempiereIdGenerator; import org.adempiere.webui.LayoutUtils; +import org.adempiere.webui.component.Combobox; import org.adempiere.webui.component.ConfirmPanel; import org.adempiere.webui.component.Label; import org.adempiere.webui.component.Textbox; @@ -75,10 +76,10 @@ public class ChangePasswordPanel extends Window implements EventListener private Label lblRetypeNewPassword; private Label lblSecurityQuestion; private Label lblAnswer; + private Combobox lstSecurityQuestion; private Textbox txtOldPassword; private Textbox txtNewPassword; private Textbox txtRetypeNewPassword; - private Textbox txtSecurityQuestion; private Textbox txtAnswer; public ChangePasswordPanel(Properties ctx, LoginWindow loginWindow, String userName, String userPassword, boolean show, KeyNamePair[] clientsKNPairs) @@ -168,7 +169,7 @@ public class ChangePasswordPanel extends Window implements EventListener td = new Td(); td.setSclass(ITheme.LOGIN_FIELD_CLASS); tr.appendChild(td); - td.appendChild(txtSecurityQuestion); + td.appendChild(lstSecurityQuestion); tr = new Tr(); tr.setId("rowAnswer"); @@ -215,7 +216,18 @@ public class ChangePasswordPanel extends Window implements EventListener lblAnswer = new Label(); lblAnswer.setId("lblAnswer"); lblAnswer.setValue(Msg.getMsg(m_ctx, "Answer")); + + lstSecurityQuestion = new Combobox(); + lstSecurityQuestion.setAutocomplete(true); + lstSecurityQuestion.setAutodrop(true); + lstSecurityQuestion.setId("lstSecurityQuestion"); + lstSecurityQuestion.setAttribute(AdempiereIdGenerator.ZK_COMPONENT_PREFIX_ATTRIBUTE, "unq" + lstSecurityQuestion.getId()); + lstSecurityQuestion.setWidth("220px"); + lstSecurityQuestion.getItems().clear(); + for (int i = 1; i <= ResetPasswordPanel.NO_OF_SECURITY_QUESTION; i++) + lstSecurityQuestion.appendItem(Msg.getMsg(m_ctx, ResetPasswordPanel.SECURITY_QUESTION_PREFIX + i), ResetPasswordPanel.SECURITY_QUESTION_PREFIX + i); + txtOldPassword = new Textbox(); txtOldPassword.setId("txtOldPassword"); txtOldPassword.setType("password"); @@ -237,12 +249,6 @@ public class ChangePasswordPanel extends Window implements EventListener txtRetypeNewPassword.setCols(25); txtRetypeNewPassword.setWidth("220px"); - txtSecurityQuestion = new Textbox(); - txtSecurityQuestion.setId("txtSecurityQuestion"); - txtSecurityQuestion.setAttribute(AdempiereIdGenerator.ZK_COMPONENT_PREFIX_ATTRIBUTE, "unq" + txtSecurityQuestion.getId()); - txtSecurityQuestion.setCols(25); - txtSecurityQuestion.setWidth("220px"); - txtAnswer = new Textbox(); txtAnswer.setId("txtAnswer"); // txtAnswer.setType("password"); @@ -268,8 +274,12 @@ public class ChangePasswordPanel extends Window implements EventListener { String oldPassword = txtOldPassword.getValue(); String newPassword = txtNewPassword.getValue(); - String retypeNewPassword = txtRetypeNewPassword.getValue(); - String securityQuestion = txtSecurityQuestion.getValue(); + String retypeNewPassword = txtRetypeNewPassword.getValue(); + + String securityQuestion = null; + if (lstSecurityQuestion.getSelectedItem() != null) + securityQuestion = (String) lstSecurityQuestion.getSelectedItem().getLabel(); + String answer = txtAnswer.getValue(); if (Util.isEmpty(oldPassword)) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java index 6b089d1d70..3bdfd23adb 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java @@ -66,7 +66,9 @@ public class ResetPasswordPanel extends Window implements EventListener private static CLogger logger = CLogger.getCLogger(ResetPasswordPanel.class); - private static final int MAX_RESET_PASSWORD_TRIES = 3; + private static final int MAX_RESET_PASSWORD_TRIES = 3; + protected static final int NO_OF_SECURITY_QUESTION = 5; + protected static final String SECURITY_QUESTION_PREFIX = "SecurityQuestion_"; private static final String RESET_PASSWORD_MAIL_TEXT_NAME = "Reset Password"; private LoginWindow wndLogin; @@ -488,6 +490,13 @@ public class ResetPasswordPanel extends Window implements EventListener mailText.setUser(to); String message = mailText.getMailText(true); message = Env.parseVariable(message, to, to.get_TrxName(), true); + + /* ?? DEBUG ?? */ + System.out.println(message); + if (true) + return true; + + EMail email = client.createEMail(to.getEMail(), mailText.getMailHeader(), message, mailText.isHtml()); if (mailText.isHtml()) email.setMessageHTML(mailText.getMailHeader(), message); From f9ca3bc142d199ea99593c1ce3cb4c9e8608d45b Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 13 Sep 2012 15:24:46 -0500 Subject: [PATCH 30/79] IDEMPIERE-375 Implement Forgot my Password / Drop lines used for debugging purposes --- .../src/org/adempiere/webui/panel/ResetPasswordPanel.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java index 3bdfd23adb..ed32beff51 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java @@ -490,13 +490,6 @@ public class ResetPasswordPanel extends Window implements EventListener mailText.setUser(to); String message = mailText.getMailText(true); message = Env.parseVariable(message, to, to.get_TrxName(), true); - - /* ?? DEBUG ?? */ - System.out.println(message); - if (true) - return true; - - EMail email = client.createEMail(to.getEMail(), mailText.getMailHeader(), message, mailText.isHtml()); if (mailText.isHtml()) email.setMessageHTML(mailText.getMailHeader(), message); From a688a3808d421fae42f64955f8f3b90bd162e8d5 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 13 Sep 2012 18:54:59 -0500 Subject: [PATCH 31/79] IDEMPIERE-375 Implement Forgot my Password / Fix problems when login with email --- .../webui/panel/ResetPasswordPanel.java | 172 +++++++++--------- 1 file changed, 85 insertions(+), 87 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java index ed32beff51..079c0f47cb 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java @@ -81,6 +81,8 @@ public class ResetPasswordPanel extends Window implements EventListener private boolean m_noSecurityQuestion; /** Tries Counter */ private int counter; + /** EMail Login preference */ + boolean m_email_login = false; private Label lblSecurityQuestion; private Label lblAnswer; @@ -97,7 +99,8 @@ public class ResetPasswordPanel extends Window implements EventListener m_ctx = ctx; m_userName = userName; m_noSecurityQuestion = noSecurityQuestion; - + m_email_login = MSysConfig.getBooleanValue(MSysConfig.USE_EMAIL_FOR_LOGIN, false); + initComponents(); init(); this.setId("resetPasswordPanel"); @@ -132,35 +135,41 @@ public class ResetPasswordPanel extends Window implements EventListener image.setSrc(ThemeManager.getLargeLogo()); td.appendChild(image); - if (m_noSecurityQuestion) + tr = new Tr(); + tr.setId("rowUser"); + table.appendChild(tr); + td = new Td(); + tr.appendChild(td); + td.setSclass(ITheme.LOGIN_LABEL_CLASS); + td.appendChild(lblUserId); + td = new Td(); + td.setSclass(ITheme.LOGIN_FIELD_CLASS); + tr.appendChild(td); + td.appendChild(txtUserId); + + tr = new Tr(); + tr.setId("rowEmail"); + table.appendChild(tr); + td = new Td(); + tr.appendChild(td); + td.setSclass(ITheme.LOGIN_LABEL_CLASS); + td.appendChild(lblEmail); + td = new Td(); + td.setSclass(ITheme.LOGIN_FIELD_CLASS); + tr.appendChild(td); + td.appendChild(txtEmail); + + if (m_email_login) { + lblEmail.setVisible(false); + txtEmail.setVisible(false); + } else { + lblUserId.setVisible(false); + txtUserId.setVisible(false); + } + + if (! m_noSecurityQuestion) { tr = new Tr(); - tr.setId("rowUser"); - table.appendChild(tr); - td = new Td(); - tr.appendChild(td); - td.setSclass(ITheme.LOGIN_LABEL_CLASS); - td.appendChild(lblUserId); - td = new Td(); - td.setSclass(ITheme.LOGIN_FIELD_CLASS); - tr.appendChild(td); - td.appendChild(txtUserId); - } - else - { - tr = new Tr(); - tr.setId("rowEmail"); - table.appendChild(tr); - td = new Td(); - tr.appendChild(td); - td.setSclass(ITheme.LOGIN_LABEL_CLASS); - td.appendChild(lblEmail); - td = new Td(); - td.setSclass(ITheme.LOGIN_FIELD_CLASS); - tr.appendChild(td); - td.appendChild(txtEmail); - - tr = new Tr(); tr.setId("rowSecurityQuestion"); table.appendChild(tr); td = new Td(); @@ -199,26 +208,29 @@ public class ResetPasswordPanel extends Window implements EventListener private void initComponents() { - if (m_noSecurityQuestion) - { - boolean email_login = MSysConfig.getBooleanValue(MSysConfig.USE_EMAIL_FOR_LOGIN, false); - lblUserId = new Label(); - lblUserId.setId("lblUserId"); - lblUserId.setValue(email_login ? Msg.getMsg(m_ctx, "Name") : Msg.getMsg(m_ctx, "EMail")); - - txtUserId = new Textbox(); - txtUserId.setId("txtUserId"); - txtUserId.setAttribute(AdempiereIdGenerator.ZK_COMPONENT_PREFIX_ATTRIBUTE, "unq" + txtUserId.getId()); - txtUserId.setCols(25); - txtUserId.setMaxlength(40); - txtUserId.setWidth("220px"); - } - else + lblEmail = new Label(); + lblEmail.setId("lblEmail"); + lblEmail.setValue(Msg.getMsg(m_ctx, "EMail")); + + txtEmail = new Textbox(); + txtEmail.setId("txtEmail"); + txtEmail.setAttribute(AdempiereIdGenerator.ZK_COMPONENT_PREFIX_ATTRIBUTE, "unq" + txtEmail.getId()); + txtEmail.setCols(25); + txtEmail.setWidth("220px"); + txtEmail.setReadonly(false); + + lblUserId = new Label(); + lblUserId.setId("lblUserId"); + lblUserId.setValue(Msg.getMsg(m_ctx, "User")); + + txtUserId = new Textbox(); + txtUserId.setId("txtUserId"); + txtUserId.setAttribute(AdempiereIdGenerator.ZK_COMPONENT_PREFIX_ATTRIBUTE, "unq" + txtUserId.getId()); + txtUserId.setCols(25); + txtUserId.setMaxlength(40); + txtUserId.setWidth("220px"); + if (! m_noSecurityQuestion) { - lblEmail = new Label(); - lblEmail.setId("lblEmail"); - lblEmail.setValue(Msg.getMsg(m_ctx, "EMail")); - lblSecurityQuestion = new Label(); lblSecurityQuestion.setId("lblSecurityQuestion"); lblSecurityQuestion.setValue(Msg.getMsg(m_ctx, "SecurityQuestion")); @@ -227,13 +239,6 @@ public class ResetPasswordPanel extends Window implements EventListener lblAnswer.setId("lblAnswer"); lblAnswer.setValue(Msg.getMsg(m_ctx, "Answer")); - txtEmail = new Textbox(); - txtEmail.setId("txtEmail"); - txtEmail.setAttribute(AdempiereIdGenerator.ZK_COMPONENT_PREFIX_ATTRIBUTE, "unq" + txtEmail.getId()); - txtEmail.setCols(25); - txtEmail.setWidth("220px"); - txtEmail.setReadonly(false); - txtSecurityQuestion = new Textbox(); txtSecurityQuestion.setId("txtSecurityQuestion"); txtSecurityQuestion.setAttribute(AdempiereIdGenerator.ZK_COMPONENT_PREFIX_ATTRIBUTE, "unq" + txtSecurityQuestion.getId()); @@ -253,34 +258,31 @@ public class ResetPasswordPanel extends Window implements EventListener private void loadData() { - boolean email_login = MSysConfig.getBooleanValue(MSysConfig.USE_EMAIL_FOR_LOGIN, false); - if (email_login) + if (m_email_login) { txtEmail.setText(m_userName); - loadSecurityQuestion(); + } else { + txtUserId.setText(m_userName); } } private void loadSecurityQuestion() { String email = txtEmail.getValue(); - if (Util.isEmpty(email)) - throw new IllegalArgumentException(Msg.getMsg(m_ctx, "FillMandatory") + " " + lblEmail.getValue()); - + String userid = txtUserId.getValue(); + if (Util.isEmpty(email) || Util.isEmpty(userid)) + throw new IllegalArgumentException(Msg.getMsg(m_ctx, "FillMandatory") + " " + (m_email_login ? lblUserId.getValue() : lblEmail.getValue())); + // TODO: Validation for user with same email uses the same password and security question StringBuilder sql = new StringBuilder("SELECT SecurityQuestion "); sql.append("FROM AD_User "); sql.append("WHERE IsActive='Y' "); - boolean email_login = MSysConfig.getBooleanValue(MSysConfig.USE_EMAIL_FOR_LOGIN, false); - if (email_login) - sql.append("AND EMail=? "); - else - sql.append("AND COALESCE(LDAPUser,Name)=? "); + sql.append("AND COALESCE(LDAPUser,Name)=? "); sql.append("AND EMail=? "); sql.append("AND SecurityQuestion IS NOT NULL "); sql.append("ORDER BY AD_Client_ID DESC"); - String securityQuestion = DB.getSQLValueString(null, sql.toString(), m_userName, email); + String securityQuestion = DB.getSQLValueString(null, sql.toString(), userid, email); txtSecurityQuestion.setValue(securityQuestion); txtEmail.setReadonly(true); @@ -306,9 +308,10 @@ public class ResetPasswordPanel extends Window implements EventListener private void validateEmail() { String email = txtEmail.getValue(); - if (Util.isEmpty(email)) - throw new IllegalArgumentException(Msg.getMsg(m_ctx, "FillMandatory") + " " + lblEmail.getValue()); - + String userid = txtUserId.getValue(); + if (Util.isEmpty(email) || Util.isEmpty(userid)) + throw new IllegalArgumentException(Msg.getMsg(m_ctx, "FillMandatory") + " " + (m_email_login ? lblUserId.getValue() : lblEmail.getValue())); + StringBuilder whereClause = new StringBuilder("Password IS NOT NULL "); whereClause.append("AND COALESCE(LDAPUser,Name)=? "); whereClause.append("AND EMail=? "); @@ -322,7 +325,7 @@ public class ResetPasswordPanel extends Window implements EventListener .append(" AD_User.IsActive='Y'"); List users = new Query(m_ctx, MUser.Table_Name, whereClause.toString(), null) - .setParameters(m_userName, email) + .setParameters(userid, email) .setOrderBy(MUser.COLUMNNAME_AD_User_ID) .list(); @@ -334,25 +337,16 @@ public class ResetPasswordPanel extends Window implements EventListener private void validateResetPassword() { + String email = txtEmail.getValue(); + String userid = txtUserId.getValue(); + if (Util.isEmpty(email) || Util.isEmpty(userid)) + throw new IllegalArgumentException(Msg.getMsg(m_ctx, "FillMandatory") + " " + (m_email_login ? lblUserId.getValue() : lblEmail.getValue())); List users = null; if (m_noSecurityQuestion) { - String userId = txtUserId.getValue(); - if (Util.isEmpty(userId)) - throw new IllegalArgumentException(Msg.getMsg(m_ctx, "FillMandatory") + " " + lblUserId.getValue()); - StringBuilder whereClause = new StringBuilder("Password IS NOT NULL "); - boolean email_login = MSysConfig.getBooleanValue(MSysConfig.USE_EMAIL_FOR_LOGIN, false); - if (email_login) - { - whereClause.append("AND EMail=? "); - whereClause.append("AND COALESCE(LDAPUser,Name)=? "); - } - else - { - whereClause.append("AND COALESCE(LDAPUser,Name)=? "); - whereClause.append("AND EMail=? "); - } + whereClause.append("AND COALESCE(LDAPUser,Name)=? "); + whereClause.append("AND EMail=? "); whereClause.append(" AND") .append(" EXISTS (SELECT * FROM AD_User_Roles ur") .append(" INNER JOIN AD_Role r ON (ur.AD_Role_ID=r.AD_Role_ID)") @@ -363,13 +357,12 @@ public class ResetPasswordPanel extends Window implements EventListener .append(" AD_User.IsActive='Y'"); users = new Query(m_ctx, MUser.Table_Name, whereClause.toString(), null) - .setParameters(m_userName, userId) + .setParameters(userid, email) .setOrderBy(MUser.COLUMNNAME_AD_User_ID) .list(); } else { - String email = txtEmail.getValue(); String securityQuestion = txtSecurityQuestion.getValue(); String answer = txtAnswer.getValue(); @@ -490,6 +483,11 @@ public class ResetPasswordPanel extends Window implements EventListener mailText.setUser(to); String message = mailText.getMailText(true); message = Env.parseVariable(message, to, to.get_TrxName(), true); + + /* BORRAR DEBUG ?? */ + System.out.println(message); + if (true) return true; + EMail email = client.createEMail(to.getEMail(), mailText.getMailHeader(), message, mailText.isHtml()); if (mailText.isHtml()) email.setMessageHTML(mailText.getMailHeader(), message); From ae3906ad4f37025c7807ebb3dad63621af84348c Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 13 Sep 2012 18:56:15 -0500 Subject: [PATCH 32/79] IDEMPIERE-375 Implement Forgot my Password / Drop lines used for debugging purposes --- .../src/org/adempiere/webui/panel/ResetPasswordPanel.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java index 079c0f47cb..338874f01d 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java @@ -483,11 +483,6 @@ public class ResetPasswordPanel extends Window implements EventListener mailText.setUser(to); String message = mailText.getMailText(true); message = Env.parseVariable(message, to, to.get_TrxName(), true); - - /* BORRAR DEBUG ?? */ - System.out.println(message); - if (true) return true; - EMail email = client.createEMail(to.getEMail(), mailText.getMailHeader(), message, mailText.isHtml()); if (mailText.isHtml()) email.setMessageHTML(mailText.getMailHeader(), message); From d7345e64f41858af071484d0560006cad826669e Mon Sep 17 00:00:00 2001 From: Elaine Tan Date: Fri, 14 Sep 2012 17:16:23 +0800 Subject: [PATCH 33/79] =?UTF-8?q?Ticket=20#1001226:=20Implement=20?= =?UTF-8?q?=E2=80=98Forgot=20my=20Password=E2=80=99=20-=20IDEMPIERE-375=20?= =?UTF-8?q?-=20Apply=20security=20question=20change=20to=20Swing=20UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/org/compiere/apps/ALogin.java | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ALogin.java b/org.adempiere.ui.swing/src/org/compiere/apps/ALogin.java index 3d05870ddd..286aed7677 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ALogin.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/ALogin.java @@ -65,6 +65,7 @@ import org.compiere.util.Login; import org.compiere.util.Msg; import org.compiere.util.Trx; import org.compiere.util.Util; +import org.compiere.util.ValueNamePair; /** * Application Login Window @@ -120,6 +121,9 @@ public final class ALogin extends CDialog private static final int CONNECTED_OK = 0; private static final int CONNECTED_OK_WITH_PASSWORD_EXPIRED = 1; + private static final int NO_OF_SECURITY_QUESTION = 5; + private static final String SECURITY_QUESTION_PREFIX = "SecurityQuestion_"; + private CPanel mainPanel = new CPanel(new BorderLayout()); private CTabbedPane loginTabPane = new CTabbedPane(); private CPanel connectionPanel = new CPanel(); @@ -168,7 +172,7 @@ public final class ALogin extends CDialog // private CLabel lblSecurityQuestion = new CLabel(); private CLabel lblAnswer = new CLabel(); - private CTextField txtSecurityQuestion = new CTextField(); + private VComboBox lstSecurityQuestion = new VComboBox(); private CTextField txtAnswer = new CTextField(); /** Server Connection */ @@ -379,12 +383,16 @@ public final class ALogin extends CDialog lblRetypeNewPassword.setHorizontalAlignment(SwingConstants.RIGHT); lblRetypeNewPassword.setText(Msg.getMsg(m_ctx, "New Password Confirm")); - txtSecurityQuestion.setName("txtSecurityQuestion"); + lstSecurityQuestion.setName("lstSecurityQuestion"); lblSecurityQuestion.setRequestFocusEnabled(false); - lblSecurityQuestion.setLabelFor(txtSecurityQuestion); + lblSecurityQuestion.setLabelFor(lstSecurityQuestion); lblSecurityQuestion.setHorizontalAlignment(SwingConstants.RIGHT); lblSecurityQuestion.setText(Msg.getMsg(m_ctx, "SecurityQuestion")); + lstSecurityQuestion.removeAllItems(); + for (int i = 1; i <= NO_OF_SECURITY_QUESTION; i++) + lstSecurityQuestion.addItem(new ValueNamePair(SECURITY_QUESTION_PREFIX + i, Msg.getMsg(m_ctx, SECURITY_QUESTION_PREFIX + i))); + txtAnswer.setName("txtAnswer"); lblAnswer.setRequestFocusEnabled(false); lblAnswer.setLabelFor(txtAnswer); @@ -407,7 +415,7 @@ public final class ALogin extends CDialog ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); changePasswordPanel.add(lblSecurityQuestion, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); - changePasswordPanel.add(txtSecurityQuestion, new GridBagConstraints(1, 3, 1, 1, 1.0, 0.0 + changePasswordPanel.add(lstSecurityQuestion, new GridBagConstraints(1, 3, 1, 1, 1.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); changePasswordPanel.add(lblAnswer, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0 ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); @@ -649,7 +657,9 @@ public final class ALogin extends CDialog String newPassword = new String(txtNewPassword.getPassword()); String retypeNewPassword = new String(txtRetypeNewPassword.getPassword()); - String securityQuestion = txtSecurityQuestion.getText(); + String securityQuestion = null; + if (lstSecurityQuestion.getSelectedItem() != null) + securityQuestion = ((ValueNamePair) lstSecurityQuestion.getSelectedItem()).getName(); String answer = txtAnswer.getText(); if (Util.isEmpty(oldPassword)) From f78d6dbcf21c04428714b9cc06226d2b8717962e Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 17 Sep 2012 09:56:14 -0500 Subject: [PATCH 34/79] IDEMPIERE-426 Product Attribute Assignment Window is being duplicated --- .../src/org/adempiere/webui/editor/WPAttributeEditor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WPAttributeEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WPAttributeEditor.java index 6dd5cc3d0d..caad530735 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WPAttributeEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WPAttributeEditor.java @@ -68,7 +68,7 @@ public class WPAttributeEditor extends WEditor implements ContextMenuListener private void initComponents() { getComponent().setButtonImage("images/PAttribute10.png"); - getComponent().addEventListener(Events.ON_CLICK, this); + // getComponent().addEventListener(Events.ON_CLICK, this); // IDEMPIERE-426 - dup listener, already set at WEditor m_WindowNo = gridField.getWindowNo(); m_mPAttribute = gridField.getLookup(); From d561f2b556f37d0256df63f7c644dab22bb9af04 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 17 Sep 2012 10:16:26 -0500 Subject: [PATCH 35/79] IDEMPIERE-419 New icon shouldn't be displayed for special forms --- .../src/org/adempiere/webui/dashboard/DPFavourites.java | 4 ++-- .../src/org/adempiere/webui/panel/AbstractMenuPanel.java | 9 +++++++-- .../org/adempiere/webui/panel/MenuTreeFilterPanel.java | 7 +++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPFavourites.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPFavourites.java index bcf254556d..db06499601 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPFavourites.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPFavourites.java @@ -127,8 +127,8 @@ public class DPFavourites extends DashboardPanel implements EventListener while (en.hasMoreElements()) { MTreeNode nd = (MTreeNode)en.nextElement(); - if (nd.isOnBar()) { - addNode(nd.getNode_ID(), nd.toString().trim(), nd.getDescription(), getIconFile(nd), nd.isWindow()); + if (nd.isOnBar()) { + addNode(nd.getNode_ID(), nd.toString().trim(), nd.getDescription(), getIconFile(nd), (nd.isWindow() && !nd.isForm())); } } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/AbstractMenuPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/AbstractMenuPanel.java index 2201f19497..14e6ca1e03 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/AbstractMenuPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/AbstractMenuPanel.java @@ -221,11 +221,16 @@ public abstract class AbstractMenuPanel extends Panel implements EventListener, public void run(Treeitem treeItem) { if (treeItem.getAttribute("menu.type") != null) { + String menuType = (String) treeItem.getAttribute("menu.type"); + if (menuType.equals("form")) + menuType = "window"; // treat forms as windows on filtering the menu if (chk.isChecked()) { - if (chk.getId().equals(treeItem.getAttribute("menu.type"))) + if (chk.getId().equals(menuType)) { boolean open = false; Treeitem parent = treeItem.getParentItem(); @@ -172,7 +175,7 @@ public class MenuTreeFilterPanel extends Popup implements EventListener, } else { - if (chk.getId().equals(treeItem.getAttribute("menu.type"))) + if (chk.getId().equals(menuType)) { boolean open = false; Treeitem parent = treeItem.getParentItem(); From 7f4c2934c091acf662889d43f777e40af3593e66 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 17 Sep 2012 16:30:08 -0500 Subject: [PATCH 36/79] =?UTF-8?q?IDEMPIERE-308=20Performance:=20Replace=20?= =?UTF-8?q?use=20of=20StringBuffer=20and=20String=20concatenation=20with?= =?UTF-8?q?=20StringBuilder=20-=20thanks=20to=20David=20Pe=C3=B1uela?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/adempiere/model/MRelationType.java | 54 ++++++------ .../org/adempiere/model/PromotionRule.java | 34 ++++---- .../adempiere/process/ResetLockedAccount.java | 26 +++--- .../util/ModelInterfaceGenerator.java | 46 +++++------ .../src/org/compiere/acct/Doc.java | 18 ++-- .../org/compiere/acct/DocLine_Allocation.java | 8 +- .../src/org/compiere/acct/DocManager.java | 16 ++-- .../src/org/compiere/acct/DocTax.java | 8 +- .../org/compiere/acct/Doc_AllocationHdr.java | 50 +++++------ .../src/org/compiere/acct/Doc_Invoice.java | 22 ++--- .../src/org/compiere/acct/Doc_Order.java | 82 +++++++++---------- .../src/org/compiere/acct/Doc_Production.java | 10 +-- .../org/compiere/acct/Doc_ProjectIssue.java | 18 ++-- .../src/org/compiere/acct/FactLine.java | 36 ++++---- .../src/org/compiere/acct/Matcher.java | 24 +++--- .../src/org/compiere/acct/ProductInfo.java | 28 +++---- .../src/org/compiere/impexp/ImpFormat.java | 22 ++--- .../src/org/compiere/impexp/MImpFormat.java | 8 +- .../src/org/compiere/model/GridFieldVO.java | 14 ++-- .../src/org/compiere/model/GridWindow.java | 18 ++-- .../src/compiere/model/CalloutUser.java | 26 +++--- 21 files changed, 285 insertions(+), 283 deletions(-) diff --git a/org.adempiere.base/src/org/adempiere/model/MRelationType.java b/org.adempiere.base/src/org/adempiere/model/MRelationType.java index 3d121ac01c..e67b83bb28 100644 --- a/org.adempiere.base/src/org/adempiere/model/MRelationType.java +++ b/org.adempiere.base/src/org/adempiere/model/MRelationType.java @@ -63,32 +63,32 @@ public class MRelationType extends X_AD_RelationType implements IZoomProvider { * Warning: Doesn't support POs with more or less than one key * column. */ - final static String SQL = // - " SELECT " // - + " rt.AD_RelationType_ID AS " + COLUMNNAME_AD_RelationType_ID // - + ", rt.Name AS " + COLUMNNAME_Name // - + ", rt.IsDirected AS " + COLUMNNAME_IsDirected // - + ", ref.AD_Reference_ID AS " + COLUMNNAME_AD_Reference_ID // - + ", tab.WhereClause AS " + COLUMNNAME_WhereClause // - + ", tab.OrderByClause AS " + COLUMNNAME_OrderByClause // - + " FROM" // - + " AD_RelationType rt, AD_Reference ref, AD_Ref_Table tab" // - + " WHERE " // - + " rt.IsActive='Y'" // - + " AND ref.IsActive='Y'" // - + " AND ref.ValidationType='T'" // must have table validation - + " AND (" // join the source AD_Reference - + " rt.AD_Reference_Source_ID=ref.AD_Reference_ID" // - + " OR (" // not directed? -> also join the target AD_Reference - + " rt.IsDirected='N' " // - + " AND rt.AD_Reference_Target_ID=ref.AD_Reference_ID" // - + " )" // - + " )" // - + " AND tab.IsActive='Y'" // Join the AD_Reference's AD_Ref_Table - + " AND tab.AD_Reference_ID=ref.AD_Reference_ID" // - + " AND tab.AD_Table_ID=?" // - + " AND tab.AD_Key=?" // - + " ORDER BY rt.Name"; + final static StringBuffer SQL = // + new StringBuffer(" SELECT " )// + .append(" rt.AD_RelationType_ID AS ").append(COLUMNNAME_AD_RelationType_ID) // + .append(", rt.Name AS ").append(COLUMNNAME_Name )// + .append(", rt.IsDirected AS ").append(COLUMNNAME_IsDirected) // + .append(", ref.AD_Reference_ID AS ").append(COLUMNNAME_AD_Reference_ID) // + .append(", tab.WhereClause AS ").append(COLUMNNAME_WhereClause) // + .append(", tab.OrderByClause AS ").append(COLUMNNAME_OrderByClause) // + .append(" FROM") // + .append(" AD_RelationType rt, AD_Reference ref, AD_Ref_Table tab") // + .append(" WHERE ") // + .append(" rt.IsActive='Y'") // + .append(" AND ref.IsActive='Y'") // + .append(" AND ref.ValidationType='T'") // must have table validation + .append(" AND (") // join the source AD_Reference + .append(" rt.AD_Reference_Source_ID=ref.AD_Reference_ID") // + .append(" OR (") // not directed? -> also join the target AD_Reference + .append(" rt.IsDirected='N' ") // + .append(" AND rt.AD_Reference_Target_ID=ref.AD_Reference_ID") // + .append(" )") // + .append(" )") // + .append(" AND tab.IsActive='Y'") // Join the AD_Reference's AD_Ref_Table + .append(" AND tab.AD_Reference_ID=ref.AD_Reference_ID") // + .append(" AND tab.AD_Table_ID=?") // + .append(" AND tab.AD_Key=?") // + .append(" ORDER BY rt.Name"); final static String SQL_WINDOW_NAME = "SELECT Name FROM AD_Window WHERE AD_WINDOW_ID=?"; @@ -131,7 +131,7 @@ public class MRelationType extends X_AD_RelationType implements IZoomProvider { final int colId = MColumn.getColumn_ID(po.get_TableName(), keyColumn); - final PreparedStatement pstmt = DB.prepareStatement(SQL, po + final PreparedStatement pstmt = DB.prepareStatement(SQL.toString(), po .get_TrxName()); ResultSet rs = null; diff --git a/org.adempiere.base/src/org/adempiere/model/PromotionRule.java b/org.adempiere.base/src/org/adempiere/model/PromotionRule.java index 55cd1fc815..af5f4ab9ae 100644 --- a/org.adempiere.base/src/org/adempiere/model/PromotionRule.java +++ b/org.adempiere.base/src/org/adempiere/model/PromotionRule.java @@ -326,8 +326,8 @@ public class PromotionRule { * @throws Exception */ private static Map> findM_Promotion_ID(MOrder order) throws Exception { - String select = "SELECT M_Promotion.M_Promotion_ID From M_Promotion Inner Join M_PromotionPreCondition " - + " ON (M_Promotion.M_Promotion_ID = M_PromotionPreCondition.M_Promotion_ID)"; + StringBuffer select = new StringBuffer("SELECT M_Promotion.M_Promotion_ID From M_Promotion Inner Join M_PromotionPreCondition ") + .append(" ON (M_Promotion.M_Promotion_ID = M_PromotionPreCondition.M_Promotion_ID)"); String bpFilter = "M_PromotionPreCondition.C_BPartner_ID = ? OR M_PromotionPreCondition.C_BP_Group_ID = ? OR (M_PromotionPreCondition.C_BPartner_ID IS NULL AND M_PromotionPreCondition.C_BP_Group_ID IS NULL)"; String priceListFilter = "M_PromotionPreCondition.M_PriceList_ID IS NULL OR M_PromotionPreCondition.M_PriceList_ID = ?"; @@ -414,12 +414,12 @@ public class PromotionRule { private static DistributionSet calculateDistributionQty(MPromotionDistribution distribution, DistributionSet prevSet, List validPromotionLineIDs, Map orderLineQty, List orderLineIdList, String trxName) throws Exception { - String sql = "SELECT C_OrderLine.C_OrderLine_ID FROM M_PromotionLine" - + " INNER JOIN M_PromotionGroup ON (M_PromotionLine.M_PromotionGroup_ID = M_PromotionGroup.M_PromotionGroup_ID AND M_PromotionGroup.IsActive = 'Y')" - + " INNER JOIN M_PromotionGroupLine ON (M_PromotionGroup.M_PromotionGroup_ID = M_PromotionGroupLine.M_PromotionGroup_ID AND M_PromotionGroupLine.IsActive = 'Y')" - + " INNER JOIN C_OrderLine ON (M_PromotionGroupLine.M_Product_ID = C_OrderLine.M_Product_ID)" - + " WHERE M_PromotionLine.M_PromotionLine_ID = ? AND C_OrderLine.C_OrderLine_ID = ?" - + " AND M_PromotionLine.IsActive = 'Y'"; + StringBuilder sql = new StringBuilder("SELECT C_OrderLine.C_OrderLine_ID FROM M_PromotionLine") + .append(" INNER JOIN M_PromotionGroup ON (M_PromotionLine.M_PromotionGroup_ID = M_PromotionGroup.M_PromotionGroup_ID AND M_PromotionGroup.IsActive = 'Y')") + .append(" INNER JOIN M_PromotionGroupLine ON (M_PromotionGroup.M_PromotionGroup_ID = M_PromotionGroupLine.M_PromotionGroup_ID AND M_PromotionGroupLine.IsActive = 'Y')") + .append(" INNER JOIN C_OrderLine ON (M_PromotionGroupLine.M_Product_ID = C_OrderLine.M_Product_ID)") + .append(" WHERE M_PromotionLine.M_PromotionLine_ID = ? AND C_OrderLine.C_OrderLine_ID = ?") + .append(" AND M_PromotionLine.IsActive = 'Y'"); DistributionSet distributionSet = new DistributionSet(); ListeligibleOrderLineIDs = new ArrayList(); @@ -434,7 +434,7 @@ public class PromotionRule { PreparedStatement stmt = null; ResultSet rs = null; try { - stmt = DB.prepareStatement(sql, trxName); + stmt = DB.prepareStatement(sql.toString(), trxName); stmt.setInt(1, distribution.getM_PromotionLine_ID()); stmt.setInt(2, C_OrderLine_ID); rs = stmt.executeQuery(); @@ -547,17 +547,17 @@ public class PromotionRule { for (MPromotionLine pl : plist) { boolean match = false; if (pl.getM_PromotionGroup_ID() > 0) { - String sql = "SELECT DISTINCT C_OrderLine.C_OrderLine_ID FROM M_PromotionGroup INNER JOIN M_PromotionGroupLine" - + " ON (M_PromotionGroup.M_PromotionGroup_ID = M_PromotionGroupLine.M_PromotionGroup_ID AND M_PromotionGroupLine.IsActive = 'Y')" - + " INNER JOIN C_OrderLine ON (M_PromotionGroupLine.M_Product_ID = C_OrderLine.M_Product_ID)" - + " INNER JOIN M_PromotionLine ON (M_PromotionLine.M_PromotionGroup_ID = M_PromotionGroup.M_PromotionGroup_ID)" - + " WHERE M_PromotionLine.M_PromotionLine_ID = ? AND C_OrderLine.C_Order_ID = ?" - + " AND M_PromotionLine.IsActive = 'Y'" - + " AND M_PromotionGroup.IsActive = 'Y'"; + StringBuilder sql = new StringBuilder("SELECT DISTINCT C_OrderLine.C_OrderLine_ID FROM M_PromotionGroup INNER JOIN M_PromotionGroupLine") + .append(" ON (M_PromotionGroup.M_PromotionGroup_ID = M_PromotionGroupLine.M_PromotionGroup_ID AND M_PromotionGroupLine.IsActive = 'Y')") + .append(" INNER JOIN C_OrderLine ON (M_PromotionGroupLine.M_Product_ID = C_OrderLine.M_Product_ID)") + .append(" INNER JOIN M_PromotionLine ON (M_PromotionLine.M_PromotionGroup_ID = M_PromotionGroup.M_PromotionGroup_ID)") + .append(" WHERE M_PromotionLine.M_PromotionLine_ID = ? AND C_OrderLine.C_Order_ID = ?") + .append(" AND M_PromotionLine.IsActive = 'Y'") + .append(" AND M_PromotionGroup.IsActive = 'Y'"); PreparedStatement stmt = null; ResultSet rs = null; try { - stmt = DB.prepareStatement(sql, order.get_TrxName()); + stmt = DB.prepareStatement(sql.toString(), order.get_TrxName()); stmt.setInt(1, pl.getM_PromotionLine_ID()); stmt.setInt(2, order.getC_Order_ID()); rs = stmt.executeQuery(); diff --git a/org.adempiere.base/src/org/adempiere/process/ResetLockedAccount.java b/org.adempiere.base/src/org/adempiere/process/ResetLockedAccount.java index 562bef93f9..7fd77275b2 100644 --- a/org.adempiere.base/src/org/adempiere/process/ResetLockedAccount.java +++ b/org.adempiere.base/src/org/adempiere/process/ResetLockedAccount.java @@ -47,11 +47,11 @@ public class ResetLockedAccount extends SvrProcess { if (!user.isLocked()) throw new AdempiereException("User " + user.getName() + " is not locked"); - String sql = "UPDATE AD_User SET IsLocked = 'N', DateAccountLocked=NULL, FailedLoginCount=0, DateLastLogin=NULL, Updated=SysDate " - + " WHERE IsLocked='Y' AND AD_Client_ID = ? " - + " AND DateAccountLocked IS NOT NULL " - + " AND AD_User_ID = " + user.getAD_User_ID(); - int no = DB.executeUpdate(sql, new Object[] { p_AD_Client_ID }, false, get_TrxName()); + StringBuffer sql = new StringBuffer ("UPDATE AD_User SET IsLocked = 'N', DateAccountLocked=NULL, FailedLoginCount=0, DateLastLogin=NULL, Updated=SysDate ") + .append(" WHERE IsLocked='Y' AND AD_Client_ID = ? ") + .append(" AND DateAccountLocked IS NOT NULL ") + .append(" AND AD_User_ID = " + user.getAD_User_ID()); + int no = DB.executeUpdate(sql.toString(), new Object[] { p_AD_Client_ID }, false, get_TrxName()); if (no < 0) throw new AdempiereException("Could not unlock user account" + user.toString()); @@ -62,26 +62,26 @@ public class ResetLockedAccount extends SvrProcess { int MAX_ACCOUNT_LOCK_MINUTES = MSysConfig.getIntValue(MSysConfig.USER_LOCKING_MAX_ACCOUNT_LOCK_MINUTES, 0); int MAX_INACTIVE_PERIOD = MSysConfig.getIntValue(MSysConfig.USER_LOCKING_MAX_INACTIVE_PERIOD_DAY, 0); - String sql = "UPDATE AD_User SET IsLocked = 'N', DateAccountLocked=NULL, FailedLoginCount=0, DateLastLogin=NULL, Updated=SysDate " - + " WHERE IsLocked='Y' AND AD_Client_ID IN (0, ?) " - + " AND DateAccountLocked IS NOT NULL"; + StringBuffer sql = new StringBuffer("UPDATE AD_User SET IsLocked = 'N', DateAccountLocked=NULL, FailedLoginCount=0, DateLastLogin=NULL, Updated=SysDate ") + .append(" WHERE IsLocked='Y' AND AD_Client_ID IN (0, ?) ") + .append(" AND DateAccountLocked IS NOT NULL"); if (DB.isPostgreSQL()) { if (MAX_ACCOUNT_LOCK_MINUTES > 0) - sql += " AND EXTRACT(MINUTE FROM (now()-DateAccountLocked)) * 24 * 60 > " + MAX_ACCOUNT_LOCK_MINUTES; + sql.append( " AND EXTRACT(MINUTE FROM (now()-DateAccountLocked)) * 24 * 60 > ").append(MAX_ACCOUNT_LOCK_MINUTES); if (MAX_INACTIVE_PERIOD > 0) - sql += " AND EXTRACT(DAY FROM (now()-DateLastLogin)) * 24 <= " + MAX_INACTIVE_PERIOD; + sql.append(" AND EXTRACT(DAY FROM (now()-DateLastLogin)) * 24 <= ").append(MAX_INACTIVE_PERIOD); } else { if (MAX_ACCOUNT_LOCK_MINUTES > 0) - sql += " AND (SysDate-DateAccountLocked) * 24 * 60 > " + MAX_ACCOUNT_LOCK_MINUTES; + sql.append(" AND (SysDate-DateAccountLocked) * 24 * 60 > ").append(MAX_ACCOUNT_LOCK_MINUTES); if (MAX_INACTIVE_PERIOD > 0) - sql += " AND (SysDate-DateLastLogin) * 24 <= " + MAX_INACTIVE_PERIOD; + sql.append(" AND (SysDate-DateLastLogin) * 24 <= ").append(MAX_INACTIVE_PERIOD); } - int no = DB.executeUpdate(sql, p_AD_Client_ID, get_TrxName()); + int no = DB.executeUpdate(sql.toString(), p_AD_Client_ID, get_TrxName()); if (no < 0) throw new AdempiereException("Could not unlock user account"); return no + " locked account has been reset"; diff --git a/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java b/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java index 2fe2cdb28e..f1884357d3 100644 --- a/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java +++ b/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java @@ -233,23 +233,23 @@ public class ModelInterfaceGenerator */ private StringBuffer createColumns(int AD_Table_ID, StringBuffer mandatory) { StringBuffer sb = new StringBuffer(); - String sql = "SELECT c.ColumnName, c.IsUpdateable, c.IsMandatory," // 1..3 - + " c.AD_Reference_ID, c.AD_Reference_Value_ID, DefaultValue, SeqNo, " // 4..7 - + " c.FieldLength, c.ValueMin, c.ValueMax, c.VFormat, c.Callout, " // 8..12 - + " c.Name, c.Description, c.ColumnSQL, c.IsEncrypted, c.IsKey " // 13..17 - + "FROM AD_Column c " - + "WHERE c.AD_Table_ID=?" + StringBuffer sql = new StringBuffer("SELECT c.ColumnName, c.IsUpdateable, c.IsMandatory,") // 1..3 + .append(" c.AD_Reference_ID, c.AD_Reference_Value_ID, DefaultValue, SeqNo, ") // 4..7 + .append(" c.FieldLength, c.ValueMin, c.ValueMax, c.VFormat, c.Callout, ") // 8..12 + .append(" c.Name, c.Description, c.ColumnSQL, c.IsEncrypted, c.IsKey ") // 13..17 + .append("FROM AD_Column c ") + .append("WHERE c.AD_Table_ID=?") // + " AND c.ColumnName <> 'AD_Client_ID'" // + " AND c.ColumnName <> 'AD_Org_ID'" // + " AND c.ColumnName <> 'IsActive'" // + " AND c.ColumnName NOT LIKE 'Created%'" // + " AND c.ColumnName NOT LIKE 'Updated%' " - + " AND c.IsActive='Y'" - + " ORDER BY c.ColumnName"; + .append(" AND c.IsActive='Y'") + .append(" ORDER BY c.ColumnName"); PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql, null); + pstmt = DB.prepareStatement(sql.toString(), null); pstmt.setInt(1, AD_Table_ID); rs = pstmt.executeQuery(); while (rs.next()) { @@ -289,7 +289,7 @@ public class ModelInterfaceGenerator } catch (SQLException e) { - throw new DBException(e, sql); + throw new DBException(e, sql.toString()); } finally { @@ -495,15 +495,15 @@ public class ModelInterfaceGenerator else if ((DisplayType.Table == displayType || DisplayType.Search == displayType) && AD_Reference_ID > 0) { - String sql = "SELECT c.AD_Reference_ID, c.AD_Reference_Value_ID" - +" FROM AD_Ref_Table rt" - +" INNER JOIN AD_Column c ON (c.AD_Column_ID=rt.AD_Key)" - +" WHERE rt.AD_Reference_ID=?"; + StringBuffer sql = new StringBuffer("SELECT c.AD_Reference_ID, c.AD_Reference_Value_ID") + .append(" FROM AD_Ref_Table rt") + .append(" INNER JOIN AD_Column c ON (c.AD_Column_ID=rt.AD_Key)") + .append(" WHERE rt.AD_Reference_ID=?"); PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql, null); + pstmt = DB.prepareStatement(sql.toString(), null); pstmt.setInt(1, AD_Reference_ID); rs = pstmt.executeQuery(); if (rs.next()) @@ -518,7 +518,7 @@ public class ModelInterfaceGenerator } catch (SQLException e) { - throw new DBException(e, sql); + throw new DBException(e, sql.toString()); } finally { @@ -670,17 +670,17 @@ public class ModelInterfaceGenerator if (AD_Table_ID == 707 && columnName.equals("Account_ID")) return null; // - final String sql = "SELECT t.TableName, t.EntityType, ck.AD_Reference_ID" - +" FROM AD_Ref_Table rt" - +" INNER JOIN AD_Table t ON (t.AD_Table_ID=rt.AD_Table_ID)" - +" INNER JOIN AD_Column ck ON (ck.AD_Table_ID=rt.AD_Table_ID AND ck.AD_Column_ID=rt.AD_Key)" - +" WHERE rt.AD_Reference_ID=?" + final StringBuffer sql = new StringBuffer("SELECT t.TableName, t.EntityType, ck.AD_Reference_ID") + .append(" FROM AD_Ref_Table rt") + .append(" INNER JOIN AD_Table t ON (t.AD_Table_ID=rt.AD_Table_ID)") + .append(" INNER JOIN AD_Column ck ON (ck.AD_Table_ID=rt.AD_Table_ID AND ck.AD_Column_ID=rt.AD_Key)") + .append(" WHERE rt.AD_Reference_ID=?") ; PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql, null); + pstmt = DB.prepareStatement(sql.toString(), null); pstmt.setInt(1, AD_Reference_ID); rs = pstmt.executeQuery(); if (rs.next()) @@ -705,7 +705,7 @@ public class ModelInterfaceGenerator } catch (SQLException e) { - throw new DBException(e, sql); + throw new DBException(e, sql.toString()); } finally { diff --git a/org.adempiere.base/src/org/compiere/acct/Doc.java b/org.adempiere.base/src/org/compiere/acct/Doc.java index 8f2f5077c0..6e4c468b1d 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc.java @@ -841,11 +841,11 @@ public abstract class Doc // We have a document Type, but no GL info - search for DocType if (m_GL_Category_ID == 0) { - String sql = "SELECT GL_Category_ID FROM C_DocType " - + "WHERE AD_Client_ID=? AND DocBaseType=?"; + StringBuilder sql = new StringBuilder("SELECT GL_Category_ID FROM C_DocType ") + .append("WHERE AD_Client_ID=? AND DocBaseType=?"); try { - PreparedStatement pstmt = DB.prepareStatement(sql, null); + PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null); pstmt.setInt(1, getAD_Client_ID()); pstmt.setString(2, m_DocumentType); ResultSet rsDT = pstmt.executeQuery(); @@ -856,19 +856,19 @@ public abstract class Doc } catch (SQLException e) { - log.log(Level.SEVERE, sql, e); + log.log(Level.SEVERE, sql.toString(), e); } } // Still no GL_Category - get Default GL Category if (m_GL_Category_ID == 0) { - String sql = "SELECT GL_Category_ID FROM GL_Category " - + "WHERE AD_Client_ID=? " - + "ORDER BY IsDefault DESC"; + StringBuilder sql = new StringBuilder("SELECT GL_Category_ID FROM GL_Category ") + .append("WHERE AD_Client_ID=? ") + .append("ORDER BY IsDefault DESC"); try { - PreparedStatement pstmt = DB.prepareStatement(sql, null); + PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null); pstmt.setInt(1, getAD_Client_ID()); ResultSet rsDT = pstmt.executeQuery(); if (rsDT.next()) @@ -878,7 +878,7 @@ public abstract class Doc } catch (SQLException e) { - log.log(Level.SEVERE, sql, e); + log.log(Level.SEVERE, sql.toString(), e); } } // diff --git a/org.adempiere.base/src/org/compiere/acct/DocLine_Allocation.java b/org.adempiere.base/src/org/compiere/acct/DocLine_Allocation.java index 29bc606919..28c833940e 100644 --- a/org.adempiere.base/src/org/compiere/acct/DocLine_Allocation.java +++ b/org.adempiere.base/src/org/compiere/acct/DocLine_Allocation.java @@ -71,10 +71,10 @@ public class DocLine_Allocation extends DocLine { if (m_C_Invoice_ID == 0) return 0; - String sql = "SELECT C_Currency_ID " - + "FROM C_Invoice " - + "WHERE C_Invoice_ID=?"; - return DB.getSQLValue(null, sql, m_C_Invoice_ID); + StringBuilder sql = new StringBuilder("SELECT C_Currency_ID ") + .append("FROM C_Invoice ") + .append("WHERE C_Invoice_ID=?"); + return DB.getSQLValue(null, sql.toString(), m_C_Invoice_ID); } // getInvoiceC_Currency_ID /** diff --git a/org.adempiere.base/src/org/compiere/acct/DocManager.java b/org.adempiere.base/src/org/compiere/acct/DocManager.java index 76af3bfd98..adc71421d8 100644 --- a/org.adempiere.base/src/org/compiere/acct/DocManager.java +++ b/org.adempiere.base/src/org/compiere/acct/DocManager.java @@ -68,19 +68,19 @@ public class DocManager { private static void fillDocumentsTableArrays() { if (documentsTableID == null) { - String sql = "SELECT t.AD_Table_ID, t.TableName " + - "FROM AD_Table t, AD_Column c " + - "WHERE t.AD_Table_ID=c.AD_Table_ID AND " + - "c.ColumnName='Posted' AND " + - "IsView='N' " + - "ORDER BY t.AD_Table_ID"; + StringBuilder sql = new StringBuilder("SELECT t.AD_Table_ID, t.TableName ") + .append("FROM AD_Table t, AD_Column c ") + .append("WHERE t.AD_Table_ID=c.AD_Table_ID AND ") + .append("c.ColumnName='Posted' AND ") + .append("IsView='N' ") + .append("ORDER BY t.AD_Table_ID"); ArrayList tableIDs = new ArrayList(); ArrayList tableNames = new ArrayList(); PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql, null); + pstmt = DB.prepareStatement(sql.toString(), null); rs = pstmt.executeQuery(); while (rs.next()) { @@ -90,7 +90,7 @@ public class DocManager { } catch (SQLException e) { - throw new DBException(e, sql); + throw new DBException(e, sql.toString()); } finally { diff --git a/org.adempiere.base/src/org/compiere/acct/DocTax.java b/org.adempiere.base/src/org/compiere/acct/DocTax.java index 7ba252ab80..7358cd20bc 100644 --- a/org.adempiere.base/src/org/compiere/acct/DocTax.java +++ b/org.adempiere.base/src/org/compiere/acct/DocTax.java @@ -96,14 +96,14 @@ public final class DocTax if (AcctType < 0 || AcctType > 4) return null; // - String sql = "SELECT T_Due_Acct, T_Liability_Acct, T_Credit_Acct, T_Receivables_Acct, T_Expense_Acct " - + "FROM C_Tax_Acct WHERE C_Tax_ID=? AND C_AcctSchema_ID=?"; + StringBuilder sql = new StringBuilder("SELECT T_Due_Acct, T_Liability_Acct, T_Credit_Acct, T_Receivables_Acct, T_Expense_Acct ") + .append("FROM C_Tax_Acct WHERE C_Tax_ID=? AND C_AcctSchema_ID=?"); int validCombination_ID = 0; PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql, null); + pstmt = DB.prepareStatement(sql.toString(), null); pstmt.setInt(1, m_C_Tax_ID); pstmt.setInt(2, as.getC_AcctSchema_ID()); rs = pstmt.executeQuery(); @@ -112,7 +112,7 @@ public final class DocTax } catch (SQLException e) { - log.log(Level.SEVERE, sql, e); + log.log(Level.SEVERE, sql.toString(), e); } finally { DB.close(rs, pstmt); diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java b/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java index 2c013c6dec..60fdb95f5e 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java @@ -628,14 +628,14 @@ public class Doc_AllocationHdr extends Doc // or Doc.ACCTTYPE_PaymentSelect (AP) or V_Prepayment int accountType = Doc.ACCTTYPE_UnallocatedCash; // - String sql = "SELECT p.C_BankAccount_ID, d.DocBaseType, p.IsReceipt, p.IsPrepayment " - + "FROM C_Payment p INNER JOIN C_DocType d ON (p.C_DocType_ID=d.C_DocType_ID) " - + "WHERE C_Payment_ID=?"; + StringBuilder sql = new StringBuilder("SELECT p.C_BankAccount_ID, d.DocBaseType, p.IsReceipt, p.IsPrepayment ") + .append("FROM C_Payment p INNER JOIN C_DocType d ON (p.C_DocType_ID=d.C_DocType_ID) ") + .append("WHERE C_Payment_ID=?"); PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement (sql, getTrxName()); + pstmt = DB.prepareStatement (sql.toString(), getTrxName()); pstmt.setInt (1, C_Payment_ID); rs = pstmt.executeQuery (); if (rs.next ()) @@ -655,7 +655,7 @@ public class Doc_AllocationHdr extends Doc } catch (Exception e) { - log.log(Level.SEVERE, sql, e); + log.log(Level.SEVERE, sql.toString(), e); } finally { @@ -680,10 +680,10 @@ public class Doc_AllocationHdr extends Doc */ private MAccount getCashAcct (MAcctSchema as, int C_CashLine_ID) { - String sql = "SELECT c.C_CashBook_ID " - + "FROM C_Cash c, C_CashLine cl " - + "WHERE c.C_Cash_ID=cl.C_Cash_ID AND cl.C_CashLine_ID=?"; - setC_CashBook_ID(DB.getSQLValue(null, sql, C_CashLine_ID)); + StringBuilder sql = new StringBuilder("SELECT c.C_CashBook_ID ") + .append("FROM C_Cash c, C_CashLine cl ") + .append("WHERE c.C_Cash_ID=cl.C_Cash_ID AND cl.C_CashLine_ID=?"); + setC_CashBook_ID(DB.getSQLValue(null, sql.toString(), C_CashLine_ID)); if (getC_CashBook_ID() <= 0) { log.log(Level.SEVERE, "NONE for C_CashLine_ID=" + C_CashLine_ID); @@ -711,20 +711,20 @@ public class Doc_AllocationHdr extends Doc BigDecimal invoiceSource = null; BigDecimal invoiceAccounted = null; // - String sql = "SELECT " - + (invoice.isSOTrx() + StringBuffer sql = new StringBuffer("SELECT ") + .append((invoice.isSOTrx() ? "SUM(AmtSourceDr), SUM(AmtAcctDr)" // so - : "SUM(AmtSourceCr), SUM(AmtAcctCr)") // po - + " FROM Fact_Acct " - + "WHERE AD_Table_ID=318 AND Record_ID=?" // Invoice - + " AND C_AcctSchema_ID=?" - + " AND PostingType='A'"; + : "SUM(AmtSourceCr), SUM(AmtAcctCr)")) // po + .append(" FROM Fact_Acct ") + .append("WHERE AD_Table_ID=318 AND Record_ID=?") // Invoice + .append(" AND C_AcctSchema_ID=?") + .append(" AND PostingType='A'"); //AND C_Currency_ID=102 PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql, getTrxName()); + pstmt = DB.prepareStatement(sql.toString(), getTrxName()); pstmt.setInt(1, invoice.getC_Invoice_ID()); pstmt.setInt(2, as.getC_AcctSchema_ID()); rs = pstmt.executeQuery(); @@ -736,7 +736,7 @@ public class Doc_AllocationHdr extends Doc } catch (Exception e) { - log.log(Level.SEVERE, sql, e); + log.log(Level.SEVERE, sql.toString(), e); } finally { DB.close(rs, pstmt); @@ -856,16 +856,16 @@ public class Doc_AllocationHdr extends Doc DiscountAccount, discount, WriteOffAccoint, writeOff, isSOTrx); // Get Source Amounts with account - String sql = "SELECT * " - + "FROM Fact_Acct " - + "WHERE AD_Table_ID=318 AND Record_ID=?" // Invoice - + " AND C_AcctSchema_ID=?" - + " AND Line_ID IS NULL"; // header lines like tax or total + StringBuilder sql = new StringBuilder("SELECT * ") + .append("FROM Fact_Acct ") + .append("WHERE AD_Table_ID=318 AND Record_ID=?") // Invoice + .append(" AND C_AcctSchema_ID=?") + .append(" AND Line_ID IS NULL"); // header lines like tax or total PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql, getTrxName()); + pstmt = DB.prepareStatement(sql.toString(), getTrxName()); pstmt.setInt(1, line.getC_Invoice_ID()); pstmt.setInt(2, as.getC_AcctSchema_ID()); rs = pstmt.executeQuery(); @@ -874,7 +874,7 @@ public class Doc_AllocationHdr extends Doc } catch (Exception e) { - log.log(Level.SEVERE, sql, e); + log.log(Level.SEVERE, sql.toString(), e); } finally { DB.close(rs, pstmt); diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_Invoice.java b/org.adempiere.base/src/org/compiere/acct/Doc_Invoice.java index 6b08293f22..da8c7b8ed6 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_Invoice.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_Invoice.java @@ -99,14 +99,14 @@ public class Doc_Invoice extends Doc private DocTax[] loadTaxes() { ArrayList list = new ArrayList(); - String sql = "SELECT it.C_Tax_ID, t.Name, t.Rate, it.TaxBaseAmt, it.TaxAmt, t.IsSalesTax " - + "FROM C_Tax t, C_InvoiceTax it " - + "WHERE t.C_Tax_ID=it.C_Tax_ID AND it.C_Invoice_ID=?"; + StringBuilder sql = new StringBuilder("SELECT it.C_Tax_ID, t.Name, t.Rate, it.TaxBaseAmt, it.TaxAmt, t.IsSalesTax ") + .append("FROM C_Tax t, C_InvoiceTax it ") + .append("WHERE t.C_Tax_ID=it.C_Tax_ID AND it.C_Invoice_ID=?"); PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql, getTrxName()); + pstmt = DB.prepareStatement(sql.toString(), getTrxName()); pstmt.setInt(1, get_ID()); rs = pstmt.executeQuery(); // @@ -127,7 +127,7 @@ public class Doc_Invoice extends Doc } catch (SQLException e) { - log.log(Level.SEVERE, sql, e); + log.log(Level.SEVERE, sql.toString(), e); return null; } finally { @@ -886,13 +886,13 @@ public class Doc_Invoice extends Doc return; StringBuffer sql = new StringBuffer ( - "UPDATE M_Product_PO po " - + "SET PriceLastInv = " + "UPDATE M_Product_PO po ") + .append("SET PriceLastInv = ") // select - + "(SELECT currencyConvert(il.PriceActual,i.C_Currency_ID,po.C_Currency_ID,i.DateInvoiced,i.C_ConversionType_ID,i.AD_Client_ID,i.AD_Org_ID) " - + "FROM C_Invoice i, C_InvoiceLine il " - + "WHERE i.C_Invoice_ID=il.C_Invoice_ID" - + " AND po.M_Product_ID=il.M_Product_ID AND po.C_BPartner_ID=i.C_BPartner_ID"); + .append("(SELECT currencyConvert(il.PriceActual,i.C_Currency_ID,po.C_Currency_ID,i.DateInvoiced,i.C_ConversionType_ID,i.AD_Client_ID,i.AD_Org_ID) ") + .append("FROM C_Invoice i, C_InvoiceLine il ") + .append("WHERE i.C_Invoice_ID=il.C_Invoice_ID") + .append(" AND po.M_Product_ID=il.M_Product_ID AND po.C_BPartner_ID=i.C_BPartner_ID"); //jz + " AND ROWNUM=1 AND i.C_Invoice_ID=").append(get_ID()).append(") ") if (DB.isOracle()) //jz { diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_Order.java b/org.adempiere.base/src/org/compiere/acct/Doc_Order.java index a626f5252b..73abf58371 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_Order.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_Order.java @@ -164,17 +164,17 @@ public class Doc_Order extends Doc } // ArrayList list = new ArrayList(); - String sql = "SELECT * FROM M_RequisitionLine rl " - + "WHERE EXISTS (SELECT * FROM C_Order o " - + " INNER JOIN C_OrderLine ol ON (o.C_Order_ID=ol.C_Order_ID) " - + "WHERE ol.C_OrderLine_ID=rl.C_OrderLine_ID" - + " AND o.C_Order_ID=?) " - + "ORDER BY rl.C_OrderLine_ID"; + StringBuilder sql = new StringBuilder("SELECT * FROM M_RequisitionLine rl ") + .append("WHERE EXISTS (SELECT * FROM C_Order o ") + .append(" INNER JOIN C_OrderLine ol ON (o.C_Order_ID=ol.C_Order_ID) ") + .append("WHERE ol.C_OrderLine_ID=rl.C_OrderLine_ID") + .append(" AND o.C_Order_ID=?) ") + .append("ORDER BY rl.C_OrderLine_ID"); PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement (sql, null); + pstmt = DB.prepareStatement (sql.toString(), null); pstmt.setInt (1, order.getC_Order_ID()); rs = pstmt.executeQuery (); while (rs.next ()) @@ -201,7 +201,7 @@ public class Doc_Order extends Doc } catch (Exception e) { - log.log (Level.SEVERE, sql, e); + log.log (Level.SEVERE, sql.toString(), e); } finally { @@ -234,14 +234,14 @@ public class Doc_Order extends Doc private DocTax[] loadTaxes() { ArrayList list = new ArrayList(); - String sql = "SELECT it.C_Tax_ID, t.Name, t.Rate, it.TaxBaseAmt, it.TaxAmt, t.IsSalesTax " - + "FROM C_Tax t, C_OrderTax it " - + "WHERE t.C_Tax_ID=it.C_Tax_ID AND it.C_Order_ID=?"; + StringBuilder sql = new StringBuilder("SELECT it.C_Tax_ID, t.Name, t.Rate, it.TaxBaseAmt, it.TaxAmt, t.IsSalesTax ") + .append("FROM C_Tax t, C_OrderTax it ") + .append("WHERE t.C_Tax_ID=it.C_Tax_ID AND it.C_Order_ID=?"); PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql, getTrxName()); + pstmt = DB.prepareStatement(sql.toString(), getTrxName()); pstmt.setInt(1, get_ID()); rs = pstmt.executeQuery(); // @@ -261,7 +261,7 @@ public class Doc_Order extends Doc } catch (SQLException e) { - log.log(Level.SEVERE, sql, e); + log.log(Level.SEVERE, sql.toString(), e); } finally { DB.close(rs, pstmt); @@ -461,22 +461,22 @@ public class Doc_Order extends Doc if (ci.getC_AcctSchema1_ID() != as.getC_AcctSchema_ID()) return; - StringBuffer sql = new StringBuffer ( - "UPDATE M_Product_PO po " - + "SET PriceLastPO = (SELECT currencyConvert(ol.PriceActual,ol.C_Currency_ID,po.C_Currency_ID,o.DateOrdered,o.C_ConversionType_ID,o.AD_Client_ID,o.AD_Org_ID) " - + "FROM C_Order o, C_OrderLine ol " - + "WHERE o.C_Order_ID=ol.C_Order_ID" - + " AND po.M_Product_ID=ol.M_Product_ID AND po.C_BPartner_ID=o.C_BPartner_ID "); + StringBuffer sql = new StringBuffer ( + "UPDATE M_Product_PO po ") + .append("SET PriceLastPO = (SELECT currencyConvert(ol.PriceActual,ol.C_Currency_ID,po.C_Currency_ID,o.DateOrdered,o.C_ConversionType_ID,o.AD_Client_ID,o.AD_Org_ID) ") + .append("FROM C_Order o, C_OrderLine ol ") + .append("WHERE o.C_Order_ID=ol.C_Order_ID") + .append(" AND po.M_Product_ID=ol.M_Product_ID AND po.C_BPartner_ID=o.C_BPartner_ID "); //jz + " AND ROWNUM=1 AND o.C_Order_ID=").append(get_ID()).append(") ") if (DB.isOracle()) //jz { sql.append(" AND ROWNUM=1 "); } else - sql.append(" AND ol.C_OrderLine_ID = (SELECT MIN(ol1.C_OrderLine_ID) " - + "FROM C_Order o1, C_OrderLine ol1 " - + "WHERE o1.C_Order_ID=ol1.C_Order_ID" - + " AND po.M_Product_ID=ol1.M_Product_ID AND po.C_BPartner_ID=o1.C_BPartner_ID") + sql.append(" AND ol.C_OrderLine_ID = (SELECT MIN(ol1.C_OrderLine_ID) ") + .append("FROM C_Order o1, C_OrderLine ol1 ") + .append("WHERE o1.C_Order_ID=ol1.C_Order_ID") + .append(" AND po.M_Product_ID=ol1.M_Product_ID AND po.C_BPartner_ID=o1.C_BPartner_ID") .append(" AND o1.C_Order_ID=").append(get_ID()).append(") "); sql.append(" AND o.C_Order_ID=").append(get_ID()).append(") ") .append("WHERE EXISTS (SELECT * " @@ -501,20 +501,20 @@ public class Doc_Order extends Doc int precision = -1; // ArrayList list = new ArrayList(); - String sql = "SELECT * FROM C_OrderLine ol " - + "WHERE EXISTS " - + "(SELECT * FROM C_InvoiceLine il " - + "WHERE il.C_OrderLine_ID=ol.C_OrderLine_ID" - + " AND il.C_InvoiceLine_ID=?)" - + " OR EXISTS " - + "(SELECT * FROM M_MatchPO po " - + "WHERE po.C_OrderLine_ID=ol.C_OrderLine_ID" - + " AND po.C_InvoiceLine_ID=?)"; + StringBuilder sql = new StringBuilder("SELECT * FROM C_OrderLine ol ") + .append("WHERE EXISTS ") + .append("(SELECT * FROM C_InvoiceLine il ") + .append("WHERE il.C_OrderLine_ID=ol.C_OrderLine_ID") + .append(" AND il.C_InvoiceLine_ID=?)") + .append(" OR EXISTS ") + .append("(SELECT * FROM M_MatchPO po ") + .append("WHERE po.C_OrderLine_ID=ol.C_OrderLine_ID") + .append(" AND po.C_InvoiceLine_ID=?)"); PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement (sql, null); + pstmt = DB.prepareStatement (sql.toString(), null); pstmt.setInt (1, C_InvoiceLine_ID); pstmt.setInt (2, C_InvoiceLine_ID); rs = pstmt.executeQuery (); @@ -568,7 +568,7 @@ public class Doc_Order extends Doc } catch (Exception e) { - s_log.log (Level.SEVERE, sql, e); + s_log.log (Level.SEVERE, sql.toString(), e); } finally { @@ -646,16 +646,16 @@ public class Doc_Order extends Doc int precision = -1; // ArrayList list = new ArrayList(); - String sql = "SELECT * FROM C_OrderLine ol " - + "WHERE EXISTS " - + "(SELECT * FROM M_InOutLine il " - + "WHERE il.C_OrderLine_ID=ol.C_OrderLine_ID" - + " AND il.M_InOutLine_ID=?)"; + StringBuilder sql = new StringBuilder("SELECT * FROM C_OrderLine ol ") + .append("WHERE EXISTS ") + .append("(SELECT * FROM M_InOutLine il ") + .append("WHERE il.C_OrderLine_ID=ol.C_OrderLine_ID") + .append(" AND il.M_InOutLine_ID=?)"); PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement (sql, null); + pstmt = DB.prepareStatement (sql.toString(), null); pstmt.setInt (1, M_InOutLine_ID); rs = pstmt.executeQuery (); while (rs.next ()) @@ -708,7 +708,7 @@ public class Doc_Order extends Doc } catch (Exception e) { - s_log.log (Level.SEVERE, sql, e); + s_log.log (Level.SEVERE, sql.toString(), e); } finally { diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_Production.java b/org.adempiere.base/src/org/compiere/acct/Doc_Production.java index ff0092887f..64dee4a8b9 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_Production.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_Production.java @@ -82,14 +82,14 @@ public class Doc_Production extends Doc ArrayList list = new ArrayList(); // Production // -- ProductionLine - the real level - String sqlPL = "SELECT * FROM M_ProductionLine pl " - + "WHERE pl.M_Production_ID=? " - + "ORDER BY pl.Line"; + StringBuilder sqlPL = new StringBuilder("SELECT * FROM M_ProductionLine pl ") + .append("WHERE pl.M_Production_ID=? ") + .append("ORDER BY pl.Line"); try { - PreparedStatement pstmtPL = DB.prepareStatement(sqlPL, getTrxName()); + PreparedStatement pstmtPL = DB.prepareStatement(sqlPL.toString(), getTrxName()); pstmtPL.setInt(1,get_ID()); ResultSet rsPL = pstmtPL.executeQuery(); while (rsPL.next()) @@ -113,7 +113,7 @@ public class Doc_Production extends Doc } catch (Exception ee) { - log.log(Level.SEVERE, sqlPL, ee); + log.log(Level.SEVERE, sqlPL.toString(), ee); } DocLine[] dl = new DocLine[list.size()]; diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_ProjectIssue.java b/org.adempiere.base/src/org/compiere/acct/Doc_ProjectIssue.java index dc162d90c6..1cfd18ed25 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_ProjectIssue.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_ProjectIssue.java @@ -168,16 +168,16 @@ public class Doc_ProjectIssue extends Doc { BigDecimal retValue = null; // Uses PO Date - String sql = "SELECT currencyConvert(ol.PriceActual, o.C_Currency_ID, ?, o.DateOrdered, o.C_ConversionType_ID, ?, ?) " - + "FROM C_OrderLine ol" - + " INNER JOIN M_InOutLine iol ON (iol.C_OrderLine_ID=ol.C_OrderLine_ID)" - + " INNER JOIN C_Order o ON (o.C_Order_ID=ol.C_Order_ID) " - + "WHERE iol.M_InOutLine_ID=?"; + StringBuilder sql = new StringBuilder("SELECT currencyConvert(ol.PriceActual, o.C_Currency_ID, ?, o.DateOrdered, o.C_ConversionType_ID, ?, ?) ") + .append("FROM C_OrderLine ol") + .append(" INNER JOIN M_InOutLine iol ON (iol.C_OrderLine_ID=ol.C_OrderLine_ID)") + .append(" INNER JOIN C_Order o ON (o.C_Order_ID=ol.C_Order_ID) ") + .append("WHERE iol.M_InOutLine_ID=?"); PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql, getTrxName()); + pstmt = DB.prepareStatement(sql.toString(), getTrxName()); pstmt.setInt(1, as.getC_Currency_ID()); pstmt.setInt(2, getAD_Client_ID()); pstmt.setInt(3, getAD_Org_ID()); @@ -193,7 +193,7 @@ public class Doc_ProjectIssue extends Doc } catch (Exception e) { - log.log(Level.SEVERE, sql, e); + log.log(Level.SEVERE, sql.toString(), e); } finally { @@ -215,8 +215,8 @@ public class Doc_ProjectIssue extends Doc BigDecimal retValue = Env.ZERO; BigDecimal qty = Env.ZERO; - String sql = "SELECT ConvertedAmt, Qty FROM S_TimeExpenseLine " + - " WHERE S_TimeExpenseLine.S_TimeExpenseLine_ID = ?"; + StringBuilder sql = new StringBuilder("SELECT ConvertedAmt, Qty FROM S_TimeExpenseLine ") + .append(" WHERE S_TimeExpenseLine.S_TimeExpenseLine_ID = ?"); PreparedStatement pstmt = null; ResultSet rs = null; try diff --git a/org.adempiere.base/src/org/compiere/acct/FactLine.java b/org.adempiere.base/src/org/compiere/acct/FactLine.java index 37b2ba292a..ae1518a1be 100644 --- a/org.adempiere.base/src/org/compiere/acct/FactLine.java +++ b/org.adempiere.base/src/org/compiere/acct/FactLine.java @@ -497,13 +497,13 @@ public final class FactLine extends X_Fact_Acct if (M_Locator_ID == 0) return; int C_Location_ID = 0; - String sql = "SELECT w.C_Location_ID FROM M_Warehouse w, M_Locator l " - + "WHERE w.M_Warehouse_ID=l.M_Warehouse_ID AND l.M_Locator_ID=?"; + StringBuilder sql = new StringBuilder("SELECT w.C_Location_ID FROM M_Warehouse w, M_Locator l ") + .append("WHERE w.M_Warehouse_ID=l.M_Warehouse_ID AND l.M_Locator_ID=?"); PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt = DB.prepareStatement(sql.toString(), get_TrxName()); pstmt.setInt(1, M_Locator_ID); rs = pstmt.executeQuery(); if (rs.next()) @@ -511,7 +511,7 @@ public final class FactLine extends X_Fact_Acct } catch (SQLException e) { - log.log(Level.SEVERE, sql, e); + log.log(Level.SEVERE, sql.toString(), e); return; } finally { @@ -994,16 +994,16 @@ public final class FactLine extends X_Fact_Acct // get Unearned Revenue Acct from BPartner Group int UnearnedRevenue_Acct = 0; int new_Account_ID = 0; - String sql = "SELECT ga.UnearnedRevenue_Acct, vc.Account_ID " - + "FROM C_BP_Group_Acct ga, C_BPartner p, C_ValidCombination vc " - + "WHERE ga.C_BP_Group_ID=p.C_BP_Group_ID" - + " AND ga.UnearnedRevenue_Acct=vc.C_ValidCombination_ID" - + " AND ga.C_AcctSchema_ID=? AND p.C_BPartner_ID=?"; + StringBuilder sql = new StringBuilder("SELECT ga.UnearnedRevenue_Acct, vc.Account_ID ") + .append("FROM C_BP_Group_Acct ga, C_BPartner p, C_ValidCombination vc ") + .append("WHERE ga.C_BP_Group_ID=p.C_BP_Group_ID") + .append(" AND ga.UnearnedRevenue_Acct=vc.C_ValidCombination_ID") + .append(" AND ga.C_AcctSchema_ID=? AND p.C_BPartner_ID=?"); PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt = DB.prepareStatement(sql.toString(), get_TrxName()); pstmt.setInt(1, getC_AcctSchema_ID()); pstmt.setInt(2, C_BPartner_ID); rs = pstmt.executeQuery(); @@ -1015,7 +1015,7 @@ public final class FactLine extends X_Fact_Acct } catch (SQLException e) { - log.log(Level.SEVERE, sql, e); + log.log(Level.SEVERE, sql.toString(), e); } finally { DB.close(rs, pstmt); @@ -1061,20 +1061,20 @@ public final class FactLine extends X_Fact_Acct { boolean success = false; - String sql = "SELECT * " - + "FROM Fact_Acct " - + "WHERE C_AcctSchema_ID=? AND AD_Table_ID=? AND Record_ID=?" - + " AND Line_ID=? AND Account_ID=?"; + StringBuffer sql = new StringBuffer("SELECT * ") + .append("FROM Fact_Acct ") + .append("WHERE C_AcctSchema_ID=? AND AD_Table_ID=? AND Record_ID=?") + .append(" AND Line_ID=? AND Account_ID=?"); // MZ Goodwill // for Inventory Move if (MMovement.Table_ID == AD_Table_ID) - sql += " AND M_Locator_ID=?"; + sql.append(" AND M_Locator_ID=?"); // end MZ PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt = DB.prepareStatement(sql.toString(), get_TrxName()); pstmt.setInt(1, getC_AcctSchema_ID()); pstmt.setInt(2, AD_Table_ID); pstmt.setInt(3, Record_ID); @@ -1141,7 +1141,7 @@ public final class FactLine extends X_Fact_Acct } catch (SQLException e) { - log.log(Level.SEVERE, sql, e); + log.log(Level.SEVERE, sql.toString(), e); } finally { DB.close(rs, pstmt); diff --git a/org.adempiere.base/src/org/compiere/acct/Matcher.java b/org.adempiere.base/src/org/compiere/acct/Matcher.java index caae0744e3..44da0d7e6d 100644 --- a/org.adempiere.base/src/org/compiere/acct/Matcher.java +++ b/org.adempiere.base/src/org/compiere/acct/Matcher.java @@ -80,23 +80,23 @@ public class Matcher { int counter = 0; // (a) Direct Matches - String sql = "SELECT m1.AD_Client_ID,m2.AD_Org_ID, " // 1..2 - + "m1.C_InvoiceLine_ID,m2.M_InOutLine_ID,m1.M_Product_ID, " // 3..5 - + "m1.DateTrx,m2.DateTrx, m1.Qty, m2.Qty " // 6..9 - + "FROM M_MatchPO m1, M_MatchPO m2 " - + "WHERE m1.C_OrderLine_ID=m2.C_OrderLine_ID" - + " AND m1.M_InOutLine_ID IS NULL" - + " AND m2.C_InvoiceLine_ID IS NULL" - + " AND m1.M_Product_ID=m2.M_Product_ID" - + " AND m1.AD_Client_ID=?" // #1 + StringBuilder sql = new StringBuilder("SELECT m1.AD_Client_ID,m2.AD_Org_ID, ") // 1..2 + .append("m1.C_InvoiceLine_ID,m2.M_InOutLine_ID,m1.M_Product_ID, ") // 3..5 + .append("m1.DateTrx,m2.DateTrx, m1.Qty, m2.Qty ") // 6..9 + .append("FROM M_MatchPO m1, M_MatchPO m2 ") + .append("WHERE m1.C_OrderLine_ID=m2.C_OrderLine_ID") + .append(" AND m1.M_InOutLine_ID IS NULL") + .append(" AND m2.C_InvoiceLine_ID IS NULL") + .append(" AND m1.M_Product_ID=m2.M_Product_ID") + .append(" AND m1.AD_Client_ID=?") // #1 // Not existing Inv Matches - + " AND NOT EXISTS (SELECT * FROM M_MatchInv mi " - + "WHERE mi.C_InvoiceLine_ID=m1.C_InvoiceLine_ID AND mi.M_InOutLine_ID=m2.M_InOutLine_ID)"; + .append(" AND NOT EXISTS (SELECT * FROM M_MatchInv mi ") + .append("WHERE mi.C_InvoiceLine_ID=m1.C_InvoiceLine_ID AND mi.M_InOutLine_ID=m2.M_InOutLine_ID)"); PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql, null); + pstmt = DB.prepareStatement(sql.toString(), null); pstmt.setInt(1, m_AD_Client_ID); rs = pstmt.executeQuery(); while (rs.next()) diff --git a/org.adempiere.base/src/org/compiere/acct/ProductInfo.java b/org.adempiere.base/src/org/compiere/acct/ProductInfo.java index f2e74d147e..0c07b58fb5 100644 --- a/org.adempiere.base/src/org/compiere/acct/ProductInfo.java +++ b/org.adempiere.base/src/org/compiere/acct/ProductInfo.java @@ -83,18 +83,18 @@ public class ProductInfo if (m_M_Product_ID == 0) return; - String sql = "SELECT p.ProductType, pc.Value, " // 1..2 - + "p.C_RevenueRecognition_ID,p.C_UOM_ID, " // 3..4 - + "p.AD_Client_ID,p.AD_Org_ID, " // 5..6 - + "p.IsBOM, p.IsStocked " // 7..8 - + "FROM M_Product_Category pc" - + " INNER JOIN M_Product p ON (pc.M_Product_Category_ID=p.M_Product_Category_ID) " - + "WHERE p.M_Product_ID=?"; // #1 + StringBuilder sql = new StringBuilder("SELECT p.ProductType, pc.Value, ") // 1..2 + .append("p.C_RevenueRecognition_ID,p.C_UOM_ID, ") // 3..4 + .append("p.AD_Client_ID,p.AD_Org_ID, ") // 5..6 + .append("p.IsBOM, p.IsStocked ") // 7..8 + .append("FROM M_Product_Category pc") + .append(" INNER JOIN M_Product p ON (pc.M_Product_Category_ID=p.M_Product_Category_ID) ") + .append("WHERE p.M_Product_ID=?"); // #1 PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql, null); + pstmt = DB.prepareStatement(sql.toString(), null); pstmt.setInt(1, m_M_Product_ID); rs = pstmt.executeQuery(); if (rs.next()) @@ -113,7 +113,7 @@ public class ProductInfo } catch (SQLException e) { - log.log(Level.SEVERE, sql, e); + log.log(Level.SEVERE, sql.toString(), e); } finally { DB.close(rs, pstmt); @@ -296,9 +296,9 @@ public class ProductInfo */ private BigDecimal getPOCost (MAcctSchema as) { - String sql = "SELECT C_Currency_ID, PriceList,PricePO,PriceLastPO " - + "FROM M_Product_PO WHERE M_Product_ID=? " - + "ORDER BY IsCurrentVendor DESC"; + StringBuilder sql = new StringBuilder("SELECT C_Currency_ID, PriceList,PricePO,PriceLastPO ") + .append("FROM M_Product_PO WHERE M_Product_ID=? ") + .append("ORDER BY IsCurrentVendor DESC"); int C_Currency_ID = 0; BigDecimal PriceList = null; @@ -308,7 +308,7 @@ public class ProductInfo ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql, null); + pstmt = DB.prepareStatement(sql.toString(), null); pstmt.setInt(1, m_M_Product_ID); rs = pstmt.executeQuery(); if (rs.next()) @@ -321,7 +321,7 @@ public class ProductInfo } catch (SQLException e) { - log.log(Level.SEVERE, sql, e); + log.log(Level.SEVERE, sql.toString(), e); } finally { DB.close(rs, pstmt); diff --git a/org.adempiere.base/src/org/compiere/impexp/ImpFormat.java b/org.adempiere.base/src/org/compiere/impexp/ImpFormat.java index a1da4942bf..0cc769464d 100644 --- a/org.adempiere.base/src/org/compiere/impexp/ImpFormat.java +++ b/org.adempiere.base/src/org/compiere/impexp/ImpFormat.java @@ -115,12 +115,12 @@ public final class ImpFormat m_AD_Table_ID = AD_Table_ID; m_tableName = null; m_tablePK = null; - String sql = "SELECT t.TableName,c.ColumnName " - + "FROM AD_Table t INNER JOIN AD_Column c ON (t.AD_Table_ID=c.AD_Table_ID AND c.IsKey='Y') " - + "WHERE t.AD_Table_ID=?"; + StringBuilder sql = new StringBuilder("SELECT t.TableName,c.ColumnName ") + .append("FROM AD_Table t INNER JOIN AD_Column c ON (t.AD_Table_ID=c.AD_Table_ID AND c.IsKey='Y') ") + .append("WHERE t.AD_Table_ID=?"); try { - PreparedStatement pstmt = DB.prepareStatement(sql, null); + PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null); pstmt.setInt(1, AD_Table_ID); ResultSet rs = pstmt.executeQuery(); if (rs.next()) @@ -301,14 +301,14 @@ public final class ImpFormat */ private static void loadRows (ImpFormat format, int ID) { - String sql = "SELECT f.SeqNo,c.ColumnName,f.StartNo,f.EndNo,f.DataType,c.FieldLength," // 1..6 - + "f.DataFormat,f.DecimalPoint,f.DivideBy100,f.ConstantValue,f.Callout " // 7..11 - + "FROM AD_ImpFormat_Row f,AD_Column c " - + "WHERE f.AD_ImpFormat_ID=? AND f.AD_Column_ID=c.AD_Column_ID AND f.IsActive='Y'" - + "ORDER BY f.SeqNo"; + StringBuilder sql = new StringBuilder("SELECT f.SeqNo,c.ColumnName,f.StartNo,f.EndNo,f.DataType,c.FieldLength,") // 1..6 + .append("f.DataFormat,f.DecimalPoint,f.DivideBy100,f.ConstantValue,f.Callout ") // 7..11 + .append("FROM AD_ImpFormat_Row f,AD_Column c ") + .append("WHERE f.AD_ImpFormat_ID=? AND f.AD_Column_ID=c.AD_Column_ID AND f.IsActive='Y'") + .append("ORDER BY f.SeqNo"); try { - PreparedStatement pstmt = DB.prepareStatement(sql, null); + PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null); pstmt.setInt (1, ID); ResultSet rs = pstmt.executeQuery(); while (rs.next()) @@ -327,7 +327,7 @@ public final class ImpFormat } catch (SQLException e) { - log.log(Level.SEVERE, sql, e); + log.log(Level.SEVERE, sql.toString(), e); } } // loadLines diff --git a/org.adempiere.base/src/org/compiere/impexp/MImpFormat.java b/org.adempiere.base/src/org/compiere/impexp/MImpFormat.java index 741f754f30..8f97dc05ea 100644 --- a/org.adempiere.base/src/org/compiere/impexp/MImpFormat.java +++ b/org.adempiere.base/src/org/compiere/impexp/MImpFormat.java @@ -69,13 +69,13 @@ public class MImpFormat extends X_AD_ImpFormat public MImpFormatRow[] getRows() { ArrayList list = new ArrayList(); - String sql = "SELECT * FROM AD_ImpFormat_Row " - + "WHERE AD_ImpFormat_ID=? " - + "ORDER BY SeqNo"; + StringBuilder sql = new StringBuilder("SELECT * FROM AD_ImpFormat_Row ") + .append("WHERE AD_ImpFormat_ID=? ") + .append("ORDER BY SeqNo"); PreparedStatement pstmt = null; try { - pstmt = DB.prepareStatement (sql, get_TrxName()); + pstmt = DB.prepareStatement (sql.toString(), get_TrxName()); pstmt.setInt (1, getAD_ImpFormat_ID()); ResultSet rs = pstmt.executeQuery (); while (rs.next ()) diff --git a/org.adempiere.base/src/org/compiere/model/GridFieldVO.java b/org.adempiere.base/src/org/compiere/model/GridFieldVO.java index 3ffe7a0bce..40a738f901 100644 --- a/org.adempiere.base/src/org/compiere/model/GridFieldVO.java +++ b/org.adempiere.base/src/org/compiere/model/GridFieldVO.java @@ -57,13 +57,15 @@ public class GridFieldVO implements Serializable public static String getSQL (Properties ctx) { // IsActive is part of View - String sql = "SELECT * FROM AD_Field_v WHERE AD_Tab_ID=?" - + " ORDER BY IsDisplayed DESC, SeqNo"; + StringBuffer sql; if (!Env.isBaseLanguage(ctx, "AD_Tab")) - sql = "SELECT * FROM AD_Field_vt WHERE AD_Tab_ID=?" - + " AND AD_Language='" + Env.getAD_Language(ctx) + "'" - + " ORDER BY IsDisplayed DESC, SeqNo"; - return sql; + sql = new StringBuffer("SELECT * FROM AD_Field_vt WHERE AD_Tab_ID=?") + .append(" AND AD_Language='" + Env.getAD_Language(ctx) + "'") + .append(" ORDER BY IsDisplayed DESC, SeqNo"); + else + sql = new StringBuffer("SELECT * FROM AD_Field_v WHERE AD_Tab_ID=?") + .append(" ORDER BY IsDisplayed DESC, SeqNo"); + return sql.toString(); } // getSQL public String InfoFactoryClass = null; diff --git a/org.adempiere.base/src/org/compiere/model/GridWindow.java b/org.adempiere.base/src/org/compiere/model/GridWindow.java index b00b0a23d5..5f523de365 100644 --- a/org.adempiere.base/src/org/compiere/model/GridWindow.java +++ b/org.adempiere.base/src/org/compiere/model/GridWindow.java @@ -559,18 +559,18 @@ public class GridWindow implements Serializable { if (recalc || m_modelUpdated == null) { - String sql = "SELECT MAX(w.Updated), MAX(t.Updated), MAX(tt.Updated), MAX(f.Updated), MAX(c.Updated) " - + "FROM AD_Window w" - + " INNER JOIN AD_Tab t ON (w.AD_Window_ID=t.AD_Window_ID)" - + " INNER JOIN AD_Table tt ON (t.AD_Table_ID=tt.AD_Table_ID)" - + " INNER JOIN AD_Field f ON (t.AD_Tab_ID=f.AD_Tab_ID)" - + " INNER JOIN AD_Column c ON (f.AD_Column_ID=c.AD_Column_ID) " - + "WHERE w.AD_Window_ID=?"; + StringBuilder sql = new StringBuilder("SELECT MAX(w.Updated), MAX(t.Updated), MAX(tt.Updated), MAX(f.Updated), MAX(c.Updated) ") + .append("FROM AD_Window w") + .append(" INNER JOIN AD_Tab t ON (w.AD_Window_ID=t.AD_Window_ID)") + .append(" INNER JOIN AD_Table tt ON (t.AD_Table_ID=tt.AD_Table_ID)") + .append(" INNER JOIN AD_Field f ON (t.AD_Tab_ID=f.AD_Tab_ID)") + .append(" INNER JOIN AD_Column c ON (f.AD_Column_ID=c.AD_Column_ID) ") + .append("WHERE w.AD_Window_ID=?"); PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement (sql, null); + pstmt = DB.prepareStatement (sql.toString(), null); pstmt.setInt (1, getAD_Window_ID()); rs = pstmt.executeQuery (); if (rs.next ()) @@ -592,7 +592,7 @@ public class GridWindow implements Serializable } catch (Exception e) { - log.log (Level.SEVERE, sql, e); + log.log (Level.SEVERE, sql.toString(), e); } finally { diff --git a/org.adempiere.extend/src/compiere/model/CalloutUser.java b/org.adempiere.extend/src/compiere/model/CalloutUser.java index 6a735bd963..4b4951ae59 100644 --- a/org.adempiere.extend/src/compiere/model/CalloutUser.java +++ b/org.adempiere.extend/src/compiere/model/CalloutUser.java @@ -77,21 +77,21 @@ public class CalloutUser extends CalloutEngine if (C_BPartner_ID == null || C_BPartner_ID.intValue() == 0) return ""; - String sql = "SELECT p.AD_Language,p.C_PaymentTerm_ID," - + " COALESCE(p.M_PriceList_ID,g.M_PriceList_ID) AS M_PriceList_ID, p.PaymentRule,p.POReference," - + " p.SO_Description,p.IsDiscountPrinted," - + " p.SO_CreditLimit, p.SO_CreditLimit-p.SO_CreditUsed AS CreditAvailable," - + " l.C_BPartner_Location_ID,c.AD_User_ID," - + " COALESCE(p.PO_PriceList_ID,g.PO_PriceList_ID) AS PO_PriceList_ID, p.PaymentRulePO,p.PO_PaymentTerm_ID " - + "FROM C_BPartner p" - + " INNER JOIN C_BP_Group g ON (p.C_BP_Group_ID=g.C_BP_Group_ID)" - + " LEFT OUTER JOIN C_BPartner_Location l ON (p.C_BPartner_ID=l.C_BPartner_ID AND l.IsBillTo='Y' AND l.IsActive='Y')" - + " LEFT OUTER JOIN AD_User c ON (p.C_BPartner_ID=c.C_BPartner_ID) " - + "WHERE p.C_BPartner_ID=? AND p.IsActive='Y'"; // #1 + StringBuilder sql = new StringBuilder("SELECT p.AD_Language,p.C_PaymentTerm_ID,") + .append (" COALESCE(p.M_PriceList_ID,g.M_PriceList_ID) AS M_PriceList_ID, p.PaymentRule,p.POReference,") + .append (" p.SO_Description,p.IsDiscountPrinted,") + .append (" p.SO_CreditLimit, p.SO_CreditLimit-p.SO_CreditUsed AS CreditAvailable,") + .append (" l.C_BPartner_Location_ID,c.AD_User_ID,") + .append (" COALESCE(p.PO_PriceList_ID,g.PO_PriceList_ID) AS PO_PriceList_ID, p.PaymentRulePO,p.PO_PaymentTerm_ID ") + .append ("FROM C_BPartner p") + .append (" INNER JOIN C_BP_Group g ON (p.C_BP_Group_ID=g.C_BP_Group_ID)") + .append (" LEFT OUTER JOIN C_BPartner_Location l ON (p.C_BPartner_ID=l.C_BPartner_ID AND l.IsBillTo='Y' AND l.IsActive='Y')") + .append (" LEFT OUTER JOIN AD_User c ON (p.C_BPartner_ID=c.C_BPartner_ID) ") + .append ("WHERE p.C_BPartner_ID=? AND p.IsActive='Y'"); // #1 try { - PreparedStatement pstmt = DB.prepareStatement(sql, null); + PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null); pstmt.setInt(1, C_BPartner_ID.intValue()); ResultSet rs = pstmt.executeQuery(); // @@ -130,7 +130,7 @@ public class CalloutUser extends CalloutEngine } catch (SQLException e) { - log.log(Level.SEVERE, sql, e); + log.log(Level.SEVERE, sql.toString(), e); return e.getLocalizedMessage(); } From 2af449365ad7f44b81b7cd43b6d5f53a87dea50f Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 17 Sep 2012 16:55:00 -0500 Subject: [PATCH 37/79] IDEMPIERE-131 Info Account Viewer enhancement / fix zk6 not showing the buttons --- .../WEB-INF/src/org/adempiere/webui/acct/WAcctViewer.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/acct/WAcctViewer.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/acct/WAcctViewer.java index 311b39bac8..53dc3f2070 100755 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/acct/WAcctViewer.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/acct/WAcctViewer.java @@ -56,6 +56,7 @@ import org.compiere.model.MColumn; import org.compiere.model.X_C_AcctSchema_Element; import org.compiere.report.core.RModel; import org.compiere.report.core.RModelExcelExporter; +import org.compiere.tools.FileUtil; import org.compiere.util.CLogger; import org.compiere.util.Env; import org.compiere.util.Ini; @@ -759,7 +760,7 @@ public class WAcctViewer extends Window implements EventListener RModelExcelExporter exporter = new RModelExcelExporter(m_rmodel); File file; try { - file = File.createTempFile(TITLE, ".xls"); + file = new File(FileUtil.getTempMailName(TITLE, ".xls")); exporter.export(file, Env.getLanguage(Env.getCtx())); Filedownload.save(file, "application/vnd.ms-excel"); } catch (Exception e) { @@ -1009,6 +1010,7 @@ public class WAcctViewer extends Window implements EventListener // Switch to Result pane tabbedPane.setSelectedIndex(1); + stateChanged(); // Set TableModel with Query From 90216161fb17ec3eed5086143f0e4f307dc7ca0c Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 17 Sep 2012 17:31:52 -0500 Subject: [PATCH 38/79] IDEMPIERE-433 login screen not show by exception when get USE_EMAIL_FOR_LOGIN --- org.adempiere.ui.swing/src/org/compiere/apps/ALogin.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ALogin.java b/org.adempiere.ui.swing/src/org/compiere/apps/ALogin.java index 286aed7677..0618470bb2 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ALogin.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/ALogin.java @@ -593,8 +593,10 @@ public final class ALogin extends CDialog else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) appExit(); // - else if (e.getSource() == hostField) + else if (e.getSource() == hostField) { validateConnection(); + languageComboChanged(); + } else if (e.getSource() == languageCombo) languageComboChanged(); // @@ -1174,7 +1176,7 @@ public final class ALogin extends CDialog // this.setTitle(res.getString("Login")); hostLabel.setText(res.getString("Host")); - boolean email_login = MSysConfig.getBooleanValue(MSysConfig.USE_EMAIL_FOR_LOGIN, false); + boolean email_login = (DB.isConnected() && MSysConfig.getBooleanValue(MSysConfig.USE_EMAIL_FOR_LOGIN, false)); if (email_login) userLabel.setText(res.getString("EMail")); else From 340acefdf69ccbbb3d1578b77c9e49db2eb94033 Mon Sep 17 00:00:00 2001 From: Juliana Corredor Date: Mon, 17 Sep 2012 21:01:42 -0500 Subject: [PATCH 39/79] IDEMPIERE-366 Improve Role Inheritance / Fix problem with validation rules --- .../oracle/911_IDEMPIERE-366.sql | 36 +++++++++++++++++++ .../postgresql/911_IDEMPIERE-366.sql | 36 +++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 migration/360lts-release/oracle/911_IDEMPIERE-366.sql create mode 100644 migration/360lts-release/postgresql/911_IDEMPIERE-366.sql diff --git a/migration/360lts-release/oracle/911_IDEMPIERE-366.sql b/migration/360lts-release/oracle/911_IDEMPIERE-366.sql new file mode 100644 index 0000000000..108368a9f5 --- /dev/null +++ b/migration/360lts-release/oracle/911_IDEMPIERE-366.sql @@ -0,0 +1,36 @@ +-- Sep 17, 2012 5:24:55 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARI'', ''API'',''ARC'',''APC'') AND C_DocType.IsSOTrx=''@IsSOTrx@'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_DATE('2012-09-17 17:24:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=124 +; + +-- Sep 17, 2012 5:25:09 PM COT +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''GLD'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_DATE('2012-09-17 17:25:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=121 +; + +-- Sep 17, 2012 5:25:14 PM COT +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARI'', ''API'',''ARC'',''APC'') AND AD_Client_ID=@AD_Client_ID@',Updated=TO_DATE('2012-09-17 17:25:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=173 +; + +-- Sep 17, 2012 5:25:30 PM COT +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''MMR'') AND IsSOTrx=''N'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_DATE('2012-09-17 17:25:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=52054 +; + +-- Sep 17, 2012 5:25:38 PM COT +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''MMR'', ''MMS'') AND AD_Client_ID=@AD_Client_ID@',Updated=TO_DATE('2012-09-17 17:25:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=125 +; + +-- Sep 17, 2012 5:25:44 PM COT +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''MMM'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_DATE('2012-09-17 17:25:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=201 +; + +-- Sep 17, 2012 5:25:49 PM COT +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''DOO'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_DATE('2012-09-17 17:25:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=52004 +; + +-- Sep 17, 2012 5:26:19 PM COT +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''SOO'', ''POO'') AND C_DocType.DocSubTypeSO=''RM'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@ AND IsSOTrx=''N'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_DATE('2012-09-17 17:26:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=52066 +; + +SELECT register_migration_script('911_IDEMPIERE-366.sql') FROM dual +; + diff --git a/migration/360lts-release/postgresql/911_IDEMPIERE-366.sql b/migration/360lts-release/postgresql/911_IDEMPIERE-366.sql new file mode 100644 index 0000000000..e3ff1cfcb0 --- /dev/null +++ b/migration/360lts-release/postgresql/911_IDEMPIERE-366.sql @@ -0,0 +1,36 @@ +-- Sep 17, 2012 5:24:55 PM COT +-- IDEMPIERE-366 Improve Role Inheritance +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARI'', ''API'',''ARC'',''APC'') AND C_DocType.IsSOTrx=''@IsSOTrx@'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-17 17:24:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=124 +; + +-- Sep 17, 2012 5:25:09 PM COT +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''GLD'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-17 17:25:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=121 +; + +-- Sep 17, 2012 5:25:14 PM COT +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARI'', ''API'',''ARC'',''APC'') AND AD_Client_ID=@AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-17 17:25:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=173 +; + +-- Sep 17, 2012 5:25:30 PM COT +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''MMR'') AND IsSOTrx=''N'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-17 17:25:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=52054 +; + +-- Sep 17, 2012 5:25:38 PM COT +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''MMR'', ''MMS'') AND AD_Client_ID=@AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-17 17:25:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=125 +; + +-- Sep 17, 2012 5:25:44 PM COT +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''MMM'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-17 17:25:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=201 +; + +-- Sep 17, 2012 5:25:49 PM COT +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''DOO'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-17 17:25:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=52004 +; + +-- Sep 17, 2012 5:26:19 PM COT +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''SOO'', ''POO'') AND C_DocType.DocSubTypeSO=''RM'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@ AND IsSOTrx=''N'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-17 17:26:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=52066 +; + +SELECT register_migration_script('911_IDEMPIERE-366.sql') FROM dual +; + From fa5b24e7e2fd1aed3d5ac41d72c2efa8be76b661 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 17 Sep 2012 22:12:48 -0500 Subject: [PATCH 40/79] =?UTF-8?q?IDEMPIERE-308=20Performance:=20Replace=20?= =?UTF-8?q?use=20of=20StringBuffer=20and=20String=20concatenation=20with?= =?UTF-8?q?=20StringBuilder=20/=20replace=20String.concat=20used=20in=20lo?= =?UTF-8?q?ops=20-=20cases=20detected=20using=20findbugs=20/=20thanks=20to?= =?UTF-8?q?=20Richard=20Morales=20and=20David=20Pe=C3=B1uela?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/adempiere/process/UUIDGenerator.java | 20 +++++++--- .../util/AbstractDocumentSearch.java | 40 ++++++++++--------- .../adempiere/util/ModelClassGenerator.java | 14 +++---- .../util/ModelInterfaceGenerator.java | 14 +++---- .../impexp/OFXBankStatementHandler.java | 4 +- .../src/org/compiere/model/MLanguage.java | 18 ++++----- .../src/org/compiere/model/MPasswordRule.java | 10 +++-- .../src/org/compiere/util/Language.java | 8 ++-- 8 files changed, 71 insertions(+), 57 deletions(-) diff --git a/org.adempiere.base/src/org/adempiere/process/UUIDGenerator.java b/org.adempiere.base/src/org/adempiere/process/UUIDGenerator.java index 115ba9e56d..75188890e0 100644 --- a/org.adempiere.base/src/org/adempiere/process/UUIDGenerator.java +++ b/org.adempiere.base/src/org/adempiere/process/UUIDGenerator.java @@ -151,14 +151,22 @@ public class UUIDGenerator extends SvrProcess { } sql.append(" FROM ").append(table.getTableName()); sql.append(" WHERE ").append(column.getColumnName()).append(" IS NULL "); - String updateSQL = "UPDATE "+table.getTableName()+" SET "+column.getColumnName()+"=? WHERE "; + StringBuffer updateSQL = new StringBuffer(); + updateSQL.append("UPDATE "); + updateSQL.append(table.getTableName()); + updateSQL.append(" SET "); + updateSQL.append(column.getColumnName()); + updateSQL.append("=? WHERE "); if (AD_Column_ID > 0) { - updateSQL = updateSQL + keyColumn + "=?"; + updateSQL.append(keyColumn); + updateSQL.append("=?"); } else { for(String s : compositeKeys) { - updateSQL = updateSQL + s + "=? AND "; + updateSQL.append(s); + updateSQL.append("=? AND "); } - updateSQL = updateSQL.substring(0, updateSQL.length() - " AND ".length()); + int length = updateSQL.length(); + updateSQL.delete(length-5, length); // delete last AND } boolean localTrx = false; @@ -180,7 +188,7 @@ public class UUIDGenerator extends SvrProcess { int recordId = rs.getInt(1); if (recordId > MTable.MAX_OFFICIAL_ID) { UUID uuid = UUID.randomUUID(); - DB.executeUpdateEx(updateSQL,new Object[]{uuid.toString(), recordId}, trx.getTrxName()); + DB.executeUpdateEx(updateSQL.toString(),new Object[]{uuid.toString(), recordId}, trx.getTrxName()); } } else { UUID uuid = UUID.randomUUID(); @@ -189,7 +197,7 @@ public class UUIDGenerator extends SvrProcess { for (String s : compositeKeys) { params.add(rs.getObject(s)); } - DB.executeUpdateEx(updateSQL,params.toArray(),trx.getTrxName()); + DB.executeUpdateEx(updateSQL.toString(),params.toArray(),trx.getTrxName()); } } if (localTrx) { diff --git a/org.adempiere.base/src/org/adempiere/util/AbstractDocumentSearch.java b/org.adempiere.base/src/org/adempiere/util/AbstractDocumentSearch.java index 17a0261448..ab455fdadd 100644 --- a/org.adempiere.base/src/org/adempiere/util/AbstractDocumentSearch.java +++ b/org.adempiere.base/src/org/adempiere/util/AbstractDocumentSearch.java @@ -45,6 +45,7 @@ import org.compiere.model.MTable; import org.compiere.util.CLogger; import org.compiere.util.DB; import org.compiere.util.Env; +import org.compiere.util.Util; /** * Executes search and opens windows for defined transaction codes @@ -67,12 +68,12 @@ public abstract class AbstractDocumentSearch { log.fine("Search started with String: " + searchString); // Check if / how many transaction-codes are used - if (searchString != null && !"".equals(searchString)) { + if (! Util.isEmpty(searchString)) { String[] codes = searchString.trim().replaceAll(" ", " ").split(" "); List codeList = new ArrayList(); boolean codeSearch = true; - searchString = ""; + StringBuffer search = new StringBuffer(); // Analyze String to separate transactionCodes from searchString for (int i = 0; i < codes.length; i++) { @@ -84,9 +85,9 @@ public abstract class AbstractDocumentSearch { // Build the searchString with eventually appearing // whitespaces codeSearch = false; - searchString += s; + search.append(s); if (i != (codes.length - 1)) { - searchString += " "; + search.append(" "); } } } catch (SQLException e) { @@ -99,12 +100,12 @@ public abstract class AbstractDocumentSearch { if (codeList.size() > 0) { for (int i = 0; i < codeList.size(); i++) { log.fine("Search with Transaction: '" + codeList.get(i) + "' for: '" - + searchString + "'"); - getID(codeList.get(i), searchString); + + search.toString() + "'"); + getID(codeList.get(i), search.toString()); } } else { - log.fine("Search without Transaction: " + searchString); - getID(null, searchString); + log.fine("Search without Transaction: " + search.toString()); + getID(null, search.toString()); } } else { log.fine("Search String is invalid"); @@ -252,32 +253,35 @@ public abstract class AbstractDocumentSearch { if (ids == null || ids.size() == 0) { return; } - String whereString = " " + tableName + "_ID"; + StringBuffer whereString = new StringBuffer(); + whereString.append(" "); + whereString.append(tableName); + whereString.append("_ID"); // create query string if (ids.size() == 1) { if (ids.get(0).intValue() == 0) { whereString = null; } else { - whereString += "=" + ids.get(0).intValue(); + whereString.append("="); + whereString.append(ids.get(0).intValue()); } } else { - whereString += " IN ("; + whereString.append(" IN ("); for (int i = 0; i < ids.size(); i++) { - whereString += ids.get(i).intValue(); + whereString.append(ids.get(i).intValue()); if (i < ids.size() - 1) { - whereString += ","; + whereString.append(","); } else { - whereString += ") "; + whereString.append(") "); } } } - log.fine(whereString); - + final MQuery query = new MQuery(tableName); - query.addRestriction(whereString); + query.addRestriction(whereString.toString()); final boolean ok = openWindow(windowId, query); if (!ok) { - log.severe("Unable to open window: " + whereString); + log.severe("Unable to open window: " + whereString.toString()); } if (!windowOpened && ok) windowOpened = true; diff --git a/org.adempiere.base/src/org/adempiere/util/ModelClassGenerator.java b/org.adempiere.base/src/org/adempiere/util/ModelClassGenerator.java index 96584e9d22..f51cbb15e8 100644 --- a/org.adempiere.base/src/org/adempiere/util/ModelClassGenerator.java +++ b/org.adempiere.base/src/org/adempiere/util/ModelClassGenerator.java @@ -839,10 +839,10 @@ public class ModelClassGenerator if (!tableLike.startsWith("'") || !tableLike.endsWith("'")) tableLike = "'" + tableLike + "'"; - String entityTypeFilter = null; + StringBuffer entityTypeFilter = new StringBuffer(); if (entityType != null && entityType.trim().length() > 0) { - entityTypeFilter = "EntityType IN ("; + entityTypeFilter.append("EntityType IN ("); StringTokenizer tokenizer = new StringTokenizer(entityType, ","); int i = 0; while(tokenizer.hasMoreTokens()) { @@ -850,15 +850,15 @@ public class ModelClassGenerator if (!token.startsWith("'") || !token.endsWith("'")) token = "'" + token + "'"; if (i > 0) - entityTypeFilter = entityTypeFilter + ","; - entityTypeFilter = entityTypeFilter + token; + entityTypeFilter.append(","); + entityTypeFilter.append(token); i++; } - entityTypeFilter = entityTypeFilter+")"; + entityTypeFilter.append(")"); } else { - entityTypeFilter = "EntityType IN ('U','A')"; + entityTypeFilter.append("EntityType IN ('U','A')"); } String directory = sourceFolder.trim(); @@ -884,7 +884,7 @@ public class ModelClassGenerator .append(" OR IsView='N')") .append(" AND IsActive = 'Y' AND TableName NOT LIKE '%_Trl' "); sql.append(" AND TableName LIKE ").append(tableLike); - sql.append(" AND ").append(entityTypeFilter); + sql.append(" AND ").append(entityTypeFilter.toString()); sql.append(" ORDER BY TableName"); // diff --git a/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java b/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java index f1884357d3..435a2655f1 100644 --- a/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java +++ b/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java @@ -774,10 +774,10 @@ public class ModelInterfaceGenerator if (!tableLike.startsWith("'") || !tableLike.endsWith("'")) tableLike = "'" + tableLike + "'"; - String entityTypeFilter = null; + StringBuffer entityTypeFilter = new StringBuffer(); if (entityType != null && entityType.trim().length() > 0) { - entityTypeFilter = "EntityType IN ("; + entityTypeFilter.append("EntityType IN ("); StringTokenizer tokenizer = new StringTokenizer(entityType, ","); int i = 0; while(tokenizer.hasMoreTokens()) { @@ -785,15 +785,15 @@ public class ModelInterfaceGenerator if (!token.startsWith("'") || !token.endsWith("'")) token = "'" + token + "'"; if (i > 0) - entityTypeFilter = entityTypeFilter + ","; - entityTypeFilter = entityTypeFilter + token; + entityTypeFilter.append(","); + entityTypeFilter.append(token); i++; } - entityTypeFilter = entityTypeFilter+")"; + entityTypeFilter.append(")"); } else { - entityTypeFilter = "EntityType IN ('U','A')"; + entityTypeFilter.append("EntityType IN ('U','A')"); } String directory = sourceFolder.trim(); @@ -819,7 +819,7 @@ public class ModelInterfaceGenerator .append(" OR IsView='N')") .append(" AND IsActive = 'Y' AND TableName NOT LIKE '%_Trl' "); sql.append(" AND TableName LIKE ").append(tableLike); - sql.append(" AND ").append(entityTypeFilter); + sql.append(" AND ").append(entityTypeFilter.toString()); sql.append(" ORDER BY TableName"); // diff --git a/org.adempiere.base/src/org/compiere/impexp/OFXBankStatementHandler.java b/org.adempiere.base/src/org/compiere/impexp/OFXBankStatementHandler.java index 9e5ddb3607..20e3187d75 100644 --- a/org.adempiere.base/src/org/compiere/impexp/OFXBankStatementHandler.java +++ b/org.adempiere.base/src/org/compiere/impexp/OFXBankStatementHandler.java @@ -217,10 +217,10 @@ public abstract class OFXBankStatementHandler extends DefaultHandler { BufferedReader reader = new BufferedReader(new InputStreamReader(is)); reader.mark(HEADER_SIZE + 100); - String header = ""; + StringBuffer header = new StringBuffer(""); for (int i = 0; i < HEADER_SIZE; i++) { - header = header + reader.readLine(); + header.append(reader.readLine()); } if ((header.indexOf(" " + nFormat); - m_dateFormat.applyPattern(nFormat); + m_dateFormat.applyPattern(nFormat.toString()); } // Unknown short format => use JDBC if (m_dateFormat.toPattern().length() != 8) @@ -235,15 +235,15 @@ public class MLanguage extends X_AD_Language if (m_dateFormat.toPattern().indexOf("yyyy") == -1) { sFormat = m_dateFormat.toPattern(); - String nFormat = ""; + StringBuffer nFormat = new StringBuffer(""); for (int i = 0; i < sFormat.length(); i++) { if (sFormat.charAt(i) == 'y') - nFormat += "yy"; + nFormat.append("yy"); else - nFormat += sFormat.charAt(i); + nFormat.append(sFormat.charAt(i)); } - m_dateFormat.applyPattern(nFormat); + m_dateFormat.applyPattern(nFormat.toString()); } } // diff --git a/org.adempiere.base/src/org/compiere/model/MPasswordRule.java b/org.adempiere.base/src/org/compiere/model/MPasswordRule.java index 7ec9f9d8a0..8cc579ad68 100644 --- a/org.adempiere.base/src/org/compiere/model/MPasswordRule.java +++ b/org.adempiere.base/src/org/compiere/model/MPasswordRule.java @@ -197,12 +197,14 @@ public class MPasswordRule extends X_AD_PasswordRule { passwordData.setUsername(username); RuleResult result = validator.validate(passwordData); if (!result.isValid()) { - String error = Msg.getMsg(getCtx(), "PasswordErrors") + ": ["; + StringBuffer error = new StringBuffer(Msg.getMsg(getCtx(), "PasswordErrors")); + error.append(": ["); for (String msg : validator.getMessages(result)) { - error = error + " " + msg; + error.append(" "); + error.append(msg); } - error = error + " ]"; - throw new AdempiereException(error); + error.append(" ]"); + throw new AdempiereException(error.toString()); } } } diff --git a/org.adempiere.base/src/org/compiere/util/Language.java b/org.adempiere.base/src/org/compiere/util/Language.java index 6f385c441e..98f403a249 100644 --- a/org.adempiere.base/src/org/compiere/util/Language.java +++ b/org.adempiere.base/src/org/compiere/util/Language.java @@ -626,15 +626,15 @@ public class Language implements Serializable if (m_dateFormat.toPattern().indexOf("yyyy") == -1) { sFormat = m_dateFormat.toPattern(); - String nFormat = ""; + StringBuffer nFormat = new StringBuffer(""); for (int i = 0; i < sFormat.length(); i++) { if (sFormat.charAt(i) == 'y') - nFormat += "yy"; + nFormat.append("yy"); else - nFormat += sFormat.charAt(i); + nFormat.append(sFormat.charAt(i)); } - m_dateFormat.applyPattern(nFormat); + m_dateFormat.applyPattern(nFormat.toString()); } m_dateFormat.setLenient(true); } From 527ab89cfe93b16a33ea3b451356f3bcaf5a5859 Mon Sep 17 00:00:00 2001 From: Elaine Tan Date: Wed, 19 Sep 2012 11:23:16 +0800 Subject: [PATCH 41/79] IDEMPIERE-374 Change password must be changed to be a form instead of a process --- .../oracle/913_IDEMPIERE-374.sql | 202 ++++++++++ .../postgresql/913_IDEMPIERE-374.sql | 202 ++++++++++ .../compiere/apps/form/VResetPassword.java | 329 ++++++++++++++++ .../webui/apps/form/WResetPassword.java | 352 ++++++++++++++++++ .../webui/panel/AbstractMenuPanel.java | 5 + 5 files changed, 1090 insertions(+) create mode 100644 migration/360lts-release/oracle/913_IDEMPIERE-374.sql create mode 100644 migration/360lts-release/postgresql/913_IDEMPIERE-374.sql create mode 100644 org.adempiere.ui.swing/src/org/compiere/apps/form/VResetPassword.java create mode 100644 org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WResetPassword.java diff --git a/migration/360lts-release/oracle/913_IDEMPIERE-374.sql b/migration/360lts-release/oracle/913_IDEMPIERE-374.sql new file mode 100644 index 0000000000..3bb61edaef --- /dev/null +++ b/migration/360lts-release/oracle/913_IDEMPIERE-374.sql @@ -0,0 +1,202 @@ +-- Sep 18, 2012 2:38:36 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Form (AccessLevel,Classname,AD_Form_ID,Help,IsBetaFunctionality,EntityType,AD_Form_UU,Description,Name,AD_Org_ID,UpdatedBy,CreatedBy,Updated,Created,AD_Client_ID,IsActive) VALUES ('1','org.compiere.apps.form.VResetPassword',200001,NULL,'N','D','e2db983d-c11a-46f7-a4f5-fca8167c8d6c','Reset Password','Reset Password',0,100,100,TO_DATE('2012-09-18 14:38:34','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-18 14:38:34','YYYY-MM-DD HH24:MI:SS'),0,'Y') +; + +-- Sep 18, 2012 2:38:38 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Form_Trl (AD_Language,AD_Form_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Form_Trl_UU ) SELECT l.AD_Language,t.AD_Form_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Form t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Form_ID=200001 AND NOT EXISTS (SELECT * FROM AD_Form_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Form_ID=t.AD_Form_ID) +; + +-- Sep 18, 2012 2:39:13 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Menu (AD_Menu_ID,IsSummary,IsSOTrx,IsReadOnly,AD_Form_ID,EntityType,IsCentrallyMaintained,Name,Description,Action,AD_Menu_UU,IsActive,AD_Client_ID,CreatedBy,Updated,AD_Org_ID,Created,UpdatedBy) VALUES (200017,'N','N','N',200001,'D','Y','Reset Password','Reset Passwords for User','X','c9aa4c76-894d-4a72-97de-38d0345fd477','Y',0,100,TO_DATE('2012-09-18 14:39:12','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2012-09-18 14:39:12','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 18, 2012 2:39:14 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Menu_Trl_UU ) SELECT l.AD_Language,t.AD_Menu_ID, t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Menu_ID=200017 AND NOT EXISTS (SELECT * FROM AD_Menu_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Menu_ID=t.AD_Menu_ID) +; + +-- Sep 18, 2012 2:39:14 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo, AD_TreeNodeMM_UU) SELECT t.AD_Client_ID, 0, 'Y', SysDate, 100, SysDate, 100,t.AD_Tree_ID, 200017, 0, 999, Generate_UUID() FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.TreeType='MM' AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=200017) +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=200002 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=147 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53246 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=200017 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=4, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=487 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=5, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=200012 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=6, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=150 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=7, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=495 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=8, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=50007 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=9, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=362 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=10, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=200001 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=11, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=475 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=12, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=366 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=13, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=483 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=14, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=368 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=15, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=508 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=16, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53348 +; + +-- Sep 18, 2012 2:39:32 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +DELETE FROM AD_Menu_Trl WHERE AD_Menu_ID=487 +; + +-- Sep 18, 2012 2:39:33 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +DELETE FROM AD_Menu WHERE AD_Menu_ID=487 +; + +-- Sep 18, 2012 2:39:33 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +DELETE FROM AD_TreeNodeMM n WHERE Node_ID=487 AND EXISTS (SELECT * FROM AD_Tree t WHERE t.AD_Tree_ID=n.AD_Tree_ID AND t.TreeType='MM') +; + +-- Sep 18, 2012 2:48:49 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_Form SET AccessLevel='7',Updated=TO_DATE('2012-09-18 14:48:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Form_ID=200001 +; + +-- Sep 18, 2012 4:32:53 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Message (MsgType,MsgText,MsgTip,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','User is Mandatory',NULL,200067,'D','40544a9e-776d-4f96-8ef1-f38de2237027','UserMandatory','Y',TO_DATE('2012-09-18 16:32:51','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-09-18 16:32:51','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 18, 2012 4:32:53 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200067 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Sep 18, 2012 4:35:14 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','New EMail does not match the Confirm New EMail',200068,'D','5046c7a0-0846-4f09-b130-d8280a043775','NewEmailNotMatch','Y',TO_DATE('2012-09-18 16:35:13','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-09-18 16:35:13','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 18, 2012 4:35:14 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200068 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Sep 18, 2012 4:35:51 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','Confirm New EMail is Mandatory',200069,'D','c9e44d6f-af2e-4306-bb84-2df8258ad79c','NewEmailConfirmMandatory','Y',TO_DATE('2012-09-18 16:35:50','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-09-18 16:35:50','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 18, 2012 4:35:51 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200069 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Sep 18, 2012 4:37:44 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Confirm New EMail',200070,'D','41282b1f-672c-43e0-b823-439b87fa0544','New EMail Confirm','Y',TO_DATE('2012-09-18 16:37:43','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-09-18 16:37:43','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 18, 2012 4:37:44 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200070 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Sep 18, 2012 4:38:20 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','New EMail',200071,'D','6a228718-3a23-46d3-8e0c-97a6511acc50','New EMail','Y',TO_DATE('2012-09-18 16:38:19','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-09-18 16:38:19','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 18, 2012 4:38:20 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200071 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Sep 18, 2012 4:38:36 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','New EMail User',200072,'D','3bf5a60b-20a1-484d-a5f0-11dbe95fcbce','New EMail User','Y',TO_DATE('2012-09-18 16:38:35','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-09-18 16:38:35','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 18, 2012 4:38:36 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200072 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Sep 18, 2012 4:39:03 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','New EMail User Password',200073,'D','cfe2fcb8-81cc-4df5-b187-f1df99f8f842','New EMail User Password','Y',TO_DATE('2012-09-18 16:38:59','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-09-18 16:38:59','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 18, 2012 4:39:03 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200073 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +SELECT register_migration_script('913_IDEMPIERE-374.sql') FROM dual +; \ No newline at end of file diff --git a/migration/360lts-release/postgresql/913_IDEMPIERE-374.sql b/migration/360lts-release/postgresql/913_IDEMPIERE-374.sql new file mode 100644 index 0000000000..6a49da8830 --- /dev/null +++ b/migration/360lts-release/postgresql/913_IDEMPIERE-374.sql @@ -0,0 +1,202 @@ +-- Sep 18, 2012 2:38:36 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Form (AccessLevel,Classname,AD_Form_ID,Help,IsBetaFunctionality,EntityType,AD_Form_UU,Description,Name,AD_Org_ID,UpdatedBy,CreatedBy,Updated,Created,AD_Client_ID,IsActive) VALUES ('1','org.compiere.apps.form.VResetPassword',200001,NULL,'N','D','e2db983d-c11a-46f7-a4f5-fca8167c8d6c','Reset Password','Reset Password',0,100,100,TO_TIMESTAMP('2012-09-18 14:38:34','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-18 14:38:34','YYYY-MM-DD HH24:MI:SS'),0,'Y') +; + +-- Sep 18, 2012 2:38:38 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Form_Trl (AD_Language,AD_Form_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Form_Trl_UU ) SELECT l.AD_Language,t.AD_Form_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Form t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Form_ID=200001 AND NOT EXISTS (SELECT * FROM AD_Form_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Form_ID=t.AD_Form_ID) +; + +-- Sep 18, 2012 2:39:13 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Menu (AD_Menu_ID,IsSummary,IsSOTrx,IsReadOnly,AD_Form_ID,EntityType,IsCentrallyMaintained,Name,Description,"action",AD_Menu_UU,IsActive,AD_Client_ID,CreatedBy,Updated,AD_Org_ID,Created,UpdatedBy) VALUES (200017,'N','N','N',200001,'D','Y','Reset Password','Reset Passwords for User','X','c9aa4c76-894d-4a72-97de-38d0345fd477','Y',0,100,TO_TIMESTAMP('2012-09-18 14:39:12','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2012-09-18 14:39:12','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Sep 18, 2012 2:39:14 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Menu_Trl_UU ) SELECT l.AD_Language,t.AD_Menu_ID, t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Menu_ID=200017 AND NOT EXISTS (SELECT * FROM AD_Menu_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Menu_ID=t.AD_Menu_ID) +; + +-- Sep 18, 2012 2:39:14 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo, AD_TreeNodeMM_UU) SELECT t.AD_Client_ID, 0, 'Y', CURRENT_TIMESTAMP, 100, CURRENT_TIMESTAMP, 100,t.AD_Tree_ID, 200017, 0, 999, Generate_UUID() FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.TreeType='MM' AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=200017) +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=0, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=200002 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=1, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=147 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=2, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53246 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=3, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=200017 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=4, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=487 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=5, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=200012 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=6, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=150 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=7, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=495 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=8, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=50007 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=9, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=362 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=10, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=200001 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=11, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=475 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=12, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=366 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=13, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=483 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=14, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=368 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=15, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=508 +; + +-- Sep 18, 2012 2:39:24 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=16, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53348 +; + +-- Sep 18, 2012 2:39:32 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +DELETE FROM AD_Menu_Trl WHERE AD_Menu_ID=487 +; + +-- Sep 18, 2012 2:39:33 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +DELETE FROM AD_Menu WHERE AD_Menu_ID=487 +; + +-- Sep 18, 2012 2:39:33 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +DELETE FROM AD_TreeNodeMM WHERE Node_ID=487 AND EXISTS (SELECT * FROM AD_Tree t WHERE t.AD_Tree_ID=AD_TreeNodeMM.AD_Tree_ID AND t.TreeType='MM') +; + +-- Sep 18, 2012 2:48:49 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +UPDATE AD_Form SET AccessLevel='7',Updated=TO_TIMESTAMP('2012-09-18 14:48:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Form_ID=200001 +; + +-- Sep 18, 2012 4:32:53 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Message (MsgType,MsgText,MsgTip,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','User is Mandatory',NULL,200067,'D','40544a9e-776d-4f96-8ef1-f38de2237027','UserMandatory','Y',TO_TIMESTAMP('2012-09-18 16:32:51','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-09-18 16:32:51','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 18, 2012 4:32:53 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200067 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Sep 18, 2012 4:35:14 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','New EMail does not match the Confirm New EMail',200068,'D','5046c7a0-0846-4f09-b130-d8280a043775','NewEmailNotMatch','Y',TO_TIMESTAMP('2012-09-18 16:35:13','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-09-18 16:35:13','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 18, 2012 4:35:14 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200068 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Sep 18, 2012 4:35:51 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','Confirm New EMail is Mandatory',200069,'D','c9e44d6f-af2e-4306-bb84-2df8258ad79c','NewEmailConfirmMandatory','Y',TO_TIMESTAMP('2012-09-18 16:35:50','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-09-18 16:35:50','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 18, 2012 4:35:51 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200069 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Sep 18, 2012 4:37:44 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Confirm New EMail',200070,'D','41282b1f-672c-43e0-b823-439b87fa0544','New EMail Confirm','Y',TO_TIMESTAMP('2012-09-18 16:37:43','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-09-18 16:37:43','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 18, 2012 4:37:44 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200070 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Sep 18, 2012 4:38:20 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','New EMail',200071,'D','6a228718-3a23-46d3-8e0c-97a6511acc50','New EMail','Y',TO_TIMESTAMP('2012-09-18 16:38:19','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-09-18 16:38:19','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 18, 2012 4:38:20 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200071 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Sep 18, 2012 4:38:36 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','New EMail User',200072,'D','3bf5a60b-20a1-484d-a5f0-11dbe95fcbce','New EMail User','Y',TO_TIMESTAMP('2012-09-18 16:38:35','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-09-18 16:38:35','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 18, 2012 4:38:36 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200072 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Sep 18, 2012 4:39:03 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','New EMail User Password',200073,'D','cfe2fcb8-81cc-4df5-b187-f1df99f8f842','New EMail User Password','Y',TO_TIMESTAMP('2012-09-18 16:38:59','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-09-18 16:38:59','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 18, 2012 4:39:03 PM SGT +-- IDEMPIERE-374 Change password must be changed to be a form instead of a process +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200073 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +SELECT register_migration_script('913_IDEMPIERE-374.sql') FROM dual +; \ No newline at end of file diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VResetPassword.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VResetPassword.java new file mode 100644 index 0000000000..175dfede91 --- /dev/null +++ b/org.adempiere.ui.swing/src/org/compiere/apps/form/VResetPassword.java @@ -0,0 +1,329 @@ +package org.compiere.apps.form; + +import java.awt.BorderLayout; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Insets; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyVetoException; +import java.beans.VetoableChangeListener; +import java.util.logging.Level; + +import javax.swing.JPasswordField; +import javax.swing.JTextField; +import javax.swing.SwingConstants; + +import org.compiere.apps.ADialog; +import org.compiere.apps.ConfirmPanel; +import org.compiere.grid.ed.VLookup; +import org.compiere.model.MLookup; +import org.compiere.model.MLookupFactory; +import org.compiere.model.MSysConfig; +import org.compiere.model.MUser; +import org.compiere.swing.CLabel; +import org.compiere.swing.CPanel; +import org.compiere.util.CLogger; +import org.compiere.util.DisplayType; +import org.compiere.util.Env; +import org.compiere.util.Msg; +import org.compiere.util.Util; + +public class VResetPassword implements FormPanel, ActionListener, VetoableChangeListener { + + private static CLogger log = CLogger.getCLogger(VResetPassword.class); + + private FormFrame frame; + private CPanel mainPanel; + private ConfirmPanel confirmPanel; + + private CLabel lblUser; + private CLabel lblOldPassword; + private CLabel lblNewPassword; + private CLabel lblRetypeNewPassword; + private CLabel lblNewEMail; + private CLabel lblRetypeNewEMail; + private CLabel lblNewEMailUser; + private CLabel lblNewEMailUserPW; + + private VLookup fUser; + private JPasswordField txtOldPassword; + private JPasswordField txtNewPassword; + private JPasswordField txtRetypeNewPassword; + private JTextField txtNewEMail; + private JTextField txtRetypeNewEMail; + private JTextField txtNewEMailUser; + private JTextField txtNewEMailUserPW; + + public int windowNo = 0; + + @Override + public void init(int WindowNo, FormFrame frame) + { + this.windowNo = WindowNo; + this.frame = frame; + + try + { + dynInit(); + jbInit(); + + frame.getContentPane().add(mainPanel, BorderLayout.CENTER); + frame.getContentPane().add(confirmPanel, BorderLayout.SOUTH); + confirmPanel.addActionListener(this); + } + catch(Exception e) + { + log.log(Level.SEVERE, "init", e); + } + } + + private void jbInit() throws Exception + { + GridBagLayout panelLayout = new GridBagLayout(); + mainPanel.setLayout(panelLayout); + + mainPanel.add(lblUser, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 + ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); + mainPanel.add(fUser, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0 + ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); + mainPanel.add(lblOldPassword, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 + ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); + mainPanel.add(txtOldPassword, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0 + ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); + mainPanel.add(lblNewPassword, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 + ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); + mainPanel.add(txtNewPassword, new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0 + ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); + mainPanel.add(lblRetypeNewPassword, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 + ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); + mainPanel.add(txtRetypeNewPassword, new GridBagConstraints(1, 3, 1, 1, 1.0, 0.0 + ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); + mainPanel.add(lblNewEMail, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0 + ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); + mainPanel.add(txtNewEMail, new GridBagConstraints(1, 4, 1, 1, 1.0, 0.0 + ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); + mainPanel.add(lblRetypeNewEMail, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0 + ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); + mainPanel.add(txtRetypeNewEMail, new GridBagConstraints(1, 5, 1, 1, 1.0, 0.0 + ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); + mainPanel.add(lblNewEMailUser, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0 + ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); + mainPanel.add(txtNewEMailUser, new GridBagConstraints(1, 6, 1, 1, 1.0, 0.0 + ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); + mainPanel.add(lblNewEMailUserPW, new GridBagConstraints(0, 7, 1, 1, 0.0, 0.0 + ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); + mainPanel.add(txtNewEMailUserPW, new GridBagConstraints(1, 7, 1, 1, 1.0, 0.0 + ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); + + fUser.addVetoableChangeListener(this); + } + + private void dynInit() + { + mainPanel = new CPanel(); + + // AD_User.AD_User_ID + MLookup userLkp = MLookupFactory.get (Env.getCtx(), windowNo, 0, 212, DisplayType.Search); + fUser = new VLookup("AD_User_ID", false, false, true, userLkp); + + txtOldPassword = new JPasswordField(); + txtOldPassword.setName("txtOldPassword"); + + txtNewPassword = new JPasswordField(); + txtNewPassword.setName("txtNewPassword"); + + txtRetypeNewPassword = new JPasswordField(); + txtRetypeNewPassword.setName("txtRetypeNewPassword"); + + txtNewEMail = new JTextField(); + txtNewEMail.setName("txtNewEMail"); + + txtRetypeNewEMail = new JTextField(); + txtRetypeNewEMail.setName("txtRetypeNewEMail"); + + txtNewEMailUser = new JTextField(); + txtNewEMailUser.setName("txtNewEMailUser"); + + txtNewEMailUserPW = new JTextField(); + txtNewEMailUserPW.setName("txtNewEMailUserPW"); + + lblUser = new CLabel(Msg.translate(Env.getCtx(), "AD_User_ID")); + lblUser.setRequestFocusEnabled(false); + lblUser.setLabelFor(fUser); + lblUser.setHorizontalAlignment(SwingConstants.RIGHT); + + lblOldPassword = new CLabel(Msg.getMsg(Env.getCtx(), "Old Password")); + lblOldPassword.setRequestFocusEnabled(false); + lblOldPassword.setLabelFor(txtOldPassword); + lblOldPassword.setHorizontalAlignment(SwingConstants.RIGHT); + + lblNewPassword = new CLabel(Msg.getMsg(Env.getCtx(), "New Password")); + lblNewPassword.setRequestFocusEnabled(false); + lblNewPassword.setLabelFor(txtNewPassword); + lblNewPassword.setHorizontalAlignment(SwingConstants.RIGHT); + + lblRetypeNewPassword = new CLabel(Msg.getMsg(Env.getCtx(), "New Password Confirm")); + lblRetypeNewPassword.setRequestFocusEnabled(false); + lblRetypeNewPassword.setLabelFor(txtRetypeNewPassword); + lblRetypeNewPassword.setHorizontalAlignment(SwingConstants.RIGHT); + + lblNewEMail = new CLabel(Msg.getMsg(Env.getCtx(), "New EMail")); + lblNewEMail.setRequestFocusEnabled(false); + lblNewEMail.setLabelFor(txtNewEMail); + lblNewEMail.setHorizontalAlignment(SwingConstants.RIGHT); + + lblRetypeNewEMail = new CLabel(Msg.getMsg(Env.getCtx(), "New EMail Confirm")); + lblRetypeNewEMail.setRequestFocusEnabled(false); + lblRetypeNewEMail.setLabelFor(txtRetypeNewEMail); + lblRetypeNewEMail.setHorizontalAlignment(SwingConstants.RIGHT); + + lblNewEMailUser = new CLabel(Msg.getMsg(Env.getCtx(), "New EMail User")); + lblNewEMailUser.setRequestFocusEnabled(false); + lblNewEMailUser.setLabelFor(txtNewEMailUser); + lblNewEMailUser.setHorizontalAlignment(SwingConstants.RIGHT); + + lblNewEMailUserPW = new CLabel(Msg.getMsg(Env.getCtx(), "New EMail User Password")); + lblNewEMailUserPW.setRequestFocusEnabled(false); + lblNewEMailUserPW.setLabelFor(txtNewEMailUserPW); + lblNewEMailUserPW.setHorizontalAlignment(SwingConstants.RIGHT); + + confirmPanel = new ConfirmPanel(); + } + + @Override + public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException + { + log.info(e.getPropertyName() + "=" + e.getNewValue()); + if (e.getPropertyName().equals("AD_User_ID")) + fUser.setValue(e.getNewValue()); + } + + @Override + public void actionPerformed(ActionEvent e) + { + if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) + { + dispose(); + return; + } + else if (e.getActionCommand().equals(ConfirmPanel.A_OK)) + { + validateChangePassword(); + } + } + + private void validateChangePassword() + { + int p_AD_User_ID = -1; + if (fUser.getValue() != null) + p_AD_User_ID = Integer.parseInt(fUser.getValue().toString()); + if (p_AD_User_ID < 0) + { + ADialog.error(windowNo, frame, "UserMandatory"); + return; + } + + String p_OldPassword = new String(txtOldPassword.getPassword()); + String p_NewPassword = new String(txtNewPassword.getPassword()); + String p_NewPasswordConfirm = new String(txtRetypeNewPassword.getPassword()); + String p_NewEMail = txtNewEMail.getText(); + String p_NewEMailConfirm = txtRetypeNewEMail.getText(); + String p_NewEMailUser = txtNewEMailUser.getText(); + String p_NewEMailUserPW = txtNewEMailUserPW.getText(); + + MUser user = MUser.get(Env.getCtx(), p_AD_User_ID); + log.fine("User=" + user); + + // Do we need a password ? + if (Util.isEmpty(p_OldPassword)) // Password required + { + MUser operator = MUser.get(Env.getCtx(), Env.getAD_User_ID(Env.getCtx())); + log.fine("Operator=" + operator); + + if (p_AD_User_ID == 0 // change of System + || p_AD_User_ID == 100 // change of SuperUser + || !operator.isAdministrator()) + { + ADialog.error(windowNo, frame, "OldPasswordMandatory"); + return; + } + } else { + // is entered Password correct ? + boolean hash_password = MSysConfig.getBooleanValue(MSysConfig.USER_PASSWORD_HASH, false); + if (hash_password) { + if (!user.authenticateHash(p_OldPassword)) + { + ADialog.error(windowNo, frame, "OldPasswordNoMatch"); + return; + } + } else { + if (!p_OldPassword.equals(user.getPassword())) + { + ADialog.error(windowNo, frame, "OldPasswordNoMatch"); + return; + } + } + } + + // new password confirm +// if (!Util.isEmpty(p_NewPassword)) { + if (Util.isEmpty(p_NewPasswordConfirm)) { + ADialog.error(windowNo, frame, "NewPasswordConfirmMandatory"); + return; + } else { + if (!p_NewPassword.equals(p_NewPasswordConfirm)) { + ADialog.error(windowNo, frame, "PasswordNotMatch"); + return; + } + } +// } + + if (!Util.isEmpty(p_NewEMailUserPW)) { + if (Util.isEmpty(p_NewEMailConfirm)) { + ADialog.error(windowNo, frame, "NewEmailConfirmMandatory"); + return; + } else { + if (!p_NewEMailUserPW.equals(p_NewEMailConfirm)) { + ADialog.error(windowNo, frame, "NewEmailNotMatch"); + return; + } + } + } + + if (!Util.isEmpty(p_NewPassword)) + user.set_ValueOfColumn("Password", p_NewPassword); // will be hashed and validate on saveEx + if (!Util.isEmpty(p_NewEMail)) + user.setEMail(p_NewEMail); + if (!Util.isEmpty(p_NewEMailUser)) + user.setEMailUser(p_NewEMailUser); + if (!Util.isEmpty(p_NewEMailUserPW)) + user.setEMailUserPW(p_NewEMailUserPW); + + user.saveEx(); + clearForm(); + ADialog.info(windowNo, frame, "RecordSaved"); + return; + } + + private void clearForm() + { + fUser.setValue(null); + txtOldPassword.setText(null); + txtNewPassword.setText(null); + txtRetypeNewPassword.setText(null); + txtNewEMail.setText(null); + txtRetypeNewEMail.setText(null); + txtNewEMailUser.setText(null); + txtNewEMailUserPW.setText(null); + } + + @Override + public void dispose() + { + if (frame != null) + frame.dispose(); + frame = null; + } +} \ No newline at end of file diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WResetPassword.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WResetPassword.java new file mode 100644 index 0000000000..e8cf4ae6ac --- /dev/null +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WResetPassword.java @@ -0,0 +1,352 @@ +/****************************************************************************** + * Copyright (C) 2012 Elaine Tan * + * Copyright (C) 2012 Trek Global + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + *****************************************************************************/ + +package org.adempiere.webui.apps.form; + +import java.util.logging.Level; + +import org.adempiere.webui.AdempiereIdGenerator; +import org.adempiere.webui.component.Column; +import org.adempiere.webui.component.ConfirmPanel; +import org.adempiere.webui.component.Grid; +import org.adempiere.webui.component.GridFactory; +import org.adempiere.webui.component.Label; +import org.adempiere.webui.component.Row; +import org.adempiere.webui.component.Rows; +import org.adempiere.webui.component.Textbox; +import org.adempiere.webui.editor.WSearchEditor; +import org.adempiere.webui.event.ValueChangeEvent; +import org.adempiere.webui.event.ValueChangeListener; +import org.adempiere.webui.panel.ADForm; +import org.adempiere.webui.panel.CustomForm; +import org.adempiere.webui.panel.IFormController; +import org.adempiere.webui.session.SessionManager; +import org.adempiere.webui.window.FDialog; +import org.compiere.model.MLookup; +import org.compiere.model.MLookupFactory; +import org.compiere.model.MSysConfig; +import org.compiere.model.MUser; +import org.compiere.util.CLogger; +import org.compiere.util.DisplayType; +import org.compiere.util.Env; +import org.compiere.util.Msg; +import org.compiere.util.Util; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Borderlayout; +import org.zkoss.zul.Center; +import org.zkoss.zul.Columns; +import org.zkoss.zul.South; + +/** + * Reset Password Form + * @author Elaine + * @date September 18, 2012 + */ +public class WResetPassword implements IFormController, EventListener, ValueChangeListener { + + private static CLogger log = CLogger.getCLogger(WResetPassword.class); + + private CustomForm form; + private Grid gridPanel; + private ConfirmPanel confirmPanel; + + private Label lblUser; + private Label lblOldPassword; + private Label lblNewPassword; + private Label lblRetypeNewPassword; + private Label lblNewEMail; + private Label lblRetypeNewEMail; + private Label lblNewEMailUser; + private Label lblNewEMailUserPW; + + private WSearchEditor fUser; + private Textbox txtOldPassword; + private Textbox txtNewPassword; + private Textbox txtRetypeNewPassword; + private Textbox txtNewEMail; + private Textbox txtRetypeNewEMail; + private Textbox txtNewEMailUser; + private Textbox txtNewEMailUserPW; + + public WResetPassword() + { + form = new CustomForm(); + + try + { + dynInit(); + zkInit(); + + Borderlayout contentPane = new Borderlayout(); + form.appendChild(contentPane); + contentPane.setWidth("99%"); + contentPane.setHeight("100%"); + Center center = new Center(); + center.setStyle("border: none"); + contentPane.appendChild(center); + center.appendChild(gridPanel); + center.setFlex(true); + South south = new South(); + south.setStyle("border: none"); + contentPane.appendChild(south); + south.appendChild(confirmPanel); + confirmPanel.addActionListener(this); + } + catch(Exception ex) + { + log.log(Level.SEVERE, "init", ex); + } + } + + private void dynInit() throws Exception + { + lblUser = new Label(Msg.translate(Env.getCtx(), "AD_User_ID")); + lblOldPassword = new Label(Msg.getMsg(Env.getCtx(), "Old Password")); + lblNewPassword = new Label(Msg.getMsg(Env.getCtx(), "New Password")); + lblRetypeNewPassword = new Label(Msg.getMsg(Env.getCtx(), "New Password Confirm")); + lblNewEMail = new Label(Msg.getMsg(Env.getCtx(), "New EMail")); + lblRetypeNewEMail = new Label(Msg.getMsg(Env.getCtx(), "New EMail Confirm")); + lblNewEMailUser = new Label(Msg.getMsg(Env.getCtx(), "New EMail User")); + lblNewEMailUserPW = new Label(Msg.getMsg(Env.getCtx(), "New EMail User Password")); + + // AD_User.AD_User_ID + MLookup userLkp = MLookupFactory.get(Env.getCtx(), form.getWindowNo(), 0, 212, DisplayType.Search); + fUser = new WSearchEditor("AD_User_ID", false, false, true, userLkp); + fUser.getComponent().setWidth("220px"); + + txtOldPassword = new Textbox(); + txtOldPassword.setId("txtOldPassword"); + txtOldPassword.setType("password"); + txtOldPassword.setAttribute(AdempiereIdGenerator.ZK_COMPONENT_PREFIX_ATTRIBUTE, "unq" + txtOldPassword.getId()); + txtOldPassword.setCols(25); + txtOldPassword.setWidth("220px"); + + txtNewPassword = new Textbox(); + txtNewPassword.setId("txtNewPassword"); + txtNewPassword.setType("password"); + txtNewPassword.setAttribute(AdempiereIdGenerator.ZK_COMPONENT_PREFIX_ATTRIBUTE, "unq" + txtNewPassword.getId()); + txtNewPassword.setCols(25); + txtNewPassword.setWidth("220px"); + + txtRetypeNewPassword = new Textbox(); + txtRetypeNewPassword.setId("txtRetypeNewPassword"); + txtRetypeNewPassword.setType("password"); + txtRetypeNewPassword.setAttribute(AdempiereIdGenerator.ZK_COMPONENT_PREFIX_ATTRIBUTE, "unq" + txtNewPassword.getId()); + txtRetypeNewPassword.setCols(25); + txtRetypeNewPassword.setWidth("220px"); + + txtNewEMail = new Textbox(); + txtNewEMail.setId("txtNewEMail"); + txtNewEMail.setAttribute(AdempiereIdGenerator.ZK_COMPONENT_PREFIX_ATTRIBUTE, "unq" + txtNewEMail.getId()); + txtNewEMail.setCols(25); + txtNewEMail.setWidth("220px"); + + txtRetypeNewEMail = new Textbox(); + txtRetypeNewEMail.setId("txtRetypeNewEMail"); + txtRetypeNewEMail.setAttribute(AdempiereIdGenerator.ZK_COMPONENT_PREFIX_ATTRIBUTE, "unq" + txtRetypeNewEMail.getId()); + txtRetypeNewEMail.setCols(25); + txtRetypeNewEMail.setWidth("220px"); + + txtNewEMailUser = new Textbox(); + txtNewEMailUser.setId("txtNewEMailUser"); + txtNewEMailUser.setAttribute(AdempiereIdGenerator.ZK_COMPONENT_PREFIX_ATTRIBUTE, "unq" + txtNewEMailUser.getId()); + txtNewEMailUser.setCols(25); + txtNewEMailUser.setWidth("220px"); + + txtNewEMailUserPW = new Textbox(); + txtNewEMailUserPW.setId("txtNewEMailUserPW"); + txtNewEMailUserPW.setAttribute(AdempiereIdGenerator.ZK_COMPONENT_PREFIX_ATTRIBUTE, "unq" + txtNewEMailUserPW.getId()); + txtNewEMailUserPW.setCols(25); + txtNewEMailUserPW.setWidth("220px"); + + confirmPanel = new ConfirmPanel(true); + } + + private void zkInit() throws Exception + { + gridPanel = GridFactory.newGridLayout(); + + Columns columns = new Columns(); + gridPanel.appendChild(columns); + + Column column = new Column(); + columns.appendChild(column); + column.setWidth("40%"); + + column = new Column(); + columns.appendChild(column); + column.setWidth("60%"); + + Rows rows = new Rows(); + gridPanel.appendChild(rows); + + Row row = new Row(); + rows.appendChild(row); + row.appendChild(lblUser.rightAlign()); + row.appendChild(fUser.getComponent()); + fUser.addValueChangeListener(this); + + row = new Row(); + rows.appendChild(row); + row.appendChild(lblOldPassword.rightAlign()); + row.appendChild(txtOldPassword); + + row = new Row(); + rows.appendChild(row); + row.appendChild(lblNewPassword.rightAlign()); + row.appendChild(txtNewPassword); + + row = new Row(); + rows.appendChild(row); + row.appendChild(lblRetypeNewPassword.rightAlign()); + row.appendChild(txtRetypeNewPassword); + + row = new Row(); + rows.appendChild(row); + row.appendChild(lblNewEMail.rightAlign()); + row.appendChild(txtNewEMail); + + row = new Row(); + rows.appendChild(row); + row.appendChild(lblRetypeNewEMail.rightAlign()); + row.appendChild(txtRetypeNewEMail); + + row = new Row(); + rows.appendChild(row); + row.appendChild(lblNewEMailUser.rightAlign()); + row.appendChild(txtNewEMailUser); + + row = new Row(); + rows.appendChild(row); + row.appendChild(lblNewEMailUserPW.rightAlign()); + row.appendChild(txtNewEMailUserPW); + } + + @Override + public void valueChange(ValueChangeEvent e) { + log.info(e.getPropertyName() + "=" + e.getNewValue()); + if (e.getPropertyName().equals("AD_User_ID")) + fUser.setValue(e.getNewValue()); + } + + @Override + public void onEvent(Event e) throws Exception + { + if (e.getTarget().getId().equals(ConfirmPanel.A_CANCEL)) + { + SessionManager.getAppDesktop().closeActiveWindow(); + return; + } + else if (e.getTarget().getId().equals(ConfirmPanel.A_OK)) + { + validateChangePassword(); + } + } + + private void validateChangePassword() + { + int p_AD_User_ID = -1; + if (fUser.getValue() != null) + p_AD_User_ID = Integer.parseInt(fUser.getValue().toString()); + if (p_AD_User_ID < 0) + throw new IllegalArgumentException(Msg.getMsg(Env.getCtx(), "UserMandatory")); + + String p_OldPassword = txtOldPassword.getValue(); + String p_NewPassword = txtNewPassword.getValue(); + String p_NewPasswordConfirm = txtRetypeNewPassword.getValue(); + String p_NewEMail = txtNewEMail.getValue(); + String p_NewEMailConfirm = txtRetypeNewEMail.getValue(); + String p_NewEMailUser = txtNewEMailUser.getValue(); + String p_NewEMailUserPW = txtNewEMailUserPW.getValue(); + + MUser user = MUser.get(Env.getCtx(), p_AD_User_ID); + log.fine("User=" + user); + + // Do we need a password ? + if (Util.isEmpty(p_OldPassword)) // Password required + { + MUser operator = MUser.get(Env.getCtx(), Env.getAD_User_ID(Env.getCtx())); + log.fine("Operator=" + operator); + + if (p_AD_User_ID == 0 // change of System + || p_AD_User_ID == 100 // change of SuperUser + || !operator.isAdministrator()) + throw new IllegalArgumentException(Msg.getMsg(Env.getCtx(), "OldPasswordMandatory")); + } else { + // is entered Password correct ? + boolean hash_password = MSysConfig.getBooleanValue(MSysConfig.USER_PASSWORD_HASH, false); + if (hash_password) { + if (!user.authenticateHash(p_OldPassword)) + throw new IllegalArgumentException(Msg.getMsg(Env.getCtx(), "OldPasswordNoMatch")); + } else { + if (!p_OldPassword.equals(user.getPassword())) + throw new IllegalArgumentException(Msg.getMsg(Env.getCtx(), "OldPasswordNoMatch")); + } + } + + // new password confirm +// if (!Util.isEmpty(p_NewPassword)) { + if (Util.isEmpty(p_NewPasswordConfirm)) { + throw new IllegalArgumentException(Msg.getMsg(Env.getCtx(), "NewPasswordConfirmMandatory")); + } else { + if (!p_NewPassword.equals(p_NewPasswordConfirm)) { + throw new IllegalArgumentException(Msg.getMsg(Env.getCtx(), "PasswordNotMatch")); + } + } +// } + + if (!Util.isEmpty(p_NewEMailUserPW)) { + if (Util.isEmpty(p_NewEMailConfirm)) { + throw new IllegalArgumentException(Msg.getMsg(Env.getCtx(), "NewEmailConfirmMandatory")); + } else { + if (!p_NewEMailUserPW.equals(p_NewEMailConfirm)) { + throw new IllegalArgumentException(Msg.getMsg(Env.getCtx(), "NewEmailNotMatch")); + } + } + } + + if (!Util.isEmpty(p_NewPassword)) + user.set_ValueOfColumn("Password", p_NewPassword); // will be hashed and validate on saveEx + if (!Util.isEmpty(p_NewEMail)) + user.setEMail(p_NewEMail); + if (!Util.isEmpty(p_NewEMailUser)) + user.setEMailUser(p_NewEMailUser); + if (!Util.isEmpty(p_NewEMailUserPW)) + user.setEMailUserPW(p_NewEMailUserPW); + + user.saveEx(); + clearForm(); + FDialog.info(form.getWindowNo(), form, "RecordSaved"); + return; + } + + private void clearForm() + { + fUser.setValue(null); + txtOldPassword.setValue(null); + txtNewPassword.setValue(null); + txtRetypeNewPassword.setValue(null); + txtNewEMail.setValue(null); + txtRetypeNewEMail.setValue(null); + txtNewEMailUser.setValue(null); + txtNewEMailUserPW.setValue(null); + } + + @Override + public ADForm getForm() + { + return form; + } +} diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/AbstractMenuPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/AbstractMenuPanel.java index 2201f19497..0743057c05 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/AbstractMenuPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/AbstractMenuPanel.java @@ -221,6 +221,11 @@ public abstract class AbstractMenuPanel extends Panel implements EventListener Date: Wed, 19 Sep 2012 13:02:33 -0500 Subject: [PATCH 42/79] IDEMPIERE-374 Change password must be changed to be a form instead of a process --- .../org/compiere/apps/form/VResetPassword.java | 17 ++++++++++++++++- .../webui/apps/form/WResetPassword.java | 16 +++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VResetPassword.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VResetPassword.java index 175dfede91..2f38ec9f86 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/VResetPassword.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/form/VResetPassword.java @@ -265,6 +265,13 @@ public class VResetPassword implements FormPanel, ActionListener, VetoableChange return; } } + if (MSysConfig.getBooleanValue(MSysConfig.CHANGE_PASSWORD_MUST_DIFFER, true)) + { + if (p_OldPassword.equals(p_NewPassword)) { + ADialog.error(windowNo, frame, "NewPasswordMustDiffer"); + return; + } + } } // new password confirm @@ -301,7 +308,15 @@ public class VResetPassword implements FormPanel, ActionListener, VetoableChange if (!Util.isEmpty(p_NewEMailUserPW)) user.setEMailUserPW(p_NewEMailUserPW); - user.saveEx(); + try { + user.saveEx(); + } + catch(Exception e) + { + ADialog.error(windowNo, frame, e.getLocalizedMessage()); + user.load(user.get_TrxName()); + return; + } clearForm(); ADialog.info(windowNo, frame, "RecordSaved"); return; diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WResetPassword.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WResetPassword.java index e8cf4ae6ac..7063ff87fe 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WResetPassword.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WResetPassword.java @@ -16,6 +16,7 @@ package org.adempiere.webui.apps.form; import java.util.logging.Level; +import org.adempiere.exceptions.AdempiereException; import org.adempiere.webui.AdempiereIdGenerator; import org.adempiere.webui.component.Column; import org.adempiere.webui.component.ConfirmPanel; @@ -294,6 +295,12 @@ public class WResetPassword implements IFormController, EventListener, ValueChan if (!p_OldPassword.equals(user.getPassword())) throw new IllegalArgumentException(Msg.getMsg(Env.getCtx(), "OldPasswordNoMatch")); } + if (MSysConfig.getBooleanValue(MSysConfig.CHANGE_PASSWORD_MUST_DIFFER, true)) + { + if (p_OldPassword.equals(p_NewPassword)) { + throw new IllegalArgumentException(Msg.getMsg(Env.getCtx(), "NewPasswordMustDiffer")); + } + } } // new password confirm @@ -326,7 +333,14 @@ public class WResetPassword implements IFormController, EventListener, ValueChan if (!Util.isEmpty(p_NewEMailUserPW)) user.setEMailUserPW(p_NewEMailUserPW); - user.saveEx(); + try { + user.saveEx(); + } + catch(AdempiereException e) + { + user.load(user.get_TrxName()); + throw e; + } clearForm(); FDialog.info(form.getWindowNo(), form, "RecordSaved"); return; From aa20175f3edbb539c89b1b706265d4a45807a7fe Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 19 Sep 2012 14:29:42 -0500 Subject: [PATCH 43/79] IDEMPIERE-308 Performance: Replace use of StringBuffer and String concatenation with StringBuilder / Thanks to Richard Morales --- .../org/adempiere/model/MRelationType.java | 2 +- .../org/adempiere/model/PromotionRule.java | 36 +++++++------- .../adempiere/process/ResetLockedAccount.java | 4 +- .../util/ModelInterfaceGenerator.java | 47 ++++++++++--------- .../src/org/compiere/acct/Doc.java | 16 +++---- .../org/compiere/acct/DocLine_Allocation.java | 9 ++-- .../src/org/compiere/acct/DocManager.java | 16 +++---- .../src/org/compiere/acct/DocTax.java | 8 ++-- .../org/compiere/acct/Doc_AllocationHdr.java | 39 +++++++-------- .../src/org/compiere/acct/Doc_Invoice.java | 12 ++--- .../src/org/compiere/acct/Doc_Order.java | 16 +++---- .../src/org/compiere/acct/Doc_Production.java | 10 ++-- .../org/compiere/acct/Doc_ProjectIssue.java | 22 ++++----- .../src/org/compiere/acct/FactLine.java | 24 +++++----- .../src/org/compiere/acct/Matcher.java | 24 +++++----- .../src/org/compiere/acct/ProductInfo.java | 28 +++++------ .../src/org/compiere/impexp/ImpFormat.java | 22 ++++----- .../src/org/compiere/impexp/MImpFormat.java | 8 ++-- .../src/org/compiere/model/GridFieldVO.java | 6 +-- .../src/org/compiere/model/GridWindow.java | 18 +++---- .../src/compiere/model/CalloutUser.java | 26 +++++----- 21 files changed, 199 insertions(+), 194 deletions(-) diff --git a/org.adempiere.base/src/org/adempiere/model/MRelationType.java b/org.adempiere.base/src/org/adempiere/model/MRelationType.java index e67b83bb28..3bd4cf3001 100644 --- a/org.adempiere.base/src/org/adempiere/model/MRelationType.java +++ b/org.adempiere.base/src/org/adempiere/model/MRelationType.java @@ -63,7 +63,7 @@ public class MRelationType extends X_AD_RelationType implements IZoomProvider { * Warning: Doesn't support POs with more or less than one key * column. */ - final static StringBuffer SQL = // + static StringBuffer SQL = // new StringBuffer(" SELECT " )// .append(" rt.AD_RelationType_ID AS ").append(COLUMNNAME_AD_RelationType_ID) // .append(", rt.Name AS ").append(COLUMNNAME_Name )// diff --git a/org.adempiere.base/src/org/adempiere/model/PromotionRule.java b/org.adempiere.base/src/org/adempiere/model/PromotionRule.java index af5f4ab9ae..f8bb5085a1 100644 --- a/org.adempiere.base/src/org/adempiere/model/PromotionRule.java +++ b/org.adempiere.base/src/org/adempiere/model/PromotionRule.java @@ -326,8 +326,8 @@ public class PromotionRule { * @throws Exception */ private static Map> findM_Promotion_ID(MOrder order) throws Exception { - StringBuffer select = new StringBuffer("SELECT M_Promotion.M_Promotion_ID From M_Promotion Inner Join M_PromotionPreCondition ") - .append(" ON (M_Promotion.M_Promotion_ID = M_PromotionPreCondition.M_Promotion_ID)"); + String select = "SELECT M_Promotion.M_Promotion_ID From M_Promotion Inner Join M_PromotionPreCondition " + + " ON (M_Promotion.M_Promotion_ID = M_PromotionPreCondition.M_Promotion_ID)"; String bpFilter = "M_PromotionPreCondition.C_BPartner_ID = ? OR M_PromotionPreCondition.C_BP_Group_ID = ? OR (M_PromotionPreCondition.C_BPartner_ID IS NULL AND M_PromotionPreCondition.C_BP_Group_ID IS NULL)"; String priceListFilter = "M_PromotionPreCondition.M_PriceList_ID IS NULL OR M_PromotionPreCondition.M_PriceList_ID = ?"; @@ -414,12 +414,13 @@ public class PromotionRule { private static DistributionSet calculateDistributionQty(MPromotionDistribution distribution, DistributionSet prevSet, List validPromotionLineIDs, Map orderLineQty, List orderLineIdList, String trxName) throws Exception { - StringBuilder sql = new StringBuilder("SELECT C_OrderLine.C_OrderLine_ID FROM M_PromotionLine") - .append(" INNER JOIN M_PromotionGroup ON (M_PromotionLine.M_PromotionGroup_ID = M_PromotionGroup.M_PromotionGroup_ID AND M_PromotionGroup.IsActive = 'Y')") - .append(" INNER JOIN M_PromotionGroupLine ON (M_PromotionGroup.M_PromotionGroup_ID = M_PromotionGroupLine.M_PromotionGroup_ID AND M_PromotionGroupLine.IsActive = 'Y')") - .append(" INNER JOIN C_OrderLine ON (M_PromotionGroupLine.M_Product_ID = C_OrderLine.M_Product_ID)") - .append(" WHERE M_PromotionLine.M_PromotionLine_ID = ? AND C_OrderLine.C_OrderLine_ID = ?") - .append(" AND M_PromotionLine.IsActive = 'Y'"); + String sql = "SELECT C_OrderLine.C_OrderLine_ID FROM M_PromotionLine" + + " INNER JOIN M_PromotionGroup ON (M_PromotionLine.M_PromotionGroup_ID = M_PromotionGroup.M_PromotionGroup_ID AND M_PromotionGroup.IsActive = 'Y')" + + " INNER JOIN M_PromotionGroupLine ON (M_PromotionGroup.M_PromotionGroup_ID = M_PromotionGroupLine.M_PromotionGroup_ID AND M_PromotionGroupLine.IsActive = 'Y')" + + " INNER JOIN C_OrderLine ON (M_PromotionGroupLine.M_Product_ID = C_OrderLine.M_Product_ID)" + + " WHERE M_PromotionLine.M_PromotionLine_ID = ? AND C_OrderLine.C_OrderLine_ID = ?" + + " AND M_PromotionLine.IsActive = 'Y'"; + DistributionSet distributionSet = new DistributionSet(); ListeligibleOrderLineIDs = new ArrayList(); @@ -434,7 +435,7 @@ public class PromotionRule { PreparedStatement stmt = null; ResultSet rs = null; try { - stmt = DB.prepareStatement(sql.toString(), trxName); + stmt = DB.prepareStatement(sql, trxName); stmt.setInt(1, distribution.getM_PromotionLine_ID()); stmt.setInt(2, C_OrderLine_ID); rs = stmt.executeQuery(); @@ -544,20 +545,21 @@ public class PromotionRule { //List Listapplicable = new ArrayList(); MOrderLine[] lines = order.getLines(); + String sql = "SELECT DISTINCT C_OrderLine.C_OrderLine_ID FROM M_PromotionGroup INNER JOIN M_PromotionGroupLine" + + " ON (M_PromotionGroup.M_PromotionGroup_ID = M_PromotionGroupLine.M_PromotionGroup_ID AND M_PromotionGroupLine.IsActive = 'Y')" + + " INNER JOIN C_OrderLine ON (M_PromotionGroupLine.M_Product_ID = C_OrderLine.M_Product_ID)" + + " INNER JOIN M_PromotionLine ON (M_PromotionLine.M_PromotionGroup_ID = M_PromotionGroup.M_PromotionGroup_ID)" + + " WHERE M_PromotionLine.M_PromotionLine_ID = ? AND C_OrderLine.C_Order_ID = ?" + + " AND M_PromotionLine.IsActive = 'Y'" + + " AND M_PromotionGroup.IsActive = 'Y'"; for (MPromotionLine pl : plist) { boolean match = false; if (pl.getM_PromotionGroup_ID() > 0) { - StringBuilder sql = new StringBuilder("SELECT DISTINCT C_OrderLine.C_OrderLine_ID FROM M_PromotionGroup INNER JOIN M_PromotionGroupLine") - .append(" ON (M_PromotionGroup.M_PromotionGroup_ID = M_PromotionGroupLine.M_PromotionGroup_ID AND M_PromotionGroupLine.IsActive = 'Y')") - .append(" INNER JOIN C_OrderLine ON (M_PromotionGroupLine.M_Product_ID = C_OrderLine.M_Product_ID)") - .append(" INNER JOIN M_PromotionLine ON (M_PromotionLine.M_PromotionGroup_ID = M_PromotionGroup.M_PromotionGroup_ID)") - .append(" WHERE M_PromotionLine.M_PromotionLine_ID = ? AND C_OrderLine.C_Order_ID = ?") - .append(" AND M_PromotionLine.IsActive = 'Y'") - .append(" AND M_PromotionGroup.IsActive = 'Y'"); + PreparedStatement stmt = null; ResultSet rs = null; try { - stmt = DB.prepareStatement(sql.toString(), order.get_TrxName()); + stmt = DB.prepareStatement(sql, order.get_TrxName()); stmt.setInt(1, pl.getM_PromotionLine_ID()); stmt.setInt(2, order.getC_Order_ID()); rs = stmt.executeQuery(); diff --git a/org.adempiere.base/src/org/adempiere/process/ResetLockedAccount.java b/org.adempiere.base/src/org/adempiere/process/ResetLockedAccount.java index 7fd77275b2..13321d8dff 100644 --- a/org.adempiere.base/src/org/adempiere/process/ResetLockedAccount.java +++ b/org.adempiere.base/src/org/adempiere/process/ResetLockedAccount.java @@ -47,7 +47,7 @@ public class ResetLockedAccount extends SvrProcess { if (!user.isLocked()) throw new AdempiereException("User " + user.getName() + " is not locked"); - StringBuffer sql = new StringBuffer ("UPDATE AD_User SET IsLocked = 'N', DateAccountLocked=NULL, FailedLoginCount=0, DateLastLogin=NULL, Updated=SysDate ") + StringBuilder sql = new StringBuilder ("UPDATE AD_User SET IsLocked = 'N', DateAccountLocked=NULL, FailedLoginCount=0, DateLastLogin=NULL, Updated=SysDate ") .append(" WHERE IsLocked='Y' AND AD_Client_ID = ? ") .append(" AND DateAccountLocked IS NOT NULL ") .append(" AND AD_User_ID = " + user.getAD_User_ID()); @@ -62,7 +62,7 @@ public class ResetLockedAccount extends SvrProcess { int MAX_ACCOUNT_LOCK_MINUTES = MSysConfig.getIntValue(MSysConfig.USER_LOCKING_MAX_ACCOUNT_LOCK_MINUTES, 0); int MAX_INACTIVE_PERIOD = MSysConfig.getIntValue(MSysConfig.USER_LOCKING_MAX_INACTIVE_PERIOD_DAY, 0); - StringBuffer sql = new StringBuffer("UPDATE AD_User SET IsLocked = 'N', DateAccountLocked=NULL, FailedLoginCount=0, DateLastLogin=NULL, Updated=SysDate ") + StringBuilder sql = new StringBuilder("UPDATE AD_User SET IsLocked = 'N', DateAccountLocked=NULL, FailedLoginCount=0, DateLastLogin=NULL, Updated=SysDate ") .append(" WHERE IsLocked='Y' AND AD_Client_ID IN (0, ?) ") .append(" AND DateAccountLocked IS NOT NULL"); diff --git a/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java b/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java index 435a2655f1..24ef048802 100644 --- a/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java +++ b/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java @@ -233,23 +233,24 @@ public class ModelInterfaceGenerator */ private StringBuffer createColumns(int AD_Table_ID, StringBuffer mandatory) { StringBuffer sb = new StringBuffer(); - StringBuffer sql = new StringBuffer("SELECT c.ColumnName, c.IsUpdateable, c.IsMandatory,") // 1..3 - .append(" c.AD_Reference_ID, c.AD_Reference_Value_ID, DefaultValue, SeqNo, ") // 4..7 - .append(" c.FieldLength, c.ValueMin, c.ValueMax, c.VFormat, c.Callout, ") // 8..12 - .append(" c.Name, c.Description, c.ColumnSQL, c.IsEncrypted, c.IsKey ") // 13..17 - .append("FROM AD_Column c ") - .append("WHERE c.AD_Table_ID=?") + String sql = "SELECT c.ColumnName, c.IsUpdateable, c.IsMandatory," // 1..3 + + " c.AD_Reference_ID, c.AD_Reference_Value_ID, DefaultValue, SeqNo, " // 4..7 + + " c.FieldLength, c.ValueMin, c.ValueMax, c.VFormat, c.Callout, " // 8..12 + + " c.Name, c.Description, c.ColumnSQL, c.IsEncrypted, c.IsKey " // 13..17 + + "FROM AD_Column c " + + "WHERE c.AD_Table_ID=?" + // + " AND c.ColumnName <> 'AD_Client_ID'" // + " AND c.ColumnName <> 'AD_Org_ID'" // + " AND c.ColumnName <> 'IsActive'" // + " AND c.ColumnName NOT LIKE 'Created%'" // + " AND c.ColumnName NOT LIKE 'Updated%' " - .append(" AND c.IsActive='Y'") - .append(" ORDER BY c.ColumnName"); + + " AND c.IsActive='Y'" + + " ORDER BY c.ColumnName"; PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql.toString(), null); + pstmt = DB.prepareStatement(sql, null); pstmt.setInt(1, AD_Table_ID); rs = pstmt.executeQuery(); while (rs.next()) { @@ -289,7 +290,7 @@ public class ModelInterfaceGenerator } catch (SQLException e) { - throw new DBException(e, sql.toString()); + throw new DBException(e, sql); } finally { @@ -495,15 +496,15 @@ public class ModelInterfaceGenerator else if ((DisplayType.Table == displayType || DisplayType.Search == displayType) && AD_Reference_ID > 0) { - StringBuffer sql = new StringBuffer("SELECT c.AD_Reference_ID, c.AD_Reference_Value_ID") - .append(" FROM AD_Ref_Table rt") - .append(" INNER JOIN AD_Column c ON (c.AD_Column_ID=rt.AD_Key)") - .append(" WHERE rt.AD_Reference_ID=?"); + String sql = "SELECT c.AD_Reference_ID, c.AD_Reference_Value_ID" + +" FROM AD_Ref_Table rt" + +" INNER JOIN AD_Column c ON (c.AD_Column_ID=rt.AD_Key)" + +" WHERE rt.AD_Reference_ID=?"; PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql.toString(), null); + pstmt = DB.prepareStatement(sql, null); pstmt.setInt(1, AD_Reference_ID); rs = pstmt.executeQuery(); if (rs.next()) @@ -518,7 +519,7 @@ public class ModelInterfaceGenerator } catch (SQLException e) { - throw new DBException(e, sql.toString()); + throw new DBException(e, sql); } finally { @@ -670,17 +671,17 @@ public class ModelInterfaceGenerator if (AD_Table_ID == 707 && columnName.equals("Account_ID")) return null; // - final StringBuffer sql = new StringBuffer("SELECT t.TableName, t.EntityType, ck.AD_Reference_ID") - .append(" FROM AD_Ref_Table rt") - .append(" INNER JOIN AD_Table t ON (t.AD_Table_ID=rt.AD_Table_ID)") - .append(" INNER JOIN AD_Column ck ON (ck.AD_Table_ID=rt.AD_Table_ID AND ck.AD_Column_ID=rt.AD_Key)") - .append(" WHERE rt.AD_Reference_ID=?") + final String sql = "SELECT t.TableName, t.EntityType, ck.AD_Reference_ID" + +" FROM AD_Ref_Table rt" + +" INNER JOIN AD_Table t ON (t.AD_Table_ID=rt.AD_Table_ID)" + +" INNER JOIN AD_Column ck ON (ck.AD_Table_ID=rt.AD_Table_ID AND ck.AD_Column_ID=rt.AD_Key)" + +" WHERE rt.AD_Reference_ID=?" ; PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql.toString(), null); + pstmt = DB.prepareStatement(sql, null); pstmt.setInt(1, AD_Reference_ID); rs = pstmt.executeQuery(); if (rs.next()) @@ -705,7 +706,7 @@ public class ModelInterfaceGenerator } catch (SQLException e) { - throw new DBException(e, sql.toString()); + throw new DBException(e, sql); } finally { diff --git a/org.adempiere.base/src/org/compiere/acct/Doc.java b/org.adempiere.base/src/org/compiere/acct/Doc.java index 6e4c468b1d..6516c0ac10 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc.java @@ -841,8 +841,8 @@ public abstract class Doc // We have a document Type, but no GL info - search for DocType if (m_GL_Category_ID == 0) { - StringBuilder sql = new StringBuilder("SELECT GL_Category_ID FROM C_DocType ") - .append("WHERE AD_Client_ID=? AND DocBaseType=?"); + String sql = "SELECT GL_Category_ID FROM C_DocType " + + "WHERE AD_Client_ID=? AND DocBaseType=?"; try { PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null); @@ -856,19 +856,19 @@ public abstract class Doc } catch (SQLException e) { - log.log(Level.SEVERE, sql.toString(), e); + log.log(Level.SEVERE, sql, e); } } // Still no GL_Category - get Default GL Category if (m_GL_Category_ID == 0) { - StringBuilder sql = new StringBuilder("SELECT GL_Category_ID FROM GL_Category ") - .append("WHERE AD_Client_ID=? ") - .append("ORDER BY IsDefault DESC"); + String sql = "SELECT GL_Category_ID FROM GL_Category " + + "WHERE AD_Client_ID=? " + + "ORDER BY IsDefault DESC"; try { - PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null); + PreparedStatement pstmt = DB.prepareStatement(sql, null); pstmt.setInt(1, getAD_Client_ID()); ResultSet rsDT = pstmt.executeQuery(); if (rsDT.next()) @@ -878,7 +878,7 @@ public abstract class Doc } catch (SQLException e) { - log.log(Level.SEVERE, sql.toString(), e); + log.log(Level.SEVERE, sql, e); } } // diff --git a/org.adempiere.base/src/org/compiere/acct/DocLine_Allocation.java b/org.adempiere.base/src/org/compiere/acct/DocLine_Allocation.java index 28c833940e..a70746a68e 100644 --- a/org.adempiere.base/src/org/compiere/acct/DocLine_Allocation.java +++ b/org.adempiere.base/src/org/compiere/acct/DocLine_Allocation.java @@ -71,10 +71,11 @@ public class DocLine_Allocation extends DocLine { if (m_C_Invoice_ID == 0) return 0; - StringBuilder sql = new StringBuilder("SELECT C_Currency_ID ") - .append("FROM C_Invoice ") - .append("WHERE C_Invoice_ID=?"); - return DB.getSQLValue(null, sql.toString(), m_C_Invoice_ID); + String sql = "SELECT C_Currency_ID " + + "FROM C_Invoice " + + "WHERE C_Invoice_ID=?"; + return DB.getSQLValue(null, sql, m_C_Invoice_ID); + } // getInvoiceC_Currency_ID /** diff --git a/org.adempiere.base/src/org/compiere/acct/DocManager.java b/org.adempiere.base/src/org/compiere/acct/DocManager.java index adc71421d8..97b83de957 100644 --- a/org.adempiere.base/src/org/compiere/acct/DocManager.java +++ b/org.adempiere.base/src/org/compiere/acct/DocManager.java @@ -68,19 +68,19 @@ public class DocManager { private static void fillDocumentsTableArrays() { if (documentsTableID == null) { - StringBuilder sql = new StringBuilder("SELECT t.AD_Table_ID, t.TableName ") - .append("FROM AD_Table t, AD_Column c ") - .append("WHERE t.AD_Table_ID=c.AD_Table_ID AND ") - .append("c.ColumnName='Posted' AND ") - .append("IsView='N' ") - .append("ORDER BY t.AD_Table_ID"); + String sql = "SELECT t.AD_Table_ID, t.TableName " + + "FROM AD_Table t, AD_Column c " + + "WHERE t.AD_Table_ID=c.AD_Table_ID AND " + + "c.ColumnName='Posted' AND " + + "IsView='N' " + + "ORDER BY t.AD_Table_ID"; ArrayList tableIDs = new ArrayList(); ArrayList tableNames = new ArrayList(); PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql.toString(), null); + pstmt = DB.prepareStatement(sql, null); rs = pstmt.executeQuery(); while (rs.next()) { @@ -90,7 +90,7 @@ public class DocManager { } catch (SQLException e) { - throw new DBException(e, sql.toString()); + throw new DBException(e, sql); } finally { diff --git a/org.adempiere.base/src/org/compiere/acct/DocTax.java b/org.adempiere.base/src/org/compiere/acct/DocTax.java index 7358cd20bc..6a1ee7effa 100644 --- a/org.adempiere.base/src/org/compiere/acct/DocTax.java +++ b/org.adempiere.base/src/org/compiere/acct/DocTax.java @@ -96,14 +96,14 @@ public final class DocTax if (AcctType < 0 || AcctType > 4) return null; // - StringBuilder sql = new StringBuilder("SELECT T_Due_Acct, T_Liability_Acct, T_Credit_Acct, T_Receivables_Acct, T_Expense_Acct ") - .append("FROM C_Tax_Acct WHERE C_Tax_ID=? AND C_AcctSchema_ID=?"); + String sql = "SELECT T_Due_Acct, T_Liability_Acct, T_Credit_Acct, T_Receivables_Acct, T_Expense_Acct " + + "FROM C_Tax_Acct WHERE C_Tax_ID=? AND C_AcctSchema_ID=?"; int validCombination_ID = 0; PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql.toString(), null); + pstmt = DB.prepareStatement(sql, null); pstmt.setInt(1, m_C_Tax_ID); pstmt.setInt(2, as.getC_AcctSchema_ID()); rs = pstmt.executeQuery(); @@ -112,7 +112,7 @@ public final class DocTax } catch (SQLException e) { - log.log(Level.SEVERE, sql.toString(), e); + log.log(Level.SEVERE, sql, e); } finally { DB.close(rs, pstmt); diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java b/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java index 60fdb95f5e..d0e8a10dd5 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java @@ -628,14 +628,14 @@ public class Doc_AllocationHdr extends Doc // or Doc.ACCTTYPE_PaymentSelect (AP) or V_Prepayment int accountType = Doc.ACCTTYPE_UnallocatedCash; // - StringBuilder sql = new StringBuilder("SELECT p.C_BankAccount_ID, d.DocBaseType, p.IsReceipt, p.IsPrepayment ") - .append("FROM C_Payment p INNER JOIN C_DocType d ON (p.C_DocType_ID=d.C_DocType_ID) ") - .append("WHERE C_Payment_ID=?"); + String sql = "SELECT p.C_BankAccount_ID, d.DocBaseType, p.IsReceipt, p.IsPrepayment " + + "FROM C_Payment p INNER JOIN C_DocType d ON (p.C_DocType_ID=d.C_DocType_ID) " + + "WHERE C_Payment_ID=?"; PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement (sql.toString(), getTrxName()); + pstmt = DB.prepareStatement (sql, getTrxName()); pstmt.setInt (1, C_Payment_ID); rs = pstmt.executeQuery (); if (rs.next ()) @@ -655,7 +655,7 @@ public class Doc_AllocationHdr extends Doc } catch (Exception e) { - log.log(Level.SEVERE, sql.toString(), e); + log.log(Level.SEVERE, sql, e); } finally { @@ -680,10 +680,11 @@ public class Doc_AllocationHdr extends Doc */ private MAccount getCashAcct (MAcctSchema as, int C_CashLine_ID) { - StringBuilder sql = new StringBuilder("SELECT c.C_CashBook_ID ") - .append("FROM C_Cash c, C_CashLine cl ") - .append("WHERE c.C_Cash_ID=cl.C_Cash_ID AND cl.C_CashLine_ID=?"); - setC_CashBook_ID(DB.getSQLValue(null, sql.toString(), C_CashLine_ID)); + String sql = "SELECT c.C_CashBook_ID " + + "FROM C_Cash c, C_CashLine cl " + + "WHERE c.C_Cash_ID=cl.C_Cash_ID AND cl.C_CashLine_ID=?"; + setC_CashBook_ID(DB.getSQLValue(null, sql, C_CashLine_ID)); + if (getC_CashBook_ID() <= 0) { log.log(Level.SEVERE, "NONE for C_CashLine_ID=" + C_CashLine_ID); @@ -711,10 +712,10 @@ public class Doc_AllocationHdr extends Doc BigDecimal invoiceSource = null; BigDecimal invoiceAccounted = null; // - StringBuffer sql = new StringBuffer("SELECT ") - .append((invoice.isSOTrx() + StringBuilder sql = new StringBuilder("SELECT ") + .append(invoice.isSOTrx() ? "SUM(AmtSourceDr), SUM(AmtAcctDr)" // so - : "SUM(AmtSourceCr), SUM(AmtAcctCr)")) // po + : "SUM(AmtSourceCr), SUM(AmtAcctCr)") // po .append(" FROM Fact_Acct ") .append("WHERE AD_Table_ID=318 AND Record_ID=?") // Invoice .append(" AND C_AcctSchema_ID=?") @@ -856,16 +857,16 @@ public class Doc_AllocationHdr extends Doc DiscountAccount, discount, WriteOffAccoint, writeOff, isSOTrx); // Get Source Amounts with account - StringBuilder sql = new StringBuilder("SELECT * ") - .append("FROM Fact_Acct ") - .append("WHERE AD_Table_ID=318 AND Record_ID=?") // Invoice - .append(" AND C_AcctSchema_ID=?") - .append(" AND Line_ID IS NULL"); // header lines like tax or total + String sql = "SELECT * " + + "FROM Fact_Acct " + + "WHERE AD_Table_ID=318 AND Record_ID=?" // Invoice + + " AND C_AcctSchema_ID=?" + + " AND Line_ID IS NULL"; // header lines like tax or total PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql.toString(), getTrxName()); + pstmt = DB.prepareStatement(sql, getTrxName()); pstmt.setInt(1, line.getC_Invoice_ID()); pstmt.setInt(2, as.getC_AcctSchema_ID()); rs = pstmt.executeQuery(); @@ -874,7 +875,7 @@ public class Doc_AllocationHdr extends Doc } catch (Exception e) { - log.log(Level.SEVERE, sql.toString(), e); + log.log(Level.SEVERE, sql, e); } finally { DB.close(rs, pstmt); diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_Invoice.java b/org.adempiere.base/src/org/compiere/acct/Doc_Invoice.java index da8c7b8ed6..270bd8eeac 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_Invoice.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_Invoice.java @@ -99,14 +99,14 @@ public class Doc_Invoice extends Doc private DocTax[] loadTaxes() { ArrayList list = new ArrayList(); - StringBuilder sql = new StringBuilder("SELECT it.C_Tax_ID, t.Name, t.Rate, it.TaxBaseAmt, it.TaxAmt, t.IsSalesTax ") - .append("FROM C_Tax t, C_InvoiceTax it ") - .append("WHERE t.C_Tax_ID=it.C_Tax_ID AND it.C_Invoice_ID=?"); + String sql = "SELECT it.C_Tax_ID, t.Name, t.Rate, it.TaxBaseAmt, it.TaxAmt, t.IsSalesTax " + + "FROM C_Tax t, C_InvoiceTax it " + + "WHERE t.C_Tax_ID=it.C_Tax_ID AND it.C_Invoice_ID=?"; PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql.toString(), getTrxName()); + pstmt = DB.prepareStatement(sql, getTrxName()); pstmt.setInt(1, get_ID()); rs = pstmt.executeQuery(); // @@ -127,7 +127,7 @@ public class Doc_Invoice extends Doc } catch (SQLException e) { - log.log(Level.SEVERE, sql.toString(), e); + log.log(Level.SEVERE, sql, e); return null; } finally { @@ -885,7 +885,7 @@ public class Doc_Invoice extends Doc if (ci.getC_AcctSchema1_ID() != as.getC_AcctSchema_ID()) return; - StringBuffer sql = new StringBuffer ( + StringBuilder sql = new StringBuilder ( "UPDATE M_Product_PO po ") .append("SET PriceLastInv = ") // select diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_Order.java b/org.adempiere.base/src/org/compiere/acct/Doc_Order.java index 73abf58371..919324a1bf 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_Order.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_Order.java @@ -164,17 +164,17 @@ public class Doc_Order extends Doc } // ArrayList list = new ArrayList(); - StringBuilder sql = new StringBuilder("SELECT * FROM M_RequisitionLine rl ") - .append("WHERE EXISTS (SELECT * FROM C_Order o ") - .append(" INNER JOIN C_OrderLine ol ON (o.C_Order_ID=ol.C_Order_ID) ") - .append("WHERE ol.C_OrderLine_ID=rl.C_OrderLine_ID") - .append(" AND o.C_Order_ID=?) ") - .append("ORDER BY rl.C_OrderLine_ID"); + String sql = "SELECT * FROM M_RequisitionLine rl " + + "WHERE EXISTS (SELECT * FROM C_Order o " + + " INNER JOIN C_OrderLine ol ON (o.C_Order_ID=ol.C_Order_ID) " + + "WHERE ol.C_OrderLine_ID=rl.C_OrderLine_ID" + + " AND o.C_Order_ID=?) " + + "ORDER BY rl.C_OrderLine_ID"; PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement (sql.toString(), null); + pstmt = DB.prepareStatement (sql, null); pstmt.setInt (1, order.getC_Order_ID()); rs = pstmt.executeQuery (); while (rs.next ()) @@ -201,7 +201,7 @@ public class Doc_Order extends Doc } catch (Exception e) { - log.log (Level.SEVERE, sql.toString(), e); + log.log (Level.SEVERE, sql, e); } finally { diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_Production.java b/org.adempiere.base/src/org/compiere/acct/Doc_Production.java index 64dee4a8b9..c99f1b985a 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_Production.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_Production.java @@ -82,14 +82,14 @@ public class Doc_Production extends Doc ArrayList list = new ArrayList(); // Production // -- ProductionLine - the real level - StringBuilder sqlPL = new StringBuilder("SELECT * FROM M_ProductionLine pl ") - .append("WHERE pl.M_Production_ID=? ") - .append("ORDER BY pl.Line"); + String sqlPL = "SELECT * FROM M_ProductionLine pl " + + "WHERE pl.M_Production_ID=? " + + "ORDER BY pl.Line"; try { - PreparedStatement pstmtPL = DB.prepareStatement(sqlPL.toString(), getTrxName()); + PreparedStatement pstmtPL = DB.prepareStatement(sqlPL, getTrxName()); pstmtPL.setInt(1,get_ID()); ResultSet rsPL = pstmtPL.executeQuery(); while (rsPL.next()) @@ -113,7 +113,7 @@ public class Doc_Production extends Doc } catch (Exception ee) { - log.log(Level.SEVERE, sqlPL.toString(), ee); + log.log(Level.SEVERE, sqlPL, ee); } DocLine[] dl = new DocLine[list.size()]; diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_ProjectIssue.java b/org.adempiere.base/src/org/compiere/acct/Doc_ProjectIssue.java index 1cfd18ed25..21abf38069 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_ProjectIssue.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_ProjectIssue.java @@ -168,16 +168,16 @@ public class Doc_ProjectIssue extends Doc { BigDecimal retValue = null; // Uses PO Date - StringBuilder sql = new StringBuilder("SELECT currencyConvert(ol.PriceActual, o.C_Currency_ID, ?, o.DateOrdered, o.C_ConversionType_ID, ?, ?) ") - .append("FROM C_OrderLine ol") - .append(" INNER JOIN M_InOutLine iol ON (iol.C_OrderLine_ID=ol.C_OrderLine_ID)") - .append(" INNER JOIN C_Order o ON (o.C_Order_ID=ol.C_Order_ID) ") - .append("WHERE iol.M_InOutLine_ID=?"); + String sql = "SELECT currencyConvert(ol.PriceActual, o.C_Currency_ID, ?, o.DateOrdered, o.C_ConversionType_ID, ?, ?) " + + "FROM C_OrderLine ol" + + " INNER JOIN M_InOutLine iol ON (iol.C_OrderLine_ID=ol.C_OrderLine_ID)" + + " INNER JOIN C_Order o ON (o.C_Order_ID=ol.C_Order_ID) " + + "WHERE iol.M_InOutLine_ID=?"; PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql.toString(), getTrxName()); + pstmt = DB.prepareStatement(sql, getTrxName()); pstmt.setInt(1, as.getC_Currency_ID()); pstmt.setInt(2, getAD_Client_ID()); pstmt.setInt(3, getAD_Org_ID()); @@ -193,7 +193,7 @@ public class Doc_ProjectIssue extends Doc } catch (Exception e) { - log.log(Level.SEVERE, sql.toString(), e); + log.log(Level.SEVERE, sql, e); } finally { @@ -215,13 +215,13 @@ public class Doc_ProjectIssue extends Doc BigDecimal retValue = Env.ZERO; BigDecimal qty = Env.ZERO; - StringBuilder sql = new StringBuilder("SELECT ConvertedAmt, Qty FROM S_TimeExpenseLine ") - .append(" WHERE S_TimeExpenseLine.S_TimeExpenseLine_ID = ?"); + String sql = "SELECT ConvertedAmt, Qty FROM S_TimeExpenseLine " + + " WHERE S_TimeExpenseLine.S_TimeExpenseLine_ID = ?"; PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement (sql.toString (), getTrxName()); + pstmt = DB.prepareStatement (sql, getTrxName()); pstmt.setInt(1, m_issue.getS_TimeExpenseLine_ID()); rs = pstmt.executeQuery(); if (rs.next()) @@ -236,7 +236,7 @@ public class Doc_ProjectIssue extends Doc } catch (Exception e) { - log.log(Level.SEVERE, sql.toString(), e); + log.log(Level.SEVERE, sql, e); } finally { diff --git a/org.adempiere.base/src/org/compiere/acct/FactLine.java b/org.adempiere.base/src/org/compiere/acct/FactLine.java index ae1518a1be..bdaac5aebc 100644 --- a/org.adempiere.base/src/org/compiere/acct/FactLine.java +++ b/org.adempiere.base/src/org/compiere/acct/FactLine.java @@ -497,13 +497,13 @@ public final class FactLine extends X_Fact_Acct if (M_Locator_ID == 0) return; int C_Location_ID = 0; - StringBuilder sql = new StringBuilder("SELECT w.C_Location_ID FROM M_Warehouse w, M_Locator l ") - .append("WHERE w.M_Warehouse_ID=l.M_Warehouse_ID AND l.M_Locator_ID=?"); + String sql = "SELECT w.C_Location_ID FROM M_Warehouse w, M_Locator l " + + "WHERE w.M_Warehouse_ID=l.M_Warehouse_ID AND l.M_Locator_ID=?"; PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql.toString(), get_TrxName()); + pstmt = DB.prepareStatement(sql, get_TrxName()); pstmt.setInt(1, M_Locator_ID); rs = pstmt.executeQuery(); if (rs.next()) @@ -511,7 +511,7 @@ public final class FactLine extends X_Fact_Acct } catch (SQLException e) { - log.log(Level.SEVERE, sql.toString(), e); + log.log(Level.SEVERE, sql, e); return; } finally { @@ -994,16 +994,16 @@ public final class FactLine extends X_Fact_Acct // get Unearned Revenue Acct from BPartner Group int UnearnedRevenue_Acct = 0; int new_Account_ID = 0; - StringBuilder sql = new StringBuilder("SELECT ga.UnearnedRevenue_Acct, vc.Account_ID ") - .append("FROM C_BP_Group_Acct ga, C_BPartner p, C_ValidCombination vc ") - .append("WHERE ga.C_BP_Group_ID=p.C_BP_Group_ID") - .append(" AND ga.UnearnedRevenue_Acct=vc.C_ValidCombination_ID") - .append(" AND ga.C_AcctSchema_ID=? AND p.C_BPartner_ID=?"); + String sql = "SELECT ga.UnearnedRevenue_Acct, vc.Account_ID " + + "FROM C_BP_Group_Acct ga, C_BPartner p, C_ValidCombination vc " + + "WHERE ga.C_BP_Group_ID=p.C_BP_Group_ID" + + " AND ga.UnearnedRevenue_Acct=vc.C_ValidCombination_ID" + + " AND ga.C_AcctSchema_ID=? AND p.C_BPartner_ID=?"; PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql.toString(), get_TrxName()); + pstmt = DB.prepareStatement(sql, get_TrxName()); pstmt.setInt(1, getC_AcctSchema_ID()); pstmt.setInt(2, C_BPartner_ID); rs = pstmt.executeQuery(); @@ -1015,7 +1015,7 @@ public final class FactLine extends X_Fact_Acct } catch (SQLException e) { - log.log(Level.SEVERE, sql.toString(), e); + log.log(Level.SEVERE, sql, e); } finally { DB.close(rs, pstmt); @@ -1061,7 +1061,7 @@ public final class FactLine extends X_Fact_Acct { boolean success = false; - StringBuffer sql = new StringBuffer("SELECT * ") + StringBuilder sql = new StringBuilder("SELECT * ") .append("FROM Fact_Acct ") .append("WHERE C_AcctSchema_ID=? AND AD_Table_ID=? AND Record_ID=?") .append(" AND Line_ID=? AND Account_ID=?"); diff --git a/org.adempiere.base/src/org/compiere/acct/Matcher.java b/org.adempiere.base/src/org/compiere/acct/Matcher.java index 44da0d7e6d..3f520e1b00 100644 --- a/org.adempiere.base/src/org/compiere/acct/Matcher.java +++ b/org.adempiere.base/src/org/compiere/acct/Matcher.java @@ -80,23 +80,23 @@ public class Matcher { int counter = 0; // (a) Direct Matches - StringBuilder sql = new StringBuilder("SELECT m1.AD_Client_ID,m2.AD_Org_ID, ") // 1..2 - .append("m1.C_InvoiceLine_ID,m2.M_InOutLine_ID,m1.M_Product_ID, ") // 3..5 - .append("m1.DateTrx,m2.DateTrx, m1.Qty, m2.Qty ") // 6..9 - .append("FROM M_MatchPO m1, M_MatchPO m2 ") - .append("WHERE m1.C_OrderLine_ID=m2.C_OrderLine_ID") - .append(" AND m1.M_InOutLine_ID IS NULL") - .append(" AND m2.C_InvoiceLine_ID IS NULL") - .append(" AND m1.M_Product_ID=m2.M_Product_ID") - .append(" AND m1.AD_Client_ID=?") // #1 + String sql = "SELECT m1.AD_Client_ID,m2.AD_Org_ID, " // 1..2 + + "m1.C_InvoiceLine_ID,m2.M_InOutLine_ID,m1.M_Product_ID, " // 3..5 + + "m1.DateTrx,m2.DateTrx, m1.Qty, m2.Qty " // 6..9 + + "FROM M_MatchPO m1, M_MatchPO m2 " + + "WHERE m1.C_OrderLine_ID=m2.C_OrderLine_ID" + + " AND m1.M_InOutLine_ID IS NULL" + + " AND m2.C_InvoiceLine_ID IS NULL" + + " AND m1.M_Product_ID=m2.M_Product_ID" + + " AND m1.AD_Client_ID=?" // #1 // Not existing Inv Matches - .append(" AND NOT EXISTS (SELECT * FROM M_MatchInv mi ") - .append("WHERE mi.C_InvoiceLine_ID=m1.C_InvoiceLine_ID AND mi.M_InOutLine_ID=m2.M_InOutLine_ID)"); + + " AND NOT EXISTS (SELECT * FROM M_MatchInv mi " + + "WHERE mi.C_InvoiceLine_ID=m1.C_InvoiceLine_ID AND mi.M_InOutLine_ID=m2.M_InOutLine_ID)"; PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql.toString(), null); + pstmt = DB.prepareStatement(sql, null); pstmt.setInt(1, m_AD_Client_ID); rs = pstmt.executeQuery(); while (rs.next()) diff --git a/org.adempiere.base/src/org/compiere/acct/ProductInfo.java b/org.adempiere.base/src/org/compiere/acct/ProductInfo.java index 0c07b58fb5..10711c6b66 100644 --- a/org.adempiere.base/src/org/compiere/acct/ProductInfo.java +++ b/org.adempiere.base/src/org/compiere/acct/ProductInfo.java @@ -83,18 +83,18 @@ public class ProductInfo if (m_M_Product_ID == 0) return; - StringBuilder sql = new StringBuilder("SELECT p.ProductType, pc.Value, ") // 1..2 - .append("p.C_RevenueRecognition_ID,p.C_UOM_ID, ") // 3..4 - .append("p.AD_Client_ID,p.AD_Org_ID, ") // 5..6 - .append("p.IsBOM, p.IsStocked ") // 7..8 - .append("FROM M_Product_Category pc") - .append(" INNER JOIN M_Product p ON (pc.M_Product_Category_ID=p.M_Product_Category_ID) ") - .append("WHERE p.M_Product_ID=?"); // #1 + String sql = "SELECT p.ProductType, pc.Value, " // 1..2 + + "p.C_RevenueRecognition_ID,p.C_UOM_ID, " // 3..4 + + "p.AD_Client_ID,p.AD_Org_ID, " // 5..6 + + "p.IsBOM, p.IsStocked " // 7..8 + + "FROM M_Product_Category pc" + + " INNER JOIN M_Product p ON (pc.M_Product_Category_ID=p.M_Product_Category_ID) " + + "WHERE p.M_Product_ID=?"; // #1 PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql.toString(), null); + pstmt = DB.prepareStatement(sql, null); pstmt.setInt(1, m_M_Product_ID); rs = pstmt.executeQuery(); if (rs.next()) @@ -113,7 +113,7 @@ public class ProductInfo } catch (SQLException e) { - log.log(Level.SEVERE, sql.toString(), e); + log.log(Level.SEVERE, sql, e); } finally { DB.close(rs, pstmt); @@ -296,9 +296,9 @@ public class ProductInfo */ private BigDecimal getPOCost (MAcctSchema as) { - StringBuilder sql = new StringBuilder("SELECT C_Currency_ID, PriceList,PricePO,PriceLastPO ") - .append("FROM M_Product_PO WHERE M_Product_ID=? ") - .append("ORDER BY IsCurrentVendor DESC"); + String sql = "SELECT C_Currency_ID, PriceList,PricePO,PriceLastPO " + + "FROM M_Product_PO WHERE M_Product_ID=? " + + "ORDER BY IsCurrentVendor DESC"; int C_Currency_ID = 0; BigDecimal PriceList = null; @@ -308,7 +308,7 @@ public class ProductInfo ResultSet rs = null; try { - pstmt = DB.prepareStatement(sql.toString(), null); + pstmt = DB.prepareStatement(sql, null); pstmt.setInt(1, m_M_Product_ID); rs = pstmt.executeQuery(); if (rs.next()) @@ -321,7 +321,7 @@ public class ProductInfo } catch (SQLException e) { - log.log(Level.SEVERE, sql.toString(), e); + log.log(Level.SEVERE, sql, e); } finally { DB.close(rs, pstmt); diff --git a/org.adempiere.base/src/org/compiere/impexp/ImpFormat.java b/org.adempiere.base/src/org/compiere/impexp/ImpFormat.java index 0cc769464d..65e2d79620 100644 --- a/org.adempiere.base/src/org/compiere/impexp/ImpFormat.java +++ b/org.adempiere.base/src/org/compiere/impexp/ImpFormat.java @@ -115,12 +115,12 @@ public final class ImpFormat m_AD_Table_ID = AD_Table_ID; m_tableName = null; m_tablePK = null; - StringBuilder sql = new StringBuilder("SELECT t.TableName,c.ColumnName ") - .append("FROM AD_Table t INNER JOIN AD_Column c ON (t.AD_Table_ID=c.AD_Table_ID AND c.IsKey='Y') ") - .append("WHERE t.AD_Table_ID=?"); + String sql = "SELECT t.TableName,c.ColumnName " + + "FROM AD_Table t INNER JOIN AD_Column c ON (t.AD_Table_ID=c.AD_Table_ID AND c.IsKey='Y') " + + "WHERE t.AD_Table_ID=?"; try { - PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null); + PreparedStatement pstmt = DB.prepareStatement(sql, null); pstmt.setInt(1, AD_Table_ID); ResultSet rs = pstmt.executeQuery(); if (rs.next()) @@ -301,14 +301,14 @@ public final class ImpFormat */ private static void loadRows (ImpFormat format, int ID) { - StringBuilder sql = new StringBuilder("SELECT f.SeqNo,c.ColumnName,f.StartNo,f.EndNo,f.DataType,c.FieldLength,") // 1..6 - .append("f.DataFormat,f.DecimalPoint,f.DivideBy100,f.ConstantValue,f.Callout ") // 7..11 - .append("FROM AD_ImpFormat_Row f,AD_Column c ") - .append("WHERE f.AD_ImpFormat_ID=? AND f.AD_Column_ID=c.AD_Column_ID AND f.IsActive='Y'") - .append("ORDER BY f.SeqNo"); + String sql = "SELECT f.SeqNo,c.ColumnName,f.StartNo,f.EndNo,f.DataType,c.FieldLength," // 1..6 + + "f.DataFormat,f.DecimalPoint,f.DivideBy100,f.ConstantValue,f.Callout " // 7..11 + + "FROM AD_ImpFormat_Row f,AD_Column c " + + "WHERE f.AD_ImpFormat_ID=? AND f.AD_Column_ID=c.AD_Column_ID AND f.IsActive='Y'" + + "ORDER BY f.SeqNo"; try { - PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null); + PreparedStatement pstmt = DB.prepareStatement(sql, null); pstmt.setInt (1, ID); ResultSet rs = pstmt.executeQuery(); while (rs.next()) @@ -327,7 +327,7 @@ public final class ImpFormat } catch (SQLException e) { - log.log(Level.SEVERE, sql.toString(), e); + log.log(Level.SEVERE, sql, e); } } // loadLines diff --git a/org.adempiere.base/src/org/compiere/impexp/MImpFormat.java b/org.adempiere.base/src/org/compiere/impexp/MImpFormat.java index 8f97dc05ea..d47008e1df 100644 --- a/org.adempiere.base/src/org/compiere/impexp/MImpFormat.java +++ b/org.adempiere.base/src/org/compiere/impexp/MImpFormat.java @@ -69,13 +69,13 @@ public class MImpFormat extends X_AD_ImpFormat public MImpFormatRow[] getRows() { ArrayList list = new ArrayList(); - StringBuilder sql = new StringBuilder("SELECT * FROM AD_ImpFormat_Row ") - .append("WHERE AD_ImpFormat_ID=? ") - .append("ORDER BY SeqNo"); + String sql = "SELECT * FROM AD_ImpFormat_Row " + + "WHERE AD_ImpFormat_ID=? " + + "ORDER BY SeqNo"; PreparedStatement pstmt = null; try { - pstmt = DB.prepareStatement (sql.toString(), get_TrxName()); + pstmt = DB.prepareStatement (sql, get_TrxName()); pstmt.setInt (1, getAD_ImpFormat_ID()); ResultSet rs = pstmt.executeQuery (); while (rs.next ()) diff --git a/org.adempiere.base/src/org/compiere/model/GridFieldVO.java b/org.adempiere.base/src/org/compiere/model/GridFieldVO.java index 40a738f901..eee5e23723 100644 --- a/org.adempiere.base/src/org/compiere/model/GridFieldVO.java +++ b/org.adempiere.base/src/org/compiere/model/GridFieldVO.java @@ -57,13 +57,13 @@ public class GridFieldVO implements Serializable public static String getSQL (Properties ctx) { // IsActive is part of View - StringBuffer sql; + StringBuilder sql; if (!Env.isBaseLanguage(ctx, "AD_Tab")) - sql = new StringBuffer("SELECT * FROM AD_Field_vt WHERE AD_Tab_ID=?") + sql = new StringBuilder("SELECT * FROM AD_Field_vt WHERE AD_Tab_ID=?") .append(" AND AD_Language='" + Env.getAD_Language(ctx) + "'") .append(" ORDER BY IsDisplayed DESC, SeqNo"); else - sql = new StringBuffer("SELECT * FROM AD_Field_v WHERE AD_Tab_ID=?") + sql = new StringBuilder("SELECT * FROM AD_Field_v WHERE AD_Tab_ID=?") .append(" ORDER BY IsDisplayed DESC, SeqNo"); return sql.toString(); } // getSQL diff --git a/org.adempiere.base/src/org/compiere/model/GridWindow.java b/org.adempiere.base/src/org/compiere/model/GridWindow.java index 5f523de365..bc961938d5 100644 --- a/org.adempiere.base/src/org/compiere/model/GridWindow.java +++ b/org.adempiere.base/src/org/compiere/model/GridWindow.java @@ -559,18 +559,18 @@ public class GridWindow implements Serializable { if (recalc || m_modelUpdated == null) { - StringBuilder sql = new StringBuilder("SELECT MAX(w.Updated), MAX(t.Updated), MAX(tt.Updated), MAX(f.Updated), MAX(c.Updated) ") - .append("FROM AD_Window w") - .append(" INNER JOIN AD_Tab t ON (w.AD_Window_ID=t.AD_Window_ID)") - .append(" INNER JOIN AD_Table tt ON (t.AD_Table_ID=tt.AD_Table_ID)") - .append(" INNER JOIN AD_Field f ON (t.AD_Tab_ID=f.AD_Tab_ID)") - .append(" INNER JOIN AD_Column c ON (f.AD_Column_ID=c.AD_Column_ID) ") - .append("WHERE w.AD_Window_ID=?"); + String sql = "SELECT MAX(w.Updated), MAX(t.Updated), MAX(tt.Updated), MAX(f.Updated), MAX(c.Updated) " + + "FROM AD_Window w" + + " INNER JOIN AD_Tab t ON (w.AD_Window_ID=t.AD_Window_ID)" + + " INNER JOIN AD_Table tt ON (t.AD_Table_ID=tt.AD_Table_ID)" + + " INNER JOIN AD_Field f ON (t.AD_Tab_ID=f.AD_Tab_ID)" + + " INNER JOIN AD_Column c ON (f.AD_Column_ID=c.AD_Column_ID) " + + "WHERE w.AD_Window_ID=?"; PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement (sql.toString(), null); + pstmt = DB.prepareStatement (sql, null); pstmt.setInt (1, getAD_Window_ID()); rs = pstmt.executeQuery (); if (rs.next ()) @@ -592,7 +592,7 @@ public class GridWindow implements Serializable } catch (Exception e) { - log.log (Level.SEVERE, sql.toString(), e); + log.log (Level.SEVERE, sql, e); } finally { diff --git a/org.adempiere.extend/src/compiere/model/CalloutUser.java b/org.adempiere.extend/src/compiere/model/CalloutUser.java index 4b4951ae59..5c541082bf 100644 --- a/org.adempiere.extend/src/compiere/model/CalloutUser.java +++ b/org.adempiere.extend/src/compiere/model/CalloutUser.java @@ -77,21 +77,21 @@ public class CalloutUser extends CalloutEngine if (C_BPartner_ID == null || C_BPartner_ID.intValue() == 0) return ""; - StringBuilder sql = new StringBuilder("SELECT p.AD_Language,p.C_PaymentTerm_ID,") - .append (" COALESCE(p.M_PriceList_ID,g.M_PriceList_ID) AS M_PriceList_ID, p.PaymentRule,p.POReference,") - .append (" p.SO_Description,p.IsDiscountPrinted,") - .append (" p.SO_CreditLimit, p.SO_CreditLimit-p.SO_CreditUsed AS CreditAvailable,") - .append (" l.C_BPartner_Location_ID,c.AD_User_ID,") - .append (" COALESCE(p.PO_PriceList_ID,g.PO_PriceList_ID) AS PO_PriceList_ID, p.PaymentRulePO,p.PO_PaymentTerm_ID ") - .append ("FROM C_BPartner p") - .append (" INNER JOIN C_BP_Group g ON (p.C_BP_Group_ID=g.C_BP_Group_ID)") - .append (" LEFT OUTER JOIN C_BPartner_Location l ON (p.C_BPartner_ID=l.C_BPartner_ID AND l.IsBillTo='Y' AND l.IsActive='Y')") - .append (" LEFT OUTER JOIN AD_User c ON (p.C_BPartner_ID=c.C_BPartner_ID) ") - .append ("WHERE p.C_BPartner_ID=? AND p.IsActive='Y'"); // #1 + String sql = "SELECT p.AD_Language,p.C_PaymentTerm_ID," + + " COALESCE(p.M_PriceList_ID,g.M_PriceList_ID) AS M_PriceList_ID, p.PaymentRule,p.POReference," + + " p.SO_Description,p.IsDiscountPrinted," + + " p.SO_CreditLimit, p.SO_CreditLimit-p.SO_CreditUsed AS CreditAvailable," + + " l.C_BPartner_Location_ID,c.AD_User_ID," + + " COALESCE(p.PO_PriceList_ID,g.PO_PriceList_ID) AS PO_PriceList_ID, p.PaymentRulePO,p.PO_PaymentTerm_ID " + + "FROM C_BPartner p" + + " INNER JOIN C_BP_Group g ON (p.C_BP_Group_ID=g.C_BP_Group_ID)" + + " LEFT OUTER JOIN C_BPartner_Location l ON (p.C_BPartner_ID=l.C_BPartner_ID AND l.IsBillTo='Y' AND l.IsActive='Y')" + + " LEFT OUTER JOIN AD_User c ON (p.C_BPartner_ID=c.C_BPartner_ID) " + + "WHERE p.C_BPartner_ID=? AND p.IsActive='Y'"; // #1 try { - PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null); + PreparedStatement pstmt = DB.prepareStatement(sql, null); pstmt.setInt(1, C_BPartner_ID.intValue()); ResultSet rs = pstmt.executeQuery(); // @@ -130,7 +130,7 @@ public class CalloutUser extends CalloutEngine } catch (SQLException e) { - log.log(Level.SEVERE, sql.toString(), e); + log.log(Level.SEVERE, sql, e); return e.getLocalizedMessage(); } From d91955538a23101757f88456b9dfc69ef2575f73 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 19 Sep 2012 15:46:53 -0500 Subject: [PATCH 44/79] IDEMPIERE-254 2Pack Stabilization and Enhancement / Menus not being exported by default --- .../src/org/adempiere/pipo2/handler/MenuElementHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/MenuElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/MenuElementHandler.java index 25a64d74ad..c47ff19ce9 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/MenuElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/MenuElementHandler.java @@ -191,7 +191,7 @@ public class MenuElementHandler extends AbstractElementHandler { } private int getDefaultMenuTreeId() { - return DB.getSQLValue(null, "SELECT MIN(AD_Tree_ID) FROM AD_Tree WHERE IsDefault='Y' AND TreeType='MM' AND AD_Client_ID=0"); + return DB.getSQLValue(null, "SELECT AD_Tree_ID FROM AD_Tree WHERE TreeType='MM' AND AD_Client_ID=0 ORDER BY IsDefault DESC, AD_Tree_ID"); } public void endElement(PIPOContext ctx, Element element) throws SAXException { From af49e500be4d74c9555e9423fd48533c0c5c06ae Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 19 Sep 2012 19:12:23 -0500 Subject: [PATCH 45/79] IDEMPIERE-254 2Pack Stabilization and Enhancement / Problems found importing packages --- .../src/org/adempiere/pipo2/AbstractElementHandler.java | 2 +- org.adempiere.pipo/src/org/adempiere/pipo2/PackInHandler.java | 2 +- org.adempiere.pipo/src/org/adempiere/pipo2/PackOutProcess.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/org.adempiere.pipo/src/org/adempiere/pipo2/AbstractElementHandler.java b/org.adempiere.pipo/src/org/adempiere/pipo2/AbstractElementHandler.java index 92bee91180..bb86bfb215 100644 --- a/org.adempiere.pipo/src/org/adempiere/pipo2/AbstractElementHandler.java +++ b/org.adempiere.pipo/src/org/adempiere/pipo2/AbstractElementHandler.java @@ -569,7 +569,7 @@ public abstract class AbstractElementHandler implements ElementHandler { String id = element.properties.get(idColumn).contents.toString(); if (id != null && id.trim().length() > 0) { Query query = new Query(ctx.ctx, tableName, idColumn+"=?", ctx.trx.getTrxName()); - po = query.setParameters(id.trim()).firstOnly(); + po = query.setParameters(Integer.valueOf(id.trim())).firstOnly(); } } return po; diff --git a/org.adempiere.pipo/src/org/adempiere/pipo2/PackInHandler.java b/org.adempiere.pipo/src/org/adempiere/pipo2/PackInHandler.java index 94be371932..660bbdde66 100644 --- a/org.adempiere.pipo/src/org/adempiere/pipo2/PackInHandler.java +++ b/org.adempiere.pipo/src/org/adempiere/pipo2/PackInHandler.java @@ -191,7 +191,7 @@ public class PackInHandler extends DefaultHandler { packageInst.saveEx(); } - m_ctx.ctx.put("AD_Package_Imp_ID", AD_Package_Imp_ID); + m_ctx.ctx.put("AD_Package_Imp_ID", String.valueOf(AD_Package_Imp_ID)); m_ctx.ctx.put("UpdateMode", m_updateDictionary); m_ctx.ctx.put("PackageDirectory", packageDirectory); m_ctx.packIn = packIn; diff --git a/org.adempiere.pipo/src/org/adempiere/pipo2/PackOutProcess.java b/org.adempiere.pipo/src/org/adempiere/pipo2/PackOutProcess.java index a5e009d032..6a54799dd7 100644 --- a/org.adempiere.pipo/src/org/adempiere/pipo2/PackOutProcess.java +++ b/org.adempiere.pipo/src/org/adempiere/pipo2/PackOutProcess.java @@ -179,7 +179,7 @@ public class PackOutProcess extends SvrProcess else if (X_AD_Package_Exp_Detail.TYPE_Role.equals(type)) return I_AD_Role.Table_Name; else if (X_AD_Package_Exp_Detail.TYPE_SQLStatement.equals(type)) - return "SQL_Statement"; + return "SQLStatement"; else if (X_AD_Package_Exp_Detail.TYPE_Table.equals(type)) return I_AD_Table.Table_Name; else if (X_AD_Package_Exp_Detail.TYPE_Window.equals(type)) From f22faccda1ea5f50a9d84171e12f72c9f341e8cf Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 19 Sep 2012 19:20:36 -0500 Subject: [PATCH 46/79] IDEMPIERE-436 AdempiereActivator is not able to run 2Pack --- .../pipo/srv/PipoDictionaryService.java | 26 ++++++++++++++++++- .../plugin/utils/AdempiereActivator.java | 17 +++++++++--- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/org.adempiere.pipo/src/org/adempiere/pipo/srv/PipoDictionaryService.java b/org.adempiere.pipo/src/org/adempiere/pipo/srv/PipoDictionaryService.java index fb0397be14..3c80a19b54 100644 --- a/org.adempiere.pipo/src/org/adempiere/pipo/srv/PipoDictionaryService.java +++ b/org.adempiere.pipo/src/org/adempiere/pipo/srv/PipoDictionaryService.java @@ -1,12 +1,15 @@ package org.adempiere.pipo.srv; import java.io.File; +import java.sql.Timestamp; import java.util.logging.Level; import java.util.logging.Logger; import org.adempiere.base.IDictionaryService; import org.adempiere.pipo2.PackIn; +import org.adempiere.pipo2.Zipper; import org.compiere.Adempiere; +import org.compiere.model.X_AD_Package_Imp_Proc; import org.compiere.util.Env; import org.compiere.util.Trx; import org.osgi.framework.BundleContext; @@ -28,7 +31,28 @@ public class PipoDictionaryService implements IDictionaryService { packIn.setPackageVersion((String) context.getBundle().getHeaders().get("Bundle-Version")); packIn.setUpdateDictionary(false); packIn.setPackageDirectory(getPackageDir()); - packIn.importXML(packageFile.getAbsolutePath(), Env.getCtx(), trxName); + + X_AD_Package_Imp_Proc adPackageImp = new X_AD_Package_Imp_Proc(Env.getCtx(), + 0, trxName); + File zipFilepath = packageFile; + logger.info("zipFilepath->" + zipFilepath); + String parentDir = Zipper.getParentDir(zipFilepath); + File targetDir = new File(System.getProperty("java.io.tmpdir")); + Zipper.unpackFile(zipFilepath, targetDir); + + String dict_file = targetDir + File.separator + parentDir + File.separator + + "dict" + File.separator + "PackOut.xml"; + + logger.info("dict file->" + dict_file); + + // call XML Handler + String msg = packIn.importXML(dict_file, Env.getCtx(), trxName); + adPackageImp.setName(packIn.getPackageName()); + adPackageImp.setDateProcessed(new Timestamp(System.currentTimeMillis())); + adPackageImp.setP_Msg(msg); + adPackageImp.setAD_Package_Source_Type("File"); + adPackageImp.saveEx(); + Trx.get(trxName, false).commit(); logger.info("commit " + trxName); } catch (Exception e) { diff --git a/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/AdempiereActivator.java b/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/AdempiereActivator.java index 789913306a..7ae0a580a9 100644 --- a/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/AdempiereActivator.java +++ b/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/AdempiereActivator.java @@ -1,6 +1,8 @@ package org.adempiere.plugin.utils; import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; import java.net.URL; import java.util.logging.Level; import java.util.logging.Logger; @@ -60,12 +62,21 @@ public class AdempiereActivator implements BundleActivator { } protected void packIn(String trxName) { - URL packout = this.getClass().getResource( - "/META-INF/2Pack.zip"); + URL packout = this.getClass().getClassLoader().getResource("/META-INF/2Pack.zip"); if (packout != null) { IDictionaryService service = Service.locate(IDictionaryService.class); try { - service.merge(context, new File(packout.getFile())); + // copy the resource to a temporary file to process it with 2pack + InputStream stream = this.getClass().getResourceAsStream("/META-INF/2Pack.zip"); + File zipfile = File.createTempFile(getName(), ".zip"); + FileOutputStream zipstream = new FileOutputStream(zipfile); + byte[] buffer = new byte[1024]; + int read; + while((read = stream.read(buffer)) != -1){ + zipstream.write(buffer, 0, read); + } + // call 2pack + service.merge(context, zipfile); } catch (Exception e) { logger.log(Level.WARNING, "Error on Dictionary service", e); } From e963fea9dcf32aad77e5d3a1d2b414e14b8da6af Mon Sep 17 00:00:00 2001 From: Elaine Tan Date: Fri, 21 Sep 2012 17:38:01 +0800 Subject: [PATCH 47/79] Fixed NullPointerException when create HTML with null HTML extension --- org.adempiere.base/src/org/compiere/print/ReportEngine.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/print/ReportEngine.java b/org.adempiere.base/src/org/compiere/print/ReportEngine.java index c359c9fed9..e4814452f6 100644 --- a/org.adempiere.base/src/org/compiere/print/ReportEngine.java +++ b/org.adempiere.base/src/org/compiere/print/ReportEngine.java @@ -703,12 +703,12 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount) { XhtmlDocument doc = new XhtmlDocument(); doc.appendBody(table); - if (extension.getStyleURL() != null) + if (extension != null && extension.getStyleURL() != null) { link l = new link(extension.getStyleURL(), "stylesheet", "text/css"); doc.appendHead(l); } - if (extension.getScriptURL() != null) + if (extension != null && extension.getScriptURL() != null) { script jslink = new script(); jslink.setLanguage("javascript"); From 8cac5e089790ca62f03e6163070a4ab92c0bec9e Mon Sep 17 00:00:00 2001 From: Deepak Pansheriya Date: Sun, 23 Sep 2012 00:51:07 +0530 Subject: [PATCH 48/79] IDEMPIERE-370 : Addding link on form's generate window --- .../adempiere/webui/apps/form/WGenForm.java | 117 ++++++++++++++++-- 1 file changed, 110 insertions(+), 7 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WGenForm.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WGenForm.java index 979c9d12fe..ca0a562d40 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WGenForm.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WGenForm.java @@ -15,6 +15,7 @@ package org.adempiere.webui.apps.form; import java.io.File; import java.io.FileInputStream; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.List; import java.util.logging.Level; @@ -49,17 +50,24 @@ import org.compiere.model.MTable; import org.compiere.model.PrintInfo; import org.compiere.print.MPrintFormat; import org.compiere.print.ReportEngine; +import org.compiere.process.ProcessInfoLog; import org.compiere.process.ProcessInfoUtil; import org.compiere.util.CLogger; +import org.compiere.util.DisplayType; import org.compiere.util.Env; import org.compiere.util.Msg; +import org.zkoss.zhtml.Table; +import org.zkoss.zhtml.Td; +import org.zkoss.zhtml.Tr; import org.zkoss.zk.au.out.AuEcho; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zul.A; import org.zkoss.zul.Borderlayout; import org.zkoss.zul.Center; +import org.zkoss.zul.Label; import org.zkoss.zul.North; import org.zkoss.zul.South; import org.zkoss.zul.Div; @@ -91,6 +99,8 @@ public class WGenForm extends ADForm implements EventListener, WTableModelListen private Html info = new Html(); private WListbox miniTable = ListboxFactory.newDataTable(); private BusyDialog progressWindow; + private Div messageDiv; + private Table logMessageTable; private int[] m_ids; @@ -181,9 +191,9 @@ public class WGenForm extends ADForm implements EventListener, WTableModelListen genPanel.setStyle("border: none; position: absolute"); center = new Center(); genPanel.appendChild(center); - Div div = new Div(); - div.appendChild(info); - center.appendChild(div); + messageDiv = new Div(); + messageDiv.appendChild(info); + center.appendChild(messageDiv); south = new South(); genPanel.appendChild(south); south.appendChild(confirmPanelGen); @@ -234,7 +244,11 @@ public class WGenForm extends ADForm implements EventListener, WTableModelListen { log.info("Cmd=" + e.getTarget().getId()); // - if (e.getTarget().getId().equals(ConfirmPanel.A_CANCEL)) + if(e.getTarget() instanceof A && e.getName().equals(Events.ON_CLICK)){ + doOnClick((A)e.getTarget()); + return; + } + else if (e.getTarget().getId().equals(ConfirmPanel.A_CANCEL)) { dispose(); return; @@ -321,10 +335,15 @@ public class WGenForm extends ADForm implements EventListener, WTableModelListen .append("
    (") .append(Msg.getMsg(Env.getCtx(), genForm.getTitle())) // Shipments are generated depending on the Delivery Rule selection in the Order - .append(")
    ") - .append(genForm.getProcessInfo().getLogInfo(true)); + .append(")

    "); info.setContent(iText.toString()); - + + //If log Message Table presents, remove it + if(logMessageTable!=null){ + messageDiv.removeChild(logMessageTable); + } + appendRecordLogInfo(genForm.getProcessInfo().getLogs()); + // Get results int[] ids = genForm.getProcessInfo().getIDs(); if (ids == null || ids.length == 0) @@ -445,4 +464,88 @@ public class WGenForm extends ADForm implements EventListener, WTableModelListen { return statusBar; } + + /** + *append process log info to response panel + * @param m_logs + */ + private void appendRecordLogInfo(ProcessInfoLog[] m_logs) { + if (m_logs == null) + return ; + + SimpleDateFormat dateFormat = DisplayType.getDateFormat(DisplayType.Date); + + logMessageTable = new Table(); + logMessageTable.setId("logrecords"); + logMessageTable.setDynamicProperty("border", "1"); + logMessageTable.setDynamicProperty("cellpadding", "0"); + logMessageTable.setDynamicProperty("cellspacing", "0"); + logMessageTable.setDynamicProperty("width", "100%"); + + this.appendChild(logMessageTable); + + for (int i = 0; i < m_logs.length; i++) + { + + Tr tr = new Tr(); + logMessageTable.appendChild(tr); + + ProcessInfoLog log = m_logs[i]; + + if (log.getP_Date() != null){ + Label label = new Label(dateFormat.format(log.getP_Date())); + //label.setStyle("padding-right:100px"); + Td td = new Td(); + td = new Td(); + td.appendChild(label); + tr.appendChild(td); + + } + + if (log.getP_Number() != null){ + Label labelPno= new Label(""+log.getP_Number()); + Td td = new Td(); + td.appendChild(labelPno); + tr.appendChild(td); + } + + A recordLink = null; + if (log.getP_Msg() != null){ + recordLink = new A(); + recordLink.setLabel(log.getP_Msg()); + + if (log.getAD_Table_ID() > 0 && log.getRecord_ID()> 0) { + recordLink.setAttribute("Record_ID", String.valueOf(log.getRecord_ID())); + recordLink.setAttribute("AD_Table_ID", String.valueOf(log.getAD_Table_ID())); + recordLink.addEventListener(Events.ON_CLICK, this); + + } + Td td = new Td(); + td.appendChild(recordLink); + tr.appendChild(td); + } + } + messageDiv.appendChild(logMessageTable); + } + /** + * Handling Anchor link on end of process + * Open document window + * @param btn + */ + private void doOnClick(A btn) { + int Record_ID = 0; + int AD_Table_ID =0; + try + { + Record_ID = Integer.valueOf((String)btn.getAttribute("Record_ID")); + AD_Table_ID= Integer.valueOf((String)btn.getAttribute("AD_Table_ID")); + } + catch (Exception e) { + } + + if (Record_ID > 0 && AD_Table_ID > 0) { + + AEnv.zoom(AD_Table_ID, Record_ID); + } + } } From 9eb89963409b62ae81e6f313375e778ae899d21c Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 26 Sep 2012 10:27:51 -0500 Subject: [PATCH 49/79] IDEMPIERE-29 Improvement on full location / Thanks to Nicolas for pointing to this bug --- org.adempiere.ui.swing/src/org/compiere/grid/ed/VLookup.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLookup.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLookup.java index dc293eac3e..f068d44dcb 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLookup.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLookup.java @@ -1308,7 +1308,7 @@ public class VLookup extends JComponent MBPartnerLocation bpl = new MBPartnerLocation(Env.getCtx(), BPLocation_ID, null); MLocation location= new MLocation(Env.getCtx(), bpl.getC_Location_ID(), null); - VLocationDialog ld = new VLocationDialog(AEnv.getFrame(this), Msg.getMsg(Env.getCtx(), "C_Location_ID"), location); + VLocationDialog ld = new VLocationDialog(AEnv.getFrame(this), Msg.getMsg(Env.getCtx(), "Location"), location); ld.setVisible(true); } } // actionBPartner From 27bc656e22de56cca6dff5fcb4e20651f77b41c1 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 26 Sep 2012 18:31:39 -0500 Subject: [PATCH 50/79] =?UTF-8?q?IDEMPIERE-308=20Performance:=20Replace=20?= =?UTF-8?q?with=20StringBuilder=20/=20Thanks=20to=20Richard=20Morales=20an?= =?UTF-8?q?d=20David=20Pe=C3=B1uela?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../compiere/process/ExpenseAPInvoice.java | 41 +- .../org/compiere/process/ExpenseSOrder.java | 32 +- .../org/compiere/process/FactAcctSummary.java | 6 +- .../org/compiere/process/ImportAccount.java | 321 +++++------ .../org/compiere/process/ImportBPartner.java | 277 ++++----- .../compiere/process/ImportBankStatement.java | 322 +++++------ .../process/ImportConversionRate.java | 161 +++--- .../org/compiere/process/ImportDelete.java | 23 +- .../org/compiere/process/ImportGLJournal.java | 529 +++++++++--------- .../compiere/process/ImportInOutConfirm.java | 75 +-- .../org/compiere/process/ImportInventory.java | 193 +++---- .../org/compiere/process/ImportInvoice.java | 454 +++++++-------- .../src/org/compiere/process/ImportOrder.java | 479 ++++++++-------- .../org/compiere/process/ImportPayment.java | 358 ++++++------ .../org/compiere/process/ImportProduct.java | 357 ++++++------ .../compiere/process/ImportReportLine.java | 330 +++++------ .../org/compiere/process/InOutGenerate.java | 75 +-- .../process/InventoryCountCreate.java | 34 +- .../process/InventoryCountUpdate.java | 60 +- 19 files changed, 2088 insertions(+), 2039 deletions(-) diff --git a/org.adempiere.base.process/src/org/compiere/process/ExpenseAPInvoice.java b/org.adempiere.base.process/src/org/compiere/process/ExpenseAPInvoice.java index 5a1d206a39..491dbabf9b 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ExpenseAPInvoice.java +++ b/org.adempiere.base.process/src/org/compiere/process/ExpenseAPInvoice.java @@ -76,21 +76,21 @@ public class ExpenseAPInvoice extends SvrProcess */ protected String doIt() throws java.lang.Exception { - StringBuffer sql = new StringBuffer ("SELECT * " - + "FROM S_TimeExpense e " - + "WHERE e.Processed='Y'" - + " AND e.AD_Client_ID=?"); // #1 + StringBuilder sql = new StringBuilder ("SELECT * ") + .append("FROM S_TimeExpense e ") + .append("WHERE e.Processed='Y'") + .append(" AND e.AD_Client_ID=?"); // #1 if (m_C_BPartner_ID != 0) sql.append(" AND e.C_BPartner_ID=?"); // #2 if (m_DateFrom != null) sql.append(" AND e.DateReport >= ?"); // #3 if (m_DateTo != null) sql.append(" AND e.DateReport <= ?"); // #4 - sql.append(" AND EXISTS (SELECT * FROM S_TimeExpenseLine el " - + "WHERE e.S_TimeExpense_ID=el.S_TimeExpense_ID" - + " AND el.C_InvoiceLine_ID IS NULL" - + " AND el.ConvertedAmt<>0) " - + "ORDER BY e.C_BPartner_ID, e.S_TimeExpense_ID"); + sql.append(" AND EXISTS (SELECT * FROM S_TimeExpenseLine el ") + .append("WHERE e.S_TimeExpense_ID=el.S_TimeExpense_ID") + .append(" AND el.C_InvoiceLine_ID IS NULL") + .append(" AND el.ConvertedAmt<>0) ") + .append("ORDER BY e.C_BPartner_ID, e.S_TimeExpense_ID"); // int old_BPartner_ID = -1; MInvoice invoice = null; @@ -128,18 +128,19 @@ public class ExpenseAPInvoice extends SvrProcess invoice.setBPartner(bp); if (invoice.getC_BPartner_Location_ID() == 0) { - log.log(Level.SEVERE, "No BP Location: " + bp); - addLog(0, te.getDateReport(), - null, "No Location: " + te.getDocumentNo() + " " + bp.getName()); + StringBuilder msglog = new StringBuilder("No BP Location: ").append(bp); + log.log(Level.SEVERE, msglog.toString()); + msglog = new StringBuilder("No Location: ").append(te.getDocumentNo()).append(" ").append(bp.getName()); + addLog(0, te.getDateReport(), null, msglog.toString() ); invoice = null; break; } invoice.setM_PriceList_ID(te.getM_PriceList_ID()); invoice.setSalesRep_ID(te.getDoc_User_ID()); - String descr = Msg.translate(getCtx(), "S_TimeExpense_ID") - + ": " + te.getDocumentNo() + " " - + DisplayType.getDateFormat(DisplayType.Date).format(te.getDateReport()); - invoice.setDescription(descr); + StringBuilder descr = new StringBuilder(Msg.translate(getCtx(), "S_TimeExpense_ID")) + .append(": ").append(te.getDocumentNo()).append(" " ) + .append(DisplayType.getDateFormat(DisplayType.Date).format(te.getDateReport())); + invoice.setDescription(descr.toString()); if (!invoice.save()) new IllegalStateException("Cannot save Invoice"); old_BPartner_ID = bp.getC_BPartner_ID(); @@ -200,7 +201,8 @@ public class ExpenseAPInvoice extends SvrProcess rs = null; pstmt = null; } completeInvoice (invoice); - return "@Created@=" + m_noInvoices; + StringBuilder msgreturn = new StringBuilder("@Created@=").append(m_noInvoices); + return msgreturn.toString(); } // doIt /** @@ -213,8 +215,9 @@ public class ExpenseAPInvoice extends SvrProcess return; invoice.setDocAction(DocAction.ACTION_Prepare); if (!invoice.processIt(DocAction.ACTION_Prepare)) { - log.warning("Invoice Process Failed: " + invoice + " - " + invoice.getProcessMsg()); - throw new IllegalStateException("Invoice Process Failed: " + invoice + " - " + invoice.getProcessMsg()); + StringBuilder msglog = new StringBuilder("Invoice Process Failed: ").append(invoice).append(" - ").append(invoice.getProcessMsg()); + log.warning(msglog.toString()); + throw new IllegalStateException(msglog.toString()); } if (!invoice.save()) diff --git a/org.adempiere.base.process/src/org/compiere/process/ExpenseSOrder.java b/org.adempiere.base.process/src/org/compiere/process/ExpenseSOrder.java index a60b9852d6..b494651fb1 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ExpenseSOrder.java +++ b/org.adempiere.base.process/src/org/compiere/process/ExpenseSOrder.java @@ -84,18 +84,18 @@ public class ExpenseSOrder extends SvrProcess */ protected String doIt() throws java.lang.Exception { - StringBuffer sql = new StringBuffer("SELECT * FROM S_TimeExpenseLine el " - + "WHERE el.AD_Client_ID=?" // #1 - + " AND el.C_BPartner_ID>0 AND el.IsInvoiced='Y'" // Business Partner && to be invoiced - + " AND el.C_OrderLine_ID IS NULL" // not invoiced yet - + " AND EXISTS (SELECT * FROM S_TimeExpense e " // processed only - + "WHERE el.S_TimeExpense_ID=e.S_TimeExpense_ID AND e.Processed='Y')"); + StringBuilder sql = new StringBuilder("SELECT * FROM S_TimeExpenseLine el ") + .append("WHERE el.AD_Client_ID=?") // #1 + .append(" AND el.C_BPartner_ID>0 AND el.IsInvoiced='Y'") // Business Partner && to be invoiced + .append(" AND el.C_OrderLine_ID IS NULL") // not invoiced yet + .append(" AND EXISTS (SELECT * FROM S_TimeExpense e ") // processed only + .append("WHERE el.S_TimeExpense_ID=e.S_TimeExpense_ID AND e.Processed='Y')"); if (p_C_BPartner_ID != 0) sql.append(" AND el.C_BPartner_ID=?"); // #2 if (p_DateFrom != null || m_DateTo != null) { - sql.append(" AND EXISTS (SELECT * FROM S_TimeExpense e " - + "WHERE el.S_TimeExpense_ID=e.S_TimeExpense_ID"); + sql.append(" AND EXISTS (SELECT * FROM S_TimeExpense e ") + .append("WHERE el.S_TimeExpense_ID=e.S_TimeExpense_ID"); if (p_DateFrom != null) sql.append(" AND e.DateReport >= ?"); // #3 if (m_DateTo != null) @@ -158,8 +158,8 @@ public class ExpenseSOrder extends SvrProcess rs = null; pstmt = null; } completeOrder (); - - return "@Created@=" + m_noOrders; + StringBuilder msgreturn = new StringBuilder("@Created@=").append(m_noOrders); + return msgreturn.toString(); } // doIt /** @@ -180,9 +180,11 @@ public class ExpenseSOrder extends SvrProcess m_order.setBPartner(bp); if (m_order.getC_BPartner_Location_ID() == 0) { - log.log(Level.SEVERE, "No BP Location: " + bp); + StringBuilder msglog = new StringBuilder("No BP Location: ").append(bp); + log.log(Level.SEVERE, msglog.toString()); + msglog = new StringBuilder("No Location: ").append(te.getDocumentNo()).append(" ").append(bp.getName()); addLog(0, te.getDateReport(), - null, "No Location: " + te.getDocumentNo() + " " + bp.getName()); + null, msglog.toString()); m_order = null; return; } @@ -271,8 +273,10 @@ public class ExpenseSOrder extends SvrProcess return; m_order.setDocAction(DocAction.ACTION_Prepare); if (!m_order.processIt(DocAction.ACTION_Prepare)) { - log.warning("Order Process Failed: " + m_order + " - " + m_order.getProcessMsg()); - throw new IllegalStateException("Order Process Failed: " + m_order + " - " + m_order.getProcessMsg()); + StringBuilder msglog = new StringBuilder("Order Process Failed: ").append(m_order).append(" - ").append(m_order.getProcessMsg()); + log.warning(msglog.toString()); + msglog = new StringBuilder("Order Process Failed: ").append(m_order).append(" - ").append(m_order.getProcessMsg()); + throw new IllegalStateException(msglog.toString()); } if (!m_order.save()) throw new IllegalStateException("Cannot save Order"); diff --git a/org.adempiere.base.process/src/org/compiere/process/FactAcctSummary.java b/org.adempiere.base.process/src/org/compiere/process/FactAcctSummary.java index 60f1f18f60..389297eb12 100644 --- a/org.adempiere.base.process/src/org/compiere/process/FactAcctSummary.java +++ b/org.adempiere.base.process/src/org/compiere/process/FactAcctSummary.java @@ -55,11 +55,11 @@ public class FactAcctSummary extends SvrProcess { @Override protected String doIt() throws Exception { - String where = ""; + StringBuilder where = new StringBuilder(); if ( p_Cube_ID > 0) - where = "PA_ReportCube_ID = " + p_Cube_ID; + where = new StringBuilder("PA_ReportCube_ID = ").append(p_Cube_ID); - List cubes = new Query(getCtx(), MReportCube.Table_Name, where, get_TrxName()) + List cubes = new Query(getCtx(), MReportCube.Table_Name, where.toString(), get_TrxName()) .setOnlyActiveRecords(true).setClient_ID() .list(); diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportAccount.java b/org.adempiere.base.process/src/org/compiere/process/ImportAccount.java index ff377ffe29..68f54f42a6 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportAccount.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportAccount.java @@ -88,35 +88,35 @@ public class ImportAccount extends SvrProcess */ protected String doIt() throws java.lang.Exception { - StringBuffer sql = null; + StringBuilder sql = null; int no = 0; - String clientCheck = " AND AD_Client_ID=" + m_AD_Client_ID; + StringBuilder clientCheck = new StringBuilder(" AND AD_Client_ID=").append(m_AD_Client_ID); // **** Prepare **** // Delete Old Imported if (m_deleteOldImported) { - sql = new StringBuffer ("DELETE I_ElementValue " - + "WHERE I_IsImported='Y'").append(clientCheck); + sql = new StringBuilder ("DELETE I_ElementValue ") + .append("WHERE I_IsImported='Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Delete Old Impored =" + no); } // Set Client, Org, IsActive, Created/Updated - sql = new StringBuffer ("UPDATE I_ElementValue " - + "SET AD_Client_ID = COALESCE (AD_Client_ID, ").append(m_AD_Client_ID).append(")," - + " AD_Org_ID = COALESCE (AD_Org_ID, 0)," - + " IsActive = COALESCE (IsActive, 'Y')," - + " Created = COALESCE (Created, SysDate)," - + " CreatedBy = COALESCE (CreatedBy, 0)," - + " Updated = COALESCE (Updated, SysDate)," - + " UpdatedBy = COALESCE (UpdatedBy, 0)," - + " I_ErrorMsg = ' '," - + " Processed = 'N', " - + " Processing = 'Y', " - + " I_IsImported = 'N' " - + "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); + sql = new StringBuilder ("UPDATE I_ElementValue ") + .append("SET AD_Client_ID = COALESCE (AD_Client_ID, ").append(m_AD_Client_ID).append("),") + .append(" AD_Org_ID = COALESCE (AD_Org_ID, 0),") + .append(" IsActive = COALESCE (IsActive, 'Y'),") + .append(" Created = COALESCE (Created, SysDate),") + .append(" CreatedBy = COALESCE (CreatedBy, 0),") + .append(" Updated = COALESCE (Updated, SysDate),") + .append(" UpdatedBy = COALESCE (UpdatedBy, 0),") + .append(" I_ErrorMsg = ' ',") + .append(" Processed = 'N', ") + .append(" Processing = 'Y', ") + .append(" I_IsImported = 'N' ") + .append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Reset=" + no); @@ -125,53 +125,53 @@ public class ImportAccount extends SvrProcess // Set Element if (m_C_Element_ID != 0) { - sql = new StringBuffer ("UPDATE I_ElementValue " - + "SET ElementName=(SELECT Name FROM C_Element WHERE C_Element_ID=").append(m_C_Element_ID).append(") " - + "WHERE ElementName IS NULL AND C_Element_ID IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ElementValue ") + .append("SET ElementName=(SELECT Name FROM C_Element WHERE C_Element_ID=").append(m_C_Element_ID).append(") ") + .append("WHERE ElementName IS NULL AND C_Element_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Element Default=" + no); } // - sql = new StringBuffer ("UPDATE I_ElementValue i " - + "SET C_Element_ID = (SELECT C_Element_ID FROM C_Element e" - + " WHERE i.ElementName=e.Name AND i.AD_Client_ID=e.AD_Client_ID)" - + "WHERE C_Element_ID IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ElementValue i ") + .append("SET C_Element_ID = (SELECT C_Element_ID FROM C_Element e") + .append(" WHERE i.ElementName=e.Name AND i.AD_Client_ID=e.AD_Client_ID)") + .append("WHERE C_Element_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Element=" + no); // - sql = new StringBuffer ("UPDATE I_ElementValue " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Element, ' " - + "WHERE C_Element_ID IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ElementValue ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Element, ' ") + .append("WHERE C_Element_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.config("Invalid Element=" + no); // No Name, Value - sql = new StringBuffer ("UPDATE I_ElementValue " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Name, ' " - + "WHERE (Value IS NULL OR Name IS NULL)" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ElementValue ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Name, ' ") + .append("WHERE (Value IS NULL OR Name IS NULL)") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.config("Invalid Name=" + no); // Set Column - sql = new StringBuffer ("UPDATE I_ElementValue i " - + "SET AD_Column_ID = (SELECT AD_Column_ID FROM AD_Column c" - + " WHERE UPPER(i.Default_Account)=UPPER(c.ColumnName)" - + " AND c.AD_Table_ID IN (315,266) AND AD_Reference_ID=25) " - + "WHERE Default_Account IS NOT NULL AND AD_Column_ID IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ElementValue i ") + .append("SET AD_Column_ID = (SELECT AD_Column_ID FROM AD_Column c") + .append(" WHERE UPPER(i.Default_Account)=UPPER(c.ColumnName)") + .append(" AND c.AD_Table_ID IN (315,266) AND AD_Reference_ID=25) ") + .append("WHERE Default_Account IS NOT NULL AND AD_Column_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Column=" + no); // - sql = new StringBuffer ("UPDATE I_ElementValue " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Column, ' " - + "WHERE AD_Column_ID IS NULL AND Default_Account IS NOT NULL" - + " AND UPPER(Default_Account)<>'DEFAULT_ACCT'" // ignore default account - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ElementValue ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Column, ' ") + .append("WHERE AD_Column_ID IS NULL AND Default_Account IS NOT NULL") + .append(" AND UPPER(Default_Account)<>'DEFAULT_ACCT'") // ignore default account + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.config("Invalid Column=" + no); @@ -179,76 +179,77 @@ public class ImportAccount extends SvrProcess String[] yColumns = new String[] {"PostActual", "PostBudget", "PostStatistical", "PostEncumbrance"}; for (int i = 0; i < yColumns.length; i++) { - sql = new StringBuffer ("UPDATE I_ElementValue SET ") + sql = new StringBuilder ("UPDATE I_ElementValue SET ") .append(yColumns[i]).append("='Y' WHERE ") .append(yColumns[i]).append(" IS NULL OR ") - .append(yColumns[i]).append(" NOT IN ('Y','N')" - + " AND I_IsImported<>'Y'").append(clientCheck); + .append(yColumns[i]).append(" NOT IN ('Y','N')") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set " + yColumns[i] + " Default=" + no); + StringBuilder msglog = new StringBuilder("Set ").append(yColumns[i]).append(" Default=").append(no); + log.fine(msglog.toString()); } // Summary - sql = new StringBuffer ("UPDATE I_ElementValue " - + "SET IsSummary='N' " - + "WHERE IsSummary IS NULL OR IsSummary NOT IN ('Y','N')" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ElementValue ") + .append("SET IsSummary='N' ") + .append("WHERE IsSummary IS NULL OR IsSummary NOT IN ('Y','N')") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set IsSummary Default=" + no); // Doc Controlled - sql = new StringBuffer ("UPDATE I_ElementValue " - + "SET IsDocControlled = CASE WHEN AD_Column_ID IS NOT NULL THEN 'Y' ELSE 'N' END " - + "WHERE IsDocControlled IS NULL OR IsDocControlled NOT IN ('Y','N')" - + " AND I_IsImported='N'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ElementValue ") + .append("SET IsDocControlled = CASE WHEN AD_Column_ID IS NOT NULL THEN 'Y' ELSE 'N' END ") + .append("WHERE IsDocControlled IS NULL OR IsDocControlled NOT IN ('Y','N')") + .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set IsDocumentControlled Default=" + no); // Check Account Type A (E) L M O R - sql = new StringBuffer ("UPDATE I_ElementValue " - + "SET AccountType='E' " - + "WHERE AccountType IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ElementValue ") + .append("SET AccountType='E' ") + .append("WHERE AccountType IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set AccountType Default=" + no); // - sql = new StringBuffer ("UPDATE I_ElementValue " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid AccountType, ' " - + "WHERE AccountType NOT IN ('A','E','L','M','O','R')" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ElementValue ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid AccountType, ' ") + .append("WHERE AccountType NOT IN ('A','E','L','M','O','R')") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.config("Invalid AccountType=" + no); // Check Account Sign (N) C B - sql = new StringBuffer ("UPDATE I_ElementValue " - + "SET AccountSign='N' " - + "WHERE AccountSign IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ElementValue ") + .append("SET AccountSign='N' ") + .append("WHERE AccountSign IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set AccountSign Default=" + no); // - sql = new StringBuffer ("UPDATE I_ElementValue " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid AccountSign, ' " - + "WHERE AccountSign NOT IN ('N','C','D')" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ElementValue ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid AccountSign, ' ") + .append("WHERE AccountSign NOT IN ('N','C','D')") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.config("Invalid AccountSign=" + no); // No Value - sql = new StringBuffer ("UPDATE I_ElementValue " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Key, ' " - + "WHERE (Value IS NULL OR Value='')" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ElementValue ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Key, ' ") + .append("WHERE (Value IS NULL OR Value='')") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.config("Invalid Key=" + no); // **** Update ElementValue from existing - sql = new StringBuffer ("UPDATE I_ElementValue i " - + "SET C_ElementValue_ID=(SELECT C_ElementValue_ID FROM C_ElementValue ev" - + " INNER JOIN C_Element e ON (ev.C_Element_ID=e.C_Element_ID)" - + " WHERE i.C_Element_ID=e.C_Element_ID AND i.AD_Client_ID=e.AD_Client_ID" - + " AND i.Value=ev.Value) " - + "WHERE C_ElementValue_ID IS NULL" - + " AND I_IsImported='N'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ElementValue i ") + .append("SET C_ElementValue_ID=(SELECT C_ElementValue_ID FROM C_ElementValue ev") + .append(" INNER JOIN C_Element e ON (ev.C_Element_ID=e.C_Element_ID)") + .append(" WHERE i.C_Element_ID=e.C_Element_ID AND i.AD_Client_ID=e.AD_Client_ID") + .append(" AND i.Value=ev.Value) ") + .append("WHERE C_ElementValue_ID IS NULL") + .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Found ElementValue=" + no); @@ -259,9 +260,9 @@ public class ImportAccount extends SvrProcess int noUpdate = 0; // Go through Records - sql = new StringBuffer ("SELECT * " - + "FROM I_ElementValue " - + "WHERE I_IsImported='N'").append(clientCheck) + sql = new StringBuilder ("SELECT * ") + .append("FROM I_ElementValue ") + .append("WHERE I_IsImported='N'").append(clientCheck) .append(" ORDER BY I_ElementValue_ID"); try { @@ -286,8 +287,8 @@ public class ImportAccount extends SvrProcess } else { - sql = new StringBuffer ("UPDATE I_ElementValue i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert ElementValue ")) + sql = new StringBuilder ("UPDATE I_ElementValue i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert ElementValue ")) .append("WHERE I_ElementValue_ID=").append(I_ElementValue_ID); DB.executeUpdate(sql.toString(), get_TrxName()); } @@ -308,8 +309,8 @@ public class ImportAccount extends SvrProcess } else { - sql = new StringBuffer ("UPDATE I_ElementValue i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Update ElementValue")) + sql = new StringBuilder ("UPDATE I_ElementValue i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Update ElementValue")) .append("WHERE I_ElementValue_ID=").append(I_ElementValue_ID); DB.executeUpdate(sql.toString(), get_TrxName()); } @@ -324,9 +325,9 @@ public class ImportAccount extends SvrProcess } // Set Error to indicator to not imported - sql = new StringBuffer ("UPDATE I_ElementValue " - + "SET I_IsImported='N', Updated=SysDate " - + "WHERE I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ElementValue ") + .append("SET I_IsImported='N', Updated=SysDate ") + .append("WHERE I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); addLog (0, null, new BigDecimal (no), "@Errors@"); addLog (0, null, new BigDecimal (noInsert), "@C_ElementValue_ID@: @Inserted@"); @@ -335,29 +336,29 @@ public class ImportAccount extends SvrProcess commitEx(); // ***** Set Parent - sql = new StringBuffer ("UPDATE I_ElementValue i " - + "SET ParentElementValue_ID=(SELECT C_ElementValue_ID" - + " FROM C_ElementValue ev WHERE i.C_Element_ID=ev.C_Element_ID" - + " AND i.ParentValue=ev.Value AND i.AD_Client_ID=ev.AD_Client_ID) " - + "WHERE ParentElementValue_ID IS NULL" - + " AND I_IsImported='Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ElementValue i ") + .append("SET ParentElementValue_ID=(SELECT C_ElementValue_ID") + .append(" FROM C_ElementValue ev WHERE i.C_Element_ID=ev.C_Element_ID") + .append(" AND i.ParentValue=ev.Value AND i.AD_Client_ID=ev.AD_Client_ID) ") + .append("WHERE ParentElementValue_ID IS NULL") + .append(" AND I_IsImported='Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Found Parent ElementValue=" + no); // - sql = new StringBuffer ("UPDATE I_ElementValue " - + "SET I_ErrorMsg=I_ErrorMsg||'Info=ParentNotFound, ' " - + "WHERE ParentElementValue_ID IS NULL AND ParentValue IS NOT NULL" - + " AND I_IsImported='Y' AND Processed='N'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ElementValue ") + .append("SET I_ErrorMsg=I_ErrorMsg||'Info=ParentNotFound, ' ") + .append("WHERE ParentElementValue_ID IS NULL AND ParentValue IS NOT NULL") + .append(" AND I_IsImported='Y' AND Processed='N'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.config("Not Found Parent ElementValue=" + no); // - sql = new StringBuffer ("SELECT i.ParentElementValue_ID, i.I_ElementValue_ID," - + " e.AD_Tree_ID, i.C_ElementValue_ID, i.Value||'-'||i.Name AS Info " - + "FROM I_ElementValue i" - + " INNER JOIN C_Element e ON (i.C_Element_ID=e.C_Element_ID) " - + "WHERE i.C_ElementValue_ID IS NOT NULL AND e.AD_Tree_ID IS NOT NULL" - + " AND i.ParentElementValue_ID IS NOT NULL" - + " AND i.I_IsImported='Y' AND Processed='N' AND i.AD_Client_ID=").append(m_AD_Client_ID); + sql = new StringBuilder ("SELECT i.ParentElementValue_ID, i.I_ElementValue_ID,") + .append(" e.AD_Tree_ID, i.C_ElementValue_ID, i.Value||'-'||i.Name AS Info ") + .append("FROM I_ElementValue i") + .append(" INNER JOIN C_Element e ON (i.C_Element_ID=e.C_Element_ID) ") + .append("WHERE i.C_ElementValue_ID IS NOT NULL AND e.AD_Tree_ID IS NOT NULL") + .append(" AND i.ParentElementValue_ID IS NOT NULL") + .append(" AND i.I_IsImported='Y' AND Processed='N' AND i.AD_Client_ID=").append(m_AD_Client_ID); int noParentUpdate = 0; try { @@ -402,10 +403,10 @@ public class ImportAccount extends SvrProcess commitEx(); // Reset Processing Flag - sql = new StringBuffer ("UPDATE I_ElementValue " - + "SET Processing='-'" - + "WHERE I_IsImported='Y' AND Processed='N' AND Processing='Y'" - + " AND C_ElementValue_ID IS NOT NULL") + sql = new StringBuilder ("UPDATE I_ElementValue ") + .append("SET Processing='-'") + .append("WHERE I_IsImported='Y' AND Processed='N' AND Processing='Y'") + .append(" AND C_ElementValue_ID IS NOT NULL") .append(clientCheck); if (m_updateDefaultAccounts) sql.append(" AND AD_Column_ID IS NULL"); @@ -413,17 +414,17 @@ public class ImportAccount extends SvrProcess log.fine("Reset Processing Flag=" + no); if (m_updateDefaultAccounts) - updateDefaults(clientCheck); + updateDefaults(clientCheck.toString()); // Update Description - sql = new StringBuffer("SELECT * FROM C_ValidCombination vc " - + "WHERE EXISTS (SELECT * FROM I_ElementValue i " - + "WHERE vc.Account_ID=i.C_ElementValue_ID)"); + sql = new StringBuilder("SELECT * FROM C_ValidCombination vc ") + .append("WHERE EXISTS (SELECT * FROM I_ElementValue i ") + .append("WHERE vc.Account_ID=i.C_ElementValue_ID)"); // Done - sql = new StringBuffer ("UPDATE I_ElementValue " - + "SET Processing='N', Processed='Y'" - + "WHERE I_IsImported='Y'") + sql = new StringBuilder ("UPDATE I_ElementValue ") + .append("SET Processing='N', Processed='Y'") + .append("WHERE I_IsImported='Y'") .append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Processed=" + no); @@ -441,8 +442,8 @@ public class ImportAccount extends SvrProcess log.config("CreateNewCombination=" + m_createNewCombination); // **** Update Defaults - StringBuffer sql = new StringBuffer ("SELECT C_AcctSchema_ID FROM C_AcctSchema_Element " - + "WHERE C_Element_ID=?").append(clientCheck); + StringBuilder sql = new StringBuilder ("SELECT C_AcctSchema_ID FROM C_AcctSchema_Element ") + .append("WHERE C_Element_ID=?").append(clientCheck); try { PreparedStatement pstmt = DB.prepareStatement(sql.toString(), get_TrxName()); @@ -459,14 +460,14 @@ public class ImportAccount extends SvrProcess } // Default Account DEFAULT_ACCT - sql = new StringBuffer ("UPDATE C_AcctSchema_Element e " - + "SET C_ElementValue_ID=(SELECT C_ElementValue_ID FROM I_ElementValue i" - + " WHERE e.C_Element_ID=i.C_Element_ID AND i.C_ElementValue_ID IS NOT NULL" - + " AND UPPER(i.Default_Account)='DEFAULT_ACCT') " - + "WHERE EXISTS (SELECT * FROM I_ElementValue i" - + " WHERE e.C_Element_ID=i.C_Element_ID AND i.C_ElementValue_ID IS NOT NULL" - + " AND UPPER(i.Default_Account)='DEFAULT_ACCT' " - + " AND i.I_IsImported='Y' AND i.Processing='-')") + sql = new StringBuilder ("UPDATE C_AcctSchema_Element e ") + .append("SET C_ElementValue_ID=(SELECT C_ElementValue_ID FROM I_ElementValue i") + .append(" WHERE e.C_Element_ID=i.C_Element_ID AND i.C_ElementValue_ID IS NOT NULL") + .append(" AND UPPER(i.Default_Account)='DEFAULT_ACCT') ") + .append("WHERE EXISTS (SELECT * FROM I_ElementValue i") + .append(" WHERE e.C_Element_ID=i.C_Element_ID AND i.C_ElementValue_ID IS NOT NULL") + .append(" AND UPPER(i.Default_Account)='DEFAULT_ACCT' ") + .append(" AND i.I_IsImported='Y' AND i.Processing='-')") .append(clientCheck); int no = DB.executeUpdate(sql.toString(), get_TrxName()); addLog (0, null, new BigDecimal (no), "@C_AcctSchema_Element_ID@: @Updated@"); @@ -484,21 +485,22 @@ public class ImportAccount extends SvrProcess MAcctSchema as = new MAcctSchema (getCtx(), C_AcctSchema_ID, get_TrxName()); if (as.getAcctSchemaElement("AC").getC_Element_ID() != m_C_Element_ID) { - log.log(Level.SEVERE, "C_Element_ID=" + m_C_Element_ID + " not in AcctSchema=" + as); + StringBuilder msglog = new StringBuilder("C_Element_ID=").append(m_C_Element_ID).append(" not in AcctSchema=").append(as); + log.log(Level.SEVERE, msglog.toString()); return; } int[] counts = new int[] {0, 0, 0}; - String sql = "SELECT i.C_ElementValue_ID, t.TableName, c.ColumnName, i.I_ElementValue_ID " - + "FROM I_ElementValue i" - + " INNER JOIN AD_Column c ON (i.AD_Column_ID=c.AD_Column_ID)" - + " INNER JOIN AD_Table t ON (c.AD_Table_ID=t.AD_Table_ID) " - + "WHERE i.I_IsImported='Y' AND Processing='Y'" - + " AND i.C_ElementValue_ID IS NOT NULL AND C_Element_ID=?"; + StringBuilder sql = new StringBuilder("SELECT i.C_ElementValue_ID, t.TableName, c.ColumnName, i.I_ElementValue_ID ") + .append("FROM I_ElementValue i") + .append(" INNER JOIN AD_Column c ON (i.AD_Column_ID=c.AD_Column_ID)") + .append(" INNER JOIN AD_Table t ON (c.AD_Table_ID=t.AD_Table_ID) ") + .append("WHERE i.I_IsImported='Y' AND Processing='Y'") + .append(" AND i.C_ElementValue_ID IS NOT NULL AND C_Element_ID=?"); try { - PreparedStatement pstmt = DB.prepareStatement(sql, get_TrxName()); + PreparedStatement pstmt = DB.prepareStatement(sql.toString(), get_TrxName()); pstmt.setInt(1, m_C_Element_ID); ResultSet rs = pstmt.executeQuery(); while (rs.next()) @@ -512,8 +514,8 @@ public class ImportAccount extends SvrProcess counts[u]++; if (u != UPDATE_ERROR) { - sql = "UPDATE I_ElementValue SET Processing='N' " - + "WHERE I_ElementValue_ID=" + I_ElementValue_ID; + sql = new StringBuilder("UPDATE I_ElementValue SET Processing='N' ") + .append("WHERE I_ElementValue_ID=").append(I_ElementValue_ID); int no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 1) log.log(Level.SEVERE, "Updated=" + no); @@ -552,9 +554,10 @@ public class ImportAccount extends SvrProcess */ private int updateDefaultAccount (String TableName, String ColumnName, int C_AcctSchema_ID, int C_ElementValue_ID) { - log.fine(TableName + "." + ColumnName + " - " + C_ElementValue_ID); + StringBuilder msglog = new StringBuilder(TableName).append(".").append(ColumnName).append(" - ").append(C_ElementValue_ID); + log.fine(msglog.toString()); int retValue = UPDATE_ERROR; - StringBuffer sql = new StringBuffer ("SELECT x.") + StringBuilder sql = new StringBuilder ("SELECT x.") .append(ColumnName).append(",Account_ID FROM ") .append(TableName).append(" x INNER JOIN C_ValidCombination vc ON (x.") .append(ColumnName).append("=vc.C_ValidCombination_ID) ") @@ -586,13 +589,14 @@ public class ImportAccount extends SvrProcess int newC_ValidCombination_ID = acct.getC_ValidCombination_ID(); if (C_ValidCombination_ID != newC_ValidCombination_ID) { - sql = new StringBuffer ("UPDATE ").append(TableName) + sql = new StringBuilder ("UPDATE ").append(TableName) .append(" SET ").append(ColumnName).append("=").append(newC_ValidCombination_ID) .append(" WHERE C_AcctSchema_ID=").append(C_AcctSchema_ID); int no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("New #" + no + " - " - + TableName + "." + ColumnName + " - " + C_ElementValue_ID - + " -- " + C_ValidCombination_ID + " -> " + newC_ValidCombination_ID); + msglog = new StringBuilder("New #").append(no).append(" - ") + .append(TableName).append(".").append(ColumnName).append(" - ").append(C_ElementValue_ID) + .append(" -- ").append(C_ValidCombination_ID).append(" -> ").append(newC_ValidCombination_ID); + log.fine(msglog.toString()); if (no == 1) retValue = UPDATE_YES; } @@ -603,25 +607,28 @@ public class ImportAccount extends SvrProcess else // Replace Combination { // Only Acct Combination directly - sql = new StringBuffer ("UPDATE C_ValidCombination SET Account_ID=") + sql = new StringBuilder ("UPDATE C_ValidCombination SET Account_ID=") .append(C_ElementValue_ID).append(" WHERE C_ValidCombination_ID=").append(C_ValidCombination_ID); int no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Replace #" + no + " - " - + "C_ValidCombination_ID=" + C_ValidCombination_ID + ", New Account_ID=" + C_ElementValue_ID); + msglog = new StringBuilder("Replace #").append(no).append(" - ") + .append("C_ValidCombination_ID=").append(C_ValidCombination_ID).append(", New Account_ID=").append(C_ElementValue_ID); + log.fine(msglog.toString()); if (no == 1) { retValue = UPDATE_YES; // Where Acct was used - sql = new StringBuffer ("UPDATE C_ValidCombination SET Account_ID=") + sql = new StringBuilder ("UPDATE C_ValidCombination SET Account_ID=") .append(C_ElementValue_ID).append(" WHERE Account_ID=").append(Account_ID); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("ImportAccount.updateDefaultAccount - Replace VC #" + no + " - " - + "Account_ID=" + Account_ID + ", New Account_ID=" + C_ElementValue_ID); - sql = new StringBuffer ("UPDATE Fact_Acct SET Account_ID=") + msglog = new StringBuilder("ImportAccount.updateDefaultAccount - Replace VC #").append(no).append(" - ") + .append("Account_ID=").append(Account_ID).append(", New Account_ID=").append(C_ElementValue_ID); + log.fine(msglog.toString()); + sql = new StringBuilder ("UPDATE Fact_Acct SET Account_ID=") .append(C_ElementValue_ID).append(" WHERE Account_ID=").append(Account_ID); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("ImportAccount.updateDefaultAccount - Replace Fact #" + no + " - " - + "Account_ID=" + Account_ID + ", New Account_ID=" + C_ElementValue_ID); + msglog = new StringBuilder("ImportAccount.updateDefaultAccount - Replace Fact #").append(no).append(" - ") + .append("Account_ID=").append(Account_ID).append(", New Account_ID=").append(C_ElementValue_ID); + log.fine(msglog.toString()); } } // replace combination } // need to update diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportBPartner.java b/org.adempiere.base.process/src/org/compiere/process/ImportBPartner.java index be27f2c990..e3234ad12d 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportBPartner.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportBPartner.java @@ -91,7 +91,7 @@ implements ImportProcess */ protected String doIt() throws java.lang.Exception { - StringBuffer sql = null; + StringBuilder sql = null; int no = 0; String clientCheck = getWhereClause(); @@ -100,50 +100,50 @@ implements ImportProcess // Delete Old Imported if (m_deleteOldImported) { - sql = new StringBuffer ("DELETE I_BPartner " - + "WHERE I_IsImported='Y'").append(clientCheck); + sql = new StringBuilder ("DELETE I_BPartner ") + .append("WHERE I_IsImported='Y'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); log.fine("Delete Old Impored =" + no); } // Set Client, Org, IsActive, Created/Updated - sql = new StringBuffer ("UPDATE I_BPartner " - + "SET AD_Client_ID = COALESCE (AD_Client_ID, ").append(m_AD_Client_ID).append(")," - + " AD_Org_ID = COALESCE (AD_Org_ID, 0)," - + " IsActive = COALESCE (IsActive, 'Y')," - + " Created = COALESCE (Created, SysDate)," - + " CreatedBy = COALESCE (CreatedBy, 0)," - + " Updated = COALESCE (Updated, SysDate)," - + " UpdatedBy = COALESCE (UpdatedBy, 0)," - + " I_ErrorMsg = ' '," - + " I_IsImported = 'N' " - + "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); + sql = new StringBuilder ("UPDATE I_BPartner ") + .append("SET AD_Client_ID = COALESCE (AD_Client_ID, ").append(m_AD_Client_ID).append("),") + .append(" AD_Org_ID = COALESCE (AD_Org_ID, 0),") + .append(" IsActive = COALESCE (IsActive, 'Y'),") + .append(" Created = COALESCE (Created, SysDate),") + .append(" CreatedBy = COALESCE (CreatedBy, 0),") + .append(" Updated = COALESCE (Updated, SysDate),") + .append(" UpdatedBy = COALESCE (UpdatedBy, 0),") + .append(" I_ErrorMsg = ' ',") + .append(" I_IsImported = 'N' ") + .append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); log.fine("Reset=" + no); ModelValidationEngine.get().fireImportValidate(this, null, null, ImportValidator.TIMING_BEFORE_VALIDATE); // Set BP_Group - sql = new StringBuffer ("UPDATE I_BPartner i " - + "SET GroupValue=(SELECT MAX(Value) FROM C_BP_Group g WHERE g.IsDefault='Y'" - + " AND g.AD_Client_ID=i.AD_Client_ID) "); - sql.append("WHERE GroupValue IS NULL AND C_BP_Group_ID IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_BPartner i ") + .append("SET GroupValue=(SELECT MAX(Value) FROM C_BP_Group g WHERE g.IsDefault='Y'") + .append(" AND g.AD_Client_ID=i.AD_Client_ID) "); + sql.append("WHERE GroupValue IS NULL AND C_BP_Group_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); log.fine("Set Group Default=" + no); // - sql = new StringBuffer ("UPDATE I_BPartner i " - + "SET C_BP_Group_ID=(SELECT C_BP_Group_ID FROM C_BP_Group g" - + " WHERE i.GroupValue=g.Value AND g.AD_Client_ID=i.AD_Client_ID) " - + "WHERE C_BP_Group_ID IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_BPartner i ") + .append("SET C_BP_Group_ID=(SELECT C_BP_Group_ID FROM C_BP_Group g") + .append(" WHERE i.GroupValue=g.Value AND g.AD_Client_ID=i.AD_Client_ID) ") + .append("WHERE C_BP_Group_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); log.fine("Set Group=" + no); // - sql = new StringBuffer ("UPDATE I_BPartner " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Group, ' " - + "WHERE C_BP_Group_ID IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_BPartner ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Group, ' ") + .append("WHERE C_BP_Group_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); log.config("Invalid Group=" + no); @@ -158,123 +158,123 @@ implements ImportProcess log.fine("Set Country Default=" + no); **/ // - sql = new StringBuffer ("UPDATE I_BPartner i " - + "SET C_Country_ID=(SELECT C_Country_ID FROM C_Country c" - + " WHERE i.CountryCode=c.CountryCode AND c.AD_Client_ID IN (0, i.AD_Client_ID)) " - + "WHERE C_Country_ID IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_BPartner i ") + .append("SET C_Country_ID=(SELECT C_Country_ID FROM C_Country c") + .append(" WHERE i.CountryCode=c.CountryCode AND c.AD_Client_ID IN (0, i.AD_Client_ID)) ") + .append("WHERE C_Country_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); log.fine("Set Country=" + no); // - sql = new StringBuffer ("UPDATE I_BPartner " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Country, ' " - + "WHERE C_Country_ID IS NULL AND (City IS NOT NULL OR Address1 IS NOT NULL)" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_BPartner ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Country, ' ") + .append("WHERE C_Country_ID IS NULL AND (City IS NOT NULL OR Address1 IS NOT NULL)") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); log.config("Invalid Country=" + no); // Set Region - sql = new StringBuffer ("UPDATE I_BPartner i " - + "Set RegionName=(SELECT MAX(Name) FROM C_Region r" - + " WHERE r.IsDefault='Y' AND r.C_Country_ID=i.C_Country_ID" - + " AND r.AD_Client_ID IN (0, i.AD_Client_ID)) " ); - sql.append("WHERE RegionName IS NULL AND C_Region_ID IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_BPartner i ") + .append("Set RegionName=(SELECT MAX(Name) FROM C_Region r") + .append(" WHERE r.IsDefault='Y' AND r.C_Country_ID=i.C_Country_ID") + .append(" AND r.AD_Client_ID IN (0, i.AD_Client_ID)) " ); + sql.append("WHERE RegionName IS NULL AND C_Region_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); log.fine("Set Region Default=" + no); // - sql = new StringBuffer ("UPDATE I_BPartner i " - + "Set C_Region_ID=(SELECT C_Region_ID FROM C_Region r" - + " WHERE r.Name=i.RegionName AND r.C_Country_ID=i.C_Country_ID" - + " AND r.AD_Client_ID IN (0, i.AD_Client_ID)) " - + "WHERE C_Region_ID IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_BPartner i ") + .append("Set C_Region_ID=(SELECT C_Region_ID FROM C_Region r") + .append(" WHERE r.Name=i.RegionName AND r.C_Country_ID=i.C_Country_ID") + .append(" AND r.AD_Client_ID IN (0, i.AD_Client_ID)) ") + .append("WHERE C_Region_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); log.fine("Set Region=" + no); // - sql = new StringBuffer ("UPDATE I_BPartner i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Region, ' " - + "WHERE C_Region_ID IS NULL " - + " AND EXISTS (SELECT * FROM C_Country c" - + " WHERE c.C_Country_ID=i.C_Country_ID AND c.HasRegion='Y')" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_BPartner i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Region, ' ") + .append("WHERE C_Region_ID IS NULL ") + .append(" AND EXISTS (SELECT * FROM C_Country c") + .append(" WHERE c.C_Country_ID=i.C_Country_ID AND c.HasRegion='Y')") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); log.config("Invalid Region=" + no); // Set Greeting - sql = new StringBuffer ("UPDATE I_BPartner i " - + "SET C_Greeting_ID=(SELECT C_Greeting_ID FROM C_Greeting g" - + " WHERE i.BPContactGreeting=g.Name AND g.AD_Client_ID IN (0, i.AD_Client_ID)) " - + "WHERE C_Greeting_ID IS NULL AND BPContactGreeting IS NOT NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_BPartner i ") + .append("SET C_Greeting_ID=(SELECT C_Greeting_ID FROM C_Greeting g") + .append(" WHERE i.BPContactGreeting=g.Name AND g.AD_Client_ID IN (0, i.AD_Client_ID)) ") + .append("WHERE C_Greeting_ID IS NULL AND BPContactGreeting IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); log.fine("Set Greeting=" + no); // - sql = new StringBuffer ("UPDATE I_BPartner i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Greeting, ' " - + "WHERE C_Greeting_ID IS NULL AND BPContactGreeting IS NOT NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_BPartner i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Greeting, ' ") + .append("WHERE C_Greeting_ID IS NULL AND BPContactGreeting IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); log.config("Invalid Greeting=" + no); // Existing User ? - sql = new StringBuffer ("UPDATE I_BPartner i " - + "SET (C_BPartner_ID,AD_User_ID)=" - + "(SELECT C_BPartner_ID,AD_User_ID FROM AD_User u " - + "WHERE i.EMail=u.EMail AND u.AD_Client_ID=i.AD_Client_ID) " - + "WHERE i.EMail IS NOT NULL AND I_IsImported='N'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_BPartner i ") + .append("SET (C_BPartner_ID,AD_User_ID)=") + .append("(SELECT C_BPartner_ID,AD_User_ID FROM AD_User u ") + .append("WHERE i.EMail=u.EMail AND u.AD_Client_ID=i.AD_Client_ID) ") + .append("WHERE i.EMail IS NOT NULL AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); log.fine("Found EMail User=" + no); // Existing BPartner ? Match Value - sql = new StringBuffer ("UPDATE I_BPartner i " - + "SET C_BPartner_ID=(SELECT C_BPartner_ID FROM C_BPartner p" - + " WHERE i.Value=p.Value AND p.AD_Client_ID=i.AD_Client_ID) " - + "WHERE C_BPartner_ID IS NULL AND Value IS NOT NULL" - + " AND I_IsImported='N'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_BPartner i ") + .append("SET C_BPartner_ID=(SELECT C_BPartner_ID FROM C_BPartner p") + .append(" WHERE i.Value=p.Value AND p.AD_Client_ID=i.AD_Client_ID) ") + .append("WHERE C_BPartner_ID IS NULL AND Value IS NOT NULL") + .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); log.fine("Found BPartner=" + no); // Existing Contact ? Match Name - sql = new StringBuffer ("UPDATE I_BPartner i " - + "SET AD_User_ID=(SELECT AD_User_ID FROM AD_User c" - + " WHERE i.ContactName=c.Name AND i.C_BPartner_ID=c.C_BPartner_ID AND c.AD_Client_ID=i.AD_Client_ID) " - + "WHERE C_BPartner_ID IS NOT NULL AND AD_User_ID IS NULL AND ContactName IS NOT NULL" - + " AND I_IsImported='N'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_BPartner i ") + .append("SET AD_User_ID=(SELECT AD_User_ID FROM AD_User c") + .append(" WHERE i.ContactName=c.Name AND i.C_BPartner_ID=c.C_BPartner_ID AND c.AD_Client_ID=i.AD_Client_ID) ") + .append("WHERE C_BPartner_ID IS NOT NULL AND AD_User_ID IS NULL AND ContactName IS NOT NULL") + .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); log.fine("Found Contact=" + no); // Existing Location ? Exact Match - sql = new StringBuffer ("UPDATE I_BPartner i " - + "SET C_BPartner_Location_ID=(SELECT C_BPartner_Location_ID" - + " FROM C_BPartner_Location bpl INNER JOIN C_Location l ON (bpl.C_Location_ID=l.C_Location_ID)" - + " WHERE i.C_BPartner_ID=bpl.C_BPartner_ID AND bpl.AD_Client_ID=i.AD_Client_ID" - + " AND (i.Address1=l.Address1 OR (i.Address1 IS NULL AND l.Address1 IS NULL))" - + " AND (i.Address2=l.Address2 OR (i.Address2 IS NULL AND l.Address2 IS NULL))" - + " AND (i.City=l.City OR (i.City IS NULL AND l.City IS NULL))" - + " AND (i.Postal=l.Postal OR (i.Postal IS NULL AND l.Postal IS NULL))" - + " AND (i.Postal_Add=l.Postal_Add OR (l.Postal_Add IS NULL AND l.Postal_Add IS NULL))" - + " AND (i.C_Region_ID=l.C_Region_ID OR (l.C_Region_ID IS NULL AND i.C_Region_ID IS NULL))" - + " AND i.C_Country_ID=l.C_Country_ID) " - + "WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL" - + " AND I_IsImported='N'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_BPartner i ") + .append("SET C_BPartner_Location_ID=(SELECT C_BPartner_Location_ID") + .append(" FROM C_BPartner_Location bpl INNER JOIN C_Location l ON (bpl.C_Location_ID=l.C_Location_ID)") + .append(" WHERE i.C_BPartner_ID=bpl.C_BPartner_ID AND bpl.AD_Client_ID=i.AD_Client_ID") + .append(" AND (i.Address1=l.Address1 OR (i.Address1 IS NULL AND l.Address1 IS NULL))") + .append(" AND (i.Address2=l.Address2 OR (i.Address2 IS NULL AND l.Address2 IS NULL))") + .append(" AND (i.City=l.City OR (i.City IS NULL AND l.City IS NULL))") + .append(" AND (i.Postal=l.Postal OR (i.Postal IS NULL AND l.Postal IS NULL))") + .append(" AND (i.Postal_Add=l.Postal_Add OR (l.Postal_Add IS NULL AND l.Postal_Add IS NULL))") + .append(" AND (i.C_Region_ID=l.C_Region_ID OR (l.C_Region_ID IS NULL AND i.C_Region_ID IS NULL))") + .append(" AND i.C_Country_ID=l.C_Country_ID) ") + .append("WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL") + .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); log.fine("Found Location=" + no); // Interest Area - sql = new StringBuffer ("UPDATE I_BPartner i " - + "SET R_InterestArea_ID=(SELECT R_InterestArea_ID FROM R_InterestArea ia " - + "WHERE i.InterestAreaName=ia.Name AND ia.AD_Client_ID=i.AD_Client_ID) " - + "WHERE R_InterestArea_ID IS NULL AND InterestAreaName IS NOT NULL" - + " AND I_IsImported='N'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_BPartner i ") + .append("SET R_InterestArea_ID=(SELECT R_InterestArea_ID FROM R_InterestArea ia ") + .append("WHERE i.InterestAreaName=ia.Name AND ia.AD_Client_ID=i.AD_Client_ID) ") + .append("WHERE R_InterestArea_ID IS NULL AND InterestAreaName IS NOT NULL") + .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); log.fine("Set Interest Area=" + no); // Value is mandatory error - sql = new StringBuffer ("UPDATE I_BPartner " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Value is mandatory, ' " - + "WHERE Value IS NULL " - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_BPartner ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Value is mandatory, ' ") + .append("WHERE Value IS NULL ") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); log.config("Value is mandatory=" + no); @@ -290,8 +290,8 @@ implements ImportProcess int noUpdate = 0; // Go through Records - sql = new StringBuffer ("SELECT * FROM I_BPartner " - + "WHERE I_IsImported='N'").append(clientCheck); + sql = new StringBuilder ("SELECT * FROM I_BPartner ") + .append("WHERE I_IsImported='N'").append(clientCheck); // gody: 20070113 - Order so the same values are consecutive. sql.append(" ORDER BY Value, I_BPartner_ID"); PreparedStatement pstmt = null; @@ -313,11 +313,12 @@ implements ImportProcess // Remember Value - only first occurance of the value is BP String New_BPValue = rs.getString("Value") ; - X_I_BPartner impBP = new X_I_BPartner (getCtx(), rs, get_TrxName()); - log.fine("I_BPartner_ID=" + impBP.getI_BPartner_ID() - + ", C_BPartner_ID=" + impBP.getC_BPartner_ID() - + ", C_BPartner_Location_ID=" + impBP.getC_BPartner_Location_ID() - + ", AD_User_ID=" + impBP.getAD_User_ID()); + X_I_BPartner impBP = new X_I_BPartner (getCtx(), rs, get_TrxName()); + StringBuilder msglog = new StringBuilder("I_BPartner_ID=") .append(impBP.getI_BPartner_ID()) + .append(", C_BPartner_ID=").append(impBP.getC_BPartner_ID()) + .append(", C_BPartner_Location_ID=").append(impBP.getC_BPartner_Location_ID()) + .append(", AD_User_ID=").append(impBP.getAD_User_ID()); + log.fine(msglog.toString()); if ( ! New_BPValue.equals(Old_BPValue)) { @@ -333,14 +334,15 @@ implements ImportProcess if (bp.save()) { - impBP.setC_BPartner_ID(bp.getC_BPartner_ID()); - log.finest("Insert BPartner - " + bp.getC_BPartner_ID()); + impBP.setC_BPartner_ID(bp.getC_BPartner_ID()); + msglog = new StringBuilder("Insert BPartner - ").append(bp.getC_BPartner_ID()); + log.finest(msglog.toString()); noInsert++; } else { - sql = new StringBuffer ("UPDATE I_BPartner i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||") + sql = new StringBuilder ("UPDATE I_BPartner i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||") .append("'Cannot Insert BPartner, ' ") .append("WHERE I_BPartner_ID=").append(impBP.getI_BPartner_ID()); DB.executeUpdateEx(sql.toString(), get_TrxName()); @@ -374,13 +376,14 @@ implements ImportProcess // if (bp.save()) { - log.finest("Update BPartner - " + bp.getC_BPartner_ID()); + msglog = new StringBuilder("Update BPartner - ").append(bp.getC_BPartner_ID()); + log.finest(msglog.toString()); noUpdate++; } else { - sql = new StringBuffer ("UPDATE I_BPartner i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||") + sql = new StringBuilder ("UPDATE I_BPartner i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||") .append("'Cannot Update BPartner, ' ") .append("WHERE I_BPartner_ID=").append(impBP.getI_BPartner_ID()); DB.executeUpdateEx(sql.toString(), get_TrxName()); @@ -425,14 +428,16 @@ implements ImportProcess location.setAddress2(impBP.getAddress2()); location.setPostal(impBP.getPostal()); location.setPostal_Add(impBP.getPostal_Add()); - if (location.save()) - log.finest("Insert Location - " + location.getC_Location_ID()); + if (location.save()){ + msglog = new StringBuilder("Insert Location - ").append(location.getC_Location_ID()); + log.finest(msglog.toString()); + } else { rollback(); noInsert--; - sql = new StringBuffer ("UPDATE I_BPartner i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||") + sql = new StringBuilder ("UPDATE I_BPartner i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||") .append("'Cannot Insert Location, ' ") .append("WHERE I_BPartner_ID=").append(impBP.getI_BPartner_ID()); DB.executeUpdateEx(sql.toString(), get_TrxName()); @@ -447,15 +452,16 @@ implements ImportProcess ModelValidationEngine.get().fireImportValidate(this, impBP, bpl, ImportValidator.TIMING_AFTER_IMPORT); if (bpl.save()) { - log.finest("Insert BP Location - " + bpl.getC_BPartner_Location_ID()); + msglog = new StringBuilder("Insert BP Location - ").append(bpl.getC_BPartner_Location_ID()); + log.finest(msglog.toString()); impBP.setC_BPartner_Location_ID(bpl.getC_BPartner_Location_ID()); } else { rollback(); noInsert--; - sql = new StringBuffer ("UPDATE I_BPartner i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||") + sql = new StringBuilder ("UPDATE I_BPartner i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||") .append("'Cannot Insert BPLocation, ' ") .append("WHERE I_BPartner_ID=").append(impBP.getI_BPartner_ID()); DB.executeUpdateEx(sql.toString(), get_TrxName()); @@ -477,8 +483,8 @@ implements ImportProcess { rollback(); noInsert--; - sql = new StringBuffer ("UPDATE I_BPartner i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||") + sql = new StringBuilder ("UPDATE I_BPartner i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||") .append("'BP of User <> BP, ' ") .append("WHERE I_BPartner_ID=").append(impBP.getI_BPartner_ID()); DB.executeUpdateEx(sql.toString(), get_TrxName()); @@ -511,14 +517,15 @@ implements ImportProcess ModelValidationEngine.get().fireImportValidate(this, impBP, user, ImportValidator.TIMING_AFTER_IMPORT); if (user.save()) { - log.finest("Update BP Contact - " + user.getAD_User_ID()); + msglog = new StringBuilder("Update BP Contact - ").append(user.getAD_User_ID()); + log.finest(msglog.toString()); } else { rollback(); noInsert--; - sql = new StringBuffer ("UPDATE I_BPartner i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||") + sql = new StringBuilder ("UPDATE I_BPartner i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||") .append("'Cannot Update BP Contact, ' ") .append("WHERE I_BPartner_ID=").append(impBP.getI_BPartner_ID()); DB.executeUpdateEx(sql.toString(), get_TrxName()); @@ -548,15 +555,16 @@ implements ImportProcess ModelValidationEngine.get().fireImportValidate(this, impBP, user, ImportValidator.TIMING_AFTER_IMPORT); if (user.save()) { - log.finest("Insert BP Contact - " + user.getAD_User_ID()); + msglog = new StringBuilder("Insert BP Contact - ").append(user.getAD_User_ID()); + log.finest(msglog.toString()); impBP.setAD_User_ID(user.getAD_User_ID()); } else { rollback(); noInsert--; - sql = new StringBuffer ("UPDATE I_BPartner i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||") + sql = new StringBuilder ("UPDATE I_BPartner i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||") .append("'Cannot Insert BPContact, ' ") .append("WHERE I_BPartner_ID=").append(impBP.getI_BPartner_ID()); DB.executeUpdateEx(sql.toString(), get_TrxName()); @@ -592,9 +600,9 @@ implements ImportProcess DB.close(rs, pstmt); rs = null; pstmt = null; // Set Error to indicator to not imported - sql = new StringBuffer ("UPDATE I_BPartner " - + "SET I_IsImported='N', Updated=SysDate " - + "WHERE I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_BPartner ") + .append("SET I_IsImported='N', Updated=SysDate ") + .append("WHERE I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); addLog (0, null, new BigDecimal (no), "@Errors@"); addLog (0, null, new BigDecimal (noInsert), "@C_BPartner_ID@: @Inserted@"); @@ -607,7 +615,8 @@ implements ImportProcess //@Override public String getWhereClause() { - return " AND AD_Client_ID=" + m_AD_Client_ID; + StringBuilder msgreturn = new StringBuilder(" AND AD_Client_ID=").append(m_AD_Client_ID); + return msgreturn.toString(); } diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportBankStatement.java b/org.adempiere.base.process/src/org/compiere/process/ImportBankStatement.java index 327147eed7..f608302731 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportBankStatement.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportBankStatement.java @@ -82,249 +82,250 @@ public class ImportBankStatement extends SvrProcess */ protected String doIt() throws java.lang.Exception { - log.info("AD_Org_ID=" + p_AD_Org_ID + ", C_BankAccount_ID" + p_C_BankAccount_ID); - StringBuffer sql = null; + StringBuilder msglog = new StringBuilder("AD_Org_ID=").append(p_AD_Org_ID).append(", C_BankAccount_ID").append(p_C_BankAccount_ID); + log.info(msglog.toString()); + StringBuilder sql = null; int no = 0; - String clientCheck = " AND AD_Client_ID=" + p_AD_Client_ID; + StringBuilder clientCheck = new StringBuilder(" AND AD_Client_ID=").append(p_AD_Client_ID); // **** Prepare **** // Delete Old Imported if (p_deleteOldImported) { - sql = new StringBuffer ("DELETE I_BankStatement " - + "WHERE I_IsImported='Y'").append (clientCheck); + sql = new StringBuilder ("DELETE I_BankStatement ") + .append("WHERE I_IsImported='Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Delete Old Impored =" + no); } // Set Client, Org, IsActive, Created/Updated - sql = new StringBuffer ("UPDATE I_BankStatement " - + "SET AD_Client_ID = COALESCE (AD_Client_ID,").append (p_AD_Client_ID).append (")," - + " AD_Org_ID = COALESCE (AD_Org_ID,").append (p_AD_Org_ID).append ("),"); - sql.append(" IsActive = COALESCE (IsActive, 'Y')," - + " Created = COALESCE (Created, SysDate)," - + " CreatedBy = COALESCE (CreatedBy, 0)," - + " Updated = COALESCE (Updated, SysDate)," - + " UpdatedBy = COALESCE (UpdatedBy, 0)," - + " I_ErrorMsg = ' '," - + " I_IsImported = 'N' " - + "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL OR AD_Client_ID IS NULL OR AD_Org_ID IS NULL OR AD_Client_ID=0 OR AD_Org_ID=0"); + sql = new StringBuilder ("UPDATE I_BankStatement ") + .append("SET AD_Client_ID = COALESCE (AD_Client_ID,").append (p_AD_Client_ID).append ("),") + .append(" AD_Org_ID = COALESCE (AD_Org_ID,").append (p_AD_Org_ID).append ("),"); + sql.append(" IsActive = COALESCE (IsActive, 'Y'),") + .append(" Created = COALESCE (Created, SysDate),") + .append(" CreatedBy = COALESCE (CreatedBy, 0),") + .append(" Updated = COALESCE (Updated, SysDate),") + .append(" UpdatedBy = COALESCE (UpdatedBy, 0),") + .append(" I_ErrorMsg = ' ',") + .append(" I_IsImported = 'N' ") + .append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL OR AD_Client_ID IS NULL OR AD_Org_ID IS NULL OR AD_Client_ID=0 OR AD_Org_ID=0"); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.info ("Reset=" + no); - sql = new StringBuffer ("UPDATE I_BankStatement o " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '" - + "WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0" - + " OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_BankStatement o ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '") + .append("WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0") + .append(" OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Org=" + no); // Set Bank Account - sql = new StringBuffer("UPDATE I_BankStatement i " - + "SET C_BankAccount_ID=" - + "( " - + " SELECT C_BankAccount_ID " - + " FROM C_BankAccount a, C_Bank b " - + " WHERE b.IsOwnBank='Y' " - + " AND a.AD_Client_ID=i.AD_Client_ID " - + " AND a.C_Bank_ID=b.C_Bank_ID " - + " AND a.AccountNo=i.BankAccountNo " - + " AND b.RoutingNo=i.RoutingNo " - + " OR b.SwiftCode=i.RoutingNo " - + ") " - + "WHERE i.C_BankAccount_ID IS NULL " - + "AND i.I_IsImported<>'Y' " - + "OR i.I_IsImported IS NULL").append(clientCheck); + sql = new StringBuilder("UPDATE I_BankStatement i ") + .append("SET C_BankAccount_ID=") + .append("( ") + .append(" SELECT C_BankAccount_ID ") + .append(" FROM C_BankAccount a, C_Bank b ") + .append(" WHERE b.IsOwnBank='Y' ") + .append(" AND a.AD_Client_ID=i.AD_Client_ID ") + .append(" AND a.C_Bank_ID=b.C_Bank_ID ") + .append(" AND a.AccountNo=i.BankAccountNo ") + .append(" AND b.RoutingNo=i.RoutingNo ") + .append(" OR b.SwiftCode=i.RoutingNo ") + .append(") ") + .append("WHERE i.C_BankAccount_ID IS NULL ") + .append("AND i.I_IsImported<>'Y' ") + .append("OR i.I_IsImported IS NULL").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Bank Account (With Routing No)=" + no); // - sql = new StringBuffer("UPDATE I_BankStatement i " - + "SET C_BankAccount_ID=" - + "( " - + " SELECT C_BankAccount_ID " - + " FROM C_BankAccount a, C_Bank b " - + " WHERE b.IsOwnBank='Y' " - + " AND a.C_Bank_ID=b.C_Bank_ID " - + " AND a.AccountNo=i.BankAccountNo " - + " AND a.AD_Client_ID=i.AD_Client_ID " - + ") " - + "WHERE i.C_BankAccount_ID IS NULL " - + "AND i.I_isImported<>'Y' " - + "OR i.I_isImported IS NULL").append(clientCheck); + sql = new StringBuilder("UPDATE I_BankStatement i ") + .append("SET C_BankAccount_ID=") + .append("( ") + .append(" SELECT C_BankAccount_ID ") + .append(" FROM C_BankAccount a, C_Bank b ") + .append(" WHERE b.IsOwnBank='Y' ") + .append(" AND a.C_Bank_ID=b.C_Bank_ID ") + .append(" AND a.AccountNo=i.BankAccountNo ") + .append(" AND a.AD_Client_ID=i.AD_Client_ID ") + .append(") ") + .append("WHERE i.C_BankAccount_ID IS NULL ") + .append("AND i.I_isImported<>'Y' ") + .append("OR i.I_isImported IS NULL").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Bank Account (Without Routing No)=" + no); // - sql = new StringBuffer("UPDATE I_BankStatement i " - + "SET C_BankAccount_ID=(SELECT C_BankAccount_ID FROM C_BankAccount a WHERE a.C_BankAccount_ID=").append(p_C_BankAccount_ID); - sql.append(" and a.AD_Client_ID=i.AD_Client_ID) " - + "WHERE i.C_BankAccount_ID IS NULL " - + "AND i.BankAccountNo IS NULL " - + "AND i.I_isImported<>'Y' " - + "OR i.I_isImported IS NULL").append(clientCheck); + sql = new StringBuilder("UPDATE I_BankStatement i ") + .append("SET C_BankAccount_ID=(SELECT C_BankAccount_ID FROM C_BankAccount a WHERE a.C_BankAccount_ID=").append(p_C_BankAccount_ID) + .append(" and a.AD_Client_ID=i.AD_Client_ID) ") + .append("WHERE i.C_BankAccount_ID IS NULL ") + .append("AND i.BankAccountNo IS NULL ") + .append("AND i.I_isImported<>'Y' ") + .append("OR i.I_isImported IS NULL").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Bank Account=" + no); // - sql = new StringBuffer("UPDATE I_BankStatement " - + "SET I_isImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Bank Account, ' " - + "WHERE C_BankAccount_ID IS NULL " - + "AND I_isImported<>'Y' " - + "OR I_isImported IS NULL").append(clientCheck); + sql = new StringBuilder("UPDATE I_BankStatement ") + .append("SET I_isImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Bank Account, ' ") + .append("WHERE C_BankAccount_ID IS NULL ") + .append("AND I_isImported<>'Y' ") + .append("OR I_isImported IS NULL").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning("Invalid Bank Account=" + no); // Set Currency - sql = new StringBuffer ("UPDATE I_BankStatement i " - + "SET C_Currency_ID=(SELECT C_Currency_ID FROM C_Currency c" - + " WHERE i.ISO_Code=c.ISO_Code AND c.AD_Client_ID IN (0,i.AD_Client_ID)) " - + "WHERE C_Currency_ID IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_BankStatement i ") + .append("SET C_Currency_ID=(SELECT C_Currency_ID FROM C_Currency c") + .append(" WHERE i.ISO_Code=c.ISO_Code AND c.AD_Client_ID IN (0,i.AD_Client_ID)) ") + .append("WHERE C_Currency_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Set Currency=" + no); // - sql = new StringBuffer("UPDATE I_BankStatement i " - + "SET C_Currency_ID=(SELECT C_Currency_ID FROM C_BankAccount WHERE C_BankAccount_ID=i.C_BankAccount_ID) " - + "WHERE i.C_Currency_ID IS NULL " - + "AND i.ISO_Code IS NULL").append(clientCheck); + sql = new StringBuilder("UPDATE I_BankStatement i ") + .append("SET C_Currency_ID=(SELECT C_Currency_ID FROM C_BankAccount WHERE C_BankAccount_ID=i.C_BankAccount_ID) ") + .append("WHERE i.C_Currency_ID IS NULL ") + .append("AND i.ISO_Code IS NULL").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Set Currency=" + no); // - sql = new StringBuffer ("UPDATE I_BankStatement " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Currency,' " - + "WHERE C_Currency_ID IS NULL " - + "AND I_IsImported<>'E' " - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_BankStatement ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Currency,' ") + .append("WHERE C_Currency_ID IS NULL ") + .append("AND I_IsImported<>'E' ") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning("Invalid Currency=" + no); // Set Amount - sql = new StringBuffer("UPDATE I_BankStatement " - + "SET ChargeAmt=0 " - + "WHERE ChargeAmt IS NULL " - + "AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder("UPDATE I_BankStatement ") + .append("SET ChargeAmt=0 ") + .append("WHERE ChargeAmt IS NULL ") + .append("AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Charge Amount=" + no); // - sql = new StringBuffer("UPDATE I_BankStatement " - + "SET InterestAmt=0 " - + "WHERE InterestAmt IS NULL " - + "AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder("UPDATE I_BankStatement ") + .append("SET InterestAmt=0 ") + .append("WHERE InterestAmt IS NULL ") + .append("AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Interest Amount=" + no); // - sql = new StringBuffer("UPDATE I_BankStatement " - + "SET TrxAmt=StmtAmt - InterestAmt - ChargeAmt " - + "WHERE TrxAmt IS NULL " - + "AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder("UPDATE I_BankStatement ") + .append("SET TrxAmt=StmtAmt - InterestAmt - ChargeAmt ") + .append("WHERE TrxAmt IS NULL ") + .append("AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Transaction Amount=" + no); // - sql = new StringBuffer("UPDATE I_BankStatement " - + "SET I_isImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Amount, ' " - + "WHERE TrxAmt + ChargeAmt + InterestAmt <> StmtAmt " - + "AND I_isImported<>'Y'").append(clientCheck); + sql = new StringBuilder("UPDATE I_BankStatement ") + .append("SET I_isImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Amount, ' ") + .append("WHERE TrxAmt + ChargeAmt + InterestAmt <> StmtAmt ") + .append("AND I_isImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Invaid Amount=" + no); // Set Valuta Date - sql = new StringBuffer("UPDATE I_BankStatement " - + "SET ValutaDate=StatementLineDate " - + "WHERE ValutaDate IS NULL " - + "AND I_isImported<>'Y'").append(clientCheck); + sql = new StringBuilder("UPDATE I_BankStatement ") + .append("SET ValutaDate=StatementLineDate ") + .append("WHERE ValutaDate IS NULL ") + .append("AND I_isImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Valuta Date=" + no); // Check Payment<->Invoice combination - sql = new StringBuffer("UPDATE I_BankStatement " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Payment<->Invoice, ' " - + "WHERE I_BankStatement_ID IN " - + "(SELECT I_BankStatement_ID " - + "FROM I_BankStatement i" - + " INNER JOIN C_Payment p ON (i.C_Payment_ID=p.C_Payment_ID) " - + "WHERE i.C_Invoice_ID IS NOT NULL " - + " AND p.C_Invoice_ID IS NOT NULL " - + " AND p.C_Invoice_ID<>i.C_Invoice_ID) ") + sql = new StringBuilder("UPDATE I_BankStatement ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Payment<->Invoice, ' ") + .append("WHERE I_BankStatement_ID IN ") + .append("(SELECT I_BankStatement_ID ") + .append("FROM I_BankStatement i") + .append(" INNER JOIN C_Payment p ON (i.C_Payment_ID=p.C_Payment_ID) ") + .append("WHERE i.C_Invoice_ID IS NOT NULL ") + .append(" AND p.C_Invoice_ID IS NOT NULL ") + .append(" AND p.C_Invoice_ID<>i.C_Invoice_ID) ") .append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Payment<->Invoice Mismatch=" + no); // Check Payment<->BPartner combination - sql = new StringBuffer("UPDATE I_BankStatement " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Payment<->BPartner, ' " - + "WHERE I_BankStatement_ID IN " - + "(SELECT I_BankStatement_ID " - + "FROM I_BankStatement i" - + " INNER JOIN C_Payment p ON (i.C_Payment_ID=p.C_Payment_ID) " - + "WHERE i.C_BPartner_ID IS NOT NULL " - + " AND p.C_BPartner_ID IS NOT NULL " - + " AND p.C_BPartner_ID<>i.C_BPartner_ID) ") + sql = new StringBuilder("UPDATE I_BankStatement ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Payment<->BPartner, ' ") + .append("WHERE I_BankStatement_ID IN ") + .append("(SELECT I_BankStatement_ID ") + .append("FROM I_BankStatement i") + .append(" INNER JOIN C_Payment p ON (i.C_Payment_ID=p.C_Payment_ID) ") + .append("WHERE i.C_BPartner_ID IS NOT NULL ") + .append(" AND p.C_BPartner_ID IS NOT NULL ") + .append(" AND p.C_BPartner_ID<>i.C_BPartner_ID) ") .append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Payment<->BPartner Mismatch=" + no); // Check Invoice<->BPartner combination - sql = new StringBuffer("UPDATE I_BankStatement " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Invoice<->BPartner, ' " - + "WHERE I_BankStatement_ID IN " - + "(SELECT I_BankStatement_ID " - + "FROM I_BankStatement i" - + " INNER JOIN C_Invoice v ON (i.C_Invoice_ID=v.C_Invoice_ID) " - + "WHERE i.C_BPartner_ID IS NOT NULL " - + " AND v.C_BPartner_ID IS NOT NULL " - + " AND v.C_BPartner_ID<>i.C_BPartner_ID) ") + sql = new StringBuilder("UPDATE I_BankStatement ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Invoice<->BPartner, ' ") + .append("WHERE I_BankStatement_ID IN ") + .append("(SELECT I_BankStatement_ID ") + .append("FROM I_BankStatement i") + .append(" INNER JOIN C_Invoice v ON (i.C_Invoice_ID=v.C_Invoice_ID) ") + .append("WHERE i.C_BPartner_ID IS NOT NULL ") + .append(" AND v.C_BPartner_ID IS NOT NULL ") + .append(" AND v.C_BPartner_ID<>i.C_BPartner_ID) ") .append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Invoice<->BPartner Mismatch=" + no); // Check Invoice.BPartner<->Payment.BPartner combination - sql = new StringBuffer("UPDATE I_BankStatement " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Invoice.BPartner<->Payment.BPartner, ' " - + "WHERE I_BankStatement_ID IN " - + "(SELECT I_BankStatement_ID " - + "FROM I_BankStatement i" - + " INNER JOIN C_Invoice v ON (i.C_Invoice_ID=v.C_Invoice_ID)" - + " INNER JOIN C_Payment p ON (i.C_Payment_ID=p.C_Payment_ID) " - + "WHERE p.C_Invoice_ID<>v.C_Invoice_ID" - + " AND v.C_BPartner_ID<>p.C_BPartner_ID) ") + sql = new StringBuilder("UPDATE I_BankStatement ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Invoice.BPartner<->Payment.BPartner, ' ") + .append("WHERE I_BankStatement_ID IN ") + .append("(SELECT I_BankStatement_ID ") + .append("FROM I_BankStatement i") + .append(" INNER JOIN C_Invoice v ON (i.C_Invoice_ID=v.C_Invoice_ID)") + .append(" INNER JOIN C_Payment p ON (i.C_Payment_ID=p.C_Payment_ID) ") + .append("WHERE p.C_Invoice_ID<>v.C_Invoice_ID") + .append(" AND v.C_BPartner_ID<>p.C_BPartner_ID) ") .append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Invoice.BPartner<->Payment.BPartner Mismatch=" + no); // Detect Duplicates - sql = new StringBuffer("SELECT i.I_BankStatement_ID, l.C_BankStatementLine_ID, i.EftTrxID " - + "FROM I_BankStatement i, C_BankStatement s, C_BankStatementLine l " - + "WHERE i.I_isImported='N' " - + "AND s.C_BankStatement_ID=l.C_BankStatement_ID " - + "AND i.EftTrxID IS NOT NULL AND " + sql = new StringBuilder("SELECT i.I_BankStatement_ID, l.C_BankStatementLine_ID, i.EftTrxID ") + .append("FROM I_BankStatement i, C_BankStatement s, C_BankStatementLine l ") + .append("WHERE i.I_isImported='N' ") + .append("AND s.C_BankStatement_ID=l.C_BankStatement_ID ") + .append("AND i.EftTrxID IS NOT NULL AND ") // Concatenate EFT Info - + "(l.EftTrxID||l.EftAmt||l.EftStatementLineDate||l.EftValutaDate||l.EftTrxType||l.EftCurrency||l.EftReference||s.EftStatementReference " - + "||l.EftCheckNo||l.EftMemo||l.EftPayee||l.EftPayeeAccount) " - + "= " - + "(i.EftTrxID||i.EftAmt||i.EftStatementLineDate||i.EftValutaDate||i.EftTrxType||i.EftCurrency||i.EftReference||i.EftStatementReference " - + "||i.EftCheckNo||i.EftMemo||i.EftPayee||i.EftPayeeAccount) "); + .append("(l.EftTrxID||l.EftAmt||l.EftStatementLineDate||l.EftValutaDate||l.EftTrxType||l.EftCurrency||l.EftReference||s.EftStatementReference ") + .append("||l.EftCheckNo||l.EftMemo||l.EftPayee||l.EftPayeeAccount) ") + .append("= ") + .append("(i.EftTrxID||i.EftAmt||i.EftStatementLineDate||i.EftValutaDate||i.EftTrxType||i.EftCurrency||i.EftReference||i.EftStatementReference ") + .append("||i.EftCheckNo||i.EftMemo||i.EftPayee||i.EftPayeeAccount) "); - StringBuffer updateSql = new StringBuffer("UPDATE I_Bankstatement " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Duplicate['||?||']' " - + "WHERE I_BankStatement_ID=?").append(clientCheck); + StringBuilder updateSql = new StringBuilder("UPDATE I_Bankstatement ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Duplicate['||?||']' ") + .append("WHERE I_BankStatement_ID=?").append(clientCheck); PreparedStatement pupdt = DB.prepareStatement(updateSql.toString(), get_TrxName()); PreparedStatement pstmtDuplicates = null; @@ -335,9 +336,9 @@ public class ImportBankStatement extends SvrProcess ResultSet rs = pstmtDuplicates.executeQuery(); while (rs.next()) { - String info = "Line_ID=" + rs.getInt(2) // l.C_BankStatementLine_ID - + ",EDTTrxID=" + rs.getString(3); // i.EftTrxID - pupdt.setString(1, info); + StringBuilder info = new StringBuilder("Line_ID=").append(rs.getInt(2)) // l.C_BankStatementLine_ID + .append(",EDTTrxID=").append(rs.getString(3)); // i.EftTrxID + pupdt.setString(1, info.toString()); pupdt.setInt(2, rs.getInt(1)); // i.I_BankStatement_ID pupdt.executeUpdate(); no++; @@ -360,9 +361,9 @@ public class ImportBankStatement extends SvrProcess commitEx(); //Import Bank Statement - sql = new StringBuffer("SELECT * FROM I_BankStatement" - + " WHERE I_IsImported='N'" - + " ORDER BY C_BankAccount_ID, Name, EftStatementDate, EftStatementReference"); + sql = new StringBuilder("SELECT * FROM I_BankStatement") + .append(" WHERE I_IsImported='N'") + .append(" ORDER BY C_BankAccount_ID, Name, EftStatementDate, EftStatementReference"); MBankStatement statement = null; MBankAccount account = null; @@ -383,14 +384,16 @@ public class ImportBankStatement extends SvrProcess { account = MBankAccount.get (m_ctx, imp.getC_BankAccount_ID()); statement = null; - log.info("New Statement, Account=" + account.getAccountNo()); + msglog = new StringBuilder("New Statement, Account=").append(account.getAccountNo()); + log.info(msglog.toString()); } // Create a new Bank Statement for every account else if (account.getC_BankAccount_ID() != imp.getC_BankAccount_ID()) { account = MBankAccount.get (m_ctx, imp.getC_BankAccount_ID()); statement = null; - log.info("New Statement, Account=" + account.getAccountNo()); + msglog = new StringBuilder("New Statement, Account=").append(account.getAccountNo()); + log.info(msglog.toString()); } // Create a new Bank Statement for every statement name else if ((statement.getName() != null) && (imp.getName() != null)) @@ -398,7 +401,8 @@ public class ImportBankStatement extends SvrProcess if (!statement.getName().equals(imp.getName())) { statement = null; - log.info("New Statement, Statement Name=" + imp.getName()); + msglog = new StringBuilder("New Statement, Statement Name=").append(imp.getName()); + log.info(msglog.toString()); } } // Create a new Bank Statement for every statement reference @@ -407,7 +411,8 @@ public class ImportBankStatement extends SvrProcess if (!statement.getEftStatementReference().equals(imp.getEftStatementReference())) { statement = null; - log.info("New Statement, Statement Reference=" + imp.getEftStatementReference()); + msglog = new StringBuilder("New Statement, Statement Reference=").append(imp.getEftStatementReference()); + log.info(msglog.toString()); } } // Create a new Bank Statement for every statement date @@ -416,7 +421,8 @@ public class ImportBankStatement extends SvrProcess if (!statement.getStatementDate().equals(imp.getStatementDate())) { statement = null; - log.info("New Statement, Statement Date=" + imp.getStatementDate()); + msglog = new StringBuilder("New Statement, Statement Date=").append(imp.getStatementDate()); + log.info(msglog.toString()); } } @@ -513,9 +519,9 @@ public class ImportBankStatement extends SvrProcess } // Set Error to indicator to not imported - sql = new StringBuffer ("UPDATE I_BankStatement " - + "SET I_IsImported='N', Updated=SysDate " - + "WHERE I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_BankStatement ") + .append("SET I_IsImported='N', Updated=SysDate ") + .append("WHERE I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); addLog (0, null, new BigDecimal (no), "@Errors@"); // diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportConversionRate.java b/org.adempiere.base.process/src/org/compiere/process/ImportConversionRate.java index b52a423dd8..21cccbb37d 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportConversionRate.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportConversionRate.java @@ -84,138 +84,139 @@ public class ImportConversionRate extends SvrProcess */ protected String doIt() throws Exception { - log.info("doIt - AD_Client_ID=" + p_AD_Client_ID - + ",AD_Org_ID=" + p_AD_Org_ID - + ",C_ConversionType_ID=" + p_C_ConversionType_ID - + ",ValidFrom=" + p_ValidFrom - + ",CreateReciprocalRate=" + p_CreateReciprocalRate); + StringBuilder msglog = new StringBuilder("doIt - AD_Client_ID=").append(p_AD_Client_ID) + .append(",AD_Org_ID=").append(p_AD_Org_ID) + .append(",C_ConversionType_ID=").append(p_C_ConversionType_ID) + .append(",ValidFrom=").append(p_ValidFrom) + .append(",CreateReciprocalRate=").append(p_CreateReciprocalRate); + log.info(msglog.toString()); // - StringBuffer sql = null; + StringBuilder sql = null; int no = 0; - String clientCheck = " AND AD_Client_ID=" + p_AD_Client_ID; + StringBuilder clientCheck = new StringBuilder(" AND AD_Client_ID=").append(p_AD_Client_ID); // **** Prepare **** // Delete Old Imported if (p_DeleteOldImported) { - sql = new StringBuffer ("DELETE I_Conversion_Rate " - + "WHERE I_IsImported='Y'").append (clientCheck); + sql = new StringBuilder ("DELETE I_Conversion_Rate ") + .append("WHERE I_IsImported='Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Delete Old Impored =" + no); } // Set Client, Org, Location, IsActive, Created/Updated - sql = new StringBuffer ("UPDATE I_Conversion_Rate " - + "SET AD_Client_ID = COALESCE (AD_Client_ID,").append (p_AD_Client_ID).append (")," - + " AD_Org_ID = COALESCE (AD_Org_ID,").append (p_AD_Org_ID).append ("),"); + sql = new StringBuilder ("UPDATE I_Conversion_Rate ") + .append("SET AD_Client_ID = COALESCE (AD_Client_ID,").append (p_AD_Client_ID).append ("),") + .append(" AD_Org_ID = COALESCE (AD_Org_ID,").append (p_AD_Org_ID).append ("),"); if (p_C_ConversionType_ID != 0) sql.append(" C_ConversionType_ID = COALESCE (C_ConversionType_ID,").append (p_C_ConversionType_ID).append ("),"); if (p_ValidFrom != null) sql.append(" ValidFrom = COALESCE (ValidFrom,").append (DB.TO_DATE(p_ValidFrom)).append ("),"); else sql.append(" ValidFrom = COALESCE (ValidFrom,SysDate),"); - sql.append(" CreateReciprocalRate = COALESCE (CreateReciprocalRate,'").append (p_CreateReciprocalRate ? "Y" : "N").append ("')," - + " IsActive = COALESCE (IsActive, 'Y')," - + " Created = COALESCE (Created, SysDate)," - + " CreatedBy = COALESCE (CreatedBy, 0)," - + " Updated = COALESCE (Updated, SysDate)," - + " UpdatedBy = ").append(getAD_User_ID()).append("," - + " I_ErrorMsg = ' '," - + " Processed = 'N'," - + " I_IsImported = 'N' " - + "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); + sql.append(" CreateReciprocalRate = COALESCE (CreateReciprocalRate,'").append (p_CreateReciprocalRate ? "Y" : "N").append ("'),") + .append(" IsActive = COALESCE (IsActive, 'Y'),") + .append(" Created = COALESCE (Created, SysDate),") + .append(" CreatedBy = COALESCE (CreatedBy, 0),") + .append(" Updated = COALESCE (Updated, SysDate),") + .append(" UpdatedBy = ").append(getAD_User_ID()).append(",") + .append(" I_ErrorMsg = ' ',") + .append(" Processed = 'N'," ) + .append(" I_IsImported = 'N' ") + .append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.info ("Reset =" + no); // Org - sql = new StringBuffer ("UPDATE I_Conversion_Rate o " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '" - + "WHERE (AD_Org_ID IS NULL" - + " OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Conversion_Rate o ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '") + .append("WHERE (AD_Org_ID IS NULL") + .append(" OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Org =" + no); // Conversion Type - sql = new StringBuffer ("UPDATE I_Conversion_Rate i " - + "SET C_ConversionType_ID = (SELECT C_ConversionType_ID FROM C_ConversionType c" - + " WHERE c.Value=i.ConversionTypeValue AND c.AD_Client_ID IN (0,i.AD_Client_ID) AND c.IsActive='Y') " - + "WHERE C_ConversionType_ID IS NULL AND ConversionTypeValue IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Conversion_Rate i ") + .append("SET C_ConversionType_ID = (SELECT C_ConversionType_ID FROM C_ConversionType c") + .append(" WHERE c.Value=i.ConversionTypeValue AND c.AD_Client_ID IN (0,i.AD_Client_ID) AND c.IsActive='Y') ") + .append("WHERE C_ConversionType_ID IS NULL AND ConversionTypeValue IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no > 0) log.fine("Set ConversionType =" + no); - sql = new StringBuffer ("UPDATE I_Conversion_Rate i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid ConversionType, ' " - + "WHERE (C_ConversionType_ID IS NULL" - + " OR NOT EXISTS (SELECT * FROM C_ConversionType c " - + "WHERE i.C_ConversionType_ID=c.C_ConversionType_ID AND c.IsActive='Y'" - + " AND c.AD_Client_ID IN (0,i.AD_Client_ID)))" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Conversion_Rate i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid ConversionType, ' ") + .append("WHERE (C_ConversionType_ID IS NULL") + .append(" OR NOT EXISTS (SELECT * FROM C_ConversionType c ") + .append("WHERE i.C_ConversionType_ID=c.C_ConversionType_ID AND c.IsActive='Y'") + .append(" AND c.AD_Client_ID IN (0,i.AD_Client_ID)))") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid ConversionType =" + no); // Currency - sql = new StringBuffer ("UPDATE I_Conversion_Rate i " - + "SET C_Currency_ID = (SELECT C_Currency_ID FROM C_Currency c" - + " WHERE c.ISO_Code=i.ISO_Code AND c.AD_Client_ID IN (0,i.AD_Client_ID) AND c.IsActive='Y') " - + "WHERE C_Currency_ID IS NULL AND ISO_Code IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Conversion_Rate i ") + .append("SET C_Currency_ID = (SELECT C_Currency_ID FROM C_Currency c") + .append(" WHERE c.ISO_Code=i.ISO_Code AND c.AD_Client_ID IN (0,i.AD_Client_ID) AND c.IsActive='Y') ") + .append("WHERE C_Currency_ID IS NULL AND ISO_Code IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no > 0) log.fine("Set Currency =" + no); - sql = new StringBuffer ("UPDATE I_Conversion_Rate i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Currency, ' " - + "WHERE (C_Currency_ID IS NULL" - + " OR NOT EXISTS (SELECT * FROM C_Currency c " - + "WHERE i.C_Currency_ID=c.C_Currency_ID AND c.IsActive='Y'" - + " AND c.AD_Client_ID IN (0,i.AD_Client_ID)))" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Conversion_Rate i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Currency, ' ") + .append("WHERE (C_Currency_ID IS NULL") + .append(" OR NOT EXISTS (SELECT * FROM C_Currency c ") + .append("WHERE i.C_Currency_ID=c.C_Currency_ID AND c.IsActive='Y'") + .append(" AND c.AD_Client_ID IN (0,i.AD_Client_ID)))") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Currency =" + no); // Currency To - sql = new StringBuffer ("UPDATE I_Conversion_Rate i " - + "SET C_Currency_ID_To = (SELECT C_Currency_ID FROM C_Currency c" - + " WHERE c.ISO_Code=i.ISO_Code_To AND c.AD_Client_ID IN (0,i.AD_Client_ID) AND c.IsActive='Y') " - + "WHERE C_Currency_ID_To IS NULL AND ISO_Code_To IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Conversion_Rate i ") + .append("SET C_Currency_ID_To = (SELECT C_Currency_ID FROM C_Currency c") + .append(" WHERE c.ISO_Code=i.ISO_Code_To AND c.AD_Client_ID IN (0,i.AD_Client_ID) AND c.IsActive='Y') ") + .append("WHERE C_Currency_ID_To IS NULL AND ISO_Code_To IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no > 0) log.fine("Set Currency To =" + no); - sql = new StringBuffer ("UPDATE I_Conversion_Rate i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Currency To, ' " - + "WHERE (C_Currency_ID_To IS NULL" - + " OR NOT EXISTS (SELECT * FROM C_Currency c " - + "WHERE i.C_Currency_ID_To=c.C_Currency_ID AND c.IsActive='Y'" - + " AND c.AD_Client_ID IN (0,i.AD_Client_ID)))" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Conversion_Rate i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Currency To, ' ") + .append("WHERE (C_Currency_ID_To IS NULL") + .append(" OR NOT EXISTS (SELECT * FROM C_Currency c ") + .append("WHERE i.C_Currency_ID_To=c.C_Currency_ID AND c.IsActive='Y'") + .append(" AND c.AD_Client_ID IN (0,i.AD_Client_ID)))") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Currency To =" + no); // Rates - sql = new StringBuffer ("UPDATE I_Conversion_Rate i " - + "SET MultiplyRate = 1 / DivideRate " - + "WHERE (MultiplyRate IS NULL OR MultiplyRate = 0) AND DivideRate IS NOT NULL AND DivideRate<>0" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Conversion_Rate i ") + .append("SET MultiplyRate = 1 / DivideRate ") + .append("WHERE (MultiplyRate IS NULL OR MultiplyRate = 0) AND DivideRate IS NOT NULL AND DivideRate<>0") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no > 0) log.fine("Set MultiplyRate =" + no); - sql = new StringBuffer ("UPDATE I_Conversion_Rate i " - + "SET DivideRate = 1 / MultiplyRate " - + "WHERE (DivideRate IS NULL OR DivideRate = 0) AND MultiplyRate IS NOT NULL AND MultiplyRate<>0" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Conversion_Rate i ") + .append("SET DivideRate = 1 / MultiplyRate ") + .append("WHERE (DivideRate IS NULL OR DivideRate = 0) AND MultiplyRate IS NOT NULL AND MultiplyRate<>0") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no > 0) log.fine("Set DivideRate =" + no); - sql = new StringBuffer ("UPDATE I_Conversion_Rate i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Rates, ' " - + "WHERE (MultiplyRate IS NULL OR MultiplyRate = 0 OR DivideRate IS NULL OR DivideRate = 0)" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Conversion_Rate i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Rates, ' ") + .append("WHERE (MultiplyRate IS NULL OR MultiplyRate = 0 OR DivideRate IS NULL OR DivideRate = 0)") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Rates =" + no); @@ -231,8 +232,8 @@ public class ImportConversionRate extends SvrProcess /*********************************************************************/ int noInsert = 0; - sql = new StringBuffer ("SELECT * FROM I_Conversion_Rate " - + "WHERE I_IsImported='N'").append (clientCheck) + sql = new StringBuilder ("SELECT * FROM I_Conversion_Rate ") + .append("WHERE I_IsImported='N'").append (clientCheck) .append(" ORDER BY C_Currency_ID, C_Currency_ID_To, ValidFrom"); PreparedStatement pstmt = null; try @@ -289,9 +290,9 @@ public class ImportConversionRate extends SvrProcess } // Set Error to indicator to not imported - sql = new StringBuffer ("UPDATE I_Conversion_Rate " - + "SET I_IsImported='N', Updated=SysDate " - + "WHERE I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Conversion_Rate ") + .append("SET I_IsImported='N', Updated=SysDate ") + .append("WHERE I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); addLog (0, null, new BigDecimal (no), "@Errors@"); // diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportDelete.java b/org.adempiere.base.process/src/org/compiere/process/ImportDelete.java index 21b3083104..24e794990a 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportDelete.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportDelete.java @@ -58,20 +58,25 @@ public class ImportDelete extends SvrProcess */ protected String doIt() throws Exception { - log.info("AD_Table_ID=" + p_AD_Table_ID); + StringBuilder msglog = new StringBuilder("AD_Table_ID=").append(p_AD_Table_ID); + log.info(msglog.toString()); // get Table Info MTable table = new MTable (getCtx(), p_AD_Table_ID, get_TrxName()); - if (table.get_ID() == 0) - throw new IllegalArgumentException ("No AD_Table_ID=" + p_AD_Table_ID); + if (table.get_ID() == 0){ + StringBuilder msgexc = new StringBuilder("No AD_Table_ID=").append(p_AD_Table_ID); + throw new IllegalArgumentException (msgexc.toString()); + } String tableName = table.getTableName(); - if (!tableName.startsWith("I")) - throw new IllegalArgumentException ("Not an import table = " + tableName); + if (!tableName.startsWith("I")){ + StringBuilder msgexc = new StringBuilder("Not an import table = ").append(tableName); + throw new IllegalArgumentException (msgexc.toString()); + } // Delete - String sql = "DELETE FROM " + tableName + " WHERE AD_Client_ID=" + getAD_Client_ID(); - int no = DB.executeUpdate(sql, get_TrxName()); - String msg = Msg.translate(getCtx(), tableName + "_ID") + " #" + no; - return msg; + StringBuilder sql = new StringBuilder("DELETE FROM ").append(tableName).append(" WHERE AD_Client_ID=").append(getAD_Client_ID()); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); + StringBuilder msg = new StringBuilder(Msg.translate(getCtx(), tableName + "_ID")).append(" #").append(no); + return msg.toString(); } // ImportDelete } // ImportDelete diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportGLJournal.java b/org.adempiere.base.process/src/org/compiere/process/ImportGLJournal.java index 54435b23ce..2c4a8e25cd 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportGLJournal.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportGLJournal.java @@ -95,271 +95,272 @@ public class ImportGLJournal extends SvrProcess */ protected String doIt() throws java.lang.Exception { - log.info("IsValidateOnly=" + m_IsValidateOnly + ", IsImportOnlyNoErrors=" + m_IsImportOnlyNoErrors); - StringBuffer sql = null; + StringBuilder msglog = new StringBuilder("IsValidateOnly=").append(m_IsValidateOnly).append(", IsImportOnlyNoErrors=").append(m_IsImportOnlyNoErrors); + log.info(msglog.toString()); + StringBuilder sql = null; int no = 0; - String clientCheck = " AND AD_Client_ID=" + m_AD_Client_ID; + StringBuilder clientCheck = new StringBuilder(" AND AD_Client_ID=").append(m_AD_Client_ID); // **** Prepare **** // Delete Old Imported if (m_DeleteOldImported) { - sql = new StringBuffer ("DELETE I_GLJournal " - + "WHERE I_IsImported='Y'").append (clientCheck); + sql = new StringBuilder ("DELETE I_GLJournal ") + .append("WHERE I_IsImported='Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Delete Old Impored =" + no); } // Set IsActive, Created/Updated - sql = new StringBuffer ("UPDATE I_GLJournal " - + "SET IsActive = COALESCE (IsActive, 'Y')," - + " Created = COALESCE (Created, SysDate)," - + " CreatedBy = COALESCE (CreatedBy, 0)," - + " Updated = COALESCE (Updated, SysDate)," - + " UpdatedBy = COALESCE (UpdatedBy, 0)," - + " I_ErrorMsg = ' '," - + " I_IsImported = 'N' " - + "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); + sql = new StringBuilder ("UPDATE I_GLJournal ") + .append("SET IsActive = COALESCE (IsActive, 'Y'),") + .append(" Created = COALESCE (Created, SysDate),") + .append(" CreatedBy = COALESCE (CreatedBy, 0),") + .append(" Updated = COALESCE (Updated, SysDate),") + .append(" UpdatedBy = COALESCE (UpdatedBy, 0),") + .append(" I_ErrorMsg = ' ',") + .append(" I_IsImported = 'N' ") + .append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.info ("Reset=" + no); // Set Client from Name - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET AD_Client_ID=(SELECT c.AD_Client_ID FROM AD_Client c WHERE c.Value=i.ClientValue) " - + "WHERE (AD_Client_ID IS NULL OR AD_Client_ID=0) AND ClientValue IS NOT NULL" - + " AND I_IsImported<>'Y'"); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET AD_Client_ID=(SELECT c.AD_Client_ID FROM AD_Client c WHERE c.Value=i.ClientValue) ") + .append("WHERE (AD_Client_ID IS NULL OR AD_Client_ID=0) AND ClientValue IS NOT NULL") + .append(" AND I_IsImported<>'Y'"); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Client from Value=" + no); // Set Default Client, Doc Org, AcctSchema, DatAcct - sql = new StringBuffer ("UPDATE I_GLJournal " - + "SET AD_Client_ID = COALESCE (AD_Client_ID,").append (m_AD_Client_ID).append (")," - + " AD_OrgDoc_ID = COALESCE (AD_OrgDoc_ID,").append (m_AD_Org_ID).append ("),"); + sql = new StringBuilder ("UPDATE I_GLJournal ") + .append("SET AD_Client_ID = COALESCE (AD_Client_ID,").append (m_AD_Client_ID).append ("),") + .append(" AD_OrgDoc_ID = COALESCE (AD_OrgDoc_ID,").append (m_AD_Org_ID).append ("),"); if (m_C_AcctSchema_ID != 0) sql.append(" C_AcctSchema_ID = COALESCE (C_AcctSchema_ID,").append (m_C_AcctSchema_ID).append ("),"); if (m_DateAcct != null) sql.append(" DateAcct = COALESCE (DateAcct,").append (DB.TO_DATE(m_DateAcct)).append ("),"); - sql.append(" Updated = COALESCE (Updated, SysDate) " - + "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); + sql.append(" Updated = COALESCE (Updated, SysDate) ") + .append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Client/DocOrg/Default=" + no); // Error Doc Org - sql = new StringBuffer ("UPDATE I_GLJournal o " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Doc Org, '" - + "WHERE (AD_OrgDoc_ID IS NULL OR AD_OrgDoc_ID=0" - + " OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_OrgDoc_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal o ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Doc Org, '") + .append("WHERE (AD_OrgDoc_ID IS NULL OR AD_OrgDoc_ID=0") + .append(" OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_OrgDoc_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Doc Org=" + no); // Set AcctSchema - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET C_AcctSchema_ID=(SELECT a.C_AcctSchema_ID FROM C_AcctSchema a" - + " WHERE i.AcctSchemaName=a.Name AND i.AD_Client_ID=a.AD_Client_ID) " - + "WHERE C_AcctSchema_ID IS NULL AND AcctSchemaName IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET C_AcctSchema_ID=(SELECT a.C_AcctSchema_ID FROM C_AcctSchema a") + .append(" WHERE i.AcctSchemaName=a.Name AND i.AD_Client_ID=a.AD_Client_ID) ") + .append("WHERE C_AcctSchema_ID IS NULL AND AcctSchemaName IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set AcctSchema from Name=" + no); - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET C_AcctSchema_ID=(SELECT c.C_AcctSchema1_ID FROM AD_ClientInfo c WHERE c.AD_Client_ID=i.AD_Client_ID) " - + "WHERE C_AcctSchema_ID IS NULL AND AcctSchemaName IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET C_AcctSchema_ID=(SELECT c.C_AcctSchema1_ID FROM AD_ClientInfo c WHERE c.AD_Client_ID=i.AD_Client_ID) ") + .append("WHERE C_AcctSchema_ID IS NULL AND AcctSchemaName IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set AcctSchema from Client=" + no); // Error AcctSchema - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid AcctSchema, '" - + "WHERE (C_AcctSchema_ID IS NULL OR C_AcctSchema_ID=0" - + " OR NOT EXISTS (SELECT * FROM C_AcctSchema a WHERE i.AD_Client_ID=a.AD_Client_ID))" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid AcctSchema, '") + .append("WHERE (C_AcctSchema_ID IS NULL OR C_AcctSchema_ID=0") + .append(" OR NOT EXISTS (SELECT * FROM C_AcctSchema a WHERE i.AD_Client_ID=a.AD_Client_ID))") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid AcctSchema=" + no); // Set DateAcct (mandatory) - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET DateAcct=SysDate " - + "WHERE DateAcct IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET DateAcct=SysDate ") + .append("WHERE DateAcct IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set DateAcct=" + no); // Document Type - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET C_DocType_ID=(SELECT d.C_DocType_ID FROM C_DocType d" - + " WHERE d.Name=i.DocTypeName AND d.DocBaseType='GLJ' AND i.AD_Client_ID=d.AD_Client_ID) " - + "WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET C_DocType_ID=(SELECT d.C_DocType_ID FROM C_DocType d") + .append(" WHERE d.Name=i.DocTypeName AND d.DocBaseType='GLJ' AND i.AD_Client_ID=d.AD_Client_ID) ") + .append("WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set DocType=" + no); - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid DocType, '" - + "WHERE (C_DocType_ID IS NULL OR C_DocType_ID=0" - + " OR NOT EXISTS (SELECT * FROM C_DocType d WHERE i.AD_Client_ID=d.AD_Client_ID AND d.DocBaseType='GLJ'))" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid DocType, '") + .append("WHERE (C_DocType_ID IS NULL OR C_DocType_ID=0") + .append(" OR NOT EXISTS (SELECT * FROM C_DocType d WHERE i.AD_Client_ID=d.AD_Client_ID AND d.DocBaseType='GLJ'))") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid DocType=" + no); // GL Category - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET GL_Category_ID=(SELECT c.GL_Category_ID FROM GL_Category c" - + " WHERE c.Name=i.CategoryName AND i.AD_Client_ID=c.AD_Client_ID) " - + "WHERE GL_Category_ID IS NULL AND CategoryName IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET GL_Category_ID=(SELECT c.GL_Category_ID FROM GL_Category c") + .append(" WHERE c.Name=i.CategoryName AND i.AD_Client_ID=c.AD_Client_ID) ") + .append("WHERE GL_Category_ID IS NULL AND CategoryName IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set DocType=" + no); - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Category, '" - + "WHERE (GL_Category_ID IS NULL OR GL_Category_ID=0)" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Category, '") + .append("WHERE (GL_Category_ID IS NULL OR GL_Category_ID=0)") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid GLCategory=" + no); // Set Currency - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET C_Currency_ID=(SELECT c.C_Currency_ID FROM C_Currency c" - + " WHERE c.ISO_Code=i.ISO_Code AND c.AD_Client_ID IN (0,i.AD_Client_ID)) " - + "WHERE C_Currency_ID IS NULL AND ISO_Code IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET C_Currency_ID=(SELECT c.C_Currency_ID FROM C_Currency c") + .append(" WHERE c.ISO_Code=i.ISO_Code AND c.AD_Client_ID IN (0,i.AD_Client_ID)) ") + .append("WHERE C_Currency_ID IS NULL AND ISO_Code IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Currency from ISO=" + no); - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET C_Currency_ID=(SELECT a.C_Currency_ID FROM C_AcctSchema a" - + " WHERE a.C_AcctSchema_ID=i.C_AcctSchema_ID AND a.AD_Client_ID=i.AD_Client_ID)" - + "WHERE C_Currency_ID IS NULL AND ISO_Code IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET C_Currency_ID=(SELECT a.C_Currency_ID FROM C_AcctSchema a") + .append(" WHERE a.C_AcctSchema_ID=i.C_AcctSchema_ID AND a.AD_Client_ID=i.AD_Client_ID)") + .append("WHERE C_Currency_ID IS NULL AND ISO_Code IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Default Currency=" + no); - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Currency, '" - + "WHERE (C_Currency_ID IS NULL OR C_Currency_ID=0)" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Currency, '") + .append("WHERE (C_Currency_ID IS NULL OR C_Currency_ID=0)") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Currency=" + no); // Set Conversion Type - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET ConversionTypeValue='S' " - + "WHERE C_ConversionType_ID IS NULL AND ConversionTypeValue IS NULL" - + " AND I_IsImported='N'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET ConversionTypeValue='S' ") + .append("WHERE C_ConversionType_ID IS NULL AND ConversionTypeValue IS NULL") + .append(" AND I_IsImported='N'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set CurrencyType Value to Spot =" + no); - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET C_ConversionType_ID=(SELECT c.C_ConversionType_ID FROM C_ConversionType c" - + " WHERE c.Value=i.ConversionTypeValue AND c.AD_Client_ID IN (0,i.AD_Client_ID)) " - + "WHERE C_ConversionType_ID IS NULL AND ConversionTypeValue IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET C_ConversionType_ID=(SELECT c.C_ConversionType_ID FROM C_ConversionType c") + .append(" WHERE c.Value=i.ConversionTypeValue AND c.AD_Client_ID IN (0,i.AD_Client_ID)) ") + .append("WHERE C_ConversionType_ID IS NULL AND ConversionTypeValue IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set CurrencyType from Value=" + no); - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid CurrencyType, '" - + "WHERE (C_ConversionType_ID IS NULL OR C_ConversionType_ID=0) AND ConversionTypeValue IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid CurrencyType, '") + .append("WHERE (C_ConversionType_ID IS NULL OR C_ConversionType_ID=0) AND ConversionTypeValue IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid CurrencyTypeValue=" + no); - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No ConversionType, '" - + "WHERE (C_ConversionType_ID IS NULL OR C_ConversionType_ID=0)" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No ConversionType, '") + .append("WHERE (C_ConversionType_ID IS NULL OR C_ConversionType_ID=0)") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("No CourrencyType=" + no); // Set/Overwrite Home Currency Rate - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET CurrencyRate=1" - + "WHERE EXISTS (SELECT * FROM C_AcctSchema a" - + " WHERE a.C_AcctSchema_ID=i.C_AcctSchema_ID AND a.C_Currency_ID=i.C_Currency_ID)" - + " AND C_Currency_ID IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET CurrencyRate=1") + .append("WHERE EXISTS (SELECT * FROM C_AcctSchema a") + .append(" WHERE a.C_AcctSchema_ID=i.C_AcctSchema_ID AND a.C_Currency_ID=i.C_Currency_ID)") + .append(" AND C_Currency_ID IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Home CurrencyRate=" + no); // Set Currency Rate - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET CurrencyRate=(SELECT MAX(r.MultiplyRate) FROM C_Conversion_Rate r, C_AcctSchema s" - + " WHERE s.C_AcctSchema_ID=i.C_AcctSchema_ID AND s.AD_Client_ID=i.AD_Client_ID" - + " AND r.C_Currency_ID=i.C_Currency_ID AND r.C_Currency_ID_TO=s.C_Currency_ID" - + " AND r.AD_Client_ID=i.AD_Client_ID AND r.AD_Org_ID=i.AD_OrgDoc_ID" - + " AND r.C_ConversionType_ID=i.C_ConversionType_ID" - + " AND i.DateAcct BETWEEN r.ValidFrom AND r.ValidTo " + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET CurrencyRate=(SELECT MAX(r.MultiplyRate) FROM C_Conversion_Rate r, C_AcctSchema s") + .append(" WHERE s.C_AcctSchema_ID=i.C_AcctSchema_ID AND s.AD_Client_ID=i.AD_Client_ID") + .append(" AND r.C_Currency_ID=i.C_Currency_ID AND r.C_Currency_ID_TO=s.C_Currency_ID") + .append(" AND r.AD_Client_ID=i.AD_Client_ID AND r.AD_Org_ID=i.AD_OrgDoc_ID") + .append(" AND r.C_ConversionType_ID=i.C_ConversionType_ID") + .append(" AND i.DateAcct BETWEEN r.ValidFrom AND r.ValidTo ") // ORDER BY ValidFrom DESC - + ") WHERE CurrencyRate IS NULL OR CurrencyRate=0 AND C_Currency_ID>0" - + " AND I_IsImported<>'Y'").append (clientCheck); + .append(") WHERE CurrencyRate IS NULL OR CurrencyRate=0 AND C_Currency_ID>0") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Org Rate=" + no); - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET CurrencyRate=(SELECT MAX(r.MultiplyRate) FROM C_Conversion_Rate r, C_AcctSchema s" - + " WHERE s.C_AcctSchema_ID=i.C_AcctSchema_ID AND s.AD_Client_ID=i.AD_Client_ID" - + " AND r.C_Currency_ID=i.C_Currency_ID AND r.C_Currency_ID_TO=s.C_Currency_ID" - + " AND r.AD_Client_ID=i.AD_Client_ID" - + " AND r.C_ConversionType_ID=i.C_ConversionType_ID" - + " AND i.DateAcct BETWEEN r.ValidFrom AND r.ValidTo " + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET CurrencyRate=(SELECT MAX(r.MultiplyRate) FROM C_Conversion_Rate r, C_AcctSchema s") + .append(" WHERE s.C_AcctSchema_ID=i.C_AcctSchema_ID AND s.AD_Client_ID=i.AD_Client_ID") + .append(" AND r.C_Currency_ID=i.C_Currency_ID AND r.C_Currency_ID_TO=s.C_Currency_ID") + .append(" AND r.AD_Client_ID=i.AD_Client_ID") + .append(" AND r.C_ConversionType_ID=i.C_ConversionType_ID") + .append(" AND i.DateAcct BETWEEN r.ValidFrom AND r.ValidTo ") // ORDER BY ValidFrom DESC - + ") WHERE CurrencyRate IS NULL OR CurrencyRate=0 AND C_Currency_ID>0" - + " AND I_IsImported<>'Y'").append (clientCheck); + .append(") WHERE CurrencyRate IS NULL OR CurrencyRate=0 AND C_Currency_ID>0") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Client Rate=" + no); - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Rate, '" - + "WHERE CurrencyRate IS NULL OR CurrencyRate=0" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Rate, '") + .append("WHERE CurrencyRate IS NULL OR CurrencyRate=0") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("No Rate=" + no); // Set Period - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET C_Period_ID=(SELECT MAX(p.C_Period_ID) FROM C_Period p" - + " INNER JOIN C_Year y ON (y.C_Year_ID=p.C_Year_ID)" - + " INNER JOIN AD_ClientInfo c ON (c.C_Calendar_ID=y.C_Calendar_ID)" - + " WHERE c.AD_Client_ID=i.AD_Client_ID" + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET C_Period_ID=(SELECT MAX(p.C_Period_ID) FROM C_Period p") + .append(" INNER JOIN C_Year y ON (y.C_Year_ID=p.C_Year_ID)") + .append(" INNER JOIN AD_ClientInfo c ON (c.C_Calendar_ID=y.C_Calendar_ID)") + .append(" WHERE c.AD_Client_ID=i.AD_Client_ID") // globalqss - cruiz - Bug [ 1577712 ] Financial Period Bug - + " AND i.DateAcct BETWEEN p.StartDate AND p.EndDate AND p.IsActive='Y' AND p.PeriodType='S') " - + "WHERE C_Period_ID IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + .append(" AND i.DateAcct BETWEEN p.StartDate AND p.EndDate AND p.IsActive='Y' AND p.PeriodType='S') ") + .append("WHERE C_Period_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Period=" + no); - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Period, '" - + "WHERE C_Period_ID IS NULL OR C_Period_ID NOT IN" - + "(SELECT C_Period_ID FROM C_Period p" - + " INNER JOIN C_Year y ON (y.C_Year_ID=p.C_Year_ID)" - + " INNER JOIN AD_ClientInfo c ON (c.C_Calendar_ID=y.C_Calendar_ID) " - + " WHERE c.AD_Client_ID=i.AD_Client_ID" + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Period, '") + .append("WHERE C_Period_ID IS NULL OR C_Period_ID NOT IN") + .append("(SELECT C_Period_ID FROM C_Period p") + .append(" INNER JOIN C_Year y ON (y.C_Year_ID=p.C_Year_ID)") + .append(" INNER JOIN AD_ClientInfo c ON (c.C_Calendar_ID=y.C_Calendar_ID) ") + .append(" WHERE c.AD_Client_ID=i.AD_Client_ID") // globalqss - cruiz - Bug [ 1577712 ] Financial Period Bug - + " AND i.DateAcct BETWEEN p.StartDate AND p.EndDate AND p.IsActive='Y' AND p.PeriodType='S')" - + " AND I_IsImported<>'Y'").append (clientCheck); + .append(" AND i.DateAcct BETWEEN p.StartDate AND p.EndDate AND p.IsActive='Y' AND p.PeriodType='S')") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Period=" + no); - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET I_ErrorMsg=I_ErrorMsg||'WARN=Period Closed, ' " - + "WHERE C_Period_ID IS NOT NULL AND NOT EXISTS" - + " (SELECT * FROM C_PeriodControl pc WHERE pc.C_Period_ID=i.C_Period_ID AND DocBaseType='GLJ' AND PeriodStatus='O') " - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET I_ErrorMsg=I_ErrorMsg||'WARN=Period Closed, ' ") + .append("WHERE C_Period_ID IS NOT NULL AND NOT EXISTS") + .append(" (SELECT * FROM C_PeriodControl pc WHERE pc.C_Period_ID=i.C_Period_ID AND DocBaseType='GLJ' AND PeriodStatus='O') ") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Period Closed=" + no); // Posting Type - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET PostingType='A' " - + "WHERE PostingType IS NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET PostingType='A' ") + .append("WHERE PostingType IS NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Actual PostingType=" + no); - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid PostingType, ' " - + "WHERE PostingType IS NULL OR NOT EXISTS" - + " (SELECT * FROM AD_Ref_List r WHERE r.AD_Reference_ID=125 AND i.PostingType=r.Value)" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid PostingType, ' ") + .append("WHERE PostingType IS NULL OR NOT EXISTS") + .append(" (SELECT * FROM AD_Ref_List r WHERE r.AD_Reference_ID=125 AND i.PostingType=r.Value)") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid PostingTypee=" + no); @@ -369,152 +370,152 @@ public class ImportGLJournal extends SvrProcess // (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) // Set Org from Name (* is overwritten and default) - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET AD_Org_ID=COALESCE((SELECT o.AD_Org_ID FROM AD_Org o" - + " WHERE o.Value=i.OrgValue AND o.IsSummary='N' AND i.AD_Client_ID=o.AD_Client_ID),AD_Org_ID) " - + "WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0) AND OrgValue IS NOT NULL" - + " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'"); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET AD_Org_ID=COALESCE((SELECT o.AD_Org_ID FROM AD_Org o") + .append(" WHERE o.Value=i.OrgValue AND o.IsSummary='N' AND i.AD_Client_ID=o.AD_Client_ID),AD_Org_ID) ") + .append("WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0) AND OrgValue IS NOT NULL") + .append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'"); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Org from Value=" + no); - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET AD_Org_ID=AD_OrgDoc_ID " - + "WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0) AND OrgValue IS NULL AND AD_OrgDoc_ID IS NOT NULL AND AD_OrgDoc_ID<>0" - + " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET AD_Org_ID=AD_OrgDoc_ID ") + .append("WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0) AND OrgValue IS NULL AND AD_OrgDoc_ID IS NOT NULL AND AD_OrgDoc_ID<>0") + .append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Org from Doc Org=" + no); // Error Org - sql = new StringBuffer ("UPDATE I_GLJournal o " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '" - + "WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0" - + " OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))" - + " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal o ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '") + .append("WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0") + .append(" OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))") + .append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Org=" + no); // Set Account - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET Account_ID=(SELECT MAX(ev.C_ElementValue_ID) FROM C_ElementValue ev" - + " INNER JOIN C_Element e ON (e.C_Element_ID=ev.C_Element_ID)" - + " INNER JOIN C_AcctSchema_Element ase ON (e.C_Element_ID=ase.C_Element_ID AND ase.ElementType='AC')" - + " WHERE ev.Value=i.AccountValue AND ev.IsSummary='N'" - + " AND i.C_AcctSchema_ID=ase.C_AcctSchema_ID AND i.AD_Client_ID=ev.AD_Client_ID) " - + "WHERE Account_ID IS NULL AND AccountValue IS NOT NULL" - + " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET Account_ID=(SELECT MAX(ev.C_ElementValue_ID) FROM C_ElementValue ev") + .append(" INNER JOIN C_Element e ON (e.C_Element_ID=ev.C_Element_ID)") + .append(" INNER JOIN C_AcctSchema_Element ase ON (e.C_Element_ID=ase.C_Element_ID AND ase.ElementType='AC')") + .append(" WHERE ev.Value=i.AccountValue AND ev.IsSummary='N'") + .append(" AND i.C_AcctSchema_ID=ase.C_AcctSchema_ID AND i.AD_Client_ID=ev.AD_Client_ID) ") + .append("WHERE Account_ID IS NULL AND AccountValue IS NOT NULL") + .append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Account from Value=" + no); - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Account, '" - + "WHERE (Account_ID IS NULL OR Account_ID=0)" - + " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Account, '") + .append("WHERE (Account_ID IS NULL OR Account_ID=0)") + .append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Account=" + no); // Set BPartner - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET C_BPartner_ID=(SELECT bp.C_BPartner_ID FROM C_BPartner bp" - + " WHERE bp.Value=i.BPartnerValue AND bp.IsSummary='N' AND i.AD_Client_ID=bp.AD_Client_ID) " - + "WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NOT NULL" - + " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET C_BPartner_ID=(SELECT bp.C_BPartner_ID FROM C_BPartner bp") + .append(" WHERE bp.Value=i.BPartnerValue AND bp.IsSummary='N' AND i.AD_Client_ID=bp.AD_Client_ID) ") + .append("WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NOT NULL") + .append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set BPartner from Value=" + no); - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid BPartner, '" - + "WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NOT NULL" - + " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid BPartner, '") + .append("WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NOT NULL") + .append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid BPartner=" + no); // Set Product - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET M_Product_ID=(SELECT MAX(p.M_Product_ID) FROM M_Product p" - + " WHERE (p.Value=i.ProductValue OR p.UPC=i.UPC OR p.SKU=i.SKU)" - + " AND p.IsSummary='N' AND i.AD_Client_ID=p.AD_Client_ID) " - + "WHERE M_Product_ID IS NULL AND (ProductValue IS NOT NULL OR UPC IS NOT NULL OR SKU IS NOT NULL)" - + " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET M_Product_ID=(SELECT MAX(p.M_Product_ID) FROM M_Product p") + .append(" WHERE (p.Value=i.ProductValue OR p.UPC=i.UPC OR p.SKU=i.SKU)") + .append(" AND p.IsSummary='N' AND i.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE M_Product_ID IS NULL AND (ProductValue IS NOT NULL OR UPC IS NOT NULL OR SKU IS NOT NULL)") + .append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Product from Value=" + no); - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Product, '" - + "WHERE M_Product_ID IS NULL AND (ProductValue IS NOT NULL OR UPC IS NOT NULL OR SKU IS NOT NULL)" - + " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Product, '") + .append("WHERE M_Product_ID IS NULL AND (ProductValue IS NOT NULL OR UPC IS NOT NULL OR SKU IS NOT NULL)") + .append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Product=" + no); // Set Project - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET C_Project_ID=(SELECT p.C_Project_ID FROM C_Project p" - + " WHERE p.Value=i.ProjectValue AND p.IsSummary='N' AND i.AD_Client_ID=p.AD_Client_ID) " - + "WHERE C_Project_ID IS NULL AND ProjectValue IS NOT NULL" - + " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET C_Project_ID=(SELECT p.C_Project_ID FROM C_Project p") + .append(" WHERE p.Value=i.ProjectValue AND p.IsSummary='N' AND i.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE C_Project_ID IS NULL AND ProjectValue IS NOT NULL") + .append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Project from Value=" + no); - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Project, '" - + "WHERE C_Project_ID IS NULL AND ProjectValue IS NOT NULL" - + " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Project, '") + .append("WHERE C_Project_ID IS NULL AND ProjectValue IS NOT NULL") + .append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Project=" + no); // Set TrxOrg - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET AD_OrgTrx_ID=(SELECT o.AD_Org_ID FROM AD_Org o" - + " WHERE o.Value=i.OrgValue AND o.IsSummary='N' AND i.AD_Client_ID=o.AD_Client_ID) " - + "WHERE AD_OrgTrx_ID IS NULL AND OrgTrxValue IS NOT NULL" - + " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET AD_OrgTrx_ID=(SELECT o.AD_Org_ID FROM AD_Org o") + .append(" WHERE o.Value=i.OrgValue AND o.IsSummary='N' AND i.AD_Client_ID=o.AD_Client_ID) ") + .append("WHERE AD_OrgTrx_ID IS NULL AND OrgTrxValue IS NOT NULL") + .append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set OrgTrx from Value=" + no); - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid OrgTrx, '" - + "WHERE AD_OrgTrx_ID IS NULL AND OrgTrxValue IS NOT NULL" - + " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid OrgTrx, '") + .append("WHERE AD_OrgTrx_ID IS NULL AND OrgTrxValue IS NOT NULL") + .append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid OrgTrx=" + no); // Source Amounts - sql = new StringBuffer ("UPDATE I_GLJournal " - + "SET AmtSourceDr = 0 " - + "WHERE AmtSourceDr IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal ") + .append("SET AmtSourceDr = 0 ") + .append("WHERE AmtSourceDr IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set 0 Source Dr=" + no); - sql = new StringBuffer ("UPDATE I_GLJournal " - + "SET AmtSourceCr = 0 " - + "WHERE AmtSourceCr IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal ") + .append("SET AmtSourceCr = 0 ") + .append("WHERE AmtSourceCr IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set 0 Source Cr=" + no); - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET I_ErrorMsg=I_ErrorMsg||'WARN=Zero Source Balance, ' " - + "WHERE (AmtSourceDr-AmtSourceCr)=0" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET I_ErrorMsg=I_ErrorMsg||'WARN=Zero Source Balance, ' ") + .append("WHERE (AmtSourceDr-AmtSourceCr)=0") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Zero Source Balance=" + no); // Accounted Amounts (Only if No Error) - sql = new StringBuffer ("UPDATE I_GLJournal " - + "SET AmtAcctDr = ROUND(AmtSourceDr * CurrencyRate, 2) " // HARDCODED rounding - + "WHERE AmtAcctDr IS NULL OR AmtAcctDr=0" - + " AND I_IsImported='N'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal ") + .append("SET AmtAcctDr = ROUND(AmtSourceDr * CurrencyRate, 2) ") // HARDCODED rounding + .append("WHERE AmtAcctDr IS NULL OR AmtAcctDr=0") + .append(" AND I_IsImported='N'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Calculate Acct Dr=" + no); - sql = new StringBuffer ("UPDATE I_GLJournal " - + "SET AmtAcctCr = ROUND(AmtSourceCr * CurrencyRate, 2) " - + "WHERE AmtAcctCr IS NULL OR AmtAcctCr=0" - + " AND I_IsImported='N'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal ") + .append("SET AmtAcctCr = ROUND(AmtSourceCr * CurrencyRate, 2) ") + .append("WHERE AmtAcctCr IS NULL OR AmtAcctCr=0") + .append(" AND I_IsImported='N'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Calculate Acct Cr=" + no); - sql = new StringBuffer ("UPDATE I_GLJournal i " - + "SET I_ErrorMsg=I_ErrorMsg||'WARN=Zero Acct Balance, ' " - + "WHERE (AmtSourceDr-AmtSourceCr)<>0 AND (AmtAcctDr-AmtAcctCr)=0" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal i ") + .append("SET I_ErrorMsg=I_ErrorMsg||'WARN=Zero Acct Balance, ' ") + .append("WHERE (AmtSourceDr-AmtSourceCr)<>0 AND (AmtAcctDr-AmtAcctCr)=0") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Zero Acct Balance=" + no); @@ -533,9 +534,9 @@ public class ImportGLJournal extends SvrProcess /*********************************************************************/ // Get Balance - sql = new StringBuffer ("SELECT SUM(AmtSourceDr)-SUM(AmtSourceCr), SUM(AmtAcctDr)-SUM(AmtAcctCr) " - + "FROM I_GLJournal " - + "WHERE I_IsImported='N'").append (clientCheck); + sql = new StringBuilder ("SELECT SUM(AmtSourceDr)-SUM(AmtSourceCr), SUM(AmtAcctDr)-SUM(AmtAcctCr) ") + .append("FROM I_GLJournal ") + .append("WHERE I_IsImported='N'").append (clientCheck); PreparedStatement pstmt = null; try { @@ -548,8 +549,10 @@ public class ImportGLJournal extends SvrProcess if (source != null && source.signum() == 0 && acct != null && acct.signum() == 0) log.info ("Import Balance = 0"); - else - log.warning("Balance Source=" + source + ", Acct=" + acct); + else{ + msglog = new StringBuilder("Balance Source=").append(source).append(", Acct=").append(acct); + log.warning(msglog.toString()); + } if (source != null) addLog (0, null, source, "@AmtSourceDr@ - @AmtSourceCr@"); if (acct != null) @@ -585,10 +588,12 @@ public class ImportGLJournal extends SvrProcess if (m_IsValidateOnly || m_IsImportOnlyNoErrors) throw new Exception ("@Errors@=" + errors); } - else if (m_IsValidateOnly) - return "@Errors@=" + errors; - - log.info("Validation Errors=" + errors); + else if (m_IsValidateOnly){ + StringBuilder msgreturn = new StringBuilder("@Errors@=").append(errors); + return msgreturn.toString(); + } + msglog = new StringBuilder("Validation Errors=").append(errors); + log.info(msglog.toString()); // moved commit above to save error messages // commit(); @@ -606,11 +611,11 @@ public class ImportGLJournal extends SvrProcess boolean wasCreateNewBatch = false; // Go through Journal Records - sql = new StringBuffer ("SELECT * FROM I_GLJournal " - + "WHERE I_IsImported='N'").append (clientCheck) - .append(" ORDER BY COALESCE(BatchDocumentNo, TO_NCHAR(I_GLJournal_ID)||' '), COALESCE(JournalDocumentNo, " + - "TO_NCHAR(I_GLJournal_ID)||' '), C_AcctSchema_ID, PostingType, C_DocType_ID, GL_Category_ID, " + - "C_Currency_ID, TRUNC(DateAcct), Line, I_GLJournal_ID"); + sql = new StringBuilder ("SELECT * FROM I_GLJournal ") + .append("WHERE I_IsImported='N'").append (clientCheck) + .append(" ORDER BY COALESCE(BatchDocumentNo, TO_NCHAR(I_GLJournal_ID)||' '), COALESCE(JournalDocumentNo, ") + .append("TO_NCHAR(I_GLJournal_ID)||' '), C_AcctSchema_ID, PostingType, C_DocType_ID, GL_Category_ID, ") + .append("C_Currency_ID, TRUNC(DateAcct), Line, I_GLJournal_ID"); try { pstmt = DB.prepareStatement (sql.toString (), get_TrxName()); @@ -647,13 +652,13 @@ public class ImportGLJournal extends SvrProcess batch.setDocumentNo (imp.getBatchDocumentNo()); batch.setC_DocType_ID(imp.getC_DocType_ID()); batch.setPostingType(imp.getPostingType()); - String description = imp.getBatchDescription(); + StringBuilder description = new StringBuilder(imp.getBatchDescription()); if (description == null || description.length() == 0) - description = "*Import-"; + description = new StringBuilder("*Import-"); else - description += " *Import-"; - description += new Timestamp(System.currentTimeMillis()); - batch.setDescription(description); + description.append(" *Import-"); + description.append(new Timestamp(System.currentTimeMillis())); + batch.setDescription(description.toString()); if (!batch.save()) { log.log(Level.SEVERE, "Batch not saved"); @@ -795,9 +800,9 @@ public class ImportGLJournal extends SvrProcess pstmt = null; // Set Error to indicator to not imported - sql = new StringBuffer ("UPDATE I_GLJournal " - + "SET I_IsImported='N', Updated=SysDate " - + "WHERE I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_GLJournal ") + .append("SET I_IsImported='N', Updated=SysDate ") + .append("WHERE I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); addLog (0, null, new BigDecimal (no), "@Errors@"); // diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportInOutConfirm.java b/org.adempiere.base.process/src/org/compiere/process/ImportInOutConfirm.java index f95bfda9d5..a3b4ef52d3 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportInOutConfirm.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportInOutConfirm.java @@ -68,67 +68,68 @@ public class ImportInOutConfirm extends SvrProcess */ protected String doIt () throws Exception { - log.info("I_InOutLineConfirm_ID=" + p_I_InOutLineConfirm_ID); - StringBuffer sql = null; + StringBuilder msglog = new StringBuilder("I_InOutLineConfirm_ID=").append(p_I_InOutLineConfirm_ID); + log.info(msglog.toString()); + StringBuilder sql = null; int no = 0; - String clientCheck = " AND AD_Client_ID=" + p_AD_Client_ID; + StringBuilder clientCheck = new StringBuilder(" AND AD_Client_ID=").append(p_AD_Client_ID); // Delete Old Imported if (p_DeleteOldImported) { - sql = new StringBuffer ("DELETE I_InOutLineConfirm " - + "WHERE I_IsImported='Y'").append (clientCheck); + sql = new StringBuilder ("DELETE I_InOutLineConfirm ") + .append("WHERE I_IsImported='Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Delete Old Impored =" + no); } // Set IsActive, Created/Updated - sql = new StringBuffer ("UPDATE I_InOutLineConfirm " - + "SET IsActive = COALESCE (IsActive, 'Y')," - + " Created = COALESCE (Created, SysDate)," - + " CreatedBy = COALESCE (CreatedBy, 0)," - + " Updated = COALESCE (Updated, SysDate)," - + " UpdatedBy = COALESCE (UpdatedBy, 0)," - + " I_ErrorMsg = ' '," - + " I_IsImported = 'N' " - + "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); + sql = new StringBuilder ("UPDATE I_InOutLineConfirm ") + .append("SET IsActive = COALESCE (IsActive, 'Y'),") + .append(" Created = COALESCE (Created, SysDate),") + .append(" CreatedBy = COALESCE (CreatedBy, 0),") + .append(" Updated = COALESCE (Updated, SysDate),") + .append(" UpdatedBy = COALESCE (UpdatedBy, 0),") + .append(" I_ErrorMsg = ' ',") + .append(" I_IsImported = 'N' ") + .append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.info ("Reset=" + no); // Set Client from Name - sql = new StringBuffer ("UPDATE I_InOutLineConfirm i " - + "SET AD_Client_ID=COALESCE (AD_Client_ID,").append (p_AD_Client_ID).append (") " - + "WHERE (AD_Client_ID IS NULL OR AD_Client_ID=0)" - + " AND I_IsImported<>'Y'"); + sql = new StringBuilder ("UPDATE I_InOutLineConfirm i ") + .append("SET AD_Client_ID=COALESCE (AD_Client_ID,").append (p_AD_Client_ID).append (") ") + .append("WHERE (AD_Client_ID IS NULL OR AD_Client_ID=0)") + .append(" AND I_IsImported<>'Y'"); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Client from Value=" + no); // Error Confirmation Line - sql = new StringBuffer ("UPDATE I_InOutLineConfirm i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Confirmation Line, '" - + "WHERE (M_InOutLineConfirm_ID IS NULL OR M_InOutLineConfirm_ID=0" - + " OR NOT EXISTS (SELECT * FROM M_InOutLineConfirm c WHERE i.M_InOutLineConfirm_ID=c.M_InOutLineConfirm_ID))" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_InOutLineConfirm i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Confirmation Line, '") + .append("WHERE (M_InOutLineConfirm_ID IS NULL OR M_InOutLineConfirm_ID=0") + .append(" OR NOT EXISTS (SELECT * FROM M_InOutLineConfirm c WHERE i.M_InOutLineConfirm_ID=c.M_InOutLineConfirm_ID))") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid InOutLineConfirm=" + no); // Error Confirmation No - sql = new StringBuffer ("UPDATE I_InOutLineConfirm i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Missing Confirmation No, '" - + "WHERE (ConfirmationNo IS NULL OR ConfirmationNo='')" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_InOutLineConfirm i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Missing Confirmation No, '") + .append("WHERE (ConfirmationNo IS NULL OR ConfirmationNo='')") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid ConfirmationNo=" + no); // Qty - sql = new StringBuffer ("UPDATE I_InOutLineConfirm i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Target<>(Confirmed+Difference+Scrapped), ' " - + "WHERE EXISTS (SELECT * FROM M_InOutLineConfirm c " - + "WHERE i.M_InOutLineConfirm_ID=c.M_InOutLineConfirm_ID" - + " AND c.TargetQty<>(i.ConfirmedQty+i.ScrappedQty+i.DifferenceQty))" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_InOutLineConfirm i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Target<>(Confirmed+Difference+Scrapped), ' ") + .append("WHERE EXISTS (SELECT * FROM M_InOutLineConfirm c ") + .append("WHERE i.M_InOutLineConfirm_ID=c.M_InOutLineConfirm_ID") + .append(" AND c.TargetQty<>(i.ConfirmedQty+i.ScrappedQty+i.DifferenceQty))") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Qty=" + no); @@ -138,8 +139,8 @@ public class ImportInOutConfirm extends SvrProcess /*********************************************************************/ PreparedStatement pstmt = null; - sql = new StringBuffer ("SELECT * FROM I_InOutLineConfirm " - + "WHERE I_IsImported='N'").append (clientCheck) + sql = new StringBuilder ("SELECT * FROM I_InOutLineConfirm ") + .append("WHERE I_IsImported='N'").append (clientCheck) .append(" ORDER BY I_InOutLineConfirm_ID"); no = 0; try @@ -193,8 +194,8 @@ public class ImportInOutConfirm extends SvrProcess { pstmt = null; } - - return "@Updated@ #" + no; + StringBuilder msgreturn = new StringBuilder("@Updated@ #").append(no); + return msgreturn.toString(); } // doIt } // ImportInOutConfirm diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportInventory.java b/org.adempiere.base.process/src/org/compiere/process/ImportInventory.java index 31bbbc89ba..d1b86a13ad 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportInventory.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportInventory.java @@ -112,7 +112,8 @@ public class ImportInventory extends SvrProcess */ protected String doIt() throws java.lang.Exception { - log.info("M_Locator_ID=" + p_M_Locator_ID + ",MovementDate=" + p_MovementDate); + StringBuilder msglog = new StringBuilder("M_Locator_ID=").append(p_M_Locator_ID).append(",MovementDate=").append(p_MovementDate); + log.info(msglog.toString()); if (p_UpdateCosting) { if (p_C_AcctSchema_ID <= 0) { @@ -130,174 +131,174 @@ public class ImportInventory extends SvrProcess acctSchema = MAcctSchema.get(getCtx(), p_C_AcctSchema_ID, get_TrxName()); } - StringBuffer sql = null; + StringBuilder sql = null; int no = 0; - String clientCheck = " AND AD_Client_ID=" + p_AD_Client_ID; + StringBuilder clientCheck = new StringBuilder(" AND AD_Client_ID=").append(p_AD_Client_ID); // **** Prepare **** // Delete Old Imported if (p_DeleteOldImported) { - sql = new StringBuffer ("DELETE I_Inventory " - + "WHERE I_IsImported='Y'").append (clientCheck); + sql = new StringBuilder ("DELETE I_Inventory ") + .append("WHERE I_IsImported='Y'").append (clientCheck); no = DB.executeUpdate (sql.toString (), get_TrxName()); log.fine("Delete Old Imported=" + no); } // Set Client, Org, Location, IsActive, Created/Updated - sql = new StringBuffer ("UPDATE I_Inventory " - + "SET AD_Client_ID = COALESCE (AD_Client_ID,").append (p_AD_Client_ID).append (")," - + " AD_Org_ID = DECODE (NVL(AD_Org_ID),0,").append (p_AD_Org_ID).append (",AD_Org_ID),"); + sql = new StringBuilder ("UPDATE I_Inventory ") + .append("SET AD_Client_ID = COALESCE (AD_Client_ID,").append (p_AD_Client_ID).append ("),") + .append(" AD_Org_ID = DECODE (NVL(AD_Org_ID),0,").append (p_AD_Org_ID).append (",AD_Org_ID),"); if (p_MovementDate != null) sql.append(" MovementDate = COALESCE (MovementDate,").append (DB.TO_DATE(p_MovementDate)).append ("),"); - sql.append(" IsActive = COALESCE (IsActive, 'Y')," - + " Created = COALESCE (Created, SysDate)," - + " CreatedBy = COALESCE (CreatedBy, 0)," - + " Updated = COALESCE (Updated, SysDate)," - + " UpdatedBy = COALESCE (UpdatedBy, 0)," - + " I_ErrorMsg = ' '," - + " M_Warehouse_ID = NULL," // reset - + " I_IsImported = 'N' " - + "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); + sql.append(" IsActive = COALESCE (IsActive, 'Y'),") + .append(" Created = COALESCE (Created, SysDate),") + .append(" CreatedBy = COALESCE (CreatedBy, 0),") + .append(" Updated = COALESCE (Updated, SysDate),") + .append(" UpdatedBy = COALESCE (UpdatedBy, 0),") + .append(" I_ErrorMsg = ' ',") + .append(" M_Warehouse_ID = NULL,") // reset + .append(" I_IsImported = 'N' ") + .append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); no = DB.executeUpdate (sql.toString (), get_TrxName()); log.info ("Reset=" + no); - sql = new StringBuffer ("UPDATE I_Inventory o " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '" - + "WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0" - + " OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Inventory o ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '") + .append("WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0") + .append(" OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString (), get_TrxName()); if (no != 0) log.warning ("Invalid Org=" + no); // Document Type - sql = new StringBuffer ("UPDATE I_Inventory i " - + "SET C_DocType_ID=(SELECT d.C_DocType_ID FROM C_DocType d" - + " WHERE d.Name=i.DocTypeName AND d.DocBaseType='MMI' AND i.AD_Client_ID=d.AD_Client_ID) " - + "WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Inventory i ") + .append("SET C_DocType_ID=(SELECT d.C_DocType_ID FROM C_DocType d") + .append(" WHERE d.Name=i.DocTypeName AND d.DocBaseType='MMI' AND i.AD_Client_ID=d.AD_Client_ID) ") + .append("WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set DocType=" + no); - sql = new StringBuffer ("UPDATE I_Inventory i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid DocType, ' " - + "WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Inventory i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid DocType, ' ") + .append("WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid DocType=" + no); // Locator - sql = new StringBuffer ("UPDATE I_Inventory i " - + "SET M_Locator_ID=(SELECT MAX(M_Locator_ID) FROM M_Locator l" - + " WHERE i.LocatorValue=l.Value AND i.AD_Client_ID=l.AD_Client_ID) " - + "WHERE M_Locator_ID IS NULL AND LocatorValue IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Inventory i ") + .append("SET M_Locator_ID=(SELECT MAX(M_Locator_ID) FROM M_Locator l") + .append(" WHERE i.LocatorValue=l.Value AND i.AD_Client_ID=l.AD_Client_ID) ") + .append("WHERE M_Locator_ID IS NULL AND LocatorValue IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString (), get_TrxName()); log.fine("Set Locator from Value =" + no); - sql = new StringBuffer ("UPDATE I_Inventory i " - + "SET M_Locator_ID=(SELECT MAX(M_Locator_ID) FROM M_Locator l" - + " WHERE i.X=l.X AND i.Y=l.Y AND i.Z=l.Z AND i.AD_Client_ID=l.AD_Client_ID) " - + "WHERE M_Locator_ID IS NULL AND X IS NOT NULL AND Y IS NOT NULL AND Z IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Inventory i ") + .append("SET M_Locator_ID=(SELECT MAX(M_Locator_ID) FROM M_Locator l") + .append(" WHERE i.X=l.X AND i.Y=l.Y AND i.Z=l.Z AND i.AD_Client_ID=l.AD_Client_ID) ") + .append("WHERE M_Locator_ID IS NULL AND X IS NOT NULL AND Y IS NOT NULL AND Z IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString (), get_TrxName()); log.fine("Set Locator from X,Y,Z =" + no); if (p_M_Locator_ID != 0) { - sql = new StringBuffer ("UPDATE I_Inventory " - + "SET M_Locator_ID = ").append (p_M_Locator_ID).append ( - " WHERE M_Locator_ID IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Inventory ") + .append("SET M_Locator_ID = ").append (p_M_Locator_ID) + .append (" WHERE M_Locator_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString (), get_TrxName()); log.fine("Set Locator from Parameter=" + no); } - sql = new StringBuffer ("UPDATE I_Inventory " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Location, ' " - + "WHERE M_Locator_ID IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Inventory ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Location, ' ") + .append("WHERE M_Locator_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString (), get_TrxName()); if (no != 0) log.warning ("No Location=" + no); // Set M_Warehouse_ID - sql = new StringBuffer ("UPDATE I_Inventory i " - + "SET M_Warehouse_ID=(SELECT M_Warehouse_ID FROM M_Locator l WHERE i.M_Locator_ID=l.M_Locator_ID) " - + "WHERE M_Locator_ID IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Inventory i ") + .append("SET M_Warehouse_ID=(SELECT M_Warehouse_ID FROM M_Locator l WHERE i.M_Locator_ID=l.M_Locator_ID) ") + .append("WHERE M_Locator_ID IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString (), get_TrxName()); log.fine("Set Warehouse from Locator =" + no); - sql = new StringBuffer ("UPDATE I_Inventory " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Warehouse, ' " - + "WHERE M_Warehouse_ID IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Inventory ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Warehouse, ' ") + .append("WHERE M_Warehouse_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString (), get_TrxName()); if (no != 0) log.warning ("No Warehouse=" + no); // Product - sql = new StringBuffer ("UPDATE I_Inventory i " - + "SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p" - + " WHERE i.Value=p.Value AND i.AD_Client_ID=p.AD_Client_ID) " - + "WHERE M_Product_ID IS NULL AND Value IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Inventory i ") + .append("SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p") + .append(" WHERE i.Value=p.Value AND i.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE M_Product_ID IS NULL AND Value IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString (), get_TrxName()); log.fine("Set Product from Value=" + no); - sql = new StringBuffer ("UPDATE I_Inventory i " - + "SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p" - + " WHERE i.UPC=p.UPC AND i.AD_Client_ID=p.AD_Client_ID) " - + "WHERE M_Product_ID IS NULL AND UPC IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Inventory i ") + .append("SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p") + .append(" WHERE i.UPC=p.UPC AND i.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE M_Product_ID IS NULL AND UPC IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString (), get_TrxName()); log.fine("Set Product from UPC=" + no); - sql = new StringBuffer ("UPDATE I_Inventory " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Product, ' " - + "WHERE M_Product_ID IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Inventory ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Product, ' ") + .append("WHERE M_Product_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString (), get_TrxName()); if (no != 0) log.warning ("No Product=" + no); // Charge - sql = new StringBuffer ("UPDATE I_Inventory o " - + "SET C_Charge_ID=(SELECT C_Charge_ID FROM C_Charge p" - + " WHERE o.ChargeName=p.Name AND o.AD_Client_ID=p.AD_Client_ID) " - + "WHERE C_Charge_ID IS NULL AND ChargeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Inventory o ") + .append("SET C_Charge_ID=(SELECT C_Charge_ID FROM C_Charge p") + .append(" WHERE o.ChargeName=p.Name AND o.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE C_Charge_ID IS NULL AND ChargeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Charge=" + no); - sql = new StringBuffer ("UPDATE I_Inventory " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Charge, ' " - + "WHERE C_Charge_ID IS NULL AND (ChargeName IS NOT NULL)" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Inventory ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Charge, ' ") + .append("WHERE C_Charge_ID IS NULL AND (ChargeName IS NOT NULL)") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Charge=" + no); // No QtyCount or QtyInternalUse - sql = new StringBuffer ("UPDATE I_Inventory " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Qty Count or Internal Use, ' " - + "WHERE QtyCount IS NULL AND QtyInternalUse IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Inventory ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Qty Count or Internal Use, ' ") + .append("WHERE QtyCount IS NULL AND QtyInternalUse IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString (), get_TrxName()); if (no != 0) log.warning ("No QtyCount or QtyInternalUse=" + no); // Excluding quantities - sql = new StringBuffer ("UPDATE I_Inventory " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Excluding quantities, ' " - + "WHERE NVL(QtyInternalUse,0)<>0 AND (NVL(QtyCount,0)<>0 OR NVL(QtyBook,0)<>0) " - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Inventory ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Excluding quantities, ' ") + .append("WHERE NVL(QtyInternalUse,0)<>0 AND (NVL(QtyCount,0)<>0 OR NVL(QtyBook,0)<>0) ") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString (), get_TrxName()); if (no != 0) log.warning ("Excluding quantities=" + no); // Required charge for internal use - sql = new StringBuffer ("UPDATE I_Inventory " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Required charge, ' " - + "WHERE NVL(QtyInternalUse,0)<>0 AND NVL(C_Charge_ID,0)=0 " - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Inventory ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Required charge, ' ") + .append("WHERE NVL(QtyInternalUse,0)<>0 AND NVL(C_Charge_ID,0)=0 ") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString (), get_TrxName()); if (no != 0) log.warning ("Required charge=" + no); @@ -312,8 +313,8 @@ public class ImportInventory extends SvrProcess int noInsertLine = 0; // Go through Inventory Records - sql = new StringBuffer ("SELECT * FROM I_Inventory " - + "WHERE I_IsImported='N'").append (clientCheck) + sql = new StringBuilder ("SELECT * FROM I_Inventory ") + .append("WHERE I_IsImported='N'").append (clientCheck) .append(" ORDER BY M_Warehouse_ID, TRUNC(MovementDate), I_Inventory_ID"); try { @@ -415,9 +416,9 @@ public class ImportInventory extends SvrProcess } // Set Error to indicator to not imported - sql = new StringBuffer ("UPDATE I_Inventory " - + "SET I_IsImported='N', Updated=SysDate " - + "WHERE I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Inventory ") + .append("SET I_IsImported='N', Updated=SysDate ") + .append("WHERE I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); addLog (0, null, new BigDecimal (no), "@Errors@"); // diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportInvoice.java b/org.adempiere.base.process/src/org/compiere/process/ImportInvoice.java index bf05db3b21..c3cd8010c7 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportInvoice.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportInvoice.java @@ -86,282 +86,282 @@ public class ImportInvoice extends SvrProcess */ protected String doIt() throws java.lang.Exception { - StringBuffer sql = null; + StringBuilder sql = null; int no = 0; - String clientCheck = " AND AD_Client_ID=" + m_AD_Client_ID; + StringBuilder clientCheck = new StringBuilder(" AND AD_Client_ID=").append(m_AD_Client_ID); // **** Prepare **** // Delete Old Imported if (m_deleteOldImported) { - sql = new StringBuffer ("DELETE I_Invoice " - + "WHERE I_IsImported='Y'").append (clientCheck); + sql = new StringBuilder ("DELETE I_Invoice ") + .append("WHERE I_IsImported='Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Delete Old Impored =" + no); } // Set Client, Org, IsActive, Created/Updated - sql = new StringBuffer ("UPDATE I_Invoice " - + "SET AD_Client_ID = COALESCE (AD_Client_ID,").append (m_AD_Client_ID).append (")," - + " AD_Org_ID = COALESCE (AD_Org_ID,").append (m_AD_Org_ID).append (")," - + " IsActive = COALESCE (IsActive, 'Y')," - + " Created = COALESCE (Created, SysDate)," - + " CreatedBy = COALESCE (CreatedBy, 0)," - + " Updated = COALESCE (Updated, SysDate)," - + " UpdatedBy = COALESCE (UpdatedBy, 0)," - + " I_ErrorMsg = ' '," - + " I_IsImported = 'N' " - + "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); + sql = new StringBuilder ("UPDATE I_Invoice ") + .append("SET AD_Client_ID = COALESCE (AD_Client_ID,").append (m_AD_Client_ID).append ("),") + .append(" AD_Org_ID = COALESCE (AD_Org_ID,").append (m_AD_Org_ID).append ("),") + .append(" IsActive = COALESCE (IsActive, 'Y'),") + .append(" Created = COALESCE (Created, SysDate),") + .append(" CreatedBy = COALESCE (CreatedBy, 0),") + .append(" Updated = COALESCE (Updated, SysDate),") + .append(" UpdatedBy = COALESCE (UpdatedBy, 0),") + .append(" I_ErrorMsg = ' ',") + .append(" I_IsImported = 'N' ") + .append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.info ("Reset=" + no); - sql = new StringBuffer ("UPDATE I_Invoice o " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '" - + "WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0" - + " OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '") + .append("WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0") + .append(" OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Org=" + no); // Document Type - PO - SO - sql = new StringBuffer ("UPDATE I_Invoice o " - + "SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName" - + " AND d.DocBaseType IN ('API','APC') AND o.AD_Client_ID=d.AD_Client_ID) " - + "WHERE C_DocType_ID IS NULL AND IsSOTrx='N' AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName") + .append(" AND d.DocBaseType IN ('API','APC') AND o.AD_Client_ID=d.AD_Client_ID) ") + .append("WHERE C_DocType_ID IS NULL AND IsSOTrx='N' AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Set PO DocType=" + no); - sql = new StringBuffer ("UPDATE I_Invoice o " - + "SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName" - + " AND d.DocBaseType IN ('ARI','ARC') AND o.AD_Client_ID=d.AD_Client_ID) " - + "WHERE C_DocType_ID IS NULL AND IsSOTrx='Y' AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName") + .append(" AND d.DocBaseType IN ('ARI','ARC') AND o.AD_Client_ID=d.AD_Client_ID) ") + .append("WHERE C_DocType_ID IS NULL AND IsSOTrx='Y' AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Set SO DocType=" + no); - sql = new StringBuffer ("UPDATE I_Invoice o " - + "SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName" - + " AND d.DocBaseType IN ('API','ARI','APC','ARC') AND o.AD_Client_ID=d.AD_Client_ID) " + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName") + .append(" AND d.DocBaseType IN ('API','ARI','APC','ARC') AND o.AD_Client_ID=d.AD_Client_ID) ") //+ "WHERE C_DocType_ID IS NULL AND IsSOTrx IS NULL AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); - + "WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); + .append("WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Set DocType=" + no); - sql = new StringBuffer ("UPDATE I_Invoice " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid DocTypeName, ' " - + "WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid DocTypeName, ' ") + .append("WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid DocTypeName=" + no); // DocType Default - sql = new StringBuffer ("UPDATE I_Invoice o " - + "SET C_DocType_ID=(SELECT MAX(C_DocType_ID) FROM C_DocType d WHERE d.IsDefault='Y'" - + " AND d.DocBaseType='API' AND o.AD_Client_ID=d.AD_Client_ID) " - + "WHERE C_DocType_ID IS NULL AND IsSOTrx='N' AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("SET C_DocType_ID=(SELECT MAX(C_DocType_ID) FROM C_DocType d WHERE d.IsDefault='Y'") + .append(" AND d.DocBaseType='API' AND o.AD_Client_ID=d.AD_Client_ID) ") + .append("WHERE C_DocType_ID IS NULL AND IsSOTrx='N' AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Set PO Default DocType=" + no); - sql = new StringBuffer ("UPDATE I_Invoice o " - + "SET C_DocType_ID=(SELECT MAX(C_DocType_ID) FROM C_DocType d WHERE d.IsDefault='Y'" - + " AND d.DocBaseType='ARI' AND o.AD_Client_ID=d.AD_Client_ID) " - + "WHERE C_DocType_ID IS NULL AND IsSOTrx='Y' AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("SET C_DocType_ID=(SELECT MAX(C_DocType_ID) FROM C_DocType d WHERE d.IsDefault='Y'") + .append(" AND d.DocBaseType='ARI' AND o.AD_Client_ID=d.AD_Client_ID) ") + .append("WHERE C_DocType_ID IS NULL AND IsSOTrx='Y' AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Set SO Default DocType=" + no); - sql = new StringBuffer ("UPDATE I_Invoice o " - + "SET C_DocType_ID=(SELECT MAX(C_DocType_ID) FROM C_DocType d WHERE d.IsDefault='Y'" - + " AND d.DocBaseType IN('ARI','API') AND o.AD_Client_ID=d.AD_Client_ID) " - + "WHERE C_DocType_ID IS NULL AND IsSOTrx IS NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("SET C_DocType_ID=(SELECT MAX(C_DocType_ID) FROM C_DocType d WHERE d.IsDefault='Y'") + .append(" AND d.DocBaseType IN('ARI','API') AND o.AD_Client_ID=d.AD_Client_ID) ") + .append("WHERE C_DocType_ID IS NULL AND IsSOTrx IS NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Set Default DocType=" + no); - sql = new StringBuffer ("UPDATE I_Invoice " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No DocType, ' " - + "WHERE C_DocType_ID IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No DocType, ' ") + .append("WHERE C_DocType_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("No DocType=" + no); // Set IsSOTrx - sql = new StringBuffer ("UPDATE I_Invoice o SET IsSOTrx='Y' " - + "WHERE EXISTS (SELECT * FROM C_DocType d WHERE o.C_DocType_ID=d.C_DocType_ID AND d.DocBaseType='ARI' AND o.AD_Client_ID=d.AD_Client_ID)" - + " AND C_DocType_ID IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o SET IsSOTrx='Y' ") + .append("WHERE EXISTS (SELECT * FROM C_DocType d WHERE o.C_DocType_ID=d.C_DocType_ID AND d.DocBaseType='ARI' AND o.AD_Client_ID=d.AD_Client_ID)") + .append(" AND C_DocType_ID IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set IsSOTrx=Y=" + no); - sql = new StringBuffer ("UPDATE I_Invoice o SET IsSOTrx='N' " - + "WHERE EXISTS (SELECT * FROM C_DocType d WHERE o.C_DocType_ID=d.C_DocType_ID AND d.DocBaseType='API' AND o.AD_Client_ID=d.AD_Client_ID)" - + " AND C_DocType_ID IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o SET IsSOTrx='N' ") + .append("WHERE EXISTS (SELECT * FROM C_DocType d WHERE o.C_DocType_ID=d.C_DocType_ID AND d.DocBaseType='API' AND o.AD_Client_ID=d.AD_Client_ID)") + .append(" AND C_DocType_ID IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set IsSOTrx=N=" + no); // Price List - sql = new StringBuffer ("UPDATE I_Invoice o " - + "SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p WHERE p.IsDefault='Y'" - + " AND p.C_Currency_ID=o.C_Currency_ID AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) " - + "WHERE M_PriceList_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p WHERE p.IsDefault='Y'") + .append(" AND p.C_Currency_ID=o.C_Currency_ID AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE M_PriceList_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Default Currency PriceList=" + no); - sql = new StringBuffer ("UPDATE I_Invoice o " - + "SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p WHERE p.IsDefault='Y'" - + " AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) " - + "WHERE M_PriceList_ID IS NULL AND C_Currency_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p WHERE p.IsDefault='Y'") + .append(" AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE M_PriceList_ID IS NULL AND C_Currency_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Default PriceList=" + no); - sql = new StringBuffer ("UPDATE I_Invoice o " - + "SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p " - + " WHERE p.C_Currency_ID=o.C_Currency_ID AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) " - + "WHERE M_PriceList_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p ") + .append(" WHERE p.C_Currency_ID=o.C_Currency_ID AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE M_PriceList_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Currency PriceList=" + no); - sql = new StringBuffer ("UPDATE I_Invoice o " - + "SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p " - + " WHERE p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) " - + "WHERE M_PriceList_ID IS NULL AND C_Currency_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p ") + .append(" WHERE p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE M_PriceList_ID IS NULL AND C_Currency_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set PriceList=" + no); // - sql = new StringBuffer ("UPDATE I_Invoice " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No PriceList, ' " - + "WHERE M_PriceList_ID IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No PriceList, ' ") + .append("WHERE M_PriceList_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning("No PriceList=" + no); // Payment Term - sql = new StringBuffer ("UPDATE I_Invoice o " - + "SET C_PaymentTerm_ID=(SELECT C_PaymentTerm_ID FROM C_PaymentTerm p" - + " WHERE o.PaymentTermValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) " - + "WHERE C_PaymentTerm_ID IS NULL AND PaymentTermValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("SET C_PaymentTerm_ID=(SELECT C_PaymentTerm_ID FROM C_PaymentTerm p") + .append(" WHERE o.PaymentTermValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE C_PaymentTerm_ID IS NULL AND PaymentTermValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set PaymentTerm=" + no); - sql = new StringBuffer ("UPDATE I_Invoice o " - + "SET C_PaymentTerm_ID=(SELECT MAX(C_PaymentTerm_ID) FROM C_PaymentTerm p" - + " WHERE p.IsDefault='Y' AND o.AD_Client_ID=p.AD_Client_ID) " - + "WHERE C_PaymentTerm_ID IS NULL AND o.PaymentTermValue IS NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("SET C_PaymentTerm_ID=(SELECT MAX(C_PaymentTerm_ID) FROM C_PaymentTerm p") + .append(" WHERE p.IsDefault='Y' AND o.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE C_PaymentTerm_ID IS NULL AND o.PaymentTermValue IS NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Default PaymentTerm=" + no); // - sql = new StringBuffer ("UPDATE I_Invoice " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No PaymentTerm, ' " - + "WHERE C_PaymentTerm_ID IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No PaymentTerm, ' ") + .append("WHERE C_PaymentTerm_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("No PaymentTerm=" + no); // globalqss - Add project and activity // Project - sql = new StringBuffer ("UPDATE I_Invoice o " - + "SET C_Project_ID=(SELECT C_Project_ID FROM C_Project p" - + " WHERE o.ProjectValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) " - + "WHERE C_Project_ID IS NULL AND ProjectValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("SET C_Project_ID=(SELECT C_Project_ID FROM C_Project p") + .append(" WHERE o.ProjectValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE C_Project_ID IS NULL AND ProjectValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Project=" + no); - sql = new StringBuffer ("UPDATE I_Invoice " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Project, ' " - + "WHERE C_Project_ID IS NULL AND (ProjectValue IS NOT NULL)" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Project, ' ") + .append("WHERE C_Project_ID IS NULL AND (ProjectValue IS NOT NULL)") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Project=" + no); // Activity - sql = new StringBuffer ("UPDATE I_Invoice o " - + "SET C_Activity_ID=(SELECT C_Activity_ID FROM C_Activity p" - + " WHERE o.ActivityValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) " - + "WHERE C_Activity_ID IS NULL AND ActivityValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("SET C_Activity_ID=(SELECT C_Activity_ID FROM C_Activity p") + .append(" WHERE o.ActivityValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE C_Activity_ID IS NULL AND ActivityValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Activity=" + no); - sql = new StringBuffer ("UPDATE I_Invoice " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Activity, ' " - + "WHERE C_Activity_ID IS NULL AND (ActivityValue IS NOT NULL)" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Activity, ' ") + .append("WHERE C_Activity_ID IS NULL AND (ActivityValue IS NOT NULL)") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Activity=" + no); // globalqss - add charge // Charge - sql = new StringBuffer ("UPDATE I_Invoice o " - + "SET C_Charge_ID=(SELECT C_Charge_ID FROM C_Charge p" - + " WHERE o.ChargeName=p.Name AND o.AD_Client_ID=p.AD_Client_ID) " - + "WHERE C_Charge_ID IS NULL AND ChargeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("SET C_Charge_ID=(SELECT C_Charge_ID FROM C_Charge p") + .append(" WHERE o.ChargeName=p.Name AND o.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE C_Charge_ID IS NULL AND ChargeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Charge=" + no); - sql = new StringBuffer ("UPDATE I_Invoice " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Charge, ' " - + "WHERE C_Charge_ID IS NULL AND (ChargeName IS NOT NULL)" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Charge, ' ") + .append("WHERE C_Charge_ID IS NULL AND (ChargeName IS NOT NULL)") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Charge=" + no); // // BP from EMail - sql = new StringBuffer ("UPDATE I_Invoice o " - + "SET (C_BPartner_ID,AD_User_ID)=(SELECT C_BPartner_ID,AD_User_ID FROM AD_User u" - + " WHERE o.EMail=u.EMail AND o.AD_Client_ID=u.AD_Client_ID AND u.C_BPartner_ID IS NOT NULL) " - + "WHERE C_BPartner_ID IS NULL AND EMail IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("SET (C_BPartner_ID,AD_User_ID)=(SELECT C_BPartner_ID,AD_User_ID FROM AD_User u") + .append(" WHERE o.EMail=u.EMail AND o.AD_Client_ID=u.AD_Client_ID AND u.C_BPartner_ID IS NOT NULL) ") + .append("WHERE C_BPartner_ID IS NULL AND EMail IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set BP from EMail=" + no); // BP from ContactName - sql = new StringBuffer ("UPDATE I_Invoice o " - + "SET (C_BPartner_ID,AD_User_ID)=(SELECT C_BPartner_ID,AD_User_ID FROM AD_User u" - + " WHERE o.ContactName=u.Name AND o.AD_Client_ID=u.AD_Client_ID AND u.C_BPartner_ID IS NOT NULL) " - + "WHERE C_BPartner_ID IS NULL AND ContactName IS NOT NULL" - + " AND EXISTS (SELECT Name FROM AD_User u WHERE o.ContactName=u.Name AND o.AD_Client_ID=u.AD_Client_ID AND u.C_BPartner_ID IS NOT NULL GROUP BY Name HAVING COUNT(*)=1)" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("SET (C_BPartner_ID,AD_User_ID)=(SELECT C_BPartner_ID,AD_User_ID FROM AD_User u") + .append(" WHERE o.ContactName=u.Name AND o.AD_Client_ID=u.AD_Client_ID AND u.C_BPartner_ID IS NOT NULL) ") + .append("WHERE C_BPartner_ID IS NULL AND ContactName IS NOT NULL") + .append(" AND EXISTS (SELECT Name FROM AD_User u WHERE o.ContactName=u.Name AND o.AD_Client_ID=u.AD_Client_ID AND u.C_BPartner_ID IS NOT NULL GROUP BY Name HAVING COUNT(*)=1)") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set BP from ContactName=" + no); // BP from Value - sql = new StringBuffer ("UPDATE I_Invoice o " - + "SET C_BPartner_ID=(SELECT MAX(C_BPartner_ID) FROM C_BPartner bp" - + " WHERE o.BPartnerValue=bp.Value AND o.AD_Client_ID=bp.AD_Client_ID) " - + "WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("SET C_BPartner_ID=(SELECT MAX(C_BPartner_ID) FROM C_BPartner bp") + .append(" WHERE o.BPartnerValue=bp.Value AND o.AD_Client_ID=bp.AD_Client_ID) ") + .append("WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set BP from Value=" + no); // Default BP - sql = new StringBuffer ("UPDATE I_Invoice o " - + "SET C_BPartner_ID=(SELECT C_BPartnerCashTrx_ID FROM AD_ClientInfo c" - + " WHERE o.AD_Client_ID=c.AD_Client_ID) " - + "WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NULL AND Name IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("SET C_BPartner_ID=(SELECT C_BPartnerCashTrx_ID FROM AD_ClientInfo c") + .append(" WHERE o.AD_Client_ID=c.AD_Client_ID) ") + .append("WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NULL AND Name IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Default BP=" + no); // Existing Location ? Exact Match - sql = new StringBuffer ("UPDATE I_Invoice o " - + "SET C_BPartner_Location_ID=(SELECT C_BPartner_Location_ID" - + " FROM C_BPartner_Location bpl INNER JOIN C_Location l ON (bpl.C_Location_ID=l.C_Location_ID)" - + " WHERE o.C_BPartner_ID=bpl.C_BPartner_ID AND bpl.AD_Client_ID=o.AD_Client_ID" - + " AND DUMP(o.Address1)=DUMP(l.Address1) AND DUMP(o.Address2)=DUMP(l.Address2)" - + " AND DUMP(o.City)=DUMP(l.City) AND DUMP(o.Postal)=DUMP(l.Postal)" - + " AND o.C_Region_ID=l.C_Region_ID AND o.C_Country_ID=l.C_Country_ID) " - + "WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL" - + " AND I_IsImported='N'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("SET C_BPartner_Location_ID=(SELECT C_BPartner_Location_ID") + .append(" FROM C_BPartner_Location bpl INNER JOIN C_Location l ON (bpl.C_Location_ID=l.C_Location_ID)") + .append(" WHERE o.C_BPartner_ID=bpl.C_BPartner_ID AND bpl.AD_Client_ID=o.AD_Client_ID") + .append(" AND DUMP(o.Address1)=DUMP(l.Address1) AND DUMP(o.Address2)=DUMP(l.Address2)") + .append(" AND DUMP(o.City)=DUMP(l.City) AND DUMP(o.Postal)=DUMP(l.Postal)") + .append(" AND o.C_Region_ID=l.C_Region_ID AND o.C_Country_ID=l.C_Country_ID) ") + .append("WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL") + .append(" AND I_IsImported='N'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Found Location=" + no); // Set Location from BPartner - sql = new StringBuffer ("UPDATE I_Invoice o " - + "SET C_BPartner_Location_ID=(SELECT MAX(C_BPartner_Location_ID) FROM C_BPartner_Location l" - + " WHERE l.C_BPartner_ID=o.C_BPartner_ID AND o.AD_Client_ID=l.AD_Client_ID" - + " AND ((l.IsBillTo='Y' AND o.IsSOTrx='Y') OR o.IsSOTrx='N')" - + ") " - + "WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("SET C_BPartner_Location_ID=(SELECT MAX(C_BPartner_Location_ID) FROM C_BPartner_Location l") + .append(" WHERE l.C_BPartner_ID=o.C_BPartner_ID AND o.AD_Client_ID=l.AD_Client_ID") + .append(" AND ((l.IsBillTo='Y' AND o.IsSOTrx='Y') OR o.IsSOTrx='N')") + .append(") ") + .append("WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set BP Location from BP=" + no); // - sql = new StringBuffer ("UPDATE I_Invoice " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No BP Location, ' " - + "WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No BP Location, ' ") + .append("WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("No BP Location=" + no); @@ -376,102 +376,102 @@ public class ImportInvoice extends SvrProcess no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Country Default=" + no); **/ - sql = new StringBuffer ("UPDATE I_Invoice o " - + "SET C_Country_ID=(SELECT C_Country_ID FROM C_Country c" - + " WHERE o.CountryCode=c.CountryCode AND c.AD_Client_ID IN (0, o.AD_Client_ID)) " - + "WHERE C_BPartner_ID IS NULL AND C_Country_ID IS NULL AND CountryCode IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("SET C_Country_ID=(SELECT C_Country_ID FROM C_Country c") + .append(" WHERE o.CountryCode=c.CountryCode AND c.AD_Client_ID IN (0, o.AD_Client_ID)) ") + .append("WHERE C_BPartner_ID IS NULL AND C_Country_ID IS NULL AND CountryCode IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Country=" + no); // - sql = new StringBuffer ("UPDATE I_Invoice " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Country, ' " - + "WHERE C_BPartner_ID IS NULL AND C_Country_ID IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Country, ' ") + .append("WHERE C_BPartner_ID IS NULL AND C_Country_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Country=" + no); // Set Region - sql = new StringBuffer ("UPDATE I_Invoice o " - + "Set RegionName=(SELECT MAX(Name) FROM C_Region r" - + " WHERE r.IsDefault='Y' AND r.C_Country_ID=o.C_Country_ID" - + " AND r.AD_Client_ID IN (0, o.AD_Client_ID)) " - + "WHERE C_BPartner_ID IS NULL AND C_Region_ID IS NULL AND RegionName IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("Set RegionName=(SELECT MAX(Name) FROM C_Region r") + .append(" WHERE r.IsDefault='Y' AND r.C_Country_ID=o.C_Country_ID") + .append(" AND r.AD_Client_ID IN (0, o.AD_Client_ID)) ") + .append("WHERE C_BPartner_ID IS NULL AND C_Region_ID IS NULL AND RegionName IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Region Default=" + no); // - sql = new StringBuffer ("UPDATE I_Invoice o " - + "Set C_Region_ID=(SELECT C_Region_ID FROM C_Region r" - + " WHERE r.Name=o.RegionName AND r.C_Country_ID=o.C_Country_ID" - + " AND r.AD_Client_ID IN (0, o.AD_Client_ID)) " - + "WHERE C_BPartner_ID IS NULL AND C_Region_ID IS NULL AND RegionName IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("Set C_Region_ID=(SELECT C_Region_ID FROM C_Region r") + .append(" WHERE r.Name=o.RegionName AND r.C_Country_ID=o.C_Country_ID") + .append(" AND r.AD_Client_ID IN (0, o.AD_Client_ID)) ") + .append("WHERE C_BPartner_ID IS NULL AND C_Region_ID IS NULL AND RegionName IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Region=" + no); // - sql = new StringBuffer ("UPDATE I_Invoice o " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Region, ' " - + "WHERE C_BPartner_ID IS NULL AND C_Region_ID IS NULL " - + " AND EXISTS (SELECT * FROM C_Country c" - + " WHERE c.C_Country_ID=o.C_Country_ID AND c.HasRegion='Y')" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Region, ' ") + .append("WHERE C_BPartner_ID IS NULL AND C_Region_ID IS NULL ") + .append(" AND EXISTS (SELECT * FROM C_Country c") + .append(" WHERE c.C_Country_ID=o.C_Country_ID AND c.HasRegion='Y')") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Region=" + no); // Product - sql = new StringBuffer ("UPDATE I_Invoice o " - + "SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p" - + " WHERE o.ProductValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) " - + "WHERE M_Product_ID IS NULL AND ProductValue IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p") + .append(" WHERE o.ProductValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE M_Product_ID IS NULL AND ProductValue IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Product from Value=" + no); - sql = new StringBuffer ("UPDATE I_Invoice o " - + "SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p" - + " WHERE o.UPC=p.UPC AND o.AD_Client_ID=p.AD_Client_ID) " - + "WHERE M_Product_ID IS NULL AND UPC IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p") + .append(" WHERE o.UPC=p.UPC AND o.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE M_Product_ID IS NULL AND UPC IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Product from UPC=" + no); - sql = new StringBuffer ("UPDATE I_Invoice o " - + "SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p" - + " WHERE o.SKU=p.SKU AND o.AD_Client_ID=p.AD_Client_ID) " - + "WHERE M_Product_ID IS NULL AND SKU IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p") + .append(" WHERE o.SKU=p.SKU AND o.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE M_Product_ID IS NULL AND SKU IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Product fom SKU=" + no); - sql = new StringBuffer ("UPDATE I_Invoice " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Product, ' " - + "WHERE M_Product_ID IS NULL AND (ProductValue IS NOT NULL OR UPC IS NOT NULL OR SKU IS NOT NULL)" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Product, ' ") + .append("WHERE M_Product_ID IS NULL AND (ProductValue IS NOT NULL OR UPC IS NOT NULL OR SKU IS NOT NULL)") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Product=" + no); // globalqss - charge and product are exclusive - sql = new StringBuffer ("UPDATE I_Invoice " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Product and Charge, ' " - + "WHERE M_Product_ID IS NOT NULL AND C_Charge_ID IS NOT NULL " - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Product and Charge, ' ") + .append("WHERE M_Product_ID IS NOT NULL AND C_Charge_ID IS NOT NULL ") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Product and Charge exclusive=" + no); // Tax - sql = new StringBuffer ("UPDATE I_Invoice o " - + "SET C_Tax_ID=(SELECT MAX(C_Tax_ID) FROM C_Tax t" - + " WHERE o.TaxIndicator=t.TaxIndicator AND o.AD_Client_ID=t.AD_Client_ID) " - + "WHERE C_Tax_ID IS NULL AND TaxIndicator IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice o ") + .append("SET C_Tax_ID=(SELECT MAX(C_Tax_ID) FROM C_Tax t") + .append(" WHERE o.TaxIndicator=t.TaxIndicator AND o.AD_Client_ID=t.AD_Client_ID) ") + .append("WHERE C_Tax_ID IS NULL AND TaxIndicator IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Tax=" + no); - sql = new StringBuffer ("UPDATE I_Invoice " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Tax, ' " - + "WHERE C_Tax_ID IS NULL AND TaxIndicator IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Tax, ' ") + .append("WHERE C_Tax_ID IS NULL AND TaxIndicator IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Tax=" + no); @@ -481,8 +481,8 @@ public class ImportInvoice extends SvrProcess // -- New BPartner --------------------------------------------------- // Go through Invoice Records w/o C_BPartner_ID - sql = new StringBuffer ("SELECT * FROM I_Invoice " - + "WHERE I_IsImported='N' AND C_BPartner_ID IS NULL").append (clientCheck); + sql = new StringBuilder ("SELECT * FROM I_Invoice ") + .append("WHERE I_IsImported='N' AND C_BPartner_ID IS NULL").append (clientCheck); try { PreparedStatement pstmt = DB.prepareStatement (sql.toString(), get_TrxName()); @@ -601,10 +601,10 @@ public class ImportInvoice extends SvrProcess { log.log(Level.SEVERE, "CreateBP", e); } - sql = new StringBuffer ("UPDATE I_Invoice " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No BPartner, ' " - + "WHERE C_BPartner_ID IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No BPartner, ' ") + .append("WHERE C_BPartner_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("No BPartner=" + no); @@ -617,8 +617,8 @@ public class ImportInvoice extends SvrProcess int noInsertLine = 0; // Go through Invoice Records w/o - sql = new StringBuffer ("SELECT * FROM I_Invoice " - + "WHERE I_IsImported='N'").append (clientCheck) + sql = new StringBuilder ("SELECT * FROM I_Invoice ") + .append("WHERE I_IsImported='N'").append (clientCheck) .append(" ORDER BY C_BPartner_ID, C_BPartner_Location_ID, I_Invoice_ID"); try { @@ -760,9 +760,9 @@ public class ImportInvoice extends SvrProcess } // Set Error to indicator to not imported - sql = new StringBuffer ("UPDATE I_Invoice " - + "SET I_IsImported='N', Updated=SysDate " - + "WHERE I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Invoice ") + .append("SET I_IsImported='N', Updated=SysDate ") + .append("WHERE I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); addLog (0, null, new BigDecimal (no), "@Errors@"); // diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportOrder.java b/org.adempiere.base.process/src/org/compiere/process/ImportOrder.java index 187243b998..06d12d54f5 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportOrder.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportOrder.java @@ -88,7 +88,7 @@ public class ImportOrder extends SvrProcess */ protected String doIt() throws java.lang.Exception { - StringBuffer sql = null; + StringBuilder sql = null; int no = 0; String clientCheck = " AND AD_Client_ID=" + m_AD_Client_ID; @@ -97,272 +97,272 @@ public class ImportOrder extends SvrProcess // Delete Old Imported if (m_deleteOldImported) { - sql = new StringBuffer ("DELETE I_Order " - + "WHERE I_IsImported='Y'").append (clientCheck); + sql = new StringBuilder ("DELETE I_Order ") + .append("WHERE I_IsImported='Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Delete Old Impored =" + no); } // Set Client, Org, IsActive, Created/Updated - sql = new StringBuffer ("UPDATE I_Order " - + "SET AD_Client_ID = COALESCE (AD_Client_ID,").append (m_AD_Client_ID).append (")," - + " AD_Org_ID = COALESCE (AD_Org_ID,").append (m_AD_Org_ID).append (")," - + " IsActive = COALESCE (IsActive, 'Y')," - + " Created = COALESCE (Created, SysDate)," - + " CreatedBy = COALESCE (CreatedBy, 0)," - + " Updated = COALESCE (Updated, SysDate)," - + " UpdatedBy = COALESCE (UpdatedBy, 0)," - + " I_ErrorMsg = ' '," - + " I_IsImported = 'N' " - + "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); + sql = new StringBuilder ("UPDATE I_Order ") + .append("SET AD_Client_ID = COALESCE (AD_Client_ID,").append (m_AD_Client_ID).append ("),") + .append(" AD_Org_ID = COALESCE (AD_Org_ID,").append (m_AD_Org_ID).append ("),") + .append(" IsActive = COALESCE (IsActive, 'Y'),") + .append(" Created = COALESCE (Created, SysDate),") + .append(" CreatedBy = COALESCE (CreatedBy, 0),") + .append(" Updated = COALESCE (Updated, SysDate),") + .append(" UpdatedBy = COALESCE (UpdatedBy, 0),") + .append(" I_ErrorMsg = ' ',") + .append(" I_IsImported = 'N' ") + .append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.info ("Reset=" + no); - sql = new StringBuffer ("UPDATE I_Order o " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '" - + "WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0" - + " OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '") + .append("WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0") + .append(" OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Org=" + no); // Document Type - PO - SO - sql = new StringBuffer ("UPDATE I_Order o " // PO Document Type Name - + "SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName" - + " AND d.DocBaseType='POO' AND o.AD_Client_ID=d.AD_Client_ID) " - + "WHERE C_DocType_ID IS NULL AND IsSOTrx='N' AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") // PO Document Type Name + .append("SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName") + .append(" AND d.DocBaseType='POO' AND o.AD_Client_ID=d.AD_Client_ID) ") + .append("WHERE C_DocType_ID IS NULL AND IsSOTrx='N' AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set PO DocType=" + no); - sql = new StringBuffer ("UPDATE I_Order o " // SO Document Type Name - + "SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName" - + " AND d.DocBaseType='SOO' AND o.AD_Client_ID=d.AD_Client_ID) " - + "WHERE C_DocType_ID IS NULL AND IsSOTrx='Y' AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") // SO Document Type Name + .append("SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName") + .append(" AND d.DocBaseType='SOO' AND o.AD_Client_ID=d.AD_Client_ID) ") + .append("WHERE C_DocType_ID IS NULL AND IsSOTrx='Y' AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set SO DocType=" + no); - sql = new StringBuffer ("UPDATE I_Order o " - + "SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName" - + " AND d.DocBaseType IN ('SOO','POO') AND o.AD_Client_ID=d.AD_Client_ID) " + sql = new StringBuilder ("UPDATE I_Order o ") + .append("SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName") + .append(" AND d.DocBaseType IN ('SOO','POO') AND o.AD_Client_ID=d.AD_Client_ID) ") //+ "WHERE C_DocType_ID IS NULL AND IsSOTrx IS NULL AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); - + "WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); + .append("WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set DocType=" + no); - sql = new StringBuffer ("UPDATE I_Order " // Error Invalid Doc Type Name - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid DocTypeName, ' " - + "WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order ") // Error Invalid Doc Type Name + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid DocTypeName, ' ") + .append("WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid DocTypeName=" + no); // DocType Default - sql = new StringBuffer ("UPDATE I_Order o " // Default PO - + "SET C_DocType_ID=(SELECT MAX(C_DocType_ID) FROM C_DocType d WHERE d.IsDefault='Y'" - + " AND d.DocBaseType='POO' AND o.AD_Client_ID=d.AD_Client_ID) " - + "WHERE C_DocType_ID IS NULL AND IsSOTrx='N' AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") // Default PO + .append("SET C_DocType_ID=(SELECT MAX(C_DocType_ID) FROM C_DocType d WHERE d.IsDefault='Y'") + .append(" AND d.DocBaseType='POO' AND o.AD_Client_ID=d.AD_Client_ID) ") + .append("WHERE C_DocType_ID IS NULL AND IsSOTrx='N' AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set PO Default DocType=" + no); - sql = new StringBuffer ("UPDATE I_Order o " // Default SO - + "SET C_DocType_ID=(SELECT MAX(C_DocType_ID) FROM C_DocType d WHERE d.IsDefault='Y'" - + " AND d.DocBaseType='SOO' AND o.AD_Client_ID=d.AD_Client_ID) " - + "WHERE C_DocType_ID IS NULL AND IsSOTrx='Y' AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") // Default SO + .append("SET C_DocType_ID=(SELECT MAX(C_DocType_ID) FROM C_DocType d WHERE d.IsDefault='Y'") + .append(" AND d.DocBaseType='SOO' AND o.AD_Client_ID=d.AD_Client_ID) ") + .append("WHERE C_DocType_ID IS NULL AND IsSOTrx='Y' AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set SO Default DocType=" + no); - sql = new StringBuffer ("UPDATE I_Order o " - + "SET C_DocType_ID=(SELECT MAX(C_DocType_ID) FROM C_DocType d WHERE d.IsDefault='Y'" - + " AND d.DocBaseType IN('SOO','POO') AND o.AD_Client_ID=d.AD_Client_ID) " - + "WHERE C_DocType_ID IS NULL AND IsSOTrx IS NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") + .append("SET C_DocType_ID=(SELECT MAX(C_DocType_ID) FROM C_DocType d WHERE d.IsDefault='Y'") + .append(" AND d.DocBaseType IN('SOO','POO') AND o.AD_Client_ID=d.AD_Client_ID) ") + .append("WHERE C_DocType_ID IS NULL AND IsSOTrx IS NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Default DocType=" + no); - sql = new StringBuffer ("UPDATE I_Order " // No DocType - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No DocType, ' " - + "WHERE C_DocType_ID IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order ") // No DocType + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No DocType, ' ") + .append("WHERE C_DocType_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("No DocType=" + no); // Set IsSOTrx - sql = new StringBuffer ("UPDATE I_Order o SET IsSOTrx='Y' " - + "WHERE EXISTS (SELECT * FROM C_DocType d WHERE o.C_DocType_ID=d.C_DocType_ID AND d.DocBaseType='SOO' AND o.AD_Client_ID=d.AD_Client_ID)" - + " AND C_DocType_ID IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o SET IsSOTrx='Y' ") + .append("WHERE EXISTS (SELECT * FROM C_DocType d WHERE o.C_DocType_ID=d.C_DocType_ID AND d.DocBaseType='SOO' AND o.AD_Client_ID=d.AD_Client_ID)") + .append(" AND C_DocType_ID IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set IsSOTrx=Y=" + no); - sql = new StringBuffer ("UPDATE I_Order o SET IsSOTrx='N' " - + "WHERE EXISTS (SELECT * FROM C_DocType d WHERE o.C_DocType_ID=d.C_DocType_ID AND d.DocBaseType='POO' AND o.AD_Client_ID=d.AD_Client_ID)" - + " AND C_DocType_ID IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o SET IsSOTrx='N' ") + .append("WHERE EXISTS (SELECT * FROM C_DocType d WHERE o.C_DocType_ID=d.C_DocType_ID AND d.DocBaseType='POO' AND o.AD_Client_ID=d.AD_Client_ID)") + .append(" AND C_DocType_ID IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set IsSOTrx=N=" + no); // Price List - sql = new StringBuffer ("UPDATE I_Order o " - + "SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p WHERE p.IsDefault='Y'" - + " AND p.C_Currency_ID=o.C_Currency_ID AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) " - + "WHERE M_PriceList_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") + .append("SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p WHERE p.IsDefault='Y'") + .append(" AND p.C_Currency_ID=o.C_Currency_ID AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE M_PriceList_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Default Currency PriceList=" + no); - sql = new StringBuffer ("UPDATE I_Order o " - + "SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p WHERE p.IsDefault='Y'" - + " AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) " - + "WHERE M_PriceList_ID IS NULL AND C_Currency_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") + .append("SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p WHERE p.IsDefault='Y'") + .append(" AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE M_PriceList_ID IS NULL AND C_Currency_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Default PriceList=" + no); - sql = new StringBuffer ("UPDATE I_Order o " - + "SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p " - + " WHERE p.C_Currency_ID=o.C_Currency_ID AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) " - + "WHERE M_PriceList_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") + .append("SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p ") + .append(" WHERE p.C_Currency_ID=o.C_Currency_ID AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE M_PriceList_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Currency PriceList=" + no); - sql = new StringBuffer ("UPDATE I_Order o " - + "SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p " - + " WHERE p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) " - + "WHERE M_PriceList_ID IS NULL AND C_Currency_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") + .append("SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p ") + .append(" WHERE p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE M_PriceList_ID IS NULL AND C_Currency_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set PriceList=" + no); // - sql = new StringBuffer ("UPDATE I_Order " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No PriceList, ' " - + "WHERE M_PriceList_ID IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No PriceList, ' ") + .append("WHERE M_PriceList_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning("No PriceList=" + no); // @Trifon - Import Order Source - sql = new StringBuffer ("UPDATE I_Order o " - + "SET C_OrderSource_ID=(SELECT C_OrderSource_ID FROM C_OrderSource p" - + " WHERE o.C_OrderSourceValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) " - + "WHERE C_OrderSource_ID IS NULL AND C_OrderSourceValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") + .append("SET C_OrderSource_ID=(SELECT C_OrderSource_ID FROM C_OrderSource p") + .append(" WHERE o.C_OrderSourceValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE C_OrderSource_ID IS NULL AND C_OrderSourceValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Order Source=" + no); // Set proper error message - sql = new StringBuffer ("UPDATE I_Order " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Not Found Order Source, ' " - + "WHERE C_OrderSource_ID IS NULL AND C_OrderSourceValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Not Found Order Source, ' ") + .append("WHERE C_OrderSource_ID IS NULL AND C_OrderSourceValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning("No OrderSource=" + no); // Payment Term - sql = new StringBuffer ("UPDATE I_Order o " - + "SET C_PaymentTerm_ID=(SELECT C_PaymentTerm_ID FROM C_PaymentTerm p" - + " WHERE o.PaymentTermValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) " - + "WHERE C_PaymentTerm_ID IS NULL AND PaymentTermValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") + .append("SET C_PaymentTerm_ID=(SELECT C_PaymentTerm_ID FROM C_PaymentTerm p") + .append(" WHERE o.PaymentTermValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE C_PaymentTerm_ID IS NULL AND PaymentTermValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set PaymentTerm=" + no); - sql = new StringBuffer ("UPDATE I_Order o " - + "SET C_PaymentTerm_ID=(SELECT MAX(C_PaymentTerm_ID) FROM C_PaymentTerm p" - + " WHERE p.IsDefault='Y' AND o.AD_Client_ID=p.AD_Client_ID) " - + "WHERE C_PaymentTerm_ID IS NULL AND o.PaymentTermValue IS NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") + .append("SET C_PaymentTerm_ID=(SELECT MAX(C_PaymentTerm_ID) FROM C_PaymentTerm p") + .append(" WHERE p.IsDefault='Y' AND o.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE C_PaymentTerm_ID IS NULL AND o.PaymentTermValue IS NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Default PaymentTerm=" + no); // - sql = new StringBuffer ("UPDATE I_Order " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No PaymentTerm, ' " - + "WHERE C_PaymentTerm_ID IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No PaymentTerm, ' ") + .append("WHERE C_PaymentTerm_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("No PaymentTerm=" + no); // Warehouse - sql = new StringBuffer ("UPDATE I_Order o " - + "SET M_Warehouse_ID=(SELECT MAX(M_Warehouse_ID) FROM M_Warehouse w" - + " WHERE o.AD_Client_ID=w.AD_Client_ID AND o.AD_Org_ID=w.AD_Org_ID) " - + "WHERE M_Warehouse_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") + .append("SET M_Warehouse_ID=(SELECT MAX(M_Warehouse_ID) FROM M_Warehouse w") + .append(" WHERE o.AD_Client_ID=w.AD_Client_ID AND o.AD_Org_ID=w.AD_Org_ID) ") + .append("WHERE M_Warehouse_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); // Warehouse for Org if (no != 0) log.fine("Set Warehouse=" + no); - sql = new StringBuffer ("UPDATE I_Order o " - + "SET M_Warehouse_ID=(SELECT M_Warehouse_ID FROM M_Warehouse w" - + " WHERE o.AD_Client_ID=w.AD_Client_ID) " - + "WHERE M_Warehouse_ID IS NULL" - + " AND EXISTS (SELECT AD_Client_ID FROM M_Warehouse w WHERE w.AD_Client_ID=o.AD_Client_ID GROUP BY AD_Client_ID HAVING COUNT(*)=1)" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") + .append("SET M_Warehouse_ID=(SELECT M_Warehouse_ID FROM M_Warehouse w") + .append(" WHERE o.AD_Client_ID=w.AD_Client_ID) ") + .append("WHERE M_Warehouse_ID IS NULL") + .append(" AND EXISTS (SELECT AD_Client_ID FROM M_Warehouse w WHERE w.AD_Client_ID=o.AD_Client_ID GROUP BY AD_Client_ID HAVING COUNT(*)=1)") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Set Only Client Warehouse=" + no); // - sql = new StringBuffer ("UPDATE I_Order " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Warehouse, ' " - + "WHERE M_Warehouse_ID IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Warehouse, ' ") + .append("WHERE M_Warehouse_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("No Warehouse=" + no); // BP from EMail - sql = new StringBuffer ("UPDATE I_Order o " - + "SET (C_BPartner_ID,AD_User_ID)=(SELECT C_BPartner_ID,AD_User_ID FROM AD_User u" - + " WHERE o.EMail=u.EMail AND o.AD_Client_ID=u.AD_Client_ID AND u.C_BPartner_ID IS NOT NULL) " - + "WHERE C_BPartner_ID IS NULL AND EMail IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") + .append("SET (C_BPartner_ID,AD_User_ID)=(SELECT C_BPartner_ID,AD_User_ID FROM AD_User u") + .append(" WHERE o.EMail=u.EMail AND o.AD_Client_ID=u.AD_Client_ID AND u.C_BPartner_ID IS NOT NULL) ") + .append("WHERE C_BPartner_ID IS NULL AND EMail IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set BP from EMail=" + no); // BP from ContactName - sql = new StringBuffer ("UPDATE I_Order o " - + "SET (C_BPartner_ID,AD_User_ID)=(SELECT C_BPartner_ID,AD_User_ID FROM AD_User u" - + " WHERE o.ContactName=u.Name AND o.AD_Client_ID=u.AD_Client_ID AND u.C_BPartner_ID IS NOT NULL) " - + "WHERE C_BPartner_ID IS NULL AND ContactName IS NOT NULL" - + " AND EXISTS (SELECT Name FROM AD_User u WHERE o.ContactName=u.Name AND o.AD_Client_ID=u.AD_Client_ID AND u.C_BPartner_ID IS NOT NULL GROUP BY Name HAVING COUNT(*)=1)" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") + .append("SET (C_BPartner_ID,AD_User_ID)=(SELECT C_BPartner_ID,AD_User_ID FROM AD_User u") + .append(" WHERE o.ContactName=u.Name AND o.AD_Client_ID=u.AD_Client_ID AND u.C_BPartner_ID IS NOT NULL) ") + .append("WHERE C_BPartner_ID IS NULL AND ContactName IS NOT NULL") + .append(" AND EXISTS (SELECT Name FROM AD_User u WHERE o.ContactName=u.Name AND o.AD_Client_ID=u.AD_Client_ID AND u.C_BPartner_ID IS NOT NULL GROUP BY Name HAVING COUNT(*)=1)") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set BP from ContactName=" + no); // BP from Value - sql = new StringBuffer ("UPDATE I_Order o " - + "SET C_BPartner_ID=(SELECT MAX(C_BPartner_ID) FROM C_BPartner bp" - + " WHERE o.BPartnerValue=bp.Value AND o.AD_Client_ID=bp.AD_Client_ID) " - + "WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") + .append("SET C_BPartner_ID=(SELECT MAX(C_BPartner_ID) FROM C_BPartner bp") + .append(" WHERE o.BPartnerValue=bp.Value AND o.AD_Client_ID=bp.AD_Client_ID) ") + .append("WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set BP from Value=" + no); // Default BP - sql = new StringBuffer ("UPDATE I_Order o " - + "SET C_BPartner_ID=(SELECT C_BPartnerCashTrx_ID FROM AD_ClientInfo c" - + " WHERE o.AD_Client_ID=c.AD_Client_ID) " - + "WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NULL AND Name IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") + .append("SET C_BPartner_ID=(SELECT C_BPartnerCashTrx_ID FROM AD_ClientInfo c") + .append(" WHERE o.AD_Client_ID=c.AD_Client_ID) ") + .append("WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NULL AND Name IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Default BP=" + no); // Existing Location ? Exact Match - sql = new StringBuffer ("UPDATE I_Order o " - + "SET (BillTo_ID,C_BPartner_Location_ID)=(SELECT C_BPartner_Location_ID,C_BPartner_Location_ID" - + " FROM C_BPartner_Location bpl INNER JOIN C_Location l ON (bpl.C_Location_ID=l.C_Location_ID)" - + " WHERE o.C_BPartner_ID=bpl.C_BPartner_ID AND bpl.AD_Client_ID=o.AD_Client_ID" - + " AND DUMP(o.Address1)=DUMP(l.Address1) AND DUMP(o.Address2)=DUMP(l.Address2)" - + " AND DUMP(o.City)=DUMP(l.City) AND DUMP(o.Postal)=DUMP(l.Postal)" - + " AND o.C_Region_ID=l.C_Region_ID AND o.C_Country_ID=l.C_Country_ID) " - + "WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL" - + " AND I_IsImported='N'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") + .append("SET (BillTo_ID,C_BPartner_Location_ID)=(SELECT C_BPartner_Location_ID,C_BPartner_Location_ID") + .append(" FROM C_BPartner_Location bpl INNER JOIN C_Location l ON (bpl.C_Location_ID=l.C_Location_ID)") + .append(" WHERE o.C_BPartner_ID=bpl.C_BPartner_ID AND bpl.AD_Client_ID=o.AD_Client_ID") + .append(" AND DUMP(o.Address1)=DUMP(l.Address1) AND DUMP(o.Address2)=DUMP(l.Address2)") + .append(" AND DUMP(o.City)=DUMP(l.City) AND DUMP(o.Postal)=DUMP(l.Postal)") + .append(" AND o.C_Region_ID=l.C_Region_ID AND o.C_Country_ID=l.C_Country_ID) ") + .append("WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL") + .append(" AND I_IsImported='N'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Found Location=" + no); // Set Bill Location from BPartner - sql = new StringBuffer ("UPDATE I_Order o " - + "SET BillTo_ID=(SELECT MAX(C_BPartner_Location_ID) FROM C_BPartner_Location l" - + " WHERE l.C_BPartner_ID=o.C_BPartner_ID AND o.AD_Client_ID=l.AD_Client_ID" - + " AND ((l.IsBillTo='Y' AND o.IsSOTrx='Y') OR (l.IsPayFrom='Y' AND o.IsSOTrx='N'))" - + ") " - + "WHERE C_BPartner_ID IS NOT NULL AND BillTo_ID IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") + .append("SET BillTo_ID=(SELECT MAX(C_BPartner_Location_ID) FROM C_BPartner_Location l") + .append(" WHERE l.C_BPartner_ID=o.C_BPartner_ID AND o.AD_Client_ID=l.AD_Client_ID") + .append(" AND ((l.IsBillTo='Y' AND o.IsSOTrx='Y') OR (l.IsPayFrom='Y' AND o.IsSOTrx='N'))") + .append(") ") + .append("WHERE C_BPartner_ID IS NOT NULL AND BillTo_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set BP BillTo from BP=" + no); // Set Location from BPartner - sql = new StringBuffer ("UPDATE I_Order o " - + "SET C_BPartner_Location_ID=(SELECT MAX(C_BPartner_Location_ID) FROM C_BPartner_Location l" - + " WHERE l.C_BPartner_ID=o.C_BPartner_ID AND o.AD_Client_ID=l.AD_Client_ID" - + " AND ((l.IsShipTo='Y' AND o.IsSOTrx='Y') OR o.IsSOTrx='N')" - + ") " - + "WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") + .append("SET C_BPartner_Location_ID=(SELECT MAX(C_BPartner_Location_ID) FROM C_BPartner_Location l") + .append(" WHERE l.C_BPartner_ID=o.C_BPartner_ID AND o.AD_Client_ID=l.AD_Client_ID") + .append(" AND ((l.IsShipTo='Y' AND o.IsSOTrx='Y') OR o.IsSOTrx='N')") + .append(") ") + .append("WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set BP Location from BP=" + no); // - sql = new StringBuffer ("UPDATE I_Order " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No BP Location, ' " - + "WHERE C_BPartner_ID IS NOT NULL AND (BillTo_ID IS NULL OR C_BPartner_Location_ID IS NULL)" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No BP Location, ' ") + .append("WHERE C_BPartner_ID IS NOT NULL AND (BillTo_ID IS NULL OR C_BPartner_Location_ID IS NULL)") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("No BP Location=" + no); @@ -377,117 +377,117 @@ public class ImportOrder extends SvrProcess no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Country Default=" + no); **/ - sql = new StringBuffer ("UPDATE I_Order o " - + "SET C_Country_ID=(SELECT C_Country_ID FROM C_Country c" - + " WHERE o.CountryCode=c.CountryCode AND c.AD_Client_ID IN (0, o.AD_Client_ID)) " - + "WHERE C_BPartner_ID IS NULL AND C_Country_ID IS NULL AND CountryCode IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") + .append("SET C_Country_ID=(SELECT C_Country_ID FROM C_Country c") + .append(" WHERE o.CountryCode=c.CountryCode AND c.AD_Client_ID IN (0, o.AD_Client_ID)) ") + .append("WHERE C_BPartner_ID IS NULL AND C_Country_ID IS NULL AND CountryCode IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Country=" + no); // - sql = new StringBuffer ("UPDATE I_Order " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Country, ' " - + "WHERE C_BPartner_ID IS NULL AND C_Country_ID IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Country, ' ") + .append("WHERE C_BPartner_ID IS NULL AND C_Country_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Country=" + no); // Set Region - sql = new StringBuffer ("UPDATE I_Order o " - + "Set RegionName=(SELECT MAX(Name) FROM C_Region r" - + " WHERE r.IsDefault='Y' AND r.C_Country_ID=o.C_Country_ID" - + " AND r.AD_Client_ID IN (0, o.AD_Client_ID)) " - + "WHERE C_BPartner_ID IS NULL AND C_Region_ID IS NULL AND RegionName IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") + .append("Set RegionName=(SELECT MAX(Name) FROM C_Region r") + .append(" WHERE r.IsDefault='Y' AND r.C_Country_ID=o.C_Country_ID") + .append(" AND r.AD_Client_ID IN (0, o.AD_Client_ID)) ") + .append("WHERE C_BPartner_ID IS NULL AND C_Region_ID IS NULL AND RegionName IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Region Default=" + no); // - sql = new StringBuffer ("UPDATE I_Order o " - + "Set C_Region_ID=(SELECT C_Region_ID FROM C_Region r" - + " WHERE r.Name=o.RegionName AND r.C_Country_ID=o.C_Country_ID" - + " AND r.AD_Client_ID IN (0, o.AD_Client_ID)) " - + "WHERE C_BPartner_ID IS NULL AND C_Region_ID IS NULL AND RegionName IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") + .append("Set C_Region_ID=(SELECT C_Region_ID FROM C_Region r") + .append(" WHERE r.Name=o.RegionName AND r.C_Country_ID=o.C_Country_ID") + .append(" AND r.AD_Client_ID IN (0, o.AD_Client_ID)) ") + .append("WHERE C_BPartner_ID IS NULL AND C_Region_ID IS NULL AND RegionName IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Region=" + no); // - sql = new StringBuffer ("UPDATE I_Order o " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Region, ' " - + "WHERE C_BPartner_ID IS NULL AND C_Region_ID IS NULL " - + " AND EXISTS (SELECT * FROM C_Country c" - + " WHERE c.C_Country_ID=o.C_Country_ID AND c.HasRegion='Y')" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Region, ' ") + .append("WHERE C_BPartner_ID IS NULL AND C_Region_ID IS NULL ") + .append(" AND EXISTS (SELECT * FROM C_Country c") + .append(" WHERE c.C_Country_ID=o.C_Country_ID AND c.HasRegion='Y')") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Region=" + no); // Product - sql = new StringBuffer ("UPDATE I_Order o " - + "SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p" - + " WHERE o.ProductValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) " - + "WHERE M_Product_ID IS NULL AND ProductValue IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") + .append("SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p") + .append(" WHERE o.ProductValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE M_Product_ID IS NULL AND ProductValue IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Product from Value=" + no); - sql = new StringBuffer ("UPDATE I_Order o " - + "SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p" - + " WHERE o.UPC=p.UPC AND o.AD_Client_ID=p.AD_Client_ID) " - + "WHERE M_Product_ID IS NULL AND UPC IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") + .append("SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p") + .append(" WHERE o.UPC=p.UPC AND o.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE M_Product_ID IS NULL AND UPC IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Product from UPC=" + no); - sql = new StringBuffer ("UPDATE I_Order o " - + "SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p" - + " WHERE o.SKU=p.SKU AND o.AD_Client_ID=p.AD_Client_ID) " - + "WHERE M_Product_ID IS NULL AND SKU IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") + .append("SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p") + .append(" WHERE o.SKU=p.SKU AND o.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE M_Product_ID IS NULL AND SKU IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Product fom SKU=" + no); - sql = new StringBuffer ("UPDATE I_Order " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Product, ' " - + "WHERE M_Product_ID IS NULL AND (ProductValue IS NOT NULL OR UPC IS NOT NULL OR SKU IS NOT NULL)" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Product, ' ") + .append("WHERE M_Product_ID IS NULL AND (ProductValue IS NOT NULL OR UPC IS NOT NULL OR SKU IS NOT NULL)") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Product=" + no); // Charge - sql = new StringBuffer ("UPDATE I_Order o " - + "SET C_Charge_ID=(SELECT C_Charge_ID FROM C_Charge c" - + " WHERE o.ChargeName=c.Name AND o.AD_Client_ID=c.AD_Client_ID) " - + "WHERE C_Charge_ID IS NULL AND ChargeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") + .append("SET C_Charge_ID=(SELECT C_Charge_ID FROM C_Charge c") + .append(" WHERE o.ChargeName=c.Name AND o.AD_Client_ID=c.AD_Client_ID) ") + .append("WHERE C_Charge_ID IS NULL AND ChargeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Charge=" + no); - sql = new StringBuffer ("UPDATE I_Order " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Charge, ' " - + "WHERE C_Charge_ID IS NULL AND (ChargeName IS NOT NULL)" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Charge, ' ") + .append("WHERE C_Charge_ID IS NULL AND (ChargeName IS NOT NULL)") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Charge=" + no); // - sql = new StringBuffer ("UPDATE I_Order " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Product and Charge, ' " - + "WHERE M_Product_ID IS NOT NULL AND C_Charge_ID IS NOT NULL " - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Product and Charge, ' ") + .append("WHERE M_Product_ID IS NOT NULL AND C_Charge_ID IS NOT NULL ") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Product and Charge exclusive=" + no); // Tax - sql = new StringBuffer ("UPDATE I_Order o " - + "SET C_Tax_ID=(SELECT MAX(C_Tax_ID) FROM C_Tax t" - + " WHERE o.TaxIndicator=t.TaxIndicator AND o.AD_Client_ID=t.AD_Client_ID) " - + "WHERE C_Tax_ID IS NULL AND TaxIndicator IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order o ") + .append("SET C_Tax_ID=(SELECT MAX(C_Tax_ID) FROM C_Tax t") + .append(" WHERE o.TaxIndicator=t.TaxIndicator AND o.AD_Client_ID=t.AD_Client_ID) ") + .append("WHERE C_Tax_ID IS NULL AND TaxIndicator IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Tax=" + no); - sql = new StringBuffer ("UPDATE I_Order " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Tax, ' " - + "WHERE C_Tax_ID IS NULL AND TaxIndicator IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Tax, ' ") + .append("WHERE C_Tax_ID IS NULL AND TaxIndicator IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Tax=" + no); @@ -497,8 +497,8 @@ public class ImportOrder extends SvrProcess // -- New BPartner --------------------------------------------------- // Go through Order Records w/o C_BPartner_ID - sql = new StringBuffer ("SELECT * FROM I_Order " - + "WHERE I_IsImported='N' AND C_BPartner_ID IS NULL").append (clientCheck); + sql = new StringBuilder ("SELECT * FROM I_Order ") + .append("WHERE I_IsImported='N' AND C_BPartner_ID IS NULL").append (clientCheck); try { PreparedStatement pstmt = DB.prepareStatement (sql.toString(), get_TrxName()); @@ -618,10 +618,10 @@ public class ImportOrder extends SvrProcess { log.log(Level.SEVERE, "BP - " + sql.toString(), e); } - sql = new StringBuffer ("UPDATE I_Order " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No BPartner, ' " - + "WHERE C_BPartner_ID IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Order ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No BPartner, ' ") + .append("WHERE C_BPartner_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("No BPartner=" + no); @@ -634,8 +634,8 @@ public class ImportOrder extends SvrProcess int noInsertLine = 0; // Go through Order Records w/o - sql = new StringBuffer ("SELECT * FROM I_Order " - + "WHERE I_IsImported='N'").append (clientCheck) + sql = new StringBuilder ("SELECT * FROM I_Order ") + .append("WHERE I_IsImported='N'").append (clientCheck) .append(" ORDER BY C_BPartner_ID, BillTo_ID, C_BPartner_Location_ID, I_Order_ID"); try { @@ -788,15 +788,16 @@ public class ImportOrder extends SvrProcess } // Set Error to indicator to not imported - sql = new StringBuffer ("UPDATE I_Order " - + "SET I_IsImported='N', Updated=SysDate " - + "WHERE I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Order ") + .append("SET I_IsImported='N', Updated=SysDate ") + .append("WHERE I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); addLog (0, null, new BigDecimal (no), "@Errors@"); // addLog (0, null, new BigDecimal (noInsert), "@C_Order_ID@: @Inserted@"); addLog (0, null, new BigDecimal (noInsertLine), "@C_OrderLine_ID@: @Inserted@"); - return "#" + noInsert + "/" + noInsertLine; + StringBuilder msgreturn = new StringBuilder("#").append(noInsert).append("/").append(noInsertLine); + return msgreturn.toString(); } // doIt } // ImportOrder diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportPayment.java b/org.adempiere.base.process/src/org/compiere/process/ImportPayment.java index 59ca16b95d..d14a362c84 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportPayment.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportPayment.java @@ -90,7 +90,7 @@ public class ImportPayment extends SvrProcess p_AD_Org_ID = ba.getAD_Org_ID(); log.info("AD_Org_ID=" + p_AD_Org_ID); - StringBuffer sql = null; + StringBuilder sql = null; int no = 0; String clientCheck = " AND AD_Client_ID=" + ba.getAD_Client_ID(); @@ -99,307 +99,307 @@ public class ImportPayment extends SvrProcess // Delete Old Imported if (p_deleteOldImported) { - sql = new StringBuffer ("DELETE I_Payment " - + "WHERE I_IsImported='Y'").append (clientCheck); + sql = new StringBuilder ("DELETE I_Payment ") + .append("WHERE I_IsImported='Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Delete Old Impored =" + no); } // Set Client, Org, IsActive, Created/Updated - sql = new StringBuffer ("UPDATE I_Payment " - + "SET AD_Client_ID = COALESCE (AD_Client_ID,").append (ba.getAD_Client_ID()).append (")," - + " AD_Org_ID = COALESCE (AD_Org_ID,").append (p_AD_Org_ID).append ("),"); - sql.append(" IsActive = COALESCE (IsActive, 'Y')," - + " Created = COALESCE (Created, SysDate)," - + " CreatedBy = COALESCE (CreatedBy, 0)," - + " Updated = COALESCE (Updated, SysDate)," - + " UpdatedBy = COALESCE (UpdatedBy, 0)," - + " I_ErrorMsg = ' '," - + " I_IsImported = 'N' " - + "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL OR AD_Client_ID IS NULL OR AD_Org_ID IS NULL OR AD_Client_ID=0 OR AD_Org_ID=0"); + sql = new StringBuilder ("UPDATE I_Payment ") + .append("SET AD_Client_ID = COALESCE (AD_Client_ID,").append (ba.getAD_Client_ID()).append ("),") + .append(" AD_Org_ID = COALESCE (AD_Org_ID,").append (p_AD_Org_ID).append ("),"); + sql.append(" IsActive = COALESCE (IsActive, 'Y'),") + .append(" Created = COALESCE (Created, SysDate),") + .append(" CreatedBy = COALESCE (CreatedBy, 0),") + .append(" Updated = COALESCE (Updated, SysDate),") + .append(" UpdatedBy = COALESCE (UpdatedBy, 0),") + .append(" I_ErrorMsg = ' ',") + .append(" I_IsImported = 'N' ") + .append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL OR AD_Client_ID IS NULL OR AD_Org_ID IS NULL OR AD_Client_ID=0 OR AD_Org_ID=0"); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.info ("Reset=" + no); - sql = new StringBuffer ("UPDATE I_Payment o " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '" - + "WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0" - + " OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Payment o ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '") + .append("WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0") + .append(" OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid Org=" + no); // Set Bank Account - sql = new StringBuffer("UPDATE I_Payment i " - + "SET C_BankAccount_ID=" - + "( " - + " SELECT C_BankAccount_ID " - + " FROM C_BankAccount a, C_Bank b " - + " WHERE b.IsOwnBank='Y' " - + " AND a.AD_Client_ID=i.AD_Client_ID " - + " AND a.C_Bank_ID=b.C_Bank_ID " - + " AND a.AccountNo=i.BankAccountNo " - + " AND b.RoutingNo=i.RoutingNo " - + " OR b.SwiftCode=i.RoutingNo " - + ") " - + "WHERE i.C_BankAccount_ID IS NULL " - + "AND i.I_IsImported<>'Y' " - + "OR i.I_IsImported IS NULL").append(clientCheck); + sql = new StringBuilder("UPDATE I_Payment i ") + .append("SET C_BankAccount_ID=") + .append("( ") + .append(" SELECT C_BankAccount_ID ") + .append(" FROM C_BankAccount a, C_Bank b ") + .append(" WHERE b.IsOwnBank='Y' ") + .append(" AND a.AD_Client_ID=i.AD_Client_ID ") + .append(" AND a.C_Bank_ID=b.C_Bank_ID ") + .append(" AND a.AccountNo=i.BankAccountNo ") + .append(" AND b.RoutingNo=i.RoutingNo ") + .append(" OR b.SwiftCode=i.RoutingNo ") + .append(") ") + .append("WHERE i.C_BankAccount_ID IS NULL ") + .append("AND i.I_IsImported<>'Y' ") + .append("OR i.I_IsImported IS NULL").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Bank Account (With Routing No)=" + no); // - sql = new StringBuffer("UPDATE I_Payment i " - + "SET C_BankAccount_ID=" - + "( " - + " SELECT C_BankAccount_ID " - + " FROM C_BankAccount a, C_Bank b " - + " WHERE b.IsOwnBank='Y' " - + " AND a.C_Bank_ID=b.C_Bank_ID " - + " AND a.AccountNo=i.BankAccountNo " - + " AND a.AD_Client_ID=i.AD_Client_ID " - + ") " - + "WHERE i.C_BankAccount_ID IS NULL " - + "AND i.I_isImported<>'Y' " - + "OR i.I_isImported IS NULL").append(clientCheck); + sql = new StringBuilder("UPDATE I_Payment i ") + .append("SET C_BankAccount_ID=") + .append("( ") + .append(" SELECT C_BankAccount_ID ") + .append(" FROM C_BankAccount a, C_Bank b ") + .append(" WHERE b.IsOwnBank='Y' ") + .append(" AND a.C_Bank_ID=b.C_Bank_ID ") + .append(" AND a.AccountNo=i.BankAccountNo ") + .append(" AND a.AD_Client_ID=i.AD_Client_ID ") + .append(") ") + .append("WHERE i.C_BankAccount_ID IS NULL ") + .append("AND i.I_isImported<>'Y' ") + .append("OR i.I_isImported IS NULL").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Bank Account (Without Routing No)=" + no); // - sql = new StringBuffer("UPDATE I_Payment i " - + "SET C_BankAccount_ID=(SELECT C_BankAccount_ID FROM C_BankAccount a WHERE a.C_BankAccount_ID=").append(p_C_BankAccount_ID); - sql.append(" and a.AD_Client_ID=i.AD_Client_ID) " - + "WHERE i.C_BankAccount_ID IS NULL " - + "AND i.BankAccountNo IS NULL " - + "AND i.I_isImported<>'Y' " - + "OR i.I_isImported IS NULL").append(clientCheck); + sql = new StringBuilder("UPDATE I_Payment i ") + .append("SET C_BankAccount_ID=(SELECT C_BankAccount_ID FROM C_BankAccount a WHERE a.C_BankAccount_ID=").append(p_C_BankAccount_ID); + sql.append(" and a.AD_Client_ID=i.AD_Client_ID) ") + .append("WHERE i.C_BankAccount_ID IS NULL ") + .append("AND i.BankAccountNo IS NULL ") + .append("AND i.I_isImported<>'Y' ") + .append("OR i.I_isImported IS NULL").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Bank Account=" + no); // - sql = new StringBuffer("UPDATE I_Payment " - + "SET I_isImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Bank Account, ' " - + "WHERE C_BankAccount_ID IS NULL " - + "AND I_isImported<>'Y' " - + "OR I_isImported IS NULL").append(clientCheck); + sql = new StringBuilder("UPDATE I_Payment ") + .append("SET I_isImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Bank Account, ' ") + .append("WHERE C_BankAccount_ID IS NULL ") + .append("AND I_isImported<>'Y' ") + .append("OR I_isImported IS NULL").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning("Invalid Bank Account=" + no); // Set Currency - sql = new StringBuffer ("UPDATE I_Payment i " - + "SET C_Currency_ID=(SELECT C_Currency_ID FROM C_Currency c" - + " WHERE i.ISO_Code=c.ISO_Code AND c.AD_Client_ID IN (0,i.AD_Client_ID)) " - + "WHERE C_Currency_ID IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Payment i ") + .append("SET C_Currency_ID=(SELECT C_Currency_ID FROM C_Currency c") + .append(" WHERE i.ISO_Code=c.ISO_Code AND c.AD_Client_ID IN (0,i.AD_Client_ID)) ") + .append("WHERE C_Currency_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Set Currency=" + no); // - sql = new StringBuffer("UPDATE I_Payment i " - + "SET C_Currency_ID=(SELECT C_Currency_ID FROM C_BankAccount WHERE C_BankAccount_ID=i.C_BankAccount_ID) " - + "WHERE i.C_Currency_ID IS NULL " - + "AND i.ISO_Code IS NULL").append(clientCheck); + sql = new StringBuilder("UPDATE I_Payment i ") + .append("SET C_Currency_ID=(SELECT C_Currency_ID FROM C_BankAccount WHERE C_BankAccount_ID=i.C_BankAccount_ID) ") + .append("WHERE i.C_Currency_ID IS NULL ") + .append("AND i.ISO_Code IS NULL").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Set Currency=" + no); // - sql = new StringBuffer ("UPDATE I_Payment " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Currency,' " - + "WHERE C_Currency_ID IS NULL " - + "AND I_IsImported<>'E' " - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Payment ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Currency,' ") + .append("WHERE C_Currency_ID IS NULL ") + .append("AND I_IsImported<>'E' ") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning("No Currency=" + no); // Set Amount - sql = new StringBuffer("UPDATE I_Payment " - + "SET ChargeAmt=0 " - + "WHERE ChargeAmt IS NULL " - + "AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder("UPDATE I_Payment ") + .append("SET ChargeAmt=0 ") + .append("WHERE ChargeAmt IS NULL ") + .append("AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Charge Amount=" + no); // - sql = new StringBuffer("UPDATE I_Payment " - + "SET TaxAmt=0 " - + "WHERE TaxAmt IS NULL " - + "AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder("UPDATE I_Payment ") + .append("SET TaxAmt=0 ") + .append("WHERE TaxAmt IS NULL ") + .append("AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Tax Amount=" + no); // - sql = new StringBuffer("UPDATE I_Payment " - + "SET WriteOffAmt=0 " - + "WHERE WriteOffAmt IS NULL " - + "AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder("UPDATE I_Payment ") + .append("SET WriteOffAmt=0 ") + .append("WHERE WriteOffAmt IS NULL ") + .append("AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("WriteOff Amount=" + no); // - sql = new StringBuffer("UPDATE I_Payment " - + "SET DiscountAmt=0 " - + "WHERE DiscountAmt IS NULL " - + "AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder("UPDATE I_Payment ") + .append("SET DiscountAmt=0 ") + .append("WHERE DiscountAmt IS NULL ") + .append("AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Discount Amount=" + no); // // Set Date - sql = new StringBuffer("UPDATE I_Payment " - + "SET DateTrx=Created " - + "WHERE DateTrx IS NULL " - + "AND I_isImported<>'Y'").append(clientCheck); + sql = new StringBuilder("UPDATE I_Payment ") + .append("SET DateTrx=Created ") + .append("WHERE DateTrx IS NULL ") + .append("AND I_isImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Trx Date=" + no); - sql = new StringBuffer("UPDATE I_Payment " - + "SET DateAcct=DateTrx " - + "WHERE DateAcct IS NULL " - + "AND I_isImported<>'Y'").append(clientCheck); + sql = new StringBuilder("UPDATE I_Payment ") + .append("SET DateAcct=DateTrx ") + .append("WHERE DateAcct IS NULL ") + .append("AND I_isImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Acct Date=" + no); // Invoice - sql = new StringBuffer ("UPDATE I_Payment i " - + "SET C_Invoice_ID=(SELECT MAX(C_Invoice_ID) FROM C_Invoice ii" - + " WHERE i.InvoiceDocumentNo=ii.DocumentNo AND i.AD_Client_ID=ii.AD_Client_ID) " - + "WHERE C_Invoice_ID IS NULL AND InvoiceDocumentNo IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Payment i ") + .append("SET C_Invoice_ID=(SELECT MAX(C_Invoice_ID) FROM C_Invoice ii") + .append(" WHERE i.InvoiceDocumentNo=ii.DocumentNo AND i.AD_Client_ID=ii.AD_Client_ID) ") + .append("WHERE C_Invoice_ID IS NULL AND InvoiceDocumentNo IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Set Invoice from DocumentNo=" + no); // BPartner - sql = new StringBuffer ("UPDATE I_Payment i " - + "SET C_BPartner_ID=(SELECT MAX(C_BPartner_ID) FROM C_BPartner bp" - + " WHERE i.BPartnerValue=bp.Value AND i.AD_Client_ID=bp.AD_Client_ID) " - + "WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Payment i ") + .append("SET C_BPartner_ID=(SELECT MAX(C_BPartner_ID) FROM C_BPartner bp") + .append(" WHERE i.BPartnerValue=bp.Value AND i.AD_Client_ID=bp.AD_Client_ID) ") + .append("WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Set BP from Value=" + no); - sql = new StringBuffer ("UPDATE I_Payment i " - + "SET C_BPartner_ID=(SELECT MAX(C_BPartner_ID) FROM C_Invoice ii" - + " WHERE i.C_Invoice_ID=ii.C_Invoice_ID AND i.AD_Client_ID=ii.AD_Client_ID) " - + "WHERE C_BPartner_ID IS NULL AND C_Invoice_ID IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Payment i ") + .append("SET C_BPartner_ID=(SELECT MAX(C_BPartner_ID) FROM C_Invoice ii") + .append(" WHERE i.C_Invoice_ID=ii.C_Invoice_ID AND i.AD_Client_ID=ii.AD_Client_ID) ") + .append("WHERE C_BPartner_ID IS NULL AND C_Invoice_ID IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Set BP from Invoice=" + no); - sql = new StringBuffer ("UPDATE I_Payment " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No BPartner,' " - + "WHERE C_BPartner_ID IS NULL " - + "AND I_IsImported<>'E' " - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Payment ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No BPartner,' ") + .append("WHERE C_BPartner_ID IS NULL ") + .append("AND I_IsImported<>'E' ") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning("No BPartner=" + no); // Check Payment<->Invoice combination - sql = new StringBuffer("UPDATE I_Payment " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Payment<->Invoice, ' " - + "WHERE I_Payment_ID IN " - + "(SELECT I_Payment_ID " - + "FROM I_Payment i" - + " INNER JOIN C_Payment p ON (i.C_Payment_ID=p.C_Payment_ID) " - + "WHERE i.C_Invoice_ID IS NOT NULL " - + " AND p.C_Invoice_ID IS NOT NULL " - + " AND p.C_Invoice_ID<>i.C_Invoice_ID) ") + sql = new StringBuilder("UPDATE I_Payment ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Payment<->Invoice, ' ") + .append("WHERE I_Payment_ID IN ") + .append("(SELECT I_Payment_ID ") + .append("FROM I_Payment i") + .append(" INNER JOIN C_Payment p ON (i.C_Payment_ID=p.C_Payment_ID) ") + .append("WHERE i.C_Invoice_ID IS NOT NULL ") + .append(" AND p.C_Invoice_ID IS NOT NULL ") + .append(" AND p.C_Invoice_ID<>i.C_Invoice_ID) ") .append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Payment<->Invoice Mismatch=" + no); // Check Payment<->BPartner combination - sql = new StringBuffer("UPDATE I_Payment " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Payment<->BPartner, ' " - + "WHERE I_Payment_ID IN " - + "(SELECT I_Payment_ID " - + "FROM I_Payment i" - + " INNER JOIN C_Payment p ON (i.C_Payment_ID=p.C_Payment_ID) " - + "WHERE i.C_BPartner_ID IS NOT NULL " - + " AND p.C_BPartner_ID IS NOT NULL " - + " AND p.C_BPartner_ID<>i.C_BPartner_ID) ") + sql = new StringBuilder("UPDATE I_Payment ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Payment<->BPartner, ' ") + .append("WHERE I_Payment_ID IN ") + .append("(SELECT I_Payment_ID ") + .append("FROM I_Payment i") + .append(" INNER JOIN C_Payment p ON (i.C_Payment_ID=p.C_Payment_ID) ") + .append("WHERE i.C_BPartner_ID IS NOT NULL ") + .append(" AND p.C_BPartner_ID IS NOT NULL ") + .append(" AND p.C_BPartner_ID<>i.C_BPartner_ID) ") .append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Payment<->BPartner Mismatch=" + no); // Check Invoice<->BPartner combination - sql = new StringBuffer("UPDATE I_Payment " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Invoice<->BPartner, ' " - + "WHERE I_Payment_ID IN " - + "(SELECT I_Payment_ID " - + "FROM I_Payment i" - + " INNER JOIN C_Invoice v ON (i.C_Invoice_ID=v.C_Invoice_ID) " - + "WHERE i.C_BPartner_ID IS NOT NULL " - + " AND v.C_BPartner_ID IS NOT NULL " - + " AND v.C_BPartner_ID<>i.C_BPartner_ID) ") + sql = new StringBuilder("UPDATE I_Payment ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Invoice<->BPartner, ' ") + .append("WHERE I_Payment_ID IN ") + .append("(SELECT I_Payment_ID ") + .append("FROM I_Payment i") + .append(" INNER JOIN C_Invoice v ON (i.C_Invoice_ID=v.C_Invoice_ID) ") + .append("WHERE i.C_BPartner_ID IS NOT NULL ") + .append(" AND v.C_BPartner_ID IS NOT NULL ") + .append(" AND v.C_BPartner_ID<>i.C_BPartner_ID) ") .append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Invoice<->BPartner Mismatch=" + no); // Check Invoice.BPartner<->Payment.BPartner combination - sql = new StringBuffer("UPDATE I_Payment " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Invoice.BPartner<->Payment.BPartner, ' " - + "WHERE I_Payment_ID IN " - + "(SELECT I_Payment_ID " - + "FROM I_Payment i" - + " INNER JOIN C_Invoice v ON (i.C_Invoice_ID=v.C_Invoice_ID)" - + " INNER JOIN C_Payment p ON (i.C_Payment_ID=p.C_Payment_ID) " - + "WHERE p.C_Invoice_ID<>v.C_Invoice_ID" - + " AND v.C_BPartner_ID<>p.C_BPartner_ID) ") + sql = new StringBuilder("UPDATE I_Payment ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Invoice.BPartner<->Payment.BPartner, ' ") + .append("WHERE I_Payment_ID IN ") + .append("(SELECT I_Payment_ID ") + .append("FROM I_Payment i") + .append(" INNER JOIN C_Invoice v ON (i.C_Invoice_ID=v.C_Invoice_ID)") + .append(" INNER JOIN C_Payment p ON (i.C_Payment_ID=p.C_Payment_ID) ") + .append("WHERE p.C_Invoice_ID<>v.C_Invoice_ID") + .append(" AND v.C_BPartner_ID<>p.C_BPartner_ID) ") .append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Invoice.BPartner<->Payment.BPartner Mismatch=" + no); // TrxType - sql = new StringBuffer("UPDATE I_Payment " - + "SET TrxType='S' " // MPayment.TRXTYPE_Sales - + "WHERE TrxType IS NULL " - + "AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder("UPDATE I_Payment ") + .append("SET TrxType='S' ") // MPayment.TRXTYPE_Sales + .append("WHERE TrxType IS NULL ") + .append("AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("TrxType Default=" + no); // TenderType - sql = new StringBuffer("UPDATE I_Payment " - + "SET TenderType='K' " // MPayment.TENDERTYPE_Check - + "WHERE TenderType IS NULL " - + "AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder("UPDATE I_Payment ") + .append("SET TenderType='K' ") // MPayment.TENDERTYPE_Check + .append("WHERE TenderType IS NULL ") + .append("AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("TenderType Default=" + no); // Document Type - sql = new StringBuffer ("UPDATE I_Payment i " - + "SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=i.DocTypeName" - + " AND d.DocBaseType IN ('ARR','APP') AND i.AD_Client_ID=d.AD_Client_ID) " - + "WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Payment i ") + .append("SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=i.DocTypeName") + .append(" AND d.DocBaseType IN ('ARR','APP') AND i.AD_Client_ID=d.AD_Client_ID) ") + .append("WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("Set DocType=" + no); - sql = new StringBuffer ("UPDATE I_Payment " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid DocTypeName, ' " - + "WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Payment ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid DocTypeName, ' ") + .append("WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("Invalid DocTypeName=" + no); - sql = new StringBuffer ("UPDATE I_Payment " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No DocType, ' " - + "WHERE C_DocType_ID IS NULL" - + " AND I_IsImported<>'Y'").append (clientCheck); + sql = new StringBuilder ("UPDATE I_Payment ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No DocType, ' ") + .append("WHERE C_DocType_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning ("No DocType=" + no); @@ -407,9 +407,9 @@ public class ImportPayment extends SvrProcess commitEx(); //Import Bank Statement - sql = new StringBuffer("SELECT * FROM I_Payment" - + " WHERE I_IsImported='N'" - + " ORDER BY C_BankAccount_ID, CheckNo, DateTrx, R_AuthCode"); + sql = new StringBuilder("SELECT * FROM I_Payment") + .append(" WHERE I_IsImported='N'") + .append(" ORDER BY C_BankAccount_ID, CheckNo, DateTrx, R_AuthCode"); MBankAccount account = null; PreparedStatement pstmt = null; @@ -526,9 +526,9 @@ public class ImportPayment extends SvrProcess } // Set Error to indicator to not imported - sql = new StringBuffer ("UPDATE I_Payment " - + "SET I_IsImported='N', Updated=SysDate " - + "WHERE I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Payment ") + .append("SET I_IsImported='N', Updated=SysDate ") + .append("WHERE I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); addLog (0, null, new BigDecimal (no), "@Errors@"); // diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportProduct.java b/org.adempiere.base.process/src/org/compiere/process/ImportProduct.java index a53510c97b..3b2c644945 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportProduct.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportProduct.java @@ -83,7 +83,7 @@ public class ImportProduct extends SvrProcess implements ImportProcess */ protected String doIt() throws java.lang.Exception { - StringBuffer sql = null; + StringBuilder sql = null; int no = 0; String clientCheck = getWhereClause(); @@ -92,43 +92,43 @@ public class ImportProduct extends SvrProcess implements ImportProcess // Delete Old Imported if (m_deleteOldImported) { - sql = new StringBuffer ("DELETE I_Product " - + "WHERE I_IsImported='Y'").append(clientCheck); + sql = new StringBuilder ("DELETE I_Product ") + .append("WHERE I_IsImported='Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.info("Delete Old Imported =" + no); } // Set Client, Org, IaActive, Created/Updated, ProductType - sql = new StringBuffer ("UPDATE I_Product " - + "SET AD_Client_ID = COALESCE (AD_Client_ID, ").append(m_AD_Client_ID).append(")," - + " AD_Org_ID = COALESCE (AD_Org_ID, 0)," - + " IsActive = COALESCE (IsActive, 'Y')," - + " Created = COALESCE (Created, SysDate)," - + " CreatedBy = COALESCE (CreatedBy, 0)," - + " Updated = COALESCE (Updated, SysDate)," - + " UpdatedBy = COALESCE (UpdatedBy, 0)," - + " ProductType = COALESCE (ProductType, 'I')," - + " I_ErrorMsg = ' '," - + " I_IsImported = 'N' " - + "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); + sql = new StringBuilder ("UPDATE I_Product ") + .append("SET AD_Client_ID = COALESCE (AD_Client_ID, ").append(m_AD_Client_ID).append("),") + .append(" AD_Org_ID = COALESCE (AD_Org_ID, 0),") + .append(" IsActive = COALESCE (IsActive, 'Y'),") + .append(" Created = COALESCE (Created, SysDate),") + .append(" CreatedBy = COALESCE (CreatedBy, 0),") + .append(" Updated = COALESCE (Updated, SysDate),") + .append(" UpdatedBy = COALESCE (UpdatedBy, 0),") + .append(" ProductType = COALESCE (ProductType, 'I'),") + .append(" I_ErrorMsg = ' ',") + .append(" I_IsImported = 'N' ") + .append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.info("Reset=" + no); ModelValidationEngine.get().fireImportValidate(this, null, null, ImportValidator.TIMING_BEFORE_VALIDATE); // Set Optional BPartner - sql = new StringBuffer ("UPDATE I_Product i " - + "SET C_BPartner_ID=(SELECT C_BPartner_ID FROM C_BPartner p" - + " WHERE i.BPartner_Value=p.Value AND i.AD_Client_ID=p.AD_Client_ID) " - + "WHERE C_BPartner_ID IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Product i ") + .append("SET C_BPartner_ID=(SELECT C_BPartner_ID FROM C_BPartner p") + .append(" WHERE i.BPartner_Value=p.Value AND i.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE C_BPartner_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.info("BPartner=" + no); // - sql = new StringBuffer ("UPDATE I_Product " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid BPartner,' " - + "WHERE C_BPartner_ID IS NULL AND BPartner_Value IS NOT NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Product ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid BPartner,' ") + .append("WHERE C_BPartner_ID IS NULL AND BPartner_Value IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning("Invalid BPartner=" + no); @@ -136,48 +136,48 @@ public class ImportProduct extends SvrProcess implements ImportProcess // **** Find Product // EAN/UPC - sql = new StringBuffer ("UPDATE I_Product i " - + "SET M_Product_ID=(SELECT M_Product_ID FROM M_Product p" - + " WHERE i.UPC=p.UPC AND i.AD_Client_ID=p.AD_Client_ID) " - + "WHERE M_Product_ID IS NULL" - + " AND I_IsImported='N'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Product i ") + .append("SET M_Product_ID=(SELECT M_Product_ID FROM M_Product p") + .append(" WHERE i.UPC=p.UPC AND i.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE M_Product_ID IS NULL") + .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.info("Product Existing UPC=" + no); // Value - sql = new StringBuffer ("UPDATE I_Product i " - + "SET M_Product_ID=(SELECT M_Product_ID FROM M_Product p" - + " WHERE i.Value=p.Value AND i.AD_Client_ID=p.AD_Client_ID) " - + "WHERE M_Product_ID IS NULL" - + " AND I_IsImported='N'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Product i ") + .append("SET M_Product_ID=(SELECT M_Product_ID FROM M_Product p") + .append(" WHERE i.Value=p.Value AND i.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE M_Product_ID IS NULL") + .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.info("Product Existing Value=" + no); // BP ProdNo - sql = new StringBuffer ("UPDATE I_Product i " - + "SET M_Product_ID=(SELECT M_Product_ID FROM M_Product_po p" - + " WHERE i.C_BPartner_ID=p.C_BPartner_ID" - + " AND i.VendorProductNo=p.VendorProductNo AND i.AD_Client_ID=p.AD_Client_ID) " - + "WHERE M_Product_ID IS NULL" - + " AND I_IsImported='N'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Product i ") + .append("SET M_Product_ID=(SELECT M_Product_ID FROM M_Product_po p") + .append(" WHERE i.C_BPartner_ID=p.C_BPartner_ID") + .append(" AND i.VendorProductNo=p.VendorProductNo AND i.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE M_Product_ID IS NULL") + .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.info("Product Existing Vendor ProductNo=" + no); // Set Product Category - sql = new StringBuffer ("UPDATE I_Product " - + "SET ProductCategory_Value=(SELECT MAX(Value) FROM M_Product_Category" - + " WHERE IsDefault='Y' AND AD_Client_ID=").append(m_AD_Client_ID).append(") " - + "WHERE ProductCategory_Value IS NULL AND M_Product_Category_ID IS NULL" - + " AND M_Product_ID IS NULL" // set category only if product not found - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Product ") + .append("SET ProductCategory_Value=(SELECT MAX(Value) FROM M_Product_Category") + .append(" WHERE IsDefault='Y' AND AD_Client_ID=").append(m_AD_Client_ID).append(") ") + .append("WHERE ProductCategory_Value IS NULL AND M_Product_Category_ID IS NULL") + .append(" AND M_Product_ID IS NULL") // set category only if product not found + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Category Default Value=" + no); // - sql = new StringBuffer ("UPDATE I_Product i " - + "SET M_Product_Category_ID=(SELECT M_Product_Category_ID FROM M_Product_Category c" - + " WHERE i.ProductCategory_Value=c.Value AND i.AD_Client_ID=c.AD_Client_ID) " - + "WHERE ProductCategory_Value IS NOT NULL AND M_Product_Category_ID IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Product i ") + .append("SET M_Product_Category_ID=(SELECT M_Product_Category_ID FROM M_Product_Category c") + .append(" WHERE i.ProductCategory_Value=c.Value AND i.AD_Client_ID=c.AD_Client_ID) ") + .append("WHERE ProductCategory_Value IS NOT NULL AND M_Product_Category_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.info("Set Category=" + no); @@ -188,12 +188,12 @@ public class ImportProduct extends SvrProcess implements ImportProcess "Discontinued","DiscontinuedBy","DiscontinuedAt","ImageURL","DescriptionURL"}; for (int i = 0; i < strFields.length; i++) { - sql = new StringBuffer ("UPDATE I_Product i " - + "SET ").append(strFields[i]).append(" = (SELECT ").append(strFields[i]).append(" FROM M_Product p" - + " WHERE i.M_Product_ID=p.M_Product_ID AND i.AD_Client_ID=p.AD_Client_ID) " - + "WHERE M_Product_ID IS NOT NULL" - + " AND ").append(strFields[i]).append(" IS NULL" - + " AND I_IsImported='N'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Product i ") + .append("SET ").append(strFields[i]).append(" = (SELECT ").append(strFields[i]).append(" FROM M_Product p") + .append(" WHERE i.M_Product_ID=p.M_Product_ID AND i.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE M_Product_ID IS NOT NULL") + .append(" AND ").append(strFields[i]).append(" IS NULL") + .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine(strFields[i] + " - default from existing Product=" + no); @@ -202,12 +202,12 @@ public class ImportProduct extends SvrProcess implements ImportProcess "Volume","Weight","ShelfWidth","ShelfHeight","ShelfDepth","UnitsPerPallet"}; for (int i = 0; i < numFields.length; i++) { - sql = new StringBuffer ("UPDATE I_PRODUCT i " - + "SET ").append(numFields[i]).append(" = (SELECT ").append(numFields[i]).append(" FROM M_Product p" - + " WHERE i.M_Product_ID=p.M_Product_ID AND i.AD_Client_ID=p.AD_Client_ID) " - + "WHERE M_Product_ID IS NOT NULL" - + " AND (").append(numFields[i]).append(" IS NULL OR ").append(numFields[i]).append("=0)" - + " AND I_IsImported='N'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_PRODUCT i ") + .append("SET ").append(numFields[i]).append(" = (SELECT ").append(numFields[i]).append(" FROM M_Product p") + .append(" WHERE i.M_Product_ID=p.M_Product_ID AND i.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE M_Product_ID IS NOT NULL") + .append(" AND (").append(numFields[i]).append(" IS NULL OR ").append(numFields[i]).append("=0)") + .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine(numFields[i] + " default from existing Product=" + no); @@ -219,13 +219,13 @@ public class ImportProduct extends SvrProcess implements ImportProcess "Discontinued","DiscontinuedBy", "DiscontinuedAt"}; for (int i = 0; i < strFieldsPO.length; i++) { - sql = new StringBuffer ("UPDATE I_PRODUCT i " - + "SET ").append(strFieldsPO[i]).append(" = (SELECT ").append(strFieldsPO[i]) - .append(" FROM M_Product_PO p" - + " WHERE i.M_Product_ID=p.M_Product_ID AND i.C_BPartner_ID=p.C_BPartner_ID AND i.AD_Client_ID=p.AD_Client_ID) " - + "WHERE M_Product_ID IS NOT NULL AND C_BPartner_ID IS NOT NULL" - + " AND ").append(strFieldsPO[i]).append(" IS NULL" - + " AND I_IsImported='N'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_PRODUCT i ") + .append("SET ").append(strFieldsPO[i]).append(" = (SELECT ").append(strFieldsPO[i]) + .append(" FROM M_Product_PO p") + .append(" WHERE i.M_Product_ID=p.M_Product_ID AND i.C_BPartner_ID=p.C_BPartner_ID AND i.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE M_Product_ID IS NOT NULL AND C_BPartner_ID IS NOT NULL") + .append(" AND ").append(strFieldsPO[i]).append(" IS NULL") + .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine(strFieldsPO[i] + " default from existing Product PO=" + no); @@ -235,111 +235,111 @@ public class ImportProduct extends SvrProcess implements ImportProcess "Order_Min","Order_Pack","CostPerOrder","DeliveryTime_Promised"}; for (int i = 0; i < numFieldsPO.length; i++) { - sql = new StringBuffer ("UPDATE I_PRODUCT i " - + "SET ").append(numFieldsPO[i]).append(" = (SELECT ").append(numFieldsPO[i]) - .append(" FROM M_Product_PO p" - + " WHERE i.M_Product_ID=p.M_Product_ID AND i.C_BPartner_ID=p.C_BPartner_ID AND i.AD_Client_ID=p.AD_Client_ID) " - + "WHERE M_Product_ID IS NOT NULL AND C_BPartner_ID IS NOT NULL" - + " AND (").append(numFieldsPO[i]).append(" IS NULL OR ").append(numFieldsPO[i]).append("=0)" - + " AND I_IsImported='N'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_PRODUCT i ") + .append("SET ").append(numFieldsPO[i]).append(" = (SELECT ").append(numFieldsPO[i]) + .append(" FROM M_Product_PO p") + .append(" WHERE i.M_Product_ID=p.M_Product_ID AND i.C_BPartner_ID=p.C_BPartner_ID AND i.AD_Client_ID=p.AD_Client_ID) ") + .append("WHERE M_Product_ID IS NOT NULL AND C_BPartner_ID IS NOT NULL") + .append(" AND (").append(numFieldsPO[i]).append(" IS NULL OR ").append(numFieldsPO[i]).append("=0)") + .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine(numFieldsPO[i] + " default from existing Product PO=" + no); } // Invalid Category - sql = new StringBuffer ("UPDATE I_Product " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid ProdCategory,' " - + "WHERE M_Product_Category_ID IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Product ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid ProdCategory,' ") + .append("WHERE M_Product_Category_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning("Invalid Category=" + no); // Set UOM (System/own) - sql = new StringBuffer ("UPDATE I_Product i " - + "SET X12DE355 = " - + "(SELECT MAX(X12DE355) FROM C_UOM u WHERE u.IsDefault='Y' AND u.AD_Client_ID IN (0,i.AD_Client_ID)) " - + "WHERE X12DE355 IS NULL AND C_UOM_ID IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Product i ") + .append("SET X12DE355 = ") + .append("(SELECT MAX(X12DE355) FROM C_UOM u WHERE u.IsDefault='Y' AND u.AD_Client_ID IN (0,i.AD_Client_ID)) ") + .append("WHERE X12DE355 IS NULL AND C_UOM_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set UOM Default=" + no); // - sql = new StringBuffer ("UPDATE I_Product i " - + "SET C_UOM_ID = (SELECT C_UOM_ID FROM C_UOM u WHERE u.X12DE355=i.X12DE355 AND u.AD_Client_ID IN (0,i.AD_Client_ID)) " - + "WHERE C_UOM_ID IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Product i ") + .append("SET C_UOM_ID = (SELECT C_UOM_ID FROM C_UOM u WHERE u.X12DE355=i.X12DE355 AND u.AD_Client_ID IN (0,i.AD_Client_ID)) ") + .append("WHERE C_UOM_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.info("Set UOM=" + no); // - sql = new StringBuffer ("UPDATE I_Product " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid UOM, ' " - + "WHERE C_UOM_ID IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Product ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid UOM, ' ") + .append("WHERE C_UOM_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning("Invalid UOM=" + no); // Set Currency - sql = new StringBuffer ("UPDATE I_Product i " - + "SET ISO_Code=(SELECT ISO_Code FROM C_Currency c" - + " INNER JOIN C_AcctSchema a ON (a.C_Currency_ID=c.C_Currency_ID)" - + " INNER JOIN AD_ClientInfo ci ON (a.C_AcctSchema_ID=ci.C_AcctSchema1_ID)" - + " WHERE ci.AD_Client_ID=i.AD_Client_ID) " - + "WHERE C_Currency_ID IS NULL AND ISO_Code IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Product i ") + .append("SET ISO_Code=(SELECT ISO_Code FROM C_Currency c") + .append(" INNER JOIN C_AcctSchema a ON (a.C_Currency_ID=c.C_Currency_ID)") + .append(" INNER JOIN AD_ClientInfo ci ON (a.C_AcctSchema_ID=ci.C_AcctSchema1_ID)") + .append(" WHERE ci.AD_Client_ID=i.AD_Client_ID) ") + .append("WHERE C_Currency_ID IS NULL AND ISO_Code IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set Currency Default=" + no); // - sql = new StringBuffer ("UPDATE I_Product i " - + "SET C_Currency_ID=(SELECT C_Currency_ID FROM C_Currency c" - + " WHERE i.ISO_Code=c.ISO_Code AND c.AD_Client_ID IN (0,i.AD_Client_ID)) " - + "WHERE C_Currency_ID IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Product i ") + .append("SET C_Currency_ID=(SELECT C_Currency_ID FROM C_Currency c") + .append(" WHERE i.ISO_Code=c.ISO_Code AND c.AD_Client_ID IN (0,i.AD_Client_ID)) ") + .append("WHERE C_Currency_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.info("doIt- Set Currency=" + no); // - sql = new StringBuffer ("UPDATE I_Product " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Currency,' " - + "WHERE C_Currency_ID IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Product ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Currency,' ") + .append("WHERE C_Currency_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning("Invalid Currency=" + no); // Verify ProductType - sql = new StringBuffer ("UPDATE I_Product " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid ProductType,' " - + "WHERE ProductType NOT IN ('E','I','R','S')" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Product ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid ProductType,' ") + .append("WHERE ProductType NOT IN ('E','I','R','S')") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning("Invalid ProductType=" + no); // Unique UPC/Value - sql = new StringBuffer ("UPDATE I_Product i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Value not unique,' " - + "WHERE I_IsImported<>'Y'" - + " AND Value IN (SELECT Value FROM I_Product ii WHERE i.AD_Client_ID=ii.AD_Client_ID GROUP BY Value HAVING COUNT(*) > 1)").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Product i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Value not unique,' ") + .append("WHERE I_IsImported<>'Y'") + .append(" AND Value IN (SELECT Value FROM I_Product ii WHERE i.AD_Client_ID=ii.AD_Client_ID GROUP BY Value HAVING COUNT(*) > 1)").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning("Not Unique Value=" + no); // - sql = new StringBuffer ("UPDATE I_Product i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=UPC not unique,' " - + "WHERE I_IsImported<>'Y'" - + " AND UPC IN (SELECT UPC FROM I_Product ii WHERE i.AD_Client_ID=ii.AD_Client_ID GROUP BY UPC HAVING COUNT(*) > 1)").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Product i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=UPC not unique,' ") + .append("WHERE I_IsImported<>'Y'") + .append(" AND UPC IN (SELECT UPC FROM I_Product ii WHERE i.AD_Client_ID=ii.AD_Client_ID GROUP BY UPC HAVING COUNT(*) > 1)").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning("Not Unique UPC=" + no); // Mandatory Value - sql = new StringBuffer ("UPDATE I_Product i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Mandatory Value,' " - + "WHERE Value IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Product i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Mandatory Value,' ") + .append("WHERE Value IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.warning("No Mandatory Value=" + no); @@ -351,19 +351,19 @@ public class ImportProduct extends SvrProcess implements ImportProcess // + " AND VendorProductNo IS NULL AND (C_BPartner_ID IS NOT NULL OR BPartner_Value IS NOT NULL)").append(clientCheck); // no = DB.executeUpdate(sql.toString(), get_TrxName()); // log.info(log.l3_Util, "No Mandatory VendorProductNo=" + no); - sql = new StringBuffer ("UPDATE I_Product " - + "SET VendorProductNo=Value " - + "WHERE C_BPartner_ID IS NOT NULL AND VendorProductNo IS NULL" - + " AND I_IsImported='N'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Product ") + .append("SET VendorProductNo=Value ") + .append("WHERE C_BPartner_ID IS NOT NULL AND VendorProductNo IS NULL") + .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.info("VendorProductNo Set to Value=" + no); // - sql = new StringBuffer ("UPDATE I_Product i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=VendorProductNo not unique,' " - + "WHERE I_IsImported<>'Y'" - + " AND C_BPartner_ID IS NOT NULL" - + " AND (C_BPartner_ID, VendorProductNo) IN " - + " (SELECT C_BPartner_ID, VendorProductNo FROM I_Product ii WHERE i.AD_Client_ID=ii.AD_Client_ID GROUP BY C_BPartner_ID, VendorProductNo HAVING COUNT(*) > 1)") + sql = new StringBuilder ("UPDATE I_Product i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=VendorProductNo not unique,' ") + .append("WHERE I_IsImported<>'Y'") + .append(" AND C_BPartner_ID IS NOT NULL") + .append(" AND (C_BPartner_ID, VendorProductNo) IN ") + .append(" (SELECT C_BPartner_ID, VendorProductNo FROM I_Product ii WHERE i.AD_Client_ID=ii.AD_Client_ID GROUP BY C_BPartner_ID, VendorProductNo HAVING COUNT(*) > 1)") .append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) @@ -373,8 +373,8 @@ public class ImportProduct extends SvrProcess implements ImportProcess int C_TaxCategory_ID = 0; try { - PreparedStatement pstmt = DB.prepareStatement - ("SELECT C_TaxCategory_ID FROM C_TaxCategory WHERE IsDefault='Y'" + clientCheck, get_TrxName()); + StringBuilder dbpst = new StringBuilder("SELECT C_TaxCategory_ID FROM C_TaxCategory WHERE IsDefault='Y'").append(clientCheck); + PreparedStatement pstmt = DB.prepareStatement(dbpst.toString(), get_TrxName()); ResultSet rs = pstmt.executeQuery(); if (rs.next()) C_TaxCategory_ID = rs.getInt(1); @@ -399,7 +399,7 @@ public class ImportProduct extends SvrProcess implements ImportProcess // Go through Records log.fine("start inserting/updating ..."); - sql = new StringBuffer ("SELECT * FROM I_Product WHERE I_IsImported='N'") + sql = new StringBuilder ("SELECT * FROM I_Product WHERE I_IsImported='N'") .append(clientCheck); try { @@ -504,8 +504,8 @@ public class ImportProduct extends SvrProcess implements ImportProcess } else { - StringBuffer sql0 = new StringBuffer ("UPDATE I_Product i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert Product failed")) + StringBuilder sql0 = new StringBuilder ("UPDATE I_Product i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert Product failed")) .append("WHERE I_Product_ID=").append(I_Product_ID); DB.executeUpdate(sql0.toString(), get_TrxName()); continue; @@ -513,19 +513,19 @@ public class ImportProduct extends SvrProcess implements ImportProcess } else // Update Product { - String sqlt = "UPDATE M_PRODUCT " - + "SET (Value,Name,Description,DocumentNote,Help," - + "UPC,SKU,C_UOM_ID,M_Product_Category_ID,Classification,ProductType," - + "Volume,Weight,ShelfWidth,ShelfHeight,ShelfDepth,UnitsPerPallet," - + "Discontinued,DiscontinuedBy, DiscontinuedAt, Updated,UpdatedBy)= " - + "(SELECT Value,Name,Description,DocumentNote,Help," - + "UPC,SKU,C_UOM_ID,M_Product_Category_ID,Classification,ProductType," - + "Volume,Weight,ShelfWidth,ShelfHeight,ShelfDepth,UnitsPerPallet," - + "Discontinued,DiscontinuedBy, DiscontinuedAt, SysDate,UpdatedBy" - + " FROM I_Product WHERE I_Product_ID="+I_Product_ID+") " - + "WHERE M_Product_ID="+M_Product_ID; + StringBuilder sqlt = new StringBuilder("UPDATE M_PRODUCT ") + .append("SET (Value,Name,Description,DocumentNote,Help,") + .append("UPC,SKU,C_UOM_ID,M_Product_Category_ID,Classification,ProductType,") + .append("Volume,Weight,ShelfWidth,ShelfHeight,ShelfDepth,UnitsPerPallet,") + .append("Discontinued,DiscontinuedBy, DiscontinuedAt, Updated,UpdatedBy)= ") + .append("(SELECT Value,Name,Description,DocumentNote,Help,") + .append("UPC,SKU,C_UOM_ID,M_Product_Category_ID,Classification,ProductType,") + .append("Volume,Weight,ShelfWidth,ShelfHeight,ShelfDepth,UnitsPerPallet,") + .append("Discontinued,DiscontinuedBy, DiscontinuedAt, SysDate,UpdatedBy") + .append(" FROM I_Product WHERE I_Product_ID=").append(I_Product_ID).append(") ") + .append("WHERE M_Product_ID=").append(M_Product_ID); PreparedStatement pstmt_updateProduct = DB.prepareStatement - (sqlt, get_TrxName()); + (sqlt.toString(), get_TrxName()); //jz pstmt_updateProduct.setInt(1, I_Product_ID); // pstmt_updateProduct.setInt(2, M_Product_ID); @@ -538,8 +538,8 @@ public class ImportProduct extends SvrProcess implements ImportProcess catch (SQLException ex) { log.warning("Update Product - " + ex.toString()); - StringBuffer sql0 = new StringBuffer ("UPDATE I_Product i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Update Product: " + ex.toString())) + StringBuilder sql0 = new StringBuilder ("UPDATE I_Product i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Update Product: " + ex.toString())) .append("WHERE I_Product_ID=").append(I_Product_ID); DB.executeUpdate(sql0.toString(), get_TrxName()); continue; @@ -554,22 +554,22 @@ public class ImportProduct extends SvrProcess implements ImportProcess // If Product existed, Try to Update first if (!newProduct) { - String sqlt = "UPDATE M_Product_PO " - + "SET (IsCurrentVendor,C_UOM_ID,C_Currency_ID,UPC," - + "PriceList,PricePO,RoyaltyAmt,PriceEffective," - + "VendorProductNo,VendorCategory,Manufacturer," - + "Discontinued,DiscontinuedBy, DiscontinuedAt, Order_Min,Order_Pack," - + "CostPerOrder,DeliveryTime_Promised,Updated,UpdatedBy)= " - + "(SELECT CAST('Y' AS CHAR),C_UOM_ID,C_Currency_ID,UPC," //jz fix EDB unknown datatype error - + "PriceList,PricePO,RoyaltyAmt,PriceEffective," - + "VendorProductNo,VendorCategory,Manufacturer," - + "Discontinued,DiscontinuedBy, DiscontinuedAt, Order_Min,Order_Pack," - + "CostPerOrder,DeliveryTime_Promised,SysDate,UpdatedBy" - + " FROM I_Product" - + " WHERE I_Product_ID="+I_Product_ID+") " - + "WHERE M_Product_ID="+M_Product_ID+" AND C_BPartner_ID="+C_BPartner_ID; + StringBuilder sqlt = new StringBuilder("UPDATE M_Product_PO ") + .append("SET (IsCurrentVendor,C_UOM_ID,C_Currency_ID,UPC,") + .append("PriceList,PricePO,RoyaltyAmt,PriceEffective,") + .append("VendorProductNo,VendorCategory,Manufacturer,") + .append("Discontinued,DiscontinuedBy, DiscontinuedAt, Order_Min,Order_Pack,") + .append("CostPerOrder,DeliveryTime_Promised,Updated,UpdatedBy)= ") + .append("(SELECT CAST('Y' AS CHAR),C_UOM_ID,C_Currency_ID,UPC,") //jz fix EDB unknown datatype error + .append("PriceList,PricePO,RoyaltyAmt,PriceEffective,") + .append("VendorProductNo,VendorCategory,Manufacturer,") + .append("Discontinued,DiscontinuedBy, DiscontinuedAt, Order_Min,Order_Pack,") + .append("CostPerOrder,DeliveryTime_Promised,SysDate,UpdatedBy") + .append(" FROM I_Product") + .append(" WHERE I_Product_ID=").append(I_Product_ID).append(") ") + .append("WHERE M_Product_ID=").append(M_Product_ID).append(" AND C_BPartner_ID=").append(C_BPartner_ID); PreparedStatement pstmt_updateProductPO = DB.prepareStatement - (sqlt, get_TrxName()); + (sqlt.toString(), get_TrxName()); //jz pstmt_updateProductPO.setInt(1, I_Product_ID); // pstmt_updateProductPO.setInt(2, M_Product_ID); // pstmt_updateProductPO.setInt(3, C_BPartner_ID); @@ -584,8 +584,8 @@ public class ImportProduct extends SvrProcess implements ImportProcess log.warning("Update Product_PO - " + ex.toString()); noUpdate--; rollback(); - StringBuffer sql0 = new StringBuffer ("UPDATE I_Product i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Update Product_PO: " + ex.toString())) + StringBuilder sql0 = new StringBuilder ("UPDATE I_Product i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Update Product_PO: " + ex.toString())) .append("WHERE I_Product_ID=").append(I_Product_ID); DB.executeUpdate(sql0.toString(), get_TrxName()); continue; @@ -608,8 +608,8 @@ public class ImportProduct extends SvrProcess implements ImportProcess log.warning("Insert Product_PO - " + ex.toString()); noInsert--; // assume that product also did not exist rollback(); - StringBuffer sql0 = new StringBuffer ("UPDATE I_Product i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert Product_PO: " + ex.toString())) + StringBuilder sql0 = new StringBuilder ("UPDATE I_Product i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert Product_PO: " + ex.toString())) .append("WHERE I_Product_ID=").append(I_Product_ID); DB.executeUpdate(sql0.toString(), get_TrxName()); continue; @@ -659,9 +659,9 @@ public class ImportProduct extends SvrProcess implements ImportProcess } // Set Error to indicator to not imported - sql = new StringBuffer ("UPDATE I_Product " - + "SET I_IsImported='N', Updated=SysDate " - + "WHERE I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_Product ") + .append("SET I_IsImported='N', Updated=SysDate ") + .append("WHERE I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); addLog (0, null, new BigDecimal (no), "@Errors@"); addLog (0, null, new BigDecimal (noInsert), "@M_Product_ID@: @Inserted@"); @@ -680,7 +680,8 @@ public class ImportProduct extends SvrProcess implements ImportProcess @Override public String getWhereClause() { - return " AND AD_Client_ID=" + m_AD_Client_ID; + StringBuilder msgreturn = new StringBuilder(" AND AD_Client_ID=").append(m_AD_Client_ID); + return msgreturn.toString(); } } // ImportProduct diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportReportLine.java b/org.adempiere.base.process/src/org/compiere/process/ImportReportLine.java index 0bf01f1e83..f93ef38233 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportReportLine.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportReportLine.java @@ -76,181 +76,181 @@ public class ImportReportLine extends SvrProcess */ protected String doIt() throws java.lang.Exception { - StringBuffer sql = null; + StringBuilder sql = null; int no = 0; - String clientCheck = " AND AD_Client_ID=" + m_AD_Client_ID; + StringBuilder clientCheck = new StringBuilder(" AND AD_Client_ID=").append(m_AD_Client_ID); // **** Prepare **** // Delete Old Imported if (m_deleteOldImported) { - sql = new StringBuffer ("DELETE I_ReportLine " - + "WHERE I_IsImported='Y'").append(clientCheck); + sql = new StringBuilder ("DELETE I_ReportLine ") + .append("WHERE I_IsImported='Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Delete Old Impored =" + no); } // Set Client, Org, IsActive, Created/Updated - sql = new StringBuffer ("UPDATE I_ReportLine " - + "SET AD_Client_ID = COALESCE (AD_Client_ID, ").append(m_AD_Client_ID).append(")," - + " AD_Org_ID = COALESCE (AD_Org_ID, 0)," - + " IsActive = COALESCE (IsActive, 'Y')," - + " Created = COALESCE (Created, SysDate)," - + " CreatedBy = COALESCE (CreatedBy, 0)," - + " Updated = COALESCE (Updated, SysDate)," - + " UpdatedBy = COALESCE (UpdatedBy, 0)," - + " I_ErrorMsg = ' '," - + " I_IsImported = 'N' " - + "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); + sql = new StringBuilder ("UPDATE I_ReportLine ") + .append("SET AD_Client_ID = COALESCE (AD_Client_ID, ").append(m_AD_Client_ID).append("),") + .append(" AD_Org_ID = COALESCE (AD_Org_ID, 0),") + .append(" IsActive = COALESCE (IsActive, 'Y'),") + .append(" Created = COALESCE (Created, SysDate),") + .append(" CreatedBy = COALESCE (CreatedBy, 0),") + .append(" Updated = COALESCE (Updated, SysDate),") + .append(" UpdatedBy = COALESCE (UpdatedBy, 0),") + .append(" I_ErrorMsg = ' ',") + .append(" I_IsImported = 'N' ") + .append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Reset=" + no); // ReportLineSetName (Default) if (m_PA_ReportLineSet_ID != 0) { - sql = new StringBuffer ("UPDATE I_ReportLine i " - + "SET ReportLineSetName=(SELECT Name FROM PA_ReportLineSet r" - + " WHERE PA_ReportLineSet_ID=").append(m_PA_ReportLineSet_ID).append(" AND i.AD_Client_ID=r.AD_Client_ID) " - + "WHERE ReportLineSetName IS NULL AND PA_ReportLineSet_ID IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ReportLine i ") + .append("SET ReportLineSetName=(SELECT Name FROM PA_ReportLineSet r") + .append(" WHERE PA_ReportLineSet_ID=").append(m_PA_ReportLineSet_ID).append(" AND i.AD_Client_ID=r.AD_Client_ID) ") + .append("WHERE ReportLineSetName IS NULL AND PA_ReportLineSet_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set ReportLineSetName Default=" + no); } // Set PA_ReportLineSet_ID - sql = new StringBuffer ("UPDATE I_ReportLine i " - + "SET PA_ReportLineSet_ID=(SELECT PA_ReportLineSet_ID FROM PA_ReportLineSet r" - + " WHERE i.ReportLineSetName=r.Name AND i.AD_Client_ID=r.AD_Client_ID) " - + "WHERE PA_ReportLineSet_ID IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ReportLine i ") + .append("SET PA_ReportLineSet_ID=(SELECT PA_ReportLineSet_ID FROM PA_ReportLineSet r") + .append(" WHERE i.ReportLineSetName=r.Name AND i.AD_Client_ID=r.AD_Client_ID) ") + .append("WHERE PA_ReportLineSet_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set PA_ReportLineSet_ID=" + no); // - sql = new StringBuffer ("UPDATE I_ReportLine " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid ReportLineSet, ' " - + "WHERE PA_ReportLineSet_ID IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ReportLine ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid ReportLineSet, ' ") + .append("WHERE PA_ReportLineSet_ID IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.config("Invalid ReportLineSet=" + no); // Ignore if there is no Report Line Name or ID - sql = new StringBuffer ("UPDATE I_ReportLine " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Ignored=NoLineName, ' " - + "WHERE PA_ReportLine_ID IS NULL AND Name IS NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ReportLine ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Ignored=NoLineName, ' ") + .append("WHERE PA_ReportLine_ID IS NULL AND Name IS NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.config("Invalid LineName=" + no); // Validate ElementValue - sql = new StringBuffer ("UPDATE I_ReportLine i " - + "SET C_ElementValue_ID=(SELECT C_ElementValue_ID FROM C_ElementValue e" - + " WHERE i.ElementValue=e.Value AND i.AD_Client_ID=e.AD_Client_ID) " - + "WHERE C_ElementValue_ID IS NULL AND ElementValue IS NOT NULL" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ReportLine i ") + .append("SET C_ElementValue_ID=(SELECT C_ElementValue_ID FROM C_ElementValue e") + .append(" WHERE i.ElementValue=e.Value AND i.AD_Client_ID=e.AD_Client_ID) ") + .append("WHERE C_ElementValue_ID IS NULL AND ElementValue IS NOT NULL") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set C_ElementValue_ID=" + no); // Validate C_ElementValue_ID - sql = new StringBuffer ("UPDATE I_ReportLine " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid ElementValue, ' " - + "WHERE C_ElementValue_ID IS NULL AND LineType<>'C'" // MReportLine.LINETYPE_Calculation - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ReportLine ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid ElementValue, ' ") + .append("WHERE C_ElementValue_ID IS NULL AND LineType<>'C'") // MReportLine.LINETYPE_Calculation + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.config("Invalid AccountType=" + no); // Set SeqNo - sql = new StringBuffer ("UPDATE I_ReportLine " - + "SET SeqNo=I_ReportLine_ID " - + "WHERE SeqNo IS NULL" - + " AND I_IsImported='N'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ReportLine ") + .append("SET SeqNo=I_ReportLine_ID ") + .append("WHERE SeqNo IS NULL") + .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set SeqNo Default=" + no); // Copy/Sync from first Row of Line - sql = new StringBuffer ("UPDATE I_ReportLine i " - + "SET (Description, SeqNo, IsSummary, IsPrinted, LineType, CalculationType, AmountType, PAAmountType, PAPeriodType, PostingType)=" - + " (SELECT Description, SeqNo, IsSummary, IsPrinted, LineType, CalculationType, AmountType, PAAmountType, PAPeriodType, PostingType" - + " FROM I_ReportLine ii WHERE i.Name=ii.Name AND i.PA_ReportLineSet_ID=ii.PA_ReportLineSet_ID" - + " AND ii.I_ReportLine_ID=(SELECT MIN(I_ReportLine_ID) FROM I_ReportLine iii" - + " WHERE i.Name=iii.Name AND i.PA_ReportLineSet_ID=iii.PA_ReportLineSet_ID)) " - + "WHERE EXISTS (SELECT *" - + " FROM I_ReportLine ii WHERE i.Name=ii.Name AND i.PA_ReportLineSet_ID=ii.PA_ReportLineSet_ID" - + " AND ii.I_ReportLine_ID=(SELECT MIN(I_ReportLine_ID) FROM I_ReportLine iii" - + " WHERE i.Name=iii.Name AND i.PA_ReportLineSet_ID=iii.PA_ReportLineSet_ID))" - + " AND I_IsImported='N'").append(clientCheck); // not if previous error + sql = new StringBuilder ("UPDATE I_ReportLine i ") + .append("SET (Description, SeqNo, IsSummary, IsPrinted, LineType, CalculationType, AmountType, PAAmountType, PAPeriodType, PostingType)=") + .append(" (SELECT Description, SeqNo, IsSummary, IsPrinted, LineType, CalculationType, AmountType, PAAmountType, PAPeriodType, PostingType") + .append(" FROM I_ReportLine ii WHERE i.Name=ii.Name AND i.PA_ReportLineSet_ID=ii.PA_ReportLineSet_ID") + .append(" AND ii.I_ReportLine_ID=(SELECT MIN(I_ReportLine_ID) FROM I_ReportLine iii") + .append(" WHERE i.Name=iii.Name AND i.PA_ReportLineSet_ID=iii.PA_ReportLineSet_ID)) ") + .append("WHERE EXISTS (SELECT *") + .append(" FROM I_ReportLine ii WHERE i.Name=ii.Name AND i.PA_ReportLineSet_ID=ii.PA_ReportLineSet_ID") + .append(" AND ii.I_ReportLine_ID=(SELECT MIN(I_ReportLine_ID) FROM I_ReportLine iii") + .append(" WHERE i.Name=iii.Name AND i.PA_ReportLineSet_ID=iii.PA_ReportLineSet_ID))") + .append(" AND I_IsImported='N'").append(clientCheck); // not if previous error no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Sync from first Row of Line=" + no); // Validate IsSummary - (N) Y - sql = new StringBuffer ("UPDATE I_ReportLine " - + "SET IsSummary='N' " - + "WHERE IsSummary IS NULL OR IsSummary NOT IN ('Y','N')" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ReportLine ") + .append("SET IsSummary='N' ") + .append("WHERE IsSummary IS NULL OR IsSummary NOT IN ('Y','N')") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set IsSummary Default=" + no); // Validate IsPrinted - (Y) N - sql = new StringBuffer ("UPDATE I_ReportLine " - + "SET IsPrinted='Y' " - + "WHERE IsPrinted IS NULL OR IsPrinted NOT IN ('Y','N')" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ReportLine ") + .append("SET IsPrinted='Y' ") + .append("WHERE IsPrinted IS NULL OR IsPrinted NOT IN ('Y','N')") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set IsPrinted Default=" + no); // Validate Line Type - (S) C - sql = new StringBuffer ("UPDATE I_ReportLine " - + "SET LineType='S' " - + "WHERE LineType IS NULL OR LineType NOT IN ('S','C')" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ReportLine ") + .append("SET LineType='S' ") + .append("WHERE LineType IS NULL OR LineType NOT IN ('S','C')") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set LineType Default=" + no); // Validate Optional Calculation Type - A P R S - sql = new StringBuffer ("UPDATE I_ReportLine " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid CalculationType, ' " - + "WHERE CalculationType IS NOT NULL AND CalculationType NOT IN ('A','P','R','S')" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ReportLine ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid CalculationType, ' ") + .append("WHERE CalculationType IS NOT NULL AND CalculationType NOT IN ('A','P','R','S')") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.config("Invalid CalculationType=" + no); // Convert Optional Amount Type to PAAmount Type and PAPeriodType - sql = new StringBuffer ("UPDATE I_ReportLine " - + "SET PAAmountType = substr(AmountType,1,1), PAPeriodType = substr(AmountType,1,2) " - + "WHERE AmountType IS NOT NULL AND (PAAmountType IS NULL OR PAPeriodType IS NULL) " - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ReportLine ") + .append("SET PAAmountType = substr(AmountType,1,1), PAPeriodType = substr(AmountType,1,2) ") + .append("WHERE AmountType IS NOT NULL AND (PAAmountType IS NULL OR PAPeriodType IS NULL) ") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.config("Converted AmountType=" + no); // Validate Optional Amount Type - - sql = new StringBuffer ("UPDATE I_ReportLine " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid PAAmountType, ' " - + "WHERE PAAmountType IS NOT NULL AND UPPER(AmountType) NOT IN ('B','C','D','Q','S','R')" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ReportLine ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid PAAmountType, ' ") + .append("WHERE PAAmountType IS NOT NULL AND UPPER(AmountType) NOT IN ('B','C','D','Q','S','R')") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.config("Invalid AmountType=" + no); // Validate Optional Period Type - - sql = new StringBuffer ("UPDATE I_ReportLine " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid PAPeriodType, ' " - + "WHERE PAPeriodType IS NOT NULL AND UPPER(AmountType) NOT IN ('P','Y','T','N')" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ReportLine ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid PAPeriodType, ' ") + .append("WHERE PAPeriodType IS NOT NULL AND UPPER(AmountType) NOT IN ('P','Y','T','N')") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.config("Invalid PeriodType=" + no); // Validate Optional Posting Type - A B E S R - sql = new StringBuffer ("UPDATE I_ReportLine " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid CalculationType, ' " - + "WHERE PostingType IS NOT NULL AND PostingType NOT IN ('A','B','E','S','R')" - + " AND I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ReportLine ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid CalculationType, ' ") + .append("WHERE PostingType IS NOT NULL AND PostingType NOT IN ('A','B','E','S','R')") + .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.config("Invalid PostingType=" + no); // Set PA_ReportLine_ID - sql = new StringBuffer ("UPDATE I_ReportLine i " - + "SET PA_ReportLine_ID=(SELECT MAX(PA_ReportLine_ID) FROM PA_ReportLine r" - + " WHERE i.Name=r.Name AND i.PA_ReportLineSet_ID=r.PA_ReportLineSet_ID) " - + "WHERE PA_ReportLine_ID IS NULL AND PA_ReportLineSet_ID IS NOT NULL" - + " AND I_IsImported='N'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ReportLine i ") + .append("SET PA_ReportLine_ID=(SELECT MAX(PA_ReportLine_ID) FROM PA_ReportLine r") + .append(" WHERE i.Name=r.Name AND i.PA_ReportLineSet_ID=r.PA_ReportLineSet_ID) ") + .append("WHERE PA_ReportLine_ID IS NULL AND PA_ReportLineSet_ID IS NOT NULL") + .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set PA_ReportLine_ID=" + no); @@ -261,29 +261,29 @@ public class ImportReportLine extends SvrProcess int noUpdateLine = 0; // **** Create Missing ReportLines - sql = new StringBuffer ("SELECT DISTINCT PA_ReportLineSet_ID, Name " - + "FROM I_ReportLine " - + "WHERE I_IsImported='N' AND PA_ReportLine_ID IS NULL" - + " AND I_IsImported='N'").append(clientCheck); + sql = new StringBuilder ("SELECT DISTINCT PA_ReportLineSet_ID, Name ") + .append("FROM I_ReportLine ") + .append("WHERE I_IsImported='N' AND PA_ReportLine_ID IS NULL") + .append(" AND I_IsImported='N'").append(clientCheck); try { // Insert ReportLine - PreparedStatement pstmt_insertLine = DB.prepareStatement - ("INSERT INTO PA_ReportLine " - + "(PA_ReportLine_ID,PA_ReportLineSet_ID," - + "AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy," - + "Name,SeqNo,IsPrinted,IsSummary,LineType)" - + "SELECT ?,PA_ReportLineSet_ID," - + "AD_Client_ID,AD_Org_ID,'Y',SysDate,CreatedBy,SysDate,UpdatedBy," - + "Name,SeqNo,IsPrinted,IsSummary,LineType " - //jz + "FROM I_ReportLine " - // + "WHERE PA_ReportLineSet_ID=? AND Name=? AND ROWNUM=1" // #2..3 - + "FROM I_ReportLine " - + "WHERE I_ReportLine_ID=(SELECT MAX(I_ReportLine_ID) " - + "FROM I_ReportLine " - + "WHERE PA_ReportLineSet_ID=? AND Name=? " // #2..3 - //jz + clientCheck, get_TrxName()); - + clientCheck + ")", get_TrxName()); + StringBuilder dbpst = new StringBuilder("INSERT INTO PA_ReportLine ") + .append("(PA_ReportLine_ID,PA_ReportLineSet_ID,") + .append("AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,") + .append("Name,SeqNo,IsPrinted,IsSummary,LineType)") + .append("SELECT ?,PA_ReportLineSet_ID,") + .append("AD_Client_ID,AD_Org_ID,'Y',SysDate,CreatedBy,SysDate,UpdatedBy,") + .append("Name,SeqNo,IsPrinted,IsSummary,LineType ") + //jz + "FROM I_ReportLine " + // + "WHERE PA_ReportLineSet_ID=? AND Name=? AND ROWNUM=1" // #2..3 + .append("FROM I_ReportLine ") + .append("WHERE I_ReportLine_ID=(SELECT MAX(I_ReportLine_ID) ") + .append("FROM I_ReportLine ") + .append("WHERE PA_ReportLineSet_ID=? AND Name=? ") // #2..3 + //jz + clientCheck, get_TrxName()); + .append(clientCheck).append(")"); + PreparedStatement pstmt_insertLine = DB.prepareStatement(dbpst.toString(), get_TrxName()); PreparedStatement pstmt = DB.prepareStatement(sql.toString(), get_TrxName()); ResultSet rs = pstmt.executeQuery(); @@ -322,25 +322,25 @@ public class ImportReportLine extends SvrProcess } // Set PA_ReportLine_ID (for newly created) - sql = new StringBuffer ("UPDATE I_ReportLine i " - + "SET PA_ReportLine_ID=(SELECT MAX(PA_ReportLine_ID) FROM PA_ReportLine r" - + " WHERE i.Name=r.Name AND i.PA_ReportLineSet_ID=r.PA_ReportLineSet_ID) " - + "WHERE PA_ReportLine_ID IS NULL AND PA_ReportLineSet_ID IS NOT NULL" - + " AND I_IsImported='N'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ReportLine i ") + .append("SET PA_ReportLine_ID=(SELECT MAX(PA_ReportLine_ID) FROM PA_ReportLine r") + .append(" WHERE i.Name=r.Name AND i.PA_ReportLineSet_ID=r.PA_ReportLineSet_ID) ") + .append("WHERE PA_ReportLine_ID IS NULL AND PA_ReportLineSet_ID IS NOT NULL") + .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Set PA_ReportLine_ID=" + no); // **** Update ReportLine - sql = new StringBuffer ("UPDATE PA_ReportLine r " - + "SET (Description,SeqNo,IsSummary,IsPrinted,LineType,CalculationType,AmountType,PAAmountType,PAPeriodType,PostingType,Updated,UpdatedBy)=" - + " (SELECT Description,SeqNo,IsSummary,IsPrinted,LineType,CalculationType,AmountType,PAAmountType,PAPeriodType,PostingType,SysDate,UpdatedBy" - + " FROM I_ReportLine i WHERE r.Name=i.Name AND r.PA_ReportLineSet_ID=i.PA_ReportLineSet_ID" - + " AND i.I_ReportLine_ID=(SELECT MIN(I_ReportLine_ID) FROM I_ReportLine iii" - + " WHERE i.Name=iii.Name AND i.PA_ReportLineSet_ID=iii.PA_ReportLineSet_ID)) " - + "WHERE EXISTS (SELECT *" - + " FROM I_ReportLine i WHERE r.Name=i.Name AND r.PA_ReportLineSet_ID=i.PA_ReportLineSet_ID" - + " AND i.I_ReportLine_ID=(SELECT MIN(I_ReportLine_ID) FROM I_ReportLine iii" - + " WHERE i.Name=iii.Name AND i.PA_ReportLineSet_ID=iii.PA_ReportLineSet_ID AND i.I_IsImported='N'))") + sql = new StringBuilder ("UPDATE PA_ReportLine r ") + .append("SET (Description,SeqNo,IsSummary,IsPrinted,LineType,CalculationType,AmountType,PAAmountType,PAPeriodType,PostingType,Updated,UpdatedBy)=") + .append(" (SELECT Description,SeqNo,IsSummary,IsPrinted,LineType,CalculationType,AmountType,PAAmountType,PAPeriodType,PostingType,SysDate,UpdatedBy") + .append(" FROM I_ReportLine i WHERE r.Name=i.Name AND r.PA_ReportLineSet_ID=i.PA_ReportLineSet_ID") + .append(" AND i.I_ReportLine_ID=(SELECT MIN(I_ReportLine_ID) FROM I_ReportLine iii") + .append(" WHERE i.Name=iii.Name AND i.PA_ReportLineSet_ID=iii.PA_ReportLineSet_ID)) ") + .append("WHERE EXISTS (SELECT *") + .append(" FROM I_ReportLine i WHERE r.Name=i.Name AND r.PA_ReportLineSet_ID=i.PA_ReportLineSet_ID") + .append(" AND i.I_ReportLine_ID=(SELECT MIN(I_ReportLine_ID) FROM I_ReportLine iii") + .append(" WHERE i.Name=iii.Name AND i.PA_ReportLineSet_ID=iii.PA_ReportLineSet_ID AND i.I_IsImported='N'))") .append(clientCheck); noUpdateLine = DB.executeUpdate(sql.toString(), get_TrxName()); log.config("Update PA_ReportLine=" + noUpdateLine); @@ -351,26 +351,26 @@ public class ImportReportLine extends SvrProcess int noUpdateSource = 0; // **** Create ReportSource - sql = new StringBuffer ("SELECT I_ReportLine_ID, PA_ReportSource_ID " - + "FROM I_ReportLine " - + "WHERE PA_ReportLine_ID IS NOT NULL" - + " AND I_IsImported='N'").append(clientCheck); + sql = new StringBuilder ("SELECT I_ReportLine_ID, PA_ReportSource_ID ") + .append("FROM I_ReportLine ") + .append("WHERE PA_ReportLine_ID IS NOT NULL") + .append(" AND I_IsImported='N'").append(clientCheck); try { // Insert ReportSource - PreparedStatement pstmt_insertSource = DB.prepareStatement - ("INSERT INTO PA_ReportSource " - + "(PA_ReportSource_ID," - + "AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy," - + "PA_ReportLine_ID,ElementType,C_ElementValue_ID) " - + "SELECT ?," - + "AD_Client_ID,AD_Org_ID,'Y',SysDate,CreatedBy,SysDate,UpdatedBy," - + "PA_ReportLine_ID,'AC',C_ElementValue_ID " - + "FROM I_ReportLine " - + "WHERE I_ReportLine_ID=?" - + " AND I_IsImported='N'" - + clientCheck, get_TrxName()); + StringBuilder dbpst = new StringBuilder("INSERT INTO PA_ReportSource ") + .append("(PA_ReportSource_ID,") + .append("AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,") + .append("PA_ReportLine_ID,ElementType,C_ElementValue_ID) ") + .append("SELECT ?,") + .append("AD_Client_ID,AD_Org_ID,'Y',SysDate,CreatedBy,SysDate,UpdatedBy,") + .append("PA_ReportLine_ID,'AC',C_ElementValue_ID ") + .append("FROM I_ReportLine ") + .append("WHERE I_ReportLine_ID=?") + .append(" AND I_IsImported='N'") + .append(clientCheck); + PreparedStatement pstmt_insertSource = DB.prepareStatement(dbpst.toString(), get_TrxName()); // Update ReportSource //jz @@ -387,11 +387,11 @@ public class ImportReportLine extends SvrProcess */ // Delete ReportSource - afalcone 22/02/2007 - F.R. [ 1642250 ] Import ReportLine / Very Slow Reports - PreparedStatement pstmt_deleteSource = DB.prepareStatement - ("DELETE FROM PA_ReportSource " - + "WHERE C_ElementValue_ID IS NULL" - + " AND PA_ReportSource_ID=?" - + clientCheck, get_TrxName()); + dbpst = new StringBuilder("DELETE FROM PA_ReportSource ") + .append("WHERE C_ElementValue_ID IS NULL") + .append(" AND PA_ReportSource_ID=?") + .append(clientCheck); + PreparedStatement pstmt_deleteSource = DB.prepareStatement(dbpst.toString(), get_TrxName()); //End afalcone 22/02/2007 - F.R. [ 1642250 ] Import ReportLine / Very Slow Reports // Set Imported = Y @@ -424,8 +424,8 @@ public class ImportReportLine extends SvrProcess catch (Exception ex) { log.finest("Insert ReportSource - " + ex.toString()); - sql = new StringBuffer ("UPDATE I_ReportLine i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert ElementSource: " + ex.toString())) + sql = new StringBuilder ("UPDATE I_ReportLine i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert ElementSource: " + ex.toString())) .append("WHERE I_ReportLine_ID=").append(I_ReportLine_ID); DB.executeUpdate(sql.toString(), get_TrxName()); continue; @@ -434,15 +434,15 @@ public class ImportReportLine extends SvrProcess else // update Report Source { //jz - String sqlt="UPDATE PA_ReportSource " - + "SET (ElementType,C_ElementValue_ID,Updated,UpdatedBy)=" - + " (SELECT CAST('AC' AS CHAR(2)),C_ElementValue_ID,SysDate,UpdatedBy" //jz - + " FROM I_ReportLine" - + " WHERE I_ReportLine_ID=" + I_ReportLine_ID + ") " - + "WHERE PA_ReportSource_ID="+PA_ReportSource_ID+" " - + clientCheck; + StringBuilder sqlt= new StringBuilder("UPDATE PA_ReportSource ") + .append("SET (ElementType,C_ElementValue_ID,Updated,UpdatedBy)=") + .append(" (SELECT CAST('AC' AS CHAR(2)),C_ElementValue_ID,SysDate,UpdatedBy") //jz + .append(" FROM I_ReportLine") + .append(" WHERE I_ReportLine_ID=").append(I_ReportLine_ID).append(") ") + .append("WHERE PA_ReportSource_ID=").append(PA_ReportSource_ID).append(" ") + .append(clientCheck); PreparedStatement pstmt_updateSource = DB.prepareStatement - (sqlt, get_TrxName()); + (sqlt.toString(), get_TrxName()); //pstmt_updateSource.setInt(1, I_ReportLine_ID); //pstmt_updateSource.setInt(2, PA_ReportSource_ID); try @@ -455,8 +455,8 @@ public class ImportReportLine extends SvrProcess catch (SQLException ex) { log.finest( "Update ReportSource - " + ex.toString()); - sql = new StringBuffer ("UPDATE I_ReportLine i " - + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Update ElementSource: " + ex.toString())) + sql = new StringBuilder ("UPDATE I_ReportLine i ") + .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Update ElementSource: " + ex.toString())) .append("WHERE I_ReportLine_ID=").append(I_ReportLine_ID); DB.executeUpdate(sql.toString(), get_TrxName()); continue; @@ -494,9 +494,9 @@ public class ImportReportLine extends SvrProcess } // Set Error to indicator to not imported - sql = new StringBuffer ("UPDATE I_ReportLine " - + "SET I_IsImported='N', Updated=SysDate " - + "WHERE I_IsImported<>'Y'").append(clientCheck); + sql = new StringBuilder ("UPDATE I_ReportLine ") + .append("SET I_IsImported='N', Updated=SysDate ") + .append("WHERE I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); addLog (0, null, new BigDecimal (no), "@Errors@"); diff --git a/org.adempiere.base.process/src/org/compiere/process/InOutGenerate.java b/org.adempiere.base.process/src/org/compiere/process/InOutGenerate.java index baa436e83b..f12c5b4fb8 100644 --- a/org.adempiere.base.process/src/org/compiere/process/InOutGenerate.java +++ b/org.adempiere.base.process/src/org/compiere/process/InOutGenerate.java @@ -74,7 +74,7 @@ public class InOutGenerate extends SvrProcess private int m_lastC_BPartner_Location_ID = -1; /** The Query sql */ - private String m_sql = null; + private StringBuffer m_sql = null; /** Storages temp space */ @@ -147,38 +147,38 @@ public class InOutGenerate extends SvrProcess if (p_Selection) // VInOutGen { - m_sql = "SELECT C_Order.* FROM C_Order, T_Selection " - + "WHERE C_Order.DocStatus='CO' AND C_Order.IsSOTrx='Y' AND C_Order.AD_Client_ID=? " - + "AND C_Order.C_Order_ID = T_Selection.T_Selection_ID " - + "AND T_Selection.AD_PInstance_ID=? "; + m_sql = new StringBuffer("SELECT C_Order.* FROM C_Order, T_Selection ") + .append("WHERE C_Order.DocStatus='CO' AND C_Order.IsSOTrx='Y' AND C_Order.AD_Client_ID=? ") + .append("AND C_Order.C_Order_ID = T_Selection.T_Selection_ID ") + .append("AND T_Selection.AD_PInstance_ID=? "); } else { - m_sql = "SELECT * FROM C_Order o " - + "WHERE DocStatus='CO' AND IsSOTrx='Y'" + m_sql = new StringBuffer("SELECT * FROM C_Order o ") + .append("WHERE DocStatus='CO' AND IsSOTrx='Y'") // No Offer,POS - + " AND o.C_DocType_ID IN (SELECT C_DocType_ID FROM C_DocType " - + "WHERE DocBaseType='SOO' AND DocSubTypeSO NOT IN ('ON','OB','WR'))" - + " AND o.IsDropShip='N'" + .append(" AND o.C_DocType_ID IN (SELECT C_DocType_ID FROM C_DocType ") + .append("WHERE DocBaseType='SOO' AND DocSubTypeSO NOT IN ('ON','OB','WR'))") + .append(" AND o.IsDropShip='N'") // No Manual - + " AND o.DeliveryRule<>'M'" + .append(" AND o.DeliveryRule<>'M'") // Open Order Lines with Warehouse - + " AND EXISTS (SELECT * FROM C_OrderLine ol " - + "WHERE ol.M_Warehouse_ID=?"; // #1 + .append(" AND EXISTS (SELECT * FROM C_OrderLine ol ") + .append("WHERE ol.M_Warehouse_ID=?"); // #1 if (p_DatePromised != null) - m_sql += " AND TRUNC(ol.DatePromised)<=?"; // #2 - m_sql += " AND o.C_Order_ID=ol.C_Order_ID AND ol.QtyOrdered<>ol.QtyDelivered)"; + m_sql.append(" AND TRUNC(ol.DatePromised)<=?"); // #2 + m_sql.append(" AND o.C_Order_ID=ol.C_Order_ID AND ol.QtyOrdered<>ol.QtyDelivered)"); // if (p_C_BPartner_ID != 0) - m_sql += " AND o.C_BPartner_ID=?"; // #3 + m_sql.append(" AND o.C_BPartner_ID=?"); // #3 } - m_sql += " ORDER BY M_Warehouse_ID, PriorityRule, M_Shipper_ID, C_BPartner_ID, C_BPartner_Location_ID, C_Order_ID"; + m_sql.append(" ORDER BY M_Warehouse_ID, PriorityRule, M_Shipper_ID, C_BPartner_ID, C_BPartner_Location_ID, C_Order_ID"); // m_sql += " FOR UPDATE"; PreparedStatement pstmt = null; try { - pstmt = DB.prepareStatement (m_sql, get_TrxName()); + pstmt = DB.prepareStatement (m_sql.toString(), get_TrxName()); int index = 1; if (p_Selection) { @@ -196,7 +196,7 @@ public class InOutGenerate extends SvrProcess } catch (Exception e) { - log.log(Level.SEVERE, m_sql, e); + log.log(Level.SEVERE, m_sql.toString(), e); } return generate(pstmt); } // doIt @@ -228,23 +228,23 @@ public class InOutGenerate extends SvrProcess Timestamp minGuaranteeDate = m_movementDate; boolean completeOrder = MOrder.DELIVERYRULE_CompleteOrder.equals(order.getDeliveryRule()); // OrderLine WHERE - String where = " AND M_Warehouse_ID=" + p_M_Warehouse_ID; + StringBuilder where = new StringBuilder(" AND M_Warehouse_ID=").append(p_M_Warehouse_ID); if (p_DatePromised != null) - where += " AND (TRUNC(DatePromised)<=" + DB.TO_DATE(p_DatePromised, true) - + " OR DatePromised IS NULL)"; + where.append(" AND (TRUNC(DatePromised)<=").append(DB.TO_DATE(p_DatePromised, true)) + .append(" OR DatePromised IS NULL)"); // Exclude Auto Delivery if not Force if (!MOrder.DELIVERYRULE_Force.equals(order.getDeliveryRule())) - where += " AND (C_OrderLine.M_Product_ID IS NULL" - + " OR EXISTS (SELECT * FROM M_Product p " - + "WHERE C_OrderLine.M_Product_ID=p.M_Product_ID" - + " AND IsExcludeAutoDelivery='N'))"; + where.append(" AND (C_OrderLine.M_Product_ID IS NULL") + .append(" OR EXISTS (SELECT * FROM M_Product p ") + .append("WHERE C_OrderLine.M_Product_ID=p.M_Product_ID") + .append(" AND IsExcludeAutoDelivery='N'))"); // Exclude Unconfirmed if (!p_IsUnconfirmedInOut) - where += " AND NOT EXISTS (SELECT * FROM M_InOutLine iol" - + " INNER JOIN M_InOut io ON (iol.M_InOut_ID=io.M_InOut_ID) " - + "WHERE iol.C_OrderLine_ID=C_OrderLine.C_OrderLine_ID AND io.DocStatus IN ('IP','WC'))"; + where.append(" AND NOT EXISTS (SELECT * FROM M_InOutLine iol") + .append(" INNER JOIN M_InOut io ON (iol.M_InOut_ID=io.M_InOut_ID) ") + .append("WHERE iol.C_OrderLine_ID=C_OrderLine.C_OrderLine_ID AND io.DocStatus IN ('IP','WC'))"); // Deadlock Prevention - Order by M_Product_ID - MOrderLine[] lines = order.getLines (where, "C_BPartner_Location_ID, M_Product_ID"); + MOrderLine[] lines = order.getLines (where.toString(), "C_BPartner_Location_ID, M_Product_ID"); for (int i = 0; i < lines.length; i++) { MOrderLine line = lines[i]; @@ -272,18 +272,18 @@ public class InOutGenerate extends SvrProcess line.getC_OrderLine_ID(), where2, null); for (int j = 0; j < iols.length; j++) unconfirmedShippedQty = unconfirmedShippedQty.add(iols[j].getMovementQty()); - String logInfo = "Unconfirmed Qty=" + unconfirmedShippedQty - + " - ToDeliver=" + toDeliver + "->"; + StringBuilder logInfo = new StringBuilder("Unconfirmed Qty=").append(unconfirmedShippedQty) + .append(" - ToDeliver=").append(toDeliver).append("->"); toDeliver = toDeliver.subtract(unconfirmedShippedQty); - logInfo += toDeliver; + logInfo.append(toDeliver); if (toDeliver.signum() < 0) { toDeliver = Env.ZERO; - logInfo += " (set to 0)"; + logInfo.append(" (set to 0)"); } // Adjust On Hand onHand = onHand.subtract(unconfirmedShippedQty); - log.fine(logInfo); + log.fine(logInfo.toString()); } // Comments & lines w/o product & services @@ -397,7 +397,7 @@ public class InOutGenerate extends SvrProcess } catch (Exception e) { - log.log(Level.SEVERE, m_sql, e); + log.log(Level.SEVERE, m_sql.toString(), e); } try { @@ -410,7 +410,8 @@ public class InOutGenerate extends SvrProcess pstmt = null; } completeShipment(); - return "@Created@ = " + m_created; + StringBuilder msgreturn = new StringBuilder("@Created@ = ").append(m_created); + return msgreturn.toString(); } // generate diff --git a/org.adempiere.base.process/src/org/compiere/process/InventoryCountCreate.java b/org.adempiere.base.process/src/org/compiere/process/InventoryCountCreate.java index 71f55f9c6e..8a6e836b7a 100644 --- a/org.adempiere.base.process/src/org/compiere/process/InventoryCountCreate.java +++ b/org.adempiere.base.process/src/org/compiere/process/InventoryCountCreate.java @@ -119,16 +119,16 @@ public class InventoryCountCreate extends SvrProcess if (p_DeleteOld) { //Added Line by armen - String sql1 = "DELETE FROM M_InventoryLineMA ma WHERE EXISTS " - + "(SELECT * FROM M_InventoryLine l WHERE l.M_InventoryLine_ID=ma.M_InventoryLine_ID" - + " AND Processed='N' AND M_Inventory_ID=" + p_M_Inventory_ID + ")"; - int no1 = DB.executeUpdate(sql1, get_TrxName()); + StringBuilder sql1 = new StringBuilder("DELETE FROM M_InventoryLineMA ma WHERE EXISTS ") + .append("(SELECT * FROM M_InventoryLine l WHERE l.M_InventoryLine_ID=ma.M_InventoryLine_ID") + .append(" AND Processed='N' AND M_Inventory_ID=").append(p_M_Inventory_ID).append(")"); + int no1 = DB.executeUpdate(sql1.toString(), get_TrxName()); log.fine("doIt - Deleted MA #" + no1); //End of Added Line - String sql = "DELETE M_InventoryLine WHERE Processed='N' " - + "AND M_Inventory_ID=" + p_M_Inventory_ID; - int no = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("DELETE M_InventoryLine WHERE Processed='N' ") + .append("AND M_Inventory_ID=").append(p_M_Inventory_ID); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("doIt - Deleted #" + no); } @@ -257,15 +257,16 @@ public class InventoryCountCreate extends SvrProcess // Set Count to Zero if (p_InventoryCountSetZero) { - String sql1 = "UPDATE M_InventoryLine l " - + "SET QtyCount=0 " - + "WHERE M_Inventory_ID=" + p_M_Inventory_ID; - int no = DB.executeUpdate(sql1, get_TrxName()); + StringBuilder sql1 = new StringBuilder("UPDATE M_InventoryLine l ") + .append("SET QtyCount=0 ") + .append("WHERE M_Inventory_ID=").append(p_M_Inventory_ID); + int no = DB.executeUpdate(sql1.toString(), get_TrxName()); log.info("Set Cont to Zero=" + no); } // - return "@M_InventoryLine_ID@ - #" + count; + StringBuilder msgreturn = new StringBuilder("@M_InventoryLine_ID@ - #").append(count); + return msgreturn.toString(); } // doIt /** @@ -350,7 +351,7 @@ public class InventoryCountCreate extends SvrProcess private String getSubCategoryWhereClause(int productCategoryId) throws SQLException, AdempiereSystemError{ //if a node with this id is found later in the search we have a loop in the tree int subTreeRootParentId = 0; - String retString = " "; + StringBuilder retString = new StringBuilder(); String sql = " SELECT M_Product_Category_ID, M_Product_Category_Parent_ID FROM M_Product_Category"; final Vector categories = new Vector(100); Statement stmt = DB.createStatement(); @@ -361,10 +362,10 @@ public class InventoryCountCreate extends SvrProcess } categories.add(new SimpleTreeNode(rs.getInt(1), rs.getInt(2))); } - retString += getSubCategoriesString(productCategoryId, categories, subTreeRootParentId); + retString.append(getSubCategoriesString(productCategoryId, categories, subTreeRootParentId)); rs.close(); stmt.close(); - return retString; + return retString.toString(); } /** @@ -389,7 +390,8 @@ public class InventoryCountCreate extends SvrProcess } } log.fine(ret.toString()); - return ret.toString() + productCategoryId; + StringBuilder msgreturn = new StringBuilder(ret).append(productCategoryId); + return msgreturn.toString(); } /** diff --git a/org.adempiere.base.process/src/org/compiere/process/InventoryCountUpdate.java b/org.adempiere.base.process/src/org/compiere/process/InventoryCountUpdate.java index 336d922967..eb5a51f68a 100644 --- a/org.adempiere.base.process/src/org/compiere/process/InventoryCountUpdate.java +++ b/org.adempiere.base.process/src/org/compiere/process/InventoryCountUpdate.java @@ -75,34 +75,34 @@ public class InventoryCountUpdate extends SvrProcess throw new AdempiereSystemError ("Not found: M_Inventory_ID=" + p_M_Inventory_ID); // Multiple Lines for one item - String sql = "UPDATE M_InventoryLine SET IsActive='N' " - + "WHERE M_Inventory_ID=" + p_M_Inventory_ID - + " AND (M_Product_ID, M_Locator_ID, M_AttributeSetInstance_ID) IN " - + "(SELECT M_Product_ID, M_Locator_ID, M_AttributeSetInstance_ID " - + "FROM M_InventoryLine " - + "WHERE M_Inventory_ID=" + p_M_Inventory_ID - + " GROUP BY M_Product_ID, M_Locator_ID, M_AttributeSetInstance_ID " - + "HAVING COUNT(*) > 1)"; - int multiple = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("UPDATE M_InventoryLine SET IsActive='N' ") + .append("WHERE M_Inventory_ID=").append(p_M_Inventory_ID) + .append(" AND (M_Product_ID, M_Locator_ID, M_AttributeSetInstance_ID) IN ") + .append("(SELECT M_Product_ID, M_Locator_ID, M_AttributeSetInstance_ID ") + .append("FROM M_InventoryLine ") + .append("WHERE M_Inventory_ID=").append(p_M_Inventory_ID) + .append(" GROUP BY M_Product_ID, M_Locator_ID, M_AttributeSetInstance_ID ") + .append("HAVING COUNT(*) > 1)"); + int multiple = DB.executeUpdate(sql.toString(), get_TrxName()); log.info("Multiple=" + multiple); int delMA = MInventoryLineMA.deleteInventoryMA(p_M_Inventory_ID, get_TrxName()); log.info("DeletedMA=" + delMA); // ASI - sql = "UPDATE M_InventoryLine l " - + "SET (QtyBook,QtyCount) = " - + "(SELECT QtyOnHand,QtyOnHand FROM M_Storage s " - + "WHERE s.M_Product_ID=l.M_Product_ID AND s.M_Locator_ID=l.M_Locator_ID" - + " AND s.M_AttributeSetInstance_ID=l.M_AttributeSetInstance_ID)," - + " Updated=SysDate," - + " UpdatedBy=" + getAD_User_ID() + sql = new StringBuilder("UPDATE M_InventoryLine l ") + .append("SET (QtyBook,QtyCount) = ") + .append("(SELECT QtyOnHand,QtyOnHand FROM M_Storage s ") + .append("WHERE s.M_Product_ID=l.M_Product_ID AND s.M_Locator_ID=l.M_Locator_ID") + .append(" AND s.M_AttributeSetInstance_ID=l.M_AttributeSetInstance_ID),") + .append(" Updated=SysDate,") + .append(" UpdatedBy=").append(getAD_User_ID()) // - + " WHERE M_Inventory_ID=" + p_M_Inventory_ID - + " AND EXISTS (SELECT * FROM M_Storage s " - + "WHERE s.M_Product_ID=l.M_Product_ID AND s.M_Locator_ID=l.M_Locator_ID" - + " AND s.M_AttributeSetInstance_ID=l.M_AttributeSetInstance_ID)"; - int no = DB.executeUpdate(sql, get_TrxName()); + .append(" WHERE M_Inventory_ID=").append(p_M_Inventory_ID) + .append(" AND EXISTS (SELECT * FROM M_Storage s ") + .append("WHERE s.M_Product_ID=l.M_Product_ID AND s.M_Locator_ID=l.M_Locator_ID") + .append(" AND s.M_AttributeSetInstance_ID=l.M_AttributeSetInstance_ID)"); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); log.info("Update with ASI=" + no); // No ASI @@ -111,17 +111,19 @@ public class InventoryCountUpdate extends SvrProcess // Set Count to Zero if (p_InventoryCountSetZero) { - sql = "UPDATE M_InventoryLine l " - + "SET QtyCount=0 " - + "WHERE M_Inventory_ID=" + p_M_Inventory_ID; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE M_InventoryLine l ") + .append("SET QtyCount=0 ") + .append("WHERE M_Inventory_ID=").append(p_M_Inventory_ID); + no = DB.executeUpdate(sql.toString(), get_TrxName()); log.info("Set Count to Zero=" + no); } - if (multiple > 0) - return "@M_InventoryLine_ID@ - #" + (no + noMA) + " --> @InventoryProductMultiple@"; - - return "@M_InventoryLine_ID@ - #" + no; + if (multiple > 0){ + StringBuilder msgreturn = new StringBuilder("@M_InventoryLine_ID@ - #").append((no + noMA)).append(" --> @InventoryProductMultiple@"); + return msgreturn.toString(); + } + StringBuilder msgreturn = new StringBuilder("@M_InventoryLine_ID@ - #").append(no); + return msgreturn.toString(); } // doIt /** From 2defc00efb182212a742046333c396a2bd0e1f0a Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 26 Sep 2012 18:35:53 -0500 Subject: [PATCH 51/79] =?UTF-8?q?IDEMPIERE-308=20Performance:=20Replace=20?= =?UTF-8?q?with=20StringBuilder=20/=20Thanks=20to=20Richard=20Morales=20an?= =?UTF-8?q?d=20David=20Pe=C3=B1uela?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/compiere/process/InventoryValue.java | 247 +++++++++--------- .../compiere/process/InvoiceBatchProcess.java | 3 +- .../org/compiere/process/InvoiceGenerate.java | 50 ++-- .../src/org/compiere/process/InvoiceNGL.java | 104 ++++---- .../process/InvoicePayScheduleValidate.java | 10 +- .../org/compiere/process/InvoicePrint.java | 48 ++-- .../org/compiere/process/InvoiceWriteOff.java | 11 +- .../src/org/compiere/process/IssueReport.java | 12 +- .../compiere/process/M_PriceList_Create.java | 30 +-- .../compiere/process/M_Product_BOM_Check.java | 60 ++--- .../compiere/process/M_Production_Run.java | 8 +- .../src/org/compiere/process/NoteDelete.java | 11 +- .../compiere/process/OrderBatchProcess.java | 7 +- .../process/OrderLineCreateProduction.java | 3 +- .../org/compiere/process/OrderPOCreate.java | 30 +-- .../process/OrderPayScheduleValidate.java | 10 +- .../org/compiere/process/OrderRePrice.java | 10 +- .../org/compiere/process/OrgOwnership.java | 124 ++++----- .../process/PaySelectionCreateCheck.java | 7 +- 19 files changed, 401 insertions(+), 384 deletions(-) diff --git a/org.adempiere.base.process/src/org/compiere/process/InventoryValue.java b/org.adempiere.base.process/src/org/compiere/process/InventoryValue.java index 408ea957ac..5b3e5535b1 100644 --- a/org.adempiere.base.process/src/org/compiere/process/InventoryValue.java +++ b/org.adempiere.base.process/src/org/compiere/process/InventoryValue.java @@ -94,23 +94,23 @@ public class InventoryValue extends SvrProcess MAcctSchema as = c.getAcctSchema(); // Delete (just to be sure) - StringBuffer sql = new StringBuffer ("DELETE T_InventoryValue WHERE AD_PInstance_ID="); + StringBuilder sql = new StringBuilder ("DELETE T_InventoryValue WHERE AD_PInstance_ID="); sql.append(getAD_PInstance_ID()); int no = DB.executeUpdateEx(sql.toString(), get_TrxName()); // Insert Standard Costs - sql = new StringBuffer ("INSERT INTO T_InventoryValue " - + "(AD_PInstance_ID, M_Warehouse_ID, M_Product_ID, M_AttributeSetInstance_ID," - + " AD_Client_ID, AD_Org_ID, CostStandard) " - + "SELECT ").append(getAD_PInstance_ID()) - .append(", w.M_Warehouse_ID, c.M_Product_ID, c.M_AttributeSetInstance_ID," - + " w.AD_Client_ID, w.AD_Org_ID, c.CurrentCostPrice " - + "FROM M_Warehouse w" - + " INNER JOIN AD_ClientInfo ci ON (w.AD_Client_ID=ci.AD_Client_ID)" - + " INNER JOIN C_AcctSchema acs ON (ci.C_AcctSchema1_ID=acs.C_AcctSchema_ID)" - + " INNER JOIN M_Cost c ON (acs.C_AcctSchema_ID=c.C_AcctSchema_ID AND acs.M_CostType_ID=c.M_CostType_ID AND c.AD_Org_ID IN (0, w.AD_Org_ID))" - + " INNER JOIN M_CostElement ce ON (c.M_CostElement_ID=ce.M_CostElement_ID AND ce.CostingMethod='S' AND ce.CostElementType='M') " - + "WHERE w.M_Warehouse_ID=").append(p_M_Warehouse_ID); + sql = new StringBuilder ("INSERT INTO T_InventoryValue ") + .append("(AD_PInstance_ID, M_Warehouse_ID, M_Product_ID, M_AttributeSetInstance_ID,") + .append(" AD_Client_ID, AD_Org_ID, CostStandard) ") + .append("SELECT ").append(getAD_PInstance_ID()) + .append(", w.M_Warehouse_ID, c.M_Product_ID, c.M_AttributeSetInstance_ID,") + .append(" w.AD_Client_ID, w.AD_Org_ID, c.CurrentCostPrice ") + .append("FROM M_Warehouse w") + .append(" INNER JOIN AD_ClientInfo ci ON (w.AD_Client_ID=ci.AD_Client_ID)") + .append(" INNER JOIN C_AcctSchema acs ON (ci.C_AcctSchema1_ID=acs.C_AcctSchema_ID)") + .append(" INNER JOIN M_Cost c ON (acs.C_AcctSchema_ID=c.C_AcctSchema_ID AND acs.M_CostType_ID=c.M_CostType_ID AND c.AD_Org_ID IN (0, w.AD_Org_ID))") + .append(" INNER JOIN M_CostElement ce ON (c.M_CostElement_ID=ce.M_CostElement_ID AND ce.CostingMethod='S' AND ce.CostElementType='M') ") + .append("WHERE w.M_Warehouse_ID=").append(p_M_Warehouse_ID); int noInsertStd = DB.executeUpdateEx(sql.toString(), get_TrxName()); log.fine("Inserted Std=" + noInsertStd); if (noInsertStd == 0) @@ -120,41 +120,41 @@ public class InventoryValue extends SvrProcess int noInsertCost = 0; if (p_M_CostElement_ID != 0) { - sql = new StringBuffer ("INSERT INTO T_InventoryValue " - + "(AD_PInstance_ID, M_Warehouse_ID, M_Product_ID, M_AttributeSetInstance_ID," - + " AD_Client_ID, AD_Org_ID, CostStandard, Cost, M_CostElement_ID) " - + "SELECT ").append(getAD_PInstance_ID()) - .append(", w.M_Warehouse_ID, c.M_Product_ID, c.M_AttributeSetInstance_ID," - + " w.AD_Client_ID, w.AD_Org_ID, 0, c.CurrentCostPrice, c.M_CostElement_ID " - + "FROM M_Warehouse w" - + " INNER JOIN AD_ClientInfo ci ON (w.AD_Client_ID=ci.AD_Client_ID)" - + " INNER JOIN C_AcctSchema acs ON (ci.C_AcctSchema1_ID=acs.C_AcctSchema_ID)" - + " INNER JOIN M_Cost c ON (acs.C_AcctSchema_ID=c.C_AcctSchema_ID AND acs.M_CostType_ID=c.M_CostType_ID AND c.AD_Org_ID IN (0, w.AD_Org_ID)) " - + "WHERE w.M_Warehouse_ID=").append(p_M_Warehouse_ID) + sql = new StringBuilder ("INSERT INTO T_InventoryValue ") + .append("(AD_PInstance_ID, M_Warehouse_ID, M_Product_ID, M_AttributeSetInstance_ID,") + .append(" AD_Client_ID, AD_Org_ID, CostStandard, Cost, M_CostElement_ID) ") + .append("SELECT ").append(getAD_PInstance_ID()) + .append(", w.M_Warehouse_ID, c.M_Product_ID, c.M_AttributeSetInstance_ID,") + .append(" w.AD_Client_ID, w.AD_Org_ID, 0, c.CurrentCostPrice, c.M_CostElement_ID ") + .append("FROM M_Warehouse w") + .append(" INNER JOIN AD_ClientInfo ci ON (w.AD_Client_ID=ci.AD_Client_ID)") + .append(" INNER JOIN C_AcctSchema acs ON (ci.C_AcctSchema1_ID=acs.C_AcctSchema_ID)") + .append(" INNER JOIN M_Cost c ON (acs.C_AcctSchema_ID=c.C_AcctSchema_ID AND acs.M_CostType_ID=c.M_CostType_ID AND c.AD_Org_ID IN (0, w.AD_Org_ID)) ") + .append("WHERE w.M_Warehouse_ID=").append(p_M_Warehouse_ID) .append(" AND c.M_CostElement_ID=").append(p_M_CostElement_ID) - .append(" AND NOT EXISTS (SELECT * FROM T_InventoryValue iv " - + "WHERE iv.AD_PInstance_ID=").append(getAD_PInstance_ID()) - .append(" AND iv.M_Warehouse_ID=w.M_Warehouse_ID" - + " AND iv.M_Product_ID=c.M_Product_ID" - + " AND iv.M_AttributeSetInstance_ID=c.M_AttributeSetInstance_ID)"); + .append(" AND NOT EXISTS (SELECT * FROM T_InventoryValue iv ") + .append("WHERE iv.AD_PInstance_ID=").append(getAD_PInstance_ID()) + .append(" AND iv.M_Warehouse_ID=w.M_Warehouse_ID") + .append(" AND iv.M_Product_ID=c.M_Product_ID") + .append(" AND iv.M_AttributeSetInstance_ID=c.M_AttributeSetInstance_ID)"); noInsertCost = DB.executeUpdateEx(sql.toString(), get_TrxName()); log.fine("Inserted Cost=" + noInsertCost); // Update Std Cost Records - sql = new StringBuffer ("UPDATE T_InventoryValue iv " - + "SET (Cost, M_CostElement_ID)=" - + "(SELECT c.CurrentCostPrice, c.M_CostElement_ID " - + "FROM M_Warehouse w" - + " INNER JOIN AD_ClientInfo ci ON (w.AD_Client_ID=ci.AD_Client_ID)" - + " INNER JOIN C_AcctSchema acs ON (ci.C_AcctSchema1_ID=acs.C_AcctSchema_ID)" - + " INNER JOIN M_Cost c ON (acs.C_AcctSchema_ID=c.C_AcctSchema_ID" - + " AND acs.M_CostType_ID=c.M_CostType_ID AND c.AD_Org_ID IN (0, w.AD_Org_ID)) " - + "WHERE c.M_CostElement_ID=" + p_M_CostElement_ID - + " AND iv.M_Warehouse_ID=w.M_Warehouse_ID" - + " AND iv.M_Product_ID=c.M_Product_ID" - + " AND iv.M_AttributeSetInstance_ID=c.M_AttributeSetInstance_ID) " - + "WHERE EXISTS (SELECT * FROM T_InventoryValue ivv " - + "WHERE ivv.AD_PInstance_ID=" + getAD_PInstance_ID() - + " AND ivv.M_CostElement_ID IS NULL)"); + sql = new StringBuilder ("UPDATE T_InventoryValue iv ") + .append("SET (Cost, M_CostElement_ID)=") + .append("(SELECT c.CurrentCostPrice, c.M_CostElement_ID ") + .append("FROM M_Warehouse w") + .append(" INNER JOIN AD_ClientInfo ci ON (w.AD_Client_ID=ci.AD_Client_ID)") + .append(" INNER JOIN C_AcctSchema acs ON (ci.C_AcctSchema1_ID=acs.C_AcctSchema_ID)") + .append(" INNER JOIN M_Cost c ON (acs.C_AcctSchema_ID=c.C_AcctSchema_ID") + .append(" AND acs.M_CostType_ID=c.M_CostType_ID AND c.AD_Org_ID IN (0, w.AD_Org_ID)) ") + .append("WHERE c.M_CostElement_ID=").append(p_M_CostElement_ID) + .append(" AND iv.M_Warehouse_ID=w.M_Warehouse_ID") + .append(" AND iv.M_Product_ID=c.M_Product_ID") + .append(" AND iv.M_AttributeSetInstance_ID=c.M_AttributeSetInstance_ID) ") + .append("WHERE EXISTS (SELECT * FROM T_InventoryValue ivv ") + .append("WHERE ivv.AD_PInstance_ID=").append(getAD_PInstance_ID()) + .append(" AND ivv.M_CostElement_ID IS NULL)"); int noUpdatedCost = DB.executeUpdateEx(sql.toString(), get_TrxName()); log.fine("Updated Cost=" + noUpdatedCost); } @@ -164,97 +164,97 @@ public class InventoryValue extends SvrProcess // Update Constants // YYYY-MM-DD HH24:MI:SS.mmmm JDBC Timestamp format String myDate = p_DateValue.toString(); - sql = new StringBuffer ("UPDATE T_InventoryValue SET ") + sql = new StringBuilder ("UPDATE T_InventoryValue SET ") .append("DateValue=TO_DATE('").append(myDate.substring(0,10)) .append(" 23:59:59','YYYY-MM-DD HH24:MI:SS'),") .append("M_PriceList_Version_ID=").append(p_M_PriceList_Version_ID).append(",") .append("C_Currency_ID=").append(p_C_Currency_ID) - .append(" WHERE AD_PInstance_ID=" + getAD_PInstance_ID()); + .append(" WHERE AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); log.fine("Constants=" + no); // Get current QtyOnHand with ASI - sql = new StringBuffer ("UPDATE T_InventoryValue iv SET QtyOnHand = " - + "(SELECT SUM(QtyOnHand) FROM M_Storage s" - + " INNER JOIN M_Locator l ON (l.M_Locator_ID=s.M_Locator_ID) " - + "WHERE iv.M_Product_ID=s.M_Product_ID" - + " AND iv.M_Warehouse_ID=l.M_Warehouse_ID" - + " AND iv.M_AttributeSetInstance_ID=s.M_AttributeSetInstance_ID) " - + "WHERE AD_PInstance_ID=").append(getAD_PInstance_ID()) + sql = new StringBuilder ("UPDATE T_InventoryValue iv SET QtyOnHand = ") + .append("(SELECT SUM(QtyOnHand) FROM M_Storage s") + .append(" INNER JOIN M_Locator l ON (l.M_Locator_ID=s.M_Locator_ID) ") + .append("WHERE iv.M_Product_ID=s.M_Product_ID") + .append(" AND iv.M_Warehouse_ID=l.M_Warehouse_ID") + .append(" AND iv.M_AttributeSetInstance_ID=s.M_AttributeSetInstance_ID) ") + .append("WHERE AD_PInstance_ID=").append(getAD_PInstance_ID()) .append(" AND iv.M_AttributeSetInstance_ID<>0"); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); log.fine("QtHand with ASI=" + no); // Get current QtyOnHand without ASI - sql = new StringBuffer ("UPDATE T_InventoryValue iv SET QtyOnHand = " - + "(SELECT SUM(QtyOnHand) FROM M_Storage s" - + " INNER JOIN M_Locator l ON (l.M_Locator_ID=s.M_Locator_ID) " - + "WHERE iv.M_Product_ID=s.M_Product_ID" - + " AND iv.M_Warehouse_ID=l.M_Warehouse_ID) " - + "WHERE iv.AD_PInstance_ID=").append(getAD_PInstance_ID()) + sql = new StringBuilder ("UPDATE T_InventoryValue iv SET QtyOnHand = ") + .append("(SELECT SUM(QtyOnHand) FROM M_Storage s") + .append(" INNER JOIN M_Locator l ON (l.M_Locator_ID=s.M_Locator_ID) ") + .append("WHERE iv.M_Product_ID=s.M_Product_ID") + .append(" AND iv.M_Warehouse_ID=l.M_Warehouse_ID) ") + .append("WHERE iv.AD_PInstance_ID=").append(getAD_PInstance_ID()) .append(" AND iv.M_AttributeSetInstance_ID=0"); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); log.fine("QtHand w/o ASI=" + no); // Adjust for Valuation Date - sql = new StringBuffer("UPDATE T_InventoryValue iv " - + "SET QtyOnHand=" - + "(SELECT iv.QtyOnHand - NVL(SUM(t.MovementQty), 0) " - + "FROM M_Transaction t" - + " INNER JOIN M_Locator l ON (t.M_Locator_ID=l.M_Locator_ID) " - + "WHERE t.M_Product_ID=iv.M_Product_ID" - + " AND t.M_AttributeSetInstance_ID=iv.M_AttributeSetInstance_ID" - + " AND t.MovementDate > iv.DateValue" - + " AND l.M_Warehouse_ID=iv.M_Warehouse_ID) " - + "WHERE iv.M_AttributeSetInstance_ID<>0" - + " AND iv.AD_PInstance_ID=").append(getAD_PInstance_ID()); + sql = new StringBuilder("UPDATE T_InventoryValue iv ") + .append("SET QtyOnHand=") + .append("(SELECT iv.QtyOnHand - NVL(SUM(t.MovementQty), 0) ") + .append("FROM M_Transaction t") + .append(" INNER JOIN M_Locator l ON (t.M_Locator_ID=l.M_Locator_ID) ") + .append("WHERE t.M_Product_ID=iv.M_Product_ID") + .append(" AND t.M_AttributeSetInstance_ID=iv.M_AttributeSetInstance_ID") + .append(" AND t.MovementDate > iv.DateValue") + .append(" AND l.M_Warehouse_ID=iv.M_Warehouse_ID) ") + .append("WHERE iv.M_AttributeSetInstance_ID<>0" ) + .append(" AND iv.AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); log.fine("Update with ASI=" + no); // - sql = new StringBuffer("UPDATE T_InventoryValue iv " - + "SET QtyOnHand=" - + "(SELECT iv.QtyOnHand - NVL(SUM(t.MovementQty), 0) " - + "FROM M_Transaction t" - + " INNER JOIN M_Locator l ON (t.M_Locator_ID=l.M_Locator_ID) " - + "WHERE t.M_Product_ID=iv.M_Product_ID" - + " AND t.MovementDate > iv.DateValue" - + " AND l.M_Warehouse_ID=iv.M_Warehouse_ID) " - + "WHERE iv.M_AttributeSetInstance_ID=0 " - + "AND iv.AD_PInstance_ID=").append(getAD_PInstance_ID()); + sql = new StringBuilder("UPDATE T_InventoryValue iv ") + .append("SET QtyOnHand=") + .append("(SELECT iv.QtyOnHand - NVL(SUM(t.MovementQty), 0) ") + .append("FROM M_Transaction t") + .append(" INNER JOIN M_Locator l ON (t.M_Locator_ID=l.M_Locator_ID) ") + .append("WHERE t.M_Product_ID=iv.M_Product_ID") + .append(" AND t.MovementDate > iv.DateValue") + .append(" AND l.M_Warehouse_ID=iv.M_Warehouse_ID) ") + .append("WHERE iv.M_AttributeSetInstance_ID=0 ") + .append("AND iv.AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); log.fine("Update w/o ASI=" + no); // Delete Records w/o OnHand Qty - sql = new StringBuffer("DELETE T_InventoryValue " - + "WHERE (QtyOnHand=0 OR QtyOnHand IS NULL) AND AD_PInstance_ID=").append(getAD_PInstance_ID()); + sql = new StringBuilder("DELETE T_InventoryValue ") + .append("WHERE (QtyOnHand=0 OR QtyOnHand IS NULL) AND AD_PInstance_ID=").append(getAD_PInstance_ID()); int noQty = DB.executeUpdateEx (sql.toString(), get_TrxName()); log.fine("NoQty Deleted=" + noQty); // Update Prices - sql = new StringBuffer("UPDATE T_InventoryValue iv " - + "SET PricePO = " - + "(SELECT MAX(currencyConvert (po.PriceList,po.C_Currency_ID,iv.C_Currency_ID,iv.DateValue,null, po.AD_Client_ID,po.AD_Org_ID))" - + " FROM M_Product_PO po WHERE po.M_Product_ID=iv.M_Product_ID" - + " AND po.IsCurrentVendor='Y'), " - + "PriceList = " - + "(SELECT currencyConvert(pp.PriceList,pl.C_Currency_ID,iv.C_Currency_ID,iv.DateValue,null, pl.AD_Client_ID,pl.AD_Org_ID)" - + " FROM M_PriceList pl, M_PriceList_Version plv, M_ProductPrice pp" - + " WHERE pp.M_Product_ID=iv.M_Product_ID AND pp.M_PriceList_Version_ID=iv.M_PriceList_Version_ID" - + " AND pp.M_PriceList_Version_ID=plv.M_PriceList_Version_ID" - + " AND plv.M_PriceList_ID=pl.M_PriceList_ID), " - + "PriceStd = " - + "(SELECT currencyConvert(pp.PriceStd,pl.C_Currency_ID,iv.C_Currency_ID,iv.DateValue,null, pl.AD_Client_ID,pl.AD_Org_ID)" - + " FROM M_PriceList pl, M_PriceList_Version plv, M_ProductPrice pp" - + " WHERE pp.M_Product_ID=iv.M_Product_ID AND pp.M_PriceList_Version_ID=iv.M_PriceList_Version_ID" - + " AND pp.M_PriceList_Version_ID=plv.M_PriceList_Version_ID" - + " AND plv.M_PriceList_ID=pl.M_PriceList_ID), " - + "PriceLimit = " - + "(SELECT currencyConvert(pp.PriceLimit,pl.C_Currency_ID,iv.C_Currency_ID,iv.DateValue,null, pl.AD_Client_ID,pl.AD_Org_ID)" - + " FROM M_PriceList pl, M_PriceList_Version plv, M_ProductPrice pp" - + " WHERE pp.M_Product_ID=iv.M_Product_ID AND pp.M_PriceList_Version_ID=iv.M_PriceList_Version_ID" - + " AND pp.M_PriceList_Version_ID=plv.M_PriceList_Version_ID" - + " AND plv.M_PriceList_ID=pl.M_PriceList_ID)" - + " WHERE iv.AD_PInstance_ID=").append(getAD_PInstance_ID()); + sql = new StringBuilder("UPDATE T_InventoryValue iv ") + .append("SET PricePO = ") + .append("(SELECT MAX(currencyConvert (po.PriceList,po.C_Currency_ID,iv.C_Currency_ID,iv.DateValue,null, po.AD_Client_ID,po.AD_Org_ID))") + .append(" FROM M_Product_PO po WHERE po.M_Product_ID=iv.M_Product_ID") + .append(" AND po.IsCurrentVendor='Y'), ") + .append("PriceList = ") + .append("(SELECT currencyConvert(pp.PriceList,pl.C_Currency_ID,iv.C_Currency_ID,iv.DateValue,null, pl.AD_Client_ID,pl.AD_Org_ID)") + .append(" FROM M_PriceList pl, M_PriceList_Version plv, M_ProductPrice pp") + .append(" WHERE pp.M_Product_ID=iv.M_Product_ID AND pp.M_PriceList_Version_ID=iv.M_PriceList_Version_ID") + .append(" AND pp.M_PriceList_Version_ID=plv.M_PriceList_Version_ID") + .append(" AND plv.M_PriceList_ID=pl.M_PriceList_ID), ") + .append("PriceStd = ") + .append("(SELECT currencyConvert(pp.PriceStd,pl.C_Currency_ID,iv.C_Currency_ID,iv.DateValue,null, pl.AD_Client_ID,pl.AD_Org_ID)") + .append(" FROM M_PriceList pl, M_PriceList_Version plv, M_ProductPrice pp") + .append(" WHERE pp.M_Product_ID=iv.M_Product_ID AND pp.M_PriceList_Version_ID=iv.M_PriceList_Version_ID") + .append(" AND pp.M_PriceList_Version_ID=plv.M_PriceList_Version_ID") + .append(" AND plv.M_PriceList_ID=pl.M_PriceList_ID), ") + .append("PriceLimit = ") + .append("(SELECT currencyConvert(pp.PriceLimit,pl.C_Currency_ID,iv.C_Currency_ID,iv.DateValue,null, pl.AD_Client_ID,pl.AD_Org_ID)") + .append(" FROM M_PriceList pl, M_PriceList_Version plv, M_ProductPrice pp") + .append(" WHERE pp.M_Product_ID=iv.M_Product_ID AND pp.M_PriceList_Version_ID=iv.M_PriceList_Version_ID") + .append(" AND pp.M_PriceList_Version_ID=plv.M_PriceList_Version_ID") + .append(" AND plv.M_PriceList_ID=pl.M_PriceList_ID)") + .append(" WHERE iv.AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdateEx (sql.toString(), get_TrxName()); String msg = ""; @@ -264,28 +264,29 @@ public class InventoryValue extends SvrProcess // Convert if different Currency if (as.getC_Currency_ID() != p_C_Currency_ID) { - sql = new StringBuffer ("UPDATE T_InventoryValue iv " - + "SET CostStandard= " - + "(SELECT currencyConvert(iv.CostStandard,acs.C_Currency_ID,iv.C_Currency_ID,iv.DateValue,null, iv.AD_Client_ID,iv.AD_Org_ID) " - + "FROM C_AcctSchema acs WHERE acs.C_AcctSchema_ID=" + as.getC_AcctSchema_ID() + ")," - + " Cost= " - + "(SELECT currencyConvert(iv.Cost,acs.C_Currency_ID,iv.C_Currency_ID,iv.DateValue,null, iv.AD_Client_ID,iv.AD_Org_ID) " - + "FROM C_AcctSchema acs WHERE acs.C_AcctSchema_ID=" + as.getC_AcctSchema_ID() + ") " - + "WHERE iv.AD_PInstance_ID=" + getAD_PInstance_ID()); + sql = new StringBuilder ("UPDATE T_InventoryValue iv ") + .append("SET CostStandard= ") + .append("(SELECT currencyConvert(iv.CostStandard,acs.C_Currency_ID,iv.C_Currency_ID,iv.DateValue,null, iv.AD_Client_ID,iv.AD_Org_ID) ") + .append("FROM C_AcctSchema acs WHERE acs.C_AcctSchema_ID=").append(as.getC_AcctSchema_ID()).append("),") + .append(" Cost= ") + .append("(SELECT currencyConvert(iv.Cost,acs.C_Currency_ID,iv.C_Currency_ID,iv.DateValue,null, iv.AD_Client_ID,iv.AD_Org_ID) ") + .append("FROM C_AcctSchema acs WHERE acs.C_AcctSchema_ID=").append(as.getC_AcctSchema_ID()).append(") ") + .append("WHERE iv.AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdateEx (sql.toString(), get_TrxName()); log.fine("Converted=" + no); } // Update Values - no = DB.executeUpdateEx("UPDATE T_InventoryValue SET " - + "PricePOAmt = QtyOnHand * PricePO, " - + "PriceListAmt = QtyOnHand * PriceList, " - + "PriceStdAmt = QtyOnHand * PriceStd, " - + "PriceLimitAmt = QtyOnHand * PriceLimit, " - + "CostStandardAmt = QtyOnHand * CostStandard, " - + "CostAmt = QtyOnHand * Cost " - + "WHERE AD_PInstance_ID=" + getAD_PInstance_ID() - , get_TrxName()); + StringBuilder dbeux = new StringBuilder("UPDATE T_InventoryValue SET ") + .append("PricePOAmt = QtyOnHand * PricePO, ") + .append("PriceListAmt = QtyOnHand * PriceList, ") + .append("PriceStdAmt = QtyOnHand * PriceStd, ") + .append("PriceLimitAmt = QtyOnHand * PriceLimit, ") + .append("CostStandardAmt = QtyOnHand * CostStandard, ") + .append("CostAmt = QtyOnHand * Cost ") + .append("WHERE AD_PInstance_ID=").append(getAD_PInstance_ID() + ); + no = DB.executeUpdateEx(dbeux.toString(), get_TrxName()); log.fine("Calculation=" + no); // return msg; diff --git a/org.adempiere.base.process/src/org/compiere/process/InvoiceBatchProcess.java b/org.adempiere.base.process/src/org/compiere/process/InvoiceBatchProcess.java index 5832d40b28..90905bfdc4 100644 --- a/org.adempiere.base.process/src/org/compiere/process/InvoiceBatchProcess.java +++ b/org.adempiere.base.process/src/org/compiere/process/InvoiceBatchProcess.java @@ -142,7 +142,8 @@ public class InvoiceBatchProcess extends SvrProcess batch.setProcessed(true); batch.saveEx(); - return "#" + m_count; + StringBuilder msgreturn = new StringBuilder("#").append(m_count); + return msgreturn.toString(); } // doIt diff --git a/org.adempiere.base.process/src/org/compiere/process/InvoiceGenerate.java b/org.adempiere.base.process/src/org/compiere/process/InvoiceGenerate.java index 93718cec58..9d3b4ce445 100644 --- a/org.adempiere.base.process/src/org/compiere/process/InvoiceGenerate.java +++ b/org.adempiere.base.process/src/org/compiere/process/InvoiceGenerate.java @@ -129,38 +129,38 @@ public class InvoiceGenerate extends SvrProcess + ", C_Order_ID=" + p_C_Order_ID + ", DocAction=" + p_docAction + ", Consolidate=" + p_ConsolidateDocument); // - String sql = null; + StringBuilder sql = null; if (p_Selection) // VInvoiceGen { - sql = "SELECT C_Order.* FROM C_Order, T_Selection " - + "WHERE C_Order.DocStatus='CO' AND C_Order.IsSOTrx='Y' " - + "AND C_Order.C_Order_ID = T_Selection.T_Selection_ID " - + "AND T_Selection.AD_PInstance_ID=? " - + "ORDER BY C_Order.M_Warehouse_ID, C_Order.PriorityRule, C_Order.C_BPartner_ID, C_Order.Bill_Location_ID, C_Order.C_Order_ID"; + sql = new StringBuilder("SELECT C_Order.* FROM C_Order, T_Selection ") + .append("WHERE C_Order.DocStatus='CO' AND C_Order.IsSOTrx='Y' ") + .append("AND C_Order.C_Order_ID = T_Selection.T_Selection_ID ") + .append("AND T_Selection.AD_PInstance_ID=? ") + .append("ORDER BY C_Order.M_Warehouse_ID, C_Order.PriorityRule, C_Order.C_BPartner_ID, C_Order.Bill_Location_ID, C_Order.C_Order_ID"); } else { - sql = "SELECT * FROM C_Order o " - + "WHERE DocStatus IN('CO','CL') AND IsSOTrx='Y'"; + sql = new StringBuilder("SELECT * FROM C_Order o ") + .append("WHERE DocStatus IN('CO','CL') AND IsSOTrx='Y'"); if (p_AD_Org_ID != 0) - sql += " AND AD_Org_ID=?"; + sql.append(" AND AD_Org_ID=?"); if (p_C_BPartner_ID != 0) - sql += " AND C_BPartner_ID=?"; + sql.append(" AND C_BPartner_ID=?"); if (p_C_Order_ID != 0) - sql += " AND C_Order_ID=?"; + sql.append(" AND C_Order_ID=?"); // - sql += " AND EXISTS (SELECT * FROM C_OrderLine ol " - + "WHERE o.C_Order_ID=ol.C_Order_ID AND ol.QtyOrdered<>ol.QtyInvoiced) " - + "AND o.C_DocType_ID IN (SELECT C_DocType_ID FROM C_DocType " - + "WHERE DocBaseType='SOO' AND DocSubTypeSO NOT IN ('ON','OB','WR')) " - + "ORDER BY M_Warehouse_ID, PriorityRule, C_BPartner_ID, Bill_Location_ID, C_Order_ID"; + sql.append(" AND EXISTS (SELECT * FROM C_OrderLine ol ") + .append("WHERE o.C_Order_ID=ol.C_Order_ID AND ol.QtyOrdered<>ol.QtyInvoiced) ") + .append("AND o.C_DocType_ID IN (SELECT C_DocType_ID FROM C_DocType ") + .append("WHERE DocBaseType='SOO' AND DocSubTypeSO NOT IN ('ON','OB','WR')) ") + .append("ORDER BY M_Warehouse_ID, PriorityRule, C_BPartner_ID, Bill_Location_ID, C_Order_ID"); } // sql += " FOR UPDATE"; PreparedStatement pstmt = null; try { - pstmt = DB.prepareStatement (sql, get_TrxName()); + pstmt = DB.prepareStatement (sql.toString(), get_TrxName()); int index = 1; if (p_Selection) { @@ -178,7 +178,7 @@ public class InvoiceGenerate extends SvrProcess } catch (Exception e) { - log.log(Level.SEVERE, sql, e); + log.log(Level.SEVERE, sql.toString(), e); } return generate(pstmt); } // doIt @@ -197,7 +197,8 @@ public class InvoiceGenerate extends SvrProcess while (rs.next ()) { MOrder order = new MOrder (getCtx(), rs, get_TrxName()); - statusUpdate(Msg.getMsg(getCtx(), "Processing") + " " + order.getDocumentInfo()); + StringBuilder msgsup = new StringBuilder(Msg.getMsg(getCtx(), "Processing")).append(" ").append(order.getDocumentInfo()); + statusUpdate(msgsup.toString()); // New Invoice Location if (!p_ConsolidateDocument @@ -337,7 +338,8 @@ public class InvoiceGenerate extends SvrProcess pstmt = null; } completeInvoice(); - return "@Created@ = " + m_created; + StringBuilder msgreturn = new StringBuilder("@Created@ = ").append(m_created); + return msgreturn.toString(); } // generate @@ -400,14 +402,14 @@ public class InvoiceGenerate extends SvrProcess AD_Language = Language.getBaseAD_Language(); java.text.SimpleDateFormat format = DisplayType.getDateFormat (DisplayType.Date, Language.getLanguage(AD_Language)); - String reference = dt.getPrintName(m_bp.getAD_Language()) - + ": " + ship.getDocumentNo() - + " - " + format.format(ship.getMovementDate()); + StringBuilder reference = new StringBuilder(dt.getPrintName(m_bp.getAD_Language())) + .append(": ").append(ship.getDocumentNo()) + .append(" - ").append(format.format(ship.getMovementDate())); m_ship = ship; // MInvoiceLine line = new MInvoiceLine (m_invoice); line.setIsDescription(true); - line.setDescription(reference); + line.setDescription(reference.toString()); line.setLine(m_line + sLine.getLine() - 2); if (!line.save()) throw new IllegalStateException("Could not create Invoice Comment Line (sh)"); diff --git a/org.adempiere.base.process/src/org/compiere/process/InvoiceNGL.java b/org.adempiere.base.process/src/org/compiere/process/InvoiceNGL.java index 16bdc1e06a..964f24ee36 100644 --- a/org.adempiere.base.process/src/org/compiere/process/InvoiceNGL.java +++ b/org.adempiere.base.process/src/org/compiere/process/InvoiceNGL.java @@ -117,47 +117,47 @@ public class InvoiceNGL extends SvrProcess p_DateReval = new Timestamp(System.currentTimeMillis()); // Delete - just to be sure - String sql = "DELETE T_InvoiceGL WHERE AD_PInstance_ID=" + getAD_PInstance_ID(); - int no = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("DELETE T_InvoiceGL WHERE AD_PInstance_ID=").append(getAD_PInstance_ID()); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no > 0) log.info("Deleted #" + no); // Insert Trx String dateStr = DB.TO_DATE(p_DateReval, true); - sql = "INSERT INTO T_InvoiceGL (AD_Client_ID, AD_Org_ID, IsActive, Created,CreatedBy, Updated,UpdatedBy," - + " AD_PInstance_ID, C_Invoice_ID, GrandTotal, OpenAmt, " - + " Fact_Acct_ID, AmtSourceBalance, AmtAcctBalance, " - + " AmtRevalDr, AmtRevalCr, C_DocTypeReval_ID, IsAllCurrencies, " - + " DateReval, C_ConversionTypeReval_ID, AmtRevalDrDiff, AmtRevalCrDiff, APAR) " + sql = new StringBuilder("INSERT INTO T_InvoiceGL (AD_Client_ID, AD_Org_ID, IsActive, Created,CreatedBy, Updated,UpdatedBy,") + .append(" AD_PInstance_ID, C_Invoice_ID, GrandTotal, OpenAmt, ") + .append(" Fact_Acct_ID, AmtSourceBalance, AmtAcctBalance, ") + .append(" AmtRevalDr, AmtRevalCr, C_DocTypeReval_ID, IsAllCurrencies, ") + .append(" DateReval, C_ConversionTypeReval_ID, AmtRevalDrDiff, AmtRevalCrDiff, APAR) ") // -- - + "SELECT i.AD_Client_ID, i.AD_Org_ID, i.IsActive, i.Created,i.CreatedBy, i.Updated,i.UpdatedBy," - + getAD_PInstance_ID() + ", i.C_Invoice_ID, i.GrandTotal, invoiceOpen(i.C_Invoice_ID, 0), " - + " fa.Fact_Acct_ID, fa.AmtSourceDr-fa.AmtSourceCr, fa.AmtAcctDr-fa.AmtAcctCr, " + .append("SELECT i.AD_Client_ID, i.AD_Org_ID, i.IsActive, i.Created,i.CreatedBy, i.Updated,i.UpdatedBy,") + .append( getAD_PInstance_ID()).append(", i.C_Invoice_ID, i.GrandTotal, invoiceOpen(i.C_Invoice_ID, 0), ") + .append(" fa.Fact_Acct_ID, fa.AmtSourceDr-fa.AmtSourceCr, fa.AmtAcctDr-fa.AmtAcctCr, ") // AmtRevalDr, AmtRevalCr, - + " currencyConvert(fa.AmtSourceDr, i.C_Currency_ID, a.C_Currency_ID, " + dateStr + ", " + p_C_ConversionTypeReval_ID + ", i.AD_Client_ID, i.AD_Org_ID)," - + " currencyConvert(fa.AmtSourceCr, i.C_Currency_ID, a.C_Currency_ID, " + dateStr + ", " + p_C_ConversionTypeReval_ID + ", i.AD_Client_ID, i.AD_Org_ID)," - + (p_C_DocTypeReval_ID==0 ? "NULL" : String.valueOf(p_C_DocTypeReval_ID)) + ", " - + (p_IsAllCurrencies ? "'Y'," : "'N',") - + dateStr + ", " + p_C_ConversionTypeReval_ID + ", 0, 0, '" + p_APAR + "' " + .append(" currencyConvert(fa.AmtSourceDr, i.C_Currency_ID, a.C_Currency_ID, ").append(dateStr).append(", ").append(p_C_ConversionTypeReval_ID).append(", i.AD_Client_ID, i.AD_Org_ID),") + .append(" currencyConvert(fa.AmtSourceCr, i.C_Currency_ID, a.C_Currency_ID, ").append(dateStr).append(", ").append(p_C_ConversionTypeReval_ID).append(", i.AD_Client_ID, i.AD_Org_ID),") + .append((p_C_DocTypeReval_ID==0 ? "NULL" : String.valueOf(p_C_DocTypeReval_ID))).append(", ") + .append((p_IsAllCurrencies ? "'Y'," : "'N',")) + .append(dateStr).append(", ").append(p_C_ConversionTypeReval_ID).append(", 0, 0, '").append(p_APAR).append("' ") // - + "FROM C_Invoice_v i" - + " INNER JOIN Fact_Acct fa ON (fa.AD_Table_ID=318 AND fa.Record_ID=i.C_Invoice_ID" - + " AND (i.GrandTotal=fa.AmtSourceDr OR i.GrandTotal=fa.AmtSourceCr))" - + " INNER JOIN C_AcctSchema a ON (fa.C_AcctSchema_ID=a.C_AcctSchema_ID) " - + "WHERE i.IsPaid='N'" - + " AND EXISTS (SELECT * FROM C_ElementValue ev " - + "WHERE ev.C_ElementValue_ID=fa.Account_ID AND (ev.AccountType='A' OR ev.AccountType='L'))" - + " AND fa.C_AcctSchema_ID=" + p_C_AcctSchema_ID; + .append("FROM C_Invoice_v i") + .append(" INNER JOIN Fact_Acct fa ON (fa.AD_Table_ID=318 AND fa.Record_ID=i.C_Invoice_ID") + .append(" AND (i.GrandTotal=fa.AmtSourceDr OR i.GrandTotal=fa.AmtSourceCr))") + .append(" INNER JOIN C_AcctSchema a ON (fa.C_AcctSchema_ID=a.C_AcctSchema_ID) ") + .append("WHERE i.IsPaid='N'") + .append(" AND EXISTS (SELECT * FROM C_ElementValue ev ") + .append("WHERE ev.C_ElementValue_ID=fa.Account_ID AND (ev.AccountType='A' OR ev.AccountType='L'))") + .append(" AND fa.C_AcctSchema_ID=").append(p_C_AcctSchema_ID); if (!p_IsAllCurrencies) - sql += " AND i.C_Currency_ID<>a.C_Currency_ID"; + sql.append(" AND i.C_Currency_ID<>a.C_Currency_ID"); if (ONLY_AR.equals(p_APAR)) - sql += " AND i.IsSOTrx='Y'"; + sql.append(" AND i.IsSOTrx='Y'"); else if (ONLY_AP.equals(p_APAR)) - sql += " AND i.IsSOTrx='N'"; + sql.append(" AND i.IsSOTrx='N'"); if (!p_IsAllCurrencies && p_C_Currency_ID != 0) - sql += " AND i.C_Currency_ID=" + p_C_Currency_ID; + sql.append(" AND i.C_Currency_ID=").append(p_C_Currency_ID); - no = DB.executeUpdate(sql, get_TrxName()); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Inserted #" + no); else if (CLogMgt.isLevelFiner()) @@ -166,35 +166,35 @@ public class InvoiceNGL extends SvrProcess log.warning("Inserted #" + no); // Calculate Difference - sql = "UPDATE T_InvoiceGL gl " - + "SET (AmtRevalDrDiff,AmtRevalCrDiff)=" - + "(SELECT gl.AmtRevalDr-fa.AmtAcctDr, gl.AmtRevalCr-fa.AmtAcctCr " - + "FROM Fact_Acct fa " - + "WHERE gl.Fact_Acct_ID=fa.Fact_Acct_ID) " - + "WHERE AD_PInstance_ID=" + getAD_PInstance_ID(); - int noT = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE T_InvoiceGL gl ") + .append("SET (AmtRevalDrDiff,AmtRevalCrDiff)=") + .append("(SELECT gl.AmtRevalDr-fa.AmtAcctDr, gl.AmtRevalCr-fa.AmtAcctCr ") + .append("FROM Fact_Acct fa ") + .append("WHERE gl.Fact_Acct_ID=fa.Fact_Acct_ID) ") + .append("WHERE AD_PInstance_ID=").append(getAD_PInstance_ID()); + int noT = DB.executeUpdate(sql.toString(), get_TrxName()); if (noT > 0) log.config("Difference #" + noT); // Percentage - sql = "UPDATE T_InvoiceGL SET Percent = 100 " - + "WHERE GrandTotal=OpenAmt AND AD_PInstance_ID=" + getAD_PInstance_ID(); - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE T_InvoiceGL SET Percent = 100 ") + .append("WHERE GrandTotal=OpenAmt AND AD_PInstance_ID=").append(getAD_PInstance_ID()); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no > 0) log.info("Not Paid #" + no); - sql = "UPDATE T_InvoiceGL SET Percent = ROUND(OpenAmt*100/GrandTotal,6) " - + "WHERE GrandTotal<>OpenAmt AND GrandTotal <> 0 AND AD_PInstance_ID=" + getAD_PInstance_ID(); - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE T_InvoiceGL SET Percent = ROUND(OpenAmt*100/GrandTotal,6) ") + .append("WHERE GrandTotal<>OpenAmt AND GrandTotal <> 0 AND AD_PInstance_ID=").append(getAD_PInstance_ID()); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no > 0) log.info("Partial Paid #" + no); - sql = "UPDATE T_InvoiceGL SET AmtRevalDr = AmtRevalDr * Percent/100," - + " AmtRevalCr = AmtRevalCr * Percent/100," - + " AmtRevalDrDiff = AmtRevalDrDiff * Percent/100," - + " AmtRevalCrDiff = AmtRevalCrDiff * Percent/100 " - + "WHERE Percent <> 100 AND AD_PInstance_ID=" + getAD_PInstance_ID(); - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE T_InvoiceGL SET AmtRevalDr = AmtRevalDr * Percent/100,") + .append(" AmtRevalCr = AmtRevalCr * Percent/100,") + .append(" AmtRevalDrDiff = AmtRevalDrDiff * Percent/100,") + .append(" AmtRevalCrDiff = AmtRevalCrDiff * Percent/100 ") + .append("WHERE Percent <> 100 AND AD_PInstance_ID=").append(getAD_PInstance_ID()); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no > 0) log.config("Partial Calc #" + no); @@ -206,8 +206,9 @@ public class InvoiceNGL extends SvrProcess log.warning("Can create Journal only for all currencies"); else info = createGLJournal(); - } - return "#" + noT + info; + } + StringBuilder msgreturn = new StringBuilder("#").append(noT).append(info); + return msgreturn.toString(); } // doIt /** @@ -302,8 +303,9 @@ public class InvoiceNGL extends SvrProcess } } createBalancing (asDefaultAccts, journal, drTotal, crTotal, AD_Org_ID, (list.size()+1) * 10); - - return " - " + batch.getDocumentNo() + " #" + list.size(); + + StringBuilder msgreturn = new StringBuilder(" - ").append(batch.getDocumentNo()).append(" #").append(list.size()); + return msgreturn.toString(); } // createGLJournal /** diff --git a/org.adempiere.base.process/src/org/compiere/process/InvoicePayScheduleValidate.java b/org.adempiere.base.process/src/org/compiere/process/InvoicePayScheduleValidate.java index d169bcd6e2..ebdb180fec 100644 --- a/org.adempiere.base.process/src/org/compiere/process/InvoicePayScheduleValidate.java +++ b/org.adempiere.base.process/src/org/compiere/process/InvoicePayScheduleValidate.java @@ -84,12 +84,12 @@ public class InvoicePayScheduleValidate extends SvrProcess schedule[i].saveEx(); } } - String msg = "@OK@"; + StringBuilder msg = new StringBuilder("@OK@"); if (!valid) - msg = "@GrandTotal@ = " + invoice.getGrandTotal() - + " <> @Total@ = " + total - + " - @Difference@ = " + invoice.getGrandTotal().subtract(total); - return Msg.parseTranslation(getCtx(), msg); + msg = new StringBuilder("@GrandTotal@ = ").append(invoice.getGrandTotal()) + .append(" <> @Total@ = ").append(total) + .append(" - @Difference@ = ").append(invoice.getGrandTotal().subtract(total)); + return Msg.parseTranslation(getCtx(), msg.toString()); } // doIt } // InvoicePayScheduleValidate diff --git a/org.adempiere.base.process/src/org/compiere/process/InvoicePrint.java b/org.adempiere.base.process/src/org/compiere/process/InvoicePrint.java index e45ea6e790..c219703eb8 100644 --- a/org.adempiere.base.process/src/org/compiere/process/InvoicePrint.java +++ b/org.adempiere.base.process/src/org/compiere/process/InvoicePrint.java @@ -130,21 +130,20 @@ public class InvoicePrint extends SvrProcess MClient client = MClient.get(getCtx()); // Get Info - StringBuffer sql = new StringBuffer ( - "SELECT i.C_Invoice_ID,bp.AD_Language,c.IsMultiLingualDocument," // 1..3 + StringBuilder sql = new StringBuilder ("SELECT i.C_Invoice_ID,bp.AD_Language,c.IsMultiLingualDocument,") // 1..3 // Prio: 1. BPartner 2. DocType, 3. PrintFormat (Org) // see ReportCtl+MInvoice - + " COALESCE(bp.Invoice_PrintFormat_ID, dt.AD_PrintFormat_ID, pf.Invoice_PrintFormat_ID)," // 4 - + " dt.DocumentCopies+bp.DocumentCopies," // 5 - + " bpc.AD_User_ID, i.DocumentNo," // 6..7 - + " bp.C_BPartner_ID " // 8 - + "FROM C_Invoice i" - + " INNER JOIN C_BPartner bp ON (i.C_BPartner_ID=bp.C_BPartner_ID)" - + " LEFT OUTER JOIN AD_User bpc ON (i.AD_User_ID=bpc.AD_User_ID)" - + " INNER JOIN AD_Client c ON (i.AD_Client_ID=c.AD_Client_ID)" - + " INNER JOIN AD_PrintForm pf ON (i.AD_Client_ID=pf.AD_Client_ID)" - + " INNER JOIN C_DocType dt ON (i.C_DocType_ID=dt.C_DocType_ID)" - + " WHERE i.AD_Client_ID=? AND i.AD_Org_ID=? AND i.isSOTrx='Y' AND " - + " pf.AD_Org_ID IN (0,i.AD_Org_ID) AND " ); // more them 1 PF + .append(" COALESCE(bp.Invoice_PrintFormat_ID, dt.AD_PrintFormat_ID, pf.Invoice_PrintFormat_ID),") // 4 + .append(" dt.DocumentCopies+bp.DocumentCopies,") // 5 + .append(" bpc.AD_User_ID, i.DocumentNo,") // 6..7 + .append(" bp.C_BPartner_ID ") // 8 + .append("FROM C_Invoice i") + .append(" INNER JOIN C_BPartner bp ON (i.C_BPartner_ID=bp.C_BPartner_ID)") + .append(" LEFT OUTER JOIN AD_User bpc ON (i.AD_User_ID=bpc.AD_User_ID)") + .append(" INNER JOIN AD_Client c ON (i.AD_Client_ID=c.AD_Client_ID)") + .append(" INNER JOIN AD_PrintForm pf ON (i.AD_Client_ID=pf.AD_Client_ID)") + .append(" INNER JOIN C_DocType dt ON (i.C_DocType_ID=dt.C_DocType_ID)") + .append(" WHERE i.AD_Client_ID=? AND i.AD_Org_ID=? AND i.isSOTrx='Y' AND ") + .append(" pf.AD_Org_ID IN (0,i.AD_Org_ID) AND " ); // more them 1 PF boolean needAnd = false; if (m_C_Invoice_ID != 0) sql.append("i.C_Invoice_ID=").append(m_C_Invoice_ID); @@ -289,8 +288,8 @@ public class InvoicePrint extends SvrProcess boolean printed = false; if (p_EMailPDF) { - String subject = mText.getMailHeader() + " - " + DocumentNo; - EMail email = client.createEMail(to.getEMail(), subject, null); + StringBuilder subject =new StringBuilder(mText.getMailHeader()).append(" - ").append(DocumentNo); + EMail email = client.createEMail(to.getEMail(), subject.toString(), null); if (!email.isValid()) { addLog (C_Invoice_ID, null, null, @@ -303,10 +302,10 @@ public class InvoicePrint extends SvrProcess mText.setPO(new MInvoice(getCtx(), C_Invoice_ID, get_TrxName())); String message = mText.getMailText(true); if (mText.isHtml()) - email.setMessageHTML(subject, message); + email.setMessageHTML(subject.toString(), message); else { - email.setSubject (subject); + email.setSubject (subject.toString()); email.setMessageText (message); } // @@ -348,8 +347,8 @@ public class InvoicePrint extends SvrProcess // Print Confirm if (printed) { - StringBuffer sb = new StringBuffer ("UPDATE C_Invoice " - + "SET DatePrinted=SysDate, IsPrinted='Y' WHERE C_Invoice_ID=") + StringBuilder sb = new StringBuilder ("UPDATE C_Invoice ") + .append("SET DatePrinted=SysDate, IsPrinted='Y' WHERE C_Invoice_ID=") .append (C_Invoice_ID); int no = DB.executeUpdate(sb.toString(), get_TrxName()); } @@ -364,9 +363,12 @@ public class InvoicePrint extends SvrProcess DB.close(rs, pstmt); } // - if (p_EMailPDF) - return "@Sent@=" + count + " - @Errors@=" + errors; - return "@Printed@=" + count; + if (p_EMailPDF){ + StringBuilder msgreturn = new StringBuilder("@Sent@=").append(count).append(" - @Errors@=").append(errors); + return msgreturn.toString(); + } + StringBuilder msgreturn = new StringBuilder("@Printed@=").append(count); + return msgreturn.toString(); } // doIt } // InvoicePrint diff --git a/org.adempiere.base.process/src/org/compiere/process/InvoiceWriteOff.java b/org.adempiere.base.process/src/org/compiere/process/InvoiceWriteOff.java index 55d04169be..68e175257e 100644 --- a/org.adempiere.base.process/src/org/compiere/process/InvoiceWriteOff.java +++ b/org.adempiere.base.process/src/org/compiere/process/InvoiceWriteOff.java @@ -134,10 +134,10 @@ public class InvoiceWriteOff extends SvrProcess if (p_CreatePayment && p_C_BankAccount_ID == 0) throw new AdempiereUserError ("@FillMandatory@ @C_BankAccount_ID@"); // - StringBuffer sql = new StringBuffer( - "SELECT C_Invoice_ID,DocumentNo,DateInvoiced," - + " C_Currency_ID,GrandTotal, invoiceOpen(C_Invoice_ID, 0) AS OpenAmt " - + "FROM C_Invoice WHERE "); + StringBuilder sql = new StringBuilder( + "SELECT C_Invoice_ID,DocumentNo,DateInvoiced,") + .append(" C_Currency_ID,GrandTotal, invoiceOpen(C_Invoice_ID, 0) AS OpenAmt ") + .append("FROM C_Invoice WHERE "); if (p_C_Invoice_ID != 0) sql.append("C_Invoice_ID=").append(p_C_Invoice_ID); else @@ -201,7 +201,8 @@ public class InvoiceWriteOff extends SvrProcess // final processPayment(); processAllocation(); - return "#" + counter; + StringBuilder msgreturn = new StringBuilder("#").append(counter); + return msgreturn.toString(); } // doIt /** diff --git a/org.adempiere.base.process/src/org/compiere/process/IssueReport.java b/org.adempiere.base.process/src/org/compiere/process/IssueReport.java index 0e39c24f8f..991433a864 100644 --- a/org.adempiere.base.process/src/org/compiere/process/IssueReport.java +++ b/org.adempiere.base.process/src/org/compiere/process/IssueReport.java @@ -51,14 +51,18 @@ public class IssueReport extends SvrProcess return "NOT reported - Enable Error Reporting in Window System"; // MIssue issue = new MIssue(getCtx(), m_AD_Issue_ID, get_TrxName()); - if (issue.get_ID() == 0) - return "No Issue to report - ID=" + m_AD_Issue_ID; + if (issue.get_ID() == 0){ + StringBuilder msgreturn = new StringBuilder("No Issue to report - ID=").append(m_AD_Issue_ID); + return msgreturn.toString(); + } // String error = issue.report(); if (error != null) throw new AdempiereSystemError(error); - if (issue.save()) - return "Issue Reported: " + issue.getRequestDocumentNo(); + if (issue.save()){ + StringBuilder msgreturn = new StringBuilder("Issue Reported: ").append(issue.getRequestDocumentNo()); + return msgreturn.toString(); + } throw new AdempiereSystemError("Issue Not Saved"); } // doIt diff --git a/org.adempiere.base.process/src/org/compiere/process/M_PriceList_Create.java b/org.adempiere.base.process/src/org/compiere/process/M_PriceList_Create.java index 9e85ad04f0..85380b6403 100644 --- a/org.adempiere.base.process/src/org/compiere/process/M_PriceList_Create.java +++ b/org.adempiere.base.process/src/org/compiere/process/M_PriceList_Create.java @@ -91,7 +91,7 @@ public class M_PriceList_Create extends SvrProcess { int totd = 0; int V_temp; int v_NextNo = 0; - String Message = " "; + StringBuilder Message = new StringBuilder(); // //Checking Prerequisites //PO Prices must exists @@ -225,7 +225,7 @@ public class M_PriceList_Create extends SvrProcess { if (cntd == -1) raiseError(" DELETE M_ProductPrice ", sqldel.toString()); totd += cntd; - Message = "@Deleted@=" + cntd + " - "; + Message = new StringBuilder("@Deleted@=").append(cntd).append(" - "); log.fine("Deleted " + cntd); } // @@ -375,7 +375,7 @@ public class M_PriceList_Create extends SvrProcess { } - Message = Message + "@Selected@=" + cnti; + Message.append("@Selected@=").append(cnti); // //Delete Prices in Selection, so that we can insert @@ -393,7 +393,7 @@ public class M_PriceList_Create extends SvrProcess { if (cntd == -1) raiseError(" DELETE M_ProductPrice ", sqldel.toString()); totd += cntd; - Message = Message + ", @Deleted@=" + cntd; + Message.append(", @Deleted@=").append(cntd); log.fine("Deleted " + cntd); } @@ -564,7 +564,7 @@ public class M_PriceList_Create extends SvrProcess { log.fine("Inserted " + cnti); } - Message = Message + ", @Inserted@=" + cnti; + Message.append(", @Inserted@=").append(cnti); // // Calculation // @@ -656,7 +656,7 @@ public class M_PriceList_Create extends SvrProcess { totu += cntu; log.fine("Updated " + cntu); - Message = Message + ", @Updated@=" + cntu; + Message.append(", @Updated@=").append(cntu); // //Fixed Price overwrite // @@ -683,8 +683,8 @@ public class M_PriceList_Create extends SvrProcess { log.fine("Updated " + cntu); v_NextNo = v_NextNo + 1; - addLog(0, null, null, Message); - Message = ""; + addLog(0, null, null, Message.toString()); + Message = new StringBuilder(); } dl.close(); Cur_DiscountLine.close(); @@ -718,12 +718,12 @@ public class M_PriceList_Create extends SvrProcess { private void raiseError(String string, String sql) throws Exception { // DB.rollback(false, get_TrxName()); - String msg = string; + StringBuilder msg = new StringBuilder(string); ValueNamePair pp = CLogger.retrieveError(); if (pp != null) - msg = pp.getName() + " - "; - msg += sql; - throw new AdempiereUserError(msg); + msg = new StringBuilder(pp.getName()).append(" - "); + msg.append(sql); + throw new AdempiereUserError(msg.toString()); } /** @@ -735,7 +735,7 @@ public class M_PriceList_Create extends SvrProcess { private String getSubCategoryWhereClause(int productCategoryId) throws SQLException, AdempiereSystemError{ //if a node with this id is found later in the search we have a loop in the tree int subTreeRootParentId = 0; - String retString = " "; + StringBuilder retString = new StringBuilder(); String sql = " SELECT M_Product_Category_ID, M_Product_Category_Parent_ID FROM M_Product_Category"; final Vector categories = new Vector(100); Statement stmt = DB.createStatement(); @@ -746,10 +746,10 @@ public class M_PriceList_Create extends SvrProcess { } categories.add(new SimpleTreeNode(rs.getInt(1), rs.getInt(2))); } - retString += getSubCategoriesString(productCategoryId, categories, subTreeRootParentId); + retString.append(getSubCategoriesString(productCategoryId, categories, subTreeRootParentId)); rs.close(); stmt.close(); - return retString; + return retString.toString(); } /** diff --git a/org.adempiere.base.process/src/org/compiere/process/M_Product_BOM_Check.java b/org.adempiere.base.process/src/org/compiere/process/M_Product_BOM_Check.java index 95cff66f55..7cb9424b79 100644 --- a/org.adempiere.base.process/src/org/compiere/process/M_Product_BOM_Check.java +++ b/org.adempiere.base.process/src/org/compiere/process/M_Product_BOM_Check.java @@ -73,7 +73,7 @@ public class M_Product_BOM_Check extends SvrProcess */ protected String doIt() throws Exception { - StringBuffer sql1 = null; + StringBuilder sql1 = null; int no = 0; log.info("Check BOM Structure"); @@ -90,20 +90,20 @@ public class M_Product_BOM_Check extends SvrProcess } // Table to put all BOMs - duplicate will cause exception - sql1 = new StringBuffer("DELETE FROM T_Selection2 WHERE Query_ID = 0 AND AD_PInstance_ID="+ m_AD_PInstance_ID); + sql1 = new StringBuilder("DELETE FROM T_Selection2 WHERE Query_ID = 0 AND AD_PInstance_ID=").append(m_AD_PInstance_ID); no = DB.executeUpdate(sql1.toString(), get_TrxName()); - sql1 = new StringBuffer("INSERT INTO T_Selection2 (AD_PInstance_ID, Query_ID, T_Selection_ID) VALUES (" - + m_AD_PInstance_ID - + ", 0, " - + p_Record_ID + ")"); + sql1 = new StringBuilder("INSERT INTO T_Selection2 (AD_PInstance_ID, Query_ID, T_Selection_ID) VALUES (") + .append(m_AD_PInstance_ID) + .append(", 0, ") + .append(p_Record_ID).append(")"); no = DB.executeUpdate(sql1.toString(), get_TrxName()); // Table of root modes - sql1 = new StringBuffer("DELETE FROM T_Selection WHERE AD_PInstance_ID="+ m_AD_PInstance_ID); + sql1 = new StringBuilder("DELETE FROM T_Selection WHERE AD_PInstance_ID=").append(m_AD_PInstance_ID); no = DB.executeUpdate(sql1.toString(), get_TrxName()); - sql1 = new StringBuffer("INSERT INTO T_Selection (AD_PInstance_ID, T_Selection_ID) VALUES (" - + m_AD_PInstance_ID - + ", " - + p_Record_ID + ")"); + sql1 = new StringBuilder("INSERT INTO T_Selection (AD_PInstance_ID, T_Selection_ID) VALUES (") + .append(m_AD_PInstance_ID) + .append(", ") + .append(p_Record_ID).append(")"); no = DB.executeUpdate(sql1.toString(), get_TrxName()); while (true) { @@ -112,8 +112,8 @@ public class M_Product_BOM_Check extends SvrProcess int countno = 0; try { - PreparedStatement pstmt = DB.prepareStatement - ("SELECT COUNT(*) FROM T_Selection WHERE AD_PInstance_ID="+ m_AD_PInstance_ID, get_TrxName()); + StringBuilder dbpst = new StringBuilder("SELECT COUNT(*) FROM T_Selection WHERE AD_PInstance_ID=").append(m_AD_PInstance_ID); + PreparedStatement pstmt = DB.prepareStatement(dbpst.toString(), get_TrxName()); ResultSet rs = pstmt.executeQuery(); if (rs.next()) countno = rs.getInt(1); @@ -133,31 +133,31 @@ public class M_Product_BOM_Check extends SvrProcess { // if any command fails (no==-1) break and inform failure // Insert BOM Nodes into "All" table - sql1 = new StringBuffer("INSERT INTO T_Selection2 (AD_PInstance_ID, Query_ID, T_Selection_ID) " - + "SELECT " + m_AD_PInstance_ID + ", 0, p.M_Product_ID FROM M_Product p WHERE IsBOM='Y' AND EXISTS " + sql1 = new StringBuilder("INSERT INTO T_Selection2 (AD_PInstance_ID, Query_ID, T_Selection_ID) ") + .append("SELECT ").append(m_AD_PInstance_ID).append(", 0, p.M_Product_ID FROM M_Product p WHERE IsBOM='Y' AND EXISTS ") //+ "(SELECT * FROM M_Product_BOM b WHERE p.M_Product_ID=b.M_ProductBOM_ID AND b.M_Product_ID IN " - + "(SELECT * FROM PP_Product_BOM b WHERE p.M_Product_ID=b.M_Product_ID AND b.M_Product_ID IN " - + "(SELECT T_Selection_ID FROM T_Selection WHERE AD_PInstance_ID="+ m_AD_PInstance_ID + "))"); + .append("(SELECT * FROM PP_Product_BOM b WHERE p.M_Product_ID=b.M_Product_ID AND b.M_Product_ID IN ") + .append("(SELECT T_Selection_ID FROM T_Selection WHERE AD_PInstance_ID=").append(m_AD_PInstance_ID).append("))"); no = DB.executeUpdate(sql1.toString(), get_TrxName()); if (no == -1) raiseError("InsertingRoot:ERROR", sql1.toString()); // Insert BOM Nodes into temporary table - sql1 = new StringBuffer("DELETE FROM T_Selection2 WHERE Query_ID = 1 AND AD_PInstance_ID="+ m_AD_PInstance_ID); + sql1 = new StringBuilder("DELETE FROM T_Selection2 WHERE Query_ID = 1 AND AD_PInstance_ID=").append(m_AD_PInstance_ID); no = DB.executeUpdate(sql1.toString(), get_TrxName()); if (no == -1) raiseError("InsertingRoot:ERROR", sql1.toString()); - sql1 = new StringBuffer("INSERT INTO T_Selection2 (AD_PInstance_ID, Query_ID, T_Selection_ID) " - + "SELECT " + m_AD_PInstance_ID + ", 1, p.M_Product_ID FROM M_Product p WHERE IsBOM='Y' AND EXISTS " + sql1 = new StringBuilder("INSERT INTO T_Selection2 (AD_PInstance_ID, Query_ID, T_Selection_ID) ") + .append("SELECT ").append(m_AD_PInstance_ID).append(", 1, p.M_Product_ID FROM M_Product p WHERE IsBOM='Y' AND EXISTS ") //+ "(SELECT * FROM M_Product_BOM b WHERE p.M_Product_ID=b.M_ProductBOM_ID AND b.M_Product_ID IN " - + "(SELECT * FROM PP_Product_BOM b WHERE p.M_Product_ID=b.M_Product_ID AND b.M_Product_ID IN " - + "(SELECT T_Selection_ID FROM T_Selection WHERE AD_PInstance_ID="+ m_AD_PInstance_ID + "))"); + .append("(SELECT * FROM PP_Product_BOM b WHERE p.M_Product_ID=b.M_Product_ID AND b.M_Product_ID IN ") + .append("(SELECT T_Selection_ID FROM T_Selection WHERE AD_PInstance_ID=").append(m_AD_PInstance_ID).append("))"); no = DB.executeUpdate(sql1.toString(), get_TrxName()); if (no == -1) raiseError("InsertingRoot:ERROR", sql1.toString()); // Copy into root table - sql1 = new StringBuffer("DELETE FROM T_Selection WHERE AD_PInstance_ID="+ m_AD_PInstance_ID); + sql1 = new StringBuilder("DELETE FROM T_Selection WHERE AD_PInstance_ID=").append(m_AD_PInstance_ID); no = DB.executeUpdate(sql1.toString(), get_TrxName()); if (no == -1) raiseError("InsertingRoot:ERROR", sql1.toString()); - sql1 = new StringBuffer("INSERT INTO T_Selection (AD_PInstance_ID, T_Selection_ID) " - + "SELECT " + m_AD_PInstance_ID + ", T_Selection_ID " - + "FROM T_Selection2 WHERE Query_ID = 1 AND AD_PInstance_ID="+ m_AD_PInstance_ID); + sql1 = new StringBuilder("INSERT INTO T_Selection (AD_PInstance_ID, T_Selection_ID) ") + .append("SELECT ").append(m_AD_PInstance_ID).append(", T_Selection_ID ") + .append("FROM T_Selection2 WHERE Query_ID = 1 AND AD_PInstance_ID=").append(m_AD_PInstance_ID); no = DB.executeUpdate(sql1.toString(), get_TrxName()); if (no == -1) raiseError("InsertingRoot:ERROR", sql1.toString()); } @@ -176,12 +176,12 @@ public class M_Product_BOM_Check extends SvrProcess private void raiseError(String string, String sql) throws Exception { DB.rollback(false, get_TrxName()); - String msg = string; + StringBuilder msg = new StringBuilder(string); ValueNamePair pp = CLogger.retrieveError(); if (pp != null) - msg = pp.getName() + " - "; - msg += sql; - throw new AdempiereUserError (msg); + msg = new StringBuilder(pp.getName()).append(" - "); + msg.append(sql); + throw new AdempiereUserError (msg.toString()); } } // M_Product_BOM_Check diff --git a/org.adempiere.base.process/src/org/compiere/process/M_Production_Run.java b/org.adempiere.base.process/src/org/compiere/process/M_Production_Run.java index 68b84b0c70..4448164d1d 100644 --- a/org.adempiere.base.process/src/org/compiere/process/M_Production_Run.java +++ b/org.adempiere.base.process/src/org/compiere/process/M_Production_Run.java @@ -256,11 +256,11 @@ public class M_Production_Run extends SvrProcess { } private void raiseError(String string, String sql) throws Exception { - String msg = string; + StringBuilder msg = new StringBuilder(string); ValueNamePair pp = CLogger.retrieveError(); if (pp != null) - msg = pp.getName() + " - "; - msg += sql; - throw new AdempiereUserError (msg); + msg = new StringBuilder(pp.getName()).append(" - "); + msg.append(sql); + throw new AdempiereUserError (msg.toString()); } } // M_Production_Run diff --git a/org.adempiere.base.process/src/org/compiere/process/NoteDelete.java b/org.adempiere.base.process/src/org/compiere/process/NoteDelete.java index f4968af0f2..6ceee421d5 100644 --- a/org.adempiere.base.process/src/org/compiere/process/NoteDelete.java +++ b/org.adempiere.base.process/src/org/compiere/process/NoteDelete.java @@ -66,14 +66,15 @@ public class NoteDelete extends SvrProcess { log.info("doIt - AD_User_ID=" + p_AD_User_ID); - String sql = "DELETE FROM AD_Note WHERE AD_Client_ID=" + getAD_Client_ID(); + StringBuilder sql = new StringBuilder("DELETE FROM AD_Note WHERE AD_Client_ID=").append(getAD_Client_ID()); if (p_AD_User_ID > 0) - sql += " AND AD_User_ID=" + p_AD_User_ID; + sql.append(" AND AD_User_ID=").append(p_AD_User_ID); if (p_KeepLogDays > 0) - sql += " AND (Created+" + p_KeepLogDays + ") < SysDate"; + sql.append(" AND (Created+").append(p_KeepLogDays).append(") < SysDate"); // - int no = DB.executeUpdate(sql, get_TrxName()); - return "@Deleted@ = " + no; + int no = DB.executeUpdate(sql.toString(), get_TrxName()); + StringBuilder msgreturn = new StringBuilder("@Deleted@ = ").append(no); + return msgreturn.toString(); } // doIt } // NoteDelete diff --git a/org.adempiere.base.process/src/org/compiere/process/OrderBatchProcess.java b/org.adempiere.base.process/src/org/compiere/process/OrderBatchProcess.java index 5bd041f9d4..66dab9845f 100644 --- a/org.adempiere.base.process/src/org/compiere/process/OrderBatchProcess.java +++ b/org.adempiere.base.process/src/org/compiere/process/OrderBatchProcess.java @@ -102,8 +102,8 @@ public class OrderBatchProcess extends SvrProcess throw new AdempiereUserError("@NotFound@: @DocAction@"); // - StringBuffer sql = new StringBuffer("SELECT * FROM C_Order o " - + " WHERE o.C_DocTypeTarget_ID=? AND o.DocStatus=? "); + StringBuilder sql = new StringBuilder("SELECT * FROM C_Order o ") + .append(" WHERE o.C_DocTypeTarget_ID=? AND o.DocStatus=? "); if (p_IsSelfService != null && p_IsSelfService.length() == 1) sql.append(" AND o.IsSelfService='").append(p_IsSelfService).append("'"); if (p_C_BPartner_ID != 0) @@ -159,7 +159,8 @@ public class OrderBatchProcess extends SvrProcess { pstmt = null; } - return "@Updated@=" + counter + ", @Errors@=" + errCounter; + StringBuilder msgreturn = new StringBuilder("@Updated@=").append(counter).append(", @Errors@=").append(errCounter); + return msgreturn.toString(); } // doIt /** diff --git a/org.adempiere.base.process/src/org/compiere/process/OrderLineCreateProduction.java b/org.adempiere.base.process/src/org/compiere/process/OrderLineCreateProduction.java index 60aa4febfe..6029082c9c 100644 --- a/org.adempiere.base.process/src/org/compiere/process/OrderLineCreateProduction.java +++ b/org.adempiere.base.process/src/org/compiere/process/OrderLineCreateProduction.java @@ -131,7 +131,8 @@ public class OrderLineCreateProduction extends SvrProcess production.setIsCreated("Y"); production.saveEx(); - return "Production created -- " + production.get_ValueAsString("DocumentNo"); + StringBuilder msgreturn = new StringBuilder("Production created -- ").append(production.get_ValueAsString("DocumentNo")); + return msgreturn.toString(); } // OrderLineCreateShipment } // OrderLineCreateShipment diff --git a/org.adempiere.base.process/src/org/compiere/process/OrderPOCreate.java b/org.adempiere.base.process/src/org/compiere/process/OrderPOCreate.java index b162d06262..837b51be9e 100644 --- a/org.adempiere.base.process/src/org/compiere/process/OrderPOCreate.java +++ b/org.adempiere.base.process/src/org/compiere/process/OrderPOCreate.java @@ -102,35 +102,34 @@ public class OrderPOCreate extends SvrProcess && p_C_BPartner_ID == 0 && p_Vendor_ID == 0) throw new AdempiereUserError("You need to restrict selection"); // - String sql = "SELECT * FROM C_Order o " - + "WHERE o.IsSOTrx='Y'" + StringBuilder sql = new StringBuilder("SELECT * FROM C_Order o ") + .append("WHERE o.IsSOTrx='Y'") // No Duplicates // " AND o.Link_Order_ID IS NULL" - + " AND NOT EXISTS (SELECT * FROM C_OrderLine ol WHERE o.C_Order_ID=ol.C_Order_ID AND ol.Link_OrderLine_ID IS NOT NULL)" - ; + .append(" AND NOT EXISTS (SELECT * FROM C_OrderLine ol WHERE o.C_Order_ID=ol.C_Order_ID AND ol.Link_OrderLine_ID IS NOT NULL)"); if (p_C_Order_ID != 0) - sql += " AND o.C_Order_ID=?"; + sql.append(" AND o.C_Order_ID=?"); else { if (p_C_BPartner_ID != 0) - sql += " AND o.C_BPartner_ID=?"; + sql.append(" AND o.C_BPartner_ID=?"); if (p_Vendor_ID != 0) - sql += " AND EXISTS (SELECT * FROM C_OrderLine ol" - + " INNER JOIN M_Product_PO po ON (ol.M_Product_ID=po.M_Product_ID) " - + "WHERE o.C_Order_ID=ol.C_Order_ID AND po.C_BPartner_ID=?)"; + sql.append(" AND EXISTS (SELECT * FROM C_OrderLine ol") + .append(" INNER JOIN M_Product_PO po ON (ol.M_Product_ID=po.M_Product_ID) ") + .append("WHERE o.C_Order_ID=ol.C_Order_ID AND po.C_BPartner_ID=?)"); if (p_DateOrdered_From != null && p_DateOrdered_To != null) - sql += "AND TRUNC(o.DateOrdered) BETWEEN ? AND ?"; + sql.append("AND TRUNC(o.DateOrdered) BETWEEN ? AND ?"); else if (p_DateOrdered_From != null && p_DateOrdered_To == null) - sql += "AND TRUNC(o.DateOrdered) >= ?"; + sql.append("AND TRUNC(o.DateOrdered) >= ?"); else if (p_DateOrdered_From == null && p_DateOrdered_To != null) - sql += "AND TRUNC(o.DateOrdered) <= ?"; + sql.append("AND TRUNC(o.DateOrdered) <= ?"); } PreparedStatement pstmt = null; ResultSet rs = null; int counter = 0; try { - pstmt = DB.prepareStatement (sql, get_TrxName()); + pstmt = DB.prepareStatement (sql.toString(), get_TrxName()); if (p_C_Order_ID != 0) pstmt.setInt (1, p_C_Order_ID); else @@ -162,8 +161,9 @@ public class OrderPOCreate extends SvrProcess rs = null; pstmt = null; } if (counter == 0) - log.fine(sql); - return "@Created@ " + counter; + log.fine(sql.toString()); + StringBuilder msgreturn = new StringBuilder("@Created@ ").append(counter); + return msgreturn.toString(); } // doIt /** diff --git a/org.adempiere.base.process/src/org/compiere/process/OrderPayScheduleValidate.java b/org.adempiere.base.process/src/org/compiere/process/OrderPayScheduleValidate.java index 5302aca83d..034601c38e 100644 --- a/org.adempiere.base.process/src/org/compiere/process/OrderPayScheduleValidate.java +++ b/org.adempiere.base.process/src/org/compiere/process/OrderPayScheduleValidate.java @@ -83,12 +83,12 @@ public class OrderPayScheduleValidate extends SvrProcess schedule[i].saveEx(); } } - String msg = "@OK@"; + StringBuilder msg = new StringBuilder("@OK@"); if (!valid) - msg = "@GrandTotal@ = " + order.getGrandTotal() - + " <> @Total@ = " + total - + " - @Difference@ = " + order.getGrandTotal().subtract(total); - return Msg.parseTranslation(getCtx(), msg); + msg = new StringBuilder("@GrandTotal@ = ") .append(order.getGrandTotal()) + .append(" <> @Total@ = ").append(total) + .append(" - @Difference@ = ").append(order.getGrandTotal().subtract(total)); + return Msg.parseTranslation(getCtx(), msg.toString()); } // doIt } // OrderPayScheduleValidate diff --git a/org.adempiere.base.process/src/org/compiere/process/OrderRePrice.java b/org.adempiere.base.process/src/org/compiere/process/OrderRePrice.java index 3e45fc2457..4ecab034c5 100644 --- a/org.adempiere.base.process/src/org/compiere/process/OrderRePrice.java +++ b/org.adempiere.base.process/src/org/compiere/process/OrderRePrice.java @@ -69,7 +69,7 @@ public class OrderRePrice extends SvrProcess if (p_C_Order_ID == 0 && p_C_Invoice_ID == 0) throw new IllegalArgumentException("Nothing to do"); - String retValue = ""; + StringBuilder retValue = new StringBuilder(); if (p_C_Order_ID != 0) { MOrder order = new MOrder (getCtx(), p_C_Order_ID, get_TrxName()); @@ -82,7 +82,7 @@ public class OrderRePrice extends SvrProcess } order = new MOrder (getCtx(), p_C_Order_ID, get_TrxName()); BigDecimal newPrice = order.getGrandTotal(); - retValue = order.getDocumentNo() + ": " + oldPrice + " -> " + newPrice; + retValue = new StringBuilder(order.getDocumentNo()).append(": ").append(oldPrice).append(" -> ").append(newPrice); } if (p_C_Invoice_ID != 0) { @@ -97,11 +97,11 @@ public class OrderRePrice extends SvrProcess invoice = new MInvoice (getCtx(), p_C_Invoice_ID, null); BigDecimal newPrice = invoice.getGrandTotal(); if (retValue.length() > 0) - retValue += Env.NL; - retValue += invoice.getDocumentNo() + ": " + oldPrice + " -> " + newPrice; + retValue.append(Env.NL); + retValue.append(invoice.getDocumentNo()).append(": ").append(oldPrice).append(" -> ").append(newPrice); } // - return retValue; + return retValue.toString(); } // doIt } // OrderRePrice diff --git a/org.adempiere.base.process/src/org/compiere/process/OrgOwnership.java b/org.adempiere.base.process/src/org/compiere/process/OrgOwnership.java index 1aee96ccaa..b79160b080 100644 --- a/org.adempiere.base.process/src/org/compiere/process/OrgOwnership.java +++ b/org.adempiere.base.process/src/org/compiere/process/OrgOwnership.java @@ -109,9 +109,9 @@ public class OrgOwnership extends SvrProcess throw new IllegalArgumentException ("Warehouse - Org cannot be * (0)"); // Set Warehouse - StringBuffer sql = new StringBuffer(); - sql.append("UPDATE M_Warehouse " - + "SET AD_Org_ID=").append(p_AD_Org_ID) + StringBuilder sql = new StringBuilder(); + sql.append("UPDATE M_Warehouse ") + .append("SET AD_Org_ID=").append(p_AD_Org_ID) .append(" WHERE M_Warehouse_ID=").append(p_M_Warehouse_ID) .append(" AND AD_Client_ID=").append(getAD_Client_ID()) .append(" AND AD_Org_ID<>").append(p_AD_Org_ID); @@ -119,9 +119,9 @@ public class OrgOwnership extends SvrProcess addLog (0,null, new BigDecimal(no), Msg.translate(getCtx(), "M_Warehouse_ID")); // Set Accounts - sql = new StringBuffer(); - sql.append("UPDATE M_Warehouse_Acct " - + "SET AD_Org_ID=").append(p_AD_Org_ID) + sql = new StringBuilder(); + sql.append("UPDATE M_Warehouse_Acct ") + .append("SET AD_Org_ID=").append(p_AD_Org_ID) .append(" WHERE M_Warehouse_ID=").append(p_M_Warehouse_ID) .append(" AND AD_Client_ID=").append(getAD_Client_ID()) .append(" AND AD_Org_ID<>").append(p_AD_Org_ID); @@ -129,9 +129,9 @@ public class OrgOwnership extends SvrProcess addLog (0,null, new BigDecimal(no), Msg.translate(getCtx(), "C_AcctSchema_ID")); // Set Locators - sql = new StringBuffer(); - sql.append("UPDATE M_Locator " - + "SET AD_Org_ID=").append(p_AD_Org_ID) + sql = new StringBuilder(); + sql.append("UPDATE M_Locator ") + .append("SET AD_Org_ID=").append(p_AD_Org_ID) .append(" WHERE M_Warehouse_ID=").append(p_M_Warehouse_ID) .append(" AND AD_Client_ID=").append(getAD_Client_ID()) .append(" AND AD_Org_ID<>").append(p_AD_Org_ID); @@ -139,12 +139,12 @@ public class OrgOwnership extends SvrProcess addLog (0,null, new BigDecimal(no), Msg.translate(getCtx(), "M_Locator_ID")); // Set Storage - sql = new StringBuffer(); - sql.append("UPDATE M_Storage s " - + "SET AD_Org_ID=").append(p_AD_Org_ID) - .append(" WHERE EXISTS " - + "(SELECT * FROM M_Locator l WHERE l.M_Locator_ID=s.M_Locator_ID" - + " AND l.M_Warehouse_ID=").append(p_M_Warehouse_ID) + sql = new StringBuilder(); + sql.append("UPDATE M_Storage s ") + .append("SET AD_Org_ID=").append(p_AD_Org_ID) + .append(" WHERE EXISTS ") + .append("(SELECT * FROM M_Locator l WHERE l.M_Locator_ID=s.M_Locator_ID") + .append(" AND l.M_Warehouse_ID=").append(p_M_Warehouse_ID) .append(") AND AD_Client_ID=").append(getAD_Client_ID()) .append(" AND AD_Org_ID<>").append(p_AD_Org_ID); no = DB.executeUpdate(sql.toString(), get_TrxName()); @@ -162,39 +162,39 @@ public class OrgOwnership extends SvrProcess log.info ("productOwnership - M_Product_Category_ID=" + p_M_Product_Category_ID + ", M_Product_ID=" + p_M_Product_ID); - String set = " SET AD_Org_ID=" + p_AD_Org_ID; + StringBuilder set = new StringBuilder(" SET AD_Org_ID=").append(p_AD_Org_ID); if (p_M_Product_Category_ID > 0) - set += " WHERE EXISTS (SELECT * FROM M_Product p" - + " WHERE p.M_Product_ID=x.M_Product_ID AND p.M_Product_Category_ID=" - + p_M_Product_Category_ID + ")"; + set.append(" WHERE EXISTS (SELECT * FROM M_Product p") + .append(" WHERE p.M_Product_ID=x.M_Product_ID AND p.M_Product_Category_ID=") + .append(p_M_Product_Category_ID).append(")"); else - set += " WHERE M_Product_ID=" + p_M_Product_ID; - set += " AND AD_Client_ID=" + getAD_Client_ID() + " AND AD_Org_ID<>" + p_AD_Org_ID; + set.append(" WHERE M_Product_ID=").append(p_M_Product_ID); + set.append(" AND AD_Client_ID=").append(getAD_Client_ID()).append(" AND AD_Org_ID<>").append(p_AD_Org_ID); log.fine("productOwnership - " + set); // Product - String sql = "UPDATE M_Product x " + set; - int no = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("UPDATE M_Product x ").append(set); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); addLog (0,null, new BigDecimal(no), Msg.translate(getCtx(), "M_Product_ID")); // Acct - sql = "UPDATE M_Product_Acct x " + set; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE M_Product_Acct x ").append(set); + no = DB.executeUpdate(sql.toString(), get_TrxName()); addLog (0,null, new BigDecimal(no), Msg.translate(getCtx(), "C_AcctSchema_ID")); // BOM - sql = "UPDATE M_Product_BOM x " + set; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE M_Product_BOM x ").append(set); + no = DB.executeUpdate(sql.toString(), get_TrxName()); addLog (0,null, new BigDecimal(no), Msg.translate(getCtx(), "M_Product_BOM_ID")); // PO - sql = "UPDATE M_Product_PO x " + set; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE M_Product_PO x ").append(set); + no = DB.executeUpdate(sql.toString(), get_TrxName()); addLog (0,null, new BigDecimal(no), Msg.translate(getCtx(), "PO")); // Trl - sql = "UPDATE M_Product_Trl x " + set; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE M_Product_Trl x ").append(set); + no = DB.executeUpdate(sql.toString(), get_TrxName()); addLog (0,null, new BigDecimal(no), Msg.translate(getCtx(), "AD_Language")); return ""; @@ -209,43 +209,43 @@ public class OrgOwnership extends SvrProcess log.info ("bPartnerOwnership - C_BP_Group_ID=" + p_C_BP_Group_ID + ", C_BPartner_ID=" + p_C_BPartner_ID); - String set = " SET AD_Org_ID=" + p_AD_Org_ID; + StringBuilder set = new StringBuilder(" SET AD_Org_ID=").append(p_AD_Org_ID); if (p_C_BP_Group_ID > 0) - set += " WHERE EXISTS (SELECT * FROM C_BPartner bp WHERE bp.C_BPartner_ID=x.C_BPartner_ID AND bp.C_BP_Group_ID=" + p_C_BP_Group_ID + ")"; + set.append(" WHERE EXISTS (SELECT * FROM C_BPartner bp WHERE bp.C_BPartner_ID=x.C_BPartner_ID AND bp.C_BP_Group_ID=").append(p_C_BP_Group_ID).append(")"); else - set += " WHERE C_BPartner_ID=" + p_C_BPartner_ID; - set += " AND AD_Client_ID=" + getAD_Client_ID() + " AND AD_Org_ID<>" + p_AD_Org_ID; - log.fine("bPartnerOwnership - " + set); + set.append(" WHERE C_BPartner_ID=").append(p_C_BPartner_ID); + set.append(" AND AD_Client_ID=").append(getAD_Client_ID()).append(" AND AD_Org_ID<>").append(p_AD_Org_ID); + log.fine("bPartnerOwnership - " + set.toString()); // BPartner - String sql = "UPDATE C_BPartner x " + set; - int no = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("UPDATE C_BPartner x ").append(set); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); addLog (0,null, new BigDecimal(no), Msg.translate(getCtx(), "C_BPartner_ID")); // Acct xxx - sql = "UPDATE C_BP_Customer_Acct x " + set; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE C_BP_Customer_Acct x ").append(set); + no = DB.executeUpdate(sql.toString(), get_TrxName()); addLog (0,null, new BigDecimal(no), Msg.translate(getCtx(), "C_AcctSchema_ID")); - sql = "UPDATE C_BP_Employee_Acct x " + set; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE C_BP_Employee_Acct x ").append(set); + no = DB.executeUpdate(sql.toString(), get_TrxName()); addLog (0,null, new BigDecimal(no), Msg.translate(getCtx(), "C_AcctSchema_ID")); - sql = "UPDATE C_BP_Vendor_Acct x " + set; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE C_BP_Vendor_Acct x ").append(set); + no = DB.executeUpdate(sql.toString(), get_TrxName()); addLog (0,null, new BigDecimal(no), Msg.translate(getCtx(), "C_AcctSchema_ID")); // Location - sql = "UPDATE C_BPartner_Location x " + set; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE C_BPartner_Location x ").append(set); + no = DB.executeUpdate(sql.toString(), get_TrxName()); addLog (0,null, new BigDecimal(no), Msg.translate(getCtx(), "C_BPartner_Location_ID")); // Contcat/User - sql = "UPDATE AD_User x " + set; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE AD_User x ").append(set); + no = DB.executeUpdate(sql.toString(), get_TrxName()); addLog (0,null, new BigDecimal(no), Msg.translate(getCtx(), "AD_User_ID")); // BankAcct - sql = "UPDATE C_BP_BankAccount x " + set; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE C_BP_BankAccount x ").append(set); + no = DB.executeUpdate(sql.toString(), get_TrxName()); addLog (0,null, new BigDecimal(no), Msg.translate(getCtx(), "C_BP_BankAccount_ID")); return ""; @@ -257,36 +257,36 @@ public class OrgOwnership extends SvrProcess */ private void generalOwnership () { - String set = "SET AD_Org_ID=0 WHERE AD_Client_ID=" + getAD_Client_ID() - + " AND AD_Org_ID<>0"; + StringBuilder set = new StringBuilder("SET AD_Org_ID=0 WHERE AD_Client_ID=").append(getAD_Client_ID()) + .append(" AND AD_Org_ID<>0"); // R_ContactInterest - String sql = "UPDATE R_ContactInterest " + set; - int no = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("UPDATE R_ContactInterest ").append(set); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("generalOwnership - R_ContactInterest=" + no); // AD_User_Roles - sql = "UPDATE AD_User_Roles " + set; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE AD_User_Roles ").append(set); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("generalOwnership - AD_User_Roles=" + no); // C_BPartner_Product - sql = "UPDATE C_BPartner_Product " + set; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE C_BPartner_Product ").append(set); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("generalOwnership - C_BPartner_Product=" + no); // Withholding - sql = "UPDATE C_BP_Withholding x " + set; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE C_BP_Withholding x ").append(set); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("generalOwnership - C_BP_Withholding=" + no); // Replenish - sql = "UPDATE M_Replenish " + set; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE M_Replenish ").append(set); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("generalOwnership - M_Replenish=" + no); diff --git a/org.adempiere.base.process/src/org/compiere/process/PaySelectionCreateCheck.java b/org.adempiere.base.process/src/org/compiere/process/PaySelectionCreateCheck.java index 6dce8e28b4..f4fa76d745 100644 --- a/org.adempiere.base.process/src/org/compiere/process/PaySelectionCreateCheck.java +++ b/org.adempiere.base.process/src/org/compiere/process/PaySelectionCreateCheck.java @@ -91,7 +91,8 @@ public class PaySelectionCreateCheck extends SvrProcess psel.setProcessed(true); psel.saveEx(); - return "@C_PaySelectionCheck_ID@ - #" + m_list.size(); + StringBuilder msgreturn = new StringBuilder("@C_PaySelectionCheck_ID@ - #").append(m_list.size()); + return msgreturn.toString(); } // doIt /** @@ -130,8 +131,8 @@ public class PaySelectionCreateCheck extends SvrProcess { int C_BPartner_ID = check.getC_BPartner_ID(); MBPartner bp = MBPartner.get(getCtx(), C_BPartner_ID); - String msg = "@NotFound@ @C_BP_BankAccount@: " + bp.getName(); - throw new AdempiereUserError(msg); + StringBuilder msg = new StringBuilder("@NotFound@ @C_BP_BankAccount@: ").append(bp.getName()); + throw new AdempiereUserError(msg.toString()); } if (!check.save()) throw new IllegalStateException("Cannot save MPaySelectionCheck"); From a210231735c2df37b0e0b35dbe1cb38202844307 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 26 Sep 2012 18:37:43 -0500 Subject: [PATCH 52/79] =?UTF-8?q?IDEMPIERE-308=20Performance:=20Replace=20?= =?UTF-8?q?with=20StringBuilder=20/=20Thanks=20to=20Richard=20Morales=20an?= =?UTF-8?q?d=20David=20Pe=C3=B1uela?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../process/PaySelectionCreateFrom.java | 76 ++++++++-------- .../org/compiere/process/PeriodStatus.java | 5 +- .../process/ProductCategoryAcctCopy.java | 89 ++++++++++--------- .../compiere/process/ProductionCreate.java | 3 +- .../compiere/process/ProductionProcess.java | 5 +- .../org/compiere/process/ProjectGenOrder.java | 3 +- .../org/compiere/process/ProjectIssue.java | 9 +- .../compiere/process/ProjectLinePricing.java | 8 +- .../process/ProjectPhaseGenOrder.java | 10 ++- .../org/compiere/process/RegisterSystem.java | 2 +- .../org/compiere/process/ReplenishReport.java | 35 ++++---- .../process/ReplenishReportProduction.java | 54 +++++------ .../compiere/process/ReplicationLocal.java | 16 ++-- .../compiere/process/ReplicationRemote.java | 40 ++++----- .../process/ReportColumnSet_Copy.java | 3 +- .../compiere/process/ReportLineSet_Copy.java | 3 +- .../process/RequestEMailProcessor.java | 52 +++++++---- .../org/compiere/process/RequestInvoice.java | 22 ++--- .../compiere/process/RequisitionPOCreate.java | 7 +- .../src/org/compiere/process/RfQClose.java | 3 +- 20 files changed, 237 insertions(+), 208 deletions(-) diff --git a/org.adempiere.base.process/src/org/compiere/process/PaySelectionCreateFrom.java b/org.adempiere.base.process/src/org/compiere/process/PaySelectionCreateFrom.java index 37002df4d3..6cde6e3dd9 100644 --- a/org.adempiere.base.process/src/org/compiere/process/PaySelectionCreateFrom.java +++ b/org.adempiere.base.process/src/org/compiere/process/PaySelectionCreateFrom.java @@ -113,71 +113,71 @@ public class PaySelectionCreateFrom extends SvrProcess // psel.getPayDate(); - String sql = "SELECT C_Invoice_ID," + StringBuilder sql = new StringBuilder("SELECT C_Invoice_ID,") // Open - + " currencyConvert(invoiceOpen(i.C_Invoice_ID, 0)" - + ",i.C_Currency_ID, ?,?, i.C_ConversionType_ID,i.AD_Client_ID,i.AD_Org_ID)," // ##1/2 Currency_To,PayDate + .append(" currencyConvert(invoiceOpen(i.C_Invoice_ID, 0)") + .append(",i.C_Currency_ID, ?,?, i.C_ConversionType_ID,i.AD_Client_ID,i.AD_Org_ID),") // ##1/2 Currency_To,PayDate // Discount - + " currencyConvert(paymentTermDiscount(i.GrandTotal,i.C_Currency_ID,i.C_PaymentTerm_ID,i.DateInvoiced, ?)" // ##3 PayDate - + ",i.C_Currency_ID, ?,?,i.C_ConversionType_ID,i.AD_Client_ID,i.AD_Org_ID)," // ##4/5 Currency_To,PayDate - + " PaymentRule, IsSOTrx " // 4..6 - + "FROM C_Invoice i " - + "WHERE IsSOTrx='N' AND IsPaid='N' AND DocStatus IN ('CO','CL')" - + " AND AD_Client_ID=?" // ##6 + .append(" currencyConvert(paymentTermDiscount(i.GrandTotal,i.C_Currency_ID,i.C_PaymentTerm_ID,i.DateInvoiced, ?)") // ##3 PayDate + .append(",i.C_Currency_ID, ?,?,i.C_ConversionType_ID,i.AD_Client_ID,i.AD_Org_ID),") // ##4/5 Currency_To,PayDate + .append(" PaymentRule, IsSOTrx ") // 4..6 + .append("FROM C_Invoice i ") + .append("WHERE IsSOTrx='N' AND IsPaid='N' AND DocStatus IN ('CO','CL')") + .append(" AND AD_Client_ID=?") // ##6 // Existing Payments - Will reselect Invoice if prepared but not paid - + " AND NOT EXISTS (SELECT * FROM C_PaySelectionLine psl" - + " INNER JOIN C_PaySelectionCheck psc ON (psl.C_PaySelectionCheck_ID=psc.C_PaySelectionCheck_ID)" - + " LEFT OUTER JOIN C_Payment pmt ON (pmt.C_Payment_ID=psc.C_Payment_ID)" - + " WHERE i.C_Invoice_ID=psl.C_Invoice_ID AND psl.IsActive='Y'" - + " AND (pmt.DocStatus IS NULL OR pmt.DocStatus NOT IN ('VO','RE')) )"; + .append(" AND NOT EXISTS (SELECT * FROM C_PaySelectionLine psl") + .append(" INNER JOIN C_PaySelectionCheck psc ON (psl.C_PaySelectionCheck_ID=psc.C_PaySelectionCheck_ID)") + .append(" LEFT OUTER JOIN C_Payment pmt ON (pmt.C_Payment_ID=psc.C_Payment_ID)") + .append(" WHERE i.C_Invoice_ID=psl.C_Invoice_ID AND psl.IsActive='Y'") + .append(" AND (pmt.DocStatus IS NULL OR pmt.DocStatus NOT IN ('VO','RE')) )"); // Disputed if (!p_IncludeInDispute) - sql += " AND i.IsInDispute='N'"; + sql.append(" AND i.IsInDispute='N'"); // PaymentRule (optional) if (p_PaymentRule != null) - sql += " AND PaymentRule=?"; // ## + sql.append(" AND PaymentRule=?"); // ## // OnlyDiscount if (p_OnlyDiscount) { if (p_OnlyDue) - sql += " AND ("; + sql.append(" AND ("); else - sql += " AND "; - sql += "paymentTermDiscount(invoiceOpen(C_Invoice_ID, 0), C_Currency_ID, C_PaymentTerm_ID, DateInvoiced, ?) > 0"; // ## + sql.append(" AND "); + sql.append("paymentTermDiscount(invoiceOpen(C_Invoice_ID, 0), C_Currency_ID, C_PaymentTerm_ID, DateInvoiced, ?) > 0"); // ## } // OnlyDue if (p_OnlyDue) { if (p_OnlyDiscount) - sql += " OR "; + sql.append(" OR "); else - sql += " AND "; - sql += "paymentTermDueDays(C_PaymentTerm_ID, DateInvoiced, ?) >= 0"; // ## + sql.append(" AND "); + sql.append("paymentTermDueDays(C_PaymentTerm_ID, DateInvoiced, ?) >= 0"); // ## if (p_OnlyDiscount) - sql += ")"; + sql.append(")"); } // Business Partner if (p_C_BPartner_ID != 0) - sql += " AND C_BPartner_ID=?"; // ## + sql.append(" AND C_BPartner_ID=?"); // ## // Business Partner Group else if (p_C_BP_Group_ID != 0) - sql += " AND EXISTS (SELECT * FROM C_BPartner bp " - + "WHERE bp.C_BPartner_ID=i.C_BPartner_ID AND bp.C_BP_Group_ID=?)"; // ## + sql.append(" AND EXISTS (SELECT * FROM C_BPartner bp ") + .append("WHERE bp.C_BPartner_ID=i.C_BPartner_ID AND bp.C_BP_Group_ID=?)"); // ## // PO Matching Requirement if (p_MatchRequirement.equals("P") || p_MatchRequirement.equals("B")) { - sql += " AND EXISTS (SELECT * FROM C_InvoiceLine il " - + "WHERE i.C_Invoice_ID=il.C_Invoice_ID" - + " AND QtyInvoiced=(SELECT SUM(Qty) FROM M_MatchPO m " - + "WHERE il.C_InvoiceLine_ID=m.C_InvoiceLine_ID))"; + sql.append(" AND EXISTS (SELECT * FROM C_InvoiceLine il ") + .append("WHERE i.C_Invoice_ID=il.C_Invoice_ID") + .append(" AND QtyInvoiced=(SELECT SUM(Qty) FROM M_MatchPO m ") + .append("WHERE il.C_InvoiceLine_ID=m.C_InvoiceLine_ID))"); } // Receipt Matching Requirement if (p_MatchRequirement.equals("R") || p_MatchRequirement.equals("B")) { - sql += " AND EXISTS (SELECT * FROM C_InvoiceLine il " - + "WHERE i.C_Invoice_ID=il.C_Invoice_ID" - + " AND QtyInvoiced=(SELECT SUM(Qty) FROM M_MatchInv m " - + "WHERE il.C_InvoiceLine_ID=m.C_InvoiceLine_ID))"; + sql.append(" AND EXISTS (SELECT * FROM C_InvoiceLine il ") + .append("WHERE i.C_Invoice_ID=il.C_Invoice_ID") + .append(" AND QtyInvoiced=(SELECT SUM(Qty) FROM M_MatchInv m ") + .append("WHERE il.C_InvoiceLine_ID=m.C_InvoiceLine_ID))"); } // @@ -186,7 +186,7 @@ public class PaySelectionCreateFrom extends SvrProcess PreparedStatement pstmt = null; try { - pstmt = DB.prepareStatement (sql, get_TrxName()); + pstmt = DB.prepareStatement (sql.toString(), get_TrxName()); int index = 1; pstmt.setInt (index++, C_CurrencyTo_ID); pstmt.setTimestamp(index++, psel.getPayDate()); @@ -234,7 +234,7 @@ public class PaySelectionCreateFrom extends SvrProcess } catch (Exception e) { - log.log(Level.SEVERE, sql, e); + log.log(Level.SEVERE, sql.toString(), e); } try { @@ -246,8 +246,8 @@ public class PaySelectionCreateFrom extends SvrProcess { pstmt = null; } - - return "@C_PaySelectionLine_ID@ - #" + lines; + StringBuilder msgreturn = new StringBuilder("@C_PaySelectionLine_ID@ - #").append(lines); + return msgreturn.toString(); } // doIt } // PaySelectionCreateFrom diff --git a/org.adempiere.base.process/src/org/compiere/process/PeriodStatus.java b/org.adempiere.base.process/src/org/compiere/process/PeriodStatus.java index 11ea77c05d..c765e98456 100644 --- a/org.adempiere.base.process/src/org/compiere/process/PeriodStatus.java +++ b/org.adempiere.base.process/src/org/compiere/process/PeriodStatus.java @@ -69,7 +69,7 @@ public class PeriodStatus extends SvrProcess if (period.get_ID() == 0) throw new AdempiereUserError("@NotFound@ @C_Period_ID@=" + p_C_Period_ID); - StringBuffer sql = new StringBuffer ("UPDATE C_PeriodControl "); + StringBuilder sql = new StringBuilder ("UPDATE C_PeriodControl "); sql.append("SET PeriodStatus='"); // Open if (MPeriodControl.PERIODACTION_OpenPeriod.equals(p_PeriodAction)) @@ -93,7 +93,8 @@ public class PeriodStatus extends SvrProcess CacheMgt.get().reset("C_PeriodControl", 0); CacheMgt.get().reset("C_Period", p_C_Period_ID); - return "@Updated@ #" + no; + StringBuilder msgreturn = new StringBuilder("@Updated@ #").append(no); + return msgreturn.toString(); } // doIt } // PeriodStatus diff --git a/org.adempiere.base.process/src/org/compiere/process/ProductCategoryAcctCopy.java b/org.adempiere.base.process/src/org/compiere/process/ProductCategoryAcctCopy.java index a2205837c1..9cbe40690b 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ProductCategoryAcctCopy.java +++ b/org.adempiere.base.process/src/org/compiere/process/ProductCategoryAcctCopy.java @@ -72,55 +72,56 @@ public class ProductCategoryAcctCopy extends SvrProcess throw new AdempiereSystemError("Not Found - C_AcctSchema_ID=" + p_C_AcctSchema_ID); // Update - String sql = "UPDATE M_Product_Acct pa " - + "SET (P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct," - + " P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct,P_AverageCostVariance_Acct," - + " P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct," - + " P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct," - + " P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct)=" - + " (SELECT P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct," - + " P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct,P_AverageCostVariance_Acct," - + " P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct," - + " P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct," - + " P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct" - + " FROM M_Product_Category_Acct pca" - + " WHERE pca.M_Product_Category_ID=" + p_M_Product_Category_ID - + " AND pca.C_AcctSchema_ID=" + p_C_AcctSchema_ID - + "), Updated=SysDate, UpdatedBy=0 " - + "WHERE pa.C_AcctSchema_ID=" + p_C_AcctSchema_ID - + " AND EXISTS (SELECT * FROM M_Product p " - + "WHERE p.M_Product_ID=pa.M_Product_ID" - + " AND p.M_Product_Category_ID=" + p_M_Product_Category_ID + ")"; - int updated = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("UPDATE M_Product_Acct pa ") + .append("SET (P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct,") + .append(" P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct,P_AverageCostVariance_Acct,") + .append(" P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct,") + .append(" P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct,") + .append(" P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct)=") + .append(" (SELECT P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct,") + .append(" P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct,P_AverageCostVariance_Acct,") + .append(" P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct,") + .append(" P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct,") + .append(" P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct") + .append(" FROM M_Product_Category_Acct pca") + .append(" WHERE pca.M_Product_Category_ID=").append(p_M_Product_Category_ID) + .append(" AND pca.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) + .append("), Updated=SysDate, UpdatedBy=0 ") + .append("WHERE pa.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) + .append(" AND EXISTS (SELECT * FROM M_Product p ") + .append("WHERE p.M_Product_ID=pa.M_Product_ID") + .append(" AND p.M_Product_Category_ID=").append(p_M_Product_Category_ID).append(")"); + int updated = DB.executeUpdate(sql.toString(), get_TrxName()); addLog(0, null, new BigDecimal(updated), "@Updated@"); // Insert new Products - sql = "INSERT INTO M_Product_Acct " - + "(M_Product_ID, C_AcctSchema_ID," - + " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy," - + " P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct," - + " P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_AverageCostVariance_Acct," - + " P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, " - + " P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct," - + " P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) " - + "SELECT p.M_Product_ID, acct.C_AcctSchema_ID," - + " p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0," - + " acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct," - + " acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_AverageCostVariance_Acct," - + " acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, " - + " acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct," - + " acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct " - + "FROM M_Product p" - + " INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)" - + "WHERE acct.C_AcctSchema_ID=" + p_C_AcctSchema_ID // # - + " AND p.M_Product_Category_ID=" + p_M_Product_Category_ID // # - + " AND NOT EXISTS (SELECT * FROM M_Product_Acct pa " - + "WHERE pa.M_Product_ID=p.M_Product_ID" - + " AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID)"; - int created = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("INSERT INTO M_Product_Acct ") + .append("(M_Product_ID, C_AcctSchema_ID,") + .append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,") + .append(" P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct,") + .append(" P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_AverageCostVariance_Acct,") + .append(" P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, ") + .append(" P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct,") + .append(" P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) ") + .append("SELECT p.M_Product_ID, acct.C_AcctSchema_ID,") + .append(" p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,") + .append(" acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct,") + .append(" acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_AverageCostVariance_Acct,") + .append(" acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, ") + .append(" acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct,") + .append(" acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct ") + .append("FROM M_Product p") + .append(" INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)") + .append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) // # + .append(" AND p.M_Product_Category_ID=").append(p_M_Product_Category_ID) // # + .append(" AND NOT EXISTS (SELECT * FROM M_Product_Acct pa ") + .append("WHERE pa.M_Product_ID=p.M_Product_ID") + .append(" AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID)"); + int created = DB.executeUpdate(sql.toString(), get_TrxName()); addLog(0, null, new BigDecimal(created), "@Created@"); - return "@Created@=" + created + ", @Updated@=" + updated; + StringBuilder msgreturn = new StringBuilder("@Created@=").append(created).append(", @Updated@=").append(updated); + return msgreturn.toString(); } // doIt } // ProductCategoryAcctCopy diff --git a/org.adempiere.base.process/src/org/compiere/process/ProductionCreate.java b/org.adempiere.base.process/src/org/compiere/process/ProductionCreate.java index 68e56f8c7c..a51da43714 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ProductionCreate.java +++ b/org.adempiere.base.process/src/org/compiere/process/ProductionCreate.java @@ -105,7 +105,8 @@ public class ProductionCreate extends SvrProcess { m_production.setIsCreated("Y"); m_production.save(get_TrxName()); - return created + " production lines were created"; + StringBuilder msgreturn = new StringBuilder(created).append(" production lines were created"); + return msgreturn.toString(); } protected void isBom(int M_Product_ID) throws Exception diff --git a/org.adempiere.base.process/src/org/compiere/process/ProductionProcess.java b/org.adempiere.base.process/src/org/compiere/process/ProductionProcess.java index a53d74f0b9..07a0a19dfa 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ProductionProcess.java +++ b/org.adempiere.base.process/src/org/compiere/process/ProductionProcess.java @@ -67,7 +67,7 @@ public class ProductionProcess extends SvrProcess { int processed = 0; m_production.setMovementDate(p_MovementDate); MProductionLine[] lines = m_production.getLines(); - StringBuffer errors = new StringBuffer(); + StringBuilder errors = new StringBuilder(); for ( int i = 0; i Saved=" + count); } // Order Lines - return "@C_Order_ID@ " + order.getDocumentNo() + " (" + count + ")"; + StringBuilder msgreturn = new StringBuilder("@C_Order_ID@ ").append(order.getDocumentNo()).append(" (").append(count).append(")"); + return msgreturn.toString(); } // doIt /** diff --git a/org.adempiere.base.process/src/org/compiere/process/ProjectIssue.java b/org.adempiere.base.process/src/org/compiere/process/ProjectIssue.java index 2caab1f132..ac97383ad2 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ProjectIssue.java +++ b/org.adempiere.base.process/src/org/compiere/process/ProjectIssue.java @@ -196,8 +196,8 @@ public class ProjectIssue extends SvrProcess addLog(pi.getLine(), pi.getMovementDate(), pi.getMovementQty(), null); counter++; } // all InOutLines - - return "@Created@ " + counter; + StringBuilder msgreturn = new StringBuilder("@Created@ ").append(counter); + return msgreturn.toString(); } // issueReceipt @@ -258,8 +258,9 @@ public class ProjectIssue extends SvrProcess addLog(pi.getLine(), pi.getMovementDate(), pi.getMovementQty(), null); counter++; } // allExpenseLines - - return "@Created@ " + counter; + + StringBuilder msgreturn = new StringBuilder("@Created@ ").append(counter); + return msgreturn.toString(); } // issueExpense diff --git a/org.adempiere.base.process/src/org/compiere/process/ProjectLinePricing.java b/org.adempiere.base.process/src/org/compiere/process/ProjectLinePricing.java index 65d46ea34b..4b452e9495 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ProjectLinePricing.java +++ b/org.adempiere.base.process/src/org/compiere/process/ProjectLinePricing.java @@ -80,10 +80,10 @@ public class ProjectLinePricing extends SvrProcess projectLine.setPlannedMarginAmt(pp.getPriceStd().subtract(pp.getPriceLimit())); projectLine.saveEx(); // - String retValue = Msg.getElement(getCtx(), "PriceList") + pp.getPriceList() + " - " - + Msg.getElement(getCtx(), "PriceStd") + pp.getPriceStd() + " - " - + Msg.getElement(getCtx(), "PriceLimit") + pp.getPriceLimit(); - return retValue; + StringBuilder retValue = new StringBuilder(Msg.getElement(getCtx(), "PriceList")).append(pp.getPriceList()).append(" - ") + .append(Msg.getElement(getCtx(), "PriceStd")).append(pp.getPriceStd()).append(" - ") + .append(Msg.getElement(getCtx(), "PriceLimit")).append(pp.getPriceLimit()); + return retValue.toString(); } // doIt } // ProjectLinePricing diff --git a/org.adempiere.base.process/src/org/compiere/process/ProjectPhaseGenOrder.java b/org.adempiere.base.process/src/org/compiere/process/ProjectPhaseGenOrder.java index 947d70968d..5c6cd21aa3 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ProjectPhaseGenOrder.java +++ b/org.adempiere.base.process/src/org/compiere/process/ProjectPhaseGenOrder.java @@ -77,7 +77,7 @@ public class ProjectPhaseGenOrder extends SvrProcess { MOrderLine ol = new MOrderLine(order); ol.setLine(fromPhase.getSeqNo()); - StringBuffer sb = new StringBuffer (fromPhase.getName()); + StringBuilder sb = new StringBuilder (fromPhase.getName()); if (fromPhase.getDescription() != null && fromPhase.getDescription().length() > 0) sb.append(" - ").append(fromPhase.getDescription()); ol.setDescription(sb.toString()); @@ -90,7 +90,8 @@ public class ProjectPhaseGenOrder extends SvrProcess ol.setTax(); if (!ol.save()) log.log(Level.SEVERE, "doIt - Lines not generated"); - return "@C_Order_ID@ " + order.getDocumentNo() + " (1)"; + StringBuilder msgreturn = new StringBuilder("@C_Order_ID@ ").append(order.getDocumentNo()).append(" (1)"); + return msgreturn.toString(); } // Project Phase Lines @@ -121,7 +122,7 @@ public class ProjectPhaseGenOrder extends SvrProcess { MOrderLine ol = new MOrderLine(order); ol.setLine(tasks[i].getSeqNo()); - StringBuffer sb = new StringBuffer (tasks[i].getName()); + StringBuilder sb = new StringBuilder (tasks[i].getName()); if (tasks[i].getDescription() != null && tasks[i].getDescription().length() > 0) sb.append(" - ").append(tasks[i].getDescription()); ol.setDescription(sb.toString()); @@ -136,7 +137,8 @@ public class ProjectPhaseGenOrder extends SvrProcess if (tasks.length != count - lines.length) log.log(Level.SEVERE, "doIt - Lines difference - ProjectTasks=" + tasks.length + " <> Saved=" + count); - return "@C_Order_ID@ " + order.getDocumentNo() + " (" + count + ")"; + StringBuilder msgreturn = new StringBuilder("@C_Order_ID@ ").append(order.getDocumentNo()).append(" (").append(count).append(")"); + return msgreturn.toString(); } // doIt } // ProjectPhaseGenOrder diff --git a/org.adempiere.base.process/src/org/compiere/process/RegisterSystem.java b/org.adempiere.base.process/src/org/compiere/process/RegisterSystem.java index 64917ce42f..0ee1f58acd 100644 --- a/org.adempiere.base.process/src/org/compiere/process/RegisterSystem.java +++ b/org.adempiere.base.process/src/org/compiere/process/RegisterSystem.java @@ -86,7 +86,7 @@ public class RegisterSystem extends SvrProcess // Create Query String String enc = WebEnv.ENCODING; // Send GET Request - StringBuffer urlString = new StringBuffer ("http://www.adempiere.com") + StringBuilder urlString = new StringBuilder ("http://www.adempiere.com") .append("/wstore/registrationServlet?"); // System Info urlString.append("Name=").append(URLEncoder.encode(sys.getName(), enc)) diff --git a/org.adempiere.base.process/src/org/compiere/process/ReplenishReport.java b/org.adempiere.base.process/src/org/compiere/process/ReplenishReport.java index 0b22b09164..e5f5c030c5 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ReplenishReport.java +++ b/org.adempiere.base.process/src/org/compiere/process/ReplenishReport.java @@ -67,7 +67,7 @@ public class ReplenishReport extends SvrProcess /** Document Type */ private int p_C_DocType_ID = 0; /** Return Info */ - private String m_info = ""; + private StringBuffer m_info = new StringBuffer(); /** * Prepare - e.g., get Parameters. @@ -130,7 +130,7 @@ public class ReplenishReport extends SvrProcess createMovements(); else if (p_ReplenishmentCreate.equals("DOO")) createDO(); - return m_info; + return m_info.toString(); } // doIt /** @@ -435,8 +435,8 @@ public class ReplenishReport extends SvrProcess line.setPrice(); line.saveEx(); } - m_info = "#" + noOrders + info.toString(); - log.info(m_info); + m_info = new StringBuffer("#").append(noOrders).append(info.toString()); + log.info(m_info.toString()); } // createPO /** @@ -481,8 +481,8 @@ public class ReplenishReport extends SvrProcess line.setPrice(); line.saveEx(); } - m_info = "#" + noReqs + info.toString(); - log.info(m_info); + m_info = new StringBuffer("#").append(noReqs).append(info.toString()); + log.info(m_info.toString()); } // createRequisition /** @@ -567,13 +567,13 @@ public class ReplenishReport extends SvrProcess } if (replenishs.length == 0) { - m_info = "No Source Warehouse"; - log.warning(m_info); + m_info = new StringBuffer("No Source Warehouse"); + log.warning(m_info.toString()); } else { - m_info = "#" + noMoves + info; - log.info(m_info); + m_info = new StringBuffer("#") .append(noMoves).append(info); + log.info(m_info.toString()); } } // Create Inventory Movements @@ -608,10 +608,11 @@ public class ReplenishReport extends SvrProcess M_WarehouseSource_ID = replenish.getM_WarehouseSource_ID(); M_Warehouse_ID = replenish.getM_Warehouse_ID(); - order = new MDDOrder (getCtx(), 0, get_TrxName()); + order = new MDDOrder (getCtx(), 0, get_TrxName()); order.setC_DocType_ID(p_C_DocType_ID); - order.setDescription(Msg.getMsg(getCtx(), "Replenishment") - + ": " + whSource.getName() + "->" + wh.getName()); + StringBuffer msgsd = new StringBuffer(Msg.getMsg(getCtx(), "Replenishment")) + .append(": ").append(whSource.getName()).append("->").append(wh.getName()); + order.setDescription(msgsd.toString()); // Set Org order.setAD_Org_ID(whSource.getAD_Org_ID()); // Set Org Trx @@ -714,13 +715,13 @@ public class ReplenishReport extends SvrProcess } if (replenishs.length == 0) { - m_info = "No Source Warehouse"; - log.warning(m_info); + m_info = new StringBuffer("No Source Warehouse"); + log.warning(m_info.toString()); } else { - m_info = "#" + noMoves + info; - log.info(m_info); + m_info = new StringBuffer("#").append(noMoves).append(info); + log.info(m_info.toString()); } } // create Distribution Order diff --git a/org.adempiere.base.process/src/org/compiere/process/ReplenishReportProduction.java b/org.adempiere.base.process/src/org/compiere/process/ReplenishReportProduction.java index 7344a68727..525c9e76ec 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ReplenishReportProduction.java +++ b/org.adempiere.base.process/src/org/compiere/process/ReplenishReportProduction.java @@ -70,7 +70,7 @@ public class ReplenishReportProduction extends SvrProcess /** Document Type */ private int p_C_DocType_ID = 0; /** Return Info */ - private String m_info = ""; + private StringBuffer m_info = new StringBuffer(); private int p_M_Product_Category_ID = 0; private String isKanban = null; @@ -108,12 +108,12 @@ public class ReplenishReportProduction extends SvrProcess * @throws Exception if not successful */ protected String doIt() throws Exception - { - StringBuilder msglog = new StringBuilder("M_Warehouse_ID=").append(p_M_Warehouse_ID) - .append(", C_BPartner_ID=").append(p_C_BPartner_ID) - .append(" - ReplenishmentCreate=").append(p_ReplenishmentCreate) - .append(", C_DocType_ID=").append(p_C_DocType_ID); - log.info(msglog.toString()); + { + log.info("M_Warehouse_ID=" + p_M_Warehouse_ID + + ", C_BPartner_ID=" + p_C_BPartner_ID + +" - ReplenishmentCreate=" + p_ReplenishmentCreate + + ", C_DocType_ID=" + p_C_DocType_ID); + if (p_ReplenishmentCreate != null && p_C_DocType_ID == 0 && !p_ReplenishmentCreate.equals("PRD")) throw new AdempiereUserError("@FillMandatory@ @C_DocType_ID@"); @@ -141,7 +141,7 @@ public class ReplenishReportProduction extends SvrProcess createDO(); else if (p_ReplenishmentCreate.equals("PRD")) createProduction(); - return m_info; + return m_info.toString(); } // doIt /** @@ -470,8 +470,8 @@ public class ReplenishReportProduction extends SvrProcess line.setPrice(); line.saveEx(); } - m_info = "#" + noOrders + info.toString(); - log.info(m_info); + m_info = new StringBuffer("#").append(noOrders).append(info.toString()); + log.info(m_info.toString()); } // createPO /** @@ -516,8 +516,8 @@ public class ReplenishReportProduction extends SvrProcess line.setPrice(); line.saveEx(); } - m_info = "#" + noReqs + info.toString(); - log.info(m_info); + m_info = new StringBuffer("#").append(noReqs).append(info.toString()); + log.info(m_info.toString()); } // createRequisition /** @@ -554,8 +554,9 @@ public class ReplenishReportProduction extends SvrProcess move = new MMovement (getCtx(), 0, get_TrxName()); move.setC_DocType_ID(p_C_DocType_ID); - move.setDescription(Msg.getMsg(getCtx(), "Replenishment") - + ": " + whSource.getName() + "->" + wh.getName()); + StringBuilder msgsd = new StringBuilder(Msg.getMsg(getCtx(), "Replenishment")) + .append(": ").append(whSource.getName()).append("->").append(wh.getName()); + move.setDescription(msgsd.toString()); // Set Org move.setAD_Org_ID(whSource.getAD_Org_ID()); if (!move.save()) @@ -602,13 +603,13 @@ public class ReplenishReportProduction extends SvrProcess } if (replenishs.length == 0) { - m_info = "No Source Warehouse"; - log.warning(m_info); + m_info = new StringBuffer("No Source Warehouse"); + log.warning(m_info.toString()); } else { - m_info = "#" + noMoves + info.toString(); - log.info(m_info); + m_info = new StringBuffer("#").append(noMoves).append(info.toString()); + log.info(m_info.toString()); } } // Create Inventory Movements @@ -645,8 +646,9 @@ public class ReplenishReportProduction extends SvrProcess order = new MDDOrder (getCtx(), 0, get_TrxName()); order.setC_DocType_ID(p_C_DocType_ID); - order.setDescription(Msg.getMsg(getCtx(), "Replenishment") - + ": " + whSource.getName() + "->" + wh.getName()); + StringBuilder msgsd = new StringBuilder(Msg.getMsg(getCtx(), "Replenishment")) + .append(": ").append(whSource.getName()).append("->").append(wh.getName()); + order.setDescription(msgsd.toString()); // Set Org order.setAD_Org_ID(whSource.getAD_Org_ID()); // Set Org Trx @@ -749,13 +751,13 @@ public class ReplenishReportProduction extends SvrProcess } if (replenishs.length == 0) { - m_info = "No Source Warehouse"; - log.warning(m_info); + m_info = new StringBuffer("No Source Warehouse"); + log.warning(m_info.toString()); } else { - m_info = "#" + noMoves + info.toString(); - log.info(m_info); + m_info = new StringBuffer("#").append(noMoves).append(info.toString()); + log.info(m_info.toString()); } } // create Distribution Order /** @@ -820,8 +822,8 @@ public class ReplenishReportProduction extends SvrProcess } } - m_info = "#" + noProds + info.toString(); - log.info(m_info); + m_info = new StringBuffer("#").append(noProds).append(info.toString()); + log.info(m_info.toString()); } // createRequisition /** diff --git a/org.adempiere.base.process/src/org/compiere/process/ReplicationLocal.java b/org.adempiere.base.process/src/org/compiere/process/ReplicationLocal.java index f0971721b5..969eb01f00 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ReplicationLocal.java +++ b/org.adempiere.base.process/src/org/compiere/process/ReplicationLocal.java @@ -251,7 +251,7 @@ public class ReplicationLocal extends SvrProcess data.Test = m_test; data.TableName = TableName; // Create SQL - StringBuffer sql = new StringBuffer("SELECT * FROM ") + StringBuilder sql = new StringBuilder("SELECT * FROM ") .append(TableName) .append(" WHERE AD_Client_ID=").append(m_replication.getRemote_Client_ID()); if (m_replication.getRemote_Org_ID() != 0) @@ -289,12 +289,12 @@ public class ReplicationLocal extends SvrProcess // send it pi = m_serverRemote.process (new Properties (), pi); ProcessInfoLog[] logs = pi.getLogs(); - String msg = "< "; + StringBuilder msg = new StringBuilder("< "); if (logs != null && logs.length > 0) - msg += logs[0].getP_Msg(); // Remote Message + msg.append(logs[0].getP_Msg()); // Remote Message log.info("mergeDataTable - " + pi); // - MReplicationLog rLog = new MReplicationLog (getCtx(), m_replicationRun.getAD_Replication_Run_ID(), AD_ReplicationTable_ID, msg, get_TrxName()); + MReplicationLog rLog = new MReplicationLog (getCtx(), m_replicationRun.getAD_Replication_Run_ID(), AD_ReplicationTable_ID, msg.toString(), get_TrxName()); if (pi.isError()) { log.severe ("mergeDataTable Error - " + pi); @@ -429,7 +429,7 @@ public class ReplicationLocal extends SvrProcess data.Test = m_test; data.TableName = TableName; // Create SQL - StringBuffer sql = new StringBuffer ("SELECT * FROM ") + StringBuilder sql = new StringBuilder ("SELECT * FROM ") .append(TableName) .append(" WHERE AD_Client_ID=").append(m_replication.getRemote_Client_ID()); if (m_replication.getRemote_Org_ID() != 0) @@ -488,11 +488,11 @@ public class ReplicationLocal extends SvrProcess pi = m_serverRemote.process (new Properties (), pi); log.info("sendUpdatesTable - " + pi); ProcessInfoLog[] logs = pi.getLogs(); - String msg = "> "; + StringBuilder msg = new StringBuilder("> "); if (logs != null && logs.length > 0) - msg += logs[0].getP_Msg(); // Remote Message + msg.append(logs[0].getP_Msg()); // Remote Message // - MReplicationLog rLog = new MReplicationLog (getCtx(), m_replicationRun.getAD_Replication_Run_ID(), AD_ReplicationTable_ID, msg, get_TrxName()); + MReplicationLog rLog = new MReplicationLog (getCtx(), m_replicationRun.getAD_Replication_Run_ID(), AD_ReplicationTable_ID, msg.toString(), get_TrxName()); if (pi.isError()) m_replicated = false; rLog.setIsReplicated(!pi.isError()); diff --git a/org.adempiere.base.process/src/org/compiere/process/ReplicationRemote.java b/org.adempiere.base.process/src/org/compiere/process/ReplicationRemote.java index dc4db310ec..96f9b1e48b 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ReplicationRemote.java +++ b/org.adempiere.base.process/src/org/compiere/process/ReplicationRemote.java @@ -152,21 +152,21 @@ public class ReplicationRemote extends SvrProcess */ private void setupRemoteAD_Sequence (BigDecimal IDRangeStart) throws Exception { - String sql = "UPDATE AD_Sequence SET StartNo = " + IDRangeStart - + " WHERE IsTableID='Y' AND StartNo < " + IDRangeStart; - int no = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("UPDATE AD_Sequence SET StartNo = ").append(IDRangeStart) + .append(" WHERE IsTableID='Y' AND StartNo < ").append(IDRangeStart); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no == -1) throw new Exception("setupRemoteAD_Sequence_Start"); // - sql = "UPDATE AD_Sequence SET CurrentNext = " + IDRangeStart - + " WHERE IsTableID='Y' AND CurrentNext < " + IDRangeStart; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE AD_Sequence SET CurrentNext = ").append(IDRangeStart) + .append(" WHERE IsTableID='Y' AND CurrentNext < ").append(IDRangeStart); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no == -1) throw new Exception("setupRemoteAD_Sequence_Next"); // - sql = "UPDATE AD_Sequence SET CurrentNextSys = -1" - + " WHERE IsTableID='Y' AND CurrentNextSys <> -1"; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE AD_Sequence SET CurrentNextSys = -1") + .append(" WHERE IsTableID='Y' AND CurrentNextSys <> -1"); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no == -1) throw new Exception("setupRemoteAD_Sequence_Sys"); } // setupRemoteAD_Sequence @@ -185,17 +185,17 @@ public class ReplicationRemote extends SvrProcess if (Suffix == null) Suffix = ""; // DocNoSequence_ID - String sql = "UPDATE AD_Sequence SET Prefix=" + DB.TO_STRING(Prefix) + ", Suffix=" + DB.TO_STRING(Suffix) - + " WHERE AD_Sequence_ID IN (SELECT DocNoSequence_ID FROM C_DocType" - + " WHERE AD_Client_ID=" + AD_Client_ID + " AND DocNoSequence_ID IS NOT NULL)"; - int no = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("UPDATE AD_Sequence SET Prefix=").append(DB.TO_STRING(Prefix)).append(", Suffix=").append(DB.TO_STRING(Suffix)) + .append(" WHERE AD_Sequence_ID IN (SELECT DocNoSequence_ID FROM C_DocType") + .append(" WHERE AD_Client_ID=").append(AD_Client_ID).append(" AND DocNoSequence_ID IS NOT NULL)"); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no == -1) throw new Exception("setupRemoteC_DocType_DocNo"); // BatchNoSequence_ID - sql = "UPDATE AD_Sequence SET Prefix=" + DB.TO_STRING(Prefix) + ", Suffix=" + DB.TO_STRING(Suffix) - + " WHERE AD_Sequence_ID IN (SELECT BatchNoSequence_ID FROM C_DocType" - + " WHERE AD_Client_ID=" + AD_Client_ID + " AND BatchNoSequence_ID IS NOT NULL)"; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE AD_Sequence SET Prefix=").append(DB.TO_STRING(Prefix)).append(", Suffix=").append(DB.TO_STRING(Suffix)) + .append(" WHERE AD_Sequence_ID IN (SELECT BatchNoSequence_ID FROM C_DocType") + .append(" WHERE AD_Client_ID=").append(AD_Client_ID).append(" AND BatchNoSequence_ID IS NOT NULL)"); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no == -1) throw new Exception("setupRemoteC_DocType_Batch"); } // setupRemoteC_DocType @@ -208,9 +208,9 @@ public class ReplicationRemote extends SvrProcess */ private void setupRemoteAD_Table(String TableName, String ReplicationType) throws Exception { - String sql = "UPDATE AD_Table SET ReplicationType = '" + ReplicationType - + "' WHERE TableName='" + TableName + "' AND ReplicationType <> '" + ReplicationType + "'"; - int no = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("UPDATE AD_Table SET ReplicationType = '").append(ReplicationType) + .append("' WHERE TableName='").append(TableName).append("' AND ReplicationType <> '").append(ReplicationType).append("'"); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no == -1) throw new Exception("setupRemoteAD_Table"); } // setupRemoteAD_Table diff --git a/org.adempiere.base.process/src/org/compiere/process/ReportColumnSet_Copy.java b/org.adempiere.base.process/src/org/compiere/process/ReportColumnSet_Copy.java index 706d8fa9e8..c06985eb4b 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ReportColumnSet_Copy.java +++ b/org.adempiere.base.process/src/org/compiere/process/ReportColumnSet_Copy.java @@ -80,7 +80,8 @@ public class ReportColumnSet_Copy extends SvrProcess rc.saveEx(); } // Oper 1/2 were set to Null ! - return "@Copied@=" + rcs.length; + StringBuilder msgreturn = new StringBuilder("@Copied@=").append(rcs.length); + return msgreturn.toString(); } // doIt } // ReportColumnSet_Copy diff --git a/org.adempiere.base.process/src/org/compiere/process/ReportLineSet_Copy.java b/org.adempiere.base.process/src/org/compiere/process/ReportLineSet_Copy.java index 59b3ea804c..cd958bbbc0 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ReportLineSet_Copy.java +++ b/org.adempiere.base.process/src/org/compiere/process/ReportLineSet_Copy.java @@ -90,7 +90,8 @@ public class ReportLineSet_Copy extends SvrProcess } // Oper 1/2 were set to Null ! } - return "@Copied@=" + rls.length; + StringBuilder msgreturn = new StringBuilder("@Copied@=").append(rls.length); + return msgreturn.toString(); } // doIt } // ReportLineSet_Copy diff --git a/org.adempiere.base.process/src/org/compiere/process/RequestEMailProcessor.java b/org.adempiere.base.process/src/org/compiere/process/RequestEMailProcessor.java index eae7feb262..7a8afb9cc9 100644 --- a/org.adempiere.base.process/src/org/compiere/process/RequestEMailProcessor.java +++ b/org.adempiere.base.process/src/org/compiere/process/RequestEMailProcessor.java @@ -160,9 +160,10 @@ public class RequestEMailProcessor extends SvrProcess { } - return "processInBox - Total=" + noProcessed + - " - Requests=" + noRequest + - " - Errors=" + noError; + StringBuilder msgreturn = new StringBuilder("processInBox - Total=").append(noProcessed) + .append(" - Requests=").append(noRequest) + .append(" - Errors=").append(noError); + return msgreturn.toString(); } // doIt /************************************************************************** @@ -409,9 +410,11 @@ public class RequestEMailProcessor extends SvrProcess MRequest req = new MRequest(getCtx(), 0, get_TrxName()); // Subject as summary - req.setSummary("FROM: " + fromAddress + "\n" + msg.getSubject()); + StringBuilder msgreq = new StringBuilder("FROM: ").append(fromAddress).append("\n").append(msg.getSubject()); + req.setSummary(msgreq.toString()); // Body as result - req.setResult("FROM: " + from[0].toString() + "\n" + getMessage(msg)); + msgreq = new StringBuilder("FROM: ") .append(from[0].toString()).append("\n").append(getMessage(msg)); + req.setResult(msgreq.toString()); // Message-ID as documentNo if (hdrs != null) req.setDocumentNo(hdrs[0].substring(0,30)); @@ -534,7 +537,8 @@ public class RequestEMailProcessor extends SvrProcess MRequest requp = new MRequest(getCtx(), request_upd, get_TrxName()); // Body as result Address[] from = msg.getFrom(); - requp.setResult("FROM: " + from[0].toString() + "\n" + getMessage(msg)); + StringBuilder msgreq = new StringBuilder("FROM: ").append(from[0].toString()).append("\n").append(getMessage(msg)); + requp.setResult(msgreq.toString()); return requp.save(); } @@ -605,7 +609,7 @@ public class RequestEMailProcessor extends SvrProcess */ private String getMessage (Part msg) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); try { // Text @@ -790,30 +794,37 @@ public class RequestEMailProcessor extends SvrProcess { printOut("-----------------------------------------------------------------"); Address[] a; + StringBuilder msgout = new StringBuilder(); // FROM if ((a = m.getFrom()) != null) { - for (int j = 0; j < a.length; j++) - printOut("FROM: " + a[j].toString()); + for (int j = 0; j < a.length; j++){ + msgout = new StringBuilder("FROM: ").append(a[j].toString()); + printOut(msgout.toString()); + } } // TO if ((a = m.getRecipients(Message.RecipientType.TO)) != null) { - for (int j = 0; j < a.length; j++) - printOut("TO: " + a[j].toString()); + for (int j = 0; j < a.length; j++){ + msgout = new StringBuilder("TO: ").append(a[j].toString()); + printOut(msgout.toString()); + } } // SUBJECT - printOut("SUBJECT: " + m.getSubject()); + msgout = new StringBuilder("SUBJECT: ").append(m.getSubject()); + printOut(msgout.toString()); // DATE java.util.Date d = m.getSentDate(); - printOut("SendDate: " + (d != null ? d.toString() : "UNKNOWN")); + msgout = new StringBuilder("SendDate: ").append((d != null ? d.toString() : "UNKNOWN")); + printOut(msgout.toString()); // FLAGS Flags flags = m.getFlags(); - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); Flags.Flag[] sf = flags.getSystemFlags(); // get the system flags boolean first = true; @@ -851,13 +862,14 @@ public class RequestEMailProcessor extends SvrProcess sb.append(' '); sb.append(uf[i]); } - printOut("FLAGS: " + sb.toString()); + msgout = new StringBuilder("FLAGS: ").append(sb.toString()); + printOut(msgout.toString()); // X-MAILER String[] hdrs = m.getHeader("X-Mailer"); if (hdrs != null) { - StringBuffer sb1 = new StringBuffer("X-Mailer: "); + StringBuilder sb1 = new StringBuilder("X-Mailer: "); for (int i = 0; i < hdrs.length; i++) sb1.append(hdrs[i]).append(" "); printOut(sb1.toString()); @@ -869,7 +881,7 @@ public class RequestEMailProcessor extends SvrProcess hdrs = m.getHeader("Message-ID"); if (hdrs != null) { - StringBuffer sb1 = new StringBuffer("Message-ID: "); + StringBuilder sb1 = new StringBuilder("Message-ID: "); for (int i = 0; i < hdrs.length; i++) sb1.append(hdrs[i]).append(" "); printOut(sb1.toString()); @@ -883,7 +895,8 @@ public class RequestEMailProcessor extends SvrProcess while (en.hasMoreElements()) { Header hdr = (Header)en.nextElement(); - printOut (" " + hdr.getName() + " = " + hdr.getValue()); + msgout = new StringBuilder(" ").append(hdr.getName()).append(" = ").append(hdr.getValue()); + printOut (msgout.toString()); } @@ -899,7 +912,8 @@ public class RequestEMailProcessor extends SvrProcess { // http://www.iana.org/assignments/media-types/ printOut("================================================================="); - printOut("CONTENT-TYPE: " + p.getContentType()); + StringBuilder msgout = new StringBuilder("CONTENT-TYPE: ").append(p.getContentType()); + printOut(msgout.toString()); /** Enumeration en = p.getAllHeaders(); while (en.hasMoreElements()) diff --git a/org.adempiere.base.process/src/org/compiere/process/RequestInvoice.java b/org.adempiere.base.process/src/org/compiere/process/RequestInvoice.java index cd963a30cb..00a6b213ad 100644 --- a/org.adempiere.base.process/src/org/compiere/process/RequestInvoice.java +++ b/org.adempiere.base.process/src/org/compiere/process/RequestInvoice.java @@ -98,26 +98,26 @@ public class RequestInvoice extends SvrProcess if (!type.isInvoiced()) throw new AdempiereSystemError("@R_RequestType_ID@ <> @IsInvoiced@"); - String sql = "SELECT * FROM R_Request r" - + " INNER JOIN R_Status s ON (r.R_Status_ID=s.R_Status_ID) " - + "WHERE s.IsClosed='Y'" - + " AND r.R_RequestType_ID=?"; + StringBuilder sql = new StringBuilder("SELECT * FROM R_Request r") + .append(" INNER JOIN R_Status s ON (r.R_Status_ID=s.R_Status_ID) ") + .append("WHERE s.IsClosed='Y'") + .append(" AND r.R_RequestType_ID=?"); // globalqss -- avoid double invoicing // + " AND EXISTS (SELECT 1 FROM R_RequestUpdate ru " + // "WHERE ru.R_Request_ID=r.R_Request_ID AND NVL(C_InvoiceLine_ID,0)=0"; if (p_R_Group_ID != 0) - sql += " AND r.R_Group_ID=?"; + sql.append(" AND r.R_Group_ID=?"); if (p_R_Category_ID != 0) - sql += " AND r.R_Category_ID=?"; + sql.append(" AND r.R_Category_ID=?"); if (p_C_BPartner_ID != 0) - sql += " AND r.C_BPartner_ID=?"; - sql += " AND r.IsInvoiced='Y' " - + "ORDER BY C_BPartner_ID"; + sql.append(" AND r.C_BPartner_ID=?"); + sql.append(" AND r.IsInvoiced='Y' ") + .append("ORDER BY C_BPartner_ID"); PreparedStatement pstmt = null; try { - pstmt = DB.prepareStatement (sql, get_TrxName()); + pstmt = DB.prepareStatement (sql.toString(), get_TrxName()); int index = 1; pstmt.setInt (index++, p_R_RequestType_ID); if (p_R_Group_ID != 0) @@ -150,7 +150,7 @@ public class RequestInvoice extends SvrProcess } catch (Exception e) { - log.log (Level.SEVERE, sql, e); + log.log (Level.SEVERE, sql.toString(), e); } try { diff --git a/org.adempiere.base.process/src/org/compiere/process/RequisitionPOCreate.java b/org.adempiere.base.process/src/org/compiere/process/RequisitionPOCreate.java index 2394c42c93..44cd6ed874 100644 --- a/org.adempiere.base.process/src/org/compiere/process/RequisitionPOCreate.java +++ b/org.adempiere.base.process/src/org/compiere/process/RequisitionPOCreate.java @@ -173,7 +173,7 @@ public class RequisitionPOCreate extends SvrProcess + ", ConsolidateDocument" + p_ConsolidateDocument); ArrayList params = new ArrayList(); - StringBuffer whereClause = new StringBuffer("C_OrderLine_ID IS NULL"); + StringBuilder whereClause = new StringBuilder("C_OrderLine_ID IS NULL"); if (p_AD_Org_ID > 0) { whereClause.append(" AND AD_Org_ID=?"); @@ -355,8 +355,9 @@ public class RequisitionPOCreate extends SvrProcess // default po document type if (!p_ConsolidateDocument) { - m_order.setDescription(Msg.getElement(getCtx(), "M_Requisition_ID") - + ": " + rLine.getParent().getDocumentNo()); + StringBuilder msgsd= new StringBuilder(Msg.getElement(getCtx(), "M_Requisition_ID")) + .append(": ").append(rLine.getParent().getDocumentNo()); + m_order.setDescription(msgsd.toString()); } // Prepare Save diff --git a/org.adempiere.base.process/src/org/compiere/process/RfQClose.java b/org.adempiere.base.process/src/org/compiere/process/RfQClose.java index 566f9d2e86..03d3aff36d 100644 --- a/org.adempiere.base.process/src/org/compiere/process/RfQClose.java +++ b/org.adempiere.base.process/src/org/compiere/process/RfQClose.java @@ -78,7 +78,8 @@ public class RfQClose extends SvrProcess counter++; } // - return "# " + counter; + StringBuilder msgreturn = new StringBuilder("# ").append(counter); + return msgreturn.toString(); } // doIt } // RfQClose From cb910d298d4fd251784f00f669fb8d7b98ff1335 Mon Sep 17 00:00:00 2001 From: Elaine Tan Date: Thu, 27 Sep 2012 15:22:39 +0800 Subject: [PATCH 53/79] IDEMPIERE-373 Implement User Locking - fix login error message --- .../oracle/919_IDEMPIERE-373_User_Locking.sql | 22 +++++++++++++++++++ .../919_IDEMPIERE-373_User_Locking.sql | 22 +++++++++++++++++++ .../src/org/compiere/util/Login.java | 4 ++-- 3 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 migration/360lts-release/oracle/919_IDEMPIERE-373_User_Locking.sql create mode 100644 migration/360lts-release/postgresql/919_IDEMPIERE-373_User_Locking.sql diff --git a/migration/360lts-release/oracle/919_IDEMPIERE-373_User_Locking.sql b/migration/360lts-release/oracle/919_IDEMPIERE-373_User_Locking.sql new file mode 100644 index 0000000000..6f1da9c4ce --- /dev/null +++ b/migration/360lts-release/oracle/919_IDEMPIERE-373_User_Locking.sql @@ -0,0 +1,22 @@ +-- Sep 27, 2012 12:32:31 PM SGT +-- IDEMPIERE-373 Implement User Locking +UPDATE AD_Message SET MsgText='Reached the maximum number of login attempts, user account ({0}) is locked',Updated=TO_DATE('2012-09-27 12:32:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200033 +; + +-- Sep 27, 2012 12:32:31 PM SGT +-- IDEMPIERE-373 Implement User Locking +UPDATE AD_Message_Trl SET IsTranslated='N' WHERE AD_Message_ID=200033 +; + +-- Sep 27, 2012 12:32:59 PM SGT +-- IDEMPIERE-373 Implement User Locking +UPDATE AD_Message SET MsgText='User account ({0}) is locked, please contact the system administrator',Updated=TO_DATE('2012-09-27 12:32:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200032 +; + +-- Sep 27, 2012 12:32:59 PM SGT +-- IDEMPIERE-373 Implement User Locking +UPDATE AD_Message_Trl SET IsTranslated='N' WHERE AD_Message_ID=200032 +; + +SELECT register_migration_script('919_IDEMPIERE-373_User_Locking.sql') FROM dual +; diff --git a/migration/360lts-release/postgresql/919_IDEMPIERE-373_User_Locking.sql b/migration/360lts-release/postgresql/919_IDEMPIERE-373_User_Locking.sql new file mode 100644 index 0000000000..abd7b3ec57 --- /dev/null +++ b/migration/360lts-release/postgresql/919_IDEMPIERE-373_User_Locking.sql @@ -0,0 +1,22 @@ +-- Sep 27, 2012 12:32:31 PM SGT +-- IDEMPIERE-373 Implement User Locking +UPDATE AD_Message SET MsgText='Reached the maximum number of login attempts, user account ({0}) is locked',Updated=TO_TIMESTAMP('2012-09-27 12:32:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200033 +; + +-- Sep 27, 2012 12:32:31 PM SGT +-- IDEMPIERE-373 Implement User Locking +UPDATE AD_Message_Trl SET IsTranslated='N' WHERE AD_Message_ID=200033 +; + +-- Sep 27, 2012 12:32:59 PM SGT +-- IDEMPIERE-373 Implement User Locking +UPDATE AD_Message SET MsgText='User account ({0}) is locked, please contact the system administrator',Updated=TO_TIMESTAMP('2012-09-27 12:32:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200032 +; + +-- Sep 27, 2012 12:32:59 PM SGT +-- IDEMPIERE-373 Implement User Locking +UPDATE AD_Message_Trl SET IsTranslated='N' WHERE AD_Message_ID=200032 +; + +SELECT register_migration_script('919_IDEMPIERE-373_User_Locking.sql') FROM dual +; diff --git a/org.adempiere.base/src/org/compiere/util/Login.java b/org.adempiere.base/src/org/compiere/util/Login.java index db1f9d9cbc..4c74695bca 100644 --- a/org.adempiere.base/src/org/compiere/util/Login.java +++ b/org.adempiere.base/src/org/compiere/util/Login.java @@ -1468,7 +1468,7 @@ public class Login { if (user.isLocked()) { - // User account '{0}' is locked, please contact the system administrator + // User account ({0}) is locked, please contact the system administrator loginErrMsg = Msg.getMsg(m_ctx, "UserAccountLocked", new Object[] {app_user}); break; } @@ -1479,7 +1479,7 @@ public class Login int MAX_LOGIN_ATTEMPT = MSysConfig.getIntValue(MSysConfig.USER_LOCKING_MAX_LOGIN_ATTEMPT, 0); if (MAX_LOGIN_ATTEMPT > 0 && count >= MAX_LOGIN_ATTEMPT) { - // Reached the maximum number of login attempts, user account '{0}' is locked + // Reached the maximum number of login attempts, user account ({0}) is locked loginErrMsg = Msg.getMsg(m_ctx, "ReachedMaxLoginAttempts", new Object[] {app_user}); reachMaxAttempt = true; } From 62cb8851cb6a146654aed0b882d29828014b817f Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 27 Sep 2012 11:10:33 -0500 Subject: [PATCH 54/79] =?UTF-8?q?IDEMPIERE-308=20Performance:=20Replace=20?= =?UTF-8?q?with=20StringBuilder=20/=20Thanks=20to=20Richard=20Morales=20an?= =?UTF-8?q?d=20David=20Pe=C3=B1uela?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/compiere/process/RfQCopyLines.java | 3 +- .../src/org/compiere/process/RfQCreate.java | 6 +- .../src/org/compiere/process/RfQCreatePO.java | 4 +- .../org/compiere/process/RfQResponseRank.java | 3 +- .../compiere/process/RoleAccessUpdate.java | 16 +-- .../src/org/compiere/process/RollUpCosts.java | 26 ++--- .../org/compiere/process/SendMailText.java | 34 +++--- .../org/compiere/process/SequenceCheck.java | 28 +++-- .../org/compiere/process/StorageCleanup.java | 12 +- .../process/SynchronizeTerminology.java | 4 +- .../src/org/compiere/process/TabCopy.java | 4 +- .../org/compiere/process/TabCreateFields.java | 3 +- .../compiere/process/TableCreateColumns.java | 7 +- .../process/TaxDeclarationCreate.java | 6 +- .../org/compiere/process/TransactionXRef.java | 103 +++++++++--------- .../compiere/process/TranslationDocSync.java | 4 +- .../org/compiere/process/TreeMaintenance.java | 23 ++-- .../process/UniversalSubstitution.java | 4 +- .../src/org/compiere/process/WindowCopy.java | 4 +- 19 files changed, 156 insertions(+), 138 deletions(-) diff --git a/org.adempiere.base.process/src/org/compiere/process/RfQCopyLines.java b/org.adempiere.base.process/src/org/compiere/process/RfQCopyLines.java index 2f4c7f93f7..4057a4fa3a 100644 --- a/org.adempiere.base.process/src/org/compiere/process/RfQCopyLines.java +++ b/org.adempiere.base.process/src/org/compiere/process/RfQCopyLines.java @@ -103,6 +103,7 @@ public class RfQCopyLines extends SvrProcess } // copy all lines // - return "# " + counter; + StringBuilder msgreturn = new StringBuilder("# ").append(counter); + return msgreturn.toString(); } // doIt } diff --git a/org.adempiere.base.process/src/org/compiere/process/RfQCreate.java b/org.adempiere.base.process/src/org/compiere/process/RfQCreate.java index d04666b5eb..897e1dfb47 100644 --- a/org.adempiere.base.process/src/org/compiere/process/RfQCreate.java +++ b/org.adempiere.base.process/src/org/compiere/process/RfQCreate.java @@ -110,10 +110,10 @@ public class RfQCreate extends SvrProcess } } // for all subscribers - String retValue = "@Created@ " + counter; + StringBuilder retValue = new StringBuilder("@Created@ ").append(counter); if (p_IsSendRfQ) - retValue += " - @IsSendRfQ@=" + sent + " - @Error@=" + notSent; - return retValue; + retValue.append(" - @IsSendRfQ@=").append(sent).append(" - @Error@=").append(notSent); + return retValue.toString(); } // doIt } // RfQCreate diff --git a/org.adempiere.base.process/src/org/compiere/process/RfQCreatePO.java b/org.adempiere.base.process/src/org/compiere/process/RfQCreatePO.java index f18e11a4a0..60bf10829f 100644 --- a/org.adempiere.base.process/src/org/compiere/process/RfQCreatePO.java +++ b/org.adempiere.base.process/src/org/compiere/process/RfQCreatePO.java @@ -202,7 +202,7 @@ public class RfQCreatePO extends SvrProcess response.saveEx(); } } - - return "#" + noOrders; + StringBuilder msgreturn = new StringBuilder("#").append(noOrders); + return msgreturn.toString(); } // doIt } // RfQCreatePO diff --git a/org.adempiere.base.process/src/org/compiere/process/RfQResponseRank.java b/org.adempiere.base.process/src/org/compiere/process/RfQResponseRank.java index fda0e93371..a7e463e032 100644 --- a/org.adempiere.base.process/src/org/compiere/process/RfQResponseRank.java +++ b/org.adempiere.base.process/src/org/compiere/process/RfQResponseRank.java @@ -97,7 +97,8 @@ public class RfQResponseRank extends SvrProcess rankResponses(rfq, responses); else rankLines (rfq, responses); - return "# " + responses.length; + StringBuilder msgreturn = new StringBuilder("# ").append(responses.length); + return msgreturn.toString(); } // doIt diff --git a/org.adempiere.base.process/src/org/compiere/process/RoleAccessUpdate.java b/org.adempiere.base.process/src/org/compiere/process/RoleAccessUpdate.java index 77ebb01ce7..2085253cfd 100644 --- a/org.adempiere.base.process/src/org/compiere/process/RoleAccessUpdate.java +++ b/org.adempiere.base.process/src/org/compiere/process/RoleAccessUpdate.java @@ -86,20 +86,20 @@ public class RoleAccessUpdate extends SvrProcess else { List params = new ArrayList(); - String whereClause = "1=1"; + StringBuilder whereClause = new StringBuilder("1=1"); if (p_AD_Client_ID > 0) { - whereClause += " AND AD_Client_ID=? "; + whereClause.append(" AND AD_Client_ID=? "); params.add(p_AD_Client_ID); } if (p_AD_Role_ID == 0) // System Role { - whereClause += " AND AD_Role_ID=?"; + whereClause.append(" AND AD_Role_ID=?"); params.add(p_AD_Role_ID); } //sql += "ORDER BY AD_Client_ID, Name"; - List roles = new Query(getCtx(), MRole.Table_Name, whereClause, get_TrxName()) + List roles = new Query(getCtx(), MRole.Table_Name, whereClause.toString(), get_TrxName()) .setOnlyActiveRecords(true) .setParameters(params) .setOrderBy("AD_Client_ID, Name") @@ -120,8 +120,9 @@ public class RoleAccessUpdate extends SvrProcess */ private void updateRole (MRole role) { - addLog(0, null, null, role.getName() + ": " - + role.updateAccessRecords(p_IsReset)); + StringBuilder msglog = new StringBuilder(role.getName()).append(": ") + .append(role.updateAccessRecords(p_IsReset)); + addLog(0, null, null, msglog.toString()); } // updateRole //add main method, preparing for nightly build @@ -138,7 +139,8 @@ public class RoleAccessUpdate extends SvrProcess RoleAccessUpdate rau = new RoleAccessUpdate(); rau.startProcess(Env.getCtx(), pi, null); - System.out.println("Process=" + pi.getTitle() + " Error="+pi.isError() + " Summary=" + pi.getSummary()); + StringBuilder msgout= new StringBuilder("Process=").append(pi.getTitle()).append(" Error=").append(pi.isError()).append(" Summary=").append(pi.getSummary()); + System.out.println(msgout.toString()); } } // RoleAccessUpdate diff --git a/org.adempiere.base.process/src/org/compiere/process/RollUpCosts.java b/org.adempiere.base.process/src/org/compiere/process/RollUpCosts.java index b8f2987ad7..54a1256187 100644 --- a/org.adempiere.base.process/src/org/compiere/process/RollUpCosts.java +++ b/org.adempiere.base.process/src/org/compiere/process/RollUpCosts.java @@ -95,9 +95,9 @@ public class RollUpCosts extends SvrProcess { protected void rollUpCosts(int p_id) throws Exception { - String sql = "SELECT M_ProductBOM_ID FROM M_Product_BOM WHERE M_Product_ID = ? " + - " AND AD_Client_ID = " + client_id; - int[] prodbomids = DB.getIDsEx(get_TrxName(), sql, client_id); + StringBuilder sql = new StringBuilder("SELECT M_ProductBOM_ID FROM M_Product_BOM WHERE M_Product_ID = ? ") + .append(" AND AD_Client_ID = ").append(client_id); + int[] prodbomids = DB.getIDsEx(get_TrxName(), sql.toString(), client_id); for (int prodbomid : prodbomids) { if ( !processed.contains(p_id)) { @@ -106,17 +106,17 @@ public class RollUpCosts extends SvrProcess { } //once the subproducts costs are accurate, calculate the costs for this product - String update = "UPDATE M_Cost set CurrentCostPrice = COALESCE((select Sum (b.BOMQty * c.currentcostprice)" + - " FROM M_Product_BOM b INNER JOIN M_Cost c ON (b.M_PRODUCTBOM_ID = c.M_Product_ID) " + - " WHERE b.M_Product_ID = " + p_id + " AND M_CostElement_ID = " + costelement_id + "),0)," + - " FutureCostPrice = COALESCE((select Sum (b.BOMQty * c.futurecostprice) FROM M_Product_BOM b " + - " INNER JOIN M_Cost c ON (b.M_PRODUCTBOM_ID = c.M_Product_ID) " + - " WHERE b.M_Product_ID = " + p_id + " AND M_CostElement_ID = " + costelement_id + "),0)" + - " WHERE M_Product_ID = " + p_id + " AND AD_Client_ID = " + client_id + - " AND M_CostElement_ID = " + costelement_id + - " AND M_PRODUCT_ID IN (SELECT M_PRODUCT_ID FROM M_PRODUCT_BOM)";; + StringBuilder update = new StringBuilder("UPDATE M_Cost set CurrentCostPrice = COALESCE((select Sum (b.BOMQty * c.currentcostprice)") + .append(" FROM M_Product_BOM b INNER JOIN M_Cost c ON (b.M_PRODUCTBOM_ID = c.M_Product_ID) ") + .append(" WHERE b.M_Product_ID = ").append(p_id).append(" AND M_CostElement_ID = ").append(costelement_id).append("),0),") + .append(" FutureCostPrice = COALESCE((select Sum (b.BOMQty * c.futurecostprice) FROM M_Product_BOM b ") + .append(" INNER JOIN M_Cost c ON (b.M_PRODUCTBOM_ID = c.M_Product_ID) ") + .append(" WHERE b.M_Product_ID = ").append(p_id).append(" AND M_CostElement_ID = ").append(costelement_id).append("),0)") + .append(" WHERE M_Product_ID = ").append(p_id).append(" AND AD_Client_ID = ").append(client_id) + .append(" AND M_CostElement_ID = ").append(costelement_id) + .append(" AND M_PRODUCT_ID IN (SELECT M_PRODUCT_ID FROM M_PRODUCT_BOM)"); - DB.executeUpdate(update, get_TrxName()); + DB.executeUpdate(update.toString(), get_TrxName()); processed.add(p_id); diff --git a/org.adempiere.base.process/src/org/compiere/process/SendMailText.java b/org.adempiere.base.process/src/org/compiere/process/SendMailText.java index a1b7648d4a..e3529a65ae 100644 --- a/org.adempiere.base.process/src/org/compiere/process/SendMailText.java +++ b/org.adempiere.base.process/src/org/compiere/process/SendMailText.java @@ -124,8 +124,9 @@ public class SendMailText extends SvrProcess if (m_C_BP_Group_ID > 0) sendBPGroup(); - return "@Created@=" + m_counter + ", @Errors@=" + m_errors + " - " - + (System.currentTimeMillis()-start) + "ms"; + StringBuilder msgreturn = new StringBuilder("@Created@=").append(m_counter).append(", @Errors@=").append(m_errors).append(" - ") + .append((System.currentTimeMillis()-start)).append("ms"); + return msgreturn.toString(); } // doIt /** @@ -135,14 +136,14 @@ public class SendMailText extends SvrProcess { log.info("R_InterestArea_ID=" + m_R_InterestArea_ID); m_ia = MInterestArea.get(getCtx(), m_R_InterestArea_ID); - String unsubscribe = null; + StringBuilder unsubscribe = null; if (m_ia.isSelfService()) { - unsubscribe = "\n\n---------.----------.----------.----------.----------.----------\n" - + Msg.getElement(getCtx(), "R_InterestArea_ID") - + ": " + m_ia.getName() - + "\n" + Msg.getMsg(getCtx(), "UnsubscribeInfo") - + "\n"; + unsubscribe = new StringBuilder("\n\n---------.----------.----------.----------.----------.----------\n") + .append(Msg.getElement(getCtx(), "R_InterestArea_ID")) + .append(": ").append(m_ia.getName()) + .append("\n").append(Msg.getMsg(getCtx(), "UnsubscribeInfo")) + .append("\n"); MStore[] wstores = MStore.getOfClient(m_client); int index = 0; for (int i = 0; i < wstores.length; i++) @@ -154,7 +155,7 @@ public class SendMailText extends SvrProcess } } if (wstores.length > 0) - unsubscribe += wstores[index].getWebContext(true); + unsubscribe.append(wstores[index].getWebContext(true)); } // @@ -258,7 +259,7 @@ public class SendMailText extends SvrProcess * @param unsubscribe unsubscribe message * @return true if mail has been sent */ - private Boolean sendIndividualMail (String Name, int AD_User_ID, String unsubscribe) + private Boolean sendIndividualMail (String Name, int AD_User_ID, StringBuilder unsubscribe) { // Prevent two email Integer ii = new Integer (AD_User_ID); @@ -268,18 +269,18 @@ public class SendMailText extends SvrProcess // MUser to = new MUser (getCtx(), AD_User_ID, null); m_MailText.setUser(AD_User_ID); // parse context - String message = m_MailText.getMailText(true); + StringBuilder message = new StringBuilder(m_MailText.getMailText(true)); // Unsubscribe if (unsubscribe != null) - message += unsubscribe; + message.append(unsubscribe); // - EMail email = m_client.createEMail(m_from, to, m_MailText.getMailHeader(), message); + EMail email = m_client.createEMail(m_from, to, m_MailText.getMailHeader(), message.toString()); if (m_MailText.isHtml()) - email.setMessageHTML(m_MailText.getMailHeader(), message); + email.setMessageHTML(m_MailText.getMailHeader(), message.toString()); else { email.setSubject (m_MailText.getMailHeader()); - email.setMessageText (message); + email.setMessageText (message.toString()); } if (!email.isValid() && !email.isValid(true)) { @@ -296,7 +297,8 @@ public class SendMailText extends SvrProcess log.fine(to.getEMail()); else log.warning("FAILURE - " + to.getEMail()); - addLog(0, null, null, (OK ? "@OK@" : "@ERROR@") + " - " + to.getEMail()); + StringBuilder msglog = new StringBuilder((OK ? "@OK@" : "@ERROR@")).append(" - ").append(to.getEMail()); + addLog(0, null, null, msglog.toString()); return new Boolean(OK); } // sendIndividualMail diff --git a/org.adempiere.base.process/src/org/compiere/process/SequenceCheck.java b/org.adempiere.base.process/src/org/compiere/process/SequenceCheck.java index 841481e8e2..3b07a60af3 100644 --- a/org.adempiere.base.process/src/org/compiere/process/SequenceCheck.java +++ b/org.adempiere.base.process/src/org/compiere/process/SequenceCheck.java @@ -143,8 +143,10 @@ public class SequenceCheck extends SvrProcess int no = DB.executeUpdate(sql, trxName); if (no > 0) { - if (sp != null) - sp.addLog(0, null, null, "SyncName #" + no); + if (sp != null){ + StringBuilder msglog = new StringBuilder("SyncName #").append(no); + sp.addLog(0, null, null,msglog.toString()); + } else s_log.fine("Sync #" + no); } @@ -165,7 +167,8 @@ public class SequenceCheck extends SvrProcess { String TableName = rs.getString(1); String SeqName = rs.getString(2); - sp.addLog(0, null, null, "ERROR: TableName=" + TableName + " - Sequence=" + SeqName); + StringBuilder msglog = new StringBuilder("ERROR: TableName=").append(TableName).append(" - Sequence=").append(SeqName); + sp.addLog(0, null, null, msglog.toString()); } } catch (Exception e) @@ -215,21 +218,21 @@ public class SequenceCheck extends SvrProcess { if (seq.getCurrentNext() != old) { - String msg = seq.getName() + " ID " - + old + " -> " + seq.getCurrentNext(); + StringBuilder msg = new StringBuilder(seq.getName()).append(" ID ") + .append(old).append(" -> ").append(seq.getCurrentNext()); if (sp != null) - sp.addLog(0, null, null, msg); + sp.addLog(0, null, null, msg.toString()); else - s_log.fine(msg); + s_log.fine(msg.toString()); } if (seq.getCurrentNextSys() != oldSys) { - String msg = seq.getName() + " Sys " - + oldSys + " -> " + seq.getCurrentNextSys(); + StringBuilder msg = new StringBuilder(seq.getName()).append(" Sys ") + .append(oldSys).append(" -> ").append(seq.getCurrentNextSys()); if (sp != null) - sp.addLog(0, null, null, msg); + sp.addLog(0, null, null, msg.toString()); else - s_log.fine(msg); + s_log.fine(msg.toString()); } if (seq.save()) counter++; @@ -305,6 +308,7 @@ public class SequenceCheck extends SvrProcess SequenceCheck sc = new SequenceCheck(); sc.startProcess(Env.getCtx(), pi, null); - System.out.println("Process=" + pi.getTitle() + " Error="+pi.isError() + " Summary=" + pi.getSummary()); + StringBuilder msgout = new StringBuilder("Process=").append(pi.getTitle()).append(" Error=").append(pi.isError()).append(" Summary=").append(pi.getSummary()); + System.out.println(msgout.toString()); } } // SequenceCheck diff --git a/org.adempiere.base.process/src/org/compiere/process/StorageCleanup.java b/org.adempiere.base.process/src/org/compiere/process/StorageCleanup.java index 5fcc1bc8ef..bfe2371617 100644 --- a/org.adempiere.base.process/src/org/compiere/process/StorageCleanup.java +++ b/org.adempiere.base.process/src/org/compiere/process/StorageCleanup.java @@ -117,8 +117,8 @@ public class StorageCleanup extends SvrProcess DB.close(rs, pstmt); rs = null; pstmt = null; } - - return "#" + lines; + StringBuilder msgreturn = new StringBuilder("#").append(lines); + return msgreturn.toString(); } // doIt /** @@ -176,10 +176,10 @@ public class StorageCleanup extends SvrProcess } mh.saveEx(); - - addLog(0, null, new BigDecimal(lines), "@M_Movement_ID@ " + mh.getDocumentNo() + " (" - + MRefList.get(getCtx(), MMovement.DOCSTATUS_AD_Reference_ID, - mh.getDocStatus(), get_TrxName()) + ")"); + StringBuilder msglog= new StringBuilder("@M_Movement_ID@ ").append(mh.getDocumentNo()).append(" (") + .append(MRefList.get(getCtx(), MMovement.DOCSTATUS_AD_Reference_ID, + mh.getDocStatus(), get_TrxName())).append(")"); + addLog(0, null, new BigDecimal(lines), msglog.toString()); eliminateReservation(target); return lines; diff --git a/org.adempiere.base.process/src/org/compiere/process/SynchronizeTerminology.java b/org.adempiere.base.process/src/org/compiere/process/SynchronizeTerminology.java index 420c61c755..663c714f6b 100644 --- a/org.adempiere.base.process/src/org/compiere/process/SynchronizeTerminology.java +++ b/org.adempiere.base.process/src/org/compiere/process/SynchronizeTerminology.java @@ -861,7 +861,7 @@ public class SynchronizeTerminology extends SvrProcess SynchronizeTerminology sc = new SynchronizeTerminology(); sc.startProcess(Env.getCtx(), pi, null); - - System.out.println("Process=" + pi.getTitle() + " Error="+pi.isError() + " Summary=" + pi.getSummary()); + StringBuilder msgout = new StringBuilder("Process=").append(pi.getTitle()).append(" Error=").append(pi.isError()).append(" Summary=").append(pi.getSummary()); + System.out.println(msgout.toString()); } } diff --git a/org.adempiere.base.process/src/org/compiere/process/TabCopy.java b/org.adempiere.base.process/src/org/compiere/process/TabCopy.java index 08929a8373..f56cab2f86 100644 --- a/org.adempiere.base.process/src/org/compiere/process/TabCopy.java +++ b/org.adempiere.base.process/src/org/compiere/process/TabCopy.java @@ -83,8 +83,8 @@ public class TabCopy extends SvrProcess else throw new AdempiereUserError("@Error@ @AD_Field_ID@"); } - - return "@Copied@ #" + count; + StringBuilder msgreturn = new StringBuilder("@Copied@ #").append(count); + return msgreturn.toString(); } // doIt } // TabCopy diff --git a/org.adempiere.base.process/src/org/compiere/process/TabCreateFields.java b/org.adempiere.base.process/src/org/compiere/process/TabCreateFields.java index 25f2d7cc2f..a188ed56e4 100644 --- a/org.adempiere.base.process/src/org/compiere/process/TabCreateFields.java +++ b/org.adempiere.base.process/src/org/compiere/process/TabCreateFields.java @@ -124,7 +124,8 @@ public class TabCreateFields extends SvrProcess DB.close(rs, pstmt); rs = null; pstmt = null; } - return "@Created@ #" + count; + StringBuilder msgreturn = new StringBuilder("@Created@ #").append(count); + return msgreturn.toString(); } // doIt } // TabCreateFields diff --git a/org.adempiere.base.process/src/org/compiere/process/TableCreateColumns.java b/org.adempiere.base.process/src/org/compiere/process/TableCreateColumns.java index e2897c5712..a1a161ac56 100644 --- a/org.adempiere.base.process/src/org/compiere/process/TableCreateColumns.java +++ b/org.adempiere.base.process/src/org/compiere/process/TableCreateColumns.java @@ -116,8 +116,8 @@ public class TableCreateColumns extends SvrProcess ResultSet rs = md.getColumns(catalog, schema, tableName, null); addTableColumn(rs, table); } - - return "#" + m_count; + StringBuilder msgreturn = new StringBuilder("#").append(m_count); + return msgreturn.toString(); } finally { if (conn != null) { try { @@ -369,7 +369,8 @@ public class TableCreateColumns extends SvrProcess // Done if (column.save ()) { - addLog (0, null, null, table.getTableName() + "." + column.getColumnName()); + StringBuilder msglog = new StringBuilder(table.getTableName()).append(".").append(column.getColumnName()); + addLog (0, null, null, msglog.toString()); m_count++; } } // while columns diff --git a/org.adempiere.base.process/src/org/compiere/process/TaxDeclarationCreate.java b/org.adempiere.base.process/src/org/compiere/process/TaxDeclarationCreate.java index bb7d6b1fdb..0ade87fced 100644 --- a/org.adempiere.base.process/src/org/compiere/process/TaxDeclarationCreate.java +++ b/org.adempiere.base.process/src/org/compiere/process/TaxDeclarationCreate.java @@ -125,9 +125,9 @@ public class TaxDeclarationCreate extends SvrProcess rs = null; pstmt = null; } - - return "@C_Invoice_ID@ #" + noInvoices - + " (" + m_noLines + ", " + m_noAccts + ")"; + StringBuilder msgreturn = new StringBuilder("@C_Invoice_ID@ #").append(noInvoices) + .append(" (").append(m_noLines).append(", ").append(m_noAccts).append(")"); + return msgreturn.toString(); } // doIt /** diff --git a/org.adempiere.base.process/src/org/compiere/process/TransactionXRef.java b/org.adempiere.base.process/src/org/compiere/process/TransactionXRef.java index 96f60ffa98..77b5b5237a 100644 --- a/org.adempiere.base.process/src/org/compiere/process/TransactionXRef.java +++ b/org.adempiere.base.process/src/org/compiere/process/TransactionXRef.java @@ -66,29 +66,32 @@ public class TransactionXRef extends SvrProcess log.info("M_InOut_ID=" + p_Search_InOut_ID + ", C_Order_ID=" + p_Search_Order_ID + ", C_Invoice_ID=" + p_Search_Invoice_ID); // - if (p_Search_InOut_ID != 0) - insertTrx( - "SELECT NVL(ma.M_AttributeSetInstance_ID,iol.M_AttributeSetInstance_ID) " - + "FROM M_InOutLine iol" - + " LEFT OUTER JOIN M_InOutLineMA ma ON (iol.M_InOutLine_ID=ma.M_InOutLine_ID) " - + "WHERE M_InOut_ID=" + p_Search_InOut_ID - ); - else if (p_Search_Order_ID != 0) - insertTrx( - "SELECT NVL(ma.M_AttributeSetInstance_ID,iol.M_AttributeSetInstance_ID) " - + "FROM M_InOutLine iol" - + " LEFT OUTER JOIN M_InOutLineMA ma ON (iol.M_InOutLine_ID=ma.M_InOutLine_ID) " - + " INNER JOIN M_InOut io ON (iol.M_InOut_ID=io.M_InOut_ID)" - + "WHERE io.C_Order_ID=" + p_Search_Order_ID - ); - else if (p_Search_Invoice_ID != 0) - insertTrx( - "SELECT NVL(ma.M_AttributeSetInstance_ID,iol.M_AttributeSetInstance_ID) " - + "FROM M_InOutLine iol" - + " LEFT OUTER JOIN M_InOutLineMA ma ON (iol.M_InOutLine_ID=ma.M_InOutLine_ID) " - + " INNER JOIN C_InvoiceLine il ON (iol.M_InOutLine_ID=il.M_InOutLine_ID) " - + "WHERE il.C_Invoice_ID=" + p_Search_Invoice_ID - ); + if (p_Search_InOut_ID != 0){ + StringBuilder msgtrx = new StringBuilder( + "SELECT NVL(ma.M_AttributeSetInstance_ID,iol.M_AttributeSetInstance_ID) ") + .append("FROM M_InOutLine iol") + .append(" LEFT OUTER JOIN M_InOutLineMA ma ON (iol.M_InOutLine_ID=ma.M_InOutLine_ID) ") + .append("WHERE M_InOut_ID=").append(p_Search_InOut_ID); + insertTrx(msgtrx.toString()); + } + else if (p_Search_Order_ID != 0){ + StringBuilder msgtrx = new StringBuilder( + "SELECT NVL(ma.M_AttributeSetInstance_ID,iol.M_AttributeSetInstance_ID) ") + .append("FROM M_InOutLine iol") + .append(" LEFT OUTER JOIN M_InOutLineMA ma ON (iol.M_InOutLine_ID=ma.M_InOutLine_ID) ") + .append(" INNER JOIN M_InOut io ON (iol.M_InOut_ID=io.M_InOut_ID)") + .append("WHERE io.C_Order_ID=").append(p_Search_Order_ID); + insertTrx(msgtrx.toString()); + } + else if (p_Search_Invoice_ID != 0){ + StringBuilder msgtrx = new StringBuilder( + "SELECT NVL(ma.M_AttributeSetInstance_ID,iol.M_AttributeSetInstance_ID) ") + .append("FROM M_InOutLine iol") + .append(" LEFT OUTER JOIN M_InOutLineMA ma ON (iol.M_InOutLine_ID=ma.M_InOutLine_ID) ") + .append(" INNER JOIN C_InvoiceLine il ON (iol.M_InOutLine_ID=il.M_InOutLine_ID) ") + .append("WHERE il.C_Invoice_ID=").append(p_Search_Invoice_ID); + insertTrx(msgtrx.toString()); + } else throw new AdempiereUserError("Select one Parameter"); // @@ -101,37 +104,37 @@ public class TransactionXRef extends SvrProcess */ private void insertTrx (String sqlSubSelect) { - String sql = "INSERT INTO T_Transaction " - + "(AD_PInstance_ID, M_Transaction_ID," - + " AD_Client_ID, AD_Org_ID, IsActive, Created,CreatedBy, Updated,UpdatedBy," - + " MovementType, M_Locator_ID, M_Product_ID, M_AttributeSetInstance_ID," - + " MovementDate, MovementQty," - + " M_InOutLine_ID, M_InOut_ID," - + " M_MovementLine_ID, M_Movement_ID," - + " M_InventoryLine_ID, M_Inventory_ID, " - + " C_ProjectIssue_ID, C_Project_ID, " - + " M_ProductionLine_ID, M_Production_ID, " - + " Search_Order_ID, Search_Invoice_ID, Search_InOut_ID) " + StringBuilder sql = new StringBuilder("INSERT INTO T_Transaction ") + .append("(AD_PInstance_ID, M_Transaction_ID,") + .append(" AD_Client_ID, AD_Org_ID, IsActive, Created,CreatedBy, Updated,UpdatedBy,") + .append(" MovementType, M_Locator_ID, M_Product_ID, M_AttributeSetInstance_ID,") + .append(" MovementDate, MovementQty,") + .append(" M_InOutLine_ID, M_InOut_ID,") + .append(" M_MovementLine_ID, M_Movement_ID,") + .append(" M_InventoryLine_ID, M_Inventory_ID, ") + .append(" C_ProjectIssue_ID, C_Project_ID, ") + .append(" M_ProductionLine_ID, M_Production_ID, ") + .append(" Search_Order_ID, Search_Invoice_ID, Search_InOut_ID) ") // Data - + "SELECT " + getAD_PInstance_ID() + ", M_Transaction_ID," - + " AD_Client_ID, AD_Org_ID, IsActive, Created,CreatedBy, Updated,UpdatedBy," - + " MovementType, M_Locator_ID, M_Product_ID, M_AttributeSetInstance_ID," - + " MovementDate, MovementQty," - + " M_InOutLine_ID, M_InOut_ID, " - + " M_MovementLine_ID, M_Movement_ID," - + " M_InventoryLine_ID, M_Inventory_ID, " - + " C_ProjectIssue_ID, C_Project_ID, " - + " M_ProductionLine_ID, M_Production_ID, " + .append("SELECT ").append(getAD_PInstance_ID()).append(", M_Transaction_ID,") + .append(" AD_Client_ID, AD_Org_ID, IsActive, Created,CreatedBy, Updated,UpdatedBy,") + .append(" MovementType, M_Locator_ID, M_Product_ID, M_AttributeSetInstance_ID,") + .append(" MovementDate, MovementQty,") + .append(" M_InOutLine_ID, M_InOut_ID, ") + .append(" M_MovementLine_ID, M_Movement_ID,") + .append(" M_InventoryLine_ID, M_Inventory_ID, ") + .append(" C_ProjectIssue_ID, C_Project_ID, ") + .append(" M_ProductionLine_ID, M_Production_ID, ") // Parameter - + p_Search_Order_ID + ", " + p_Search_Invoice_ID + "," + p_Search_InOut_ID + " " + .append(p_Search_Order_ID).append(", ").append(p_Search_Invoice_ID).append(",").append(p_Search_InOut_ID).append(" ") // - + "FROM M_Transaction_v " - + "WHERE M_AttributeSetInstance_ID > 0 AND M_AttributeSetInstance_ID IN (" - + sqlSubSelect - + ") ORDER BY M_Transaction_ID"; + .append("FROM M_Transaction_v ") + .append("WHERE M_AttributeSetInstance_ID > 0 AND M_AttributeSetInstance_ID IN (") + .append(sqlSubSelect) + .append(") ORDER BY M_Transaction_ID"); // - int no = DB.executeUpdate(sql, get_TrxName()); - log.fine(sql); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); + log.fine(sql.toString()); log.config("#" + no); // Multi-Level diff --git a/org.adempiere.base.process/src/org/compiere/process/TranslationDocSync.java b/org.adempiere.base.process/src/org/compiere/process/TranslationDocSync.java index 9b3fbc4007..9068f3f944 100644 --- a/org.adempiere.base.process/src/org/compiere/process/TranslationDocSync.java +++ b/org.adempiere.base.process/src/org/compiere/process/TranslationDocSync.java @@ -99,7 +99,7 @@ public class TranslationDocSync extends SvrProcess */ private void processTable (MTable table, int AD_Client_ID) { - StringBuffer sql = new StringBuffer(); + StringBuilder sql = new StringBuilder(); MColumn[] columns = table.getColumns(false); for (int i = 0; i < columns.length; i++) { @@ -119,7 +119,7 @@ public class TranslationDocSync extends SvrProcess log.config(baseTable + ": " + sql); String columnNames = sql.toString(); - sql = new StringBuffer(); + sql = new StringBuilder(); sql.append("UPDATE ").append(table.getTableName()).append(" t SET (") .append(columnNames).append(") = (SELECT ").append(columnNames) .append(" FROM ").append(baseTable).append(" b WHERE t.") diff --git a/org.adempiere.base.process/src/org/compiere/process/TreeMaintenance.java b/org.adempiere.base.process/src/org/compiere/process/TreeMaintenance.java index 8f268c7fdf..30559f6661 100644 --- a/org.adempiere.base.process/src/org/compiere/process/TreeMaintenance.java +++ b/org.adempiere.base.process/src/org/compiere/process/TreeMaintenance.java @@ -90,15 +90,15 @@ public class TreeMaintenance extends SvrProcess int C_Element_ID = 0; if (MTree.TREETYPE_ElementValue.equals(tree.getTreeType())) { - String sql = "SELECT C_Element_ID FROM C_Element " - + "WHERE AD_Tree_ID=" + tree.getAD_Tree_ID(); - C_Element_ID = DB.getSQLValue(null, sql); + StringBuilder sql = new StringBuilder("SELECT C_Element_ID FROM C_Element ") + .append("WHERE AD_Tree_ID=").append(tree.getAD_Tree_ID()); + C_Element_ID = DB.getSQLValue(null, sql.toString()); if (C_Element_ID <= 0) throw new IllegalStateException("No Account Element found"); } // Delete unused - StringBuffer sql = new StringBuffer(); + StringBuilder sql = new StringBuilder(); sql.append("DELETE ").append(nodeTableName) .append(" WHERE AD_Tree_ID=").append(tree.getAD_Tree_ID()) .append(" AND Node_ID NOT IN (SELECT ").append(sourceTableKey) @@ -111,12 +111,13 @@ public class TreeMaintenance extends SvrProcess // int deletes = DB.executeUpdate(sql.toString(), get_TrxName()); addLog(0,null, new BigDecimal(deletes), tree.getName()+ " Deleted"); - if (!tree.isAllNodes()) - return tree.getName() + " OK"; - + if (!tree.isAllNodes()){ + StringBuilder msgreturn = new StringBuilder(tree.getName()).append(" OK"); + return msgreturn.toString(); + } // Insert new int inserts = 0; - sql = new StringBuffer(); + sql = new StringBuilder(); sql.append("SELECT ").append(sourceTableKey) .append(" FROM ").append(sourceTableName) .append(" WHERE AD_Client_ID=").append(AD_Client_ID); @@ -175,8 +176,10 @@ public class TreeMaintenance extends SvrProcess { pstmt = null; } - addLog(0,null, new BigDecimal(inserts), tree.getName()+ " Inserted"); - return tree.getName() + (ok ? " OK" : " Error"); + StringBuilder msglog = new StringBuilder(tree.getName()).append(" Inserted"); + addLog(0,null, new BigDecimal(inserts), msglog.toString()); + StringBuilder msgreturn = new StringBuilder(tree.getName()).append((ok ? " OK" : " Error")); + return msgreturn.toString(); } // verifyTree } // TreeMaintenence diff --git a/org.adempiere.base.process/src/org/compiere/process/UniversalSubstitution.java b/org.adempiere.base.process/src/org/compiere/process/UniversalSubstitution.java index d95aae5d18..156381f256 100644 --- a/org.adempiere.base.process/src/org/compiere/process/UniversalSubstitution.java +++ b/org.adempiere.base.process/src/org/compiere/process/UniversalSubstitution.java @@ -45,8 +45,8 @@ public class UniversalSubstitution extends SvrProcess { bom.saveEx(); count++; } - - return count + " BOM products updated"; + StringBuilder msgreturn = new StringBuilder(count).append(" BOM products updated"); + return msgreturn.toString(); } } diff --git a/org.adempiere.base.process/src/org/compiere/process/WindowCopy.java b/org.adempiere.base.process/src/org/compiere/process/WindowCopy.java index 8f0a4fb4b0..20af8b71b1 100644 --- a/org.adempiere.base.process/src/org/compiere/process/WindowCopy.java +++ b/org.adempiere.base.process/src/org/compiere/process/WindowCopy.java @@ -96,8 +96,8 @@ public class WindowCopy extends SvrProcess else throw new AdempiereUserError("@Error@ @AD_Tab_ID@"); } - - return "@Copied@ #" + tabCount + "/" + fieldCount; + StringBuilder msgreturn = new StringBuilder("@Copied@ #").append(tabCount).append("/").append(fieldCount); + return msgreturn.toString(); } // doIt } // WindowCopy From 19342a042ee0a9931242ff99d076f03a88e30615 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 27 Sep 2012 12:20:39 -0500 Subject: [PATCH 55/79] IDEMPIERE-366 Improve Role Inheritance / Thanks to Juliana Corredor --- .../oracle/920_IDEMPIERE_366.sql | 178 +++++++++++++++++ .../postgresql/920_IDEMPIERE_366.sql | 179 ++++++++++++++++++ .../src/org/compiere/model/MRole.java | 2 +- 3 files changed, 358 insertions(+), 1 deletion(-) create mode 100644 migration/360lts-release/oracle/920_IDEMPIERE_366.sql create mode 100644 migration/360lts-release/postgresql/920_IDEMPIERE_366.sql diff --git a/migration/360lts-release/oracle/920_IDEMPIERE_366.sql b/migration/360lts-release/oracle/920_IDEMPIERE_366.sql new file mode 100644 index 0000000000..dc48eeb8fd --- /dev/null +++ b/migration/360lts-release/oracle/920_IDEMPIERE_366.sql @@ -0,0 +1,178 @@ +-- Sep 25, 2012 1:46:23 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:46:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=930 +; + +-- Sep 25, 2012 1:46:30 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:46:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=931 +; + +-- Sep 25, 2012 1:46:35 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:46:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=59592 +; + +-- Sep 25, 2012 1:46:40 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:46:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=59591 +; + +-- Sep 25, 2012 1:46:46 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:46:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10126 +; + +-- Sep 25, 2012 1:46:52 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:46:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=52018 +; + +-- Sep 25, 2012 1:46:57 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:46:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8740 +; + +-- Sep 25, 2012 1:47:04 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:47:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5227 +; + +-- Sep 25, 2012 1:47:10 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:47:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11006 +; + +-- Sep 25, 2012 1:47:16 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:47:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11003 +; + +-- Sep 25, 2012 1:47:23 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:47:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11002 +; + +-- Sep 25, 2012 1:47:30 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:47:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8311 +; + +-- Sep 25, 2012 1:49:28 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:49:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10813 +; + +-- Sep 25, 2012 1:49:40 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsAccessAllOrgs@=N and @IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:49:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11256 +; + +-- Sep 25, 2012 1:49:50 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsAccessAllOrgs@=N and @IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:49:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11257 +; + +-- Sep 25, 2012 1:49:56 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:49:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8313 +; + +-- Sep 25, 2012 1:50:01 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:50:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8314 +; + +-- Sep 25, 2012 1:50:06 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:50:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8312 +; + +-- Sep 25, 2012 1:50:22 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:50:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8310 +; + +-- Sep 25, 2012 1:50:26 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:50:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=12367 +; + +-- Sep 25, 2012 1:50:31 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:50:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=12368 +; + +-- Sep 25, 2012 1:50:40 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:50:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200071 +; + +-- Sep 25, 2012 1:50:45 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:50:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50168 +; + +-- Sep 25, 2012 1:51:14 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:51:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50169 +; + +-- Sep 25, 2012 1:51:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:51:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50170 +; + +-- Sep 25, 2012 1:51:35 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:51:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50172 +; + +-- Sep 25, 2012 1:51:40 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:51:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50173 +; + +-- Sep 25, 2012 1:51:45 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:51:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50174 +; + +-- Sep 25, 2012 1:51:50 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:51:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50175 +; + +-- Sep 25, 2012 1:51:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:51:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50176 +; + +-- Sep 25, 2012 1:52:00 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:52:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50177 +; + +-- Sep 25, 2012 1:52:04 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:52:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50178 +; + +-- Sep 25, 2012 1:58:27 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET ReadOnlyLogic=NULL,DefaultValue=NULL,Updated=TO_DATE('2012-09-25 13:58:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=534 +; + +-- Sep 25, 2012 2:19:54 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsAccessAllOrgs@=N & @IsMasterRole@=N',Updated=TO_DATE('2012-09-25 14:19:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11256 +; + +-- Sep 25, 2012 2:20:02 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsAccessAllOrgs@=N & @IsMasterRole@=N',Updated=TO_DATE('2012-09-25 14:20:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11257 +; + +SELECT register_migration_script('920_IDEMPIERE_366.sql') FROM dual +; + diff --git a/migration/360lts-release/postgresql/920_IDEMPIERE_366.sql b/migration/360lts-release/postgresql/920_IDEMPIERE_366.sql new file mode 100644 index 0000000000..7ce086eb7a --- /dev/null +++ b/migration/360lts-release/postgresql/920_IDEMPIERE_366.sql @@ -0,0 +1,179 @@ +-- Sep 25, 2012 1:46:23 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:46:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=930 +; + +-- Sep 25, 2012 1:46:30 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:46:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=931 +; + +-- Sep 25, 2012 1:46:35 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:46:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=59592 +; + +-- Sep 25, 2012 1:46:40 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:46:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=59591 +; + +-- Sep 25, 2012 1:46:46 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:46:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10126 +; + +-- Sep 25, 2012 1:46:52 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:46:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=52018 +; + +-- Sep 25, 2012 1:46:57 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:46:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8740 +; + +-- Sep 25, 2012 1:47:04 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:47:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5227 +; + +-- Sep 25, 2012 1:47:10 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:47:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11006 +; + +-- Sep 25, 2012 1:47:16 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:47:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11003 +; + +-- Sep 25, 2012 1:47:23 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:47:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11002 +; + +-- Sep 25, 2012 1:47:30 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:47:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8311 +; + +-- Sep 25, 2012 1:49:28 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:49:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10813 +; + +-- Sep 25, 2012 1:49:40 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsAccessAllOrgs@=N and @IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:49:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11256 +; + +-- Sep 25, 2012 1:49:50 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsAccessAllOrgs@=N and @IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:49:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11257 +; + +-- Sep 25, 2012 1:49:56 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:49:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8313 +; + +-- Sep 25, 2012 1:50:01 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:50:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8314 +; + +-- Sep 25, 2012 1:50:06 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:50:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8312 +; + +-- Sep 25, 2012 1:50:22 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:50:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8310 +; + +-- Sep 25, 2012 1:50:26 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:50:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=12367 +; + +-- Sep 25, 2012 1:50:31 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:50:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=12368 +; + +-- Sep 25, 2012 1:50:40 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:50:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200071 +; + +-- Sep 25, 2012 1:50:45 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:50:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50168 +; + +-- Sep 25, 2012 1:51:14 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:51:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50169 +; + +-- Sep 25, 2012 1:51:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:51:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50170 +; + +-- Sep 25, 2012 1:51:35 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:51:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50172 +; + +-- Sep 25, 2012 1:51:40 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:51:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50173 +; + +-- Sep 25, 2012 1:51:45 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:51:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50174 +; + +-- Sep 25, 2012 1:51:50 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:51:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50175 +; + +-- Sep 25, 2012 1:51:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:51:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50176 +; + +-- Sep 25, 2012 1:52:00 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:52:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50177 +; + +-- Sep 25, 2012 1:52:04 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:52:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50178 +; + +-- Sep 25, 2012 1:58:27 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET ReadOnlyLogic=NULL,DefaultValue=NULL,Updated=TO_TIMESTAMP('2012-09-25 13:58:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=534 +; + +-- Sep 25, 2012 2:19:54 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsAccessAllOrgs@=N & @IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 14:19:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11256 +; + +-- Sep 25, 2012 2:20:02 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@IsAccessAllOrgs@=N & @IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 14:20:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11257 +; + + +SELECT register_migration_script('920_IDEMPIERE_366.sql') FROM dual +; + diff --git a/org.adempiere.base/src/org/compiere/model/MRole.java b/org.adempiere.base/src/org/compiere/model/MRole.java index 8717c5ca17..dc93502819 100644 --- a/org.adempiere.base/src/org/compiere/model/MRole.java +++ b/org.adempiere.base/src/org/compiere/model/MRole.java @@ -349,7 +349,7 @@ public final class MRole extends X_AD_Role setUserLevel(USERLEVEL_System); else if (getUserLevel().equals(USERLEVEL_System)) { - log.saveWarning("AccessTableNoUpdate", Msg.getElement(getCtx(), "UserLevel")); + log.saveError("AccessTableNoUpdate", Msg.getElement(getCtx(), "UserLevel")); return false; } // } From 671b042b271d54f86e2db871623517f5e9f71ba5 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 28 Sep 2012 13:40:45 -0500 Subject: [PATCH 56/79] =?UTF-8?q?IDEMPIERE-362=20Hide=20things=20that=20do?= =?UTF-8?q?n't=20work=20on=20iDempiere=20/=20Thanks=20to=20David=20Pe?= =?UTF-8?q?=C3=B1uela?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../oracle/915_IDEMPIERE-362.sql | 259 +++++++ .../oracle/916_IDEMPIERE-362.sql | 388 ++++++++++ .../postgresql/915_IDEMPIERE-362.sql | 261 +++++++ .../postgresql/916_IDEMPIERE-362.sql | 388 ++++++++++ .../process/AcctSchemaDefaultCopy.java | 77 +- .../process/ProductCategoryAcctCopy.java | 12 +- .../src/org/compiere/acct/DocTax.java | 14 +- .../model/I_C_AcctSchema_Default.java | 407 +--------- .../org/compiere/model/I_C_AcctSchema_GL.java | 52 +- .../compiere/model/I_C_BP_Employee_Acct.java | 47 +- .../org/compiere/model/I_C_BP_Group_Acct.java | 47 +- .../compiere/model/I_C_BankAccount_Acct.java | 107 +-- .../org/compiere/model/I_C_Currency_Acct.java | 77 +- .../src/org/compiere/model/I_C_Tax_Acct.java | 47 +- .../org/compiere/model/I_M_Product_Acct.java | 182 +---- .../model/I_M_Product_Category_Acct.java | 182 +---- .../compiere/model/I_M_Warehouse_Acct.java | 62 +- .../compiere/model/MAcctSchemaDefault.java | 33 +- .../model/X_C_AcctSchema_Default.java | 704 +----------------- .../org/compiere/model/X_C_AcctSchema_GL.java | 91 +-- .../compiere/model/X_C_BP_Employee_Acct.java | 64 +- .../org/compiere/model/X_C_BP_Group_Acct.java | 76 +- .../compiere/model/X_C_BankAccount_Acct.java | 180 +---- .../org/compiere/model/X_C_Currency_Acct.java | 128 +--- .../src/org/compiere/model/X_C_Tax_Acct.java | 76 +- .../org/compiere/model/X_M_Product_Acct.java | 310 +------- .../model/X_M_Product_Category_Acct.java | 310 +------- .../compiere/model/X_M_Warehouse_Acct.java | 102 +-- .../test/functional/MCurrencyAcctTest.java | 7 +- .../data/import/AccountingUS.csv | 62 +- .../data/import/AccountingUS.xls | Bin 79360 -> 78336 bytes 31 files changed, 1664 insertions(+), 3088 deletions(-) create mode 100644 migration/360lts-release/oracle/915_IDEMPIERE-362.sql create mode 100644 migration/360lts-release/oracle/916_IDEMPIERE-362.sql create mode 100644 migration/360lts-release/postgresql/915_IDEMPIERE-362.sql create mode 100644 migration/360lts-release/postgresql/916_IDEMPIERE-362.sql diff --git a/migration/360lts-release/oracle/915_IDEMPIERE-362.sql b/migration/360lts-release/oracle/915_IDEMPIERE-362.sql new file mode 100644 index 0000000000..d5cdece2b4 --- /dev/null +++ b/migration/360lts-release/oracle/915_IDEMPIERE-362.sql @@ -0,0 +1,259 @@ +-- IDEMPIERE-362 Hide things that don't work on iDempiere +-- Sep 19, 2012 4:36:27 PM COT +UPDATE AD_Column SET IsActive='N' WHERE AD_Column_ID IN ( +4862, -- C_AcctSchema_Default.B_Expense_Acct +4868, -- C_AcctSchema_Default.B_RevaluationGain_Acct +4869, -- C_AcctSchema_Default.B_RevaluationLoss_Acct +4866, -- C_AcctSchema_Default.B_SettlementGain_Acct +4867, -- C_AcctSchema_Default.B_SettlementLoss_Acct +4865, -- C_AcctSchema_Default.B_Unidentified_Acct +3449, -- C_AcctSchema_Default.E_Expense_Acct +3450, -- C_AcctSchema_Default.E_Prepayment_Acct +4873, -- C_AcctSchema_Default.NotInvoicedReceivables_Acct +4840, -- C_AcctSchema_Default.NotInvoicedRevenue_Acct +56545, -- C_AcctSchema_Default.P_Burden_Acct +56543, -- C_AcctSchema_Default.P_CostOfProduction_Acct +56542, -- C_AcctSchema_Default.P_FloorStock_Acct +56544, -- C_AcctSchema_Default.P_Labor_Acct +56538, -- C_AcctSchema_Default.P_MethodChangeVariance_Acct +56541, -- C_AcctSchema_Default.P_MixVariance_Acct +56546, -- C_AcctSchema_Default.P_OutsideProcessing_Acct +56567, -- C_AcctSchema_Default.P_Overhead_Acct +56568, -- C_AcctSchema_Default.P_Scrap_Acct +56539, -- C_AcctSchema_Default.P_UsageVariance_Acct +56537, -- C_AcctSchema_Default.P_WIP_Acct +4856, -- C_AcctSchema_Default.T_Liability_Acct +4857, -- C_AcctSchema_Default.T_Receivables_Acct +6114, -- C_AcctSchema_Default.W_InvActualAdjust_Acct +3443, -- C_AcctSchema_Default.W_Inventory_Acct +4853, -- C_AcctSchema_Default.Withholding_Acct +4843, -- C_AcctSchema_Default.W_Revaluation_Acct +2501, -- C_AcctSchema_GL.IncomeSummary_Acct +2500, -- C_AcctSchema_GL.RetainedEarning_Acct +2493, -- C_AcctSchema_GL.SuspenseError_Acct +4901, -- C_BankAccount_Acct.B_Expense_Acct +4907, -- C_BankAccount_Acct.B_RevaluationGain_Acct +4908, -- C_BankAccount_Acct.B_RevaluationLoss_Acct +4905, -- C_BankAccount_Acct.B_SettlementGain_Acct +4906, -- C_BankAccount_Acct.B_SettlementLoss_Acct +4904, -- C_BankAccount_Acct.B_Unidentified_Acct +3381, -- C_BP_Employee_Acct.E_Expense_Acct +3382, -- C_BP_Employee_Acct.E_Prepayment_Acct +4999, -- C_BP_Group_Acct.NotInvoicedReceivables_Acct +4998, -- C_BP_Group_Acct.NotInvoicedRevenue_Acct +10287, -- C_Currency_Acct.RealizedGain_Acct +10289, -- C_Currency_Acct.RealizedLoss_Acct +10279, -- C_Currency_Acct.UnrealizedGain_Acct +10290, -- C_Currency_Acct.UnrealizedLoss_Acct +5085, -- C_Tax_Acct.T_Liability_Acct +5087, -- C_Tax_Acct.T_Receivables_Acct +56565, -- M_Product_Acct.P_Burden_Acct +56563, -- M_Product_Acct.P_CostOfProduction_Acct +56562, -- M_Product_Acct.P_FloorStock_Acct +56564, -- M_Product_Acct.P_Labor_Acct +56558, -- M_Product_Acct.P_MethodChangeVariance_Acct +56561, -- M_Product_Acct.P_MixVariance_Acct +56566, -- M_Product_Acct.P_OutsideProcessing_Acct +56571, -- M_Product_Acct.P_Overhead_Acct +56572, -- M_Product_Acct.P_Scrap_Acct +56559, -- M_Product_Acct.P_UsageVariance_Acct +56557, -- M_Product_Acct.P_WIP_Acct +56555, -- M_Product_Category_Acct.P_Burden_Acct +56553, -- M_Product_Category_Acct.P_CostOfProduction_Acct +56547, -- M_Product_Category_Acct.P_FloorStock_Acct +56554, -- M_Product_Category_Acct.P_Labor_Acct +56549, -- M_Product_Category_Acct.P_MethodChangeVariance_Acct +56552, -- M_Product_Category_Acct.P_MixVariance_Acct +56556, -- M_Product_Category_Acct.P_OutsideProcessing_Acct +56569, -- M_Product_Category_Acct.P_Overhead_Acct +56570, -- M_Product_Category_Acct.P_Scrap_Acct +56550, -- M_Product_Category_Acct.P_UsageVariance_Acct +56548, -- M_Product_Category_Acct.P_WIP_Acct +6124, -- M_Warehouse_Acct.W_InvActualAdjust_Acct +3386, -- M_Warehouse_Acct.W_Inventory_Acct +5133 -- M_Warehouse_Acct.W_Revaluation_Acct +) +; + + + +-- + +UPDATE AD_Field SET IsActive='N' WHERE AD_Column_ID IN ( +4862, -- C_AcctSchema_Default.B_Expense_Acct +4868, -- C_AcctSchema_Default.B_RevaluationGain_Acct +4869, -- C_AcctSchema_Default.B_RevaluationLoss_Acct +4866, -- C_AcctSchema_Default.B_SettlementGain_Acct +4867, -- C_AcctSchema_Default.B_SettlementLoss_Acct +4865, -- C_AcctSchema_Default.B_Unidentified_Acct +3449, -- C_AcctSchema_Default.E_Expense_Acct +3450, -- C_AcctSchema_Default.E_Prepayment_Acct +4873, -- C_AcctSchema_Default.NotInvoicedReceivables_Acct +4840, -- C_AcctSchema_Default.NotInvoicedRevenue_Acct +56545, -- C_AcctSchema_Default.P_Burden_Acct +56543, -- C_AcctSchema_Default.P_CostOfProduction_Acct +56542, -- C_AcctSchema_Default.P_FloorStock_Acct +56544, -- C_AcctSchema_Default.P_Labor_Acct +56538, -- C_AcctSchema_Default.P_MethodChangeVariance_Acct +56541, -- C_AcctSchema_Default.P_MixVariance_Acct +56546, -- C_AcctSchema_Default.P_OutsideProcessing_Acct +56567, -- C_AcctSchema_Default.P_Overhead_Acct +56568, -- C_AcctSchema_Default.P_Scrap_Acct +56539, -- C_AcctSchema_Default.P_UsageVariance_Acct +56537, -- C_AcctSchema_Default.P_WIP_Acct +4856, -- C_AcctSchema_Default.T_Liability_Acct +4857, -- C_AcctSchema_Default.T_Receivables_Acct +6114, -- C_AcctSchema_Default.W_InvActualAdjust_Acct +3443, -- C_AcctSchema_Default.W_Inventory_Acct +4853, -- C_AcctSchema_Default.Withholding_Acct +4843, -- C_AcctSchema_Default.W_Revaluation_Acct +2501, -- C_AcctSchema_GL.IncomeSummary_Acct +2500, -- C_AcctSchema_GL.RetainedEarning_Acct +2493, -- C_AcctSchema_GL.SuspenseError_Acct +4901, -- C_BankAccount_Acct.B_Expense_Acct +4907, -- C_BankAccount_Acct.B_RevaluationGain_Acct +4908, -- C_BankAccount_Acct.B_RevaluationLoss_Acct +4905, -- C_BankAccount_Acct.B_SettlementGain_Acct +4906, -- C_BankAccount_Acct.B_SettlementLoss_Acct +4904, -- C_BankAccount_Acct.B_Unidentified_Acct +3381, -- C_BP_Employee_Acct.E_Expense_Acct +3382, -- C_BP_Employee_Acct.E_Prepayment_Acct +4999, -- C_BP_Group_Acct.NotInvoicedReceivables_Acct +4998, -- C_BP_Group_Acct.NotInvoicedRevenue_Acct +10287, -- C_Currency_Acct.RealizedGain_Acct +10289, -- C_Currency_Acct.RealizedLoss_Acct +10279, -- C_Currency_Acct.UnrealizedGain_Acct +10290, -- C_Currency_Acct.UnrealizedLoss_Acct +5085, -- C_Tax_Acct.T_Liability_Acct +5087, -- C_Tax_Acct.T_Receivables_Acct +56565, -- M_Product_Acct.P_Burden_Acct +56563, -- M_Product_Acct.P_CostOfProduction_Acct +56562, -- M_Product_Acct.P_FloorStock_Acct +56564, -- M_Product_Acct.P_Labor_Acct +56558, -- M_Product_Acct.P_MethodChangeVariance_Acct +56561, -- M_Product_Acct.P_MixVariance_Acct +56566, -- M_Product_Acct.P_OutsideProcessing_Acct +56571, -- M_Product_Acct.P_Overhead_Acct +56572, -- M_Product_Acct.P_Scrap_Acct +56559, -- M_Product_Acct.P_UsageVariance_Acct +56557, -- M_Product_Acct.P_WIP_Acct +56555, -- M_Product_Category_Acct.P_Burden_Acct +56553, -- M_Product_Category_Acct.P_CostOfProduction_Acct +56547, -- M_Product_Category_Acct.P_FloorStock_Acct +56554, -- M_Product_Category_Acct.P_Labor_Acct +56549, -- M_Product_Category_Acct.P_MethodChangeVariance_Acct +56552, -- M_Product_Category_Acct.P_MixVariance_Acct +56556, -- M_Product_Category_Acct.P_OutsideProcessing_Acct +56569, -- M_Product_Category_Acct.P_Overhead_Acct +56570, -- M_Product_Category_Acct.P_Scrap_Acct +56550, -- M_Product_Category_Acct.P_UsageVariance_Acct +56548, -- M_Product_Category_Acct.P_WIP_Acct +6124, -- M_Warehouse_Acct.W_InvActualAdjust_Acct +3386, -- M_Warehouse_Acct.W_Inventory_Acct +5133 -- M_Warehouse_Acct.W_Revaluation_Acct +) +; + +--- +UPDATE AD_PrintFormatItem SET IsActive='N' WHERE AD_Column_ID IN ( +4862, -- C_AcctSchema_Default.B_Expense_Acct +4868, -- C_AcctSchema_Default.B_RevaluationGain_Acct +4869, -- C_AcctSchema_Default.B_RevaluationLoss_Acct +4866, -- C_AcctSchema_Default.B_SettlementGain_Acct +4867, -- C_AcctSchema_Default.B_SettlementLoss_Acct +4865, -- C_AcctSchema_Default.B_Unidentified_Acct +3449, -- C_AcctSchema_Default.E_Expense_Acct +3450, -- C_AcctSchema_Default.E_Prepayment_Acct +4873, -- C_AcctSchema_Default.NotInvoicedReceivables_Acct +4840, -- C_AcctSchema_Default.NotInvoicedRevenue_Acct +56545, -- C_AcctSchema_Default.P_Burden_Acct +56543, -- C_AcctSchema_Default.P_CostOfProduction_Acct +56542, -- C_AcctSchema_Default.P_FloorStock_Acct +56544, -- C_AcctSchema_Default.P_Labor_Acct +56538, -- C_AcctSchema_Default.P_MethodChangeVariance_Acct +56541, -- C_AcctSchema_Default.P_MixVariance_Acct +56546, -- C_AcctSchema_Default.P_OutsideProcessing_Acct +56567, -- C_AcctSchema_Default.P_Overhead_Acct +56568, -- C_AcctSchema_Default.P_Scrap_Acct +56539, -- C_AcctSchema_Default.P_UsageVariance_Acct +56537, -- C_AcctSchema_Default.P_WIP_Acct +4856, -- C_AcctSchema_Default.T_Liability_Acct +4857, -- C_AcctSchema_Default.T_Receivables_Acct +6114, -- C_AcctSchema_Default.W_InvActualAdjust_Acct +3443, -- C_AcctSchema_Default.W_Inventory_Acct +4853, -- C_AcctSchema_Default.Withholding_Acct +4843, -- C_AcctSchema_Default.W_Revaluation_Acct +2501, -- C_AcctSchema_GL.IncomeSummary_Acct +2500, -- C_AcctSchema_GL.RetainedEarning_Acct +2493, -- C_AcctSchema_GL.SuspenseError_Acct +4901, -- C_BankAccount_Acct.B_Expense_Acct +4907, -- C_BankAccount_Acct.B_RevaluationGain_Acct +4908, -- C_BankAccount_Acct.B_RevaluationLoss_Acct +4905, -- C_BankAccount_Acct.B_SettlementGain_Acct +4906, -- C_BankAccount_Acct.B_SettlementLoss_Acct +4904, -- C_BankAccount_Acct.B_Unidentified_Acct +3381, -- C_BP_Employee_Acct.E_Expense_Acct +3382, -- C_BP_Employee_Acct.E_Prepayment_Acct +4999, -- C_BP_Group_Acct.NotInvoicedReceivables_Acct +4998, -- C_BP_Group_Acct.NotInvoicedRevenue_Acct +10287, -- C_Currency_Acct.RealizedGain_Acct +10289, -- C_Currency_Acct.RealizedLoss_Acct +10279, -- C_Currency_Acct.UnrealizedGain_Acct +10290, -- C_Currency_Acct.UnrealizedLoss_Acct +5085, -- C_Tax_Acct.T_Liability_Acct +5087, -- C_Tax_Acct.T_Receivables_Acct +56565, -- M_Product_Acct.P_Burden_Acct +56563, -- M_Product_Acct.P_CostOfProduction_Acct +56562, -- M_Product_Acct.P_FloorStock_Acct +56564, -- M_Product_Acct.P_Labor_Acct +56558, -- M_Product_Acct.P_MethodChangeVariance_Acct +56561, -- M_Product_Acct.P_MixVariance_Acct +56566, -- M_Product_Acct.P_OutsideProcessing_Acct +56571, -- M_Product_Acct.P_Overhead_Acct +56572, -- M_Product_Acct.P_Scrap_Acct +56559, -- M_Product_Acct.P_UsageVariance_Acct +56557, -- M_Product_Acct.P_WIP_Acct +56555, -- M_Product_Category_Acct.P_Burden_Acct +56553, -- M_Product_Category_Acct.P_CostOfProduction_Acct +56547, -- M_Product_Category_Acct.P_FloorStock_Acct +56554, -- M_Product_Category_Acct.P_Labor_Acct +56549, -- M_Product_Category_Acct.P_MethodChangeVariance_Acct +56552, -- M_Product_Category_Acct.P_MixVariance_Acct +56556, -- M_Product_Category_Acct.P_OutsideProcessing_Acct +56569, -- M_Product_Category_Acct.P_Overhead_Acct +56570, -- M_Product_Category_Acct.P_Scrap_Acct +56550, -- M_Product_Category_Acct.P_UsageVariance_Acct +56548, -- M_Product_Category_Acct.P_WIP_Acct +6124, -- M_Warehouse_Acct.W_InvActualAdjust_Acct +3386, -- M_Warehouse_Acct.W_Inventory_Acct +5133 -- M_Warehouse_Acct.W_Revaluation_Acct +) +; + +-- Sep 27, 2012 11:08:01 AM COT +UPDATE AD_Tab SET IsActive='N',Updated=TO_DATE('2012-09-27 11:08:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Tab_ID=214 +; + + +-- Sep 28, 2012 1:14:51 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-28 13:14:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1370 +; + +-- Sep 28, 2012 1:15:22 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_Tab SET IsActive='N',Updated=TO_DATE('2012-09-28 13:15:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=569 +; + +-- Sep 28, 2012 1:20:15 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_Field SET DisplayLogic=NULL,Updated=TO_DATE('2012-09-28 13:20:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56547 +; + +-- Sep 28, 2012 1:20:51 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_Field SET DisplayLogic=NULL,Updated=TO_DATE('2012-09-28 13:20:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56537 +; + +SELECT register_migration_script('915_IDEMPIERE-362.sql') FROM dual +; diff --git a/migration/360lts-release/oracle/916_IDEMPIERE-362.sql b/migration/360lts-release/oracle/916_IDEMPIERE-362.sql new file mode 100644 index 0000000000..7a9472fd1a --- /dev/null +++ b/migration/360lts-release/oracle/916_IDEMPIERE-362.sql @@ -0,0 +1,388 @@ +-- IDEMPIERE-362 Hide things that don't work on iDempiere +-- Hide Payroll to be managed as extension + +-- Sep 20, 2012 7:59:44 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-20 19:59:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53114 +; + +-- Sep 20, 2012 8:01:41 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-20 20:01:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53036 +; + +-- Sep 20, 2012 8:01:41 PM COT +UPDATE AD_Menu SET Name='Payroll Concept Catalog', Description='Maintain Payroll Concept Catalog', IsActive='N',Updated=TO_DATE('2012-09-20 20:01:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53115 +; + +-- Sep 20, 2012 8:01:41 PM COT +UPDATE AD_WF_Node SET IsActive='N',Updated=TO_DATE('2012-09-20 20:01:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50084 +; + +-- Sep 20, 2012 8:01:48 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-20 20:01:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53039 +; + +-- Sep 20, 2012 8:01:48 PM COT +UPDATE AD_Menu SET Name='Payroll Concept Category', Description='Maintain Payroll Concept Category', IsActive='N',Updated=TO_DATE('2012-09-20 20:01:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53118 +; + +-- Sep 20, 2012 8:01:48 PM COT +UPDATE AD_WF_Node SET IsActive='N',Updated=TO_DATE('2012-09-20 20:01:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50075 +; + +-- Sep 20, 2012 8:01:59 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-20 20:01:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53032 +; + +-- Sep 20, 2012 8:01:59 PM COT +UPDATE AD_Menu SET Name='Payroll Contract', Description='Maintain Payroll Contract', IsActive='N',Updated=TO_DATE('2012-09-20 20:01:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53110 +; + +-- Sep 20, 2012 8:01:59 PM COT +UPDATE AD_WF_Node SET IsActive='N',Updated=TO_DATE('2012-09-20 20:01:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50076 +; + +-- Sep 20, 2012 8:02:04 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-20 20:02:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53038 +; + +-- Sep 20, 2012 8:02:04 PM COT +UPDATE AD_Menu SET Name='Payroll Definition', Description='In a company, payroll is the sum of all financial records of salaries, wages, bonuses, and deductions.', IsActive='N',Updated=TO_DATE('2012-09-20 20:02:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53117 +; + +-- Sep 20, 2012 8:02:04 PM COT +UPDATE AD_WF_Node SET IsActive='N',Updated=TO_DATE('2012-09-20 20:02:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50074 +; + +-- Sep 20, 2012 8:02:08 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-20 20:02:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53034 +; + +-- Sep 20, 2012 8:02:08 PM COT +UPDATE AD_Menu SET Name='Payroll Department', Description='Maintain Payroll Department', IsActive='N',Updated=TO_DATE('2012-09-20 20:02:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53112 +; + +-- Sep 20, 2012 8:02:08 PM COT +UPDATE AD_WF_Node SET IsActive='N',Updated=TO_DATE('2012-09-20 20:02:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50079 +; + +-- Sep 20, 2012 8:02:13 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-20 20:02:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53033 +; + +-- Sep 20, 2012 8:02:13 PM COT +UPDATE AD_Menu SET Name='Payroll Employee', Description='Maintain Payroll Employee', IsActive='N',Updated=TO_DATE('2012-09-20 20:02:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53111 +; + +-- Sep 20, 2012 8:02:13 PM COT +UPDATE AD_WF_Node SET IsActive='N',Updated=TO_DATE('2012-09-20 20:02:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50080 +; + +-- Sep 20, 2012 8:02:18 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-20 20:02:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53035 +; + +-- Sep 20, 2012 8:02:18 PM COT +UPDATE AD_Menu SET Name='Payroll Job', Description='Maintain Payroll Job', IsActive='N',Updated=TO_DATE('2012-09-20 20:02:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53113 +; + +-- Sep 20, 2012 8:02:18 PM COT +UPDATE AD_WF_Node SET IsActive='N',Updated=TO_DATE('2012-09-20 20:02:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50083 +; + +-- Sep 20, 2012 8:02:42 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-20 20:02:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53042 +; + +-- Sep 20, 2012 8:02:42 PM COT +UPDATE AD_Menu SET Name='Payroll Movement', Description='History of Payroll Movement', IsActive='N',Updated=TO_DATE('2012-09-20 20:02:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53121 +; + +-- Sep 20, 2012 8:02:48 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-20 20:02:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53037 +; + +-- Sep 20, 2012 8:02:48 PM COT +UPDATE AD_Menu SET Name='Payroll Process', Description='Payroll Process', IsActive='N',Updated=TO_DATE('2012-09-20 20:02:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53127 +; + +-- Sep 20, 2012 8:02:48 PM COT +UPDATE AD_WF_Node SET IsActive='N',Updated=TO_DATE('2012-09-20 20:02:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50077 +; + +-- Sep 20, 2012 8:02:55 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-20 20:02:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53041 +; + +-- Sep 20, 2012 8:02:55 PM COT +UPDATE AD_Menu SET Name='Payroll Table', Description='Maintain Payroll Table', IsActive='N',Updated=TO_DATE('2012-09-20 20:02:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53120 +; + +-- Sep 20, 2012 8:02:55 PM COT +UPDATE AD_WF_Node SET IsActive='N',Updated=TO_DATE('2012-09-20 20:02:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50078 +; + +-- Sep 20, 2012 8:03:03 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-20 20:03:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53040 +; + +-- Sep 20, 2012 8:03:03 PM COT +UPDATE AD_Menu SET Name='Payroll Table Type', Description='Maintain Payroll Table Type', IsActive='N',Updated=TO_DATE('2012-09-20 20:03:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53119 +; + +-- Sep 20, 2012 8:03:03 PM COT +UPDATE AD_WF_Node SET IsActive='N',Updated=TO_DATE('2012-09-20 20:03:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50082 +; + +-- Sep 28, 2012 1:07:59 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-28 13:07:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53124 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=53108, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53124 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=53108, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=530 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=53108, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53109 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=53108, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53114 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=266 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=232 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=190 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=127 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=4, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=133 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=5, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=172 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=6, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=173 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=7, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53256 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=8, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=110 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=9, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=394 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=10, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=544 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=11, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=512 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=12, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=506 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=13, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=420 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=14, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=451 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=15, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=186 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=16, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=473 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=17, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=531 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=53108, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53124 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=53108, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53109 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=53108, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53114 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=266 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=232 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=190 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=127 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=4, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=133 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=5, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=172 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=6, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=173 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=7, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53256 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=8, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=110 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=9, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=394 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=10, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=544 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=11, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=512 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=12, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=506 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=13, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=420 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=14, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=451 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=15, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=186 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=16, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=473 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=17, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=531 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=18, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=530 +; + +-- Sep 28, 2012 1:11:02 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-28 13:11:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53123 +; + +-- Sep 28, 2012 1:11:11 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-28 13:11:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53116 +; + +-- Sep 28, 2012 1:11:15 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-28 13:11:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53122 +; + +-- Sep 28, 2012 1:11:28 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-28 13:11:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53109 +; + +-- Sep 28, 2012 1:11:33 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-28 13:11:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53108 +; + +SELECT register_migration_script('916_IDEMPIERE-362.sql') FROM dual +; + diff --git a/migration/360lts-release/postgresql/915_IDEMPIERE-362.sql b/migration/360lts-release/postgresql/915_IDEMPIERE-362.sql new file mode 100644 index 0000000000..ace0d2f0f1 --- /dev/null +++ b/migration/360lts-release/postgresql/915_IDEMPIERE-362.sql @@ -0,0 +1,261 @@ +-- IDEMPIERE-362 Hide things that don't work on iDempiere + +-- Sep 19, 2012 4:36:27 PM COT +UPDATE AD_Column SET IsActive='N' WHERE AD_Column_ID IN ( +4862, -- C_AcctSchema_Default.B_Expense_Acct +4868, -- C_AcctSchema_Default.B_RevaluationGain_Acct +4869, -- C_AcctSchema_Default.B_RevaluationLoss_Acct +4866, -- C_AcctSchema_Default.B_SettlementGain_Acct +4867, -- C_AcctSchema_Default.B_SettlementLoss_Acct +4865, -- C_AcctSchema_Default.B_Unidentified_Acct +3449, -- C_AcctSchema_Default.E_Expense_Acct +3450, -- C_AcctSchema_Default.E_Prepayment_Acct +4873, -- C_AcctSchema_Default.NotInvoicedReceivables_Acct +4840, -- C_AcctSchema_Default.NotInvoicedRevenue_Acct +56545, -- C_AcctSchema_Default.P_Burden_Acct +56543, -- C_AcctSchema_Default.P_CostOfProduction_Acct +56542, -- C_AcctSchema_Default.P_FloorStock_Acct +56544, -- C_AcctSchema_Default.P_Labor_Acct +56538, -- C_AcctSchema_Default.P_MethodChangeVariance_Acct +56541, -- C_AcctSchema_Default.P_MixVariance_Acct +56546, -- C_AcctSchema_Default.P_OutsideProcessing_Acct +56567, -- C_AcctSchema_Default.P_Overhead_Acct +56568, -- C_AcctSchema_Default.P_Scrap_Acct +56539, -- C_AcctSchema_Default.P_UsageVariance_Acct +56537, -- C_AcctSchema_Default.P_WIP_Acct +4856, -- C_AcctSchema_Default.T_Liability_Acct +4857, -- C_AcctSchema_Default.T_Receivables_Acct +6114, -- C_AcctSchema_Default.W_InvActualAdjust_Acct +3443, -- C_AcctSchema_Default.W_Inventory_Acct +4853, -- C_AcctSchema_Default.Withholding_Acct +4843, -- C_AcctSchema_Default.W_Revaluation_Acct +2501, -- C_AcctSchema_GL.IncomeSummary_Acct +2500, -- C_AcctSchema_GL.RetainedEarning_Acct +2493, -- C_AcctSchema_GL.SuspenseError_Acct +4901, -- C_BankAccount_Acct.B_Expense_Acct +4907, -- C_BankAccount_Acct.B_RevaluationGain_Acct +4908, -- C_BankAccount_Acct.B_RevaluationLoss_Acct +4905, -- C_BankAccount_Acct.B_SettlementGain_Acct +4906, -- C_BankAccount_Acct.B_SettlementLoss_Acct +4904, -- C_BankAccount_Acct.B_Unidentified_Acct +3381, -- C_BP_Employee_Acct.E_Expense_Acct +3382, -- C_BP_Employee_Acct.E_Prepayment_Acct +4999, -- C_BP_Group_Acct.NotInvoicedReceivables_Acct +4998, -- C_BP_Group_Acct.NotInvoicedRevenue_Acct +10287, -- C_Currency_Acct.RealizedGain_Acct +10289, -- C_Currency_Acct.RealizedLoss_Acct +10279, -- C_Currency_Acct.UnrealizedGain_Acct +10290, -- C_Currency_Acct.UnrealizedLoss_Acct +5085, -- C_Tax_Acct.T_Liability_Acct +5087, -- C_Tax_Acct.T_Receivables_Acct +56565, -- M_Product_Acct.P_Burden_Acct +56563, -- M_Product_Acct.P_CostOfProduction_Acct +56562, -- M_Product_Acct.P_FloorStock_Acct +56564, -- M_Product_Acct.P_Labor_Acct +56558, -- M_Product_Acct.P_MethodChangeVariance_Acct +56561, -- M_Product_Acct.P_MixVariance_Acct +56566, -- M_Product_Acct.P_OutsideProcessing_Acct +56571, -- M_Product_Acct.P_Overhead_Acct +56572, -- M_Product_Acct.P_Scrap_Acct +56559, -- M_Product_Acct.P_UsageVariance_Acct +56557, -- M_Product_Acct.P_WIP_Acct +56555, -- M_Product_Category_Acct.P_Burden_Acct +56553, -- M_Product_Category_Acct.P_CostOfProduction_Acct +56547, -- M_Product_Category_Acct.P_FloorStock_Acct +56554, -- M_Product_Category_Acct.P_Labor_Acct +56549, -- M_Product_Category_Acct.P_MethodChangeVariance_Acct +56552, -- M_Product_Category_Acct.P_MixVariance_Acct +56556, -- M_Product_Category_Acct.P_OutsideProcessing_Acct +56569, -- M_Product_Category_Acct.P_Overhead_Acct +56570, -- M_Product_Category_Acct.P_Scrap_Acct +56550, -- M_Product_Category_Acct.P_UsageVariance_Acct +56548, -- M_Product_Category_Acct.P_WIP_Acct +6124, -- M_Warehouse_Acct.W_InvActualAdjust_Acct +3386, -- M_Warehouse_Acct.W_Inventory_Acct +5133 -- M_Warehouse_Acct.W_Revaluation_Acct +) +; + + + +-- + +UPDATE AD_Field SET IsActive='N' WHERE AD_Column_ID IN ( +4862, -- C_AcctSchema_Default.B_Expense_Acct +4868, -- C_AcctSchema_Default.B_RevaluationGain_Acct +4869, -- C_AcctSchema_Default.B_RevaluationLoss_Acct +4866, -- C_AcctSchema_Default.B_SettlementGain_Acct +4867, -- C_AcctSchema_Default.B_SettlementLoss_Acct +4865, -- C_AcctSchema_Default.B_Unidentified_Acct +3449, -- C_AcctSchema_Default.E_Expense_Acct +3450, -- C_AcctSchema_Default.E_Prepayment_Acct +4873, -- C_AcctSchema_Default.NotInvoicedReceivables_Acct +4840, -- C_AcctSchema_Default.NotInvoicedRevenue_Acct +56545, -- C_AcctSchema_Default.P_Burden_Acct +56543, -- C_AcctSchema_Default.P_CostOfProduction_Acct +56542, -- C_AcctSchema_Default.P_FloorStock_Acct +56544, -- C_AcctSchema_Default.P_Labor_Acct +56538, -- C_AcctSchema_Default.P_MethodChangeVariance_Acct +56541, -- C_AcctSchema_Default.P_MixVariance_Acct +56546, -- C_AcctSchema_Default.P_OutsideProcessing_Acct +56567, -- C_AcctSchema_Default.P_Overhead_Acct +56568, -- C_AcctSchema_Default.P_Scrap_Acct +56539, -- C_AcctSchema_Default.P_UsageVariance_Acct +56537, -- C_AcctSchema_Default.P_WIP_Acct +4856, -- C_AcctSchema_Default.T_Liability_Acct +4857, -- C_AcctSchema_Default.T_Receivables_Acct +6114, -- C_AcctSchema_Default.W_InvActualAdjust_Acct +3443, -- C_AcctSchema_Default.W_Inventory_Acct +4853, -- C_AcctSchema_Default.Withholding_Acct +4843, -- C_AcctSchema_Default.W_Revaluation_Acct +2501, -- C_AcctSchema_GL.IncomeSummary_Acct +2500, -- C_AcctSchema_GL.RetainedEarning_Acct +2493, -- C_AcctSchema_GL.SuspenseError_Acct +4901, -- C_BankAccount_Acct.B_Expense_Acct +4907, -- C_BankAccount_Acct.B_RevaluationGain_Acct +4908, -- C_BankAccount_Acct.B_RevaluationLoss_Acct +4905, -- C_BankAccount_Acct.B_SettlementGain_Acct +4906, -- C_BankAccount_Acct.B_SettlementLoss_Acct +4904, -- C_BankAccount_Acct.B_Unidentified_Acct +3381, -- C_BP_Employee_Acct.E_Expense_Acct +3382, -- C_BP_Employee_Acct.E_Prepayment_Acct +4999, -- C_BP_Group_Acct.NotInvoicedReceivables_Acct +4998, -- C_BP_Group_Acct.NotInvoicedRevenue_Acct +10287, -- C_Currency_Acct.RealizedGain_Acct +10289, -- C_Currency_Acct.RealizedLoss_Acct +10279, -- C_Currency_Acct.UnrealizedGain_Acct +10290, -- C_Currency_Acct.UnrealizedLoss_Acct +5085, -- C_Tax_Acct.T_Liability_Acct +5087, -- C_Tax_Acct.T_Receivables_Acct +56565, -- M_Product_Acct.P_Burden_Acct +56563, -- M_Product_Acct.P_CostOfProduction_Acct +56562, -- M_Product_Acct.P_FloorStock_Acct +56564, -- M_Product_Acct.P_Labor_Acct +56558, -- M_Product_Acct.P_MethodChangeVariance_Acct +56561, -- M_Product_Acct.P_MixVariance_Acct +56566, -- M_Product_Acct.P_OutsideProcessing_Acct +56571, -- M_Product_Acct.P_Overhead_Acct +56572, -- M_Product_Acct.P_Scrap_Acct +56559, -- M_Product_Acct.P_UsageVariance_Acct +56557, -- M_Product_Acct.P_WIP_Acct +56555, -- M_Product_Category_Acct.P_Burden_Acct +56553, -- M_Product_Category_Acct.P_CostOfProduction_Acct +56547, -- M_Product_Category_Acct.P_FloorStock_Acct +56554, -- M_Product_Category_Acct.P_Labor_Acct +56549, -- M_Product_Category_Acct.P_MethodChangeVariance_Acct +56552, -- M_Product_Category_Acct.P_MixVariance_Acct +56556, -- M_Product_Category_Acct.P_OutsideProcessing_Acct +56569, -- M_Product_Category_Acct.P_Overhead_Acct +56570, -- M_Product_Category_Acct.P_Scrap_Acct +56550, -- M_Product_Category_Acct.P_UsageVariance_Acct +56548, -- M_Product_Category_Acct.P_WIP_Acct +6124, -- M_Warehouse_Acct.W_InvActualAdjust_Acct +3386, -- M_Warehouse_Acct.W_Inventory_Acct +5133 -- M_Warehouse_Acct.W_Revaluation_Acct +) +; + +--- +UPDATE AD_PrintFormatItem SET IsActive='N' WHERE AD_Column_ID IN ( +4862, -- C_AcctSchema_Default.B_Expense_Acct +4868, -- C_AcctSchema_Default.B_RevaluationGain_Acct +4869, -- C_AcctSchema_Default.B_RevaluationLoss_Acct +4866, -- C_AcctSchema_Default.B_SettlementGain_Acct +4867, -- C_AcctSchema_Default.B_SettlementLoss_Acct +4865, -- C_AcctSchema_Default.B_Unidentified_Acct +3449, -- C_AcctSchema_Default.E_Expense_Acct +3450, -- C_AcctSchema_Default.E_Prepayment_Acct +4873, -- C_AcctSchema_Default.NotInvoicedReceivables_Acct +4840, -- C_AcctSchema_Default.NotInvoicedRevenue_Acct +56545, -- C_AcctSchema_Default.P_Burden_Acct +56543, -- C_AcctSchema_Default.P_CostOfProduction_Acct +56542, -- C_AcctSchema_Default.P_FloorStock_Acct +56544, -- C_AcctSchema_Default.P_Labor_Acct +56538, -- C_AcctSchema_Default.P_MethodChangeVariance_Acct +56541, -- C_AcctSchema_Default.P_MixVariance_Acct +56546, -- C_AcctSchema_Default.P_OutsideProcessing_Acct +56567, -- C_AcctSchema_Default.P_Overhead_Acct +56568, -- C_AcctSchema_Default.P_Scrap_Acct +56539, -- C_AcctSchema_Default.P_UsageVariance_Acct +56537, -- C_AcctSchema_Default.P_WIP_Acct +4856, -- C_AcctSchema_Default.T_Liability_Acct +4857, -- C_AcctSchema_Default.T_Receivables_Acct +6114, -- C_AcctSchema_Default.W_InvActualAdjust_Acct +3443, -- C_AcctSchema_Default.W_Inventory_Acct +4853, -- C_AcctSchema_Default.Withholding_Acct +4843, -- C_AcctSchema_Default.W_Revaluation_Acct +2501, -- C_AcctSchema_GL.IncomeSummary_Acct +2500, -- C_AcctSchema_GL.RetainedEarning_Acct +2493, -- C_AcctSchema_GL.SuspenseError_Acct +4901, -- C_BankAccount_Acct.B_Expense_Acct +4907, -- C_BankAccount_Acct.B_RevaluationGain_Acct +4908, -- C_BankAccount_Acct.B_RevaluationLoss_Acct +4905, -- C_BankAccount_Acct.B_SettlementGain_Acct +4906, -- C_BankAccount_Acct.B_SettlementLoss_Acct +4904, -- C_BankAccount_Acct.B_Unidentified_Acct +3381, -- C_BP_Employee_Acct.E_Expense_Acct +3382, -- C_BP_Employee_Acct.E_Prepayment_Acct +4999, -- C_BP_Group_Acct.NotInvoicedReceivables_Acct +4998, -- C_BP_Group_Acct.NotInvoicedRevenue_Acct +10287, -- C_Currency_Acct.RealizedGain_Acct +10289, -- C_Currency_Acct.RealizedLoss_Acct +10279, -- C_Currency_Acct.UnrealizedGain_Acct +10290, -- C_Currency_Acct.UnrealizedLoss_Acct +5085, -- C_Tax_Acct.T_Liability_Acct +5087, -- C_Tax_Acct.T_Receivables_Acct +56565, -- M_Product_Acct.P_Burden_Acct +56563, -- M_Product_Acct.P_CostOfProduction_Acct +56562, -- M_Product_Acct.P_FloorStock_Acct +56564, -- M_Product_Acct.P_Labor_Acct +56558, -- M_Product_Acct.P_MethodChangeVariance_Acct +56561, -- M_Product_Acct.P_MixVariance_Acct +56566, -- M_Product_Acct.P_OutsideProcessing_Acct +56571, -- M_Product_Acct.P_Overhead_Acct +56572, -- M_Product_Acct.P_Scrap_Acct +56559, -- M_Product_Acct.P_UsageVariance_Acct +56557, -- M_Product_Acct.P_WIP_Acct +56555, -- M_Product_Category_Acct.P_Burden_Acct +56553, -- M_Product_Category_Acct.P_CostOfProduction_Acct +56547, -- M_Product_Category_Acct.P_FloorStock_Acct +56554, -- M_Product_Category_Acct.P_Labor_Acct +56549, -- M_Product_Category_Acct.P_MethodChangeVariance_Acct +56552, -- M_Product_Category_Acct.P_MixVariance_Acct +56556, -- M_Product_Category_Acct.P_OutsideProcessing_Acct +56569, -- M_Product_Category_Acct.P_Overhead_Acct +56570, -- M_Product_Category_Acct.P_Scrap_Acct +56550, -- M_Product_Category_Acct.P_UsageVariance_Acct +56548, -- M_Product_Category_Acct.P_WIP_Acct +6124, -- M_Warehouse_Acct.W_InvActualAdjust_Acct +3386, -- M_Warehouse_Acct.W_Inventory_Acct +5133 -- M_Warehouse_Acct.W_Revaluation_Acct +) +; + + +-- Sep 27, 2012 11:08:01 AM COT +UPDATE AD_Tab SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-27 11:08:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Tab_ID=214 +; + +-- Sep 28, 2012 1:14:51 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-28 13:14:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1370 +; + +-- Sep 28, 2012 1:15:22 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_Tab SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-28 13:15:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=569 +; + +-- Sep 28, 2012 1:20:15 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_Field SET DisplayLogic=NULL,Updated=TO_TIMESTAMP('2012-09-28 13:20:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56547 +; + +-- Sep 28, 2012 1:20:51 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_Field SET DisplayLogic=NULL,Updated=TO_TIMESTAMP('2012-09-28 13:20:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56537 +; + +SELECT register_migration_script('915_IDEMPIERE-362.sql') FROM dual +; + diff --git a/migration/360lts-release/postgresql/916_IDEMPIERE-362.sql b/migration/360lts-release/postgresql/916_IDEMPIERE-362.sql new file mode 100644 index 0000000000..eb23354f2c --- /dev/null +++ b/migration/360lts-release/postgresql/916_IDEMPIERE-362.sql @@ -0,0 +1,388 @@ +-- IDEMPIERE-362 Hide things that don't work on iDempiere +-- Hide Payroll to be managed as extension + +-- Sep 20, 2012 7:59:44 PM COT +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 19:59:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53114 +; + +-- Sep 20, 2012 8:01:41 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:01:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53036 +; + +-- Sep 20, 2012 8:01:41 PM COT +UPDATE AD_Menu SET Name='Payroll Concept Catalog', Description='Maintain Payroll Concept Catalog', IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:01:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53115 +; + +-- Sep 20, 2012 8:01:41 PM COT +UPDATE AD_WF_Node SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:01:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50084 +; + +-- Sep 20, 2012 8:01:48 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:01:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53039 +; + +-- Sep 20, 2012 8:01:48 PM COT +UPDATE AD_Menu SET Name='Payroll Concept Category', Description='Maintain Payroll Concept Category', IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:01:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53118 +; + +-- Sep 20, 2012 8:01:48 PM COT +UPDATE AD_WF_Node SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:01:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50075 +; + +-- Sep 20, 2012 8:01:59 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:01:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53032 +; + +-- Sep 20, 2012 8:01:59 PM COT +UPDATE AD_Menu SET Name='Payroll Contract', Description='Maintain Payroll Contract', IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:01:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53110 +; + +-- Sep 20, 2012 8:01:59 PM COT +UPDATE AD_WF_Node SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:01:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50076 +; + +-- Sep 20, 2012 8:02:04 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53038 +; + +-- Sep 20, 2012 8:02:04 PM COT +UPDATE AD_Menu SET Name='Payroll Definition', Description='In a company, payroll is the sum of all financial records of salaries, wages, bonuses, and deductions.', IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53117 +; + +-- Sep 20, 2012 8:02:04 PM COT +UPDATE AD_WF_Node SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50074 +; + +-- Sep 20, 2012 8:02:08 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53034 +; + +-- Sep 20, 2012 8:02:08 PM COT +UPDATE AD_Menu SET Name='Payroll Department', Description='Maintain Payroll Department', IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53112 +; + +-- Sep 20, 2012 8:02:08 PM COT +UPDATE AD_WF_Node SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50079 +; + +-- Sep 20, 2012 8:02:13 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53033 +; + +-- Sep 20, 2012 8:02:13 PM COT +UPDATE AD_Menu SET Name='Payroll Employee', Description='Maintain Payroll Employee', IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53111 +; + +-- Sep 20, 2012 8:02:13 PM COT +UPDATE AD_WF_Node SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50080 +; + +-- Sep 20, 2012 8:02:18 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53035 +; + +-- Sep 20, 2012 8:02:18 PM COT +UPDATE AD_Menu SET Name='Payroll Job', Description='Maintain Payroll Job', IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53113 +; + +-- Sep 20, 2012 8:02:18 PM COT +UPDATE AD_WF_Node SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50083 +; + +-- Sep 20, 2012 8:02:42 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53042 +; + +-- Sep 20, 2012 8:02:42 PM COT +UPDATE AD_Menu SET Name='Payroll Movement', Description='History of Payroll Movement', IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53121 +; + +-- Sep 20, 2012 8:02:48 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53037 +; + +-- Sep 20, 2012 8:02:48 PM COT +UPDATE AD_Menu SET Name='Payroll Process', Description='Payroll Process', IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53127 +; + +-- Sep 20, 2012 8:02:48 PM COT +UPDATE AD_WF_Node SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50077 +; + +-- Sep 20, 2012 8:02:55 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53041 +; + +-- Sep 20, 2012 8:02:55 PM COT +UPDATE AD_Menu SET Name='Payroll Table', Description='Maintain Payroll Table', IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53120 +; + +-- Sep 20, 2012 8:02:55 PM COT +UPDATE AD_WF_Node SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50078 +; + +-- Sep 20, 2012 8:03:03 PM COT +UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:03:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53040 +; + +-- Sep 20, 2012 8:03:03 PM COT +UPDATE AD_Menu SET Name='Payroll Table Type', Description='Maintain Payroll Table Type', IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:03:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53119 +; + +-- Sep 20, 2012 8:03:03 PM COT +UPDATE AD_WF_Node SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:03:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50082 +; + +-- Sep 28, 2012 1:07:59 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-28 13:07:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53124 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=53108, SeqNo=0, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53124 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=53108, SeqNo=1, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=530 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=53108, SeqNo=2, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53109 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=53108, SeqNo=3, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53114 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=0, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=266 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=1, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=232 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=2, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=190 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=3, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=127 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=4, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=133 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=5, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=172 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=6, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=173 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=7, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53256 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=8, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=110 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=9, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=394 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=10, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=544 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=11, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=512 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=12, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=506 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=13, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=420 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=14, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=451 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=15, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=186 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=16, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=473 +; + +-- Sep 28, 2012 1:08:54 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=17, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=531 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=53108, SeqNo=0, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53124 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=53108, SeqNo=1, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53109 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=53108, SeqNo=2, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53114 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=0, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=266 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=1, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=232 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=2, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=190 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=3, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=127 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=4, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=133 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=5, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=172 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=6, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=173 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=7, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53256 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=8, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=110 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=9, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=394 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=10, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=544 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=11, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=512 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=12, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=506 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=13, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=420 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=14, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=451 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=15, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=186 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=16, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=473 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=17, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=531 +; + +-- Sep 28, 2012 1:08:58 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=18, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=530 +; + +-- Sep 28, 2012 1:11:02 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-28 13:11:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53123 +; + +-- Sep 28, 2012 1:11:11 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-28 13:11:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53116 +; + +-- Sep 28, 2012 1:11:15 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-28 13:11:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53122 +; + +-- Sep 28, 2012 1:11:28 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-28 13:11:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53109 +; + +-- Sep 28, 2012 1:11:33 PM COT +-- IDEMPIERE-362 Hide things that don't work on iDempiere +UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-28 13:11:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53108 +; + +SELECT register_migration_script('916_IDEMPIERE-362.sql') FROM dual +; + diff --git a/org.adempiere.base.process/src/org/compiere/process/AcctSchemaDefaultCopy.java b/org.adempiere.base.process/src/org/compiere/process/AcctSchemaDefaultCopy.java index b24410a39c..4b6432d7a9 100644 --- a/org.adempiere.base.process/src/org/compiere/process/AcctSchemaDefaultCopy.java +++ b/org.adempiere.base.process/src/org/compiere/process/AcctSchemaDefaultCopy.java @@ -97,18 +97,7 @@ public class AcctSchemaDefaultCopy extends SvrProcess .append(", P_AverageCostVariance_Acct=").append(acct.getP_AverageCostVariance_Acct()) .append(", P_TradeDiscountRec_Acct=").append(acct.getP_TradeDiscountRec_Acct()) .append(", P_TradeDiscountGrant_Acct=").append(acct.getP_TradeDiscountGrant_Acct()) - .append(", P_WIP_Acct=").append(acct.getP_WIP_Acct()) - .append(", P_FloorStock_Acct=").append(acct.getP_FloorStock_Acct()) - .append(", P_MethodChangeVariance_Acct=").append(acct.getP_MethodChangeVariance_Acct()) - .append(", P_UsageVariance_Acct=").append(acct.getP_UsageVariance_Acct()) .append(", P_RateVariance_Acct=").append(acct.getP_RateVariance_Acct()) - .append(", P_MixVariance_Acct=").append(acct.getP_MixVariance_Acct()) - .append(", P_Labor_Acct=").append(acct.getP_Labor_Acct()) - .append(", P_Burden_Acct=").append(acct.getP_Burden_Acct()) - .append(", P_CostOfProduction_Acct=").append(acct.getP_CostOfProduction_Acct()) - .append(", P_OutsideProcessing_Acct=").append(acct.getP_OutsideProcessing_Acct()) - .append(", P_Overhead_Acct=").append(acct.getP_Overhead_Acct()) - .append(", P_Scrap_Acct=").append(acct.getP_Scrap_Acct()) .append(", Updated=SysDate, UpdatedBy=0 ") .append("WHERE pa.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) .append(" AND EXISTS (SELECT * FROM M_Product_Category p ") @@ -124,15 +113,13 @@ public class AcctSchemaDefaultCopy extends SvrProcess .append(" P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct,") .append(" P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_AverageCostVariance_Acct,") .append(" P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct," ) - .append(" P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct,") - .append(" P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct) ") + .append(" P_RateVariance_Acct) ") .append(" SELECT p.M_Product_Category_ID, acct.C_AcctSchema_ID,") .append(" p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,") .append(" acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct,") .append(" acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_AverageCostVariance_Acct,") .append(" acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct,") - .append(" acct.P_WIP_Acct,acct.P_FloorStock_Acct,acct.P_MethodChangeVariance_Acct,acct.P_UsageVariance_Acct,acct.P_RateVariance_Acct,") - .append(" acct.P_MixVariance_Acct,acct.P_Labor_Acct,acct.P_Burden_Acct,acct.P_CostOfProduction_Acct,acct.P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct ") + .append(" acct.P_RateVariance_Acct ") .append("FROM M_Product_Category p") .append(" INNER JOIN C_AcctSchema_Default acct ON (p.AD_Client_ID=acct.AD_Client_ID) ") .append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) @@ -150,15 +137,13 @@ public class AcctSchemaDefaultCopy extends SvrProcess .append(" P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct,") .append(" P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_AverageCostVariance_Acct,") .append(" P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, ") - .append(" P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct,") - .append(" P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct) ") + .append(" P_RateVariance_Acct) ") .append("SELECT p.M_Product_ID, acct.C_AcctSchema_ID,") .append(" p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,") .append(" acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct,") .append(" acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_AverageCostVariance_Acct,") .append(" acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct,") - .append(" acct.P_WIP_Acct,acct.P_FloorStock_Acct,acct.P_MethodChangeVariance_Acct,acct.P_UsageVariance_Acct,acct.P_RateVariance_Acct,") - .append(" acct.P_MixVariance_Acct,acct.P_Labor_Acct,acct.P_Burden_Acct,acct.P_CostOfProduction_Acct,acct.P_OutsideProcessing_Acct,acct.P_Overhead_Acct,acct.P_Scrap_Acct ") + .append(" acct.P_RateVariance_Acct ") .append("FROM M_Product p") .append(" INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)") .append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) @@ -187,8 +172,6 @@ public class AcctSchemaDefaultCopy extends SvrProcess .append(", WriteOff_Acct=").append(acct.getWriteOff_Acct()) .append(", NotInvoicedReceipts_Acct=").append(acct.getNotInvoicedReceipts_Acct()) .append(", UnEarnedRevenue_Acct=").append(acct.getUnEarnedRevenue_Acct()) - .append(", NotInvoicedRevenue_Acct=").append(acct.getNotInvoicedRevenue_Acct()) - .append(", NotInvoicedReceivables_Acct=").append(acct.getNotInvoicedReceivables_Acct()) .append(", Updated=SysDate, UpdatedBy=0 ") .append("WHERE a.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) .append(" AND EXISTS (SELECT * FROM C_BP_Group_Acct x ") @@ -204,15 +187,13 @@ public class AcctSchemaDefaultCopy extends SvrProcess .append(" C_Receivable_Acct, C_Receivable_Services_Acct, C_PrePayment_Acct,") .append(" V_Liability_Acct, V_Liability_Services_Acct, V_PrePayment_Acct,") .append(" PayDiscount_Exp_Acct, PayDiscount_Rev_Acct, WriteOff_Acct,") - .append(" NotInvoicedReceipts_Acct, UnEarnedRevenue_Acct,") - .append(" NotInvoicedRevenue_Acct, NotInvoicedReceivables_Acct) ") + .append(" NotInvoicedReceipts_Acct, UnEarnedRevenue_Acct) ") .append("SELECT x.C_BP_Group_ID, acct.C_AcctSchema_ID,") .append(" x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,") .append(" acct.C_Receivable_Acct, acct.C_Receivable_Services_Acct, acct.C_PrePayment_Acct,") .append(" acct.V_Liability_Acct, acct.V_Liability_Services_Acct, acct.V_PrePayment_Acct,") .append(" acct.PayDiscount_Exp_Acct, acct.PayDiscount_Rev_Acct, acct.WriteOff_Acct,") - .append(" acct.NotInvoicedReceipts_Acct, acct.UnEarnedRevenue_Acct,") - .append(" acct.NotInvoicedRevenue_Acct, acct.NotInvoicedReceivables_Acct ") + .append(" acct.NotInvoicedReceipts_Acct, acct.UnEarnedRevenue_Acct ") .append("FROM C_BP_Group x") .append(" INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) ") .append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) @@ -223,8 +204,9 @@ public class AcctSchemaDefaultCopy extends SvrProcess addLog(0, null, new BigDecimal(created), "@Created@ @C_BP_Group_ID@"); createdTotal += created; - +//IDEMPIERE-362 Hide things that don't work on iDempiere // Update Business Partner - Employee + /* if (p_CopyOverwriteAcct) { sql = new StringBuilder("UPDATE C_BP_Employee_Acct a ") @@ -255,6 +237,7 @@ public class AcctSchemaDefaultCopy extends SvrProcess created = DB.executeUpdate(sql.toString(), get_TrxName()); addLog(0, null, new BigDecimal(created), "@Created@ @C_BPartner_ID@ @IsEmployee@"); createdTotal += created; + */ // if (!p_CopyOverwriteAcct) { @@ -293,15 +276,12 @@ public class AcctSchemaDefaultCopy extends SvrProcess addLog(0, null, new BigDecimal(created), "@Created@ @C_BPartner_ID@ @IsVendor@"); createdTotal += created; } - +//IDEMPIERE-362 Hide things that don't work on iDempiere // Update Warehouse if (p_CopyOverwriteAcct) { sql = new StringBuilder("UPDATE M_Warehouse_Acct a ") - .append("SET W_Inventory_Acct=").append(acct.getW_Inventory_Acct()) - .append(", W_Differences_Acct=").append(acct.getW_Differences_Acct()) - .append(", W_Revaluation_Acct=").append(acct.getW_Revaluation_Acct()) - .append(", W_InvActualAdjust_Acct=").append(acct.getW_InvActualAdjust_Acct()) + .append("SET W_Differences_Acct=").append(acct.getW_Differences_Acct()) .append(", Updated=SysDate, UpdatedBy=0 ") .append("WHERE a.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) .append(" AND EXISTS (SELECT * FROM M_Warehouse_Acct x ") @@ -314,10 +294,10 @@ public class AcctSchemaDefaultCopy extends SvrProcess sql = new StringBuilder("INSERT INTO M_Warehouse_Acct ") .append("(M_Warehouse_ID, C_AcctSchema_ID,") .append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,") - .append(" W_Inventory_Acct, W_Differences_Acct, W_Revaluation_Acct, W_InvActualAdjust_Acct) ") + .append(" W_Differences_Acct) ") .append("SELECT x.M_Warehouse_ID, acct.C_AcctSchema_ID,") .append(" x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,") - .append(" acct.W_Inventory_Acct, acct.W_Differences_Acct, acct.W_Revaluation_Acct, acct.W_InvActualAdjust_Acct ") + .append(" acct.W_Differences_Acct ") .append("FROM M_Warehouse x") .append(" INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) ") .append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) @@ -361,15 +341,13 @@ public class AcctSchemaDefaultCopy extends SvrProcess addLog(0, null, new BigDecimal(created), "@Created@ @C_Project_ID@"); createdTotal += created; - +//IDEMPIERE-362 Hide things that don't work on iDempiere // Update Tax if (p_CopyOverwriteAcct) { sql = new StringBuilder("UPDATE C_Tax_Acct a ") .append("SET T_Due_Acct=").append(acct.getT_Due_Acct()) - .append(", T_Liability_Acct=").append(acct.getT_Liability_Acct()) .append(", T_Credit_Acct=").append(acct.getT_Credit_Acct()) - .append(", T_Receivables_Acct=").append(acct.getT_Receivables_Acct()) .append(", T_Expense_Acct=").append(acct.getT_Expense_Acct()) .append(", Updated=SysDate, UpdatedBy=0 ") .append("WHERE a.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) @@ -383,10 +361,10 @@ public class AcctSchemaDefaultCopy extends SvrProcess sql = new StringBuilder("INSERT INTO C_Tax_Acct ") .append("(C_Tax_ID, C_AcctSchema_ID,") .append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,") - .append(" T_Due_Acct, T_Liability_Acct, T_Credit_Acct, T_Receivables_Acct, T_Expense_Acct) ") + .append(" T_Due_Acct, T_Credit_Acct, T_Expense_Acct) ") .append("SELECT x.C_Tax_ID, acct.C_AcctSchema_ID,") .append(" x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,") - .append(" acct.T_Due_Acct, acct.T_Liability_Acct, acct.T_Credit_Acct, acct.T_Receivables_Acct, acct.T_Expense_Acct ") + .append(" acct.T_Due_Acct, acct.T_Credit_Acct, acct.T_Expense_Acct ") .append("FROM C_Tax x") .append(" INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) ") .append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) @@ -404,16 +382,10 @@ public class AcctSchemaDefaultCopy extends SvrProcess sql = new StringBuilder("UPDATE C_BankAccount_Acct a ") .append("SET B_InTransit_Acct=").append(acct.getB_InTransit_Acct()) .append(", B_Asset_Acct=").append(acct.getB_Asset_Acct()) - .append(", B_Expense_Acct=").append(acct.getB_Expense_Acct()) .append(", B_InterestRev_Acct=").append(acct.getB_InterestRev_Acct()) .append(", B_InterestExp_Acct=").append(acct.getB_InterestExp_Acct()) - .append(", B_Unidentified_Acct=").append(acct.getB_Unidentified_Acct()) .append(", B_UnallocatedCash_Acct=").append(acct.getB_UnallocatedCash_Acct()) .append(", B_PaymentSelect_Acct=").append(acct.getB_PaymentSelect_Acct()) - .append(", B_SettlementGain_Acct=").append(acct.getB_SettlementGain_Acct()) - .append(", B_SettlementLoss_Acct=").append(acct.getB_SettlementLoss_Acct()) - .append(", B_RevaluationGain_Acct=").append(acct.getB_RevaluationGain_Acct()) - .append(", B_RevaluationLoss_Acct=").append(acct.getB_RevaluationLoss_Acct()) .append(", Updated=SysDate, UpdatedBy=0 ") .append("WHERE a.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) .append(" AND EXISTS (SELECT * FROM C_BankAccount_Acct x ") @@ -426,16 +398,12 @@ public class AcctSchemaDefaultCopy extends SvrProcess sql = new StringBuilder("INSERT INTO C_BankAccount_Acct ") .append("(C_BankAccount_ID, C_AcctSchema_ID,") .append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,") - .append(" B_InTransit_Acct, B_Asset_Acct, B_Expense_Acct, B_InterestRev_Acct, B_InterestExp_Acct,") - .append(" B_Unidentified_Acct, B_UnallocatedCash_Acct, B_PaymentSelect_Acct,") - .append(" B_SettlementGain_Acct, B_SettlementLoss_Acct,") - .append(" B_RevaluationGain_Acct, B_RevaluationLoss_Acct) ") + .append(" B_InTransit_Acct, B_Asset_Acct, B_InterestRev_Acct, B_InterestExp_Acct,") + .append(" B_UnallocatedCash_Acct, B_PaymentSelect_Acct) ") .append("SELECT x.C_BankAccount_ID, acct.C_AcctSchema_ID,") .append(" x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,") - .append(" acct.B_InTransit_Acct, acct.B_Asset_Acct, acct.B_Expense_Acct, acct.B_InterestRev_Acct, acct.B_InterestExp_Acct,") - .append(" acct.B_Unidentified_Acct, acct.B_UnallocatedCash_Acct, acct.B_PaymentSelect_Acct,") - .append(" acct.B_SettlementGain_Acct, acct.B_SettlementLoss_Acct,") - .append(" acct.B_RevaluationGain_Acct, acct.B_RevaluationLoss_Acct ") + .append(" acct.B_InTransit_Acct, acct.B_Asset_Acct, acct.B_InterestRev_Acct, acct.B_InterestExp_Acct,") + .append(" acct.B_UnallocatedCash_Acct, acct.B_PaymentSelect_Acct ") .append("FROM C_BankAccount x") .append(" INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) ") .append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) @@ -446,8 +414,9 @@ public class AcctSchemaDefaultCopy extends SvrProcess addLog(0, null, new BigDecimal(created), "@Created@ @C_BankAccount_ID@"); createdTotal += created; - +//IDEMPIERE-362 Hide things that don't work on iDempiere // Update Withholding + /* if (p_CopyOverwriteAcct) { sql = new StringBuilder("UPDATE C_Withholding_Acct a ") @@ -477,7 +446,7 @@ public class AcctSchemaDefaultCopy extends SvrProcess created = DB.executeUpdate(sql.toString(), get_TrxName()); addLog(0, null, new BigDecimal(created), "@Created@ @C_Withholding_ID@"); createdTotal += created; - + */ // Update Charge if (p_CopyOverwriteAcct) diff --git a/org.adempiere.base.process/src/org/compiere/process/ProductCategoryAcctCopy.java b/org.adempiere.base.process/src/org/compiere/process/ProductCategoryAcctCopy.java index 9cbe40690b..093866f190 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ProductCategoryAcctCopy.java +++ b/org.adempiere.base.process/src/org/compiere/process/ProductCategoryAcctCopy.java @@ -76,13 +76,11 @@ public class ProductCategoryAcctCopy extends SvrProcess .append("SET (P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct,") .append(" P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct,P_AverageCostVariance_Acct,") .append(" P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct,") - .append(" P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct,") - .append(" P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct)=") + .append(" P_RateVariance_Acct)=") .append(" (SELECT P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct,") .append(" P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct,P_AverageCostVariance_Acct,") .append(" P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct,") - .append(" P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct,") - .append(" P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct") + .append(" P_RateVariance_Acct") .append(" FROM M_Product_Category_Acct pca") .append(" WHERE pca.M_Product_Category_ID=").append(p_M_Product_Category_ID) .append(" AND pca.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) @@ -101,15 +99,13 @@ public class ProductCategoryAcctCopy extends SvrProcess .append(" P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct,") .append(" P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_AverageCostVariance_Acct,") .append(" P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, ") - .append(" P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct,") - .append(" P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) ") + .append(" P_RateVariance_Acct) ") .append("SELECT p.M_Product_ID, acct.C_AcctSchema_ID,") .append(" p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,") .append(" acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct,") .append(" acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_AverageCostVariance_Acct,") .append(" acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, ") - .append(" acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct,") - .append(" acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct ") + .append(" acct.P_RateVariance_Acct ") .append("FROM M_Product p") .append(" INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)") .append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) // # diff --git a/org.adempiere.base/src/org/compiere/acct/DocTax.java b/org.adempiere.base/src/org/compiere/acct/DocTax.java index 6a1ee7effa..9dbe5f21d5 100644 --- a/org.adempiere.base/src/org/compiere/acct/DocTax.java +++ b/org.adempiere.base/src/org/compiere/acct/DocTax.java @@ -76,14 +76,10 @@ public final class DocTax /** Tax Due Acct */ public static final int ACCTTYPE_TaxDue = 0; - /** Tax Liability */ - public static final int ACCTTYPE_TaxLiability = 1; /** Tax Credit */ - public static final int ACCTTYPE_TaxCredit = 2; - /** Tax Receivables */ - public static final int ACCTTYPE_TaxReceivables = 3; + public static final int ACCTTYPE_TaxCredit = 1; /** Tax Expense */ - public static final int ACCTTYPE_TaxExpense = 4; + public static final int ACCTTYPE_TaxExpense = 2; /** * Get Account @@ -93,10 +89,10 @@ public final class DocTax */ public MAccount getAccount (int AcctType, MAcctSchema as) { - if (AcctType < 0 || AcctType > 4) + if (AcctType < ACCTTYPE_TaxDue || AcctType > ACCTTYPE_TaxExpense) return null; // - String sql = "SELECT T_Due_Acct, T_Liability_Acct, T_Credit_Acct, T_Receivables_Acct, T_Expense_Acct " + String sql = "SELECT T_Due_Acct, T_Credit_Acct, T_Expense_Acct " + "FROM C_Tax_Acct WHERE C_Tax_ID=? AND C_AcctSchema_ID=?"; int validCombination_ID = 0; PreparedStatement pstmt = null; @@ -108,7 +104,7 @@ public final class DocTax pstmt.setInt(2, as.getC_AcctSchema_ID()); rs = pstmt.executeQuery(); if (rs.next()) - validCombination_ID = rs.getInt(AcctType+1); // 1..5 + validCombination_ID = rs.getInt(AcctType+1); // 1..3 } catch (SQLException e) { diff --git a/org.adempiere.base/src/org/compiere/model/I_C_AcctSchema_Default.java b/org.adempiere.base/src/org/compiere/model/I_C_AcctSchema_Default.java index d7e238c951..a994519eba 100644 --- a/org.adempiere.base/src/org/compiere/model/I_C_AcctSchema_Default.java +++ b/org.adempiere.base/src/org/compiere/model/I_C_AcctSchema_Default.java @@ -35,7 +35,7 @@ public interface I_C_AcctSchema_Default KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); - /** AccessLevel = 2 - Client + /** AccessLevel = - Client */ BigDecimal accessLevel = BigDecimal.valueOf(2); @@ -77,21 +77,6 @@ public interface I_C_AcctSchema_Default public I_C_ValidCombination getB_Asset_A() throws RuntimeException; - /** Column name B_Expense_Acct */ - public static final String COLUMNNAME_B_Expense_Acct = "B_Expense_Acct"; - - /** Set Bank Expense. - * Bank Expense Account - */ - public void setB_Expense_Acct (int B_Expense_Acct); - - /** Get Bank Expense. - * Bank Expense Account - */ - public int getB_Expense_Acct(); - - public I_C_ValidCombination getB_Expense_A() throws RuntimeException; - /** Column name B_InterestExp_Acct */ public static final String COLUMNNAME_B_InterestExp_Acct = "B_InterestExp_Acct"; @@ -152,66 +137,6 @@ public interface I_C_AcctSchema_Default public I_C_ValidCombination getB_PaymentSelect_A() throws RuntimeException; - /** Column name B_RevaluationGain_Acct */ - public static final String COLUMNNAME_B_RevaluationGain_Acct = "B_RevaluationGain_Acct"; - - /** Set Bank Revaluation Gain. - * Bank Revaluation Gain Account - */ - public void setB_RevaluationGain_Acct (int B_RevaluationGain_Acct); - - /** Get Bank Revaluation Gain. - * Bank Revaluation Gain Account - */ - public int getB_RevaluationGain_Acct(); - - public I_C_ValidCombination getB_RevaluationGain_A() throws RuntimeException; - - /** Column name B_RevaluationLoss_Acct */ - public static final String COLUMNNAME_B_RevaluationLoss_Acct = "B_RevaluationLoss_Acct"; - - /** Set Bank Revaluation Loss. - * Bank Revaluation Loss Account - */ - public void setB_RevaluationLoss_Acct (int B_RevaluationLoss_Acct); - - /** Get Bank Revaluation Loss. - * Bank Revaluation Loss Account - */ - public int getB_RevaluationLoss_Acct(); - - public I_C_ValidCombination getB_RevaluationLoss_A() throws RuntimeException; - - /** Column name B_SettlementGain_Acct */ - public static final String COLUMNNAME_B_SettlementGain_Acct = "B_SettlementGain_Acct"; - - /** Set Bank Settlement Gain. - * Bank Settlement Gain Account - */ - public void setB_SettlementGain_Acct (int B_SettlementGain_Acct); - - /** Get Bank Settlement Gain. - * Bank Settlement Gain Account - */ - public int getB_SettlementGain_Acct(); - - public I_C_ValidCombination getB_SettlementGain_A() throws RuntimeException; - - /** Column name B_SettlementLoss_Acct */ - public static final String COLUMNNAME_B_SettlementLoss_Acct = "B_SettlementLoss_Acct"; - - /** Set Bank Settlement Loss. - * Bank Settlement Loss Account - */ - public void setB_SettlementLoss_Acct (int B_SettlementLoss_Acct); - - /** Get Bank Settlement Loss. - * Bank Settlement Loss Account - */ - public int getB_SettlementLoss_Acct(); - - public I_C_ValidCombination getB_SettlementLoss_A() throws RuntimeException; - /** Column name B_UnallocatedCash_Acct */ public static final String COLUMNNAME_B_UnallocatedCash_Acct = "B_UnallocatedCash_Acct"; @@ -227,21 +152,6 @@ public interface I_C_AcctSchema_Default public I_C_ValidCombination getB_UnallocatedCash_A() throws RuntimeException; - /** Column name B_Unidentified_Acct */ - public static final String COLUMNNAME_B_Unidentified_Acct = "B_Unidentified_Acct"; - - /** Set Bank Unidentified Receipts. - * Bank Unidentified Receipts Account - */ - public void setB_Unidentified_Acct (int B_Unidentified_Acct); - - /** Get Bank Unidentified Receipts. - * Bank Unidentified Receipts Account - */ - public int getB_Unidentified_Acct(); - - public I_C_ValidCombination getB_Unidentified_A() throws RuntimeException; - /** Column name C_AcctSchema_Default_UU */ public static final String COLUMNNAME_C_AcctSchema_Default_UU = "C_AcctSchema_Default_UU"; @@ -417,36 +327,6 @@ public interface I_C_AcctSchema_Default public I_C_ValidCombination getC_Receivable_Services_A() throws RuntimeException; - /** Column name E_Expense_Acct */ - public static final String COLUMNNAME_E_Expense_Acct = "E_Expense_Acct"; - - /** Set Employee Expense. - * Account for Employee Expenses - */ - public void setE_Expense_Acct (int E_Expense_Acct); - - /** Get Employee Expense. - * Account for Employee Expenses - */ - public int getE_Expense_Acct(); - - public I_C_ValidCombination getE_Expense_A() throws RuntimeException; - - /** Column name E_Prepayment_Acct */ - public static final String COLUMNNAME_E_Prepayment_Acct = "E_Prepayment_Acct"; - - /** Set Employee Prepayment. - * Account for Employee Expense Prepayments - */ - public void setE_Prepayment_Acct (int E_Prepayment_Acct); - - /** Get Employee Prepayment. - * Account for Employee Expense Prepayments - */ - public int getE_Prepayment_Acct(); - - public I_C_ValidCombination getE_Prepayment_A() throws RuntimeException; - /** Column name IsActive */ public static final String COLUMNNAME_IsActive = "IsActive"; @@ -475,36 +355,6 @@ public interface I_C_AcctSchema_Default public I_C_ValidCombination getNotInvoicedReceipts_A() throws RuntimeException; - /** Column name NotInvoicedReceivables_Acct */ - public static final String COLUMNNAME_NotInvoicedReceivables_Acct = "NotInvoicedReceivables_Acct"; - - /** Set Not-invoiced Receivables. - * Account for not invoiced Receivables - */ - public void setNotInvoicedReceivables_Acct (int NotInvoicedReceivables_Acct); - - /** Get Not-invoiced Receivables. - * Account for not invoiced Receivables - */ - public int getNotInvoicedReceivables_Acct(); - - public I_C_ValidCombination getNotInvoicedReceivables_A() throws RuntimeException; - - /** Column name NotInvoicedRevenue_Acct */ - public static final String COLUMNNAME_NotInvoicedRevenue_Acct = "NotInvoicedRevenue_Acct"; - - /** Set Not-invoiced Revenue. - * Account for not invoiced Revenue - */ - public void setNotInvoicedRevenue_Acct (int NotInvoicedRevenue_Acct); - - /** Get Not-invoiced Revenue. - * Account for not invoiced Revenue - */ - public int getNotInvoicedRevenue_Acct(); - - public I_C_ValidCombination getNotInvoicedRevenue_A() throws RuntimeException; - /** Column name P_Asset_Acct */ public static final String COLUMNNAME_P_Asset_Acct = "P_Asset_Acct"; @@ -565,21 +415,6 @@ public interface I_C_AcctSchema_Default public I_C_ValidCombination getPayDiscount_Rev_A() throws RuntimeException; - /** Column name P_Burden_Acct */ - public static final String COLUMNNAME_P_Burden_Acct = "P_Burden_Acct"; - - /** Set Burden. - * The Burden account is the account used Manufacturing Order - */ - public void setP_Burden_Acct (int P_Burden_Acct); - - /** Get Burden. - * The Burden account is the account used Manufacturing Order - */ - public int getP_Burden_Acct(); - - public I_C_ValidCombination getP_Burden_A() throws RuntimeException; - /** Column name P_COGS_Acct */ public static final String COLUMNNAME_P_COGS_Acct = "P_COGS_Acct"; @@ -610,21 +445,6 @@ public interface I_C_AcctSchema_Default public I_C_ValidCombination getP_CostAdjustment_A() throws RuntimeException; - /** Column name P_CostOfProduction_Acct */ - public static final String COLUMNNAME_P_CostOfProduction_Acct = "P_CostOfProduction_Acct"; - - /** Set Cost Of Production. - * The Cost Of Production account is the account used Manufacturing Order - */ - public void setP_CostOfProduction_Acct (int P_CostOfProduction_Acct); - - /** Get Cost Of Production. - * The Cost Of Production account is the account used Manufacturing Order - */ - public int getP_CostOfProduction_Acct(); - - public I_C_ValidCombination getP_CostOfProduction_A() throws RuntimeException; - /** Column name P_Expense_Acct */ public static final String COLUMNNAME_P_Expense_Acct = "P_Expense_Acct"; @@ -640,21 +460,6 @@ public interface I_C_AcctSchema_Default public I_C_ValidCombination getP_Expense_A() throws RuntimeException; - /** Column name P_FloorStock_Acct */ - public static final String COLUMNNAME_P_FloorStock_Acct = "P_FloorStock_Acct"; - - /** Set Floor Stock. - * The Floor Stock account is the account used Manufacturing Order - */ - public void setP_FloorStock_Acct (int P_FloorStock_Acct); - - /** Get Floor Stock. - * The Floor Stock account is the account used Manufacturing Order - */ - public int getP_FloorStock_Acct(); - - public I_C_ValidCombination getP_FloorStock_A() throws RuntimeException; - /** Column name P_InventoryClearing_Acct */ public static final String COLUMNNAME_P_InventoryClearing_Acct = "P_InventoryClearing_Acct"; @@ -715,81 +520,6 @@ public interface I_C_AcctSchema_Default public I_C_ValidCombination getPJ_WIP_A() throws RuntimeException; - /** Column name P_Labor_Acct */ - public static final String COLUMNNAME_P_Labor_Acct = "P_Labor_Acct"; - - /** Set Labor. - * The Labor account is the account used Manufacturing Order - */ - public void setP_Labor_Acct (int P_Labor_Acct); - - /** Get Labor. - * The Labor account is the account used Manufacturing Order - */ - public int getP_Labor_Acct(); - - public I_C_ValidCombination getP_Labor_A() throws RuntimeException; - - /** Column name P_MethodChangeVariance_Acct */ - public static final String COLUMNNAME_P_MethodChangeVariance_Acct = "P_MethodChangeVariance_Acct"; - - /** Set Method Change Variance. - * The Method Change Variance account is the account used Manufacturing Order - */ - public void setP_MethodChangeVariance_Acct (int P_MethodChangeVariance_Acct); - - /** Get Method Change Variance. - * The Method Change Variance account is the account used Manufacturing Order - */ - public int getP_MethodChangeVariance_Acct(); - - public I_C_ValidCombination getP_MethodChangeVariance_A() throws RuntimeException; - - /** Column name P_MixVariance_Acct */ - public static final String COLUMNNAME_P_MixVariance_Acct = "P_MixVariance_Acct"; - - /** Set Mix Variance. - * The Mix Variance account is the account used Manufacturing Order - */ - public void setP_MixVariance_Acct (int P_MixVariance_Acct); - - /** Get Mix Variance. - * The Mix Variance account is the account used Manufacturing Order - */ - public int getP_MixVariance_Acct(); - - public I_C_ValidCombination getP_MixVariance_A() throws RuntimeException; - - /** Column name P_OutsideProcessing_Acct */ - public static final String COLUMNNAME_P_OutsideProcessing_Acct = "P_OutsideProcessing_Acct"; - - /** Set Outside Processing. - * The Outside Processing Account is the account used in Manufacturing Order - */ - public void setP_OutsideProcessing_Acct (int P_OutsideProcessing_Acct); - - /** Get Outside Processing. - * The Outside Processing Account is the account used in Manufacturing Order - */ - public int getP_OutsideProcessing_Acct(); - - public I_C_ValidCombination getP_OutsideProcessing_A() throws RuntimeException; - - /** Column name P_Overhead_Acct */ - public static final String COLUMNNAME_P_Overhead_Acct = "P_Overhead_Acct"; - - /** Set Overhead. - * The Overhead account is the account used in Manufacturing Order - */ - public void setP_Overhead_Acct (int P_Overhead_Acct); - - /** Get Overhead. - * The Overhead account is the account used in Manufacturing Order - */ - public int getP_Overhead_Acct(); - - public I_C_ValidCombination getP_Overhead_A() throws RuntimeException; - /** Column name P_PurchasePriceVariance_Acct */ public static final String COLUMNNAME_P_PurchasePriceVariance_Acct = "P_PurchasePriceVariance_Acct"; @@ -844,21 +574,6 @@ public interface I_C_AcctSchema_Default /** Get Process Now */ public boolean isProcessing(); - /** Column name P_Scrap_Acct */ - public static final String COLUMNNAME_P_Scrap_Acct = "P_Scrap_Acct"; - - /** Set Scrap. - * The Scrap account is the account used in Manufacturing Order - */ - public void setP_Scrap_Acct (int P_Scrap_Acct); - - /** Get Scrap. - * The Scrap account is the account used in Manufacturing Order - */ - public int getP_Scrap_Acct(); - - public I_C_ValidCombination getP_Scrap_A() throws RuntimeException; - /** Column name P_TradeDiscountGrant_Acct */ public static final String COLUMNNAME_P_TradeDiscountGrant_Acct = "P_TradeDiscountGrant_Acct"; @@ -889,36 +604,6 @@ public interface I_C_AcctSchema_Default public I_C_ValidCombination getP_TradeDiscountRec_A() throws RuntimeException; - /** Column name P_UsageVariance_Acct */ - public static final String COLUMNNAME_P_UsageVariance_Acct = "P_UsageVariance_Acct"; - - /** Set Usage Variance. - * The Usage Variance account is the account used Manufacturing Order - */ - public void setP_UsageVariance_Acct (int P_UsageVariance_Acct); - - /** Get Usage Variance. - * The Usage Variance account is the account used Manufacturing Order - */ - public int getP_UsageVariance_Acct(); - - public I_C_ValidCombination getP_UsageVariance_A() throws RuntimeException; - - /** Column name P_WIP_Acct */ - public static final String COLUMNNAME_P_WIP_Acct = "P_WIP_Acct"; - - /** Set Work In Process. - * The Work in Process account is the account used Manufacturing Order - */ - public void setP_WIP_Acct (int P_WIP_Acct); - - /** Get Work In Process. - * The Work in Process account is the account used Manufacturing Order - */ - public int getP_WIP_Acct(); - - public I_C_ValidCombination getP_WIP_A() throws RuntimeException; - /** Column name RealizedGain_Acct */ public static final String COLUMNNAME_RealizedGain_Acct = "RealizedGain_Acct"; @@ -994,36 +679,6 @@ public interface I_C_AcctSchema_Default public I_C_ValidCombination getT_Expense_A() throws RuntimeException; - /** Column name T_Liability_Acct */ - public static final String COLUMNNAME_T_Liability_Acct = "T_Liability_Acct"; - - /** Set Tax Liability. - * Account for Tax declaration liability - */ - public void setT_Liability_Acct (int T_Liability_Acct); - - /** Get Tax Liability. - * Account for Tax declaration liability - */ - public int getT_Liability_Acct(); - - public I_C_ValidCombination getT_Liability_A() throws RuntimeException; - - /** Column name T_Receivables_Acct */ - public static final String COLUMNNAME_T_Receivables_Acct = "T_Receivables_Acct"; - - /** Set Tax Receivables. - * Account for Tax credit after tax declaration - */ - public void setT_Receivables_Acct (int T_Receivables_Acct); - - /** Get Tax Receivables. - * Account for Tax credit after tax declaration - */ - public int getT_Receivables_Acct(); - - public I_C_ValidCombination getT_Receivables_A() throws RuntimeException; - /** Column name UnEarnedRevenue_Acct */ public static final String COLUMNNAME_UnEarnedRevenue_Acct = "UnEarnedRevenue_Acct"; @@ -1145,66 +800,6 @@ public interface I_C_AcctSchema_Default public I_C_ValidCombination getW_Differences_A() throws RuntimeException; - /** Column name W_InvActualAdjust_Acct */ - public static final String COLUMNNAME_W_InvActualAdjust_Acct = "W_InvActualAdjust_Acct"; - - /** Set Inventory Adjustment. - * Account for Inventory value adjustments for Actual Costing - */ - public void setW_InvActualAdjust_Acct (int W_InvActualAdjust_Acct); - - /** Get Inventory Adjustment. - * Account for Inventory value adjustments for Actual Costing - */ - public int getW_InvActualAdjust_Acct(); - - public I_C_ValidCombination getW_InvActualAdjust_A() throws RuntimeException; - - /** Column name W_Inventory_Acct */ - public static final String COLUMNNAME_W_Inventory_Acct = "W_Inventory_Acct"; - - /** Set (Not Used). - * Warehouse Inventory Asset Account - Currently not used - */ - public void setW_Inventory_Acct (int W_Inventory_Acct); - - /** Get (Not Used). - * Warehouse Inventory Asset Account - Currently not used - */ - public int getW_Inventory_Acct(); - - public I_C_ValidCombination getW_Inventory_A() throws RuntimeException; - - /** Column name Withholding_Acct */ - public static final String COLUMNNAME_Withholding_Acct = "Withholding_Acct"; - - /** Set Withholding. - * Account for Withholdings - */ - public void setWithholding_Acct (int Withholding_Acct); - - /** Get Withholding. - * Account for Withholdings - */ - public int getWithholding_Acct(); - - public I_C_ValidCombination getWithholding_A() throws RuntimeException; - - /** Column name W_Revaluation_Acct */ - public static final String COLUMNNAME_W_Revaluation_Acct = "W_Revaluation_Acct"; - - /** Set Inventory Revaluation. - * Account for Inventory Revaluation - */ - public void setW_Revaluation_Acct (int W_Revaluation_Acct); - - /** Get Inventory Revaluation. - * Account for Inventory Revaluation - */ - public int getW_Revaluation_Acct(); - - public I_C_ValidCombination getW_Revaluation_A() throws RuntimeException; - /** Column name WriteOff_Acct */ public static final String COLUMNNAME_WriteOff_Acct = "WriteOff_Acct"; diff --git a/org.adempiere.base/src/org/compiere/model/I_C_AcctSchema_GL.java b/org.adempiere.base/src/org/compiere/model/I_C_AcctSchema_GL.java index a989f4228d..02b9784dd6 100644 --- a/org.adempiere.base/src/org/compiere/model/I_C_AcctSchema_GL.java +++ b/org.adempiere.base/src/org/compiere/model/I_C_AcctSchema_GL.java @@ -31,11 +31,11 @@ public interface I_C_AcctSchema_GL public static final String Table_Name = "C_AcctSchema_GL"; /** AD_Table_ID=266 */ - public static final int Table_ID = MTable.getTable_ID(Table_Name); + public static final int Table_ID = 266; KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); - /** AccessLevel = 2 - Client + /** AccessLevel = - Client */ BigDecimal accessLevel = BigDecimal.valueOf(2); @@ -62,6 +62,15 @@ public interface I_C_AcctSchema_GL */ public int getAD_Org_ID(); + /** Column name C_AcctSchema_GL_UU */ + public static final String COLUMNNAME_C_AcctSchema_GL_UU = "C_AcctSchema_GL_UU"; + + /** Set C_AcctSchema_GL_UU */ + public void setC_AcctSchema_GL_UU (String C_AcctSchema_GL_UU); + + /** Get C_AcctSchema_GL_UU */ + public String getC_AcctSchema_GL_UU(); + /** Column name C_AcctSchema_ID */ public static final String COLUMNNAME_C_AcctSchema_ID = "C_AcctSchema_ID"; @@ -75,7 +84,7 @@ public interface I_C_AcctSchema_GL */ public int getC_AcctSchema_ID(); - public I_C_AcctSchema getC_AcctSchema() throws RuntimeException; + public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException; /** Column name CommitmentOffset_Acct */ public static final String COLUMNNAME_CommitmentOffset_Acct = "CommitmentOffset_Acct"; @@ -138,21 +147,6 @@ public interface I_C_AcctSchema_GL public I_C_ValidCombination getCurrencyBalancing_A() throws RuntimeException; - /** Column name IncomeSummary_Acct */ - public static final String COLUMNNAME_IncomeSummary_Acct = "IncomeSummary_Acct"; - - /** Set Income Summary Acct. - * Income Summary Account - */ - public void setIncomeSummary_Acct (int IncomeSummary_Acct); - - /** Get Income Summary Acct. - * Income Summary Account - */ - public int getIncomeSummary_Acct(); - - public I_C_ValidCombination getIncomeSummary_A() throws RuntimeException; - /** Column name IntercompanyDueFrom_Acct */ public static final String COLUMNNAME_IntercompanyDueFrom_Acct = "IntercompanyDueFrom_Acct"; @@ -211,17 +205,6 @@ public interface I_C_AcctSchema_GL public I_C_ValidCombination getPPVOffset_A() throws RuntimeException; - /** Column name RetainedEarning_Acct */ - public static final String COLUMNNAME_RetainedEarning_Acct = "RetainedEarning_Acct"; - - /** Set Retained Earning Acct */ - public void setRetainedEarning_Acct (int RetainedEarning_Acct); - - /** Get Retained Earning Acct */ - public int getRetainedEarning_Acct(); - - public I_C_ValidCombination getRetainedEarning_A() throws RuntimeException; - /** Column name SuspenseBalancing_Acct */ public static final String COLUMNNAME_SuspenseBalancing_Acct = "SuspenseBalancing_Acct"; @@ -233,17 +216,6 @@ public interface I_C_AcctSchema_GL public I_C_ValidCombination getSuspenseBalancing_A() throws RuntimeException; - /** Column name SuspenseError_Acct */ - public static final String COLUMNNAME_SuspenseError_Acct = "SuspenseError_Acct"; - - /** Set Suspense Error Acct */ - public void setSuspenseError_Acct (int SuspenseError_Acct); - - /** Get Suspense Error Acct */ - public int getSuspenseError_Acct(); - - public I_C_ValidCombination getSuspenseError_A() throws RuntimeException; - /** Column name Updated */ public static final String COLUMNNAME_Updated = "Updated"; diff --git a/org.adempiere.base/src/org/compiere/model/I_C_BP_Employee_Acct.java b/org.adempiere.base/src/org/compiere/model/I_C_BP_Employee_Acct.java index 2f06d88403..ccb98f5fbf 100644 --- a/org.adempiere.base/src/org/compiere/model/I_C_BP_Employee_Acct.java +++ b/org.adempiere.base/src/org/compiere/model/I_C_BP_Employee_Acct.java @@ -31,11 +31,11 @@ public interface I_C_BP_Employee_Acct public static final String Table_Name = "C_BP_Employee_Acct"; /** AD_Table_ID=184 */ - public static final int Table_ID = MTable.getTable_ID(Table_Name); + public static final int Table_ID = 184; KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); - /** AccessLevel = 3 - Client - Org + /** AccessLevel = - Client - Org */ BigDecimal accessLevel = BigDecimal.valueOf(3); @@ -75,7 +75,7 @@ public interface I_C_BP_Employee_Acct */ public int getC_AcctSchema_ID(); - public I_C_AcctSchema getC_AcctSchema() throws RuntimeException; + public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException; /** Column name C_BPartner_ID */ public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID"; @@ -90,7 +90,16 @@ public interface I_C_BP_Employee_Acct */ public int getC_BPartner_ID(); - public I_C_BPartner getC_BPartner() throws RuntimeException; + public org.compiere.model.I_C_BPartner getC_BPartner() throws RuntimeException; + + /** Column name C_BP_Employee_Acct_UU */ + public static final String COLUMNNAME_C_BP_Employee_Acct_UU = "C_BP_Employee_Acct_UU"; + + /** Set C_BP_Employee_Acct_UU */ + public void setC_BP_Employee_Acct_UU (String C_BP_Employee_Acct_UU); + + /** Get C_BP_Employee_Acct_UU */ + public String getC_BP_Employee_Acct_UU(); /** Column name Created */ public static final String COLUMNNAME_Created = "Created"; @@ -108,36 +117,6 @@ public interface I_C_BP_Employee_Acct */ public int getCreatedBy(); - /** Column name E_Expense_Acct */ - public static final String COLUMNNAME_E_Expense_Acct = "E_Expense_Acct"; - - /** Set Employee Expense. - * Account for Employee Expenses - */ - public void setE_Expense_Acct (int E_Expense_Acct); - - /** Get Employee Expense. - * Account for Employee Expenses - */ - public int getE_Expense_Acct(); - - public I_C_ValidCombination getE_Expense_A() throws RuntimeException; - - /** Column name E_Prepayment_Acct */ - public static final String COLUMNNAME_E_Prepayment_Acct = "E_Prepayment_Acct"; - - /** Set Employee Prepayment. - * Account for Employee Expense Prepayments - */ - public void setE_Prepayment_Acct (int E_Prepayment_Acct); - - /** Get Employee Prepayment. - * Account for Employee Expense Prepayments - */ - public int getE_Prepayment_Acct(); - - public I_C_ValidCombination getE_Prepayment_A() throws RuntimeException; - /** Column name IsActive */ public static final String COLUMNNAME_IsActive = "IsActive"; diff --git a/org.adempiere.base/src/org/compiere/model/I_C_BP_Group_Acct.java b/org.adempiere.base/src/org/compiere/model/I_C_BP_Group_Acct.java index ef91291393..929e0a7fd9 100644 --- a/org.adempiere.base/src/org/compiere/model/I_C_BP_Group_Acct.java +++ b/org.adempiere.base/src/org/compiere/model/I_C_BP_Group_Acct.java @@ -31,11 +31,11 @@ public interface I_C_BP_Group_Acct public static final String Table_Name = "C_BP_Group_Acct"; /** AD_Table_ID=395 */ - public static final int Table_ID = MTable.getTable_ID(Table_Name); + public static final int Table_ID = 395; KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); - /** AccessLevel = 3 - Client - Org + /** AccessLevel = - Client - Org */ BigDecimal accessLevel = BigDecimal.valueOf(3); @@ -75,7 +75,16 @@ public interface I_C_BP_Group_Acct */ public int getC_AcctSchema_ID(); - public I_C_AcctSchema getC_AcctSchema() throws RuntimeException; + public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException; + + /** Column name C_BP_Group_Acct_UU */ + public static final String COLUMNNAME_C_BP_Group_Acct_UU = "C_BP_Group_Acct_UU"; + + /** Set C_BP_Group_Acct_UU */ + public void setC_BP_Group_Acct_UU (String C_BP_Group_Acct_UU); + + /** Get C_BP_Group_Acct_UU */ + public String getC_BP_Group_Acct_UU(); /** Column name C_BP_Group_ID */ public static final String COLUMNNAME_C_BP_Group_ID = "C_BP_Group_ID"; @@ -90,7 +99,7 @@ public interface I_C_BP_Group_Acct */ public int getC_BP_Group_ID(); - public I_C_BP_Group getC_BP_Group() throws RuntimeException; + public org.compiere.model.I_C_BP_Group getC_BP_Group() throws RuntimeException; /** Column name C_Prepayment_Acct */ public static final String COLUMNNAME_C_Prepayment_Acct = "C_Prepayment_Acct"; @@ -181,36 +190,6 @@ public interface I_C_BP_Group_Acct public I_C_ValidCombination getNotInvoicedReceipts_A() throws RuntimeException; - /** Column name NotInvoicedReceivables_Acct */ - public static final String COLUMNNAME_NotInvoicedReceivables_Acct = "NotInvoicedReceivables_Acct"; - - /** Set Not-invoiced Receivables. - * Account for not invoiced Receivables - */ - public void setNotInvoicedReceivables_Acct (int NotInvoicedReceivables_Acct); - - /** Get Not-invoiced Receivables. - * Account for not invoiced Receivables - */ - public int getNotInvoicedReceivables_Acct(); - - public I_C_ValidCombination getNotInvoicedReceivables_A() throws RuntimeException; - - /** Column name NotInvoicedRevenue_Acct */ - public static final String COLUMNNAME_NotInvoicedRevenue_Acct = "NotInvoicedRevenue_Acct"; - - /** Set Not-invoiced Revenue. - * Account for not invoiced Revenue - */ - public void setNotInvoicedRevenue_Acct (int NotInvoicedRevenue_Acct); - - /** Get Not-invoiced Revenue. - * Account for not invoiced Revenue - */ - public int getNotInvoicedRevenue_Acct(); - - public I_C_ValidCombination getNotInvoicedRevenue_A() throws RuntimeException; - /** Column name PayDiscount_Exp_Acct */ public static final String COLUMNNAME_PayDiscount_Exp_Acct = "PayDiscount_Exp_Acct"; diff --git a/org.adempiere.base/src/org/compiere/model/I_C_BankAccount_Acct.java b/org.adempiere.base/src/org/compiere/model/I_C_BankAccount_Acct.java index 56d0bf87c8..eac085b167 100644 --- a/org.adempiere.base/src/org/compiere/model/I_C_BankAccount_Acct.java +++ b/org.adempiere.base/src/org/compiere/model/I_C_BankAccount_Acct.java @@ -31,11 +31,11 @@ public interface I_C_BankAccount_Acct public static final String Table_Name = "C_BankAccount_Acct"; /** AD_Table_ID=391 */ - public static final int Table_ID = MTable.getTable_ID(Table_Name); + public static final int Table_ID = 391; KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); - /** AccessLevel = 3 - Client - Org + /** AccessLevel = - Client - Org */ BigDecimal accessLevel = BigDecimal.valueOf(3); @@ -77,21 +77,6 @@ public interface I_C_BankAccount_Acct public I_C_ValidCombination getB_Asset_A() throws RuntimeException; - /** Column name B_Expense_Acct */ - public static final String COLUMNNAME_B_Expense_Acct = "B_Expense_Acct"; - - /** Set Bank Expense. - * Bank Expense Account - */ - public void setB_Expense_Acct (int B_Expense_Acct); - - /** Get Bank Expense. - * Bank Expense Account - */ - public int getB_Expense_Acct(); - - public I_C_ValidCombination getB_Expense_A() throws RuntimeException; - /** Column name B_InterestExp_Acct */ public static final String COLUMNNAME_B_InterestExp_Acct = "B_InterestExp_Acct"; @@ -152,66 +137,6 @@ public interface I_C_BankAccount_Acct public I_C_ValidCombination getB_PaymentSelect_A() throws RuntimeException; - /** Column name B_RevaluationGain_Acct */ - public static final String COLUMNNAME_B_RevaluationGain_Acct = "B_RevaluationGain_Acct"; - - /** Set Bank Revaluation Gain. - * Bank Revaluation Gain Account - */ - public void setB_RevaluationGain_Acct (int B_RevaluationGain_Acct); - - /** Get Bank Revaluation Gain. - * Bank Revaluation Gain Account - */ - public int getB_RevaluationGain_Acct(); - - public I_C_ValidCombination getB_RevaluationGain_A() throws RuntimeException; - - /** Column name B_RevaluationLoss_Acct */ - public static final String COLUMNNAME_B_RevaluationLoss_Acct = "B_RevaluationLoss_Acct"; - - /** Set Bank Revaluation Loss. - * Bank Revaluation Loss Account - */ - public void setB_RevaluationLoss_Acct (int B_RevaluationLoss_Acct); - - /** Get Bank Revaluation Loss. - * Bank Revaluation Loss Account - */ - public int getB_RevaluationLoss_Acct(); - - public I_C_ValidCombination getB_RevaluationLoss_A() throws RuntimeException; - - /** Column name B_SettlementGain_Acct */ - public static final String COLUMNNAME_B_SettlementGain_Acct = "B_SettlementGain_Acct"; - - /** Set Bank Settlement Gain. - * Bank Settlement Gain Account - */ - public void setB_SettlementGain_Acct (int B_SettlementGain_Acct); - - /** Get Bank Settlement Gain. - * Bank Settlement Gain Account - */ - public int getB_SettlementGain_Acct(); - - public I_C_ValidCombination getB_SettlementGain_A() throws RuntimeException; - - /** Column name B_SettlementLoss_Acct */ - public static final String COLUMNNAME_B_SettlementLoss_Acct = "B_SettlementLoss_Acct"; - - /** Set Bank Settlement Loss. - * Bank Settlement Loss Account - */ - public void setB_SettlementLoss_Acct (int B_SettlementLoss_Acct); - - /** Get Bank Settlement Loss. - * Bank Settlement Loss Account - */ - public int getB_SettlementLoss_Acct(); - - public I_C_ValidCombination getB_SettlementLoss_A() throws RuntimeException; - /** Column name B_UnallocatedCash_Acct */ public static final String COLUMNNAME_B_UnallocatedCash_Acct = "B_UnallocatedCash_Acct"; @@ -227,21 +152,6 @@ public interface I_C_BankAccount_Acct public I_C_ValidCombination getB_UnallocatedCash_A() throws RuntimeException; - /** Column name B_Unidentified_Acct */ - public static final String COLUMNNAME_B_Unidentified_Acct = "B_Unidentified_Acct"; - - /** Set Bank Unidentified Receipts. - * Bank Unidentified Receipts Account - */ - public void setB_Unidentified_Acct (int B_Unidentified_Acct); - - /** Get Bank Unidentified Receipts. - * Bank Unidentified Receipts Account - */ - public int getB_Unidentified_Acct(); - - public I_C_ValidCombination getB_Unidentified_A() throws RuntimeException; - /** Column name C_AcctSchema_ID */ public static final String COLUMNNAME_C_AcctSchema_ID = "C_AcctSchema_ID"; @@ -255,7 +165,16 @@ public interface I_C_BankAccount_Acct */ public int getC_AcctSchema_ID(); - public I_C_AcctSchema getC_AcctSchema() throws RuntimeException; + public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException; + + /** Column name C_BankAccount_Acct_UU */ + public static final String COLUMNNAME_C_BankAccount_Acct_UU = "C_BankAccount_Acct_UU"; + + /** Set C_BankAccount_Acct_UU */ + public void setC_BankAccount_Acct_UU (String C_BankAccount_Acct_UU); + + /** Get C_BankAccount_Acct_UU */ + public String getC_BankAccount_Acct_UU(); /** Column name C_BankAccount_ID */ public static final String COLUMNNAME_C_BankAccount_ID = "C_BankAccount_ID"; @@ -270,7 +189,7 @@ public interface I_C_BankAccount_Acct */ public int getC_BankAccount_ID(); - public I_C_BankAccount getC_BankAccount() throws RuntimeException; + public org.compiere.model.I_C_BankAccount getC_BankAccount() throws RuntimeException; /** Column name Created */ public static final String COLUMNNAME_Created = "Created"; diff --git a/org.adempiere.base/src/org/compiere/model/I_C_Currency_Acct.java b/org.adempiere.base/src/org/compiere/model/I_C_Currency_Acct.java index a2e2a523a1..b0b18865a4 100644 --- a/org.adempiere.base/src/org/compiere/model/I_C_Currency_Acct.java +++ b/org.adempiere.base/src/org/compiere/model/I_C_Currency_Acct.java @@ -31,11 +31,11 @@ public interface I_C_Currency_Acct public static final String Table_Name = "C_Currency_Acct"; /** AD_Table_ID=638 */ - public static final int Table_ID = MTable.getTable_ID(Table_Name); + public static final int Table_ID = 638; KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); - /** AccessLevel = 3 - Client - Org + /** AccessLevel = - Client - Org */ BigDecimal accessLevel = BigDecimal.valueOf(3); @@ -75,7 +75,16 @@ public interface I_C_Currency_Acct */ public int getC_AcctSchema_ID(); - public I_C_AcctSchema getC_AcctSchema() throws RuntimeException; + public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException; + + /** Column name C_Currency_Acct_UU */ + public static final String COLUMNNAME_C_Currency_Acct_UU = "C_Currency_Acct_UU"; + + /** Set C_Currency_Acct_UU */ + public void setC_Currency_Acct_UU (String C_Currency_Acct_UU); + + /** Get C_Currency_Acct_UU */ + public String getC_Currency_Acct_UU(); /** Column name C_Currency_ID */ public static final String COLUMNNAME_C_Currency_ID = "C_Currency_ID"; @@ -90,7 +99,7 @@ public interface I_C_Currency_Acct */ public int getC_Currency_ID(); - public I_C_Currency getC_Currency() throws RuntimeException; + public org.compiere.model.I_C_Currency getC_Currency() throws RuntimeException; /** Column name Created */ public static final String COLUMNNAME_Created = "Created"; @@ -121,66 +130,6 @@ public interface I_C_Currency_Acct */ public boolean isActive(); - /** Column name RealizedGain_Acct */ - public static final String COLUMNNAME_RealizedGain_Acct = "RealizedGain_Acct"; - - /** Set Realized Gain Acct. - * Realized Gain Account - */ - public void setRealizedGain_Acct (int RealizedGain_Acct); - - /** Get Realized Gain Acct. - * Realized Gain Account - */ - public int getRealizedGain_Acct(); - - public I_C_ValidCombination getRealizedGain_A() throws RuntimeException; - - /** Column name RealizedLoss_Acct */ - public static final String COLUMNNAME_RealizedLoss_Acct = "RealizedLoss_Acct"; - - /** Set Realized Loss Acct. - * Realized Loss Account - */ - public void setRealizedLoss_Acct (int RealizedLoss_Acct); - - /** Get Realized Loss Acct. - * Realized Loss Account - */ - public int getRealizedLoss_Acct(); - - public I_C_ValidCombination getRealizedLoss_A() throws RuntimeException; - - /** Column name UnrealizedGain_Acct */ - public static final String COLUMNNAME_UnrealizedGain_Acct = "UnrealizedGain_Acct"; - - /** Set Unrealized Gain Acct. - * Unrealized Gain Account for currency revaluation - */ - public void setUnrealizedGain_Acct (int UnrealizedGain_Acct); - - /** Get Unrealized Gain Acct. - * Unrealized Gain Account for currency revaluation - */ - public int getUnrealizedGain_Acct(); - - public I_C_ValidCombination getUnrealizedGain_A() throws RuntimeException; - - /** Column name UnrealizedLoss_Acct */ - public static final String COLUMNNAME_UnrealizedLoss_Acct = "UnrealizedLoss_Acct"; - - /** Set Unrealized Loss Acct. - * Unrealized Loss Account for currency revaluation - */ - public void setUnrealizedLoss_Acct (int UnrealizedLoss_Acct); - - /** Get Unrealized Loss Acct. - * Unrealized Loss Account for currency revaluation - */ - public int getUnrealizedLoss_Acct(); - - public I_C_ValidCombination getUnrealizedLoss_A() throws RuntimeException; - /** Column name Updated */ public static final String COLUMNNAME_Updated = "Updated"; diff --git a/org.adempiere.base/src/org/compiere/model/I_C_Tax_Acct.java b/org.adempiere.base/src/org/compiere/model/I_C_Tax_Acct.java index 203f525027..fe731ac0b7 100644 --- a/org.adempiere.base/src/org/compiere/model/I_C_Tax_Acct.java +++ b/org.adempiere.base/src/org/compiere/model/I_C_Tax_Acct.java @@ -31,11 +31,11 @@ public interface I_C_Tax_Acct public static final String Table_Name = "C_Tax_Acct"; /** AD_Table_ID=399 */ - public static final int Table_ID = MTable.getTable_ID(Table_Name); + public static final int Table_ID = 399; KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); - /** AccessLevel = 3 - Client - Org + /** AccessLevel = - Client - Org */ BigDecimal accessLevel = BigDecimal.valueOf(3); @@ -75,7 +75,7 @@ public interface I_C_Tax_Acct */ public int getC_AcctSchema_ID(); - public I_C_AcctSchema getC_AcctSchema() throws RuntimeException; + public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException; /** Column name Created */ public static final String COLUMNNAME_Created = "Created"; @@ -93,6 +93,15 @@ public interface I_C_Tax_Acct */ public int getCreatedBy(); + /** Column name C_Tax_Acct_UU */ + public static final String COLUMNNAME_C_Tax_Acct_UU = "C_Tax_Acct_UU"; + + /** Set C_Tax_Acct_UU */ + public void setC_Tax_Acct_UU (String C_Tax_Acct_UU); + + /** Get C_Tax_Acct_UU */ + public String getC_Tax_Acct_UU(); + /** Column name C_Tax_ID */ public static final String COLUMNNAME_C_Tax_ID = "C_Tax_ID"; @@ -106,7 +115,7 @@ public interface I_C_Tax_Acct */ public int getC_Tax_ID(); - public I_C_Tax getC_Tax() throws RuntimeException; + public org.compiere.model.I_C_Tax getC_Tax() throws RuntimeException; /** Column name IsActive */ public static final String COLUMNNAME_IsActive = "IsActive"; @@ -166,36 +175,6 @@ public interface I_C_Tax_Acct public I_C_ValidCombination getT_Expense_A() throws RuntimeException; - /** Column name T_Liability_Acct */ - public static final String COLUMNNAME_T_Liability_Acct = "T_Liability_Acct"; - - /** Set Tax Liability. - * Account for Tax declaration liability - */ - public void setT_Liability_Acct (int T_Liability_Acct); - - /** Get Tax Liability. - * Account for Tax declaration liability - */ - public int getT_Liability_Acct(); - - public I_C_ValidCombination getT_Liability_A() throws RuntimeException; - - /** Column name T_Receivables_Acct */ - public static final String COLUMNNAME_T_Receivables_Acct = "T_Receivables_Acct"; - - /** Set Tax Receivables. - * Account for Tax credit after tax declaration - */ - public void setT_Receivables_Acct (int T_Receivables_Acct); - - /** Get Tax Receivables. - * Account for Tax credit after tax declaration - */ - public int getT_Receivables_Acct(); - - public I_C_ValidCombination getT_Receivables_A() throws RuntimeException; - /** Column name Updated */ public static final String COLUMNNAME_Updated = "Updated"; diff --git a/org.adempiere.base/src/org/compiere/model/I_M_Product_Acct.java b/org.adempiere.base/src/org/compiere/model/I_M_Product_Acct.java index a54b140ff9..affb5e75e1 100644 --- a/org.adempiere.base/src/org/compiere/model/I_M_Product_Acct.java +++ b/org.adempiere.base/src/org/compiere/model/I_M_Product_Acct.java @@ -31,11 +31,11 @@ public interface I_M_Product_Acct public static final String Table_Name = "M_Product_Acct"; /** AD_Table_ID=273 */ - public static final int Table_ID = MTable.getTable_ID(Table_Name); + public static final int Table_ID = 273; KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); - /** AccessLevel = 3 - Client - Org + /** AccessLevel = - Client - Org */ BigDecimal accessLevel = BigDecimal.valueOf(3); @@ -75,7 +75,7 @@ public interface I_M_Product_Acct */ public int getC_AcctSchema_ID(); - public I_C_AcctSchema getC_AcctSchema() throws RuntimeException; + public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException; /** Column name Created */ public static final String COLUMNNAME_Created = "Created"; @@ -106,6 +106,15 @@ public interface I_M_Product_Acct */ public boolean isActive(); + /** Column name M_Product_Acct_UU */ + public static final String COLUMNNAME_M_Product_Acct_UU = "M_Product_Acct_UU"; + + /** Set M_Product_Acct_UU */ + public void setM_Product_Acct_UU (String M_Product_Acct_UU); + + /** Get M_Product_Acct_UU */ + public String getM_Product_Acct_UU(); + /** Column name M_Product_ID */ public static final String COLUMNNAME_M_Product_ID = "M_Product_ID"; @@ -119,7 +128,7 @@ public interface I_M_Product_Acct */ public int getM_Product_ID(); - public I_M_Product getM_Product() throws RuntimeException; + public org.compiere.model.I_M_Product getM_Product() throws RuntimeException; /** Column name P_Asset_Acct */ public static final String COLUMNNAME_P_Asset_Acct = "P_Asset_Acct"; @@ -151,21 +160,6 @@ public interface I_M_Product_Acct public I_C_ValidCombination getP_AverageCostVariance_A() throws RuntimeException; - /** Column name P_Burden_Acct */ - public static final String COLUMNNAME_P_Burden_Acct = "P_Burden_Acct"; - - /** Set Burden. - * The Burden account is the account used Manufacturing Order - */ - public void setP_Burden_Acct (int P_Burden_Acct); - - /** Get Burden. - * The Burden account is the account used Manufacturing Order - */ - public int getP_Burden_Acct(); - - public I_C_ValidCombination getP_Burden_A() throws RuntimeException; - /** Column name P_COGS_Acct */ public static final String COLUMNNAME_P_COGS_Acct = "P_COGS_Acct"; @@ -196,21 +190,6 @@ public interface I_M_Product_Acct public I_C_ValidCombination getP_CostAdjustment_A() throws RuntimeException; - /** Column name P_CostOfProduction_Acct */ - public static final String COLUMNNAME_P_CostOfProduction_Acct = "P_CostOfProduction_Acct"; - - /** Set Cost Of Production. - * The Cost Of Production account is the account used Manufacturing Order - */ - public void setP_CostOfProduction_Acct (int P_CostOfProduction_Acct); - - /** Get Cost Of Production. - * The Cost Of Production account is the account used Manufacturing Order - */ - public int getP_CostOfProduction_Acct(); - - public I_C_ValidCombination getP_CostOfProduction_A() throws RuntimeException; - /** Column name P_Expense_Acct */ public static final String COLUMNNAME_P_Expense_Acct = "P_Expense_Acct"; @@ -226,21 +205,6 @@ public interface I_M_Product_Acct public I_C_ValidCombination getP_Expense_A() throws RuntimeException; - /** Column name P_FloorStock_Acct */ - public static final String COLUMNNAME_P_FloorStock_Acct = "P_FloorStock_Acct"; - - /** Set Floor Stock. - * The Floor Stock account is the account used Manufacturing Order - */ - public void setP_FloorStock_Acct (int P_FloorStock_Acct); - - /** Get Floor Stock. - * The Floor Stock account is the account used Manufacturing Order - */ - public int getP_FloorStock_Acct(); - - public I_C_ValidCombination getP_FloorStock_A() throws RuntimeException; - /** Column name P_InventoryClearing_Acct */ public static final String COLUMNNAME_P_InventoryClearing_Acct = "P_InventoryClearing_Acct"; @@ -271,81 +235,6 @@ public interface I_M_Product_Acct public I_C_ValidCombination getP_InvoicePriceVariance_A() throws RuntimeException; - /** Column name P_Labor_Acct */ - public static final String COLUMNNAME_P_Labor_Acct = "P_Labor_Acct"; - - /** Set Labor. - * The Labor account is the account used Manufacturing Order - */ - public void setP_Labor_Acct (int P_Labor_Acct); - - /** Get Labor. - * The Labor account is the account used Manufacturing Order - */ - public int getP_Labor_Acct(); - - public I_C_ValidCombination getP_Labor_A() throws RuntimeException; - - /** Column name P_MethodChangeVariance_Acct */ - public static final String COLUMNNAME_P_MethodChangeVariance_Acct = "P_MethodChangeVariance_Acct"; - - /** Set Method Change Variance. - * The Method Change Variance account is the account used Manufacturing Order - */ - public void setP_MethodChangeVariance_Acct (int P_MethodChangeVariance_Acct); - - /** Get Method Change Variance. - * The Method Change Variance account is the account used Manufacturing Order - */ - public int getP_MethodChangeVariance_Acct(); - - public I_C_ValidCombination getP_MethodChangeVariance_A() throws RuntimeException; - - /** Column name P_MixVariance_Acct */ - public static final String COLUMNNAME_P_MixVariance_Acct = "P_MixVariance_Acct"; - - /** Set Mix Variance. - * The Mix Variance account is the account used Manufacturing Order - */ - public void setP_MixVariance_Acct (int P_MixVariance_Acct); - - /** Get Mix Variance. - * The Mix Variance account is the account used Manufacturing Order - */ - public int getP_MixVariance_Acct(); - - public I_C_ValidCombination getP_MixVariance_A() throws RuntimeException; - - /** Column name P_OutsideProcessing_Acct */ - public static final String COLUMNNAME_P_OutsideProcessing_Acct = "P_OutsideProcessing_Acct"; - - /** Set Outside Processing. - * The Outside Processing Account is the account used in Manufacturing Order - */ - public void setP_OutsideProcessing_Acct (int P_OutsideProcessing_Acct); - - /** Get Outside Processing. - * The Outside Processing Account is the account used in Manufacturing Order - */ - public int getP_OutsideProcessing_Acct(); - - public I_C_ValidCombination getP_OutsideProcessing_A() throws RuntimeException; - - /** Column name P_Overhead_Acct */ - public static final String COLUMNNAME_P_Overhead_Acct = "P_Overhead_Acct"; - - /** Set Overhead. - * The Overhead account is the account used in Manufacturing Order - */ - public void setP_Overhead_Acct (int P_Overhead_Acct); - - /** Get Overhead. - * The Overhead account is the account used in Manufacturing Order - */ - public int getP_Overhead_Acct(); - - public I_C_ValidCombination getP_Overhead_A() throws RuntimeException; - /** Column name P_PurchasePriceVariance_Acct */ public static final String COLUMNNAME_P_PurchasePriceVariance_Acct = "P_PurchasePriceVariance_Acct"; @@ -391,21 +280,6 @@ public interface I_M_Product_Acct public I_C_ValidCombination getP_Revenue_A() throws RuntimeException; - /** Column name P_Scrap_Acct */ - public static final String COLUMNNAME_P_Scrap_Acct = "P_Scrap_Acct"; - - /** Set Scrap. - * The Scrap account is the account used in Manufacturing Order - */ - public void setP_Scrap_Acct (int P_Scrap_Acct); - - /** Get Scrap. - * The Scrap account is the account used in Manufacturing Order - */ - public int getP_Scrap_Acct(); - - public I_C_ValidCombination getP_Scrap_A() throws RuntimeException; - /** Column name P_TradeDiscountGrant_Acct */ public static final String COLUMNNAME_P_TradeDiscountGrant_Acct = "P_TradeDiscountGrant_Acct"; @@ -436,36 +310,6 @@ public interface I_M_Product_Acct public I_C_ValidCombination getP_TradeDiscountRec_A() throws RuntimeException; - /** Column name P_UsageVariance_Acct */ - public static final String COLUMNNAME_P_UsageVariance_Acct = "P_UsageVariance_Acct"; - - /** Set Usage Variance. - * The Usage Variance account is the account used Manufacturing Order - */ - public void setP_UsageVariance_Acct (int P_UsageVariance_Acct); - - /** Get Usage Variance. - * The Usage Variance account is the account used Manufacturing Order - */ - public int getP_UsageVariance_Acct(); - - public I_C_ValidCombination getP_UsageVariance_A() throws RuntimeException; - - /** Column name P_WIP_Acct */ - public static final String COLUMNNAME_P_WIP_Acct = "P_WIP_Acct"; - - /** Set Work In Process. - * The Work in Process account is the account used Manufacturing Order - */ - public void setP_WIP_Acct (int P_WIP_Acct); - - /** Get Work In Process. - * The Work in Process account is the account used Manufacturing Order - */ - public int getP_WIP_Acct(); - - public I_C_ValidCombination getP_WIP_A() throws RuntimeException; - /** Column name Updated */ public static final String COLUMNNAME_Updated = "Updated"; diff --git a/org.adempiere.base/src/org/compiere/model/I_M_Product_Category_Acct.java b/org.adempiere.base/src/org/compiere/model/I_M_Product_Category_Acct.java index 29b7f9a807..37bf89c489 100644 --- a/org.adempiere.base/src/org/compiere/model/I_M_Product_Category_Acct.java +++ b/org.adempiere.base/src/org/compiere/model/I_M_Product_Category_Acct.java @@ -31,11 +31,11 @@ public interface I_M_Product_Category_Acct public static final String Table_Name = "M_Product_Category_Acct"; /** AD_Table_ID=401 */ - public static final int Table_ID = MTable.getTable_ID(Table_Name); + public static final int Table_ID = 401; KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); - /** AccessLevel = 3 - Client - Org + /** AccessLevel = - Client - Org */ BigDecimal accessLevel = BigDecimal.valueOf(3); @@ -75,7 +75,7 @@ public interface I_M_Product_Category_Acct */ public int getC_AcctSchema_ID(); - public I_C_AcctSchema getC_AcctSchema() throws RuntimeException; + public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException; /** Column name CostingLevel */ public static final String COLUMNNAME_CostingLevel = "CostingLevel"; @@ -132,6 +132,15 @@ public interface I_M_Product_Category_Acct */ public boolean isActive(); + /** Column name M_Product_Category_Acct_UU */ + public static final String COLUMNNAME_M_Product_Category_Acct_UU = "M_Product_Category_Acct_UU"; + + /** Set M_Product_Category_Acct_UU */ + public void setM_Product_Category_Acct_UU (String M_Product_Category_Acct_UU); + + /** Get M_Product_Category_Acct_UU */ + public String getM_Product_Category_Acct_UU(); + /** Column name M_Product_Category_ID */ public static final String COLUMNNAME_M_Product_Category_ID = "M_Product_Category_ID"; @@ -145,7 +154,7 @@ public interface I_M_Product_Category_Acct */ public int getM_Product_Category_ID(); - public I_M_Product_Category getM_Product_Category() throws RuntimeException; + public org.compiere.model.I_M_Product_Category getM_Product_Category() throws RuntimeException; /** Column name P_Asset_Acct */ public static final String COLUMNNAME_P_Asset_Acct = "P_Asset_Acct"; @@ -177,21 +186,6 @@ public interface I_M_Product_Category_Acct public I_C_ValidCombination getP_AverageCostVariance_A() throws RuntimeException; - /** Column name P_Burden_Acct */ - public static final String COLUMNNAME_P_Burden_Acct = "P_Burden_Acct"; - - /** Set Burden. - * The Burden account is the account used Manufacturing Order - */ - public void setP_Burden_Acct (int P_Burden_Acct); - - /** Get Burden. - * The Burden account is the account used Manufacturing Order - */ - public int getP_Burden_Acct(); - - public I_C_ValidCombination getP_Burden_A() throws RuntimeException; - /** Column name P_COGS_Acct */ public static final String COLUMNNAME_P_COGS_Acct = "P_COGS_Acct"; @@ -222,21 +216,6 @@ public interface I_M_Product_Category_Acct public I_C_ValidCombination getP_CostAdjustment_A() throws RuntimeException; - /** Column name P_CostOfProduction_Acct */ - public static final String COLUMNNAME_P_CostOfProduction_Acct = "P_CostOfProduction_Acct"; - - /** Set Cost Of Production. - * The Cost Of Production account is the account used Manufacturing Order - */ - public void setP_CostOfProduction_Acct (int P_CostOfProduction_Acct); - - /** Get Cost Of Production. - * The Cost Of Production account is the account used Manufacturing Order - */ - public int getP_CostOfProduction_Acct(); - - public I_C_ValidCombination getP_CostOfProduction_A() throws RuntimeException; - /** Column name P_Expense_Acct */ public static final String COLUMNNAME_P_Expense_Acct = "P_Expense_Acct"; @@ -252,21 +231,6 @@ public interface I_M_Product_Category_Acct public I_C_ValidCombination getP_Expense_A() throws RuntimeException; - /** Column name P_FloorStock_Acct */ - public static final String COLUMNNAME_P_FloorStock_Acct = "P_FloorStock_Acct"; - - /** Set Floor Stock. - * The Floor Stock account is the account used Manufacturing Order - */ - public void setP_FloorStock_Acct (int P_FloorStock_Acct); - - /** Get Floor Stock. - * The Floor Stock account is the account used Manufacturing Order - */ - public int getP_FloorStock_Acct(); - - public I_C_ValidCombination getP_FloorStock_A() throws RuntimeException; - /** Column name P_InventoryClearing_Acct */ public static final String COLUMNNAME_P_InventoryClearing_Acct = "P_InventoryClearing_Acct"; @@ -297,81 +261,6 @@ public interface I_M_Product_Category_Acct public I_C_ValidCombination getP_InvoicePriceVariance_A() throws RuntimeException; - /** Column name P_Labor_Acct */ - public static final String COLUMNNAME_P_Labor_Acct = "P_Labor_Acct"; - - /** Set Labor. - * The Labor account is the account used Manufacturing Order - */ - public void setP_Labor_Acct (int P_Labor_Acct); - - /** Get Labor. - * The Labor account is the account used Manufacturing Order - */ - public int getP_Labor_Acct(); - - public I_C_ValidCombination getP_Labor_A() throws RuntimeException; - - /** Column name P_MethodChangeVariance_Acct */ - public static final String COLUMNNAME_P_MethodChangeVariance_Acct = "P_MethodChangeVariance_Acct"; - - /** Set Method Change Variance. - * The Method Change Variance account is the account used Manufacturing Order - */ - public void setP_MethodChangeVariance_Acct (int P_MethodChangeVariance_Acct); - - /** Get Method Change Variance. - * The Method Change Variance account is the account used Manufacturing Order - */ - public int getP_MethodChangeVariance_Acct(); - - public I_C_ValidCombination getP_MethodChangeVariance_A() throws RuntimeException; - - /** Column name P_MixVariance_Acct */ - public static final String COLUMNNAME_P_MixVariance_Acct = "P_MixVariance_Acct"; - - /** Set Mix Variance. - * The Mix Variance account is the account used Manufacturing Order - */ - public void setP_MixVariance_Acct (int P_MixVariance_Acct); - - /** Get Mix Variance. - * The Mix Variance account is the account used Manufacturing Order - */ - public int getP_MixVariance_Acct(); - - public I_C_ValidCombination getP_MixVariance_A() throws RuntimeException; - - /** Column name P_OutsideProcessing_Acct */ - public static final String COLUMNNAME_P_OutsideProcessing_Acct = "P_OutsideProcessing_Acct"; - - /** Set Outside Processing. - * The Outside Processing Account is the account used in Manufacturing Order - */ - public void setP_OutsideProcessing_Acct (int P_OutsideProcessing_Acct); - - /** Get Outside Processing. - * The Outside Processing Account is the account used in Manufacturing Order - */ - public int getP_OutsideProcessing_Acct(); - - public I_C_ValidCombination getP_OutsideProcessing_A() throws RuntimeException; - - /** Column name P_Overhead_Acct */ - public static final String COLUMNNAME_P_Overhead_Acct = "P_Overhead_Acct"; - - /** Set Overhead. - * The Overhead account is the account used in Manufacturing Order - */ - public void setP_Overhead_Acct (int P_Overhead_Acct); - - /** Get Overhead. - * The Overhead account is the account used in Manufacturing Order - */ - public int getP_Overhead_Acct(); - - public I_C_ValidCombination getP_Overhead_A() throws RuntimeException; - /** Column name P_PurchasePriceVariance_Acct */ public static final String COLUMNNAME_P_PurchasePriceVariance_Acct = "P_PurchasePriceVariance_Acct"; @@ -426,21 +315,6 @@ public interface I_M_Product_Category_Acct /** Get Process Now */ public boolean isProcessing(); - /** Column name P_Scrap_Acct */ - public static final String COLUMNNAME_P_Scrap_Acct = "P_Scrap_Acct"; - - /** Set Scrap. - * The Scrap account is the account used in Manufacturing Order - */ - public void setP_Scrap_Acct (int P_Scrap_Acct); - - /** Get Scrap. - * The Scrap account is the account used in Manufacturing Order - */ - public int getP_Scrap_Acct(); - - public I_C_ValidCombination getP_Scrap_A() throws RuntimeException; - /** Column name P_TradeDiscountGrant_Acct */ public static final String COLUMNNAME_P_TradeDiscountGrant_Acct = "P_TradeDiscountGrant_Acct"; @@ -471,36 +345,6 @@ public interface I_M_Product_Category_Acct public I_C_ValidCombination getP_TradeDiscountRec_A() throws RuntimeException; - /** Column name P_UsageVariance_Acct */ - public static final String COLUMNNAME_P_UsageVariance_Acct = "P_UsageVariance_Acct"; - - /** Set Usage Variance. - * The Usage Variance account is the account used Manufacturing Order - */ - public void setP_UsageVariance_Acct (int P_UsageVariance_Acct); - - /** Get Usage Variance. - * The Usage Variance account is the account used Manufacturing Order - */ - public int getP_UsageVariance_Acct(); - - public I_C_ValidCombination getP_UsageVariance_A() throws RuntimeException; - - /** Column name P_WIP_Acct */ - public static final String COLUMNNAME_P_WIP_Acct = "P_WIP_Acct"; - - /** Set Work In Process. - * The Work in Process account is the account used Manufacturing Order - */ - public void setP_WIP_Acct (int P_WIP_Acct); - - /** Get Work In Process. - * The Work in Process account is the account used Manufacturing Order - */ - public int getP_WIP_Acct(); - - public I_C_ValidCombination getP_WIP_A() throws RuntimeException; - /** Column name Updated */ public static final String COLUMNNAME_Updated = "Updated"; diff --git a/org.adempiere.base/src/org/compiere/model/I_M_Warehouse_Acct.java b/org.adempiere.base/src/org/compiere/model/I_M_Warehouse_Acct.java index 4b43c0a448..8e1daa9631 100644 --- a/org.adempiere.base/src/org/compiere/model/I_M_Warehouse_Acct.java +++ b/org.adempiere.base/src/org/compiere/model/I_M_Warehouse_Acct.java @@ -31,11 +31,11 @@ public interface I_M_Warehouse_Acct public static final String Table_Name = "M_Warehouse_Acct"; /** AD_Table_ID=191 */ - public static final int Table_ID = MTable.getTable_ID(Table_Name); + public static final int Table_ID = 191; KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); - /** AccessLevel = 3 - Client - Org + /** AccessLevel = - Client - Org */ BigDecimal accessLevel = BigDecimal.valueOf(3); @@ -75,7 +75,7 @@ public interface I_M_Warehouse_Acct */ public int getC_AcctSchema_ID(); - public I_C_AcctSchema getC_AcctSchema() throws RuntimeException; + public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException; /** Column name Created */ public static final String COLUMNNAME_Created = "Created"; @@ -106,6 +106,15 @@ public interface I_M_Warehouse_Acct */ public boolean isActive(); + /** Column name M_Warehouse_Acct_UU */ + public static final String COLUMNNAME_M_Warehouse_Acct_UU = "M_Warehouse_Acct_UU"; + + /** Set M_Warehouse_Acct_UU */ + public void setM_Warehouse_Acct_UU (String M_Warehouse_Acct_UU); + + /** Get M_Warehouse_Acct_UU */ + public String getM_Warehouse_Acct_UU(); + /** Column name M_Warehouse_ID */ public static final String COLUMNNAME_M_Warehouse_ID = "M_Warehouse_ID"; @@ -119,7 +128,7 @@ public interface I_M_Warehouse_Acct */ public int getM_Warehouse_ID(); - public I_M_Warehouse getM_Warehouse() throws RuntimeException; + public org.compiere.model.I_M_Warehouse getM_Warehouse() throws RuntimeException; /** Column name Updated */ public static final String COLUMNNAME_Updated = "Updated"; @@ -151,49 +160,4 @@ public interface I_M_Warehouse_Acct public int getW_Differences_Acct(); public I_C_ValidCombination getW_Differences_A() throws RuntimeException; - - /** Column name W_InvActualAdjust_Acct */ - public static final String COLUMNNAME_W_InvActualAdjust_Acct = "W_InvActualAdjust_Acct"; - - /** Set Inventory Adjustment. - * Account for Inventory value adjustments for Actual Costing - */ - public void setW_InvActualAdjust_Acct (int W_InvActualAdjust_Acct); - - /** Get Inventory Adjustment. - * Account for Inventory value adjustments for Actual Costing - */ - public int getW_InvActualAdjust_Acct(); - - public I_C_ValidCombination getW_InvActualAdjust_A() throws RuntimeException; - - /** Column name W_Inventory_Acct */ - public static final String COLUMNNAME_W_Inventory_Acct = "W_Inventory_Acct"; - - /** Set (Not Used). - * Warehouse Inventory Asset Account - Currently not used - */ - public void setW_Inventory_Acct (int W_Inventory_Acct); - - /** Get (Not Used). - * Warehouse Inventory Asset Account - Currently not used - */ - public int getW_Inventory_Acct(); - - public I_C_ValidCombination getW_Inventory_A() throws RuntimeException; - - /** Column name W_Revaluation_Acct */ - public static final String COLUMNNAME_W_Revaluation_Acct = "W_Revaluation_Acct"; - - /** Set Inventory Revaluation. - * Account for Inventory Revaluation - */ - public void setW_Revaluation_Acct (int W_Revaluation_Acct); - - /** Get Inventory Revaluation. - * Account for Inventory Revaluation - */ - public int getW_Revaluation_Acct(); - - public I_C_ValidCombination getW_Revaluation_A() throws RuntimeException; } diff --git a/org.adempiere.base/src/org/compiere/model/MAcctSchemaDefault.java b/org.adempiere.base/src/org/compiere/model/MAcctSchemaDefault.java index c5aec04768..5927a786e7 100644 --- a/org.adempiere.base/src/org/compiere/model/MAcctSchemaDefault.java +++ b/org.adempiere.base/src/org/compiere/model/MAcctSchemaDefault.java @@ -84,26 +84,31 @@ public class MAcctSchemaDefault extends X_C_AcctSchema_Default * @param C_Currency_ID currency * @return gain acct */ - public int getRealizedGain_Acct (int C_Currency_ID) - { - MCurrencyAcct acct = MCurrencyAcct.get (this, C_Currency_ID); - if (acct != null) - return acct.getRealizedGain_Acct(); - return super.getRealizedGain_Acct(); - } // getRealizedGain_Acct +// IDEMPIERE-362 Hide things that don't work on iDempiere + +// public int getRealizedGain_Acct (int C_Currency_ID) +// { +// MCurrencyAcct acct = MCurrencyAcct.get (this, C_Currency_ID); +// if (acct != null) +// return acct.getRealizedGain_Acct(); +// return super.getRealizedGain_Acct(); +// } // getRealizedGain_Acct /** * Get Realized Loss Acct for currency * @param C_Currency_ID currency * @return loss acct */ - public int getRealizedLoss_Acct (int C_Currency_ID) - { - MCurrencyAcct acct = MCurrencyAcct.get (this, C_Currency_ID); - if (acct != null) - return acct.getRealizedLoss_Acct(); - return super.getRealizedLoss_Acct(); - } // getRealizedLoss_Acct + +// IDEMPIERE-362 Hide things that don't work on iDempiere + +// public int getRealizedLoss_Acct (int C_Currency_ID) +// { +// MCurrencyAcct acct = MCurrencyAcct.get (this, C_Currency_ID); +// if (acct != null) +// return acct.getRealizedLoss_Acct(); +// return super.getRealizedLoss_Acct(); +// } // getRealizedLoss_Acct /** * Get Acct Info list diff --git a/org.adempiere.base/src/org/compiere/model/X_C_AcctSchema_Default.java b/org.adempiere.base/src/org/compiere/model/X_C_AcctSchema_Default.java index 1e7bce2396..7ca91ce8ef 100644 --- a/org.adempiere.base/src/org/compiere/model/X_C_AcctSchema_Default.java +++ b/org.adempiere.base/src/org/compiere/model/X_C_AcctSchema_Default.java @@ -30,7 +30,7 @@ public class X_C_AcctSchema_Default extends PO implements I_C_AcctSchema_Default /** * */ - private static final long serialVersionUID = 20120817L; + private static final long serialVersionUID = 20120928L; /** Standard Constructor */ public X_C_AcctSchema_Default (Properties ctx, int C_AcctSchema_Default_ID, String trxName) @@ -39,17 +39,11 @@ public class X_C_AcctSchema_Default extends PO implements I_C_AcctSchema_Default /** if (C_AcctSchema_Default_ID == 0) { setB_Asset_Acct (0); - setB_Expense_Acct (0); setB_InterestExp_Acct (0); setB_InterestRev_Acct (0); setB_InTransit_Acct (0); setB_PaymentSelect_Acct (0); - setB_RevaluationGain_Acct (0); - setB_RevaluationLoss_Acct (0); - setB_SettlementGain_Acct (0); - setB_SettlementLoss_Acct (0); setB_UnallocatedCash_Acct (0); - setB_Unidentified_Acct (0); setC_AcctSchema_ID (0); setCB_Asset_Acct (0); setCB_CashTransfer_Acct (0); @@ -60,44 +54,27 @@ public class X_C_AcctSchema_Default extends PO implements I_C_AcctSchema_Default setC_Prepayment_Acct (0); setC_Receivable_Acct (0); setC_Receivable_Services_Acct (0); - setE_Expense_Acct (0); - setE_Prepayment_Acct (0); setNotInvoicedReceipts_Acct (0); - setNotInvoicedReceivables_Acct (0); - setNotInvoicedRevenue_Acct (0); setP_Asset_Acct (0); setPayDiscount_Exp_Acct (0); setPayDiscount_Rev_Acct (0); - setP_Burden_Acct (0); setP_COGS_Acct (0); setP_CostAdjustment_Acct (0); - setP_CostOfProduction_Acct (0); setP_Expense_Acct (0); - setP_FloorStock_Acct (0); setP_InventoryClearing_Acct (0); setP_InvoicePriceVariance_Acct (0); setPJ_Asset_Acct (0); setPJ_WIP_Acct (0); - setP_Labor_Acct (0); - setP_MethodChangeVariance_Acct (0); - setP_MixVariance_Acct (0); - setP_OutsideProcessing_Acct (0); - setP_Overhead_Acct (0); setP_PurchasePriceVariance_Acct (0); setP_RateVariance_Acct (0); setP_Revenue_Acct (0); - setP_Scrap_Acct (0); setP_TradeDiscountGrant_Acct (0); setP_TradeDiscountRec_Acct (0); - setP_UsageVariance_Acct (0); - setP_WIP_Acct (0); setRealizedGain_Acct (0); setRealizedLoss_Acct (0); setT_Credit_Acct (0); setT_Due_Acct (0); setT_Expense_Acct (0); - setT_Liability_Acct (0); - setT_Receivables_Acct (0); setUnEarnedRevenue_Acct (0); setUnrealizedGain_Acct (0); setUnrealizedLoss_Acct (0); @@ -105,10 +82,6 @@ public class X_C_AcctSchema_Default extends PO implements I_C_AcctSchema_Default setV_Liability_Services_Acct (0); setV_Prepayment_Acct (0); setW_Differences_Acct (0); - setW_InvActualAdjust_Acct (0); - setW_Inventory_Acct (0); - setWithholding_Acct (0); - setW_Revaluation_Acct (0); setWriteOff_Acct (0); } */ } @@ -166,31 +139,6 @@ public class X_C_AcctSchema_Default extends PO implements I_C_AcctSchema_Default return ii.intValue(); } - public I_C_ValidCombination getB_Expense_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getB_Expense_Acct(), get_TrxName()); } - - /** Set Bank Expense. - @param B_Expense_Acct - Bank Expense Account - */ - public void setB_Expense_Acct (int B_Expense_Acct) - { - set_Value (COLUMNNAME_B_Expense_Acct, Integer.valueOf(B_Expense_Acct)); - } - - /** Get Bank Expense. - @return Bank Expense Account - */ - public int getB_Expense_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_B_Expense_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - public I_C_ValidCombination getB_InterestExp_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) @@ -291,106 +239,6 @@ public class X_C_AcctSchema_Default extends PO implements I_C_AcctSchema_Default return ii.intValue(); } - public I_C_ValidCombination getB_RevaluationGain_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getB_RevaluationGain_Acct(), get_TrxName()); } - - /** Set Bank Revaluation Gain. - @param B_RevaluationGain_Acct - Bank Revaluation Gain Account - */ - public void setB_RevaluationGain_Acct (int B_RevaluationGain_Acct) - { - set_Value (COLUMNNAME_B_RevaluationGain_Acct, Integer.valueOf(B_RevaluationGain_Acct)); - } - - /** Get Bank Revaluation Gain. - @return Bank Revaluation Gain Account - */ - public int getB_RevaluationGain_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_B_RevaluationGain_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getB_RevaluationLoss_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getB_RevaluationLoss_Acct(), get_TrxName()); } - - /** Set Bank Revaluation Loss. - @param B_RevaluationLoss_Acct - Bank Revaluation Loss Account - */ - public void setB_RevaluationLoss_Acct (int B_RevaluationLoss_Acct) - { - set_Value (COLUMNNAME_B_RevaluationLoss_Acct, Integer.valueOf(B_RevaluationLoss_Acct)); - } - - /** Get Bank Revaluation Loss. - @return Bank Revaluation Loss Account - */ - public int getB_RevaluationLoss_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_B_RevaluationLoss_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getB_SettlementGain_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getB_SettlementGain_Acct(), get_TrxName()); } - - /** Set Bank Settlement Gain. - @param B_SettlementGain_Acct - Bank Settlement Gain Account - */ - public void setB_SettlementGain_Acct (int B_SettlementGain_Acct) - { - set_Value (COLUMNNAME_B_SettlementGain_Acct, Integer.valueOf(B_SettlementGain_Acct)); - } - - /** Get Bank Settlement Gain. - @return Bank Settlement Gain Account - */ - public int getB_SettlementGain_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_B_SettlementGain_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getB_SettlementLoss_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getB_SettlementLoss_Acct(), get_TrxName()); } - - /** Set Bank Settlement Loss. - @param B_SettlementLoss_Acct - Bank Settlement Loss Account - */ - public void setB_SettlementLoss_Acct (int B_SettlementLoss_Acct) - { - set_Value (COLUMNNAME_B_SettlementLoss_Acct, Integer.valueOf(B_SettlementLoss_Acct)); - } - - /** Get Bank Settlement Loss. - @return Bank Settlement Loss Account - */ - public int getB_SettlementLoss_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_B_SettlementLoss_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - public I_C_ValidCombination getB_UnallocatedCash_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) @@ -416,31 +264,6 @@ public class X_C_AcctSchema_Default extends PO implements I_C_AcctSchema_Default return ii.intValue(); } - public I_C_ValidCombination getB_Unidentified_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getB_Unidentified_Acct(), get_TrxName()); } - - /** Set Bank Unidentified Receipts. - @param B_Unidentified_Acct - Bank Unidentified Receipts Account - */ - public void setB_Unidentified_Acct (int B_Unidentified_Acct) - { - set_Value (COLUMNNAME_B_Unidentified_Acct, Integer.valueOf(B_Unidentified_Acct)); - } - - /** Get Bank Unidentified Receipts. - @return Bank Unidentified Receipts Account - */ - public int getB_Unidentified_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_B_Unidentified_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - /** Set C_AcctSchema_Default_UU. @param C_AcctSchema_Default_UU C_AcctSchema_Default_UU */ public void setC_AcctSchema_Default_UU (String C_AcctSchema_Default_UU) @@ -716,56 +539,6 @@ public class X_C_AcctSchema_Default extends PO implements I_C_AcctSchema_Default return ii.intValue(); } - public I_C_ValidCombination getE_Expense_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getE_Expense_Acct(), get_TrxName()); } - - /** Set Employee Expense. - @param E_Expense_Acct - Account for Employee Expenses - */ - public void setE_Expense_Acct (int E_Expense_Acct) - { - set_Value (COLUMNNAME_E_Expense_Acct, Integer.valueOf(E_Expense_Acct)); - } - - /** Get Employee Expense. - @return Account for Employee Expenses - */ - public int getE_Expense_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_E_Expense_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getE_Prepayment_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getE_Prepayment_Acct(), get_TrxName()); } - - /** Set Employee Prepayment. - @param E_Prepayment_Acct - Account for Employee Expense Prepayments - */ - public void setE_Prepayment_Acct (int E_Prepayment_Acct) - { - set_Value (COLUMNNAME_E_Prepayment_Acct, Integer.valueOf(E_Prepayment_Acct)); - } - - /** Get Employee Prepayment. - @return Account for Employee Expense Prepayments - */ - public int getE_Prepayment_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_E_Prepayment_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - public I_C_ValidCombination getNotInvoicedReceipts_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) @@ -791,56 +564,6 @@ public class X_C_AcctSchema_Default extends PO implements I_C_AcctSchema_Default return ii.intValue(); } - public I_C_ValidCombination getNotInvoicedReceivables_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getNotInvoicedReceivables_Acct(), get_TrxName()); } - - /** Set Not-invoiced Receivables. - @param NotInvoicedReceivables_Acct - Account for not invoiced Receivables - */ - public void setNotInvoicedReceivables_Acct (int NotInvoicedReceivables_Acct) - { - set_Value (COLUMNNAME_NotInvoicedReceivables_Acct, Integer.valueOf(NotInvoicedReceivables_Acct)); - } - - /** Get Not-invoiced Receivables. - @return Account for not invoiced Receivables - */ - public int getNotInvoicedReceivables_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_NotInvoicedReceivables_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getNotInvoicedRevenue_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getNotInvoicedRevenue_Acct(), get_TrxName()); } - - /** Set Not-invoiced Revenue. - @param NotInvoicedRevenue_Acct - Account for not invoiced Revenue - */ - public void setNotInvoicedRevenue_Acct (int NotInvoicedRevenue_Acct) - { - set_Value (COLUMNNAME_NotInvoicedRevenue_Acct, Integer.valueOf(NotInvoicedRevenue_Acct)); - } - - /** Get Not-invoiced Revenue. - @return Account for not invoiced Revenue - */ - public int getNotInvoicedRevenue_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_NotInvoicedRevenue_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - public I_C_ValidCombination getP_Asset_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) @@ -941,31 +664,6 @@ public class X_C_AcctSchema_Default extends PO implements I_C_AcctSchema_Default return ii.intValue(); } - public I_C_ValidCombination getP_Burden_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_Burden_Acct(), get_TrxName()); } - - /** Set Burden. - @param P_Burden_Acct - The Burden account is the account used Manufacturing Order - */ - public void setP_Burden_Acct (int P_Burden_Acct) - { - set_Value (COLUMNNAME_P_Burden_Acct, Integer.valueOf(P_Burden_Acct)); - } - - /** Get Burden. - @return The Burden account is the account used Manufacturing Order - */ - public int getP_Burden_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_Burden_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - public I_C_ValidCombination getP_COGS_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) @@ -1016,31 +714,6 @@ public class X_C_AcctSchema_Default extends PO implements I_C_AcctSchema_Default return ii.intValue(); } - public I_C_ValidCombination getP_CostOfProduction_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_CostOfProduction_Acct(), get_TrxName()); } - - /** Set Cost Of Production. - @param P_CostOfProduction_Acct - The Cost Of Production account is the account used Manufacturing Order - */ - public void setP_CostOfProduction_Acct (int P_CostOfProduction_Acct) - { - set_Value (COLUMNNAME_P_CostOfProduction_Acct, Integer.valueOf(P_CostOfProduction_Acct)); - } - - /** Get Cost Of Production. - @return The Cost Of Production account is the account used Manufacturing Order - */ - public int getP_CostOfProduction_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_CostOfProduction_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - public I_C_ValidCombination getP_Expense_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) @@ -1066,31 +739,6 @@ public class X_C_AcctSchema_Default extends PO implements I_C_AcctSchema_Default return ii.intValue(); } - public I_C_ValidCombination getP_FloorStock_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_FloorStock_Acct(), get_TrxName()); } - - /** Set Floor Stock. - @param P_FloorStock_Acct - The Floor Stock account is the account used Manufacturing Order - */ - public void setP_FloorStock_Acct (int P_FloorStock_Acct) - { - set_Value (COLUMNNAME_P_FloorStock_Acct, Integer.valueOf(P_FloorStock_Acct)); - } - - /** Get Floor Stock. - @return The Floor Stock account is the account used Manufacturing Order - */ - public int getP_FloorStock_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_FloorStock_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - public I_C_ValidCombination getP_InventoryClearing_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) @@ -1191,131 +839,6 @@ public class X_C_AcctSchema_Default extends PO implements I_C_AcctSchema_Default return ii.intValue(); } - public I_C_ValidCombination getP_Labor_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_Labor_Acct(), get_TrxName()); } - - /** Set Labor. - @param P_Labor_Acct - The Labor account is the account used Manufacturing Order - */ - public void setP_Labor_Acct (int P_Labor_Acct) - { - set_Value (COLUMNNAME_P_Labor_Acct, Integer.valueOf(P_Labor_Acct)); - } - - /** Get Labor. - @return The Labor account is the account used Manufacturing Order - */ - public int getP_Labor_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_Labor_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getP_MethodChangeVariance_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_MethodChangeVariance_Acct(), get_TrxName()); } - - /** Set Method Change Variance. - @param P_MethodChangeVariance_Acct - The Method Change Variance account is the account used Manufacturing Order - */ - public void setP_MethodChangeVariance_Acct (int P_MethodChangeVariance_Acct) - { - set_Value (COLUMNNAME_P_MethodChangeVariance_Acct, Integer.valueOf(P_MethodChangeVariance_Acct)); - } - - /** Get Method Change Variance. - @return The Method Change Variance account is the account used Manufacturing Order - */ - public int getP_MethodChangeVariance_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_MethodChangeVariance_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getP_MixVariance_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_MixVariance_Acct(), get_TrxName()); } - - /** Set Mix Variance. - @param P_MixVariance_Acct - The Mix Variance account is the account used Manufacturing Order - */ - public void setP_MixVariance_Acct (int P_MixVariance_Acct) - { - set_Value (COLUMNNAME_P_MixVariance_Acct, Integer.valueOf(P_MixVariance_Acct)); - } - - /** Get Mix Variance. - @return The Mix Variance account is the account used Manufacturing Order - */ - public int getP_MixVariance_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_MixVariance_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getP_OutsideProcessing_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_OutsideProcessing_Acct(), get_TrxName()); } - - /** Set Outside Processing. - @param P_OutsideProcessing_Acct - The Outside Processing Account is the account used in Manufacturing Order - */ - public void setP_OutsideProcessing_Acct (int P_OutsideProcessing_Acct) - { - set_Value (COLUMNNAME_P_OutsideProcessing_Acct, Integer.valueOf(P_OutsideProcessing_Acct)); - } - - /** Get Outside Processing. - @return The Outside Processing Account is the account used in Manufacturing Order - */ - public int getP_OutsideProcessing_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_OutsideProcessing_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getP_Overhead_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_Overhead_Acct(), get_TrxName()); } - - /** Set Overhead. - @param P_Overhead_Acct - The Overhead account is the account used in Manufacturing Order - */ - public void setP_Overhead_Acct (int P_Overhead_Acct) - { - set_Value (COLUMNNAME_P_Overhead_Acct, Integer.valueOf(P_Overhead_Acct)); - } - - /** Get Overhead. - @return The Overhead account is the account used in Manufacturing Order - */ - public int getP_Overhead_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_Overhead_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - public I_C_ValidCombination getP_PurchasePriceVariance_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) @@ -1412,31 +935,6 @@ public class X_C_AcctSchema_Default extends PO implements I_C_AcctSchema_Default return false; } - public I_C_ValidCombination getP_Scrap_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_Scrap_Acct(), get_TrxName()); } - - /** Set Scrap. - @param P_Scrap_Acct - The Scrap account is the account used in Manufacturing Order - */ - public void setP_Scrap_Acct (int P_Scrap_Acct) - { - set_Value (COLUMNNAME_P_Scrap_Acct, Integer.valueOf(P_Scrap_Acct)); - } - - /** Get Scrap. - @return The Scrap account is the account used in Manufacturing Order - */ - public int getP_Scrap_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_Scrap_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - public I_C_ValidCombination getP_TradeDiscountGrant_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) @@ -1487,56 +985,6 @@ public class X_C_AcctSchema_Default extends PO implements I_C_AcctSchema_Default return ii.intValue(); } - public I_C_ValidCombination getP_UsageVariance_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_UsageVariance_Acct(), get_TrxName()); } - - /** Set Usage Variance. - @param P_UsageVariance_Acct - The Usage Variance account is the account used Manufacturing Order - */ - public void setP_UsageVariance_Acct (int P_UsageVariance_Acct) - { - set_Value (COLUMNNAME_P_UsageVariance_Acct, Integer.valueOf(P_UsageVariance_Acct)); - } - - /** Get Usage Variance. - @return The Usage Variance account is the account used Manufacturing Order - */ - public int getP_UsageVariance_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_UsageVariance_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getP_WIP_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_WIP_Acct(), get_TrxName()); } - - /** Set Work In Process. - @param P_WIP_Acct - The Work in Process account is the account used Manufacturing Order - */ - public void setP_WIP_Acct (int P_WIP_Acct) - { - set_Value (COLUMNNAME_P_WIP_Acct, Integer.valueOf(P_WIP_Acct)); - } - - /** Get Work In Process. - @return The Work in Process account is the account used Manufacturing Order - */ - public int getP_WIP_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_WIP_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - public I_C_ValidCombination getRealizedGain_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) @@ -1662,56 +1110,6 @@ public class X_C_AcctSchema_Default extends PO implements I_C_AcctSchema_Default return ii.intValue(); } - public I_C_ValidCombination getT_Liability_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getT_Liability_Acct(), get_TrxName()); } - - /** Set Tax Liability. - @param T_Liability_Acct - Account for Tax declaration liability - */ - public void setT_Liability_Acct (int T_Liability_Acct) - { - set_Value (COLUMNNAME_T_Liability_Acct, Integer.valueOf(T_Liability_Acct)); - } - - /** Get Tax Liability. - @return Account for Tax declaration liability - */ - public int getT_Liability_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_T_Liability_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getT_Receivables_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getT_Receivables_Acct(), get_TrxName()); } - - /** Set Tax Receivables. - @param T_Receivables_Acct - Account for Tax credit after tax declaration - */ - public void setT_Receivables_Acct (int T_Receivables_Acct) - { - set_Value (COLUMNNAME_T_Receivables_Acct, Integer.valueOf(T_Receivables_Acct)); - } - - /** Get Tax Receivables. - @return Account for Tax credit after tax declaration - */ - public int getT_Receivables_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_T_Receivables_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - public I_C_ValidCombination getUnEarnedRevenue_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) @@ -1887,106 +1285,6 @@ public class X_C_AcctSchema_Default extends PO implements I_C_AcctSchema_Default return ii.intValue(); } - public I_C_ValidCombination getW_InvActualAdjust_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getW_InvActualAdjust_Acct(), get_TrxName()); } - - /** Set Inventory Adjustment. - @param W_InvActualAdjust_Acct - Account for Inventory value adjustments for Actual Costing - */ - public void setW_InvActualAdjust_Acct (int W_InvActualAdjust_Acct) - { - set_Value (COLUMNNAME_W_InvActualAdjust_Acct, Integer.valueOf(W_InvActualAdjust_Acct)); - } - - /** Get Inventory Adjustment. - @return Account for Inventory value adjustments for Actual Costing - */ - public int getW_InvActualAdjust_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_W_InvActualAdjust_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getW_Inventory_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getW_Inventory_Acct(), get_TrxName()); } - - /** Set (Not Used). - @param W_Inventory_Acct - Warehouse Inventory Asset Account - Currently not used - */ - public void setW_Inventory_Acct (int W_Inventory_Acct) - { - set_Value (COLUMNNAME_W_Inventory_Acct, Integer.valueOf(W_Inventory_Acct)); - } - - /** Get (Not Used). - @return Warehouse Inventory Asset Account - Currently not used - */ - public int getW_Inventory_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_W_Inventory_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getWithholding_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getWithholding_Acct(), get_TrxName()); } - - /** Set Withholding. - @param Withholding_Acct - Account for Withholdings - */ - public void setWithholding_Acct (int Withholding_Acct) - { - set_Value (COLUMNNAME_Withholding_Acct, Integer.valueOf(Withholding_Acct)); - } - - /** Get Withholding. - @return Account for Withholdings - */ - public int getWithholding_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_Withholding_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getW_Revaluation_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getW_Revaluation_Acct(), get_TrxName()); } - - /** Set Inventory Revaluation. - @param W_Revaluation_Acct - Account for Inventory Revaluation - */ - public void setW_Revaluation_Acct (int W_Revaluation_Acct) - { - set_Value (COLUMNNAME_W_Revaluation_Acct, Integer.valueOf(W_Revaluation_Acct)); - } - - /** Get Inventory Revaluation. - @return Account for Inventory Revaluation - */ - public int getW_Revaluation_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_W_Revaluation_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - public I_C_ValidCombination getWriteOff_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) diff --git a/org.adempiere.base/src/org/compiere/model/X_C_AcctSchema_GL.java b/org.adempiere.base/src/org/compiere/model/X_C_AcctSchema_GL.java index d2b2d8429c..313b353a1a 100644 --- a/org.adempiere.base/src/org/compiere/model/X_C_AcctSchema_GL.java +++ b/org.adempiere.base/src/org/compiere/model/X_C_AcctSchema_GL.java @@ -30,7 +30,7 @@ public class X_C_AcctSchema_GL extends PO implements I_C_AcctSchema_GL, I_Persis /** * */ - private static final long serialVersionUID = 20100614L; + private static final long serialVersionUID = 20120928L; /** Standard Constructor */ public X_C_AcctSchema_GL (Properties ctx, int C_AcctSchema_GL_ID, String trxName) @@ -41,11 +41,9 @@ public class X_C_AcctSchema_GL extends PO implements I_C_AcctSchema_GL, I_Persis setC_AcctSchema_ID (0); setCommitmentOffset_Acct (0); setCommitmentOffsetSales_Acct (0); - setIncomeSummary_Acct (0); setIntercompanyDueFrom_Acct (0); setIntercompanyDueTo_Acct (0); setPPVOffset_Acct (0); - setRetainedEarning_Acct (0); setUseCurrencyBalancing (false); setUseSuspenseBalancing (false); setUseSuspenseError (false); @@ -80,9 +78,23 @@ public class X_C_AcctSchema_GL extends PO implements I_C_AcctSchema_GL, I_Persis return sb.toString(); } - public I_C_AcctSchema getC_AcctSchema() throws RuntimeException + /** Set C_AcctSchema_GL_UU. + @param C_AcctSchema_GL_UU C_AcctSchema_GL_UU */ + public void setC_AcctSchema_GL_UU (String C_AcctSchema_GL_UU) + { + set_Value (COLUMNNAME_C_AcctSchema_GL_UU, C_AcctSchema_GL_UU); + } + + /** Get C_AcctSchema_GL_UU. + @return C_AcctSchema_GL_UU */ + public String getC_AcctSchema_GL_UU () + { + return (String)get_Value(COLUMNNAME_C_AcctSchema_GL_UU); + } + + public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException { - return (I_C_AcctSchema)MTable.get(getCtx(), I_C_AcctSchema.Table_Name) + return (org.compiere.model.I_C_AcctSchema)MTable.get(getCtx(), org.compiere.model.I_C_AcctSchema.Table_Name) .getPO(getC_AcctSchema_ID(), get_TrxName()); } /** Set Accounting Schema. @@ -191,31 +203,6 @@ public class X_C_AcctSchema_GL extends PO implements I_C_AcctSchema_GL, I_Persis return ii.intValue(); } - public I_C_ValidCombination getIncomeSummary_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getIncomeSummary_Acct(), get_TrxName()); } - - /** Set Income Summary Acct. - @param IncomeSummary_Acct - Income Summary Account - */ - public void setIncomeSummary_Acct (int IncomeSummary_Acct) - { - set_Value (COLUMNNAME_IncomeSummary_Acct, Integer.valueOf(IncomeSummary_Acct)); - } - - /** Get Income Summary Acct. - @return Income Summary Account - */ - public int getIncomeSummary_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_IncomeSummary_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - public I_C_ValidCombination getIntercompanyDueFrom_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) @@ -291,28 +278,6 @@ public class X_C_AcctSchema_GL extends PO implements I_C_AcctSchema_GL, I_Persis return ii.intValue(); } - public I_C_ValidCombination getRetainedEarning_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getRetainedEarning_Acct(), get_TrxName()); } - - /** Set Retained Earning Acct. - @param RetainedEarning_Acct Retained Earning Acct */ - public void setRetainedEarning_Acct (int RetainedEarning_Acct) - { - set_Value (COLUMNNAME_RetainedEarning_Acct, Integer.valueOf(RetainedEarning_Acct)); - } - - /** Get Retained Earning Acct. - @return Retained Earning Acct */ - public int getRetainedEarning_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_RetainedEarning_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - public I_C_ValidCombination getSuspenseBalancing_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) @@ -335,28 +300,6 @@ public class X_C_AcctSchema_GL extends PO implements I_C_AcctSchema_GL, I_Persis return ii.intValue(); } - public I_C_ValidCombination getSuspenseError_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getSuspenseError_Acct(), get_TrxName()); } - - /** Set Suspense Error Acct. - @param SuspenseError_Acct Suspense Error Acct */ - public void setSuspenseError_Acct (int SuspenseError_Acct) - { - set_Value (COLUMNNAME_SuspenseError_Acct, Integer.valueOf(SuspenseError_Acct)); - } - - /** Get Suspense Error Acct. - @return Suspense Error Acct */ - public int getSuspenseError_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_SuspenseError_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - /** Set Use Currency Balancing. @param UseCurrencyBalancing Use Currency Balancing */ public void setUseCurrencyBalancing (boolean UseCurrencyBalancing) diff --git a/org.adempiere.base/src/org/compiere/model/X_C_BP_Employee_Acct.java b/org.adempiere.base/src/org/compiere/model/X_C_BP_Employee_Acct.java index 7db3548b47..72b850df48 100644 --- a/org.adempiere.base/src/org/compiere/model/X_C_BP_Employee_Acct.java +++ b/org.adempiere.base/src/org/compiere/model/X_C_BP_Employee_Acct.java @@ -29,7 +29,7 @@ public class X_C_BP_Employee_Acct extends PO implements I_C_BP_Employee_Acct, I_ /** * */ - private static final long serialVersionUID = 20100614L; + private static final long serialVersionUID = 20120928L; /** Standard Constructor */ public X_C_BP_Employee_Acct (Properties ctx, int C_BP_Employee_Acct_ID, String trxName) @@ -39,8 +39,6 @@ public class X_C_BP_Employee_Acct extends PO implements I_C_BP_Employee_Acct, I_ { setC_AcctSchema_ID (0); setC_BPartner_ID (0); - setE_Expense_Acct (0); - setE_Prepayment_Acct (0); } */ } @@ -72,9 +70,9 @@ public class X_C_BP_Employee_Acct extends PO implements I_C_BP_Employee_Acct, I_ return sb.toString(); } - public I_C_AcctSchema getC_AcctSchema() throws RuntimeException + public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException { - return (I_C_AcctSchema)MTable.get(getCtx(), I_C_AcctSchema.Table_Name) + return (org.compiere.model.I_C_AcctSchema)MTable.get(getCtx(), org.compiere.model.I_C_AcctSchema.Table_Name) .getPO(getC_AcctSchema_ID(), get_TrxName()); } /** Set Accounting Schema. @@ -100,9 +98,9 @@ public class X_C_BP_Employee_Acct extends PO implements I_C_BP_Employee_Acct, I_ return ii.intValue(); } - public I_C_BPartner getC_BPartner() throws RuntimeException + public org.compiere.model.I_C_BPartner getC_BPartner() throws RuntimeException { - return (I_C_BPartner)MTable.get(getCtx(), I_C_BPartner.Table_Name) + return (org.compiere.model.I_C_BPartner)MTable.get(getCtx(), org.compiere.model.I_C_BPartner.Table_Name) .getPO(getC_BPartner_ID(), get_TrxName()); } /** Set Business Partner . @@ -128,53 +126,17 @@ public class X_C_BP_Employee_Acct extends PO implements I_C_BP_Employee_Acct, I_ return ii.intValue(); } - public I_C_ValidCombination getE_Expense_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getE_Expense_Acct(), get_TrxName()); } - - /** Set Employee Expense. - @param E_Expense_Acct - Account for Employee Expenses - */ - public void setE_Expense_Acct (int E_Expense_Acct) + /** Set C_BP_Employee_Acct_UU. + @param C_BP_Employee_Acct_UU C_BP_Employee_Acct_UU */ + public void setC_BP_Employee_Acct_UU (String C_BP_Employee_Acct_UU) { - set_Value (COLUMNNAME_E_Expense_Acct, Integer.valueOf(E_Expense_Acct)); + set_Value (COLUMNNAME_C_BP_Employee_Acct_UU, C_BP_Employee_Acct_UU); } - /** Get Employee Expense. - @return Account for Employee Expenses - */ - public int getE_Expense_Acct () + /** Get C_BP_Employee_Acct_UU. + @return C_BP_Employee_Acct_UU */ + public String getC_BP_Employee_Acct_UU () { - Integer ii = (Integer)get_Value(COLUMNNAME_E_Expense_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getE_Prepayment_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getE_Prepayment_Acct(), get_TrxName()); } - - /** Set Employee Prepayment. - @param E_Prepayment_Acct - Account for Employee Expense Prepayments - */ - public void setE_Prepayment_Acct (int E_Prepayment_Acct) - { - set_Value (COLUMNNAME_E_Prepayment_Acct, Integer.valueOf(E_Prepayment_Acct)); - } - - /** Get Employee Prepayment. - @return Account for Employee Expense Prepayments - */ - public int getE_Prepayment_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_E_Prepayment_Acct); - if (ii == null) - return 0; - return ii.intValue(); + return (String)get_Value(COLUMNNAME_C_BP_Employee_Acct_UU); } } \ No newline at end of file diff --git a/org.adempiere.base/src/org/compiere/model/X_C_BP_Group_Acct.java b/org.adempiere.base/src/org/compiere/model/X_C_BP_Group_Acct.java index 002b3cb905..aacaee6a33 100644 --- a/org.adempiere.base/src/org/compiere/model/X_C_BP_Group_Acct.java +++ b/org.adempiere.base/src/org/compiere/model/X_C_BP_Group_Acct.java @@ -30,7 +30,7 @@ public class X_C_BP_Group_Acct extends PO implements I_C_BP_Group_Acct, I_Persis /** * */ - private static final long serialVersionUID = 20100614L; + private static final long serialVersionUID = 20120928L; /** Standard Constructor */ public X_C_BP_Group_Acct (Properties ctx, int C_BP_Group_Acct_ID, String trxName) @@ -44,8 +44,6 @@ public class X_C_BP_Group_Acct extends PO implements I_C_BP_Group_Acct, I_Persis setC_Receivable_Acct (0); setC_Receivable_Services_Acct (0); setNotInvoicedReceipts_Acct (0); - setNotInvoicedReceivables_Acct (0); - setNotInvoicedRevenue_Acct (0); setPayDiscount_Exp_Acct (0); setPayDiscount_Rev_Acct (0); setUnEarnedRevenue_Acct (0); @@ -84,9 +82,9 @@ public class X_C_BP_Group_Acct extends PO implements I_C_BP_Group_Acct, I_Persis return sb.toString(); } - public I_C_AcctSchema getC_AcctSchema() throws RuntimeException + public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException { - return (I_C_AcctSchema)MTable.get(getCtx(), I_C_AcctSchema.Table_Name) + return (org.compiere.model.I_C_AcctSchema)MTable.get(getCtx(), org.compiere.model.I_C_AcctSchema.Table_Name) .getPO(getC_AcctSchema_ID(), get_TrxName()); } /** Set Accounting Schema. @@ -112,9 +110,23 @@ public class X_C_BP_Group_Acct extends PO implements I_C_BP_Group_Acct, I_Persis return ii.intValue(); } - public I_C_BP_Group getC_BP_Group() throws RuntimeException + /** Set C_BP_Group_Acct_UU. + @param C_BP_Group_Acct_UU C_BP_Group_Acct_UU */ + public void setC_BP_Group_Acct_UU (String C_BP_Group_Acct_UU) + { + set_Value (COLUMNNAME_C_BP_Group_Acct_UU, C_BP_Group_Acct_UU); + } + + /** Get C_BP_Group_Acct_UU. + @return C_BP_Group_Acct_UU */ + public String getC_BP_Group_Acct_UU () + { + return (String)get_Value(COLUMNNAME_C_BP_Group_Acct_UU); + } + + public org.compiere.model.I_C_BP_Group getC_BP_Group() throws RuntimeException { - return (I_C_BP_Group)MTable.get(getCtx(), I_C_BP_Group.Table_Name) + return (org.compiere.model.I_C_BP_Group)MTable.get(getCtx(), org.compiere.model.I_C_BP_Group.Table_Name) .getPO(getC_BP_Group_ID(), get_TrxName()); } /** Set Business Partner Group. @@ -248,56 +260,6 @@ public class X_C_BP_Group_Acct extends PO implements I_C_BP_Group_Acct, I_Persis return ii.intValue(); } - public I_C_ValidCombination getNotInvoicedReceivables_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getNotInvoicedReceivables_Acct(), get_TrxName()); } - - /** Set Not-invoiced Receivables. - @param NotInvoicedReceivables_Acct - Account for not invoiced Receivables - */ - public void setNotInvoicedReceivables_Acct (int NotInvoicedReceivables_Acct) - { - set_Value (COLUMNNAME_NotInvoicedReceivables_Acct, Integer.valueOf(NotInvoicedReceivables_Acct)); - } - - /** Get Not-invoiced Receivables. - @return Account for not invoiced Receivables - */ - public int getNotInvoicedReceivables_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_NotInvoicedReceivables_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getNotInvoicedRevenue_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getNotInvoicedRevenue_Acct(), get_TrxName()); } - - /** Set Not-invoiced Revenue. - @param NotInvoicedRevenue_Acct - Account for not invoiced Revenue - */ - public void setNotInvoicedRevenue_Acct (int NotInvoicedRevenue_Acct) - { - set_Value (COLUMNNAME_NotInvoicedRevenue_Acct, Integer.valueOf(NotInvoicedRevenue_Acct)); - } - - /** Get Not-invoiced Revenue. - @return Account for not invoiced Revenue - */ - public int getNotInvoicedRevenue_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_NotInvoicedRevenue_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - public I_C_ValidCombination getPayDiscount_Exp_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) diff --git a/org.adempiere.base/src/org/compiere/model/X_C_BankAccount_Acct.java b/org.adempiere.base/src/org/compiere/model/X_C_BankAccount_Acct.java index d551748f3b..a0ac41d168 100644 --- a/org.adempiere.base/src/org/compiere/model/X_C_BankAccount_Acct.java +++ b/org.adempiere.base/src/org/compiere/model/X_C_BankAccount_Acct.java @@ -29,7 +29,7 @@ public class X_C_BankAccount_Acct extends PO implements I_C_BankAccount_Acct, I_ /** * */ - private static final long serialVersionUID = 20100614L; + private static final long serialVersionUID = 20120928L; /** Standard Constructor */ public X_C_BankAccount_Acct (Properties ctx, int C_BankAccount_Acct_ID, String trxName) @@ -38,17 +38,11 @@ public class X_C_BankAccount_Acct extends PO implements I_C_BankAccount_Acct, I_ /** if (C_BankAccount_Acct_ID == 0) { setB_Asset_Acct (0); - setB_Expense_Acct (0); setB_InterestExp_Acct (0); setB_InterestRev_Acct (0); setB_InTransit_Acct (0); setB_PaymentSelect_Acct (0); - setB_RevaluationGain_Acct (0); - setB_RevaluationLoss_Acct (0); - setB_SettlementGain_Acct (0); - setB_SettlementLoss_Acct (0); setB_UnallocatedCash_Acct (0); - setB_Unidentified_Acct (0); setC_AcctSchema_ID (0); setC_BankAccount_ID (0); } */ @@ -107,31 +101,6 @@ public class X_C_BankAccount_Acct extends PO implements I_C_BankAccount_Acct, I_ return ii.intValue(); } - public I_C_ValidCombination getB_Expense_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getB_Expense_Acct(), get_TrxName()); } - - /** Set Bank Expense. - @param B_Expense_Acct - Bank Expense Account - */ - public void setB_Expense_Acct (int B_Expense_Acct) - { - set_Value (COLUMNNAME_B_Expense_Acct, Integer.valueOf(B_Expense_Acct)); - } - - /** Get Bank Expense. - @return Bank Expense Account - */ - public int getB_Expense_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_B_Expense_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - public I_C_ValidCombination getB_InterestExp_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) @@ -232,106 +201,6 @@ public class X_C_BankAccount_Acct extends PO implements I_C_BankAccount_Acct, I_ return ii.intValue(); } - public I_C_ValidCombination getB_RevaluationGain_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getB_RevaluationGain_Acct(), get_TrxName()); } - - /** Set Bank Revaluation Gain. - @param B_RevaluationGain_Acct - Bank Revaluation Gain Account - */ - public void setB_RevaluationGain_Acct (int B_RevaluationGain_Acct) - { - set_Value (COLUMNNAME_B_RevaluationGain_Acct, Integer.valueOf(B_RevaluationGain_Acct)); - } - - /** Get Bank Revaluation Gain. - @return Bank Revaluation Gain Account - */ - public int getB_RevaluationGain_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_B_RevaluationGain_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getB_RevaluationLoss_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getB_RevaluationLoss_Acct(), get_TrxName()); } - - /** Set Bank Revaluation Loss. - @param B_RevaluationLoss_Acct - Bank Revaluation Loss Account - */ - public void setB_RevaluationLoss_Acct (int B_RevaluationLoss_Acct) - { - set_Value (COLUMNNAME_B_RevaluationLoss_Acct, Integer.valueOf(B_RevaluationLoss_Acct)); - } - - /** Get Bank Revaluation Loss. - @return Bank Revaluation Loss Account - */ - public int getB_RevaluationLoss_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_B_RevaluationLoss_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getB_SettlementGain_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getB_SettlementGain_Acct(), get_TrxName()); } - - /** Set Bank Settlement Gain. - @param B_SettlementGain_Acct - Bank Settlement Gain Account - */ - public void setB_SettlementGain_Acct (int B_SettlementGain_Acct) - { - set_Value (COLUMNNAME_B_SettlementGain_Acct, Integer.valueOf(B_SettlementGain_Acct)); - } - - /** Get Bank Settlement Gain. - @return Bank Settlement Gain Account - */ - public int getB_SettlementGain_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_B_SettlementGain_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getB_SettlementLoss_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getB_SettlementLoss_Acct(), get_TrxName()); } - - /** Set Bank Settlement Loss. - @param B_SettlementLoss_Acct - Bank Settlement Loss Account - */ - public void setB_SettlementLoss_Acct (int B_SettlementLoss_Acct) - { - set_Value (COLUMNNAME_B_SettlementLoss_Acct, Integer.valueOf(B_SettlementLoss_Acct)); - } - - /** Get Bank Settlement Loss. - @return Bank Settlement Loss Account - */ - public int getB_SettlementLoss_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_B_SettlementLoss_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - public I_C_ValidCombination getB_UnallocatedCash_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) @@ -357,34 +226,9 @@ public class X_C_BankAccount_Acct extends PO implements I_C_BankAccount_Acct, I_ return ii.intValue(); } - public I_C_ValidCombination getB_Unidentified_A() throws RuntimeException + public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getB_Unidentified_Acct(), get_TrxName()); } - - /** Set Bank Unidentified Receipts. - @param B_Unidentified_Acct - Bank Unidentified Receipts Account - */ - public void setB_Unidentified_Acct (int B_Unidentified_Acct) - { - set_Value (COLUMNNAME_B_Unidentified_Acct, Integer.valueOf(B_Unidentified_Acct)); - } - - /** Get Bank Unidentified Receipts. - @return Bank Unidentified Receipts Account - */ - public int getB_Unidentified_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_B_Unidentified_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_AcctSchema getC_AcctSchema() throws RuntimeException - { - return (I_C_AcctSchema)MTable.get(getCtx(), I_C_AcctSchema.Table_Name) + return (org.compiere.model.I_C_AcctSchema)MTable.get(getCtx(), org.compiere.model.I_C_AcctSchema.Table_Name) .getPO(getC_AcctSchema_ID(), get_TrxName()); } /** Set Accounting Schema. @@ -410,9 +254,23 @@ public class X_C_BankAccount_Acct extends PO implements I_C_BankAccount_Acct, I_ return ii.intValue(); } - public I_C_BankAccount getC_BankAccount() throws RuntimeException + /** Set C_BankAccount_Acct_UU. + @param C_BankAccount_Acct_UU C_BankAccount_Acct_UU */ + public void setC_BankAccount_Acct_UU (String C_BankAccount_Acct_UU) + { + set_Value (COLUMNNAME_C_BankAccount_Acct_UU, C_BankAccount_Acct_UU); + } + + /** Get C_BankAccount_Acct_UU. + @return C_BankAccount_Acct_UU */ + public String getC_BankAccount_Acct_UU () + { + return (String)get_Value(COLUMNNAME_C_BankAccount_Acct_UU); + } + + public org.compiere.model.I_C_BankAccount getC_BankAccount() throws RuntimeException { - return (I_C_BankAccount)MTable.get(getCtx(), I_C_BankAccount.Table_Name) + return (org.compiere.model.I_C_BankAccount)MTable.get(getCtx(), org.compiere.model.I_C_BankAccount.Table_Name) .getPO(getC_BankAccount_ID(), get_TrxName()); } /** Set Bank Account. diff --git a/org.adempiere.base/src/org/compiere/model/X_C_Currency_Acct.java b/org.adempiere.base/src/org/compiere/model/X_C_Currency_Acct.java index b470c4f860..be54e29445 100644 --- a/org.adempiere.base/src/org/compiere/model/X_C_Currency_Acct.java +++ b/org.adempiere.base/src/org/compiere/model/X_C_Currency_Acct.java @@ -29,7 +29,7 @@ public class X_C_Currency_Acct extends PO implements I_C_Currency_Acct, I_Persis /** * */ - private static final long serialVersionUID = 20100614L; + private static final long serialVersionUID = 20120928L; /** Standard Constructor */ public X_C_Currency_Acct (Properties ctx, int C_Currency_Acct_ID, String trxName) @@ -39,10 +39,6 @@ public class X_C_Currency_Acct extends PO implements I_C_Currency_Acct, I_Persis { setC_AcctSchema_ID (0); setC_Currency_ID (0); - setRealizedGain_Acct (0); - setRealizedLoss_Acct (0); - setUnrealizedGain_Acct (0); - setUnrealizedLoss_Acct (0); } */ } @@ -74,9 +70,9 @@ public class X_C_Currency_Acct extends PO implements I_C_Currency_Acct, I_Persis return sb.toString(); } - public I_C_AcctSchema getC_AcctSchema() throws RuntimeException + public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException { - return (I_C_AcctSchema)MTable.get(getCtx(), I_C_AcctSchema.Table_Name) + return (org.compiere.model.I_C_AcctSchema)MTable.get(getCtx(), org.compiere.model.I_C_AcctSchema.Table_Name) .getPO(getC_AcctSchema_ID(), get_TrxName()); } /** Set Accounting Schema. @@ -102,9 +98,23 @@ public class X_C_Currency_Acct extends PO implements I_C_Currency_Acct, I_Persis return ii.intValue(); } - public I_C_Currency getC_Currency() throws RuntimeException + /** Set C_Currency_Acct_UU. + @param C_Currency_Acct_UU C_Currency_Acct_UU */ + public void setC_Currency_Acct_UU (String C_Currency_Acct_UU) + { + set_Value (COLUMNNAME_C_Currency_Acct_UU, C_Currency_Acct_UU); + } + + /** Get C_Currency_Acct_UU. + @return C_Currency_Acct_UU */ + public String getC_Currency_Acct_UU () + { + return (String)get_Value(COLUMNNAME_C_Currency_Acct_UU); + } + + public org.compiere.model.I_C_Currency getC_Currency() throws RuntimeException { - return (I_C_Currency)MTable.get(getCtx(), I_C_Currency.Table_Name) + return (org.compiere.model.I_C_Currency)MTable.get(getCtx(), org.compiere.model.I_C_Currency.Table_Name) .getPO(getC_Currency_ID(), get_TrxName()); } /** Set Currency. @@ -129,104 +139,4 @@ public class X_C_Currency_Acct extends PO implements I_C_Currency_Acct, I_Persis return 0; return ii.intValue(); } - - public I_C_ValidCombination getRealizedGain_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getRealizedGain_Acct(), get_TrxName()); } - - /** Set Realized Gain Acct. - @param RealizedGain_Acct - Realized Gain Account - */ - public void setRealizedGain_Acct (int RealizedGain_Acct) - { - set_Value (COLUMNNAME_RealizedGain_Acct, Integer.valueOf(RealizedGain_Acct)); - } - - /** Get Realized Gain Acct. - @return Realized Gain Account - */ - public int getRealizedGain_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_RealizedGain_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getRealizedLoss_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getRealizedLoss_Acct(), get_TrxName()); } - - /** Set Realized Loss Acct. - @param RealizedLoss_Acct - Realized Loss Account - */ - public void setRealizedLoss_Acct (int RealizedLoss_Acct) - { - set_Value (COLUMNNAME_RealizedLoss_Acct, Integer.valueOf(RealizedLoss_Acct)); - } - - /** Get Realized Loss Acct. - @return Realized Loss Account - */ - public int getRealizedLoss_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_RealizedLoss_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getUnrealizedGain_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getUnrealizedGain_Acct(), get_TrxName()); } - - /** Set Unrealized Gain Acct. - @param UnrealizedGain_Acct - Unrealized Gain Account for currency revaluation - */ - public void setUnrealizedGain_Acct (int UnrealizedGain_Acct) - { - set_Value (COLUMNNAME_UnrealizedGain_Acct, Integer.valueOf(UnrealizedGain_Acct)); - } - - /** Get Unrealized Gain Acct. - @return Unrealized Gain Account for currency revaluation - */ - public int getUnrealizedGain_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_UnrealizedGain_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getUnrealizedLoss_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getUnrealizedLoss_Acct(), get_TrxName()); } - - /** Set Unrealized Loss Acct. - @param UnrealizedLoss_Acct - Unrealized Loss Account for currency revaluation - */ - public void setUnrealizedLoss_Acct (int UnrealizedLoss_Acct) - { - set_Value (COLUMNNAME_UnrealizedLoss_Acct, Integer.valueOf(UnrealizedLoss_Acct)); - } - - /** Get Unrealized Loss Acct. - @return Unrealized Loss Account for currency revaluation - */ - public int getUnrealizedLoss_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_UnrealizedLoss_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } } \ No newline at end of file diff --git a/org.adempiere.base/src/org/compiere/model/X_C_Tax_Acct.java b/org.adempiere.base/src/org/compiere/model/X_C_Tax_Acct.java index 545a8433bf..d7447d0c7c 100644 --- a/org.adempiere.base/src/org/compiere/model/X_C_Tax_Acct.java +++ b/org.adempiere.base/src/org/compiere/model/X_C_Tax_Acct.java @@ -29,7 +29,7 @@ public class X_C_Tax_Acct extends PO implements I_C_Tax_Acct, I_Persistent /** * */ - private static final long serialVersionUID = 20100614L; + private static final long serialVersionUID = 20120928L; /** Standard Constructor */ public X_C_Tax_Acct (Properties ctx, int C_Tax_Acct_ID, String trxName) @@ -42,8 +42,6 @@ public class X_C_Tax_Acct extends PO implements I_C_Tax_Acct, I_Persistent setT_Credit_Acct (0); setT_Due_Acct (0); setT_Expense_Acct (0); - setT_Liability_Acct (0); - setT_Receivables_Acct (0); } */ } @@ -75,9 +73,9 @@ public class X_C_Tax_Acct extends PO implements I_C_Tax_Acct, I_Persistent return sb.toString(); } - public I_C_AcctSchema getC_AcctSchema() throws RuntimeException + public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException { - return (I_C_AcctSchema)MTable.get(getCtx(), I_C_AcctSchema.Table_Name) + return (org.compiere.model.I_C_AcctSchema)MTable.get(getCtx(), org.compiere.model.I_C_AcctSchema.Table_Name) .getPO(getC_AcctSchema_ID(), get_TrxName()); } /** Set Accounting Schema. @@ -103,9 +101,23 @@ public class X_C_Tax_Acct extends PO implements I_C_Tax_Acct, I_Persistent return ii.intValue(); } - public I_C_Tax getC_Tax() throws RuntimeException + /** Set C_Tax_Acct_UU. + @param C_Tax_Acct_UU C_Tax_Acct_UU */ + public void setC_Tax_Acct_UU (String C_Tax_Acct_UU) + { + set_Value (COLUMNNAME_C_Tax_Acct_UU, C_Tax_Acct_UU); + } + + /** Get C_Tax_Acct_UU. + @return C_Tax_Acct_UU */ + public String getC_Tax_Acct_UU () + { + return (String)get_Value(COLUMNNAME_C_Tax_Acct_UU); + } + + public org.compiere.model.I_C_Tax getC_Tax() throws RuntimeException { - return (I_C_Tax)MTable.get(getCtx(), I_C_Tax.Table_Name) + return (org.compiere.model.I_C_Tax)MTable.get(getCtx(), org.compiere.model.I_C_Tax.Table_Name) .getPO(getC_Tax_ID(), get_TrxName()); } /** Set Tax. @@ -205,54 +217,4 @@ public class X_C_Tax_Acct extends PO implements I_C_Tax_Acct, I_Persistent return 0; return ii.intValue(); } - - public I_C_ValidCombination getT_Liability_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getT_Liability_Acct(), get_TrxName()); } - - /** Set Tax Liability. - @param T_Liability_Acct - Account for Tax declaration liability - */ - public void setT_Liability_Acct (int T_Liability_Acct) - { - set_Value (COLUMNNAME_T_Liability_Acct, Integer.valueOf(T_Liability_Acct)); - } - - /** Get Tax Liability. - @return Account for Tax declaration liability - */ - public int getT_Liability_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_T_Liability_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getT_Receivables_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getT_Receivables_Acct(), get_TrxName()); } - - /** Set Tax Receivables. - @param T_Receivables_Acct - Account for Tax credit after tax declaration - */ - public void setT_Receivables_Acct (int T_Receivables_Acct) - { - set_Value (COLUMNNAME_T_Receivables_Acct, Integer.valueOf(T_Receivables_Acct)); - } - - /** Get Tax Receivables. - @return Account for Tax credit after tax declaration - */ - public int getT_Receivables_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_T_Receivables_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } } \ No newline at end of file diff --git a/org.adempiere.base/src/org/compiere/model/X_M_Product_Acct.java b/org.adempiere.base/src/org/compiere/model/X_M_Product_Acct.java index 31a5819cdd..a8a902ff9f 100644 --- a/org.adempiere.base/src/org/compiere/model/X_M_Product_Acct.java +++ b/org.adempiere.base/src/org/compiere/model/X_M_Product_Acct.java @@ -29,7 +29,7 @@ public class X_M_Product_Acct extends PO implements I_M_Product_Acct, I_Persiste /** * */ - private static final long serialVersionUID = 20100614L; + private static final long serialVersionUID = 20120928L; /** Standard Constructor */ public X_M_Product_Acct (Properties ctx, int M_Product_Acct_ID, String trxName) @@ -40,27 +40,16 @@ public class X_M_Product_Acct extends PO implements I_M_Product_Acct, I_Persiste setC_AcctSchema_ID (0); setM_Product_ID (0); setP_Asset_Acct (0); - setP_Burden_Acct (0); setP_COGS_Acct (0); setP_CostAdjustment_Acct (0); - setP_CostOfProduction_Acct (0); setP_Expense_Acct (0); - setP_FloorStock_Acct (0); setP_InventoryClearing_Acct (0); setP_InvoicePriceVariance_Acct (0); - setP_Labor_Acct (0); - setP_MethodChangeVariance_Acct (0); - setP_MixVariance_Acct (0); - setP_OutsideProcessing_Acct (0); - setP_Overhead_Acct (0); setP_PurchasePriceVariance_Acct (0); setP_RateVariance_Acct (0); setP_Revenue_Acct (0); - setP_Scrap_Acct (0); setP_TradeDiscountGrant_Acct (0); setP_TradeDiscountRec_Acct (0); - setP_UsageVariance_Acct (0); - setP_WIP_Acct (0); } */ } @@ -92,9 +81,9 @@ public class X_M_Product_Acct extends PO implements I_M_Product_Acct, I_Persiste return sb.toString(); } - public I_C_AcctSchema getC_AcctSchema() throws RuntimeException + public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException { - return (I_C_AcctSchema)MTable.get(getCtx(), I_C_AcctSchema.Table_Name) + return (org.compiere.model.I_C_AcctSchema)MTable.get(getCtx(), org.compiere.model.I_C_AcctSchema.Table_Name) .getPO(getC_AcctSchema_ID(), get_TrxName()); } /** Set Accounting Schema. @@ -120,9 +109,23 @@ public class X_M_Product_Acct extends PO implements I_M_Product_Acct, I_Persiste return ii.intValue(); } - public I_M_Product getM_Product() throws RuntimeException + /** Set M_Product_Acct_UU. + @param M_Product_Acct_UU M_Product_Acct_UU */ + public void setM_Product_Acct_UU (String M_Product_Acct_UU) + { + set_Value (COLUMNNAME_M_Product_Acct_UU, M_Product_Acct_UU); + } + + /** Get M_Product_Acct_UU. + @return M_Product_Acct_UU */ + public String getM_Product_Acct_UU () + { + return (String)get_Value(COLUMNNAME_M_Product_Acct_UU); + } + + public org.compiere.model.I_M_Product getM_Product() throws RuntimeException { - return (I_M_Product)MTable.get(getCtx(), I_M_Product.Table_Name) + return (org.compiere.model.I_M_Product)MTable.get(getCtx(), org.compiere.model.I_M_Product.Table_Name) .getPO(getM_Product_ID(), get_TrxName()); } /** Set Product. @@ -198,31 +201,6 @@ public class X_M_Product_Acct extends PO implements I_M_Product_Acct, I_Persiste return ii.intValue(); } - public I_C_ValidCombination getP_Burden_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_Burden_Acct(), get_TrxName()); } - - /** Set Burden. - @param P_Burden_Acct - The Burden account is the account used Manufacturing Order - */ - public void setP_Burden_Acct (int P_Burden_Acct) - { - set_Value (COLUMNNAME_P_Burden_Acct, Integer.valueOf(P_Burden_Acct)); - } - - /** Get Burden. - @return The Burden account is the account used Manufacturing Order - */ - public int getP_Burden_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_Burden_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - public I_C_ValidCombination getP_COGS_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) @@ -273,31 +251,6 @@ public class X_M_Product_Acct extends PO implements I_M_Product_Acct, I_Persiste return ii.intValue(); } - public I_C_ValidCombination getP_CostOfProduction_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_CostOfProduction_Acct(), get_TrxName()); } - - /** Set Cost Of Production. - @param P_CostOfProduction_Acct - The Cost Of Production account is the account used Manufacturing Order - */ - public void setP_CostOfProduction_Acct (int P_CostOfProduction_Acct) - { - set_Value (COLUMNNAME_P_CostOfProduction_Acct, Integer.valueOf(P_CostOfProduction_Acct)); - } - - /** Get Cost Of Production. - @return The Cost Of Production account is the account used Manufacturing Order - */ - public int getP_CostOfProduction_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_CostOfProduction_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - public I_C_ValidCombination getP_Expense_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) @@ -323,31 +276,6 @@ public class X_M_Product_Acct extends PO implements I_M_Product_Acct, I_Persiste return ii.intValue(); } - public I_C_ValidCombination getP_FloorStock_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_FloorStock_Acct(), get_TrxName()); } - - /** Set Floor Stock. - @param P_FloorStock_Acct - The Floor Stock account is the account used Manufacturing Order - */ - public void setP_FloorStock_Acct (int P_FloorStock_Acct) - { - set_Value (COLUMNNAME_P_FloorStock_Acct, Integer.valueOf(P_FloorStock_Acct)); - } - - /** Get Floor Stock. - @return The Floor Stock account is the account used Manufacturing Order - */ - public int getP_FloorStock_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_FloorStock_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - public I_C_ValidCombination getP_InventoryClearing_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) @@ -398,131 +326,6 @@ public class X_M_Product_Acct extends PO implements I_M_Product_Acct, I_Persiste return ii.intValue(); } - public I_C_ValidCombination getP_Labor_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_Labor_Acct(), get_TrxName()); } - - /** Set Labor. - @param P_Labor_Acct - The Labor account is the account used Manufacturing Order - */ - public void setP_Labor_Acct (int P_Labor_Acct) - { - set_Value (COLUMNNAME_P_Labor_Acct, Integer.valueOf(P_Labor_Acct)); - } - - /** Get Labor. - @return The Labor account is the account used Manufacturing Order - */ - public int getP_Labor_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_Labor_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getP_MethodChangeVariance_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_MethodChangeVariance_Acct(), get_TrxName()); } - - /** Set Method Change Variance. - @param P_MethodChangeVariance_Acct - The Method Change Variance account is the account used Manufacturing Order - */ - public void setP_MethodChangeVariance_Acct (int P_MethodChangeVariance_Acct) - { - set_Value (COLUMNNAME_P_MethodChangeVariance_Acct, Integer.valueOf(P_MethodChangeVariance_Acct)); - } - - /** Get Method Change Variance. - @return The Method Change Variance account is the account used Manufacturing Order - */ - public int getP_MethodChangeVariance_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_MethodChangeVariance_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getP_MixVariance_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_MixVariance_Acct(), get_TrxName()); } - - /** Set Mix Variance. - @param P_MixVariance_Acct - The Mix Variance account is the account used Manufacturing Order - */ - public void setP_MixVariance_Acct (int P_MixVariance_Acct) - { - set_Value (COLUMNNAME_P_MixVariance_Acct, Integer.valueOf(P_MixVariance_Acct)); - } - - /** Get Mix Variance. - @return The Mix Variance account is the account used Manufacturing Order - */ - public int getP_MixVariance_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_MixVariance_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getP_OutsideProcessing_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_OutsideProcessing_Acct(), get_TrxName()); } - - /** Set Outside Processing. - @param P_OutsideProcessing_Acct - The Outside Processing Account is the account used in Manufacturing Order - */ - public void setP_OutsideProcessing_Acct (int P_OutsideProcessing_Acct) - { - set_Value (COLUMNNAME_P_OutsideProcessing_Acct, Integer.valueOf(P_OutsideProcessing_Acct)); - } - - /** Get Outside Processing. - @return The Outside Processing Account is the account used in Manufacturing Order - */ - public int getP_OutsideProcessing_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_OutsideProcessing_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getP_Overhead_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_Overhead_Acct(), get_TrxName()); } - - /** Set Overhead. - @param P_Overhead_Acct - The Overhead account is the account used in Manufacturing Order - */ - public void setP_Overhead_Acct (int P_Overhead_Acct) - { - set_Value (COLUMNNAME_P_Overhead_Acct, Integer.valueOf(P_Overhead_Acct)); - } - - /** Get Overhead. - @return The Overhead account is the account used in Manufacturing Order - */ - public int getP_Overhead_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_Overhead_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - public I_C_ValidCombination getP_PurchasePriceVariance_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) @@ -598,31 +401,6 @@ public class X_M_Product_Acct extends PO implements I_M_Product_Acct, I_Persiste return ii.intValue(); } - public I_C_ValidCombination getP_Scrap_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_Scrap_Acct(), get_TrxName()); } - - /** Set Scrap. - @param P_Scrap_Acct - The Scrap account is the account used in Manufacturing Order - */ - public void setP_Scrap_Acct (int P_Scrap_Acct) - { - set_Value (COLUMNNAME_P_Scrap_Acct, Integer.valueOf(P_Scrap_Acct)); - } - - /** Get Scrap. - @return The Scrap account is the account used in Manufacturing Order - */ - public int getP_Scrap_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_Scrap_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - public I_C_ValidCombination getP_TradeDiscountGrant_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) @@ -672,54 +450,4 @@ public class X_M_Product_Acct extends PO implements I_M_Product_Acct, I_Persiste return 0; return ii.intValue(); } - - public I_C_ValidCombination getP_UsageVariance_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_UsageVariance_Acct(), get_TrxName()); } - - /** Set Usage Variance. - @param P_UsageVariance_Acct - The Usage Variance account is the account used Manufacturing Order - */ - public void setP_UsageVariance_Acct (int P_UsageVariance_Acct) - { - set_Value (COLUMNNAME_P_UsageVariance_Acct, Integer.valueOf(P_UsageVariance_Acct)); - } - - /** Get Usage Variance. - @return The Usage Variance account is the account used Manufacturing Order - */ - public int getP_UsageVariance_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_UsageVariance_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getP_WIP_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_WIP_Acct(), get_TrxName()); } - - /** Set Work In Process. - @param P_WIP_Acct - The Work in Process account is the account used Manufacturing Order - */ - public void setP_WIP_Acct (int P_WIP_Acct) - { - set_Value (COLUMNNAME_P_WIP_Acct, Integer.valueOf(P_WIP_Acct)); - } - - /** Get Work In Process. - @return The Work in Process account is the account used Manufacturing Order - */ - public int getP_WIP_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_WIP_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } } \ No newline at end of file diff --git a/org.adempiere.base/src/org/compiere/model/X_M_Product_Category_Acct.java b/org.adempiere.base/src/org/compiere/model/X_M_Product_Category_Acct.java index 9589896779..914bd49a85 100644 --- a/org.adempiere.base/src/org/compiere/model/X_M_Product_Category_Acct.java +++ b/org.adempiere.base/src/org/compiere/model/X_M_Product_Category_Acct.java @@ -29,7 +29,7 @@ public class X_M_Product_Category_Acct extends PO implements I_M_Product_Categor /** * */ - private static final long serialVersionUID = 20100614L; + private static final long serialVersionUID = 20120928L; /** Standard Constructor */ public X_M_Product_Category_Acct (Properties ctx, int M_Product_Category_Acct_ID, String trxName) @@ -40,27 +40,16 @@ public class X_M_Product_Category_Acct extends PO implements I_M_Product_Categor setC_AcctSchema_ID (0); setM_Product_Category_ID (0); setP_Asset_Acct (0); - setP_Burden_Acct (0); setP_COGS_Acct (0); setP_CostAdjustment_Acct (0); - setP_CostOfProduction_Acct (0); setP_Expense_Acct (0); - setP_FloorStock_Acct (0); setP_InventoryClearing_Acct (0); setP_InvoicePriceVariance_Acct (0); - setP_Labor_Acct (0); - setP_MethodChangeVariance_Acct (0); - setP_MixVariance_Acct (0); - setP_OutsideProcessing_Acct (0); - setP_Overhead_Acct (0); setP_PurchasePriceVariance_Acct (0); setP_RateVariance_Acct (0); setP_Revenue_Acct (0); - setP_Scrap_Acct (0); setP_TradeDiscountGrant_Acct (0); setP_TradeDiscountRec_Acct (0); - setP_UsageVariance_Acct (0); - setP_WIP_Acct (0); } */ } @@ -92,9 +81,9 @@ public class X_M_Product_Category_Acct extends PO implements I_M_Product_Categor return sb.toString(); } - public I_C_AcctSchema getC_AcctSchema() throws RuntimeException + public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException { - return (I_C_AcctSchema)MTable.get(getCtx(), I_C_AcctSchema.Table_Name) + return (org.compiere.model.I_C_AcctSchema)MTable.get(getCtx(), org.compiere.model.I_C_AcctSchema.Table_Name) .getPO(getC_AcctSchema_ID(), get_TrxName()); } /** Set Accounting Schema. @@ -184,9 +173,23 @@ public class X_M_Product_Category_Acct extends PO implements I_M_Product_Categor return (String)get_Value(COLUMNNAME_CostingMethod); } - public I_M_Product_Category getM_Product_Category() throws RuntimeException + /** Set M_Product_Category_Acct_UU. + @param M_Product_Category_Acct_UU M_Product_Category_Acct_UU */ + public void setM_Product_Category_Acct_UU (String M_Product_Category_Acct_UU) + { + set_Value (COLUMNNAME_M_Product_Category_Acct_UU, M_Product_Category_Acct_UU); + } + + /** Get M_Product_Category_Acct_UU. + @return M_Product_Category_Acct_UU */ + public String getM_Product_Category_Acct_UU () + { + return (String)get_Value(COLUMNNAME_M_Product_Category_Acct_UU); + } + + public org.compiere.model.I_M_Product_Category getM_Product_Category() throws RuntimeException { - return (I_M_Product_Category)MTable.get(getCtx(), I_M_Product_Category.Table_Name) + return (org.compiere.model.I_M_Product_Category)MTable.get(getCtx(), org.compiere.model.I_M_Product_Category.Table_Name) .getPO(getM_Product_Category_ID(), get_TrxName()); } /** Set Product Category. @@ -262,31 +265,6 @@ public class X_M_Product_Category_Acct extends PO implements I_M_Product_Categor return ii.intValue(); } - public I_C_ValidCombination getP_Burden_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_Burden_Acct(), get_TrxName()); } - - /** Set Burden. - @param P_Burden_Acct - The Burden account is the account used Manufacturing Order - */ - public void setP_Burden_Acct (int P_Burden_Acct) - { - set_Value (COLUMNNAME_P_Burden_Acct, Integer.valueOf(P_Burden_Acct)); - } - - /** Get Burden. - @return The Burden account is the account used Manufacturing Order - */ - public int getP_Burden_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_Burden_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - public I_C_ValidCombination getP_COGS_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) @@ -337,31 +315,6 @@ public class X_M_Product_Category_Acct extends PO implements I_M_Product_Categor return ii.intValue(); } - public I_C_ValidCombination getP_CostOfProduction_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_CostOfProduction_Acct(), get_TrxName()); } - - /** Set Cost Of Production. - @param P_CostOfProduction_Acct - The Cost Of Production account is the account used Manufacturing Order - */ - public void setP_CostOfProduction_Acct (int P_CostOfProduction_Acct) - { - set_Value (COLUMNNAME_P_CostOfProduction_Acct, Integer.valueOf(P_CostOfProduction_Acct)); - } - - /** Get Cost Of Production. - @return The Cost Of Production account is the account used Manufacturing Order - */ - public int getP_CostOfProduction_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_CostOfProduction_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - public I_C_ValidCombination getP_Expense_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) @@ -387,31 +340,6 @@ public class X_M_Product_Category_Acct extends PO implements I_M_Product_Categor return ii.intValue(); } - public I_C_ValidCombination getP_FloorStock_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_FloorStock_Acct(), get_TrxName()); } - - /** Set Floor Stock. - @param P_FloorStock_Acct - The Floor Stock account is the account used Manufacturing Order - */ - public void setP_FloorStock_Acct (int P_FloorStock_Acct) - { - set_Value (COLUMNNAME_P_FloorStock_Acct, Integer.valueOf(P_FloorStock_Acct)); - } - - /** Get Floor Stock. - @return The Floor Stock account is the account used Manufacturing Order - */ - public int getP_FloorStock_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_FloorStock_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - public I_C_ValidCombination getP_InventoryClearing_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) @@ -462,131 +390,6 @@ public class X_M_Product_Category_Acct extends PO implements I_M_Product_Categor return ii.intValue(); } - public I_C_ValidCombination getP_Labor_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_Labor_Acct(), get_TrxName()); } - - /** Set Labor. - @param P_Labor_Acct - The Labor account is the account used Manufacturing Order - */ - public void setP_Labor_Acct (int P_Labor_Acct) - { - set_Value (COLUMNNAME_P_Labor_Acct, Integer.valueOf(P_Labor_Acct)); - } - - /** Get Labor. - @return The Labor account is the account used Manufacturing Order - */ - public int getP_Labor_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_Labor_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getP_MethodChangeVariance_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_MethodChangeVariance_Acct(), get_TrxName()); } - - /** Set Method Change Variance. - @param P_MethodChangeVariance_Acct - The Method Change Variance account is the account used Manufacturing Order - */ - public void setP_MethodChangeVariance_Acct (int P_MethodChangeVariance_Acct) - { - set_Value (COLUMNNAME_P_MethodChangeVariance_Acct, Integer.valueOf(P_MethodChangeVariance_Acct)); - } - - /** Get Method Change Variance. - @return The Method Change Variance account is the account used Manufacturing Order - */ - public int getP_MethodChangeVariance_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_MethodChangeVariance_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getP_MixVariance_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_MixVariance_Acct(), get_TrxName()); } - - /** Set Mix Variance. - @param P_MixVariance_Acct - The Mix Variance account is the account used Manufacturing Order - */ - public void setP_MixVariance_Acct (int P_MixVariance_Acct) - { - set_Value (COLUMNNAME_P_MixVariance_Acct, Integer.valueOf(P_MixVariance_Acct)); - } - - /** Get Mix Variance. - @return The Mix Variance account is the account used Manufacturing Order - */ - public int getP_MixVariance_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_MixVariance_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getP_OutsideProcessing_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_OutsideProcessing_Acct(), get_TrxName()); } - - /** Set Outside Processing. - @param P_OutsideProcessing_Acct - The Outside Processing Account is the account used in Manufacturing Order - */ - public void setP_OutsideProcessing_Acct (int P_OutsideProcessing_Acct) - { - set_Value (COLUMNNAME_P_OutsideProcessing_Acct, Integer.valueOf(P_OutsideProcessing_Acct)); - } - - /** Get Outside Processing. - @return The Outside Processing Account is the account used in Manufacturing Order - */ - public int getP_OutsideProcessing_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_OutsideProcessing_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getP_Overhead_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_Overhead_Acct(), get_TrxName()); } - - /** Set Overhead. - @param P_Overhead_Acct - The Overhead account is the account used in Manufacturing Order - */ - public void setP_Overhead_Acct (int P_Overhead_Acct) - { - set_Value (COLUMNNAME_P_Overhead_Acct, Integer.valueOf(P_Overhead_Acct)); - } - - /** Get Overhead. - @return The Overhead account is the account used in Manufacturing Order - */ - public int getP_Overhead_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_Overhead_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - public I_C_ValidCombination getP_PurchasePriceVariance_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) @@ -683,31 +486,6 @@ public class X_M_Product_Category_Acct extends PO implements I_M_Product_Categor return false; } - public I_C_ValidCombination getP_Scrap_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_Scrap_Acct(), get_TrxName()); } - - /** Set Scrap. - @param P_Scrap_Acct - The Scrap account is the account used in Manufacturing Order - */ - public void setP_Scrap_Acct (int P_Scrap_Acct) - { - set_Value (COLUMNNAME_P_Scrap_Acct, Integer.valueOf(P_Scrap_Acct)); - } - - /** Get Scrap. - @return The Scrap account is the account used in Manufacturing Order - */ - public int getP_Scrap_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_Scrap_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - public I_C_ValidCombination getP_TradeDiscountGrant_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) @@ -757,54 +535,4 @@ public class X_M_Product_Category_Acct extends PO implements I_M_Product_Categor return 0; return ii.intValue(); } - - public I_C_ValidCombination getP_UsageVariance_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_UsageVariance_Acct(), get_TrxName()); } - - /** Set Usage Variance. - @param P_UsageVariance_Acct - The Usage Variance account is the account used Manufacturing Order - */ - public void setP_UsageVariance_Acct (int P_UsageVariance_Acct) - { - set_Value (COLUMNNAME_P_UsageVariance_Acct, Integer.valueOf(P_UsageVariance_Acct)); - } - - /** Get Usage Variance. - @return The Usage Variance account is the account used Manufacturing Order - */ - public int getP_UsageVariance_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_UsageVariance_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getP_WIP_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getP_WIP_Acct(), get_TrxName()); } - - /** Set Work In Process. - @param P_WIP_Acct - The Work in Process account is the account used Manufacturing Order - */ - public void setP_WIP_Acct (int P_WIP_Acct) - { - set_Value (COLUMNNAME_P_WIP_Acct, Integer.valueOf(P_WIP_Acct)); - } - - /** Get Work In Process. - @return The Work in Process account is the account used Manufacturing Order - */ - public int getP_WIP_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_P_WIP_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } } \ No newline at end of file diff --git a/org.adempiere.base/src/org/compiere/model/X_M_Warehouse_Acct.java b/org.adempiere.base/src/org/compiere/model/X_M_Warehouse_Acct.java index d5559baab7..13e1e294a6 100644 --- a/org.adempiere.base/src/org/compiere/model/X_M_Warehouse_Acct.java +++ b/org.adempiere.base/src/org/compiere/model/X_M_Warehouse_Acct.java @@ -29,7 +29,7 @@ public class X_M_Warehouse_Acct extends PO implements I_M_Warehouse_Acct, I_Pers /** * */ - private static final long serialVersionUID = 20100614L; + private static final long serialVersionUID = 20120928L; /** Standard Constructor */ public X_M_Warehouse_Acct (Properties ctx, int M_Warehouse_Acct_ID, String trxName) @@ -40,9 +40,6 @@ public class X_M_Warehouse_Acct extends PO implements I_M_Warehouse_Acct, I_Pers setC_AcctSchema_ID (0); setM_Warehouse_ID (0); setW_Differences_Acct (0); - setW_InvActualAdjust_Acct (0); - setW_Inventory_Acct (0); - setW_Revaluation_Acct (0); } */ } @@ -74,9 +71,9 @@ public class X_M_Warehouse_Acct extends PO implements I_M_Warehouse_Acct, I_Pers return sb.toString(); } - public I_C_AcctSchema getC_AcctSchema() throws RuntimeException + public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException { - return (I_C_AcctSchema)MTable.get(getCtx(), I_C_AcctSchema.Table_Name) + return (org.compiere.model.I_C_AcctSchema)MTable.get(getCtx(), org.compiere.model.I_C_AcctSchema.Table_Name) .getPO(getC_AcctSchema_ID(), get_TrxName()); } /** Set Accounting Schema. @@ -102,9 +99,23 @@ public class X_M_Warehouse_Acct extends PO implements I_M_Warehouse_Acct, I_Pers return ii.intValue(); } - public I_M_Warehouse getM_Warehouse() throws RuntimeException + /** Set M_Warehouse_Acct_UU. + @param M_Warehouse_Acct_UU M_Warehouse_Acct_UU */ + public void setM_Warehouse_Acct_UU (String M_Warehouse_Acct_UU) + { + set_Value (COLUMNNAME_M_Warehouse_Acct_UU, M_Warehouse_Acct_UU); + } + + /** Get M_Warehouse_Acct_UU. + @return M_Warehouse_Acct_UU */ + public String getM_Warehouse_Acct_UU () + { + return (String)get_Value(COLUMNNAME_M_Warehouse_Acct_UU); + } + + public org.compiere.model.I_M_Warehouse getM_Warehouse() throws RuntimeException { - return (I_M_Warehouse)MTable.get(getCtx(), I_M_Warehouse.Table_Name) + return (org.compiere.model.I_M_Warehouse)MTable.get(getCtx(), org.compiere.model.I_M_Warehouse.Table_Name) .getPO(getM_Warehouse_ID(), get_TrxName()); } /** Set Warehouse. @@ -154,79 +165,4 @@ public class X_M_Warehouse_Acct extends PO implements I_M_Warehouse_Acct, I_Pers return 0; return ii.intValue(); } - - public I_C_ValidCombination getW_InvActualAdjust_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getW_InvActualAdjust_Acct(), get_TrxName()); } - - /** Set Inventory Adjustment. - @param W_InvActualAdjust_Acct - Account for Inventory value adjustments for Actual Costing - */ - public void setW_InvActualAdjust_Acct (int W_InvActualAdjust_Acct) - { - set_Value (COLUMNNAME_W_InvActualAdjust_Acct, Integer.valueOf(W_InvActualAdjust_Acct)); - } - - /** Get Inventory Adjustment. - @return Account for Inventory value adjustments for Actual Costing - */ - public int getW_InvActualAdjust_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_W_InvActualAdjust_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getW_Inventory_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getW_Inventory_Acct(), get_TrxName()); } - - /** Set (Not Used). - @param W_Inventory_Acct - Warehouse Inventory Asset Account - Currently not used - */ - public void setW_Inventory_Acct (int W_Inventory_Acct) - { - set_Value (COLUMNNAME_W_Inventory_Acct, Integer.valueOf(W_Inventory_Acct)); - } - - /** Get (Not Used). - @return Warehouse Inventory Asset Account - Currently not used - */ - public int getW_Inventory_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_W_Inventory_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ValidCombination getW_Revaluation_A() throws RuntimeException - { - return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) - .getPO(getW_Revaluation_Acct(), get_TrxName()); } - - /** Set Inventory Revaluation. - @param W_Revaluation_Acct - Account for Inventory Revaluation - */ - public void setW_Revaluation_Acct (int W_Revaluation_Acct) - { - set_Value (COLUMNNAME_W_Revaluation_Acct, Integer.valueOf(W_Revaluation_Acct)); - } - - /** Get Inventory Revaluation. - @return Account for Inventory Revaluation - */ - public int getW_Revaluation_Acct () - { - Integer ii = (Integer)get_Value(COLUMNNAME_W_Revaluation_Acct); - if (ii == null) - return 0; - return ii.intValue(); - } } \ No newline at end of file diff --git a/org.adempiere.extend/src/test/functional/MCurrencyAcctTest.java b/org.adempiere.extend/src/test/functional/MCurrencyAcctTest.java index 2bebb02a72..f3b7295925 100644 --- a/org.adempiere.extend/src/test/functional/MCurrencyAcctTest.java +++ b/org.adempiere.extend/src/test/functional/MCurrencyAcctTest.java @@ -33,8 +33,11 @@ public class MCurrencyAcctTest extends AdempiereTestCase public void testQuery() throws Exception { //red1 create C_Currency_Acct wih SchemaDef = 101 and C_Currency = 100 MAcctSchemaDefault as = MAcctSchemaDefault.get(getCtx(), 101); - int a = as.getRealizedGain_Acct(100); - assertTrue("No test record been setup", a > 0); + +// IDEMPIERE-362 Hide things that don't work on iDempiere + + //int a = as.getRealizedGain_Acct(100); + //assertTrue("No test record been setup", a > 0); } diff --git a/org.adempiere.server-feature/data/import/AccountingUS.csv b/org.adempiere.server-feature/data/import/AccountingUS.csv index 6f5b458db4..6c45d08307 100644 --- a/org.adempiere.server-feature/data/import/AccountingUS.csv +++ b/org.adempiere.server-feature/data/import/AccountingUS.csv @@ -3,7 +3,7 @@ 11,"Cash",,"Asset",,,"Yes",,1,11,"Cash",1,"Cash",,,,,, 11100,"Checking Account","Bank Asset","Asset",,"Yes","No","B_ASSET_ACCT",11,,,,,,,,,, 11110,"Checking In-Transfer","Bank transactions in transit","Asset",,"Yes","No","B_INTRANSIT_ACCT",11,,,,,,,,,, -11120,"Checking Unidentified Receipts","Receipts from unidentified customer","Asset",,"Yes","No","B_UNIDENTIFIED_ACCT",11,,,,,,,,,, +11120,"Checking Unidentified Receipts","Receipts from unidentified customer","Asset",,"Yes","No","",11,,,,,,,,,, 11130,"Checking Unallocated Receipts","Received, unallocated payments","Asset",,"Yes","No","B_UNALLOCATEDCASH_ACCT",11,,,,,,,,,, 11200,"Checking Account 2",,"Asset",,,"No",,11,,,,,,,,,, 11300,"Savings Account",,"Asset",,,"No",,11,,,,,,,,,, @@ -16,7 +16,7 @@ 12115,"Accounts Receivable Services - Trade","Accounts Receivables for Services","Asset",,"Yes","No","C_RECEIVABLE_SERVICES_ACCT",121,,,"2a","Trade nodes and accounts receivables",,,,,, 12120,"A/R Non Sufficient Funds Returned Checks",,"Asset",,,"No",,121,,,"2a",,,,,,, 12180,"A/R Trade Allowance for Bad Debit",,"Asset",,,"No",,121,,,"2b","Less allowances for bad debts",,,,,, -12190,"Not invoiced receivables","We delivered but have not invoiced yet","Asset",,"Yes","No","NOTINVOICEDRECEIVABLES_ACCT",121,,,"2a",,,,,,, +12190,"Not invoiced receivables","We delivered but have not invoiced yet","Asset",,"Yes","No","",121,,,"2a",,,,,,, 122,"Credit Card in Transit",,"Asset",,,"Yes",,12,,,,,,,,,, 12210,"In Transit A/R Amex",,"Asset",,,"No",,122,,,"2a",,,,,,, 12220,"In Transit A/R Master Card",,"Asset",,,"No",,122,,,"2a",,,,,,, @@ -30,10 +30,10 @@ 12440,"Loans Receivable Others",,"Asset",,,"No",,124,,,"2a",,,,,,, 125,"Prepayments",,"Asset",,,"Yes",,12,,,,,,,,,, 12510,"Vendor prepayment","Prepayments for future expense","Asset",,"Yes","No","V_PREPAYMENT_ACCT",125,,,"2a",,,,,,, -12520,"Employee Expense Prepayment","Expense advances","Asset",,"Yes","No","E_PREPAYMENT_ACCT",125,,,"2a",,,,,,, +12520,"Employee Expense Prepayment","Expense advances","Asset",,"Yes","No","",125,,,"2a",,,,,,, 126,"Tax receivables",,"Asset",,,"Yes",,12,,,,,,,,,, 12610,"Tax credit A/R","Tax to be reimbursed - before tax declaration","Asset",,"Yes","No","T_CREDIT_ACCT",126,,,6,,,,,,, -12620,"Tax receivables","Tax to receive based on tax declaration","Asset",,"Yes","No","T_RECEIVABLES_ACCT",126,,,6,,,,,,, +12620,"Tax receivables","Tax to receive based on tax declaration","Asset",,"Yes","No","",126,,,6,,,,,,, 12800,"Intercompany Due From","Default Receivables account for intercompany trx","Asset",,"Yes","No","INTERCOMPANYDUEFROM_ACCT",12,,,6,,,,,,, 12900,"A/R Miscellaneous",,"Asset",,,"No",,12,,,"2a",,,,,,, 13,"Investments",,"Asset",,,"Yes",,1,13,"Investments",,,,,,,, @@ -41,10 +41,10 @@ 13200,"Tax-Exempt Securities",,"Asset",,,"No",,13,,,5,"Tax-Exempt Securities",,,,,, 13300,"Other Investments",,"Asset",,,"No",,13,,,9,"Other Investments",,,,,, 14,"Inventory",,"Asset",,,"Yes",,1,14,"Inventory",3,"Inventories",,,,,, -14100,"General Trade Inventory","Inventory Account","Asset",,"Yes","No","W_INVENTORY_ACCT",14,,,,,,,,,, +14100,"General Trade Inventory","Inventory Account","Asset",,"Yes","No","",14,,,,,,,,,, 14120,"Product asset","Product Inventory Account","Asset",,"Yes","No","P_ASSET_ACCT",14,,,,,,,,,, -14130,"Work In Process","Work In Process Account","Asset",,"Yes","No","P_WIP_ACCT",14,,,,,,,,,, -14140,"Floor Stock","Floor Stock Account","Asset",,"Yes","No","P_FLOORSTOCK_ACCT",14,,,,,,,,,, +14130,"Work In Process","Work In Process Account","Asset",,"Yes","No","",14,,,,,,,,,, +14140,"Floor Stock","Floor Stock Account","Asset",,"Yes","No","",14,,,,,,,,,, 15,"Prepaid Expenses, Deposits & Other Current Assets",,"Asset",,,"Yes",,1,15,"Prepaid Expenses, Deposits & Other Current Assets",6,"Other Current Assets",,,,,, 151,"Prepaid Expenses",,"Asset",,,"Yes",,15,,,,,,,,,, 15110,"Prepaid Insurance",,"Asset",,,"No",,151,,,,,,,,,, @@ -110,8 +110,8 @@ 21550,"Mail Order Deposits",,"Liability",,,"No",,215,,,,,,,,,, 216,"Tax Payables",,"Liability",,,"Yes",,21,,,18,"Other current liabilities",,,,,, 21610,"Tax due","Tax to be paid - before tax declaration","Liability",,"Yes","No","T_DUE_ACCT",216,,,,,,,,,, -21620,"Tax liability","Tax to be paid based on tax declaration","Liability",,"Yes","No","T_LIABILITY_ACCT",216,,,,,,,,,, -21700,"Withholding (Tax)","Withholding for 1099 or Quality Guarantee","Liability",,"Yes","No","WITHHOLDING_ACCT",21,,,,,,,,,, +21620,"Tax liability","Tax to be paid based on tax declaration","Liability",,"Yes","No","",216,,,,,,,,,, +21700,"Withholding (Tax)","Withholding for 1099 or Quality Guarantee","Liability",,"Yes","No","",21,,,,,,,,,, 21710,"Withholding (Other)",,"Liability",,,"No",,21,,,,,,,,,, 21800,"Intercompany Due To","Default Payables account for intercompany trx","Liability",,"Yes","No","INTERCOMPANYDUETO_ACCT",21,,,,,,,,,, 22,"Accrued Expenses",,"Liability",,,"Yes",,2,22,"Accrued Expenses",18,,,,,,, @@ -152,7 +152,7 @@ 32,"Earnings",,"Owner's Equity",,,"Yes",,3,32,"Current Profit & Loss",25,"Retained Earnings",,,,,, 32100,"Dividends",,"Owner's Equity",,,"No",,32,,,,,,,,,, 32200,"Drawings",,"Owner's Equity",,,"No",,32,,,,,,,,,, -32900,"Retained Earnings","Year end processing to balance account (Income Summary)","Owner's Equity",,"Yes","No","RETAINEDEARNING_ACCT",32,,,,,,,,,, +32900,"Retained Earnings","Year end processing to balance account (Income Summary)","Owner's Equity",,"Yes","No","",32,,,,,,,,,, ,,,,,,,,,33,"Total Liabilities and Equity",,,,,,,, 4,"Sales",,"Revenue",,,"Yes",,,,,,,4,"Sales",,,, 41000,"Trade Revenue","Default Product or Service revenue","Revenue",,"Yes","No","P_REVENUE_ACCT",4,,,,,,,"1a","Gross receipts or sales",, @@ -160,16 +160,16 @@ 43000,"Sideline Revenue",,"Revenue",,,"No",,4,,,,,,,"1a",,, 46000,"Royalties Revenue",,"Revenue",,,"No",,4,,,,,,,7,"Gross Royalties",, 47000,"Unearned revenue","We have invoiced, but not delivered yet","Revenue",,"Yes","No","UNEARNEDREVENUE_ACCT",4,,,,,,,"1a",,, -48000,"Not invoiced revenue","We delivered but have not invoiced yet","Revenue",,"Yes","No","NOTINVOICEDREVENUE_ACCT",4,,,,,,,"1a",,, +48000,"Not invoiced revenue","We delivered but have not invoiced yet","Revenue",,"Yes","No","",4,,,,,,,"1a",,, 49,"Sales Discounts",,"Revenue",,,"Yes",,4,,,,,49,"Sales Discounts","1b","Less returns and allowances",, 49100,"Trade Discounts","Granted Trade discounts (corrects Product Revenue)","Revenue",,"Yes","No","P_TRADEDISCOUNTGRANT_ACCT",49,,,,,,,,,, 49200,"Payment discount expense","Granted early payment discount to customers","Revenue",,"Yes","No","PAYDISCOUNT_EXP_ACCT",49,,,,,,,,,, 49300,"Promotion Discounts",,"Revenue",,,"No",,49,,,,,,,,,, 5,"Cost of Goods Sold",,"Expense",,,"Yes",,,,,,,5,"Cost of Goods Sold",2,"Cost of goods sold",, 51100,"Product CoGs","Cost of Goods Sold","Expense",,"Yes","No","P_COGS_ACCT",5,,,,,,,,,, -51110,"Cost Of Production","Cost Of Production Account","Expense",,"Yes","No","P_COSTOFPRODUCTION_ACCT",5,,,,,,,,,, -51120,"Scrap","Scrap Account","Expense",,"Yes","No","P_SCRAP_ACCT",5,,,,,,,,,, -51130,"Outside Processing (Subcontract)","Outside Processing Account","Expense",,"Yes","No","P_OUTSIDEPROCESSING_ACCT",5,,,,,,,,,, +51110,"Cost Of Production","Cost Of Production Account","Expense",,"Yes","No","",5,,,,,,,,,, +51120,"Scrap","Scrap Account","Expense",,"Yes","No","",5,,,,,,,,,, +51130,"Outside Processing (Subcontract)","Outside Processing Account","Expense",,"Yes","No","",5,,,,,,,,,, 51200,"Product Expense","Default Service costs (I.e. not on inventory)","Expense",,"Yes","No","P_EXPENSE_ACCT",5,,,,,,,,,, 51210,"Product Cost Adjustment","Product Cost Adjustments","Expense",,"Yes","No","P_COSTADJUSTMENT_ACCT",5,,,,,,,,,, 51290,"Product Inventory Clearing","Default Product costs (I.e. on inventory)","Expense",,"Yes","No","P_INVENTORYCLEARING_ACCT",5,,,,,,,,,, @@ -182,17 +182,17 @@ 56,"Inventory CoGs",,"Expense",,,"Yes",,5,,,,,56,"Inventory CoGs",2,,, 56100,"Inventory Shrinkage","Physical Inventory Gain/Loss","Expense",,"Yes","No","W_DIFFERENCES_ACCT",56,,,,,,,,,, 56200,"Inventory Write Down Below Cost",,"Expense",,,"No",,56,,,,,,,,,, -56300,"Inventory Adjustment","Inventory Actual Accounting Value Adjustment","Expense",,"Yes","No","W_INVACTUALADJUST_ACCT",56,,,,,,,,,, -56400,"Inventory Revaluation","Difference to (lower cost) or market","Expense",,"Yes","No","W_REVALUATION_ACCT",56,,,,,,,,,, +56300,"Inventory Adjustment","Inventory Actual Accounting Value Adjustment","Expense",,"Yes","No","",56,,,,,,,,,, +56400,"Inventory Revaluation","Difference to (lower cost) or market","Expense",,"Yes","No","",56,,,,,,,,,, 57000,"Direct Labor",,"Expense",,,"No",,5,,,,,,,,,, 58,"CoGS Variances",,"Expense",,,"Yes",,5,,,,,58,"CoGs Variances",2,,, 58100,"Invoice price variance","Difference between product cost and invoice price (IPV)","Expense",,"Yes","No","P_INVOICEPRICEVARIANCE_ACCT",58,,,,,,,,,, 58200,"Purchase price variance","Difference between purchase price and standard costs (PPV)","Expense",,"Yes","No","P_PURCHASEPRICEVARIANCE_ACCT",58,,,,,,,,,, 58300,"Purchase price variance Offset","Offset Account for Purchase price variance (PPV) ","Expense",,"Yes","No","PPVOFFSET_ACCT",58,,,,,,,,,, -58400,"Using Variance","Account for Using Variance","Expense",,"Yes","No","P_USAGEVARIANCE_ACCT",58,,,,,,,,,, -58500,"Method Change Variance","Account for Method Change Variance","Expense",,"Yes","No","P_METHODCHANGEVARIANCE_ACCT",58,,,,,,,,,, -58600,"Rate Variance","Account for Rate Variance","Expense",,"Yes","No","P_RATEVARIANCE_ACCT",58,,,,,,,,,, -58700,"Mix Variance","Account for Mix Variance","Expense",,"Yes","No","P_MIXVARIANCE_ACCT",58,,,,,,,,,, +58400,"Using Variance","Account for Using Variance","Expense",,"Yes","No","",58,,,,,,,,,, +58500,"Method Change Variance","Account for Method Change Variance","Expense",,"Yes","No","P_RATEVARIANCE_ACCT",58,,,,,,,,,, +58600,"Rate Variance","Account for Rate Variance","Expense",,"Yes","No","",58,,,,,,,,,, +58700,"Mix Variance","Account for Mix Variance","Expense",,"Yes","No","",58,,,,,,,,,, 58800,"Average Cost Variance","Account for Average Cost Variance","Expense",,"Yes","No","P_AVERAGECOSTVARIANCE_ACCT",58,,,,,,,,,, 59,"CoGs Discounts",,"Expense",,,"Yes",,5,,,,,59,"CoGS Discounts",2,,, 59100,"Trade discounts received","Received Trade Discounts (corrects Product expense)","Expense",,"Yes","No","P_TRADEDISCOUNTREC_ACCT",59,,,,,,,,,, @@ -273,7 +273,7 @@ 68300,"Business Travel - Hotel",,"Expense",,,"No",,68,,,,,,,,,, 68400,"Business Meals & Entertainment (50%)",,"Expense",,,"No",,68,,,,,,,,,, 68500,"Staff Meeting Food (100%)",,"Expense",,,"No",,68,,,,,,,,,, -68600,"Employee expense","Default employee expenses","Expense",,"Yes","No","E_EXPENSE_ACCT",68,,,,,,,,,, +68600,"Employee expense","Default employee expenses","Expense",,"Yes","No","",68,,,,,,,,,, 68900,"Business Travel Other Expense",,"Expense",,,"No",,68,,,,,,,,,, 69,"Insurance",,"Expense",,,"Yes",,6,,,,,69,"Insurance",,,, 69100,"Business Insurance",,"Expense",,,"No",,69,,,,,,,,,, @@ -282,7 +282,7 @@ 69400,"Other Insurance",,"Expense",,,"No",,69,,,,,,,,,, 70,"Payment Processor Costs",,"Expense",,,"Yes",,6,,,,,70,"Payment Processor Costs",,,, 70100,"Credit Card Service Charges",,"Expense",,,"No",,70,,,,,,,,,, -70200,"Bank Service Charges","Bank expenses","Expense",,"Yes","No","B_EXPENSE_ACCT",70,,,,,,,,,, +70200,"Bank Service Charges","Bank expenses","Expense",,"Yes","No","",70,,,,,,,,,, 70900,"Other Payment Service Charges",,"Expense",,,"No",,70,,,,,,,,,, 71,"Dues & Subscription",,"Expense",,,"Yes",,6,,,,,71,"Dues & Subscriptions",,,, 71100,"Association Membership Fees",,"Expense",,,"No",,71,,,,,,,,,, @@ -329,7 +329,7 @@ 79,"Default/Suspense Accounts","Temporary accounts - balance should be zero","Expense",,,"Yes",,6,,,,,79,"Default/Suspense Accounts",,,, 79100,"Default account","Default Account (if no other account is defined) V1.1","Expense",,"Yes","No","DEFAULT_ACCT",79,,,,,,,,,, 79200,"Suspense balancing ","Difference to make journal balance in source currency - needs to be solved","Expense",,"Yes","No","SUSPENSEBALANCING_ACCT",79,,,,,,,,,, -79300,"Suspense error","Import did not find account - needs to be solved","Expense",,"Yes","No","SUSPENSEERROR_ACCT",79,,,,,,,,,, +79300,"Suspense error","Import did not find account - needs to be solved","Expense",,"Yes","No","",79,,,,,,,,,, 79400,"Cash book expense","Default other expense for petty cash transactions","Expense",,"Yes","No","CB_EXPENSE_ACCT",79,,,,,,,,,, 79500,"Cash book receipts","Default other revenue for petty cash transactions","Revenue",,"Yes","No","CB_RECEIPT_ACCT",79,,,,,,,,,, 79600,"Charge expense","Default other expense","Expense",,"Yes","No","CH_EXPENSE_ACCT",79,,,,,,,,,, @@ -342,8 +342,8 @@ 80300,"Rental Income",,"Revenue",,,"No",,80,,,,,,,6,"Gross Rents",, 80400,"Sales Tax Commission",,"Revenue",,,"No",,80,,,,,,,,,, 805,"Currency Gain",,"Revenue",,,"Yes",,80,,,,,805,"Currency Gain",,,, -80510,"Bank revaluation gain","Foreign currency bank account gain","Revenue",,"Yes","No","B_REVALUATIONGAIN_ACCT",805,,,,,,,,,, -80520,"Bank settlement gain","Difference between payment and bank account currency","Revenue",,"Yes","No","B_SETTLEMENTGAIN_ACCT",805,,,,,,,,,, +80510,"Bank revaluation gain","Foreign currency bank account gain","Revenue",,"Yes","No","",805,,,,,,,,,, +80520,"Bank settlement gain","Difference between payment and bank account currency","Revenue",,"Yes","No","",805,,,,,,,,,, 80530,"Unrealized gain","Difference between foreign currency receivables/payables and current rate","Revenue",,"Yes","No","UNREALIZEDGAIN_ACCT",805,,,,,,,,,, 80540,"Realized gain","Difference between invoice and payment currency","Revenue",,"Yes","No","REALIZEDGAIN_ACCT",805,,,,,,,,,, 80700,"Capital Gains Income",,"Revenue",,,"No",,80,,,,,,,,,, @@ -355,8 +355,8 @@ 82300,"Uninsured Casualty Loss",,"Expense",,,"No",,82,,,,,,,,,, 82400,"Charitable Contributions",,"Expense",,,"No",,82,,,,,,,19,"Charitable Contributions",, 825,"Currency Loss",,"Expense",,,"Yes",,82,,,,,825,"Currency Loss",,,, -82510,"Bank revaluation loss","Foreign currency bank account loss","Expense",,"Yes","No","B_REVALUATIONLOSS_ACCT",825,,,,,,,,,, -82520,"Bank settlement loss","Difference between payment and bank account currency","Expense",,"Yes","No","B_SETTLEMENTLOSS_ACCT",825,,,,,,,,,, +82510,"Bank revaluation loss","Foreign currency bank account loss","Expense",,"Yes","No","",825,,,,,,,,,, +82520,"Bank settlement loss","Difference between payment and bank account currency","Expense",,"Yes","No","",825,,,,,,,,,, 82530,"Unrealized loss","Difference between foreign currency receivables/payables and current rate","Expense",,"Yes","No","UNREALIZEDLOSS_ACCT",825,,,,,,,,,, 82540,"Realized loss","Difference between invoice and payment currency","Expense",,"Yes","No","REALIZEDLOSS_ACCT",825,,,,,,,,,, 82550,"Currency balancing","Rounding difference to make journal balance in accounting currency","Expense",,"Yes","No","CURRENCYBALANCING_ACCT",825,,,,,,,,,, @@ -364,15 +364,15 @@ 82800,"Fixes Asset Sale Loss",,"Expense",,,"No",,82,,,,,,,,,, 82900,"Other Expense",,"Expense",,,"No",,82,,,,,,,,,, 83,"Expense (Absorbed)",,"Expense",,,"Yes",,,,,,,83,"Expense (Absorbed)",,,, -83100,"Labor (Absorbed)","Labor Absorbed account","Expense",,"Yes","No","P_LABOR_ACCT",83,,,,,,,,,, -83200,"Burden (Absorbed)","Burden Absorbed account","Expense",,"Yes","No","P_BURDEN_ACCT",83,,,,,,,,,, -83300,"Overhead (Applied)","Overhead Applied account","Expense",,"Yes","No","P_OVERHEAD_ACCT",83,,,,,,,,,, +83100,"Labor (Absorbed)","Labor Absorbed account","Expense",,"Yes","No","",83,,,,,,,,,, +83200,"Burden (Absorbed)","Burden Absorbed account","Expense",,"Yes","No","",83,,,,,,,,,, +83300,"Overhead (Applied)","Overhead Applied account","Expense",,"Yes","No","",83,,,,,,,,,, ,,,,,,,,,,,,,"83_","Net Income before Tax",,,, 89,"Income Tax & Summary",,"Expense",,,"Yes",,,,,,,89,"Income Tax & Summary",,,, 89100,"Federal Income Tax",,"Expense",,,"No",,89,,,,,,,,,, 89200,"State Income Tax",,"Expense",,,"No",,89,,,,,,,,,, 89300,"Local Income Tax",,"Expense",,,"No",,89,,,,,,,,,, -89900,"Income Summary","Year end processing to balance account (Retained Earnings)","Expense",,"Yes","No","INCOMESUMMARY_ACCT",89,,,,,"89_","Net Income",,,, +89900,"Income Summary","Year end processing to balance account (Retained Earnings)","Expense",,"Yes","No","",89,,,,,"89_","Net Income",,,, 91,"Costing",,"Memo",,,"Yes",,,,,,,,,,,, 911,"Profit Center Costing Distribution",,"Memo",,,"No",,91,,,,,,,,,, 912,"Project Costing Distribution",,"Memo",,,"No",,91,,,,,,,,,, diff --git a/org.adempiere.server-feature/data/import/AccountingUS.xls b/org.adempiere.server-feature/data/import/AccountingUS.xls index fc8ced345b7c3ed77e3da5cc7fb9acd6c819e77a..9e028bcd6c63052763b2c483c464582b7b7009d2 100644 GIT binary patch delta 10818 zcmZXa3w+J>|Hr?dV=faua~thAGsD_TKOJYgvjU$(l z+!J!-mfR|-BuPRNA|*+ZB$xmD^ZCB^O~3yDH#!QtGHow4%DfZ?+P3V-{uMw);J|7zvio=GKqQ>11YtF z1o>(YpwDX83KWZ)Qi}X_Qvz4(t}7l`|75xdgfyHds&a`=eTVnXDT{rC)wl1kQQ0Hu zqBkY*RHJ$>dMPP6a60J)L2a8R(~73e=w8#IH1Vn7#hV(lsv3dco?0ACi(8)y%xaTT zB5AUPH}>QyVRxDUE*n0m%Y@Z>%GWGV}VgG)G*5M*a9^T zV=gxz)4(uFRx^xcDTdLtbYQCQXO}BX1YYRw5^A6O?DQZi)+eBT-xw0<2<+QgRW%u=pcv{o9wyf_cWsH_a13J^!Efc_`c0Wl$ zSzeJyO|$-WOCGm!=VZA>LzQQwjxk?-5d7o@_+-r}pydijmUb>Z)DjT6{dCu)= zG^Td_Oqm2$LATU|X7r1r1N|aJeY(^yRy3uM{<-2Qn%X~=$1Tuw{^2w4@`0GDRzj8f=Qz)PAtyO9#6}8`?QIS3biv)N!t^ zN7t4b4e^Rp${A8SM9o$ySBMe8dufCTT0JC*PZ7E>q)_dq42=p6@IYn2jU8o?(5?$#;jv87-u3Px1X>K}i^K%nLH`KY}D0aQ4uzUWWKMy2yMe6(8(prq0D#XuT5I#&#$bEEr;!PIO{CHE0qS6ymz`u{38wsu&$OGhvBKjHA($Q$5P2E+>ok z$;NRZ^zpXzN&6z5o6L5K$#aYG)G9Ci@$o3y+<44*&QQ5~jY>vyqfEh&%5)&Fl9)gz z^D@Omil34xCQ&|bC(|X~=25e$nPLhp;_XzrIkgj)Z8a@HPD8=AdNQZe%xPZn676SY z29#8-yiBg?UNMuBrYDG5ls!G&GYfi}?n=HBscZffIyJq%m`$Z$8X{h$(Jy6+IdqJ- zuTjj5Ofi?H^L8Gc<81*odO1@N74UXGUE}QnYBe)cETk1P(|LP+W}@&@ty#HZ5iOjR zDqlxCnR-_JbYqrVET%H~sUD@MiF}s#$;Q88UI9dtuTb_@=M(E5#PGo0h`%UpNE%KZ4FqDxP$uWPjI7}gnEcpqPQK;IB z*{5Km!L~5_3~Y?e3SPJ55umZKwP*G@*f_8i%#MP+2zGSK*VDU>V`4!k?n+5WgG*K^G^!~Ex@&vRz_}dp+@@uduU@MrN1e*$WgV{G= z)4)=eTk;gxbg;S1PJ_J!cAnW8uo+Exw~V zZ`7CPpwB|i&^IjkJy<^29%kpkUO}BQE0e`}N?VyIFF=_M_uQ41xJbuWn(_xIuR+MA}l3}p_K>8$)nhgi7+IxBS=^>;Yu&ED3<_QsFYmyx2uW?$ zS@LhN*TEL8vpj!+E!J1(T_;jk=T*ABt~%9R-^%rmK||Juh1`R@RJVHHpatvOy6zct zVSSzO2hf)3LJyrt6=G-XhUi#+Cg}&;GNTkfswy}ZX|yr;bwS^smKh;NAHzkHHn>BI zffefha*_2LqU$K5dO9xW^kn1Wa+gk9uAg^7NLXH!aDPJsAt?T>M0K4Fcq>2Vzptq3 z0ixbzdFQ;gs>g^_udVKluK#@~s++QUC{n`PqgBPX-i`<D~Q-{0EM6OM$pbb56s(&^MbP+h;;zs0Zi<7q-5 z(Gvm3M(wZRM7IBEz!Z^mC*bwegz~ob)p8=+m$uF1&)%cAc|B23Hfi4zPGtK&WnVPi z+UAuel+BpFq<1aJub6t~wt(d`;}=QI-T^zqtPa>#X5EZXirL=j5vI>An!P<%#=#dr z?xF3LtP8dcEObYPtOxck>W$pt6ZPoGj>evNDBJaD>N}A=n#i4|Xh3N@O_=~?2dYlr zX(c@gwo~UOI+4zGqDK$p&Y}ZZc2{&#Ls)j{bgvUVn!f8l=fSR`^ohHoWg{f)Mvu1b zvSeeh_b|?&-9C{-J$5(tG=Z{5H`dgN>~U`0ZSq>e+1;k68I9L^f)xPFVWcv!(_cZN!&rE6oWuNx7bfQNGx$i%N+*dTnxIJO&-uKL&DBcBf_hh+} zS|NYGuGZR#9<8?jKh^dZRrBnN_OwC50iFJg6WN{av(FT5Y4$!dDHX~=?Mri_N1HkL zpJomgHFKYvNk_s5I=!6}+08WHZ;A{Wy5E%Tp?rv=wQ9eQmm%)$Z|vy^*)gJkoI+TBHMS2eLlK-ptkG=*_YI-i-NE z?dD?o?s8l|w+A8jIC2XPWyrx`UxD3VHU#VhSi6riBAW^8|)jf zfy{=1odP?=EC=i~SglVoWG>hlu&K<3gMABjp4kYnvtZ3W&5$F(z5`pzY!uizu)EAg zgMDwaK)27naLF-%=V5GkG((OBy8t%-s1-YonVQ^-dUAK~uqXGTp4=DVzi9glzQ~Z{ zfqp=Vp3EkIT>{&~Y$DiYX6k+)cFgBdOf_{`KdzhOaeY}ot|!r)W2T&ptRGS7&@oHq zfn5O${nC}yND2KEQo9AoV4V8u)n}!zOm#2usdKcGFu4tH`u4&c%>igE;BXmkW)U-zfARFk>gOk@YD2D zrhFajA5_|N%94x0?tzs#ZOJ8I_ffsaX`g4Q!&LQUPNb?YrDLZ}SqSz3l}eql%dBaZDY0`tQ1(#c}s2p3kK`V z>@Bd;V5^vI1bYnZ7PGg(%7C@F;FX)e$}&^q%)j8{wXusA;^Y=6<=_s#XvufLBv>}H ztzaQwdzl5m%7c~r!IIm+DuDI;!JG6hSVf_}WZLdT`q((pqc3h11zzC4`ypEHfTa>j zR=VVsJHaY5Qv>RL$tQNw)=P167nD%AuV3N?Hn1vS%`Wo-8(3AaIn4HeJq~t`+52E& z%v4KtfAop>X~vInaxWA&+y{TOJo~_^>7nj-BKtIqxKf?cuSCfM;2va7y<*9OVBu)z z_!Xb{fMR}%lOIB&ij9|1<7M8jV!c?hfqO3e7hCl1lMU*a4k67H~TUimTH zHR0}c&ByC(>*+F^c@HwfquF3~G=4t))B;77KQS*;in7z#?w6 zlqbOAz(z9r8mule)vv=heBx`0_&rXZgi;Ug9>4Q)99TTqMrNnL>Vw^5b{eb!SlUfq zjsr_zrdnEh(ahkEGy!g6nTVAK!1~xeKYSHvZ#8wlU^Gg6p23=O484+=rB^ zjSrm2HXeLn>NSp3QPPlf=Rr%)Lpaj3pFa%gcm6aCru)MLUbLF?Fd^IpC0+Z9IgzT% zOIY7OY#@RbR1gWC;*i>DV+kkH9azvuB#4p=7K()MQcyCqFW8Cff(x#Q&WWV~+Y9yC z>oJbhSFasJabukBWd~8#c-|-jR|oAX>(3Fw9a0XkBM(HavH6z>(Kb!dz5GG0qrRg0 z7=8I)1$~Wm;%P`W3VsOEg*yrL2L=)~I_VyUIFa2$fBhg4Ez0}52MM!I1s2t%+F6&0 zylj{0tjknHVrM<4+?CBiBE@yb@c$kp!a^!R?NX$=i;EOd+25l$k0KOe*CO#{7DK9l z`ijQ(O>xmxRPom>A>zWTLhPnH{kRjM)8k5raR2HOA}Tx#Ql>V#oe0LCm9cV3Hdcew zT^l`41Y>4No`!J$)RMw1UmfDJ+8W_97P>^6@(&(9e5n2};5(Sw`*-wqiREHmPN}kb zwx2B;-6yJ44gXCp6%vV3J&MHGQatpUpwAW2@ro85?4CvRGp4c@yw5Y`o0LB+Sfq+t z{{F#Y+W&l!+Mkb_y5aaA28+U&1|0DZ{zO83{#0wtk23Z7Q!)R?rG;8#_9s6kPIzjg zycKZa`-;ww0q`}IJnndZf8KfO!#Pkp`Sj4^9th_~8$uh5Dw9HZYP^6$0FNqIbUq9PIa%hsJpaw5AEcgqWVy*QiirFs6S3L??d1fF3!qp1_w8DlFTV;EO@w{>%;j}>SkDQ z4#(JLR}`&<+!gdJg3gWbhN3>Os(HeRvek}&0L$WQAySFkbJhP(h1DT2EjK}Jc2hiw?*5rahVVP0{) zDaso)Y`7qtpBKR^c;QuWL%-RuWCY(nf=@B*Qmmp8yn|bxqIy%(xX#DzvTeE^DGsQH zOYt|KPQ#zo5}AVkMkLs%=6cL{U^`QyL{AYskx#~dxDE7X_YO1Z>5G9KJ9|*$A3IG5A delta 11807 zcmZXa34Bb~`^N7X5faOZ*u_LF(OgMv5viq;n`B62nMlGUN>=+4iLEFaOI1}>bLgnr ztEzTls}icZtE%F!s;a21sG_Q<{NHo#liTvsPw(XYKF|A}<(@fr<|M@zJ&Lb;%x_y` zk%oUhnznH3b9O)5%3h+M-G8>ZobfS^*i=W1BfgIjo#;q2J;R!wVs&b1nj&Ma*@^K+bbMlbI%?brjZ(Ga)8pctiLvp?JqlsDUv zk>W^BL)}Y`vyw(XK}!#HkMfkY(t4*UuOl_pnQBg_N0On&8U5dp^q||KWZ`foH>fM? zr8&~m6CH9%Sz@VhUS@GLM^EG?I@8ScNJEd#Ef^j!X5iSdBL@KeH^KA4#Rwph{kDUa**-K zG0r4MTJNMJqhc|iPJ7g_RcMdMmiF{HoFn^7IfJT)7!=3+(v2-ZTJ>aVjv zVasx|mLip|&xlo7P96lWxAN*G*%7Rjcs5(-!4Rq`Aw(3C5-Qea>#VgnmYqb`fShpF zM)b)k;%(rqsl08)$(#t*PSnf|?9|>;s%s97#-vTPc~hq}EmBL~XLgfoj7SGKxvCK^ zM&w4Yj$(CgU~okZP80NR4SH8ojXc!wQ8gmO-P{D$UPR^jv1diUyae6}RcldhmeyJ9 z%+q-nFkjVDS8+2hR866;n!@KqgZx0M(JeoibrZw#i&&&Mlb>Lhy^wvUMMCY~E;IXH zSG5}@Vh6}}=MV5>hS)IRUpMUr=`D2iZ%#3@n+LkU&N5YcF~nH{RKhl<$IVSE@ot(9lEm^C`IhMeiv z8)kv1e>P8zcP3 zWwNni!nh(fPF$m($BWqU`RoO;c6=t~+FmH4>)00t^9g9V3$<3DO%&H&2xpT-z=R~a z7EB0dFN)O@GU@twg3cz3pos~53NpH>*_tY*Pt@5uAk(M}cUyW~Yk*QS*yIXMTM#qqq*AgL*yHguW)$6i2YR;%spk ze;rDKQs#+(X%XxVkufcd%@=d0B?Zoho~V|_n^q+EmlBHP(nwTGqxSSVOo*WA!`T9{ zV0tE7C~ngAEfF^(lextzx-Jrr==!$kGc%Jd7F+20j_`gtlPwVg=(<#ty_`hX>a)Vx zG7&wih%Fb}XC?3zXfsny@G?>J6+gC8w0b4ME)_YC&(mw9cC8gt%l3J-kE{|UuOzS) z;w-t}6%YR7?yuaPgH3mTgH8c8$dZx)K1Pkoox|w=IQpW@C{VH zZB}IZj*_obJRsk8D1(%5hZUK=s5f-BQw)1Ux9@^7SowBak?Gq)z7NIeH*~%S$`Fjg zcm72CM_@x$?p`Z0bJxz-**zRu~1qi)79jK=#-gVS?GvEg8Si5&nN0k)3V$6zDD z9uPYSRzOVNg`Op8>=Uu9q@Dc`lu@cjpIVXGqw6I)`%Kgmy8Uw~h06DZ6`8(%qKSH} z7OH*hOEG~mzJjMnWqfT#W=0t@id4p7aa!p78+b;e=e`RJ`w_4)s>-)kWL7C$ptGZ5 z@dBNH2W2cqcx*u=`%d^SH25(n<4`q^*!N)L!L|`Q4)y|=?Ja|!0Gj}oO6(-qM6gxF z{ts*t*ll8`z+ME4b{qT$u*qO0#7=`v0Xt9ZN3f}2?H3vR4A@I1E1kZmi~M*f_Aj2v ze}YyFf9g91KMOVuY!$Je!KQ=VCUy>N23YhGgZ~0H6Rd>Td9atk&J();HVdr%QiERv zdj)Jdv0uSv6O-%j*wRS5WO4(Wtv1(+2f=K${ag~Qm$l=Uk@YGn6)ZFO6|gyAWyG$6 zy@u*Fmq)UzB6)c@zXoM4+$GBm_M14qT<6!Jybh)M3WMDc$t!ez6Usa&vqj>@;!S;+<&i0b@`xKtls$^Ow?TyXRFLa_L@dMp71VFU8usut804NJefGLCd9ug zw56)5mlesXhLo4 zJgfodGBqSBz4ZN{5ScDZFINfYmzxR8RYFZ9EU!rTKmS^g zR;r2ewIWPZ{Q4k!ZGv(%E1#ICmF7f=c~qnh(pIS=U8x81o~^2A?eq2i&zL}d6|IYM ztDY#gij+xOHSu_Tpie!NdzT7i$lDdRp^yDv$hBOpzGaa&sDW6sLHBP6wp#U~kriPm zH#P(@KT&U^?%x>Fd&+3HA{hH`3}XIb)<)f@38Xa@BiX+(iU$C`uX@*1)ZCQ70z}_U zeyo`oze%?@hrU)-uW+wbC7O!8n{@iheQ8sKJrKSRl&_@~$zC)Soj02c{{yw~pJBqa zxuZP@rgbVsw<0rT9a7e*lvYf9PAT-^P2G(3Dka2<%#=o3ny9Y}>nY_$EtF{@dP}&y zHC!81P8%ySa~5pTSzA%ICBohg%0}gDZ$+lhcdO3AMAxkm_6|@sDPOo1nZEht>nQeY zjo=YbHk)%*vd!Sn0&T(cr4Z``wiRpzvCd%Ih-J|9-P)G+AEs7}NG%QKUEnK4?%Yy? zcLm!HcBa(Hp99;0dY!ks*mI&}dnbE0C_B|)BCW_A%$4mrixR#&bZ$V|g{nPw81`te z-6}W6ip<=#JIq_YTiw4{CO+K}WOu;yp-Sm)MP`ckPBZ00mC}QWXLbhhIGFaJ<*c0s zj|ck*s!icH^O@}-D-+Y7c)0NivaDdJ3LZJhyY=#w?W#@fl&es7|Hj|0<9|hU_!t}99dESc5lv^L^bTZIr zuWs)T<)HFqS&`|>*=v?Qs7hxuF=cO%JqM;wR7$QDnJEYN>MT!O->dU{D2H%+TI_SN z0b=sLPWFLNK2;S4S&>=c*gl;N7LWEt*oQ#*O!%#Rm9`2u~oTjt`Uz`g|QyWd5J2HW!o_%QEa zeb!X0IcNmGNV;4$@)l*Q?S#kFV|X%hk0ICh6DOYn_B~i3v8iCk!Hy7n3G4(| z$RQ^$20IBhhuAc*{{y>1Y&zH}u{@Tgsfn5MQOY9A>i(p+3JNbODUx~?`eDPtIT{79$uk;}yR~-h) zz2R3)KKtJkHNVk$39>GsQul8RF2F8>y+v#R*cGr##1?{GMT;Gexacru-Vr}Km|1s3 z=WgiNkaPZs!54x32G;&tgTD=S9c((W#b7tUjuCqY>?T;VqXu6B_B+^UVoSkpfgL2a z4D1hLa&~;bbJ>?$OwP^Ldv zJs>8>J^#4N{x6fgSZ_IGFV+c<6FT1j_7Ii2o-p`Eut#8XiERS=2i4DFE;w}UaT z`^0vD*@(#@$DMYu9b(04KRR04ds^qapjSf9-O~o&4dwwB`=h}>1gi|TfY=@|Pq2%` zJ_4%(*5Qo7_kvXgn@MaRm>1Y_Vr5|7U@d;4BPg(HU}K3L0ILpm=%)z&F<1>^a-800 zUF@L9I~&SBfl?FhWoHe32#kZ>B=#wo4_LRK4gMKeEwFjSJ_qv!JNt7)+!tWAnf#U5 zmsX_ijTKea2CCoh$Ze-K^Q0$UBii=NNPegJiV5erApSKH>Y#yH=OXxFu)4(L@D87I zvBRRpFQNP!DD~jZ`NiNz!0Ll-A@(g;1Cy1UH~3MYhOng&`wpxTG1<_H^Da8nx_>^D zAA{ltcZUl`-1lIO)wqva(SOI?nEiL$jh`5IV_-uOCDc-y!9Dd#1V00J zbGQ#(aj~C7=&?Sz~Zja;TBjBF*(zVuDRHG zaqF5NU9115+b=-Z)!bgRBJ=&8`db+LRm}RW2fqZR6>6XP&A~5&1%tJ{?%-FzLcnGc zy9yQxc8b_Fu-3$6zd~-f*flZpMkxOcN*lNj+%Wicu(n`6Hw}IRtQ}Ymv72D+!L|_l z9W0C(wN&!Ei%z{Veh=lhAasCv!S4qD11ucuBC*?G9l<)>GWZ>^2(ze|dCSG_h%>kR z=)mj#EuH@f{aNI+{lnn*z&e2y6Z;FSGuTmL_rbb=1>83H-(X$A3W+@cdk*Zt?Fjx5 ztQ#>ot)6#W?4iiI6Ka11B~sn!f2;@_`yHJ<7RTsXE*{;vD!-y!zWYDtHJOy9&TGp5 zTqJ+Rt#*|tG{5GaVW--P8LAPR6`75A{H5C}*+iSag185yXe1B%%ixv4V!(D1^8||p z^Sp2HDqs$WiBX!~7dSNm9OsRwR9NCKdUpJ!>RJKMJEiiZX9d zvNATdBD3JZM`6q^?mY_g_lM$Cz9v?Lf<6984-WuLVe;EqQ;L|)Q|m?h@I zw$==;Udq*69R0`7rv+Fl-57Od_VAyceiD|^7rj(EH_X-Yw0!!{SACLBd&|b+?1CO* z3+VsH<>lq_e>Z-9TfT11eTTK9#TluUT<}n>r!o2W7=dUhO%0=^6=4`}J`SS4AldU+ z4+$bkerlKB^dq%qznVqTRS_L&>1rL(bn@~j8)KqZc_W`z(0W&BFP2BKV6nH{&nE;@ zp9<-6d6Z8mpbJA^7{U6m(1r6@sDEon8LF>stjO%^!XKEwI$h3C3#6@W;h!wXza3ne zDyO{_nK|w*3`vnH{TXAre+0zmmGxOGg0+SRSv$Eq zdNAFmGsJ!vuX~gSi}L9L+P{MCm$YI9WK~dJnMLug@Mf#YY3k0Z%o12v_qxh###6tZ z9fXa@9plNCJ#`2@inON>p$oy>)v7Rg((Im5g&ns)hxT&R;JR6n99&cP*s4rtk?v*m z5?rx7a@F$4^Qf%WSgu+gQOL_xV`=KXU6mQ!0L%l7_97S!m=9P&Fjzvl@&-_8mv*VT z`TiV0r8Be`Bn-fWJoaKP7UQO02ZY*Vp$$}>cUY0x`4!&GJmMLs?tFKfd!IK8it7Q} zAeB_HUIv-{p$^DTiG!Z_BsJ)XPf~+awK$u*Ni`N^k4Lq^s#?W58jR5ms7CYG(>;$~ z>8=_Tb-OvcLBZd6llXxWleRO;$DEm0q;pz zv93k{cCW!Acq*JD3DT3&J+}rewp9128Z0zE4O)TfM7kBJPGFh}XqsNKK4=#_F--+D zO~qPoo96CWlZD&+pui|q&SgdBn3mLJ=E3$T%6d`DpsYhOD-*s#mDSgZ%&dAGS%s>t z=P9cjXYF`D_=?ni+uuEvGe4dMI2vPJ%UKVW<-WyPD9?sA29p!wLo=2GI2LfSgt>s@ z01p$i=K+paz09{FvzM)Eu_obiQH@s%X8_4^t&eB&*I4pRY-%;=&t(Q$sq%3$$X!^A zIzAZi1=aB(?!~oO8XpQcLG@#Z`%x|G+%Uk2fQi0zk1M8d5@3mh!{K}pHBb3c%@Kf; z;p|+SoFf6J02bF~^fyWFCADcs7zJ&rsaer~zi&-dgD!O6q6A(9%S&d$uAn+p%&RS( zLDgbj+H3B1fvonf?7FNq^GYD-uH>byG2sXGq_Zo1-U_jKY44cuTz%GzdF5*!nkT^v zCZu004P{;z=d{R2$e(>ITdzugKx4K3LjcQUULOD9IQ)cWFGG|Z`tb#ZTL$=dpNp%p;A(z-DDlbyD0%}H}6k&`)hJ#NWtOtkf=xig5> z@u(3&LKOY4y>jh?dhVtntVz}4QEz-xJoy_Yrg=QOt2l(+W$Z2YxYlfj&A0ik2d$ZB GrT+(s>c|rS From 80d9c6bda333a05ad00959884df17fb3472e1f79 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 28 Sep 2012 13:56:57 -0500 Subject: [PATCH 57/79] Fix strange character on commit 80090351de1c - IDEMPIERE-373 --- .../postgresql/919_IDEMPIERE-373_User_Locking.sql | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/migration/360lts-release/postgresql/919_IDEMPIERE-373_User_Locking.sql b/migration/360lts-release/postgresql/919_IDEMPIERE-373_User_Locking.sql index abd7b3ec57..aa39972caa 100644 --- a/migration/360lts-release/postgresql/919_IDEMPIERE-373_User_Locking.sql +++ b/migration/360lts-release/postgresql/919_IDEMPIERE-373_User_Locking.sql @@ -1,22 +1,18 @@ --- Sep 27, 2012 12:32:31 PM SGT +-- Sep 27, 2012 12:32:31 PM SGT -- IDEMPIERE-373 Implement User Locking UPDATE AD_Message SET MsgText='Reached the maximum number of login attempts, user account ({0}) is locked',Updated=TO_TIMESTAMP('2012-09-27 12:32:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200033 ; - -- Sep 27, 2012 12:32:31 PM SGT -- IDEMPIERE-373 Implement User Locking UPDATE AD_Message_Trl SET IsTranslated='N' WHERE AD_Message_ID=200033 ; - -- Sep 27, 2012 12:32:59 PM SGT -- IDEMPIERE-373 Implement User Locking UPDATE AD_Message SET MsgText='User account ({0}) is locked, please contact the system administrator',Updated=TO_TIMESTAMP('2012-09-27 12:32:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200032 ; - -- Sep 27, 2012 12:32:59 PM SGT -- IDEMPIERE-373 Implement User Locking UPDATE AD_Message_Trl SET IsTranslated='N' WHERE AD_Message_ID=200032 ; - SELECT register_migration_script('919_IDEMPIERE-373_User_Locking.sql') FROM dual ; From b65f9deeb9f26d6576230aee1231f88670c5a005 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 28 Sep 2012 20:05:00 -0500 Subject: [PATCH 58/79] IDEMPIERE-308 Performance: Replace with StringBuilder / fix a problem found with StringBuilder(int) --- .../src/org/adempiere/process/ExpenseTypesFromAccounts.java | 2 +- .../src/org/compiere/process/ProductionCreate.java | 2 +- .../src/org/compiere/process/ProductionProcess.java | 2 +- .../src/org/compiere/process/UniversalSubstitution.java | 2 +- .../src/org/adempiere/util/ModelInterfaceGenerator.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/org.adempiere.base.process/src/org/adempiere/process/ExpenseTypesFromAccounts.java b/org.adempiere.base.process/src/org/adempiere/process/ExpenseTypesFromAccounts.java index efd6182c00..4cc0c9f000 100644 --- a/org.adempiere.base.process/src/org/adempiere/process/ExpenseTypesFromAccounts.java +++ b/org.adempiere.base.process/src/org/adempiere/process/ExpenseTypesFromAccounts.java @@ -224,7 +224,7 @@ public class ExpenseTypesFromAccounts extends SvrProcess { } } - StringBuilder returnStr = new StringBuilder(addCount).append(" products added."); + StringBuilder returnStr = new StringBuilder().append(addCount).append(" products added."); if (skipCount>0) returnStr.append(" ").append(skipCount).append(" products skipped."); return(returnStr.toString()); diff --git a/org.adempiere.base.process/src/org/compiere/process/ProductionCreate.java b/org.adempiere.base.process/src/org/compiere/process/ProductionCreate.java index a51da43714..f1b23b0ea5 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ProductionCreate.java +++ b/org.adempiere.base.process/src/org/compiere/process/ProductionCreate.java @@ -105,7 +105,7 @@ public class ProductionCreate extends SvrProcess { m_production.setIsCreated("Y"); m_production.save(get_TrxName()); - StringBuilder msgreturn = new StringBuilder(created).append(" production lines were created"); + StringBuilder msgreturn = new StringBuilder().append(created).append(" production lines were created"); return msgreturn.toString(); } diff --git a/org.adempiere.base.process/src/org/compiere/process/ProductionProcess.java b/org.adempiere.base.process/src/org/compiere/process/ProductionProcess.java index 07a0a19dfa..db3c15de95 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ProductionProcess.java +++ b/org.adempiere.base.process/src/org/compiere/process/ProductionProcess.java @@ -84,7 +84,7 @@ public class ProductionProcess extends SvrProcess { m_production.setProcessed(true); m_production.saveEx(get_TrxName()); - StringBuilder msgreturn = new StringBuilder(processed).append(" production lines were processed"); + StringBuilder msgreturn = new StringBuilder().append(processed).append(" production lines were processed"); return msgreturn.toString(); } diff --git a/org.adempiere.base.process/src/org/compiere/process/UniversalSubstitution.java b/org.adempiere.base.process/src/org/compiere/process/UniversalSubstitution.java index 156381f256..f97fb83065 100644 --- a/org.adempiere.base.process/src/org/compiere/process/UniversalSubstitution.java +++ b/org.adempiere.base.process/src/org/compiere/process/UniversalSubstitution.java @@ -45,7 +45,7 @@ public class UniversalSubstitution extends SvrProcess { bom.saveEx(); count++; } - StringBuilder msgreturn = new StringBuilder(count).append(" BOM products updated"); + StringBuilder msgreturn = new StringBuilder().append(count).append(" BOM products updated"); return msgreturn.toString(); } diff --git a/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java b/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java index 594c138526..00732354c8 100644 --- a/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java +++ b/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java @@ -162,7 +162,7 @@ public class ModelInterfaceGenerator if (tableName == null) throw new RuntimeException("TableName not found for ID=" + AD_Table_ID); // - StringBuilder accessLevelInfo = new StringBuilder(accessLevel).append(" "); + StringBuilder accessLevelInfo = new StringBuilder().append(accessLevel).append(" "); if (accessLevel >= 4 ) accessLevelInfo.append("- System "); if (accessLevel == 2 || accessLevel == 3 || accessLevel == 6 || accessLevel == 7) From b875bd411bc84727996a9ba98bd204c8f0cad6ab Mon Sep 17 00:00:00 2001 From: Elaine Tan Date: Mon, 1 Oct 2012 17:56:05 +0800 Subject: [PATCH 59/79] IDEMPIERE-373 Implement User Locking - fix locking error message when involving multi-clients user --- org.adempiere.base/src/org/compiere/util/Login.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/util/Login.java b/org.adempiere.base/src/org/compiere/util/Login.java index 4c74695bca..43145f803e 100644 --- a/org.adempiere.base/src/org/compiere/util/Login.java +++ b/org.adempiere.base/src/org/compiere/util/Login.java @@ -1464,13 +1464,13 @@ public class Login } else { + boolean foundLockedAccount = false; for (MUser user : users) { if (user.isLocked()) { - // User account ({0}) is locked, please contact the system administrator - loginErrMsg = Msg.getMsg(m_ctx, "UserAccountLocked", new Object[] {app_user}); - break; + foundLockedAccount = true; + continue; } int count = user.getFailedLoginCount() + 1; @@ -1500,6 +1500,12 @@ public class Login if (!user.save()) log.severe("Failed to update user record with increase failed login count"); } + + if (loginErrMsg == null && foundLockedAccount) + { + // User account ({0}) is locked, please contact the system administrator + loginErrMsg = Msg.getMsg(m_ctx, "UserAccountLocked", new Object[] {app_user}); + } } return retValue; } From bd96df6367678d734ae70cdb49333130c7a9e770 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 1 Oct 2012 20:33:05 -0500 Subject: [PATCH 60/79] =?UTF-8?q?IDEMPIERE-308=20Performance:=20Replace=20?= =?UTF-8?q?with=20StringBuilder=20/=20Thanks=20to=20Richard=20Morales=20an?= =?UTF-8?q?d=20David=20Pe=C3=B1uela?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/compiere/model/CalloutAssignment.java | 10 +- .../src/org/compiere/model/CalloutOrder.java | 5 +- .../src/org/compiere/model/MAccount.java | 10 +- .../org/compiere/model/MAccountLookup.java | 12 +- .../org/compiere/model/MAcctProcessor.java | 16 +- .../src/org/compiere/model/MAcctSchema.java | 15 +- .../compiere/model/MAcctSchemaElement.java | 37 +++-- .../src/org/compiere/model/MAchievement.java | 2 +- .../src/org/compiere/model/MActivity.java | 6 +- .../src/org/compiere/model/MAd.java | 3 +- .../src/org/compiere/model/MAging.java | 2 +- .../src/org/compiere/model/MAlert.java | 2 +- .../org/compiere/model/MAlertRecipient.java | 2 +- .../src/org/compiere/model/MAlertRule.java | 41 ++--- .../org/compiere/model/MAllocationHdr.java | 26 +-- .../org/compiere/model/MAllocationLine.java | 26 +-- .../src/org/compiere/model/MArchive.java | 40 ++--- .../src/org/compiere/model/MAsset.java | 25 +-- .../org/compiere/model/MAssetDelivery.java | 2 +- .../org/compiere/model/MAssignmentSlot.java | 10 +- .../src/org/compiere/model/MAttachment.java | 27 +-- .../org/compiere/model/MAttachmentEntry.java | 13 +- .../src/org/compiere/model/MAttribute.java | 20 +-- .../compiere/model/MAttributeInstance.java | 2 +- .../src/org/compiere/model/MAttributeSet.java | 46 +++--- .../compiere/model/MAttributeSetInstance.java | 2 +- .../src/org/compiere/model/MAttributeUse.java | 46 +++--- .../src/org/compiere/model/MBOM.java | 10 +- .../org/compiere/model/MBPBankAccount.java | 2 +- .../src/org/compiere/model/MBPartner.java | 16 +- .../src/org/compiere/model/MBPartnerInfo.java | 4 +- .../org/compiere/model/MBPartnerLocation.java | 26 +-- .../src/org/compiere/model/MBank.java | 2 +- .../src/org/compiere/model/MBankAccount.java | 5 +- .../org/compiere/model/MBankStatement.java | 72 ++++---- .../compiere/model/MBankStatementLine.java | 24 +-- .../compiere/model/MBankStatementLoader.java | 2 +- .../src/org/compiere/model/MCStage.java | 23 +-- .../src/org/compiere/model/MCalendar.java | 3 +- .../src/org/compiere/model/MCash.java | 103 ++++++------ .../src/org/compiere/model/MCashPlanLine.java | 10 +- .../org/compiere/model/MChangeRequest.java | 3 +- .../src/org/compiere/model/MChat.java | 6 +- .../src/org/compiere/model/MClick.java | 4 +- .../src/org/compiere/model/MClickCount.java | 12 +- .../src/org/compiere/model/MClient.java | 120 +++++++------- .../src/org/compiere/model/MClientShare.java | 26 +-- .../src/org/compiere/model/MColor.java | 3 +- .../src/org/compiere/model/MColorSchema.java | 2 +- .../src/org/compiere/model/MColumn.java | 27 +-- .../src/org/compiere/model/MColumnAccess.java | 9 +- .../org/compiere/model/MContactInterest.java | 2 +- .../src/org/compiere/model/MContainer.java | 53 +++--- .../org/compiere/model/MConversionRate.java | 2 +- .../src/org/compiere/model/MCost.java | 144 ++++++++-------- .../src/org/compiere/model/MCostDetail.java | 119 ++++++------- .../src/org/compiere/model/MCostElement.java | 2 +- .../src/org/compiere/model/MCostQueue.java | 22 +-- .../src/org/compiere/model/MCostType.java | 2 +- .../src/org/compiere/model/MCurrency.java | 15 +- .../org/compiere/model/MDashboardContent.java | 24 +-- .../compiere/model/MDashboardPreference.java | 24 +-- .../compiere/model/MDepreciationWorkfile.java | 6 +- .../src/org/compiere/model/MDesktop.java | 29 ++-- .../compiere/model/MDiscountSchemaBreak.java | 2 +- .../src/org/compiere/model/MDistribution.java | 12 +- .../model/MDistributionRunDetail.java | 12 +- .../compiere/model/MDistributionRunLine.java | 4 +- .../src/org/compiere/model/MDocType.java | 39 ++--- .../org/compiere/model/MDocTypeCounter.java | 2 +- .../src/org/compiere/model/MDunning.java | 2 +- .../org/compiere/model/MDunningRunEntry.java | 18 +- .../org/compiere/model/MDunningRunLine.java | 20 +-- .../src/org/compiere/model/MEXPFormat.java | 6 +- .../org/compiere/model/MEXPFormatLine.java | 4 +- .../src/org/compiere/model/MEXPProcessor.java | 2 +- .../src/org/compiere/model/MElementValue.java | 4 +- .../src/org/compiere/model/MExpenseType.java | 3 +- .../src/org/compiere/model/MFactAcct.java | 2 +- .../src/org/compiere/model/MGLCategory.java | 13 +- .../src/org/compiere/model/MGoal.java | 2 +- .../org/compiere/model/MGoalRestriction.java | 2 +- .../src/org/compiere/model/MIMPProcessor.java | 13 +- .../src/org/compiere/model/MImage.java | 3 +- .../src/org/compiere/model/MInOut.java | 153 +++++++++-------- .../src/org/compiere/model/MInOutConfirm.java | 106 ++++++------ .../src/org/compiere/model/MInOutLine.java | 8 +- .../src/org/compiere/model/MInOutLineMA.java | 10 +- .../src/org/compiere/model/MIndex.java | 20 +-- .../src/org/compiere/model/MInterestArea.java | 2 +- .../src/org/compiere/model/MInventory.java | 77 +++++---- .../org/compiere/model/MInventoryLine.java | 8 +- .../org/compiere/model/MInventoryLineMA.java | 18 +- .../src/org/compiere/model/MInvoice.java | 156 +++++++++--------- .../src/org/compiere/model/MInvoiceBatch.java | 6 +- .../org/compiere/model/MInvoiceBatchLine.java | 10 +- .../src/org/compiere/model/MInvoiceLine.java | 55 +++--- .../compiere/model/MInvoicePaySchedule.java | 18 +- .../src/org/compiere/model/MInvoiceTax.java | 2 +- .../src/org/compiere/model/MIssue.java | 50 +++--- .../src/org/compiere/model/MIssueProject.java | 2 +- .../src/org/compiere/model/MIssueSystem.java | 2 +- .../src/org/compiere/model/MIssueUser.java | 2 +- .../src/org/compiere/model/MJournal.java | 114 +++++++------ .../src/org/compiere/model/MJournalBatch.java | 84 +++++----- .../src/org/compiere/model/MJournalLine.java | 24 +-- .../src/org/compiere/model/MLandedCost.java | 2 +- .../org/compiere/model/MLdapProcessor.java | 111 +++++++------ .../src/org/compiere/model/MLocation.java | 32 ++-- .../org/compiere/model/MLocationLookup.java | 6 +- .../src/org/compiere/model/MLocator.java | 6 +- .../org/compiere/model/MLocatorLookup.java | 11 +- .../src/org/compiere/model/MLookup.java | 50 +++--- .../src/org/compiere/model/MLookupCache.java | 6 +- .../org/compiere/model/MLookupFactory.java | 70 ++++---- .../src/org/compiere/model/MLookupInfo.java | 9 +- .../src/org/compiere/model/MMailText.java | 14 +- .../src/org/compiere/model/MMatchPO.java | 10 +- .../src/org/compiere/model/MMeasure.java | 22 +-- .../src/org/compiere/model/M_Element.java | 20 +-- 120 files changed, 1512 insertions(+), 1355 deletions(-) diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutAssignment.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutAssignment.java index 943f3ee846..071743bc89 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutAssignment.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutAssignment.java @@ -57,7 +57,7 @@ public class CalloutAssignment extends CalloutEngine return ""; int M_Product_ID = 0; - String Name = null; + StringBuilder Name = null; String Description = null; BigDecimal Qty = null; String sql = "SELECT p.M_Product_ID, ra.Name, ra.Description, ra.Qty " @@ -74,7 +74,7 @@ public class CalloutAssignment extends CalloutEngine if (rs.next()) { M_Product_ID = rs.getInt (1); - Name = rs.getString(2); + Name = new StringBuilder(rs.getString(2)); Description = rs.getString(3); Qty = rs.getBigDecimal(4); } @@ -94,9 +94,9 @@ public class CalloutAssignment extends CalloutEngine { mTab.setValue ("M_Product_ID", new Integer (M_Product_ID)); if (Description != null) - Name += " (" + Description + ")"; - if (!".".equals(Name)) - mTab.setValue("Description", Name); + Name.append(" (").append(Description).append(")"); + if (!".".equals(Name.toString())) + mTab.setValue("Description", Name.toString()); // String variable = "Qty"; // TimeExpenseLine if (mTab.getTableName().startsWith("C_Order")) diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java index 12771ba6ba..21b96bc58b 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java @@ -1317,8 +1317,9 @@ public class CalloutOrder extends CalloutEngine BigDecimal total = available.subtract(notReserved); if (total.compareTo(QtyOrdered) < 0) { - String info = Msg.parseTranslation(ctx, "@QtyAvailable@=" + available - + " - @QtyNotReserved@=" + notReserved + " = " + total); + StringBuilder msgpts = new StringBuilder("@QtyAvailable@=").append(available) + .append(" - @QtyNotReserved@=").append(notReserved).append(" = ").append(total); + String info = Msg.parseTranslation(ctx, msgpts.toString()); mTab.fireDataStatusEEvent ("InsufficientQtyAvailable", info, false); } diff --git a/org.adempiere.base/src/org/compiere/model/MAccount.java b/org.adempiere.base/src/org/compiere/model/MAccount.java index 173adc77ec..7739a61a1b 100644 --- a/org.adempiere.base/src/org/compiere/model/MAccount.java +++ b/org.adempiere.base/src/org/compiere/model/MAccount.java @@ -74,7 +74,7 @@ public class MAccount extends X_C_ValidCombination int C_Project_ID, int C_Campaign_ID, int C_Activity_ID, int User1_ID, int User2_ID, int UserElement1_ID, int UserElement2_ID) { - StringBuffer info = new StringBuffer(); + StringBuilder info = new StringBuilder(); info.append("AD_Client_ID=").append(AD_Client_ID).append(",AD_Org_ID=").append(AD_Org_ID); // Schema info.append(",C_AcctSchema_ID=").append(C_AcctSchema_ID); @@ -83,7 +83,7 @@ public class MAccount extends X_C_ValidCombination ArrayList params = new ArrayList(); // Mandatory fields - StringBuffer whereClause = new StringBuffer("AD_Client_ID=?" // #1 + StringBuilder whereClause = new StringBuilder("AD_Client_ID=?" // #1 + " AND AD_Org_ID=?" + " AND C_AcctSchema_ID=?" + " AND Account_ID=?"); // #4 @@ -422,7 +422,7 @@ public class MAccount extends X_C_ValidCombination */ public String toString() { - StringBuffer sb = new StringBuffer("MAccount=["); + StringBuilder sb = new StringBuilder("MAccount=["); sb.append(getC_ValidCombination_ID()); if (getCombination() != null) sb.append(",") @@ -545,8 +545,8 @@ public class MAccount extends X_C_ValidCombination */ public void setValueDescription() { - StringBuffer combi = new StringBuffer(); - StringBuffer descr = new StringBuffer(); + StringBuilder combi = new StringBuilder(); + StringBuilder descr = new StringBuilder(); boolean fullyQualified = true; // MAcctSchema as = new MAcctSchema(getCtx(), getC_AcctSchema_ID(), get_TrxName()); // In Trx! diff --git a/org.adempiere.base/src/org/compiere/model/MAccountLookup.java b/org.adempiere.base/src/org/compiere/model/MAccountLookup.java index af7169b88e..cee7604a5f 100644 --- a/org.adempiere.base/src/org/compiere/model/MAccountLookup.java +++ b/org.adempiere.base/src/org/compiere/model/MAccountLookup.java @@ -66,8 +66,10 @@ public final class MAccountLookup extends Lookup implements Serializable */ public String getDisplay (Object value) { - if (!containsKey (value)) - return "<" + value.toString() + ">"; + if (!containsKey (value)){ + StringBuilder msgreturn = new StringBuilder("<").append(value.toString()).append(">"); + return msgreturn.toString(); + } return toString(); } // getDisplay @@ -189,9 +191,9 @@ public final class MAccountLookup extends Lookup implements Serializable for(MAccount account :accounts) { - list.add (new KeyNamePair(account.getC_ValidCombination_ID(), - account.getCombination() + " - " + - account.getDescription())); + StringBuilder msglist = new StringBuilder(account.getCombination()).append(" - ") + .append(account.getDescription()); + list.add (new KeyNamePair(account.getC_ValidCombination_ID(), msglist.toString())); } // Sort & return return list; diff --git a/org.adempiere.base/src/org/compiere/model/MAcctProcessor.java b/org.adempiere.base/src/org/compiere/model/MAcctProcessor.java index d57a359468..ba6d4d9131 100644 --- a/org.adempiere.base/src/org/compiere/model/MAcctProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/MAcctProcessor.java @@ -94,8 +94,9 @@ public class MAcctProcessor extends X_C_AcctProcessor { this (client.getCtx(), 0, client.get_TrxName()); setClientOrg(client); - setName (client.getName() + " - " - + Msg.translate(getCtx(), "C_AcctProcessor_ID")); + StringBuilder msgset = new StringBuilder(client.getName()).append(" - ") + .append(Msg.translate(getCtx(), "C_AcctProcessor_ID")); + setName (msgset.toString()); setSupervisor_ID (Supervisor_ID); } // MAcctProcessor @@ -107,7 +108,8 @@ public class MAcctProcessor extends X_C_AcctProcessor */ public String getServerID () { - return "AcctProcessor" + get_ID(); + StringBuilder msgreturn = new StringBuilder("AcctProcessor").append(get_ID()); + return msgreturn.toString(); } // getServerID /** @@ -144,10 +146,10 @@ public class MAcctProcessor extends X_C_AcctProcessor { if (getKeepLogDays() < 1) return 0; - String sql = "DELETE C_AcctProcessorLog " - + "WHERE C_AcctProcessor_ID=" + getC_AcctProcessor_ID() - + " AND (Created+" + getKeepLogDays() + ") < SysDate"; - int no = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("DELETE C_AcctProcessorLog ") + .append("WHERE C_AcctProcessor_ID=").append(getC_AcctProcessor_ID()) + .append(" AND (Created+").append(getKeepLogDays()).append(") < SysDate"); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); return no; } // deleteLog diff --git a/org.adempiere.base/src/org/compiere/model/MAcctSchema.java b/org.adempiere.base/src/org/compiere/model/MAcctSchema.java index dca3bd7ba1..2d06d2f56b 100644 --- a/org.adempiere.base/src/org/compiere/model/MAcctSchema.java +++ b/org.adempiere.base/src/org/compiere/model/MAcctSchema.java @@ -105,17 +105,17 @@ public class MAcctSchema extends X_C_AcctSchema list.add(as); ArrayList params = new ArrayList(); - String whereClause = "IsActive=? " - + " AND EXISTS (SELECT * FROM C_AcctSchema_GL gl WHERE C_AcctSchema.C_AcctSchema_ID=gl.C_AcctSchema_ID)" - + " AND EXISTS (SELECT * FROM C_AcctSchema_Default d WHERE C_AcctSchema.C_AcctSchema_ID=d.C_AcctSchema_ID)"; + StringBuilder whereClause = new StringBuilder("IsActive=? ") + .append(" AND EXISTS (SELECT * FROM C_AcctSchema_GL gl WHERE C_AcctSchema.C_AcctSchema_ID=gl.C_AcctSchema_ID)") + .append(" AND EXISTS (SELECT * FROM C_AcctSchema_Default d WHERE C_AcctSchema.C_AcctSchema_ID=d.C_AcctSchema_ID)"); params.add("Y"); if (AD_Client_ID != 0) { - whereClause += " AND AD_Client_ID=?"; + whereClause.append(" AND AD_Client_ID=?"); params.add(AD_Client_ID); } - List ass = new Query(ctx, I_C_AcctSchema.Table_Name,whereClause,trxName) + List ass = new Query(ctx, I_C_AcctSchema.Table_Name,whereClause.toString(),trxName) .setParameters(params) .setOrderBy(MAcctSchema.COLUMNNAME_C_AcctSchema_ID) .list(); @@ -195,7 +195,8 @@ public class MAcctSchema extends X_C_AcctSchema this (client.getCtx(), 0, client.get_TrxName()); setClientOrg(client); setC_Currency_ID (currency.getKey()); - setName (client.getName() + " " + getGAAP() + "/" + get_ColumnCount() + " " + currency.getName()); + StringBuilder msgset = new StringBuilder(client.getName()).append(" ").append(getGAAP()).append("/").append(get_ColumnCount()).append(" ").append(currency.getName()); + setName (msgset.toString()); } // MAcctSchema @@ -291,7 +292,7 @@ public class MAcctSchema extends X_C_AcctSchema */ public String toString() { - StringBuffer sb = new StringBuffer("AcctSchema["); + StringBuilder sb = new StringBuilder("AcctSchema["); sb.append(get_ID()).append("-").append(getName()) .append("]"); return sb.toString(); diff --git a/org.adempiere.base/src/org/compiere/model/MAcctSchemaElement.java b/org.adempiere.base/src/org/compiere/model/MAcctSchemaElement.java index 0a76f3eaaa..9c55b8f8f0 100644 --- a/org.adempiere.base/src/org/compiere/model/MAcctSchemaElement.java +++ b/org.adempiere.base/src/org/compiere/model/MAcctSchemaElement.java @@ -388,10 +388,11 @@ public final class MAcctSchemaElement extends X_C_AcctSchema_Element */ public String toString() { - return "AcctSchemaElement[" + get_ID() - + "-" + getName() - + "(" + getElementType() + ")=" + getDefaultValue() - + ",Pos=" + getSeqNo() + "]"; + StringBuilder msgreturn = new StringBuilder("AcctSchemaElement[").append(get_ID()) + .append("-").append(getName()) + .append("(").append(getElementType()).append(")=").append(getDefaultValue()) + .append(",Pos=").append(getSeqNo()).append("]"); + return msgreturn.toString(); } // toString @@ -486,10 +487,10 @@ public final class MAcctSchemaElement extends X_C_AcctSchema_Element s_cache.clear(); // Resequence - if (newRecord || is_ValueChanged(COLUMNNAME_SeqNo)) - MAccount.updateValueDescription(getCtx(), - "AD_Client_ID=" + getAD_Client_ID(), get_TrxName()); - + if (newRecord || is_ValueChanged(COLUMNNAME_SeqNo)){ + StringBuilder msguvd = new StringBuilder("AD_Client_ID=").append(getAD_Client_ID()); + MAccount.updateValueDescription(getCtx(), msguvd.toString(), get_TrxName()); + } return success; } // afterSave @@ -500,16 +501,16 @@ public final class MAcctSchemaElement extends X_C_AcctSchema_Element */ private void updateData (String element, int id) { - MAccount.updateValueDescription(getCtx(), - element + "=" + id, get_TrxName()); + StringBuilder msguvd = new StringBuilder(element).append("=").append(id); + MAccount.updateValueDescription(getCtx(),msguvd.toString(), get_TrxName()); // - String sql = "UPDATE C_ValidCombination SET " + element + "=" + id - + " WHERE " + element + " IS NULL AND AD_Client_ID=" + getAD_Client_ID(); - int noC = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("UPDATE C_ValidCombination SET ").append(element).append("=").append(id) + .append(" WHERE ").append(element).append(" IS NULL AND AD_Client_ID=").append(getAD_Client_ID()); + int noC = DB.executeUpdate(sql.toString(), get_TrxName()); // - sql = "UPDATE Fact_Acct SET " + element + "=" + id - + " WHERE " + element + " IS NULL AND C_AcctSchema_ID=" + getC_AcctSchema_ID(); - int noF = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE Fact_Acct SET ").append(element).append("=").append(id) + .append(" WHERE ").append(element).append(" IS NULL AND C_AcctSchema_ID=").append(getC_AcctSchema_ID()); + int noF = DB.executeUpdate(sql.toString(), get_TrxName()); // log.fine("ValidCombination=" + noC + ", Fact=" + noF); } // updateData @@ -535,8 +536,8 @@ public final class MAcctSchemaElement extends X_C_AcctSchema_Element protected boolean afterDelete (boolean success) { // Update Account Info - MAccount.updateValueDescription(getCtx(), - "AD_Client_ID=" + getAD_Client_ID(), get_TrxName()); + StringBuilder msguvd = new StringBuilder("AD_Client_ID=").append(getAD_Client_ID()); + MAccount.updateValueDescription(getCtx(),msguvd.toString(), get_TrxName()); // s_cache.clear(); return success; diff --git a/org.adempiere.base/src/org/compiere/model/MAchievement.java b/org.adempiere.base/src/org/compiere/model/MAchievement.java index 8c2a90d2da..b8b414dc45 100644 --- a/org.adempiere.base/src/org/compiere/model/MAchievement.java +++ b/org.adempiere.base/src/org/compiere/model/MAchievement.java @@ -98,7 +98,7 @@ public class MAchievement extends X_PA_Achievement */ public String toString () { - StringBuffer sb = new StringBuffer ("MAchievement["); + StringBuilder sb = new StringBuilder ("MAchievement["); sb.append (get_ID()).append ("-").append (getName()).append ("]"); return sb.toString (); } // toString diff --git a/org.adempiere.base/src/org/compiere/model/MActivity.java b/org.adempiere.base/src/org/compiere/model/MActivity.java index ea0e267c44..d7a87b6560 100644 --- a/org.adempiere.base/src/org/compiere/model/MActivity.java +++ b/org.adempiere.base/src/org/compiere/model/MActivity.java @@ -110,8 +110,10 @@ public class MActivity extends X_C_Activity if (newRecord) insert_Tree(MTree_Base.TREETYPE_Activity); // Value/Name change - if (!newRecord && (is_ValueChanged("Value") || is_ValueChanged("Name"))) - MAccount.updateValueDescription(getCtx(), "C_Activity_ID=" + getC_Activity_ID(), get_TrxName()); + if (!newRecord && (is_ValueChanged("Value") || is_ValueChanged("Name"))){ + StringBuilder msguvd = new StringBuilder("C_Activity_ID=").append(getC_Activity_ID()); + MAccount.updateValueDescription(getCtx(), msguvd.toString(), get_TrxName()); + } return true; } // afterSave diff --git a/org.adempiere.base/src/org/compiere/model/MAd.java b/org.adempiere.base/src/org/compiere/model/MAd.java index 3ba7ceabc0..76a2c8ee97 100644 --- a/org.adempiere.base/src/org/compiere/model/MAd.java +++ b/org.adempiere.base/src/org/compiere/model/MAd.java @@ -72,7 +72,8 @@ public class MAd extends X_CM_Ad */ public static MAd getNext(Properties ctx, int CM_Ad_Cat_ID, String trxName) { MAd thisAd = null; - int [] thisAds = MAd.getAllIDs("CM_Ad","ActualImpression+StartImpression 0) sql.append(" WHERE ").append(getWhereClause()); - String finalSQL = sql.toString(); + StringBuilder finalSQL = new StringBuilder(sql.toString()); // // Apply Security: if (applySecurity) { @@ -118,14 +118,14 @@ public class MAlertRule extends X_AD_AlertRule if (AD_Role_ID != -1) { MRole role = MRole.get(getCtx(), AD_Role_ID); - finalSQL = role.addAccessSQL(finalSQL, null, true, false); + finalSQL = new StringBuilder(role.addAccessSQL(finalSQL.toString(), null, true, false)); } } } // if (getOtherClause() != null && getOtherClause().length() > 0) - finalSQL += " " + getOtherClause(); - return finalSQL; + finalSQL.append(" ").append(getOtherClause()); + return finalSQL.toString(); } // getSql /** @@ -139,12 +139,14 @@ public class MAlertRule extends X_AD_AlertRule { throw new IllegalArgumentException("Parameter extension cannot be empty"); } - String name = new SimpleDateFormat("yyyyMMddhhmm").format(new Timestamp(System.currentTimeMillis())) - +"_"+Util.stripDiacritics(getName().trim()); + StringBuilder msgname = new StringBuilder(new SimpleDateFormat("yyyyMMddhhmm").format(new Timestamp(System.currentTimeMillis()))) + .append("_").append(Util.stripDiacritics(getName().trim())); + String name = msgname.toString(); File file = null; try { - file = new File(System.getProperty("java.io.tmpdir"), name+"."+extension); + StringBuilder msgp = new StringBuilder(name).append(".").append(extension); + file = new File(System.getProperty("java.io.tmpdir"), msgp.toString()); file.createNewFile(); return file; } @@ -156,7 +158,8 @@ public class MAlertRule extends X_AD_AlertRule String filePrefix = "Alert_"; // TODO: add AD_AlertRule.FileName (maybe) try { - file = File.createTempFile(filePrefix, "."+extension); + StringBuilder msgctf = new StringBuilder(".").append(extension); + file = File.createTempFile(filePrefix, msgctf.toString()); } catch (IOException e) { @@ -198,16 +201,14 @@ public class MAlertRule extends X_AD_AlertRule * @return true if success */ private boolean updateParent() { - final String sql_count = "SELECT COUNT(*) FROM "+Table_Name+" r" - +" WHERE r."+COLUMNNAME_AD_Alert_ID+"=a."+MAlert.COLUMNNAME_AD_Alert_ID - +" AND r."+COLUMNNAME_IsValid+"='N'" - +" AND r.IsActive='Y'" - ; - final String sql = "UPDATE "+MAlert.Table_Name+" a SET " - +" "+MAlert.COLUMNNAME_IsValid+"=(CASE WHEN ("+sql_count+") > 0 THEN 'N' ELSE 'Y' END)" - +" WHERE a."+MAlert.COLUMNNAME_AD_Alert_ID+"=?" - ; - int no = DB.executeUpdate(sql, getAD_Alert_ID(), get_TrxName()); + StringBuilder sql_count = new StringBuilder("SELECT COUNT(*) FROM ").append(Table_Name).append(" r") + .append(" WHERE r.").append(COLUMNNAME_AD_Alert_ID).append("=a.").append(MAlert.COLUMNNAME_AD_Alert_ID) + .append(" AND r.").append(COLUMNNAME_IsValid).append("='N'") + .append(" AND r.IsActive='Y'"); + StringBuilder sql = new StringBuilder("UPDATE ").append(MAlert.Table_Name).append(" a SET ") + .append(" ").append(MAlert.COLUMNNAME_IsValid).append("=(CASE WHEN (").append(sql_count).append(") > 0 THEN 'N' ELSE 'Y' END)") + .append(" WHERE a.").append(MAlert.COLUMNNAME_AD_Alert_ID).append("=?"); + int no = DB.executeUpdate(sql.toString(), getAD_Alert_ID(), get_TrxName()); return no == 1; } @@ -217,7 +218,7 @@ public class MAlertRule extends X_AD_AlertRule */ public String toString () { - StringBuffer sb = new StringBuffer ("MAlertRule["); + StringBuilder sb = new StringBuilder ("MAlertRule["); sb.append(get_ID()) .append("-").append(getName()) .append(",Valid=").append(isValid()) diff --git a/org.adempiere.base/src/org/compiere/model/MAllocationHdr.java b/org.adempiere.base/src/org/compiere/model/MAllocationHdr.java index a861aa9cec..0917529f45 100644 --- a/org.adempiere.base/src/org/compiere/model/MAllocationHdr.java +++ b/org.adempiere.base/src/org/compiere/model/MAllocationHdr.java @@ -278,10 +278,10 @@ public final class MAllocationHdr extends X_C_AllocationHdr implements DocAction super.setProcessed (processed); if (get_ID() == 0) return; - String sql = "UPDATE C_AllocationHdr SET Processed='" - + (processed ? "Y" : "N") - + "' WHERE C_AllocationHdr_ID=" + getC_AllocationHdr_ID(); - int no = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("UPDATE C_AllocationHdr SET Processed='") + .append((processed ? "Y" : "N")) + .append("' WHERE C_AllocationHdr_ID=").append(getC_AllocationHdr_ID()); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); m_lines = null; log.fine(processed + " - #" + no); } // setProcessed @@ -411,10 +411,10 @@ public final class MAllocationHdr extends X_C_AllocationHdr implements DocAction { if (line.getC_Invoice_ID() != 0) { - final String whereClause = I_C_Invoice.COLUMNNAME_C_Invoice_ID + "=? AND " - + I_C_Invoice.COLUMNNAME_IsPaid + "=? AND " - + I_C_Invoice.COLUMNNAME_DocStatus + " NOT IN (?,?)"; - boolean InvoiceIsPaid = new Query(getCtx(), I_C_Invoice.Table_Name, whereClause, get_TrxName()) + StringBuilder whereClause = new StringBuilder(I_C_Invoice.COLUMNNAME_C_Invoice_ID).append("=? AND ") + .append(I_C_Invoice.COLUMNNAME_IsPaid).append("=? AND ") + .append(I_C_Invoice.COLUMNNAME_DocStatus).append(" NOT IN (?,?)"); + boolean InvoiceIsPaid = new Query(getCtx(), I_C_Invoice.Table_Name, whereClause.toString(), get_TrxName()) .setClient_ID() .setParameters(line.getC_Invoice_ID(), "Y", X_C_Invoice.DOCSTATUS_Voided, X_C_Invoice.DOCSTATUS_Reversed) .match(); @@ -638,7 +638,7 @@ public final class MAllocationHdr extends X_C_AllocationHdr implements DocAction */ public String toString () { - StringBuffer sb = new StringBuffer ("MAllocationHdr["); + StringBuilder sb = new StringBuilder ("MAllocationHdr["); sb.append(get_ID()).append("-").append(getSummary()).append ("]"); return sb.toString (); } // toString @@ -649,7 +649,8 @@ public final class MAllocationHdr extends X_C_AllocationHdr implements DocAction */ public String getDocumentInfo() { - return Msg.getElement(getCtx(), "C_AllocationHdr_ID") + " " + getDocumentNo(); + StringBuilder msgreturn = new StringBuilder(Msg.getElement(getCtx(), "C_AllocationHdr_ID")).append(" ").append(getDocumentNo()); + return msgreturn.toString(); } // getDocumentInfo /** @@ -660,7 +661,8 @@ public final class MAllocationHdr extends X_C_AllocationHdr implements DocAction { try { - File temp = File.createTempFile(get_TableName()+get_ID()+"_", ".pdf"); + StringBuilder msgctf = new StringBuilder(get_TableName()).append(get_ID()).append("_"); + File temp = File.createTempFile(msgctf.toString(), ".pdf"); return createPDF (temp); } catch (Exception e) @@ -689,7 +691,7 @@ public final class MAllocationHdr extends X_C_AllocationHdr implements DocAction */ public String getSummary() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append(getDocumentNo()); // : Total Lines = 123.00 (#1) sb.append(": ") diff --git a/org.adempiere.base/src/org/compiere/model/MAllocationLine.java b/org.adempiere.base/src/org/compiere/model/MAllocationLine.java index c4fee6740a..bfd739c63d 100644 --- a/org.adempiere.base/src/org/compiere/model/MAllocationLine.java +++ b/org.adempiere.base/src/org/compiere/model/MAllocationLine.java @@ -221,7 +221,7 @@ public class MAllocationLine extends X_C_AllocationLine */ public String toString () { - StringBuffer sb = new StringBuffer ("MAllocationLine["); + StringBuilder sb = new StringBuilder ("MAllocationLine["); sb.append(get_ID()); if (getC_Payment_ID() != 0) sb.append(",C_Payment_ID=").append(getC_Payment_ID()); @@ -296,12 +296,12 @@ public class MAllocationLine extends X_C_AllocationLine } // Link to Order - String update = "UPDATE C_Order o " - + "SET C_Payment_ID=" - + (reverse ? "NULL " : "(SELECT C_Payment_ID FROM C_Invoice WHERE C_Invoice_ID=" + C_Invoice_ID + ") ") - + "WHERE o.C_Order_ID = (SELECT i.C_Order_ID FROM C_Invoice i " - + "WHERE i.C_Invoice_ID=" + C_Invoice_ID + ")"; - if (DB.executeUpdate(update, get_TrxName()) > 0) + StringBuilder update = new StringBuilder("UPDATE C_Order o ") + .append("SET C_Payment_ID=") + .append((reverse ? "NULL " : "(SELECT C_Payment_ID FROM C_Invoice WHERE C_Invoice_ID=")).append(C_Invoice_ID).append(") ") + .append("WHERE o.C_Order_ID = (SELECT i.C_Order_ID FROM C_Invoice i ") + .append("WHERE i.C_Invoice_ID=").append(C_Invoice_ID).append(")"); + if (DB.executeUpdate(update.toString(), get_TrxName()) > 0) log.fine("C_Payment_ID=" + C_Payment_ID + (reverse ? " UnLinked from" : " Linked to") + " order of C_Invoice_ID=" + C_Invoice_ID); @@ -325,12 +325,12 @@ public class MAllocationLine extends X_C_AllocationLine } // Link to Order - String update = "UPDATE C_Order o " - + "SET C_CashLine_ID=" - + (reverse ? "NULL " : "(SELECT C_CashLine_ID FROM C_Invoice WHERE C_Invoice_ID=" + C_Invoice_ID + ") ") - + "WHERE o.C_Order_ID = (SELECT i.C_Order_ID FROM C_Invoice i " - + "WHERE i.C_Invoice_ID=" + C_Invoice_ID + ")"; - if (DB.executeUpdate(update, get_TrxName()) > 0) + StringBuilder update = new StringBuilder("UPDATE C_Order o ") + .append("SET C_CashLine_ID=") + .append((reverse ? "NULL " : "(SELECT C_CashLine_ID FROM C_Invoice WHERE C_Invoice_ID=")).append(C_Invoice_ID).append(") ") + .append("WHERE o.C_Order_ID = (SELECT i.C_Order_ID FROM C_Invoice i ") + .append("WHERE i.C_Invoice_ID=").append(C_Invoice_ID).append(")"); + if (DB.executeUpdate(update.toString(), get_TrxName()) > 0) log.fine("C_CashLine_ID=" + C_CashLine_ID + (reverse ? " UnLinked from" : " Linked to") + " order of C_Invoice_ID=" + C_Invoice_ID); diff --git a/org.adempiere.base/src/org/compiere/model/MArchive.java b/org.adempiere.base/src/org/compiere/model/MArchive.java index 2992e9a01c..cd843f2948 100644 --- a/org.adempiere.base/src/org/compiere/model/MArchive.java +++ b/org.adempiere.base/src/org/compiere/model/MArchive.java @@ -79,13 +79,13 @@ public class MArchive extends X_AD_Archive { public static MArchive[] get(Properties ctx, String whereClause) { ArrayList list = new ArrayList(); PreparedStatement pstmt = null; - String sql = "SELECT * FROM AD_Archive WHERE AD_Client_ID=?"; + StringBuilder sql = new StringBuilder("SELECT * FROM AD_Archive WHERE AD_Client_ID=?"); if (whereClause != null && whereClause.length() > 0) - sql += whereClause; - sql += " ORDER BY Created"; + sql.append(whereClause); + sql.append(" ORDER BY Created"); try { - pstmt = DB.prepareStatement(sql, null); + pstmt = DB.prepareStatement(sql.toString(), null); pstmt.setInt(1, Env.getAD_Client_ID(ctx)); ResultSet rs = pstmt.executeQuery(); while (rs.next()) @@ -94,7 +94,7 @@ public class MArchive extends X_AD_Archive { pstmt.close(); pstmt = null; } catch (Exception e) { - s_log.log(Level.SEVERE, sql, e); + s_log.log(Level.SEVERE, sql.toString(), e); } try { if (pstmt != null) @@ -104,9 +104,9 @@ public class MArchive extends X_AD_Archive { pstmt = null; } if (list.size() == 0) - s_log.fine(sql); + s_log.fine(sql.toString()); else - s_log.finer(sql); + s_log.finer(sql.toString()); // MArchive[] retValue = new MArchive[list.size()]; list.toArray(retValue); @@ -215,12 +215,12 @@ public class MArchive extends X_AD_Archive { * @return info */ public String toString() { - StringBuffer sb = new StringBuffer("MArchive["); + StringBuilder sb = new StringBuilder("MArchive["); sb.append(get_ID()).append(",Name=").append(getName()); if (m_inflated != null) - sb.append(",Inflated=" + m_inflated); + sb.append(",Inflated=").append(m_inflated); if (m_deflated != null) - sb.append(",Deflated=" + m_deflated); + sb.append(",Deflated=").append(m_deflated); sb.append("]"); return sb.toString(); } // toString @@ -419,8 +419,9 @@ public class MArchive extends X_AD_Archive { } } // write to pdf - final File destFile = new File(m_archivePathRoot + File.separator - + getArchivePathSnippet() + this.get_ID() + ".pdf"); + StringBuilder msgfile = new StringBuilder(m_archivePathRoot).append(File.separator) + .append(getArchivePathSnippet()).append(this.get_ID()).append(".pdf"); + final File destFile = new File(msgfile.toString()); out = new BufferedOutputStream(new FileOutputStream(destFile)); out.write(inflatedData); @@ -433,7 +434,8 @@ public class MArchive extends X_AD_Archive { document.appendChild(root); document.setXmlStandalone(true); final Element entry = document.createElement("entry"); - entry.setAttribute("file", ARCHIVE_FOLDER_PLACEHOLDER + getArchivePathSnippet() + this.get_ID() + ".pdf"); + StringBuilder msgsat = new StringBuilder(ARCHIVE_FOLDER_PLACEHOLDER).append(getArchivePathSnippet()).append(this.get_ID()).append(".pdf"); + entry.setAttribute("file", msgsat.toString()); root.appendChild(entry); final Source source = new DOMSource(document); final ByteArrayOutputStream bos = new ByteArrayOutputStream(); @@ -538,19 +540,19 @@ public class MArchive extends X_AD_Archive { * @return String */ private String getArchivePathSnippet() { - String path = this.getAD_Client_ID() + File.separator + this.getAD_Org_ID() - + File.separator; + StringBuilder path = new StringBuilder(this.getAD_Client_ID()).append(File.separator).append(this.getAD_Org_ID()) + .append(File.separator); if (this.getAD_Process_ID() > 0) { - path = path + this.getAD_Process_ID() + File.separator; + path.append(this.getAD_Process_ID()).append(File.separator); } if (this.getAD_Table_ID() > 0) { - path = path + this.getAD_Table_ID() + File.separator; + path.append(this.getAD_Table_ID()).append(File.separator); } if (this.getRecord_ID() > 0) { - path = path + this.getRecord_ID() + File.separator; + path.append(this.getRecord_ID()).append(File.separator); } // path = path + this.get_ID() + ".pdf"; - return path; + return path.toString(); } /** diff --git a/org.adempiere.base/src/org/compiere/model/MAsset.java b/org.adempiere.base/src/org/compiere/model/MAsset.java index 372bae8cda..faf94f2241 100644 --- a/org.adempiere.base/src/org/compiere/model/MAsset.java +++ b/org.adempiere.base/src/org/compiere/model/MAsset.java @@ -183,20 +183,21 @@ public class MAsset extends X_A_Asset public void setValueNameDescription (MInOut shipment, int deliveryCount, MProduct product, MBPartner partner) { - String documentNo = "_" + shipment.getDocumentNo(); + StringBuilder documentNo = new StringBuilder("_").append(shipment.getDocumentNo()); if (deliveryCount > 1) - documentNo += "_" + deliveryCount; + documentNo.append("_").append(deliveryCount); // Value - String value = partner.getValue() + "_" + product.getValue(); + StringBuilder value = new StringBuilder(partner.getValue()).append("_").append(product.getValue()); if (value.length() > 40-documentNo.length()) - value = value.substring(0,40-documentNo.length()) + documentNo; - setValue(value); + value.delete(40-documentNo.length(), value.length()).append(documentNo); + + setValue(value.toString()); // Name MProduct.afterSave - String name = partner.getName() + " - " + product.getName(); + StringBuilder name = new StringBuilder(partner.getName()).append(" - ").append(product.getName()); if (name.length() > 60) - name = name.substring(0,60); - setName(name); + name.delete(60,name.length()); + setName(name.toString()); // Description String description = product.getDescription(); setDescription(description); @@ -211,8 +212,10 @@ public class MAsset extends X_A_Asset String desc = getDescription(); if (desc == null) setDescription(description); - else - setDescription(desc + " | " + description); + else{ + StringBuilder msgsd= new StringBuilder(desc).append(" | ").append(description); + setDescription(msgsd.toString()); + } } // addDescription /** @@ -233,7 +236,7 @@ public class MAsset extends X_A_Asset */ public String toString () { - StringBuffer sb = new StringBuffer ("MAsset[") + StringBuilder sb = new StringBuilder ("MAsset[") .append (get_ID ()) .append("-").append(getValue()) .append ("]"); diff --git a/org.adempiere.base/src/org/compiere/model/MAssetDelivery.java b/org.adempiere.base/src/org/compiere/model/MAssetDelivery.java index 374f84be54..9a6d6c1b21 100644 --- a/org.adempiere.base/src/org/compiere/model/MAssetDelivery.java +++ b/org.adempiere.base/src/org/compiere/model/MAssetDelivery.java @@ -124,7 +124,7 @@ public class MAssetDelivery extends X_A_Asset_Delivery */ public String toString () { - StringBuffer sb = new StringBuffer ("MAssetDelivery[") + StringBuilder sb = new StringBuilder ("MAssetDelivery[") .append (get_ID ()) .append(",A_Asset_ID=").append(getA_Asset_ID()) .append(",MovementDate=").append(getMovementDate()) diff --git a/org.adempiere.base/src/org/compiere/model/MAssignmentSlot.java b/org.adempiere.base/src/org/compiere/model/MAssignmentSlot.java index 22049c764e..133d40d41c 100644 --- a/org.adempiere.base/src/org/compiere/model/MAssignmentSlot.java +++ b/org.adempiere.base/src/org/compiere/model/MAssignmentSlot.java @@ -438,7 +438,7 @@ public class MAssignmentSlot implements Comparator return getInfo(); // DISPLAY_ALL - StringBuffer sb = new StringBuffer("MAssignmentSlot["); + StringBuilder sb = new StringBuilder("MAssignmentSlot["); sb.append(m_startTime).append("-").append(m_endTime) .append("-Status=").append(m_status).append(",Name=") .append(m_name).append(",").append(m_description).append("]"); @@ -460,7 +460,7 @@ public class MAssignmentSlot implements Comparator */ public String getInfoTimeFromTo() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append(m_language.getTimeFormat().format(m_startTime)) .append(" - ") .append(m_language.getTimeFormat().format(m_endTime)); @@ -473,7 +473,7 @@ public class MAssignmentSlot implements Comparator */ public String getInfoDateTimeFromTo() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append(m_language.getDateTimeFormat().format(m_startTime)) .append(" - "); if (TimeUtil.isSameDay(m_startTime, m_endTime)) @@ -489,7 +489,7 @@ public class MAssignmentSlot implements Comparator */ public String getInfoNameDescription() { - StringBuffer sb = new StringBuffer(m_name); + StringBuilder sb = new StringBuilder(m_name); if (m_description.length() > 0) sb.append(" (").append(m_description).append(")"); return sb.toString(); @@ -501,7 +501,7 @@ public class MAssignmentSlot implements Comparator */ public String getInfo() { - StringBuffer sb = new StringBuffer(getInfoDateTimeFromTo()); + StringBuilder sb = new StringBuilder(getInfoDateTimeFromTo()); sb.append(": ").append(m_name); if (m_description.length() > 0) sb.append(" (").append(m_description).append(")"); diff --git a/org.adempiere.base/src/org/compiere/model/MAttachment.java b/org.adempiere.base/src/org/compiere/model/MAttachment.java index 9e384c076a..772a72ebd2 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttachment.java +++ b/org.adempiere.base/src/org/compiere/model/MAttachment.java @@ -222,7 +222,7 @@ public class MAttachment extends X_AD_Attachment */ public String toString() { - StringBuffer sb = new StringBuffer("MAttachment["); + StringBuilder sb = new StringBuilder("MAttachment["); sb.append(getAD_Attachment_ID()).append(",Title=").append(getTitle()) .append(",Entries=").append(getEntryCount()); for (int i = 0; i < getEntryCount(); i++) @@ -435,9 +435,12 @@ public class MAttachment extends X_AD_Attachment System.out.println("- no entries -"); return; } - System.out.println("- entries: " + m_items.size()); - for (int i = 0; i < m_items.size(); i++) - System.out.println(" - " + getEntryName(i)); + StringBuilder msgout = new StringBuilder("- entries: ").append(m_items.size()); + System.out.println(msgout.toString()); + for (int i = 0; i < m_items.size(); i++){ + msgout = new StringBuilder(" - ").append(getEntryName(i)); + System.out.println(msgout.toString()); + } } // dumpEntryNames /** @@ -576,14 +579,16 @@ public class MAttachment extends X_AD_Attachment FileChannel out = null; try { //create destination folder - final File destFolder = new File(m_attachmentPathRoot + File.separator + getAttachmentPathSnippet()); + StringBuilder msgfile = new StringBuilder(m_attachmentPathRoot).append(File.separator).append(getAttachmentPathSnippet()); + final File destFolder = new File(msgfile.toString()); if(!destFolder.exists()){ if(!destFolder.mkdirs()){ log.warning("unable to create folder: " + destFolder.getPath()); } } - final File destFile = new File(m_attachmentPathRoot + File.separator - + getAttachmentPathSnippet() + File.separator + entryFile.getName()); + msgfile = new StringBuilder(m_attachmentPathRoot).append(File.separator) + .append(getAttachmentPathSnippet()).append(File.separator).append(entryFile.getName()); + final File destFile = new File(msgfile.toString()); in = new FileInputStream(entryFile).getChannel(); out = new FileOutputStream(destFile).getChannel(); in.transferTo(0, in.size(), out); @@ -808,9 +813,11 @@ public class MAttachment extends X_AD_Attachment * @return String */ private String getAttachmentPathSnippet(){ - return this.getAD_Client_ID() + File.separator + - this.getAD_Org_ID() + File.separator + - this.getAD_Table_ID() + File.separator + this.getRecord_ID(); + + StringBuilder msgreturn = new StringBuilder(this.getAD_Client_ID()).append(File.separator) + .append(this.getAD_Org_ID()).append(File.separator) + .append(this.getAD_Table_ID()).append(File.separator).append(this.getRecord_ID()); + return msgreturn.toString(); } /** diff --git a/org.adempiere.base/src/org/compiere/model/MAttachmentEntry.java b/org.adempiere.base/src/org/compiere/model/MAttachmentEntry.java index 3e45c19424..c3dc3d371c 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttachmentEntry.java +++ b/org.adempiere.base/src/org/compiere/model/MAttachmentEntry.java @@ -144,7 +144,7 @@ public class MAttachmentEntry */ public String toStringX () { - StringBuffer sb = new StringBuffer (m_name); + StringBuilder sb = new StringBuilder (m_name); if (m_data != null) { sb.append(" ("); @@ -176,8 +176,8 @@ public class MAttachmentEntry */ public void dump () { - String hdr = "----- " + getName() + " -----"; - System.out.println (hdr); + StringBuilder hdr = new StringBuilder("----- ").append(getName()).append(" -----"); + System.out.println (hdr.toString()); if (m_data == null) { System.out.println ("----- no data -----"); @@ -191,14 +191,15 @@ public class MAttachmentEntry } System.out.println (); - System.out.println (hdr); + System.out.println (hdr.toString()); // Count nulls at end int ii = m_data.length -1; int nullCount = 0; while (m_data[ii--] == 0) nullCount++; - System.out.println("----- Length=" + m_data.length + ", EndNulls=" + nullCount - + ", RealLength=" + (m_data.length-nullCount)); + StringBuilder msgout = new StringBuilder("----- Length=").append(m_data.length).append(", EndNulls=").append(nullCount) + .append(", RealLength=").append((m_data.length-nullCount)); + System.out.println(msgout.toString()); /** // Dump w/o nulls if (nullCount > 0) diff --git a/org.adempiere.base/src/org/compiere/model/MAttribute.java b/org.adempiere.base/src/org/compiere/model/MAttribute.java index ab2f9d0f2f..df0e71573a 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttribute.java +++ b/org.adempiere.base/src/org/compiere/model/MAttribute.java @@ -64,9 +64,9 @@ public class MAttribute extends X_M_Attribute sql += " AND AttributeValueType=?"; params.add(MAttribute.ATTRIBUTEVALUETYPE_List); } - final String whereClause = "AD_Client_ID=?"+sql; + StringBuilder whereClause = new StringBuilder("AD_Client_ID=?").append(sql); - Listlist = new Query(ctx,I_M_Attribute.Table_Name,whereClause,null) + Listlist = new Query(ctx,I_M_Attribute.Table_Name,whereClause.toString(),null) .setParameters(params) .setOnlyActiveRecords(true) .setOrderBy("Name") @@ -224,7 +224,7 @@ public class MAttribute extends X_M_Attribute */ public String toString () { - StringBuffer sb = new StringBuffer ("MAttribute["); + StringBuilder sb = new StringBuilder ("MAttribute["); sb.append (get_ID()).append ("-").append (getName()) .append(",Type=").append(getAttributeValueType()) .append(",Instance=").append(isInstanceAttribute()) @@ -243,13 +243,13 @@ public class MAttribute extends X_M_Attribute // Changed to Instance Attribute if (!newRecord && is_ValueChanged("IsInstanceAttribute") && isInstanceAttribute()) { - String sql = "UPDATE M_AttributeSet mas " - + "SET IsInstanceAttribute='Y' " - + "WHERE IsInstanceAttribute='N'" - + " AND EXISTS (SELECT * FROM M_AttributeUse mau " - + "WHERE mas.M_AttributeSet_ID=mau.M_AttributeSet_ID" - + " AND mau.M_Attribute_ID=" + getM_Attribute_ID() + ")"; - int no = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("UPDATE M_AttributeSet mas ") + .append("SET IsInstanceAttribute='Y' ") + .append("WHERE IsInstanceAttribute='N'") + .append(" AND EXISTS (SELECT * FROM M_AttributeUse mau ") + .append("WHERE mas.M_AttributeSet_ID=mau.M_AttributeSet_ID") + .append(" AND mau.M_Attribute_ID=").append(getM_Attribute_ID()).append(")"); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("AttributeSet Instance set #" + no); } return success; diff --git a/org.adempiere.base/src/org/compiere/model/MAttributeInstance.java b/org.adempiere.base/src/org/compiere/model/MAttributeInstance.java index 8906abd43f..9b22be74ba 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttributeInstance.java +++ b/org.adempiere.base/src/org/compiere/model/MAttributeInstance.java @@ -131,7 +131,7 @@ public class MAttributeInstance extends X_M_AttributeInstance } // Display number w/o decimal 0 char[] chars = ValueNumber.toString().toCharArray(); - StringBuffer display = new StringBuffer(); + StringBuilder display = new StringBuilder(); boolean add = false; for (int i = chars.length-1; i >= 0; i--) { diff --git a/org.adempiere.base/src/org/compiere/model/MAttributeSet.java b/org.adempiere.base/src/org/compiere/model/MAttributeSet.java index 556eaf3605..9deb0bef5e 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttributeSet.java +++ b/org.adempiere.base/src/org/compiere/model/MAttributeSet.java @@ -385,18 +385,18 @@ public class MAttributeSet extends X_M_AttributeSet // Set Instance Attribute if (!isInstanceAttribute()) { - String sql = "UPDATE M_AttributeSet mas" - + " SET IsInstanceAttribute='Y' " - + "WHERE M_AttributeSet_ID=" + getM_AttributeSet_ID() - + " AND IsInstanceAttribute='N'" - + " AND (IsSerNo='Y' OR IsLot='Y' OR IsGuaranteeDate='Y'" - + " OR EXISTS (SELECT * FROM M_AttributeUse mau" - + " INNER JOIN M_Attribute ma ON (mau.M_Attribute_ID=ma.M_Attribute_ID) " - + "WHERE mau.M_AttributeSet_ID=mas.M_AttributeSet_ID" - + " AND mau.IsActive='Y' AND ma.IsActive='Y'" - + " AND ma.IsInstanceAttribute='Y')" - + ")"; - int no = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("UPDATE M_AttributeSet mas") + .append(" SET IsInstanceAttribute='Y' ") + .append("WHERE M_AttributeSet_ID=").append(getM_AttributeSet_ID()) + .append(" AND IsInstanceAttribute='N'") + .append(" AND (IsSerNo='Y' OR IsLot='Y' OR IsGuaranteeDate='Y'") + .append(" OR EXISTS (SELECT * FROM M_AttributeUse mau") + .append(" INNER JOIN M_Attribute ma ON (mau.M_Attribute_ID=ma.M_Attribute_ID) ") + .append("WHERE mau.M_AttributeSet_ID=mas.M_AttributeSet_ID") + .append(" AND mau.IsActive='Y' AND ma.IsActive='Y'") + .append(" AND ma.IsInstanceAttribute='Y')") + .append(")"); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) { log.warning("Set Instance Attribute"); @@ -406,17 +406,17 @@ public class MAttributeSet extends X_M_AttributeSet // Reset Instance Attribute if (isInstanceAttribute() && !isSerNo() && !isLot() && !isGuaranteeDate()) { - String sql = "UPDATE M_AttributeSet mas" - + " SET IsInstanceAttribute='N' " - + "WHERE M_AttributeSet_ID=" + getM_AttributeSet_ID() - + " AND IsInstanceAttribute='Y'" - + " AND IsSerNo='N' AND IsLot='N' AND IsGuaranteeDate='N'" - + " AND NOT EXISTS (SELECT * FROM M_AttributeUse mau" - + " INNER JOIN M_Attribute ma ON (mau.M_Attribute_ID=ma.M_Attribute_ID) " - + "WHERE mau.M_AttributeSet_ID=mas.M_AttributeSet_ID" - + " AND mau.IsActive='Y' AND ma.IsActive='Y'" - + " AND ma.IsInstanceAttribute='Y')"; - int no = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("UPDATE M_AttributeSet mas") + .append(" SET IsInstanceAttribute='N' ") + .append("WHERE M_AttributeSet_ID=").append(getM_AttributeSet_ID()) + .append(" AND IsInstanceAttribute='Y'") + .append(" AND IsSerNo='N' AND IsLot='N' AND IsGuaranteeDate='N'") + .append(" AND NOT EXISTS (SELECT * FROM M_AttributeUse mau") + .append(" INNER JOIN M_Attribute ma ON (mau.M_Attribute_ID=ma.M_Attribute_ID) ") + .append("WHERE mau.M_AttributeSet_ID=mas.M_AttributeSet_ID") + .append(" AND mau.IsActive='Y' AND ma.IsActive='Y'") + .append(" AND ma.IsInstanceAttribute='Y')"); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) { log.warning("Reset Instance Attribute"); diff --git a/org.adempiere.base/src/org/compiere/model/MAttributeSetInstance.java b/org.adempiere.base/src/org/compiere/model/MAttributeSetInstance.java index 91b936bfd6..f7bb33a670 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttributeSetInstance.java +++ b/org.adempiere.base/src/org/compiere/model/MAttributeSetInstance.java @@ -186,7 +186,7 @@ public class MAttributeSetInstance extends X_M_AttributeSetInstance return; } - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); // Instance Attribute Values MAttribute[] attributes = m_mas.getMAttributes(true); diff --git a/org.adempiere.base/src/org/compiere/model/MAttributeUse.java b/org.adempiere.base/src/org/compiere/model/MAttributeUse.java index d98d0c4b61..ad99de46db 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttributeUse.java +++ b/org.adempiere.base/src/org/compiere/model/MAttributeUse.java @@ -70,32 +70,32 @@ public class MAttributeUse extends X_M_AttributeUse protected boolean afterSave (boolean newRecord, boolean success) { // also used for afterDelete - String sql = "UPDATE M_AttributeSet mas" - + " SET IsInstanceAttribute='Y' " - + "WHERE M_AttributeSet_ID=" + getM_AttributeSet_ID() - + " AND IsInstanceAttribute='N'" - + " AND (IsSerNo='Y' OR IsLot='Y' OR IsGuaranteeDate='Y'" - + " OR EXISTS (SELECT * FROM M_AttributeUse mau" - + " INNER JOIN M_Attribute ma ON (mau.M_Attribute_ID=ma.M_Attribute_ID) " - + "WHERE mau.M_AttributeSet_ID=mas.M_AttributeSet_ID" - + " AND mau.IsActive='Y' AND ma.IsActive='Y'" - + " AND ma.IsInstanceAttribute='Y')" - + ")"; - int no = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("UPDATE M_AttributeSet mas") + .append(" SET IsInstanceAttribute='Y' ") + .append("WHERE M_AttributeSet_ID=").append(getM_AttributeSet_ID()) + .append(" AND IsInstanceAttribute='N'") + .append(" AND (IsSerNo='Y' OR IsLot='Y' OR IsGuaranteeDate='Y'") + .append(" OR EXISTS (SELECT * FROM M_AttributeUse mau") + .append(" INNER JOIN M_Attribute ma ON (mau.M_Attribute_ID=ma.M_Attribute_ID) ") + .append("WHERE mau.M_AttributeSet_ID=mas.M_AttributeSet_ID") + .append(" AND mau.IsActive='Y' AND ma.IsActive='Y'") + .append(" AND ma.IsInstanceAttribute='Y')") + .append(")"); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("afterSave - Set Instance Attribute"); // - sql = "UPDATE M_AttributeSet mas" - + " SET IsInstanceAttribute='N' " - + "WHERE M_AttributeSet_ID=" + getM_AttributeSet_ID() - + " AND IsInstanceAttribute='Y'" - + " AND IsSerNo='N' AND IsLot='N' AND IsGuaranteeDate='N'" - + " AND NOT EXISTS (SELECT * FROM M_AttributeUse mau" - + " INNER JOIN M_Attribute ma ON (mau.M_Attribute_ID=ma.M_Attribute_ID) " - + "WHERE mau.M_AttributeSet_ID=mas.M_AttributeSet_ID" - + " AND mau.IsActive='Y' AND ma.IsActive='Y'" - + " AND ma.IsInstanceAttribute='Y')"; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE M_AttributeSet mas") + .append(" SET IsInstanceAttribute='N' ") + .append("WHERE M_AttributeSet_ID=").append(getM_AttributeSet_ID()) + .append(" AND IsInstanceAttribute='Y'") + .append(" AND IsSerNo='N' AND IsLot='N' AND IsGuaranteeDate='N'") + .append(" AND NOT EXISTS (SELECT * FROM M_AttributeUse mau") + .append(" INNER JOIN M_Attribute ma ON (mau.M_Attribute_ID=ma.M_Attribute_ID) ") + .append("WHERE mau.M_AttributeSet_ID=mas.M_AttributeSet_ID") + .append(" AND mau.IsActive='Y' AND ma.IsActive='Y'") + .append(" AND ma.IsInstanceAttribute='Y')"); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.fine("afterSave - Reset Instance Attribute"); diff --git a/org.adempiere.base/src/org/compiere/model/MBOM.java b/org.adempiere.base/src/org/compiere/model/MBOM.java index b64698ee82..ca4ed82fda 100644 --- a/org.adempiere.base/src/org/compiere/model/MBOM.java +++ b/org.adempiere.base/src/org/compiere/model/MBOM.java @@ -67,10 +67,10 @@ public class MBOM extends X_M_BOM String trxName, String whereClause) { //FR: [ 2214883 ] Remove SQL code and Replace for Query - red1 - String where = "M_Product_ID=?"; + StringBuilder where = new StringBuilder("M_Product_ID=?"); if (whereClause != null && whereClause.length() > 0) - where += " AND " + whereClause; - List list = new Query(ctx, I_M_BOM.Table_Name, where, trxName) + where.append(" AND ").append(whereClause); + List list = new Query(ctx, I_M_BOM.Table_Name, where.toString(), trxName) .setParameters(M_Product_ID) .list(); @@ -128,8 +128,8 @@ public class MBOM extends X_M_BOM // Only one Current Active if (getBOMType().equals(BOMTYPE_CurrentActive)) { - MBOM[] boms = getOfProduct(getCtx(), getM_Product_ID(), get_TrxName(), - "BOMType='A' AND BOMUse='" + getBOMUse() + "' AND IsActive='Y'"); + StringBuilder msgofp = new StringBuilder("BOMType='A' AND BOMUse='").append(getBOMUse()).append("' AND IsActive='Y'"); + MBOM[] boms = getOfProduct(getCtx(), getM_Product_ID(), get_TrxName(),msgofp.toString()); if (boms.length == 0 // only one = this || (boms.length == 1 && boms[0].getM_BOM_ID() == getM_BOM_ID())) ; diff --git a/org.adempiere.base/src/org/compiere/model/MBPBankAccount.java b/org.adempiere.base/src/org/compiere/model/MBPBankAccount.java index c233231438..e55146f3f2 100644 --- a/org.adempiere.base/src/org/compiere/model/MBPBankAccount.java +++ b/org.adempiere.base/src/org/compiere/model/MBPBankAccount.java @@ -188,7 +188,7 @@ public class MBPBankAccount extends X_C_BP_BankAccount */ public String toString () { - StringBuffer sb = new StringBuffer ("MBP_BankAccount[") + StringBuilder sb = new StringBuilder ("MBP_BankAccount[") .append (get_ID ()) .append(", Name=").append(getA_Name()) .append ("]"); diff --git a/org.adempiere.base/src/org/compiere/model/MBPartner.java b/org.adempiere.base/src/org/compiere/model/MBPartner.java index 40f5d32ca5..aef09a051a 100644 --- a/org.adempiere.base/src/org/compiere/model/MBPartner.java +++ b/org.adempiere.base/src/org/compiere/model/MBPartner.java @@ -531,7 +531,7 @@ public class MBPartner extends X_C_BPartner */ public String toString () { - StringBuffer sb = new StringBuffer ("MBPartner[ID=") + StringBuilder sb = new StringBuilder ("MBPartner[ID=") .append(get_ID()) .append(",Value=").append(getValue()) .append(",Name=").append(getName()) @@ -988,18 +988,18 @@ public class MBPartner extends X_C_BPartner // Trees insert_Tree(MTree_Base.TREETYPE_BPartner); // Accounting - insert_Accounting("C_BP_Customer_Acct", "C_BP_Group_Acct", - "p.C_BP_Group_ID=" + getC_BP_Group_ID()); - insert_Accounting("C_BP_Vendor_Acct", "C_BP_Group_Acct", - "p.C_BP_Group_ID=" + getC_BP_Group_ID()); + StringBuilder msgacc = new StringBuilder("p.C_BP_Group_ID=").append(getC_BP_Group_ID()); + insert_Accounting("C_BP_Customer_Acct", "C_BP_Group_Acct", msgacc.toString()); + insert_Accounting("C_BP_Vendor_Acct", "C_BP_Group_Acct",msgacc.toString()); insert_Accounting("C_BP_Employee_Acct", "C_AcctSchema_Default", null); } // Value/Name change if (success && !newRecord - && (is_ValueChanged("Value") || is_ValueChanged("Name"))) - MAccount.updateValueDescription(getCtx(), "C_BPartner_ID=" + getC_BPartner_ID(), get_TrxName()); - + && (is_ValueChanged("Value") || is_ValueChanged("Name"))){ + StringBuilder msgacc = new StringBuilder("C_BPartner_ID=").append(getC_BPartner_ID()); + MAccount.updateValueDescription(getCtx(), msgacc.toString(), get_TrxName()); + } return success; } // afterSave diff --git a/org.adempiere.base/src/org/compiere/model/MBPartnerInfo.java b/org.adempiere.base/src/org/compiere/model/MBPartnerInfo.java index 78f6404062..e4990afcab 100644 --- a/org.adempiere.base/src/org/compiere/model/MBPartnerInfo.java +++ b/org.adempiere.base/src/org/compiere/model/MBPartnerInfo.java @@ -52,8 +52,8 @@ public class MBPartnerInfo extends X_RV_BPartner public static MBPartnerInfo[] find (Properties ctx, String Value, String Name, String Contact, String EMail, String Phone, String City) { - StringBuffer sql = new StringBuffer ("SELECT * FROM RV_BPartner WHERE IsActive='Y'"); - StringBuffer sb = new StringBuffer(); + StringBuilder sql = new StringBuilder ("SELECT * FROM RV_BPartner WHERE IsActive='Y'"); + StringBuilder sb = new StringBuilder(); Value = getFindParameter (Value); if (Value != null) sb.append("UPPER(Value) LIKE ?"); diff --git a/org.adempiere.base/src/org/compiere/model/MBPartnerLocation.java b/org.adempiere.base/src/org/compiere/model/MBPartnerLocation.java index e4e5b48c20..6e733f2f06 100644 --- a/org.adempiere.base/src/org/compiere/model/MBPartnerLocation.java +++ b/org.adempiere.base/src/org/compiere/model/MBPartnerLocation.java @@ -125,7 +125,7 @@ public class MBPartnerLocation extends X_C_BPartner_Location { /** Cached Location */ private MLocation m_location = null; /** Unique Name */ - private String m_uniqueName = null; + private StringBuffer m_uniqueName = null; private int m_unique = 0; /** @@ -148,7 +148,7 @@ public class MBPartnerLocation extends X_C_BPartner_Location { * @return info */ public String toString() { - StringBuffer sb = new StringBuffer("MBPartner_Location[ID=") + StringBuilder sb = new StringBuilder("MBPartner_Location[ID=") .append(get_ID()).append(",C_Location_ID=") .append(getC_Location_ID()).append(",Name=").append(getName()) .append("]"); @@ -181,21 +181,21 @@ public class MBPartnerLocation extends X_C_BPartner_Location { * address */ private void makeUnique(MLocation address) { - m_uniqueName = ""; + m_uniqueName = new StringBuffer(); // 0 - City if (m_unique >= 0 || m_uniqueName.length() == 0) { String xx = address.getCity(); if (xx != null && xx.length() > 0) - m_uniqueName = xx; + m_uniqueName = new StringBuffer(xx); } // 1 + Address1 if (m_unique >= 1 || m_uniqueName.length() == 0) { String xx = address.getAddress1(); if (xx != null && xx.length() > 0) { if (m_uniqueName.length() > 0) - m_uniqueName += " "; - m_uniqueName += xx; + m_uniqueName.append(" "); + m_uniqueName.append(xx); } } // 2 + Address2 @@ -203,8 +203,8 @@ public class MBPartnerLocation extends X_C_BPartner_Location { String xx = address.getAddress2(); if (xx != null && xx.length() > 0) { if (m_uniqueName.length() > 0) - m_uniqueName += " "; - m_uniqueName += xx; + m_uniqueName.append(" "); + m_uniqueName.append(xx); } } // 3 - Region @@ -212,8 +212,8 @@ public class MBPartnerLocation extends X_C_BPartner_Location { String xx = address.getRegionName(true); if (xx != null && xx.length() > 0) { if (m_uniqueName.length() > 0) - m_uniqueName += " "; - m_uniqueName += xx; + m_uniqueName.append(" "); + m_uniqueName.append(xx); } } // 4 - ID @@ -221,12 +221,12 @@ public class MBPartnerLocation extends X_C_BPartner_Location { int id = get_ID(); if (id == 0) id = address.get_ID(); - m_uniqueName += "#" + id; + m_uniqueName.append("#").append(id); } } // makeUnique public String getBPLocName(MLocation address) { - m_uniqueName = getName(); + m_uniqueName = new StringBuffer(getName()); m_unique = MSysConfig.getIntValue("START_VALUE_BPLOCATION_NAME", 0, getAD_Client_ID(), getAD_Org_ID()); if (m_unique < 0 || m_unique > 4) @@ -256,7 +256,7 @@ public class MBPartnerLocation extends X_C_BPartner_Location { } } } - return m_uniqueName; + return m_uniqueName.toString(); } } // MBPartnerLocation diff --git a/org.adempiere.base/src/org/compiere/model/MBank.java b/org.adempiere.base/src/org/compiere/model/MBank.java index 710efab0bb..a01b066634 100644 --- a/org.adempiere.base/src/org/compiere/model/MBank.java +++ b/org.adempiere.base/src/org/compiere/model/MBank.java @@ -86,7 +86,7 @@ public class MBank extends X_C_Bank */ public String toString () { - StringBuffer sb = new StringBuffer ("MBank["); + StringBuilder sb = new StringBuilder ("MBank["); sb.append (get_ID ()).append ("-").append(getName ()).append ("]"); return sb.toString (); } // toString diff --git a/org.adempiere.base/src/org/compiere/model/MBankAccount.java b/org.adempiere.base/src/org/compiere/model/MBankAccount.java index f6d2af0246..ce681e4f54 100644 --- a/org.adempiere.base/src/org/compiere/model/MBankAccount.java +++ b/org.adempiere.base/src/org/compiere/model/MBankAccount.java @@ -95,7 +95,7 @@ public class MBankAccount extends X_C_BankAccount */ public String toString () { - StringBuffer sb = new StringBuffer ("MBankAccount[") + StringBuilder sb = new StringBuilder ("MBankAccount[") .append (get_ID()) .append("-").append(getAccountNo()) .append ("]"); @@ -117,7 +117,8 @@ public class MBankAccount extends X_C_BankAccount */ public String getName() { - return getBank().getName() + " " + getAccountNo(); + StringBuilder msgreturn = new StringBuilder(getBank().getName()).append(" ").append(getAccountNo()); + return msgreturn.toString(); } // getName /** diff --git a/org.adempiere.base/src/org/compiere/model/MBankStatement.java b/org.adempiere.base/src/org/compiere/model/MBankStatement.java index 56806857ef..4f38fa577b 100644 --- a/org.adempiere.base/src/org/compiere/model/MBankStatement.java +++ b/org.adempiere.base/src/org/compiere/model/MBankStatement.java @@ -148,8 +148,10 @@ public class MBankStatement extends X_C_BankStatement implements DocAction String desc = getDescription(); if (desc == null) setDescription(description); - else - setDescription(desc + " | " + description); + else{ + StringBuilder msgsd = new StringBuilder(desc).append(" | ").append(description); + setDescription(msgsd.toString()); + } } // addDescription /** @@ -162,10 +164,10 @@ public class MBankStatement extends X_C_BankStatement implements DocAction super.setProcessed (processed); if (get_ID() == 0) return; - String sql = "UPDATE C_BankStatementLine SET Processed='" - + (processed ? "Y" : "N") - + "' WHERE C_BankStatement_ID=" + getC_BankStatement_ID(); - int noLine = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("UPDATE C_BankStatementLine SET Processed='") + .append((processed ? "Y" : "N")) + .append("' WHERE C_BankStatement_ID=").append(getC_BankStatement_ID()); + int noLine = DB.executeUpdate(sql.toString(), get_TrxName()); m_lines = null; log.fine("setProcessed - " + processed + " - Lines=" + noLine); } // setProcessed @@ -194,7 +196,8 @@ public class MBankStatement extends X_C_BankStatement implements DocAction */ public String getDocumentInfo() { - return getBankAccount().getName() + " " + getDocumentNo(); + StringBuilder msgreturn = new StringBuilder(getBankAccount().getName()).append(" ").append(getDocumentNo()); + return msgreturn.toString(); } // getDocumentInfo /** @@ -205,7 +208,8 @@ public class MBankStatement extends X_C_BankStatement implements DocAction { try { - File temp = File.createTempFile(get_TableName()+get_ID()+"_", ".pdf"); + StringBuilder msgfile = new StringBuilder(get_TableName()).append(get_ID()).append("_"); + File temp = File.createTempFile(msgfile.toString(), ".pdf"); return createPDF (temp); } catch (Exception e) @@ -259,7 +263,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction } // processIt /** Process Message */ - private String m_processMsg = null; + private StringBuffer m_processMsg = null; /** Just Prepared Flag */ private boolean m_justPrepared = false; @@ -292,7 +296,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction public String prepareIt() { log.info(toString()); - m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE); + m_processMsg = new StringBuffer( ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE)); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -301,7 +305,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction MBankStatementLine[] lines = getLines(true); if (lines.length == 0) { - m_processMsg = "@NoLines@"; + m_processMsg = new StringBuffer("@NoLines@"); return DocAction.STATUS_Invalid; } // Lines @@ -322,7 +326,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction MPeriod.testPeriodOpen(getCtx(), minDate, MDocType.DOCBASETYPE_BankStatement, 0); MPeriod.testPeriodOpen(getCtx(), maxDate, MDocType.DOCBASETYPE_BankStatement, 0); - m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE)); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -369,7 +373,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction return status; } - m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE)); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -401,7 +405,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE); if (valid != null) { - m_processMsg = valid; + m_processMsg = new StringBuffer(valid); return DocAction.STATUS_Invalid; } // @@ -418,7 +422,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction { log.info(toString()); // Before Void - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID)); if (m_processMsg != null) return false; @@ -426,7 +430,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction || DOCSTATUS_Reversed.equals(getDocStatus()) || DOCSTATUS_Voided.equals(getDocStatus())) { - m_processMsg = "Document Closed: " + getDocStatus(); + m_processMsg = new StringBuffer("Document Closed: ").append(getDocStatus()); setDocAction(DOCACTION_None); return false; } @@ -460,16 +464,16 @@ public class MBankStatement extends X_C_BankStatement implements DocAction MBankStatementLine line = lines[i]; if (line.getStmtAmt().compareTo(Env.ZERO) != 0) { - String description = Msg.getMsg(getCtx(), "Voided") + " (" - + Msg.translate(getCtx(), "StmtAmt") + "=" + line.getStmtAmt(); + StringBuilder description = new StringBuilder(Msg.getMsg(getCtx(), "Voided")).append(" (") + .append(Msg.translate(getCtx(), "StmtAmt")).append("=").append(line.getStmtAmt()); if (line.getTrxAmt().compareTo(Env.ZERO) != 0) - description += ", " + Msg.translate(getCtx(), "TrxAmt") + "=" + line.getTrxAmt(); + description.append(", ").append(Msg.translate(getCtx(), "TrxAmt")).append("=").append(line.getTrxAmt()); if (line.getChargeAmt().compareTo(Env.ZERO) != 0) - description += ", " + Msg.translate(getCtx(), "ChargeAmt") + "=" + line.getChargeAmt(); + description.append(", ").append(Msg.translate(getCtx(), "ChargeAmt")).append("=").append(line.getChargeAmt()); if (line.getInterestAmt().compareTo(Env.ZERO) != 0) - description += ", " + Msg.translate(getCtx(), "InterestAmt") + "=" + line.getInterestAmt(); - description += ")"; - line.addDescription(description); + description.append(", ").append(Msg.translate(getCtx(), "InterestAmt")).append("=").append(line.getInterestAmt()); + description.append(")"); + line.addDescription(description.toString()); // line.setStmtAmt(Env.ZERO); line.setTrxAmt(Env.ZERO); @@ -489,7 +493,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction setStatementDifference(Env.ZERO); // After Void - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID)); if (m_processMsg != null) return false; @@ -506,14 +510,14 @@ public class MBankStatement extends X_C_BankStatement implements DocAction { log.info("closeIt - " + toString()); // Before Close - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE)); if (m_processMsg != null) return false; setDocAction(DOCACTION_None); // After Close - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE)); if (m_processMsg != null) return false; return true; @@ -527,12 +531,12 @@ public class MBankStatement extends X_C_BankStatement implements DocAction { log.info("reverseCorrectIt - " + toString()); // Before reverseCorrect - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT)); if (m_processMsg != null) return false; // After reverseCorrect - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT)); if (m_processMsg != null) return false; @@ -547,12 +551,12 @@ public class MBankStatement extends X_C_BankStatement implements DocAction { log.info("reverseAccrualIt - " + toString()); // Before reverseAccrual - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL)); if (m_processMsg != null) return false; // After reverseAccrual - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL)); if (m_processMsg != null) return false; @@ -567,12 +571,12 @@ public class MBankStatement extends X_C_BankStatement implements DocAction { log.info("reActivateIt - " + toString()); // Before reActivate - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE)); if (m_processMsg != null) return false; // After reActivate - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE)); if (m_processMsg != null) return false; return false; @@ -585,7 +589,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction */ public String getSummary() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append(getName()); // : Total Lines = 123.00 (#1) sb.append(": ") @@ -603,7 +607,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction */ public String getProcessMsg() { - return m_processMsg; + return m_processMsg.toString(); } // getProcessMsg /** diff --git a/org.adempiere.base/src/org/compiere/model/MBankStatementLine.java b/org.adempiere.base/src/org/compiere/model/MBankStatementLine.java index a365ba88ce..16ddc6f419 100644 --- a/org.adempiere.base/src/org/compiere/model/MBankStatementLine.java +++ b/org.adempiere.base/src/org/compiere/model/MBankStatementLine.java @@ -148,8 +148,10 @@ import org.compiere.util.Msg; String desc = getDescription(); if (desc == null) setDescription(description); - else - setDescription(desc + " | " + description); + else{ + StringBuilder msgsd = new StringBuilder(desc).append(" | ").append(description); + setDescription(msgsd.toString()); + } } // addDescription @@ -252,19 +254,19 @@ import org.compiere.util.Msg; */ private boolean updateHeader() { - String sql = "UPDATE C_BankStatement bs" - + " SET StatementDifference=(SELECT COALESCE(SUM(StmtAmt),0) FROM C_BankStatementLine bsl " - + "WHERE bsl.C_BankStatement_ID=bs.C_BankStatement_ID AND bsl.IsActive='Y') " - + "WHERE C_BankStatement_ID=" + getC_BankStatement_ID(); - int no = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("UPDATE C_BankStatement bs") + .append(" SET StatementDifference=(SELECT COALESCE(SUM(StmtAmt),0) FROM C_BankStatementLine bsl ") + .append("WHERE bsl.C_BankStatement_ID=bs.C_BankStatement_ID AND bsl.IsActive='Y') ") + .append("WHERE C_BankStatement_ID=").append(getC_BankStatement_ID()); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 1) { log.warning("StatementDifference #" + no); return false; } - sql = "UPDATE C_BankStatement bs" - + " SET EndingBalance=BeginningBalance+StatementDifference " - + "WHERE C_BankStatement_ID=" + getC_BankStatement_ID(); - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE C_BankStatement bs") + .append(" SET EndingBalance=BeginningBalance+StatementDifference ") + .append("WHERE C_BankStatement_ID=").append(getC_BankStatement_ID()); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 1) { log.warning("Balance #" + no); return false; diff --git a/org.adempiere.base/src/org/compiere/model/MBankStatementLoader.java b/org.adempiere.base/src/org/compiere/model/MBankStatementLoader.java index a248b0d5d9..ab938339b1 100644 --- a/org.adempiere.base/src/org/compiere/model/MBankStatementLoader.java +++ b/org.adempiere.base/src/org/compiere/model/MBankStatementLoader.java @@ -133,7 +133,7 @@ import org.compiere.impexp.BankStatementLoaderInterface; */ public String toString () { - StringBuffer sb = new StringBuffer ("MBankStatementLoader[") + StringBuilder sb = new StringBuilder ("MBankStatementLoader[") .append(get_ID ()).append("-").append(getName()) .append ("]"); return sb.toString (); diff --git a/org.adempiere.base/src/org/compiere/model/MCStage.java b/org.adempiere.base/src/org/compiere/model/MCStage.java index 4d1b7ccdbc..fce725208e 100644 --- a/org.adempiere.base/src/org/compiere/model/MCStage.java +++ b/org.adempiere.base/src/org/compiere/model/MCStage.java @@ -163,7 +163,7 @@ public class MCStage extends X_CM_CStage */ public String toString () { - StringBuffer sb = new StringBuffer ("MCStage[") + StringBuilder sb = new StringBuilder ("MCStage[") .append (get_ID()).append ("-").append (getName()).append ("]"); return sb.toString (); } // toString @@ -208,10 +208,10 @@ public class MCStage extends X_CM_CStage } if (newRecord) { - StringBuffer sb = new StringBuffer ("INSERT INTO AD_TreeNodeCMS " - + "(AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, " - + "AD_Tree_ID, Node_ID, Parent_ID, SeqNo) " - + "VALUES (") + StringBuilder sb = new StringBuilder ("INSERT INTO AD_TreeNodeCMS ") + .append("(AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, ") + .append("AD_Tree_ID, Node_ID, Parent_ID, SeqNo) ") + .append("VALUES (") .append(getAD_Client_ID()).append(",0, 'Y', SysDate, 0, SysDate, 0,") .append(getAD_Tree_ID()).append(",").append(get_ID()) .append(", 0, 999)"); @@ -237,7 +237,7 @@ public class MCStage extends X_CM_CStage if (!success) return success; // - StringBuffer sb = new StringBuffer ("DELETE FROM AD_TreeNodeCMS ") + StringBuilder sb = new StringBuilder ("DELETE FROM AD_TreeNodeCMS ") .append(" WHERE Node_ID=").append(get_IDOld()) .append(" AND AD_Tree_ID=").append(getAD_Tree_ID()); int no = DB.executeUpdate(sb.toString(), get_TrxName()); @@ -263,7 +263,7 @@ public class MCStage extends X_CM_CStage */ protected boolean checkElements () { X_CM_Template thisTemplate = new X_CM_Template(getCtx(), this.getCM_Template_ID(), get_TrxName()); - StringBuffer thisElementList = new StringBuffer(thisTemplate.getElements()); + StringBuilder thisElementList = new StringBuilder(thisTemplate.getElements()); while (thisElementList.indexOf("\n")>=0) { String thisElement = thisElementList.substring(0,thisElementList.indexOf("\n")); thisElementList.delete(0,thisElementList.indexOf("\n")+1); @@ -279,7 +279,8 @@ public class MCStage extends X_CM_CStage * @param elementName */ protected void checkElement(String elementName) { - int [] tableKeys = X_CM_CStage_Element.getAllIDs("CM_CStage_Element", "CM_CStage_ID=" + this.get_ID() + " AND Name like '" + elementName + "'", get_TrxName()); + StringBuilder msgx = new StringBuilder("CM_CStage_ID=").append(this.get_ID()).append(" AND Name like '").append(elementName).append("'"); + int [] tableKeys = X_CM_CStage_Element.getAllIDs("CM_CStage_Element", msgx.toString(), get_TrxName()); if (tableKeys==null || tableKeys.length==0) { X_CM_CStage_Element thisElement = new X_CM_CStage_Element(getCtx(), 0, get_TrxName()); thisElement.setAD_Client_ID(getAD_Client_ID()); @@ -296,11 +297,13 @@ public class MCStage extends X_CM_CStage * @return true if updated */ protected boolean checkTemplateTable () { - int [] tableKeys = X_CM_TemplateTable.getAllIDs("CM_TemplateTable", "CM_Template_ID=" + this.getCM_Template_ID(), get_TrxName()); + StringBuilder msgx = new StringBuilder("CM_Template_ID=").append(this.getCM_Template_ID()); + int [] tableKeys = X_CM_TemplateTable.getAllIDs("CM_TemplateTable", msgx.toString(), get_TrxName()); if (tableKeys!=null) { for (int i=0;i 0) super.setDescription (Description); - else - super.setDescription (getAD_Table_ID() + "#" + getRecord_ID()); + else{ + StringBuilder msgsd = new StringBuilder(getAD_Table_ID()).append("#").append(getRecord_ID()); + super.setDescription (msgsd.toString()); + } } // setDescription /** diff --git a/org.adempiere.base/src/org/compiere/model/MClick.java b/org.adempiere.base/src/org/compiere/model/MClick.java index 8c43271fb3..b696762bd4 100644 --- a/org.adempiere.base/src/org/compiere/model/MClick.java +++ b/org.adempiere.base/src/org/compiere/model/MClick.java @@ -202,7 +202,8 @@ public class MClick extends X_W_Click try { pstmt = DB.prepareStatement(sql, null); - pstmt.setString(1, "%" + url + "%"); + StringBuilder msgstr = new StringBuilder("%").append(url).append("%"); + pstmt.setString(1, msgstr.toString()); ResultSet rs = pstmt.executeQuery(); while (rs.next()) { @@ -271,6 +272,7 @@ public class MClick extends X_W_Click } } } + System.out.println("#" + counter); } // main diff --git a/org.adempiere.base/src/org/compiere/model/MClickCount.java b/org.adempiere.base/src/org/compiere/model/MClickCount.java index 463b0582e1..4b9dcec07c 100644 --- a/org.adempiere.base/src/org/compiere/model/MClickCount.java +++ b/org.adempiere.base/src/org/compiere/model/MClickCount.java @@ -108,15 +108,15 @@ public class MClickCount extends X_W_ClickCount protected ValueNamePair[] getCount (String DateFormat) { ArrayList list = new ArrayList(); - String sql = "SELECT TRUNC(Created, '" + DateFormat + "'), Count(*) " - + "FROM W_Click " - + "WHERE W_ClickCount_ID=? " - + "GROUP BY TRUNC(Created, '" + DateFormat + "')"; + StringBuilder sql = new StringBuilder("SELECT TRUNC(Created, '").append(DateFormat).append("'), Count(*) ") + .append("FROM W_Click ") + .append("WHERE W_ClickCount_ID=? ") + .append("GROUP BY TRUNC(Created, '").append(DateFormat).append("')"); // PreparedStatement pstmt = null; try { - pstmt = DB.prepareStatement(sql, null); + pstmt = DB.prepareStatement(sql.toString(), null); pstmt.setInt(1, getW_ClickCount_ID()); ResultSet rs = pstmt.executeQuery(); while (rs.next()) @@ -132,7 +132,7 @@ public class MClickCount extends X_W_ClickCount } catch (SQLException ex) { - log.log(Level.SEVERE, sql, ex); + log.log(Level.SEVERE, sql.toString(), ex); } try { diff --git a/org.adempiere.base/src/org/compiere/model/MClient.java b/org.adempiere.base/src/org/compiere/model/MClient.java index 938ac32fb5..6702df7328 100644 --- a/org.adempiere.base/src/org/compiere/model/MClient.java +++ b/org.adempiere.base/src/org/compiere/model/MClient.java @@ -212,7 +212,7 @@ public class MClient extends X_AD_Client */ public String toString() { - StringBuffer sb = new StringBuffer ("MClient[") + StringBuilder sb = new StringBuilder ("MClient[") .append(get_ID()).append("-").append(getValue()) .append("]"); return sb.toString(); @@ -289,13 +289,13 @@ public class MClient extends X_AD_Client public boolean setupClientInfo (String language) { // Create Trees - String sql = null; + StringBuilder sql = null; if (Env.isBaseLanguage (language, "AD_Ref_List")) // Get TreeTypes & Name - sql = "SELECT Value, Name FROM AD_Ref_List WHERE AD_Reference_ID=120 AND IsActive='Y'"; + sql = new StringBuilder("SELECT Value, Name FROM AD_Ref_List WHERE AD_Reference_ID=120 AND IsActive='Y'"); else - sql = "SELECT l.Value, t.Name FROM AD_Ref_List l, AD_Ref_List_Trl t " - + "WHERE l.AD_Reference_ID=120 AND l.AD_Ref_List_ID=t.AD_Ref_List_ID AND l.IsActive='Y'" - + " AND t.AD_Language=" + DB.TO_STRING(language); + sql = new StringBuilder("SELECT l.Value, t.Name FROM AD_Ref_List l, AD_Ref_List_Trl t ") + .append("WHERE l.AD_Reference_ID=120 AND l.AD_Ref_List_ID=t.AD_Ref_List_ID AND l.IsActive='Y'") + .append(" AND t.AD_Language=").append(DB.TO_STRING(language)); // Tree IDs int AD_Tree_Org_ID=0, AD_Tree_BPartner_ID=0, AD_Tree_Project_ID=0, @@ -305,59 +305,59 @@ public class MClient extends X_AD_Client boolean success = false; try { - PreparedStatement stmt = DB.prepareStatement(sql, get_TrxName()); + PreparedStatement stmt = DB.prepareStatement(sql.toString(), get_TrxName()); ResultSet rs = stmt.executeQuery(); MTree_Base tree = null; while (rs.next()) { String value = rs.getString(1); - String name = getName() + " " + rs.getString(2); + StringBuilder name = new StringBuilder(getName()).append(" ").append(rs.getString(2)); // if (value.equals(X_AD_Tree.TREETYPE_Organization)) { - tree = new MTree_Base (this, name, value); + tree = new MTree_Base (this, name.toString(), value); success = tree.save(); AD_Tree_Org_ID = tree.getAD_Tree_ID(); } else if (value.equals(X_AD_Tree.TREETYPE_BPartner)) { - tree = new MTree_Base (this, name, value); + tree = new MTree_Base (this, name.toString(), value); success = tree.save(); AD_Tree_BPartner_ID = tree.getAD_Tree_ID(); } else if (value.equals(X_AD_Tree.TREETYPE_Project)) { - tree = new MTree_Base (this, name, value); + tree = new MTree_Base (this, name.toString(), value); success = tree.save(); AD_Tree_Project_ID = tree.getAD_Tree_ID(); } else if (value.equals(X_AD_Tree.TREETYPE_SalesRegion)) { - tree = new MTree_Base (this, name, value); + tree = new MTree_Base (this, name.toString(), value); success = tree.save(); AD_Tree_SalesRegion_ID = tree.getAD_Tree_ID(); } else if (value.equals(X_AD_Tree.TREETYPE_Product)) { - tree = new MTree_Base (this, name, value); + tree = new MTree_Base (this, name.toString(), value); success = tree.save(); AD_Tree_Product_ID = tree.getAD_Tree_ID(); } else if (value.equals(X_AD_Tree.TREETYPE_ElementValue)) { - tree = new MTree_Base (this, name, value); + tree = new MTree_Base (this, name.toString(), value); success = tree.save(); m_AD_Tree_Account_ID = tree.getAD_Tree_ID(); } else if (value.equals(X_AD_Tree.TREETYPE_Campaign)) { - tree = new MTree_Base (this, name, value); + tree = new MTree_Base (this, name.toString(), value); success = tree.save(); AD_Tree_Campaign_ID = tree.getAD_Tree_ID(); } else if (value.equals(X_AD_Tree.TREETYPE_Activity)) { - tree = new MTree_Base (this, name, value); + tree = new MTree_Base (this, name.toString(), value); success = tree.save(); AD_Tree_Activity_ID = tree.getAD_Tree_ID(); } @@ -365,7 +365,7 @@ public class MClient extends X_AD_Client success = true; else // PC (Product Category), BB (BOM) { - tree = new MTree_Base (this, name, value); + tree = new MTree_Base (this, name.toString(), value); success = tree.save(); } if (!success) @@ -467,14 +467,18 @@ public class MClient extends X_AD_Client */ public String testEMail() { - if (getRequestEMail() == null || getRequestEMail().length() == 0) - return "No Request EMail for " + getName(); + if (getRequestEMail() == null || getRequestEMail().length() == 0){ + StringBuilder msgreturn = new StringBuilder("No Request EMail for ").append(getName()); + return msgreturn.toString(); + } // + StringBuilder msgce = new StringBuilder("Adempiere EMail Test: ").append(toString()); EMail email = createEMail (getRequestEMail(), - "Adempiere EMail Test", - "Adempiere EMail Test: " + toString()); - if (email == null) - return "Could not create EMail: " + getName(); + "Adempiere EMail Test",msgce.toString()); + if (email == null){ + StringBuilder msgreturn = new StringBuilder("Could not create EMail: ").append(getName()); + return msgreturn.toString(); + } try { String msg = null; @@ -920,52 +924,52 @@ public class MClient extends X_AD_Client if (m_fieldAccess == null) { m_fieldAccess = new ArrayList(11000); - String sqlvalidate = - "SELECT AD_Field_ID " - + " FROM AD_Field " - + " WHERE ( AD_Field_ID NOT IN ( " - // ASP subscribed fields for client - + " SELECT f.AD_Field_ID " - + " FROM ASP_Field f, ASP_Tab t, ASP_Window w, ASP_Level l, ASP_ClientLevel cl " - + " WHERE w.ASP_Level_ID = l.ASP_Level_ID " - + " AND cl.AD_Client_ID = " + getAD_Client_ID() - + " AND cl.ASP_Level_ID = l.ASP_Level_ID " - + " AND f.ASP_Tab_ID = t.ASP_Tab_ID " - + " AND t.ASP_Window_ID = w.ASP_Window_ID " - + " AND f.IsActive = 'Y' " - + " AND t.IsActive = 'Y' " - + " AND w.IsActive = 'Y' " - + " AND l.IsActive = 'Y' " - + " AND cl.IsActive = 'Y' " - + " AND f.ASP_Status = 'H' " - +" AND f.AD_Field_ID NOT IN (" - +" SELECT AD_Field_ID" - +" FROM ASP_ClientException ce" - +" WHERE ce.AD_Client_ID ="+getAD_Client_ID() - +" AND ce.IsActive = 'Y'" - +" AND ce.AD_Field_ID IS NOT NULL" - +" AND ce.ASP_Status <> 'H')" - + " UNION ALL " + StringBuilder sqlvalidate = new StringBuilder( + "SELECT AD_Field_ID ") + .append(" FROM AD_Field ") + .append(" WHERE ( AD_Field_ID NOT IN ( ") + // ASP subscribed fields for client) + .append(" SELECT f.AD_Field_ID ") + .append(" FROM ASP_Field f, ASP_Tab t, ASP_Window w, ASP_Level l, ASP_ClientLevel cl ") + .append(" WHERE w.ASP_Level_ID = l.ASP_Level_ID ") + .append(" AND cl.AD_Client_ID = ").append(getAD_Client_ID()) + .append(" AND cl.ASP_Level_ID = l.ASP_Level_ID ") + .append(" AND f.ASP_Tab_ID = t.ASP_Tab_ID ") + .append(" AND t.ASP_Window_ID = w.ASP_Window_ID ") + .append(" AND f.IsActive = 'Y' ") + .append(" AND t.IsActive = 'Y' ") + .append(" AND w.IsActive = 'Y' ") + .append(" AND l.IsActive = 'Y' ") + .append(" AND cl.IsActive = 'Y' ") + .append(" AND f.ASP_Status = 'H' ") + .append(" AND f.AD_Field_ID NOT IN (") + .append(" SELECT AD_Field_ID") + .append(" FROM ASP_ClientException ce") + .append(" WHERE ce.AD_Client_ID =").append(getAD_Client_ID()) + .append(" AND ce.IsActive = 'Y'") + .append(" AND ce.AD_Field_ID IS NOT NULL") + .append(" AND ce.ASP_Status <> 'H')") + .append(" UNION ALL ") // minus ASP hide exceptions for client - + " SELECT AD_Field_ID " - + " FROM ASP_ClientException ce " - + " WHERE ce.AD_Client_ID = " + getAD_Client_ID() - + " AND ce.IsActive = 'Y' " - + " AND ce.AD_Field_ID IS NOT NULL " - + " AND ce.ASP_Status = 'H'))" - + " ORDER BY AD_Field_ID"; + .append(" SELECT AD_Field_ID ") + .append(" FROM ASP_ClientException ce ") + .append(" WHERE ce.AD_Client_ID = ").append(getAD_Client_ID()) + .append(" AND ce.IsActive = 'Y' ") + .append(" AND ce.AD_Field_ID IS NOT NULL ") + .append(" AND ce.ASP_Status = 'H'))") + .append(" ORDER BY AD_Field_ID"); PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement(sqlvalidate, get_TrxName()); + pstmt = DB.prepareStatement(sqlvalidate.toString(), get_TrxName()); rs = pstmt.executeQuery(); while (rs.next()) m_fieldAccess.add(rs.getInt(1)); } catch (Exception e) { - log.log(Level.SEVERE, sqlvalidate, e); + log.log(Level.SEVERE, sqlvalidate.toString(), e); } finally { diff --git a/org.adempiere.base/src/org/compiere/model/MClientShare.java b/org.adempiere.base/src/org/compiere/model/MClientShare.java index ab378e2bd2..f0f45898f2 100644 --- a/org.adempiere.base/src/org/compiere/model/MClientShare.java +++ b/org.adempiere.base/src/org/compiere/model/MClientShare.java @@ -88,12 +88,12 @@ public class MClientShare extends X_AD_ClientShare { int Client_ID = rs.getInt(1); int table_ID = rs.getInt(2); - String key = Client_ID + "_" + table_ID; + StringBuilder key = new StringBuilder(Client_ID).append("_").append(table_ID); String ShareType = rs.getString(3); if (ShareType.equals(SHARETYPE_ClientAllShared)) - s_shares.put(key, Boolean.TRUE); + s_shares.put(key.toString(), Boolean.TRUE); else if (ShareType.equals(SHARETYPE_OrgNotShared)) - s_shares.put(key, Boolean.FALSE); + s_shares.put(key.toString(), Boolean.FALSE); } rs.close (); pstmt.close (); @@ -116,7 +116,7 @@ public class MClientShare extends X_AD_ClientShare if (s_shares.isEmpty()) // put in something s_shares.put("0_0", Boolean.TRUE); } // load - String key = AD_Client_ID + "_" + AD_Table_ID; + StringBuilder key = new StringBuilder(AD_Client_ID).append("_").append(AD_Table_ID); return s_shares.get(key); } // load @@ -211,26 +211,26 @@ public class MClientShare extends X_AD_ClientShare */ public String setDataToLevel() { - String info = "-"; + StringBuilder info = new StringBuilder("-"); if (isClientLevelOnly()) { - StringBuffer sql = new StringBuffer("UPDATE ") + StringBuilder sql = new StringBuilder("UPDATE ") .append(getTableName()) .append(" SET AD_Org_ID=0 WHERE AD_Org_ID<>0 AND AD_Client_ID=?"); int no = DB.executeUpdate(sql.toString(), getAD_Client_ID(), get_TrxName()); - info = getTableName() + " set to Shared #" + no; - log.info(info); + info = new StringBuilder(getTableName()).append(" set to Shared #").append(no); + log.info(info.toString()); } else if (isOrgLevelOnly()) { - StringBuffer sql = new StringBuffer("SELECT COUNT(*) FROM ") + StringBuilder sql = new StringBuilder("SELECT COUNT(*) FROM ") .append(getTableName()) .append(" WHERE AD_Org_ID=0 AND AD_Client_ID=?"); int no = DB.getSQLValue(get_TrxName(), sql.toString(), getAD_Client_ID()); - info = getTableName() + " Shared records #" + no; - log.info(info); + info = new StringBuilder(getTableName()).append(" Shared records #").append(no); + log.info(info.toString()); } - return info; + return info.toString(); } // setDataToLevel /** @@ -239,7 +239,7 @@ public class MClientShare extends X_AD_ClientShare */ public String listChildRecords() { - StringBuffer info = new StringBuffer(); + StringBuilder info = new StringBuilder(); String sql = "SELECT AD_Table_ID, TableName " + "FROM AD_Table t " + "WHERE AccessLevel='3' AND IsView='N'" diff --git a/org.adempiere.base/src/org/compiere/model/MColor.java b/org.adempiere.base/src/org/compiere/model/MColor.java index 6c191a7f43..d10da418e2 100644 --- a/org.adempiere.base/src/org/compiere/model/MColor.java +++ b/org.adempiere.base/src/org/compiere/model/MColor.java @@ -54,7 +54,8 @@ public class MColor extends X_AD_Color */ public String toString() { - return "MColor[ID=" + get_ID() + " - " + getName() + "]"; + StringBuilder msgreturn = new StringBuilder("MColor[ID=").append(get_ID()).append(" - ").append(getName()).append("]"); + return msgreturn.toString(); } // toString /** diff --git a/org.adempiere.base/src/org/compiere/model/MColorSchema.java b/org.adempiere.base/src/org/compiere/model/MColorSchema.java index 3672f497c2..12ce4b5301 100644 --- a/org.adempiere.base/src/org/compiere/model/MColorSchema.java +++ b/org.adempiere.base/src/org/compiere/model/MColorSchema.java @@ -204,7 +204,7 @@ public class MColorSchema extends X_PA_ColorSchema */ public String toString () { - StringBuffer sb = new StringBuffer ("MColorSchema["); + StringBuilder sb = new StringBuilder ("MColorSchema["); sb.append (get_ID()).append ("-").append (getName()).append ("]"); return sb.toString (); } // toString diff --git a/org.adempiere.base/src/org/compiere/model/MColumn.java b/org.adempiere.base/src/org/compiere/model/MColumn.java index 17afe81858..60704a241e 100644 --- a/org.adempiere.base/src/org/compiere/model/MColumn.java +++ b/org.adempiere.base/src/org/compiere/model/MColumn.java @@ -304,7 +304,7 @@ public class MColumn extends X_AD_Column || is_ValueChanged(MColumn.COLUMNNAME_Description) || is_ValueChanged(MColumn.COLUMNNAME_Help) ) { - StringBuffer sql = new StringBuffer("UPDATE AD_Field SET Name=") + StringBuilder sql = new StringBuilder("UPDATE AD_Field SET Name=") .append(DB.TO_STRING(getName())) .append(", Description=").append(DB.TO_STRING(getDescription())) .append(", Help=").append(DB.TO_STRING(getHelp())) @@ -324,7 +324,7 @@ public class MColumn extends X_AD_Column */ public String getSQLAdd (MTable table) { - StringBuffer sql = new StringBuffer ("ALTER TABLE ") + StringBuilder sql = new StringBuilder ("ALTER TABLE ") .append(table.getTableName()) .append(" ADD ").append(getSQLDDL()); String constraint = getConstraint(table.getTableName()); @@ -345,7 +345,7 @@ public class MColumn extends X_AD_Column if (isVirtualColumn()) return null; - StringBuffer sql = new StringBuffer (getColumnName()) + StringBuilder sql = new StringBuilder (getColumnName()) .append(" ").append(getSQLDataType()); // Default @@ -393,13 +393,13 @@ public class MColumn extends X_AD_Column */ public String getSQLModify (MTable table, boolean setNullOption) { - StringBuffer sql = new StringBuffer(); - StringBuffer sqlBase = new StringBuffer ("ALTER TABLE ") + StringBuilder sql = new StringBuilder(); + StringBuilder sqlBase = new StringBuilder ("ALTER TABLE ") .append(table.getTableName()) .append(" MODIFY ").append(getColumnName()); // Default - StringBuffer sqlDefault = new StringBuffer(sqlBase) + StringBuilder sqlDefault = new StringBuilder(sqlBase) .append(" ").append(getSQLDataType()); String defaultValue = getDefaultValue(); if (defaultValue != null @@ -433,7 +433,7 @@ public class MColumn extends X_AD_Column // Null Values if (isMandatory() && defaultValue != null && defaultValue.length() > 0) { - StringBuffer sqlSet = new StringBuffer("UPDATE ") + StringBuilder sqlSet = new StringBuilder("UPDATE ") .append(table.getTableName()) .append(" SET ").append(getColumnName()) .append("=").append(defaultValue) @@ -444,7 +444,7 @@ public class MColumn extends X_AD_Column // Null if (setNullOption) { - StringBuffer sqlNull = new StringBuffer(sqlBase); + StringBuilder sqlNull = new StringBuilder(sqlBase); if (isMandatory()) sqlNull.append(" NOT NULL"); else @@ -505,13 +505,14 @@ public class MColumn extends X_AD_Column public String getConstraint(String tableName) { if (isKey()) { - String constraintName; + StringBuilder constraintName; if (tableName.length() > 26) // Oracle restricts object names to 30 characters - constraintName = tableName.substring(0, 26) + "_Key"; + constraintName = new StringBuilder(tableName.substring(0, 26)).append("_Key"); else - constraintName = tableName + "_Key"; - return "CONSTRAINT " + constraintName + " PRIMARY KEY (" + getColumnName() + ")"; + constraintName = new StringBuilder(tableName).append("_Key"); + StringBuilder msgreturn = new StringBuilder("CONSTRAINT ").append(constraintName).append(" PRIMARY KEY (").append(getColumnName()).append(")"); + return msgreturn.toString(); } /** if (getAD_Reference_ID() == DisplayType.TableDir @@ -530,7 +531,7 @@ public class MColumn extends X_AD_Column */ public String toString() { - StringBuffer sb = new StringBuffer ("MColumn["); + StringBuilder sb = new StringBuilder ("MColumn["); sb.append (get_ID()).append ("-").append (getColumnName()).append ("]"); return sb.toString (); } // toString diff --git a/org.adempiere.base/src/org/compiere/model/MColumnAccess.java b/org.adempiere.base/src/org/compiere/model/MColumnAccess.java index d2e429845e..c5ce061657 100644 --- a/org.adempiere.base/src/org/compiere/model/MColumnAccess.java +++ b/org.adempiere.base/src/org/compiere/model/MColumnAccess.java @@ -68,7 +68,7 @@ public class MColumnAccess extends X_AD_Column_Access */ public String toString() { - StringBuffer sb = new StringBuffer("MColumnAccess["); + StringBuilder sb = new StringBuilder("MColumnAccess["); sb.append("AD_Role_ID=").append(getAD_Role_ID()) .append(",AD_Table_ID=").append(getAD_Table_ID()) .append(",AD_Column_ID=").append(getAD_Column_ID()) @@ -86,7 +86,7 @@ public class MColumnAccess extends X_AD_Column_Access { String in = Msg.getMsg(ctx, "Include"); String ex = Msg.getMsg(ctx, "Exclude"); - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append(Msg.translate(ctx, "AD_Table_ID")) .append("=").append(getTableName(ctx)).append(", ") .append(Msg.translate(ctx, "AD_Column_ID")) @@ -157,8 +157,9 @@ public class MColumnAccess extends X_AD_Column_Access pstmt = null; } // Get Clear Text - String realName = Msg.translate(ctx, m_tableName + "_ID"); - if (!realName.equals(m_tableName + "_ID")) + StringBuilder msgrn = new StringBuilder(m_tableName).append("_ID"); + String realName = Msg.translate(ctx, msgrn.toString()); + if (!realName.equals(msgrn.toString())) m_tableName = realName; m_columnName = Msg.translate(ctx, m_columnName); } diff --git a/org.adempiere.base/src/org/compiere/model/MContactInterest.java b/org.adempiere.base/src/org/compiere/model/MContactInterest.java index 677cc4101b..78abb650d7 100644 --- a/org.adempiere.base/src/org/compiere/model/MContactInterest.java +++ b/org.adempiere.base/src/org/compiere/model/MContactInterest.java @@ -204,7 +204,7 @@ public class MContactInterest extends X_R_ContactInterest */ public String toString () { - StringBuffer sb = new StringBuffer ("MContactInterest[") + StringBuilder sb = new StringBuilder ("MContactInterest[") .append("R_InterestArea_ID=").append(getR_InterestArea_ID()) .append(",AD_User_ID=").append(getAD_User_ID()) .append(",Subscribed=").append(isSubscribed()) diff --git a/org.adempiere.base/src/org/compiere/model/MContainer.java b/org.adempiere.base/src/org/compiere/model/MContainer.java index ac22bf2d05..6f1b0735aa 100644 --- a/org.adempiere.base/src/org/compiere/model/MContainer.java +++ b/org.adempiere.base/src/org/compiere/model/MContainer.java @@ -274,18 +274,20 @@ public class MContainer extends X_CM_Container .getProperty ("java.naming.provider.url")), log, getCtx (), get_TrxName ()); // First update the new ones... + StringBuilder msgx = new StringBuilder("CM_CStage_ID=").append(stage.get_ID ()); int[] tableKeys = X_CM_CStage_Element.getAllIDs ("CM_CStage_Element", - "CM_CStage_ID=" + stage.get_ID (), trxName); + msgx.toString(), trxName); if (tableKeys != null && tableKeys.length > 0) { for (int i = 0; i < tableKeys.length; i++) { X_CM_CStage_Element thisStageElement = new X_CM_CStage_Element ( - project.getCtx (), tableKeys[i], trxName); + project.getCtx (), tableKeys[i], trxName); + msgx = new StringBuilder("CM_Container_ID=") + .append(stage.get_ID ()).append(" AND Name LIKE '") + .append(thisStageElement.getName ()).append("'"); int[] thisContainerElementKeys = X_CM_Container_Element - .getAllIDs ("CM_Container_Element", "CM_Container_ID=" - + stage.get_ID () + " AND Name LIKE '" - + thisStageElement.getName () + "'", trxName); + .getAllIDs ("CM_Container_Element", msgx.toString(), trxName); X_CM_Container_Element thisContainerElement; if (thisContainerElementKeys != null && thisContainerElementKeys.length > 0) @@ -318,18 +320,20 @@ public class MContainer extends X_CM_Container } } // Now we are checking the existing ones to delete the unneeded ones... + msgx = new StringBuilder("CM_Container_ID=").append(stage.get_ID ()); tableKeys = X_CM_Container_Element.getAllIDs ("CM_Container_Element", - "CM_Container_ID=" + stage.get_ID (), trxName); + msgx.toString(), trxName); if (tableKeys != null && tableKeys.length > 0) { for (int i = 0; i < tableKeys.length; i++) { X_CM_Container_Element thisContainerElement = new X_CM_Container_Element ( - project.getCtx (), tableKeys[i], trxName); + project.getCtx (), tableKeys[i], trxName); + msgx = new StringBuilder("CM_CStage_ID=") + .append(stage.get_ID ()).append(" AND Name LIKE '") + .append(thisContainerElement.getName ()).append("'"); int[] thisCStageElementKeys = X_CM_CStage_Element - .getAllIDs ("CM_CStage_Element", "CM_CStage_ID=" - + stage.get_ID () + " AND Name LIKE '" - + thisContainerElement.getName () + "'", trxName); + .getAllIDs ("CM_CStage_Element", msgx.toString(), trxName); // If we cannot find a representative in the Stage we will delete from production if (thisCStageElementKeys == null || thisCStageElementKeys.length < 1) @@ -356,18 +360,20 @@ public class MContainer extends X_CM_Container protected void updateTTables (MWebProject project, MCStage stage, String trxName) { + StringBuilder msgx = new StringBuilder("CM_CStage_ID=").append(stage.get_ID ()); int[] tableKeys = X_CM_CStageTTable.getAllIDs (I_CM_CStageTTable.Table_Name, - "CM_CStage_ID=" + stage.get_ID (), trxName); + msgx.toString(), trxName); if (tableKeys != null && tableKeys.length > 0) { for (int i = 0; i < tableKeys.length; i++) { X_CM_CStageTTable thisStageTTable = new X_CM_CStageTTable ( - project.getCtx (), tableKeys[i], trxName); + project.getCtx (), tableKeys[i], trxName); + msgx = new StringBuilder("CM_Container_ID=").append(stage.get_ID ()) + .append(" AND CM_TemplateTable_ID=") + .append(thisStageTTable.getCM_TemplateTable_ID ()); int[] thisContainerTTableKeys = X_CM_ContainerTTable.getAllIDs ( - I_CM_ContainerTTable.Table_Name, "CM_Container_ID=" + stage.get_ID () - + " AND CM_TemplateTable_ID=" - + thisStageTTable.getCM_TemplateTable_ID (), trxName); + I_CM_ContainerTTable.Table_Name, msgx.toString(), trxName); X_CM_ContainerTTable thisContainerTTable; if (thisContainerTTableKeys != null && thisContainerTTableKeys.length > 0) @@ -407,7 +413,7 @@ public class MContainer extends X_CM_Container */ public String toString () { - StringBuffer sb = new StringBuffer ("MContainer[").append (get_ID ()) + StringBuilder sb = new StringBuilder ("MContainer[").append (get_ID ()) .append ("-").append (getName ()).append ("]"); return sb.toString (); } // toString @@ -427,10 +433,10 @@ public class MContainer extends X_CM_Container return success; if (newRecord) { - StringBuffer sb = new StringBuffer ( - "INSERT INTO AD_TreeNodeCMC " - + "(AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, " - + "AD_Tree_ID, Node_ID, Parent_ID, SeqNo) " + "VALUES (") + StringBuilder sb = new StringBuilder ( + "INSERT INTO AD_TreeNodeCMC ") + .append("(AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, ") + .append("AD_Tree_ID, Node_ID, Parent_ID, SeqNo) ").append("VALUES (") .append (getAD_Client_ID ()).append ( ",0, 'Y', SysDate, 0, SysDate, 0,").append ( getAD_Tree_ID ()).append (",").append (get_ID ()).append ( @@ -447,7 +453,8 @@ public class MContainer extends X_CM_Container protected MContainerElement[] getAllElements() { - int elements[] = MContainerElement.getAllIDs("CM_Container_Element", "CM_Container_ID=" + get_ID(), get_TrxName()); + StringBuilder msgmc = new StringBuilder("CM_Container_ID=").append(get_ID()); + int elements[] = MContainerElement.getAllIDs("CM_Container_Element", msgmc.toString(), get_TrxName()); if (elements.length>0) { MContainerElement[] containerElements = new MContainerElement[elements.length]; @@ -475,7 +482,7 @@ public class MContainer extends X_CM_Container } } // - StringBuffer sb = new StringBuffer ("DELETE FROM AD_TreeNodeCMC ") + StringBuilder sb = new StringBuilder ("DELETE FROM AD_TreeNodeCMC ") .append (" WHERE Node_ID=").append (get_ID ()).append ( " AND AD_Tree_ID=").append (getAD_Tree_ID ()); int no = DB.executeUpdate (sb.toString (), get_TrxName ()); @@ -497,7 +504,7 @@ public class MContainer extends X_CM_Container if (!success) return success; // - StringBuffer sb = new StringBuffer ("DELETE FROM AD_TreeNodeCMC ") + StringBuilder sb = new StringBuilder ("DELETE FROM AD_TreeNodeCMC ") .append (" WHERE Node_ID=").append (get_IDOld ()).append ( " AND AD_Tree_ID=").append (getAD_Tree_ID ()); int no = DB.executeUpdate (sb.toString (), get_TrxName ()); diff --git a/org.adempiere.base/src/org/compiere/model/MConversionRate.java b/org.adempiere.base/src/org/compiere/model/MConversionRate.java index 225dadb3f2..14e3daf0b2 100644 --- a/org.adempiere.base/src/org/compiere/model/MConversionRate.java +++ b/org.adempiere.base/src/org/compiere/model/MConversionRate.java @@ -372,7 +372,7 @@ public class MConversionRate extends X_C_Conversion_Rate */ public String toString() { - StringBuffer sb = new StringBuffer("MConversionRate["); + StringBuilder sb = new StringBuilder("MConversionRate["); sb.append(get_ID()) .append(",Currency=").append(getC_Currency_ID()) .append(",To=").append(getC_Currency_ID_To()) diff --git a/org.adempiere.base/src/org/compiere/model/MCost.java b/org.adempiere.base/src/org/compiere/model/MCost.java index 831ae108c9..ea84d9e3d7 100644 --- a/org.adempiere.base/src/org/compiere/model/MCost.java +++ b/org.adempiere.base/src/org/compiere/model/MCost.java @@ -463,22 +463,22 @@ public class MCost extends X_M_Cost int M_ASI_ID, int AD_Org_ID, int C_Currency_ID) { BigDecimal retValue = null; - String sql = "SELECT currencyConvert(il.PriceActual, i.C_Currency_ID, ?, i.DateAcct, i.C_ConversionType_ID, il.AD_Client_ID, il.AD_Org_ID) " + StringBuilder sql = new StringBuilder("SELECT currencyConvert(il.PriceActual, i.C_Currency_ID, ?, i.DateAcct, i.C_ConversionType_ID, il.AD_Client_ID, il.AD_Org_ID) ") // ,il.PriceActual, il.QtyInvoiced, i.DateInvoiced, il.Line - + "FROM C_InvoiceLine il " - + " INNER JOIN C_Invoice i ON (il.C_Invoice_ID=i.C_Invoice_ID) " - + "WHERE il.M_Product_ID=?" - + " AND i.IsSOTrx='N'"; + .append("FROM C_InvoiceLine il ") + .append(" INNER JOIN C_Invoice i ON (il.C_Invoice_ID=i.C_Invoice_ID) ") + .append("WHERE il.M_Product_ID=?") + .append(" AND i.IsSOTrx='N'"); if (AD_Org_ID != 0) - sql += " AND il.AD_Org_ID=?"; + sql.append(" AND il.AD_Org_ID=?"); else if (M_ASI_ID != 0) - sql += " AND il.M_AttributeSetInstance_ID=?"; - sql += " ORDER BY i.DateInvoiced DESC, il.Line DESC"; + sql.append(" AND il.M_AttributeSetInstance_ID=?"); + sql.append(" ORDER BY i.DateInvoiced DESC, il.Line DESC"); // PreparedStatement pstmt = null; try { - pstmt = DB.prepareStatement (sql, product.get_TrxName()); + pstmt = DB.prepareStatement (sql.toString(), product.get_TrxName()); pstmt.setInt (1, C_Currency_ID); pstmt.setInt (2, product.getM_Product_ID()); if (AD_Org_ID != 0) @@ -494,7 +494,7 @@ public class MCost extends X_M_Cost } catch (Exception e) { - s_log.log (Level.SEVERE, sql, e); + s_log.log (Level.SEVERE, sql.toString(), e); } try { @@ -527,24 +527,24 @@ public class MCost extends X_M_Cost int M_ASI_ID, int AD_Org_ID, int C_Currency_ID) { BigDecimal retValue = null; - String sql = "SELECT currencyConvert(ol.PriceCost, o.C_Currency_ID, ?, o.DateAcct, o.C_ConversionType_ID, ol.AD_Client_ID, ol.AD_Org_ID)," - + " currencyConvert(ol.PriceActual, o.C_Currency_ID, ?, o.DateAcct, o.C_ConversionType_ID, ol.AD_Client_ID, ol.AD_Org_ID) " + StringBuilder sql = new StringBuilder("SELECT currencyConvert(ol.PriceCost, o.C_Currency_ID, ?, o.DateAcct, o.C_ConversionType_ID, ol.AD_Client_ID, ol.AD_Org_ID),") + .append(" currencyConvert(ol.PriceActual, o.C_Currency_ID, ?, o.DateAcct, o.C_ConversionType_ID, ol.AD_Client_ID, ol.AD_Org_ID) ") // ,ol.PriceCost,ol.PriceActual, ol.QtyOrdered, o.DateOrdered, ol.Line - + "FROM C_OrderLine ol" - + " INNER JOIN C_Order o ON (ol.C_Order_ID=o.C_Order_ID) " - + "WHERE ol.M_Product_ID=?" - + " AND o.IsSOTrx='N'"; + .append("FROM C_OrderLine ol") + .append(" INNER JOIN C_Order o ON (ol.C_Order_ID=o.C_Order_ID) ") + .append("WHERE ol.M_Product_ID=?") + .append(" AND o.IsSOTrx='N'"); if (AD_Org_ID != 0) - sql += " AND ol.AD_Org_ID=?"; + sql.append(" AND ol.AD_Org_ID=?"); else if (M_ASI_ID != 0) - sql += " AND ol.M_AttributeSetInstance_ID=?"; - sql += " ORDER BY o.DateOrdered DESC, ol.Line DESC"; + sql.append(" AND ol.M_AttributeSetInstance_ID=?"); + sql.append(" ORDER BY o.DateOrdered DESC, ol.Line DESC"); // PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement (sql, product.get_TrxName()); + pstmt = DB.prepareStatement (sql.toString(), product.get_TrxName()); pstmt.setInt (1, C_Currency_ID); pstmt.setInt (2, C_Currency_ID); pstmt.setInt (3, product.getM_Product_ID()); @@ -562,7 +562,7 @@ public class MCost extends X_M_Cost } catch (SQLException e) { - throw new DBException(e, sql); + throw new DBException(e, sql.toString()); } finally { @@ -838,18 +838,18 @@ public class MCost extends X_M_Cost public static BigDecimal calculateAverageInv (MProduct product, int M_AttributeSetInstance_ID, MAcctSchema as, int AD_Org_ID) { - String sql = "SELECT t.MovementQty, mi.Qty, il.QtyInvoiced, il.PriceActual," - + " i.C_Currency_ID, i.DateAcct, i.C_ConversionType_ID, i.AD_Client_ID, i.AD_Org_ID, t.M_Transaction_ID " - + "FROM M_Transaction t" - + " INNER JOIN M_MatchInv mi ON (t.M_InOutLine_ID=mi.M_InOutLine_ID)" - + " INNER JOIN C_InvoiceLine il ON (mi.C_InvoiceLine_ID=il.C_InvoiceLine_ID)" - + " INNER JOIN C_Invoice i ON (il.C_Invoice_ID=i.C_Invoice_ID) " - + "WHERE t.M_Product_ID=?"; + StringBuilder sql = new StringBuilder("SELECT t.MovementQty, mi.Qty, il.QtyInvoiced, il.PriceActual,") + .append(" i.C_Currency_ID, i.DateAcct, i.C_ConversionType_ID, i.AD_Client_ID, i.AD_Org_ID, t.M_Transaction_ID ") + .append("FROM M_Transaction t") + .append(" INNER JOIN M_MatchInv mi ON (t.M_InOutLine_ID=mi.M_InOutLine_ID)") + .append(" INNER JOIN C_InvoiceLine il ON (mi.C_InvoiceLine_ID=il.C_InvoiceLine_ID)") + .append(" INNER JOIN C_Invoice i ON (il.C_Invoice_ID=i.C_Invoice_ID) ") + .append("WHERE t.M_Product_ID=?"); if (AD_Org_ID != 0) - sql += " AND t.AD_Org_ID=?"; + sql.append(" AND t.AD_Org_ID=?"); else if (M_AttributeSetInstance_ID != 0) - sql += " AND t.M_AttributeSetInstance_ID=?"; - sql += " ORDER BY t.M_Transaction_ID"; + sql.append(" AND t.M_AttributeSetInstance_ID=?"); + sql.append(" ORDER BY t.M_Transaction_ID"); PreparedStatement pstmt = null; ResultSet rs = null; @@ -859,7 +859,7 @@ public class MCost extends X_M_Cost int oldTransaction_ID = 0; try { - pstmt = DB.prepareStatement (sql, null); + pstmt = DB.prepareStatement (sql.toString(), null); pstmt.setInt (1, product.getM_Product_ID()); if (AD_Org_ID != 0) pstmt.setInt (2, AD_Org_ID); @@ -904,7 +904,7 @@ public class MCost extends X_M_Cost } catch (SQLException e) { - throw new DBException(e, sql); + throw new DBException(e, sql.toString()); } finally { @@ -931,19 +931,19 @@ public class MCost extends X_M_Cost public static BigDecimal calculateAveragePO (MProduct product, int M_AttributeSetInstance_ID, MAcctSchema as, int AD_Org_ID) { - String sql = "SELECT t.MovementQty, mp.Qty, ol.QtyOrdered, ol.PriceCost, ol.PriceActual," // 1..5 - + " o.C_Currency_ID, o.DateAcct, o.C_ConversionType_ID," // 6..8 - + " o.AD_Client_ID, o.AD_Org_ID, t.M_Transaction_ID " // 9..11 - + "FROM M_Transaction t" - + " INNER JOIN M_MatchPO mp ON (t.M_InOutLine_ID=mp.M_InOutLine_ID)" - + " INNER JOIN C_OrderLine ol ON (mp.C_OrderLine_ID=ol.C_OrderLine_ID)" - + " INNER JOIN C_Order o ON (ol.C_Order_ID=o.C_Order_ID) " - + "WHERE t.M_Product_ID=?"; + StringBuilder sql = new StringBuilder("SELECT t.MovementQty, mp.Qty, ol.QtyOrdered, ol.PriceCost, ol.PriceActual,") // 1..5 + .append(" o.C_Currency_ID, o.DateAcct, o.C_ConversionType_ID,") // 6..8 + .append(" o.AD_Client_ID, o.AD_Org_ID, t.M_Transaction_ID ") // 9..11 + .append("FROM M_Transaction t") + .append(" INNER JOIN M_MatchPO mp ON (t.M_InOutLine_ID=mp.M_InOutLine_ID)") + .append(" INNER JOIN C_OrderLine ol ON (mp.C_OrderLine_ID=ol.C_OrderLine_ID)") + .append(" INNER JOIN C_Order o ON (ol.C_Order_ID=o.C_Order_ID) ") + .append("WHERE t.M_Product_ID=?"); if (AD_Org_ID != 0) - sql += " AND t.AD_Org_ID=?"; + sql.append(" AND t.AD_Org_ID=?"); else if (M_AttributeSetInstance_ID != 0) - sql += " AND t.M_AttributeSetInstance_ID=?"; - sql += " ORDER BY t.M_Transaction_ID"; + sql.append(" AND t.M_AttributeSetInstance_ID=?"); + sql.append(" ORDER BY t.M_Transaction_ID"); PreparedStatement pstmt = null; ResultSet rs = null; @@ -953,7 +953,7 @@ public class MCost extends X_M_Cost int oldTransaction_ID = 0; try { - pstmt = DB.prepareStatement (sql, null); + pstmt = DB.prepareStatement (sql.toString(), null); pstmt.setInt (1, product.getM_Product_ID()); if (AD_Org_ID != 0) pstmt.setInt (2, AD_Org_ID); @@ -1000,7 +1000,7 @@ public class MCost extends X_M_Cost } catch (SQLException e) { - throw new DBException(e, sql); + throw new DBException(e, sql.toString()); } finally { @@ -1027,18 +1027,18 @@ public class MCost extends X_M_Cost public static BigDecimal calculateFiFo (MProduct product, int M_AttributeSetInstance_ID, MAcctSchema as, int AD_Org_ID) { - String sql = "SELECT t.MovementQty, mi.Qty, il.QtyInvoiced, il.PriceActual," - + " i.C_Currency_ID, i.DateAcct, i.C_ConversionType_ID, i.AD_Client_ID, i.AD_Org_ID, t.M_Transaction_ID " - + "FROM M_Transaction t" - + " INNER JOIN M_MatchInv mi ON (t.M_InOutLine_ID=mi.M_InOutLine_ID)" - + " INNER JOIN C_InvoiceLine il ON (mi.C_InvoiceLine_ID=il.C_InvoiceLine_ID)" - + " INNER JOIN C_Invoice i ON (il.C_Invoice_ID=i.C_Invoice_ID) " - + "WHERE t.M_Product_ID=?"; + StringBuilder sql = new StringBuilder("SELECT t.MovementQty, mi.Qty, il.QtyInvoiced, il.PriceActual,") + .append(" i.C_Currency_ID, i.DateAcct, i.C_ConversionType_ID, i.AD_Client_ID, i.AD_Org_ID, t.M_Transaction_ID ") + .append("FROM M_Transaction t") + .append(" INNER JOIN M_MatchInv mi ON (t.M_InOutLine_ID=mi.M_InOutLine_ID)") + .append(" INNER JOIN C_InvoiceLine il ON (mi.C_InvoiceLine_ID=il.C_InvoiceLine_ID)") + .append(" INNER JOIN C_Invoice i ON (il.C_Invoice_ID=i.C_Invoice_ID) ") + .append("WHERE t.M_Product_ID=?"); if (AD_Org_ID != 0) - sql += " AND t.AD_Org_ID=?"; + sql.append(" AND t.AD_Org_ID=?"); else if (M_AttributeSetInstance_ID != 0) - sql += " AND t.M_AttributeSetInstance_ID=?"; - sql += " ORDER BY t.M_Transaction_ID"; + sql.append(" AND t.M_AttributeSetInstance_ID=?"); + sql.append(" ORDER BY t.M_Transaction_ID"); PreparedStatement pstmt = null; ResultSet rs = null; @@ -1047,7 +1047,7 @@ public class MCost extends X_M_Cost ArrayList fifo = new ArrayList(); try { - pstmt = DB.prepareStatement (sql, null); + pstmt = DB.prepareStatement (sql.toString(), null); pstmt.setInt (1, product.getM_Product_ID()); if (AD_Org_ID != 0) pstmt.setInt (2, AD_Org_ID); @@ -1136,7 +1136,7 @@ public class MCost extends X_M_Cost } catch (SQLException e) { - throw new DBException(e, sql); + throw new DBException(e, sql.toString()); } finally { @@ -1164,19 +1164,19 @@ public class MCost extends X_M_Cost public static BigDecimal calculateLiFo (MProduct product, int M_AttributeSetInstance_ID, MAcctSchema as, int AD_Org_ID) { - String sql = "SELECT t.MovementQty, mi.Qty, il.QtyInvoiced, il.PriceActual," - + " i.C_Currency_ID, i.DateAcct, i.C_ConversionType_ID, i.AD_Client_ID, i.AD_Org_ID, t.M_Transaction_ID " - + "FROM M_Transaction t" - + " INNER JOIN M_MatchInv mi ON (t.M_InOutLine_ID=mi.M_InOutLine_ID)" - + " INNER JOIN C_InvoiceLine il ON (mi.C_InvoiceLine_ID=il.C_InvoiceLine_ID)" - + " INNER JOIN C_Invoice i ON (il.C_Invoice_ID=i.C_Invoice_ID) " - + "WHERE t.M_Product_ID=?"; + StringBuilder sql = new StringBuilder("SELECT t.MovementQty, mi.Qty, il.QtyInvoiced, il.PriceActual,") + .append(" i.C_Currency_ID, i.DateAcct, i.C_ConversionType_ID, i.AD_Client_ID, i.AD_Org_ID, t.M_Transaction_ID ") + .append("FROM M_Transaction t") + .append(" INNER JOIN M_MatchInv mi ON (t.M_InOutLine_ID=mi.M_InOutLine_ID)") + .append(" INNER JOIN C_InvoiceLine il ON (mi.C_InvoiceLine_ID=il.C_InvoiceLine_ID)") + .append(" INNER JOIN C_Invoice i ON (il.C_Invoice_ID=i.C_Invoice_ID) ") + .append("WHERE t.M_Product_ID=?"); if (AD_Org_ID != 0) - sql += " AND t.AD_Org_ID=?"; + sql.append(" AND t.AD_Org_ID=?"); else if (M_AttributeSetInstance_ID != 0) - sql += " AND t.M_AttributeSetInstance_ID=?"; + sql.append(" AND t.M_AttributeSetInstance_ID=?"); // Starting point? - sql += " ORDER BY t.M_Transaction_ID DESC"; + sql.append(" ORDER BY t.M_Transaction_ID DESC"); PreparedStatement pstmt = null; ResultSet rs = null; @@ -1185,7 +1185,7 @@ public class MCost extends X_M_Cost ArrayList lifo = new ArrayList(); try { - pstmt = DB.prepareStatement (sql, null); + pstmt = DB.prepareStatement (sql.toString(), null); pstmt.setInt (1, product.getM_Product_ID()); if (AD_Org_ID != 0) pstmt.setInt (2, AD_Org_ID); @@ -1255,7 +1255,7 @@ public class MCost extends X_M_Cost } catch (SQLException e) { - throw new DBException(e, sql); + throw new DBException(e, sql.toString()); } finally { @@ -1299,7 +1299,7 @@ public class MCost extends X_M_Cost */ public String toString () { - StringBuffer sb = new StringBuffer ("Qty=").append(Qty) + StringBuilder sb = new StringBuilder ("Qty=").append(Qty) .append (",Cost=").append (Cost); return sb.toString (); } // toString @@ -1562,7 +1562,7 @@ public class MCost extends X_M_Cost */ public String toString () { - StringBuffer sb = new StringBuffer ("MCost["); + StringBuilder sb = new StringBuilder ("MCost["); sb.append ("AD_Client_ID=").append (getAD_Client_ID()); if (getAD_Org_ID() != 0) sb.append (",AD_Org_ID=").append (getAD_Org_ID()); diff --git a/org.adempiere.base/src/org/compiere/model/MCostDetail.java b/org.adempiere.base/src/org/compiere/model/MCostDetail.java index 85cfef48d7..6141fc9a9c 100644 --- a/org.adempiere.base/src/org/compiere/model/MCostDetail.java +++ b/org.adempiere.base/src/org/compiere/model/MCostDetail.java @@ -73,12 +73,12 @@ public class MCostDetail extends X_M_CostDetail String Description, String trxName) { // Delete Unprocessed zero Differences - String sql = "DELETE M_CostDetail " - + "WHERE Processed='N' AND COALESCE(DeltaAmt,0)=0 AND COALESCE(DeltaQty,0)=0" - + " AND C_OrderLine_ID=" + C_OrderLine_ID - + " AND C_AcctSchema_ID =" + as.getC_AcctSchema_ID() - + " AND M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID; - int no = DB.executeUpdate(sql, trxName); + StringBuilder sql = new StringBuilder("DELETE M_CostDetail ") + .append("WHERE Processed='N' AND COALESCE(DeltaAmt,0)=0 AND COALESCE(DeltaQty,0)=0") + .append(" AND C_OrderLine_ID=").append(C_OrderLine_ID) + .append(" AND C_AcctSchema_ID =").append(as.getC_AcctSchema_ID()) + .append(" AND M_AttributeSetInstance_ID=").append(M_AttributeSetInstance_ID); + int no = DB.executeUpdate(sql.toString(), trxName); if (no != 0) s_log.config("Deleted #" + no); MCostDetail cd = get (as.getCtx(), "C_OrderLine_ID=?", @@ -140,12 +140,12 @@ public class MCostDetail extends X_M_CostDetail String Description, String trxName) { // Delete Unprocessed zero Differences - String sql = "DELETE M_CostDetail " - + "WHERE Processed='N' AND COALESCE(DeltaAmt,0)=0 AND COALESCE(DeltaQty,0)=0" - + " AND C_InvoiceLine_ID=" + C_InvoiceLine_ID - + " AND C_AcctSchema_ID =" + as.getC_AcctSchema_ID() - + " AND M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID; - int no = DB.executeUpdate(sql, trxName); + StringBuilder sql = new StringBuilder("DELETE M_CostDetail ") + .append("WHERE Processed='N' AND COALESCE(DeltaAmt,0)=0 AND COALESCE(DeltaQty,0)=0") + .append(" AND C_InvoiceLine_ID=").append(C_InvoiceLine_ID) + .append(" AND C_AcctSchema_ID =").append(as.getC_AcctSchema_ID()) + .append(" AND M_AttributeSetInstance_ID=").append(M_AttributeSetInstance_ID); + int no = DB.executeUpdate(sql.toString(), trxName); if (no != 0) s_log.config("Deleted #" + no); MCostDetail cd = get (as.getCtx(), "C_InvoiceLine_ID=?", @@ -207,12 +207,12 @@ public class MCostDetail extends X_M_CostDetail String Description, boolean IsSOTrx, String trxName) { // Delete Unprocessed zero Differences - String sql = "DELETE M_CostDetail " - + "WHERE Processed='N' AND COALESCE(DeltaAmt,0)=0 AND COALESCE(DeltaQty,0)=0" - + " AND M_InOutLine_ID=" + M_InOutLine_ID - + " AND C_AcctSchema_ID =" + as.getC_AcctSchema_ID() - + " AND M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID; - int no = DB.executeUpdate(sql, trxName); + StringBuilder sql = new StringBuilder("DELETE M_CostDetail ") + .append("WHERE Processed='N' AND COALESCE(DeltaAmt,0)=0 AND COALESCE(DeltaQty,0)=0") + .append(" AND M_InOutLine_ID=").append(M_InOutLine_ID) + .append(" AND C_AcctSchema_ID =").append(as.getC_AcctSchema_ID()) + .append(" AND M_AttributeSetInstance_ID=").append(M_AttributeSetInstance_ID); + int no = DB.executeUpdate(sql.toString(), trxName); if (no != 0) s_log.config("Deleted #" + no); MCostDetail cd = get (as.getCtx(), "M_InOutLine_ID=?", @@ -274,12 +274,12 @@ public class MCostDetail extends X_M_CostDetail String Description, String trxName) { // Delete Unprocessed zero Differences - String sql = "DELETE M_CostDetail " - + "WHERE Processed='N' AND COALESCE(DeltaAmt,0)=0 AND COALESCE(DeltaQty,0)=0" - + " AND M_InventoryLine_ID=" + M_InventoryLine_ID - + " AND C_AcctSchema_ID =" + as.getC_AcctSchema_ID() - + " AND M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID; - int no = DB.executeUpdate(sql, trxName); + StringBuilder sql = new StringBuilder("DELETE M_CostDetail ") + .append("WHERE Processed='N' AND COALESCE(DeltaAmt,0)=0 AND COALESCE(DeltaQty,0)=0") + .append(" AND M_InventoryLine_ID=").append(M_InventoryLine_ID) + .append(" AND C_AcctSchema_ID =").append(as.getC_AcctSchema_ID()) + .append(" AND M_AttributeSetInstance_ID=").append(M_AttributeSetInstance_ID); + int no = DB.executeUpdate(sql.toString(), trxName); if (no != 0) s_log.config("Deleted #" + no); MCostDetail cd = get (as.getCtx(), "M_InventoryLine_ID=?", @@ -341,17 +341,18 @@ public class MCostDetail extends X_M_CostDetail String Description, String trxName) { // Delete Unprocessed zero Differences - String sql = "DELETE M_CostDetail " - + "WHERE Processed='N' AND COALESCE(DeltaAmt,0)=0 AND COALESCE(DeltaQty,0)=0" - + " AND M_MovementLine_ID=" + M_MovementLine_ID - + " AND IsSOTrx=" + (from ? "'Y'" : "'N'") - + " AND C_AcctSchema_ID =" + as.getC_AcctSchema_ID() - + " AND M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID; - int no = DB.executeUpdate(sql, trxName); + StringBuilder sql = new StringBuilder("DELETE M_CostDetail ") + .append("WHERE Processed='N' AND COALESCE(DeltaAmt,0)=0 AND COALESCE(DeltaQty,0)=0") + .append(" AND M_MovementLine_ID=").append(M_MovementLine_ID) + .append(" AND IsSOTrx=").append((from ? "'Y'" : "'N'")) + .append(" AND C_AcctSchema_ID =").append(as.getC_AcctSchema_ID()) + .append(" AND M_AttributeSetInstance_ID=").append(M_AttributeSetInstance_ID); + int no = DB.executeUpdate(sql.toString(), trxName); if (no != 0) s_log.config("Deleted #" + no); - MCostDetail cd = get (as.getCtx(), "M_MovementLine_ID=? AND IsSOTrx=" - + (from ? "'Y'" : "'N'"), + StringBuilder msget = new StringBuilder( "M_MovementLine_ID=? AND IsSOTrx=") + .append((from ? "'Y'" : "'N'")); + MCostDetail cd = get (as.getCtx(),msget.toString(), M_MovementLine_ID, M_AttributeSetInstance_ID, as.getC_AcctSchema_ID(), trxName); // if (cd == null) // createNew @@ -410,12 +411,12 @@ public class MCostDetail extends X_M_CostDetail String Description, String trxName) { // Delete Unprocessed zero Differences - String sql = "DELETE M_CostDetail " - + "WHERE Processed='N' AND COALESCE(DeltaAmt,0)=0 AND COALESCE(DeltaQty,0)=0" - + " AND M_ProductionLine_ID=" + M_ProductionLine_ID - + " AND C_AcctSchema_ID =" + as.getC_AcctSchema_ID() - + " AND M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID; - int no = DB.executeUpdate(sql, trxName); + StringBuilder sql = new StringBuilder("DELETE M_CostDetail ") + .append("WHERE Processed='N' AND COALESCE(DeltaAmt,0)=0 AND COALESCE(DeltaQty,0)=0") + .append(" AND M_ProductionLine_ID=").append(M_ProductionLine_ID) + .append(" AND C_AcctSchema_ID =").append(as.getC_AcctSchema_ID()) + .append(" AND M_AttributeSetInstance_ID=").append(M_AttributeSetInstance_ID); + int no = DB.executeUpdate(sql.toString(), trxName); if (no != 0) s_log.config("Deleted #" + no); MCostDetail cd = get (as.getCtx(), "M_ProductionLine_ID=?", @@ -467,21 +468,21 @@ public class MCostDetail extends X_M_CostDetail public static MCostDetail get (Properties ctx, String whereClause, int ID, int M_AttributeSetInstance_ID, String trxName) { - String sql = "SELECT * FROM M_CostDetail WHERE " + whereClause; + StringBuilder sql = new StringBuilder("SELECT * FROM M_CostDetail WHERE ").append(whereClause); MClientInfo clientInfo = MClientInfo.get(ctx); MAcctSchema primary = clientInfo.getMAcctSchema1(); int C_AcctSchema_ID = primary != null ? primary.getC_AcctSchema_ID() : 0; if (C_AcctSchema_ID > 0) { - sql = sql + " AND C_AcctSchema_ID=?"; + sql.append(" AND C_AcctSchema_ID=?"); } MCostDetail retValue = null; PreparedStatement pstmt = null; ResultSet rs = null; try { - pstmt = DB.prepareStatement (sql, null); + pstmt = DB.prepareStatement (sql.toString(), null); pstmt.setInt (1, ID); pstmt.setInt (2, M_AttributeSetInstance_ID); if (C_AcctSchema_ID > 0) @@ -515,10 +516,10 @@ public class MCostDetail extends X_M_CostDetail public static MCostDetail get (Properties ctx, String whereClause, int ID, int M_AttributeSetInstance_ID, int C_AcctSchema_ID, String trxName) { - final String localWhereClause = whereClause - + " AND M_AttributeSetInstance_ID=?" - + " AND C_AcctSchema_ID=?"; - MCostDetail retValue = new Query(ctx,I_M_CostDetail.Table_Name,localWhereClause,trxName) + StringBuilder localWhereClause = new StringBuilder(whereClause) + .append(" AND M_AttributeSetInstance_ID=?") + .append(" AND C_AcctSchema_ID=?"); + MCostDetail retValue = new Query(ctx,I_M_CostDetail.Table_Name,localWhereClause.toString(),trxName) .setParameters(ID,M_AttributeSetInstance_ID,C_AcctSchema_ID) .first(); return retValue; @@ -714,7 +715,7 @@ public class MCostDetail extends X_M_CostDetail */ public String toString () { - StringBuffer sb = new StringBuffer ("MCostDetail["); + StringBuilder sb = new StringBuilder ("MCostDetail["); sb.append (get_ID()); if (getC_OrderLine_ID() != 0) sb.append (",C_OrderLine_ID=").append (getC_OrderLine_ID()); @@ -1001,17 +1002,17 @@ public class MCostDetail extends X_M_CostDetail * Solution: * Make sure the current qty is reflecting the actual qty in storage */ - String sql = "SELECT COALESCE(SUM(QtyOnHand),0) FROM M_Storage" - + " WHERE AD_Client_ID=" + cost.getAD_Client_ID() - + " AND M_Product_ID=" + cost.getM_Product_ID(); + StringBuilder sql = new StringBuilder("SELECT COALESCE(SUM(QtyOnHand),0) FROM M_Storage") + .append(" WHERE AD_Client_ID=").append(cost.getAD_Client_ID()) + .append(" AND M_Product_ID=").append(cost.getM_Product_ID()); //Costing Level String CostingLevel = product.getCostingLevel(as); if (MAcctSchema.COSTINGLEVEL_Organization.equals(CostingLevel)) - sql += " AND AD_Org_ID=" + cost.getAD_Org_ID(); + sql.append(" AND AD_Org_ID=").append(cost.getAD_Org_ID()); else if (MAcctSchema.COSTINGLEVEL_BatchLot.equals(CostingLevel)) - sql += " AND M_AttributeSetInstance_ID=" + M_ASI_ID; + sql.append(" AND M_AttributeSetInstance_ID=").append(M_ASI_ID); // - BigDecimal qtyOnhand = DB.getSQLValueBD(get_TrxName(), sql); + BigDecimal qtyOnhand = DB.getSQLValueBD(get_TrxName(), sql.toString()); if (qtyOnhand.signum() != 0) { BigDecimal oldSum = cost.getCurrentCostPrice().multiply(cost.getCurrentQty()); @@ -1158,17 +1159,17 @@ public class MCostDetail extends X_M_CostDetail MCostElement[] lce = MCostElement.getNonCostingMethods(this); if (lce.length > 0) { - String sql = "SELECT COALESCE(SUM(QtyOnHand),0) FROM M_Storage" - + " WHERE AD_Client_ID=" + cost.getAD_Client_ID() - + " AND M_Product_ID=" + cost.getM_Product_ID(); + StringBuilder sql = new StringBuilder("SELECT COALESCE(SUM(QtyOnHand),0) FROM M_Storage") + .append(" WHERE AD_Client_ID=").append(cost.getAD_Client_ID()) + .append(" AND M_Product_ID=").append(cost.getM_Product_ID()); //Costing Level String CostingLevel = product.getCostingLevel(as); if (MAcctSchema.COSTINGLEVEL_Organization.equals(CostingLevel)) - sql += " AND AD_Org_ID=" + cost.getAD_Org_ID(); + sql.append(" AND AD_Org_ID=").append(cost.getAD_Org_ID()); else if (MAcctSchema.COSTINGLEVEL_BatchLot.equals(CostingLevel)) - sql += " AND M_AttributeSetInstance_ID=" + M_ASI_ID; + sql.append(" AND M_AttributeSetInstance_ID=").append(M_ASI_ID); // - BigDecimal qtyOnhand = DB.getSQLValueBD(get_TrxName(), sql); + BigDecimal qtyOnhand = DB.getSQLValueBD(get_TrxName(), sql.toString()); for (int i = 0 ; i < lce.length ; i++) { MCost lCost = MCost.get(getCtx(), cost.getAD_Client_ID(), cost.getAD_Org_ID(), diff --git a/org.adempiere.base/src/org/compiere/model/MCostElement.java b/org.adempiere.base/src/org/compiere/model/MCostElement.java index a2b4769707..29b4158fb2 100644 --- a/org.adempiere.base/src/org/compiere/model/MCostElement.java +++ b/org.adempiere.base/src/org/compiere/model/MCostElement.java @@ -441,7 +441,7 @@ public class MCostElement extends X_M_CostElement */ public String toString () { - StringBuffer sb = new StringBuffer ("MCostElement["); + StringBuilder sb = new StringBuilder ("MCostElement["); sb.append (get_ID ()) .append ("-").append (getName()) .append(",Type=").append(getCostElementType()) diff --git a/org.adempiere.base/src/org/compiere/model/MCostQueue.java b/org.adempiere.base/src/org/compiere/model/MCostQueue.java index 4157861c1e..b0e72ef9cf 100644 --- a/org.adempiere.base/src/org/compiere/model/MCostQueue.java +++ b/org.adempiere.base/src/org/compiere/model/MCostQueue.java @@ -115,21 +115,21 @@ public class MCostQueue extends X_M_CostQueue MAcctSchema as, int Org_ID, MCostElement ce, String trxName) { ArrayList list = new ArrayList(); - String sql = "SELECT * FROM M_CostQueue " - + "WHERE AD_Client_ID=? AND AD_Org_ID=?" - + " AND M_Product_ID=?" - + " AND M_CostType_ID=? AND C_AcctSchema_ID=?" - + " AND M_CostElement_ID=?"; + StringBuilder sql = new StringBuilder("SELECT * FROM M_CostQueue ") + .append("WHERE AD_Client_ID=? AND AD_Org_ID=?") + .append(" AND M_Product_ID=?") + .append(" AND M_CostType_ID=? AND C_AcctSchema_ID=?") + .append(" AND M_CostElement_ID=?"); if (M_ASI_ID != 0) - sql += " AND M_AttributeSetInstance_ID=?"; - sql += " AND CurrentQty<>0 " - + "ORDER BY M_AttributeSetInstance_ID "; + sql.append(" AND M_AttributeSetInstance_ID=?"); + sql.append(" AND CurrentQty<>0 ") + .append("ORDER BY M_AttributeSetInstance_ID "); if (!ce.isFifo()) - sql += "DESC"; + sql.append("DESC"); PreparedStatement pstmt = null; try { - pstmt = DB.prepareStatement (sql, trxName); + pstmt = DB.prepareStatement (sql.toString(), trxName); pstmt.setInt (1, product.getAD_Client_ID()); pstmt.setInt (2, Org_ID); pstmt.setInt (3, product.getM_Product_ID()); @@ -147,7 +147,7 @@ public class MCostQueue extends X_M_CostQueue } catch (Exception e) { - s_log.log (Level.SEVERE, sql, e); + s_log.log (Level.SEVERE, sql.toString(), e); } try { diff --git a/org.adempiere.base/src/org/compiere/model/MCostType.java b/org.adempiere.base/src/org/compiere/model/MCostType.java index 3d055b9c45..57efe558b7 100644 --- a/org.adempiere.base/src/org/compiere/model/MCostType.java +++ b/org.adempiere.base/src/org/compiere/model/MCostType.java @@ -61,7 +61,7 @@ public class MCostType extends X_M_CostType */ public String toString () { - StringBuffer sb = new StringBuffer ("MCostType["); + StringBuilder sb = new StringBuilder ("MCostType["); sb.append (get_ID()).append ("-").append (getName ()).append ("]"); return sb.toString (); } // toString diff --git a/org.adempiere.base/src/org/compiere/model/MCurrency.java b/org.adempiere.base/src/org/compiere/model/MCurrency.java index d4021884d0..c15e923241 100644 --- a/org.adempiere.base/src/org/compiere/model/MCurrency.java +++ b/org.adempiere.base/src/org/compiere/model/MCurrency.java @@ -146,15 +146,15 @@ public class MCurrency extends X_C_Currency */ public static String getISO_Code (Properties ctx, int C_Currency_ID) { - String contextKey = "C_Currency_" + C_Currency_ID; - String retValue = ctx.getProperty(contextKey); + StringBuilder contextKey = new StringBuilder("C_Currency_").append(C_Currency_ID); + String retValue = ctx.getProperty(contextKey.toString()); if (retValue != null) return retValue; // Create it MCurrency c = get(ctx, C_Currency_ID); retValue = c.getISO_Code(); - ctx.setProperty(contextKey, retValue); + ctx.setProperty(contextKey.toString(), retValue); return retValue; } // getISO @@ -176,10 +176,11 @@ public class MCurrency extends X_C_Currency */ public String toString() { - return "MCurrency[" + getC_Currency_ID() - + "-" + getISO_Code() + "-" + getCurSymbol() - + "," + getDescription() - + ",Precision=" + getStdPrecision() + "/" + getCostingPrecision(); + StringBuilder msgreturn = new StringBuilder("MCurrency[").append(getC_Currency_ID()) + .append("-").append(getISO_Code()).append("-").append(getCurSymbol()) + .append(",").append(getDescription()) + .append(",Precision=").append(getStdPrecision()).append("/").append(getCostingPrecision()); + return msgreturn.toString(); } // toString diff --git a/org.adempiere.base/src/org/compiere/model/MDashboardContent.java b/org.adempiere.base/src/org/compiere/model/MDashboardContent.java index d015ec0350..bd4bbd61c1 100644 --- a/org.adempiere.base/src/org/compiere/model/MDashboardContent.java +++ b/org.adempiere.base/src/org/compiere/model/MDashboardContent.java @@ -37,24 +37,24 @@ public class MDashboardContent extends X_PA_DashboardContent { Properties ctx = Env.getCtx(); - String whereClause = COLUMNNAME_IsShowInDashboard+"=?"; + StringBuilder whereClause = new StringBuilder(COLUMNNAME_IsShowInDashboard).append("=?"); if (AD_Role_ID == 0) - whereClause += " AND ("+COLUMNNAME_AD_Role_ID+" IS NULL OR "+COLUMNNAME_AD_Role_ID+"=?)"; + whereClause.append(" AND (").append(COLUMNNAME_AD_Role_ID).append(" IS NULL OR ").append(COLUMNNAME_AD_Role_ID).append("=?)"); else - whereClause += " AND "+COLUMNNAME_AD_Role_ID+"=?"; + whereClause.append(" AND ").append(COLUMNNAME_AD_Role_ID).append("=?"); if (AD_User_ID == 0) - whereClause += " AND ("+COLUMNNAME_AD_User_ID+" IS NULL OR "+COLUMNNAME_AD_User_ID+"=?)"; + whereClause.append(" AND (").append(COLUMNNAME_AD_User_ID).append(" IS NULL OR ").append(COLUMNNAME_AD_User_ID).append("=?)"); else - whereClause += " AND "+COLUMNNAME_AD_User_ID+"=?"; + whereClause.append(" AND ").append(COLUMNNAME_AD_User_ID).append("=?"); List parameters = new ArrayList(); parameters.add(isShowInDashboard); parameters.add(AD_Role_ID); parameters.add(AD_User_ID); - return new Query(ctx, Table_Name, whereClause, null) + return new Query(ctx, Table_Name, whereClause.toString(), null) .setParameters(parameters) .setOnlyActiveRecords(true) .setApplyAccessFilter(true, false) @@ -71,23 +71,23 @@ public class MDashboardContent extends X_PA_DashboardContent { Properties ctx = Env.getCtx(); - String whereClause = ""; + StringBuilder whereClause = new StringBuilder(); if (AD_Role_ID == 0) - whereClause += "("+COLUMNNAME_AD_Role_ID+" IS NULL OR "+COLUMNNAME_AD_Role_ID+"=?)"; + whereClause.append("(").append(COLUMNNAME_AD_Role_ID).append(" IS NULL OR ").append(COLUMNNAME_AD_Role_ID).append("=?)"); else - whereClause += COLUMNNAME_AD_Role_ID+"=?"; + whereClause.append(COLUMNNAME_AD_Role_ID).append("=?"); if (AD_User_ID == 0) - whereClause += " AND ("+COLUMNNAME_AD_User_ID+" IS NULL OR "+COLUMNNAME_AD_User_ID+"=?)"; + whereClause.append(" AND (").append(COLUMNNAME_AD_User_ID).append(" IS NULL OR ").append(COLUMNNAME_AD_User_ID).append("=?)"); else - whereClause += " AND "+COLUMNNAME_AD_User_ID+"=?"; + whereClause.append(" AND ").append(COLUMNNAME_AD_User_ID).append("=?"); List parameters = new ArrayList(); parameters.add(AD_Role_ID); parameters.add(AD_User_ID); - return new Query(ctx, Table_Name, whereClause, null) + return new Query(ctx, Table_Name, whereClause.toString(), null) .setParameters(parameters) .setOnlyActiveRecords(true) .setApplyAccessFilter(true, false) diff --git a/org.adempiere.base/src/org/compiere/model/MDashboardPreference.java b/org.adempiere.base/src/org/compiere/model/MDashboardPreference.java index b30ec34909..43bf3725b6 100644 --- a/org.adempiere.base/src/org/compiere/model/MDashboardPreference.java +++ b/org.adempiere.base/src/org/compiere/model/MDashboardPreference.java @@ -49,24 +49,24 @@ public class MDashboardPreference extends X_PA_DashboardPreference { Properties ctx = Env.getCtx(); - String whereClause = COLUMNNAME_IsShowInDashboard+"=?"; + StringBuilder whereClause = new StringBuilder(COLUMNNAME_IsShowInDashboard).append("=?"); if (AD_Role_ID == 0) - whereClause += " AND ("+COLUMNNAME_AD_Role_ID+" IS NULL OR "+COLUMNNAME_AD_Role_ID+"=?)"; + whereClause.append(" AND (").append(COLUMNNAME_AD_Role_ID).append(" IS NULL OR ").append(COLUMNNAME_AD_Role_ID).append("=?)"); else - whereClause += " AND "+COLUMNNAME_AD_Role_ID+"=?"; + whereClause.append(" AND ").append(COLUMNNAME_AD_Role_ID).append("=?"); if (AD_User_ID == 0) - whereClause += " AND ("+COLUMNNAME_AD_User_ID+" IS NULL OR "+COLUMNNAME_AD_User_ID+"=?)"; + whereClause.append(" AND (").append(COLUMNNAME_AD_User_ID).append(" IS NULL OR ").append(COLUMNNAME_AD_User_ID).append("=?)"); else - whereClause += " AND "+COLUMNNAME_AD_User_ID+"=?"; + whereClause.append(" AND ").append(COLUMNNAME_AD_User_ID).append("=?"); List parameters = new ArrayList(); parameters.add(isShowInDashboard); parameters.add(AD_Role_ID); parameters.add(AD_User_ID); - return new Query(ctx, Table_Name, whereClause, null) + return new Query(ctx, Table_Name, whereClause.toString(), null) .setParameters(parameters) .setOnlyActiveRecords(true) .setApplyAccessFilter(true, false) @@ -83,23 +83,23 @@ public class MDashboardPreference extends X_PA_DashboardPreference { Properties ctx = Env.getCtx(); - String whereClause = ""; + StringBuilder whereClause = new StringBuilder(); if (AD_Role_ID == 0) - whereClause += "("+COLUMNNAME_AD_Role_ID+" IS NULL OR "+COLUMNNAME_AD_Role_ID+"=?)"; + whereClause.append("(").append(COLUMNNAME_AD_Role_ID).append(" IS NULL OR ").append(COLUMNNAME_AD_Role_ID).append("=?)"); else - whereClause += COLUMNNAME_AD_Role_ID+"=?"; + whereClause.append(COLUMNNAME_AD_Role_ID).append("=?"); if (AD_User_ID == 0) - whereClause += " AND ("+COLUMNNAME_AD_User_ID+" IS NULL OR "+COLUMNNAME_AD_User_ID+"=?)"; + whereClause.append(" AND (").append(COLUMNNAME_AD_User_ID).append(" IS NULL OR ").append(COLUMNNAME_AD_User_ID).append("=?)"); else - whereClause += " AND "+COLUMNNAME_AD_User_ID+"=?"; + whereClause.append(" AND ").append(COLUMNNAME_AD_User_ID).append("=?"); List parameters = new ArrayList(); parameters.add(AD_Role_ID); parameters.add(AD_User_ID); - return new Query(ctx, Table_Name, whereClause, null) + return new Query(ctx, Table_Name, whereClause.toString(), null) .setParameters(parameters) .setOnlyActiveRecords(true) .setApplyAccessFilter(true, false) diff --git a/org.adempiere.base/src/org/compiere/model/MDepreciationWorkfile.java b/org.adempiere.base/src/org/compiere/model/MDepreciationWorkfile.java index 8fd509f314..774e032ecc 100644 --- a/org.adempiere.base/src/org/compiere/model/MDepreciationWorkfile.java +++ b/org.adempiere.base/src/org/compiere/model/MDepreciationWorkfile.java @@ -63,9 +63,9 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile int p_wkasset_ID = 0; //p_A_Asset_ID = getA_Asset_ID(); p_wkasset_ID = getA_Depreciation_Workfile_ID(); - StringBuffer sqlB = new StringBuffer ("UPDATE A_Depreciation_Workfile " - + "SET Processing = 'Y'" - + " WHERE A_Depreciation_Workfile_ID = " + p_wkasset_ID ); + StringBuilder sqlB = new StringBuilder ("UPDATE A_Depreciation_Workfile ") + .append("SET Processing = 'Y'") + .append(" WHERE A_Depreciation_Workfile_ID = " ).append(p_wkasset_ID ); int no = DB.executeUpdate (sqlB.toString(),null); if (no == -1) diff --git a/org.adempiere.base/src/org/compiere/model/MDesktop.java b/org.adempiere.base/src/org/compiere/model/MDesktop.java index 9482f2e44c..6af38950ad 100644 --- a/org.adempiere.base/src/org/compiere/model/MDesktop.java +++ b/org.adempiere.base/src/org/compiere/model/MDesktop.java @@ -72,22 +72,22 @@ public class MDesktop { AD_Desktop_ID = ad_Desktop_ID; // Get WB info - String sql = null; + StringBuilder sql = null; if (Env.isBaseLanguage(m_ctx, "AD_Desktop")) - sql = "SELECT Name,Description,Help," // 1..3 - + " AD_Column_ID,AD_Image_ID,AD_Color_ID,PA_Goal_ID " // 4..7 - + "FROM AD_Desktop " - + "WHERE AD_Desktop_ID=? AND IsActive='Y'"; + sql = new StringBuilder("SELECT Name,Description,Help,") // 1..3 + .append(" AD_Column_ID,AD_Image_ID,AD_Color_ID,PA_Goal_ID ") // 4..7 + .append("FROM AD_Desktop ") + .append("WHERE AD_Desktop_ID=? AND IsActive='Y'"); else - sql = "SELECT t.Name,t.Description,t.Help," - + " w.AD_Column_ID,w.AD_Image_ID,w.AD_Color_ID,w.PA_Goal_ID " - + "FROM AD_Desktop w, AD_Desktop_Trl t " - + "WHERE w.AD_Desktop_ID=? AND w.IsActive='Y'" - + " AND w.AD_Desktop_ID=t.AD_Desktop_ID" - + " AND t.AD_Language='" + Env.getAD_Language(m_ctx) + "'"; + sql = new StringBuilder("SELECT t.Name,t.Description,t.Help,") + .append(" w.AD_Column_ID,w.AD_Image_ID,w.AD_Color_ID,w.PA_Goal_ID ") + .append("FROM AD_Desktop w, AD_Desktop_Trl t ") + .append("WHERE w.AD_Desktop_ID=? AND w.IsActive='Y'") + .append(" AND w.AD_Desktop_ID=t.AD_Desktop_ID") + .append(" AND t.AD_Language='").append(Env.getAD_Language(m_ctx)).append("'"); try { - PreparedStatement pstmt = DB.prepareStatement(sql, null); + PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null); pstmt.setInt(1, AD_Desktop_ID); ResultSet rs = pstmt.executeQuery(); if (rs.next()) @@ -112,7 +112,7 @@ public class MDesktop } catch (SQLException e) { - log.log(Level.SEVERE, sql, e); + log.log(Level.SEVERE, sql.toString(), e); } if (AD_Desktop_ID == 0) @@ -126,7 +126,8 @@ public class MDesktop */ public String toString() { - return "MDesktop ID=" + AD_Desktop_ID + " " + Name; + StringBuilder msgreturn = new StringBuilder("MDesktop ID=").append(AD_Desktop_ID).append(" ").append(Name); + return msgreturn.toString(); } /************************************************************************** diff --git a/org.adempiere.base/src/org/compiere/model/MDiscountSchemaBreak.java b/org.adempiere.base/src/org/compiere/model/MDiscountSchemaBreak.java index f96e666b2b..de31f034be 100644 --- a/org.adempiere.base/src/org/compiere/model/MDiscountSchemaBreak.java +++ b/org.adempiere.base/src/org/compiere/model/MDiscountSchemaBreak.java @@ -109,7 +109,7 @@ public class MDiscountSchemaBreak extends X_M_DiscountSchemaBreak */ public String toString () { - StringBuffer sb = new StringBuffer ("MDiscountSchemaBreak["); + StringBuilder sb = new StringBuilder ("MDiscountSchemaBreak["); sb.append(get_ID()).append("-Seq=").append(getSeqNo()); if (getM_Product_Category_ID() != 0) sb.append(",M_Product_Category_ID=").append(getM_Product_Category_ID()); diff --git a/org.adempiere.base/src/org/compiere/model/MDistribution.java b/org.adempiere.base/src/org/compiere/model/MDistribution.java index bdd49e0b08..a63fd5c622 100644 --- a/org.adempiere.base/src/org/compiere/model/MDistribution.java +++ b/org.adempiere.base/src/org/compiere/model/MDistribution.java @@ -270,12 +270,12 @@ public class MDistribution extends X_GL_Distribution */ public String validate() { - String retValue = null; + StringBuilder retValue = null; getLines(true); if (m_lines.length == 0) - retValue = "@NoLines@"; + retValue = new StringBuilder("@NoLines@"); else if (getPercentTotal().compareTo(Env.ONEHUNDRED) != 0) - retValue = "@PercentTotal@ <> 100"; + retValue = new StringBuilder("@PercentTotal@ <> 100"); else { // More then one line with 0 @@ -286,8 +286,8 @@ public class MDistribution extends X_GL_Distribution { if (lineFound >= 0 && m_lines[i].getPercent().compareTo(Env.ZERO) == 0) { - retValue = "@Line@ " + lineFound - + " + " + m_lines[i].getLine() + ": == 0"; + retValue = new StringBuilder("@Line@ ").append(lineFound) + .append(" + ").append(m_lines[i].getLine()).append(": == 0"); break; } lineFound = m_lines[i].getLine(); @@ -296,7 +296,7 @@ public class MDistribution extends X_GL_Distribution } setIsValid (retValue == null); - return retValue; + return retValue.toString(); } // validate diff --git a/org.adempiere.base/src/org/compiere/model/MDistributionRunDetail.java b/org.adempiere.base/src/org/compiere/model/MDistributionRunDetail.java index 7c5e684681..d730ddcb8a 100644 --- a/org.adempiere.base/src/org/compiere/model/MDistributionRunDetail.java +++ b/org.adempiere.base/src/org/compiere/model/MDistributionRunDetail.java @@ -52,15 +52,15 @@ public class MDistributionRunDetail extends X_T_DistributionRunDetail boolean orderBP, String trxName) { ArrayList list = new ArrayList(); - String sql = "SELECT * FROM T_DistributionRunDetail WHERE M_DistributionRun_ID=? "; + StringBuilder sql = new StringBuilder("SELECT * FROM T_DistributionRunDetail WHERE M_DistributionRun_ID=? "); if (orderBP) - sql += "ORDER BY C_BPartner_ID, C_BPartner_Location_ID"; + sql.append("ORDER BY C_BPartner_ID, C_BPartner_Location_ID"); else - sql += "ORDER BY M_DistributionRunLine_ID"; + sql.append("ORDER BY M_DistributionRunLine_ID"); PreparedStatement pstmt = null; try { - pstmt = DB.prepareStatement (sql, trxName); + pstmt = DB.prepareStatement (sql.toString(), trxName); pstmt.setInt (1, M_DistributionRun_ID); ResultSet rs = pstmt.executeQuery (); while (rs.next ()) @@ -71,7 +71,7 @@ public class MDistributionRunDetail extends X_T_DistributionRunDetail } catch (Exception e) { - s_log.log(Level.SEVERE, sql, e); + s_log.log(Level.SEVERE, sql.toString(), e); } try { @@ -191,7 +191,7 @@ public class MDistributionRunDetail extends X_T_DistributionRunDetail */ public String toString () { - StringBuffer sb = new StringBuffer ("MDistributionRunDetail[") + StringBuilder sb = new StringBuilder ("MDistributionRunDetail[") .append (get_ID ()) .append (";M_DistributionListLine_ID=").append (getM_DistributionListLine_ID()) .append(";Qty=").append(getQty()) diff --git a/org.adempiere.base/src/org/compiere/model/MDistributionRunLine.java b/org.adempiere.base/src/org/compiere/model/MDistributionRunLine.java index 48f0fb94e0..e5baa1c3da 100644 --- a/org.adempiere.base/src/org/compiere/model/MDistributionRunLine.java +++ b/org.adempiere.base/src/org/compiere/model/MDistributionRunLine.java @@ -235,7 +235,7 @@ public class MDistributionRunLine extends X_M_DistributionRunLine */ public String toString () { - StringBuffer sb = new StringBuffer ("MDistributionRunLine[") + StringBuilder sb = new StringBuilder ("MDistributionRunLine[") .append(get_ID()).append("-") .append(getInfo()) .append ("]"); @@ -248,7 +248,7 @@ public class MDistributionRunLine extends X_M_DistributionRunLine */ public String getInfo() { - StringBuffer sb = new StringBuffer (); + StringBuilder sb = new StringBuilder (); sb.append("Line=").append(getLine()) .append (",TotalQty=").append(getTotalQty()) .append(",SumMin=").append(getActualMin()) diff --git a/org.adempiere.base/src/org/compiere/model/MDocType.java b/org.adempiere.base/src/org/compiere/model/MDocType.java index b6ce65abbb..ff2185b82d 100644 --- a/org.adempiere.base/src/org/compiere/model/MDocType.java +++ b/org.adempiere.base/src/org/compiere/model/MDocType.java @@ -192,7 +192,7 @@ public class MDocType extends X_C_DocType */ public String toString() { - StringBuffer sb = new StringBuffer("MDocType["); + StringBuilder sb = new StringBuilder("MDocType["); sb.append(get_ID()).append("-").append(getName()) .append(",DocNoSequence_ID=").append(getDocNoSequence_ID()) .append("]"); @@ -266,23 +266,23 @@ public class MDocType extends X_C_DocType if (newRecord && success) { // Add doctype/docaction access to all roles of client - String sqlDocAction = "INSERT INTO AD_Document_Action_Access " - + "(AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy," - + "C_DocType_ID , AD_Ref_List_ID, AD_Role_ID) " - + "(SELECT " - + getAD_Client_ID() + ",0,'Y', SysDate," - + getUpdatedBy() + ", SysDate," + getUpdatedBy() - + ", doctype.C_DocType_ID, action.AD_Ref_List_ID, rol.AD_Role_ID " - + "FROM AD_Client client " - + "INNER JOIN C_DocType doctype ON (doctype.AD_Client_ID=client.AD_Client_ID) " - + "INNER JOIN AD_Ref_List action ON (action.AD_Reference_ID=135) " - + "INNER JOIN AD_Role rol ON (rol.AD_Client_ID=client.AD_Client_ID) " - + "WHERE client.AD_Client_ID=" + getAD_Client_ID() - + " AND doctype.C_DocType_ID=" + get_ID() - + " AND rol.IsManual='N'" - + ")"; + StringBuilder sqlDocAction = new StringBuilder("INSERT INTO AD_Document_Action_Access ") + .append("(AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,") + .append("C_DocType_ID , AD_Ref_List_ID, AD_Role_ID) ") + .append("(SELECT ") + .append(getAD_Client_ID()).append(",0,'Y', SysDate,") + .append(getUpdatedBy()).append(", SysDate,").append(getUpdatedBy()) + .append(", doctype.C_DocType_ID, action.AD_Ref_List_ID, rol.AD_Role_ID ") + .append("FROM AD_Client client ") + .append("INNER JOIN C_DocType doctype ON (doctype.AD_Client_ID=client.AD_Client_ID) ") + .append("INNER JOIN AD_Ref_List action ON (action.AD_Reference_ID=135) ") + .append("INNER JOIN AD_Role rol ON (rol.AD_Client_ID=client.AD_Client_ID) ") + .append("WHERE client.AD_Client_ID=").append(getAD_Client_ID()) + .append(" AND doctype.C_DocType_ID=").append(get_ID()) + .append(" AND rol.IsManual='N'") + .append(")"); - int docact = DB.executeUpdate(sqlDocAction, get_TrxName()); + int docact = DB.executeUpdate(sqlDocAction.toString(), get_TrxName()); log.fine("AD_Document_Action_Access=" + docact); } return success; @@ -296,7 +296,8 @@ public class MDocType extends X_C_DocType protected boolean beforeDelete () { // delete access records - int docactDel = DB.executeUpdate("DELETE FROM AD_Document_Action_Access WHERE C_DocType_ID=" + get_ID(), get_TrxName()); + StringBuilder msgdb = new StringBuilder("DELETE FROM AD_Document_Action_Access WHERE C_DocType_ID=").append(get_ID()); + int docactDel = DB.executeUpdate(msgdb.toString(), get_TrxName()); log.fine("Delete AD_Document_Action_Access=" + docactDel + " for C_DocType_ID: " + get_ID()); return docactDel >= 0; } // beforeDelete @@ -334,7 +335,7 @@ public class MDocType extends X_C_DocType if (relatedDocTypeName != null) { - StringBuffer whereClause = new StringBuffer(30); + StringBuilder whereClause = new StringBuilder(30); whereClause.append("Name='").append(relatedDocTypeName).append("' "); whereClause.append("and AD_Client_ID=").append(Env.getAD_Client_ID(Env.getCtx())); whereClause.append(" AND IsActive='Y'"); diff --git a/org.adempiere.base/src/org/compiere/model/MDocTypeCounter.java b/org.adempiere.base/src/org/compiere/model/MDocTypeCounter.java index 0a283bcf0e..623760cdc2 100644 --- a/org.adempiere.base/src/org/compiere/model/MDocTypeCounter.java +++ b/org.adempiere.base/src/org/compiere/model/MDocTypeCounter.java @@ -354,7 +354,7 @@ public class MDocTypeCounter extends X_C_DocTypeCounter */ public String toString () { - StringBuffer sb = new StringBuffer ("MDocTypeCounter["); + StringBuilder sb = new StringBuilder ("MDocTypeCounter["); sb.append(get_ID()).append(",").append(getName()) .append(",C_DocType_ID=").append(getC_DocType_ID()) .append(",Counter=").append(getCounter_C_DocType_ID()) diff --git a/org.adempiere.base/src/org/compiere/model/MDunning.java b/org.adempiere.base/src/org/compiere/model/MDunning.java index 41c580fcb0..848550765b 100644 --- a/org.adempiere.base/src/org/compiere/model/MDunning.java +++ b/org.adempiere.base/src/org/compiere/model/MDunning.java @@ -63,7 +63,7 @@ public class MDunning extends X_C_Dunning @Override public String toString() { - StringBuffer sb = new StringBuffer("MDunning[").append(get_ID()) + StringBuilder sb = new StringBuilder("MDunning[").append(get_ID()) .append("-").append(getName()); sb.append("]"); return sb.toString(); diff --git a/org.adempiere.base/src/org/compiere/model/MDunningRunEntry.java b/org.adempiere.base/src/org/compiere/model/MDunningRunEntry.java index 8346b873e9..b531d61321 100644 --- a/org.adempiere.base/src/org/compiere/model/MDunningRunEntry.java +++ b/org.adempiere.base/src/org/compiere/model/MDunningRunEntry.java @@ -145,13 +145,13 @@ public class MDunningRunEntry extends X_C_DunningRunEntry } else if (firstActive != null) { - String msg = "@C_BPartner_ID@ " + bp.getName(); + StringBuilder msg = new StringBuilder("@C_BPartner_ID@ ").append(bp.getName()); if (isSOTrx) - msg += " @No@ @IsPayFrom@"; + msg.append(" @No@ @IsPayFrom@"); else - msg += " @No@ @IsRemitTo@"; - msg += " & @IsBillTo@"; - log.info(msg); + msg.append(" @No@ @IsRemitTo@"); + msg.append(" & @IsBillTo@"); + log.info(msg.toString()); setC_BPartner_Location_ID (firstActive.getC_BPartner_Location_ID()); } } @@ -199,13 +199,13 @@ public class MDunningRunEntry extends X_C_DunningRunEntry public MDunningRunLine[] getLines (boolean onlyInvoices) { ArrayList list = new ArrayList(); - String sql = "SELECT * FROM C_DunningRunLine WHERE C_DunningRunEntry_ID=?"; + StringBuilder sql = new StringBuilder("SELECT * FROM C_DunningRunLine WHERE C_DunningRunEntry_ID=?"); if (onlyInvoices) - sql += " AND C_Invoice_ID IS NOT NULL"; + sql.append(" AND C_Invoice_ID IS NOT NULL"); PreparedStatement pstmt = null; try { - pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt = DB.prepareStatement(sql.toString(), get_TrxName()); pstmt.setInt(1, get_ID ()); ResultSet rs = pstmt.executeQuery(); while (rs.next()) @@ -216,7 +216,7 @@ public class MDunningRunEntry extends X_C_DunningRunEntry } catch (Exception e) { - s_log.log(Level.SEVERE, sql, e); + s_log.log(Level.SEVERE, sql.toString(), e); } try { diff --git a/org.adempiere.base/src/org/compiere/model/MDunningRunLine.java b/org.adempiere.base/src/org/compiere/model/MDunningRunLine.java index d274e9c838..756fbfbf1a 100644 --- a/org.adempiere.base/src/org/compiere/model/MDunningRunLine.java +++ b/org.adempiere.base/src/org/compiere/model/MDunningRunLine.java @@ -340,17 +340,17 @@ public class MDunningRunLine extends X_C_DunningRunLine private void updateEntry() { // we do not count the fee line as an item, but it sum it up. - String sql = "UPDATE C_DunningRunEntry e " - + "SET Amt=NVL((SELECT SUM(ConvertedAmt)+SUM(FeeAmt)+SUM(InterestAmt)" - + " FROM C_DunningRunLine l " - + "WHERE e.C_DunningRunEntry_ID=l.C_DunningRunEntry_ID), 0), " - + "QTY=(SELECT COUNT(*)" - + " FROM C_DunningRunLine l " - + "WHERE e.C_DunningRunEntry_ID=l.C_DunningRunEntry_ID " - + " AND (NOT C_Invoice_ID IS NULL OR NOT C_Payment_ID IS NULL))" - + " WHERE C_DunningRunEntry_ID=" + getC_DunningRunEntry_ID(); + StringBuilder sql = new StringBuilder("UPDATE C_DunningRunEntry e ") + .append("SET Amt=NVL((SELECT SUM(ConvertedAmt)+SUM(FeeAmt)+SUM(InterestAmt)") + .append(" FROM C_DunningRunLine l ") + .append("WHERE e.C_DunningRunEntry_ID=l.C_DunningRunEntry_ID), 0), ") + .append("QTY=(SELECT COUNT(*)") + .append(" FROM C_DunningRunLine l ") + .append("WHERE e.C_DunningRunEntry_ID=l.C_DunningRunEntry_ID ") + .append(" AND (NOT C_Invoice_ID IS NULL OR NOT C_Payment_ID IS NULL))") + .append(" WHERE C_DunningRunEntry_ID=").append(getC_DunningRunEntry_ID()); - DB.executeUpdate(sql, get_TrxName()); + DB.executeUpdate(sql.toString(), get_TrxName()); } // updateEntry } // MDunningRunLine diff --git a/org.adempiere.base/src/org/compiere/model/MEXPFormat.java b/org.adempiere.base/src/org/compiere/model/MEXPFormat.java index aa0e3b2d1d..9c19dbc9d7 100644 --- a/org.adempiere.base/src/org/compiere/model/MEXPFormat.java +++ b/org.adempiere.base/src/org/compiere/model/MEXPFormat.java @@ -131,7 +131,7 @@ public class MEXPFormat extends X_EXP_Format { if(retValue!=null) return retValue; - StringBuffer whereClause = new StringBuffer(X_EXP_Format.COLUMNNAME_Value).append("=?") + StringBuilder whereClause = new StringBuilder(X_EXP_Format.COLUMNNAME_Value).append("=?") .append(" AND AD_Client_ID = ?") .append(" AND ").append(X_EXP_Format.COLUMNNAME_Version).append(" = ?"); @@ -157,7 +157,7 @@ public class MEXPFormat extends X_EXP_Format { if(retValue!=null) return retValue; - StringBuffer whereClause = new StringBuffer(" AD_Client_ID = ? ") + StringBuilder whereClause = new StringBuilder(" AD_Client_ID = ? ") .append(" AND ").append(X_EXP_Format.COLUMNNAME_AD_Table_ID).append(" = ? ") .append(" AND ").append(X_EXP_Format.COLUMNNAME_Version).append(" = ?"); @@ -176,7 +176,7 @@ public class MEXPFormat extends X_EXP_Format { @Override public String toString() { - StringBuffer sb = new StringBuffer ("X_EXP_Format[ID=").append(get_ID()).append("; Value = "+getValue()+"]"); + StringBuilder sb = new StringBuilder ("X_EXP_Format[ID=").append(get_ID()).append("; Value = ").append(getValue()).append("]"); return sb.toString(); } diff --git a/org.adempiere.base/src/org/compiere/model/MEXPFormatLine.java b/org.adempiere.base/src/org/compiere/model/MEXPFormatLine.java index 6b1115675e..2ceb8632ce 100644 --- a/org.adempiere.base/src/org/compiere/model/MEXPFormatLine.java +++ b/org.adempiere.base/src/org/compiere/model/MEXPFormatLine.java @@ -61,7 +61,7 @@ public class MEXPFormatLine extends X_EXP_FormatLine { @Override public String toString() { - StringBuffer sb = new StringBuffer ("X_EXP_FormatLine[ID=").append(get_ID()).append("; Value="+getValue()+"; Type="+getType()+"]"); + StringBuilder sb = new StringBuilder ("X_EXP_FormatLine[ID=").append(get_ID()).append("; Value=").append(getValue()).append("; Type=").append(getType()).append("]"); return sb.toString(); } @@ -70,7 +70,7 @@ public class MEXPFormatLine extends X_EXP_FormatLine { { MEXPFormatLine result = null; - StringBuffer sql = new StringBuffer("SELECT * ") + StringBuilder sql = new StringBuilder("SELECT * ") .append(" FROM ").append(X_EXP_FormatLine.Table_Name) .append(" WHERE ").append(X_EXP_Format.COLUMNNAME_Value).append("=?") //.append(" AND IsActive = ?") diff --git a/org.adempiere.base/src/org/compiere/model/MEXPProcessor.java b/org.adempiere.base/src/org/compiere/model/MEXPProcessor.java index f1aea22235..b2d69b69c2 100644 --- a/org.adempiere.base/src/org/compiere/model/MEXPProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/MEXPProcessor.java @@ -78,7 +78,7 @@ public class MEXPProcessor extends X_EXP_Processor { List resultList = new ArrayList(); - StringBuffer sql = new StringBuffer("SELECT * ") + StringBuilder sql = new StringBuilder("SELECT * ") .append(" FROM ").append(X_EXP_ProcessorParameter.Table_Name) .append(" WHERE ").append(X_EXP_ProcessorParameter.COLUMNNAME_EXP_Processor_ID).append("=?") // # 1 .append(" AND IsActive = ?") // # 2 diff --git a/org.adempiere.base/src/org/compiere/model/MElementValue.java b/org.adempiere.base/src/org/compiere/model/MElementValue.java index 767f86bb3f..1ad8f7b486 100644 --- a/org.adempiere.base/src/org/compiere/model/MElementValue.java +++ b/org.adempiere.base/src/org/compiere/model/MElementValue.java @@ -183,7 +183,7 @@ public class MElementValue extends X_C_ElementValue */ public String toString () { - StringBuffer sb = new StringBuffer (); + StringBuilder sb = new StringBuilder(); sb.append(getValue()).append(" - ").append(getName()); return sb.toString (); } // toString @@ -194,7 +194,7 @@ public class MElementValue extends X_C_ElementValue */ public String toStringX () { - StringBuffer sb = new StringBuffer ("MElementValue["); + StringBuilder sb = new StringBuilder ("MElementValue["); sb.append(get_ID()).append(",").append(getValue()).append(" - ").append(getName()) .append ("]"); return sb.toString (); diff --git a/org.adempiere.base/src/org/compiere/model/MExpenseType.java b/org.adempiere.base/src/org/compiere/model/MExpenseType.java index 5d915e03d3..f774dd1be6 100644 --- a/org.adempiere.base/src/org/compiere/model/MExpenseType.java +++ b/org.adempiere.base/src/org/compiere/model/MExpenseType.java @@ -67,7 +67,8 @@ public class MExpenseType extends X_S_ExpenseType { if (m_product == null) { - MProduct[] products = MProduct.get(getCtx(), "S_ExpenseType_ID=" + getS_ExpenseType_ID(), get_TrxName()); + StringBuilder msgmp = new StringBuilder("S_ExpenseType_ID=").append(getS_ExpenseType_ID()); + MProduct[] products = MProduct.get(getCtx(), msgmp.toString(), get_TrxName()); if (products.length > 0) m_product = products[0]; } diff --git a/org.adempiere.base/src/org/compiere/model/MFactAcct.java b/org.adempiere.base/src/org/compiere/model/MFactAcct.java index 91629d3ba3..9fa427a221 100644 --- a/org.adempiere.base/src/org/compiere/model/MFactAcct.java +++ b/org.adempiere.base/src/org/compiere/model/MFactAcct.java @@ -110,7 +110,7 @@ public class MFactAcct extends X_Fact_Acct */ public String toString () { - StringBuffer sb = new StringBuffer ("MFactAcct["); + StringBuilder sb = new StringBuilder ("MFactAcct["); sb.append(get_ID()).append("-Acct=").append(getAccount_ID()) .append(",Dr=").append(getAmtSourceDr()).append("|").append(getAmtAcctDr()) .append(",Cr=").append(getAmtSourceCr()).append("|").append(getAmtAcctCr()) diff --git a/org.adempiere.base/src/org/compiere/model/MGLCategory.java b/org.adempiere.base/src/org/compiere/model/MGLCategory.java index 351ff5a2d1..87cf2bbc93 100644 --- a/org.adempiere.base/src/org/compiere/model/MGLCategory.java +++ b/org.adempiere.base/src/org/compiere/model/MGLCategory.java @@ -167,11 +167,12 @@ public class MGLCategory extends X_GL_Category @Override public String toString() { - return getClass().getSimpleName()+"["+get_ID() - +", Name="+getName() - +", IsDefault="+isDefault() - +", IsActive="+isActive() - +", CategoryType="+getCategoryType() - +"]"; + StringBuilder msgreturn = new StringBuilder(getClass().getSimpleName()).append("[").append(get_ID()) + .append(", Name=").append(getName()) + .append(", IsDefault=").append(isDefault()) + .append(", IsActive=").append(isActive()) + .append(", CategoryType=").append(getCategoryType()) + .append("]"); + return msgreturn.toString(); } } // MGLCategory diff --git a/org.adempiere.base/src/org/compiere/model/MGoal.java b/org.adempiere.base/src/org/compiere/model/MGoal.java index 6778d211a5..db6abad1b0 100644 --- a/org.adempiere.base/src/org/compiere/model/MGoal.java +++ b/org.adempiere.base/src/org/compiere/model/MGoal.java @@ -511,7 +511,7 @@ public class MGoal extends X_PA_Goal */ public String toString () { - StringBuffer sb = new StringBuffer ("MGoal["); + StringBuilder sb = new StringBuilder ("MGoal["); sb.append (get_ID ()) .append ("-").append (getName()) .append(",").append(getGoalPerformance()) diff --git a/org.adempiere.base/src/org/compiere/model/MGoalRestriction.java b/org.adempiere.base/src/org/compiere/model/MGoalRestriction.java index 4ed7c9725d..a3a7ef9618 100644 --- a/org.adempiere.base/src/org/compiere/model/MGoalRestriction.java +++ b/org.adempiere.base/src/org/compiere/model/MGoalRestriction.java @@ -63,7 +63,7 @@ public class MGoalRestriction extends X_PA_GoalRestriction */ public String toString () { - StringBuffer sb = new StringBuffer ("MGoalRestriction["); + StringBuilder sb = new StringBuilder ("MGoalRestriction["); sb.append (get_ID()).append ("-").append (getName()).append ("]"); return sb.toString (); } // toString diff --git a/org.adempiere.base/src/org/compiere/model/MIMPProcessor.java b/org.adempiere.base/src/org/compiere/model/MIMPProcessor.java index 8e84d4842d..7e33c21f5e 100644 --- a/org.adempiere.base/src/org/compiere/model/MIMPProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/MIMPProcessor.java @@ -134,21 +134,22 @@ public class MIMPProcessor { if (getKeepLogDays() < 1) return 0; - String sql = "DELETE " + X_IMP_ProcessorLog.Table_Name + " " - + "WHERE "+X_IMP_ProcessorLog.COLUMNNAME_IMP_Processor_ID+"=" + getIMP_Processor_ID() - + " AND (Created+" + getKeepLogDays() + ") < SysDate"; - int no = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("DELETE ").append(X_IMP_ProcessorLog.Table_Name).append(" ") + .append("WHERE ").append(X_IMP_ProcessorLog.COLUMNNAME_IMP_Processor_ID).append("=").append(getIMP_Processor_ID()) + .append(" AND (Created+").append(getKeepLogDays()).append(") < SysDate"); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); return no; } public String getServerID() { - return "ReplicationProcessor" + get_ID(); + StringBuilder msgreturn = new StringBuilder("ReplicationProcessor").append(get_ID()); + return msgreturn.toString(); } public X_IMP_ProcessorParameter[] getIMP_ProcessorParameters(String trxName) { List resultList = new ArrayList(); - StringBuffer sql = new StringBuffer("SELECT * ") + StringBuilder sql = new StringBuilder("SELECT * ") .append(" FROM ").append(X_IMP_ProcessorParameter.Table_Name) .append(" WHERE ").append(X_IMP_ProcessorParameter.COLUMNNAME_IMP_Processor_ID).append("=?") // # 1 .append(" AND IsActive = ?") // # 2 diff --git a/org.adempiere.base/src/org/compiere/model/MImage.java b/org.adempiere.base/src/org/compiere/model/MImage.java index 56970a2d8c..918e92a8d5 100644 --- a/org.adempiere.base/src/org/compiere/model/MImage.java +++ b/org.adempiere.base/src/org/compiere/model/MImage.java @@ -290,7 +290,8 @@ public class MImage extends X_AD_Image */ public String toString() { - return "MImage[ID=" + get_ID() + ",Name=" + getName() + "]"; + StringBuilder msgreturn = new StringBuilder("MImage[ID=").append(get_ID()).append(",Name=").append(getName()).append("]"); + return msgreturn.toString(); } // toString diff --git a/org.adempiere.base/src/org/compiere/model/MInOut.java b/org.adempiere.base/src/org/compiere/model/MInOut.java index 6d28cfe442..77c39ee3fe 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOut.java +++ b/org.adempiere.base/src/org/compiere/model/MInOut.java @@ -564,8 +564,10 @@ public class MInOut extends X_M_InOut implements DocAction String desc = getDescription(); if (desc == null) setDescription(description); - else - setDescription(desc + " | " + description); + else{ + StringBuilder msgsd = new StringBuilder(desc).append(" | ").append(description); + setDescription(msgsd.toString()); + } } // addDescription /** @@ -574,7 +576,7 @@ public class MInOut extends X_M_InOut implements DocAction */ public String toString () { - StringBuffer sb = new StringBuffer ("MInOut[") + StringBuilder sb = new StringBuilder ("MInOut[") .append (get_ID()).append("-").append(getDocumentNo()) .append(",DocStatus=").append(getDocStatus()) .append ("]"); @@ -588,7 +590,8 @@ public class MInOut extends X_M_InOut implements DocAction public String getDocumentInfo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); - return dt.getName() + " " + getDocumentNo(); + StringBuilder msgreturn = new StringBuilder(dt.getName()).append(" ").append(getDocumentNo()); + return msgreturn.toString(); } // getDocumentInfo /** @@ -599,7 +602,8 @@ public class MInOut extends X_M_InOut implements DocAction { try { - File temp = File.createTempFile(get_TableName()+get_ID()+"_", ".pdf"); + StringBuilder msgfile = new StringBuilder(get_TableName()).append(get_ID()).append("_"); + File temp = File.createTempFile(msgfile.toString(), ".pdf"); return createPDF (temp); } catch (Exception e) @@ -801,10 +805,10 @@ public class MInOut extends X_M_InOut implements DocAction super.setProcessed (processed); if (get_ID() == 0) return; - String sql = "UPDATE M_InOutLine SET Processed='" - + (processed ? "Y" : "N") - + "' WHERE M_InOut_ID=" + getM_InOut_ID(); - int noLine = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("UPDATE M_InOutLine SET Processed='") + .append((processed ? "Y" : "N")) + .append("' WHERE M_InOut_ID=").append(getM_InOut_ID()); + int noLine = DB.executeUpdate(sql.toString(), get_TrxName()); m_lines = null; log.fine(processed + " - Lines=" + noLine); } // setProcessed @@ -1045,12 +1049,12 @@ public class MInOut extends X_M_InOut implements DocAction if (is_ValueChanged("AD_Org_ID")) { - String sql = "UPDATE M_InOutLine ol" - + " SET AD_Org_ID =" - + "(SELECT AD_Org_ID" - + " FROM M_InOut o WHERE ol.M_InOut_ID=o.M_InOut_ID) " - + "WHERE M_InOut_ID=" + getC_Order_ID(); - int no = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("UPDATE M_InOutLine ol") + .append(" SET AD_Org_ID =") + .append("(SELECT AD_Org_ID") + .append(" FROM M_InOut o WHERE ol.M_InOut_ID=o.M_InOut_ID) ") + .append("WHERE M_InOut_ID=").append(getC_Order_ID()); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Lines -> #" + no); } return true; @@ -1070,7 +1074,7 @@ public class MInOut extends X_M_InOut implements DocAction } // process /** Process Message */ - private String m_processMsg = null; + private StringBuffer m_processMsg = null; /** Just Prepared Flag */ private boolean m_justPrepared = false; @@ -1103,7 +1107,7 @@ public class MInOut extends X_M_InOut implements DocAction public String prepareIt() { log.info(toString()); - m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE)); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -1112,13 +1116,13 @@ public class MInOut extends X_M_InOut implements DocAction // Order OR RMA can be processed on a shipment/receipt if (getC_Order_ID() != 0 && getM_RMA_ID() != 0) { - m_processMsg = "@OrderOrRMA@"; + m_processMsg = new StringBuffer("@OrderOrRMA@"); return DocAction.STATUS_Invalid; } // Std Period open? if (!MPeriod.isOpen(getCtx(), getDateAcct(), dt.getDocBaseType(), getAD_Org_ID())) { - m_processMsg = "@PeriodClosed@"; + m_processMsg = new StringBuffer("@PeriodClosed@"); return DocAction.STATUS_Invalid; } @@ -1133,24 +1137,24 @@ public class MInOut extends X_M_InOut implements DocAction MBPartner bp = new MBPartner (getCtx(), getC_BPartner_ID(), get_TrxName()); if (MBPartner.SOCREDITSTATUS_CreditStop.equals(bp.getSOCreditStatus())) { - m_processMsg = "@BPartnerCreditStop@ - @TotalOpenBalance@=" - + bp.getTotalOpenBalance() - + ", @SO_CreditLimit@=" + bp.getSO_CreditLimit(); + m_processMsg = new StringBuffer("@BPartnerCreditStop@ - @TotalOpenBalance@=") + .append(bp.getTotalOpenBalance()) + .append(", @SO_CreditLimit@=").append(bp.getSO_CreditLimit()); return DocAction.STATUS_Invalid; } if (MBPartner.SOCREDITSTATUS_CreditHold.equals(bp.getSOCreditStatus())) { - m_processMsg = "@BPartnerCreditHold@ - @TotalOpenBalance@=" - + bp.getTotalOpenBalance() - + ", @SO_CreditLimit@=" + bp.getSO_CreditLimit(); + m_processMsg = new StringBuffer("@BPartnerCreditHold@ - @TotalOpenBalance@=") + .append(bp.getTotalOpenBalance()) + .append(", @SO_CreditLimit@=").append(bp.getSO_CreditLimit()); return DocAction.STATUS_Invalid; } BigDecimal notInvoicedAmt = MBPartner.getNotInvoicedAmt(getC_BPartner_ID()); if (MBPartner.SOCREDITSTATUS_CreditHold.equals(bp.getSOCreditStatus(notInvoicedAmt))) { - m_processMsg = "@BPartnerOverSCreditHold@ - @TotalOpenBalance@=" - + bp.getTotalOpenBalance() + ", @NotInvoicedAmt@=" + notInvoicedAmt - + ", @SO_CreditLimit@=" + bp.getSO_CreditLimit(); + m_processMsg = new StringBuffer("@BPartnerOverSCreditHold@ - @TotalOpenBalance@=") + .append(bp.getTotalOpenBalance()).append(", @NotInvoicedAmt@=").append(notInvoicedAmt) + .append(", @SO_CreditLimit@=").append(bp.getSO_CreditLimit()); return DocAction.STATUS_Invalid; } } @@ -1160,7 +1164,7 @@ public class MInOut extends X_M_InOut implements DocAction MInOutLine[] lines = getLines(true); if (lines == null || lines.length == 0) { - m_processMsg = "@NoLines@"; + m_processMsg = new StringBuffer("@NoLines@"); return DocAction.STATUS_Invalid; } BigDecimal Volume = Env.ZERO; @@ -1181,8 +1185,8 @@ public class MInOut extends X_M_InOut implements DocAction continue; if (product != null && product.isASIMandatory(isSOTrx())) { - m_processMsg = "@M_AttributeSet_ID@ @IsMandatory@ (@Line@ #" + lines[i].getLine() + - ", @M_Product_ID@=" + product.getValue() + ")"; + m_processMsg = new StringBuffer("@M_AttributeSet_ID@ @IsMandatory@ (@Line@ #").append(lines[i].getLine()) + .append(", @M_Product_ID@=").append(product.getValue()).append(")"); return DocAction.STATUS_Invalid; } } @@ -1194,7 +1198,7 @@ public class MInOut extends X_M_InOut implements DocAction createConfirmation(); } - m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE)); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -1240,7 +1244,7 @@ public class MInOut extends X_M_InOut implements DocAction return status; } - m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE)); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -1254,8 +1258,8 @@ public class MInOut extends X_M_InOut implements DocAction if (MInOutConfirm.CONFIRMTYPE_CustomerConfirmation.equals(confirm.getConfirmType())) continue; // - m_processMsg = "Open @M_InOutConfirm_ID@: " + - confirm.getConfirmTypeName() + " - " + confirm.getDocumentNo(); + m_processMsg = new StringBuffer("Open @M_InOutConfirm_ID@: ") + .append(confirm.getConfirmTypeName()).append(" - ").append(confirm.getDocumentNo()); return DocAction.STATUS_InProgress; } } @@ -1265,7 +1269,7 @@ public class MInOut extends X_M_InOut implements DocAction if (!isApproved()) approveIt(); log.info(toString()); - StringBuffer info = new StringBuffer(); + StringBuilder info = new StringBuilder(); // For all lines MInOutLine[] lines = getLines(false); @@ -1359,7 +1363,7 @@ public class MInOut extends X_M_InOut implements DocAction get_TrxName())) { String lastError = CLogger.retrieveErrorString(""); - m_processMsg = "Cannot correct Inventory (MA) - " + lastError; + m_processMsg = new StringBuffer("Cannot correct Inventory (MA) - ").append(lastError); return DocAction.STATUS_Invalid; } if (!sameWarehouse) { @@ -1371,7 +1375,7 @@ public class MInOut extends X_M_InOut implements DocAction ma.getM_AttributeSetInstance_ID(), reservationAttributeSetInstance_ID, Env.ZERO, reservedDiff, orderedDiff, get_TrxName())) { - m_processMsg = "Cannot correct Inventory (MA) in order warehouse"; + m_processMsg = new StringBuffer("Cannot correct Inventory (MA) in order warehouse"); return DocAction.STATUS_Invalid; } } @@ -1383,7 +1387,7 @@ public class MInOut extends X_M_InOut implements DocAction mtrx.setM_InOutLine_ID(sLine.getM_InOutLine_ID()); if (!mtrx.save()) { - m_processMsg = "Could not create Material Transaction (MA)"; + m_processMsg = new StringBuffer("Could not create Material Transaction (MA)"); return DocAction.STATUS_Invalid; } } @@ -1401,7 +1405,7 @@ public class MInOut extends X_M_InOut implements DocAction sLine.getM_AttributeSetInstance_ID(), reservationAttributeSetInstance_ID, Qty, reservedDiff, orderedDiff, get_TrxName())) { - m_processMsg = "Cannot correct Inventory"; + m_processMsg = new StringBuffer("Cannot correct Inventory"); return DocAction.STATUS_Invalid; } if (!sameWarehouse) { @@ -1413,7 +1417,7 @@ public class MInOut extends X_M_InOut implements DocAction sLine.getM_AttributeSetInstance_ID(), reservationAttributeSetInstance_ID, Env.ZERO, QtySO.negate(), QtyPO.negate(), get_TrxName())) { - m_processMsg = "Cannot correct Inventory"; + m_processMsg = new StringBuffer("Cannot correct Inventory"); return DocAction.STATUS_Invalid; } } @@ -1425,7 +1429,7 @@ public class MInOut extends X_M_InOut implements DocAction mtrx.setM_InOutLine_ID(sLine.getM_InOutLine_ID()); if (!mtrx.save()) { - m_processMsg = CLogger.retrieveErrorString("Could not create Material Transaction"); + m_processMsg = new StringBuffer(CLogger.retrieveErrorString("Could not create Material Transaction")); return DocAction.STATUS_Invalid; } } @@ -1449,7 +1453,7 @@ public class MInOut extends X_M_InOut implements DocAction } if (!oLine.save()) { - m_processMsg = "Could not update Order Line"; + m_processMsg = new StringBuffer("Could not update Order Line"); return DocAction.STATUS_Invalid; } else @@ -1469,7 +1473,7 @@ public class MInOut extends X_M_InOut implements DocAction } if (!rmaLine.save()) { - m_processMsg = "Could not update RMA Line"; + m_processMsg = new StringBuffer("Could not update RMA Line"); return DocAction.STATUS_Invalid; } } @@ -1496,7 +1500,7 @@ public class MInOut extends X_M_InOut implements DocAction MAsset asset = new MAsset (this, sLine, deliveryCount); if (!asset.save(get_TrxName())) { - m_processMsg = "Could not create Asset"; + m_processMsg = new StringBuffer("Could not create Asset"); return DocAction.STATUS_Invalid; } info.append(asset.getValue()); @@ -1533,7 +1537,7 @@ public class MInOut extends X_M_InOut implements DocAction isNewMatchInv = true; if (!inv.save(get_TrxName())) { - m_processMsg = CLogger.retrieveErrorString("Could not create Inv Matching"); + m_processMsg = new StringBuffer(CLogger.retrieveErrorString("Could not create Inv Matching")); return DocAction.STATUS_Invalid; } if (isNewMatchInv) @@ -1552,7 +1556,7 @@ public class MInOut extends X_M_InOut implements DocAction isNewMatchPO = true; if (!po.save(get_TrxName())) { - m_processMsg = "Could not create PO Matching"; + m_processMsg = new StringBuffer("Could not create PO Matching"); return DocAction.STATUS_Invalid; } if (isNewMatchPO) @@ -1580,7 +1584,7 @@ public class MInOut extends X_M_InOut implements DocAction isNewMatchPO = true; if (!po.save(get_TrxName())) { - m_processMsg = "Could not create PO(Inv) Matching"; + m_processMsg = new StringBuffer("Could not create PO(Inv) Matching"); return DocAction.STATUS_Invalid; } if (isNewMatchPO) @@ -1612,14 +1616,14 @@ public class MInOut extends X_M_InOut implements DocAction String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE); if (valid != null) { - m_processMsg = valid; + m_processMsg = new StringBuffer(valid); return DocAction.STATUS_Invalid; } // Set the definite document number after completed (if needed) setDefiniteDocumentNo(); - m_processMsg = info.toString(); + m_processMsg = new StringBuffer(info.toString()); setProcessed(true); setDocAction(DOCACTION_Close); return DocAction.STATUS_Completed; @@ -1942,7 +1946,7 @@ public class MInOut extends X_M_InOut implements DocAction { log.info(toString()); // Before Void - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID)); if (m_processMsg != null) return false; @@ -1950,7 +1954,7 @@ public class MInOut extends X_M_InOut implements DocAction || DOCSTATUS_Reversed.equals(getDocStatus()) || DOCSTATUS_Voided.equals(getDocStatus())) { - m_processMsg = "Document Closed: " + getDocStatus(); + m_processMsg = new StringBuffer("Document Closed: ").append(getDocStatus()); return false; } @@ -1970,7 +1974,8 @@ public class MInOut extends X_M_InOut implements DocAction if (old.signum() != 0) { line.setQty(Env.ZERO); - line.addDescription("Void (" + old + ")"); + StringBuilder msgd = new StringBuilder("Void (").append(old).append(")"); + line.addDescription(msgd.toString()); line.saveEx(get_TrxName()); } } @@ -1986,7 +1991,7 @@ public class MInOut extends X_M_InOut implements DocAction } // After Void - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID)); if (m_processMsg != null) return false; @@ -2003,7 +2008,7 @@ public class MInOut extends X_M_InOut implements DocAction { log.info(toString()); // Before Close - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE)); if (m_processMsg != null) return false; @@ -2011,7 +2016,7 @@ public class MInOut extends X_M_InOut implements DocAction setDocAction(DOCACTION_None); // After Close - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE)); if (m_processMsg != null) return false; return true; @@ -2025,14 +2030,14 @@ public class MInOut extends X_M_InOut implements DocAction { log.info(toString()); // Before reverseCorrect - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT)); if (m_processMsg != null) return false; MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); if (!MPeriod.isOpen(getCtx(), getDateAcct(), dt.getDocBaseType(), getAD_Org_ID())) { - m_processMsg = "@PeriodClosed@"; + m_processMsg = new StringBuffer("@PeriodClosed@"); return false; } @@ -2061,7 +2066,7 @@ public class MInOut extends X_M_InOut implements DocAction getC_DocType_ID(), isSOTrx(), false, get_TrxName(), true); if (reversal == null) { - m_processMsg = "Could not create Ship Reversal"; + m_processMsg = new StringBuffer("Could not create Ship Reversal"); return false; } reversal.setReversal(true); @@ -2079,7 +2084,7 @@ public class MInOut extends X_M_InOut implements DocAction rLine.setReversalLine_ID(sLines[i].getM_InOutLine_ID()); if (!rLine.save(get_TrxName())) { - m_processMsg = "Could not correct Ship Reversal Line"; + m_processMsg = new StringBuffer("Could not correct Ship Reversal Line"); return false; } // We need to copy MA @@ -2100,14 +2105,17 @@ public class MInOut extends X_M_InOut implements DocAction if (asset != null) { asset.setIsActive(false); - asset.addDescription("(" + reversal.getDocumentNo() + " #" + rLine.getLine() + "<-)"); + StringBuilder msgd = new StringBuilder( + "(").append(reversal.getDocumentNo()).append(" #").append(rLine.getLine()).append("<-)"); + asset.addDescription(msgd.toString()); asset.saveEx(); } } reversal.setC_Order_ID(getC_Order_ID()); // Set M_RMA_ID reversal.setM_RMA_ID(getM_RMA_ID()); - reversal.addDescription("{->" + getDocumentNo() + ")"); + StringBuilder msgd = new StringBuilder("{->").append(getDocumentNo()).append(")"); + reversal.addDescription(msgd.toString()); //FR1948157 reversal.setReversal_ID(getM_InOut_ID()); reversal.saveEx(get_TrxName()); @@ -2115,7 +2123,7 @@ public class MInOut extends X_M_InOut implements DocAction if (!reversal.processIt(DocAction.ACTION_Complete) || !reversal.getDocStatus().equals(DocAction.STATUS_Completed)) { - m_processMsg = "Reversal ERROR: " + reversal.getProcessMsg(); + m_processMsg = new StringBuffer("Reversal ERROR: ").append(reversal.getProcessMsg()); return false; } reversal.closeIt(); @@ -2124,7 +2132,8 @@ public class MInOut extends X_M_InOut implements DocAction reversal.setDocAction(DOCACTION_None); reversal.saveEx(get_TrxName()); // - addDescription("(" + reversal.getDocumentNo() + "<-)"); + msgd = new StringBuilder("(").append(reversal.getDocumentNo()).append("<-)"); + addDescription(msgd.toString()); // // Void Confirmations @@ -2135,11 +2144,11 @@ public class MInOut extends X_M_InOut implements DocAction voidConfirmations(); // After reverseCorrect - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT)); if (m_processMsg != null) return false; - m_processMsg = reversal.getDocumentNo(); + m_processMsg = new StringBuffer(reversal.getDocumentNo()); setProcessed(true); setDocStatus(DOCSTATUS_Reversed); // may come from void setDocAction(DOCACTION_None); @@ -2154,12 +2163,12 @@ public class MInOut extends X_M_InOut implements DocAction { log.info(toString()); // Before reverseAccrual - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL)); if (m_processMsg != null) return false; // After reverseAccrual - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL)); if (m_processMsg != null) return false; @@ -2174,12 +2183,12 @@ public class MInOut extends X_M_InOut implements DocAction { log.info(toString()); // Before reActivate - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE)); if (m_processMsg != null) return false; // After reActivate - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE)); if (m_processMsg != null) return false; @@ -2193,7 +2202,7 @@ public class MInOut extends X_M_InOut implements DocAction */ public String getSummary() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append(getDocumentNo()); // : Total Lines = 123.00 (#1) sb.append(":") @@ -2211,7 +2220,7 @@ public class MInOut extends X_M_InOut implements DocAction */ public String getProcessMsg() { - return m_processMsg; + return m_processMsg.toString(); } // getProcessMsg /** diff --git a/org.adempiere.base/src/org/compiere/model/MInOutConfirm.java b/org.adempiere.base/src/org/compiere/model/MInOutConfirm.java index 03d6dfdad4..aefea48bf7 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOutConfirm.java +++ b/org.adempiere.base/src/org/compiere/model/MInOutConfirm.java @@ -174,8 +174,10 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction String desc = getDescription(); if (desc == null) setDescription(description); - else - setDescription(desc + " | " + description); + else{ + StringBuilder msgd = new StringBuilder(desc).append(" | ").append(description); + setDescription(msgd.toString()); + } } // addDescription /** @@ -193,7 +195,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction */ public String toString () { - StringBuffer sb = new StringBuffer ("MInOutConfirm["); + StringBuilder sb = new StringBuilder ("MInOutConfirm["); sb.append(get_ID()).append("-").append(getSummary()) .append ("]"); return sb.toString (); @@ -205,7 +207,8 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction */ public String getDocumentInfo() { - return Msg.getElement(getCtx(), "M_InOutConfirm_ID") + " " + getDocumentNo(); + StringBuilder msgreturn = new StringBuilder(Msg.getElement(getCtx(), "M_InOutConfirm_ID")).append(" ").append(getDocumentNo()); + return msgreturn.toString(); } // getDocumentInfo /** @@ -216,7 +219,8 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction { try { - File temp = File.createTempFile(get_TableName()+get_ID()+"_", ".pdf"); + StringBuilder msgfile = new StringBuilder(get_TableName()).append(get_ID()).append("_"); + File temp = File.createTempFile(msgfile.toString(), ".pdf"); return createPDF (temp); } catch (Exception e) @@ -249,11 +253,11 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction { int AD_User_ID = Env.getAD_User_ID(getCtx()); MUser user = MUser.get(getCtx(), AD_User_ID); - String info = user.getName() - + ": " - + Msg.translate(getCtx(), "IsApproved") - + " - " + new Timestamp(System.currentTimeMillis()); - addDescription(info); + StringBuilder info = new StringBuilder(user.getName()) + .append(": ") + .append(Msg.translate(getCtx(), "IsApproved")) + .append(" - ").append(new Timestamp(System.currentTimeMillis())); + addDescription(info.toString()); } super.setIsApproved (IsApproved); } // setIsApproved @@ -272,7 +276,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction } // processIt /** Process Message */ - private String m_processMsg = null; + private StringBuffer m_processMsg = null; /** Just Prepared Flag */ private boolean m_justPrepared = false; @@ -305,7 +309,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction public String prepareIt() { log.info(toString()); - m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE)); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -323,7 +327,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction MInOutLineConfirm[] lines = getLines(true); if (lines.length == 0) { - m_processMsg = "@NoLines@"; + m_processMsg = new StringBuffer("@NoLines@"); return DocAction.STATUS_Invalid; } // Set dispute if not fully confirmed @@ -338,7 +342,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction } setIsInDispute(difference); - m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE)); if (m_processMsg != null) return DocAction.STATUS_Invalid; // @@ -384,7 +388,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction return status; } - m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE)); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -404,7 +408,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction { if (dt.getC_DocTypeDifference_ID() == 0) { - m_processMsg = "No Split Document Type defined for: " + dt.getName(); + m_processMsg = new StringBuffer("No Split Document Type defined for: ").append(dt.getName()); return DocAction.STATUS_Invalid; } splitInOut (inout, dt.getC_DocTypeDifference_ID(), lines); @@ -419,7 +423,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction confirmLine.set_TrxName(get_TrxName()); if (!confirmLine.processLine (inout.isSOTrx(), getConfirmType())) { - m_processMsg = "ShipLine not saved - " + confirmLine; + m_processMsg = new StringBuffer("ShipLine not saved - ").append(confirmLine); return DocAction.STATUS_Invalid; } if (confirmLine.isFullyConfirmed()) @@ -444,9 +448,9 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction } // for all lines if (m_creditMemo != null) - m_processMsg += " @C_Invoice_ID@=" + m_creditMemo.getDocumentNo(); + m_processMsg.append(" @C_Invoice_ID@=").append(m_creditMemo.getDocumentNo()); if (m_inventory != null) - m_processMsg += " @M_Inventory_ID@=" + m_inventory.getDocumentNo(); + m_processMsg.append(" @M_Inventory_ID@=").append(m_inventory.getDocumentNo()); // Try to complete Shipment @@ -457,7 +461,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE); if (valid != null) { - m_processMsg = valid; + m_processMsg = new StringBuffer(valid); return DocAction.STATUS_Invalid; } @@ -490,10 +494,12 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction if (split == null) { split = new MInOut (original, C_DocType_ID, original.getMovementDate()); - split.addDescription("Splitted from " + original.getDocumentNo()); + StringBuilder msgd = new StringBuilder("Splitted from ").append(original.getDocumentNo()); + split.addDescription(msgd.toString()); split.setIsInDispute(true); split.saveEx(); - original.addDescription("Split: " + split.getDocumentNo()); + msgd = new StringBuilder("Split: ").append(split.getDocumentNo()); + original.addDescription(msgd.toString()); original.saveEx(); } // @@ -508,12 +514,14 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction splitLine.setM_Product_ID(oldLine.getM_Product_ID()); splitLine.setM_Warehouse_ID(oldLine.getM_Warehouse_ID()); splitLine.setRef_InOutLine_ID(oldLine.getRef_InOutLine_ID()); - splitLine.addDescription("Split: from " + oldLine.getMovementQty()); + StringBuilder msgd = new StringBuilder("Split: from ").append(oldLine.getMovementQty()); + splitLine.addDescription(msgd.toString()); // Qtys splitLine.setQty(differenceQty); // Entered/Movement splitLine.saveEx(); // Old - oldLine.addDescription("Splitted: from " + oldLine.getMovementQty()); + msgd = new StringBuilder("Splitted: from ").append(oldLine.getMovementQty()); + oldLine.addDescription(msgd.toString()); oldLine.setQty(oldLine.getMovementQty().subtract(differenceQty)); oldLine.saveEx(); // Update Confirmation Line @@ -528,8 +536,8 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction return ; } - m_processMsg = "Split @M_InOut_ID@=" + split.getDocumentNo() - + " - @M_InOutConfirm_ID@="; + m_processMsg = new StringBuffer("Split @M_InOut_ID@=").append(split.getDocumentNo()) + .append(" - @M_InOutConfirm_ID@="); MDocType dt = MDocType.get(getCtx(), original.getC_DocType_ID()); if (!dt.isPrepareSplitDocument()) @@ -552,13 +560,13 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction index++; // try just next if (splitConfirms[index].isProcessed()) { - m_processMsg += splitConfirms[index].getDocumentNo() + " processed??"; + m_processMsg.append(splitConfirms[index].getDocumentNo()).append(" processed??"); return; } } splitConfirms[index].setIsInDispute(true); splitConfirms[index].saveEx(); - m_processMsg += splitConfirms[index].getDocumentNo(); + m_processMsg.append(splitConfirms[index].getDocumentNo()); // Set Lines to unconfirmed MInOutLineConfirm[] splitConfirmLines = splitConfirms[index].getLines(false); for (int i = 0; i < splitConfirmLines.length; i++) @@ -570,7 +578,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction } } else - m_processMsg += "??"; + m_processMsg.append("??"); } // splitInOut @@ -584,9 +592,9 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction private boolean createDifferenceDoc (MInOut inout, MInOutLineConfirm confirm) { if (m_processMsg == null) - m_processMsg = ""; + m_processMsg = new StringBuffer(); else if (m_processMsg.length() > 0) - m_processMsg += "; "; + m_processMsg.append("; "); // Credit Memo if linked Document if (confirm.getDifferenceQty().signum() != 0 && !inout.isSOTrx() && inout.getRef_InOut_ID() != 0) @@ -595,7 +603,8 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction if (m_creditMemo == null) { m_creditMemo = new MInvoice (inout, null); - m_creditMemo.setDescription(Msg.translate(getCtx(), "M_InOutConfirm_ID") + " " + getDocumentNo()); + StringBuilder msgd = new StringBuilder(Msg.translate(getCtx(), "M_InOutConfirm_ID")).append(" ").append(getDocumentNo()); + m_creditMemo.setDescription(msgd.toString()); m_creditMemo.setC_DocTypeTarget_ID(MDocType.DOCBASETYPE_APCreditMemo); m_creditMemo.saveEx(); setC_Invoice_ID(m_creditMemo.getC_Invoice_ID()); @@ -620,7 +629,8 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction { MWarehouse wh = MWarehouse.get(getCtx(), inout.getM_Warehouse_ID()); m_inventory = new MInventory (wh, get_TrxName()); - m_inventory.setDescription(Msg.translate(getCtx(), "M_InOutConfirm_ID") + " " + getDocumentNo()); + StringBuilder msgd = new StringBuilder(Msg.translate(getCtx(), "M_InOutConfirm_ID")).append(" ").append(getDocumentNo()); + m_inventory.setDescription(msgd.toString()); m_inventory.saveEx(); setM_Inventory_ID(m_inventory.getM_Inventory_ID()); } @@ -630,7 +640,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction confirm.getScrappedQty(), Env.ZERO); if (!line.save(get_TrxName())) { - m_processMsg += "Inventory Line not created"; + m_processMsg.append("Inventory Line not created"); return false; } confirm.setM_InventoryLine_ID(line.getM_InventoryLine_ID()); @@ -639,7 +649,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction // if (!confirm.save(get_TrxName())) { - m_processMsg += "Confirmation Line not saved"; + m_processMsg.append("Confirmation Line not saved"); return false; } return true; @@ -653,7 +663,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction { log.info(toString()); // Before Void - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID)); if (m_processMsg != null) return false; @@ -661,7 +671,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction || DOCSTATUS_Reversed.equals(getDocStatus()) || DOCSTATUS_Voided.equals(getDocStatus())) { - m_processMsg = "Document Closed: " + getDocStatus(); + m_processMsg = new StringBuffer("Document Closed: ").append(getDocStatus()); return false; } @@ -695,7 +705,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction } // After Void - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID)); if (m_processMsg != null) return false; @@ -713,14 +723,14 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction { log.info(toString()); // Before Close - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE)); if (m_processMsg != null) return false; setDocAction(DOCACTION_None); // After Close - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE)); if (m_processMsg != null) return false; @@ -735,12 +745,12 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction { log.info(toString()); // Before reverseCorrect - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT)); if (m_processMsg != null) return false; // After reverseCorrect - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT)); if (m_processMsg != null) return false; @@ -755,12 +765,12 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction { log.info(toString()); // Before reverseAccrual - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL)); if (m_processMsg != null) return false; // After reverseAccrual - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL)); if (m_processMsg != null) return false; @@ -775,12 +785,12 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction { log.info(toString()); // Before reActivate - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE)); if (m_processMsg != null) return false; // After reActivate - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE)); if (m_processMsg != null) return false; @@ -794,7 +804,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction */ public String getSummary() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append(getDocumentNo()); // : Total Lines = 123.00 (#1) sb.append(": ") @@ -812,7 +822,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction */ public String getProcessMsg() { - return m_processMsg; + return m_processMsg.toString(); } // getProcessMsg /** diff --git a/org.adempiere.base/src/org/compiere/model/MInOutLine.java b/org.adempiere.base/src/org/compiere/model/MInOutLine.java index 8641f14542..da12869f2d 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOutLine.java +++ b/org.adempiere.base/src/org/compiere/model/MInOutLine.java @@ -423,8 +423,10 @@ public class MInOutLine extends X_M_InOutLine String desc = getDescription(); if (desc == null) setDescription(description); - else - setDescription(desc + " | " + description); + else{ + StringBuilder msgd = new StringBuilder(desc).append(" | ").append(description); + setDescription(msgd.toString()); + } } // addDescription /** @@ -628,7 +630,7 @@ public class MInOutLine extends X_M_InOutLine */ public String toString () { - StringBuffer sb = new StringBuffer ("MInOutLine[").append (get_ID()) + StringBuilder sb = new StringBuilder ("MInOutLine[").append (get_ID()) .append(",M_Product_ID=").append(getM_Product_ID()) .append(",QtyEntered=").append(getQtyEntered()) .append(",MovementQty=").append(getMovementQty()) diff --git a/org.adempiere.base/src/org/compiere/model/MInOutLineMA.java b/org.adempiere.base/src/org/compiere/model/MInOutLineMA.java index c1d422aa61..cf28a56c55 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOutLineMA.java +++ b/org.adempiere.base/src/org/compiere/model/MInOutLineMA.java @@ -62,10 +62,10 @@ public class MInOutLineMA extends X_M_InOutLineMA */ public static int deleteInOutMA (int M_InOut_ID, String trxName) { - String sql = "DELETE FROM M_InOutLineMA ma WHERE EXISTS " - + "(SELECT * FROM M_InOutLine l WHERE l.M_InOutLine_ID=ma.M_InOutLine_ID" - + " AND M_InOut_ID=" + M_InOut_ID + ")"; - return DB.executeUpdate(sql, trxName); + StringBuilder sql = new StringBuilder("DELETE FROM M_InOutLineMA ma WHERE EXISTS ") + .append("(SELECT * FROM M_InOutLine l WHERE l.M_InOutLine_ID=ma.M_InOutLine_ID") + .append(" AND M_InOut_ID=").append(M_InOut_ID).append(")"); + return DB.executeUpdate(sql.toString(), trxName); } // deleteInOutMA /** @@ -130,7 +130,7 @@ public class MInOutLineMA extends X_M_InOutLineMA */ public String toString () { - StringBuffer sb = new StringBuffer ("MInOutLineMA["); + StringBuilder sb = new StringBuilder ("MInOutLineMA["); sb.append("M_InOutLine_ID=").append(getM_InOutLine_ID()) .append(",M_AttributeSetInstance_ID=").append(getM_AttributeSetInstance_ID()) .append(", Qty=").append(getMovementQty()) diff --git a/org.adempiere.base/src/org/compiere/model/MIndex.java b/org.adempiere.base/src/org/compiere/model/MIndex.java index a6778f068e..9bb05d9363 100644 --- a/org.adempiere.base/src/org/compiere/model/MIndex.java +++ b/org.adempiere.base/src/org/compiere/model/MIndex.java @@ -72,10 +72,10 @@ public class MIndex extends X_K_Index */ public static int cleanUp (String trxName, int AD_Client_ID, int AD_Table_ID, int Record_ID) { - StringBuffer sb = new StringBuffer ("DELETE FROM K_Index " - + "WHERE AD_Client_ID=" + AD_Client_ID + " AND " - + "AD_Table_ID=" + AD_Table_ID + " AND " - + "Record_ID=" + Record_ID); + StringBuilder sb = new StringBuilder ("DELETE FROM K_Index ") + .append("WHERE AD_Client_ID=").append(AD_Client_ID).append( " AND ") + .append("AD_Table_ID=").append(AD_Table_ID).append( " AND ") + .append("Record_ID=").append(Record_ID); int no = DB.executeUpdate(sb.toString(), trxName); return no; } @@ -214,20 +214,20 @@ public class MIndex extends X_K_Index public static void reIndex(boolean runCleanUp, String[] toBeIndexed, Properties ctx, int AD_Client_ID, int AD_Table_ID, int Record_ID, int CM_WebProject_ID, Timestamp lastUpdated) { - String trxName = "ReIndex_" + AD_Table_ID + "_" + Record_ID; + StringBuilder trxName = new StringBuilder("ReIndex_").append(AD_Table_ID).append("_").append(Record_ID); try { if (!runCleanUp) { - MIndex.cleanUp(trxName, AD_Client_ID, AD_Table_ID, Record_ID); + MIndex.cleanUp(trxName.toString(), AD_Client_ID, AD_Table_ID, Record_ID); } for (int i=0;i" + getDocumentNo() + ")"); + StringBuilder msgd = new StringBuilder("{->").append(getDocumentNo()).append(")"); + reversal.addDescription(msgd.toString()); //FR1948157 reversal.setReversal_ID(getM_Inventory_ID()); reversal.saveEx(); @@ -792,19 +798,20 @@ public class MInventory extends X_M_Inventory implements DocAction // if (!reversal.processIt(DocAction.ACTION_Complete)) { - m_processMsg = "Reversal ERROR: " + reversal.getProcessMsg(); + m_processMsg = new StringBuffer("Reversal ERROR: ").append(reversal.getProcessMsg()); return false; } reversal.closeIt(); reversal.setDocStatus(DOCSTATUS_Reversed); reversal.setDocAction(DOCACTION_None); reversal.saveEx(); - m_processMsg = reversal.getDocumentNo(); + m_processMsg = new StringBuffer(reversal.getDocumentNo()); // Update Reversed (this) - addDescription("(" + reversal.getDocumentNo() + "<-)"); + msgd = new StringBuilder("(").append(reversal.getDocumentNo()).append("<-)"); + addDescription(msgd.toString()); // After reverseCorrect - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT)); if (m_processMsg != null) return false; setProcessed(true); @@ -824,12 +831,12 @@ public class MInventory extends X_M_Inventory implements DocAction { log.info(toString()); // Before reverseAccrual - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL)); if (m_processMsg != null) return false; // After reverseAccrual - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL)); if (m_processMsg != null) return false; @@ -844,12 +851,12 @@ public class MInventory extends X_M_Inventory implements DocAction { log.info(toString()); // Before reActivate - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE)); if (m_processMsg != null) return false; // After reActivate - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE)); if (m_processMsg != null) return false; @@ -863,7 +870,7 @@ public class MInventory extends X_M_Inventory implements DocAction */ public String getSummary() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append(getDocumentNo()); // : Total Lines = 123.00 (#1) sb.append(": ") @@ -881,7 +888,7 @@ public class MInventory extends X_M_Inventory implements DocAction */ public String getProcessMsg() { - return m_processMsg; + return m_processMsg.toString(); } // getProcessMsg /** diff --git a/org.adempiere.base/src/org/compiere/model/MInventoryLine.java b/org.adempiere.base/src/org/compiere/model/MInventoryLine.java index f1287d296d..6e6b7f1970 100644 --- a/org.adempiere.base/src/org/compiere/model/MInventoryLine.java +++ b/org.adempiere.base/src/org/compiere/model/MInventoryLine.java @@ -206,8 +206,10 @@ public class MInventoryLine extends X_M_InventoryLine String desc = getDescription(); if (desc == null) setDescription(description); - else - setDescription(desc + " | " + description); + else{ + StringBuilder msgd = new StringBuilder(desc).append(" | ").append(description); + setDescription(msgd.toString()); + } } // addDescription /** @@ -236,7 +238,7 @@ public class MInventoryLine extends X_M_InventoryLine */ public String toString () { - StringBuffer sb = new StringBuffer ("MInventoryLine["); + StringBuilder sb = new StringBuilder ("MInventoryLine["); sb.append (get_ID()) .append("-M_Product_ID=").append (getM_Product_ID()) .append(",QtyCount=").append(getQtyCount()) diff --git a/org.adempiere.base/src/org/compiere/model/MInventoryLineMA.java b/org.adempiere.base/src/org/compiere/model/MInventoryLineMA.java index 4a133c6391..12123e75a1 100644 --- a/org.adempiere.base/src/org/compiere/model/MInventoryLineMA.java +++ b/org.adempiere.base/src/org/compiere/model/MInventoryLineMA.java @@ -85,10 +85,10 @@ public class MInventoryLineMA extends X_M_InventoryLineMA */ public static int deleteInventoryMA (int M_Inventory_ID, String trxName) { - String sql = "DELETE FROM M_InventoryLineMA ma WHERE EXISTS " - + "(SELECT * FROM M_InventoryLine l WHERE l.M_InventoryLine_ID=ma.M_InventoryLine_ID" - + " AND M_Inventory_ID=" + M_Inventory_ID + ")"; - return DB.executeUpdate(sql, trxName); + StringBuilder sql = new StringBuilder("DELETE FROM M_InventoryLineMA ma WHERE EXISTS ") + .append("(SELECT * FROM M_InventoryLine l WHERE l.M_InventoryLine_ID=ma.M_InventoryLine_ID") + .append(" AND M_Inventory_ID=").append(M_Inventory_ID).append(")"); + return DB.executeUpdate(sql.toString(), trxName); } // deleteInventoryMA /** @@ -99,10 +99,10 @@ public class MInventoryLineMA extends X_M_InventoryLineMA */ public static int deleteInventoryLineMA (int M_InventoryLine_ID, String trxName) { - String sql = "DELETE FROM M_InventoryLineMA ma WHERE EXISTS " - + "(SELECT * FROM M_InventoryLine l WHERE l.M_InventoryLine_ID=ma.M_InventoryLine_ID" - + " AND M_InventoryLine_ID=" + M_InventoryLine_ID + ")"; - return DB.executeUpdate(sql, trxName); + StringBuilder sql = new StringBuilder("DELETE FROM M_InventoryLineMA ma WHERE EXISTS ") + .append("(SELECT * FROM M_InventoryLine l WHERE l.M_InventoryLine_ID=ma.M_InventoryLine_ID") + .append(" AND M_InventoryLine_ID=").append(M_InventoryLine_ID).append(")"); + return DB.executeUpdate(sql.toString(), trxName); } // deleteInventoryMA /** Logger */ @@ -155,7 +155,7 @@ public class MInventoryLineMA extends X_M_InventoryLineMA */ public String toString () { - StringBuffer sb = new StringBuffer ("MInventoryLineMA["); + StringBuilder sb = new StringBuilder ("MInventoryLineMA["); sb.append("M_InventoryLine_ID=").append(getM_InventoryLine_ID()) .append(",M_AttributeSetInstance_ID=").append(getM_AttributeSetInstance_ID()) .append(", Qty=").append(getMovementQty()) diff --git a/org.adempiere.base/src/org/compiere/model/MInvoice.java b/org.adempiere.base/src/org/compiere/model/MInvoice.java index b9f4f4ae2c..8faedb10fb 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoice.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoice.java @@ -219,7 +219,7 @@ public class MInvoice extends X_C_Invoice implements DocAction */ public static String getPDFFileName (String documentDir, int C_Invoice_ID) { - StringBuffer sb = new StringBuffer (documentDir); + StringBuilder sb = new StringBuilder (documentDir); if (sb.length() == 0) sb.append("."); if (!sb.toString().endsWith(File.separator)) @@ -825,8 +825,10 @@ public class MInvoice extends X_C_Invoice implements DocAction String desc = getDescription(); if (desc == null) setDescription(description); - else - setDescription(desc + " | " + description); + else{ + StringBuilder msgd = new StringBuilder(desc).append(" | ").append(description); + setDescription(msgd.toString()); + } } // addDescription /** @@ -851,9 +853,9 @@ public class MInvoice extends X_C_Invoice implements DocAction super.setProcessed (processed); if (get_ID() == 0) return; - String set = "SET Processed='" - + (processed ? "Y" : "N") - + "' WHERE C_Invoice_ID=" + getC_Invoice_ID(); + StringBuilder set = new StringBuilder("SET Processed='") + .append((processed ? "Y" : "N")) + .append("' WHERE C_Invoice_ID=").append(getC_Invoice_ID()); int noLine = DB.executeUpdate("UPDATE C_InvoiceLine " + set, get_TrxName()); int noTax = DB.executeUpdate("UPDATE C_InvoiceTax " + set, get_TrxName()); m_lines = null; @@ -1021,7 +1023,7 @@ public class MInvoice extends X_C_Invoice implements DocAction */ public String toString () { - StringBuffer sb = new StringBuffer ("MInvoice[") + StringBuilder sb = new StringBuilder ("MInvoice[") .append(get_ID()).append("-").append(getDocumentNo()) .append(",GrandTotal=").append(getGrandTotal()); if (m_lines != null) @@ -1037,7 +1039,8 @@ public class MInvoice extends X_C_Invoice implements DocAction public String getDocumentInfo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); - return dt.getName() + " " + getDocumentNo(); + StringBuilder msgreturn = new StringBuilder(dt.getName()).append(" ").append(getDocumentNo()); + return msgreturn.toString(); } // getDocumentInfo @@ -1054,12 +1057,12 @@ public class MInvoice extends X_C_Invoice implements DocAction if (is_ValueChanged("AD_Org_ID")) { - String sql = "UPDATE C_InvoiceLine ol" - + " SET AD_Org_ID =" - + "(SELECT AD_Org_ID" - + " FROM C_Invoice o WHERE ol.C_Invoice_ID=o.C_Invoice_ID) " - + "WHERE C_Invoice_ID=" + getC_Invoice_ID(); - int no = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("UPDATE C_InvoiceLine ol") + .append(" SET AD_Org_ID =") + .append("(SELECT AD_Org_ID") + .append(" FROM C_Invoice o WHERE ol.C_Invoice_ID=o.C_Invoice_ID) ") + .append("WHERE C_Invoice_ID=").append(getC_Invoice_ID()); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine("Lines -> #" + no); } return true; @@ -1255,7 +1258,8 @@ public class MInvoice extends X_C_Invoice implements DocAction { try { - File temp = File.createTempFile(get_TableName()+get_ID()+"_", ".pdf"); + StringBuilder msgfile = new StringBuilder(get_TableName()).append(get_ID()).append("_"); + File temp = File.createTempFile(msgfile.toString(), ".pdf"); return createPDF (temp); } catch (Exception e) @@ -1335,7 +1339,7 @@ public class MInvoice extends X_C_Invoice implements DocAction } // process /** Process Message */ - private String m_processMsg = null; + private StringBuffer m_processMsg = null; /** Just Prepared Flag */ private boolean m_justPrepared = false; @@ -1368,7 +1372,7 @@ public class MInvoice extends X_C_Invoice implements DocAction public String prepareIt() { log.info(toString()); - m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE)); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -1378,14 +1382,14 @@ public class MInvoice extends X_C_Invoice implements DocAction MInvoiceLine[] lines = getLines(true); if (lines.length == 0) { - m_processMsg = "@NoLines@"; + m_processMsg = new StringBuffer("@NoLines@"); return DocAction.STATUS_Invalid; } // No Cash Book if (PAYMENTRULE_Cash.equals(getPaymentRule()) && MCashBook.get(getCtx(), getAD_Org_ID(), getC_Currency_ID()) == null) { - m_processMsg = "@NoCashBook@"; + m_processMsg = new StringBuffer("@NoCashBook@"); return DocAction.STATUS_Invalid; } @@ -1394,14 +1398,14 @@ public class MInvoice extends X_C_Invoice implements DocAction setC_DocType_ID(getC_DocTypeTarget_ID()); if (getC_DocType_ID() == 0) { - m_processMsg = "No Document Type"; + m_processMsg = new StringBuffer("No Document Type"); return DocAction.STATUS_Invalid; } explodeBOM(); if (!calculateTaxTotal()) // setTotals { - m_processMsg = "Error calculating Tax"; + m_processMsg = new StringBuffer("Error calculating Tax"); return DocAction.STATUS_Invalid; } @@ -1410,13 +1414,13 @@ public class MInvoice extends X_C_Invoice implements DocAction { if (!createPaySchedule()) { - m_processMsg = "@ErrorPaymentSchedule@"; + m_processMsg = new StringBuffer("@ErrorPaymentSchedule@"); return DocAction.STATUS_Invalid; } } else { if (MInvoicePaySchedule.getInvoicePaySchedule(getCtx(), getC_Invoice_ID(), 0, get_TrxName()).length > 0) { - m_processMsg = "@ErrorPaymentSchedule@"; + m_processMsg = new StringBuffer("@ErrorPaymentSchedule@"); return DocAction.STATUS_Invalid; } } @@ -1433,9 +1437,9 @@ public class MInvoice extends X_C_Invoice implements DocAction MBPartner bp = new MBPartner (getCtx(), getC_BPartner_ID(), null); if ( MBPartner.SOCREDITSTATUS_CreditStop.equals(bp.getSOCreditStatus()) ) { - m_processMsg = "@BPartnerCreditStop@ - @TotalOpenBalance@=" - + bp.getTotalOpenBalance() - + ", @SO_CreditLimit@=" + bp.getSO_CreditLimit(); + m_processMsg = new StringBuffer("@BPartnerCreditStop@ - @TotalOpenBalance@=") + .append(bp.getTotalOpenBalance()) + .append(", @SO_CreditLimit@=").append(bp.getSO_CreditLimit()); return DocAction.STATUS_Invalid; } } @@ -1450,13 +1454,13 @@ public class MInvoice extends X_C_Invoice implements DocAction String error = line.allocateLandedCosts(); if (error != null && error.length() > 0) { - m_processMsg = error; + m_processMsg = new StringBuffer(error); return DocAction.STATUS_Invalid; } } } - m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE)); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -1541,12 +1545,12 @@ public class MInvoice extends X_C_Invoice implements DocAction line.setPriceList (Env.ZERO); line.setLineNetAmt (Env.ZERO); // - String description = product.getName (); + StringBuilder description = new StringBuilder(product.getName ()); if (product.getDescription () != null) - description += " " + product.getDescription (); + description.append(" ").append(product.getDescription ()); if (line.getDescription () != null) - description += " " + line.getDescription (); - line.setDescription (description); + description.append(" ").append(line.getDescription ()); + line.setDescription (description.toString()); line.saveEx (get_TrxName()); } // for all lines with BOM @@ -1564,7 +1568,8 @@ public class MInvoice extends X_C_Invoice implements DocAction { log.fine(""); // Delete Taxes - DB.executeUpdateEx("DELETE C_InvoiceTax WHERE C_Invoice_ID=" + getC_Invoice_ID(), get_TrxName()); + StringBuilder msgdb = new StringBuilder("DELETE C_InvoiceTax WHERE C_Invoice_ID=").append(getC_Invoice_ID()); + DB.executeUpdateEx(msgdb.toString(), get_TrxName()); m_taxes = null; // Lines @@ -1698,7 +1703,7 @@ public class MInvoice extends X_C_Invoice implements DocAction return status; } - m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE)); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -1706,7 +1711,7 @@ public class MInvoice extends X_C_Invoice implements DocAction if (!isApproved()) approveIt(); log.info(toString()); - StringBuffer info = new StringBuffer(); + StringBuilder info = new StringBuilder(); // POS supports multiple payments boolean fromPOS = false; @@ -1743,17 +1748,17 @@ public class MInvoice extends X_C_Invoice implements DocAction if (cash == null || cash.get_ID() == 0) { - m_processMsg = "@NoCashBook@"; + m_processMsg = new StringBuffer("@NoCashBook@"); return DocAction.STATUS_Invalid; } MCashLine cl = new MCashLine (cash); cl.setInvoice(this); if (!cl.save(get_TrxName())) { - m_processMsg = "Could not save Cash Journal Line"; + m_processMsg = new StringBuffer("Could not save Cash Journal Line"); return DocAction.STATUS_Invalid; } - info.append("@C_Cash_ID@: " + cash.getName() + " #" + cl.getLine()); + info.append("@C_Cash_ID@: ").append(cash.getName()).append(" #").append(cl.getLine()); setC_CashLine_ID(cl.getC_CashLine_ID()); } // CashBook @@ -1777,7 +1782,7 @@ public class MInvoice extends X_C_Invoice implements DocAction ol.setQtyInvoiced(ol.getQtyInvoiced().add(line.getQtyInvoiced())); if (!ol.save(get_TrxName())) { - m_processMsg = "Could not update Order Line"; + m_processMsg = new StringBuffer("Could not update Order Line"); return DocAction.STATUS_Invalid; } } @@ -1795,7 +1800,7 @@ public class MInvoice extends X_C_Invoice implements DocAction isNewMatchPO = true; if (!po.save(get_TrxName())) { - m_processMsg = "Could not create PO Matching"; + m_processMsg = new StringBuffer("Could not create PO Matching"); return DocAction.STATUS_Invalid; } matchPO++; @@ -1814,7 +1819,7 @@ public class MInvoice extends X_C_Invoice implements DocAction rmaLine.setQtyInvoiced(line.getQtyInvoiced()); if (!rmaLine.save(get_TrxName())) { - m_processMsg = "Could not update RMA Line"; + m_processMsg = new StringBuffer("Could not update RMA Line"); return DocAction.STATUS_Invalid; } } @@ -1838,7 +1843,7 @@ public class MInvoice extends X_C_Invoice implements DocAction isNewMatchInv = true; if (!inv.save(get_TrxName())) { - m_processMsg = CLogger.retrieveErrorString("Could not create Invoice Matching"); + m_processMsg = new StringBuffer(CLogger.retrieveErrorString("Could not create Invoice Matching")); return DocAction.STATUS_Invalid; } matchInv++; @@ -1860,8 +1865,8 @@ public class MInvoice extends X_C_Invoice implements DocAction getC_Currency_ID(), getDateAcct(), getC_ConversionType_ID(), getAD_Client_ID(), getAD_Org_ID()); if (invAmt == null) { - m_processMsg = "Could not convert C_Currency_ID=" + getC_Currency_ID() - + " to base C_Currency_ID=" + MClient.get(Env.getCtx()).getC_Currency_ID(); + m_processMsg = new StringBuffer("Could not convert C_Currency_ID=").append(getC_Currency_ID()) + .append(" to base C_Currency_ID=").append(MClient.get(Env.getCtx()).getC_Currency_ID()); return DocAction.STATUS_Invalid; } // Total Balance @@ -1902,7 +1907,7 @@ public class MInvoice extends X_C_Invoice implements DocAction bp.setSOCreditStatus(); if (!bp.save(get_TrxName())) { - m_processMsg = "Could not update Business Partner"; + m_processMsg = new StringBuffer("Could not update Business Partner"); return DocAction.STATUS_Invalid; } @@ -1911,10 +1916,11 @@ public class MInvoice extends X_C_Invoice implements DocAction { MUser user = new MUser (getCtx(), getAD_User_ID(), get_TrxName()); user.setLastContact(new Timestamp(System.currentTimeMillis())); - user.setLastResult(Msg.translate(getCtx(), "C_Invoice_ID") + ": " + getDocumentNo()); + StringBuilder msgr = new StringBuilder(Msg.translate(getCtx(), "C_Invoice_ID")).append(": ").append(getDocumentNo()); + user.setLastResult(msgr.toString()); if (!user.save(get_TrxName())) { - m_processMsg = "Could not update Business Partner User"; + m_processMsg = new StringBuffer("Could not update Business Partner User"); return DocAction.STATUS_Invalid; } } // user @@ -1930,8 +1936,8 @@ public class MInvoice extends X_C_Invoice implements DocAction getDateAcct(), 0, getAD_Client_ID(), getAD_Org_ID()); if (amt == null) { - m_processMsg = "Could not convert C_Currency_ID=" + getC_Currency_ID() - + " to Project C_Currency_ID=" + C_CurrencyTo_ID; + m_processMsg = new StringBuffer("Could not convert C_Currency_ID=").append(getC_Currency_ID()) + .append(" to Project C_Currency_ID=").append(C_CurrencyTo_ID); return DocAction.STATUS_Invalid; } BigDecimal newAmt = project.getInvoicedAmt(); @@ -1945,7 +1951,7 @@ public class MInvoice extends X_C_Invoice implements DocAction project.setInvoicedAmt(newAmt); if (!project.save(get_TrxName())) { - m_processMsg = "Could not update Project"; + m_processMsg = new StringBuffer("Could not update Project"); return DocAction.STATUS_Invalid; } } // project @@ -1954,7 +1960,7 @@ public class MInvoice extends X_C_Invoice implements DocAction String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE); if (valid != null) { - m_processMsg = valid; + m_processMsg = new StringBuffer(valid); return DocAction.STATUS_Invalid; } @@ -1966,7 +1972,7 @@ public class MInvoice extends X_C_Invoice implements DocAction if (counter != null) info.append(" - @CounterDoc@: @C_Invoice_ID@=").append(counter.getDocumentNo()); - m_processMsg = info.toString().trim(); + m_processMsg = new StringBuffer(info.toString().trim()); setProcessed(true); setDocAction(DOCACTION_Close); return DocAction.STATUS_Completed; @@ -2092,7 +2098,7 @@ public class MInvoice extends X_C_Invoice implements DocAction { log.info(toString()); // Before Void - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID)); if (m_processMsg != null) return false; @@ -2100,7 +2106,7 @@ public class MInvoice extends X_C_Invoice implements DocAction || DOCSTATUS_Reversed.equals(getDocStatus()) || DOCSTATUS_Voided.equals(getDocStatus())) { - m_processMsg = "Document Closed: " + getDocStatus(); + m_processMsg = new StringBuffer("Document Closed: ").append(getDocStatus()); setDocAction(DOCACTION_None); return false; } @@ -2124,7 +2130,8 @@ public class MInvoice extends X_C_Invoice implements DocAction line.setTaxAmt(Env.ZERO); line.setLineNetAmt(Env.ZERO); line.setLineTotalAmt(Env.ZERO); - line.addDescription(Msg.getMsg(getCtx(), "Voided") + " (" + old + ")"); + StringBuilder msgd = new StringBuilder(Msg.getMsg(getCtx(), "Voided")).append(" (").append(old).append(")"); + line.addDescription(msgd.toString()); // Unlink Shipment if (line.getM_InOutLine_ID() != 0) { @@ -2146,7 +2153,7 @@ public class MInvoice extends X_C_Invoice implements DocAction } // After Void - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID)); if (m_processMsg != null) return false; @@ -2163,7 +2170,7 @@ public class MInvoice extends X_C_Invoice implements DocAction { log.info(toString()); // Before Close - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE)); if (m_processMsg != null) return false; @@ -2171,7 +2178,7 @@ public class MInvoice extends X_C_Invoice implements DocAction setDocAction(DOCACTION_None); // After Close - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE)); if (m_processMsg != null) return false; return true; @@ -2185,7 +2192,7 @@ public class MInvoice extends X_C_Invoice implements DocAction { log.info(toString()); // Before reverseCorrect - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT)); if (m_processMsg != null) return false; @@ -2228,7 +2235,7 @@ public class MInvoice extends X_C_Invoice implements DocAction reversal = copyFrom (this, getDateInvoiced(), getDateAcct(), getC_DocType_ID(), isSOTrx(), false, get_TrxName(), true, getDocumentNo()+"^"); if (reversal == null) { - m_processMsg = "Could not create Invoice Reversal"; + m_processMsg = new StringBuffer("Could not create Invoice Reversal"); return false; } reversal.setReversal(true); @@ -2247,7 +2254,7 @@ public class MInvoice extends X_C_Invoice implements DocAction rLine.setLineTotalAmt(rLine.getLineTotalAmt().negate()); if (!rLine.save(get_TrxName())) { - m_processMsg = "Could not correct Invoice Reversal Line"; + m_processMsg = new StringBuffer("Could not correct Invoice Reversal Line"); return false; } } @@ -2259,7 +2266,7 @@ public class MInvoice extends X_C_Invoice implements DocAction // if (!reversal.processIt(DocAction.ACTION_Complete)) { - m_processMsg = "Reversal ERROR: " + reversal.getProcessMsg(); + m_processMsg = new StringBuffer("Reversal ERROR: ").append(reversal.getProcessMsg()); return false; } reversal.setC_Payment_ID(0); @@ -2269,9 +2276,10 @@ public class MInvoice extends X_C_Invoice implements DocAction reversal.setDocStatus(DOCSTATUS_Reversed); reversal.setDocAction(DOCACTION_None); reversal.saveEx(get_TrxName()); - m_processMsg = reversal.getDocumentNo(); + m_processMsg = new StringBuffer(reversal.getDocumentNo()); // - addDescription("(" + reversal.getDocumentNo() + "<-)"); + StringBuilder msgd = new StringBuilder("(").append(reversal.getDocumentNo()).append("<-)"); + addDescription(msgd.toString()); // Clean up Reversed (this) MInvoiceLine[] iLines = getLines(false); @@ -2297,10 +2305,10 @@ public class MInvoice extends X_C_Invoice implements DocAction setIsPaid(true); // Create Allocation + msgd = new StringBuilder( + Msg.translate(getCtx(), "C_Invoice_ID")).append(": ").append(getDocumentNo()).append("/").append(reversal.getDocumentNo()); MAllocationHdr alloc = new MAllocationHdr(getCtx(), false, getDateAcct(), - getC_Currency_ID(), - Msg.translate(getCtx(), "C_Invoice_ID") + ": " + getDocumentNo() + "/" + reversal.getDocumentNo(), - get_TrxName()); + getC_Currency_ID(),msgd.toString(),get_TrxName()); alloc.setAD_Org_ID(getAD_Org_ID()); if (alloc.save()) { @@ -2326,7 +2334,7 @@ public class MInvoice extends X_C_Invoice implements DocAction } // After reverseCorrect - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT)); if (m_processMsg != null) return false; @@ -2341,12 +2349,12 @@ public class MInvoice extends X_C_Invoice implements DocAction { log.info(toString()); // Before reverseAccrual - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL)); if (m_processMsg != null) return false; // After reverseAccrual - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL)); if (m_processMsg != null) return false; @@ -2361,12 +2369,12 @@ public class MInvoice extends X_C_Invoice implements DocAction { log.info(toString()); // Before reActivate - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE)); if (m_processMsg != null) return false; // After reActivate - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE)); if (m_processMsg != null) return false; @@ -2381,7 +2389,7 @@ public class MInvoice extends X_C_Invoice implements DocAction */ public String getSummary() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append(getDocumentNo()); // : Grand Total = 123.00 (#1) sb.append(": "). @@ -2399,7 +2407,7 @@ public class MInvoice extends X_C_Invoice implements DocAction */ public String getProcessMsg() { - return m_processMsg; + return m_processMsg.toString(); } // getProcessMsg /** diff --git a/org.adempiere.base/src/org/compiere/model/MInvoiceBatch.java b/org.adempiere.base/src/org/compiere/model/MInvoiceBatch.java index 10c6e8ac92..8f734e8205 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoiceBatch.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoiceBatch.java @@ -136,9 +136,9 @@ public class MInvoiceBatch extends X_C_InvoiceBatch super.setProcessed (processed); if (get_ID() == 0) return; - String set = "SET Processed='" - + (processed ? "Y" : "N") - + "' WHERE C_InvoiceBatch_ID=" + getC_InvoiceBatch_ID(); + StringBuilder set = new StringBuilder("SET Processed='") + .append((processed ? "Y" : "N")) + .append("' WHERE C_InvoiceBatch_ID=").append(getC_InvoiceBatch_ID()); int noLine = DB.executeUpdate("UPDATE C_InvoiceBatchLine " + set, get_TrxName()); m_lines = null; log.fine(processed + " - Lines=" + noLine); diff --git a/org.adempiere.base/src/org/compiere/model/MInvoiceBatchLine.java b/org.adempiere.base/src/org/compiere/model/MInvoiceBatchLine.java index 784bd956c6..76fb56d569 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoiceBatchLine.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoiceBatchLine.java @@ -111,11 +111,11 @@ public class MInvoiceBatchLine extends X_C_InvoiceBatchLine { if (success) { - String sql = "UPDATE C_InvoiceBatch h " - + "SET DocumentAmt = NVL((SELECT SUM(LineTotalAmt) FROM C_InvoiceBatchLine l " - + "WHERE h.C_InvoiceBatch_ID=l.C_InvoiceBatch_ID AND l.IsActive='Y'),0) " - + "WHERE C_InvoiceBatch_ID=" + getC_InvoiceBatch_ID(); - DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("UPDATE C_InvoiceBatch h ") + .append("SET DocumentAmt = NVL((SELECT SUM(LineTotalAmt) FROM C_InvoiceBatchLine l ") + .append("WHERE h.C_InvoiceBatch_ID=l.C_InvoiceBatch_ID AND l.IsActive='Y'),0) ") + .append("WHERE C_InvoiceBatch_ID=").append(getC_InvoiceBatch_ID()); + DB.executeUpdate(sql.toString(), get_TrxName()); } return success; } // afterSave diff --git a/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java b/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java index 00a6226ebe..726245d2bb 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java @@ -308,8 +308,10 @@ public class MInvoiceLine extends X_C_InvoiceLine String desc = getDescription(); if (desc == null) setDescription(description); - else - setDescription(desc + " | " + description); + else{ + StringBuilder msgd = new StringBuilder(desc).append(" | ").append(description); + setDescription(msgd.toString()); + } } // addDescription /** @@ -702,7 +704,7 @@ public class MInvoiceLine extends X_C_InvoiceLine */ public String toString () { - StringBuffer sb = new StringBuffer ("MInvoiceLine[") + StringBuilder sb = new StringBuilder ("MInvoiceLine[") .append(get_ID()).append(",").append(getLine()) .append(",QtyInvoiced=").append(getQtyInvoiced()) .append(",LineNetAmt=").append(getLineNetAmt()) @@ -1005,13 +1007,14 @@ public class MInvoiceLine extends X_C_InvoiceLine MLandedCost[] lcs = MLandedCost.getLandedCosts(this); if (lcs.length == 0) return ""; - String sql = "DELETE C_LandedCostAllocation WHERE C_InvoiceLine_ID=" + getC_InvoiceLine_ID(); - int no = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("DELETE C_LandedCostAllocation WHERE C_InvoiceLine_ID=").append(getC_InvoiceLine_ID()); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) log.info("Deleted #" + no); int inserted = 0; // *** Single Criteria *** + StringBuilder msgreturn; if (lcs.length == 1) { MLandedCost lc = lcs[0]; @@ -1038,8 +1041,10 @@ public class MInvoiceLine extends X_C_InvoiceLine MInOutLine iol = (MInOutLine)list.get(i); total = total.add(iol.getBase(lc.getLandedCostDistribution())); } - if (total.signum() == 0) - return "Total of Base values is 0 - " + lc.getLandedCostDistribution(); + if (total.signum() == 0){ + msgreturn = new StringBuilder("Total of Base values is 0 - ").append(lc.getLandedCostDistribution()); + return msgreturn.toString(); + } // Create Allocations for (int i = 0; i < list.size(); i++) { @@ -1059,8 +1064,10 @@ public class MInvoiceLine extends X_C_InvoiceLine result /= total.doubleValue(); lca.setAmt(result, getPrecision()); } - if (!lca.save()) - return "Cannot save line Allocation = " + lca; + if (!lca.save()){ + msgreturn = new StringBuilder("Cannot save line Allocation = ").append(lca); + return msgreturn.toString(); + } inserted++; } log.info("Inserted " + inserted); @@ -1071,8 +1078,10 @@ public class MInvoiceLine extends X_C_InvoiceLine else if (lc.getM_InOutLine_ID() != 0) { MInOutLine iol = new MInOutLine (getCtx(), lc.getM_InOutLine_ID(), get_TrxName()); - if (iol.isDescription() || iol.getM_Product_ID() == 0) - return "Invalid Receipt Line - " + iol; + if (iol.isDescription() || iol.getM_Product_ID() == 0){ + msgreturn = new StringBuilder("Invalid Receipt Line - ").append(iol); + return msgreturn.toString(); + } MLandedCostAllocation lca = new MLandedCostAllocation (this, lc.getM_CostElement_ID()); lca.setM_Product_ID(iol.getM_Product_ID()); lca.setM_AttributeSetInstance_ID(iol.getM_AttributeSetInstance_ID()); @@ -1085,7 +1094,8 @@ public class MInvoiceLine extends X_C_InvoiceLine // end MZ if (lca.save()) return ""; - return "Cannot save single line Allocation = " + lc; + msgreturn = new StringBuilder("Cannot save single line Allocation = ").append(lc); + return msgreturn.toString(); } // Single Product else if (lc.getM_Product_ID() != 0) @@ -1095,10 +1105,13 @@ public class MInvoiceLine extends X_C_InvoiceLine lca.setAmt(getLineNetAmt()); if (lca.save()) return ""; - return "Cannot save Product Allocation = " + lc; + msgreturn = new StringBuilder("Cannot save Product Allocation = ").append(lc); + return msgreturn.toString(); } - else - return "No Reference for " + lc; + else{ + msgreturn = new StringBuilder("No Reference for ").append(lc); + return msgreturn.toString(); + } } // *** Multiple Criteria *** @@ -1149,8 +1162,10 @@ public class MInvoiceLine extends X_C_InvoiceLine MInOutLine iol = (MInOutLine)list.get(i); total = total.add(iol.getBase(LandedCostDistribution)); } - if (total.signum() == 0) - return "Total of Base values is 0 - " + LandedCostDistribution; + if (total.signum() == 0){ + msgreturn = new StringBuilder("Total of Base values is 0 - ").append(LandedCostDistribution); + return msgreturn.toString(); + } // Create Allocations for (int i = 0; i < list.size(); i++) { @@ -1170,8 +1185,10 @@ public class MInvoiceLine extends X_C_InvoiceLine result /= total.doubleValue(); lca.setAmt(result, getPrecision()); } - if (!lca.save()) - return "Cannot save line Allocation = " + lca; + if (!lca.save()){ + msgreturn = new StringBuilder("Cannot save line Allocation = ").append(lca); + return msgreturn.toString(); + } inserted++; } diff --git a/org.adempiere.base/src/org/compiere/model/MInvoicePaySchedule.java b/org.adempiere.base/src/org/compiere/model/MInvoicePaySchedule.java index 9d21b55640..ce4e2a2a98 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoicePaySchedule.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoicePaySchedule.java @@ -53,19 +53,19 @@ public class MInvoicePaySchedule extends X_C_InvoicePaySchedule public static MInvoicePaySchedule[] getInvoicePaySchedule(Properties ctx, int C_Invoice_ID, int C_InvoicePaySchedule_ID, String trxName) { - String sql = "SELECT * FROM C_InvoicePaySchedule ips WHERE IsActive='Y' "; + StringBuilder sql = new StringBuilder("SELECT * FROM C_InvoicePaySchedule ips WHERE IsActive='Y' "); if (C_Invoice_ID != 0) - sql += "AND C_Invoice_ID=? "; + sql.append("AND C_Invoice_ID=? "); else - sql += "AND EXISTS (SELECT * FROM C_InvoicePaySchedule x" - + " WHERE x.C_InvoicePaySchedule_ID=? AND ips.C_Invoice_ID=x.C_Invoice_ID) "; - sql += "ORDER BY DueDate"; + sql.append("AND EXISTS (SELECT * FROM C_InvoicePaySchedule x") + .append(" WHERE x.C_InvoicePaySchedule_ID=? AND ips.C_Invoice_ID=x.C_Invoice_ID) "); + sql.append("ORDER BY DueDate"); // ArrayList list = new ArrayList(); PreparedStatement pstmt = null; try { - pstmt = DB.prepareStatement(sql, trxName); + pstmt = DB.prepareStatement(sql.toString(), trxName); if (C_Invoice_ID != 0) pstmt.setInt(1, C_Invoice_ID); else @@ -205,9 +205,9 @@ public class MInvoicePaySchedule extends X_C_InvoicePaySchedule */ public String toString() { - StringBuffer sb = new StringBuffer("MInvoicePaySchedule["); - sb.append(get_ID()).append("-Due=" + getDueDate() + "/" + getDueAmt()) - .append(";Discount=").append(getDiscountDate() + "/" + getDiscountAmt()) + StringBuilder sb = new StringBuilder("MInvoicePaySchedule["); + sb.append(get_ID()).append("-Due=").append(getDueDate()).append("/").append(getDueAmt()) + .append(";Discount=").append(getDiscountDate()).append("/").append(getDiscountAmt()) .append("]"); return sb.toString(); } // toString diff --git a/org.adempiere.base/src/org/compiere/model/MInvoiceTax.java b/org.adempiere.base/src/org/compiere/model/MInvoiceTax.java index d1eee99490..d95309ef72 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoiceTax.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoiceTax.java @@ -248,7 +248,7 @@ public class MInvoiceTax extends X_C_InvoiceTax */ public String toString () { - StringBuffer sb = new StringBuffer ("MInvoiceTax["); + StringBuilder sb = new StringBuilder ("MInvoiceTax["); sb.append("C_Invoice_ID=").append(getC_Invoice_ID()) .append(",C_Tax_ID=").append(getC_Tax_ID()) .append(", Base=").append(getTaxBaseAmt()).append(",Tax=").append(getTaxAmt()) diff --git a/org.adempiere.base/src/org/compiere/model/MIssue.java b/org.adempiere.base/src/org/compiere/model/MIssue.java index fa51d35183..341128ff0b 100644 --- a/org.adempiere.base/src/org/compiere/model/MIssue.java +++ b/org.adempiere.base/src/org/compiere/model/MIssue.java @@ -155,7 +155,7 @@ public class MIssue extends X_AD_Issue public MIssue (LogRecord record) { this (Env.getCtx(), 0, null); - String summary = record.getMessage(); + StringBuilder summary = new StringBuilder(record.getMessage()); setSourceClassName(record.getSourceClassName()); setSourceMethodName(record.getSourceMethodName()); setLoggerName(record.getLoggerName()); @@ -163,11 +163,11 @@ public class MIssue extends X_AD_Issue if (t != null) { if (summary != null && summary.length() > 0) - summary = t.toString() + " " + summary; + summary = new StringBuilder(t.toString()).append(" ").append(summary); if (summary == null || summary.length() == 0) - summary = t.toString(); + summary = new StringBuilder(t.toString()); // - StringBuffer error = new StringBuffer(); + StringBuilder error = new StringBuilder(); StackTraceElement[] tes = t.getStackTrace(); int count = 0; for (int i = 0; i < tes.length; i++) @@ -179,9 +179,9 @@ public class MIssue extends X_AD_Issue error.append(s).append("\n"); if (count == 0) { - String source = element.getClassName() - + "." + element.getMethodName(); - setSourceClassName(source); + StringBuilder source = new StringBuilder(element.getClassName()) + .append(".").append(element.getMethodName()); + setSourceClassName(source.toString()); setLineNo(element.getLineNumber()); } count++; @@ -197,8 +197,8 @@ public class MIssue extends X_AD_Issue setStackTrace(cWriter.toString()); } if (summary == null || summary.length() == 0) - summary = "??"; - setIssueSummary(summary); + summary = new StringBuilder("??"); + setIssueSummary(summary.toString()); setRecord_ID(1); } // MIssue @@ -304,8 +304,10 @@ public class MIssue extends X_AD_Issue if (old == null || old.length() == 0) setComments (Comments); else if (!old.equals(Comments) - && old.indexOf(Comments) == -1) // something new - setComments (Comments + " | " + old); + && old.indexOf(Comments) == -1){ // something new + StringBuilder msgc = new StringBuilder(Comments).append(" | ").append(old); + setComments (msgc.toString()); + } } // addComments /** @@ -357,7 +359,7 @@ public class MIssue extends X_AD_Issue */ public String createAnswer() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); if (getA_Asset_ID() != 0) sb.append("Sign up for support at http://www.adempiere.org to receive answers."); else @@ -416,7 +418,7 @@ public class MIssue extends X_AD_Issue { if (true) return "-"; - StringBuffer parameter = new StringBuffer("?"); + StringBuilder parameter = new StringBuilder("?"); if (getRecord_ID() == 0) // don't report return "ID=0"; if (getRecord_ID() == 1) // new @@ -435,7 +437,8 @@ public class MIssue extends X_AD_Issue catch (Exception e) { log.severe(e.getLocalizedMessage()); - return "New-" + e.getLocalizedMessage(); + StringBuilder msgreturn = new StringBuilder("New-").append(e.getLocalizedMessage()); + return msgreturn.toString(); } } else // existing @@ -449,7 +452,8 @@ public class MIssue extends X_AD_Issue catch (Exception e) { log.severe(e.getLocalizedMessage()); - return "Update-" + e.getLocalizedMessage(); + StringBuilder msgreturn = new StringBuilder("Update-").append(e.getLocalizedMessage()); + return msgreturn.toString(); } } @@ -457,7 +461,7 @@ public class MIssue extends X_AD_Issue String target = "http://dev1/wstore/issueReportServlet"; try // Send GET Request { - StringBuffer urlString = new StringBuffer(target) + StringBuilder urlString = new StringBuilder(target) .append(parameter); URL url = new URL (urlString.toString()); URLConnection uc = url.openConnection(); @@ -465,15 +469,15 @@ public class MIssue extends X_AD_Issue } catch (Exception e) { - String msg = "Cannot connect to http://" + target; + StringBuilder msg = new StringBuilder("Cannot connect to http://").append(target); if (e instanceof FileNotFoundException || e instanceof ConnectException) - msg += "\nServer temporarily down - Please try again later"; + msg.append("\nServer temporarily down - Please try again later"); else { - msg += "\nCheck connection - " + e.getLocalizedMessage(); - log.log(Level.FINE, msg); + msg.append("\nCheck connection - ").append(e.getLocalizedMessage()); + log.log(Level.FINE, msg.toString()); } - return msg; + return msg.toString(); } return readResponse(in); } // report @@ -485,7 +489,7 @@ public class MIssue extends X_AD_Issue */ private String readResponse(InputStreamReader in) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); int Record_ID = 0; String ResponseText = null; String RequestDocumentNo = null; @@ -543,7 +547,7 @@ public class MIssue extends X_AD_Issue */ public String toString () { - StringBuffer sb = new StringBuffer ("MIssue["); + StringBuilder sb = new StringBuilder ("MIssue["); sb.append (get_ID()) .append ("-").append (getIssueSummary()) .append (",Record=").append (getRecord_ID()) diff --git a/org.adempiere.base/src/org/compiere/model/MIssueProject.java b/org.adempiere.base/src/org/compiere/model/MIssueProject.java index bd905b8804..b21ee35b2a 100644 --- a/org.adempiere.base/src/org/compiere/model/MIssueProject.java +++ b/org.adempiere.base/src/org/compiere/model/MIssueProject.java @@ -148,7 +148,7 @@ public class MIssueProject extends X_R_IssueProject */ public String toString () { - StringBuffer sb = new StringBuffer ("MIssueProject["); + StringBuilder sb = new StringBuilder ("MIssueProject["); sb.append (get_ID()) .append ("-").append (getName()) .append(",A_Asset_ID=").append(getA_Asset_ID()) diff --git a/org.adempiere.base/src/org/compiere/model/MIssueSystem.java b/org.adempiere.base/src/org/compiere/model/MIssueSystem.java index baa5ebf324..127d08030d 100644 --- a/org.adempiere.base/src/org/compiere/model/MIssueSystem.java +++ b/org.adempiere.base/src/org/compiere/model/MIssueSystem.java @@ -130,7 +130,7 @@ public class MIssueSystem extends X_R_IssueSystem */ public String toString () { - StringBuffer sb = new StringBuffer ("MIssueSystem["); + StringBuilder sb = new StringBuilder ("MIssueSystem["); sb.append(get_ID()) .append ("-").append (getDBAddress()) .append(",A_Asset_ID=").append(getA_Asset_ID()) diff --git a/org.adempiere.base/src/org/compiere/model/MIssueUser.java b/org.adempiere.base/src/org/compiere/model/MIssueUser.java index a621df91c6..a20b6370ca 100644 --- a/org.adempiere.base/src/org/compiere/model/MIssueUser.java +++ b/org.adempiere.base/src/org/compiere/model/MIssueUser.java @@ -133,7 +133,7 @@ public class MIssueUser extends X_R_IssueUser */ public String toString () { - StringBuffer sb = new StringBuffer ("MIssueUser["); + StringBuilder sb = new StringBuilder ("MIssueUser["); sb.append (get_ID()) .append ("-").append(getUserName()) .append(",AD_User_ID=").append(getAD_User_ID()) diff --git a/org.adempiere.base/src/org/compiere/model/MJournal.java b/org.adempiere.base/src/org/compiere/model/MJournal.java index 6dae4b1338..969c14e7fe 100644 --- a/org.adempiere.base/src/org/compiere/model/MJournal.java +++ b/org.adempiere.base/src/org/compiere/model/MJournal.java @@ -203,8 +203,10 @@ public class MJournal extends X_GL_Journal implements DocAction String desc = getDescription(); if (desc == null) setDescription(description); - else - setDescription(desc + " | " + description); + else{ + StringBuilder msgd = new StringBuilder(desc).append(" | ").append(description); + setDescription(msgd.toString()); + } } /************************************************************************** @@ -279,10 +281,10 @@ public class MJournal extends X_GL_Journal implements DocAction super.setProcessed (processed); if (get_ID() == 0) return; - String sql = "UPDATE GL_JournalLine SET Processed='" - + (processed ? "Y" : "N") - + "' WHERE GL_Journal_ID=" + getGL_Journal_ID(); - int noLine = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("UPDATE GL_JournalLine SET Processed='") + .append((processed ? "Y" : "N")) + .append("' WHERE GL_Journal_ID=").append(getGL_Journal_ID()); + int noLine = DB.executeUpdate(sql.toString(), get_TrxName()); log.fine(processed + " - Lines=" + noLine); } // setProcessed @@ -372,11 +374,11 @@ public class MJournal extends X_GL_Journal implements DocAction private boolean updateBatch() { if (getGL_JournalBatch_ID()!=0) { // idempiere 344 - nmicoud - String sql = "UPDATE GL_JournalBatch jb" - + " SET (TotalDr, TotalCr) = (SELECT COALESCE(SUM(TotalDr),0), COALESCE(SUM(TotalCr),0)" - + " FROM GL_Journal j WHERE j.IsActive='Y' AND jb.GL_JournalBatch_ID=j.GL_JournalBatch_ID) " - + "WHERE GL_JournalBatch_ID=" + getGL_JournalBatch_ID(); - int no = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("UPDATE GL_JournalBatch jb") + .append(" SET (TotalDr, TotalCr) = (SELECT COALESCE(SUM(TotalDr),0), COALESCE(SUM(TotalCr),0)") + .append(" FROM GL_Journal j WHERE j.IsActive='Y' AND jb.GL_JournalBatch_ID=j.GL_JournalBatch_ID) ") + .append("WHERE GL_JournalBatch_ID=").append(getGL_JournalBatch_ID()); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 1) log.warning("afterSave - Update Batch #" + no); return no == 1; @@ -398,7 +400,7 @@ public class MJournal extends X_GL_Journal implements DocAction } // process /** Process Message */ - private String m_processMsg = null; + private StringBuffer m_processMsg = null; /** Just Prepared Flag */ private boolean m_justPrepared = false; @@ -430,7 +432,7 @@ public class MJournal extends X_GL_Journal implements DocAction public String prepareIt() { log.info(toString()); - m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE)); if (m_processMsg != null) return DocAction.STATUS_Invalid; MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); @@ -440,14 +442,14 @@ public class MJournal extends X_GL_Journal implements DocAction if (period == null) { log.warning("No Period for " + getDateAcct()); - m_processMsg = "@PeriodNotFound@"; + m_processMsg = new StringBuffer("@PeriodNotFound@"); return DocAction.STATUS_Invalid; } // Standard Period if (period.getC_Period_ID() != getC_Period_ID() && period.isStandardPeriod()) { - m_processMsg = "@PeriodNotValid@"; + m_processMsg = new StringBuffer("@PeriodNotValid@"); return DocAction.STATUS_Invalid; } boolean open = period.isOpen(dt.getDocBaseType(), getDateAcct()); @@ -455,7 +457,7 @@ public class MJournal extends X_GL_Journal implements DocAction { log.warning(period.getName() + ": Not open for " + dt.getDocBaseType() + " (" + getDateAcct() + ")"); - m_processMsg = "@PeriodClosed@"; + m_processMsg = new StringBuffer("@PeriodClosed@"); return DocAction.STATUS_Invalid; } @@ -463,7 +465,7 @@ public class MJournal extends X_GL_Journal implements DocAction MJournalLine[] lines = getLines(true); if (lines.length == 0) { - m_processMsg = "@NoLines@"; + m_processMsg = new StringBuffer("@NoLines@"); return DocAction.STATUS_Invalid; } @@ -479,8 +481,8 @@ public class MJournal extends X_GL_Journal implements DocAction // bcahya, BF [2789319] No check of Actual, Budget, Statistical attribute if (!line.getAccountElementValue().isActive()) { - m_processMsg = "@InActiveAccount@ - @Line@=" + line.getLine() - + " - " + line.getAccountElementValue(); + m_processMsg = new StringBuffer("@InActiveAccount@ - @Line@=").append(line.getLine()) + .append(" - ").append(line.getAccountElementValue()); return DocAction.STATUS_Invalid; } @@ -491,8 +493,8 @@ public class MJournal extends X_GL_Journal implements DocAction getPostingType().equals(POSTINGTYPE_Reservation) ) { - m_processMsg = "@DocControlledError@ - @Line@=" + line.getLine() - + " - " + line.getAccountElementValue(); + m_processMsg = new StringBuffer("@DocControlledError@ - @Line@=").append(line.getLine()) + .append(" - ").append(line.getAccountElementValue()); return DocAction.STATUS_Invalid; } // @@ -500,22 +502,22 @@ public class MJournal extends X_GL_Journal implements DocAction // bcahya, BF [2789319] No check of Actual, Budget, Statistical attribute if (getPostingType().equals(POSTINGTYPE_Actual) && !line.getAccountElementValue().isPostActual()) { - m_processMsg = "@PostingTypeActualError@ - @Line@=" + line.getLine() - + " - " + line.getAccountElementValue(); + m_processMsg = new StringBuffer("@PostingTypeActualError@ - @Line@=").append(line.getLine()) + .append(" - ").append(line.getAccountElementValue()); return DocAction.STATUS_Invalid; } if (getPostingType().equals(POSTINGTYPE_Budget) && !line.getAccountElementValue().isPostBudget()) { - m_processMsg = "@PostingTypeBudgetError@ - @Line@=" + line.getLine() - + " - " + line.getAccountElementValue(); + m_processMsg = new StringBuffer("@PostingTypeBudgetError@ - @Line@=").append(line.getLine()) + .append(" - ").append(line.getAccountElementValue()); return DocAction.STATUS_Invalid; } if (getPostingType().equals(POSTINGTYPE_Statistical) && !line.getAccountElementValue().isPostStatistical()) { - m_processMsg = "@PostingTypeStatisticalError@ - @Line@=" + line.getLine() - + " - " + line.getAccountElementValue(); + m_processMsg = new StringBuffer("@PostingTypeStatisticalError@ - @Line@=").append(line.getLine()) + .append(" - ").append(line.getAccountElementValue()); return DocAction.STATUS_Invalid; } // end BF [2789319] No check of Actual, Budget, Statistical attribute @@ -530,7 +532,7 @@ public class MJournal extends X_GL_Journal implements DocAction if (Env.ZERO.compareTo(getControlAmt()) != 0 && getControlAmt().compareTo(getTotalDr()) != 0) { - m_processMsg = "@ControlAmtError@"; + m_processMsg = new StringBuffer("@ControlAmtError@"); return DocAction.STATUS_Invalid; } @@ -540,7 +542,7 @@ public class MJournal extends X_GL_Journal implements DocAction MAcctSchemaGL gl = MAcctSchemaGL.get(getCtx(), getC_AcctSchema_ID()); if (gl == null || !gl.isUseSuspenseBalancing()) { - m_processMsg = "@UnbalancedJornal@"; + m_processMsg = new StringBuffer("@UnbalancedJornal@"); return DocAction.STATUS_Invalid; } } @@ -548,7 +550,7 @@ public class MJournal extends X_GL_Journal implements DocAction if (!DOCACTION_Complete.equals(getDocAction())) setDocAction(DOCACTION_Complete); - m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE)); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -592,7 +594,7 @@ public class MJournal extends X_GL_Journal implements DocAction return status; } - m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE)); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -604,7 +606,7 @@ public class MJournal extends X_GL_Journal implements DocAction String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE); if (valid != null) { - m_processMsg = valid; + m_processMsg = new StringBuffer(valid); return DocAction.STATUS_Invalid; } @@ -644,7 +646,7 @@ public class MJournal extends X_GL_Journal implements DocAction { log.info(toString()); // Before Void - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID)); if (m_processMsg != null) return false; @@ -660,7 +662,7 @@ public class MJournal extends X_GL_Journal implements DocAction } // After Void - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID)); if (m_processMsg != null) return false; @@ -676,7 +678,7 @@ public class MJournal extends X_GL_Journal implements DocAction { log.info(toString()); // Before Close - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE)); if (m_processMsg != null) return false; @@ -691,7 +693,7 @@ public class MJournal extends X_GL_Journal implements DocAction } // After Close - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE)); if (m_processMsg != null) return false; @@ -706,7 +708,7 @@ public class MJournal extends X_GL_Journal implements DocAction public boolean reverseCorrectIt() { // Before reverseCorrect - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT)); if (m_processMsg != null) return false; @@ -716,7 +718,7 @@ public class MJournal extends X_GL_Journal implements DocAction return false; // After reverseCorrect - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT)); if (m_processMsg != null) return false; @@ -739,12 +741,14 @@ public class MJournal extends X_GL_Journal implements DocAction reverse.setC_Period_ID(getC_Period_ID()); reverse.setDateAcct(getDateAcct()); // Reverse indicator - reverse.addDescription("(->" + getDocumentNo() + ")"); + StringBuilder msgd = new StringBuilder("(->").append(getDocumentNo()).append(")"); + reverse.addDescription(msgd.toString()); //FR [ 1948157 ] reverse.setReversal_ID(getGL_Journal_ID()); if (!reverse.save()) return null; - addDescription("(" + reverse.getDocumentNo() + "<-)"); + msgd = new StringBuilder("(").append(reverse.getDocumentNo()).append("<-)"); + addDescription(msgd.toString()); // Lines reverse.copyLinesFrom(this, null, 'C'); @@ -764,7 +768,7 @@ public class MJournal extends X_GL_Journal implements DocAction public boolean reverseAccrualIt() { // Before reverseAccrual - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL)); if (m_processMsg != null) return false; @@ -774,7 +778,7 @@ public class MJournal extends X_GL_Journal implements DocAction return false; // After reverseAccrual - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL)); if (m_processMsg != null) return false; @@ -797,12 +801,12 @@ public class MJournal extends X_GL_Journal implements DocAction reverse.set_ValueNoCheck ("C_Period_ID", null); // reset reverse.setDateAcct(reverse.getDateDoc()); // Reverse indicator - String description = reverse.getDescription(); - if (description == null) - description = "** " + getDocumentNo() + " **"; + StringBuilder description ; + if (reverse.getDescription() == null) + description = new StringBuilder("** ").append(getDocumentNo()).append(" **"); else - description += " ** " + getDocumentNo() + " **"; - reverse.setDescription(description); + description = new StringBuilder(reverse.getDescription()).append(" ** ").append(getDocumentNo()).append(" **"); + reverse.setDescription(description.toString()); if (!reverse.save()) return null; @@ -822,7 +826,7 @@ public class MJournal extends X_GL_Journal implements DocAction { log.info(toString()); // Before reActivate - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE)); if (m_processMsg != null) return false; @@ -834,7 +838,7 @@ public class MJournal extends X_GL_Journal implements DocAction setDocAction(DOCACTION_Complete); // After reActivate - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE)); if (m_processMsg != null) return false; @@ -848,7 +852,7 @@ public class MJournal extends X_GL_Journal implements DocAction */ public String getSummary() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append(getDocumentNo()); // : Total Lines = 123.00 (#1) sb.append(": ") @@ -868,7 +872,7 @@ public class MJournal extends X_GL_Journal implements DocAction */ public String toString () { - StringBuffer sb = new StringBuffer ("MJournal["); + StringBuilder sb = new StringBuilder ("MJournal["); sb.append(get_ID()).append(",").append(getDescription()) .append(",DR=").append(getTotalDr()) .append(",CR=").append(getTotalCr()) @@ -883,7 +887,8 @@ public class MJournal extends X_GL_Journal implements DocAction public String getDocumentInfo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); - return dt.getName() + " " + getDocumentNo(); + StringBuilder msgreturn = new StringBuilder(dt.getName()).append(" ").append(getDocumentNo()); + return msgreturn.toString(); } // getDocumentInfo /** @@ -894,7 +899,8 @@ public class MJournal extends X_GL_Journal implements DocAction { try { - File temp = File.createTempFile(get_TableName()+get_ID()+"_", ".pdf"); + StringBuilder msgfile = new StringBuilder(get_TableName()).append(get_ID()).append("_"); + File temp = File.createTempFile(msgfile.toString(), ".pdf"); return createPDF (temp); } catch (Exception e) @@ -924,7 +930,7 @@ public class MJournal extends X_GL_Journal implements DocAction */ public String getProcessMsg() { - return m_processMsg; + return m_processMsg.toString(); } // getProcessMsg /** diff --git a/org.adempiere.base/src/org/compiere/model/MJournalBatch.java b/org.adempiere.base/src/org/compiere/model/MJournalBatch.java index f9085c4a67..2d828d2835 100644 --- a/org.adempiere.base/src/org/compiere/model/MJournalBatch.java +++ b/org.adempiere.base/src/org/compiere/model/MJournalBatch.java @@ -280,7 +280,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction } // process /** Process Message */ - private String m_processMsg = null; + private StringBuffer m_processMsg = null; /** Just Prepared Flag */ private boolean m_justPrepared = false; @@ -312,7 +312,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction public String prepareIt() { log.info(toString()); - m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE)); if (m_processMsg != null) return DocAction.STATUS_Invalid; MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); @@ -320,7 +320,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction // Std Period open? if (!MPeriod.isOpen(getCtx(), getDateAcct(), dt.getDocBaseType(), getAD_Org_ID())) { - m_processMsg = "@PeriodClosed@"; + m_processMsg = new StringBuffer("@PeriodClosed@"); return DocAction.STATUS_Invalid; } @@ -328,7 +328,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction MJournal[] journals = getJournals(false); if (journals.length == 0) { - m_processMsg = "@NoLines@"; + m_processMsg = new StringBuffer("@NoLines@"); return DocAction.STATUS_Invalid; } @@ -352,7 +352,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction { journal.setDocStatus(status); journal.saveEx(); - m_processMsg = journal.getProcessMsg(); + m_processMsg = new StringBuffer(journal.getProcessMsg()); return status; } journal.setDocStatus(DOCSTATUS_InProgress); @@ -369,7 +369,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction if (Env.ZERO.compareTo(getControlAmt()) != 0 && getControlAmt().compareTo(getTotalDr()) != 0) { - m_processMsg = "@ControlAmtError@"; + m_processMsg = new StringBuffer("@ControlAmtError@"); return DocAction.STATUS_Invalid; } @@ -398,7 +398,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction } } - m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE)); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -444,7 +444,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction return status; } - m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE)); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -481,7 +481,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction journal.saveEx(); if (!DocAction.STATUS_Completed.equals(journal.getDocStatus())) { - m_processMsg = journal.getProcessMsg(); + m_processMsg = new StringBuffer(journal.getProcessMsg()); return journal.getDocStatus(); } } @@ -495,7 +495,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE); if (valid != null) { - m_processMsg = valid; + m_processMsg = new StringBuffer(valid); return DocAction.STATUS_Invalid; } @@ -531,11 +531,11 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction { log.info("voidIt - " + toString()); // Before Void - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID)); if (m_processMsg != null) return false; // After Void - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID)); if (m_processMsg != null) return false; @@ -550,7 +550,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction { log.info("closeIt - " + toString()); // Before Close - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE)); if (m_processMsg != null) return false; @@ -570,7 +570,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction || DOCSTATUS_InProgress.equals(journal.getDocStatus()) || DOCSTATUS_Invalid.equals(journal.getDocStatus())) { - m_processMsg = "Journal not Completed: " + journal.getSummary(); + m_processMsg = new StringBuffer("Journal not Completed: ").append(journal.getSummary()); return false; } @@ -583,14 +583,14 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction { if (!journal.closeIt()) { - m_processMsg = "Cannot close: " + journal.getSummary(); + m_processMsg = new StringBuffer("Cannot close: ").append(journal.getSummary()); return false; } journal.saveEx(); } } // After Close - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE)); if (m_processMsg != null) return false; @@ -606,7 +606,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction { log.info("reverseCorrectIt - " + toString()); // Before reverseCorrect - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT)); if (m_processMsg != null) return false; @@ -622,7 +622,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction ; else { - m_processMsg = "All Journals need to be Completed: " + journal.getSummary(); + m_processMsg = new StringBuffer("All Journals need to be Completed: ").append(journal.getSummary()); return false; } } @@ -633,12 +633,12 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction reverse.setC_Period_ID(getC_Period_ID()); reverse.setDateAcct(getDateAcct()); // Reverse indicator - String description = reverse.getDescription(); - if (description == null) - description = "** " + getDocumentNo() + " **"; + StringBuilder description ; + if (reverse.getDescription() == null) + description = new StringBuilder("** ").append(getDocumentNo()).append(" **"); else - description += " ** " + getDocumentNo() + " **"; - reverse.setDescription(description); + description = new StringBuilder(reverse.getDescription()).append(" ** ").append(getDocumentNo()).append(" **"); + reverse.setDescription(description.toString()); //[ 1948157 ] reverse.setReversal_ID(getGL_JournalBatch_ID()); reverse.saveEx(); @@ -652,7 +652,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction continue; if (journal.reverseCorrectIt(reverse.getGL_JournalBatch_ID()) == null) { - m_processMsg = "Could not reverse " + journal; + m_processMsg = new StringBuffer("Could not reverse ").append(journal); return false; } journal.saveEx(); @@ -662,7 +662,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction setReversal_ID(reverse.getGL_JournalBatch_ID()); saveEx(); // After reverseCorrect - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT)); if (m_processMsg != null) return false; @@ -678,7 +678,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction { log.info("reverseAccrualIt - " + toString()); // Before reverseAccrual - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL)); if (m_processMsg != null) return false; @@ -694,7 +694,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction ; else { - m_processMsg = "All Journals need to be Completed: " + journal.getSummary(); + m_processMsg = new StringBuffer("All Journals need to be Completed: ").append(journal.getSummary()); return false; } } @@ -704,12 +704,12 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction reverse.setDateDoc(new Timestamp(System.currentTimeMillis())); reverse.setDateAcct(reverse.getDateDoc()); // Reverse indicator - String description = reverse.getDescription(); - if (description == null) - description = "** " + getDocumentNo() + " **"; + StringBuilder description; + if (reverse.getDescription() == null) + description = new StringBuilder("** ").append(getDocumentNo()).append(" **"); else - description += " ** " + getDocumentNo() + " **"; - reverse.setDescription(description); + description = new StringBuilder(reverse.getDescription()).append(" ** ").append(getDocumentNo()).append(" **"); + reverse.setDescription(description.toString()); reverse.saveEx(); // Reverse Journals @@ -720,13 +720,13 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction continue; if (journal.reverseAccrualIt(reverse.getGL_JournalBatch_ID()) == null) { - m_processMsg = "Could not reverse " + journal; + m_processMsg = new StringBuffer("Could not reverse ").append(journal); return false; } journal.saveEx(); } // After reverseAccrual - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL)); if (m_processMsg != null) return false; @@ -742,7 +742,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction log.info("reActivateIt - " + toString()); // Before reActivate - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE)); if (m_processMsg != null) return false; @@ -764,7 +764,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction setDocAction(DOCACTION_Complete); // After reActivate - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE); + m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE)); if (m_processMsg != null) return false; @@ -778,7 +778,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction */ public String getSummary() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append(getDocumentNo()); // : Total Lines = 123.00 (#1) sb.append(": ") @@ -798,7 +798,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction */ public String toString () { - StringBuffer sb = new StringBuffer ("MJournalBatch["); + StringBuilder sb = new StringBuilder ("MJournalBatch["); sb.append(get_ID()).append(",").append(getDescription()) .append(",DR=").append(getTotalDr()) .append(",CR=").append(getTotalCr()) @@ -813,7 +813,8 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction public String getDocumentInfo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); - return dt.getName() + " " + getDocumentNo(); + StringBuilder msgreturn = new StringBuilder(dt.getName()).append(" ").append(getDocumentNo()); + return msgreturn.toString(); } // getDocumentInfo /** @@ -824,7 +825,8 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction { try { - File temp = File.createTempFile(get_TableName()+get_ID()+"_", ".pdf"); + StringBuilder msgfile = new StringBuilder(get_TableName()).append(get_ID()).append("_"); + File temp = File.createTempFile(msgfile.toString(), ".pdf"); return createPDF (temp); } catch (Exception e) @@ -854,7 +856,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction */ public String getProcessMsg() { - return m_processMsg; + return m_processMsg.toString(); } // getProcessMsg /** diff --git a/org.adempiere.base/src/org/compiere/model/MJournalLine.java b/org.adempiere.base/src/org/compiere/model/MJournalLine.java index 08d2af1aa4..4f05c677d3 100644 --- a/org.adempiere.base/src/org/compiere/model/MJournalLine.java +++ b/org.adempiere.base/src/org/compiere/model/MJournalLine.java @@ -357,24 +357,24 @@ public class MJournalLine extends X_GL_JournalLine private boolean updateJournalTotal() { // Update Journal Total - String sql = "UPDATE GL_Journal j" - + " SET (TotalDr, TotalCr) = (SELECT COALESCE(SUM(AmtAcctDr),0), COALESCE(SUM(AmtAcctCr),0)" // croo Bug# 1789935 - + " FROM GL_JournalLine jl WHERE jl.IsActive='Y' AND j.GL_Journal_ID=jl.GL_Journal_ID) " - + "WHERE GL_Journal_ID=" + getGL_Journal_ID(); - int no = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("UPDATE GL_Journal j") + .append(" SET (TotalDr, TotalCr) = (SELECT COALESCE(SUM(AmtAcctDr),0), COALESCE(SUM(AmtAcctCr),0)") // croo Bug# 1789935 + .append(" FROM GL_JournalLine jl WHERE jl.IsActive='Y' AND j.GL_Journal_ID=jl.GL_Journal_ID) ") + .append("WHERE GL_Journal_ID=").append(getGL_Journal_ID()); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 1) log.warning("afterSave - Update Journal #" + no); // Update Batch Total int GL_JournalBatch_ID=DB.getSQLValue(get_TrxName(), "SELECT GL_JournalBatch_ID FROM GL_Journal WHERE GL_Journal_ID=?", getGL_Journal_ID()); if (GL_JournalBatch_ID!=0) { // idempiere 344 - nmicoud - sql = "UPDATE GL_JournalBatch jb" - + " SET (TotalDr, TotalCr) = (SELECT COALESCE(SUM(TotalDr),0), COALESCE(SUM(TotalCr),0)" - + " FROM GL_Journal j WHERE jb.GL_JournalBatch_ID=j.GL_JournalBatch_ID) " - + "WHERE GL_JournalBatch_ID=" - + "(SELECT DISTINCT GL_JournalBatch_ID FROM GL_Journal WHERE GL_Journal_ID=" - + getGL_Journal_ID() + ")"; - no = DB.executeUpdate(sql, get_TrxName()); + sql = new StringBuilder("UPDATE GL_JournalBatch jb") + .append(" SET (TotalDr, TotalCr) = (SELECT COALESCE(SUM(TotalDr),0), COALESCE(SUM(TotalCr),0)") + .append(" FROM GL_Journal j WHERE jb.GL_JournalBatch_ID=j.GL_JournalBatch_ID) ") + .append("WHERE GL_JournalBatch_ID=") + .append("(SELECT DISTINCT GL_JournalBatch_ID FROM GL_Journal WHERE GL_Journal_ID=") + .append(getGL_Journal_ID()).append(")"); + no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 1) log.warning("Update Batch #" + no); } diff --git a/org.adempiere.base/src/org/compiere/model/MLandedCost.java b/org.adempiere.base/src/org/compiere/model/MLandedCost.java index 3e5c873df2..65025d78bb 100644 --- a/org.adempiere.base/src/org/compiere/model/MLandedCost.java +++ b/org.adempiere.base/src/org/compiere/model/MLandedCost.java @@ -155,7 +155,7 @@ public class MLandedCost extends X_C_LandedCost */ public String toString () { - StringBuffer sb = new StringBuffer ("MLandedCost["); + StringBuilder sb = new StringBuilder ("MLandedCost["); sb.append (get_ID ()) .append (",CostDistribution=").append (getLandedCostDistribution()) .append(",M_CostElement_ID=").append(getM_CostElement_ID()); diff --git a/org.adempiere.base/src/org/compiere/model/MLdapProcessor.java b/org.adempiere.base/src/org/compiere/model/MLdapProcessor.java index 188ed74263..ce5b5a8a71 100755 --- a/org.adempiere.base/src/org/compiere/model/MLdapProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/MLdapProcessor.java @@ -121,8 +121,9 @@ public class MLdapProcessor extends X_AD_LdapProcessor implements AdempiereProce */ public String getInfo() { - return "Auth=" + m_auth - + ", OK=" + m_ok + ", Error=" + m_error; + StringBuilder msgreturn = new StringBuilder("Auth=").append(m_auth) + .append(", OK=").append(m_ok).append(", Error=").append(m_error); + return msgreturn.toString(); } // getInfo /** @@ -180,10 +181,10 @@ public class MLdapProcessor extends X_AD_LdapProcessor implements AdempiereProce { if (getKeepLogDays() < 1) return 0; - String sql = "DELETE AD_LdapProcessorLog " - + "WHERE AD_LdapProcessor_ID=" + getAD_LdapProcessor_ID() - + " AND (Created+" + getKeepLogDays() + ") < SysDate"; - int no = DB.executeUpdate(sql, get_TrxName()); + StringBuilder sql = new StringBuilder("DELETE AD_LdapProcessorLog ") + .append("WHERE AD_LdapProcessor_ID=").append(getAD_LdapProcessor_ID()) + .append(" AND (Created+").append(getKeepLogDays()).append(") < SysDate"); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); return no; } // deleteLog @@ -211,7 +212,7 @@ public class MLdapProcessor extends X_AD_LdapProcessor implements AdempiereProce */ public String toString() { - StringBuffer sb = new StringBuffer ("MLdapProcessor["); + StringBuilder sb = new StringBuilder ("MLdapProcessor["); sb.append (get_ID()).append ("-").append (getName()) .append (",Port=").append (getLdapPort()) .append ("]"); @@ -233,35 +234,35 @@ public class MLdapProcessor extends X_AD_LdapProcessor implements AdempiereProce if (ldapUser == null) ldapUser = new MLdapUser(); - String error = null; - String info = null; + StringBuilder error = null; + StringBuilder info = null; // User if (usr == null || usr.trim().length () == 0) { - error = "@NotFound@ User"; - ldapUser.setErrorString(error); + error = new StringBuilder("@NotFound@ User"); + ldapUser.setErrorString(error.toString()); m_error++; - log.warning (error); + log.warning (error.toString()); return ldapUser; } usr = usr.trim(); // Client if (o == null || o.length () == 0) { - error = "@NotFound@ O"; - ldapUser.setErrorString(error); + error = new StringBuilder("@NotFound@ O"); + ldapUser.setErrorString(error.toString()); m_error++; - log.warning (error); + log.warning (error.toString()); return ldapUser; } int AD_Client_ID = findClient(o); if (AD_Client_ID == 0) { - error = "@NotFound@ O=" + o; - ldapUser.setErrorString(error); + error = new StringBuilder("@NotFound@ O=").append(o); + ldapUser.setErrorString(error.toString()); m_error++; - log.config (error); + log.config (error.toString()); return ldapUser; } // Optional Interest Area @@ -271,10 +272,10 @@ public class MLdapProcessor extends X_AD_LdapProcessor implements AdempiereProce R_InterestArea_ID = findInterestArea (AD_Client_ID, ou); if (R_InterestArea_ID == 0) { - error = "@NotFound@ OU=" + ou; - ldapUser.setErrorString(error); + error = new StringBuilder("@NotFound@ OU=").append(ou); + ldapUser.setErrorString(error.toString()); m_error++; - log.config (error); + log.config (error.toString()); return ldapUser; } } @@ -322,7 +323,7 @@ public class MLdapProcessor extends X_AD_LdapProcessor implements AdempiereProce catch (Exception e) { log.log (Level.SEVERE, sql, e); - error = "System Error"; + error = new StringBuilder("System Error"); } finally { @@ -332,51 +333,51 @@ public class MLdapProcessor extends X_AD_LdapProcessor implements AdempiereProce if (error != null) { m_error++; - ldapUser.setErrorString(error); + ldapUser.setErrorString(error.toString()); return ldapUser; } // if (AD_User_ID == 0) { - error = "@NotFound@ User=" + usr; - info = "User not found - " + usr; + error = new StringBuilder("@NotFound@ User=").append(usr); + info = new StringBuilder("User not found - ").append(usr); } else if (!IsActive) { - error = "@NotFound@ User=" + usr; - info = "User not active - " + usr; + error = new StringBuilder("@NotFound@ User=").append(usr); + info = new StringBuilder("User not active - ").append(usr); } else if (EMailVerify == null) { - error = "@UserNotVerified@ User=" + usr; - info = "User EMail not verified - " + usr; + error = new StringBuilder("@UserNotVerified@ User=").append(usr); + info = new StringBuilder("User EMail not verified - ").append(usr); } else if (usr.equalsIgnoreCase(LdapUser)) - info = "User verified - Ldap=" + usr - + (isUnique ? "" : " - Not Unique"); + info = new StringBuilder("User verified - Ldap=").append(usr) + .append((isUnique ? "" : " - Not Unique")); else if (usr.equalsIgnoreCase(Value)) - info = "User verified - Value=" + usr - + (isUnique ? "" : " - Not Unique"); + info = new StringBuilder("User verified - Value=").append(usr) + .append((isUnique ? "" : " - Not Unique")); else if (usr.equalsIgnoreCase(EMail)) - info = "User verified - EMail=" + usr - + (isUnique ? "" : " - Not Unique"); + info = new StringBuilder("User verified - EMail=").append(usr) + .append((isUnique ? "" : " - Not Unique")); else - info = "User verified ?? " + usr - + " - Name=" + Name - + ", Ldap=" + LdapUser + ", Value=" + Value - + (isUnique ? "" : " - Not Unique"); + info = new StringBuilder("User verified ?? ").append(usr) + .append(" - Name=").append(Name) + .append(", Ldap=").append(LdapUser).append(", Value=").append(Value) + .append((isUnique ? "" : " - Not Unique")); // Error if (error != null) // should use Language of the User { - logAccess (AD_Client_ID, AD_User_ID, R_InterestArea_ID, info, error); - ldapUser.setErrorString(Msg.translate (getCtx(), error)); + logAccess (AD_Client_ID, AD_User_ID, R_InterestArea_ID, info.toString(), error.toString()); + ldapUser.setErrorString(Msg.translate (getCtx(), error.toString())); return ldapUser; } // Done if (R_InterestArea_ID == 0) { - logAccess (AD_Client_ID, AD_User_ID, R_InterestArea_ID, info, null); + logAccess (AD_Client_ID, AD_User_ID, R_InterestArea_ID, info.toString(), null); ldapUser.setOrg(o); ldapUser.setOrgUnit(ou); ldapUser.setUserId(usr); @@ -407,7 +408,7 @@ public class MLdapProcessor extends X_AD_LdapProcessor implements AdempiereProce catch (Exception e) { log.log (Level.SEVERE, sql, e); - error = "System Error (2)"; + error = new StringBuilder("System Error (2)"); } finally { @@ -418,38 +419,38 @@ public class MLdapProcessor extends X_AD_LdapProcessor implements AdempiereProce if (error != null) { m_error++; - ldapUser.setErrorString(error); + ldapUser.setErrorString(error.toString()); return ldapUser; } if (!found) { - error = "@UserNotSubscribed@ User=" + usr; - info = "No User Interest - " + usr - + " - R_InterestArea_ID=" + R_InterestArea_ID; + error = new StringBuilder("@UserNotSubscribed@ User=").append(usr); + info = new StringBuilder("No User Interest - ").append(usr) + .append(" - R_InterestArea_ID=").append(R_InterestArea_ID); } else if (OptOutDate != null) { - error = "@UserNotSubscribed@ User=" + usr + " @OptOutDate@=" + OptOutDate; - info = "Opted out - " + usr + " - OptOutDate=" + OptOutDate; + error = new StringBuilder("@UserNotSubscribed@ User=").append(usr).append(" @OptOutDate@=").append(OptOutDate); + info = new StringBuilder("Opted out - ").append(usr).append(" - OptOutDate=").append(OptOutDate); } else if (!IsActive) { - error = "@UserNotSubscribed@ User=" + usr; - info = "User Interest Not Active - " + usr; + error = new StringBuilder("@UserNotSubscribed@ User=").append(usr); + info = new StringBuilder("User Interest Not Active - ").append(usr); } else - info = "User subscribed - " + usr; + info = new StringBuilder("User subscribed - ").append(usr); if (error != null) // should use Language of the User { - logAccess (AD_Client_ID, AD_User_ID, R_InterestArea_ID, info, error); - ldapUser.setErrorString(Msg.translate (getCtx(), error)); + logAccess (AD_Client_ID, AD_User_ID, R_InterestArea_ID, info.toString(), error.toString()); + ldapUser.setErrorString(Msg.translate (getCtx(), error.toString())); return ldapUser; } // Done - logAccess (AD_Client_ID, AD_User_ID, R_InterestArea_ID, info, null); + logAccess (AD_Client_ID, AD_User_ID, R_InterestArea_ID, info.toString(), null); ldapUser.setOrg(o); ldapUser.setOrgUnit(ou); ldapUser.setUserId(usr); diff --git a/org.adempiere.base/src/org/compiere/model/MLocation.java b/org.adempiere.base/src/org/compiere/model/MLocation.java index d49e9d0c5d..5e12ed88dd 100644 --- a/org.adempiere.base/src/org/compiere/model/MLocation.java +++ b/org.adempiere.base/src/org/compiere/model/MLocation.java @@ -453,7 +453,7 @@ public class MLocation extends X_C_Location implements Comparator boolean local = getC_Country_ID() == MCountry.getDefault(getCtx()).getC_Country_ID(); String inStr = local ? c.getDisplaySequenceLocal() : c.getDisplaySequence(); - StringBuffer outStr = new StringBuffer(); + StringBuilder outStr = new StringBuilder(); String token; int i = inStr.indexOf('@'); @@ -519,7 +519,7 @@ public class MLocation extends X_C_Location implements Comparator */ public String toString() { - StringBuffer retStr = new StringBuffer(); + StringBuilder retStr = new StringBuilder(); if (isAddressLinesReverse()) { // City, Region, Postal @@ -556,7 +556,7 @@ public class MLocation extends X_C_Location implements Comparator */ public String toStringCR() { - StringBuffer retStr = new StringBuffer(); + StringBuilder retStr = new StringBuilder(); if (isAddressLinesReverse()) { // City, Region, Postal @@ -593,7 +593,7 @@ public class MLocation extends X_C_Location implements Comparator */ public String toStringX() { - StringBuffer sb = new StringBuffer("MLocation=["); + StringBuilder sb = new StringBuilder("MLocation=["); sb.append(get_ID()) .append(",C_Country_ID=").append(getC_Country_ID()) .append(",C_Region_ID=").append(getC_Region_ID()) @@ -650,10 +650,12 @@ public class MLocation extends X_C_Location implements Comparator && ("Y".equals(Env.getContext(getCtx(), "$Element_LF")) || "Y".equals(Env.getContext(getCtx(), "$Element_LT"))) && (is_ValueChanged("Postal") || is_ValueChanged("City")) - ) - MAccount.updateValueDescription(getCtx(), - "(C_LocFrom_ID=" + getC_Location_ID() - + " OR C_LocTo_ID=" + getC_Location_ID() + ")", get_TrxName()); + ){ + StringBuilder msgup = new StringBuilder( + "(C_LocFrom_ID=").append(getC_Location_ID()) + .append(" OR C_LocTo_ID=").append(getC_Location_ID()).append(")"); + MAccount.updateValueDescription(getCtx(), msgup.toString(), get_TrxName()); + } //Update BP_Location name IDEMPIERE 417 if (get_TrxName().startsWith(PO.LOCAL_TRX_PREFIX)) { // saved without trx @@ -676,14 +678,14 @@ public class MLocation extends X_C_Location implements Comparator public String getMapsLocation() { MRegion region = new MRegion(Env.getCtx(), getC_Region_ID(), get_TrxName()); - String address = ""; - address = address + (getAddress1() != null ? getAddress1() + ", " : ""); - address = address + (getAddress2() != null ? getAddress2() + ", " : ""); - address = address + (getCity() != null ? getCity() + ", " : ""); - address = address + (region.getName() != null ? region.getName() + ", " : ""); - address = address + (getCountryName() != null ? getCountryName() : ""); + StringBuilder address = new StringBuilder(); + address.append((getAddress1() != null ? getAddress1() + ", " : "")); + address.append((getAddress2() != null ? getAddress2() + ", " : "")); + address.append((getCity() != null ? getCity() + ", " : "")); + address.append((region.getName() != null ? region.getName() + ", " : "")); + address.append((getCountryName() != null ? getCountryName() : "")); - return address.replace(" ", "+"); + return address.toString().replace(" ", "+"); } } // MLocation diff --git a/org.adempiere.base/src/org/compiere/model/MLocationLookup.java b/org.adempiere.base/src/org/compiere/model/MLocationLookup.java index 34fb33ac8d..85f3b3286d 100644 --- a/org.adempiere.base/src/org/compiere/model/MLocationLookup.java +++ b/org.adempiere.base/src/org/compiere/model/MLocationLookup.java @@ -63,8 +63,10 @@ public final class MLocationLookup extends Lookup if (value == null) return null; MLocation loc = getLocation (value, null); - if (loc == null) - return "<" + value.toString() + ">"; + if (loc == null){ + StringBuilder msgreturn = new StringBuilder("<").append(value.toString()).append(">"); + return msgreturn.toString(); + } return loc.toString(); } // getDisplay diff --git a/org.adempiere.base/src/org/compiere/model/MLocator.java b/org.adempiere.base/src/org/compiere/model/MLocator.java index c9c7d6ee7d..7337e70a91 100644 --- a/org.adempiere.base/src/org/compiere/model/MLocator.java +++ b/org.adempiere.base/src/org/compiere/model/MLocator.java @@ -269,8 +269,10 @@ public class MLocator extends X_M_Locator public String getWarehouseName() { MWarehouse wh = MWarehouse.get(getCtx(), getM_Warehouse_ID()); - if (wh.get_ID() == 0) - return "<" + getM_Warehouse_ID() + ">"; + if (wh.get_ID() == 0){ + StringBuilder msgreturn = new StringBuilder("<").append(getM_Warehouse_ID()).append(">"); + return msgreturn.toString(); + } return wh.getName(); } // getWarehouseName diff --git a/org.adempiere.base/src/org/compiere/model/MLocatorLookup.java b/org.adempiere.base/src/org/compiere/model/MLocatorLookup.java index 9eaf2f47ee..608c046b78 100644 --- a/org.adempiere.base/src/org/compiere/model/MLocatorLookup.java +++ b/org.adempiere.base/src/org/compiere/model/MLocatorLookup.java @@ -191,8 +191,10 @@ public final class MLocatorLookup extends Lookup implements Serializable return ""; // NamePair display = get (value); - if (display == null) - return "<" + value.toString() + ">"; + if (display == null){ + StringBuilder msgreturn = new StringBuilder("<").append(value.toString()).append(">"); + return msgreturn.toString(); + } return display.toString(); } // getDisplay @@ -256,7 +258,8 @@ public final class MLocatorLookup extends Lookup implements Serializable */ public String toString() { - return "MLocatorLookup[Size=" + m_lookup.size() + "]"; + StringBuilder msgreturn = new StringBuilder("MLocatorLookup[Size=").append(m_lookup.size()).append("]"); + return msgreturn.toString(); } // toString @@ -320,7 +323,7 @@ public final class MLocatorLookup extends Lookup implements Serializable int local_only_warehouse_id = getOnly_Warehouse_ID(); // [ 1674891 ] MLocatorLookup - weird error int local_only_product_id = getOnly_Product_ID(); - StringBuffer sql = new StringBuffer("SELECT * FROM M_Locator ") + StringBuilder sql = new StringBuilder("SELECT * FROM M_Locator ") .append(" WHERE IsActive='Y'"); if (local_only_warehouse_id != 0) diff --git a/org.adempiere.base/src/org/compiere/model/MLookup.java b/org.adempiere.base/src/org/compiere/model/MLookup.java index b1b6fe7d2b..420002054f 100644 --- a/org.adempiere.base/src/org/compiere/model/MLookup.java +++ b/org.adempiere.base/src/org/compiere/model/MLookup.java @@ -223,8 +223,10 @@ public final class MLookup extends Lookup implements Serializable return ""; // Object display = get (key); - if (display == null) - return "<" + key.toString() + ">"; + if (display == null){ + StringBuilder msgreturn = new StringBuilder("<").append(key.toString()).append(">"); + return msgreturn.toString(); + } return display.toString(); } // getDisplay @@ -251,10 +253,11 @@ public final class MLookup extends Lookup implements Serializable */ public String toString() { - return "MLookup[" + m_info.KeyColumn + ",Column_ID=" + m_info.Column_ID - + ",Size=" + m_lookup.size() + ",Validated=" + isValidated() - + "-" + getValidation() - + "]"; + StringBuilder msgreturn = new StringBuilder("MLookup[").append(m_info.KeyColumn).append(",Column_ID=").append(m_info.Column_ID) + .append(",Size=").append(m_lookup.size()).append(",Validated=").append(isValidated()) + .append("-").append(getValidation()) + .append("]"); + return msgreturn.toString(); } // toString /** @@ -665,7 +668,7 @@ public final class MLookup extends Lookup implements Serializable long startTime = System.currentTimeMillis(); if (Ini.isClient()) MLookupCache.loadStart (m_info); - String sql = m_info.Query; + StringBuilder sql = new StringBuilder(m_info.Query); // not validated if (!m_info.IsValidated) @@ -692,14 +695,13 @@ public final class MLookup extends Lookup implements Serializable // int posOrder = sql.lastIndexOf(" ORDER BY "); if (posOrder != -1) - sql = sql.substring(0, posOrder) - + (hasWhere ? " AND " : " WHERE ") - + validation - + sql.substring(posOrder); + sql = new StringBuilder(sql.substring(0, posOrder)) + .append((hasWhere ? " AND " : " WHERE ")) + .append(validation) + .append(sql.substring(posOrder)); else - sql += (hasWhere ? " AND " : " WHERE ") - - + validation; + sql.append((hasWhere ? " AND " : " WHERE ")) + .append(validation); if (CLogMgt.isLevelFinest()) log.fine(m_info.KeyColumn + ": Validation=" + validation); } @@ -712,7 +714,7 @@ public final class MLookup extends Lookup implements Serializable } // if (CLogMgt.isLevelFiner()) - Env.setContext(m_info.ctx, Env.WINDOW_MLOOKUP, m_info.Column_ID, m_info.KeyColumn, sql); + Env.setContext(m_info.ctx, Env.WINDOW_MLOOKUP, m_info.Column_ID, m_info.KeyColumn, sql.toString()); if (CLogMgt.isLevelFinest()) log.fine(m_info.KeyColumn + ": " + sql); @@ -726,7 +728,7 @@ public final class MLookup extends Lookup implements Serializable try { // SELECT Key, Value, Name, IsActive FROM ... - pstmt = DB.prepareStatement(sql, null); + pstmt = DB.prepareStatement(sql.toString(), null); rs = pstmt.executeQuery(); // Get first ... rows @@ -735,16 +737,16 @@ public final class MLookup extends Lookup implements Serializable { if (rows++ > MAX_ROWS) { - String s = m_info.KeyColumn + ": Loader - Too many records"; + StringBuilder s = new StringBuilder(m_info.KeyColumn).append(": Loader - Too many records"); if (m_info.Column_ID > 0) { MColumn mColumn = MColumn.get(m_info.ctx, m_info.Column_ID); String column = mColumn.getColumnName(); - s = s + ", Column="+column; + s.append(", Column=").append(column); String tableName = MTable.getTableName(m_info.ctx, mColumn.getAD_Table_ID()); - s = s + ", Table="+tableName; + s.append(", Table=").append(tableName); } - log.warning(s); + log.warning(s.toString()); break; } // check for interrupted every 10 rows @@ -752,23 +754,23 @@ public final class MLookup extends Lookup implements Serializable break; // load data - String name = rs.getString(3); + StringBuilder name = new StringBuilder(rs.getString(3)); boolean isActive = rs.getString(4).equals("Y"); if (!isActive) { - name = INACTIVE_S + name + INACTIVE_E; + name.append(INACTIVE_S).append(INACTIVE_E); m_hasInactive = true; } if (isNumber) { int key = rs.getInt(1); - KeyNamePair p = new KeyNamePair(key, name); + KeyNamePair p = new KeyNamePair(key, name.toString()); m_lookup.put(new Integer(key), p); } else { String value = rs.getString(2); - ValueNamePair p = new ValueNamePair(value, name); + ValueNamePair p = new ValueNamePair(value, name.toString()); m_lookup.put(value, p); } // log.fine( m_info.KeyColumn + ": " + name); diff --git a/org.adempiere.base/src/org/compiere/model/MLookupCache.java b/org.adempiere.base/src/org/compiere/model/MLookupCache.java index 9a62d94444..fc0e15fd98 100644 --- a/org.adempiere.base/src/org/compiere/model/MLookupCache.java +++ b/org.adempiere.base/src/org/compiere/model/MLookupCache.java @@ -69,7 +69,7 @@ public class MLookupCache if (info == null) return String.valueOf(System.currentTimeMillis()); // - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append(info.WindowNo).append(":") // .append(info.Column_ID) .append(info.KeyColumn) @@ -125,7 +125,7 @@ public class MLookupCache */ public static void cacheReset (int WindowNo) { - String key = String.valueOf(WindowNo) + ":"; + StringBuilder key = new StringBuilder(String.valueOf(WindowNo)).append(":"); int startNo = s_loadedLookups.size(); // find keys of Lookups to delete ArrayList toDelete = new ArrayList(); @@ -133,7 +133,7 @@ public class MLookupCache while (iterator.hasNext()) { String info = (String)iterator.next(); - if (info != null && info.startsWith(key)) + if (info != null && info.startsWith(key.toString())) toDelete.add(info); } diff --git a/org.adempiere.base/src/org/compiere/model/MLookupFactory.java b/org.adempiere.base/src/org/compiere/model/MLookupFactory.java index f979518461..a60c7cb269 100644 --- a/org.adempiere.base/src/org/compiere/model/MLookupFactory.java +++ b/org.adempiere.base/src/org/compiere/model/MLookupFactory.java @@ -290,31 +290,31 @@ public class MLookupFactory static public MLookupInfo getLookup_List(Language language, int AD_Reference_Value_ID) { String byValue = DB.getSQLValueString(null, "SELECT IsOrderByValue FROM AD_Reference WHERE AD_Reference_ID = ? ", AD_Reference_Value_ID); - StringBuffer realSQL = new StringBuffer ("SELECT NULL, AD_Ref_List.Value,"); + StringBuilder realSQL = new StringBuilder ("SELECT NULL, AD_Ref_List.Value,"); MClient client = MClient.get(Env.getCtx()); - String AspFilter=""; + StringBuilder AspFilter = new StringBuilder(); if ( client.isUseASP() ) { - AspFilter=" AND AD_Ref_List.AD_Ref_List_ID NOT IN ( " - +" SELECT li.AD_Ref_List_ID" - +" FROM ASP_Ref_List li" - +" INNER JOIN ASP_Level l ON ( li.ASP_Level_ID = l.ASP_Level_ID)" - +" INNER JOIN ASP_ClientLevel cl on (l.ASP_Level_ID = cl.ASP_Level_ID)" - +" INNER JOIN AD_Client c on (cl.AD_Client_ID = c.AD_Client_ID)" - +" WHERE li.AD_Reference_ID="+AD_Reference_Value_ID - +" AND li.IsActive='Y'" - +" AND c.AD_Client_ID="+client.getAD_Client_ID() - +" AND li.ASP_Status='H')"; + AspFilter.append(" AND AD_Ref_List.AD_Ref_List_ID NOT IN ( ") + .append(" SELECT li.AD_Ref_List_ID") + .append(" FROM ASP_Ref_List li") + .append(" INNER JOIN ASP_Level l ON ( li.ASP_Level_ID = l.ASP_Level_ID)") + .append(" INNER JOIN ASP_ClientLevel cl on (l.ASP_Level_ID = cl.ASP_Level_ID)") + .append(" INNER JOIN AD_Client c on (cl.AD_Client_ID = c.AD_Client_ID)") + .append(" WHERE li.AD_Reference_ID=").append(AD_Reference_Value_ID) + .append(" AND li.IsActive='Y'") + .append(" AND c.AD_Client_ID=").append(client.getAD_Client_ID()) + .append(" AND li.ASP_Status='H')"); } if (Env.isBaseLanguage(language, "AD_Ref_List")) realSQL.append("AD_Ref_List.Name,AD_Ref_List.IsActive FROM AD_Ref_List "); else - realSQL.append("trl.Name, AD_Ref_List.IsActive " - + "FROM AD_Ref_List INNER JOIN AD_Ref_List_Trl trl " - + " ON (AD_Ref_List.AD_Ref_List_ID=trl.AD_Ref_List_ID AND trl.AD_Language='") + realSQL.append("trl.Name, AD_Ref_List.IsActive ") + .append("FROM AD_Ref_List INNER JOIN AD_Ref_List_Trl trl ") + .append(" ON (AD_Ref_List.AD_Ref_List_ID=trl.AD_Ref_List_ID AND trl.AD_Language='") .append(language.getAD_Language()).append("')"); realSQL.append(" WHERE AD_Ref_List.AD_Reference_ID=").append(AD_Reference_Value_ID); - realSQL.append(AspFilter); + realSQL.append(AspFilter.toString()); if ("Y".equals(byValue)) realSQL.append(" ORDER BY 2"); else @@ -334,13 +334,13 @@ public class MLookupFactory static public String getLookup_ListEmbed(Language language, int AD_Reference_Value_ID, String linkColumnName) { - StringBuffer realSQL = new StringBuffer ("SELECT "); + StringBuilder realSQL = new StringBuilder ("SELECT "); if (Env.isBaseLanguage(language, "AD_Ref_List")) realSQL.append("AD_Ref_List.Name FROM AD_Ref_List "); else - realSQL.append("trl.Name " - + "FROM AD_Ref_List INNER JOIN AD_Ref_List_Trl trl " - + " ON (AD_Ref_List.AD_Ref_List_ID=trl.AD_Ref_List_ID AND trl.AD_Language='") + realSQL.append("trl.Name ") + .append("FROM AD_Ref_List INNER JOIN AD_Ref_List_Trl trl ") + .append(" ON (AD_Ref_List.AD_Ref_List_ID=trl.AD_Ref_List_ID AND trl.AD_Language='") .append(language.getAD_Language()).append("')"); realSQL.append(" WHERE AD_Ref_List.AD_Reference_ID=").append(AD_Reference_Value_ID) .append(" AND AD_Ref_List.Value=").append(linkColumnName); @@ -362,7 +362,7 @@ public class MLookupFactory int WindowNo, int AD_Reference_Value_ID) { // Try cache - assume no language change - String key = Env.getAD_Client_ID(ctx) + "|" + String.valueOf(AD_Reference_Value_ID); + StringBuilder key = new StringBuilder(Env.getAD_Client_ID(ctx)).append("|").append(String.valueOf(AD_Reference_Value_ID)); MLookupInfo retValue = (MLookupInfo)s_cacheRefTable.get(key); if (retValue != null) { @@ -434,7 +434,7 @@ public class MLookupFactory return null; } - StringBuffer realSQL = new StringBuffer("SELECT "); + StringBuilder realSQL = new StringBuilder("SELECT "); if (!KeyColumn.endsWith("_ID")) realSQL.append("NULL,"); @@ -513,9 +513,10 @@ public class MLookupFactory ZoomWindow = overrideZoomWindow; ZoomWindowPO = 0; } + StringBuilder msginf = new StringBuilder(TableName).append(".").append(KeyColumn); retValue = new MLookupInfo (realSQL.toString(), TableName, - TableName + "." + KeyColumn, ZoomWindow, ZoomWindowPO, zoomQuery); - s_cacheRefTable.put(key, retValue.cloneIt()); + msginf.toString(), ZoomWindow, ZoomWindowPO, zoomQuery); + s_cacheRefTable.put(key.toString(), retValue.cloneIt()); return retValue; } // getLookup_Table @@ -583,7 +584,7 @@ public class MLookupFactory TableNameAlias = TableName; } - StringBuffer embedSQL = new StringBuffer("SELECT "); + StringBuilder embedSQL = new StringBuilder("SELECT "); // Translated if (IsTranslated && !Env.isBaseLanguage(language, TableName)) @@ -649,7 +650,7 @@ public class MLookupFactory int ZoomWindowPO = 0; //try cache - String cacheKey = Env.getAD_Client_ID(ctx) + "|" + TableName + "." + KeyColumn; + StringBuilder cacheKey = new StringBuilder(Env.getAD_Client_ID(ctx)).append("|").append(TableName).append(".").append(KeyColumn); if (s_cacheRefTable.containsKey(cacheKey)) return s_cacheRefTable.get(cacheKey).cloneIt(); @@ -709,10 +710,10 @@ public class MLookupFactory list.add(new LookupDisplayColumn(KeyColumn, null, false, DisplayType.ID, 0)); } - StringBuffer realSQL = new StringBuffer("SELECT "); + StringBuilder realSQL = new StringBuilder("SELECT "); realSQL.append(TableName).append(".").append(KeyColumn).append(",NULL,"); - StringBuffer displayColumn = new StringBuffer(); + StringBuilder displayColumn = new StringBuilder(); int size = list.size(); // Get Display Column for (int i = 0; i < size; i++) @@ -720,7 +721,8 @@ public class MLookupFactory if (i > 0) displayColumn.append(" ||'_'|| " ); LookupDisplayColumn ldc = (LookupDisplayColumn)list.get(i); - String columnSQL = ldc.IsVirtual ? ldc.ColumnSQL : TableName + "." + ldc.ColumnName; + StringBuilder msg = new StringBuilder(TableName).append(".").append(ldc.ColumnName); + String columnSQL = ldc.IsVirtual ? ldc.ColumnSQL : msg.toString(); displayColumn.append("NVL("); @@ -795,9 +797,10 @@ public class MLookupFactory if (CLogMgt.isLevelFinest()) s_log.fine("ColumnName=" + ColumnName + " - " + realSQL); + StringBuilder msginf = new StringBuilder(TableName).append(".").append(KeyColumn); MLookupInfo lInfo = new MLookupInfo(realSQL.toString(), TableName, - TableName + "." + KeyColumn, ZoomWindow, ZoomWindowPO, zoomQuery); - s_cacheRefTable.put(cacheKey, lInfo.cloneIt()); + msginf.toString(), ZoomWindow, ZoomWindowPO, zoomQuery); + s_cacheRefTable.put(cacheKey.toString(), lInfo.cloneIt()); return lInfo; } // getLookup_TableDir @@ -881,7 +884,7 @@ public class MLookupFactory } // - StringBuffer embedSQL = new StringBuffer("SELECT "); + StringBuilder embedSQL = new StringBuilder("SELECT "); int size = list.size(); for (int i = 0; i < size; i++) @@ -889,7 +892,8 @@ public class MLookupFactory if (i > 0) embedSQL.append("||' - '||" ); LookupDisplayColumn ldc = (LookupDisplayColumn)list.get(i); - String columnSQL = ldc.IsVirtual ? ldc.ColumnSQL : TableName + "." + ldc.ColumnName; + StringBuilder msg = new StringBuilder(TableName).append(".").append(ldc.ColumnName); + String columnSQL = ldc.IsVirtual ? ldc.ColumnSQL : msg.toString(); // translated if (ldc.IsTranslated && !Env.isBaseLanguage(language, TableName) && !ldc.IsVirtual) diff --git a/org.adempiere.base/src/org/compiere/model/MLookupInfo.java b/org.adempiere.base/src/org/compiere/model/MLookupInfo.java index c857055bc6..650c27ac42 100644 --- a/org.adempiere.base/src/org/compiere/model/MLookupInfo.java +++ b/org.adempiere.base/src/org/compiere/model/MLookupInfo.java @@ -65,7 +65,9 @@ public class MLookupInfo implements Serializable, Cloneable refName = rs.getString(2); validationType = rs.getString(3); isActive = rs.getString(4).equals("Y"); - CLogger.get().config("AD_Reference Name=" + refName + ", ID=" + id + ", Type=" + validationType + ", Active=" + isActive); + StringBuilder msgconf = new StringBuilder( + "AD_Reference Name=").append(refName).append(", ID=").append(id).append(", Type=").append(validationType).append(", Active=").append(isActive); + CLogger.get().config(msgconf.toString()); } rs.close(); pstmt.close(); @@ -107,7 +109,8 @@ public class MLookupInfo implements Serializable, Cloneable retValue = id; colName = rs.getString(2); tabName = rs.getString(3); - CLogger.get().config("Name=" + colName + ", ID=" + id + ", Table=" + tabName); + StringBuilder msgconf = new StringBuilder("Name=").append(colName).append(", ID=").append(id).append(", Table=").append(tabName); + CLogger.get().config(msgconf.toString()); } rs.close(); pstmt.close(); @@ -195,7 +198,7 @@ public class MLookupInfo implements Serializable, Cloneable */ public String toString() { - StringBuffer sb = new StringBuffer ("MLookupInfo[") + StringBuilder sb = new StringBuilder ("MLookupInfo[") .append(KeyColumn) .append("-Direct=").append(QueryDirect) .append("]"); diff --git a/org.adempiere.base/src/org/compiere/model/MMailText.java b/org.adempiere.base/src/org/compiere/model/MMailText.java index ac894d4199..3ecbb103fb 100644 --- a/org.adempiere.base/src/org/compiere/model/MMailText.java +++ b/org.adempiere.base/src/org/compiere/model/MMailText.java @@ -88,7 +88,7 @@ public class MMailText extends X_R_MailText if (!all) return parse(m_MailText); // - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append(m_MailText); String s = m_MailText2; if (s != null && s.length() > 0) @@ -176,7 +176,7 @@ public class MMailText extends X_R_MailText String inStr = text; String token; - StringBuffer outStr = new StringBuffer(); + StringBuilder outStr = new StringBuilder(); int i = inStr.indexOf('@'); while (i != -1) @@ -211,8 +211,10 @@ public class MMailText extends X_R_MailText private String parseVariable (String variable, PO po) { int index = po.get_ColumnIndex(variable); - if (index == -1) - return "@" + variable + "@"; // keep for next + if (index == -1){ + StringBuilder msgreturn = new StringBuilder("@").append(variable).append("@"); + return msgreturn.toString(); // keep for next + } // Object value = po.get_Value(index); if (value == null) @@ -305,13 +307,13 @@ public class MMailText extends X_R_MailText { if (m_bpartner != null && m_bpartner.getAD_Language() != null) { - String key = m_bpartner.getAD_Language() + get_ID(); + StringBuilder key = new StringBuilder(m_bpartner.getAD_Language()).append(get_ID()); MMailTextTrl trl = s_cacheTrl.get(key); if (trl == null) { trl = getTranslation(m_bpartner.getAD_Language()); if (trl != null) - s_cacheTrl.put(key, trl); + s_cacheTrl.put(key.toString(), trl); } if (trl != null) { diff --git a/org.adempiere.base/src/org/compiere/model/MMatchPO.java b/org.adempiere.base/src/org/compiere/model/MMatchPO.java index a7365f3c69..4f075b44cf 100644 --- a/org.adempiere.base/src/org/compiere/model/MMatchPO.java +++ b/org.adempiere.base/src/org/compiere/model/MMatchPO.java @@ -758,7 +758,7 @@ public class MMatchPO extends X_M_MatchPO */ public String toString () { - StringBuffer sb = new StringBuffer ("MMatchPO["); + StringBuilder sb = new StringBuilder ("MMatchPO["); sb.append (get_ID()) .append (",Qty=").append (getQty()) .append (",C_OrderLine_ID=").append (getC_OrderLine_ID()) @@ -800,10 +800,10 @@ public class MMatchPO extends X_M_MatchPO if (po1.getM_InOutLine_ID() != 0 && po1.getC_InvoiceLine_ID() == 0 && po2.getM_InOutLine_ID() == 0 && po2.getC_InvoiceLine_ID() != 0) { - String s1 = "UPDATE M_MatchPO SET C_InvoiceLine_ID=" - + po2.getC_InvoiceLine_ID() - + " WHERE M_MatchPO_ID=" + po1.getM_MatchPO_ID(); - int no1 = DB.executeUpdate(s1, null); + StringBuilder s1 = new StringBuilder("UPDATE M_MatchPO SET C_InvoiceLine_ID=") + .append(po2.getC_InvoiceLine_ID()) + .append(" WHERE M_MatchPO_ID=").append(po1.getM_MatchPO_ID()); + int no1 = DB.executeUpdate(s1.toString(), null); if (no1 != 1) { errors++; diff --git a/org.adempiere.base/src/org/compiere/model/MMeasure.java b/org.adempiere.base/src/org/compiere/model/MMeasure.java index f3065b4582..8df75f2c33 100644 --- a/org.adempiere.base/src/org/compiere/model/MMeasure.java +++ b/org.adempiere.base/src/org/compiere/model/MMeasure.java @@ -166,7 +166,7 @@ public class MMeasure extends X_PA_Measure // else if (MGoal.MEASUREDISPLAY_Day.equals(MeasureDisplay)) // trunc = "D"; trunc = "TRUNC(DateDoc,'" + trunc + "')"; - StringBuffer sql = new StringBuffer ("SELECT SUM(ManualActual), ") + StringBuilder sql = new StringBuilder ("SELECT SUM(ManualActual), ") .append(trunc).append(" FROM PA_Achievement WHERE PA_Measure_ID=? AND IsAchieved='Y' ") .append("GROUP BY ").append(trunc) .append(" ORDER BY ").append(trunc); @@ -283,7 +283,7 @@ public class MMeasure extends X_PA_Measure */ public String toString () { - StringBuffer sb = new StringBuffer ("MMeasure["); + StringBuilder sb = new StringBuilder ("MMeasure["); sb.append (get_ID()).append ("-").append (getName()).append ("]"); return sb.toString (); } // toString @@ -594,20 +594,20 @@ public class MMeasure extends X_PA_Measure while (st.hasMoreTokens()) // for each class { String cmd = st.nextToken().trim(); - String retValue = ""; + StringBuilder retValue = new StringBuilder(); if (cmd.toLowerCase().startsWith(MRule.SCRIPT_PREFIX)) { MRule rule = MRule.get(getCtx(), cmd.substring(MRule.SCRIPT_PREFIX.length())); if (rule == null) { - retValue = "Script " + cmd + " not found"; - log.log(Level.SEVERE, retValue); + retValue = new StringBuilder("Script ").append(cmd).append(" not found"); + log.log(Level.SEVERE, retValue.toString()); break; } if ( ! (rule.getEventType().equals(MRule.EVENTTYPE_MeasureForPerformanceAnalysis) && rule.getRuleType().equals(MRule.RULETYPE_JSR223ScriptingAPIs))) { - retValue = "Script " + cmd - + " must be of type JSR 223 and event measure"; - log.log(Level.SEVERE, retValue); + retValue = new StringBuilder("Script ").append(cmd) + .append(" must be of type JSR 223 and event measure"); + log.log(Level.SEVERE, retValue.toString()); break; } ScriptEngine engine = rule.getScriptEngine(); @@ -622,7 +622,7 @@ public class MMeasure extends X_PA_Measure catch (Exception e) { log.log(Level.SEVERE, "", e); - retValue = "Script Invalid: " + e.toString(); + retValue = new StringBuilder("Script Invalid: ").append(e.toString()); return false; } } @@ -652,9 +652,9 @@ public class MMeasure extends X_PA_Measure } } - if (!Util.isEmpty(retValue)) // interrupt on first error + if (!Util.isEmpty(retValue.toString())) // interrupt on first error { - log.severe (retValue); + log.severe (retValue.toString()); return false; } } diff --git a/org.adempiere.base/src/org/compiere/model/M_Element.java b/org.adempiere.base/src/org/compiere/model/M_Element.java index 033c2f3ccd..706a3fd31b 100644 --- a/org.adempiere.base/src/org/compiere/model/M_Element.java +++ b/org.adempiere.base/src/org/compiere/model/M_Element.java @@ -186,10 +186,10 @@ public class M_Element extends X_AD_Element if (getColumnName().length() != columnName.length()) setColumnName(columnName); - String sql = "select count(*) from AD_Element where UPPER(ColumnName)=?"; + StringBuilder sql = new StringBuilder("select count(*) from AD_Element where UPPER(ColumnName)=?"); if (!newRecord) - sql += " AND AD_Element_ID<>" + get_ID(); - int no = DB.getSQLValue(null, sql, columnName.toUpperCase()); + sql.append(" AND AD_Element_ID<>").append(get_ID()); + int no = DB.getSQLValue(null, sql.toString(), columnName.toUpperCase()); if (no > 0) { log.saveError("SaveErrorNotUnique", Msg.getElement(getCtx(), COLUMNNAME_ColumnName)); return false; @@ -210,7 +210,7 @@ public class M_Element extends X_AD_Element // Update Columns, Fields, Parameters, Print Info if (!newRecord) { - StringBuffer sql = new StringBuffer(); + StringBuilder sql = new StringBuilder(); int no = 0; if ( is_ValueChanged(M_Element.COLUMNNAME_Name) @@ -219,7 +219,7 @@ public class M_Element extends X_AD_Element || is_ValueChanged(M_Element.COLUMNNAME_ColumnName) ) { // Column - sql = new StringBuffer("UPDATE AD_Column SET ColumnName=") + sql = new StringBuilder("UPDATE AD_Column SET ColumnName=") .append(DB.TO_STRING(getColumnName())) .append(", Name=").append(DB.TO_STRING(getName())) .append(", Description=").append(DB.TO_STRING(getDescription())) @@ -229,7 +229,7 @@ public class M_Element extends X_AD_Element log.fine("afterSave - Columns updated #" + no); // Parameter - sql = new StringBuffer("UPDATE AD_Process_Para SET ColumnName=") + sql = new StringBuilder("UPDATE AD_Process_Para SET ColumnName=") .append(DB.TO_STRING(getColumnName())) .append(", Name=").append(DB.TO_STRING(getName())) .append(", Description=").append(DB.TO_STRING(getDescription())) @@ -240,7 +240,7 @@ public class M_Element extends X_AD_Element .append(" AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL"); no = DB.executeUpdate(sql.toString(), get_TrxName()); - sql = new StringBuffer("UPDATE AD_Process_Para SET ColumnName=") + sql = new StringBuilder("UPDATE AD_Process_Para SET ColumnName=") .append(DB.TO_STRING(getColumnName())) .append(", Name=").append(DB.TO_STRING(getName())) .append(", Description=").append(DB.TO_STRING(getDescription())) @@ -256,7 +256,7 @@ public class M_Element extends X_AD_Element || is_ValueChanged(M_Element.COLUMNNAME_Help) ) { // Field - sql = new StringBuffer("UPDATE AD_Field SET Name=") + sql = new StringBuilder("UPDATE AD_Field SET Name=") .append(DB.TO_STRING(getName())) .append(", Description=").append(DB.TO_STRING(getDescription())) .append(", Help=").append(DB.TO_STRING(getHelp())) @@ -275,7 +275,7 @@ public class M_Element extends X_AD_Element || is_ValueChanged(M_Element.COLUMNNAME_Name) ) { // Print Info - sql = new StringBuffer("UPDATE AD_PrintFormatItem pi SET PrintName=") + sql = new StringBuilder("UPDATE AD_PrintFormatItem pi SET PrintName=") .append(DB.TO_STRING(getPrintName())) .append(", Name=").append(DB.TO_STRING(getName())) .append(" WHERE IsCentrallyMaintained='Y'") @@ -296,7 +296,7 @@ public class M_Element extends X_AD_Element */ public String toString() { - StringBuffer sb = new StringBuffer ("M_Element["); + StringBuilder sb = new StringBuilder ("M_Element["); sb.append (get_ID()).append ("-").append (getColumnName()).append ("]"); return sb.toString (); } // toString From b8af84eb25788ab0048b1e7e02fd572073d467bb Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 1 Oct 2012 20:40:41 -0500 Subject: [PATCH 61/79] IDEMPIERE-308 Performance: Replace with StringBuilder / fix problems found with StringBuilder(int) --- org.adempiere.base/src/org/compiere/model/MArchive.java | 2 +- org.adempiere.base/src/org/compiere/model/MAttachment.java | 2 +- org.adempiere.base/src/org/compiere/model/MChat.java | 2 +- org.adempiere.base/src/org/compiere/model/MClientShare.java | 4 ++-- org.adempiere.base/src/org/compiere/model/MLookupFactory.java | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MArchive.java b/org.adempiere.base/src/org/compiere/model/MArchive.java index cd843f2948..8a193021da 100644 --- a/org.adempiere.base/src/org/compiere/model/MArchive.java +++ b/org.adempiere.base/src/org/compiere/model/MArchive.java @@ -540,7 +540,7 @@ public class MArchive extends X_AD_Archive { * @return String */ private String getArchivePathSnippet() { - StringBuilder path = new StringBuilder(this.getAD_Client_ID()).append(File.separator).append(this.getAD_Org_ID()) + StringBuilder path = new StringBuilder().append(this.getAD_Client_ID()).append(File.separator).append(this.getAD_Org_ID()) .append(File.separator); if (this.getAD_Process_ID() > 0) { path.append(this.getAD_Process_ID()).append(File.separator); diff --git a/org.adempiere.base/src/org/compiere/model/MAttachment.java b/org.adempiere.base/src/org/compiere/model/MAttachment.java index 772a72ebd2..0a57f7c1d3 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttachment.java +++ b/org.adempiere.base/src/org/compiere/model/MAttachment.java @@ -814,7 +814,7 @@ public class MAttachment extends X_AD_Attachment */ private String getAttachmentPathSnippet(){ - StringBuilder msgreturn = new StringBuilder(this.getAD_Client_ID()).append(File.separator) + StringBuilder msgreturn = new StringBuilder().append(this.getAD_Client_ID()).append(File.separator) .append(this.getAD_Org_ID()).append(File.separator) .append(this.getAD_Table_ID()).append(File.separator).append(this.getRecord_ID()); return msgreturn.toString(); diff --git a/org.adempiere.base/src/org/compiere/model/MChat.java b/org.adempiere.base/src/org/compiere/model/MChat.java index a346488612..4598ff4391 100644 --- a/org.adempiere.base/src/org/compiere/model/MChat.java +++ b/org.adempiere.base/src/org/compiere/model/MChat.java @@ -196,7 +196,7 @@ public class MChat extends X_CM_Chat if (Description != null && Description.length() > 0) super.setDescription (Description); else{ - StringBuilder msgsd = new StringBuilder(getAD_Table_ID()).append("#").append(getRecord_ID()); + StringBuilder msgsd = new StringBuilder().append(getAD_Table_ID()).append("#").append(getRecord_ID()); super.setDescription (msgsd.toString()); } } // setDescription diff --git a/org.adempiere.base/src/org/compiere/model/MClientShare.java b/org.adempiere.base/src/org/compiere/model/MClientShare.java index f0f45898f2..330ca7132c 100644 --- a/org.adempiere.base/src/org/compiere/model/MClientShare.java +++ b/org.adempiere.base/src/org/compiere/model/MClientShare.java @@ -88,7 +88,7 @@ public class MClientShare extends X_AD_ClientShare { int Client_ID = rs.getInt(1); int table_ID = rs.getInt(2); - StringBuilder key = new StringBuilder(Client_ID).append("_").append(table_ID); + StringBuilder key = new StringBuilder().append(Client_ID).append("_").append(table_ID); String ShareType = rs.getString(3); if (ShareType.equals(SHARETYPE_ClientAllShared)) s_shares.put(key.toString(), Boolean.TRUE); @@ -116,7 +116,7 @@ public class MClientShare extends X_AD_ClientShare if (s_shares.isEmpty()) // put in something s_shares.put("0_0", Boolean.TRUE); } // load - StringBuilder key = new StringBuilder(AD_Client_ID).append("_").append(AD_Table_ID); + StringBuilder key = new StringBuilder().append(AD_Client_ID).append("_").append(AD_Table_ID); return s_shares.get(key); } // load diff --git a/org.adempiere.base/src/org/compiere/model/MLookupFactory.java b/org.adempiere.base/src/org/compiere/model/MLookupFactory.java index a60c7cb269..6d91dde21a 100644 --- a/org.adempiere.base/src/org/compiere/model/MLookupFactory.java +++ b/org.adempiere.base/src/org/compiere/model/MLookupFactory.java @@ -362,7 +362,7 @@ public class MLookupFactory int WindowNo, int AD_Reference_Value_ID) { // Try cache - assume no language change - StringBuilder key = new StringBuilder(Env.getAD_Client_ID(ctx)).append("|").append(String.valueOf(AD_Reference_Value_ID)); + StringBuilder key = new StringBuilder().append(Env.getAD_Client_ID(ctx)).append("|").append(String.valueOf(AD_Reference_Value_ID)); MLookupInfo retValue = (MLookupInfo)s_cacheRefTable.get(key); if (retValue != null) { @@ -650,7 +650,7 @@ public class MLookupFactory int ZoomWindowPO = 0; //try cache - StringBuilder cacheKey = new StringBuilder(Env.getAD_Client_ID(ctx)).append("|").append(TableName).append(".").append(KeyColumn); + StringBuilder cacheKey = new StringBuilder().append(Env.getAD_Client_ID(ctx)).append("|").append(TableName).append(".").append(KeyColumn); if (s_cacheRefTable.containsKey(cacheKey)) return s_cacheRefTable.get(cacheKey).cloneIt(); From c37aea6dfb175664ddabb7daac28329047c035c9 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 2 Oct 2012 11:41:11 -0500 Subject: [PATCH 62/79] IDEMPIERE-308 Performance: Replace with StringBuilder / revert model classes affected by StringBuffer(null) raising NPE --- .../org/compiere/model/MBankStatement.java | 72 ++++---- .../src/org/compiere/model/MCash.java | 103 ++++++------ .../src/org/compiere/model/MInOut.java | 153 ++++++++--------- .../src/org/compiere/model/MInOutConfirm.java | 106 ++++++------ .../src/org/compiere/model/MInventory.java | 77 ++++----- .../src/org/compiere/model/MInvoice.java | 156 +++++++++--------- .../src/org/compiere/model/MJournal.java | 114 ++++++------- .../src/org/compiere/model/MJournalBatch.java | 84 +++++----- 8 files changed, 407 insertions(+), 458 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MBankStatement.java b/org.adempiere.base/src/org/compiere/model/MBankStatement.java index 4f38fa577b..56806857ef 100644 --- a/org.adempiere.base/src/org/compiere/model/MBankStatement.java +++ b/org.adempiere.base/src/org/compiere/model/MBankStatement.java @@ -148,10 +148,8 @@ public class MBankStatement extends X_C_BankStatement implements DocAction String desc = getDescription(); if (desc == null) setDescription(description); - else{ - StringBuilder msgsd = new StringBuilder(desc).append(" | ").append(description); - setDescription(msgsd.toString()); - } + else + setDescription(desc + " | " + description); } // addDescription /** @@ -164,10 +162,10 @@ public class MBankStatement extends X_C_BankStatement implements DocAction super.setProcessed (processed); if (get_ID() == 0) return; - StringBuilder sql = new StringBuilder("UPDATE C_BankStatementLine SET Processed='") - .append((processed ? "Y" : "N")) - .append("' WHERE C_BankStatement_ID=").append(getC_BankStatement_ID()); - int noLine = DB.executeUpdate(sql.toString(), get_TrxName()); + String sql = "UPDATE C_BankStatementLine SET Processed='" + + (processed ? "Y" : "N") + + "' WHERE C_BankStatement_ID=" + getC_BankStatement_ID(); + int noLine = DB.executeUpdate(sql, get_TrxName()); m_lines = null; log.fine("setProcessed - " + processed + " - Lines=" + noLine); } // setProcessed @@ -196,8 +194,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction */ public String getDocumentInfo() { - StringBuilder msgreturn = new StringBuilder(getBankAccount().getName()).append(" ").append(getDocumentNo()); - return msgreturn.toString(); + return getBankAccount().getName() + " " + getDocumentNo(); } // getDocumentInfo /** @@ -208,8 +205,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction { try { - StringBuilder msgfile = new StringBuilder(get_TableName()).append(get_ID()).append("_"); - File temp = File.createTempFile(msgfile.toString(), ".pdf"); + File temp = File.createTempFile(get_TableName()+get_ID()+"_", ".pdf"); return createPDF (temp); } catch (Exception e) @@ -263,7 +259,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction } // processIt /** Process Message */ - private StringBuffer m_processMsg = null; + private String m_processMsg = null; /** Just Prepared Flag */ private boolean m_justPrepared = false; @@ -296,7 +292,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction public String prepareIt() { log.info(toString()); - m_processMsg = new StringBuffer( ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -305,7 +301,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction MBankStatementLine[] lines = getLines(true); if (lines.length == 0) { - m_processMsg = new StringBuffer("@NoLines@"); + m_processMsg = "@NoLines@"; return DocAction.STATUS_Invalid; } // Lines @@ -326,7 +322,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction MPeriod.testPeriodOpen(getCtx(), minDate, MDocType.DOCBASETYPE_BankStatement, 0); MPeriod.testPeriodOpen(getCtx(), maxDate, MDocType.DOCBASETYPE_BankStatement, 0); - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -373,7 +369,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction return status; } - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -405,7 +401,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE); if (valid != null) { - m_processMsg = new StringBuffer(valid); + m_processMsg = valid; return DocAction.STATUS_Invalid; } // @@ -422,7 +418,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction { log.info(toString()); // Before Void - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID); if (m_processMsg != null) return false; @@ -430,7 +426,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction || DOCSTATUS_Reversed.equals(getDocStatus()) || DOCSTATUS_Voided.equals(getDocStatus())) { - m_processMsg = new StringBuffer("Document Closed: ").append(getDocStatus()); + m_processMsg = "Document Closed: " + getDocStatus(); setDocAction(DOCACTION_None); return false; } @@ -464,16 +460,16 @@ public class MBankStatement extends X_C_BankStatement implements DocAction MBankStatementLine line = lines[i]; if (line.getStmtAmt().compareTo(Env.ZERO) != 0) { - StringBuilder description = new StringBuilder(Msg.getMsg(getCtx(), "Voided")).append(" (") - .append(Msg.translate(getCtx(), "StmtAmt")).append("=").append(line.getStmtAmt()); + String description = Msg.getMsg(getCtx(), "Voided") + " (" + + Msg.translate(getCtx(), "StmtAmt") + "=" + line.getStmtAmt(); if (line.getTrxAmt().compareTo(Env.ZERO) != 0) - description.append(", ").append(Msg.translate(getCtx(), "TrxAmt")).append("=").append(line.getTrxAmt()); + description += ", " + Msg.translate(getCtx(), "TrxAmt") + "=" + line.getTrxAmt(); if (line.getChargeAmt().compareTo(Env.ZERO) != 0) - description.append(", ").append(Msg.translate(getCtx(), "ChargeAmt")).append("=").append(line.getChargeAmt()); + description += ", " + Msg.translate(getCtx(), "ChargeAmt") + "=" + line.getChargeAmt(); if (line.getInterestAmt().compareTo(Env.ZERO) != 0) - description.append(", ").append(Msg.translate(getCtx(), "InterestAmt")).append("=").append(line.getInterestAmt()); - description.append(")"); - line.addDescription(description.toString()); + description += ", " + Msg.translate(getCtx(), "InterestAmt") + "=" + line.getInterestAmt(); + description += ")"; + line.addDescription(description); // line.setStmtAmt(Env.ZERO); line.setTrxAmt(Env.ZERO); @@ -493,7 +489,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction setStatementDifference(Env.ZERO); // After Void - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID); if (m_processMsg != null) return false; @@ -510,14 +506,14 @@ public class MBankStatement extends X_C_BankStatement implements DocAction { log.info("closeIt - " + toString()); // Before Close - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE); if (m_processMsg != null) return false; setDocAction(DOCACTION_None); // After Close - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE); if (m_processMsg != null) return false; return true; @@ -531,12 +527,12 @@ public class MBankStatement extends X_C_BankStatement implements DocAction { log.info("reverseCorrectIt - " + toString()); // Before reverseCorrect - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT); if (m_processMsg != null) return false; // After reverseCorrect - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT); if (m_processMsg != null) return false; @@ -551,12 +547,12 @@ public class MBankStatement extends X_C_BankStatement implements DocAction { log.info("reverseAccrualIt - " + toString()); // Before reverseAccrual - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL); if (m_processMsg != null) return false; // After reverseAccrual - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL); if (m_processMsg != null) return false; @@ -571,12 +567,12 @@ public class MBankStatement extends X_C_BankStatement implements DocAction { log.info("reActivateIt - " + toString()); // Before reActivate - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE); if (m_processMsg != null) return false; // After reActivate - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE); if (m_processMsg != null) return false; return false; @@ -589,7 +585,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction */ public String getSummary() { - StringBuilder sb = new StringBuilder(); + StringBuffer sb = new StringBuffer(); sb.append(getName()); // : Total Lines = 123.00 (#1) sb.append(": ") @@ -607,7 +603,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction */ public String getProcessMsg() { - return m_processMsg.toString(); + return m_processMsg; } // getProcessMsg /** diff --git a/org.adempiere.base/src/org/compiere/model/MCash.java b/org.adempiere.base/src/org/compiere/model/MCash.java index 05b3de3a0d..90a2a6f582 100644 --- a/org.adempiere.base/src/org/compiere/model/MCash.java +++ b/org.adempiere.base/src/org/compiere/model/MCash.java @@ -159,9 +159,9 @@ public class MCash extends X_C_Cash implements DocAction Timestamp today = TimeUtil.getDay(System.currentTimeMillis()); setStatementDate (today); // @#Date@ setDateAcct (today); // @#Date@ - StringBuilder name = new StringBuilder(DisplayType.getDateFormat(DisplayType.Date).format(today)) - .append(" ").append(MOrg.get(ctx, getAD_Org_ID()).getValue()); - setName (name.toString()); + String name = DisplayType.getDateFormat(DisplayType.Date).format(today) + + " " + MOrg.get(ctx, getAD_Org_ID()).getValue(); + setName (name); setIsApproved(false); setPosted (false); // N setProcessed (false); @@ -193,9 +193,9 @@ public class MCash extends X_C_Cash implements DocAction { setStatementDate (today); setDateAcct (today); - StringBuilder name = new StringBuilder(DisplayType.getDateFormat(DisplayType.Date).format(today)) - .append(" ").append(cb.getName()); - setName (name.toString()); + String name = DisplayType.getDateFormat(DisplayType.Date).format(today) + + " " + cb.getName(); + setName (name); } m_book = cb; } // MCash @@ -254,8 +254,7 @@ public class MCash extends X_C_Cash implements DocAction */ public String getDocumentInfo() { - StringBuilder msgreturn = new StringBuilder(Msg.getElement(getCtx(), "C_Cash_ID")).append(" ").append(getDocumentNo()); - return msgreturn.toString(); + return Msg.getElement(getCtx(), "C_Cash_ID") + " " + getDocumentNo(); } // getDocumentInfo /** @@ -266,8 +265,7 @@ public class MCash extends X_C_Cash implements DocAction { try { - StringBuilder msgfile = new StringBuilder(get_TableName()).append(get_ID()).append("_"); - File temp = File.createTempFile(msgfile.toString(), ".pdf"); + File temp = File.createTempFile(get_TableName()+get_ID()+"_", ".pdf"); return createPDF (temp); } catch (Exception e) @@ -322,7 +320,7 @@ public class MCash extends X_C_Cash implements DocAction } // process /** Process Message */ - private StringBuffer m_processMsg = null; + private String m_processMsg = null; /** Just Prepared Flag */ private boolean m_justPrepared = false; @@ -355,20 +353,20 @@ public class MCash extends X_C_Cash implements DocAction public String prepareIt() { log.info(toString()); - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE); if (m_processMsg != null) return DocAction.STATUS_Invalid; // Std Period open? if (!MPeriod.isOpen(getCtx(), getDateAcct(), MDocType.DOCBASETYPE_CashJournal, getAD_Org_ID())) { - m_processMsg = new StringBuffer("@PeriodClosed@"); + m_processMsg = "@PeriodClosed@"; return DocAction.STATUS_Invalid; } MCashLine[] lines = getLines(false); if (lines.length == 0) { - m_processMsg = new StringBuffer("@NoLines@"); + m_processMsg = "@NoLines@"; return DocAction.STATUS_Invalid; } // Add up Amounts @@ -388,7 +386,7 @@ public class MCash extends X_C_Cash implements DocAction getAD_Client_ID(), getAD_Org_ID()); if (amt == null) { - m_processMsg = new StringBuffer("No Conversion Rate found - @C_CashLine_ID@= ").append(line.getLine()); + m_processMsg = "No Conversion Rate found - @C_CashLine_ID@= " + line.getLine(); return DocAction.STATUS_Invalid; } difference = difference.add(amt); @@ -397,7 +395,7 @@ public class MCash extends X_C_Cash implements DocAction setStatementDifference(difference); // setEndingBalance(getBeginningBalance().add(getStatementDifference())); - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -443,7 +441,7 @@ public class MCash extends X_C_Cash implements DocAction return status; } - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -468,19 +466,19 @@ public class MCash extends X_C_Cash implements DocAction && !MInvoice.DOCSTATUS_Voided.equals(invoice.getDocStatus()) ) { - m_processMsg = new StringBuffer("@Line@ ").append(line.getLine()).append(": @InvoiceCreateDocNotCompleted@"); + m_processMsg = "@Line@ "+line.getLine()+": @InvoiceCreateDocNotCompleted@"; return DocAction.STATUS_Invalid; } // - StringBuilder name = new StringBuilder(Msg.translate(getCtx(), "C_Cash_ID")).append(": ").append(getName()) - .append(" - ").append(Msg.translate(getCtx(), "Line")).append(" ").append(line.getLine()); + String name = Msg.translate(getCtx(), "C_Cash_ID") + ": " + getName() + + " - " + Msg.translate(getCtx(), "Line") + " " + line.getLine(); MAllocationHdr hdr = new MAllocationHdr(getCtx(), false, getDateAcct(), line.getC_Currency_ID(), - name.toString(), get_TrxName()); + name, get_TrxName()); hdr.setAD_Org_ID(getAD_Org_ID()); if (!hdr.save()) { - m_processMsg = new StringBuffer(CLogger.retrieveErrorString("Could not create Allocation Hdr")); + m_processMsg = CLogger.retrieveErrorString("Could not create Allocation Hdr"); return DocAction.STATUS_Invalid; } // Allocation Line @@ -490,16 +488,16 @@ public class MCash extends X_C_Cash implements DocAction aLine.setC_CashLine_ID(line.getC_CashLine_ID()); if (!aLine.save()) { - m_processMsg = new StringBuffer(CLogger.retrieveErrorString("Could not create Allocation Line")); + m_processMsg = CLogger.retrieveErrorString("Could not create Allocation Line"); return DocAction.STATUS_Invalid; } // Should start WF if(!hdr.processIt(DocAction.ACTION_Complete)) { - m_processMsg = new StringBuffer(CLogger.retrieveErrorString("Could not process Allocation")); + m_processMsg = CLogger.retrieveErrorString("Could not process Allocation"); return DocAction.STATUS_Invalid; } if (!hdr.save()) { - m_processMsg = new StringBuffer(CLogger.retrieveErrorString("Could not save Allocation")); + m_processMsg = CLogger.retrieveErrorString("Could not save Allocation"); return DocAction.STATUS_Invalid; } } @@ -531,14 +529,14 @@ public class MCash extends X_C_Cash implements DocAction pay.setProcessed(true); if (!pay.save()) { - m_processMsg = new StringBuffer(CLogger.retrieveErrorString("Could not create Payment")); + m_processMsg = CLogger.retrieveErrorString("Could not create Payment"); return DocAction.STATUS_Invalid; } line.setC_Payment_ID(pay.getC_Payment_ID()); if (!line.save()) { - m_processMsg = new StringBuffer("Could not update Cash Line"); + m_processMsg = "Could not update Cash Line"; return DocAction.STATUS_Invalid; } } @@ -548,7 +546,7 @@ public class MCash extends X_C_Cash implements DocAction String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE); if (valid != null) { - m_processMsg = new StringBuffer(valid); + m_processMsg = valid; return DocAction.STATUS_Invalid; } // @@ -566,7 +564,7 @@ public class MCash extends X_C_Cash implements DocAction { log.info(toString()); // Before Void - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID); if (m_processMsg != null) return false; @@ -575,7 +573,7 @@ public class MCash extends X_C_Cash implements DocAction if (retValue) { // After Void - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID); if (m_processMsg != null) return false; setDocAction(DOCACTION_None); @@ -596,7 +594,7 @@ public class MCash extends X_C_Cash implements DocAction || DOCSTATUS_Reversed.equals(getDocStatus()) || DOCSTATUS_Voided.equals(getDocStatus())) { - m_processMsg = new StringBuffer("Document Closed: ").append(getDocStatus()); + m_processMsg = "Document Closed: " + getDocStatus(); setDocAction(DOCACTION_None); return false; } @@ -623,10 +621,9 @@ public class MCash extends X_C_Cash implements DocAction cashline.setAmount(Env.ZERO); cashline.setDiscountAmt(Env.ZERO); cashline.setWriteOffAmt(Env.ZERO); - StringBuilder msgadd = new StringBuilder(Msg.getMsg(getCtx(), "Voided")) - .append(" (Amount=").append(oldAmount).append(", Discount=").append(oldDiscount) - .append(", WriteOff=").append(oldWriteOff).append(", )"); - cashline.addDescription(msgadd.toString()); + cashline.addDescription(Msg.getMsg(getCtx(), "Voided") + + " (Amount=" + oldAmount + ", Discount=" + oldDiscount + + ", WriteOff=" + oldWriteOff + ", )"); if (MCashLine.CASHTYPE_BankAccountTransfer.equals(cashline.getCashType())) { if (cashline.getC_Payment_ID() == 0) @@ -662,10 +659,8 @@ public class MCash extends X_C_Cash implements DocAction String desc = getDescription(); if (desc == null) setDescription(description); - else{ - StringBuilder msgsd = new StringBuilder(desc).append(" | ").append(description); - setDescription(msgsd.toString()); - } + else + setDescription(desc + " | " + description); } // addDescription /** @@ -677,14 +672,14 @@ public class MCash extends X_C_Cash implements DocAction { log.info(toString()); // Before Close - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE); if (m_processMsg != null) return false; setDocAction(DOCACTION_None); // After Close - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE); if (m_processMsg != null) return false; return true; @@ -698,7 +693,7 @@ public class MCash extends X_C_Cash implements DocAction { log.info(toString()); // Before reverseCorrect - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT); if (m_processMsg != null) return false; @@ -707,7 +702,7 @@ public class MCash extends X_C_Cash implements DocAction if (retValue) { // After reverseCorrect - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT); if (m_processMsg != null) return false; } @@ -723,12 +718,12 @@ public class MCash extends X_C_Cash implements DocAction { log.info(toString()); // Before reverseAccrual - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL); if (m_processMsg != null) return false; // After reverseAccrual - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL); if (m_processMsg != null) return false; @@ -743,7 +738,7 @@ public class MCash extends X_C_Cash implements DocAction { log.info(toString()); // Before reActivate - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE); if (m_processMsg != null) return false; @@ -752,7 +747,7 @@ public class MCash extends X_C_Cash implements DocAction return true; // After reActivate - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE); if (m_processMsg != null) return false; return false; @@ -765,10 +760,10 @@ public class MCash extends X_C_Cash implements DocAction public void setProcessed (boolean processed) { super.setProcessed (processed); - StringBuilder sql = new StringBuilder("UPDATE C_CashLine SET Processed='") - .append((processed ? "Y" : "N")) - .append("' WHERE C_Cash_ID=").append(getC_Cash_ID()); - int noLine = DB.executeUpdate (sql.toString(), get_TrxName()); + String sql = "UPDATE C_CashLine SET Processed='" + + (processed ? "Y" : "N") + + "' WHERE C_Cash_ID=" + getC_Cash_ID(); + int noLine = DB.executeUpdate (sql, get_TrxName()); m_lines = null; log.fine(processed + " - Lines=" + noLine); } // setProcessed @@ -779,7 +774,7 @@ public class MCash extends X_C_Cash implements DocAction */ public String toString () { - StringBuilder sb = new StringBuilder ("MCash["); + StringBuffer sb = new StringBuffer ("MCash["); sb.append (get_ID ()) .append ("-").append (getName()) .append(", Balance=").append(getBeginningBalance()) @@ -794,7 +789,7 @@ public class MCash extends X_C_Cash implements DocAction */ public String getSummary() { - StringBuilder sb = new StringBuilder(); + StringBuffer sb = new StringBuffer(); sb.append(getName()); // : Total Lines = 123.00 (#1) sb.append(": ") @@ -814,7 +809,7 @@ public class MCash extends X_C_Cash implements DocAction */ public String getProcessMsg() { - return m_processMsg.toString(); + return m_processMsg; } // getProcessMsg /** diff --git a/org.adempiere.base/src/org/compiere/model/MInOut.java b/org.adempiere.base/src/org/compiere/model/MInOut.java index 77c39ee3fe..6d28cfe442 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOut.java +++ b/org.adempiere.base/src/org/compiere/model/MInOut.java @@ -564,10 +564,8 @@ public class MInOut extends X_M_InOut implements DocAction String desc = getDescription(); if (desc == null) setDescription(description); - else{ - StringBuilder msgsd = new StringBuilder(desc).append(" | ").append(description); - setDescription(msgsd.toString()); - } + else + setDescription(desc + " | " + description); } // addDescription /** @@ -576,7 +574,7 @@ public class MInOut extends X_M_InOut implements DocAction */ public String toString () { - StringBuilder sb = new StringBuilder ("MInOut[") + StringBuffer sb = new StringBuffer ("MInOut[") .append (get_ID()).append("-").append(getDocumentNo()) .append(",DocStatus=").append(getDocStatus()) .append ("]"); @@ -590,8 +588,7 @@ public class MInOut extends X_M_InOut implements DocAction public String getDocumentInfo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); - StringBuilder msgreturn = new StringBuilder(dt.getName()).append(" ").append(getDocumentNo()); - return msgreturn.toString(); + return dt.getName() + " " + getDocumentNo(); } // getDocumentInfo /** @@ -602,8 +599,7 @@ public class MInOut extends X_M_InOut implements DocAction { try { - StringBuilder msgfile = new StringBuilder(get_TableName()).append(get_ID()).append("_"); - File temp = File.createTempFile(msgfile.toString(), ".pdf"); + File temp = File.createTempFile(get_TableName()+get_ID()+"_", ".pdf"); return createPDF (temp); } catch (Exception e) @@ -805,10 +801,10 @@ public class MInOut extends X_M_InOut implements DocAction super.setProcessed (processed); if (get_ID() == 0) return; - StringBuilder sql = new StringBuilder("UPDATE M_InOutLine SET Processed='") - .append((processed ? "Y" : "N")) - .append("' WHERE M_InOut_ID=").append(getM_InOut_ID()); - int noLine = DB.executeUpdate(sql.toString(), get_TrxName()); + String sql = "UPDATE M_InOutLine SET Processed='" + + (processed ? "Y" : "N") + + "' WHERE M_InOut_ID=" + getM_InOut_ID(); + int noLine = DB.executeUpdate(sql, get_TrxName()); m_lines = null; log.fine(processed + " - Lines=" + noLine); } // setProcessed @@ -1049,12 +1045,12 @@ public class MInOut extends X_M_InOut implements DocAction if (is_ValueChanged("AD_Org_ID")) { - StringBuilder sql = new StringBuilder("UPDATE M_InOutLine ol") - .append(" SET AD_Org_ID =") - .append("(SELECT AD_Org_ID") - .append(" FROM M_InOut o WHERE ol.M_InOut_ID=o.M_InOut_ID) ") - .append("WHERE M_InOut_ID=").append(getC_Order_ID()); - int no = DB.executeUpdate(sql.toString(), get_TrxName()); + String sql = "UPDATE M_InOutLine ol" + + " SET AD_Org_ID =" + + "(SELECT AD_Org_ID" + + " FROM M_InOut o WHERE ol.M_InOut_ID=o.M_InOut_ID) " + + "WHERE M_InOut_ID=" + getC_Order_ID(); + int no = DB.executeUpdate(sql, get_TrxName()); log.fine("Lines -> #" + no); } return true; @@ -1074,7 +1070,7 @@ public class MInOut extends X_M_InOut implements DocAction } // process /** Process Message */ - private StringBuffer m_processMsg = null; + private String m_processMsg = null; /** Just Prepared Flag */ private boolean m_justPrepared = false; @@ -1107,7 +1103,7 @@ public class MInOut extends X_M_InOut implements DocAction public String prepareIt() { log.info(toString()); - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -1116,13 +1112,13 @@ public class MInOut extends X_M_InOut implements DocAction // Order OR RMA can be processed on a shipment/receipt if (getC_Order_ID() != 0 && getM_RMA_ID() != 0) { - m_processMsg = new StringBuffer("@OrderOrRMA@"); + m_processMsg = "@OrderOrRMA@"; return DocAction.STATUS_Invalid; } // Std Period open? if (!MPeriod.isOpen(getCtx(), getDateAcct(), dt.getDocBaseType(), getAD_Org_ID())) { - m_processMsg = new StringBuffer("@PeriodClosed@"); + m_processMsg = "@PeriodClosed@"; return DocAction.STATUS_Invalid; } @@ -1137,24 +1133,24 @@ public class MInOut extends X_M_InOut implements DocAction MBPartner bp = new MBPartner (getCtx(), getC_BPartner_ID(), get_TrxName()); if (MBPartner.SOCREDITSTATUS_CreditStop.equals(bp.getSOCreditStatus())) { - m_processMsg = new StringBuffer("@BPartnerCreditStop@ - @TotalOpenBalance@=") - .append(bp.getTotalOpenBalance()) - .append(", @SO_CreditLimit@=").append(bp.getSO_CreditLimit()); + m_processMsg = "@BPartnerCreditStop@ - @TotalOpenBalance@=" + + bp.getTotalOpenBalance() + + ", @SO_CreditLimit@=" + bp.getSO_CreditLimit(); return DocAction.STATUS_Invalid; } if (MBPartner.SOCREDITSTATUS_CreditHold.equals(bp.getSOCreditStatus())) { - m_processMsg = new StringBuffer("@BPartnerCreditHold@ - @TotalOpenBalance@=") - .append(bp.getTotalOpenBalance()) - .append(", @SO_CreditLimit@=").append(bp.getSO_CreditLimit()); + m_processMsg = "@BPartnerCreditHold@ - @TotalOpenBalance@=" + + bp.getTotalOpenBalance() + + ", @SO_CreditLimit@=" + bp.getSO_CreditLimit(); return DocAction.STATUS_Invalid; } BigDecimal notInvoicedAmt = MBPartner.getNotInvoicedAmt(getC_BPartner_ID()); if (MBPartner.SOCREDITSTATUS_CreditHold.equals(bp.getSOCreditStatus(notInvoicedAmt))) { - m_processMsg = new StringBuffer("@BPartnerOverSCreditHold@ - @TotalOpenBalance@=") - .append(bp.getTotalOpenBalance()).append(", @NotInvoicedAmt@=").append(notInvoicedAmt) - .append(", @SO_CreditLimit@=").append(bp.getSO_CreditLimit()); + m_processMsg = "@BPartnerOverSCreditHold@ - @TotalOpenBalance@=" + + bp.getTotalOpenBalance() + ", @NotInvoicedAmt@=" + notInvoicedAmt + + ", @SO_CreditLimit@=" + bp.getSO_CreditLimit(); return DocAction.STATUS_Invalid; } } @@ -1164,7 +1160,7 @@ public class MInOut extends X_M_InOut implements DocAction MInOutLine[] lines = getLines(true); if (lines == null || lines.length == 0) { - m_processMsg = new StringBuffer("@NoLines@"); + m_processMsg = "@NoLines@"; return DocAction.STATUS_Invalid; } BigDecimal Volume = Env.ZERO; @@ -1185,8 +1181,8 @@ public class MInOut extends X_M_InOut implements DocAction continue; if (product != null && product.isASIMandatory(isSOTrx())) { - m_processMsg = new StringBuffer("@M_AttributeSet_ID@ @IsMandatory@ (@Line@ #").append(lines[i].getLine()) - .append(", @M_Product_ID@=").append(product.getValue()).append(")"); + m_processMsg = "@M_AttributeSet_ID@ @IsMandatory@ (@Line@ #" + lines[i].getLine() + + ", @M_Product_ID@=" + product.getValue() + ")"; return DocAction.STATUS_Invalid; } } @@ -1198,7 +1194,7 @@ public class MInOut extends X_M_InOut implements DocAction createConfirmation(); } - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -1244,7 +1240,7 @@ public class MInOut extends X_M_InOut implements DocAction return status; } - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -1258,8 +1254,8 @@ public class MInOut extends X_M_InOut implements DocAction if (MInOutConfirm.CONFIRMTYPE_CustomerConfirmation.equals(confirm.getConfirmType())) continue; // - m_processMsg = new StringBuffer("Open @M_InOutConfirm_ID@: ") - .append(confirm.getConfirmTypeName()).append(" - ").append(confirm.getDocumentNo()); + m_processMsg = "Open @M_InOutConfirm_ID@: " + + confirm.getConfirmTypeName() + " - " + confirm.getDocumentNo(); return DocAction.STATUS_InProgress; } } @@ -1269,7 +1265,7 @@ public class MInOut extends X_M_InOut implements DocAction if (!isApproved()) approveIt(); log.info(toString()); - StringBuilder info = new StringBuilder(); + StringBuffer info = new StringBuffer(); // For all lines MInOutLine[] lines = getLines(false); @@ -1363,7 +1359,7 @@ public class MInOut extends X_M_InOut implements DocAction get_TrxName())) { String lastError = CLogger.retrieveErrorString(""); - m_processMsg = new StringBuffer("Cannot correct Inventory (MA) - ").append(lastError); + m_processMsg = "Cannot correct Inventory (MA) - " + lastError; return DocAction.STATUS_Invalid; } if (!sameWarehouse) { @@ -1375,7 +1371,7 @@ public class MInOut extends X_M_InOut implements DocAction ma.getM_AttributeSetInstance_ID(), reservationAttributeSetInstance_ID, Env.ZERO, reservedDiff, orderedDiff, get_TrxName())) { - m_processMsg = new StringBuffer("Cannot correct Inventory (MA) in order warehouse"); + m_processMsg = "Cannot correct Inventory (MA) in order warehouse"; return DocAction.STATUS_Invalid; } } @@ -1387,7 +1383,7 @@ public class MInOut extends X_M_InOut implements DocAction mtrx.setM_InOutLine_ID(sLine.getM_InOutLine_ID()); if (!mtrx.save()) { - m_processMsg = new StringBuffer("Could not create Material Transaction (MA)"); + m_processMsg = "Could not create Material Transaction (MA)"; return DocAction.STATUS_Invalid; } } @@ -1405,7 +1401,7 @@ public class MInOut extends X_M_InOut implements DocAction sLine.getM_AttributeSetInstance_ID(), reservationAttributeSetInstance_ID, Qty, reservedDiff, orderedDiff, get_TrxName())) { - m_processMsg = new StringBuffer("Cannot correct Inventory"); + m_processMsg = "Cannot correct Inventory"; return DocAction.STATUS_Invalid; } if (!sameWarehouse) { @@ -1417,7 +1413,7 @@ public class MInOut extends X_M_InOut implements DocAction sLine.getM_AttributeSetInstance_ID(), reservationAttributeSetInstance_ID, Env.ZERO, QtySO.negate(), QtyPO.negate(), get_TrxName())) { - m_processMsg = new StringBuffer("Cannot correct Inventory"); + m_processMsg = "Cannot correct Inventory"; return DocAction.STATUS_Invalid; } } @@ -1429,7 +1425,7 @@ public class MInOut extends X_M_InOut implements DocAction mtrx.setM_InOutLine_ID(sLine.getM_InOutLine_ID()); if (!mtrx.save()) { - m_processMsg = new StringBuffer(CLogger.retrieveErrorString("Could not create Material Transaction")); + m_processMsg = CLogger.retrieveErrorString("Could not create Material Transaction"); return DocAction.STATUS_Invalid; } } @@ -1453,7 +1449,7 @@ public class MInOut extends X_M_InOut implements DocAction } if (!oLine.save()) { - m_processMsg = new StringBuffer("Could not update Order Line"); + m_processMsg = "Could not update Order Line"; return DocAction.STATUS_Invalid; } else @@ -1473,7 +1469,7 @@ public class MInOut extends X_M_InOut implements DocAction } if (!rmaLine.save()) { - m_processMsg = new StringBuffer("Could not update RMA Line"); + m_processMsg = "Could not update RMA Line"; return DocAction.STATUS_Invalid; } } @@ -1500,7 +1496,7 @@ public class MInOut extends X_M_InOut implements DocAction MAsset asset = new MAsset (this, sLine, deliveryCount); if (!asset.save(get_TrxName())) { - m_processMsg = new StringBuffer("Could not create Asset"); + m_processMsg = "Could not create Asset"; return DocAction.STATUS_Invalid; } info.append(asset.getValue()); @@ -1537,7 +1533,7 @@ public class MInOut extends X_M_InOut implements DocAction isNewMatchInv = true; if (!inv.save(get_TrxName())) { - m_processMsg = new StringBuffer(CLogger.retrieveErrorString("Could not create Inv Matching")); + m_processMsg = CLogger.retrieveErrorString("Could not create Inv Matching"); return DocAction.STATUS_Invalid; } if (isNewMatchInv) @@ -1556,7 +1552,7 @@ public class MInOut extends X_M_InOut implements DocAction isNewMatchPO = true; if (!po.save(get_TrxName())) { - m_processMsg = new StringBuffer("Could not create PO Matching"); + m_processMsg = "Could not create PO Matching"; return DocAction.STATUS_Invalid; } if (isNewMatchPO) @@ -1584,7 +1580,7 @@ public class MInOut extends X_M_InOut implements DocAction isNewMatchPO = true; if (!po.save(get_TrxName())) { - m_processMsg = new StringBuffer("Could not create PO(Inv) Matching"); + m_processMsg = "Could not create PO(Inv) Matching"; return DocAction.STATUS_Invalid; } if (isNewMatchPO) @@ -1616,14 +1612,14 @@ public class MInOut extends X_M_InOut implements DocAction String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE); if (valid != null) { - m_processMsg = new StringBuffer(valid); + m_processMsg = valid; return DocAction.STATUS_Invalid; } // Set the definite document number after completed (if needed) setDefiniteDocumentNo(); - m_processMsg = new StringBuffer(info.toString()); + m_processMsg = info.toString(); setProcessed(true); setDocAction(DOCACTION_Close); return DocAction.STATUS_Completed; @@ -1946,7 +1942,7 @@ public class MInOut extends X_M_InOut implements DocAction { log.info(toString()); // Before Void - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID); if (m_processMsg != null) return false; @@ -1954,7 +1950,7 @@ public class MInOut extends X_M_InOut implements DocAction || DOCSTATUS_Reversed.equals(getDocStatus()) || DOCSTATUS_Voided.equals(getDocStatus())) { - m_processMsg = new StringBuffer("Document Closed: ").append(getDocStatus()); + m_processMsg = "Document Closed: " + getDocStatus(); return false; } @@ -1974,8 +1970,7 @@ public class MInOut extends X_M_InOut implements DocAction if (old.signum() != 0) { line.setQty(Env.ZERO); - StringBuilder msgd = new StringBuilder("Void (").append(old).append(")"); - line.addDescription(msgd.toString()); + line.addDescription("Void (" + old + ")"); line.saveEx(get_TrxName()); } } @@ -1991,7 +1986,7 @@ public class MInOut extends X_M_InOut implements DocAction } // After Void - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID); if (m_processMsg != null) return false; @@ -2008,7 +2003,7 @@ public class MInOut extends X_M_InOut implements DocAction { log.info(toString()); // Before Close - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE); if (m_processMsg != null) return false; @@ -2016,7 +2011,7 @@ public class MInOut extends X_M_InOut implements DocAction setDocAction(DOCACTION_None); // After Close - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE); if (m_processMsg != null) return false; return true; @@ -2030,14 +2025,14 @@ public class MInOut extends X_M_InOut implements DocAction { log.info(toString()); // Before reverseCorrect - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT); if (m_processMsg != null) return false; MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); if (!MPeriod.isOpen(getCtx(), getDateAcct(), dt.getDocBaseType(), getAD_Org_ID())) { - m_processMsg = new StringBuffer("@PeriodClosed@"); + m_processMsg = "@PeriodClosed@"; return false; } @@ -2066,7 +2061,7 @@ public class MInOut extends X_M_InOut implements DocAction getC_DocType_ID(), isSOTrx(), false, get_TrxName(), true); if (reversal == null) { - m_processMsg = new StringBuffer("Could not create Ship Reversal"); + m_processMsg = "Could not create Ship Reversal"; return false; } reversal.setReversal(true); @@ -2084,7 +2079,7 @@ public class MInOut extends X_M_InOut implements DocAction rLine.setReversalLine_ID(sLines[i].getM_InOutLine_ID()); if (!rLine.save(get_TrxName())) { - m_processMsg = new StringBuffer("Could not correct Ship Reversal Line"); + m_processMsg = "Could not correct Ship Reversal Line"; return false; } // We need to copy MA @@ -2105,17 +2100,14 @@ public class MInOut extends X_M_InOut implements DocAction if (asset != null) { asset.setIsActive(false); - StringBuilder msgd = new StringBuilder( - "(").append(reversal.getDocumentNo()).append(" #").append(rLine.getLine()).append("<-)"); - asset.addDescription(msgd.toString()); + asset.addDescription("(" + reversal.getDocumentNo() + " #" + rLine.getLine() + "<-)"); asset.saveEx(); } } reversal.setC_Order_ID(getC_Order_ID()); // Set M_RMA_ID reversal.setM_RMA_ID(getM_RMA_ID()); - StringBuilder msgd = new StringBuilder("{->").append(getDocumentNo()).append(")"); - reversal.addDescription(msgd.toString()); + reversal.addDescription("{->" + getDocumentNo() + ")"); //FR1948157 reversal.setReversal_ID(getM_InOut_ID()); reversal.saveEx(get_TrxName()); @@ -2123,7 +2115,7 @@ public class MInOut extends X_M_InOut implements DocAction if (!reversal.processIt(DocAction.ACTION_Complete) || !reversal.getDocStatus().equals(DocAction.STATUS_Completed)) { - m_processMsg = new StringBuffer("Reversal ERROR: ").append(reversal.getProcessMsg()); + m_processMsg = "Reversal ERROR: " + reversal.getProcessMsg(); return false; } reversal.closeIt(); @@ -2132,8 +2124,7 @@ public class MInOut extends X_M_InOut implements DocAction reversal.setDocAction(DOCACTION_None); reversal.saveEx(get_TrxName()); // - msgd = new StringBuilder("(").append(reversal.getDocumentNo()).append("<-)"); - addDescription(msgd.toString()); + addDescription("(" + reversal.getDocumentNo() + "<-)"); // // Void Confirmations @@ -2144,11 +2135,11 @@ public class MInOut extends X_M_InOut implements DocAction voidConfirmations(); // After reverseCorrect - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT); if (m_processMsg != null) return false; - m_processMsg = new StringBuffer(reversal.getDocumentNo()); + m_processMsg = reversal.getDocumentNo(); setProcessed(true); setDocStatus(DOCSTATUS_Reversed); // may come from void setDocAction(DOCACTION_None); @@ -2163,12 +2154,12 @@ public class MInOut extends X_M_InOut implements DocAction { log.info(toString()); // Before reverseAccrual - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL); if (m_processMsg != null) return false; // After reverseAccrual - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL); if (m_processMsg != null) return false; @@ -2183,12 +2174,12 @@ public class MInOut extends X_M_InOut implements DocAction { log.info(toString()); // Before reActivate - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE); if (m_processMsg != null) return false; // After reActivate - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE); if (m_processMsg != null) return false; @@ -2202,7 +2193,7 @@ public class MInOut extends X_M_InOut implements DocAction */ public String getSummary() { - StringBuilder sb = new StringBuilder(); + StringBuffer sb = new StringBuffer(); sb.append(getDocumentNo()); // : Total Lines = 123.00 (#1) sb.append(":") @@ -2220,7 +2211,7 @@ public class MInOut extends X_M_InOut implements DocAction */ public String getProcessMsg() { - return m_processMsg.toString(); + return m_processMsg; } // getProcessMsg /** diff --git a/org.adempiere.base/src/org/compiere/model/MInOutConfirm.java b/org.adempiere.base/src/org/compiere/model/MInOutConfirm.java index aefea48bf7..03d6dfdad4 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOutConfirm.java +++ b/org.adempiere.base/src/org/compiere/model/MInOutConfirm.java @@ -174,10 +174,8 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction String desc = getDescription(); if (desc == null) setDescription(description); - else{ - StringBuilder msgd = new StringBuilder(desc).append(" | ").append(description); - setDescription(msgd.toString()); - } + else + setDescription(desc + " | " + description); } // addDescription /** @@ -195,7 +193,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction */ public String toString () { - StringBuilder sb = new StringBuilder ("MInOutConfirm["); + StringBuffer sb = new StringBuffer ("MInOutConfirm["); sb.append(get_ID()).append("-").append(getSummary()) .append ("]"); return sb.toString (); @@ -207,8 +205,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction */ public String getDocumentInfo() { - StringBuilder msgreturn = new StringBuilder(Msg.getElement(getCtx(), "M_InOutConfirm_ID")).append(" ").append(getDocumentNo()); - return msgreturn.toString(); + return Msg.getElement(getCtx(), "M_InOutConfirm_ID") + " " + getDocumentNo(); } // getDocumentInfo /** @@ -219,8 +216,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction { try { - StringBuilder msgfile = new StringBuilder(get_TableName()).append(get_ID()).append("_"); - File temp = File.createTempFile(msgfile.toString(), ".pdf"); + File temp = File.createTempFile(get_TableName()+get_ID()+"_", ".pdf"); return createPDF (temp); } catch (Exception e) @@ -253,11 +249,11 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction { int AD_User_ID = Env.getAD_User_ID(getCtx()); MUser user = MUser.get(getCtx(), AD_User_ID); - StringBuilder info = new StringBuilder(user.getName()) - .append(": ") - .append(Msg.translate(getCtx(), "IsApproved")) - .append(" - ").append(new Timestamp(System.currentTimeMillis())); - addDescription(info.toString()); + String info = user.getName() + + ": " + + Msg.translate(getCtx(), "IsApproved") + + " - " + new Timestamp(System.currentTimeMillis()); + addDescription(info); } super.setIsApproved (IsApproved); } // setIsApproved @@ -276,7 +272,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction } // processIt /** Process Message */ - private StringBuffer m_processMsg = null; + private String m_processMsg = null; /** Just Prepared Flag */ private boolean m_justPrepared = false; @@ -309,7 +305,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction public String prepareIt() { log.info(toString()); - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -327,7 +323,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction MInOutLineConfirm[] lines = getLines(true); if (lines.length == 0) { - m_processMsg = new StringBuffer("@NoLines@"); + m_processMsg = "@NoLines@"; return DocAction.STATUS_Invalid; } // Set dispute if not fully confirmed @@ -342,7 +338,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction } setIsInDispute(difference); - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE); if (m_processMsg != null) return DocAction.STATUS_Invalid; // @@ -388,7 +384,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction return status; } - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -408,7 +404,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction { if (dt.getC_DocTypeDifference_ID() == 0) { - m_processMsg = new StringBuffer("No Split Document Type defined for: ").append(dt.getName()); + m_processMsg = "No Split Document Type defined for: " + dt.getName(); return DocAction.STATUS_Invalid; } splitInOut (inout, dt.getC_DocTypeDifference_ID(), lines); @@ -423,7 +419,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction confirmLine.set_TrxName(get_TrxName()); if (!confirmLine.processLine (inout.isSOTrx(), getConfirmType())) { - m_processMsg = new StringBuffer("ShipLine not saved - ").append(confirmLine); + m_processMsg = "ShipLine not saved - " + confirmLine; return DocAction.STATUS_Invalid; } if (confirmLine.isFullyConfirmed()) @@ -448,9 +444,9 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction } // for all lines if (m_creditMemo != null) - m_processMsg.append(" @C_Invoice_ID@=").append(m_creditMemo.getDocumentNo()); + m_processMsg += " @C_Invoice_ID@=" + m_creditMemo.getDocumentNo(); if (m_inventory != null) - m_processMsg.append(" @M_Inventory_ID@=").append(m_inventory.getDocumentNo()); + m_processMsg += " @M_Inventory_ID@=" + m_inventory.getDocumentNo(); // Try to complete Shipment @@ -461,7 +457,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE); if (valid != null) { - m_processMsg = new StringBuffer(valid); + m_processMsg = valid; return DocAction.STATUS_Invalid; } @@ -494,12 +490,10 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction if (split == null) { split = new MInOut (original, C_DocType_ID, original.getMovementDate()); - StringBuilder msgd = new StringBuilder("Splitted from ").append(original.getDocumentNo()); - split.addDescription(msgd.toString()); + split.addDescription("Splitted from " + original.getDocumentNo()); split.setIsInDispute(true); split.saveEx(); - msgd = new StringBuilder("Split: ").append(split.getDocumentNo()); - original.addDescription(msgd.toString()); + original.addDescription("Split: " + split.getDocumentNo()); original.saveEx(); } // @@ -514,14 +508,12 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction splitLine.setM_Product_ID(oldLine.getM_Product_ID()); splitLine.setM_Warehouse_ID(oldLine.getM_Warehouse_ID()); splitLine.setRef_InOutLine_ID(oldLine.getRef_InOutLine_ID()); - StringBuilder msgd = new StringBuilder("Split: from ").append(oldLine.getMovementQty()); - splitLine.addDescription(msgd.toString()); + splitLine.addDescription("Split: from " + oldLine.getMovementQty()); // Qtys splitLine.setQty(differenceQty); // Entered/Movement splitLine.saveEx(); // Old - msgd = new StringBuilder("Splitted: from ").append(oldLine.getMovementQty()); - oldLine.addDescription(msgd.toString()); + oldLine.addDescription("Splitted: from " + oldLine.getMovementQty()); oldLine.setQty(oldLine.getMovementQty().subtract(differenceQty)); oldLine.saveEx(); // Update Confirmation Line @@ -536,8 +528,8 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction return ; } - m_processMsg = new StringBuffer("Split @M_InOut_ID@=").append(split.getDocumentNo()) - .append(" - @M_InOutConfirm_ID@="); + m_processMsg = "Split @M_InOut_ID@=" + split.getDocumentNo() + + " - @M_InOutConfirm_ID@="; MDocType dt = MDocType.get(getCtx(), original.getC_DocType_ID()); if (!dt.isPrepareSplitDocument()) @@ -560,13 +552,13 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction index++; // try just next if (splitConfirms[index].isProcessed()) { - m_processMsg.append(splitConfirms[index].getDocumentNo()).append(" processed??"); + m_processMsg += splitConfirms[index].getDocumentNo() + " processed??"; return; } } splitConfirms[index].setIsInDispute(true); splitConfirms[index].saveEx(); - m_processMsg.append(splitConfirms[index].getDocumentNo()); + m_processMsg += splitConfirms[index].getDocumentNo(); // Set Lines to unconfirmed MInOutLineConfirm[] splitConfirmLines = splitConfirms[index].getLines(false); for (int i = 0; i < splitConfirmLines.length; i++) @@ -578,7 +570,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction } } else - m_processMsg.append("??"); + m_processMsg += "??"; } // splitInOut @@ -592,9 +584,9 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction private boolean createDifferenceDoc (MInOut inout, MInOutLineConfirm confirm) { if (m_processMsg == null) - m_processMsg = new StringBuffer(); + m_processMsg = ""; else if (m_processMsg.length() > 0) - m_processMsg.append("; "); + m_processMsg += "; "; // Credit Memo if linked Document if (confirm.getDifferenceQty().signum() != 0 && !inout.isSOTrx() && inout.getRef_InOut_ID() != 0) @@ -603,8 +595,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction if (m_creditMemo == null) { m_creditMemo = new MInvoice (inout, null); - StringBuilder msgd = new StringBuilder(Msg.translate(getCtx(), "M_InOutConfirm_ID")).append(" ").append(getDocumentNo()); - m_creditMemo.setDescription(msgd.toString()); + m_creditMemo.setDescription(Msg.translate(getCtx(), "M_InOutConfirm_ID") + " " + getDocumentNo()); m_creditMemo.setC_DocTypeTarget_ID(MDocType.DOCBASETYPE_APCreditMemo); m_creditMemo.saveEx(); setC_Invoice_ID(m_creditMemo.getC_Invoice_ID()); @@ -629,8 +620,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction { MWarehouse wh = MWarehouse.get(getCtx(), inout.getM_Warehouse_ID()); m_inventory = new MInventory (wh, get_TrxName()); - StringBuilder msgd = new StringBuilder(Msg.translate(getCtx(), "M_InOutConfirm_ID")).append(" ").append(getDocumentNo()); - m_inventory.setDescription(msgd.toString()); + m_inventory.setDescription(Msg.translate(getCtx(), "M_InOutConfirm_ID") + " " + getDocumentNo()); m_inventory.saveEx(); setM_Inventory_ID(m_inventory.getM_Inventory_ID()); } @@ -640,7 +630,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction confirm.getScrappedQty(), Env.ZERO); if (!line.save(get_TrxName())) { - m_processMsg.append("Inventory Line not created"); + m_processMsg += "Inventory Line not created"; return false; } confirm.setM_InventoryLine_ID(line.getM_InventoryLine_ID()); @@ -649,7 +639,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction // if (!confirm.save(get_TrxName())) { - m_processMsg.append("Confirmation Line not saved"); + m_processMsg += "Confirmation Line not saved"; return false; } return true; @@ -663,7 +653,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction { log.info(toString()); // Before Void - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID); if (m_processMsg != null) return false; @@ -671,7 +661,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction || DOCSTATUS_Reversed.equals(getDocStatus()) || DOCSTATUS_Voided.equals(getDocStatus())) { - m_processMsg = new StringBuffer("Document Closed: ").append(getDocStatus()); + m_processMsg = "Document Closed: " + getDocStatus(); return false; } @@ -705,7 +695,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction } // After Void - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID); if (m_processMsg != null) return false; @@ -723,14 +713,14 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction { log.info(toString()); // Before Close - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE); if (m_processMsg != null) return false; setDocAction(DOCACTION_None); // After Close - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE); if (m_processMsg != null) return false; @@ -745,12 +735,12 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction { log.info(toString()); // Before reverseCorrect - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT); if (m_processMsg != null) return false; // After reverseCorrect - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT); if (m_processMsg != null) return false; @@ -765,12 +755,12 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction { log.info(toString()); // Before reverseAccrual - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL); if (m_processMsg != null) return false; // After reverseAccrual - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL); if (m_processMsg != null) return false; @@ -785,12 +775,12 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction { log.info(toString()); // Before reActivate - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE); if (m_processMsg != null) return false; // After reActivate - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE); if (m_processMsg != null) return false; @@ -804,7 +794,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction */ public String getSummary() { - StringBuilder sb = new StringBuilder(); + StringBuffer sb = new StringBuffer(); sb.append(getDocumentNo()); // : Total Lines = 123.00 (#1) sb.append(": ") @@ -822,7 +812,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction */ public String getProcessMsg() { - return m_processMsg.toString(); + return m_processMsg; } // getProcessMsg /** diff --git a/org.adempiere.base/src/org/compiere/model/MInventory.java b/org.adempiere.base/src/org/compiere/model/MInventory.java index 44ffd744ac..3a8a4f6cdc 100644 --- a/org.adempiere.base/src/org/compiere/model/MInventory.java +++ b/org.adempiere.base/src/org/compiere/model/MInventory.java @@ -162,10 +162,8 @@ public class MInventory extends X_M_Inventory implements DocAction String desc = getDescription(); if (desc == null) setDescription(description); - else{ - StringBuilder msgreturn = new StringBuilder(desc).append(" | ").append(description); - setDescription(msgreturn.toString()); - } + else + setDescription(desc + " | " + description); } // addDescription /** @@ -184,7 +182,7 @@ public class MInventory extends X_M_Inventory implements DocAction */ public String toString () { - StringBuilder sb = new StringBuilder ("MInventory["); + StringBuffer sb = new StringBuffer ("MInventory["); sb.append (get_ID()) .append ("-").append (getDocumentNo()) .append (",M_Warehouse_ID=").append(getM_Warehouse_ID()) @@ -199,8 +197,7 @@ public class MInventory extends X_M_Inventory implements DocAction public String getDocumentInfo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); - StringBuilder msgreturn = new StringBuilder(dt.getName()).append(" ").append(getDocumentNo()); - return msgreturn.toString(); + return dt.getName() + " " + getDocumentNo(); } // getDocumentInfo /** @@ -211,8 +208,7 @@ public class MInventory extends X_M_Inventory implements DocAction { try { - StringBuilder msgfile = new StringBuilder(get_TableName()).append(get_ID()).append("_"); - File temp = File.createTempFile(msgfile.toString(), ".pdf"); + File temp = File.createTempFile(get_TableName()+get_ID()+"_", ".pdf"); return createPDF (temp); } catch (Exception e) @@ -289,7 +285,7 @@ public class MInventory extends X_M_Inventory implements DocAction } // processIt /** Process Message */ - private StringBuffer m_processMsg = null; + private String m_processMsg = null; /** Just Prepared Flag */ private boolean m_justPrepared = false; @@ -322,7 +318,7 @@ public class MInventory extends X_M_Inventory implements DocAction public String prepareIt() { log.info(toString()); - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -331,14 +327,14 @@ public class MInventory extends X_M_Inventory implements DocAction MInventoryLine[] lines = getLines(false); if (lines.length == 0) { - m_processMsg = new StringBuffer("@NoLines@"); + m_processMsg = "@NoLines@"; return DocAction.STATUS_Invalid; } // TODO: Add up Amounts // setApprovalAmt(); - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -384,7 +380,7 @@ public class MInventory extends X_M_Inventory implements DocAction return status; } - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -444,7 +440,7 @@ public class MInventory extends X_M_Inventory implements DocAction QtyMA.negate(), Env.ZERO, Env.ZERO, get_TrxName())) { String lastError = CLogger.retrieveErrorString(""); - m_processMsg = new StringBuffer("Cannot correct Inventory (MA) - ").append(lastError); + m_processMsg = "Cannot correct Inventory (MA) - " + lastError; return DocAction.STATUS_Invalid; } @@ -456,7 +452,7 @@ public class MInventory extends X_M_Inventory implements DocAction storage.setDateLastInventory(getMovementDate()); if (!storage.save(get_TrxName())) { - m_processMsg = new StringBuffer("Storage not updated(2)"); + m_processMsg = "Storage not updated(2)"; return DocAction.STATUS_Invalid; } } @@ -474,7 +470,7 @@ public class MInventory extends X_M_Inventory implements DocAction mtrx.setM_InventoryLine_ID(line.getM_InventoryLine_ID()); if (!mtrx.save()) { - m_processMsg = new StringBuffer("Transaction not inserted(2)"); + m_processMsg = "Transaction not inserted(2)"; return DocAction.STATUS_Invalid; } @@ -494,7 +490,7 @@ public class MInventory extends X_M_Inventory implements DocAction line.getM_AttributeSetInstance_ID(), 0, qtyDiff, Env.ZERO, Env.ZERO, get_TrxName())) { - m_processMsg = new StringBuffer("Cannot correct Inventory (MA)"); + m_processMsg = "Cannot correct Inventory (MA)"; return DocAction.STATUS_Invalid; } @@ -507,7 +503,7 @@ public class MInventory extends X_M_Inventory implements DocAction storage.setDateLastInventory(getMovementDate()); if (!storage.save(get_TrxName())) { - m_processMsg = new StringBuffer("Storage not updated(2)"); + m_processMsg = "Storage not updated(2)"; return DocAction.STATUS_Invalid; } } @@ -524,7 +520,7 @@ public class MInventory extends X_M_Inventory implements DocAction mtrx.setM_InventoryLine_ID(line.getM_InventoryLine_ID()); if (!mtrx.save()) { - m_processMsg = new StringBuffer("Transaction not inserted(2)"); + m_processMsg = "Transaction not inserted(2)"; return DocAction.STATUS_Invalid; } } // Fallback @@ -536,7 +532,7 @@ public class MInventory extends X_M_Inventory implements DocAction String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE); if (valid != null) { - m_processMsg = new StringBuffer(valid); + m_processMsg = valid; return DocAction.STATUS_Invalid; } @@ -661,7 +657,7 @@ public class MInventory extends X_M_Inventory implements DocAction { log.info(toString()); // Before Void - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID); if (m_processMsg != null) return false; @@ -669,7 +665,7 @@ public class MInventory extends X_M_Inventory implements DocAction || DOCSTATUS_Reversed.equals(getDocStatus()) || DOCSTATUS_Voided.equals(getDocStatus())) { - m_processMsg = new StringBuffer("Document Closed: ").append(getDocStatus()); + m_processMsg = "Document Closed: " + getDocStatus(); return false; } @@ -692,8 +688,7 @@ public class MInventory extends X_M_Inventory implements DocAction { line.setQtyInternalUse(Env.ZERO); line.setQtyCount(line.getQtyBook()); - StringBuilder msgd = new StringBuilder("Void (").append(oldCount).append("/").append(oldInternal).append(")"); - line.addDescription(msgd.toString()); + line.addDescription("Void (" + oldCount + "/" + oldInternal + ")"); line.saveEx(get_TrxName()); } } @@ -704,7 +699,7 @@ public class MInventory extends X_M_Inventory implements DocAction } // After Void - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID); if (m_processMsg != null) return false; setProcessed(true); @@ -720,13 +715,13 @@ public class MInventory extends X_M_Inventory implements DocAction { log.info(toString()); // Before Close - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE); if (m_processMsg != null) return false; setDocAction(DOCACTION_None); // After Close - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE); if (m_processMsg != null) return false; return true; @@ -740,7 +735,7 @@ public class MInventory extends X_M_Inventory implements DocAction { log.info(toString()); // Before reverseCorrect - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT); if (m_processMsg != null) return false; @@ -755,8 +750,7 @@ public class MInventory extends X_M_Inventory implements DocAction reversal.setIsApproved (false); reversal.setPosted(false); reversal.setProcessed(false); - StringBuilder msgd = new StringBuilder("{->").append(getDocumentNo()).append(")"); - reversal.addDescription(msgd.toString()); + reversal.addDescription("{->" + getDocumentNo() + ")"); //FR1948157 reversal.setReversal_ID(getM_Inventory_ID()); reversal.saveEx(); @@ -798,20 +792,19 @@ public class MInventory extends X_M_Inventory implements DocAction // if (!reversal.processIt(DocAction.ACTION_Complete)) { - m_processMsg = new StringBuffer("Reversal ERROR: ").append(reversal.getProcessMsg()); + m_processMsg = "Reversal ERROR: " + reversal.getProcessMsg(); return false; } reversal.closeIt(); reversal.setDocStatus(DOCSTATUS_Reversed); reversal.setDocAction(DOCACTION_None); reversal.saveEx(); - m_processMsg = new StringBuffer(reversal.getDocumentNo()); + m_processMsg = reversal.getDocumentNo(); // Update Reversed (this) - msgd = new StringBuilder("(").append(reversal.getDocumentNo()).append("<-)"); - addDescription(msgd.toString()); + addDescription("(" + reversal.getDocumentNo() + "<-)"); // After reverseCorrect - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT); if (m_processMsg != null) return false; setProcessed(true); @@ -831,12 +824,12 @@ public class MInventory extends X_M_Inventory implements DocAction { log.info(toString()); // Before reverseAccrual - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL); if (m_processMsg != null) return false; // After reverseAccrual - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL); if (m_processMsg != null) return false; @@ -851,12 +844,12 @@ public class MInventory extends X_M_Inventory implements DocAction { log.info(toString()); // Before reActivate - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE); if (m_processMsg != null) return false; // After reActivate - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE); if (m_processMsg != null) return false; @@ -870,7 +863,7 @@ public class MInventory extends X_M_Inventory implements DocAction */ public String getSummary() { - StringBuilder sb = new StringBuilder(); + StringBuffer sb = new StringBuffer(); sb.append(getDocumentNo()); // : Total Lines = 123.00 (#1) sb.append(": ") @@ -888,7 +881,7 @@ public class MInventory extends X_M_Inventory implements DocAction */ public String getProcessMsg() { - return m_processMsg.toString(); + return m_processMsg; } // getProcessMsg /** diff --git a/org.adempiere.base/src/org/compiere/model/MInvoice.java b/org.adempiere.base/src/org/compiere/model/MInvoice.java index 8faedb10fb..b9f4f4ae2c 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoice.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoice.java @@ -219,7 +219,7 @@ public class MInvoice extends X_C_Invoice implements DocAction */ public static String getPDFFileName (String documentDir, int C_Invoice_ID) { - StringBuilder sb = new StringBuilder (documentDir); + StringBuffer sb = new StringBuffer (documentDir); if (sb.length() == 0) sb.append("."); if (!sb.toString().endsWith(File.separator)) @@ -825,10 +825,8 @@ public class MInvoice extends X_C_Invoice implements DocAction String desc = getDescription(); if (desc == null) setDescription(description); - else{ - StringBuilder msgd = new StringBuilder(desc).append(" | ").append(description); - setDescription(msgd.toString()); - } + else + setDescription(desc + " | " + description); } // addDescription /** @@ -853,9 +851,9 @@ public class MInvoice extends X_C_Invoice implements DocAction super.setProcessed (processed); if (get_ID() == 0) return; - StringBuilder set = new StringBuilder("SET Processed='") - .append((processed ? "Y" : "N")) - .append("' WHERE C_Invoice_ID=").append(getC_Invoice_ID()); + String set = "SET Processed='" + + (processed ? "Y" : "N") + + "' WHERE C_Invoice_ID=" + getC_Invoice_ID(); int noLine = DB.executeUpdate("UPDATE C_InvoiceLine " + set, get_TrxName()); int noTax = DB.executeUpdate("UPDATE C_InvoiceTax " + set, get_TrxName()); m_lines = null; @@ -1023,7 +1021,7 @@ public class MInvoice extends X_C_Invoice implements DocAction */ public String toString () { - StringBuilder sb = new StringBuilder ("MInvoice[") + StringBuffer sb = new StringBuffer ("MInvoice[") .append(get_ID()).append("-").append(getDocumentNo()) .append(",GrandTotal=").append(getGrandTotal()); if (m_lines != null) @@ -1039,8 +1037,7 @@ public class MInvoice extends X_C_Invoice implements DocAction public String getDocumentInfo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); - StringBuilder msgreturn = new StringBuilder(dt.getName()).append(" ").append(getDocumentNo()); - return msgreturn.toString(); + return dt.getName() + " " + getDocumentNo(); } // getDocumentInfo @@ -1057,12 +1054,12 @@ public class MInvoice extends X_C_Invoice implements DocAction if (is_ValueChanged("AD_Org_ID")) { - StringBuilder sql = new StringBuilder("UPDATE C_InvoiceLine ol") - .append(" SET AD_Org_ID =") - .append("(SELECT AD_Org_ID") - .append(" FROM C_Invoice o WHERE ol.C_Invoice_ID=o.C_Invoice_ID) ") - .append("WHERE C_Invoice_ID=").append(getC_Invoice_ID()); - int no = DB.executeUpdate(sql.toString(), get_TrxName()); + String sql = "UPDATE C_InvoiceLine ol" + + " SET AD_Org_ID =" + + "(SELECT AD_Org_ID" + + " FROM C_Invoice o WHERE ol.C_Invoice_ID=o.C_Invoice_ID) " + + "WHERE C_Invoice_ID=" + getC_Invoice_ID(); + int no = DB.executeUpdate(sql, get_TrxName()); log.fine("Lines -> #" + no); } return true; @@ -1258,8 +1255,7 @@ public class MInvoice extends X_C_Invoice implements DocAction { try { - StringBuilder msgfile = new StringBuilder(get_TableName()).append(get_ID()).append("_"); - File temp = File.createTempFile(msgfile.toString(), ".pdf"); + File temp = File.createTempFile(get_TableName()+get_ID()+"_", ".pdf"); return createPDF (temp); } catch (Exception e) @@ -1339,7 +1335,7 @@ public class MInvoice extends X_C_Invoice implements DocAction } // process /** Process Message */ - private StringBuffer m_processMsg = null; + private String m_processMsg = null; /** Just Prepared Flag */ private boolean m_justPrepared = false; @@ -1372,7 +1368,7 @@ public class MInvoice extends X_C_Invoice implements DocAction public String prepareIt() { log.info(toString()); - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -1382,14 +1378,14 @@ public class MInvoice extends X_C_Invoice implements DocAction MInvoiceLine[] lines = getLines(true); if (lines.length == 0) { - m_processMsg = new StringBuffer("@NoLines@"); + m_processMsg = "@NoLines@"; return DocAction.STATUS_Invalid; } // No Cash Book if (PAYMENTRULE_Cash.equals(getPaymentRule()) && MCashBook.get(getCtx(), getAD_Org_ID(), getC_Currency_ID()) == null) { - m_processMsg = new StringBuffer("@NoCashBook@"); + m_processMsg = "@NoCashBook@"; return DocAction.STATUS_Invalid; } @@ -1398,14 +1394,14 @@ public class MInvoice extends X_C_Invoice implements DocAction setC_DocType_ID(getC_DocTypeTarget_ID()); if (getC_DocType_ID() == 0) { - m_processMsg = new StringBuffer("No Document Type"); + m_processMsg = "No Document Type"; return DocAction.STATUS_Invalid; } explodeBOM(); if (!calculateTaxTotal()) // setTotals { - m_processMsg = new StringBuffer("Error calculating Tax"); + m_processMsg = "Error calculating Tax"; return DocAction.STATUS_Invalid; } @@ -1414,13 +1410,13 @@ public class MInvoice extends X_C_Invoice implements DocAction { if (!createPaySchedule()) { - m_processMsg = new StringBuffer("@ErrorPaymentSchedule@"); + m_processMsg = "@ErrorPaymentSchedule@"; return DocAction.STATUS_Invalid; } } else { if (MInvoicePaySchedule.getInvoicePaySchedule(getCtx(), getC_Invoice_ID(), 0, get_TrxName()).length > 0) { - m_processMsg = new StringBuffer("@ErrorPaymentSchedule@"); + m_processMsg = "@ErrorPaymentSchedule@"; return DocAction.STATUS_Invalid; } } @@ -1437,9 +1433,9 @@ public class MInvoice extends X_C_Invoice implements DocAction MBPartner bp = new MBPartner (getCtx(), getC_BPartner_ID(), null); if ( MBPartner.SOCREDITSTATUS_CreditStop.equals(bp.getSOCreditStatus()) ) { - m_processMsg = new StringBuffer("@BPartnerCreditStop@ - @TotalOpenBalance@=") - .append(bp.getTotalOpenBalance()) - .append(", @SO_CreditLimit@=").append(bp.getSO_CreditLimit()); + m_processMsg = "@BPartnerCreditStop@ - @TotalOpenBalance@=" + + bp.getTotalOpenBalance() + + ", @SO_CreditLimit@=" + bp.getSO_CreditLimit(); return DocAction.STATUS_Invalid; } } @@ -1454,13 +1450,13 @@ public class MInvoice extends X_C_Invoice implements DocAction String error = line.allocateLandedCosts(); if (error != null && error.length() > 0) { - m_processMsg = new StringBuffer(error); + m_processMsg = error; return DocAction.STATUS_Invalid; } } } - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -1545,12 +1541,12 @@ public class MInvoice extends X_C_Invoice implements DocAction line.setPriceList (Env.ZERO); line.setLineNetAmt (Env.ZERO); // - StringBuilder description = new StringBuilder(product.getName ()); + String description = product.getName (); if (product.getDescription () != null) - description.append(" ").append(product.getDescription ()); + description += " " + product.getDescription (); if (line.getDescription () != null) - description.append(" ").append(line.getDescription ()); - line.setDescription (description.toString()); + description += " " + line.getDescription (); + line.setDescription (description); line.saveEx (get_TrxName()); } // for all lines with BOM @@ -1568,8 +1564,7 @@ public class MInvoice extends X_C_Invoice implements DocAction { log.fine(""); // Delete Taxes - StringBuilder msgdb = new StringBuilder("DELETE C_InvoiceTax WHERE C_Invoice_ID=").append(getC_Invoice_ID()); - DB.executeUpdateEx(msgdb.toString(), get_TrxName()); + DB.executeUpdateEx("DELETE C_InvoiceTax WHERE C_Invoice_ID=" + getC_Invoice_ID(), get_TrxName()); m_taxes = null; // Lines @@ -1703,7 +1698,7 @@ public class MInvoice extends X_C_Invoice implements DocAction return status; } - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -1711,7 +1706,7 @@ public class MInvoice extends X_C_Invoice implements DocAction if (!isApproved()) approveIt(); log.info(toString()); - StringBuilder info = new StringBuilder(); + StringBuffer info = new StringBuffer(); // POS supports multiple payments boolean fromPOS = false; @@ -1748,17 +1743,17 @@ public class MInvoice extends X_C_Invoice implements DocAction if (cash == null || cash.get_ID() == 0) { - m_processMsg = new StringBuffer("@NoCashBook@"); + m_processMsg = "@NoCashBook@"; return DocAction.STATUS_Invalid; } MCashLine cl = new MCashLine (cash); cl.setInvoice(this); if (!cl.save(get_TrxName())) { - m_processMsg = new StringBuffer("Could not save Cash Journal Line"); + m_processMsg = "Could not save Cash Journal Line"; return DocAction.STATUS_Invalid; } - info.append("@C_Cash_ID@: ").append(cash.getName()).append(" #").append(cl.getLine()); + info.append("@C_Cash_ID@: " + cash.getName() + " #" + cl.getLine()); setC_CashLine_ID(cl.getC_CashLine_ID()); } // CashBook @@ -1782,7 +1777,7 @@ public class MInvoice extends X_C_Invoice implements DocAction ol.setQtyInvoiced(ol.getQtyInvoiced().add(line.getQtyInvoiced())); if (!ol.save(get_TrxName())) { - m_processMsg = new StringBuffer("Could not update Order Line"); + m_processMsg = "Could not update Order Line"; return DocAction.STATUS_Invalid; } } @@ -1800,7 +1795,7 @@ public class MInvoice extends X_C_Invoice implements DocAction isNewMatchPO = true; if (!po.save(get_TrxName())) { - m_processMsg = new StringBuffer("Could not create PO Matching"); + m_processMsg = "Could not create PO Matching"; return DocAction.STATUS_Invalid; } matchPO++; @@ -1819,7 +1814,7 @@ public class MInvoice extends X_C_Invoice implements DocAction rmaLine.setQtyInvoiced(line.getQtyInvoiced()); if (!rmaLine.save(get_TrxName())) { - m_processMsg = new StringBuffer("Could not update RMA Line"); + m_processMsg = "Could not update RMA Line"; return DocAction.STATUS_Invalid; } } @@ -1843,7 +1838,7 @@ public class MInvoice extends X_C_Invoice implements DocAction isNewMatchInv = true; if (!inv.save(get_TrxName())) { - m_processMsg = new StringBuffer(CLogger.retrieveErrorString("Could not create Invoice Matching")); + m_processMsg = CLogger.retrieveErrorString("Could not create Invoice Matching"); return DocAction.STATUS_Invalid; } matchInv++; @@ -1865,8 +1860,8 @@ public class MInvoice extends X_C_Invoice implements DocAction getC_Currency_ID(), getDateAcct(), getC_ConversionType_ID(), getAD_Client_ID(), getAD_Org_ID()); if (invAmt == null) { - m_processMsg = new StringBuffer("Could not convert C_Currency_ID=").append(getC_Currency_ID()) - .append(" to base C_Currency_ID=").append(MClient.get(Env.getCtx()).getC_Currency_ID()); + m_processMsg = "Could not convert C_Currency_ID=" + getC_Currency_ID() + + " to base C_Currency_ID=" + MClient.get(Env.getCtx()).getC_Currency_ID(); return DocAction.STATUS_Invalid; } // Total Balance @@ -1907,7 +1902,7 @@ public class MInvoice extends X_C_Invoice implements DocAction bp.setSOCreditStatus(); if (!bp.save(get_TrxName())) { - m_processMsg = new StringBuffer("Could not update Business Partner"); + m_processMsg = "Could not update Business Partner"; return DocAction.STATUS_Invalid; } @@ -1916,11 +1911,10 @@ public class MInvoice extends X_C_Invoice implements DocAction { MUser user = new MUser (getCtx(), getAD_User_ID(), get_TrxName()); user.setLastContact(new Timestamp(System.currentTimeMillis())); - StringBuilder msgr = new StringBuilder(Msg.translate(getCtx(), "C_Invoice_ID")).append(": ").append(getDocumentNo()); - user.setLastResult(msgr.toString()); + user.setLastResult(Msg.translate(getCtx(), "C_Invoice_ID") + ": " + getDocumentNo()); if (!user.save(get_TrxName())) { - m_processMsg = new StringBuffer("Could not update Business Partner User"); + m_processMsg = "Could not update Business Partner User"; return DocAction.STATUS_Invalid; } } // user @@ -1936,8 +1930,8 @@ public class MInvoice extends X_C_Invoice implements DocAction getDateAcct(), 0, getAD_Client_ID(), getAD_Org_ID()); if (amt == null) { - m_processMsg = new StringBuffer("Could not convert C_Currency_ID=").append(getC_Currency_ID()) - .append(" to Project C_Currency_ID=").append(C_CurrencyTo_ID); + m_processMsg = "Could not convert C_Currency_ID=" + getC_Currency_ID() + + " to Project C_Currency_ID=" + C_CurrencyTo_ID; return DocAction.STATUS_Invalid; } BigDecimal newAmt = project.getInvoicedAmt(); @@ -1951,7 +1945,7 @@ public class MInvoice extends X_C_Invoice implements DocAction project.setInvoicedAmt(newAmt); if (!project.save(get_TrxName())) { - m_processMsg = new StringBuffer("Could not update Project"); + m_processMsg = "Could not update Project"; return DocAction.STATUS_Invalid; } } // project @@ -1960,7 +1954,7 @@ public class MInvoice extends X_C_Invoice implements DocAction String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE); if (valid != null) { - m_processMsg = new StringBuffer(valid); + m_processMsg = valid; return DocAction.STATUS_Invalid; } @@ -1972,7 +1966,7 @@ public class MInvoice extends X_C_Invoice implements DocAction if (counter != null) info.append(" - @CounterDoc@: @C_Invoice_ID@=").append(counter.getDocumentNo()); - m_processMsg = new StringBuffer(info.toString().trim()); + m_processMsg = info.toString().trim(); setProcessed(true); setDocAction(DOCACTION_Close); return DocAction.STATUS_Completed; @@ -2098,7 +2092,7 @@ public class MInvoice extends X_C_Invoice implements DocAction { log.info(toString()); // Before Void - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID); if (m_processMsg != null) return false; @@ -2106,7 +2100,7 @@ public class MInvoice extends X_C_Invoice implements DocAction || DOCSTATUS_Reversed.equals(getDocStatus()) || DOCSTATUS_Voided.equals(getDocStatus())) { - m_processMsg = new StringBuffer("Document Closed: ").append(getDocStatus()); + m_processMsg = "Document Closed: " + getDocStatus(); setDocAction(DOCACTION_None); return false; } @@ -2130,8 +2124,7 @@ public class MInvoice extends X_C_Invoice implements DocAction line.setTaxAmt(Env.ZERO); line.setLineNetAmt(Env.ZERO); line.setLineTotalAmt(Env.ZERO); - StringBuilder msgd = new StringBuilder(Msg.getMsg(getCtx(), "Voided")).append(" (").append(old).append(")"); - line.addDescription(msgd.toString()); + line.addDescription(Msg.getMsg(getCtx(), "Voided") + " (" + old + ")"); // Unlink Shipment if (line.getM_InOutLine_ID() != 0) { @@ -2153,7 +2146,7 @@ public class MInvoice extends X_C_Invoice implements DocAction } // After Void - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID); if (m_processMsg != null) return false; @@ -2170,7 +2163,7 @@ public class MInvoice extends X_C_Invoice implements DocAction { log.info(toString()); // Before Close - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE); if (m_processMsg != null) return false; @@ -2178,7 +2171,7 @@ public class MInvoice extends X_C_Invoice implements DocAction setDocAction(DOCACTION_None); // After Close - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE); if (m_processMsg != null) return false; return true; @@ -2192,7 +2185,7 @@ public class MInvoice extends X_C_Invoice implements DocAction { log.info(toString()); // Before reverseCorrect - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT); if (m_processMsg != null) return false; @@ -2235,7 +2228,7 @@ public class MInvoice extends X_C_Invoice implements DocAction reversal = copyFrom (this, getDateInvoiced(), getDateAcct(), getC_DocType_ID(), isSOTrx(), false, get_TrxName(), true, getDocumentNo()+"^"); if (reversal == null) { - m_processMsg = new StringBuffer("Could not create Invoice Reversal"); + m_processMsg = "Could not create Invoice Reversal"; return false; } reversal.setReversal(true); @@ -2254,7 +2247,7 @@ public class MInvoice extends X_C_Invoice implements DocAction rLine.setLineTotalAmt(rLine.getLineTotalAmt().negate()); if (!rLine.save(get_TrxName())) { - m_processMsg = new StringBuffer("Could not correct Invoice Reversal Line"); + m_processMsg = "Could not correct Invoice Reversal Line"; return false; } } @@ -2266,7 +2259,7 @@ public class MInvoice extends X_C_Invoice implements DocAction // if (!reversal.processIt(DocAction.ACTION_Complete)) { - m_processMsg = new StringBuffer("Reversal ERROR: ").append(reversal.getProcessMsg()); + m_processMsg = "Reversal ERROR: " + reversal.getProcessMsg(); return false; } reversal.setC_Payment_ID(0); @@ -2276,10 +2269,9 @@ public class MInvoice extends X_C_Invoice implements DocAction reversal.setDocStatus(DOCSTATUS_Reversed); reversal.setDocAction(DOCACTION_None); reversal.saveEx(get_TrxName()); - m_processMsg = new StringBuffer(reversal.getDocumentNo()); + m_processMsg = reversal.getDocumentNo(); // - StringBuilder msgd = new StringBuilder("(").append(reversal.getDocumentNo()).append("<-)"); - addDescription(msgd.toString()); + addDescription("(" + reversal.getDocumentNo() + "<-)"); // Clean up Reversed (this) MInvoiceLine[] iLines = getLines(false); @@ -2305,10 +2297,10 @@ public class MInvoice extends X_C_Invoice implements DocAction setIsPaid(true); // Create Allocation - msgd = new StringBuilder( - Msg.translate(getCtx(), "C_Invoice_ID")).append(": ").append(getDocumentNo()).append("/").append(reversal.getDocumentNo()); MAllocationHdr alloc = new MAllocationHdr(getCtx(), false, getDateAcct(), - getC_Currency_ID(),msgd.toString(),get_TrxName()); + getC_Currency_ID(), + Msg.translate(getCtx(), "C_Invoice_ID") + ": " + getDocumentNo() + "/" + reversal.getDocumentNo(), + get_TrxName()); alloc.setAD_Org_ID(getAD_Org_ID()); if (alloc.save()) { @@ -2334,7 +2326,7 @@ public class MInvoice extends X_C_Invoice implements DocAction } // After reverseCorrect - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT); if (m_processMsg != null) return false; @@ -2349,12 +2341,12 @@ public class MInvoice extends X_C_Invoice implements DocAction { log.info(toString()); // Before reverseAccrual - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL); if (m_processMsg != null) return false; // After reverseAccrual - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL); if (m_processMsg != null) return false; @@ -2369,12 +2361,12 @@ public class MInvoice extends X_C_Invoice implements DocAction { log.info(toString()); // Before reActivate - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE); if (m_processMsg != null) return false; // After reActivate - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE); if (m_processMsg != null) return false; @@ -2389,7 +2381,7 @@ public class MInvoice extends X_C_Invoice implements DocAction */ public String getSummary() { - StringBuilder sb = new StringBuilder(); + StringBuffer sb = new StringBuffer(); sb.append(getDocumentNo()); // : Grand Total = 123.00 (#1) sb.append(": "). @@ -2407,7 +2399,7 @@ public class MInvoice extends X_C_Invoice implements DocAction */ public String getProcessMsg() { - return m_processMsg.toString(); + return m_processMsg; } // getProcessMsg /** diff --git a/org.adempiere.base/src/org/compiere/model/MJournal.java b/org.adempiere.base/src/org/compiere/model/MJournal.java index 969c14e7fe..6dae4b1338 100644 --- a/org.adempiere.base/src/org/compiere/model/MJournal.java +++ b/org.adempiere.base/src/org/compiere/model/MJournal.java @@ -203,10 +203,8 @@ public class MJournal extends X_GL_Journal implements DocAction String desc = getDescription(); if (desc == null) setDescription(description); - else{ - StringBuilder msgd = new StringBuilder(desc).append(" | ").append(description); - setDescription(msgd.toString()); - } + else + setDescription(desc + " | " + description); } /************************************************************************** @@ -281,10 +279,10 @@ public class MJournal extends X_GL_Journal implements DocAction super.setProcessed (processed); if (get_ID() == 0) return; - StringBuilder sql = new StringBuilder("UPDATE GL_JournalLine SET Processed='") - .append((processed ? "Y" : "N")) - .append("' WHERE GL_Journal_ID=").append(getGL_Journal_ID()); - int noLine = DB.executeUpdate(sql.toString(), get_TrxName()); + String sql = "UPDATE GL_JournalLine SET Processed='" + + (processed ? "Y" : "N") + + "' WHERE GL_Journal_ID=" + getGL_Journal_ID(); + int noLine = DB.executeUpdate(sql, get_TrxName()); log.fine(processed + " - Lines=" + noLine); } // setProcessed @@ -374,11 +372,11 @@ public class MJournal extends X_GL_Journal implements DocAction private boolean updateBatch() { if (getGL_JournalBatch_ID()!=0) { // idempiere 344 - nmicoud - StringBuilder sql = new StringBuilder("UPDATE GL_JournalBatch jb") - .append(" SET (TotalDr, TotalCr) = (SELECT COALESCE(SUM(TotalDr),0), COALESCE(SUM(TotalCr),0)") - .append(" FROM GL_Journal j WHERE j.IsActive='Y' AND jb.GL_JournalBatch_ID=j.GL_JournalBatch_ID) ") - .append("WHERE GL_JournalBatch_ID=").append(getGL_JournalBatch_ID()); - int no = DB.executeUpdate(sql.toString(), get_TrxName()); + String sql = "UPDATE GL_JournalBatch jb" + + " SET (TotalDr, TotalCr) = (SELECT COALESCE(SUM(TotalDr),0), COALESCE(SUM(TotalCr),0)" + + " FROM GL_Journal j WHERE j.IsActive='Y' AND jb.GL_JournalBatch_ID=j.GL_JournalBatch_ID) " + + "WHERE GL_JournalBatch_ID=" + getGL_JournalBatch_ID(); + int no = DB.executeUpdate(sql, get_TrxName()); if (no != 1) log.warning("afterSave - Update Batch #" + no); return no == 1; @@ -400,7 +398,7 @@ public class MJournal extends X_GL_Journal implements DocAction } // process /** Process Message */ - private StringBuffer m_processMsg = null; + private String m_processMsg = null; /** Just Prepared Flag */ private boolean m_justPrepared = false; @@ -432,7 +430,7 @@ public class MJournal extends X_GL_Journal implements DocAction public String prepareIt() { log.info(toString()); - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE); if (m_processMsg != null) return DocAction.STATUS_Invalid; MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); @@ -442,14 +440,14 @@ public class MJournal extends X_GL_Journal implements DocAction if (period == null) { log.warning("No Period for " + getDateAcct()); - m_processMsg = new StringBuffer("@PeriodNotFound@"); + m_processMsg = "@PeriodNotFound@"; return DocAction.STATUS_Invalid; } // Standard Period if (period.getC_Period_ID() != getC_Period_ID() && period.isStandardPeriod()) { - m_processMsg = new StringBuffer("@PeriodNotValid@"); + m_processMsg = "@PeriodNotValid@"; return DocAction.STATUS_Invalid; } boolean open = period.isOpen(dt.getDocBaseType(), getDateAcct()); @@ -457,7 +455,7 @@ public class MJournal extends X_GL_Journal implements DocAction { log.warning(period.getName() + ": Not open for " + dt.getDocBaseType() + " (" + getDateAcct() + ")"); - m_processMsg = new StringBuffer("@PeriodClosed@"); + m_processMsg = "@PeriodClosed@"; return DocAction.STATUS_Invalid; } @@ -465,7 +463,7 @@ public class MJournal extends X_GL_Journal implements DocAction MJournalLine[] lines = getLines(true); if (lines.length == 0) { - m_processMsg = new StringBuffer("@NoLines@"); + m_processMsg = "@NoLines@"; return DocAction.STATUS_Invalid; } @@ -481,8 +479,8 @@ public class MJournal extends X_GL_Journal implements DocAction // bcahya, BF [2789319] No check of Actual, Budget, Statistical attribute if (!line.getAccountElementValue().isActive()) { - m_processMsg = new StringBuffer("@InActiveAccount@ - @Line@=").append(line.getLine()) - .append(" - ").append(line.getAccountElementValue()); + m_processMsg = "@InActiveAccount@ - @Line@=" + line.getLine() + + " - " + line.getAccountElementValue(); return DocAction.STATUS_Invalid; } @@ -493,8 +491,8 @@ public class MJournal extends X_GL_Journal implements DocAction getPostingType().equals(POSTINGTYPE_Reservation) ) { - m_processMsg = new StringBuffer("@DocControlledError@ - @Line@=").append(line.getLine()) - .append(" - ").append(line.getAccountElementValue()); + m_processMsg = "@DocControlledError@ - @Line@=" + line.getLine() + + " - " + line.getAccountElementValue(); return DocAction.STATUS_Invalid; } // @@ -502,22 +500,22 @@ public class MJournal extends X_GL_Journal implements DocAction // bcahya, BF [2789319] No check of Actual, Budget, Statistical attribute if (getPostingType().equals(POSTINGTYPE_Actual) && !line.getAccountElementValue().isPostActual()) { - m_processMsg = new StringBuffer("@PostingTypeActualError@ - @Line@=").append(line.getLine()) - .append(" - ").append(line.getAccountElementValue()); + m_processMsg = "@PostingTypeActualError@ - @Line@=" + line.getLine() + + " - " + line.getAccountElementValue(); return DocAction.STATUS_Invalid; } if (getPostingType().equals(POSTINGTYPE_Budget) && !line.getAccountElementValue().isPostBudget()) { - m_processMsg = new StringBuffer("@PostingTypeBudgetError@ - @Line@=").append(line.getLine()) - .append(" - ").append(line.getAccountElementValue()); + m_processMsg = "@PostingTypeBudgetError@ - @Line@=" + line.getLine() + + " - " + line.getAccountElementValue(); return DocAction.STATUS_Invalid; } if (getPostingType().equals(POSTINGTYPE_Statistical) && !line.getAccountElementValue().isPostStatistical()) { - m_processMsg = new StringBuffer("@PostingTypeStatisticalError@ - @Line@=").append(line.getLine()) - .append(" - ").append(line.getAccountElementValue()); + m_processMsg = "@PostingTypeStatisticalError@ - @Line@=" + line.getLine() + + " - " + line.getAccountElementValue(); return DocAction.STATUS_Invalid; } // end BF [2789319] No check of Actual, Budget, Statistical attribute @@ -532,7 +530,7 @@ public class MJournal extends X_GL_Journal implements DocAction if (Env.ZERO.compareTo(getControlAmt()) != 0 && getControlAmt().compareTo(getTotalDr()) != 0) { - m_processMsg = new StringBuffer("@ControlAmtError@"); + m_processMsg = "@ControlAmtError@"; return DocAction.STATUS_Invalid; } @@ -542,7 +540,7 @@ public class MJournal extends X_GL_Journal implements DocAction MAcctSchemaGL gl = MAcctSchemaGL.get(getCtx(), getC_AcctSchema_ID()); if (gl == null || !gl.isUseSuspenseBalancing()) { - m_processMsg = new StringBuffer("@UnbalancedJornal@"); + m_processMsg = "@UnbalancedJornal@"; return DocAction.STATUS_Invalid; } } @@ -550,7 +548,7 @@ public class MJournal extends X_GL_Journal implements DocAction if (!DOCACTION_Complete.equals(getDocAction())) setDocAction(DOCACTION_Complete); - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -594,7 +592,7 @@ public class MJournal extends X_GL_Journal implements DocAction return status; } - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -606,7 +604,7 @@ public class MJournal extends X_GL_Journal implements DocAction String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE); if (valid != null) { - m_processMsg = new StringBuffer(valid); + m_processMsg = valid; return DocAction.STATUS_Invalid; } @@ -646,7 +644,7 @@ public class MJournal extends X_GL_Journal implements DocAction { log.info(toString()); // Before Void - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID); if (m_processMsg != null) return false; @@ -662,7 +660,7 @@ public class MJournal extends X_GL_Journal implements DocAction } // After Void - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID); if (m_processMsg != null) return false; @@ -678,7 +676,7 @@ public class MJournal extends X_GL_Journal implements DocAction { log.info(toString()); // Before Close - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE); if (m_processMsg != null) return false; @@ -693,7 +691,7 @@ public class MJournal extends X_GL_Journal implements DocAction } // After Close - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE); if (m_processMsg != null) return false; @@ -708,7 +706,7 @@ public class MJournal extends X_GL_Journal implements DocAction public boolean reverseCorrectIt() { // Before reverseCorrect - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT); if (m_processMsg != null) return false; @@ -718,7 +716,7 @@ public class MJournal extends X_GL_Journal implements DocAction return false; // After reverseCorrect - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT); if (m_processMsg != null) return false; @@ -741,14 +739,12 @@ public class MJournal extends X_GL_Journal implements DocAction reverse.setC_Period_ID(getC_Period_ID()); reverse.setDateAcct(getDateAcct()); // Reverse indicator - StringBuilder msgd = new StringBuilder("(->").append(getDocumentNo()).append(")"); - reverse.addDescription(msgd.toString()); + reverse.addDescription("(->" + getDocumentNo() + ")"); //FR [ 1948157 ] reverse.setReversal_ID(getGL_Journal_ID()); if (!reverse.save()) return null; - msgd = new StringBuilder("(").append(reverse.getDocumentNo()).append("<-)"); - addDescription(msgd.toString()); + addDescription("(" + reverse.getDocumentNo() + "<-)"); // Lines reverse.copyLinesFrom(this, null, 'C'); @@ -768,7 +764,7 @@ public class MJournal extends X_GL_Journal implements DocAction public boolean reverseAccrualIt() { // Before reverseAccrual - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL); if (m_processMsg != null) return false; @@ -778,7 +774,7 @@ public class MJournal extends X_GL_Journal implements DocAction return false; // After reverseAccrual - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL); if (m_processMsg != null) return false; @@ -801,12 +797,12 @@ public class MJournal extends X_GL_Journal implements DocAction reverse.set_ValueNoCheck ("C_Period_ID", null); // reset reverse.setDateAcct(reverse.getDateDoc()); // Reverse indicator - StringBuilder description ; - if (reverse.getDescription() == null) - description = new StringBuilder("** ").append(getDocumentNo()).append(" **"); + String description = reverse.getDescription(); + if (description == null) + description = "** " + getDocumentNo() + " **"; else - description = new StringBuilder(reverse.getDescription()).append(" ** ").append(getDocumentNo()).append(" **"); - reverse.setDescription(description.toString()); + description += " ** " + getDocumentNo() + " **"; + reverse.setDescription(description); if (!reverse.save()) return null; @@ -826,7 +822,7 @@ public class MJournal extends X_GL_Journal implements DocAction { log.info(toString()); // Before reActivate - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE); if (m_processMsg != null) return false; @@ -838,7 +834,7 @@ public class MJournal extends X_GL_Journal implements DocAction setDocAction(DOCACTION_Complete); // After reActivate - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE); if (m_processMsg != null) return false; @@ -852,7 +848,7 @@ public class MJournal extends X_GL_Journal implements DocAction */ public String getSummary() { - StringBuilder sb = new StringBuilder(); + StringBuffer sb = new StringBuffer(); sb.append(getDocumentNo()); // : Total Lines = 123.00 (#1) sb.append(": ") @@ -872,7 +868,7 @@ public class MJournal extends X_GL_Journal implements DocAction */ public String toString () { - StringBuilder sb = new StringBuilder ("MJournal["); + StringBuffer sb = new StringBuffer ("MJournal["); sb.append(get_ID()).append(",").append(getDescription()) .append(",DR=").append(getTotalDr()) .append(",CR=").append(getTotalCr()) @@ -887,8 +883,7 @@ public class MJournal extends X_GL_Journal implements DocAction public String getDocumentInfo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); - StringBuilder msgreturn = new StringBuilder(dt.getName()).append(" ").append(getDocumentNo()); - return msgreturn.toString(); + return dt.getName() + " " + getDocumentNo(); } // getDocumentInfo /** @@ -899,8 +894,7 @@ public class MJournal extends X_GL_Journal implements DocAction { try { - StringBuilder msgfile = new StringBuilder(get_TableName()).append(get_ID()).append("_"); - File temp = File.createTempFile(msgfile.toString(), ".pdf"); + File temp = File.createTempFile(get_TableName()+get_ID()+"_", ".pdf"); return createPDF (temp); } catch (Exception e) @@ -930,7 +924,7 @@ public class MJournal extends X_GL_Journal implements DocAction */ public String getProcessMsg() { - return m_processMsg.toString(); + return m_processMsg; } // getProcessMsg /** diff --git a/org.adempiere.base/src/org/compiere/model/MJournalBatch.java b/org.adempiere.base/src/org/compiere/model/MJournalBatch.java index 2d828d2835..f9085c4a67 100644 --- a/org.adempiere.base/src/org/compiere/model/MJournalBatch.java +++ b/org.adempiere.base/src/org/compiere/model/MJournalBatch.java @@ -280,7 +280,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction } // process /** Process Message */ - private StringBuffer m_processMsg = null; + private String m_processMsg = null; /** Just Prepared Flag */ private boolean m_justPrepared = false; @@ -312,7 +312,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction public String prepareIt() { log.info(toString()); - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE); if (m_processMsg != null) return DocAction.STATUS_Invalid; MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); @@ -320,7 +320,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction // Std Period open? if (!MPeriod.isOpen(getCtx(), getDateAcct(), dt.getDocBaseType(), getAD_Org_ID())) { - m_processMsg = new StringBuffer("@PeriodClosed@"); + m_processMsg = "@PeriodClosed@"; return DocAction.STATUS_Invalid; } @@ -328,7 +328,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction MJournal[] journals = getJournals(false); if (journals.length == 0) { - m_processMsg = new StringBuffer("@NoLines@"); + m_processMsg = "@NoLines@"; return DocAction.STATUS_Invalid; } @@ -352,7 +352,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction { journal.setDocStatus(status); journal.saveEx(); - m_processMsg = new StringBuffer(journal.getProcessMsg()); + m_processMsg = journal.getProcessMsg(); return status; } journal.setDocStatus(DOCSTATUS_InProgress); @@ -369,7 +369,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction if (Env.ZERO.compareTo(getControlAmt()) != 0 && getControlAmt().compareTo(getTotalDr()) != 0) { - m_processMsg = new StringBuffer("@ControlAmtError@"); + m_processMsg = "@ControlAmtError@"; return DocAction.STATUS_Invalid; } @@ -398,7 +398,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction } } - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -444,7 +444,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction return status; } - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE); if (m_processMsg != null) return DocAction.STATUS_Invalid; @@ -481,7 +481,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction journal.saveEx(); if (!DocAction.STATUS_Completed.equals(journal.getDocStatus())) { - m_processMsg = new StringBuffer(journal.getProcessMsg()); + m_processMsg = journal.getProcessMsg(); return journal.getDocStatus(); } } @@ -495,7 +495,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE); if (valid != null) { - m_processMsg = new StringBuffer(valid); + m_processMsg = valid; return DocAction.STATUS_Invalid; } @@ -531,11 +531,11 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction { log.info("voidIt - " + toString()); // Before Void - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID); if (m_processMsg != null) return false; // After Void - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID); if (m_processMsg != null) return false; @@ -550,7 +550,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction { log.info("closeIt - " + toString()); // Before Close - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE); if (m_processMsg != null) return false; @@ -570,7 +570,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction || DOCSTATUS_InProgress.equals(journal.getDocStatus()) || DOCSTATUS_Invalid.equals(journal.getDocStatus())) { - m_processMsg = new StringBuffer("Journal not Completed: ").append(journal.getSummary()); + m_processMsg = "Journal not Completed: " + journal.getSummary(); return false; } @@ -583,14 +583,14 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction { if (!journal.closeIt()) { - m_processMsg = new StringBuffer("Cannot close: ").append(journal.getSummary()); + m_processMsg = "Cannot close: " + journal.getSummary(); return false; } journal.saveEx(); } } // After Close - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE); if (m_processMsg != null) return false; @@ -606,7 +606,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction { log.info("reverseCorrectIt - " + toString()); // Before reverseCorrect - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT); if (m_processMsg != null) return false; @@ -622,7 +622,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction ; else { - m_processMsg = new StringBuffer("All Journals need to be Completed: ").append(journal.getSummary()); + m_processMsg = "All Journals need to be Completed: " + journal.getSummary(); return false; } } @@ -633,12 +633,12 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction reverse.setC_Period_ID(getC_Period_ID()); reverse.setDateAcct(getDateAcct()); // Reverse indicator - StringBuilder description ; - if (reverse.getDescription() == null) - description = new StringBuilder("** ").append(getDocumentNo()).append(" **"); + String description = reverse.getDescription(); + if (description == null) + description = "** " + getDocumentNo() + " **"; else - description = new StringBuilder(reverse.getDescription()).append(" ** ").append(getDocumentNo()).append(" **"); - reverse.setDescription(description.toString()); + description += " ** " + getDocumentNo() + " **"; + reverse.setDescription(description); //[ 1948157 ] reverse.setReversal_ID(getGL_JournalBatch_ID()); reverse.saveEx(); @@ -652,7 +652,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction continue; if (journal.reverseCorrectIt(reverse.getGL_JournalBatch_ID()) == null) { - m_processMsg = new StringBuffer("Could not reverse ").append(journal); + m_processMsg = "Could not reverse " + journal; return false; } journal.saveEx(); @@ -662,7 +662,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction setReversal_ID(reverse.getGL_JournalBatch_ID()); saveEx(); // After reverseCorrect - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT); if (m_processMsg != null) return false; @@ -678,7 +678,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction { log.info("reverseAccrualIt - " + toString()); // Before reverseAccrual - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL); if (m_processMsg != null) return false; @@ -694,7 +694,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction ; else { - m_processMsg = new StringBuffer("All Journals need to be Completed: ").append(journal.getSummary()); + m_processMsg = "All Journals need to be Completed: " + journal.getSummary(); return false; } } @@ -704,12 +704,12 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction reverse.setDateDoc(new Timestamp(System.currentTimeMillis())); reverse.setDateAcct(reverse.getDateDoc()); // Reverse indicator - StringBuilder description; - if (reverse.getDescription() == null) - description = new StringBuilder("** ").append(getDocumentNo()).append(" **"); + String description = reverse.getDescription(); + if (description == null) + description = "** " + getDocumentNo() + " **"; else - description = new StringBuilder(reverse.getDescription()).append(" ** ").append(getDocumentNo()).append(" **"); - reverse.setDescription(description.toString()); + description += " ** " + getDocumentNo() + " **"; + reverse.setDescription(description); reverse.saveEx(); // Reverse Journals @@ -720,13 +720,13 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction continue; if (journal.reverseAccrualIt(reverse.getGL_JournalBatch_ID()) == null) { - m_processMsg = new StringBuffer("Could not reverse ").append(journal); + m_processMsg = "Could not reverse " + journal; return false; } journal.saveEx(); } // After reverseAccrual - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL); if (m_processMsg != null) return false; @@ -742,7 +742,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction log.info("reActivateIt - " + toString()); // Before reActivate - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE); if (m_processMsg != null) return false; @@ -764,7 +764,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction setDocAction(DOCACTION_Complete); // After reActivate - m_processMsg = new StringBuffer(ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE)); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE); if (m_processMsg != null) return false; @@ -778,7 +778,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction */ public String getSummary() { - StringBuilder sb = new StringBuilder(); + StringBuffer sb = new StringBuffer(); sb.append(getDocumentNo()); // : Total Lines = 123.00 (#1) sb.append(": ") @@ -798,7 +798,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction */ public String toString () { - StringBuilder sb = new StringBuilder ("MJournalBatch["); + StringBuffer sb = new StringBuffer ("MJournalBatch["); sb.append(get_ID()).append(",").append(getDescription()) .append(",DR=").append(getTotalDr()) .append(",CR=").append(getTotalCr()) @@ -813,8 +813,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction public String getDocumentInfo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); - StringBuilder msgreturn = new StringBuilder(dt.getName()).append(" ").append(getDocumentNo()); - return msgreturn.toString(); + return dt.getName() + " " + getDocumentNo(); } // getDocumentInfo /** @@ -825,8 +824,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction { try { - StringBuilder msgfile = new StringBuilder(get_TableName()).append(get_ID()).append("_"); - File temp = File.createTempFile(msgfile.toString(), ".pdf"); + File temp = File.createTempFile(get_TableName()+get_ID()+"_", ".pdf"); return createPDF (temp); } catch (Exception e) @@ -856,7 +854,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction */ public String getProcessMsg() { - return m_processMsg.toString(); + return m_processMsg; } // getProcessMsg /** From 917fe37caa19c2b2ad2d36b2d0abd2aa76babc9a Mon Sep 17 00:00:00 2001 From: Kirit Thummar Date: Tue, 2 Oct 2012 11:48:33 -0500 Subject: [PATCH 63/79] IDEMPIERE-370 Implement link from process ending message to next records --- .../oracle/908_Process_Message.sql | 62 +++++++++++++++++++ .../postgresql/908_Process_Message.sql | 62 +++++++++++++++++++ .../adempiere/process/InvoiceGenerateRMA.java | 3 +- .../org/compiere/process/AllocationAuto.java | 10 ++- .../org/compiere/process/InOutGenerate.java | 3 +- .../compiere/process/InvoiceBatchProcess.java | 4 +- .../org/compiere/process/InvoiceGenerate.java | 3 +- .../org/compiere/process/OrderPOCreate.java | 4 +- .../org/compiere/process/RequestInvoice.java | 4 +- .../compiere/process/RequisitionPOCreate.java | 3 +- 10 files changed, 148 insertions(+), 10 deletions(-) create mode 100644 migration/360lts-release/oracle/908_Process_Message.sql create mode 100644 migration/360lts-release/postgresql/908_Process_Message.sql diff --git a/migration/360lts-release/oracle/908_Process_Message.sql b/migration/360lts-release/oracle/908_Process_Message.sql new file mode 100644 index 0000000000..3d89bb9cd5 --- /dev/null +++ b/migration/360lts-release/oracle/908_Process_Message.sql @@ -0,0 +1,62 @@ +-- Sep 11, 2012 8:42:54 PM IST +-- Adding i18n messages +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Invoice Processed: ',200060,'U','3c06a457-be2c-4e54-a197-ac5b5646143f','InvoiceProcessed','Y',TO_DATE('2012-09-11 20:42:53','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-09-11 20:42:53','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 11, 2012 8:42:55 PM IST +-- Adding i18n messages +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200060 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Sep 11, 2012 8:49:40 PM IST +-- Adding i18n messages +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Payment Allocated: ',200061,'U','2d9d4e87-b308-4643-9046-a2730a95cb9b','PaymentAllocated','Y',TO_DATE('2012-09-11 20:49:39','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-09-11 20:49:39','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 11, 2012 8:49:40 PM IST +-- Adding i18n messages +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200061 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Sep 11, 2012 8:52:47 PM IST +-- Adding i18n messages +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Allocation Processed: ',200062,'U','5e6e24fc-a609-4424-9aa4-f30f13fa03ac','AllocationProcessed','Y',TO_DATE('2012-09-11 20:52:46','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-09-11 20:52:46','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 11, 2012 8:52:47 PM IST +-- Adding i18n messages +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200062 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Sep 11, 2012 8:54:59 PM IST +-- Adding i18n messages +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Shipment Processed: ',200063,'U','1de82564-7da4-468e-955d-7451a304844d','ShipmentProcessed','Y',TO_DATE('2012-09-11 20:54:58','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-09-11 20:54:58','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 11, 2012 8:54:59 PM IST +-- Adding i18n messages +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200063 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Sep 11, 2012 9:00:52 PM IST +-- Adding i18n messages +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Order Created: ',200064,'U','0e54bec9-9529-4ac8-b453-b36b201b5149','OrderCreated','Y',TO_DATE('2012-09-11 21:00:51','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-09-11 21:00:51','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 11, 2012 9:00:52 PM IST +-- Adding i18n messages +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200064 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Sep 11, 2012 9:05:34 PM IST +-- Adding i18n messages +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Generated PO: ',200065,'U','f0135f4a-27e6-499c-9c7e-851631a10a4f','GeneratedPO','Y',TO_DATE('2012-09-11 21:05:33','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-09-11 21:05:33','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 11, 2012 9:05:34 PM IST +-- Adding i18n messages +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200065 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +SELECT register_migration_script('908_Process_Message.sql') FROM dual +; \ No newline at end of file diff --git a/migration/360lts-release/postgresql/908_Process_Message.sql b/migration/360lts-release/postgresql/908_Process_Message.sql new file mode 100644 index 0000000000..5d7ac6e769 --- /dev/null +++ b/migration/360lts-release/postgresql/908_Process_Message.sql @@ -0,0 +1,62 @@ +-- Sep 11, 2012 8:42:54 PM IST +-- Adding i18n messages +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Invoice Processed: ',200060,'U','3c06a457-be2c-4e54-a197-ac5b5646143f','InvoiceProcessed','Y',TO_TIMESTAMP('2012-09-11 20:42:53','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-09-11 20:42:53','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 11, 2012 8:42:55 PM IST +-- Adding i18n messages +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200060 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Sep 11, 2012 8:49:40 PM IST +-- Adding i18n messages +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Payment Allocated: ',200061,'U','2d9d4e87-b308-4643-9046-a2730a95cb9b','PaymentAllocated','Y',TO_TIMESTAMP('2012-09-11 20:49:39','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-09-11 20:49:39','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 11, 2012 8:49:40 PM IST +-- Adding i18n messages +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200061 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Sep 11, 2012 8:52:47 PM IST +-- Adding i18n messages +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Allocation Processed: ',200062,'U','5e6e24fc-a609-4424-9aa4-f30f13fa03ac','AllocationProcessed','Y',TO_TIMESTAMP('2012-09-11 20:52:46','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-09-11 20:52:46','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 11, 2012 8:52:47 PM IST +-- Adding i18n messages +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200062 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Sep 11, 2012 8:54:59 PM IST +-- Adding i18n messages +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Shipment Processed: ',200063,'U','1de82564-7da4-468e-955d-7451a304844d','ShipmentProcessed','Y',TO_TIMESTAMP('2012-09-11 20:54:58','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-09-11 20:54:58','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 11, 2012 8:54:59 PM IST +-- Adding i18n messages +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200063 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Sep 11, 2012 9:00:52 PM IST +-- Adding i18n messages +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Order Created: ',200064,'U','0e54bec9-9529-4ac8-b453-b36b201b5149','OrderCreated','Y',TO_TIMESTAMP('2012-09-11 21:00:51','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-09-11 21:00:51','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 11, 2012 9:00:52 PM IST +-- Adding i18n messages +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200064 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Sep 11, 2012 9:05:34 PM IST +-- Adding i18n messages +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Generated PO: ',200065,'U','f0135f4a-27e6-499c-9c7e-851631a10a4f','GeneratedPO','Y',TO_TIMESTAMP('2012-09-11 21:05:33','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-09-11 21:05:33','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 11, 2012 9:05:34 PM IST +-- Adding i18n messages +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200065 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +SELECT register_migration_script('908_Process_Message.sql') FROM dual +; \ No newline at end of file diff --git a/org.adempiere.base.process/src/org/adempiere/process/InvoiceGenerateRMA.java b/org.adempiere.base.process/src/org/adempiere/process/InvoiceGenerateRMA.java index de7d5e0239..693fc6b8ca 100644 --- a/org.adempiere.base.process/src/org/adempiere/process/InvoiceGenerateRMA.java +++ b/org.adempiere.base.process/src/org/adempiere/process/InvoiceGenerateRMA.java @@ -219,7 +219,8 @@ public class InvoiceGenerateRMA extends SvrProcess } // Add processing information to process log - addLog(invoice.getC_Invoice_ID(), invoice.getDateInvoiced(), null, processMsg.toString(),invoice.get_Table_ID(),invoice.getC_Invoice_ID()); + String message = Msg.parseTranslation(getCtx(), "@InvoiceProcessed@ " + processMsg.toString()); + addLog(invoice.getC_Invoice_ID(), invoice.getDateInvoiced(), null, message, invoice.get_Table_ID(), invoice.getC_Invoice_ID()); m_created++; } } diff --git a/org.adempiere.base.process/src/org/compiere/process/AllocationAuto.java b/org.adempiere.base.process/src/org/compiere/process/AllocationAuto.java index 361eb27c8e..b8cbe3d946 100644 --- a/org.adempiere.base.process/src/org/compiere/process/AllocationAuto.java +++ b/org.adempiere.base.process/src/org/compiere/process/AllocationAuto.java @@ -33,6 +33,7 @@ import org.compiere.model.MPayment; import org.compiere.util.AdempiereSystemError; import org.compiere.util.DB; import org.compiere.util.Env; +import org.compiere.util.Msg; /** * Automatic Allocation Process @@ -397,7 +398,8 @@ public class AllocationAuto extends SvrProcess { if (payment.allocateIt()) { - addLog(0, payment.getDateAcct(), openAmt, payment.getDocumentNo() + " [1]",payment.get_Table_ID(),payment.getC_Payment_ID()); + String message = Msg.parseTranslation(getCtx(), "@PaymentAllocated@ " + payment.getDocumentNo() + " [1]"); + addLog(0, payment.getDateAcct(), openAmt, message, payment.get_Table_ID(), payment.getC_Payment_ID()); count++; } break; @@ -441,7 +443,8 @@ public class AllocationAuto extends SvrProcess { if (payment.allocateIt()) { - addLog(0, payment.getDateAcct(), availableAmt, payment.getDocumentNo() + " [n]"); + String message = Msg.parseTranslation(getCtx(), "@PaymentAllocated@ " + payment.getDocumentNo() + " [n]"); + addLog(0, payment.getDateAcct(), availableAmt, message); count++; } } @@ -837,7 +840,8 @@ public class AllocationAuto extends SvrProcess } else m_allocation.saveEx(); - addLog(0, m_allocation.getDateAcct(), null, m_allocation.getDescription()); + String message = Msg.parseTranslation(getCtx(), "@AllocationProcessed@ " + m_allocation.getDescription()); + addLog(0, m_allocation.getDateAcct(), null, message); m_allocation = null; return success; } // processAllocation diff --git a/org.adempiere.base.process/src/org/compiere/process/InOutGenerate.java b/org.adempiere.base.process/src/org/compiere/process/InOutGenerate.java index f12c5b4fb8..bb0c5fbb69 100644 --- a/org.adempiere.base.process/src/org/compiere/process/InOutGenerate.java +++ b/org.adempiere.base.process/src/org/compiere/process/InOutGenerate.java @@ -585,7 +585,8 @@ public class InOutGenerate extends SvrProcess } m_shipment.saveEx(); - addLog(m_shipment.getM_InOut_ID(), m_shipment.getMovementDate(), null, m_shipment.getDocumentNo(),m_shipment.get_Table_ID(),m_shipment.getM_InOut_ID()); + String message = Msg.parseTranslation(getCtx(), "@ShipmentProcessed@ " + m_shipment.getDocumentNo()); + addLog(m_shipment.getM_InOut_ID(), m_shipment.getMovementDate(), null, message, m_shipment.get_Table_ID(),m_shipment.getM_InOut_ID()); m_created++; //reset storage cache as MInOut.completeIt will update m_storage diff --git a/org.adempiere.base.process/src/org/compiere/process/InvoiceBatchProcess.java b/org.adempiere.base.process/src/org/compiere/process/InvoiceBatchProcess.java index 90905bfdc4..e6941c5dfb 100644 --- a/org.adempiere.base.process/src/org/compiere/process/InvoiceBatchProcess.java +++ b/org.adempiere.base.process/src/org/compiere/process/InvoiceBatchProcess.java @@ -21,6 +21,7 @@ import org.compiere.model.MInvoiceBatch; import org.compiere.model.MInvoiceBatchLine; import org.compiere.model.MInvoiceLine; import org.compiere.util.AdempiereUserError; +import org.compiere.util.Msg; /** @@ -163,7 +164,8 @@ public class InvoiceBatchProcess extends SvrProcess } m_invoice.saveEx(); - addLog(0, m_invoice.getDateInvoiced(), m_invoice.getGrandTotal(), m_invoice.getDocumentNo(),m_invoice.get_Table_ID(),m_invoice.getC_Invoice_ID()); + String message = Msg.parseTranslation(getCtx(), "@InvoiceProcessed@ " + m_invoice.getDocumentNo()); + addLog(0, m_invoice.getDateInvoiced(), m_invoice.getGrandTotal(), message, m_invoice.get_Table_ID(), m_invoice.getC_Invoice_ID()); m_count++; m_invoice = null; diff --git a/org.adempiere.base.process/src/org/compiere/process/InvoiceGenerate.java b/org.adempiere.base.process/src/org/compiere/process/InvoiceGenerate.java index 9d3b4ce445..ba12b6e370 100644 --- a/org.adempiere.base.process/src/org/compiere/process/InvoiceGenerate.java +++ b/org.adempiere.base.process/src/org/compiere/process/InvoiceGenerate.java @@ -499,7 +499,8 @@ public class InvoiceGenerate extends SvrProcess } m_invoice.saveEx(); - addLog(m_invoice.getC_Invoice_ID(), m_invoice.getDateInvoiced(), null, m_invoice.getDocumentNo(),m_invoice.get_Table_ID(),m_invoice.getC_Invoice_ID()); + String message = Msg.parseTranslation(getCtx(), "@InvoiceProcessed@ " + m_invoice.getDocumentNo()); + addLog(m_invoice.getC_Invoice_ID(), m_invoice.getDateInvoiced(), null, message, m_invoice.get_Table_ID(), m_invoice.getC_Invoice_ID()); m_created++; } m_invoice = null; diff --git a/org.adempiere.base.process/src/org/compiere/process/OrderPOCreate.java b/org.adempiere.base.process/src/org/compiere/process/OrderPOCreate.java index 837b51be9e..a889e2c647 100644 --- a/org.adempiere.base.process/src/org/compiere/process/OrderPOCreate.java +++ b/org.adempiere.base.process/src/org/compiere/process/OrderPOCreate.java @@ -28,6 +28,7 @@ import org.compiere.model.MOrderLine; import org.compiere.model.MOrgInfo; import org.compiere.util.AdempiereUserError; import org.compiere.util.DB; +import org.compiere.util.Msg; /** * Generate PO from Sales Order @@ -208,7 +209,8 @@ public class OrderPOCreate extends SvrProcess if (po == null || po.getBill_BPartner_ID() != C_BPartner_ID) { po = createPOForVendor(rs.getInt(1), so); - addLog(0, null, null, po.getDocumentNo(),po.get_Table_ID(),po.getC_Order_ID()); + String message = Msg.parseTranslation(getCtx(), "@OrderCreated@ " + po.getDocumentNo()); + addLog(0, null, null, message, po.get_Table_ID(), po.getC_Order_ID()); counter++; } diff --git a/org.adempiere.base.process/src/org/compiere/process/RequestInvoice.java b/org.adempiere.base.process/src/org/compiere/process/RequestInvoice.java index 00a6b213ad..f5c2a18812 100644 --- a/org.adempiere.base.process/src/org/compiere/process/RequestInvoice.java +++ b/org.adempiere.base.process/src/org/compiere/process/RequestInvoice.java @@ -29,6 +29,7 @@ import org.compiere.model.MRequestType; import org.compiere.model.MRequestUpdate; import org.compiere.util.AdempiereSystemError; import org.compiere.util.DB; +import org.compiere.util.Msg; /** * Create Invoices for Requests @@ -184,7 +185,8 @@ public class RequestInvoice extends SvrProcess } m_invoice.saveEx(); - addLog(0, null, m_invoice.getGrandTotal(), m_invoice.getDocumentNo(),m_invoice.get_Table_ID(),m_invoice.getC_Invoice_ID()); + String message = Msg.parseTranslation(getCtx(), "@InvoiceProcessed@ " + m_invoice.getDocumentNo()); + addLog(0, null, m_invoice.getGrandTotal(), message, m_invoice.get_Table_ID(), m_invoice.getC_Invoice_ID()); } } m_invoice = null; diff --git a/org.adempiere.base.process/src/org/compiere/process/RequisitionPOCreate.java b/org.adempiere.base.process/src/org/compiere/process/RequisitionPOCreate.java index 44cd6ed874..f1bc07b3b3 100644 --- a/org.adempiere.base.process/src/org/compiere/process/RequisitionPOCreate.java +++ b/org.adempiere.base.process/src/org/compiere/process/RequisitionPOCreate.java @@ -381,7 +381,8 @@ public class RequisitionPOCreate extends SvrProcess if (m_order != null) { m_order.load(get_TrxName()); - addLog(0, null, m_order.getGrandTotal(), m_order.getDocumentNo(),m_order.get_Table_ID(),m_order.getC_Order_ID()); + String message = Msg.parseTranslation(getCtx(), "@GeneratedPO@ " + m_order.getDocumentNo()); + addLog(0, null, m_order.getGrandTotal(), message, m_order.get_Table_ID(), m_order.getC_Order_ID()); } m_order = null; m_orderLine = null; From c7d1ef47e06442c7b2b17fe50bc93cb09c5f0c3f Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 2 Oct 2012 14:50:34 -0500 Subject: [PATCH 64/79] IDEMPIERE-207 GL Journal Generator / Fix ORA-00972: identifier is too long --- migration/360lts-release/oracle/918_IDEMPIERE-207.sql | 2 +- migration/360lts-release/postgresql/918_IDEMPIERE-207.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/migration/360lts-release/oracle/918_IDEMPIERE-207.sql b/migration/360lts-release/oracle/918_IDEMPIERE-207.sql index 753e713c9f..2f39735360 100644 --- a/migration/360lts-release/oracle/918_IDEMPIERE-207.sql +++ b/migration/360lts-release/oracle/918_IDEMPIERE-207.sql @@ -1383,7 +1383,7 @@ ALTER TABLE GL_JournalGeneratorSource ADD GL_JournalGeneratorSource_UU NVARCHAR2 -- Sep 24, 2012 1:52:08 PM COT -- IDEMPIERE-207 GL Journal Generator -CREATE UNIQUE INDEX GL_JournalGeneratorSource_U_uu_idx ON gl_journalgeneratorsource(GL_JournalGeneratorSource_UU) +CREATE UNIQUE INDEX GL_JournalGeneratorSour_uu_idx ON gl_journalgeneratorsource(GL_JournalGeneratorSource_UU) ; -- Sep 24, 2012 2:13:33 PM COT diff --git a/migration/360lts-release/postgresql/918_IDEMPIERE-207.sql b/migration/360lts-release/postgresql/918_IDEMPIERE-207.sql index 777f1c07de..d1d2e440c3 100644 --- a/migration/360lts-release/postgresql/918_IDEMPIERE-207.sql +++ b/migration/360lts-release/postgresql/918_IDEMPIERE-207.sql @@ -1383,7 +1383,7 @@ ALTER TABLE GL_JournalGeneratorSource ADD COLUMN GL_JournalGeneratorSource_UU VA -- Sep 24, 2012 1:52:08 PM COT -- IDEMPIERE-207 GL Journal Generator -CREATE UNIQUE INDEX GL_JournalGeneratorSource_U_uu_idx ON gl_journalgeneratorsource(GL_JournalGeneratorSource_UU) +CREATE UNIQUE INDEX GL_JournalGeneratorSour_uu_idx ON gl_journalgeneratorsource(GL_JournalGeneratorSource_UU) ; -- Sep 24, 2012 2:13:33 PM COT From 1d5a201e7f689c5b0bbdce840e26791f724ad8e2 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 2 Oct 2012 14:52:05 -0500 Subject: [PATCH 65/79] =?UTF-8?q?IDEMPIERE-362=20Hide=20things=20that=20do?= =?UTF-8?q?n't=20work=20on=20iDempiere=20/=20Fix=20problem=20reported=20by?= =?UTF-8?q?=20Michael=20H=C3=BCttemann=20http://red1.org/adempiere/viewtop?= =?UTF-8?q?ic.php=3Ff=3D31&t=3D1693&p=3D8084#p8084?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../oracle/922_IDEMPIERE-362.sql | 75 +++++++++++++++++++ .../postgresql/922_IDEMPIERE-362.sql | 75 +++++++++++++++++++ 2 files changed, 150 insertions(+) create mode 100644 migration/360lts-release/oracle/922_IDEMPIERE-362.sql create mode 100644 migration/360lts-release/postgresql/922_IDEMPIERE-362.sql diff --git a/migration/360lts-release/oracle/922_IDEMPIERE-362.sql b/migration/360lts-release/oracle/922_IDEMPIERE-362.sql new file mode 100644 index 0000000000..1e5b1326ff --- /dev/null +++ b/migration/360lts-release/oracle/922_IDEMPIERE-362.sql @@ -0,0 +1,75 @@ +-- IDEMPIERE-362 Hide things that don't work on iDempiere + +ALTER TABLE c_acctschema_default MODIFY ( b_expense_acct NUMBER(10) NULL ); + +ALTER TABLE c_acctschema_default MODIFY ( b_revaluationgain_acct NUMBER(10) NULL ); + +ALTER TABLE c_acctschema_default MODIFY ( b_revaluationloss_acct NUMBER(10) NULL ); + +ALTER TABLE c_acctschema_default MODIFY ( b_settlementgain_acct NUMBER(10) NULL ); + +ALTER TABLE c_acctschema_default MODIFY ( b_settlementloss_acct NUMBER(10) NULL ); + +ALTER TABLE c_acctschema_default MODIFY ( b_unidentified_acct NUMBER(10) NULL ); + +ALTER TABLE c_acctschema_default MODIFY ( e_expense_acct NUMBER(10) NULL ); + +ALTER TABLE c_acctschema_default MODIFY ( e_prepayment_acct NUMBER(10) NULL ); + +ALTER TABLE c_acctschema_default MODIFY ( notinvoicedreceivables_acct NUMBER(10) NULL ); + +ALTER TABLE c_acctschema_default MODIFY ( notinvoicedrevenue_acct NUMBER(10) NULL ); + +ALTER TABLE c_acctschema_default MODIFY ( t_liability_acct NUMBER(10) NULL ); + +ALTER TABLE c_acctschema_default MODIFY ( t_receivables_acct NUMBER(10) NULL ); + +ALTER TABLE c_acctschema_default MODIFY ( w_invactualadjust_acct NUMBER(10) NULL ); + +ALTER TABLE c_acctschema_default MODIFY ( w_inventory_acct NUMBER(10) NULL ); + +ALTER TABLE c_acctschema_default MODIFY ( w_revaluation_acct NUMBER(10) NULL ); + +ALTER TABLE c_acctschema_default MODIFY ( withholding_acct NUMBER(10) NULL ); + +ALTER TABLE c_acctschema_gl MODIFY ( incomesummary_acct NUMBER(10) NULL ); + +ALTER TABLE c_acctschema_gl MODIFY ( retainedearning_acct NUMBER(10) NULL ); + +ALTER TABLE c_bankaccount_acct MODIFY ( b_expense_acct NUMBER(10) NULL ); + +ALTER TABLE c_bankaccount_acct MODIFY ( b_revaluationgain_acct NUMBER(10) NULL ); + +ALTER TABLE c_bankaccount_acct MODIFY ( b_revaluationloss_acct NUMBER(10) NULL ); + +ALTER TABLE c_bankaccount_acct MODIFY ( b_settlementgain_acct NUMBER(10) NULL ); + +ALTER TABLE c_bankaccount_acct MODIFY ( b_settlementloss_acct NUMBER(10) NULL ); + +ALTER TABLE c_bankaccount_acct MODIFY ( b_unidentified_acct NUMBER(10) NULL ); + +ALTER TABLE c_bp_group_acct MODIFY ( notinvoicedreceivables_acct NUMBER(10) NULL ); + +ALTER TABLE c_bp_group_acct MODIFY ( notinvoicedrevenue_acct NUMBER(10) NULL ); + +ALTER TABLE c_currency_acct MODIFY ( realizedgain_acct NUMBER(10) NULL ); + +ALTER TABLE c_currency_acct MODIFY ( realizedloss_acct NUMBER(10) NULL ); + +ALTER TABLE c_currency_acct MODIFY ( unrealizedgain_acct NUMBER(10) NULL ); + +ALTER TABLE c_currency_acct MODIFY ( unrealizedloss_acct NUMBER(10) NULL ); + +ALTER TABLE c_tax_acct MODIFY ( t_liability_acct NUMBER(10) NULL ); + +ALTER TABLE c_tax_acct MODIFY ( t_receivables_acct NUMBER(10) NULL ); + +ALTER TABLE m_warehouse_acct MODIFY ( w_invactualadjust_acct NUMBER(10) NULL ); + +ALTER TABLE m_warehouse_acct MODIFY ( w_inventory_acct NUMBER(10) NULL ); + +ALTER TABLE m_warehouse_acct MODIFY ( w_revaluation_acct NUMBER(10) NULL ); + +SELECT register_migration_script('922_IDEMPIERE-362.sql') FROM dual +; + diff --git a/migration/360lts-release/postgresql/922_IDEMPIERE-362.sql b/migration/360lts-release/postgresql/922_IDEMPIERE-362.sql new file mode 100644 index 0000000000..49297626f0 --- /dev/null +++ b/migration/360lts-release/postgresql/922_IDEMPIERE-362.sql @@ -0,0 +1,75 @@ +-- IDEMPIERE-362 Hide things that don't work on iDempiere + +ALTER TABLE c_acctschema_default ALTER b_expense_acct DROP NOT NULL; + +ALTER TABLE c_acctschema_default ALTER b_revaluationgain_acct DROP NOT NULL; + +ALTER TABLE c_acctschema_default ALTER b_revaluationloss_acct DROP NOT NULL; + +ALTER TABLE c_acctschema_default ALTER b_settlementgain_acct DROP NOT NULL; + +ALTER TABLE c_acctschema_default ALTER b_settlementloss_acct DROP NOT NULL; + +ALTER TABLE c_acctschema_default ALTER b_unidentified_acct DROP NOT NULL; + +ALTER TABLE c_acctschema_default ALTER e_expense_acct DROP NOT NULL; + +ALTER TABLE c_acctschema_default ALTER e_prepayment_acct DROP NOT NULL; + +ALTER TABLE c_acctschema_default ALTER notinvoicedreceivables_acct DROP NOT NULL; + +ALTER TABLE c_acctschema_default ALTER notinvoicedrevenue_acct DROP NOT NULL; + +ALTER TABLE c_acctschema_default ALTER t_liability_acct DROP NOT NULL; + +ALTER TABLE c_acctschema_default ALTER t_receivables_acct DROP NOT NULL; + +ALTER TABLE c_acctschema_default ALTER w_invactualadjust_acct DROP NOT NULL; + +ALTER TABLE c_acctschema_default ALTER w_inventory_acct DROP NOT NULL; + +ALTER TABLE c_acctschema_default ALTER w_revaluation_acct DROP NOT NULL; + +ALTER TABLE c_acctschema_default ALTER withholding_acct DROP NOT NULL; + +ALTER TABLE c_acctschema_gl ALTER incomesummary_acct DROP NOT NULL; + +ALTER TABLE c_acctschema_gl ALTER retainedearning_acct DROP NOT NULL; + +ALTER TABLE c_bankaccount_acct ALTER b_expense_acct DROP NOT NULL; + +ALTER TABLE c_bankaccount_acct ALTER b_revaluationgain_acct DROP NOT NULL; + +ALTER TABLE c_bankaccount_acct ALTER b_revaluationloss_acct DROP NOT NULL; + +ALTER TABLE c_bankaccount_acct ALTER b_settlementgain_acct DROP NOT NULL; + +ALTER TABLE c_bankaccount_acct ALTER b_settlementloss_acct DROP NOT NULL; + +ALTER TABLE c_bankaccount_acct ALTER b_unidentified_acct DROP NOT NULL; + +ALTER TABLE c_bp_group_acct ALTER notinvoicedreceivables_acct DROP NOT NULL; + +ALTER TABLE c_bp_group_acct ALTER notinvoicedrevenue_acct DROP NOT NULL; + +ALTER TABLE c_currency_acct ALTER realizedgain_acct DROP NOT NULL; + +ALTER TABLE c_currency_acct ALTER realizedloss_acct DROP NOT NULL; + +ALTER TABLE c_currency_acct ALTER unrealizedgain_acct DROP NOT NULL; + +ALTER TABLE c_currency_acct ALTER unrealizedloss_acct DROP NOT NULL; + +ALTER TABLE c_tax_acct ALTER t_liability_acct DROP NOT NULL; + +ALTER TABLE c_tax_acct ALTER t_receivables_acct DROP NOT NULL; + +ALTER TABLE m_warehouse_acct ALTER w_invactualadjust_acct DROP NOT NULL; + +ALTER TABLE m_warehouse_acct ALTER w_inventory_acct DROP NOT NULL; + +ALTER TABLE m_warehouse_acct ALTER w_revaluation_acct DROP NOT NULL; + +SELECT register_migration_script('922_IDEMPIERE-362.sql') FROM dual +; + From bdccbad71139cdc38f8f3cbe0ccf802b4969d367 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 2 Oct 2012 15:11:25 -0500 Subject: [PATCH 66/79] IDEMPIERE-358 Login- how to make unique and safe - fix problem stopping POS to work --- org.adempiere.ui.swing/src/org/compiere/apps/ALogin.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ALogin.java b/org.adempiere.ui.swing/src/org/compiere/apps/ALogin.java index 0618470bb2..56754ae554 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ALogin.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/ALogin.java @@ -966,8 +966,9 @@ public final class ALogin extends CDialog Env.setContext(m_ctx, "#AD_Client_ID", client.getKey()); MUser user = MUser.get (m_ctx, userTextField.getText()); if (user != null) { - Env.setContext(m_ctx, "#AD_User_ID", user.getAD_User_ID() ); - Env.setContext(m_ctx, "#SalesRep_ID", user.getAD_User_ID() ); + Env.setContext(m_ctx, "#AD_User_Name", userTextField.getText()); + Env.setContext(m_ctx, "#AD_User_ID", user.getAD_User_ID()); + Env.setContext(m_ctx, "#SalesRep_ID", user.getAD_User_ID()); } // KeyNamePair[] roles = m_login.getRoles(userTextField.getText(), client); From 993116f1ea5a412f38c9d3c9392c1c8501093c33 Mon Sep 17 00:00:00 2001 From: Juliana Corredor Date: Tue, 2 Oct 2012 17:43:43 -0500 Subject: [PATCH 67/79] IDEMPIERE-391 Scheduler improvements --- .../oracle/912_IDEMPIERE_391.sql | 1828 ++++++++++++++++ .../postgresql/912_IDEMPIERE_391.sql | 1830 +++++++++++++++++ .../compiere/model/AdempiereProcessor2.java | 3 + .../compiere/model/I_AD_AlertProcessor.java | 50 +- .../src/org/compiere/model/I_AD_Schedule.java | 248 +++ .../org/compiere/model/I_AD_Scheduler.java | 111 +- .../model/I_AD_WorkflowProcessor.java | 54 +- .../org/compiere/model/I_C_AcctProcessor.java | 54 +- .../compiere/model/I_R_RequestProcessor.java | 52 +- .../model/I_R_RequestProcessorLog.java | 2 +- .../model/I_R_RequestProcessor_Route.java | 6 +- .../org/compiere/model/MAcctProcessor.java | 39 +- .../org/compiere/model/MAlertProcessor.java | 20 +- .../org/compiere/model/MLdapProcessor.java | 2 +- .../org/compiere/model/MRequestProcessor.java | 24 +- .../src/org/compiere/model/MSchedule.java | 273 +++ .../src/org/compiere/model/MScheduler.java | 51 +- .../compiere/model/X_AD_AlertProcessor.java | 93 +- .../model/X_AD_AlertProcessorLog.java | 6 +- .../src/org/compiere/model/X_AD_Schedule.java | 319 +++ .../org/compiere/model/X_AD_Scheduler.java | 212 +- .../model/X_AD_WorkflowProcessor.java | 95 +- .../org/compiere/model/X_C_AcctProcessor.java | 101 +- .../compiere/model/X_C_AcctProcessorLog.java | 6 +- .../compiere/model/X_R_RequestProcessor.java | 98 +- .../model/X_R_RequestProcessorLog.java | 6 +- .../model/X_R_RequestProcessor_Route.java | 14 +- .../org/compiere/wf/MWorkflowProcessor.java | 25 +- .../org/compiere/server/AcctProcessor.java | 5 +- .../org/compiere/server/AdempiereServer.java | 53 +- .../compiere/server/AdempiereServerMgr.java | 3 +- .../server/org/compiere/server/Scheduler.java | 57 +- .../org/compiere/web/AdempiereMonitor.java | 64 +- 33 files changed, 5093 insertions(+), 711 deletions(-) create mode 100644 migration/360lts-release/oracle/912_IDEMPIERE_391.sql create mode 100644 migration/360lts-release/postgresql/912_IDEMPIERE_391.sql create mode 100644 org.adempiere.base/src/org/compiere/model/I_AD_Schedule.java create mode 100644 org.adempiere.base/src/org/compiere/model/MSchedule.java create mode 100644 org.adempiere.base/src/org/compiere/model/X_AD_Schedule.java diff --git a/migration/360lts-release/oracle/912_IDEMPIERE_391.sql b/migration/360lts-release/oracle/912_IDEMPIERE_391.sql new file mode 100644 index 0000000000..86f1a2d198 --- /dev/null +++ b/migration/360lts-release/oracle/912_IDEMPIERE_391.sql @@ -0,0 +1,1828 @@ +-- Sep 18, 2012 11:17:01 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Table (IsSecurityEnabled,AccessLevel,LoadSeq,AD_Table_ID,IsHighVolume,ImportTable,IsView,IsChangeLog,EntityType,CopyColumnsFromTable,ReplicationType,AD_Table_UU,IsCentrallyMaintained,IsDeleteable,TableName,Description,Name,AD_Client_ID,IsActive,AD_Org_ID,CreatedBy,Updated,UpdatedBy,Created) VALUES ('N','4',0,200020,'N','N','N','N','D','N','L','54a5f4ee-e0e9-4504-961a-6269c0052dfa','Y','Y','AD_Schedule','Times for the Scheduler','AD_Schedule',0,'Y',0,0,TO_DATE('2012-09-18 11:16:35','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2012-09-18 11:16:35','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 18, 2012 11:17:01 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Table_Trl (AD_Language,AD_Table_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Table_Trl_UU ) SELECT l.AD_Language,t.AD_Table_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Table t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Table_ID=200020 AND NOT EXISTS (SELECT * FROM AD_Table_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Table_ID=t.AD_Table_ID) +; + +-- Sep 18, 2012 11:17:02 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Sequence (StartNewYear,CurrentNextSys,IsTableID,StartNo,CurrentNext,IsAudited,IsAutoSequence,AD_Sequence_ID,Description,Name,IncrementNo,AD_Sequence_UU,AD_Org_ID,AD_Client_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive) VALUES ('N',200000,'Y',1000000,1000000,'N','Y',200020,'Table AD_Schedule','AD_Schedule',1,'1cd2e6e4-72de-492a-9c52-a140bc5b1fac',0,0,TO_DATE('2012-09-18 11:17:01','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2012-09-18 11:17:01','YYYY-MM-DD HH24:MI:SS'),0,'Y') +; + +-- Sep 18, 2012 11:21:52 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,DefaultValue,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200471,'U','Y','N','N',0,'N',22,'N',19,'N','N',102,'N','N','31aa3740-d9b8-4765-8420-0417f644e940','N','Y','N','AD_Client_ID','Client/Tenant for this installation.','@#AD_Client_ID@','A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','Client','N',0,TO_DATE('2012-09-18 11:21:52','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-18 11:21:52','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:21:52 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200471 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:22:45 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,AD_Val_Rule_ID,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,DefaultValue,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200472,'U','Y','N','N',0,'N',22,'N',19,'N',104,'N',113,'N','Y','aa30dabd-cc97-429d-89ed-d6c5cbe949ac','N','Y','N','AD_Org_ID','Organizational entity within client','@#AD_Org_ID@','An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','Organization','N',0,TO_DATE('2012-09-18 11:22:44','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-18 11:22:44','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:22:45 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200472 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:24:05 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('AD_Schedule_ID',200132,'D','AD_Schedule_ID','AD_Schedule_ID','bce1a7be-08e9-4e36-b908-312ef92605e2',0,TO_DATE('2012-09-18 11:24:04','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-18 11:24:04','YYYY-MM-DD HH24:MI:SS'),0,0,0,'Y') +; + +-- Sep 18, 2012 11:24:05 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200132 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 18, 2012 11:24:51 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200473,'D','N','N','Y',1,'N',22,'N',13,'N','Y',200132,'N','N','9bdff8e7-b227-4712-86cd-f873520e85d7','N','N','N','AD_Schedule_ID','AD_Schedule_ID','N',0,TO_DATE('2012-09-18 11:24:50','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-18 11:24:50','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:24:51 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200473 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:24:57 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET EntityType='D',Updated=TO_DATE('2012-09-18 11:24:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=200471 +; + +-- Sep 18, 2012 11:25:02 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET EntityType='D',Updated=TO_DATE('2012-09-18 11:25:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=200472 +; + +-- Sep 18, 2012 11:29:41 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200474,'D','Y','N','N',0,'N',7,'N',16,'N','N',245,'N','N','676bd5f9-f80f-417e-bc5f-5be8181dd6a3','N','Y','N','Created','Date this record was created','The Created field indicates the date that this record was created.','Created','N',0,TO_DATE('2012-09-18 11:29:40','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-18 11:29:40','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:29:41 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200474 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:33:32 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200475,'D',110,'Y','N','N',0,'N',22,'N',18,'N','N',246,'N','Y','6b87ab8f-baa6-49ee-a4a8-0ca225691fb4','N','Y','N','CreatedBy','User who created this records','The Created By field indicates the user who created this record.','Created By','N',0,TO_DATE('2012-09-18 11:33:32','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-18 11:33:32','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:33:32 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200475 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:34:48 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200476,'D','Y','N','N',0,'N',7,'N',16,'N','N',607,'N','N','fc29c26c-e144-4d77-abfe-354eb3a8cdc6','N','Y','N','Updated','Date this record was updated','The Updated field indicates the date that this record was updated.','Updated','N',0,TO_DATE('2012-09-18 11:34:47','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-18 11:34:47','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:34:48 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200476 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:39:25 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200477,'D',110,'Y','N','N',0,'N',22,'N',18,'N','N',608,'N','N','c66a48fd-47e0-4004-9d36-65924de07c74','N','Y','N','UpdatedBy','User who updated this records','The Updated By field indicates the user who updated this record.','Updated By','N',0,TO_DATE('2012-09-18 11:39:24','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-18 11:39:24','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:39:25 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200477 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:40:28 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,DefaultValue,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200478,'D','Y','N','N',0,'N',1,'N',40,'N','N',348,'N','N','cd090c45-d7ec-4e4f-a205-c2471f8425c9','N','Y','N','IsActive','The record is active in the system','Y','There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports. +There are two reasons for de-activating and not deleting records: +(1) The system requires the record for audit purposes. +(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','Active','N',0,TO_DATE('2012-09-18 11:40:17','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-18 11:40:17','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:40:28 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200478 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:41:40 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200479,'D','N','N','N',0,'N',225,'N',10,'N','N',275,'N','N','8bd423be-e422-44ce-aa43-e75d796d2f74','N','Y','N','Description','Optional short description of the record','A description is limited to 255 characters.','Description','Y',0,TO_DATE('2012-09-18 11:41:39','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-18 11:41:39','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:41:40 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200479 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:44:31 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200480,'D',221,'N','N','N',0,'N',1,'N',17,'N','N',1507,'N','Y','97df7222-704c-4790-b9c6-f0b089cb2f9f','N','Y','N','FrequencyType','Frequency of event','The frequency type is used for calculating the date of the next event.','Frequency Type','Y',0,TO_DATE('2012-09-18 11:44:31','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-18 11:44:31','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:44:31 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200480 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:46:04 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,DefaultValue,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200481,'D',318,'N','N','N',0,'N',1,'N',17,'N','N',2457,'N','Y','92fda8e1-8815-4718-8b54-df770ec08594','N','Y','N','ScheduleType','Type of schedule','F','Define the method how the next occurrence is calculated','Schedule Type','Y',0,TO_DATE('2012-09-18 11:46:03','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-18 11:46:03','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:46:04 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200481 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:47:20 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200482,'D','N','N','N',0,'N',255,'N',10,'N','N',54124,'N','Y','4777132c-1cd4-4ef7-af7b-3b753f892b2e','N','Y','N','CronPattern','Cron pattern to define when the process should be invoked.','Cron pattern to define when the process should be invoked. See http://en.wikipedia.org/wiki/Cron#crontab_syntax for cron scheduling syntax and example.','Cron Scheduling Pattern','Y',0,TO_DATE('2012-09-18 11:47:19','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-18 11:47:19','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:47:20 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200482 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:48:44 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200483,'U','N','N','N',0,'N',22,'N',11,'N','N',1506,'N','Y','16094bae-2dca-4217-bcd6-703801047ce3','N','Y','N','Frequency','Frequency of events','The frequency is used in conjunction with the frequency type in determining an event. Example: If the Frequency Type is Week and the Frequency is 2 - it is every two weeks.','Frequency','Y',0,TO_DATE('2012-09-18 11:48:19','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-18 11:48:19','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:48:44 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200483 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:55:03 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,ValueMax,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,ValueMin,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200484,'31','D','N','N','N',0,'1','N',22,'N',11,'N','N',2454,'N','Y','1781134b-b56e-48b4-bef9-7e5ccfc29811','N','Y','N','MonthDay','Day of the month 1 to 28/29/30/31','Day of the Month','Y',0,TO_DATE('2012-09-18 11:54:59','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-18 11:54:59','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:55:03 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200484 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:55:32 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET EntityType='D',Updated=TO_DATE('2012-09-18 11:55:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=200483 +; + +-- Sep 18, 2012 11:56:25 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200485,'U',167,'N','N','N',0,'N',1,'N',17,'N','N',2458,'N','Y','fc957f56-4f18-462a-80a5-ad67231ffc75','N','Y','N','WeekDay','Day of the Week','Day of the Week','Y',0,TO_DATE('2012-09-18 11:56:24','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-18 11:56:24','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:56:25 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200485 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:56:34 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET EntityType='D',Updated=TO_DATE('2012-09-18 11:56:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=200485 +; + +-- Sep 18, 2012 11:59:13 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200486,'D','N','N','N',0,'N',60,'N',10,'N','N',3011,'N','N','a332a52b-8b68-43d4-b5ac-43c42a78db3f','N','Y','N','IP_Address','Defines the IP address to transfer data to','Contains info on the IP address to which we will transfer data','IP Address','Y',0,TO_DATE('2012-09-18 11:59:12','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-18 11:59:12','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:59:13 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200486 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:59:20 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET ColumnName='RunOnlyOnIP', Name='RunOnlyOnIP',Updated=TO_DATE('2012-09-18 11:59:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=200486 +; + +-- Sep 18, 2012 11:59:20 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column_Trl SET IsTranslated='N' WHERE AD_Column_ID=200486 +; + +-- Sep 18, 2012 11:59:20 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET Name='RunOnlyOnIP', Description='Defines the IP address to transfer data to', Help='Contains info on the IP address to which we will transfer data' WHERE AD_Column_ID=200486 AND IsCentrallyMaintained='Y' +; + +-- Sep 18, 2012 12:06:20 PM COT +-- IDEMPIERE-391 Scheduler improvements +CREATE TABLE AD_Schedule (AD_Client_ID NUMBER(10) NOT NULL, AD_Org_ID NUMBER(10) NOT NULL, AD_Schedule_ID NUMBER(10) DEFAULT NULL , Created DATE NOT NULL, CreatedBy NUMBER(10) NOT NULL, CronPattern NVARCHAR2(255) DEFAULT NULL , Description NVARCHAR2(225) DEFAULT NULL , Frequency NUMBER(10) DEFAULT NULL , FrequencyType CHAR(1) DEFAULT NULL , IsActive NVARCHAR2(1) DEFAULT 'Y' NOT NULL, MonthDay NUMBER(10) DEFAULT NULL , RunOnlyOnIP NVARCHAR2(60) DEFAULT NULL , ScheduleType CHAR(1) DEFAULT 'F', Updated DATE NOT NULL, UpdatedBy NUMBER(10) NOT NULL, WeekDay CHAR(1) DEFAULT NULL , CONSTRAINT AD_Schedule_Key PRIMARY KEY (AD_Schedule_ID)) +; + +-- Sep 18, 2012 12:08:05 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=9434 +; + +-- Sep 18, 2012 12:10:34 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Window (WindowType,IsSOTrx,IsDefault,IsBetaFunctionality,WinHeight,WinWidth,EntityType,Name,Description,AD_Window_ID,Processing,AD_Window_UU,Created,Updated,AD_Org_ID,AD_Client_ID,IsActive,UpdatedBy,CreatedBy) VALUES ('T','N','N','N',0,0,'D','Schedule','Times for the scheduler',200012,'N','b1165a29-bcef-442c-be03-92ca75d4c019',TO_DATE('2012-09-18 12:10:34','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-18 12:10:34','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',0,0) +; + +-- Sep 18, 2012 12:10:34 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Window_Trl (AD_Language,AD_Window_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Window_Trl_UU ) SELECT l.AD_Language,t.AD_Window_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Window t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Window_ID=200012 AND NOT EXISTS (SELECT * FROM AD_Window_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Window_ID=t.AD_Window_ID) +; + +-- Sep 18, 2012 12:11:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Tab (IsSingleRow,AD_Window_ID,SeqNo,IsTranslationTab,IsSortTab,AD_Table_ID,ImportFields,HasTree,IsInfoTab,IsReadOnly,IsInsertRecord,IsAdvancedTab,TabLevel,AD_Tab_UU,EntityType,Name,Description,AD_Tab_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,Updated,UpdatedBy,Processing,IsActive) VALUES ('N',200012,10,'N','N',200020,'N','N','N','N','Y','N',0,'06dc0531-48ba-42cf-8c50-d4fbb44928fc','D','Schedule','Schedule',200019,0,0,TO_DATE('2012-09-18 12:11:18','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2012-09-18 12:11:18','YYYY-MM-DD HH24:MI:SS'),0,'N','Y') +; + +-- Sep 18, 2012 12:11:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Tab_Trl (AD_Language,AD_Tab_ID, Help,CommitWarning,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Tab_Trl_UU ) SELECT l.AD_Language,t.AD_Tab_ID, t.Help,t.CommitWarning,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Tab t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Tab_ID=200019 AND NOT EXISTS (SELECT * FROM AD_Tab_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Tab_ID=t.AD_Tab_ID) +; + +-- Sep 18, 2012 12:11:25 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,1,'N','N',200478,'Y',200488,'N','There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports. +There are two reasons for de-activating and not deleting records: +(1) The system requires the record for audit purposes. +(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','D','The record is active in the system','Active','Y','N','0dcbc18c-ee3d-4bf3-bf42-4bd6a0d63783',0,0,TO_DATE('2012-09-18 12:11:25','YYYY-MM-DD HH24:MI:SS'),0,0,TO_DATE('2012-09-18 12:11:25','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 18, 2012 12:11:25 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200488 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 18, 2012 12:11:26 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid) VALUES ('N',200019,22,'N','N',200473,'Y',200489,'N','D','AD_Schedule_ID','N','N','94177e96-cd4e-4537-9ac0-457ddd542f3f',0,0,TO_DATE('2012-09-18 12:11:25','YYYY-MM-DD HH24:MI:SS'),0,0,TO_DATE('2012-09-18 12:11:25','YYYY-MM-DD HH24:MI:SS'),'Y','N') +; + +-- Sep 18, 2012 12:11:26 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200489 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 18, 2012 12:11:26 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,22,'N','N',200471,'Y',200490,'N','A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','D','Client/Tenant for this installation.','Client','Y','N','aa204f69-805c-4a4c-95c8-1e15a5448c86',0,0,TO_DATE('2012-09-18 12:11:26','YYYY-MM-DD HH24:MI:SS'),0,0,TO_DATE('2012-09-18 12:11:26','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 18, 2012 12:11:26 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200490 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 18, 2012 12:11:27 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,255,'N','N',200482,'Y',200491,'N','Cron pattern to define when the process should be invoked. See http://en.wikipedia.org/wiki/Cron#crontab_syntax for cron scheduling syntax and example.','D','Cron pattern to define when the process should be invoked.','Cron Scheduling Pattern','Y','N','03487b4d-0971-4c70-8f04-46fe0e420278',0,0,TO_DATE('2012-09-18 12:11:26','YYYY-MM-DD HH24:MI:SS'),0,0,TO_DATE('2012-09-18 12:11:26','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 18, 2012 12:11:27 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200491 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 18, 2012 12:11:27 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,22,'N','N',200484,'Y',200492,'N','D','Day of the month 1 to 28/29/30/31','Day of the Month','Y','N','deeababe-b70b-44d9-a11a-1e8894614a4b',0,0,TO_DATE('2012-09-18 12:11:27','YYYY-MM-DD HH24:MI:SS'),0,0,TO_DATE('2012-09-18 12:11:27','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 18, 2012 12:11:27 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200492 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 18, 2012 12:11:28 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,1,'N','N',200485,'Y',200493,'N','D','Day of the Week','Day of the Week','Y','N','bd084abe-110c-4810-9fbf-6966b6bae3d1',0,0,TO_DATE('2012-09-18 12:11:27','YYYY-MM-DD HH24:MI:SS'),0,0,TO_DATE('2012-09-18 12:11:27','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 18, 2012 12:11:28 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200493 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 18, 2012 12:11:28 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,225,'N','N',200479,'Y',200494,'N','A description is limited to 255 characters.','D','Optional short description of the record','Description','Y','N','ca15c625-eaa2-4c2e-af8a-f5c38c85820b',0,0,TO_DATE('2012-09-18 12:11:28','YYYY-MM-DD HH24:MI:SS'),0,0,TO_DATE('2012-09-18 12:11:28','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 18, 2012 12:11:28 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200494 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 18, 2012 12:11:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,22,'N','N',200483,'Y',200495,'N','The frequency is used in conjunction with the frequency type in determining an event. Example: If the Frequency Type is Week and the Frequency is 2 - it is every two weeks.','D','Frequency of events','Frequency','Y','N','f2a92a92-ab3d-4b14-9cd6-b340b23c7eac',0,0,TO_DATE('2012-09-18 12:11:28','YYYY-MM-DD HH24:MI:SS'),0,0,TO_DATE('2012-09-18 12:11:28','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 18, 2012 12:11:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200495 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 18, 2012 12:11:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,1,'N','N',200480,'Y',200496,'N','The frequency type is used for calculating the date of the next event.','D','Frequency of event','Frequency Type','Y','N','87167c4f-fe83-4ee2-8089-913c63eca7d9',0,0,TO_DATE('2012-09-18 12:11:29','YYYY-MM-DD HH24:MI:SS'),0,0,TO_DATE('2012-09-18 12:11:29','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 18, 2012 12:11:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200496 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 18, 2012 12:11:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,22,'N','N',200472,'Y',200497,'N','An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','D','Organizational entity within client','Organization','Y','N','c0054e5a-74ae-41cd-9f90-1fc31b504318',0,0,TO_DATE('2012-09-18 12:11:29','YYYY-MM-DD HH24:MI:SS'),0,0,TO_DATE('2012-09-18 12:11:29','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 18, 2012 12:11:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200497 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 18, 2012 12:11:30 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,60,'N','N',200486,'Y',200498,'N','Contains info on the IP address to which we will transfer data','D','Defines the IP address to transfer data to','IP Address','Y','N','2d42c7e3-1df7-4f1d-9097-288628f38e8e',0,0,TO_DATE('2012-09-18 12:11:29','YYYY-MM-DD HH24:MI:SS'),0,0,TO_DATE('2012-09-18 12:11:29','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 18, 2012 12:11:30 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200498 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 18, 2012 12:11:30 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,1,'N','N',200481,'Y',200499,'N','Define the method how the next occurrence is calculated','D','Type of schedule','Schedule Type','Y','N','f8967225-915e-4f3d-b51d-3fd73d69a178',0,0,TO_DATE('2012-09-18 12:11:30','YYYY-MM-DD HH24:MI:SS'),0,0,TO_DATE('2012-09-18 12:11:30','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 18, 2012 12:11:30 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200499 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 18, 2012 12:12:04 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=10,IsDisplayed='Y' WHERE AD_Field_ID=200490 +; + +-- Sep 18, 2012 12:12:04 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=20,IsDisplayed='Y' WHERE AD_Field_ID=200497 +; + +-- Sep 18, 2012 12:12:04 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=30,IsDisplayed='Y' WHERE AD_Field_ID=200488 +; + +-- Sep 18, 2012 12:12:04 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=40,IsDisplayed='Y' WHERE AD_Field_ID=200491 +; + +-- Sep 18, 2012 12:12:04 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=50,IsDisplayed='Y' WHERE AD_Field_ID=200492 +; + +-- Sep 18, 2012 12:12:05 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=200493 +; + +-- Sep 18, 2012 12:12:05 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=200494 +; + +-- Sep 18, 2012 12:12:05 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=200495 +; + +-- Sep 18, 2012 12:12:05 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=200496 +; + +-- Sep 18, 2012 12:12:05 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=200498 +; + +-- Sep 18, 2012 12:12:05 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=200499 +; + +-- Sep 18, 2012 12:13:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=200492 +; + +-- Sep 18, 2012 12:13:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=200493 +; + +-- Sep 18, 2012 12:13:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=30,IsDisplayed='Y' WHERE AD_Field_ID=200494 +; + +-- Sep 18, 2012 12:13:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=40,IsDisplayed='Y' WHERE AD_Field_ID=200499 +; + +-- Sep 18, 2012 12:13:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=50,IsDisplayed='Y' WHERE AD_Field_ID=200496 +; + +-- Sep 18, 2012 12:13:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=200495 +; + +-- Sep 18, 2012 12:13:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=200491 +; + +-- Sep 18, 2012 12:13:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=200498 +; + +-- Sep 18, 2012 12:13:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=200488 +; + +-- Sep 18, 2012 12:14:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200487,'D','N','N','N',0,'N',22,'Y',10,'N','N',469,'N','Y','85289efa-6925-4a1b-a56d-d2eeab992199','N','Y','N','Name','Alphanumeric identifier of the entity','The name of an entity (record) is used as an default search option in addition to the search key. The name is up to 60 characters in length.','Name','Y',0,TO_DATE('2012-09-18 12:14:18','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-18 12:14:18','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 12:14:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200487 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 12:14:26 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_Schedule ADD Name NVARCHAR2(22) DEFAULT NULL +; + +-- Sep 18, 2012 12:14:45 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,22,'N','N',200487,'Y',200500,'N','The name of an entity (record) is used as an default search option in addition to the search key. The name is up to 60 characters in length.','D','Alphanumeric identifier of the entity','Name','Y','N','40e45db9-e809-4c5b-9eb1-ded79bc2065f',0,0,TO_DATE('2012-09-18 12:14:45','YYYY-MM-DD HH24:MI:SS'),0,0,TO_DATE('2012-09-18 12:14:45','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 18, 2012 12:14:45 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200500 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 18, 2012 12:15:06 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=30,IsDisplayed='Y' WHERE AD_Field_ID=200500 +; + +-- Sep 18, 2012 12:15:06 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=40,IsDisplayed='Y' WHERE AD_Field_ID=200494 +; + +-- Sep 18, 2012 12:15:06 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=50,IsDisplayed='Y' WHERE AD_Field_ID=200499 +; + +-- Sep 18, 2012 12:15:06 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=200496 +; + +-- Sep 18, 2012 12:15:06 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=200495 +; + +-- Sep 18, 2012 12:15:06 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=200491 +; + +-- Sep 18, 2012 12:15:06 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=200498 +; + +-- Sep 18, 2012 12:15:06 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=200488 +; + +-- Sep 18, 2012 1:47:15 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@ScheduleType@=F',Updated=TO_DATE('2012-09-18 13:47:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200496 +; + +-- Sep 18, 2012 1:50:16 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@ScheduleType@=C',Updated=TO_DATE('2012-09-18 13:50:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200491 +; + +-- Sep 18, 2012 1:52:00 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_DATE('2012-09-18 13:52:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200488 +; + +-- Sep 18, 2012 1:52:10 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET ColumnSpan=1,Updated=TO_DATE('2012-09-18 13:52:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200488 +; + +-- Sep 18, 2012 1:52:18 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_DATE('2012-09-18 13:52:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200490 +; + +-- Sep 18, 2012 1:52:36 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET XPosition=4, ColumnSpan=2,Updated=TO_DATE('2012-09-18 13:52:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200497 +; + +-- Sep 18, 2012 1:52:43 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET ColumnSpan=5,Updated=TO_DATE('2012-09-18 13:52:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200500 +; + +-- Sep 18, 2012 1:52:58 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET ColumnSpan=5, NumLines=3,Updated=TO_DATE('2012-09-18 13:52:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200494 +; + +-- Sep 18, 2012 1:53:07 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_DATE('2012-09-18 13:53:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200499 +; + +-- Sep 18, 2012 1:53:20 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET XPosition=4, ColumnSpan=2,Updated=TO_DATE('2012-09-18 13:53:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200496 +; + +-- Sep 18, 2012 1:53:33 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET XPosition=4, ColumnSpan=2,Updated=TO_DATE('2012-09-18 13:53:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200495 +; + +-- Sep 18, 2012 1:53:38 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET XPosition=1,Updated=TO_DATE('2012-09-18 13:53:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200495 +; + +-- Sep 18, 2012 1:53:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET ColumnSpan=5,Updated=TO_DATE('2012-09-18 13:53:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200491 +; + +-- Sep 18, 2012 1:53:51 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET ColumnSpan=5,Updated=TO_DATE('2012-09-18 13:53:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200498 +; + +-- Sep 18, 2012 1:53:58 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET XPosition=2,Updated=TO_DATE('2012-09-18 13:53:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200488 +; + +-- Sep 18, 2012 1:56:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Menu (AD_Window_ID,AD_Menu_ID,IsSummary,IsSOTrx,IsReadOnly,EntityType,IsCentrallyMaintained,Name,Description,Action,AD_Menu_UU,IsActive,AD_Client_ID,CreatedBy,Updated,AD_Org_ID,Created,UpdatedBy) VALUES (200012,200018,'N','N','N','D','Y','Schedule','Maintain times foe Scheduler','W','e821174d-eb46-4c6c-b295-9b9ea2d3822e','Y',0,0,TO_DATE('2012-09-18 13:56:43','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2012-09-18 13:56:43','YYYY-MM-DD HH24:MI:SS'),0) +; + +-- Sep 18, 2012 1:56:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Menu_Trl_UU ) SELECT l.AD_Language,t.AD_Menu_ID, t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Menu_ID=200018 AND NOT EXISTS (SELECT * FROM AD_Menu_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Menu_ID=t.AD_Menu_ID) +; + +-- Sep 18, 2012 1:56:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo, AD_TreeNodeMM_UU) SELECT t.AD_Client_ID, 0, 'Y', SysDate, 0, SysDate, 0,t.AD_Tree_ID, 200018, 0, 999, Generate_UUID() FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.TreeType='MM' AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=200018) +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=218 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=153 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=263 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=166 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=4, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=203 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=5, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53242 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=6, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=236 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=7, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=183 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=8, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=160 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=9, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=278 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=10, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53296 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=11, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=345 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=12, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53014 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=13, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53108 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=456, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=450 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=456, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=200018 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=456, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=200 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=456, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=446 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=456, SeqNo=4, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53191 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=456, SeqNo=5, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53192 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=456, SeqNo=6, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=439 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=456, SeqNo=7, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=440 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=456, SeqNo=8, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=594 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=456, SeqNo=9, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=50009 +; + +-- Sep 18, 2012 2:13:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=200491 +; + +-- Sep 18, 2012 2:13:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=200495 +; + +-- Sep 18, 2012 2:14:48 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET AD_Reference_ID=20,Updated=TO_DATE('2012-09-18 14:14:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=200478 +; + +-- Sep 20, 2012 9:38:20 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Schedule (Frequency,AD_Client_ID,AD_Org_ID,AD_Schedule_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive,FrequencyType,ScheduleType,MonthDay,Name) VALUES (1,0,0,200000,TO_DATE('2012-09-20 09:38:18','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2012-09-20 09:38:18','YYYY-MM-DD HH24:MI:SS'),100,'Y','D','F',0,'1 Day') +; + +-- Sep 20, 2012 10:16:54 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Schedule (Frequency,AD_Client_ID,AD_Org_ID,AD_Schedule_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive,FrequencyType,ScheduleType,MonthDay,Name) VALUES (7,0,0,200001,TO_DATE('2012-09-20 10:16:53','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2012-09-20 10:16:53','YYYY-MM-DD HH24:MI:SS'),100,'Y','D','F',0,'7 Days') +; + +-- Sep 20, 2012 10:20:08 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,688,200489,'D','N','N','N',0,'N',10,'N',19,'N','N',200132,'N','Y','a61f8f27-8146-4c2d-9cea-b9fc50d7a77e','N','Y','N','AD_Schedule_ID','AD_Schedule_ID','Y',100,TO_DATE('2012-09-20 10:20:07','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-20 10:20:07','YYYY-MM-DD HH24:MI:SS'),100,0,0) +; + +-- Sep 20, 2012 10:20:08 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200489 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 20, 2012 10:20:17 AM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_Scheduler ADD AD_Schedule_ID NUMBER(10) DEFAULT NULL +; + +-- Sep 20, 2012 10:20:58 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',589,10,'N','N',200489,'Y',200501,'N','D','AD_Schedule_ID','Y','N','ae7b8de9-50f5-4f79-92ef-c7d5e72555b0',100,0,TO_DATE('2012-09-20 10:20:57','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-20 10:20:57','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 20, 2012 10:20:58 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200501 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 20, 2012 10:20:59 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',589,36,'N','N',60493,'Y',200502,'N','D','AD_Scheduler_UU','Y','N','57fc4fb5-58ff-4f4d-8799-a9fee348cc9f',100,0,TO_DATE('2012-09-20 10:20:58','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-20 10:20:58','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 20, 2012 10:20:59 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200502 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 20, 2012 10:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=200502 +; + +-- Sep 20, 2012 10:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=200501 +; + +-- Sep 20, 2012 10:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=10051 +; + +-- Sep 20, 2012 10:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=9437 +; + +-- Sep 20, 2012 10:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=9430 +; + +-- Sep 20, 2012 10:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=58773 +; + +-- Sep 20, 2012 10:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=58774 +; + +-- Sep 20, 2012 10:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=130,IsDisplayed='Y' WHERE AD_Field_ID=9432 +; + +-- Sep 20, 2012 10:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=140,IsDisplayed='Y' WHERE AD_Field_ID=9442 +; + +-- Sep 20, 2012 10:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=9443 +; + +-- Sep 20, 2012 10:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=9438 +; + +-- Sep 20, 2012 10:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=60991 +; + +-- Sep 20, 2012 10:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=60992 +; + +-- Sep 20, 2012 10:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=190,IsDisplayed='Y' WHERE AD_Field_ID=9434 +; + +-- Sep 20, 2012 10:24:02 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET Name='Schedule', ColumnSpan=2,Updated=TO_DATE('2012-09-20 10:24:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200501 +; + +-- Sep 20, 2012 10:24:02 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field_Trl SET IsTranslated='N' WHERE AD_Field_ID=200501 +; + +-- Sep 20, 2012 10:26:00 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=200502 +; + +-- Sep 20, 2012 10:26:00 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNoGrid=180,IsDisplayedGrid='Y' WHERE AD_Field_ID=200501 +; + +-- Sep 20, 2012 10:27:53 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET SeqNoSelection=2,Updated=TO_DATE('2012-09-20 10:27:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200487 +; + +-- Sep 20, 2012 11:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsSelectionColumn='N', IsUpdateable='N', SeqNoSelection=0,Updated=TO_DATE('2012-09-20 11:23:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200487 +; + +-- Sep 20, 2012 11:23:16 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsSelectionColumn='Y', IsUpdateable='N', SeqNoSelection=2,Updated=TO_DATE('2012-09-20 11:23:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200487 +; + + +-- Sep 20, 2012 11:35:11 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=58774 +; + +-- Sep 20, 2012 11:35:11 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=9430 +; + +-- Sep 20, 2012 11:35:11 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=9437 +; + +-- Sep 20, 2012 11:35:11 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=10051 +; + +-- Sep 20, 2012 11:35:11 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=58773 +; + +-- Sep 20, 2012 11:35:11 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=9432 +; + +-- Sep 20, 2012 11:35:11 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=9442 +; + +-- Sep 20, 2012 11:35:11 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=9443 +; + +-- Sep 20, 2012 11:35:11 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=9438 +; + +-- Sep 20, 2012 11:35:11 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=130,IsDisplayed='Y' WHERE AD_Field_ID=60991 +; + +-- Sep 20, 2012 11:35:11 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=140,IsDisplayed='Y' WHERE AD_Field_ID=60992 +; + +-- Sep 20, 2012 11:35:11 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=9434 +; + +-- Sep 20, 2012 11:37:12 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=58774 +; + +-- Sep 20, 2012 11:37:12 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=9430 +; + +-- Sep 20, 2012 11:37:12 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=9437 +; + +-- Sep 20, 2012 11:37:12 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=10051 +; + +-- Sep 20, 2012 11:37:12 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNoGrid=70,IsDisplayedGrid='Y' WHERE AD_Field_ID=58773 +; + +-- Sep 20, 2012 11:37:12 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNoGrid=80,IsDisplayedGrid='Y' WHERE AD_Field_ID=9432 +; + +-- Sep 20, 2012 11:37:12 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNoGrid=90,IsDisplayedGrid='Y' WHERE AD_Field_ID=9442 +; + +-- Sep 20, 2012 11:37:12 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNoGrid=100,IsDisplayedGrid='Y' WHERE AD_Field_ID=9443 +; + +-- Sep 20, 2012 11:37:12 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNoGrid=110,IsDisplayedGrid='Y' WHERE AD_Field_ID=9438 +; + +-- Sep 20, 2012 11:37:12 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNoGrid=120,IsDisplayedGrid='Y' WHERE AD_Field_ID=60991 +; + +-- Sep 20, 2012 11:37:12 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNoGrid=130,IsDisplayedGrid='Y' WHERE AD_Field_ID=60992 +; + +-- Sep 20, 2012 11:37:12 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNoGrid=140,IsDisplayedGrid='Y' WHERE AD_Field_ID=200501 +; + +-- Sep 20, 2012 11:52:30 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-20 11:52:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=59029 +; + +-- Sep 20, 2012 11:52:39 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-20 11:52:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11247 +; + +-- Sep 20, 2012 11:52:44 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-20 11:52:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11255 +; + +-- Sep 20, 2012 11:52:55 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-20 11:52:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11523 +; + +-- Sep 20, 2012 11:53:05 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-20 11:53:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11521 +; + +-- Sep 20, 2012 11:53:14 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-20 11:53:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11522 +; +-- Sep 20, 2012 6:24:20 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,695,200490,'D','N','N','N',0,'N',10,'N',19,'N','N',200132,'N','Y','7e549561-f9c8-44b7-9bc2-9e1d1bb4c728','N','Y','N','AD_Schedule_ID','AD_Schedule_ID','Y',100,TO_DATE('2012-09-20 18:24:18','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-20 18:24:18','YYYY-MM-DD HH24:MI:SS'),100,0,0) +; + +-- Sep 20, 2012 6:24:20 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200490 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 20, 2012 6:24:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',608,10,'N','N',200490,'Y',200503,'N','D','AD_Schedule_ID','Y','N','6d491d80-dc56-484f-90c8-8c6d0cb2344d',100,0,TO_DATE('2012-09-20 18:24:54','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-20 18:24:54','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 20, 2012 6:24:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200503 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 20, 2012 6:24:56 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',608,36,'N','N',60588,'Y',200504,'N','D','C_AcctProcessor_UU','Y','N','1cbac684-149b-40fc-b1bc-66a8e3bde012',100,0,TO_DATE('2012-09-20 18:24:55','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-20 18:24:55','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 20, 2012 6:24:56 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200504 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 20, 2012 6:25:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=200504 +; + +-- Sep 20, 2012 6:25:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=9039 +; + +-- Sep 20, 2012 6:25:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=200503 +; + +-- Sep 20, 2012 6:25:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=9037 +; + +-- Sep 20, 2012 6:25:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=9028 +; + +-- Sep 20, 2012 6:25:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=9027 +; + +-- Sep 20, 2012 6:25:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=9033 +; + +-- Sep 20, 2012 6:25:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=130,IsDisplayed='Y' WHERE AD_Field_ID=9031 +; + +-- Sep 20, 2012 6:25:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=140,IsDisplayed='Y' WHERE AD_Field_ID=9032 +; + +-- Sep 20, 2012 6:25:59 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=9028 +; + +-- Sep 20, 2012 6:25:59 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=9037 +; + +-- Sep 20, 2012 6:25:59 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=9027 +; + +-- Sep 20, 2012 6:25:59 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=9033 +; + +-- Sep 20, 2012 6:25:59 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=9031 +; + +-- Sep 20, 2012 6:25:59 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=9032 +; + +-- Sep 20, 2012 6:27:37 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-20 18:27:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11348 +; + +-- Sep 20, 2012 6:27:43 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-20 18:27:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11359 +; + +-- Sep 20, 2012 6:28:12 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET ColumnSpan=3,Updated=TO_DATE('2012-09-20 18:28:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200503 +; + +-- Sep 20, 2012 6:29:41 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Schedule (Frequency,AD_Client_ID,AD_Org_ID,AD_Schedule_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive,FrequencyType,ScheduleType,MonthDay,Name) VALUES (10,0,0,200002,TO_DATE('2012-09-20 18:29:40','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2012-09-20 18:29:40','YYYY-MM-DD HH24:MI:SS'),100,'Y','M','F',0,'10 Minutes') +; + +-- Sep 20, 2012 6:31:38 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE C_AcctProcessor ADD AD_Schedule_ID NUMBER(10) DEFAULT NULL +; + +-- Sep 20, 2012 6:33:24 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsIdentifier='Y', SeqNo=2, IsUpdateable='N',Updated=TO_DATE('2012-09-20 18:33:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200487 +; + +-- Sep 20, 2012 6:55:21 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,700,200491,'D','N','N','N',0,'N',10,'N',19,'N','N',200132,'N','Y','273fcf64-47b6-48ef-a432-b1d600bad17f','N','Y','N','AD_Schedule_ID','AD_Schedule_ID','Y',100,TO_DATE('2012-09-20 18:55:19','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-20 18:55:19','YYYY-MM-DD HH24:MI:SS'),100,0,0) +; + +-- Sep 20, 2012 6:55:21 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200491 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 20, 2012 6:55:26 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_AlertProcessor ADD AD_Schedule_ID NUMBER(10) DEFAULT NULL +; + +-- Sep 20, 2012 6:56:21 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',631,36,'N','N',60374,'Y',200505,'N','D','AD_AlertProcessor_UU','Y','N','a9ee04e4-207b-400f-b182-b6600231ce3e',100,0,TO_DATE('2012-09-20 18:56:20','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-20 18:56:20','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 20, 2012 6:56:21 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200505 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 20, 2012 6:56:22 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',631,10,'N','N',200491,'Y',200506,'N','D','AD_Schedule_ID','Y','N','bcfced0e-e826-4815-a75e-767f25b1f1ae',100,0,TO_DATE('2012-09-20 18:56:21','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-20 18:56:21','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 20, 2012 6:56:22 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200506 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 20, 2012 6:56:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=200505 +; + +-- Sep 20, 2012 6:56:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=9534 +; + +-- Sep 20, 2012 6:56:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=9533 +; + +-- Sep 20, 2012 6:56:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=200506 +; + +-- Sep 20, 2012 6:56:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=9530 +; + +-- Sep 20, 2012 6:56:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=9532 +; + +-- Sep 20, 2012 6:56:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=9524 +; + +-- Sep 20, 2012 6:56:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=9527 +; + +-- Sep 20, 2012 6:57:01 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_DATE('2012-09-20 18:57:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200506 +; + +-- Sep 20, 2012 6:57:26 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsMandatory='N', IsActive='N',Updated=TO_DATE('2012-09-20 18:57:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11441 +; + +-- Sep 20, 2012 6:57:32 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2012-09-20 18:57:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11440 +; + +-- Sep 20, 2012 6:57:43 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_AlertProcessor MODIFY FrequencyType CHAR(1) DEFAULT NULL +; + +-- Sep 20, 2012 6:57:43 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_AlertProcessor MODIFY FrequencyType NULL +; + +-- Sep 20, 2012 6:59:53 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_AlertProcessor SET AD_Schedule_ID=200000,Updated=TO_DATE('2012-09-20 18:59:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_AlertProcessor_ID=100 +; + +-- Sep 20, 2012 7:00:09 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Element SET PrintName='Schedule',Updated=TO_DATE('2012-09-20 19:00:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=200132 +; + +-- Sep 20, 2012 7:00:09 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=200132 +; + +-- Sep 20, 2012 7:00:09 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_PrintFormatItem pi SET PrintName='Schedule', Name='AD_Schedule_ID' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=200132) +; + +-- Sep 20, 2012 7:23:52 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,420,200492,'D','N','N','N',0,'N',10,'N',19,'N','N',200132,'N','Y','e3fdcc19-7a75-4a63-97a1-785bbafe1996','N','Y','N','AD_Schedule_ID','AD_Schedule_ID','Y',100,TO_DATE('2012-09-20 19:23:51','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-20 19:23:51','YYYY-MM-DD HH24:MI:SS'),100,0,0) +; + +-- Sep 20, 2012 7:23:52 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200492 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 20, 2012 7:35:11 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE R_RequestProcessor ADD AD_Schedule_ID NUMBER(10) DEFAULT NULL +; + +-- Sep 20, 2012 7:36:28 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',346,10,'N','N',200492,'Y',200507,'N','D','AD_Schedule_ID','Y','N','fad6e2a5-de6b-44ec-add5-f61622bf7731',100,0,TO_DATE('2012-09-20 19:36:26','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-20 19:36:26','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 20, 2012 7:36:28 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200507 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 20, 2012 7:36:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',346,36,'N','N',61024,'Y',200508,'N','D','R_RequestProcessor_UU','Y','N','034c812e-f7b9-4897-baa8-7a5751483828',100,0,TO_DATE('2012-09-20 19:36:28','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-20 19:36:28','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 20, 2012 7:36:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200508 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 20, 2012 7:36:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=4330 +; + +-- Sep 20, 2012 7:36:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=4331 +; + +-- Sep 20, 2012 7:36:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=200508 +; + +-- Sep 20, 2012 7:36:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=200507 +; + +-- Sep 20, 2012 7:36:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=5149 +; + +-- Sep 20, 2012 7:36:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=10907 +; + +-- Sep 20, 2012 7:36:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=5150 +; + +-- Sep 20, 2012 7:36:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=5166 +; + +-- Sep 20, 2012 7:36:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=10912 +; + +-- Sep 20, 2012 7:36:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=130,IsDisplayed='Y' WHERE AD_Field_ID=9318 +; + +-- Sep 20, 2012 7:36:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=140,IsDisplayed='Y' WHERE AD_Field_ID=4327 +; + +-- Sep 20, 2012 7:36:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=4328 +; + +-- Sep 20, 2012 7:37:15 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_DATE('2012-09-20 19:37:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200507 +; + +-- Sep 20, 2012 7:37:37 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-20 19:37:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5480 +; + +-- Sep 20, 2012 7:37:41 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-20 19:37:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5481 +; + +-- Sep 20, 2012 7:39:26 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Schedule (Frequency,AD_Client_ID,AD_Org_ID,AD_Schedule_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive,FrequencyType,ScheduleType,MonthDay,Name) VALUES (15,0,0,200003,TO_DATE('2012-09-20 19:39:24','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2012-09-20 19:39:24','YYYY-MM-DD HH24:MI:SS'),100,'Y','M','F',0,'15 Minutes') +; + +-- Sep 20, 2012 7:55:53 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,697,200493,'D','N','N','N',0,'N',10,'N',19,'N','N',200132,'N','Y','a8107d13-a59f-4b3f-b5d7-467c067eb8f0','N','Y','N','AD_Schedule_ID','AD_Schedule_ID','Y',100,TO_DATE('2012-09-20 19:55:52','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-20 19:55:52','YYYY-MM-DD HH24:MI:SS'),100,0,0) +; + +-- Sep 20, 2012 7:55:53 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200493 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 20, 2012 7:56:02 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_WorkflowProcessor ADD AD_Schedule_ID NUMBER(10) DEFAULT NULL +; + +-- Sep 20, 2012 7:56:54 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',592,10,'N','N',200493,'Y',200509,'N','D','AD_Schedule_ID','Y','N','8be243a9-ba4d-49c2-addb-128f2451e3d8',100,0,TO_DATE('2012-09-20 19:56:48','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-20 19:56:48','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 20, 2012 7:56:54 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200509 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 20, 2012 7:56:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',592,36,'N','N',60559,'Y',200510,'N','D','AD_WorkflowProcessor_UU','Y','N','ba7097bf-ef51-4e12-9602-745bd0218380',100,0,TO_DATE('2012-09-20 19:56:54','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-20 19:56:54','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 20, 2012 7:56:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200510 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 20, 2012 7:57:17 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=200510 +; + +-- Sep 20, 2012 7:57:17 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=9509 +; + +-- Sep 20, 2012 7:57:17 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=9502 +; + +-- Sep 20, 2012 7:57:17 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=200509 +; + +-- Sep 20, 2012 7:57:17 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=10916 +; + +-- Sep 20, 2012 7:57:17 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=10917 +; + +-- Sep 20, 2012 7:57:17 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=9510 +; + +-- Sep 20, 2012 7:57:18 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=9501 +; + +-- Sep 20, 2012 7:57:18 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=10924 +; + +-- Sep 20, 2012 7:57:18 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=9511 +; + +-- Sep 20, 2012 7:57:18 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=130,IsDisplayed='Y' WHERE AD_Field_ID=9499 +; + +-- Sep 20, 2012 7:57:36 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-20 19:57:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11391 +; + +-- Sep 20, 2012 7:57:41 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-20 19:57:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11382 +; + +-- Sep 20, 2012 7:59:45 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Schedule (Frequency,AD_Client_ID,AD_Org_ID,AD_Schedule_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive,FrequencyType,ScheduleType,MonthDay) VALUES (2,0,0,200004,TO_DATE('2012-09-20 19:59:44','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2012-09-20 19:59:44','YYYY-MM-DD HH24:MI:SS'),100,'Y','H','F',0) +; + +-- Sep 24, 2012 3:50:02 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,DefaultValue,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200557,'U','N','N','N',0,'N',1,'N',20,'N','N',54123,'N','Y','3be5ad4a-1390-4dd5-b526-230f6fe3c9ee','N','Y','N','IsIgnoreProcessingTime','Do not include processing time for the DateNextRun calculation','N','When this is selected, the previous DateNextRun is always use as the source for the next DateNextRun calculation.','Ignore Processing Time','Y',100,TO_DATE('2012-09-24 15:50:01','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-24 15:50:01','YYYY-MM-DD HH24:MI:SS'),100,0,0) +; + +-- Sep 24, 2012 3:50:02 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200557 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 3:50:11 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET EntityType='D',Updated=TO_DATE('2012-09-24 15:50:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200557 +; + +-- Sep 24, 2012 3:50:15 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_Schedule ADD IsIgnoreProcessingTime CHAR(1) DEFAULT 'N' CHECK (IsIgnoreProcessingTime IN ('Y','N')) +; + +-- Sep 24, 2012 3:50:36 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Table SET AD_Window_ID=200012,Updated=TO_DATE('2012-09-24 15:50:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=200020 +; + +-- Sep 24, 2012 3:50:49 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,1,'N','N',200557,'Y',200552,'N','When this is selected, the previous DateNextRun is always use as the source for the next DateNextRun calculation.','D','Do not include processing time for the DateNextRun calculation','Ignore Processing Time','Y','N','8abaf449-ec3d-4333-ba76-d437f0055462',100,0,TO_DATE('2012-09-24 15:50:48','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 15:50:48','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 24, 2012 3:50:49 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200552 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 3:51:10 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET XPosition=4,Updated=TO_DATE('2012-09-24 15:51:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200552 +; + +-- Sep 24, 2012 3:51:17 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-24 15:51:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=59028 +; + +-- Sep 24, 2012 3:52:27 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET IsDisplayed='N', IsActive='N',Updated=TO_DATE('2012-09-24 15:52:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58773 +; + +-- Sep 24, 2012 5:05:08 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,Description,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('IsSystemSchedule',200157,'D','IsSystemSchedule','Schedule Just For System','System Schedule','0fcff3a8-e3d4-4d54-a060-7aa225b329c6',0,TO_DATE('2012-09-24 17:05:07','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-24 17:05:07','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Sep 24, 2012 5:05:08 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200157 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 5:06:10 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,DefaultValue,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200558,'D','N','N','N',0,'N',1,'N',20,'N','N',200157,'N','Y','f5b750f4-c9a7-4dfb-a4de-17f8431a1f47','N','Y','N','IsSystemSchedule','Schedule Just For System','N','IsSystemSchedule','Y',100,TO_DATE('2012-09-24 17:06:09','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-24 17:06:09','YYYY-MM-DD HH24:MI:SS'),100,0,0) +; + +-- Sep 24, 2012 5:06:10 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200558 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 5:06:23 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_Schedule ADD IsSystemSchedule CHAR(1) DEFAULT 'N' CHECK (IsSystemSchedule IN ('Y','N')) +; + +-- Sep 24, 2012 5:06:51 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,1,'N','N',200558,'Y',200553,'N','D','Schedule Just For System','IsSystemSchedule','Y','N','1a29d07e-df06-4d49-bab4-733c0f547714',100,0,TO_DATE('2012-09-24 17:06:50','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 17:06:50','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 24, 2012 5:06:51 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200553 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 5:07:07 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET XPosition=2,Updated=TO_DATE('2012-09-24 17:07:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200553 +; + +-- Sep 24, 2012 5:09:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET XPosition=5,Updated=TO_DATE('2012-09-24 17:09:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200552 +; + +-- Sep 24, 2012 5:29:33 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Val_Rule (Code,AD_Val_Rule_ID,EntityType,Name,Type,AD_Val_Rule_UU,CreatedBy,UpdatedBy,Updated,Created,AD_Client_ID,IsActive,AD_Org_ID) VALUES ('AD_Schedule.IsSystemSchedule=''N'' OR @AD_Client_ID@=0',200007,'D','AD_scheduler for System','S','2643339c-9859-4187-a5ec-e0809a93a43a',100,100,TO_DATE('2012-09-24 17:29:32','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-24 17:29:32','YYYY-MM-DD HH24:MI:SS'),0,'Y',0) +; + +-- Sep 24, 2012 5:32:02 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Val_Rule SET Name='AD_schedule for System',Updated=TO_DATE('2012-09-24 17:32:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=200007 +; + +-- Sep 24, 2012 5:32:06 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET AD_Val_Rule_ID=200007,Updated=TO_DATE('2012-09-24 17:32:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200490 +; + +-- Sep 24, 2012 5:39:23 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET AD_Val_Rule_ID=200007,Updated=TO_DATE('2012-09-24 17:39:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200491 +; + +-- Sep 24, 2012 5:47:37 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET AD_Val_Rule_ID=200007,Updated=TO_DATE('2012-09-24 17:47:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200493 +; + +-- Sep 24, 2012 5:51:36 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET AD_Val_Rule_ID=200007,Updated=TO_DATE('2012-09-24 17:51:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200492 +; + +-- Sep 27, 2012 10:19:28 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2012-09-27 10:19:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11348 +; + +-- Sep 27, 2012 10:19:30 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +ALTER TABLE C_AcctProcessor MODIFY Frequency NUMBER(10) DEFAULT NULL +; + +-- Sep 27, 2012 10:19:30 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +ALTER TABLE C_AcctProcessor MODIFY Frequency NULL +; + +-- Sep 27, 2012 11:05:06 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-27 11:05:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11348 +; + +-- Sep 27, 2012 11:36:59 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2012-09-27 11:36:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11441 +; + +-- Sep 27, 2012 11:37:05 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +ALTER TABLE AD_AlertProcessor MODIFY Frequency NUMBER(10) DEFAULT NULL +; + +-- Sep 27, 2012 11:37:18 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-27 11:37:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11441 +; + +-- Sep 27, 2012 11:37:24 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2012-09-27 11:37:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11440 +; + +-- Sep 27, 2012 11:37:28 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +ALTER TABLE AD_AlertProcessor MODIFY FrequencyType CHAR(1) DEFAULT NULL +; + +-- Sep 27, 2012 11:37:34 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-27 11:37:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11440 +; + +-- Sep 27, 2012 11:38:29 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2012-09-27 11:38:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5480 +; + +-- Sep 27, 2012 11:38:33 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +ALTER TABLE R_RequestProcessor MODIFY Frequency NUMBER(10) DEFAULT 1 +; + +-- Sep 27, 2012 11:38:33 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +ALTER TABLE R_RequestProcessor MODIFY Frequency NULL +; + +-- Sep 27, 2012 11:38:38 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-27 11:38:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5480 +; + +-- Sep 27, 2012 11:38:45 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2012-09-27 11:38:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5481 +; + +-- Sep 27, 2012 11:38:49 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +ALTER TABLE R_RequestProcessor MODIFY FrequencyType CHAR(1) DEFAULT NULL +; + +-- Sep 27, 2012 11:38:50 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +ALTER TABLE R_RequestProcessor MODIFY FrequencyType NULL +; + +-- Sep 27, 2012 11:38:55 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-27 11:38:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5481 +; + +-- Sep 27, 2012 11:39:55 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2012-09-27 11:39:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11391 +; + +-- Sep 27, 2012 11:39:56 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +ALTER TABLE AD_WorkflowProcessor MODIFY Frequency NUMBER(10) DEFAULT NULL +; + +-- Sep 27, 2012 11:39:56 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +ALTER TABLE AD_WorkflowProcessor MODIFY Frequency NULL +; + +-- Sep 27, 2012 11:40:03 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-27 11:40:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11391 +; + +-- Sep 27, 2012 11:40:11 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsMandatory='N', IsActive='N',Updated=TO_DATE('2012-09-27 11:40:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11382 +; + +-- Sep 27, 2012 11:45:45 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2012-09-27 11:45:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11247 +; + +-- Sep 27, 2012 11:45:49 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +ALTER TABLE AD_Scheduler MODIFY Frequency NUMBER(10) DEFAULT NULL +; + +-- Sep 27, 2012 11:45:49 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +ALTER TABLE AD_Scheduler MODIFY Frequency NULL +; + +-- Sep 27, 2012 11:45:55 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-27 11:45:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11247 +; + +-- Sep 27, 2012 11:46:03 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2012-09-27 11:46:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11255 +; + +-- Sep 27, 2012 11:46:05 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +ALTER TABLE AD_Scheduler MODIFY FrequencyType CHAR(1) DEFAULT NULL +; + +-- Sep 27, 2012 11:46:05 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +ALTER TABLE AD_Scheduler MODIFY FrequencyType NULL +; + +-- Sep 27, 2012 11:46:10 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-27 11:46:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11255 +; + +-- Sep 27, 2012 11:49:52 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Window SET WindowType='M',Updated=TO_DATE('2012-09-27 11:49:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID=200012 +; + +SELECT register_migration_script('912_IDEMPIERE-391.sql') FROM dual +; diff --git a/migration/360lts-release/postgresql/912_IDEMPIERE_391.sql b/migration/360lts-release/postgresql/912_IDEMPIERE_391.sql new file mode 100644 index 0000000000..e24b08312d --- /dev/null +++ b/migration/360lts-release/postgresql/912_IDEMPIERE_391.sql @@ -0,0 +1,1830 @@ +-- Sep 18, 2012 11:17:01 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Table (IsSecurityEnabled,AccessLevel,LoadSeq,AD_Table_ID,IsHighVolume,ImportTable,IsView,IsChangeLog,EntityType,CopyColumnsFromTable,ReplicationType,AD_Table_UU,IsCentrallyMaintained,IsDeleteable,TableName,Description,Name,AD_Client_ID,IsActive,AD_Org_ID,CreatedBy,Updated,UpdatedBy,Created) VALUES ('N','4',0,200020,'N','N','N','N','D','N','L','54a5f4ee-e0e9-4504-961a-6269c0052dfa','Y','Y','AD_Schedule','Times for the Scheduler','AD_Schedule',0,'Y',0,0,TO_TIMESTAMP('2012-09-18 11:16:35','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2012-09-18 11:16:35','YYYY-MM-DD HH24:MI:SS')) +; + +-- Sep 18, 2012 11:17:01 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Table_Trl (AD_Language,AD_Table_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Table_Trl_UU ) SELECT l.AD_Language,t.AD_Table_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Table t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Table_ID=200020 AND NOT EXISTS (SELECT * FROM AD_Table_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Table_ID=t.AD_Table_ID) +; + +-- Sep 18, 2012 11:17:02 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Sequence (StartNewYear,CurrentNextSys,IsTableID,StartNo,CurrentNext,IsAudited,IsAutoSequence,AD_Sequence_ID,Description,Name,IncrementNo,AD_Sequence_UU,AD_Org_ID,AD_Client_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive) VALUES ('N',200000,'Y',1000000,1000000,'N','Y',200020,'Table AD_Schedule','AD_Schedule',1,'1cd2e6e4-72de-492a-9c52-a140bc5b1fac',0,0,TO_TIMESTAMP('2012-09-18 11:17:01','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2012-09-18 11:17:01','YYYY-MM-DD HH24:MI:SS'),0,'Y') +; + +-- Sep 18, 2012 11:21:52 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,DefaultValue,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200471,'U','Y','N','N',0,'N',22,'N',19,'N','N',102,'N','N','31aa3740-d9b8-4765-8420-0417f644e940','N','Y','N','AD_Client_ID','Client/Tenant for this installation.','@#AD_Client_ID@','A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','Client','N',0,TO_TIMESTAMP('2012-09-18 11:21:52','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-18 11:21:52','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:21:52 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200471 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:22:45 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,AD_Val_Rule_ID,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,DefaultValue,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200472,'U','Y','N','N',0,'N',22,'N',19,'N',104,'N',113,'N','Y','aa30dabd-cc97-429d-89ed-d6c5cbe949ac','N','Y','N','AD_Org_ID','Organizational entity within client','@#AD_Org_ID@','An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','Organization','N',0,TO_TIMESTAMP('2012-09-18 11:22:44','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-18 11:22:44','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:22:45 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200472 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:24:05 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('AD_Schedule_ID',200132,'D','AD_Schedule_ID','AD_Schedule_ID','bce1a7be-08e9-4e36-b908-312ef92605e2',0,TO_TIMESTAMP('2012-09-18 11:24:04','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-18 11:24:04','YYYY-MM-DD HH24:MI:SS'),0,0,0,'Y') +; + +-- Sep 18, 2012 11:24:05 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200132 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 18, 2012 11:24:51 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200473,'D','N','N','Y',1,'N',22,'N',13,'N','Y',200132,'N','N','9bdff8e7-b227-4712-86cd-f873520e85d7','N','N','N','AD_Schedule_ID','AD_Schedule_ID','N',0,TO_TIMESTAMP('2012-09-18 11:24:50','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-18 11:24:50','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:24:51 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200473 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:24:57 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2012-09-18 11:24:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=200471 +; + +-- Sep 18, 2012 11:25:02 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2012-09-18 11:25:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=200472 +; + +-- Sep 18, 2012 11:29:41 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200474,'D','Y','N','N',0,'N',7,'N',16,'N','N',245,'N','N','676bd5f9-f80f-417e-bc5f-5be8181dd6a3','N','Y','N','Created','Date this record was created','The Created field indicates the date that this record was created.','Created','N',0,TO_TIMESTAMP('2012-09-18 11:29:40','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-18 11:29:40','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:29:41 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200474 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:33:32 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200475,'D',110,'Y','N','N',0,'N',22,'N',18,'N','N',246,'N','Y','6b87ab8f-baa6-49ee-a4a8-0ca225691fb4','N','Y','N','CreatedBy','User who created this records','The Created By field indicates the user who created this record.','Created By','N',0,TO_TIMESTAMP('2012-09-18 11:33:32','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-18 11:33:32','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:33:32 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200475 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:34:48 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200476,'D','Y','N','N',0,'N',7,'N',16,'N','N',607,'N','N','fc29c26c-e144-4d77-abfe-354eb3a8cdc6','N','Y','N','Updated','Date this record was updated','The Updated field indicates the date that this record was updated.','Updated','N',0,TO_TIMESTAMP('2012-09-18 11:34:47','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-18 11:34:47','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:34:48 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200476 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:39:25 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200477,'D',110,'Y','N','N',0,'N',22,'N',18,'N','N',608,'N','N','c66a48fd-47e0-4004-9d36-65924de07c74','N','Y','N','UpdatedBy','User who updated this records','The Updated By field indicates the user who updated this record.','Updated By','N',0,TO_TIMESTAMP('2012-09-18 11:39:24','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-18 11:39:24','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:39:25 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200477 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:40:28 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,DefaultValue,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200478,'D','Y','N','N',0,'N',1,'N',40,'N','N',348,'N','N','cd090c45-d7ec-4e4f-a205-c2471f8425c9','N','Y','N','IsActive','The record is active in the system','Y','There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports. +There are two reasons for de-activating and not deleting records: +(1) The system requires the record for audit purposes. +(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','Active','N',0,TO_TIMESTAMP('2012-09-18 11:40:17','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-18 11:40:17','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:40:28 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200478 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:41:40 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200479,'D','N','N','N',0,'N',225,'N',10,'N','N',275,'N','N','8bd423be-e422-44ce-aa43-e75d796d2f74','N','Y','N','Description','Optional short description of the record','A description is limited to 255 characters.','Description','Y',0,TO_TIMESTAMP('2012-09-18 11:41:39','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-18 11:41:39','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:41:40 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200479 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:44:31 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200480,'D',221,'N','N','N',0,'N',1,'N',17,'N','N',1507,'N','Y','97df7222-704c-4790-b9c6-f0b089cb2f9f','N','Y','N','FrequencyType','Frequency of event','The frequency type is used for calculating the date of the next event.','Frequency Type','Y',0,TO_TIMESTAMP('2012-09-18 11:44:31','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-18 11:44:31','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:44:31 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200480 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:46:04 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,DefaultValue,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200481,'D',318,'N','N','N',0,'N',1,'N',17,'N','N',2457,'N','Y','92fda8e1-8815-4718-8b54-df770ec08594','N','Y','N','ScheduleType','Type of schedule','F','Define the method how the next occurrence is calculated','Schedule Type','Y',0,TO_TIMESTAMP('2012-09-18 11:46:03','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-18 11:46:03','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:46:04 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200481 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:47:20 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200482,'D','N','N','N',0,'N',255,'N',10,'N','N',54124,'N','Y','4777132c-1cd4-4ef7-af7b-3b753f892b2e','N','Y','N','CronPattern','Cron pattern to define when the process should be invoked.','Cron pattern to define when the process should be invoked. See http://en.wikipedia.org/wiki/Cron#crontab_syntax for cron scheduling syntax and example.','Cron Scheduling Pattern','Y',0,TO_TIMESTAMP('2012-09-18 11:47:19','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-18 11:47:19','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:47:20 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200482 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:48:44 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200483,'U','N','N','N',0,'N',22,'N',11,'N','N',1506,'N','Y','16094bae-2dca-4217-bcd6-703801047ce3','N','Y','N','Frequency','Frequency of events','The frequency is used in conjunction with the frequency type in determining an event. Example: If the Frequency Type is Week and the Frequency is 2 - it is every two weeks.','Frequency','Y',0,TO_TIMESTAMP('2012-09-18 11:48:19','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-18 11:48:19','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:48:44 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200483 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:55:03 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,ValueMax,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,ValueMin,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200484,'31','D','N','N','N',0,'1','N',22,'N',11,'N','N',2454,'N','Y','1781134b-b56e-48b4-bef9-7e5ccfc29811','N','Y','N','MonthDay','Day of the month 1 to 28/29/30/31','Day of the Month','Y',0,TO_TIMESTAMP('2012-09-18 11:54:59','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-18 11:54:59','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:55:03 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200484 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:55:32 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2012-09-18 11:55:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=200483 +; + +-- Sep 18, 2012 11:56:25 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200485,'U',167,'N','N','N',0,'N',1,'N',17,'N','N',2458,'N','Y','fc957f56-4f18-462a-80a5-ad67231ffc75','N','Y','N','WeekDay','Day of the Week','Day of the Week','Y',0,TO_TIMESTAMP('2012-09-18 11:56:24','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-18 11:56:24','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:56:25 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200485 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:56:34 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2012-09-18 11:56:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=200485 +; + +-- Sep 18, 2012 11:59:13 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200486,'D','N','N','N',0,'N',60,'N',10,'N','N',3011,'N','N','a332a52b-8b68-43d4-b5ac-43c42a78db3f','N','Y','N','IP_Address','Defines the IP address to transfer data to','Contains info on the IP address to which we will transfer data','IP Address','Y',0,TO_TIMESTAMP('2012-09-18 11:59:12','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-18 11:59:12','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 11:59:13 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200486 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 11:59:20 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET ColumnName='RunOnlyOnIP', Name='RunOnlyOnIP',Updated=TO_TIMESTAMP('2012-09-18 11:59:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=200486 +; + +-- Sep 18, 2012 11:59:20 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column_Trl SET IsTranslated='N' WHERE AD_Column_ID=200486 +; + +-- Sep 18, 2012 11:59:20 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET Name='RunOnlyOnIP', Description='Defines the IP address to transfer data to', Help='Contains info on the IP address to which we will transfer data' WHERE AD_Column_ID=200486 AND IsCentrallyMaintained='Y' +; +-- Sep 18, 2012 12:06:20 PM COT +-- IDEMPIERE-391 Scheduler improvements +CREATE TABLE AD_Schedule (AD_Client_ID NUMERIC(10) NOT NULL, AD_Org_ID NUMERIC(10) NOT NULL, AD_Schedule_ID NUMERIC(10) DEFAULT NULL , Created TIMESTAMP NOT NULL, CreatedBy NUMERIC(10) NOT NULL, CronPattern VARCHAR(255) DEFAULT NULL , Description VARCHAR(225) DEFAULT NULL , Frequency NUMERIC(10) DEFAULT NULL , FrequencyType CHAR(1) DEFAULT NULL , IsActive VARCHAR(1) DEFAULT 'Y' NOT NULL, MonthDay NUMERIC(10) DEFAULT NULL , RunOnlyOnIP VARCHAR(60) DEFAULT NULL , ScheduleType CHAR(1) DEFAULT 'F', Updated TIMESTAMP NOT NULL, UpdatedBy NUMERIC(10) NOT NULL, WeekDay CHAR(1) DEFAULT NULL , CONSTRAINT AD_Schedule_Key PRIMARY KEY (AD_Schedule_ID)) +; + +-- Sep 18, 2012 12:08:05 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=9434 +; + +-- Sep 18, 2012 12:10:34 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Window (WindowType,IsSOTrx,IsDefault,IsBetaFunctionality,WinHeight,WinWidth,EntityType,Name,Description,AD_Window_ID,Processing,AD_Window_UU,Created,Updated,AD_Org_ID,AD_Client_ID,IsActive,UpdatedBy,CreatedBy) VALUES ('T','N','N','N',0,0,'D','Schedule','Times for the scheduler',200012,'N','b1165a29-bcef-442c-be03-92ca75d4c019',TO_TIMESTAMP('2012-09-18 12:10:34','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-18 12:10:34','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',0,0) +; + +-- Sep 18, 2012 12:10:34 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Window_Trl (AD_Language,AD_Window_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Window_Trl_UU ) SELECT l.AD_Language,t.AD_Window_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Window t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Window_ID=200012 AND NOT EXISTS (SELECT * FROM AD_Window_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Window_ID=t.AD_Window_ID) +; + +-- Sep 18, 2012 12:11:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Tab (IsSingleRow,AD_Window_ID,SeqNo,IsTranslationTab,IsSortTab,AD_Table_ID,ImportFields,HasTree,IsInfoTab,IsReadOnly,IsInsertRecord,IsAdvancedTab,TabLevel,AD_Tab_UU,EntityType,Name,Description,AD_Tab_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,Updated,UpdatedBy,Processing,IsActive) VALUES ('N',200012,10,'N','N',200020,'N','N','N','N','Y','N',0,'06dc0531-48ba-42cf-8c50-d4fbb44928fc','D','Schedule','Schedule',200019,0,0,TO_TIMESTAMP('2012-09-18 12:11:18','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2012-09-18 12:11:18','YYYY-MM-DD HH24:MI:SS'),0,'N','Y') +; + +-- Sep 18, 2012 12:11:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Tab_Trl (AD_Language,AD_Tab_ID, Help,CommitWarning,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Tab_Trl_UU ) SELECT l.AD_Language,t.AD_Tab_ID, t.Help,t.CommitWarning,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Tab t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Tab_ID=200019 AND NOT EXISTS (SELECT * FROM AD_Tab_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Tab_ID=t.AD_Tab_ID) +; + +-- Sep 18, 2012 12:11:25 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,1,'N','N',200478,'Y',200488,'N','There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports. +There are two reasons for de-activating and not deleting records: +(1) The system requires the record for audit purposes. +(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','D','The record is active in the system','Active','Y','N','0dcbc18c-ee3d-4bf3-bf42-4bd6a0d63783',0,0,TO_TIMESTAMP('2012-09-18 12:11:25','YYYY-MM-DD HH24:MI:SS'),0,0,TO_TIMESTAMP('2012-09-18 12:11:25','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 18, 2012 12:11:25 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200488 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 18, 2012 12:11:26 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid) VALUES ('N',200019,22,'N','N',200473,'Y',200489,'N','D','AD_Schedule_ID','N','N','94177e96-cd4e-4537-9ac0-457ddd542f3f',0,0,TO_TIMESTAMP('2012-09-18 12:11:25','YYYY-MM-DD HH24:MI:SS'),0,0,TO_TIMESTAMP('2012-09-18 12:11:25','YYYY-MM-DD HH24:MI:SS'),'Y','N') +; + +-- Sep 18, 2012 12:11:26 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200489 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 18, 2012 12:11:26 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,22,'N','N',200471,'Y',200490,'N','A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','D','Client/Tenant for this installation.','Client','Y','N','aa204f69-805c-4a4c-95c8-1e15a5448c86',0,0,TO_TIMESTAMP('2012-09-18 12:11:26','YYYY-MM-DD HH24:MI:SS'),0,0,TO_TIMESTAMP('2012-09-18 12:11:26','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 18, 2012 12:11:26 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200490 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 18, 2012 12:11:27 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,255,'N','N',200482,'Y',200491,'N','Cron pattern to define when the process should be invoked. See http://en.wikipedia.org/wiki/Cron#crontab_syntax for cron scheduling syntax and example.','D','Cron pattern to define when the process should be invoked.','Cron Scheduling Pattern','Y','N','03487b4d-0971-4c70-8f04-46fe0e420278',0,0,TO_TIMESTAMP('2012-09-18 12:11:26','YYYY-MM-DD HH24:MI:SS'),0,0,TO_TIMESTAMP('2012-09-18 12:11:26','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 18, 2012 12:11:27 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200491 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 18, 2012 12:11:27 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,22,'N','N',200484,'Y',200492,'N','D','Day of the month 1 to 28/29/30/31','Day of the Month','Y','N','deeababe-b70b-44d9-a11a-1e8894614a4b',0,0,TO_TIMESTAMP('2012-09-18 12:11:27','YYYY-MM-DD HH24:MI:SS'),0,0,TO_TIMESTAMP('2012-09-18 12:11:27','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 18, 2012 12:11:27 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200492 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 18, 2012 12:11:28 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,1,'N','N',200485,'Y',200493,'N','D','Day of the Week','Day of the Week','Y','N','bd084abe-110c-4810-9fbf-6966b6bae3d1',0,0,TO_TIMESTAMP('2012-09-18 12:11:27','YYYY-MM-DD HH24:MI:SS'),0,0,TO_TIMESTAMP('2012-09-18 12:11:27','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 18, 2012 12:11:28 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200493 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 18, 2012 12:11:28 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,225,'N','N',200479,'Y',200494,'N','A description is limited to 255 characters.','D','Optional short description of the record','Description','Y','N','ca15c625-eaa2-4c2e-af8a-f5c38c85820b',0,0,TO_TIMESTAMP('2012-09-18 12:11:28','YYYY-MM-DD HH24:MI:SS'),0,0,TO_TIMESTAMP('2012-09-18 12:11:28','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 18, 2012 12:11:28 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200494 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 18, 2012 12:11:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,22,'N','N',200483,'Y',200495,'N','The frequency is used in conjunction with the frequency type in determining an event. Example: If the Frequency Type is Week and the Frequency is 2 - it is every two weeks.','D','Frequency of events','Frequency','Y','N','f2a92a92-ab3d-4b14-9cd6-b340b23c7eac',0,0,TO_TIMESTAMP('2012-09-18 12:11:28','YYYY-MM-DD HH24:MI:SS'),0,0,TO_TIMESTAMP('2012-09-18 12:11:28','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 18, 2012 12:11:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200495 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 18, 2012 12:11:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,1,'N','N',200480,'Y',200496,'N','The frequency type is used for calculating the date of the next event.','D','Frequency of event','Frequency Type','Y','N','87167c4f-fe83-4ee2-8089-913c63eca7d9',0,0,TO_TIMESTAMP('2012-09-18 12:11:29','YYYY-MM-DD HH24:MI:SS'),0,0,TO_TIMESTAMP('2012-09-18 12:11:29','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 18, 2012 12:11:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200496 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 18, 2012 12:11:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,22,'N','N',200472,'Y',200497,'N','An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','D','Organizational entity within client','Organization','Y','N','c0054e5a-74ae-41cd-9f90-1fc31b504318',0,0,TO_TIMESTAMP('2012-09-18 12:11:29','YYYY-MM-DD HH24:MI:SS'),0,0,TO_TIMESTAMP('2012-09-18 12:11:29','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 18, 2012 12:11:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200497 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 18, 2012 12:11:30 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,60,'N','N',200486,'Y',200498,'N','Contains info on the IP address to which we will transfer data','D','Defines the IP address to transfer data to','IP Address','Y','N','2d42c7e3-1df7-4f1d-9097-288628f38e8e',0,0,TO_TIMESTAMP('2012-09-18 12:11:29','YYYY-MM-DD HH24:MI:SS'),0,0,TO_TIMESTAMP('2012-09-18 12:11:29','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 18, 2012 12:11:30 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200498 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 18, 2012 12:11:30 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,1,'N','N',200481,'Y',200499,'N','Define the method how the next occurrence is calculated','D','Type of schedule','Schedule Type','Y','N','f8967225-915e-4f3d-b51d-3fd73d69a178',0,0,TO_TIMESTAMP('2012-09-18 12:11:30','YYYY-MM-DD HH24:MI:SS'),0,0,TO_TIMESTAMP('2012-09-18 12:11:30','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 18, 2012 12:11:30 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200499 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 18, 2012 12:12:04 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=10,IsDisplayed='Y' WHERE AD_Field_ID=200490 +; + +-- Sep 18, 2012 12:12:04 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=20,IsDisplayed='Y' WHERE AD_Field_ID=200497 +; + +-- Sep 18, 2012 12:12:04 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=30,IsDisplayed='Y' WHERE AD_Field_ID=200488 +; + +-- Sep 18, 2012 12:12:04 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=40,IsDisplayed='Y' WHERE AD_Field_ID=200491 +; + +-- Sep 18, 2012 12:12:04 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=50,IsDisplayed='Y' WHERE AD_Field_ID=200492 +; + +-- Sep 18, 2012 12:12:05 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=200493 +; + +-- Sep 18, 2012 12:12:05 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=200494 +; + +-- Sep 18, 2012 12:12:05 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=200495 +; + +-- Sep 18, 2012 12:12:05 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=200496 +; + +-- Sep 18, 2012 12:12:05 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=200498 +; + +-- Sep 18, 2012 12:12:05 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=200499 +; + +-- Sep 18, 2012 12:13:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=200492 +; + +-- Sep 18, 2012 12:13:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=200493 +; + +-- Sep 18, 2012 12:13:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=30,IsDisplayed='Y' WHERE AD_Field_ID=200494 +; + +-- Sep 18, 2012 12:13:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=40,IsDisplayed='Y' WHERE AD_Field_ID=200499 +; + +-- Sep 18, 2012 12:13:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=50,IsDisplayed='Y' WHERE AD_Field_ID=200496 +; + +-- Sep 18, 2012 12:13:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=200495 +; + +-- Sep 18, 2012 12:13:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=200491 +; + +-- Sep 18, 2012 12:13:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=200498 +; + +-- Sep 18, 2012 12:13:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=200488 +; + +-- Sep 18, 2012 12:14:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200487,'D','N','N','N',0,'N',22,'Y',10,'N','N',469,'N','Y','85289efa-6925-4a1b-a56d-d2eeab992199','N','Y','N','Name','Alphanumeric identifier of the entity','The name of an entity (record) is used as an default search option in addition to the search key. The name is up to 60 characters in length.','Name','Y',0,TO_TIMESTAMP('2012-09-18 12:14:18','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-18 12:14:18','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 18, 2012 12:14:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200487 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 18, 2012 12:14:26 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_Schedule ADD COLUMN Name VARCHAR(22) DEFAULT NULL +; + +-- Sep 18, 2012 12:14:45 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,22,'N','N',200487,'Y',200500,'N','The name of an entity (record) is used as an default search option in addition to the search key. The name is up to 60 characters in length.','D','Alphanumeric identifier of the entity','Name','Y','N','40e45db9-e809-4c5b-9eb1-ded79bc2065f',0,0,TO_TIMESTAMP('2012-09-18 12:14:45','YYYY-MM-DD HH24:MI:SS'),0,0,TO_TIMESTAMP('2012-09-18 12:14:45','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 18, 2012 12:14:45 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200500 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 18, 2012 12:15:06 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=30,IsDisplayed='Y' WHERE AD_Field_ID=200500 +; + +-- Sep 18, 2012 12:15:06 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=40,IsDisplayed='Y' WHERE AD_Field_ID=200494 +; + +-- Sep 18, 2012 12:15:06 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=50,IsDisplayed='Y' WHERE AD_Field_ID=200499 +; + +-- Sep 18, 2012 12:15:06 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=200496 +; + +-- Sep 18, 2012 12:15:06 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=200495 +; + +-- Sep 18, 2012 12:15:06 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=200491 +; + +-- Sep 18, 2012 12:15:06 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=200498 +; + +-- Sep 18, 2012 12:15:06 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=200488 +; + + +-- Sep 18, 2012 1:47:15 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@ScheduleType@=F',Updated=TO_TIMESTAMP('2012-09-18 13:47:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200496 +; + +-- Sep 18, 2012 1:50:16 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET DisplayLogic='@ScheduleType@=C',Updated=TO_TIMESTAMP('2012-09-18 13:50:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200491 +; + +-- Sep 18, 2012 1:52:00 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_TIMESTAMP('2012-09-18 13:52:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200488 +; + +-- Sep 18, 2012 1:52:10 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET ColumnSpan=1,Updated=TO_TIMESTAMP('2012-09-18 13:52:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200488 +; + +-- Sep 18, 2012 1:52:18 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_TIMESTAMP('2012-09-18 13:52:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200490 +; + +-- Sep 18, 2012 1:52:36 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET XPosition=4, ColumnSpan=2,Updated=TO_TIMESTAMP('2012-09-18 13:52:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200497 +; + +-- Sep 18, 2012 1:52:43 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET ColumnSpan=5,Updated=TO_TIMESTAMP('2012-09-18 13:52:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200500 +; + +-- Sep 18, 2012 1:52:58 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET ColumnSpan=5, NumLines=3,Updated=TO_TIMESTAMP('2012-09-18 13:52:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200494 +; + +-- Sep 18, 2012 1:53:07 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_TIMESTAMP('2012-09-18 13:53:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200499 +; + +-- Sep 18, 2012 1:53:20 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET XPosition=4, ColumnSpan=2,Updated=TO_TIMESTAMP('2012-09-18 13:53:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200496 +; + +-- Sep 18, 2012 1:53:33 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET XPosition=4, ColumnSpan=2,Updated=TO_TIMESTAMP('2012-09-18 13:53:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200495 +; + +-- Sep 18, 2012 1:53:38 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET XPosition=1,Updated=TO_TIMESTAMP('2012-09-18 13:53:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200495 +; + +-- Sep 18, 2012 1:53:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET ColumnSpan=5,Updated=TO_TIMESTAMP('2012-09-18 13:53:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200491 +; + +-- Sep 18, 2012 1:53:51 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET ColumnSpan=5,Updated=TO_TIMESTAMP('2012-09-18 13:53:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200498 +; + +-- Sep 18, 2012 1:53:58 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET XPosition=2,Updated=TO_TIMESTAMP('2012-09-18 13:53:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200488 +; + +-- Sep 18, 2012 1:56:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Menu (AD_Window_ID,AD_Menu_ID,IsSummary,IsSOTrx,IsReadOnly,EntityType,IsCentrallyMaintained,Name,Description,"action",AD_Menu_UU,IsActive,AD_Client_ID,CreatedBy,Updated,AD_Org_ID,Created,UpdatedBy) VALUES (200012,200018,'N','N','N','D','Y','Schedule','Maintain times foe Scheduler','W','e821174d-eb46-4c6c-b295-9b9ea2d3822e','Y',0,0,TO_TIMESTAMP('2012-09-18 13:56:43','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2012-09-18 13:56:43','YYYY-MM-DD HH24:MI:SS'),0) +; + +-- Sep 18, 2012 1:56:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Menu_Trl_UU ) SELECT l.AD_Language,t.AD_Menu_ID, t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Menu_ID=200018 AND NOT EXISTS (SELECT * FROM AD_Menu_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Menu_ID=t.AD_Menu_ID) +; + +-- Sep 18, 2012 1:56:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo, AD_TreeNodeMM_UU) SELECT t.AD_Client_ID, 0, 'Y', CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0,t.AD_Tree_ID, 200018, 0, 999, Generate_UUID() FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.TreeType='MM' AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=200018) +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=0, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=218 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=1, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=153 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=2, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=263 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=3, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=166 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=4, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=203 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=5, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53242 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=6, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=236 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=7, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=183 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=8, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=160 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=9, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=278 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=10, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53296 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=11, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=345 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=12, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53014 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=13, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53108 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=456, SeqNo=0, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=450 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=456, SeqNo=1, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=200018 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=456, SeqNo=2, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=200 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=456, SeqNo=3, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=446 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=456, SeqNo=4, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53191 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=456, SeqNo=5, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53192 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=456, SeqNo=6, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=439 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=456, SeqNo=7, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=440 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=456, SeqNo=8, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=594 +; + +-- Sep 18, 2012 1:57:13 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_TreeNodeMM SET Parent_ID=456, SeqNo=9, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=50009 +; + +-- Sep 18, 2012 2:13:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=200491 +; + +-- Sep 18, 2012 2:13:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=200495 +; + +-- Sep 18, 2012 2:14:48 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET AD_Reference_ID=20,Updated=TO_TIMESTAMP('2012-09-18 14:14:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=200478 +; + +-- Sep 20, 2012 9:38:20 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Schedule (Frequency,AD_Client_ID,AD_Org_ID,AD_Schedule_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive,FrequencyType,ScheduleType,MonthDay,Name) VALUES (1,0,0,200000,TO_TIMESTAMP('2012-09-20 09:38:18','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2012-09-20 09:38:18','YYYY-MM-DD HH24:MI:SS'),100,'Y','D','F',0,'1 Day') +; + +-- Sep 20, 2012 10:16:54 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Schedule (Frequency,AD_Client_ID,AD_Org_ID,AD_Schedule_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive,FrequencyType,ScheduleType,MonthDay,Name) VALUES (7,0,0,200001,TO_TIMESTAMP('2012-09-20 10:16:53','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2012-09-20 10:16:53','YYYY-MM-DD HH24:MI:SS'),100,'Y','D','F',0,'7 Days') +; + +-- Sep 20, 2012 10:20:08 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,688,200489,'D','N','N','N',0,'N',10,'N',19,'N','N',200132,'N','Y','a61f8f27-8146-4c2d-9cea-b9fc50d7a77e','N','Y','N','AD_Schedule_ID','AD_Schedule_ID','Y',100,TO_TIMESTAMP('2012-09-20 10:20:07','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-20 10:20:07','YYYY-MM-DD HH24:MI:SS'),100,0,0) +; + +-- Sep 20, 2012 10:20:08 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200489 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 20, 2012 10:20:17 AM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_Scheduler ADD COLUMN AD_Schedule_ID NUMERIC(10) DEFAULT NULL +; + +-- Sep 20, 2012 10:20:58 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',589,10,'N','N',200489,'Y',200501,'N','D','AD_Schedule_ID','Y','N','ae7b8de9-50f5-4f79-92ef-c7d5e72555b0',100,0,TO_TIMESTAMP('2012-09-20 10:20:57','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-20 10:20:57','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 20, 2012 10:20:58 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200501 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 20, 2012 10:20:59 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',589,36,'N','N',60493,'Y',200502,'N','D','AD_Scheduler_UU','Y','N','57fc4fb5-58ff-4f4d-8799-a9fee348cc9f',100,0,TO_TIMESTAMP('2012-09-20 10:20:58','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-20 10:20:58','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 20, 2012 10:20:59 AM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200502 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 20, 2012 10:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=200502 +; + +-- Sep 20, 2012 10:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=200501 +; + +-- Sep 20, 2012 10:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=10051 +; + +-- Sep 20, 2012 10:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=9437 +; + +-- Sep 20, 2012 10:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=9430 +; + +-- Sep 20, 2012 10:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=58773 +; + +-- Sep 20, 2012 10:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=58774 +; + +-- Sep 20, 2012 10:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=130,IsDisplayed='Y' WHERE AD_Field_ID=9432 +; + +-- Sep 20, 2012 10:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=140,IsDisplayed='Y' WHERE AD_Field_ID=9442 +; + +-- Sep 20, 2012 10:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=9443 +; + +-- Sep 20, 2012 10:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=9438 +; + +-- Sep 20, 2012 10:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=60991 +; + +-- Sep 20, 2012 10:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=60992 +; + +-- Sep 20, 2012 10:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=190,IsDisplayed='Y' WHERE AD_Field_ID=9434 +; + +-- Sep 20, 2012 10:24:02 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET Name='Schedule', ColumnSpan=2,Updated=TO_TIMESTAMP('2012-09-20 10:24:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200501 +; + +-- Sep 20, 2012 10:24:02 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field_Trl SET IsTranslated='N' WHERE AD_Field_ID=200501 +; + +-- Sep 20, 2012 10:26:00 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=200502 +; + +-- Sep 20, 2012 10:26:00 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNoGrid=180,IsDisplayedGrid='Y' WHERE AD_Field_ID=200501 +; + +-- Sep 20, 2012 10:27:53 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET SeqNoSelection=2,Updated=TO_TIMESTAMP('2012-09-20 10:27:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200487 +; +-- Sep 20, 2012 11:23:10 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsSelectionColumn='N', IsUpdateable='N', SeqNoSelection=0,Updated=TO_TIMESTAMP('2012-09-20 11:23:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200487 +; + +-- Sep 20, 2012 11:23:16 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsSelectionColumn='Y', IsUpdateable='N', SeqNoSelection=2,Updated=TO_TIMESTAMP('2012-09-20 11:23:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200487 +; + + +-- Sep 20, 2012 11:35:11 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=58774 +; + +-- Sep 20, 2012 11:35:11 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=9430 +; + +-- Sep 20, 2012 11:35:11 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=9437 +; + +-- Sep 20, 2012 11:35:11 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=10051 +; + +-- Sep 20, 2012 11:35:11 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=58773 +; + +-- Sep 20, 2012 11:35:11 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=9432 +; + +-- Sep 20, 2012 11:35:11 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=9442 +; + +-- Sep 20, 2012 11:35:11 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=9443 +; + +-- Sep 20, 2012 11:35:11 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=9438 +; + +-- Sep 20, 2012 11:35:11 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=130,IsDisplayed='Y' WHERE AD_Field_ID=60991 +; + +-- Sep 20, 2012 11:35:11 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=140,IsDisplayed='Y' WHERE AD_Field_ID=60992 +; + +-- Sep 20, 2012 11:35:11 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=9434 +; + +-- Sep 20, 2012 11:37:12 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=58774 +; + +-- Sep 20, 2012 11:37:12 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=9430 +; + +-- Sep 20, 2012 11:37:12 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=9437 +; + +-- Sep 20, 2012 11:37:12 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=10051 +; + +-- Sep 20, 2012 11:37:12 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNoGrid=70,IsDisplayedGrid='Y' WHERE AD_Field_ID=58773 +; + +-- Sep 20, 2012 11:37:12 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNoGrid=80,IsDisplayedGrid='Y' WHERE AD_Field_ID=9432 +; + +-- Sep 20, 2012 11:37:12 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNoGrid=90,IsDisplayedGrid='Y' WHERE AD_Field_ID=9442 +; + +-- Sep 20, 2012 11:37:12 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNoGrid=100,IsDisplayedGrid='Y' WHERE AD_Field_ID=9443 +; + +-- Sep 20, 2012 11:37:12 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNoGrid=110,IsDisplayedGrid='Y' WHERE AD_Field_ID=9438 +; + +-- Sep 20, 2012 11:37:12 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNoGrid=120,IsDisplayedGrid='Y' WHERE AD_Field_ID=60991 +; + +-- Sep 20, 2012 11:37:12 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNoGrid=130,IsDisplayedGrid='Y' WHERE AD_Field_ID=60992 +; + +-- Sep 20, 2012 11:37:12 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNoGrid=140,IsDisplayedGrid='Y' WHERE AD_Field_ID=200501 +; + +-- Sep 20, 2012 11:52:30 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 11:52:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=59029 +; + +-- Sep 20, 2012 11:52:39 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 11:52:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11247 +; + +-- Sep 20, 2012 11:52:44 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 11:52:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11255 +; + +-- Sep 20, 2012 11:52:55 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 11:52:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11523 +; + +-- Sep 20, 2012 11:53:05 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 11:53:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11521 +; + +-- Sep 20, 2012 11:53:14 AM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 11:53:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11522 +; + +-- Sep 20, 2012 6:24:20 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,695,200490,'D','N','N','N',0,'N',10,'N',19,'N','N',200132,'N','Y','7e549561-f9c8-44b7-9bc2-9e1d1bb4c728','N','Y','N','AD_Schedule_ID','AD_Schedule_ID','Y',100,TO_TIMESTAMP('2012-09-20 18:24:18','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-20 18:24:18','YYYY-MM-DD HH24:MI:SS'),100,0,0) +; + +-- Sep 20, 2012 6:24:20 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200490 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 20, 2012 6:24:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',608,10,'N','N',200490,'Y',200503,'N','D','AD_Schedule_ID','Y','N','6d491d80-dc56-484f-90c8-8c6d0cb2344d',100,0,TO_TIMESTAMP('2012-09-20 18:24:54','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-20 18:24:54','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 20, 2012 6:24:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200503 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 20, 2012 6:24:56 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',608,36,'N','N',60588,'Y',200504,'N','D','C_AcctProcessor_UU','Y','N','1cbac684-149b-40fc-b1bc-66a8e3bde012',100,0,TO_TIMESTAMP('2012-09-20 18:24:55','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-20 18:24:55','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 20, 2012 6:24:56 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200504 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 20, 2012 6:25:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=200504 +; + +-- Sep 20, 2012 6:25:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=9039 +; + +-- Sep 20, 2012 6:25:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=200503 +; + +-- Sep 20, 2012 6:25:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=9037 +; + +-- Sep 20, 2012 6:25:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=9028 +; + +-- Sep 20, 2012 6:25:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=9027 +; + +-- Sep 20, 2012 6:25:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=9033 +; + +-- Sep 20, 2012 6:25:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=130,IsDisplayed='Y' WHERE AD_Field_ID=9031 +; + +-- Sep 20, 2012 6:25:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=140,IsDisplayed='Y' WHERE AD_Field_ID=9032 +; + +-- Sep 20, 2012 6:25:59 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=9028 +; + +-- Sep 20, 2012 6:25:59 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=9037 +; + +-- Sep 20, 2012 6:25:59 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=9027 +; + +-- Sep 20, 2012 6:25:59 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=9033 +; + +-- Sep 20, 2012 6:25:59 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=9031 +; + +-- Sep 20, 2012 6:25:59 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=9032 +; + +-- Sep 20, 2012 6:27:37 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 18:27:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11348 +; + +-- Sep 20, 2012 6:27:43 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 18:27:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11359 +; + +-- Sep 20, 2012 6:28:12 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET ColumnSpan=3,Updated=TO_TIMESTAMP('2012-09-20 18:28:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200503 +; + +-- Sep 20, 2012 6:29:41 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Schedule (Frequency,AD_Client_ID,AD_Org_ID,AD_Schedule_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive,FrequencyType,ScheduleType,MonthDay,Name) VALUES (10,0,0,200002,TO_TIMESTAMP('2012-09-20 18:29:40','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2012-09-20 18:29:40','YYYY-MM-DD HH24:MI:SS'),100,'Y','M','F',0,'10 Minutes') +; + +-- Sep 20, 2012 6:31:38 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE C_AcctProcessor ADD COLUMN AD_Schedule_ID NUMERIC(10) DEFAULT NULL +; + +-- Sep 20, 2012 6:33:24 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsIdentifier='Y', SeqNo=2, IsUpdateable='N',Updated=TO_TIMESTAMP('2012-09-20 18:33:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200487 +; + +-- Sep 20, 2012 6:55:21 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,700,200491,'D','N','N','N',0,'N',10,'N',19,'N','N',200132,'N','Y','273fcf64-47b6-48ef-a432-b1d600bad17f','N','Y','N','AD_Schedule_ID','AD_Schedule_ID','Y',100,TO_TIMESTAMP('2012-09-20 18:55:19','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-20 18:55:19','YYYY-MM-DD HH24:MI:SS'),100,0,0) +; + +-- Sep 20, 2012 6:55:21 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200491 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 20, 2012 6:55:26 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_AlertProcessor ADD COLUMN AD_Schedule_ID NUMERIC(10) DEFAULT NULL +; + +-- Sep 20, 2012 6:56:21 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',631,36,'N','N',60374,'Y',200505,'N','D','AD_AlertProcessor_UU','Y','N','a9ee04e4-207b-400f-b182-b6600231ce3e',100,0,TO_TIMESTAMP('2012-09-20 18:56:20','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-20 18:56:20','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 20, 2012 6:56:21 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200505 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 20, 2012 6:56:22 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',631,10,'N','N',200491,'Y',200506,'N','D','AD_Schedule_ID','Y','N','bcfced0e-e826-4815-a75e-767f25b1f1ae',100,0,TO_TIMESTAMP('2012-09-20 18:56:21','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-20 18:56:21','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 20, 2012 6:56:22 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200506 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 20, 2012 6:56:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=200505 +; + +-- Sep 20, 2012 6:56:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=9534 +; + +-- Sep 20, 2012 6:56:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=9533 +; + +-- Sep 20, 2012 6:56:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=200506 +; + +-- Sep 20, 2012 6:56:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=9530 +; + +-- Sep 20, 2012 6:56:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=9532 +; + +-- Sep 20, 2012 6:56:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=9524 +; + +-- Sep 20, 2012 6:56:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=9527 +; + +-- Sep 20, 2012 6:57:01 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_TIMESTAMP('2012-09-20 18:57:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200506 +; + +-- Sep 20, 2012 6:57:26 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsMandatory='N', IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 18:57:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11441 +; + +-- Sep 20, 2012 6:57:32 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2012-09-20 18:57:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11440 +; + +-- Sep 20, 2012 6:57:43 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO t_alter_column values('ad_alertprocessor','FrequencyType','CHAR(1)',null,'NULL') +; + +-- Sep 20, 2012 6:57:43 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO t_alter_column values('ad_alertprocessor','FrequencyType',null,'NULL',null) +; + +-- Sep 20, 2012 6:59:53 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_AlertProcessor SET AD_Schedule_ID=200000,Updated=TO_TIMESTAMP('2012-09-20 18:59:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_AlertProcessor_ID=100 +; + +-- Sep 20, 2012 7:00:09 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Element SET PrintName='Schedule',Updated=TO_TIMESTAMP('2012-09-20 19:00:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=200132 +; + +-- Sep 20, 2012 7:00:09 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=200132 +; + +-- Sep 20, 2012 7:00:09 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_PrintFormatItem SET PrintName='Schedule', Name='AD_Schedule_ID' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=AD_PrintFormatItem.AD_Column_ID AND c.AD_Element_ID=200132) +; + +-- Sep 20, 2012 7:23:52 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,420,200492,'D','N','N','N',0,'N',10,'N',19,'N','N',200132,'N','Y','e3fdcc19-7a75-4a63-97a1-785bbafe1996','N','Y','N','AD_Schedule_ID','AD_Schedule_ID','Y',100,TO_TIMESTAMP('2012-09-20 19:23:51','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-20 19:23:51','YYYY-MM-DD HH24:MI:SS'),100,0,0) +; + +-- Sep 20, 2012 7:23:52 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200492 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 20, 2012 7:35:11 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE R_RequestProcessor ADD COLUMN AD_Schedule_ID NUMERIC(10) DEFAULT NULL +; + +-- Sep 20, 2012 7:36:28 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',346,10,'N','N',200492,'Y',200507,'N','D','AD_Schedule_ID','Y','N','fad6e2a5-de6b-44ec-add5-f61622bf7731',100,0,TO_TIMESTAMP('2012-09-20 19:36:26','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-20 19:36:26','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 20, 2012 7:36:28 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200507 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 20, 2012 7:36:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',346,36,'N','N',61024,'Y',200508,'N','D','R_RequestProcessor_UU','Y','N','034c812e-f7b9-4897-baa8-7a5751483828',100,0,TO_TIMESTAMP('2012-09-20 19:36:28','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-20 19:36:28','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 20, 2012 7:36:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200508 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 20, 2012 7:36:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=4330 +; + +-- Sep 20, 2012 7:36:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=4331 +; + +-- Sep 20, 2012 7:36:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=200508 +; + +-- Sep 20, 2012 7:36:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=200507 +; + +-- Sep 20, 2012 7:36:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=5149 +; + +-- Sep 20, 2012 7:36:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=10907 +; + +-- Sep 20, 2012 7:36:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=5150 +; + +-- Sep 20, 2012 7:36:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=5166 +; + +-- Sep 20, 2012 7:36:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=10912 +; + +-- Sep 20, 2012 7:36:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=130,IsDisplayed='Y' WHERE AD_Field_ID=9318 +; + +-- Sep 20, 2012 7:36:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=140,IsDisplayed='Y' WHERE AD_Field_ID=4327 +; + +-- Sep 20, 2012 7:36:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=4328 +; + +-- Sep 20, 2012 7:37:15 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_TIMESTAMP('2012-09-20 19:37:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200507 +; + +-- Sep 20, 2012 7:37:37 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 19:37:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5480 +; + +-- Sep 20, 2012 7:37:41 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 19:37:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5481 +; + +-- Sep 20, 2012 7:39:26 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Schedule (Frequency,AD_Client_ID,AD_Org_ID,AD_Schedule_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive,FrequencyType,ScheduleType,MonthDay,Name) VALUES (15,0,0,200003,TO_TIMESTAMP('2012-09-20 19:39:24','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2012-09-20 19:39:24','YYYY-MM-DD HH24:MI:SS'),100,'Y','M','F',0,'15 Minutes') +; + +-- Sep 20, 2012 7:55:53 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,697,200493,'D','N','N','N',0,'N',10,'N',19,'N','N',200132,'N','Y','a8107d13-a59f-4b3f-b5d7-467c067eb8f0','N','Y','N','AD_Schedule_ID','AD_Schedule_ID','Y',100,TO_TIMESTAMP('2012-09-20 19:55:52','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-20 19:55:52','YYYY-MM-DD HH24:MI:SS'),100,0,0) +; + +-- Sep 20, 2012 7:55:53 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200493 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 20, 2012 7:56:02 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_WorkflowProcessor ADD COLUMN AD_Schedule_ID NUMERIC(10) DEFAULT NULL +; + +-- Sep 20, 2012 7:56:54 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',592,10,'N','N',200493,'Y',200509,'N','D','AD_Schedule_ID','Y','N','8be243a9-ba4d-49c2-addb-128f2451e3d8',100,0,TO_TIMESTAMP('2012-09-20 19:56:48','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-20 19:56:48','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 20, 2012 7:56:54 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200509 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 20, 2012 7:56:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',592,36,'N','N',60559,'Y',200510,'N','D','AD_WorkflowProcessor_UU','Y','N','ba7097bf-ef51-4e12-9602-745bd0218380',100,0,TO_TIMESTAMP('2012-09-20 19:56:54','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-20 19:56:54','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 20, 2012 7:56:55 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200510 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 20, 2012 7:57:17 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=200510 +; + +-- Sep 20, 2012 7:57:17 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=9509 +; + +-- Sep 20, 2012 7:57:17 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=9502 +; + +-- Sep 20, 2012 7:57:17 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=200509 +; + +-- Sep 20, 2012 7:57:17 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=10916 +; + +-- Sep 20, 2012 7:57:17 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=10917 +; + +-- Sep 20, 2012 7:57:17 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=9510 +; + +-- Sep 20, 2012 7:57:18 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=9501 +; + +-- Sep 20, 2012 7:57:18 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=10924 +; + +-- Sep 20, 2012 7:57:18 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=9511 +; + +-- Sep 20, 2012 7:57:18 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET SeqNo=130,IsDisplayed='Y' WHERE AD_Field_ID=9499 +; + +-- Sep 20, 2012 7:57:36 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 19:57:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11391 +; + +-- Sep 20, 2012 7:57:41 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 19:57:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11382 +; + +-- Sep 20, 2012 7:59:45 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Schedule (Frequency,AD_Client_ID,AD_Org_ID,AD_Schedule_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive,FrequencyType,ScheduleType,MonthDay) VALUES (2,0,0,200004,TO_TIMESTAMP('2012-09-20 19:59:44','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2012-09-20 19:59:44','YYYY-MM-DD HH24:MI:SS'),100,'Y','H','F',0) +; + +-- Sep 24, 2012 3:50:02 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,DefaultValue,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200557,'U','N','N','N',0,'N',1,'N',20,'N','N',54123,'N','Y','3be5ad4a-1390-4dd5-b526-230f6fe3c9ee','N','Y','N','IsIgnoreProcessingTime','Do not include processing time for the DateNextRun calculation','N','When this is selected, the previous DateNextRun is always use as the source for the next DateNextRun calculation.','Ignore Processing Time','Y',100,TO_TIMESTAMP('2012-09-24 15:50:01','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-24 15:50:01','YYYY-MM-DD HH24:MI:SS'),100,0,0) +; + +-- Sep 24, 2012 3:50:02 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200557 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 3:50:11 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2012-09-24 15:50:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200557 +; + +-- Sep 24, 2012 3:50:15 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_Schedule ADD COLUMN IsIgnoreProcessingTime CHAR(1) DEFAULT 'N' CHECK (IsIgnoreProcessingTime IN ('Y','N')) +; + +-- Sep 24, 2012 3:50:36 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Table SET AD_Window_ID=200012,Updated=TO_TIMESTAMP('2012-09-24 15:50:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=200020 +; + +-- Sep 24, 2012 3:50:49 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,1,'N','N',200557,'Y',200552,'N','When this is selected, the previous DateNextRun is always use as the source for the next DateNextRun calculation.','D','Do not include processing time for the DateNextRun calculation','Ignore Processing Time','Y','N','8abaf449-ec3d-4333-ba76-d437f0055462',100,0,TO_TIMESTAMP('2012-09-24 15:50:48','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 15:50:48','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 24, 2012 3:50:49 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200552 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 3:51:10 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET XPosition=4,Updated=TO_TIMESTAMP('2012-09-24 15:51:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200552 +; + +-- Sep 24, 2012 3:51:17 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-24 15:51:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=59028 +; + +-- Sep 24, 2012 3:52:27 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET IsDisplayed='N', IsActive='N',Updated=TO_TIMESTAMP('2012-09-24 15:52:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58773 +; + +-- Sep 24, 2012 5:05:08 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,Description,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('IsSystemSchedule',200157,'D','IsSystemSchedule','Schedule Just For System','System Schedule','0fcff3a8-e3d4-4d54-a060-7aa225b329c6',0,TO_TIMESTAMP('2012-09-24 17:05:07','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-24 17:05:07','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Sep 24, 2012 5:05:08 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200157 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 5:06:10 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,DefaultValue,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200558,'D','N','N','N',0,'N',1,'N',20,'N','N',200157,'N','Y','f5b750f4-c9a7-4dfb-a4de-17f8431a1f47','N','Y','N','IsSystemSchedule','Schedule Just For System','N','IsSystemSchedule','Y',100,TO_TIMESTAMP('2012-09-24 17:06:09','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-24 17:06:09','YYYY-MM-DD HH24:MI:SS'),100,0,0) +; + +-- Sep 24, 2012 5:06:10 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200558 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 5:06:23 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_Schedule ADD COLUMN IsSystemSchedule CHAR(1) DEFAULT 'N' CHECK (IsSystemSchedule IN ('Y','N')) +; + +-- Sep 24, 2012 5:06:51 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,1,'N','N',200558,'Y',200553,'N','D','Schedule Just For System','IsSystemSchedule','Y','N','1a29d07e-df06-4d49-bab4-733c0f547714',100,0,TO_TIMESTAMP('2012-09-24 17:06:50','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 17:06:50','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Sep 24, 2012 5:06:51 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200553 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Sep 24, 2012 5:07:07 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET XPosition=2,Updated=TO_TIMESTAMP('2012-09-24 17:07:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200553 +; + +-- Sep 24, 2012 5:09:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET XPosition=5,Updated=TO_TIMESTAMP('2012-09-24 17:09:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200552 +; + +-- Sep 24, 2012 5:29:33 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Val_Rule (Code,AD_Val_Rule_ID,EntityType,Name,Type,AD_Val_Rule_UU,CreatedBy,UpdatedBy,Updated,Created,AD_Client_ID,IsActive,AD_Org_ID) VALUES ('AD_Schedule.IsSystemSchedule=''N'' OR @AD_Client_ID@=0',200007,'D','AD_scheduler for System','S','2643339c-9859-4187-a5ec-e0809a93a43a',100,100,TO_TIMESTAMP('2012-09-24 17:29:32','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-24 17:29:32','YYYY-MM-DD HH24:MI:SS'),0,'Y',0) +; + +-- Sep 24, 2012 5:32:02 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Val_Rule SET Name='AD_Schedule for System',Updated=TO_TIMESTAMP('2012-09-24 17:32:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=200007 +; + +-- Sep 24, 2012 5:32:06 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET AD_Val_Rule_ID=200007,Updated=TO_TIMESTAMP('2012-09-24 17:32:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200490 +; + +-- Sep 24, 2012 5:39:23 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET AD_Val_Rule_ID=200007,Updated=TO_TIMESTAMP('2012-09-24 17:39:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200491 +; + +-- Sep 24, 2012 5:47:37 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET AD_Val_Rule_ID=200007,Updated=TO_TIMESTAMP('2012-09-24 17:47:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200493 +; + +-- Sep 24, 2012 5:51:36 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET AD_Val_Rule_ID=200007,Updated=TO_TIMESTAMP('2012-09-24 17:51:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200492 +; + +-- Sep 27, 2012 10:19:28 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2012-09-27 10:19:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11348 +; + +-- Sep 27, 2012 10:19:30 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +INSERT INTO t_alter_column values('c_acctprocessor','Frequency','NUMERIC(10)',null,'NULL') +; + +-- Sep 27, 2012 10:19:30 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +INSERT INTO t_alter_column values('c_acctprocessor','Frequency',null,'NULL',null) +; + +-- Sep 27, 2012 11:05:06 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-27 11:05:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11348 +; + +-- Sep 27, 2012 11:36:59 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2012-09-27 11:36:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11441 +; + +-- Sep 27, 2012 11:37:05 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +INSERT INTO t_alter_column values('ad_alertprocessor','Frequency','NUMERIC(10)',null,'NULL') +; + +-- Sep 27, 2012 11:37:18 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-27 11:37:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11441 +; + +-- Sep 27, 2012 11:37:24 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2012-09-27 11:37:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11440 +; + +-- Sep 27, 2012 11:37:28 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +INSERT INTO t_alter_column values('ad_alertprocessor','FrequencyType','CHAR(1)',null,'NULL') +; + +-- Sep 27, 2012 11:37:34 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-27 11:37:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11440 +; + +-- Sep 27, 2012 11:38:29 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2012-09-27 11:38:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5480 +; + +-- Sep 27, 2012 11:38:33 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +INSERT INTO t_alter_column values('r_requestprocessor','Frequency','NUMERIC(10)',null,'1') +; + +-- Sep 27, 2012 11:38:33 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +INSERT INTO t_alter_column values('r_requestprocessor','Frequency',null,'NULL',null) +; + +-- Sep 27, 2012 11:38:38 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-27 11:38:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5480 +; + +-- Sep 27, 2012 11:38:45 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2012-09-27 11:38:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5481 +; + +-- Sep 27, 2012 11:38:49 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +INSERT INTO t_alter_column values('r_requestprocessor','FrequencyType','CHAR(1)',null,'NULL') +; + +-- Sep 27, 2012 11:38:50 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +INSERT INTO t_alter_column values('r_requestprocessor','FrequencyType',null,'NULL',null) +; + +-- Sep 27, 2012 11:38:55 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-27 11:38:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5481 +; + +-- Sep 27, 2012 11:39:55 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2012-09-27 11:39:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11391 +; + +-- Sep 27, 2012 11:39:56 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +INSERT INTO t_alter_column values('ad_workflowprocessor','Frequency','NUMERIC(10)',null,'NULL') +; + +-- Sep 27, 2012 11:39:56 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +INSERT INTO t_alter_column values('ad_workflowprocessor','Frequency',null,'NULL',null) +; + +-- Sep 27, 2012 11:40:03 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-27 11:40:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11391 +; + +-- Sep 27, 2012 11:40:11 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsMandatory='N', IsActive='N',Updated=TO_TIMESTAMP('2012-09-27 11:40:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11382 +; + +-- Sep 27, 2012 11:45:45 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2012-09-27 11:45:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11247 +; + +-- Sep 27, 2012 11:45:49 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +INSERT INTO t_alter_column values('ad_scheduler','Frequency','NUMERIC(10)',null,'NULL') +; + +-- Sep 27, 2012 11:45:49 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +INSERT INTO t_alter_column values('ad_scheduler','Frequency',null,'NULL',null) +; + +-- Sep 27, 2012 11:45:55 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-27 11:45:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11247 +; + +-- Sep 27, 2012 11:46:03 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2012-09-27 11:46:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11255 +; + +-- Sep 27, 2012 11:46:05 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +INSERT INTO t_alter_column values('ad_scheduler','FrequencyType','CHAR(1)',null,'NULL') +; + +-- Sep 27, 2012 11:46:05 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +INSERT INTO t_alter_column values('ad_scheduler','FrequencyType',null,'NULL',null) +; + +-- Sep 27, 2012 11:46:10 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-27 11:46:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11255 +; + +-- Sep 27, 2012 11:49:52 AM COT +-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator +UPDATE AD_Window SET WindowType='M',Updated=TO_TIMESTAMP('2012-09-27 11:49:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID=200012 +; + + +SELECT register_migration_script('912_IDEMPIERE-391.sql') FROM dual +; + diff --git a/org.adempiere.base/src/org/compiere/model/AdempiereProcessor2.java b/org.adempiere.base/src/org/compiere/model/AdempiereProcessor2.java index 3b3d17dbf6..64e6508f58 100644 --- a/org.adempiere.base/src/org/compiere/model/AdempiereProcessor2.java +++ b/org.adempiere.base/src/org/compiere/model/AdempiereProcessor2.java @@ -25,4 +25,7 @@ public interface AdempiereProcessor2 { * server time is use as the base to the new DateNextRun value. */ public boolean isIgnoreProcessingTime(); + + // IDEMPIERE-391 + public int getAD_Schedule_ID(); } diff --git a/org.adempiere.base/src/org/compiere/model/I_AD_AlertProcessor.java b/org.adempiere.base/src/org/compiere/model/I_AD_AlertProcessor.java index 50bfcf4836..976133619a 100644 --- a/org.adempiere.base/src/org/compiere/model/I_AD_AlertProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/I_AD_AlertProcessor.java @@ -31,7 +31,7 @@ public interface I_AD_AlertProcessor public static final String Table_Name = "AD_AlertProcessor"; /** AD_Table_ID=700 */ - public static final int Table_ID = MTable.getTable_ID(Table_Name); + public static final int Table_ID = 700; KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); @@ -54,6 +54,15 @@ public interface I_AD_AlertProcessor */ public int getAD_AlertProcessor_ID(); + /** Column name AD_AlertProcessor_UU */ + public static final String COLUMNNAME_AD_AlertProcessor_UU = "AD_AlertProcessor_UU"; + + /** Set AD_AlertProcessor_UU */ + public void setAD_AlertProcessor_UU (String AD_AlertProcessor_UU); + + /** Get AD_AlertProcessor_UU */ + public String getAD_AlertProcessor_UU(); + /** Column name AD_Client_ID */ public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID"; @@ -75,6 +84,17 @@ public interface I_AD_AlertProcessor */ public int getAD_Org_ID(); + /** Column name AD_Schedule_ID */ + public static final String COLUMNNAME_AD_Schedule_ID = "AD_Schedule_ID"; + + /** Set AD_Schedule_ID */ + public void setAD_Schedule_ID (int AD_Schedule_ID); + + /** Get AD_Schedule_ID */ + public int getAD_Schedule_ID(); + + public org.compiere.model.I_AD_Schedule getAD_Schedule() throws RuntimeException; + /** Column name Created */ public static final String COLUMNNAME_Created = "Created"; @@ -130,32 +150,6 @@ public interface I_AD_AlertProcessor */ public String getDescription(); - /** Column name Frequency */ - public static final String COLUMNNAME_Frequency = "Frequency"; - - /** Set Frequency. - * Frequency of events - */ - public void setFrequency (int Frequency); - - /** Get Frequency. - * Frequency of events - */ - public int getFrequency(); - - /** Column name FrequencyType */ - public static final String COLUMNNAME_FrequencyType = "FrequencyType"; - - /** Set Frequency Type. - * Frequency of event - */ - public void setFrequencyType (String FrequencyType); - - /** Get Frequency Type. - * Frequency of event - */ - public String getFrequencyType(); - /** Column name IsActive */ public static final String COLUMNNAME_IsActive = "IsActive"; @@ -217,7 +211,7 @@ public interface I_AD_AlertProcessor */ public int getSupervisor_ID(); - public I_AD_User getSupervisor() throws RuntimeException; + public org.compiere.model.I_AD_User getSupervisor() throws RuntimeException; /** Column name Updated */ public static final String COLUMNNAME_Updated = "Updated"; diff --git a/org.adempiere.base/src/org/compiere/model/I_AD_Schedule.java b/org.adempiere.base/src/org/compiere/model/I_AD_Schedule.java new file mode 100644 index 0000000000..efbd4426b3 --- /dev/null +++ b/org.adempiere.base/src/org/compiere/model/I_AD_Schedule.java @@ -0,0 +1,248 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * + * This program is free software, you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY, without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program, if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.math.BigDecimal; +import java.sql.Timestamp; +import org.compiere.util.KeyNamePair; + +/** Generated Interface for AD_Schedule + * @author Adempiere (generated) + * @version Release 3.6.0LTS + */ +public interface I_AD_Schedule +{ + + /** TableName=AD_Schedule */ + public static final String Table_Name = "AD_Schedule"; + + /** AD_Table_ID=200020 */ + public static final int Table_ID = 200020; + + KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); + + /** AccessLevel = - System + */ + BigDecimal accessLevel = BigDecimal.valueOf(4); + + /** Load Meta Data */ + + /** Column name AD_Client_ID */ + public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID"; + + /** Get Client. + * Client/Tenant for this installation. + */ + public int getAD_Client_ID(); + + /** Column name AD_Org_ID */ + public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID"; + + /** Set Organization. + * Organizational entity within client + */ + public void setAD_Org_ID (int AD_Org_ID); + + /** Get Organization. + * Organizational entity within client + */ + public int getAD_Org_ID(); + + /** Column name AD_Schedule_ID */ + public static final String COLUMNNAME_AD_Schedule_ID = "AD_Schedule_ID"; + + /** Set AD_Schedule_ID */ + public void setAD_Schedule_ID (int AD_Schedule_ID); + + /** Get AD_Schedule_ID */ + public int getAD_Schedule_ID(); + + /** Column name Created */ + public static final String COLUMNNAME_Created = "Created"; + + /** Get Created. + * Date this record was created + */ + public Timestamp getCreated(); + + /** Column name CreatedBy */ + public static final String COLUMNNAME_CreatedBy = "CreatedBy"; + + /** Get Created By. + * User who created this records + */ + public int getCreatedBy(); + + /** Column name CronPattern */ + public static final String COLUMNNAME_CronPattern = "CronPattern"; + + /** Set Cron Scheduling Pattern. + * Cron pattern to define when the process should be invoked. + */ + public void setCronPattern (String CronPattern); + + /** Get Cron Scheduling Pattern. + * Cron pattern to define when the process should be invoked. + */ + public String getCronPattern(); + + /** Column name Description */ + public static final String COLUMNNAME_Description = "Description"; + + /** Set Description. + * Optional short description of the record + */ + public void setDescription (String Description); + + /** Get Description. + * Optional short description of the record + */ + public String getDescription(); + + /** Column name Frequency */ + public static final String COLUMNNAME_Frequency = "Frequency"; + + /** Set Frequency. + * Frequency of events + */ + public void setFrequency (int Frequency); + + /** Get Frequency. + * Frequency of events + */ + public int getFrequency(); + + /** Column name FrequencyType */ + public static final String COLUMNNAME_FrequencyType = "FrequencyType"; + + /** Set Frequency Type. + * Frequency of event + */ + public void setFrequencyType (String FrequencyType); + + /** Get Frequency Type. + * Frequency of event + */ + public String getFrequencyType(); + + /** Column name IsActive */ + public static final String COLUMNNAME_IsActive = "IsActive"; + + /** Set Active. + * The record is active in the system + */ + public void setIsActive (boolean IsActive); + + /** Get Active. + * The record is active in the system + */ + public boolean isActive(); + + /** Column name IsIgnoreProcessingTime */ + public static final String COLUMNNAME_IsIgnoreProcessingTime = "IsIgnoreProcessingTime"; + + /** Set Ignore Processing Time. + * Do not include processing time for the DateNextRun calculation + */ + public void setIsIgnoreProcessingTime (boolean IsIgnoreProcessingTime); + + /** Get Ignore Processing Time. + * Do not include processing time for the DateNextRun calculation + */ + public boolean isIgnoreProcessingTime(); + + /** Column name MonthDay */ + public static final String COLUMNNAME_MonthDay = "MonthDay"; + + /** Set Day of the Month. + * Day of the month 1 to 28/29/30/31 + */ + public void setMonthDay (int MonthDay); + + /** Get Day of the Month. + * Day of the month 1 to 28/29/30/31 + */ + public int getMonthDay(); + + /** Column name Name */ + public static final String COLUMNNAME_Name = "Name"; + + /** Set Name. + * Alphanumeric identifier of the entity + */ + public void setName (String Name); + + /** Get Name. + * Alphanumeric identifier of the entity + */ + public String getName(); + + /** Column name RunOnlyOnIP */ + public static final String COLUMNNAME_RunOnlyOnIP = "RunOnlyOnIP"; + + /** Set RunOnlyOnIP. + * Defines the IP address to transfer data to + */ + public void setRunOnlyOnIP (String RunOnlyOnIP); + + /** Get RunOnlyOnIP. + * Defines the IP address to transfer data to + */ + public String getRunOnlyOnIP(); + + /** Column name ScheduleType */ + public static final String COLUMNNAME_ScheduleType = "ScheduleType"; + + /** Set Schedule Type. + * Type of schedule + */ + public void setScheduleType (String ScheduleType); + + /** Get Schedule Type. + * Type of schedule + */ + public String getScheduleType(); + + /** Column name Updated */ + public static final String COLUMNNAME_Updated = "Updated"; + + /** Get Updated. + * Date this record was updated + */ + public Timestamp getUpdated(); + + /** Column name UpdatedBy */ + public static final String COLUMNNAME_UpdatedBy = "UpdatedBy"; + + /** Get Updated By. + * User who updated this records + */ + public int getUpdatedBy(); + + /** Column name WeekDay */ + public static final String COLUMNNAME_WeekDay = "WeekDay"; + + /** Set Day of the Week. + * Day of the Week + */ + public void setWeekDay (String WeekDay); + + /** Get Day of the Week. + * Day of the Week + */ + public String getWeekDay(); +} diff --git a/org.adempiere.base/src/org/compiere/model/I_AD_Scheduler.java b/org.adempiere.base/src/org/compiere/model/I_AD_Scheduler.java index 3a8c97ed94..d8205fa442 100644 --- a/org.adempiere.base/src/org/compiere/model/I_AD_Scheduler.java +++ b/org.adempiere.base/src/org/compiere/model/I_AD_Scheduler.java @@ -77,6 +77,17 @@ public interface I_AD_Scheduler public org.compiere.model.I_AD_Process getAD_Process() throws RuntimeException; + /** Column name AD_Schedule_ID */ + public static final String COLUMNNAME_AD_Schedule_ID = "AD_Schedule_ID"; + + /** Set AD_Schedule_ID */ + public void setAD_Schedule_ID (int AD_Schedule_ID); + + /** Get AD_Schedule_ID */ + public int getAD_Schedule_ID(); + + public org.compiere.model.I_AD_Schedule getAD_Schedule() throws RuntimeException; + /** Column name AD_Scheduler_ID */ public static final String COLUMNNAME_AD_Scheduler_ID = "AD_Scheduler_ID"; @@ -90,6 +101,15 @@ public interface I_AD_Scheduler */ public int getAD_Scheduler_ID(); + /** Column name AD_Scheduler_UU */ + public static final String COLUMNNAME_AD_Scheduler_UU = "AD_Scheduler_UU"; + + /** Set AD_Scheduler_UU */ + public void setAD_Scheduler_UU (String AD_Scheduler_UU); + + /** Get AD_Scheduler_UU */ + public String getAD_Scheduler_UU(); + /** Column name AD_Table_ID */ public static final String COLUMNNAME_AD_Table_ID = "AD_Table_ID"; @@ -121,19 +141,6 @@ public interface I_AD_Scheduler */ public int getCreatedBy(); - /** Column name CronPattern */ - public static final String COLUMNNAME_CronPattern = "CronPattern"; - - /** Set Cron Scheduling Pattern. - * Cron pattern to define when the process should be invoked. - */ - public void setCronPattern (String CronPattern); - - /** Get Cron Scheduling Pattern. - * Cron pattern to define when the process should be invoked. - */ - public String getCronPattern(); - /** Column name DateLastRun */ public static final String COLUMNNAME_DateLastRun = "DateLastRun"; @@ -173,32 +180,6 @@ public interface I_AD_Scheduler */ public String getDescription(); - /** Column name Frequency */ - public static final String COLUMNNAME_Frequency = "Frequency"; - - /** Set Frequency. - * Frequency of events - */ - public void setFrequency (int Frequency); - - /** Get Frequency. - * Frequency of events - */ - public int getFrequency(); - - /** Column name FrequencyType */ - public static final String COLUMNNAME_FrequencyType = "FrequencyType"; - - /** Set Frequency Type. - * Frequency of event - */ - public void setFrequencyType (String FrequencyType); - - /** Get Frequency Type. - * Frequency of event - */ - public String getFrequencyType(); - /** Column name IsActive */ public static final String COLUMNNAME_IsActive = "IsActive"; @@ -212,19 +193,6 @@ public interface I_AD_Scheduler */ public boolean isActive(); - /** Column name IsIgnoreProcessingTime */ - public static final String COLUMNNAME_IsIgnoreProcessingTime = "IsIgnoreProcessingTime"; - - /** Set Ignore Processing Time. - * Do not include processing time for the DateNextRun calculation - */ - public void setIsIgnoreProcessingTime (boolean IsIgnoreProcessingTime); - - /** Get Ignore Processing Time. - * Do not include processing time for the DateNextRun calculation - */ - public boolean isIgnoreProcessingTime(); - /** Column name KeepLogDays */ public static final String COLUMNNAME_KeepLogDays = "KeepLogDays"; @@ -238,19 +206,6 @@ public interface I_AD_Scheduler */ public int getKeepLogDays(); - /** Column name MonthDay */ - public static final String COLUMNNAME_MonthDay = "MonthDay"; - - /** Set Day of the Month. - * Day of the month 1 to 28/29/30/31 - */ - public void setMonthDay (int MonthDay); - - /** Get Day of the Month. - * Day of the month 1 to 28/29/30/31 - */ - public int getMonthDay(); - /** Column name Name */ public static final String COLUMNNAME_Name = "Name"; @@ -286,19 +241,6 @@ public interface I_AD_Scheduler */ public int getRecord_ID(); - /** Column name ScheduleType */ - public static final String COLUMNNAME_ScheduleType = "ScheduleType"; - - /** Set Schedule Type. - * Type of schedule - */ - public void setScheduleType (String ScheduleType); - - /** Get Schedule Type. - * Type of schedule - */ - public String getScheduleType(); - /** Column name Supervisor_ID */ public static final String COLUMNNAME_Supervisor_ID = "Supervisor_ID"; @@ -329,17 +271,4 @@ public interface I_AD_Scheduler * User who updated this records */ public int getUpdatedBy(); - - /** Column name WeekDay */ - public static final String COLUMNNAME_WeekDay = "WeekDay"; - - /** Set Day of the Week. - * Day of the Week - */ - public void setWeekDay (String WeekDay); - - /** Get Day of the Week. - * Day of the Week - */ - public String getWeekDay(); } diff --git a/org.adempiere.base/src/org/compiere/model/I_AD_WorkflowProcessor.java b/org.adempiere.base/src/org/compiere/model/I_AD_WorkflowProcessor.java index f6ec7b806f..6843046966 100644 --- a/org.adempiere.base/src/org/compiere/model/I_AD_WorkflowProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/I_AD_WorkflowProcessor.java @@ -31,13 +31,13 @@ public interface I_AD_WorkflowProcessor public static final String Table_Name = "AD_WorkflowProcessor"; /** AD_Table_ID=697 */ - public static final int Table_ID = MTable.getTable_ID(Table_Name); + public static final int Table_ID = 697; KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); - /** AccessLevel = 4 - System + /** AccessLevel = 6 - System - Client */ - BigDecimal accessLevel = BigDecimal.valueOf(4); + BigDecimal accessLevel = BigDecimal.valueOf(6); /** Load Meta Data */ @@ -62,6 +62,17 @@ public interface I_AD_WorkflowProcessor */ public int getAD_Org_ID(); + /** Column name AD_Schedule_ID */ + public static final String COLUMNNAME_AD_Schedule_ID = "AD_Schedule_ID"; + + /** Set AD_Schedule_ID */ + public void setAD_Schedule_ID (int AD_Schedule_ID); + + /** Get AD_Schedule_ID */ + public int getAD_Schedule_ID(); + + public org.compiere.model.I_AD_Schedule getAD_Schedule() throws RuntimeException; + /** Column name AD_WorkflowProcessor_ID */ public static final String COLUMNNAME_AD_WorkflowProcessor_ID = "AD_WorkflowProcessor_ID"; @@ -75,6 +86,15 @@ public interface I_AD_WorkflowProcessor */ public int getAD_WorkflowProcessor_ID(); + /** Column name AD_WorkflowProcessor_UU */ + public static final String COLUMNNAME_AD_WorkflowProcessor_UU = "AD_WorkflowProcessor_UU"; + + /** Set AD_WorkflowProcessor_UU */ + public void setAD_WorkflowProcessor_UU (String AD_WorkflowProcessor_UU); + + /** Get AD_WorkflowProcessor_UU */ + public String getAD_WorkflowProcessor_UU(); + /** Column name AlertOverPriority */ public static final String COLUMNNAME_AlertOverPriority = "AlertOverPriority"; @@ -143,32 +163,6 @@ public interface I_AD_WorkflowProcessor */ public String getDescription(); - /** Column name Frequency */ - public static final String COLUMNNAME_Frequency = "Frequency"; - - /** Set Frequency. - * Frequency of events - */ - public void setFrequency (int Frequency); - - /** Get Frequency. - * Frequency of events - */ - public int getFrequency(); - - /** Column name FrequencyType */ - public static final String COLUMNNAME_FrequencyType = "FrequencyType"; - - /** Set Frequency Type. - * Frequency of event - */ - public void setFrequencyType (String FrequencyType); - - /** Get Frequency Type. - * Frequency of event - */ - public String getFrequencyType(); - /** Column name InactivityAlertDays */ public static final String COLUMNNAME_InactivityAlertDays = "InactivityAlertDays"; @@ -256,7 +250,7 @@ public interface I_AD_WorkflowProcessor */ public int getSupervisor_ID(); - public I_AD_User getSupervisor() throws RuntimeException; + public org.compiere.model.I_AD_User getSupervisor() throws RuntimeException; /** Column name Updated */ public static final String COLUMNNAME_Updated = "Updated"; diff --git a/org.adempiere.base/src/org/compiere/model/I_C_AcctProcessor.java b/org.adempiere.base/src/org/compiere/model/I_C_AcctProcessor.java index 3ac2583d98..5b321cfdbb 100644 --- a/org.adempiere.base/src/org/compiere/model/I_C_AcctProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/I_C_AcctProcessor.java @@ -31,7 +31,7 @@ public interface I_C_AcctProcessor public static final String Table_Name = "C_AcctProcessor"; /** AD_Table_ID=695 */ - public static final int Table_ID = MTable.getTable_ID(Table_Name); + public static final int Table_ID = 695; KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); @@ -62,6 +62,17 @@ public interface I_C_AcctProcessor */ public int getAD_Org_ID(); + /** Column name AD_Schedule_ID */ + public static final String COLUMNNAME_AD_Schedule_ID = "AD_Schedule_ID"; + + /** Set AD_Schedule_ID */ + public void setAD_Schedule_ID (int AD_Schedule_ID); + + /** Get AD_Schedule_ID */ + public int getAD_Schedule_ID(); + + public org.compiere.model.I_AD_Schedule getAD_Schedule() throws RuntimeException; + /** Column name AD_Table_ID */ public static final String COLUMNNAME_AD_Table_ID = "AD_Table_ID"; @@ -75,7 +86,7 @@ public interface I_C_AcctProcessor */ public int getAD_Table_ID(); - public I_AD_Table getAD_Table() throws RuntimeException; + public org.compiere.model.I_AD_Table getAD_Table() throws RuntimeException; /** Column name C_AcctProcessor_ID */ public static final String COLUMNNAME_C_AcctProcessor_ID = "C_AcctProcessor_ID"; @@ -90,6 +101,15 @@ public interface I_C_AcctProcessor */ public int getC_AcctProcessor_ID(); + /** Column name C_AcctProcessor_UU */ + public static final String COLUMNNAME_C_AcctProcessor_UU = "C_AcctProcessor_UU"; + + /** Set C_AcctProcessor_UU */ + public void setC_AcctProcessor_UU (String C_AcctProcessor_UU); + + /** Get C_AcctProcessor_UU */ + public String getC_AcctProcessor_UU(); + /** Column name C_AcctSchema_ID */ public static final String COLUMNNAME_C_AcctSchema_ID = "C_AcctSchema_ID"; @@ -103,7 +123,7 @@ public interface I_C_AcctProcessor */ public int getC_AcctSchema_ID(); - public I_C_AcctSchema getC_AcctSchema() throws RuntimeException; + public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException; /** Column name Created */ public static final String COLUMNNAME_Created = "Created"; @@ -160,32 +180,6 @@ public interface I_C_AcctProcessor */ public String getDescription(); - /** Column name Frequency */ - public static final String COLUMNNAME_Frequency = "Frequency"; - - /** Set Frequency. - * Frequency of events - */ - public void setFrequency (int Frequency); - - /** Get Frequency. - * Frequency of events - */ - public int getFrequency(); - - /** Column name FrequencyType */ - public static final String COLUMNNAME_FrequencyType = "FrequencyType"; - - /** Set Frequency Type. - * Frequency of event - */ - public void setFrequencyType (String FrequencyType); - - /** Get Frequency Type. - * Frequency of event - */ - public String getFrequencyType(); - /** Column name IsActive */ public static final String COLUMNNAME_IsActive = "IsActive"; @@ -247,7 +241,7 @@ public interface I_C_AcctProcessor */ public int getSupervisor_ID(); - public I_AD_User getSupervisor() throws RuntimeException; + public org.compiere.model.I_AD_User getSupervisor() throws RuntimeException; /** Column name Updated */ public static final String COLUMNNAME_Updated = "Updated"; diff --git a/org.adempiere.base/src/org/compiere/model/I_R_RequestProcessor.java b/org.adempiere.base/src/org/compiere/model/I_R_RequestProcessor.java index b677952d4d..d621441c23 100644 --- a/org.adempiere.base/src/org/compiere/model/I_R_RequestProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/I_R_RequestProcessor.java @@ -31,7 +31,7 @@ public interface I_R_RequestProcessor public static final String Table_Name = "R_RequestProcessor"; /** AD_Table_ID=420 */ - public static final int Table_ID = MTable.getTable_ID(Table_Name); + public static final int Table_ID = 420; KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); @@ -62,6 +62,17 @@ public interface I_R_RequestProcessor */ public int getAD_Org_ID(); + /** Column name AD_Schedule_ID */ + public static final String COLUMNNAME_AD_Schedule_ID = "AD_Schedule_ID"; + + /** Set AD_Schedule_ID */ + public void setAD_Schedule_ID (int AD_Schedule_ID); + + /** Get AD_Schedule_ID */ + public int getAD_Schedule_ID(); + + public org.compiere.model.I_AD_Schedule getAD_Schedule() throws RuntimeException; + /** Column name Created */ public static final String COLUMNNAME_Created = "Created"; @@ -117,32 +128,6 @@ public interface I_R_RequestProcessor */ public String getDescription(); - /** Column name Frequency */ - public static final String COLUMNNAME_Frequency = "Frequency"; - - /** Set Frequency. - * Frequency of events - */ - public void setFrequency (int Frequency); - - /** Get Frequency. - * Frequency of events - */ - public int getFrequency(); - - /** Column name FrequencyType */ - public static final String COLUMNNAME_FrequencyType = "FrequencyType"; - - /** Set Frequency Type. - * Frequency of event - */ - public void setFrequencyType (String FrequencyType); - - /** Get Frequency Type. - * Frequency of event - */ - public String getFrequencyType(); - /** Column name InactivityAlertDays */ public static final String COLUMNNAME_InactivityAlertDays = "InactivityAlertDays"; @@ -256,6 +241,15 @@ public interface I_R_RequestProcessor */ public int getR_RequestProcessor_ID(); + /** Column name R_RequestProcessor_UU */ + public static final String COLUMNNAME_R_RequestProcessor_UU = "R_RequestProcessor_UU"; + + /** Set R_RequestProcessor_UU */ + public void setR_RequestProcessor_UU (String R_RequestProcessor_UU); + + /** Get R_RequestProcessor_UU */ + public String getR_RequestProcessor_UU(); + /** Column name R_RequestType_ID */ public static final String COLUMNNAME_R_RequestType_ID = "R_RequestType_ID"; @@ -269,7 +263,7 @@ public interface I_R_RequestProcessor */ public int getR_RequestType_ID(); - public I_R_RequestType getR_RequestType() throws RuntimeException; + public org.compiere.model.I_R_RequestType getR_RequestType() throws RuntimeException; /** Column name Supervisor_ID */ public static final String COLUMNNAME_Supervisor_ID = "Supervisor_ID"; @@ -284,7 +278,7 @@ public interface I_R_RequestProcessor */ public int getSupervisor_ID(); - public I_AD_User getSupervisor() throws RuntimeException; + public org.compiere.model.I_AD_User getSupervisor() throws RuntimeException; /** Column name Updated */ public static final String COLUMNNAME_Updated = "Updated"; diff --git a/org.adempiere.base/src/org/compiere/model/I_R_RequestProcessorLog.java b/org.adempiere.base/src/org/compiere/model/I_R_RequestProcessorLog.java index 0beaa94a66..177891f388 100644 --- a/org.adempiere.base/src/org/compiere/model/I_R_RequestProcessorLog.java +++ b/org.adempiere.base/src/org/compiere/model/I_R_RequestProcessorLog.java @@ -156,7 +156,7 @@ public interface I_R_RequestProcessorLog */ public int getR_RequestProcessor_ID(); - public I_R_RequestProcessor getR_RequestProcessor() throws RuntimeException; + public org.compiere.model.I_R_RequestProcessor getR_RequestProcessor() throws RuntimeException; /** Column name R_RequestProcessorLog_ID */ public static final String COLUMNNAME_R_RequestProcessorLog_ID = "R_RequestProcessorLog_ID"; diff --git a/org.adempiere.base/src/org/compiere/model/I_R_RequestProcessor_Route.java b/org.adempiere.base/src/org/compiere/model/I_R_RequestProcessor_Route.java index 25b9a32b5a..9658dc64e2 100644 --- a/org.adempiere.base/src/org/compiere/model/I_R_RequestProcessor_Route.java +++ b/org.adempiere.base/src/org/compiere/model/I_R_RequestProcessor_Route.java @@ -75,7 +75,7 @@ public interface I_R_RequestProcessor_Route */ public int getAD_User_ID(); - public I_AD_User getAD_User() throws RuntimeException; + public org.compiere.model.I_AD_User getAD_User() throws RuntimeException; /** Column name Created */ public static final String COLUMNNAME_Created = "Created"; @@ -132,7 +132,7 @@ public interface I_R_RequestProcessor_Route */ public int getR_RequestProcessor_ID(); - public I_R_RequestProcessor getR_RequestProcessor() throws RuntimeException; + public org.compiere.model.I_R_RequestProcessor getR_RequestProcessor() throws RuntimeException; /** Column name R_RequestProcessor_Route_ID */ public static final String COLUMNNAME_R_RequestProcessor_Route_ID = "R_RequestProcessor_Route_ID"; @@ -160,7 +160,7 @@ public interface I_R_RequestProcessor_Route */ public int getR_RequestType_ID(); - public I_R_RequestType getR_RequestType() throws RuntimeException; + public org.compiere.model.I_R_RequestType getR_RequestType() throws RuntimeException; /** Column name SeqNo */ public static final String COLUMNNAME_SeqNo = "SeqNo"; diff --git a/org.adempiere.base/src/org/compiere/model/MAcctProcessor.java b/org.adempiere.base/src/org/compiere/model/MAcctProcessor.java index ba6d4d9131..49dc20919a 100644 --- a/org.adempiere.base/src/org/compiere/model/MAcctProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/MAcctProcessor.java @@ -35,12 +35,14 @@ import org.compiere.util.Msg; * @version $Id: MAcctProcessor.java,v 1.3 2006/07/30 00:51:02 jjanke Exp $ */ public class MAcctProcessor extends X_C_AcctProcessor - implements AdempiereProcessor + implements AdempiereProcessor, AdempiereProcessor2 { + + /** * */ - private static final long serialVersionUID = 6558688522646469260L; + private static final long serialVersionUID = -7574845047521861399L; /** * Get Active @@ -68,8 +70,8 @@ public class MAcctProcessor extends X_C_AcctProcessor { // setName (null); // setSupervisor_ID (0); - setFrequencyType (FREQUENCYTYPE_Hour); - setFrequency (1); + // setFrequencyType (FREQUENCYTYPE_Hour); + // setFrequency (1); setKeepLogDays (7); // 7 } } // MAcctProcessor @@ -153,4 +155,33 @@ public class MAcctProcessor extends X_C_AcctProcessor return no; } // deleteLog + + @Override + public String getFrequencyType() { + int AD_Schedule_ID = this.getAD_Schedule_ID(); + if( AD_Schedule_ID > 0) + { + MSchedule schedule=MSchedule.get(getCtx(), AD_Schedule_ID); + return schedule.getFrequencyType(); + } + return ""; + } + + @Override + public int getFrequency() { + int AD_Schedule_ID = this.getAD_Schedule_ID(); + if( AD_Schedule_ID > 0) + { + MSchedule schedule=MSchedule.get(getCtx(),AD_Schedule_ID); + return schedule.getFrequency(); + } + return 0; + } + + @Override + public boolean isIgnoreProcessingTime() { + MSchedule schedule=MSchedule.get(getCtx(),getAD_Schedule_ID()); + return schedule.isIgnoreProcessingTime(); + } + } // MAcctProcessor diff --git a/org.adempiere.base/src/org/compiere/model/MAlertProcessor.java b/org.adempiere.base/src/org/compiere/model/MAlertProcessor.java index c8da6d700f..01e2c925f3 100644 --- a/org.adempiere.base/src/org/compiere/model/MAlertProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/MAlertProcessor.java @@ -33,7 +33,7 @@ import org.compiere.util.DB; * @version $Id: MAlertProcessor.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $ */ public class MAlertProcessor extends X_AD_AlertProcessor - implements AdempiereProcessor + implements AdempiereProcessor, AdempiereProcessor2 { /** * @@ -162,4 +162,22 @@ public class MAlertProcessor extends X_AD_AlertProcessor return alerts; } // getAlerts + @Override + public int getFrequency() { + MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID()); + return schedule.getFrequency(); + } + + @Override + public String getFrequencyType() { + MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID()); + return schedule.getFrequencyType(); + } + + @Override + public boolean isIgnoreProcessingTime() { + MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID()); + return schedule.isIgnoreProcessingTime(); + } + } // MAlertProcessor diff --git a/org.adempiere.base/src/org/compiere/model/MLdapProcessor.java b/org.adempiere.base/src/org/compiere/model/MLdapProcessor.java index ce5b5a8a71..7eab3fdc9f 100755 --- a/org.adempiere.base/src/org/compiere/model/MLdapProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/MLdapProcessor.java @@ -203,7 +203,7 @@ public class MLdapProcessor extends X_AD_LdapProcessor implements AdempiereProce */ public String getFrequencyType() { - return X_R_RequestProcessor.FREQUENCYTYPE_Minute; + return X_AD_Schedule.FREQUENCYTYPE_Minute; } // getFrequencyType /** diff --git a/org.adempiere.base/src/org/compiere/model/MRequestProcessor.java b/org.adempiere.base/src/org/compiere/model/MRequestProcessor.java index 173d4cf0c4..1a637a7b55 100644 --- a/org.adempiere.base/src/org/compiere/model/MRequestProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/MRequestProcessor.java @@ -34,7 +34,7 @@ import org.compiere.util.Msg; * @version $Id: MRequestProcessor.java,v 1.2 2006/07/30 00:51:02 jjanke Exp $ */ public class MRequestProcessor extends X_R_RequestProcessor - implements AdempiereProcessor + implements AdempiereProcessor, AdempiereProcessor2 { /** * @@ -96,8 +96,8 @@ public class MRequestProcessor extends X_R_RequestProcessor if (R_RequestProcessor_ID == 0) { // setName (null); - setFrequencyType (FREQUENCYTYPE_Day); - setFrequency (0); + //setFrequencyType (FREQUENCYTYPE_Day); + //setFrequency (0); setKeepLogDays (7); setOverdueAlertDays (0); setOverdueAssignDays (0); @@ -255,5 +255,23 @@ public class MRequestProcessor extends X_R_RequestProcessor { return "RequestProcessor" + get_ID(); } // getServerID + + @Override + public String getFrequencyType() { + MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID()); + return schedule.getFrequencyType(); + } + + @Override + public int getFrequency() { + MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID()); + return schedule.getFrequency(); + } + + @Override + public boolean isIgnoreProcessingTime() { + MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID()); + return schedule.isIgnoreProcessingTime(); + } } // MRequestProcessor diff --git a/org.adempiere.base/src/org/compiere/model/MSchedule.java b/org.adempiere.base/src/org/compiere/model/MSchedule.java new file mode 100644 index 0000000000..5bc05e0374 --- /dev/null +++ b/org.adempiere.base/src/org/compiere/model/MSchedule.java @@ -0,0 +1,273 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ + +package org.compiere.model; + +import it.sauronsoftware.cron4j.Predictor; +import it.sauronsoftware.cron4j.SchedulingPattern; + +import java.net.InetAddress; +import java.sql.ResultSet; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Properties; +import java.util.StringTokenizer; +import java.util.logging.Level; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.regex.PatternSyntaxException; + +import org.compiere.util.DisplayType; + +public class MSchedule extends X_AD_Schedule +{ + + /** + * + */ + private static final long serialVersionUID = 2532063246191430056L; + + private static Pattern VALID_IPV4_PATTERN = null; + private static Pattern VALID_IPV6_PATTERN = null; + private static final String ipv4Pattern = "(([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.){3}([01]?\\d\\d?|2[0-4]\\d|25[0-5])"; + private static final String ipv6Pattern = "([0-9a-f]{1,4}:){7}([0-9a-f]){1,4}"; + + private it.sauronsoftware.cron4j.Scheduler cronScheduler; + private Predictor predictor; + + public MSchedule(Properties ctx, int AD_Schedule_ID, String trxName) { + super(ctx, AD_Schedule_ID, trxName); + // TODO Auto-generated constructor stub + } + + public MSchedule(Properties ctx, ResultSet rs, String trxName) { + super(ctx, rs, trxName); + // TODO Auto-generated constructor stub + } + + protected boolean beforeSave() + { + // Set Schedule Type & Frequencies + if (SCHEDULETYPE_Frequency.equals(getScheduleType())) + { + if (getFrequencyType() == null) + setFrequencyType(FREQUENCYTYPE_Day); + if (getFrequency() < 1) + setFrequency(1); + setCronPattern(null); + } + else if (SCHEDULETYPE_CronSchedulingPattern.equals(getScheduleType())) + { + String pattern = getCronPattern(); + if (pattern != null && pattern.trim().length() > 0) + { + if (!SchedulingPattern.validate(pattern)) + { + log.saveError("Error", "InvalidCronPattern"); + return false; + } + } + } + return true; + } + + + + + /** + * Brought from Compiere Open Source Community version 3.3.0 + * Is it OK to Run process On IP of this box + * @return + */ + public boolean isOKtoRunOnIP() + { + String ipOnly = getRunOnlyOnIP(); + if ((ipOnly == null) || (ipOnly.length() == 0)) + return true; + + StringTokenizer st = new StringTokenizer(ipOnly, ";"); + while (st.hasMoreElements()) + { + String ip = st.nextToken(); + if (checkIP(ip)) + return true; + } + return false; + } // isOKtoRunOnIP + + /** + * + * Brought from Compiere Open Source Community version 3.3.0 + * check whether this IP is allowed to process + * @param ipOnly + * @return true if IP is correct + */ + private boolean checkIP(String ipOnly) + { + try + { + InetAddress box = InetAddress.getLocalHost(); + String ip = box.getHostAddress(); + if (chekIPFormat()) { + if (ipOnly.indexOf(ip) == -1) { + + log.fine("Not allowed here - IP=" + ip + " does not match "+ ipOnly); + return false; + } + log.fine("Allowed here - IP=" + ip + " matches " + ipOnly); + } + else{ + String hostname=box.getHostName(); + if(ipOnly.equals(hostname)){ + log.fine("Not Allowed here -hostname " + hostname + " does not match "+ipOnly); + return false; + } + log.fine("Allowed here - hostname=" + hostname + " matches " + ipOnly); + } + } + catch (Exception e) + { + log.log(Level.SEVERE, "", e); + return false; + } + return true; + } // checkIP + + public static MSchedule get(Properties ctx, int AD_Schedule_ID) + { + if(AD_Schedule_ID > 0) + { + MSchedule schedule=new MSchedule(ctx, AD_Schedule_ID, null); + return schedule; + } + return null; + + } + + public boolean chekIPFormat() + { + boolean IsIp = false; + try { + VALID_IPV4_PATTERN = Pattern.compile(ipv4Pattern,Pattern.CASE_INSENSITIVE); + VALID_IPV6_PATTERN = Pattern.compile(ipv6Pattern,Pattern.CASE_INSENSITIVE); + + Matcher m1 = VALID_IPV4_PATTERN.matcher(getRunOnlyOnIP()); + if (m1.matches()) { + IsIp = true; + } else { + Matcher m2 = VALID_IPV6_PATTERN.matcher(getRunOnlyOnIP()); + if (m2.matches()) { + IsIp = true; + } else { + IsIp = false; + } + } + } catch (PatternSyntaxException e) { + // TODO: handle exception + log.fine("Error: " + e.getLocalizedMessage()); + } + return IsIp; + } + /** + * Brought from Compiere 330 + * Get Next Run + * @param last in MS + * @return next run in MS + */ + public long getNextRunMS (long last) + { + Calendar calNow = Calendar.getInstance(); + calNow.setTimeInMillis (last); + // + Calendar calNext = Calendar.getInstance(); + calNext.setTimeInMillis (last); + + + String scheduleType = getScheduleType(); + if (SCHEDULETYPE_Frequency.equals(scheduleType)) + { + String frequencyType = getFrequencyType(); + int frequency = getFrequency(); + + boolean increment=true; + + + /***** DAY ******/ + if (X_AD_Schedule.FREQUENCYTYPE_Day.equals(frequencyType)) + { + calNext.set (Calendar.HOUR_OF_DAY, 0); + calNext.set (Calendar.MINUTE, 0); + if(increment) + { + calNext.add(Calendar.DAY_OF_YEAR, frequency); + } + } // Day + + /***** HOUR ******/ + else if (X_AD_Schedule.FREQUENCYTYPE_Hour.equals(frequencyType)) + { + calNext.set (Calendar.MINUTE, 0); + if(increment) + { + calNext.add (Calendar.HOUR_OF_DAY, frequency); + } + + } // Hour + + /***** MINUTE ******/ + else if (X_AD_Schedule.FREQUENCYTYPE_Minute.equals(frequencyType)) + { + if(increment) + { + calNext.add(Calendar.MINUTE, frequency); + } + } // Minute + + long delta = calNext.getTimeInMillis() - calNow.getTimeInMillis(); + StringBuilder info = new StringBuilder("Now=") .append(calNow.getTime().toString()) + .append( ", Next=" + calNext.getTime().toString()) + .append( ", Delta=" + delta) + .append( ", " + toString()); + + if (delta < 0) + { + log.warning(info.toString()); + } + else + log.info (info.toString()); + + return calNext.getTimeInMillis(); + } + else + { + String cronPattern = (String) getCronPattern(); + if (cronPattern != null && cronPattern.trim().length() > 0 + && SchedulingPattern.validate(cronPattern)) { + cronScheduler = new it.sauronsoftware.cron4j.Scheduler(); + predictor = new Predictor(cronPattern); + long next = predictor.nextMatchingTime(); + return next; + } + + } + + return 0; + + } // getNextRunMS + +} diff --git a/org.adempiere.base/src/org/compiere/model/MScheduler.java b/org.adempiere.base/src/org/compiere/model/MScheduler.java index c4fa2e716c..c892b021e5 100644 --- a/org.adempiere.base/src/org/compiere/model/MScheduler.java +++ b/org.adempiere.base/src/org/compiere/model/MScheduler.java @@ -72,16 +72,7 @@ public class MScheduler extends X_AD_Scheduler super (ctx, AD_Scheduler_ID, trxName); if (AD_Scheduler_ID == 0) { - // setAD_Process_ID (0); - // setName (null); - setScheduleType (SCHEDULETYPE_Frequency); // F - setFrequencyType (FREQUENCYTYPE_Day); - // setFrequency (1); - // setMonthDay(1); - // setWeekDay(WEEKDAY_Monday); - // setKeepLogDays (7); - // setSupervisor_ID (0); } } // MScheduler @@ -248,27 +239,6 @@ public class MScheduler extends X_AD_Scheduler */ protected boolean beforeSave(boolean newRecord) { - // Set Schedule Type & Frequencies - if (SCHEDULETYPE_Frequency.equals(getScheduleType())) - { - if (getFrequencyType() == null) - setFrequencyType(FREQUENCYTYPE_Day); - if (getFrequency() < 1) - setFrequency(1); - setCronPattern(null); - } - else if (SCHEDULETYPE_CronSchedulingPattern.equals(getScheduleType())) - { - String pattern = getCronPattern(); - if (pattern != null && pattern.trim().length() > 0) - { - if (!SchedulingPattern.validate(pattern)) - { - log.saveError("Error", "InvalidCronPattern"); - return false; - } - } - } // FR [3135351] - Enable Scheduler for buttons if (getAD_Table_ID() > 0) { @@ -315,4 +285,25 @@ public class MScheduler extends X_AD_Scheduler return sb.toString (); } // toString + @Override + public String getFrequencyType() { + MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID()); + + return schedule.getFrequencyType(); + } + + @Override + public int getFrequency() { + MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID()); + return schedule.getFrequency(); + } + + @Override + public boolean isIgnoreProcessingTime() { + MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID()); + return schedule.isIgnoreProcessingTime(); + } + + + } // MScheduler diff --git a/org.adempiere.base/src/org/compiere/model/X_AD_AlertProcessor.java b/org.adempiere.base/src/org/compiere/model/X_AD_AlertProcessor.java index a0c7b340f8..3b47dcd304 100644 --- a/org.adempiere.base/src/org/compiere/model/X_AD_AlertProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/X_AD_AlertProcessor.java @@ -31,7 +31,7 @@ public class X_AD_AlertProcessor extends PO implements I_AD_AlertProcessor, I_Pe /** * */ - private static final long serialVersionUID = 20100614L; + private static final long serialVersionUID = 20120920L; /** Standard Constructor */ public X_AD_AlertProcessor (Properties ctx, int AD_AlertProcessor_ID, String trxName) @@ -40,8 +40,6 @@ public class X_AD_AlertProcessor extends PO implements I_AD_AlertProcessor, I_Pe /** if (AD_AlertProcessor_ID == 0) { setAD_AlertProcessor_ID (0); - setFrequency (0); - setFrequencyType (null); setKeepLogDays (0); // 7 setName (null); @@ -100,6 +98,45 @@ public class X_AD_AlertProcessor extends PO implements I_AD_AlertProcessor, I_Pe return ii.intValue(); } + /** Set AD_AlertProcessor_UU. + @param AD_AlertProcessor_UU AD_AlertProcessor_UU */ + public void setAD_AlertProcessor_UU (String AD_AlertProcessor_UU) + { + set_Value (COLUMNNAME_AD_AlertProcessor_UU, AD_AlertProcessor_UU); + } + + /** Get AD_AlertProcessor_UU. + @return AD_AlertProcessor_UU */ + public String getAD_AlertProcessor_UU () + { + return (String)get_Value(COLUMNNAME_AD_AlertProcessor_UU); + } + + public org.compiere.model.I_AD_Schedule getAD_Schedule() throws RuntimeException + { + return (org.compiere.model.I_AD_Schedule)MTable.get(getCtx(), org.compiere.model.I_AD_Schedule.Table_Name) + .getPO(getAD_Schedule_ID(), get_TrxName()); } + + /** Set AD_Schedule_ID. + @param AD_Schedule_ID AD_Schedule_ID */ + public void setAD_Schedule_ID (int AD_Schedule_ID) + { + if (AD_Schedule_ID < 1) + set_Value (COLUMNNAME_AD_Schedule_ID, null); + else + set_Value (COLUMNNAME_AD_Schedule_ID, Integer.valueOf(AD_Schedule_ID)); + } + + /** Get AD_Schedule_ID. + @return AD_Schedule_ID */ + public int getAD_Schedule_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_AD_Schedule_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + /** Set Date last run. @param DateLastRun Date the process was last run. @@ -151,52 +188,6 @@ public class X_AD_AlertProcessor extends PO implements I_AD_AlertProcessor, I_Pe return (String)get_Value(COLUMNNAME_Description); } - /** Set Frequency. - @param Frequency - Frequency of events - */ - public void setFrequency (int Frequency) - { - set_Value (COLUMNNAME_Frequency, Integer.valueOf(Frequency)); - } - - /** Get Frequency. - @return Frequency of events - */ - public int getFrequency () - { - Integer ii = (Integer)get_Value(COLUMNNAME_Frequency); - if (ii == null) - return 0; - return ii.intValue(); - } - - /** FrequencyType AD_Reference_ID=221 */ - public static final int FREQUENCYTYPE_AD_Reference_ID=221; - /** Minute = M */ - public static final String FREQUENCYTYPE_Minute = "M"; - /** Hour = H */ - public static final String FREQUENCYTYPE_Hour = "H"; - /** Day = D */ - public static final String FREQUENCYTYPE_Day = "D"; - /** Set Frequency Type. - @param FrequencyType - Frequency of event - */ - public void setFrequencyType (String FrequencyType) - { - - set_Value (COLUMNNAME_FrequencyType, FrequencyType); - } - - /** Get Frequency Type. - @return Frequency of event - */ - public String getFrequencyType () - { - return (String)get_Value(COLUMNNAME_FrequencyType); - } - /** Set Days to keep Log. @param KeepLogDays Number of days to keep the log entries @@ -263,9 +254,9 @@ public class X_AD_AlertProcessor extends PO implements I_AD_AlertProcessor, I_Pe return false; } - public I_AD_User getSupervisor() throws RuntimeException + public org.compiere.model.I_AD_User getSupervisor() throws RuntimeException { - return (I_AD_User)MTable.get(getCtx(), I_AD_User.Table_Name) + return (org.compiere.model.I_AD_User)MTable.get(getCtx(), org.compiere.model.I_AD_User.Table_Name) .getPO(getSupervisor_ID(), get_TrxName()); } /** Set Supervisor. diff --git a/org.adempiere.base/src/org/compiere/model/X_AD_AlertProcessorLog.java b/org.adempiere.base/src/org/compiere/model/X_AD_AlertProcessorLog.java index 472326b5c6..78c18be91f 100644 --- a/org.adempiere.base/src/org/compiere/model/X_AD_AlertProcessorLog.java +++ b/org.adempiere.base/src/org/compiere/model/X_AD_AlertProcessorLog.java @@ -29,7 +29,7 @@ public class X_AD_AlertProcessorLog extends PO implements I_AD_AlertProcessorLog /** * */ - private static final long serialVersionUID = 20100614L; + private static final long serialVersionUID = 20120920L; /** Standard Constructor */ public X_AD_AlertProcessorLog (Properties ctx, int AD_AlertProcessorLog_ID, String trxName) @@ -71,9 +71,9 @@ public class X_AD_AlertProcessorLog extends PO implements I_AD_AlertProcessorLog return sb.toString(); } - public I_AD_AlertProcessor getAD_AlertProcessor() throws RuntimeException + public org.compiere.model.I_AD_AlertProcessor getAD_AlertProcessor() throws RuntimeException { - return (I_AD_AlertProcessor)MTable.get(getCtx(), I_AD_AlertProcessor.Table_Name) + return (org.compiere.model.I_AD_AlertProcessor)MTable.get(getCtx(), org.compiere.model.I_AD_AlertProcessor.Table_Name) .getPO(getAD_AlertProcessor_ID(), get_TrxName()); } /** Set Alert Processor. diff --git a/org.adempiere.base/src/org/compiere/model/X_AD_Schedule.java b/org.adempiere.base/src/org/compiere/model/X_AD_Schedule.java new file mode 100644 index 0000000000..dcee8009cd --- /dev/null +++ b/org.adempiere.base/src/org/compiere/model/X_AD_Schedule.java @@ -0,0 +1,319 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * + * This program is free software, you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY, without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program, if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +/** Generated Model - DO NOT CHANGE */ +package org.compiere.model; + +import java.sql.ResultSet; +import java.util.Properties; +import org.compiere.util.KeyNamePair; + +/** Generated Model for AD_Schedule + * @author Adempiere (generated) + * @version Release 3.6.0LTS - $Id$ */ +public class X_AD_Schedule extends PO implements I_AD_Schedule, I_Persistent +{ + + /** + * + */ + private static final long serialVersionUID = 20120924L; + + /** Standard Constructor */ + public X_AD_Schedule (Properties ctx, int AD_Schedule_ID, String trxName) + { + super (ctx, AD_Schedule_ID, trxName); + /** if (AD_Schedule_ID == 0) + { + } */ + } + + /** Load Constructor */ + public X_AD_Schedule (Properties ctx, ResultSet rs, String trxName) + { + super (ctx, rs, trxName); + } + + /** AccessLevel + * @return 4 - System + */ + protected int get_AccessLevel() + { + return accessLevel.intValue(); + } + + /** Load Meta Data */ + protected POInfo initPO (Properties ctx) + { + POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName()); + return poi; + } + + public String toString() + { + StringBuffer sb = new StringBuffer ("X_AD_Schedule[") + .append(get_ID()).append("]"); + return sb.toString(); + } + + /** Set AD_Schedule_ID. + @param AD_Schedule_ID AD_Schedule_ID */ + public void setAD_Schedule_ID (int AD_Schedule_ID) + { + if (AD_Schedule_ID < 1) + set_ValueNoCheck (COLUMNNAME_AD_Schedule_ID, null); + else + set_ValueNoCheck (COLUMNNAME_AD_Schedule_ID, Integer.valueOf(AD_Schedule_ID)); + } + + /** Get AD_Schedule_ID. + @return AD_Schedule_ID */ + public int getAD_Schedule_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_AD_Schedule_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Get Record ID/ColumnName + @return ID/ColumnName pair + */ + public KeyNamePair getKeyNamePair() + { + return new KeyNamePair(get_ID(), String.valueOf(getAD_Schedule_ID())); + } + + /** Set Cron Scheduling Pattern. + @param CronPattern + Cron pattern to define when the process should be invoked. + */ + public void setCronPattern (String CronPattern) + { + set_Value (COLUMNNAME_CronPattern, CronPattern); + } + + /** Get Cron Scheduling Pattern. + @return Cron pattern to define when the process should be invoked. + */ + public String getCronPattern () + { + return (String)get_Value(COLUMNNAME_CronPattern); + } + + /** Set Description. + @param Description + Optional short description of the record + */ + public void setDescription (String Description) + { + set_Value (COLUMNNAME_Description, Description); + } + + /** Get Description. + @return Optional short description of the record + */ + public String getDescription () + { + return (String)get_Value(COLUMNNAME_Description); + } + + /** Set Frequency. + @param Frequency + Frequency of events + */ + public void setFrequency (int Frequency) + { + set_Value (COLUMNNAME_Frequency, Integer.valueOf(Frequency)); + } + + /** Get Frequency. + @return Frequency of events + */ + public int getFrequency () + { + Integer ii = (Integer)get_Value(COLUMNNAME_Frequency); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** FrequencyType AD_Reference_ID=221 */ + public static final int FREQUENCYTYPE_AD_Reference_ID=221; + /** Minute = M */ + public static final String FREQUENCYTYPE_Minute = "M"; + /** Hour = H */ + public static final String FREQUENCYTYPE_Hour = "H"; + /** Day = D */ + public static final String FREQUENCYTYPE_Day = "D"; + /** Set Frequency Type. + @param FrequencyType + Frequency of event + */ + public void setFrequencyType (String FrequencyType) + { + + set_Value (COLUMNNAME_FrequencyType, FrequencyType); + } + + /** Get Frequency Type. + @return Frequency of event + */ + public String getFrequencyType () + { + return (String)get_Value(COLUMNNAME_FrequencyType); + } + + /** Set Ignore Processing Time. + @param IsIgnoreProcessingTime + Do not include processing time for the DateNextRun calculation + */ + public void setIsIgnoreProcessingTime (boolean IsIgnoreProcessingTime) + { + set_Value (COLUMNNAME_IsIgnoreProcessingTime, Boolean.valueOf(IsIgnoreProcessingTime)); + } + + /** Get Ignore Processing Time. + @return Do not include processing time for the DateNextRun calculation + */ + public boolean isIgnoreProcessingTime () + { + Object oo = get_Value(COLUMNNAME_IsIgnoreProcessingTime); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Day of the Month. + @param MonthDay + Day of the month 1 to 28/29/30/31 + */ + public void setMonthDay (int MonthDay) + { + set_Value (COLUMNNAME_MonthDay, Integer.valueOf(MonthDay)); + } + + /** Get Day of the Month. + @return Day of the month 1 to 28/29/30/31 + */ + public int getMonthDay () + { + Integer ii = (Integer)get_Value(COLUMNNAME_MonthDay); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Name. + @param Name + Alphanumeric identifier of the entity + */ + public void setName (String Name) + { + set_ValueNoCheck (COLUMNNAME_Name, Name); + } + + /** Get Name. + @return Alphanumeric identifier of the entity + */ + public String getName () + { + return (String)get_Value(COLUMNNAME_Name); + } + + /** Set RunOnlyOnIP. + @param RunOnlyOnIP + Defines the IP address to transfer data to + */ + public void setRunOnlyOnIP (String RunOnlyOnIP) + { + set_Value (COLUMNNAME_RunOnlyOnIP, RunOnlyOnIP); + } + + /** Get RunOnlyOnIP. + @return Defines the IP address to transfer data to + */ + public String getRunOnlyOnIP () + { + return (String)get_Value(COLUMNNAME_RunOnlyOnIP); + } + + /** ScheduleType AD_Reference_ID=318 */ + public static final int SCHEDULETYPE_AD_Reference_ID=318; + /** Frequency = F */ + public static final String SCHEDULETYPE_Frequency = "F"; + /** Week Day = W */ + public static final String SCHEDULETYPE_WeekDay = "W"; + /** Month Day = M */ + public static final String SCHEDULETYPE_MonthDay = "M"; + /** Cron Scheduling Pattern = C */ + public static final String SCHEDULETYPE_CronSchedulingPattern = "C"; + /** Set Schedule Type. + @param ScheduleType + Type of schedule + */ + public void setScheduleType (String ScheduleType) + { + + set_Value (COLUMNNAME_ScheduleType, ScheduleType); + } + + /** Get Schedule Type. + @return Type of schedule + */ + public String getScheduleType () + { + return (String)get_Value(COLUMNNAME_ScheduleType); + } + + /** WeekDay AD_Reference_ID=167 */ + public static final int WEEKDAY_AD_Reference_ID=167; + /** Sunday = 7 */ + public static final String WEEKDAY_Sunday = "7"; + /** Monday = 1 */ + public static final String WEEKDAY_Monday = "1"; + /** Tuesday = 2 */ + public static final String WEEKDAY_Tuesday = "2"; + /** Wednesday = 3 */ + public static final String WEEKDAY_Wednesday = "3"; + /** Thursday = 4 */ + public static final String WEEKDAY_Thursday = "4"; + /** Friday = 5 */ + public static final String WEEKDAY_Friday = "5"; + /** Saturday = 6 */ + public static final String WEEKDAY_Saturday = "6"; + /** Set Day of the Week. + @param WeekDay + Day of the Week + */ + public void setWeekDay (String WeekDay) + { + + set_Value (COLUMNNAME_WeekDay, WeekDay); + } + + /** Get Day of the Week. + @return Day of the Week + */ + public String getWeekDay () + { + return (String)get_Value(COLUMNNAME_WeekDay); + } +} \ No newline at end of file diff --git a/org.adempiere.base/src/org/compiere/model/X_AD_Scheduler.java b/org.adempiere.base/src/org/compiere/model/X_AD_Scheduler.java index a79bc64467..ecd51048a1 100644 --- a/org.adempiere.base/src/org/compiere/model/X_AD_Scheduler.java +++ b/org.adempiere.base/src/org/compiere/model/X_AD_Scheduler.java @@ -31,7 +31,7 @@ public class X_AD_Scheduler extends PO implements I_AD_Scheduler, I_Persistent /** * */ - private static final long serialVersionUID = 20110325L; + private static final long serialVersionUID = 20120924L; /** Standard Constructor */ public X_AD_Scheduler (Properties ctx, int AD_Scheduler_ID, String trxName) @@ -44,8 +44,6 @@ public class X_AD_Scheduler extends PO implements I_AD_Scheduler, I_Persistent setKeepLogDays (0); // 7 setName (null); - setScheduleType (null); -// F setSupervisor_ID (0); } */ } @@ -106,6 +104,31 @@ public class X_AD_Scheduler extends PO implements I_AD_Scheduler, I_Persistent return ii.intValue(); } + public org.compiere.model.I_AD_Schedule getAD_Schedule() throws RuntimeException + { + return (org.compiere.model.I_AD_Schedule)MTable.get(getCtx(), org.compiere.model.I_AD_Schedule.Table_Name) + .getPO(getAD_Schedule_ID(), get_TrxName()); } + + /** Set AD_Schedule_ID. + @param AD_Schedule_ID AD_Schedule_ID */ + public void setAD_Schedule_ID (int AD_Schedule_ID) + { + if (AD_Schedule_ID < 1) + set_Value (COLUMNNAME_AD_Schedule_ID, null); + else + set_Value (COLUMNNAME_AD_Schedule_ID, Integer.valueOf(AD_Schedule_ID)); + } + + /** Get AD_Schedule_ID. + @return AD_Schedule_ID */ + public int getAD_Schedule_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_AD_Schedule_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + /** Set Scheduler. @param AD_Scheduler_ID Schedule Processes @@ -129,6 +152,20 @@ public class X_AD_Scheduler extends PO implements I_AD_Scheduler, I_Persistent return ii.intValue(); } + /** Set AD_Scheduler_UU. + @param AD_Scheduler_UU AD_Scheduler_UU */ + public void setAD_Scheduler_UU (String AD_Scheduler_UU) + { + set_Value (COLUMNNAME_AD_Scheduler_UU, AD_Scheduler_UU); + } + + /** Get AD_Scheduler_UU. + @return AD_Scheduler_UU */ + public String getAD_Scheduler_UU () + { + return (String)get_Value(COLUMNNAME_AD_Scheduler_UU); + } + public org.compiere.model.I_AD_Table getAD_Table() throws RuntimeException { return (org.compiere.model.I_AD_Table)MTable.get(getCtx(), org.compiere.model.I_AD_Table.Table_Name) @@ -157,23 +194,6 @@ public class X_AD_Scheduler extends PO implements I_AD_Scheduler, I_Persistent return ii.intValue(); } - /** Set Cron Scheduling Pattern. - @param CronPattern - Cron pattern to define when the process should be invoked. - */ - public void setCronPattern (String CronPattern) - { - set_Value (COLUMNNAME_CronPattern, CronPattern); - } - - /** Get Cron Scheduling Pattern. - @return Cron pattern to define when the process should be invoked. - */ - public String getCronPattern () - { - return (String)get_Value(COLUMNNAME_CronPattern); - } - /** Set Date last run. @param DateLastRun Date the process was last run. @@ -225,76 +245,6 @@ public class X_AD_Scheduler extends PO implements I_AD_Scheduler, I_Persistent return (String)get_Value(COLUMNNAME_Description); } - /** Set Frequency. - @param Frequency - Frequency of events - */ - public void setFrequency (int Frequency) - { - set_Value (COLUMNNAME_Frequency, Integer.valueOf(Frequency)); - } - - /** Get Frequency. - @return Frequency of events - */ - public int getFrequency () - { - Integer ii = (Integer)get_Value(COLUMNNAME_Frequency); - if (ii == null) - return 0; - return ii.intValue(); - } - - /** FrequencyType AD_Reference_ID=221 */ - public static final int FREQUENCYTYPE_AD_Reference_ID=221; - /** Minute = M */ - public static final String FREQUENCYTYPE_Minute = "M"; - /** Hour = H */ - public static final String FREQUENCYTYPE_Hour = "H"; - /** Day = D */ - public static final String FREQUENCYTYPE_Day = "D"; - /** Set Frequency Type. - @param FrequencyType - Frequency of event - */ - public void setFrequencyType (String FrequencyType) - { - - set_Value (COLUMNNAME_FrequencyType, FrequencyType); - } - - /** Get Frequency Type. - @return Frequency of event - */ - public String getFrequencyType () - { - return (String)get_Value(COLUMNNAME_FrequencyType); - } - - /** Set Ignore Processing Time. - @param IsIgnoreProcessingTime - Do not include processing time for the DateNextRun calculation - */ - public void setIsIgnoreProcessingTime (boolean IsIgnoreProcessingTime) - { - set_Value (COLUMNNAME_IsIgnoreProcessingTime, Boolean.valueOf(IsIgnoreProcessingTime)); - } - - /** Get Ignore Processing Time. - @return Do not include processing time for the DateNextRun calculation - */ - public boolean isIgnoreProcessingTime () - { - Object oo = get_Value(COLUMNNAME_IsIgnoreProcessingTime); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - /** Set Days to keep Log. @param KeepLogDays Number of days to keep the log entries @@ -315,26 +265,6 @@ public class X_AD_Scheduler extends PO implements I_AD_Scheduler, I_Persistent return ii.intValue(); } - /** Set Day of the Month. - @param MonthDay - Day of the month 1 to 28/29/30/31 - */ - public void setMonthDay (int MonthDay) - { - set_Value (COLUMNNAME_MonthDay, Integer.valueOf(MonthDay)); - } - - /** Get Day of the Month. - @return Day of the month 1 to 28/29/30/31 - */ - public int getMonthDay () - { - Integer ii = (Integer)get_Value(COLUMNNAME_MonthDay); - if (ii == null) - return 0; - return ii.intValue(); - } - /** Set Name. @param Name Alphanumeric identifier of the entity @@ -404,34 +334,6 @@ public class X_AD_Scheduler extends PO implements I_AD_Scheduler, I_Persistent return ii.intValue(); } - /** ScheduleType AD_Reference_ID=318 */ - public static final int SCHEDULETYPE_AD_Reference_ID=318; - /** Frequency = F */ - public static final String SCHEDULETYPE_Frequency = "F"; - /** Week Day = W */ - public static final String SCHEDULETYPE_WeekDay = "W"; - /** Month Day = M */ - public static final String SCHEDULETYPE_MonthDay = "M"; - /** Cron Scheduling Pattern = C */ - public static final String SCHEDULETYPE_CronSchedulingPattern = "C"; - /** Set Schedule Type. - @param ScheduleType - Type of schedule - */ - public void setScheduleType (String ScheduleType) - { - - set_Value (COLUMNNAME_ScheduleType, ScheduleType); - } - - /** Get Schedule Type. - @return Type of schedule - */ - public String getScheduleType () - { - return (String)get_Value(COLUMNNAME_ScheduleType); - } - public org.compiere.model.I_AD_User getSupervisor() throws RuntimeException { return (org.compiere.model.I_AD_User)MTable.get(getCtx(), org.compiere.model.I_AD_User.Table_Name) @@ -459,38 +361,4 @@ public class X_AD_Scheduler extends PO implements I_AD_Scheduler, I_Persistent return 0; return ii.intValue(); } - - /** WeekDay AD_Reference_ID=167 */ - public static final int WEEKDAY_AD_Reference_ID=167; - /** Sunday = 7 */ - public static final String WEEKDAY_Sunday = "7"; - /** Monday = 1 */ - public static final String WEEKDAY_Monday = "1"; - /** Tuesday = 2 */ - public static final String WEEKDAY_Tuesday = "2"; - /** Wednesday = 3 */ - public static final String WEEKDAY_Wednesday = "3"; - /** Thursday = 4 */ - public static final String WEEKDAY_Thursday = "4"; - /** Friday = 5 */ - public static final String WEEKDAY_Friday = "5"; - /** Saturday = 6 */ - public static final String WEEKDAY_Saturday = "6"; - /** Set Day of the Week. - @param WeekDay - Day of the Week - */ - public void setWeekDay (String WeekDay) - { - - set_Value (COLUMNNAME_WeekDay, WeekDay); - } - - /** Get Day of the Week. - @return Day of the Week - */ - public String getWeekDay () - { - return (String)get_Value(COLUMNNAME_WeekDay); - } } \ No newline at end of file diff --git a/org.adempiere.base/src/org/compiere/model/X_AD_WorkflowProcessor.java b/org.adempiere.base/src/org/compiere/model/X_AD_WorkflowProcessor.java index 66cb845262..0c84002a3e 100644 --- a/org.adempiere.base/src/org/compiere/model/X_AD_WorkflowProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/X_AD_WorkflowProcessor.java @@ -31,7 +31,7 @@ public class X_AD_WorkflowProcessor extends PO implements I_AD_WorkflowProcessor /** * */ - private static final long serialVersionUID = 20100614L; + private static final long serialVersionUID = 20120920L; /** Standard Constructor */ public X_AD_WorkflowProcessor (Properties ctx, int AD_WorkflowProcessor_ID, String trxName) @@ -40,8 +40,6 @@ public class X_AD_WorkflowProcessor extends PO implements I_AD_WorkflowProcessor /** if (AD_WorkflowProcessor_ID == 0) { setAD_WorkflowProcessor_ID (0); - setFrequency (0); - setFrequencyType (null); setKeepLogDays (0); // 7 setName (null); @@ -56,7 +54,7 @@ public class X_AD_WorkflowProcessor extends PO implements I_AD_WorkflowProcessor } /** AccessLevel - * @return 4 - System + * @return 6 - System - Client */ protected int get_AccessLevel() { @@ -77,6 +75,31 @@ public class X_AD_WorkflowProcessor extends PO implements I_AD_WorkflowProcessor return sb.toString(); } + public org.compiere.model.I_AD_Schedule getAD_Schedule() throws RuntimeException + { + return (org.compiere.model.I_AD_Schedule)MTable.get(getCtx(), org.compiere.model.I_AD_Schedule.Table_Name) + .getPO(getAD_Schedule_ID(), get_TrxName()); } + + /** Set AD_Schedule_ID. + @param AD_Schedule_ID AD_Schedule_ID */ + public void setAD_Schedule_ID (int AD_Schedule_ID) + { + if (AD_Schedule_ID < 1) + set_Value (COLUMNNAME_AD_Schedule_ID, null); + else + set_Value (COLUMNNAME_AD_Schedule_ID, Integer.valueOf(AD_Schedule_ID)); + } + + /** Get AD_Schedule_ID. + @return AD_Schedule_ID */ + public int getAD_Schedule_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_AD_Schedule_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + /** Set Workflow Processor. @param AD_WorkflowProcessor_ID Workflow Processor Server @@ -100,6 +123,20 @@ public class X_AD_WorkflowProcessor extends PO implements I_AD_WorkflowProcessor return ii.intValue(); } + /** Set AD_WorkflowProcessor_UU. + @param AD_WorkflowProcessor_UU AD_WorkflowProcessor_UU */ + public void setAD_WorkflowProcessor_UU (String AD_WorkflowProcessor_UU) + { + set_Value (COLUMNNAME_AD_WorkflowProcessor_UU, AD_WorkflowProcessor_UU); + } + + /** Get AD_WorkflowProcessor_UU. + @return AD_WorkflowProcessor_UU */ + public String getAD_WorkflowProcessor_UU () + { + return (String)get_Value(COLUMNNAME_AD_WorkflowProcessor_UU); + } + /** Set Alert over Priority. @param AlertOverPriority Send alert email when over priority @@ -171,52 +208,6 @@ public class X_AD_WorkflowProcessor extends PO implements I_AD_WorkflowProcessor return (String)get_Value(COLUMNNAME_Description); } - /** Set Frequency. - @param Frequency - Frequency of events - */ - public void setFrequency (int Frequency) - { - set_Value (COLUMNNAME_Frequency, Integer.valueOf(Frequency)); - } - - /** Get Frequency. - @return Frequency of events - */ - public int getFrequency () - { - Integer ii = (Integer)get_Value(COLUMNNAME_Frequency); - if (ii == null) - return 0; - return ii.intValue(); - } - - /** FrequencyType AD_Reference_ID=221 */ - public static final int FREQUENCYTYPE_AD_Reference_ID=221; - /** Minute = M */ - public static final String FREQUENCYTYPE_Minute = "M"; - /** Hour = H */ - public static final String FREQUENCYTYPE_Hour = "H"; - /** Day = D */ - public static final String FREQUENCYTYPE_Day = "D"; - /** Set Frequency Type. - @param FrequencyType - Frequency of event - */ - public void setFrequencyType (String FrequencyType) - { - - set_Value (COLUMNNAME_FrequencyType, FrequencyType); - } - - /** Get Frequency Type. - @return Frequency of event - */ - public String getFrequencyType () - { - return (String)get_Value(COLUMNNAME_FrequencyType); - } - /** Set Inactivity Alert Days. @param InactivityAlertDays Send Alert when there is no activity after days (0= no alert) @@ -323,9 +314,9 @@ public class X_AD_WorkflowProcessor extends PO implements I_AD_WorkflowProcessor return ii.intValue(); } - public I_AD_User getSupervisor() throws RuntimeException + public org.compiere.model.I_AD_User getSupervisor() throws RuntimeException { - return (I_AD_User)MTable.get(getCtx(), I_AD_User.Table_Name) + return (org.compiere.model.I_AD_User)MTable.get(getCtx(), org.compiere.model.I_AD_User.Table_Name) .getPO(getSupervisor_ID(), get_TrxName()); } /** Set Supervisor. diff --git a/org.adempiere.base/src/org/compiere/model/X_C_AcctProcessor.java b/org.adempiere.base/src/org/compiere/model/X_C_AcctProcessor.java index b813984ca9..6d7565dce3 100644 --- a/org.adempiere.base/src/org/compiere/model/X_C_AcctProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/X_C_AcctProcessor.java @@ -31,7 +31,7 @@ public class X_C_AcctProcessor extends PO implements I_C_AcctProcessor, I_Persis /** * */ - private static final long serialVersionUID = 20100614L; + private static final long serialVersionUID = 20120920L; /** Standard Constructor */ public X_C_AcctProcessor (Properties ctx, int C_AcctProcessor_ID, String trxName) @@ -40,8 +40,6 @@ public class X_C_AcctProcessor extends PO implements I_C_AcctProcessor, I_Persis /** if (C_AcctProcessor_ID == 0) { setC_AcctProcessor_ID (0); - setFrequency (0); - setFrequencyType (null); setKeepLogDays (0); // 7 setName (null); @@ -77,9 +75,34 @@ public class X_C_AcctProcessor extends PO implements I_C_AcctProcessor, I_Persis return sb.toString(); } - public I_AD_Table getAD_Table() throws RuntimeException + public org.compiere.model.I_AD_Schedule getAD_Schedule() throws RuntimeException { - return (I_AD_Table)MTable.get(getCtx(), I_AD_Table.Table_Name) + return (org.compiere.model.I_AD_Schedule)MTable.get(getCtx(), org.compiere.model.I_AD_Schedule.Table_Name) + .getPO(getAD_Schedule_ID(), get_TrxName()); } + + /** Set AD_Schedule_ID. + @param AD_Schedule_ID AD_Schedule_ID */ + public void setAD_Schedule_ID (int AD_Schedule_ID) + { + if (AD_Schedule_ID < 1) + set_Value (COLUMNNAME_AD_Schedule_ID, null); + else + set_Value (COLUMNNAME_AD_Schedule_ID, Integer.valueOf(AD_Schedule_ID)); + } + + /** Get AD_Schedule_ID. + @return AD_Schedule_ID */ + public int getAD_Schedule_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_AD_Schedule_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public org.compiere.model.I_AD_Table getAD_Table() throws RuntimeException + { + return (org.compiere.model.I_AD_Table)MTable.get(getCtx(), org.compiere.model.I_AD_Table.Table_Name) .getPO(getAD_Table_ID(), get_TrxName()); } /** Set Table. @@ -128,9 +151,23 @@ public class X_C_AcctProcessor extends PO implements I_C_AcctProcessor, I_Persis return ii.intValue(); } - public I_C_AcctSchema getC_AcctSchema() throws RuntimeException + /** Set C_AcctProcessor_UU. + @param C_AcctProcessor_UU C_AcctProcessor_UU */ + public void setC_AcctProcessor_UU (String C_AcctProcessor_UU) + { + set_Value (COLUMNNAME_C_AcctProcessor_UU, C_AcctProcessor_UU); + } + + /** Get C_AcctProcessor_UU. + @return C_AcctProcessor_UU */ + public String getC_AcctProcessor_UU () + { + return (String)get_Value(COLUMNNAME_C_AcctProcessor_UU); + } + + public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException { - return (I_C_AcctSchema)MTable.get(getCtx(), I_C_AcctSchema.Table_Name) + return (org.compiere.model.I_C_AcctSchema)MTable.get(getCtx(), org.compiere.model.I_C_AcctSchema.Table_Name) .getPO(getC_AcctSchema_ID(), get_TrxName()); } /** Set Accounting Schema. @@ -207,52 +244,6 @@ public class X_C_AcctProcessor extends PO implements I_C_AcctProcessor, I_Persis return (String)get_Value(COLUMNNAME_Description); } - /** Set Frequency. - @param Frequency - Frequency of events - */ - public void setFrequency (int Frequency) - { - set_Value (COLUMNNAME_Frequency, Integer.valueOf(Frequency)); - } - - /** Get Frequency. - @return Frequency of events - */ - public int getFrequency () - { - Integer ii = (Integer)get_Value(COLUMNNAME_Frequency); - if (ii == null) - return 0; - return ii.intValue(); - } - - /** FrequencyType AD_Reference_ID=221 */ - public static final int FREQUENCYTYPE_AD_Reference_ID=221; - /** Minute = M */ - public static final String FREQUENCYTYPE_Minute = "M"; - /** Hour = H */ - public static final String FREQUENCYTYPE_Hour = "H"; - /** Day = D */ - public static final String FREQUENCYTYPE_Day = "D"; - /** Set Frequency Type. - @param FrequencyType - Frequency of event - */ - public void setFrequencyType (String FrequencyType) - { - - set_Value (COLUMNNAME_FrequencyType, FrequencyType); - } - - /** Get Frequency Type. - @return Frequency of event - */ - public String getFrequencyType () - { - return (String)get_Value(COLUMNNAME_FrequencyType); - } - /** Set Days to keep Log. @param KeepLogDays Number of days to keep the log entries @@ -319,9 +310,9 @@ public class X_C_AcctProcessor extends PO implements I_C_AcctProcessor, I_Persis return false; } - public I_AD_User getSupervisor() throws RuntimeException + public org.compiere.model.I_AD_User getSupervisor() throws RuntimeException { - return (I_AD_User)MTable.get(getCtx(), I_AD_User.Table_Name) + return (org.compiere.model.I_AD_User)MTable.get(getCtx(), org.compiere.model.I_AD_User.Table_Name) .getPO(getSupervisor_ID(), get_TrxName()); } /** Set Supervisor. diff --git a/org.adempiere.base/src/org/compiere/model/X_C_AcctProcessorLog.java b/org.adempiere.base/src/org/compiere/model/X_C_AcctProcessorLog.java index 032b8fcdc8..596321a32a 100644 --- a/org.adempiere.base/src/org/compiere/model/X_C_AcctProcessorLog.java +++ b/org.adempiere.base/src/org/compiere/model/X_C_AcctProcessorLog.java @@ -29,7 +29,7 @@ public class X_C_AcctProcessorLog extends PO implements I_C_AcctProcessorLog, I_ /** * */ - private static final long serialVersionUID = 20100614L; + private static final long serialVersionUID = 20120920L; /** Standard Constructor */ public X_C_AcctProcessorLog (Properties ctx, int C_AcctProcessorLog_ID, String trxName) @@ -88,9 +88,9 @@ public class X_C_AcctProcessorLog extends PO implements I_C_AcctProcessorLog, I_ return (byte[])get_Value(COLUMNNAME_BinaryData); } - public I_C_AcctProcessor getC_AcctProcessor() throws RuntimeException + public org.compiere.model.I_C_AcctProcessor getC_AcctProcessor() throws RuntimeException { - return (I_C_AcctProcessor)MTable.get(getCtx(), I_C_AcctProcessor.Table_Name) + return (org.compiere.model.I_C_AcctProcessor)MTable.get(getCtx(), org.compiere.model.I_C_AcctProcessor.Table_Name) .getPO(getC_AcctProcessor_ID(), get_TrxName()); } /** Set Accounting Processor. diff --git a/org.adempiere.base/src/org/compiere/model/X_R_RequestProcessor.java b/org.adempiere.base/src/org/compiere/model/X_R_RequestProcessor.java index 2533309843..62e13ab8d8 100644 --- a/org.adempiere.base/src/org/compiere/model/X_R_RequestProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/X_R_RequestProcessor.java @@ -31,7 +31,7 @@ public class X_R_RequestProcessor extends PO implements I_R_RequestProcessor, I_ /** * */ - private static final long serialVersionUID = 20100614L; + private static final long serialVersionUID = 20120920L; /** Standard Constructor */ public X_R_RequestProcessor (Properties ctx, int R_RequestProcessor_ID, String trxName) @@ -39,9 +39,6 @@ public class X_R_RequestProcessor extends PO implements I_R_RequestProcessor, I_ super (ctx, R_RequestProcessor_ID, trxName); /** if (R_RequestProcessor_ID == 0) { - setFrequency (0); -// 1 - setFrequencyType (null); setInactivityAlertDays (0); // 0 setKeepLogDays (0); @@ -86,6 +83,31 @@ public class X_R_RequestProcessor extends PO implements I_R_RequestProcessor, I_ return sb.toString(); } + public org.compiere.model.I_AD_Schedule getAD_Schedule() throws RuntimeException + { + return (org.compiere.model.I_AD_Schedule)MTable.get(getCtx(), org.compiere.model.I_AD_Schedule.Table_Name) + .getPO(getAD_Schedule_ID(), get_TrxName()); } + + /** Set AD_Schedule_ID. + @param AD_Schedule_ID AD_Schedule_ID */ + public void setAD_Schedule_ID (int AD_Schedule_ID) + { + if (AD_Schedule_ID < 1) + set_Value (COLUMNNAME_AD_Schedule_ID, null); + else + set_Value (COLUMNNAME_AD_Schedule_ID, Integer.valueOf(AD_Schedule_ID)); + } + + /** Get AD_Schedule_ID. + @return AD_Schedule_ID */ + public int getAD_Schedule_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_AD_Schedule_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + /** Set Date last run. @param DateLastRun Date the process was last run. @@ -137,52 +159,6 @@ public class X_R_RequestProcessor extends PO implements I_R_RequestProcessor, I_ return (String)get_Value(COLUMNNAME_Description); } - /** Set Frequency. - @param Frequency - Frequency of events - */ - public void setFrequency (int Frequency) - { - set_Value (COLUMNNAME_Frequency, Integer.valueOf(Frequency)); - } - - /** Get Frequency. - @return Frequency of events - */ - public int getFrequency () - { - Integer ii = (Integer)get_Value(COLUMNNAME_Frequency); - if (ii == null) - return 0; - return ii.intValue(); - } - - /** FrequencyType AD_Reference_ID=221 */ - public static final int FREQUENCYTYPE_AD_Reference_ID=221; - /** Minute = M */ - public static final String FREQUENCYTYPE_Minute = "M"; - /** Hour = H */ - public static final String FREQUENCYTYPE_Hour = "H"; - /** Day = D */ - public static final String FREQUENCYTYPE_Day = "D"; - /** Set Frequency Type. - @param FrequencyType - Frequency of event - */ - public void setFrequencyType (String FrequencyType) - { - - set_Value (COLUMNNAME_FrequencyType, FrequencyType); - } - - /** Get Frequency Type. - @return Frequency of event - */ - public String getFrequencyType () - { - return (String)get_Value(COLUMNNAME_FrequencyType); - } - /** Set Inactivity Alert Days. @param InactivityAlertDays Send Alert when there is no activity after days (0= no alert) @@ -352,9 +328,23 @@ public class X_R_RequestProcessor extends PO implements I_R_RequestProcessor, I_ return ii.intValue(); } - public I_R_RequestType getR_RequestType() throws RuntimeException + /** Set R_RequestProcessor_UU. + @param R_RequestProcessor_UU R_RequestProcessor_UU */ + public void setR_RequestProcessor_UU (String R_RequestProcessor_UU) + { + set_Value (COLUMNNAME_R_RequestProcessor_UU, R_RequestProcessor_UU); + } + + /** Get R_RequestProcessor_UU. + @return R_RequestProcessor_UU */ + public String getR_RequestProcessor_UU () + { + return (String)get_Value(COLUMNNAME_R_RequestProcessor_UU); + } + + public org.compiere.model.I_R_RequestType getR_RequestType() throws RuntimeException { - return (I_R_RequestType)MTable.get(getCtx(), I_R_RequestType.Table_Name) + return (org.compiere.model.I_R_RequestType)MTable.get(getCtx(), org.compiere.model.I_R_RequestType.Table_Name) .getPO(getR_RequestType_ID(), get_TrxName()); } /** Set Request Type. @@ -380,9 +370,9 @@ public class X_R_RequestProcessor extends PO implements I_R_RequestProcessor, I_ return ii.intValue(); } - public I_AD_User getSupervisor() throws RuntimeException + public org.compiere.model.I_AD_User getSupervisor() throws RuntimeException { - return (I_AD_User)MTable.get(getCtx(), I_AD_User.Table_Name) + return (org.compiere.model.I_AD_User)MTable.get(getCtx(), org.compiere.model.I_AD_User.Table_Name) .getPO(getSupervisor_ID(), get_TrxName()); } /** Set Supervisor. diff --git a/org.adempiere.base/src/org/compiere/model/X_R_RequestProcessorLog.java b/org.adempiere.base/src/org/compiere/model/X_R_RequestProcessorLog.java index 3df35f146e..acb5b929cd 100644 --- a/org.adempiere.base/src/org/compiere/model/X_R_RequestProcessorLog.java +++ b/org.adempiere.base/src/org/compiere/model/X_R_RequestProcessorLog.java @@ -29,7 +29,7 @@ public class X_R_RequestProcessorLog extends PO implements I_R_RequestProcessorL /** * */ - private static final long serialVersionUID = 20100614L; + private static final long serialVersionUID = 20120920L; /** Standard Constructor */ public X_R_RequestProcessorLog (Properties ctx, int R_RequestProcessorLog_ID, String trxName) @@ -146,9 +146,9 @@ public class X_R_RequestProcessorLog extends PO implements I_R_RequestProcessorL return (String)get_Value(COLUMNNAME_Reference); } - public I_R_RequestProcessor getR_RequestProcessor() throws RuntimeException + public org.compiere.model.I_R_RequestProcessor getR_RequestProcessor() throws RuntimeException { - return (I_R_RequestProcessor)MTable.get(getCtx(), I_R_RequestProcessor.Table_Name) + return (org.compiere.model.I_R_RequestProcessor)MTable.get(getCtx(), org.compiere.model.I_R_RequestProcessor.Table_Name) .getPO(getR_RequestProcessor_ID(), get_TrxName()); } /** Set Request Processor. diff --git a/org.adempiere.base/src/org/compiere/model/X_R_RequestProcessor_Route.java b/org.adempiere.base/src/org/compiere/model/X_R_RequestProcessor_Route.java index ee6cb41e50..6c87051aa0 100644 --- a/org.adempiere.base/src/org/compiere/model/X_R_RequestProcessor_Route.java +++ b/org.adempiere.base/src/org/compiere/model/X_R_RequestProcessor_Route.java @@ -30,7 +30,7 @@ public class X_R_RequestProcessor_Route extends PO implements I_R_RequestProcess /** * */ - private static final long serialVersionUID = 20100614L; + private static final long serialVersionUID = 20120920L; /** Standard Constructor */ public X_R_RequestProcessor_Route (Properties ctx, int R_RequestProcessor_Route_ID, String trxName) @@ -73,9 +73,9 @@ public class X_R_RequestProcessor_Route extends PO implements I_R_RequestProcess return sb.toString(); } - public I_AD_User getAD_User() throws RuntimeException + public org.compiere.model.I_AD_User getAD_User() throws RuntimeException { - return (I_AD_User)MTable.get(getCtx(), I_AD_User.Table_Name) + return (org.compiere.model.I_AD_User)MTable.get(getCtx(), org.compiere.model.I_AD_User.Table_Name) .getPO(getAD_User_ID(), get_TrxName()); } /** Set User/Contact. @@ -118,9 +118,9 @@ public class X_R_RequestProcessor_Route extends PO implements I_R_RequestProcess return (String)get_Value(COLUMNNAME_Keyword); } - public I_R_RequestProcessor getR_RequestProcessor() throws RuntimeException + public org.compiere.model.I_R_RequestProcessor getR_RequestProcessor() throws RuntimeException { - return (I_R_RequestProcessor)MTable.get(getCtx(), I_R_RequestProcessor.Table_Name) + return (org.compiere.model.I_R_RequestProcessor)MTable.get(getCtx(), org.compiere.model.I_R_RequestProcessor.Table_Name) .getPO(getR_RequestProcessor_ID(), get_TrxName()); } /** Set Request Processor. @@ -169,9 +169,9 @@ public class X_R_RequestProcessor_Route extends PO implements I_R_RequestProcess return ii.intValue(); } - public I_R_RequestType getR_RequestType() throws RuntimeException + public org.compiere.model.I_R_RequestType getR_RequestType() throws RuntimeException { - return (I_R_RequestType)MTable.get(getCtx(), I_R_RequestType.Table_Name) + return (org.compiere.model.I_R_RequestType)MTable.get(getCtx(), org.compiere.model.I_R_RequestType.Table_Name) .getPO(getR_RequestType_ID(), get_TrxName()); } /** Set Request Type. diff --git a/org.adempiere.base/src/org/compiere/wf/MWorkflowProcessor.java b/org.adempiere.base/src/org/compiere/wf/MWorkflowProcessor.java index a16b892df4..8f57c13cda 100644 --- a/org.adempiere.base/src/org/compiere/wf/MWorkflowProcessor.java +++ b/org.adempiere.base/src/org/compiere/wf/MWorkflowProcessor.java @@ -22,7 +22,9 @@ import java.util.List; import java.util.Properties; import org.compiere.model.AdempiereProcessor; +import org.compiere.model.AdempiereProcessor2; import org.compiere.model.AdempiereProcessorLog; +import org.compiere.model.MSchedule; import org.compiere.model.Query; import org.compiere.model.X_AD_WorkflowProcessor; import org.compiere.util.DB; @@ -35,7 +37,7 @@ import org.compiere.util.DB; * @version $Id: MWorkflowProcessor.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $ */ public class MWorkflowProcessor extends X_AD_WorkflowProcessor - implements AdempiereProcessor + implements AdempiereProcessor,AdempiereProcessor2 { /** * @@ -132,4 +134,25 @@ public class MWorkflowProcessor extends X_AD_WorkflowProcessor return no; } // deleteLog + + @Override + public String getFrequencyType() { + MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID()); + return schedule.getFrequencyType(); + } + + + @Override + public int getFrequency() { + MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID()); + return schedule.getFrequency(); + } + + + @Override + public boolean isIgnoreProcessingTime() { + MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID()); + return schedule.isIgnoreProcessingTime(); + } + } // MWorkflowProcessor diff --git a/org.adempiere.server/src/main/server/org/compiere/server/AcctProcessor.java b/org.adempiere.server/src/main/server/org/compiere/server/AcctProcessor.java index 5db435d894..5c2d2bdc5a 100644 --- a/org.adempiere.server/src/main/server/org/compiere/server/AcctProcessor.java +++ b/org.adempiere.server/src/main/server/org/compiere/server/AcctProcessor.java @@ -26,11 +26,13 @@ import java.util.List; import java.util.logging.Level; import org.compiere.acct.DocManager; +import org.compiere.model.AdempiereProcessor2; import org.compiere.model.MAcctProcessor; import org.compiere.model.MAcctProcessorLog; import org.compiere.model.MAcctSchema; import org.compiere.model.MClient; import org.compiere.model.MCost; +import org.compiere.model.MSchedule; import org.compiere.util.DB; import org.compiere.util.Env; import org.compiere.util.TimeUtil; @@ -42,7 +44,7 @@ import org.compiere.util.TimeUtil; * @author Jorg Janke * @version $Id: AcctProcessor.java,v 1.3 2006/07/30 00:53:33 jjanke Exp $ */ -public class AcctProcessor extends AdempiereServer +public class AcctProcessor extends AdempiereServer { /** * Accounting Processor @@ -243,4 +245,5 @@ public class AcctProcessor extends AdempiereServer return "#" + p_runCount + " - Last=" + m_summary.toString(); } // getServerInfo + } // AcctProcessor diff --git a/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServer.java b/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServer.java index 0e887ea4d6..aea2114339 100644 --- a/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServer.java +++ b/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServer.java @@ -29,8 +29,10 @@ import org.compiere.model.MAlertProcessor; import org.compiere.model.MClient; import org.compiere.model.MLdapProcessor; import org.compiere.model.MRequestProcessor; +import org.compiere.model.MSchedule; import org.compiere.model.MScheduler; import org.compiere.model.MSystem; +import org.compiere.model.X_AD_Schedule; import org.compiere.util.CLogger; import org.compiere.util.Env; import org.compiere.util.TimeUtil; @@ -42,7 +44,7 @@ import org.compiere.wf.MWorkflowProcessor; * @author Jorg Janke * @version $Id: AdempiereServer.java,v 1.3 2006/10/09 00:23:26 jjanke Exp $ */ -public abstract class AdempiereServer extends Thread +public abstract class AdempiereServer extends Thread { /** * Create New Server Thead @@ -190,7 +192,24 @@ public abstract class AdempiereServer extends Thread * Run async */ public void run () - { + { + + if(p_model instanceof AdempiereProcessor2) + { + AdempiereProcessor2 model=(AdempiereProcessor2) p_model; + int AD_Schedule_ID = model.getAD_Schedule_ID(); + MSchedule schedule = null; + if (AD_Schedule_ID != 0) + { + schedule = MSchedule.get (getCtx(), AD_Schedule_ID); + if (!schedule.isOKtoRunOnIP()) + { + log.warning (getName() + ": Stopped - IP Restriction " + schedule); + return; // done + } + } + } + try { log.fine(getName() + ": pre-nap - " + m_initialNap); @@ -234,7 +253,7 @@ public abstract class AdempiereServer extends Thread m_runLastMS = now - p_startWork; m_runTotalMS += m_runLastMS; // - m_sleepMS = calculateSleep(); + m_sleepMS = calculateSleep(m_start); Timestamp lastRun = new Timestamp(now); if (p_model instanceof AdempiereProcessor2) { @@ -344,7 +363,7 @@ public abstract class AdempiereServer extends Thread * Calculate Sleep ms * @return miliseconds */ - private long calculateSleep () + private long calculateSleep (long now) { String frequencyType = p_model.getFrequencyType(); int frequency = p_model.getFrequency(); @@ -354,14 +373,32 @@ public abstract class AdempiereServer extends Thread long typeSec = 600; // 10 minutes if (frequencyType == null) typeSec = 300; // 5 minutes - else if (MRequestProcessor.FREQUENCYTYPE_Minute.equals(frequencyType)) + else if (X_AD_Schedule.FREQUENCYTYPE_Minute.equals(frequencyType)) typeSec = 60; - else if (MRequestProcessor.FREQUENCYTYPE_Hour.equals(frequencyType)) + else if (X_AD_Schedule.FREQUENCYTYPE_Hour.equals(frequencyType)) typeSec = 3600; - else if (MRequestProcessor.FREQUENCYTYPE_Day.equals(frequencyType)) + else if (X_AD_Schedule.FREQUENCYTYPE_Day.equals(frequencyType)) typeSec = 86400; // - return typeSec * 1000 * frequency; // ms + long sleep= typeSec * 1000 * frequency; + + if (p_model instanceof AdempiereProcessor2) + { + AdempiereProcessor2 model=(AdempiereProcessor2) p_model; + if (model.getAD_Schedule_ID() == 0) + return sleep; + + // Calculate Schedule + MSchedule schedule = MSchedule.get(getCtx(),model.getAD_Schedule_ID()); + long next = schedule.getNextRunMS(now); + long delta = next - now; + if (delta < 0) { + log.warning("Negative Delta=" + delta + " - set to " + sleep); + delta = sleep; + } + return delta; + } + return sleep; } // calculateSleep /** diff --git a/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServerMgr.java b/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServerMgr.java index 2768ef0428..3eeb828c65 100644 --- a/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServerMgr.java +++ b/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServerMgr.java @@ -103,10 +103,11 @@ public class AdempiereServerMgr * Start Environment * @return true if started */ - private boolean startServers() + public boolean startServers() { log.info(""); int noServers = 0; + m_servers=new ArrayList(); // Accounting MAcctProcessor[] acctModels = MAcctProcessor.getActive(m_ctx); for (int i = 0; i < acctModels.length; i++) diff --git a/org.adempiere.server/src/main/server/org/compiere/server/Scheduler.java b/org.adempiere.server/src/main/server/org/compiere/server/Scheduler.java index 9445539277..e7b800e1f6 100644 --- a/org.adempiere.server/src/main/server/org/compiere/server/Scheduler.java +++ b/org.adempiere.server/src/main/server/org/compiere/server/Scheduler.java @@ -34,6 +34,7 @@ import org.compiere.model.MPInstance; import org.compiere.model.MPInstancePara; import org.compiere.model.MProcess; import org.compiere.model.MRole; +import org.compiere.model.MSchedule; import org.compiere.model.MScheduler; import org.compiere.model.MSchedulerLog; import org.compiere.model.MSchedulerPara; @@ -422,33 +423,39 @@ public class Scheduler extends AdempiereServer } // getServerInfo @Override - public void run() { - String cronPattern = (String) m_model.getCronPattern(); - if (cronPattern != null && cronPattern.trim().length() > 0 && SchedulingPattern.validate(cronPattern)) { - cronScheduler = new it.sauronsoftware.cron4j.Scheduler(); - cronScheduler.schedule(cronPattern, new Runnable() { - public void run() { - runNow(); - long next = predictor.nextMatchingTime(); - p_model.setDateNextRun(new Timestamp(next)); - p_model.saveEx(); - } - }); - predictor = new Predictor(cronPattern); - long next = predictor.nextMatchingTime(); - p_model.setDateNextRun(new Timestamp(next)); - p_model.saveEx(); - cronScheduler.start(); - while (true) { - if (!sleep()) { - cronScheduler.stop(); - break; - } else if (!cronScheduler.isStarted()) { - break; + public void run() + { + if (m_model.getAD_Schedule_ID() > 0) + { + MSchedule time = new MSchedule(getCtx(),m_model.getAD_Schedule_ID(), null); + String cronPattern = (String) time.getCronPattern(); + if (cronPattern != null && cronPattern.trim().length() > 0 + && SchedulingPattern.validate(cronPattern)) { + cronScheduler = new it.sauronsoftware.cron4j.Scheduler(); + cronScheduler.schedule(cronPattern, new Runnable() { + public void run() { + runNow(); + long next = predictor.nextMatchingTime(); + p_model.setDateNextRun(new Timestamp(next)); + p_model.saveEx(); + } + }); + predictor = new Predictor(cronPattern); + long next = predictor.nextMatchingTime(); + p_model.setDateNextRun(new Timestamp(next)); + p_model.saveEx(); + cronScheduler.start(); + while (true) { + if (!sleep()) { + cronScheduler.stop(); + break; + } else if (!cronScheduler.isStarted()) { + break; + } } + } else { + super.run(); } - } else { - super.run(); } } } // Scheduler diff --git a/org.adempiere.server/src/main/servlet/org/compiere/web/AdempiereMonitor.java b/org.adempiere.server/src/main/servlet/org/compiere/web/AdempiereMonitor.java index fde0c7cbbf..060b4050f8 100644 --- a/org.adempiere.server/src/main/servlet/org/compiere/web/AdempiereMonitor.java +++ b/org.adempiere.server/src/main/servlet/org/compiere/web/AdempiereMonitor.java @@ -25,12 +25,15 @@ import java.lang.management.MemoryMXBean; import java.lang.management.RuntimeMXBean; import java.lang.management.ThreadMXBean; import java.sql.Timestamp; +import java.util.Collection; +import java.util.Locale; import java.util.Properties; import java.util.logging.Level; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.ServletOutputStream; +import javax.servlet.http.Cookie; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -62,6 +65,7 @@ import org.compiere.model.MClient; import org.compiere.model.MStore; import org.compiere.model.MSystem; import org.compiere.server.AdempiereServer; +import org.compiere.server.AdempiereServerGroup; import org.compiere.server.AdempiereServerMgr; import org.compiere.util.CLogFile; import org.compiere.util.CLogMgt; @@ -139,12 +143,12 @@ public class AdempiereMonitor extends HttpServlet if (processRunNowParameter (request)) ; else - processActionParameter (request); + processActionParameter (request,response); if (xmlOutput) createXMLSummaryPage(request, response); else - createSummaryPage(request, response); + createSummaryPage(request, response,false); } // doGet /** @@ -265,7 +269,7 @@ public class AdempiereMonitor extends HttpServlet * Process Action Parameter * @param request request */ - private void processActionParameter (HttpServletRequest request) + private void processActionParameter (HttpServletRequest request,HttpServletResponse response) { String action = WebUtil.getParameter (request, "Action"); if (action == null || action.length() == 0) @@ -274,6 +278,7 @@ public class AdempiereMonitor extends HttpServlet try { boolean start = action.startsWith("Start"); + boolean refresh=action.startsWith("Refresh"); m_message = new p(); String msg = (start ? "Started" : "Stopped") + ": "; m_message.addElement(new strong(msg)); @@ -283,28 +288,36 @@ public class AdempiereMonitor extends HttpServlet if (serverID.equals("All")) { if (start) + { ok = m_serverMgr.startAll(); - else + } else{ ok = m_serverMgr.stopAll(); + } + m_message.addElement("All"); } else { - AdempiereServer server = m_serverMgr.getServer(serverID); - if (server == null) - { - m_message = new p(); - m_message.addElement(new strong("Server not found: ")); - m_message.addElement(serverID); - return; - } - else - { - if (start) - ok = m_serverMgr.start (serverID); - else - ok = m_serverMgr.stop (serverID); - m_message.addElement(server.getName()); + if (refresh) + { + m_serverMgr.stopAll(); + ok=m_serverMgr.startServers(); + this.createSummaryPage(request, response,true); + + } else { + AdempiereServer server = m_serverMgr.getServer(serverID); + if (server == null) { + m_message = new p(); + m_message.addElement(new strong("Server not found: ")); + m_message.addElement(serverID); + return; + } else { + if (start) + ok = m_serverMgr.start(serverID); + else + ok = m_serverMgr.stop(serverID); + m_message.addElement(server.getName()); + } } } m_message.addElement(ok ? " - OK" : " - Error!"); @@ -517,15 +530,17 @@ public class AdempiereMonitor extends HttpServlet * @throws ServletException * @throws IOException */ - private void createSummaryPage (HttpServletRequest request, HttpServletResponse response) + private void createSummaryPage (HttpServletRequest request, HttpServletResponse response,boolean refresh) throws ServletException, IOException { WebDoc doc = WebDoc.create ("Adempiere Server Monitor"); // log.info("ServletConfig=" + getServletConfig()); - // AdempiereServerGroup.get().dump(); + AdempiereServerGroup.get().dump(); // Body - body bb = doc.getBody(); + body bb=new body(); + bb = doc.getBody(); + // Message if (m_message != null) { @@ -574,11 +589,11 @@ public class AdempiereMonitor extends HttpServlet link = new a ("adempiereMonitor?Action=Stop_All", "Stop All"); para.addElement(link); para.addElement(" - "); - link = new a ("adempiereMonitor", "Refresh"); + link = new a ("adempiereMonitor?Action=Refresh", "Refresh"); para.addElement(link); bb.addElement(para); - // ***** Server Links ***** + // ***** Server Links ***** bb.addElement(new hr()); para = new p(); AdempiereServer[] servers = m_serverMgr.getAll(); @@ -602,6 +617,7 @@ public class AdempiereMonitor extends HttpServlet createLogMgtPage(bb); // ***** Server Details ***** + bb.removeEndEndModifier(); for (int i = 0; i < servers.length; i++) { AdempiereServer server = servers[i]; From 110618d495a8facebc2b4dfb9f4e15d6a5517401 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 2 Oct 2012 23:16:41 -0500 Subject: [PATCH 68/79] IDEMPIERE-391 Scheduler improvements / Peer review, tests, some refactoring --- .../oracle/912_IDEMPIERE_391.sql | 552 +++++++++++++++-- .../postgresql/912_IDEMPIERE_391.sql | 570 ++++++++++++++++-- .../compiere/model/AdempiereProcessor.java | 12 + .../src/org/compiere/model/I_AD_Schedule.java | 30 +- .../org/compiere/model/MAcctProcessor.java | 53 +- .../org/compiere/model/MAlertProcessor.java | 43 +- .../src/org/compiere/model/MIMPProcessor.java | 14 +- .../org/compiere/model/MLdapProcessor.java | 12 +- .../org/compiere/model/MRequestProcessor.java | 41 +- .../src/org/compiere/model/MSchedule.java | 146 ++--- .../src/org/compiere/model/MScheduler.java | 30 +- .../src/org/compiere/model/MSetup.java | 7 +- .../src/org/compiere/model/SystemIDs.java | 4 + .../src/org/compiere/model/X_AD_Schedule.java | 49 +- .../org/compiere/wf/MWorkflowProcessor.java | 40 +- .../org/adempiere/server/IServerFactory.java | 2 + .../org/compiere/server/AdempiereServer.java | 116 +--- .../compiere/server/AdempiereServerMgr.java | 48 +- .../org/compiere/server/AlertProcessor.java | 2 +- .../org/compiere/server/RequestProcessor.java | 2 +- .../server/org/compiere/server/Scheduler.java | 46 +- .../compiere/server/WorkflowProcessor.java | 2 +- 22 files changed, 1375 insertions(+), 446 deletions(-) diff --git a/migration/360lts-release/oracle/912_IDEMPIERE_391.sql b/migration/360lts-release/oracle/912_IDEMPIERE_391.sql index 86f1a2d198..a06964a2ff 100644 --- a/migration/360lts-release/oracle/912_IDEMPIERE_391.sql +++ b/migration/360lts-release/oracle/912_IDEMPIERE_391.sql @@ -764,6 +764,31 @@ UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=200495 UPDATE AD_Column SET AD_Reference_ID=20,Updated=TO_DATE('2012-09-18 14:14:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=200478 ; +-- Sep 28, 2012 5:40:09 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('AD_Schedule_UU',200158,'D','AD_Schedule_UU','AD_Schedule_UU','027b3c04-57c2-4df2-bae1-daffffa41fa7',0,TO_DATE('2012-09-28 17:40:07','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-28 17:40:07','YYYY-MM-DD HH24:MI:SS'),0,0,0,'Y') +; + +-- Sep 28, 2012 5:40:09 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200158 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 28, 2012 5:40:56 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200559,'D','N','N','N',0,'N',36,'N',10,'N','N',200158,'N','Y','b4867242-4498-4608-aa86-c262f3af378e','N','Y','N','AD_Schedule_UU','AD_Schedule_UU','N',0,TO_DATE('2012-09-28 17:40:55','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-28 17:40:55','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 28, 2012 5:40:56 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200559 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 28, 2012 5:40:59 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_Schedule ADD AD_Schedule_UU NVARCHAR2(36) DEFAULT NULL +; + -- Sep 20, 2012 9:38:20 AM COT -- IDEMPIERE-391 Scheduler improvements INSERT INTO AD_Schedule (Frequency,AD_Client_ID,AD_Org_ID,AD_Schedule_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive,FrequencyType,ScheduleType,MonthDay,Name) VALUES (1,0,0,200000,TO_DATE('2012-09-20 09:38:18','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2012-09-20 09:38:18','YYYY-MM-DD HH24:MI:SS'),100,'Y','D','F',0,'1 Day') @@ -1064,6 +1089,7 @@ UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-20 11:53:05','YYYY-MM -- IDEMPIERE-391 Scheduler improvements UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-20 11:53:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11522 ; + -- Sep 20, 2012 6:24:20 PM COT -- IDEMPIERE-391 Scheduler improvements INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,695,200490,'D','N','N','N',0,'N',10,'N',19,'N','N',200132,'N','Y','7e549561-f9c8-44b7-9bc2-9e1d1bb4c728','N','Y','N','AD_Schedule_ID','AD_Schedule_ID','Y',100,TO_DATE('2012-09-20 18:24:18','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-20 18:24:18','YYYY-MM-DD HH24:MI:SS'),100,0,0) @@ -1186,7 +1212,7 @@ UPDATE AD_Field SET ColumnSpan=3,Updated=TO_DATE('2012-09-20 18:28:12','YYYY-MM- -- Sep 20, 2012 6:29:41 PM COT -- IDEMPIERE-391 Scheduler improvements -INSERT INTO AD_Schedule (Frequency,AD_Client_ID,AD_Org_ID,AD_Schedule_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive,FrequencyType,ScheduleType,MonthDay,Name) VALUES (10,0,0,200002,TO_DATE('2012-09-20 18:29:40','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2012-09-20 18:29:40','YYYY-MM-DD HH24:MI:SS'),100,'Y','M','F',0,'10 Minutes') +INSERT INTO AD_Schedule (Frequency,AD_Client_ID,AD_Org_ID,AD_Schedule_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive,FrequencyType,ScheduleType,MonthDay,Name,Description) VALUES (10,0,0,200002,TO_DATE('2012-09-20 18:29:40','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2012-09-20 18:29:40','YYYY-MM-DD HH24:MI:SS'),100,'Y','M','F',0,'10 Minutes','(do not delete, used in Initial Client Setup)') ; -- Sep 20, 2012 6:31:38 PM COT @@ -1431,7 +1457,7 @@ UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-20 19:37:41','YYYY-MM -- Sep 20, 2012 7:39:26 PM COT -- IDEMPIERE-391 Scheduler improvements -INSERT INTO AD_Schedule (Frequency,AD_Client_ID,AD_Org_ID,AD_Schedule_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive,FrequencyType,ScheduleType,MonthDay,Name) VALUES (15,0,0,200003,TO_DATE('2012-09-20 19:39:24','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2012-09-20 19:39:24','YYYY-MM-DD HH24:MI:SS'),100,'Y','M','F',0,'15 Minutes') +INSERT INTO AD_Schedule (Frequency,AD_Client_ID,AD_Org_ID,AD_Schedule_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive,FrequencyType,ScheduleType,MonthDay,Name,Description) VALUES (15,0,0,200003,TO_DATE('2012-09-20 19:39:24','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2012-09-20 19:39:24','YYYY-MM-DD HH24:MI:SS'),100,'Y','M','F',0,'15 Minutes','(do not delete, used in Initial Client Setup)') ; -- Sep 20, 2012 7:55:53 PM COT @@ -1559,6 +1585,106 @@ UPDATE AD_Column SET EntityType='D',Updated=TO_DATE('2012-09-24 15:50:11','YYYY- ALTER TABLE AD_Schedule ADD IsIgnoreProcessingTime CHAR(1) DEFAULT 'N' CHECK (IsIgnoreProcessingTime IN ('Y','N')) ; +-- Sep 24, 2012 5:05:08 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,Description,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('IsSystemSchedule',200157,'D','IsSystemSchedule','Schedule Just For System','System Schedule','0fcff3a8-e3d4-4d54-a060-7aa225b329c6',0,TO_DATE('2012-09-24 17:05:07','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-24 17:05:07','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Sep 24, 2012 5:05:08 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200157 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 5:06:10 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,DefaultValue,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200558,'D','N','N','N',0,'N',1,'N',20,'N','N',200157,'N','Y','f5b750f4-c9a7-4dfb-a4de-17f8431a1f47','N','Y','N','IsSystemSchedule','Schedule Just For System','N','IsSystemSchedule','Y',100,TO_DATE('2012-09-24 17:06:09','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-24 17:06:09','YYYY-MM-DD HH24:MI:SS'),100,0,0) +; + +-- Sep 24, 2012 5:06:10 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200558 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 5:06:23 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_Schedule ADD IsSystemSchedule CHAR(1) DEFAULT 'N' CHECK (IsSystemSchedule IN ('Y','N')) +; + +/* Create schedule records for actual configuration */ +insert into ad_schedule (ad_schedule_id, ad_schedule_uu, ad_client_id, ad_org_id, frequencytype, frequency, weekday, scheduletype, isignoreprocessingtime, cronpattern +,created, createdby,description,isactive,runonlyonip,updated,updatedby,name,issystemschedule) +select distinct nextidfunc( 200020 , 'N'), generate_uuid(), 0, 0, frequencytype, frequency, weekday, scheduletype, isignoreprocessingtime, cronpattern +,sysdate,100,null,'Y',null,sysdate,100,coalesce(frequencytype,' ')||' '||coalesce(frequency,-1)||' '||coalesce(scheduletype,' ')||' '||nvl(cronpattern,' '),'N' +from ( +select distinct frequencytype, frequency, weekday, scheduletype, isignoreprocessingtime, cronpattern +from ad_scheduler +where not exists (select 1 from ad_schedule where +coalesce(ad_scheduler.frequencytype,' ') =coalesce(ad_schedule.frequencytype,' ') and +coalesce(ad_scheduler.frequency,-1) =coalesce(ad_schedule.frequency,-1) and +coalesce(ad_scheduler.weekday,' ') =coalesce(ad_schedule.weekday,' ') and +coalesce(ad_scheduler.scheduletype,' ') =coalesce(ad_schedule.scheduletype,' ') and +coalesce(ad_scheduler.isignoreprocessingtime,' ')=coalesce(ad_schedule.isignoreprocessingtime,' ') and +nvl(ad_scheduler.cronpattern,' ') =nvl(ad_schedule.cronpattern,' ') +) +) +; + +insert into ad_schedule (ad_schedule_id, ad_schedule_uu, ad_client_id, ad_org_id, frequencytype, frequency, scheduletype, isignoreprocessingtime +,created, createdby,description,isactive,runonlyonip,updated,updatedby,name,issystemschedule) +select distinct nextidfunc( 200020 , 'N'), generate_uuid(), 0, 0, frequencytype, frequency, scheduletype, isignoreprocessingtime +,sysdate,100,null,'Y',null,sysdate,100,coalesce(frequencytype,' ')||' '||coalesce(frequency,-1)||' '||coalesce(scheduletype,' '),'N' +from ( +select distinct frequencytype, frequency, 'F' as scheduletype, 'Y' as isignoreprocessingtime +from c_acctprocessor +where not exists (select 1 from ad_schedule where +coalesce(c_acctprocessor.frequencytype,' ') =coalesce(ad_schedule.frequencytype,' ') and +coalesce(c_acctprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1) +) +) +; + +insert into ad_schedule (ad_schedule_id, ad_schedule_uu, ad_client_id, ad_org_id, frequencytype, frequency, scheduletype, isignoreprocessingtime +,created, createdby,description,isactive,runonlyonip,updated,updatedby,name,issystemschedule) +select distinct nextidfunc( 200020 , 'N'), generate_uuid(), 0, 0, frequencytype, frequency, scheduletype, isignoreprocessingtime +,sysdate,100,null,'Y',null,sysdate,100,coalesce(frequencytype,' ')||' '||coalesce(frequency,-1)||' '||coalesce(scheduletype,' '),'N' +from ( +select distinct frequencytype, frequency, 'F' as scheduletype, 'Y' as isignoreprocessingtime +from ad_alertprocessor +where not exists (select 1 from ad_schedule where +coalesce(ad_alertprocessor.frequencytype,' ') =coalesce(ad_schedule.frequencytype,' ') and +coalesce(ad_alertprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1) +) +) +; + +insert into ad_schedule (ad_schedule_id, ad_schedule_uu, ad_client_id, ad_org_id, frequencytype, frequency, scheduletype, isignoreprocessingtime +,created, createdby,description,isactive,runonlyonip,updated,updatedby,name,issystemschedule) +select distinct nextidfunc( 200020 , 'N'), generate_uuid(), 0, 0, frequencytype, frequency, scheduletype, isignoreprocessingtime +,sysdate,100,null,'Y',null,sysdate,100,coalesce(frequencytype,' ')||' '||coalesce(frequency,-1)||' '||coalesce(scheduletype,' '),'N' +from ( +select distinct frequencytype, frequency, 'F' as scheduletype, 'Y' as isignoreprocessingtime +from r_requestprocessor +where not exists (select 1 from ad_schedule where +coalesce(r_requestprocessor.frequencytype,' ') =coalesce(ad_schedule.frequencytype,' ') and +coalesce(r_requestprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1) +) +) +; + +insert into ad_schedule (ad_schedule_id, ad_schedule_uu, ad_client_id, ad_org_id, frequencytype, frequency, scheduletype, isignoreprocessingtime +,created, createdby,description,isactive,runonlyonip,updated,updatedby,name,issystemschedule) +select distinct nextidfunc( 200020 , 'N'), generate_uuid(), 0, 0, frequencytype, frequency, scheduletype, isignoreprocessingtime +,sysdate,100,null,'Y',null,sysdate,100,coalesce(frequencytype,' ')||' '||coalesce(frequency,-1)||' '||coalesce(scheduletype,' '),'N' +from ( +select distinct frequencytype, frequency, 'F' as scheduletype, 'Y' as isignoreprocessingtime +from ad_workflowprocessor +where not exists (select 1 from ad_schedule where +coalesce(ad_workflowprocessor.frequencytype,' ') =coalesce(ad_schedule.frequencytype,' ') and +coalesce(ad_workflowprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1) +) +) +; + -- Sep 24, 2012 3:50:36 PM COT -- IDEMPIERE-391 Scheduler improvements UPDATE AD_Table SET AD_Window_ID=200012,Updated=TO_DATE('2012-09-24 15:50:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=200020 @@ -1589,31 +1715,6 @@ UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-24 15:51:17','YYYY-MM UPDATE AD_Field SET IsDisplayed='N', IsActive='N',Updated=TO_DATE('2012-09-24 15:52:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58773 ; --- Sep 24, 2012 5:05:08 PM COT --- IDEMPIERE-391 Scheduler improvements -INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,Description,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('IsSystemSchedule',200157,'D','IsSystemSchedule','Schedule Just For System','System Schedule','0fcff3a8-e3d4-4d54-a060-7aa225b329c6',0,TO_DATE('2012-09-24 17:05:07','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-24 17:05:07','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') -; - --- Sep 24, 2012 5:05:08 PM COT --- IDEMPIERE-391 Scheduler improvements -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200157 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) -; - --- Sep 24, 2012 5:06:10 PM COT --- IDEMPIERE-391 Scheduler improvements -INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,DefaultValue,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200558,'D','N','N','N',0,'N',1,'N',20,'N','N',200157,'N','Y','f5b750f4-c9a7-4dfb-a4de-17f8431a1f47','N','Y','N','IsSystemSchedule','Schedule Just For System','N','IsSystemSchedule','Y',100,TO_DATE('2012-09-24 17:06:09','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-24 17:06:09','YYYY-MM-DD HH24:MI:SS'),100,0,0) -; - --- Sep 24, 2012 5:06:10 PM COT --- IDEMPIERE-391 Scheduler improvements -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200558 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) -; - --- Sep 24, 2012 5:06:23 PM COT --- IDEMPIERE-391 Scheduler improvements -ALTER TABLE AD_Schedule ADD IsSystemSchedule CHAR(1) DEFAULT 'N' CHECK (IsSystemSchedule IN ('Y','N')) -; - -- Sep 24, 2012 5:06:51 PM COT -- IDEMPIERE-391 Scheduler improvements INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,1,'N','N',200558,'Y',200553,'N','D','Schedule Just For System','IsSystemSchedule','Y','N','1a29d07e-df06-4d49-bab4-733c0f547714',100,0,TO_DATE('2012-09-24 17:06:50','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-24 17:06:50','YYYY-MM-DD HH24:MI:SS'),'Y') @@ -1641,7 +1742,7 @@ INSERT INTO AD_Val_Rule (Code,AD_Val_Rule_ID,EntityType,Name,Type,AD_Val_Rule_UU -- Sep 24, 2012 5:32:02 PM COT -- IDEMPIERE-391 Scheduler improvements -UPDATE AD_Val_Rule SET Name='AD_schedule for System',Updated=TO_DATE('2012-09-24 17:32:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=200007 +UPDATE AD_Val_Rule SET Name='AD_Schedule for System',Updated=TO_DATE('2012-09-24 17:32:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=200007 ; -- Sep 24, 2012 5:32:06 PM COT @@ -1665,164 +1766,493 @@ UPDATE AD_Column SET AD_Val_Rule_ID=200007,Updated=TO_DATE('2012-09-24 17:51:36' ; -- Sep 27, 2012 10:19:28 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2012-09-27 10:19:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11348 ; -- Sep 27, 2012 10:19:30 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator ALTER TABLE C_AcctProcessor MODIFY Frequency NUMBER(10) DEFAULT NULL ; --- Sep 27, 2012 10:19:30 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator ALTER TABLE C_AcctProcessor MODIFY Frequency NULL ; -- Sep 27, 2012 11:05:06 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-27 11:05:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11348 ; -- Sep 27, 2012 11:36:59 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2012-09-27 11:36:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11441 ; -- Sep 27, 2012 11:37:05 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator ALTER TABLE AD_AlertProcessor MODIFY Frequency NUMBER(10) DEFAULT NULL ; -- Sep 27, 2012 11:37:18 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-27 11:37:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11441 ; -- Sep 27, 2012 11:37:24 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2012-09-27 11:37:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11440 ; -- Sep 27, 2012 11:37:28 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator ALTER TABLE AD_AlertProcessor MODIFY FrequencyType CHAR(1) DEFAULT NULL ; -- Sep 27, 2012 11:37:34 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-27 11:37:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11440 ; -- Sep 27, 2012 11:38:29 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2012-09-27 11:38:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5480 ; -- Sep 27, 2012 11:38:33 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator ALTER TABLE R_RequestProcessor MODIFY Frequency NUMBER(10) DEFAULT 1 ; -- Sep 27, 2012 11:38:33 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator ALTER TABLE R_RequestProcessor MODIFY Frequency NULL ; -- Sep 27, 2012 11:38:38 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-27 11:38:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5480 ; -- Sep 27, 2012 11:38:45 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2012-09-27 11:38:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5481 ; -- Sep 27, 2012 11:38:49 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator ALTER TABLE R_RequestProcessor MODIFY FrequencyType CHAR(1) DEFAULT NULL ; -- Sep 27, 2012 11:38:50 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator ALTER TABLE R_RequestProcessor MODIFY FrequencyType NULL ; -- Sep 27, 2012 11:38:55 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-27 11:38:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5481 ; -- Sep 27, 2012 11:39:55 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2012-09-27 11:39:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11391 ; -- Sep 27, 2012 11:39:56 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator ALTER TABLE AD_WorkflowProcessor MODIFY Frequency NUMBER(10) DEFAULT NULL ; -- Sep 27, 2012 11:39:56 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator ALTER TABLE AD_WorkflowProcessor MODIFY Frequency NULL ; -- Sep 27, 2012 11:40:03 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-27 11:40:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11391 ; -- Sep 27, 2012 11:40:11 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsMandatory='N', IsActive='N',Updated=TO_DATE('2012-09-27 11:40:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11382 ; -- Sep 27, 2012 11:45:45 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2012-09-27 11:45:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11247 ; -- Sep 27, 2012 11:45:49 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator ALTER TABLE AD_Scheduler MODIFY Frequency NUMBER(10) DEFAULT NULL ; -- Sep 27, 2012 11:45:49 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator ALTER TABLE AD_Scheduler MODIFY Frequency NULL ; -- Sep 27, 2012 11:45:55 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-27 11:45:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11247 ; -- Sep 27, 2012 11:46:03 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2012-09-27 11:46:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11255 ; -- Sep 27, 2012 11:46:05 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator ALTER TABLE AD_Scheduler MODIFY FrequencyType CHAR(1) DEFAULT NULL ; -- Sep 27, 2012 11:46:05 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator ALTER TABLE AD_Scheduler MODIFY FrequencyType NULL ; -- Sep 27, 2012 11:46:10 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-27 11:46:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11255 ; -- Sep 27, 2012 11:49:52 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Window SET WindowType='M',Updated=TO_DATE('2012-09-27 11:49:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID=200012 ; +-- Sep 28, 2012 5:38:59 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Table SET Name='Schedule',Updated=TO_DATE('2012-09-28 17:38:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Table_ID=200020 +; + +-- Sep 28, 2012 5:38:59 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Table_Trl SET IsTranslated='N' WHERE AD_Table_ID=200020 +; + +-- Sep 28, 2012 5:42:10 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('RunOnlyOnIP',200159,'D','Run only on IP','Run only on IP','090ed7f1-67f7-4d25-ac6b-c4de976b732b',0,TO_DATE('2012-09-28 17:42:09','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-28 17:42:09','YYYY-MM-DD HH24:MI:SS'),0,0,0,'Y') +; + +-- Sep 28, 2012 5:42:10 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200159 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 28, 2012 5:42:18 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET AD_Element_ID=200159, ColumnName='RunOnlyOnIP', Description=NULL, Help=NULL, Name='Run only on IP',Updated=TO_DATE('2012-09-28 17:42:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=200486 +; + +-- Sep 28, 2012 5:42:18 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column_Trl SET IsTranslated='N' WHERE AD_Column_ID=200486 +; + +-- Sep 28, 2012 5:42:18 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET Name='Run only on IP', Description=NULL, Help=NULL WHERE AD_Column_ID=200486 AND IsCentrallyMaintained='Y' +; + +CREATE UNIQUE INDEX ad_schedule_uu_idx ON ad_schedule (ad_schedule_uu) +; + +-- Sep 28, 2012 6:21:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Element SET Name='System Schedule',Updated=TO_DATE('2012-09-28 18:21:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=200157 +; + +-- Sep 28, 2012 6:21:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=200157 +; + +-- Sep 28, 2012 6:21:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET ColumnName='IsSystemSchedule', Name='System Schedule', Description='Schedule Just For System', Help=NULL WHERE AD_Element_ID=200157 +; + +-- Sep 28, 2012 6:21:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Process_Para SET ColumnName='IsSystemSchedule', Name='System Schedule', Description='Schedule Just For System', Help=NULL, AD_Element_ID=200157 WHERE UPPER(ColumnName)='ISSYSTEMSCHEDULE' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL +; + +-- Sep 28, 2012 6:21:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Process_Para SET ColumnName='IsSystemSchedule', Name='System Schedule', Description='Schedule Just For System', Help=NULL WHERE AD_Element_ID=200157 AND IsCentrallyMaintained='Y' +; + +-- Sep 28, 2012 6:21:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET Name='System Schedule', Description='Schedule Just For System', Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=200157) AND IsCentrallyMaintained='Y' +; + +-- Sep 28, 2012 6:21:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_PrintFormatItem pi SET PrintName='System Schedule', Name='System Schedule' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=200157) +; + +-- Sep 28, 2012 6:22:28 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsMandatory='Y', FieldLength=60, IsUpdateable='Y',Updated=TO_DATE('2012-09-28 18:22:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200487 +; + +-- Sep 28, 2012 6:22:53 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Schedule SET Name='2 Hours',Updated=TO_DATE('2012-09-28 18:22:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Schedule_ID=200004 +; + +-- Sep 28, 2012 6:23:11 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_Schedule MODIFY Name NVARCHAR2(60) +; + +-- Sep 28, 2012 6:23:11 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_Schedule MODIFY Name NOT NULL +; + +-- Sep 28, 2012 6:26:22 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsIdentifier='N', SeqNo=0, IsUpdateable='N',Updated=TO_DATE('2012-09-28 18:26:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200473 +; + +-- Sep 28, 2012 6:26:38 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET SeqNo=1,Updated=TO_DATE('2012-09-28 18:26:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200487 +; + +-- Sep 28, 2012 6:26:53 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET SeqNoSelection=1,Updated=TO_DATE('2012-09-28 18:26:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200487 +; + +-- Sep 28, 2012 6:28:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsMandatory='Y',Updated=TO_DATE('2012-09-28 18:28:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200557 +; + +-- Sep 28, 2012 6:28:30 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_Schedule MODIFY IsIgnoreProcessingTime CHAR(1) DEFAULT 'N' +; + +-- Sep 28, 2012 6:28:31 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Schedule SET IsIgnoreProcessingTime='N' WHERE IsIgnoreProcessingTime IS NULL +; + +-- Sep 28, 2012 6:28:31 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_Schedule MODIFY IsIgnoreProcessingTime NOT NULL +; + +-- Sep 28, 2012 6:28:42 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsMandatory='Y',Updated=TO_DATE('2012-09-28 18:28:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200558 +; + +-- Sep 28, 2012 6:28:48 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_Schedule MODIFY IsSystemSchedule CHAR(1) DEFAULT 'N' +; + +-- Sep 28, 2012 6:28:48 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Schedule SET IsSystemSchedule='N' WHERE IsSystemSchedule IS NULL +; + +-- Sep 28, 2012 6:28:48 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_Schedule MODIFY IsSystemSchedule NOT NULL +; + +-- ?? MIGRATE ACTUAL DATA + + +-- Sep 28, 2012 6:30:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Element SET Name='Schedule',Updated=TO_DATE('2012-09-28 18:30:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=200132 +; + +-- Sep 28, 2012 6:30:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=200132 +; + +-- Sep 28, 2012 6:30:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET ColumnName='AD_Schedule_ID', Name='Schedule', Description=NULL, Help=NULL WHERE AD_Element_ID=200132 +; + +-- Sep 28, 2012 6:30:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Process_Para SET ColumnName='AD_Schedule_ID', Name='Schedule', Description=NULL, Help=NULL, AD_Element_ID=200132 WHERE UPPER(ColumnName)='AD_SCHEDULE_ID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL +; + +-- Sep 28, 2012 6:30:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Process_Para SET ColumnName='AD_Schedule_ID', Name='Schedule', Description=NULL, Help=NULL WHERE AD_Element_ID=200132 AND IsCentrallyMaintained='Y' +; + +-- Sep 28, 2012 6:30:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET Name='Schedule', Description=NULL, Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=200132) AND IsCentrallyMaintained='Y' +; + +-- Sep 28, 2012 6:30:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_PrintFormatItem pi SET PrintName='Schedule', Name='Schedule' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=200132) +; + +-- Sep 28, 2012 6:32:24 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Scheduler SET Record_ID=NULL, AD_Schedule_ID=200001,Updated=TO_DATE('2012-09-28 18:32:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Scheduler_ID=100 +; + +-- Sep 28, 2012 6:34:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsMandatory='Y',Updated=TO_DATE('2012-09-28 18:34:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200491 +; + +/* Set schedules for actual records before making them mandatory */ +update ad_scheduler set ad_schedule_id=(select min(ad_schedule_id) from ad_schedule where +coalesce(ad_scheduler.frequencytype,' ') =coalesce(ad_schedule.frequencytype,' ') and +coalesce(ad_scheduler.frequency,-1) =coalesce(ad_schedule.frequency,-1) and +coalesce(ad_scheduler.weekday,' ') =coalesce(ad_schedule.weekday,' ') and +coalesce(ad_scheduler.scheduletype,' ') =coalesce(ad_schedule.scheduletype,' ') and +coalesce(ad_scheduler.isignoreprocessingtime,' ')=coalesce(ad_schedule.isignoreprocessingtime,' ') and +nvl(ad_scheduler.cronpattern,' ') =nvl(ad_schedule.cronpattern,' ')) +; + +update c_acctprocessor set ad_schedule_id=(select min(ad_schedule_id) from ad_schedule where +coalesce(c_acctprocessor.frequencytype,' ')=coalesce(ad_schedule.frequencytype,' ') and +coalesce(c_acctprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1) and +ad_schedule.scheduletype='F') +; + +update ad_alertprocessor set ad_schedule_id=(select min(ad_schedule_id) from ad_schedule where +coalesce(ad_alertprocessor.frequencytype,' ')=coalesce(ad_schedule.frequencytype,' ') and +coalesce(ad_alertprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1) and +ad_schedule.scheduletype='F') +; + +update ad_workflowprocessor set ad_schedule_id=(select min(ad_schedule_id) from ad_schedule where +coalesce(ad_workflowprocessor.frequencytype,' ')=coalesce(ad_schedule.frequencytype,' ') and +coalesce(ad_workflowprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1) and +ad_schedule.scheduletype='F') +; + +update r_requestprocessor set ad_schedule_id=(select min(ad_schedule_id) from ad_schedule where +coalesce(r_requestprocessor.frequencytype,' ')=coalesce(ad_schedule.frequencytype,' ') and +coalesce(r_requestprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1) and +ad_schedule.scheduletype='F') +; + +-- Sep 28, 2012 6:34:33 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_AlertProcessor MODIFY AD_Schedule_ID NUMBER(10) +; + +-- Sep 28, 2012 6:34:33 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_AlertProcessor MODIFY AD_Schedule_ID NOT NULL +; + +-- Sep 28, 2012 6:34:50 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsMandatory='Y',Updated=TO_DATE('2012-09-28 18:34:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200489 +; + +-- Sep 28, 2012 6:34:52 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_Scheduler MODIFY AD_Schedule_ID NUMBER(10) +; + +-- Sep 28, 2012 6:34:52 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_Scheduler MODIFY AD_Schedule_ID NOT NULL +; + +-- Sep 28, 2012 6:35:38 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_WorkflowProcessor SET AD_Schedule_ID=200004,Updated=TO_DATE('2012-09-28 18:35:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_WorkflowProcessor_ID=100 +; + +-- Sep 28, 2012 6:36:15 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsMandatory='Y',Updated=TO_DATE('2012-09-28 18:36:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200493 +; + +-- Sep 28, 2012 6:36:16 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_WorkflowProcessor MODIFY AD_Schedule_ID NUMBER(10) +; + +-- Sep 28, 2012 6:36:16 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_WorkflowProcessor MODIFY AD_Schedule_ID NOT NULL +; + +-- Sep 28, 2012 6:37:32 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE C_AcctProcessor SET AD_Schedule_ID=200002,Updated=TO_DATE('2012-09-28 18:37:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE C_AcctProcessor_ID=100 +; + +-- Sep 28, 2012 6:38:02 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE R_RequestProcessor SET AD_Schedule_ID=200003,Updated=TO_DATE('2012-09-28 18:38:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE R_RequestProcessor_ID=100 +; + +-- Sep 28, 2012 6:38:36 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsMandatory='Y',Updated=TO_DATE('2012-09-28 18:38:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200490 +; + +-- Sep 28, 2012 6:38:37 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE C_AcctProcessor MODIFY AD_Schedule_ID NUMBER(10) +; + +-- Sep 28, 2012 6:38:37 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE C_AcctProcessor MODIFY AD_Schedule_ID NOT NULL +; + +-- Sep 28, 2012 6:39:50 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsMandatory='Y',Updated=TO_DATE('2012-09-28 18:39:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200492 +; + +-- Sep 28, 2012 6:39:52 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE R_RequestProcessor MODIFY AD_Schedule_ID NUMBER(10) +; + +-- Sep 28, 2012 6:39:52 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE R_RequestProcessor MODIFY AD_Schedule_ID NOT NULL +; + +-- Sep 28, 2012 6:47:43 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET AD_Val_Rule_ID=200007,Updated=TO_DATE('2012-09-28 18:47:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200489 +; + +-- Oct 2, 2012 8:02:11 PM COT +UPDATE AD_Field SET DisplayLogic='@ScheduleType@=F',Updated=TO_DATE('2012-10-02 20:02:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200495 +; + +-- Oct 2, 2012 8:06:14 PM COT +UPDATE AD_Element SET Help='Cron pattern to define when the process should be invoked. See http://www.sauronsoftware.it/projects/cron4j/api/it/sauronsoftware/cron4j/SchedulingPattern.html',Updated=TO_DATE('2012-10-02 20:06:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=54124 +; + +-- Oct 2, 2012 8:06:14 PM COT +UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=54124 +; + +-- Oct 2, 2012 8:06:14 PM COT +UPDATE AD_Column SET ColumnName='CronPattern', Name='Cron Scheduling Pattern', Description='Cron pattern to define when the process should be invoked.', Help='Cron pattern to define when the process should be invoked. See http://www.sauronsoftware.it/projects/cron4j/api/it/sauronsoftware/cron4j/SchedulingPattern.html' WHERE AD_Element_ID=54124 +; + +-- Oct 2, 2012 8:06:14 PM COT +UPDATE AD_Process_Para SET ColumnName='CronPattern', Name='Cron Scheduling Pattern', Description='Cron pattern to define when the process should be invoked.', Help='Cron pattern to define when the process should be invoked. See http://www.sauronsoftware.it/projects/cron4j/api/it/sauronsoftware/cron4j/SchedulingPattern.html', AD_Element_ID=54124 WHERE UPPER(ColumnName)='CRONPATTERN' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL +; + +-- Oct 2, 2012 8:06:14 PM COT +UPDATE AD_Process_Para SET ColumnName='CronPattern', Name='Cron Scheduling Pattern', Description='Cron pattern to define when the process should be invoked.', Help='Cron pattern to define when the process should be invoked. See http://www.sauronsoftware.it/projects/cron4j/api/it/sauronsoftware/cron4j/SchedulingPattern.html' WHERE AD_Element_ID=54124 AND IsCentrallyMaintained='Y' +; + +-- Oct 2, 2012 8:06:14 PM COT +UPDATE AD_Field SET Name='Cron Scheduling Pattern', Description='Cron pattern to define when the process should be invoked.', Help='Cron pattern to define when the process should be invoked. See http://www.sauronsoftware.it/projects/cron4j/api/it/sauronsoftware/cron4j/SchedulingPattern.html' WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=54124) AND IsCentrallyMaintained='Y' +; + +ALTER TABLE C_AcctProcessor MODIFY FrequencyType NULL +; + +ALTER TABLE AD_AlertProcessor MODIFY Frequency NULL +; + +ALTER TABLE AD_WorkflowProcessor MODIFY FrequencyType NULL +; + +-- Oct 2, 2012 10:44:20 PM COT +UPDATE AD_Field SET IsDisplayed='N',Updated=TO_DATE('2012-10-02 22:44:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=9434 +; + SELECT register_migration_script('912_IDEMPIERE-391.sql') FROM dual ; + diff --git a/migration/360lts-release/postgresql/912_IDEMPIERE_391.sql b/migration/360lts-release/postgresql/912_IDEMPIERE_391.sql index e24b08312d..e57743b5ee 100644 --- a/migration/360lts-release/postgresql/912_IDEMPIERE_391.sql +++ b/migration/360lts-release/postgresql/912_IDEMPIERE_391.sql @@ -220,6 +220,7 @@ UPDATE AD_Column_Trl SET IsTranslated='N' WHERE AD_Column_ID=200486 -- IDEMPIERE-391 Scheduler improvements UPDATE AD_Field SET Name='RunOnlyOnIP', Description='Defines the IP address to transfer data to', Help='Contains info on the IP address to which we will transfer data' WHERE AD_Column_ID=200486 AND IsCentrallyMaintained='Y' ; + -- Sep 18, 2012 12:06:20 PM COT -- IDEMPIERE-391 Scheduler improvements CREATE TABLE AD_Schedule (AD_Client_ID NUMERIC(10) NOT NULL, AD_Org_ID NUMERIC(10) NOT NULL, AD_Schedule_ID NUMERIC(10) DEFAULT NULL , Created TIMESTAMP NOT NULL, CreatedBy NUMERIC(10) NOT NULL, CronPattern VARCHAR(255) DEFAULT NULL , Description VARCHAR(225) DEFAULT NULL , Frequency NUMERIC(10) DEFAULT NULL , FrequencyType CHAR(1) DEFAULT NULL , IsActive VARCHAR(1) DEFAULT 'Y' NOT NULL, MonthDay NUMERIC(10) DEFAULT NULL , RunOnlyOnIP VARCHAR(60) DEFAULT NULL , ScheduleType CHAR(1) DEFAULT 'F', Updated TIMESTAMP NOT NULL, UpdatedBy NUMERIC(10) NOT NULL, WeekDay CHAR(1) DEFAULT NULL , CONSTRAINT AD_Schedule_Key PRIMARY KEY (AD_Schedule_ID)) @@ -538,7 +539,6 @@ UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=200498 UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=200488 ; - -- Sep 18, 2012 1:47:15 PM COT -- IDEMPIERE-391 Scheduler improvements UPDATE AD_Field SET DisplayLogic='@ScheduleType@=F',Updated=TO_TIMESTAMP('2012-09-18 13:47:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200496 @@ -764,6 +764,31 @@ UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=200495 UPDATE AD_Column SET AD_Reference_ID=20,Updated=TO_TIMESTAMP('2012-09-18 14:14:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=200478 ; +-- Sep 28, 2012 5:40:09 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('AD_Schedule_UU',200158,'D','AD_Schedule_UU','AD_Schedule_UU','027b3c04-57c2-4df2-bae1-daffffa41fa7',0,TO_TIMESTAMP('2012-09-28 17:40:07','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-28 17:40:07','YYYY-MM-DD HH24:MI:SS'),0,0,0,'Y') +; + +-- Sep 28, 2012 5:40:09 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200158 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 28, 2012 5:40:56 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200559,'D','N','N','N',0,'N',36,'N',10,'N','N',200158,'N','Y','b4867242-4498-4608-aa86-c262f3af378e','N','Y','N','AD_Schedule_UU','AD_Schedule_UU','N',0,TO_TIMESTAMP('2012-09-28 17:40:55','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-28 17:40:55','YYYY-MM-DD HH24:MI:SS'),0,0,0) +; + +-- Sep 28, 2012 5:40:56 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200559 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 28, 2012 5:40:59 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_Schedule ADD COLUMN AD_Schedule_UU VARCHAR(36) DEFAULT NULL +; + -- Sep 20, 2012 9:38:20 AM COT -- IDEMPIERE-391 Scheduler improvements INSERT INTO AD_Schedule (Frequency,AD_Client_ID,AD_Org_ID,AD_Schedule_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive,FrequencyType,ScheduleType,MonthDay,Name) VALUES (1,0,0,200000,TO_TIMESTAMP('2012-09-20 09:38:18','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2012-09-20 09:38:18','YYYY-MM-DD HH24:MI:SS'),100,'Y','D','F',0,'1 Day') @@ -903,6 +928,7 @@ UPDATE AD_Field SET SeqNoGrid=180,IsDisplayedGrid='Y' WHERE AD_Field_ID=200501 -- IDEMPIERE-391 Scheduler improvements UPDATE AD_Column SET SeqNoSelection=2,Updated=TO_TIMESTAMP('2012-09-20 10:27:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200487 ; + -- Sep 20, 2012 11:23:10 AM COT -- IDEMPIERE-391 Scheduler improvements UPDATE AD_Column SET IsSelectionColumn='N', IsUpdateable='N', SeqNoSelection=0,Updated=TO_TIMESTAMP('2012-09-20 11:23:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200487 @@ -1186,7 +1212,7 @@ UPDATE AD_Field SET ColumnSpan=3,Updated=TO_TIMESTAMP('2012-09-20 18:28:12','YYY -- Sep 20, 2012 6:29:41 PM COT -- IDEMPIERE-391 Scheduler improvements -INSERT INTO AD_Schedule (Frequency,AD_Client_ID,AD_Org_ID,AD_Schedule_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive,FrequencyType,ScheduleType,MonthDay,Name) VALUES (10,0,0,200002,TO_TIMESTAMP('2012-09-20 18:29:40','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2012-09-20 18:29:40','YYYY-MM-DD HH24:MI:SS'),100,'Y','M','F',0,'10 Minutes') +INSERT INTO AD_Schedule (Frequency,AD_Client_ID,AD_Org_ID,AD_Schedule_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive,FrequencyType,ScheduleType,MonthDay,Name,Description) VALUES (10,0,0,200002,TO_TIMESTAMP('2012-09-20 18:29:40','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2012-09-20 18:29:40','YYYY-MM-DD HH24:MI:SS'),100,'Y','M','F',0,'10 Minutes','(do not delete, used in Initial Client Setup)') ; -- Sep 20, 2012 6:31:38 PM COT @@ -1431,7 +1457,7 @@ UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 19:37:41','YY -- Sep 20, 2012 7:39:26 PM COT -- IDEMPIERE-391 Scheduler improvements -INSERT INTO AD_Schedule (Frequency,AD_Client_ID,AD_Org_ID,AD_Schedule_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive,FrequencyType,ScheduleType,MonthDay,Name) VALUES (15,0,0,200003,TO_TIMESTAMP('2012-09-20 19:39:24','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2012-09-20 19:39:24','YYYY-MM-DD HH24:MI:SS'),100,'Y','M','F',0,'15 Minutes') +INSERT INTO AD_Schedule (Frequency,AD_Client_ID,AD_Org_ID,AD_Schedule_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive,FrequencyType,ScheduleType,MonthDay,Name,Description) VALUES (15,0,0,200003,TO_TIMESTAMP('2012-09-20 19:39:24','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2012-09-20 19:39:24','YYYY-MM-DD HH24:MI:SS'),100,'Y','M','F',0,'15 Minutes','(do not delete, used in Initial Client Setup)') ; -- Sep 20, 2012 7:55:53 PM COT @@ -1559,6 +1585,106 @@ UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2012-09-24 15:50:11',' ALTER TABLE AD_Schedule ADD COLUMN IsIgnoreProcessingTime CHAR(1) DEFAULT 'N' CHECK (IsIgnoreProcessingTime IN ('Y','N')) ; +-- Sep 24, 2012 5:05:08 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,Description,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('IsSystemSchedule',200157,'D','IsSystemSchedule','Schedule Just For System','System Schedule','0fcff3a8-e3d4-4d54-a060-7aa225b329c6',0,TO_TIMESTAMP('2012-09-24 17:05:07','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-24 17:05:07','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Sep 24, 2012 5:05:08 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200157 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 24, 2012 5:06:10 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,DefaultValue,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200558,'D','N','N','N',0,'N',1,'N',20,'N','N',200157,'N','Y','f5b750f4-c9a7-4dfb-a4de-17f8431a1f47','N','Y','N','IsSystemSchedule','Schedule Just For System','N','IsSystemSchedule','Y',100,TO_TIMESTAMP('2012-09-24 17:06:09','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-24 17:06:09','YYYY-MM-DD HH24:MI:SS'),100,0,0) +; + +-- Sep 24, 2012 5:06:10 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200558 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Sep 24, 2012 5:06:23 PM COT +-- IDEMPIERE-391 Scheduler improvements +ALTER TABLE AD_Schedule ADD COLUMN IsSystemSchedule CHAR(1) DEFAULT 'N' CHECK (IsSystemSchedule IN ('Y','N')) +; + +/* Create schedule records for actual configuration */ +insert into ad_schedule (ad_schedule_id, ad_schedule_uu, ad_client_id, ad_org_id, frequencytype, frequency, weekday, scheduletype, isignoreprocessingtime, cronpattern +,created, createdby,description,isactive,runonlyonip,updated,updatedby,name,issystemschedule) +select distinct nextid( 200020 , 'N'), generate_uuid(), 0, 0, frequencytype, frequency, weekday, scheduletype, isignoreprocessingtime, cronpattern +,now(),100,null,'Y',null,now(),100,coalesce(frequencytype,' ')||' '||coalesce(frequency,-1)||' '||coalesce(scheduletype,' ')||' '||coalesce(cronpattern,' '),'N' +from ( +select distinct frequencytype, frequency, weekday, scheduletype, isignoreprocessingtime, cronpattern +from ad_scheduler +where not exists (select 1 from ad_schedule where +coalesce(ad_scheduler.frequencytype,' ') =coalesce(ad_schedule.frequencytype,' ') and +coalesce(ad_scheduler.frequency,-1) =coalesce(ad_schedule.frequency,-1) and +coalesce(ad_scheduler.weekday,' ') =coalesce(ad_schedule.weekday,' ') and +coalesce(ad_scheduler.scheduletype,' ') =coalesce(ad_schedule.scheduletype,' ') and +coalesce(ad_scheduler.isignoreprocessingtime,' ')=coalesce(ad_schedule.isignoreprocessingtime,' ') and +coalesce(ad_scheduler.cronpattern,' ') =coalesce(ad_schedule.cronpattern,' ') +) +) as x +; + +insert into ad_schedule (ad_schedule_id, ad_schedule_uu, ad_client_id, ad_org_id, frequencytype, frequency, scheduletype, isignoreprocessingtime +,created, createdby,description,isactive,runonlyonip,updated,updatedby,name,issystemschedule) +select distinct nextid( 200020 , 'N'), generate_uuid(), 0, 0, frequencytype, frequency, scheduletype, isignoreprocessingtime +,now(),100,null,'Y',null,now(),100,coalesce(frequencytype,' ')||' '||coalesce(frequency,-1)||' '||coalesce(scheduletype,' '),'N' +from ( +select distinct frequencytype, frequency, 'F' as scheduletype, 'Y' as isignoreprocessingtime +from c_acctprocessor +where not exists (select 1 from ad_schedule where +coalesce(c_acctprocessor.frequencytype,' ') =coalesce(ad_schedule.frequencytype,' ') and +coalesce(c_acctprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1) +) +) as x +; + +insert into ad_schedule (ad_schedule_id, ad_schedule_uu, ad_client_id, ad_org_id, frequencytype, frequency, scheduletype, isignoreprocessingtime +,created, createdby,description,isactive,runonlyonip,updated,updatedby,name,issystemschedule) +select distinct nextid( 200020 , 'N'), generate_uuid(), 0, 0, frequencytype, frequency, scheduletype, isignoreprocessingtime +,now(),100,null,'Y',null,now(),100,coalesce(frequencytype,' ')||' '||coalesce(frequency,-1)||' '||coalesce(scheduletype,' '),'N' +from ( +select distinct frequencytype, frequency, 'F' as scheduletype, 'Y' as isignoreprocessingtime +from ad_alertprocessor +where not exists (select 1 from ad_schedule where +coalesce(ad_alertprocessor.frequencytype,' ') =coalesce(ad_schedule.frequencytype,' ') and +coalesce(ad_alertprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1) +) +) as x +; + +insert into ad_schedule (ad_schedule_id, ad_schedule_uu, ad_client_id, ad_org_id, frequencytype, frequency, scheduletype, isignoreprocessingtime +,created, createdby,description,isactive,runonlyonip,updated,updatedby,name,issystemschedule) +select distinct nextid( 200020 , 'N'), generate_uuid(), 0, 0, frequencytype, frequency, scheduletype, isignoreprocessingtime +,now(),100,null,'Y',null,now(),100,coalesce(frequencytype,' ')||' '||coalesce(frequency,-1)||' '||coalesce(scheduletype,' '),'N' +from ( +select distinct frequencytype, frequency, 'F' as scheduletype, 'Y' as isignoreprocessingtime +from r_requestprocessor +where not exists (select 1 from ad_schedule where +coalesce(r_requestprocessor.frequencytype,' ') =coalesce(ad_schedule.frequencytype,' ') and +coalesce(r_requestprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1) +) +) as x +; + +insert into ad_schedule (ad_schedule_id, ad_schedule_uu, ad_client_id, ad_org_id, frequencytype, frequency, scheduletype, isignoreprocessingtime +,created, createdby,description,isactive,runonlyonip,updated,updatedby,name,issystemschedule) +select distinct nextid( 200020 , 'N'), generate_uuid(), 0, 0, frequencytype, frequency, scheduletype, isignoreprocessingtime +,now(),100,null,'Y',null,now(),100,coalesce(frequencytype,' ')||' '||coalesce(frequency,-1)||' '||coalesce(scheduletype,' '),'N' +from ( +select distinct frequencytype, frequency, 'F' as scheduletype, 'Y' as isignoreprocessingtime +from ad_workflowprocessor +where not exists (select 1 from ad_schedule where +coalesce(ad_workflowprocessor.frequencytype,' ') =coalesce(ad_schedule.frequencytype,' ') and +coalesce(ad_workflowprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1) +) +) as x +; + -- Sep 24, 2012 3:50:36 PM COT -- IDEMPIERE-391 Scheduler improvements UPDATE AD_Table SET AD_Window_ID=200012,Updated=TO_TIMESTAMP('2012-09-24 15:50:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=200020 @@ -1589,31 +1715,6 @@ UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-24 15:51:17','YY UPDATE AD_Field SET IsDisplayed='N', IsActive='N',Updated=TO_TIMESTAMP('2012-09-24 15:52:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58773 ; --- Sep 24, 2012 5:05:08 PM COT --- IDEMPIERE-391 Scheduler improvements -INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,Description,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('IsSystemSchedule',200157,'D','IsSystemSchedule','Schedule Just For System','System Schedule','0fcff3a8-e3d4-4d54-a060-7aa225b329c6',0,TO_TIMESTAMP('2012-09-24 17:05:07','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-24 17:05:07','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') -; - --- Sep 24, 2012 5:05:08 PM COT --- IDEMPIERE-391 Scheduler improvements -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200157 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) -; - --- Sep 24, 2012 5:06:10 PM COT --- IDEMPIERE-391 Scheduler improvements -INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,DefaultValue,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,200020,200558,'D','N','N','N',0,'N',1,'N',20,'N','N',200157,'N','Y','f5b750f4-c9a7-4dfb-a4de-17f8431a1f47','N','Y','N','IsSystemSchedule','Schedule Just For System','N','IsSystemSchedule','Y',100,TO_TIMESTAMP('2012-09-24 17:06:09','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-24 17:06:09','YYYY-MM-DD HH24:MI:SS'),100,0,0) -; - --- Sep 24, 2012 5:06:10 PM COT --- IDEMPIERE-391 Scheduler improvements -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200558 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) -; - --- Sep 24, 2012 5:06:23 PM COT --- IDEMPIERE-391 Scheduler improvements -ALTER TABLE AD_Schedule ADD COLUMN IsSystemSchedule CHAR(1) DEFAULT 'N' CHECK (IsSystemSchedule IN ('Y','N')) -; - -- Sep 24, 2012 5:06:51 PM COT -- IDEMPIERE-391 Scheduler improvements INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',200019,1,'N','N',200558,'Y',200553,'N','D','Schedule Just For System','IsSystemSchedule','Y','N','1a29d07e-df06-4d49-bab4-733c0f547714',100,0,TO_TIMESTAMP('2012-09-24 17:06:50','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-24 17:06:50','YYYY-MM-DD HH24:MI:SS'),'Y') @@ -1665,165 +1766,514 @@ UPDATE AD_Column SET AD_Val_Rule_ID=200007,Updated=TO_TIMESTAMP('2012-09-24 17:5 ; -- Sep 27, 2012 10:19:28 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2012-09-27 10:19:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11348 ; -- Sep 27, 2012 10:19:30 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO t_alter_column values('c_acctprocessor','Frequency','NUMERIC(10)',null,'NULL') ; -- Sep 27, 2012 10:19:30 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO t_alter_column values('c_acctprocessor','Frequency',null,'NULL',null) ; -- Sep 27, 2012 11:05:06 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-27 11:05:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11348 ; -- Sep 27, 2012 11:36:59 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2012-09-27 11:36:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11441 ; -- Sep 27, 2012 11:37:05 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO t_alter_column values('ad_alertprocessor','Frequency','NUMERIC(10)',null,'NULL') ; -- Sep 27, 2012 11:37:18 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-27 11:37:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11441 ; -- Sep 27, 2012 11:37:24 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2012-09-27 11:37:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11440 ; -- Sep 27, 2012 11:37:28 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO t_alter_column values('ad_alertprocessor','FrequencyType','CHAR(1)',null,'NULL') ; -- Sep 27, 2012 11:37:34 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-27 11:37:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11440 ; -- Sep 27, 2012 11:38:29 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2012-09-27 11:38:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5480 ; -- Sep 27, 2012 11:38:33 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO t_alter_column values('r_requestprocessor','Frequency','NUMERIC(10)',null,'1') ; -- Sep 27, 2012 11:38:33 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO t_alter_column values('r_requestprocessor','Frequency',null,'NULL',null) ; -- Sep 27, 2012 11:38:38 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-27 11:38:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5480 ; -- Sep 27, 2012 11:38:45 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2012-09-27 11:38:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5481 ; -- Sep 27, 2012 11:38:49 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO t_alter_column values('r_requestprocessor','FrequencyType','CHAR(1)',null,'NULL') ; -- Sep 27, 2012 11:38:50 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO t_alter_column values('r_requestprocessor','FrequencyType',null,'NULL',null) ; -- Sep 27, 2012 11:38:55 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-27 11:38:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5481 ; -- Sep 27, 2012 11:39:55 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2012-09-27 11:39:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11391 ; -- Sep 27, 2012 11:39:56 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO t_alter_column values('ad_workflowprocessor','Frequency','NUMERIC(10)',null,'NULL') ; -- Sep 27, 2012 11:39:56 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO t_alter_column values('ad_workflowprocessor','Frequency',null,'NULL',null) ; -- Sep 27, 2012 11:40:03 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-27 11:40:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11391 ; -- Sep 27, 2012 11:40:11 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsMandatory='N', IsActive='N',Updated=TO_TIMESTAMP('2012-09-27 11:40:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11382 ; -- Sep 27, 2012 11:45:45 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2012-09-27 11:45:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11247 ; -- Sep 27, 2012 11:45:49 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO t_alter_column values('ad_scheduler','Frequency','NUMERIC(10)',null,'NULL') ; -- Sep 27, 2012 11:45:49 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO t_alter_column values('ad_scheduler','Frequency',null,'NULL',null) ; -- Sep 27, 2012 11:45:55 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-27 11:45:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11247 ; -- Sep 27, 2012 11:46:03 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2012-09-27 11:46:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11255 ; -- Sep 27, 2012 11:46:05 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO t_alter_column values('ad_scheduler','FrequencyType','CHAR(1)',null,'NULL') ; -- Sep 27, 2012 11:46:05 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO t_alter_column values('ad_scheduler','FrequencyType',null,'NULL',null) ; -- Sep 27, 2012 11:46:10 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-27 11:46:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11255 ; -- Sep 27, 2012 11:49:52 AM COT --- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Window SET WindowType='M',Updated=TO_TIMESTAMP('2012-09-27 11:49:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID=200012 ; +-- Sep 28, 2012 5:38:59 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Table SET Name='Schedule',Updated=TO_TIMESTAMP('2012-09-28 17:38:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Table_ID=200020 +; + +-- Sep 28, 2012 5:38:59 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Table_Trl SET IsTranslated='N' WHERE AD_Table_ID=200020 +; + +-- Sep 28, 2012 5:42:10 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('RunOnlyOnIP',200159,'D','Run only on IP','Run only on IP','090ed7f1-67f7-4d25-ac6b-c4de976b732b',0,TO_TIMESTAMP('2012-09-28 17:42:09','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-28 17:42:09','YYYY-MM-DD HH24:MI:SS'),0,0,0,'Y') +; + +-- Sep 28, 2012 5:42:10 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200159 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Sep 28, 2012 5:42:18 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET AD_Element_ID=200159, ColumnName='RunOnlyOnIP', Description=NULL, Help=NULL, Name='Run only on IP',Updated=TO_TIMESTAMP('2012-09-28 17:42:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=200486 +; + +-- Sep 28, 2012 5:42:18 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column_Trl SET IsTranslated='N' WHERE AD_Column_ID=200486 +; + +-- Sep 28, 2012 5:42:18 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET Name='Run only on IP', Description=NULL, Help=NULL WHERE AD_Column_ID=200486 AND IsCentrallyMaintained='Y' +; + +CREATE UNIQUE INDEX ad_schedule_uu_idx ON ad_schedule (ad_schedule_uu) +; + +-- Sep 28, 2012 6:21:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Element SET Name='System Schedule',Updated=TO_TIMESTAMP('2012-09-28 18:21:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=200157 +; + +-- Sep 28, 2012 6:21:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=200157 +; + +-- Sep 28, 2012 6:21:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET ColumnName='IsSystemSchedule', Name='System Schedule', Description='Schedule Just For System', Help=NULL WHERE AD_Element_ID=200157 +; + +-- Sep 28, 2012 6:21:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Process_Para SET ColumnName='IsSystemSchedule', Name='System Schedule', Description='Schedule Just For System', Help=NULL, AD_Element_ID=200157 WHERE UPPER(ColumnName)='ISSYSTEMSCHEDULE' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL +; + +-- Sep 28, 2012 6:21:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Process_Para SET ColumnName='IsSystemSchedule', Name='System Schedule', Description='Schedule Just For System', Help=NULL WHERE AD_Element_ID=200157 AND IsCentrallyMaintained='Y' +; + +-- Sep 28, 2012 6:21:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET Name='System Schedule', Description='Schedule Just For System', Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=200157) AND IsCentrallyMaintained='Y' +; + +-- Sep 28, 2012 6:21:19 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_PrintFormatItem SET PrintName='System Schedule', Name='System Schedule' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=AD_PrintFormatItem.AD_Column_ID AND c.AD_Element_ID=200157) +; + +-- Sep 28, 2012 6:22:28 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsMandatory='Y', FieldLength=60, IsUpdateable='Y',Updated=TO_TIMESTAMP('2012-09-28 18:22:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200487 +; + +-- Sep 28, 2012 6:22:53 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Schedule SET Name='2 Hours',Updated=TO_TIMESTAMP('2012-09-28 18:22:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Schedule_ID=200004 +; + +-- Sep 28, 2012 6:23:11 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO t_alter_column values('ad_schedule','Name','VARCHAR(60)',null,null) +; + +-- Sep 28, 2012 6:23:11 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO t_alter_column values('ad_schedule','Name',null,'NOT NULL',null) +; + +-- Sep 28, 2012 6:26:22 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsIdentifier='N', SeqNo=0, IsUpdateable='N',Updated=TO_TIMESTAMP('2012-09-28 18:26:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200473 +; + +-- Sep 28, 2012 6:26:38 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET SeqNo=1,Updated=TO_TIMESTAMP('2012-09-28 18:26:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200487 +; + +-- Sep 28, 2012 6:26:53 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET SeqNoSelection=1,Updated=TO_TIMESTAMP('2012-09-28 18:26:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200487 +; + +-- Sep 28, 2012 6:28:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsMandatory='Y',Updated=TO_TIMESTAMP('2012-09-28 18:28:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200557 +; + +-- Sep 28, 2012 6:28:30 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO t_alter_column values('ad_schedule','IsIgnoreProcessingTime','CHAR(1)',null,'N') +; + +-- Sep 28, 2012 6:28:31 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Schedule SET IsIgnoreProcessingTime='N' WHERE IsIgnoreProcessingTime IS NULL +; + +-- Sep 28, 2012 6:28:31 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO t_alter_column values('ad_schedule','IsIgnoreProcessingTime',null,'NOT NULL',null) +; + +-- Sep 28, 2012 6:28:42 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsMandatory='Y',Updated=TO_TIMESTAMP('2012-09-28 18:28:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200558 +; + +-- Sep 28, 2012 6:28:48 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO t_alter_column values('ad_schedule','IsSystemSchedule','CHAR(1)',null,'N') +; + +-- Sep 28, 2012 6:28:48 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Schedule SET IsSystemSchedule='N' WHERE IsSystemSchedule IS NULL +; + +-- Sep 28, 2012 6:28:48 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO t_alter_column values('ad_schedule','IsSystemSchedule',null,'NOT NULL',null) +; + +-- ?? MIGRATE ACTUAL DATA + + +-- Sep 28, 2012 6:30:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Element SET Name='Schedule',Updated=TO_TIMESTAMP('2012-09-28 18:30:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=200132 +; + +-- Sep 28, 2012 6:30:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=200132 +; + +-- Sep 28, 2012 6:30:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET ColumnName='AD_Schedule_ID', Name='Schedule', Description=NULL, Help=NULL WHERE AD_Element_ID=200132 +; + +-- Sep 28, 2012 6:30:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Process_Para SET ColumnName='AD_Schedule_ID', Name='Schedule', Description=NULL, Help=NULL, AD_Element_ID=200132 WHERE UPPER(ColumnName)='AD_SCHEDULE_ID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL +; + +-- Sep 28, 2012 6:30:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Process_Para SET ColumnName='AD_Schedule_ID', Name='Schedule', Description=NULL, Help=NULL WHERE AD_Element_ID=200132 AND IsCentrallyMaintained='Y' +; + +-- Sep 28, 2012 6:30:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Field SET Name='Schedule', Description=NULL, Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=200132) AND IsCentrallyMaintained='Y' +; + +-- Sep 28, 2012 6:30:44 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_PrintFormatItem SET PrintName='Schedule', Name='Schedule' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=AD_PrintFormatItem.AD_Column_ID AND c.AD_Element_ID=200132) +; + +-- Sep 28, 2012 6:32:24 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Scheduler SET Record_ID=NULL, AD_Schedule_ID=200001,Updated=TO_TIMESTAMP('2012-09-28 18:32:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Scheduler_ID=100 +; + +-- Sep 28, 2012 6:34:29 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsMandatory='Y',Updated=TO_TIMESTAMP('2012-09-28 18:34:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200491 +; + +/* Set schedules for actual records before making them mandatory */ +update ad_scheduler set ad_schedule_id=(select min(ad_schedule_id) from ad_schedule where +coalesce(ad_scheduler.frequencytype,' ') =coalesce(ad_schedule.frequencytype,' ') and +coalesce(ad_scheduler.frequency,-1) =coalesce(ad_schedule.frequency,-1) and +coalesce(ad_scheduler.weekday,' ') =coalesce(ad_schedule.weekday,' ') and +coalesce(ad_scheduler.scheduletype,' ') =coalesce(ad_schedule.scheduletype,' ') and +coalesce(ad_scheduler.isignoreprocessingtime,' ')=coalesce(ad_schedule.isignoreprocessingtime,' ') and +coalesce(ad_scheduler.cronpattern,' ') =coalesce(ad_schedule.cronpattern,' ')) +; + +update c_acctprocessor set ad_schedule_id=(select min(ad_schedule_id) from ad_schedule where +coalesce(c_acctprocessor.frequencytype,' ')=coalesce(ad_schedule.frequencytype,' ') and +coalesce(c_acctprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1) and +ad_schedule.scheduletype='F') +; + +update ad_alertprocessor set ad_schedule_id=(select min(ad_schedule_id) from ad_schedule where +coalesce(ad_alertprocessor.frequencytype,' ')=coalesce(ad_schedule.frequencytype,' ') and +coalesce(ad_alertprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1) and +ad_schedule.scheduletype='F') +; + +update ad_workflowprocessor set ad_schedule_id=(select min(ad_schedule_id) from ad_schedule where +coalesce(ad_workflowprocessor.frequencytype,' ')=coalesce(ad_schedule.frequencytype,' ') and +coalesce(ad_workflowprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1) and +ad_schedule.scheduletype='F') +; + +update r_requestprocessor set ad_schedule_id=(select min(ad_schedule_id) from ad_schedule where +coalesce(r_requestprocessor.frequencytype,' ')=coalesce(ad_schedule.frequencytype,' ') and +coalesce(r_requestprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1) and +ad_schedule.scheduletype='F') +; + +-- Sep 28, 2012 6:34:33 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO t_alter_column values('ad_alertprocessor','AD_Schedule_ID','NUMERIC(10)',null,null) +; + +-- Sep 28, 2012 6:34:33 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO t_alter_column values('ad_alertprocessor','AD_Schedule_ID',null,'NOT NULL',null) +; + +-- Sep 28, 2012 6:34:50 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsMandatory='Y',Updated=TO_TIMESTAMP('2012-09-28 18:34:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200489 +; + +-- Sep 28, 2012 6:34:52 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO t_alter_column values('ad_scheduler','AD_Schedule_ID','NUMERIC(10)',null,null) +; + +-- Sep 28, 2012 6:34:52 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO t_alter_column values('ad_scheduler','AD_Schedule_ID',null,'NOT NULL',null) +; + +-- Sep 28, 2012 6:35:38 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_WorkflowProcessor SET AD_Schedule_ID=200004,Updated=TO_TIMESTAMP('2012-09-28 18:35:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_WorkflowProcessor_ID=100 +; + +-- Sep 28, 2012 6:36:15 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsMandatory='Y',Updated=TO_TIMESTAMP('2012-09-28 18:36:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200493 +; + +-- Sep 28, 2012 6:36:16 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO t_alter_column values('ad_workflowprocessor','AD_Schedule_ID','NUMERIC(10)',null,null) +; + +-- Sep 28, 2012 6:36:16 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO t_alter_column values('ad_workflowprocessor','AD_Schedule_ID',null,'NOT NULL',null) +; + +-- Sep 28, 2012 6:37:32 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE C_AcctProcessor SET AD_Schedule_ID=200002,Updated=TO_TIMESTAMP('2012-09-28 18:37:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE C_AcctProcessor_ID=100 +; + +-- Sep 28, 2012 6:38:02 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE R_RequestProcessor SET AD_Schedule_ID=200003,Updated=TO_TIMESTAMP('2012-09-28 18:38:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE R_RequestProcessor_ID=100 +; + +-- Sep 28, 2012 6:38:36 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsMandatory='Y',Updated=TO_TIMESTAMP('2012-09-28 18:38:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200490 +; + +-- Sep 28, 2012 6:38:37 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO t_alter_column values('c_acctprocessor','AD_Schedule_ID','NUMERIC(10)',null,null) +; + +-- Sep 28, 2012 6:38:37 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO t_alter_column values('c_acctprocessor','AD_Schedule_ID',null,'NOT NULL',null) +; + +-- Sep 28, 2012 6:39:50 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET IsMandatory='Y',Updated=TO_TIMESTAMP('2012-09-28 18:39:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200492 +; + +-- Sep 28, 2012 6:39:52 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO t_alter_column values('r_requestprocessor','AD_Schedule_ID','NUMERIC(10)',null,null) +; + +-- Sep 28, 2012 6:39:52 PM COT +-- IDEMPIERE-391 Scheduler improvements +INSERT INTO t_alter_column values('r_requestprocessor','AD_Schedule_ID',null,'NOT NULL',null) +; + +-- Sep 28, 2012 6:47:43 PM COT +-- IDEMPIERE-391 Scheduler improvements +UPDATE AD_Column SET AD_Val_Rule_ID=200007,Updated=TO_TIMESTAMP('2012-09-28 18:47:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200489 +; + +-- Oct 2, 2012 8:02:11 PM COT +UPDATE AD_Field SET DisplayLogic='@ScheduleType@=F',Updated=TO_TIMESTAMP('2012-10-02 20:02:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200495 +; + +-- Oct 2, 2012 8:06:14 PM COT +UPDATE AD_Element SET Help='Cron pattern to define when the process should be invoked. See http://www.sauronsoftware.it/projects/cron4j/api/it/sauronsoftware/cron4j/SchedulingPattern.html',Updated=TO_TIMESTAMP('2012-10-02 20:06:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=54124 +; + +-- Oct 2, 2012 8:06:14 PM COT +UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=54124 +; + +-- Oct 2, 2012 8:06:14 PM COT +UPDATE AD_Column SET ColumnName='CronPattern', Name='Cron Scheduling Pattern', Description='Cron pattern to define when the process should be invoked.', Help='Cron pattern to define when the process should be invoked. See http://www.sauronsoftware.it/projects/cron4j/api/it/sauronsoftware/cron4j/SchedulingPattern.html' WHERE AD_Element_ID=54124 +; + +-- Oct 2, 2012 8:06:14 PM COT +UPDATE AD_Process_Para SET ColumnName='CronPattern', Name='Cron Scheduling Pattern', Description='Cron pattern to define when the process should be invoked.', Help='Cron pattern to define when the process should be invoked. See http://www.sauronsoftware.it/projects/cron4j/api/it/sauronsoftware/cron4j/SchedulingPattern.html', AD_Element_ID=54124 WHERE UPPER(ColumnName)='CRONPATTERN' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL +; + +-- Oct 2, 2012 8:06:14 PM COT +UPDATE AD_Process_Para SET ColumnName='CronPattern', Name='Cron Scheduling Pattern', Description='Cron pattern to define when the process should be invoked.', Help='Cron pattern to define when the process should be invoked. See http://www.sauronsoftware.it/projects/cron4j/api/it/sauronsoftware/cron4j/SchedulingPattern.html' WHERE AD_Element_ID=54124 AND IsCentrallyMaintained='Y' +; + +-- Oct 2, 2012 8:06:14 PM COT +UPDATE AD_Field SET Name='Cron Scheduling Pattern', Description='Cron pattern to define when the process should be invoked.', Help='Cron pattern to define when the process should be invoked. See http://www.sauronsoftware.it/projects/cron4j/api/it/sauronsoftware/cron4j/SchedulingPattern.html' WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=54124) AND IsCentrallyMaintained='Y' +; + +ALTER TABLE C_AcctProcessor ALTER FrequencyType DROP NOT NULL +; + +ALTER TABLE C_AcctProcessor ALTER Frequency DROP NOT NULL +; + +ALTER TABLE AD_AlertProcessor ALTER FrequencyType DROP NOT NULL +; + +ALTER TABLE AD_AlertProcessor ALTER Frequency DROP NOT NULL +; + +ALTER TABLE R_RequestProcessor ALTER FrequencyType DROP NOT NULL +; + +ALTER TABLE R_RequestProcessor ALTER Frequency DROP NOT NULL +; + +ALTER TABLE AD_Scheduler ALTER FrequencyType DROP NOT NULL +; + +ALTER TABLE AD_Scheduler ALTER Frequency DROP NOT NULL +; + +ALTER TABLE AD_WorkflowProcessor ALTER FrequencyType DROP NOT NULL +; + +ALTER TABLE AD_WorkflowProcessor ALTER Frequency DROP NOT NULL +; + +-- Oct 2, 2012 10:44:20 PM COT +UPDATE AD_Field SET IsDisplayed='N',Updated=TO_TIMESTAMP('2012-10-02 22:44:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=9434 +; SELECT register_migration_script('912_IDEMPIERE-391.sql') FROM dual ; diff --git a/org.adempiere.base/src/org/compiere/model/AdempiereProcessor.java b/org.adempiere.base/src/org/compiere/model/AdempiereProcessor.java index 0716817304..1583e8fa20 100644 --- a/org.adempiere.base/src/org/compiere/model/AdempiereProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/AdempiereProcessor.java @@ -59,6 +59,18 @@ public interface AdempiereProcessor */ public String getFrequencyType(); + /** + * Get the schedule type + * @return schedule type + */ + public String getScheduleType(); + + /** + * Get the cron pattern + * @return cron pattern + */ + public String getCronPattern(); + /** * Get the frequency * @return frequency diff --git a/org.adempiere.base/src/org/compiere/model/I_AD_Schedule.java b/org.adempiere.base/src/org/compiere/model/I_AD_Schedule.java index efbd4426b3..a182a4afe1 100644 --- a/org.adempiere.base/src/org/compiere/model/I_AD_Schedule.java +++ b/org.adempiere.base/src/org/compiere/model/I_AD_Schedule.java @@ -71,6 +71,15 @@ public interface I_AD_Schedule /** Get AD_Schedule_ID */ public int getAD_Schedule_ID(); + /** Column name AD_Schedule_UU */ + public static final String COLUMNNAME_AD_Schedule_UU = "AD_Schedule_UU"; + + /** Set AD_Schedule_UU */ + public void setAD_Schedule_UU (String AD_Schedule_UU); + + /** Get AD_Schedule_UU */ + public String getAD_Schedule_UU(); + /** Column name Created */ public static final String COLUMNNAME_Created = "Created"; @@ -165,6 +174,19 @@ public interface I_AD_Schedule */ public boolean isIgnoreProcessingTime(); + /** Column name IsSystemSchedule */ + public static final String COLUMNNAME_IsSystemSchedule = "IsSystemSchedule"; + + /** Set IsSystemSchedule. + * Schedule Just For System + */ + public void setIsSystemSchedule (boolean IsSystemSchedule); + + /** Get IsSystemSchedule. + * Schedule Just For System + */ + public boolean isSystemSchedule(); + /** Column name MonthDay */ public static final String COLUMNNAME_MonthDay = "MonthDay"; @@ -194,14 +216,10 @@ public interface I_AD_Schedule /** Column name RunOnlyOnIP */ public static final String COLUMNNAME_RunOnlyOnIP = "RunOnlyOnIP"; - /** Set RunOnlyOnIP. - * Defines the IP address to transfer data to - */ + /** Set Run only on IP */ public void setRunOnlyOnIP (String RunOnlyOnIP); - /** Get RunOnlyOnIP. - * Defines the IP address to transfer data to - */ + /** Get Run only on IP */ public String getRunOnlyOnIP(); /** Column name ScheduleType */ diff --git a/org.adempiere.base/src/org/compiere/model/MAcctProcessor.java b/org.adempiere.base/src/org/compiere/model/MAcctProcessor.java index 49dc20919a..6ad2e59ef6 100644 --- a/org.adempiere.base/src/org/compiere/model/MAcctProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/MAcctProcessor.java @@ -37,12 +37,10 @@ import org.compiere.util.Msg; public class MAcctProcessor extends X_C_AcctProcessor implements AdempiereProcessor, AdempiereProcessor2 { - - /** * */ - private static final long serialVersionUID = -7574845047521861399L; + private static final long serialVersionUID = -4760475718973777369L; /** * Get Active @@ -102,8 +100,23 @@ public class MAcctProcessor extends X_C_AcctProcessor setSupervisor_ID (Supervisor_ID); } // MAcctProcessor - - + /** + * Before Save + * @param newRecord new + * @return true + */ + @Override + protected boolean beforeSave(boolean newRecord) + { + if (newRecord || is_ValueChanged("AD_Schedule_ID")) { + long nextWork = MSchedule.getNextRunMS(System.currentTimeMillis(), getScheduleType(), getFrequencyType(), getFrequency(), getCronPattern()); + if (nextWork > 0) + setDateNextRun(new Timestamp(nextWork)); + } + + return true; + } // beforeSave + /** * Get Server ID * @return id @@ -155,33 +168,29 @@ public class MAcctProcessor extends X_C_AcctProcessor return no; } // deleteLog - @Override public String getFrequencyType() { - int AD_Schedule_ID = this.getAD_Schedule_ID(); - if( AD_Schedule_ID > 0) - { - MSchedule schedule=MSchedule.get(getCtx(), AD_Schedule_ID); - return schedule.getFrequencyType(); - } - return ""; + return MSchedule.get(getCtx(),getAD_Schedule_ID()).getFrequencyType(); } @Override public int getFrequency() { - int AD_Schedule_ID = this.getAD_Schedule_ID(); - if( AD_Schedule_ID > 0) - { - MSchedule schedule=MSchedule.get(getCtx(),AD_Schedule_ID); - return schedule.getFrequency(); - } - return 0; + return MSchedule.get(getCtx(),getAD_Schedule_ID()).getFrequency(); } @Override public boolean isIgnoreProcessingTime() { - MSchedule schedule=MSchedule.get(getCtx(),getAD_Schedule_ID()); - return schedule.isIgnoreProcessingTime(); + return MSchedule.get(getCtx(),getAD_Schedule_ID()).isIgnoreProcessingTime(); + } + + @Override + public String getScheduleType() { + return MSchedule.get(getCtx(),getAD_Schedule_ID()).getScheduleType(); + } + + @Override + public String getCronPattern() { + return MSchedule.get(getCtx(),getAD_Schedule_ID()).getCronPattern(); } } // MAcctProcessor diff --git a/org.adempiere.base/src/org/compiere/model/MAlertProcessor.java b/org.adempiere.base/src/org/compiere/model/MAlertProcessor.java index 01e2c925f3..3c261470d0 100644 --- a/org.adempiere.base/src/org/compiere/model/MAlertProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/MAlertProcessor.java @@ -38,8 +38,7 @@ public class MAlertProcessor extends X_AD_AlertProcessor /** * */ - private static final long serialVersionUID = 9060358751064718910L; - + private static final long serialVersionUID = -6566030540146374829L; /** * Get Active @@ -162,22 +161,46 @@ public class MAlertProcessor extends X_AD_AlertProcessor return alerts; } // getAlerts + /** + * Before Save + * @param newRecord new + * @return true + */ @Override - public int getFrequency() { - MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID()); - return schedule.getFrequency(); - } + protected boolean beforeSave(boolean newRecord) + { + if (newRecord || is_ValueChanged("AD_Schedule_ID")) { + long nextWork = MSchedule.getNextRunMS(System.currentTimeMillis(), getScheduleType(), getFrequencyType(), getFrequency(), getCronPattern()); + if (nextWork > 0) + setDateNextRun(new Timestamp(nextWork)); + } + + return true; + } // beforeSave @Override public String getFrequencyType() { - MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID()); - return schedule.getFrequencyType(); + return MSchedule.get(getCtx(),getAD_Schedule_ID()).getFrequencyType(); + } + + @Override + public int getFrequency() { + return MSchedule.get(getCtx(),getAD_Schedule_ID()).getFrequency(); } @Override public boolean isIgnoreProcessingTime() { - MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID()); - return schedule.isIgnoreProcessingTime(); + return MSchedule.get(getCtx(),getAD_Schedule_ID()).isIgnoreProcessingTime(); + } + + @Override + public String getScheduleType() { + return MSchedule.get(getCtx(),getAD_Schedule_ID()).getScheduleType(); + } + + @Override + public String getCronPattern() { + return MSchedule.get(getCtx(),getAD_Schedule_ID()).getCronPattern(); } } // MAlertProcessor diff --git a/org.adempiere.base/src/org/compiere/model/MIMPProcessor.java b/org.adempiere.base/src/org/compiere/model/MIMPProcessor.java index 7e33c21f5e..87eb9ec3ff 100644 --- a/org.adempiere.base/src/org/compiere/model/MIMPProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/MIMPProcessor.java @@ -50,8 +50,8 @@ public class MIMPProcessor /** * */ - private static final long serialVersionUID = 8634765494025824138L; - /** Static Logger */ + private static final long serialVersionUID = 4477942100661801354L; + private static CLogger s_log = CLogger.getCLogger (MIMPProcessor.class); public MIMPProcessor(Properties ctx, @@ -215,5 +215,15 @@ public class MIMPProcessor list.toArray(retValue); return retValue; } // getActive + + @Override + public String getScheduleType() { + return MSchedule.SCHEDULETYPE_Frequency; + } + @Override + public String getCronPattern() { + return null; + } + } diff --git a/org.adempiere.base/src/org/compiere/model/MLdapProcessor.java b/org.adempiere.base/src/org/compiere/model/MLdapProcessor.java index 7eab3fdc9f..8e1ccf1d15 100755 --- a/org.adempiere.base/src/org/compiere/model/MLdapProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/MLdapProcessor.java @@ -39,7 +39,7 @@ public class MLdapProcessor extends X_AD_LdapProcessor implements AdempiereProce /** * */ - private static final long serialVersionUID = 7577593682255409240L; + private static final long serialVersionUID = -1477519989047580644L; /** * Get Active LDAP Server @@ -525,4 +525,14 @@ public class MLdapProcessor extends X_AD_LdapProcessor implements AdempiereProce access.save (); } // logAccess + @Override + public String getScheduleType() { + return MSchedule.SCHEDULETYPE_Frequency; + } + + @Override + public String getCronPattern() { + return null; + } + } // MLdapProcessor diff --git a/org.adempiere.base/src/org/compiere/model/MRequestProcessor.java b/org.adempiere.base/src/org/compiere/model/MRequestProcessor.java index 1a637a7b55..30364ebd50 100644 --- a/org.adempiere.base/src/org/compiere/model/MRequestProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/MRequestProcessor.java @@ -39,8 +39,7 @@ public class MRequestProcessor extends X_R_RequestProcessor /** * */ - private static final long serialVersionUID = -3149710397208186523L; - + private static final long serialVersionUID = 8231854734466233461L; /** * Get Active Request Processors @@ -256,22 +255,46 @@ public class MRequestProcessor extends X_R_RequestProcessor return "RequestProcessor" + get_ID(); } // getServerID + /** + * Before Save + * @param newRecord new + * @return true + */ + @Override + protected boolean beforeSave(boolean newRecord) + { + if (newRecord || is_ValueChanged("AD_Schedule_ID")) { + long nextWork = MSchedule.getNextRunMS(System.currentTimeMillis(), getScheduleType(), getFrequencyType(), getFrequency(), getCronPattern()); + if (nextWork > 0) + setDateNextRun(new Timestamp(nextWork)); + } + + return true; + } // beforeSave + @Override public String getFrequencyType() { - MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID()); - return schedule.getFrequencyType(); + return MSchedule.get(getCtx(),getAD_Schedule_ID()).getFrequencyType(); } @Override public int getFrequency() { - MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID()); - return schedule.getFrequency(); + return MSchedule.get(getCtx(),getAD_Schedule_ID()).getFrequency(); } @Override public boolean isIgnoreProcessingTime() { - MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID()); - return schedule.isIgnoreProcessingTime(); + return MSchedule.get(getCtx(),getAD_Schedule_ID()).isIgnoreProcessingTime(); } - + + @Override + public String getScheduleType() { + return MSchedule.get(getCtx(),getAD_Schedule_ID()).getScheduleType(); + } + + @Override + public String getCronPattern() { + return MSchedule.get(getCtx(),getAD_Schedule_ID()).getCronPattern(); + } + } // MRequestProcessor diff --git a/org.adempiere.base/src/org/compiere/model/MSchedule.java b/org.adempiere.base/src/org/compiere/model/MSchedule.java index 5bc05e0374..26a7172983 100644 --- a/org.adempiere.base/src/org/compiere/model/MSchedule.java +++ b/org.adempiere.base/src/org/compiere/model/MSchedule.java @@ -22,9 +22,6 @@ import it.sauronsoftware.cron4j.SchedulingPattern; import java.net.InetAddress; import java.sql.ResultSet; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Calendar; import java.util.Properties; import java.util.StringTokenizer; import java.util.logging.Level; @@ -32,24 +29,20 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; -import org.compiere.util.DisplayType; +import org.compiere.util.CCache; public class MSchedule extends X_AD_Schedule { - /** * */ - private static final long serialVersionUID = 2532063246191430056L; - + private static final long serialVersionUID = -3319184522988847237L; + private static Pattern VALID_IPV4_PATTERN = null; private static Pattern VALID_IPV6_PATTERN = null; private static final String ipv4Pattern = "(([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.){3}([01]?\\d\\d?|2[0-4]\\d|25[0-5])"; private static final String ipv6Pattern = "([0-9a-f]{1,4}:){7}([0-9a-f]){1,4}"; - private it.sauronsoftware.cron4j.Scheduler cronScheduler; - private Predictor predictor; - public MSchedule(Properties ctx, int AD_Schedule_ID, String trxName) { super(ctx, AD_Schedule_ID, trxName); // TODO Auto-generated constructor stub @@ -60,8 +53,8 @@ public class MSchedule extends X_AD_Schedule // TODO Auto-generated constructor stub } - protected boolean beforeSave() - { + @Override + protected boolean beforeSave(boolean newRecord) { // Set Schedule Type & Frequencies if (SCHEDULETYPE_Frequency.equals(getScheduleType())) { @@ -85,10 +78,7 @@ public class MSchedule extends X_AD_Schedule } return true; } - - - - + /** * Brought from Compiere Open Source Community version 3.3.0 * Is it OK to Run process On IP of this box @@ -123,7 +113,7 @@ public class MSchedule extends X_AD_Schedule { InetAddress box = InetAddress.getLocalHost(); String ip = box.getHostAddress(); - if (chekIPFormat()) { + if (chekIPFormat(ipOnly)) { if (ipOnly.indexOf(ip) == -1) { log.fine("Not allowed here - IP=" + ip + " does not match "+ ipOnly); @@ -133,7 +123,7 @@ public class MSchedule extends X_AD_Schedule } else{ String hostname=box.getHostName(); - if(ipOnly.equals(hostname)){ + if(! ipOnly.equals(hostname)){ log.fine("Not Allowed here -hostname " + hostname + " does not match "+ipOnly); return false; } @@ -150,27 +140,31 @@ public class MSchedule extends X_AD_Schedule public static MSchedule get(Properties ctx, int AD_Schedule_ID) { - if(AD_Schedule_ID > 0) - { - MSchedule schedule=new MSchedule(ctx, AD_Schedule_ID, null); - return schedule; - } - return null; - + Integer key = new Integer (AD_Schedule_ID); + MSchedule retValue = (MSchedule)s_cache.get (key); + if (retValue != null) + return retValue; + retValue = new MSchedule (ctx, AD_Schedule_ID, null); + if (retValue.get_ID() != 0) + s_cache.put (key, retValue); + return retValue; } - - public boolean chekIPFormat() + + /** Cache */ + private static CCache s_cache = new CCache ("AD_Schedule", 10); + + public boolean chekIPFormat(String ipOnly) { boolean IsIp = false; try { VALID_IPV4_PATTERN = Pattern.compile(ipv4Pattern,Pattern.CASE_INSENSITIVE); VALID_IPV6_PATTERN = Pattern.compile(ipv6Pattern,Pattern.CASE_INSENSITIVE); - Matcher m1 = VALID_IPV4_PATTERN.matcher(getRunOnlyOnIP()); + Matcher m1 = VALID_IPV4_PATTERN.matcher(ipOnly); if (m1.matches()) { IsIp = true; } else { - Matcher m2 = VALID_IPV6_PATTERN.matcher(getRunOnlyOnIP()); + Matcher m2 = VALID_IPV6_PATTERN.matcher(ipOnly); if (m2.matches()) { IsIp = true; } else { @@ -183,91 +177,55 @@ public class MSchedule extends X_AD_Schedule } return IsIp; } + /** - * Brought from Compiere 330 * Get Next Run * @param last in MS * @return next run in MS */ - public long getNextRunMS (long last) + public static long getNextRunMS (long last, String scheduleType, String frequencyType, int frequency, String cronPattern) { - Calendar calNow = Calendar.getInstance(); - calNow.setTimeInMillis (last); - // - Calendar calNext = Calendar.getInstance(); - calNext.setTimeInMillis (last); - - - String scheduleType = getScheduleType(); - if (SCHEDULETYPE_Frequency.equals(scheduleType)) + long now = System.currentTimeMillis(); + if (MSchedule.SCHEDULETYPE_Frequency.equals(scheduleType)) { - String frequencyType = getFrequencyType(); - int frequency = getFrequency(); + // Calculate sleep interval based on frequency defined + if (frequency < 1) + frequency = 1; + long typeSec = 600; // 10 minutes + if (frequencyType == null) + typeSec = 300; // 5 minutes + else if (MSchedule.FREQUENCYTYPE_Minute.equals(frequencyType)) + typeSec = 60; + else if (MSchedule.FREQUENCYTYPE_Hour.equals(frequencyType)) + typeSec = 3600; + else if (MSchedule.FREQUENCYTYPE_Day.equals(frequencyType)) + typeSec = 86400; + long sleepInterval = typeSec * 1000 * frequency; // ms - boolean increment=true; - - - /***** DAY ******/ - if (X_AD_Schedule.FREQUENCYTYPE_Day.equals(frequencyType)) + long next = last + sleepInterval; + while (next < now) { - calNext.set (Calendar.HOUR_OF_DAY, 0); - calNext.set (Calendar.MINUTE, 0); - if(increment) - { - calNext.add(Calendar.DAY_OF_YEAR, frequency); - } - } // Day - - /***** HOUR ******/ - else if (X_AD_Schedule.FREQUENCYTYPE_Hour.equals(frequencyType)) - { - calNext.set (Calendar.MINUTE, 0); - if(increment) - { - calNext.add (Calendar.HOUR_OF_DAY, frequency); - } - - } // Hour - - /***** MINUTE ******/ - else if (X_AD_Schedule.FREQUENCYTYPE_Minute.equals(frequencyType)) - { - if(increment) - { - calNext.add(Calendar.MINUTE, frequency); - } - } // Minute - - long delta = calNext.getTimeInMillis() - calNow.getTimeInMillis(); - StringBuilder info = new StringBuilder("Now=") .append(calNow.getTime().toString()) - .append( ", Next=" + calNext.getTime().toString()) - .append( ", Delta=" + delta) - .append( ", " + toString()); - - if (delta < 0) - { - log.warning(info.toString()); + next = next + sleepInterval; } - else - log.info (info.toString()); - - return calNext.getTimeInMillis(); + return next; } - else + else if (MSchedule.SCHEDULETYPE_CronSchedulingPattern.equals(scheduleType)) { - String cronPattern = (String) getCronPattern(); if (cronPattern != null && cronPattern.trim().length() > 0 && SchedulingPattern.validate(cronPattern)) { - cronScheduler = new it.sauronsoftware.cron4j.Scheduler(); - predictor = new Predictor(cronPattern); + Predictor predictor = new Predictor(cronPattern, last); long next = predictor.nextMatchingTime(); + while (next < now) + { + predictor = new Predictor(cronPattern, next); + next = predictor.nextMatchingTime(); + } return next; } - } + } // not implemented MSchedule.SCHEDULETYPE_MonthDay, MSchedule.SCHEDULETYPE_WeekDay - can be done with cron return 0; - } // getNextRunMS } diff --git a/org.adempiere.base/src/org/compiere/model/MScheduler.java b/org.adempiere.base/src/org/compiere/model/MScheduler.java index c892b021e5..de8a4bc8cb 100644 --- a/org.adempiere.base/src/org/compiere/model/MScheduler.java +++ b/org.adempiere.base/src/org/compiere/model/MScheduler.java @@ -16,8 +16,6 @@ *****************************************************************************/ package org.compiere.model; -import it.sauronsoftware.cron4j.SchedulingPattern; - import java.sql.ResultSet; import java.sql.Timestamp; import java.util.List; @@ -44,7 +42,7 @@ public class MScheduler extends X_AD_Scheduler /** * */ - private static final long serialVersionUID = 6563650236096742870L; + private static final long serialVersionUID = 5106574386025319255L; /** * Get Active @@ -237,6 +235,7 @@ public class MScheduler extends X_AD_Scheduler * @param newRecord new * @return true */ + @Override protected boolean beforeSave(boolean newRecord) { @@ -269,7 +268,12 @@ public class MScheduler extends X_AD_Scheduler return false; } } - // + + if (newRecord || is_ValueChanged("AD_Schedule_ID")) { + long nextWork = MSchedule.getNextRunMS(System.currentTimeMillis(), getScheduleType(), getFrequencyType(), getFrequency(), getCronPattern()); + if (nextWork > 0) + setDateNextRun(new Timestamp(nextWork)); + } return true; } // beforeSave @@ -287,23 +291,27 @@ public class MScheduler extends X_AD_Scheduler @Override public String getFrequencyType() { - MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID()); - - return schedule.getFrequencyType(); + return MSchedule.get(getCtx(),getAD_Schedule_ID()).getFrequencyType(); } @Override public int getFrequency() { - MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID()); - return schedule.getFrequency(); + return MSchedule.get(getCtx(),getAD_Schedule_ID()).getFrequency(); } @Override public boolean isIgnoreProcessingTime() { - MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID()); - return schedule.isIgnoreProcessingTime(); + return MSchedule.get(getCtx(),getAD_Schedule_ID()).isIgnoreProcessingTime(); } + @Override + public String getScheduleType() { + return MSchedule.get(getCtx(),getAD_Schedule_ID()).getScheduleType(); + } + @Override + public String getCronPattern() { + return MSchedule.get(getCtx(),getAD_Schedule_ID()).getCronPattern(); + } } // MScheduler diff --git a/org.adempiere.base/src/org/compiere/model/MSetup.java b/org.adempiere.base/src/org/compiere/model/MSetup.java index d187c631e6..64f8f85cf4 100644 --- a/org.adempiere.base/src/org/compiere/model/MSetup.java +++ b/org.adempiere.base/src/org/compiere/model/MSetup.java @@ -16,6 +16,10 @@ *****************************************************************************/ package org.compiere.model; +import static org.compiere.model.SystemIDs.COUNTRY_US; +import static org.compiere.model.SystemIDs.SCHEDULE_10_MINUTES; +import static org.compiere.model.SystemIDs.SCHEDULE_15_MINUTES; + import java.io.File; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -34,7 +38,6 @@ import org.compiere.util.Env; import org.compiere.util.KeyNamePair; import org.compiere.util.Msg; import org.compiere.util.Trx; -import static org.compiere.model.SystemIDs.*; /** * Initial Setup Model @@ -340,9 +343,11 @@ public final class MSetup // Processors MAcctProcessor ap = new MAcctProcessor(m_client, AD_User_ID); + ap.setAD_Schedule_ID(SCHEDULE_10_MINUTES); ap.saveEx(); MRequestProcessor rp = new MRequestProcessor (m_client, AD_User_ID); + rp.setAD_Schedule_ID(SCHEDULE_15_MINUTES); rp.saveEx(); log.info("fini"); diff --git a/org.adempiere.base/src/org/compiere/model/SystemIDs.java b/org.adempiere.base/src/org/compiere/model/SystemIDs.java index 51f0911701..793b845fa9 100644 --- a/org.adempiere.base/src/org/compiere/model/SystemIDs.java +++ b/org.adempiere.base/src/org/compiere/model/SystemIDs.java @@ -149,4 +149,8 @@ public class SystemIDs public final static int SYSCONFIG_USER_HASH_PASSWORD = 200013; public final static int SYSCONFIG_SYSTEM_NATIVE_SEQUENCE = 50016; + + public final static int SCHEDULE_10_MINUTES = 200002; + public final static int SCHEDULE_15_MINUTES = 200003; + } diff --git a/org.adempiere.base/src/org/compiere/model/X_AD_Schedule.java b/org.adempiere.base/src/org/compiere/model/X_AD_Schedule.java index dcee8009cd..81ff342ce6 100644 --- a/org.adempiere.base/src/org/compiere/model/X_AD_Schedule.java +++ b/org.adempiere.base/src/org/compiere/model/X_AD_Schedule.java @@ -97,6 +97,20 @@ public class X_AD_Schedule extends PO implements I_AD_Schedule, I_Persistent return new KeyNamePair(get_ID(), String.valueOf(getAD_Schedule_ID())); } + /** Set AD_Schedule_UU. + @param AD_Schedule_UU AD_Schedule_UU */ + public void setAD_Schedule_UU (String AD_Schedule_UU) + { + set_Value (COLUMNNAME_AD_Schedule_UU, AD_Schedule_UU); + } + + /** Get AD_Schedule_UU. + @return AD_Schedule_UU */ + public String getAD_Schedule_UU () + { + return (String)get_Value(COLUMNNAME_AD_Schedule_UU); + } + /** Set Cron Scheduling Pattern. @param CronPattern Cron pattern to define when the process should be invoked. @@ -201,6 +215,30 @@ public class X_AD_Schedule extends PO implements I_AD_Schedule, I_Persistent return false; } + /** Set IsSystemSchedule. + @param IsSystemSchedule + Schedule Just For System + */ + public void setIsSystemSchedule (boolean IsSystemSchedule) + { + set_Value (COLUMNNAME_IsSystemSchedule, Boolean.valueOf(IsSystemSchedule)); + } + + /** Get IsSystemSchedule. + @return Schedule Just For System + */ + public boolean isSystemSchedule () + { + Object oo = get_Value(COLUMNNAME_IsSystemSchedule); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + /** Set Day of the Month. @param MonthDay Day of the month 1 to 28/29/30/31 @@ -238,18 +276,15 @@ public class X_AD_Schedule extends PO implements I_AD_Schedule, I_Persistent return (String)get_Value(COLUMNNAME_Name); } - /** Set RunOnlyOnIP. - @param RunOnlyOnIP - Defines the IP address to transfer data to - */ + /** Set Run only on IP. + @param RunOnlyOnIP Run only on IP */ public void setRunOnlyOnIP (String RunOnlyOnIP) { set_Value (COLUMNNAME_RunOnlyOnIP, RunOnlyOnIP); } - /** Get RunOnlyOnIP. - @return Defines the IP address to transfer data to - */ + /** Get Run only on IP. + @return Run only on IP */ public String getRunOnlyOnIP () { return (String)get_Value(COLUMNNAME_RunOnlyOnIP); diff --git a/org.adempiere.base/src/org/compiere/wf/MWorkflowProcessor.java b/org.adempiere.base/src/org/compiere/wf/MWorkflowProcessor.java index 8f57c13cda..524ae69f09 100644 --- a/org.adempiere.base/src/org/compiere/wf/MWorkflowProcessor.java +++ b/org.adempiere.base/src/org/compiere/wf/MWorkflowProcessor.java @@ -42,8 +42,7 @@ public class MWorkflowProcessor extends X_AD_WorkflowProcessor /** * */ - private static final long serialVersionUID = 9164558879064747427L; - + private static final long serialVersionUID = 6110376502075157361L; /** * Get Active @@ -134,25 +133,46 @@ public class MWorkflowProcessor extends X_AD_WorkflowProcessor return no; } // deleteLog + /** + * Before Save + * @param newRecord new + * @return true + */ + @Override + protected boolean beforeSave(boolean newRecord) + { + if (newRecord || is_ValueChanged("AD_Schedule_ID")) { + long nextWork = MSchedule.getNextRunMS(System.currentTimeMillis(), getScheduleType(), getFrequencyType(), getFrequency(), getCronPattern()); + if (nextWork > 0) + setDateNextRun(new Timestamp(nextWork)); + } + + return true; + } // beforeSave @Override public String getFrequencyType() { - MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID()); - return schedule.getFrequencyType(); + return MSchedule.get(getCtx(),getAD_Schedule_ID()).getFrequencyType(); } - @Override public int getFrequency() { - MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID()); - return schedule.getFrequency(); + return MSchedule.get(getCtx(),getAD_Schedule_ID()).getFrequency(); } - @Override public boolean isIgnoreProcessingTime() { - MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID()); - return schedule.isIgnoreProcessingTime(); + return MSchedule.get(getCtx(),getAD_Schedule_ID()).isIgnoreProcessingTime(); + } + + @Override + public String getScheduleType() { + return MSchedule.get(getCtx(),getAD_Schedule_ID()).getScheduleType(); + } + + @Override + public String getCronPattern() { + return MSchedule.get(getCtx(),getAD_Schedule_ID()).getCronPattern(); } } // MWorkflowProcessor diff --git a/org.adempiere.server/src/main/server/org/adempiere/server/IServerFactory.java b/org.adempiere.server/src/main/server/org/adempiere/server/IServerFactory.java index 00ffb126b9..0f3fb37610 100644 --- a/org.adempiere.server/src/main/server/org/adempiere/server/IServerFactory.java +++ b/org.adempiere.server/src/main/server/org/adempiere/server/IServerFactory.java @@ -23,5 +23,7 @@ import org.compiere.server.AdempiereServer; * */ public interface IServerFactory { + + // Class implementing this method must take into account if the server can be ran on this IP public AdempiereServer[] create (Properties ctx); } diff --git a/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServer.java b/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServer.java index aea2114339..b1386b31b0 100644 --- a/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServer.java +++ b/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServer.java @@ -32,7 +32,6 @@ import org.compiere.model.MRequestProcessor; import org.compiere.model.MSchedule; import org.compiere.model.MScheduler; import org.compiere.model.MSystem; -import org.compiere.model.X_AD_Schedule; import org.compiere.util.CLogger; import org.compiere.util.Env; import org.compiere.util.TimeUtil; @@ -53,6 +52,8 @@ public abstract class AdempiereServer extends Thread */ public static AdempiereServer create (AdempiereProcessor model) { + if (! isOKtoRunOnIP(model)) + return null; if (model instanceof MRequestProcessor) return new RequestProcessor ((MRequestProcessor)model); if (model instanceof MWorkflowProcessor) @@ -85,23 +86,20 @@ public abstract class AdempiereServer extends Thread p_client = MClient.get(m_ctx); Env.setContext(m_ctx, "#AD_Client_ID", p_client.getAD_Client_ID()); m_initialNap = initialNap; - Timestamp dateNextRun = getDateNextRun(true); - if (dateNextRun != null) - m_nextWork = dateNextRun.getTime(); // log.info(model.getName() + " - " + getThreadGroup()); } // ServerBase /** The Processor Model */ - protected AdempiereProcessor p_model; + protected volatile AdempiereProcessor p_model; /** Initial nap is seconds */ private int m_initialNap = 0; - /** Miliseconds to sleep - 10 Min default */ - private long m_sleepMS = 600000; + /** Milliseconds to sleep - 10 Min default */ + protected long m_sleepMS = 600000; /** Sleeping */ private volatile boolean m_sleeping = false; /** Server start time */ - private long m_start = 0; + protected long m_start = 0; /** Number of Work executions */ protected int p_runCount = 0; /** Tine start of work */ @@ -118,7 +116,7 @@ public abstract class AdempiereServer extends Thread /** Context */ private Properties m_ctx = null; /** System */ - protected static MSystem p_system = null; + protected volatile static MSystem p_system = null; /** Client */ protected MClient p_client = null; @@ -193,23 +191,6 @@ public abstract class AdempiereServer extends Thread */ public void run () { - - if(p_model instanceof AdempiereProcessor2) - { - AdempiereProcessor2 model=(AdempiereProcessor2) p_model; - int AD_Schedule_ID = model.getAD_Schedule_ID(); - MSchedule schedule = null; - if (AD_Schedule_ID != 0) - { - schedule = MSchedule.get (getCtx(), AD_Schedule_ID); - if (!schedule.isOKtoRunOnIP()) - { - log.warning (getName() + ": Stopped - IP Restriction " + schedule); - return; // done - } - } - } - try { log.fine(getName() + ": pre-nap - " + m_initialNap); @@ -251,9 +232,9 @@ public abstract class AdempiereServer extends Thread p_runCount++; m_runLastMS = now - p_startWork; - m_runTotalMS += m_runLastMS; - // - m_sleepMS = calculateSleep(m_start); + m_runTotalMS += m_runLastMS; + + // Finished work - calculate datetime for next run Timestamp lastRun = new Timestamp(now); if (p_model instanceof AdempiereProcessor2) { @@ -261,23 +242,15 @@ public abstract class AdempiereServer extends Thread if (ap.isIgnoreProcessingTime()) { lastRun = new Timestamp(p_startWork); - if (m_nextWork <= 0) - m_nextWork = p_startWork; - m_nextWork = m_nextWork + m_sleepMS; - while (m_nextWork < now) - { - m_nextWork = m_nextWork + m_sleepMS; - } - } - else - { - m_nextWork = now + m_sleepMS; } } - else - { - m_nextWork = now + m_sleepMS; - } + + m_nextWork = MSchedule.getNextRunMS(lastRun.getTime(), + p_model.getScheduleType(), p_model.getFrequencyType(), + p_model.getFrequency(), p_model.getCronPattern()); + + m_sleepMS = m_nextWork - now; + log.info(getName() + " Next run: " + new Timestamp(m_nextWork) + " sleep " + m_sleepMS); // p_model.setDateLastRun(lastRun); p_model.setDateNextRun(new Timestamp(m_nextWork)); @@ -359,48 +332,6 @@ public abstract class AdempiereServer extends Thread return p_model; } // getModel - /** - * Calculate Sleep ms - * @return miliseconds - */ - private long calculateSleep (long now) - { - String frequencyType = p_model.getFrequencyType(); - int frequency = p_model.getFrequency(); - if (frequency < 1) - frequency = 1; - // - long typeSec = 600; // 10 minutes - if (frequencyType == null) - typeSec = 300; // 5 minutes - else if (X_AD_Schedule.FREQUENCYTYPE_Minute.equals(frequencyType)) - typeSec = 60; - else if (X_AD_Schedule.FREQUENCYTYPE_Hour.equals(frequencyType)) - typeSec = 3600; - else if (X_AD_Schedule.FREQUENCYTYPE_Day.equals(frequencyType)) - typeSec = 86400; - // - long sleep= typeSec * 1000 * frequency; - - if (p_model instanceof AdempiereProcessor2) - { - AdempiereProcessor2 model=(AdempiereProcessor2) p_model; - if (model.getAD_Schedule_ID() == 0) - return sleep; - - // Calculate Schedule - MSchedule schedule = MSchedule.get(getCtx(),model.getAD_Schedule_ID()); - long next = schedule.getNextRunMS(now); - long delta = next - now; - if (delta < 0) { - log.warning("Negative Delta=" + delta + " - set to " + sleep); - delta = sleep; - } - return delta; - } - return sleep; - } // calculateSleep - /** * Is Sleeping * @return sleeping @@ -460,4 +391,17 @@ public abstract class AdempiereServer extends Thread return p_model.getLogs(); } // getLogs + + public static boolean isOKtoRunOnIP(AdempiereProcessor model) { + if (model instanceof AdempiereProcessor2) { + int AD_Schedule_ID = ((AdempiereProcessor2)model).getAD_Schedule_ID(); + MSchedule schedule = MSchedule.get(Env.getCtx(), AD_Schedule_ID); + if (!schedule.isOKtoRunOnIP()) + { + return false; // done + } + } + return true; + } + } // AdempiereServer diff --git a/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServerMgr.java b/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServerMgr.java index 3eeb828c65..3480d14de6 100644 --- a/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServerMgr.java +++ b/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServerMgr.java @@ -114,9 +114,11 @@ public class AdempiereServerMgr { MAcctProcessor pModel = acctModels[i]; AdempiereServer server = AdempiereServer.create(pModel); - server.start(); - server.setPriority(Thread.NORM_PRIORITY-2); - m_servers.add(server); + if (server != null) { + server.start(); + server.setPriority(Thread.NORM_PRIORITY-2); + m_servers.add(server); + } } // Request MRequestProcessor[] requestModels = MRequestProcessor.getActive(m_ctx); @@ -124,9 +126,11 @@ public class AdempiereServerMgr { MRequestProcessor pModel = requestModels[i]; AdempiereServer server = AdempiereServer.create(pModel); - server.start(); - server.setPriority(Thread.NORM_PRIORITY-2); - m_servers.add(server); + if (server != null) { + server.start(); + server.setPriority(Thread.NORM_PRIORITY-2); + m_servers.add(server); + } } // Workflow MWorkflowProcessor[] workflowModels = MWorkflowProcessor.getActive(m_ctx); @@ -134,9 +138,11 @@ public class AdempiereServerMgr { MWorkflowProcessor pModel = workflowModels[i]; AdempiereServer server = AdempiereServer.create(pModel); - server.start(); - server.setPriority(Thread.NORM_PRIORITY-2); - m_servers.add(server); + if (server != null) { + server.start(); + server.setPriority(Thread.NORM_PRIORITY-2); + m_servers.add(server); + } } // Alert MAlertProcessor[] alertModels = MAlertProcessor.getActive(m_ctx); @@ -144,9 +150,11 @@ public class AdempiereServerMgr { MAlertProcessor pModel = alertModels[i]; AdempiereServer server = AdempiereServer.create(pModel); - server.start(); - server.setPriority(Thread.NORM_PRIORITY-2); - m_servers.add(server); + if (server != null) { + server.start(); + server.setPriority(Thread.NORM_PRIORITY-2); + m_servers.add(server); + } } // Scheduler MScheduler[] schedulerModels = MScheduler.getActive(m_ctx); @@ -154,9 +162,11 @@ public class AdempiereServerMgr { MScheduler pModel = schedulerModels[i]; AdempiereServer server = AdempiereServer.create(pModel); - server.start(); - server.setPriority(Thread.NORM_PRIORITY-2); - m_servers.add(server); + if (server != null) { + server.start(); + server.setPriority(Thread.NORM_PRIORITY-2); + m_servers.add(server); + } } // LDAP MLdapProcessor[] ldapModels = MLdapProcessor.getActive(m_ctx); @@ -164,9 +174,11 @@ public class AdempiereServerMgr { MLdapProcessor lp = ldapModels[i]; AdempiereServer server = AdempiereServer.create(lp); - server.start(); - server.setPriority(Thread.NORM_PRIORITY-1); - m_servers.add(server); + if (server != null) { + server.start(); + server.setPriority(Thread.NORM_PRIORITY-1); + m_servers.add(server); + } } //osgi server diff --git a/org.adempiere.server/src/main/server/org/compiere/server/AlertProcessor.java b/org.adempiere.server/src/main/server/org/compiere/server/AlertProcessor.java index ce0b157241..2591b9c3f7 100644 --- a/org.adempiere.server/src/main/server/org/compiere/server/AlertProcessor.java +++ b/org.adempiere.server/src/main/server/org/compiere/server/AlertProcessor.java @@ -66,7 +66,7 @@ public class AlertProcessor extends AdempiereServer */ public AlertProcessor (MAlertProcessor model) { - super (model, 180); // 3 minute delay + super (model, 30); // 30 seconds delay m_model = model; m_client = MClient.get(model.getCtx(), model.getAD_Client_ID()); } // AlertProcessor diff --git a/org.adempiere.server/src/main/server/org/compiere/server/RequestProcessor.java b/org.adempiere.server/src/main/server/org/compiere/server/RequestProcessor.java index 47004b8b94..7afee9eec7 100644 --- a/org.adempiere.server/src/main/server/org/compiere/server/RequestProcessor.java +++ b/org.adempiere.server/src/main/server/org/compiere/server/RequestProcessor.java @@ -51,7 +51,7 @@ public class RequestProcessor extends AdempiereServer */ public RequestProcessor (MRequestProcessor model) { - super (model, 60); // 1 minute delay + super (model, 30); // 30 seconds delay m_model = model; m_client = MClient.get(model.getCtx(), model.getAD_Client_ID()); } // RequestProcessor diff --git a/org.adempiere.server/src/main/server/org/compiere/server/Scheduler.java b/org.adempiere.server/src/main/server/org/compiere/server/Scheduler.java index e7b800e1f6..fbfddc204d 100644 --- a/org.adempiere.server/src/main/server/org/compiere/server/Scheduler.java +++ b/org.adempiere.server/src/main/server/org/compiere/server/Scheduler.java @@ -16,9 +16,6 @@ *****************************************************************************/ package org.compiere.server; -import it.sauronsoftware.cron4j.Predictor; -import it.sauronsoftware.cron4j.SchedulingPattern; - import java.io.File; import java.math.BigDecimal; import java.sql.Timestamp; @@ -34,12 +31,10 @@ import org.compiere.model.MPInstance; import org.compiere.model.MPInstancePara; import org.compiere.model.MProcess; import org.compiere.model.MRole; -import org.compiere.model.MSchedule; import org.compiere.model.MScheduler; import org.compiere.model.MSchedulerLog; import org.compiere.model.MSchedulerPara; import org.compiere.model.MUser; -import org.compiere.print.MPrintFormat; import org.compiere.print.ReportEngine; import org.compiere.process.ProcessInfo; import org.compiere.process.ProcessInfoUtil; @@ -67,7 +62,7 @@ public class Scheduler extends AdempiereServer */ public Scheduler (MScheduler model) { - super (model, 240); // nap + super (model, 30); // 30 seconds delay m_model = model; // m_client = MClient.get(model.getCtx(), model.getAD_Client_ID()); } // Scheduler @@ -79,9 +74,6 @@ public class Scheduler extends AdempiereServer /** Transaction */ private Trx m_trx = null; - private it.sauronsoftware.cron4j.Scheduler cronScheduler; - private Predictor predictor; - // ctx for the report/process Properties m_schedulerctx = new Properties(); @@ -422,40 +414,4 @@ public class Scheduler extends AdempiereServer return "#" + p_runCount + " - Last=" + m_summary.toString(); } // getServerInfo - @Override - public void run() - { - if (m_model.getAD_Schedule_ID() > 0) - { - MSchedule time = new MSchedule(getCtx(),m_model.getAD_Schedule_ID(), null); - String cronPattern = (String) time.getCronPattern(); - if (cronPattern != null && cronPattern.trim().length() > 0 - && SchedulingPattern.validate(cronPattern)) { - cronScheduler = new it.sauronsoftware.cron4j.Scheduler(); - cronScheduler.schedule(cronPattern, new Runnable() { - public void run() { - runNow(); - long next = predictor.nextMatchingTime(); - p_model.setDateNextRun(new Timestamp(next)); - p_model.saveEx(); - } - }); - predictor = new Predictor(cronPattern); - long next = predictor.nextMatchingTime(); - p_model.setDateNextRun(new Timestamp(next)); - p_model.saveEx(); - cronScheduler.start(); - while (true) { - if (!sleep()) { - cronScheduler.stop(); - break; - } else if (!cronScheduler.isStarted()) { - break; - } - } - } else { - super.run(); - } - } - } } // Scheduler diff --git a/org.adempiere.server/src/main/server/org/compiere/server/WorkflowProcessor.java b/org.adempiere.server/src/main/server/org/compiere/server/WorkflowProcessor.java index 77b3b187ec..b3f36f2705 100644 --- a/org.adempiere.server/src/main/server/org/compiere/server/WorkflowProcessor.java +++ b/org.adempiere.server/src/main/server/org/compiere/server/WorkflowProcessor.java @@ -55,7 +55,7 @@ public class WorkflowProcessor extends AdempiereServer */ public WorkflowProcessor (MWorkflowProcessor model) { - super (model, 120); // 2 minute delay + super (model, 30); // 30 seconds delay m_model = model; m_client = MClient.get(model.getCtx(), model.getAD_Client_ID()); } // WorkflowProcessor From 3bbe4cec45fa264950ebd29070602aacaf20f195 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 2 Oct 2012 23:17:29 -0500 Subject: [PATCH 69/79] IDEMPIERE-308 Performance: Replace with StringBuilder / fix problem found with lookups --- org.adempiere.base/src/org/compiere/model/MLookup.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/model/MLookup.java b/org.adempiere.base/src/org/compiere/model/MLookup.java index 420002054f..39f0e82fdc 100644 --- a/org.adempiere.base/src/org/compiere/model/MLookup.java +++ b/org.adempiere.base/src/org/compiere/model/MLookup.java @@ -758,7 +758,7 @@ public final class MLookup extends Lookup implements Serializable boolean isActive = rs.getString(4).equals("Y"); if (!isActive) { - name.append(INACTIVE_S).append(INACTIVE_E); + name = new StringBuilder(INACTIVE_S).append(INACTIVE_E); m_hasInactive = true; } if (isNumber) From 5b92e3a2d72a7a63f43560f0719505d23c2c9670 Mon Sep 17 00:00:00 2001 From: Elaine Tan Date: Wed, 3 Oct 2012 12:33:03 +0800 Subject: [PATCH 70/79] IDEMPIERE-373 Implement User Locking - fix locking error message when involving multi-clients user --- org.adempiere.base/src/org/compiere/util/Login.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/util/Login.java b/org.adempiere.base/src/org/compiere/util/Login.java index 43145f803e..8f6d76db09 100644 --- a/org.adempiere.base/src/org/compiere/util/Login.java +++ b/org.adempiere.base/src/org/compiere/util/Login.java @@ -1372,6 +1372,7 @@ public class Login } } + boolean validButLocked = false; for (MUser user : users) { if (clientsValidated.contains(user.getAD_Client_ID())) { log.severe("Two users with password with the same name/email combination on same tenant: " + app_user); @@ -1387,7 +1388,10 @@ public class Login } if (valid ) { if (user.isLocked()) + { + validButLocked = true; continue; + } if (user.isExpired()) isPasswordExpired = true; @@ -1462,7 +1466,12 @@ public class Login log.severe("Failed to update user record with date last login"); } } - else + else if (validButLocked) + { + // User account ({0}) is locked, please contact the system administrator + loginErrMsg = Msg.getMsg(m_ctx, "UserAccountLocked", new Object[] {app_user}); + } + else { boolean foundLockedAccount = false; for (MUser user : users) From 17a779a61aa19224ac4eeec4813f31eb990ec48b Mon Sep 17 00:00:00 2001 From: Elaine Tan Date: Wed, 3 Oct 2012 18:18:59 +0800 Subject: [PATCH 71/79] Fix SQL query error at 'Find' window of Swing UI --- org.adempiere.ui.swing/src/org/compiere/apps/search/Find.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/Find.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/Find.java index df2f718517..ab4f117c39 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/Find.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/search/Find.java @@ -1074,7 +1074,7 @@ public final class Find extends CDialog valueStr.append("%"); // ColumnSQL = new StringBuilder("UPPER(").append(ColumnSQL).append(")"); - value = valueStr; + value = valueStr.toString(); } // if (value.toString().indexOf('%') != -1) From a5f5d8d972e0e0197754c4c012f1f5f23203f5a7 Mon Sep 17 00:00:00 2001 From: Elaine Tan Date: Wed, 3 Oct 2012 18:30:46 +0800 Subject: [PATCH 72/79] IDEMPIERE-447 Abstract Payment Processor from Tenant configuration --- .../oracle/924_IDEMPIERE-447.sql | 1066 +++++++++++++++++ .../postgresql/924_IDEMPIERE-447.sql | 1066 +++++++++++++++++ .../src/org/adempiere/base/Core.java | 4 +- .../org/compiere/model/I_C_BankAccount.java | 45 +- .../compiere/model/I_C_PaymentProcessor.java | 47 +- .../src/org/compiere/model/MPayment.java | 64 +- .../org/compiere/model/MPaymentProcessor.java | 66 +- .../org/compiere/model/X_C_BankAccount.java | 88 +- .../compiere/model/X_C_PaymentProcessor.java | 79 +- .../src/org/compiere/grid/VPayment.java | 2 +- .../src/org/compiere/pos/PosOrderModel.java | 21 +- 11 files changed, 2391 insertions(+), 157 deletions(-) create mode 100644 migration/360lts-release/oracle/924_IDEMPIERE-447.sql create mode 100644 migration/360lts-release/postgresql/924_IDEMPIERE-447.sql diff --git a/migration/360lts-release/oracle/924_IDEMPIERE-447.sql b/migration/360lts-release/oracle/924_IDEMPIERE-447.sql new file mode 100644 index 0000000000..fb3fbf9fcc --- /dev/null +++ b/migration/360lts-release/oracle/924_IDEMPIERE-447.sql @@ -0,0 +1,1066 @@ +-- Oct 3, 2012 3:52:52 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,297,200579,'U','N','N','N',0,'N',10,'N',19,'N','N',1385,'N','Y','4dbd226a-1b09-4ae7-96dc-5c4379f249bc','N','Y','N','C_PaymentProcessor_ID','Payment processor for electronic payments','The Payment Processor indicates the processor to be used for electronic payments','Payment Processor','Y',100,TO_DATE('2012-10-03 15:52:51','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-10-03 15:52:51','YYYY-MM-DD HH24:MI:SS'),100,0,0) +; + +-- Oct 3, 2012 3:52:53 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200579 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Oct 3, 2012 3:53:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +ALTER TABLE C_BankAccount ADD C_PaymentProcessor_ID NUMBER(10) DEFAULT NULL +; + +-- Oct 3, 2012 3:53:12 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Column SET EntityType='D',Updated=TO_DATE('2012-10-03 15:53:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200579 +; + +-- Oct 3, 2012 3:53:15 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +ALTER TABLE C_BankAccount MODIFY C_PaymentProcessor_ID NUMBER(10) DEFAULT NULL +; + +-- Oct 3, 2012 3:53:54 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Window (WindowType,IsSOTrx,IsDefault,IsBetaFunctionality,WinHeight,WinWidth,EntityType,Name,AD_Window_ID,Processing,AD_Window_UU,Created,Updated,AD_Org_ID,AD_Client_ID,IsActive,UpdatedBy,CreatedBy) VALUES ('M','Y','N','N',0,0,'D','Payment Processor',200015,'N','be2857c6-7fdf-4c81-9431-c31855562b5d',TO_DATE('2012-10-03 15:53:54','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-10-03 15:53:54','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',100,100) +; + +-- Oct 3, 2012 3:53:55 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Window_Trl (AD_Language,AD_Window_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Window_Trl_UU ) SELECT l.AD_Language,t.AD_Window_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Window t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Window_ID=200015 AND NOT EXISTS (SELECT * FROM AD_Window_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Window_ID=t.AD_Window_ID) +; + +-- Oct 3, 2012 3:54:14 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Tab (IsSingleRow,AD_Window_ID,SeqNo,IsTranslationTab,IsSortTab,AD_Table_ID,ImportFields,HasTree,IsReadOnly,IsInfoTab,IsInsertRecord,IsAdvancedTab,TabLevel,AD_Tab_UU,EntityType,Name,AD_Tab_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,Updated,UpdatedBy,Processing,IsActive) VALUES ('N',200015,10,'N','N',398,'N','N','N','N','Y','N',0,'2929b7ec-62c4-46d9-a7cc-59728070eb40','D','Payment Processor',200024,0,0,TO_DATE('2012-10-03 15:54:14','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2012-10-03 15:54:14','YYYY-MM-DD HH24:MI:SS'),100,'N','Y') +; + +-- Oct 3, 2012 3:54:14 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Tab_Trl (AD_Language,AD_Tab_ID, Help,CommitWarning,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Tab_Trl_UU ) SELECT l.AD_Language,t.AD_Tab_ID, t.Help,t.CommitWarning,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Tab t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Tab_ID=200024 AND NOT EXISTS (SELECT * FROM AD_Tab_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Tab_ID=t.AD_Tab_ID) +; + +-- Oct 3, 2012 3:54:26 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,14,'N','N',5054,10,'Y',200557,'N','The Payment Processor indicates the processor to be used for electronic payments','D','Payment processor for electronic payments','Payment Processor','N','N','e27b85cc-ad5f-4dc5-89f0-d9ed6661101b',100,0,TO_DATE('2012-10-03 15:54:25','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:25','YYYY-MM-DD HH24:MI:SS'),'Y','N',10,1,2,1) +; + +-- Oct 3, 2012 3:54:26 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200557 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:27 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,14,'N','N',5163,20,'Y',200558,'Y','A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','D','Client/Tenant for this installation.','Client','N','Y','f8b7204e-62b4-4c4d-8cf6-1cb9b5d5d2fc',100,0,TO_DATE('2012-10-03 15:54:27','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:27','YYYY-MM-DD HH24:MI:SS'),'Y','Y',20,1,2,1) +; + +-- Oct 3, 2012 3:54:27 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200558 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:28 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,14,'Y','N',5164,30,'Y',200559,'Y','An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','D','Organizational entity within client','Organization','N','Y','6f14f2a6-2419-41a8-8119-dd39f2f6ef8a',100,0,TO_DATE('2012-10-03 15:54:27','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:27','YYYY-MM-DD HH24:MI:SS'),'Y','Y',30,4,2,1) +; + +-- Oct 3, 2012 3:54:28 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200559 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:29 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,14,'N','N',5057,40,'Y',200560,'Y','The Bank Account identifies an account at this Bank.','D','Account at the Bank','Bank Account','N','Y','ccc2dd6b-5108-4bb3-8701-063e21c7a0e7',100,0,TO_DATE('2012-10-03 15:54:28','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:28','YYYY-MM-DD HH24:MI:SS'),'Y','Y',40,1,2,1) +; + +-- Oct 3, 2012 3:54:29 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200560 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:29 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES (1,'N',200024,60,'N','N',5055,50,'Y',200561,'N','The name of an entity (record) is used as an default search option in addition to the search key. The name is up to 60 characters in length.','D','Alphanumeric identifier of the entity','Name','N','Y','4951c671-36ed-4711-b92a-44db8de47051',100,0,TO_DATE('2012-10-03 15:54:29','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:29','YYYY-MM-DD HH24:MI:SS'),'Y','Y',50,1,5,1) +; + +-- Oct 3, 2012 3:54:30 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200561 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:30 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,60,'N','N',5056,60,'Y',200562,'N','A description is limited to 255 characters.','D','Optional short description of the record','Description','N','Y','060b2eee-c0d8-416c-9e90-beea430b3fcd',100,0,TO_DATE('2012-10-03 15:54:30','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:30','YYYY-MM-DD HH24:MI:SS'),'Y','Y',60,1,5,1) +; + +-- Oct 3, 2012 3:54:30 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200562 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:31 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,1,'N','N',5165,70,'Y',200563,'N','There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports. +There are two reasons for de-activating and not deleting records: +(1) The system requires the record for audit purposes. +(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','D','The record is active in the system','Active','N','Y','1010c8fe-fe5d-4769-9b06-02b019607ca5',100,0,TO_DATE('2012-10-03 15:54:30','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:30','YYYY-MM-DD HH24:MI:SS'),'Y','Y',70,2,2,1) +; + +-- Oct 3, 2012 3:54:31 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200563 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:32 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,20,'N','N',5060,80,'Y',200564,'N','The Host Address identifies the URL or DNS of the target host','D','Host Address URL or DNS','Host Address','N','Y','c20bcb42-54ac-40e9-8d17-429df645f70e',100,0,TO_DATE('2012-10-03 15:54:31','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:31','YYYY-MM-DD HH24:MI:SS'),'Y','Y',80,1,2,1) +; + +-- Oct 3, 2012 3:54:32 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200564 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:32 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,11,'Y','N',5061,90,'Y',200565,'N','The Host Port identifies the port to communicate with the host.','D','Host Communication Port','Host port','N','Y','054cddae-7028-4232-a2d4-77153dea73df',100,0,TO_DATE('2012-10-03 15:54:32','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:32','YYYY-MM-DD HH24:MI:SS'),'Y','Y',90,4,2,1) +; + +-- Oct 3, 2012 3:54:32 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200565 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:33 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,20,'N','N',7798,100,'Y',200566,'N','Partner ID (Verisign) or Account ID (Optimal)','D','Partner ID or Account for the Payment Processor','Partner ID','N','Y','718f44d0-1000-4374-a88a-c3159f0b38ba',100,0,TO_DATE('2012-10-03 15:54:32','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:32','YYYY-MM-DD HH24:MI:SS'),'Y','Y',100,1,2,1) +; + +-- Oct 3, 2012 3:54:33 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200566 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:34 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,20,'Y','N',7797,110,'Y',200567,'N','D','Vendor ID for the Payment Processor','Vendor ID','N','Y','16f5458d-fcd9-4ebf-aab8-fd6fbe1e378d',100,0,TO_DATE('2012-10-03 15:54:33','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:33','YYYY-MM-DD HH24:MI:SS'),'Y','Y',110,4,2,1) +; + +-- Oct 3, 2012 3:54:34 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200567 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:34 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,20,'N','N',5058,120,'Y',200568,'N','The User ID identifies a user and allows access to records or processes.','D','User ID or account number','User ID','N','Y','44ae6576-129f-44e1-9bf0-acfddd6a7aae',100,0,TO_DATE('2012-10-03 15:54:34','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:34','YYYY-MM-DD HH24:MI:SS'),'Y','Y',120,1,2,1) +; + +-- Oct 3, 2012 3:54:35 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200568 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:35 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('Y',200024,20,'Y','N',5059,130,'Y',200569,'N','The Password for this User. Passwords are required to identify authorized users. For Adempiere Users, you can change the password via the Process "Reset Password".','D','Password of any length (case sensitive)','Password','N','Y','e87e8ed4-2624-47d7-942c-232d64d933b1',100,0,TO_DATE('2012-10-03 15:54:35','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:35','YYYY-MM-DD HH24:MI:SS'),'Y','Y',130,4,2,1) +; + +-- Oct 3, 2012 3:54:35 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200569 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:36 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,20,'N','N',5062,140,'Y',200570,'N','The Proxy Address must be defined if you must pass through a firewall to access your payment processor. ','D',' Address of your proxy server','Proxy address','N','Y','9d38e19d-fc52-4be3-94f1-daef7d2344fc',100,0,TO_DATE('2012-10-03 15:54:35','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:35','YYYY-MM-DD HH24:MI:SS'),'Y','Y',140,1,2,1) +; + +-- Oct 3, 2012 3:54:36 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200570 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:37 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,11,'Y','N',5063,150,'Y',200571,'N','The Proxy Port identifies the port of your proxy server.','D','Port of your proxy server','Proxy port','N','Y','f59364c8-8fe5-4816-8310-3f4f493755a8',100,0,TO_DATE('2012-10-03 15:54:36','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:36','YYYY-MM-DD HH24:MI:SS'),'Y','Y',150,4,2,1) +; + +-- Oct 3, 2012 3:54:37 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200571 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:38 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,20,'N','N',5064,160,'Y',200572,'N','The Proxy Logon identifies the Logon ID for your proxy server.','D','Logon of your proxy server','Proxy logon','N','Y','728771b9-c404-499e-9d8d-fdbb24ca6e1f',100,0,TO_DATE('2012-10-03 15:54:37','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:37','YYYY-MM-DD HH24:MI:SS'),'Y','Y',160,1,2,1) +; + +-- Oct 3, 2012 3:54:38 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200572 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:39 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('Y',200024,20,'Y','N',5065,170,'Y',200573,'N','The Proxy Password identifies the password for your proxy server.','D','Password of your proxy server','Proxy password','N','Y','af4105cc-e6f6-4fd2-8ebe-f86b16ace1ad',100,0,TO_DATE('2012-10-03 15:54:38','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:38','YYYY-MM-DD HH24:MI:SS'),'Y','Y',170,4,2,1) +; + +-- Oct 3, 2012 3:54:39 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200573 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:39 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,1,'N','N',5067,180,'Y',200574,'N','Indicates if Master Cards are accepted ','D','Accept Master Card','Accept MasterCard','N','Y','f00ba72b-d610-4d5b-8e50-07731549f2ad',100,0,TO_DATE('2012-10-03 15:54:39','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:39','YYYY-MM-DD HH24:MI:SS'),'Y','Y',180,2,2,1) +; + +-- Oct 3, 2012 3:54:39 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200574 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:40 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,1,'Y','N',5066,190,'Y',200575,'N','Indicates if Visa Cards are accepted ','D','Accept Visa Cards','Accept Visa','N','Y','1a9b931f-7dc1-471c-829d-c73f83616371',100,0,TO_DATE('2012-10-03 15:54:39','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:39','YYYY-MM-DD HH24:MI:SS'),'Y','Y',190,5,2,1) +; + +-- Oct 3, 2012 3:54:40 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200575 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:41 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,1,'N','N',5068,200,'Y',200576,'N','Indicates if American Express Cards are accepted','D','Accept American Express Card','Accept AMEX','N','Y','19614db3-d11f-4e06-8f71-c7905367fd1a',100,0,TO_DATE('2012-10-03 15:54:40','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:40','YYYY-MM-DD HH24:MI:SS'),'Y','Y',200,2,2,1) +; + +-- Oct 3, 2012 3:54:41 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200576 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:42 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,1,'Y','N',5069,210,'Y',200577,'N','Indicates if Diner''s Club Cards are accepted ','D','Accept Diner''s Club','Accept Diners','N','Y','d14f97a6-f55d-418a-a58c-1a49357ed3a9',100,0,TO_DATE('2012-10-03 15:54:41','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:41','YYYY-MM-DD HH24:MI:SS'),'Y','Y',210,5,2,1) +; + +-- Oct 3, 2012 3:54:42 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200577 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:42 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,1,'N','N',5073,220,'Y',200578,'N','Indicates if Corporate Purchase Cards are accepted ','D','Accept Corporate Purchase Cards','Accept Corporate','N','Y','aadbeb74-e953-49bb-8b8b-f3d37db88630',100,0,TO_DATE('2012-10-03 15:54:42','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:42','YYYY-MM-DD HH24:MI:SS'),'Y','Y',220,2,2,1) +; + +-- Oct 3, 2012 3:54:42 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200578 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:43 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,1,'Y','N',5357,230,'Y',200579,'N','Indicates if Discover Cards are accepted','D','Accept Discover Card','Accept Discover','N','Y','b91b9eb8-591c-4146-9727-41aea3445387',100,0,TO_DATE('2012-10-03 15:54:42','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:42','YYYY-MM-DD HH24:MI:SS'),'Y','Y',230,5,2,1) +; + +-- Oct 3, 2012 3:54:43 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200579 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:44 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,1,'N','N',5070,240,'Y',200580,'N','Indicates if Direct Deposits (wire transfers, etc.) are accepted. Direct Deposits are initiated by the payee.','D','Accept Direct Deposit (payee initiated)','Accept Direct Deposit','N','Y','daed29a8-24da-403a-bfba-9fd3b6fd33ce',100,0,TO_DATE('2012-10-03 15:54:43','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:43','YYYY-MM-DD HH24:MI:SS'),'Y','Y',240,2,2,1) +; + +-- Oct 3, 2012 3:54:44 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200580 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:44 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,1,'Y','N',10763,250,'Y',200581,'N','Accept Direct Debit transactions. Direct Debits are initiated by the vendor who has permission to deduct amounts from the payee''s account.','D','Accept Direct Debits (vendor initiated)','Accept Direct Debit','N','Y','d202e8d5-89f9-4587-b864-38ba9d70289c',100,0,TO_DATE('2012-10-03 15:54:44','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:44','YYYY-MM-DD HH24:MI:SS'),'Y','Y',250,5,2,1) +; + +-- Oct 3, 2012 3:54:44 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200581 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:45 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,1,'N','N',5071,260,'Y',200582,'N','Indicates if EChecks are accepted','D','Accept ECheck (Electronic Checks)','Accept Electronic Check','N','Y','0992214d-ed4f-4d58-b89e-a763a3775e28',100,0,TO_DATE('2012-10-03 15:54:45','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:45','YYYY-MM-DD HH24:MI:SS'),'Y','Y',260,2,2,1) +; + +-- Oct 3, 2012 3:54:45 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200582 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:46 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,1,'Y','N',5072,270,'Y',200583,'N','Indicates if Bank ATM Cards are accepted','D','Accept Bank ATM Card','Accept ATM','N','Y','a752c4d3-dfed-4031-8ea4-6b8f73fceaf3',100,0,TO_DATE('2012-10-03 15:54:45','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:45','YYYY-MM-DD HH24:MI:SS'),'Y','Y',270,5,2,1) +; + +-- Oct 3, 2012 3:54:46 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200583 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:47 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,26,'N','N',9832,280,'Y',200584,'N','D','Minimum Amount in Document Currency','Minimum Amt','N','Y','d0838a33-67b8-4833-8488-db678d6c7b5e',100,0,TO_DATE('2012-10-03 15:54:46','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:46','YYYY-MM-DD HH24:MI:SS'),'Y','Y',280,1,2,1) +; + +-- Oct 3, 2012 3:54:47 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200584 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:47 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,14,'N','N',5360,290,'N',200585,'N','The Only Currency field indicates that this bank account accepts only the currency identified here.','D','Restrict accepting only this currency','Only Currency','N','Y','ae63d36f-5e17-4bca-b470-4f17bcd90e94',100,0,TO_DATE('2012-10-03 15:54:47','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:47','YYYY-MM-DD HH24:MI:SS'),'Y','Y',290,1,2,1) +; + +-- Oct 3, 2012 3:54:47 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200585 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:48 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,1,'Y','N',5361,300,'Y',200586,'N','The Require CC Verification checkbox indicates if this bank accounts requires a verification number for credit card transactions.','D','Require 3/4 digit Credit Verification Code','Require CreditCard Verification Code','N','Y','d4087352-9d0c-464b-b44c-78219776dc2c',100,0,TO_DATE('2012-10-03 15:54:47','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:47','YYYY-MM-DD HH24:MI:SS'),'Y','Y',300,5,2,1) +; + +-- Oct 3, 2012 3:54:48 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200586 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:49 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,14,'N','N',5319,310,'Y',200587,'N','The Sequence defines the numbering sequence to be used for documents.','D','Document Sequence','Sequence','N','Y','844c95b1-2338-4c92-a57c-834d2c698d82',100,0,TO_DATE('2012-10-03 15:54:48','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:48','YYYY-MM-DD HH24:MI:SS'),'Y','Y',310,1,2,1) +; + +-- Oct 3, 2012 3:54:49 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200587 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:50 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,26,'N','N',5320,320,'Y',200588,'N','Payment Processor class identifies the Java class used to process payments extending the org.compiere.model.PaymentProcessor class.
    +Example implementations are Optimal Payments: org.compiere.model.PP_Optimal or Verisign: org.compiere.model.PP_PayFlowPro','D','Payment Processor Java Class','Payment Processor Class','N','Y','bd7bdcdf-5cbb-4572-ae84-cebf8cff2e78',100,0,TO_DATE('2012-10-03 15:54:49','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:49','YYYY-MM-DD HH24:MI:SS'),'Y','Y',320,1,2,1) +; + +-- Oct 3, 2012 3:54:50 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200588 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:50 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,26,'N','N',5358,330,'Y',200589,'N','The Commission indicates (as a percentage) the commission to be paid.','D','Commission stated as a percentage','Commission %','N','Y','62d0f61e-a78e-4c8d-a782-3008d45f55fe',100,0,TO_DATE('2012-10-03 15:54:50','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:50','YYYY-MM-DD HH24:MI:SS'),'Y','Y',330,1,2,1) +; + +-- Oct 3, 2012 3:54:50 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200589 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:51 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,26,'Y','N',5359,340,'Y',200590,'N','The Cost per Transaction indicates the fixed cost per to be charged per transaction.','D','Fixed cost per transaction','Cost per transaction','N','Y','60e201df-0286-4e88-864f-24b56a91402d',100,0,TO_DATE('2012-10-03 15:54:50','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 15:54:50','YYYY-MM-DD HH24:MI:SS'),'Y','Y',340,4,2,1) +; + +-- Oct 3, 2012 3:54:51 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200590 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:55:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=200560 +; + +-- Oct 3, 2012 3:55:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=200557 +; + +-- Oct 3, 2012 3:55:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=10,IsDisplayed='Y' WHERE AD_Field_ID=200558 +; + +-- Oct 3, 2012 3:55:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=20,IsDisplayed='Y' WHERE AD_Field_ID=200559 +; + +-- Oct 3, 2012 3:55:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=30,IsDisplayed='Y' WHERE AD_Field_ID=200561 +; + +-- Oct 3, 2012 3:55:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=40,IsDisplayed='Y' WHERE AD_Field_ID=200562 +; + +-- Oct 3, 2012 3:55:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=50,IsDisplayed='Y' WHERE AD_Field_ID=200563 +; + +-- Oct 3, 2012 3:55:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=200564 +; + +-- Oct 3, 2012 3:55:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=200565 +; + +-- Oct 3, 2012 3:55:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=200566 +; + +-- Oct 3, 2012 3:55:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=200567 +; + +-- Oct 3, 2012 3:55:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=200568 +; + +-- Oct 3, 2012 3:55:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=200569 +; + +-- Oct 3, 2012 3:55:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=200570 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=130,IsDisplayed='Y' WHERE AD_Field_ID=200571 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=140,IsDisplayed='Y' WHERE AD_Field_ID=200572 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=200573 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=200574 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=200575 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=200576 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=190,IsDisplayed='Y' WHERE AD_Field_ID=200577 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=200,IsDisplayed='Y' WHERE AD_Field_ID=200578 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=210,IsDisplayed='Y' WHERE AD_Field_ID=200579 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=220,IsDisplayed='Y' WHERE AD_Field_ID=200580 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=230,IsDisplayed='Y' WHERE AD_Field_ID=200581 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=240,IsDisplayed='Y' WHERE AD_Field_ID=200582 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=250,IsDisplayed='Y' WHERE AD_Field_ID=200583 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=260,IsDisplayed='Y' WHERE AD_Field_ID=200584 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=270,IsDisplayed='Y' WHERE AD_Field_ID=200585 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=280,IsDisplayed='Y' WHERE AD_Field_ID=200586 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=290,IsDisplayed='Y' WHERE AD_Field_ID=200587 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=300,IsDisplayed='Y' WHERE AD_Field_ID=200588 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=310,IsDisplayed='Y' WHERE AD_Field_ID=200589 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=320,IsDisplayed='Y' WHERE AD_Field_ID=200590 +; + +-- Oct 3, 2012 3:55:06 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=200560 +; + +-- Oct 3, 2012 3:55:06 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=200557 +; + +-- Oct 3, 2012 3:55:06 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=10,IsDisplayedGrid='Y' WHERE AD_Field_ID=200558 +; + +-- Oct 3, 2012 3:55:06 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=20,IsDisplayedGrid='Y' WHERE AD_Field_ID=200559 +; + +-- Oct 3, 2012 3:55:06 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=30,IsDisplayedGrid='Y' WHERE AD_Field_ID=200561 +; + +-- Oct 3, 2012 3:55:06 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=40,IsDisplayedGrid='Y' WHERE AD_Field_ID=200562 +; + +-- Oct 3, 2012 3:55:06 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=50,IsDisplayedGrid='Y' WHERE AD_Field_ID=200563 +; + +-- Oct 3, 2012 3:55:06 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=60,IsDisplayedGrid='Y' WHERE AD_Field_ID=200564 +; + +-- Oct 3, 2012 3:55:06 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=70,IsDisplayedGrid='Y' WHERE AD_Field_ID=200565 +; + +-- Oct 3, 2012 3:55:06 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=80,IsDisplayedGrid='Y' WHERE AD_Field_ID=200566 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=90,IsDisplayedGrid='Y' WHERE AD_Field_ID=200567 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=100,IsDisplayedGrid='Y' WHERE AD_Field_ID=200568 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=110,IsDisplayedGrid='Y' WHERE AD_Field_ID=200569 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=120,IsDisplayedGrid='Y' WHERE AD_Field_ID=200570 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=130,IsDisplayedGrid='Y' WHERE AD_Field_ID=200571 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=140,IsDisplayedGrid='Y' WHERE AD_Field_ID=200572 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=150,IsDisplayedGrid='Y' WHERE AD_Field_ID=200573 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=160,IsDisplayedGrid='Y' WHERE AD_Field_ID=200574 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=170,IsDisplayedGrid='Y' WHERE AD_Field_ID=200575 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=180,IsDisplayedGrid='Y' WHERE AD_Field_ID=200576 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=190,IsDisplayedGrid='Y' WHERE AD_Field_ID=200577 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=200,IsDisplayedGrid='Y' WHERE AD_Field_ID=200578 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=210,IsDisplayedGrid='Y' WHERE AD_Field_ID=200579 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=220,IsDisplayedGrid='Y' WHERE AD_Field_ID=200580 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=230,IsDisplayedGrid='Y' WHERE AD_Field_ID=200581 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=240,IsDisplayedGrid='Y' WHERE AD_Field_ID=200582 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=250,IsDisplayedGrid='Y' WHERE AD_Field_ID=200583 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=260,IsDisplayedGrid='Y' WHERE AD_Field_ID=200584 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=270,IsDisplayedGrid='Y' WHERE AD_Field_ID=200585 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=280,IsDisplayedGrid='Y' WHERE AD_Field_ID=200586 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=290,IsDisplayedGrid='Y' WHERE AD_Field_ID=200587 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=300,IsDisplayedGrid='Y' WHERE AD_Field_ID=200588 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=310,IsDisplayedGrid='Y' WHERE AD_Field_ID=200589 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=320,IsDisplayedGrid='Y' WHERE AD_Field_ID=200590 +; + +-- Oct 3, 2012 3:55:30 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Column SET IsMandatory='N', IsUpdateable='N',Updated=TO_DATE('2012-10-03 15:55:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5057 +; + +-- Oct 3, 2012 3:56:02 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Column SET IsParent='N',Updated=TO_DATE('2012-10-03 15:56:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5057 +; + +-- Oct 3, 2012 3:56:09 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +ALTER TABLE C_PaymentProcessor MODIFY C_BankAccount_ID NUMBER(10) DEFAULT NULL +; + +-- Oct 3, 2012 3:56:09 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +ALTER TABLE C_PaymentProcessor MODIFY C_BankAccount_ID NULL +; + +-- Oct 3, 2012 3:56:53 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Table SET AccessLevel='6', AD_Window_ID=NULL,Updated=TO_DATE('2012-10-03 15:56:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=398 +; + +-- Oct 3, 2012 3:57:12 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Table SET AD_Window_ID=200015,Updated=TO_DATE('2012-10-03 15:57:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=398 +; + +-- Oct 3, 2012 3:58:53 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Menu (AD_Window_ID,AD_Menu_ID,IsSummary,IsSOTrx,IsReadOnly,EntityType,IsCentrallyMaintained,Name,Description,Action,AD_Menu_UU,IsActive,AD_Client_ID,CreatedBy,Updated,AD_Org_ID,Created,UpdatedBy) VALUES (200015,200021,'N','Y','N','D','Y','Payment Processor','Maintain Payment Processor','W','8b19f811-50bc-435e-8722-9dc8a94244d0','Y',0,100,TO_DATE('2012-10-03 15:58:52','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2012-10-03 15:58:52','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Oct 3, 2012 3:58:53 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Menu_Trl_UU ) SELECT l.AD_Language,t.AD_Menu_ID, t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Menu_ID=200021 AND NOT EXISTS (SELECT * FROM AD_Menu_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Menu_ID=t.AD_Menu_ID) +; + +-- Oct 3, 2012 3:58:54 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo, AD_TreeNodeMM_UU) SELECT t.AD_Client_ID, 0, 'Y', SysDate, 100, SysDate, 100,t.AD_Tree_ID, 200021, 0, 999, Generate_UUID() FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.TreeType='MM' AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=200021) +; + +-- Oct 3, 2012 3:59:10 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=155 +; + +-- Oct 3, 2012 3:59:10 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=156 +; + +-- Oct 3, 2012 3:59:10 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=175 +; + +-- Oct 3, 2012 3:59:10 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=200021 +; + +-- Oct 3, 2012 3:59:10 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=4, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=157 +; + +-- Oct 3, 2012 3:59:10 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=5, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53251 +; + +-- Oct 3, 2012 3:59:10 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=6, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=552 +; + +-- Oct 3, 2012 3:59:14 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=441 +; + +-- Oct 3, 2012 3:59:14 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=149 +; + +-- Oct 3, 2012 3:59:14 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=50010 +; + +-- Oct 3, 2012 3:59:14 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=200010 +; + +-- Oct 3, 2012 3:59:14 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=4, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=171 +; + +-- Oct 3, 2012 3:59:14 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=5, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=437 +; + +-- Oct 3, 2012 3:59:14 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=6, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=240 +; + +-- Oct 3, 2012 3:59:14 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=7, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=200021 +; + +-- Oct 3, 2012 3:59:14 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=8, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=361 +; + +-- Oct 3, 2012 3:59:22 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=441 +; + +-- Oct 3, 2012 3:59:22 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=149 +; + +-- Oct 3, 2012 3:59:22 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=50010 +; + +-- Oct 3, 2012 3:59:22 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=200010 +; + +-- Oct 3, 2012 3:59:22 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=4, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=171 +; + +-- Oct 3, 2012 3:59:22 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=5, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=200021 +; + +-- Oct 3, 2012 3:59:22 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=6, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=437 +; + +-- Oct 3, 2012 3:59:22 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=7, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=240 +; + +-- Oct 3, 2012 3:59:22 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=8, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=200021 +; + +-- Oct 3, 2012 3:59:22 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=9, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=361 +; + +-- Oct 3, 2012 3:59:23 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=441 +; + +-- Oct 3, 2012 3:59:23 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=149 +; + +-- Oct 3, 2012 3:59:23 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=50010 +; + +-- Oct 3, 2012 3:59:23 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=200010 +; + +-- Oct 3, 2012 3:59:23 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=4, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=200021 +; + +-- Oct 3, 2012 3:59:23 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=5, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=171 +; + +-- Oct 3, 2012 3:59:23 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=6, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=200021 +; + +-- Oct 3, 2012 3:59:23 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=7, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=437 +; + +-- Oct 3, 2012 3:59:23 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=8, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=240 +; + +-- Oct 3, 2012 3:59:23 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=9, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=361 +; + +-- Oct 3, 2012 4:05:54 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',227,36,'N','N',60597,'Y',200591,'N','D','C_Bank_UU','N','Y','fdff0eca-55e9-44fd-a28f-dc601ee3ae4d',100,0,TO_DATE('2012-10-03 16:05:51','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 16:05:51','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Oct 3, 2012 4:05:54 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200591 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 4:06:17 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=200591 +; + +-- Oct 3, 2012 4:06:20 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=200591 +; + +-- Oct 3, 2012 4:06:54 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',228,36,'N','N',60598,'Y',200592,'N','D','C_BankAccount_UU','N','Y','978e72b4-e2d0-4a52-9547-3fba0277afa3',100,0,TO_DATE('2012-10-03 16:06:53','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 16:06:53','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Oct 3, 2012 4:06:54 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200592 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 4:06:54 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',228,10,'N','N',200579,'Y',200593,'N','The Payment Processor indicates the processor to be used for electronic payments','D','Payment processor for electronic payments','Payment Processor','N','Y','3aab6e76-c1ed-4f4d-ba1e-2b17a3194914',100,0,TO_DATE('2012-10-03 16:06:54','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-10-03 16:06:54','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Oct 3, 2012 4:06:55 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200593 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 4:07:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=200592 +; + +-- Oct 3, 2012 4:07:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=60881 +; + +-- Oct 3, 2012 4:07:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=2221 +; + +-- Oct 3, 2012 4:07:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=200593 +; + +-- Oct 3, 2012 4:07:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=200592 +; + +-- Oct 3, 2012 4:07:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=150,IsDisplayedGrid='Y' WHERE AD_Field_ID=60881 +; + +-- Oct 3, 2012 4:07:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=160,IsDisplayedGrid='Y' WHERE AD_Field_ID=2221 +; + +-- Oct 3, 2012 4:07:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=170,IsDisplayedGrid='Y' WHERE AD_Field_ID=200593 +; + +-- Oct 3, 2012 4:07:54 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_DATE('2012-10-03 16:07:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200593 +; + +-- Oct 3, 2012 4:09:00 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Tab SET IsActive='N',Updated=TO_DATE('2012-10-03 16:09:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=326 +; + +-- Oct 3, 2012 4:09:08 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +DELETE FROM AD_Tab_Trl WHERE AD_Tab_ID=326 +; + +-- Oct 3, 2012 4:09:09 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +DELETE FROM AD_Tab WHERE AD_Tab_ID=326 +; + +UPDATE C_BankAccount ba SET C_PaymentProcessor_ID = ( + SELECT pp.C_PaymentProcessor_ID + FROM C_PaymentProcessor pp + WHERE pp.C_BankAccount_ID IS NOT NULL + AND pp.C_BankAccount_ID = ba.C_BankAccount_ID) +WHERE ba.C_PaymentProcessor_ID IS NULL; + +UPDATE C_PaymentProcessor pp SET C_BankAccount_ID = NULL, AD_Client_ID = 0, AD_Org_ID = 0 + WHERE C_PaymentProcessor_ID IN (100, 101); + +SELECT register_migration_script('924_IDEMPIERE-447.sql') FROM dual +; \ No newline at end of file diff --git a/migration/360lts-release/postgresql/924_IDEMPIERE-447.sql b/migration/360lts-release/postgresql/924_IDEMPIERE-447.sql new file mode 100644 index 0000000000..c9bba7c88d --- /dev/null +++ b/migration/360lts-release/postgresql/924_IDEMPIERE-447.sql @@ -0,0 +1,1066 @@ +-- Oct 3, 2012 3:52:52 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,297,200579,'U','N','N','N',0,'N',10,'N',19,'N','N',1385,'N','Y','4dbd226a-1b09-4ae7-96dc-5c4379f249bc','N','Y','N','C_PaymentProcessor_ID','Payment processor for electronic payments','The Payment Processor indicates the processor to be used for electronic payments','Payment Processor','Y',100,TO_TIMESTAMP('2012-10-03 15:52:51','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-10-03 15:52:51','YYYY-MM-DD HH24:MI:SS'),100,0,0) +; + +-- Oct 3, 2012 3:52:53 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200579 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Oct 3, 2012 3:53:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +ALTER TABLE C_BankAccount ADD COLUMN C_PaymentProcessor_ID NUMERIC(10) DEFAULT NULL +; + +-- Oct 3, 2012 3:53:12 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2012-10-03 15:53:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200579 +; + +-- Oct 3, 2012 3:53:15 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO t_alter_column values('c_bankaccount','C_PaymentProcessor_ID','NUMERIC(10)',null,'NULL') +; + +-- Oct 3, 2012 3:53:54 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Window (WindowType,IsSOTrx,IsDefault,IsBetaFunctionality,WinHeight,WinWidth,EntityType,Name,AD_Window_ID,Processing,AD_Window_UU,Created,Updated,AD_Org_ID,AD_Client_ID,IsActive,UpdatedBy,CreatedBy) VALUES ('M','Y','N','N',0,0,'D','Payment Processor',200015,'N','be2857c6-7fdf-4c81-9431-c31855562b5d',TO_TIMESTAMP('2012-10-03 15:53:54','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-10-03 15:53:54','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',100,100) +; + +-- Oct 3, 2012 3:53:55 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Window_Trl (AD_Language,AD_Window_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Window_Trl_UU ) SELECT l.AD_Language,t.AD_Window_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Window t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Window_ID=200015 AND NOT EXISTS (SELECT * FROM AD_Window_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Window_ID=t.AD_Window_ID) +; + +-- Oct 3, 2012 3:54:14 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Tab (IsSingleRow,AD_Window_ID,SeqNo,IsTranslationTab,IsSortTab,AD_Table_ID,ImportFields,HasTree,IsReadOnly,IsInfoTab,IsInsertRecord,IsAdvancedTab,TabLevel,AD_Tab_UU,EntityType,Name,AD_Tab_ID,AD_Client_ID,AD_Org_ID,Created,CreatedBy,Updated,UpdatedBy,Processing,IsActive) VALUES ('N',200015,10,'N','N',398,'N','N','N','N','Y','N',0,'2929b7ec-62c4-46d9-a7cc-59728070eb40','D','Payment Processor',200024,0,0,TO_TIMESTAMP('2012-10-03 15:54:14','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2012-10-03 15:54:14','YYYY-MM-DD HH24:MI:SS'),100,'N','Y') +; + +-- Oct 3, 2012 3:54:14 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Tab_Trl (AD_Language,AD_Tab_ID, Help,CommitWarning,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Tab_Trl_UU ) SELECT l.AD_Language,t.AD_Tab_ID, t.Help,t.CommitWarning,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Tab t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Tab_ID=200024 AND NOT EXISTS (SELECT * FROM AD_Tab_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Tab_ID=t.AD_Tab_ID) +; + +-- Oct 3, 2012 3:54:26 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,14,'N','N',5054,10,'Y',200557,'N','The Payment Processor indicates the processor to be used for electronic payments','D','Payment processor for electronic payments','Payment Processor','N','N','e27b85cc-ad5f-4dc5-89f0-d9ed6661101b',100,0,TO_TIMESTAMP('2012-10-03 15:54:25','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:25','YYYY-MM-DD HH24:MI:SS'),'Y','N',10,1,2,1) +; + +-- Oct 3, 2012 3:54:26 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200557 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:27 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,14,'N','N',5163,20,'Y',200558,'Y','A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','D','Client/Tenant for this installation.','Client','N','Y','f8b7204e-62b4-4c4d-8cf6-1cb9b5d5d2fc',100,0,TO_TIMESTAMP('2012-10-03 15:54:27','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:27','YYYY-MM-DD HH24:MI:SS'),'Y','Y',20,1,2,1) +; + +-- Oct 3, 2012 3:54:27 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200558 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:28 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,14,'Y','N',5164,30,'Y',200559,'Y','An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','D','Organizational entity within client','Organization','N','Y','6f14f2a6-2419-41a8-8119-dd39f2f6ef8a',100,0,TO_TIMESTAMP('2012-10-03 15:54:27','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:27','YYYY-MM-DD HH24:MI:SS'),'Y','Y',30,4,2,1) +; + +-- Oct 3, 2012 3:54:28 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200559 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:29 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,14,'N','N',5057,40,'Y',200560,'Y','The Bank Account identifies an account at this Bank.','D','Account at the Bank','Bank Account','N','Y','ccc2dd6b-5108-4bb3-8701-063e21c7a0e7',100,0,TO_TIMESTAMP('2012-10-03 15:54:28','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:28','YYYY-MM-DD HH24:MI:SS'),'Y','Y',40,1,2,1) +; + +-- Oct 3, 2012 3:54:29 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200560 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:29 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES (1,'N',200024,60,'N','N',5055,50,'Y',200561,'N','The name of an entity (record) is used as an default search option in addition to the search key. The name is up to 60 characters in length.','D','Alphanumeric identifier of the entity','Name','N','Y','4951c671-36ed-4711-b92a-44db8de47051',100,0,TO_TIMESTAMP('2012-10-03 15:54:29','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:29','YYYY-MM-DD HH24:MI:SS'),'Y','Y',50,1,5,1) +; + +-- Oct 3, 2012 3:54:30 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200561 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:30 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,60,'N','N',5056,60,'Y',200562,'N','A description is limited to 255 characters.','D','Optional short description of the record','Description','N','Y','060b2eee-c0d8-416c-9e90-beea430b3fcd',100,0,TO_TIMESTAMP('2012-10-03 15:54:30','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:30','YYYY-MM-DD HH24:MI:SS'),'Y','Y',60,1,5,1) +; + +-- Oct 3, 2012 3:54:30 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200562 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:31 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,1,'N','N',5165,70,'Y',200563,'N','There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports. +There are two reasons for de-activating and not deleting records: +(1) The system requires the record for audit purposes. +(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','D','The record is active in the system','Active','N','Y','1010c8fe-fe5d-4769-9b06-02b019607ca5',100,0,TO_TIMESTAMP('2012-10-03 15:54:30','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:30','YYYY-MM-DD HH24:MI:SS'),'Y','Y',70,2,2,1) +; + +-- Oct 3, 2012 3:54:31 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200563 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:32 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,20,'N','N',5060,80,'Y',200564,'N','The Host Address identifies the URL or DNS of the target host','D','Host Address URL or DNS','Host Address','N','Y','c20bcb42-54ac-40e9-8d17-429df645f70e',100,0,TO_TIMESTAMP('2012-10-03 15:54:31','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:31','YYYY-MM-DD HH24:MI:SS'),'Y','Y',80,1,2,1) +; + +-- Oct 3, 2012 3:54:32 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200564 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:32 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,11,'Y','N',5061,90,'Y',200565,'N','The Host Port identifies the port to communicate with the host.','D','Host Communication Port','Host port','N','Y','054cddae-7028-4232-a2d4-77153dea73df',100,0,TO_TIMESTAMP('2012-10-03 15:54:32','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:32','YYYY-MM-DD HH24:MI:SS'),'Y','Y',90,4,2,1) +; + +-- Oct 3, 2012 3:54:32 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200565 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:33 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,20,'N','N',7798,100,'Y',200566,'N','Partner ID (Verisign) or Account ID (Optimal)','D','Partner ID or Account for the Payment Processor','Partner ID','N','Y','718f44d0-1000-4374-a88a-c3159f0b38ba',100,0,TO_TIMESTAMP('2012-10-03 15:54:32','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:32','YYYY-MM-DD HH24:MI:SS'),'Y','Y',100,1,2,1) +; + +-- Oct 3, 2012 3:54:33 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200566 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:34 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,20,'Y','N',7797,110,'Y',200567,'N','D','Vendor ID for the Payment Processor','Vendor ID','N','Y','16f5458d-fcd9-4ebf-aab8-fd6fbe1e378d',100,0,TO_TIMESTAMP('2012-10-03 15:54:33','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:33','YYYY-MM-DD HH24:MI:SS'),'Y','Y',110,4,2,1) +; + +-- Oct 3, 2012 3:54:34 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200567 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:34 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,20,'N','N',5058,120,'Y',200568,'N','The User ID identifies a user and allows access to records or processes.','D','User ID or account number','User ID','N','Y','44ae6576-129f-44e1-9bf0-acfddd6a7aae',100,0,TO_TIMESTAMP('2012-10-03 15:54:34','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:34','YYYY-MM-DD HH24:MI:SS'),'Y','Y',120,1,2,1) +; + +-- Oct 3, 2012 3:54:35 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200568 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:35 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('Y',200024,20,'Y','N',5059,130,'Y',200569,'N','The Password for this User. Passwords are required to identify authorized users. For Adempiere Users, you can change the password via the Process "Reset Password".','D','Password of any length (case sensitive)','Password','N','Y','e87e8ed4-2624-47d7-942c-232d64d933b1',100,0,TO_TIMESTAMP('2012-10-03 15:54:35','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:35','YYYY-MM-DD HH24:MI:SS'),'Y','Y',130,4,2,1) +; + +-- Oct 3, 2012 3:54:35 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200569 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:36 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,20,'N','N',5062,140,'Y',200570,'N','The Proxy Address must be defined if you must pass through a firewall to access your payment processor. ','D',' Address of your proxy server','Proxy address','N','Y','9d38e19d-fc52-4be3-94f1-daef7d2344fc',100,0,TO_TIMESTAMP('2012-10-03 15:54:35','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:35','YYYY-MM-DD HH24:MI:SS'),'Y','Y',140,1,2,1) +; + +-- Oct 3, 2012 3:54:36 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200570 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:37 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,11,'Y','N',5063,150,'Y',200571,'N','The Proxy Port identifies the port of your proxy server.','D','Port of your proxy server','Proxy port','N','Y','f59364c8-8fe5-4816-8310-3f4f493755a8',100,0,TO_TIMESTAMP('2012-10-03 15:54:36','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:36','YYYY-MM-DD HH24:MI:SS'),'Y','Y',150,4,2,1) +; + +-- Oct 3, 2012 3:54:37 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200571 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:38 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,20,'N','N',5064,160,'Y',200572,'N','The Proxy Logon identifies the Logon ID for your proxy server.','D','Logon of your proxy server','Proxy logon','N','Y','728771b9-c404-499e-9d8d-fdbb24ca6e1f',100,0,TO_TIMESTAMP('2012-10-03 15:54:37','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:37','YYYY-MM-DD HH24:MI:SS'),'Y','Y',160,1,2,1) +; + +-- Oct 3, 2012 3:54:38 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200572 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:39 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('Y',200024,20,'Y','N',5065,170,'Y',200573,'N','The Proxy Password identifies the password for your proxy server.','D','Password of your proxy server','Proxy password','N','Y','af4105cc-e6f6-4fd2-8ebe-f86b16ace1ad',100,0,TO_TIMESTAMP('2012-10-03 15:54:38','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:38','YYYY-MM-DD HH24:MI:SS'),'Y','Y',170,4,2,1) +; + +-- Oct 3, 2012 3:54:39 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200573 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:39 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,1,'N','N',5067,180,'Y',200574,'N','Indicates if Master Cards are accepted ','D','Accept Master Card','Accept MasterCard','N','Y','f00ba72b-d610-4d5b-8e50-07731549f2ad',100,0,TO_TIMESTAMP('2012-10-03 15:54:39','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:39','YYYY-MM-DD HH24:MI:SS'),'Y','Y',180,2,2,1) +; + +-- Oct 3, 2012 3:54:39 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200574 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:40 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,1,'Y','N',5066,190,'Y',200575,'N','Indicates if Visa Cards are accepted ','D','Accept Visa Cards','Accept Visa','N','Y','1a9b931f-7dc1-471c-829d-c73f83616371',100,0,TO_TIMESTAMP('2012-10-03 15:54:39','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:39','YYYY-MM-DD HH24:MI:SS'),'Y','Y',190,5,2,1) +; + +-- Oct 3, 2012 3:54:40 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200575 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:41 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,1,'N','N',5068,200,'Y',200576,'N','Indicates if American Express Cards are accepted','D','Accept American Express Card','Accept AMEX','N','Y','19614db3-d11f-4e06-8f71-c7905367fd1a',100,0,TO_TIMESTAMP('2012-10-03 15:54:40','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:40','YYYY-MM-DD HH24:MI:SS'),'Y','Y',200,2,2,1) +; + +-- Oct 3, 2012 3:54:41 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200576 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:42 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,1,'Y','N',5069,210,'Y',200577,'N','Indicates if Diner''s Club Cards are accepted ','D','Accept Diner''s Club','Accept Diners','N','Y','d14f97a6-f55d-418a-a58c-1a49357ed3a9',100,0,TO_TIMESTAMP('2012-10-03 15:54:41','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:41','YYYY-MM-DD HH24:MI:SS'),'Y','Y',210,5,2,1) +; + +-- Oct 3, 2012 3:54:42 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200577 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:42 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,1,'N','N',5073,220,'Y',200578,'N','Indicates if Corporate Purchase Cards are accepted ','D','Accept Corporate Purchase Cards','Accept Corporate','N','Y','aadbeb74-e953-49bb-8b8b-f3d37db88630',100,0,TO_TIMESTAMP('2012-10-03 15:54:42','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:42','YYYY-MM-DD HH24:MI:SS'),'Y','Y',220,2,2,1) +; + +-- Oct 3, 2012 3:54:42 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200578 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:43 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,1,'Y','N',5357,230,'Y',200579,'N','Indicates if Discover Cards are accepted','D','Accept Discover Card','Accept Discover','N','Y','b91b9eb8-591c-4146-9727-41aea3445387',100,0,TO_TIMESTAMP('2012-10-03 15:54:42','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:42','YYYY-MM-DD HH24:MI:SS'),'Y','Y',230,5,2,1) +; + +-- Oct 3, 2012 3:54:43 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200579 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:44 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,1,'N','N',5070,240,'Y',200580,'N','Indicates if Direct Deposits (wire transfers, etc.) are accepted. Direct Deposits are initiated by the payee.','D','Accept Direct Deposit (payee initiated)','Accept Direct Deposit','N','Y','daed29a8-24da-403a-bfba-9fd3b6fd33ce',100,0,TO_TIMESTAMP('2012-10-03 15:54:43','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:43','YYYY-MM-DD HH24:MI:SS'),'Y','Y',240,2,2,1) +; + +-- Oct 3, 2012 3:54:44 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200580 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:44 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,1,'Y','N',10763,250,'Y',200581,'N','Accept Direct Debit transactions. Direct Debits are initiated by the vendor who has permission to deduct amounts from the payee''s account.','D','Accept Direct Debits (vendor initiated)','Accept Direct Debit','N','Y','d202e8d5-89f9-4587-b864-38ba9d70289c',100,0,TO_TIMESTAMP('2012-10-03 15:54:44','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:44','YYYY-MM-DD HH24:MI:SS'),'Y','Y',250,5,2,1) +; + +-- Oct 3, 2012 3:54:44 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200581 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:45 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,1,'N','N',5071,260,'Y',200582,'N','Indicates if EChecks are accepted','D','Accept ECheck (Electronic Checks)','Accept Electronic Check','N','Y','0992214d-ed4f-4d58-b89e-a763a3775e28',100,0,TO_TIMESTAMP('2012-10-03 15:54:45','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:45','YYYY-MM-DD HH24:MI:SS'),'Y','Y',260,2,2,1) +; + +-- Oct 3, 2012 3:54:45 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200582 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:46 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,1,'Y','N',5072,270,'Y',200583,'N','Indicates if Bank ATM Cards are accepted','D','Accept Bank ATM Card','Accept ATM','N','Y','a752c4d3-dfed-4031-8ea4-6b8f73fceaf3',100,0,TO_TIMESTAMP('2012-10-03 15:54:45','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:45','YYYY-MM-DD HH24:MI:SS'),'Y','Y',270,5,2,1) +; + +-- Oct 3, 2012 3:54:46 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200583 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:47 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,26,'N','N',9832,280,'Y',200584,'N','D','Minimum Amount in Document Currency','Minimum Amt','N','Y','d0838a33-67b8-4833-8488-db678d6c7b5e',100,0,TO_TIMESTAMP('2012-10-03 15:54:46','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:46','YYYY-MM-DD HH24:MI:SS'),'Y','Y',280,1,2,1) +; + +-- Oct 3, 2012 3:54:47 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200584 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:47 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,14,'N','N',5360,290,'N',200585,'N','The Only Currency field indicates that this bank account accepts only the currency identified here.','D','Restrict accepting only this currency','Only Currency','N','Y','ae63d36f-5e17-4bca-b470-4f17bcd90e94',100,0,TO_TIMESTAMP('2012-10-03 15:54:47','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:47','YYYY-MM-DD HH24:MI:SS'),'Y','Y',290,1,2,1) +; + +-- Oct 3, 2012 3:54:47 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200585 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:48 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,1,'Y','N',5361,300,'Y',200586,'N','The Require CC Verification checkbox indicates if this bank accounts requires a verification number for credit card transactions.','D','Require 3/4 digit Credit Verification Code','Require CreditCard Verification Code','N','Y','d4087352-9d0c-464b-b44c-78219776dc2c',100,0,TO_TIMESTAMP('2012-10-03 15:54:47','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:47','YYYY-MM-DD HH24:MI:SS'),'Y','Y',300,5,2,1) +; + +-- Oct 3, 2012 3:54:48 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200586 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:49 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,14,'N','N',5319,310,'Y',200587,'N','The Sequence defines the numbering sequence to be used for documents.','D','Document Sequence','Sequence','N','Y','844c95b1-2338-4c92-a57c-834d2c698d82',100,0,TO_TIMESTAMP('2012-10-03 15:54:48','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:48','YYYY-MM-DD HH24:MI:SS'),'Y','Y',310,1,2,1) +; + +-- Oct 3, 2012 3:54:49 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200587 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:50 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,26,'N','N',5320,320,'Y',200588,'N','Payment Processor class identifies the Java class used to process payments extending the org.compiere.model.PaymentProcessor class.
    +Example implementations are Optimal Payments: org.compiere.model.PP_Optimal or Verisign: org.compiere.model.PP_PayFlowPro','D','Payment Processor Java Class','Payment Processor Class','N','Y','bd7bdcdf-5cbb-4572-ae84-cebf8cff2e78',100,0,TO_TIMESTAMP('2012-10-03 15:54:49','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:49','YYYY-MM-DD HH24:MI:SS'),'Y','Y',320,1,2,1) +; + +-- Oct 3, 2012 3:54:50 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200588 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:50 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,26,'N','N',5358,330,'Y',200589,'N','The Commission indicates (as a percentage) the commission to be paid.','D','Commission stated as a percentage','Commission %','N','Y','62d0f61e-a78e-4c8d-a782-3008d45f55fe',100,0,TO_TIMESTAMP('2012-10-03 15:54:50','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:50','YYYY-MM-DD HH24:MI:SS'),'Y','Y',330,1,2,1) +; + +-- Oct 3, 2012 3:54:50 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200589 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:54:51 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES ('N',200024,26,'Y','N',5359,340,'Y',200590,'N','The Cost per Transaction indicates the fixed cost per to be charged per transaction.','D','Fixed cost per transaction','Cost per transaction','N','Y','60e201df-0286-4e88-864f-24b56a91402d',100,0,TO_TIMESTAMP('2012-10-03 15:54:50','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 15:54:50','YYYY-MM-DD HH24:MI:SS'),'Y','Y',340,4,2,1) +; + +-- Oct 3, 2012 3:54:51 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200590 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 3:55:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=200560 +; + +-- Oct 3, 2012 3:55:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=200557 +; + +-- Oct 3, 2012 3:55:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=10,IsDisplayed='Y' WHERE AD_Field_ID=200558 +; + +-- Oct 3, 2012 3:55:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=20,IsDisplayed='Y' WHERE AD_Field_ID=200559 +; + +-- Oct 3, 2012 3:55:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=30,IsDisplayed='Y' WHERE AD_Field_ID=200561 +; + +-- Oct 3, 2012 3:55:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=40,IsDisplayed='Y' WHERE AD_Field_ID=200562 +; + +-- Oct 3, 2012 3:55:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=50,IsDisplayed='Y' WHERE AD_Field_ID=200563 +; + +-- Oct 3, 2012 3:55:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=200564 +; + +-- Oct 3, 2012 3:55:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=200565 +; + +-- Oct 3, 2012 3:55:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=200566 +; + +-- Oct 3, 2012 3:55:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=200567 +; + +-- Oct 3, 2012 3:55:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=200568 +; + +-- Oct 3, 2012 3:55:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=200569 +; + +-- Oct 3, 2012 3:55:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=200570 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=130,IsDisplayed='Y' WHERE AD_Field_ID=200571 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=140,IsDisplayed='Y' WHERE AD_Field_ID=200572 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=200573 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=200574 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=200575 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=200576 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=190,IsDisplayed='Y' WHERE AD_Field_ID=200577 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=200,IsDisplayed='Y' WHERE AD_Field_ID=200578 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=210,IsDisplayed='Y' WHERE AD_Field_ID=200579 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=220,IsDisplayed='Y' WHERE AD_Field_ID=200580 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=230,IsDisplayed='Y' WHERE AD_Field_ID=200581 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=240,IsDisplayed='Y' WHERE AD_Field_ID=200582 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=250,IsDisplayed='Y' WHERE AD_Field_ID=200583 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=260,IsDisplayed='Y' WHERE AD_Field_ID=200584 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=270,IsDisplayed='Y' WHERE AD_Field_ID=200585 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=280,IsDisplayed='Y' WHERE AD_Field_ID=200586 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=290,IsDisplayed='Y' WHERE AD_Field_ID=200587 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=300,IsDisplayed='Y' WHERE AD_Field_ID=200588 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=310,IsDisplayed='Y' WHERE AD_Field_ID=200589 +; + +-- Oct 3, 2012 3:55:04 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=320,IsDisplayed='Y' WHERE AD_Field_ID=200590 +; + +-- Oct 3, 2012 3:55:06 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=200560 +; + +-- Oct 3, 2012 3:55:06 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=200557 +; + +-- Oct 3, 2012 3:55:06 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=10,IsDisplayedGrid='Y' WHERE AD_Field_ID=200558 +; + +-- Oct 3, 2012 3:55:06 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=20,IsDisplayedGrid='Y' WHERE AD_Field_ID=200559 +; + +-- Oct 3, 2012 3:55:06 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=30,IsDisplayedGrid='Y' WHERE AD_Field_ID=200561 +; + +-- Oct 3, 2012 3:55:06 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=40,IsDisplayedGrid='Y' WHERE AD_Field_ID=200562 +; + +-- Oct 3, 2012 3:55:06 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=50,IsDisplayedGrid='Y' WHERE AD_Field_ID=200563 +; + +-- Oct 3, 2012 3:55:06 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=60,IsDisplayedGrid='Y' WHERE AD_Field_ID=200564 +; + +-- Oct 3, 2012 3:55:06 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=70,IsDisplayedGrid='Y' WHERE AD_Field_ID=200565 +; + +-- Oct 3, 2012 3:55:06 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=80,IsDisplayedGrid='Y' WHERE AD_Field_ID=200566 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=90,IsDisplayedGrid='Y' WHERE AD_Field_ID=200567 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=100,IsDisplayedGrid='Y' WHERE AD_Field_ID=200568 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=110,IsDisplayedGrid='Y' WHERE AD_Field_ID=200569 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=120,IsDisplayedGrid='Y' WHERE AD_Field_ID=200570 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=130,IsDisplayedGrid='Y' WHERE AD_Field_ID=200571 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=140,IsDisplayedGrid='Y' WHERE AD_Field_ID=200572 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=150,IsDisplayedGrid='Y' WHERE AD_Field_ID=200573 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=160,IsDisplayedGrid='Y' WHERE AD_Field_ID=200574 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=170,IsDisplayedGrid='Y' WHERE AD_Field_ID=200575 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=180,IsDisplayedGrid='Y' WHERE AD_Field_ID=200576 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=190,IsDisplayedGrid='Y' WHERE AD_Field_ID=200577 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=200,IsDisplayedGrid='Y' WHERE AD_Field_ID=200578 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=210,IsDisplayedGrid='Y' WHERE AD_Field_ID=200579 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=220,IsDisplayedGrid='Y' WHERE AD_Field_ID=200580 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=230,IsDisplayedGrid='Y' WHERE AD_Field_ID=200581 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=240,IsDisplayedGrid='Y' WHERE AD_Field_ID=200582 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=250,IsDisplayedGrid='Y' WHERE AD_Field_ID=200583 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=260,IsDisplayedGrid='Y' WHERE AD_Field_ID=200584 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=270,IsDisplayedGrid='Y' WHERE AD_Field_ID=200585 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=280,IsDisplayedGrid='Y' WHERE AD_Field_ID=200586 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=290,IsDisplayedGrid='Y' WHERE AD_Field_ID=200587 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=300,IsDisplayedGrid='Y' WHERE AD_Field_ID=200588 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=310,IsDisplayedGrid='Y' WHERE AD_Field_ID=200589 +; + +-- Oct 3, 2012 3:55:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=320,IsDisplayedGrid='Y' WHERE AD_Field_ID=200590 +; + +-- Oct 3, 2012 3:55:30 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Column SET IsMandatory='N', IsUpdateable='N',Updated=TO_TIMESTAMP('2012-10-03 15:55:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5057 +; + +-- Oct 3, 2012 3:56:02 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Column SET IsParent='N',Updated=TO_TIMESTAMP('2012-10-03 15:56:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5057 +; + +-- Oct 3, 2012 3:56:09 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO t_alter_column values('c_paymentprocessor','C_BankAccount_ID','NUMERIC(10)',null,'NULL') +; + +-- Oct 3, 2012 3:56:09 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO t_alter_column values('c_paymentprocessor','C_BankAccount_ID',null,'NULL',null) +; + +-- Oct 3, 2012 3:56:53 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Table SET AccessLevel='6', AD_Window_ID=NULL,Updated=TO_TIMESTAMP('2012-10-03 15:56:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=398 +; + +-- Oct 3, 2012 3:57:12 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Table SET AD_Window_ID=200015,Updated=TO_TIMESTAMP('2012-10-03 15:57:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=398 +; + +-- Oct 3, 2012 3:58:53 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Menu (AD_Window_ID,AD_Menu_ID,IsSummary,IsSOTrx,IsReadOnly,EntityType,IsCentrallyMaintained,Name,Description,"action",AD_Menu_UU,IsActive,AD_Client_ID,CreatedBy,Updated,AD_Org_ID,Created,UpdatedBy) VALUES (200015,200021,'N','Y','N','D','Y','Payment Processor','Maintain Payment Processor','W','8b19f811-50bc-435e-8722-9dc8a94244d0','Y',0,100,TO_TIMESTAMP('2012-10-03 15:58:52','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2012-10-03 15:58:52','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Oct 3, 2012 3:58:53 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Menu_Trl_UU ) SELECT l.AD_Language,t.AD_Menu_ID, t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Menu_ID=200021 AND NOT EXISTS (SELECT * FROM AD_Menu_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Menu_ID=t.AD_Menu_ID) +; + +-- Oct 3, 2012 3:58:54 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo, AD_TreeNodeMM_UU) SELECT t.AD_Client_ID, 0, 'Y', CURRENT_TIMESTAMP, 100, CURRENT_TIMESTAMP, 100,t.AD_Tree_ID, 200021, 0, 999, Generate_UUID() FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.TreeType='MM' AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=200021) +; + +-- Oct 3, 2012 3:59:10 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=0, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=155 +; + +-- Oct 3, 2012 3:59:10 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=1, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=156 +; + +-- Oct 3, 2012 3:59:10 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=2, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=175 +; + +-- Oct 3, 2012 3:59:10 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=3, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=200021 +; + +-- Oct 3, 2012 3:59:10 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=4, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=157 +; + +-- Oct 3, 2012 3:59:10 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=5, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53251 +; + +-- Oct 3, 2012 3:59:10 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=6, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=552 +; + +-- Oct 3, 2012 3:59:14 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=0, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=441 +; + +-- Oct 3, 2012 3:59:14 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=1, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=149 +; + +-- Oct 3, 2012 3:59:14 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=2, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=50010 +; + +-- Oct 3, 2012 3:59:14 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=3, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=200010 +; + +-- Oct 3, 2012 3:59:14 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=4, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=171 +; + +-- Oct 3, 2012 3:59:14 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=5, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=437 +; + +-- Oct 3, 2012 3:59:14 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=6, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=240 +; + +-- Oct 3, 2012 3:59:14 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=7, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=200021 +; + +-- Oct 3, 2012 3:59:14 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=8, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=361 +; + +-- Oct 3, 2012 3:59:22 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=0, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=441 +; + +-- Oct 3, 2012 3:59:22 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=1, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=149 +; + +-- Oct 3, 2012 3:59:22 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=2, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=50010 +; + +-- Oct 3, 2012 3:59:22 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=3, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=200010 +; + +-- Oct 3, 2012 3:59:22 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=4, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=171 +; + +-- Oct 3, 2012 3:59:22 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=5, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=200021 +; + +-- Oct 3, 2012 3:59:22 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=6, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=437 +; + +-- Oct 3, 2012 3:59:22 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=7, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=240 +; + +-- Oct 3, 2012 3:59:22 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=8, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=200021 +; + +-- Oct 3, 2012 3:59:22 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=9, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=361 +; + +-- Oct 3, 2012 3:59:23 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=0, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=441 +; + +-- Oct 3, 2012 3:59:23 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=1, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=149 +; + +-- Oct 3, 2012 3:59:23 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=2, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=50010 +; + +-- Oct 3, 2012 3:59:23 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=3, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=200010 +; + +-- Oct 3, 2012 3:59:23 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=4, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=200021 +; + +-- Oct 3, 2012 3:59:23 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=5, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=171 +; + +-- Oct 3, 2012 3:59:23 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=6, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=200021 +; + +-- Oct 3, 2012 3:59:23 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=7, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=437 +; + +-- Oct 3, 2012 3:59:23 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=8, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=240 +; + +-- Oct 3, 2012 3:59:23 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_TreeNodeMM SET Parent_ID=175, SeqNo=9, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=361 +; + +-- Oct 3, 2012 4:05:54 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',227,36,'N','N',60597,'Y',200591,'N','D','C_Bank_UU','N','Y','fdff0eca-55e9-44fd-a28f-dc601ee3ae4d',100,0,TO_TIMESTAMP('2012-10-03 16:05:51','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 16:05:51','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Oct 3, 2012 4:05:54 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200591 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 4:06:17 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=200591 +; + +-- Oct 3, 2012 4:06:20 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=200591 +; + +-- Oct 3, 2012 4:06:54 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',228,36,'N','N',60598,'Y',200592,'N','D','C_BankAccount_UU','N','Y','978e72b4-e2d0-4a52-9547-3fba0277afa3',100,0,TO_TIMESTAMP('2012-10-03 16:06:53','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 16:06:53','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Oct 3, 2012 4:06:54 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200592 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 4:06:54 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',228,10,'N','N',200579,'Y',200593,'N','The Payment Processor indicates the processor to be used for electronic payments','D','Payment processor for electronic payments','Payment Processor','N','Y','3aab6e76-c1ed-4f4d-ba1e-2b17a3194914',100,0,TO_TIMESTAMP('2012-10-03 16:06:54','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-10-03 16:06:54','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Oct 3, 2012 4:06:55 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200593 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Oct 3, 2012 4:07:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=200592 +; + +-- Oct 3, 2012 4:07:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=60881 +; + +-- Oct 3, 2012 4:07:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=2221 +; + +-- Oct 3, 2012 4:07:03 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=200593 +; + +-- Oct 3, 2012 4:07:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=200592 +; + +-- Oct 3, 2012 4:07:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=150,IsDisplayedGrid='Y' WHERE AD_Field_ID=60881 +; + +-- Oct 3, 2012 4:07:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=160,IsDisplayedGrid='Y' WHERE AD_Field_ID=2221 +; + +-- Oct 3, 2012 4:07:07 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET SeqNoGrid=170,IsDisplayedGrid='Y' WHERE AD_Field_ID=200593 +; + +-- Oct 3, 2012 4:07:54 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_TIMESTAMP('2012-10-03 16:07:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200593 +; + +-- Oct 3, 2012 4:09:00 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +UPDATE AD_Tab SET IsActive='N',Updated=TO_TIMESTAMP('2012-10-03 16:09:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=326 +; + +-- Oct 3, 2012 4:09:08 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +DELETE FROM AD_Tab_Trl WHERE AD_Tab_ID=326 +; + +-- Oct 3, 2012 4:09:09 PM SGT +-- IDEMPIERE-447 Abstract Payment Processor from Tenant configuration +DELETE FROM AD_Tab WHERE AD_Tab_ID=326 +; + +UPDATE C_BankAccount ba SET C_PaymentProcessor_ID = ( + SELECT pp.C_PaymentProcessor_ID + FROM C_PaymentProcessor pp + WHERE pp.C_BankAccount_ID IS NOT NULL + AND pp.C_BankAccount_ID = ba.C_BankAccount_ID) +WHERE ba.C_PaymentProcessor_ID IS NULL; + +UPDATE C_PaymentProcessor pp SET C_BankAccount_ID = NULL, AD_Client_ID = 0, AD_Org_ID = 0 + WHERE C_PaymentProcessor_ID IN (100, 101); + +SELECT register_migration_script('924_IDEMPIERE-447.sql') FROM dual +; \ No newline at end of file diff --git a/org.adempiere.base/src/org/adempiere/base/Core.java b/org.adempiere.base/src/org/adempiere/base/Core.java index 5a4f41d260..9cb8e84f3c 100644 --- a/org.adempiere.base/src/org/adempiere/base/Core.java +++ b/org.adempiere.base/src/org/adempiere/base/Core.java @@ -111,7 +111,9 @@ public class Core { } // PaymentProcessor myProcessor = null; - myProcessor = Service.locate(PaymentProcessor.class); + ServiceQuery query = new ServiceQuery(); + query.put(ServiceQuery.EXTENSION_ID, className); + myProcessor = Service.locate(PaymentProcessor.class, query); if (myProcessor == null) { try { Class ppClass = Class.forName(className); diff --git a/org.adempiere.base/src/org/compiere/model/I_C_BankAccount.java b/org.adempiere.base/src/org/compiere/model/I_C_BankAccount.java index 244c4add98..ad64446083 100644 --- a/org.adempiere.base/src/org/compiere/model/I_C_BankAccount.java +++ b/org.adempiere.base/src/org/compiere/model/I_C_BankAccount.java @@ -101,6 +101,21 @@ public interface I_C_BankAccount */ public String getBBAN(); + /** Column name C_Bank_ID */ + public static final String COLUMNNAME_C_Bank_ID = "C_Bank_ID"; + + /** Set Bank. + * Bank + */ + public void setC_Bank_ID (int C_Bank_ID); + + /** Get Bank. + * Bank + */ + public int getC_Bank_ID(); + + public org.compiere.model.I_C_Bank getC_Bank() throws RuntimeException; + /** Column name C_BankAccount_ID */ public static final String COLUMNNAME_C_BankAccount_ID = "C_BankAccount_ID"; @@ -123,21 +138,6 @@ public interface I_C_BankAccount /** Get C_BankAccount_UU */ public String getC_BankAccount_UU(); - /** Column name C_Bank_ID */ - public static final String COLUMNNAME_C_Bank_ID = "C_Bank_ID"; - - /** Set Bank. - * Bank - */ - public void setC_Bank_ID (int C_Bank_ID); - - /** Get Bank. - * Bank - */ - public int getC_Bank_ID(); - - public org.compiere.model.I_C_Bank getC_Bank() throws RuntimeException; - /** Column name C_Currency_ID */ public static final String COLUMNNAME_C_Currency_ID = "C_Currency_ID"; @@ -153,6 +153,21 @@ public interface I_C_BankAccount public org.compiere.model.I_C_Currency getC_Currency() throws RuntimeException; + /** Column name C_PaymentProcessor_ID */ + public static final String COLUMNNAME_C_PaymentProcessor_ID = "C_PaymentProcessor_ID"; + + /** Set Payment Processor. + * Payment processor for electronic payments + */ + public void setC_PaymentProcessor_ID (int C_PaymentProcessor_ID); + + /** Get Payment Processor. + * Payment processor for electronic payments + */ + public int getC_PaymentProcessor_ID(); + + public org.compiere.model.I_C_PaymentProcessor getC_PaymentProcessor() throws RuntimeException; + /** Column name Created */ public static final String COLUMNNAME_Created = "Created"; diff --git a/org.adempiere.base/src/org/compiere/model/I_C_PaymentProcessor.java b/org.adempiere.base/src/org/compiere/model/I_C_PaymentProcessor.java index d8151182f9..4fd01f9972 100644 --- a/org.adempiere.base/src/org/compiere/model/I_C_PaymentProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/I_C_PaymentProcessor.java @@ -31,13 +31,13 @@ public interface I_C_PaymentProcessor public static final String Table_Name = "C_PaymentProcessor"; /** AD_Table_ID=398 */ - public static final int Table_ID = MTable.getTable_ID(Table_Name); + public static final int Table_ID = 398; KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); - /** AccessLevel = 3 - Client - Org + /** AccessLevel = 6 - System - Client */ - BigDecimal accessLevel = BigDecimal.valueOf(3); + BigDecimal accessLevel = BigDecimal.valueOf(6); /** Load Meta Data */ @@ -205,7 +205,7 @@ public interface I_C_PaymentProcessor */ public int getAD_Sequence_ID(); - public I_AD_Sequence getAD_Sequence() throws RuntimeException; + public org.compiere.model.I_AD_Sequence getAD_Sequence() throws RuntimeException; /** Column name C_BankAccount_ID */ public static final String COLUMNNAME_C_BankAccount_ID = "C_BankAccount_ID"; @@ -220,7 +220,7 @@ public interface I_C_PaymentProcessor */ public int getC_BankAccount_ID(); - public I_C_BankAccount getC_BankAccount() throws RuntimeException; + public org.compiere.model.I_C_BankAccount getC_BankAccount() throws RuntimeException; /** Column name C_Currency_ID */ public static final String COLUMNNAME_C_Currency_ID = "C_Currency_ID"; @@ -235,7 +235,29 @@ public interface I_C_PaymentProcessor */ public int getC_Currency_ID(); - public I_C_Currency getC_Currency() throws RuntimeException; + public org.compiere.model.I_C_Currency getC_Currency() throws RuntimeException; + + /** Column name C_PaymentProcessor_ID */ + public static final String COLUMNNAME_C_PaymentProcessor_ID = "C_PaymentProcessor_ID"; + + /** Set Payment Processor. + * Payment processor for electronic payments + */ + public void setC_PaymentProcessor_ID (int C_PaymentProcessor_ID); + + /** Get Payment Processor. + * Payment processor for electronic payments + */ + public int getC_PaymentProcessor_ID(); + + /** Column name C_PaymentProcessor_UU */ + public static final String COLUMNNAME_C_PaymentProcessor_UU = "C_PaymentProcessor_UU"; + + /** Set C_PaymentProcessor_UU */ + public void setC_PaymentProcessor_UU (String C_PaymentProcessor_UU); + + /** Get C_PaymentProcessor_UU */ + public String getC_PaymentProcessor_UU(); /** Column name Commission */ public static final String COLUMNNAME_Commission = "Commission"; @@ -263,19 +285,6 @@ public interface I_C_PaymentProcessor */ public BigDecimal getCostPerTrx(); - /** Column name C_PaymentProcessor_ID */ - public static final String COLUMNNAME_C_PaymentProcessor_ID = "C_PaymentProcessor_ID"; - - /** Set Payment Processor. - * Payment processor for electronic payments - */ - public void setC_PaymentProcessor_ID (int C_PaymentProcessor_ID); - - /** Get Payment Processor. - * Payment processor for electronic payments - */ - public int getC_PaymentProcessor_ID(); - /** Column name Created */ public static final String COLUMNNAME_Created = "Created"; diff --git a/org.adempiere.base/src/org/compiere/model/MPayment.java b/org.adempiere.base/src/org/compiere/model/MPayment.java index 1939101d13..3794e559a2 100644 --- a/org.adempiere.base/src/org/compiere/model/MPayment.java +++ b/org.adempiere.base/src/org/compiere/model/MPayment.java @@ -162,10 +162,10 @@ public final class MPayment extends X_C_Payment super(ctx, rs, trxName); } // MPayment - /** Temporary Payment Processors */ - private MPaymentProcessor[] m_mPaymentProcessors = null; - /** Temporary Payment Processor */ - private MPaymentProcessor m_mPaymentProcessor = null; + /** Temporary Bank Accounts & Payment Processors */ + private MBankAccount[] m_mBankAccounts = null; + /** Temporary Bank Account & Payment Processor */ + private MBankAccount m_mBankAccount = null; /** Logger */ private static CLogger s_log = CLogger.getCLogger (MPayment.class); /** Error Message */ @@ -466,9 +466,9 @@ public final class MPayment extends X_C_Payment return true; } - if (m_mPaymentProcessor == null) + if (m_mBankAccount == null) setPaymentProcessor(); - if (m_mPaymentProcessor == null) + if (m_mBankAccount == null) { log.log(Level.WARNING, "No Payment Processor Model"); setErrorMessage("No Payment Processor Model"); @@ -479,7 +479,8 @@ public final class MPayment extends X_C_Payment try { - PaymentProcessor pp = PaymentProcessor.create(m_mPaymentProcessor, this); + MPaymentProcessor paymentProcessor = new MPaymentProcessor(m_mBankAccount.getCtx(), m_mBankAccount.getC_PaymentProcessor_ID(), m_mBankAccount.get_TrxName()); + PaymentProcessor pp = PaymentProcessor.create(paymentProcessor, this); if (pp == null) setErrorMessage("No Payment Processor"); else @@ -825,30 +826,33 @@ public final class MPayment extends X_C_Payment */ public boolean setPaymentProcessor (String tender, String CCType) { - m_mPaymentProcessor = null; + m_mBankAccount = null; // Get Processor List - if (m_mPaymentProcessors == null || m_mPaymentProcessors.length == 0) - m_mPaymentProcessors = MPaymentProcessor.find (getCtx(), tender, CCType, getAD_Client_ID(), + if (m_mBankAccounts == null || m_mBankAccounts.length == 0) + m_mBankAccounts = MPaymentProcessor.find (getCtx(), tender, CCType, getAD_Client_ID(), getC_Currency_ID(), getPayAmt(), get_TrxName()); // Relax Amount - if (m_mPaymentProcessors == null || m_mPaymentProcessors.length == 0) - m_mPaymentProcessors = MPaymentProcessor.find (getCtx(), tender, CCType, getAD_Client_ID(), + if (m_mBankAccounts == null || m_mBankAccounts.length == 0) + m_mBankAccounts = MPaymentProcessor.find (getCtx(), tender, CCType, getAD_Client_ID(), getC_Currency_ID(), Env.ZERO, get_TrxName()); - if (m_mPaymentProcessors == null || m_mPaymentProcessors.length == 0) + if (m_mBankAccounts == null || m_mBankAccounts.length == 0) return false; // Find the first right one - for (int i = 0; i < m_mPaymentProcessors.length; i++) + for (int i = 0; i < m_mBankAccounts.length; i++) { - if (m_mPaymentProcessors[i].accepts (tender, CCType)) + MBankAccount bankAccount = m_mBankAccounts[i]; + MPaymentProcessor paymentProcessor = new MPaymentProcessor(bankAccount.getCtx(), bankAccount.getC_PaymentProcessor_ID(), bankAccount.get_TrxName()); + if (paymentProcessor.accepts (tender, CCType)) { - m_mPaymentProcessor = m_mPaymentProcessors[i]; + m_mBankAccount = m_mBankAccounts[i]; + break; } } - if (m_mPaymentProcessor != null) - setC_BankAccount_ID (m_mPaymentProcessor.getC_BankAccount_ID()); + if (m_mBankAccount != null) + setC_BankAccount_ID (m_mBankAccount.getC_BankAccount_ID()); // - return m_mPaymentProcessor != null; + return m_mBankAccount != null; } // setPaymentProcessor @@ -871,30 +875,32 @@ public final class MPayment extends X_C_Payment { try { - if (m_mPaymentProcessors == null || m_mPaymentProcessors.length == 0) - m_mPaymentProcessors = MPaymentProcessor.find (getCtx (), null, null, + if (m_mBankAccounts == null || m_mBankAccounts.length == 0) + m_mBankAccounts = MPaymentProcessor.find (getCtx (), null, null, getAD_Client_ID (), getC_Currency_ID (), amt, get_TrxName()); // HashMap map = new HashMap(); // to eliminate duplicates - for (int i = 0; i < m_mPaymentProcessors.length; i++) + for (int i = 0; i < m_mBankAccounts.length; i++) { - if (m_mPaymentProcessors[i].isAcceptAMEX ()) + MBankAccount bankAccount = m_mBankAccounts[i]; + MPaymentProcessor paymentProcessor = new MPaymentProcessor(bankAccount.getCtx(), bankAccount.getC_PaymentProcessor_ID(), bankAccount.get_TrxName()); + if (paymentProcessor.isAcceptAMEX ()) map.put (CREDITCARDTYPE_Amex, getCreditCardPair (CREDITCARDTYPE_Amex)); - if (m_mPaymentProcessors[i].isAcceptDiners ()) + if (paymentProcessor.isAcceptDiners ()) map.put (CREDITCARDTYPE_Diners, getCreditCardPair (CREDITCARDTYPE_Diners)); - if (m_mPaymentProcessors[i].isAcceptDiscover ()) + if (paymentProcessor.isAcceptDiscover ()) map.put (CREDITCARDTYPE_Discover, getCreditCardPair (CREDITCARDTYPE_Discover)); - if (m_mPaymentProcessors[i].isAcceptMC ()) + if (paymentProcessor.isAcceptMC ()) map.put (CREDITCARDTYPE_MasterCard, getCreditCardPair (CREDITCARDTYPE_MasterCard)); - if (m_mPaymentProcessors[i].isAcceptCorporate ()) + if (paymentProcessor.isAcceptCorporate ()) map.put (CREDITCARDTYPE_PurchaseCard, getCreditCardPair (CREDITCARDTYPE_PurchaseCard)); - if (m_mPaymentProcessors[i].isAcceptVisa ()) + if (paymentProcessor.isAcceptVisa ()) map.put (CREDITCARDTYPE_Visa, getCreditCardPair (CREDITCARDTYPE_Visa)); } // for all payment processors // ValueNamePair[] retValue = new ValueNamePair[map.size ()]; map.values ().toArray (retValue); - log.fine("getCreditCards - #" + retValue.length + " - Processors=" + m_mPaymentProcessors.length); + log.fine("getCreditCards - #" + retValue.length + " - Processors=" + m_mBankAccounts.length); return retValue; } catch (Exception ex) diff --git a/org.adempiere.base/src/org/compiere/model/MPaymentProcessor.java b/org.adempiere.base/src/org/compiere/model/MPaymentProcessor.java index 880b8ae021..97e4ae4ccf 100644 --- a/org.adempiere.base/src/org/compiere/model/MPaymentProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/MPaymentProcessor.java @@ -43,7 +43,7 @@ public class MPaymentProcessor extends X_C_PaymentProcessor private static final long serialVersionUID = 8514876566904723695L; - public static MPaymentProcessor[] find (Properties ctx, + public static MBankAccount[] find (Properties ctx, String tender, String CCType, int AD_Client_ID, int AD_Org_ID, int C_Currency_ID, BigDecimal Amt, String trxName) { @@ -61,37 +61,40 @@ public class MPaymentProcessor extends X_C_PaymentProcessor * @param trxName transaction * @return Array of BankAccount[0] & PaymentProcessor[1] or null */ - protected static MPaymentProcessor[] find (Properties ctx, + protected static MBankAccount[] find (Properties ctx, String tender, String CCType, int AD_Client_ID, int C_Currency_ID, BigDecimal Amt, String trxName) { - ArrayList list = new ArrayList(); - StringBuffer sql = new StringBuffer("SELECT * " - + "FROM C_PaymentProcessor " - + "WHERE AD_Client_ID=? AND IsActive='Y'" // #1 - + " AND (C_Currency_ID IS NULL OR C_Currency_ID=?)" // #2 - + " AND (MinimumAmt IS NULL OR MinimumAmt = 0 OR MinimumAmt <= ?)"); // #3 + ArrayList list = new ArrayList(); + StringBuffer sql = new StringBuffer("SELECT ba.* " + + "FROM C_PaymentProcessor pp, C_BankAccount ba " + + "WHERE pp.C_PaymentProcessor_ID = ba.C_PaymentProcessor_ID" + + " AND ba.AD_Client_ID=? AND ba.IsActive='Y'" // #1 + + " AND pp.IsActive='Y' " + + " AND (pp.C_Currency_ID IS NULL OR pp.C_Currency_ID=?)" // #2 + + " AND (pp.MinimumAmt IS NULL OR pp.MinimumAmt = 0 OR pp.MinimumAmt <= ?)"); // #3 if (MPayment.TENDERTYPE_DirectDeposit.equals(tender)) - sql.append(" AND AcceptDirectDeposit='Y'"); + sql.append(" AND pp.AcceptDirectDeposit='Y'"); else if (MPayment.TENDERTYPE_DirectDebit.equals(tender)) - sql.append(" AND AcceptDirectDebit='Y'"); + sql.append(" AND pp.AcceptDirectDebit='Y'"); else if (MPayment.TENDERTYPE_Check.equals(tender)) - sql.append(" AND AcceptCheck='Y'"); + sql.append(" AND pp.AcceptCheck='Y'"); // CreditCards else if (MPayment.CREDITCARDTYPE_ATM.equals(CCType)) - sql.append(" AND AcceptATM='Y'"); + sql.append(" AND pp.AcceptATM='Y'"); else if (MPayment.CREDITCARDTYPE_Amex.equals(CCType)) - sql.append(" AND AcceptAMEX='Y'"); + sql.append(" AND pp.AcceptAMEX='Y'"); else if (MPayment.CREDITCARDTYPE_Visa.equals(CCType)) - sql.append(" AND AcceptVISA='Y'"); + sql.append(" AND pp.AcceptVISA='Y'"); else if (MPayment.CREDITCARDTYPE_MasterCard.equals(CCType)) - sql.append(" AND AcceptMC='Y'"); + sql.append(" AND pp.AcceptMC='Y'"); else if (MPayment.CREDITCARDTYPE_Diners.equals(CCType)) - sql.append(" AND AcceptDiners='Y'"); + sql.append(" AND pp.AcceptDiners='Y'"); else if (MPayment.CREDITCARDTYPE_Discover.equals(CCType)) - sql.append(" AND AcceptDiscover='Y'"); + sql.append(" AND pp.AcceptDiscover='Y'"); else if (MPayment.CREDITCARDTYPE_PurchaseCard.equals(CCType)) - sql.append(" AND AcceptCORPORATE='Y'"); + sql.append(" AND pp.AcceptCORPORATE='Y'"); + sql.append(" ORDER BY ba.IsDefault DESC "); // try { @@ -101,7 +104,7 @@ public class MPaymentProcessor extends X_C_PaymentProcessor pstmt.setBigDecimal(3, Amt); ResultSet rs = pstmt.executeQuery(); while (rs.next()) - list.add(new MPaymentProcessor (ctx, rs, trxName)); + list.add(new MBankAccount (ctx, rs, trxName)); rs.close(); pstmt.close(); } @@ -117,7 +120,7 @@ public class MPaymentProcessor extends X_C_PaymentProcessor else s_log.fine("find - #" + list.size() + " - AD_Client_ID=" + AD_Client_ID + ", C_Currency_ID=" + C_Currency_ID + ", Amt=" + Amt); - MPaymentProcessor[] retValue = new MPaymentProcessor[list.size()]; + MBankAccount[] retValue = new MBankAccount[list.size()]; list.toArray(retValue); return retValue; } // find @@ -205,4 +208,27 @@ public class MPaymentProcessor extends X_C_PaymentProcessor return false; } // accepts + /** + * @deprecated Use C_BankAccount.C_PaymentProcessor_ID + */ + @Override + public I_C_BankAccount getC_BankAccount() throws RuntimeException { + return super.getC_BankAccount(); + } + + /** + * @deprecated Use C_BankAccount.C_PaymentProcessor_ID + */ + @Override + public void setC_BankAccount_ID(int C_BankAccount_ID) { + super.setC_BankAccount_ID(C_BankAccount_ID); + } + + /** + * @deprecated Use C_BankAccount.C_PaymentProcessor_ID + */ + @Override + public int getC_BankAccount_ID() { + return super.getC_BankAccount_ID(); + } } // MPaymentProcessor diff --git a/org.adempiere.base/src/org/compiere/model/X_C_BankAccount.java b/org.adempiere.base/src/org/compiere/model/X_C_BankAccount.java index 69925d195d..423639d7b7 100644 --- a/org.adempiere.base/src/org/compiere/model/X_C_BankAccount.java +++ b/org.adempiere.base/src/org/compiere/model/X_C_BankAccount.java @@ -32,7 +32,7 @@ public class X_C_BankAccount extends PO implements I_C_BankAccount, I_Persistent /** * */ - private static final long serialVersionUID = 20120906L; + private static final long serialVersionUID = 20121003L; /** Standard Constructor */ public X_C_BankAccount (Properties ctx, int C_BankAccount_ID, String trxName) @@ -42,8 +42,8 @@ public class X_C_BankAccount extends PO implements I_C_BankAccount, I_Persistent { setAccountNo (null); setBankAccountType (null); - setC_BankAccount_ID (0); setC_Bank_ID (0); + setC_BankAccount_ID (0); setC_Currency_ID (0); setCreditLimit (Env.ZERO); setCurrentBalance (Env.ZERO); @@ -143,6 +143,34 @@ public class X_C_BankAccount extends PO implements I_C_BankAccount, I_Persistent return (String)get_Value(COLUMNNAME_BBAN); } + public org.compiere.model.I_C_Bank getC_Bank() throws RuntimeException + { + return (org.compiere.model.I_C_Bank)MTable.get(getCtx(), org.compiere.model.I_C_Bank.Table_Name) + .getPO(getC_Bank_ID(), get_TrxName()); } + + /** Set Bank. + @param C_Bank_ID + Bank + */ + public void setC_Bank_ID (int C_Bank_ID) + { + if (C_Bank_ID < 1) + set_ValueNoCheck (COLUMNNAME_C_Bank_ID, null); + else + set_ValueNoCheck (COLUMNNAME_C_Bank_ID, Integer.valueOf(C_Bank_ID)); + } + + /** Get Bank. + @return Bank + */ + public int getC_Bank_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Bank_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + /** Set Bank Account. @param C_BankAccount_ID Account at the Bank @@ -180,34 +208,6 @@ public class X_C_BankAccount extends PO implements I_C_BankAccount, I_Persistent return (String)get_Value(COLUMNNAME_C_BankAccount_UU); } - public org.compiere.model.I_C_Bank getC_Bank() throws RuntimeException - { - return (org.compiere.model.I_C_Bank)MTable.get(getCtx(), org.compiere.model.I_C_Bank.Table_Name) - .getPO(getC_Bank_ID(), get_TrxName()); } - - /** Set Bank. - @param C_Bank_ID - Bank - */ - public void setC_Bank_ID (int C_Bank_ID) - { - if (C_Bank_ID < 1) - set_ValueNoCheck (COLUMNNAME_C_Bank_ID, null); - else - set_ValueNoCheck (COLUMNNAME_C_Bank_ID, Integer.valueOf(C_Bank_ID)); - } - - /** Get Bank. - @return Bank - */ - public int getC_Bank_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_C_Bank_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - public org.compiere.model.I_C_Currency getC_Currency() throws RuntimeException { return (org.compiere.model.I_C_Currency)MTable.get(getCtx(), org.compiere.model.I_C_Currency.Table_Name) @@ -236,6 +236,34 @@ public class X_C_BankAccount extends PO implements I_C_BankAccount, I_Persistent return ii.intValue(); } + public org.compiere.model.I_C_PaymentProcessor getC_PaymentProcessor() throws RuntimeException + { + return (org.compiere.model.I_C_PaymentProcessor)MTable.get(getCtx(), org.compiere.model.I_C_PaymentProcessor.Table_Name) + .getPO(getC_PaymentProcessor_ID(), get_TrxName()); } + + /** Set Payment Processor. + @param C_PaymentProcessor_ID + Payment processor for electronic payments + */ + public void setC_PaymentProcessor_ID (int C_PaymentProcessor_ID) + { + if (C_PaymentProcessor_ID < 1) + set_Value (COLUMNNAME_C_PaymentProcessor_ID, null); + else + set_Value (COLUMNNAME_C_PaymentProcessor_ID, Integer.valueOf(C_PaymentProcessor_ID)); + } + + /** Get Payment Processor. + @return Payment processor for electronic payments + */ + public int getC_PaymentProcessor_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_PaymentProcessor_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + /** Set Credit limit. @param CreditLimit Amount of Credit allowed diff --git a/org.adempiere.base/src/org/compiere/model/X_C_PaymentProcessor.java b/org.adempiere.base/src/org/compiere/model/X_C_PaymentProcessor.java index 6109c8989b..6c6955d961 100644 --- a/org.adempiere.base/src/org/compiere/model/X_C_PaymentProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/X_C_PaymentProcessor.java @@ -32,7 +32,7 @@ public class X_C_PaymentProcessor extends PO implements I_C_PaymentProcessor, I_ /** * */ - private static final long serialVersionUID = 20100614L; + private static final long serialVersionUID = 20121003L; /** Standard Constructor */ public X_C_PaymentProcessor (Properties ctx, int C_PaymentProcessor_ID, String trxName) @@ -50,10 +50,9 @@ public class X_C_PaymentProcessor extends PO implements I_C_PaymentProcessor, I_ setAcceptDiscover (false); setAcceptMC (false); setAcceptVisa (false); - setC_BankAccount_ID (0); + setC_PaymentProcessor_ID (0); setCommission (Env.ZERO); setCostPerTrx (Env.ZERO); - setC_PaymentProcessor_ID (0); setHostAddress (null); setHostPort (0); setName (null); @@ -70,7 +69,7 @@ public class X_C_PaymentProcessor extends PO implements I_C_PaymentProcessor, I_ } /** AccessLevel - * @return 3 - Client - Org + * @return 6 - System - Client */ protected int get_AccessLevel() { @@ -331,9 +330,9 @@ public class X_C_PaymentProcessor extends PO implements I_C_PaymentProcessor, I_ return false; } - public I_AD_Sequence getAD_Sequence() throws RuntimeException + public org.compiere.model.I_AD_Sequence getAD_Sequence() throws RuntimeException { - return (I_AD_Sequence)MTable.get(getCtx(), I_AD_Sequence.Table_Name) + return (org.compiere.model.I_AD_Sequence)MTable.get(getCtx(), org.compiere.model.I_AD_Sequence.Table_Name) .getPO(getAD_Sequence_ID(), get_TrxName()); } /** Set Sequence. @@ -359,9 +358,9 @@ public class X_C_PaymentProcessor extends PO implements I_C_PaymentProcessor, I_ return ii.intValue(); } - public I_C_BankAccount getC_BankAccount() throws RuntimeException + public org.compiere.model.I_C_BankAccount getC_BankAccount() throws RuntimeException { - return (I_C_BankAccount)MTable.get(getCtx(), I_C_BankAccount.Table_Name) + return (org.compiere.model.I_C_BankAccount)MTable.get(getCtx(), org.compiere.model.I_C_BankAccount.Table_Name) .getPO(getC_BankAccount_ID(), get_TrxName()); } /** Set Bank Account. @@ -387,9 +386,9 @@ public class X_C_PaymentProcessor extends PO implements I_C_PaymentProcessor, I_ return ii.intValue(); } - public I_C_Currency getC_Currency() throws RuntimeException + public org.compiere.model.I_C_Currency getC_Currency() throws RuntimeException { - return (I_C_Currency)MTable.get(getCtx(), I_C_Currency.Table_Name) + return (org.compiere.model.I_C_Currency)MTable.get(getCtx(), org.compiere.model.I_C_Currency.Table_Name) .getPO(getC_Currency_ID(), get_TrxName()); } /** Set Currency. @@ -415,6 +414,43 @@ public class X_C_PaymentProcessor extends PO implements I_C_PaymentProcessor, I_ return ii.intValue(); } + /** Set Payment Processor. + @param C_PaymentProcessor_ID + Payment processor for electronic payments + */ + public void setC_PaymentProcessor_ID (int C_PaymentProcessor_ID) + { + if (C_PaymentProcessor_ID < 1) + set_ValueNoCheck (COLUMNNAME_C_PaymentProcessor_ID, null); + else + set_ValueNoCheck (COLUMNNAME_C_PaymentProcessor_ID, Integer.valueOf(C_PaymentProcessor_ID)); + } + + /** Get Payment Processor. + @return Payment processor for electronic payments + */ + public int getC_PaymentProcessor_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_PaymentProcessor_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set C_PaymentProcessor_UU. + @param C_PaymentProcessor_UU C_PaymentProcessor_UU */ + public void setC_PaymentProcessor_UU (String C_PaymentProcessor_UU) + { + set_Value (COLUMNNAME_C_PaymentProcessor_UU, C_PaymentProcessor_UU); + } + + /** Get C_PaymentProcessor_UU. + @return C_PaymentProcessor_UU */ + public String getC_PaymentProcessor_UU () + { + return (String)get_Value(COLUMNNAME_C_PaymentProcessor_UU); + } + /** Set Commission %. @param Commission Commission stated as a percentage @@ -455,29 +491,6 @@ public class X_C_PaymentProcessor extends PO implements I_C_PaymentProcessor, I_ return bd; } - /** Set Payment Processor. - @param C_PaymentProcessor_ID - Payment processor for electronic payments - */ - public void setC_PaymentProcessor_ID (int C_PaymentProcessor_ID) - { - if (C_PaymentProcessor_ID < 1) - set_ValueNoCheck (COLUMNNAME_C_PaymentProcessor_ID, null); - else - set_ValueNoCheck (COLUMNNAME_C_PaymentProcessor_ID, Integer.valueOf(C_PaymentProcessor_ID)); - } - - /** Get Payment Processor. - @return Payment processor for electronic payments - */ - public int getC_PaymentProcessor_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_C_PaymentProcessor_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - /** Set Description. @param Description Optional short description of the record diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VPayment.java b/org.adempiere.ui.swing/src/org/compiere/grid/VPayment.java index 426c6fa4b1..56575f831d 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VPayment.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/VPayment.java @@ -726,7 +726,7 @@ public class VPayment extends CDialog * Load Bank Accounts */ SQL = MRole.getDefault().addAccessSQL( - "SELECT C_BankAccount_ID, Name || ' ' || AccountNo, IsDefault " + "SELECT C_BankAccount_ID, ba.Name || ' ' || AccountNo, IsDefault " + "FROM C_BankAccount ba" + " INNER JOIN C_Bank b ON (ba.C_Bank_ID=b.C_Bank_ID) " + "WHERE b.IsActive='Y'", diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/PosOrderModel.java b/org.adempiere.ui.swing/src/org/compiere/pos/PosOrderModel.java index 149c0469b5..596289f89a 100644 --- a/org.adempiere.ui.swing/src/org/compiere/pos/PosOrderModel.java +++ b/org.adempiere.ui.swing/src/org/compiere/pos/PosOrderModel.java @@ -18,6 +18,7 @@ import java.util.HashMap; import java.util.Properties; import org.compiere.model.MBPartner; +import org.compiere.model.MBankAccount; import org.compiere.model.MOrder; import org.compiere.model.MOrderLine; import org.compiere.model.MOrderTax; @@ -396,29 +397,31 @@ public class PosOrderModel extends MOrder { { try { - MPaymentProcessor[] m_mPaymentProcessors = MPaymentProcessor.find (getCtx (), null, null, + MBankAccount[] m_mBankAccounts = MPaymentProcessor.find (getCtx (), null, null, getAD_Client_ID (), getAD_Org_ID(), getC_Currency_ID (), amt, get_TrxName()); // HashMap map = new HashMap(); // to eliminate duplicates - for (int i = 0; i < m_mPaymentProcessors.length; i++) + for (int i = 0; i < m_mBankAccounts.length; i++) { - if (m_mPaymentProcessors[i].isAcceptAMEX ()) + MBankAccount bankAccount = m_mBankAccounts[i]; + MPaymentProcessor paymentProcessor = new MPaymentProcessor(bankAccount.getCtx(), bankAccount.getC_PaymentProcessor_ID(), bankAccount.get_TrxName()); + if (paymentProcessor.isAcceptAMEX ()) map.put (MPayment.CREDITCARDTYPE_Amex, getCreditCardPair (MPayment.CREDITCARDTYPE_Amex)); - if (m_mPaymentProcessors[i].isAcceptDiners ()) + if (paymentProcessor.isAcceptDiners ()) map.put (MPayment.CREDITCARDTYPE_Diners, getCreditCardPair (MPayment.CREDITCARDTYPE_Diners)); - if (m_mPaymentProcessors[i].isAcceptDiscover ()) + if (paymentProcessor.isAcceptDiscover ()) map.put (MPayment.CREDITCARDTYPE_Discover, getCreditCardPair (MPayment.CREDITCARDTYPE_Discover)); - if (m_mPaymentProcessors[i].isAcceptMC ()) + if (paymentProcessor.isAcceptMC ()) map.put (MPayment.CREDITCARDTYPE_MasterCard, getCreditCardPair (MPayment.CREDITCARDTYPE_MasterCard)); - if (m_mPaymentProcessors[i].isAcceptCorporate ()) + if (paymentProcessor.isAcceptCorporate ()) map.put (MPayment.CREDITCARDTYPE_PurchaseCard, getCreditCardPair (MPayment.CREDITCARDTYPE_PurchaseCard)); - if (m_mPaymentProcessors[i].isAcceptVisa ()) + if (paymentProcessor.isAcceptVisa ()) map.put (MPayment.CREDITCARDTYPE_Visa, getCreditCardPair (MPayment.CREDITCARDTYPE_Visa)); } // for all payment processors // ValueNamePair[] retValue = new ValueNamePair[map.size ()]; map.values ().toArray (retValue); - log.fine("getCreditCards - #" + retValue.length + " - Processors=" + m_mPaymentProcessors.length); + log.fine("getCreditCards - #" + retValue.length + " - Processors=" + m_mBankAccounts.length); return retValue; } catch (Exception ex) From 90c30026c4eb7fe0c33974481eaaeba1d88a720c Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 4 Oct 2012 17:44:50 -0500 Subject: [PATCH 73/79] IDEMPIERE-332 Document sequence organization level and restart monthly / NPE when not org selected --- org.adempiere.base/src/org/compiere/model/MSequence.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/model/MSequence.java b/org.adempiere.base/src/org/compiere/model/MSequence.java index b01099eb49..1092822971 100644 --- a/org.adempiere.base/src/org/compiere/model/MSequence.java +++ b/org.adempiere.base/src/org/compiere/model/MSequence.java @@ -1345,7 +1345,10 @@ public class MSequence extends X_AD_Sequence cym = sdf.format(d); } if (orgLevelSeq) { - org = (Integer)tab.getValue(seq.getOrgColumn()); + String orgColumn = seq.getOrgColumn(); + Object orgObj = tab.getValue(orgColumn); + if (orgObj != null) + org = (Integer)orgObj; } String sql = "SELECT CurrentNext FROM AD_Sequence_No WHERE AD_Sequence_ID=? AND CalendarYearMonth=? AND AD_Org_ID=?"; currentNext = DB.getSQLValue(null, sql, AD_Sequence_ID, cym, org); From ae5622f7de3a1b712b60e969e99f8c860ccb8c47 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 4 Oct 2012 18:32:31 -0500 Subject: [PATCH 74/79] IDEMPIERE-308 Performance: Replace with StringBuilder / fix problem found with lookups --- org.adempiere.base/src/org/compiere/model/MLookup.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/model/MLookup.java b/org.adempiere.base/src/org/compiere/model/MLookup.java index 39f0e82fdc..6af60303be 100644 --- a/org.adempiere.base/src/org/compiere/model/MLookup.java +++ b/org.adempiere.base/src/org/compiere/model/MLookup.java @@ -758,7 +758,7 @@ public final class MLookup extends Lookup implements Serializable boolean isActive = rs.getString(4).equals("Y"); if (!isActive) { - name = new StringBuilder(INACTIVE_S).append(INACTIVE_E); + name = new StringBuilder(INACTIVE_S).append(name).append(INACTIVE_E); m_hasInactive = true; } if (isNumber) From 7874f573e4635baf696882f362ab68eee5bfa022 Mon Sep 17 00:00:00 2001 From: Juan David Arboleda Date: Fri, 5 Oct 2012 11:22:33 -0500 Subject: [PATCH 75/79] IDEMPIERE-422 Complete Native Sequence feature --- db/ddlutils/oracle/procedures/nextID.sql | 56 +++++++++--- db/ddlutils/postgresql/functions/nextID.sql | 41 +++++++-- .../921_IDEMPIERE-422_NativeSequence.sql | 89 +++++++++++++++++++ .../921_IDEMPIERE-422_NativeSequence.sql | 78 ++++++++++++++++ .../oracle/03_update_sequences.sql | 50 ++++++++--- .../postgresql/03_update_sequences.sql | 48 +++++++--- .../org/compiere/process/SequenceCheck.java | 50 ++++------- .../src/org/compiere/model/MSequence.java | 67 ++++++++++---- 8 files changed, 385 insertions(+), 94 deletions(-) create mode 100644 migration/360lts-release/oracle/921_IDEMPIERE-422_NativeSequence.sql create mode 100644 migration/360lts-release/postgresql/921_IDEMPIERE-422_NativeSequence.sql diff --git a/db/ddlutils/oracle/procedures/nextID.sql b/db/ddlutils/oracle/procedures/nextID.sql index 2d23db2471..eda4003eff 100644 --- a/db/ddlutils/oracle/procedures/nextID.sql +++ b/db/ddlutils/oracle/procedures/nextID.sql @@ -24,11 +24,16 @@ BEGIN END; * ************************************************************************/ -AS +As +Isnativeseqon NVARCHAR2(1); +Tablename Nvarchar2(60); +sqlcmd VARCHAR2(200); BEGIN + + IF (p_System = 'Y') THEN SELECT CurrentNextSys - INTO o_NextID + INTO o_NextID FROM AD_Sequence WHERE AD_Sequence_ID=p_AD_Sequence_ID FOR UPDATE OF CurrentNextSys; @@ -36,16 +41,43 @@ BEGIN UPDATE AD_Sequence SET CurrentNextSys = CurrentNextSys + IncrementNo WHERE AD_Sequence_ID=p_AD_Sequence_ID; - ELSE - SELECT CurrentNext - INTO o_NextID - FROM AD_Sequence - WHERE AD_Sequence_ID=p_AD_Sequence_ID - FOR UPDATE OF CurrentNext; - -- - UPDATE AD_Sequence - SET CurrentNext = CurrentNext + IncrementNo - WHERE AD_Sequence_ID=p_AD_Sequence_ID; + ELSE + + BEGIN + SELECT Value + Into Isnativeseqon + From Ad_Sysconfig + Where Name ='SYSTEM_NATIVE_SEQUENCE'; + EXCEPTION + WHEN NO_DATA_FOUND THEN + Isnativeseqon:= 'N'; + END; + + IF Isnativeseqon = 'Y' THEN + + Select Name + INTO tablename + From Ad_Sequence + Where Ad_Sequence_Id=P_Ad_Sequence_Id + And Istableid = 'Y'; + -- + Sqlcmd := 'SELECT '||Tablename||'_SQ.Nextval FROM DUAL'; + -- + Execute Immediate Sqlcmd Into O_Nextid; + -- + ELSE + + SELECT CurrentNext + INTO o_NextID + FROM AD_Sequence + WHERE AD_Sequence_ID=p_AD_Sequence_ID + FOR UPDATE OF CurrentNext; + -- + Update Ad_Sequence + Set Currentnext = Currentnext + Incrementno + Where Ad_Sequence_Id=P_Ad_Sequence_Id; + -- + END IF; END IF; -- EXCEPTION diff --git a/db/ddlutils/postgresql/functions/nextID.sql b/db/ddlutils/postgresql/functions/nextID.sql index 5f34795e32..a916ba4d2b 100644 --- a/db/ddlutils/postgresql/functions/nextID.sql +++ b/db/ddlutils/postgresql/functions/nextID.sql @@ -1,4 +1,4 @@ -CREATE OR REPLACE FUNCTION nextid( +CREATE OR REPLACE FUNCTION nextid( p_AD_Sequence_ID IN INTEGER, p_System IN VARCHAR, o_NextID OUT INTEGER @@ -21,7 +21,9 @@ CREATE OR REPLACE FUNCTION nextid( * select * from nextid((select ad_sequence_id from ad_sequence where name = 'Test')::Integer, 'Y'::Varchar); * ************************************************************************/ - +DECLARE +Isnativeseqon VARCHAR(1); +tablename VARCHAR(60); BEGIN IF (p_System = 'Y') THEN RAISE NOTICE 'system'; @@ -34,14 +36,35 @@ BEGIN SET CurrentNextSys = CurrentNextSys + IncrementNo WHERE AD_Sequence_ID=p_AD_Sequence_ID; ELSE - SELECT CurrentNext + + BEGIN + SELECT Value + INTO Isnativeseqon + FROM AD_SYSCONFIG + WHERE Name ='SYSTEM_NATIVE_SEQUENCE'; + EXCEPTION + WHEN NO_DATA_FOUND THEN + Isnativeseqon:= 'N'; + END; + + IF Isnativeseqon = 'Y' THEN + SELECT Name + INTO tablename + FROM Ad_Sequence + WHERE Ad_Sequence_Id=P_Ad_Sequence_Id; + -- + EXECUTE 'SELECT nextval('''||tablename||'_sq'''||')' INTO o_NextID; + -- + ELSE + SELECT CurrentNext INTO o_NextID - FROM AD_Sequence - WHERE AD_Sequence_ID=p_AD_Sequence_ID; - -- - UPDATE AD_Sequence - SET CurrentNext = CurrentNext + IncrementNo - WHERE AD_Sequence_ID=p_AD_Sequence_ID; + FROM AD_Sequence + WHERE AD_Sequence_ID=p_AD_Sequence_ID; + -- + UPDATE AD_Sequence + SET CurrentNext = CurrentNext + IncrementNo + WHERE AD_Sequence_ID=p_AD_Sequence_ID; + END IF; END IF; -- EXCEPTION diff --git a/migration/360lts-release/oracle/921_IDEMPIERE-422_NativeSequence.sql b/migration/360lts-release/oracle/921_IDEMPIERE-422_NativeSequence.sql new file mode 100644 index 0000000000..01f75cab6e --- /dev/null +++ b/migration/360lts-release/oracle/921_IDEMPIERE-422_NativeSequence.sql @@ -0,0 +1,89 @@ +CREATE OR REPLACE PROCEDURE nextID +( + p_AD_Sequence_ID IN NUMBER, + p_System IN CHAR, + o_NextID OUT NUMBER +) +/************************************************************************* + * The contents of this file are subject to the Adempiere License. You may + * obtain a copy of the License at http://www.adempiere.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: Adempiere ERP+CRM + * Copyright (C) 1999-2005 Jorg Janke, ComPiere, Inc. All Rights Reserved. + ************************************************************************* + * $Id: nextID.sql,v 1.1 2006/04/21 17:51:58 jjanke Exp $ + *** + * Title: Get Next ID - no Commit + * Description: + * Test via +DECLARE + v_NextID NUMBER; +BEGIN + nextID(2, 'Y', v_NextID); + DBMS_OUTPUT.PUT_LINE(v_NextID); +END; + * + ************************************************************************/ +As +Isnativeseqon NVARCHAR2(1); +Tablename Nvarchar2(60); +sqlcmd VARCHAR2(200); +BEGIN + + + IF (p_System = 'Y') THEN + SELECT CurrentNextSys + INTO o_NextID + FROM AD_Sequence + WHERE AD_Sequence_ID=p_AD_Sequence_ID + FOR UPDATE OF CurrentNextSys; + -- + UPDATE AD_Sequence + SET CurrentNextSys = CurrentNextSys + IncrementNo + WHERE AD_Sequence_ID=p_AD_Sequence_ID; + ELSE + + BEGIN + SELECT Value + Into Isnativeseqon + From Ad_Sysconfig + Where Name ='SYSTEM_NATIVE_SEQUENCE'; + EXCEPTION + WHEN NO_DATA_FOUND THEN + Isnativeseqon:= 'N'; + END; + + IF Isnativeseqon = 'Y' THEN + + Select Name + INTO tablename + From Ad_Sequence + Where Ad_Sequence_Id=P_Ad_Sequence_Id + And Istableid = 'Y'; + -- + Sqlcmd := 'SELECT '||Tablename||'_SQ.Nextval FROM DUAL'; + -- + Execute Immediate Sqlcmd Into O_Nextid; + -- + ELSE + + SELECT CurrentNext + INTO o_NextID + FROM AD_Sequence + WHERE AD_Sequence_ID=p_AD_Sequence_ID + FOR UPDATE OF CurrentNext; + -- + Update Ad_Sequence + Set Currentnext = Currentnext + Incrementno + Where Ad_Sequence_Id=P_Ad_Sequence_Id; + -- + END IF; + END IF; + -- +EXCEPTION + WHEN OTHERS THEN + DBMS_OUTPUT.PUT_LINE(SQLERRM); +END nextID; +/ +SELECT register_migration_script('921_IDEMPIERE-422_NativeSequence.sql') FROM dual; + diff --git a/migration/360lts-release/postgresql/921_IDEMPIERE-422_NativeSequence.sql b/migration/360lts-release/postgresql/921_IDEMPIERE-422_NativeSequence.sql new file mode 100644 index 0000000000..2a47b95d44 --- /dev/null +++ b/migration/360lts-release/postgresql/921_IDEMPIERE-422_NativeSequence.sql @@ -0,0 +1,78 @@ +CREATE OR REPLACE FUNCTION nextid( + p_AD_Sequence_ID IN INTEGER, + p_System IN VARCHAR, + o_NextID OUT INTEGER +) + RETURNS INTEGER AS $body$ +/************************************************************************* + * 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-2005 Jorg Janke, ComPiere, Inc. All Rights Reserved. + * + * converted to postgreSQL by Karsten Thiemann (Schaeffer AG), + * kthiemann@adempiere.org + ************************************************************************* + *** + * Title: Get Next ID - no Commit + * Description: Returns the next id of the sequence. + * Test: + * select * from nextid((select ad_sequence_id from ad_sequence where name = 'Test')::Integer, 'Y'::Varchar); + * + ************************************************************************/ +DECLARE +Isnativeseqon VARCHAR(1); +tablename VARCHAR(60); +BEGIN + IF (p_System = 'Y') THEN + RAISE NOTICE 'system'; + SELECT CurrentNextSys + INTO o_NextID + FROM AD_Sequence + WHERE AD_Sequence_ID=p_AD_Sequence_ID; + -- + UPDATE AD_Sequence + SET CurrentNextSys = CurrentNextSys + IncrementNo + WHERE AD_Sequence_ID=p_AD_Sequence_ID; + ELSE + + BEGIN + SELECT Value + INTO Isnativeseqon + FROM AD_SYSCONFIG + WHERE Name ='SYSTEM_NATIVE_SEQUENCE'; + EXCEPTION + WHEN NO_DATA_FOUND THEN + Isnativeseqon:= 'N'; + END; + + IF Isnativeseqon = 'Y' THEN + SELECT Name + INTO tablename + FROM Ad_Sequence + WHERE Ad_Sequence_Id=P_Ad_Sequence_Id; + -- + EXECUTE 'SELECT nextval('''||tablename||'_sq'''||')' INTO o_NextID; + -- + ELSE + SELECT CurrentNext + INTO o_NextID + FROM AD_Sequence + WHERE AD_Sequence_ID=p_AD_Sequence_ID; + -- + UPDATE AD_Sequence + SET CurrentNext = CurrentNext + IncrementNo + WHERE AD_Sequence_ID=p_AD_Sequence_ID; + END IF; + END IF; + -- +EXCEPTION + WHEN OTHERS THEN + RAISE NOTICE '%',SQLERRM; +END; +$body$ LANGUAGE plpgsql; + +SELECT register_migration_script('921_IDEMPIERE-422_NativeSequence.sql') FROM dual +; + diff --git a/migration/processes_post_migration/oracle/03_update_sequences.sql b/migration/processes_post_migration/oracle/03_update_sequences.sql index ac1abdfa3a..4ba7274544 100644 --- a/migration/processes_post_migration/oracle/03_update_sequences.sql +++ b/migration/processes_post_migration/oracle/03_update_sequences.sql @@ -7,7 +7,9 @@ DECLARE currentnextsys NUMBER (10); currentnext NUMBER (10); currentseqsys NUMBER (10); - currentseq NUMBER (10); + Currentseq Number (10); + Isnativeseqon Varchar2(1); + sqlcmd VARCHAR2(200); BEGIN DBMS_OUTPUT.PUT_LINE ('Start'); @@ -38,8 +40,18 @@ BEGIN DBMS_OUTPUT.PUT_LINE ('Table not found'); DBMS_OUTPUT.PUT_LINE (cmdsys); GOTO next_iteration; - END; - + End; + + BEGIN + SELECT Value + Into Isnativeseqon + From Ad_Sysconfig + Where Name ='SYSTEM_NATIVE_SEQUENCE'; + Exception + When NO_DATA_FOUND Then + Isnativeseqon :='N'; + End; + IF currentnextsys IS NULL THEN currentnextsys := 0; @@ -76,16 +88,26 @@ BEGIN INTO currentnext FROM DUAL; - cmdseq := - 'SELECT currentnext, currentnextsys FROM AD_Sequence ' + If Isnativeseqon ='Y' Then + Cmdseq := + 'SELECT '||R.Tablename||'_SQ.Nextval as currentnext, + currentnextsys + FROM AD_Sequence ' || 'WHERE Name = ''' - || r.tablename - || ''' AND istableid = ''Y'''; + || r.Tablename + || ''' AND istableid = ''Y'''; + ELSE + cmdseq := + 'SELECT currentnext, currentnextsys FROM AD_Sequence ' + || 'WHERE Name = ''' + || r.tablename + || ''' AND istableid = ''Y'''; + END IF; EXECUTE IMMEDIATE cmdseq INTO currentseq, currentseqsys; - IF currentnextsys <> currentseqsys OR currentnext <> currentseq + IF currentnextsys <> currentseqsys OR (currentnext <> currentseq AND Isnativeseqon ='N') THEN DBMS_OUTPUT.PUT_LINE ( r.tablename || ' sys=' @@ -108,8 +130,16 @@ BEGIN DBMS_OUTPUT.PUT_LINE (cmdupd); EXECUTE IMMEDIATE cmdupd; - END IF; - + End If; + + If Currentseq < Currentnext And Isnativeseqon ='Y' Then + Sqlcmd := 'SELECT '||R.Tablename||'_SQ.Nextval FROM DUAL'; + DBMS_OUTPUT.PUT_LINE (Sqlcmd); + While Not Currentseq >= (currentnext-1) Loop + Execute Immediate Sqlcmd + Into currentseq; + End Loop; + END IF; <> NULL; END LOOP; diff --git a/migration/processes_post_migration/postgresql/03_update_sequences.sql b/migration/processes_post_migration/postgresql/03_update_sequences.sql index 04453fadcd..4380cea0de 100644 --- a/migration/processes_post_migration/postgresql/03_update_sequences.sql +++ b/migration/processes_post_migration/postgresql/03_update_sequences.sql @@ -1,4 +1,4 @@ -CREATE OR REPLACE FUNCTION update_sequences() RETURNS void as $func$ +CREATE OR REPLACE FUNCTION update_sequences() RETURNS void as $func$ -- TODO: Currently not inserting new sequences DECLARE cmdsys VARCHAR (1000); @@ -11,10 +11,11 @@ DECLARE currentseq NUMERIC (10); ok BOOLEAN; r RECORD; + isnativeseqon VARCHAR (1); BEGIN - FOR r IN (SELECT tablename - FROM AD_TABLE t + FOR r IN (SELECT tablename + FROM AD_TABLE t WHERE EXISTS ( SELECT 1 FROM AD_COLUMN c @@ -41,6 +42,17 @@ BEGIN END; IF ok THEN + + BEGIN + SELECT Value + INTO isnativeseqon + FROM AD_SYSCONFIG + WHERE Name ='SYSTEM_NATIVE_SEQUENCE'; + EXCEPTION + WHEN NO_DATA_FOUND THEN + isnativeseqon:= 'N'; + END; + IF currentnextsys IS NULL THEN currentnextsys := 0; @@ -72,15 +84,25 @@ BEGIN ELSE coalesce (currentnext + 1, 1000000) END ; - cmdseq := - 'SELECT currentnext, currentnextsys FROM AD_Sequence ' - || 'WHERE Name = ''' - || r.tablename - || ''' AND istableid = ''Y'''; + IF isnativeseqon ='Y' THEN + cmdseq := + 'SELECT nextval('''||trim(r.tablename)||'_sq'''||') as currentnext, + currentnextsys + FROM AD_Sequence ' + || 'WHERE Name = ''' + || r.tablename + || ''' AND istableid = ''Y'''; + ELSE + cmdseq := + 'SELECT currentnext, currentnextsys FROM AD_Sequence ' + || 'WHERE Name = ''' + || r.tablename + || ''' AND istableid = ''Y'''; + END IF; EXECUTE cmdseq INTO currentseq, currentseqsys; - IF currentnextsys <> currentseqsys OR currentnext <> currentseq + IF currentnextsys <> currentseqsys OR (currentnext <> currentseq AND isnativeseqon ='N') THEN cmdupd := 'update ad_sequence set currentnextsys = ' @@ -93,8 +115,14 @@ BEGIN EXECUTE cmdupd; END IF; + IF currentseq < currentnext AND isnativeseqon ='Y' THEN + --RAISE NOTICE 'currentseq % ,currentnext %',currentseq,currentnext; + WHILE NOT currentseq >= (currentnext-1) LOOP + EXECUTE 'SELECT nextval('''||trim(r.tablename)||'_sq'''||')' INTO currentseq; + --RAISE NOTICE 'currentseq % ,currentnext %',currentseq,currentnext; + END LOOP; + END IF; END IF; - END LOOP; END; $func$ LANGUAGE plpgsql; diff --git a/org.adempiere.base.process/src/org/compiere/process/SequenceCheck.java b/org.adempiere.base.process/src/org/compiere/process/SequenceCheck.java index 3b07a60af3..a73dc0d99a 100644 --- a/org.adempiere.base.process/src/org/compiere/process/SequenceCheck.java +++ b/org.adempiere.base.process/src/org/compiere/process/SequenceCheck.java @@ -202,42 +202,28 @@ public class SequenceCheck extends SvrProcess + "ORDER BY Name"; int counter = 0; PreparedStatement pstmt = null; + ResultSet rs = null; String trxName = null; if (sp != null) trxName = sp.get_TrxName(); try { pstmt = DB.prepareStatement(sql, trxName); - ResultSet rs = pstmt.executeQuery(); + rs = pstmt.executeQuery(); while (rs.next()) { MSequence seq = new MSequence (ctx, rs, trxName); - int old = seq.getCurrentNext(); - int oldSys = seq.getCurrentNextSys(); - if (seq.validateTableIDValue()) - { - if (seq.getCurrentNext() != old) - { - StringBuilder msg = new StringBuilder(seq.getName()).append(" ID ") - .append(old).append(" -> ").append(seq.getCurrentNext()); - if (sp != null) - sp.addLog(0, null, null, msg.toString()); - else - s_log.fine(msg.toString()); - } - if (seq.getCurrentNextSys() != oldSys) - { - StringBuilder msg = new StringBuilder(seq.getName()).append(" Sys ") - .append(oldSys).append(" -> ").append(seq.getCurrentNextSys()); - if (sp != null) - sp.addLog(0, null, null, msg.toString()); - else - s_log.fine(msg.toString()); - } - if (seq.save()) - counter++; + String tableValidation= seq.validateTableIDValue(); + if (tableValidation!=null){ + if (sp != null) + sp.addLog(0, null, null, tableValidation); else - s_log.severe("Not updated: " + seq); + s_log.fine(tableValidation); + + if (seq.save()) + counter++; + else + s_log.severe("Not updated: " + seq); } // else if (CLogMgt.isLevel(6)) // log.fine("checkTableID - skipped " + tableName); @@ -249,16 +235,10 @@ public class SequenceCheck extends SvrProcess catch (Exception e) { s_log.log(Level.SEVERE, sql, e); - } - try + }finally { - if (pstmt != null) - pstmt.close(); - pstmt = null; - } - catch (Exception e) - { - pstmt = null; + DB.close(rs, pstmt); + rs = null; pstmt = null; } s_log.fine("#" + counter); } // checkTableID diff --git a/org.adempiere.base/src/org/compiere/model/MSequence.java b/org.adempiere.base/src/org/compiere/model/MSequence.java index 1092822971..75c62d7201 100644 --- a/org.adempiere.base/src/org/compiere/model/MSequence.java +++ b/org.adempiere.base/src/org/compiere/model/MSequence.java @@ -62,7 +62,8 @@ public class MSequence extends X_AD_Sequence private static final int QUERY_TIME_OUT = 30; private static final String NoYearNorMonth = "-"; - + + @Deprecated public static int getNextID (int AD_Client_ID, String TableName) { return getNextID(AD_Client_ID, TableName, null); @@ -74,8 +75,13 @@ public class MSequence extends X_AD_Sequence * @param AD_Client_ID client * @param TableName table name * @param trxName deprecated. - * @return next no or (-1=not found, -2=error) - */ + * @return next no or (-1=not found, -2=error) + * + * WARNING!! This method doesn't take into account the native sequence setting, it always read from table AD_Sequence + * must be used JUST for the method Enable Native Sequence + * + * @deprecated + */ public static int getNextID (int AD_Client_ID, String TableName, String trxName) { if (TableName == null || TableName.length() == 0) @@ -693,7 +699,7 @@ public class MSequence extends X_AD_Sequence seq.setDescription("Table " + TableName); seq.setIsTableID(tableID); seq.saveEx(); - next_id = seq.getCurrentNext(); + next_id = INIT_NO; } if (! CConnection.get().getDatabase().createSequence(TableName+"_SQ", 1, 0 , 99999999, next_id, trxName)) return false; @@ -883,10 +889,10 @@ public class MSequence extends X_AD_Sequence * Validate Table Sequence Values * @return true if updated */ - public boolean validateTableIDValue() + public String validateTableIDValue() { if (!isTableID()) - return false; + return null; String tableName = getName(); int AD_Column_ID = DB.getSQLValue(null, "SELECT MAX(c.AD_Column_ID) " + "FROM AD_Table t" @@ -894,13 +900,14 @@ public class MSequence extends X_AD_Sequence + "WHERE t.TableName='" + tableName + "'" + " AND c.ColumnName='" + tableName + "_ID'"); if (AD_Column_ID <= 0) - return false; + return null; // MSystem system = MSystem.get(getCtx()); int IDRangeEnd = 0; if (system.getIDRangeEnd() != null) IDRangeEnd = system.getIDRangeEnd().intValue(); - boolean change = false; + + String changeMsg = null; String info = null; // Current Next @@ -910,12 +917,14 @@ public class MSequence extends X_AD_Sequence int maxTableID = DB.getSQLValue(null, sql); if (maxTableID < INIT_NO) maxTableID = INIT_NO - 1; - maxTableID++; // Next - if (getCurrentNext() < maxTableID) + maxTableID++; // Next + + int currentNextValue = getCurrentNext(); + if (currentNextValue < maxTableID) { setCurrentNext(maxTableID); info = "CurrentNext=" + maxTableID; - change = true; + changeMsg = getName() + " ID " + currentNextValue + " -> " + maxTableID; } // Get Max System_ID used in Table @@ -924,22 +933,44 @@ public class MSequence extends X_AD_Sequence int maxTableSysID = DB.getSQLValue(null, sql); if (maxTableSysID <= 0) maxTableSysID = INIT_SYS_NO - 1; - maxTableSysID++; // Next - if (getCurrentNextSys() < maxTableSysID) - { + int currentNextSysValue = getCurrentNextSys(); + if (currentNextSysValue < maxTableSysID){ setCurrentNextSys(maxTableSysID); if (info == null) info = "CurrentNextSys=" + maxTableSysID; else info += " - CurrentNextSys=" + maxTableSysID; - change = true; + + if (changeMsg == null) + changeMsg = getName() + " Sys " + currentNextSysValue + " -> " + maxTableSysID; + else + changeMsg += " - " +getName() + " Sys " + currentNextSysValue + " -> " + maxTableSysID; } if (info != null) - log.fine(getName() + " - " + info); - return change; + log.fine(getName() + " - " + info); + + return changeMsg; } // validate - + @Override + public int getCurrentNext() { + if (MSysConfig.getBooleanValue(MSysConfig.SYSTEM_NATIVE_SEQUENCE,false) && isTableID()){ + return DB.getNextID (getAD_Client_ID(),getName(),get_TrxName()); + }else { + return super.getCurrentNext(); + } + } + + @Override + public void setCurrentNext(int CurrentNext) { + if (MSysConfig.getBooleanValue(MSysConfig.SYSTEM_NATIVE_SEQUENCE,false) && isTableID()){ + while (DB.getNextID(getAD_Client_ID(),getName(),get_TrxName()) < (CurrentNext-1)) { + // do nothing - the while is incrementing the sequence + } + }else { + super.setCurrentNext(CurrentNext); + } + } /************************************************************************** * Test * @param args ignored From 595fda5ef4a42addbf1bce354a2c9016d58d83ec Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 5 Oct 2012 19:03:57 -0500 Subject: [PATCH 76/79] IDEMPIERE-422 Complete Native Sequence feature / peer review and tests --- db/ddlutils/oracle/procedures/nextID.sql | 158 ++++++------ db/ddlutils/postgresql/functions/nextID.sql | 15 +- .../921_IDEMPIERE-422_NativeSequence.sql | 50 ++-- .../921_IDEMPIERE-422_NativeSequence.sql | 26 +- .../oracle/03_update_sequences.sql | 19 +- .../postgresql/03_update_sequences.sql | 22 +- .../org/compiere/process/SequenceCheck.java | 17 +- .../src/org/compiere/model/MSequence.java | 228 ++---------------- .../src/org/compiere/db/DB_Oracle.java | 37 ++- .../src/org/compiere/db/DB_PostgreSQL.java | 10 +- .../compiere/dbPort/Convert_PostgreSQL.java | 26 -- 11 files changed, 181 insertions(+), 427 deletions(-) diff --git a/db/ddlutils/oracle/procedures/nextID.sql b/db/ddlutils/oracle/procedures/nextID.sql index eda4003eff..c241509cdb 100644 --- a/db/ddlutils/oracle/procedures/nextID.sql +++ b/db/ddlutils/oracle/procedures/nextID.sql @@ -1,87 +1,71 @@ -CREATE OR REPLACE PROCEDURE nextID -( - p_AD_Sequence_ID IN NUMBER, - p_System IN CHAR, - o_NextID OUT NUMBER -) -/************************************************************************* - * The contents of this file are subject to the Adempiere License. You may - * obtain a copy of the License at http://www.adempiere.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: Adempiere ERP+CRM - * Copyright (C) 1999-2005 Jorg Janke, ComPiere, Inc. All Rights Reserved. - ************************************************************************* - * $Id: nextID.sql,v 1.1 2006/04/21 17:51:58 jjanke Exp $ - *** - * Title: Get Next ID - no Commit - * Description: - * Test via -DECLARE - v_NextID NUMBER; -BEGIN - nextID(2, 'Y', v_NextID); - DBMS_OUTPUT.PUT_LINE(v_NextID); -END; - * - ************************************************************************/ -As -Isnativeseqon NVARCHAR2(1); -Tablename Nvarchar2(60); -sqlcmd VARCHAR2(200); -BEGIN - - - IF (p_System = 'Y') THEN - SELECT CurrentNextSys - INTO o_NextID - FROM AD_Sequence - WHERE AD_Sequence_ID=p_AD_Sequence_ID - FOR UPDATE OF CurrentNextSys; - -- - UPDATE AD_Sequence - SET CurrentNextSys = CurrentNextSys + IncrementNo - WHERE AD_Sequence_ID=p_AD_Sequence_ID; - ELSE - - BEGIN - SELECT Value - Into Isnativeseqon - From Ad_Sysconfig - Where Name ='SYSTEM_NATIVE_SEQUENCE'; - EXCEPTION - WHEN NO_DATA_FOUND THEN - Isnativeseqon:= 'N'; - END; - - IF Isnativeseqon = 'Y' THEN - - Select Name - INTO tablename - From Ad_Sequence - Where Ad_Sequence_Id=P_Ad_Sequence_Id - And Istableid = 'Y'; - -- - Sqlcmd := 'SELECT '||Tablename||'_SQ.Nextval FROM DUAL'; - -- - Execute Immediate Sqlcmd Into O_Nextid; - -- - ELSE - - SELECT CurrentNext - INTO o_NextID - FROM AD_Sequence - WHERE AD_Sequence_ID=p_AD_Sequence_ID - FOR UPDATE OF CurrentNext; - -- - Update Ad_Sequence - Set Currentnext = Currentnext + Incrementno - Where Ad_Sequence_Id=P_Ad_Sequence_Id; - -- - END IF; - END IF; - -- -EXCEPTION - WHEN OTHERS THEN - DBMS_OUTPUT.PUT_LINE(SQLERRM); -END nextID; -/ +CREATE OR REPLACE PROCEDURE nextID +( + p_AD_Sequence_ID IN NUMBER, + p_System IN CHAR, + o_NextID OUT NUMBER +) +/************************************************************************* + * The contents of this file are subject to the Adempiere License. You may + * obtain a copy of the License at http://www.adempiere.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: Adempiere ERP+CRM + * Copyright (C) 1999-2005 Jorg Janke, ComPiere, Inc. All Rights Reserved. + ************************************************************************* + * $Id: nextID.sql,v 1.1 2006/04/21 17:51:58 jjanke Exp $ + *** + * Title: Get Next ID - no Commit + * Description: + * Test via + * + ************************************************************************/ +AS +Isnativeseqon NVARCHAR2(1); +Tablename Nvarchar2(60); +sqlcmd VARCHAR2(200); +BEGIN + + + IF (p_System = 'Y') THEN + SELECT CurrentNextSys + INTO o_NextID + FROM AD_Sequence + WHERE AD_Sequence_ID=p_AD_Sequence_ID + FOR UPDATE OF CurrentNextSys; + -- + UPDATE AD_Sequence + SET CurrentNextSys = CurrentNextSys + IncrementNo + WHERE AD_Sequence_ID=p_AD_Sequence_ID; + ELSE + + Isnativeseqon := get_Sysconfig('SYSTEM_NATIVE_SEQUENCE','N',0,0); + IF Isnativeseqon = 'Y' THEN + + SELECT Name + INTO tablename + FROM Ad_Sequence + WHERE Ad_Sequence_Id=P_Ad_Sequence_Id; + -- + Sqlcmd := 'SELECT '||Tablename||'_SQ.Nextval FROM DUAL'; + -- + Execute Immediate Sqlcmd Into O_Nextid; + -- + ELSE + + SELECT CurrentNext + INTO o_NextID + FROM AD_Sequence + WHERE AD_Sequence_ID=p_AD_Sequence_ID + FOR UPDATE OF CurrentNext; + -- + UPDATE Ad_Sequence + SET Currentnext = Currentnext + Incrementno + WHERE Ad_Sequence_Id=P_Ad_Sequence_Id; + -- + END IF; + END IF; + -- +EXCEPTION + WHEN OTHERS THEN + DBMS_OUTPUT.PUT_LINE(SQLERRM); +END nextID; +/ diff --git a/db/ddlutils/postgresql/functions/nextID.sql b/db/ddlutils/postgresql/functions/nextID.sql index a916ba4d2b..2785d1c8d8 100644 --- a/db/ddlutils/postgresql/functions/nextID.sql +++ b/db/ddlutils/postgresql/functions/nextID.sql @@ -1,4 +1,4 @@ -CREATE OR REPLACE FUNCTION nextid( +CREATE OR REPLACE FUNCTION nextid( p_AD_Sequence_ID IN INTEGER, p_System IN VARCHAR, o_NextID OUT INTEGER @@ -37,16 +37,7 @@ BEGIN WHERE AD_Sequence_ID=p_AD_Sequence_ID; ELSE - BEGIN - SELECT Value - INTO Isnativeseqon - FROM AD_SYSCONFIG - WHERE Name ='SYSTEM_NATIVE_SEQUENCE'; - EXCEPTION - WHEN NO_DATA_FOUND THEN - Isnativeseqon:= 'N'; - END; - + Isnativeseqon := get_Sysconfig('SYSTEM_NATIVE_SEQUENCE','N',0,0); IF Isnativeseqon = 'Y' THEN SELECT Name INTO tablename @@ -74,5 +65,3 @@ END; $body$ LANGUAGE plpgsql; - - diff --git a/migration/360lts-release/oracle/921_IDEMPIERE-422_NativeSequence.sql b/migration/360lts-release/oracle/921_IDEMPIERE-422_NativeSequence.sql index 01f75cab6e..22ad2f3649 100644 --- a/migration/360lts-release/oracle/921_IDEMPIERE-422_NativeSequence.sql +++ b/migration/360lts-release/oracle/921_IDEMPIERE-422_NativeSequence.sql @@ -1,6 +1,6 @@ CREATE OR REPLACE PROCEDURE nextID ( - p_AD_Sequence_ID IN NUMBER, + p_AD_Sequence_ID IN NUMBER, p_System IN CHAR, o_NextID OUT NUMBER ) @@ -16,15 +16,9 @@ CREATE OR REPLACE PROCEDURE nextID * Title: Get Next ID - no Commit * Description: * Test via -DECLARE - v_NextID NUMBER; -BEGIN - nextID(2, 'Y', v_NextID); - DBMS_OUTPUT.PUT_LINE(v_NextID); -END; * ************************************************************************/ -As +AS Isnativeseqon NVARCHAR2(1); Tablename Nvarchar2(60); sqlcmd VARCHAR2(200); @@ -43,23 +37,13 @@ BEGIN WHERE AD_Sequence_ID=p_AD_Sequence_ID; ELSE - BEGIN - SELECT Value - Into Isnativeseqon - From Ad_Sysconfig - Where Name ='SYSTEM_NATIVE_SEQUENCE'; - EXCEPTION - WHEN NO_DATA_FOUND THEN - Isnativeseqon:= 'N'; - END; - + Isnativeseqon := get_Sysconfig('SYSTEM_NATIVE_SEQUENCE','N',0,0); IF Isnativeseqon = 'Y' THEN - Select Name + SELECT Name INTO tablename - From Ad_Sequence - Where Ad_Sequence_Id=P_Ad_Sequence_Id - And Istableid = 'Y'; + FROM Ad_Sequence + WHERE Ad_Sequence_Id=P_Ad_Sequence_Id; -- Sqlcmd := 'SELECT '||Tablename||'_SQ.Nextval FROM DUAL'; -- @@ -73,9 +57,9 @@ BEGIN WHERE AD_Sequence_ID=p_AD_Sequence_ID FOR UPDATE OF CurrentNext; -- - Update Ad_Sequence - Set Currentnext = Currentnext + Incrementno - Where Ad_Sequence_Id=P_Ad_Sequence_Id; + UPDATE Ad_Sequence + SET Currentnext = Currentnext + Incrementno + WHERE Ad_Sequence_Id=P_Ad_Sequence_Id; -- END IF; END IF; @@ -85,5 +69,19 @@ EXCEPTION DBMS_OUTPUT.PUT_LINE(SQLERRM); END nextID; / -SELECT register_migration_script('921_IDEMPIERE-422_NativeSequence.sql') FROM dual; + +DROP SEQUENCE ad_error_seq +; + +DROP SEQUENCE ad_pinstance_seq +; + +DROP SEQUENCE t_spool_seq +; + +DROP SEQUENCE w_basket_seq +; + +SELECT register_migration_script('921_IDEMPIERE-422_NativeSequence.sql') FROM dual +; diff --git a/migration/360lts-release/postgresql/921_IDEMPIERE-422_NativeSequence.sql b/migration/360lts-release/postgresql/921_IDEMPIERE-422_NativeSequence.sql index 2a47b95d44..d833929616 100644 --- a/migration/360lts-release/postgresql/921_IDEMPIERE-422_NativeSequence.sql +++ b/migration/360lts-release/postgresql/921_IDEMPIERE-422_NativeSequence.sql @@ -1,4 +1,4 @@ -CREATE OR REPLACE FUNCTION nextid( +CREATE OR REPLACE FUNCTION nextid( p_AD_Sequence_ID IN INTEGER, p_System IN VARCHAR, o_NextID OUT INTEGER @@ -37,16 +37,7 @@ BEGIN WHERE AD_Sequence_ID=p_AD_Sequence_ID; ELSE - BEGIN - SELECT Value - INTO Isnativeseqon - FROM AD_SYSCONFIG - WHERE Name ='SYSTEM_NATIVE_SEQUENCE'; - EXCEPTION - WHEN NO_DATA_FOUND THEN - Isnativeseqon:= 'N'; - END; - + Isnativeseqon := get_Sysconfig('SYSTEM_NATIVE_SEQUENCE','N',0,0); IF Isnativeseqon = 'Y' THEN SELECT Name INTO tablename @@ -71,8 +62,21 @@ EXCEPTION WHEN OTHERS THEN RAISE NOTICE '%',SQLERRM; END; + $body$ LANGUAGE plpgsql; +DROP SEQUENCE ad_error_seq +; + +DROP SEQUENCE ad_pinstance_seq +; + +DROP SEQUENCE t_spool_seq +; + +DROP SEQUENCE w_basket_seq +; + SELECT register_migration_script('921_IDEMPIERE-422_NativeSequence.sql') FROM dual ; diff --git a/migration/processes_post_migration/oracle/03_update_sequences.sql b/migration/processes_post_migration/oracle/03_update_sequences.sql index 4ba7274544..061710f3d9 100644 --- a/migration/processes_post_migration/oracle/03_update_sequences.sql +++ b/migration/processes_post_migration/oracle/03_update_sequences.sql @@ -40,26 +40,17 @@ BEGIN DBMS_OUTPUT.PUT_LINE ('Table not found'); DBMS_OUTPUT.PUT_LINE (cmdsys); GOTO next_iteration; - End; + END; - BEGIN - SELECT Value - Into Isnativeseqon - From Ad_Sysconfig - Where Name ='SYSTEM_NATIVE_SEQUENCE'; - Exception - When NO_DATA_FOUND Then - Isnativeseqon :='N'; - End; - + Isnativeseqon := get_Sysconfig('SYSTEM_NATIVE_SEQUENCE','N',0,0); IF currentnextsys IS NULL THEN currentnextsys := 0; END IF; - SELECT DECODE (SIGN (currentnextsys - 50000), - -1, 50000, - NVL (currentnextsys + 1, 50000) + SELECT DECODE (SIGN (currentnextsys - 200000), + -1, 200000, + NVL (currentnextsys + 1, 200000) ) INTO currentnextsys FROM DUAL; diff --git a/migration/processes_post_migration/postgresql/03_update_sequences.sql b/migration/processes_post_migration/postgresql/03_update_sequences.sql index 4380cea0de..490cdae5fd 100644 --- a/migration/processes_post_migration/postgresql/03_update_sequences.sql +++ b/migration/processes_post_migration/postgresql/03_update_sequences.sql @@ -1,4 +1,4 @@ -CREATE OR REPLACE FUNCTION update_sequences() RETURNS void as $func$ +CREATE OR REPLACE FUNCTION update_sequences() RETURNS void as $func$ -- TODO: Currently not inserting new sequences DECLARE cmdsys VARCHAR (1000); @@ -42,25 +42,15 @@ BEGIN END; IF ok THEN - - BEGIN - SELECT Value - INTO isnativeseqon - FROM AD_SYSCONFIG - WHERE Name ='SYSTEM_NATIVE_SEQUENCE'; - EXCEPTION - WHEN NO_DATA_FOUND THEN - isnativeseqon:= 'N'; - END; - + isnativeseqon := get_Sysconfig('SYSTEM_NATIVE_SEQUENCE','N',0,0); IF currentnextsys IS NULL THEN currentnextsys := 0; END IF; - SELECT INTO currentnextsys CASE SIGN (currentnextsys - 50000) - WHEN -1 THEN 50000 - ELSE coalesce (currentnextsys + 1, 50000) + SELECT INTO currentnextsys CASE SIGN (currentnextsys - 200000) + WHEN -1 THEN 200000 + ELSE coalesce (currentnextsys + 1, 200000) END; cmdnosys := @@ -116,10 +106,8 @@ BEGIN EXECUTE cmdupd; END IF; IF currentseq < currentnext AND isnativeseqon ='Y' THEN - --RAISE NOTICE 'currentseq % ,currentnext %',currentseq,currentnext; WHILE NOT currentseq >= (currentnext-1) LOOP EXECUTE 'SELECT nextval('''||trim(r.tablename)||'_sq'''||')' INTO currentseq; - --RAISE NOTICE 'currentseq % ,currentnext %',currentseq,currentnext; END LOOP; END IF; END IF; diff --git a/org.adempiere.base.process/src/org/compiere/process/SequenceCheck.java b/org.adempiere.base.process/src/org/compiere/process/SequenceCheck.java index a73dc0d99a..6083b14f84 100644 --- a/org.adempiere.base.process/src/org/compiere/process/SequenceCheck.java +++ b/org.adempiere.base.process/src/org/compiere/process/SequenceCheck.java @@ -117,7 +117,6 @@ public class SequenceCheck extends SvrProcess } else { - rs.close(); throw new Exception ("Error creating Table Sequence for " + tableName); } } @@ -213,8 +212,12 @@ public class SequenceCheck extends SvrProcess while (rs.next()) { MSequence seq = new MSequence (ctx, rs, trxName); - String tableValidation= seq.validateTableIDValue(); - if (tableValidation!=null){ + /* NOTE: When using native sequences - every time the sequence check process is run + * a sequence number is lost on all sequences - because with native sequences + * reading the sequence consumes a number + */ + String tableValidation = seq.validateTableIDValue(); + if (tableValidation != null) { if (sp != null) sp.addLog(0, null, null, tableValidation); else @@ -225,17 +228,13 @@ public class SequenceCheck extends SvrProcess else s_log.severe("Not updated: " + seq); } - // else if (CLogMgt.isLevel(6)) - // log.fine("checkTableID - skipped " + tableName); } - rs.close(); - pstmt.close(); - pstmt = null; } catch (Exception e) { s_log.log(Level.SEVERE, sql, e); - }finally + } + finally { DB.close(rs, pstmt); rs = null; pstmt = null; diff --git a/org.adempiere.base/src/org/compiere/model/MSequence.java b/org.adempiere.base/src/org/compiere/model/MSequence.java index 75c62d7201..51786e8a19 100644 --- a/org.adempiere.base/src/org/compiere/model/MSequence.java +++ b/org.adempiere.base/src/org/compiere/model/MSequence.java @@ -54,7 +54,7 @@ public class MSequence extends X_AD_Sequence /** * */ - private static final long serialVersionUID = -1204207754819125876L; + private static final long serialVersionUID = -631878634759124313L; /** Log Level for Next ID Call */ private static final Level LOGLEVEL = Level.ALL; @@ -62,12 +62,6 @@ public class MSequence extends X_AD_Sequence private static final int QUERY_TIME_OUT = 30; private static final String NoYearNorMonth = "-"; - - @Deprecated - public static int getNextID (int AD_Client_ID, String TableName) - { - return getNextID(AD_Client_ID, TableName, null); - } /** * @@ -76,207 +70,14 @@ public class MSequence extends X_AD_Sequence * @param TableName table name * @param trxName deprecated. * @return next no or (-1=not found, -2=error) - * - * WARNING!! This method doesn't take into account the native sequence setting, it always read from table AD_Sequence - * must be used JUST for the method Enable Native Sequence - * - * @deprecated */ public static int getNextID (int AD_Client_ID, String TableName, String trxName) { if (TableName == null || TableName.length() == 0) throw new IllegalArgumentException("TableName missing"); - int retValue = -1; - - // Check AdempiereSys - boolean adempiereSys = false; - if (Ini.isClient()) - { - adempiereSys = Ini.isPropertyBool(Ini.P_ADEMPIERESYS); - } - else - { - String sysProperty = Env.getCtx().getProperty("AdempiereSys", "N"); - adempiereSys = "y".equalsIgnoreCase(sysProperty) || "true".equalsIgnoreCase(sysProperty); - } - - if (adempiereSys && AD_Client_ID > 11) - adempiereSys = false; - // - if (CLogMgt.isLevel(LOGLEVEL)) - s_log.log(LOGLEVEL, TableName + " - AdempiereSys=" + adempiereSys + " [" + trxName + "]"); - //begin vpj-cd e-evolution 09/02/2005 PostgreSQL - String selectSQL = null; - if (DB.isOracle() == false) - { - selectSQL = "SELECT CurrentNext, CurrentNextSys, IncrementNo, AD_Sequence_ID " - + "FROM AD_Sequence " - + "WHERE Name=?" - + " AND IsActive='Y' AND IsTableID='Y' AND IsAutoSequence='Y' " - + " FOR UPDATE OF AD_Sequence "; - } - else - { - selectSQL = "SELECT CurrentNext, CurrentNextSys, IncrementNo, AD_Sequence_ID " - + "FROM AD_Sequence " - + "WHERE Name=?" - + " AND IsActive='Y' AND IsTableID='Y' AND IsAutoSequence='Y' "; - - } - - Connection conn = null; - PreparedStatement pstmt = null; - ResultSet rs = null; - for (int i = 0; i < 3; i++) - { - try - { - conn = DB.getConnectionID(); - // Error - if (conn == null) - return -1; - - pstmt = conn.prepareStatement(selectSQL, - ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE); - pstmt.setString(1, TableName); - // - //postgresql use special syntax instead of the setQueryTimeout method - if (DB.isPostgreSQL()) - { - Statement timeoutStatement = conn.createStatement(); - timeoutStatement.execute("SET LOCAL statement_timeout TO " + ( QUERY_TIME_OUT * 1000 )); - } - else if (DB.getDatabase().isQueryTimeoutSupported()) - { - pstmt.setQueryTimeout(QUERY_TIME_OUT); - } - rs = pstmt.executeQuery(); - if (CLogMgt.isLevelFinest()) - s_log.finest("AC=" + conn.getAutoCommit() + ", RO=" + conn.isReadOnly() - + " - Isolation=" + conn.getTransactionIsolation() + "(" + Connection.TRANSACTION_READ_COMMITTED - + ") - RSType=" + pstmt.getResultSetType() + "(" + ResultSet.TYPE_SCROLL_SENSITIVE - + "), RSConcur=" + pstmt.getResultSetConcurrency() + "(" + ResultSet.CONCUR_UPDATABLE - + ")"); - if (rs.next()) - { - - // Get the table - MTable table = MTable.get(Env.getCtx(), TableName); - - int AD_Sequence_ID = rs.getInt(4); - boolean gotFromHTTP = false; - - // If maintaining official dictionary try to get the ID from http official server - if (adempiereSys) { - - String isUseCentralizedID = MSysConfig.getValue(MSysConfig.DICTIONARY_ID_USE_CENTRALIZED_ID, "Y"); // defaults to Y - if ( ( ! isUseCentralizedID.equals("N") ) && ( ! isExceptionCentralized(TableName) ) ) { - // get ID from http site - retValue = getNextOfficialID_HTTP(TableName); - if (retValue > 0) { - PreparedStatement updateSQL; - updateSQL = conn.prepareStatement("UPDATE AD_Sequence SET CurrentNextSys = ? + 1 WHERE AD_Sequence_ID = ?"); - try { - updateSQL.setInt(1, retValue); - updateSQL.setInt(2, AD_Sequence_ID); - updateSQL.executeUpdate(); - } finally { - updateSQL.close(); - } - } - gotFromHTTP = true; - } - - } - - boolean queryProjectServer = false; - if (table.getColumn("EntityType") != null) - queryProjectServer = true; - if (!queryProjectServer && MSequence.Table_Name.equalsIgnoreCase(TableName)) - queryProjectServer = true; - - // If not official dictionary try to get the ID from http custom server - if configured - if (queryProjectServer && ( ! adempiereSys ) && ( ! isExceptionCentralized(TableName) ) ) { - - String isUseProjectCentralizedID = MSysConfig.getValue(MSysConfig.PROJECT_ID_USE_CENTRALIZED_ID, "N"); // defaults to N - if (isUseProjectCentralizedID.equals("Y")) { - // get ID from http site - retValue = getNextProjectID_HTTP(TableName); - if (retValue > 0) { - PreparedStatement updateSQL; - updateSQL = conn.prepareStatement("UPDATE AD_Sequence SET CurrentNext = GREATEST(CurrentNext, ? + 1) WHERE AD_Sequence_ID = ?"); - try { - updateSQL.setInt(1, retValue); - updateSQL.setInt(2, AD_Sequence_ID); - updateSQL.executeUpdate(); - } finally { - updateSQL.close(); - } - } - gotFromHTTP = true; - } - - } - - if (! gotFromHTTP) { - PreparedStatement updateSQL; - int incrementNo = rs.getInt(3); - if (adempiereSys) { - updateSQL = conn - .prepareStatement("UPDATE AD_Sequence SET CurrentNextSys = CurrentNextSys + ? WHERE AD_Sequence_ID = ?"); - retValue = rs.getInt(2); - } else { - updateSQL = conn - .prepareStatement("UPDATE AD_Sequence SET CurrentNext = CurrentNext + ? WHERE AD_Sequence_ID = ?"); - retValue = rs.getInt(1); - } - try { - updateSQL.setInt(1, incrementNo); - updateSQL.setInt(2, AD_Sequence_ID); - updateSQL.executeUpdate(); - } finally { - updateSQL.close(); - } - } - - //if (trx == null) - conn.commit(); - } - else - s_log.severe ("No record found - " + TableName); - - // - break; // EXIT - } - catch (Exception e) - { - s_log.log(Level.SEVERE, TableName + " - " + e.getMessage(), e); - try - { - if (conn != null) - conn.rollback(); - } catch (SQLException e1) { } - } - finally - { - DB.close(rs, pstmt); - pstmt = null; - rs = null; - if (conn != null) - { - try { - conn.close(); - } catch (SQLException e) {} - conn = null; - } - } - Thread.yield(); // give it time - } - - - //s_log.finest (retValue + " - Table=" + TableName + " [" + trx + "]"); - return retValue; + MSequence seq = MSequence.get (Env.getCtx(), TableName, trxName, true); + return seq.getNextID(); } // getNextID /************************************************************************** @@ -690,7 +491,7 @@ public class MSequence extends X_AD_Sequence if (tableID && SYSTEM_NATIVE_SEQUENCE) { - int next_id = MSequence.getNextID(Env.getAD_Client_ID(ctx), TableName, trxName); + int next_id = DB.getSQLValue(trxName, "SELECT CurrentNext FROM AD_Sequence WHERE Name=? AND IsActive='Y' AND IsTableID='Y' AND IsAutoSequence='Y'", TableName); if (next_id == -1) { MSequence seq = new MSequence (ctx, 0, trxName); @@ -701,7 +502,7 @@ public class MSequence extends X_AD_Sequence seq.saveEx(); next_id = INIT_NO; } - if (! CConnection.get().getDatabase().createSequence(TableName+"_SQ", 1, 0 , 99999999, next_id, trxName)) + if (! CConnection.get().getDatabase().createSequence(TableName+"_SQ", 1, INIT_NO, Integer.MAX_VALUE, next_id, trxName)) return false; return true; @@ -881,7 +682,9 @@ public class MSequence extends X_AD_Sequence public int getNextID() { int retValue = getCurrentNext(); - setCurrentNext(retValue + getIncrementNo()); + if (! (MSysConfig.getBooleanValue(MSysConfig.SYSTEM_NATIVE_SEQUENCE,false) && isTableID())) { + setCurrentNext(retValue + getIncrementNo()); + } return retValue; } // getNextNo @@ -932,7 +735,7 @@ public class MSequence extends X_AD_Sequence + " WHERE " + tableName + "_ID < " + INIT_NO; int maxTableSysID = DB.getSQLValue(null, sql); if (maxTableSysID <= 0) - maxTableSysID = INIT_SYS_NO - 1; + maxTableSysID = INIT_SYS_NO; int currentNextSysValue = getCurrentNextSys(); if (currentNextSysValue < maxTableSysID){ setCurrentNextSys(maxTableSysID); @@ -956,7 +759,7 @@ public class MSequence extends X_AD_Sequence public int getCurrentNext() { if (MSysConfig.getBooleanValue(MSysConfig.SYSTEM_NATIVE_SEQUENCE,false) && isTableID()){ return DB.getNextID (getAD_Client_ID(),getName(),get_TrxName()); - }else { + } else { return super.getCurrentNext(); } } @@ -964,8 +767,10 @@ public class MSequence extends X_AD_Sequence @Override public void setCurrentNext(int CurrentNext) { if (MSysConfig.getBooleanValue(MSysConfig.SYSTEM_NATIVE_SEQUENCE,false) && isTableID()){ - while (DB.getNextID(getAD_Client_ID(),getName(),get_TrxName()) < (CurrentNext-1)) { - // do nothing - the while is incrementing the sequence + while (true) { + int id = DB.getNextID(getAD_Client_ID(),getName(),get_TrxName()); + if (id < 0 || id >= (CurrentNext-1)) + break; } }else { super.setCurrentNext(CurrentNext); @@ -1376,10 +1181,7 @@ public class MSequence extends X_AD_Sequence cym = sdf.format(d); } if (orgLevelSeq) { - String orgColumn = seq.getOrgColumn(); - Object orgObj = tab.getValue(orgColumn); - if (orgObj != null) - org = (Integer)orgObj; + org = (Integer)tab.getValue(seq.getOrgColumn()); } String sql = "SELECT CurrentNext FROM AD_Sequence_No WHERE AD_Sequence_ID=? AND CalendarYearMonth=? AND AD_Org_ID=?"; currentNext = DB.getSQLValue(null, sql, AD_Sequence_ID, cym, org); diff --git a/org.compiere.db.oracle.provider/src/org/compiere/db/DB_Oracle.java b/org.compiere.db.oracle.provider/src/org/compiere/db/DB_Oracle.java index 49dffd9315..047a2bd53f 100644 --- a/org.compiere.db.oracle.provider/src/org/compiere/db/DB_Oracle.java +++ b/org.compiere.db.oracle.provider/src/org/compiere/db/DB_Oracle.java @@ -41,6 +41,7 @@ import org.adempiere.exceptions.DBException; import org.compiere.Adempiere; import org.compiere.dbPort.Convert; import org.compiere.dbPort.Convert_Oracle; +import org.compiere.model.MSysConfig; import org.compiere.model.PO; import org.compiere.util.CLogger; import org.compiere.util.DB; @@ -1158,13 +1159,35 @@ public class DB_Oracle implements AdempiereDatabase public boolean createSequence(String name , int increment , int minvalue , int maxvalue ,int start , String trxName) { - int no = DB.executeUpdate("DROP SEQUENCE "+name.toUpperCase(), trxName); - StringBuilder msgDB = new StringBuilder("CREATE SEQUENCE ").append(name.toUpperCase()) - .append(" MINVALUE ").append(minvalue) - .append(" MAXVALUE ").append(maxvalue) - .append(" START WITH ").append(start) - .append(" INCREMENT BY ").append(increment).append(" CACHE 20"); - no = DB.executeUpdateEx(msgDB.toString(), trxName); + // Check if Sequence exists + final int cnt = DB.getSQLValueEx(trxName, "SELECT COUNT(*) FROM USER_SEQUENCES WHERE UPPER(sequence_name)=?", name.toUpperCase()); + final int no; + if (start < minvalue) + start = minvalue; + // + // New Sequence + if (cnt == 0) + { + no = DB.executeUpdate("CREATE SEQUENCE "+name.toUpperCase() + + " MINVALUE " + minvalue + + " MAXVALUE " + maxvalue + + " START WITH " + start + + " INCREMENT BY " + increment + + " CACHE 20", trxName); + } + // + // Already existing sequence => ALTER + else + { + no = DB.executeUpdate("ALTER SEQUENCE "+name.toUpperCase() + + " INCREMENT BY " + increment + // + " MINVALUE " + minvalue // ORA-04007 + + " MAXVALUE " + maxvalue + + " CACHE 20", trxName); + while (DB.getSQLValue(trxName, "SELECT " + name.toUpperCase() + ".NEXTVAL FROM DUAL") < start) { + // do nothing - the while is incrementing the sequence + } + } if(no == -1 ) return false; else diff --git a/org.compiere.db.postgresql.provider/src/org/compiere/db/DB_PostgreSQL.java b/org.compiere.db.postgresql.provider/src/org/compiere/db/DB_PostgreSQL.java index 0dbc1eaa99..b8979f13b1 100755 --- a/org.compiere.db.postgresql.provider/src/org/compiere/db/DB_PostgreSQL.java +++ b/org.compiere.db.postgresql.provider/src/org/compiere/db/DB_PostgreSQL.java @@ -854,25 +854,27 @@ public class DB_PostgreSQL implements AdempiereDatabase // Check if Sequence exists final int cnt = DB.getSQLValueEx(trxName, "SELECT COUNT(*) FROM pg_class WHERE UPPER(relname)=? AND relkind='S'", name.toUpperCase()); final int no; + if (start < minvalue) + start = minvalue; // // New Sequence if (cnt == 0) { no = DB.executeUpdate("CREATE SEQUENCE "+name.toUpperCase() - + " INCREMENT " + increment + + " INCREMENT BY " + increment + " MINVALUE " + minvalue + " MAXVALUE " + maxvalue - + " START " + start , trxName); + + " START WITH " + start, trxName); } // // Already existing sequence => ALTER else { no = DB.executeUpdate("ALTER SEQUENCE "+name.toUpperCase() - + " INCREMENT " + increment + + " INCREMENT BY " + increment + " MINVALUE " + minvalue + " MAXVALUE " + maxvalue - + " RESTART " + start , trxName); + + " RESTART WITH " + start, trxName); } if(no == -1 ) return false; diff --git a/org.compiere.db.postgresql.provider/src/org/compiere/dbPort/Convert_PostgreSQL.java b/org.compiere.db.postgresql.provider/src/org/compiere/dbPort/Convert_PostgreSQL.java index cc4aad2d1b..fb4c0d8249 100644 --- a/org.compiere.db.postgresql.provider/src/org/compiere/dbPort/Convert_PostgreSQL.java +++ b/org.compiere.db.postgresql.provider/src/org/compiere/dbPort/Convert_PostgreSQL.java @@ -80,32 +80,6 @@ public class Convert_PostgreSQL extends Convert_SQL92 { /** Vector to save previous values of quoted strings **/ Vector retVars = new Vector(); - //Validate Next ID Function and use Native Sequence if the functionality is active - int found_next_fuction = sqlStatement.toUpperCase().indexOf("NEXTIDFUNC("); - if(found_next_fuction<=0) - found_next_fuction = sqlStatement.toUpperCase().indexOf("NEXTID("); - if(found_next_fuction > 0) - { - boolean SYSTEM_NATIVE_SEQUENCE = MSysConfig.getBooleanValue(MSysConfig.SYSTEM_NATIVE_SEQUENCE,false); - boolean adempiereSys = Ini.isPropertyBool(Ini.P_ADEMPIERESYS); - - if(SYSTEM_NATIVE_SEQUENCE && !adempiereSys) - { - String function_before = sqlStatement.substring(0,found_next_fuction); - String function_start = sqlStatement.substring(found_next_fuction); - String function_after = function_start.substring(function_start.indexOf(")") + 1); - String sequence = function_start.substring(function_start.indexOf("(") + 1, function_start.indexOf(",")); - int separator = function_start.indexOf("'") + 1; - String next = function_start.substring(separator); - String system = next.substring(0,next.indexOf("'")); - if (system.equals("N")) - { - String seq_name = DB.getSQLValueString(null, "SELECT Name FROM AD_Sequence WHERE AD_Sequence_ID=" + sequence); - sqlStatement = function_before + " nextval('"+seq_name+ "_seq') " + function_after; - } - } - } - String statement = replaceQuotedStrings(sqlStatement, retVars); statement = convertWithConvertMap(statement); statement = statement.replace(DB_PostgreSQL.NATIVE_MARKER, ""); From 2dba271ee96b130f28806e31188318ecc75401f1 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 8 Oct 2012 08:45:07 -0500 Subject: [PATCH 77/79] reapply b4342c844a23 / IDEMPIERE-332 Document sequence organization level and restart monthly / NPE when not org selected --- org.adempiere.base/src/org/compiere/model/MSequence.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/model/MSequence.java b/org.adempiere.base/src/org/compiere/model/MSequence.java index 51786e8a19..873a9855a4 100644 --- a/org.adempiere.base/src/org/compiere/model/MSequence.java +++ b/org.adempiere.base/src/org/compiere/model/MSequence.java @@ -1181,7 +1181,10 @@ public class MSequence extends X_AD_Sequence cym = sdf.format(d); } if (orgLevelSeq) { - org = (Integer)tab.getValue(seq.getOrgColumn()); + String orgColumn = seq.getOrgColumn(); + Object orgObj = tab.getValue(orgColumn); + if (orgObj != null) + org = (Integer)orgObj; } String sql = "SELECT CurrentNext FROM AD_Sequence_No WHERE AD_Sequence_ID=? AND CalendarYearMonth=? AND AD_Org_ID=?"; currentNext = DB.getSQLValue(null, sql, AD_Sequence_ID, cym, org); From c2e073a34ab4e3dfbd7a44758ab74a7f55f55ac2 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 8 Oct 2012 10:21:11 -0500 Subject: [PATCH 78/79] IDEMPIERE-422 Complete Native Sequence feature / fix problem reported in forums https://groups.google.com/d/topic/idempiere/aBv-Rx6EFdc/discussion --- .../src/org/compiere/model/MSequence.java | 207 +++++++++++++++++- .../src/org/compiere/util/DB.java | 2 +- 2 files changed, 203 insertions(+), 6 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MSequence.java b/org.adempiere.base/src/org/compiere/model/MSequence.java index 873a9855a4..2700c2470e 100644 --- a/org.adempiere.base/src/org/compiere/model/MSequence.java +++ b/org.adempiere.base/src/org/compiere/model/MSequence.java @@ -63,21 +63,218 @@ public class MSequence extends X_AD_Sequence private static final String NoYearNorMonth = "-"; + public static int getNextID (int AD_Client_ID, String TableName) + { + return getNextID(AD_Client_ID, TableName, null); + } + /** * * Get next number for Key column = 0 is Error. * @param AD_Client_ID client * @param TableName table name - * @param trxName deprecated. - * @return next no or (-1=not found, -2=error) - */ + * @param trxName deprecated (NOT USED!!) + * @return next no or (-1=not found, -2=error) + * + * WARNING!! This method doesn't take into account the native sequence setting, it's just to be called from DB.getNextID() + * + * @deprecated please use DB.getNextID (int, String, String) + */ public static int getNextID (int AD_Client_ID, String TableName, String trxName) { if (TableName == null || TableName.length() == 0) throw new IllegalArgumentException("TableName missing"); - MSequence seq = MSequence.get (Env.getCtx(), TableName, trxName, true); - return seq.getNextID(); + int retValue = -1; + + // Check AdempiereSys + boolean adempiereSys = false; + if (Ini.isClient()) + { + adempiereSys = Ini.isPropertyBool(Ini.P_ADEMPIERESYS); + } + else + { + String sysProperty = Env.getCtx().getProperty("AdempiereSys", "N"); + adempiereSys = "y".equalsIgnoreCase(sysProperty) || "true".equalsIgnoreCase(sysProperty); + } + + if (adempiereSys && AD_Client_ID > 11) + adempiereSys = false; + // + if (CLogMgt.isLevel(LOGLEVEL)) + s_log.log(LOGLEVEL, TableName + " - AdempiereSys=" + adempiereSys + " [" + trxName + "]"); + //begin vpj-cd e-evolution 09/02/2005 PostgreSQL + String selectSQL = null; + if (DB.isOracle() == false) + { + selectSQL = "SELECT CurrentNext, CurrentNextSys, IncrementNo, AD_Sequence_ID " + + "FROM AD_Sequence " + + "WHERE Name=?" + + " AND IsActive='Y' AND IsTableID='Y' AND IsAutoSequence='Y' " + + " FOR UPDATE OF AD_Sequence "; + } + else + { + selectSQL = "SELECT CurrentNext, CurrentNextSys, IncrementNo, AD_Sequence_ID " + + "FROM AD_Sequence " + + "WHERE Name=?" + + " AND IsActive='Y' AND IsTableID='Y' AND IsAutoSequence='Y' "; + + } + + Connection conn = null; + PreparedStatement pstmt = null; + ResultSet rs = null; + for (int i = 0; i < 3; i++) + { + try + { + conn = DB.getConnectionID(); + // Error + if (conn == null) + return -1; + + pstmt = conn.prepareStatement(selectSQL, + ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE); + pstmt.setString(1, TableName); + // + //postgresql use special syntax instead of the setQueryTimeout method + if (DB.isPostgreSQL()) + { + Statement timeoutStatement = conn.createStatement(); + timeoutStatement.execute("SET LOCAL statement_timeout TO " + ( QUERY_TIME_OUT * 1000 )); + } + else if (DB.getDatabase().isQueryTimeoutSupported()) + { + pstmt.setQueryTimeout(QUERY_TIME_OUT); + } + rs = pstmt.executeQuery(); + if (CLogMgt.isLevelFinest()) + s_log.finest("AC=" + conn.getAutoCommit() + ", RO=" + conn.isReadOnly() + + " - Isolation=" + conn.getTransactionIsolation() + "(" + Connection.TRANSACTION_READ_COMMITTED + + ") - RSType=" + pstmt.getResultSetType() + "(" + ResultSet.TYPE_SCROLL_SENSITIVE + + "), RSConcur=" + pstmt.getResultSetConcurrency() + "(" + ResultSet.CONCUR_UPDATABLE + + ")"); + if (rs.next()) + { + + // Get the table + MTable table = MTable.get(Env.getCtx(), TableName); + + int AD_Sequence_ID = rs.getInt(4); + boolean gotFromHTTP = false; + + // If maintaining official dictionary try to get the ID from http official server + if (adempiereSys) { + + String isUseCentralizedID = MSysConfig.getValue(MSysConfig.DICTIONARY_ID_USE_CENTRALIZED_ID, "Y"); // defaults to Y + if ( ( ! isUseCentralizedID.equals("N") ) && ( ! isExceptionCentralized(TableName) ) ) { + // get ID from http site + retValue = getNextOfficialID_HTTP(TableName); + if (retValue > 0) { + PreparedStatement updateSQL; + updateSQL = conn.prepareStatement("UPDATE AD_Sequence SET CurrentNextSys = ? + 1 WHERE AD_Sequence_ID = ?"); + try { + updateSQL.setInt(1, retValue); + updateSQL.setInt(2, AD_Sequence_ID); + updateSQL.executeUpdate(); + } finally { + updateSQL.close(); + } + } + gotFromHTTP = true; + } + + } + + boolean queryProjectServer = false; + if (table.getColumn("EntityType") != null) + queryProjectServer = true; + if (!queryProjectServer && MSequence.Table_Name.equalsIgnoreCase(TableName)) + queryProjectServer = true; + + // If not official dictionary try to get the ID from http custom server - if configured + if (queryProjectServer && ( ! adempiereSys ) && ( ! isExceptionCentralized(TableName) ) ) { + + String isUseProjectCentralizedID = MSysConfig.getValue(MSysConfig.PROJECT_ID_USE_CENTRALIZED_ID, "N"); // defaults to N + if (isUseProjectCentralizedID.equals("Y")) { + // get ID from http site + retValue = getNextProjectID_HTTP(TableName); + if (retValue > 0) { + PreparedStatement updateSQL; + updateSQL = conn.prepareStatement("UPDATE AD_Sequence SET CurrentNext = GREATEST(CurrentNext, ? + 1) WHERE AD_Sequence_ID = ?"); + try { + updateSQL.setInt(1, retValue); + updateSQL.setInt(2, AD_Sequence_ID); + updateSQL.executeUpdate(); + } finally { + updateSQL.close(); + } + } + gotFromHTTP = true; + } + + } + + if (! gotFromHTTP) { + PreparedStatement updateSQL; + int incrementNo = rs.getInt(3); + if (adempiereSys) { + updateSQL = conn + .prepareStatement("UPDATE AD_Sequence SET CurrentNextSys = CurrentNextSys + ? WHERE AD_Sequence_ID = ?"); + retValue = rs.getInt(2); + } else { + updateSQL = conn + .prepareStatement("UPDATE AD_Sequence SET CurrentNext = CurrentNext + ? WHERE AD_Sequence_ID = ?"); + retValue = rs.getInt(1); + } + try { + updateSQL.setInt(1, incrementNo); + updateSQL.setInt(2, AD_Sequence_ID); + updateSQL.executeUpdate(); + } finally { + updateSQL.close(); + } + } + + //if (trx == null) + conn.commit(); + } + else + s_log.severe ("No record found - " + TableName); + + // + break; // EXIT + } + catch (Exception e) + { + s_log.log(Level.SEVERE, TableName + " - " + e.getMessage(), e); + try + { + if (conn != null) + conn.rollback(); + } catch (SQLException e1) { } + } + finally + { + DB.close(rs, pstmt); + pstmt = null; + rs = null; + if (conn != null) + { + try { + conn.close(); + } catch (SQLException e) {} + conn = null; + } + } + Thread.yield(); // give it time + } + + + //s_log.finest (retValue + " - Table=" + TableName + " [" + trx + "]"); + return retValue; } // getNextID /************************************************************************** diff --git a/org.adempiere.base/src/org/compiere/util/DB.java b/org.adempiere.base/src/org/compiere/util/DB.java index 90913e1fcd..8a8e06bd78 100644 --- a/org.adempiere.base/src/org/compiere/util/DB.java +++ b/org.adempiere.base/src/org/compiere/util/DB.java @@ -1870,7 +1870,7 @@ public final class DB return m_sequence_id; } - return MSequence.getNextID (AD_Client_ID, TableName, trxName); + return MSequence.getNextID (AD_Client_ID, TableName, trxName); // it is ok to call deprecated method here } // getNextID /** From dba1c54c91e2d08d2b19bdfb2a5d743d465e1247 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 8 Oct 2012 10:50:46 -0500 Subject: [PATCH 79/79] IDEMPIERE-422 Complete Native Sequence feature / deprecate method that must not be used --- org.adempiere.base/src/org/compiere/model/MSequence.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/org.adempiere.base/src/org/compiere/model/MSequence.java b/org.adempiere.base/src/org/compiere/model/MSequence.java index 2700c2470e..1bbd5d0ac8 100644 --- a/org.adempiere.base/src/org/compiere/model/MSequence.java +++ b/org.adempiere.base/src/org/compiere/model/MSequence.java @@ -63,6 +63,9 @@ public class MSequence extends X_AD_Sequence private static final String NoYearNorMonth = "-"; + /** + * @deprecated please use DB.getNextID (int, String, String) + */ public static int getNextID (int AD_Client_ID, String TableName) { return getNextID(AD_Client_ID, TableName, null);