Merged development into zk7

This commit is contained in:
Heng Sin Low 2013-12-19 21:02:07 +08:00
commit 69b9a551f3
57 changed files with 34767 additions and 123 deletions

View File

@ -21,7 +21,7 @@ AS
CURSOR CUR_BPLoc IS
SELECT IsRemitTo, C_Location_ID
FROM C_BPartner_Location
WHERE C_BPartner_ID=p_C_BPartner_ID
WHERE C_BPartner_ID=p_C_BPartner_ID AND IsActive='Y'
ORDER BY IsRemitTo DESC;
BEGIN
FOR l IN CUR_BPLoc LOOP
@ -31,4 +31,4 @@ BEGIN
END LOOP;
RETURN v_C_Location_ID;
END bpartnerRemitLocation;
/
/

View File

@ -9,7 +9,7 @@ BEGIN
FOR l IN
SELECT IsRemitTo, C_Location_ID
FROM C_BPartner_Location
WHERE C_BPartner_ID=p_C_BPartner_ID
WHERE C_BPartner_ID=p_C_BPartner_ID AND IsActive='Y'
ORDER BY IsRemitTo DESC
LOOP
IF (v_C_Location_ID IS NULL) THEN

View File

@ -0,0 +1,34 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Nov 27, 2013 4:57:14 PM CET
-- IDEMPIERE-1521
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Element_UU,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,202630,'c7849ef7-da73-46b6-8f8a-448c3ffedccc',0,'DatabaseViewDrop',TO_DATE('2013-11-27 16:57:13','YYYY-MM-DD HH24:MI:SS'),0,'D','Y','Drop view','Drop view',TO_DATE('2013-11-27 16:57:13','YYYY-MM-DD HH24:MI:SS'),0)
;
-- Nov 27, 2013 4:58:14 PM CET
INSERT INTO AD_Process (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Process_UU,AccessLevel,Classname,CopyFromProcess,Created,CreatedBy,EntityType,IsActive,IsBetaFunctionality,IsDirectPrint,IsReport,IsServerProcess,Name,ShowHelp,Statistic_Count,Statistic_Seconds,Updated,UpdatedBy,Value) VALUES (0,0,200066,'8d781c31-93a6-435d-a9c3-eb393d1cf2f3','4','org.compiere.process.DatabaseViewDrop','N',TO_DATE('2013-11-27 16:58:14','YYYY-MM-DD HH24:MI:SS'),0,'D','Y','N','N','N','N','Drop view','Y',0,0,TO_DATE('2013-11-27 16:58:14','YYYY-MM-DD HH24:MI:SS'),0,'AD_ViewComponent Drop')
;
-- Nov 27, 2013 4:58:31 PM CET
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Column_UU,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FKConstraintType,FieldLength,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,210892,'2c8da8e6-1c75-4b7b-8e39-7e28c3399979',202630,0,200066,28,100,'DatabaseViewDrop',TO_DATE('2013-11-27 16:58:30','YYYY-MM-DD HH24:MI:SS'),0,'D','N',1,'Y','Y','Y','N','N','N','N','N','N','N','N','N','N','Y','N','Y','Drop view',0,0,TO_DATE('2013-11-27 16:58:30','YYYY-MM-DD HH24:MI:SS'),0,0)
;
-- Nov 27, 2013 4:58:33 PM CET
ALTER TABLE AD_Table ADD DatabaseViewDrop CHAR(1) DEFAULT NULL
;
-- Nov 27, 2013 4:59:24 PM CET
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Field_UU,AD_Org_ID,AD_Tab_ID,ColumnSpan,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,Updated,UpdatedBy,XPosition) VALUES (0,210892,202541,'e6c3fc02-67cc-4dec-b5c1-c3fe0b7fe717',0,100,2,TO_DATE('2013-11-27 16:59:23','YYYY-MM-DD HH24:MI:SS'),0,1,'D','Y','Y','Y','N','N','N','N','N','Drop view',210,TO_DATE('2013-11-27 16:59:23','YYYY-MM-DD HH24:MI:SS'),0,2)
;
-- Nov 27, 2013 4:59:38 PM CET
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=210, XPosition=5,Updated=TO_DATE('2013-11-27 16:59:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=202541
;
-- Nov 27, 2013 4:59:56 PM CET
UPDATE AD_Field SET DisplayLogic='@IsView@=''Y''',Updated=TO_DATE('2013-11-27 16:59:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=202541
;
SELECT register_migration_script('201311271704_IDEMPIERE-1521.sql') FROM dual
;

View File

@ -0,0 +1,78 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Nov 28, 2013 9:18:15 AM CET
-- IDEMPIERE-1575
UPDATE AD_Column SET FieldLength=255,Updated=TO_DATE('2013-11-28 09:18:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=14862
;
-- Nov 28, 2013 9:18:17 AM CET
ALTER TABLE AD_Issue MODIFY LoggerName NVARCHAR2(255) DEFAULT NULL
;
-- Nov 28, 2013 9:18:33 AM CET
UPDATE AD_Column SET FieldLength=255,Updated=TO_DATE('2013-11-28 09:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=14860
;
-- Nov 28, 2013 9:18:33 AM CET
ALTER TABLE AD_Issue MODIFY SourceClassName NVARCHAR2(255) DEFAULT NULL
;
-- Nov 28, 2013 9:19:32 AM CET
UPDATE AD_Column SET FieldLength=255,Updated=TO_DATE('2013-11-28 09:19:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5664
;
-- Nov 28, 2013 9:19:33 AM CET
ALTER TABLE AD_PInstance_Para MODIFY Info NVARCHAR2(255) DEFAULT NULL
;
-- Nov 28, 2013 9:20:44 AM CET
UPDATE AD_Column SET FieldLength=255,Updated=TO_DATE('2013-11-28 09:20:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=14922
;
-- Nov 28, 2013 9:20:45 AM CET
ALTER TABLE AD_System MODIFY ProfileInfo NVARCHAR2(255) DEFAULT NULL
;
-- Nov 28, 2013 9:21:02 AM CET
UPDATE AD_Column SET FieldLength=120,Updated=TO_DATE('2013-11-28 09:21:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2902
;
-- Nov 28, 2013 9:21:03 AM CET
ALTER TABLE C_BPartner MODIFY Name NVARCHAR2(120)
;
-- Nov 28, 2013 9:21:17 AM CET
UPDATE AD_Column SET FieldLength=120,Updated=TO_DATE('2013-11-28 09:21:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=1135
;
-- Nov 28, 2013 9:21:18 AM CET
ALTER TABLE C_ElementValue MODIFY Name NVARCHAR2(120)
;
-- Nov 28, 2013 9:21:26 AM CET
UPDATE AD_Column SET FieldLength=120,Updated=TO_DATE('2013-11-28 09:21:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3163
;
-- Nov 28, 2013 9:21:26 AM CET
ALTER TABLE C_ElementValue_Trl MODIFY Name NVARCHAR2(120)
;
-- Nov 28, 2013 9:21:42 AM CET
UPDATE AD_Column SET FieldLength=120,Updated=TO_DATE('2013-11-28 09:21:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5617
;
-- Nov 28, 2013 9:21:43 AM CET
ALTER TABLE C_PaySelection MODIFY Name NVARCHAR2(120)
;
-- Dec 11, 2013 1:49:22 PM CET
UPDATE AD_Column SET FieldLength=255,Updated=TO_DATE('2013-12-11 13:49:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5950
;
-- Dec 11, 2013 1:49:22 PM CET
ALTER TABLE AD_Note MODIFY Reference NVARCHAR2(255) DEFAULT NULL
;
SELECT register_migration_script('201311280926_IDEMPIERE-1575.sql') FROM dual
;

View File

@ -14,5 +14,5 @@ AND po.C_BPartner_ID NOT IN (
AND ppo.M_Product_ID = po.M_Product_ID
);
SELECT register_migration_script('201312051535_IDEMPIERE-337') FROM dual
;
SELECT register_migration_script('201312051535_IDEMPIERE-337.sql') FROM dual
;

View File

@ -0,0 +1,38 @@
CREATE OR REPLACE FUNCTION bpartnerRemitLocation
(
p_C_BPartner_ID C_BPartner.C_BPartner_ID%TYPE
)
RETURN NUMBER
/*************************************************************************
* The contents of this file are subject to the Compiere License. You may
* obtain a copy of the License at http://www.compiere.org/license.html
* Software is on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for details. Code: Compiere ERP+CRM
* Copyright (C) 1999-2002 Jorg Janke, ComPiere, Inc. All Rights Reserved.
*************************************************************************
* $Id: C_BPartner_RemitLocation.SQL,v 1.1 2006/04/21 17:51:58 jjanke Exp $
***
* Title: Return the first RemitTo C_Location_ID of a Business Partner
* Description:
*
************************************************************************/
AS
v_C_Location_ID NUMBER := NULL;
CURSOR CUR_BPLoc IS
SELECT IsRemitTo, C_Location_ID
FROM C_BPartner_Location
WHERE C_BPartner_ID=p_C_BPartner_ID AND IsActive='Y'
ORDER BY IsRemitTo DESC;
BEGIN
FOR l IN CUR_BPLoc LOOP
IF (v_C_Location_ID IS NULL) THEN
v_C_Location_ID := l.C_Location_ID;
END IF;
END LOOP;
RETURN v_C_Location_ID;
END bpartnerRemitLocation;
/
SELECT register_migration_script('201312110939_IDEMPIERE-1625.sql') FROM dual
;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
-- Dec 13, 2013 1:43:47 PM COT
-- Ticket: 1003579 - Improve check for BOM child records with zero quantity
UPDATE AD_Column SET ValueMin='0.0000000001',Updated=TO_DATE('2013-12-13 13:43:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=4723
;
SELECT register_migration_script('201312131400_Ticket_1003579.sql') FROM dual
;

View File

@ -0,0 +1,23 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Dec 13, 2013 4:13:06 PM COT
-- IDEMPIERE-1597 Price List and Date must be not-updateable
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Org_ID,Created,AD_Client_ID) VALUES ('E','Price list cannot be changed because the order contains product lines',200243,'D','41c5bae2-77e0-4beb-a562-3f3ae465cb90','CannotChangePl','Y',TO_DATE('2013-12-13 16:13:05','YYYY-MM-DD HH24:MI:SS'),100,100,0,TO_DATE('2013-12-13 16:13:05','YYYY-MM-DD HH24:MI:SS'),0)
;
-- Dec 13, 2013 4:15:35 PM COT
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Org_ID,Created,AD_Client_ID) VALUES ('E','Date Ordered cannot be changed because the order contains product lines and the change falls in a differente price list version',200244,'D','8264d9e8-2b91-4aa2-ba80-82171b747254','CannotChangeDateOrdered','Y',TO_DATE('2013-12-13 16:15:34','YYYY-MM-DD HH24:MI:SS'),100,100,0,TO_DATE('2013-12-13 16:15:34','YYYY-MM-DD HH24:MI:SS'),0)
;
-- Dec 13, 2013 4:23:13 PM COT
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Org_ID,Created,AD_Client_ID) VALUES ('E','Price list cannot be changed because the invoice contains product lines',200245,'D','4d860b4e-0cd0-491f-a68d-e8a4b0ffb8f8','CannotChangePlIn','Y',TO_DATE('2013-12-13 16:23:12','YYYY-MM-DD HH24:MI:SS'),100,100,0,TO_DATE('2013-12-13 16:23:12','YYYY-MM-DD HH24:MI:SS'),0)
;
-- Dec 13, 2013 4:24:15 PM COT
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Org_ID,Created,AD_Client_ID) VALUES ('E','Date Invoiced cannot be changed because the invoice contains product lines and the change falls in a differente price list version',200246,'D','411625c7-21ee-48e0-8350-5e59f7fb9ecd','CannotChangeDateInvoiced','Y',TO_DATE('2013-12-13 16:24:14','YYYY-MM-DD HH24:MI:SS'),100,100,0,TO_DATE('2013-12-13 16:24:14','YYYY-MM-DD HH24:MI:SS'),0)
;
SELECT register_migration_script('201312131644_IDEMPIERE-1597.sql') FROM dual
;

View File

@ -0,0 +1,19 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Dec 17, 2013 11:04:16 AM COT
-- IDEMPIERE-1603 Copy Info Window Columns from other Info Window's
INSERT INTO AD_Process (CopyFromProcess,AD_Process_ID,IsDirectPrint,IsReport,AD_Process_UU,AccessLevel,IsBetaFunctionality,IsServerProcess,Statistic_Seconds,Statistic_Count,ShowHelp,EntityType,Name,AD_Org_ID,Updated,UpdatedBy,Created,IsActive,CreatedBy,Classname,Value,AD_Client_ID) VALUES ('N',200067,'N','N','32fe7794-53ce-442d-bb40-a132ebcdff7e','4','N','N',0,0,'Y','D','Copy Info Window Columns',0,TO_DATE('2013-12-17 11:04:16','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2013-12-17 11:04:16','YYYY-MM-DD HH24:MI:SS'),'Y',100,'org.compiere.process.CopyInfoWindowColumns','CopyInfoWindowColumns',0)
;
-- Dec 17, 2013 11:05:01 AM COT
INSERT INTO AD_Process_Para (IsRange,AD_Process_Para_ID,AD_Process_Para_UU,Help,AD_Process_ID,AD_Reference_ID,IsMandatory,EntityType,Name,ColumnName,Description,FieldLength,IsCentrallyMaintained,SeqNo,IsActive,UpdatedBy,Updated,CreatedBy,Created,AD_Org_ID,IsEncrypted,AD_Client_ID,AD_Element_ID) VALUES ('N',200073,'989f60c7-012b-4f13-9a15-6118d75a4854','The Info window is used to search and select records as well as display information relevant to the selection.',200067,19,'Y','D','Info Window','AD_InfoWindow_ID','Info and search/select Window',10,'Y',10,'Y',100,TO_DATE('2013-12-17 11:05:01','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2013-12-17 11:05:01','YYYY-MM-DD HH24:MI:SS'),0,'N',0,3068)
;
-- Dec 17, 2013 11:06:48 AM COT
INSERT INTO AD_ToolBarButton (Action,AD_Tab_ID,AD_Process_ID,SeqNo,Name,ComponentName,IsCustomization,AD_Org_ID,Created,CreatedBy,AD_ToolBarButton_ID,Updated,UpdatedBy,IsActive,AD_Client_ID,AD_ToolBarButton_UU) VALUES ('W',842,200067,10,'Copy Info Window Columns','CopyInfoWindowColumns','N',0,TO_DATE('2013-12-17 11:06:48','YYYY-MM-DD HH24:MI:SS'),100,200079,TO_DATE('2013-12-17 11:06:48','YYYY-MM-DD HH24:MI:SS'),100,'Y',0,'c4845d6f-abf8-4419-b7e6-adaec70cebe2')
;
SELECT register_migration_script('201312171107_IDEMPIERE-1603.sql') FROM dual
;

View File

@ -0,0 +1,31 @@
-- Nov 27, 2013 4:57:14 PM CET
-- IDEMPIERE-1521
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Element_UU,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,202630,'c7849ef7-da73-46b6-8f8a-448c3ffedccc',0,'DatabaseViewDrop',TO_TIMESTAMP('2013-11-27 16:57:13','YYYY-MM-DD HH24:MI:SS'),0,'D','Y','Drop view','Drop view',TO_TIMESTAMP('2013-11-27 16:57:13','YYYY-MM-DD HH24:MI:SS'),0)
;
-- Nov 27, 2013 4:58:14 PM CET
INSERT INTO AD_Process (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Process_UU,AccessLevel,Classname,CopyFromProcess,Created,CreatedBy,EntityType,IsActive,IsBetaFunctionality,IsDirectPrint,IsReport,IsServerProcess,Name,ShowHelp,Statistic_Count,Statistic_Seconds,Updated,UpdatedBy,Value) VALUES (0,0,200066,'8d781c31-93a6-435d-a9c3-eb393d1cf2f3','4','org.compiere.process.DatabaseViewDrop','N',TO_TIMESTAMP('2013-11-27 16:58:14','YYYY-MM-DD HH24:MI:SS'),0,'D','Y','N','N','N','N','Drop view','Y',0,0,TO_TIMESTAMP('2013-11-27 16:58:14','YYYY-MM-DD HH24:MI:SS'),0,'AD_ViewComponent Drop')
;
-- Nov 27, 2013 4:58:31 PM CET
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Column_UU,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FKConstraintType,FieldLength,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,210892,'2c8da8e6-1c75-4b7b-8e39-7e28c3399979',202630,0,200066,28,100,'DatabaseViewDrop',TO_TIMESTAMP('2013-11-27 16:58:30','YYYY-MM-DD HH24:MI:SS'),0,'D','N',1,'Y','Y','Y','N','N','N','N','N','N','N','N','N','N','Y','N','Y','Drop view',0,0,TO_TIMESTAMP('2013-11-27 16:58:30','YYYY-MM-DD HH24:MI:SS'),0,0)
;
-- Nov 27, 2013 4:58:33 PM CET
ALTER TABLE AD_Table ADD COLUMN DatabaseViewDrop CHAR(1) DEFAULT NULL
;
-- Nov 27, 2013 4:59:24 PM CET
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Field_UU,AD_Org_ID,AD_Tab_ID,ColumnSpan,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,Updated,UpdatedBy,XPosition) VALUES (0,210892,202541,'e6c3fc02-67cc-4dec-b5c1-c3fe0b7fe717',0,100,2,TO_TIMESTAMP('2013-11-27 16:59:23','YYYY-MM-DD HH24:MI:SS'),0,1,'D','Y','Y','Y','N','N','N','N','N','Drop view',210,TO_TIMESTAMP('2013-11-27 16:59:23','YYYY-MM-DD HH24:MI:SS'),0,2)
;
-- Nov 27, 2013 4:59:38 PM CET
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=210, XPosition=5,Updated=TO_TIMESTAMP('2013-11-27 16:59:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=202541
;
-- Nov 27, 2013 4:59:56 PM CET
UPDATE AD_Field SET DisplayLogic='@IsView@=''Y''',Updated=TO_TIMESTAMP('2013-11-27 16:59:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=202541
;
SELECT register_migration_script('201311271704_IDEMPIERE-1521.sql') FROM dual
;

View File

@ -0,0 +1,75 @@
-- Nov 28, 2013 9:18:15 AM CET
-- IDEMPIERE-1575
UPDATE AD_Column SET FieldLength=255,Updated=TO_TIMESTAMP('2013-11-28 09:18:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=14862
;
-- Nov 28, 2013 9:18:17 AM CET
INSERT INTO t_alter_column values('ad_issue','LoggerName','VARCHAR(255)',null,'NULL')
;
-- Nov 28, 2013 9:18:33 AM CET
UPDATE AD_Column SET FieldLength=255,Updated=TO_TIMESTAMP('2013-11-28 09:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=14860
;
-- Nov 28, 2013 9:18:33 AM CET
INSERT INTO t_alter_column values('ad_issue','SourceClassName','VARCHAR(255)',null,'NULL')
;
-- Nov 28, 2013 9:19:32 AM CET
UPDATE AD_Column SET FieldLength=255,Updated=TO_TIMESTAMP('2013-11-28 09:19:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5664
;
-- Nov 28, 2013 9:19:33 AM CET
INSERT INTO t_alter_column values('ad_pinstance_para','Info','VARCHAR(255)',null,'NULL')
;
-- Nov 28, 2013 9:20:44 AM CET
UPDATE AD_Column SET FieldLength=255,Updated=TO_TIMESTAMP('2013-11-28 09:20:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=14922
;
-- Nov 28, 2013 9:20:45 AM CET
INSERT INTO t_alter_column values('ad_system','ProfileInfo','VARCHAR(255)',null,'NULL')
;
-- Nov 28, 2013 9:21:02 AM CET
UPDATE AD_Column SET FieldLength=120,Updated=TO_TIMESTAMP('2013-11-28 09:21:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2902
;
-- Nov 28, 2013 9:21:03 AM CET
INSERT INTO t_alter_column values('c_bpartner','Name','VARCHAR(120)',null,null)
;
-- Nov 28, 2013 9:21:17 AM CET
UPDATE AD_Column SET FieldLength=120,Updated=TO_TIMESTAMP('2013-11-28 09:21:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=1135
;
-- Nov 28, 2013 9:21:18 AM CET
INSERT INTO t_alter_column values('c_elementvalue','Name','VARCHAR(120)',null,null)
;
-- Nov 28, 2013 9:21:26 AM CET
UPDATE AD_Column SET FieldLength=120,Updated=TO_TIMESTAMP('2013-11-28 09:21:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3163
;
-- Nov 28, 2013 9:21:26 AM CET
INSERT INTO t_alter_column values('c_elementvalue_trl','Name','VARCHAR(120)',null,null)
;
-- Nov 28, 2013 9:21:42 AM CET
UPDATE AD_Column SET FieldLength=120,Updated=TO_TIMESTAMP('2013-11-28 09:21:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5617
;
-- Nov 28, 2013 9:21:43 AM CET
INSERT INTO t_alter_column values('c_payselection','Name','VARCHAR(120)',null,null)
;
-- Dec 11, 2013 1:49:22 PM CET
UPDATE AD_Column SET FieldLength=255,Updated=TO_TIMESTAMP('2013-12-11 13:49:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5950
;
-- Dec 11, 2013 1:49:22 PM CET
INSERT INTO t_alter_column values('ad_note','Reference','VARCHAR(255)',null,'NULL')
;
SELECT register_migration_script('201311280926_IDEMPIERE-1575.sql') FROM dual
;

View File

@ -11,5 +11,5 @@ AND po.C_BPartner_ID NOT IN (
AND ppo.M_Product_ID = po.M_Product_ID
);
SELECT register_migration_script('201312051535_IDEMPIERE-337') FROM dual
;
SELECT register_migration_script('201312051535_IDEMPIERE-337.sql') FROM dual
;

View File

@ -0,0 +1,27 @@
CREATE OR REPLACE FUNCTION bpartnerRemitLocation(p_C_BPartner_ID C_BPartner.C_BPartner_ID%TYPE)
RETURNS numeric AS $body$
DECLARE
v_C_Location_ID NUMERIC := NULL;
l RECORD;
BEGIN
FOR l IN
SELECT IsRemitTo, C_Location_ID
FROM C_BPartner_Location
WHERE C_BPartner_ID=p_C_BPartner_ID AND IsActive='Y'
ORDER BY IsRemitTo DESC
LOOP
IF (v_C_Location_ID IS NULL) THEN
v_C_Location_ID := l.C_Location_ID;
END IF;
END LOOP;
RETURN v_C_Location_ID;
END;
$body$ LANGUAGE plpgsql;
SELECT register_migration_script('201312110939_IDEMPIERE-1625.sql') FROM dual
;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
-- Dec 13, 2013 1:43:47 PM COT
-- Ticket: 1003579 - Improve check for BOM child records with zero quantity
UPDATE AD_Column SET ValueMin='0.0000000001',Updated=TO_TIMESTAMP('2013-12-13 13:43:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=4723
;
SELECT register_migration_script('201312131400_Ticket_1003579.sql') FROM dual
;

View File

@ -0,0 +1,20 @@
-- Dec 13, 2013 4:13:06 PM COT
-- IDEMPIERE-1597 Price List and Date must be not-updateable
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Org_ID,Created,AD_Client_ID) VALUES ('E','Price list cannot be changed because the order contains product lines',200243,'D','41c5bae2-77e0-4beb-a562-3f3ae465cb90','CannotChangePl','Y',TO_TIMESTAMP('2013-12-13 16:13:05','YYYY-MM-DD HH24:MI:SS'),100,100,0,TO_TIMESTAMP('2013-12-13 16:13:05','YYYY-MM-DD HH24:MI:SS'),0)
;
-- Dec 13, 2013 4:15:35 PM COT
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Org_ID,Created,AD_Client_ID) VALUES ('E','Date Ordered cannot be changed because the order contains product lines and the change falls in a differente price list version',200244,'D','8264d9e8-2b91-4aa2-ba80-82171b747254','CannotChangeDateOrdered','Y',TO_TIMESTAMP('2013-12-13 16:15:34','YYYY-MM-DD HH24:MI:SS'),100,100,0,TO_TIMESTAMP('2013-12-13 16:15:34','YYYY-MM-DD HH24:MI:SS'),0)
;
-- Dec 13, 2013 4:23:13 PM COT
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Org_ID,Created,AD_Client_ID) VALUES ('E','Price list cannot be changed because the invoice contains product lines',200245,'D','4d860b4e-0cd0-491f-a68d-e8a4b0ffb8f8','CannotChangePlIn','Y',TO_TIMESTAMP('2013-12-13 16:23:12','YYYY-MM-DD HH24:MI:SS'),100,100,0,TO_TIMESTAMP('2013-12-13 16:23:12','YYYY-MM-DD HH24:MI:SS'),0)
;
-- Dec 13, 2013 4:24:15 PM COT
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Org_ID,Created,AD_Client_ID) VALUES ('E','Date Invoiced cannot be changed because the invoice contains product lines and the change falls in a differente price list version',200246,'D','411625c7-21ee-48e0-8350-5e59f7fb9ecd','CannotChangeDateInvoiced','Y',TO_TIMESTAMP('2013-12-13 16:24:14','YYYY-MM-DD HH24:MI:SS'),100,100,0,TO_TIMESTAMP('2013-12-13 16:24:14','YYYY-MM-DD HH24:MI:SS'),0)
;
SELECT register_migration_script('201312131644_IDEMPIERE-1597.sql') FROM dual
;

View File

@ -0,0 +1,16 @@
-- Dec 17, 2013 11:04:16 AM COT
-- IDEMPIERE-1603 Copy Info Window Columns from other Info Window's
INSERT INTO AD_Process (CopyFromProcess,AD_Process_ID,IsDirectPrint,IsReport,AD_Process_UU,AccessLevel,IsBetaFunctionality,IsServerProcess,Statistic_Seconds,Statistic_Count,ShowHelp,EntityType,Name,AD_Org_ID,Updated,UpdatedBy,Created,IsActive,CreatedBy,Classname,Value,AD_Client_ID) VALUES ('N',200067,'N','N','32fe7794-53ce-442d-bb40-a132ebcdff7e','4','N','N',0,0,'Y','D','Copy Info Window Columns',0,TO_TIMESTAMP('2013-12-17 11:04:16','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2013-12-17 11:04:16','YYYY-MM-DD HH24:MI:SS'),'Y',100,'org.compiere.process.CopyInfoWindowColumns','CopyInfoWindowColumns',0)
;
-- Dec 17, 2013 11:05:01 AM COT
INSERT INTO AD_Process_Para (IsRange,AD_Process_Para_ID,AD_Process_Para_UU,Help,AD_Process_ID,AD_Reference_ID,IsMandatory,EntityType,Name,ColumnName,Description,FieldLength,IsCentrallyMaintained,SeqNo,IsActive,UpdatedBy,Updated,CreatedBy,Created,AD_Org_ID,IsEncrypted,AD_Client_ID,AD_Element_ID) VALUES ('N',200073,'989f60c7-012b-4f13-9a15-6118d75a4854','The Info window is used to search and select records as well as display information relevant to the selection.',200067,19,'Y','D','Info Window','AD_InfoWindow_ID','Info and search/select Window',10,'Y',10,'Y',100,TO_TIMESTAMP('2013-12-17 11:05:01','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2013-12-17 11:05:01','YYYY-MM-DD HH24:MI:SS'),0,'N',0,3068)
;
-- Dec 17, 2013 11:06:48 AM COT
INSERT INTO AD_ToolBarButton ("action",AD_Tab_ID,AD_Process_ID,SeqNo,Name,ComponentName,IsCustomization,AD_Org_ID,Created,CreatedBy,AD_ToolBarButton_ID,Updated,UpdatedBy,IsActive,AD_Client_ID,AD_ToolBarButton_UU) VALUES ('W',842,200067,10,'Copy Info Window Columns','CopyInfoWindowColumns','N',0,TO_TIMESTAMP('2013-12-17 11:06:48','YYYY-MM-DD HH24:MI:SS'),100,200079,TO_TIMESTAMP('2013-12-17 11:06:48','YYYY-MM-DD HH24:MI:SS'),100,'Y',0,'c4845d6f-abf8-4419-b7e6-adaec70cebe2')
;
SELECT register_migration_script('201312171107_IDEMPIERE-1603.sql') FROM dual
;

View File

@ -81,8 +81,9 @@ public class ExpenseTypesFromAccounts extends SvrProcess {
ProcessInfoParameter[] para = getParameter();
for (int i = 0; i < para.length; i++) {
String name = para[i].getParameterName();
if (para[i].getParameter() == null);
else if (name.equals("M_Product_Category_ID")) {
if (para[i].getParameter() == null) {
// nothing
} else if (name.equals("M_Product_Category_ID")) {
m_productCategoryId = para[i].getParameterAsInt();
} else if (name.equals("C_AcctSchema_ID")) {
m_acctSchemaId = para[i].getParameterAsInt();

View File

@ -0,0 +1,111 @@
/**********************************************************************
* 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: *
* - Hideaki Hagiwara *
**********************************************************************/
package org.compiere.process;
import java.util.logging.Level;
import org.compiere.model.MInfoColumn;
import org.compiere.model.MInfoWindow;
import org.compiere.model.PO;
import org.compiere.util.AdempiereSystemError;
/**
* Copy Info Window Columns from other Info Window
*
* @author Hideaki Hagiwara
* @version $Id: CopyInfoWindowColumns v 1.0 2013/12/4
*/
public class CopyInfoWindowColumns extends SvrProcess
{
/** Target Info Window */
private int p_target_AD_InfoWindow_ID = 0;
/** Source Info Window */
private int p_source_AD_InfoWindow_ID= 0;
/** Column Count */
private int m_count = 0;
/**
* Prepare - e.g., get Parameters.
*/
protected void prepare ()
{
ProcessInfoParameter[] para = getParameter();
for (int i = 0; i < para.length; i++)
{
String name = para[i].getParameterName();
if (para[i].getParameter() == null)
;
else if (name.equals("AD_InfoWindow_ID"))
p_source_AD_InfoWindow_ID = para[i].getParameterAsInt();
else
log.log(Level.SEVERE, "Unknown Parameter: " + name);
}
p_target_AD_InfoWindow_ID = getRecord_ID();
} // prepare
/**
* Process
* @return info
* @throws Exception
*/
protected String doIt () throws Exception
{
if (p_target_AD_InfoWindow_ID == 0)
throw new AdempiereSystemError("@NotFound@ @AD_InfoWindow_ID@ " + p_target_AD_InfoWindow_ID);
if (p_source_AD_InfoWindow_ID == 0)
throw new AdempiereSystemError("@NotFound@ @AD_InfoWindow_ID@ " + p_source_AD_InfoWindow_ID);
if (log.isLoggable(Level.INFO)) log.info("Source AD_InfoWindow_ID=" + p_source_AD_InfoWindow_ID
+ ", Target AD_InfoWindow_ID=" + p_target_AD_InfoWindow_ID);
MInfoWindow targetInfoWindow = new MInfoWindow(getCtx(), p_target_AD_InfoWindow_ID, get_TrxName());
MInfoColumn[] targetColumns = targetInfoWindow.getInfoColumns();
if (targetColumns.length > 0) //Target Info Window must not have columns
throw new AdempiereSystemError("Target info window must not have columns");
MInfoWindow sourceInfoWindow = new MInfoWindow(getCtx(), p_source_AD_InfoWindow_ID, get_TrxName());
MInfoColumn[] sourceColumns = sourceInfoWindow.getInfoColumns();
for (int i = 0; i < sourceColumns.length; i++)
{
MInfoColumn colTarget = new MInfoColumn(getCtx(),0, get_TrxName());
PO.copyValues(sourceColumns[i], colTarget);
colTarget.setAD_InfoWindow_ID (targetInfoWindow.getAD_InfoWindow_ID());
colTarget.setAD_Org_ID(targetInfoWindow.getAD_Org_ID());
colTarget.setEntityType(targetInfoWindow.getEntityType());
colTarget.setIsActive(sourceColumns[i].isActive());
colTarget.saveEx(get_TrxName());
m_count++;
}
//
return "#" + m_count;
} // doIt
} // CopyInfoWindowColumns

View File

@ -364,7 +364,7 @@ public class ImportBankStatement extends SvrProcess
//Import Bank Statement
sql = new StringBuilder("SELECT * FROM I_BankStatement")
.append(" WHERE I_IsImported='N'")
.append(" ORDER BY C_BankAccount_ID, Name, EftStatementDate, EftStatementReference");
.append(" ORDER BY C_BankAccount_ID, Name, StatementDate, EftStatementReference");
MBankStatement statement = null;
MBankAccount account = null;
@ -448,7 +448,7 @@ public class ImportBankStatement extends SvrProcess
statement.setDescription(imp.getDescription());
statement.setEftStatementReference(imp.getEftStatementReference());
statement.setEftStatementDate(imp.getEftStatementDate());
if (statement.save())
if (statement.save(get_TrxName()))
{
noInsert++;
}
@ -496,7 +496,7 @@ public class ImportBankStatement extends SvrProcess
line.setEftAmt(imp.getEftAmt());
// Save statement line
if (line.save())
if (line.save(get_TrxName()))
{
imp.setC_BankStatement_ID(statement.getC_BankStatement_ID());
imp.setC_BankStatementLine_ID(line.getC_BankStatementLine_ID());

View File

@ -852,16 +852,7 @@ public class Doc_Invoice extends Doc
if (X_M_Cost.COSTINGMETHOD_AverageInvoice.equals(costingMethod) || X_M_Cost.COSTINGMETHOD_AveragePO.equals(costingMethod))
{
// Convert to AcctCurrency
BigDecimal allocationAmt = lca.getAmt();
if (getC_Currency_ID() != as.getC_Currency_ID())
allocationAmt = MConversionRate.convert(getCtx(), allocationAmt,
getC_Currency_ID(), as.getC_Currency_ID(),
getDateAcct(), getC_ConversionType_ID(),
getAD_Client_ID(), getAD_Org_ID());
if (allocationAmt.scale() > as.getCostingPrecision())
allocationAmt = allocationAmt.setScale(as.getCostingPrecision(), BigDecimal.ROUND_HALF_UP);
BigDecimal allocationAmt = lca.getAmt();
BigDecimal estimatedAmt = BigDecimal.ZERO;
if (lca.getM_InOutLine_ID() > 0)
{
@ -921,11 +912,20 @@ public class Doc_Invoice extends Doc
boolean zeroQty = false;
try {
savepoint = trx.setSavepoint(null);
BigDecimal costDetailAmt = costAdjustmentAmt;
//convert to accounting schema currency
if (getC_Currency_ID() != as.getC_Currency_ID())
costDetailAmt = MConversionRate.convert(getCtx(), costDetailAmt,
getC_Currency_ID(), as.getC_Currency_ID(),
getDateAcct(), getC_ConversionType_ID(),
getAD_Client_ID(), getAD_Org_ID());
if (costDetailAmt.scale() > as.getCostingPrecision())
costDetailAmt = costDetailAmt.setScale(as.getCostingPrecision(), BigDecimal.ROUND_HALF_UP);
if (!MCostDetail.createInvoice(as, lca.getAD_Org_ID(),
lca.getM_Product_ID(), lca.getM_AttributeSetInstance_ID(),
C_InvoiceLine_ID, lca.getM_CostElement_ID(),
costAdjustmentAmt, lca.getQty(),
costDetailAmt, lca.getQty(),
desc, getTrxName())) {
throw new RuntimeException("Failed to create cost detail record.");
}

View File

@ -305,7 +305,7 @@ public final class ImpFormat
private static void loadRows (ImpFormat format, int ID)
{
String sql = "SELECT f.SeqNo,c.ColumnName,f.StartNo,f.EndNo,f.DataType,c.FieldLength," // 1..6
+ "f.DataFormat,f.DecimalPoint,f.DivideBy100,f.ConstantValue,f.Callout " // 7..11
+ "f.DataFormat,f.DecimalPoint,f.DivideBy100,f.ConstantValue,f.Callout,f.Name " // 7..12
+ "FROM AD_ImpFormat_Row f,AD_Column c "
+ "WHERE f.AD_ImpFormat_ID=? AND f.AD_Column_ID=c.AD_Column_ID AND f.IsActive='Y'"
+ "ORDER BY f.SeqNo";
@ -319,7 +319,7 @@ public final class ImpFormat
while (rs.next())
{
ImpFormatRow row = new ImpFormatRow (rs.getInt(1),
rs.getString(2), rs.getInt(3), rs.getInt(4), rs.getString(5), rs.getInt(6));
rs.getString(2), rs.getInt(3), rs.getInt(4), rs.getString(5), rs.getInt(6), rs.getString(12));
//
row.setFormatInfo(rs.getString(7), rs.getString(8),
rs.getString(9).equals("Y"),

View File

@ -52,11 +52,13 @@ public final class ImpFormatRow
* @param endNo and no
* @param dataType data type - see constants DATATYPE_
* @param maxLength if String it is the maximum length (truncated)
* @param name column label
*/
public ImpFormatRow(int seqNo, String columnName, int startNo, int endNo, String dataType, int maxLength)
public ImpFormatRow(int seqNo, String columnName, int startNo, int endNo, String dataType, int maxLength, String name)
{
m_seqNo = seqNo;
setColumnName(columnName);
setName(name);
m_startNo = startNo;
m_endNo = endNo;
setDataType (dataType);
@ -80,6 +82,7 @@ public final class ImpFormatRow
private int m_seqNo;
private String m_columnName;
private String m_name;
private int m_startNo = 0;
private int m_endNo = 0;
private String m_dataType;
@ -173,6 +176,27 @@ public final class ImpFormatRow
return m_columnName;
} // getColumnName
/**
* Name
* @param Name name
*/
public void setName (String name)
{
if (name == null || name.length() == 0)
throw new IllegalArgumentException("Name must be at least 1 char");
else
m_name = name;
} // setName
/**
* Get Name
* @return Name
*/
public String getName()
{
return m_name;
} // getName
/**
* Data Type
* @param dataType data type - see constants DATATYPE_

View File

@ -101,7 +101,7 @@ public class GridTable extends AbstractTableModel
/**
*
*/
private static final long serialVersionUID = -2181155164268688340L;
private static final long serialVersionUID = 4223765688790104180L;
public static final String DATA_REFRESH_MESSAGE = "Refreshed";
@ -232,6 +232,10 @@ public class GridTable extends AbstractTableModel
private final static Integer NEW_ROW_ID = Integer.valueOf(-1);
private static final int DEFAULT_FETCH_SIZE = 200;
/** Keep track of last sorted column index and sort direction */
private int m_lastSortColumnIndex = -1;
private boolean m_lastSortedAscending = true;
/**
* Set Table Name
* @param newTableName table name
@ -890,6 +894,13 @@ public class GridTable extends AbstractTableModel
}
if (getRowCount() == 0)
return;
boolean isSameSortEntries = (col == m_lastSortColumnIndex && ascending == m_lastSortedAscending);
if (!isSameSortEntries)
{
m_lastSortColumnIndex = col;
m_lastSortedAscending = ascending;
}
//cache changed row
Object[] changedRow = m_rowChanged >= 0 ? getDataAtRow(m_rowChanged) : null;
@ -948,10 +959,14 @@ public class GridTable extends AbstractTableModel
m_sort.get(i).data = null;
}
}
// update UI
fireTableDataChanged();
// Info detected by MTab.dataStatusChanged and current row set to 0
fireDataStatusIEvent("Sorted", "#" + m_sort.size());
if (!isSameSortEntries)
{
// update UI
fireTableDataChanged();
// Info detected by MTab.dataStatusChanged and current row set to 0
fireDataStatusIEvent("Sorted", "#" + m_sort.size());
}
} // sort
/**
@ -2919,6 +2934,11 @@ public class GridTable extends AbstractTableModel
m_changed = false;
m_rowChanged = -1;
m_inserting = false;
if (m_lastSortColumnIndex >= 0)
{
loadComplete();
sort(m_lastSortColumnIndex, m_lastSortedAscending);
}
fireTableDataChanged();
if (fireStatusEvent)
fireDataStatusIEvent(DATA_REFRESH_MESSAGE, "");
@ -3847,4 +3867,12 @@ public class GridTable extends AbstractTableModel
public String get_TrxName() {
return m_trxName;
}
/**
* reset the cache sort state ( sort column and sort ascending )
*/
public void resetCacheSortState() {
m_lastSortColumnIndex = -1;
m_lastSortedAscending = true;
}
}

View File

@ -54,38 +54,54 @@ public class MDashboardContentAccess extends X_PA_DashboardContent_Access {
parameters.add(AD_Client_ID);
StringBuffer sql= new StringBuffer();
// First part : dashboards not configured in access and flagged to be shown in login (this is intended to show new dashboards, otherwise new dashboards won't be shown unless the user go and configure them)
sql.append("SELECT PA_DashboardContent_ID,ColumnNo ")
.append(" FROM PA_DashboardContent ")
.append(" WHERE PA_DashboardContent_ID NOT IN (")
.append(" SELECT PA_DashboardContent_ID ")
.append(" FROM PA_DashboardContent_Access" )
.append(" WHERE IsActive='Y' AND AD_Client_ID IN (0, ?))")
.append(" WHERE AD_Client_ID IN (0, ?))")
.append(" AND IsShowInLogin='Y'")
.append(" AND IsActive='Y' AND AD_Client_ID IN (0, ?)")
.append(" UNION ALL")
// Second part : second part is to process the dashboards configured in content access
.append(" SELECT ct.PA_DashboardContent_ID,ct.ColumnNo")
.append(" FROM PA_DashboardContent ct")
.append(" INNER JOIN PA_DashboardContent_Access cta on (ct.PA_DashboardContent_ID = cta.PA_DashboardContent_ID)")
.append(" WHERE cta.IsActive='Y'")
.append(" AND ct.IsActive='Y'");
if(AD_Role >= 0){
sql.append(" AND coalesce(cta.AD_Role_ID, ?) = ?");
if(AD_Role >= 0) {
sql.append(" AND COALESCE(cta.AD_Role_ID, ?) = ?");
parameters.add(AD_Role);
parameters.add(AD_Role);
}
if (AD_User >= 0){
sql.append(" AND coalesce(cta.AD_User_ID, ?) = ?");
if (AD_User >= 0) {
sql.append(" AND COALESCE(cta.AD_User_ID, ?) = ?");
parameters.add(AD_User);
parameters.add(AD_User);
}
sql.append(" AND cta.AD_Client_ID in (0,?)");
parameters.add(AD_Client_ID);
// New part : remove dashboard if inactive records
sql.append(" AND ct.PA_DashboardContent_ID NOT IN (SELECT PA_DashboardContent_ID FROM PA_DashboardContent_Access WHERE IsActive='N' AND ct.AD_Client_ID in (0,?)");
parameters.add(AD_Client_ID);
if (AD_Role >= 0) {
sql.append(" AND COALESCE(ct.AD_Role_ID, ?) = ?");
parameters.add(AD_Role);
parameters.add(AD_Role);
}
if (AD_User >= 0) {
sql.append(" AND COALESCE(ct.AD_User_ID, ?) = ?");
parameters.add(AD_User);
parameters.add(AD_User);
}
sql.append(")");
sql.append(" ORDER BY ColumnNo");
PreparedStatement pstmt=null;
ResultSet rs = null;

View File

@ -94,6 +94,8 @@ public class MGoal extends X_PA_Goal
DB.close(rs, pstmt);
rs = null; pstmt = null;
}
if (list.size() == 0)
s_log.log (Level.WARNING, Msg.getMsg(ctx, "FindZeroRecords"));
MGoal[] retValue = new MGoal[list.size ()];
list.toArray (retValue);
return retValue;

View File

@ -989,7 +989,27 @@ public class MInvoice extends X_C_Invoice implements DocAction
if (order.getC_CashPlanLine_ID() > 0)
setC_CashPlanLine_ID(order.getC_CashPlanLine_ID());
}
// IDEMPIERE-1597 Price List and Date must be not-updateable
if (!newRecord && (is_ValueChanged(COLUMNNAME_M_PriceList_ID) || is_ValueChanged(COLUMNNAME_DateInvoiced))) {
int cnt = DB.getSQLValueEx(get_TrxName(), "SELECT COUNT(*) FROM C_InvoiceLine WHERE C_Invoice_ID=? AND M_Product_ID>0", getC_Invoice_ID());
if (cnt > 0) {
if (is_ValueChanged(COLUMNNAME_M_PriceList_ID)) {
log.saveError("Error", Msg.getMsg(getCtx(), "CannotChangePlIn"));
return false;
}
if (is_ValueChanged(COLUMNNAME_DateInvoiced)) {
MPriceList pList = MPriceList.get(getCtx(), getM_PriceList_ID(), null);
MPriceListVersion plOld = pList.getPriceListVersion((Timestamp)get_ValueOld(COLUMNNAME_DateInvoiced));
MPriceListVersion plNew = pList.getPriceListVersion((Timestamp)get_Value(COLUMNNAME_DateInvoiced));
if (plNew == null || !plNew.equals(plOld)) {
log.saveError("Error", Msg.getMsg(getCtx(), "CannotChangeDateInvoiced"));
return false;
}
}
}
}
return true;
} // beforeSave

View File

@ -862,12 +862,12 @@ public class MInvoiceLine extends X_C_InvoiceLine
setPrice();
// IDEMPIERE-1574 Sales Order Line lets Price under the Price Limit when updating
// Check PriceLimit
boolean enforce = m_IsSOTrx && m_parent.getM_PriceList().isEnforcePriceLimit();
boolean enforce = m_IsSOTrx && getParent().getM_PriceList().isEnforcePriceLimit();
if (enforce && MRole.getDefault().isOverwritePriceLimit())
enforce = false;
// Check Price Limit?
if (enforce && getPriceLimit() != Env.ZERO
&& getPriceActual().compareTo(getPriceLimit()) < 0)
&& getPriceEntered().compareTo(getPriceLimit()) < 0)
{
log.saveError("UnderLimitPrice", "PriceEntered=" + getPriceEntered() + ", PriceLimit=" + getPriceLimit());
return false;
@ -1096,9 +1096,9 @@ public class MInvoiceLine extends X_C_InvoiceLine
// end MZ
if (base.signum() != 0)
{
BigDecimal result = getLineNetAmt().multiply(base);
result = result.divide(total, BigDecimal.ROUND_HALF_UP);
lca.setAmt(result.doubleValue(), getPrecision());
double result = getLineNetAmt().multiply(base).doubleValue();
result /= total.doubleValue();
lca.setAmt(result, getPrecision());
}
if (!lca.save()){
msgreturn = new StringBuilder("Cannot save line Allocation = ").append(lca);
@ -1221,9 +1221,9 @@ public class MInvoiceLine extends X_C_InvoiceLine
// end MZ
if (base.signum() != 0)
{
BigDecimal result = getLineNetAmt().multiply(base);
result = result.divide(total, BigDecimal.ROUND_HALF_UP);
lca.setAmt(result.doubleValue(), getPrecision());
double result = getLineNetAmt().multiply(base).doubleValue();
result /= total.doubleValue();
lca.setAmt(result, getPrecision());
}
if (!lca.save()){
msgreturn = new StringBuilder("Cannot save line Allocation = ").append(lca);

View File

@ -109,6 +109,8 @@ public class MMeasure extends X_PA_Measure
String sql = mc.getSqlBarChart(goal.getRestrictions(false),
goal.getMeasureDisplay(), goal.getDateFrom(),
MRole.getDefault()); // logged in role
if (sql.indexOf("@") >= 0)
sql = Env.parseContext(getCtx(), 0, sql, false, false);
PreparedStatement pstmt = null;
ResultSet rs = null;
try

View File

@ -235,6 +235,8 @@ public class MMeasureCalc extends X_PA_MeasureCalc
.append("')=TRUNC(").append(DB.TO_DATE(date)).append(",'").append(trunc).append("')");
}
String finalSQL = addRestrictions(sql.toString(), restrictions, role);
if (finalSQL.indexOf("@") >= 0)
finalSQL = Env.parseContext(getCtx(), 0, finalSQL, false, false);
// Execute
StringBuilder where = new StringBuilder();
PreparedStatement pstmt = null;

View File

@ -1068,7 +1068,27 @@ public class MOrder extends X_C_Order implements DocAction
}
}
}
// IDEMPIERE-1597 Price List and Date must be not-updateable
if (!newRecord && (is_ValueChanged(COLUMNNAME_M_PriceList_ID) || is_ValueChanged(COLUMNNAME_DateOrdered))) {
int cnt = DB.getSQLValueEx(get_TrxName(), "SELECT COUNT(*) FROM C_OrderLine WHERE C_Order_ID=? AND M_Product_ID>0", getC_Order_ID());
if (cnt > 0) {
if (is_ValueChanged(COLUMNNAME_M_PriceList_ID)) {
log.saveError("Error", Msg.getMsg(getCtx(), "CannotChangePl"));
return false;
}
if (is_ValueChanged(COLUMNNAME_DateOrdered)) {
MPriceList pList = MPriceList.get(getCtx(), getM_PriceList_ID(), null);
MPriceListVersion plOld = pList.getPriceListVersion((Timestamp)get_ValueOld(COLUMNNAME_DateOrdered));
MPriceListVersion plNew = pList.getPriceListVersion((Timestamp)get_Value(COLUMNNAME_DateOrdered));
if (plNew == null || !plNew.equals(plOld)) {
log.saveError("Error", Msg.getMsg(getCtx(), "CannotChangeDateOrdered"));
return false;
}
}
}
}
return true;
} // beforeSave

View File

@ -872,12 +872,12 @@ public class MOrderLine extends X_C_OrderLine
getProductPricing(m_M_PriceList_ID);
// IDEMPIERE-1574 Sales Order Line lets Price under the Price Limit when updating
// Check PriceLimit
boolean enforce = m_IsSOTrx && m_parent.getM_PriceList().isEnforcePriceLimit();
boolean enforce = m_IsSOTrx && getParent().getM_PriceList().isEnforcePriceLimit();
if (enforce && MRole.getDefault().isOverwritePriceLimit())
enforce = false;
// Check Price Limit?
if (enforce && getPriceLimit() != Env.ZERO
&& getPriceActual().compareTo(getPriceLimit()) < 0)
&& getPriceEntered().compareTo(getPriceLimit()) < 0)
{
log.saveError("UnderLimitPrice", "PriceEntered=" + getPriceEntered() + ", PriceLimit=" + getPriceLimit());
return false;

View File

@ -2200,6 +2200,7 @@ public final class MPayment extends X_C_Payment
Msg.translate(getCtx(), "C_Payment_ID") + ": " + getDocumentNo(),
get_TrxName());
alloc.setAD_Org_ID(getAD_Org_ID());
alloc.setDateAcct(getDateAcct()); // in case date acct is different from datetrx in payment; IDEMPIERE-1532 tbayen
if (!alloc.save())
{
log.severe("P.Allocations not created");
@ -2628,10 +2629,11 @@ public final class MPayment extends X_C_Payment
// Create automatic Allocation
MAllocationHdr alloc = new MAllocationHdr (getCtx(), false,
( accrual ? dateAcct : getDateTrx() ),
getDateTrx(),
getC_Currency_ID(),
Msg.translate(getCtx(), "C_Payment_ID") + ": " + reversal.getDocumentNo(), get_TrxName());
alloc.setAD_Org_ID(getAD_Org_ID());
alloc.setDateAcct(dateAcct); // dateAcct variable already take into account the accrual parameter
alloc.saveEx(get_TrxName());
// Original Allocation

View File

@ -240,9 +240,6 @@ public class MPriceList extends X_M_PriceList
{
if (valid == null)
valid = new Timestamp (System.currentTimeMillis());
// Assume there is no later
if (m_plv != null && m_plv.getValidFrom().before(valid))
return m_plv;
final String whereClause = "M_PriceList_ID=? AND TRUNC(ValidFrom)<=?";
m_plv = new Query(getCtx(), I_M_PriceList_Version.Table_Name, whereClause, get_TrxName())

View File

@ -19,9 +19,10 @@ package org.compiere.model;
import java.sql.ResultSet;
import java.util.List;
import java.util.Properties;
import java.util.logging.Level;
import org.adempiere.exceptions.DBException;
import org.compiere.util.DB;
import org.compiere.util.Msg;
/**
* Product PO Model
@ -105,11 +106,12 @@ public class MProductPO extends X_M_Product_PO
)
)
{
if (isActive() && isCurrentVendor())
{
String sql = "UPDATE M_Product_PO SET IsCurrentVendor='N' WHERE IsActive='Y' AND IsCurrentVendor='Y' AND C_BPartner_ID!=? AND M_Product_ID=?";
int no = DB.executeUpdate(sql, new Object[] {getC_BPartner_ID(), getM_Product_ID()}, false, get_TrxName());
if (log.isLoggable(Level.FINEST)) log.finest("Updated M_Product_PO.IsCurrentVendor #" + no);
int cnt = DB.getSQLValue(get_TrxName(),
"SELECT COUNT(*) FROM M_Product_PO WHERE IsActive='Y' AND IsCurrentVendor='Y' AND C_BPartner_ID!=? AND M_Product_ID=?",
getC_BPartner_ID(), getM_Product_ID());
if (cnt > 0) {
log.saveError("SaveError", Msg.getMsg(getCtx(), DBException.SAVE_ERROR_NOT_UNIQUE_MSG, true) + Msg.getElement(getCtx(), COLUMNNAME_IsCurrentVendor));
return false;
}
}

View File

@ -0,0 +1,43 @@
/******************************************************************************
* Product: iDempiere ERP & CRM Smart Business Solution *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*****************************************************************************/
package org.compiere.process;
import org.adempiere.exceptions.AdempiereException;
import org.compiere.model.MTable;
import org.compiere.util.DB;
import org.compiere.util.Msg;
public class DatabaseViewDrop extends SvrProcess {
private int p_AD_Table_ID = 0;
@Override
protected void prepare()
{
p_AD_Table_ID = getRecord_ID();
}
@Override
protected String doIt() throws Exception
{
MTable table = new MTable(getCtx(), p_AD_Table_ID, get_TrxName());
log.info(table.toString());
if (!table.isView() || !table.isActive())
throw new AdempiereException(Msg.getMsg(getCtx(), "NotActiveDatabaseView"));
String sql = "DROP VIEW " + table.getTableName();
int rvalue = DB.executeUpdateEx(sql, get_TrxName());
return rvalue + " - " + sql;
}
} // DatabaseViewDrop

View File

@ -608,7 +608,7 @@ public final class DisplayType
if (fieldLength == 1)
return "CHAR(" + fieldLength + ")";
else
return "NVARCHAR2(" + fieldLength + ")";
return "VARCHAR2(" + fieldLength + ")";
}
if (displayType == DisplayType.Color) // this condition is never reached - filtered above in isID
{
@ -635,7 +635,7 @@ public final class DisplayType
if (!DisplayType.isText(displayType))
s_log.severe("Unhandled Data Type = " + displayType);
return "NVARCHAR2(" + fieldLength + ")";
return "VARCHAR2(" + fieldLength + ")";
} // getSQLDataType
/**

View File

@ -547,7 +547,7 @@ public final class EMail implements Serializable
try
{
m_from = new InternetAddress (newFrom, true);
if (MSysConfig.getBooleanValue(MSysConfig.MAIL_SEND_BCC_TO_FROM, false, Env.getAD_Client_ID(Env.getCtx())));
if (MSysConfig.getBooleanValue(MSysConfig.MAIL_SEND_BCC_TO_FROM, false, Env.getAD_Client_ID(Env.getCtx())))
addBcc(newFrom);
}
catch (Exception e)

View File

@ -1,3 +1,14 @@
/******************************************************************************
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*****************************************************************************/
package org.adempiere.pipo.srv;
import java.io.File;
@ -27,9 +38,26 @@ public class PipoDictionaryService implements IDictionaryService {
try {
PackIn packIn = new PackIn();
packIn.setPackageName(context.getBundle().getSymbolicName());
packIn.setPackageVersion((String) context.getBundle().getHeaders().get("Bundle-Version"));
//get package version from file name suffix or bundle header
String packageVersion = null;
String fileName = packageFile.getName();
int versionSeparatorPos = fileName.lastIndexOf("_");
if (versionSeparatorPos > 0) {
int dotPos = fileName.lastIndexOf(".");
if (dotPos > 0 && dotPos > versionSeparatorPos) {
String version = fileName.substring(versionSeparatorPos+1, dotPos);
if (version.split("[.]").length == 3) {
packageVersion = version;
}
}
}
//no version string from file name suffix, get it from bundle header
if (packageVersion == null)
packageVersion = (String) context.getBundle().getHeaders().get("Bundle-Version");
packIn.setPackageVersion(packageVersion);
packIn.setUpdateDictionary(false);
// packIn.setPackageDirectory(getPackageDir());
X_AD_Package_Imp_Proc adPackageImp = new X_AD_Package_Imp_Proc(Env.getCtx(),
0, trxName);

View File

@ -0,0 +1,307 @@
/******************************************************************************
* Copyright (C) 2013 Heng Sin Low *
* Copyright (C) 2013 Trek Global *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*****************************************************************************/
package org.adempiere.plugin.utils;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Enumeration;
import java.util.List;
import java.util.Properties;
import java.util.logging.Level;
import org.adempiere.base.IDictionaryService;
import org.adempiere.util.ServerContext;
import org.compiere.Adempiere;
import org.compiere.model.Query;
import org.compiere.model.ServerStateChangeEvent;
import org.compiere.model.ServerStateChangeListener;
import org.compiere.model.X_AD_Package_Imp;
import org.compiere.util.CLogger;
import org.compiere.util.Env;
import org.compiere.util.Trx;
import org.compiere.util.Util;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.util.tracker.ServiceTracker;
import org.osgi.util.tracker.ServiceTrackerCustomizer;
/**
*
* @author hengsin
*
*/
public class Incremental2PackActivator implements BundleActivator, ServiceTrackerCustomizer<IDictionaryService, IDictionaryService> {
protected final static CLogger logger = CLogger.getCLogger(Incremental2PackActivator.class.getName());
private BundleContext context;
private ServiceTracker<IDictionaryService, IDictionaryService> serviceTracker;
private IDictionaryService service;
@Override
public void start(BundleContext context) throws Exception {
this.context = context;
if (logger.isLoggable(Level.INFO)) logger.info(getName() + " " + getVersion() + " starting...");
serviceTracker = new ServiceTracker<IDictionaryService, IDictionaryService>(context, IDictionaryService.class.getName(), this);
serviceTracker.open();
start();
if (logger.isLoggable(Level.INFO)) logger.info(getName() + " " + getVersion() + " ready.");
}
public String getName() {
return context.getBundle().getSymbolicName();
}
public String getVersion() {
String version = (String) context.getBundle().getHeaders().get("Bundle-Version");
// e.g. 1.0.0.qualifier, check only the "1.0.0" part
String[] components = version.split("[.]");
StringBuilder versionBuilder = new StringBuilder(components[0]);
if (components.length >= 3) {
versionBuilder.append(".").append(components[1]).append(".").append(components[2]);
} else if (components.length == 2) {
versionBuilder.append(".").append(components[1]).append(".0");
} else {
versionBuilder.append(".0.0");
}
return versionBuilder.toString();
}
public String getDescription() {
return getName();
}
private void installPackage() {
String trxName = Trx.createTrxName();
try {
// e.g. 1.0.0.qualifier, check only the "1.0.0" part
String bundleVersionPart = getVersion();
String installedVersionPart = null;
String where = "Name=?";
Query q = new Query(Env.getCtx(), X_AD_Package_Imp.Table_Name,
where.toString(), null);
q.setParameters(new Object[] { getName() });
List<X_AD_Package_Imp> pkgs = q.list();
if (pkgs != null && !pkgs.isEmpty()) {
for(X_AD_Package_Imp pkg : pkgs) {
String packageVersionPart = pkg.getPK_Version();
String[] part = packageVersionPart.split("[.]");
if (installedVersionPart == null) {
if (part.length > 3) {
installedVersionPart = part[0]+"."+part[1]+"."+part[2];
} else {
installedVersionPart = packageVersionPart;
}
} else {
Version installedVersion = new Version(installedVersionPart);
if (part.length > 3) {
packageVersionPart = part[0]+"."+part[1]+"."+part[2];
}
Version packageVersion = new Version(packageVersionPart);
if (packageVersion.compareTo(installedVersion) > 0) {
installedVersionPart = packageVersionPart;
}
}
}
}
packIn(trxName, installedVersionPart, bundleVersionPart);
afterPackIn();
Trx.get(trxName, false).commit();
} finally {
if (Trx.get(trxName, false) != null) {
Trx.get(trxName, false).close();
}
}
}
private static class TwoPackEntry {
private URL url;
private String version;
private TwoPackEntry(URL url, String version) {
this.url=url;
this.version = version;
}
}
protected void packIn(String trxName, String installedVersionPart, String bundleVersionPart) {
List<TwoPackEntry> list = new ArrayList<TwoPackEntry>();
//2Pack_1.0.0.zip, 2Pack_1.0.1.zip, etc
Enumeration<URL> urls = context.getBundle().findEntries("/META-INF", "2Pack_*.zip", false);
Version bundleVersion = new Version(bundleVersionPart);
if (!Util.isEmpty(installedVersionPart)) {
Version installedVersion = new Version(installedVersionPart);
while(urls.hasMoreElements()) {
URL u = urls.nextElement();
String version = extractVersionString(u);
Version packageVersion = new Version(version);
if (packageVersion.compareTo(bundleVersion) <= 0 && packageVersion.compareTo(installedVersion) > 0)
list.add(new TwoPackEntry(u, version));
}
} else {
while(urls.hasMoreElements()) {
URL u = urls.nextElement();
String version = extractVersionString(u);
Version packageVersion = new Version(version);
if (packageVersion.compareTo(bundleVersion) <= 0)
list.add(new TwoPackEntry(u, version));
}
}
Collections.sort(list, new Comparator<TwoPackEntry>() {
@Override
public int compare(TwoPackEntry o1, TwoPackEntry o2) {
return new Version(o1.version).compareTo(new Version(o2.version));
}
});
for(TwoPackEntry entry : list) {
packIn(trxName, entry.url);
}
}
private String extractVersionString(URL u) {
String p = u.getPath();
int upos=p.lastIndexOf("_");
int dpos=p.lastIndexOf(".");
String v = p.substring(upos+1, dpos);
return v;
}
protected void packIn(String trxName, URL packout) {
if (packout != null && service != null) {
String path = packout.getPath();
String suffix = path.substring(path.lastIndexOf("_"));
System.out.println("Installing " + getName() + " " + path + " ...");
FileOutputStream zipstream = null;
try {
// copy the resource to a temporary file to process it with 2pack
InputStream stream = packout.openStream();
File zipfile = File.createTempFile(getName(), suffix);
zipstream = new FileOutputStream(zipfile);
byte[] buffer = new byte[1024];
int read;
while((read = stream.read(buffer)) != -1){
zipstream.write(buffer, 0, read);
}
// call 2pack
service.merge(context, zipfile);
} catch (Throwable e) {
logger.log(Level.SEVERE, "Pack in failed.", e);
} finally{
if (zipstream != null) {
try {
zipstream.close();
} catch (Exception e2) {}
}
}
System.out.println(getName() + " " + packout.getPath() + " installed");
}
}
protected BundleContext getContext() {
return context;
}
protected void setContext(BundleContext context) {
this.context = context;
}
@Override
public void stop(BundleContext context) throws Exception {
stop();
serviceTracker.close();
this.context = null;
if (logger.isLoggable(Level.INFO)) logger.info(context.getBundle().getSymbolicName() + " "
+ context.getBundle().getHeaders().get("Bundle-Version")
+ " stopped.");
}
protected void afterPackIn() {
};
/**
* call when bundle have been started ( after this.context have been set )
*/
protected void start() {
};
/**
* call when bundle is stop ( before this.context is set to null )
*/
protected void stop() {
}
@Override
public IDictionaryService addingService(
ServiceReference<IDictionaryService> reference) {
service = context.getService(reference);
if (Adempiere.getThreadPoolExecutor() != null) {
Adempiere.getThreadPoolExecutor().execute(new Runnable() {
@Override
public void run() {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(Incremental2PackActivator.class.getClassLoader());
setupPackInContext();
installPackage();
} finally {
ServerContext.dispose();
service = null;
Thread.currentThread().setContextClassLoader(cl);
}
}
});
} else {
Adempiere.addServerStateChangeListener(new ServerStateChangeListener() {
@Override
public void stateChange(ServerStateChangeEvent event) {
if (event.getEventType() == ServerStateChangeEvent.SERVER_START && service != null) {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(Incremental2PackActivator.class.getClassLoader());
setupPackInContext();
installPackage();
} finally {
ServerContext.dispose();
service = null;
Thread.currentThread().setContextClassLoader(cl);
}
}
}
});
}
return null;
}
@Override
public void modifiedService(ServiceReference<IDictionaryService> reference,
IDictionaryService service) {
}
@Override
public void removedService(ServiceReference<IDictionaryService> reference,
IDictionaryService service) {
}
protected void setupPackInContext() {
Properties serverContext = new Properties();
ServerContext.setCurrentInstance(serverContext);
};
}

View File

@ -0,0 +1,66 @@
/******************************************************************************
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*****************************************************************************/
package org.adempiere.plugin.utils;
/**
*
* @author hengsin
*
*/
public class Version implements Comparable<Version> {
private String version;
public final String get() {
return this.version;
}
public Version(String version) {
if(version == null)
throw new IllegalArgumentException("Version can not be null");
if(!version.matches("[0-9]+(\\.[0-9]+)*"))
throw new IllegalArgumentException("Invalid version format");
this.version = version;
}
@Override
public int compareTo(Version that) {
if(that == null)
return 1;
String[] thisParts = this.get().split("\\.");
String[] thatParts = that.get().split("\\.");
int length = Math.max(thisParts.length, thatParts.length);
for(int i = 0; i < length; i++) {
int thisPart = i < thisParts.length ?
Integer.parseInt(thisParts[i]) : 0;
int thatPart = i < thatParts.length ?
Integer.parseInt(thatParts[i]) : 0;
if(thisPart < thatPart)
return -1;
if(thisPart > thatPart)
return 1;
}
return 0;
}
@Override
public boolean equals(Object that) {
if(this == that)
return true;
if(that == null)
return false;
if(this.getClass() != that.getClass())
return false;
return this.compareTo((Version) that) == 0;
}
}

View File

@ -64,6 +64,11 @@ public final class Attachment extends CDialog
*/
private static final long serialVersionUID = 2497487523050526742L;
/**
* Save the last path selected
*/
private static String lastPath = null;
/**
* Constructor.
* loads Attachment, if ID <> 0
@ -424,7 +429,8 @@ public final class Attachment extends CDialog
private void loadFile()
{
log.info("");
JFileChooser chooser = new JFileChooser();
JFileChooser chooser = new JFileChooser(lastPath);
chooser.setDialogType(JFileChooser.OPEN_DIALOG);
chooser.setDialogTitle(Msg.getMsg(Env.getCtx(), "AttachmentNew"));
chooser.setMultiSelectionEnabled(true);
@ -463,6 +469,10 @@ public final class Attachment extends CDialog
}
}
}
// Save path of file
if (files.length>0) {
lastPath = files[0].getParentFile().getAbsolutePath();
}
} // getFileName
/**

View File

@ -391,7 +391,7 @@ public class VFileImport extends CPanel
for (int i = 0; i < size; i++)
{
ImpFormatRow row = m_format.getRow(i);
m_labels[i] = new JLabel (row.getColumnName());
m_labels[i] = new JLabel (row.getName());
previewPanel.add(m_labels[i], new GridBagConstraints(i, 0, 1, 1, 1.0, 1.0,
GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(2, 2, 2, 2), 0, 0));
//

View File

@ -213,11 +213,6 @@ public class VLocationDialog extends CDialog
private boolean inCountryAction;
private boolean inOKAction;
/** The "route" key */
private static final String TO_ROUTE = Msg.getMsg(Env.getCtx(), "Route");
/** The "to link" key */
private static final String TO_LINK = Msg.getMsg(Env.getCtx(), "Map");
private JButton toLink = new JButton();
private JButton toRoute = new JButton();
@ -246,14 +241,14 @@ public class VLocationDialog extends CDialog
southPanel.add(confirmPanel, BorderLayout.NORTH);
//BEGIN fernandinho/ricardo
toLink.setText(TO_LINK);
toLink.setText(Msg.getMsg(Env.getCtx(), "Map"));
toLink.addActionListener(this);
toLink.setMargin(ConfirmPanel.s_insets);
confirmPanel.addComponent(toLink);
if (MLocation.LOCATION_MAPS_URL_PREFIX == null)
toLink.setVisible(false);
toRoute.setText(TO_ROUTE);
toRoute.setText(Msg.getMsg(Env.getCtx(), "Route"));
toRoute.addActionListener(this);
toRoute.setMargin(ConfirmPanel.s_insets);
confirmPanel.addComponent(toRoute);

View File

@ -108,6 +108,7 @@ import org.zkoss.zk.ui.util.Clients;
import org.zkoss.zul.Column;
import org.zkoss.zul.Columns;
import org.zkoss.zul.Div;
import org.zkoss.zul.Grid;
import org.zkoss.zul.Menuitem;
import org.zkoss.zul.Menupopup;
import org.zkoss.zul.Window.Mode;
@ -1668,9 +1669,42 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
*/
public void onRefresh()
{
GridTab gridTab = adTabbox.getSelectedGridTab();
if (gridTab != null && gridTab.getTableModel() != null)
{
gridTab.getTableModel().resetCacheSortState();
}
Column sortColumn = findCurrentSortColumn();
onRefresh(true, false);
if (sortColumn != null)
{
sortColumn.setSortDirection("natural");
}
}
private Column findCurrentSortColumn() {
IADTabpanel iadtabpanel = getADTab().getSelectedTabpanel();
if (iadtabpanel instanceof ADTabpanel) {
ADTabpanel adtabpanel = (ADTabpanel) iadtabpanel;
Grid grid = adtabpanel.getGridView().getListbox();
Columns columns = grid.getColumns();
if (columns != null) {
List<?> list = columns.getChildren();
for(int i = 0; i < list.size(); i++)
{
Component c = (Component) list.get(i);
if (c instanceof Column) {
Column column = (Column) c;
if (!"natural".equals(column.getSortDirection())) {
return column;
}
}
}
}
}
return null;
}
/**
* @see ToolbarListener#onHelp()
*/
@ -2766,7 +2800,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
if (Executions.getCurrent() != null)
{
if (notPrint) // refresh if not print
if (notPrint || pi.isError()) // show process info if it is not print or have error
{
updateUI(pi);
}
@ -2777,7 +2811,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
//acquire desktop, 2 second timeout
Executions.activate(getComponent().getDesktop(), 2000);
try {
if (notPrint) // refresh if not print
if (notPrint || pi.isError()) // show process info if it is not print or have error
{
updateUI(pi);
}

View File

@ -282,7 +282,8 @@ public class ProcessParameterPanel extends Panel implements
Row row = new Row();
// The Editor
WEditor editor = WebEditorFactory.getEditor(mField, false);
WEditor editor = WebEditorFactory.getEditor(mField, false);
editor.setProcessParameter(true);
editor.getComponent().addEventListener(Events.ON_FOCUS, this);
editor.getComponent().addEventListener(Events.ON_BLUR, this);
editor.addValueChangeListener(this);
@ -337,6 +338,7 @@ public class ProcessParameterPanel extends Panel implements
m_mFields2.add(mField2);
// The Editor
WEditor editor2 = WebEditorFactory.getEditor(mField2, false);
editor2.setProcessParameter(true);
//override attribute
editor2.getComponent().setWidgetAttribute("columnName", mField2.getColumnName()+"_To");
editor2.getComponent().addEventListener(Events.ON_FOCUS, this);

View File

@ -367,7 +367,11 @@ public class WCreateFromShipmentUI extends CreateFromShipment implements EventLi
// BPartner - load Order/Invoice/Shipment
if (e.getPropertyName().equals("C_BPartner_ID"))
{
int C_BPartner_ID = ((Integer)e.getNewValue()).intValue();
int C_BPartner_ID = 0;
if (e.getNewValue() != null){
C_BPartner_ID = ((Integer)e.getNewValue()).intValue();
}
initBPOrderDetails (C_BPartner_ID, true);
}
window.tableChanged(null);

View File

@ -487,7 +487,7 @@ public class WFileImport extends ADForm implements EventListener<Event>
{
ImpFormatRow row = m_format.getRow(i);
m_labels[i] = new Label(row.getColumnName());
m_labels[i] = new Label(row.getName());
Hbox hbox = new Hbox();
hbox.setAlign("center");

View File

@ -14,6 +14,7 @@ public class WViewPI extends ADForm {
this.setSclass("window-view-pi");
WPerformanceIndicator.Options options = new WPerformanceIndicator.Options();
WPAPanel paPanel = WPAPanel.get(options);
appendChild(paPanel);
if (paPanel != null)
appendChild(paPanel);
}
}

View File

@ -91,6 +91,8 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
protected WEditorPopupMenu popupMenu;
private boolean tableEditor;
private boolean isProcessParameter;
public WEditor(Component comp, GridField gridField) {
this(comp, gridField, -1);
@ -208,7 +210,8 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
label = new Label("");
label.setValue(strLabel);
label.setTooltiptext(description);
label.setMandatory(mandatory);
this.setMandatory (mandatory);
if (readOnly || !updateable)
@ -546,7 +549,7 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
}
public boolean isMandatoryStyle() {
return mandatory && !readOnly && getGridField().isEditable(true) && isNullOrEmpty();
return mandatory && !readOnly && (isProcessParameter || getGridField().isEditable(true)) && isNullOrEmpty();
}
public boolean isNullOrEmpty() {
@ -632,6 +635,14 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
}
return false;
}
public boolean isProcessParameter() {
return isProcessParameter;
}
public void setProcessParameter(boolean isProcessParameter) {
this.isProcessParameter = isProcessParameter;
}
private static final String STYLE_ZOOMABLE_LABEL = "cursor: pointer; text-decoration: underline;";
private static final String STYLE_NORMAL_LABEL = "color: #333;";

View File

@ -21,6 +21,7 @@ import org.zkoss.zhtml.Script;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zk.ui.util.Clients;
import org.zkoss.zul.Borderlayout;
import org.zkoss.zul.Center;
import org.zkoss.zul.Div;
@ -143,6 +144,7 @@ public class TimeoutPanel extends Window implements
timer.stop();
SessionManager.logoutSession();
Executions.sendRedirect("/index.zul");
Clients.confirmClose(null);
}
}
}

View File

@ -230,51 +230,57 @@ public class WGadgets extends Window implements EventListener<Event>{
{
Properties ctx = Env.getCtx();
int AD_CLient_ID =Env.getAD_Client_ID(ctx);
int AD_Client_ID =Env.getAD_Client_ID(ctx);
int AD_Role_ID = Env.getAD_Role_ID(ctx);
int AD_User_ID = Env.getAD_User_ID(ctx);
noItems.removeAll(noItems);
yesItems.removeAll(yesItems);
String query = " SELECT ct.PA_DashboardContent_ID, ct.Name "
+" FROM PA_DashboardContent ct"
+" WHERE ct.AD_Client_ID IN (0,?)"
+" AND ct.IsActive='Y'"
+" AND ct.PA_DashboardContent_ID NOT IN ("
+" SELECT pre.PA_DashboardContent_ID"
+" FROM PA_DashboardPreference pre"
+" WHERE pre.AD_Client_ID IN (0,?)"
+" AND pre.AD_Role_ID = ?"
+" AND pre.AD_User_ID = ?"
+" AND pre.AD_Org_ID=0 "
+" AND pre.IsActive='Y') "
+" AND ("
+" ct.PA_DashboardContent_ID NOT IN ( SELECT PA_DashboardContent_ID "
+" FROM PA_DashboardContent_Access"
+" WHERE IsActive='Y' AND AD_Client_ID IN (0, ?))"
+" OR ct.PA_DashboardContent_ID IN ( SELECT cta.PA_DashboardContent_ID "
+" FROM PA_DashboardContent_Access cta "
+" WHERE cta.IsActive='Y'"
+" AND coalesce(cta.AD_Role_ID, ?) = ?"
+" AND coalesce(cta.AD_User_ID, ?) = ?"
+" AND cta.AD_Client_ID in (0,?) ) "
+" )";
String query = ""
+ "SELECT ct.PA_DashboardContent_ID, "
+ " ct.Name "
+ "FROM PA_DashboardContent ct "
+ "WHERE ct.AD_Client_ID IN ( 0, ? ) "
+ " AND ct.IsActive = 'Y' "
+ " AND ct.PA_DashboardContent_ID NOT IN (SELECT pre.PA_DashboardContent_ID "
+ " FROM PA_DashboardPreference pre "
+ " WHERE pre.AD_Client_ID IN ( 0, ? ) "
+ " AND pre.AD_Role_ID = ? "
+ " AND pre.AD_User_ID = ? "
+ " AND pre.AD_Org_ID = 0 "
+ " AND pre.IsActive = 'Y') "
+ " AND ( ct.PA_DashboardContent_ID NOT IN (SELECT cta.PA_DashboardContent_ID "
+ " FROM PA_DashboardContent_Access cta "
+ " WHERE cta.IsActive = 'N' "
+ " AND COALESCE(cta.AD_Role_ID, ?) = ? "
+ " AND COALESCE(cta.AD_User_ID, ?) = ? "
+ " AND cta.AD_Client_ID IN ( 0, ? )) "
+ " OR ct.PA_DashboardContent_ID IN (SELECT cta.PA_DashboardContent_ID "
+ " FROM PA_DashboardContent_Access cta "
+ " WHERE cta.IsActive = 'Y' "
+ " AND COALESCE(cta.AD_Role_ID, ?) = ? "
+ " AND COALESCE(cta.AD_User_ID, ?) = ? "
+ " AND cta.AD_Client_ID IN ( 0, ? )) ) ";
ResultSet rs = null;
PreparedStatement pstmt = null;
try {
pstmt = DB.prepareStatement(query, null);
pstmt.setInt(1, AD_CLient_ID);
pstmt.setInt(2, AD_CLient_ID);
pstmt.setInt(1, AD_Client_ID);
pstmt.setInt(2, AD_Client_ID);
pstmt.setInt(3, AD_Role_ID);
pstmt.setInt(4, AD_User_ID);
pstmt.setInt(5, AD_CLient_ID);
pstmt.setInt(5, AD_Role_ID);
pstmt.setInt(6, AD_Role_ID);
pstmt.setInt(7, AD_Role_ID);
pstmt.setInt(7, AD_User_ID);
pstmt.setInt(8, AD_User_ID);
pstmt.setInt(9, AD_User_ID);
pstmt.setInt(10, AD_CLient_ID);
pstmt.setInt(9, AD_Client_ID);
pstmt.setInt(10, AD_Role_ID);
pstmt.setInt(11, AD_Role_ID);
pstmt.setInt(12, AD_User_ID);
pstmt.setInt(13, AD_User_ID);
pstmt.setInt(14, AD_Client_ID);
rs = pstmt.executeQuery();
while (rs.next()) {
@ -298,7 +304,7 @@ public class WGadgets extends Window implements EventListener<Event>{
+" AND IsActive='Y'";
Query query1 =new Query(ctx,MDashboardPreference.Table_Name, where, null);
query1.setParameters(new Object[]{AD_User_ID,AD_Role_ID ,AD_CLient_ID});
query1.setParameters(new Object[]{AD_User_ID,AD_Role_ID ,AD_Client_ID});
List<MDashboardPreference> preference=query1.list();
if(preference.size() > 0){

View File

@ -137,11 +137,6 @@ public class WLocationDialog extends Window implements EventListener<Event>
private boolean inCountryAction;
private boolean inOKAction;
/** The "route" key */
private static final String TO_ROUTE = Msg.getMsg(Env.getCtx(), "Route");
/** The "to link" key */
private static final String TO_LINK = Msg.getMsg(Env.getCtx(), "Map");
private Button toLink;
private Button toRoute;
@ -277,10 +272,10 @@ public class WLocationDialog extends Window implements EventListener<Event>
confirmPanel = new ConfirmPanel(true);
confirmPanel.addActionListener(this);
toLink = new Button(TO_LINK);
toLink = new Button(Msg.getMsg(Env.getCtx(), "Map"));
LayoutUtils.addSclass("txt-btn", toLink);
toLink.addEventListener(Events.ON_CLICK,this);
toRoute = new Button(TO_ROUTE);
toRoute = new Button(Msg.getMsg(Env.getCtx(), "Route"));
LayoutUtils.addSclass("txt-btn", toRoute);
toRoute.addEventListener(Events.ON_CLICK,this);

View File

@ -43,6 +43,7 @@ import org.adempiere.webui.component.Window;
import org.compiere.model.MLocator;
import org.compiere.model.MLocatorLookup;
import org.compiere.model.MRole;
import org.compiere.util.AdempiereUserError;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;
@ -303,6 +304,19 @@ public class WLocatorDialog extends Window implements EventListener<Event>
if (log.isLoggable(Level.FINE)) log.fine(m_mLocator.toString());
if (m_mLocator.getSize()==0)
{
throw new AdempiereUserError(Msg.getMsg(Env.getCtx(), "DRP-001", false));
}
else if (m_mLocator.getSize()==1)
{
MLocator locator = (MLocator) m_mLocator.getElementAt(0);
if (locator == null || locator.getM_Locator_ID() <= 0)
{
throw new AdempiereUserError(Msg.getMsg(Env.getCtx(), "DRP-001", false));
}
}
for (int i = 0; i < m_mLocator.getSize(); i++)
{
Object obj = m_mLocator.getElementAt(i);
@ -552,7 +566,7 @@ public class WLocatorDialog extends Window implements EventListener<Event>
if (m_change)
{
ListItem listitem = lstLocator.getSelectedItem();
MLocator l = (MLocator)listitem.getValue();
MLocator l = listitem != null ? (MLocator)listitem.getValue() : null;
if (l != null)
return l.getM_Locator_ID() == m_M_Locator_ID;