From ce3406650e9e6cb4a62e885b0c27ae89b9c78af6 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 18 Jul 2014 19:10:31 -0500 Subject: [PATCH 01/10] IDEMPIERE-2079 2Pack problem exporting/importing translation tabs --- .../pipo2/handler/GenericPOElementHandler.java | 14 ++++++++++---- .../org/adempiere/pipo2/GridTab2PackExporter.java | 2 ++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/GenericPOElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/GenericPOElementHandler.java index 7eebb5f8d5..ed61cc9148 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/GenericPOElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/GenericPOElementHandler.java @@ -53,13 +53,13 @@ import org.xml.sax.helpers.AttributesImpl; */ public class GenericPOElementHandler extends AbstractElementHandler { - private String tableName; + private String m_tableName; public GenericPOElementHandler() { } public GenericPOElementHandler(String tableName) { - this.tableName = tableName; + this.m_tableName = tableName; } public void startElement(PIPOContext ctx, Element element) throws SAXException { @@ -223,6 +223,12 @@ public class GenericPOElementHandler extends AbstractElementHandler { document.startElement("", "", tables[index], atts); PoExporter filler = new PoExporter(ctx, document, po); filler.export(excludes, true); + ctx.packOut.getCtx().ctx.put("Table_Name",tables[index]); + try { + new CommonTranslationHandler().packOut(ctx.packOut,document,null,po.get_ID()); + } catch(Exception e) { + if (log.isLoggable(Level.INFO)) log.info(e.toString()); + } } } for (int i=index+1; i gridTab.getTabLevel()+1) { sql = sql.append(">").append(child.getTableName()); } else { From 6953754984f32a2f045e43c3597ee28c46ffb7c8 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 18 Jul 2014 19:11:47 -0500 Subject: [PATCH 02/10] IDEMPIERE-2079 2Pack problem exporting/importing translation tabs --- .../src/org/adempiere/pipo2/GridTab2PackExporter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/org.adempiere.pipo/src/org/adempiere/pipo2/GridTab2PackExporter.java b/org.adempiere.pipo/src/org/adempiere/pipo2/GridTab2PackExporter.java index 83c02ab32d..b8b4d6e2c3 100644 --- a/org.adempiere.pipo/src/org/adempiere/pipo2/GridTab2PackExporter.java +++ b/org.adempiere.pipo/src/org/adempiere/pipo2/GridTab2PackExporter.java @@ -159,10 +159,12 @@ public class GridTab2PackExporter implements IGridTabExporter { /** * {@inheritDoc} - * With 2Pack, everry tab is support to export + * With 2Pack, just trl tabs are not intended to be exported (they are exported as translation */ @Override public boolean isExportableTab(GridTab gridTab) { + if (gridTab.getTableName().toLowerCase().endsWith("_trl")) + return false; return true; } } From 33120387c276117a39d34755dc29e7b90abdc474 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 22 Jul 2014 16:53:25 -0500 Subject: [PATCH 03/10] IDEMPIERE-2083 can't complete a internal inventory when date account > date account all receipt / IDEMPIERE-1770 / thanks to Hiep (hieplq) --- org.adempiere.base/src/org/compiere/model/MInventoryLineMA.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/model/MInventoryLineMA.java b/org.adempiere.base/src/org/compiere/model/MInventoryLineMA.java index 7db4fce3d6..951266607a 100644 --- a/org.adempiere.base/src/org/compiere/model/MInventoryLineMA.java +++ b/org.adempiere.base/src/org/compiere/model/MInventoryLineMA.java @@ -238,7 +238,7 @@ public class MInventoryLineMA extends X_M_InventoryLineMA protected boolean beforeSave (boolean newRecord) { //Set DateMaterialPolicy - if(is_ValueChanged(COLUMNNAME_M_AttributeSetInstance_ID)){ + if(!newRecord && is_ValueChanged(COLUMNNAME_M_AttributeSetInstance_ID)){ I_M_InventoryLine line = getM_InventoryLine(); Timestamp dateMPolicy = null; From afb8d58ef6500d06a75f03fca4d941745f884481 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 23 Jul 2014 10:05:25 -0500 Subject: [PATCH 04/10] IDEMPIERE-2077 Go to the HTML tab of WTextEditorDialog when a field IsHtml is checked in the window / based on patch from Nicolas Micoud (nmicoud) --- .../org/adempiere/webui/editor/WStringEditor.java | 10 +++++++++- .../adempiere/webui/window/WTextEditorDialog.java | 15 +++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java index a5b601e5dc..606656ea6c 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java @@ -233,8 +233,16 @@ public class WStringEditor extends WEditor implements ContextMenuListener else if (WEditorPopupMenu.EDITOR_EVENT.equals(evt.getContextEvent())) { adwindowContent = findADWindowContent(); + boolean isHtml = false; + if (( gridField.getDisplayType() == DisplayType.Text + || gridField.getDisplayType() == DisplayType.TextLong + || gridField.getDisplayType() == DisplayType.Memo) + && adwindowContent != null + && adwindowContent.getActiveGridTab() != null) { + isHtml = adwindowContent.getActiveGridTab().getValueAsBoolean("IsHtml"); + } final WTextEditorDialog dialog = new WTextEditorDialog(gridField.getVO().Header, getDisplay(), - isReadWrite(), gridField.getFieldLength()); + isReadWrite(), gridField.getFieldLength(), isHtml); dialog.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener() { @Override public void onEvent(Event event) throws Exception { 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 589487da2f..3efe983d31 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 @@ -38,11 +38,11 @@ import org.zkoss.zul.Vlayout; * */ public class WTextEditorDialog extends Window implements EventListener{ - /** * */ - private static final long serialVersionUID = -3852236029054284848L; + private static final long serialVersionUID = 1188165765430615546L; + private boolean editable; private int maxSize; private String text; @@ -59,8 +59,9 @@ public class WTextEditorDialog extends Window implements EventListener{ * @param text * @param editable * @param maxSize + * @param isHtml - select the html tab at start */ - public WTextEditorDialog(String title, String text, boolean editable, int maxSize) { + public WTextEditorDialog(String title, String text, boolean editable, int maxSize, boolean IsHtml) { super(); setTitle(title); this.editable = editable; @@ -68,8 +69,14 @@ public class WTextEditorDialog extends Window implements EventListener{ this.text = text; init(); + if (IsHtml) + tabbox.setSelectedTab(htmlTab); } - + + public WTextEditorDialog(String title, String text, boolean editable, int maxSize) { + this(title, text, editable, maxSize, false); + } + private void init() { setBorder("normal"); setHeight("450px"); From d67c4db60a20f8dc4d70eb7f635a0666fe399fe0 Mon Sep 17 00:00:00 2001 From: hieplq Date: Wed, 23 Jul 2014 11:12:33 +0700 Subject: [PATCH 05/10] IDEMPIERE-2083 can't complete a internal inventory when date account > date account all receipt --- org.adempiere.base/src/org/compiere/model/MInOutLineMA.java | 2 +- org.adempiere.base/src/org/compiere/model/MMovementLineMA.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MInOutLineMA.java b/org.adempiere.base/src/org/compiere/model/MInOutLineMA.java index 7c38d690b6..71f879543c 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOutLineMA.java +++ b/org.adempiere.base/src/org/compiere/model/MInOutLineMA.java @@ -264,7 +264,7 @@ public class MInOutLineMA extends X_M_InOutLineMA protected boolean beforeSave (boolean newRecord) { //Set DateMaterialPolicy - if(is_ValueChanged(COLUMNNAME_M_AttributeSetInstance_ID)){ + if(!newRecord && is_ValueChanged(COLUMNNAME_M_AttributeSetInstance_ID)){ //TODO Require testing for all scenario I_M_InOutLine line = getM_InOutLine(); diff --git a/org.adempiere.base/src/org/compiere/model/MMovementLineMA.java b/org.adempiere.base/src/org/compiere/model/MMovementLineMA.java index 5283b852ef..ddb3a67217 100644 --- a/org.adempiere.base/src/org/compiere/model/MMovementLineMA.java +++ b/org.adempiere.base/src/org/compiere/model/MMovementLineMA.java @@ -243,7 +243,7 @@ public class MMovementLineMA extends X_M_MovementLineMA protected boolean beforeSave (boolean newRecord) { //Set DateMaterialPolicy - if(is_ValueChanged(COLUMNNAME_M_AttributeSetInstance_ID)){ + if(!newRecord && is_ValueChanged(COLUMNNAME_M_AttributeSetInstance_ID)){ I_M_MovementLine line = getM_MovementLine(); Timestamp dateMPolicy = null; From ad302c7dedc086709320bcf11a6a3c4778b20674 Mon Sep 17 00:00:00 2001 From: Nicolas Micoud Date: Wed, 23 Jul 2014 10:42:26 -0500 Subject: [PATCH 06/10] IDEMPIERE-2073 AD_Val_Rule_ID is missing from AD_UserDef_Field --- .../oracle/201407172028_IDEMPIERE-2073.sql | 122 ++++++++++++++++++ .../201407172028_IDEMPIERE-2073.sql | 119 +++++++++++++++++ .../src/org/compiere/model/GridFieldVO.java | 7 +- .../compiere/model/I_AD_UserDef_Field.java | 15 +++ .../compiere/model/X_AD_UserDef_Field.java | 30 ++++- 5 files changed, 290 insertions(+), 3 deletions(-) create mode 100644 migration/i2.0/oracle/201407172028_IDEMPIERE-2073.sql create mode 100644 migration/i2.0/postgresql/201407172028_IDEMPIERE-2073.sql diff --git a/migration/i2.0/oracle/201407172028_IDEMPIERE-2073.sql b/migration/i2.0/oracle/201407172028_IDEMPIERE-2073.sql new file mode 100644 index 0000000000..c7cbe9f5f1 --- /dev/null +++ b/migration/i2.0/oracle/201407172028_IDEMPIERE-2073.sql @@ -0,0 +1,122 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Jul 17, 2014 8:23:45 PM CEST +-- IDEMPIERE-2073 +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,211571,'5bd0edd0-0f13-463e-bf7d-4f8f8d5a8aa3',139,0,19,464,'AD_Val_Rule_ID',TO_DATE('2014-07-17 20:23:44','YYYY-MM-DD HH24:MI:SS'),100,'Dynamic Validation Rule','D','N',22,'These rules define how an entry is determined to valid. You can use variables for dynamic (context sensitive) validation.','Y','Y','Y','N','N','N','N','N','N','N','N','N','N','N','N','Y','Dynamic Validation',0,0,TO_DATE('2014-07-17 20:23:44','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jul 17, 2014 8:23:48 PM CEST +UPDATE AD_Column SET FKConstraintName='ADValRule_ADUserDefField', FKConstraintType='N',Updated=TO_DATE('2014-07-17 20:23:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=211571 +; + +-- Jul 17, 2014 8:23:48 PM CEST +ALTER TABLE AD_UserDef_Field ADD AD_Val_Rule_ID NUMBER(10) DEFAULT NULL +; + +-- Jul 17, 2014 8:23:48 PM CEST +ALTER TABLE AD_UserDef_Field ADD CONSTRAINT ADValRule_ADUserDefField FOREIGN KEY (AD_Val_Rule_ID) REFERENCES AD_VAL_RULE(AD_VAL_RULE_ID) DEFERRABLE INITIALLY DEFERRED +; + +-- Jul 17, 2014 8:24:03 PM CEST +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,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,Updated,UpdatedBy) VALUES (0,211571,203266,'e0427cf3-b251-47c0-aa58-afc672aac597',0,395,2,TO_DATE('2014-07-17 20:24:03','YYYY-MM-DD HH24:MI:SS'),100,'Dynamic Validation Rule',22,'D','These rules define how an entry is determined to valid. You can use variables for dynamic (context sensitive) validation.','Y','Y','Y','N','N','N','N','N','Dynamic Validation',280,TO_DATE('2014-07-17 20:24:03','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jul 17, 2014 8:24:22 PM CEST +UPDATE AD_Field SET SeqNoGrid=160,IsDisplayedGrid='Y' WHERE AD_Field_ID=200857 +; + +-- Jul 17, 2014 8:24:22 PM CEST +UPDATE AD_Field SET SeqNoGrid=170,IsDisplayedGrid='Y' WHERE AD_Field_ID=200850 +; + +-- Jul 17, 2014 8:24:22 PM CEST +UPDATE AD_Field SET SeqNoGrid=180,IsDisplayedGrid='Y' WHERE AD_Field_ID=5055 +; + +-- Jul 17, 2014 8:24:22 PM CEST +UPDATE AD_Field SET SeqNoGrid=190,IsDisplayedGrid='Y' WHERE AD_Field_ID=11252 +; + +-- Jul 17, 2014 8:24:22 PM CEST +UPDATE AD_Field SET SeqNoGrid=200,IsDisplayedGrid='Y' WHERE AD_Field_ID=200853 +; + +-- Jul 17, 2014 8:24:22 PM CEST +UPDATE AD_Field SET SeqNoGrid=210,IsDisplayedGrid='Y' WHERE AD_Field_ID=200858 +; + +-- Jul 17, 2014 8:24:22 PM CEST +UPDATE AD_Field SET SeqNoGrid=220,IsDisplayedGrid='Y' WHERE AD_Field_ID=200856 +; + +-- Jul 17, 2014 8:24:22 PM CEST +UPDATE AD_Field SET SeqNoGrid=230,IsDisplayedGrid='Y' WHERE AD_Field_ID=200855 +; + +-- Jul 17, 2014 8:24:22 PM CEST +UPDATE AD_Field SET SeqNoGrid=240,IsDisplayedGrid='Y' WHERE AD_Field_ID=200849 +; + +-- Jul 17, 2014 8:24:22 PM CEST +UPDATE AD_Field SET SeqNoGrid=250,IsDisplayedGrid='Y' WHERE AD_Field_ID=200851 +; + +-- Jul 17, 2014 8:24:22 PM CEST +UPDATE AD_Field SET SeqNoGrid=260,IsDisplayedGrid='Y' WHERE AD_Field_ID=200852 +; + +-- Jul 17, 2014 8:24:22 PM CEST +UPDATE AD_Field SET SeqNoGrid=270,IsDisplayedGrid='Y' WHERE AD_Field_ID=200854 +; + +-- Jul 17, 2014 8:24:22 PM CEST +UPDATE AD_Field SET SeqNoGrid=280,IsDisplayedGrid='Y' WHERE AD_Field_ID=203266 +; + +-- Jul 17, 2014 8:24:59 PM CEST +UPDATE AD_Field SET SeqNo=210,IsDisplayed='Y' WHERE AD_Field_ID=203266 +; + +-- Jul 17, 2014 8:24:59 PM CEST +UPDATE AD_Field SET SeqNo=220,IsDisplayed='Y' WHERE AD_Field_ID=5054 +; + +-- Jul 17, 2014 8:24:59 PM CEST +UPDATE AD_Field SET SeqNo=230,IsDisplayed='Y' WHERE AD_Field_ID=200849 +; + +-- Jul 17, 2014 8:24:59 PM CEST +UPDATE AD_Field SET SeqNo=240,IsDisplayed='Y' WHERE AD_Field_ID=200851 +; + +-- Jul 17, 2014 8:24:59 PM CEST +UPDATE AD_Field SET SeqNo=250,IsDisplayed='Y' WHERE AD_Field_ID=200852 +; + +-- Jul 17, 2014 8:24:59 PM CEST +UPDATE AD_Field SET SeqNo=260,IsDisplayed='Y' WHERE AD_Field_ID=200854 +; + +-- Jul 17, 2014 8:24:59 PM CEST +UPDATE AD_Field SET SeqNo=270,IsDisplayed='Y' WHERE AD_Field_ID=5051 +; + +-- Jul 17, 2014 8:24:59 PM CEST +UPDATE AD_Field SET SeqNo=280,IsDisplayed='Y' WHERE AD_Field_ID=5057 +; + +-- Jul 17, 2014 8:25:24 PM CEST +UPDATE AD_Field SET IsDisplayed='Y', SeqNo=210, XPosition=4,Updated=TO_DATE('2014-07-17 20:25:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203266 +; + +-- Jul 17, 2014 8:26:05 PM CEST +UPDATE AD_Field SET DisplayLogic='@AD_Reference_ID@=17 | @AD_Reference_ID@=18 | @AD_Reference_ID@=19 | @AD_Reference_ID@=28 | @AD_Reference_ID@=30 | @AD_Reference_ID@=200012',Updated=TO_DATE('2014-07-17 20:26:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203266 +; + +-- Jul 17, 2014 8:26:41 PM CEST +UPDATE AD_Field SET IsSameLine='Y',Updated=TO_DATE('2014-07-17 20:26:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203266 +; + +SELECT register_migration_script('201407172028_IDEMPIERE-2073.sql') FROM dual +; \ No newline at end of file diff --git a/migration/i2.0/postgresql/201407172028_IDEMPIERE-2073.sql b/migration/i2.0/postgresql/201407172028_IDEMPIERE-2073.sql new file mode 100644 index 0000000000..0cfe808cd2 --- /dev/null +++ b/migration/i2.0/postgresql/201407172028_IDEMPIERE-2073.sql @@ -0,0 +1,119 @@ +-- Jul 17, 2014 8:23:45 PM CEST +-- IDEMPIERE-2073 +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,211571,'5bd0edd0-0f13-463e-bf7d-4f8f8d5a8aa3',139,0,19,464,'AD_Val_Rule_ID',TO_TIMESTAMP('2014-07-17 20:23:44','YYYY-MM-DD HH24:MI:SS'),100,'Dynamic Validation Rule','D','N',22,'These rules define how an entry is determined to valid. You can use variables for dynamic (context sensitive) validation.','Y','Y','Y','N','N','N','N','N','N','N','N','N','N','N','N','Y','Dynamic Validation',0,0,TO_TIMESTAMP('2014-07-17 20:23:44','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jul 17, 2014 8:23:48 PM CEST +UPDATE AD_Column SET FKConstraintName='ADValRule_ADUserDefField', FKConstraintType='N',Updated=TO_TIMESTAMP('2014-07-17 20:23:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=211571 +; + +-- Jul 17, 2014 8:23:48 PM CEST +ALTER TABLE AD_UserDef_Field ADD COLUMN AD_Val_Rule_ID NUMERIC(10) DEFAULT NULL +; + +-- Jul 17, 2014 8:23:48 PM CEST +ALTER TABLE AD_UserDef_Field ADD CONSTRAINT ADValRule_ADUserDefField FOREIGN KEY (AD_Val_Rule_ID) REFERENCES AD_VAL_RULE(AD_VAL_RULE_ID) DEFERRABLE INITIALLY DEFERRED +; + +-- Jul 17, 2014 8:24:03 PM CEST +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,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,Updated,UpdatedBy) VALUES (0,211571,203266,'e0427cf3-b251-47c0-aa58-afc672aac597',0,395,2,TO_TIMESTAMP('2014-07-17 20:24:03','YYYY-MM-DD HH24:MI:SS'),100,'Dynamic Validation Rule',22,'D','These rules define how an entry is determined to valid. You can use variables for dynamic (context sensitive) validation.','Y','Y','Y','N','N','N','N','N','Dynamic Validation',280,TO_TIMESTAMP('2014-07-17 20:24:03','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jul 17, 2014 8:24:22 PM CEST +UPDATE AD_Field SET SeqNoGrid=160,IsDisplayedGrid='Y' WHERE AD_Field_ID=200857 +; + +-- Jul 17, 2014 8:24:22 PM CEST +UPDATE AD_Field SET SeqNoGrid=170,IsDisplayedGrid='Y' WHERE AD_Field_ID=200850 +; + +-- Jul 17, 2014 8:24:22 PM CEST +UPDATE AD_Field SET SeqNoGrid=180,IsDisplayedGrid='Y' WHERE AD_Field_ID=5055 +; + +-- Jul 17, 2014 8:24:22 PM CEST +UPDATE AD_Field SET SeqNoGrid=190,IsDisplayedGrid='Y' WHERE AD_Field_ID=11252 +; + +-- Jul 17, 2014 8:24:22 PM CEST +UPDATE AD_Field SET SeqNoGrid=200,IsDisplayedGrid='Y' WHERE AD_Field_ID=200853 +; + +-- Jul 17, 2014 8:24:22 PM CEST +UPDATE AD_Field SET SeqNoGrid=210,IsDisplayedGrid='Y' WHERE AD_Field_ID=200858 +; + +-- Jul 17, 2014 8:24:22 PM CEST +UPDATE AD_Field SET SeqNoGrid=220,IsDisplayedGrid='Y' WHERE AD_Field_ID=200856 +; + +-- Jul 17, 2014 8:24:22 PM CEST +UPDATE AD_Field SET SeqNoGrid=230,IsDisplayedGrid='Y' WHERE AD_Field_ID=200855 +; + +-- Jul 17, 2014 8:24:22 PM CEST +UPDATE AD_Field SET SeqNoGrid=240,IsDisplayedGrid='Y' WHERE AD_Field_ID=200849 +; + +-- Jul 17, 2014 8:24:22 PM CEST +UPDATE AD_Field SET SeqNoGrid=250,IsDisplayedGrid='Y' WHERE AD_Field_ID=200851 +; + +-- Jul 17, 2014 8:24:22 PM CEST +UPDATE AD_Field SET SeqNoGrid=260,IsDisplayedGrid='Y' WHERE AD_Field_ID=200852 +; + +-- Jul 17, 2014 8:24:22 PM CEST +UPDATE AD_Field SET SeqNoGrid=270,IsDisplayedGrid='Y' WHERE AD_Field_ID=200854 +; + +-- Jul 17, 2014 8:24:22 PM CEST +UPDATE AD_Field SET SeqNoGrid=280,IsDisplayedGrid='Y' WHERE AD_Field_ID=203266 +; + +-- Jul 17, 2014 8:24:59 PM CEST +UPDATE AD_Field SET SeqNo=210,IsDisplayed='Y' WHERE AD_Field_ID=203266 +; + +-- Jul 17, 2014 8:24:59 PM CEST +UPDATE AD_Field SET SeqNo=220,IsDisplayed='Y' WHERE AD_Field_ID=5054 +; + +-- Jul 17, 2014 8:24:59 PM CEST +UPDATE AD_Field SET SeqNo=230,IsDisplayed='Y' WHERE AD_Field_ID=200849 +; + +-- Jul 17, 2014 8:24:59 PM CEST +UPDATE AD_Field SET SeqNo=240,IsDisplayed='Y' WHERE AD_Field_ID=200851 +; + +-- Jul 17, 2014 8:24:59 PM CEST +UPDATE AD_Field SET SeqNo=250,IsDisplayed='Y' WHERE AD_Field_ID=200852 +; + +-- Jul 17, 2014 8:24:59 PM CEST +UPDATE AD_Field SET SeqNo=260,IsDisplayed='Y' WHERE AD_Field_ID=200854 +; + +-- Jul 17, 2014 8:24:59 PM CEST +UPDATE AD_Field SET SeqNo=270,IsDisplayed='Y' WHERE AD_Field_ID=5051 +; + +-- Jul 17, 2014 8:24:59 PM CEST +UPDATE AD_Field SET SeqNo=280,IsDisplayed='Y' WHERE AD_Field_ID=5057 +; + +-- Jul 17, 2014 8:25:24 PM CEST +UPDATE AD_Field SET IsDisplayed='Y', SeqNo=210, XPosition=4,Updated=TO_TIMESTAMP('2014-07-17 20:25:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203266 +; + +-- Jul 17, 2014 8:26:05 PM CEST +UPDATE AD_Field SET DisplayLogic='@AD_Reference_ID@=17 | @AD_Reference_ID@=18 | @AD_Reference_ID@=19 | @AD_Reference_ID@=28 | @AD_Reference_ID@=30 | @AD_Reference_ID@=200012',Updated=TO_TIMESTAMP('2014-07-17 20:26:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203266 +; + +-- Jul 17, 2014 8:26:41 PM CEST +UPDATE AD_Field SET IsSameLine='Y',Updated=TO_TIMESTAMP('2014-07-17 20:26:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203266 +; + +SELECT register_migration_script('201407172028_IDEMPIERE-2073.sql') FROM dual +; \ No newline at end of file diff --git a/org.adempiere.base/src/org/compiere/model/GridFieldVO.java b/org.adempiere.base/src/org/compiere/model/GridFieldVO.java index 8a1f6deebf..6220f6123e 100644 --- a/org.adempiere.base/src/org/compiere/model/GridFieldVO.java +++ b/org.adempiere.base/src/org/compiere/model/GridFieldVO.java @@ -17,6 +17,8 @@ *****************************************************************************/ package org.compiere.model; +import static org.compiere.model.SystemIDs.REFERENCE_AD_USER; + import java.io.Serializable; import java.sql.ResultSet; import java.sql.ResultSetMetaData; @@ -26,9 +28,9 @@ import java.util.Properties; import java.util.logging.Level; import org.compiere.util.CLogger; +import org.compiere.util.DB; import org.compiere.util.DisplayType; import org.compiere.util.Env; -import static org.compiere.model.SystemIDs.*; /** @@ -297,7 +299,8 @@ public class GridFieldVO implements Serializable //IDEMPIERE-1120 Implement Field SeqNo customization if (userDef.getSeqNo() > 0) vo.SeqNo = userDef.getSeqNo(); - + if (userDef.getAD_Val_Rule_ID() > 0) + vo.ValidationCode = DB.getSQLValueStringEx(null, "SELECT Code FROM AD_Val_Rule WHERE AD_Val_Rule_ID = ?", userDef.getAD_Val_Rule_ID()); } } // diff --git a/org.adempiere.base/src/org/compiere/model/I_AD_UserDef_Field.java b/org.adempiere.base/src/org/compiere/model/I_AD_UserDef_Field.java index 8fb5d15bc4..8c4027652f 100644 --- a/org.adempiere.base/src/org/compiere/model/I_AD_UserDef_Field.java +++ b/org.adempiere.base/src/org/compiere/model/I_AD_UserDef_Field.java @@ -136,6 +136,21 @@ public interface I_AD_UserDef_Field public org.compiere.model.I_AD_UserDef_Tab getAD_UserDef_Tab() throws RuntimeException; + /** Column name AD_Val_Rule_ID */ + public static final String COLUMNNAME_AD_Val_Rule_ID = "AD_Val_Rule_ID"; + + /** Set Dynamic Validation. + * Dynamic Validation Rule + */ + public void setAD_Val_Rule_ID (int AD_Val_Rule_ID); + + /** Get Dynamic Validation. + * Dynamic Validation Rule + */ + public int getAD_Val_Rule_ID(); + + public org.compiere.model.I_AD_Val_Rule getAD_Val_Rule() throws RuntimeException; + /** Column name ColumnSpan */ public static final String COLUMNNAME_ColumnSpan = "ColumnSpan"; diff --git a/org.adempiere.base/src/org/compiere/model/X_AD_UserDef_Field.java b/org.adempiere.base/src/org/compiere/model/X_AD_UserDef_Field.java index 5ab19f4d2a..d3ebdc3742 100644 --- a/org.adempiere.base/src/org/compiere/model/X_AD_UserDef_Field.java +++ b/org.adempiere.base/src/org/compiere/model/X_AD_UserDef_Field.java @@ -30,7 +30,7 @@ public class X_AD_UserDef_Field extends PO implements I_AD_UserDef_Field, I_Pers /** * */ - private static final long serialVersionUID = 20131031L; + private static final long serialVersionUID = 20140717L; /** Standard Constructor */ public X_AD_UserDef_Field (Properties ctx, int AD_UserDef_Field_ID, String trxName) @@ -225,6 +225,34 @@ public class X_AD_UserDef_Field extends PO implements I_AD_UserDef_Field, I_Pers return ii.intValue(); } + public org.compiere.model.I_AD_Val_Rule getAD_Val_Rule() throws RuntimeException + { + return (org.compiere.model.I_AD_Val_Rule)MTable.get(getCtx(), org.compiere.model.I_AD_Val_Rule.Table_Name) + .getPO(getAD_Val_Rule_ID(), get_TrxName()); } + + /** Set Dynamic Validation. + @param AD_Val_Rule_ID + Dynamic Validation Rule + */ + public void setAD_Val_Rule_ID (int AD_Val_Rule_ID) + { + if (AD_Val_Rule_ID < 1) + set_Value (COLUMNNAME_AD_Val_Rule_ID, null); + else + set_Value (COLUMNNAME_AD_Val_Rule_ID, Integer.valueOf(AD_Val_Rule_ID)); + } + + /** Get Dynamic Validation. + @return Dynamic Validation Rule + */ + public int getAD_Val_Rule_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_AD_Val_Rule_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + /** Set Column Span. @param ColumnSpan Number of column for a box of field From 10ce8aa22e2c86eb662cc64012ed70bd4728499f Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 23 Jul 2014 11:10:24 -0500 Subject: [PATCH 07/10] IDEMPIERE-2073 AD_Val_Rule_ID is missing from AD_UserDef_Field --- .../oracle/201407172028_IDEMPIERE-2073.sql | 0 .../oracle/201407231109_IDEMPIERE-2073.sql | 11 ++ .../201407172028_IDEMPIERE-2073.sql | 0 .../201407231109_IDEMPIERE-2073.sql | 8 ++ .../src/org/compiere/model/GridFieldVO.java | 3 +- .../src/org/compiere/model/MValRule.java | 103 ++++++++++++++++++ 6 files changed, 123 insertions(+), 2 deletions(-) rename migration/{i2.0 => i2.0z}/oracle/201407172028_IDEMPIERE-2073.sql (100%) create mode 100644 migration/i2.0z/oracle/201407231109_IDEMPIERE-2073.sql rename migration/{i2.0 => i2.0z}/postgresql/201407172028_IDEMPIERE-2073.sql (100%) create mode 100644 migration/i2.0z/postgresql/201407231109_IDEMPIERE-2073.sql create mode 100644 org.adempiere.base/src/org/compiere/model/MValRule.java diff --git a/migration/i2.0/oracle/201407172028_IDEMPIERE-2073.sql b/migration/i2.0z/oracle/201407172028_IDEMPIERE-2073.sql similarity index 100% rename from migration/i2.0/oracle/201407172028_IDEMPIERE-2073.sql rename to migration/i2.0z/oracle/201407172028_IDEMPIERE-2073.sql diff --git a/migration/i2.0z/oracle/201407231109_IDEMPIERE-2073.sql b/migration/i2.0z/oracle/201407231109_IDEMPIERE-2073.sql new file mode 100644 index 0000000000..8888bd21f7 --- /dev/null +++ b/migration/i2.0z/oracle/201407231109_IDEMPIERE-2073.sql @@ -0,0 +1,11 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Jul 23, 2014 11:07:39 AM COT +-- IDEMPIERE-2073 AD_Val_Rule_ID is missing from AD_UserDef_Field +UPDATE AD_Field SET IsAdvancedField='Y',Updated=TO_DATE('2014-07-23 11:07:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203266 +; + +SELECT register_migration_script('201407231109_IDEMPIERE-2073.sql') FROM dual +; + diff --git a/migration/i2.0/postgresql/201407172028_IDEMPIERE-2073.sql b/migration/i2.0z/postgresql/201407172028_IDEMPIERE-2073.sql similarity index 100% rename from migration/i2.0/postgresql/201407172028_IDEMPIERE-2073.sql rename to migration/i2.0z/postgresql/201407172028_IDEMPIERE-2073.sql diff --git a/migration/i2.0z/postgresql/201407231109_IDEMPIERE-2073.sql b/migration/i2.0z/postgresql/201407231109_IDEMPIERE-2073.sql new file mode 100644 index 0000000000..cdc0cc622f --- /dev/null +++ b/migration/i2.0z/postgresql/201407231109_IDEMPIERE-2073.sql @@ -0,0 +1,8 @@ +-- Jul 23, 2014 11:07:39 AM COT +-- IDEMPIERE-2073 AD_Val_Rule_ID is missing from AD_UserDef_Field +UPDATE AD_Field SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2014-07-23 11:07:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203266 +; + +SELECT register_migration_script('201407231109_IDEMPIERE-2073.sql') FROM dual +; + diff --git a/org.adempiere.base/src/org/compiere/model/GridFieldVO.java b/org.adempiere.base/src/org/compiere/model/GridFieldVO.java index 6220f6123e..d051465393 100644 --- a/org.adempiere.base/src/org/compiere/model/GridFieldVO.java +++ b/org.adempiere.base/src/org/compiere/model/GridFieldVO.java @@ -28,7 +28,6 @@ import java.util.Properties; import java.util.logging.Level; import org.compiere.util.CLogger; -import org.compiere.util.DB; import org.compiere.util.DisplayType; import org.compiere.util.Env; @@ -300,7 +299,7 @@ public class GridFieldVO implements Serializable if (userDef.getSeqNo() > 0) vo.SeqNo = userDef.getSeqNo(); if (userDef.getAD_Val_Rule_ID() > 0) - vo.ValidationCode = DB.getSQLValueStringEx(null, "SELECT Code FROM AD_Val_Rule WHERE AD_Val_Rule_ID = ?", userDef.getAD_Val_Rule_ID()); + vo.ValidationCode = MValRule.get(ctx, userDef.getAD_Val_Rule_ID()).getCode(); } } // diff --git a/org.adempiere.base/src/org/compiere/model/MValRule.java b/org.adempiere.base/src/org/compiere/model/MValRule.java new file mode 100644 index 0000000000..ef38c0bc07 --- /dev/null +++ b/org.adempiere.base/src/org/compiere/model/MValRule.java @@ -0,0 +1,103 @@ +/********************************************************************** +* This file is part of iDempiere ERP Open Source * +* http://www.idempiere.org * +* * +* Copyright (C) Contributors * +* * +* This program is free software; you can redistribute it and/or * +* modify it under the terms of the GNU General Public License * +* as published by the Free Software Foundation; either version 2 * +* of the License, or (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU General Public License * +* along with this program; if not, write to the Free Software * +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * +* MA 02110-1301, USA. * +* * +* Contributors: * +* - Carlos Ruiz - globalqss * +**********************************************************************/ +package org.compiere.model; + +import java.sql.ResultSet; +import java.util.Properties; + +import org.compiere.util.CCache; +import org.compiere.util.CLogger; + +/** + * Persistent Validation Rule Model + * @author Carlos Ruiz + * @version $Id: MValRule.java + */ +public class MValRule extends X_AD_Val_Rule +{ + /** + * + */ + private static final long serialVersionUID = -8482599477870030638L; + + /** + * Get Rule from Cache + * @param ctx context + * @param AD_Val_Rule_ID id + * @return MValRule + */ + public static MValRule get (Properties ctx, int AD_Val_Rule_ID) + { + Integer key = new Integer (AD_Val_Rule_ID); + MValRule retValue = (MValRule) s_cache.get (key); + if (retValue != null) + return retValue; + retValue = new MValRule (ctx, AD_Val_Rule_ID, null); + if (retValue.get_ID () != 0) + s_cache.put (key, retValue); + return retValue; + } // get + + /** Cache */ + private static CCache s_cache = new CCache(Table_Name, 20); + + /** Static Logger */ + @SuppressWarnings("unused") + private static CLogger s_log = CLogger.getCLogger (MValRule.class); + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param AD_Val_Rule_ID id + * @param trxName transaction + */ + public MValRule (Properties ctx, int AD_Val_Rule_ID, String trxName) + { + super (ctx, AD_Val_Rule_ID, trxName); + } // MValRule + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MValRule (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MValRule + + /** + * String Representation + * @return info + */ + public String toString() + { + StringBuilder sb = new StringBuilder ("MValRule["); + sb.append (get_ID()).append ("-").append (getName()).append ("]"); + return sb.toString (); + } // toString + +} // MValRule \ No newline at end of file From 7bb8143f154332e10814c389e8c1d0b51faa0276 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 23 Jul 2014 12:45:10 -0500 Subject: [PATCH 08/10] IDEMPIERE-2072 get number of non business days between 2 dates / based on patch from Nicolas Micoud (nmicoud) --- .../src/org/compiere/util/TimeUtil.java | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/org.adempiere.base/src/org/compiere/util/TimeUtil.java b/org.adempiere.base/src/org/compiere/util/TimeUtil.java index db9b2192f8..1ee35ec51d 100644 --- a/org.adempiere.base/src/org/compiere/util/TimeUtil.java +++ b/org.adempiere.base/src/org/compiere/util/TimeUtil.java @@ -20,6 +20,9 @@ import java.sql.Timestamp; import java.util.BitSet; import java.util.Calendar; import java.util.GregorianCalendar; +import java.util.List; + +import org.compiere.model.MCountry; /** @@ -829,4 +832,51 @@ public class TimeUtil return retValue; } + /** Returns number of non business days between 2 dates */ + public static int getBusinessDaysBetween(Timestamp startDate, Timestamp endDate, int clientID, String trxName) + { + int retValue = 0; + + if (startDate.equals(endDate)) + return 0; + + boolean negative = false; + if (endDate.before(startDate)) { + negative = true; + Timestamp temp = startDate; + startDate = endDate; + endDate = temp; + } + + final String sql = "SELECT Date1 FROM C_NonBusinessDay WHERE AD_Client_ID=? AND Date1 BETWEEN ? AND ? AND COALESCE(C_Country_ID,0) IN (0, ?)"; + List nbd = DB.getSQLValueObjectsEx(trxName, sql, clientID, startDate, endDate, MCountry.getDefault(Env.getCtx()).getC_Country_ID()); + + GregorianCalendar cal = new GregorianCalendar(); + cal.setTime(startDate); + cal.set(Calendar.HOUR_OF_DAY, 0); + cal.set(Calendar.MINUTE, 0); + cal.set(Calendar.SECOND, 0); + cal.set(Calendar.MILLISECOND, 0); + + GregorianCalendar calEnd = new GregorianCalendar(); + calEnd.setTime(endDate); + calEnd.set(Calendar.HOUR_OF_DAY, 0); + calEnd.set(Calendar.MINUTE, 0); + calEnd.set(Calendar.SECOND, 0); + calEnd.set(Calendar.MILLISECOND, 0); + + while (cal.before(calEnd) || cal.equals(calEnd)) { + if (!nbd.contains(new Timestamp(cal.getTimeInMillis()))) { + if (cal.get(Calendar.DAY_OF_WEEK) != Calendar.SATURDAY && cal.get(Calendar.DAY_OF_WEEK) != Calendar.SUNDAY) { + retValue++; + } + } + cal.add(Calendar.DAY_OF_MONTH, 1); + } + + if (negative) + retValue = retValue * -1; + return retValue; + } + } // TimeUtil From 53c142a32c43a3fa6838b13f7cd427e3f0a1609b Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 23 Jul 2014 12:53:51 -0500 Subject: [PATCH 09/10] IDEMPIERE-2086 Task not working on zk --- .../adempiere/webui/dashboard/DPFavourites.java | 2 +- .../src/org/adempiere/webui/window/WTask.java | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPFavourites.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPFavourites.java index 4dc7551224..d5bba7f3fd 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPFavourites.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPFavourites.java @@ -353,7 +353,7 @@ public class DPFavourites extends DashboardPanel implements EventListener return "images/mWindow.png"; if (mt.isReport()) return "images/mReport.png"; - if (mt.isProcess()) + if (mt.isProcess() || mt.isTask()) return "images/mProcess.png"; if (mt.isWorkFlow()) return "images/mWorkFlow.png"; diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WTask.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WTask.java index 8a85aca810..3eb4ee8696 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WTask.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WTask.java @@ -37,9 +37,9 @@ import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; import org.zkoss.zul.Borderlayout; import org.zkoss.zul.Center; -import org.zkoss.zul.South; import org.zkoss.zul.Div; import org.zkoss.zul.Html; +import org.zkoss.zul.South; /** * Application Task @@ -96,7 +96,14 @@ public class WTask extends Window implements EventListener, IHelpContext SessionManager.getAppDesktop().showWindow(this); - Events.echoEvent("executeTask", this, null); + addEventListener("onExecuteTask", new EventListener() { + @Override + public void onEvent(Event event) throws Exception { + executeTask(); + } + }); + + Events.echoEvent("onExecuteTask", this, null); } catch(Exception e) { @@ -204,8 +211,8 @@ public class WTask extends Window implements EventListener, IHelpContext taskThread.interrupt(); else if (e.getName().equals(WindowContainer.ON_WINDOW_CONTAINER_SELECTION_CHANGED_EVENT)) SessionManager.getAppDesktop().updateHelpContext(X_AD_CtxHelp.CTXTYPE_Task, m_task.getAD_Task_ID()); - - SessionManager.getAppDesktop().closeActiveWindow(); + else if (e.getName().equals(Events.ON_CLICK)) + SessionManager.getAppDesktop().closeActiveWindow(); } // actionPerformed } // ATask From 9d8b8e11b7aa21709d4fa23efe672a6d84bbfd1f Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 23 Jul 2014 12:58:33 -0500 Subject: [PATCH 10/10] IDEMPIERE-2072 get number of non business days between 2 dates / forgot the IsActive condition --- org.adempiere.base/src/org/compiere/util/TimeUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/util/TimeUtil.java b/org.adempiere.base/src/org/compiere/util/TimeUtil.java index 1ee35ec51d..68eeeb5e24 100644 --- a/org.adempiere.base/src/org/compiere/util/TimeUtil.java +++ b/org.adempiere.base/src/org/compiere/util/TimeUtil.java @@ -848,7 +848,7 @@ public class TimeUtil endDate = temp; } - final String sql = "SELECT Date1 FROM C_NonBusinessDay WHERE AD_Client_ID=? AND Date1 BETWEEN ? AND ? AND COALESCE(C_Country_ID,0) IN (0, ?)"; + final String sql = "SELECT Date1 FROM C_NonBusinessDay WHERE IsActive='Y' AND AD_Client_ID=? AND Date1 BETWEEN ? AND ? AND COALESCE(C_Country_ID,0) IN (0, ?)"; List nbd = DB.getSQLValueObjectsEx(trxName, sql, clientID, startDate, endDate, MCountry.getDefault(Env.getCtx()).getC_Country_ID()); GregorianCalendar cal = new GregorianCalendar();