Merge with 5ed88ce505b934c7868a6f97652ea1718db75958

This commit is contained in:
Heng Sin Low 2012-10-12 21:47:29 +08:00
commit 91786b1e16
200 changed files with 19311 additions and 931 deletions

View File

@ -59,6 +59,7 @@ syntax: regexp
^lib/plugins$
^plugins/.*\.class$
^adempiere-local\.properties$
^org.adempiere.extend/test.properties$
^org\.adempiere\.ui/.*\.class$
^org\.adempiere\.ui/bin/.*\.css$
^org\.adempiere\.pipo.handlers/.*\.class$

View File

@ -0,0 +1,66 @@
-- IDEMPIERE-388 Enable port and TLS configuration for email
-- Oct 3, 2012 10:55:41 AM COT
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 ('SMTPPort',200170,'D','SMTP Port','SMTP Port Number','SMTP Port','20c841ef-0f1c-4482-87a7-0e882ae1e0de',0,TO_DATE('2012-10-03 10:55:39','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-10-03 10:55:39','YYYY-MM-DD HH24:MI:SS'),0,0,0,'Y')
;
-- Oct 3, 2012 10:55:41 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,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=200170 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)
;
-- Oct 3, 2012 10:58:59 AM COT
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,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,112,200580,'D','N','N','N',0,'N',10,'N',11,'N','N',200170,'N','Y','e463ed28-f6d5-4150-b7bd-49cdc6e7e03b','N','Y','N','SMTPPort','SMTP Port Number','SMTP Port','Y',0,TO_DATE('2012-10-03 10:58:58','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-10-03 10:58:58','YYYY-MM-DD HH24:MI:SS'),0,0,0)
;
-- Oct 3, 2012 10:58:59 AM COT
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=200580 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 11:00:50 AM COT
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 ('IsSecureSMTP',200171,'D','SMTP SSL/TLS','Use SSL/TLS for SMTP','SMTP SSL/TLS','08c7ca81-950d-4f5f-b0fd-99da440cd1e2',0,TO_DATE('2012-10-03 11:00:49','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-10-03 11:00:49','YYYY-MM-DD HH24:MI:SS'),0,0,0,'Y')
;
-- Oct 3, 2012 11:00: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,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=200171 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)
;
-- Oct 3, 2012 11:02:40 AM COT
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,112,200581,'D','N','N','N',0,'N',1,'N',20,'N','N',200171,'N','Y','1bf7924e-8543-481d-972d-32ac400ce786','N','Y','N','IsSecureSMTP','Use SSL/TLS for SMTP','N','SMTP SSL/TLS','Y',0,TO_DATE('2012-10-03 11:02:39','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-10-03 11:02:39','YYYY-MM-DD HH24:MI:SS'),0,0,0)
;
-- Oct 3, 2012 11:02:40 AM COT
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=200581 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 11:24:52 AM COT
INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,AD_FieldGroup_ID,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES (0,'N',145,0,'N','N',200580,113,'Y',200594,'N',119,'D','SMTP Port Number','SMTP Port','Y','N','e54979c8-39fc-4ac5-8fd0-5232834a070c',0,0,TO_DATE('2012-10-03 11:24:52','YYYY-MM-DD HH24:MI:SS'),0,0,TO_DATE('2012-10-03 11:24:52','YYYY-MM-DD HH24:MI:SS'),'Y','Y',113,1,1,1)
;
-- Oct 3, 2012 11:24:52 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,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=200594 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 11:27:59 AM COT
INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,AD_FieldGroup_ID,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES (0,'N',145,0,'Y','N',200581,115,'Y',200595,'N',119,'D','Use SSL/TLS for SMTP','SMTP SSL/TLS','Y','N','dbef5a74-3dfa-4246-8b76-04b924ec869c',0,0,TO_DATE('2012-10-03 11:27:58','YYYY-MM-DD HH24:MI:SS'),0,0,TO_DATE('2012-10-03 11:27:58','YYYY-MM-DD HH24:MI:SS'),'Y','Y',115,5,2,1)
;
-- Oct 3, 2012 11:27:59 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,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=200595 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 8, 2012 10:15:49 PM COT
-- IDEMPIERE-388 Enable port and TLS configuration for email
UPDATE AD_Column SET IsMandatory='Y',Updated=TO_DATE('2012-10-08 22:15:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200581
;
-- Oct 8, 2012 10:15:51 PM COT
-- IDEMPIERE-388 Enable port and TLS configuration for email
ALTER TABLE AD_Client ADD IsSecureSMTP CHAR(1) DEFAULT 'N' CHECK (IsSecureSMTP IN ('Y','N')) NOT NULL
;
-- Oct 8, 2012 10:16:24 PM COT
-- IDEMPIERE-388 Enable port and TLS configuration for email
ALTER TABLE AD_Client ADD SMTPPort NUMBER(10) DEFAULT NULL
;
SELECT register_migration_script('927_IDEMPIERE-388.sql') FROM dual
;

View File

@ -0,0 +1,13 @@
-- IDEMPIERE-458 Invalid indirect foreign keys on GardenWorld
delete from ad_treenode where ad_tree_id=102 and node_id not in (select m_product_id from m_product)
;
delete from ad_treenode where ad_tree_id=103 and node_id not in (select c_bpartner_id from c_bpartner)
;
delete from ad_treenode where ad_tree_id=101 and node_id not in (select c_elementvalue_id from c_elementvalue)
;
SELECT register_migration_script('929_IDEMPIERE-458.sql') FROM dual
;

View File

@ -0,0 +1,66 @@
-- IDEMPIERE-388 Enable port and TLS configuration for email
-- Oct 3, 2012 10:55:41 AM COT
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 ('SMTPPort',200170,'D','SMTP Port','SMTP Port Number','SMTP Port','20c841ef-0f1c-4482-87a7-0e882ae1e0de',0,TO_TIMESTAMP('2012-10-03 10:55:39','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-10-03 10:55:39','YYYY-MM-DD HH24:MI:SS'),0,0,0,'Y')
;
-- Oct 3, 2012 10:55:41 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,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=200170 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)
;
-- Oct 3, 2012 10:58:59 AM COT
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,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,112,200580,'D','N','N','N',0,'N',10,'N',11,'N','N',200170,'N','Y','e463ed28-f6d5-4150-b7bd-49cdc6e7e03b','N','Y','N','SMTPPort','SMTP Port Number','SMTP Port','Y',0,TO_TIMESTAMP('2012-10-03 10:58:58','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-10-03 10:58:58','YYYY-MM-DD HH24:MI:SS'),0,0,0)
;
-- Oct 3, 2012 10:58:59 AM COT
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=200580 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 11:00:50 AM COT
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 ('IsSecureSMTP',200171,'D','SMTP SSL/TLS','Use SSL/TLS for SMTP','SMTP SSL/TLS','08c7ca81-950d-4f5f-b0fd-99da440cd1e2',0,TO_TIMESTAMP('2012-10-03 11:00:49','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-10-03 11:00:49','YYYY-MM-DD HH24:MI:SS'),0,0,0,'Y')
;
-- Oct 3, 2012 11:00: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,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=200171 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)
;
-- Oct 3, 2012 11:02:40 AM COT
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,112,200581,'D','N','N','N',0,'N',1,'N',20,'N','N',200171,'N','Y','1bf7924e-8543-481d-972d-32ac400ce786','N','Y','N','IsSecureSMTP','Use SSL/TLS for SMTP','N','SMTP SSL/TLS','Y',0,TO_TIMESTAMP('2012-10-03 11:02:39','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-10-03 11:02:39','YYYY-MM-DD HH24:MI:SS'),0,0,0)
;
-- Oct 3, 2012 11:02:40 AM COT
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=200581 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 11:24:52 AM COT
INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,AD_FieldGroup_ID,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES (0,'N',145,0,'N','N',200580,113,'Y',200594,'N',119,'D','SMTP Port Number','SMTP Port','Y','N','e54979c8-39fc-4ac5-8fd0-5232834a070c',0,0,TO_TIMESTAMP('2012-10-03 11:24:52','YYYY-MM-DD HH24:MI:SS'),0,0,TO_TIMESTAMP('2012-10-03 11:24:52','YYYY-MM-DD HH24:MI:SS'),'Y','Y',113,1,1,1)
;
-- Oct 3, 2012 11:24:52 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,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=200594 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 11:27:59 AM COT
INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,AD_FieldGroup_ID,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES (0,'N',145,0,'Y','N',200581,115,'Y',200595,'N',119,'D','Use SSL/TLS for SMTP','SMTP SSL/TLS','Y','N','dbef5a74-3dfa-4246-8b76-04b924ec869c',0,0,TO_TIMESTAMP('2012-10-03 11:27:58','YYYY-MM-DD HH24:MI:SS'),0,0,TO_TIMESTAMP('2012-10-03 11:27:58','YYYY-MM-DD HH24:MI:SS'),'Y','Y',115,5,2,1)
;
-- Oct 3, 2012 11:27:59 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,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=200595 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 8, 2012 10:15:49 PM COT
-- IDEMPIERE-388 Enable port and TLS configuration for email
UPDATE AD_Column SET IsMandatory='Y',Updated=TO_TIMESTAMP('2012-10-08 22:15:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200581
;
-- Oct 8, 2012 10:15:51 PM COT
-- IDEMPIERE-388 Enable port and TLS configuration for email
ALTER TABLE AD_Client ADD COLUMN IsSecureSMTP CHAR(1) DEFAULT 'N' CHECK (IsSecureSMTP IN ('Y','N')) NOT NULL
;
-- Oct 8, 2012 10:16:24 PM COT
-- IDEMPIERE-388 Enable port and TLS configuration for email
ALTER TABLE AD_Client ADD COLUMN SMTPPort NUMERIC(10) DEFAULT NULL
;
SELECT register_migration_script('927_IDEMPIERE-388.sql') FROM dual
;

View File

@ -0,0 +1,13 @@
-- IDEMPIERE-458 Invalid indirect foreign keys on GardenWorld
delete from ad_treenode where ad_tree_id=102 and node_id not in (select m_product_id from m_product)
;
delete from ad_treenode where ad_tree_id=103 and node_id not in (select c_bpartner_id from c_bpartner)
;
delete from ad_treenode where ad_tree_id=101 and node_id not in (select c_elementvalue_id from c_elementvalue)
;
SELECT register_migration_script('929_IDEMPIERE-458.sql') FROM dual
;

View File

@ -57,7 +57,7 @@ public class CalloutAssignment extends CalloutEngine
return "";
int M_Product_ID = 0;
StringBuilder Name = null;
String 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 = new StringBuilder(rs.getString(2));
Name = 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.append(" (").append(Description).append(")");
if (!".".equals(Name.toString()))
mTab.setValue("Description", Name.toString());
Name += " (" + Description + ")";
if (!".".equals(Name))
mTab.setValue("Description", Name);
//
String variable = "Qty"; // TimeExpenseLine
if (mTab.getTableName().startsWith("C_Order"))

View File

@ -264,12 +264,12 @@ public class ClientAcctProcessor extends SvrProcess
if (countError[i] > 0)
m_summary.append("(Errors=").append(countError[i]).append(")");
m_summary.append(" - ");
StringBuilder msglog = new StringBuilder(getName()).append(": ").append(m_summary.toString());
StringBuilder msglog = new StringBuilder().append(getName()).append(": ").append(m_summary.toString());
log.finer(msglog.toString());
}
else
{
StringBuilder msglog = new StringBuilder(getName()).append(": ").append(TableName).append(" - no work");
StringBuilder msglog = new StringBuilder().append(getName()).append(": ").append(TableName).append(" - no work");
log.finer(msglog.toString());
}
}

View File

@ -141,7 +141,7 @@ public class HouseKeeping extends SvrProcess{
houseKeeping.setLastDeleted(nodel);
houseKeeping.saveEx();
addLog("@Deleted@ " + nodel);
StringBuilder msg = new StringBuilder(Msg.getElement(getCtx(), tableName + "_ID")).append(" #").append(nodel);
StringBuilder msg = new StringBuilder().append(Msg.getElement(getCtx(), tableName + "_ID")).append(" #").append(nodel);
return msg.toString();
}//doIt
}

View File

@ -126,7 +126,8 @@ public class InOutGenerateRMA extends SvrProcess
}
}
return "@Created@ = " + m_created;
StringBuilder msgreturn = new StringBuilder("@Created@ = ").append(m_created);
return msgreturn.toString();
}
private int getShipmentDocTypeId(int M_RMA_ID)
@ -241,7 +242,7 @@ public class InOutGenerateRMA extends SvrProcess
log.log(Level.WARNING, msglog.toString());
}
StringBuffer processMsg = new StringBuffer(shipment.getDocumentNo());
StringBuffer processMsg = new StringBuffer().append(shipment.getDocumentNo());
if (!shipment.processIt(p_docAction))
{

View File

@ -120,7 +120,8 @@ public class InvoiceGenerateRMA extends SvrProcess
log.log(Level.SEVERE, "Could not close prepared statement");
}
}
return "@Created@ = " + m_created;
StringBuilder msgreturn = new StringBuilder("@Created@ = ").append(m_created);
return msgreturn.toString();
}
private int getInvoiceDocTypeId(int M_RMA_ID)
@ -203,7 +204,7 @@ public class InvoiceGenerateRMA extends SvrProcess
log.log(Level.WARNING, msglog.toString());
}
StringBuilder processMsg = new StringBuilder(invoice.getDocumentNo());
StringBuilder processMsg = new StringBuilder().append(invoice.getDocumentNo());
if (!invoice.processIt(p_docAction))
{

View File

@ -160,7 +160,7 @@ public class PrepareMigrationScripts extends SvrProcess {
}
}
if (blBody) {
body.append(line + '\n');
body.append(line).append('\n');
}
if (line.equals("--BEGINHEADER--")) {
blHeader = true;
@ -173,7 +173,7 @@ public class PrepareMigrationScripts extends SvrProcess {
} else {
if (!isFirstLine)
line = scanner.nextLine();
body.append(line + '\n');
body.append(line).append('\n');
}
isFirstLine = false;
}

View File

@ -87,7 +87,8 @@ public class AD_PrintPaper_Default extends SvrProcess
log.log(Level.SEVERE, "set print format", e);
}
return "@Copied@=" + cnt;
StringBuilder msgreturn = new StringBuilder("@Copied@=").append(cnt);
return msgreturn.toString();
} // doIt
} // AD_PrintPaper_Default

View File

@ -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);
StringBuilder sql;
StringBuilder sql = null;
int updated = 0;
int created = 0;
int updatedTotal = 0;

View File

@ -111,7 +111,8 @@ public class AllocationReset extends SvrProcess
if (delete(hdr))
count++;
m_trx.close();
return "@Deleted@ #" + count;
StringBuilder msgreturn = new StringBuilder("@Deleted@ #").append(count);
return msgreturn.toString();
}
// Selection
@ -171,7 +172,8 @@ public class AllocationReset extends SvrProcess
rs = null; pstmt = null;
}
m_trx.close();
return "@Deleted@ #" + count;
StringBuilder msgreturn = new StringBuilder("@Deleted@ #").append(count);
return msgreturn.toString();
} // doIt

View File

@ -181,7 +181,8 @@ public class AssetDelivery extends SvrProcess
log.info("Count=" + count + ", Errors=" + errors + ", Reminder=" + reminders
+ " - " + (System.currentTimeMillis()-start) + "ms");
return "@Sent@=" + count + " - @Errors@=" + errors;
StringBuilder msgreturn = new StringBuilder("@Sent@=").append(count).append(" - @Errors@=").append(errors);
return msgreturn.toString();
} // doIt
@ -218,8 +219,10 @@ public class AssetDelivery extends SvrProcess
}
String msg = email.send();
new MUserMail(m_MailText, asset.getAD_User_ID(), email).saveEx();
if (!EMail.SENT_OK.equals(msg))
return "** Not delivered: " + user.getEMail() + " - " + msg;
if (!EMail.SENT_OK.equals(msg)){
StringBuilder msgreturn = new StringBuilder("** Not delivered: ").append(user.getEMail()).append(" - ").append(msg);
return msgreturn.toString();
}
//
return user.getEMail();
} // sendNoGuaranteeMail
@ -285,8 +288,10 @@ public class AssetDelivery extends SvrProcess
}
String msg = email.send();
new MUserMail(m_MailText, asset.getAD_User_ID(), email).saveEx();
if (!EMail.SENT_OK.equals(msg))
return "** Not delivered: " + user.getEMail() + " - " + msg;
if (!EMail.SENT_OK.equals(msg)){
StringBuilder msgreturn = new StringBuilder("** Not delivered: ").append(user.getEMail()).append(" - ").append(msg);
return msgreturn.toString();
}
MAssetDelivery ad = asset.confirmDelivery(email, user.getAD_User_ID());
ad.saveEx();
@ -294,7 +299,8 @@ public class AssetDelivery extends SvrProcess
//
log.fine((System.currentTimeMillis()-start) + " ms");
// success
return user.getEMail() + " - " + asset.getProductVersionNo();
StringBuilder msgreturn = new StringBuilder().append(user.getEMail()).append(" - ").append(asset.getProductVersionNo());
return msgreturn.toString();
} // deliverIt
} // AssetDelivery

View File

@ -63,7 +63,7 @@ public class BOMFlagValidate extends SvrProcess {
while (rs.next())
{
StringBuilder msglog=new StringBuilder(rs.getString(1)).append(" BOM without BOM lines");
StringBuilder msglog=new StringBuilder().append(rs.getString(1)).append(" BOM without BOM lines");
addLog(0, null, null, msglog.toString(), MProduct.Table_ID, rs.getInt(2));
}
} catch (SQLException e) {
@ -119,7 +119,7 @@ public class BOMFlagValidate extends SvrProcess {
while (rs.next())
{
StringBuilder msglog = new StringBuilder(rs.getString(1)).append(" not BOM with BOM lines");
StringBuilder msglog = new StringBuilder().append(rs.getString(1)).append(" not BOM with BOM lines");
addLog(0, null, null, msglog.toString(), MProduct.Table_ID, rs.getInt(2));
}
} catch (SQLException e) {

View File

@ -391,7 +391,7 @@ public class ChangeLogProcess extends SvrProcess
.append (" FROM ").append(tableName)
.append (" WHERE EntityType IN ('D','C'))");
int no = DB.executeUpdate(update.toString(), get_TrxName());
StringBuilder msglog = new StringBuilder(table.getTableName()).append(" = ").append(no);
StringBuilder msglog = new StringBuilder().append(table.getTableName()).append(" = ").append(no);
log.config(msglog.toString());
updateNo += no;
@ -406,8 +406,8 @@ public class ChangeLogProcess extends SvrProcess
DB.close(rs, pstmt);
rs = null; pstmt = null;
}
return "@Reset@: " + resetNo + " - @Updated@: " + updateNo;
StringBuilder msgreturn = new StringBuilder("@Reset@: ").append(resetNo).append(" - @Updated@: ").append(updateNo);
return msgreturn.toString();
} // setCustomization
} // ChangeLogProcess

View File

@ -125,7 +125,8 @@ public class ColumnEncryption extends SvrProcess {
column.setIsEncrypted(false);
column.saveEx();
}
return columnName + ": cannot be encrypted";
StringBuilder msgreturn = new StringBuilder().append(columnName).append(": cannot be encrypted");
return msgreturn.toString();
}
// Start
@ -257,7 +258,8 @@ public class ColumnEncryption extends SvrProcess {
}
}
return "Encryption=" + column.isEncrypted();
StringBuilder msgreturn = new StringBuilder("Encryption=").append(column.isEncrypted());
return msgreturn.toString();
} // doIt
/**
@ -346,7 +348,7 @@ public class ColumnEncryption extends SvrProcess {
for (int i = 0; i < colLength; i++) {
str.append("1");
}
str = new StringBuilder(SecureEngine.encrypt(str.toString()));
str = new StringBuilder().append(SecureEngine.encrypt(str.toString()));
return str.length();
} // encryptedColumnLength
@ -372,14 +374,14 @@ public class ColumnEncryption extends SvrProcess {
selectSql.append(" WHERE AD_Column_ID=?");
// Alter SQL
StringBuffer alterSql = new StringBuffer();
StringBuilder alterSql = new StringBuilder();
alterSql.append("ALTER TABLE ").append(tableName);
alterSql.append(" MODIFY ").append(columnName);
alterSql.append(" NVARCHAR2(");
alterSql.append(length).append(") ");
// Update SQL
StringBuffer updateSql = new StringBuffer();
StringBuilder updateSql = new StringBuilder();
updateSql.append("UPDATE AD_Column");
updateSql.append(" SET FieldLength=").append(length);
updateSql.append(" WHERE AD_Column_ID=").append(columnID);

View File

@ -89,7 +89,7 @@ public class CommissionCalc extends SvrProcess
comRun.setStartDate(p_StartDate);
// 01-Jan-2000 - 31-Jan-2001 - USD
SimpleDateFormat format = DisplayType.getDateFormat(DisplayType.Date);
StringBuilder description = new StringBuilder(format.format(p_StartDate))
StringBuilder description = new StringBuilder().append(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());

View File

@ -112,7 +112,7 @@ public class CopyOrder extends SvrProcess
//
// Env.setSOTrx(getCtx(), newOrder.isSOTrx());
// return "@C_Order_ID@ " + newOrder.getDocumentNo();
StringBuilder msgreturn = new StringBuilder(dt.getName()).append(": ").append(newOrder.getDocumentNo());
StringBuilder msgreturn = new StringBuilder().append(dt.getName()).append(": ").append(newOrder.getDocumentNo());
return msgreturn.toString();
} // doIt

View File

@ -208,7 +208,8 @@ public class DistributionRun extends SvrProcess
createOrders();
}
return "@Created@ #" + m_counter;
StringBuilder msgreturn = new StringBuilder("@Created@ #").append(m_counter);
return msgreturn.toString();
} // doIt
@ -547,7 +548,7 @@ public class DistributionRun extends SvrProcess
product = MProduct.get (getCtx(), detail.getM_Product_ID());
if (p_IsTest)
{
StringBuilder msglog = new StringBuilder(bp.getName()).append(" - ").append(product.getName());
StringBuilder msglog = new StringBuilder().append(bp.getName()).append(" - ").append(product.getName());
addLog(0,null, detail.getActualAllocation(), msglog.toString());
continue;
}
@ -571,7 +572,7 @@ public class DistributionRun extends SvrProcess
log.log(Level.SEVERE, "OrderLine not saved");
return false;
}
StringBuilder msglog = new StringBuilder(order.getDocumentNo()).append(": ").append(bp.getName()).append(" - ").append(product.getName());
StringBuilder msglog = new StringBuilder().append(order.getDocumentNo()).append(": ").append(bp.getName()).append(" - ").append(product.getName());
addLog(0,null, detail.getActualAllocation(), msglog.toString());
}
// finish order
@ -997,7 +998,7 @@ public class DistributionRun extends SvrProcess
product = MProduct.get (getCtx(), detail.getM_Product_ID());
if (p_IsTest)
{
StringBuilder msglog = new StringBuilder(bp.getName()).append(" - ").append(product.getName());
StringBuilder msglog = new StringBuilder().append(bp.getName()).append(" - ").append(product.getName());
addLog(0,null, detail.getActualAllocation(), msglog.toString());
continue;
}
@ -1082,7 +1083,7 @@ public class DistributionRun extends SvrProcess
line.saveEx();
}
StringBuilder msglog = new StringBuilder(order.getDocumentNo())
StringBuilder msglog = new StringBuilder().append(order.getDocumentNo())
.append(": ").append(bp.getName()).append(" - ").append(product.getName());
addLog(0,null, detail.getActualAllocation(), msglog.toString());
}

View File

@ -167,7 +167,7 @@ public class DunningPrint extends SvrProcess
MDunningRunEntry.Table_ID,
entry.getC_DunningRunEntry_ID(),
entry.getC_BPartner_ID());
StringBuilder msginfo = new StringBuilder(bp.getName()).append(", Amt=").append(entry.getAmt());
StringBuilder msginfo = new StringBuilder().append(bp.getName()).append(", Amt=").append(entry.getAmt());
info.setDescription(msginfo.toString());
ReportEngine re = null;
if (format != null)
@ -198,7 +198,7 @@ public class DunningPrint extends SvrProcess
//
if (re != null) {
File attachment = re.getPDF(File.createTempFile("Dunning", ".pdf"));
StringBuilder msglog = new StringBuilder(to.toString()).append(" - ").append(attachment);
StringBuilder msglog = new StringBuilder().append(to.toString()).append(" - ").append(attachment);
log.fine(msglog.toString());
email.addAttachment(attachment);
}
@ -208,15 +208,15 @@ public class DunningPrint extends SvrProcess
um.saveEx();
if (msg.equals(EMail.SENT_OK))
{
StringBuilder msglog = new StringBuilder(
bp.getName()).append(" @RequestActionEMailOK@");
StringBuilder msglog = new StringBuilder()
.append(bp.getName()).append(" @RequestActionEMailOK@");
addLog (entry.get_ID(), null, null,msglog.toString());
count++;
printed = true;
}
else
{
StringBuilder msglog = new StringBuilder(bp.getName()).append(" @RequestActionEMailError@ ").append(msg);
StringBuilder msglog = new StringBuilder().append(bp.getName()).append(" @RequestActionEMailError@ ").append(msg);
addLog (entry.get_ID(), null, null,msglog.toString() );
errors++;
}
@ -244,7 +244,8 @@ public class DunningPrint extends SvrProcess
StringBuilder msgreturn = new StringBuilder("@Sent@=").append(count).append(" - @Errors@=").append(errors);
return msgreturn.toString();
}
return "@Printed@=" + count;
StringBuilder msgreturn = new StringBuilder("@Printed@=").append(count);
return msgreturn.toString();
} // doIt
} // DunningPrint

View File

@ -123,7 +123,8 @@ public class DunningRunCreate extends SvrProcess
int entries = DB.getSQLValue(get_TrxName(), "SELECT COUNT(*) FROM C_DunningRunEntry WHERE C_DunningRun_ID=?", m_run.get_ID());
return "@C_DunningRunEntry_ID@ #" + entries;
StringBuilder msgreturn = new StringBuilder("@C_DunningRunEntry_ID@ #").append(entries);
return msgreturn.toString();
} // doIt

View File

@ -55,7 +55,7 @@ public class EMailTest extends SvrProcess
// Test Client Mail
String clientTest = client.testEMail();
StringBuilder msglog = new StringBuilder(client.getName()).append(": ").append(clientTest);
StringBuilder msglog = new StringBuilder().append(client.getName()).append(": ").append(clientTest);
addLog(0, null, null, msglog.toString());
// Test Client DocumentDir
@ -76,7 +76,7 @@ public class EMailTest extends SvrProcess
{
MStore store = wstores[i];
String test = store.testEMail();
msglog = new StringBuilder(store.getName()).append(": ").append(test);
msglog = new StringBuilder().append(store.getName()).append(": ").append(test);
addLog(0, null, null, msglog.toString());
}

View File

@ -137,7 +137,7 @@ public class ExpenseAPInvoice extends SvrProcess
}
invoice.setM_PriceList_ID(te.getM_PriceList_ID());
invoice.setSalesRep_ID(te.getDoc_User_ID());
StringBuilder descr = new StringBuilder(Msg.translate(getCtx(), "S_TimeExpense_ID"))
StringBuilder descr = new StringBuilder().append(Msg.translate(getCtx(), "S_TimeExpense_ID"))
.append(": ").append(te.getDocumentNo()).append(" " )
.append(DisplayType.getDateFormat(DisplayType.Date).format(te.getDateReport()));
invoice.setDescription(descr.toString());

View File

@ -75,7 +75,7 @@ public class ImportDelete extends SvrProcess
// Delete
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);
StringBuilder msg = new StringBuilder().append(Msg.translate(getCtx(), tableName + "_ID")).append(" #").append(no);
return msg.toString();
} // ImportDelete

View File

@ -580,8 +580,8 @@ public class ImportGLJournal extends SvrProcess
commitEx();
// Count Errors
int errors = DB.getSQLValue(get_TrxName(),
"SELECT COUNT(*) FROM I_GLJournal WHERE I_IsImported NOT IN ('Y','N')" + clientCheck);
StringBuilder msgdb = new StringBuilder("SELECT COUNT(*) FROM I_GLJournal WHERE I_IsImported NOT IN ('Y','N')").append(clientCheck);
int errors = DB.getSQLValue(get_TrxName(), msgdb.toString());
if (errors != 0)
{
@ -652,11 +652,11 @@ public class ImportGLJournal extends SvrProcess
batch.setDocumentNo (imp.getBatchDocumentNo());
batch.setC_DocType_ID(imp.getC_DocType_ID());
batch.setPostingType(imp.getPostingType());
StringBuilder description = new StringBuilder(imp.getBatchDescription());
if (description == null || description.length() == 0)
StringBuilder description;
if (imp.getBatchDescription() == null || imp.getBatchDescription().toString().length() == 0)
description = new StringBuilder("*Import-");
else
description.append(" *Import-");
description = new StringBuilder(imp.getBatchDescription()).append(" *Import-");
description.append(new Timestamp(System.currentTimeMillis()));
batch.setDescription(description.toString());
if (!batch.save())

View File

@ -92,7 +92,7 @@ public class ImportPayment extends SvrProcess
StringBuilder sql = null;
int no = 0;
String clientCheck = " AND AD_Client_ID=" + ba.getAD_Client_ID();
StringBuilder clientCheck = new StringBuilder(" AND AD_Client_ID=").append(ba.getAD_Client_ID());
// **** Prepare ****

View File

@ -402,7 +402,7 @@ public class InvoiceGenerate extends SvrProcess
AD_Language = Language.getBaseAD_Language();
java.text.SimpleDateFormat format = DisplayType.getDateFormat
(DisplayType.Date, Language.getLanguage(AD_Language));
StringBuilder reference = new StringBuilder(dt.getPrintName(m_bp.getAD_Language()))
StringBuilder reference = new StringBuilder().append(dt.getPrintName(m_bp.getAD_Language()))
.append(": ").append(ship.getDocumentNo())
.append(" - ").append(format.format(ship.getMovementDate()));
m_ship = ship;

View File

@ -82,7 +82,7 @@ public class OrderRePrice extends SvrProcess
}
order = new MOrder (getCtx(), p_C_Order_ID, get_TrxName());
BigDecimal newPrice = order.getGrandTotal();
retValue = new StringBuilder(order.getDocumentNo()).append(": ").append(oldPrice).append(" -> ").append(newPrice);
retValue = new StringBuilder().append(order.getDocumentNo()).append(": ").append(oldPrice).append(" -> ").append(newPrice);
}
if (p_C_Invoice_ID != 0)
{

View File

@ -80,7 +80,7 @@ public class ProjectLinePricing extends SvrProcess
projectLine.setPlannedMarginAmt(pp.getPriceStd().subtract(pp.getPriceLimit()));
projectLine.saveEx();
//
StringBuilder retValue = new StringBuilder(Msg.getElement(getCtx(), "PriceList")).append(pp.getPriceList()).append(" - ")
StringBuilder retValue = new StringBuilder().append(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();

View File

@ -131,7 +131,7 @@ public class RegisterSystem extends SvrProcess
// Send it
URL url = new URL (urlString.toString());
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
try
{
URLConnection uc = url.openConnection();

View File

@ -243,7 +243,7 @@ public class RequisitionPOCreate extends SvrProcess
whereClause.append(")"); // End Requisition Header
//
// ORDER BY clause
StringBuffer orderClause = new StringBuffer();
StringBuilder orderClause = new StringBuilder();
if (!p_ConsolidateDocument)
{
orderClause.append("M_Requisition_ID, ");
@ -355,7 +355,7 @@ public class RequisitionPOCreate extends SvrProcess
// default po document type
if (!p_ConsolidateDocument)
{
StringBuilder msgsd= new StringBuilder(Msg.getElement(getCtx(), "M_Requisition_ID"))
StringBuilder msgsd= new StringBuilder().append(Msg.getElement(getCtx(), "M_Requisition_ID"))
.append(": ").append(rLine.getParent().getDocumentNo());
m_order.setDescription(msgsd.toString());
}

View File

@ -369,7 +369,7 @@ public class TableCreateColumns extends SvrProcess
// Done
if (column.save ())
{
StringBuilder msglog = new StringBuilder(table.getTableName()).append(".").append(column.getColumnName());
StringBuilder msglog = new StringBuilder().append(table.getTableName()).append(".").append(column.getColumnName());
addLog (0, null, null, msglog.toString());
m_count++;
}

View File

@ -112,7 +112,7 @@ 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()){
StringBuilder msgreturn = new StringBuilder(tree.getName()).append(" OK");
StringBuilder msgreturn = new StringBuilder().append(tree.getName()).append(" OK");
return msgreturn.toString();
}
// Insert new
@ -176,9 +176,9 @@ public class TreeMaintenance extends SvrProcess
{
pstmt = null;
}
StringBuilder msglog = new StringBuilder(tree.getName()).append(" Inserted");
StringBuilder msglog = new StringBuilder().append(tree.getName()).append(" Inserted");
addLog(0,null, new BigDecimal(inserts), msglog.toString());
StringBuilder msgreturn = new StringBuilder(tree.getName()).append((ok ? " OK" : " Error"));
StringBuilder msgreturn = new StringBuilder().append(tree.getName()).append((ok ? " OK" : " Error"));
return msgreturn.toString();
} // verifyTree

View File

@ -11,6 +11,7 @@
</attributes>
</classpathentry>
<classpathentry exported="true" kind="lib" path="groovy-all-1.7.5.jar"/>
<classpathentry kind="lib" path="super-csv-2.0.0-beta-1.jar" sourcepath="/home/carlos/libsources/super-csv-2.0.0-beta-1-sources.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
<accessrules>
<accessrule kind="accessible" pattern="com/sun/rowset/*"/>

View File

@ -17,7 +17,8 @@ Bundle-ClassPath: base.jar,
jnlp.jar,
groovy-all-1.7.5.jar,
vt-dictionary-3.0.jar,
vt-password-3.1.1.jar
vt-password-3.1.1.jar,
super-csv-2.0.0-beta-1.jar
Export-Package: bsh,
bsh.classpath,
bsh.collection,
@ -237,7 +238,14 @@ Export-Package: bsh,
org.jfree.ui.about.resources,
org.jfree.ui.action,
org.jfree.ui.tabbedui,
org.jfree.util
org.jfree.util,
org.supercsv.cellprocessor,
org.supercsv.cellprocessor.constraint,
org.supercsv.cellprocessor.ift,
org.supercsv.exception,
org.supercsv.io,
org.supercsv.prefs,
org.supercsv.util
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: com.sun.mail.smtp;version="1.4.0",
javax.jms;version="1.1.0",

View File

@ -15,7 +15,8 @@ bin.includes = META-INF/,\
OSGI-INF/,\
groovy-all-1.7.5.jar,\
vt-dictionary-3.0.jar,\
vt-password-3.1.1.jar
vt-password-3.1.1.jar,\
super-csv-2.0.0-beta-1.jar
output.base.jar = build/
source.base.jar = src/
src.includes = schema/

View File

@ -42,6 +42,15 @@
priority="0">
</exporter>
</extension>
<extension
id="org.adempiere.impexp.GridTabCSVExporter"
name="Grid data CSV exporter"
point="org.adempiere.base.IGridTabExporter">
<exporter
class="org.adempiere.impexp.GridTabCSVExporter"
priority="0">
</exporter>
</extension>
<extension
id="org.adempiere.base.ModelGeneratorApplication"
name="Model Generator"

View File

@ -0,0 +1,256 @@
/******************************************************************************
* Product: iDempiere ERP & CRM Smart Business Solution *
* Copyright (C) 2012 Carlos Ruiz *
* 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.impexp;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.adempiere.base.IGridTabExporter;
import org.adempiere.model.MTabCustomization;
import org.compiere.model.GridField;
import org.compiere.model.GridTab;
import org.compiere.model.GridTable;
import org.compiere.model.MColumn;
import org.compiere.model.MRefList;
import org.compiere.model.MTable;
import org.compiere.util.DB;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.compiere.util.Util;
import org.supercsv.cellprocessor.FmtBool;
import org.supercsv.cellprocessor.FmtDate;
import org.supercsv.cellprocessor.FmtNumber;
import org.supercsv.cellprocessor.Optional;
import org.supercsv.cellprocessor.ift.CellProcessor;
import org.supercsv.io.CsvMapWriter;
import org.supercsv.io.ICsvMapWriter;
import org.supercsv.prefs.CsvPreference;
/**
* CSV Exporter for GridTab
* @author Carlos Ruiz
*/
public class GridTabCSVExporter implements IGridTabExporter
{
@Override
public void export(GridTab gridTab, List<GridTab> childs, boolean currentRowOnly, File file) {
ICsvMapWriter mapWriter = null;
try {
mapWriter = new CsvMapWriter(new FileWriter(file), CsvPreference.STANDARD_PREFERENCE);
GridTable gt = gridTab.getTableModel();
GridField[] gridFields = getFields(gridTab);
List<String> headArray = new ArrayList<String>();
List<String> colsArray = new ArrayList<String>();
List<CellProcessor> procArray = new ArrayList<CellProcessor>();
MTable table = MTable.get(Env.getCtx(), gridTab.getTableName());
for (int idxfld = 0; idxfld < gridFields.length; idxfld++) {
GridField field = gridFields[idxfld];
colsArray.add(field.getColumnName());
MColumn column = MColumn.get(Env.getCtx(), field.getAD_Column_ID());
String headName = resolveColumnName(table, column);
headArray.add(headName);
if (DisplayType.Date == column.getAD_Reference_ID()) {
procArray.add(new Optional(new FmtDate(DisplayType.DEFAULT_DATE_FORMAT)));
} else if (DisplayType.DateTime == column.getAD_Reference_ID()) {
procArray.add(new Optional(new FmtDate(DisplayType.DEFAULT_TIMESTAMP_FORMAT)));
} else if (DisplayType.Time == column.getAD_Reference_ID()) {
procArray.add(new Optional(new FmtDate("DisplayType.DEFAULT_TIME_FORMAT")));
} else if (DisplayType.Integer == column.getAD_Reference_ID() || DisplayType.isNumeric(column.getAD_Reference_ID())) {
procArray.add(new Optional(new FmtNumber(DisplayType.getNumberFormat(column.getAD_Reference_ID()))));
} else if (DisplayType.YesNo == column.getAD_Reference_ID()) {
procArray.add(new Optional(new FmtBool("Y", "N")));
} else { // lookups and text
procArray.add(null);
}
}
// the header elements are used to map the bean values to each column (names must match)
String[] header = headArray.toArray(new String[headArray.size()]);
CellProcessor[] processors = procArray.toArray(new CellProcessor[procArray.size()]);
// write the header
mapWriter.writeHeader(header);
// write the beans
int start = 0;
int end = 0;
if (currentRowOnly) {
start = gridTab.getCurrentRow();
end = start + 1;
} else {
end = gt.getRowCount();
}
for (int idxrow = start; idxrow < end; idxrow++) {
Map<String, Object> row = new HashMap<String, Object>();
for (int idxfld = 0; idxfld < header.length; idxfld++) {
GridField field = gridFields[idxfld];
MColumn column = MColumn.get(Env.getCtx(), field.getAD_Column_ID());
String headName = header[idxfld];
Object value = resolveValue(gridTab, table, column, idxrow, headName);
row.put(headName, value);
}
mapWriter.write(row, header, processors);
}
} catch (IOException e) {
e.printStackTrace();
} finally {
if (mapWriter != null) {
try {
mapWriter.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
private Object resolveValue(GridTab gridTab, MTable table, MColumn column, int i, String headName) {
Object value = null;
if (headName.contains("[") && headName.endsWith("]")) {
String foreignTable = column.getReferenceTableName();
Object idO = gridTab.getValue(i, column.getColumnName());
if (idO != null) {
if (foreignTable.equals("AD_Ref_List")) {
String ref = (String) idO;
value = MRefList.getListName(Env.getCtx(), column.getAD_Reference_Value_ID(), ref);
} else {
int id = (Integer) idO;
int start = headName.indexOf("[")+1;
int end = headName.length()-1;
String foreignColumn = headName.substring(start, end);
StringBuilder select = new StringBuilder("SELECT ")
.append(foreignColumn).append(" FROM ")
.append(foreignTable).append(" WHERE ")
.append(foreignTable).append("_ID=?");
value = DB.getSQLValueStringEx(null, select.toString(), id);
}
}
} else {
value = gridTab.getValue(i, headName);
}
return value;
}
private String resolveColumnName(MTable table, MColumn column) {
StringBuilder name = new StringBuilder(column.getColumnName());
if (DisplayType.isLookup(column.getAD_Reference_ID())) {
// resolve to identifier - search for value first, if not search for name - if not use the ID
String foreignTable = column.getReferenceTableName();
if ( ! ("AD_Language".equals(foreignTable) || "AD_EntityType".equals(foreignTable))) {
MTable fTable = MTable.get(Env.getCtx(), foreignTable);
// Hardcoded / do not check for Value on AD_Org and AD_User, must use name for these two tables
if (! ("AD_Org".equals(foreignTable) || "AD_User".equals(foreignTable))
&& fTable.getColumn("Value") != null) {
name.append("[Value]"); // fully qualified
} else if (fTable.getColumn("Name") != null) {
name.append("[Name]");
}
}
}
return name.toString();
}
@Override
public String getFileExtension() {
return "csv";
}
@Override
public String getFileExtensionLabel() {
return Msg.getMsg(Env.getCtx(), "FileCSV");
}
@Override
public String getContentType() {
return "application/csv";
}
private GridField[] getFields (GridTab gridTab) {
GridTable tableModel = gridTab.getTableModel();
GridField[] tmpFields = tableModel.getFields();
MTabCustomization tabCustomization = MTabCustomization.get(Env.getCtx(), Env.getAD_User_ID(Env.getCtx()), gridTab.getAD_Tab_ID(), null);
GridField[] gridFields = null;
if (tabCustomization != null
&& tabCustomization.getAD_Tab_Customization_ID() > 0
&& !Util.isEmpty(tabCustomization.getCustom(), true))
{
String custom = tabCustomization.getCustom().trim();
String[] customComponent = custom.split(";");
String[] fieldIds = customComponent[0].split("[,]");
List<GridField> fieldList = new ArrayList<GridField>();
for(String fieldIdStr : fieldIds)
{
fieldIdStr = fieldIdStr.trim();
if (fieldIdStr.length() == 0) continue;
int AD_Field_ID = Integer.parseInt(fieldIdStr);
for(GridField gridField : tmpFields)
{
if (gridField.getAD_Field_ID() == AD_Field_ID)
{
if(gridField.isDisplayedGrid())
fieldList.add(gridField);
break;
}
}
}
gridFields = fieldList.toArray(new GridField[0]);
}
else
{
ArrayList<GridField> gridFieldList = new ArrayList<GridField>();
for(GridField field:tmpFields)
{
if(field.isDisplayedGrid())
gridFieldList.add(field);
}
Collections.sort(gridFieldList, new Comparator<GridField>() {
@Override
public int compare(GridField o1, GridField o2) {
return o1.getSeqNoGrid()-o2.getSeqNoGrid();
}
});
gridFields = new GridField[gridFieldList.size()];
gridFieldList.toArray(gridFields);
}
return gridFields;
}
public boolean isColumnPrinted(GridTab tab, int col)
{
GridField field = tab.getField(col);
// field not displayed
if (!field.isDisplayed())
return false;
// field encrypted
if (field.isEncrypted())
return false;
// button without a reference value
if (field.getDisplayType() == DisplayType.Button && field.getAD_Reference_Value_ID() == 0)
return false;
return true;
}
}

View File

@ -414,8 +414,8 @@ public class MRelationType extends X_AD_RelationType implements IZoomProvider {
private static void evaluateQuery(final MQuery query) {
final String sqlCommon = " FROM " + query.getZoomTableName()
+ " WHERE " + query.getWhereClause(false);
StringBuilder sqlCommon = new StringBuilder(" FROM ").append(query.getZoomTableName())
.append(" WHERE ").append(query.getWhereClause(false));
final String sqlCount = "SELECT COUNT(*) " + sqlCommon;
@ -424,10 +424,10 @@ public class MRelationType extends X_AD_RelationType implements IZoomProvider {
if (count > 0) {
final String sqlFirstKey = "SELECT " + query.getZoomColumnName()
+ sqlCommon;
StringBuilder sqlFirstKey = new StringBuilder("SELECT ").append(query.getZoomColumnName())
.append(sqlCommon);
final int firstKey = DB.getSQLValueEx(null, sqlFirstKey);
final int firstKey = DB.getSQLValueEx(null, sqlFirstKey.toString());
query.setZoomValue(firstKey);
}
}
@ -462,7 +462,7 @@ public class MRelationType extends X_AD_RelationType implements IZoomProvider {
@Override
public String toString() {
final StringBuffer sb = new StringBuffer("MRelationType[");
StringBuilder sb = new StringBuilder("MRelationType[");
//
sb.append(get_ID());
sb.append(", Name=").append(getName());

View File

@ -55,7 +55,8 @@ public class ResetLockedAccount extends SvrProcess {
if (no < 0)
throw new AdempiereException("Could not unlock user account" + user.toString());
return "@OK@ - The user '" + user.getName() + "' has been unlocked";
StringBuilder msgreturn = new StringBuilder("@OK@ - The user '").append(user.getName()).append("' has been unlocked");
return msgreturn.toString();
}
else
{
@ -84,7 +85,8 @@ public class ResetLockedAccount extends SvrProcess {
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";
StringBuilder msgreturn = new StringBuilder().append(no).append(" locked account has been reset");
return msgreturn.toString();
}
}
}

View File

@ -127,7 +127,8 @@ public class UUIDGenerator extends SvrProcess {
} finally {
DB.close(rs,stmt);
}
return count + " table altered";
StringBuilder msgreturn = new StringBuilder().append(count).append(" table altered");
return msgreturn.toString();
}
public static void updateUUID(MColumn column, String trxName) {
@ -241,13 +242,13 @@ public class UUIDGenerator extends SvrProcess {
while (rs.next())
{
noColumns++;
StringBuilder columnName = new StringBuilder(rs.getString ("COLUMN_NAME"));
StringBuilder columnName = new StringBuilder().append(rs.getString ("COLUMN_NAME"));
if (!columnName.toString().equalsIgnoreCase(column.getColumnName()))
continue;
// update existing column
boolean notNull = DatabaseMetaData.columnNoNulls == rs.getInt("NULLABLE");
sql = new StringBuilder(column.getSQLModify(table, column.isMandatory() != notNull));
sql = new StringBuilder().append(column.getSQLModify(table, column.isMandatory() != notNull));
break;
}
}
@ -282,10 +283,10 @@ public class UUIDGenerator extends SvrProcess {
if (no != -1)
{
StringBuilder indexName = new StringBuilder(column.getColumnName()).append("_idx");
StringBuilder indexName = new StringBuilder().append(column.getColumnName()).append("_idx");
if (indexName.length() > 30) {
int i = indexName.length() - 31;
indexName = new StringBuilder(column.getColumnName().substring(0, column.getColumnName().length() - i));
indexName = new StringBuilder().append(column.getColumnName().substring(0, column.getColumnName().length() - i));
indexName.append("_uu_idx");
}
StringBuilder indexSql = new StringBuilder("CREATE UNIQUE INDEX ").append(indexName).append(" ON ").append(tableName)

View File

@ -176,7 +176,7 @@ public abstract class AbstractDocumentSearch {
}
// SearchDefinition with a special query
} else if (msd.getSearchType().equals(MSearchDefinition.SEARCHTYPE_QUERY)) {
sqlSO = new StringBuilder(msd.getQuery());
sqlSO = new StringBuilder().append(msd.getQuery());
pstmtSO = DB.prepareStatement(sqlSO.toString(), null);
// count '?' in statement
int count = 1;

View File

@ -135,22 +135,22 @@ public class ModelClassGenerator
if (tableName == null)
throw new RuntimeException ("TableName not found for ID=" + AD_Table_ID);
//
String accessLevelInfo = accessLevel + " ";
StringBuilder accessLevelInfo = new StringBuilder().append(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 keyColumn = tableName + "_ID";
String className = "X_" + tableName;
StringBuilder keyColumn = new StringBuilder().append(tableName).append("_ID");
StringBuilder className = new StringBuilder("X_").append(tableName);
//
StringBuilder start = new StringBuilder()
.append (ModelInterfaceGenerator.COPY)
.append ("/** Generated Model - DO NOT CHANGE */").append(NL)
.append("package " + packageName + ";").append(NL)
.append("package ").append(packageName).append(";").append(NL)
.append(NL)
;
@ -248,12 +248,12 @@ public class ModelClassGenerator
.append(" }").append(NL)
;
StringBuilder end = new StringBuilder ("}");
String end = "}";
//
sb.insert(0, start);
sb.append(end);
return className;
return className.toString();
}
/**
@ -398,10 +398,10 @@ public class ModelClassGenerator
if (fieldName != null && referenceClassName != null)
{
sb.append(NL)
.append("\tpublic "+referenceClassName+" get").append(fieldName).append("() throws RuntimeException").append(NL)
.append("\tpublic ").append(referenceClassName).append(" get").append(fieldName).append("() throws RuntimeException").append(NL)
.append(" {").append(NL)
.append("\t\treturn ("+referenceClassName+")MTable.get(getCtx(), "+referenceClassName+".Table_Name)").append(NL)
.append("\t\t\t.getPO(get"+columnName+"(), get_TrxName());")
.append("\t\treturn (").append(referenceClassName).append(")MTable.get(getCtx(), ").append(referenceClassName).append(".Table_Name)").append(NL)
.append("\t\t\t.getPO(get").append(columnName).append("(), get_TrxName());")
/**/
.append("\t}").append(NL)
;
@ -701,9 +701,9 @@ public class ModelClassGenerator
*/
private StringBuilder createKeyNamePair (String columnName, int displayType)
{
String method = "get" + columnName + "()";
StringBuilder method = new StringBuilder("get").append(columnName).append("()");
if (displayType != DisplayType.String)
method = "String.valueOf(" + method + ")";
method = new StringBuilder("String.valueOf(").append(method).append(")");
StringBuilder sb = new StringBuilder(NL)
.append(" /** Get Record ID/ColumnName").append(NL)
@ -757,7 +757,8 @@ public class ModelClassGenerator
fw.close ();
float size = out.length();
size /= 1024;
System.out.println(out.getAbsolutePath() + " - " + size + " kB");
StringBuilder msgout = new StringBuilder().append(out.getAbsolutePath()).append(" - ").append(size).append(" kB");
System.out.println(msgout.toString());
}
catch (Exception ex)
{
@ -837,9 +838,9 @@ public class ModelClassGenerator
if (tableName == null || tableName.trim().length() == 0)
throw new IllegalArgumentException("Must specify table name");
String tableLike = tableName.trim();
if (!tableLike.startsWith("'") || !tableLike.endsWith("'"))
tableLike = "'" + tableLike + "'";
StringBuilder tableLike = new StringBuilder().append(tableName.trim());
if (!tableLike.toString().startsWith("'") || !tableLike.toString().endsWith("'"))
tableLike = new StringBuilder("'").append(tableLike).append("'");
StringBuilder entityTypeFilter = new StringBuilder();
if (entityType != null && entityType.trim().length() > 0)
@ -848,9 +849,9 @@ public class ModelClassGenerator
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().append(tokenizer.nextToken().trim());
if (!token.toString().startsWith("'") || !token.toString().endsWith("'"))
token = new StringBuilder("'").append(token).append("'");
if (i > 0)
entityTypeFilter.append(",");
entityTypeFilter.append(token);
@ -863,18 +864,18 @@ public class ModelClassGenerator
entityTypeFilter.append("EntityType IN ('U','A')");
}
String directory = sourceFolder.trim();
StringBuilder directory = new StringBuilder().append(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.append(packagePath);
file = new File(directory.toString());
if (!file.exists())
file.mkdirs();
@ -899,7 +900,7 @@ public class ModelClassGenerator
rs = pstmt.executeQuery();
while (rs.next())
{
new ModelClassGenerator(rs.getInt(1), directory, packageName);
new ModelClassGenerator(rs.getInt(1), directory.toString(), packageName);
count++;
}
}

View File

@ -171,7 +171,7 @@ public class ModelInterfaceGenerator
accessLevelInfo.append("- Org ");
//
String className = "I_" + tableName;
StringBuilder className = new StringBuilder("I_").append(tableName);
//
StringBuilder start = new StringBuilder()
.append (COPY)
@ -216,12 +216,12 @@ public class ModelInterfaceGenerator
//.append(" POInfo initPO (Properties ctx);") // INFO - Should this be here???
;
StringBuilder end = new StringBuilder("}");
String end = "}";
//
sb.insert(0, start);
sb.append(end);
return className;
return className.toString();
}
/**
@ -418,7 +418,8 @@ public class ModelInterfaceGenerator
fw.close();
float size = out.length();
size /= 1024;
System.out.println(out.getAbsolutePath() + " - " + size + " kB");
StringBuilder msgout = new StringBuilder().append(out.getAbsolutePath()).append(" - ").append(size).append(" kB");
System.out.println(msgout.toString());
} catch (Exception ex) {
log.log(Level.SEVERE, fileName, ex);
throw new RuntimeException(ex);
@ -634,13 +635,13 @@ public class ModelInterfaceGenerator
public static String getReferenceClassName(int AD_Table_ID, String columnName, int displayType, int AD_Reference_ID)
{
StringBuilder referenceClassName = null;
String 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 = new StringBuilder("I_").append(refTableName);
referenceClassName = "I_"+refTableName;
MTable table = MTable.get(Env.getCtx(), refTableName);
if (table != null)
@ -649,7 +650,7 @@ public class ModelInterfaceGenerator
String modelpackage = getModelPackage(entityType) ;
if (modelpackage != null)
{
referenceClassName = new StringBuilder(modelpackage).append(".").append(referenceClassName);
referenceClassName = modelpackage+"."+referenceClassName;
}
if (!isGenerateModelGetterForEntity(AD_Table_ID, entityType))
{
@ -691,11 +692,11 @@ public class ModelInterfaceGenerator
final int refDisplayType = rs.getInt(3);
if (refDisplayType == DisplayType.ID)
{
referenceClassName = new StringBuilder("I_").append(refTableName);
referenceClassName = "I_"+refTableName;
String modelpackage = getModelPackage(entityType);
if (modelpackage != null)
{
referenceClassName = new StringBuilder(modelpackage).append(".").append(referenceClassName);
referenceClassName = modelpackage+"."+referenceClassName;
}
if (!isGenerateModelGetterForEntity(AD_Table_ID, entityType))
{
@ -716,19 +717,19 @@ public class ModelInterfaceGenerator
}
else if (displayType == DisplayType.Location)
{
referenceClassName = new StringBuilder("I_C_Location");
referenceClassName = "I_C_Location";
}
else if (displayType == DisplayType.Locator)
{
referenceClassName = new StringBuilder("I_M_Locator");
referenceClassName = "I_M_Locator";
}
else if (displayType == DisplayType.Account)
{
referenceClassName = new StringBuilder("I_C_ValidCombination");
referenceClassName = "I_C_ValidCombination";
}
else if (displayType == DisplayType.PAttribute)
{
referenceClassName = new StringBuilder("I_M_AttributeSetInstance");
referenceClassName = "I_M_AttributeSetInstance";
}
else
{
@ -736,7 +737,7 @@ public class ModelInterfaceGenerator
//sb.append("\tpublic I_"+columnName+" getI_").append(columnName).append("(){return null; };");
}
//
return referenceClassName.toString();
return referenceClassName;
}
@ -797,7 +798,7 @@ public class ModelInterfaceGenerator
entityTypeFilter.append("EntityType IN ('U','A')");
}
StringBuilder directory = new StringBuilder(sourceFolder.trim());
StringBuilder directory = new StringBuilder().append(sourceFolder.trim());
String packagePath = packageName.replace(".", File.separator);
if (!(directory.toString().endsWith("/") || directory.toString().endsWith("\\")))
{

View File

@ -426,22 +426,24 @@ public abstract class Doc
|| m_DocStatus.equals(DocumentEngine.STATUS_Voided)
|| m_DocStatus.equals(DocumentEngine.STATUS_Reversed))
;
else
return "Invalid DocStatus='" + m_DocStatus + "' for DocumentNo=" + getDocumentNo();
else{
StringBuilder msgreturn = new StringBuilder("Invalid DocStatus='").append(m_DocStatus).append("' for DocumentNo=").append(getDocumentNo());
return msgreturn.toString();
}
//
if (p_po.getAD_Client_ID() != m_as.getAD_Client_ID())
{
String error = "AD_Client_ID Conflict - Document=" + p_po.getAD_Client_ID()
+ ", AcctSchema=" + m_as.getAD_Client_ID();
log.severe(error);
return error;
StringBuilder error = new StringBuilder("AD_Client_ID Conflict - Document=").append(p_po.getAD_Client_ID())
.append(", AcctSchema=").append(m_as.getAD_Client_ID());
log.severe(error.toString());
return error.toString();
}
// Lock Record ----
String trxName = null; // outside trx if on server
if (! m_manageLocalTrx)
trxName = getTrxName(); // on trx if it's in client
StringBuffer sql = new StringBuffer ("UPDATE ");
StringBuilder sql = new StringBuilder ("UPDATE ");
sql.append(get_TableName()).append( " SET Processing='Y' WHERE ")
.append(get_TableName()).append("_ID=").append(get_ID())
.append(" AND Processed='Y' AND IsActive='Y'");
@ -565,7 +567,7 @@ public abstract class Doc
// Reference
note.setReference(toString()); // Document
// Text
StringBuffer Text = new StringBuffer (Msg.getMsg(Env.getCtx(), AD_MessageValue));
StringBuilder Text = new StringBuilder (Msg.getMsg(Env.getCtx(), AD_MessageValue));
if (p_Error != null)
Text.append(" (").append(p_Error).append(")");
String cn = getClass().getName();
@ -603,7 +605,7 @@ public abstract class Doc
*/
protected int deleteAcct()
{
StringBuffer sql = new StringBuffer ("DELETE Fact_Acct WHERE AD_Table_ID=")
StringBuilder sql = new StringBuilder ("DELETE Fact_Acct WHERE AD_Table_ID=")
.append(get_Table_ID())
.append(" AND Record_ID=").append(p_po.get_ID())
.append(" AND C_AcctSchema_ID=").append(m_as.getC_AcctSchema_ID());
@ -776,7 +778,7 @@ public abstract class Doc
String trxName = null; // outside trx if on server
if (! m_manageLocalTrx)
trxName = getTrxName(); // on trx if it's in client
StringBuffer sql = new StringBuffer ("UPDATE ");
StringBuilder sql = new StringBuilder ("UPDATE ");
sql.append(get_TableName()).append( " SET Processing='N' WHERE ")
.append(get_TableName()).append("_ID=").append(p_po.get_ID());
DB.executeUpdate(sql.toString(), trxName);

View File

@ -84,7 +84,7 @@ public class DocLine_Allocation extends DocLine
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("DocLine_Allocation[");
StringBuilder sb = new StringBuilder ("DocLine_Allocation[");
sb.append(get_ID())
.append(",Amt=").append(getAmtSource())
.append(",Discount=").append(getDiscountAmt())

View File

@ -227,10 +227,11 @@ public class DocManager {
if (tableName == null)
{
s_log.severe("Table not a financial document. AD_Table_ID=" + AD_Table_ID);
return "Table not a financial document. AD_Table_ID="+AD_Table_ID;
StringBuilder msgreturn = new StringBuilder("Table not a financial document. AD_Table_ID=").append(AD_Table_ID);
return msgreturn.toString();
}
StringBuffer sql = new StringBuffer("SELECT * FROM ")
StringBuilder sql = new StringBuilder("SELECT * FROM ")
.append(tableName)
.append(" WHERE ").append(tableName).append("_ID=? AND Processed='Y'");
PreparedStatement pstmt = null;
@ -366,7 +367,7 @@ public class DocManager {
private final static boolean save (String trxName, int AD_Table_ID, int Record_ID, String status)
{
MTable table = MTable.get(Env.getCtx(), AD_Table_ID);
StringBuffer sql = new StringBuffer("UPDATE ");
StringBuilder sql = new StringBuilder("UPDATE ");
sql.append(table.getTableName()).append(" SET Posted='").append(status)
.append("',Processing='N' ")
.append("WHERE ")

View File

@ -170,7 +170,8 @@ public final class DocTax
*/
public String getDescription()
{
return m_name + " " + m_taxBaseAmt.toString();
StringBuilder msgreturn = new StringBuilder().append(m_name).append(" ").append(m_taxBaseAmt.toString());
return msgreturn.toString();
} // getDescription
/**
@ -236,7 +237,7 @@ public final class DocTax
*/
public String toString()
{
StringBuffer sb = new StringBuffer("Tax=(");
StringBuilder sb = new StringBuilder("Tax=(");
sb.append(m_name);
sb.append(" Amt=").append(m_amount);
sb.append(")");

View File

@ -747,9 +747,9 @@ public class Doc_AllocationHdr extends Doc
if (invoiceSource == null || invoiceAccounted == null)
return "Gain/Loss - Invoice not posted yet";
//
String description = "Invoice=(" + invoice.getC_Currency_ID() + ")" + invoiceSource + "/" + invoiceAccounted
+ " - Allocation=(" + getC_Currency_ID() + ")" + allocationSource + "/" + allocationAccounted;
log.fine(description);
StringBuilder description = new StringBuilder("Invoice=(").append(invoice.getC_Currency_ID()).append(")").append(invoiceSource).append("/").append(invoiceAccounted)
.append(" - Allocation=(").append(getC_Currency_ID()).append(")").append(allocationSource).append("/").append(allocationAccounted);
log.fine(description.toString());
// Allocation not Invoice Currency
if (getC_Currency_ID() != invoice.getC_Currency_ID())
{
@ -759,10 +759,10 @@ public class Doc_AllocationHdr extends Doc
invoice.getC_ConversionType_ID(), invoice.getAD_Client_ID(), invoice.getAD_Org_ID());
if (allocationSourceNew == null)
return "Gain/Loss - No Conversion from Allocation->Invoice";
String d2 = "Allocation=(" + getC_Currency_ID() + ")" + allocationSource
+ "->(" + invoice.getC_Currency_ID() + ")" + allocationSourceNew;
log.fine(d2);
description += " - " + d2;
StringBuilder d2 = new StringBuilder("Allocation=(").append(getC_Currency_ID()).append(")").append(allocationSource)
.append("->(").append(invoice.getC_Currency_ID()).append(")").append(allocationSourceNew);
log.fine(d2.toString());
description.append(" - ").append(d2);
allocationSource = allocationSourceNew;
}
@ -771,9 +771,9 @@ public class Doc_AllocationHdr extends Doc
if (allocationSource.compareTo(invoiceSource) == 0)
{
acctDifference = invoiceAccounted.subtract(allocationAccounted); // gain is negative
String d2 = "(full) = " + acctDifference;
log.fine(d2);
description += " - " + d2;
StringBuilder d2 = new StringBuilder("(full) = ").append(acctDifference);
log.fine(d2.toString());
description.append(" - ").append(d2);
}
else // partial or MC
{
@ -790,9 +790,9 @@ public class Doc_AllocationHdr extends Doc
int precision = as.getStdPrecision();
if (acctDifference.scale() > precision)
acctDifference = acctDifference.setScale(precision, BigDecimal.ROUND_HALF_UP);
String d2 = "(partial) = " + acctDifference + " - Multiplier=" + multiplier;
log.fine(d2);
description += " - " + d2;
StringBuilder d2 = new StringBuilder("(partial) = ").append(acctDifference).append(" - Multiplier=").append(multiplier);
log.fine(d2.toString());
description.append(" - ").append(d2);
}
if (acctDifference.signum() == 0)
@ -808,10 +808,10 @@ public class Doc_AllocationHdr extends Doc
{
FactLine fl = fact.createLine (line, loss, gain,
as.getC_Currency_ID(), acctDifference);
fl.setDescription(description);
fl.setDescription(description.toString());
fact.createLine (line, acct,
as.getC_Currency_ID(), acctDifference.negate());
fl.setDescription(description);
fl.setDescription(description.toString());
}
else
{

View File

@ -245,7 +245,7 @@ public class Doc_Invoice extends Doc
public BigDecimal getBalance()
{
BigDecimal retValue = Env.ZERO;
StringBuffer sb = new StringBuffer (" [");
StringBuilder sb = new StringBuilder (" [");
// Total
retValue = retValue.add(getAmount(Doc.AMTTYPE_Gross));
sb.append(getAmount(Doc.AMTTYPE_Gross));
@ -900,19 +900,19 @@ public class Doc_Invoice extends Doc
}
else
{
sql.append(" AND il.C_InvoiceLine_ID = (SELECT MIN(il1.C_InvoiceLine_ID) "
+ "FROM C_Invoice i1, C_InvoiceLine il1 "
+ "WHERE i1.C_Invoice_ID=il1.C_Invoice_ID"
+ " AND po.M_Product_ID=il1.M_Product_ID AND po.C_BPartner_ID=i1.C_BPartner_ID")
sql.append(" AND il.C_InvoiceLine_ID = (SELECT MIN(il1.C_InvoiceLine_ID) ")
.append("FROM C_Invoice i1, C_InvoiceLine il1 ")
.append("WHERE i1.C_Invoice_ID=il1.C_Invoice_ID")
.append(" AND po.M_Product_ID=il1.M_Product_ID AND po.C_BPartner_ID=i1.C_BPartner_ID")
.append(" AND i1.C_Invoice_ID=").append(get_ID()).append(") ");
}
sql.append(" AND i.C_Invoice_ID=").append(get_ID()).append(") ")
// update
.append("WHERE EXISTS (SELECT * "
+ "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"
+ " AND i.C_Invoice_ID=").append(get_ID()).append(")");
.append("WHERE EXISTS (SELECT * ")
.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")
.append(" AND i.C_Invoice_ID=").append(get_ID()).append(")");
int no = DB.executeUpdate(sql.toString(), getTrxName());
log.fine("Updated=" + no);
} // updateProductPO

View File

@ -282,7 +282,7 @@ public class Doc_Order extends Doc
public BigDecimal getBalance()
{
BigDecimal retValue = Env.ZERO;
StringBuffer sb = new StringBuffer (" [");
StringBuilder sb = new StringBuilder (" [");
// Total
retValue = retValue.add(getAmount(Doc.AMTTYPE_Gross));
sb.append(getAmount(Doc.AMTTYPE_Gross));
@ -461,7 +461,7 @@ public class Doc_Order 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 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 ")
@ -479,11 +479,11 @@ public class Doc_Order extends Doc
.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 * "
+ "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"
+ " AND o.C_Order_ID=").append(get_ID()).append(")");
.append("WHERE EXISTS (SELECT * ")
.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")
.append(" AND o.C_Order_ID=").append(get_ID()).append(")");
int no = DB.executeUpdate(sql.toString(), getTrxName());
log.fine("Updated=" + no);
} // updateProductPO

View File

@ -86,9 +86,12 @@ public class Doc_ProjectIssue extends Doc
public String getDocumentNo ()
{
MProject p = m_issue.getParent();
if (p != null)
return p.getValue() + " #" + m_issue.getLine();
return "(" + m_issue.get_ID() + ")";
if (p != null){
StringBuilder msgreturn = new StringBuilder().append(p.getValue()).append(" #").append(m_issue.getLine());
return msgreturn.toString();
}
StringBuilder msgreturn = new StringBuilder("(").append(m_issue.get_ID()).append(")");
return msgreturn.toString();
} // getDocumentNo
/**

View File

@ -351,7 +351,7 @@ public final class FactLine extends X_Fact_Acct
if (m_docLine != null)
setC_Tax_ID (m_docLine.getC_Tax_ID());
// Description
StringBuffer description = new StringBuffer(m_doc.getDocumentNo());
StringBuilder description = new StringBuilder().append(m_doc.getDocumentNo());
if (m_docLine != null)
{
description.append(" #").append(m_docLine.getLine());
@ -458,8 +458,10 @@ public final class FactLine extends X_Fact_Acct
String original = getDescription();
if (original == null || original.trim().length() == 0)
super.setDescription(description);
else
super.setDescription(original + " - " + description);
else{
StringBuilder msgd = new StringBuilder(original).append(" - ").append(description);
super.setDescription(msgd.toString());
}
} // addDescription
/**
@ -729,7 +731,7 @@ public final class FactLine extends X_Fact_Acct
*/
public String toString()
{
StringBuffer sb = new StringBuffer("FactLine=[");
StringBuilder sb = new StringBuilder("FactLine=[");
sb.append(getAD_Table_ID()).append(":").append(getRecord_ID())
.append(",").append(m_acct)
.append(",Cur=").append(getC_Currency_ID())
@ -1104,7 +1106,7 @@ public final class FactLine extends X_Fact_Acct
// end Bayu Sistematika
//
success = true;
log.fine(new StringBuffer("(Table=").append(AD_Table_ID)
log.fine(new StringBuilder("(Table=").append(AD_Table_ID)
.append(",Record_ID=").append(Record_ID)
.append(",Line=").append(Record_ID)
.append(", Account=").append(m_acct)
@ -1132,7 +1134,7 @@ public final class FactLine extends X_Fact_Acct
setAD_Org_ID (fact.getAD_Org_ID());
}
else
log.warning(new StringBuffer("Not Found (try later) ")
log.warning(new StringBuilder("Not Found (try later) ")
.append(",C_AcctSchema_ID=").append(getC_AcctSchema_ID())
.append(", AD_Table_ID=").append(AD_Table_ID)
.append(",Record_ID=").append(Record_ID)

View File

@ -157,12 +157,12 @@ public class Matcher
// MMatchInv inv = new MMatchInv ();
int M_MatchInv_ID = DB.getNextID (AD_Client_ID, "M_MatchInv", m_trxName);
//
StringBuffer sql = new StringBuffer("INSERT INTO M_MatchInv ("
+ "M_MatchInv_ID, "
+ "AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy, "
+ "M_InOutLine_ID,C_InvoiceLine_ID, "
+ "M_Product_ID,DateTrx,Qty, "
+ "Processing,Processed,Posted) VALUES (")
StringBuilder sql = new StringBuilder("INSERT INTO M_MatchInv (")
.append("M_MatchInv_ID, ")
.append("AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy, ")
.append("M_InOutLine_ID,C_InvoiceLine_ID, ")
.append("M_Product_ID,DateTrx,Qty, ")
.append("Processing,Processed,Posted) VALUES (")
.append(M_MatchInv_ID).append(", ")
.append(AD_Client_ID).append(",").append(AD_Org_ID).append(",'Y',SysDate,0,SysDate,0, ")
.append(M_InOutLine_ID).append(",").append(C_InvoiceLine_ID).append(", ")

View File

@ -236,12 +236,12 @@ public class ProductInfo
*/
private BigDecimal getPriceList (MAcctSchema as, boolean onlyPOPriceList)
{
StringBuffer sql = new StringBuffer (
"SELECT pl.C_Currency_ID, pp.PriceList, pp.PriceStd, pp.PriceLimit "
+ "FROM M_PriceList pl, M_PriceList_Version plv, M_ProductPrice pp "
+ "WHERE pl.M_PriceList_ID = plv.M_PriceList_ID"
+ " AND plv.M_PriceList_Version_ID = pp.M_PriceList_Version_ID"
+ " AND pp.M_Product_ID=?");
StringBuilder sql = new StringBuilder (
"SELECT pl.C_Currency_ID, pp.PriceList, pp.PriceStd, pp.PriceLimit ")
.append("FROM M_PriceList pl, M_PriceList_Version plv, M_ProductPrice pp ")
.append("WHERE pl.M_PriceList_ID = plv.M_PriceList_ID")
.append(" AND plv.M_PriceList_Version_ID = pp.M_PriceList_Version_ID")
.append(" AND pp.M_Product_ID=?");
if (onlyPOPriceList)
sql.append(" AND pl.IsSOPriceList='N'");
sql.append(" ORDER BY pl.IsSOPriceList ASC, plv.ValidFrom DESC");

View File

@ -350,7 +350,7 @@ public final class ImpFormat
for (int i = 0; i < m_rows.size(); i++)
{
ImpFormatRow row = (ImpFormatRow)m_rows.get(i);
StringBuffer entry = new StringBuffer ();
StringBuilder entry = new StringBuilder ();
// Label-Start
if (withLabel)
{
@ -439,7 +439,7 @@ public final class ImpFormat
int length = line.length();
for (int field = 1; field <= fieldNo && pos < length; field++)
{
StringBuffer content = new StringBuffer();
StringBuilder content = new StringBuilder();
// two delimiter directly after each other
if (line.charAt(pos) == delimiter)
{
@ -518,7 +518,7 @@ public final class ImpFormat
// Check if the record is already there ------------------------------
StringBuffer sql = new StringBuffer ("SELECT COUNT(*), MAX(")
StringBuilder sql = new StringBuilder ("SELECT COUNT(*), MAX(")
.append(m_tablePK).append(") FROM ").append(m_tableName)
.append(" WHERE AD_Client_ID=").append(AD_Client_ID).append(" AND (");
//
@ -541,7 +541,7 @@ public final class ImpFormat
whereParentChild += " AND " + nodes[i];
}
}
StringBuffer find = new StringBuffer();
StringBuilder find = new StringBuilder();
if (where1 != null)
find.append(where1);
if (where2 != null)
@ -587,7 +587,7 @@ public final class ImpFormat
if (ID == 0)
{
ID = DB.getNextID(ctx, m_tableName, null); // get ID
sql = new StringBuffer("INSERT INTO ")
sql = new StringBuilder("INSERT INTO ")
.append(m_tableName).append("(").append(m_tablePK).append(",")
.append("AD_Client_ID,AD_Org_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive") // StdFields
.append(") VALUES (").append(ID).append(",")
@ -607,7 +607,7 @@ public final class ImpFormat
log.finer("Old ID=" + ID + " " + find);
// Update Info -------------------------------------------------------
sql = new StringBuffer ("UPDATE ")
sql = new StringBuilder ("UPDATE ")
.append(m_tableName).append(" SET ");
for (int i = 0; i < nodes.length; i++)
sql.append(nodes[i]).append(","); // column=value

View File

@ -731,7 +731,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler
{
if (!m_controller.saveLine())
{
m_errorMessage = new StringBuffer(m_controller.getErrorMessage());
m_errorMessage = new StringBuffer().append(m_controller.getErrorMessage());
m_errorDescription = new StringBuffer(m_controller.getErrorDescription());
throw new SAXException(m_errorMessage.toString());
}

View File

@ -676,7 +676,7 @@ public class GridFieldVO implements Serializable
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MFieldVO[");
StringBuilder sb = new StringBuilder ("MFieldVO[");
sb.append(AD_Column_ID).append("-").append(ColumnName)
.append ("]");
return sb.toString ();

View File

@ -537,7 +537,7 @@ public class GridTable extends AbstractTableModel
} // getColumn
/**
* Return Columns with Indentifier (ColumnName)
* Return Columns with Identifier (ColumnName)
* @param identifier column name
* @return MField
*/

View File

@ -413,7 +413,8 @@ public class GridWindow implements Serializable
*/
public String toString()
{
return "MWindow[" + m_vo.WindowNo + "," + m_vo.Name + " (" + m_vo.AD_Window_ID + ")]";
StringBuilder msgreturn = new StringBuilder("MWindow[").append(m_vo.WindowNo).append(",").append(m_vo.Name).append(" (").append(m_vo.AD_Window_ID).append(")]");
return msgreturn.toString();
} // toString
/**
@ -423,15 +424,15 @@ public class GridWindow implements Serializable
*/
public WebDoc getHelpDoc (boolean javaClient)
{
String title = Msg.getMsg(Env.getCtx(), "Window") + ": " + getName();
StringBuilder title = new StringBuilder(Msg.getMsg(Env.getCtx(), "Window")).append(": ").append(getName());
WebDoc doc = null;
if (javaClient)
{
doc = WebDoc.create (false, title, javaClient);
doc = WebDoc.create (false, title.toString(), javaClient);
}
else // HTML
{
doc = WebDoc.createPopup (title);
doc = WebDoc.createPopup (title.toString());
doc.addPopupClose(Env.getCtx());
}

View File

@ -87,10 +87,10 @@ public interface I_AD_Client
/** Column name AD_PasswordRule_ID */
public static final String COLUMNNAME_AD_PasswordRule_ID = "AD_PasswordRule_ID";
/** Set AD_PasswordRule */
/** Set Password Policies */
public void setAD_PasswordRule_ID (int AD_PasswordRule_ID);
/** Get AD_PasswordRule */
/** Get Password Policies */
public int getAD_PasswordRule_ID();
public org.compiere.model.I_AD_PasswordRule getAD_PasswordRule() throws RuntimeException;
@ -217,6 +217,19 @@ public interface I_AD_Client
*/
public boolean isPostImmediate();
/** Column name IsSecureSMTP */
public static final String COLUMNNAME_IsSecureSMTP = "IsSecureSMTP";
/** Set SMTP SSL/TLS.
* Use SSL/TLS for SMTP
*/
public void setIsSecureSMTP (boolean IsSecureSMTP);
/** Get SMTP SSL/TLS.
* Use SSL/TLS for SMTP
*/
public boolean isSecureSMTP();
/** Column name IsServerEMail */
public static final String COLUMNNAME_IsServerEMail = "IsServerEMail";
@ -373,6 +386,19 @@ public interface I_AD_Client
*/
public String getSMTPHost();
/** Column name SMTPPort */
public static final String COLUMNNAME_SMTPPort = "SMTPPort";
/** Set SMTP Port.
* SMTP Port Number
*/
public void setSMTPPort (int SMTPPort);
/** Get SMTP Port.
* SMTP Port Number
*/
public int getSMTPPort();
/** Column name StoreArchiveOnFileSystem */
public static final String COLUMNNAME_StoreArchiveOnFileSystem = "StoreArchiveOnFileSystem";

View File

@ -83,10 +83,10 @@ public class MAccount extends X_C_ValidCombination
ArrayList<Object> params = new ArrayList<Object>();
// Mandatory fields
StringBuilder whereClause = new StringBuilder("AD_Client_ID=?" // #1
+ " AND AD_Org_ID=?"
+ " AND C_AcctSchema_ID=?"
+ " AND Account_ID=?"); // #4
StringBuilder whereClause = new StringBuilder("AD_Client_ID=?") // #1
.append(" AND AD_Org_ID=?")
.append(" AND C_AcctSchema_ID=?")
.append(" AND Account_ID=?"); // #4
params.add(AD_Client_ID);
params.add(AD_Org_ID);
params.add(C_AcctSchema_ID);

View File

@ -191,7 +191,7 @@ public final class MAccountLookup extends Lookup implements Serializable
for(MAccount account :accounts)
{
StringBuilder msglist = new StringBuilder(account.getCombination()).append(" - ")
StringBuilder msglist = new StringBuilder().append(account.getCombination()).append(" - ")
.append(account.getDescription());
list.add (new KeyNamePair(account.getC_ValidCombination_ID(), msglist.toString()));
}

View File

@ -94,7 +94,7 @@ public class MAcctProcessor extends X_C_AcctProcessor
{
this (client.getCtx(), 0, client.get_TrxName());
setClientOrg(client);
StringBuilder msgset = new StringBuilder(client.getName()).append(" - ")
StringBuilder msgset = new StringBuilder().append(client.getName()).append(" - ")
.append(Msg.translate(getCtx(), "C_AcctProcessor_ID"));
setName (msgset.toString());
setSupervisor_ID (Supervisor_ID);

View File

@ -195,7 +195,7 @@ public class MAcctSchema extends X_C_AcctSchema
this (client.getCtx(), 0, client.get_TrxName());
setClientOrg(client);
setC_Currency_ID (currency.getKey());
StringBuilder msgset = new StringBuilder(client.getName()).append(" ").append(getGAAP()).append("/").append(get_ColumnCount()).append(" ").append(currency.getName());
StringBuilder msgset = new StringBuilder().append(client.getName()).append(" ").append(getGAAP()).append("/").append(get_ColumnCount()).append(" ").append(currency.getName());
setName (msgset.toString());
} // MAcctSchema

View File

@ -649,7 +649,7 @@ public final class MAllocationHdr extends X_C_AllocationHdr implements DocAction
*/
public String getDocumentInfo()
{
StringBuilder msgreturn = new StringBuilder(Msg.getElement(getCtx(), "C_AllocationHdr_ID")).append(" ").append(getDocumentNo());
StringBuilder msgreturn = new StringBuilder().append(Msg.getElement(getCtx(), "C_AllocationHdr_ID")).append(" ").append(getDocumentNo());
return msgreturn.toString();
} // getDocumentInfo
@ -661,7 +661,7 @@ public final class MAllocationHdr extends X_C_AllocationHdr implements DocAction
{
try
{
StringBuilder msgctf = new StringBuilder(get_TableName()).append(get_ID()).append("_");
StringBuilder msgctf = new StringBuilder().append(get_TableName()).append(get_ID()).append("_");
File temp = File.createTempFile(msgctf.toString(), ".pdf");
return createPDF (temp);
}

View File

@ -411,15 +411,16 @@ public class MArchive extends X_AD_Archive {
BufferedOutputStream out = null;
try {
// create destination folder
final File destFolder = new File(m_archivePathRoot + File.separator
+ getArchivePathSnippet());
StringBuilder msgfile = new StringBuilder().append(m_archivePathRoot).append(File.separator)
.append(getArchivePathSnippet());
final File destFolder = new File(msgfile.toString());
if (!destFolder.exists()) {
if (!destFolder.mkdirs()) {
log.warning("unable to create folder: " + destFolder.getPath());
}
}
// write to pdf
StringBuilder msgfile = new StringBuilder(m_archivePathRoot).append(File.separator)
msgfile = new StringBuilder().append(m_archivePathRoot).append(File.separator)
.append(getArchivePathSnippet()).append(this.get_ID()).append(".pdf");
final File destFile = new File(msgfile.toString());

View File

@ -187,14 +187,14 @@ public class MAsset extends X_A_Asset
if (deliveryCount > 1)
documentNo.append("_").append(deliveryCount);
// Value
StringBuilder value = new StringBuilder(partner.getValue()).append("_").append(product.getValue());
StringBuilder value = new StringBuilder().append(partner.getValue()).append("_").append(product.getValue());
if (value.length() > 40-documentNo.length())
value.delete(40-documentNo.length(), value.length()).append(documentNo);
setValue(value.toString());
// Name MProduct.afterSave
StringBuilder name = new StringBuilder(partner.getName()).append(" - ").append(product.getName());
StringBuilder name = new StringBuilder().append(partner.getName()).append(" - ").append(product.getName());
if (name.length() > 60)
name.delete(60,name.length());
setName(name.toString());

View File

@ -579,14 +579,14 @@ public class MAttachment extends X_AD_Attachment
FileChannel out = null;
try {
//create destination folder
StringBuilder msgfile = new StringBuilder(m_attachmentPathRoot).append(File.separator).append(getAttachmentPathSnippet());
StringBuilder msgfile = new StringBuilder().append(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());
}
}
msgfile = new StringBuilder(m_attachmentPathRoot).append(File.separator)
msgfile = new StringBuilder().append(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();

View File

@ -125,7 +125,7 @@ public class MBPartnerLocation extends X_C_BPartner_Location {
/** Cached Location */
private MLocation m_location = null;
/** Unique Name */
private StringBuffer m_uniqueName = null;
private String m_uniqueName = null;
private int m_unique = 0;
/**
@ -181,21 +181,21 @@ public class MBPartnerLocation extends X_C_BPartner_Location {
* address
*/
private void makeUnique(MLocation address) {
m_uniqueName = new StringBuffer();
m_uniqueName = "";
// 0 - City
if (m_unique >= 0 || m_uniqueName.length() == 0) {
String xx = address.getCity();
if (xx != null && xx.length() > 0)
m_uniqueName = new StringBuffer(xx);
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.append(" ");
m_uniqueName.append(xx);
m_uniqueName += " ";
m_uniqueName += 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.append(" ");
m_uniqueName.append(xx);
m_uniqueName += " ";
m_uniqueName += 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.append(" ");
m_uniqueName.append(xx);
m_uniqueName += " ";
m_uniqueName += 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.append("#").append(id);
m_uniqueName += "#" + id;
}
} // makeUnique
public String getBPLocName(MLocation address) {
m_uniqueName = new StringBuffer(getName());
m_uniqueName = getName();
m_unique = MSysConfig.getIntValue("START_VALUE_BPLOCATION_NAME", 0,
getAD_Client_ID(), getAD_Org_ID());
if (m_unique < 0 || m_unique > 4)

View File

@ -117,7 +117,7 @@ public class MBankAccount extends X_C_BankAccount
*/
public String getName()
{
StringBuilder msgreturn = new StringBuilder(getBank().getName()).append(" ").append(getAccountNo());
StringBuilder msgreturn = new StringBuilder().append(getBank().getName()).append(" ").append(getAccountNo());
return msgreturn.toString();
} // getName

View File

@ -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 msgd = new StringBuilder(desc).append(" | ").append(description);
setDescription(msgd.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().append(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().append(get_TableName()).append(get_ID()).append("_");
File temp = File.createTempFile(msgfile.toString(), ".pdf");
return createPDF (temp);
}
catch (Exception e)
@ -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);
@ -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(": ")

View File

@ -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());
StringBuilder thisElementList = new StringBuilder(thisTemplate.getElements());
StringBuilder thisElementList = new StringBuilder().append(thisTemplate.getElements());
while (thisElementList.indexOf("\n")>=0) {
String thisElement = thisElementList.substring(0,thisElementList.indexOf("\n"));
thisElementList.delete(0,thisElementList.indexOf("\n")+1);

View File

@ -113,7 +113,7 @@ public class MCalendar extends X_C_Calendar
{
super(client.getCtx(), 0, client.get_TrxName());
setClientOrg(client);
StringBuilder msgset = new StringBuilder(client.getName()).append(" ").append(Msg.translate(client.getCtx(), "C_Calendar_ID"));
StringBuilder msgset = new StringBuilder().append(client.getName()).append(" ").append(Msg.translate(client.getCtx(), "C_Calendar_ID"));
setName(msgset.toString());
} // MCalendar

View File

@ -159,9 +159,10 @@ public class MCash extends X_C_Cash implements DocAction
Timestamp today = TimeUtil.getDay(System.currentTimeMillis());
setStatementDate (today); // @#Date@
setDateAcct (today); // @#Date@
String name = DisplayType.getDateFormat(DisplayType.Date).format(today)
+ " " + MOrg.get(ctx, getAD_Org_ID()).getValue();
setName (name);
StringBuilder name = new StringBuilder(DisplayType.getDateFormat(DisplayType.Date).format(today))
.append(" ").append(MOrg.get(ctx, getAD_Org_ID()).getValue());
setName (name.toString());
setIsApproved(false);
setPosted (false); // N
setProcessed (false);
@ -193,9 +194,9 @@ public class MCash extends X_C_Cash implements DocAction
{
setStatementDate (today);
setDateAcct (today);
String name = DisplayType.getDateFormat(DisplayType.Date).format(today)
+ " " + cb.getName();
setName (name);
StringBuilder name = new StringBuilder(DisplayType.getDateFormat(DisplayType.Date).format(today))
.append(" ").append(cb.getName());
setName (name.toString());
}
m_book = cb;
} // MCash
@ -254,7 +255,8 @@ public class MCash extends X_C_Cash implements DocAction
*/
public String getDocumentInfo()
{
return Msg.getElement(getCtx(), "C_Cash_ID") + " " + getDocumentNo();
StringBuilder msgreturn = new StringBuilder().append(Msg.getElement(getCtx(), "C_Cash_ID")).append(" ").append(getDocumentNo());
return msgreturn.toString();
} // getDocumentInfo
/**
@ -265,7 +267,8 @@ public class MCash extends X_C_Cash implements DocAction
{
try
{
File temp = File.createTempFile(get_TableName()+get_ID()+"_", ".pdf");
StringBuilder msgfile = new StringBuilder().append(get_TableName()).append(get_ID()).append("_");
File temp = File.createTempFile(msgfile.toString(), ".pdf");
return createPDF (temp);
}
catch (Exception e)
@ -470,11 +473,11 @@ public class MCash extends X_C_Cash implements DocAction
return DocAction.STATUS_Invalid;
}
//
String name = Msg.translate(getCtx(), "C_Cash_ID") + ": " + getName()
+ " - " + Msg.translate(getCtx(), "Line") + " " + line.getLine();
StringBuilder name = new StringBuilder().append(Msg.translate(getCtx(), "C_Cash_ID")).append(": ").append(getName())
.append(" - ").append(Msg.translate(getCtx(), "Line")).append(" ").append(line.getLine());
MAllocationHdr hdr = new MAllocationHdr(getCtx(), false,
getDateAcct(), line.getC_Currency_ID(),
name, get_TrxName());
name.toString(), get_TrxName());
hdr.setAD_Org_ID(getAD_Org_ID());
if (!hdr.save())
{
@ -621,9 +624,10 @@ public class MCash extends X_C_Cash implements DocAction
cashline.setAmount(Env.ZERO);
cashline.setDiscountAmt(Env.ZERO);
cashline.setWriteOffAmt(Env.ZERO);
cashline.addDescription(Msg.getMsg(getCtx(), "Voided")
+ " (Amount=" + oldAmount + ", Discount=" + oldDiscount
+ ", WriteOff=" + oldWriteOff + ", )");
StringBuilder msgadd = new StringBuilder().append(Msg.getMsg(getCtx(), "Voided"))
.append(" (Amount=").append(oldAmount).append(", Discount=").append(oldDiscount)
.append(", WriteOff=").append(oldWriteOff).append(", )");
cashline.addDescription(msgadd.toString());
if (MCashLine.CASHTYPE_BankAccountTransfer.equals(cashline.getCashType()))
{
if (cashline.getC_Payment_ID() == 0)
@ -659,8 +663,10 @@ public class MCash extends X_C_Cash 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
/**
@ -760,10 +766,10 @@ public class MCash extends X_C_Cash implements DocAction
public void setProcessed (boolean processed)
{
super.setProcessed (processed);
String sql = "UPDATE C_CashLine SET Processed='"
+ (processed ? "Y" : "N")
+ "' WHERE C_Cash_ID=" + getC_Cash_ID();
int noLine = DB.executeUpdate (sql, get_TrxName());
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());
m_lines = null;
log.fine(processed + " - Lines=" + noLine);
} // setProcessed
@ -774,7 +780,7 @@ public class MCash extends X_C_Cash implements DocAction
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MCash[");
StringBuilder sb = new StringBuilder ("MCash[");
sb.append (get_ID ())
.append ("-").append (getName())
.append(", Balance=").append(getBeginningBalance())
@ -789,7 +795,7 @@ public class MCash extends X_C_Cash implements DocAction
*/
public String getSummary()
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(getName());
// : Total Lines = 123.00 (#1)
sb.append(": ")

View File

@ -61,7 +61,7 @@ public class MChangeRequest extends X_M_ChangeRequest
{
this (request.getCtx(), 0, request.get_TrxName());
setClientOrg(request);
StringBuilder msgset = new StringBuilder(Msg.getElement(getCtx(), "R_Request_ID")).append(": ").append(request.getDocumentNo());
StringBuilder msgset = new StringBuilder().append(Msg.getElement(getCtx(), "R_Request_ID")).append(": ").append(request.getDocumentNo());
setName(msgset.toString());
setHelp(request.getSummary());
//

View File

@ -56,7 +56,7 @@ public class MClient extends X_AD_Client
/**
*
*/
private static final long serialVersionUID = -6482473737885701403L;
private static final long serialVersionUID = 5428247545086634858L;
/**
@ -311,7 +311,7 @@ public class MClient extends X_AD_Client
while (rs.next())
{
String value = rs.getString(1);
StringBuilder name = new StringBuilder(getName()).append(" ").append(rs.getString(2));
StringBuilder name = new StringBuilder().append(getName()).append(" ").append(rs.getString(2));
//
if (value.equals(X_AD_Tree.TREETYPE_Organization))
{
@ -979,4 +979,17 @@ public class MClient extends X_AD_Client
return (Collections.binarySearch(m_fieldAccess, aDFieldID) > 0);
}
@Override
protected boolean beforeSave(boolean newRecord)
{
//gmail specific support
if ("smtp.gmail.com".equals(getSMTPHost()))
{
if (getSMTPPort() == 0)
setSMTPPort(587);
}
return true;
}
} // MClient

View File

@ -218,7 +218,7 @@ public class MClientShare extends X_AD_ClientShare
.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 = new StringBuilder(getTableName()).append(" set to Shared #").append(no);
info = new StringBuilder().append(getTableName()).append(" set to Shared #").append(no);
log.info(info.toString());
}
else if (isOrgLevelOnly())
@ -227,7 +227,7 @@ public class MClientShare extends X_AD_ClientShare
.append(getTableName())
.append(" WHERE AD_Org_ID=0 AND AD_Client_ID=?");
int no = DB.getSQLValue(get_TrxName(), sql.toString(), getAD_Client_ID());
info = new StringBuilder(getTableName()).append(" Shared records #").append(no);
info = new StringBuilder().append(getTableName()).append(" Shared records #").append(no);
log.info(info.toString());
}
return info.toString();

View File

@ -345,7 +345,7 @@ public class MColumn extends X_AD_Column
if (isVirtualColumn())
return null;
StringBuilder sql = new StringBuilder (getColumnName())
StringBuilder sql = new StringBuilder ().append(getColumnName())
.append(" ").append(getSQLDataType());
// Default
@ -603,4 +603,24 @@ public class MColumn extends X_AD_Column
else
return false;
}
public String getReferenceTableName() {
String foreignTable = null;
if (DisplayType.TableDir == getAD_Reference_ID()
|| (DisplayType.Search == getAD_Reference_ID() && getAD_Reference_Value_ID() == 0)) {
foreignTable = getColumnName().substring(0, getColumnName().length()-3);
} else if (DisplayType.Table == getAD_Reference_ID() || DisplayType.Search == getAD_Reference_ID()) {
X_AD_Reference ref = new X_AD_Reference(getCtx(), getAD_Reference_Value_ID(), get_TrxName());
if (X_AD_Reference.VALIDATIONTYPE_TableValidation.equals(ref.getValidationType())) {
MRefTable rt = new MRefTable(getCtx(), getAD_Reference_Value_ID(), get_TrxName());
if (rt != null)
foreignTable = rt.getAD_Table().getTableName();
}
} else if (DisplayType.List == getAD_Reference_ID()) {
foreignTable = "AD_Ref_List";
}
return foreignTable;
}
} // MColumn

View File

@ -167,7 +167,7 @@ public class MGLCategory extends X_GL_Category
@Override
public String toString()
{
StringBuilder msgreturn = new StringBuilder(getClass().getSimpleName()).append("[").append(get_ID())
StringBuilder msgreturn = new StringBuilder().append(getClass().getSimpleName()).append("[").append(get_ID())
.append(", Name=").append(getName())
.append(", IsDefault=").append(isDefault())
.append(", IsActive=").append(isActive())

View File

@ -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 msgd = new StringBuilder(desc).append(" | ").append(description);
setDescription(msgd.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().append(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().append(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;
@ -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);
@ -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 msgadd = new StringBuilder("Void (").append(old).append(")");
line.addDescription(msgadd.toString());
line.saveEx(get_TrxName());
}
}
@ -2100,14 +2105,16 @@ public class MInOut extends X_M_InOut implements DocAction
if (asset != null)
{
asset.setIsActive(false);
asset.addDescription("(" + reversal.getDocumentNo() + " #" + rLine.getLine() + "<-)");
StringBuilder msgadd = new StringBuilder("(").append(reversal.getDocumentNo()).append(" #").append(rLine.getLine()).append("<-)");
asset.addDescription(msgadd.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 msgadd = new StringBuilder("{->").append(getDocumentNo()).append(")");
reversal.addDescription(msgadd.toString());
//FR1948157
reversal.setReversal_ID(getM_InOut_ID());
reversal.saveEx(get_TrxName());
@ -2124,7 +2131,8 @@ public class MInOut extends X_M_InOut implements DocAction
reversal.setDocAction(DOCACTION_None);
reversal.saveEx(get_TrxName());
//
addDescription("(" + reversal.getDocumentNo() + "<-)");
msgadd = new StringBuilder("(").append(reversal.getDocumentNo()).append("<-)");
addDescription(msgadd.toString());
//
// Void Confirmations
@ -2193,7 +2201,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(":")

View File

@ -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().append(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().append(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().append(user.getName())
.append(": ")
.append(Msg.translate(getCtx(), "IsApproved"))
.append(" - ").append(new Timestamp(System.currentTimeMillis()));
addDescription(info.toString());
}
super.setIsApproved (IsApproved);
} // setIsApproved
@ -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
@ -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().append(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().append(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());
}
@ -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(": ")

View File

@ -162,8 +162,10 @@ public class MInventory extends X_M_Inventory implements DocAction
String desc = getDescription();
if (desc == null)
setDescription(description);
else
setDescription(desc + " | " + description);
else{
StringBuilder msgreturn = new StringBuilder(desc).append(" | ").append(description);
setDescription(msgreturn.toString());
}
} // addDescription
/**
@ -182,7 +184,7 @@ public class MInventory extends X_M_Inventory implements DocAction
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MInventory[");
StringBuilder sb = new StringBuilder ("MInventory[");
sb.append (get_ID())
.append ("-").append (getDocumentNo())
.append (",M_Warehouse_ID=").append(getM_Warehouse_ID())
@ -197,7 +199,8 @@ public class MInventory extends X_M_Inventory implements DocAction
public String getDocumentInfo()
{
MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());
return dt.getName() + " " + getDocumentNo();
StringBuilder msgreturn = new StringBuilder().append(dt.getName()).append(" ").append(getDocumentNo());
return msgreturn.toString();
} // getDocumentInfo
/**
@ -208,7 +211,8 @@ public class MInventory extends X_M_Inventory implements DocAction
{
try
{
File temp = File.createTempFile(get_TableName()+get_ID()+"_", ".pdf");
StringBuilder msgfile = new StringBuilder().append(get_TableName()).append(get_ID()).append("_");
File temp = File.createTempFile(msgfile.toString(), ".pdf");
return createPDF (temp);
}
catch (Exception e)
@ -688,7 +692,8 @@ public class MInventory extends X_M_Inventory implements DocAction
{
line.setQtyInternalUse(Env.ZERO);
line.setQtyCount(line.getQtyBook());
line.addDescription("Void (" + oldCount + "/" + oldInternal + ")");
StringBuilder msgd = new StringBuilder("Void (").append(oldCount).append("/").append(oldInternal).append(")");
line.addDescription(msgd.toString());
line.saveEx(get_TrxName());
}
}
@ -750,7 +755,8 @@ public class MInventory extends X_M_Inventory implements DocAction
reversal.setIsApproved (false);
reversal.setPosted(false);
reversal.setProcessed(false);
reversal.addDescription("{->" + getDocumentNo() + ")");
StringBuilder msgd = new StringBuilder("{->").append(getDocumentNo()).append(")");
reversal.addDescription(msgd.toString());
//FR1948157
reversal.setReversal_ID(getM_Inventory_ID());
reversal.saveEx();
@ -802,7 +808,8 @@ public class MInventory extends X_M_Inventory implements DocAction
m_processMsg = 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);
if (m_processMsg != null)
@ -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(": ")

View File

@ -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,11 +853,14 @@ 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();
int noLine = DB.executeUpdate("UPDATE C_InvoiceLine " + set, get_TrxName());
int noTax = DB.executeUpdate("UPDATE C_InvoiceTax " + set, get_TrxName());
StringBuilder set = new StringBuilder("SET Processed='")
.append((processed ? "Y" : "N"))
.append("' WHERE C_Invoice_ID=").append(getC_Invoice_ID());
StringBuilder msgdb = new StringBuilder("UPDATE C_InvoiceLine ").append(set);
int noLine = DB.executeUpdate(msgdb.toString(), get_TrxName());
msgdb = new StringBuilder("UPDATE C_InvoiceTax ").append(set);
int noTax = DB.executeUpdate(msgdb.toString(), get_TrxName());
m_lines = null;
m_taxes = null;
log.fine(processed + " - Lines=" + noLine + ", Tax=" + noTax);
@ -1021,7 +1026,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 +1042,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().append(dt.getName()).append(" ").append(getDocumentNo());
return msgreturn.toString();
} // getDocumentInfo
@ -1054,12 +1060,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;
@ -1161,7 +1167,7 @@ public class MInvoice extends X_C_Invoice implements DocAction
public static void setIsPaid (Properties ctx, int C_BPartner_ID, String trxName)
{
List<Object> params = new ArrayList<Object>();
StringBuffer whereClause = new StringBuffer("IsPaid='N' AND DocStatus IN ('CO','CL')");
StringBuilder whereClause = new StringBuilder("IsPaid='N' AND DocStatus IN ('CO','CL')");
if (C_BPartner_ID > 1)
{
whereClause.append(" AND C_BPartner_ID=?");
@ -1255,7 +1261,8 @@ public class MInvoice extends X_C_Invoice implements DocAction
{
try
{
File temp = File.createTempFile(get_TableName()+get_ID()+"_", ".pdf");
StringBuilder msgfile = new StringBuilder().append(get_TableName()).append(get_ID()).append("_");
File temp = File.createTempFile(msgfile.toString(), ".pdf");
return createPDF (temp);
}
catch (Exception e)
@ -1541,12 +1548,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().append(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 +1571,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
@ -1706,7 +1714,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;
@ -1911,7 +1919,8 @@ 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 msgset = new StringBuilder().append(Msg.translate(getCtx(), "C_Invoice_ID")).append(": ").append(getDocumentNo());
user.setLastResult(msgset.toString());
if (!user.save(get_TrxName()))
{
m_processMsg = "Could not update Business Partner User";
@ -2124,7 +2133,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 msgadd = new StringBuilder(Msg.getMsg(getCtx(), "Voided")).append(" (").append(old).append(")");
line.addDescription(msgadd.toString());
// Unlink Shipment
if (line.getM_InOutLine_ID() != 0)
{
@ -2252,7 +2262,8 @@ public class MInvoice extends X_C_Invoice implements DocAction
}
}
reversal.setC_Order_ID(getC_Order_ID());
reversal.addDescription("{->" + getDocumentNo() + ")");
StringBuilder msgadd = new StringBuilder("{->").append(getDocumentNo()).append(")");
reversal.addDescription(msgadd.toString());
//FR1948157
reversal.setReversal_ID(getC_Invoice_ID());
reversal.saveEx(get_TrxName());
@ -2271,7 +2282,8 @@ public class MInvoice extends X_C_Invoice implements DocAction
reversal.saveEx(get_TrxName());
m_processMsg = reversal.getDocumentNo();
//
addDescription("(" + reversal.getDocumentNo() + "<-)");
msgadd = new StringBuilder("(").append(reversal.getDocumentNo()).append("<-)");
addDescription(msgadd.toString());
// Clean up Reversed (this)
MInvoiceLine[] iLines = getLines(false);
@ -2297,9 +2309,10 @@ public class MInvoice extends X_C_Invoice implements DocAction
setIsPaid(true);
// Create Allocation
StringBuilder msgall = new StringBuilder().append(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(),
msgall.toString(),
get_TrxName());
alloc.setAD_Org_ID(getAD_Org_ID());
if (alloc.save())
@ -2381,7 +2394,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(": ").

View File

@ -155,7 +155,7 @@ public class MIssue extends X_AD_Issue
public MIssue (LogRecord record)
{
this (Env.getCtx(), 0, null);
StringBuilder summary = new StringBuilder(record.getMessage());
String summary = record.getMessage();
setSourceClassName(record.getSourceClassName());
setSourceMethodName(record.getSourceMethodName());
setLoggerName(record.getLoggerName());
@ -163,9 +163,9 @@ public class MIssue extends X_AD_Issue
if (t != null)
{
if (summary != null && summary.length() > 0)
summary = new StringBuilder(t.toString()).append(" ").append(summary);
summary = t.toString() + " " + summary;
if (summary == null || summary.length() == 0)
summary = new StringBuilder(t.toString());
summary = t.toString();
//
StringBuilder error = new StringBuilder();
StackTraceElement[] tes = t.getStackTrace();
@ -179,7 +179,7 @@ public class MIssue extends X_AD_Issue
error.append(s).append("\n");
if (count == 0)
{
StringBuilder source = new StringBuilder(element.getClassName())
StringBuilder source = new StringBuilder().append(element.getClassName())
.append(".").append(element.getMethodName());
setSourceClassName(source.toString());
setLineNo(element.getLineNumber());
@ -197,7 +197,7 @@ public class MIssue extends X_AD_Issue
setStackTrace(cWriter.toString());
}
if (summary == null || summary.length() == 0)
summary = new StringBuilder("??");
summary = "??";
setIssueSummary(summary.toString());
setRecord_ID(1);
} // MIssue

View File

@ -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;
@ -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');
@ -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;
@ -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().append(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().append(get_TableName()).append(get_ID()).append("_");
File temp = File.createTempFile(msgfile.toString(), ".pdf");
return createPDF (temp);
}
catch (Exception e)

View File

@ -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();
@ -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
@ -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().append(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().append(get_TableName()).append(get_ID()).append("_");
File temp = File.createTempFile(msgfile.toString(), ".pdf");
return createPDF (temp);
}
catch (Exception e)

View File

@ -414,13 +414,13 @@ public class MLanguage extends X_AD_Language
log.log(Level.SEVERE, "No Columns found for " + baseTable);
return 0;
}
StringBuffer cols = new StringBuffer();
StringBuilder cols = new StringBuilder();
for (int i = 0; i < columns.size(); i++)
cols.append(",").append(columns.get(i));
// Insert Statement
int AD_User_ID = Env.getAD_User_ID(getCtx());
String keyColumn = baseTable + "_ID";
StringBuilder keyColumn = new StringBuilder(baseTable).append("_ID");
StringBuilder insert = new StringBuilder("INSERT INTO ").append(tableName)
.append("(AD_Language,IsTranslated, AD_Client_ID,AD_Org_ID, ")
.append("Createdby,UpdatedBy, ")
@ -441,7 +441,7 @@ public class MLanguage extends X_AD_Language
if (column != null)
UUIDGenerator.updateUUID(column, get_TrxName());
//
StringBuilder msglog = new StringBuilder(tableName).append(" #").append(no);
StringBuilder msglog = new StringBuilder().append(tableName).append(" #").append(no);
log.fine(msglog.toString());
return no;
} // addTable

View File

@ -668,7 +668,7 @@ public final class MLookup extends Lookup implements Serializable
long startTime = System.currentTimeMillis();
if (Ini.isClient())
MLookupCache.loadStart (m_info);
StringBuilder sql = new StringBuilder(m_info.Query);
StringBuilder sql = new StringBuilder().append(m_info.Query);
// not validated
if (!m_info.IsValidated)
@ -737,7 +737,7 @@ public final class MLookup extends Lookup implements Serializable
{
if (rows++ > MAX_ROWS)
{
StringBuilder s = new StringBuilder(m_info.KeyColumn).append(": Loader - Too many records");
StringBuilder s = new StringBuilder().append(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);
@ -754,7 +754,7 @@ public final class MLookup extends Lookup implements Serializable
break;
// load data
StringBuilder name = new StringBuilder(rs.getString(3));
StringBuilder name = new StringBuilder().append(rs.getString(3));
boolean isActive = rs.getString(4).equals("Y");
if (!isActive)
{

View File

@ -513,7 +513,7 @@ public class MLookupFactory
ZoomWindow = overrideZoomWindow;
ZoomWindowPO = 0;
}
StringBuilder msginf = new StringBuilder(TableName).append(".").append(KeyColumn);
StringBuilder msginf = new StringBuilder().append(TableName).append(".").append(KeyColumn);
retValue = new MLookupInfo (realSQL.toString(), TableName,
msginf.toString(), ZoomWindow, ZoomWindowPO, zoomQuery);
s_cacheRefTable.put(key.toString(), retValue.cloneIt());
@ -721,7 +721,7 @@ public class MLookupFactory
if (i > 0)
displayColumn.append(" ||'_'|| " );
LookupDisplayColumn ldc = (LookupDisplayColumn)list.get(i);
StringBuilder msg = new StringBuilder(TableName).append(".").append(ldc.ColumnName);
StringBuilder msg = new StringBuilder().append(TableName).append(".").append(ldc.ColumnName);
String columnSQL = ldc.IsVirtual ? ldc.ColumnSQL : msg.toString();
displayColumn.append("NVL(");
@ -797,7 +797,7 @@ public class MLookupFactory
if (CLogMgt.isLevelFinest())
s_log.fine("ColumnName=" + ColumnName + " - " + realSQL);
StringBuilder msginf = new StringBuilder(TableName).append(".").append(KeyColumn);
StringBuilder msginf = new StringBuilder().append(TableName).append(".").append(KeyColumn);
MLookupInfo lInfo = new MLookupInfo(realSQL.toString(), TableName,
msginf.toString(), ZoomWindow, ZoomWindowPO, zoomQuery);
s_cacheRefTable.put(cacheKey.toString(), lInfo.cloneIt());
@ -892,7 +892,7 @@ public class MLookupFactory
if (i > 0)
embedSQL.append("||' - '||" );
LookupDisplayColumn ldc = (LookupDisplayColumn)list.get(i);
StringBuilder msg = new StringBuilder(TableName).append(".").append(ldc.ColumnName);
StringBuilder msg = new StringBuilder().append(TableName).append(".").append(ldc.ColumnName);
String columnSQL = ldc.IsVirtual ? ldc.ColumnSQL : msg.toString();
// translated

View File

@ -307,7 +307,7 @@ public class MMailText extends X_R_MailText
{
if (m_bpartner != null && m_bpartner.getAD_Language() != null)
{
StringBuilder key = new StringBuilder(m_bpartner.getAD_Language()).append(get_ID());
StringBuilder key = new StringBuilder().append(m_bpartner.getAD_Language()).append(get_ID());
MMailTextTrl trl = s_cacheTrl.get(key);
if (trl == null)
{

View File

@ -30,7 +30,7 @@ public class X_AD_Client extends PO implements I_AD_Client, I_Persistent
/**
*
*/
private static final long serialVersionUID = 20120802L;
private static final long serialVersionUID = 20121008L;
/** Standard Constructor */
public X_AD_Client (Properties ctx, int AD_Client_ID, String trxName)
@ -42,6 +42,8 @@ public class X_AD_Client extends PO implements I_AD_Client, I_Persistent
// N
setIsMultiLingualDocument (false);
setIsPostImmediate (false);
// N
setIsSecureSMTP (false);
// N
setIsServerEMail (false);
setIsSmtpAuthorization (false);
@ -126,8 +128,8 @@ public class X_AD_Client extends PO implements I_AD_Client, I_Persistent
return (org.compiere.model.I_AD_PasswordRule)MTable.get(getCtx(), org.compiere.model.I_AD_PasswordRule.Table_Name)
.getPO(getAD_PasswordRule_ID(), get_TrxName()); }
/** Set AD_PasswordRule.
@param AD_PasswordRule_ID AD_PasswordRule */
/** Set Password Policies.
@param AD_PasswordRule_ID Password Policies */
public void setAD_PasswordRule_ID (int AD_PasswordRule_ID)
{
if (AD_PasswordRule_ID < 1)
@ -136,8 +138,8 @@ public class X_AD_Client extends PO implements I_AD_Client, I_Persistent
set_Value (COLUMNNAME_AD_PasswordRule_ID, Integer.valueOf(AD_PasswordRule_ID));
}
/** Get AD_PasswordRule.
@return AD_PasswordRule */
/** Get Password Policies.
@return Password Policies */
public int getAD_PasswordRule_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_PasswordRule_ID);
@ -301,6 +303,30 @@ public class X_AD_Client extends PO implements I_AD_Client, I_Persistent
return false;
}
/** Set SMTP SSL/TLS.
@param IsSecureSMTP
Use SSL/TLS for SMTP
*/
public void setIsSecureSMTP (boolean IsSecureSMTP)
{
set_Value (COLUMNNAME_IsSecureSMTP, Boolean.valueOf(IsSecureSMTP));
}
/** Get SMTP SSL/TLS.
@return Use SSL/TLS for SMTP
*/
public boolean isSecureSMTP ()
{
Object oo = get_Value(COLUMNNAME_IsSecureSMTP);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Server EMail.
@param IsServerEMail
Send EMail from Server
@ -545,6 +571,26 @@ public class X_AD_Client extends PO implements I_AD_Client, I_Persistent
return (String)get_Value(COLUMNNAME_SMTPHost);
}
/** Set SMTP Port.
@param SMTPPort
SMTP Port Number
*/
public void setSMTPPort (int SMTPPort)
{
set_Value (COLUMNNAME_SMTPPort, Integer.valueOf(SMTPPort));
}
/** Get SMTP Port.
@return SMTP Port Number
*/
public int getSMTPPort ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_SMTPPort);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Store Archive On File System.
@param StoreArchiveOnFileSystem Store Archive On File System */
public void setStoreArchiveOnFileSystem (boolean StoreArchiveOnFileSystem)

View File

@ -1867,6 +1867,11 @@ public final class DB
if(SYSTEM_NATIVE_SEQUENCE && !adempiereSys)
{
int m_sequence_id = CConnection.get().getDatabase().getNextID(TableName+"_SQ");
if (m_sequence_id == -1) {
// try to create the sequence and try again
MSequence.createTableSequence(Env.getCtx(), TableName, trxName, true);
m_sequence_id = CConnection.get().getDatabase().getNextID(TableName+"_SQ");
}
return m_sequence_id;
}

View File

@ -130,6 +130,10 @@ public final class DisplayType
/** Default Amount Precision */
private static final int AMOUNT_FRACTION = 2;
public static final String DEFAULT_TIME_FORMAT = "HH:mm:ss";
public static final String DEFAULT_TIMESTAMP_FORMAT = "yyyy-MM-dd HH:mm:ss";
public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd";
/** Logger */
private static CLogger s_log = CLogger.getCLogger (DisplayType.class);
@ -398,7 +402,7 @@ public final class DisplayType
*/
static public SimpleDateFormat getDateFormat_JDBC()
{
return new SimpleDateFormat ("yyyy-MM-dd");
return new SimpleDateFormat (DEFAULT_DATE_FORMAT);
} // getDateFormat_JDBC
/**
@ -407,9 +411,14 @@ public final class DisplayType
*/
static public SimpleDateFormat getTimestampFormat_Default()
{
return new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss");
return new SimpleDateFormat (DEFAULT_TIMESTAMP_FORMAT);
} // getTimestampFormat_JDBC
static public SimpleDateFormat getTimeFormat_Default()
{
return new SimpleDateFormat (DEFAULT_TIME_FORMAT);
} // getTimeFormat_Default
/**
* Return Storage Class.
* (used for MiniTable)

View File

@ -85,7 +85,7 @@ public final class EMail implements Serializable
public EMail (MClient client, String from, String to,
String subject, String message)
{
this (client.getCtx(), client.getSMTPHost(), from, to, subject, message);
this (client.getCtx(), client.getSMTPHost(), client.getSMTPPort(), client.isSecureSMTP(), from, to, subject, message, false);
} // EMail
/**
@ -100,7 +100,7 @@ public final class EMail implements Serializable
public EMail (MClient client, String from, String to,
String subject, String message, boolean html)
{
this (client.getCtx(), client.getSMTPHost(), from, to, subject, message, html);
this (client.getCtx(), client.getSMTPHost(), client.getSMTPPort(), client.isSecureSMTP(), from, to, subject, message, html);
} // EMail
/**
@ -115,7 +115,7 @@ public final class EMail implements Serializable
public EMail (Properties ctx, String smtpHost, String from, String to,
String subject, String message)
{
this(ctx, smtpHost, from, to, subject, message, false);
this(ctx, smtpHost, 0, false, from, to, subject, message, false);
}
/**
@ -131,6 +131,26 @@ public final class EMail implements Serializable
public EMail (Properties ctx, String smtpHost, String from, String to,
String subject, String message, boolean html)
{
this(ctx, smtpHost, 0, false, from, to, subject, message, html);
}
/**
* Full Constructor
* @param ctx context
* @param smtpHost The mail server
* @param smtpPort
* @param isSecureSmtp
* @param from Sender's EMail address
* @param to Recipient EMail address
* @param subject Subject of message
* @param message The message
* @param html html email
*/
public EMail (Properties ctx, String smtpHost, int smtpPort, boolean isSecureSmtp, String from, String to,
String subject, String message, boolean html)
{
setSmtpHost(smtpHost);
setFrom(from);
String bccAddressForAllMails = MSysConfig.getValue(MSysConfig.MAIL_SEND_BCC_TO_ADDRESS, Env.getAD_Client_ID(Env.getCtx()));
@ -150,7 +170,17 @@ public final class EMail implements Serializable
setMessageText (message);
}
m_valid = isValid (true);
setSmtpPort(smtpPort);
setSecureSmtp(isSecureSmtp);
} // EMail
private void setSecureSmtp(boolean isSecureSmtp) {
m_secureSmtp = isSecureSmtp;
}
private void setSmtpPort(int smtpPort) {
m_smtpPort = smtpPort;
}
/** From Address */
private InternetAddress m_from;
@ -170,14 +200,14 @@ public final class EMail implements Serializable
private String m_messageHTML;
/** Mail SMTP Server */
private String m_smtpHost;
/** Mail SMTP Server Port */
// @TODO - make port configurable - private int m_smtpPort = 0;
/** SMTP enable start TLS */
// @TODO - make tls configurable - private boolean m_smtpStarttlsEnable = false;
private int m_smtpPort;
private boolean m_secureSmtp;
/** Attachments */
private ArrayList<DataSource> m_attachments;
/** UserName and Password */
private EMailAuthenticator m_auth = null;
private transient EMailAuthenticator m_auth = null;
/** Message */
private SMTPMessage m_msg = null;
/** Context - may be null */
@ -192,7 +222,7 @@ public final class EMail implements Serializable
public static final String SENT_OK = "OK";
/** Logger */
protected static CLogger log = CLogger.getCLogger (EMail.class);
protected transient static CLogger log = CLogger.getCLogger (EMail.class);
/**
* Send Mail direct
@ -201,6 +231,8 @@ public final class EMail implements Serializable
public String send ()
{
log.info("(" + m_smtpHost + ") " + m_from + " -> " + m_to);
log.info("(m_auth) " + m_auth);
m_sentMsg = null;
//
if (!isValid(true))
@ -224,10 +256,12 @@ public final class EMail implements Serializable
{
if (m_auth != null) // createAuthenticator was called
props.put("mail.smtp.auth", "true");
if (m_smtpHost.equalsIgnoreCase("smtp.gmail.com")) {
// TODO: make it configurable
// Enable gmail port and ttls - Hardcoded
props.put("mail.smtp.port", "587");
if (m_smtpPort > 0)
{
props.put("mail.smtp.port", String.valueOf(m_smtpPort));
}
if (m_secureSmtp)
{
props.put("mail.smtp.starttls.enable", "true");
}
@ -247,6 +281,7 @@ public final class EMail implements Serializable
return e.toString();
}
Transport t = null;
try
{
// m_msg = new MimeMessage(session);
@ -283,7 +318,7 @@ public final class EMail implements Serializable
// log.fine("message =" + m_msg);
//
// Transport.send(msg);
Transport t = session.getTransport("smtp");
t = session.getTransport("smtp");
// log.fine("transport=" + t);
t.connect();
// t.connect(m_smtpHost, user, password);
@ -380,6 +415,17 @@ public final class EMail implements Serializable
m_sentMsg = e.getLocalizedMessage();
return e.getLocalizedMessage();
}
finally
{
if(t != null)
{
try {
t.close();
} catch (Exception e) {
}
t = null;
}
}
//
if (CLogMgt.isLevelFinest())
dumpMessage();

View File

@ -83,6 +83,16 @@ public final class ValueNamePair extends NamePair
return false;
} // equals
/**
* Get the Object representation of the value
* @return value
*/
public Object getValueObject()
{
return m_value;
}
/**
* Return Hashcode of value
* @return hascode

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="SuperCSV-with_src-1.52.jar"/>
<classpathentry exported="true" kind="lib" path="spiffy-with_source-all-0.05.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="/org.adempiere.base/super-csv-2.0.0-beta-1.jar" sourcepath="/home/carlos/libsources/super-csv-2.0.0-beta-1-sources.jar"/>
<classpathentry kind="output" path="build"/>
</classpath>

View File

@ -4,12 +4,13 @@ Bundle-Name: org.adempiere.extend
Bundle-SymbolicName: org.adempiere.extend;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-ClassPath: extend.jar,
spiffy-with_source-all-0.05.jar,
SuperCSV-with_src-1.52.jar
spiffy-with_source-all-0.05.jar
Eclipse-RegisterBuddy: org.adempiere.tools
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: compiere.model,
test
Fragment-Host: org.adempiere.base;bundle-version="0.0.0"
Eclipse-PatchFragment: true
Import-Package: junit.framework;version="3.8.2"
Import-Package: junit.framework;version="3.8.2",
org.supercsv.io,
org.supercsv.prefs

Some files were not shown because too many files have changed in this diff Show More