Merge release-7.1 into master

This commit is contained in:
Carlos Ruiz 2019-12-21 16:00:24 +01:00
commit a8ad176e47
19 changed files with 673 additions and 204 deletions

View File

@ -6,7 +6,8 @@ CREATE OR REPLACE VIEW AD_TAB_V
AD_IMAGE_ID, TABLEVEL, WHERECLAUSE, ORDERBYCLAUSE, COMMITWARNING, AD_IMAGE_ID, TABLEVEL, WHERECLAUSE, ORDERBYCLAUSE, COMMITWARNING,
READONLYLOGIC, DISPLAYLOGIC, AD_COLUMN_ID, AD_PROCESS_ID, ISSORTTAB, READONLYLOGIC, DISPLAYLOGIC, AD_COLUMN_ID, AD_PROCESS_ID, ISSORTTAB,
ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID, ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID,
INCLUDED_TAB_ID, PARENT_COLUMN_ID, AD_Tab_UU, AD_Table_UU, TREEDISPLAYEDON) INCLUDED_TAB_ID, PARENT_COLUMN_ID, AD_Tab_UU, AD_Table_UU, TREEDISPLAYEDON,
MAXQUERYRECORDS)
AS AS
SELECT t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, t.Name, t.Description, SELECT t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, t.Name, t.Description,
t.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType, t.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType,
@ -16,7 +17,7 @@ SELECT t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, t.Name, t.Description,
t.WhereClause, t.OrderByClause, t.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic, t.WhereClause, t.OrderByClause, t.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic,
t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab, t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab,
t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID, t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID,
t.AD_Tab_UU, tbl.AD_Table_UU, t.TreeDisplayedOn t.AD_Tab_UU, tbl.AD_Table_UU, t.TreeDisplayedOn, t.MaxQueryRecords
FROM AD_Tab t FROM AD_Tab t
INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID) INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID)
WHERE t.IsActive='Y' WHERE t.IsActive='Y'

View File

@ -6,7 +6,8 @@ CREATE OR REPLACE VIEW AD_TAB_VT
ISREADONLY, AD_IMAGE_ID, TABLEVEL, WHERECLAUSE, ORDERBYCLAUSE, ISREADONLY, AD_IMAGE_ID, TABLEVEL, WHERECLAUSE, ORDERBYCLAUSE,
COMMITWARNING, READONLYLOGIC, DISPLAYLOGIC, AD_COLUMN_ID, AD_PROCESS_ID, COMMITWARNING, READONLYLOGIC, DISPLAYLOGIC, AD_COLUMN_ID, AD_PROCESS_ID,
ISSORTTAB, ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID, ISSORTTAB, ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID,
INCLUDED_TAB_ID, PARENT_COLUMN_ID, AD_Tab_UU, AD_Table_UU, TREEDISPLAYEDON) INCLUDED_TAB_ID, PARENT_COLUMN_ID, AD_Tab_UU, AD_Table_UU, TREEDISPLAYEDON,
MAXQUERYRECORDS)
AS AS
SELECT trl.AD_Language, t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, trl.Name, trl.Description, SELECT trl.AD_Language, t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, trl.Name, trl.Description,
trl.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType, trl.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType,
@ -16,7 +17,7 @@ SELECT trl.AD_Language, t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, trl.Name, tr
t.WhereClause, t.OrderByClause, trl.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic, t.WhereClause, t.OrderByClause, trl.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic,
t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab, t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab,
t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID, t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID,
t.AD_Tab_UU, tbl.AD_Table_UU, t.TreeDisplayedOn t.AD_Tab_UU, tbl.AD_Table_UU, t.TreeDisplayedOn, t.MaxQueryRecords
FROM AD_Tab t FROM AD_Tab t
INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID) INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID)
INNER JOIN AD_Tab_Trl trl ON (t.AD_Tab_ID = trl.AD_Tab_ID) INNER JOIN AD_Tab_Trl trl ON (t.AD_Tab_ID = trl.AD_Tab_ID)

View File

@ -6,7 +6,8 @@ CREATE OR REPLACE VIEW AD_TAB_V
AD_IMAGE_ID, TABLEVEL, WHERECLAUSE, ORDERBYCLAUSE, COMMITWARNING, AD_IMAGE_ID, TABLEVEL, WHERECLAUSE, ORDERBYCLAUSE, COMMITWARNING,
READONLYLOGIC, DISPLAYLOGIC, AD_COLUMN_ID, AD_PROCESS_ID, ISSORTTAB, READONLYLOGIC, DISPLAYLOGIC, AD_COLUMN_ID, AD_PROCESS_ID, ISSORTTAB,
ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID, ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID,
INCLUDED_TAB_ID, PARENT_COLUMN_ID, AD_Tab_UU, AD_Table_UU, TREEDISPLAYEDON) INCLUDED_TAB_ID, PARENT_COLUMN_ID, AD_Tab_UU, AD_Table_UU, TREEDISPLAYEDON,
MAXQUERYRECORDS)
AS AS
SELECT t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, t.Name, t.Description, SELECT t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, t.Name, t.Description,
t.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType, t.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType,
@ -16,7 +17,7 @@ SELECT t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, t.Name, t.Description,
t.WhereClause, t.OrderByClause, t.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic, t.WhereClause, t.OrderByClause, t.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic,
t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab, t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab,
t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID, t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID,
t.AD_Tab_UU, tbl.AD_Table_UU, t.TreeDisplayedOn t.AD_Tab_UU, tbl.AD_Table_UU, t.TreeDisplayedOn, t.MaxQueryRecords
FROM AD_Tab t FROM AD_Tab t
INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID) INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID)
WHERE t.IsActive='Y' WHERE t.IsActive='Y'

View File

@ -6,7 +6,8 @@ CREATE OR REPLACE VIEW AD_TAB_VT
ISREADONLY, AD_IMAGE_ID, TABLEVEL, WHERECLAUSE, ORDERBYCLAUSE, ISREADONLY, AD_IMAGE_ID, TABLEVEL, WHERECLAUSE, ORDERBYCLAUSE,
COMMITWARNING, READONLYLOGIC, DISPLAYLOGIC, AD_COLUMN_ID, AD_PROCESS_ID, COMMITWARNING, READONLYLOGIC, DISPLAYLOGIC, AD_COLUMN_ID, AD_PROCESS_ID,
ISSORTTAB, ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID, ISSORTTAB, ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID,
INCLUDED_TAB_ID, PARENT_COLUMN_ID, AD_Tab_UU, AD_Table_UU, TREEDISPLAYEDON) INCLUDED_TAB_ID, PARENT_COLUMN_ID, AD_Tab_UU, AD_Table_UU, TREEDISPLAYEDON,
MAXQUERYRECORDS)
AS AS
SELECT trl.AD_Language, t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, trl.Name, trl.Description, SELECT trl.AD_Language, t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, trl.Name, trl.Description,
trl.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType, trl.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType,
@ -16,7 +17,7 @@ SELECT trl.AD_Language, t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, trl.Name, tr
t.WhereClause, t.OrderByClause, trl.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic, t.WhereClause, t.OrderByClause, trl.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic,
t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab, t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab,
t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID, t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID,
t.AD_Tab_UU, tbl.AD_Table_UU, t.TreeDisplayedOn t.AD_Tab_UU, tbl.AD_Table_UU, t.TreeDisplayedOn, t.MaxQueryRecords
FROM AD_Tab t FROM AD_Tab t
INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID) INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID)
INNER JOIN AD_Tab_Trl trl ON (t.AD_Tab_ID = trl.AD_Tab_ID) INNER JOIN AD_Tab_Trl trl ON (t.AD_Tab_ID = trl.AD_Tab_ID)

View File

@ -0,0 +1,28 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-2836 SQL Searches for advanced users
-- Nov 21, 2019, 10:28:50 PM CET
UPDATE AD_Field SET Help='The Validation Code displays the date, time and message of the error.
You can add advanced SQL queries to your searches by filling this field with @SQL=[WHERE CLAUSE].
Do not include the WHERE statement and use Fully qualified SQL statements. F.e:
'||chr(64)||'SQL=C_Order.isActive=''Y'' AND SalesRep_ID=@AD_User_ID@
will filter orders by active and where the sales representative is the current user.', IsCentrallyMaintained='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2019-11-21 22:28:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=12249
;
-- Nov 21, 2019, 6:54:31 PM CET
UPDATE AD_Field SET Help='The Validation Code displays the date, time and message of the error.
You can add advanced SQL queries to your searches by filling this field with @SQL=[WHERE CLAUSE].
Do not include the WHERE statement and use Fully qualified SQL statements. F.e:
'||chr(64)||'SQL=C_Order.isActive=''Y'' AND SalesRep_ID=@AD_User_ID@
will filter orders by active and where the sales representative is the current user.', IsCentrallyMaintained='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2019-11-21 18:54:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206305
;
SELECT register_migration_script('201911211857_IDEMPIERE-2836.sql') FROM dual
;

View File

@ -0,0 +1,122 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-4130 MaxQueryRecords by Tab (FHCA-1115)
-- Dec 18, 2019, 10:20:27 PM CET
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType,IsHtml) VALUES (214163,0,'Max Query Records','If defined, you cannot query more records as defined - the query criteria needs to be changed to query less records','Enter the number of records a user will be able to query to avoid unnecessary system load. If 0, no restrictions are imposed.',106,'MaxQueryRecords','0',10,'N','N','N','N','N',0,'N',11,0,0,'Y',TO_DATE('2019-12-18 22:20:26','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2019-12-18 22:20:26','YYYY-MM-DD HH24:MI:SS'),100,2854,'Y','N','D','N','N','N','Y','33a4790c-3b91-474d-9c36-0cc85af4b700','Y',0,'N','N','N','N')
;
-- Dec 18, 2019, 10:20:44 PM CET
ALTER TABLE AD_Tab ADD MaxQueryRecords NUMBER(10) DEFAULT 0
;
-- Dec 18, 2019, 10:21:56 PM CET
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (206373,'Max Query Records','If defined, you cannot query more records as defined - the query criteria needs to be changed to query less records','Enter the number of records a user will be able to query to avoid unnecessary system load. If 0, no restrictions are imposed.',106,214163,'Y',10,350,'N','N','N','N',0,0,'Y',TO_DATE('2019-12-18 22:21:56','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2019-12-18 22:21:56','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','27fb6d6a-0562-4de7-a9a8-7772daca44a0','Y',330,2)
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=230, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=4, IsToolbarButton=NULL,Updated=TO_DATE('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206373
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=240, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11265
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=250, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=929
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=260, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11998
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=270, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=271
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=280, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11266
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=290, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1548
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=300, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1550
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=310, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1549
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=320, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4956
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=330, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201811
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=340, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5131
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=350, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3205
;
CREATE OR REPLACE VIEW AD_TAB_V
(AD_TAB_ID, AD_WINDOW_ID, AD_TABLE_ID, NAME, DESCRIPTION,
HELP, SEQNO, ISSINGLEROW, HASTREE, ISINFOTAB,
REPLICATIONTYPE, TABLENAME, ACCESSLEVEL, ISSECURITYENABLED, ISDELETEABLE,
ISHIGHVOLUME, ISVIEW, HASASSOCIATION, ISTRANSLATIONTAB, ISREADONLY,
AD_IMAGE_ID, TABLEVEL, WHERECLAUSE, ORDERBYCLAUSE, COMMITWARNING,
READONLYLOGIC, DISPLAYLOGIC, AD_COLUMN_ID, AD_PROCESS_ID, ISSORTTAB,
ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID,
INCLUDED_TAB_ID, PARENT_COLUMN_ID, AD_Tab_UU, AD_Table_UU, TREEDISPLAYEDON,
MAXQUERYRECORDS)
AS
SELECT t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, t.Name, t.Description,
t.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType,
tbl.TableName, tbl.AccessLevel, tbl.IsSecurityEnabled, tbl.IsDeleteable,
tbl.IsHighVolume, tbl.IsView, cast('N' as char) AS HasAssociation, -- compatibility
t.IsTranslationTab, t.IsReadOnly, t.AD_Image_ID, t.TabLevel,
t.WhereClause, t.OrderByClause, t.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic,
t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab,
t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID,
t.AD_Tab_UU, tbl.AD_Table_UU, t.TreeDisplayedOn, t.MaxQueryRecords
FROM AD_Tab t
INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID)
WHERE t.IsActive='Y'
AND tbl.IsActive='Y';
CREATE OR REPLACE VIEW AD_TAB_VT
(AD_LANGUAGE, AD_TAB_ID, AD_WINDOW_ID, AD_TABLE_ID, NAME,
DESCRIPTION, HELP, SEQNO, ISSINGLEROW, HASTREE,
ISINFOTAB, REPLICATIONTYPE, TABLENAME, ACCESSLEVEL, ISSECURITYENABLED,
ISDELETEABLE, ISHIGHVOLUME, ISVIEW, HASASSOCIATION, ISTRANSLATIONTAB,
ISREADONLY, AD_IMAGE_ID, TABLEVEL, WHERECLAUSE, ORDERBYCLAUSE,
COMMITWARNING, READONLYLOGIC, DISPLAYLOGIC, AD_COLUMN_ID, AD_PROCESS_ID,
ISSORTTAB, ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID,
INCLUDED_TAB_ID, PARENT_COLUMN_ID, AD_Tab_UU, AD_Table_UU, TREEDISPLAYEDON,
MAXQUERYRECORDS)
AS
SELECT trl.AD_Language, t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, trl.Name, trl.Description,
trl.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType,
tbl.TableName, tbl.AccessLevel, tbl.IsSecurityEnabled, tbl.IsDeleteable,
tbl.IsHighVolume, tbl.IsView, cast('N' as char) AS HasAssociation, -- compatibility
t.IsTranslationTab, t.IsReadOnly, t.AD_Image_ID, t.TabLevel,
t.WhereClause, t.OrderByClause, trl.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic,
t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab,
t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID,
t.AD_Tab_UU, tbl.AD_Table_UU, t.TreeDisplayedOn, t.MaxQueryRecords
FROM AD_Tab t
INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID)
INNER JOIN AD_Tab_Trl trl ON (t.AD_Tab_ID = trl.AD_Tab_ID)
WHERE t.IsActive='Y'
AND tbl.IsActive='Y';
SELECT register_migration_script('201912182232_IDEMPIERE-4130.sql') FROM dual
;

View File

@ -0,0 +1,25 @@
-- IDEMPIERE-2836 SQL Searches for advanced users
-- Nov 21, 2019, 10:28:50 PM CET
UPDATE AD_Field SET Help='The Validation Code displays the date, time and message of the error.
You can add advanced SQL queries to your searches by filling this field with @SQL=[WHERE CLAUSE].
Do not include the WHERE statement and use Fully qualified SQL statements. F.e:
@SQL=C_Order.isActive=''Y'' AND SalesRep_ID=@AD_User_ID@
will filter orders by active and where the sales representative is the current user.', IsCentrallyMaintained='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-11-21 22:28:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=12249
;
-- Nov 21, 2019, 6:54:31 PM CET
UPDATE AD_Field SET Help='The Validation Code displays the date, time and message of the error.
You can add advanced SQL queries to your searches by filling this field with @SQL=[WHERE CLAUSE].
Do not include the WHERE statement and use Fully qualified SQL statements. F.e:
@SQL=C_Order.isActive=''Y'' AND SalesRep_ID=@AD_User_ID@
will filter orders by active and where the sales representative is the current user.', IsCentrallyMaintained='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-11-21 18:54:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206305
;
SELECT register_migration_script('201911211857_IDEMPIERE-2836.sql') FROM dual
;

View File

@ -0,0 +1,119 @@
-- IDEMPIERE-4130 MaxQueryRecords by Tab (FHCA-1115)
-- Dec 18, 2019, 10:20:27 PM CET
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType,IsHtml) VALUES (214163,0,'Max Query Records','If defined, you cannot query more records as defined - the query criteria needs to be changed to query less records','Enter the number of records a user will be able to query to avoid unnecessary system load. If 0, no restrictions are imposed.',106,'MaxQueryRecords','0',10,'N','N','N','N','N',0,'N',11,0,0,'Y',TO_TIMESTAMP('2019-12-18 22:20:26','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2019-12-18 22:20:26','YYYY-MM-DD HH24:MI:SS'),100,2854,'Y','N','D','N','N','N','Y','33a4790c-3b91-474d-9c36-0cc85af4b700','Y',0,'N','N','N','N')
;
-- Dec 18, 2019, 10:20:44 PM CET
ALTER TABLE AD_Tab ADD COLUMN MaxQueryRecords NUMERIC(10) DEFAULT '0'
;
-- Dec 18, 2019, 10:21:56 PM CET
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (206373,'Max Query Records','If defined, you cannot query more records as defined - the query criteria needs to be changed to query less records','Enter the number of records a user will be able to query to avoid unnecessary system load. If 0, no restrictions are imposed.',106,214163,'Y',10,350,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2019-12-18 22:21:56','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2019-12-18 22:21:56','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','27fb6d6a-0562-4de7-a9a8-7772daca44a0','Y',330,2)
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=230, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=4, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206373
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=240, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11265
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=250, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=929
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=260, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11998
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=270, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=271
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=280, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11266
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=290, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1548
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=300, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1550
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=310, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1549
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=320, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4956
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=330, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201811
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=340, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5131
;
-- Dec 18, 2019, 10:23:00 PM CET
UPDATE AD_Field SET SeqNo=350, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-12-18 22:23:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3205
;
CREATE OR REPLACE VIEW AD_TAB_V
(AD_TAB_ID, AD_WINDOW_ID, AD_TABLE_ID, NAME, DESCRIPTION,
HELP, SEQNO, ISSINGLEROW, HASTREE, ISINFOTAB,
REPLICATIONTYPE, TABLENAME, ACCESSLEVEL, ISSECURITYENABLED, ISDELETEABLE,
ISHIGHVOLUME, ISVIEW, HASASSOCIATION, ISTRANSLATIONTAB, ISREADONLY,
AD_IMAGE_ID, TABLEVEL, WHERECLAUSE, ORDERBYCLAUSE, COMMITWARNING,
READONLYLOGIC, DISPLAYLOGIC, AD_COLUMN_ID, AD_PROCESS_ID, ISSORTTAB,
ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID,
INCLUDED_TAB_ID, PARENT_COLUMN_ID, AD_Tab_UU, AD_Table_UU, TREEDISPLAYEDON,
MAXQUERYRECORDS)
AS
SELECT t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, t.Name, t.Description,
t.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType,
tbl.TableName, tbl.AccessLevel, tbl.IsSecurityEnabled, tbl.IsDeleteable,
tbl.IsHighVolume, tbl.IsView, cast('N' as char) AS HasAssociation, -- compatibility
t.IsTranslationTab, t.IsReadOnly, t.AD_Image_ID, t.TabLevel,
t.WhereClause, t.OrderByClause, t.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic,
t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab,
t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID,
t.AD_Tab_UU, tbl.AD_Table_UU, t.TreeDisplayedOn, t.MaxQueryRecords
FROM AD_Tab t
INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID)
WHERE t.IsActive='Y'
AND tbl.IsActive='Y';
CREATE OR REPLACE VIEW AD_TAB_VT
(AD_LANGUAGE, AD_TAB_ID, AD_WINDOW_ID, AD_TABLE_ID, NAME,
DESCRIPTION, HELP, SEQNO, ISSINGLEROW, HASTREE,
ISINFOTAB, REPLICATIONTYPE, TABLENAME, ACCESSLEVEL, ISSECURITYENABLED,
ISDELETEABLE, ISHIGHVOLUME, ISVIEW, HASASSOCIATION, ISTRANSLATIONTAB,
ISREADONLY, AD_IMAGE_ID, TABLEVEL, WHERECLAUSE, ORDERBYCLAUSE,
COMMITWARNING, READONLYLOGIC, DISPLAYLOGIC, AD_COLUMN_ID, AD_PROCESS_ID,
ISSORTTAB, ISINSERTRECORD, ISADVANCEDTAB, AD_COLUMNSORTORDER_ID, AD_COLUMNSORTYESNO_ID,
INCLUDED_TAB_ID, PARENT_COLUMN_ID, AD_Tab_UU, AD_Table_UU, TREEDISPLAYEDON,
MAXQUERYRECORDS)
AS
SELECT trl.AD_Language, t.AD_Tab_ID, t.AD_Window_ID, t.AD_Table_ID, trl.Name, trl.Description,
trl.Help, t.SeqNo, t.IsSingleRow, t.HasTree, t.IsInfoTab, tbl.ReplicationType,
tbl.TableName, tbl.AccessLevel, tbl.IsSecurityEnabled, tbl.IsDeleteable,
tbl.IsHighVolume, tbl.IsView, cast('N' as char) AS HasAssociation, -- compatibility
t.IsTranslationTab, t.IsReadOnly, t.AD_Image_ID, t.TabLevel,
t.WhereClause, t.OrderByClause, trl.CommitWarning, t.ReadOnlyLogic, t.DisplayLogic,
t.AD_Column_ID, t.AD_Process_ID, t.IsSortTab, t.IsInsertRecord, t.IsAdvancedTab,
t.AD_ColumnSortOrder_ID, t.AD_ColumnSortYesNo_ID, t.Included_Tab_ID, t.Parent_Column_ID,
t.AD_Tab_UU, tbl.AD_Table_UU, t.TreeDisplayedOn, t.MaxQueryRecords
FROM AD_Tab t
INNER JOIN AD_Table tbl ON (t.AD_Table_ID = tbl.AD_Table_ID)
INNER JOIN AD_Tab_Trl trl ON (t.AD_Tab_ID = trl.AD_Tab_ID)
WHERE t.IsActive='Y'
AND tbl.IsActive='Y';
SELECT register_migration_script('201912182232_IDEMPIERE-4130.sql') FROM dual
;

View File

@ -37,7 +37,6 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.TreeMap; import java.util.TreeMap;
import java.util.UUID;
import java.util.logging.Level; import java.util.logging.Level;
import org.adempiere.base.IGridTabImporter; import org.adempiere.base.IGridTabImporter;
@ -242,6 +241,7 @@ public class GridTabCSVImporter implements IGridTabImporter
manageMasterTrx(gridTab, null); manageMasterTrx(gridTab, null);
createTrx(gridTab); createTrx(gridTab);
} }
trx.setDisplayName(GridTabCSVImporter.class.getName()+"_fileImport_" + gridTab.getTableName());
String recordResult = processRecord(importMode, gridTab, indxDetail, isDetail, idx, rowResult, childs); String recordResult = processRecord(importMode, gridTab, indxDetail, isDetail, idx, rowResult, childs);
rowResult.append(recordResult); rowResult.append(recordResult);
@ -594,8 +594,7 @@ public class GridTabCSVImporter implements IGridTabImporter
* @param gridTab * @param gridTab
*/ */
private void createTrx(GridTab gridTab){ private void createTrx(GridTab gridTab){
trxName = Trx.createTrxName("CSVImport");
trxName = getTrxName(gridTab.getTableName());
gridTab.getTableModel().setImportingMode(true,trxName); gridTab.getTableModel().setImportingMode(true,trxName);
trx = Trx.get(trxName,true); trx = Trx.get(trxName,true);
masterRecord = null; masterRecord = null;
@ -777,10 +776,6 @@ public class GridTabCSVImporter implements IGridTabImporter
}//processRecord }//processRecord
private String getTrxName(String gritTabName){
return "Import_" + gritTabName + "_" + UUID.randomUUID();
}
private void throwAdempiereException(String msg){ private void throwAdempiereException(String msg){
throw new AdempiereException(msg); throw new AdempiereException(msg);
} }

View File

@ -112,7 +112,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
/** /**
* *
*/ */
private static final long serialVersionUID = -3115353522698098211L; private static final long serialVersionUID = 5057703093968124177L;
public static final String DEFAULT_STATUS_MESSAGE = "NavigateOrUpdate"; public static final String DEFAULT_STATUS_MESSAGE = "NavigateOrUpdate";
@ -3392,4 +3392,44 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
public void setCalloutUI(ICalloutUI calloutUI) { public void setCalloutUI(ICalloutUI calloutUI) {
this.calloutUI = calloutUI; this.calloutUI = calloutUI;
} }
/** Get Max Query Records.
* @return If defined, you cannot query more records as defined - the query criteria needs to be changed to query less records
*/
public int getMaxQueryRecords() {
// minimum between AD_Tab.MaxQueryRecords and AD_Role.MaxQueryRecords
int roleMaxQueryRecords = MRole.getDefault().getMaxQueryRecords();
int tabMaxQueryRecords = m_vo.MaxQueryRecords;
if (roleMaxQueryRecords > 0 && roleMaxQueryRecords < tabMaxQueryRecords)
tabMaxQueryRecords = roleMaxQueryRecords;
return tabMaxQueryRecords;
}
/**
* Require Query
* @param noRecords records
* @return true if query required
*/
public boolean isQueryRequire (int noRecords)
{
if (noRecords < 2)
return false;
int max = getMaxQueryRecords();
if (max > 0 && noRecords > max)
return true;
int qu = MRole.getDefault().getConfirmQueryRecords();
return (noRecords > qu);
} // isQueryRequire
/**
* Over max Query
* @param noRecords records
* @return true if over max query
*/
public boolean isQueryMax (int noRecords)
{
int max = getMaxQueryRecords();
return max > 0 && noRecords > max;
} // isQueryMax
} // GridTab } // GridTab

View File

@ -41,7 +41,7 @@ public class GridTabVO implements Evaluatee, Serializable
/** /**
* *
*/ */
private static final long serialVersionUID = -1353087123788176368L; private static final long serialVersionUID = 9091214632840854495L;
/************************************************************************** /**************************************************************************
* Create MTab VO * Create MTab VO
@ -206,6 +206,8 @@ public class GridTabVO implements Evaluatee, Serializable
vo.TreeDisplayedOn = rs.getString("TreeDisplayedOn"); vo.TreeDisplayedOn = rs.getString("TreeDisplayedOn");
vo.MaxQueryRecords = rs.getInt("MaxQueryRecords");
vo.AD_Table_ID = rs.getInt("AD_Table_ID"); vo.AD_Table_ID = rs.getInt("AD_Table_ID");
vo.TableName = rs.getString("TableName"); vo.TableName = rs.getString("TableName");
if (rs.getString("IsView").equals("Y")) if (rs.getString("IsView").equals("Y"))
@ -436,6 +438,8 @@ public class GridTabVO implements Evaluatee, Serializable
public boolean HasTree = false; public boolean HasTree = false;
/** Tree displayed on */ /** Tree displayed on */
public String TreeDisplayedOn = ""; public String TreeDisplayedOn = "";
/** Max Query Records */
public int MaxQueryRecords = 0;
/** Table */ /** Table */
public int AD_Table_ID; public int AD_Table_ID;
/** Table UUID */ /** Table UUID */
@ -553,6 +557,7 @@ public class GridTabVO implements Evaluatee, Serializable
clone.IsInsertRecord = IsInsertRecord; clone.IsInsertRecord = IsInsertRecord;
clone.HasTree = HasTree; clone.HasTree = HasTree;
clone.TreeDisplayedOn = TreeDisplayedOn; clone.TreeDisplayedOn = TreeDisplayedOn;
clone.MaxQueryRecords = MaxQueryRecords;
clone.AD_Table_ID = AD_Table_ID; clone.AD_Table_ID = AD_Table_ID;
clone.AD_Column_ID = AD_Column_ID; clone.AD_Column_ID = AD_Column_ID;
clone.Parent_Column_ID = Parent_Column_ID; clone.Parent_Column_ID = Parent_Column_ID;

View File

@ -428,6 +428,19 @@ public interface I_AD_Tab
*/ */
public boolean isTranslationTab(); public boolean isTranslationTab();
/** Column name MaxQueryRecords */
public static final String COLUMNNAME_MaxQueryRecords = "MaxQueryRecords";
/** Set Max Query Records.
* If defined, you cannot query more records as defined - the query criteria needs to be changed to query less records
*/
public void setMaxQueryRecords (int MaxQueryRecords);
/** Get Max Query Records.
* If defined, you cannot query more records as defined - the query criteria needs to be changed to query less records
*/
public int getMaxQueryRecords();
/** Column name Name */ /** Column name Name */
public static final String COLUMNNAME_Name = "Name"; public static final String COLUMNNAME_Name = "Name";

View File

@ -30,7 +30,7 @@ public class X_AD_Tab extends PO implements I_AD_Tab, I_Persistent
/** /**
* *
*/ */
private static final long serialVersionUID = 20191121L; private static final long serialVersionUID = 20191218L;
/** Standard Constructor */ /** Standard Constructor */
public X_AD_Tab (Properties ctx, int AD_Tab_ID, String trxName) public X_AD_Tab (Properties ctx, int AD_Tab_ID, String trxName)
@ -674,6 +674,26 @@ public class X_AD_Tab extends PO implements I_AD_Tab, I_Persistent
return false; return false;
} }
/** Set Max Query Records.
@param MaxQueryRecords
If defined, you cannot query more records as defined - the query criteria needs to be changed to query less records
*/
public void setMaxQueryRecords (int MaxQueryRecords)
{
set_Value (COLUMNNAME_MaxQueryRecords, Integer.valueOf(MaxQueryRecords));
}
/** Get Max Query Records.
@return If defined, you cannot query more records as defined - the query criteria needs to be changed to query less records
*/
public int getMaxQueryRecords ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_MaxQueryRecords);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Name. /** Set Name.
@param Name @param Name
Alphanumeric identifier of the entity Alphanumeric identifier of the entity

View File

@ -657,7 +657,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
} }
private void initFirstTabpanel() { private void initFirstTabpanel() {
adTabbox.getSelectedTabpanel().query(m_onlyCurrentRows, m_onlyCurrentDays, MRole.getDefault().getMaxQueryRecords()); adTabbox.getSelectedTabpanel().query(m_onlyCurrentRows, m_onlyCurrentDays, adTabbox.getSelectedGridTab().getMaxQueryRecords());
adTabbox.getSelectedTabpanel().activate(true); adTabbox.getSelectedTabpanel().activate(true);
Events.echoEvent(new Event(ADTabpanel.ON_POST_INIT_EVENT, adTabbox.getSelectedTabpanel())); Events.echoEvent(new Event(ADTabpanel.ON_POST_INIT_EVENT, adTabbox.getSelectedTabpanel()));
} }
@ -705,7 +705,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
mTab.getTableName(), MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); mTab.getTableName(), MRole.SQL_NOTQUALIFIED, MRole.SQL_RO);
int no = DB.getSQLValue(null, finalSQL.toString()); int no = DB.getSQLValue(null, finalSQL.toString());
// //
require = MRole.getDefault().isQueryRequire(no); require = mTab.isQueryRequire(no);
} }
// Show Query // Show Query
if (require) if (require)
@ -2060,7 +2060,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
{ {
m_onlyCurrentRows = false; // search history too m_onlyCurrentRows = false; // search history too
adTabbox.getSelectedGridTab().setQuery(query); adTabbox.getSelectedGridTab().setQuery(query);
adTabbox.getSelectedTabpanel().query(m_onlyCurrentRows, m_onlyCurrentDays, MRole.getDefault().getMaxQueryRecords()); // autoSize adTabbox.getSelectedTabpanel().query(m_onlyCurrentRows, m_onlyCurrentDays, adTabbox.getSelectedGridTab().getMaxQueryRecords()); // autoSize
} }
if (findWindow.isCreateNew()) if (findWindow.isCreateNew())

View File

@ -251,7 +251,7 @@ public class ProcessParameterPanel extends Panel implements
for (int i = 0; i < listVO.size(); i++) for (int i = 0; i < listVO.size(); i++)
{ {
createField(listVO.get(i), rows); createField(listVO.get(i), rows);
log.severe(listVO.get(i).ColumnName + listVO.get(i).SeqNo); if (log.isLoggable(Level.INFO)) log.info(listVO.get(i).ColumnName + listVO.get(i).SeqNo);
} }
} catch (SQLException e) { } catch (SQLException e) {

View File

@ -23,6 +23,7 @@ import org.adempiere.webui.component.Panel;
import org.adempiere.webui.component.Row; import org.adempiere.webui.component.Row;
import org.adempiere.webui.component.Rows; import org.adempiere.webui.component.Rows;
import org.adempiere.webui.component.Textbox; import org.adempiere.webui.component.Textbox;
import org.adempiere.webui.component.ToolBarButton;
import org.adempiere.webui.component.WListbox; import org.adempiere.webui.component.WListbox;
import org.adempiere.webui.editor.WDateEditor; import org.adempiere.webui.editor.WDateEditor;
import org.adempiere.webui.editor.WSearchEditor; import org.adempiere.webui.editor.WSearchEditor;
@ -35,10 +36,12 @@ import org.adempiere.webui.panel.ADForm;
import org.adempiere.webui.panel.CustomForm; import org.adempiere.webui.panel.CustomForm;
import org.adempiere.webui.panel.IFormController; import org.adempiere.webui.panel.IFormController;
import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.util.ZKUpdateUtil; import org.adempiere.webui.util.ZKUpdateUtil;
import org.compiere.apps.form.FactReconcile; import org.compiere.apps.form.FactReconcile;
import org.compiere.model.MClient; import org.compiere.model.MClient;
import org.compiere.model.MColumn; import org.compiere.model.MColumn;
import org.compiere.model.MFactAcct;
import org.compiere.model.MLookup; import org.compiere.model.MLookup;
import org.compiere.model.MLookupFactory; import org.compiere.model.MLookupFactory;
import org.compiere.model.X_C_ElementValue; import org.compiere.model.X_C_ElementValue;
@ -47,8 +50,10 @@ import org.compiere.util.DisplayType;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.KeyNamePair; import org.compiere.util.KeyNamePair;
import org.compiere.util.Msg; import org.compiere.util.Msg;
import org.zkoss.zk.ui.WrongValueException;
import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zul.Borderlayout; import org.zkoss.zul.Borderlayout;
import org.zkoss.zul.Center; import org.zkoss.zul.Center;
import org.zkoss.zul.North; import org.zkoss.zul.North;
@ -112,6 +117,7 @@ implements IFormController, EventListener<Event>, WTableModelListener, ValueChan
private Button bGenerate = cp.createButton(ConfirmPanel.A_PROCESS); private Button bGenerate = cp.createButton(ConfirmPanel.A_PROCESS);
private Button bReset = cp.createButton(ConfirmPanel.A_RESET); private Button bReset = cp.createButton(ConfirmPanel.A_RESET);
private Button bZoom = cp.createButton(ConfirmPanel.A_ZOOM); private Button bZoom = cp.createButton(ConfirmPanel.A_ZOOM);
private Button bZoomDoc = cp.createButton(ConfirmPanel.A_ZOOM);
private Grid commandLayout = GridFactory.newGridLayout(); private Grid commandLayout = GridFactory.newGridLayout();
private Button bRefresh = cp.createButton(ConfirmPanel.A_REFRESH); private Button bRefresh = cp.createButton(ConfirmPanel.A_REFRESH);
private Label labelDateAcct = new Label(); private Label labelDateAcct = new Label();
@ -125,6 +131,9 @@ implements IFormController, EventListener<Event>, WTableModelListener, ValueChan
private Label differenceLabel = new Label(); private Label differenceLabel = new Label();
private Textbox differenceField = new Textbox(); private Textbox differenceField = new Textbox();
private ToolBarButton bSelect = new ToolBarButton("SelectAll");
private boolean checkAllSelected = true;
/** /**
* Static Init * Static Init
* @throws Exception * @throws Exception
@ -137,12 +146,19 @@ implements IFormController, EventListener<Event>, WTableModelListener, ValueChan
bRefresh.addActionListener(this); bRefresh.addActionListener(this);
bReset.addActionListener(this); bReset.addActionListener(this);
bZoom.addActionListener(this); bZoom.addActionListener(this);
bZoomDoc.addActionListener(this);
bGenerate.setEnabled(false); bGenerate.setEnabled(false);
bReset.setEnabled(false); bReset.setEnabled(false);
//bRefresh.setText(Msg.getMsg(Env.getCtx(), "Query")); //bRefresh.setText(Msg.getMsg(Env.getCtx(), "Query"));
bGenerate.setLabel(Msg.getMsg(Env.getCtx(),"Process")); bGenerate.setLabel(Msg.getMsg(Env.getCtx(),"Process"));
bReset.setLabel(Msg.getMsg(Env.getCtx(),"Reset")); bReset.setLabel(Msg.getMsg(Env.getCtx(),"Reset"));
bZoom.setLabel(Msg.translate(Env.getCtx(), "Fact_Acct_ID")); bZoom.setLabel(Msg.translate(Env.getCtx(), "Fact_Acct_ID"));
bZoomDoc.setId(bZoomDoc.getId() + "Doc"); // to avoid 'org.zkoss.zk.ui.UiException: Not unique in the ID space of <Grid null>: Zoom'
bZoomDoc.setLabel(Msg.translate(Env.getCtx(), "ZoomDocument"));
bSelect.setMode("toggle");
bSelect.setImage(ThemeManager.getThemeResource("images/SelectAll24.png"));
bSelect.setTooltiptext(Msg.getCleanMsg(Env.getCtx(), "SelectAll"));
bSelect.addEventListener(Events.ON_CLICK, this);
// //
labelAcctSchema.setText(Msg.translate(Env.getCtx(), "C_AcctSchema_ID")); labelAcctSchema.setText(Msg.translate(Env.getCtx(), "C_AcctSchema_ID"));
@ -234,9 +250,13 @@ implements IFormController, EventListener<Event>, WTableModelListener, ValueChan
ZKUpdateUtil.setWidth(commandLayout, "100%"); ZKUpdateUtil.setWidth(commandLayout, "100%");
rows = commandLayout.newRows(); rows = commandLayout.newRows();
row = rows.newRow(); row = rows.newRow();
row.appendCellChild(bSelect, 1);
row.appendCellChild(bZoom, 1); row.appendCellChild(bZoom, 1);
ZKUpdateUtil.setHflex(bZoom, "true"); ZKUpdateUtil.setHflex(bZoom, "true");
ZKUpdateUtil.setWidth(bZoom, "100%"); ZKUpdateUtil.setWidth(bZoom, "100%");
row.appendCellChild(bZoomDoc, 1);
ZKUpdateUtil.setHflex(bZoomDoc, "true");
ZKUpdateUtil.setWidth(bZoomDoc, "100%");
row.appendCellChild(differenceLabel.rightAlign()); row.appendCellChild(differenceLabel.rightAlign());
ZKUpdateUtil.setHflex(differenceLabel, "true"); ZKUpdateUtil.setHflex(differenceLabel, "true");
row.appendCellChild(differenceField, 2); row.appendCellChild(differenceField, 2);
@ -251,6 +271,8 @@ implements IFormController, EventListener<Event>, WTableModelListener, ValueChan
{ {
bZoom.setTooltiptext(bZoom.getLabel()); bZoom.setTooltiptext(bZoom.getLabel());
bZoom.setLabel(null); bZoom.setLabel(null);
bZoomDoc.setTooltiptext(bZoomDoc.getLabel());
bZoomDoc.setLabel(null);
bGenerate.setTooltiptext(bGenerate.getLabel()); bGenerate.setTooltiptext(bGenerate.getLabel());
bGenerate.setLabel(null); bGenerate.setLabel(null);
bReset.setTooltiptext(bReset.getLabel()); bReset.setTooltiptext(bReset.getLabel());
@ -310,11 +332,14 @@ implements IFormController, EventListener<Event>, WTableModelListener, ValueChan
+ "AND EXISTS (SELECT 1 FROM C_AcctSchema_Element ase " + "AND EXISTS (SELECT 1 FROM C_AcctSchema_Element ase "
+ "WHERE ase.C_Element_ID=C_ElementValue.C_Element_ID AND ase.ElementType='AC' " + "WHERE ase.C_Element_ID=C_ElementValue.C_Element_ID AND ase.ElementType='AC' "
+ "AND ase.C_AcctSchema_ID=@C_AcctSchema_ID@ AND ase.AD_Client_ID=@AD_Client_ID@) "); + "AND ase.C_AcctSchema_ID=@C_AcctSchema_ID@ AND ase.AD_Client_ID=@AD_Client_ID@) ");
fieldAccount = new WTableDirEditor("C_ElementValue_ID", false, false, true, lookupAccount); fieldAccount = new WTableDirEditor("C_ElementValue_ID", true, false, true, lookupAccount);
} }
public void loadData(){ public void loadData(){
if(fieldAccount.isNullOrEmpty())
throw new WrongValueException(fieldAccount.getComponent(), Msg.getMsg(Env.getCtx(), "FillMandatory"));
if(fieldAcctSchema.getValue()!=null) if(fieldAcctSchema.getValue()!=null)
m_C_AcctSchema_ID = (Integer)fieldAcctSchema.getValue(); m_C_AcctSchema_ID = (Integer)fieldAcctSchema.getValue();
else else
@ -419,6 +444,27 @@ implements IFormController, EventListener<Event>, WTableModelListener, ValueChan
public void tableChanged(WTableModelEvent event) { public void tableChanged(WTableModelEvent event) {
if (! loading ) if (! loading )
calculateSelection(); calculateSelection();
if (event.getModel() == miniTable.getModel()) {
int row = event.getFirstRow();
int col = event.getColumn();
if (row < 0)
return;
if (checkAllSelected && col == selectedColIndex) {
ListModelTable model = miniTable.getModel();
boolean rowUnSelected = false;
for (int i = 0; i < model.getRowCount(); i++) {
if ( ! (Boolean) model.getValueAt(i, selectedColIndex) ) {
rowUnSelected = true;
break;
}
}
bSelect.setPressed(! rowUnSelected);
}
}
} }
@Override @Override
@ -431,7 +477,9 @@ implements IFormController, EventListener<Event>, WTableModelListener, ValueChan
resetReconciliation(); resetReconciliation();
else if (event.getTarget().equals(bZoom)) else if (event.getTarget().equals(bZoom))
zoom(); zoom(MFactAcct.Table_ID);
else if (event.getTarget().equals(bZoomDoc))
zoom(-1);
else if (event.getTarget().equals(bCancel)) else if (event.getTarget().equals(bCancel))
SessionManager.getAppDesktop().closeActiveWindow(); SessionManager.getAppDesktop().closeActiveWindow();
@ -439,6 +487,9 @@ implements IFormController, EventListener<Event>, WTableModelListener, ValueChan
else if (event.getTarget().equals(bRefresh)) else if (event.getTarget().equals(bRefresh))
loadData(); loadData();
else if (event.getTarget().equals(bSelect))
onbSelect();
} }
private void generateReconciliation() { private void generateReconciliation() {
@ -474,6 +525,8 @@ implements IFormController, EventListener<Event>, WTableModelListener, ValueChan
((ListModelTable) miniTable.getModel()).remove(r--); ((ListModelTable) miniTable.getModel()).remove(r--);
} }
} }
bSelect.setPressed(false);
} }
/** /**
@ -481,7 +534,7 @@ implements IFormController, EventListener<Event>, WTableModelListener, ValueChan
* @param AD_Window_ID window id * @param AD_Window_ID window id
* @param zoomQuery zoom query * @param zoomQuery zoom query
*/ */
protected void zoom () protected void zoom (int tableID)
{ {
log.info(""); log.info("");
@ -494,7 +547,12 @@ implements IFormController, EventListener<Event>, WTableModelListener, ValueChan
int factId = pp.getKey(); int factId = pp.getKey();
AEnv.zoom(270, factId); if (tableID == MFactAcct.Table_ID)
AEnv.zoom(tableID, factId);
else {
MFactAcct fa = new MFactAcct(Env.getCtx(), factId, null);
AEnv.zoom(fa.getAD_Table_ID(), fa.getRecord_ID());
}
} // zoom } // zoom
private void resetReconciliation() { private void resetReconciliation() {
@ -522,6 +580,8 @@ implements IFormController, EventListener<Event>, WTableModelListener, ValueChan
((ListModelTable) miniTable.getModel()).remove(r--); ((ListModelTable) miniTable.getModel()).remove(r--);
} }
} }
bSelect.setPressed(false);
} }
@Override @Override
@ -529,5 +589,17 @@ implements IFormController, EventListener<Event>, WTableModelListener, ValueChan
return form; return form;
} }
void onbSelect() {
ListModelTable model = miniTable.getModel();
int rows = model.getSize();
Boolean selectAll = bSelect.isPressed() ? Boolean.FALSE : Boolean.TRUE;
bSelect.setPressed(! bSelect.isPressed());
checkAllSelected = false;
for (int i = 0; i < rows; i++)
model.setValueAt(selectAll, i, selectedColIndex);
checkAllSelected = true;
miniTable.setModel(model);
calculateSelection();
}
} }

View File

@ -58,7 +58,6 @@ import org.adempiere.webui.util.ZKUpdateUtil;
import org.compiere.model.GridTab; import org.compiere.model.GridTab;
import org.compiere.model.MImportTemplate; import org.compiere.model.MImportTemplate;
import org.compiere.model.MQuery; import org.compiere.model.MQuery;
import org.compiere.model.MRole;
import org.compiere.util.DB; import org.compiere.util.DB;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.Msg; import org.compiere.util.Msg;
@ -345,14 +344,14 @@ public class CSVImportAction implements EventListener<Event>
if (query != null) { if (query != null) {
query.addRestriction("1=1"); query.addRestriction("1=1");
panel.getActiveGridTab().setQuery(query); panel.getActiveGridTab().setQuery(query);
panel.getADTab().getSelectedTabpanel().query(false, 0, MRole.getDefault().getMaxQueryRecords()); panel.getADTab().getSelectedTabpanel().query(false, 0, panel.getActiveGridTab().getMaxQueryRecords());
} }
panel.getActiveGridTab().dataRefresh(false); panel.getActiveGridTab().dataRefresh(false);
if (detailQuery != null){ if (detailQuery != null){
detailQuery.addRestriction("1=1"); detailQuery.addRestriction("1=1");
panel.getADTab().getSelectedDetailADTabpanel().getGridTab().setQuery(detailQuery); panel.getADTab().getSelectedDetailADTabpanel().getGridTab().setQuery(detailQuery);
panel.getADTab().getSelectedDetailADTabpanel().query(false, 0, MRole.getDefault().getMaxQueryRecords()); panel.getADTab().getSelectedDetailADTabpanel().query(false, 0, panel.getActiveGridTab().getMaxQueryRecords());
panel.getADTab().getSelectedDetailADTabpanel().getGridTab().dataRefresh(false); panel.getADTab().getSelectedDetailADTabpanel().getGridTab().dataRefresh(false);
} }
} catch (Exception e) { } catch (Exception e) {

View File

@ -127,16 +127,15 @@ import org.zkoss.zul.Vlayout;
*/ */
public class FindWindow extends Window implements EventListener<Event>, ValueChangeListener, DialogEvents public class FindWindow extends Window implements EventListener<Event>, ValueChangeListener, DialogEvents
{ {
/**
*
*/
private static final long serialVersionUID = 2958810511464597943L;
private static final String FIND_ROW_EDITOR = "find.row.editor"; private static final String FIND_ROW_EDITOR = "find.row.editor";
private static final String FIND_ROW_EDITOR_TO = "find.row.editor.to"; private static final String FIND_ROW_EDITOR_TO = "find.row.editor.to";
/**
*
*/
private static final long serialVersionUID = -7374857601424061640L;
// values and label for history combo // values and label for history combo
private static final String HISTORY_DAY_ALL = "All"; private static final String HISTORY_DAY_ALL = "All";
private static final String HISTORY_DAY_YEAR = "Year"; private static final String HISTORY_DAY_YEAR = "Year";
@ -174,6 +173,8 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
private String m_whereExtended; private String m_whereExtended;
/** Search Fields */ /** Search Fields */
private GridField[] m_findFields; private GridField[] m_findFields;
/** The Tab */
private GridTab m_gridTab = null;
/** Resulting query */ /** Resulting query */
private MQuery m_query = null; private MQuery m_query = null;
/** Is cancel ? */ /** Is cancel ? */
@ -243,6 +244,10 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
private StatusBarPanel statusBar = new StatusBarPanel(); private StatusBarPanel statusBar = new StatusBarPanel();
/** END DEVCOFFEE **/ /** END DEVCOFFEE **/
/** IDEMPIERE-2836 User Query Where */
private String m_whereUserQuery;
private ToolBar advancedPanelToolBar;
/** /**
* FindPanel Constructor * FindPanel Constructor
* @param targetWindowNo targetWindowNo * @param targetWindowNo targetWindowNo
@ -264,6 +269,8 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
m_tableName = tableName; m_tableName = tableName;
m_whereExtended = whereExtended; m_whereExtended = whereExtended;
m_findFields = findFields; m_findFields = findFields;
if (findFields != null && findFields.length > 0)
m_gridTab = findFields[0].getGridTab();
m_sNew = "** ".concat(Msg.getMsg(Env.getCtx(), "New Query")).concat(" **"); m_sNew = "** ".concat(Msg.getMsg(Env.getCtx(), "New Query")).concat(" **");
m_AD_Tab_ID = adTabId; m_AD_Tab_ID = adTabId;
m_minRecords = minRecords; m_minRecords = minRecords;
@ -469,10 +476,10 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
pnlButtonRight.appendChild(btnCancel); pnlButtonRight.appendChild(btnCancel);
pnlButtonRight.setStyle("text-align: right"); pnlButtonRight.setStyle("text-align: right");
ToolBar toolBar = new ToolBar(); advancedPanelToolBar = new ToolBar();
toolBar.appendChild(btnNew); advancedPanelToolBar.appendChild(btnNew);
toolBar.appendChild(btnDelete); advancedPanelToolBar.appendChild(btnDelete);
ZKUpdateUtil.setWidth(toolBar, "100%"); ZKUpdateUtil.setWidth(advancedPanelToolBar, "100%");
fQueryName.addEventListener(Events.ON_SELECT, this); fQueryName.addEventListener(Events.ON_SELECT, this);
@ -541,9 +548,9 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
North north =new North(); North north =new North();
layout.appendChild(north); layout.appendChild(north);
north.appendChild(toolBar); north.appendChild(advancedPanelToolBar);
ZKUpdateUtil.setVflex(toolBar, "0"); ZKUpdateUtil.setVflex(advancedPanelToolBar, "0");
Center center = new Center(); Center center = new Center();
layout.appendChild(center); layout.appendChild(center);
@ -1313,6 +1320,8 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
} }
else if (event.getTarget() == fQueryName) else if (event.getTarget() == fQueryName)
{ {
m_whereUserQuery = null;
showAdvanced();
btnSave.setDisabled(false); btnSave.setDisabled(false);
btnShare.setDisabled(false); btnShare.setDisabled(false);
int index = fQueryName.getSelectedIndex(); int index = fQueryName.getSelectedIndex();
@ -1483,6 +1492,11 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
private void parseUserQuery(MUserQuery userQuery) private void parseUserQuery(MUserQuery userQuery)
{ {
String code = userQuery.getCode(); String code = userQuery.getCode();
if (code.startsWith("@SQL=")) {
m_whereUserQuery = "(" + code.substring(code.indexOf("=")+1, code.length()) + ")";
log.log(Level.INFO, m_whereUserQuery);
hideAdvanced();
} else {
String[] segments = code.split(Pattern.quote(SEGMENT_SEPARATOR)); String[] segments = code.split(Pattern.quote(SEGMENT_SEPARATOR));
List<?> rowList = advancedPanel.getChildren(); List<?> rowList = advancedPanel.getChildren();
@ -1506,8 +1520,9 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
//historyCombo.setSelectedItem(new Comboitem(history, history)); //historyCombo.setSelectedItem(new Comboitem(history, history));
historyCombo.setSelectedIndex(getHistoryIndex(history)+1); historyCombo.setSelectedIndex(getHistoryIndex(history)+1);
} }
}
advancedPanel.invalidate(); winAdvanced.invalidate();
} }
private int getHistoryIndex(String value) private int getHistoryIndex(String value)
@ -1613,6 +1628,8 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
// //
m_query = new MQuery(m_tableName); m_query = new MQuery(m_tableName);
m_query.addRestriction(Env.parseContext(Env.getCtx(), m_targetWindowNo, m_whereExtended, false)); m_query.addRestriction(Env.parseContext(Env.getCtx(), m_targetWindowNo, m_whereExtended, false));
if (m_whereUserQuery == null) {
StringBuilder code = new StringBuilder(); StringBuilder code = new StringBuilder();
int openBrackets = 0; int openBrackets = 0;
@ -1753,6 +1770,9 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
} }
saveQuery(saveQuery, code, shareAllUsers); saveQuery(saveQuery, code, shareAllUsers);
} else {
m_query.addRestriction(Env.parseContext(Env.getCtx(), m_targetWindowNo, m_whereUserQuery, false));
}
} // cmd_saveAdvanced } // cmd_saveAdvanced
@ -2340,15 +2360,14 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
rs = null; rs = null;
stmt = null; stmt = null;
} }
MRole role = MRole.getDefault();
// No Records // No Records
/* if (m_total == 0 && alertZeroRecords) /* if (m_total == 0 && alertZeroRecords)
FDialog.warn(m_targetWindowNo, this, "FindZeroRecords");*/ FDialog.warn(m_targetWindowNo, this, "FindZeroRecords");*/
// More then allowed // More then allowed
if (query != null && role.isQueryMax(m_total)) if (m_gridTab != null && query != null && m_gridTab.isQueryMax(m_total))
{ {
FDialog.error(m_targetWindowNo, this, "FindOverMax", FDialog.error(m_targetWindowNo, this, "FindOverMax",
m_total + " > " + role.getMaxQueryRecords()); m_total + " > " + m_gridTab.getMaxQueryRecords());
m_total = 0; // return 0 if more then allowed - teo_sarca [ 1708717 ] m_total = 0; // return 0 if more then allowed - teo_sarca [ 1708717 ]
} }
else else
@ -2536,8 +2555,7 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
*/ */
public MQuery getQuery() public MQuery getQuery()
{ {
MRole role = MRole.getDefault(); if (m_gridTab != null && m_gridTab.isQueryMax(getTotalRecords()) && !m_isCancel)
if (role.isQueryMax(getTotalRecords()) && !m_isCancel)
{ {
m_query = MQuery.getNoRecordQuery (m_tableName, false); m_query = MQuery.getNoRecordQuery (m_tableName, false);
m_total = 0; m_total = 0;
@ -2709,4 +2727,14 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
} // setDtatusDB } // setDtatusDB
/** END DEVCOFFEE **/ /** END DEVCOFFEE **/
private void hideAdvanced() {
advancedPanelToolBar.setVisible(false);
advancedPanel.setVisible(false);
}
private void showAdvanced() {
advancedPanelToolBar.setVisible(true);
advancedPanel.setVisible(true);
}
} // FindPanel } // FindPanel

View File

@ -250,8 +250,7 @@ public class FactReconcile {
return false; return false;
} }
rec.setMatchCode(null); return rec.delete(false);
return rec.save();
} }
protected Vector<KeyNamePair> getAccount(){ protected Vector<KeyNamePair> getAccount(){