IDEMPIERE-1697 Ability to filter available column for print format / peer review

This commit is contained in:
Carlos Ruiz 2014-07-02 10:18:30 -05:00
parent f4369874db
commit 1effd5918b
5 changed files with 12 additions and 11 deletions

View File

@ -19,11 +19,11 @@ INSERT INTO AD_Val_Rule (AD_Client_ID,AD_Org_ID,AD_Val_Rule_ID,AD_Val_Rule_UU,Co
;
-- Jan 17, 2014 7:57:32 PM CET
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,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,Description,EntityType,FKConstraintType,FieldLength,Help,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,210935,'e5fe354e-7566-4a08-a601-b0d97ca5f186',104,0,19,200109,200055,'AD_Column_ID',TO_DATE('2014-01-17 19:57:32','YYYY-MM-DD HH24:MI:SS'),100,'Column in the table','U','N',22,'Link to the database column of the table','Y','Y','Y','N','N','N','N','N','Y','Y','N','N','N','N','N','N','Column',0,0,TO_DATE('2014-01-17 19:57:32','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,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,Description,EntityType,FKConstraintType,FieldLength,Help,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,210935,'e5fe354e-7566-4a08-a601-b0d97ca5f186',104,0,19,200109,200055,'AD_Column_ID',TO_DATE('2014-01-17 19:57:32','YYYY-MM-DD HH24:MI:SS'),100,'Column in the table','D','N',22,'Link to the database column of the table','Y','Y','Y','N','N','N','N','N','Y','Y','N','N','N','N','N','N','Column',0,0,TO_DATE('2014-01-17 19:57:32','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- Jan 17, 2014 7:57:50 PM CET
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,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,210936,'60086644-8471-499c-bf88-44478e949c93',113,0,19,200109,148,'AD_Org_ID',TO_DATE('2014-01-17 19:57:50','YYYY-MM-DD HH24:MI:SS'),100,'@#AD_Org_ID@','Organizational entity within client','U',22,'An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','Y','N','Y','N','N','N','N','N','Y','N','N','N','N','N','N','N','Organization',0,0,TO_DATE('2014-01-17 19:57:50','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,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,210936,'60086644-8471-499c-bf88-44478e949c93',113,0,19,200109,148,'AD_Org_ID',TO_DATE('2014-01-17 19:57:50','YYYY-MM-DD HH24:MI:SS'),100,'@#AD_Org_ID@','Organizational entity within client','D',22,'An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','Y','N','Y','N','N','N','N','N','Y','N','N','N','N','N','N','N','Organization',0,0,TO_DATE('2014-01-17 19:57:50','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- Jan 17, 2014 7:58:03 PM CET
@ -43,7 +43,7 @@ UPDATE AD_Column SET EntityType='D', IsUpdateable='N',Updated=TO_DATE('2014-01-1
;
-- Jan 17, 2014 7:58:47 PM CET
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,Description,EntityType,FKConstraintType,FieldLength,Help,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,210938,'6d8f48d0-07e3-49c3-a0e6-5e5539279496',1252,0,30,200109,'AD_ReportView_ID',TO_DATE('2014-01-17 19:58:46','YYYY-MM-DD HH24:MI:SS'),100,'View used to generate this report','U','N',22,'The Report View indicates the view used to generate this report.','Y','Y','Y','N','N','N','N','N','Y','Y','N','N','N','N','N','N','Report View',0,0,TO_DATE('2014-01-17 19:58:46','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,Description,EntityType,FKConstraintType,FieldLength,Help,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,210938,'6d8f48d0-07e3-49c3-a0e6-5e5539279496',1252,0,30,200109,'AD_ReportView_ID',TO_DATE('2014-01-17 19:58:46','YYYY-MM-DD HH24:MI:SS'),100,'View used to generate this report','D','N',22,'The Report View indicates the view used to generate this report.','Y','Y','Y','N','N','N','N','N','Y','Y','N','N','N','N','N','N','Report View',0,0,TO_DATE('2014-01-17 19:58:46','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- Jan 17, 2014 7:58:56 PM CET

View File

@ -16,11 +16,11 @@ INSERT INTO AD_Val_Rule (AD_Client_ID,AD_Org_ID,AD_Val_Rule_ID,AD_Val_Rule_UU,Co
;
-- Jan 17, 2014 7:57:32 PM CET
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,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,Description,EntityType,FKConstraintType,FieldLength,Help,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,210935,'e5fe354e-7566-4a08-a601-b0d97ca5f186',104,0,19,200109,200055,'AD_Column_ID',TO_TIMESTAMP('2014-01-17 19:57:32','YYYY-MM-DD HH24:MI:SS'),100,'Column in the table','U','N',22,'Link to the database column of the table','Y','Y','Y','N','N','N','N','N','Y','Y','N','N','N','N','N','N','Column',0,0,TO_TIMESTAMP('2014-01-17 19:57:32','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,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,Description,EntityType,FKConstraintType,FieldLength,Help,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,210935,'e5fe354e-7566-4a08-a601-b0d97ca5f186',104,0,19,200109,200055,'AD_Column_ID',TO_TIMESTAMP('2014-01-17 19:57:32','YYYY-MM-DD HH24:MI:SS'),100,'Column in the table','D','N',22,'Link to the database column of the table','Y','Y','Y','N','N','N','N','N','Y','Y','N','N','N','N','N','N','Column',0,0,TO_TIMESTAMP('2014-01-17 19:57:32','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- Jan 17, 2014 7:57:50 PM CET
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,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,210936,'60086644-8471-499c-bf88-44478e949c93',113,0,19,200109,148,'AD_Org_ID',TO_TIMESTAMP('2014-01-17 19:57:50','YYYY-MM-DD HH24:MI:SS'),100,'@#AD_Org_ID@','Organizational entity within client','U',22,'An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','Y','N','Y','N','N','N','N','N','Y','N','N','N','N','N','N','N','Organization',0,0,TO_TIMESTAMP('2014-01-17 19:57:50','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,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,210936,'60086644-8471-499c-bf88-44478e949c93',113,0,19,200109,148,'AD_Org_ID',TO_TIMESTAMP('2014-01-17 19:57:50','YYYY-MM-DD HH24:MI:SS'),100,'@#AD_Org_ID@','Organizational entity within client','D',22,'An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','Y','N','Y','N','N','N','N','N','Y','N','N','N','N','N','N','N','Organization',0,0,TO_TIMESTAMP('2014-01-17 19:57:50','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- Jan 17, 2014 7:58:03 PM CET
@ -40,7 +40,7 @@ UPDATE AD_Column SET EntityType='D', IsUpdateable='N',Updated=TO_TIMESTAMP('2014
;
-- Jan 17, 2014 7:58:47 PM CET
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,Description,EntityType,FKConstraintType,FieldLength,Help,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,210938,'6d8f48d0-07e3-49c3-a0e6-5e5539279496',1252,0,30,200109,'AD_ReportView_ID',TO_TIMESTAMP('2014-01-17 19:58:46','YYYY-MM-DD HH24:MI:SS'),100,'View used to generate this report','U','N',22,'The Report View indicates the view used to generate this report.','Y','Y','Y','N','N','N','N','N','Y','Y','N','N','N','N','N','N','Report View',0,0,TO_TIMESTAMP('2014-01-17 19:58:46','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,Description,EntityType,FKConstraintType,FieldLength,Help,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,210938,'6d8f48d0-07e3-49c3-a0e6-5e5539279496',1252,0,30,200109,'AD_ReportView_ID',TO_TIMESTAMP('2014-01-17 19:58:46','YYYY-MM-DD HH24:MI:SS'),100,'View used to generate this report','D','N',22,'The Report View indicates the view used to generate this report.','Y','Y','Y','N','N','N','N','N','Y','Y','N','N','N','N','N','N','Report View',0,0,TO_TIMESTAMP('2014-01-17 19:58:46','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- Jan 17, 2014 7:58:56 PM CET

View File

@ -843,7 +843,7 @@ public class MPrintFormat extends X_AD_PrintFormat
+ " AND IsEncrypted='N' AND ObscureType IS NULL "
+ " AND AD_Column_ID NOT IN (SELECT pfi.AD_Column_ID FROM AD_PrintFormatItem pfi WHERE pfi.AD_PrintFormat_ID=? AND pfi.AD_Column_ID IS NOT NULL) "
+ " AND (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_ReportView_Column WHERE AD_ReportView_ID=? AND IsActive='Y')"
+ " OR ((SELECT COUNT(*) FROM AD_ReportView_Column WHERE AD_ReportView_ID=?) = 0))"
+ " OR ((SELECT COUNT(*) FROM AD_ReportView_Column WHERE AD_ReportView_ID=? AND IsActive='Y') = 0))"
+ "ORDER BY COALESCE(IsDisplayed,'N') DESC, SortNo, SeqNo, Name";
PreparedStatement pstmt = null;
ResultSet rs = null;
@ -883,7 +883,7 @@ public class MPrintFormat extends X_AD_PrintFormat
+ "WHERE IsActive='Y' AND AD_Table_ID=? "
+ " AND AD_Column_ID NOT IN (SELECT pfi.AD_Column_ID FROM AD_PrintFormatItem pfi WHERE pfi.AD_PrintFormat_ID=? AND pfi.AD_Column_ID IS NOT NULL) "
+ " AND (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_ReportView_Column WHERE AD_ReportView_ID=? AND IsActive='Y')"
+ " OR ((SELECT COUNT(*) FROM AD_ReportView_Column WHERE AD_ReportView_ID=?) = 0))"
+ " OR ((SELECT COUNT(*) FROM AD_ReportView_Column WHERE AD_ReportView_ID=?) = 0 AND IsActive='Y'))"
+ "ORDER BY IsIdentifier DESC, SeqNo, Name";
try
{

View File

@ -434,7 +434,7 @@ public class VSortTab extends CPanel implements APanelTab
if (reportView_ID > 0)
sql.append(" AND (t.AD_Column_ID IN (SELECT AD_Column_ID FROM AD_ReportView_Column WHERE AD_ReportView_ID=")
.append(reportView_ID).append(" AND IsActive='Y')")
.append(" OR ((SELECT COUNT(*) FROM AD_ReportView_Column WHERE AD_ReportView_ID=").append(reportView_ID).append(") = 0))");
.append(" OR ((SELECT COUNT(*) FROM AD_ReportView_Column WHERE AD_ReportView_ID=").append(reportView_ID).append(" AND IsActive='Y') = 0))");
if (m_IdentifierTranslated)
sql.append(" AND t.").append(m_KeyColumnName).append("=tt.").append(m_KeyColumnName)

View File

@ -398,10 +398,11 @@ public class ADSortTab extends Panel implements IADTabpanel
}
int reportView_ID = Env.getContextAsInt(Env.getCtx(), m_WindowNo, "AD_ReportView_ID");
if (reportView_ID > 0)
if ("AD_PrintFormatItem".equals(m_TableName) && reportView_ID > 0) {
sql.append(" AND (t.AD_Column_ID IN (SELECT AD_Column_ID FROM AD_ReportView_Column WHERE AD_ReportView_ID=")
.append(reportView_ID).append(" AND IsActive='Y')")
.append(" OR ((SELECT COUNT(*) FROM AD_ReportView_Column WHERE AD_ReportView_ID=").append(reportView_ID).append(") = 0))");
.append(" OR ((SELECT COUNT(*) FROM AD_ReportView_Column WHERE AD_ReportView_ID=").append(reportView_ID).append(" AND IsActive='Y') = 0))");
}
if (m_IdentifierTranslated)
sql.append(" AND t.").append(m_KeyColumnName).append("=tt.").append(m_KeyColumnName)