From 58fdf77dd89a02d2595d55b61be3fe9372afeff1 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 29 Dec 2014 18:48:06 -0500 Subject: [PATCH 01/19] IDEMPIERE-2378 Text editor can be sizeable and maximizable --- .../src/org/adempiere/webui/window/WTextEditorDialog.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WTextEditorDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WTextEditorDialog.java index 66a63f4615..5aeb684c68 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WTextEditorDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WTextEditorDialog.java @@ -24,7 +24,6 @@ import org.adempiere.webui.component.Tabpanels; import org.adempiere.webui.component.Tabs; import org.adempiere.webui.component.Textbox; import org.adempiere.webui.component.Window; -import org.compiere.util.Env; import org.compiere.util.Language; import org.zkforge.ckez.CKeditor; import org.zkoss.zk.au.out.AuScript; @@ -160,6 +159,8 @@ public class WTextEditorDialog extends Window implements EventListener{ tabbox.addEventListener(Events.ON_SELECT, this); //Bug IDEMPIERE-1992 Ensure that text editor dialog has a close button setClosable(true); + setSizable(true); + setMaximizable(true); } private void createEditor(org.zkoss.zul.Tabpanel tabPanel) { From 8eb5a0150155a8c85c2daa148600e93b74e020e7 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 29 Dec 2014 19:51:55 -0500 Subject: [PATCH 02/19] IDEMPIERE-2379 Problem encrypting AD_Client.RequestUserPw --- .../src/org/compiere/model/GridTable.java | 18 ++++++++++++++++-- .../src/org/compiere/model/POInfo.java | 1 + 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/GridTable.java b/org.adempiere.base/src/org/compiere/model/GridTable.java index 1bed622ae9..e9062f7813 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTable.java +++ b/org.adempiere.base/src/org/compiere/model/GridTable.java @@ -3232,7 +3232,7 @@ public class GridTable extends AbstractTableModel { String str = rs.getString(j+1); if (field.isEncryptedColumn()) - str = (String)decrypt(str, getAD_Client_ID()); + str = (String)decrypt(str, getAD_Client_ID(rs)); rowData[j] = new Boolean ("Y".equals(str)); // Boolean } // LOB @@ -3263,7 +3263,7 @@ public class GridTable extends AbstractTableModel rowData[j] = rs.getString(j+1); // String // Encrypted if (field.isEncryptedColumn() && displayType != DisplayType.YesNo) - rowData[j] = decrypt(rowData[j], getAD_Client_ID()); + rowData[j] = decrypt(rowData[j], getAD_Client_ID(rs)); } } catch (SQLException e) @@ -3297,6 +3297,20 @@ public class GridTable extends AbstractTableModel return SecureEngine.decrypt(yy, AD_Client_ID); } // decrypt + private int getAD_Client_ID(ResultSet rs) { + int AD_Client_ID = -1; + try { + AD_Client_ID = rs.getInt("AD_Client_ID"); + if (rs.wasNull()) + AD_Client_ID = -1; + } catch (SQLException e) { + AD_Client_ID = -1; + } + if (AD_Client_ID == -1) + AD_Client_ID = getAD_Client_ID(); + return AD_Client_ID; + } + private int getAD_Client_ID() { int AD_Client_ID = Env.getAD_Client_ID(Env.getCtx()); diff --git a/org.adempiere.base/src/org/compiere/model/POInfo.java b/org.adempiere.base/src/org/compiere/model/POInfo.java index 9e04422c9a..c97230cc44 100644 --- a/org.adempiere.base/src/org/compiere/model/POInfo.java +++ b/org.adempiere.base/src/org/compiere/model/POInfo.java @@ -165,6 +165,7 @@ public class POInfo implements Serializable + " AND c.IsActive='Y'"); if (!baseLanguage) sql.append(" AND e.AD_Language='").append(Env.getAD_Language(m_ctx)).append("'"); + sql.append(" ORDER BY c.AD_Column_ID"); // PreparedStatement pstmt = null; ResultSet rs = null; From fef106746ad880bc02c7418e849a1dde7db43766 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 5 Jan 2015 18:33:53 -0500 Subject: [PATCH 03/19] IDEMPIERE-448 Add CopyFrom on Bank Statement / fix problem copying lines without charges - throwing error about Charge is mandatory --- .../i2.1/oracle/201501051826_IDEMPIERE-448.sql | 15 +++++++++++++++ .../postgresql/201501051826_IDEMPIERE-448.sql | 12 ++++++++++++ .../org/compiere/model/MBankStatementLine.java | 14 +++++++------- 3 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 migration/i2.1/oracle/201501051826_IDEMPIERE-448.sql create mode 100644 migration/i2.1/postgresql/201501051826_IDEMPIERE-448.sql diff --git a/migration/i2.1/oracle/201501051826_IDEMPIERE-448.sql b/migration/i2.1/oracle/201501051826_IDEMPIERE-448.sql new file mode 100644 index 0000000000..a1b24e0d6e --- /dev/null +++ b/migration/i2.1/oracle/201501051826_IDEMPIERE-448.sql @@ -0,0 +1,15 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Jan 5, 2015 6:14:51 PM COT +-- IDEMPIERE-448 Add CopyFrom on Bank Statement +UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2015-01-05 18:14:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=4939 +; + +-- Jan 5, 2015 6:14:59 PM COT +UPDATE AD_Field SET IsMandatory='Y',Updated=TO_DATE('2015-01-05 18:14:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4009 +; + +SELECT register_migration_script('201501051826_IDEMPIERE-448.sql') FROM dual +; + diff --git a/migration/i2.1/postgresql/201501051826_IDEMPIERE-448.sql b/migration/i2.1/postgresql/201501051826_IDEMPIERE-448.sql new file mode 100644 index 0000000000..9ff19bfb61 --- /dev/null +++ b/migration/i2.1/postgresql/201501051826_IDEMPIERE-448.sql @@ -0,0 +1,12 @@ +-- Jan 5, 2015 6:14:51 PM COT +-- IDEMPIERE-448 Add CopyFrom on Bank Statement +UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2015-01-05 18:14:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=4939 +; + +-- Jan 5, 2015 6:14:59 PM COT +UPDATE AD_Field SET IsMandatory='Y',Updated=TO_TIMESTAMP('2015-01-05 18:14:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4009 +; + +SELECT register_migration_script('201501051826_IDEMPIERE-448.sql') FROM dual +; + diff --git a/org.adempiere.base/src/org/compiere/model/MBankStatementLine.java b/org.adempiere.base/src/org/compiere/model/MBankStatementLine.java index 445f53a848..91447408f6 100644 --- a/org.adempiere.base/src/org/compiere/model/MBankStatementLine.java +++ b/org.adempiere.base/src/org/compiere/model/MBankStatementLine.java @@ -166,6 +166,13 @@ import org.compiere.util.Msg; log.saveError("ParentComplete", Msg.translate(getCtx(), "C_BankStatementLine")); return false; } + // Calculate Charge = Statement - trx - Interest + BigDecimal amt = getStmtAmt(); + amt = amt.subtract(getTrxAmt()); + amt = amt.subtract(getInterestAmt()); + if (amt.compareTo(getChargeAmt()) != 0) + setChargeAmt (amt); + // if (getChargeAmt().signum() != 0 && getC_Charge_ID() == 0) { log.saveError("FillMandatory", Msg.getElement(getCtx(), "C_Charge_ID")); @@ -199,13 +206,6 @@ import org.compiere.util.Msg; setC_BPartner_ID(invoice.getC_BPartner_ID()); } - // Calculate Charge = Statement - trx - Interest - BigDecimal amt = getStmtAmt(); - amt = amt.subtract(getTrxAmt()); - amt = amt.subtract(getInterestAmt()); - if (amt.compareTo(getChargeAmt()) != 0) - setChargeAmt (amt); - // return true; } // beforeSave From d3397ab12702c6d41dccc7ed749331e5b135d89f Mon Sep 17 00:00:00 2001 From: Nicolas Micoud Date: Wed, 7 Jan 2015 09:16:13 -0500 Subject: [PATCH 04/19] IDEMPIERE-1148 Account : Add checkboxes to identify account kind (bpartner, product) --- .../oracle/201501070858_IDEMPIERE-1148.sql | 361 ++++++++++++++++++ .../201501070858_IDEMPIERE-1148.sql | 359 +++++++++++++++++ 2 files changed, 720 insertions(+) create mode 100644 migration/i2.1/oracle/201501070858_IDEMPIERE-1148.sql create mode 100644 migration/i2.1/postgresql/201501070858_IDEMPIERE-1148.sql diff --git a/migration/i2.1/oracle/201501070858_IDEMPIERE-1148.sql b/migration/i2.1/oracle/201501070858_IDEMPIERE-1148.sql new file mode 100644 index 0000000000..e83cd35860 --- /dev/null +++ b/migration/i2.1/oracle/201501070858_IDEMPIERE-1148.sql @@ -0,0 +1,361 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Oct 4, 2013 12:00:54 AM CEST +-- IDEMPIERE-1148 +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Element_UU,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,202614,'af1fda99-5c72-4da1-bed5-710d59ea3e6f',0,'IsDetailBPartner',TO_DATE('2013-10-04 00:00:52','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Manage Business Partners','Manage Business Partners',TO_DATE('2013-10-04 00:00:52','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Oct 4, 2013 12:01:06 AM CEST +-- IDEMPIERE-1148 +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Element_UU,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,202615,'d995b2e6-3beb-4b20-8efd-1a021c9c0634',0,'IsDetailProduct',TO_DATE('2013-10-04 00:01:05','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Manage Products','Manage Products',TO_DATE('2013-10-04 00:01:05','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Oct 4, 2013 12:01:59 AM CEST +-- IDEMPIERE-1148 +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Element_UU,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,202616,'25ffab36-a5f8-46dc-92f3-a4c43a3a4601',0,'BPartnerType',TO_DATE('2013-10-04 00:01:59','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Business Partner Type','Business Partner Type',TO_DATE('2013-10-04 00:01:59','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Oct 4, 2013 12:02:30 AM CEST +-- IDEMPIERE-1148 +INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_UU,Created,CreatedBy,Description,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,VFormat,ValidationType) VALUES (0,0,200076,'7688770d-a2dd-428b-ac28-efcd8fe24785',TO_DATE('2013-10-04 00:02:30','YYYY-MM-DD HH24:MI:SS'),100,NULL,'D','Y','N','C_ElementValue Account BPartner Type',TO_DATE('2013-10-04 00:02:30','YYYY-MM-DD HH24:MI:SS'),100,NULL,'L') +; + +-- Oct 4, 2013 12:02:43 AM CEST +-- IDEMPIERE-1148 +INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Ref_List_UU,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,200165,'261c79ec-c7fd-458e-8823-cac29cf1ec35',200076,TO_DATE('2013-10-04 00:02:42','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Customer',TO_DATE('2013-10-04 00:02:42','YYYY-MM-DD HH24:MI:SS'),100,'C') +; + +-- Oct 4, 2013 12:02:49 AM CEST +-- IDEMPIERE-1148 +INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Ref_List_UU,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,200166,'b0d3a446-cb7d-4b3f-9cd0-37052c4de7f5',200076,TO_DATE('2013-10-04 00:02:48','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Vendor',TO_DATE('2013-10-04 00:02:48','YYYY-MM-DD HH24:MI:SS'),100,'V') +; + +-- Oct 4, 2013 12:02:54 AM CEST +-- IDEMPIERE-1148 +INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Ref_List_UU,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,200167,'5a2e2ea0-9902-4747-9eed-e6d1832544ba',200076,TO_DATE('2013-10-04 00:02:53','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Employee',TO_DATE('2013-10-04 00:02:53','YYYY-MM-DD HH24:MI:SS'),100,'E') +; + +-- Oct 4, 2013 12:03:25 AM CEST +-- IDEMPIERE-1148 +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Column_UU,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,EntityType,FieldLength,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,210873,'25a5098a-b000-4b5f-9432-1a1a893a418e',202614,0,20,188,'IsDetailBPartner',TO_DATE('2013-10-04 00:03:24','YYYY-MM-DD HH24:MI:SS'),100,'N','U',1,'Y','Y','Y','N','N','N','N','N','Y','N','N','N','N','N','N','Y','Manage Business Partners',0,0,TO_DATE('2013-10-04 00:03:24','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Oct 4, 2013 12:03:32 AM CEST +-- IDEMPIERE-1148 +ALTER TABLE C_ElementValue ADD IsDetailBPartner CHAR(1) DEFAULT 'N' CHECK (IsDetailBPartner IN ('Y','N')) NOT NULL +; + +-- Oct 4, 2013 12:03:36 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Column SET EntityType='D',Updated=TO_DATE('2013-10-04 00:03:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=210873 +; + +-- Oct 4, 2013 12:04:15 AM CEST +-- IDEMPIERE-1148 +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Column_UU,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,EntityType,FieldLength,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,210874,'1ba4da15-d645-4b35-a7d3-36d073d39ac7',202615,0,20,188,'IsDetailProduct',TO_DATE('2013-10-04 00:03:53','YYYY-MM-DD HH24:MI:SS'),100,'N','D',1,'Y','Y','Y','N','N','N','N','N','Y','N','N','N','N','N','N','Y','Manage Products',0,0,TO_DATE('2013-10-04 00:03:53','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Oct 4, 2013 12:05:27 AM CEST +-- IDEMPIERE-1148 +ALTER TABLE C_ElementValue ADD IsDetailProduct CHAR(1) DEFAULT 'N' CHECK (IsDetailProduct IN ('Y','N')) NOT NULL +; + +-- Oct 4, 2013 12:05:57 AM CEST +-- IDEMPIERE-1148 +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Column_UU,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,210875,'740d84a2-55d7-4ad0-aeca-d0e1f7033e7d',202616,0,17,200076,188,'BPartnerType',TO_DATE('2013-10-04 00:05:56','YYYY-MM-DD HH24:MI:SS'),100,'D',1,'Y','Y','Y','N','N','N','N','N','N','N','N','N','N','N','N','Y','Business Partner Type',0,0,TO_DATE('2013-10-04 00:05:56','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Oct 4, 2013 12:05:58 AM CEST +-- IDEMPIERE-1148 +ALTER TABLE C_ElementValue ADD BPartnerType CHAR(1) DEFAULT NULL +; + +-- Oct 4, 2013 12:07:13 AM CEST +-- IDEMPIERE-1148 +INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Field_UU,AD_Org_ID,AD_Tab_ID,ColumnSpan,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,Updated,UpdatedBy) VALUES (0,60657,202520,'c6b1b45a-5d93-4229-8d22-e7a66ce656fa',0,132,2,TO_DATE('2013-10-04 00:07:12','YYYY-MM-DD HH24:MI:SS'),100,36,'D','Y','Y','N','N','N','N','N','N','N','C_ElementValue_UU',230,TO_DATE('2013-10-04 00:07:12','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Oct 4, 2013 12:07:14 AM CEST +-- IDEMPIERE-1148 +INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Field_UU,AD_Org_ID,AD_Tab_ID,ColumnSpan,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,Updated,UpdatedBy,XPosition) VALUES (0,210873,202521,'c7634155-02a7-473d-9369-4570437b4f26',0,132,2,TO_DATE('2013-10-04 00:07:13','YYYY-MM-DD HH24:MI:SS'),100,1,'D','Y','Y','Y','N','N','N','N','N','Manage Business Partners',240,TO_DATE('2013-10-04 00:07:13','YYYY-MM-DD HH24:MI:SS'),100,2) +; + +-- Oct 4, 2013 12:07:14 AM CEST +-- IDEMPIERE-1148 +INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Field_UU,AD_Org_ID,AD_Tab_ID,ColumnSpan,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,Updated,UpdatedBy,XPosition) VALUES (0,210874,202522,'c5c2fa78-6f69-43ab-8e38-82e875709ea5',0,132,2,TO_DATE('2013-10-04 00:07:14','YYYY-MM-DD HH24:MI:SS'),100,1,'D','Y','Y','Y','N','N','N','N','N','Manage Products',250,TO_DATE('2013-10-04 00:07:14','YYYY-MM-DD HH24:MI:SS'),100,2) +; + +-- Oct 4, 2013 12:07:15 AM CEST +-- IDEMPIERE-1148 +INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Field_UU,AD_Org_ID,AD_Tab_ID,ColumnSpan,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,Updated,UpdatedBy) VALUES (0,210875,202523,'d5444222-49ed-41fc-aac9-4edb3c04b68c',0,132,2,TO_DATE('2013-10-04 00:07:14','YYYY-MM-DD HH24:MI:SS'),100,1,'D','Y','Y','Y','N','N','N','N','N','Business Partner Type',260,TO_DATE('2013-10-04 00:07:14','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=500 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=501 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=942 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=622 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=623 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=10,IsDisplayedGrid='Y' WHERE AD_Field_ID=2014 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=20,IsDisplayedGrid='Y' WHERE AD_Field_ID=502 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=30,IsDisplayedGrid='Y' WHERE AD_Field_ID=503 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=40,IsDisplayedGrid='Y' WHERE AD_Field_ID=504 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=50,IsDisplayedGrid='Y' WHERE AD_Field_ID=505 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=60,IsDisplayedGrid='Y' WHERE AD_Field_ID=506 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=70,IsDisplayedGrid='Y' WHERE AD_Field_ID=514 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=80,IsDisplayedGrid='Y' WHERE AD_Field_ID=510 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=90,IsDisplayedGrid='Y' WHERE AD_Field_ID=507 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=100,IsDisplayedGrid='Y' WHERE AD_Field_ID=511 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=110,IsDisplayedGrid='Y' WHERE AD_Field_ID=508 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=120,IsDisplayedGrid='Y' WHERE AD_Field_ID=620 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=130,IsDisplayedGrid='Y' WHERE AD_Field_ID=509 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=140,IsDisplayedGrid='Y' WHERE AD_Field_ID=3049 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=150,IsDisplayedGrid='Y' WHERE AD_Field_ID=3048 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=160,IsDisplayedGrid='Y' WHERE AD_Field_ID=2077 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=170,IsDisplayedGrid='Y' WHERE AD_Field_ID=2076 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=180,IsDisplayedGrid='Y' WHERE AD_Field_ID=202522 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=190,IsDisplayedGrid='Y' WHERE AD_Field_ID=202521 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=200,IsDisplayedGrid='Y' WHERE AD_Field_ID=202523 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=500 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=202520 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=942 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=622 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=623 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=10,IsDisplayed='Y' WHERE AD_Field_ID=501 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=20,IsDisplayed='Y' WHERE AD_Field_ID=2014 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=30,IsDisplayed='Y' WHERE AD_Field_ID=502 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=40,IsDisplayed='Y' WHERE AD_Field_ID=503 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=50,IsDisplayed='Y' WHERE AD_Field_ID=504 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=505 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=506 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=514 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=510 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=507 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=511 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=508 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=130,IsDisplayed='Y' WHERE AD_Field_ID=620 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=140,IsDisplayed='Y' WHERE AD_Field_ID=509 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=3049 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=3048 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=2077 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=2076 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=190,IsDisplayed='Y' WHERE AD_Field_ID=202522 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=200,IsDisplayed='Y' WHERE AD_Field_ID=202521 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=210,IsDisplayed='Y' WHERE AD_Field_ID=202523 +; + +-- Oct 4, 2013 12:09:31 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET DisplayLogic='@IsDetailBPartner@=Y',Updated=TO_DATE('2013-10-04 00:09:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202523 +; + +-- Oct 4, 2013 12:09:50 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET IsSameLine='Y',Updated=TO_DATE('2013-10-04 00:09:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202521 +; + + +SELECT register_migration_script('201501070858_IDEMPIERE-1148.sql') FROM dual +; \ No newline at end of file diff --git a/migration/i2.1/postgresql/201501070858_IDEMPIERE-1148.sql b/migration/i2.1/postgresql/201501070858_IDEMPIERE-1148.sql new file mode 100644 index 0000000000..29be4b0a1f --- /dev/null +++ b/migration/i2.1/postgresql/201501070858_IDEMPIERE-1148.sql @@ -0,0 +1,359 @@ +-- Oct 4, 2013 12:00:54 AM CEST +-- IDEMPIERE-1148 +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Element_UU,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,202614,'af1fda99-5c72-4da1-bed5-710d59ea3e6f',0,'IsDetailBPartner',TO_TIMESTAMP('2013-10-04 00:00:52','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Manage Business Partners','Manage Business Partners',TO_TIMESTAMP('2013-10-04 00:00:52','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Oct 4, 2013 12:01:06 AM CEST +-- IDEMPIERE-1148 +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Element_UU,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,202615,'d995b2e6-3beb-4b20-8efd-1a021c9c0634',0,'IsDetailProduct',TO_TIMESTAMP('2013-10-04 00:01:05','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Manage Products','Manage Products',TO_TIMESTAMP('2013-10-04 00:01:05','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Oct 4, 2013 12:01:59 AM CEST +-- IDEMPIERE-1148 +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Element_UU,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,202616,'25ffab36-a5f8-46dc-92f3-a4c43a3a4601',0,'BPartnerType',TO_TIMESTAMP('2013-10-04 00:01:59','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Business Partner Type','Business Partner Type',TO_TIMESTAMP('2013-10-04 00:01:59','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Oct 4, 2013 12:02:30 AM CEST +-- IDEMPIERE-1148 +INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_UU,Created,CreatedBy,Description,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,VFormat,ValidationType) VALUES (0,0,200076,'7688770d-a2dd-428b-ac28-efcd8fe24785',TO_TIMESTAMP('2013-10-04 00:02:30','YYYY-MM-DD HH24:MI:SS'),100,NULL,'D','Y','N','C_ElementValue Account BPartner Type',TO_TIMESTAMP('2013-10-04 00:02:30','YYYY-MM-DD HH24:MI:SS'),100,NULL,'L') +; + +-- Oct 4, 2013 12:02:43 AM CEST +-- IDEMPIERE-1148 +INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Ref_List_UU,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,200165,'261c79ec-c7fd-458e-8823-cac29cf1ec35',200076,TO_TIMESTAMP('2013-10-04 00:02:42','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Customer',TO_TIMESTAMP('2013-10-04 00:02:42','YYYY-MM-DD HH24:MI:SS'),100,'C') +; + +-- Oct 4, 2013 12:02:49 AM CEST +-- IDEMPIERE-1148 +INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Ref_List_UU,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,200166,'b0d3a446-cb7d-4b3f-9cd0-37052c4de7f5',200076,TO_TIMESTAMP('2013-10-04 00:02:48','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Vendor',TO_TIMESTAMP('2013-10-04 00:02:48','YYYY-MM-DD HH24:MI:SS'),100,'V') +; + +-- Oct 4, 2013 12:02:54 AM CEST +-- IDEMPIERE-1148 +INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Ref_List_UU,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,200167,'5a2e2ea0-9902-4747-9eed-e6d1832544ba',200076,TO_TIMESTAMP('2013-10-04 00:02:53','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Employee',TO_TIMESTAMP('2013-10-04 00:02:53','YYYY-MM-DD HH24:MI:SS'),100,'E') +; + +-- Oct 4, 2013 12:03:25 AM CEST +-- IDEMPIERE-1148 +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Column_UU,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,EntityType,FieldLength,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,210873,'25a5098a-b000-4b5f-9432-1a1a893a418e',202614,0,20,188,'IsDetailBPartner',TO_TIMESTAMP('2013-10-04 00:03:24','YYYY-MM-DD HH24:MI:SS'),100,'N','U',1,'Y','Y','Y','N','N','N','N','N','Y','N','N','N','N','N','N','Y','Manage Business Partners',0,0,TO_TIMESTAMP('2013-10-04 00:03:24','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Oct 4, 2013 12:03:32 AM CEST +-- IDEMPIERE-1148 +ALTER TABLE C_ElementValue ADD COLUMN IsDetailBPartner CHAR(1) DEFAULT 'N' CHECK (IsDetailBPartner IN ('Y','N')) NOT NULL +; + +-- Oct 4, 2013 12:03:36 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2013-10-04 00:03:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=210873 +; + +-- Oct 4, 2013 12:04:15 AM CEST +-- IDEMPIERE-1148 +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Column_UU,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,EntityType,FieldLength,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,210874,'1ba4da15-d645-4b35-a7d3-36d073d39ac7',202615,0,20,188,'IsDetailProduct',TO_TIMESTAMP('2013-10-04 00:03:53','YYYY-MM-DD HH24:MI:SS'),100,'N','D',1,'Y','Y','Y','N','N','N','N','N','Y','N','N','N','N','N','N','Y','Manage Products',0,0,TO_TIMESTAMP('2013-10-04 00:03:53','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Oct 4, 2013 12:05:27 AM CEST +-- IDEMPIERE-1148 +ALTER TABLE C_ElementValue ADD COLUMN IsDetailProduct CHAR(1) DEFAULT 'N' CHECK (IsDetailProduct IN ('Y','N')) NOT NULL +; + +-- Oct 4, 2013 12:05:57 AM CEST +-- IDEMPIERE-1148 +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Column_UU,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,210875,'740d84a2-55d7-4ad0-aeca-d0e1f7033e7d',202616,0,17,200076,188,'BPartnerType',TO_TIMESTAMP('2013-10-04 00:05:56','YYYY-MM-DD HH24:MI:SS'),100,'D',1,'Y','Y','Y','N','N','N','N','N','N','N','N','N','N','N','N','Y','Business Partner Type',0,0,TO_TIMESTAMP('2013-10-04 00:05:56','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Oct 4, 2013 12:05:58 AM CEST +-- IDEMPIERE-1148 +ALTER TABLE C_ElementValue ADD COLUMN BPartnerType CHAR(1) DEFAULT NULL +; + +-- Oct 4, 2013 12:07:13 AM CEST +-- IDEMPIERE-1148 +INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Field_UU,AD_Org_ID,AD_Tab_ID,ColumnSpan,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,Updated,UpdatedBy) VALUES (0,60657,202520,'c6b1b45a-5d93-4229-8d22-e7a66ce656fa',0,132,2,TO_TIMESTAMP('2013-10-04 00:07:12','YYYY-MM-DD HH24:MI:SS'),100,36,'D','Y','Y','N','N','N','N','N','N','N','C_ElementValue_UU',230,TO_TIMESTAMP('2013-10-04 00:07:12','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Oct 4, 2013 12:07:14 AM CEST +-- IDEMPIERE-1148 +INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Field_UU,AD_Org_ID,AD_Tab_ID,ColumnSpan,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,Updated,UpdatedBy,XPosition) VALUES (0,210873,202521,'c7634155-02a7-473d-9369-4570437b4f26',0,132,2,TO_TIMESTAMP('2013-10-04 00:07:13','YYYY-MM-DD HH24:MI:SS'),100,1,'D','Y','Y','Y','N','N','N','N','N','Manage Business Partners',240,TO_TIMESTAMP('2013-10-04 00:07:13','YYYY-MM-DD HH24:MI:SS'),100,2) +; + +-- Oct 4, 2013 12:07:14 AM CEST +-- IDEMPIERE-1148 +INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Field_UU,AD_Org_ID,AD_Tab_ID,ColumnSpan,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,Updated,UpdatedBy,XPosition) VALUES (0,210874,202522,'c5c2fa78-6f69-43ab-8e38-82e875709ea5',0,132,2,TO_TIMESTAMP('2013-10-04 00:07:14','YYYY-MM-DD HH24:MI:SS'),100,1,'D','Y','Y','Y','N','N','N','N','N','Manage Products',250,TO_TIMESTAMP('2013-10-04 00:07:14','YYYY-MM-DD HH24:MI:SS'),100,2) +; + +-- Oct 4, 2013 12:07:15 AM CEST +-- IDEMPIERE-1148 +INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Field_UU,AD_Org_ID,AD_Tab_ID,ColumnSpan,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,Updated,UpdatedBy) VALUES (0,210875,202523,'d5444222-49ed-41fc-aac9-4edb3c04b68c',0,132,2,TO_TIMESTAMP('2013-10-04 00:07:14','YYYY-MM-DD HH24:MI:SS'),100,1,'D','Y','Y','Y','N','N','N','N','N','Business Partner Type',260,TO_TIMESTAMP('2013-10-04 00:07:14','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=500 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=501 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=942 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=622 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=623 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=10,IsDisplayedGrid='Y' WHERE AD_Field_ID=2014 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=20,IsDisplayedGrid='Y' WHERE AD_Field_ID=502 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=30,IsDisplayedGrid='Y' WHERE AD_Field_ID=503 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=40,IsDisplayedGrid='Y' WHERE AD_Field_ID=504 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=50,IsDisplayedGrid='Y' WHERE AD_Field_ID=505 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=60,IsDisplayedGrid='Y' WHERE AD_Field_ID=506 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=70,IsDisplayedGrid='Y' WHERE AD_Field_ID=514 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=80,IsDisplayedGrid='Y' WHERE AD_Field_ID=510 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=90,IsDisplayedGrid='Y' WHERE AD_Field_ID=507 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=100,IsDisplayedGrid='Y' WHERE AD_Field_ID=511 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=110,IsDisplayedGrid='Y' WHERE AD_Field_ID=508 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=120,IsDisplayedGrid='Y' WHERE AD_Field_ID=620 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=130,IsDisplayedGrid='Y' WHERE AD_Field_ID=509 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=140,IsDisplayedGrid='Y' WHERE AD_Field_ID=3049 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=150,IsDisplayedGrid='Y' WHERE AD_Field_ID=3048 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=160,IsDisplayedGrid='Y' WHERE AD_Field_ID=2077 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=170,IsDisplayedGrid='Y' WHERE AD_Field_ID=2076 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=180,IsDisplayedGrid='Y' WHERE AD_Field_ID=202522 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=190,IsDisplayedGrid='Y' WHERE AD_Field_ID=202521 +; + +-- Oct 4, 2013 12:07:27 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNoGrid=200,IsDisplayedGrid='Y' WHERE AD_Field_ID=202523 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=500 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=202520 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=942 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=622 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=623 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=10,IsDisplayed='Y' WHERE AD_Field_ID=501 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=20,IsDisplayed='Y' WHERE AD_Field_ID=2014 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=30,IsDisplayed='Y' WHERE AD_Field_ID=502 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=40,IsDisplayed='Y' WHERE AD_Field_ID=503 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=50,IsDisplayed='Y' WHERE AD_Field_ID=504 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=505 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=506 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=514 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=510 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=507 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=511 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=508 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=130,IsDisplayed='Y' WHERE AD_Field_ID=620 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=140,IsDisplayed='Y' WHERE AD_Field_ID=509 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=3049 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=3048 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=2077 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=2076 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=190,IsDisplayed='Y' WHERE AD_Field_ID=202522 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=200,IsDisplayed='Y' WHERE AD_Field_ID=202521 +; + +-- Oct 4, 2013 12:07:33 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET SeqNo=210,IsDisplayed='Y' WHERE AD_Field_ID=202523 +; + +-- Oct 4, 2013 12:09:31 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET DisplayLogic='@IsDetailBPartner@=Y',Updated=TO_TIMESTAMP('2013-10-04 00:09:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202523 +; + +-- Oct 4, 2013 12:09:50 AM CEST +-- IDEMPIERE-1148 +UPDATE AD_Field SET IsSameLine='Y',Updated=TO_TIMESTAMP('2013-10-04 00:09:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202521 +; + + + +SELECT register_migration_script('201501070858_IDEMPIERE-1148.sql') FROM dual +; \ No newline at end of file From 1162973504383b3807215cec0a928367a7497f75 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 7 Jan 2015 09:16:44 -0500 Subject: [PATCH 05/19] IDEMPIERE-1148 Account : Add checkboxes to identify account kind (bpartner, product) --- .../oracle/201501070858_IDEMPIERE-1148.sql | 27 ++++++- .../201501070858_IDEMPIERE-1148.sql | 26 ++++++- .../org/compiere/model/I_C_ElementValue.java | 27 +++++++ .../org/compiere/model/X_C_ElementValue.java | 71 ++++++++++++++++++- 4 files changed, 146 insertions(+), 5 deletions(-) diff --git a/migration/i2.1/oracle/201501070858_IDEMPIERE-1148.sql b/migration/i2.1/oracle/201501070858_IDEMPIERE-1148.sql index e83cd35860..22958ad06a 100644 --- a/migration/i2.1/oracle/201501070858_IDEMPIERE-1148.sql +++ b/migration/i2.1/oracle/201501070858_IDEMPIERE-1148.sql @@ -38,7 +38,7 @@ INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Ref_List_UU,AD -- Oct 4, 2013 12:03:25 AM CEST -- IDEMPIERE-1148 -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Column_UU,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,EntityType,FieldLength,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,210873,'25a5098a-b000-4b5f-9432-1a1a893a418e',202614,0,20,188,'IsDetailBPartner',TO_DATE('2013-10-04 00:03:24','YYYY-MM-DD HH24:MI:SS'),100,'N','U',1,'Y','Y','Y','N','N','N','N','N','Y','N','N','N','N','N','N','Y','Manage Business Partners',0,0,TO_DATE('2013-10-04 00:03:24','YYYY-MM-DD HH24:MI:SS'),100,0) +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Column_UU,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,EntityType,FieldLength,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,210873,'25a5098a-b000-4b5f-9432-1a1a893a418e',202614,0,20,188,'IsDetailBPartner',TO_DATE('2013-10-04 00:03:24','YYYY-MM-DD HH24:MI:SS'),100,'N','D',1,'Y','Y','Y','N','N','N','N','N','Y','N','N','N','N','N','N','Y','Manage Business Partners',0,0,TO_DATE('2013-10-04 00:03:24','YYYY-MM-DD HH24:MI:SS'),100,0) ; -- Oct 4, 2013 12:03:32 AM CEST @@ -356,6 +356,29 @@ UPDATE AD_Field SET DisplayLogic='@IsDetailBPartner@=Y',Updated=TO_DATE('2013-10 UPDATE AD_Field SET IsSameLine='Y',Updated=TO_DATE('2013-10-04 00:09:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202521 ; +-- Jan 7, 2015 9:09:16 AM COT +UPDATE AD_Field SET DisplayLogic='@ElementType@=A & @IsSummary@=N',Updated=TO_DATE('2015-01-07 09:09:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202522 +; + +-- Jan 7, 2015 9:09:23 AM COT +UPDATE AD_Field SET DisplayLogic='@ElementType@=A & @IsSummary@=N',Updated=TO_DATE('2015-01-07 09:09:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202521 +; + +-- Jan 7, 2015 9:09:29 AM COT +UPDATE AD_Field SET DisplayLogic='@ElementType@=A & @IsSummary@=N & @IsDetailBPartner@=Y',Updated=TO_DATE('2015-01-07 09:09:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202523 +; + +-- Jan 7, 2015 9:10:10 AM COT +UPDATE AD_Field SET IsDisplayed='Y', SeqNo=190, XPosition=2,Updated=TO_DATE('2015-01-07 09:10:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202521 +; + +-- Jan 7, 2015 9:10:10 AM COT +UPDATE AD_Field SET IsDisplayed='Y', SeqNo=200, XPosition=4,Updated=TO_DATE('2015-01-07 09:10:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202523 +; + +-- Jan 7, 2015 9:10:10 AM COT +UPDATE AD_Field SET SeqNo=210,Updated=TO_DATE('2015-01-07 09:10:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202522 +; SELECT register_migration_script('201501070858_IDEMPIERE-1148.sql') FROM dual -; \ No newline at end of file +; diff --git a/migration/i2.1/postgresql/201501070858_IDEMPIERE-1148.sql b/migration/i2.1/postgresql/201501070858_IDEMPIERE-1148.sql index 29be4b0a1f..e6b44c724e 100644 --- a/migration/i2.1/postgresql/201501070858_IDEMPIERE-1148.sql +++ b/migration/i2.1/postgresql/201501070858_IDEMPIERE-1148.sql @@ -35,7 +35,7 @@ INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Ref_List_UU,AD -- Oct 4, 2013 12:03:25 AM CEST -- IDEMPIERE-1148 -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Column_UU,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,EntityType,FieldLength,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,210873,'25a5098a-b000-4b5f-9432-1a1a893a418e',202614,0,20,188,'IsDetailBPartner',TO_TIMESTAMP('2013-10-04 00:03:24','YYYY-MM-DD HH24:MI:SS'),100,'N','U',1,'Y','Y','Y','N','N','N','N','N','Y','N','N','N','N','N','N','Y','Manage Business Partners',0,0,TO_TIMESTAMP('2013-10-04 00:03:24','YYYY-MM-DD HH24:MI:SS'),100,0) +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Column_UU,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,EntityType,FieldLength,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,210873,'25a5098a-b000-4b5f-9432-1a1a893a418e',202614,0,20,188,'IsDetailBPartner',TO_TIMESTAMP('2013-10-04 00:03:24','YYYY-MM-DD HH24:MI:SS'),100,'N','D',1,'Y','Y','Y','N','N','N','N','N','Y','N','N','N','N','N','N','Y','Manage Business Partners',0,0,TO_TIMESTAMP('2013-10-04 00:03:24','YYYY-MM-DD HH24:MI:SS'),100,0) ; -- Oct 4, 2013 12:03:32 AM CEST @@ -353,7 +353,29 @@ UPDATE AD_Field SET DisplayLogic='@IsDetailBPartner@=Y',Updated=TO_TIMESTAMP('20 UPDATE AD_Field SET IsSameLine='Y',Updated=TO_TIMESTAMP('2013-10-04 00:09:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202521 ; +-- Jan 7, 2015 9:09:16 AM COT +UPDATE AD_Field SET DisplayLogic='@ElementType@=A & @IsSummary@=N',Updated=TO_TIMESTAMP('2015-01-07 09:09:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202522 +; +-- Jan 7, 2015 9:09:23 AM COT +UPDATE AD_Field SET DisplayLogic='@ElementType@=A & @IsSummary@=N',Updated=TO_TIMESTAMP('2015-01-07 09:09:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202521 +; + +-- Jan 7, 2015 9:09:29 AM COT +UPDATE AD_Field SET DisplayLogic='@ElementType@=A & @IsSummary@=N & @IsDetailBPartner@=Y',Updated=TO_TIMESTAMP('2015-01-07 09:09:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202523 +; + +-- Jan 7, 2015 9:10:10 AM COT +UPDATE AD_Field SET IsDisplayed='Y', SeqNo=190, XPosition=2,Updated=TO_TIMESTAMP('2015-01-07 09:10:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202521 +; + +-- Jan 7, 2015 9:10:10 AM COT +UPDATE AD_Field SET IsDisplayed='Y', SeqNo=200, XPosition=4,Updated=TO_TIMESTAMP('2015-01-07 09:10:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202523 +; + +-- Jan 7, 2015 9:10:10 AM COT +UPDATE AD_Field SET SeqNo=210,Updated=TO_TIMESTAMP('2015-01-07 09:10:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202522 +; SELECT register_migration_script('201501070858_IDEMPIERE-1148.sql') FROM dual -; \ No newline at end of file +; diff --git a/org.adempiere.base/src/org/compiere/model/I_C_ElementValue.java b/org.adempiere.base/src/org/compiere/model/I_C_ElementValue.java index 7932ffaf3e..3e7fe8629f 100644 --- a/org.adempiere.base/src/org/compiere/model/I_C_ElementValue.java +++ b/org.adempiere.base/src/org/compiere/model/I_C_ElementValue.java @@ -88,6 +88,15 @@ public interface I_C_ElementValue */ public int getAD_Org_ID(); + /** Column name BPartnerType */ + public static final String COLUMNNAME_BPartnerType = "BPartnerType"; + + /** Set Business Partner Type */ + public void setBPartnerType (String BPartnerType); + + /** Get Business Partner Type */ + public String getBPartnerType(); + /** Column name C_BankAccount_ID */ public static final String COLUMNNAME_C_BankAccount_ID = "C_BankAccount_ID"; @@ -210,6 +219,24 @@ public interface I_C_ElementValue */ public boolean isBankAccount(); + /** Column name IsDetailBPartner */ + public static final String COLUMNNAME_IsDetailBPartner = "IsDetailBPartner"; + + /** Set Manage Business Partners */ + public void setIsDetailBPartner (boolean IsDetailBPartner); + + /** Get Manage Business Partners */ + public boolean isDetailBPartner(); + + /** Column name IsDetailProduct */ + public static final String COLUMNNAME_IsDetailProduct = "IsDetailProduct"; + + /** Set Manage Products */ + public void setIsDetailProduct (boolean IsDetailProduct); + + /** Get Manage Products */ + public boolean isDetailProduct(); + /** Column name IsDocControlled */ public static final String COLUMNNAME_IsDocControlled = "IsDocControlled"; diff --git a/org.adempiere.base/src/org/compiere/model/X_C_ElementValue.java b/org.adempiere.base/src/org/compiere/model/X_C_ElementValue.java index 8aa1d37b52..1b5af75228 100644 --- a/org.adempiere.base/src/org/compiere/model/X_C_ElementValue.java +++ b/org.adempiere.base/src/org/compiere/model/X_C_ElementValue.java @@ -31,7 +31,7 @@ public class X_C_ElementValue extends PO implements I_C_ElementValue, I_Persiste /** * */ - private static final long serialVersionUID = 20141030L; + private static final long serialVersionUID = 20150107L; /** Standard Constructor */ public X_C_ElementValue (Properties ctx, int C_ElementValue_ID, String trxName) @@ -45,6 +45,10 @@ public class X_C_ElementValue extends PO implements I_C_ElementValue, I_Persiste // E setC_Element_ID (0); setC_ElementValue_ID (0); + setIsDetailBPartner (false); +// N + setIsDetailProduct (false); +// N setIsSummary (false); setName (null); setPostActual (true); @@ -145,6 +149,29 @@ public class X_C_ElementValue extends PO implements I_C_ElementValue, I_Persiste return (String)get_Value(COLUMNNAME_AccountType); } + /** BPartnerType AD_Reference_ID=200076 */ + public static final int BPARTNERTYPE_AD_Reference_ID=200076; + /** Customer = C */ + public static final String BPARTNERTYPE_Customer = "C"; + /** Vendor = V */ + public static final String BPARTNERTYPE_Vendor = "V"; + /** Employee = E */ + public static final String BPARTNERTYPE_Employee = "E"; + /** Set Business Partner Type. + @param BPartnerType Business Partner Type */ + public void setBPartnerType (String BPartnerType) + { + + set_Value (COLUMNNAME_BPartnerType, BPartnerType); + } + + /** Get Business Partner Type. + @return Business Partner Type */ + public String getBPartnerType () + { + return (String)get_Value(COLUMNNAME_BPartnerType); + } + public org.compiere.model.I_C_BankAccount getC_BankAccount() throws RuntimeException { return (org.compiere.model.I_C_BankAccount)MTable.get(getCtx(), org.compiere.model.I_C_BankAccount.Table_Name) @@ -307,6 +334,48 @@ public class X_C_ElementValue extends PO implements I_C_ElementValue, I_Persiste return false; } + /** Set Manage Business Partners. + @param IsDetailBPartner Manage Business Partners */ + public void setIsDetailBPartner (boolean IsDetailBPartner) + { + set_Value (COLUMNNAME_IsDetailBPartner, Boolean.valueOf(IsDetailBPartner)); + } + + /** Get Manage Business Partners. + @return Manage Business Partners */ + public boolean isDetailBPartner () + { + Object oo = get_Value(COLUMNNAME_IsDetailBPartner); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Manage Products. + @param IsDetailProduct Manage Products */ + public void setIsDetailProduct (boolean IsDetailProduct) + { + set_Value (COLUMNNAME_IsDetailProduct, Boolean.valueOf(IsDetailProduct)); + } + + /** Get Manage Products. + @return Manage Products */ + public boolean isDetailProduct () + { + Object oo = get_Value(COLUMNNAME_IsDetailProduct); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + /** Set Document Controlled. @param IsDocControlled Control account - If an account is controlled by a document, you cannot post manually to it From d867a0f2a7dc549978f423d3e702a43629a56b0b Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 7 Jan 2015 10:32:21 -0500 Subject: [PATCH 06/19] IDEMPIERE-1551 Generate Shipments (manual) window don't load Warehouse when login with Organization = * / based on patch from hieplq --- .../WEB-INF/src/org/adempiere/webui/apps/form/WInOutGen.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WInOutGen.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WInOutGen.java index 74766f6b22..3be9dced43 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WInOutGen.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WInOutGen.java @@ -128,7 +128,7 @@ public class WInOutGen extends InOutGen implements IFormController, EventListene public void dynInit() throws Exception { // C_OrderLine.M_Warehouse_ID - MLookup orgL = MLookupFactory.get (Env.getCtx(), form.getWindowNo(), 0, 2223, DisplayType.TableDir); + MLookup orgL = MLookupFactory.get (Env.getCtx(), form.getWindowNo(), 0, 11474 /* M_Requisition.M_Warehouse_ID */, DisplayType.TableDir); fWarehouse = new WTableDirEditor ("M_Warehouse_ID", true, false, true, orgL); lWarehouse.setText(Msg.translate(Env.getCtx(), "M_Warehouse_ID")); fWarehouse.addValueChangeListener(this); From 5e04ddd8a8b203780b95d10b8b267a1fb08b11ff Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 7 Jan 2015 11:10:30 -0500 Subject: [PATCH 07/19] IDEMPIERE-1492 when login with Organization = *, run "Bank Transfer" make error "Fill mandatory fields: : Organization" / based on patch from hieplq --- .../oracle/201501071044_IDEMPIERE-1492.sql | 27 ++++++++++++++++ .../201501071044_IDEMPIERE-1492.sql | 24 ++++++++++++++ .../src/org/compiere/model/PO.java | 2 +- .../org/eevolution/process/BankTransfer.java | 32 +++++++++++-------- 4 files changed, 71 insertions(+), 14 deletions(-) create mode 100644 migration/i2.1/oracle/201501071044_IDEMPIERE-1492.sql create mode 100644 migration/i2.1/postgresql/201501071044_IDEMPIERE-1492.sql diff --git a/migration/i2.1/oracle/201501071044_IDEMPIERE-1492.sql b/migration/i2.1/oracle/201501071044_IDEMPIERE-1492.sql new file mode 100644 index 0000000000..335184530a --- /dev/null +++ b/migration/i2.1/oracle/201501071044_IDEMPIERE-1492.sql @@ -0,0 +1,27 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Jan 7, 2015 10:39:54 AM COT +-- IDEMPIERE-1492 +UPDATE AD_Process SET Name='Bank/Cash Transfer', Description='Bank/Cash Transfer let money tranfer between Banks',Updated=TO_DATE('2015-01-07 10:39:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=53153 +; + +-- Jan 7, 2015 10:39:54 AM COT +UPDATE AD_Menu SET Name='Bank/Cash Transfer', Description='Bank/Cash Transfer let money tranfer between Banks', IsActive='Y',Updated=TO_DATE('2015-01-07 10:39:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53190 +; + +-- Jan 7, 2015 10:43:38 AM COT +INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,Help,AD_Process_ID,SeqNo,AD_Reference_ID,AD_Reference_Value_ID,IsRange,FieldLength,IsMandatory,DefaultValue,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted) VALUES (200115,0,0,'Y',TO_DATE('2015-01-07 10:43:37','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2015-01-07 10:43:37','YYYY-MM-DD HH24:MI:SS'),100,'Organization','Organizational entity within client','An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.',53153,120,19,130,'N',10,'Y','@#AD_Org_ID@','AD_Org_ID','Y','D',113,'cf69cf9d-aac5-430f-b290-d6d4ba70cf8e','N') +; + +-- Jan 7, 2015 11:00:05 AM COT +INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('E','Banks From and To must be different',0,0,'Y',TO_DATE('2015-01-07 11:00:04','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2015-01-07 11:00:04','YYYY-MM-DD HH24:MI:SS'),100,200329,'BankFromToMustDiffer','D','238c4118-870c-47b7-833a-f2d51f200ac6') +; + +-- Jan 7, 2015 11:04:17 AM COT +UPDATE AD_Process_Para SET DefaultValue='@$C_Currency_ID@',Updated=TO_DATE('2015-01-07 11:04:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=53256 +; + +SELECT register_migration_script('201501071044_IDEMPIERE-1492.sql') FROM dual +; + diff --git a/migration/i2.1/postgresql/201501071044_IDEMPIERE-1492.sql b/migration/i2.1/postgresql/201501071044_IDEMPIERE-1492.sql new file mode 100644 index 0000000000..18d5afef25 --- /dev/null +++ b/migration/i2.1/postgresql/201501071044_IDEMPIERE-1492.sql @@ -0,0 +1,24 @@ +-- Jan 7, 2015 10:39:54 AM COT +-- IDEMPIERE-1492 +UPDATE AD_Process SET Name='Bank/Cash Transfer', Description='Bank/Cash Transfer let money tranfer between Banks',Updated=TO_TIMESTAMP('2015-01-07 10:39:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=53153 +; + +-- Jan 7, 2015 10:39:54 AM COT +UPDATE AD_Menu SET Name='Bank/Cash Transfer', Description='Bank/Cash Transfer let money tranfer between Banks', IsActive='Y',Updated=TO_TIMESTAMP('2015-01-07 10:39:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53190 +; + +-- Jan 7, 2015 10:43:38 AM COT +INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,Help,AD_Process_ID,SeqNo,AD_Reference_ID,AD_Reference_Value_ID,IsRange,FieldLength,IsMandatory,DefaultValue,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted) VALUES (200115,0,0,'Y',TO_TIMESTAMP('2015-01-07 10:43:37','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2015-01-07 10:43:37','YYYY-MM-DD HH24:MI:SS'),100,'Organization','Organizational entity within client','An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.',53153,120,19,130,'N',10,'Y','@#AD_Org_ID@','AD_Org_ID','Y','D',113,'cf69cf9d-aac5-430f-b290-d6d4ba70cf8e','N') +; + +-- Jan 7, 2015 11:00:05 AM COT +INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('E','Banks From and To must be different',0,0,'Y',TO_TIMESTAMP('2015-01-07 11:00:04','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2015-01-07 11:00:04','YYYY-MM-DD HH24:MI:SS'),100,200329,'BankFromToMustDiffer','D','238c4118-870c-47b7-833a-f2d51f200ac6') +; + +-- Jan 7, 2015 11:04:17 AM COT +UPDATE AD_Process_Para SET DefaultValue='@$C_Currency_ID@',Updated=TO_TIMESTAMP('2015-01-07 11:04:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=53256 +; + +SELECT register_migration_script('201501071044_IDEMPIERE-1492.sql') FROM dual +; + diff --git a/org.adempiere.base/src/org/compiere/model/PO.java b/org.adempiere.base/src/org/compiere/model/PO.java index 14e6437249..635501bd7e 100644 --- a/org.adempiere.base/src/org/compiere/model/PO.java +++ b/org.adempiere.base/src/org/compiere/model/PO.java @@ -2477,7 +2477,7 @@ public abstract class PO value = DB.getDocumentNo(AD_Client_ID, p_info.getTableName(), m_trxName, this); } else - log.warning("DocumentNo updated: " + m_oldValues[i] + " -> " + value); + if (log.isLoggable(Level.INFO)) log.info("DocumentNo updated: " + m_oldValues[i] + " -> " + value); } if (changes) diff --git a/org.adempiere.base/src/org/eevolution/process/BankTransfer.java b/org.adempiere.base/src/org/eevolution/process/BankTransfer.java index fe3d20a235..a282f690d7 100644 --- a/org.adempiere.base/src/org/eevolution/process/BankTransfer.java +++ b/org.adempiere.base/src/org/eevolution/process/BankTransfer.java @@ -42,16 +42,18 @@ public class BankTransfer extends SvrProcess private String p_DocumentNo= ""; // Document No private String p_Description= ""; // Description private int p_C_BPartner_ID = 0; // Business Partner to be used as bridge - private int p_C_Currency_ID = 0; // Payment Currency + private int p_C_Currency_ID = 0; // Payment Currency private int p_C_ConversionType_ID = 0; // Payment Conversion Type - private int p_C_Charge_ID = 0; // Charge to be used as bridge + private int p_C_Charge_ID = 0; // Charge to be used as bridge private BigDecimal p_Amount = Env.ZERO; // Amount to be transfered between the accounts private int p_From_C_BankAccount_ID = 0; // Bank Account From private int p_To_C_BankAccount_ID= 0; // Bank Account To private Timestamp p_StatementDate = null; // Date Statement private Timestamp p_DateAcct = null; // Date Account + private int p_AD_Org_ID = 0; private int m_created = 0; + /** * Prepare - e.g., get Parameters. */ @@ -83,6 +85,8 @@ public class BankTransfer extends SvrProcess p_StatementDate = (Timestamp)para[i].getParameter(); else if (name.equals("DateAcct")) p_DateAcct = (Timestamp)para[i].getParameter(); + else if (name.equals("AD_Org_ID")) + p_AD_Org_ID = para[i].getParameterAsInt(); else log.log(Level.SEVERE, "prepare - Unknown Parameter: " + name); } @@ -100,26 +104,26 @@ public class BankTransfer extends SvrProcess + " - Description="+p_Description+ " - Statement Date="+p_StatementDate+ " - Date Account="+p_DateAcct); - if (Env.getAD_Org_ID(getCtx()) == 0) - throw new AdempiereUserError(Msg.getMsg(getCtx(), "Org0NotAllowed")); - if (p_To_C_BankAccount_ID == 0 || p_From_C_BankAccount_ID == 0) - throw new IllegalArgumentException("Banks required"); + throw new AdempiereUserError (Msg.parseTranslation(getCtx(), "@FillMandatory@: @To_C_BankAccount_ID@, @From_C_BankAccount_ID@")); if (p_To_C_BankAccount_ID == p_From_C_BankAccount_ID) - throw new AdempiereUserError ("Banks From and To must be different"); + throw new AdempiereUserError (Msg.getMsg(getCtx(), "BankFromToMustDiffer")); if (p_C_BPartner_ID == 0) - throw new AdempiereUserError ("Business Partner required"); + throw new AdempiereUserError (Msg.parseTranslation(getCtx(), "@FillMandatory@ @C_BPartner_ID@")); if (p_C_Currency_ID == 0) - throw new AdempiereUserError ("Currency required"); + throw new AdempiereUserError (Msg.parseTranslation(getCtx(), "@FillMandatory@ @C_Currency_ID@")); if (p_C_Charge_ID == 0) - throw new AdempiereUserError ("Business Partner required"); + throw new AdempiereUserError (Msg.parseTranslation(getCtx(), "@FillMandatory@ @C_Charge_ID@")); if (p_Amount.signum() == 0) - throw new AdempiereUserError ("Amount required"); + throw new AdempiereUserError (Msg.parseTranslation(getCtx(), "@FillMandatory@ @Amount@")); + + if (p_AD_Org_ID == 0) + throw new AdempiereUserError (Msg.parseTranslation(getCtx(), "@FillMandatory@ @AD_Org_ID@")); // Login Date if (p_StatementDate == null) @@ -147,6 +151,7 @@ public class BankTransfer extends SvrProcess MPayment paymentBankFrom = new MPayment(getCtx(), 0 , get_TrxName()); paymentBankFrom.setC_BankAccount_ID(mBankFrom.getC_BankAccount_ID()); + paymentBankFrom.setAD_Org_ID(p_AD_Org_ID); if (!Util.isEmpty(p_DocumentNo, true)) paymentBankFrom.setDocumentNo(p_DocumentNo); paymentBankFrom.setDateAcct(p_DateAcct); @@ -174,6 +179,7 @@ public class BankTransfer extends SvrProcess MPayment paymentBankTo = new MPayment(getCtx(), 0 , get_TrxName()); paymentBankTo.setC_BankAccount_ID(mBankTo.getC_BankAccount_ID()); + paymentBankTo.setAD_Org_ID(p_AD_Org_ID); if (!Util.isEmpty(p_DocumentNo, true)) paymentBankTo.setDocumentNo(p_DocumentNo); paymentBankTo.setDateAcct(p_DateAcct); @@ -200,6 +206,6 @@ public class BankTransfer extends SvrProcess m_created++; return; - } // createCashLines + } // generateBankTransfer -} // ImmediateBankTransfer +} // BankTransfer From 4f0dc99e31ab9b19de60461a2a2d3afe54f59574 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 7 Jan 2015 11:39:14 -0500 Subject: [PATCH 08/19] IDEMPIERE-1654 IsInsertRecord = 'Y' for Organization Info Tab on Organization Window / based on patch from hieplq --- .../i2.1/oracle/201501071116_IDEMPIERE-1654.sql | 14 ++++++++++++++ .../postgresql/201501071116_IDEMPIERE-1654.sql | 11 +++++++++++ 2 files changed, 25 insertions(+) create mode 100644 migration/i2.1/oracle/201501071116_IDEMPIERE-1654.sql create mode 100644 migration/i2.1/postgresql/201501071116_IDEMPIERE-1654.sql diff --git a/migration/i2.1/oracle/201501071116_IDEMPIERE-1654.sql b/migration/i2.1/oracle/201501071116_IDEMPIERE-1654.sql new file mode 100644 index 0000000000..4584908f50 --- /dev/null +++ b/migration/i2.1/oracle/201501071116_IDEMPIERE-1654.sql @@ -0,0 +1,14 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Jan 2, 2014 3:03:27 PM ICT +-- IDEMPIERE-1654 IsInsertRecord = 'Y' for Organization Info Tab on Organization Window +UPDATE AD_Table SET IsDeleteable='N',Updated=TO_DATE('2015-01-07 11:03:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=227 +; + +-- Jan 2, 2014 3:07:18 PM ICT +UPDATE AD_Tab SET IsInsertRecord='N',Updated=TO_DATE('2015-01-07 11:07:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=170 +; + +SELECT register_migration_script('201501071116_IDEMPIERE-1654.sql') FROM dual +; diff --git a/migration/i2.1/postgresql/201501071116_IDEMPIERE-1654.sql b/migration/i2.1/postgresql/201501071116_IDEMPIERE-1654.sql new file mode 100644 index 0000000000..a2ca98c7fa --- /dev/null +++ b/migration/i2.1/postgresql/201501071116_IDEMPIERE-1654.sql @@ -0,0 +1,11 @@ +-- Jan 2, 2014 3:03:27 PM ICT +-- IDEMPIERE-1654 IsInsertRecord = 'Y' for Organization Info Tab on Organization Window +UPDATE AD_Table SET IsDeleteable='N',Updated=TO_TIMESTAMP('2015-01-07 11:03:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=227 +; + +-- Jan 2, 2014 3:07:18 PM ICT +UPDATE AD_Tab SET IsInsertRecord='N',Updated=TO_TIMESTAMP('2015-01-07 11:07:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=170 +; + +SELECT register_migration_script('201501071116_IDEMPIERE-1654.sql') FROM dual +; From d6e96b3f059e7595635f10134b7f876c7cf6e6be Mon Sep 17 00:00:00 2001 From: hieplq Date: Wed, 7 Jan 2015 23:00:51 +0700 Subject: [PATCH 09/19] IDEMPIERE-1689:When use Jaspersoft for print document. Extend of file name is incorect with type --- .../WEB-INF/src/org/adempiere/webui/window/ZkJRViewer.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/ZkJRViewer.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/ZkJRViewer.java index 11bfd89bf2..c4eeafe702 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/ZkJRViewer.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/ZkJRViewer.java @@ -244,7 +244,7 @@ public class ZkJRViewer extends Window implements EventListener, ITabOnCl if ( "PDF".equals( reportType ) ) { attachment = getPDF(); - media = new AMedia(m_title, "pdf", "application/pdf", attachment, true); + media = new AMedia(m_title + ".pdf", "pdf", "application/pdf", attachment, true); } else if ("HTML".equals(reportType)) { String path = System.getProperty("java.io.tmpdir"); @@ -281,7 +281,7 @@ public class ZkJRViewer extends Window implements EventListener, ITabOnCl exporterXLS.setParameter(JRXlsExporterParameter.OUTPUT_STREAM, fos); exporterXLS.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.FALSE); exporterXLS.exportReport(); - media = new AMedia(m_title, "xls", "application/vnd.ms-excel", file, true); + media = new AMedia(m_title + ".xls", "xls", "application/vnd.ms-excel", file, true); }else if ("CSV".equals(reportType)) { String path = System.getProperty("java.io.tmpdir"); @@ -297,7 +297,7 @@ public class ZkJRViewer extends Window implements EventListener, ITabOnCl exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, fos); exporter.exportReport(); - media = new AMedia(m_title, "csv", "application/csv", file, true); + media = new AMedia(m_title + ".csv", "csv", "application/csv", file, true); }else if ("SSV".equals(reportType)) { String path = System.getProperty("java.io.tmpdir"); From 27a945963f0e04503f6bf6af0fea875ccc9ffb0c Mon Sep 17 00:00:00 2001 From: hieplq Date: Sat, 6 Sep 2014 15:16:52 +0700 Subject: [PATCH 10/19] IDEMPIERE-2191:Product info >>Available to promise >>Show detail NPE --- .../src/org/adempiere/webui/info/InfoProductWindow.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java index fd3b92b102..cf04b3a4e3 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java @@ -290,8 +290,9 @@ public class InfoProductWindow extends InfoWindow { public void onEvent(Event event) throws Exception { if (contentPanel.getLayout() != null) { int M_Warehouse_ID = getSelectedWarehouseId(); - int m_M_Product_ID = getSelectedRowKey(); - initAtpTab(M_Warehouse_ID, m_M_Product_ID); + Integer m_M_Product_ID = getSelectedRowKey(); + if (m_M_Product_ID != null) + initAtpTab(M_Warehouse_ID, m_M_Product_ID); } } }); From fe342806ef9e34d0a30cc58d4ff38857eb68a218 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 7 Jan 2015 14:12:56 -0500 Subject: [PATCH 11/19] IDEMPIERE-1821 print invoice sometime print nothing, because filter incorrect organization / based on patch from hieplq --- .../src/org/adempiere/webui/process/InvoicePrint.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/InvoicePrint.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/InvoicePrint.java index f9c17bb9e3..2c2c1d907e 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/InvoicePrint.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/InvoicePrint.java @@ -33,6 +33,7 @@ import org.compiere.model.MClient; import org.compiere.model.MInvoice; import org.compiere.model.MMailText; import org.compiere.model.MQuery; +import org.compiere.model.MRole; import org.compiere.model.MUser; import org.compiere.model.MUserMail; import org.compiere.model.PrintInfo; @@ -46,6 +47,7 @@ import org.compiere.util.EMail; import org.compiere.util.Env; import org.compiere.util.Ini; import org.compiere.util.Language; +import org.compiere.util.Util; /** * Print Invoices on Paper or send PDFs @@ -326,10 +328,9 @@ public class InvoicePrint extends SvrProcess + " INNER JOIN AD_Client c ON (i.AD_Client_ID=c.AD_Client_ID)" + " INNER JOIN AD_PrintForm pf ON (i.AD_Client_ID=pf.AD_Client_ID)" + " INNER JOIN C_DocType dt ON (i.C_DocType_ID=dt.C_DocType_ID)" - + " WHERE i.AD_Client_ID=? AND i.AD_Org_ID=? AND i.isSOTrx='Y' AND " + + " WHERE i.AD_Client_ID=? AND i.isSOTrx='Y' AND " + " pf.AD_Org_ID IN (0,i.AD_Org_ID) " ); // more them 1 PF params.add(Env.getAD_Client_ID(Env.getCtx())); - params.add(Env.getAD_Org_ID(Env.getCtx())); if (m_C_Invoice_ID != 0) { sql.append(" AND i.C_Invoice_ID=?"); params.add(m_C_Invoice_ID); @@ -377,6 +378,11 @@ public class InvoicePrint extends SvrProcess sql.append(" AND i.DocStatus IN ('CO','CL') "); } } + String orgWhere = MRole.getDefault(getCtx(), false).getOrgWhere(MRole.SQL_RO); + if (!Util.isEmpty(orgWhere, true)) { + sql.append(" AND i."); + sql.append(orgWhere); + } sql.append(" ORDER BY i.C_Invoice_ID, pf.AD_Org_ID DESC"); // more than 1 PF record } From 04d0310563e8dbf6fed4da40ad7998d1505d3308 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 7 Jan 2015 14:31:13 -0500 Subject: [PATCH 12/19] IDEMPIERE-1781 Error when try to change Invoiced mark in Event Windows / based on patch from hieplq --- .../oracle/201501071430_IDEMPIERE-1781.sql | 19 +++++++++++++++++++ .../201501071430_IDEMPIERE-1781.sql | 16 ++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 migration/i2.1/oracle/201501071430_IDEMPIERE-1781.sql create mode 100644 migration/i2.1/postgresql/201501071430_IDEMPIERE-1781.sql diff --git a/migration/i2.1/oracle/201501071430_IDEMPIERE-1781.sql b/migration/i2.1/oracle/201501071430_IDEMPIERE-1781.sql new file mode 100644 index 0000000000..c22d199b1a --- /dev/null +++ b/migration/i2.1/oracle/201501071430_IDEMPIERE-1781.sql @@ -0,0 +1,19 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Jan 7, 2015 2:25:11 PM COT +-- IDEMPIERE-1781:Error when try to change Invoiced mark in Event Windows +UPDATE AD_Column SET AD_Reference_ID=20, AD_Reference_Value_ID=NULL,Updated=TO_DATE('2015-01-07 14:25:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=13507 +; + +-- Jan 7, 2015 2:25:25 PM COT +UPDATE AD_Field SET AD_Reference_ID=17, AD_Reference_Value_ID=319,Updated=TO_DATE('2015-01-07 14:25:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11471 +; + +-- Jan 7, 2015 2:25:36 PM COT +UPDATE AD_Field SET AD_Reference_ID=17, AD_Reference_Value_ID=319,Updated=TO_DATE('2015-01-07 14:25:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11435 +; + +SELECT register_migration_script('201501071430_IDEMPIERE-1781.sql') FROM dual +; + diff --git a/migration/i2.1/postgresql/201501071430_IDEMPIERE-1781.sql b/migration/i2.1/postgresql/201501071430_IDEMPIERE-1781.sql new file mode 100644 index 0000000000..430c1ef39f --- /dev/null +++ b/migration/i2.1/postgresql/201501071430_IDEMPIERE-1781.sql @@ -0,0 +1,16 @@ +-- Jan 7, 2015 2:25:11 PM COT +-- IDEMPIERE-1781:Error when try to change Invoiced mark in Event Windows +UPDATE AD_Column SET AD_Reference_ID=20, AD_Reference_Value_ID=NULL,Updated=TO_TIMESTAMP('2015-01-07 14:25:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=13507 +; + +-- Jan 7, 2015 2:25:25 PM COT +UPDATE AD_Field SET AD_Reference_ID=17, AD_Reference_Value_ID=319,Updated=TO_TIMESTAMP('2015-01-07 14:25:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11471 +; + +-- Jan 7, 2015 2:25:36 PM COT +UPDATE AD_Field SET AD_Reference_ID=17, AD_Reference_Value_ID=319,Updated=TO_TIMESTAMP('2015-01-07 14:25:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11435 +; + +SELECT register_migration_script('201501071430_IDEMPIERE-1781.sql') FROM dual +; + From afcfc0b1a640fea0c0bac46141adec82441e46be Mon Sep 17 00:00:00 2001 From: hieplq Date: Fri, 18 Jul 2014 15:17:20 +0700 Subject: [PATCH 13/19] IDEMPIERE-2046:Info Window - Row selection selects hidden page row too --- .../WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java index 5676622df4..cb9b78b7f7 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java @@ -1349,7 +1349,7 @@ public abstract class InfoPanel extends Window implements EventListener, model.setMultiple(p_multipleSelection); contentPanel.setData(model, null); - contentPanel.setSelectedIndex(0); + //contentPanel.setSelectedIndex(0); } } else if (event.getName().equals(Events.ON_CHANGE)) From f93bc28a0d593c4f5d8199120dc512a7c4ac99ac Mon Sep 17 00:00:00 2001 From: hieplq Date: Thu, 8 Jan 2015 02:14:33 +0700 Subject: [PATCH 14/19] IDEMPIERE-2148:Cant add fields over Grid Sequence fields in window column customisation --- .../src/org/compiere/model/GridField.java | 4 +- .../adwindow/AbstractADWindowContent.java | 5 ++ .../webui/adwindow/GridTabRowRenderer.java | 67 ++++++++++++++----- .../adempiere/webui/adwindow/GridView.java | 26 +++++-- .../webui/panel/CustomizeGridViewPanel.java | 57 ++++++++-------- .../webui/window/CustomizeGridViewDialog.java | 1 + 6 files changed, 107 insertions(+), 53 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/GridField.java b/org.adempiere.base/src/org/compiere/model/GridField.java index 354e2ca333..595bcdb2d5 100644 --- a/org.adempiere.base/src/org/compiere/model/GridField.java +++ b/org.adempiere.base/src/org/compiere/model/GridField.java @@ -511,9 +511,7 @@ public class GridField if (checkContext && getGridTab() != null && !Env.getContext(ctx, m_vo.WindowNo,m_vo.TabNo, "IsActive").equals("Y")) return false; - // ultimately visibility decides - if(isGrid) - return isDisplayedGrid(); + return isDisplayed (ctx, checkContext); } // isEditable diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java index 4cc8dc70f3..15df4f3a34 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java @@ -3101,6 +3101,8 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements } /** + * show dialog to customize fields (hidden, display, order of field) in grid mode + * @see CustomizeGridViewDialog * @see ToolbarListener#onCustomize() */ public void onCustomize() { @@ -3111,6 +3113,9 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements Map columnsWidth = new HashMap(); ArrayList gridFieldIds = new ArrayList(); for (int i = 0; i < fields.length; i++) { + // 2 is offset of num of column in grid view and actual data fields. + // in grid view, add two function column, indicator column and selection (checkbox) column + // @see GridView#setupColumns Column column = (Column) columnList.get(i+2); String width = column.getWidth(); columnsWidth.put(fields[i].getAD_Field_ID(), width); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridTabRowRenderer.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridTabRowRenderer.java index d7210202a7..de637b5285 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridTabRowRenderer.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridTabRowRenderer.java @@ -94,7 +94,11 @@ public class GridTabRowRenderer implements RowRenderer, RowRendererExt private int currentRowIndex = -1; private AbstractADWindowContent m_windowPanel; private ActionListener buttonListener; - + /** + * Flag detect this view has customized column or not + * value is set at {@link #render(Row, Object[], int)} + */ + private boolean isGridViewCustomized = false; /** DefaultFocusField */ private WEditor defaultFocusField = null; @@ -164,14 +168,33 @@ public class GridTabRowRenderer implements RowRenderer, RowRendererExt return checkBox; } - private String getDisplayText(Object value, GridField gridField, int rowIndex) + /** + * call {@link #getDisplayText(Object, GridField, int, boolean)} with isForceGetValue = false + * @param value + * @param gridField + * @param rowIndex + * @return + */ + private String getDisplayText(Object value, GridField gridField, int rowIndex){ + return getDisplayText(value, gridField, rowIndex, false); + } + + /** + * Get display text of a field. when field have isDisplay = false always return empty string, except isForceGetValue = true + * @param value + * @param gridField + * @param rowIndex + * @param isForceGetValue + * @return + */ + private String getDisplayText(Object value, GridField gridField, int rowIndex, boolean isForceGetValue) { if (value == null) return ""; if (rowIndex >= 0) { GridRowCtx gridRowCtx = new GridRowCtx(Env.getCtx(), gridTab, rowIndex); - if (!gridField.isDisplayed(gridRowCtx, true)) { + if (!isForceGetValue && !gridField.isDisplayed(gridRowCtx, true)) { return ""; } } @@ -188,8 +211,18 @@ public class GridTabRowRenderer implements RowRenderer, RowRendererExt else return value.toString(); } - - private Component getDisplayComponent(int rowIndex, Object value, GridField gridField) { + + /** + * get component to display value of a field. + * when display is boolean or button, return correspond component + * other return a label with text get from {@link #getDisplayText(Object, GridField, int, boolean)} + * @param rowIndex + * @param value + * @param gridField + * @param isForceGetValue + * @return + */ + private Component getDisplayComponent(int rowIndex, Object value, GridField gridField, boolean isForceGetValue) { Component component; if (gridField.getDisplayType() == DisplayType.YesNo) { component = createReadonlyCheckbox(value); @@ -202,7 +235,7 @@ public class GridTabRowRenderer implements RowRenderer, RowRendererExt editor.addActionListener(buttonListener); component = editor.getComponent(); } else { - String text = getDisplayText(value, gridField, rowIndex); + String text = getDisplayText(value, gridField, rowIndex, isForceGetValue); Label label = new Label(); setLabelText(text, label); @@ -315,7 +348,6 @@ public class GridTabRowRenderer implements RowRenderer, RowRendererExt int columnCount = 0; GridField[] gridPanelFields = null; GridField[] gridTabFields = null; - boolean isGridViewCustomized = false; if (gridPanel != null) { if (!gridPanel.isVisible()) { @@ -426,7 +458,8 @@ public class GridTabRowRenderer implements RowRenderer, RowRendererExt } } - if (!gridPanelFields[i].isDisplayedGrid() || gridPanelFields[i].isToolbarButton()) { + // IDEMPIERE-2148: when has tab customize, ignore check properties isDisplayedGrid + if ((!isGridViewCustomized && gridPanelFields[i].isDisplayedGrid()) || gridPanelFields[i].isToolbarButton()) { continue; } colIndex ++; @@ -435,7 +468,7 @@ public class GridTabRowRenderer implements RowRenderer, RowRendererExt String divStyle = CELL_DIV_STYLE; org.zkoss.zul.Column column = (org.zkoss.zul.Column) columns.getChildren().get(colIndex); if (column.isVisible()) { - Component component = getDisplayComponent(rowIndex, currentValues[i], gridPanelFields[i]); + Component component = getDisplayComponent(rowIndex, currentValues[i], gridPanelFields[i], isGridViewCustomized); div.appendChild(component); div.setAttribute("display.component", component); @@ -445,8 +478,12 @@ public class GridTabRowRenderer implements RowRenderer, RowRendererExt else if (DisplayType.isNumeric(gridPanelFields[i].getDisplayType())) { divStyle = CELL_DIV_STYLE_ALIGN_RIGHT; } + GridRowCtx ctx = new GridRowCtx(Env.getCtx(), gridTab, rowIndex); - component.setVisible(gridPanelFields[i].isDisplayed(ctx, true)); + if (!gridPanelFields[i].isDisplayed(ctx, true)){ + // IDEMPIERE-2253 + div.removeChild(component); + } } div.setStyle(divStyle); div.setWidth("100%"); @@ -553,7 +590,7 @@ public class GridTabRowRenderer implements RowRenderer, RowRendererExt //skip selection and indicator column int colIndex = 1; for (int i = 0; i < columnCount; i++) { - if (!gridPanelFields[i].isDisplayedGrid() || gridPanelFields[i].isToolbarButton()) { + if ((!isGridViewCustomized && !gridPanelFields[i].isDisplayedGrid()) || gridPanelFields[i].isToolbarButton()) { continue; } colIndex ++; @@ -584,11 +621,11 @@ public class GridTabRowRenderer implements RowRenderer, RowRendererExt Properties ctx = isDetailPane() ? new GridRowCtx(Env.getCtx(), gridTab, gridTab.getCurrentRow()) : gridPanelFields[i].getVO().ctx; //check context - if (!gridPanelFields[i].isDisplayedGrid() || - !gridPanelFields[i].isDisplayed(ctx, true)) - { - editor.setVisible(false); + if (!gridPanelFields[i].isDisplayed(ctx, true)){ + // IDEMPIERE-2253 + div.removeChild(editor.getComponent()); } + editor.setReadWrite(gridPanelFields[i].isEditableGrid(true)); } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java index b13954748e..33dcee6587 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java @@ -97,6 +97,10 @@ public class GridView extends Vbox implements EventListener, IdSpace, IFi private int pageSize = DEFAULT_PAGE_SIZE; + /** + * list field display in grid mode, in case user customize grid + * this list container only customize list. + */ private GridField[] gridField; private AbstractTableModel tableModel; @@ -129,6 +133,8 @@ public class GridView extends Vbox implements EventListener, IdSpace, IFi private boolean detailPaneMode; protected Checkbox selectAll; + + boolean isHasCustomizeData = false; public GridView() { @@ -245,7 +251,7 @@ public class GridView extends Vbox implements EventListener, IdSpace, IFi parent = parent.getParent(); } } - + private void setupFields(GridTab gridTab) { this.gridTab = gridTab; gridTab.addStateChangeListener(this); @@ -254,8 +260,9 @@ public class GridView extends Vbox implements EventListener, IdSpace, IFi columnWidthMap = new HashMap(); GridField[] tmpFields = ((GridTable)tableModel).getFields(); MTabCustomization tabCustomization = MTabCustomization.get(Env.getCtx(), Env.getAD_User_ID(Env.getCtx()), gridTab.getAD_Tab_ID(), null); - if (tabCustomization != null && tabCustomization.getAD_Tab_Customization_ID() > 0 - && tabCustomization.getCustom() != null && tabCustomization.getCustom().trim().length() > 0) { + isHasCustomizeData = tabCustomization != null && tabCustomization.getAD_Tab_Customization_ID() > 0 + && tabCustomization.getCustom() != null && tabCustomization.getCustom().trim().length() > 0; + if (isHasCustomizeData) { String custom = tabCustomization.getCustom().trim(); String[] customComponent = custom.split(";"); String[] fieldIds = customComponent[0].split("[,]"); @@ -266,7 +273,8 @@ public class GridView extends Vbox implements EventListener, IdSpace, IFi int AD_Field_ID = Integer.parseInt(fieldIdStr); for(GridField gridField : tmpFields) { if (gridField.getAD_Field_ID() == AD_Field_ID) { - if(gridField.isDisplayedGrid() && !gridField.isToolbarButton()) + // IDEMPIERE-2204 add field in tabCustomization list to display list event this field have showInGrid = false + if((gridField.isDisplayedGrid() || gridField.isDisplayed()) && !gridField.isToolbarButton()) fieldList.add(gridField); break; @@ -477,9 +485,11 @@ public class GridView extends Vbox implements EventListener, IdSpace, IFi Map colnames = new HashMap(); int index = 0; + for (int i = 0; i < numColumns; i++) { - if (gridField[i].isDisplayedGrid() && !gridField[i].isToolbarButton()) + // IDEMPIERE-2148: when has tab customize, ignore check properties isDisplayedGrid + if ((isHasCustomizeData || gridField[i].isDisplayedGrid()) && !gridField[i].isToolbarButton()) { colnames.put(index, gridField[i].getHeader()); index++; @@ -959,7 +969,7 @@ public class GridView extends Vbox implements EventListener, IdSpace, IFi Properties ctx = isDetailPane() ? new GridRowCtx(Env.getCtx(), gridTab, gridTab.getCurrentRow()) : mField.getVO().ctx; - comp.setVisible(mField.isDisplayedGrid() && mField.isDisplayed(ctx, true)); + comp.setVisible((isHasCustomizeData || mField.isDisplayedGrid()) && mField.isDisplayed(ctx, true)); } } } @@ -1044,6 +1054,10 @@ public class GridView extends Vbox implements EventListener, IdSpace, IFi updateModel(); } + /** + * list field display in grid mode, in case user customize grid + * this list container only customize list. + */ public GridField[] getFields() { return gridField; } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/CustomizeGridViewPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/CustomizeGridViewPanel.java index 77c7fb7d21..45ccebcbe4 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/CustomizeGridViewPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/CustomizeGridViewPanel.java @@ -16,9 +16,6 @@ *****************************************************************************/ package org.adempiere.webui.panel; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -27,6 +24,7 @@ import java.util.Map; import java.util.Set; import java.util.logging.Level; +import org.adempiere.exceptions.DBException; import org.adempiere.model.MTabCustomization; import org.adempiere.webui.LayoutUtils; import org.adempiere.webui.adwindow.GridView; @@ -43,9 +41,12 @@ import org.adempiere.webui.component.SimpleListModel; import org.adempiere.webui.factory.ButtonFactory; import org.adempiere.webui.theme.ThemeManager; import org.adempiere.webui.window.FDialog; +import org.compiere.model.MField; import org.compiere.model.MRefList; +import org.compiere.model.MRole; +import org.compiere.model.MTab; +import org.compiere.model.Query; import org.compiere.util.CLogger; -import org.compiere.util.DB; import org.compiere.util.Env; import org.compiere.util.Msg; import org.compiere.util.NamePair; @@ -295,27 +296,31 @@ public class CustomizeGridViewPanel extends Panel yesModel.removeAllElements(); noModel.removeAllElements(); boolean baseLanguage = Env.isBaseLanguage(Env.getCtx(), "AD_Field"); - String sql; - if (baseLanguage) - sql = "SELECT f.AD_Field_ID,f.Name FROM AD_Field f WHERE f.AD_Tab_ID=? AND (f.IsDisplayed='Y' OR f.IsDisplayedGrid='Y') AND f.IsActive='Y' ORDER BY f.SeqNoGrid,f.Name,f.SeqNo"; - else - sql = "SELECT f.AD_Field_ID,trl.Name FROM AD_Field f JOIN AD_Field_Trl trl ON (f.AD_Field_ID = trl.AD_Field_ID)" - + " WHERE f.AD_Tab_ID=? AND (f.IsDisplayed='Y' OR f.IsDisplayedGrid='Y') AND f.IsActive='Y' AND trl.AD_Language=? ORDER BY f.SeqNoGrid,f.Name,f.SeqNo"; - PreparedStatement pstmt = null; - ResultSet rs = null; + Query query = null; + + query = new Query(Env.getCtx(), MField.Table_Name, "AD_Tab_ID=? AND (IsDisplayed='Y' OR IsDisplayedGrid='Y') AND IsActive='Y'", null); + query.setOrderBy("SeqNoGrid, Name, SeqNo"); + query.setParameters(new Object [] {m_AD_Tab_ID}); + query.setApplyAccessFilter(true); + try { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, m_AD_Tab_ID); - if (!baseLanguage) - pstmt.setString(2, Env.getAD_Language(Env.getCtx())); - rs = pstmt.executeQuery(); - + List lsFieldsOfGrid = query.list(); HashMap curTabSel = new HashMap(); - while (rs.next()) + MTab tab = new MTab(Env.getCtx(), m_AD_Tab_ID, null); + + for (MField field : lsFieldsOfGrid) { - int key = rs.getInt(1); - String name = rs.getString(2); + if (!MRole.getDefault(Env.getCtx(), false).isColumnAccess(tab.getAD_Table_ID(), field.getAD_Column_ID(), true)) + continue; + + int key = field.get_ID(); + String name = null; + if (baseLanguage) + name = field.getName(); + else + name = field.get_Translation(MField.COLUMNNAME_Name); + ListElement pp = new ListElement(key, name); if (tableSeqs != null && tableSeqs.size() > 0 ) { if (tableSeqs.contains(key)) { @@ -335,16 +340,10 @@ public class CustomizeGridViewPanel extends Panel } } } - catch (SQLException e) + catch (DBException e) { - log.log(Level.SEVERE, sql.toString(), e); + log.log(Level.SEVERE, e.getMessage(), e); } - finally - { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } - bAdd.setEnabled(true); bRemove.setEnabled(true); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/CustomizeGridViewDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/CustomizeGridViewDialog.java index 9e32cc83a3..b258a51500 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/CustomizeGridViewDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/CustomizeGridViewDialog.java @@ -61,6 +61,7 @@ public class CustomizeGridViewDialog extends Window { * @param WindowNo window no * @param AD_Tab_ID * @param columnsWidth + * @param gridFieldIds list fieldId current display in gridview */ public static boolean showCustomize (int WindowNo, int AD_Tab_ID, Map columnsWidth,ArrayList gridFieldIds,GridView gridPanel) { From f4f317c3adabefec4476aee9756b6b25a3306dea Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 7 Jan 2015 15:06:51 -0500 Subject: [PATCH 15/19] IDEMPIERE-2148:Cant add fields over Grid Sequence fields in window column customisation / minor peer review --- .../src/org/adempiere/webui/adwindow/GridView.java | 10 +++++----- .../adempiere/webui/panel/CustomizeGridViewPanel.java | 2 +- .../webui/window/CustomizeGridViewDialog.java | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java index 33dcee6587..e73840e1f7 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java @@ -72,17 +72,17 @@ import org.zkoss.zul.impl.CustomGridDataLoader; */ public class GridView extends Vbox implements EventListener, IdSpace, IFieldEditorContainer, StateChangeListener { + /** + * + */ + private static final long serialVersionUID = -2966799998482667434L; + private static final String HEADER_GRID_STYLE = "border: none; margin:0; padding: 0;"; private static final int DEFAULT_DETAIL_PAGE_SIZE = 10; private static final int DEFAULT_PAGE_SIZE = 20; - /** - * generated serial version ID - */ - private static final long serialVersionUID = -7151423393713654553L; - private static final int MIN_COLUMN_WIDTH = 100; private static final int MAX_COLUMN_WIDTH = 300; diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/CustomizeGridViewPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/CustomizeGridViewPanel.java index 45ccebcbe4..0517c72fa8 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/CustomizeGridViewPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/CustomizeGridViewPanel.java @@ -73,7 +73,7 @@ public class CustomizeGridViewPanel extends Panel /** * */ - private static final long serialVersionUID = 1592146462575454625L; + private static final long serialVersionUID = -6300916636341781651L; private Map m_columnsWidth; ArrayList tableSeqs; diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/CustomizeGridViewDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/CustomizeGridViewDialog.java index b258a51500..bb7ea48928 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/CustomizeGridViewDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/CustomizeGridViewDialog.java @@ -62,6 +62,7 @@ public class CustomizeGridViewDialog extends Window { * @param AD_Tab_ID * @param columnsWidth * @param gridFieldIds list fieldId current display in gridview + * @param gridPanel */ public static boolean showCustomize (int WindowNo, int AD_Tab_ID, Map columnsWidth,ArrayList gridFieldIds,GridView gridPanel) { From c8f3a94f45cf0917976133a3306d1ef6ad83876e Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 9 Jan 2015 13:33:39 -0500 Subject: [PATCH 16/19] IDEMPIERE-1695 Errors on Invoice Not Realized Gain/Loss --- db/ddlutils/oracle/views/T_INVOICEGL_VT.sql | 137 ------------------ .../postgresql/views/T_INVOICEGL_VT.sql | 135 ----------------- .../oracle/201501091326_IDEMPIERE-1695.sql | 6 + .../201501091326_IDEMPIERE-1695.sql | 6 + .../src/org/compiere/process/InvoiceNGL.java | 122 +++++++++------- 5 files changed, 85 insertions(+), 321 deletions(-) delete mode 100644 db/ddlutils/oracle/views/T_INVOICEGL_VT.sql delete mode 100644 db/ddlutils/postgresql/views/T_INVOICEGL_VT.sql create mode 100644 migration/i2.1/oracle/201501091326_IDEMPIERE-1695.sql create mode 100644 migration/i2.1/postgresql/201501091326_IDEMPIERE-1695.sql diff --git a/db/ddlutils/oracle/views/T_INVOICEGL_VT.sql b/db/ddlutils/oracle/views/T_INVOICEGL_VT.sql deleted file mode 100644 index 0d78dd9a1b..0000000000 --- a/db/ddlutils/oracle/views/T_INVOICEGL_VT.sql +++ /dev/null @@ -1,137 +0,0 @@ -DROP VIEW t_invoicegl_vt; - -CREATE OR REPLACE VIEW t_invoicegl_vt -AS - SELECT i.ad_client_id, - i.ad_org_id, - i.isactive, - i.created, - i.createdby, - i.updated, - i.updatedby, - i.c_invoice_id, - i.issotrx, - i.documentno, - i.docstatus, - i.c_doctype_id, - i.c_order_id, - i.description, - i.salesrep_id, - i.dateinvoiced, - i.dateacct, - i.c_paymentterm_id, - i.c_bpartner_id, - i.c_bpartner_location_id, - i.ad_user_id, - i.isselfservice, - i.c_currency_id, - i.c_conversiontype_id, - i.grandtotal, - i.istaxincluded, - i.c_campaign_id, - i.c_project_id, - i.c_activity_id, - i.ad_orgtrx_id, - i.user1_id, - i.user2_id, - fa.c_locfrom_id, - fa.c_locto_id, - fa.c_salesregion_id, - fa.fact_acct_id, - fa.c_acctschema_id, - fa.account_id, - fa.c_period_id, - fa.gl_category_id, - fa.gl_budget_id, - fa.c_tax_id, - fa.m_locator_id, - fa.postingtype, - fa.amtsourcedr, - fa.amtsourcecr, - fa.amtacctdr, - fa.amtacctcr, - fa.c_uom_id, - fa.qty, - gl.ad_pinstance_id, - gl.apar, - gl.openamt, - gl.percent, - gl.amtrevaldr, - gl.amtrevalcr, - gl.datereval, - gl.c_conversiontypereval_id, - gl.amtsourcebalance, - gl.amtacctbalance, - gl.c_doctypereval_id, - gl.amtrevaldrdiff, - gl.amtrevalcrdiff, - gl.isallcurrencies, - fa.amtacctdr * gl.percent / 100 AS amtacctopendr, - fa.amtacctcr * gl.percent / 100 AS amtacctopencr, - ( fa.amtacctdr - fa.amtacctcr ) * gl.percent / 100 AS amtacctopenbalance, - gl.ad_org_id AS t_invoicegl_ad_org_id, - gl.c_invoice_id AS t_invoicegl_c_invoice_id, - gl.created AS t_invoicegl_created, - gl.createdby AS t_invoicegl_createdby, - gl.grandtotal AS t_invoicegl_grandtotal, - gl.isactive AS t_invoicegl_isactive, - gl.updated AS t_invoicegl_updated, - gl.updatedby AS t_invoicegl_updatedby, - i.c_charge_id AS c_invoice_c_charge_id, - i.c_doctypetarget_id, - i.c_dunninglevel_id, - i.chargeamt, - i.c_payment_id, - i.dateordered, - i.dateprinted, - i.docaction, - i.dunninggrace, - i.generateto, - i.invoicecollectiontype, - i.isapproved, - i.isdiscountprinted, - i.isindispute, - i.ispaid, - i.ispayschedulevalid, - i.isprinted, - i.istransferred, - i.m_pricelist_id, - i.m_rma_id, - i.paymentrule, - i.poreference, - i.posted, - i.processedon, - i.processing, - i.ref_invoice_id, - i.reversal_id, - i.sendemail, - i.totallines, - fa.a_asset_id, - fa.ad_org_id AS fact_acct_ad_org_id, - fa.ad_orgtrx_id AS fact_acct_ad_orgtrx_id, - fa.ad_table_id AS fact_acct_ad_table_id, - fa.c_activity_id AS fact_acct_c_activity_id, - fa.c_bpartner_id AS fact_acct_c_bpartner_id, - fa.c_campaign_id AS fact_acct_c_campaign_id, - fa.c_currency_id AS fact_acct_c_currency_id, - fa.c_subacct_id, - fa.dateacct AS fact_acct_dateacct, - fa.datetrx, - fa.description AS fact_acct_description, - fa.isactive AS fact_acct_isactive, - fa.line_id, - fa.m_product_id AS fact_acct_m_product_id, - fa.record_id, - fa.updated AS fact_acct_updated, - fa.updatedby AS fact_acct_updatedby, - fa.user1_id AS fact_acct_user1_id, - fa.user2_id AS fact_acct_user2_id, - fa.userelement1_id, - fa.userelement2_id - FROM t_invoicegl gl - JOIN c_invoice i - ON gl.c_invoice_id = i.c_invoice_id - JOIN fact_acct fa - ON gl.fact_acct_id = fa.fact_acct_id -; - diff --git a/db/ddlutils/postgresql/views/T_INVOICEGL_VT.sql b/db/ddlutils/postgresql/views/T_INVOICEGL_VT.sql deleted file mode 100644 index b23aa82ff4..0000000000 --- a/db/ddlutils/postgresql/views/T_INVOICEGL_VT.sql +++ /dev/null @@ -1,135 +0,0 @@ -DROP VIEW t_invoicegl_vt; - -CREATE OR REPLACE VIEW t_invoicegl_vt AS -SELECT i.ad_client_id, - i.ad_org_id, - i.isactive, - i.created, - i.createdby, - i.updated, - i.updatedby, - i.c_invoice_id, - i.issotrx, - i.documentno, - i.docstatus, - i.c_doctype_id, - i.c_order_id, - i.description, - i.salesrep_id, - i.dateinvoiced, - i.dateacct, - i.c_paymentterm_id, - i.c_bpartner_id, - i.c_bpartner_location_id, - i.ad_user_id, - i.isselfservice, - i.c_currency_id, - i.c_conversiontype_id, - i.grandtotal, - i.istaxincluded, - i.c_campaign_id, - i.c_project_id, - i.c_activity_id, - i.ad_orgtrx_id, - i.user1_id, - i.user2_id, - fa.c_locfrom_id, - fa.c_locto_id, - fa.c_salesregion_id, - fa.fact_acct_id, - fa.c_acctschema_id, - fa.account_id, - fa.c_period_id, - fa.gl_category_id, - fa.gl_budget_id, - fa.c_tax_id, - fa.m_locator_id, - fa.postingtype, - fa.amtsourcedr, - fa.amtsourcecr, - fa.amtacctdr, - fa.amtacctcr, - fa.c_uom_id, - fa.qty, - gl.ad_pinstance_id, - gl.apar, - gl.openamt, - gl.percent, - gl.amtrevaldr, - gl.amtrevalcr, - gl.datereval, - gl.c_conversiontypereval_id, - gl.amtsourcebalance, - gl.amtacctbalance, - gl.c_doctypereval_id, - gl.amtrevaldrdiff, - gl.amtrevalcrdiff, - gl.isallcurrencies, - fa.amtacctdr * gl.percent / 100 AS amtacctopendr, - fa.amtacctcr * gl.percent / 100 AS amtacctopencr, - (fa.amtacctdr - fa.amtacctcr) * gl.percent / 100 AS amtacctopenbalance, - gl.ad_org_id AS t_invoicegl_ad_org_id, - gl.c_invoice_id AS t_invoicegl_c_invoice_id, - gl.created AS t_invoicegl_created, - gl.createdby AS t_invoicegl_createdby, - gl.grandtotal AS t_invoicegl_grandtotal, - gl.isactive AS t_invoicegl_isactive, - gl.updated AS t_invoicegl_updated, - gl.updatedby AS t_invoicegl_updatedby, - i.c_charge_id AS c_invoice_c_charge_id, - i.c_doctypetarget_id, - i.c_dunninglevel_id, - i.chargeamt, - i.c_payment_id, - i.dateordered, - i.dateprinted, - i.docaction, - i.dunninggrace, - i.generateto, - i.invoicecollectiontype, - i.isapproved, - i.isdiscountprinted, - i.isindispute, - i.ispaid, - i.ispayschedulevalid, - i.isprinted, - i.istransferred, - i.m_pricelist_id, - i.m_rma_id, - i.paymentrule, - i.poreference, - i.posted, - i.processedon, - i.processing, - i.ref_invoice_id, - i.reversal_id, - i.sendemail, - i.totallines, - fa.a_asset_id, - fa.ad_org_id AS fact_acct_ad_org_id, - fa.ad_orgtrx_id AS fact_acct_ad_orgtrx_id, - fa.ad_table_id AS fact_acct_ad_table_id, - fa.c_activity_id AS fact_acct_c_activity_id, - fa.c_bpartner_id AS fact_acct_c_bpartner_id, - fa.c_campaign_id AS fact_acct_c_campaign_id, - fa.c_currency_id AS fact_acct_c_currency_id, - fa.c_subacct_id, - fa.dateacct AS fact_acct_dateacct, - fa.datetrx, - fa.description AS fact_acct_description, - fa.isactive AS fact_acct_isactive, - fa.line_id, - fa.m_product_id AS fact_acct_m_product_id, - fa.record_id, - fa.updated AS fact_acct_updated, - fa.updatedby AS fact_acct_updatedby, - fa.user1_id AS fact_acct_user1_id, - fa.user2_id AS fact_acct_user2_id, - fa.userelement1_id, - fa.userelement2_id -FROM t_invoicegl gl - JOIN c_invoice i - ON gl.c_invoice_id = i.c_invoice_id - JOIN fact_acct fa - ON gl.fact_acct_id = fa.fact_acct_id -; diff --git a/migration/i2.1/oracle/201501091326_IDEMPIERE-1695.sql b/migration/i2.1/oracle/201501091326_IDEMPIERE-1695.sql new file mode 100644 index 0000000000..04bb8d2e35 --- /dev/null +++ b/migration/i2.1/oracle/201501091326_IDEMPIERE-1695.sql @@ -0,0 +1,6 @@ +drop view t_invoicegl_vt +; + +SELECT register_migration_script('201501091326_IDEMPIERE-1695.sql') FROM dual +; + diff --git a/migration/i2.1/postgresql/201501091326_IDEMPIERE-1695.sql b/migration/i2.1/postgresql/201501091326_IDEMPIERE-1695.sql new file mode 100644 index 0000000000..04bb8d2e35 --- /dev/null +++ b/migration/i2.1/postgresql/201501091326_IDEMPIERE-1695.sql @@ -0,0 +1,6 @@ +drop view t_invoicegl_vt +; + +SELECT register_migration_script('201501091326_IDEMPIERE-1695.sql') FROM dual +; + diff --git a/org.adempiere.base.process/src/org/compiere/process/InvoiceNGL.java b/org.adempiere.base.process/src/org/compiere/process/InvoiceNGL.java index 2c69f479e4..3564abc424 100644 --- a/org.adempiere.base.process/src/org/compiere/process/InvoiceNGL.java +++ b/org.adempiere.base.process/src/org/compiere/process/InvoiceNGL.java @@ -29,7 +29,6 @@ import org.compiere.model.MFactAcct; import org.compiere.model.MGLCategory; import org.compiere.model.MInvoice; import org.compiere.model.MJournal; -import org.compiere.model.MJournalBatch; import org.compiere.model.MJournalLine; import org.compiere.model.MOrg; import org.compiere.model.Query; @@ -147,7 +146,7 @@ public class InvoiceNGL extends SvrProcess .append(" AND EXISTS (SELECT * FROM C_ElementValue ev ") .append("WHERE ev.C_ElementValue_ID=fa.Account_ID AND (ev.AccountType='A' OR ev.AccountType='L'))") .append(" AND fa.C_AcctSchema_ID=").append(p_C_AcctSchema_ID); - if (!p_IsAllCurrencies) + if (p_IsAllCurrencies) sql.append(" AND i.C_Currency_ID<>a.C_Currency_ID"); if (ONLY_AR.equals(p_APAR)) sql.append(" AND i.IsSOTrx='Y'"); @@ -238,19 +237,23 @@ public class InvoiceNGL extends SvrProcess cat = MGLCategory.get(getCtx(), docType.getGL_Category_ID()); } // - MJournalBatch batch = new MJournalBatch(getCtx(), 0, get_TrxName()); - batch.setDescription (getName()); - batch.setC_DocType_ID(p_C_DocTypeReval_ID); - batch.setDateDoc(new Timestamp(System.currentTimeMillis())); - batch.setDateAcct(p_DateReval); - batch.setC_Currency_ID(as.getC_Currency_ID()); - if (!batch.save()) - return " - Could not create Batch"; - // - MJournal journal = null; - BigDecimal drTotal = Env.ZERO; - BigDecimal crTotal = Env.ZERO; + MJournal journal = new MJournal (getCtx(), 0, get_TrxName()); + journal.setC_DocType_ID(p_C_DocTypeReval_ID); + journal.setPostingType(MJournal.POSTINGTYPE_Actual); + journal.setDateDoc(new Timestamp(System.currentTimeMillis())); + journal.setDateAcct(p_DateReval); // sets the period too + journal.setC_Currency_ID(as.getC_Currency_ID()); + journal.setC_AcctSchema_ID (as.getC_AcctSchema_ID()); + journal.setC_ConversionType_ID(p_C_ConversionTypeReval_ID); + journal.setGL_Category_ID (cat.getGL_Category_ID()); + journal.setDescription(getName()); // updated below + if (!journal.save()) + return " - Could not create Journal"; + // + BigDecimal gainTotal = Env.ZERO; + BigDecimal lossTotal = Env.ZERO; int AD_Org_ID = 0; + MOrg org = null; for (int i = 0; i < list.size(); i++) { X_T_InvoiceGL gl = list.get(i); @@ -265,65 +268,86 @@ public class InvoiceNGL extends SvrProcess // Change in Org if (AD_Org_ID != gl.getAD_Org_ID()) { - createBalancing (asDefaultAccts, journal, drTotal, crTotal, AD_Org_ID, (i+1) * 10); + createBalancing (asDefaultAccts, journal, gainTotal, lossTotal, AD_Org_ID, (i+1) * 10); // AD_Org_ID = gl.getAD_Org_ID(); - drTotal = Env.ZERO; - crTotal = Env.ZERO; + gainTotal = Env.ZERO; + lossTotal = Env.ZERO; journal = null; - } - // - if (journal == null) - { - journal = new MJournal (batch); - journal.setC_AcctSchema_ID (as.getC_AcctSchema_ID()); - journal.setC_Currency_ID(as.getC_Currency_ID()); - journal.setC_ConversionType_ID(p_C_ConversionTypeReval_ID); - MOrg org = MOrg.get(getCtx(), gl.getAD_Org_ID()); - journal.setDescription (getName() + " - " + org.getName()); - journal.setGL_Category_ID (cat.getGL_Category_ID()); - if (!journal.save()) - return " - Could not create Journal"; + } + // + if (org == null) { + org = MOrg.get(getCtx(), gl.getAD_Org_ID()); + journal.setDescription (getName() + " - " + org.getName()); + if (!journal.save()) + return " - Could not set Description for Journal"; } // MJournalLine line = new MJournalLine(journal); line.setLine((i+1) * 10); line.setDescription(invoice.getSummary()); // - MFactAcct fa = new MFactAcct (getCtx(), gl.getFact_Acct_ID(), null); - line.setC_ValidCombination_ID(MAccount.get(fa)); + MFactAcct fa = new MFactAcct (getCtx(), gl.getFact_Acct_ID(), null); + MAccount acct = MAccount.get(fa); + line.setC_ValidCombination_ID(acct); BigDecimal dr = gl.getAmtRevalDrDiff(); - BigDecimal cr = gl.getAmtRevalCrDiff(); - drTotal = drTotal.add(dr); - crTotal = crTotal.add(cr); + BigDecimal cr = gl.getAmtRevalCrDiff(); + // Check if acct.IsActiva to differentiate gain and loss -> + // acct.isActiva negative dr or positive cr -> loss + // acct.isActiva positive dr or negative cr -> gain + // acct.isPassiva negative cr or positive dr -> gain + // acct.isPassiva positive cr or negative dr -> loss + if (acct.isActiva()) { + if (dr.signum() < 0) { + lossTotal = lossTotal.add(dr.negate()); + } else if (dr.signum() > 0) { + gainTotal = gainTotal.add(dr); + } + if (cr.signum() > 0) { + lossTotal = lossTotal.add(cr); + } if (cr.signum() < 0) { + gainTotal = gainTotal.add(cr.negate()); + } + } else { // isPassiva + if (cr.signum() < 0) { + gainTotal = gainTotal.add(cr.negate()); + } else if (cr.signum() > 0) { + lossTotal = lossTotal.add(cr); + } + if (dr.signum() > 0) { + gainTotal = gainTotal.add(dr); + } else if (dr.signum() < 0) { + lossTotal = lossTotal.add(dr.negate()); + } + } line.setAmtSourceDr (dr); line.setAmtAcctDr (dr); line.setAmtSourceCr (cr); line.setAmtAcctCr (cr); line.saveEx(); } - createBalancing (asDefaultAccts, journal, drTotal, crTotal, AD_Org_ID, (list.size()+1) * 10); - - StringBuilder msgreturn = new StringBuilder(" - ").append(batch.getDocumentNo()).append(" #").append(list.size()); - return msgreturn.toString(); + createBalancing (asDefaultAccts, journal, gainTotal, lossTotal, AD_Org_ID, (list.size()+1) * 10); + + StringBuilder msgreturn = new StringBuilder(" - ").append(journal.getDocumentNo()).append(" #").append(list.size()); + addLog(journal.getGL_Journal_ID(), null, null, msgreturn.toString(), MJournal.Table_ID, journal.getGL_Journal_ID()); + return "OK"; } // createGLJournal /** * Create Balancing Entry * @param asDefaultAccts acct schema default accounts * @param journal journal - * @param drTotal dr - * @param crTotal cr + * @param gainTotal dr + * @param lossTotal cr * @param AD_Org_ID org * @param lineNo base line no */ private void createBalancing (MAcctSchemaDefault asDefaultAccts, MJournal journal, - BigDecimal drTotal, BigDecimal crTotal, int AD_Org_ID, int lineNo) + BigDecimal gainTotal, BigDecimal lossTotal, int AD_Org_ID, int lineNo) { if (journal == null) - throw new IllegalArgumentException("Jornal is null"); // CR Entry = Gain - if (drTotal.signum() != 0) + if (gainTotal.signum() != 0) { MJournalLine line = new MJournalLine(journal); line.setLine(lineNo+1); @@ -337,12 +361,12 @@ public class InvoiceNGL extends SvrProcess get_TrxName()); line.setDescription(Msg.getElement(getCtx(), "UnrealizedGain_Acct")); line.setC_ValidCombination_ID(acct.getC_ValidCombination_ID()); - line.setAmtSourceCr (drTotal); - line.setAmtAcctCr (drTotal); + line.setAmtSourceCr (gainTotal); + line.setAmtAcctCr (gainTotal); line.saveEx(); } // DR Entry = Loss - if (crTotal.signum() != 0) + if (lossTotal.signum() != 0) { MJournalLine line = new MJournalLine(journal); line.setLine(lineNo+2); @@ -356,8 +380,8 @@ public class InvoiceNGL extends SvrProcess get_TrxName()); line.setDescription(Msg.getElement(getCtx(), "UnrealizedLoss_Acct")); line.setC_ValidCombination_ID(acct.getC_ValidCombination_ID()); - line.setAmtSourceDr (crTotal); - line.setAmtAcctDr (crTotal); + line.setAmtSourceDr (lossTotal); + line.setAmtAcctDr (lossTotal); line.saveEx(); } } // createBalancing From 97f3b075354ef5f9f7b2c39b763fc5f8a825f718 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 9 Jan 2015 14:27:29 -0500 Subject: [PATCH 17/19] IDEMPIERE-1695 Errors on Invoice Not Realized Gain/Loss --- migration/i2.1/oracle/201501091412_IDEMPIERE-1695.sql | 11 +++++++++++ .../i2.1/postgresql/201501091412_IDEMPIERE-1695.sql | 8 ++++++++ .../src/org/compiere/process/InvoiceNGL.java | 3 ++- 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 migration/i2.1/oracle/201501091412_IDEMPIERE-1695.sql create mode 100644 migration/i2.1/postgresql/201501091412_IDEMPIERE-1695.sql diff --git a/migration/i2.1/oracle/201501091412_IDEMPIERE-1695.sql b/migration/i2.1/oracle/201501091412_IDEMPIERE-1695.sql new file mode 100644 index 0000000000..fbdd928810 --- /dev/null +++ b/migration/i2.1/oracle/201501091412_IDEMPIERE-1695.sql @@ -0,0 +1,11 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Jan 9, 2015 2:12:28 PM COT +-- IDEMPIERE-1298 2Pack: Support copying of data from one client to another +UPDATE AD_Process_Para SET AD_Val_Rule_ID=102,Updated=TO_DATE('2015-01-09 14:12:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=644 +; + +SELECT register_migration_script('201501091412_IDEMPIERE-1695.sql') FROM dual +; + diff --git a/migration/i2.1/postgresql/201501091412_IDEMPIERE-1695.sql b/migration/i2.1/postgresql/201501091412_IDEMPIERE-1695.sql new file mode 100644 index 0000000000..847eb4f36f --- /dev/null +++ b/migration/i2.1/postgresql/201501091412_IDEMPIERE-1695.sql @@ -0,0 +1,8 @@ +-- Jan 9, 2015 2:12:28 PM COT +-- IDEMPIERE-1298 2Pack: Support copying of data from one client to another +UPDATE AD_Process_Para SET AD_Val_Rule_ID=102,Updated=TO_TIMESTAMP('2015-01-09 14:12:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=644 +; + +SELECT register_migration_script('201501091412_IDEMPIERE-1695.sql') FROM dual +; + diff --git a/org.adempiere.base.process/src/org/compiere/process/InvoiceNGL.java b/org.adempiere.base.process/src/org/compiere/process/InvoiceNGL.java index 3564abc424..a253180bc0 100644 --- a/org.adempiere.base.process/src/org/compiere/process/InvoiceNGL.java +++ b/org.adempiere.base.process/src/org/compiere/process/InvoiceNGL.java @@ -240,7 +240,7 @@ public class InvoiceNGL extends SvrProcess MJournal journal = new MJournal (getCtx(), 0, get_TrxName()); journal.setC_DocType_ID(p_C_DocTypeReval_ID); journal.setPostingType(MJournal.POSTINGTYPE_Actual); - journal.setDateDoc(new Timestamp(System.currentTimeMillis())); + journal.setDateDoc(p_DateReval); journal.setDateAcct(p_DateReval); // sets the period too journal.setC_Currency_ID(as.getC_Currency_ID()); journal.setC_AcctSchema_ID (as.getC_AcctSchema_ID()); @@ -346,6 +346,7 @@ public class InvoiceNGL extends SvrProcess BigDecimal gainTotal, BigDecimal lossTotal, int AD_Org_ID, int lineNo) { if (journal == null) + throw new IllegalArgumentException("Journal is null"); // CR Entry = Gain if (gainTotal.signum() != 0) { From 53f2daccba2aa23f718562a0f58c4d0926fea738 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 9 Jan 2015 20:44:25 +0000 Subject: [PATCH 18/19] README.md edited online with Bitbucket --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000000..9131db14e5 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +IDEMPIERE IS A COMMUNITY PROJECT THAT RESPECTS AND PROTECTS CONTRIBUTIONS AND MAINTAINS ALL CREDITS IN PLACE HERE IN ITS OFFICIAL REPOSITORY. ALSO WE OBEY THE GPL LAW THAT BASICALLY SAYS 'YOU ARE FREE TO MODIFY THE SOURCE BUT SHARE BACK THE CHANGES'. IF NOT KINDLY INFORM US. (Please write to red1@red1.org). +HOWEVER ALL SOURCE GOES THROUGH STRICT PEER REVIEW BEFORE MAKING IT TO THE CORE. (Please check http://ci.idempiere.org/) + +AS WE ARE USING THE OSGI PLUGIN APPROACH, A MARKETPLACE OF INDEPENDENT PLUGINS THAT ARE LOOSELY COUPLED TO THE CORE IS NOW POSSIBLE WITHOUT IMPACTING THE CORE THUS REDUCING ITS BLOAT (Please do so at http://wiki.idempiere.org/en/Category:Available_Plugins) + +WE WORK WELL DOCUMENTING ISSUES (Please do so at https://idempiere.atlassian.net/secure/Dashboard.jspa) + +ALL COMMUNICATION REGARDING CODE IS APPRECIATED AT https://groups.google.com/forum/#!forum/idempiere. + +COMMUNITY LEADER +Redhuan D. Oon \ No newline at end of file From 53261a48710472d6fa024ec0e2753351edb324e4 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 9 Jan 2015 20:45:03 +0000 Subject: [PATCH 19/19] README.md edited online with Bitbucket --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9131db14e5..9c10322bdd 100644 --- a/README.md +++ b/README.md @@ -8,4 +8,5 @@ WE WORK WELL DOCUMENTING ISSUES (Please do so at https://idempiere.atlassian.net ALL COMMUNICATION REGARDING CODE IS APPRECIATED AT https://groups.google.com/forum/#!forum/idempiere. COMMUNITY LEADER -Redhuan D. Oon \ No newline at end of file + +Redhuan D. Oon \ No newline at end of file